@mappedin/mappedin-js 6.0.0-alpha.3 → 6.0.0-alpha.4
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.js +1 -1
- package/lib/esm/navigator/index.js +1 -1
- package/lib/esm/renderer/{browser-BJWJW3K3.js → browser-BSXGVGOV.js} +1 -1
- package/lib/esm/renderer/chunk-3HR2E7UG.js +1 -0
- package/lib/esm/renderer/index.js +1 -1
- package/lib/mappedin.js +1 -1
- package/lib/node/index.js +1 -1
- package/package.json +3 -2
- package/lib/esm/renderer/chunk-2SPGYHVG.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var M,Ou=Object.create,Ma=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,Au=Object.getOwnPropertyNames,Nu=Object.getPrototypeOf,Eu=Object.prototype.hasOwnProperty,Su=(e,t,n)=>t in e?Ma(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mi=(e,t)=>()=>(e&&(t=e(e=0)),t),D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Pu=(e,t)=>{for(var n in t)Ma(e,n,{get:t[n],enumerable:!0})},Fu=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of Au(t))!Eu.call(e,i)&&i!==n&&Ma(e,i,{get:()=>t[i],enumerable:!(r=zu(t,i))||r.enumerable});return e},Yn=(e,t,n)=>(n=null!=e?Ou(Nu(e)):{},Fu(!t&&e&&e.__esModule?n:Ma(n,"default",{value:e,enumerable:!0}),e)),ye=(e,t,n)=>(Su(e,"symbol"!=typeof t?t+"":t,n),n),wi=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},N=(e,t,n)=>(wi(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Y=(e,t,n,r)=>(wi(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),h=Mi((()=>{M={env:{NODE_ENV:"production",npm_package_version:"6.0.0-alpha.3"}}})),xi=D(((e,t)=>{h(),function(n){var r="object"==typeof e&&e,i="object"==typeof t&&t&&t.exports==r&&t,a="object"==typeof global&&global;(a.global===a||a.window===a)&&(n=a);var s=function(e){this.message=e};(s.prototype=new Error).name="InvalidCharacterError";var o=function(e){throw new s(e)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&o("The string to be encoded contains characters outside of the Latin1 range.");for(var t,n,r,i,a=e.length%3,s="",u=-1,h=e.length-a;++u<h;)t=e.charCodeAt(u)<<16,n=e.charCodeAt(++u)<<8,r=e.charCodeAt(++u),s+=l.charAt((i=t+n+r)>>18&63)+l.charAt(i>>12&63)+l.charAt(i>>6&63)+l.charAt(63&i);return 2==a?(t=e.charCodeAt(u)<<8,n=e.charCodeAt(++u),s+=l.charAt((i=t+n)>>10)+l.charAt(i>>4&63)+l.charAt(i<<2&63)+"="):1==a&&(i=e.charCodeAt(u),s+=l.charAt(i>>2)+l.charAt(i<<4&63)+"=="),s},decode:function(e){var t=(e=String(e).replace(u,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&o("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,a="",s=-1;++s<t;)r=l.indexOf(e.charAt(s)),n=i%4?64*n+r:r,i++%4&&(a+=String.fromCharCode(255&n>>(-2*i&6)));return a},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return h}));else if(r&&!r.nodeType)if(i)i.exports=h;else for(var c in h)h.hasOwnProperty(c)&&(r[c]=h[c]);else n.base64=h}(e)})),oe=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.areaConversion=e.timeConversion=e.distanceConversion=e.altitudeKeys=e.latitudeKeys=e.longitudeKeys=e.MAXLON=e.MINLON=e.MAXLAT=e.MINLAT=e.earthRadius=e.sexagesimalPattern=void 0;e.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;e.earthRadius=6378137;e.MINLAT=-90;e.MAXLAT=90;e.MINLON=-180;e.MAXLON=180;e.longitudeKeys=["lng","lon","longitude",0];e.latitudeKeys=["lat","latitude",1];e.altitudeKeys=["alt","altitude","elevation","elev",2];e.distanceConversion={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};e.timeConversion={m:60,h:3600,d:86400};var t={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};e.areaConversion=t,t.sqm=t.m2,t.sqkm=t.km2,t.sqft=t.ft2,t.sqyd=t.yd2,t.sqin=t.in2})),Kt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e,t){return t.reduce((function(t,n){if(typeof e>"u"||null===e)throw new Error("'".concat(e,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(e,n)&&typeof n<"u"&&typeof t>"u"?(t=n,n):t}),void 0)};e.default=t})),Zt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){var t=e.toString().trim();return!isNaN(parseFloat(t))&&parseFloat(t)===Number(t)};e.default=t})),Qt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){return t.sexagesimalPattern.test(e.toString().trim())};e.default=n})),ea=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=new RegExp(t.sexagesimalPattern).exec(e);if(typeof n>"u"||null===n)throw new Error("Given value is not in sexagesimal format");var r=Number(n[2])/60||0,i=Number(n[4])/3600||0,a=parseFloat(n[1])+r+i;return["S","W"].includes(n[7])?-a:a};e.default=n})),Oa=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=oe(),r=(t=Kt())&&t.__esModule?t:{default:t};function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:n.longitudeKeys,latitude:n.latitudeKeys,altitude:n.altitudeKeys},i=(0,r.default)(e,t.longitude),s=(0,r.default)(e,t.latitude),o=(0,r.default)(e,t.altitude);return a({latitude:s,longitude:i},o?{altitude:o}:{})};e.default=o})),Zn=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(Zt()),n=a(Qt()),r=a(ea()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function e(a){return(0,t.default)(a)?!(parseFloat(a)>i.MAXLAT||a<i.MINLAT):!!(0,n.default)(a)&&e((0,r.default)(a))};e.default=s})),er=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(Zt()),n=a(Qt()),r=a(ea()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function e(a){return(0,t.default)(a)?!(parseFloat(a)>i.MAXLON||a<i.MINLON):!!(0,n.default)(a)&&e((0,r.default)(a))};e.default=s})),ar=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(Oa()),n=i(Zn()),r=i(er());function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var i=(0,t.default)(e),a=i.latitude,s=i.longitude;if(Array.isArray(e)&&e.length>=2)return(0,r.default)(e[0])&&(0,n.default)(e[1]);if(typeof a>"u"||typeof s>"u")return!1;var o=e[s],l=e[a];return!(typeof l>"u"||typeof o>"u"||!1===(0,n.default)(l)||!1===(0,r.default)(o))};e.default=a})),Sa=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(Zt()),n=s(Qt()),r=s(ea()),i=s(ar()),a=s(Oa());function s(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=function e(s){if((0,t.default)(s))return Number(s);if((0,n.default)(s))return(0,r.default)(s);if((0,i.default)(s)){var o=(0,a.default)(s);return Array.isArray(s)?s.map((function(t,n){return[0,1].includes(n)?e(t):t})):l(l(l({},s),o.latitude&&u({},o.latitude,e(s[o.latitude]))),o.longitude&&u({},o.longitude,e(s[o.longitude])))}return Array.isArray(s)?s.map((function(t){return(0,i.default)(t)?e(t):t})):s};e.default=c})),_e=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=i(Kt()),r=i(Sa());function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e,i){var a=(0,n.default)(e,t.latitudeKeys);if(!(typeof a>"u"||null===a)){var s=e[a];return!0===i?s:(0,r.default)(s)}};e.default=a})),je=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=i(Kt()),r=i(Sa());function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e,i){var a=(0,n.default)(e,t.longitudeKeys);if(!(typeof a>"u"||null===a)){var s=e[a];return!0===i?s:(0,r.default)(s)}};e.default=a})),De=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return e*Math.PI/180};e.default=t})),dt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return 180*e/Math.PI};e.default=t})),Pi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(_e()),n=s(je()),r=s(De()),i=s(dt()),a=oe();function s(e){return e&&e.__esModule?e:{default:e}}var o=function(e,s,o){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,t.default)(e),h=(0,n.default)(e),c=s/l,d=(0,r.default)(o),f=(0,r.default)(u),p=(0,r.default)(h),g=Math.asin(Math.sin(f)*Math.cos(c)+Math.cos(f)*Math.sin(c)*Math.cos(d)),y=p+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(g)),m=(0,i.default)(y);return(m<a.MINLON||m>a.MAXLON)&&(y=(y+3*Math.PI)%(2*Math.PI)-Math.PI,m=(0,i.default)(y)),{latitude:(0,i.default)(g),longitude:m}};e.default=o})),Fi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=t.areaConversion[n];if(r)return e*r;throw new Error("Invalid unit used for area conversion.")};e.default=n})),Di=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=t.distanceConversion[n];if(r)return e*r;throw new Error("Invalid unit used for distance conversion.")};e.default=n})),Li=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(n){case"kmh":return e*t.timeConversion.h*t.distanceConversion.km;case"mph":return e*t.timeConversion.h*t.distanceConversion.mi;default:return e}};e.default=n})),Bi=D((e=>{"use strict";function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&null!=o.return&&o.return()}finally{if(i)throw a}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}}(e,t)||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 n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(e){var t=Math.pow(10,12);return Math.round(e*t)/t},i=function(e){var n=t(e.toString().split("."),2),i=n[0],a=n[1],s=Math.abs(Number(i)),o=r(60*Number("0."+(a||0))),l=Math.floor(o),u=r(60*(o%l||0));return s+"° "+Number(l.toFixed(6)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+"' "+Number(u.toFixed(4)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+'"'};e.default=i})),sr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return e>1?1:e<-1?-1:e};e.default=t})),Ke=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(_e()),n=s(je()),r=s(De()),i=s(sr()),a=oe();function s(e){return e&&e.__esModule?e:{default:e}}var o=function(e,s){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;o=typeof o<"u"&&!isNaN(o)?o:1;var l=(0,t.default)(e),u=(0,n.default)(e),h=(0,t.default)(s),c=(0,n.default)(s),d=Math.acos((0,i.default)(Math.sin((0,r.default)(h))*Math.sin((0,r.default)(l))+Math.cos((0,r.default)(h))*Math.cos((0,r.default)(l))*Math.cos((0,r.default)(u)-(0,r.default)(c))))*a.earthRadius;return Math.round(d/o)*o};e.default=o})),ur=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default;return r="function"==typeof r?r:n.default,t.slice().sort((function(t,n){return r(e,t)-r(e,n)}))};e.default=r})),Vi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=ur())&&t.__esModule?t:{default:t};var r=function(e,t){return(0,n.default)(e,t)[0]};e.default=r})),Hi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(De()),n=a(_e()),r=a(je()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){var a=0;if(e.length>2){for(var s,o,l,u=0;u<e.length;u++){u===e.length-2?(s=e.length-2,o=e.length-1,l=0):u===e.length-1?(s=e.length-1,o=0,l=1):(s=u,o=u+1,l=u+2);var h=(0,r.default)(e[s]),c=(0,n.default)(e[o]),d=(0,r.default)(e[l]);a+=((0,t.default)(d)-(0,t.default)(h))*Math.sin((0,t.default)(c))}a=a*i.earthRadius*i.earthRadius/2}return Math.abs(a)};e.default=s})),dr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(_e()),n=r(je());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e){if(!1===Array.isArray(e)||0===e.length)throw new Error("No points were given.");return e.reduce((function(e,r){var i=(0,t.default)(r),a=(0,n.default)(r);return{maxLat:Math.max(i,e.maxLat),minLat:Math.min(i,e.minLat),maxLng:Math.max(a,e.maxLng),minLng:Math.min(a,e.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})};e.default=i})),Xi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(_e()),n=s(je()),r=s(De()),i=s(dt()),a=oe();function s(e){return e&&e.__esModule?e:{default:e}}var o=function(e,s){var o,l,u=(0,t.default)(e),h=(0,n.default)(e),c=(0,r.default)(u),d=(0,r.default)(h),f=s/a.earthRadius,p=c-f,g=c+f,y=(0,r.default)(a.MAXLAT),m=(0,r.default)(a.MINLAT),v=(0,r.default)(a.MAXLON),_=(0,r.default)(a.MINLON);if(p>m&&g<y){var w=Math.asin(Math.sin(f)/Math.cos(c));(o=d-w)<_&&(o+=2*Math.PI),(l=d+w)>v&&(l-=2*Math.PI)}else p=Math.max(p,m),g=Math.min(g,y),o=_,l=v;return[{latitude:(0,i.default)(p),longitude:(0,i.default)(o)},{latitude:(0,i.default)(g),longitude:(0,i.default)(l)}]};e.default=o})),Zi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=a(dt());function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){if(!1===Array.isArray(e)||0===e.length)return!1;var a=e.length,s=e.reduce((function(e,i){var a=(0,r.default)((0,t.default)(i)),s=(0,r.default)((0,n.default)(i));return{X:e.X+Math.cos(a)*Math.cos(s),Y:e.Y+Math.cos(a)*Math.sin(s),Z:e.Z+Math.sin(a)}}),{X:0,Y:0,Z:0}),o=s.X/a,l=s.Y/a,u=s.Z/a;return{longitude:(0,i.default)(Math.atan2(l,o)),latitude:(0,i.default)(Math.atan2(u,Math.sqrt(o*o+l*l)))}};e.default=s})),Qi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=dr())&&t.__esModule?t:{default:t};var r=function(e){var t=(0,n.default)(e),r=t.minLat+(t.maxLat-t.minLat)/2,i=t.minLng+(t.maxLng-t.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(i.toFixed(6))}};e.default=r})),pr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=a(dt());function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,a){var s=(0,r.default)((0,n.default)(a))-(0,r.default)((0,n.default)(e)),o=Math.log(Math.tan((0,r.default)((0,t.default)(a))/2+Math.PI/4)/Math.tan((0,r.default)((0,t.default)(e))/2+Math.PI/4));return Math.abs(s)>Math.PI&&(s=s>0?-1*(2*Math.PI-s):2*Math.PI+s),((0,i.default)(Math.atan2(s,o))+360)%360};e.default=s})),no=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=pr())&&t.__esModule?t:{default:t};var r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,i="function"==typeof r?r(e,t):(0,n.default)(e,t);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"}};e.default=r})),mr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(Ke()),n=r(sr());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e,r,i){var a=(0,t.default)(r,e),s=(0,t.default)(e,i),o=(0,t.default)(r,i),l=Math.acos((0,n.default)((a*a+o*o-s*s)/(2*a*o))),u=Math.acos((0,n.default)((s*s+o*o-a*a)/(2*s*o)));return l>Math.PI/2?a:u>Math.PI/2?s:Math.sin(l)*a};e.default=i})),uo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=a(dt());function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,a){var s=(0,t.default)(a),o=(0,n.default)(a),l=(0,t.default)(e),u=(0,n.default)(e);return((0,i.default)(Math.atan2(Math.sin((0,r.default)(o)-(0,r.default)(u))*Math.cos((0,r.default)(s)),Math.cos((0,r.default)(l))*Math.sin((0,r.default)(s))-Math.sin((0,r.default)(l))*Math.cos((0,r.default)(s))*Math.cos((0,r.default)(o)-(0,r.default)(u))))+360)%360};e.default=s})),lo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.default;return e.reduce((function(e,n){return"object"===r(e)&&null!==e.last&&(e.distance+=t(n,e.last)),e.last=n,e}),{last:null,distance:0}).distance};e.default=i})),mo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,a){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=typeof s<"u"&&!isNaN(s)?s:1;var o,l,u,h,c,d,f,p=(0,t.default)(e),g=(0,n.default)(e),y=(0,t.default)(a),m=(0,n.default)(a),v=6356752.314245,_=1/298.257223563,w=(0,r.default)(m-g),M=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(p)))),b=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(y)))),x=Math.sin(M),O=Math.cos(M),E=Math.sin(b),N=Math.cos(b),A=w,I=100;do{var k=Math.sin(A),T=Math.cos(A);if(0===(d=Math.sqrt(N*k*(N*k)+(O*E-x*N*T)*(O*E-x*N*T))))return 0;o=x*E+O*N*T,l=Math.atan2(d,o),c=o-2*x*E/(h=1-(u=O*N*k/d)*u),isNaN(c)&&(c=0);var S=_/16*h*(4+_*(4-3*h));f=A,A=w+(1-S)*_*u*(l+S*d*(c+S*o*(2*c*c-1)))}while(Math.abs(A-f)>1e-12&&--I>0);if(0===I)return NaN;var F=h*(i.earthRadius*i.earthRadius-v*v)/(v*v),D=1+F/16384*(4096+F*(F*(320-175*F)-768)),P=F/1024*(256+F*(F*(74-47*F)-128)),j=P*d*(c+P/4*(o*(2*c*c-1)-P/6*c*(4*d*d-3)*(4*c*c-3))),B=v*D*(l-j);return Math.round(B/s)*s};e.default=s})),fo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return/^NNE|NE|NNW|N$/.test(e)?"N":/^ENE|E|ESE|SE$/.test(e)?"E":/^SSE|S|SSW|SW$/.test(e)?"S":/^WSW|W|WNW|NW$/.test(e)?"W":void 0};e.default=t})),go=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,i=r(e,t),a=Number(t.time)-Number(e.time),s=i/a*1e3;return s};e.default=r})),yo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t,r){return(0,n.default)(t,e)+(0,n.default)(e,r)===(0,n.default)(t,r)};e.default=r})),ko=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(_e()),n=r(je());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e,r){for(var i=!1,a=r.length,s=-1,o=a-1;++s<a;o=s)((0,n.default)(r[s])<=(0,n.default)(e)&&(0,n.default)(e)<(0,n.default)(r[o])||(0,n.default)(r[o])<=(0,n.default)(e)&&(0,n.default)(e)<(0,n.default)(r[s]))&&(0,t.default)(e)<((0,t.default)(r[o])-(0,t.default)(r[s]))*((0,n.default)(e)-(0,n.default)(r[s]))/((0,n.default)(r[o])-(0,n.default)(r[s]))+(0,t.default)(r[s])&&(i=!i);return i};e.default=i})),bo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=mr())&&t.__esModule?t:{default:t};var r=function(e,t,r,i){return(0,n.default)(e,t,r)<i};e.default=r})),Mo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t,r){return(0,n.default)(e,t)<r};e.default=r})),xo=D((e=>{"use strict";function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&null!=o.return&&o.return()}finally{if(i)throw a}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}}(e,t)||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 n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(e){if(!e.startsWith("POLYGON"))throw new Error("Invalid wkt.");return e.slice(e.indexOf("(")+2,e.indexOf(")")).split(", ").map((function(e){var n=t(e.split(" "),2),r=n[0],i=n[1];return{longitude:parseFloat(r),latitude:parseFloat(i)}}))};e.default=r})),jo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0});var t={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(e,"computeDestinationPoint",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"convertArea",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"convertDistance",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"convertSpeed",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"decimalToSexagesimal",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"findNearest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"getAreaOfPolygon",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"getBounds",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"getBoundsOfDistance",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"getCenter",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"getCenterOfBounds",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"getCompassDirection",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"getCoordinateKey",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(e,"getCoordinateKeys",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"getDistance",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"getDistanceFromLine",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"getGreatCircleBearing",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(e,"getLatitude",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(e,"getLongitude",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(e,"getPathLength",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"getPreciseDistance",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(e,"getRhumbLineBearing",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(e,"getRoughCompassDirection",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(e,"getSpeed",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(e,"isDecimal",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"isPointInLine",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(e,"isPointInPolygon",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(e,"isPointNearLine",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(e,"isPointWithinRadius",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(e,"isSexagesimal",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(e,"isValidCoordinate",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(e,"isValidLatitude",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(e,"isValidLongitude",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(e,"orderByDistance",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(e,"sexagesimalToDecimal",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(e,"toDecimal",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(e,"toRad",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(e,"toDeg",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(e,"wktToPolygon",{enumerable:!0,get:function(){return U.default}});var n=G(Pi()),r=G(Fi()),i=G(Di()),a=G(Li()),s=G(Bi()),o=G(Vi()),l=G(Hi()),u=G(dr()),c=G(Xi()),d=G(Zi()),f=G(Qi()),p=G(no()),g=G(Kt()),y=G(Oa()),m=G(Ke()),v=G(mr()),_=G(uo()),w=G(_e()),M=G(je()),b=G(lo()),x=G(mo()),O=G(pr()),E=G(fo()),N=G(go()),A=G(Zt()),I=G(yo()),k=G(ko()),T=G(bo()),S=G(Mo()),F=G(Qt()),D=G(ar()),P=G(Zn()),j=G(er()),B=G(ur()),C=G(ea()),L=G(Sa()),z=G(De()),R=G(dt()),U=G(xo()),$=oe();function G(e){return e&&e.__esModule?e:{default:e}}Object.keys($).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return $[n]}})}))})),ss=D(((e,t)=>{"use strict";h(),t.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))})),ps=D(((e,t)=>{"use strict";h();var n="%[a-f0-9]{2}",r=new RegExp("("+n+")|([^%]+?)","gi"),i=new RegExp("("+n+")+","gi");function a(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],a(n),a(r))}function s(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(r)||[],n=1;n<t.length;n++)t=(e=a(t,n).join("")).match(r)||[];return e}}t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{var r=s(n[0]);r!==n[0]&&(t[n[0]]=r)}n=i.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),o=0;o<a.length;o++){var l=a[o];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}})),ms=D(((e,t)=>{"use strict";h(),t.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}})),gs=D(((e,t)=>{"use strict";h(),t.exports=function(e,t){for(var n={},r=Object.keys(e),i=Array.isArray(t),a=0;a<r.length;a++){var s=r[a],o=e[s];(i?-1!==t.indexOf(s):t(s,o,e))&&(n[s]=o)}return n}})),_s=D((e=>{"use strict";h();var t=ss(),n=ps(),r=ms(),i=gs(),a=Symbol("encodeFragmentIdentifier");function s(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(e,n){return n.encode?n.strict?t(e):encodeURIComponent(e):e}function l(e,t){return t.decode?n(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function c(e){let t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function d(e){let t=(e=c(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function f(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function p(e,t){s((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{let i="string"==typeof n&&n.includes(e.arrayFormatSeparator),a="string"==typeof n&&!i&&l(n,e).includes(e.arrayFormatSeparator);n=a?l(n,e):n;let s=i||a?n.split(e.arrayFormatSeparator).map((t=>l(t,e))):null===n?n:l(n,e);r[t]=s};case"bracket-separator":return(t,n,r)=>{let i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(r[t]=n&&l(n,e));let a=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>l(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],a):r[t]=a};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),i=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return i;for(let a of e.split("&")){if(""===a)continue;let[e,s]=r(t.decode?a.replace(/\+/g," "):a,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:l(s,t),n(l(e,t),s,i)}for(let e of Object.keys(i)){let n=i[e];if("object"==typeof n&&null!==n)for(let e of Object.keys(n))n[e]=f(n[e],t);else i[e]=f(n,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{let n=i[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=u(n):e[t]=n,e}),Object.create(null))}e.extract=d,e.parse=p,e.stringify=(e,t)=>{if(!e)return"";s((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let n=n=>t.skipNull&&(e=>null==e)(e[n])||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{let i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[o(t,e),"[",i,"]"].join("")]:[...n,[o(t,e),"[",o(i,e),"]=",o(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[o(t,e),"[]"].join("")]:[...n,[o(t,e),"[]=",o(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[o(n,e),t,o(i,e)].join("")]:[[r,o(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,o(t,e)]:[...n,[o(t,e),"=",o(r,e)].join("")]}}(t),i={};for(let t of Object.keys(e))n(t)||(i[t]=e[t]);let a=Object.keys(i);return!1!==t.sort&&a.sort(t.sort),a.map((n=>{let i=e[n];return void 0===i?"":null===i?o(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?o(n,t)+"[]":i.reduce(r(n),[]).join("&"):o(n,t)+"="+o(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[n,i]=r(e,"#");return Object.assign({url:n.split("?")[0]||"",query:p(d(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:l(i,t)}:{})},e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0,[a]:!0},n);let r=c(t.url).split("?")[0]||"",i=e.extract(t.url),s=e.parse(i,{sort:!1}),l=Object.assign(s,t.query),u=e.stringify(l,n);u&&(u=`?${u}`);let h=function(e){let t="",n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(t.url);return t.fragmentIdentifier&&(h=`#${n[a]?o(t.fragmentIdentifier,n):t.fragmentIdentifier}`),`${r}${u}${h}`},e.pick=(t,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[a]:!1},r);let{url:s,query:o,fragmentIdentifier:l}=e.parseUrl(t,r);return e.stringifyUrl({url:s,query:i(o,n),fragmentIdentifier:l},r)},e.exclude=(t,n,r)=>{let i=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return e.pick(t,i,r)}})),xu={};function ci(e,t){return!t&&"function"==typeof e&&(t=e,e={}),this.ondata=t,e}function cu(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[$t],(function(e){return ct(va(e.data[0],e.data[1]))}),0,n)}function va(e,t){return vt(e,t||{},0,0)}function pi(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[Vt],(function(e){return ct(Yt(e.data[0],ii(e.data[1])))}),1,n)}function Yt(e,t){return ga(e,t)}function wh(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[$t,nu,function(){return[Qr]}],(function(e){return ct(Qr(e.data[0],e.data[1]))}),2,n)}function Qr(e,t){t||(t={});var n=Ut(),r=e.length;n.p(e);var i=vt(e,t,ui(t),8),a=i.length;return oi(i,t),H(i,a-8,n.d()),H(i,a-4,r),i}function pu(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[Vt,ru,function(){return[Un]}],(function(e){return ct(Un(e.data[0]))}),3,n)}function Un(e,t){return ga(e.subarray(si(e),-8),t||new U(su(e)))}function _h(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[$t,iu,function(){return[ti]}],(function(e){return ct(ti(e.data[0],e.data[1]))}),4,n)}function ti(e,t){t||(t={});var n=ri();n.p(e);var r=vt(e,t,2,4);return li(r,t),H(r,r.length-4,n.d()),r}function mu(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[Vt,ou,function(){return[$n]}],(function(e){return ct($n(e.data[0],ii(e.data[1])))}),5,n)}function $n(e,t){return ga((uu(e),e.subarray(2,-4)),t)}function Th(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),31==e[0]&&139==e[1]&&8==e[2]?pu(e,t,n):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?pi(e,t,n):mu(e,t,n)}function Ih(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?Un(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?Yt(e,t):$n(e,t)}function lt(e,t){if(t){for(var n=new U(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Us)return Us.encode(e);var i=e.length,a=new U(e.length+(e.length>>1)),s=0,o=function(e){a[s++]=e};for(r=0;r<i;++r){if(s+5>a.length){var l=new U(s+8+(i-r<<1));l.set(a),a=l}var u=e.charCodeAt(r);u<128||t?o(u):u<2048?(o(192|u>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++r))>>18),o(128|u>>12&63),o(128|u>>6&63),o(128|63&u)):(o(224|u>>12),o(128|u>>6&63),o(128|63&u))}return ze(a,0,s)}function mi(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(ai)return ai.decode(e);var i=yu(e),a=i[0];return i[1].length&&E(8),a}function Sh(e,t,n){n||(n=t,t={}),"function"!=typeof n&&E(7);var r={};hi(e,"",r,t);var i=Object.keys(r),a=i.length,s=0,o=0,l=a,u=new Array(a),h=[],c=function(){for(var e=0;e<h.length;++e)h[e]()},d=function(e,t){Wn((function(){n(e,t)}))};Wn((function(){d=n}));var f=function(){var e=new U(o+22),t=s,n=o-s;o=0;for(var r=0;r<l;++r){var i=u[r];try{var a=i.c.length;Rt(e,o,i,i.f,i.u,a);var h=30+i.f.length+ut(i.extra),c=o+h;e.set(i.c,c),Rt(e,s,i,i.f,i.u,a,o,i.m),s+=16+h+(i.m?i.m.length:0),o=c+a}catch(e){return d(e,null)}}fi(e,s,u.length,n,t),d(null,e)};a||f();for(var p=function(e){var t=i[e],n=r[t],l=n[0],p=n[1],g=Ut(),y=l.length;g.p(l);var m=lt(t),v=m.length,_=p.comment,w=_&<(_),M=w&&w.length,b=ut(p.extra),x=0==p.level?0:8,O=function(n,r){if(n)c(),d(n,null);else{var i=r.length;u[e]=ya(p,{size:y,crc:g.d(),c:r,f:m,m:w,u:v!=t.length||w&&_.length!=M,compression:x}),s+=30+v+b+i,o+=76+2*(v+b)+(M||0)+i,--a||f()}};if(v>65535&&O(E(11,0,1),null),x)if(y<16e4)try{O(null,va(l,p))}catch(e){O(e,null)}else h.push(cu(l,p,O));else O(null,l)},g=0;g<l;++g)p(g);return c}function Ph(e,t){t||(t={});var n={},r=[];hi(e,"",n,t);var i=0,a=0;for(var s in n){var o=n[s],l=o[0],u=o[1],h=0==u.level?0:8,c=(x=lt(s)).length,d=u.comment,f=d&<(d),p=f&&f.length,g=ut(u.extra);c>65535&&E(11);var y=h?va(l,u):l,m=y.length,v=Ut();v.p(l),r.push(ya(u,{size:l.length,crc:v.d(),c:y,f:x,m:f,u:c!=s.length||f&&d.length!=p,o:i,compression:h})),i+=30+c+g+m,a+=76+2*(c+g)+(p||0)+m}for(var _=new U(a+22),w=i,M=a-i,b=0;b<r.length;++b){var x=r[b];Rt(_,x.o,x,x.f,x.u,x.c.length);var O=30+x.f.length+ut(x.extra);_.set(x.c,x.o+O),Rt(_,i,x,x.f,x.u,x.c.length,x.o,x.m),i+=16+O+(x.m?x.m.length:0)}return fi(_,i,r.length,M,w),_}function Ch(e,t,n){n||(n=t,t={}),"function"!=typeof n&&E(7);var r=[],i=function(){for(var e=0;e<r.length;++e)r[e]()},a={},s=function(e,t){Wn((function(){n(e,t)}))};Wn((function(){s=n}));for(var o=e.length-22;101010256!=Q(e,o);--o)if(!o||e.length-o>65558)return s(E(13,0,1),null),i;var l=me(e,o+8);if(l){var u=l,h=Q(e,o+16),c=4294967295==h;if(c){if(o=Q(e,o-12),101075792!=Q(e,o))return s(E(13,0,1),null),i;u=l=Q(e,o+32),h=Q(e,o+48)}for(var d=t&&t.filter,f=function(t){var n=bu(e,h,c),o=n[0],u=n[1],f=n[2],p=n[3],g=n[4],y=n[5],m=ku(e,y);h=g;var v=function(e,t){e?(i(),s(e,null)):(t&&(a[p]=t),--l||s(null,a))};if(!d||d({name:p,size:u,originalSize:f,compression:o}))if(o)if(8==o){var _=e.subarray(m,m+u);if(u<32e4)try{v(null,Yt(_,new U(f)))}catch(e){v(e,null)}else r.push(pi(_,{size:f},v))}else v(E(14,"unknown compression type "+o,1),null);else v(null,ze(e,m,m+u));else v(null,null)},p=0;p<u;++p)f()}else s(null,{});return i}function Rh(e,t){for(var n={},r=e.length-22;101010256!=Q(e,r);--r)(!r||e.length-r>65558)&&E(13);var i=me(e,r+8);if(!i)return{};var a=Q(e,r+16),s=4294967295==a;s&&(r=Q(e,r-12),101075792!=Q(e,r)&&E(13),i=Q(e,r+32),a=Q(e,r+48));for(var o=t&&t.filter,l=0;l<i;++l){var u=bu(e,a,s),h=u[0],c=u[1],d=u[2],f=u[3],p=u[4],g=u[5],y=ku(e,g);a=p,(!o||o({name:f,size:c,originalSize:d,compression:h}))&&(h?8==h?n[f]=Yt(e.subarray(y,y+c),new U(d)):E(14,"unknown compression type "+h):n[f]=ze(e,y,y+c))}return n}Pu(xu,{AsyncCompress:()=>Mh,AsyncDecompress:()=>jh,AsyncDeflate:()=>lu,AsyncGunzip:()=>du,AsyncGzip:()=>Mh,AsyncInflate:()=>di,AsyncUnzipInflate:()=>Dh,AsyncUnzlib:()=>hu,AsyncZipDeflate:()=>Nh,AsyncZlib:()=>xh,Compress:()=>Zr,DecodeUTF8:()=>Oh,Decompress:()=>fu,Deflate:()=>qe,EncodeUTF8:()=>zh,FlateErrorCode:()=>kh,Gunzip:()=>Gn,Gzip:()=>Zr,Inflate:()=>be,Unzip:()=>Lh,UnzipInflate:()=>Fh,UnzipPassThrough:()=>wu,Unzlib:()=>Vn,Zip:()=>Eh,ZipDeflate:()=>Ah,ZipPassThrough:()=>ma,Zlib:()=>ei,compress:()=>wh,compressSync:()=>Qr,decompress:()=>Th,decompressSync:()=>Ih,deflate:()=>cu,deflateSync:()=>va,gunzip:()=>pu,gunzipSync:()=>Un,gzip:()=>wh,gzipSync:()=>Qr,inflate:()=>pi,inflateSync:()=>Yt,strFromU8:()=>mi,strToU8:()=>lt,unzip:()=>Ch,unzipSync:()=>Rh,unzlib:()=>mu,unzlibSync:()=>$n,zip:()=>Sh,zipSync:()=>Ph,zlib:()=>_h,zlibSync:()=>ti});var qs,vh,U,de,Bt,qt,Gt,pa,Vs,$s,ni,Rn,Ws,Hs,Xr,ha,Ye,Oe,Je,Ct,W,Ys,Xs,Js,Ks,Dn,Ie,Ln,fa,ze,kh,Zs,E,ga,Be,Dt,Cn,Bn,Jr,Lt,qn,Kr,Qs,Xe,eu,tu,Ut,ri,vt,ya,Gs,Fn,bh,au,Vt,$t,nu,ru,iu,ou,ct,ii,Wt,Ae,Ht,me,Q,Yr,H,oi,si,su,ui,li,uu,qe,lu,be,di,Zr,Mh,Gn,du,ei,xh,Vn,hu,fu,jh,hi,Us,ai,gu,yu,Oh,zh,vu,ku,bu,Mu,ut,Rt,fi,ma,Ah,Nh,Eh,wu,Fh,Dh,Lh,Wn,_u=Mi((()=>{for(h(),qs={},vh=function(e,t,n,r,i){var a=new Worker(qs[t]||(qs[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(e){var t=e.data,n=t.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],i(r,null)}else i(null,t)},a.postMessage(n,r),a},U=Uint8Array,de=Uint16Array,Bt=Uint32Array,qt=new U([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Gt=new U([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),pa=new U([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$s=(Vs=function(e,t){for(var n=new de(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Bt(n[30]);for(r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]})(qt,2),ni=$s[0],Rn=$s[1],ni[28]=258,Rn[258]=28,Ws=Vs(Gt,0),Hs=Ws[0],Xr=Ws[1],ha=new de(32768),W=0;W<32768;++W)Ye=(61680&(Ye=(52428&(Ye=(43690&W)>>>1|(21845&W)<<1))>>>2|(13107&Ye)<<2))>>>4|(3855&Ye)<<4,ha[W]=((65280&Ye)>>>8|(255&Ye)<<8)>>>1;for(Oe=function(e,t,n){for(var r=e.length,i=0,a=new de(t);i<r;++i)e[i]&&++a[e[i]-1];var s,o=new de(t);for(i=0;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;if(n){s=new de(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],h=t-e[i],c=o[e[i]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)s[ha[c]>>>l]=u}else for(s=new de(r),i=0;i<r;++i)e[i]&&(s[i]=ha[o[e[i]-1]++]>>>15-e[i]);return s},Je=new U(288),W=0;W<144;++W)Je[W]=8;for(W=144;W<256;++W)Je[W]=9;for(W=256;W<280;++W)Je[W]=7;for(W=280;W<288;++W)Je[W]=8;for(Ct=new U(32),W=0;W<32;++W)Ct[W]=5;Ys=Oe(Je,9,0),Xs=Oe(Je,9,1),Js=Oe(Ct,5,0),Ks=Oe(Ct,5,1),Dn=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Ie=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},Ln=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},fa=function(e){return(e+7)/8|0},ze=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(2==e.BYTES_PER_ELEMENT?de:4==e.BYTES_PER_ELEMENT?Bt:U)(n-t);return r.set(e.subarray(t,n)),r},kh={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},Zs=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(e,t,n){var r=new Error(t||Zs[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,E),!n)throw r;return r},ga=function(e,t,n){var r=e.length;if(!r||n&&n.f&&!n.l)return t||new U(0);var i=!t||n,a=!n||n.i;n||(n={}),t||(t=new U(3*r));var s=function(e){var n=t.length;if(e>n){var r=new U(Math.max(2*n,e));r.set(t),t=r}},o=n.f||0,l=n.p||0,u=n.b||0,h=n.l,c=n.d,d=n.m,f=n.n,p=8*r;do{if(!h){o=Ie(e,l,1);var g=Ie(e,l+1,3);if(l+=3,!g){var y=e[(I=fa(l)+4)-4]|e[I-3]<<8,m=I+y;if(m>r){a&&E(0);break}i&&s(u+y),t.set(e.subarray(I,m),u),n.b=u+=y,n.p=l=8*m,n.f=o;continue}if(1==g)h=Xs,c=Ks,d=9,f=5;else if(2==g){var v=Ie(e,l,31)+257,_=Ie(e,l+10,15)+4,w=v+Ie(e,l+5,31)+1;l+=14;for(var M=new U(w),b=new U(19),x=0;x<_;++x)b[pa[x]]=Ie(e,l+3*x,7);l+=3*_;var O=Dn(b),N=(1<<O)-1,A=Oe(b,O,1);for(x=0;x<w;){var I,k=A[Ie(e,l,N)];if(l+=15&k,(I=k>>>4)<16)M[x++]=I;else{var T=0,S=0;for(16==I?(S=3+Ie(e,l,3),l+=2,T=M[x-1]):17==I?(S=3+Ie(e,l,7),l+=3):18==I&&(S=11+Ie(e,l,127),l+=7);S--;)M[x++]=T}}var F=M.subarray(0,v),D=M.subarray(v);d=Dn(F),f=Dn(D),h=Oe(F,d,1),c=Oe(D,f,1)}else E(1);if(l>p){a&&E(0);break}}i&&s(u+131072);for(var P=(1<<d)-1,j=(1<<f)-1,B=l;;B=l){var C=(T=h[Ln(e,l)&P])>>>4;if((l+=15&T)>p){a&&E(0);break}if(T||E(2),C<256)t[u++]=C;else{if(256==C){B=l,h=null;break}var L=C-254;if(C>264){var z=qt[x=C-257];L=Ie(e,l,(1<<z)-1)+ni[x],l+=z}var R=c[Ln(e,l)&j],$=R>>>4;R||E(3),l+=15&R;D=Hs[$];if($>3){z=Gt[$];D+=Ln(e,l)&(1<<z)-1,l+=z}if(l>p){a&&E(0);break}i&&s(u+131072);for(var G=u+L;u<G;u+=4)t[u]=t[u-D],t[u+1]=t[u+1-D],t[u+2]=t[u+2-D],t[u+3]=t[u+3-D];u=G}}n.l=h,n.p=B,n.b=u,n.f=o,h&&(o=1,n.m=d,n.d=c,n.n=f)}while(!o);return u==t.length?t:ze(t,0,u)},Be=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},Dt=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Cn=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[Xe,0];if(1==i){var s=new U(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var o=n[0],l=n[1],u=0,h=1,c=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=i-1;)o=n[n[u].f<n[c].f?u++:c++],l=n[u!=h&&n[u].f<n[c].f?u++:c++],n[h++]={s:-1,f:o.f+l.f,l:o,r:l};var d=a[0].s;for(r=1;r<i;++r)a[r].s>d&&(d=a[r].s);var f=new de(d+1),p=Bn(n[h-1],f,0);if(p>t){r=0;var g=0,y=p-t,m=1<<y;for(a.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<i;++r){var v=a[r].s;if(!(f[v]>t))break;g+=m-(1<<p-f[v]),f[v]=t}for(g>>>=y;g>0;){var _=a[r].s;f[_]<t?g-=1<<t-f[_]++-1:++r}for(;r>=0&&g;--r){var w=a[r].s;f[w]==t&&(--f[w],++g)}p=t}return[new U(f),p]},Bn=function(e,t,n){return-1==e.s?Math.max(Bn(e.l,t,n+1),Bn(e.r,t,n+1)):t[e.s]=n},Jr=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new de(++t),r=0,i=e[0],a=1,s=function(e){n[r++]=e},o=1;o<=t;++o)if(e[o]==i&&o!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(i),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}for(;a--;)s(i);a=1,i=e[o]}return[n.subarray(0,r),t]},Lt=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},qn=function(e,t,n){var r=n.length,i=fa(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;a<r;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Kr=function(e,t,n,r,i,a,s,o,l,u,h){Be(t,h++,n),++i[256];for(var c=Cn(i,15),d=c[0],f=c[1],p=Cn(a,15),g=p[0],y=p[1],m=Jr(d),v=m[0],_=m[1],w=Jr(g),M=w[0],b=w[1],x=new de(19),O=0;O<v.length;++O)x[31&v[O]]++;for(O=0;O<M.length;++O)x[31&M[O]]++;for(var E=Cn(x,7),N=E[0],A=E[1],I=19;I>4&&!N[pa[I-1]];--I);var k,T,S,F,D=u+5<<3,P=Lt(i,Je)+Lt(a,Ct)+s,j=Lt(i,d)+Lt(a,g)+s+14+3*I+Lt(x,N)+(2*x[16]+3*x[17]+7*x[18]);if(D<=P&&D<=j)return qn(t,h,e.subarray(l,l+u));if(Be(t,h,1+(j<P)),h+=2,j<P){k=Oe(d,f,0),T=d,S=Oe(g,y,0),F=g;var B=Oe(N,A,0);Be(t,h,_-257),Be(t,h+5,b-1),Be(t,h+10,I-4),h+=14;for(O=0;O<I;++O)Be(t,h+3*O,N[pa[O]]);h+=3*I;for(var C=[v,M],L=0;L<2;++L){var z=C[L];for(O=0;O<z.length;++O){var R=31&z[O];Be(t,h,B[R]),h+=N[R],R>15&&(Be(t,h,z[O]>>>5&127),h+=z[O]>>>12)}}}else k=Ys,T=Je,S=Js,F=Ct;for(O=0;O<o;++O)if(r[O]>255){R=r[O]>>>18&31;Dt(t,h,k[R+257]),h+=T[R+257],R>7&&(Be(t,h,r[O]>>>23&31),h+=qt[R]);var U=31&r[O];Dt(t,h,S[U]),h+=F[U],U>3&&(Dt(t,h,r[O]>>>5&8191),h+=Gt[U])}else Dt(t,h,k[r[O]]),h+=T[r[O]];return Dt(t,h,k[256]),h+T[256]},Qs=new Bt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Xe=new U(0),eu=function(e,t,n,r,i,a){var s=e.length,o=new U(r+s+5*(1+Math.ceil(s/7e3))+i),l=o.subarray(r,o.length-i),u=0;if(!t||s<8)for(var h=0;h<=s;h+=65535){var c=h+65535;c>=s&&(l[u>>3]=a),u=qn(l,u+1,e.subarray(h,c))}else{for(var d=Qs[t-1],f=d>>>13,p=8191&d,g=(1<<n)-1,y=new de(32768),m=new de(g+1),v=Math.ceil(n/3),_=2*v,w=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<_)&g},M=new Bt(25e3),b=new de(288),x=new de(32),O=0,E=0,N=(h=0,0),A=0,I=0;h<s;++h){var k=w(h),T=32767&h,S=m[k];if(y[T]=S,m[k]=T,A<=h){var F=s-h;if((O>7e3||N>24576)&&F>423){u=Kr(e,l,0,M,b,x,E,N,I,h-I,u),N=O=E=0,I=h;for(var D=0;D<286;++D)b[D]=0;for(D=0;D<30;++D)x[D]=0}var P=2,j=0,B=p,C=T-S&32767;if(F>2&&k==w(h-C))for(var L=Math.min(f,F)-1,z=Math.min(32767,h),R=Math.min(258,F);C<=z&&--B&&T!=S;){if(e[h+P]==e[h+P-C]){for(var $=0;$<R&&e[h+$]==e[h+$-C];++$);if($>P){if(P=$,j=C,$>L)break;var G=Math.min(C,$-2),W=0;for(D=0;D<G;++D){var H=h-C+D+32768&32767,q=H-y[H]+32768&32767;q>W&&(W=q,S=H)}}}C+=(T=S)-(S=y[T])+32768&32767}if(j){M[N++]=268435456|Rn[P]<<18|Xr[j];var J=31&Rn[P],Y=31&Xr[j];E+=qt[J]+Gt[Y],++b[257+J],++x[Y],A=h+P,++O}else M[N++]=e[h],++b[e[h]]}}u=Kr(e,l,a,M,b,x,E,N,I,h-I,u),!a&&7&u&&(u=qn(l,u+1,Xe))}return ze(o,0,r+fa(u)+i)},tu=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&-306674912)^n>>>1;e[t]=n}return e}(),Ut=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=tu[255&n^t[r]]^n>>>8;e=n},d:function(){return~e}}},ri=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,a=0|n.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=r+=n[s];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}e=r,t=i},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}},vt=function(e,t,n,r,i){return eu(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},ya=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},Gs=function(e,t,n){for(var r=e(),i=e.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<r.length;++s){var o=r[s],l=a[s];if("function"==typeof o){t+=";"+l+"=";var u=o.toString();if(o.prototype)if(-1!=u.indexOf("[native code]")){var h=u.indexOf(" ",8)+1;t+=u.slice(h,u.indexOf("(",h))}else for(var c in t+=u,o.prototype)t+=";"+l+".prototype."+c+"="+o.prototype[c].toString();else t+=u}else n[l]=o}return[t,n]},Fn=[],bh=function(e){var t=[];for(var n in e)e[n].buffer&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t},au=function(e,t,n,r){var i;if(!Fn[n]){for(var a="",s={},o=e.length-1,l=0;l<o;++l)a=(i=Gs(e[l],a,s))[0],s=i[1];Fn[n]=Gs(e[o],a,s)}var u=ya({},Fn[n][1]);return vh(Fn[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,u,bh(u),r)},Vt=function(){return[U,de,Bt,qt,Gt,pa,ni,Hs,Xs,Ks,ha,Zs,Oe,Dn,Ie,Ln,fa,ze,E,ga,Yt,ct,ii]},$t=function(){return[U,de,Bt,qt,Gt,pa,Rn,Xr,Ys,Je,Js,Ct,ha,Qs,Xe,Oe,Be,Dt,Cn,Bn,Jr,Lt,qn,Kr,fa,ze,eu,vt,va,ct]},nu=function(){return[oi,ui,H,Ut,tu]},ru=function(){return[si,su]},iu=function(){return[li,H,ri]},ou=function(){return[uu]},ct=function(e){return postMessage(e,[e.buffer])},ii=function(e){return e&&e.size&&new U(e.size)},Wt=function(e,t,n,r,i,a){var s=au(n,r,i,(function(e,t){s.terminate(),a(e,t)}));return s.postMessage([e,t],t.consume?[e.buffer]:[]),function(){s.terminate()}},Ae=function(e){return e.ondata=function(e,t){return postMessage([e,t],[e.buffer])},function(t){return e.push(t.data[0],t.data[1])}},Ht=function(e,t,n,r,i){var a,s=au(e,r,i,(function(e,n){e?(s.terminate(),t.ondata.call(t,e)):(n[1]&&s.terminate(),t.ondata.call(t,e,n[0],n[1]))}));s.postMessage(n),t.push=function(e,n){t.ondata||E(5),a&&t.ondata(E(4,0,1),null,!!n),s.postMessage([e,a=n],[e.buffer])},t.terminate=function(){s.terminate()}},me=function(e,t){return e[t]|e[t+1]<<8},Q=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},Yr=function(e,t){return Q(e,t)+4294967296*Q(e,t+4)},H=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},oi=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&H(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},si=function(e){(31!=e[0]||139!=e[1]||8!=e[2])&&E(6,"invalid gzip data");var t=e[3],n=10;4&t&&(n+=e[10]|2+(e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)},su=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},ui=function(e){return 10+(e.filename&&e.filename.length+1||0)},li=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},uu=function(e){(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)&&E(6,"invalid zlib data"),32&e[1]&&E(6,"invalid zlib data: preset dictionaries not supported")},qe=function(){function e(e,t){!t&&"function"==typeof e&&(t=e,e={}),this.ondata=t,this.o=e||{}}return e.prototype.p=function(e,t){this.ondata(vt(e,this.o,0,0,!t),t)},e.prototype.push=function(e,t){this.ondata||E(5),this.d&&E(4),this.d=t,this.p(e,t||!1)},e}(),lu=function(e,t){Ht([$t,function(){return[Ae,qe]}],this,ci.call(this,e,t),(function(e){var t=new qe(e.data);onmessage=Ae(t)}),6)},be=function(){function e(e){this.s={},this.p=new U(0),this.ondata=e}return e.prototype.e=function(e){this.ondata||E(5),this.d&&E(4);var t=this.p.length,n=new U(t+e.length);n.set(this.p),n.set(e,t),this.p=n},e.prototype.c=function(e){this.d=this.s.i=e||!1;var t=this.s.b,n=ga(this.p,this.o,this.s);this.ondata(ze(n,t,this.s.b),this.d),this.o=ze(n,this.s.b-32768),this.s.b=this.o.length,this.p=ze(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),di=function(e){this.ondata=e,Ht([Vt,function(){return[Ae,be]}],this,0,(function(){var e=new be;onmessage=Ae(e)}),7)},Zr=function(){function e(e,t){this.c=Ut(),this.l=0,this.v=1,qe.call(this,e,t)}return e.prototype.push=function(e,t){qe.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var n=vt(e,this.o,this.v&&ui(this.o),t&&8,!t);this.v&&(oi(n,this.o),this.v=0),t&&(H(n,n.length-8,this.c.d()),H(n,n.length-4,this.l)),this.ondata(n,t)},e}(),Mh=function(e,t){Ht([$t,nu,function(){return[Ae,qe,Zr]}],this,ci.call(this,e,t),(function(e){var t=new Zr(e.data);onmessage=Ae(t)}),8)},Gn=function(){function e(e){this.v=1,be.call(this,e)}return e.prototype.push=function(e,t){if(be.prototype.e.call(this,e),this.v){var n=this.p.length>3?si(this.p):4;if(n>=this.p.length&&!t)return;this.p=this.p.subarray(n),this.v=0}t&&(this.p.length<8&&E(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),be.prototype.c.call(this,t)},e}(),du=function(e){this.ondata=e,Ht([Vt,ru,function(){return[Ae,be,Gn]}],this,0,(function(){var e=new Gn;onmessage=Ae(e)}),9)},ei=function(){function e(e,t){this.c=ri(),this.v=1,qe.call(this,e,t)}return e.prototype.push=function(e,t){qe.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e);var n=vt(e,this.o,this.v&&2,t&&4,!t);this.v&&(li(n,this.o),this.v=0),t&&H(n,n.length-4,this.c.d()),this.ondata(n,t)},e}(),xh=function(e,t){Ht([$t,iu,function(){return[Ae,qe,ei]}],this,ci.call(this,e,t),(function(e){var t=new ei(e.data);onmessage=Ae(t)}),10)},Vn=function(){function e(e){this.v=1,be.call(this,e)}return e.prototype.push=function(e,t){if(be.prototype.e.call(this,e),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}t&&(this.p.length<4&&E(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),be.prototype.c.call(this,t)},e}(),hu=function(e){this.ondata=e,Ht([Vt,ou,function(){return[Ae,be,Vn]}],this,0,(function(){var e=new Vn;onmessage=Ae(e)}),11)},fu=function(){function e(e){this.G=Gn,this.I=be,this.Z=Vn,this.ondata=e}return e.prototype.push=function(e,t){if(this.ondata||E(5),this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var n=new U(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var r=this,i=function(){r.ondata.apply(r,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(i):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(i):new this.Z(i),this.s.push(this.p,t),this.p=null}}},e}(),jh=function(){function e(e){this.G=du,this.I=di,this.Z=hu,this.ondata=e}return e.prototype.push=function(e,t){fu.prototype.push.call(this,e,t)},e}(),hi=function(e,t,n,r){for(var i in e){var a=e[i],s=t+i,o=r;Array.isArray(a)&&(o=ya(r,a[1]),a=a[0]),a instanceof U?n[s]=[a,o]:(n[s+="/"]=[new U(0),o],hi(a,s,n,r))}},Us=typeof TextEncoder<"u"&&new TextEncoder,ai=typeof TextDecoder<"u"&&new TextDecoder,gu=0;try{ai.decode(Xe,{stream:!0}),gu=1}catch{}yu=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return[t,ze(e,n-1)];i?3==i?(r=((15&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t+=String.fromCharCode(55296|r>>10,56320|1023&r)):t+=1&i?String.fromCharCode((31&r)<<6|63&e[n++]):String.fromCharCode((15&r)<<12|(63&e[n++])<<6|63&e[n++]):t+=String.fromCharCode(r)}},Oh=function(){function e(e){this.ondata=e,gu?this.t=new TextDecoder:this.p=Xe}return e.prototype.push=function(e,t){if(this.ondata||E(5),t=!!t,this.t)return this.ondata(this.t.decode(e,{stream:!0}),t),void(t&&(this.t.decode().length&&E(8),this.t=null));this.p||E(4);var n=new U(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length);var r=yu(n),i=r[0],a=r[1];t?(a.length&&E(8),this.p=null):this.p=a,this.ondata(i,t)},e}(),zh=function(){function e(e){this.ondata=e}return e.prototype.push=function(e,t){this.ondata||E(5),this.d&&E(4),this.ondata(lt(e),this.d=t||!1)},e}(),vu=function(e){return 1==e?3:e<6?2:9==e?1:0},ku=function(e,t){return t+30+me(e,t+26)+me(e,t+28)},bu=function(e,t,n){var r=me(e,t+28),i=mi(e.subarray(t+46,t+46+r),!(2048&me(e,t+8))),a=t+46+r,s=Q(e,t+20),o=n&&4294967295==s?Mu(e,a):[s,Q(e,t+24),Q(e,t+42)],l=o[0],u=o[1],h=o[2];return[me(e,t+10),l,u,i,a+me(e,t+30)+me(e,t+32),h]},Mu=function(e,t){for(;1!=me(e,t);t+=4+me(e,t+2));return[Yr(e,t+12),Yr(e,t+4),Yr(e,t+20)]},ut=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&E(9),t+=r+4}return t},Rt=function(e,t,n,r,i,a,s,o){var l=r.length,u=n.extra,h=o&&o.length,c=ut(u);H(e,t,null!=s?33639248:67324752),t+=4,null!=s&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(null==a&&8),e[t++]=i&&8,e[t++]=255&n.compression,e[t++]=n.compression>>8;var d=new Date(null==n.mtime?Date.now():n.mtime),f=d.getFullYear()-1980;if((f<0||f>119)&&E(10),H(e,t,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),t+=4,null!=a&&(H(e,t,n.crc),H(e,t+4,a),H(e,t+8,n.size)),H(e,t+12,l),H(e,t+14,c),t+=16,null!=s&&(H(e,t,h),H(e,t+6,n.attrs),H(e,t+10,s),t+=14),e.set(r,t),t+=l,c)for(var p in u){var g=u[p],y=g.length;H(e,t,+p),H(e,t+2,y),e.set(g,t+4),t+=4+y}return h&&(e.set(o,t),t+=h),t},fi=function(e,t,n,r,i){H(e,t,101010256),H(e,t+8,n),H(e,t+10,n),H(e,t+12,r),H(e,t+16,i)},ma=function(){function e(e){this.filename=e,this.c=Ut(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){this.ondata||E(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}(),Ah=function(){function e(e,t){var n=this;t||(t={}),ma.call(this,e),this.d=new qe(t,(function(e,t){n.ondata(null,e,t)})),this.compression=8,this.flag=vu(t.level)}return e.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},e.prototype.push=function(e,t){ma.prototype.push.call(this,e,t)},e}(),Nh=function(){function e(e,t){var n=this;t||(t={}),ma.call(this,e),this.d=new lu(t,(function(e,t,r){n.ondata(e,t,r)})),this.compression=8,this.flag=vu(t.level),this.terminate=this.d.terminate}return e.prototype.process=function(e,t){this.d.push(e,t)},e.prototype.push=function(e,t){ma.prototype.push.call(this,e,t)},e}(),Eh=function(){function e(e){this.ondata=e,this.u=[],this.d=1}return e.prototype.add=function(e){var t=this;if(this.ondata||E(5),2&this.d)this.ondata(E(4+8*(1&this.d),0,1),null,!1);else{var n=lt(e.filename),r=n.length,i=e.comment,a=i&<(i),s=r!=e.filename.length||a&&i.length!=a.length,o=r+ut(e.extra)+30;r>65535&&this.ondata(E(11,0,1),null,!1);var l=new U(o);Rt(l,0,e,n,s);var u=[l],h=function(){for(var e=0,n=u;e<n.length;e++){var r=n[e];t.ondata(null,r,!1)}u=[]},c=this.d;this.d=0;var d=this.u.length,f=ya(e,{f:n,u:s,o:a,t:function(){e.terminate&&e.terminate()},r:function(){if(h(),c){var e=t.u[d+1];e?e.r():t.d=1}c=1}}),p=0;e.ondata=function(n,r,i){if(n)t.ondata(n,r,i),t.terminate();else if(p+=r.length,u.push(r),i){var a=new U(16);H(a,0,134695760),H(a,4,e.crc),H(a,8,p),H(a,12,e.size),u.push(a),f.c=p,f.b=o+p+16,f.crc=e.crc,f.size=e.size,c&&f.r(),c=1}else c&&h()},this.u.push(f)}},e.prototype.end=function(){var e=this;2&this.d?this.ondata(E(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&e.d&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3)},e.prototype.e=function(){for(var e=0,t=0,n=0,r=0,i=this.u;r<i.length;r++){n+=46+(l=i[r]).f.length+ut(l.extra)+(l.o?l.o.length:0)}for(var a=new U(n+22),s=0,o=this.u;s<o.length;s++){var l=o[s];Rt(a,e,l,l.f,l.u,l.c,t,l.o),e+=46+l.f.length+ut(l.extra)+(l.o?l.o.length:0),t+=l.b}fi(a,e,this.u.length,n,t),this.ondata(null,a,!0),this.d=2},e.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++){t[e].t()}this.d=2},e}(),wu=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),Fh=function(){function e(){var e=this;this.i=new be((function(t,n){e.ondata(null,t,n)}))}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(e){this.ondata(e,null,t)}},e.compression=8,e}(),Dh=function(){function e(e,t){var n=this;t<32e4?this.i=new be((function(e,t){n.ondata(null,e,t)})):(this.i=new di((function(e,t,r){n.ondata(e,t,r)})),this.terminate=this.i.terminate)}return e.prototype.push=function(e,t){this.i.terminate&&(e=ze(e,0)),this.i.push(e,t)},e.compression=8,e}(),Lh=function(){function e(e){this.onfile=e,this.k=[],this.o={0:wu},this.p=Xe}return e.prototype.push=function(e,t){var n=this;if(this.onfile||E(5),this.p||E(4),this.c>0){var r=Math.min(this.c,e.length),i=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),(e=e.subarray(r)).length)return this.push(e,t)}else{var a=0,s=0,o=void 0,l=void 0;this.p.length?e.length?((l=new U(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var u=l.length,h=this.c,c=h&&this.d,d=function(){var e,t=Q(l,s);if(67324752==t){a=1,o=s,f.d=null,f.c=0;var r=me(l,s+6),i=me(l,s+8),c=2048&r,d=8&r,p=me(l,s+26),g=me(l,s+28);if(u>s+30+p+g){var y=[];f.k.unshift(y),a=2;var m=Q(l,s+18),v=Q(l,s+22),_=mi(l.subarray(s+30,s+=30+p),!c);4294967295==m?(e=d?[-2]:Mu(l,s),m=e[0],v=e[1]):d&&(m=-1),s+=g,f.c=m;var w,M={name:_,compression:i,start:function(){if(M.ondata||E(5),m){var e=n.o[i];e||M.ondata(E(14,"unknown compression type "+i,1),null,!1),(w=m<0?new e(_):new e(_,m,v)).ondata=function(e,t,n){M.ondata(e,t,n)};for(var t=0,r=y;t<r.length;t++){var a=r[t];w.push(a,!1)}n.k[0]==y&&n.c?n.d=w:w.push(Xe,!0)}else M.ondata(null,Xe,!0)},terminate:function(){w&&w.terminate&&w.terminate()}};m>=0&&(M.size=m,M.originalSize=v),f.onfile(M)}return"break"}if(h){if(134695760==t)return o=s+=12+(-2==h&&8),a=3,f.c=0,"break";if(33639248==t)return o=s-=4,a=3,f.c=0,"break"}},f=this;s<u-4;++s){if("break"===d())break}if(this.p=Xe,h<0){var p=a?l.subarray(0,o-12-(-2==h&&8)-(134695760==Q(l,o-16)&&4)):l.subarray(0,s);c?c.push(p,!!a):this.k[+(2==a)].push(p)}if(2&a)return this.push(l.subarray(s),t);this.p=l.subarray(s)}t&&(this.c&&E(13),this.p=null)},e.prototype.register=function(e){this.o[e.compression]=e},e}(),Wn="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(e){e()}}));h();var Tu=Yn(xi());h(),h(),h();var To=Yn(jo());h();var vr=class{origin;destination;vortex;distance;angle;weight;constructor({origin:e,destination:t,vortex:n,elevationDelta:r=0,distance:i=0,angle:a=0}){let s,o;if(this.origin=e,this.destination=t,this.vortex=n,this.distance=i,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=r*o+s):(s=t.weight&&t.weight>=0?t.weight:0,o=t.multiplier&&t.multiplier>=1?t.multiplier:1,this.weight=this.distance*o+s),isNaN(this.angle))throw new Error("nan angle")}},xn=vr;h();var kr="mi-debug",mp={loggingEnabled:()=>"development"===M.env.NODE_ENV||"dev"===M.env.NODE_ENV||"test"===M.env.NODE_ENV||"true"===globalThis.sessionStorage?.getItem(kr),log(...e){this.loggingEnabled()&&console.log("[MappedInJS]",...e)},warn(...e){this.loggingEnabled()&&console.warn("[MappedInJS]",...e)},error(...e){this.loggingEnabled()&&console.error("[MappedInJS]",...e)},assert(...e){this.loggingEnabled()&&console.assert(...e)},time(e){this.loggingEnabled()&&console.time(e)},timeEnd(e){this.loggingEnabled()&&console.timeEnd(e)}},z=mp;function fp(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale||1);try{if(!e.georeference)throw new Error(`map ${e.name||e.shortName||e.id} does not have a georeference field`);if(e.georeference.length<3)throw new Error(`map ${e.name||e.shortName||e.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let t=e.georeference[0],n=e.georeference[2],r=(0,To.getDistance)({latitude:t.target.x,longitude:t.target.y},{latitude:n.target.x,longitude:n.target.y}),i=t.control.x-n.control.x,a=t.control.y-n.control.y;return Math.sqrt(i*i+a*a)/r}catch(e){return z.error(e),1}}function gp(e,t){let n=e.x-t.x,r=e.y-t.y;return(Math.atan2(r,n)+2.5*Math.PI)%(2*Math.PI)}var br=class{edges;nodesById;mapsById;constructor({nodes:e,vortexes:t,maps:n,showVortexNames:r=!1}){this.edges={},this.mapsById=n.map((e=>({...e,_scale:fp(e)}))).reduce(((e,t)=>(e[t.id]=t,e)),{});let i=e.filter((e=>!!this.mapsById[e.map])).map((e=>({...e,paths:e.paths?e.paths.filter((({map:t})=>t===e.map)):[]})));this.nodesById=i.reduce(((e,t)=>(e[t.id]=t,e)),{});for(let e in this.nodesById)this.nodesById.hasOwnProperty(e)&&(this.nodesById[e].paths=this.nodesById[e].paths.filter((({node:e})=>!!this.nodesById[e])));let a=t.map((e=>({...e,name:r?e.name:e.type,nodes:e.nodes?e.nodes.filter((e=>!!this.nodesById[e])):[]})));i.forEach((e=>{this.edges[e.id]=e.paths.map((({node:t})=>{let n=this.nodesById[t];return new xn({angle:gp(e,n),destination:n,distance:this.getDistance(e,n),origin:e})}))})),a.forEach((e=>{if(null==e.nodes||0===e.nodes.length)return;let t=0;for(;t<e.nodes.length-1;){let n=this.nodesById[e.nodes[t]];if(t++,null==n)continue;let r=t;for(;r<e.nodes.length;){let t=this.nodesById[e.nodes[r]];if(r++,null==t)continue;let i=this.mapsById[n.map].elevation||0,a=this.mapsById[t.map].elevation||0,s=Math.abs(i-a);this.edges[n.id].push(new xn({destination:t,elevationDelta:s,origin:n,vortex:e})),this.edges[t.id].push(new xn({destination:n,elevationDelta:s,origin:t,vortex:e}))}}}))}aStar(e,t,n){let r=e.map((e=>this.nodesById[e])).filter((e=>e)),i=t.map((e=>this.nodesById[e])).filter((e=>e));if(0===r.length||0===i.length)return[];let a=[],s={},o={};for(r.forEach((e=>{let t=this.getShortestEuclideanDistance(e,i);a.push({origin:e,priority:t}),s[e.id]=null,o[e.id]=0})),a.sort(((e,t)=>e.priority-t.priority));a.length>0;){let e=a[0];if(i.includes(e.origin)){let t=[],n=s[e.origin.id];for(;null!=n;){t.push(n);let e=s[n.origin.id];n=null!=e?e:null}return t.reverse()}for(let t of this.edges[e.origin.id]){let r=t.vortex&&!1===t.vortex.accessible;if(n&&(r||!1===t.origin.accessible||!1===t.destination.accessible))continue;let l=o[e.origin.id]+t.weight;if(null==o[t.destination.id]||l<o[t.destination.id]){o[t.destination.id]=l;let e=l+this.getShortestEuclideanDistance(t.destination,i);a.push({origin:t.destination,priority:e}),s[t.destination.id]=t}}a.splice(0,1),a.sort(((e,t)=>e.priority-t.priority))}return[]}getDistance(e,t){let n,r=e.x-t.x,i=e.y-t.y,a=r*r+i*i;return n=null==this.mapsById[e.map]?1:this.mapsById[e.map]._scale,Math.sqrt(a)/n}getShortestEuclideanDistance(e,t){return t.reduce(((t,n)=>{let r=this.getDistance(e,n);return Math.min(t,r)}),Number.MAX_VALUE)}},Mr=br;function yp(e){switch(e){case"down":case"up":return`${e} `;default:return""}}h(),h();var wr=class{node;instruction;action;atLocation;type;distance=0;constructor({origin:e,action:t,distance:n,atLocation:r,instruction:i}){this.node=e,this.action=t,this.distance=n||0,this.atLocation=r,this.instruction="",i?this.instruction=i:(null!=t&&"Departure"===t.type?this.instruction=null!=r?`Depart from ${r.name}`:"Depart from current location":null!=t&&"Arrival"===t.type?this.instruction=null!=r?`Arrive at ${r.name}`:"Arrive at destination":null!=t&&"TakeVortex"===t.type?this.instruction=`Take ${r&&r.name} ${yp(t.direction)}to ${t.toMap.name}`:null!=t&&"ExitVortex"===t.type?this.instruction=`Exit ${r&&r.name} at ${t.toMap.name}`:null!=t&&"Right"===t.bearing?this.instruction="Turn right":null!=t&&"SlightRight"===t.bearing?this.instruction="Turn slightly right":null!=t&&"Straight"===t.bearing?this.instruction="Head straight":null!=t&&"SlightLeft"===t.bearing?this.instruction="Turn slightly left":null!=t&&"Left"===t.bearing&&(this.instruction="Turn left"),null!=t&&"Turn"===t.type&&r&&(this.instruction+=` at ${r.name}`))}},Ze=wr,_n=.1*Math.PI;function jn(e,t){return((t-e+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var xr=class{graph;locationsByNodeId;constructor({locations:e,nodes:t,vortexes:n,maps:r,showVortexNames:i}){this.graph=new Mr({maps:r,nodes:t,showVortexNames:i,vortexes:n}),this.locationsByNodeId=e.reduce(((e,t)=>(t.nodes&&t.nodes.forEach((n=>{e[n.node]=t})),t.polygons&&t.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{e[n]=t}))})),e)),{})}getClosestLocationInRay(e,t=.5*Math.PI,n=10){let r=0,i=0,a=e;for(;Math.abs(r)<t&&i<n;){let e=this.graph.edges[a.destination.id],s=null,o=0;for(let t of e)if(t.distance>0)if(null!=s){let e=-jn(a.angle,t.angle);Math.abs(e)<Math.abs(o)&&(s=t,o=e)}else s=t,o=-jn(a.angle,t.angle);if(null==s)return null;{if(Math.abs(o)>=t||(r+=o,i+=s.distance,Math.abs(r)>=t||i>n))return null;let e=this.locationsByNodeId[s.destination.id];if(null!=e)return e;a=s}}return null}getDirections({originIds:e,destinationNodeIds:t,accessible:n,departFrom:r,arriveAt:i}){let a=this.graph.aStar(e,t,n);if(0===a.length)return{distance:0,instructions:[new Ze({distance:0,instruction:"No Valid Path Available"})],path:[]};let s=0,o=new Array(a.length+1);for(let e=0;e<a.length;e++)o[e]=a[e].origin;o[a.length]=a[a.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let e=0;e<a.length;e++){let t=a[e],n=t.origin,o=t.destination;if(s+=t.distance,c+=h?.distance||0,0===e&&l.push(new Ze({action:{type:"Departure"},atLocation:r,distance:0,origin:n})),null!=t.vortex){let e=this.graph.mapsById[n.map],r=this.graph.mapsById[o.map],i="none";if(null!=e.elevation&&null!=r.elevation){let t=e.elevation-r.elevation;t>0?i="down":t<0&&(i="up")}l.push(new Ze({action:{direction:i,fromMap:e,toMap:r,type:"TakeVortex"},atLocation:t.vortex,distance:c,origin:n})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let e=this.graph.mapsById[u.map],t=this.graph.mapsById[h.destination.map];l.push(new Ze({action:{fromMap:e,toMap:t,type:"ExitVortex"},atLocation:h.vortex,distance:c,origin:n})),d+=c,c=0}else{let e=this.graph.edges[n.id].filter((e=>e.destination!==u&&e.destination!==t.destination));if(e.length>0){let r=-jn(h.angle,t.angle),i=e.reduce(((e,n)=>{let r=-jn(t.angle,n.angle);return Math.min(e,Math.abs(r))}),Math.PI);if(Math.abs(r)>=_n||Math.abs(i)<=_n){let e;e=r<=-Math.PI/4?"Right":r<=-_n?"SlightRight":r<=_n?"Straight":r<=Math.PI/4?"SlightLeft":"Left";let t=this.locationsByNodeId[n.id];if(t||(t=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=t){let r=new Ze({action:{bearing:e,referencePosition:"At",type:"Turn"},atLocation:t,distance:c,origin:n});r.type=e,l.push(r)}else l.push(new Ze({action:{bearing:e,referencePosition:"At",type:"Turn"},distance:c,origin:n}));d+=c,c=0}}}e===a.length-1&&(l.push(new Ze({action:{type:"Arrival"},atLocation:i,distance:s-d<0?0:s-d,origin:t.destination})),d+=c,c=0),u=n,h=t}let f=[],p=null;for(let e=l.length-1;e>=0;e--){let t=l[e],{action:n}=t;n&&"TakeVortex"===n.type?(p=t.node,f.unshift(t)):n&&"Turn"===n.type&&null!=p?this.graph.getDistance(t.node,p)>5&&f.unshift(t):f.unshift(t)}return{distance:s,instructions:f,path:o}}},_r=xr;function Oo(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return zo(this.cover(t,n),t,n,e)}function zo(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a,s,o,l,u,h,c,d,f=e._root,p={data:r},g=e._x0,y=e._y0,m=e._x1,v=e._y1;if(!f)return e._root=p,e;for(;f.length;)if((u=t>=(a=(g+m)/2))?g=a:m=a,(h=n>=(s=(y+v)/2))?y=s:v=s,i=f,!(f=f[c=h<<1|u]))return i[c]=p,e;if(o=+e._x.call(null,f.data),l=+e._y.call(null,f.data),t===o&&n===l)return p.next=f,i?i[c]=p:e._root=p,e;do{i=i?i[c]=new Array(4):e._root=new Array(4),(u=t>=(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 i[d]=f,i[c]=p,e}function Ao(e){var t,n,r,i,a=e.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(r=+this._x.call(null,t=e[n]))||isNaN(i=+this._y.call(null,t))||(s[n]=r,o[n]=i,r<l&&(l=r),r>h&&(h=r),i<u&&(u=i),i>c&&(c=i));if(l>h||u>c)return this;for(this.cover(l,u).cover(h,c),n=0;n<a;++n)zo(this,s[n],o[n],e[n]);return this}function No(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var s,o,l=i-n||1,u=this._root;n>e||e>=i||r>t||t>=a;)switch(o=(t<r)<<1|e<n,s=new Array(4),s[o]=u,u=s,l*=2,o){case 0:i=n+l,a=r+l;break;case 1:n=i-l,a=r+l;break;case 2:i=n+l,r=a-l;break;case 3:n=i-l,r=a-l}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function Eo(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e}function So(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function re(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function Po(e,t,n){var r,i,a,s,o,l,u,h=this._x0,c=this._y0,d=this._x1,f=this._y1,p=[],g=this._root;for(g&&p.push(new re(g,h,c,d,f)),null==n?n=1/0:(h=e-n,c=t-n,d=e+n,f=t+n,n*=n);l=p.pop();)if(!(!(g=l.node)||(i=l.x0)>d||(a=l.y0)>f||(s=l.x1)<h||(o=l.y1)<c))if(g.length){var y=(i+s)/2,m=(a+o)/2;p.push(new re(g[3],y,m,s,o),new re(g[2],i,m,y,o),new re(g[1],y,a,s,m),new re(g[0],i,a,y,m)),(u=(t>=m)<<1|e>=y)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=l)}else{var v=e-+this._x.call(null,g.data),_=t-+this._y.call(null,g.data),w=v*v+_*_;if(w<n){var M=Math.sqrt(n=w);h=e-M,c=t-M,d=e+M,f=t+M,r=g.data}}return r}function Fo(e){if(isNaN(a=+this._x.call(null,e))||isNaN(s=+this._y.call(null,e)))return this;var t,n,r,i,a,s,o,l,u,h,c,d,f=this._root,p=this._x0,g=this._y0,y=this._x1,m=this._y1;if(!f)return this;if(f.length)for(;;){if((u=a>=(o=(p+y)/2))?p=o:y=o,(h=s>=(l=(g+m)/2))?g=l:m=l,t=f,!(f=f[c=h<<1|u]))return this;if(!f.length)break;(t[c+1&3]||t[c+2&3]||t[c+3&3])&&(n=t,d=c)}for(;f.data!==e;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):t?(i?t[c]=i:delete t[c],(f=t[0]||t[1]||t[2]||t[3])&&f===(t[3]||t[2]||t[1]||t[0])&&!f.length&&(n?n[d]=f:this._root=f),this):(this._root=i,this)}function Do(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Lo(){return this._root}function Co(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e}function Ro(e){var t,n,r,i,a,s,o=[],l=this._root;for(l&&o.push(new re(l,this._x0,this._y0,this._x1,this._y1));t=o.pop();)if(!e(l=t.node,r=t.x0,i=t.y0,a=t.x1,s=t.y1)&&l.length){var u=(r+a)/2,h=(i+s)/2;(n=l[3])&&o.push(new re(n,u,h,a,s)),(n=l[2])&&o.push(new re(n,r,h,u,s)),(n=l[1])&&o.push(new re(n,u,i,a,h)),(n=l[0])&&o.push(new re(n,r,i,u,h))}return this}function Bo(e){var t,n=[],r=[];for(this._root&&n.push(new re(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var i=t.node;if(i.length){var a,s=t.x0,o=t.y0,l=t.x1,u=t.y1,h=(s+l)/2,c=(o+u)/2;(a=i[0])&&n.push(new re(a,s,o,h,c)),(a=i[1])&&n.push(new re(a,h,o,l,c)),(a=i[2])&&n.push(new re(a,s,c,h,u)),(a=i[3])&&n.push(new re(a,h,c,l,u))}r.push(t)}for(;t=r.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this}function qo(e){return e[0]}function Go(e){return arguments.length?(this._x=e,this):this._x}function Uo(e){return e[1]}function Vo(e){return arguments.length?(this._y=e,this):this._y}function na(e,t,n){var r=new jr(t??qo,n??Uo,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function jr(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function $o(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h();var he=na.prototype=jr.prototype;he.copy=function(){var e,t,n=new jr(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=$o(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=$o(t));return n},he.add=Oo,he.addAll=Ao,he.cover=No,he.data=Eo,he.extent=So,he.find=Po,he.remove=Fo,he.removeAll=Do,he.root=Lo,he.size=Co,he.visit=Ro,he.visitAfter=Bo,he.x=Go,he.y=Vo;var Le,te,pt=class{constructor(e){ee(this,Le,void 0),ye(this,"categories"),ye(this,"locations"),ye(this,"vortexes"),ye(this,"maps"),ye(this,"nodes"),ye(this,"polygons"),ye(this,"events"),ye(this,"mapGroups"),ye(this,"locationStates"),ye(this,"rankings"),ee(this,te,{}),Y(this,Le,e)}get polygonsByMapId(){if(N(this,te).polygonsByMapId)return N(this,te).polygonsByMapId;let e,t={};for(let n=0,r=N(this,Le).polygons.length;n<r;++n)e=N(this,Le).polygons[n],t[e.map.id]||(t[e.map.id]=[]),t[e.map.id].push(e);let n=Object.entries(t).reduce(((e,[t,n])=>(e.set(t,n),e)),new Map);return N(this,te).polygonsByMapId=n,N(this,te).polygonsByMapId}get nodesByMapId(){if(N(this,te).nodesByMapId)return N(this,te).nodesByMapId;let e,t={};for(let n=0,r=N(this,Le).nodes.length;n<r;++n)e=N(this,Le).nodes[n],t[e.map.id]||(t[e.map.id]=[]),t[e.map.id].push(e);let n=Object.entries(t).reduce(((e,[t,n])=>(e.set(t,n),e)),new Map);return N(this,te).nodesByMapId=n,N(this,te).nodesByMapId}findNearestNodeOnMap(e,t){if(N(this,te).nodeTreesByMap||(N(this,te).nodeTreesByMap=new Map),!N(this,te).nodeTreesByMap.has(e)){let t=this.nodesByMapId.get(e)??[],n=na();n.x((e=>e.x)),n.y((e=>e.y)),n.addAll(t),N(this,te).nodeTreesByMap.set(e,n)}return N(this,te).nodeTreesByMap.get(e).find(t.x,t.y)}get locationsByMapId(){if(N(this,te).locationsByMapId)return N(this,te).locationsByMapId;let e,t={};for(let n=0,r=N(this,Le).locations.length;n<r;++n){e=N(this,Le).locations[n];for(let n=0,r=e.polygons.length;n<r;++n)t[e.polygons[n].map.id]||(t[e.polygons[n].map.id]=[]),t[e.polygons[n].map.id].push(e)}let n=Object.entries(t).reduce(((e,[t,n])=>(e.set(t,n),e)),new Map);return N(this,te).locationsByMapId=n,N(this,te).locationsByMapId}static create(e){return pt.instances.has(e)||pt.instances.set(e,new pt(e)),pt.instances.get(e)}static clear(){pt.instances.clear()}},Tn=pt;Le=new WeakMap,te=new WeakMap,ye(Tn,"instances",new Map);var Me=Tn;h(),h(),h(),h();var Wo=" ",ce=class{static get separator(){return Wo}static set separator(e){Wo=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);let t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}static toDms(e,t="d",n){if(isNaN(e)||"string"==typeof e&&""==e.trim()||"boolean"==typeof e||e==1/0||null==e)return null;if(void 0===n)switch(t){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:t="d",n=4}e=Math.abs(e);let r=null,i=null,a=null,s=null;switch(t){default:case"d":case"deg":i=e.toFixed(n),i<100&&(i="0"+i),i<10&&(i="0"+i),r=i+"°";break;case"dm":case"deg+min":i=Math.floor(e),a=(60*e%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),i=("000"+i).slice(-3),a<10&&(a="0"+a),r=i+"°"+ce.separator+a+"′";break;case"dms":case"deg+min+sec":i=Math.floor(e),a=Math.floor(3600*e/60)%60,s=(3600*e%60).toFixed(n),60==s&&(s=(0).toFixed(n),a++),60==a&&(a=0,i++),i=("000"+i).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),r=i+"°"+ce.separator+a+"′"+ce.separator+s+"″"}return r}static toLat(e,t,n){let r=ce.toDms(ce.wrap90(e),t,n);return null===r?"–":r.slice(1)+ce.separator+(e<0?"S":"N")}static toLon(e,t,n){let r=ce.toDms(ce.wrap180(e),t,n);return null===r?"–":r+ce.separator+(e<0?"W":"E")}static toBrng(e,t,n){let r=ce.toDms(ce.wrap360(e),t,n);return null===r?"–":r.replace("360","0")}static fromLocale(e){let t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(e){let t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=ce.wrap360(e);let n=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*n/360)%n*16/n]}static wrap360(e){return 0<=e&&e<360?e:(e%360+360)%360}static wrap180(e){return-180<e&&e<=180?e:(e+540)%360-180}static wrap90(e){return-90<=e&&e<=90?e:Math.abs((e%360+270)%360-180)-90}};Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var G=ce,J=Math.PI,A=class{constructor(e,t){if(isNaN(e))throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t))throw new TypeError(`invalid lon ‘${t}’`);this._lat=G.wrap90(Number(e)),this._lon=G.wrap180(Number(t))}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?G.wrap90(G.parse(e)):G.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?G.wrap90(G.parse(e)):G.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?G.wrap180(G.parse(e)):G.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?G.wrap180(G.parse(e)):G.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?G.wrap180(G.parse(e)):G.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");if(null===e[0]||null===e[1])throw new TypeError("invalid (null) point");let t,n;if(2==e.length&&([t,n]=e,t=G.wrap90(G.parse(t)),n=G.wrap180(G.parse(n)),isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e.toString()}’`);if(1==e.length&&"string"==typeof e[0]&&([t,n]=e[0].split(","),t=G.wrap90(G.parse(t)),n=G.wrap180(G.parse(n)),isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e[0]}’`);if(1==e.length&&"object"==typeof e[0]){let r=e[0];if("Point"==r.type&&Array.isArray(r.coordinates)?[n,t]=r.coordinates:(null!=r.latitude&&(t=r.latitude),null!=r.lat&&(t=r.lat),null!=r.longitude&&(n=r.longitude),null!=r.lng&&(n=r.lng),null!=r.lon&&(n=r.lon),t=G.wrap90(G.parse(t)),n=G.wrap180(G.parse(n))),isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if(isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${e.toString()}’`);return new A(t,n)}distanceTo(e,t=6371e3){if(e instanceof A||(e=A.parse(e)),isNaN(t))throw new TypeError(`invalid radius ‘${t}’`);let n=t,r=this.lat.toRadians(),i=this.lon.toRadians(),a=e.lat.toRadians(),s=a-r,o=e.lon.toRadians()-i,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(r)*Math.cos(a)*Math.sin(o/2)*Math.sin(o/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(e){if(e instanceof A||(e=A.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),n=e.lat.toRadians(),r=(e.lon-this.lon).toRadians(),i=Math.cos(t)*Math.sin(n)-Math.sin(t)*Math.cos(n)*Math.cos(r),a=Math.sin(r)*Math.cos(n),s=Math.atan2(a,i).toDegrees();return G.wrap360(s)}finalBearingTo(e){e instanceof A||(e=A.parse(e));let t=e.initialBearingTo(this)+180;return G.wrap360(t)}midpointTo(e){e instanceof A||(e=A.parse(e));let t=this.lat.toRadians(),n=this.lon.toRadians(),r=e.lat.toRadians(),i=(e.lon-this.lon).toRadians(),a=Math.cos(t),s=0,o=Math.sin(t),l={x:a+Math.cos(r)*Math.cos(i),y:s+Math.cos(r)*Math.sin(i),z:o+Math.sin(r)},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 A(c,d)}intermediatePointTo(e,t){if(e instanceof A||(e=A.parse(e)),this.equals(e))return new A(this.lat,this.lon);let n=this.lat.toRadians(),r=this.lon.toRadians(),i=e.lat.toRadians(),a=e.lon.toRadians(),s=i-n,o=a-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-t)*u)/Math.sin(u),c=Math.sin(t*u)/Math.sin(u),d=h*Math.cos(n)*Math.cos(r)+c*Math.cos(i)*Math.cos(a),f=h*Math.cos(n)*Math.sin(r)+c*Math.cos(i)*Math.sin(a),p=h*Math.sin(n)+c*Math.sin(i),g=Math.atan2(p,Math.sqrt(d*d+f*f)),y=Math.atan2(f,d),m=g.toDegrees(),v=y.toDegrees();return new A(m,v)}destinationPoint(e,t,n=6371e3){let r=e/n,i=Number(t).toRadians(),a=this.lat.toRadians(),s=this.lon.toRadians(),o=Math.sin(a)*Math.cos(r)+Math.cos(a)*Math.sin(r)*Math.cos(i),l=Math.asin(o),u=Math.sin(i)*Math.sin(r)*Math.cos(a),h=Math.cos(r)-Math.sin(a)*o,c=s+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new A(d,f)}static intersection(e,t,n,r){if(e instanceof A||(e=A.parse(e)),n instanceof A||(n=A.parse(n)),isNaN(t))throw new TypeError(`invalid brng1 ‘${t}’`);if(isNaN(r))throw new TypeError(`invalid brng2 ‘${r}’`);let i=e.lat.toRadians(),a=e.lon.toRadians(),s=n.lat.toRadians(),o=n.lon.toRadians(),l=Number(t).toRadians(),u=Number(r).toRadians(),h=s-i,c=o-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(i)*Math.cos(s)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new A(e.lat,e.lon);let f=(Math.sin(s)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),p=(Math.sin(i)-Math.sin(s)*Math.cos(d))/(Math.sin(d)*Math.cos(s)),g=Math.acos(Math.min(Math.max(f,-1),1)),y=Math.acos(Math.min(Math.max(p,-1),1)),m=l-(Math.sin(o-a)>0?g:2*J-g),v=(Math.sin(o-a)>0?2*J-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(i)*Math.cos(w)+Math.cos(i)*Math.sin(w)*Math.cos(l),-1),1)),b=a+Math.atan2(Math.sin(l)*Math.sin(w)*Math.cos(i),Math.cos(w)-Math.sin(i)*Math.sin(M)),x=M.toDegrees(),O=b.toDegrees();return new A(x,O)}crossTrackDistanceTo(e,t,n=6371e3){e instanceof A||(e=A.parse(e)),t instanceof A||(t=A.parse(t));let r=n;if(this.equals(e))return 0;let i=e.distanceTo(this,r)/r,a=e.initialBearingTo(this).toRadians(),s=e.initialBearingTo(t).toRadians();return Math.asin(Math.sin(i)*Math.sin(a-s))*r}alongTrackDistanceTo(e,t,n=6371e3){e instanceof A||(e=A.parse(e)),t instanceof A||(t=A.parse(t));let r=n;if(this.equals(e))return 0;let i=e.distanceTo(this,r)/r,a=e.initialBearingTo(this).toRadians(),s=e.initialBearingTo(t).toRadians(),o=Math.asin(Math.sin(i)*Math.sin(a-s));return Math.acos(Math.cos(i)/Math.abs(Math.cos(o)))*Math.sign(Math.cos(s-a))*r}maxLatitude(e){let t=Number(e).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(t)*Math.cos(n))).toDegrees()}static crossingParallels(e,t,n){if(e.equals(t))return null;let r=Number(n).toRadians(),i=e.lat.toRadians(),a=e.lon.toRadians(),s=t.lat.toRadians(),o=t.lon.toRadians()-a,l=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.sin(o),u=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.cos(o)-Math.cos(i)*Math.sin(s)*Math.cos(r),h=Math.cos(i)*Math.cos(s)*Math.sin(r)*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)),f=a+c+d,p=(a+c-d).toDegrees(),g=f.toDegrees();return{lon1:G.wrap180(p),lon2:G.wrap180(g)}}rhumbDistanceTo(e,t=6371e3){e instanceof A||(e=A.parse(e));let n=t,r=this.lat.toRadians(),i=e.lat.toRadians(),a=i-r,s=Math.abs(e.lon-this.lon).toRadians();Math.abs(s)>J&&(s=s>0?-(2*J-s):2*J+s);let o=Math.log(Math.tan(i/2+J/4)/Math.tan(r/2+J/4)),l=Math.abs(o)>1e-11?a/o:Math.cos(r);return Math.sqrt(a*a+l*l*s*s)*n}rhumbBearingTo(e){if(e instanceof A||(e=A.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),n=e.lat.toRadians(),r=(e.lon-this.lon).toRadians();Math.abs(r)>J&&(r=r>0?-(2*J-r):2*J+r);let i=Math.log(Math.tan(n/2+J/4)/Math.tan(t/2+J/4)),a=Math.atan2(r,i).toDegrees();return G.wrap360(a)}rhumbDestinationPoint(e,t,n=6371e3){let r=this.lat.toRadians(),i=this.lon.toRadians(),a=Number(t).toRadians(),s=e/n,o=s*Math.cos(a),l=r+o;Math.abs(l)>J/2&&(l=l>0?J-l:-J-l);let u=Math.log(Math.tan(l/2+J/4)/Math.tan(r/2+J/4)),h=Math.abs(u)>1e-11?o/u:Math.cos(r),c=i+s*Math.sin(a)/h,d=l.toDegrees(),f=c.toDegrees();return new A(d,f)}rhumbMidpointTo(e){e instanceof A||(e=A.parse(e));let t=this.lat.toRadians(),n=this.lon.toRadians(),r=e.lat.toRadians(),i=e.lon.toRadians();Math.abs(i-n)>J&&(n+=2*J);let a=(t+r)/2,s=Math.tan(J/4+t/2),o=Math.tan(J/4+r/2),l=Math.tan(J/4+a/2),u=((i-n)*Math.log(l)+n*Math.log(o)-i*Math.log(s))/Math.log(o/s);isFinite(u)||(u=(n+i)/2);let h=a.toDegrees(),c=u.toDegrees();return new A(h,c)}static areaOf(e,t=6371e3){let n=t,r=e[0].equals(e[e.length-1]);r||e.push(e[0]);let i=e.length-1,a=0;for(let t=0;t<i;t++){let n=e[t].lat.toRadians(),r=e[t+1].lat.toRadians(),i=(e[t+1].lon-e[t].lon).toRadians();a+=2*Math.atan2(Math.tan(i/2)*(Math.tan(n/2)+Math.tan(r/2)),1+Math.tan(n/2)*Math.tan(r/2))}(function(e){let t=0,n=e[0].initialBearingTo(e[1]);for(let r=0;r<e.length-1;r++){let i=e[r].initialBearingTo(e[r+1]),a=e[r].finalBearingTo(e[r+1]);t+=(i-n+540)%360-180,t+=(a-i+540)%360-180,n=a}let r=e[0].initialBearingTo(e[1]);return t+=(r-n+540)%360-180,Math.abs(t)<90})(e)&&(a=Math.abs(a)-2*J);let s=Math.abs(a*n*n);return r||e.pop(),s}equals(e){return e instanceof A||(e=A.parse(e)),!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(e="d",t){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);if("n"==e)return null==t&&(t=4),`${this.lat.toFixed(t)},${this.lon.toFixed(t)}`;return`${G.toLat(this.lat,e,t)}, ${G.toLon(this.lon,e,t)}`}};h(),h(),h();var ra=class{destinations=[];constructor(e){this.destinations=e}};h();var wt=class{#e;#t;distance=0;path=[];instructions=[];constructor(e,t){this.#t=e,this.#e=t,this.distance=t.distance,this.instructions=t.instructions.map((e=>{let t={...e,action:{...e.action},atLocation:e.atLocation?.id?this.#t?._vortexesById?.[e.atLocation.id]:void 0,node:e.node?.id?this.#t?._nodesById?.[e.node.id]:void 0};return("TakeVortex"===t.action?.type||"ExitVortex"===t.action?.type)&&(t.action.fromMap=this.#t._mapsById?.[t.action?.fromMap.id],t.action.toMap=this.#t._mapsById?.[t.action?.toMap.id]),t})),this.path=t.path.map((e=>this.#t?._nodesById?.[e.id]))}toJSON(){return this.#e}},Ue=class{#e;constructor(e){this.#e=e}directionsTo(e,t){if(e instanceof ra){let n=[],r=this;for(let i=0;i<e.destinations.length;i++){let a=e.destinations[i],s=ia(r),o=ia(a),l=this.#e.navigator.getDirections({originIds:s,destinationNodeIds:o,accessible:t?.accessible||!1}),u=new wt(this.#e,l);n.push(u),r=a}return n}{let n=ia(this),r=ia(e),i=this.#e.navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:t?.accessible||!1});return new wt(this.#e,i)}}distanceTo(e,t){return this.directionsTo(e,t)?.distance||0}},kp=0,bp="9999-12-31T00:00:00.000Z";function Mp(e,t,n=new Date){if(!e.states)return;let r=n||new Date,i=e.states.find((e=>{let t=new Date(e.start||kp),n=new Date(e.end||bp);return t<r&&n>r}));return i?t.find((e=>e.value===i.type)):void 0}var we=class extends Ue{#e;#t;#n={};states;id="";name="";type="";description;sortOrder;logo;phone;social;color;shortName;detailsUrl;tags;externalId;showLabelWhenImagePresent;picture;operationHours;siblingGroups;gallery;constructor(e,t){super(e),this.#e=e,this.#t=t;let n=Object.assign({},t);delete n.categories,Object.assign(this,n)}#r;get polygons(){let e=this.#n.polygons;if(typeof e<"u")return e;let t=[],n=this.#r,r=this.#e._polygonsById;if(Array.isArray(n))for(let e=0,i=n.length;e<i;++e){let i=r[n[e].id];null!=i&&i.geometry.visible&&t.push(i)}return this.#n.polygons=t,t}set polygons(e){this.#r=e}#i=[];get nodes(){let e=this.#n.nodes;if(typeof e<"u")return e;let t=[],n=this.#i,r=this.#e._nodesById;if(n)for(let e=0,i=n.length;e<i;++e){let i=r[n[e].node];null!=i&&t.push(i)}return this.#n.nodes=t,t}set nodes(e){this.#i=e}#a;get parent(){let e=this.#n.parent;if(typeof e<"u")return e;let t,n=this.#e._locationsById,r=this.#a;return void 0!==r&&(t=n[r]),this.#n.parent=t,t}set parent(e){this.#a=e}get categories(){let e=this.#n.categories;if(typeof e<"u")return e;let t=[];return this.#t.categories.forEach((e=>{let n=this.#e.getCollectionItemById("categories",e);n&&t.push(n)})),this.#n.categories=t,t}get state(){return Mp(this,this.#e.locationStates)}clone(){return new we(this.#e,this.#t)}get nodeOperationHours(){let e=this.#n.nodeOperationHours;if(typeof e<"u")return e;if(null==this.nodes)return{};let t=this.#t.nodes.reduce(((e,t)=>(null!=t.operationHours&&(e[t.node]=t.operationHours),e)),{});return this.#n.nodeOperationHours=t,t}static hydrate(e,t){return e.map((e=>new we(t,e)))}static async fetch(e){let t=e.options.things.locations.slice();e.options.things.categories&&K(t,"categories"),e.options.things.nodes&&K(t,"nodes"),e.options.things.polygons&&K(t,"polygons"),e.options.things.locationStates&&K(t,"states");let n={fields:t,venue:e.options.venue};try{let t=await Z(e.options,"location",n);return e.options.includeHidden||(t=t.filter((e=>!e.hidden))),t.map((t=>new we(e,t)))}catch(e){return z.error("Fetch Locations:",e),[]}}toJSON(){let e=this.#t;return delete e.color,e}};h();var Ce=class extends Ue{#e;#t;#n={};geometry;perspectives;image;holes;textures;material;label;id="";layer;layerId;name;externalId;vertexes;canvasBounds;constructor(e,t){super(e),this.#e=e,this.#t=t;let n=Object.assign({},t);delete n.map,Object.assign(this,n)}get map(){let e=this.#n.map;if(typeof e<"u")return e;let t=this.#e.getCollectionItemById("maps",this.#t.map);return this.#n.map=t,t}get locations(){let e=this.#n.locations;if(typeof e<"u")return e;let t=[],n=Me.instances.get(this.#e)?.locationsByMapId.get(this.map.id)??[],{id:r}=this;for(let e=0,i=n.length;e<i;++e){let i=n[e],a=i.polygons;if(Array.isArray(a))for(let e=0,n=a.length;e<n;++e)if(a[e].id===r){t.push(i);break}}return this.#n.locations=t,t}#r;get entrances(){let e=this.#n.entrances;if(typeof e<"u")return e;let t=[],n=this.#r,r=this.#e._nodesById;if(Array.isArray(n)){for(let e=0,i=n.length;e<i;++e){let i=r[n[e].id];null!=i&&t.push(i)}return this.#n.entrances=t,t}return[]}set entrances(e){this.#r=e}get rank(){let e=this.#n.rank;if(typeof e<"u")return e;let{rankings:t}=this.#e;if(!t||!t.polygons)return null;let n=t.polygons.find((e=>e.polygonId===this.id));return n?(this.#n.rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(this.#n.rank=null,null)}static hydrate(e,t){return e.map((e=>new Ce(t,e)))}static async fetch(e){let t=e.options.things.polygons.slice();e.options.things.maps&&K(t,"map"),e.options.things.nodes&&K(t,"entrances");let n={fields:t,venue:e.options.venue};try{return(await Z(e.options,"polygon",n)).filter((e=>e.geometry.visible)).map((t=>new Ce(e,t)))}catch(e){return z.error("Fetch Polygons:",e),[]}}toJSON(){return this.#t}};function Yo(e){return/^[\da-f]{24}$/i.test(e)}function Ho(e,t=!1){let n="";if(null!=e){let r="?",i=t?Object.keys(e).filter((e=>!["slug","venue"].includes(e))):Object.keys(e);for(let t=0,a=i.length;t<a;++t){let a=i[t],s=e[a];null!=s&&(n+=`${r+encodeURIComponent(a)}=${encodeURIComponent(s)}`,r="&")}}return n}function wp(e,t,n,r=!1){return r?`${e.supplementaryUrl}${t}?venue=${n.venue||n.slug}`:e.baseUrl?.includes("gateway")?`${e.baseUrl}${t}/${n.venue||n.slug}${Ho(n,e.baseUrl?.includes("gateway"))}`:e.baseUrl+t+Ho(n)}async function Z(e,t,n,r=!1){return Tr(e,t,n,r,!0)}async function Tr(e,t,n,r=!1,i=!1){let a=wp(e,t,n,r),s=await In(e,a,r);if(!i&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}async function In(e,t,n=!1){let r={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};n&&delete r.language,r.language&&(t+=`&lang=${encodeURIComponent(r.language)}`);let{headers:i}=e;i["Content-Type"]="text/json",e.authorization&&(i.Authorization=e.authorization),r.language&&(i["Accept-Language"]=r.language);let a={method:"GET",headers:i},s=await Qe()(t,a);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()}function K(e,t){e.indexOf(t)<0&&e.push(t)}function Xo([e,t],[n,r]){let i=new A(e,t),a=new A(n,r);return i.distanceTo(a)}function Jo(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale);let t;try{let n=e.georeference[0],r=e.georeference[2],i=new A(n.target.x,n.target.y),a=new A(r.target.x,r.target.y),s=i.distanceTo(a),o=n.control.x-r.control.x,l=n.control.y-r.control.y;t=Math.sqrt(o*o+l*l)/s}catch(n){t=1,z.warn(n),z.warn(`Couldn't georeference ${e.name||e.shortName||e.id}. Probably not enough geocoordinates.`)}return t}function ia(e){return e instanceof Ce?e.entrances.map((e=>e.id)):e instanceof we?e.nodes?.map((e=>e.id))||[]:[e.id]}async function Ko(e){let t={},{maps:n,images:r,scenes:i,polygons:a}=e;if(null!=r)try{let e=Object.keys(r).map((e=>fetch(`data:image/png;base64,${r[e]}`).then((e=>e.blob())).then((n=>{t[e]=n})).catch((e=>{z.error(e)}))));await Promise.all(e)}catch(e){z.error(e)}return n.forEach((e=>{(e.scene?.polygons||i[e.id])&&(null!=i&&i[e.id]&&(e.scene||(e.scene={}),Object.defineProperty(e.scene,"polygons",{get:()=>i[e.id]})),null!=r&&(e.scene.images=e.scene.images.map((({filename:e})=>({filename:e,url:t[e]}))),e.scene.polygons.forEach((e=>{if(e?.image?.url&&e?.image?.url){let n=e.image.url.split("/"),r=t[n[n.length-1]];r&&(e.image.url=r)}}))))})),null!=r&&a.forEach((e=>{if(e?.image?.url){let n=e.image.url.split("/"),r=t[n[n.length-1]];r&&(e.image.url=r)}})),null!=e.images&&delete e.images,null!=e.scenes&&delete e.scenes,e}function Ir(e,t,n){let r;return function(){let i=this,a=arguments,s=function(){r=null,n||e.apply(i,a)},o=n&&!r;clearTimeout(r),r=setTimeout(s,t),o&&e.apply(i,a)}}var Re=class{#e;#t={};#n;name;externalId;parents;id;icon;constructor(e,t){this.id=t.id,this.#n=t,this.#e=e,Object.assign(this,t)}get locations(){let e=this.#t.locations;if(typeof e<"u")return e;let t=[],{locations:n}=this.#e,{id:r}=this;for(let e=0,i=n.length;e<i;++e){let i=n[e],a=i.categories;if(Array.isArray(a))for(let e=0,n=a.length;e<n;++e)if(a[e]?.id===r){t.push(i);break}}return this.#t.locations=t,t}static hydrate(e,t){return e.map((e=>new Re(t,e)))}static async fetch(e){let t={fields:e.options.things.categories,venue:e.options.venue};try{return(await Z(e.options,"category",t)).map((t=>new Re(e,t)))}catch(e){return z.error("Fetch Categories:",e),[]}}toJSON(){return this.#n}};h();var et=class{#e;#t;#n={};id="";type="";name="";description;image;startDate;endDate;showDate;constructor(e,t){this.#t=t,this.#e=e,Object.assign(this,t)}location(){let e=this.#n.location;if(typeof e<"u")return e;let t,n=this.#e._locationsById,r=this.#t.location;if(null!=r){let e=n[r];null!=e&&(t=e)}return this.#n.location=t,t}static hydrate(e,t){return e.map((e=>new et(t,e)))}static async fetch(e){let t=e.options.things.events.slice();e.options.things.locations&&K(t,"location");let n={fields:t,venue:e.options.venue,activeAtOrAfter:Date.now()};try{return(await Z(e.options,"event",n)).map((t=>new et(e,t)))}catch(e){return z.error("Fetch Events:",e),[]}}toJSON(){return this.#t}};h();var ht=class{#e;constructor(e){this.#e=e,Object.assign(this,e)}static hydrate(e){return e.map((e=>new ht(e)))}id="";name="";value="";static async fetch(e){let t={fields:e.options.things.locationStates.slice(),venue:e.options.venue};try{return(await Z(e.options,"location-state",t)).map((e=>new ht(e)))}catch(e){return z.error("Fetch Location States:",e),[]}}toJSON(){return this.#e}};h(),h();var xt=class{map;get x(){return this.#t("x")}get y(){return this.#t("y")}get lat(){return this.#e("lat")}get lon(){return this.#e("lon")}#e(e){if(this.#s&&this.#o)return"lat"===e?this.#s:this.#o;if(null!=this.#l&&null!=this.#u){let[t,n]=this.#a(this.#l,this.#u);return this.#s=t,this.#o=n,"lat"===e?this.#s:this.#o}throw Error("MappedinCoordinate is missing x and y")}#t(e){if(this.#l&&this.#u)return"x"===e?this.#l:this.#u;if(null!=this.#s&&null!=this.#o){let[t,n]=this.#i(this.#s,this.#o);return this.#l=t,this.#u=n,"x"===e?this.#l:this.#u}throw Error("MappedinCoordinate is missing lat and lon")}#n={};#r;#i(e,t){let n=this.map.georeference[0],r=new A(n.target.x,n.target.y),i=new A(e,t),a=r.distanceTo(i),s=(r.finalBearingTo(i)+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]}#a(e,t){let n,r=this.map.georeference[0],i=new A(r.target.x,r.target.y),a=e-r.control.x,s=r.control.y-t,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=i.destinationPoint(u,180*l/Math.PI);return[h.lat,h.lon]}constructor(e){let{map:t,mappedin:n}=e;null!=e.lat&&null!=e.lon&&(this.#s=e.lat,this.#o=e.lon),null!=e.x&&null!=e.y&&(this.#l=e.x,this.#u=e.y),this.map=t,this.#r=n}#s;#o;#l;#u;absoluteDistanceTo(e){return Xo([e.lat,e.lon],[this.lat,this.lon])}get nearestNode(){let e=this.#n.nearestNode;if(typeof e<"u")return e;let t=Me.instances.get(this.#r).findNearestNodeOnMap(this.map.id,this);return this.#n.nearestNode=t,t}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}},tt=class{#e;#t={};#n;id="";group="";name="";shortName="";elevation=0;scale=0;layers;x_scale;perspectiveId;scene;width=0;height=0;georeference=[];constructor(e,t){this.#e=e,this.#n=t,Object.assign(this,t),this._scale=Jo(this),this.scale=this.x_scale||1/this._scale}_scale=0;get polygons(){return Me.instances.get(this.#e)?.polygonsByMapId?.get(this.id)??[]}get locations(){return Me.instances.get(this.#e)?.locationsByMapId?.get(this.id)??[]}get nodes(){return Me.instances.get(this.#e)?.nodesByMapId?.get(this.id)??[]}get mapGroup(){let e=this.#t.mapGroup;if(typeof e<"u")return e;let t=this.group,n=t&&this.#e._mapGroupsById[t]||null;return this.#t.mapGroup=n,n}createCoordinateByXY(e,t){return new xt({x:e,y:t,map:this,mappedin:this.#e})}createCoordinate(e,t){return new xt({lat:e,lon:t,map:this,mappedin:this.#e})}getNorth(){let e;try{let t=this.georeference[0],n=this.georeference[2],r=new A(t.target.x,t.target.y),i=new A(n.target.x,n.target.y);e=-((r.finalBearingTo(i)+0)*Math.PI/180-Math.atan2(n.control.y-t.control.y,n.control.x-t.control.x)-Math.PI/2)}catch(t){e=0,z.warn(t),z.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return e}static hydrate(e,t){return e.map((e=>new tt(t,e)))}static async fetch(e){let t=e.options.things.maps.slice();e.options.perspective&&K(t,"perspectives"),e.options.things.mapGroups&&K(t,"group"),K(t,"elevation"),K(t,"x_scale"),K(t,"scale"),K(t,"georeference");let n={fields:t,perspective:e.options.perspective,venue:e.options.venue};try{let i=await Z(e.options,"map",n),a=e=>{let t=r.layers.find((t=>t.id===e));t?t.visible=!0:r.layers.push({id:e,visible:!0})};for(let n=0,s=i.length;n<s;++n){var r=i[n];if(r){let e=r.perspective;null!=e&&(r.perspectiveId=e.id,t.indexOf("scene")>-1&&(r.scene=e.scene),e.layers?(r.layers.forEach((e=>{e.visible=!1})),e.layers.forEach(a)):r.layers.forEach((e=>{e.visible=!0}))),delete r.perspective}i[n]=new tt(e,r)}return i}catch(e){return z.error("Fetch Maps:",e),[]}}toJSON(){return this.#n}};h();var at=class{#e;#t;#n={};id="";name="";constructor(e,t){this.#t=t,this.#e=e,Object.assign(this,t)}get maps(){let e=this.#n.maps;if(typeof e<"u")return e;let t=[],{maps:n}=this.#e,{id:r}=this.#t;for(let e=0,i=n.length;e<i;++e){let i=n[e];i.group===r&&t.push(i)}return this.#n.maps=t,t}static hydrate(e,t){return e.map((e=>new at(t,e)))}static async fetch(e){let t={fields:e.options.things.mapGroups.slice(),venue:e.options.venue};try{return(await Z(e.options,"map-group",t)).map((t=>new at(e,t)))}catch(e){return z.error("Fetch Map Groups:",e),[]}}toJSON(){return this.#t}};h();var nt=class extends Ue{#e;#t;#n={};id="";x=0;y=0;operationHours;externalId;constructor(e,t){super(e),this.#e=e,this.#t=t;let n=Object.assign({},t);delete n.map,Object.assign(this,n)}get map(){let e=this.#n.map;if(typeof e<"u")return e;let t=this.#e.getCollectionItemById("maps",this.#t.map);return this.#n.map=t,t}get lat(){let e=this.#n.cachedLatLon;if(null!=e)return e.lat;let t=this.#e._mapsById?.[this.map.id];if(null==t)throw new Error("Map not found");return this.#n.cachedLatLon=t.createCoordinateByXY(this.x,this.y),this.#n.cachedLatLon.lat}get lon(){let e=this.#n.cachedLatLon;if(null!=e)return e.lon;let t=this.#e._mapsById?.[this.map.id];if(null==t)throw new Error("Map not found");return this.#n.cachedLatLon=t.createCoordinateByXY(this.x,this.y),this.#n.cachedLatLon.lon}#r;get paths(){let e=this.#n.paths;if(typeof e<"u")return e;let t=[],n=this.#e._nodesById,r=this.#r;if(Array.isArray(r))for(let e=0,i=r.length;e<i;++e){let i=n[r[e].node];null!=i&&t.push(i)}return this.#n.paths=t,t}set paths(e){this.#r=e}get locations(){let e=this.#n.locations;if(typeof e<"u")return e;let t=[],n=Me.instances.get(this.#e)?.locationsByMapId?.get(this.map.id)??[],r=this.id;for(let e=0,i=n.length;e<i;++e){let i=n[e],a=i.nodes;if(Array.isArray(a))for(let e=0,n=a.length;e<n;++e)if(a[e].id===r){t.push(i);break}}return this.#n.locations=t,t}get polygon(){let e=this.#n.polygon;if(typeof e<"u")return e;let t,n=Me.instances.get(this.#e)?.polygonsByMapId?.get(this.map.id)??[],r=this.id;for(let e=0,i=n.length;e<i;++e){let i=n[e];i.entrances.map((e=>e.id)).includes(r)&&(t=i)}return this.#n.polygon=t,t}static hydrate(e,t){return e.map((e=>new nt(t,e)))}static async fetch(e){let t=e.options.things.nodes.slice();e.options.things.maps&&K(t,"map"),["weight","multiplier","accessible"].forEach((function(e){K(t,e)}));let n={fields:t,venue:e.options.venue};try{return(await Z(e.options,"node",n)).map((t=>new nt(e,t)))}catch(e){return z.error("Fetch Nodes:",e),[]}}toJSON(){return this.#t}};h();var rt=class{#e;constructor(e){this.#e=e,Object.assign(this,e)}polygons=[];static hydrate(e){return new rt(e)}static async fetch(e){try{let t=await Tr(e.options,"smart-labels/polygon-label-ranking",{venue:e.options.venue},!0);return new rt(t)}catch(e){return z.error("Fetch Rankings:",e),null}}toJSON(){return this.#e}};h();var mt=class{id="";#e;constructor(e){this.#e=e,Object.assign(this,e)}static hydrate(e){return e.map((e=>new mt(e)))}static async fetch(e){let t={fields:e.options.things.themes.slice(),venue:e.options.venue};try{return(await Z(e.options,"apollo-theme",t)).map((e=>new mt(e)))}catch(e){return z.error("Fetch Theme:",e),[]}}toJSON(){return this.#e}};h();var it=class{#e;#t;#n={};defaultMap="";address="";city="";countrycode="";externalId="";id="";latitude;logo;longitude;metadata;name="";operationHours;postal="";slug="";state="";telephone="";tzid="";tzidOverride="";utcOffset="";website="";constructor(e,t){this.#t=e,this.#e=t,Object.assign(this,t)}static hydrate(e,t){return new it(t,e)}static async fetch(e){let t={fields:e.options.things.venue,slug:e.options.venue,limit:1};try{let n=await Z(e.options,"venue",t);return new it(e,n[0])}catch(e){return z.error("Fetch Venue:",e),{}}}get isMultiBuilding(){if(null==this.#n.isMultiBuilding){let e=this.#t.maps,t=e.reduce(((e,t)=>e.add(t.elevation)),new Set),n=e.length!==t.size;this.#n.isMultiBuilding=n}return this.#n.isMultiBuilding}toJSON(){return this.#e}};h();var ot=class{id="";#e;name;type;weight;multiplier;constructor(e){this.#e=e,Object.assign(this,e)}static hydrate(e){return e.map((e=>new ot(e)))}static async fetch(e){let t=e.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(e){K(t,e)}));let n={fields:t,venue:e.options.venue};try{return(await Z(e.options,"vortex",n)).map((e=>new ot(e)))}catch(e){return z.error("Fetch Vortexes:",e),[]}}toJSON(){return this.#e}};function xp(e,t){let n=[];return e.features.forEach((e=>{let r=[];e.properties.spaces?.forEach((e=>{if("id"in e){let n;n=t.get(e.id),n&&r.push(...n)}else r?.push({id:e.node,level:""})}));let i=r.map((e=>({node:"n_"+e.id,map:e.level}))),a=e.properties.spaces?.filter((e=>"id"in e)),s=(e.properties.hours||[]).map((e=>({...e,"@type":"OpeningHoursSpecification",dayOfWeek:[e.dayOfWeek.replace("http://schema.org/","")]}))),o={...e.properties,polygons:a||[],nodes:i||[],description:e.properties.description||"",logo:e.properties.logo||{},picture:e.properties.picture||{},phone:e.properties.phone||{},social:e.properties.social||{},externalId:e.properties.externalId||"",states:e.properties.states||[],siblingGroups:e.properties.siblingGroups||[],operationHours:s};delete o.spaces,n.push(o)})),n}function _p(e){let t=new Set;return e.features.forEach((e=>{e.properties.states?.forEach((e=>{t.add(e.type)}))})),Array.from(t).map((e=>({id:e,name:e,value:e})))}function jp(e){let t=[];return e.features.forEach((e=>{let n={...e.properties,icon:e.properties.picture};delete n.picture,t.push(n)})),t}function Tp(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;return e.features.forEach((e=>{let a;a="MultiPolygon"===e.geometry.type?e.geometry.coordinates[0].flat():e.geometry.coordinates[0],a.forEach((e=>{t=Math.min(t,e[1]),r=Math.max(r,e[1]),n=Math.min(n,e[0]),i=Math.max(i,e[0])}))})),{id:e.features[0].properties.id,minLat:t,minLong:n,maxLat:r,maxLong:i}}function Ip(e,t,n){let r=n.createGeoreferences(),i=[];return e.features.forEach((e=>{let a=new Set;t.forEach((e=>{e.layer&&a.add(e.layer)}));let s=[...a].map((e=>({id:e,visible:!0}))),o=1/n.mapScale,l={...e.properties,georeference:r,shortName:e.properties.abbreviation||"",scene:{polygons:t},scale:o,x_scale:o,group:e.properties.building,layers:s,width:n.widthInMapUnits,height:n.heightInMapUnits};i.push(l)})),i}h();var Or=class{mapExtent;stretchRatio;midLat;midLong;mapUnitRatio=1e6;latDistance;longDistance;mapScale;widthInMapUnits;heightInMapUnits;constructor(e){this.mapExtent=e;let{minLat:t,minLong:n,maxLat:r,maxLong:i}=e,a=(t+r)/2,s=(n+i)/2,o=new A(a,i),l=new A(a,n),u=new A(t,s),h=new A(r,s);this.latDistance=u.distanceTo(h),this.longDistance=o.distanceTo(l);let c=this.latDistance/this.longDistance,d=(r-t)/(i-n);this.stretchRatio=c/d,this.midLat=a,this.midLong=s,this.widthInMapUnits=(i-n)*this.mapUnitRatio,this.heightInMapUnits=(r-t)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(e){let t=e[1];return{x:(e[0]-this.midLong)*this.mapUnitRatio,y:(this.midLat-t)*this.mapUnitRatio*this.stretchRatio}}createGeoreferences(){let{minLat:e,minLong:t,maxLat:n,maxLong:r}=this.mapExtent;return[[e,t],[e,r],[n,r],[n,t]].map((e=>({target:{x:e[0],y:e[1]},control:this.convert([e[1],e[0]])})))}};function Op(e,t){let n=[];return e.features.forEach((e=>{let r=t.convert(e.geometry.coordinates),i=(e.properties.neighbors||[]).map((t=>({node:t,map:e.properties.level}))),a=e.properties.level,s={...e.properties,x:r.x,y:r.y,paths:i,map:a,externalId:e.properties.externalId||""};n.push(s)})),n}var Zo=(e,t,n,r,i)=>{let a=[];return e.features.forEach((e=>{if(!e.geometry.coordinates[0].forEach)return;let s=[];"entrances"in e.properties&&(s=e.properties.entrances.map((e=>({id:"n_"+e.id,node:"n_"+e.id,map:e.level}))));let o,l=n[e.properties.id],u=t.find((e=>e.id===l)),h=e.geometry.coordinates[0].map((e=>i.convert(e))),c=r.find((t=>t.polygonId===e.properties.id)),d=Math.max(i.widthInMapUnits,i.heightInMapUnits)/1e3;if(c){let e=i.convert([c.position[0],c.position[1]]),t=c.size.x,n=c.size.y,r=i.mapScale,a=n*r,s=t*r/d/c.viewBox.width,l=a/d/c.viewBox.height;o={url:u?.image,visible:!!u?.image,viewBox:c.viewBox,scale:{x:s,y:l},position:{x:e.x,y:e.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let f={...e.properties,entrances:s,map:e.properties.level,externalId:e.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:(u?.altitude||0)*i.mapScale/d},scale:{x:1,y:1,z:(u?.height||1)*i.mapScale/d}},material:{color:u?.color||"#000000"},image:o,vertexes:h};a.push(f)})),a};function zp(e,t,n,r,i,a){let s=Zo(e,n,r,i,a),o=Zo(t,n,r,i,a);return s.concat(o)}function Ap(e){let t=new Map;return e.forEach((e=>{e.features.forEach((e=>{let{destinations:n}=e.properties;if(0===n.length)return;let r=n[0].split("-")[0],i=t.get(r),a=n.map((e=>e.split("-")[1])).map((e=>"n_"+e));if(i)i.nodes.push(...a);else{let{name:n,type:i,weight:s,multiplier:o,accessible:l}=e.properties,u={id:r,nodes:a,name:n,type:i,weight:s,multiplier:o,accessible:l};t.set(r,u)}}))})),Array.from(t.values())}function Np(e){let t=[];return e.features.forEach((e=>{let n={...e.properties};t.push(n)})),t}function Qo(e){let t=Object.keys(e),n=new Map,r=new Map,i=new Map,a=new Map,s=new Map,o=new Map,l=new Map,u=new Map;t.filter((e=>e.indexOf("/")>-1)).forEach((t=>{let h=t.split(/[\/\.]/),c=h[0],d=h[1];switch(c){case"connection":n.set(d,e[t]);break;case"level":r.set(d,e[t]);break;case"node":i.set(d,e[t]);break;case"obstruction":a.set(d,e[t]);break;case"space":s.set(d,e[t]);break;case"style":case"polygon-style":o.set(d,e[t]);break;case"image":l.set(d,e[t]);break;case"image-instance":u.set(d,e[t])}}));let h=e["building.geojson"]||e["building.json"],c=e["category.geojson"]||e["category.json"],d=e["location.geojson"]||e["location.json"],f=e["manifest.geojson"]||e["manifest.json"],p=e["style.json"]||[];return{connection:n,level:r,node:i,obstruction:a,space:s,building:h,category:c,location:d,manifest:f,style:p,polygonStyle:o,imageInstance:u,imageBinaries:l}}function es(e){let t=Array.from(e.connection.values()),n=Array.from(e.level.values()),r=e.building,i=e.category,a=e.style,s=e.location,o=e.imageInstance,l=e.polygonStyle,u={},h=[],c=new Map;n.forEach((t=>{let n=t.features[0].properties.id,r=Tp(t),i=new Or(r);c.set(n,i);let s=e.obstruction.get(n),d=e.space.get(n),f=o.get(n),p=l.get(n);u[n]=zp(d,s,a,p,f,i);let g=e.node.get(n);h.push(...Op(g,i))}));let d=Object.values(u).flat(),f=Ap(t),p=n.map((e=>{let t=e.features[0].properties.id,n=c.get(t);return Ip(e,u[t],n)})).flat(),g=new Map;Array.from(e.space.values()).forEach((e=>{e.features.forEach((e=>{g.set(e.properties.id,e.properties.entrances)}))}));let y=Np(r),m=xp(s,g),v=jp(i),_=_p(s),w=e.manifest.features[0].properties.name,M=e.manifest.features[0].geometry.coordinates[0],b=e.manifest.features[0].geometry.coordinates[1],x=e.imageBinaries;return{locations:m,categories:v,nodes:h,maps:p,polygons:d,vortexes:f,mapGroups:y,locationStates:_,themes:[],venue:{name:w,latitude:b,longitude:M},imageBinaries:x}}h(),h(),h(),h();var ft,Se,Pe,zr=[0,4,6,8,10],Ve=()=>{let e=new Array(16).fill(0),t=4294967296*Math.random();for(let n=0;n<e.length;n++)n>0&&!(3&n)&&(t=4294967296*Math.random()),e[n]=t>>>((3&n)<<3)&255;let n=e.map((e=>e.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],zr.map(((e,t)=>n.slice(e,t===zr.length-1?void 0:zr[t+1]).join(""))).join("-")},ts="mi-session-data",as="mi-local-data",Ar=class{constructor(){ee(this,Se,void 0),ee(this,Pe,void 0);try{let e=sessionStorage.getItem(ts);Y(this,Se,e?JSON.parse(e):{id:Ve()})}catch{Y(this,Se,{id:Ve()})}try{let e=localStorage.getItem(as);Y(this,Pe,e?JSON.parse(e):{deviceId:Ve()})}catch{Y(this,Pe,{deviceId:Ve()})}N(this,Se).id||(N(this,Se).id=Ve()),N(this,Pe).deviceId||(N(this,Pe).deviceId=Ve())}static getInstance(){return N(this,ft)||Y(this,ft,new Ar),N(this,ft)}static ___clearInstance(){Y(this,ft,void 0)}saveSessionData(e,t){N(this,Se)[e]=t;try{return sessionStorage.setItem(ts,JSON.stringify(N(this,Se))),!0}catch{return!1}}loadSessionData(e){let t=N(this,Se)[e];if(null!=t)return t}saveLocalData(e,t){N(this,Pe)[e]=t;try{return localStorage.setItem(as,JSON.stringify(N(this,Pe))),!0}catch{return!1}}loadLocalData(e){let t=N(this,Pe)[e];if(null!=t)return t}},_t=Ar;function ns(e){return/^[\da-f]{24}$/i.test(e)}function rs(){return _t.getInstance().loadLocalData("deviceId")}function is(){return _t.getInstance().loadSessionData("id")}ft=new WeakMap,Se=new WeakMap,Pe=new WeakMap,ee(_t,ft,void 0);var sa,jt,Tt,ua,It,Ot,zt,gt,la,At,Nt,ca,js=Yn(_s()),qp=M?.env?.npm_package_version,Sr=["websdk","web","webv2"],Pr="websdk",Fr=class{constructor(e){ee(this,sa,void 0),ee(this,jt,void 0),ee(this,Tt,void 0),ee(this,ua,void 0),ee(this,It,void 0),ee(this,Ot,void 0),ee(this,zt,void 0),ee(this,gt,void 0),ee(this,la,void 0),ee(this,At,void 0),ee(this,Nt,void 0),ee(this,ca,void 0),Y(this,gt,e.clientId),Y(this,la,e.clientSecret),Y(this,At,e.accessToken),Y(this,zt,e.noAuth||!1);let t="https://api-gateway.mappedin.com/track-analytics/a/";!N(this,zt)&&N(this,gt)&&!ns(N(this,gt))&&(t="https://web-proxy.mappedin.com/a/"),Y(this,Tt,t),Y(this,Tt,N(this,Tt)+(e.venue+"/")),Y(this,jt,!1),Y(this,sa,"boolean"==typeof e.testMode?e.testMode:"true"===e.testMode?.toLowerCase()),Y(this,ua,Sr.find((t=>t===e.context))||Sr[0]),Y(this,It,rs()),Y(this,Ot,is()),Y(this,Nt,new Set),Y(this,ca,e.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(e,t){if(N(this,sa))return;let n={...t,g:N(this,jt)},r=N(this,Tt)+e+"?"+js.default.stringify(n),i={"mi-context":Pr||N(this,ua),"mi-session":N(this,Ot),"mi-device":N(this,It),"mappedin-sdk-version":qp,"mappedin-platform-version":N(this,ca)};N(this,At)?i.Authorization=`Bearer ${N(this,At)}`:N(this,zt)||(i.Authorization=`Basic ${btoa(`${N(this,gt)}:${N(this,la)}`)}`),Qe()(r,{method:"GET",mode:"cors",headers:i})}locationSelected(e){let t=e.id||e;this.track("select-location",{id:t})}categorySelected(e){let t=e.id||e;this.track("select-category",{id:t})}mapViewLoaded(e,t,n,r){this.track("load-mapview",{type:e,force:t,benchmark:n||-1,reason:r||"success"})}getDirections(e,t){let n={start:e.id,end:t.id,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return N(this,Ot)}getDeviceID(){return N(this,It)}setGeolocationMode(e){Y(this,jt,e)}trackBlueDotEvent(e){e&&Object.values(Fr.BLUEDOT_EVENT).includes(e)&&!N(this,Nt).has(e)?(this.track(e),N(this,Nt).add(e)):z.warn(`Ignored unsupported blue dot event: "${e}".`)}trackSearch(e){null!=e&&this.track("query-search",e)}trackSearchSuggest(e){null!=e&&this.track("query-suggest",e)}static setContext(e){let t=Sr.find((t=>t===e));t&&(Pr=t)}static clearContext(){Pr=void 0}},On=Fr;sa=new WeakMap,jt=new WeakMap,Tt=new WeakMap,ua=new WeakMap,It=new WeakMap,Ot=new WeakMap,zt=new WeakMap,gt=new WeakMap,la=new WeakMap,At=new WeakMap,Nt=new WeakMap,ca=new WeakMap,ye(On,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var zn=On,Dr={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""},oa=(e=>(e.CATEGORY="categories",e.EVENT="events",e.LOCATION="locations",e.MAPGROUP="mapGroups",e.MAP="maps",e.NODE="nodes",e.POLYGON="polygons",e.VORTEX="vortexes",e))(oa||{}),Et={categories:Re,locations:we,vortexes:ot,maps:tt,nodes:nt,polygons:Ce,venue:it,events:et,mapGroups:at,themes:mt,locationStates:ht,rankings:rt},st=class{perspective;things;options;#e;#t="";updatedAt;categories=[];locations=[];vortexes=[];maps=[];nodes=[];polygons=[];venue={};events=[];mapGroups=[];themes=[];locationStates=[];rankings;_categoriesById;_locationsById;_vortexesById;_mapsById;_nodesById;_polygonsById;_eventsById;_mapGroupsById;_locationStatesById;_locationRankingsById;_rankingsById;_categoriesByExternalId;_locationsByExternalId;_vortexesByExternalId;_mapsByExternalId;_nodesByExternalId;_polygonsByExternalId;_eventsByExternalId;_mapGroupsByExternalId;_locationStatesByExternalId;_locationRankingsByExternalId;_rankingsByExternalId;generateGetters(e){try{for(let t=0,n=e.length;t<n;++t){let n=e[t];Array.isArray(this[n])&&(Object.defineProperty(this,`_${n}ByExternalId`,{get(){let e=this.#e[n];if(null!=e)return e;let t={};return this[n].forEach((e=>t[e.externalId]=e)),this.#e[n]=t,t}}),Object.defineProperty(this,`_${n}ById`,{get(){let e=this.#e[n];if(null!=e)return e;let t={};return this[n].forEach((e=>t[e.id]=e)),this.#e[n]=t,t}}))}return this}catch(e){throw new Error("Unable to generate getters, "+e)}}getCollectionItemById(e,t){let n=`_${e}ByExternalId`,r=this[`_${e}ById`];return null!=r&&null!=r[t]||(r=this[n],null!=r&&null!=r[t])?r[t]:null}async hydrateFromMVF(e){let t=es(e);return this.hydrate(t)}async hydrate(e,t){let n;if("string"==typeof e)try{this.#t=e,n=JSON.parse(e)}catch(e){return void z.error("Unable to parse JSON",e)}else n=e,this.#t=JSON.stringify(n);let r=Object.keys(n);for(let e=0,t=r.length;e<t;++e){let t=r[e],i=n[t];null!=Et[t]&&"function"==typeof Et[t].hydrate&&(this[t]=Et[t].hydrate(i,this))}t&&await Ko(n);let{images:i,scenes:a,imageBinaries:s}=n;this.images=i,this.scenes=a,this.imageBinaries=s,this.generateGetters(r),this.initNavigator()}images;imageBinaries;scenes;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"]),Yo(this.options.clientId)||this.options.things.rankings&&delete this.options.things.rankings;let{things:e}=this.options,t=[],n=Object.keys(e);for(let e=0,r=n.length;e<r;++e){let r=n[e];Et[r]&&t.push(Et[r].fetch(this).then((e=>(this[r]=e,Promise.resolve()))))}return this.generateGetters(n),Promise.all(t).then((()=>{this.initNavigator()}))}constructor(e){this.options=e,this.#e=Me.create(this);let t=new zn({...e,testMode:!e?.emitAnalyticsEvents});this.analytics={locationSelected:t.locationSelected,categorySelected:t.categorySelected,getDirections:t.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(kr,"true")}})}analytics;navigator;initNavigator(){this.navigator=new _r({locations:this.locations.map((e=>e.toJSON())),nodes:this.nodes.map((e=>e.toJSON())),vortexes:this.vortexes.map((e=>e.toJSON())),maps:this.maps.map((e=>e.toJSON()))})}toJSON(){let e={};for(let t in Et)Array.isArray(this[t])&&(e[t]=this[t].map((e=>e.toJSON())));let t={...e,venue:this.venue.toJSON()};return null!=this.rankings&&(t.rankings=this.rankings?.toJSON()),delete t.locationRankings,t}toString(){return this.#t||JSON.stringify(this.toJSON())}};h();var Ts={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"]};h(),h();var ae=function(){return ae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ae.apply(this,arguments)};function $(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function se(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s}var da,Gp="ENTRIES",Ss="KEYS",Ps="VALUES",ue="",Lr=function(){function e(e,t){var n=e._tree,r=Array.from(n.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:n,keys:r}]:[]}return e.prototype.next=function(){var e=this.dive();return this.backtrack(),e},e.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var e=St(this._path),t=e.node,n=e.keys;if(St(n)===ue)return{done:!1,value:this.result()};var r=t.get(St(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},e.prototype.backtrack=function(){if(0!==this._path.length){var e=St(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},e.prototype.key=function(){return this.set._prefix+this._path.map((function(e){var t=e.keys;return St(t)})).filter((function(e){return e!==ue})).join("")},e.prototype.value=function(){return St(this._path).node.get(ue)},e.prototype.result=function(){switch(this._type){case Ps:return this.value();case Ss:return this.key();default:return[this.key(),this.value()]}},e.prototype[Symbol.iterator]=function(){return this},e}(),St=function(e){return e[e.length-1]},Up=function(e,t,n){var r=new Map;if(void 0===t)return r;for(var i=t.length+1,a=i+n,s=new Uint8Array(a*i).fill(n+1),o=0;o<i;++o)s[o]=o;for(var l=1;l<a;++l)s[l*i]=l;return Fs(e,t,n,r,s,1,i,""),r},Fs=function(e,t,n,r,i,a,s,o){var l,u,h=a*s;try{e:for(var c=$(e.keys()),d=c.next();!d.done;d=c.next()){var f=d.value;if(f===ue){var p=i[h-1];p<=n&&r.set(o,[e.get(f),p])}else{for(var g=a,y=0;y<f.length;++y,++g){for(var m=f[y],v=s*g,_=v-s,w=i[v],M=Math.max(0,g-n-1),b=Math.min(s-1,g+n),x=M;x<b;++x){var O=m!==t[x],E=i[_+x]+ +O,N=i[_+x+1]+1,A=i[v+x]+1,I=i[v+x+1]=Math.min(E,N,A);I<w&&(w=I)}if(w>n)continue e}Fs(e.get(f),t,n,r,i,g,s,o+f)}}}catch(e){l={error:e}}finally{try{d&&!d.done&&(u=c.return)&&u.call(c)}finally{if(l)throw l.error}}},Cr=function(){function e(e,t){void 0===e&&(e=new Map),void 0===t&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return e.prototype.atPrefix=function(t){var n,r;if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");var i=se(Nn(this._tree,t.slice(this._prefix.length)),2),a=i[0],s=i[1];if(void 0===a){var o=se(Ur(s),2),l=o[0],u=o[1];try{for(var h=$(l.keys()),c=h.next();!c.done;c=h.next()){var d=c.value;if(d!==ue&&d.startsWith(u)){var f=new Map;return f.set(d.slice(u.length),l.get(d)),new e(f,t)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}return new e(a,t)},e.prototype.clear=function(){this._size=void 0,this._tree.clear()},e.prototype.delete=function(e){return this._size=void 0,Vp(this._tree,e)},e.prototype.entries=function(){return new Lr(this,Gp)},e.prototype.forEach=function(e){var t,n;try{for(var r=$(this),i=r.next();!i.done;i=r.next()){var a=se(i.value,2);e(a[0],a[1],this)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.fuzzyGet=function(e,t){return Up(this._tree,e,t)},e.prototype.get=function(e){var t=Gr(this._tree,e);return void 0!==t?t.get(ue):void 0},e.prototype.has=function(e){var t=Gr(this._tree,e);return void 0!==t&&t.has(ue)},e.prototype.keys=function(){return new Lr(this,Ss)},e.prototype.set=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");return this._size=void 0,Rr(this._tree,e).set(ue,t),this},Object.defineProperty(e.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),e.prototype.update=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");this._size=void 0;var n=Rr(this._tree,e);return n.set(ue,t(n.get(ue))),this},e.prototype.fetch=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");this._size=void 0;var n=Rr(this._tree,e),r=n.get(ue);return void 0===r&&n.set(ue,r=t()),r},e.prototype.values=function(){return new Lr(this,Ps)},e.prototype[Symbol.iterator]=function(){return this.entries()},e.from=function(t){var n,r,i=new e;try{for(var a=$(t),s=a.next();!s.done;s=a.next()){var o=se(s.value,2),l=o[0],u=o[1];i.set(l,u)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.fromObject=function(t){return e.from(Object.entries(t))},e}(),Nn=function(e,t,n){var r,i;if(void 0===n&&(n=[]),0===t.length||null==e)return[e,n];try{for(var a=$(e.keys()),s=a.next();!s.done;s=a.next()){var o=s.value;if(o!==ue&&t.startsWith(o))return n.push([e,o]),Nn(e.get(o),t.slice(o.length),n)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n.push([e,t]),Nn(void 0,"",n)},Gr=function(e,t){var n,r;if(0===t.length||null==e)return e;try{for(var i=$(e.keys()),a=i.next();!a.done;a=i.next()){var s=a.value;if(s!==ue&&t.startsWith(s))return Gr(e.get(s),t.slice(s.length))}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},Rr=function(e,t){var n,r,i=t.length;e:for(var a=0;e&&a<i;){try{for(var s=(n=void 0,$(e.keys())),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==ue&&t[a]===l[0]){for(var u=Math.min(i-a,l.length),h=1;h<u&&t[a+h]===l[h];)++h;var c=e.get(l);if(h===l.length)e=c;else{var d=new Map;d.set(l.slice(h),c),e.set(t.slice(a,a+h),d),e.delete(l),e=d}a+=h;continue e}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}var f=new Map;return e.set(t.slice(a),f),f}return e},Vp=function(e,t){var n=se(Nn(e,t),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(ue),0===r.size)Ds(i);else if(1===r.size){var a=se(r.entries().next().value,2),s=a[0],o=a[1];Ls(i,s,o)}},Ds=function(e){if(0!==e.length){var t=se(Ur(e),2),n=t[0],r=t[1];if(n.delete(r),0===n.size)Ds(e.slice(0,-1));else if(1===n.size){var i=se(n.entries().next().value,2),a=i[0],s=i[1];a!==ue&&Ls(e.slice(0,-1),a,s)}}},Ls=function(e,t,n){if(0!==e.length){var r=se(Ur(e),2),i=r[0],a=r[1];i.set(a+t,n),i.delete(a)}},Ur=function(e){return e[e.length-1]},Vr="or",$p="and",Wp="and_not",yt=function(){function e(e){if(null==e?.fields)throw new Error('MiniSearch: option "fields" must be provided');this._options=ae(ae(ae({},qr),e),{searchOptions:ae(ae({},zs),e.searchOptions||{})}),this._index=new Cr,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 e.prototype.add=function(e){var t,n,r,i,a=this._options,s=a.extractField,o=a.tokenize,l=a.processTerm,u=a.fields,h=a.idField,c=s(e,h);if(null==c)throw new Error('MiniSearch: document does not have ID field "'.concat(h,'"'));var d=this.addDocumentId(c);this.saveStoredFields(d,e);try{for(var f=$(u),p=f.next();!p.done;p=f.next()){var g=p.value,y=s(e,g);if(null!=y){var m=o(y.toString(),g),v=this._fieldIds[g],_=new Set(m).size;this.addFieldLength(d,v,this._documentCount-1,_);try{for(var w=(r=void 0,$(m)),M=w.next();!M.done;M=w.next()){var b=l(M.value,g);b&&this.addTerm(v,d,b)}}catch(e){r={error:e}}finally{try{M&&!M.done&&(i=w.return)&&i.call(w)}finally{if(r)throw r.error}}}}}catch(e){t={error:e}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}},e.prototype.addAll=function(e){var t,n;try{for(var r=$(e),i=r.next();!i.done;i=r.next()){var a=i.value;this.add(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.addAllAsync=function(e,t){var n=this;void 0===t&&(t={});var r=t.chunkSize,i=void 0===r?10:r,a={chunk:[],promise:Promise.resolve()},s=e.reduce((function(e,t,r){var a=e.chunk,s=e.promise;return a.push(t),(r+1)%i==0?{chunk:[],promise:s.then((function(){return new Promise((function(e){return setTimeout(e,0)}))})).then((function(){return n.addAll(a)}))}:{chunk:a,promise:s}}),a),o=s.chunk;return s.promise.then((function(){return n.addAll(o)}))},e.prototype.remove=function(e){var t,n,r,i,a,s,o=this._options,l=o.tokenize,u=o.processTerm,h=o.extractField,c=o.fields,d=o.idField,f=h(e,d);if(null==f)throw new Error('MiniSearch: document does not have ID field "'.concat(d,'"'));try{for(var p=$(this._documentIds),g=p.next();!g.done;g=p.next()){var y=se(g.value,2),m=y[0];if(f===y[1]){try{for(var v=(r=void 0,$(c)),_=v.next();!_.done;_=v.next()){var w=_.value,M=h(e,w);if(null!=M){var b=l(M.toString(),w),x=this._fieldIds[w],O=new Set(b).size;this.removeFieldLength(m,x,this._documentCount,O);try{for(var E=(a=void 0,$(b)),N=E.next();!N.done;N=E.next()){var A=u(N.value,w);A&&this.removeTerm(x,m,A)}}catch(e){a={error:e}}finally{try{N&&!N.done&&(s=E.return)&&s.call(E)}finally{if(a)throw a.error}}}}}catch(e){r={error:e}}finally{try{_&&!_.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}return this._storedFields.delete(m),this._documentIds.delete(m),this._fieldLength.delete(m),void(this._documentCount-=1)}}}catch(e){t={error:e}}finally{try{g&&!g.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(f,": it is not in the index"))},e.prototype.removeAll=function(e){var t,n;if(e)try{for(var r=$(e),i=r.next();!i.done;i=r.next()){var a=i.value;this.remove(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Cr,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},e.prototype.search=function(e,t){var n,r;void 0===t&&(t={});var i=this.executeQuery(e,t),a=[];try{for(var s=$(i),o=s.next();!o.done;o=s.next()){var l=se(o.value,2),u=l[0],h=l[1],c=h.score,d=h.terms,f=h.match,p=d.length,g={id:this._documentIds.get(u),score:c*p,terms:Object.keys(f),match:f};Object.assign(g,this._storedFields.get(u)),(null==t.filter||t.filter(g))&&a.push(g)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a.sort(Ns),a},e.prototype.autoSuggest=function(e,t){var n,r,i,a;void 0===t&&(t={}),t=ae(ae({},Kp),t);var s=new Map;try{for(var o=$(this.search(e,t)),l=o.next();!l.done;l=o.next()){var u=l.value,h=u.score,c=(v=u.terms).join(" ");null!=(y=s.get(c))?(y.score+=h,y.count+=1):s.set(c,{score:h,terms:v,count:1})}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}var d=[];try{for(var f=$(s),p=f.next();!p.done;p=f.next()){var g=se(p.value,2),y=g[0],m=g[1],v=(h=m.score,m.terms),_=m.count;d.push({suggestion:y,terms:v,score:h/_})}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return d.sort(Ns),d},Object.defineProperty(e.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),e.loadJSON=function(t,n){if(null==n)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return e.loadJS(JSON.parse(t),n)},e.getDefault=function(e){if(qr.hasOwnProperty(e))return Br(qr,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},e.loadJS=function(t,n){var r,i,a,s,o=t.index,l=t.documentCount,u=t.nextId,h=t.documentIds,c=t.fieldIds,d=t.fieldLength,f=t.averageFieldLength,p=t.storedFields,g=t.serializationVersion;if(1!==g&&2!==g)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var y=new e(n);y._documentCount=l,y._nextId=u,y._documentIds=An(h),y._fieldIds=c,y._fieldLength=An(d),y._avgFieldLength=f,y._storedFields=An(p),y._index=new Cr;try{for(var m=$(o),v=m.next();!v.done;v=m.next()){var _=se(v.value,2),w=_[0],M=_[1],b=new Map;try{for(var x=(a=void 0,$(Object.keys(M))),O=x.next();!O.done;O=x.next()){var E=O.value,N=M[E];1===g&&(N=N.ds),b.set(parseInt(E,10),An(N))}}catch(e){a={error:e}}finally{try{O&&!O.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}y._index.set(w,b)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}return y},e.prototype.executeQuery=function(e,t){var n=this;if(void 0===t&&(t={}),"string"!=typeof e){var r=ae(ae(ae({},t),e),{queries:void 0}),i=e.queries.map((function(e){return n.executeQuery(e,r)}));return this.combineResults(i,e.combineWith)}var a=this._options,s=a.tokenize,o=a.processTerm,l=a.searchOptions,u=ae(ae({tokenize:s,processTerm:o},l),t),h=u.tokenize,c=u.processTerm,d=h(e).map((function(e){return c(e)})).filter((function(e){return!!e})).map(Jp(u)).map((function(e){return n.executeQuerySpec(e,u)}));return this.combineResults(d,u.combineWith)},e.prototype.executeQuerySpec=function(e,t){var n,r,i,a,s,o,l=ae(ae({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce((function(e,t){var n;return ae(ae({},e),((n={})[t]=Br(e,t)||1,n))}),l.boost||{}),h=l.boostDocument,c=l.weights,d=l.maxFuzzy,f=ae(ae({},zs.weights),c),p=f.fuzzy,g=f.prefix,y=this._index.get(e.term),m=this.termResults(e.term,e.term,1,y,u,h);if(e.prefix&&(s=this._index.atPrefix(e.term)),e.fuzzy){var v=!0===e.fuzzy?.2:e.fuzzy,_=v<1?Math.min(d,Math.round(e.term.length*v)):v;_&&(o=this._index.fuzzyGet(e.term,_))}if(s)try{for(var w=$(s),M=w.next();!M.done;M=w.next()){var b=se(M.value,2),x=b[0],O=b[1];if(I=x.length-e.term.length){o?.delete(x);var E=g*x.length/(x.length+.3*I);this.termResults(e.term,x,E,O,u,h,m)}}}catch(e){n={error:e}}finally{try{M&&!M.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}if(o)try{for(var N=$(o.keys()),A=N.next();!A.done;A=N.next()){x=A.value;var I,k=se(o.get(x),2),T=k[0];if(I=k[1]){E=p*x.length/(x.length+I);this.termResults(e.term,x,E,T,u,h,m)}}}catch(e){i={error:e}}finally{try{A&&!A.done&&(a=N.return)&&a.call(N)}finally{if(i)throw i.error}}return m},e.prototype.combineResults=function(e,t){if(void 0===t&&(t=Vr),0===e.length)return new Map;var n=t.toLowerCase();return e.reduce(Hp[n])||new Map},e.prototype.toJSON=function(){var e,t,n,r,i=[];try{for(var a=$(this._index),s=a.next();!s.done;s=a.next()){var o=se(s.value,2),l=o[0],u=o[1],h={};try{for(var c=(n=void 0,$(u)),d=c.next();!d.done;d=c.next()){var f=se(d.value,2),p=f[0],g=f[1];h[p]=Object.fromEntries(g)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}i.push([l,h])}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.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:i,serializationVersion:2}},e.prototype.termResults=function(e,t,n,r,i,a,s){var o,l,u,h,c;if(void 0===s&&(s=new Map),null==r)return s;try{for(var d=$(Object.keys(i)),f=d.next();!f.done;f=d.next()){var p=f.value,g=i[p],y=this._fieldIds[p],m=r.get(y);if(null!=m){var v=m.size,_=this._avgFieldLength[y];try{for(var w=(u=void 0,$(m.keys())),M=w.next();!M.done;M=w.next()){var b=M.value,x=a?a(this._documentIds.get(b),t):1;if(x){var O=m.get(b),E=this._fieldLength.get(b)[y],N=n*g*x*Xp(O,v,this._documentCount,E,_),A=s.get(b);if(A){A.score+=N,Zp(A.terms,e);var I=Br(A.match,t);I?I.push(p):A.match[t]=[p]}else s.set(b,{score:N,terms:[e],match:(c={},c[t]=[p],c)})}}}catch(e){u={error:e}}finally{try{M&&!M.done&&(h=w.return)&&h.call(w)}finally{if(u)throw u.error}}}}}catch(e){o={error:e}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(o)throw o.error}}return s},e.prototype.addTerm=function(e,t,n){var r=this._index.fetch(n,Es),i=r.get(e);if(null==i)(i=new Map).set(t,1),r.set(e,i);else{var a=i.get(t);i.set(t,(a||0)+1)}},e.prototype.removeTerm=function(e,t,n){if(this._index.has(n)){var r=this._index.fetch(n,Es),i=r.get(e);null==i||null==i.get(t)?this.warnDocumentChanged(t,e,n):i.get(t)<=1?i.size<=1?r.delete(e):i.delete(t):i.set(t,i.get(t)-1),0===this._index.get(n).size&&this._index.delete(n)}else this.warnDocumentChanged(t,e,n)},e.prototype.warnDocumentChanged=function(e,t,n){var r,i;if(null!=console&&null!=console.warn)try{for(var a=$(Object.keys(this._fieldIds)),s=a.next();!s.done;s=a.next()){var o=s.value;if(this._fieldIds[o]===t)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(n,'" was not present in field "').concat(o,'". Removing a document after it has changed can corrupt the index!'))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},e.prototype.addDocumentId=function(e){var t=this._nextId;return this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},e.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},e.prototype.addFieldLength=function(e,t,n,r){var i=this._fieldLength.get(e);null==i&&this._fieldLength.set(e,i=[]),i[t]=r;var a=(this._avgFieldLength[t]||0)*n+r;this._avgFieldLength[t]=a/(n+1)},e.prototype.removeFieldLength=function(e,t,n,r){var i=this._avgFieldLength[t]*n-r;this._avgFieldLength[t]=i/(n-1)},e.prototype.saveStoredFields=function(e,t){var n,r,i=this._options,a=i.storeFields,s=i.extractField;if(null!=a&&0!==a.length){var o=this._storedFields.get(e);null==o&&this._storedFields.set(e,o={});try{for(var l=$(a),u=l.next();!u.done;u=l.next()){var h=u.value,c=s(t,h);void 0!==c&&(o[h]=c)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}},e}(),Br=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},Hp=((da={})[Vr]=function(e,t){var n,r;try{for(var i=$(t.keys()),a=i.next();!a.done;a=i.next()){var s=a.value,o=e.get(s);if(null==o)e.set(s,t.get(s));else{var l=t.get(s),u=l.score,h=l.terms,c=l.match;o.score=o.score+u,o.match=Object.assign(o.match,c),As(o.terms,h)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},da[$p]=function(e,t){var n,r,i=new Map;try{for(var a=$(t.keys()),s=a.next();!s.done;s=a.next()){var o=s.value,l=e.get(o);if(null!=l){var u=t.get(o),h=u.score,c=u.terms,d=u.match;As(l.terms,c),i.set(o,{score:l.score+h,terms:l.terms,match:Object.assign(l.match,d)})}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},da[Wp]=function(e,t){var n,r;try{for(var i=$(t.keys()),a=i.next();!a.done;a=i.next()){var s=a.value;e.delete(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},da),Is=1.2,Os=.7,Yp=.5,Xp=function(e,t,n,r,i){return Math.log(1+(n-t+.5)/(t+.5))*(Yp+e*(Is+1)/(e+Is*(1-Os+Os*r/i)))},Jp=function(e){return function(t,n,r){return{term:t,fuzzy:"function"==typeof e.fuzzy?e.fuzzy(t,n,r):e.fuzzy||!1,prefix:"function"==typeof e.prefix?e.prefix(t,n,r):!0===e.prefix}}},qr={idField:"id",extractField:function(e,t){return e[t]},tokenize:function(e,t){return e.split(Qp)},processTerm:function(e,t){return e.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},zs={combineWith:Vr,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},Kp={prefix:function(e,t,n){return t===n.length-1}},Zp=function(e,t){e.includes(t)||e.push(t)},As=function(e,t){var n,r;try{for(var i=$(t),a=i.next();!a.done;a=i.next()){var s=a.value;e.includes(s)||e.push(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},Ns=function(e,t){var n=e.score;return t.score-n},Es=function(){return new Map},An=function(e){var t,n,r=new Map;try{for(var i=$(Object.keys(e)),a=i.next();!a.done;a=i.next()){var s=a.value;r.set(parseInt(s,10),e[s])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},Qp=/[\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;h();var eh=["0","1","2","3","4","5","6","7","8","9"],th=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],ah=["0","1","2","3","4","5","6","7","8","9"],nh=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],Ik=[...eh,...th,...ah,...nh],Cs=["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"];h();var rh=32,ke=!1,ih=120,$r=0,En=class{constructor(e){this._callback=e.callback,this._frameCount=null!=e.frameCount?e.frameCount:1,this._ordering=null!=e.ordering?e.ordering:0,this._supersededBy=null!=e.supersededBy?new Set(e.supersededBy):new Set,this.name=e.name,this.userdata=e.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,ke&&z.log("update instantiated",this.name)}_callback;_frameCount;_ordering;_supersededBy;name;_remainingFrameCount;_lastFrameTime;userdata;getLastFrameTime(){return this._lastFrameTime}},We=class{constructor(e){if(null!=e.group&&null!=e.priority)throw new Error("cannot specify task priority individually within group");if(null!=e.group&&null!=e.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=e.callback,this._group=null!=e.group?e.group:null,this._priority=null!=e.priority?e.priority:0,this._postponed=null!=e.postponeOnAdd&&e.postponeOnAdd,this.name=e.name,this.userdata=e.userdata,this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,ke&&z.log("task instantiated",this.name)}_postponed;userdata;_priority;_group;name;_lastFrameTime;_callback;_complete;_scheduled;_cancelled;isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},Sn=class{constructor(e){this._onComplete=null!=e.onComplete?e.onComplete:()=>{},this._priority=null!=e.priority?e.priority:0,this._postponed=null!=e.postponeOnAdd&&e.postponeOnAdd,this.name=e.name,this.userdata=e.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,ke&&z.log("task group instantiated",this.name)}_postponed;_onComplete;_priority;userdata;name;_tasks;_scheduledTasks;_scheduled;_cancelled;isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let e of this._scheduledTasks)return this._scheduledTasks.delete(e),e}},Wr=class{_maxMillisecondsPerFrame;_time;constructor(e){this._maxMillisecondsPerFrame=null!=e?.maxMillisecondsPerFrame?e.maxMillisecondsPerFrame:rh,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},Pn=class{constructor(e){this._timer=null!=e?.timer?e.timer:new Wr,this._performance=null!=e?.performance&&e.performance,this._scheduledUpdatesByOrdering=new Pt,this._scheduledTasksByPriority=new Pt,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),ke&&z.log("task scheduler instantiated"),globalThis.MappedinDebug?.TEST_IOS&&(this._raf=e=>setTimeout(e,16))}_raf;_timer;_performance;_scheduledUpdatesByOrdering;_scheduledTasksByPriority;_postponedTasks;_requestAnimationFrameHandle;_updatesToRunThisFrame;_lastFrameTime=0;_updatesRunLastFrame;clear(){for(let e of this._scheduledTasksByPriority.values())e._cancelled=!0;for(let e of this._postponedTasks.values())e._cancelled=!0;this._scheduledUpdatesByOrdering=new Pt,this._scheduledTasksByPriority=new Pt,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),ke&&z.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(e){let t;this._timer.beginFrame(),this._performance&&(t=performance.now());let n=!1;ke&&(0===$r&&(n=!0),++$r,$r%=ih);let r=this._scheduledUpdatesByOrdering.keys();for(let e=r.length-1;e>=0;--e){let t=r[e];for(let e of this._scheduledUpdatesByOrdering.get(t).values())this._updatesToRunThisFrame.push(e),n&&z.log("update scheduled to run this frame",e.name)}for(let e of this._updatesToRunThisFrame){--e._remainingFrameCount,e._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(e._ordering,e),e._superseded=!1;for(let t of this._updatesToRunThisFrame)e._supersededBy.has(t)&&(e._superseded=!0,n&&z.log("update superseded",e.name,t.name))}for(let e=0;e<this._updatesToRunThisFrame.length;++e)this._updatesToRunThisFrame[e]._superseded&&(this._updatesToRunThisFrame.splice(e,1),--e);for(let t of this._updatesToRunThisFrame){let r;this._performance&&(r=performance.now()),t._callback(e),this._performance&&(t._lastFrameTime=performance.now()-r),n&&z.log("update completed",t.name)}this._updatesRunLastFrame.clear();for(let e of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(e);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(e)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-t),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(e){let t,n=this._scheduledTasksByPriority.popFromMaxKey(),r=null;z.assert(void 0!==n),Object.getPrototypeOf(n)===Sn.prototype&&(r=n,n=r._popTask()),z.assert(void 0!==n),z.assert(Object.getPrototypeOf(n)===We.prototype),this._performance&&(t=performance.now()),n._callback(e),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-t),ke&&z.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),ke&&z.log("group completed",r.name)):this._scheduledTasksByPriority.insert(r._priority,r))}scheduleUpdate(e){e._remainingFrameCount=e._frameCount,this._scheduledUpdatesByOrdering.insert(e._ordering,e),this.requestAnimationFrame()}scheduleTask(e){if(Object.getPrototypeOf(e)===Sn)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+e.name);if(e._scheduled)throw new Error("cannot schedule already scheduled task: "+e.name);if(e._cancelled)throw new Error("cannot schedule cancelled task: "+e.name);let t=e;"_group"in e&&null!=e._group&&(e._group._tasks.add(e),e._group._scheduledTasks.add(e),t=e._group),t._postponed?this._postponedTasks.add(t):this._scheduledTasksByPriority.insert(t._priority,t),e._scheduled=!0,t._scheduled=!0,ke&&z.log("task scheduled",e.name),this.requestAnimationFrame()}cancelUpdate(e){this._scheduledUpdatesByOrdering.delete(e._ordering,e),ke&&z.log("update cancelled",e.name)}cancelTask(e){if(!e._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+e.name);if(e._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+e.name);if("_group"in e&&null!=e._group){let t=e._group.isComplete();e._group._tasks.delete(e),e._group._scheduledTasks.delete(e),e._group.isComplete()&&(this._scheduledTasksByPriority.delete(e._group._priority,e._group),t||e._group._onComplete())}else this._scheduledTasksByPriority.delete(e._priority,e),this._postponedTasks.delete(e);Object.getPrototypeOf(e)===We.prototype?e._cancelled=!0:"clear"in e&&e.clear(),ke&&z.log("task cancelled",e.name)}postponeTask(e){if("_group"in e&&null!=e._group)throw new Error("cannot postpone individual tasks in group: "+e.name);if(e._cancelled)throw new Error("cannot postpone cancelled task: "+e.name);if(!e._postponed){if(Object.getPrototypeOf(e)===We.prototype){if("_complete"in e)return;if(!e._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+e.name)}this._scheduledTasksByPriority.delete(e._priority,e),(Object.getPrototypeOf(e)===We.prototype||!e.isComplete())&&this._postponedTasks.add(e),e._postponed=!0,ke&&z.log("task postponed",e.name)}}resumeTask(e){if("_group"in e&&null!=e._group)throw new Error("cannot resume individual tasks in groups");if(e._cancelled)throw new Error("cannot resume cancelled task");if(e._postponed){if(Object.getPrototypeOf(e)===We.prototype){if("_complete"in e&&e._complete)return;if(!e._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(e),(Object.getPrototypeOf(e)===We.prototype||!e.isComplete())&&this._scheduledTasksByPriority.insert(e._priority,e),e._postponed=!1,this.requestAnimationFrame(),ke&&z.log("task resumed",e.name)}}setTaskPriority(e,t){if(Object.getPrototypeOf(e)===We.prototype&&!e._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(e._priority,e)&&(this._scheduledTasksByPriority.delete(e._priority,e),this._scheduledTasksByPriority.insert(t,e)),e._priority=t,ke&&z.log("task priority changed",e.name,t)}},Pt=class{constructor(){this._map=new Map,this._size=0,this._sortedKeys=[]}_map;_size;_sortedKeys;has(e,t){return null!=this._map.get(e)&&this._map.get(e).has(t)}get(e){return this._map.get(e)}insert(e,t){if(z.assert("number"==typeof e&&Number.isFinite(e)),null==this._map.get(e)){this._map.set(e,new Set);for(let t=0;t<=this._sortedKeys.length;++t)if(t===this._sortedKeys.length||e<this._sortedKeys[t]){this._sortedKeys.splice(t,0,e);break}}this._map.get(e).has(t)||(this._map.get(e).add(t),++this._size)}delete(e,t){null!=this._map.get(e)&&this._map.get(e).has(t)&&(this._map.get(e).delete(t),--this._size,0===this._map.get(e).size&&(this._map.delete(e),this._sortedKeys.splice(this._sortedKeys.indexOf(e),1)))}pop(e){if(null!=this._map.get(e)){let t;for(t of this._map.get(e).values()){this._map.get(e).delete(t),--this._size;break}return 0===this._map.get(e).size&&(this._map.delete(e),this._sortedKeys.splice(this._sortedKeys.indexOf(e),1)),t}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let e=this._map.keys(),t=null,n={[Symbol.iterator]:()=>n,next:()=>{if(null==t){let n=e.next();if(n.done)return n;t=this._map.get(n.value).values()}let n=t.next();for(;n.done;){let r=e.next();if(r.done)return r;t=this._map.get(r.value).values(),n=t.next()}return n}};return n}keys(){return this._sortedKeys}get size(){let e=0;for(let t of this._map.values())e+=t.size;return z.assert(e===this._size),e}},He=e=>e.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),Ft="",oh=.09,sh=1,uh=.025,lh=.5,ch=5e-4,dh=5e-4,ph=.01,hh=.05,Rs=1,mh=.01,fh=.2,gh={MappedinCategory:"categories",MappedinLocation:"locations"},yh={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:Cs,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===M.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:oh,PRIMARY_INDEX_WEIGHT:sh,SECONDARY_INDEX_WEIGHT:uh,CATEGORY_NAME_WEIGHT:lh,LOCATION_NAME_WEIGHT:Rs,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:ch,CATEGORY_LOCATION_TAGS_WEIGHT:dh,CATEGORY_LOCATION_NAME_WEIGHT:ph,PRIMARY_INDEX_TAGS_NAME_WEIGHT:hh,LOCATION_DEFAULT_RANK:Rs,RATIO_OF_FUZZY_TO_EXACT:mh,RATIO_OF_PREFIX_TO_EXACT:fh}},Hr=class{#e;#t;#n;#r;#i;#a=new Pn({performance:!0});#s;#o;#l=new Map;constructor(e,t){this.#o=new zn({...e.options,testMode:!1===t?.emitAnalyticsEvents}),this.#i={...yh,...t},this.#e=e,this.#s=new Set(this.#i?.stopWords);let{PRIMARY_INDEX_FUZZYNESS:n,PRIMARY_INDEX_WEIGHT:r,CATEGORY_NAME_WEIGHT:i,RATIO_OF_FUZZY_TO_EXACT:a,RATIO_OF_PREFIX_TO_EXACT:s,PRIMARY_INDEX_TAGS_NAME_WEIGHT:o}=this.#i.constants,l=["object","query","weight","tag","rank"],u={fields:["query","name","tag"],storeFields:l,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:n},boost:{name:r,query:r,tag:o},weights:{fuzzy:a,prefix:s},boostDocument:e=>e.includes("MappedinLocation")?r:e.includes("MappedinCategory")?i:r},h={fields:["description"],storeFields:l,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(e,t)=>this.#s?.has(e.toLowerCase())?null:e.toLowerCase()},c={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...l,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(this.#h=new Promise((e=>{this.#c=e})),this.#i?.jsonIndex){let{primary:e,secondary:t,extra:n}=JSON.parse(this.#i?.jsonIndex);this.#t=yt.loadJS(e,u),this.#n=yt.loadJS(t,h),this.#r=yt.loadJS(n,c)}else this.#t=new yt(u),this.#n=new yt(h),this.#r=new yt(c),this.#e.locations.forEach(this.#d),this.#e.categories.forEach(this.#f);this.#a.update(performance.now()),this.#p=Ir(((e,t)=>{this.#o.trackSearchSuggest({query:e,hits:t})}),300),this.#g=Ir(((e,t)=>{this.#o.trackSearch({query:e,hits:t})}),300)}#u=0;#y=e=>{this.#u++,this.#a.scheduleUpdate(new En({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{e(),this.#u--,0===this.#u&&this.#c()}}))};#d=e=>{let{SECONDARY_INDEX_WEIGHT:t,LOCATION_DEFAULT_RANK:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:r}=this.#i.constants,i=n;this.#i?.useLocationRank&&(i=Array.isArray(e.polygons)?Math.max(...e.polygons.map((e=>e.rank?.score?e.rank?.score:n)),n):n),this.#y((()=>{this.#t.add({name:He(e.name),tags:"",id:"MappedinLocation_"+e.id,weight:n,rank:i})})),this.#i?.searchTags&&Array.isArray(e.tags)&&e.tags.forEach((t=>{this.#t.add({name:"",tag:He(t),id:"MappedinLocation_"+e.id,weight:r,rank:i})})),this.#i?.searchDescriptions&&this.#y((()=>this.#n.add({description:He(e.description||""),id:"MappedinLocation_"+e.id,weight:t,rank:i})))};#f=e=>{let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:t,CATEGORY_LOCATION_TAGS_WEIGHT:n,CATEGORY_LOCATION_NAME_WEIGHT:r,CATEGORY_NAME_WEIGHT:i}=this.#i.constants;this.#y((()=>this.#t.add({name:He(e.name||""),description:"",id:"MappedinCategory_"+e.id,weight:i})));let a=e.locations.reduce(((e,t)=>e+` ${Ft} `+t.name),"")+` ${Ft}`;if(this.#i?.searchDescriptionsInCategories&&e.locations.forEach((n=>{null!=n.description&&this.#y((()=>this.#r.add({id:"MappedinCategory_"+e.id,"category.locations.description":He(n.description),ref:n.name,weight:t})))})),this.#i?.searchTagsInCategories){let t=e.locations.reduce(((e,t)=>e+t.tags?.reduce(((e,t)=>e+` ${Ft} `+t),"")+` ${Ft}`),"");this.#y((()=>this.#r.add({"category.locations.tags":He(t),id:"MappedinCategory_"+e.id,weight:n})))}this.#y((()=>this.#r.add({"category.locations.name":He(a),id:"MappedinCategory_"+e.id,weight:r})))};#h;#c;#m=e=>{let t=e.score,{object:n,id:r,weight:i,rank:a}=e,[s,o]=r.split("_"),l=n||this.#e.getCollectionItemById(gh[s],o);return a&&this.#i?.useLocationRank&&(t+=a),i&&(t*=i),{score:t,type:s,object:l}};#v=(e,t)=>{for(let n in e.match)e.match[n].forEach((r=>{let i=e.ref||e[r]||t.object[r];if("category.locations.tags"===r||"category.locations.name"===r){let t=new RegExp(`[^${Ft}]* `+n+` [^${Ft}]*`,"ig").exec(e[r]);null!=t&&(i=t[0].slice(1,-1))}t.matches.push({term:n,weight:e.weight,matchesOn:r,value:i})}))};#_(e){let t=[],n=He(e);t=[...this.#t.search(n),...this.#n.search(n),...this.#r.search(n)].sort(((e,t)=>t.score-e.score));let r={};for(let e of t){let t=this.#m(e);r[e.id]?r[e.id].score+=t.score:r[e.id]={...t,matches:[]},this.#v(e,r[e.id])}return Object.keys(r).map((e=>({...r[e],matches:r[e].matches.sort(((e,t)=>t.weight-e.weight))}))).sort(((e,t)=>t.score-e.score))}async suggest(e){await this.#h;let{PRIMARY_INDEX_FUZZYNESS:t,PRIMARY_INDEX_WEIGHT:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:r,RATIO_OF_FUZZY_TO_EXACT:i,RATIO_OF_PREFIX_TO_EXACT:a}=this.#i.constants,s=this.#t.autoSuggest(e,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:t,boost:{name:n,query:n,tag:r},weights:{fuzzy:i,prefix:a}});return this.#p(e,s.length),{total:s.length,hits:s.map((e=>({text:e.suggestion})))}}async search(e){await this.#h;let t=this.#_(e);return this.#g(e,t.length),t}async toJSON(){return await this.#h,JSON.stringify({primary:this.#t,secondary:this.#n,extra:this.#r})}#p;#g;async addQuery(e){let t,n,{query:r,object:i,weight:a=1}=e;await this.#h,t=i instanceof we?"MappedinLocation":i instanceof Re?"MappedinCategory":"Custom","MappedinLocation"===t||"MappedinCategory"===t?n=t+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=this.#l.get(i),n||(n="Custom_"+Ve(),this.#l.set(i,n))),this.#t.add({id:n,weight:a,object:i,query:He(r)})}};h();var Bs=(e=>(e.MULTI_GEOMETRY="MULTI_GEOMETRY",e.SINGLE_GEOMETRY="SINGLE_GEOMETRY",e))(Bs||{}),gi=globalThis.fetch;function Qe(){if(null==gi)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return gi}function Zk(e){gi=e}var Bh=M?.env?.npm_package_version;globalThis.btoa||(globalThis.btoa=Tu.encode);var qh=["ar"];function ka(e){let t={...Dr,things:Ts,...e};return t.headers={...t.headers,"mappedin-sdk-version":Bh},e.platformString&&(t.headers={...t.headers,"mappedin-platform-version":e.platformString}),t.noAuth||(t.accessToken?t.authorization=`Bearer ${t.accessToken}`:t.clientId&&t.clientSecret&&(t.authorization=`Basic ${globalThis.btoa(`${t.clientId}:${t.clientSecret}`)}`)),t}async function eb(e){let{venue:t,clientId:n,clientSecret:r,bundleBaseUri:i}=e,a=new st({venue:t}),s=Qo(await Vh({clientId:n,clientSecret:r,venue:t,bundleBaseUri:i},!1));return a.hydrateFromMVF(s),a}async function Gh(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,...e}}),n="public/1/"+(t.useDraftData?"draft/":""),r=new st({...t,baseUrl:t.baseUrl+n});return await r.fetch(),r}function tb(e){Gh=e}var yi={shouldPopulateBundledImagesAsBlobs:!(typeof globalThis.navigator<"u"&&"ReactNative"==globalThis.navigator.product)};async function ab(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...yi,...e}),{url:n,updated_at:r}=await Uh(e),i=await Qe()(n,{mode:"cors"}),{data:a,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format ${s}`);let o=new st(t);return await o.hydrate(a,t.shouldPopulateBundledImagesAsBlobs),o.updatedAt=r,o}async function Uh(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...yi,...e}),{version:n,venue:r}=e,i=`${e.bundleBaseUri||t.baseUrl+`exports/legacy${null!=t.language&&qh.includes(t.language)?"-"+t.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return t.language=void 0,await In(t,i)}async function nb(e,{url:t,updated_at:n}){let r=ka({baseUrl:"https://api-gateway.mappedin.com/",...yi,...e}),i=await Qe()(t,{mode:"cors"}),{data:a,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format${s}`);let o=new st(r);return await o.hydrate(a,r.shouldPopulateBundledImagesAsBlobs),o.updatedAt=n,o}async function ju(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...Dr,...e}),{version:n,venue:r}=e,i=`${e.bundleBaseUri||t.baseUrl+"exports/mvf/1/bundle"}?venue=${r}&version=1.0.0`;return t.language=void 0,await In(t,i)}async function Vh(e,t=!1){return new Promise((async(n,r)=>{try{let i=new TextDecoder,a=i.decode.bind(i),s=await Promise.resolve().then((()=>(_u(),xu)));if(t){let t=new Blob(['var enc = new TextDecoder();\n\t\t\t\tvar currentTaskName;\n\t\t\t\tself.onmessage = async function({ data }) {\n\t\t\t\t\tif (data[0] === "task") {\n\t\t\t\t\t\tcurrentTaskName = data[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tpostMessage([\n\t\t\t\t\t\t\t "finished",\n\t\t\t\t\t\t [currentTaskName, JSON.parse(enc.decode(data))]\n\t\t\t\t\t\t]);\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t postMessage(["error", e.toString()]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t currentTaskName = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t'],{type:"text/javascript"}),{url:i}=await ju(e),o=new Uint8Array(await Qe()(i).then((e=>e.arrayBuffer()))),l=s.unzipSync(o),u=Object.keys(l),h=Math.min(u.length,Math.min(4,navigator.hardwareConcurrency)||4),c=[],d=u.map((e=>[e,l[e].buffer])),f=1e6,p=[],g=[];for(let e=0;e<d.length;e++){let[,t]=d[e];t.byteLength>=f?p.push(d[e]):t.byteLength<f&&g.push(d[e])}let y={};if(0===g.length)d.forEach((([e])=>{y[e]=JSON.parse(a(l[e]))})),n(y);else{let e=function({data:e}){let t=this;if("finished"===e[0]){let n=g[s];if(null!=n){let[e,r]=n;t.postMessage(["task",e]),t.postMessage(r,[r]),s++}let[r,i]=e[1];y[r]=i,o++}else if("error"===e[0]){let[,t]=e;c.forEach((e=>e.terminate())),r(t)}o===u.length&&(n(y),c.forEach((e=>e.terminate())))};let i=URL.createObjectURL(t);for(let e=0;e<Math.min(h,g.length);e++)c.push(new Worker(i));let s=0,o=0;c.forEach((t=>{if(t.onmessage=e,null!=g[s]){let[e,n]=g[s];t.postMessage(["task",e]),t.postMessage(n,[n]),s++}})),p.forEach((([e])=>{y[e]=JSON.parse(a(l[e])),o++}))}}else{let{url:t}=await ju(e),r=new Uint8Array(await Qe()(t).then((e=>e.arrayBuffer()))),i=s.unzipSync(r),o=Object.keys(i),l={};for(let e=0;e<o.length;e++){let t=o[e];if(0===t.indexOf("image/")&&-1===t.indexOf("__MACOSX"))l[t]=i[t].buffer;else if("/"!==t.slice(-1))try{l[t]=JSON.parse(a(i[t]))}catch{z.warn("bad file",t)}}n(l)}}catch(e){r(e)}}))}export{Bs as MAP_RENDER_MODE,st as Mappedin,Re as MappedinCategory,oa as MappedinCollectionType,xt as MappedinCoordinate,ra as MappedinDestinationSet,wt as MappedinDirections,et as MappedinEvent,we as MappedinLocation,tt as MappedinMap,at as MappedinMapGroup,Ue as MappedinNavigatable,nt as MappedinNode,Ce as MappedinPolygon,rt as MappedinRankings,it as MappedinVenue,ot as MappedinVortex,Hr as OfflineSearch,tb as __setGetVenueMock,nb as downloadBundle,Vh as downloadVenueBundleMVF,Gh as getVenue,ab as getVenueBundle,Uh as getVenueBundleURL,eb as getVenueMVF,ju as getVenueMVFURL,Qe as isomorphicFetch,Zk as setFetchFn};
|
|
1
|
+
var M,Ou=Object.create,Ma=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,Au=Object.getOwnPropertyNames,Nu=Object.getPrototypeOf,Eu=Object.prototype.hasOwnProperty,Su=(e,t,n)=>t in e?Ma(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mi=(e,t)=>()=>(e&&(t=e(e=0)),t),D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Pu=(e,t)=>{for(var n in t)Ma(e,n,{get:t[n],enumerable:!0})},Fu=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of Au(t))!Eu.call(e,i)&&i!==n&&Ma(e,i,{get:()=>t[i],enumerable:!(r=zu(t,i))||r.enumerable});return e},Yn=(e,t,n)=>(n=null!=e?Ou(Nu(e)):{},Fu(!t&&e&&e.__esModule?n:Ma(n,"default",{value:e,enumerable:!0}),e)),ye=(e,t,n)=>(Su(e,"symbol"!=typeof t?t+"":t,n),n),wi=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},N=(e,t,n)=>(wi(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Y=(e,t,n,r)=>(wi(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),h=Mi((()=>{M={env:{NODE_ENV:"production",npm_package_version:"6.0.0-alpha.4"}}})),xi=D(((e,t)=>{h(),function(n){var r="object"==typeof e&&e,i="object"==typeof t&&t&&t.exports==r&&t,a="object"==typeof global&&global;(a.global===a||a.window===a)&&(n=a);var s=function(e){this.message=e};(s.prototype=new Error).name="InvalidCharacterError";var o=function(e){throw new s(e)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&o("The string to be encoded contains characters outside of the Latin1 range.");for(var t,n,r,i,a=e.length%3,s="",u=-1,h=e.length-a;++u<h;)t=e.charCodeAt(u)<<16,n=e.charCodeAt(++u)<<8,r=e.charCodeAt(++u),s+=l.charAt((i=t+n+r)>>18&63)+l.charAt(i>>12&63)+l.charAt(i>>6&63)+l.charAt(63&i);return 2==a?(t=e.charCodeAt(u)<<8,n=e.charCodeAt(++u),s+=l.charAt((i=t+n)>>10)+l.charAt(i>>4&63)+l.charAt(i<<2&63)+"="):1==a&&(i=e.charCodeAt(u),s+=l.charAt(i>>2)+l.charAt(i<<4&63)+"=="),s},decode:function(e){var t=(e=String(e).replace(u,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&o("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,a="",s=-1;++s<t;)r=l.indexOf(e.charAt(s)),n=i%4?64*n+r:r,i++%4&&(a+=String.fromCharCode(255&n>>(-2*i&6)));return a},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return h}));else if(r&&!r.nodeType)if(i)i.exports=h;else for(var c in h)h.hasOwnProperty(c)&&(r[c]=h[c]);else n.base64=h}(e)})),oe=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.areaConversion=e.timeConversion=e.distanceConversion=e.altitudeKeys=e.latitudeKeys=e.longitudeKeys=e.MAXLON=e.MINLON=e.MAXLAT=e.MINLAT=e.earthRadius=e.sexagesimalPattern=void 0;e.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;e.earthRadius=6378137;e.MINLAT=-90;e.MAXLAT=90;e.MINLON=-180;e.MAXLON=180;e.longitudeKeys=["lng","lon","longitude",0];e.latitudeKeys=["lat","latitude",1];e.altitudeKeys=["alt","altitude","elevation","elev",2];e.distanceConversion={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};e.timeConversion={m:60,h:3600,d:86400};var t={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};e.areaConversion=t,t.sqm=t.m2,t.sqkm=t.km2,t.sqft=t.ft2,t.sqyd=t.yd2,t.sqin=t.in2})),Kt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e,t){return t.reduce((function(t,n){if(typeof e>"u"||null===e)throw new Error("'".concat(e,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(e,n)&&typeof n<"u"&&typeof t>"u"?(t=n,n):t}),void 0)};e.default=t})),Zt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){var t=e.toString().trim();return!isNaN(parseFloat(t))&&parseFloat(t)===Number(t)};e.default=t})),Qt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){return t.sexagesimalPattern.test(e.toString().trim())};e.default=n})),ea=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=new RegExp(t.sexagesimalPattern).exec(e);if(typeof n>"u"||null===n)throw new Error("Given value is not in sexagesimal format");var r=Number(n[2])/60||0,i=Number(n[4])/3600||0,a=parseFloat(n[1])+r+i;return["S","W"].includes(n[7])?-a:a};e.default=n})),Oa=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=oe(),r=(t=Kt())&&t.__esModule?t:{default:t};function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:n.longitudeKeys,latitude:n.latitudeKeys,altitude:n.altitudeKeys},i=(0,r.default)(e,t.longitude),s=(0,r.default)(e,t.latitude),o=(0,r.default)(e,t.altitude);return a({latitude:s,longitude:i},o?{altitude:o}:{})};e.default=o})),Zn=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(Zt()),n=a(Qt()),r=a(ea()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function e(a){return(0,t.default)(a)?!(parseFloat(a)>i.MAXLAT||a<i.MINLAT):!!(0,n.default)(a)&&e((0,r.default)(a))};e.default=s})),er=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(Zt()),n=a(Qt()),r=a(ea()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function e(a){return(0,t.default)(a)?!(parseFloat(a)>i.MAXLON||a<i.MINLON):!!(0,n.default)(a)&&e((0,r.default)(a))};e.default=s})),ar=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(Oa()),n=i(Zn()),r=i(er());function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var i=(0,t.default)(e),a=i.latitude,s=i.longitude;if(Array.isArray(e)&&e.length>=2)return(0,r.default)(e[0])&&(0,n.default)(e[1]);if(typeof a>"u"||typeof s>"u")return!1;var o=e[s],l=e[a];return!(typeof l>"u"||typeof o>"u"||!1===(0,n.default)(l)||!1===(0,r.default)(o))};e.default=a})),Sa=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(Zt()),n=s(Qt()),r=s(ea()),i=s(ar()),a=s(Oa());function s(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=function e(s){if((0,t.default)(s))return Number(s);if((0,n.default)(s))return(0,r.default)(s);if((0,i.default)(s)){var o=(0,a.default)(s);return Array.isArray(s)?s.map((function(t,n){return[0,1].includes(n)?e(t):t})):l(l(l({},s),o.latitude&&u({},o.latitude,e(s[o.latitude]))),o.longitude&&u({},o.longitude,e(s[o.longitude])))}return Array.isArray(s)?s.map((function(t){return(0,i.default)(t)?e(t):t})):s};e.default=c})),_e=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=i(Kt()),r=i(Sa());function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e,i){var a=(0,n.default)(e,t.latitudeKeys);if(!(typeof a>"u"||null===a)){var s=e[a];return!0===i?s:(0,r.default)(s)}};e.default=a})),je=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=i(Kt()),r=i(Sa());function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e,i){var a=(0,n.default)(e,t.longitudeKeys);if(!(typeof a>"u"||null===a)){var s=e[a];return!0===i?s:(0,r.default)(s)}};e.default=a})),De=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return e*Math.PI/180};e.default=t})),dt=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return 180*e/Math.PI};e.default=t})),Pi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(_e()),n=s(je()),r=s(De()),i=s(dt()),a=oe();function s(e){return e&&e.__esModule?e:{default:e}}var o=function(e,s,o){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,t.default)(e),h=(0,n.default)(e),c=s/l,d=(0,r.default)(o),f=(0,r.default)(u),p=(0,r.default)(h),g=Math.asin(Math.sin(f)*Math.cos(c)+Math.cos(f)*Math.sin(c)*Math.cos(d)),y=p+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(g)),m=(0,i.default)(y);return(m<a.MINLON||m>a.MAXLON)&&(y=(y+3*Math.PI)%(2*Math.PI)-Math.PI,m=(0,i.default)(y)),{latitude:(0,i.default)(g),longitude:m}};e.default=o})),Fi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=t.areaConversion[n];if(r)return e*r;throw new Error("Invalid unit used for area conversion.")};e.default=n})),Di=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=t.distanceConversion[n];if(r)return e*r;throw new Error("Invalid unit used for distance conversion.")};e.default=n})),Li=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=oe(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(n){case"kmh":return e*t.timeConversion.h*t.distanceConversion.km;case"mph":return e*t.timeConversion.h*t.distanceConversion.mi;default:return e}};e.default=n})),Bi=D((e=>{"use strict";function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&null!=o.return&&o.return()}finally{if(i)throw a}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}}(e,t)||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 n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(e){var t=Math.pow(10,12);return Math.round(e*t)/t},i=function(e){var n=t(e.toString().split("."),2),i=n[0],a=n[1],s=Math.abs(Number(i)),o=r(60*Number("0."+(a||0))),l=Math.floor(o),u=r(60*(o%l||0));return s+"° "+Number(l.toFixed(6)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+"' "+Number(u.toFixed(4)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+'"'};e.default=i})),sr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return e>1?1:e<-1?-1:e};e.default=t})),Ke=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(_e()),n=s(je()),r=s(De()),i=s(sr()),a=oe();function s(e){return e&&e.__esModule?e:{default:e}}var o=function(e,s){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;o=typeof o<"u"&&!isNaN(o)?o:1;var l=(0,t.default)(e),u=(0,n.default)(e),h=(0,t.default)(s),c=(0,n.default)(s),d=Math.acos((0,i.default)(Math.sin((0,r.default)(h))*Math.sin((0,r.default)(l))+Math.cos((0,r.default)(h))*Math.cos((0,r.default)(l))*Math.cos((0,r.default)(u)-(0,r.default)(c))))*a.earthRadius;return Math.round(d/o)*o};e.default=o})),ur=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default;return r="function"==typeof r?r:n.default,t.slice().sort((function(t,n){return r(e,t)-r(e,n)}))};e.default=r})),Vi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=ur())&&t.__esModule?t:{default:t};var r=function(e,t){return(0,n.default)(e,t)[0]};e.default=r})),Hi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(De()),n=a(_e()),r=a(je()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){var a=0;if(e.length>2){for(var s,o,l,u=0;u<e.length;u++){u===e.length-2?(s=e.length-2,o=e.length-1,l=0):u===e.length-1?(s=e.length-1,o=0,l=1):(s=u,o=u+1,l=u+2);var h=(0,r.default)(e[s]),c=(0,n.default)(e[o]),d=(0,r.default)(e[l]);a+=((0,t.default)(d)-(0,t.default)(h))*Math.sin((0,t.default)(c))}a=a*i.earthRadius*i.earthRadius/2}return Math.abs(a)};e.default=s})),dr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(_e()),n=r(je());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e){if(!1===Array.isArray(e)||0===e.length)throw new Error("No points were given.");return e.reduce((function(e,r){var i=(0,t.default)(r),a=(0,n.default)(r);return{maxLat:Math.max(i,e.maxLat),minLat:Math.min(i,e.minLat),maxLng:Math.max(a,e.maxLng),minLng:Math.min(a,e.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})};e.default=i})),Xi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(_e()),n=s(je()),r=s(De()),i=s(dt()),a=oe();function s(e){return e&&e.__esModule?e:{default:e}}var o=function(e,s){var o,l,u=(0,t.default)(e),h=(0,n.default)(e),c=(0,r.default)(u),d=(0,r.default)(h),f=s/a.earthRadius,p=c-f,g=c+f,y=(0,r.default)(a.MAXLAT),m=(0,r.default)(a.MINLAT),v=(0,r.default)(a.MAXLON),_=(0,r.default)(a.MINLON);if(p>m&&g<y){var w=Math.asin(Math.sin(f)/Math.cos(c));(o=d-w)<_&&(o+=2*Math.PI),(l=d+w)>v&&(l-=2*Math.PI)}else p=Math.max(p,m),g=Math.min(g,y),o=_,l=v;return[{latitude:(0,i.default)(p),longitude:(0,i.default)(o)},{latitude:(0,i.default)(g),longitude:(0,i.default)(l)}]};e.default=o})),Zi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=a(dt());function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){if(!1===Array.isArray(e)||0===e.length)return!1;var a=e.length,s=e.reduce((function(e,i){var a=(0,r.default)((0,t.default)(i)),s=(0,r.default)((0,n.default)(i));return{X:e.X+Math.cos(a)*Math.cos(s),Y:e.Y+Math.cos(a)*Math.sin(s),Z:e.Z+Math.sin(a)}}),{X:0,Y:0,Z:0}),o=s.X/a,l=s.Y/a,u=s.Z/a;return{longitude:(0,i.default)(Math.atan2(l,o)),latitude:(0,i.default)(Math.atan2(u,Math.sqrt(o*o+l*l)))}};e.default=s})),Qi=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=dr())&&t.__esModule?t:{default:t};var r=function(e){var t=(0,n.default)(e),r=t.minLat+(t.maxLat-t.minLat)/2,i=t.minLng+(t.maxLng-t.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(i.toFixed(6))}};e.default=r})),pr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=a(dt());function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,a){var s=(0,r.default)((0,n.default)(a))-(0,r.default)((0,n.default)(e)),o=Math.log(Math.tan((0,r.default)((0,t.default)(a))/2+Math.PI/4)/Math.tan((0,r.default)((0,t.default)(e))/2+Math.PI/4));return Math.abs(s)>Math.PI&&(s=s>0?-1*(2*Math.PI-s):2*Math.PI+s),((0,i.default)(Math.atan2(s,o))+360)%360};e.default=s})),no=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=pr())&&t.__esModule?t:{default:t};var r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,i="function"==typeof r?r(e,t):(0,n.default)(e,t);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"}};e.default=r})),mr=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(Ke()),n=r(sr());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e,r,i){var a=(0,t.default)(r,e),s=(0,t.default)(e,i),o=(0,t.default)(r,i),l=Math.acos((0,n.default)((a*a+o*o-s*s)/(2*a*o))),u=Math.acos((0,n.default)((s*s+o*o-a*a)/(2*s*o)));return l>Math.PI/2?a:u>Math.PI/2?s:Math.sin(l)*a};e.default=i})),uo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=a(dt());function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,a){var s=(0,t.default)(a),o=(0,n.default)(a),l=(0,t.default)(e),u=(0,n.default)(e);return((0,i.default)(Math.atan2(Math.sin((0,r.default)(o)-(0,r.default)(u))*Math.cos((0,r.default)(s)),Math.cos((0,r.default)(l))*Math.sin((0,r.default)(s))-Math.sin((0,r.default)(l))*Math.cos((0,r.default)(s))*Math.cos((0,r.default)(o)-(0,r.default)(u))))+360)%360};e.default=s})),lo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.default;return e.reduce((function(e,n){return"object"===r(e)&&null!==e.last&&(e.distance+=t(n,e.last)),e.last=n,e}),{last:null,distance:0}).distance};e.default=i})),mo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(_e()),n=a(je()),r=a(De()),i=oe();function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,a){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=typeof s<"u"&&!isNaN(s)?s:1;var o,l,u,h,c,d,f,p=(0,t.default)(e),g=(0,n.default)(e),y=(0,t.default)(a),m=(0,n.default)(a),v=6356752.314245,_=1/298.257223563,w=(0,r.default)(m-g),M=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(p)))),b=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(y)))),x=Math.sin(M),O=Math.cos(M),E=Math.sin(b),N=Math.cos(b),A=w,I=100;do{var k=Math.sin(A),T=Math.cos(A);if(0===(d=Math.sqrt(N*k*(N*k)+(O*E-x*N*T)*(O*E-x*N*T))))return 0;o=x*E+O*N*T,l=Math.atan2(d,o),c=o-2*x*E/(h=1-(u=O*N*k/d)*u),isNaN(c)&&(c=0);var S=_/16*h*(4+_*(4-3*h));f=A,A=w+(1-S)*_*u*(l+S*d*(c+S*o*(2*c*c-1)))}while(Math.abs(A-f)>1e-12&&--I>0);if(0===I)return NaN;var F=h*(i.earthRadius*i.earthRadius-v*v)/(v*v),D=1+F/16384*(4096+F*(F*(320-175*F)-768)),P=F/1024*(256+F*(F*(74-47*F)-128)),j=P*d*(c+P/4*(o*(2*c*c-1)-P/6*c*(4*d*d-3)*(4*c*c-3))),B=v*D*(l-j);return Math.round(B/s)*s};e.default=s})),fo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return/^NNE|NE|NNW|N$/.test(e)?"N":/^ENE|E|ESE|SE$/.test(e)?"E":/^SSE|S|SSW|SW$/.test(e)?"S":/^WSW|W|WNW|NW$/.test(e)?"W":void 0};e.default=t})),go=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,i=r(e,t),a=Number(t.time)-Number(e.time),s=i/a*1e3;return s};e.default=r})),yo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t,r){return(0,n.default)(t,e)+(0,n.default)(e,r)===(0,n.default)(t,r)};e.default=r})),ko=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(_e()),n=r(je());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e,r){for(var i=!1,a=r.length,s=-1,o=a-1;++s<a;o=s)((0,n.default)(r[s])<=(0,n.default)(e)&&(0,n.default)(e)<(0,n.default)(r[o])||(0,n.default)(r[o])<=(0,n.default)(e)&&(0,n.default)(e)<(0,n.default)(r[s]))&&(0,t.default)(e)<((0,t.default)(r[o])-(0,t.default)(r[s]))*((0,n.default)(e)-(0,n.default)(r[s]))/((0,n.default)(r[o])-(0,n.default)(r[s]))+(0,t.default)(r[s])&&(i=!i);return i};e.default=i})),bo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=mr())&&t.__esModule?t:{default:t};var r=function(e,t,r,i){return(0,n.default)(e,t,r)<i};e.default=r})),Mo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=Ke())&&t.__esModule?t:{default:t};var r=function(e,t,r){return(0,n.default)(e,t)<r};e.default=r})),xo=D((e=>{"use strict";function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&null!=o.return&&o.return()}finally{if(i)throw a}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}}(e,t)||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 n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}h(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(e){if(!e.startsWith("POLYGON"))throw new Error("Invalid wkt.");return e.slice(e.indexOf("(")+2,e.indexOf(")")).split(", ").map((function(e){var n=t(e.split(" "),2),r=n[0],i=n[1];return{longitude:parseFloat(r),latitude:parseFloat(i)}}))};e.default=r})),jo=D((e=>{"use strict";h(),Object.defineProperty(e,"__esModule",{value:!0});var t={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(e,"computeDestinationPoint",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"convertArea",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"convertDistance",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"convertSpeed",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"decimalToSexagesimal",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"findNearest",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"getAreaOfPolygon",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"getBounds",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"getBoundsOfDistance",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"getCenter",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"getCenterOfBounds",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"getCompassDirection",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"getCoordinateKey",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(e,"getCoordinateKeys",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"getDistance",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"getDistanceFromLine",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"getGreatCircleBearing",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(e,"getLatitude",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(e,"getLongitude",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(e,"getPathLength",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"getPreciseDistance",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(e,"getRhumbLineBearing",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(e,"getRoughCompassDirection",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(e,"getSpeed",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(e,"isDecimal",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"isPointInLine",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(e,"isPointInPolygon",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(e,"isPointNearLine",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(e,"isPointWithinRadius",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(e,"isSexagesimal",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(e,"isValidCoordinate",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(e,"isValidLatitude",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(e,"isValidLongitude",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(e,"orderByDistance",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(e,"sexagesimalToDecimal",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(e,"toDecimal",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(e,"toRad",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(e,"toDeg",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(e,"wktToPolygon",{enumerable:!0,get:function(){return U.default}});var n=G(Pi()),r=G(Fi()),i=G(Di()),a=G(Li()),s=G(Bi()),o=G(Vi()),l=G(Hi()),u=G(dr()),c=G(Xi()),d=G(Zi()),f=G(Qi()),p=G(no()),g=G(Kt()),y=G(Oa()),m=G(Ke()),v=G(mr()),_=G(uo()),w=G(_e()),M=G(je()),b=G(lo()),x=G(mo()),O=G(pr()),E=G(fo()),N=G(go()),A=G(Zt()),I=G(yo()),k=G(ko()),T=G(bo()),S=G(Mo()),F=G(Qt()),D=G(ar()),P=G(Zn()),j=G(er()),B=G(ur()),C=G(ea()),L=G(Sa()),z=G(De()),R=G(dt()),U=G(xo()),$=oe();function G(e){return e&&e.__esModule?e:{default:e}}Object.keys($).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return $[n]}})}))})),ss=D(((e,t)=>{"use strict";h(),t.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))})),ps=D(((e,t)=>{"use strict";h();var n="%[a-f0-9]{2}",r=new RegExp("("+n+")|([^%]+?)","gi"),i=new RegExp("("+n+")+","gi");function a(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],a(n),a(r))}function s(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(r)||[],n=1;n<t.length;n++)t=(e=a(t,n).join("")).match(r)||[];return e}}t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{var r=s(n[0]);r!==n[0]&&(t[n[0]]=r)}n=i.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),o=0;o<a.length;o++){var l=a[o];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}})),ms=D(((e,t)=>{"use strict";h(),t.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}})),gs=D(((e,t)=>{"use strict";h(),t.exports=function(e,t){for(var n={},r=Object.keys(e),i=Array.isArray(t),a=0;a<r.length;a++){var s=r[a],o=e[s];(i?-1!==t.indexOf(s):t(s,o,e))&&(n[s]=o)}return n}})),_s=D((e=>{"use strict";h();var t=ss(),n=ps(),r=ms(),i=gs(),a=Symbol("encodeFragmentIdentifier");function s(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(e,n){return n.encode?n.strict?t(e):encodeURIComponent(e):e}function l(e,t){return t.decode?n(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function c(e){let t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function d(e){let t=(e=c(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function f(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function p(e,t){s((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{let i="string"==typeof n&&n.includes(e.arrayFormatSeparator),a="string"==typeof n&&!i&&l(n,e).includes(e.arrayFormatSeparator);n=a?l(n,e):n;let s=i||a?n.split(e.arrayFormatSeparator).map((t=>l(t,e))):null===n?n:l(n,e);r[t]=s};case"bracket-separator":return(t,n,r)=>{let i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(r[t]=n&&l(n,e));let a=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>l(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],a):r[t]=a};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),i=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return i;for(let a of e.split("&")){if(""===a)continue;let[e,s]=r(t.decode?a.replace(/\+/g," "):a,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:l(s,t),n(l(e,t),s,i)}for(let e of Object.keys(i)){let n=i[e];if("object"==typeof n&&null!==n)for(let e of Object.keys(n))n[e]=f(n[e],t);else i[e]=f(n,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{let n=i[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=u(n):e[t]=n,e}),Object.create(null))}e.extract=d,e.parse=p,e.stringify=(e,t)=>{if(!e)return"";s((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let n=n=>t.skipNull&&(e=>null==e)(e[n])||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{let i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[o(t,e),"[",i,"]"].join("")]:[...n,[o(t,e),"[",o(i,e),"]=",o(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[o(t,e),"[]"].join("")]:[...n,[o(t,e),"[]=",o(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[o(n,e),t,o(i,e)].join("")]:[[r,o(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,o(t,e)]:[...n,[o(t,e),"=",o(r,e)].join("")]}}(t),i={};for(let t of Object.keys(e))n(t)||(i[t]=e[t]);let a=Object.keys(i);return!1!==t.sort&&a.sort(t.sort),a.map((n=>{let i=e[n];return void 0===i?"":null===i?o(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?o(n,t)+"[]":i.reduce(r(n),[]).join("&"):o(n,t)+"="+o(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[n,i]=r(e,"#");return Object.assign({url:n.split("?")[0]||"",query:p(d(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:l(i,t)}:{})},e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0,[a]:!0},n);let r=c(t.url).split("?")[0]||"",i=e.extract(t.url),s=e.parse(i,{sort:!1}),l=Object.assign(s,t.query),u=e.stringify(l,n);u&&(u=`?${u}`);let h=function(e){let t="",n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(t.url);return t.fragmentIdentifier&&(h=`#${n[a]?o(t.fragmentIdentifier,n):t.fragmentIdentifier}`),`${r}${u}${h}`},e.pick=(t,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[a]:!1},r);let{url:s,query:o,fragmentIdentifier:l}=e.parseUrl(t,r);return e.stringifyUrl({url:s,query:i(o,n),fragmentIdentifier:l},r)},e.exclude=(t,n,r)=>{let i=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return e.pick(t,i,r)}})),xu={};function ci(e,t){return!t&&"function"==typeof e&&(t=e,e={}),this.ondata=t,e}function cu(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[$t],(function(e){return ct(va(e.data[0],e.data[1]))}),0,n)}function va(e,t){return vt(e,t||{},0,0)}function pi(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[Vt],(function(e){return ct(Yt(e.data[0],ii(e.data[1])))}),1,n)}function Yt(e,t){return ga(e,t)}function wh(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[$t,nu,function(){return[Qr]}],(function(e){return ct(Qr(e.data[0],e.data[1]))}),2,n)}function Qr(e,t){t||(t={});var n=Ut(),r=e.length;n.p(e);var i=vt(e,t,ui(t),8),a=i.length;return oi(i,t),H(i,a-8,n.d()),H(i,a-4,r),i}function pu(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[Vt,ru,function(){return[Un]}],(function(e){return ct(Un(e.data[0]))}),3,n)}function Un(e,t){return ga(e.subarray(si(e),-8),t||new U(su(e)))}function _h(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[$t,iu,function(){return[ti]}],(function(e){return ct(ti(e.data[0],e.data[1]))}),4,n)}function ti(e,t){t||(t={});var n=ri();n.p(e);var r=vt(e,t,2,4);return li(r,t),H(r,r.length-4,n.d()),r}function mu(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),Wt(e,t,[Vt,ou,function(){return[$n]}],(function(e){return ct($n(e.data[0],ii(e.data[1])))}),5,n)}function $n(e,t){return ga((uu(e),e.subarray(2,-4)),t)}function Th(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&E(7),31==e[0]&&139==e[1]&&8==e[2]?pu(e,t,n):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?pi(e,t,n):mu(e,t,n)}function Ih(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?Un(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?Yt(e,t):$n(e,t)}function lt(e,t){if(t){for(var n=new U(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Us)return Us.encode(e);var i=e.length,a=new U(e.length+(e.length>>1)),s=0,o=function(e){a[s++]=e};for(r=0;r<i;++r){if(s+5>a.length){var l=new U(s+8+(i-r<<1));l.set(a),a=l}var u=e.charCodeAt(r);u<128||t?o(u):u<2048?(o(192|u>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++r))>>18),o(128|u>>12&63),o(128|u>>6&63),o(128|63&u)):(o(224|u>>12),o(128|u>>6&63),o(128|63&u))}return ze(a,0,s)}function mi(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(ai)return ai.decode(e);var i=yu(e),a=i[0];return i[1].length&&E(8),a}function Sh(e,t,n){n||(n=t,t={}),"function"!=typeof n&&E(7);var r={};hi(e,"",r,t);var i=Object.keys(r),a=i.length,s=0,o=0,l=a,u=new Array(a),h=[],c=function(){for(var e=0;e<h.length;++e)h[e]()},d=function(e,t){Wn((function(){n(e,t)}))};Wn((function(){d=n}));var f=function(){var e=new U(o+22),t=s,n=o-s;o=0;for(var r=0;r<l;++r){var i=u[r];try{var a=i.c.length;Rt(e,o,i,i.f,i.u,a);var h=30+i.f.length+ut(i.extra),c=o+h;e.set(i.c,c),Rt(e,s,i,i.f,i.u,a,o,i.m),s+=16+h+(i.m?i.m.length:0),o=c+a}catch(e){return d(e,null)}}fi(e,s,u.length,n,t),d(null,e)};a||f();for(var p=function(e){var t=i[e],n=r[t],l=n[0],p=n[1],g=Ut(),y=l.length;g.p(l);var m=lt(t),v=m.length,_=p.comment,w=_&<(_),M=w&&w.length,b=ut(p.extra),x=0==p.level?0:8,O=function(n,r){if(n)c(),d(n,null);else{var i=r.length;u[e]=ya(p,{size:y,crc:g.d(),c:r,f:m,m:w,u:v!=t.length||w&&_.length!=M,compression:x}),s+=30+v+b+i,o+=76+2*(v+b)+(M||0)+i,--a||f()}};if(v>65535&&O(E(11,0,1),null),x)if(y<16e4)try{O(null,va(l,p))}catch(e){O(e,null)}else h.push(cu(l,p,O));else O(null,l)},g=0;g<l;++g)p(g);return c}function Ph(e,t){t||(t={});var n={},r=[];hi(e,"",n,t);var i=0,a=0;for(var s in n){var o=n[s],l=o[0],u=o[1],h=0==u.level?0:8,c=(x=lt(s)).length,d=u.comment,f=d&<(d),p=f&&f.length,g=ut(u.extra);c>65535&&E(11);var y=h?va(l,u):l,m=y.length,v=Ut();v.p(l),r.push(ya(u,{size:l.length,crc:v.d(),c:y,f:x,m:f,u:c!=s.length||f&&d.length!=p,o:i,compression:h})),i+=30+c+g+m,a+=76+2*(c+g)+(p||0)+m}for(var _=new U(a+22),w=i,M=a-i,b=0;b<r.length;++b){var x=r[b];Rt(_,x.o,x,x.f,x.u,x.c.length);var O=30+x.f.length+ut(x.extra);_.set(x.c,x.o+O),Rt(_,i,x,x.f,x.u,x.c.length,x.o,x.m),i+=16+O+(x.m?x.m.length:0)}return fi(_,i,r.length,M,w),_}function Ch(e,t,n){n||(n=t,t={}),"function"!=typeof n&&E(7);var r=[],i=function(){for(var e=0;e<r.length;++e)r[e]()},a={},s=function(e,t){Wn((function(){n(e,t)}))};Wn((function(){s=n}));for(var o=e.length-22;101010256!=Q(e,o);--o)if(!o||e.length-o>65558)return s(E(13,0,1),null),i;var l=me(e,o+8);if(l){var u=l,h=Q(e,o+16),c=4294967295==h;if(c){if(o=Q(e,o-12),101075792!=Q(e,o))return s(E(13,0,1),null),i;u=l=Q(e,o+32),h=Q(e,o+48)}for(var d=t&&t.filter,f=function(t){var n=bu(e,h,c),o=n[0],u=n[1],f=n[2],p=n[3],g=n[4],y=n[5],m=ku(e,y);h=g;var v=function(e,t){e?(i(),s(e,null)):(t&&(a[p]=t),--l||s(null,a))};if(!d||d({name:p,size:u,originalSize:f,compression:o}))if(o)if(8==o){var _=e.subarray(m,m+u);if(u<32e4)try{v(null,Yt(_,new U(f)))}catch(e){v(e,null)}else r.push(pi(_,{size:f},v))}else v(E(14,"unknown compression type "+o,1),null);else v(null,ze(e,m,m+u));else v(null,null)},p=0;p<u;++p)f()}else s(null,{});return i}function Rh(e,t){for(var n={},r=e.length-22;101010256!=Q(e,r);--r)(!r||e.length-r>65558)&&E(13);var i=me(e,r+8);if(!i)return{};var a=Q(e,r+16),s=4294967295==a;s&&(r=Q(e,r-12),101075792!=Q(e,r)&&E(13),i=Q(e,r+32),a=Q(e,r+48));for(var o=t&&t.filter,l=0;l<i;++l){var u=bu(e,a,s),h=u[0],c=u[1],d=u[2],f=u[3],p=u[4],g=u[5],y=ku(e,g);a=p,(!o||o({name:f,size:c,originalSize:d,compression:h}))&&(h?8==h?n[f]=Yt(e.subarray(y,y+c),new U(d)):E(14,"unknown compression type "+h):n[f]=ze(e,y,y+c))}return n}Pu(xu,{AsyncCompress:()=>Mh,AsyncDecompress:()=>jh,AsyncDeflate:()=>lu,AsyncGunzip:()=>du,AsyncGzip:()=>Mh,AsyncInflate:()=>di,AsyncUnzipInflate:()=>Dh,AsyncUnzlib:()=>hu,AsyncZipDeflate:()=>Nh,AsyncZlib:()=>xh,Compress:()=>Zr,DecodeUTF8:()=>Oh,Decompress:()=>fu,Deflate:()=>qe,EncodeUTF8:()=>zh,FlateErrorCode:()=>kh,Gunzip:()=>Gn,Gzip:()=>Zr,Inflate:()=>be,Unzip:()=>Lh,UnzipInflate:()=>Fh,UnzipPassThrough:()=>wu,Unzlib:()=>Vn,Zip:()=>Eh,ZipDeflate:()=>Ah,ZipPassThrough:()=>ma,Zlib:()=>ei,compress:()=>wh,compressSync:()=>Qr,decompress:()=>Th,decompressSync:()=>Ih,deflate:()=>cu,deflateSync:()=>va,gunzip:()=>pu,gunzipSync:()=>Un,gzip:()=>wh,gzipSync:()=>Qr,inflate:()=>pi,inflateSync:()=>Yt,strFromU8:()=>mi,strToU8:()=>lt,unzip:()=>Ch,unzipSync:()=>Rh,unzlib:()=>mu,unzlibSync:()=>$n,zip:()=>Sh,zipSync:()=>Ph,zlib:()=>_h,zlibSync:()=>ti});var qs,vh,U,de,Bt,qt,Gt,pa,Vs,$s,ni,Rn,Ws,Hs,Xr,ha,Ye,Oe,Je,Ct,W,Ys,Xs,Js,Ks,Dn,Ie,Ln,fa,ze,kh,Zs,E,ga,Be,Dt,Cn,Bn,Jr,Lt,qn,Kr,Qs,Xe,eu,tu,Ut,ri,vt,ya,Gs,Fn,bh,au,Vt,$t,nu,ru,iu,ou,ct,ii,Wt,Ae,Ht,me,Q,Yr,H,oi,si,su,ui,li,uu,qe,lu,be,di,Zr,Mh,Gn,du,ei,xh,Vn,hu,fu,jh,hi,Us,ai,gu,yu,Oh,zh,vu,ku,bu,Mu,ut,Rt,fi,ma,Ah,Nh,Eh,wu,Fh,Dh,Lh,Wn,_u=Mi((()=>{for(h(),qs={},vh=function(e,t,n,r,i){var a=new Worker(qs[t]||(qs[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(e){var t=e.data,n=t.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],i(r,null)}else i(null,t)},a.postMessage(n,r),a},U=Uint8Array,de=Uint16Array,Bt=Uint32Array,qt=new U([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Gt=new U([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),pa=new U([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$s=(Vs=function(e,t){for(var n=new de(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Bt(n[30]);for(r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]})(qt,2),ni=$s[0],Rn=$s[1],ni[28]=258,Rn[258]=28,Ws=Vs(Gt,0),Hs=Ws[0],Xr=Ws[1],ha=new de(32768),W=0;W<32768;++W)Ye=(61680&(Ye=(52428&(Ye=(43690&W)>>>1|(21845&W)<<1))>>>2|(13107&Ye)<<2))>>>4|(3855&Ye)<<4,ha[W]=((65280&Ye)>>>8|(255&Ye)<<8)>>>1;for(Oe=function(e,t,n){for(var r=e.length,i=0,a=new de(t);i<r;++i)e[i]&&++a[e[i]-1];var s,o=new de(t);for(i=0;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;if(n){s=new de(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],h=t-e[i],c=o[e[i]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)s[ha[c]>>>l]=u}else for(s=new de(r),i=0;i<r;++i)e[i]&&(s[i]=ha[o[e[i]-1]++]>>>15-e[i]);return s},Je=new U(288),W=0;W<144;++W)Je[W]=8;for(W=144;W<256;++W)Je[W]=9;for(W=256;W<280;++W)Je[W]=7;for(W=280;W<288;++W)Je[W]=8;for(Ct=new U(32),W=0;W<32;++W)Ct[W]=5;Ys=Oe(Je,9,0),Xs=Oe(Je,9,1),Js=Oe(Ct,5,0),Ks=Oe(Ct,5,1),Dn=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Ie=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},Ln=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},fa=function(e){return(e+7)/8|0},ze=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(2==e.BYTES_PER_ELEMENT?de:4==e.BYTES_PER_ELEMENT?Bt:U)(n-t);return r.set(e.subarray(t,n)),r},kh={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},Zs=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(e,t,n){var r=new Error(t||Zs[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,E),!n)throw r;return r},ga=function(e,t,n){var r=e.length;if(!r||n&&n.f&&!n.l)return t||new U(0);var i=!t||n,a=!n||n.i;n||(n={}),t||(t=new U(3*r));var s=function(e){var n=t.length;if(e>n){var r=new U(Math.max(2*n,e));r.set(t),t=r}},o=n.f||0,l=n.p||0,u=n.b||0,h=n.l,c=n.d,d=n.m,f=n.n,p=8*r;do{if(!h){o=Ie(e,l,1);var g=Ie(e,l+1,3);if(l+=3,!g){var y=e[(I=fa(l)+4)-4]|e[I-3]<<8,m=I+y;if(m>r){a&&E(0);break}i&&s(u+y),t.set(e.subarray(I,m),u),n.b=u+=y,n.p=l=8*m,n.f=o;continue}if(1==g)h=Xs,c=Ks,d=9,f=5;else if(2==g){var v=Ie(e,l,31)+257,_=Ie(e,l+10,15)+4,w=v+Ie(e,l+5,31)+1;l+=14;for(var M=new U(w),b=new U(19),x=0;x<_;++x)b[pa[x]]=Ie(e,l+3*x,7);l+=3*_;var O=Dn(b),N=(1<<O)-1,A=Oe(b,O,1);for(x=0;x<w;){var I,k=A[Ie(e,l,N)];if(l+=15&k,(I=k>>>4)<16)M[x++]=I;else{var T=0,S=0;for(16==I?(S=3+Ie(e,l,3),l+=2,T=M[x-1]):17==I?(S=3+Ie(e,l,7),l+=3):18==I&&(S=11+Ie(e,l,127),l+=7);S--;)M[x++]=T}}var F=M.subarray(0,v),D=M.subarray(v);d=Dn(F),f=Dn(D),h=Oe(F,d,1),c=Oe(D,f,1)}else E(1);if(l>p){a&&E(0);break}}i&&s(u+131072);for(var P=(1<<d)-1,j=(1<<f)-1,B=l;;B=l){var C=(T=h[Ln(e,l)&P])>>>4;if((l+=15&T)>p){a&&E(0);break}if(T||E(2),C<256)t[u++]=C;else{if(256==C){B=l,h=null;break}var L=C-254;if(C>264){var z=qt[x=C-257];L=Ie(e,l,(1<<z)-1)+ni[x],l+=z}var R=c[Ln(e,l)&j],$=R>>>4;R||E(3),l+=15&R;D=Hs[$];if($>3){z=Gt[$];D+=Ln(e,l)&(1<<z)-1,l+=z}if(l>p){a&&E(0);break}i&&s(u+131072);for(var G=u+L;u<G;u+=4)t[u]=t[u-D],t[u+1]=t[u+1-D],t[u+2]=t[u+2-D],t[u+3]=t[u+3-D];u=G}}n.l=h,n.p=B,n.b=u,n.f=o,h&&(o=1,n.m=d,n.d=c,n.n=f)}while(!o);return u==t.length?t:ze(t,0,u)},Be=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},Dt=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Cn=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[Xe,0];if(1==i){var s=new U(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var o=n[0],l=n[1],u=0,h=1,c=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=i-1;)o=n[n[u].f<n[c].f?u++:c++],l=n[u!=h&&n[u].f<n[c].f?u++:c++],n[h++]={s:-1,f:o.f+l.f,l:o,r:l};var d=a[0].s;for(r=1;r<i;++r)a[r].s>d&&(d=a[r].s);var f=new de(d+1),p=Bn(n[h-1],f,0);if(p>t){r=0;var g=0,y=p-t,m=1<<y;for(a.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<i;++r){var v=a[r].s;if(!(f[v]>t))break;g+=m-(1<<p-f[v]),f[v]=t}for(g>>>=y;g>0;){var _=a[r].s;f[_]<t?g-=1<<t-f[_]++-1:++r}for(;r>=0&&g;--r){var w=a[r].s;f[w]==t&&(--f[w],++g)}p=t}return[new U(f),p]},Bn=function(e,t,n){return-1==e.s?Math.max(Bn(e.l,t,n+1),Bn(e.r,t,n+1)):t[e.s]=n},Jr=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new de(++t),r=0,i=e[0],a=1,s=function(e){n[r++]=e},o=1;o<=t;++o)if(e[o]==i&&o!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(i),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}for(;a--;)s(i);a=1,i=e[o]}return[n.subarray(0,r),t]},Lt=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},qn=function(e,t,n){var r=n.length,i=fa(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;a<r;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Kr=function(e,t,n,r,i,a,s,o,l,u,h){Be(t,h++,n),++i[256];for(var c=Cn(i,15),d=c[0],f=c[1],p=Cn(a,15),g=p[0],y=p[1],m=Jr(d),v=m[0],_=m[1],w=Jr(g),M=w[0],b=w[1],x=new de(19),O=0;O<v.length;++O)x[31&v[O]]++;for(O=0;O<M.length;++O)x[31&M[O]]++;for(var E=Cn(x,7),N=E[0],A=E[1],I=19;I>4&&!N[pa[I-1]];--I);var k,T,S,F,D=u+5<<3,P=Lt(i,Je)+Lt(a,Ct)+s,j=Lt(i,d)+Lt(a,g)+s+14+3*I+Lt(x,N)+(2*x[16]+3*x[17]+7*x[18]);if(D<=P&&D<=j)return qn(t,h,e.subarray(l,l+u));if(Be(t,h,1+(j<P)),h+=2,j<P){k=Oe(d,f,0),T=d,S=Oe(g,y,0),F=g;var B=Oe(N,A,0);Be(t,h,_-257),Be(t,h+5,b-1),Be(t,h+10,I-4),h+=14;for(O=0;O<I;++O)Be(t,h+3*O,N[pa[O]]);h+=3*I;for(var C=[v,M],L=0;L<2;++L){var z=C[L];for(O=0;O<z.length;++O){var R=31&z[O];Be(t,h,B[R]),h+=N[R],R>15&&(Be(t,h,z[O]>>>5&127),h+=z[O]>>>12)}}}else k=Ys,T=Je,S=Js,F=Ct;for(O=0;O<o;++O)if(r[O]>255){R=r[O]>>>18&31;Dt(t,h,k[R+257]),h+=T[R+257],R>7&&(Be(t,h,r[O]>>>23&31),h+=qt[R]);var U=31&r[O];Dt(t,h,S[U]),h+=F[U],U>3&&(Dt(t,h,r[O]>>>5&8191),h+=Gt[U])}else Dt(t,h,k[r[O]]),h+=T[r[O]];return Dt(t,h,k[256]),h+T[256]},Qs=new Bt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Xe=new U(0),eu=function(e,t,n,r,i,a){var s=e.length,o=new U(r+s+5*(1+Math.ceil(s/7e3))+i),l=o.subarray(r,o.length-i),u=0;if(!t||s<8)for(var h=0;h<=s;h+=65535){var c=h+65535;c>=s&&(l[u>>3]=a),u=qn(l,u+1,e.subarray(h,c))}else{for(var d=Qs[t-1],f=d>>>13,p=8191&d,g=(1<<n)-1,y=new de(32768),m=new de(g+1),v=Math.ceil(n/3),_=2*v,w=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<_)&g},M=new Bt(25e3),b=new de(288),x=new de(32),O=0,E=0,N=(h=0,0),A=0,I=0;h<s;++h){var k=w(h),T=32767&h,S=m[k];if(y[T]=S,m[k]=T,A<=h){var F=s-h;if((O>7e3||N>24576)&&F>423){u=Kr(e,l,0,M,b,x,E,N,I,h-I,u),N=O=E=0,I=h;for(var D=0;D<286;++D)b[D]=0;for(D=0;D<30;++D)x[D]=0}var P=2,j=0,B=p,C=T-S&32767;if(F>2&&k==w(h-C))for(var L=Math.min(f,F)-1,z=Math.min(32767,h),R=Math.min(258,F);C<=z&&--B&&T!=S;){if(e[h+P]==e[h+P-C]){for(var $=0;$<R&&e[h+$]==e[h+$-C];++$);if($>P){if(P=$,j=C,$>L)break;var G=Math.min(C,$-2),W=0;for(D=0;D<G;++D){var H=h-C+D+32768&32767,q=H-y[H]+32768&32767;q>W&&(W=q,S=H)}}}C+=(T=S)-(S=y[T])+32768&32767}if(j){M[N++]=268435456|Rn[P]<<18|Xr[j];var J=31&Rn[P],Y=31&Xr[j];E+=qt[J]+Gt[Y],++b[257+J],++x[Y],A=h+P,++O}else M[N++]=e[h],++b[e[h]]}}u=Kr(e,l,a,M,b,x,E,N,I,h-I,u),!a&&7&u&&(u=qn(l,u+1,Xe))}return ze(o,0,r+fa(u)+i)},tu=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&-306674912)^n>>>1;e[t]=n}return e}(),Ut=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=tu[255&n^t[r]]^n>>>8;e=n},d:function(){return~e}}},ri=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,a=0|n.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=r+=n[s];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}e=r,t=i},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}},vt=function(e,t,n,r,i){return eu(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},ya=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},Gs=function(e,t,n){for(var r=e(),i=e.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<r.length;++s){var o=r[s],l=a[s];if("function"==typeof o){t+=";"+l+"=";var u=o.toString();if(o.prototype)if(-1!=u.indexOf("[native code]")){var h=u.indexOf(" ",8)+1;t+=u.slice(h,u.indexOf("(",h))}else for(var c in t+=u,o.prototype)t+=";"+l+".prototype."+c+"="+o.prototype[c].toString();else t+=u}else n[l]=o}return[t,n]},Fn=[],bh=function(e){var t=[];for(var n in e)e[n].buffer&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t},au=function(e,t,n,r){var i;if(!Fn[n]){for(var a="",s={},o=e.length-1,l=0;l<o;++l)a=(i=Gs(e[l],a,s))[0],s=i[1];Fn[n]=Gs(e[o],a,s)}var u=ya({},Fn[n][1]);return vh(Fn[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,u,bh(u),r)},Vt=function(){return[U,de,Bt,qt,Gt,pa,ni,Hs,Xs,Ks,ha,Zs,Oe,Dn,Ie,Ln,fa,ze,E,ga,Yt,ct,ii]},$t=function(){return[U,de,Bt,qt,Gt,pa,Rn,Xr,Ys,Je,Js,Ct,ha,Qs,Xe,Oe,Be,Dt,Cn,Bn,Jr,Lt,qn,Kr,fa,ze,eu,vt,va,ct]},nu=function(){return[oi,ui,H,Ut,tu]},ru=function(){return[si,su]},iu=function(){return[li,H,ri]},ou=function(){return[uu]},ct=function(e){return postMessage(e,[e.buffer])},ii=function(e){return e&&e.size&&new U(e.size)},Wt=function(e,t,n,r,i,a){var s=au(n,r,i,(function(e,t){s.terminate(),a(e,t)}));return s.postMessage([e,t],t.consume?[e.buffer]:[]),function(){s.terminate()}},Ae=function(e){return e.ondata=function(e,t){return postMessage([e,t],[e.buffer])},function(t){return e.push(t.data[0],t.data[1])}},Ht=function(e,t,n,r,i){var a,s=au(e,r,i,(function(e,n){e?(s.terminate(),t.ondata.call(t,e)):(n[1]&&s.terminate(),t.ondata.call(t,e,n[0],n[1]))}));s.postMessage(n),t.push=function(e,n){t.ondata||E(5),a&&t.ondata(E(4,0,1),null,!!n),s.postMessage([e,a=n],[e.buffer])},t.terminate=function(){s.terminate()}},me=function(e,t){return e[t]|e[t+1]<<8},Q=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},Yr=function(e,t){return Q(e,t)+4294967296*Q(e,t+4)},H=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},oi=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&H(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},si=function(e){(31!=e[0]||139!=e[1]||8!=e[2])&&E(6,"invalid gzip data");var t=e[3],n=10;4&t&&(n+=e[10]|2+(e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)},su=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},ui=function(e){return 10+(e.filename&&e.filename.length+1||0)},li=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},uu=function(e){(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)&&E(6,"invalid zlib data"),32&e[1]&&E(6,"invalid zlib data: preset dictionaries not supported")},qe=function(){function e(e,t){!t&&"function"==typeof e&&(t=e,e={}),this.ondata=t,this.o=e||{}}return e.prototype.p=function(e,t){this.ondata(vt(e,this.o,0,0,!t),t)},e.prototype.push=function(e,t){this.ondata||E(5),this.d&&E(4),this.d=t,this.p(e,t||!1)},e}(),lu=function(e,t){Ht([$t,function(){return[Ae,qe]}],this,ci.call(this,e,t),(function(e){var t=new qe(e.data);onmessage=Ae(t)}),6)},be=function(){function e(e){this.s={},this.p=new U(0),this.ondata=e}return e.prototype.e=function(e){this.ondata||E(5),this.d&&E(4);var t=this.p.length,n=new U(t+e.length);n.set(this.p),n.set(e,t),this.p=n},e.prototype.c=function(e){this.d=this.s.i=e||!1;var t=this.s.b,n=ga(this.p,this.o,this.s);this.ondata(ze(n,t,this.s.b),this.d),this.o=ze(n,this.s.b-32768),this.s.b=this.o.length,this.p=ze(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),di=function(e){this.ondata=e,Ht([Vt,function(){return[Ae,be]}],this,0,(function(){var e=new be;onmessage=Ae(e)}),7)},Zr=function(){function e(e,t){this.c=Ut(),this.l=0,this.v=1,qe.call(this,e,t)}return e.prototype.push=function(e,t){qe.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var n=vt(e,this.o,this.v&&ui(this.o),t&&8,!t);this.v&&(oi(n,this.o),this.v=0),t&&(H(n,n.length-8,this.c.d()),H(n,n.length-4,this.l)),this.ondata(n,t)},e}(),Mh=function(e,t){Ht([$t,nu,function(){return[Ae,qe,Zr]}],this,ci.call(this,e,t),(function(e){var t=new Zr(e.data);onmessage=Ae(t)}),8)},Gn=function(){function e(e){this.v=1,be.call(this,e)}return e.prototype.push=function(e,t){if(be.prototype.e.call(this,e),this.v){var n=this.p.length>3?si(this.p):4;if(n>=this.p.length&&!t)return;this.p=this.p.subarray(n),this.v=0}t&&(this.p.length<8&&E(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),be.prototype.c.call(this,t)},e}(),du=function(e){this.ondata=e,Ht([Vt,ru,function(){return[Ae,be,Gn]}],this,0,(function(){var e=new Gn;onmessage=Ae(e)}),9)},ei=function(){function e(e,t){this.c=ri(),this.v=1,qe.call(this,e,t)}return e.prototype.push=function(e,t){qe.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e);var n=vt(e,this.o,this.v&&2,t&&4,!t);this.v&&(li(n,this.o),this.v=0),t&&H(n,n.length-4,this.c.d()),this.ondata(n,t)},e}(),xh=function(e,t){Ht([$t,iu,function(){return[Ae,qe,ei]}],this,ci.call(this,e,t),(function(e){var t=new ei(e.data);onmessage=Ae(t)}),10)},Vn=function(){function e(e){this.v=1,be.call(this,e)}return e.prototype.push=function(e,t){if(be.prototype.e.call(this,e),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}t&&(this.p.length<4&&E(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),be.prototype.c.call(this,t)},e}(),hu=function(e){this.ondata=e,Ht([Vt,ou,function(){return[Ae,be,Vn]}],this,0,(function(){var e=new Vn;onmessage=Ae(e)}),11)},fu=function(){function e(e){this.G=Gn,this.I=be,this.Z=Vn,this.ondata=e}return e.prototype.push=function(e,t){if(this.ondata||E(5),this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var n=new U(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var r=this,i=function(){r.ondata.apply(r,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(i):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(i):new this.Z(i),this.s.push(this.p,t),this.p=null}}},e}(),jh=function(){function e(e){this.G=du,this.I=di,this.Z=hu,this.ondata=e}return e.prototype.push=function(e,t){fu.prototype.push.call(this,e,t)},e}(),hi=function(e,t,n,r){for(var i in e){var a=e[i],s=t+i,o=r;Array.isArray(a)&&(o=ya(r,a[1]),a=a[0]),a instanceof U?n[s]=[a,o]:(n[s+="/"]=[new U(0),o],hi(a,s,n,r))}},Us=typeof TextEncoder<"u"&&new TextEncoder,ai=typeof TextDecoder<"u"&&new TextDecoder,gu=0;try{ai.decode(Xe,{stream:!0}),gu=1}catch{}yu=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return[t,ze(e,n-1)];i?3==i?(r=((15&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t+=String.fromCharCode(55296|r>>10,56320|1023&r)):t+=1&i?String.fromCharCode((31&r)<<6|63&e[n++]):String.fromCharCode((15&r)<<12|(63&e[n++])<<6|63&e[n++]):t+=String.fromCharCode(r)}},Oh=function(){function e(e){this.ondata=e,gu?this.t=new TextDecoder:this.p=Xe}return e.prototype.push=function(e,t){if(this.ondata||E(5),t=!!t,this.t)return this.ondata(this.t.decode(e,{stream:!0}),t),void(t&&(this.t.decode().length&&E(8),this.t=null));this.p||E(4);var n=new U(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length);var r=yu(n),i=r[0],a=r[1];t?(a.length&&E(8),this.p=null):this.p=a,this.ondata(i,t)},e}(),zh=function(){function e(e){this.ondata=e}return e.prototype.push=function(e,t){this.ondata||E(5),this.d&&E(4),this.ondata(lt(e),this.d=t||!1)},e}(),vu=function(e){return 1==e?3:e<6?2:9==e?1:0},ku=function(e,t){return t+30+me(e,t+26)+me(e,t+28)},bu=function(e,t,n){var r=me(e,t+28),i=mi(e.subarray(t+46,t+46+r),!(2048&me(e,t+8))),a=t+46+r,s=Q(e,t+20),o=n&&4294967295==s?Mu(e,a):[s,Q(e,t+24),Q(e,t+42)],l=o[0],u=o[1],h=o[2];return[me(e,t+10),l,u,i,a+me(e,t+30)+me(e,t+32),h]},Mu=function(e,t){for(;1!=me(e,t);t+=4+me(e,t+2));return[Yr(e,t+12),Yr(e,t+4),Yr(e,t+20)]},ut=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&E(9),t+=r+4}return t},Rt=function(e,t,n,r,i,a,s,o){var l=r.length,u=n.extra,h=o&&o.length,c=ut(u);H(e,t,null!=s?33639248:67324752),t+=4,null!=s&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(null==a&&8),e[t++]=i&&8,e[t++]=255&n.compression,e[t++]=n.compression>>8;var d=new Date(null==n.mtime?Date.now():n.mtime),f=d.getFullYear()-1980;if((f<0||f>119)&&E(10),H(e,t,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),t+=4,null!=a&&(H(e,t,n.crc),H(e,t+4,a),H(e,t+8,n.size)),H(e,t+12,l),H(e,t+14,c),t+=16,null!=s&&(H(e,t,h),H(e,t+6,n.attrs),H(e,t+10,s),t+=14),e.set(r,t),t+=l,c)for(var p in u){var g=u[p],y=g.length;H(e,t,+p),H(e,t+2,y),e.set(g,t+4),t+=4+y}return h&&(e.set(o,t),t+=h),t},fi=function(e,t,n,r,i){H(e,t,101010256),H(e,t+8,n),H(e,t+10,n),H(e,t+12,r),H(e,t+16,i)},ma=function(){function e(e){this.filename=e,this.c=Ut(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){this.ondata||E(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}(),Ah=function(){function e(e,t){var n=this;t||(t={}),ma.call(this,e),this.d=new qe(t,(function(e,t){n.ondata(null,e,t)})),this.compression=8,this.flag=vu(t.level)}return e.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},e.prototype.push=function(e,t){ma.prototype.push.call(this,e,t)},e}(),Nh=function(){function e(e,t){var n=this;t||(t={}),ma.call(this,e),this.d=new lu(t,(function(e,t,r){n.ondata(e,t,r)})),this.compression=8,this.flag=vu(t.level),this.terminate=this.d.terminate}return e.prototype.process=function(e,t){this.d.push(e,t)},e.prototype.push=function(e,t){ma.prototype.push.call(this,e,t)},e}(),Eh=function(){function e(e){this.ondata=e,this.u=[],this.d=1}return e.prototype.add=function(e){var t=this;if(this.ondata||E(5),2&this.d)this.ondata(E(4+8*(1&this.d),0,1),null,!1);else{var n=lt(e.filename),r=n.length,i=e.comment,a=i&<(i),s=r!=e.filename.length||a&&i.length!=a.length,o=r+ut(e.extra)+30;r>65535&&this.ondata(E(11,0,1),null,!1);var l=new U(o);Rt(l,0,e,n,s);var u=[l],h=function(){for(var e=0,n=u;e<n.length;e++){var r=n[e];t.ondata(null,r,!1)}u=[]},c=this.d;this.d=0;var d=this.u.length,f=ya(e,{f:n,u:s,o:a,t:function(){e.terminate&&e.terminate()},r:function(){if(h(),c){var e=t.u[d+1];e?e.r():t.d=1}c=1}}),p=0;e.ondata=function(n,r,i){if(n)t.ondata(n,r,i),t.terminate();else if(p+=r.length,u.push(r),i){var a=new U(16);H(a,0,134695760),H(a,4,e.crc),H(a,8,p),H(a,12,e.size),u.push(a),f.c=p,f.b=o+p+16,f.crc=e.crc,f.size=e.size,c&&f.r(),c=1}else c&&h()},this.u.push(f)}},e.prototype.end=function(){var e=this;2&this.d?this.ondata(E(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&e.d&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3)},e.prototype.e=function(){for(var e=0,t=0,n=0,r=0,i=this.u;r<i.length;r++){n+=46+(l=i[r]).f.length+ut(l.extra)+(l.o?l.o.length:0)}for(var a=new U(n+22),s=0,o=this.u;s<o.length;s++){var l=o[s];Rt(a,e,l,l.f,l.u,l.c,t,l.o),e+=46+l.f.length+ut(l.extra)+(l.o?l.o.length:0),t+=l.b}fi(a,e,this.u.length,n,t),this.ondata(null,a,!0),this.d=2},e.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++){t[e].t()}this.d=2},e}(),wu=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),Fh=function(){function e(){var e=this;this.i=new be((function(t,n){e.ondata(null,t,n)}))}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(e){this.ondata(e,null,t)}},e.compression=8,e}(),Dh=function(){function e(e,t){var n=this;t<32e4?this.i=new be((function(e,t){n.ondata(null,e,t)})):(this.i=new di((function(e,t,r){n.ondata(e,t,r)})),this.terminate=this.i.terminate)}return e.prototype.push=function(e,t){this.i.terminate&&(e=ze(e,0)),this.i.push(e,t)},e.compression=8,e}(),Lh=function(){function e(e){this.onfile=e,this.k=[],this.o={0:wu},this.p=Xe}return e.prototype.push=function(e,t){var n=this;if(this.onfile||E(5),this.p||E(4),this.c>0){var r=Math.min(this.c,e.length),i=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),(e=e.subarray(r)).length)return this.push(e,t)}else{var a=0,s=0,o=void 0,l=void 0;this.p.length?e.length?((l=new U(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var u=l.length,h=this.c,c=h&&this.d,d=function(){var e,t=Q(l,s);if(67324752==t){a=1,o=s,f.d=null,f.c=0;var r=me(l,s+6),i=me(l,s+8),c=2048&r,d=8&r,p=me(l,s+26),g=me(l,s+28);if(u>s+30+p+g){var y=[];f.k.unshift(y),a=2;var m=Q(l,s+18),v=Q(l,s+22),_=mi(l.subarray(s+30,s+=30+p),!c);4294967295==m?(e=d?[-2]:Mu(l,s),m=e[0],v=e[1]):d&&(m=-1),s+=g,f.c=m;var w,M={name:_,compression:i,start:function(){if(M.ondata||E(5),m){var e=n.o[i];e||M.ondata(E(14,"unknown compression type "+i,1),null,!1),(w=m<0?new e(_):new e(_,m,v)).ondata=function(e,t,n){M.ondata(e,t,n)};for(var t=0,r=y;t<r.length;t++){var a=r[t];w.push(a,!1)}n.k[0]==y&&n.c?n.d=w:w.push(Xe,!0)}else M.ondata(null,Xe,!0)},terminate:function(){w&&w.terminate&&w.terminate()}};m>=0&&(M.size=m,M.originalSize=v),f.onfile(M)}return"break"}if(h){if(134695760==t)return o=s+=12+(-2==h&&8),a=3,f.c=0,"break";if(33639248==t)return o=s-=4,a=3,f.c=0,"break"}},f=this;s<u-4;++s){if("break"===d())break}if(this.p=Xe,h<0){var p=a?l.subarray(0,o-12-(-2==h&&8)-(134695760==Q(l,o-16)&&4)):l.subarray(0,s);c?c.push(p,!!a):this.k[+(2==a)].push(p)}if(2&a)return this.push(l.subarray(s),t);this.p=l.subarray(s)}t&&(this.c&&E(13),this.p=null)},e.prototype.register=function(e){this.o[e.compression]=e},e}(),Wn="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(e){e()}}));h();var Tu=Yn(xi(),1);h(),h(),h();var To=Yn(jo(),1);h();var vr=class{origin;destination;vortex;distance;angle;weight;constructor({origin:e,destination:t,vortex:n,elevationDelta:r=0,distance:i=0,angle:a=0}){let s,o;if(this.origin=e,this.destination=t,this.vortex=n,this.distance=i,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=r*o+s):(s=t.weight&&t.weight>=0?t.weight:0,o=t.multiplier&&t.multiplier>=1?t.multiplier:1,this.weight=this.distance*o+s),isNaN(this.angle))throw new Error("nan angle")}},xn=vr;h();var kr="mi-debug",mp={loggingEnabled:()=>"development"===M.env.NODE_ENV||"dev"===M.env.NODE_ENV||"test"===M.env.NODE_ENV||"true"===globalThis.sessionStorage?.getItem(kr),log(...e){this.loggingEnabled()&&console.log("[MappedInJS]",...e)},warn(...e){this.loggingEnabled()&&console.warn("[MappedInJS]",...e)},error(...e){this.loggingEnabled()&&console.error("[MappedInJS]",...e)},assert(...e){this.loggingEnabled()&&console.assert(...e)},time(e){this.loggingEnabled()&&console.time(e)},timeEnd(e){this.loggingEnabled()&&console.timeEnd(e)}},z=mp;function fp(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale||1);try{if(!e.georeference)throw new Error(`map ${e.name||e.shortName||e.id} does not have a georeference field`);if(e.georeference.length<3)throw new Error(`map ${e.name||e.shortName||e.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let t=e.georeference[0],n=e.georeference[2],r=(0,To.getDistance)({latitude:t.target.x,longitude:t.target.y},{latitude:n.target.x,longitude:n.target.y}),i=t.control.x-n.control.x,a=t.control.y-n.control.y;return Math.sqrt(i*i+a*a)/r}catch(e){return z.error(e),1}}function gp(e,t){let n=e.x-t.x,r=e.y-t.y;return(Math.atan2(r,n)+2.5*Math.PI)%(2*Math.PI)}var br=class{edges;nodesById;mapsById;constructor({nodes:e,vortexes:t,maps:n,showVortexNames:r=!1}){this.edges={},this.mapsById=n.map((e=>({...e,_scale:fp(e)}))).reduce(((e,t)=>(e[t.id]=t,e)),{});let i=e.filter((e=>!!this.mapsById[e.map])).map((e=>({...e,paths:e.paths?e.paths.filter((({map:t})=>t===e.map)):[]})));this.nodesById=i.reduce(((e,t)=>(e[t.id]=t,e)),{});for(let e in this.nodesById)this.nodesById.hasOwnProperty(e)&&(this.nodesById[e].paths=this.nodesById[e].paths.filter((({node:e})=>!!this.nodesById[e])));let a=t.map((e=>({...e,name:r?e.name:e.type,nodes:e.nodes?e.nodes.filter((e=>!!this.nodesById[e])):[]})));i.forEach((e=>{this.edges[e.id]=e.paths.map((({node:t})=>{let n=this.nodesById[t];return new xn({angle:gp(e,n),destination:n,distance:this.getDistance(e,n),origin:e})}))})),a.forEach((e=>{if(null==e.nodes||0===e.nodes.length)return;let t=0;for(;t<e.nodes.length-1;){let n=this.nodesById[e.nodes[t]];if(t++,null==n)continue;let r=t;for(;r<e.nodes.length;){let t=this.nodesById[e.nodes[r]];if(r++,null==t)continue;let i=this.mapsById[n.map].elevation||0,a=this.mapsById[t.map].elevation||0,s=Math.abs(i-a);this.edges[n.id].push(new xn({destination:t,elevationDelta:s,origin:n,vortex:e})),this.edges[t.id].push(new xn({destination:n,elevationDelta:s,origin:t,vortex:e}))}}}))}aStar(e,t,n){let r=e.map((e=>this.nodesById[e])).filter((e=>e)),i=t.map((e=>this.nodesById[e])).filter((e=>e));if(0===r.length||0===i.length)return[];let a=[],s={},o={};for(r.forEach((e=>{let t=this.getShortestEuclideanDistance(e,i);a.push({origin:e,priority:t}),s[e.id]=null,o[e.id]=0})),a.sort(((e,t)=>e.priority-t.priority));a.length>0;){let e=a[0];if(i.includes(e.origin)){let t=[],n=s[e.origin.id];for(;null!=n;){t.push(n);let e=s[n.origin.id];n=null!=e?e:null}return t.reverse()}for(let t of this.edges[e.origin.id]){let r=t.vortex&&!1===t.vortex.accessible;if(n&&(r||!1===t.origin.accessible||!1===t.destination.accessible))continue;let l=o[e.origin.id]+t.weight;if(null==o[t.destination.id]||l<o[t.destination.id]){o[t.destination.id]=l;let e=l+this.getShortestEuclideanDistance(t.destination,i);a.push({origin:t.destination,priority:e}),s[t.destination.id]=t}}a.splice(0,1),a.sort(((e,t)=>e.priority-t.priority))}return[]}getDistance(e,t){let n,r=e.x-t.x,i=e.y-t.y,a=r*r+i*i;return n=null==this.mapsById[e.map]?1:this.mapsById[e.map]._scale,Math.sqrt(a)/n}getShortestEuclideanDistance(e,t){return t.reduce(((t,n)=>{let r=this.getDistance(e,n);return Math.min(t,r)}),Number.MAX_VALUE)}},Mr=br;function yp(e){switch(e){case"down":case"up":return`${e} `;default:return""}}h(),h();var wr=class{node;instruction;action;atLocation;type;distance=0;constructor({origin:e,action:t,distance:n,atLocation:r,instruction:i}){this.node=e,this.action=t,this.distance=n||0,this.atLocation=r,this.instruction="",i?this.instruction=i:(null!=t&&"Departure"===t.type?this.instruction=null!=r?`Depart from ${r.name}`:"Depart from current location":null!=t&&"Arrival"===t.type?this.instruction=null!=r?`Arrive at ${r.name}`:"Arrive at destination":null!=t&&"TakeVortex"===t.type?this.instruction=`Take ${r&&r.name} ${yp(t.direction)}to ${t.toMap.name}`:null!=t&&"ExitVortex"===t.type?this.instruction=`Exit ${r&&r.name} at ${t.toMap.name}`:null!=t&&"Right"===t.bearing?this.instruction="Turn right":null!=t&&"SlightRight"===t.bearing?this.instruction="Turn slightly right":null!=t&&"Straight"===t.bearing?this.instruction="Head straight":null!=t&&"SlightLeft"===t.bearing?this.instruction="Turn slightly left":null!=t&&"Left"===t.bearing&&(this.instruction="Turn left"),null!=t&&"Turn"===t.type&&r&&(this.instruction+=` at ${r.name}`))}},Ze=wr,_n=.1*Math.PI;function jn(e,t){return((t-e+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var xr=class{graph;locationsByNodeId;constructor({locations:e,nodes:t,vortexes:n,maps:r,showVortexNames:i}){this.graph=new Mr({maps:r,nodes:t,showVortexNames:i,vortexes:n}),this.locationsByNodeId=e.reduce(((e,t)=>(t.nodes&&t.nodes.forEach((n=>{e[n.node]=t})),t.polygons&&t.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{e[n]=t}))})),e)),{})}getClosestLocationInRay(e,t=.5*Math.PI,n=10){let r=0,i=0,a=e;for(;Math.abs(r)<t&&i<n;){let e=this.graph.edges[a.destination.id],s=null,o=0;for(let t of e)if(t.distance>0)if(null!=s){let e=-jn(a.angle,t.angle);Math.abs(e)<Math.abs(o)&&(s=t,o=e)}else s=t,o=-jn(a.angle,t.angle);if(null==s)return null;{if(Math.abs(o)>=t||(r+=o,i+=s.distance,Math.abs(r)>=t||i>n))return null;let e=this.locationsByNodeId[s.destination.id];if(null!=e)return e;a=s}}return null}getDirections({originIds:e,destinationNodeIds:t,accessible:n,departFrom:r,arriveAt:i}){let a=this.graph.aStar(e,t,n);if(0===a.length)return{distance:0,instructions:[new Ze({distance:0,instruction:"No Valid Path Available"})],path:[]};let s=0,o=new Array(a.length+1);for(let e=0;e<a.length;e++)o[e]=a[e].origin;o[a.length]=a[a.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let e=0;e<a.length;e++){let t=a[e],n=t.origin,o=t.destination;if(s+=t.distance,c+=h?.distance||0,0===e&&l.push(new Ze({action:{type:"Departure"},atLocation:r,distance:0,origin:n})),null!=t.vortex){let e=this.graph.mapsById[n.map],r=this.graph.mapsById[o.map],i="none";if(null!=e.elevation&&null!=r.elevation){let t=e.elevation-r.elevation;t>0?i="down":t<0&&(i="up")}l.push(new Ze({action:{direction:i,fromMap:e,toMap:r,type:"TakeVortex"},atLocation:t.vortex,distance:c,origin:n})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let e=this.graph.mapsById[u.map],t=this.graph.mapsById[h.destination.map];l.push(new Ze({action:{fromMap:e,toMap:t,type:"ExitVortex"},atLocation:h.vortex,distance:c,origin:n})),d+=c,c=0}else{let e=this.graph.edges[n.id].filter((e=>e.destination!==u&&e.destination!==t.destination));if(e.length>0){let r=-jn(h.angle,t.angle),i=e.reduce(((e,n)=>{let r=-jn(t.angle,n.angle);return Math.min(e,Math.abs(r))}),Math.PI);if(Math.abs(r)>=_n||Math.abs(i)<=_n){let e;e=r<=-Math.PI/4?"Right":r<=-_n?"SlightRight":r<=_n?"Straight":r<=Math.PI/4?"SlightLeft":"Left";let t=this.locationsByNodeId[n.id];if(t||(t=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=t){let r=new Ze({action:{bearing:e,referencePosition:"At",type:"Turn"},atLocation:t,distance:c,origin:n});r.type=e,l.push(r)}else l.push(new Ze({action:{bearing:e,referencePosition:"At",type:"Turn"},distance:c,origin:n}));d+=c,c=0}}}e===a.length-1&&(l.push(new Ze({action:{type:"Arrival"},atLocation:i,distance:s-d<0?0:s-d,origin:t.destination})),d+=c,c=0),u=n,h=t}let f=[],p=null;for(let e=l.length-1;e>=0;e--){let t=l[e],{action:n}=t;n&&"TakeVortex"===n.type?(p=t.node,f.unshift(t)):n&&"Turn"===n.type&&null!=p?this.graph.getDistance(t.node,p)>5&&f.unshift(t):f.unshift(t)}return{distance:s,instructions:f,path:o}}},_r=xr;function Oo(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return zo(this.cover(t,n),t,n,e)}function zo(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a,s,o,l,u,h,c,d,f=e._root,p={data:r},g=e._x0,y=e._y0,m=e._x1,v=e._y1;if(!f)return e._root=p,e;for(;f.length;)if((u=t>=(a=(g+m)/2))?g=a:m=a,(h=n>=(s=(y+v)/2))?y=s:v=s,i=f,!(f=f[c=h<<1|u]))return i[c]=p,e;if(o=+e._x.call(null,f.data),l=+e._y.call(null,f.data),t===o&&n===l)return p.next=f,i?i[c]=p:e._root=p,e;do{i=i?i[c]=new Array(4):e._root=new Array(4),(u=t>=(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 i[d]=f,i[c]=p,e}function Ao(e){var t,n,r,i,a=e.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(r=+this._x.call(null,t=e[n]))||isNaN(i=+this._y.call(null,t))||(s[n]=r,o[n]=i,r<l&&(l=r),r>h&&(h=r),i<u&&(u=i),i>c&&(c=i));if(l>h||u>c)return this;for(this.cover(l,u).cover(h,c),n=0;n<a;++n)zo(this,s[n],o[n],e[n]);return this}function No(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var s,o,l=i-n||1,u=this._root;n>e||e>=i||r>t||t>=a;)switch(o=(t<r)<<1|e<n,s=new Array(4),s[o]=u,u=s,l*=2,o){case 0:i=n+l,a=r+l;break;case 1:n=i-l,a=r+l;break;case 2:i=n+l,r=a-l;break;case 3:n=i-l,r=a-l}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function Eo(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e}function So(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function re(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function Po(e,t,n){var r,i,a,s,o,l,u,h=this._x0,c=this._y0,d=this._x1,f=this._y1,p=[],g=this._root;for(g&&p.push(new re(g,h,c,d,f)),null==n?n=1/0:(h=e-n,c=t-n,d=e+n,f=t+n,n*=n);l=p.pop();)if(!(!(g=l.node)||(i=l.x0)>d||(a=l.y0)>f||(s=l.x1)<h||(o=l.y1)<c))if(g.length){var y=(i+s)/2,m=(a+o)/2;p.push(new re(g[3],y,m,s,o),new re(g[2],i,m,y,o),new re(g[1],y,a,s,m),new re(g[0],i,a,y,m)),(u=(t>=m)<<1|e>=y)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=l)}else{var v=e-+this._x.call(null,g.data),_=t-+this._y.call(null,g.data),w=v*v+_*_;if(w<n){var M=Math.sqrt(n=w);h=e-M,c=t-M,d=e+M,f=t+M,r=g.data}}return r}function Fo(e){if(isNaN(a=+this._x.call(null,e))||isNaN(s=+this._y.call(null,e)))return this;var t,n,r,i,a,s,o,l,u,h,c,d,f=this._root,p=this._x0,g=this._y0,y=this._x1,m=this._y1;if(!f)return this;if(f.length)for(;;){if((u=a>=(o=(p+y)/2))?p=o:y=o,(h=s>=(l=(g+m)/2))?g=l:m=l,t=f,!(f=f[c=h<<1|u]))return this;if(!f.length)break;(t[c+1&3]||t[c+2&3]||t[c+3&3])&&(n=t,d=c)}for(;f.data!==e;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):t?(i?t[c]=i:delete t[c],(f=t[0]||t[1]||t[2]||t[3])&&f===(t[3]||t[2]||t[1]||t[0])&&!f.length&&(n?n[d]=f:this._root=f),this):(this._root=i,this)}function Do(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Lo(){return this._root}function Co(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e}function Ro(e){var t,n,r,i,a,s,o=[],l=this._root;for(l&&o.push(new re(l,this._x0,this._y0,this._x1,this._y1));t=o.pop();)if(!e(l=t.node,r=t.x0,i=t.y0,a=t.x1,s=t.y1)&&l.length){var u=(r+a)/2,h=(i+s)/2;(n=l[3])&&o.push(new re(n,u,h,a,s)),(n=l[2])&&o.push(new re(n,r,h,u,s)),(n=l[1])&&o.push(new re(n,u,i,a,h)),(n=l[0])&&o.push(new re(n,r,i,u,h))}return this}function Bo(e){var t,n=[],r=[];for(this._root&&n.push(new re(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var i=t.node;if(i.length){var a,s=t.x0,o=t.y0,l=t.x1,u=t.y1,h=(s+l)/2,c=(o+u)/2;(a=i[0])&&n.push(new re(a,s,o,h,c)),(a=i[1])&&n.push(new re(a,h,o,l,c)),(a=i[2])&&n.push(new re(a,s,c,h,u)),(a=i[3])&&n.push(new re(a,h,c,l,u))}r.push(t)}for(;t=r.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this}function qo(e){return e[0]}function Go(e){return arguments.length?(this._x=e,this):this._x}function Uo(e){return e[1]}function Vo(e){return arguments.length?(this._y=e,this):this._y}function na(e,t,n){var r=new jr(t??qo,n??Uo,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function jr(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function $o(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h(),h();var he=na.prototype=jr.prototype;he.copy=function(){var e,t,n=new jr(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=$o(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=$o(t));return n},he.add=Oo,he.addAll=Ao,he.cover=No,he.data=Eo,he.extent=So,he.find=Po,he.remove=Fo,he.removeAll=Do,he.root=Lo,he.size=Co,he.visit=Ro,he.visitAfter=Bo,he.x=Go,he.y=Vo;var Le,te,pt=class{constructor(e){ee(this,Le,void 0),ye(this,"categories"),ye(this,"locations"),ye(this,"vortexes"),ye(this,"maps"),ye(this,"nodes"),ye(this,"polygons"),ye(this,"events"),ye(this,"mapGroups"),ye(this,"locationStates"),ye(this,"rankings"),ee(this,te,{}),Y(this,Le,e)}get polygonsByMapId(){if(N(this,te).polygonsByMapId)return N(this,te).polygonsByMapId;let e,t={};for(let n=0,r=N(this,Le).polygons.length;n<r;++n)e=N(this,Le).polygons[n],t[e.map.id]||(t[e.map.id]=[]),t[e.map.id].push(e);let n=Object.entries(t).reduce(((e,[t,n])=>(e.set(t,n),e)),new Map);return N(this,te).polygonsByMapId=n,N(this,te).polygonsByMapId}get nodesByMapId(){if(N(this,te).nodesByMapId)return N(this,te).nodesByMapId;let e,t={};for(let n=0,r=N(this,Le).nodes.length;n<r;++n)e=N(this,Le).nodes[n],t[e.map.id]||(t[e.map.id]=[]),t[e.map.id].push(e);let n=Object.entries(t).reduce(((e,[t,n])=>(e.set(t,n),e)),new Map);return N(this,te).nodesByMapId=n,N(this,te).nodesByMapId}findNearestNodeOnMap(e,t){if(N(this,te).nodeTreesByMap||(N(this,te).nodeTreesByMap=new Map),!N(this,te).nodeTreesByMap.has(e)){let t=this.nodesByMapId.get(e)??[],n=na();n.x((e=>e.x)),n.y((e=>e.y)),n.addAll(t),N(this,te).nodeTreesByMap.set(e,n)}return N(this,te).nodeTreesByMap.get(e).find(t.x,t.y)}get locationsByMapId(){if(N(this,te).locationsByMapId)return N(this,te).locationsByMapId;let e,t={};for(let n=0,r=N(this,Le).locations.length;n<r;++n){e=N(this,Le).locations[n];for(let n=0,r=e.polygons.length;n<r;++n)t[e.polygons[n].map.id]||(t[e.polygons[n].map.id]=[]),t[e.polygons[n].map.id].push(e)}let n=Object.entries(t).reduce(((e,[t,n])=>(e.set(t,n),e)),new Map);return N(this,te).locationsByMapId=n,N(this,te).locationsByMapId}static create(e){return pt.instances.has(e)||pt.instances.set(e,new pt(e)),pt.instances.get(e)}static clear(){pt.instances.clear()}},Tn=pt;Le=new WeakMap,te=new WeakMap,ye(Tn,"instances",new Map);var Me=Tn;h(),h(),h(),h();var Wo=" ",ce=class{static get separator(){return Wo}static set separator(e){Wo=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);let t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}static toDms(e,t="d",n){if(isNaN(e)||"string"==typeof e&&""==e.trim()||"boolean"==typeof e||e==1/0||null==e)return null;if(void 0===n)switch(t){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:t="d",n=4}e=Math.abs(e);let r=null,i=null,a=null,s=null;switch(t){default:case"d":case"deg":i=e.toFixed(n),i<100&&(i="0"+i),i<10&&(i="0"+i),r=i+"°";break;case"dm":case"deg+min":i=Math.floor(e),a=(60*e%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),i=("000"+i).slice(-3),a<10&&(a="0"+a),r=i+"°"+ce.separator+a+"′";break;case"dms":case"deg+min+sec":i=Math.floor(e),a=Math.floor(3600*e/60)%60,s=(3600*e%60).toFixed(n),60==s&&(s=(0).toFixed(n),a++),60==a&&(a=0,i++),i=("000"+i).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),r=i+"°"+ce.separator+a+"′"+ce.separator+s+"″"}return r}static toLat(e,t,n){let r=ce.toDms(ce.wrap90(e),t,n);return null===r?"–":r.slice(1)+ce.separator+(e<0?"S":"N")}static toLon(e,t,n){let r=ce.toDms(ce.wrap180(e),t,n);return null===r?"–":r+ce.separator+(e<0?"W":"E")}static toBrng(e,t,n){let r=ce.toDms(ce.wrap360(e),t,n);return null===r?"–":r.replace("360","0")}static fromLocale(e){let t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(e){let t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=ce.wrap360(e);let n=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*n/360)%n*16/n]}static wrap360(e){return 0<=e&&e<360?e:(e%360+360)%360}static wrap180(e){return-180<e&&e<=180?e:(e+540)%360-180}static wrap90(e){return-90<=e&&e<=90?e:Math.abs((e%360+270)%360-180)-90}};Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var G=ce,J=Math.PI,A=class{constructor(e,t){if(isNaN(e))throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t))throw new TypeError(`invalid lon ‘${t}’`);this._lat=G.wrap90(Number(e)),this._lon=G.wrap180(Number(t))}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?G.wrap90(G.parse(e)):G.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?G.wrap90(G.parse(e)):G.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?G.wrap180(G.parse(e)):G.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?G.wrap180(G.parse(e)):G.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?G.wrap180(G.parse(e)):G.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");if(null===e[0]||null===e[1])throw new TypeError("invalid (null) point");let t,n;if(2==e.length&&([t,n]=e,t=G.wrap90(G.parse(t)),n=G.wrap180(G.parse(n)),isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e.toString()}’`);if(1==e.length&&"string"==typeof e[0]&&([t,n]=e[0].split(","),t=G.wrap90(G.parse(t)),n=G.wrap180(G.parse(n)),isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e[0]}’`);if(1==e.length&&"object"==typeof e[0]){let r=e[0];if("Point"==r.type&&Array.isArray(r.coordinates)?[n,t]=r.coordinates:(null!=r.latitude&&(t=r.latitude),null!=r.lat&&(t=r.lat),null!=r.longitude&&(n=r.longitude),null!=r.lng&&(n=r.lng),null!=r.lon&&(n=r.lon),t=G.wrap90(G.parse(t)),n=G.wrap180(G.parse(n))),isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if(isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${e.toString()}’`);return new A(t,n)}distanceTo(e,t=6371e3){if(e instanceof A||(e=A.parse(e)),isNaN(t))throw new TypeError(`invalid radius ‘${t}’`);let n=t,r=this.lat.toRadians(),i=this.lon.toRadians(),a=e.lat.toRadians(),s=a-r,o=e.lon.toRadians()-i,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(r)*Math.cos(a)*Math.sin(o/2)*Math.sin(o/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(e){if(e instanceof A||(e=A.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),n=e.lat.toRadians(),r=(e.lon-this.lon).toRadians(),i=Math.cos(t)*Math.sin(n)-Math.sin(t)*Math.cos(n)*Math.cos(r),a=Math.sin(r)*Math.cos(n),s=Math.atan2(a,i).toDegrees();return G.wrap360(s)}finalBearingTo(e){e instanceof A||(e=A.parse(e));let t=e.initialBearingTo(this)+180;return G.wrap360(t)}midpointTo(e){e instanceof A||(e=A.parse(e));let t=this.lat.toRadians(),n=this.lon.toRadians(),r=e.lat.toRadians(),i=(e.lon-this.lon).toRadians(),a=Math.cos(t),s=0,o=Math.sin(t),l={x:a+Math.cos(r)*Math.cos(i),y:s+Math.cos(r)*Math.sin(i),z:o+Math.sin(r)},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 A(c,d)}intermediatePointTo(e,t){if(e instanceof A||(e=A.parse(e)),this.equals(e))return new A(this.lat,this.lon);let n=this.lat.toRadians(),r=this.lon.toRadians(),i=e.lat.toRadians(),a=e.lon.toRadians(),s=i-n,o=a-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-t)*u)/Math.sin(u),c=Math.sin(t*u)/Math.sin(u),d=h*Math.cos(n)*Math.cos(r)+c*Math.cos(i)*Math.cos(a),f=h*Math.cos(n)*Math.sin(r)+c*Math.cos(i)*Math.sin(a),p=h*Math.sin(n)+c*Math.sin(i),g=Math.atan2(p,Math.sqrt(d*d+f*f)),y=Math.atan2(f,d),m=g.toDegrees(),v=y.toDegrees();return new A(m,v)}destinationPoint(e,t,n=6371e3){let r=e/n,i=Number(t).toRadians(),a=this.lat.toRadians(),s=this.lon.toRadians(),o=Math.sin(a)*Math.cos(r)+Math.cos(a)*Math.sin(r)*Math.cos(i),l=Math.asin(o),u=Math.sin(i)*Math.sin(r)*Math.cos(a),h=Math.cos(r)-Math.sin(a)*o,c=s+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new A(d,f)}static intersection(e,t,n,r){if(e instanceof A||(e=A.parse(e)),n instanceof A||(n=A.parse(n)),isNaN(t))throw new TypeError(`invalid brng1 ‘${t}’`);if(isNaN(r))throw new TypeError(`invalid brng2 ‘${r}’`);let i=e.lat.toRadians(),a=e.lon.toRadians(),s=n.lat.toRadians(),o=n.lon.toRadians(),l=Number(t).toRadians(),u=Number(r).toRadians(),h=s-i,c=o-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(i)*Math.cos(s)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new A(e.lat,e.lon);let f=(Math.sin(s)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),p=(Math.sin(i)-Math.sin(s)*Math.cos(d))/(Math.sin(d)*Math.cos(s)),g=Math.acos(Math.min(Math.max(f,-1),1)),y=Math.acos(Math.min(Math.max(p,-1),1)),m=l-(Math.sin(o-a)>0?g:2*J-g),v=(Math.sin(o-a)>0?2*J-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(i)*Math.cos(w)+Math.cos(i)*Math.sin(w)*Math.cos(l),-1),1)),b=a+Math.atan2(Math.sin(l)*Math.sin(w)*Math.cos(i),Math.cos(w)-Math.sin(i)*Math.sin(M)),x=M.toDegrees(),O=b.toDegrees();return new A(x,O)}crossTrackDistanceTo(e,t,n=6371e3){e instanceof A||(e=A.parse(e)),t instanceof A||(t=A.parse(t));let r=n;if(this.equals(e))return 0;let i=e.distanceTo(this,r)/r,a=e.initialBearingTo(this).toRadians(),s=e.initialBearingTo(t).toRadians();return Math.asin(Math.sin(i)*Math.sin(a-s))*r}alongTrackDistanceTo(e,t,n=6371e3){e instanceof A||(e=A.parse(e)),t instanceof A||(t=A.parse(t));let r=n;if(this.equals(e))return 0;let i=e.distanceTo(this,r)/r,a=e.initialBearingTo(this).toRadians(),s=e.initialBearingTo(t).toRadians(),o=Math.asin(Math.sin(i)*Math.sin(a-s));return Math.acos(Math.cos(i)/Math.abs(Math.cos(o)))*Math.sign(Math.cos(s-a))*r}maxLatitude(e){let t=Number(e).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(t)*Math.cos(n))).toDegrees()}static crossingParallels(e,t,n){if(e.equals(t))return null;let r=Number(n).toRadians(),i=e.lat.toRadians(),a=e.lon.toRadians(),s=t.lat.toRadians(),o=t.lon.toRadians()-a,l=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.sin(o),u=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.cos(o)-Math.cos(i)*Math.sin(s)*Math.cos(r),h=Math.cos(i)*Math.cos(s)*Math.sin(r)*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)),f=a+c+d,p=(a+c-d).toDegrees(),g=f.toDegrees();return{lon1:G.wrap180(p),lon2:G.wrap180(g)}}rhumbDistanceTo(e,t=6371e3){e instanceof A||(e=A.parse(e));let n=t,r=this.lat.toRadians(),i=e.lat.toRadians(),a=i-r,s=Math.abs(e.lon-this.lon).toRadians();Math.abs(s)>J&&(s=s>0?-(2*J-s):2*J+s);let o=Math.log(Math.tan(i/2+J/4)/Math.tan(r/2+J/4)),l=Math.abs(o)>1e-11?a/o:Math.cos(r);return Math.sqrt(a*a+l*l*s*s)*n}rhumbBearingTo(e){if(e instanceof A||(e=A.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),n=e.lat.toRadians(),r=(e.lon-this.lon).toRadians();Math.abs(r)>J&&(r=r>0?-(2*J-r):2*J+r);let i=Math.log(Math.tan(n/2+J/4)/Math.tan(t/2+J/4)),a=Math.atan2(r,i).toDegrees();return G.wrap360(a)}rhumbDestinationPoint(e,t,n=6371e3){let r=this.lat.toRadians(),i=this.lon.toRadians(),a=Number(t).toRadians(),s=e/n,o=s*Math.cos(a),l=r+o;Math.abs(l)>J/2&&(l=l>0?J-l:-J-l);let u=Math.log(Math.tan(l/2+J/4)/Math.tan(r/2+J/4)),h=Math.abs(u)>1e-11?o/u:Math.cos(r),c=i+s*Math.sin(a)/h,d=l.toDegrees(),f=c.toDegrees();return new A(d,f)}rhumbMidpointTo(e){e instanceof A||(e=A.parse(e));let t=this.lat.toRadians(),n=this.lon.toRadians(),r=e.lat.toRadians(),i=e.lon.toRadians();Math.abs(i-n)>J&&(n+=2*J);let a=(t+r)/2,s=Math.tan(J/4+t/2),o=Math.tan(J/4+r/2),l=Math.tan(J/4+a/2),u=((i-n)*Math.log(l)+n*Math.log(o)-i*Math.log(s))/Math.log(o/s);isFinite(u)||(u=(n+i)/2);let h=a.toDegrees(),c=u.toDegrees();return new A(h,c)}static areaOf(e,t=6371e3){let n=t,r=e[0].equals(e[e.length-1]);r||e.push(e[0]);let i=e.length-1,a=0;for(let t=0;t<i;t++){let n=e[t].lat.toRadians(),r=e[t+1].lat.toRadians(),i=(e[t+1].lon-e[t].lon).toRadians();a+=2*Math.atan2(Math.tan(i/2)*(Math.tan(n/2)+Math.tan(r/2)),1+Math.tan(n/2)*Math.tan(r/2))}(function(e){let t=0,n=e[0].initialBearingTo(e[1]);for(let r=0;r<e.length-1;r++){let i=e[r].initialBearingTo(e[r+1]),a=e[r].finalBearingTo(e[r+1]);t+=(i-n+540)%360-180,t+=(a-i+540)%360-180,n=a}let r=e[0].initialBearingTo(e[1]);return t+=(r-n+540)%360-180,Math.abs(t)<90})(e)&&(a=Math.abs(a)-2*J);let s=Math.abs(a*n*n);return r||e.pop(),s}equals(e){return e instanceof A||(e=A.parse(e)),!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(e="d",t){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);if("n"==e)return null==t&&(t=4),`${this.lat.toFixed(t)},${this.lon.toFixed(t)}`;return`${G.toLat(this.lat,e,t)}, ${G.toLon(this.lon,e,t)}`}};h(),h(),h();var ra=class{destinations=[];constructor(e){this.destinations=e}};h();var wt=class{#e;#t;distance=0;path=[];instructions=[];constructor(e,t){this.#t=e,this.#e=t,this.distance=t.distance,this.instructions=t.instructions.map((e=>{let t={...e,action:{...e.action},atLocation:e.atLocation?.id?this.#t?._vortexesById?.[e.atLocation.id]:void 0,node:e.node?.id?this.#t?._nodesById?.[e.node.id]:void 0};return("TakeVortex"===t.action?.type||"ExitVortex"===t.action?.type)&&(t.action.fromMap=this.#t._mapsById?.[t.action?.fromMap.id],t.action.toMap=this.#t._mapsById?.[t.action?.toMap.id]),t})),this.path=t.path.map((e=>this.#t?._nodesById?.[e.id]))}toJSON(){return this.#e}},Ue=class{#e;constructor(e){this.#e=e}directionsTo(e,t){if(e instanceof ra){let n=[],r=this;for(let i=0;i<e.destinations.length;i++){let a=e.destinations[i],s=ia(r),o=ia(a),l=this.#e.navigator.getDirections({originIds:s,destinationNodeIds:o,accessible:t?.accessible||!1}),u=new wt(this.#e,l);n.push(u),r=a}return n}{let n=ia(this),r=ia(e),i=this.#e.navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:t?.accessible||!1});return new wt(this.#e,i)}}distanceTo(e,t){return this.directionsTo(e,t)?.distance||0}},kp=0,bp="9999-12-31T00:00:00.000Z";function Mp(e,t,n=new Date){if(!e.states)return;let r=n||new Date,i=e.states.find((e=>{let t=new Date(e.start||kp),n=new Date(e.end||bp);return t<r&&n>r}));return i?t.find((e=>e.value===i.type)):void 0}var we=class extends Ue{#e;#t;#n={};states;id="";name="";type="";description;sortOrder;logo;phone;social;color;shortName;detailsUrl;tags;externalId;showLabelWhenImagePresent;picture;operationHours;siblingGroups;gallery;constructor(e,t){super(e),this.#e=e,this.#t=t;let n=Object.assign({},t);delete n.categories,Object.assign(this,n)}#r;get polygons(){let e=this.#n.polygons;if(typeof e<"u")return e;let t=[],n=this.#r,r=this.#e._polygonsById;if(Array.isArray(n))for(let e=0,i=n.length;e<i;++e){let i=r[n[e].id];null!=i&&i.geometry.visible&&t.push(i)}return this.#n.polygons=t,t}set polygons(e){this.#r=e}#i=[];get nodes(){let e=this.#n.nodes;if(typeof e<"u")return e;let t=[],n=this.#i,r=this.#e._nodesById;if(n)for(let e=0,i=n.length;e<i;++e){let i=r[n[e].node];null!=i&&t.push(i)}return this.#n.nodes=t,t}set nodes(e){this.#i=e}#a;get parent(){let e=this.#n.parent;if(typeof e<"u")return e;let t,n=this.#e._locationsById,r=this.#a;return void 0!==r&&(t=n[r]),this.#n.parent=t,t}set parent(e){this.#a=e}get categories(){let e=this.#n.categories;if(typeof e<"u")return e;let t=[];return this.#t.categories.forEach((e=>{let n=this.#e.getCollectionItemById("categories",e);n&&t.push(n)})),this.#n.categories=t,t}get state(){return Mp(this,this.#e.locationStates)}clone(){return new we(this.#e,this.#t)}get nodeOperationHours(){let e=this.#n.nodeOperationHours;if(typeof e<"u")return e;if(null==this.nodes)return{};let t=this.#t.nodes.reduce(((e,t)=>(null!=t.operationHours&&(e[t.node]=t.operationHours),e)),{});return this.#n.nodeOperationHours=t,t}static hydrate(e,t){return e.map((e=>new we(t,e)))}static async fetch(e){let t=e.options.things.locations.slice();e.options.things.categories&&K(t,"categories"),e.options.things.nodes&&K(t,"nodes"),e.options.things.polygons&&K(t,"polygons"),e.options.things.locationStates&&K(t,"states");let n={fields:t,venue:e.options.venue};try{let t=await Z(e.options,"location",n);return e.options.includeHidden||(t=t.filter((e=>!e.hidden))),t.map((t=>new we(e,t)))}catch(e){return z.error("Fetch Locations:",e),[]}}toJSON(){let e=this.#t;return delete e.color,e}};h();var Ce=class extends Ue{#e;#t;#n={};geometry;perspectives;image;holes;textures;material;label;id="";layer;layerId;name;externalId;vertexes;canvasBounds;constructor(e,t){super(e),this.#e=e,this.#t=t;let n=Object.assign({},t);delete n.map,Object.assign(this,n)}get map(){let e=this.#n.map;if(typeof e<"u")return e;let t=this.#e.getCollectionItemById("maps",this.#t.map);return this.#n.map=t,t}get locations(){let e=this.#n.locations;if(typeof e<"u")return e;let t=[],n=Me.instances.get(this.#e)?.locationsByMapId.get(this.map.id)??[],{id:r}=this;for(let e=0,i=n.length;e<i;++e){let i=n[e],a=i.polygons;if(Array.isArray(a))for(let e=0,n=a.length;e<n;++e)if(a[e].id===r){t.push(i);break}}return this.#n.locations=t,t}#r;get entrances(){let e=this.#n.entrances;if(typeof e<"u")return e;let t=[],n=this.#r,r=this.#e._nodesById;if(Array.isArray(n)){for(let e=0,i=n.length;e<i;++e){let i=r[n[e].id];null!=i&&t.push(i)}return this.#n.entrances=t,t}return[]}set entrances(e){this.#r=e}get rank(){let e=this.#n.rank;if(typeof e<"u")return e;let{rankings:t}=this.#e;if(!t||!t.polygons)return null;let n=t.polygons.find((e=>e.polygonId===this.id));return n?(this.#n.rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(this.#n.rank=null,null)}static hydrate(e,t){return e.map((e=>new Ce(t,e)))}static async fetch(e){let t=e.options.things.polygons.slice();e.options.things.maps&&K(t,"map"),e.options.things.nodes&&K(t,"entrances");let n={fields:t,venue:e.options.venue};try{return(await Z(e.options,"polygon",n)).filter((e=>e.geometry.visible)).map((t=>new Ce(e,t)))}catch(e){return z.error("Fetch Polygons:",e),[]}}toJSON(){return this.#t}};function Yo(e){return/^[\da-f]{24}$/i.test(e)}function Ho(e,t=!1){let n="";if(null!=e){let r="?",i=t?Object.keys(e).filter((e=>!["slug","venue"].includes(e))):Object.keys(e);for(let t=0,a=i.length;t<a;++t){let a=i[t],s=e[a];null!=s&&(n+=`${r+encodeURIComponent(a)}=${encodeURIComponent(s)}`,r="&")}}return n}function wp(e,t,n,r=!1){return r?`${e.supplementaryUrl}${t}?venue=${n.venue||n.slug}`:e.baseUrl?.includes("gateway")?`${e.baseUrl}${t}/${n.venue||n.slug}${Ho(n,e.baseUrl?.includes("gateway"))}`:e.baseUrl+t+Ho(n)}async function Z(e,t,n,r=!1){return Tr(e,t,n,r,!0)}async function Tr(e,t,n,r=!1,i=!1){let a=wp(e,t,n,r),s=await In(e,a,r);if(!i&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}async function In(e,t,n=!1){let r={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};n&&delete r.language,r.language&&(t+=`&lang=${encodeURIComponent(r.language)}`);let{headers:i}=e;i["Content-Type"]="text/json",e.authorization&&(i.Authorization=e.authorization),r.language&&(i["Accept-Language"]=r.language);let a={method:"GET",headers:i},s=await Qe()(t,a);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()}function K(e,t){e.indexOf(t)<0&&e.push(t)}function Xo([e,t],[n,r]){let i=new A(e,t),a=new A(n,r);return i.distanceTo(a)}function Jo(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale);let t;try{let n=e.georeference[0],r=e.georeference[2],i=new A(n.target.x,n.target.y),a=new A(r.target.x,r.target.y),s=i.distanceTo(a),o=n.control.x-r.control.x,l=n.control.y-r.control.y;t=Math.sqrt(o*o+l*l)/s}catch(n){t=1,z.warn(n),z.warn(`Couldn't georeference ${e.name||e.shortName||e.id}. Probably not enough geocoordinates.`)}return t}function ia(e){return e instanceof Ce?e.entrances.map((e=>e.id)):e instanceof we?e.nodes?.map((e=>e.id))||[]:[e.id]}async function Ko(e){let t={},{maps:n,images:r,scenes:i,polygons:a}=e;if(null!=r)try{let e=Object.keys(r).map((e=>fetch(`data:image/png;base64,${r[e]}`).then((e=>e.blob())).then((n=>{t[e]=n})).catch((e=>{z.error(e)}))));await Promise.all(e)}catch(e){z.error(e)}return n.forEach((e=>{(e.scene?.polygons||i[e.id])&&(null!=i&&i[e.id]&&(e.scene||(e.scene={}),Object.defineProperty(e.scene,"polygons",{get:()=>i[e.id]})),null!=r&&(e.scene.images=e.scene.images.map((({filename:e})=>({filename:e,url:t[e]}))),e.scene.polygons.forEach((e=>{if(e?.image?.url&&e?.image?.url){let n=e.image.url.split("/"),r=t[n[n.length-1]];r&&(e.image.url=r)}}))))})),null!=r&&a.forEach((e=>{if(e?.image?.url){let n=e.image.url.split("/"),r=t[n[n.length-1]];r&&(e.image.url=r)}})),null!=e.images&&delete e.images,null!=e.scenes&&delete e.scenes,e}function Ir(e,t,n){let r;return function(){let i=this,a=arguments,s=function(){r=null,n||e.apply(i,a)},o=n&&!r;clearTimeout(r),r=setTimeout(s,t),o&&e.apply(i,a)}}var Re=class{#e;#t={};#n;name;externalId;parents;id;icon;constructor(e,t){this.id=t.id,this.#n=t,this.#e=e,Object.assign(this,t)}get locations(){let e=this.#t.locations;if(typeof e<"u")return e;let t=[],{locations:n}=this.#e,{id:r}=this;for(let e=0,i=n.length;e<i;++e){let i=n[e],a=i.categories;if(Array.isArray(a))for(let e=0,n=a.length;e<n;++e)if(a[e]?.id===r){t.push(i);break}}return this.#t.locations=t,t}static hydrate(e,t){return e.map((e=>new Re(t,e)))}static async fetch(e){let t={fields:e.options.things.categories,venue:e.options.venue};try{return(await Z(e.options,"category",t)).map((t=>new Re(e,t)))}catch(e){return z.error("Fetch Categories:",e),[]}}toJSON(){return this.#n}};h();var et=class{#e;#t;#n={};id="";type="";name="";description;image;startDate;endDate;showDate;constructor(e,t){this.#t=t,this.#e=e,Object.assign(this,t)}location(){let e=this.#n.location;if(typeof e<"u")return e;let t,n=this.#e._locationsById,r=this.#t.location;if(null!=r){let e=n[r];null!=e&&(t=e)}return this.#n.location=t,t}static hydrate(e,t){return e.map((e=>new et(t,e)))}static async fetch(e){let t=e.options.things.events.slice();e.options.things.locations&&K(t,"location");let n={fields:t,venue:e.options.venue,activeAtOrAfter:Date.now()};try{return(await Z(e.options,"event",n)).map((t=>new et(e,t)))}catch(e){return z.error("Fetch Events:",e),[]}}toJSON(){return this.#t}};h();var ht=class{#e;constructor(e){this.#e=e,Object.assign(this,e)}static hydrate(e){return e.map((e=>new ht(e)))}id="";name="";value="";static async fetch(e){let t={fields:e.options.things.locationStates.slice(),venue:e.options.venue};try{return(await Z(e.options,"location-state",t)).map((e=>new ht(e)))}catch(e){return z.error("Fetch Location States:",e),[]}}toJSON(){return this.#e}};h(),h();var xt=class{map;get x(){return this.#t("x")}get y(){return this.#t("y")}get lat(){return this.#e("lat")}get lon(){return this.#e("lon")}#e(e){if(this.#s&&this.#o)return"lat"===e?this.#s:this.#o;if(null!=this.#l&&null!=this.#u){let[t,n]=this.#a(this.#l,this.#u);return this.#s=t,this.#o=n,"lat"===e?this.#s:this.#o}throw Error("MappedinCoordinate is missing x and y")}#t(e){if(this.#l&&this.#u)return"x"===e?this.#l:this.#u;if(null!=this.#s&&null!=this.#o){let[t,n]=this.#i(this.#s,this.#o);return this.#l=t,this.#u=n,"x"===e?this.#l:this.#u}throw Error("MappedinCoordinate is missing lat and lon")}#n={};#r;#i(e,t){let n=this.map.georeference[0],r=new A(n.target.x,n.target.y),i=new A(e,t),a=r.distanceTo(i),s=(r.finalBearingTo(i)+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]}#a(e,t){let n,r=this.map.georeference[0],i=new A(r.target.x,r.target.y),a=e-r.control.x,s=r.control.y-t,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=i.destinationPoint(u,180*l/Math.PI);return[h.lat,h.lon]}constructor(e){let{map:t,mappedin:n}=e;null!=e.lat&&null!=e.lon&&(this.#s=e.lat,this.#o=e.lon),null!=e.x&&null!=e.y&&(this.#l=e.x,this.#u=e.y),this.map=t,this.#r=n}#s;#o;#l;#u;absoluteDistanceTo(e){return Xo([e.lat,e.lon],[this.lat,this.lon])}get nearestNode(){let e=this.#n.nearestNode;if(typeof e<"u")return e;let t=Me.instances.get(this.#r).findNearestNodeOnMap(this.map.id,this);return this.#n.nearestNode=t,t}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}},tt=class{#e;#t={};#n;id="";group="";name="";shortName="";elevation=0;scale=0;layers;x_scale;perspectiveId;scene;width=0;height=0;georeference=[];constructor(e,t){this.#e=e,this.#n=t,Object.assign(this,t),this._scale=Jo(this),this.scale=this.x_scale||1/this._scale}_scale=0;get polygons(){return Me.instances.get(this.#e)?.polygonsByMapId?.get(this.id)??[]}get locations(){return Me.instances.get(this.#e)?.locationsByMapId?.get(this.id)??[]}get nodes(){return Me.instances.get(this.#e)?.nodesByMapId?.get(this.id)??[]}get mapGroup(){let e=this.#t.mapGroup;if(typeof e<"u")return e;let t=this.group,n=t&&this.#e._mapGroupsById[t]||null;return this.#t.mapGroup=n,n}createCoordinateByXY(e,t){return new xt({x:e,y:t,map:this,mappedin:this.#e})}createCoordinate(e,t){return new xt({lat:e,lon:t,map:this,mappedin:this.#e})}getNorth(){let e;try{let t=this.georeference[0],n=this.georeference[2],r=new A(t.target.x,t.target.y),i=new A(n.target.x,n.target.y);e=-((r.finalBearingTo(i)+0)*Math.PI/180-Math.atan2(n.control.y-t.control.y,n.control.x-t.control.x)-Math.PI/2)}catch(t){e=0,z.warn(t),z.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return e}static hydrate(e,t){return e.map((e=>new tt(t,e)))}static async fetch(e){let t=e.options.things.maps.slice();e.options.perspective&&K(t,"perspectives"),e.options.things.mapGroups&&K(t,"group"),K(t,"elevation"),K(t,"x_scale"),K(t,"scale"),K(t,"georeference");let n={fields:t,perspective:e.options.perspective,venue:e.options.venue};try{let i=await Z(e.options,"map",n),a=e=>{let t=r.layers.find((t=>t.id===e));t?t.visible=!0:r.layers.push({id:e,visible:!0})};for(let n=0,s=i.length;n<s;++n){var r=i[n];if(r){let e=r.perspective;null!=e&&(r.perspectiveId=e.id,t.indexOf("scene")>-1&&(r.scene=e.scene),e.layers?(r.layers.forEach((e=>{e.visible=!1})),e.layers.forEach(a)):r.layers.forEach((e=>{e.visible=!0}))),delete r.perspective}i[n]=new tt(e,r)}return i}catch(e){return z.error("Fetch Maps:",e),[]}}toJSON(){return this.#n}};h();var at=class{#e;#t;#n={};id="";name="";constructor(e,t){this.#t=t,this.#e=e,Object.assign(this,t)}get maps(){let e=this.#n.maps;if(typeof e<"u")return e;let t=[],{maps:n}=this.#e,{id:r}=this.#t;for(let e=0,i=n.length;e<i;++e){let i=n[e];i.group===r&&t.push(i)}return this.#n.maps=t,t}static hydrate(e,t){return e.map((e=>new at(t,e)))}static async fetch(e){let t={fields:e.options.things.mapGroups.slice(),venue:e.options.venue};try{return(await Z(e.options,"map-group",t)).map((t=>new at(e,t)))}catch(e){return z.error("Fetch Map Groups:",e),[]}}toJSON(){return this.#t}};h();var nt=class extends Ue{#e;#t;#n={};id="";x=0;y=0;operationHours;externalId;constructor(e,t){super(e),this.#e=e,this.#t=t;let n=Object.assign({},t);delete n.map,Object.assign(this,n)}get map(){let e=this.#n.map;if(typeof e<"u")return e;let t=this.#e.getCollectionItemById("maps",this.#t.map);return this.#n.map=t,t}get lat(){let e=this.#n.cachedLatLon;if(null!=e)return e.lat;let t=this.#e._mapsById?.[this.map.id];if(null==t)throw new Error("Map not found");return this.#n.cachedLatLon=t.createCoordinateByXY(this.x,this.y),this.#n.cachedLatLon.lat}get lon(){let e=this.#n.cachedLatLon;if(null!=e)return e.lon;let t=this.#e._mapsById?.[this.map.id];if(null==t)throw new Error("Map not found");return this.#n.cachedLatLon=t.createCoordinateByXY(this.x,this.y),this.#n.cachedLatLon.lon}#r;get paths(){let e=this.#n.paths;if(typeof e<"u")return e;let t=[],n=this.#e._nodesById,r=this.#r;if(Array.isArray(r))for(let e=0,i=r.length;e<i;++e){let i=n[r[e].node];null!=i&&t.push(i)}return this.#n.paths=t,t}set paths(e){this.#r=e}get locations(){let e=this.#n.locations;if(typeof e<"u")return e;let t=[],n=Me.instances.get(this.#e)?.locationsByMapId?.get(this.map.id)??[],r=this.id;for(let e=0,i=n.length;e<i;++e){let i=n[e],a=i.nodes;if(Array.isArray(a))for(let e=0,n=a.length;e<n;++e)if(a[e].id===r){t.push(i);break}}return this.#n.locations=t,t}get polygon(){let e=this.#n.polygon;if(typeof e<"u")return e;let t,n=Me.instances.get(this.#e)?.polygonsByMapId?.get(this.map.id)??[],r=this.id;for(let e=0,i=n.length;e<i;++e){let i=n[e];i.entrances.map((e=>e.id)).includes(r)&&(t=i)}return this.#n.polygon=t,t}static hydrate(e,t){return e.map((e=>new nt(t,e)))}static async fetch(e){let t=e.options.things.nodes.slice();e.options.things.maps&&K(t,"map"),["weight","multiplier","accessible"].forEach((function(e){K(t,e)}));let n={fields:t,venue:e.options.venue};try{return(await Z(e.options,"node",n)).map((t=>new nt(e,t)))}catch(e){return z.error("Fetch Nodes:",e),[]}}toJSON(){return this.#t}};h();var rt=class{#e;constructor(e){this.#e=e,Object.assign(this,e)}polygons=[];static hydrate(e){return new rt(e)}static async fetch(e){try{let t=await Tr(e.options,"smart-labels/polygon-label-ranking",{venue:e.options.venue},!0);return new rt(t)}catch(e){return z.error("Fetch Rankings:",e),null}}toJSON(){return this.#e}};h();var mt=class{id="";#e;constructor(e){this.#e=e,Object.assign(this,e)}static hydrate(e){return e.map((e=>new mt(e)))}static async fetch(e){let t={fields:e.options.things.themes.slice(),venue:e.options.venue};try{return(await Z(e.options,"apollo-theme",t)).map((e=>new mt(e)))}catch(e){return z.error("Fetch Theme:",e),[]}}toJSON(){return this.#e}};h();var it=class{#e;#t;#n={};defaultMap="";address="";city="";countrycode="";externalId="";id="";latitude;logo;longitude;metadata;name="";operationHours;postal="";slug="";state="";telephone="";tzid="";tzidOverride="";utcOffset="";website="";constructor(e,t){this.#t=e,this.#e=t,Object.assign(this,t)}static hydrate(e,t){return new it(t,e)}static async fetch(e){let t={fields:e.options.things.venue,slug:e.options.venue,limit:1};try{let n=await Z(e.options,"venue",t);return new it(e,n[0])}catch(e){return z.error("Fetch Venue:",e),{}}}get isMultiBuilding(){if(null==this.#n.isMultiBuilding){let e=this.#t.maps,t=e.reduce(((e,t)=>e.add(t.elevation)),new Set),n=e.length!==t.size;this.#n.isMultiBuilding=n}return this.#n.isMultiBuilding}toJSON(){return this.#e}};h();var ot=class{id="";#e;name;type;weight;multiplier;constructor(e){this.#e=e,Object.assign(this,e)}static hydrate(e){return e.map((e=>new ot(e)))}static async fetch(e){let t=e.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(e){K(t,e)}));let n={fields:t,venue:e.options.venue};try{return(await Z(e.options,"vortex",n)).map((e=>new ot(e)))}catch(e){return z.error("Fetch Vortexes:",e),[]}}toJSON(){return this.#e}};function xp(e,t){let n=[];return e.features.forEach((e=>{let r=[];e.properties.spaces?.forEach((e=>{if("id"in e){let n;n=t.get(e.id),n&&r.push(...n)}else r?.push({id:e.node,level:""})}));let i=r.map((e=>({node:"n_"+e.id,map:e.level}))),a=e.properties.spaces?.filter((e=>"id"in e)),s=(e.properties.hours||[]).map((e=>({...e,"@type":"OpeningHoursSpecification",dayOfWeek:[e.dayOfWeek.replace("http://schema.org/","")]}))),o={...e.properties,polygons:a||[],nodes:i||[],description:e.properties.description||"",logo:e.properties.logo||{},picture:e.properties.picture||{},phone:e.properties.phone||{},social:e.properties.social||{},externalId:e.properties.externalId||"",states:e.properties.states||[],siblingGroups:e.properties.siblingGroups||[],operationHours:s};delete o.spaces,n.push(o)})),n}function _p(e){let t=new Set;return e.features.forEach((e=>{e.properties.states?.forEach((e=>{t.add(e.type)}))})),Array.from(t).map((e=>({id:e,name:e,value:e})))}function jp(e){let t=[];return e.features.forEach((e=>{let n={...e.properties,icon:e.properties.picture};delete n.picture,t.push(n)})),t}function Tp(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;return e.features.forEach((e=>{let a;a="MultiPolygon"===e.geometry.type?e.geometry.coordinates[0].flat():e.geometry.coordinates[0],a.forEach((e=>{t=Math.min(t,e[1]),r=Math.max(r,e[1]),n=Math.min(n,e[0]),i=Math.max(i,e[0])}))})),{id:e.features[0].properties.id,minLat:t,minLong:n,maxLat:r,maxLong:i}}function Ip(e,t,n){let r=n.createGeoreferences(),i=[];return e.features.forEach((e=>{let a=new Set;t.forEach((e=>{e.layer&&a.add(e.layer)}));let s=[...a].map((e=>({id:e,visible:!0}))),o=1/n.mapScale,l={...e.properties,georeference:r,shortName:e.properties.abbreviation||"",scene:{polygons:t},scale:o,x_scale:o,group:e.properties.building,layers:s,width:n.widthInMapUnits,height:n.heightInMapUnits};i.push(l)})),i}h();var Or=class{mapExtent;stretchRatio;midLat;midLong;mapUnitRatio=1e6;latDistance;longDistance;mapScale;widthInMapUnits;heightInMapUnits;constructor(e){this.mapExtent=e;let{minLat:t,minLong:n,maxLat:r,maxLong:i}=e,a=(t+r)/2,s=(n+i)/2,o=new A(a,i),l=new A(a,n),u=new A(t,s),h=new A(r,s);this.latDistance=u.distanceTo(h),this.longDistance=o.distanceTo(l);let c=this.latDistance/this.longDistance,d=(r-t)/(i-n);this.stretchRatio=c/d,this.midLat=a,this.midLong=s,this.widthInMapUnits=(i-n)*this.mapUnitRatio,this.heightInMapUnits=(r-t)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(e){let t=e[1];return{x:(e[0]-this.midLong)*this.mapUnitRatio,y:(this.midLat-t)*this.mapUnitRatio*this.stretchRatio}}createGeoreferences(){let{minLat:e,minLong:t,maxLat:n,maxLong:r}=this.mapExtent;return[[e,t],[e,r],[n,r],[n,t]].map((e=>({target:{x:e[0],y:e[1]},control:this.convert([e[1],e[0]])})))}};function Op(e,t){let n=[];return e.features.forEach((e=>{let r=t.convert(e.geometry.coordinates),i=(e.properties.neighbors||[]).map((t=>({node:t,map:e.properties.level}))),a=e.properties.level,s={...e.properties,x:r.x,y:r.y,paths:i,map:a,externalId:e.properties.externalId||""};n.push(s)})),n}var Zo=(e,t,n,r,i)=>{let a=[];return e.features.forEach((e=>{if(!e.geometry.coordinates[0].forEach)return;let s=[];"entrances"in e.properties&&(s=e.properties.entrances.map((e=>({id:"n_"+e.id,node:"n_"+e.id,map:e.level}))));let o,l=n[e.properties.id],u=t.find((e=>e.id===l)),h=e.geometry.coordinates[0].map((e=>i.convert(e))),c=r.find((t=>t.polygonId===e.properties.id)),d=Math.max(i.widthInMapUnits,i.heightInMapUnits)/1e3;if(c){let e=i.convert([c.position[0],c.position[1]]),t=c.size.x,n=c.size.y,r=i.mapScale,a=n*r,s=t*r/d/c.viewBox.width,l=a/d/c.viewBox.height;o={url:u?.image,visible:!!u?.image,viewBox:c.viewBox,scale:{x:s,y:l},position:{x:e.x,y:e.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let f={...e.properties,entrances:s,map:e.properties.level,externalId:e.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:(u?.altitude||0)*i.mapScale/d},scale:{x:1,y:1,z:(u?.height||1)*i.mapScale/d}},material:{color:u?.color||"#000000"},image:o,vertexes:h};a.push(f)})),a};function zp(e,t,n,r,i,a){let s=Zo(e,n,r,i,a),o=Zo(t,n,r,i,a);return s.concat(o)}function Ap(e){let t=new Map;return e.forEach((e=>{e.features.forEach((e=>{let{destinations:n}=e.properties;if(0===n.length)return;let r=n[0].split("-")[0],i=t.get(r),a=n.map((e=>e.split("-")[1])).map((e=>"n_"+e));if(i)i.nodes.push(...a);else{let{name:n,type:i,weight:s,multiplier:o,accessible:l}=e.properties,u={id:r,nodes:a,name:n,type:i,weight:s,multiplier:o,accessible:l};t.set(r,u)}}))})),Array.from(t.values())}function Np(e){let t=[];return e.features.forEach((e=>{let n={...e.properties};t.push(n)})),t}function Qo(e){let t=Object.keys(e),n=new Map,r=new Map,i=new Map,a=new Map,s=new Map,o=new Map,l=new Map,u=new Map;t.filter((e=>e.indexOf("/")>-1)).forEach((t=>{let h=t.split(/[\/\.]/),c=h[0],d=h[1];switch(c){case"connection":n.set(d,e[t]);break;case"level":r.set(d,e[t]);break;case"node":i.set(d,e[t]);break;case"obstruction":a.set(d,e[t]);break;case"space":s.set(d,e[t]);break;case"style":case"polygon-style":o.set(d,e[t]);break;case"image":l.set(d,e[t]);break;case"image-instance":u.set(d,e[t])}}));let h=e["building.geojson"]||e["building.json"],c=e["category.geojson"]||e["category.json"],d=e["location.geojson"]||e["location.json"],f=e["manifest.geojson"]||e["manifest.json"],p=e["style.json"]||[];return{connection:n,level:r,node:i,obstruction:a,space:s,building:h,category:c,location:d,manifest:f,style:p,polygonStyle:o,imageInstance:u,imageBinaries:l}}function es(e){let t=Array.from(e.connection.values()),n=Array.from(e.level.values()),r=e.building,i=e.category,a=e.style,s=e.location,o=e.imageInstance,l=e.polygonStyle,u={},h=[],c=new Map;n.forEach((t=>{let n=t.features[0].properties.id,r=Tp(t),i=new Or(r);c.set(n,i);let s=e.obstruction.get(n),d=e.space.get(n),f=o.get(n),p=l.get(n);u[n]=zp(d,s,a,p,f,i);let g=e.node.get(n);h.push(...Op(g,i))}));let d=Object.values(u).flat(),f=Ap(t),p=n.map((e=>{let t=e.features[0].properties.id,n=c.get(t);return Ip(e,u[t],n)})).flat(),g=new Map;Array.from(e.space.values()).forEach((e=>{e.features.forEach((e=>{g.set(e.properties.id,e.properties.entrances)}))}));let y=Np(r),m=xp(s,g),v=jp(i),_=_p(s),w=e.manifest.features[0].properties.name,M=e.manifest.features[0].geometry.coordinates[0],b=e.manifest.features[0].geometry.coordinates[1],x=e.imageBinaries;return{locations:m,categories:v,nodes:h,maps:p,polygons:d,vortexes:f,mapGroups:y,locationStates:_,themes:[],venue:{name:w,latitude:b,longitude:M},imageBinaries:x}}h(),h(),h(),h();var ft,Se,Pe,zr=[0,4,6,8,10],Ve=()=>{let e=new Array(16).fill(0),t=4294967296*Math.random();for(let n=0;n<e.length;n++)n>0&&!(3&n)&&(t=4294967296*Math.random()),e[n]=t>>>((3&n)<<3)&255;let n=e.map((e=>e.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],zr.map(((e,t)=>n.slice(e,t===zr.length-1?void 0:zr[t+1]).join(""))).join("-")},ts="mi-session-data",as="mi-local-data",Ar=class{constructor(){ee(this,Se,void 0),ee(this,Pe,void 0);try{let e=sessionStorage.getItem(ts);Y(this,Se,e?JSON.parse(e):{id:Ve()})}catch{Y(this,Se,{id:Ve()})}try{let e=localStorage.getItem(as);Y(this,Pe,e?JSON.parse(e):{deviceId:Ve()})}catch{Y(this,Pe,{deviceId:Ve()})}N(this,Se).id||(N(this,Se).id=Ve()),N(this,Pe).deviceId||(N(this,Pe).deviceId=Ve())}static getInstance(){return N(this,ft)||Y(this,ft,new Ar),N(this,ft)}static ___clearInstance(){Y(this,ft,void 0)}saveSessionData(e,t){N(this,Se)[e]=t;try{return sessionStorage.setItem(ts,JSON.stringify(N(this,Se))),!0}catch{return!1}}loadSessionData(e){let t=N(this,Se)[e];if(null!=t)return t}saveLocalData(e,t){N(this,Pe)[e]=t;try{return localStorage.setItem(as,JSON.stringify(N(this,Pe))),!0}catch{return!1}}loadLocalData(e){let t=N(this,Pe)[e];if(null!=t)return t}},_t=Ar;function ns(e){return/^[\da-f]{24}$/i.test(e)}function rs(){return _t.getInstance().loadLocalData("deviceId")}function is(){return _t.getInstance().loadSessionData("id")}ft=new WeakMap,Se=new WeakMap,Pe=new WeakMap,ee(_t,ft,void 0);var sa,jt,Tt,ua,It,Ot,zt,gt,la,At,Nt,ca,js=Yn(_s(),1),qp=M?.env?.npm_package_version,Sr=["websdk","web","webv2"],Pr="websdk",Fr=class{constructor(e){ee(this,sa,void 0),ee(this,jt,void 0),ee(this,Tt,void 0),ee(this,ua,void 0),ee(this,It,void 0),ee(this,Ot,void 0),ee(this,zt,void 0),ee(this,gt,void 0),ee(this,la,void 0),ee(this,At,void 0),ee(this,Nt,void 0),ee(this,ca,void 0),Y(this,gt,e.clientId),Y(this,la,e.clientSecret),Y(this,At,e.accessToken),Y(this,zt,e.noAuth||!1);let t="https://api-gateway.mappedin.com/track-analytics/a/";!N(this,zt)&&N(this,gt)&&!ns(N(this,gt))&&(t="https://web-proxy.mappedin.com/a/"),Y(this,Tt,t),Y(this,Tt,N(this,Tt)+(e.venue+"/")),Y(this,jt,!1),Y(this,sa,"boolean"==typeof e.testMode?e.testMode:"true"===e.testMode?.toLowerCase()),Y(this,ua,Sr.find((t=>t===e.context))||Sr[0]),Y(this,It,rs()),Y(this,Ot,is()),Y(this,Nt,new Set),Y(this,ca,e.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(e,t){if(N(this,sa))return;let n={...t,g:N(this,jt)},r=N(this,Tt)+e+"?"+js.default.stringify(n),i={"mi-context":Pr||N(this,ua),"mi-session":N(this,Ot),"mi-device":N(this,It),"mappedin-sdk-version":qp,"mappedin-platform-version":N(this,ca)};N(this,At)?i.Authorization=`Bearer ${N(this,At)}`:N(this,zt)||(i.Authorization=`Basic ${btoa(`${N(this,gt)}:${N(this,la)}`)}`),Qe()(r,{method:"GET",mode:"cors",headers:i})}locationSelected(e){let t=e.id||e;this.track("select-location",{id:t})}categorySelected(e){let t=e.id||e;this.track("select-category",{id:t})}mapViewLoaded(e,t,n,r){this.track("load-mapview",{type:e,force:t,benchmark:n||-1,reason:r||"success"})}getDirections(e,t){let n={start:e.id,end:t.id,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return N(this,Ot)}getDeviceID(){return N(this,It)}setGeolocationMode(e){Y(this,jt,e)}trackBlueDotEvent(e){e&&Object.values(Fr.BLUEDOT_EVENT).includes(e)&&!N(this,Nt).has(e)?(this.track(e),N(this,Nt).add(e)):z.warn(`Ignored unsupported blue dot event: "${e}".`)}trackSearch(e){null!=e&&this.track("query-search",e)}trackSearchSuggest(e){null!=e&&this.track("query-suggest",e)}static setContext(e){let t=Sr.find((t=>t===e));t&&(Pr=t)}static clearContext(){Pr=void 0}},On=Fr;sa=new WeakMap,jt=new WeakMap,Tt=new WeakMap,ua=new WeakMap,It=new WeakMap,Ot=new WeakMap,zt=new WeakMap,gt=new WeakMap,la=new WeakMap,At=new WeakMap,Nt=new WeakMap,ca=new WeakMap,ye(On,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var zn=On,Dr={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""},oa=(e=>(e.CATEGORY="categories",e.EVENT="events",e.LOCATION="locations",e.MAPGROUP="mapGroups",e.MAP="maps",e.NODE="nodes",e.POLYGON="polygons",e.VORTEX="vortexes",e))(oa||{}),Et={categories:Re,locations:we,vortexes:ot,maps:tt,nodes:nt,polygons:Ce,venue:it,events:et,mapGroups:at,themes:mt,locationStates:ht,rankings:rt},st=class{perspective;things;options;#e;#t="";updatedAt;categories=[];locations=[];vortexes=[];maps=[];nodes=[];polygons=[];venue={};events=[];mapGroups=[];themes=[];locationStates=[];rankings;_categoriesById;_locationsById;_vortexesById;_mapsById;_nodesById;_polygonsById;_eventsById;_mapGroupsById;_locationStatesById;_locationRankingsById;_rankingsById;_categoriesByExternalId;_locationsByExternalId;_vortexesByExternalId;_mapsByExternalId;_nodesByExternalId;_polygonsByExternalId;_eventsByExternalId;_mapGroupsByExternalId;_locationStatesByExternalId;_locationRankingsByExternalId;_rankingsByExternalId;generateGetters(e){try{for(let t=0,n=e.length;t<n;++t){let n=e[t];Array.isArray(this[n])&&(Object.defineProperty(this,`_${n}ByExternalId`,{get(){let e=this.#e[n];if(null!=e)return e;let t={};return this[n].forEach((e=>t[e.externalId]=e)),this.#e[n]=t,t}}),Object.defineProperty(this,`_${n}ById`,{get(){let e=this.#e[n];if(null!=e)return e;let t={};return this[n].forEach((e=>t[e.id]=e)),this.#e[n]=t,t}}))}return this}catch(e){throw new Error("Unable to generate getters, "+e)}}getCollectionItemById(e,t){let n=`_${e}ByExternalId`,r=this[`_${e}ById`];return null!=r&&null!=r[t]||(r=this[n],null!=r&&null!=r[t])?r[t]:null}async hydrateFromMVF(e){let t=es(e);return this.hydrate(t)}async hydrate(e,t){let n;if("string"==typeof e)try{this.#t=e,n=JSON.parse(e)}catch(e){return void z.error("Unable to parse JSON",e)}else n=e,this.#t=JSON.stringify(n);let r=Object.keys(n);for(let e=0,t=r.length;e<t;++e){let t=r[e],i=n[t];null!=Et[t]&&"function"==typeof Et[t].hydrate&&(this[t]=Et[t].hydrate(i,this))}t&&await Ko(n);let{images:i,scenes:a,imageBinaries:s}=n;this.images=i,this.scenes=a,this.imageBinaries=s,this.generateGetters(r),this.initNavigator()}images;imageBinaries;scenes;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"]),Yo(this.options.clientId)||this.options.things.rankings&&delete this.options.things.rankings;let{things:e}=this.options,t=[],n=Object.keys(e);for(let e=0,r=n.length;e<r;++e){let r=n[e];Et[r]&&t.push(Et[r].fetch(this).then((e=>(this[r]=e,Promise.resolve()))))}return this.generateGetters(n),Promise.all(t).then((()=>{this.initNavigator()}))}constructor(e){this.options=e,this.#e=Me.create(this);let t=new zn({...e,testMode:!e?.emitAnalyticsEvents});this.analytics={locationSelected:t.locationSelected,categorySelected:t.categorySelected,getDirections:t.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(kr,"true")}})}analytics;navigator;initNavigator(){this.navigator=new _r({locations:this.locations.map((e=>e.toJSON())),nodes:this.nodes.map((e=>e.toJSON())),vortexes:this.vortexes.map((e=>e.toJSON())),maps:this.maps.map((e=>e.toJSON()))})}toJSON(){let e={};for(let t in Et)Array.isArray(this[t])&&(e[t]=this[t].map((e=>e.toJSON())));let t={...e,venue:this.venue.toJSON()};return null!=this.rankings&&(t.rankings=this.rankings?.toJSON()),delete t.locationRankings,t}toString(){return this.#t||JSON.stringify(this.toJSON())}};h();var Ts={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"]};h(),h();var ae=function(){return ae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ae.apply(this,arguments)};function $(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function se(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s}var da,Gp="ENTRIES",Ss="KEYS",Ps="VALUES",ue="",Lr=function(){function e(e,t){var n=e._tree,r=Array.from(n.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:n,keys:r}]:[]}return e.prototype.next=function(){var e=this.dive();return this.backtrack(),e},e.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var e=St(this._path),t=e.node,n=e.keys;if(St(n)===ue)return{done:!1,value:this.result()};var r=t.get(St(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},e.prototype.backtrack=function(){if(0!==this._path.length){var e=St(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},e.prototype.key=function(){return this.set._prefix+this._path.map((function(e){var t=e.keys;return St(t)})).filter((function(e){return e!==ue})).join("")},e.prototype.value=function(){return St(this._path).node.get(ue)},e.prototype.result=function(){switch(this._type){case Ps:return this.value();case Ss:return this.key();default:return[this.key(),this.value()]}},e.prototype[Symbol.iterator]=function(){return this},e}(),St=function(e){return e[e.length-1]},Up=function(e,t,n){var r=new Map;if(void 0===t)return r;for(var i=t.length+1,a=i+n,s=new Uint8Array(a*i).fill(n+1),o=0;o<i;++o)s[o]=o;for(var l=1;l<a;++l)s[l*i]=l;return Fs(e,t,n,r,s,1,i,""),r},Fs=function(e,t,n,r,i,a,s,o){var l,u,h=a*s;try{e:for(var c=$(e.keys()),d=c.next();!d.done;d=c.next()){var f=d.value;if(f===ue){var p=i[h-1];p<=n&&r.set(o,[e.get(f),p])}else{for(var g=a,y=0;y<f.length;++y,++g){for(var m=f[y],v=s*g,_=v-s,w=i[v],M=Math.max(0,g-n-1),b=Math.min(s-1,g+n),x=M;x<b;++x){var O=m!==t[x],E=i[_+x]+ +O,N=i[_+x+1]+1,A=i[v+x]+1,I=i[v+x+1]=Math.min(E,N,A);I<w&&(w=I)}if(w>n)continue e}Fs(e.get(f),t,n,r,i,g,s,o+f)}}}catch(e){l={error:e}}finally{try{d&&!d.done&&(u=c.return)&&u.call(c)}finally{if(l)throw l.error}}},Cr=function(){function e(e,t){void 0===e&&(e=new Map),void 0===t&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return e.prototype.atPrefix=function(t){var n,r;if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");var i=se(Nn(this._tree,t.slice(this._prefix.length)),2),a=i[0],s=i[1];if(void 0===a){var o=se(Ur(s),2),l=o[0],u=o[1];try{for(var h=$(l.keys()),c=h.next();!c.done;c=h.next()){var d=c.value;if(d!==ue&&d.startsWith(u)){var f=new Map;return f.set(d.slice(u.length),l.get(d)),new e(f,t)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}return new e(a,t)},e.prototype.clear=function(){this._size=void 0,this._tree.clear()},e.prototype.delete=function(e){return this._size=void 0,Vp(this._tree,e)},e.prototype.entries=function(){return new Lr(this,Gp)},e.prototype.forEach=function(e){var t,n;try{for(var r=$(this),i=r.next();!i.done;i=r.next()){var a=se(i.value,2);e(a[0],a[1],this)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.fuzzyGet=function(e,t){return Up(this._tree,e,t)},e.prototype.get=function(e){var t=Gr(this._tree,e);return void 0!==t?t.get(ue):void 0},e.prototype.has=function(e){var t=Gr(this._tree,e);return void 0!==t&&t.has(ue)},e.prototype.keys=function(){return new Lr(this,Ss)},e.prototype.set=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");return this._size=void 0,Rr(this._tree,e).set(ue,t),this},Object.defineProperty(e.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),e.prototype.update=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");this._size=void 0;var n=Rr(this._tree,e);return n.set(ue,t(n.get(ue))),this},e.prototype.fetch=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");this._size=void 0;var n=Rr(this._tree,e),r=n.get(ue);return void 0===r&&n.set(ue,r=t()),r},e.prototype.values=function(){return new Lr(this,Ps)},e.prototype[Symbol.iterator]=function(){return this.entries()},e.from=function(t){var n,r,i=new e;try{for(var a=$(t),s=a.next();!s.done;s=a.next()){var o=se(s.value,2),l=o[0],u=o[1];i.set(l,u)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.fromObject=function(t){return e.from(Object.entries(t))},e}(),Nn=function(e,t,n){var r,i;if(void 0===n&&(n=[]),0===t.length||null==e)return[e,n];try{for(var a=$(e.keys()),s=a.next();!s.done;s=a.next()){var o=s.value;if(o!==ue&&t.startsWith(o))return n.push([e,o]),Nn(e.get(o),t.slice(o.length),n)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n.push([e,t]),Nn(void 0,"",n)},Gr=function(e,t){var n,r;if(0===t.length||null==e)return e;try{for(var i=$(e.keys()),a=i.next();!a.done;a=i.next()){var s=a.value;if(s!==ue&&t.startsWith(s))return Gr(e.get(s),t.slice(s.length))}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},Rr=function(e,t){var n,r,i=t.length;e:for(var a=0;e&&a<i;){try{for(var s=(n=void 0,$(e.keys())),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==ue&&t[a]===l[0]){for(var u=Math.min(i-a,l.length),h=1;h<u&&t[a+h]===l[h];)++h;var c=e.get(l);if(h===l.length)e=c;else{var d=new Map;d.set(l.slice(h),c),e.set(t.slice(a,a+h),d),e.delete(l),e=d}a+=h;continue e}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}var f=new Map;return e.set(t.slice(a),f),f}return e},Vp=function(e,t){var n=se(Nn(e,t),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(ue),0===r.size)Ds(i);else if(1===r.size){var a=se(r.entries().next().value,2),s=a[0],o=a[1];Ls(i,s,o)}},Ds=function(e){if(0!==e.length){var t=se(Ur(e),2),n=t[0],r=t[1];if(n.delete(r),0===n.size)Ds(e.slice(0,-1));else if(1===n.size){var i=se(n.entries().next().value,2),a=i[0],s=i[1];a!==ue&&Ls(e.slice(0,-1),a,s)}}},Ls=function(e,t,n){if(0!==e.length){var r=se(Ur(e),2),i=r[0],a=r[1];i.set(a+t,n),i.delete(a)}},Ur=function(e){return e[e.length-1]},Vr="or",$p="and",Wp="and_not",yt=function(){function e(e){if(null==e?.fields)throw new Error('MiniSearch: option "fields" must be provided');this._options=ae(ae(ae({},qr),e),{searchOptions:ae(ae({},zs),e.searchOptions||{})}),this._index=new Cr,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 e.prototype.add=function(e){var t,n,r,i,a=this._options,s=a.extractField,o=a.tokenize,l=a.processTerm,u=a.fields,h=a.idField,c=s(e,h);if(null==c)throw new Error('MiniSearch: document does not have ID field "'.concat(h,'"'));var d=this.addDocumentId(c);this.saveStoredFields(d,e);try{for(var f=$(u),p=f.next();!p.done;p=f.next()){var g=p.value,y=s(e,g);if(null!=y){var m=o(y.toString(),g),v=this._fieldIds[g],_=new Set(m).size;this.addFieldLength(d,v,this._documentCount-1,_);try{for(var w=(r=void 0,$(m)),M=w.next();!M.done;M=w.next()){var b=l(M.value,g);b&&this.addTerm(v,d,b)}}catch(e){r={error:e}}finally{try{M&&!M.done&&(i=w.return)&&i.call(w)}finally{if(r)throw r.error}}}}}catch(e){t={error:e}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}},e.prototype.addAll=function(e){var t,n;try{for(var r=$(e),i=r.next();!i.done;i=r.next()){var a=i.value;this.add(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.addAllAsync=function(e,t){var n=this;void 0===t&&(t={});var r=t.chunkSize,i=void 0===r?10:r,a={chunk:[],promise:Promise.resolve()},s=e.reduce((function(e,t,r){var a=e.chunk,s=e.promise;return a.push(t),(r+1)%i==0?{chunk:[],promise:s.then((function(){return new Promise((function(e){return setTimeout(e,0)}))})).then((function(){return n.addAll(a)}))}:{chunk:a,promise:s}}),a),o=s.chunk;return s.promise.then((function(){return n.addAll(o)}))},e.prototype.remove=function(e){var t,n,r,i,a,s,o=this._options,l=o.tokenize,u=o.processTerm,h=o.extractField,c=o.fields,d=o.idField,f=h(e,d);if(null==f)throw new Error('MiniSearch: document does not have ID field "'.concat(d,'"'));try{for(var p=$(this._documentIds),g=p.next();!g.done;g=p.next()){var y=se(g.value,2),m=y[0];if(f===y[1]){try{for(var v=(r=void 0,$(c)),_=v.next();!_.done;_=v.next()){var w=_.value,M=h(e,w);if(null!=M){var b=l(M.toString(),w),x=this._fieldIds[w],O=new Set(b).size;this.removeFieldLength(m,x,this._documentCount,O);try{for(var E=(a=void 0,$(b)),N=E.next();!N.done;N=E.next()){var A=u(N.value,w);A&&this.removeTerm(x,m,A)}}catch(e){a={error:e}}finally{try{N&&!N.done&&(s=E.return)&&s.call(E)}finally{if(a)throw a.error}}}}}catch(e){r={error:e}}finally{try{_&&!_.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}return this._storedFields.delete(m),this._documentIds.delete(m),this._fieldLength.delete(m),void(this._documentCount-=1)}}}catch(e){t={error:e}}finally{try{g&&!g.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(f,": it is not in the index"))},e.prototype.removeAll=function(e){var t,n;if(e)try{for(var r=$(e),i=r.next();!i.done;i=r.next()){var a=i.value;this.remove(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Cr,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},e.prototype.search=function(e,t){var n,r;void 0===t&&(t={});var i=this.executeQuery(e,t),a=[];try{for(var s=$(i),o=s.next();!o.done;o=s.next()){var l=se(o.value,2),u=l[0],h=l[1],c=h.score,d=h.terms,f=h.match,p=d.length,g={id:this._documentIds.get(u),score:c*p,terms:Object.keys(f),match:f};Object.assign(g,this._storedFields.get(u)),(null==t.filter||t.filter(g))&&a.push(g)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a.sort(Ns),a},e.prototype.autoSuggest=function(e,t){var n,r,i,a;void 0===t&&(t={}),t=ae(ae({},Kp),t);var s=new Map;try{for(var o=$(this.search(e,t)),l=o.next();!l.done;l=o.next()){var u=l.value,h=u.score,c=(v=u.terms).join(" ");null!=(y=s.get(c))?(y.score+=h,y.count+=1):s.set(c,{score:h,terms:v,count:1})}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}var d=[];try{for(var f=$(s),p=f.next();!p.done;p=f.next()){var g=se(p.value,2),y=g[0],m=g[1],v=(h=m.score,m.terms),_=m.count;d.push({suggestion:y,terms:v,score:h/_})}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return d.sort(Ns),d},Object.defineProperty(e.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),e.loadJSON=function(t,n){if(null==n)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return e.loadJS(JSON.parse(t),n)},e.getDefault=function(e){if(qr.hasOwnProperty(e))return Br(qr,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},e.loadJS=function(t,n){var r,i,a,s,o=t.index,l=t.documentCount,u=t.nextId,h=t.documentIds,c=t.fieldIds,d=t.fieldLength,f=t.averageFieldLength,p=t.storedFields,g=t.serializationVersion;if(1!==g&&2!==g)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var y=new e(n);y._documentCount=l,y._nextId=u,y._documentIds=An(h),y._fieldIds=c,y._fieldLength=An(d),y._avgFieldLength=f,y._storedFields=An(p),y._index=new Cr;try{for(var m=$(o),v=m.next();!v.done;v=m.next()){var _=se(v.value,2),w=_[0],M=_[1],b=new Map;try{for(var x=(a=void 0,$(Object.keys(M))),O=x.next();!O.done;O=x.next()){var E=O.value,N=M[E];1===g&&(N=N.ds),b.set(parseInt(E,10),An(N))}}catch(e){a={error:e}}finally{try{O&&!O.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}y._index.set(w,b)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}return y},e.prototype.executeQuery=function(e,t){var n=this;if(void 0===t&&(t={}),"string"!=typeof e){var r=ae(ae(ae({},t),e),{queries:void 0}),i=e.queries.map((function(e){return n.executeQuery(e,r)}));return this.combineResults(i,e.combineWith)}var a=this._options,s=a.tokenize,o=a.processTerm,l=a.searchOptions,u=ae(ae({tokenize:s,processTerm:o},l),t),h=u.tokenize,c=u.processTerm,d=h(e).map((function(e){return c(e)})).filter((function(e){return!!e})).map(Jp(u)).map((function(e){return n.executeQuerySpec(e,u)}));return this.combineResults(d,u.combineWith)},e.prototype.executeQuerySpec=function(e,t){var n,r,i,a,s,o,l=ae(ae({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce((function(e,t){var n;return ae(ae({},e),((n={})[t]=Br(e,t)||1,n))}),l.boost||{}),h=l.boostDocument,c=l.weights,d=l.maxFuzzy,f=ae(ae({},zs.weights),c),p=f.fuzzy,g=f.prefix,y=this._index.get(e.term),m=this.termResults(e.term,e.term,1,y,u,h);if(e.prefix&&(s=this._index.atPrefix(e.term)),e.fuzzy){var v=!0===e.fuzzy?.2:e.fuzzy,_=v<1?Math.min(d,Math.round(e.term.length*v)):v;_&&(o=this._index.fuzzyGet(e.term,_))}if(s)try{for(var w=$(s),M=w.next();!M.done;M=w.next()){var b=se(M.value,2),x=b[0],O=b[1];if(I=x.length-e.term.length){o?.delete(x);var E=g*x.length/(x.length+.3*I);this.termResults(e.term,x,E,O,u,h,m)}}}catch(e){n={error:e}}finally{try{M&&!M.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}if(o)try{for(var N=$(o.keys()),A=N.next();!A.done;A=N.next()){x=A.value;var I,k=se(o.get(x),2),T=k[0];if(I=k[1]){E=p*x.length/(x.length+I);this.termResults(e.term,x,E,T,u,h,m)}}}catch(e){i={error:e}}finally{try{A&&!A.done&&(a=N.return)&&a.call(N)}finally{if(i)throw i.error}}return m},e.prototype.combineResults=function(e,t){if(void 0===t&&(t=Vr),0===e.length)return new Map;var n=t.toLowerCase();return e.reduce(Hp[n])||new Map},e.prototype.toJSON=function(){var e,t,n,r,i=[];try{for(var a=$(this._index),s=a.next();!s.done;s=a.next()){var o=se(s.value,2),l=o[0],u=o[1],h={};try{for(var c=(n=void 0,$(u)),d=c.next();!d.done;d=c.next()){var f=se(d.value,2),p=f[0],g=f[1];h[p]=Object.fromEntries(g)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}i.push([l,h])}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.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:i,serializationVersion:2}},e.prototype.termResults=function(e,t,n,r,i,a,s){var o,l,u,h,c;if(void 0===s&&(s=new Map),null==r)return s;try{for(var d=$(Object.keys(i)),f=d.next();!f.done;f=d.next()){var p=f.value,g=i[p],y=this._fieldIds[p],m=r.get(y);if(null!=m){var v=m.size,_=this._avgFieldLength[y];try{for(var w=(u=void 0,$(m.keys())),M=w.next();!M.done;M=w.next()){var b=M.value,x=a?a(this._documentIds.get(b),t):1;if(x){var O=m.get(b),E=this._fieldLength.get(b)[y],N=n*g*x*Xp(O,v,this._documentCount,E,_),A=s.get(b);if(A){A.score+=N,Zp(A.terms,e);var I=Br(A.match,t);I?I.push(p):A.match[t]=[p]}else s.set(b,{score:N,terms:[e],match:(c={},c[t]=[p],c)})}}}catch(e){u={error:e}}finally{try{M&&!M.done&&(h=w.return)&&h.call(w)}finally{if(u)throw u.error}}}}}catch(e){o={error:e}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(o)throw o.error}}return s},e.prototype.addTerm=function(e,t,n){var r=this._index.fetch(n,Es),i=r.get(e);if(null==i)(i=new Map).set(t,1),r.set(e,i);else{var a=i.get(t);i.set(t,(a||0)+1)}},e.prototype.removeTerm=function(e,t,n){if(this._index.has(n)){var r=this._index.fetch(n,Es),i=r.get(e);null==i||null==i.get(t)?this.warnDocumentChanged(t,e,n):i.get(t)<=1?i.size<=1?r.delete(e):i.delete(t):i.set(t,i.get(t)-1),0===this._index.get(n).size&&this._index.delete(n)}else this.warnDocumentChanged(t,e,n)},e.prototype.warnDocumentChanged=function(e,t,n){var r,i;if(null!=console&&null!=console.warn)try{for(var a=$(Object.keys(this._fieldIds)),s=a.next();!s.done;s=a.next()){var o=s.value;if(this._fieldIds[o]===t)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(n,'" was not present in field "').concat(o,'". Removing a document after it has changed can corrupt the index!'))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},e.prototype.addDocumentId=function(e){var t=this._nextId;return this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},e.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},e.prototype.addFieldLength=function(e,t,n,r){var i=this._fieldLength.get(e);null==i&&this._fieldLength.set(e,i=[]),i[t]=r;var a=(this._avgFieldLength[t]||0)*n+r;this._avgFieldLength[t]=a/(n+1)},e.prototype.removeFieldLength=function(e,t,n,r){var i=this._avgFieldLength[t]*n-r;this._avgFieldLength[t]=i/(n-1)},e.prototype.saveStoredFields=function(e,t){var n,r,i=this._options,a=i.storeFields,s=i.extractField;if(null!=a&&0!==a.length){var o=this._storedFields.get(e);null==o&&this._storedFields.set(e,o={});try{for(var l=$(a),u=l.next();!u.done;u=l.next()){var h=u.value,c=s(t,h);void 0!==c&&(o[h]=c)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}},e}(),Br=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},Hp=((da={})[Vr]=function(e,t){var n,r;try{for(var i=$(t.keys()),a=i.next();!a.done;a=i.next()){var s=a.value,o=e.get(s);if(null==o)e.set(s,t.get(s));else{var l=t.get(s),u=l.score,h=l.terms,c=l.match;o.score=o.score+u,o.match=Object.assign(o.match,c),As(o.terms,h)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},da[$p]=function(e,t){var n,r,i=new Map;try{for(var a=$(t.keys()),s=a.next();!s.done;s=a.next()){var o=s.value,l=e.get(o);if(null!=l){var u=t.get(o),h=u.score,c=u.terms,d=u.match;As(l.terms,c),i.set(o,{score:l.score+h,terms:l.terms,match:Object.assign(l.match,d)})}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},da[Wp]=function(e,t){var n,r;try{for(var i=$(t.keys()),a=i.next();!a.done;a=i.next()){var s=a.value;e.delete(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},da),Is=1.2,Os=.7,Yp=.5,Xp=function(e,t,n,r,i){return Math.log(1+(n-t+.5)/(t+.5))*(Yp+e*(Is+1)/(e+Is*(1-Os+Os*r/i)))},Jp=function(e){return function(t,n,r){return{term:t,fuzzy:"function"==typeof e.fuzzy?e.fuzzy(t,n,r):e.fuzzy||!1,prefix:"function"==typeof e.prefix?e.prefix(t,n,r):!0===e.prefix}}},qr={idField:"id",extractField:function(e,t){return e[t]},tokenize:function(e,t){return e.split(Qp)},processTerm:function(e,t){return e.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},zs={combineWith:Vr,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},Kp={prefix:function(e,t,n){return t===n.length-1}},Zp=function(e,t){e.includes(t)||e.push(t)},As=function(e,t){var n,r;try{for(var i=$(t),a=i.next();!a.done;a=i.next()){var s=a.value;e.includes(s)||e.push(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},Ns=function(e,t){var n=e.score;return t.score-n},Es=function(){return new Map},An=function(e){var t,n,r=new Map;try{for(var i=$(Object.keys(e)),a=i.next();!a.done;a=i.next()){var s=a.value;r.set(parseInt(s,10),e[s])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},Qp=/[\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;h();var eh=["0","1","2","3","4","5","6","7","8","9"],th=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],ah=["0","1","2","3","4","5","6","7","8","9"],nh=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],Ik=[...eh,...th,...ah,...nh],Cs=["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"];h();var rh=32,ke=!1,ih=120,$r=0,En=class{constructor(e){this._callback=e.callback,this._frameCount=null!=e.frameCount?e.frameCount:1,this._ordering=null!=e.ordering?e.ordering:0,this._supersededBy=null!=e.supersededBy?new Set(e.supersededBy):new Set,this.name=e.name,this.userdata=e.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,ke&&z.log("update instantiated",this.name)}_callback;_frameCount;_ordering;_supersededBy;name;_remainingFrameCount;_lastFrameTime;userdata;getLastFrameTime(){return this._lastFrameTime}},We=class{constructor(e){if(null!=e.group&&null!=e.priority)throw new Error("cannot specify task priority individually within group");if(null!=e.group&&null!=e.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=e.callback,this._group=null!=e.group?e.group:null,this._priority=null!=e.priority?e.priority:0,this._postponed=null!=e.postponeOnAdd&&e.postponeOnAdd,this.name=e.name,this.userdata=e.userdata,this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,ke&&z.log("task instantiated",this.name)}_postponed;userdata;_priority;_group;name;_lastFrameTime;_callback;_complete;_scheduled;_cancelled;isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},Sn=class{constructor(e){this._onComplete=null!=e.onComplete?e.onComplete:()=>{},this._priority=null!=e.priority?e.priority:0,this._postponed=null!=e.postponeOnAdd&&e.postponeOnAdd,this.name=e.name,this.userdata=e.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,ke&&z.log("task group instantiated",this.name)}_postponed;_onComplete;_priority;userdata;name;_tasks;_scheduledTasks;_scheduled;_cancelled;isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let e of this._scheduledTasks)return this._scheduledTasks.delete(e),e}},Wr=class{_maxMillisecondsPerFrame;_time;constructor(e){this._maxMillisecondsPerFrame=null!=e?.maxMillisecondsPerFrame?e.maxMillisecondsPerFrame:rh,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},Pn=class{constructor(e){this._timer=null!=e?.timer?e.timer:new Wr,this._performance=null!=e?.performance&&e.performance,this._scheduledUpdatesByOrdering=new Pt,this._scheduledTasksByPriority=new Pt,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),ke&&z.log("task scheduler instantiated"),globalThis.MappedinDebug?.TEST_IOS&&(this._raf=e=>setTimeout(e,16))}_raf;_timer;_performance;_scheduledUpdatesByOrdering;_scheduledTasksByPriority;_postponedTasks;_requestAnimationFrameHandle;_updatesToRunThisFrame;_lastFrameTime=0;_updatesRunLastFrame;clear(){for(let e of this._scheduledTasksByPriority.values())e._cancelled=!0;for(let e of this._postponedTasks.values())e._cancelled=!0;this._scheduledUpdatesByOrdering=new Pt,this._scheduledTasksByPriority=new Pt,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),ke&&z.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(e){let t;this._timer.beginFrame(),this._performance&&(t=performance.now());let n=!1;ke&&(0===$r&&(n=!0),++$r,$r%=ih);let r=this._scheduledUpdatesByOrdering.keys();for(let e=r.length-1;e>=0;--e){let t=r[e];for(let e of this._scheduledUpdatesByOrdering.get(t).values())this._updatesToRunThisFrame.push(e),n&&z.log("update scheduled to run this frame",e.name)}for(let e of this._updatesToRunThisFrame){--e._remainingFrameCount,e._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(e._ordering,e),e._superseded=!1;for(let t of this._updatesToRunThisFrame)e._supersededBy.has(t)&&(e._superseded=!0,n&&z.log("update superseded",e.name,t.name))}for(let e=0;e<this._updatesToRunThisFrame.length;++e)this._updatesToRunThisFrame[e]._superseded&&(this._updatesToRunThisFrame.splice(e,1),--e);for(let t of this._updatesToRunThisFrame){let r;this._performance&&(r=performance.now()),t._callback(e),this._performance&&(t._lastFrameTime=performance.now()-r),n&&z.log("update completed",t.name)}this._updatesRunLastFrame.clear();for(let e of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(e);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(e)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-t),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(e){let t,n=this._scheduledTasksByPriority.popFromMaxKey(),r=null;z.assert(void 0!==n),Object.getPrototypeOf(n)===Sn.prototype&&(r=n,n=r._popTask()),z.assert(void 0!==n),z.assert(Object.getPrototypeOf(n)===We.prototype),this._performance&&(t=performance.now()),n._callback(e),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-t),ke&&z.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),ke&&z.log("group completed",r.name)):this._scheduledTasksByPriority.insert(r._priority,r))}scheduleUpdate(e){e._remainingFrameCount=e._frameCount,this._scheduledUpdatesByOrdering.insert(e._ordering,e),this.requestAnimationFrame()}scheduleTask(e){if(Object.getPrototypeOf(e)===Sn)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+e.name);if(e._scheduled)throw new Error("cannot schedule already scheduled task: "+e.name);if(e._cancelled)throw new Error("cannot schedule cancelled task: "+e.name);let t=e;"_group"in e&&null!=e._group&&(e._group._tasks.add(e),e._group._scheduledTasks.add(e),t=e._group),t._postponed?this._postponedTasks.add(t):this._scheduledTasksByPriority.insert(t._priority,t),e._scheduled=!0,t._scheduled=!0,ke&&z.log("task scheduled",e.name),this.requestAnimationFrame()}cancelUpdate(e){this._scheduledUpdatesByOrdering.delete(e._ordering,e),ke&&z.log("update cancelled",e.name)}cancelTask(e){if(!e._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+e.name);if(e._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+e.name);if("_group"in e&&null!=e._group){let t=e._group.isComplete();e._group._tasks.delete(e),e._group._scheduledTasks.delete(e),e._group.isComplete()&&(this._scheduledTasksByPriority.delete(e._group._priority,e._group),t||e._group._onComplete())}else this._scheduledTasksByPriority.delete(e._priority,e),this._postponedTasks.delete(e);Object.getPrototypeOf(e)===We.prototype?e._cancelled=!0:"clear"in e&&e.clear(),ke&&z.log("task cancelled",e.name)}postponeTask(e){if("_group"in e&&null!=e._group)throw new Error("cannot postpone individual tasks in group: "+e.name);if(e._cancelled)throw new Error("cannot postpone cancelled task: "+e.name);if(!e._postponed){if(Object.getPrototypeOf(e)===We.prototype){if("_complete"in e)return;if(!e._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+e.name)}this._scheduledTasksByPriority.delete(e._priority,e),(Object.getPrototypeOf(e)===We.prototype||!e.isComplete())&&this._postponedTasks.add(e),e._postponed=!0,ke&&z.log("task postponed",e.name)}}resumeTask(e){if("_group"in e&&null!=e._group)throw new Error("cannot resume individual tasks in groups");if(e._cancelled)throw new Error("cannot resume cancelled task");if(e._postponed){if(Object.getPrototypeOf(e)===We.prototype){if("_complete"in e&&e._complete)return;if(!e._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(e),(Object.getPrototypeOf(e)===We.prototype||!e.isComplete())&&this._scheduledTasksByPriority.insert(e._priority,e),e._postponed=!1,this.requestAnimationFrame(),ke&&z.log("task resumed",e.name)}}setTaskPriority(e,t){if(Object.getPrototypeOf(e)===We.prototype&&!e._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(e._priority,e)&&(this._scheduledTasksByPriority.delete(e._priority,e),this._scheduledTasksByPriority.insert(t,e)),e._priority=t,ke&&z.log("task priority changed",e.name,t)}},Pt=class{constructor(){this._map=new Map,this._size=0,this._sortedKeys=[]}_map;_size;_sortedKeys;has(e,t){return null!=this._map.get(e)&&this._map.get(e).has(t)}get(e){return this._map.get(e)}insert(e,t){if(z.assert("number"==typeof e&&Number.isFinite(e)),null==this._map.get(e)){this._map.set(e,new Set);for(let t=0;t<=this._sortedKeys.length;++t)if(t===this._sortedKeys.length||e<this._sortedKeys[t]){this._sortedKeys.splice(t,0,e);break}}this._map.get(e).has(t)||(this._map.get(e).add(t),++this._size)}delete(e,t){null!=this._map.get(e)&&this._map.get(e).has(t)&&(this._map.get(e).delete(t),--this._size,0===this._map.get(e).size&&(this._map.delete(e),this._sortedKeys.splice(this._sortedKeys.indexOf(e),1)))}pop(e){if(null!=this._map.get(e)){let t;for(t of this._map.get(e).values()){this._map.get(e).delete(t),--this._size;break}return 0===this._map.get(e).size&&(this._map.delete(e),this._sortedKeys.splice(this._sortedKeys.indexOf(e),1)),t}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let e=this._map.keys(),t=null,n={[Symbol.iterator]:()=>n,next:()=>{if(null==t){let n=e.next();if(n.done)return n;t=this._map.get(n.value).values()}let n=t.next();for(;n.done;){let r=e.next();if(r.done)return r;t=this._map.get(r.value).values(),n=t.next()}return n}};return n}keys(){return this._sortedKeys}get size(){let e=0;for(let t of this._map.values())e+=t.size;return z.assert(e===this._size),e}},He=e=>e.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),Ft="",oh=.09,sh=1,uh=.025,lh=.5,ch=5e-4,dh=5e-4,ph=.01,hh=.05,Rs=1,mh=.01,fh=.2,gh={MappedinCategory:"categories",MappedinLocation:"locations"},yh={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:Cs,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===M.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:oh,PRIMARY_INDEX_WEIGHT:sh,SECONDARY_INDEX_WEIGHT:uh,CATEGORY_NAME_WEIGHT:lh,LOCATION_NAME_WEIGHT:Rs,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:ch,CATEGORY_LOCATION_TAGS_WEIGHT:dh,CATEGORY_LOCATION_NAME_WEIGHT:ph,PRIMARY_INDEX_TAGS_NAME_WEIGHT:hh,LOCATION_DEFAULT_RANK:Rs,RATIO_OF_FUZZY_TO_EXACT:mh,RATIO_OF_PREFIX_TO_EXACT:fh}},Hr=class{#e;#t;#n;#r;#i;#a=new Pn({performance:!0});#s;#o;#l=new Map;constructor(e,t){this.#o=new zn({...e.options,testMode:!1===t?.emitAnalyticsEvents}),this.#i={...yh,...t},this.#e=e,this.#s=new Set(this.#i?.stopWords);let{PRIMARY_INDEX_FUZZYNESS:n,PRIMARY_INDEX_WEIGHT:r,CATEGORY_NAME_WEIGHT:i,RATIO_OF_FUZZY_TO_EXACT:a,RATIO_OF_PREFIX_TO_EXACT:s,PRIMARY_INDEX_TAGS_NAME_WEIGHT:o}=this.#i.constants,l=["object","query","weight","tag","rank"],u={fields:["query","name","tag"],storeFields:l,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:n},boost:{name:r,query:r,tag:o},weights:{fuzzy:a,prefix:s},boostDocument:e=>e.includes("MappedinLocation")?r:e.includes("MappedinCategory")?i:r},h={fields:["description"],storeFields:l,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(e,t)=>this.#s?.has(e.toLowerCase())?null:e.toLowerCase()},c={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...l,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(this.#h=new Promise((e=>{this.#c=e})),this.#i?.jsonIndex){let{primary:e,secondary:t,extra:n}=JSON.parse(this.#i?.jsonIndex);this.#t=yt.loadJS(e,u),this.#n=yt.loadJS(t,h),this.#r=yt.loadJS(n,c)}else this.#t=new yt(u),this.#n=new yt(h),this.#r=new yt(c),this.#e.locations.forEach(this.#d),this.#e.categories.forEach(this.#f);this.#a.update(performance.now()),this.#p=Ir(((e,t)=>{this.#o.trackSearchSuggest({query:e,hits:t})}),300),this.#g=Ir(((e,t)=>{this.#o.trackSearch({query:e,hits:t})}),300)}#u=0;#y=e=>{this.#u++,this.#a.scheduleUpdate(new En({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{e(),this.#u--,0===this.#u&&this.#c()}}))};#d=e=>{let{SECONDARY_INDEX_WEIGHT:t,LOCATION_DEFAULT_RANK:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:r}=this.#i.constants,i=n;this.#i?.useLocationRank&&(i=Array.isArray(e.polygons)?Math.max(...e.polygons.map((e=>e.rank?.score?e.rank?.score:n)),n):n),this.#y((()=>{this.#t.add({name:He(e.name),tags:"",id:"MappedinLocation_"+e.id,weight:n,rank:i})})),this.#i?.searchTags&&Array.isArray(e.tags)&&e.tags.forEach((t=>{this.#t.add({name:"",tag:He(t),id:"MappedinLocation_"+e.id,weight:r,rank:i})})),this.#i?.searchDescriptions&&this.#y((()=>this.#n.add({description:He(e.description||""),id:"MappedinLocation_"+e.id,weight:t,rank:i})))};#f=e=>{let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:t,CATEGORY_LOCATION_TAGS_WEIGHT:n,CATEGORY_LOCATION_NAME_WEIGHT:r,CATEGORY_NAME_WEIGHT:i}=this.#i.constants;this.#y((()=>this.#t.add({name:He(e.name||""),description:"",id:"MappedinCategory_"+e.id,weight:i})));let a=e.locations.reduce(((e,t)=>e+` ${Ft} `+t.name),"")+` ${Ft}`;if(this.#i?.searchDescriptionsInCategories&&e.locations.forEach((n=>{null!=n.description&&this.#y((()=>this.#r.add({id:"MappedinCategory_"+e.id,"category.locations.description":He(n.description),ref:n.name,weight:t})))})),this.#i?.searchTagsInCategories){let t=e.locations.reduce(((e,t)=>e+t.tags?.reduce(((e,t)=>e+` ${Ft} `+t),"")+` ${Ft}`),"");this.#y((()=>this.#r.add({"category.locations.tags":He(t),id:"MappedinCategory_"+e.id,weight:n})))}this.#y((()=>this.#r.add({"category.locations.name":He(a),id:"MappedinCategory_"+e.id,weight:r})))};#h;#c;#m=e=>{let t=e.score,{object:n,id:r,weight:i,rank:a}=e,[s,o]=r.split("_"),l=n||this.#e.getCollectionItemById(gh[s],o);return a&&this.#i?.useLocationRank&&(t+=a),i&&(t*=i),{score:t,type:s,object:l}};#v=(e,t)=>{for(let n in e.match)e.match[n].forEach((r=>{let i=e.ref||e[r]||t.object[r];if("category.locations.tags"===r||"category.locations.name"===r){let t=new RegExp(`[^${Ft}]* `+n+` [^${Ft}]*`,"ig").exec(e[r]);null!=t&&(i=t[0].slice(1,-1))}t.matches.push({term:n,weight:e.weight,matchesOn:r,value:i})}))};#_(e){let t=[],n=He(e);t=[...this.#t.search(n),...this.#n.search(n),...this.#r.search(n)].sort(((e,t)=>t.score-e.score));let r={};for(let e of t){let t=this.#m(e);r[e.id]?r[e.id].score+=t.score:r[e.id]={...t,matches:[]},this.#v(e,r[e.id])}return Object.keys(r).map((e=>({...r[e],matches:r[e].matches.sort(((e,t)=>t.weight-e.weight))}))).sort(((e,t)=>t.score-e.score))}async suggest(e){await this.#h;let{PRIMARY_INDEX_FUZZYNESS:t,PRIMARY_INDEX_WEIGHT:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:r,RATIO_OF_FUZZY_TO_EXACT:i,RATIO_OF_PREFIX_TO_EXACT:a}=this.#i.constants,s=this.#t.autoSuggest(e,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:t,boost:{name:n,query:n,tag:r},weights:{fuzzy:i,prefix:a}});return this.#p(e,s.length),{total:s.length,hits:s.map((e=>({text:e.suggestion})))}}async search(e){await this.#h;let t=this.#_(e);return this.#g(e,t.length),t}async toJSON(){return await this.#h,JSON.stringify({primary:this.#t,secondary:this.#n,extra:this.#r})}#p;#g;async addQuery(e){let t,n,{query:r,object:i,weight:a=1}=e;await this.#h,t=i instanceof we?"MappedinLocation":i instanceof Re?"MappedinCategory":"Custom","MappedinLocation"===t||"MappedinCategory"===t?n=t+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=this.#l.get(i),n||(n="Custom_"+Ve(),this.#l.set(i,n))),this.#t.add({id:n,weight:a,object:i,query:He(r)})}};h();var Bs=(e=>(e.MULTI_GEOMETRY="MULTI_GEOMETRY",e.SINGLE_GEOMETRY="SINGLE_GEOMETRY",e))(Bs||{}),gi=globalThis.fetch;function Qe(){if(null==gi)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return gi}function Zk(e){gi=e}var Bh=M?.env?.npm_package_version;globalThis.btoa||(globalThis.btoa=Tu.encode);var qh=["ar"];function ka(e){let t={...Dr,things:Ts,...e};return t.headers={...t.headers,"mappedin-sdk-version":Bh},e.platformString&&(t.headers={...t.headers,"mappedin-platform-version":e.platformString}),t.noAuth||(t.accessToken?t.authorization=`Bearer ${t.accessToken}`:t.clientId&&t.clientSecret&&(t.authorization=`Basic ${globalThis.btoa(`${t.clientId}:${t.clientSecret}`)}`)),t}async function eb(e){let{venue:t,clientId:n,clientSecret:r,bundleBaseUri:i}=e,a=new st({venue:t}),s=Qo(await Vh({clientId:n,clientSecret:r,venue:t,bundleBaseUri:i},!1));return a.hydrateFromMVF(s),a}async function Gh(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,...e}}),n="public/1/"+(t.useDraftData?"draft/":""),r=new st({...t,baseUrl:t.baseUrl+n});return await r.fetch(),r}function tb(e){Gh=e}var yi={shouldPopulateBundledImagesAsBlobs:!(typeof globalThis.navigator<"u"&&"ReactNative"==globalThis.navigator.product)};async function ab(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...yi,...e}),{url:n,updated_at:r}=await Uh(e),i=await Qe()(n,{mode:"cors"}),{data:a,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format ${s}`);let o=new st(t);return await o.hydrate(a,t.shouldPopulateBundledImagesAsBlobs),o.updatedAt=r,o}async function Uh(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...yi,...e}),{version:n,venue:r}=e,i=`${e.bundleBaseUri||t.baseUrl+`exports/legacy${null!=t.language&&qh.includes(t.language)?"-"+t.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return t.language=void 0,await In(t,i)}async function nb(e,{url:t,updated_at:n}){let r=ka({baseUrl:"https://api-gateway.mappedin.com/",...yi,...e}),i=await Qe()(t,{mode:"cors"}),{data:a,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format${s}`);let o=new st(r);return await o.hydrate(a,r.shouldPopulateBundledImagesAsBlobs),o.updatedAt=n,o}async function ju(e){let t=ka({baseUrl:"https://api-gateway.mappedin.com/",...Dr,...e}),{version:n,venue:r}=e,i=`${e.bundleBaseUri||t.baseUrl+"exports/mvf/1/bundle"}?venue=${r}&version=1.0.0`;return t.language=void 0,await In(t,i)}async function Vh(e,t=!1){return new Promise((async(n,r)=>{try{let i=new TextDecoder,a=i.decode.bind(i),s=await Promise.resolve().then((()=>(_u(),xu)));if(t){let t=new Blob(['var enc = new TextDecoder();\n\t\t\t\tvar currentTaskName;\n\t\t\t\tself.onmessage = async function({ data }) {\n\t\t\t\t\tif (data[0] === "task") {\n\t\t\t\t\t\tcurrentTaskName = data[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tpostMessage([\n\t\t\t\t\t\t\t "finished",\n\t\t\t\t\t\t [currentTaskName, JSON.parse(enc.decode(data))]\n\t\t\t\t\t\t]);\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t postMessage(["error", e.toString()]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t currentTaskName = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t'],{type:"text/javascript"}),{url:i}=await ju(e),o=new Uint8Array(await Qe()(i).then((e=>e.arrayBuffer()))),l=s.unzipSync(o),u=Object.keys(l),h=Math.min(u.length,Math.min(4,navigator.hardwareConcurrency)||4),c=[],d=u.map((e=>[e,l[e].buffer])),f=1e6,p=[],g=[];for(let e=0;e<d.length;e++){let[,t]=d[e];t.byteLength>=f?p.push(d[e]):t.byteLength<f&&g.push(d[e])}let y={};if(0===g.length)d.forEach((([e])=>{y[e]=JSON.parse(a(l[e]))})),n(y);else{let e=function({data:e}){let t=this;if("finished"===e[0]){let n=g[s];if(null!=n){let[e,r]=n;t.postMessage(["task",e]),t.postMessage(r,[r]),s++}let[r,i]=e[1];y[r]=i,o++}else if("error"===e[0]){let[,t]=e;c.forEach((e=>e.terminate())),r(t)}o===u.length&&(n(y),c.forEach((e=>e.terminate())))};let i=URL.createObjectURL(t);for(let e=0;e<Math.min(h,g.length);e++)c.push(new Worker(i));let s=0,o=0;c.forEach((t=>{if(t.onmessage=e,null!=g[s]){let[e,n]=g[s];t.postMessage(["task",e]),t.postMessage(n,[n]),s++}})),p.forEach((([e])=>{y[e]=JSON.parse(a(l[e])),o++}))}}else{let{url:t}=await ju(e),r=new Uint8Array(await Qe()(t).then((e=>e.arrayBuffer()))),i=s.unzipSync(r),o=Object.keys(i),l={};for(let e=0;e<o.length;e++){let t=o[e];if(0===t.indexOf("image/")&&-1===t.indexOf("__MACOSX"))l[t]=i[t].buffer;else if("/"!==t.slice(-1))try{l[t]=JSON.parse(a(i[t]))}catch{z.warn("bad file",t)}}n(l)}}catch(e){r(e)}}))}export{Bs as MAP_RENDER_MODE,st as Mappedin,Re as MappedinCategory,oa as MappedinCollectionType,xt as MappedinCoordinate,ra as MappedinDestinationSet,wt as MappedinDirections,et as MappedinEvent,we as MappedinLocation,tt as MappedinMap,at as MappedinMapGroup,Ue as MappedinNavigatable,nt as MappedinNode,Ce as MappedinPolygon,rt as MappedinRankings,it as MappedinVenue,ot as MappedinVortex,Hr as OfflineSearch,tb as __setGetVenueMock,nb as downloadBundle,Vh as downloadVenueBundleMVF,Gh as getVenue,ab as getVenueBundle,Uh as getVenueBundleURL,eb as getVenueMVF,ju as getVenueMVFURL,Qe as isomorphicFetch,Zk as setFetchFn};
|