@mappedin/mappedin-js 5.1.1 → 5.1.2

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.
@@ -1 +1 @@
1
- var Md,j,hd=Object.create,va=Object.defineProperty,md=Object.getOwnPropertyDescriptor,fd=Object.getOwnPropertyNames,gd=Object.getPrototypeOf,yd=Object.prototype.hasOwnProperty,vd=(t,e,n)=>e in t?va(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ko=t=>va(t,"__esModule",{value:!0}),Xo=(t,e)=>()=>(t&&(e=t(t=0)),e),R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),kd=(t,e)=>{for(var n in Ko(t),e)va(t,n,{get:e[n],enumerable:!0})},bd=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of fd(e))!yd.call(t,r)&&"default"!==r&&va(t,r,{get:()=>e[r],enumerable:!(n=md(e,r))||n.enumerable});return t},vr=t=>bd(Ko(va(null!=t?hd(gd(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),m=(t,e,n)=>(vd(t,"symbol"!=typeof e?e+"":e,n),n),kr=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},p=(t,e,n)=>(kr(t,e,"read from private field"),n?n.call(t):e.get(t)),T=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},I=(t,e,n,r)=>(kr(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),br=(t,e,n,r)=>({set _(r){I(t,e,r,n)},get _(){return p(t,e,r)}}),et=(t,e,n)=>(kr(t,e,"access private method"),n),f=Xo((()=>{j={env:Md={NODE_ENV:"production",npm_package_version:"5.1.1"}}})),Zo=R(((t,e)=>{f(),function(n){var r="object"==typeof t&&t,i="object"==typeof e&&e&&e.exports==r&&e,a="object"==typeof global&&global;(a.global===a||a.window===a)&&(n=a);var o=function(t){this.message=t};(o.prototype=new Error).name="InvalidCharacterError";var s=function(t){throw new o(t)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,r,i,a=t.length%3,o="",u=-1,h=t.length-a;++u<h;)e=t.charCodeAt(u)<<16,n=t.charCodeAt(++u)<<8,r=t.charCodeAt(++u),o+=l.charAt((i=e+n+r)>>18&63)+l.charAt(i>>12&63)+l.charAt(i>>6&63)+l.charAt(63&i);return 2==a?(e=t.charCodeAt(u)<<8,n=t.charCodeAt(++u),o+=l.charAt((i=e+n)>>10)+l.charAt(i>>4&63)+l.charAt(i<<2&63)+"="):1==a&&(i=t.charCodeAt(u),o+=l.charAt(i>>2)+l.charAt(i<<4&63)+"=="),o},decode:function(t){var e=(t=String(t).replace(u,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,a="",o=-1;++o<e;)r=l.indexOf(t.charAt(o)),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}(t)})),ue=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.areaConversion=t.timeConversion=t.distanceConversion=t.altitudeKeys=t.latitudeKeys=t.longitudeKeys=t.MAXLON=t.MINLON=t.MAXLAT=t.MINLAT=t.earthRadius=t.sexagesimalPattern=void 0;t.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;t.earthRadius=6378137;t.MINLAT=-90;t.MAXLAT=90;t.MINLON=-180;t.MAXLON=180;t.longitudeKeys=["lng","lon","longitude",0];t.latitudeKeys=["lat","latitude",1];t.altitudeKeys=["alt","altitude","elevation","elev",2];t.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};t.timeConversion={m:60,h:3600,d:86400};var e={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};t.areaConversion=e,e.sqm=e.m2,e.sqkm=e.km2,e.sqft=e.ft2,e.sqyd=e.yd2,e.sqin=e.in2})),ba=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t,e){return e.reduce((function(e,n){if(null==t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&void 0!==n&&void 0===e?(e=n,n):e}),void 0)};t.default=e})),Ma=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)};t.default=e})),wa=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),n=function(t){return e.sexagesimalPattern.test(t.toString().trim())};t.default=n})),xa=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),n=function(t){var n=new RegExp(e.sexagesimalPattern).exec(t);if(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};t.default=n})),Nn=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=ue(),r=(e=ba())&&e.__esModule?e:{default:e};function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:n.longitudeKeys,latitude:n.latitudeKeys,altitude:n.altitudeKeys},i=(0,r.default)(t,e.longitude),o=(0,r.default)(t,e.latitude),s=(0,r.default)(t,e.altitude);return a({latitude:o,longitude:i},s?{altitude:s}:{})};t.default=s})),jr=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ma()),n=a(wa()),r=a(xa()),i=ue();function a(t){return t&&t.__esModule?t:{default:t}}var o=function t(a){return(0,e.default)(a)?!(parseFloat(a)>i.MAXLAT||a<i.MINLAT):!!(0,n.default)(a)&&t((0,r.default)(a))};t.default=o})),Tr=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ma()),n=a(wa()),r=a(xa()),i=ue();function a(t){return t&&t.__esModule?t:{default:t}}var o=function t(a){return(0,e.default)(a)?!(parseFloat(a)>i.MAXLON||a<i.MINLON):!!(0,n.default)(a)&&t((0,r.default)(a))};t.default=o})),Or=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Nn()),n=i(jr()),r=i(Tr());function i(t){return t&&t.__esModule?t:{default:t}}var a=function(t){var i=(0,e.default)(t),a=i.latitude,o=i.longitude;if(Array.isArray(t)&&t.length>=2)return(0,r.default)(t[0])&&(0,n.default)(t[1]);if(void 0===a||void 0===o)return!1;var s=t[o],l=t[a];return!(void 0===l||void 0===s||!1===(0,n.default)(l)||!1===(0,r.default)(s))};t.default=a})),Fn=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ma()),n=o(wa()),r=o(xa()),i=o(Or()),a=o(Nn());function o(t){return t&&t.__esModule?t:{default:t}}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var h=function t(o){if((0,e.default)(o))return Number(o);if((0,n.default)(o))return(0,r.default)(o);if((0,i.default)(o)){var s=(0,a.default)(o);return Array.isArray(o)?o.map((function(e,n){return[0,1].includes(n)?t(e):e})):l(l(l({},o),s.latitude&&u({},s.latitude,t(o[s.latitude]))),s.longitude&&u({},s.longitude,t(o[s.longitude])))}return Array.isArray(o)?o.map((function(e){return(0,i.default)(e)?t(e):e})):o};t.default=h})),Oe=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),n=i(ba()),r=i(Fn());function i(t){return t&&t.__esModule?t:{default:t}}var a=function(t,i){var a=(0,n.default)(t,e.latitudeKeys);if(null!=a){var o=t[a];return!0===i?o:(0,r.default)(o)}};t.default=a})),ze=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),n=i(ba()),r=i(Fn());function i(t){return t&&t.__esModule?t:{default:t}}var a=function(t,i){var a=(0,n.default)(t,e.longitudeKeys);if(null!=a){var o=t[a];return!0===i?o:(0,r.default)(o)}};t.default=a})),Ge=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t*Math.PI/180};t.default=e})),It=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return 180*t/Math.PI};t.default=e})),ls=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Oe()),n=o(ze()),r=o(Ge()),i=o(It()),a=ue();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o,s){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,e.default)(t),h=(0,n.default)(t),c=o/l,d=(0,r.default)(s),f=(0,r.default)(u),p=(0,r.default)(h),m=Math.asin(Math.sin(f)*Math.cos(c)+Math.cos(f)*Math.sin(c)*Math.cos(d)),g=p+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(m)),y=(0,i.default)(g);return(y<a.MINLON||y>a.MAXLON)&&(g=(g+3*Math.PI)%(2*Math.PI)-Math.PI,y=(0,i.default)(g)),{latitude:(0,i.default)(m),longitude:y}};t.default=s})),ds=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=e.areaConversion[n];if(r)return t*r;throw new Error("Invalid unit used for area conversion.")};t.default=n})),cs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=e.distanceConversion[n];if(r)return t*r;throw new Error("Invalid unit used for distance conversion.")};t.default=n})),ps=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=ue(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(n){case"kmh":return t*e.timeConversion.h*e.distanceConversion.km;case"mph":return t*e.timeConversion.h*e.distanceConversion.mi;default:return t}};t.default=n})),fs=R((t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{!r&&null!=s.return&&s.return()}finally{if(i)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(t){var e=Math.pow(10,12);return Math.round(t*e)/e},i=function(t){var n=e(t.toString().split("."),2),i=n[0],a=n[1],o=Math.abs(Number(i)),s=r(60*Number("0."+(a||0))),l=Math.floor(s),u=r(60*(s%l||0));return o+"° "+Number(l.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(u.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'};t.default=i})),Er=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t>1?1:t<-1?-1:t};t.default=e})),ct=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Oe()),n=o(ze()),r=o(Ge()),i=o(Er()),a=ue();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=void 0===s||isNaN(s)?1:s;var l=(0,e.default)(t),u=(0,n.default)(t),h=(0,e.default)(o),c=(0,n.default)(o),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/s)*s};t.default=s})),Lr=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ct())&&e.__esModule?e:{default:e};var r=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default;return r="function"==typeof r?r:n.default,e.slice().sort((function(e,n){return r(t,e)-r(t,n)}))};t.default=r})),ks=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Lr())&&e.__esModule?e:{default:e};var r=function(t,e){return(0,n.default)(t,e)[0]};t.default=r})),ws=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ge()),n=a(Oe()),r=a(ze()),i=ue();function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t){var a=0;if(t.length>2){for(var o,s,l,u=0;u<t.length;u++){u===t.length-2?(o=t.length-2,s=t.length-1,l=0):u===t.length-1?(o=t.length-1,s=0,l=1):(o=u,s=u+1,l=u+2);var h=(0,r.default)(t[o]),c=(0,n.default)(t[s]),d=(0,r.default)(t[l]);a+=((0,e.default)(d)-(0,e.default)(h))*Math.sin((0,e.default)(c))}a=a*i.earthRadius*i.earthRadius/2}return Math.abs(a)};t.default=o})),Pr=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Oe()),n=r(ze());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,r){var i=(0,e.default)(r),a=(0,n.default)(r);return{maxLat:Math.max(i,t.maxLat),minLat:Math.min(i,t.minLat),maxLng:Math.max(a,t.maxLng),minLng:Math.min(a,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})};t.default=i})),js=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Oe()),n=o(ze()),r=o(Ge()),i=o(It()),a=ue();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o){var s,l,u=(0,e.default)(t),h=(0,n.default)(t),c=(0,r.default)(u),d=(0,r.default)(h),f=o/a.earthRadius,p=c-f,m=c+f,g=(0,r.default)(a.MAXLAT),y=(0,r.default)(a.MINLAT),v=(0,r.default)(a.MAXLON),_=(0,r.default)(a.MINLON);if(p>y&&m<g){var w=Math.asin(Math.sin(f)/Math.cos(c));(s=d-w)<_&&(s+=2*Math.PI),(l=d+w)>v&&(l-=2*Math.PI)}else p=Math.max(p,y),m=Math.min(m,g),s=_,l=v;return[{latitude:(0,i.default)(p),longitude:(0,i.default)(s)},{latitude:(0,i.default)(m),longitude:(0,i.default)(l)}]};t.default=s})),Is=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Oe()),n=a(ze()),r=a(Ge()),i=a(It());function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var a=t.length,o=t.reduce((function(t,i){var a=(0,r.default)((0,e.default)(i)),o=(0,r.default)((0,n.default)(i));return{X:t.X+Math.cos(a)*Math.cos(o),Y:t.Y+Math.cos(a)*Math.sin(o),Z:t.Z+Math.sin(a)}}),{X:0,Y:0,Z:0}),s=o.X/a,l=o.Y/a,u=o.Z/a;return{longitude:(0,i.default)(Math.atan2(l,s)),latitude:(0,i.default)(Math.atan2(u,Math.sqrt(s*s+l*l)))}};t.default=o})),Os=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Pr())&&e.__esModule?e:{default:e};var r=function(t){var e=(0,n.default)(t),r=e.minLat+(e.maxLat-e.minLat)/2,i=e.minLng+(e.maxLng-e.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(i.toFixed(6))}};t.default=r})),Cr=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Oe()),n=a(ze()),r=a(Ge()),i=a(It());function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t,a){var o=(0,r.default)((0,n.default)(a))-(0,r.default)((0,n.default)(t)),s=Math.log(Math.tan((0,r.default)((0,e.default)(a))/2+Math.PI/4)/Math.tan((0,r.default)((0,e.default)(t))/2+Math.PI/4));return Math.abs(o)>Math.PI&&(o=o>0?-1*(2*Math.PI-o):2*Math.PI+o),((0,i.default)(Math.atan2(o,s))+360)%360};t.default=o})),Ss=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Cr())&&e.__esModule?e:{default:e};var r=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,i="function"==typeof r?r(t,e):(0,n.default)(t,e);if(isNaN(i))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(i/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}};t.default=r})),Br=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(ct()),n=r(Er());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r,i){var a=(0,e.default)(r,t),o=(0,e.default)(t,i),s=(0,e.default)(r,i),l=Math.acos((0,n.default)((a*a+s*s-o*o)/(2*a*s))),u=Math.acos((0,n.default)((o*o+s*s-a*a)/(2*o*s)));return l>Math.PI/2?a:u>Math.PI/2?o:Math.sin(l)*a};t.default=i})),Ps=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Oe()),n=a(ze()),r=a(Ge()),i=a(It());function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t,a){var o=(0,e.default)(a),s=(0,n.default)(a),l=(0,e.default)(t),u=(0,n.default)(t);return((0,i.default)(Math.atan2(Math.sin((0,r.default)(s)-(0,r.default)(u))*Math.cos((0,r.default)(o)),Math.cos((0,r.default)(l))*Math.sin((0,r.default)(o))-Math.sin((0,r.default)(l))*Math.cos((0,r.default)(o))*Math.cos((0,r.default)(s)-(0,r.default)(u))))+360)%360};t.default=o})),Cs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ct())&&e.__esModule?e:{default:e};function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.default;return t.reduce((function(t,n){return"object"===r(t)&&null!==t.last&&(t.distance+=e(n,t.last)),t.last=n,t}),{last:null,distance:0}).distance};t.default=i})),Gs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Oe()),n=a(ze()),r=a(Ge()),i=ue();function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;o=void 0===o||isNaN(o)?1:o;var s,l,u,h,c,d,f,p=(0,e.default)(t),m=(0,n.default)(t),g=(0,e.default)(a),y=(0,n.default)(a),v=6356752.314245,_=1/298.257223563,w=(0,r.default)(y-m),M=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(p)))),b=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(g)))),I=Math.sin(M),x=Math.cos(M),T=Math.sin(b),E=Math.cos(b),O=w,k=100;do{var N=Math.sin(O),A=Math.cos(O);if(0===(d=Math.sqrt(E*N*(E*N)+(x*T-I*E*A)*(x*T-I*E*A))))return 0;s=I*T+x*E*A,l=Math.atan2(d,s),c=s-2*I*T/(h=1-(u=x*E*N/d)*u),isNaN(c)&&(c=0);var S=_/16*h*(4+_*(4-3*h));f=O,O=w+(1-S)*_*u*(l+S*d*(c+S*s*(2*c*c-1)))}while(Math.abs(O-f)>1e-12&&--k>0);if(0===k)return NaN;var F=h*(i.earthRadius*i.earthRadius-v*v)/(v*v),L=1+F/16384*(4096+F*(F*(320-175*F)-768)),D=F/1024*(256+F*(F*(74-47*F)-128)),R=D*d*(c+D/4*(s*(2*c*c-1)-D/6*c*(4*d*d-3)*(4*c*c-3))),j=v*L*(l-R);return Math.round(j/o)*o};t.default=o})),Vs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0};t.default=e})),Us=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ct())&&e.__esModule?e:{default:e};var r=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,i=r(t,e),a=Number(e.time)-Number(t.time),o=i/a*1e3;return o};t.default=r})),$s=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ct())&&e.__esModule?e:{default:e};var r=function(t,e,r){return(0,n.default)(e,t)+(0,n.default)(t,r)===(0,n.default)(e,r)};t.default=r})),Hs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Oe()),n=r(ze());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r){for(var i=!1,a=r.length,o=-1,s=a-1;++o<a;s=o)((0,n.default)(r[o])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(r[s])||(0,n.default)(r[s])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(r[o]))&&(0,e.default)(t)<((0,e.default)(r[s])-(0,e.default)(r[o]))*((0,n.default)(t)-(0,n.default)(r[o]))/((0,n.default)(r[s])-(0,n.default)(r[o]))+(0,e.default)(r[o])&&(i=!i);return i};t.default=i})),Js=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Br())&&e.__esModule?e:{default:e};var r=function(t,e,r,i){return(0,n.default)(t,e,r)<i};t.default=r})),Ks=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ct())&&e.__esModule?e:{default:e};var r=function(t,e,r){return(0,n.default)(t,e)<r};t.default=r})),Ys=R((t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{!r&&null!=s.return&&s.return()}finally{if(i)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var n=e(t.split(" "),2),r=n[0],i=n[1];return{longitude:parseFloat(r),latitude:parseFloat(i)}}))};t.default=r})),Qs=R((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0});var e={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(t,"computeDestinationPoint",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"convertArea",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"convertDistance",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"convertSpeed",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"decimalToSexagesimal",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"getAreaOfPolygon",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"getBounds",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"getBoundsOfDistance",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"getCenter",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"getCenterOfBounds",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"getCompassDirection",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(t,"toRad",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:function(){return z.default}});var n=U(ls()),r=U(ds()),i=U(cs()),a=U(ps()),o=U(fs()),s=U(ks()),l=U(ws()),u=U(Pr()),h=U(js()),c=U(Is()),d=U(Os()),p=U(Ss()),m=U(ba()),g=U(Nn()),y=U(ct()),v=U(Br()),_=U(Ps()),w=U(Oe()),M=U(ze()),b=U(Cs()),I=U(Gs()),x=U(Cr()),T=U(Vs()),E=U(Us()),O=U(Ma()),k=U($s()),N=U(Hs()),A=U(Js()),S=U(Ks()),F=U(wa()),L=U(Or()),D=U(jr()),R=U(Tr()),j=U(Lr()),P=U(xa()),B=U(Fn()),C=U(Ge()),W=U(It()),z=U(Ys()),$=ue();function U(t){return t&&t.__esModule?t:{default:t}}Object.keys($).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return $[n]}})}))})),qu=R(((t,e)=>{f(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),Wu=R(((t,e)=>{f();var n="%[a-f0-9]{2}",r=new RegExp("("+n+")|([^%]+?)","gi"),i=new RegExp("("+n+")+","gi");function a(t,e){try{return[decodeURIComponent(t.join(""))]}catch(t){}if(1===t.length)return t;e=e||1;var n=t.slice(0,e),r=t.slice(e);return Array.prototype.concat.call([],a(n),a(r))}function o(t){try{return decodeURIComponent(t)}catch(i){for(var e=t.match(r)||[],n=1;n<e.length;n++)e=(t=a(e,n).join("")).match(r)||[];return t}}e.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch(t){var r=o(n[0]);r!==n[0]&&(e[n[0]]=r)}n=i.exec(t)}e["%C2"]="�";for(var a=Object.keys(e),s=0;s<a.length;s++){var l=a[s];t=t.replace(new RegExp(l,"g"),e[l])}return t}(t)}}})),Ju=R(((t,e)=>{f(),e.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];let n=t.indexOf(e);return-1===n?[t]:[t.slice(0,n),t.slice(n+e.length)]}})),Xu=R(((t,e)=>{f(),e.exports=function(t,e){for(var n={},r=Object.keys(t),i=Array.isArray(e),a=0;a<r.length;a++){var o=r[a],s=t[o];(i?-1!==e.indexOf(o):e(o,s,t))&&(n[o]=s)}return n}})),il=R((t=>{f();var e=qu(),n=Wu(),r=Ju(),i=Xu(),a=Symbol("encodeFragmentIdentifier");function o(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function s(t,n){return n.encode?n.strict?e(t):encodeURIComponent(t):t}function l(t,e){return e.decode?n(t):t}function u(t){return Array.isArray(t)?t.sort():"object"==typeof t?u(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function h(t){let e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function c(t){let e=(t=h(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function d(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):e.parseBooleans&&null!==t&&("true"===t.toLowerCase()||"false"===t.toLowerCase())&&(t="true"===t.toLowerCase()),t}function p(t,e){o((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);let n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{let i="string"==typeof n&&n.includes(t.arrayFormatSeparator),a="string"==typeof n&&!i&&l(n,t).includes(t.arrayFormatSeparator);n=a?l(n,t):n;let o=i||a?n.split(t.arrayFormatSeparator).map((e=>l(e,t))):null===n?n:l(n,t);r[e]=o};case"bracket-separator":return(e,n,r)=>{let i=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!i)return void(r[e]=n&&l(n,t));let a=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>l(e,t)));void 0!==r[e]?r[e]=[].concat(r[e],a):r[e]=a};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e),i=Object.create(null);if("string"!=typeof t||!(t=t.trim().replace(/^[?#&]/,"")))return i;for(let a of t.split("&")){if(""===a)continue;let[t,o]=r(e.decode?a.replace(/\+/g," "):a,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?o:l(o,e),n(l(t,e),o,i)}for(let t of Object.keys(i)){let n=i[t];if("object"==typeof n&&null!==n)for(let t of Object.keys(n))n[t]=d(n[t],e);else i[t]=d(n,e)}return!1===e.sort?i:(!0===e.sort?Object.keys(i).sort():Object.keys(i).sort(e.sort)).reduce(((t,e)=>{let n=i[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=u(n):t[e]=n,t}),Object.create(null))}t.extract=c,t.parse=p,t.stringify=(t,e)=>{if(!t)return"";o((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);let n=n=>e.skipNull&&(t=>null==t)(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{let i=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[s(e,t),"[",i,"]"].join("")]:[...n,[s(e,t),"[",s(i,t),"]=",s(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[s(e,t),"[]"].join("")]:[...n,[s(e,t),"[]=",s(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{let e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[s(n,t),e,s(i,t)].join("")]:[[r,s(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,s(e,t)]:[...n,[s(e,t),"=",s(r,t)].join("")]}}(e),i={};for(let e of Object.keys(t))n(e)||(i[e]=t[e]);let a=Object.keys(i);return!1!==e.sort&&a.sort(e.sort),a.map((n=>{let i=t[n];return void 0===i?"":null===i?s(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?s(n,e)+"[]":i.reduce(r(n),[]).join("&"):s(n,e)+"="+s(i,e)})).filter((t=>t.length>0)).join("&")},t.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[n,i]=r(t,"#");return Object.assign({url:n.split("?")[0]||"",query:p(c(t),e)},e&&e.parseFragmentIdentifier&&i?{fragmentIdentifier:l(i,e)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[a]:!0},n);let r=h(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),l=Object.assign(o,e.query),u=t.stringify(l,n);u&&(u=`?${u}`);let c=function(t){let e="",n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(e.url);return e.fragmentIdentifier&&(c=`#${n[a]?s(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${u}${c}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[a]:!1},r);let{url:o,query:s,fragmentIdentifier:l}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:i(s,n),fragmentIdentifier:l},r)},t.exclude=(e,n,r)=>{let i=Array.isArray(n)?t=>!n.includes(t):(t,e)=>!n(t,e);return t.pick(e,i,r)}})),od={};function Eo(t,e){return!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,t}function Wl(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[pa],(function(t){return jt(Mn(t.data[0],t.data[1]))}),0,n)}function Mn(t,e){return Lt(t,e||{},0,0)}function Do(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[ca],(function(t){return jt(fa(t.data[0],Io(t.data[1])))}),1,n)}function fa(t,e){return kn(t,e)}function df(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[pa,Rl,function(){return[Po]}],(function(t){return jt(Po(t.data[0],t.data[1]))}),2,n)}function Po(t,e){e||(e={});var n=da(),r=t.length;n.p(t);var i=Lt(t,e,No(e),8),a=i.length;return zo(i,e),X(i,a-8,n.d()),X(i,a-4,r),i}function Jl(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[ca,Bl,function(){return[hr]}],(function(t){return jt(hr(t.data[0]))}),3,n)}function hr(t,e){return kn(t.subarray(Ao(t),-8),e||new W(Vl(t)))}function pf(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[pa,ql,function(){return[Ro]}],(function(t){return jt(Ro(t.data[0],t.data[1]))}),4,n)}function Ro(t,e){e||(e={});var n=To();n.p(t);var r=Lt(t,e,2,4);return So(r,e),X(r,r.length-4,n.d()),r}function Xl(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),ha(t,e,[ca,Gl,function(){return[fr]}],(function(t){return jt(fr(t.data[0],Io(t.data[1])))}),5,n)}function fr(t,e){return kn((Ul(t),t.subarray(2,-4)),e)}function mf(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&D(7),31==t[0]&&139==t[1]&&8==t[2]?Jl(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Do(t,e,n):Xl(t,e,n)}function ff(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?hr(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?fa(t,e):fr(t,e)}function _t(t,e){if(e){for(var n=new W(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(Zl)return Zl.encode(t);var i=t.length,a=new W(t.length+(t.length>>1)),o=0,s=function(t){a[o++]=t};for(r=0;r<i;++r){if(o+5>a.length){var l=new W(o+8+(i-r<<1));l.set(a),a=l}var u=t.charCodeAt(r);u<128||e?s(u):u<2048?(s(192|u>>6),s(128|63&u)):u>55295&&u<57344?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++r))>>18),s(128|u>>12&63),s(128|u>>6&63),s(128|63&u)):(s(224|u>>12),s(128|u>>6&63),s(128|63&u))}return De(a,0,o)}function Go(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}if(qo)return qo.decode(t);var i=ed(t),a=i[0];return i[1].length&&D(8),a}function Mf(t,e,n){n||(n=e,e={}),"function"!=typeof n&&D(7);var r={};Bo(t,"",r,e);var i=Object.keys(r),a=i.length,o=0,s=0,l=a,u=new Array(a),h=[],c=function(){for(var t=0;t<h.length;++t)h[t]()},d=function(t,e){gr((function(){n(t,e)}))};gr((function(){d=n}));var f=function(){var t=new W(s+22),e=o,n=s-o;s=0;for(var r=0;r<l;++r){var i=u[r];try{var a=i.c.length;ga(t,s,i,i.f,i.u,a);var h=30+i.f.length+Tt(i.extra),c=s+h;t.set(i.c,c),ga(t,o,i,i.f,i.u,a,s,i.m),o+=16+h+(i.m?i.m.length:0),s=c+a}catch(t){return d(t,null)}}Vo(t,o,u.length,n,e),d(null,t)};a||f();for(var p=function(t){var e=i[t],n=r[e],l=n[0],p=n[1],m=da(),g=l.length;m.p(l);var y=_t(e),v=y.length,_=p.comment,w=_&&_t(_),M=w&&w.length,b=Tt(p.extra),I=0==p.level?0:8,x=function(n,r){if(n)c(),d(n,null);else{var i=r.length;u[t]=bn(p,{size:g,crc:m.d(),c:r,f:y,m:w,u:v!=e.length||w&&_.length!=M,compression:I}),o+=30+v+b+i,s+=76+2*(v+b)+(M||0)+i,--a||f()}};if(v>65535&&x(D(11,0,1),null),I)if(g<16e4)try{x(null,Mn(l,p))}catch(t){x(t,null)}else h.push(Wl(l,p,x));else x(null,l)},m=0;m<l;++m)p(m);return c}function wf(t,e){e||(e={});var n={},r=[];Bo(t,"",n,e);var i=0,a=0;for(var o in n){var s=n[o],l=s[0],u=s[1],h=0==u.level?0:8,c=(I=_t(o)).length,d=u.comment,f=d&&_t(d),p=f&&f.length,m=Tt(u.extra);c>65535&&D(11);var g=h?Mn(l,u):l,y=g.length,v=da();v.p(l),r.push(bn(u,{size:l.length,crc:v.d(),c:g,f:I,m:f,u:c!=o.length||f&&d.length!=p,o:i,compression:h})),i+=30+c+m+y,a+=76+2*(c+m)+(p||0)+y}for(var _=new W(a+22),w=i,M=a-i,b=0;b<r.length;++b){var I=r[b];ga(_,I.o,I,I.f,I.u,I.c.length);var x=30+I.f.length+Tt(I.extra);_.set(I.c,I.o+x),ga(_,i,I,I.f,I.u,I.c.length,I.o,I.m),i+=16+x+(I.m?I.m.length:0)}return Vo(_,i,r.length,M,w),_}function Tf(t,e,n){n||(n=e,e={}),"function"!=typeof n&&D(7);var r=[],i=function(){for(var t=0;t<r.length;++t)r[t]()},a={},o=function(t,e){gr((function(){n(t,e)}))};gr((function(){o=n}));for(var s=t.length-22;101010256!=te(t,s);--s)if(!s||t.length-s>65558)return o(D(13,0,1),null),i;var l=ve(t,s+8);if(l){var u=l,h=te(t,s+16),c=4294967295==h;if(c){if(s=te(t,s-12),101075792!=te(t,s))return o(D(13,0,1),null),i;u=l=te(t,s+32),h=te(t,s+48)}for(var d=e&&e.filter,f=function(e){var n=nd(t,h,c),s=n[0],u=n[1],f=n[2],p=n[3],m=n[4],g=n[5],y=ad(t,g);h=m;var v=function(t,e){t?(i(),o(t,null)):(e&&(a[p]=e),--l||o(null,a))};if(!d||d({name:p,size:u,originalSize:f,compression:s}))if(s)if(8==s){var _=t.subarray(y,y+u);if(u<32e4)try{v(null,fa(_,new W(f)))}catch(t){v(t,null)}else r.push(Do(_,{size:f},v))}else v(D(14,"unknown compression type "+s,1),null);else v(null,De(t,y,y+u));else v(null,null)},p=0;p<u;++p)f()}else o(null,{});return i}function If(t,e){for(var n={},r=t.length-22;101010256!=te(t,r);--r)(!r||t.length-r>65558)&&D(13);var i=ve(t,r+8);if(!i)return{};var a=te(t,r+16),o=4294967295==a;o&&(r=te(t,r-12),101075792!=te(t,r)&&D(13),i=te(t,r+32),a=te(t,r+48));for(var s=e&&e.filter,l=0;l<i;++l){var u=nd(t,a,o),h=u[0],c=u[1],d=u[2],f=u[3],p=u[4],m=u[5],g=ad(t,m);a=p,(!s||s({name:f,size:c,originalSize:d,compression:h}))&&(h?8==h?n[f]=fa(t.subarray(g,g+c),new W(d)):D(14,"unknown compression type "+h):n[f]=De(t,g,g+c))}return n}kd(od,{AsyncCompress:()=>lf,AsyncDecompress:()=>hf,AsyncDeflate:()=>$l,AsyncGunzip:()=>Hl,AsyncGzip:()=>lf,AsyncInflate:()=>Lo,AsyncUnzipInflate:()=>jf,AsyncUnzlib:()=>Kl,AsyncZipDeflate:()=>kf,AsyncZlib:()=>cf,Compress:()=>Fo,DecodeUTF8:()=>gf,Decompress:()=>Yl,Deflate:()=>Qe,EncodeUTF8:()=>yf,FlateErrorCode:()=>sf,Gunzip:()=>pr,Gzip:()=>Fo,Inflate:()=>je,Unzip:()=>_f,UnzipInflate:()=>xf,UnzipPassThrough:()=>rd,Unzlib:()=>mr,Zip:()=>bf,ZipDeflate:()=>vf,ZipPassThrough:()=>wn,Zlib:()=>Co,compress:()=>df,compressSync:()=>Po,decompress:()=>mf,decompressSync:()=>ff,deflate:()=>Wl,deflateSync:()=>Mn,gunzip:()=>Jl,gunzipSync:()=>hr,gzip:()=>df,gzipSync:()=>Po,inflate:()=>Do,inflateSync:()=>fa,strFromU8:()=>Go,strToU8:()=>_t,unzip:()=>Tf,unzipSync:()=>If,unzlib:()=>Xl,unzlibSync:()=>fr,zip:()=>Mf,zipSync:()=>wf,zlib:()=>pf,zlibSync:()=>Ro});var jl,of,W,me,ia,ra,oa,gn,_l,Tl,wo,rr,Il,Ol,xo,yn,ut,Ee,lt,sa,K,zl,Al,Nl,Sl,or,Le,sr,vn,De,sf,El,D,kn,Ze,ua,ur,lr,jo,la,dr,_o,Ll,dt,Dl,Fl,da,To,Lt,bn,Pl,cr,uf,Cl,ca,pa,Rl,Bl,ql,Gl,jt,Io,ha,Fe,ma,ve,te,Oo,X,zo,Ao,Vl,No,So,Ul,Qe,$l,je,Lo,Fo,lf,pr,Hl,Co,cf,mr,Kl,Yl,hf,Bo,Zl,qo,Ql,ed,gf,yf,td,ad,nd,id,Tt,ga,Vo,wn,vf,kf,bf,rd,xf,jf,_f,gr,sd=Xo((()=>{for(f(),jl={},of=function(t,e,n,r,i){var a=new Worker(jl[e]||(jl[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],i(r,null)}else i(null,e)},a.postMessage(n,r),a},W=Uint8Array,me=Uint16Array,ia=Uint32Array,ra=new W([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]),oa=new W([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]),gn=new W([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tl=(_l=function(t,e){for(var n=new me(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new ia(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]})(ra,2),wo=Tl[0],rr=Tl[1],wo[28]=258,rr[258]=28,Il=_l(oa,0),Ol=Il[0],xo=Il[1],yn=new me(32768),K=0;K<32768;++K)ut=(61680&(ut=(52428&(ut=(43690&K)>>>1|(21845&K)<<1))>>>2|(13107&ut)<<2))>>>4|(3855&ut)<<4,yn[K]=((65280&ut)>>>8|(255&ut)<<8)>>>1;for(Ee=function(t,e,n){for(var r=t.length,i=0,a=new me(e);i<r;++i)t[i]&&++a[t[i]-1];var o,s=new me(e);for(i=0;i<e;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new me(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var u=i<<4|t[i],h=e-t[i],c=s[t[i]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)o[yn[c]>>>l]=u}else for(o=new me(r),i=0;i<r;++i)t[i]&&(o[i]=yn[s[t[i]-1]++]>>>15-t[i]);return o},lt=new W(288),K=0;K<144;++K)lt[K]=8;for(K=144;K<256;++K)lt[K]=9;for(K=256;K<280;++K)lt[K]=7;for(K=280;K<288;++K)lt[K]=8;for(sa=new W(32),K=0;K<32;++K)sa[K]=5;zl=Ee(lt,9,0),Al=Ee(lt,9,1),Nl=Ee(sa,5,0),Sl=Ee(sa,5,1),or=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Le=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},sr=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},vn=function(t){return(t+7)/8|0},De=function(t,e,n){(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length);var r=new(2==t.BYTES_PER_ELEMENT?me:4==t.BYTES_PER_ELEMENT?ia:W)(n-e);return r.set(t.subarray(e,n)),r},sf={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},El=["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"],D=function(t,e,n){var r=new Error(e||El[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,D),!n)throw r;return r},kn=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new W(0);var i=!e||n,a=!n||n.i;n||(n={}),e||(e=new W(3*r));var o=function(t){var n=e.length;if(t>n){var r=new W(Math.max(2*n,t));r.set(e),e=r}},s=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){s=Le(t,l,1);var m=Le(t,l+1,3);if(l+=3,!m){var g=t[(O=vn(l)+4)-4]|t[O-3]<<8,y=O+g;if(y>r){a&&D(0);break}i&&o(u+g),e.set(t.subarray(O,y),u),n.b=u+=g,n.p=l=8*y,n.f=s;continue}if(1==m)h=Al,c=Sl,d=9,f=5;else if(2==m){var v=Le(t,l,31)+257,_=Le(t,l+10,15)+4,w=v+Le(t,l+5,31)+1;l+=14;for(var M=new W(w),b=new W(19),I=0;I<_;++I)b[gn[I]]=Le(t,l+3*I,7);l+=3*_;var x=or(b),T=(1<<x)-1,E=Ee(b,x,1);for(I=0;I<w;){var O,k=E[Le(t,l,T)];if(l+=15&k,(O=k>>>4)<16)M[I++]=O;else{var N=0,A=0;for(16==O?(A=3+Le(t,l,3),l+=2,N=M[I-1]):17==O?(A=3+Le(t,l,7),l+=3):18==O&&(A=11+Le(t,l,127),l+=7);A--;)M[I++]=N}}var S=M.subarray(0,v),F=M.subarray(v);d=or(S),f=or(F),h=Ee(S,d,1),c=Ee(F,f,1)}else D(1);if(l>p){a&&D(0);break}}i&&o(u+131072);for(var L=(1<<d)-1,R=(1<<f)-1,j=l;;j=l){var P=(N=h[sr(t,l)&L])>>>4;if((l+=15&N)>p){a&&D(0);break}if(N||D(2),P<256)e[u++]=P;else{if(256==P){j=l,h=null;break}var B=P-254;if(P>264){var C=ra[I=P-257];B=Le(t,l,(1<<C)-1)+wo[I],l+=C}var z=c[sr(t,l)&R],$=z>>>4;z||D(3),l+=15&z;F=Ol[$];if($>3){C=oa[$];F+=sr(t,l)&(1<<C)-1,l+=C}if(l>p){a&&D(0);break}i&&o(u+131072);for(var U=u+B;u<U;u+=4)e[u]=e[u-F],e[u+1]=e[u+1-F],e[u+2]=e[u+2-F],e[u+3]=e[u+3-F];u=U}}n.l=h,n.p=j,n.b=u,n.f=s,h&&(s=1,n.m=d,n.d=c,n.n=f)}while(!s);return u==e.length?e:De(e,0,u)},Ze=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8},ua=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},ur=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,a=n.slice();if(!i)return[dt,0];if(1==i){var o=new W(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(t,e){return t.f-e.f})),n.push({s:-1,f:25001});var s=n[0],l=n[1],u=0,h=1,c=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};h!=i-1;)s=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:s.f+l.f,l:s,r:l};var d=a[0].s;for(r=1;r<i;++r)a[r].s>d&&(d=a[r].s);var f=new me(d+1),p=lr(n[h-1],f,0);if(p>e){r=0;var m=0,g=p-e,y=1<<g;for(a.sort((function(t,e){return f[e.s]-f[t.s]||t.f-e.f}));r<i;++r){var v=a[r].s;if(!(f[v]>e))break;m+=y-(1<<p-f[v]),f[v]=e}for(m>>>=g;m>0;){var _=a[r].s;f[_]<e?m-=1<<e-f[_]++-1:++r}for(;r>=0&&m;--r){var w=a[r].s;f[w]==e&&(--f[w],++m)}p=e}return[new W(f),p]},lr=function(t,e,n){return-1==t.s?Math.max(lr(t.l,e,n+1),lr(t.r,e,n+1)):e[t.s]=n},jo=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new me(++e),r=0,i=t[0],a=1,o=function(t){n[r++]=t},s=1;s<=e;++s)if(t[s]==i&&s!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=t[s]}return[n.subarray(0,r),e]},la=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},dr=function(t,e,n){var r=n.length,i=vn(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<r;++a)t[i+a+4]=n[a];return 8*(i+4+r)},_o=function(t,e,n,r,i,a,o,s,l,u,h){Ze(e,h++,n),++i[256];for(var c=ur(i,15),d=c[0],f=c[1],p=ur(a,15),m=p[0],g=p[1],y=jo(d),v=y[0],_=y[1],w=jo(m),M=w[0],b=w[1],I=new me(19),x=0;x<v.length;++x)I[31&v[x]]++;for(x=0;x<M.length;++x)I[31&M[x]]++;for(var T=ur(I,7),E=T[0],O=T[1],k=19;k>4&&!E[gn[k-1]];--k);var N,A,S,F,L=u+5<<3,D=la(i,lt)+la(a,sa)+o,R=la(i,d)+la(a,m)+o+14+3*k+la(I,E)+(2*I[16]+3*I[17]+7*I[18]);if(L<=D&&L<=R)return dr(e,h,t.subarray(l,l+u));if(Ze(e,h,1+(R<D)),h+=2,R<D){N=Ee(d,f,0),A=d,S=Ee(m,g,0),F=m;var j=Ee(E,O,0);Ze(e,h,_-257),Ze(e,h+5,b-1),Ze(e,h+10,k-4),h+=14;for(x=0;x<k;++x)Ze(e,h+3*x,E[gn[x]]);h+=3*k;for(var P=[v,M],B=0;B<2;++B){var C=P[B];for(x=0;x<C.length;++x){var W=31&C[x];Ze(e,h,j[W]),h+=E[W],W>15&&(Ze(e,h,C[x]>>>5&127),h+=C[x]>>>12)}}}else N=zl,A=lt,S=Nl,F=sa;for(x=0;x<s;++x)if(r[x]>255){W=r[x]>>>18&31;ua(e,h,N[W+257]),h+=A[W+257],W>7&&(Ze(e,h,r[x]>>>23&31),h+=ra[W]);var z=31&r[x];ua(e,h,S[z]),h+=F[z],z>3&&(ua(e,h,r[x]>>>5&8191),h+=oa[z])}else ua(e,h,N[r[x]]),h+=A[r[x]];return ua(e,h,N[256]),h+A[256]},Ll=new ia([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),dt=new W(0),Dl=function(t,e,n,r,i,a){var o=t.length,s=new W(r+o+5*(1+Math.ceil(o/7e3))+i),l=s.subarray(r,s.length-i),u=0;if(!e||o<8)for(var h=0;h<=o;h+=65535){var c=h+65535;c>=o&&(l[u>>3]=a),u=dr(l,u+1,t.subarray(h,c))}else{for(var d=Ll[e-1],f=d>>>13,p=8191&d,m=(1<<n)-1,g=new me(32768),y=new me(m+1),v=Math.ceil(n/3),_=2*v,w=function(e){return(t[e]^t[e+1]<<v^t[e+2]<<_)&m},M=new ia(25e3),b=new me(288),I=new me(32),x=0,T=0,E=(h=0,0),O=0,k=0;h<o;++h){var N=w(h),A=32767&h,S=y[N];if(g[A]=S,y[N]=A,O<=h){var F=o-h;if((x>7e3||E>24576)&&F>423){u=_o(t,l,0,M,b,I,T,E,k,h-k,u),E=x=T=0,k=h;for(var L=0;L<286;++L)b[L]=0;for(L=0;L<30;++L)I[L]=0}var D=2,R=0,j=p,P=A-S&32767;if(F>2&&N==w(h-P))for(var B=Math.min(f,F)-1,C=Math.min(32767,h),z=Math.min(258,F);P<=C&&--j&&A!=S;){if(t[h+D]==t[h+D-P]){for(var $=0;$<z&&t[h+$]==t[h+$-P];++$);if($>D){if(D=$,R=P,$>B)break;var U=Math.min(P,$-2),G=0;for(L=0;L<U;++L){var X=h-P+L+32768&32767,J=X-g[X]+32768&32767;J>G&&(G=J,S=X)}}}P+=(A=S)-(S=g[A])+32768&32767}if(R){M[E++]=268435456|rr[D]<<18|xo[R];var K=31&rr[D],V=31&xo[R];T+=ra[K]+oa[V],++b[257+K],++I[V],O=h+D,++x}else M[E++]=t[h],++b[t[h]]}}u=_o(t,l,a,M,b,I,T,E,k,h-k,u),!a&&7&u&&(u=dr(l,u+1,dt))}return De(s,0,r+vn(u)+i)},Fl=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),da=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=Fl[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},To=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,a=0|n.length,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=r+=n[o];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}t=r,e=i},d:function(){return(255&(t%=65521))<<24|t>>>8<<16|(255&(e%=65521))<<8|e>>>8}}},Lt=function(t,e,n,r,i){return Dl(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!i)},bn=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},Pl=function(t,e,n){for(var r=t(),i=t.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<r.length;++o){var s=r[o],l=a[o];if("function"==typeof s){e+=";"+l+"=";var u=s.toString();if(s.prototype)if(-1!=u.indexOf("[native code]")){var h=u.indexOf(" ",8)+1;e+=u.slice(h,u.indexOf("(",h))}else for(var c in e+=u,s.prototype)e+=";"+l+".prototype."+c+"="+s.prototype[c].toString();else e+=u}else n[l]=s}return[e,n]},cr=[],uf=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},Cl=function(t,e,n,r){var i;if(!cr[n]){for(var a="",o={},s=t.length-1,l=0;l<s;++l)a=(i=Pl(t[l],a,o))[0],o=i[1];cr[n]=Pl(t[s],a,o)}var u=bn({},cr[n][1]);return of(cr[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,uf(u),r)},ca=function(){return[W,me,ia,ra,oa,gn,wo,Ol,Al,Sl,yn,El,Ee,or,Le,sr,vn,De,D,kn,fa,jt,Io]},pa=function(){return[W,me,ia,ra,oa,gn,rr,xo,zl,lt,Nl,sa,yn,Ll,dt,Ee,Ze,ua,ur,lr,jo,la,dr,_o,vn,De,Dl,Lt,Mn,jt]},Rl=function(){return[zo,No,X,da,Fl]},Bl=function(){return[Ao,Vl]},ql=function(){return[So,X,To]},Gl=function(){return[Ul]},jt=function(t){return postMessage(t,[t.buffer])},Io=function(t){return t&&t.size&&new W(t.size)},ha=function(t,e,n,r,i,a){var o=Cl(n,r,i,(function(t,e){o.terminate(),a(t,e)}));return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Fe=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){return t.push(e.data[0],e.data[1])}},ma=function(t,e,n,r,i){var a,o=Cl(t,r,i,(function(t,n){t?(o.terminate(),e.ondata.call(e,t)):(n[1]&&o.terminate(),e.ondata.call(e,t,n[0],n[1]))}));o.postMessage(n),e.push=function(t,n){e.ondata||D(5),a&&e.ondata(D(4,0,1),null,!!n),o.postMessage([t,a=n],[t.buffer])},e.terminate=function(){o.terminate()}},ve=function(t,e){return t[e]|t[e+1]<<8},te=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},Oo=function(t,e){return te(t,e)+4294967296*te(t,e+4)},X=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},zo=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&X(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},Ao=function(t){(31!=t[0]||139!=t[1]||8!=t[2])&&D(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=t[10]|2+(t[11]<<8));for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(2&e)},Vl=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},No=function(t){return 10+(t.filename&&t.filename.length+1||0)},So=function(t,e){var n=e.level,r=0==n?0:n<6?1:9==n?3:2;t[0]=120,t[1]=r<<6|(r?32-2*r:1)},Ul=function(t){(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&D(6,"invalid zlib data"),32&t[1]&&D(6,"invalid zlib data: preset dictionaries not supported")},Qe=function(){function t(t,e){!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{}}return t.prototype.p=function(t,e){this.ondata(Lt(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){this.ondata||D(5),this.d&&D(4),this.d=e,this.p(t,e||!1)},t}(),$l=function(t,e){ma([pa,function(){return[Fe,Qe]}],this,Eo.call(this,t,e),(function(t){var e=new Qe(t.data);onmessage=Fe(e)}),6)},je=function(){function t(t){this.s={},this.p=new W(0),this.ondata=t}return t.prototype.e=function(t){this.ondata||D(5),this.d&&D(4);var e=this.p.length,n=new W(e+t.length);n.set(this.p),n.set(t,e),this.p=n},t.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,n=kn(this.p,this.o,this.s);this.ondata(De(n,e,this.s.b),this.d),this.o=De(n,this.s.b-32768),this.s.b=this.o.length,this.p=De(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),Lo=function(t){this.ondata=t,ma([ca,function(){return[Fe,je]}],this,0,(function(){var t=new je;onmessage=Fe(t)}),7)},Fo=function(){function t(t,e){this.c=da(),this.l=0,this.v=1,Qe.call(this,t,e)}return t.prototype.push=function(t,e){Qe.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=Lt(t,this.o,this.v&&No(this.o),e&&8,!e);this.v&&(zo(n,this.o),this.v=0),e&&(X(n,n.length-8,this.c.d()),X(n,n.length-4,this.l)),this.ondata(n,e)},t}(),lf=function(t,e){ma([pa,Rl,function(){return[Fe,Qe,Fo]}],this,Eo.call(this,t,e),(function(t){var e=new Fo(t.data);onmessage=Fe(e)}),8)},pr=function(){function t(t){this.v=1,je.call(this,t)}return t.prototype.push=function(t,e){if(je.prototype.e.call(this,t),this.v){var n=this.p.length>3?Ao(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}e&&(this.p.length<8&&D(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),je.prototype.c.call(this,e)},t}(),Hl=function(t){this.ondata=t,ma([ca,Bl,function(){return[Fe,je,pr]}],this,0,(function(){var t=new pr;onmessage=Fe(t)}),9)},Co=function(){function t(t,e){this.c=To(),this.v=1,Qe.call(this,t,e)}return t.prototype.push=function(t,e){Qe.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=Lt(t,this.o,this.v&&2,e&&4,!e);this.v&&(So(n,this.o),this.v=0),e&&X(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),cf=function(t,e){ma([pa,ql,function(){return[Fe,Qe,Co]}],this,Eo.call(this,t,e),(function(t){var e=new Co(t.data);onmessage=Fe(e)}),10)},mr=function(){function t(t){this.v=1,je.call(this,t)}return t.prototype.push=function(t,e){if(je.prototype.e.call(this,t),this.v){if(this.p.length<2&&!e)return;this.p=this.p.subarray(2),this.v=0}e&&(this.p.length<4&&D(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),je.prototype.c.call(this,e)},t}(),Kl=function(t){this.ondata=t,ma([ca,Gl,function(){return[Fe,je,mr]}],this,0,(function(){var t=new mr;onmessage=Fe(t)}),11)},Yl=function(){function t(t){this.G=pr,this.I=je,this.Z=mr,this.ondata=t}return t.prototype.push=function(t,e){if(this.ondata||D(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new W(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;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,e),this.p=null}}},t}(),hf=function(){function t(t){this.G=Hl,this.I=Lo,this.Z=Kl,this.ondata=t}return t.prototype.push=function(t,e){Yl.prototype.push.call(this,t,e)},t}(),Bo=function(t,e,n,r){for(var i in t){var a=t[i],o=e+i,s=r;Array.isArray(a)&&(s=bn(r,a[1]),a=a[0]),a instanceof W?n[o]=[a,s]:(n[o+="/"]=[new W(0),s],Bo(a,o,n,r))}},Zl="undefined"!=typeof TextEncoder&&new TextEncoder,qo="undefined"!=typeof TextDecoder&&new TextDecoder,Ql=0;try{qo.decode(dt,{stream:!0}),Ql=1}catch(t){}ed=function(t){for(var e="",n=0;;){var r=t[n++],i=(r>127)+(r>223)+(r>239);if(n+i>t.length)return[e,De(t,n-1)];i?3==i?(r=((15&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=1&i?String.fromCharCode((31&r)<<6|63&t[n++]):String.fromCharCode((15&r)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(r)}},gf=function(){function t(t){this.ondata=t,Ql?this.t=new TextDecoder:this.p=dt}return t.prototype.push=function(t,e){if(this.ondata||D(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&D(8),this.t=null));this.p||D(4);var n=new W(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=ed(n),i=r[0],a=r[1];e?(a.length&&D(8),this.p=null):this.p=a,this.ondata(i,e)},t}(),yf=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||D(5),this.d&&D(4),this.ondata(_t(t),this.d=e||!1)},t}(),td=function(t){return 1==t?3:t<6?2:9==t?1:0},ad=function(t,e){return e+30+ve(t,e+26)+ve(t,e+28)},nd=function(t,e,n){var r=ve(t,e+28),i=Go(t.subarray(e+46,e+46+r),!(2048&ve(t,e+8))),a=e+46+r,o=te(t,e+20),s=n&&4294967295==o?id(t,a):[o,te(t,e+24),te(t,e+42)],l=s[0],u=s[1],h=s[2];return[ve(t,e+10),l,u,i,a+ve(t,e+30)+ve(t,e+32),h]},id=function(t,e){for(;1!=ve(t,e);e+=4+ve(t,e+2));return[Oo(t,e+12),Oo(t,e+4),Oo(t,e+20)]},Tt=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&D(9),e+=r+4}return e},ga=function(t,e,n,r,i,a,o,s){var l=r.length,u=n.extra,h=s&&s.length,c=Tt(u);X(t,e,null!=o?33639248:67324752),e+=4,null!=o&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(null==a&&8),t[e++]=i&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var d=new Date(null==n.mtime?Date.now():n.mtime),f=d.getFullYear()-1980;if((f<0||f>119)&&D(10),X(t,e,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),e+=4,null!=a&&(X(t,e,n.crc),X(t,e+4,a),X(t,e+8,n.size)),X(t,e+12,l),X(t,e+14,c),e+=16,null!=o&&(X(t,e,h),X(t,e+6,n.attrs),X(t,e+10,o),e+=14),t.set(r,e),e+=l,c)for(var p in u){var m=u[p],g=m.length;X(t,e,+p),X(t,e+2,g),t.set(m,e+4),e+=4+g}return h&&(t.set(s,e),e+=h),e},Vo=function(t,e,n,r,i){X(t,e,101010256),X(t,e+8,n),X(t,e+10,n),X(t,e+12,r),X(t,e+16,i)},wn=function(){function t(t){this.filename=t,this.c=da(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||D(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),vf=function(){function t(t,e){var n=this;e||(e={}),wn.call(this,t),this.d=new Qe(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=td(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){wn.prototype.push.call(this,t,e)},t}(),kf=function(){function t(t,e){var n=this;e||(e={}),wn.call(this,t),this.d=new $l(e,(function(t,e,r){n.ondata(t,e,r)})),this.compression=8,this.flag=td(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){wn.prototype.push.call(this,t,e)},t}(),bf=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||D(5),2&this.d)this.ondata(D(4+8*(1&this.d),0,1),null,!1);else{var n=_t(t.filename),r=n.length,i=t.comment,a=i&&_t(i),o=r!=t.filename.length||a&&i.length!=a.length,s=r+Tt(t.extra)+30;r>65535&&this.ondata(D(11,0,1),null,!1);var l=new W(s);ga(l,0,t,n,o);var u=[l],h=function(){for(var t=0,n=u;t<n.length;t++){var r=n[t];e.ondata(null,r,!1)}u=[]},c=this.d;this.d=0;var d=this.u.length,f=bn(t,{f:n,u:o,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(h(),c){var t=e.u[d+1];t?t.r():e.d=1}c=1}}),p=0;t.ondata=function(n,r,i){if(n)e.ondata(n,r,i),e.terminate();else if(p+=r.length,u.push(r),i){var a=new W(16);X(a,0,134695760),X(a,4,t.crc),X(a,8,p),X(a,12,t.size),u.push(a),f.c=p,f.b=s+p+16,f.crc=t.crc,f.size=t.size,c&&f.r(),c=1}else c&&h()},this.u.push(f)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(D(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){!(1&t.d)||(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,r=0,i=this.u;r<i.length;r++){n+=46+(l=i[r]).f.length+Tt(l.extra)+(l.o?l.o.length:0)}for(var a=new W(n+22),o=0,s=this.u;o<s.length;o++){var l=s[o];ga(a,t,l,l.f,l.u,l.c,e,l.o),t+=46+l.f.length+Tt(l.extra)+(l.o?l.o.length:0),e+=l.b}Vo(a,t,this.u.length,n,e),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++){e[t].t()}this.d=2},t}(),rd=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),xf=function(){function t(){var t=this;this.i=new je((function(e,n){t.ondata(null,e,n)}))}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}(),jf=function(){function t(t,e){var n=this;e<32e4?this.i=new je((function(t,e){n.ondata(null,t,e)})):(this.i=new Lo((function(t,e,r){n.ondata(t,e,r)})),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=De(t,0)),this.i.push(t,e)},t.compression=8,t}(),_f=function(){function t(t){this.onfile=t,this.k=[],this.o={0:rd},this.p=dt}return t.prototype.push=function(t,e){var n=this;if(this.onfile||D(5),this.p||D(4),this.c>0){var r=Math.min(this.c,t.length),i=t.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),(t=t.subarray(r)).length)return this.push(t,e)}else{var a=0,o=0,s=void 0,l=void 0;this.p.length?t.length?((l=new W(this.p.length+t.length)).set(this.p),l.set(t,this.p.length)):l=this.p:l=t;for(var u=l.length,h=this.c,c=h&&this.d,d=function(){var t,e=te(l,o);if(67324752==e){a=1,s=o,f.d=null,f.c=0;var r=ve(l,o+6),i=ve(l,o+8),c=2048&r,d=8&r,p=ve(l,o+26),m=ve(l,o+28);if(u>o+30+p+m){var g=[];f.k.unshift(g),a=2;var y=te(l,o+18),v=te(l,o+22),_=Go(l.subarray(o+30,o+=30+p),!c);4294967295==y?(t=d?[-2]:id(l,o),y=t[0],v=t[1]):d&&(y=-1),o+=m,f.c=y;var w,M={name:_,compression:i,start:function(){if(M.ondata||D(5),y){var t=n.o[i];t||M.ondata(D(14,"unknown compression type "+i,1),null,!1),(w=y<0?new t(_):new t(_,y,v)).ondata=function(t,e,n){M.ondata(t,e,n)};for(var e=0,r=g;e<r.length;e++){var a=r[e];w.push(a,!1)}n.k[0]==g&&n.c?n.d=w:w.push(dt,!0)}else M.ondata(null,dt,!0)},terminate:function(){w&&w.terminate&&w.terminate()}};y>=0&&(M.size=y,M.originalSize=v),f.onfile(M)}return"break"}if(h){if(134695760==e)return s=o+=12+(-2==h&&8),a=3,f.c=0,"break";if(33639248==e)return s=o-=4,a=3,f.c=0,"break"}},f=this;o<u-4;++o){if("break"===d())break}if(this.p=dt,h<0){var p=a?l.subarray(0,s-12-(-2==h&&8)-(134695760==te(l,s-16)&&4)):l.subarray(0,o);c?c.push(p,!!a):this.k[+(2==a)].push(p)}if(2&a)return this.push(l.subarray(o),e);this.p=l.subarray(o)}e&&(this.c&&D(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}(),gr="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()}}));f();var ud=vr(Zo());f(),f(),f();var tu=vr(Qs());f();var eu=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:r=0,distance:i=0,angle:a=0}){let o,s;if(m(this,"origin"),m(this,"destination"),m(this,"vortex"),m(this,"distance"),m(this,"angle"),m(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=i,this.angle=a,n?(this.distance=0,this.angle=0,o=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,s=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=r*s+o):(o=e.weight&&e.weight>=0?e.weight:0,s=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*s+o),isNaN(this.angle))throw new Error("nan angle")}},_i=eu;f();var Ur="mi-debug",Qh={loggingEnabled(){var t;return"development"===j.env.NODE_ENV||"dev"===j.env.NODE_ENV||"test"===j.env.NODE_ENV||"true"===(null==(t=globalThis.sessionStorage)?void 0:t.getItem(Ur))},log(...t){this.loggingEnabled()&&console.log("[MappedInJS]",...t)},warn(...t){this.loggingEnabled()&&console.warn("[MappedInJS]",...t)},error(...t){this.loggingEnabled()&&console.error("[MappedInJS]",...t)},assert(...t){this.loggingEnabled()&&console.assert(...t)},time(t){this.loggingEnabled()&&console.time(t)},timeEnd(t){this.loggingEnabled()&&console.timeEnd(t)}},E=Qh;function em(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error(`map ${t.name||t.shortName||t.id} does not have a georeference field`);if(t.georeference.length<3)throw new Error(`map ${t.name||t.shortName||t.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let e=t.georeference[0],n=t.georeference[2],r=(0,tu.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),i=e.control.x-n.control.x,a=e.control.y-n.control.y;return Math.sqrt(i*i+a*a)/r}catch(t){return E.error(t),1}}function tm(t,e){let n=t.x-e.x,r=t.y-e.y;return(Math.atan2(r,n)+2.5*Math.PI)%(2*Math.PI)}var ae,Me,pt,au=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:r=!1}){m(this,"edges"),m(this,"nodesById"),m(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:em(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let i=t.filter((t=>!!this.mapsById[t.map])).map((t=>({...t,paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=i.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let a=e.map((t=>({...t,name:r?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));i.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e})=>{let n=this.nodesById[e];return new _i({angle:tm(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),a.forEach((t=>{if(null==t.nodes||0===t.nodes.length)return;let e=0;for(;e<t.nodes.length-1;){let n=this.nodesById[t.nodes[e]];if(e++,null==n)continue;let r=e;for(;r<t.nodes.length;){let e=this.nodesById[t.nodes[r]];if(r++,null==e)continue;let i=this.mapsById[n.map].elevation||0,a=this.mapsById[e.map].elevation||0,o=Math.abs(i-a);this.edges[n.id].push(new _i({destination:e,elevationDelta:o,origin:n,vortex:t})),this.edges[e.id].push(new _i({destination:n,elevationDelta:o,origin:e,vortex:t}))}}}))}aStar(t,e,n){let r=t.map((t=>this.nodesById[t])).filter((t=>t)),i=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===r.length||0===i.length)return[];let a=[],o={},s={};for(r.forEach((t=>{let e=this.getShortestEuclideanDistance(t,i);a.push({origin:t,priority:e}),o[t.id]=null,s[t.id]=0})),a.sort(((t,e)=>t.priority-e.priority));a.length>0;){let t=a[0];if(i.includes(t.origin)){let e=[],n=o[t.origin.id];for(;null!=n;){e.push(n);let t=o[n.origin.id];n=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let r=e.vortex&&!1===e.vortex.accessible;if(n&&(r||!1===e.origin.accessible||!1===e.destination.accessible))continue;let l=s[t.origin.id]+e.weight;if(null==s[e.destination.id]||l<s[e.destination.id]){s[e.destination.id]=l;let t=l+this.getShortestEuclideanDistance(e.destination,i);a.push({origin:e.destination,priority:t}),o[e.destination.id]=e}}a.splice(0,1),a.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let n,r=t.x-e.x,i=t.y-e.y,a=r*r+i*i;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(a)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let r=this.getDistance(t,n);return Math.min(e,r)}),Number.MAX_VALUE)}},$r=au;function am(t){switch(t){case pt.DOWN:case pt.UP:return`${t} `;default:return""}}f(),f(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}(ae||(ae={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(Me||(Me={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(pt||(pt={}));var Ti,nu=class{constructor({origin:t,action:e,distance:n,atLocation:r,instruction:i}){m(this,"node"),m(this,"instruction"),m(this,"action"),m(this,"atLocation"),m(this,"type"),m(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=r,this.instruction="",i?this.instruction=i:(null!=e&&e.type===ae.DEPARTURE?this.instruction=null!=r?`Depart from ${r.name}`:"Depart from current location":null!=e&&e.type===ae.ARRIVAL?this.instruction=null!=r?`Arrive at ${r.name}`:"Arrive at destination":null!=e&&e.type===ae.TAKEVORTEX?this.instruction=`Take ${r&&r.name} ${am(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===ae.EXITVORTEX?this.instruction=`Exit ${r&&r.name} at ${e.toMap.name}`:null!=e&&e.bearing===Me.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===Me.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===Me.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===Me.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===Me.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===ae.TURN&&r&&(this.instruction+=` at ${r.name}`))}},ht=nu;(Ti||(Ti={})).NO_VALID_PATH="No Valid Path Available";var Ii=.1*Math.PI;function Oi(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var iu=class{constructor({locations:t,nodes:e,vortexes:n,maps:r,showVortexNames:i}){m(this,"graph"),m(this,"locationsByNodeId"),this.graph=new $r({maps:r,nodes:e,showVortexNames:i,vortexes:n}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((n=>{t[n.node]=e})),e.polygons&&e.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{t[n]=e}))})),t)),{})}getClosestLocationInRay(t,e=.5*Math.PI,n=10){let r=0,i=0,a=t;for(;Math.abs(r)<e&&i<n;){let t=this.graph.edges[a.destination.id],o=null,s=0;for(let e of t)if(e.distance>0)if(null!=o){let t=-Oi(a.angle,e.angle);Math.abs(t)<Math.abs(s)&&(o=e,s=t)}else o=e,s=-Oi(a.angle,e.angle);if(null==o)return null;{if(Math.abs(s)>=e||(r+=s,i+=o.distance,Math.abs(r)>=e||i>n))return null;let t=this.locationsByNodeId[o.destination.id];if(null!=t)return t;a=o}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:n,departFrom:r,arriveAt:i}){let a=this.graph.aStar(t,e,n);if(0===a.length)return{distance:0,instructions:[new ht({distance:0,instruction:Ti.NO_VALID_PATH})],path:[]};let o=0,s=new Array(a.length+1);for(let t=0;t<a.length;t++)s[t]=a[t].origin;s[a.length]=a[a.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let t=0;t<a.length;t++){let e=a[t],n=e.origin,s=e.destination;if(o+=e.distance,c+=(null==h?void 0:h.distance)||0,0===t&&l.push(new ht({action:{type:ae.DEPARTURE},atLocation:r,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],r=this.graph.mapsById[s.map],i=pt.NONE;if(null!=t.elevation&&null!=r.elevation){let e=t.elevation-r.elevation;e>0?i=pt.DOWN:e<0&&(i=pt.UP)}l.push(new ht({action:{direction:i,fromMap:t,toMap:r,type:ae.TAKEVORTEX},atLocation:e.vortex,distance:c,origin:n})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let t=this.graph.mapsById[u.map],e=this.graph.mapsById[h.destination.map];l.push(new ht({action:{fromMap:t,toMap:e,type:ae.EXITVORTEX},atLocation:h.vortex,distance:c,origin:n})),d+=c,c=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==u&&t.destination!==e.destination));if(t.length>0){let r=-Oi(h.angle,e.angle),i=t.reduce(((t,n)=>{let r=-Oi(e.angle,n.angle);return Math.min(t,Math.abs(r))}),Math.PI);if(Math.abs(r)>=Ii||Math.abs(i)<=Ii){let t;t=r<=-Math.PI/4?Me.RIGHT:r<=-Ii?Me.SLIGHTRIGHT:r<=Ii?Me.STRAIGHT:r<=Math.PI/4?Me.SLIGHTLEFT:Me.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let r=new ht({action:{bearing:t,referencePosition:"At",type:ae.TURN},atLocation:e,distance:c,origin:n});r.type=t,l.push(r)}else l.push(new ht({action:{bearing:t,referencePosition:"At",type:ae.TURN},distance:c,origin:n}));d+=c,c=0}}}t===a.length-1&&(l.push(new ht({action:{type:ae.ARRIVAL},atLocation:i,distance:o-d<0?0:o-d,origin:e.destination})),d+=c,c=0),u=n,h=e}let f=[],p=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:n}=e;n&&n.type===ae.TAKEVORTEX?(p=e.node,f.unshift(e)):n&&n.type===ae.TURN&&null!=p?this.graph.getDistance(e.node,p)>5&&f.unshift(e):f.unshift(e)}return{distance:o,instructions:f,path:s}}},Wr=iu;function ru(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return ou(this.cover(e,n),e,n,t)}function ou(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a,o,s,l,u,h,c,d,f=t._root,p={data:r},m=t._x0,g=t._y0,y=t._x1,v=t._y1;if(!f)return t._root=p,t;for(;f.length;)if((u=e>=(a=(m+y)/2))?m=a:y=a,(h=n>=(o=(g+v)/2))?g=o:v=o,i=f,!(f=f[c=h<<1|u]))return i[c]=p,t;if(s=+t._x.call(null,f.data),l=+t._y.call(null,f.data),e===s&&n===l)return p.next=f,i?i[c]=p:t._root=p,t;do{i=i?i[c]=new Array(4):t._root=new Array(4),(u=e>=(a=(m+y)/2))?m=a:y=a,(h=n>=(o=(g+v)/2))?g=o:v=o}while((c=h<<1|u)==(d=(l>=o)<<1|s>=a));return i[d]=f,i[c]=p,t}function su(t){var e,n,r,i,a=t.length,o=new Array(a),s=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,e=t[n]))||isNaN(i=+this._y.call(null,e))||(o[n]=r,s[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)ou(this,o[n],s[n],t[n]);return this}function uu(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var o,s,l=i-n||1,u=this._root;n>t||t>=i||r>e||e>=a;)switch(s=(e<r)<<1|t<n,o=new Array(4),o[s]=u,u=o,l*=2,s){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 lu(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function du(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function oe(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function cu(t,e,n){var r,i,a,o,s,l,u,h=this._x0,c=this._y0,d=this._x1,f=this._y1,p=[],m=this._root;for(m&&p.push(new oe(m,h,c,d,f)),null==n?n=1/0:(h=t-n,c=e-n,d=t+n,f=e+n,n*=n);l=p.pop();)if(!(!(m=l.node)||(i=l.x0)>d||(a=l.y0)>f||(o=l.x1)<h||(s=l.y1)<c))if(m.length){var g=(i+o)/2,y=(a+s)/2;p.push(new oe(m[3],g,y,o,s),new oe(m[2],i,y,g,s),new oe(m[1],g,a,o,y),new oe(m[0],i,a,g,y)),(u=(e>=y)<<1|t>=g)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=l)}else{var v=t-+this._x.call(null,m.data),_=e-+this._y.call(null,m.data),w=v*v+_*_;if(w<n){var M=Math.sqrt(n=w);h=t-M,c=e-M,d=t+M,f=e+M,r=m.data}}return r}function pu(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,r,i,a,o,s,l,u,h,c,d,f=this._root,p=this._x0,m=this._y0,g=this._x1,y=this._y1;if(!f)return this;if(f.length)for(;;){if((u=a>=(s=(p+g)/2))?p=s:g=s,(h=o>=(l=(m+y)/2))?m=l:y=l,e=f,!(f=f[c=h<<1|u]))return this;if(!f.length)break;(e[c+1&3]||e[c+2&3]||e[c+3&3])&&(n=e,d=c)}for(;f.data!==t;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):e?(i?e[c]=i:delete e[c],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[d]=f:this._root=f),this):(this._root=i,this)}function hu(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function mu(){return this._root}function fu(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function gu(t){var e,n,r,i,a,o,s=[],l=this._root;for(l&&s.push(new oe(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,r=e.x0,i=e.y0,a=e.x1,o=e.y1)&&l.length){var u=(r+a)/2,h=(i+o)/2;(n=l[3])&&s.push(new oe(n,u,h,a,o)),(n=l[2])&&s.push(new oe(n,r,h,u,o)),(n=l[1])&&s.push(new oe(n,u,i,a,h)),(n=l[0])&&s.push(new oe(n,r,i,u,h))}return this}function yu(t){var e,n=[],r=[];for(this._root&&n.push(new oe(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var a,o=e.x0,s=e.y0,l=e.x1,u=e.y1,h=(o+l)/2,c=(s+u)/2;(a=i[0])&&n.push(new oe(a,o,s,h,c)),(a=i[1])&&n.push(new oe(a,h,s,l,c)),(a=i[2])&&n.push(new oe(a,o,c,h,u)),(a=i[3])&&n.push(new oe(a,h,c,l,u))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}function vu(t){return t[0]}function ku(t){return arguments.length?(this._x=t,this):this._x}function bu(t){return t[1]}function Mu(t){return arguments.length?(this._y=t,this):this._y}function Ta(t,e,n){var r=new Hr(null==e?vu:e,null==n?bu:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Hr(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function wu(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f(),f();var ge=Ta.prototype=Hr.prototype;ge.copy=function(){var t,e,n=new Hr(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=wu(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=wu(e));return n},ge.add=ru,ge.addAll=su,ge.cover=uu,ge.data=lu,ge.extent=du,ge.find=cu,ge.remove=pu,ge.removeAll=hu,ge.root=mu,ge.size=fu,ge.visit=gu,ge.visitAfter=yu,ge.x=ku,ge.y=Mu;var Ve,ne,Ot=class{constructor(t){T(this,Ve,void 0),m(this,"categories"),m(this,"locations"),m(this,"vortexes"),m(this,"maps"),m(this,"nodes"),m(this,"polygons"),m(this,"events"),m(this,"mapGroups"),m(this,"locationStates"),m(this,"rankings"),T(this,ne,{}),I(this,Ve,t)}get polygonsByMapId(){if(p(this,ne).polygonsByMapId)return p(this,ne).polygonsByMapId;let t,e={};for(let n=0,r=p(this,Ve).polygons.length;n<r;++n)t=p(this,Ve).polygons[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return p(this,ne).polygonsByMapId=n,p(this,ne).polygonsByMapId}get nodesByMapId(){if(p(this,ne).nodesByMapId)return p(this,ne).nodesByMapId;let t,e={};for(let n=0,r=p(this,Ve).nodes.length;n<r;++n)t=p(this,Ve).nodes[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return p(this,ne).nodesByMapId=n,p(this,ne).nodesByMapId}findNearestNodeOnMap(t,e){var n;if(p(this,ne).nodeTreesByMap||(p(this,ne).nodeTreesByMap=new Map),!p(this,ne).nodeTreesByMap.has(t)){let e=null!=(n=this.nodesByMapId.get(t))?n:[],r=Ta();r.x((t=>t.x)),r.y((t=>t.y)),r.addAll(e),p(this,ne).nodeTreesByMap.set(t,r)}return p(this,ne).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(p(this,ne).locationsByMapId)return p(this,ne).locationsByMapId;let t,e={};for(let n=0,r=p(this,Ve).locations.length;n<r;++n){t=p(this,Ve).locations[n];for(let n=0,r=t.polygons.length;n<r;++n)e[t.polygons[n].map.id]||(e[t.polygons[n].map.id]=[]),e[t.polygons[n].map.id].push(t)}let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return p(this,ne).locationsByMapId=n,p(this,ne).locationsByMapId}static create(t){return Ot.instances.has(t)||Ot.instances.set(t,new Ot(t)),Ot.instances.get(t)}static clear(){Ot.instances.clear()}},Jr=Ot;Ve=new WeakMap,ne=new WeakMap,m(Jr,"instances",new Map);var _e=Jr;f(),f(),f(),f();var xu=" ",ye=class{static get separator(){return xu}static set separator(t){xu=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);let e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let n=null;switch(e.length){case 3:n=e[0]/1+e[1]/60+e[2]/3600;break;case 2:n=e[0]/1+e[1]/60;break;case 1:n=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(n=-n),Number(n)}static toDms(t,e="d",n){if(isNaN(t)||"string"==typeof t&&""==t.trim()||"boolean"==typeof t||t==1/0||null==t)return null;if(void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="d",n=4}t=Math.abs(t);let r=null,i=null,a=null,o=null;switch(e){default:case"d":case"deg":i=t.toFixed(n),i<100&&(i="0"+i),i<10&&(i="0"+i),r=i+"°";break;case"dm":case"deg+min":i=Math.floor(t),a=(60*t%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),i=("000"+i).slice(-3),a<10&&(a="0"+a),r=i+"°"+ye.separator+a+"′";break;case"dms":case"deg+min+sec":i=Math.floor(t),a=Math.floor(3600*t/60)%60,o=(3600*t%60).toFixed(n),60==o&&(o=(0).toFixed(n),a++),60==a&&(a=0,i++),i=("000"+i).slice(-3),a=("00"+a).slice(-2),o<10&&(o="0"+o),r=i+"°"+ye.separator+a+"′"+ye.separator+o+"″"}return r}static toLat(t,e,n){let r=ye.toDms(ye.wrap90(t),e,n);return null===r?"–":r.slice(1)+ye.separator+(t<0?"S":"N")}static toLon(t,e,n){let r=ye.toDms(ye.wrap180(t),e,n);return null===r?"–":r+ye.separator+(t<0?"W":"E")}static toBrng(t,e,n){let r=ye.toDms(ye.wrap360(t),e,n);return null===r?"–":r.replace("360","0")}static fromLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=ye.wrap360(t);let n=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*n/360)%n*16/n]}static wrap360(t){return 0<=t&&t<360?t:(t%360+360)%360}static wrap180(t){return-180<t&&t<=180?t:(t+540)%360-180}static wrap90(t){return-90<=t&&t<=90?t:Math.abs((t%360+270)%360-180)-90}};Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var $=ye,Z=Math.PI,L=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=$.wrap90(Number(t)),this._lon=$.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?$.wrap90($.parse(t)):$.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?$.wrap90($.parse(t)):$.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?$.wrap180($.parse(t)):$.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?$.wrap180($.parse(t)):$.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?$.wrap180($.parse(t)):$.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,n;if(2==t.length&&([e,n]=t,e=$.wrap90($.parse(e)),n=$.wrap180($.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,n]=t[0].split(","),e=$.wrap90($.parse(e)),n=$.wrap180($.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let r=t[0];if("Point"==r.type&&Array.isArray(r.coordinates)?[n,e]=r.coordinates:(null!=r.latitude&&(e=r.latitude),null!=r.lat&&(e=r.lat),null!=r.longitude&&(n=r.longitude),null!=r.lng&&(n=r.lng),null!=r.lon&&(n=r.lon),e=$.wrap90($.parse(e)),n=$.wrap180($.parse(n))),isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${t.toString()}’`);return new L(e,n)}distanceTo(t,e=6371e3){if(t instanceof L||(t=L.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,r=this.lat.toRadians(),i=this.lon.toRadians(),a=t.lat.toRadians(),o=a-r,s=t.lon.toRadians()-i,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r)*Math.cos(a)*Math.sin(s/2)*Math.sin(s/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof L||(t=L.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),i=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(r),a=Math.sin(r)*Math.cos(n),o=Math.atan2(a,i).toDegrees();return $.wrap360(o)}finalBearingTo(t){t instanceof L||(t=L.parse(t));let e=t.initialBearingTo(this)+180;return $.wrap360(e)}midpointTo(t){t instanceof L||(t=L.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),i=(t.lon-this.lon).toRadians(),a=Math.cos(e),o=0,s=Math.sin(e),l={x:a+Math.cos(r)*Math.cos(i),y:o+Math.cos(r)*Math.sin(i),z:s+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 L(c,d)}intermediatePointTo(t,e){if(t instanceof L||(t=L.parse(t)),this.equals(t))return new L(this.lat,this.lon);let n=this.lat.toRadians(),r=this.lon.toRadians(),i=t.lat.toRadians(),a=t.lon.toRadians(),o=i-n,s=a-r,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(n)*Math.cos(i)*Math.sin(s/2)*Math.sin(s/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-e)*u)/Math.sin(u),c=Math.sin(e*u)/Math.sin(u),d=h*Math.cos(n)*Math.cos(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),m=Math.atan2(p,Math.sqrt(d*d+f*f)),g=Math.atan2(f,d),y=m.toDegrees(),v=g.toDegrees();return new L(y,v)}destinationPoint(t,e,n=6371e3){let r=t/n,i=Number(e).toRadians(),a=this.lat.toRadians(),o=this.lon.toRadians(),s=Math.sin(a)*Math.cos(r)+Math.cos(a)*Math.sin(r)*Math.cos(i),l=Math.asin(s),u=Math.sin(i)*Math.sin(r)*Math.cos(a),h=Math.cos(r)-Math.sin(a)*s,c=o+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new L(d,f)}static intersection(t,e,n,r){if(t instanceof L||(t=L.parse(t)),n instanceof L||(n=L.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(r))throw new TypeError(`invalid brng2 ‘${r}’`);let i=t.lat.toRadians(),a=t.lon.toRadians(),o=n.lat.toRadians(),s=n.lon.toRadians(),l=Number(e).toRadians(),u=Number(r).toRadians(),h=o-i,c=s-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(i)*Math.cos(o)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new L(t.lat,t.lon);let f=(Math.sin(o)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),p=(Math.sin(i)-Math.sin(o)*Math.cos(d))/(Math.sin(d)*Math.cos(o)),m=Math.acos(Math.min(Math.max(f,-1),1)),g=Math.acos(Math.min(Math.max(p,-1),1)),y=l-(Math.sin(s-a)>0?m:2*Z-m),v=(Math.sin(s-a)>0?2*Z-g:g)-u;if(0==Math.sin(y)&&0==Math.sin(v)||Math.sin(y)*Math.sin(v)<0)return null;let _=-Math.cos(y)*Math.cos(v)+Math.sin(y)*Math.sin(v)*Math.cos(d),w=Math.atan2(Math.sin(d)*Math.sin(y)*Math.sin(v),Math.cos(v)+Math.cos(y)*_),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)),I=M.toDegrees(),x=b.toDegrees();return new L(I,x)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof L||(t=L.parse(t)),e instanceof L||(e=L.parse(e));let r=n;if(this.equals(t))return 0;let i=t.distanceTo(this,r)/r,a=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(i)*Math.sin(a-o))*r}alongTrackDistanceTo(t,e,n=6371e3){t instanceof L||(t=L.parse(t)),e instanceof L||(e=L.parse(e));let r=n;if(this.equals(t))return 0;let i=t.distanceTo(this,r)/r,a=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians(),s=Math.asin(Math.sin(i)*Math.sin(a-o));return Math.acos(Math.cos(i)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-a))*r}maxLatitude(t){let e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()}static crossingParallels(t,e,n){if(t.equals(e))return null;let r=Number(n).toRadians(),i=t.lat.toRadians(),a=t.lon.toRadians(),o=e.lat.toRadians(),s=e.lon.toRadians()-a,l=Math.sin(i)*Math.cos(o)*Math.cos(r)*Math.sin(s),u=Math.sin(i)*Math.cos(o)*Math.cos(r)*Math.cos(s)-Math.cos(i)*Math.sin(o)*Math.cos(r),h=Math.cos(i)*Math.cos(o)*Math.sin(r)*Math.sin(s);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(),m=f.toDegrees();return{lon1:$.wrap180(p),lon2:$.wrap180(m)}}rhumbDistanceTo(t,e=6371e3){t instanceof L||(t=L.parse(t));let n=e,r=this.lat.toRadians(),i=t.lat.toRadians(),a=i-r,o=Math.abs(t.lon-this.lon).toRadians();Math.abs(o)>Z&&(o=o>0?-(2*Z-o):2*Z+o);let s=Math.log(Math.tan(i/2+Z/4)/Math.tan(r/2+Z/4)),l=Math.abs(s)>1e-11?a/s:Math.cos(r);return Math.sqrt(a*a+l*l*o*o)*n}rhumbBearingTo(t){if(t instanceof L||(t=L.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians();Math.abs(r)>Z&&(r=r>0?-(2*Z-r):2*Z+r);let i=Math.log(Math.tan(n/2+Z/4)/Math.tan(e/2+Z/4)),a=Math.atan2(r,i).toDegrees();return $.wrap360(a)}rhumbDestinationPoint(t,e,n=6371e3){let r=this.lat.toRadians(),i=this.lon.toRadians(),a=Number(e).toRadians(),o=t/n,s=o*Math.cos(a),l=r+s;Math.abs(l)>Z/2&&(l=l>0?Z-l:-Z-l);let u=Math.log(Math.tan(l/2+Z/4)/Math.tan(r/2+Z/4)),h=Math.abs(u)>1e-11?s/u:Math.cos(r),c=i+o*Math.sin(a)/h,d=l.toDegrees(),f=c.toDegrees();return new L(d,f)}rhumbMidpointTo(t){t instanceof L||(t=L.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians();Math.abs(i-n)>Z&&(n+=2*Z);let a=(e+r)/2,o=Math.tan(Z/4+e/2),s=Math.tan(Z/4+r/2),l=Math.tan(Z/4+a/2),u=((i-n)*Math.log(l)+n*Math.log(s)-i*Math.log(o))/Math.log(s/o);isFinite(u)||(u=(n+i)/2);let h=a.toDegrees(),c=u.toDegrees();return new L(h,c)}static areaOf(t,e=6371e3){let n=e,r=t[0].equals(t[t.length-1]);r||t.push(t[0]);let i=t.length-1,a=0;for(let e=0;e<i;e++){let n=t[e].lat.toRadians(),r=t[e+1].lat.toRadians(),i=(t[e+1].lon-t[e].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(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let r=0;r<t.length-1;r++){let i=t[r].initialBearingTo(t[r+1]),a=t[r].finalBearingTo(t[r+1]);e+=(i-n+540)%360-180,e+=(a-i+540)%360-180,n=a}return e+=(t[0].initialBearingTo(t[1])-n+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*Z);let o=Math.abs(a*n*n);return r||t.pop(),o}equals(t){return t instanceof L||(t=L.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${$.toLat(this.lat,t,e)}, ${$.toLon(this.lon,t,e)}`}};f(),f(),f();var zi=class{constructor(t){m(this,"destinations",[]),this.destinations=t}};f();var Oa,at,Ia=class{constructor(t,e){T(this,Oa,void 0),T(this,at,void 0),m(this,"distance",0),m(this,"path",[]),m(this,"instructions",[]),I(this,at,t),I(this,Oa,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,r,i,a,o,s,l,u,h,c,d;let f={...t,action:{...t.action},atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(r=null==(n=p(this,at))?void 0:n._vortexesById)?void 0:r[t.atLocation.id]:void 0,node:(null==(i=t.node)?void 0:i.id)?null==(o=null==(a=p(this,at))?void 0:a._nodesById)?void 0:o[t.node.id]:void 0};return((null==(s=f.action)?void 0:s.type)===ae.TAKEVORTEX||(null==(l=f.action)?void 0:l.type)===ae.EXITVORTEX)&&(f.action.fromMap=null==(h=p(this,at)._mapsById)?void 0:h[null==(u=f.action)?void 0:u.fromMap.id],f.action.toMap=null==(d=p(this,at)._mapsById)?void 0:d[null==(c=f.action)?void 0:c.toMap.id]),f})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=p(this,at))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return p(this,Oa)}};Oa=new WeakMap,at=new WeakMap;var ft,mt=class{constructor(t){T(this,ft,void 0),I(this,ft,t)}directionsTo(t,e){if(t instanceof zi){let n=[],r=this;for(let i=0;i<t.destinations.length;i++){let a=t.destinations[i],o=za(r),s=za(a),l=p(this,ft).navigator.getDirections({originIds:o,destinationNodeIds:s,accessible:(null==e?void 0:e.accessible)||!1}),u=new Ia(p(this,ft),l);n.push(u),r=a}return n}{let n=za(this),r=za(t),i=p(this,ft).navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:(null==e?void 0:e.accessible)||!1});return new Ia(p(this,ft),i)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}};ft=new WeakMap;var nm=0,im="9999-12-31T00:00:00.000Z";function rm(t,e,n=new Date){if(!t.states)return;let r=n||new Date,i=t.states.find((t=>{let e=new Date(t.start||nm),n=new Date(t.end||im);return e<r&&n>r}));return i?e.find((t=>t.value===i.type)):void 0}var Ue,yt,Te,Aa,Na,Sa,Ea=class extends mt{constructor(t,e){super(t),T(this,Ue,void 0),T(this,yt,void 0),T(this,Te,{}),m(this,"states"),m(this,"id",""),m(this,"name",""),m(this,"type",""),m(this,"description"),m(this,"sortOrder"),m(this,"logo"),m(this,"phone"),m(this,"social"),m(this,"color"),m(this,"shortName"),m(this,"detailsUrl"),m(this,"tags"),m(this,"externalId"),m(this,"showLabelWhenImagePresent"),m(this,"picture"),m(this,"operationHours"),m(this,"siblingGroups"),m(this,"gallery"),T(this,Aa,void 0),T(this,Na,[]),T(this,Sa,void 0),I(this,Ue,t),I(this,yt,e);let n=Object.assign({},e);delete n.categories,Object.assign(this,n)}get polygons(){let t=p(this,Te).polygons;if(void 0!==t)return t;let e=[],n=p(this,Aa),r=p(this,Ue)._polygonsById;if(Array.isArray(n))for(let t=0,i=n.length;t<i;++t){let i=r[n[t].id];null!=i&&i.geometry.visible&&e.push(i)}return p(this,Te).polygons=e,e}set polygons(t){I(this,Aa,t)}get nodes(){let t=p(this,Te).nodes;if(void 0!==t)return t;let e=[],n=p(this,Na),r=p(this,Ue)._nodesById;if(n)for(let t=0,i=n.length;t<i;++t){let i=r[n[t].node];null!=i&&e.push(i)}return p(this,Te).nodes=e,e}set nodes(t){I(this,Na,t)}get parent(){let t=p(this,Te).parent;if(void 0!==t)return t;let e,n=p(this,Ue)._locationsById,r=p(this,Sa);return void 0!==r&&(e=n[r]),p(this,Te).parent=e,e}set parent(t){I(this,Sa,t)}get categories(){let t=p(this,Te).categories;if(void 0!==t)return t;let e=[];return p(this,yt).categories.forEach((t=>{let n=p(this,Ue).getCollectionItemById(nt.CATEGORY,t);n&&e.push(n)})),p(this,Te).categories=e,e}get state(){return rm(this,p(this,Ue).locationStates)}clone(){return new Ea(p(this,Ue),p(this,yt))}get nodeOperationHours(){let t=p(this,Te).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=p(this,yt).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return p(this,Te).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new Ea(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&ee(e,"categories"),t.options.things.nodes&&ee(e,"nodes"),t.options.things.polygons&&ee(e,"polygons"),t.options.things.locationStates&&ee(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await Q(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new Ea(t,e)))}catch(t){return E.error("Fetch Locations:",t),[]}}toJSON(){let t=p(this,yt);return delete t.color,t}},gt=Ea;Ue=new WeakMap,yt=new WeakMap,Te=new WeakMap,Aa=new WeakMap,Na=new WeakMap,Sa=new WeakMap,f();var vt,Rt,Ne,La,Ai=class extends mt{constructor(t,e){super(t),T(this,vt,void 0),T(this,Rt,void 0),T(this,Ne,{}),m(this,"geometry"),m(this,"perspectives"),m(this,"image"),m(this,"holes"),m(this,"textures"),m(this,"material"),m(this,"label"),m(this,"id",""),m(this,"layer"),m(this,"layerId"),m(this,"name"),m(this,"externalId"),m(this,"vertexes"),m(this,"canvasBounds"),T(this,La,void 0),I(this,vt,t),I(this,Rt,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=p(this,Ne).map;if(void 0!==t)return t;let e=p(this,vt).getCollectionItemById(nt.MAP,p(this,Rt).map);return p(this,Ne).map=e,e}get locations(){var t,e;let n=p(this,Ne).locations;if(void 0!==n)return n;let r=[],i=null!=(e=null==(t=_e.instances.get(p(this,vt)))?void 0:t.locationsByMapId.get(this.map.id))?e:[],{id:a}=this;for(let t=0,e=i.length;t<e;++t){let e=i[t],n=e.polygons;if(Array.isArray(n))for(let t=0,i=n.length;t<i;++t)if(n[t].id===a){r.push(e);break}}return p(this,Ne).locations=r,r}get entrances(){let t=p(this,Ne).entrances;if(void 0!==t)return t;let e=[],n=p(this,La),r=p(this,vt)._nodesById;if(Array.isArray(n)){for(let t=0,i=n.length;t<i;++t){let i=r[n[t].id];null!=i&&e.push(i)}return p(this,Ne).entrances=e,e}return[]}set entrances(t){I(this,La,t)}get rank(){let t=p(this,Ne).rank;if(void 0!==t)return t;let{rankings:e}=p(this,vt);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(p(this,Ne).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(p(this,Ne).rank=null,null)}static hydrate(t,e){return t.map((t=>new Ai(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&ee(e,"map"),t.options.things.nodes&&ee(e,"entrances");let n={fields:e,venue:t.options.venue};try{return(await Q(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new Ai(t,e)))}catch(t){return E.error("Fetch Polygons:",t),[]}}toJSON(){return p(this,Rt)}},Ct=Ai;function ju(t){return/^[\da-f]{24}$/i.test(t)}function _u(t,e=!1){let n="";if(null!=t){let r="?",i=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,a=i.length;e<a;++e){let a=i[e],o=t[a];null!=o&&(n+=`${r+encodeURIComponent(a)}=${encodeURIComponent(o)}`,r="&")}}return n}function om(t,e,n,r=!1){var i,a;return r?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:(null==(i=t.baseUrl)?void 0:i.includes("gateway"))?`${t.baseUrl}${e}/${n.venue||n.slug}${_u(n,null==(a=t.baseUrl)?void 0:a.includes("gateway"))}`:t.baseUrl+e+_u(n)}async function Q(t,e,n,r=!1){return Kr(t,e,n,r,!0)}async function Kr(t,e,n,r=!1,i=!1){let a=om(t,e,n,r),o=await Ni(t,a,r);if(!i&&Array.isArray(o)){if(1===o.length)return o[0];throw new Error("Invalid response object")}return o}async function Ni(t,e,n=!1){let r={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete r.language,r.language&&(e+=`&lang=${encodeURIComponent(r.language)}`);let{headers:i}=t;i["Content-Type"]="text/json",t.authorization&&(i.Authorization=t.authorization),r.language&&(i["Accept-Language"]=r.language);let a={method:"GET",headers:i},o=await kt()(e,a);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return o.json()}function ee(t,e){t.indexOf(e)<0&&t.push(e)}function Tu([t,e],[n,r]){let i=new L(t,e),a=new L(n,r);return i.distanceTo(a)}function Iu(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],r=t.georeference[2],i=new L(n.target.x,n.target.y),a=new L(r.target.x,r.target.y),o=i.distanceTo(a),s=n.control.x-r.control.x,l=n.control.y-r.control.y;e=Math.sqrt(s*s+l*l)/o}catch(n){e=1,E.warn(n),E.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function za(t){var e;return t instanceof Ct?t.entrances.map((t=>t.id)):t instanceof gt?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function Ou(t){let e={},{maps:n,images:r,scenes:i,polygons:a}=t;if(null!=r)try{let t=Object.keys(r).map((t=>fetch(`data:image/png;base64,${r[t]}`).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{E.error(t)}))));await Promise.all(t)}catch(t){E.error(t)}return n.forEach((t=>{var n;!(null==(n=t.scene)?void 0:n.polygons)&&!i[t.id]||(null!=i&&i[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>i[t.id]})),null!=r&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,r;if((null==(n=null==t?void 0:t.image)?void 0:n.url)&&(null==(r=null==t?void 0:t.image)?void 0:r.url)){let n=t.image.url.split("/"),r=e[n[n.length-1]];r&&(t.image.url=r)}}))))})),null!=r&&a.forEach((t=>{var n;if(null==(n=null==t?void 0:t.image)?void 0:n.url){let n=t.image.url.split("/"),r=e[n[n.length-1]];r&&(t.image.url=r)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}function Xr(t,e,n){let r;return function(){let i=this,a=arguments,o=function(){r=null,n||t.apply(i,a)},s=n&&!r;clearTimeout(r),r=setTimeout(o,e),s&&t.apply(i,a)}}vt=new WeakMap,Rt=new WeakMap,Ne=new WeakMap,La=new WeakMap;var Da,Fa,Pa,Si=class{constructor(t,e){T(this,Da,void 0),T(this,Fa,{}),T(this,Pa,void 0),m(this,"name"),m(this,"externalId"),m(this,"parents"),m(this,"id"),m(this,"icon"),this.id=e.id,I(this,Pa,e),I(this,Da,t),Object.assign(this,e)}get locations(){var t;let e=p(this,Fa).locations;if(void 0!==e)return e;let n=[],{locations:r}=p(this,Da),{id:i}=this;for(let e=0,a=r.length;e<a;++e){let a=r[e],o=a.categories;if(Array.isArray(o))for(let e=0,r=o.length;e<r;++e)if((null==(t=o[e])?void 0:t.id)===i){n.push(a);break}}return p(this,Fa).locations=n,n}static hydrate(t,e){return t.map((t=>new Si(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await Q(t.options,"category",e)).map((e=>new Si(t,e)))}catch(t){return E.error("Fetch Categories:",t),[]}}toJSON(){return p(this,Pa)}},Bt=Si;Da=new WeakMap,Fa=new WeakMap,Pa=new WeakMap,f();var Ca,qt,Ra,Li=class{constructor(t,e){T(this,Ca,void 0),T(this,qt,void 0),T(this,Ra,{}),m(this,"id",""),m(this,"type",""),m(this,"name",""),m(this,"description"),m(this,"image"),m(this,"startDate"),m(this,"endDate"),m(this,"showDate"),I(this,qt,e),I(this,Ca,t),Object.assign(this,e)}location(){let t=p(this,Ra).location;if(void 0!==t)return t;let e,n=p(this,Ca)._locationsById,r=p(this,qt).location;if(null!=r){let t=n[r];null!=t&&(e=t)}return p(this,Ra).location=e,e}static hydrate(t,e){return t.map((t=>new Li(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&ee(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await Q(t.options,"event",n)).map((e=>new Li(t,e)))}catch(t){return E.error("Fetch Events:",t),[]}}toJSON(){return p(this,qt)}},Ei=Li;Ca=new WeakMap,qt=new WeakMap,Ra=new WeakMap,f();var Ba,Di=class{constructor(t){T(this,Ba,void 0),m(this,"id",""),m(this,"name",""),m(this,"value",""),I(this,Ba,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Di(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await Q(t.options,"location-state",e)).map((t=>new Di(t)))}catch(t){return E.error("Fetch Location States:",t),[]}}toJSON(){return p(this,Ba)}},Yr=Di;Ba=new WeakMap,f(),f();var Ga,zu,Va,Au,Ua,$a,Fi,sm,Pi,um,$e,We,He,Je,qa=class{constructor(t){T(this,Ga),T(this,Va),T(this,Fi),T(this,Pi),m(this,"map"),T(this,Ua,{}),T(this,$a,void 0),T(this,$e,void 0),T(this,We,void 0),T(this,He,void 0),T(this,Je,void 0);let{map:e,mappedin:n}=t;null!=t.lat&&null!=t.lon&&(I(this,$e,t.lat),I(this,We,t.lon)),null!=t.x&&null!=t.y&&(I(this,He,t.x),I(this,Je,t.y)),this.map=e,I(this,$a,n)}get x(){return et(this,Va,Au).call(this,"x")}get y(){return et(this,Va,Au).call(this,"y")}get lat(){return et(this,Ga,zu).call(this,"lat")}get lon(){return et(this,Ga,zu).call(this,"lon")}absoluteDistanceTo(t){return Tu([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=p(this,Ua).nearestNode;if(void 0!==t)return t;let e=_e.instances.get(p(this,$a)).findNearestNodeOnMap(this.map.id,this);return p(this,Ua).nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};Ga=new WeakSet,zu=function(t){if(p(this,$e)&&p(this,We))return p(this,"lat"===t?$e:We);if(null!=p(this,He)&&null!=p(this,Je)){let[e,n]=et(this,Pi,um).call(this,p(this,He),p(this,Je));return I(this,$e,e),I(this,We,n),p(this,"lat"===t?$e:We)}throw Error("MappedinCoordinate is missing x and y")},Va=new WeakSet,Au=function(t){if(p(this,He)&&p(this,Je))return p(this,"x"===t?He:Je);if(null!=p(this,$e)&&null!=p(this,We)){let[e,n]=et(this,Fi,sm).call(this,p(this,$e),p(this,We));return I(this,He,e),I(this,Je,n),p(this,"x"===t?He:Je)}throw Error("MappedinCoordinate is missing lat and lon")},Ua=new WeakMap,$a=new WeakMap,Fi=new WeakSet,sm=function(t,e){let n=this.map.georeference[0],r=new L(n.target.x,n.target.y),i=new L(t,e),a=r.distanceTo(i),o=(r.finalBearingTo(i)+360)%360*Math.PI/180||0,s=a*(1/this.map.scale),l=o+this.map.getNorth(),u=Math.sin(l)*s,h=Math.cos(l)*s;return[n.control.x+u,n.control.y-h]},Pi=new WeakSet,um=function(t,e){let n,r=this.map.georeference[0],i=new L(r.target.x,r.target.y),a=t-r.control.x,o=r.control.y-e,s=Math.atan2(a,o);n=0===a&&0===o?0:0===a?o:a/Math.sin(s);let l=s-this.map.getNorth(),u=n/this.map._scale,h=i.destinationPoint(u,180*l/Math.PI);return[h.lat,h.lon]},$e=new WeakMap,We=new WeakMap,He=new WeakMap,Je=new WeakMap;var Ke,Wa,Ha,Ri=class{constructor(t,e){T(this,Ke,void 0),T(this,Wa,{}),T(this,Ha,void 0),m(this,"id",""),m(this,"group",""),m(this,"name",""),m(this,"shortName",""),m(this,"elevation",0),m(this,"scale",0),m(this,"layers"),m(this,"x_scale"),m(this,"perspectiveId"),m(this,"scene"),m(this,"width",0),m(this,"height",0),m(this,"georeference",[]),m(this,"_scale",0),I(this,Ke,t),I(this,Ha,e),Object.assign(this,e),this._scale=Iu(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t,e,n;return null!=(n=null==(e=null==(t=_e.instances.get(p(this,Ke)))?void 0:t.polygonsByMapId)?void 0:e.get(this.id))?n:[]}get locations(){var t,e,n;return null!=(n=null==(e=null==(t=_e.instances.get(p(this,Ke)))?void 0:t.locationsByMapId)?void 0:e.get(this.id))?n:[]}get nodes(){var t,e,n;return null!=(n=null==(e=null==(t=_e.instances.get(p(this,Ke)))?void 0:t.nodesByMapId)?void 0:e.get(this.id))?n:[]}get mapGroup(){let t=p(this,Wa).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&p(this,Ke)._mapGroupsById[e]||null;return p(this,Wa).mapGroup=n,n}createCoordinateByXY(t,e){return new qa({x:t,y:e,map:this,mappedin:p(this,Ke)})}createCoordinate(t,e){return new qa({lat:t,lon:e,map:this,mappedin:p(this,Ke)})}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],r=new L(e.target.x,e.target.y),i=new L(n.target.x,n.target.y);t=-((r.finalBearingTo(i)+0)*Math.PI/180-Math.atan2(n.control.y-e.control.y,n.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,E.warn(e),E.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return t}static hydrate(t,e){return t.map((t=>new Ri(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&ee(e,"perspectives"),t.options.things.mapGroups&&ee(e,"group"),ee(e,"elevation"),ee(e,"x_scale"),ee(e,"scale"),ee(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let i=await Q(t.options,"map",n),a=t=>{let e=r.layers.find((e=>e.id===t));e?e.visible=!0:r.layers.push({id:t,visible:!0})};for(let n=0,o=i.length;n<o;++n){var r=i[n];if(r){let t=r.perspective;null!=t&&(r.perspectiveId=t.id,e.indexOf("scene")>-1&&(r.scene=t.scene),t.layers?(r.layers.forEach((t=>{t.visible=!1})),t.layers.forEach(a)):r.layers.forEach((t=>{t.visible=!0}))),delete r.perspective}i[n]=new Ri(t,r)}return i}catch(t){return E.error("Fetch Maps:",t),[]}}toJSON(){return p(this,Ha)}},Ci=Ri;Ke=new WeakMap,Wa=new WeakMap,Ha=new WeakMap,f();var Ja,Gt,Ka,qi=class{constructor(t,e){T(this,Ja,void 0),T(this,Gt,void 0),T(this,Ka,{}),m(this,"id",""),m(this,"name",""),I(this,Gt,e),I(this,Ja,t),Object.assign(this,e)}get maps(){let t=p(this,Ka).maps;if(void 0!==t)return t;let e=[],{maps:n}=p(this,Ja),{id:r}=p(this,Gt);for(let t=0,i=n.length;t<i;++t){let i=n[t];i.group===r&&e.push(i)}return p(this,Ka).maps=e,e}static hydrate(t,e){return t.map((t=>new qi(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await Q(t.options,"map-group",e)).map((e=>new qi(t,e)))}catch(t){return E.error("Fetch Map Groups:",t),[]}}toJSON(){return p(this,Gt)}},Bi=qi;Ja=new WeakMap,Gt=new WeakMap,Ka=new WeakMap,f();var Xe,Vt,le,Xa,Vi=class extends mt{constructor(t,e){super(t),T(this,Xe,void 0),T(this,Vt,void 0),T(this,le,{}),m(this,"id",""),m(this,"x",0),m(this,"y",0),m(this,"operationHours"),m(this,"externalId"),T(this,Xa,void 0),I(this,Xe,t),I(this,Vt,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=p(this,le).map;if(void 0!==t)return t;let e=p(this,Xe).getCollectionItemById(nt.MAP,p(this,Vt).map);return p(this,le).map=e,e}get lat(){var t;let e=p(this,le).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=p(this,Xe)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return p(this,le).cachedLatLon=n.createCoordinateByXY(this.x,this.y),p(this,le).cachedLatLon.lat}get lon(){var t;let e=p(this,le).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=p(this,Xe)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return p(this,le).cachedLatLon=n.createCoordinateByXY(this.x,this.y),p(this,le).cachedLatLon.lon}get paths(){let t=p(this,le).paths;if(void 0!==t)return t;let e=[],n=p(this,Xe)._nodesById,r=p(this,Xa);if(Array.isArray(r))for(let t=0,i=r.length;t<i;++t){let i=n[r[t].node];null!=i&&e.push(i)}return p(this,le).paths=e,e}set paths(t){I(this,Xa,t)}get locations(){var t,e,n;let r=p(this,le).locations;if(void 0!==r)return r;let i=[],a=null!=(n=null==(e=null==(t=_e.instances.get(p(this,Xe)))?void 0:t.locationsByMapId)?void 0:e.get(this.map.id))?n:[],o=this.id;for(let t=0,e=a.length;t<e;++t){let e=a[t],n=e.nodes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t)if(n[t].id===o){i.push(e);break}}return p(this,le).locations=i,i}get polygon(){var t,e,n;let r=p(this,le).polygon;if(void 0!==r)return r;let i,a=null!=(n=null==(e=null==(t=_e.instances.get(p(this,Xe)))?void 0:t.polygonsByMapId)?void 0:e.get(this.map.id))?n:[],o=this.id;for(let t=0,e=a.length;t<e;++t){let e=a[t];e.entrances.map((t=>t.id)).includes(o)&&(i=e)}return p(this,le).polygon=i,i}static hydrate(t,e){return t.map((t=>new Vi(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&ee(e,"map"),["weight","multiplier","accessible"].forEach((function(t){ee(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await Q(t.options,"node",n)).map((e=>new Vi(t,e)))}catch(t){return E.error("Fetch Nodes:",t),[]}}toJSON(){return p(this,Vt)}},Gi=Vi;Xe=new WeakMap,Vt=new WeakMap,le=new WeakMap,Xa=new WeakMap,f();var Ya,$i=class{constructor(t){T(this,Ya,void 0),m(this,"polygons",[]),I(this,Ya,t),Object.assign(this,t)}static hydrate(t){return new $i(t)}static async fetch(t){try{let e=await Kr(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new $i(e)}catch(t){return E.error("Fetch Rankings:",t),null}}toJSON(){return p(this,Ya)}},Ui=$i;Ya=new WeakMap,f();var Za,Wi=class{constructor(t){m(this,"id",""),T(this,Za,void 0),I(this,Za,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Wi(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await Q(t.options,"apollo-theme",e)).map((t=>new Wi(t)))}catch(t){return E.error("Fetch Theme:",t),[]}}toJSON(){return p(this,Za)}},Zr=Wi;Za=new WeakMap,f();var Qa,en,Ut,Ji=class{constructor(t,e){T(this,Qa,void 0),T(this,en,void 0),T(this,Ut,{}),m(this,"defaultMap",""),m(this,"address",""),m(this,"city",""),m(this,"countrycode",""),m(this,"externalId",""),m(this,"id",""),m(this,"latitude"),m(this,"logo"),m(this,"longitude"),m(this,"metadata"),m(this,"name",""),m(this,"operationHours"),m(this,"postal",""),m(this,"slug",""),m(this,"state",""),m(this,"telephone",""),m(this,"tzid",""),m(this,"tzidOverride",""),m(this,"utcOffset",""),m(this,"website",""),I(this,en,t),I(this,Qa,e),Object.assign(this,e)}static hydrate(t,e){return new Ji(e,t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await Q(t.options,"venue",e);return new Ji(t,n[0])}catch(t){return E.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==p(this,Ut).isMultiBuilding){let t=p(this,en).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;p(this,Ut).isMultiBuilding=n}return p(this,Ut).isMultiBuilding}toJSON(){return p(this,Qa)}},Hi=Ji;Qa=new WeakMap,en=new WeakMap,Ut=new WeakMap,f();var tn,Xi=class{constructor(t){m(this,"id",""),T(this,tn,void 0),m(this,"name"),m(this,"type"),m(this,"weight"),m(this,"multiplier"),I(this,tn,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Xi(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){ee(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await Q(t.options,"vortex",n)).map((t=>new Xi(t)))}catch(t){return E.error("Fetch Vortexes:",t),[]}}toJSON(){return p(this,tn)}},Ki=Xi;function lm(t,e){let n=[];return t.features.forEach((t=>{var r,i;let a=[];null==(r=t.properties.spaces)||r.forEach((t=>{if("id"in t){let n;n=e.get(t.id),n&&a.push(...n)}else null==a||a.push({id:t.node,level:""})}));let o=a.map((t=>({node:"n_"+t.id,map:t.level}))),s=null==(i=t.properties.spaces)?void 0:i.filter((t=>"id"in t)),l=(t.properties.hours||[]).map((t=>({...t,"@type":"OpeningHoursSpecification",dayOfWeek:[t.dayOfWeek.replace("http://schema.org/","")]}))),u={...t.properties,polygons:s||[],nodes:o||[],description:t.properties.description||"",logo:t.properties.logo||{},picture:t.properties.picture||{},phone:t.properties.phone||{},social:t.properties.social||{},externalId:t.properties.externalId||"",states:t.properties.states||[],siblingGroups:t.properties.siblingGroups||[],operationHours:l};delete u.spaces,n.push(u)})),n}function dm(t){let e=new Set;return t.features.forEach((t=>{var n;null==(n=t.properties.states)||n.forEach((t=>{e.add(t.type)}))})),Array.from(e).map((t=>({id:t,name:t,value:t})))}function cm(t){let e=[];return t.features.forEach((t=>{let n={...t.properties,icon:t.properties.picture};delete n.picture,e.push(n)})),e}function pm(t){let e=1/0,n=1/0,r=-1/0,i=-1/0;return t.features.forEach((t=>{let a;a="MultiPolygon"===t.geometry.type?t.geometry.coordinates[0].flat():t.geometry.coordinates[0],a.forEach((t=>{e=Math.min(e,t[1]),r=Math.max(r,t[1]),n=Math.min(n,t[0]),i=Math.max(i,t[0])}))})),{id:t.features[0].properties.id,minLat:e,minLong:n,maxLat:r,maxLong:i}}function hm(t,e,n){let r=n.createGeoreferences(),i=[];return t.features.forEach((t=>{let a=new Set;e.forEach((t=>{t.layer&&a.add(t.layer)}));let o=[...a].map((t=>({id:t,visible:!0}))),s=1/n.mapScale,l={...t.properties,georeference:r,shortName:t.properties.abbreviation||"",scene:{polygons:e},scale:s,x_scale:s,group:t.properties.building,layers:o,width:n.widthInMapUnits,height:n.heightInMapUnits};i.push(l)})),i}tn=new WeakMap,f();var Nu=class{constructor(t){m(this,"mapExtent"),m(this,"stretchRatio"),m(this,"midLat"),m(this,"midLong"),m(this,"mapUnitRatio",1e6),m(this,"latDistance"),m(this,"longDistance"),m(this,"mapScale"),m(this,"widthInMapUnits"),m(this,"heightInMapUnits"),this.mapExtent=t;let{minLat:e,minLong:n,maxLat:r,maxLong:i}=t,a=(e+r)/2,o=(n+i)/2,s=new L(a,i),l=new L(a,n),u=new L(e,o),h=new L(r,o);this.latDistance=u.distanceTo(h),this.longDistance=s.distanceTo(l);let c=this.latDistance/this.longDistance,d=(r-e)/(i-n);this.stretchRatio=c/d,this.midLat=a,this.midLong=o,this.widthInMapUnits=(i-n)*this.mapUnitRatio,this.heightInMapUnits=(r-e)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(t){let e=t[1];return{x:(t[0]-this.midLong)*this.mapUnitRatio,y:(this.midLat-e)*this.mapUnitRatio*this.stretchRatio}}createGeoreferences(){let{minLat:t,minLong:e,maxLat:n,maxLong:r}=this.mapExtent;return[[t,e],[t,r],[n,r],[n,e]].map((t=>({target:{x:t[0],y:t[1]},control:this.convert([t[1],t[0]])})))}};function mm(t,e){let n=[];return t.features.forEach((t=>{let r=e.convert(t.geometry.coordinates),i=(t.properties.neighbors||[]).map((e=>({node:e,map:t.properties.level}))),a=t.properties.level,o={...t.properties,x:r.x,y:r.y,paths:i,map:a,externalId:t.properties.externalId||""};n.push(o)})),n}var Su=(t,e,n,r,i)=>{let a=[];return t.features.forEach((t=>{if(!t.geometry.coordinates[0].forEach)return;let o=[];"entrances"in t.properties&&(o=t.properties.entrances.map((t=>({id:"n_"+t.id,node:"n_"+t.id,map:t.level}))));let s,l=n[t.properties.id],u=e.find((t=>t.id===l)),h=t.geometry.coordinates[0].map((t=>i.convert(t))),c=r.find((e=>e.polygonId===t.properties.id)),d=Math.max(i.widthInMapUnits,i.heightInMapUnits)/1e3;if(c){let t=i.convert([c.position[0],c.position[1]]),e=c.size.x,n=c.size.y,r=i.mapScale,a=n*r,o=e*r/d/c.viewBox.width,l=a/d/c.viewBox.height;s={url:null==u?void 0:u.image,visible:!!(null==u?void 0:u.image),viewBox:c.viewBox,scale:{x:o,y:l},position:{x:t.x,y:t.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let f={...t.properties,entrances:o,map:t.properties.level,externalId:t.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:((null==u?void 0:u.altitude)||0)*i.mapScale/d},scale:{x:1,y:1,z:((null==u?void 0:u.height)||1)*i.mapScale/d}},material:{color:(null==u?void 0:u.color)||"#000000"},image:s,vertexes:h};a.push(f)})),a};function fm(t,e,n,r,i,a){let o=Su(t,n,r,i,a),s=Su(e,n,r,i,a);return o.concat(s)}function gm(t){let e=new Map;return t.forEach((t=>{t.features.forEach((t=>{let{destinations:n}=t.properties;if(0===n.length)return;let r=n[0].split("-")[0],i=e.get(r),a=n.map((t=>t.split("-")[1])).map((t=>"n_"+t));if(i)i.nodes.push(...a);else{let{name:n,type:i,weight:o,multiplier:s,accessible:l}=t.properties,u={id:r,nodes:a,name:n,type:i,weight:o,multiplier:s,accessible:l};e.set(r,u)}}))})),Array.from(e.values())}function ym(t){let e=[];return t.features.forEach((t=>{let n={...t.properties};e.push(n)})),e}function Eu(t){let e=Object.keys(t),n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,s=new Map,l=new Map,u=new Map;e.filter((t=>t.indexOf("/")>-1)).forEach((e=>{let h=e.split(/[\/\.]/),c=h[0],d=h[1];switch(c){case"connection":n.set(d,t[e]);break;case"level":r.set(d,t[e]);break;case"node":i.set(d,t[e]);break;case"obstruction":a.set(d,t[e]);break;case"space":o.set(d,t[e]);break;case"style":case"polygon-style":s.set(d,t[e]);break;case"image":l.set(d,t[e]);break;case"image-instance":u.set(d,t[e])}}));let h=t["building.geojson"]||t["building.json"],c=t["category.geojson"]||t["category.json"],d=t["location.geojson"]||t["location.json"],f=t["manifest.geojson"]||t["manifest.json"],p=t["style.json"]||[];return{connection:n,level:r,node:i,obstruction:a,space:o,building:h,category:c,location:d,manifest:f,style:p,polygonStyle:s,imageInstance:u,imageBinaries:l}}function Lu(t){let e=Array.from(t.connection.values()),n=Array.from(t.level.values()),r=t.building,i=t.category,a=t.style,o=t.location,s=t.imageInstance,l=t.polygonStyle,u={},h=[],c=new Map;n.forEach((e=>{let n=e.features[0].properties.id,r=pm(e),i=new Nu(r);c.set(n,i);let o=t.obstruction.get(n),d=t.space.get(n),f=s.get(n),p=l.get(n);u[n]=fm(d,o,a,p,f,i);let m=t.node.get(n);h.push(...mm(m,i))}));let d=Object.values(u).flat(),f=gm(e),p=n.map((t=>{let e=t.features[0].properties.id,n=c.get(e);return hm(t,u[e],n)})).flat(),m=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{m.set(t.properties.id,t.properties.entrances)}))}));let g=ym(r),y=lm(o,m),v=cm(i),_=dm(o),w=t.manifest.features[0].properties.name,M=t.manifest.features[0].geometry.coordinates[0],b=t.manifest.features[0].geometry.coordinates[1],I=t.imageBinaries;return{locations:y,categories:v,nodes:h,maps:p,polygons:d,vortexes:f,mapGroups:g,locationStates:_,themes:[],venue:{name:w,latitude:b,longitude:M},imageBinaries:I}}f(),f(),f(),f();var zt,Re,Be,Qr=[0,4,6,8,10],it=()=>{let t=new Array(16).fill(0),e=4294967296*Math.random();for(let n=0;n<t.length;n++)n>0&&0==(3&n)&&(e=4294967296*Math.random()),t[n]=e>>>((3&n)<<3)&255;let n=t.map((t=>t.toString(16).padStart(2,"0")));return n[6]="4"+n[6][1],n[8]=["8","9","a","b"].includes(n[7][0])?n[7]:"a"+n[7][1],Qr.map(((t,e)=>n.slice(t,e===Qr.length-1?void 0:Qr[e+1]).join(""))).join("-")},Du="mi-session-data",Fu="mi-local-data",eo=class{constructor(){T(this,Re,void 0),T(this,Be,void 0);try{let t=sessionStorage.getItem(Du);I(this,Re,t?JSON.parse(t):{id:it()})}catch{I(this,Re,{id:it()})}try{let t=localStorage.getItem(Fu);I(this,Be,t?JSON.parse(t):{deviceId:it()})}catch{I(this,Be,{deviceId:it()})}p(this,Re).id||(p(this,Re).id=it()),p(this,Be).deviceId||(p(this,Be).deviceId=it())}static getInstance(){return p(this,zt)||I(this,zt,new eo),p(this,zt)}static ___clearInstance(){I(this,zt,void 0)}saveSessionData(t,e){p(this,Re)[t]=e;try{return sessionStorage.setItem(Du,JSON.stringify(p(this,Re))),!0}catch{return!1}}loadSessionData(t){let e=p(this,Re)[t];if(null!=e)return e}saveLocalData(t,e){p(this,Be)[t]=e;try{return localStorage.setItem(Fu,JSON.stringify(p(this,Be))),!0}catch{return!1}}loadLocalData(t){let e=p(this,Be)[t];if(null!=e)return e}},an=eo;function Pu(t){return/^[\da-f]{24}$/i.test(t)}function Cu(){return an.getInstance().loadLocalData("deviceId")}function Ru(){return an.getInstance().loadSessionData("id")}zt=new WeakMap,Re=new WeakMap,Be=new WeakMap,T(an,zt,void 0);var ol,sl,nn,$t,Wt,rn,Ht,Jt,Kt,At,on,Xt,Yt,sn,rl=vr(il()),Im=null==(sl=null==(ol=j)?void 0:ol.env)?void 0:sl.npm_package_version,no=["websdk","web","webv2"],io="websdk",oo=class{constructor(t){var e;T(this,nn,void 0),T(this,$t,void 0),T(this,Wt,void 0),T(this,rn,void 0),T(this,Ht,void 0),T(this,Jt,void 0),T(this,Kt,void 0),T(this,At,void 0),T(this,on,void 0),T(this,Xt,void 0),T(this,Yt,void 0),T(this,sn,void 0),I(this,At,t.clientId),I(this,on,t.clientSecret),I(this,Xt,t.accessToken),I(this,Kt,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!p(this,Kt)&&p(this,At)&&!Pu(p(this,At))&&(n="https://web-proxy.mappedin.com/a/"),I(this,Wt,n),I(this,Wt,p(this,Wt)+(t.venue+"/")),I(this,$t,!1),I(this,nn,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),I(this,rn,no.find((e=>e===t.context))||no[0]),I(this,Ht,Cu()),I(this,Jt,Ru()),I(this,Yt,new Set),I(this,sn,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(t,e){if(p(this,nn))return;let n={...e,g:p(this,$t)},r=p(this,Wt)+t+"?"+rl.default.stringify(n),i={"mi-context":io||p(this,rn),"mi-session":p(this,Jt),"mi-device":p(this,Ht),"mappedin-sdk-version":Im,"mappedin-platform-version":p(this,sn)};p(this,Xt)?i.Authorization=`Bearer ${p(this,Xt)}`:p(this,Kt)||(i.Authorization=`Basic ${btoa(`${p(this,At)}:${p(this,on)}`)}`),kt()(r,{method:"GET",mode:"cors",headers:i})}locationSelected(t){let e=t.id||t;this.track("select-location",{id:e})}categorySelected(t){let e=t.id||t;this.track("select-category",{id:e})}mapViewLoaded(t,e,n,r){this.track("load-mapview",{type:t,force:e,benchmark:n||-1,reason:r||"success"})}getDirections(t,e){let n={start:t.id,end:e.id,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return p(this,Jt)}getDeviceID(){return p(this,Ht)}setGeolocationMode(t){I(this,$t,t)}trackBlueDotEvent(t){t&&Object.values(oo.BLUEDOT_EVENT).includes(t)&&!p(this,Yt).has(t)?(this.track(t),p(this,Yt).add(t)):E.warn(`Ignored unsupported blue dot event: "${t}".`)}trackSearch(t){null!=t&&this.track("query-search",t)}trackSearchSuggest(t){null!=t&&this.track("query-suggest",t)}static setContext(t){let e=no.find((e=>e===t));e&&(io=e)}static clearContext(){io=void 0}},ro=oo;nn=new WeakMap,$t=new WeakMap,Wt=new WeakMap,rn=new WeakMap,Ht=new WeakMap,Jt=new WeakMap,Kt=new WeakMap,At=new WeakMap,on=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,sn=new WeakMap,m(ro,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var nt,Yi=ro,so={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(t){t.CATEGORY="categories",t.EVENT="events",t.LOCATION="locations",t.MAPGROUP="mapGroups",t.MAP="maps",t.NODE="nodes",t.POLYGON="polygons",t.VORTEX="vortexes"}(nt||(nt={}));var bt,Qt,Zt={categories:Bt,locations:gt,vortexes:Ki,maps:Ci,nodes:Gi,polygons:Ct,venue:Hi,events:Ei,mapGroups:Bi,themes:Zr,locationStates:Yr,rankings:Ui},Nt=class{constructor(t){m(this,"perspective"),m(this,"things"),m(this,"options"),T(this,bt,void 0),T(this,Qt,""),m(this,"updatedAt"),m(this,"categories",[]),m(this,"locations",[]),m(this,"vortexes",[]),m(this,"maps",[]),m(this,"nodes",[]),m(this,"polygons",[]),m(this,"venue",{}),m(this,"events",[]),m(this,"mapGroups",[]),m(this,"themes",[]),m(this,"locationStates",[]),m(this,"rankings"),m(this,"_categoriesById"),m(this,"_locationsById"),m(this,"_vortexesById"),m(this,"_mapsById"),m(this,"_nodesById"),m(this,"_polygonsById"),m(this,"_eventsById"),m(this,"_mapGroupsById"),m(this,"_locationStatesById"),m(this,"_locationRankingsById"),m(this,"_rankingsById"),m(this,"_categoriesByExternalId"),m(this,"_locationsByExternalId"),m(this,"_vortexesByExternalId"),m(this,"_mapsByExternalId"),m(this,"_nodesByExternalId"),m(this,"_polygonsByExternalId"),m(this,"_eventsByExternalId"),m(this,"_mapGroupsByExternalId"),m(this,"_locationStatesByExternalId"),m(this,"_locationRankingsByExternalId"),m(this,"_rankingsByExternalId"),m(this,"images"),m(this,"imageBinaries"),m(this,"scenes"),m(this,"analytics"),m(this,"navigator"),this.options=t,I(this,bt,_e.create(this));let e=new Yi({...t,testMode:!(null==t?void 0:t.emitAnalyticsEvents)});this.analytics={locationSelected:e.locationSelected,categorySelected:e.categorySelected,getDirections:e.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(Ur,"true")}})}generateGetters(t){try{for(let e=0,n=t.length;e<n;++e){let n=t[e];Array.isArray(this[n])&&(Object.defineProperty(this,`_${n}ByExternalId`,{get(){let t=p(this,bt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),p(this,bt)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=p(this,bt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),p(this,bt)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,r=this[`_${t}ById`];return null!=r&&null!=r[e]||(r=this[n],null!=r&&null!=r[e])?r[e]:null}async hydrateFromMVF(t){let e=Lu(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{I(this,Qt,t),n=JSON.parse(t)}catch(t){return void E.error("Unable to parse JSON",t)}else n=t,I(this,Qt,JSON.stringify(n));let r=Object.keys(n);for(let t=0,e=r.length;t<e;++t){let e=r[t],i=n[e];null!=Zt[e]&&"function"==typeof Zt[e].hydrate&&(this[e]=Zt[e].hydrate(i,this))}e&&await Ou(n);let{images:i,scenes:a,imageBinaries:o}=n;this.images=i,this.scenes=a,this.imageBinaries=o,this.generateGetters(r),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),ju(this.options.clientId)||this.options.things.rankings&&delete this.options.things.rankings;let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,r=n.length;t<r;++t){let r=n[t];Zt[r]&&e.push(Zt[r].fetch(this).then((t=>(this[r]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new Wr({locations:this.locations.map((t=>t.toJSON())),nodes:this.nodes.map((t=>t.toJSON())),vortexes:this.vortexes.map((t=>t.toJSON())),maps:this.maps.map((t=>t.toJSON()))})}toJSON(){var t;let e={};for(let t in Zt)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));let n={...e,venue:this.venue.toJSON()};return null!=this.rankings&&(n.rankings=null==(t=this.rankings)?void 0:t.toJSON()),delete n.locationRankings,n}toString(){return p(this,Qt)||JSON.stringify(this.toJSON())}};bt=new WeakMap,Qt=new WeakMap,f();var ul={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"]};f(),f();var ie=function(){return ie=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ie.apply(this,arguments)};function J(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function de(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}var un,Om="ENTRIES",ll="KEYS",dl="VALUES",ce="",uo=function(){function t(t,e){var n=t._tree,r=Array.from(n.keys());this.set=t,this._type=e,this._path=r.length>0?[{node:n,keys:r}]:[]}return t.prototype.next=function(){var t=this.dive();return this.backtrack(),t},t.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var t=ea(this._path),e=t.node,n=t.keys;if(ea(n)===ce)return{done:!1,value:this.result()};var r=e.get(ea(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=ea(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}},t.prototype.key=function(){return this.set._prefix+this._path.map((function(t){var e=t.keys;return ea(e)})).filter((function(t){return t!==ce})).join("")},t.prototype.value=function(){return ea(this._path).node.get(ce)},t.prototype.result=function(){switch(this._type){case dl:return this.value();case ll:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),ea=function(t){return t[t.length-1]},zm=function(t,e,n){var r=new Map;if(void 0===e)return r;for(var i=e.length+1,a=i+n,o=new Uint8Array(a*i).fill(n+1),s=0;s<i;++s)o[s]=s;for(var l=1;l<a;++l)o[l*i]=l;return cl(t,e,n,r,o,1,i,""),r},cl=function(t,e,n,r,i,a,o,s){var l,u,h=a*o;try{t:for(var c=J(t.keys()),d=c.next();!d.done;d=c.next()){var f=d.value;if(f===ce){var p=i[h-1];p<=n&&r.set(s,[t.get(f),p])}else{for(var m=a,g=0;g<f.length;++g,++m){for(var y=f[g],v=o*m,_=v-o,w=i[v],M=Math.max(0,m-n-1),b=Math.min(o-1,m+n),I=M;I<b;++I){var x=y!==e[I],T=i[_+I]+ +x,E=i[_+I+1]+1,O=i[v+I]+1,k=i[v+I+1]=Math.min(T,E,O);k<w&&(w=k)}if(w>n)continue t}cl(t.get(f),e,n,r,i,m,o,s+f)}}}catch(t){l={error:t}}finally{try{d&&!d.done&&(u=c.return)&&u.call(c)}finally{if(l)throw l.error}}},lo=function(){function t(t,e){void 0===t&&(t=new Map),void 0===e&&(e=""),this._size=void 0,this._tree=t,this._prefix=e}return t.prototype.atPrefix=function(e){var n,r;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var i=de(Zi(this._tree,e.slice(this._prefix.length)),2),a=i[0],o=i[1];if(void 0===a){var s=de(ho(o),2),l=s[0],u=s[1];try{for(var h=J(l.keys()),c=h.next();!c.done;c=h.next()){var d=c.value;if(d!==ce&&d.startsWith(u)){var f=new Map;return f.set(d.slice(u.length),l.get(d)),new t(f,e)}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}return new t(a,e)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,Am(this._tree,t)},t.prototype.entries=function(){return new uo(this,Om)},t.prototype.forEach=function(t){var e,n;try{for(var r=J(this),i=r.next();!i.done;i=r.next()){var a=de(i.value,2);t(a[0],a[1],this)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.fuzzyGet=function(t,e){return zm(this._tree,t,e)},t.prototype.get=function(t){var e=co(this._tree,t);return void 0!==e?e.get(ce):void 0},t.prototype.has=function(t){var e=co(this._tree,t);return void 0!==e&&e.has(ce)},t.prototype.keys=function(){return new uo(this,ll)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,po(this._tree,t).set(ce,e),this},Object.defineProperty(t.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var t=this.entries();!t.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),t.prototype.update=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=po(this._tree,t);return n.set(ce,e(n.get(ce))),this},t.prototype.fetch=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=po(this._tree,t),r=n.get(ce);return void 0===r&&n.set(ce,r=e()),r},t.prototype.values=function(){return new uo(this,dl)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(e){var n,r,i=new t;try{for(var a=J(e),o=a.next();!o.done;o=a.next()){var s=de(o.value,2),l=s[0],u=s[1];i.set(l,u)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},t.fromObject=function(e){return t.from(Object.entries(e))},t}(),Zi=function(t,e,n){var r,i;if(void 0===n&&(n=[]),0===e.length||null==t)return[t,n];try{for(var a=J(t.keys()),o=a.next();!o.done;o=a.next()){var s=o.value;if(s!==ce&&e.startsWith(s))return n.push([t,s]),Zi(t.get(s),e.slice(s.length),n)}}catch(t){r={error:t}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n.push([t,e]),Zi(void 0,"",n)},co=function(t,e){var n,r;if(0===e.length||null==t)return t;try{for(var i=J(t.keys()),a=i.next();!a.done;a=i.next()){var o=a.value;if(o!==ce&&e.startsWith(o))return co(t.get(o),e.slice(o.length))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},po=function(t,e){var n,r,i=e.length;t:for(var a=0;t&&a<i;){try{for(var o=(n=void 0,J(t.keys())),s=o.next();!s.done;s=o.next()){var l=s.value;if(l!==ce&&e[a]===l[0]){for(var u=Math.min(i-a,l.length),h=1;h<u&&e[a+h]===l[h];)++h;var c=t.get(l);if(h===l.length)t=c;else{var d=new Map;d.set(l.slice(h),c),t.set(e.slice(a,a+h),d),t.delete(l),t=d}a+=h;continue t}}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}var f=new Map;return t.set(e.slice(a),f),f}return t},Am=function(t,e){var n=de(Zi(t,e),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(ce),0===r.size)pl(i);else if(1===r.size){var a=de(r.entries().next().value,2),o=a[0],s=a[1];hl(i,o,s)}},pl=function(t){if(0!==t.length){var e=de(ho(t),2),n=e[0],r=e[1];if(n.delete(r),0===n.size)pl(t.slice(0,-1));else if(1===n.size){var i=de(n.entries().next().value,2),a=i[0],o=i[1];a!==ce&&hl(t.slice(0,-1),a,o)}}},hl=function(t,e,n){if(0!==t.length){var r=de(ho(t),2),i=r[0],a=r[1];i.set(a+e,n),i.delete(a)}},ho=function(t){return t[t.length-1]},mo="or",Nm="and",Sm="and_not",St=function(){function t(t){if(null==(null==t?void 0:t.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=ie(ie(ie({},go),t),{searchOptions:ie(ie({},gl),t.searchOptions||{})}),this._index=new lo,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 t.prototype.add=function(t){var e,n,r,i,a=this._options,o=a.extractField,s=a.tokenize,l=a.processTerm,u=a.fields,h=a.idField,c=o(t,h);if(null==c)throw new Error('MiniSearch: document does not have ID field "'.concat(h,'"'));var d=this.addDocumentId(c);this.saveStoredFields(d,t);try{for(var f=J(u),p=f.next();!p.done;p=f.next()){var m=p.value,g=o(t,m);if(null!=g){var y=s(g.toString(),m),v=this._fieldIds[m],_=new Set(y).size;this.addFieldLength(d,v,this._documentCount-1,_);try{for(var w=(r=void 0,J(y)),M=w.next();!M.done;M=w.next()){var b=l(M.value,m);b&&this.addTerm(v,d,b)}}catch(t){r={error:t}}finally{try{M&&!M.done&&(i=w.return)&&i.call(w)}finally{if(r)throw r.error}}}}}catch(t){e={error:t}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}},t.prototype.addAll=function(t){var e,n;try{for(var r=J(t),i=r.next();!i.done;i=r.next()){var a=i.value;this.add(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.addAllAsync=function(t,e){var n=this;void 0===e&&(e={});var r=e.chunkSize,i=void 0===r?10:r,a={chunk:[],promise:Promise.resolve()},o=t.reduce((function(t,e,r){var a=t.chunk,o=t.promise;return a.push(e),(r+1)%i==0?{chunk:[],promise:o.then((function(){return new Promise((function(t){return setTimeout(t,0)}))})).then((function(){return n.addAll(a)}))}:{chunk:a,promise:o}}),a),s=o.chunk;return o.promise.then((function(){return n.addAll(s)}))},t.prototype.remove=function(t){var e,n,r,i,a,o,s=this._options,l=s.tokenize,u=s.processTerm,h=s.extractField,c=s.fields,d=s.idField,f=h(t,d);if(null==f)throw new Error('MiniSearch: document does not have ID field "'.concat(d,'"'));try{for(var p=J(this._documentIds),m=p.next();!m.done;m=p.next()){var g=de(m.value,2),y=g[0];if(f===g[1]){try{for(var v=(r=void 0,J(c)),_=v.next();!_.done;_=v.next()){var w=_.value,M=h(t,w);if(null!=M){var b=l(M.toString(),w),I=this._fieldIds[w],x=new Set(b).size;this.removeFieldLength(y,I,this._documentCount,x);try{for(var T=(a=void 0,J(b)),E=T.next();!E.done;E=T.next()){var O=u(E.value,w);O&&this.removeTerm(I,y,O)}}catch(t){a={error:t}}finally{try{E&&!E.done&&(o=T.return)&&o.call(T)}finally{if(a)throw a.error}}}}}catch(t){r={error:t}}finally{try{_&&!_.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}return this._storedFields.delete(y),this._documentIds.delete(y),this._fieldLength.delete(y),void(this._documentCount-=1)}}}catch(t){e={error:t}}finally{try{m&&!m.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(f,": it is not in the index"))},t.prototype.removeAll=function(t){var e,n;if(t)try{for(var r=J(t),i=r.next();!i.done;i=r.next()){var a=i.value;this.remove(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new lo,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},t.prototype.search=function(t,e){var n,r;void 0===e&&(e={});var i=this.executeQuery(t,e),a=[];try{for(var o=J(i),s=o.next();!s.done;s=o.next()){var l=de(s.value,2),u=l[0],h=l[1],c=h.score,d=h.terms,f=h.match,p=d.length,m={id:this._documentIds.get(u),score:c*p,terms:Object.keys(f),match:f};Object.assign(m,this._storedFields.get(u)),(null==e.filter||e.filter(m))&&a.push(m)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a.sort(vl),a},t.prototype.autoSuggest=function(t,e){var n,r,i,a;void 0===e&&(e={}),e=ie(ie({},Pm),e);var o=new Map;try{for(var s=J(this.search(t,e)),l=s.next();!l.done;l=s.next()){var u=l.value,h=u.score,c=(v=u.terms).join(" ");null!=(g=o.get(c))?(g.score+=h,g.count+=1):o.set(c,{score:h,terms:v,count:1})}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}var d=[];try{for(var f=J(o),p=f.next();!p.done;p=f.next()){var m=de(p.value,2),g=m[0],y=m[1],v=(h=y.score,y.terms),_=y.count;d.push({suggestion:g,terms:v,score:h/_})}}catch(t){i={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return d.sort(vl),d},Object.defineProperty(t.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),t.loadJSON=function(e,n){if(null==n)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return t.loadJS(JSON.parse(e),n)},t.getDefault=function(t){if(go.hasOwnProperty(t))return fo(go,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},t.loadJS=function(e,n){var r,i,a,o,s=e.index,l=e.documentCount,u=e.nextId,h=e.documentIds,c=e.fieldIds,d=e.fieldLength,f=e.averageFieldLength,p=e.storedFields,m=e.serializationVersion;if(1!==m&&2!==m)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var g=new t(n);g._documentCount=l,g._nextId=u,g._documentIds=Qi(h),g._fieldIds=c,g._fieldLength=Qi(d),g._avgFieldLength=f,g._storedFields=Qi(p),g._index=new lo;try{for(var y=J(s),v=y.next();!v.done;v=y.next()){var _=de(v.value,2),w=_[0],M=_[1],b=new Map;try{for(var I=(a=void 0,J(Object.keys(M))),x=I.next();!x.done;x=I.next()){var T=x.value,E=M[T];1===m&&(E=E.ds),b.set(parseInt(T,10),Qi(E))}}catch(t){a={error:t}}finally{try{x&&!x.done&&(o=I.return)&&o.call(I)}finally{if(a)throw a.error}}g._index.set(w,b)}}catch(t){r={error:t}}finally{try{v&&!v.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}return g},t.prototype.executeQuery=function(t,e){var n=this;if(void 0===e&&(e={}),"string"!=typeof t){var r=ie(ie(ie({},e),t),{queries:void 0}),i=t.queries.map((function(t){return n.executeQuery(t,r)}));return this.combineResults(i,t.combineWith)}var a=this._options,o=a.tokenize,s=a.processTerm,l=a.searchOptions,u=ie(ie({tokenize:o,processTerm:s},l),e),h=u.tokenize,c=u.processTerm,d=h(t).map((function(t){return c(t)})).filter((function(t){return!!t})).map(Fm(u)).map((function(t){return n.executeQuerySpec(t,u)}));return this.combineResults(d,u.combineWith)},t.prototype.executeQuerySpec=function(t,e){var n,r,i,a,o,s,l=ie(ie({},this._options.searchOptions),e),u=(l.fields||this._options.fields).reduce((function(t,e){var n;return ie(ie({},t),((n={})[e]=fo(t,e)||1,n))}),l.boost||{}),h=l.boostDocument,c=l.weights,d=l.maxFuzzy,f=ie(ie({},gl.weights),c),p=f.fuzzy,m=f.prefix,g=this._index.get(t.term),y=this.termResults(t.term,t.term,1,g,u,h);if(t.prefix&&(o=this._index.atPrefix(t.term)),t.fuzzy){var v=!0===t.fuzzy?.2:t.fuzzy,_=v<1?Math.min(d,Math.round(t.term.length*v)):v;_&&(s=this._index.fuzzyGet(t.term,_))}if(o)try{for(var w=J(o),M=w.next();!M.done;M=w.next()){var b=de(M.value,2),I=b[0],x=b[1];if(k=I.length-t.term.length){null==s||s.delete(I);var T=m*I.length/(I.length+.3*k);this.termResults(t.term,I,T,x,u,h,y)}}}catch(t){n={error:t}}finally{try{M&&!M.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}if(s)try{for(var E=J(s.keys()),O=E.next();!O.done;O=E.next()){I=O.value;var k,N=de(s.get(I),2),A=N[0];if(k=N[1]){T=p*I.length/(I.length+k);this.termResults(t.term,I,T,A,u,h,y)}}}catch(t){i={error:t}}finally{try{O&&!O.done&&(a=E.return)&&a.call(E)}finally{if(i)throw i.error}}return y},t.prototype.combineResults=function(t,e){if(void 0===e&&(e=mo),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(Em[n])||new Map},t.prototype.toJSON=function(){var t,e,n,r,i=[];try{for(var a=J(this._index),o=a.next();!o.done;o=a.next()){var s=de(o.value,2),l=s[0],u=s[1],h={};try{for(var c=(n=void 0,J(u)),d=c.next();!d.done;d=c.next()){var f=de(d.value,2),p=f[0],m=f[1];h[p]=Object.fromEntries(m)}}catch(t){n={error:t}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}i.push([l,h])}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),index:i,serializationVersion:2}},t.prototype.termResults=function(t,e,n,r,i,a,o){var s,l,u,h,c;if(void 0===o&&(o=new Map),null==r)return o;try{for(var d=J(Object.keys(i)),f=d.next();!f.done;f=d.next()){var p=f.value,m=i[p],g=this._fieldIds[p],y=r.get(g);if(null!=y){var v=y.size,_=this._avgFieldLength[g];try{for(var w=(u=void 0,J(y.keys())),M=w.next();!M.done;M=w.next()){var b=M.value,I=a?a(this._documentIds.get(b),e):1;if(I){var x=y.get(b),T=this._fieldLength.get(b)[g],E=n*m*I*Dm(x,v,this._documentCount,T,_),O=o.get(b);if(O){O.score+=E,Cm(O.terms,t);var k=fo(O.match,e);k?k.push(p):O.match[e]=[p]}else o.set(b,{score:E,terms:[t],match:(c={},c[e]=[p],c)})}}}catch(t){u={error:t}}finally{try{M&&!M.done&&(h=w.return)&&h.call(w)}finally{if(u)throw u.error}}}}}catch(t){s={error:t}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(s)throw s.error}}return o},t.prototype.addTerm=function(t,e,n){var r=this._index.fetch(n,kl),i=r.get(t);if(null==i)(i=new Map).set(e,1),r.set(t,i);else{var a=i.get(e);i.set(e,(a||0)+1)}},t.prototype.removeTerm=function(t,e,n){if(this._index.has(n)){var r=this._index.fetch(n,kl),i=r.get(t);null==i||null==i.get(e)?this.warnDocumentChanged(e,t,n):i.get(e)<=1?i.size<=1?r.delete(t):i.delete(e):i.set(e,i.get(e)-1),0===this._index.get(n).size&&this._index.delete(n)}else this.warnDocumentChanged(e,t,n)},t.prototype.warnDocumentChanged=function(t,e,n){var r,i;if(null!=console&&null!=console.warn)try{for(var a=J(Object.keys(this._fieldIds)),o=a.next();!o.done;o=a.next()){var s=o.value;if(this._fieldIds[s]===e)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(n,'" was not present in field "').concat(s,'". Removing a document after it has changed can corrupt the index!'))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},t.prototype.addDocumentId=function(t){var e=this._nextId;return this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},t.prototype.addFields=function(t){for(var e=0;e<t.length;e++)this._fieldIds[t[e]]=e},t.prototype.addFieldLength=function(t,e,n,r){var i=this._fieldLength.get(t);null==i&&this._fieldLength.set(t,i=[]),i[e]=r;var a=(this._avgFieldLength[e]||0)*n+r;this._avgFieldLength[e]=a/(n+1)},t.prototype.removeFieldLength=function(t,e,n,r){var i=this._avgFieldLength[e]*n-r;this._avgFieldLength[e]=i/(n-1)},t.prototype.saveStoredFields=function(t,e){var n,r,i=this._options,a=i.storeFields,o=i.extractField;if(null!=a&&0!==a.length){var s=this._storedFields.get(t);null==s&&this._storedFields.set(t,s={});try{for(var l=J(a),u=l.next();!u.done;u=l.next()){var h=u.value,c=o(e,h);void 0!==c&&(s[h]=c)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}},t}(),fo=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},Em=((un={})[mo]=function(t,e){var n,r;try{for(var i=J(e.keys()),a=i.next();!a.done;a=i.next()){var o=a.value,s=t.get(o);if(null==s)t.set(o,e.get(o));else{var l=e.get(o),u=l.score,h=l.terms,c=l.match;s.score=s.score+u,s.match=Object.assign(s.match,c),yl(s.terms,h)}}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},un[Nm]=function(t,e){var n,r,i=new Map;try{for(var a=J(e.keys()),o=a.next();!o.done;o=a.next()){var s=o.value,l=t.get(s);if(null!=l){var u=e.get(s),h=u.score,c=u.terms,d=u.match;yl(l.terms,c),i.set(s,{score:l.score+h,terms:l.terms,match:Object.assign(l.match,d)})}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},un[Sm]=function(t,e){var n,r;try{for(var i=J(e.keys()),a=i.next();!a.done;a=i.next()){var o=a.value;t.delete(o)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},un),ml=1.2,fl=.7,Lm=.5,Dm=function(t,e,n,r,i){return Math.log(1+(n-e+.5)/(e+.5))*(Lm+t*(ml+1)/(t+ml*(1-fl+fl*r/i)))},Fm=function(t){return function(e,n,r){return{term:e,fuzzy:"function"==typeof t.fuzzy?t.fuzzy(e,n,r):t.fuzzy||!1,prefix:"function"==typeof t.prefix?t.prefix(e,n,r):!0===t.prefix}}},go={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(Rm)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},gl={combineWith:mo,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},Pm={prefix:function(t,e,n){return e===n.length-1}},Cm=function(t,e){t.includes(e)||t.push(e)},yl=function(t,e){var n,r;try{for(var i=J(e),a=i.next();!a.done;a=i.next()){var o=a.value;t.includes(o)||t.push(o)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},vl=function(t,e){var n=t.score;return e.score-n},kl=function(){return new Map},Qi=function(t){var e,n,r=new Map;try{for(var i=J(Object.keys(t)),a=i.next();!a.done;a=i.next()){var o=a.value;r.set(parseInt(o,10),t[o])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},Rm=/[\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;f();var Bm=["0","1","2","3","4","5","6","7","8","9"],qm=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],Gm=["0","1","2","3","4","5","6","7","8","9"],Vm=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],bk=[...Bm,...qm,...Gm,...Vm],bl=["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"];f();var Et,Se,wt,Ye,pe,dn,cn,aa,pn,na,st,er,tr,xt,hn,ar,nr,ir,rf,mn,fn,Mo,Um=32,xe=!1,$m=120,yo=0,vo=class{constructor(t){m(this,"_callback"),m(this,"_frameCount"),m(this,"_ordering"),m(this,"_supersededBy"),m(this,"name"),m(this,"_remainingFrameCount"),m(this,"_lastFrameTime"),m(this,"userdata"),this._callback=t.callback,this._frameCount=null!=t.frameCount?t.frameCount:1,this._ordering=null!=t.ordering?t.ordering:0,this._supersededBy=null!=t.supersededBy?new Set(t.supersededBy):new Set,this.name=t.name,this.userdata=t.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,xe&&E.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}},Mt=class{constructor(t){if(m(this,"_postponed"),m(this,"userdata"),m(this,"_priority"),m(this,"_group"),m(this,"name"),m(this,"_lastFrameTime"),m(this,"_callback"),m(this,"_complete"),m(this,"_scheduled"),m(this,"_cancelled"),null!=t.group&&null!=t.priority)throw new Error("cannot specify task priority individually within group");if(null!=t.group&&null!=t.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=t.callback,this._group=null!=t.group?t.group:null,this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,xe&&E.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},ko=class{constructor(t){m(this,"_postponed"),m(this,"_onComplete"),m(this,"_priority"),m(this,"userdata"),m(this,"name"),m(this,"_tasks"),m(this,"_scheduledTasks"),m(this,"_scheduled"),m(this,"_cancelled"),this._onComplete=null!=t.onComplete?t.onComplete:()=>{},this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,xe&&E.log("task group instantiated",this.name)}isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let t of this._scheduledTasks)return this._scheduledTasks.delete(t),t}},Ml=class{constructor(t){m(this,"_maxMillisecondsPerFrame"),m(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:Um,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},bo=class{constructor(t){var e;m(this,"_raf"),m(this,"_timer"),m(this,"_performance"),m(this,"_scheduledUpdatesByOrdering"),m(this,"_scheduledTasksByPriority"),m(this,"_postponedTasks"),m(this,"_requestAnimationFrameHandle"),m(this,"_updatesToRunThisFrame"),m(this,"_lastFrameTime",0),m(this,"_updatesRunLastFrame"),this._timer=null!=(null==t?void 0:t.timer)?t.timer:new Ml,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new ln,this._scheduledTasksByPriority=new ln,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),xe&&E.log("task scheduler instantiated"),(null==(e=globalThis.MappedinDebug)?void 0:e.TEST_IOS)&&(this._raf=t=>setTimeout(t,16))}clear(){for(let t of this._scheduledTasksByPriority.values())t._cancelled=!0;for(let t of this._postponedTasks.values())t._cancelled=!0;this._scheduledUpdatesByOrdering=new ln,this._scheduledTasksByPriority=new ln,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),xe&&E.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle="function"==typeof this._raf?this._raf(this.update):requestAnimationFrame(this.update))}update(t){let e;this._timer.beginFrame(),this._performance&&(e=performance.now());let n=!1;xe&&(0===yo&&(n=!0),++yo,yo%=$m);let r=this._scheduledUpdatesByOrdering.keys();for(let t=r.length-1;t>=0;--t){let e=r[t];for(let t of this._scheduledUpdatesByOrdering.get(e).values())this._updatesToRunThisFrame.push(t),n&&E.log("update scheduled to run this frame",t.name)}for(let t of this._updatesToRunThisFrame){--t._remainingFrameCount,t._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(t._ordering,t),t._superseded=!1;for(let e of this._updatesToRunThisFrame)t._supersededBy.has(e)&&(t._superseded=!0,n&&E.log("update superseded",t.name,e.name))}for(let t=0;t<this._updatesToRunThisFrame.length;++t)this._updatesToRunThisFrame[t]._superseded&&(this._updatesToRunThisFrame.splice(t,1),--t);for(let e of this._updatesToRunThisFrame){let r;this._performance&&(r=performance.now()),e._callback(t),this._performance&&(e._lastFrameTime=performance.now()-r),n&&E.log("update completed",e.name)}this._updatesRunLastFrame.clear();for(let t of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(t);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(t)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-e),this._requestAnimationFrameHandle=null,(this._scheduledUpdatesByOrdering.size>0||this._scheduledTasksByPriority.size>0)&&this.requestAnimationFrame()}flushTasks(){for(;this._scheduledTasksByPriority.size>0;)this._executeOneTask(performance.now())}getLastFrameTime(){return this._lastFrameTime}getUpdatesRunLastFrame(){return this._updatesRunLastFrame}_executeOneTask(t){let e,n=this._scheduledTasksByPriority.popFromMaxKey(),r=null;E.assert(void 0!==n),Object.getPrototypeOf(n)===ko.prototype&&(r=n,n=r._popTask()),E.assert(void 0!==n),E.assert(Object.getPrototypeOf(n)===Mt.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),xe&&E.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),xe&&E.log("group completed",r.name)):this._scheduledTasksByPriority.insert(r._priority,r))}scheduleUpdate(t){t._remainingFrameCount=t._frameCount,this._scheduledUpdatesByOrdering.insert(t._ordering,t),this.requestAnimationFrame()}scheduleTask(t){if(Object.getPrototypeOf(t)===ko)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+t.name);if(t._scheduled)throw new Error("cannot schedule already scheduled task: "+t.name);if(t._cancelled)throw new Error("cannot schedule cancelled task: "+t.name);let e=t;"_group"in t&&null!=t._group&&(t._group._tasks.add(t),t._group._scheduledTasks.add(t),e=t._group),e._postponed?this._postponedTasks.add(e):this._scheduledTasksByPriority.insert(e._priority,e),t._scheduled=!0,e._scheduled=!0,xe&&E.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),xe&&E.log("update cancelled",t.name)}cancelTask(t){if(!t._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+t.name);if(t._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+t.name);if("_group"in t&&null!=t._group){let e=t._group.isComplete();t._group._tasks.delete(t),t._group._scheduledTasks.delete(t),t._group.isComplete()&&(this._scheduledTasksByPriority.delete(t._group._priority,t._group),e||t._group._onComplete())}else this._scheduledTasksByPriority.delete(t._priority,t),this._postponedTasks.delete(t);Object.getPrototypeOf(t)===Mt.prototype?t._cancelled=!0:"clear"in t&&t.clear(),xe&&E.log("task cancelled",t.name)}postponeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot postpone individual tasks in group: "+t.name);if(t._cancelled)throw new Error("cannot postpone cancelled task: "+t.name);if(!t._postponed){if(Object.getPrototypeOf(t)===Mt.prototype){if("_complete"in t)return;if(!t._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+t.name)}this._scheduledTasksByPriority.delete(t._priority,t),(Object.getPrototypeOf(t)===Mt.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,xe&&E.log("task postponed",t.name)}}resumeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot resume individual tasks in groups");if(t._cancelled)throw new Error("cannot resume cancelled task");if(t._postponed){if(Object.getPrototypeOf(t)===Mt.prototype){if("_complete"in t&&t._complete)return;if(!t._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(t),(Object.getPrototypeOf(t)===Mt.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),xe&&E.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===Mt.prototype&&!t._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(t._priority,t)&&(this._scheduledTasksByPriority.delete(t._priority,t),this._scheduledTasksByPriority.insert(e,t)),t._priority=e,xe&&E.log("task priority changed",t.name,e)}},ln=class{constructor(){m(this,"_map"),m(this,"_size"),m(this,"_sortedKeys"),this._map=new Map,this._size=0,this._sortedKeys=[]}has(t,e){return null!=this._map.get(t)&&this._map.get(t).has(e)}get(t){return this._map.get(t)}insert(t,e){if(E.assert("number"==typeof t&&Number.isFinite(t)),null==this._map.get(t)){this._map.set(t,new Set);for(let e=0;e<=this._sortedKeys.length;++e)if(e===this._sortedKeys.length||t<this._sortedKeys[e]){this._sortedKeys.splice(e,0,t);break}}this._map.get(t).has(e)||(this._map.get(t).add(e),++this._size)}delete(t,e){null!=this._map.get(t)&&this._map.get(t).has(e)&&(this._map.get(t).delete(e),--this._size,0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)))}pop(t){if(null!=this._map.get(t)){let e;for(e of this._map.get(t).values()){this._map.get(t).delete(e),--this._size;break}return 0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)),e}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let t=this._map.keys(),e=null,n={[Symbol.iterator]:()=>n,next:()=>{if(null==e){let n=t.next();if(n.done)return n;e=this._map.get(n.value).values()}let n=e.next();for(;n.done;){let r=t.next();if(r.done)return r;e=this._map.get(r.value).values(),n=e.next()}return n}};return n}keys(){return this._sortedKeys}get size(){let t=0;for(let e of this._map.values())t+=e.size;return E.assert(t===this._size),t}},ot=t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),ta="",Wm=.09,Hm=1,Jm=.025,Km=.5,Xm=5e-4,Ym=5e-4,Zm=.01,Qm=.05,wl=1,ef=.01,tf=.2,af={MappedinCategory:"categories",MappedinLocation:"locations"},nf={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:bl,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===j.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:Wm,PRIMARY_INDEX_WEIGHT:Hm,SECONDARY_INDEX_WEIGHT:Jm,CATEGORY_NAME_WEIGHT:Km,LOCATION_NAME_WEIGHT:wl,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:Xm,CATEGORY_LOCATION_TAGS_WEIGHT:Ym,CATEGORY_LOCATION_NAME_WEIGHT:Zm,PRIMARY_INDEX_TAGS_NAME_WEIGHT:Qm,LOCATION_DEFAULT_RANK:wl,RATIO_OF_FUZZY_TO_EXACT:ef,RATIO_OF_PREFIX_TO_EXACT:tf}},xl=class{constructor(t,e){var n,r,i;T(this,ir),T(this,Et,void 0),T(this,Se,void 0),T(this,wt,void 0),T(this,Ye,void 0),T(this,pe,void 0),T(this,dn,new bo({performance:!0})),T(this,cn,void 0),T(this,aa,void 0),T(this,pn,new Map),T(this,na,0),T(this,st,(t=>{br(this,na)._++,p(this,dn).scheduleUpdate(new vo({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),br(this,na)._--,0===p(this,na)&&p(this,hn).call(this)}}))})),T(this,er,(t=>{var e,n,r;let{SECONDARY_INDEX_WEIGHT:i,LOCATION_DEFAULT_RANK:a,PRIMARY_INDEX_TAGS_NAME_WEIGHT:o}=p(this,pe).constants,s=a;(null==(e=p(this,pe))?void 0:e.useLocationRank)&&(s=Array.isArray(t.polygons)?Math.max(...t.polygons.map((t=>{var e,n;return(null==(e=t.rank)?void 0:e.score)?null==(n=t.rank)?void 0:n.score:a})),a):a),p(this,st).call(this,(()=>{p(this,Se).add({name:ot(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:a,rank:s})})),(null==(n=p(this,pe))?void 0:n.searchTags)&&Array.isArray(t.tags)&&t.tags.forEach((e=>{p(this,Se).add({name:"",tag:ot(e),id:"MappedinLocation_"+t.id,weight:o,rank:s})})),(null==(r=p(this,pe))?void 0:r.searchDescriptions)&&p(this,st).call(this,(()=>p(this,wt).add({description:ot(t.description||""),id:"MappedinLocation_"+t.id,weight:i,rank:s})))})),T(this,tr,(t=>{var e,n;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:r,CATEGORY_LOCATION_TAGS_WEIGHT:i,CATEGORY_LOCATION_NAME_WEIGHT:a,CATEGORY_NAME_WEIGHT:o}=p(this,pe).constants;p(this,st).call(this,(()=>p(this,Se).add({name:ot(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:o})));let s=t.locations.reduce(((t,e)=>t+` ${ta} `+e.name),"")+` ${ta}`;if((null==(e=p(this,pe))?void 0:e.searchDescriptionsInCategories)&&t.locations.forEach((e=>{null!=e.description&&p(this,st).call(this,(()=>p(this,Ye).add({id:"MappedinCategory_"+t.id,"category.locations.description":ot(e.description),ref:e.name,weight:r})))})),null==(n=p(this,pe))?void 0:n.searchTagsInCategories){let e=t.locations.reduce(((t,e)=>{var n;return t+(null==(n=e.tags)?void 0:n.reduce(((t,e)=>t+` ${ta} `+e),""))+` ${ta}`}),"");p(this,st).call(this,(()=>p(this,Ye).add({"category.locations.tags":ot(e),id:"MappedinCategory_"+t.id,weight:i})))}p(this,st).call(this,(()=>p(this,Ye).add({"category.locations.name":ot(s),id:"MappedinCategory_"+t.id,weight:a})))})),T(this,xt,void 0),T(this,hn,void 0),T(this,ar,(t=>{var e;let n=t.score,{object:r,id:i,weight:a,rank:o}=t,[s,l]=i.split("_"),u=r||p(this,Et).getCollectionItemById(af[s],l);return o&&(null==(e=p(this,pe))?void 0:e.useLocationRank)&&(n+=o),a&&(n*=a),{score:n,type:s,object:u}})),T(this,nr,((t,e)=>{for(let n in t.match)t.match[n].forEach((r=>{let i=t.ref||t[r]||e.object[r];if("category.locations.tags"===r||"category.locations.name"===r){let e=new RegExp(`[^${ta}]* `+n+` [^${ta}]*`,"ig").exec(t[r]);null!=e&&(i=e[0].slice(1,-1))}e.matches.push({term:n,weight:t.weight,matchesOn:r,value:i})}))})),T(this,mn,void 0),T(this,fn,void 0),I(this,aa,new Yi({...t.options,testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)})),I(this,pe,{...nf,...e}),I(this,Et,t),I(this,cn,new Set(null==(n=p(this,pe))?void 0:n.stopWords));let{PRIMARY_INDEX_FUZZYNESS:a,PRIMARY_INDEX_WEIGHT:o,CATEGORY_NAME_WEIGHT:s,RATIO_OF_FUZZY_TO_EXACT:l,RATIO_OF_PREFIX_TO_EXACT:u,PRIMARY_INDEX_TAGS_NAME_WEIGHT:h}=p(this,pe).constants,c=["object","query","weight","tag","rank"],d={fields:["query","name","tag"],storeFields:c,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:a},boost:{name:o,query:o,tag:h},weights:{fuzzy:l,prefix:u},boostDocument:t=>t.includes("MappedinLocation")?o:t.includes("MappedinCategory")?s:o},f={fields:["description"],storeFields:c,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return(null==(n=p(this,cn))?void 0:n.has(t.toLowerCase()))?null:t.toLowerCase()}},m={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...c,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(I(this,xt,new Promise((t=>{I(this,hn,t)}))),null==(r=p(this,pe))?void 0:r.jsonIndex){let{primary:t,secondary:e,extra:n}=JSON.parse(null==(i=p(this,pe))?void 0:i.jsonIndex);I(this,Se,St.loadJS(t,d)),I(this,wt,St.loadJS(e,f)),I(this,Ye,St.loadJS(n,m))}else I(this,Se,new St(d)),I(this,wt,new St(f)),I(this,Ye,new St(m)),p(this,Et).locations.forEach(p(this,er)),p(this,Et).categories.forEach(p(this,tr));p(this,dn).update(performance.now()),I(this,mn,Xr(((t,e)=>{p(this,aa).trackSearchSuggest({query:t,hits:e})}),300)),I(this,fn,Xr(((t,e)=>{p(this,aa).trackSearch({query:t,hits:e})}),300))}async suggest(t){await p(this,xt);let{PRIMARY_INDEX_FUZZYNESS:e,PRIMARY_INDEX_WEIGHT:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:r,RATIO_OF_FUZZY_TO_EXACT:i,RATIO_OF_PREFIX_TO_EXACT:a}=p(this,pe).constants,o=p(this,Se).autoSuggest(t,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:e,boost:{name:n,query:n,tag:r},weights:{fuzzy:i,prefix:a}});return p(this,mn).call(this,t,o.length),{total:o.length,hits:o.map((t=>({text:t.suggestion})))}}async search(t){await p(this,xt);let e=et(this,ir,rf).call(this,t);return p(this,fn).call(this,t,e.length),e}async toJSON(){return await p(this,xt),JSON.stringify({primary:p(this,Se),secondary:p(this,wt),extra:p(this,Ye)})}async addQuery(t){let e,n,{query:r,object:i,weight:a=1}=t;await p(this,xt),e=i instanceof gt?"MappedinLocation":i instanceof Bt?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=p(this,pn).get(i),n||(n="Custom_"+it(),p(this,pn).set(i,n))),p(this,Se).add({id:n,weight:a,object:i,query:ot(r)})}};Et=new WeakMap,Se=new WeakMap,wt=new WeakMap,Ye=new WeakMap,pe=new WeakMap,dn=new WeakMap,cn=new WeakMap,aa=new WeakMap,pn=new WeakMap,na=new WeakMap,st=new WeakMap,er=new WeakMap,tr=new WeakMap,xt=new WeakMap,hn=new WeakMap,ar=new WeakMap,nr=new WeakMap,ir=new WeakSet,rf=function(t){let e=[],n=ot(t);e=[...p(this,Se).search(n),...p(this,wt).search(n),...p(this,Ye).search(n)].sort(((t,e)=>e.score-t.score));let r={};for(let t of e){let e=p(this,ar).call(this,t);r[t.id]?r[t.id].score+=e.score:r[t.id]={...e,matches:[]},p(this,nr).call(this,t,r[t.id])}return Object.keys(r).map((t=>({...r[t],matches:r[t].matches.sort(((t,e)=>e.weight-t.weight))}))).sort(((t,e)=>e.score-t.score))},mn=new WeakMap,fn=new WeakMap,f(),function(t){t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(Mo||(Mo={}));var Uo=globalThis.fetch;function kt(){if(null==Uo)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return Uo}function Bk(t){Uo=t}var dd,cd,Of=null==(cd=null==(dd=j)?void 0:dd.env)?void 0:cd.npm_package_version;globalThis.btoa||(globalThis.btoa=ud.encode);var zf=["ar"];function xn(t){let e={...so,things:ul,...t};return e.headers={...e.headers,"mappedin-sdk-version":Of},t.platformString&&(e.headers={...e.headers,"mappedin-platform-version":t.platformString}),e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e}async function Gk(t){let{venue:e,clientId:n,clientSecret:r,bundleBaseUri:i}=t,a=new Nt({venue:e}),o=Eu(await Sf({clientId:n,clientSecret:r,venue:e,bundleBaseUri:i},!1));return a.hydrateFromMVF(o),a}async function Af(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,...t}}),n="public/1/"+(e.useDraftData?"draft/":""),r=new Nt({...e,baseUrl:e.baseUrl+n});return await r.fetch(),r}function Vk(t){Af=t}var $o={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function Uk(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...$o,...t}),{url:n,updated_at:r}=await Nf(t),i=await kt()(n,{mode:"cors"}),{data:a,format:o="jsonstring"}=await i.json();if("jsonstring"!==o)throw new Error(`Unrecognized format ${o}`);let s=new Nt(e);return await s.hydrate(a,e.shouldPopulateBundledImagesAsBlobs),s.updatedAt=r,s}async function Nf(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...$o,...t}),{version:n,venue:r}=t,i=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&zf.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return e.language=void 0,await Ni(e,i)}async function $k(t,{url:e,updated_at:n}){let r=xn({baseUrl:"https://api-gateway.mappedin.com/",...$o,...t}),i=await kt()(e,{mode:"cors"}),{data:a,format:o="jsonstring"}=await i.json();if("jsonstring"!==o)throw new Error(`Unrecognized format${o}`);let s=new Nt(r);return await s.hydrate(a,r.shouldPopulateBundledImagesAsBlobs),s.updatedAt=n,s}async function ld(t){let e=xn({baseUrl:"https://api-gateway.mappedin.com/",...so,...t}),{version:n,venue:r}=t,i=`${t.bundleBaseUri||e.baseUrl+"exports/mvf/1/bundle"}?venue=${r}&version=1.0.0`;return e.language=void 0,await Ni(e,i)}async function Sf(t,e=!1){return new Promise((async(n,r)=>{try{let i=new TextDecoder,a=i.decode.bind(i),o=await Promise.resolve().then((()=>(sd(),od)));if(e){let e=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 ld(t),s=new Uint8Array(await kt()(i).then((t=>t.arrayBuffer()))),l=o.unzipSync(s),u=Object.keys(l),h=Math.min(u.length,Math.min(4,navigator.hardwareConcurrency)||4),c=[],d=u.map((t=>[t,l[t].buffer])),f=1e6,p=[],m=[];for(let t=0;t<d.length;t++){let[,e]=d[t];e.byteLength>=f?p.push(d[t]):e.byteLength<f&&m.push(d[t])}let g={};if(0===m.length)d.forEach((([t])=>{g[t]=JSON.parse(a(l[t]))})),n(g);else{let t=function({data:t}){let e=this;if("finished"===t[0]){let n=m[o];if(null!=n){let[t,r]=n;e.postMessage(["task",t]),e.postMessage(r,[r]),o++}let[r,i]=t[1];g[r]=i,s++}else if("error"===t[0]){let[,e]=t;c.forEach((t=>t.terminate())),r(e)}s===u.length&&(n(g),c.forEach((t=>t.terminate())))},i=URL.createObjectURL(e);for(let t=0;t<Math.min(h,m.length);t++)c.push(new Worker(i));let o=0,s=0;c.forEach((e=>{if(e.onmessage=t,null!=m[o]){let[t,n]=m[o];e.postMessage(["task",t]),e.postMessage(n,[n]),o++}})),p.forEach((([t])=>{g[t]=JSON.parse(a(l[t])),s++}))}}else{let{url:e}=await ld(t),r=new Uint8Array(await kt()(e).then((t=>t.arrayBuffer()))),i=o.unzipSync(r),s=Object.keys(i),l={};for(let t=0;t<s.length;t++){let e=s[t];if(0===e.indexOf("image/")&&-1===e.indexOf("__MACOSX"))l[e]=i[e].buffer;else if("/"!==e.slice(-1))try{l[e]=JSON.parse(a(i[e]))}catch(t){E.warn("bad file",e)}}n(l)}}catch(t){r(t)}}))}export{Mo as MAP_RENDER_MODE,Nt as Mappedin,Bt as MappedinCategory,nt as MappedinCollectionType,qa as MappedinCoordinate,zi as MappedinDestinationSet,Ia as MappedinDirections,Ei as MappedinEvent,gt as MappedinLocation,Ci as MappedinMap,Bi as MappedinMapGroup,mt as MappedinNavigatable,Gi as MappedinNode,Ct as MappedinPolygon,Ui as MappedinRankings,Hi as MappedinVenue,Ki as MappedinVortex,xl as OfflineSearch,Vk as __setGetVenueMock,$k as downloadBundle,Sf as downloadVenueBundleMVF,Af as getVenue,Uk as getVenueBundle,Nf as getVenueBundleURL,Gk as getVenueMVF,ld as getVenueMVFURL,kt as isomorphicFetch,Bk as setFetchFn};
1
+ var wc,_,mc=Object.create,Rt=Object.defineProperty,fc=Object.getOwnPropertyDescriptor,gc=Object.getOwnPropertyNames,yc=Object.getPrototypeOf,vc=Object.prototype.hasOwnProperty,kc=(e,t,n)=>t in e?Rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fs=e=>Rt(e,"__esModule",{value:!0}),u=(e,t)=>Rt(e,"name",{value:t,configurable:!0}),gs=(e,t)=>()=>(e&&(t=e(e=0)),t),B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bc=(e,t)=>{for(var n in fs(e),t)Rt(e,n,{get:t[n],enumerable:!0})},Mc=(e,t,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of gc(t))!vc.call(e,r)&&"default"!==r&&Rt(e,r,{get:()=>t[r],enumerable:!(n=fc(t,r))||n.enumerable});return e},Tr=e=>Mc(fs(Rt(null!=e?mc(yc(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),f=(e,t,n)=>(kc(e,"symbol"!=typeof t?t+"":t,n),n),Ir=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},h=(e,t,n)=>(Ir(e,t,"read from private field"),n?n.call(e):t.get(e)),I=(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)},O=(e,t,n,r)=>(Ir(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Or=(e,t,n,r)=>({set _(r){O(e,t,r,n)},get _(){return h(e,t,r)}}),tt=(e,t,n)=>(Ir(e,t,"access private method"),n),g=gs((()=>{_={env:wc={NODE_ENV:"production",npm_package_version:"5.1.2"}}})),vs=B(((e,t)=>{g(),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 o=u((function(e){this.message=e}),"InvalidCharacterError");o.prototype=new Error,o.prototype.name="InvalidCharacterError";var s=u((function(e){throw new o(e)}),"error"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=/[\t\n\f\r ]/g,c=u((function(e){var t=(e=String(e).replace(h,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,a="",o=-1;++o<t;)r=l.indexOf(e.charAt(o)),n=i%4?64*n+r:r,i++%4&&(a+=String.fromCharCode(255&n>>(-2*i&6)));return a}),"decode"),d={encode:u((function(e){e=String(e),/[^\0-\xFF]/.test(e)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var t,n,r,i,a=e.length%3,o="",u=-1,h=e.length-a;++u<h;)t=e.charCodeAt(u)<<16,n=e.charCodeAt(++u)<<8,r=e.charCodeAt(++u),o+=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),o+=l.charAt((i=t+n)>>10)+l.charAt(i>>4&63)+l.charAt(i<<2&63)+"="):1==a&&(i=e.charCodeAt(u),o+=l.charAt(i>>2)+l.charAt(i<<4&63)+"=="),o}),"encode"),decode:c,version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return d}));else if(r&&!r.nodeType)if(i)i.exports=d;else for(var f in d)d.hasOwnProperty(f)&&(r[f]=d[f]);else n.base64=d}(e)})),le=B((e=>{g(),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})),_a=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u((function(e,t){return t.reduce((function(t,n){if(null==e)throw new Error("'".concat(e,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(e,n)&&void 0!==n&&void 0===t?(t=n,n):t}),void 0)}),"getCoordinateKey");e.default=t})),Ta=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u((function(e){var t=e.toString().trim();return!isNaN(parseFloat(t))&&parseFloat(t)===Number(t)}),"isDecimal");e.default=t})),Ia=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=le(),n=u((function(e){return t.sexagesimalPattern.test(e.toString().trim())}),"isSexagesimal");e.default=n})),Oa=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=le(),n=u((function(e){var n=new RegExp(t.sexagesimalPattern).exec(e);if(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}),"sexagesimalToDecimal");e.default=n})),Bn=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=le(),n=r(_a());function r(e){return e&&e.__esModule?e:{default:e}}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){o(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 o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}u(r,"_interopRequireDefault"),u(i,"ownKeys"),u(a,"_objectSpread"),u(o,"_defineProperty");var s=u((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:t.longitudeKeys,latitude:t.latitudeKeys,altitude:t.altitudeKeys},i=(0,n.default)(e,r.longitude),o=(0,n.default)(e,r.latitude),s=(0,n.default)(e,r.altitude);return a({latitude:o,longitude:i},s?{altitude:s}:{})}),"getCoordinateKeys");e.default=s})),Sr=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(Ta()),n=a(Ia()),r=a(Oa()),i=le();function a(e){return e&&e.__esModule?e:{default:e}}u(a,"_interopRequireDefault");var o=u((function e(a){return(0,t.default)(a)?!(parseFloat(a)>i.MAXLAT||a<i.MINLAT):!!(0,n.default)(a)&&e((0,r.default)(a))}),"isValidLatitude");e.default=o})),Lr=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(Ta()),n=a(Ia()),r=a(Oa()),i=le();function a(e){return e&&e.__esModule?e:{default:e}}u(a,"_interopRequireDefault");var o=u((function e(a){return(0,t.default)(a)?!(parseFloat(a)>i.MAXLON||a<i.MINLON):!!(0,n.default)(a)&&e((0,r.default)(a))}),"isValidLongitude");e.default=o})),Fr=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(Bn()),n=i(Sr()),r=i(Lr());function i(e){return e&&e.__esModule?e:{default:e}}u(i,"_interopRequireDefault");var a=u((function(e){var i=(0,t.default)(e),a=i.latitude,o=i.longitude;if(Array.isArray(e)&&e.length>=2)return(0,r.default)(e[0])&&(0,n.default)(e[1]);if(void 0===a||void 0===o)return!1;var s=e[o],l=e[a];return!(void 0===l||void 0===s||!1===(0,n.default)(l)||!1===(0,r.default)(s))}),"isValidCoordinate");e.default=a})),$n=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=o(Ta()),n=o(Ia()),r=o(Oa()),i=o(Fr()),a=o(Bn());function o(e){return e&&e.__esModule?e:{default:e}}function s(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?s(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}u(o,"_interopRequireDefault"),u(s,"ownKeys"),u(l,"_objectSpread"),u(h,"_defineProperty");var c=u((function e(o){if((0,t.default)(o))return Number(o);if((0,n.default)(o))return(0,r.default)(o);if((0,i.default)(o)){var s=(0,a.default)(o);return Array.isArray(o)?o.map((function(t,n){return[0,1].includes(n)?e(t):t})):l(l(l({},o),s.latitude&&h({},s.latitude,e(o[s.latitude]))),s.longitude&&h({},s.longitude,e(o[s.longitude])))}return Array.isArray(o)?o.map((function(t){return(0,i.default)(t)?e(t):t})):o}),"toDecimal");e.default=c})),ze=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=le(),n=i(_a()),r=i($n());function i(e){return e&&e.__esModule?e:{default:e}}u(i,"_interopRequireDefault");var a=u((function(e,i){var a=(0,n.default)(e,t.latitudeKeys);if(null!=a){var o=e[a];return!0===i?o:(0,r.default)(o)}}),"getLatitude");e.default=a})),Ae=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=le(),n=i(_a()),r=i($n());function i(e){return e&&e.__esModule?e:{default:e}}u(i,"_interopRequireDefault");var a=u((function(e,i){var a=(0,n.default)(e,t.longitudeKeys);if(null!=a){var o=e[a];return!0===i?o:(0,r.default)(o)}}),"getLongitude");e.default=a})),Ve=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u((function(e){return e*Math.PI/180}),"toRad");e.default=t})),zt=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u((function(e){return 180*e/Math.PI}),"toDeg");e.default=t})),zs=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=o(ze()),n=o(Ae()),r=o(Ve()),i=o(zt()),a=le();function o(e){return e&&e.__esModule?e:{default:e}}u(o,"_interopRequireDefault");var s=u((function(e,o,s){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,t.default)(e),h=(0,n.default)(e),c=o/l,d=(0,r.default)(s),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)),m=p+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(g)),y=(0,i.default)(m);return(y<a.MINLON||y>a.MAXLON)&&(m=(m+3*Math.PI)%(2*Math.PI)-Math.PI,y=(0,i.default)(m)),{latitude:(0,i.default)(g),longitude:y}}),"computeDestinationPoint");e.default=s})),As=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=le(),n=u((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.")}),"convertArea");e.default=n})),Ns=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=le(),n=u((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.")}),"convertDistance");e.default=n})),Ss=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=le(),n=u((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}}),"convertSpeed");e.default=n})),Ds=B((e=>{function t(e,t){return o(e)||a(e,t)||r(e,t)||n()}function n(){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 r(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}function i(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}function a(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&null!=s.return&&s.return()}finally{if(i)throw a}}return n}}function o(e){if(Array.isArray(e))return e}g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,u(t,"_slicedToArray"),u(n,"_nonIterableRest"),u(r,"_unsupportedIterableToArray"),u(i,"_arrayLikeToArray"),u(a,"_iterableToArrayLimit"),u(o,"_arrayWithHoles");var s=u((function(e){var t=Math.pow(10,12);return Math.round(e*t)/t}),"imprecise"),l=u((function(e){var n=t(e.toString().split("."),2),r=n[0],i=n[1],a=Math.abs(Number(r)),o=s(60*Number("0."+(i||0))),l=Math.floor(o),u=s(60*(o%l||0));return a+"° "+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(".")+'"'}),"decimal2sexagesimal");e.default=l})),qr=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u((function(e){return e>1?1:e<-1?-1:e}),"robustAcos");e.default=t})),ft=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=o(ze()),n=o(Ae()),r=o(Ve()),i=o(qr()),a=le();function o(e){return e&&e.__esModule?e:{default:e}}u(o,"_interopRequireDefault");var s=u((function(e,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=void 0===s||isNaN(s)?1:s;var l=(0,t.default)(e),u=(0,n.default)(e),h=(0,t.default)(o),c=(0,n.default)(o),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/s)*s}),"getDistance");e.default=s})),Gr=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(ft());function n(e){return e&&e.__esModule?e:{default:e}}u(n,"_interopRequireDefault");var r=u((function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.default;return r="function"==typeof r?r:t.default,n.slice().sort((function(t,n){return r(e,t)-r(e,n)}))}),"orderByDistance");e.default=r})),Rs=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(Gr());function n(e){return e&&e.__esModule?e:{default:e}}u(n,"_interopRequireDefault");var r=u((function(e,n){return(0,t.default)(e,n)[0]}),"findNearest");e.default=r})),Gs=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(Ve()),n=a(ze()),r=a(Ae()),i=le();function a(e){return e&&e.__esModule?e:{default:e}}u(a,"_interopRequireDefault");var o=u((function(e){var a=0;if(e.length>2){for(var o,s,l,u=0;u<e.length;u++){u===e.length-2?(o=e.length-2,s=e.length-1,l=0):u===e.length-1?(o=e.length-1,s=0,l=1):(o=u,s=u+1,l=u+2);var h=(0,r.default)(e[o]),c=(0,n.default)(e[s]),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)}),"getAreaOfPolygon");e.default=o})),$r=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(ze()),n=r(Ae());function r(e){return e&&e.__esModule?e:{default:e}}u(r,"_interopRequireDefault");var i=u((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})}),"getBounds");e.default=i})),Us=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=o(ze()),n=o(Ae()),r=o(Ve()),i=o(zt()),a=le();function o(e){return e&&e.__esModule?e:{default:e}}u(o,"_interopRequireDefault");var s=u((function(e,o){var s,l,u=(0,t.default)(e),h=(0,n.default)(e),c=(0,r.default)(u),d=(0,r.default)(h),f=o/a.earthRadius,p=c-f,g=c+f,m=(0,r.default)(a.MAXLAT),y=(0,r.default)(a.MINLAT),v=(0,r.default)(a.MAXLON),_=(0,r.default)(a.MINLON);if(p>y&&g<m){var w=Math.asin(Math.sin(f)/Math.cos(c));(s=d-w)<_&&(s+=2*Math.PI),(l=d+w)>v&&(l-=2*Math.PI)}else p=Math.max(p,y),g=Math.min(g,m),s=_,l=v;return[{latitude:(0,i.default)(p),longitude:(0,i.default)(s)},{latitude:(0,i.default)(g),longitude:(0,i.default)(l)}]}),"getBoundsOfDistance");e.default=s})),Hs=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(ze()),n=a(Ae()),r=a(Ve()),i=a(zt());function a(e){return e&&e.__esModule?e:{default:e}}u(a,"_interopRequireDefault");var o=u((function(e){if(!1===Array.isArray(e)||0===e.length)return!1;var a=e.length,o=e.reduce((function(e,i){var a=(0,r.default)((0,t.default)(i)),o=(0,r.default)((0,n.default)(i));return{X:e.X+Math.cos(a)*Math.cos(o),Y:e.Y+Math.cos(a)*Math.sin(o),Z:e.Z+Math.sin(a)}}),{X:0,Y:0,Z:0}),s=o.X/a,l=o.Y/a,u=o.Z/a;return{longitude:(0,i.default)(Math.atan2(l,s)),latitude:(0,i.default)(Math.atan2(u,Math.sqrt(s*s+l*l)))}}),"getCenter");e.default=o})),Js=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n($r());function n(e){return e&&e.__esModule?e:{default:e}}u(n,"_interopRequireDefault");var r=u((function(e){var n=(0,t.default)(e),r=n.minLat+(n.maxLat-n.minLat)/2,i=n.minLng+(n.maxLng-n.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(i.toFixed(6))}}),"getCenterOfBounds");e.default=r})),Wr=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(ze()),n=a(Ae()),r=a(Ve()),i=a(zt());function a(e){return e&&e.__esModule?e:{default:e}}u(a,"_interopRequireDefault");var o=u((function(e,a){var o=(0,r.default)((0,n.default)(a))-(0,r.default)((0,n.default)(e)),s=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(o)>Math.PI&&(o=o>0?-1*(2*Math.PI-o):2*Math.PI+o),((0,i.default)(Math.atan2(o,s))+360)%360}),"getRhumbLineBearing");e.default=o})),Zs=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(Wr());function n(e){return e&&e.__esModule?e:{default:e}}u(n,"_interopRequireDefault");var r=u((function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.default,i="function"==typeof r?r(e,n):(0,t.default)(e,n);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"}}),"getCompassDirection");e.default=r})),Jr=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(ft()),n=r(qr());function r(e){return e&&e.__esModule?e:{default:e}}u(r,"_interopRequireDefault");var i=u((function(e,r,i){var a=(0,t.default)(r,e),o=(0,t.default)(e,i),s=(0,t.default)(r,i),l=Math.acos((0,n.default)((a*a+s*s-o*o)/(2*a*s))),u=Math.acos((0,n.default)((o*o+s*s-a*a)/(2*o*s)));return l>Math.PI/2?a:u>Math.PI/2?o:Math.sin(l)*a}),"getDistanceFromLine");e.default=i})),nu=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(ze()),n=a(Ae()),r=a(Ve()),i=a(zt());function a(e){return e&&e.__esModule?e:{default:e}}u(a,"_interopRequireDefault");var o=u((function(e,a){var o=(0,t.default)(a),s=(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)(s)-(0,r.default)(u))*Math.cos((0,r.default)(o)),Math.cos((0,r.default)(l))*Math.sin((0,r.default)(o))-Math.sin((0,r.default)(l))*Math.cos((0,r.default)(o))*Math.cos((0,r.default)(s)-(0,r.default)(u))))+360)%360}),"getGreatCircleBearing");e.default=o})),iu=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(ft());function n(e){return e&&e.__esModule?e:{default:e}}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?u((function(e){return typeof e}),"_typeof"):u((function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}),"_typeof"))(e)}u(n,"_interopRequireDefault"),u(r,"_typeof");var i=u((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.default;return e.reduce((function(e,t){return"object"===r(e)&&null!==e.last&&(e.distance+=n(t,e.last)),e.last=t,e}),{last:null,distance:0}).distance}),"getPathLength");e.default=i})),uu=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(ze()),n=a(Ae()),r=a(Ve()),i=le();function a(e){return e&&e.__esModule?e:{default:e}}u(a,"_interopRequireDefault");var o=u((function(e,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;o=void 0===o||isNaN(o)?1:o;var s,l,u,h,c,d,f,p=(0,t.default)(e),g=(0,n.default)(e),m=(0,t.default)(a),y=(0,n.default)(a),v=6356752.314245,_=1/298.257223563,w=(0,r.default)(y-g),M=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(p)))),b=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(m)))),O=Math.sin(M),I=Math.cos(M),x=Math.sin(b),k=Math.cos(b),E=w,T=100;do{var F=Math.sin(E),A=Math.cos(E);if(0===(d=Math.sqrt(k*F*(k*F)+(I*x-O*k*A)*(I*x-O*k*A))))return 0;s=O*x+I*k*A,l=Math.atan2(d,s),c=s-2*O*x/(h=1-(u=I*k*F/d)*u),isNaN(c)&&(c=0);var N=_/16*h*(4+_*(4-3*h));f=E,E=w+(1-N)*_*u*(l+N*d*(c+N*s*(2*c*c-1)))}while(Math.abs(E-f)>1e-12&&--T>0);if(0===T)return NaN;var S=h*(i.earthRadius*i.earthRadius-v*v)/(v*v),D=1+S/16384*(4096+S*(S*(320-175*S)-768)),L=S/1024*(256+S*(S*(74-47*S)-128)),P=L*d*(c+L/4*(s*(2*c*c-1)-L/6*c*(4*d*d-3)*(4*c*c-3))),B=v*D*(l-P);return Math.round(B/o)*o}),"getDistance");e.default=o})),lu=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u((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}),"getRoughCompassDirection");e.default=t})),cu=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(ft());function n(e){return e&&e.__esModule?e:{default:e}}u(n,"_interopRequireDefault");var r=u((function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.default,i=r(e,n),a=Number(n.time)-Number(e.time),o=i/a*1e3;return o}),"getSpeed");e.default=r})),du=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(ft());function n(e){return e&&e.__esModule?e:{default:e}}u(n,"_interopRequireDefault");var r=u((function(e,n,r){return(0,t.default)(n,e)+(0,t.default)(e,r)===(0,t.default)(n,r)}),"isPointInLine");e.default=r})),hu=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(ze()),n=r(Ae());function r(e){return e&&e.__esModule?e:{default:e}}u(r,"_interopRequireDefault");var i=u((function(e,r){for(var i=!1,a=r.length,o=-1,s=a-1;++o<a;s=o)((0,n.default)(r[o])<=(0,n.default)(e)&&(0,n.default)(e)<(0,n.default)(r[s])||(0,n.default)(r[s])<=(0,n.default)(e)&&(0,n.default)(e)<(0,n.default)(r[o]))&&(0,t.default)(e)<((0,t.default)(r[s])-(0,t.default)(r[o]))*((0,n.default)(e)-(0,n.default)(r[o]))/((0,n.default)(r[s])-(0,n.default)(r[o]))+(0,t.default)(r[o])&&(i=!i);return i}),"isPointInPolygon");e.default=i})),mu=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(Jr());function n(e){return e&&e.__esModule?e:{default:e}}u(n,"_interopRequireDefault");var r=u((function(e,n,r,i){return(0,t.default)(e,n,r)<i}),"isPointNearLine");e.default=r})),fu=B((e=>{g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(ft());function n(e){return e&&e.__esModule?e:{default:e}}u(n,"_interopRequireDefault");var r=u((function(e,n,r){return(0,t.default)(e,n)<r}),"isPointWithinRadius");e.default=r})),yu=B((e=>{function t(e,t){return o(e)||a(e,t)||r(e,t)||n()}function n(){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 r(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}function i(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}function a(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&null!=s.return&&s.return()}finally{if(i)throw a}}return n}}function o(e){if(Array.isArray(e))return e}g(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,u(t,"_slicedToArray"),u(n,"_nonIterableRest"),u(r,"_unsupportedIterableToArray"),u(i,"_arrayLikeToArray"),u(a,"_iterableToArrayLimit"),u(o,"_arrayWithHoles");var s=u((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)}}))}),"wktToPolygon");e.default=s})),ku=B((e=>{g(),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:u((function(){return n.default}),"get")}),Object.defineProperty(e,"convertArea",{enumerable:!0,get:u((function(){return r.default}),"get")}),Object.defineProperty(e,"convertDistance",{enumerable:!0,get:u((function(){return i.default}),"get")}),Object.defineProperty(e,"convertSpeed",{enumerable:!0,get:u((function(){return a.default}),"get")}),Object.defineProperty(e,"decimalToSexagesimal",{enumerable:!0,get:u((function(){return o.default}),"get")}),Object.defineProperty(e,"findNearest",{enumerable:!0,get:u((function(){return s.default}),"get")}),Object.defineProperty(e,"getAreaOfPolygon",{enumerable:!0,get:u((function(){return l.default}),"get")}),Object.defineProperty(e,"getBounds",{enumerable:!0,get:u((function(){return h.default}),"get")}),Object.defineProperty(e,"getBoundsOfDistance",{enumerable:!0,get:u((function(){return c.default}),"get")}),Object.defineProperty(e,"getCenter",{enumerable:!0,get:u((function(){return d.default}),"get")}),Object.defineProperty(e,"getCenterOfBounds",{enumerable:!0,get:u((function(){return f.default}),"get")}),Object.defineProperty(e,"getCompassDirection",{enumerable:!0,get:u((function(){return p.default}),"get")}),Object.defineProperty(e,"getCoordinateKey",{enumerable:!0,get:u((function(){return m.default}),"get")}),Object.defineProperty(e,"getCoordinateKeys",{enumerable:!0,get:u((function(){return y.default}),"get")}),Object.defineProperty(e,"getDistance",{enumerable:!0,get:u((function(){return v.default}),"get")}),Object.defineProperty(e,"getDistanceFromLine",{enumerable:!0,get:u((function(){return _.default}),"get")}),Object.defineProperty(e,"getGreatCircleBearing",{enumerable:!0,get:u((function(){return w.default}),"get")}),Object.defineProperty(e,"getLatitude",{enumerable:!0,get:u((function(){return M.default}),"get")}),Object.defineProperty(e,"getLongitude",{enumerable:!0,get:u((function(){return b.default}),"get")}),Object.defineProperty(e,"getPathLength",{enumerable:!0,get:u((function(){return O.default}),"get")}),Object.defineProperty(e,"getPreciseDistance",{enumerable:!0,get:u((function(){return I.default}),"get")}),Object.defineProperty(e,"getRhumbLineBearing",{enumerable:!0,get:u((function(){return x.default}),"get")}),Object.defineProperty(e,"getRoughCompassDirection",{enumerable:!0,get:u((function(){return k.default}),"get")}),Object.defineProperty(e,"getSpeed",{enumerable:!0,get:u((function(){return E.default}),"get")}),Object.defineProperty(e,"isDecimal",{enumerable:!0,get:u((function(){return T.default}),"get")}),Object.defineProperty(e,"isPointInLine",{enumerable:!0,get:u((function(){return F.default}),"get")}),Object.defineProperty(e,"isPointInPolygon",{enumerable:!0,get:u((function(){return A.default}),"get")}),Object.defineProperty(e,"isPointNearLine",{enumerable:!0,get:u((function(){return N.default}),"get")}),Object.defineProperty(e,"isPointWithinRadius",{enumerable:!0,get:u((function(){return S.default}),"get")}),Object.defineProperty(e,"isSexagesimal",{enumerable:!0,get:u((function(){return D.default}),"get")}),Object.defineProperty(e,"isValidCoordinate",{enumerable:!0,get:u((function(){return L.default}),"get")}),Object.defineProperty(e,"isValidLatitude",{enumerable:!0,get:u((function(){return P.default}),"get")}),Object.defineProperty(e,"isValidLongitude",{enumerable:!0,get:u((function(){return B.default}),"get")}),Object.defineProperty(e,"orderByDistance",{enumerable:!0,get:u((function(){return j.default}),"get")}),Object.defineProperty(e,"sexagesimalToDecimal",{enumerable:!0,get:u((function(){return R.default}),"get")}),Object.defineProperty(e,"toDecimal",{enumerable:!0,get:u((function(){return C.default}),"get")}),Object.defineProperty(e,"toRad",{enumerable:!0,get:u((function(){return W.default}),"get")}),Object.defineProperty(e,"toDeg",{enumerable:!0,get:u((function(){return z.default}),"get")}),Object.defineProperty(e,"wktToPolygon",{enumerable:!0,get:u((function(){return U.default}),"get")});var n=$(zs()),r=$(As()),i=$(Ns()),a=$(Ss()),o=$(Ds()),s=$(Rs()),l=$(Gs()),h=$($r()),c=$(Us()),d=$(Hs()),f=$(Js()),p=$(Zs()),m=$(_a()),y=$(Bn()),v=$(ft()),_=$(Jr()),w=$(nu()),M=$(ze()),b=$(Ae()),O=$(iu()),I=$(uu()),x=$(Wr()),k=$(lu()),E=$(cu()),T=$(Ta()),F=$(du()),A=$(hu()),N=$(mu()),S=$(fu()),D=$(Ia()),L=$(Fr()),P=$(Sr()),B=$(Lr()),j=$(Gr()),R=$(Oa()),C=$($n()),W=$(Ve()),z=$(zt()),U=$(yu()),G=le();function $(e){return e&&e.__esModule?e:{default:e}}Object.keys(G).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(e,n,{enumerable:!0,get:u((function(){return G[n]}),"get")})})),u($,"_interopRequireDefault")})),Uu=B(((e,t)=>{g(),t.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))})),Ku=B(((e,t)=>{g();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(e){}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 o(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(r)||[],n=1;n<t.length;n++)t=(e=a(t,n).join("")).match(r)||[];return e}}function s(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var r=o(n[0]);r!==n[0]&&(t[n[0]]=r)}n=i.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),s=0;s<a.length;s++){var l=a[s];e=e.replace(new RegExp(l,"g"),t[l])}return e}u(a,"decodeComponents"),u(o,"decode"),u(s,"customDecodeURIComponent"),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(t){return s(e)}}})),Yu=B(((e,t)=>{g(),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)]}})),Qu=B(((e,t)=>{g(),t.exports=function(e,t){for(var n={},r=Object.keys(e),i=Array.isArray(t),a=0;a<r.length;a++){var o=r[a],s=e[o];(i?-1!==t.indexOf(o):t(o,s,e))&&(n[o]=s)}return n}})),sl=B((e=>{g();var t=Uu(),n=Ku(),r=Yu(),i=Qu(),a=u((e=>null==e),"isNullOrUndefined"),o=Symbol("encodeFragmentIdentifier");function s(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,[c(t,e),"[",i,"]"].join("")]:[...n,[c(t,e),"[",c(i,e),"]=",c(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[c(t,e),"[]"].join("")]:[...n,[c(t,e),"[]=",c(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?[[c(n,e),t,c(i,e)].join("")]:[[r,c(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,c(t,e)]:[...n,[c(t,e),"=",c(r,e)].join("")]}}function l(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&&d(n,e).includes(e.arrayFormatSeparator);n=a?d(n,e):n;let o=i||a?n.split(e.arrayFormatSeparator).map((t=>d(t,e))):null===n?n:d(n,e);r[t]=o};case"bracket-separator":return(t,n,r)=>{let i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(r[t]=n&&d(n,e));let a=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>d(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}}}function h(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,n){return n.encode?n.strict?t(e):encodeURIComponent(e):e}function d(e,t){return t.decode?n(e):e}function f(e){return Array.isArray(e)?e.sort():"object"==typeof e?f(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function p(e){let t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function m(e){let t="",n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}function y(e){let t=(e=p(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function v(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 _(e,t){h((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let n=l(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,o]=r(t.decode?a.replace(/\+/g," "):a,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:d(o,t),n(d(e,t),o,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]=v(n[e],t);else i[e]=v(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]=f(n):e[t]=n,e}),Object.create(null))}u(s,"encoderForArrayFormat"),u(l,"parserForArrayFormat"),u(h,"validateArrayFormatSeparator"),u(c,"encode"),u(d,"decode"),u(f,"keysSorter"),u(p,"removeHash"),u(m,"getHash"),u(y,"extract"),u(v,"parseValue"),u(_,"parse"),e.extract=y,e.parse=_,e.stringify=(e,t)=>{if(!e)return"";h((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let n=u((n=>t.skipNull&&a(e[n])||t.skipEmptyString&&""===e[n]),"shouldFilter"),r=s(t),i={};for(let t of Object.keys(e))n(t)||(i[t]=e[t]);let o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map((n=>{let i=e[n];return void 0===i?"":null===i?c(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?c(n,t)+"[]":i.reduce(r(n),[]).join("&"):c(n,t)+"="+c(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:_(y(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:d(i,t)}:{})},e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0,[o]:!0},n);let r=p(t.url).split("?")[0]||"",i=e.extract(t.url),a=e.parse(i,{sort:!1}),s=Object.assign(a,t.query),l=e.stringify(s,n);l&&(l=`?${l}`);let u=m(t.url);return t.fragmentIdentifier&&(u=`#${n[o]?c(t.fragmentIdentifier,n):t.fragmentIdentifier}`),`${r}${l}${u}`},e.pick=(t,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[o]:!1},r);let{url:a,query:s,fragmentIdentifier:l}=e.parseUrl(t,r);return e.stringifyUrl({url:a,query:i(s,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)}})),sc={};function Qo(e,t){return!t&&"function"==typeof e&&(t=e,e={}),this.ondata=t,e}function Hl(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&F(7),ka(e,t,[va],(function(e){return Tt(An(e.data[0],e.data[1]))}),0,n)}function An(e,t){return Pt(e,t||{},0,0)}function ts(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&F(7),ka(e,t,[ya],(function(e){return Tt(Ma(e.data[0],Ho(e.data[1])))}),1,n)}function Ma(e,t){return On(e,t)}function df(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&F(7),ka(e,t,[va,Bl,function(){return[ns]}],(function(e){return Tt(ns(e.data[0],e.data[1]))}),2,n)}function ns(e,t){t||(t={});var n=ga(),r=e.length;n.p(e);var i=Pt(e,t,Yo(t),8),a=i.length;return Ko(i,t),Y(i,a-8,n.d()),Y(i,a-4,r),i}function Kl(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&F(7),ka(e,t,[ya,ql,function(){return[Mr]}],(function(e){return Tt(Mr(e.data[0]))}),3,n)}function Mr(e,t){return On(e.subarray(Xo(e),-8),t||new H(Ul(e)))}function hf(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&F(7),ka(e,t,[va,Gl,function(){return[rs]}],(function(e){return Tt(rs(e.data[0],e.data[1]))}),4,n)}function rs(e,t){t||(t={});var n=Wo();n.p(e);var r=Pt(e,t,2,4);return Zo(r,t),Y(r,r.length-4,n.d()),r}function Yl(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&F(7),ka(e,t,[ya,Vl,function(){return[xr]}],(function(e){return Tt(xr(e.data[0],Ho(e.data[1])))}),5,n)}function xr(e,t){return On(($l(e),e.subarray(2,-4)),t)}function ff(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&F(7),31==e[0]&&139==e[1]&&8==e[2]?Kl(e,t,n):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?ts(e,t,n):Yl(e,t,n)}function gf(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?Mr(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?Ma(e,t):xr(e,t)}function It(e,t){if(t){for(var n=new H(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Ql)return Ql.encode(e);var i=e.length,a=new H(e.length+(e.length>>1)),o=0,s=u((function(e){a[o++]=e}),"w");for(r=0;r<i;++r){if(o+5>a.length){var l=new H(o+8+(i-r<<1));l.set(a),a=l}var h=e.charCodeAt(r);h<128||t?s(h):h<2048?(s(192|h>>6),s(128|63&h)):h>55295&&h<57344?(s(240|(h=65536+(1047552&h)|1023&e.charCodeAt(++r))>>18),s(128|h>>12&63),s(128|h>>6&63),s(128|63&h)):(s(224|h>>12),s(128|h>>6&63),s(128|63&h))}return Fe(a,0,o)}function us(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(ss)return ss.decode(e);var i=tc(e),a=i[0];return i[1].length&&F(8),a}function wf(e,t,n){n||(n=t,t={}),"function"!=typeof n&&F(7);var r={};os(e,"",r,t);var i=Object.keys(r),a=i.length,o=0,s=0,l=a,h=new Array(a),c=[],d=u((function(){for(var e=0;e<c.length;++e)c[e]()}),"tAll"),f=u((function(e,t){jr((function(){n(e,t)}))}),"cbd");jr((function(){f=n}));var p=u((function(){var e=new H(s+22),t=o,n=s-o;s=0;for(var r=0;r<l;++r){var i=h[r];try{var a=i.c.length;wa(e,s,i,i.f,i.u,a);var u=30+i.f.length+Ot(i.extra),c=s+u;e.set(i.c,c),wa(e,o,i,i.f,i.u,a,s,i.m),o+=16+u+(i.m?i.m.length:0),s=c+a}catch(e){return f(e,null)}}ls(e,o,h.length,n,t),f(null,e)}),"cbf");a||p();for(var g=u((function(e){var t=i[e],n=r[t],l=n[0],g=n[1],m=ga(),y=l.length;m.p(l);var v=It(t),_=v.length,w=g.comment,M=w&&It(w),b=M&&M.length,O=Ot(g.extra),I=0==g.level?0:8,x=u((function(n,r){if(n)d(),f(n,null);else{var i=r.length;h[e]=zn(g,{size:y,crc:m.d(),c:r,f:v,m:M,u:_!=t.length||M&&w.length!=b,compression:I}),o+=30+_+O+i,s+=76+2*(_+O)+(b||0)+i,--a||p()}}),"cbl");if(_>65535&&x(F(11,0,1),null),I)if(y<16e4)try{x(null,An(l,g))}catch(e){x(e,null)}else c.push(Hl(l,g,x));else x(null,l)}),"_loop_1"),m=0;m<l;++m)g(m);return d}function xf(e,t){t||(t={});var n={},r=[];os(e,"",n,t);var i=0,a=0;for(var o in n){var s=n[o],l=s[0],u=s[1],h=0==u.level?0:8,c=(O=It(o)).length,d=u.comment,f=d&&It(d),p=f&&f.length,g=Ot(u.extra);c>65535&&F(11);var m=h?An(l,u):l,y=m.length,v=ga();v.p(l),r.push(zn(u,{size:l.length,crc:v.d(),c:m,f:O,m:f,u:c!=o.length||f&&d.length!=p,o:i,compression:h})),i+=30+c+g+y,a+=76+2*(c+g)+(p||0)+y}for(var _=new H(a+22),w=i,M=a-i,b=0;b<r.length;++b){var O=r[b];wa(_,O.o,O,O.f,O.u,O.c.length);var I=30+O.f.length+Ot(O.extra);_.set(O.c,O.o+I),wa(_,i,O,O.f,O.u,O.c.length,O.o,O.m),i+=16+I+(O.m?O.m.length:0)}return ls(_,i,r.length,M,w),_}function If(e,t,n){n||(n=t,t={}),"function"!=typeof n&&F(7);var r=[],i=u((function(){for(var e=0;e<r.length;++e)r[e]()}),"tAll"),a={},o=u((function(e,t){jr((function(){n(e,t)}))}),"cbd");jr((function(){o=n}));for(var s=e.length-22;101010256!=ae(e,s);--s)if(!s||e.length-s>65558)return o(F(13,0,1),null),i;var l=ke(e,s+8);if(l){var h=l,c=ae(e,s+16),d=4294967295==c;if(d){if(s=ae(e,s-12),101075792!=ae(e,s))return o(F(13,0,1),null),i;h=l=ae(e,s+32),c=ae(e,s+48)}for(var f=t&&t.filter,p=u((function(t){var n=ic(e,c,d),s=n[0],h=n[1],p=n[2],g=n[3],m=n[4],y=n[5],v=nc(e,y);c=m;var _=u((function(e,t){e?(i(),o(e,null)):(t&&(a[g]=t),--l||o(null,a))}),"cbl");if(!f||f({name:g,size:h,originalSize:p,compression:s}))if(s)if(8==s){var w=e.subarray(v,v+h);if(h<32e4)try{_(null,Ma(w,new H(p)))}catch(e){_(e,null)}else r.push(ts(w,{size:p},_))}else _(F(14,"unknown compression type "+s,1),null);else _(null,Fe(e,v,v+h));else _(null,null)}),"_loop_3"),g=0;g<h;++g)p(g)}else o(null,{});return i}function Of(e,t){for(var n={},r=e.length-22;101010256!=ae(e,r);--r)(!r||e.length-r>65558)&&F(13);var i=ke(e,r+8);if(!i)return{};var a=ae(e,r+16),o=4294967295==a;o&&(r=ae(e,r-12),101075792!=ae(e,r)&&F(13),i=ae(e,r+32),a=ae(e,r+48));for(var s=t&&t.filter,l=0;l<i;++l){var u=ic(e,a,o),h=u[0],c=u[1],d=u[2],f=u[3],p=u[4],g=u[5],m=nc(e,g);a=p,(!s||s({name:f,size:c,originalSize:d,compression:h}))&&(h?8==h?n[f]=Ma(e.subarray(m,m+c),new H(d)):F(14,"unknown compression type "+h):n[f]=Fe(e,m,m+c))}return n}bc(sc,{AsyncCompress:()=>cf,AsyncDecompress:()=>mf,AsyncDeflate:()=>Wl,AsyncGunzip:()=>Jl,AsyncGzip:()=>cf,AsyncInflate:()=>es,AsyncUnzipInflate:()=>_f,AsyncUnzlib:()=>Xl,AsyncZipDeflate:()=>bf,AsyncZlib:()=>pf,Compress:()=>as,DecodeUTF8:()=>yf,Decompress:()=>Zl,Deflate:()=>et,EncodeUTF8:()=>vf,FlateErrorCode:()=>uf,Gunzip:()=>br,Gzip:()=>as,Inflate:()=>_e,Unzip:()=>Tf,UnzipInflate:()=>jf,UnzipPassThrough:()=>oc,Unzlib:()=>wr,Zip:()=>Mf,ZipDeflate:()=>kf,ZipPassThrough:()=>Nn,Zlib:()=>is,compress:()=>df,compressSync:()=>ns,decompress:()=>ff,decompressSync:()=>gf,deflate:()=>Hl,deflateSync:()=>An,gunzip:()=>Kl,gunzipSync:()=>Mr,gzip:()=>df,gzipSync:()=>ns,inflate:()=>ts,inflateSync:()=>Ma,strFromU8:()=>us,strToU8:()=>It,unzip:()=>If,unzipSync:()=>Of,unzlib:()=>Yl,unzlibSync:()=>xr,zip:()=>wf,zipSync:()=>xf,zlib:()=>hf,zlibSync:()=>rs});var _l,sf,H,ge,ca,da,pa,_n,Tl,Il,Go,hr,Ol,zl,Vo,Tn,pt,Le,ht,ha,X,Al,Nl,Sl,El,mr,De,fr,In,Fe,uf,Ll,F,On,Qe,ma,gr,yr,Uo,fa,vr,$o,Dl,mt,Fl,Pl,ga,Wo,Pt,zn,Cl,kr,lf,Rl,ya,va,Bl,ql,Gl,Vl,Tt,Ho,ka,Pe,ba,ke,ae,Jo,Y,Ko,Xo,Ul,Yo,Zo,$l,et,Wl,_e,es,as,cf,br,Jl,is,pf,wr,Xl,Zl,mf,os,Ql,ss,ec,tc,yf,vf,ac,nc,ic,rc,Ot,wa,ls,Nn,kf,bf,Mf,oc,jf,_f,Tf,jr,uc=gs((()=>{for(g(),_l={},sf=u((function(e,t,n,r,i){var a=new Worker(_l[t]||(_l[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}),"wk"),H=Uint8Array,ge=Uint16Array,ca=Uint32Array,da=new H([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]),pa=new H([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]),_n=new H([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tl=u((function(e,t){for(var n=new ge(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new ca(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]}),"freb"),Il=Tl(da,2),Go=Il[0],hr=Il[1],Go[28]=258,hr[258]=28,Ol=Tl(pa,0),zl=Ol[0],Vo=Ol[1],Tn=new ge(32768),X=0;X<32768;++X)pt=(61680&(pt=(52428&(pt=(43690&X)>>>1|(21845&X)<<1))>>>2|(13107&pt)<<2))>>>4|(3855&pt)<<4,Tn[X]=((65280&pt)>>>8|(255&pt)<<8)>>>1;for(Le=u((function(e,t,n){for(var r=e.length,i=0,a=new ge(t);i<r;++i)e[i]&&++a[e[i]-1];var o,s=new ge(t);for(i=0;i<t;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new ge(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=s[e[i]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)o[Tn[c]>>>l]=u}else for(o=new ge(r),i=0;i<r;++i)e[i]&&(o[i]=Tn[s[e[i]-1]++]>>>15-e[i]);return o}),"hMap"),ht=new H(288),X=0;X<144;++X)ht[X]=8;for(X=144;X<256;++X)ht[X]=9;for(X=256;X<280;++X)ht[X]=7;for(X=280;X<288;++X)ht[X]=8;for(ha=new H(32),X=0;X<32;++X)ha[X]=5;Al=Le(ht,9,0),Nl=Le(ht,9,1),Sl=Le(ha,5,0),El=Le(ha,5,1),mr=u((function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t}),"max"),De=u((function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n}),"bits"),fr=u((function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)}),"bits16"),In=u((function(e){return(e+7)/8|0}),"shft"),Fe=u((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?ge:4==e.BYTES_PER_ELEMENT?ca:H)(n-t);return r.set(e.subarray(t,n)),r}),"slc"),uf={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},Ll=["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"],F=u((function(e,t,n){var r=new Error(t||Ll[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,F),!n)throw r;return r}),"err"),On=u((function(e,t,n){var r=e.length;if(!r||n&&n.f&&!n.l)return t||new H(0);var i=!t||n,a=!n||n.i;n||(n={}),t||(t=new H(3*r));var o=u((function(e){var n=t.length;if(e>n){var r=new H(Math.max(2*n,e));r.set(t),t=r}}),"cbuf"),s=n.f||0,l=n.p||0,h=n.b||0,c=n.l,d=n.d,f=n.m,p=n.n,g=8*r;do{if(!c){s=De(e,l,1);var m=De(e,l+1,3);if(l+=3,!m){var y=e[(T=In(l)+4)-4]|e[T-3]<<8,v=T+y;if(v>r){a&&F(0);break}i&&o(h+y),t.set(e.subarray(T,v),h),n.b=h+=y,n.p=l=8*v,n.f=s;continue}if(1==m)c=Nl,d=El,f=9,p=5;else if(2==m){var _=De(e,l,31)+257,w=De(e,l+10,15)+4,M=_+De(e,l+5,31)+1;l+=14;for(var b=new H(M),O=new H(19),I=0;I<w;++I)O[_n[I]]=De(e,l+3*I,7);l+=3*w;var x=mr(O),k=(1<<x)-1,E=Le(O,x,1);for(I=0;I<M;){var T,A=E[De(e,l,k)];if(l+=15&A,(T=A>>>4)<16)b[I++]=T;else{var N=0,S=0;for(16==T?(S=3+De(e,l,3),l+=2,N=b[I-1]):17==T?(S=3+De(e,l,7),l+=3):18==T&&(S=11+De(e,l,127),l+=7);S--;)b[I++]=N}}var D=b.subarray(0,_),L=b.subarray(_);f=mr(D),p=mr(L),c=Le(D,f,1),d=Le(L,p,1)}else F(1);if(l>g){a&&F(0);break}}i&&o(h+131072);for(var P=(1<<f)-1,B=(1<<p)-1,j=l;;j=l){var R=(N=c[fr(e,l)&P])>>>4;if((l+=15&N)>g){a&&F(0);break}if(N||F(2),R<256)t[h++]=R;else{if(256==R){j=l,c=null;break}var C=R-254;if(R>264){var W=da[I=R-257];C=De(e,l,(1<<W)-1)+Go[I],l+=W}var z=d[fr(e,l)&B],U=z>>>4;z||F(3),l+=15&z;L=zl[U];if(U>3){W=pa[U];L+=fr(e,l)&(1<<W)-1,l+=W}if(l>g){a&&F(0);break}i&&o(h+131072);for(var G=h+C;h<G;h+=4)t[h]=t[h-L],t[h+1]=t[h+1-L],t[h+2]=t[h+2-L],t[h+3]=t[h+3-L];h=G}}n.l=c,n.p=j,n.b=h,n.f=s,c&&(s=1,n.m=f,n.d=d,n.n=p)}while(!s);return h==t.length?t:Fe(t,0,h)}),"inflt"),Qe=u((function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8}),"wbits"),ma=u((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}),"wbits16"),gr=u((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[mt,0];if(1==i){var o=new H(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],l=n[1],u=0,h=1,c=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};h!=i-1;)s=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:s.f+l.f,l:s,r:l};var d=a[0].s;for(r=1;r<i;++r)a[r].s>d&&(d=a[r].s);var f=new ge(d+1),p=yr(n[h-1],f,0);if(p>t){r=0;var g=0,m=p-t,y=1<<m;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+=y-(1<<p-f[v]),f[v]=t}for(g>>>=m;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 H(f),p]}),"hTree"),yr=u((function(e,t,n){return-1==e.s?Math.max(yr(e.l,t,n+1),yr(e.r,t,n+1)):t[e.s]=n}),"ln"),Uo=u((function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ge(++t),r=0,i=e[0],a=1,o=u((function(e){n[r++]=e}),"w"),s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]}),"lc"),fa=u((function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n}),"clen"),vr=u((function(e,t,n){var r=n.length,i=In(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)}),"wfblk"),$o=u((function(e,t,n,r,i,a,o,s,l,u,h){Qe(t,h++,n),++i[256];for(var c=gr(i,15),d=c[0],f=c[1],p=gr(a,15),g=p[0],m=p[1],y=Uo(d),v=y[0],_=y[1],w=Uo(g),M=w[0],b=w[1],O=new ge(19),I=0;I<v.length;++I)O[31&v[I]]++;for(I=0;I<M.length;++I)O[31&M[I]]++;for(var x=gr(O,7),k=x[0],E=x[1],T=19;T>4&&!k[_n[T-1]];--T);var F,A,N,S,D=u+5<<3,L=fa(i,ht)+fa(a,ha)+o,P=fa(i,d)+fa(a,g)+o+14+3*T+fa(O,k)+(2*O[16]+3*O[17]+7*O[18]);if(D<=L&&D<=P)return vr(t,h,e.subarray(l,l+u));if(Qe(t,h,1+(P<L)),h+=2,P<L){F=Le(d,f,0),A=d,N=Le(g,m,0),S=g;var B=Le(k,E,0);Qe(t,h,_-257),Qe(t,h+5,b-1),Qe(t,h+10,T-4),h+=14;for(I=0;I<T;++I)Qe(t,h+3*I,k[_n[I]]);h+=3*T;for(var j=[v,M],R=0;R<2;++R){var C=j[R];for(I=0;I<C.length;++I){var W=31&C[I];Qe(t,h,B[W]),h+=k[W],W>15&&(Qe(t,h,C[I]>>>5&127),h+=C[I]>>>12)}}}else F=Al,A=ht,N=Sl,S=ha;for(I=0;I<s;++I)if(r[I]>255){W=r[I]>>>18&31;ma(t,h,F[W+257]),h+=A[W+257],W>7&&(Qe(t,h,r[I]>>>23&31),h+=da[W]);var z=31&r[I];ma(t,h,N[z]),h+=S[z],z>3&&(ma(t,h,r[I]>>>5&8191),h+=pa[z])}else ma(t,h,F[r[I]]),h+=A[r[I]];return ma(t,h,F[256]),h+A[256]}),"wblk"),Dl=new ca([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),mt=new H(0),Fl=u((function(e,t,n,r,i,a){var o=e.length,s=new H(r+o+5*(1+Math.ceil(o/7e3))+i),l=s.subarray(r,s.length-i),h=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var d=c+65535;d>=o&&(l[h>>3]=a),h=vr(l,h+1,e.subarray(c,d))}else{for(var f=Dl[t-1],p=f>>>13,g=8191&f,m=(1<<n)-1,y=new ge(32768),v=new ge(m+1),_=Math.ceil(n/3),w=2*_,M=u((function(t){return(e[t]^e[t+1]<<_^e[t+2]<<w)&m}),"hsh"),b=new ca(25e3),O=new ge(288),I=new ge(32),x=0,k=0,E=(c=0,0),T=0,F=0;c<o;++c){var A=M(c),N=32767&c,S=v[A];if(y[N]=S,v[A]=N,T<=c){var D=o-c;if((x>7e3||E>24576)&&D>423){h=$o(e,l,0,b,O,I,k,E,F,c-F,h),E=x=k=0,F=c;for(var L=0;L<286;++L)O[L]=0;for(L=0;L<30;++L)I[L]=0}var P=2,B=0,j=g,R=N-S&32767;if(D>2&&A==M(c-R))for(var C=Math.min(p,D)-1,W=Math.min(32767,c),z=Math.min(258,D);R<=W&&--j&&N!=S;){if(e[c+P]==e[c+P-R]){for(var U=0;U<z&&e[c+U]==e[c+U-R];++U);if(U>P){if(P=U,B=R,U>C)break;var G=Math.min(R,U-2),$=0;for(L=0;L<G;++L){var q=c-R+L+32768&32767,X=q-y[q]+32768&32767;X>$&&($=X,S=q)}}}R+=(N=S)-(S=y[N])+32768&32767}if(B){b[E++]=268435456|hr[P]<<18|Vo[B];var Y=31&hr[P],K=31&Vo[B];k+=da[Y]+pa[K],++O[257+Y],++I[K],T=c+P,++x}else b[E++]=e[c],++O[e[c]]}}h=$o(e,l,a,b,O,I,k,E,F,c-F,h),!a&&7&h&&(h=vr(l,h+1,mt))}return Fe(s,0,r+In(h)+i)}),"dflt"),Pl=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}(),ga=u((function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Pl[255&n^t[r]]^n>>>8;e=n},d:function(){return~e}}}),"crc"),Wo=u((function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,a=0|n.length,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=r+=n[o];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}}}),"adler"),Pt=u((function(e,t,n,r,i){return Fl(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)}),"dopt"),zn=u((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}),"mrg"),Cl=u((function(e,t,n){for(var r=e(),i=e.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<r.length;++o){var s=r[o],l=a[o];if("function"==typeof s){t+=";"+l+"=";var u=s.toString();if(s.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,s.prototype)t+=";"+l+".prototype."+c+"="+s.prototype[c].toString();else t+=u}else n[l]=s}return[t,n]}),"wcln"),kr=[],lf=u((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}),"cbfs"),Rl=u((function(e,t,n,r){var i;if(!kr[n]){for(var a="",o={},s=e.length-1,l=0;l<s;++l)a=(i=Cl(e[l],a,o))[0],o=i[1];kr[n]=Cl(e[s],a,o)}var u=zn({},kr[n][1]);return sf(kr[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,u,lf(u),r)}),"wrkr"),ya=u((function(){return[H,ge,ca,da,pa,_n,Go,zl,Nl,El,Tn,Ll,Le,mr,De,fr,In,Fe,F,On,Ma,Tt,Ho]}),"bInflt"),va=u((function(){return[H,ge,ca,da,pa,_n,hr,Vo,Al,ht,Sl,ha,Tn,Dl,mt,Le,Qe,ma,gr,yr,Uo,fa,vr,$o,In,Fe,Fl,Pt,An,Tt]}),"bDflt"),Bl=u((function(){return[Ko,Yo,Y,ga,Pl]}),"gze"),ql=u((function(){return[Xo,Ul]}),"guze"),Gl=u((function(){return[Zo,Y,Wo]}),"zle"),Vl=u((function(){return[$l]}),"zule"),Tt=u((function(e){return postMessage(e,[e.buffer])}),"pbf"),Ho=u((function(e){return e&&e.size&&new H(e.size)}),"gu8"),ka=u((function(e,t,n,r,i,a){var o=Rl(n,r,i,(function(e,t){o.terminate(),a(e,t)}));return o.postMessage([e,t],t.consume?[e.buffer]:[]),function(){o.terminate()}}),"cbify"),Pe=u((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])}}),"astrm"),ba=u((function(e,t,n,r,i){var a,o=Rl(e,r,i,(function(e,n){e?(o.terminate(),t.ondata.call(t,e)):(n[1]&&o.terminate(),t.ondata.call(t,e,n[0],n[1]))}));o.postMessage(n),t.push=function(e,n){t.ondata||F(5),a&&t.ondata(F(4,0,1),null,!!n),o.postMessage([e,a=n],[e.buffer])},t.terminate=function(){o.terminate()}}),"astrmify"),ke=u((function(e,t){return e[t]|e[t+1]<<8}),"b2"),ae=u((function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}),"b4"),Jo=u((function(e,t){return ae(e,t)+4294967296*ae(e,t+4)}),"b8"),Y=u((function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}),"wbytes"),Ko=u((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&&Y(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)}}),"gzh"),Xo=u((function(e){(31!=e[0]||139!=e[1]||8!=e[2])&&F(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)}),"gzs"),Ul=u((function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}),"gzl"),Yo=u((function(e){return 10+(e.filename&&e.filename.length+1||0)}),"gzhl"),Zo=u((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)}),"zlh"),$l=u((function(e){(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)&&F(6,"invalid zlib data"),32&e[1]&&F(6,"invalid zlib data: preset dictionaries not supported")}),"zlv"),u(Qo,"AsyncCmpStrm"),et=function(){function e(e,t){!t&&"function"==typeof e&&(t=e,e={}),this.ondata=t,this.o=e||{}}return u(e,"Deflate"),e.prototype.p=function(e,t){this.ondata(Pt(e,this.o,0,0,!t),t)},e.prototype.push=function(e,t){this.ondata||F(5),this.d&&F(4),this.d=t,this.p(e,t||!1)},e}(),Wl=function(){function e(e,t){ba([va,function(){return[Pe,et]}],this,Qo.call(this,e,t),(function(e){var t=new et(e.data);onmessage=Pe(t)}),6)}return u(e,"AsyncDeflate"),e}(),u(Hl,"deflate"),u(An,"deflateSync"),_e=function(){function e(e){this.s={},this.p=new H(0),this.ondata=e}return u(e,"Inflate"),e.prototype.e=function(e){this.ondata||F(5),this.d&&F(4);var t=this.p.length,n=new H(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=On(this.p,this.o,this.s);this.ondata(Fe(n,t,this.s.b),this.d),this.o=Fe(n,this.s.b-32768),this.s.b=this.o.length,this.p=Fe(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),es=function(){function e(e){this.ondata=e,ba([ya,function(){return[Pe,_e]}],this,0,(function(){var e=new _e;onmessage=Pe(e)}),7)}return u(e,"AsyncInflate"),e}(),u(ts,"inflate"),u(Ma,"inflateSync"),as=function(){function e(e,t){this.c=ga(),this.l=0,this.v=1,et.call(this,e,t)}return u(e,"Gzip"),e.prototype.push=function(e,t){et.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var n=Pt(e,this.o,this.v&&Yo(this.o),t&&8,!t);this.v&&(Ko(n,this.o),this.v=0),t&&(Y(n,n.length-8,this.c.d()),Y(n,n.length-4,this.l)),this.ondata(n,t)},e}(),cf=function(){function e(e,t){ba([va,Bl,function(){return[Pe,et,as]}],this,Qo.call(this,e,t),(function(e){var t=new as(e.data);onmessage=Pe(t)}),8)}return u(e,"AsyncGzip"),e}(),u(df,"gzip"),u(ns,"gzipSync"),br=function(){function e(e){this.v=1,_e.call(this,e)}return u(e,"Gunzip"),e.prototype.push=function(e,t){if(_e.prototype.e.call(this,e),this.v){var n=this.p.length>3?Xo(this.p):4;if(n>=this.p.length&&!t)return;this.p=this.p.subarray(n),this.v=0}t&&(this.p.length<8&&F(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),_e.prototype.c.call(this,t)},e}(),Jl=function(){function e(e){this.ondata=e,ba([ya,ql,function(){return[Pe,_e,br]}],this,0,(function(){var e=new br;onmessage=Pe(e)}),9)}return u(e,"AsyncGunzip"),e}(),u(Kl,"gunzip"),u(Mr,"gunzipSync"),is=function(){function e(e,t){this.c=Wo(),this.v=1,et.call(this,e,t)}return u(e,"Zlib"),e.prototype.push=function(e,t){et.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e);var n=Pt(e,this.o,this.v&&2,t&&4,!t);this.v&&(Zo(n,this.o),this.v=0),t&&Y(n,n.length-4,this.c.d()),this.ondata(n,t)},e}(),pf=function(){function e(e,t){ba([va,Gl,function(){return[Pe,et,is]}],this,Qo.call(this,e,t),(function(e){var t=new is(e.data);onmessage=Pe(t)}),10)}return u(e,"AsyncZlib"),e}(),u(hf,"zlib"),u(rs,"zlibSync"),wr=function(){function e(e){this.v=1,_e.call(this,e)}return u(e,"Unzlib"),e.prototype.push=function(e,t){if(_e.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&&F(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),_e.prototype.c.call(this,t)},e}(),Xl=function(){function e(e){this.ondata=e,ba([ya,Vl,function(){return[Pe,_e,wr]}],this,0,(function(){var e=new wr;onmessage=Pe(e)}),11)}return u(e,"AsyncUnzlib"),e}(),u(Yl,"unzlib"),u(xr,"unzlibSync"),Zl=function(){function e(e){this.G=br,this.I=_e,this.Z=wr,this.ondata=e}return u(e,"Decompress"),e.prototype.push=function(e,t){if(this.ondata||F(5),this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var n=new H(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=u((function(){r.ondata.apply(r,arguments)}),"cb");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}(),mf=function(){function e(e){this.G=Jl,this.I=es,this.Z=Xl,this.ondata=e}return u(e,"AsyncDecompress"),e.prototype.push=function(e,t){Zl.prototype.push.call(this,e,t)},e}(),u(ff,"decompress"),u(gf,"decompressSync"),os=u((function(e,t,n,r){for(var i in e){var a=e[i],o=t+i,s=r;Array.isArray(a)&&(s=zn(r,a[1]),a=a[0]),a instanceof H?n[o]=[a,s]:(n[o+="/"]=[new H(0),s],os(a,o,n,r))}}),"fltn"),Ql="undefined"!=typeof TextEncoder&&new TextEncoder,ss="undefined"!=typeof TextDecoder&&new TextDecoder,ec=0;try{ss.decode(mt,{stream:!0}),ec=1}catch(e){}tc=u((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,Fe(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)}}),"dutf8"),yf=function(){function e(e){this.ondata=e,ec?this.t=new TextDecoder:this.p=mt}return u(e,"DecodeUTF8"),e.prototype.push=function(e,t){if(this.ondata||F(5),t=!!t,this.t)return this.ondata(this.t.decode(e,{stream:!0}),t),void(t&&(this.t.decode().length&&F(8),this.t=null));this.p||F(4);var n=new H(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length);var r=tc(n),i=r[0],a=r[1];t?(a.length&&F(8),this.p=null):this.p=a,this.ondata(i,t)},e}(),vf=function(){function e(e){this.ondata=e}return u(e,"EncodeUTF8"),e.prototype.push=function(e,t){this.ondata||F(5),this.d&&F(4),this.ondata(It(e),this.d=t||!1)},e}(),u(It,"strToU8"),u(us,"strFromU8"),ac=u((function(e){return 1==e?3:e<6?2:9==e?1:0}),"dbf"),nc=u((function(e,t){return t+30+ke(e,t+26)+ke(e,t+28)}),"slzh"),ic=u((function(e,t,n){var r=ke(e,t+28),i=us(e.subarray(t+46,t+46+r),!(2048&ke(e,t+8))),a=t+46+r,o=ae(e,t+20),s=n&&4294967295==o?rc(e,a):[o,ae(e,t+24),ae(e,t+42)],l=s[0],u=s[1],h=s[2];return[ke(e,t+10),l,u,i,a+ke(e,t+30)+ke(e,t+32),h]}),"zh"),rc=u((function(e,t){for(;1!=ke(e,t);t+=4+ke(e,t+2));return[Jo(e,t+12),Jo(e,t+4),Jo(e,t+20)]}),"z64e"),Ot=u((function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&F(9),t+=r+4}return t}),"exfl"),wa=u((function(e,t,n,r,i,a,o,s){var l=r.length,u=n.extra,h=s&&s.length,c=Ot(u);Y(e,t,null!=o?33639248:67324752),t+=4,null!=o&&(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)&&F(10),Y(e,t,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),t+=4,null!=a&&(Y(e,t,n.crc),Y(e,t+4,a),Y(e,t+8,n.size)),Y(e,t+12,l),Y(e,t+14,c),t+=16,null!=o&&(Y(e,t,h),Y(e,t+6,n.attrs),Y(e,t+10,o),t+=14),e.set(r,t),t+=l,c)for(var p in u){var g=u[p],m=g.length;Y(e,t,+p),Y(e,t+2,m),e.set(g,t+4),t+=4+m}return h&&(e.set(s,t),t+=h),t}),"wzh"),ls=u((function(e,t,n,r,i){Y(e,t,101010256),Y(e,t+8,n),Y(e,t+10,n),Y(e,t+12,r),Y(e,t+16,i)}),"wzf"),Nn=function(){function e(e){this.filename=e,this.c=ga(),this.size=0,this.compression=0}return u(e,"ZipPassThrough"),e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){this.ondata||F(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}(),kf=function(){function e(e,t){var n=this;t||(t={}),Nn.call(this,e),this.d=new et(t,(function(e,t){n.ondata(null,e,t)})),this.compression=8,this.flag=ac(t.level)}return u(e,"ZipDeflate"),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){Nn.prototype.push.call(this,e,t)},e}(),bf=function(){function e(e,t){var n=this;t||(t={}),Nn.call(this,e),this.d=new Wl(t,(function(e,t,r){n.ondata(e,t,r)})),this.compression=8,this.flag=ac(t.level),this.terminate=this.d.terminate}return u(e,"AsyncZipDeflate"),e.prototype.process=function(e,t){this.d.push(e,t)},e.prototype.push=function(e,t){Nn.prototype.push.call(this,e,t)},e}(),Mf=function(){function e(e){this.ondata=e,this.u=[],this.d=1}return u(e,"Zip"),e.prototype.add=function(e){var t=this;if(this.ondata||F(5),2&this.d)this.ondata(F(4+8*(1&this.d),0,1),null,!1);else{var n=It(e.filename),r=n.length,i=e.comment,a=i&&It(i),o=r!=e.filename.length||a&&i.length!=a.length,s=r+Ot(e.extra)+30;r>65535&&this.ondata(F(11,0,1),null,!1);var l=new H(s);wa(l,0,e,n,o);var h=[l],c=u((function(){for(var e=0,n=h;e<n.length;e++){var r=n[e];t.ondata(null,r,!1)}h=[]}),"pAll_1"),d=this.d;this.d=0;var f=this.u.length,p=zn(e,{f:n,u:o,o:a,t:function(){e.terminate&&e.terminate()},r:function(){if(c(),d){var e=t.u[f+1];e?e.r():t.d=1}d=1}}),g=0;e.ondata=function(n,r,i){if(n)t.ondata(n,r,i),t.terminate();else if(g+=r.length,h.push(r),i){var a=new H(16);Y(a,0,134695760),Y(a,4,e.crc),Y(a,8,g),Y(a,12,e.size),h.push(a),p.c=g,p.b=s+g+16,p.crc=e.crc,p.size=e.size,d&&p.r(),d=1}else d&&c()},this.u.push(p)}},e.prototype.end=function(){var e=this;2&this.d?this.ondata(F(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+Ot(l.extra)+(l.o?l.o.length:0)}for(var a=new H(n+22),o=0,s=this.u;o<s.length;o++){var l=s[o];wa(a,e,l,l.f,l.u,l.c,t,l.o),e+=46+l.f.length+Ot(l.extra)+(l.o?l.o.length:0),t+=l.b}ls(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}(),u(wf,"zip"),u(xf,"zipSync"),oc=function(){function e(){}return u(e,"UnzipPassThrough"),e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),jf=function(){function e(){var e=this;this.i=new _e((function(t,n){e.ondata(null,t,n)}))}return u(e,"UnzipInflate"),e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(e){this.ondata(e,null,t)}},e.compression=8,e}(),_f=function(){function e(e,t){var n=this;t<32e4?this.i=new _e((function(e,t){n.ondata(null,e,t)})):(this.i=new es((function(e,t,r){n.ondata(e,t,r)})),this.terminate=this.i.terminate)}return u(e,"AsyncUnzipInflate"),e.prototype.push=function(e,t){this.i.terminate&&(e=Fe(e,0)),this.i.push(e,t)},e.compression=8,e}(),Tf=function(){function e(e){this.onfile=e,this.k=[],this.o={0:oc},this.p=mt}return u(e,"Unzip"),e.prototype.push=function(e,t){var n=this;if(this.onfile||F(5),this.p||F(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,o=0,s=void 0,l=void 0;this.p.length?e.length?((l=new H(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var h=l.length,c=this.c,d=c&&this.d,f=u((function(){var e,t=ae(l,o);if(67324752==t){a=1,s=o,p.d=null,p.c=0;var r=ke(l,o+6),i=ke(l,o+8),u=2048&r,d=8&r,f=ke(l,o+26),g=ke(l,o+28);if(h>o+30+f+g){var m=[];p.k.unshift(m),a=2;var y=ae(l,o+18),v=ae(l,o+22),_=us(l.subarray(o+30,o+=30+f),!u);4294967295==y?(e=d?[-2]:rc(l,o),y=e[0],v=e[1]):d&&(y=-1),o+=g,p.c=y;var w,M={name:_,compression:i,start:function(){if(M.ondata||F(5),y){var e=n.o[i];e||M.ondata(F(14,"unknown compression type "+i,1),null,!1),(w=y<0?new e(_):new e(_,y,v)).ondata=function(e,t,n){M.ondata(e,t,n)};for(var t=0,r=m;t<r.length;t++){var a=r[t];w.push(a,!1)}n.k[0]==m&&n.c?n.d=w:w.push(mt,!0)}else M.ondata(null,mt,!0)},terminate:function(){w&&w.terminate&&w.terminate()}};y>=0&&(M.size=y,M.originalSize=v),p.onfile(M)}return"break"}if(c){if(134695760==t)return s=o+=12+(-2==c&&8),a=3,p.c=0,"break";if(33639248==t)return s=o-=4,a=3,p.c=0,"break"}}),"_loop_2"),p=this;o<h-4;++o){if("break"===f())break}if(this.p=mt,c<0){var g=a?l.subarray(0,s-12-(-2==c&&8)-(134695760==ae(l,s-16)&&4)):l.subarray(0,o);d?d.push(g,!!a):this.k[+(2==a)].push(g)}if(2&a)return this.push(l.subarray(o),t);this.p=l.subarray(o)}t&&(this.c&&F(13),this.p=null)},e.prototype.register=function(e){this.o[e.compression]=e},e}(),jr="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(e){e()},u(If,"unzip"),u(Of,"unzipSync")}));g();var lc=Tr(vs());g(),g(),g();var bu=Tr(ku());g();var Zr=class{constructor({origin:e,destination:t,vortex:n,elevationDelta:r=0,distance:i=0,angle:a=0}){let o,s;if(f(this,"origin"),f(this,"destination"),f(this,"vortex"),f(this,"distance"),f(this,"angle"),f(this,"weight"),this.origin=e,this.destination=t,this.vortex=n,this.distance=i,this.angle=a,n?(this.distance=0,this.angle=0,o=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,s=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=r*s+o):(o=t.weight&&t.weight>=0?t.weight:0,s=t.multiplier&&t.multiplier>=1?t.multiplier:1,this.weight=this.distance*s+o),isNaN(this.angle))throw new Error("nan angle")}};u(Zr,"Edge");var Li=Zr;g();var Qr="mi-debug",em={loggingEnabled(){var e;return"development"===_.env.NODE_ENV||"dev"===_.env.NODE_ENV||"test"===_.env.NODE_ENV||"true"===(null==(e=globalThis.sessionStorage)?void 0:e.getItem(Qr))},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)}},L=em;function tm(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,bu.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 L.error(e),1}}function am(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)}u(tm,"getMapScale"),u(am,"getAngle");var eo=class{constructor({nodes:e,vortexes:t,maps:n,showVortexNames:r=!1}){f(this,"edges"),f(this,"nodesById"),f(this,"mapsById"),this.edges={},this.mapsById=n.map((e=>({...e,_scale:tm(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 Li({angle:am(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,o=Math.abs(i-a);this.edges[n.id].push(new Li({destination:t,elevationDelta:o,origin:n,vortex:e})),this.edges[t.id].push(new Li({destination:n,elevationDelta:o,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=[],o={},s={};for(r.forEach((e=>{let t=this.getShortestEuclideanDistance(e,i);a.push({origin:e,priority:t}),o[e.id]=null,s[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=o[e.origin.id];for(;null!=n;){t.push(n);let e=o[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=s[e.origin.id]+t.weight;if(null==s[t.destination.id]||l<s[t.destination.id]){s[t.destination.id]=l;let e=l+this.getShortestEuclideanDistance(t.destination,i);a.push({origin:t.destination,priority:e}),o[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)}};u(eo,"NavigationGraph");var ne,we,gt,to=eo;function nm(e){switch(e){case gt.DOWN:case gt.UP:return`${e} `;default:return""}}g(),g(),function(e){e.DEPARTURE="Departure",e.TAKEVORTEX="TakeVortex",e.EXITVORTEX="ExitVortex",e.TURN="Turn",e.ARRIVAL="Arrival"}(ne||(ne={})),function(e){e.STRAIGHT="Straight",e.RIGHT="Right",e.SLIGHTRIGHT="SlightRight",e.LEFT="Left",e.SLIGHTLEFT="SlightLeft"}(we||(we={})),function(e){e.UP="up",e.DOWN="down",e.NONE="none"}(gt||(gt={})),u(nm,"vortexDirectionTest");var ao=class{constructor({origin:e,action:t,distance:n,atLocation:r,instruction:i}){f(this,"node"),f(this,"instruction"),f(this,"action"),f(this,"atLocation"),f(this,"type"),f(this,"distance",0),this.node=e,this.action=t,this.distance=n||0,this.atLocation=r,this.instruction="",i?this.instruction=i:(null!=t&&t.type===ne.DEPARTURE?this.instruction=null!=r?`Depart from ${r.name}`:"Depart from current location":null!=t&&t.type===ne.ARRIVAL?this.instruction=null!=r?`Arrive at ${r.name}`:"Arrive at destination":null!=t&&t.type===ne.TAKEVORTEX?this.instruction=`Take ${r&&r.name} ${nm(t.direction)}to ${t.toMap.name}`:null!=t&&t.type===ne.EXITVORTEX?this.instruction=`Exit ${r&&r.name} at ${t.toMap.name}`:null!=t&&t.bearing===we.RIGHT?this.instruction="Turn right":null!=t&&t.bearing===we.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=t&&t.bearing===we.STRAIGHT?this.instruction="Head straight":null!=t&&t.bearing===we.SLIGHTLEFT?this.instruction="Turn slightly left":null!=t&&t.bearing===we.LEFT&&(this.instruction="Turn left"),null!=t&&t.type===ne.TURN&&r&&(this.instruction+=` at ${r.name}`))}};u(ao,"Directive");var Di,yt=ao;(Di||(Di={})).NO_VALID_PATH="No Valid Path Available";var Fi=.1*Math.PI;function Pi(e,t){return((t-e+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}u(Pi,"differenceBetweenAngles");var no=class{constructor({locations:e,nodes:t,vortexes:n,maps:r,showVortexNames:i}){f(this,"graph"),f(this,"locationsByNodeId"),this.graph=new to({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],o=null,s=0;for(let t of e)if(t.distance>0)if(null!=o){let e=-Pi(a.angle,t.angle);Math.abs(e)<Math.abs(s)&&(o=t,s=e)}else o=t,s=-Pi(a.angle,t.angle);if(null==o)return null;{if(Math.abs(s)>=t||(r+=s,i+=o.distance,Math.abs(r)>=t||i>n))return null;let e=this.locationsByNodeId[o.destination.id];if(null!=e)return e;a=o}}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 yt({distance:0,instruction:Di.NO_VALID_PATH})],path:[]};let o=0,s=new Array(a.length+1);for(let e=0;e<a.length;e++)s[e]=a[e].origin;s[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,s=t.destination;if(o+=t.distance,c+=(null==h?void 0:h.distance)||0,0===e&&l.push(new yt({action:{type:ne.DEPARTURE},atLocation:r,distance:0,origin:n})),null!=t.vortex){let e=this.graph.mapsById[n.map],r=this.graph.mapsById[s.map],i=gt.NONE;if(null!=e.elevation&&null!=r.elevation){let t=e.elevation-r.elevation;t>0?i=gt.DOWN:t<0&&(i=gt.UP)}l.push(new yt({action:{direction:i,fromMap:e,toMap:r,type:ne.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 yt({action:{fromMap:e,toMap:t,type:ne.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=-Pi(h.angle,t.angle),i=e.reduce(((e,n)=>{let r=-Pi(t.angle,n.angle);return Math.min(e,Math.abs(r))}),Math.PI);if(Math.abs(r)>=Fi||Math.abs(i)<=Fi){let e;e=r<=-Math.PI/4?we.RIGHT:r<=-Fi?we.SLIGHTRIGHT:r<=Fi?we.STRAIGHT:r<=Math.PI/4?we.SLIGHTLEFT:we.LEFT;let t=this.locationsByNodeId[n.id];if(t||(t=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=t){let r=new yt({action:{bearing:e,referencePosition:"At",type:ne.TURN},atLocation:t,distance:c,origin:n});r.type=e,l.push(r)}else l.push(new yt({action:{bearing:e,referencePosition:"At",type:ne.TURN},distance:c,origin:n}));d+=c,c=0}}}e===a.length-1&&(l.push(new yt({action:{type:ne.ARRIVAL},atLocation:i,distance:o-d<0?0:o-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&&n.type===ne.TAKEVORTEX?(p=t.node,f.unshift(t)):n&&n.type===ne.TURN&&null!=p?this.graph.getDistance(t.node,p)>5&&f.unshift(t):f.unshift(t)}return{distance:o,instructions:f,path:s}}};u(no,"Navigator");var io=no;function ro(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return Mu(this.cover(t,n),t,n,e)}function Mu(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a,o,s,l,u,h,c,d,f=e._root,p={data:r},g=e._x0,m=e._y0,y=e._x1,v=e._y1;if(!f)return e._root=p,e;for(;f.length;)if((u=t>=(a=(g+y)/2))?g=a:y=a,(h=n>=(o=(m+v)/2))?m=o:v=o,i=f,!(f=f[c=h<<1|u]))return i[c]=p,e;if(s=+e._x.call(null,f.data),l=+e._y.call(null,f.data),t===s&&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+y)/2))?g=a:y=a,(h=n>=(o=(m+v)/2))?m=o:v=o}while((c=h<<1|u)==(d=(l>=o)<<1|s>=a));return i[d]=f,i[c]=p,e}function wu(e){var t,n,r,i,a=e.length,o=new Array(a),s=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))||(o[n]=r,s[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)Mu(this,o[n],s[n],e[n]);return this}function oo(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 o,s,l=i-n||1,u=this._root;n>e||e>=i||r>t||t>=a;)switch(s=(t<r)<<1|e<n,o=new Array(4),o[s]=u,u=o,l*=2,s){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 so(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e}function uo(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 se(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function lo(e,t,n){var r,i,a,o,s,l,u,h=this._x0,c=this._y0,d=this._x1,f=this._y1,p=[],g=this._root;for(g&&p.push(new se(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||(o=l.x1)<h||(s=l.y1)<c))if(g.length){var m=(i+o)/2,y=(a+s)/2;p.push(new se(g[3],m,y,o,s),new se(g[2],i,y,m,s),new se(g[1],m,a,o,y),new se(g[0],i,a,m,y)),(u=(t>=y)<<1|e>=m)&&(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 co(e){if(isNaN(a=+this._x.call(null,e))||isNaN(o=+this._y.call(null,e)))return this;var t,n,r,i,a,o,s,l,u,h,c,d,f=this._root,p=this._x0,g=this._y0,m=this._x1,y=this._y1;if(!f)return this;if(f.length)for(;;){if((u=a>=(s=(p+m)/2))?p=s:m=s,(h=o>=(l=(g+y)/2))?g=l:y=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 xu(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function po(){return this._root}function ho(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e}function mo(e){var t,n,r,i,a,o,s=[],l=this._root;for(l&&s.push(new se(l,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(l=t.node,r=t.x0,i=t.y0,a=t.x1,o=t.y1)&&l.length){var u=(r+a)/2,h=(i+o)/2;(n=l[3])&&s.push(new se(n,u,h,a,o)),(n=l[2])&&s.push(new se(n,r,h,u,o)),(n=l[1])&&s.push(new se(n,u,i,a,h)),(n=l[0])&&s.push(new se(n,r,i,u,h))}return this}function fo(e){var t,n=[],r=[];for(this._root&&n.push(new se(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var i=t.node;if(i.length){var a,o=t.x0,s=t.y0,l=t.x1,u=t.y1,h=(o+l)/2,c=(s+u)/2;(a=i[0])&&n.push(new se(a,o,s,h,c)),(a=i[1])&&n.push(new se(a,h,s,l,c)),(a=i[2])&&n.push(new se(a,o,c,h,u)),(a=i[3])&&n.push(new se(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 ju(e){return e[0]}function go(e){return arguments.length?(this._x=e,this):this._x}function _u(e){return e[1]}function yo(e){return arguments.length?(this._y=e,this):this._y}function Na(e,t,n){var r=new vo(null==t?ju:t,null==n?_u:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function vo(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 Tu(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}g(),g(),g(),g(),u(ro,"default"),u(Mu,"add"),u(wu,"addAll"),g(),u(oo,"default"),g(),u(so,"default"),g(),u(uo,"default"),g(),g(),u(se,"default"),u(lo,"default"),g(),u(co,"default"),u(xu,"removeAll"),g(),u(po,"default"),g(),u(ho,"default"),g(),u(mo,"default"),g(),u(fo,"default"),g(),u(ju,"defaultX"),u(go,"default"),g(),u(_u,"defaultY"),u(yo,"default"),u(Na,"quadtree"),u(vo,"Quadtree"),u(Tu,"leaf_copy");var ve=Na.prototype=vo.prototype;ve.copy=function(){var e,t,n=new vo(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=Tu(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]=Tu(t));return n},ve.add=ro,ve.addAll=wu,ve.cover=oo,ve.data=so,ve.extent=uo,ve.find=lo,ve.remove=co,ve.removeAll=xu,ve.root=po,ve.size=ho,ve.visit=mo,ve.visitAfter=fo,ve.x=go,ve.y=yo;var Ue,ie,At=class{constructor(e){I(this,Ue,void 0),f(this,"categories"),f(this,"locations"),f(this,"vortexes"),f(this,"maps"),f(this,"nodes"),f(this,"polygons"),f(this,"events"),f(this,"mapGroups"),f(this,"locationStates"),f(this,"rankings"),I(this,ie,{}),O(this,Ue,e)}get polygonsByMapId(){if(h(this,ie).polygonsByMapId)return h(this,ie).polygonsByMapId;let e,t={};for(let n=0,r=h(this,Ue).polygons.length;n<r;++n)e=h(this,Ue).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 h(this,ie).polygonsByMapId=n,h(this,ie).polygonsByMapId}get nodesByMapId(){if(h(this,ie).nodesByMapId)return h(this,ie).nodesByMapId;let e,t={};for(let n=0,r=h(this,Ue).nodes.length;n<r;++n)e=h(this,Ue).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 h(this,ie).nodesByMapId=n,h(this,ie).nodesByMapId}findNearestNodeOnMap(e,t){var n;if(h(this,ie).nodeTreesByMap||(h(this,ie).nodeTreesByMap=new Map),!h(this,ie).nodeTreesByMap.has(e)){let t=null!=(n=this.nodesByMapId.get(e))?n:[],r=Na();r.x((e=>e.x)),r.y((e=>e.y)),r.addAll(t),h(this,ie).nodeTreesByMap.set(e,r)}return h(this,ie).nodeTreesByMap.get(e).find(t.x,t.y)}get locationsByMapId(){if(h(this,ie).locationsByMapId)return h(this,ie).locationsByMapId;let e,t={};for(let n=0,r=h(this,Ue).locations.length;n<r;++n){e=h(this,Ue).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 h(this,ie).locationsByMapId=n,h(this,ie).locationsByMapId}static create(e){return At.instances.has(e)||At.instances.set(e,new At(e)),At.instances.get(e)}static clear(){At.instances.clear()}},Ci=At;u(Ci,"MappedinCache"),Ue=new WeakMap,ie=new WeakMap,f(Ci,"instances",new Map);var Te=Ci;g(),g(),g(),g();var Iu=" ",fe=class{static get separator(){return Iu}static set separator(e){Iu=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,o=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+"°"+fe.separator+a+"′";break;case"dms":case"deg+min+sec":i=Math.floor(e),a=Math.floor(3600*e/60)%60,o=(3600*e%60).toFixed(n),60==o&&(o=(0).toFixed(n),a++),60==a&&(a=0,i++),i=("000"+i).slice(-3),a=("00"+a).slice(-2),o<10&&(o="0"+o),r=i+"°"+fe.separator+a+"′"+fe.separator+o+"″"}return r}static toLat(e,t,n){let r=fe.toDms(fe.wrap90(e),t,n);return null===r?"–":r.slice(1)+fe.separator+(e<0?"S":"N")}static toLon(e,t,n){let r=fe.toDms(fe.wrap180(e),t,n);return null===r?"–":r+fe.separator+(e<0?"W":"E")}static toBrng(e,t,n){let r=fe.toDms(fe.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=fe.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}};u(fe,"Dms"),Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var W=fe,Q=Math.PI,D=class{constructor(e,t){if(isNaN(e))throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t))throw new TypeError(`invalid lon ‘${t}’`);this._lat=W.wrap90(Number(e)),this._lon=W.wrap180(Number(t))}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?W.wrap90(W.parse(e)):W.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?W.wrap90(W.parse(e)):W.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)?W.wrap180(W.parse(e)):W.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?W.wrap180(W.parse(e)):W.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?W.wrap180(W.parse(e)):W.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=W.wrap90(W.parse(t)),n=W.wrap180(W.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=W.wrap90(W.parse(t)),n=W.wrap180(W.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=W.wrap90(W.parse(t)),n=W.wrap180(W.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 D(t,n)}distanceTo(e,t=6371e3){if(e instanceof D||(e=D.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(),o=a-r,s=e.lon.toRadians()-i,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r)*Math.cos(a)*Math.sin(s/2)*Math.sin(s/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(e){if(e instanceof D||(e=D.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),o=Math.atan2(a,i).toDegrees();return W.wrap360(o)}finalBearingTo(e){e instanceof D||(e=D.parse(e));let t=e.initialBearingTo(this)+180;return W.wrap360(t)}midpointTo(e){e instanceof D||(e=D.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),o=0,s=Math.sin(t),l={x:a+Math.cos(r)*Math.cos(i),y:o+Math.cos(r)*Math.sin(i),z:s+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 D(c,d)}intermediatePointTo(e,t){if(e instanceof D||(e=D.parse(e)),this.equals(e))return new D(this.lat,this.lon);let n=this.lat.toRadians(),r=this.lon.toRadians(),i=e.lat.toRadians(),a=e.lon.toRadians(),o=i-n,s=a-r,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(n)*Math.cos(i)*Math.sin(s/2)*Math.sin(s/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)),m=Math.atan2(f,d),y=g.toDegrees(),v=m.toDegrees();return new D(y,v)}destinationPoint(e,t,n=6371e3){let r=e/n,i=Number(t).toRadians(),a=this.lat.toRadians(),o=this.lon.toRadians(),s=Math.sin(a)*Math.cos(r)+Math.cos(a)*Math.sin(r)*Math.cos(i),l=Math.asin(s),u=Math.sin(i)*Math.sin(r)*Math.cos(a),h=Math.cos(r)-Math.sin(a)*s,c=o+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new D(d,f)}static intersection(e,t,n,r){if(e instanceof D||(e=D.parse(e)),n instanceof D||(n=D.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(),o=n.lat.toRadians(),s=n.lon.toRadians(),l=Number(t).toRadians(),u=Number(r).toRadians(),h=o-i,c=s-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(i)*Math.cos(o)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new D(e.lat,e.lon);let f=(Math.sin(o)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),p=(Math.sin(i)-Math.sin(o)*Math.cos(d))/(Math.sin(d)*Math.cos(o)),g=Math.acos(Math.min(Math.max(f,-1),1)),m=Math.acos(Math.min(Math.max(p,-1),1)),y=l-(Math.sin(s-a)>0?g:2*Q-g),v=(Math.sin(s-a)>0?2*Q-m:m)-u;if(0==Math.sin(y)&&0==Math.sin(v)||Math.sin(y)*Math.sin(v)<0)return null;let _=-Math.cos(y)*Math.cos(v)+Math.sin(y)*Math.sin(v)*Math.cos(d),w=Math.atan2(Math.sin(d)*Math.sin(y)*Math.sin(v),Math.cos(v)+Math.cos(y)*_),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)),O=M.toDegrees(),I=b.toDegrees();return new D(O,I)}crossTrackDistanceTo(e,t,n=6371e3){e instanceof D||(e=D.parse(e)),t instanceof D||(t=D.parse(t));let r=n;if(this.equals(e))return 0;let i=e.distanceTo(this,r)/r,a=e.initialBearingTo(this).toRadians(),o=e.initialBearingTo(t).toRadians();return Math.asin(Math.sin(i)*Math.sin(a-o))*r}alongTrackDistanceTo(e,t,n=6371e3){e instanceof D||(e=D.parse(e)),t instanceof D||(t=D.parse(t));let r=n;if(this.equals(e))return 0;let i=e.distanceTo(this,r)/r,a=e.initialBearingTo(this).toRadians(),o=e.initialBearingTo(t).toRadians(),s=Math.asin(Math.sin(i)*Math.sin(a-o));return Math.acos(Math.cos(i)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-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(),o=t.lat.toRadians(),s=t.lon.toRadians()-a,l=Math.sin(i)*Math.cos(o)*Math.cos(r)*Math.sin(s),u=Math.sin(i)*Math.cos(o)*Math.cos(r)*Math.cos(s)-Math.cos(i)*Math.sin(o)*Math.cos(r),h=Math.cos(i)*Math.cos(o)*Math.sin(r)*Math.sin(s);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:W.wrap180(p),lon2:W.wrap180(g)}}rhumbDistanceTo(e,t=6371e3){e instanceof D||(e=D.parse(e));let n=t,r=this.lat.toRadians(),i=e.lat.toRadians(),a=i-r,o=Math.abs(e.lon-this.lon).toRadians();Math.abs(o)>Q&&(o=o>0?-(2*Q-o):2*Q+o);let s=Math.log(Math.tan(i/2+Q/4)/Math.tan(r/2+Q/4)),l=Math.abs(s)>1e-11?a/s:Math.cos(r);return Math.sqrt(a*a+l*l*o*o)*n}rhumbBearingTo(e){if(e instanceof D||(e=D.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)>Q&&(r=r>0?-(2*Q-r):2*Q+r);let i=Math.log(Math.tan(n/2+Q/4)/Math.tan(t/2+Q/4)),a=Math.atan2(r,i).toDegrees();return W.wrap360(a)}rhumbDestinationPoint(e,t,n=6371e3){let r=this.lat.toRadians(),i=this.lon.toRadians(),a=Number(t).toRadians(),o=e/n,s=o*Math.cos(a),l=r+s;Math.abs(l)>Q/2&&(l=l>0?Q-l:-Q-l);let u=Math.log(Math.tan(l/2+Q/4)/Math.tan(r/2+Q/4)),h=Math.abs(u)>1e-11?s/u:Math.cos(r),c=i+o*Math.sin(a)/h,d=l.toDegrees(),f=c.toDegrees();return new D(d,f)}rhumbMidpointTo(e){e instanceof D||(e=D.parse(e));let t=this.lat.toRadians(),n=this.lon.toRadians(),r=e.lat.toRadians(),i=e.lon.toRadians();Math.abs(i-n)>Q&&(n+=2*Q);let a=(t+r)/2,o=Math.tan(Q/4+t/2),s=Math.tan(Q/4+r/2),l=Math.tan(Q/4+a/2),u=((i-n)*Math.log(l)+n*Math.log(s)-i*Math.log(o))/Math.log(s/o);isFinite(u)||(u=(n+i)/2);let h=a.toDegrees(),c=u.toDegrees();return new D(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))}s(e)&&(a=Math.abs(a)-2*Q);let o=Math.abs(a*n*n);return r||e.pop(),o;function s(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}return t+=(e[0].initialBearingTo(e[1])-n+540)%360-180,Math.abs(t)<90}}equals(e){return e instanceof D||(e=D.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`${W.toLat(this.lat,e,t)}, ${W.toLon(this.lon,e,t)}`}};u(D,"LatLonSpherical"),g(),g(),g();var Sa=class{constructor(e){f(this,"destinations",[]),this.destinations=e}};u(Sa,"MappedinDestinationSet"),g();var Ea,nt,Gt=class{constructor(e,t){I(this,Ea,void 0),I(this,nt,void 0),f(this,"distance",0),f(this,"path",[]),f(this,"instructions",[]),O(this,nt,e),O(this,Ea,t),this.distance=t.distance,this.instructions=t.instructions.map((e=>{var t,n,r,i,a,o,s,l,u,c,d,f;let p={...e,action:{...e.action},atLocation:(null==(t=e.atLocation)?void 0:t.id)?null==(r=null==(n=h(this,nt))?void 0:n._vortexesById)?void 0:r[e.atLocation.id]:void 0,node:(null==(i=e.node)?void 0:i.id)?null==(o=null==(a=h(this,nt))?void 0:a._nodesById)?void 0:o[e.node.id]:void 0};return((null==(s=p.action)?void 0:s.type)===ne.TAKEVORTEX||(null==(l=p.action)?void 0:l.type)===ne.EXITVORTEX)&&(p.action.fromMap=null==(c=h(this,nt)._mapsById)?void 0:c[null==(u=p.action)?void 0:u.fromMap.id],p.action.toMap=null==(f=h(this,nt)._mapsById)?void 0:f[null==(d=p.action)?void 0:d.toMap.id]),p})),this.path=t.path.map((e=>{var t,n;return null==(n=null==(t=h(this,nt))?void 0:t._nodesById)?void 0:n[e.id]}))}toJSON(){return h(this,Ea)}};u(Gt,"MappedinDirections"),Ea=new WeakMap,nt=new WeakMap;var vt,it=class{constructor(e){I(this,vt,void 0),O(this,vt,e)}directionsTo(e,t){if(e instanceof Sa){let n=[],r=this;for(let i=0;i<e.destinations.length;i++){let a=e.destinations[i],o=La(r),s=La(a),l=h(this,vt).navigator.getDirections({originIds:o,destinationNodeIds:s,accessible:(null==t?void 0:t.accessible)||!1}),u=new Gt(h(this,vt),l);n.push(u),r=a}return n}{let n=La(this),r=La(e),i=h(this,vt).navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:(null==t?void 0:t.accessible)||!1});return new Gt(h(this,vt),i)}}distanceTo(e,t){let n=this.directionsTo(e,t);return(null==n?void 0:n.distance)||0}};u(it,"MappedinNavigatable"),vt=new WeakMap;var im=0,rm="9999-12-31T00:00:00.000Z";function om(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||im),n=new Date(e.end||rm);return t<r&&n>r}));return i?t.find((e=>e.value===i.type)):void 0}u(om,"getCurrentLocationState");var $e,kt,Ie,Da,Fa,Pa,Ca=class extends it{constructor(e,t){super(e),I(this,$e,void 0),I(this,kt,void 0),I(this,Ie,{}),f(this,"states"),f(this,"id",""),f(this,"name",""),f(this,"type",""),f(this,"description"),f(this,"sortOrder"),f(this,"logo"),f(this,"phone"),f(this,"social"),f(this,"color"),f(this,"shortName"),f(this,"detailsUrl"),f(this,"tags"),f(this,"externalId"),f(this,"showLabelWhenImagePresent"),f(this,"picture"),f(this,"operationHours"),f(this,"siblingGroups"),f(this,"gallery"),I(this,Da,void 0),I(this,Fa,[]),I(this,Pa,void 0),O(this,$e,e),O(this,kt,t);let n=Object.assign({},t);delete n.categories,Object.assign(this,n)}get polygons(){let e=h(this,Ie).polygons;if(void 0!==e)return e;let t=[],n=h(this,Da),r=h(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 h(this,Ie).polygons=t,t}set polygons(e){O(this,Da,e)}get nodes(){let e=h(this,Ie).nodes;if(void 0!==e)return e;let t=[],n=h(this,Fa),r=h(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 h(this,Ie).nodes=t,t}set nodes(e){O(this,Fa,e)}get parent(){let e=h(this,Ie).parent;if(void 0!==e)return e;let t,n=h(this,$e)._locationsById,r=h(this,Pa);return void 0!==r&&(t=n[r]),h(this,Ie).parent=t,t}set parent(e){O(this,Pa,e)}get categories(){let e=h(this,Ie).categories;if(void 0!==e)return e;let t=[];return h(this,kt).categories.forEach((e=>{let n=h(this,$e).getCollectionItemById(ot.CATEGORY,e);n&&t.push(n)})),h(this,Ie).categories=t,t}get state(){return om(this,h(this,$e).locationStates)}clone(){return new Ca(h(this,$e),h(this,kt))}get nodeOperationHours(){let e=h(this,Ie).nodeOperationHours;if(void 0!==e)return e;if(null==this.nodes)return{};let t=h(this,kt).nodes.reduce(((e,t)=>(null!=t.operationHours&&(e[t.node]=t.operationHours),e)),{});return h(this,Ie).nodeOperationHours=t,t}static hydrate(e,t){return e.map((e=>new Ca(t,e)))}static async fetch(e){let t=e.options.things.locations.slice();e.options.things.categories&&te(t,"categories"),e.options.things.nodes&&te(t,"nodes"),e.options.things.polygons&&te(t,"polygons"),e.options.things.locationStates&&te(t,"states");let n={fields:t,venue:e.options.venue};try{let t=await ee(e.options,"location",n);return e.options.includeHidden||(t=t.filter((e=>!e.hidden))),t.map((t=>new Ca(e,t)))}catch(e){return L.error("Fetch Locations:",e),[]}}toJSON(){let e=h(this,kt);return delete e.color,e}},rt=Ca;u(rt,"MappedinLocation"),$e=new WeakMap,kt=new WeakMap,Ie=new WeakMap,Da=new WeakMap,Fa=new WeakMap,Pa=new WeakMap,g();var bt,Vt,Se,Ra,Ri=class extends it{constructor(e,t){super(e),I(this,bt,void 0),I(this,Vt,void 0),I(this,Se,{}),f(this,"geometry"),f(this,"perspectives"),f(this,"image"),f(this,"holes"),f(this,"textures"),f(this,"material"),f(this,"label"),f(this,"id",""),f(this,"layer"),f(this,"layerId"),f(this,"name"),f(this,"externalId"),f(this,"vertexes"),f(this,"canvasBounds"),I(this,Ra,void 0),O(this,bt,e),O(this,Vt,t);let n=Object.assign({},t);delete n.map,Object.assign(this,n)}get map(){let e=h(this,Se).map;if(void 0!==e)return e;let t=h(this,bt).getCollectionItemById(ot.MAP,h(this,Vt).map);return h(this,Se).map=t,t}get locations(){var e,t;let n=h(this,Se).locations;if(void 0!==n)return n;let r=[],i=null!=(t=null==(e=Te.instances.get(h(this,bt)))?void 0:e.locationsByMapId.get(this.map.id))?t:[],{id:a}=this;for(let e=0,t=i.length;e<t;++e){let t=i[e],n=t.polygons;if(Array.isArray(n))for(let e=0,i=n.length;e<i;++e)if(n[e].id===a){r.push(t);break}}return h(this,Se).locations=r,r}get entrances(){let e=h(this,Se).entrances;if(void 0!==e)return e;let t=[],n=h(this,Ra),r=h(this,bt)._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 h(this,Se).entrances=t,t}return[]}set entrances(e){O(this,Ra,e)}get rank(){let e=h(this,Se).rank;if(void 0!==e)return e;let{rankings:t}=h(this,bt);if(!t||!t.polygons)return null;let n=t.polygons.find((e=>e.polygonId===this.id));return n?(h(this,Se).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(h(this,Se).rank=null,null)}static hydrate(e,t){return e.map((e=>new Ri(t,e)))}static async fetch(e){let t=e.options.things.polygons.slice();e.options.things.maps&&te(t,"map"),e.options.things.nodes&&te(t,"entrances");let n={fields:t,venue:e.options.venue};try{return(await ee(e.options,"polygon",n)).filter((e=>e.geometry.visible)).map((t=>new Ri(e,t)))}catch(e){return L.error("Fetch Polygons:",e),[]}}toJSON(){return h(this,Vt)}},Nt=Ri;function Ou(e){return/^[\da-f]{24}$/i.test(e)}function zu(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],o=e[a];null!=o&&(n+=`${r+encodeURIComponent(a)}=${encodeURIComponent(o)}`,r="&")}}return n}function sm(e,t,n,r=!1){var i,a;return r?`${e.supplementaryUrl}${t}?venue=${n.venue||n.slug}`:(null==(i=e.baseUrl)?void 0:i.includes("gateway"))?`${e.baseUrl}${t}/${n.venue||n.slug}${zu(n,null==(a=e.baseUrl)?void 0:a.includes("gateway"))}`:e.baseUrl+t+zu(n)}async function ee(e,t,n,r=!1){return ko(e,t,n,r,!0)}async function ko(e,t,n,r=!1,i=!1){let a=sm(e,t,n,r),o=await Bi(e,a,r);if(!i&&Array.isArray(o)){if(1===o.length)return o[0];throw new Error("Invalid response object")}return o}async function Bi(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},o=await Mt()(t,a);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return o.json()}function te(e,t){e.indexOf(t)<0&&e.push(t)}function Au([e,t],[n,r]){let i=new D(e,t),a=new D(n,r);return i.distanceTo(a)}function Nu(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 D(n.target.x,n.target.y),a=new D(r.target.x,r.target.y),o=i.distanceTo(a),s=n.control.x-r.control.x,l=n.control.y-r.control.y;t=Math.sqrt(s*s+l*l)/o}catch(n){t=1,L.warn(n),L.warn(`Couldn't georeference ${e.name||e.shortName||e.id}. Probably not enough geocoordinates.`)}return t}function La(e){var t;return e instanceof Nt?e.entrances.map((e=>e.id)):e instanceof rt?(null==(t=e.nodes)?void 0:t.map((e=>e.id)))||[]:[e.id]}async function Su(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=>{L.error(e)}))));await Promise.all(e)}catch(e){L.error(e)}return n.forEach((e=>{var n;!(null==(n=e.scene)?void 0:n.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=>{var n,r;if((null==(n=null==e?void 0:e.image)?void 0:n.url)&&(null==(r=null==e?void 0:e.image)?void 0:r.url)){let n=e.image.url.split("/"),r=t[n[n.length-1]];r&&(e.image.url=r)}}))))})),null!=r&&a.forEach((e=>{var n;if(null==(n=null==e?void 0:e.image)?void 0:n.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 bo(e,t,n){let r;return function(){let i=this,a=arguments,o=u((function(){r=null,n||e.apply(i,a)}),"later"),s=n&&!r;clearTimeout(r),r=setTimeout(o,t),s&&e.apply(i,a)}}u(Nt,"MappedinPolygon"),bt=new WeakMap,Vt=new WeakMap,Se=new WeakMap,Ra=new WeakMap,u(Ou,"isGatewayKey"),u(zu,"stringifyQuery"),u(sm,"buildUrl"),u(ee,"getArray"),u(ko,"getObject"),u(Bi,"generateAPIRequest"),u(te,"addToSet"),u(Au,"getDistanceBetweenLatLon"),u(Nu,"getMapScale"),u(La,"getNodesForNavigatable"),u(Su,"populateBundledImagesAsBlobs"),u(bo,"debounce");var Ba,qa,Ga,qi=class{constructor(e,t){I(this,Ba,void 0),I(this,qa,{}),I(this,Ga,void 0),f(this,"name"),f(this,"externalId"),f(this,"parents"),f(this,"id"),f(this,"icon"),this.id=t.id,O(this,Ga,t),O(this,Ba,e),Object.assign(this,t)}get locations(){var e;let t=h(this,qa).locations;if(void 0!==t)return t;let n=[],{locations:r}=h(this,Ba),{id:i}=this;for(let t=0,a=r.length;t<a;++t){let a=r[t],o=a.categories;if(Array.isArray(o))for(let t=0,r=o.length;t<r;++t)if((null==(e=o[t])?void 0:e.id)===i){n.push(a);break}}return h(this,qa).locations=n,n}static hydrate(e,t){return e.map((e=>new qi(t,e)))}static async fetch(e){let t={fields:e.options.things.categories,venue:e.options.venue};try{return(await ee(e.options,"category",t)).map((t=>new qi(e,t)))}catch(e){return L.error("Fetch Categories:",e),[]}}toJSON(){return h(this,Ga)}},St=qi;u(St,"MappedinCategory"),Ba=new WeakMap,qa=new WeakMap,Ga=new WeakMap,g();var Ua,Ut,$a,Gi=class{constructor(e,t){I(this,Ua,void 0),I(this,Ut,void 0),I(this,$a,{}),f(this,"id",""),f(this,"type",""),f(this,"name",""),f(this,"description"),f(this,"image"),f(this,"startDate"),f(this,"endDate"),f(this,"showDate"),O(this,Ut,t),O(this,Ua,e),Object.assign(this,t)}location(){let e=h(this,$a).location;if(void 0!==e)return e;let t,n=h(this,Ua)._locationsById,r=h(this,Ut).location;if(null!=r){let e=n[r];null!=e&&(t=e)}return h(this,$a).location=t,t}static hydrate(e,t){return e.map((e=>new Gi(t,e)))}static async fetch(e){let t=e.options.things.events.slice();e.options.things.locations&&te(t,"location");let n={fields:t,venue:e.options.venue,activeAtOrAfter:Date.now()};try{return(await ee(e.options,"event",n)).map((t=>new Gi(e,t)))}catch(e){return L.error("Fetch Events:",e),[]}}toJSON(){return h(this,Ut)}},Va=Gi;u(Va,"MappedinEvent"),Ua=new WeakMap,Ut=new WeakMap,$a=new WeakMap,g();var Wa,Ui=class{constructor(e){I(this,Wa,void 0),f(this,"id",""),f(this,"name",""),f(this,"value",""),O(this,Wa,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new Ui(e)))}static async fetch(e){let t={fields:e.options.things.locationStates.slice(),venue:e.options.venue};try{return(await ee(e.options,"location-state",t)).map((e=>new Ui(e)))}catch(e){return L.error("Fetch Location States:",e),[]}}toJSON(){return h(this,Wa)}},Vi=Ui;u(Vi,"MappedinLocationState"),Wa=new WeakMap,g(),g();var Ha,Eu,Ja,Lu,Ka,Xa,$i,um,Wi,lm,We,He,Je,Ke,$t=class{constructor(e){I(this,Ha),I(this,Ja),I(this,$i),I(this,Wi),f(this,"map"),I(this,Ka,{}),I(this,Xa,void 0),I(this,We,void 0),I(this,He,void 0),I(this,Je,void 0),I(this,Ke,void 0);let{map:t,mappedin:n}=e;null!=e.lat&&null!=e.lon&&(O(this,We,e.lat),O(this,He,e.lon)),null!=e.x&&null!=e.y&&(O(this,Je,e.x),O(this,Ke,e.y)),this.map=t,O(this,Xa,n)}get x(){return tt(this,Ja,Lu).call(this,"x")}get y(){return tt(this,Ja,Lu).call(this,"y")}get lat(){return tt(this,Ha,Eu).call(this,"lat")}get lon(){return tt(this,Ha,Eu).call(this,"lon")}absoluteDistanceTo(e){return Au([e.lat,e.lon],[this.lat,this.lon])}get nearestNode(){let e=h(this,Ka).nearestNode;if(void 0!==e)return e;let t=Te.instances.get(h(this,Xa)).findNearestNodeOnMap(this.map.id,this);return h(this,Ka).nearestNode=t,t}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};u($t,"MappedinCoordinate"),Ha=new WeakSet,Eu=u((function(e){if(h(this,We)&&h(this,He))return h(this,"lat"===e?We:He);if(null!=h(this,Je)&&null!=h(this,Ke)){let[t,n]=tt(this,Wi,lm).call(this,h(this,Je),h(this,Ke));return O(this,We,t),O(this,He,n),h(this,"lat"===e?We:He)}throw Error("MappedinCoordinate is missing x and y")}),"#getLatLon"),Ja=new WeakSet,Lu=u((function(e){if(h(this,Je)&&h(this,Ke))return h(this,"x"===e?Je:Ke);if(null!=h(this,We)&&null!=h(this,He)){let[t,n]=tt(this,$i,um).call(this,h(this,We),h(this,He));return O(this,Je,t),O(this,Ke,n),h(this,"x"===e?Je:Ke)}throw Error("MappedinCoordinate is missing lat and lon")}),"#getXY"),Ka=new WeakMap,Xa=new WeakMap,$i=new WeakSet,um=u((function(e,t){let n=this.map.georeference[0],r=new D(n.target.x,n.target.y),i=new D(e,t),a=r.distanceTo(i),o=(r.finalBearingTo(i)+360)%360*Math.PI/180||0,s=a*(1/this.map.scale),l=o+this.map.getNorth(),u=Math.sin(l)*s,h=Math.cos(l)*s;return[n.control.x+u,n.control.y-h]}),"#latLonToXY"),Wi=new WeakSet,lm=u((function(e,t){let n,r=this.map.georeference[0],i=new D(r.target.x,r.target.y),a=e-r.control.x,o=r.control.y-t,s=Math.atan2(a,o);n=0===a&&0===o?0:0===a?o:a/Math.sin(s);let l=s-this.map.getNorth(),u=n/this.map._scale,h=i.destinationPoint(u,180*l/Math.PI);return[h.lat,h.lon]}),"#xyToLatLon"),We=new WeakMap,He=new WeakMap,Je=new WeakMap,Ke=new WeakMap;var Xe,Za,Qa,Hi=class{constructor(e,t){I(this,Xe,void 0),I(this,Za,{}),I(this,Qa,void 0),f(this,"id",""),f(this,"group",""),f(this,"name",""),f(this,"shortName",""),f(this,"elevation",0),f(this,"scale",0),f(this,"layers"),f(this,"x_scale"),f(this,"perspectiveId"),f(this,"scene"),f(this,"width",0),f(this,"height",0),f(this,"georeference",[]),f(this,"_scale",0),O(this,Xe,e),O(this,Qa,t),Object.assign(this,t),this._scale=Nu(this),this.scale=this.x_scale||1/this._scale}get polygons(){var e,t,n;return null!=(n=null==(t=null==(e=Te.instances.get(h(this,Xe)))?void 0:e.polygonsByMapId)?void 0:t.get(this.id))?n:[]}get locations(){var e,t,n;return null!=(n=null==(t=null==(e=Te.instances.get(h(this,Xe)))?void 0:e.locationsByMapId)?void 0:t.get(this.id))?n:[]}get nodes(){var e,t,n;return null!=(n=null==(t=null==(e=Te.instances.get(h(this,Xe)))?void 0:e.nodesByMapId)?void 0:t.get(this.id))?n:[]}get mapGroup(){let e=h(this,Za).mapGroup;if(void 0!==e)return e;let t=this.group,n=t&&h(this,Xe)._mapGroupsById[t]||null;return h(this,Za).mapGroup=n,n}createCoordinateByXY(e,t){return new $t({x:e,y:t,map:this,mappedin:h(this,Xe)})}createCoordinate(e,t){return new $t({lat:e,lon:t,map:this,mappedin:h(this,Xe)})}getNorth(){let e;try{let t=this.georeference[0],n=this.georeference[2],r=new D(t.target.x,t.target.y),i=new D(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,L.warn(t),L.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 Hi(t,e)))}static async fetch(e){let t=e.options.things.maps.slice();e.options.perspective&&te(t,"perspectives"),e.options.things.mapGroups&&te(t,"group"),te(t,"elevation"),te(t,"x_scale"),te(t,"scale"),te(t,"georeference");let n={fields:t,perspective:e.options.perspective,venue:e.options.venue};try{let i=await ee(e.options,"map",n),a=u((e=>{let t=r.layers.find((t=>t.id===e));t?t.visible=!0:r.layers.push({id:e,visible:!0})}),"setVisibleLayer");for(let n=0,o=i.length;n<o;++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 Hi(e,r)}return i}catch(e){return L.error("Fetch Maps:",e),[]}}toJSON(){return h(this,Qa)}},Ya=Hi;u(Ya,"MappedinMap"),Xe=new WeakMap,Za=new WeakMap,Qa=new WeakMap,g();var tn,Wt,an,Ji=class{constructor(e,t){I(this,tn,void 0),I(this,Wt,void 0),I(this,an,{}),f(this,"id",""),f(this,"name",""),O(this,Wt,t),O(this,tn,e),Object.assign(this,t)}get maps(){let e=h(this,an).maps;if(void 0!==e)return e;let t=[],{maps:n}=h(this,tn),{id:r}=h(this,Wt);for(let e=0,i=n.length;e<i;++e){let i=n[e];i.group===r&&t.push(i)}return h(this,an).maps=t,t}static hydrate(e,t){return e.map((e=>new Ji(t,e)))}static async fetch(e){let t={fields:e.options.things.mapGroups.slice(),venue:e.options.venue};try{return(await ee(e.options,"map-group",t)).map((t=>new Ji(e,t)))}catch(e){return L.error("Fetch Map Groups:",e),[]}}toJSON(){return h(this,Wt)}},en=Ji;u(en,"MappedinMapGroup"),tn=new WeakMap,Wt=new WeakMap,an=new WeakMap,g();var Ye,Ht,ce,rn,Ki=class extends it{constructor(e,t){super(e),I(this,Ye,void 0),I(this,Ht,void 0),I(this,ce,{}),f(this,"id",""),f(this,"x",0),f(this,"y",0),f(this,"operationHours"),f(this,"externalId"),I(this,rn,void 0),O(this,Ye,e),O(this,Ht,t);let n=Object.assign({},t);delete n.map,Object.assign(this,n)}get map(){let e=h(this,ce).map;if(void 0!==e)return e;let t=h(this,Ye).getCollectionItemById(ot.MAP,h(this,Ht).map);return h(this,ce).map=t,t}get lat(){var e;let t=h(this,ce).cachedLatLon;if(null!=t)return t.lat;let n=null==(e=h(this,Ye)._mapsById)?void 0:e[this.map.id];if(null==n)throw new Error("Map not found");return h(this,ce).cachedLatLon=n.createCoordinateByXY(this.x,this.y),h(this,ce).cachedLatLon.lat}get lon(){var e;let t=h(this,ce).cachedLatLon;if(null!=t)return t.lon;let n=null==(e=h(this,Ye)._mapsById)?void 0:e[this.map.id];if(null==n)throw new Error("Map not found");return h(this,ce).cachedLatLon=n.createCoordinateByXY(this.x,this.y),h(this,ce).cachedLatLon.lon}get paths(){let e=h(this,ce).paths;if(void 0!==e)return e;let t=[],n=h(this,Ye)._nodesById,r=h(this,rn);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 h(this,ce).paths=t,t}set paths(e){O(this,rn,e)}get locations(){var e,t,n;let r=h(this,ce).locations;if(void 0!==r)return r;let i=[],a=null!=(n=null==(t=null==(e=Te.instances.get(h(this,Ye)))?void 0:e.locationsByMapId)?void 0:t.get(this.map.id))?n:[],o=this.id;for(let e=0,t=a.length;e<t;++e){let t=a[e],n=t.nodes;if(Array.isArray(n))for(let e=0,r=n.length;e<r;++e)if(n[e].id===o){i.push(t);break}}return h(this,ce).locations=i,i}get polygon(){var e,t,n;let r=h(this,ce).polygon;if(void 0!==r)return r;let i,a=null!=(n=null==(t=null==(e=Te.instances.get(h(this,Ye)))?void 0:e.polygonsByMapId)?void 0:t.get(this.map.id))?n:[],o=this.id;for(let e=0,t=a.length;e<t;++e){let t=a[e];t.entrances.map((e=>e.id)).includes(o)&&(i=t)}return h(this,ce).polygon=i,i}static hydrate(e,t){return e.map((e=>new Ki(t,e)))}static async fetch(e){let t=e.options.things.nodes.slice();e.options.things.maps&&te(t,"map"),["weight","multiplier","accessible"].forEach((function(e){te(t,e)}));let n={fields:t,venue:e.options.venue};try{return(await ee(e.options,"node",n)).map((t=>new Ki(e,t)))}catch(e){return L.error("Fetch Nodes:",e),[]}}toJSON(){return h(this,Ht)}},nn=Ki;u(nn,"MappedinNode"),Ye=new WeakMap,Ht=new WeakMap,ce=new WeakMap,rn=new WeakMap,g();var sn,Xi=class{constructor(e){I(this,sn,void 0),f(this,"polygons",[]),O(this,sn,e),Object.assign(this,e)}static hydrate(e){return new Xi(e)}static async fetch(e){try{let t=await ko(e.options,"smart-labels/polygon-label-ranking",{venue:e.options.venue},!0);return new Xi(t)}catch(e){return L.error("Fetch Rankings:",e),null}}toJSON(){return h(this,sn)}},on=Xi;u(on,"MappedinRankings"),sn=new WeakMap,g();var un,Zi=class{constructor(e){f(this,"id",""),I(this,un,void 0),O(this,un,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new Zi(e)))}static async fetch(e){let t={fields:e.options.things.themes.slice(),venue:e.options.venue};try{return(await ee(e.options,"apollo-theme",t)).map((e=>new Zi(e)))}catch(e){return L.error("Fetch Theme:",e),[]}}toJSON(){return h(this,un)}},Yi=Zi;u(Yi,"MappedinTheme"),un=new WeakMap,g();var cn,dn,Jt,Qi=class{constructor(e,t){I(this,cn,void 0),I(this,dn,void 0),I(this,Jt,{}),f(this,"defaultMap",""),f(this,"address",""),f(this,"city",""),f(this,"countrycode",""),f(this,"externalId",""),f(this,"id",""),f(this,"latitude"),f(this,"logo"),f(this,"longitude"),f(this,"metadata"),f(this,"name",""),f(this,"operationHours"),f(this,"postal",""),f(this,"slug",""),f(this,"state",""),f(this,"telephone",""),f(this,"tzid",""),f(this,"tzidOverride",""),f(this,"utcOffset",""),f(this,"website",""),O(this,dn,e),O(this,cn,t),Object.assign(this,t)}static hydrate(e,t){return new Qi(t,e)}static async fetch(e){let t={fields:e.options.things.venue,slug:e.options.venue,limit:1};try{let n=await ee(e.options,"venue",t);return new Qi(e,n[0])}catch(e){return L.error("Fetch Venue:",e),{}}}get isMultiBuilding(){if(null==h(this,Jt).isMultiBuilding){let e=h(this,dn).maps,t=e.reduce(((e,t)=>e.add(t.elevation)),new Set),n=e.length!==t.size;h(this,Jt).isMultiBuilding=n}return h(this,Jt).isMultiBuilding}toJSON(){return h(this,cn)}},ln=Qi;u(ln,"MappedinVenue"),cn=new WeakMap,dn=new WeakMap,Jt=new WeakMap,g();var hn,er=class{constructor(e){f(this,"id",""),I(this,hn,void 0),f(this,"name"),f(this,"type"),f(this,"weight"),f(this,"multiplier"),O(this,hn,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new er(e)))}static async fetch(e){let t=e.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(e){te(t,e)}));let n={fields:t,venue:e.options.venue};try{return(await ee(e.options,"vortex",n)).map((e=>new er(e)))}catch(e){return L.error("Fetch Vortexes:",e),[]}}toJSON(){return h(this,hn)}},pn=er;function cm(e,t){let n=[];return e.features.forEach((e=>{var r,i;let a=[];null==(r=e.properties.spaces)||r.forEach((e=>{if("id"in e){let n;n=t.get(e.id),n&&a.push(...n)}else null==a||a.push({id:e.node,level:""})}));let o=a.map((e=>({node:"n_"+e.id,map:e.level}))),s=null==(i=e.properties.spaces)?void 0:i.filter((e=>"id"in e)),l=(e.properties.hours||[]).map((e=>({...e,"@type":"OpeningHoursSpecification",dayOfWeek:[e.dayOfWeek.replace("http://schema.org/","")]}))),u={...e.properties,polygons:s||[],nodes:o||[],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:l};delete u.spaces,n.push(u)})),n}function dm(e){let t=new Set;return e.features.forEach((e=>{var n;null==(n=e.properties.states)||n.forEach((e=>{t.add(e.type)}))})),Array.from(t).map((e=>({id:e,name:e,value:e})))}function pm(e){let t=[];return e.features.forEach((e=>{let n={...e.properties,icon:e.properties.picture};delete n.picture,t.push(n)})),t}function hm(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 mm(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 o=[...a].map((e=>({id:e,visible:!0}))),s=1/n.mapScale,l={...e.properties,georeference:r,shortName:e.properties.abbreviation||"",scene:{polygons:t},scale:s,x_scale:s,group:e.properties.building,layers:o,width:n.widthInMapUnits,height:n.heightInMapUnits};i.push(l)})),i}u(pn,"MappedinVortex"),hn=new WeakMap,g(),u(cm,"convertLocations"),u(dm,"convertLocationStates"),u(pm,"convertCategories"),u(hm,"getMapExtent"),u(mm,"convertMaps");var Mo=class{constructor(e){f(this,"mapExtent"),f(this,"stretchRatio"),f(this,"midLat"),f(this,"midLong"),f(this,"mapUnitRatio",1e6),f(this,"latDistance"),f(this,"longDistance"),f(this,"mapScale"),f(this,"widthInMapUnits"),f(this,"heightInMapUnits"),this.mapExtent=e;let{minLat:t,minLong:n,maxLat:r,maxLong:i}=e,a=(t+r)/2,o=(n+i)/2,s=new D(a,i),l=new D(a,n),u=new D(t,o),h=new D(r,o);this.latDistance=u.distanceTo(h),this.longDistance=s.distanceTo(l);let c=this.latDistance/this.longDistance,d=(r-t)/(i-n);this.stretchRatio=c/d,this.midLat=a,this.midLong=o,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 fm(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,o={...e.properties,x:r.x,y:r.y,paths:i,map:a,externalId:e.properties.externalId||""};n.push(o)})),n}u(Mo,"CoordinateConverter"),u(fm,"convertNodes");var Du=u(((e,t,n,r,i)=>{let a=[];return e.features.forEach((e=>{if(!e.geometry.coordinates[0].forEach)return;let o=[];"entrances"in e.properties&&(o=e.properties.entrances.map((e=>({id:"n_"+e.id,node:"n_"+e.id,map:e.level}))));let s,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,o=t*r/d/c.viewBox.width,l=a/d/c.viewBox.height;s={url:null==u?void 0:u.image,visible:!!(null==u?void 0:u.image),viewBox:c.viewBox,scale:{x:o,y:l},position:{x:e.x,y:e.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let f={...e.properties,entrances:o,map:e.properties.level,externalId:e.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:((null==u?void 0:u.altitude)||0)*i.mapScale/d},scale:{x:1,y:1,z:((null==u?void 0:u.height)||1)*i.mapScale/d}},material:{color:(null==u?void 0:u.color)||"#000000"},image:s,vertexes:h};a.push(f)})),a}),"generateMappedinPolygons");function gm(e,t,n,r,i,a){let o=Du(e,n,r,i,a),s=Du(t,n,r,i,a);return o.concat(s)}function ym(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:o,multiplier:s,accessible:l}=e.properties,u={id:r,nodes:a,name:n,type:i,weight:o,multiplier:s,accessible:l};t.set(r,u)}}))})),Array.from(t.values())}function vm(e){let t=[];return e.features.forEach((e=>{let n={...e.properties};t.push(n)})),t}function Fu(e){let t=Object.keys(e),n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,s=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":o.set(d,e[t]);break;case"style":case"polygon-style":s.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:o,building:h,category:c,location:d,manifest:f,style:p,polygonStyle:s,imageInstance:u,imageBinaries:l}}function Pu(e){let t=Array.from(e.connection.values()),n=Array.from(e.level.values()),r=e.building,i=e.category,a=e.style,o=e.location,s=e.imageInstance,l=e.polygonStyle,u={},h=[],c=new Map;n.forEach((t=>{let n=t.features[0].properties.id,r=hm(t),i=new Mo(r);c.set(n,i);let o=e.obstruction.get(n),d=e.space.get(n),f=s.get(n),p=l.get(n);u[n]=gm(d,o,a,p,f,i);let g=e.node.get(n);h.push(...fm(g,i))}));let d=Object.values(u).flat(),f=ym(t),p=n.map((e=>{let t=e.features[0].properties.id,n=c.get(t);return mm(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 m=vm(r),y=cm(o,g),v=pm(i),_=dm(o),w=e.manifest.features[0].properties.name,M=e.manifest.features[0].geometry.coordinates[0],b=e.manifest.features[0].geometry.coordinates[1],O=e.imageBinaries;return{locations:y,categories:v,nodes:h,maps:p,polygons:d,vortexes:f,mapGroups:m,locationStates:_,themes:[],venue:{name:w,latitude:b,longitude:M},imageBinaries:O}}u(gm,"convertPolygons"),u(ym,"convertVortexes"),u(vm,"convertMapGroups"),u(Fu,"categorizeMVFFilesByPath"),u(Pu,"convertMVFToMappedin"),g(),g(),g(),g();var Et,Be,qe,wo=[0,4,6,8,10],st=u((()=>{let e=new Array(16).fill(0),t=4294967296*Math.random();for(let n=0;n<e.length;n++)n>0&&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],wo.map(((e,t)=>n.slice(e,t===wo.length-1?void 0:wo[t+1]).join(""))).join("-")}),"randomId"),Cu="mi-session-data",Ru="mi-local-data",xo=class{constructor(){I(this,Be,void 0),I(this,qe,void 0);try{let e=sessionStorage.getItem(Cu);O(this,Be,e?JSON.parse(e):{id:st()})}catch{O(this,Be,{id:st()})}try{let e=localStorage.getItem(Ru);O(this,qe,e?JSON.parse(e):{deviceId:st()})}catch{O(this,qe,{deviceId:st()})}h(this,Be).id||(h(this,Be).id=st()),h(this,qe).deviceId||(h(this,qe).deviceId=st())}static getInstance(){return h(this,Et)||O(this,Et,new xo),h(this,Et)}static ___clearInstance(){O(this,Et,void 0)}saveSessionData(e,t){h(this,Be)[e]=t;try{return sessionStorage.setItem(Cu,JSON.stringify(h(this,Be))),!0}catch{return!1}}loadSessionData(e){let t=h(this,Be)[e];if(null!=t)return t}saveLocalData(e,t){h(this,qe)[e]=t;try{return localStorage.setItem(Ru,JSON.stringify(h(this,qe))),!0}catch{return!1}}loadLocalData(e){let t=h(this,qe)[e];if(null!=t)return t}},Kt=xo;function Bu(e){return/^[\da-f]{24}$/i.test(e)}function qu(){return Kt.getInstance().loadLocalData("deviceId")}function Gu(){return Kt.getInstance().loadSessionData("id")}u(Kt,"SafeStorage"),Et=new WeakMap,Be=new WeakMap,qe=new WeakMap,I(Kt,Et,void 0),u(Bu,"isGatewayKey"),u(qu,"getDeviceID"),u(Gu,"getSessionID");var ll,cl,mn,Xt,Yt,fn,Zt,Qt,ea,Lt,gn,ta,aa,yn,ul=Tr(sl()),Om=null==(cl=null==(ll=_)?void 0:ll.env)?void 0:cl.npm_package_version,To=["websdk","web","webv2"],Io="websdk",Oo=class{constructor(e){var t;I(this,mn,void 0),I(this,Xt,void 0),I(this,Yt,void 0),I(this,fn,void 0),I(this,Zt,void 0),I(this,Qt,void 0),I(this,ea,void 0),I(this,Lt,void 0),I(this,gn,void 0),I(this,ta,void 0),I(this,aa,void 0),I(this,yn,void 0),O(this,Lt,e.clientId),O(this,gn,e.clientSecret),O(this,ta,e.accessToken),O(this,ea,e.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!h(this,ea)&&h(this,Lt)&&!Bu(h(this,Lt))&&(n="https://web-proxy.mappedin.com/a/"),O(this,Yt,n),O(this,Yt,h(this,Yt)+(e.venue+"/")),O(this,Xt,!1),O(this,mn,"boolean"==typeof e.testMode?e.testMode:"true"===(null==(t=e.testMode)?void 0:t.toLowerCase())),O(this,fn,To.find((t=>t===e.context))||To[0]),O(this,Zt,qu()),O(this,Qt,Gu()),O(this,aa,new Set),O(this,yn,e.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(e,t){if(h(this,mn))return;let n={...t,g:h(this,Xt)},r=h(this,Yt)+e+"?"+ul.default.stringify(n),i={"mi-context":Io||h(this,fn),"mi-session":h(this,Qt),"mi-device":h(this,Zt),"mappedin-sdk-version":Om,"mappedin-platform-version":h(this,yn)};h(this,ta)?i.Authorization=`Bearer ${h(this,ta)}`:h(this,ea)||(i.Authorization=`Basic ${btoa(`${h(this,Lt)}:${h(this,gn)}`)}`),Mt()(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 h(this,Qt)}getDeviceID(){return h(this,Zt)}setGeolocationMode(e){O(this,Xt,e)}trackBlueDotEvent(e){e&&Object.values(Oo.BLUEDOT_EVENT).includes(e)&&!h(this,aa).has(e)?(this.track(e),h(this,aa).add(e)):L.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=To.find((t=>t===e));t&&(Io=t)}static clearContext(){Io=void 0}},tr=Oo;u(tr,"Analytics"),mn=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,fn=new WeakMap,Zt=new WeakMap,Qt=new WeakMap,ea=new WeakMap,Lt=new WeakMap,gn=new WeakMap,ta=new WeakMap,aa=new WeakMap,yn=new WeakMap,f(tr,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var ot,ar=tr,zo={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(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"}(ot||(ot={}));var xt,ia,na={categories:St,locations:rt,vortexes:pn,maps:Ya,nodes:nn,polygons:Nt,venue:ln,events:Va,mapGroups:en,themes:Yi,locationStates:Vi,rankings:on},wt=class{constructor(e){f(this,"perspective"),f(this,"things"),f(this,"options"),I(this,xt,void 0),I(this,ia,""),f(this,"updatedAt"),f(this,"categories",[]),f(this,"locations",[]),f(this,"vortexes",[]),f(this,"maps",[]),f(this,"nodes",[]),f(this,"polygons",[]),f(this,"venue",{}),f(this,"events",[]),f(this,"mapGroups",[]),f(this,"themes",[]),f(this,"locationStates",[]),f(this,"rankings"),f(this,"_categoriesById"),f(this,"_locationsById"),f(this,"_vortexesById"),f(this,"_mapsById"),f(this,"_nodesById"),f(this,"_polygonsById"),f(this,"_eventsById"),f(this,"_mapGroupsById"),f(this,"_locationStatesById"),f(this,"_locationRankingsById"),f(this,"_rankingsById"),f(this,"_categoriesByExternalId"),f(this,"_locationsByExternalId"),f(this,"_vortexesByExternalId"),f(this,"_mapsByExternalId"),f(this,"_nodesByExternalId"),f(this,"_polygonsByExternalId"),f(this,"_eventsByExternalId"),f(this,"_mapGroupsByExternalId"),f(this,"_locationStatesByExternalId"),f(this,"_locationRankingsByExternalId"),f(this,"_rankingsByExternalId"),f(this,"images"),f(this,"imageBinaries"),f(this,"scenes"),f(this,"analytics"),f(this,"navigator"),this.options=e,O(this,xt,Te.create(this));let t=new ar({...e,testMode:!(null==e?void 0:e.emitAnalyticsEvents)});this.analytics={locationSelected:t.locationSelected,categorySelected:t.categorySelected,getDirections:t.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(Qr,"true")}})}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=h(this,xt)[n];if(null!=e)return e;let t={};return this[n].forEach((e=>t[e.externalId]=e)),h(this,xt)[n]=t,t}}),Object.defineProperty(this,`_${n}ById`,{get(){let e=h(this,xt)[n];if(null!=e)return e;let t={};return this[n].forEach((e=>t[e.id]=e)),h(this,xt)[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=Pu(e);return this.hydrate(t)}async hydrate(e,t){let n;if("string"==typeof e)try{O(this,ia,e),n=JSON.parse(e)}catch(e){return void L.error("Unable to parse JSON",e)}else n=e,O(this,ia,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!=na[t]&&"function"==typeof na[t].hydrate&&(this[t]=na[t].hydrate(i,this))}t&&await Su(n);let{images:i,scenes:a,imageBinaries:o}=n;this.images=i,this.scenes=a,this.imageBinaries=o,this.generateGetters(r),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),Ou(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];na[r]&&t.push(na[r].fetch(this).then((e=>(this[r]=e,Promise.resolve()))))}return this.generateGetters(n),Promise.all(t).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new io({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(){var e;let t={};for(let e in na)Array.isArray(this[e])&&(t[e]=this[e].map((e=>e.toJSON())));let n={...t,venue:this.venue.toJSON()};return null!=this.rankings&&(n.rankings=null==(e=this.rankings)?void 0:e.toJSON()),delete n.locationRankings,n}toString(){return h(this,ia)||JSON.stringify(this.toJSON())}};u(wt,"Mappedin"),xt=new WeakMap,ia=new WeakMap,g();var dl={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"]};g(),g();var re=u((function(){return re=Object.assign||u((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}),"__assign"),re.apply(this,arguments)}),"__assign");function K(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 de(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.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 o}u(K,"__values"),u(de,"__read");var vn,zm="ENTRIES",pl="KEYS",hl="VALUES",pe="",Ao=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 u(e,"TreeIterator"),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=ra(this._path),t=e.node,n=e.keys;if(ra(n)===pe)return{done:!1,value:this.result()};var r=t.get(ra(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=ra(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 ra(t)})).filter((function(e){return e!==pe})).join("")},e.prototype.value=function(){return ra(this._path).node.get(pe)},e.prototype.result=function(){switch(this._type){case hl:return this.value();case pl:return this.key();default:return[this.key(),this.value()]}},e.prototype[Symbol.iterator]=function(){return this},e}(),ra=u((function(e){return e[e.length-1]}),"last$1"),Am=u((function(e,t,n){var r=new Map;if(void 0===t)return r;for(var i=t.length+1,a=i+n,o=new Uint8Array(a*i).fill(n+1),s=0;s<i;++s)o[s]=s;for(var l=1;l<a;++l)o[l*i]=l;return ml(e,t,n,r,o,1,i,""),r}),"fuzzySearch"),ml=u((function(e,t,n,r,i,a,o,s){var l,u,h=a*o;try{e:for(var c=K(e.keys()),d=c.next();!d.done;d=c.next()){var f=d.value;if(f===pe){var p=i[h-1];p<=n&&r.set(s,[e.get(f),p])}else{for(var g=a,m=0;m<f.length;++m,++g){for(var y=f[m],v=o*g,_=v-o,w=i[v],M=Math.max(0,g-n-1),b=Math.min(o-1,g+n),O=M;O<b;++O){var I=y!==t[O],x=i[_+O]+ +I,k=i[_+O+1]+1,E=i[v+O]+1,T=i[v+O+1]=Math.min(x,k,E);T<w&&(w=T)}if(w>n)continue e}ml(e.get(f),t,n,r,i,g,o,s+f)}}}catch(e){l={error:e}}finally{try{d&&!d.done&&(u=c.return)&&u.call(c)}finally{if(l)throw l.error}}}),"recurse"),No=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 u(e,"SearchableMap"),e.prototype.atPrefix=function(t){var n,r;if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");var i=de(nr(this._tree,t.slice(this._prefix.length)),2),a=i[0],o=i[1];if(void 0===a){var s=de(Lo(o),2),l=s[0],u=s[1];try{for(var h=K(l.keys()),c=h.next();!c.done;c=h.next()){var d=c.value;if(d!==pe&&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,Nm(this._tree,e)},e.prototype.entries=function(){return new Ao(this,zm)},e.prototype.forEach=function(e){var t,n;try{for(var r=K(this),i=r.next();!i.done;i=r.next()){var a=de(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 Am(this._tree,e,t)},e.prototype.get=function(e){var t=So(this._tree,e);return void 0!==t?t.get(pe):void 0},e.prototype.has=function(e){var t=So(this._tree,e);return void 0!==t&&t.has(pe)},e.prototype.keys=function(){return new Ao(this,pl)},e.prototype.set=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");return this._size=void 0,Eo(this._tree,e).set(pe,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=Eo(this._tree,e);return n.set(pe,t(n.get(pe))),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=Eo(this._tree,e),r=n.get(pe);return void 0===r&&n.set(pe,r=t()),r},e.prototype.values=function(){return new Ao(this,hl)},e.prototype[Symbol.iterator]=function(){return this.entries()},e.from=function(t){var n,r,i=new e;try{for(var a=K(t),o=a.next();!o.done;o=a.next()){var s=de(o.value,2),l=s[0],u=s[1];i.set(l,u)}}catch(e){n={error:e}}finally{try{o&&!o.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}(),nr=u((function(e,t,n){var r,i;if(void 0===n&&(n=[]),0===t.length||null==e)return[e,n];try{for(var a=K(e.keys()),o=a.next();!o.done;o=a.next()){var s=o.value;if(s!==pe&&t.startsWith(s))return n.push([e,s]),nr(e.get(s),t.slice(s.length),n)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n.push([e,t]),nr(void 0,"",n)}),"trackDown"),So=u((function(e,t){var n,r;if(0===t.length||null==e)return e;try{for(var i=K(e.keys()),a=i.next();!a.done;a=i.next()){var o=a.value;if(o!==pe&&t.startsWith(o))return So(e.get(o),t.slice(o.length))}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}),"lookup"),Eo=u((function(e,t){var n,r,i=t.length;e:for(var a=0;e&&a<i;){try{for(var o=(n=void 0,K(e.keys())),s=o.next();!s.done;s=o.next()){var l=s.value;if(l!==pe&&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{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}var f=new Map;return e.set(t.slice(a),f),f}return e}),"createPath"),Nm=u((function(e,t){var n=de(nr(e,t),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(pe),0===r.size)fl(i);else if(1===r.size){var a=de(r.entries().next().value,2),o=a[0],s=a[1];gl(i,o,s)}}),"remove"),fl=u((function(e){if(0!==e.length){var t=de(Lo(e),2),n=t[0],r=t[1];if(n.delete(r),0===n.size)fl(e.slice(0,-1));else if(1===n.size){var i=de(n.entries().next().value,2),a=i[0],o=i[1];a!==pe&&gl(e.slice(0,-1),a,o)}}}),"cleanup"),gl=u((function(e,t,n){if(0!==e.length){var r=de(Lo(e),2),i=r[0],a=r[1];i.set(a+t,n),i.delete(a)}}),"merge"),Lo=u((function(e){return e[e.length-1]}),"last"),Do="or",Sm="and",Em="and_not",Dt=function(){function e(e){if(null==(null==e?void 0:e.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=re(re(re({},Po),e),{searchOptions:re(re({},kl),e.searchOptions||{})}),this._index=new No,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 u(e,"MiniSearch"),e.prototype.add=function(e){var t,n,r,i,a=this._options,o=a.extractField,s=a.tokenize,l=a.processTerm,u=a.fields,h=a.idField,c=o(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=K(u),p=f.next();!p.done;p=f.next()){var g=p.value,m=o(e,g);if(null!=m){var y=s(m.toString(),g),v=this._fieldIds[g],_=new Set(y).size;this.addFieldLength(d,v,this._documentCount-1,_);try{for(var w=(r=void 0,K(y)),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=K(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()},o=e.reduce((function(e,t,r){var a=e.chunk,o=e.promise;return a.push(t),(r+1)%i==0?{chunk:[],promise:o.then((function(){return new Promise((function(e){return setTimeout(e,0)}))})).then((function(){return n.addAll(a)}))}:{chunk:a,promise:o}}),a),s=o.chunk;return o.promise.then((function(){return n.addAll(s)}))},e.prototype.remove=function(e){var t,n,r,i,a,o,s=this._options,l=s.tokenize,u=s.processTerm,h=s.extractField,c=s.fields,d=s.idField,f=h(e,d);if(null==f)throw new Error('MiniSearch: document does not have ID field "'.concat(d,'"'));try{for(var p=K(this._documentIds),g=p.next();!g.done;g=p.next()){var m=de(g.value,2),y=m[0];if(f===m[1]){try{for(var v=(r=void 0,K(c)),_=v.next();!_.done;_=v.next()){var w=_.value,M=h(e,w);if(null!=M){var b=l(M.toString(),w),O=this._fieldIds[w],I=new Set(b).size;this.removeFieldLength(y,O,this._documentCount,I);try{for(var x=(a=void 0,K(b)),k=x.next();!k.done;k=x.next()){var E=u(k.value,w);E&&this.removeTerm(O,y,E)}}catch(e){a={error:e}}finally{try{k&&!k.done&&(o=x.return)&&o.call(x)}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(y),this._documentIds.delete(y),this._fieldLength.delete(y),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=K(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 No,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 o=K(i),s=o.next();!s.done;s=o.next()){var l=de(s.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{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a.sort(Ml),a},e.prototype.autoSuggest=function(e,t){var n,r,i,a;void 0===t&&(t={}),t=re(re({},Cm),t);var o=new Map;try{for(var s=K(this.search(e,t)),l=s.next();!l.done;l=s.next()){var u=l.value,h=u.score,c=(v=u.terms).join(" ");null!=(m=o.get(c))?(m.score+=h,m.count+=1):o.set(c,{score:h,terms:v,count:1})}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}var d=[];try{for(var f=K(o),p=f.next();!p.done;p=f.next()){var g=de(p.value,2),m=g[0],y=g[1],v=(h=y.score,y.terms),_=y.count;d.push({suggestion:m,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(Ml),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(Po.hasOwnProperty(e))return Fo(Po,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},e.loadJS=function(t,n){var r,i,a,o,s=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 m=new e(n);m._documentCount=l,m._nextId=u,m._documentIds=ir(h),m._fieldIds=c,m._fieldLength=ir(d),m._avgFieldLength=f,m._storedFields=ir(p),m._index=new No;try{for(var y=K(s),v=y.next();!v.done;v=y.next()){var _=de(v.value,2),w=_[0],M=_[1],b=new Map;try{for(var O=(a=void 0,K(Object.keys(M))),I=O.next();!I.done;I=O.next()){var x=I.value,k=M[x];1===g&&(k=k.ds),b.set(parseInt(x,10),ir(k))}}catch(e){a={error:e}}finally{try{I&&!I.done&&(o=O.return)&&o.call(O)}finally{if(a)throw a.error}}m._index.set(w,b)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}return m},e.prototype.executeQuery=function(e,t){var n=this;if(void 0===t&&(t={}),"string"!=typeof e){var r=re(re(re({},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,o=a.tokenize,s=a.processTerm,l=a.searchOptions,u=re(re({tokenize:o,processTerm:s},l),t),h=u.tokenize,c=u.processTerm,d=h(e).map((function(e){return c(e)})).filter((function(e){return!!e})).map(Pm(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,o,s,l=re(re({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce((function(e,t){var n;return re(re({},e),((n={})[t]=Fo(e,t)||1,n))}),l.boost||{}),h=l.boostDocument,c=l.weights,d=l.maxFuzzy,f=re(re({},kl.weights),c),p=f.fuzzy,g=f.prefix,m=this._index.get(e.term),y=this.termResults(e.term,e.term,1,m,u,h);if(e.prefix&&(o=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;_&&(s=this._index.fuzzyGet(e.term,_))}if(o)try{for(var w=K(o),M=w.next();!M.done;M=w.next()){var b=de(M.value,2),O=b[0],I=b[1];if(T=O.length-e.term.length){null==s||s.delete(O);var x=g*O.length/(O.length+.3*T);this.termResults(e.term,O,x,I,u,h,y)}}}catch(e){n={error:e}}finally{try{M&&!M.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}if(s)try{for(var k=K(s.keys()),E=k.next();!E.done;E=k.next()){O=E.value;var T,F=de(s.get(O),2),A=F[0];if(T=F[1]){x=p*O.length/(O.length+T);this.termResults(e.term,O,x,A,u,h,y)}}}catch(e){i={error:e}}finally{try{E&&!E.done&&(a=k.return)&&a.call(k)}finally{if(i)throw i.error}}return y},e.prototype.combineResults=function(e,t){if(void 0===t&&(t=Do),0===e.length)return new Map;var n=t.toLowerCase();return e.reduce(Lm[n])||new Map},e.prototype.toJSON=function(){var e,t,n,r,i=[];try{for(var a=K(this._index),o=a.next();!o.done;o=a.next()){var s=de(o.value,2),l=s[0],u=s[1],h={};try{for(var c=(n=void 0,K(u)),d=c.next();!d.done;d=c.next()){var f=de(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{o&&!o.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,o){var s,l,u,h,c;if(void 0===o&&(o=new Map),null==r)return o;try{for(var d=K(Object.keys(i)),f=d.next();!f.done;f=d.next()){var p=f.value,g=i[p],m=this._fieldIds[p],y=r.get(m);if(null!=y){var v=y.size,_=this._avgFieldLength[m];try{for(var w=(u=void 0,K(y.keys())),M=w.next();!M.done;M=w.next()){var b=M.value,O=a?a(this._documentIds.get(b),t):1;if(O){var I=y.get(b),x=this._fieldLength.get(b)[m],k=n*g*O*Fm(I,v,this._documentCount,x,_),E=o.get(b);if(E){E.score+=k,Rm(E.terms,e);var T=Fo(E.match,t);T?T.push(p):E.match[t]=[p]}else o.set(b,{score:k,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){s={error:e}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(s)throw s.error}}return o},e.prototype.addTerm=function(e,t,n){var r=this._index.fetch(n,wl),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,wl),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=K(Object.keys(this._fieldIds)),o=a.next();!o.done;o=a.next()){var s=o.value;if(this._fieldIds[s]===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(s,'". Removing a document after it has changed can corrupt the index!'))}}catch(e){r={error:e}}finally{try{o&&!o.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,o=i.extractField;if(null!=a&&0!==a.length){var s=this._storedFields.get(e);null==s&&this._storedFields.set(e,s={});try{for(var l=K(a),u=l.next();!u.done;u=l.next()){var h=u.value,c=o(t,h);void 0!==c&&(s[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}(),Fo=u((function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}),"getOwnProperty"),Lm=((vn={})[Do]=function(e,t){var n,r;try{for(var i=K(t.keys()),a=i.next();!a.done;a=i.next()){var o=a.value,s=e.get(o);if(null==s)e.set(o,t.get(o));else{var l=t.get(o),u=l.score,h=l.terms,c=l.match;s.score=s.score+u,s.match=Object.assign(s.match,c),bl(s.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},vn[Sm]=function(e,t){var n,r,i=new Map;try{for(var a=K(t.keys()),o=a.next();!o.done;o=a.next()){var s=o.value,l=e.get(s);if(null!=l){var u=t.get(s),h=u.score,c=u.terms,d=u.match;bl(l.terms,c),i.set(s,{score:l.score+h,terms:l.terms,match:Object.assign(l.match,d)})}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},vn[Em]=function(e,t){var n,r;try{for(var i=K(t.keys()),a=i.next();!a.done;a=i.next()){var o=a.value;e.delete(o)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},vn),yl=1.2,vl=.7,Dm=.5,Fm=u((function(e,t,n,r,i){return Math.log(1+(n-t+.5)/(t+.5))*(Dm+e*(yl+1)/(e+yl*(1-vl+vl*r/i)))}),"calcBM25Score"),Pm=u((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}}}),"termToQuerySpec"),Po={idField:"id",extractField:function(e,t){return e[t]},tokenize:function(e,t){return e.split(Bm)},processTerm:function(e,t){return e.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},kl={combineWith:Do,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},Cm={prefix:function(e,t,n){return t===n.length-1}},Rm=u((function(e,t){e.includes(t)||e.push(t)}),"assignUniqueTerm"),bl=u((function(e,t){var n,r;try{for(var i=K(t),a=i.next();!a.done;a=i.next()){var o=a.value;e.includes(o)||e.push(o)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}),"assignUniqueTerms"),Ml=u((function(e,t){var n=e.score;return t.score-n}),"byScore"),wl=u((function(){return new Map}),"createMap"),ir=u((function(e){var t,n,r=new Map;try{for(var i=K(Object.keys(e)),a=i.next();!a.done;a=i.next()){var o=a.value;r.set(parseInt(o,10),e[o])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}),"objectToNumericMap"),Bm=/[\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;g();var qm=["0","1","2","3","4","5","6","7","8","9"],Gm=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],Vm=["0","1","2","3","4","5","6","7","8","9"],Um=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],Mk=[...qm,...Gm,...Vm,...Um],xl=["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"];g();var $m=32,je=!1,Wm=120,Co=0,rr=class{constructor(e){f(this,"_callback"),f(this,"_frameCount"),f(this,"_ordering"),f(this,"_supersededBy"),f(this,"name"),f(this,"_remainingFrameCount"),f(this,"_lastFrameTime"),f(this,"userdata"),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,je&&L.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}};u(rr,"FrameUpdate");var lt=class{constructor(e){if(f(this,"_postponed"),f(this,"userdata"),f(this,"_priority"),f(this,"_group"),f(this,"name"),f(this,"_lastFrameTime"),f(this,"_callback"),f(this,"_complete"),f(this,"_scheduled"),f(this,"_cancelled"),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,je&&L.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}};u(lt,"FrameTask");var or=class{constructor(e){f(this,"_postponed"),f(this,"_onComplete"),f(this,"_priority"),f(this,"userdata"),f(this,"name"),f(this,"_tasks"),f(this,"_scheduledTasks"),f(this,"_scheduled"),f(this,"_cancelled"),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,je&&L.log("task group instantiated",this.name)}isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let e of this._scheduledTasks)return this._scheduledTasks.delete(e),e}};u(or,"FrameTaskGroup");var Ro=class{constructor(e){f(this,"_maxMillisecondsPerFrame"),f(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==e?void 0:e.maxMillisecondsPerFrame)?e.maxMillisecondsPerFrame:$m,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}};u(Ro,"RealTimeTimer");var sr=class{constructor(e){var t;f(this,"_raf"),f(this,"_timer"),f(this,"_performance"),f(this,"_scheduledUpdatesByOrdering"),f(this,"_scheduledTasksByPriority"),f(this,"_postponedTasks"),f(this,"_requestAnimationFrameHandle"),f(this,"_updatesToRunThisFrame"),f(this,"_lastFrameTime",0),f(this,"_updatesRunLastFrame"),this._timer=null!=(null==e?void 0:e.timer)?e.timer:new Ro,this._performance=null!=(null==e?void 0:e.performance)&&e.performance,this._scheduledUpdatesByOrdering=new oa,this._scheduledTasksByPriority=new oa,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),je&&L.log("task scheduler instantiated"),(null==(t=globalThis.MappedinDebug)?void 0:t.TEST_IOS)&&(this._raf=e=>setTimeout(e,16))}clear(){for(let e of this._scheduledTasksByPriority.values())e._cancelled=!0;for(let e of this._postponedTasks.values())e._cancelled=!0;this._scheduledUpdatesByOrdering=new oa,this._scheduledTasksByPriority=new oa,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),je&&L.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;je&&(0===Co&&(n=!0),++Co,Co%=Wm);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&&L.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&&L.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&&L.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;L.assert(void 0!==n),Object.getPrototypeOf(n)===or.prototype&&(r=n,n=r._popTask()),L.assert(void 0!==n),L.assert(Object.getPrototypeOf(n)===lt.prototype),this._performance&&(t=performance.now()),n._callback(e),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-t),je&&L.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),je&&L.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)===or)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,je&&L.log("task scheduled",e.name),this.requestAnimationFrame()}cancelUpdate(e){this._scheduledUpdatesByOrdering.delete(e._ordering,e),je&&L.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)===lt.prototype?e._cancelled=!0:"clear"in e&&e.clear(),je&&L.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)===lt.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)===lt.prototype||!e.isComplete())&&this._postponedTasks.add(e),e._postponed=!0,je&&L.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)===lt.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)===lt.prototype||!e.isComplete())&&this._scheduledTasksByPriority.insert(e._priority,e),e._postponed=!1,this.requestAnimationFrame(),je&&L.log("task resumed",e.name)}}setTaskPriority(e,t){if(Object.getPrototypeOf(e)===lt.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,je&&L.log("task priority changed",e.name,t)}};u(sr,"TaskScheduler");var oa=class{constructor(){f(this,"_map"),f(this,"_size"),f(this,"_sortedKeys"),this._map=new Map,this._size=0,this._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(L.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 L.assert(e===this._size),e}};u(oa,"Multimap");var Ft,Ee,jt,Ze,he,kn,bn,ua,Mn,la,dt,ur,lr,_t,wn,cr,dr,pr,of,xn,jn,qo,ct=u((e=>e.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()),"removeAccents"),sa="",Hm=.09,Jm=1,Km=.025,Xm=.5,Ym=5e-4,Zm=5e-4,Qm=.01,ef=.05,jl=1,tf=.01,af=.2,nf={MappedinCategory:"categories",MappedinLocation:"locations"},rf={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:xl,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===_.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:Hm,PRIMARY_INDEX_WEIGHT:Jm,SECONDARY_INDEX_WEIGHT:Km,CATEGORY_NAME_WEIGHT:Xm,LOCATION_NAME_WEIGHT:jl,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:Ym,CATEGORY_LOCATION_TAGS_WEIGHT:Zm,CATEGORY_LOCATION_NAME_WEIGHT:Qm,PRIMARY_INDEX_TAGS_NAME_WEIGHT:ef,LOCATION_DEFAULT_RANK:jl,RATIO_OF_FUZZY_TO_EXACT:tf,RATIO_OF_PREFIX_TO_EXACT:af}},Bo=class{constructor(e,t){var n,r,i;I(this,pr),I(this,Ft,void 0),I(this,Ee,void 0),I(this,jt,void 0),I(this,Ze,void 0),I(this,he,void 0),I(this,kn,new sr({performance:!0})),I(this,bn,void 0),I(this,ua,void 0),I(this,Mn,new Map),I(this,la,0),I(this,dt,u((e=>{Or(this,la)._++,h(this,kn).scheduleUpdate(new rr({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{e(),Or(this,la)._--,0===h(this,la)&&h(this,wn).call(this)}}))}),"#addTask")),I(this,ur,u((e=>{var t,n,r;let{SECONDARY_INDEX_WEIGHT:i,LOCATION_DEFAULT_RANK:a,PRIMARY_INDEX_TAGS_NAME_WEIGHT:o}=h(this,he).constants,s=a;(null==(t=h(this,he))?void 0:t.useLocationRank)&&(s=Array.isArray(e.polygons)?Math.max(...e.polygons.map((e=>{var t,n;return(null==(t=e.rank)?void 0:t.score)?null==(n=e.rank)?void 0:n.score:a})),a):a),h(this,dt).call(this,(()=>{h(this,Ee).add({name:ct(e.name),tags:"",id:"MappedinLocation_"+e.id,weight:a,rank:s})})),(null==(n=h(this,he))?void 0:n.searchTags)&&Array.isArray(e.tags)&&e.tags.forEach((t=>{h(this,Ee).add({name:"",tag:ct(t),id:"MappedinLocation_"+e.id,weight:o,rank:s})})),(null==(r=h(this,he))?void 0:r.searchDescriptions)&&h(this,dt).call(this,(()=>h(this,jt).add({description:ct(e.description||""),id:"MappedinLocation_"+e.id,weight:i,rank:s})))}),"#processLocation")),I(this,lr,u((e=>{var t,n;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:r,CATEGORY_LOCATION_TAGS_WEIGHT:i,CATEGORY_LOCATION_NAME_WEIGHT:a,CATEGORY_NAME_WEIGHT:o}=h(this,he).constants;h(this,dt).call(this,(()=>h(this,Ee).add({name:ct(e.name||""),description:"",id:"MappedinCategory_"+e.id,weight:o})));let s=e.locations.reduce(((e,t)=>e+` ${sa} `+t.name),"")+` ${sa}`;if((null==(t=h(this,he))?void 0:t.searchDescriptionsInCategories)&&e.locations.forEach((t=>{null!=t.description&&h(this,dt).call(this,(()=>h(this,Ze).add({id:"MappedinCategory_"+e.id,"category.locations.description":ct(t.description),ref:t.name,weight:r})))})),null==(n=h(this,he))?void 0:n.searchTagsInCategories){let t=e.locations.reduce(((e,t)=>{var n;return e+(null==(n=t.tags)?void 0:n.reduce(((e,t)=>e+` ${sa} `+t),""))+` ${sa}`}),"");h(this,dt).call(this,(()=>h(this,Ze).add({"category.locations.tags":ct(t),id:"MappedinCategory_"+e.id,weight:i})))}h(this,dt).call(this,(()=>h(this,Ze).add({"category.locations.name":ct(s),id:"MappedinCategory_"+e.id,weight:a})))}),"#processCategory")),I(this,_t,void 0),I(this,wn,void 0),I(this,cr,u((e=>{var t;let n=e.score,{object:r,id:i,weight:a,rank:o}=e,[s,l]=i.split("_"),u=r||h(this,Ft).getCollectionItemById(nf[s],l);return o&&(null==(t=h(this,he))?void 0:t.useLocationRank)&&(n+=o),a&&(n*=a),{score:n,type:s,object:u}}),"#processSearchResult")),I(this,dr,u(((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(`[^${sa}]* `+n+` [^${sa}]*`,"ig").exec(e[r]);null!=t&&(i=t[0].slice(1,-1))}t.matches.push({term:n,weight:e.weight,matchesOn:r,value:i})}))}),"#addMatches")),I(this,xn,void 0),I(this,jn,void 0),O(this,ua,new ar({...e.options,testMode:!1===(null==t?void 0:t.emitAnalyticsEvents)})),O(this,he,{...rf,...t}),O(this,Ft,e),O(this,bn,new Set(null==(n=h(this,he))?void 0:n.stopWords));let{PRIMARY_INDEX_FUZZYNESS:a,PRIMARY_INDEX_WEIGHT:o,CATEGORY_NAME_WEIGHT:s,RATIO_OF_FUZZY_TO_EXACT:l,RATIO_OF_PREFIX_TO_EXACT:c,PRIMARY_INDEX_TAGS_NAME_WEIGHT:d}=h(this,he).constants,f=["object","query","weight","tag","rank"],p={fields:["query","name","tag"],storeFields:f,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:a},boost:{name:o,query:o,tag:d},weights:{fuzzy:l,prefix:c},boostDocument:e=>e.includes("MappedinLocation")?o:e.includes("MappedinCategory")?s:o},g={fields:["description"],storeFields:f,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(e,t)=>{var n;return(null==(n=h(this,bn))?void 0:n.has(e.toLowerCase()))?null:e.toLowerCase()}},m={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...f,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(O(this,_t,new Promise((e=>{O(this,wn,e)}))),null==(r=h(this,he))?void 0:r.jsonIndex){let{primary:e,secondary:t,extra:n}=JSON.parse(null==(i=h(this,he))?void 0:i.jsonIndex);O(this,Ee,Dt.loadJS(e,p)),O(this,jt,Dt.loadJS(t,g)),O(this,Ze,Dt.loadJS(n,m))}else O(this,Ee,new Dt(p)),O(this,jt,new Dt(g)),O(this,Ze,new Dt(m)),h(this,Ft).locations.forEach(h(this,ur)),h(this,Ft).categories.forEach(h(this,lr));h(this,kn).update(performance.now()),O(this,xn,bo(((e,t)=>{h(this,ua).trackSearchSuggest({query:e,hits:t})}),300)),O(this,jn,bo(((e,t)=>{h(this,ua).trackSearch({query:e,hits:t})}),300))}async suggest(e){await h(this,_t);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}=h(this,he).constants,o=h(this,Ee).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 h(this,xn).call(this,e,o.length),{total:o.length,hits:o.map((e=>({text:e.suggestion})))}}async search(e){await h(this,_t);let t=tt(this,pr,of).call(this,e);return h(this,jn).call(this,e,t.length),t}async toJSON(){return await h(this,_t),JSON.stringify({primary:h(this,Ee),secondary:h(this,jt),extra:h(this,Ze)})}async addQuery(e){let t,n,{query:r,object:i,weight:a=1}=e;await h(this,_t),t=i instanceof rt?"MappedinLocation":i instanceof St?"MappedinCategory":"Custom","MappedinLocation"===t||"MappedinCategory"===t?n=t+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=h(this,Mn).get(i),n||(n="Custom_"+st(),h(this,Mn).set(i,n))),h(this,Ee).add({id:n,weight:a,object:i,query:ct(r)})}};u(Bo,"OfflineSearch"),Ft=new WeakMap,Ee=new WeakMap,jt=new WeakMap,Ze=new WeakMap,he=new WeakMap,kn=new WeakMap,bn=new WeakMap,ua=new WeakMap,Mn=new WeakMap,la=new WeakMap,dt=new WeakMap,ur=new WeakMap,lr=new WeakMap,_t=new WeakMap,wn=new WeakMap,cr=new WeakMap,dr=new WeakMap,pr=new WeakSet,of=u((function(e){let t=[],n=ct(e);t=[...h(this,Ee).search(n),...h(this,jt).search(n),...h(this,Ze).search(n)].sort(((e,t)=>t.score-e.score));let r={};for(let e of t){let t=h(this,cr).call(this,e);r[e.id]?r[e.id].score+=t.score:r[e.id]={...t,matches:[]},h(this,dr).call(this,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))}),"#doSearch"),xn=new WeakMap,jn=new WeakMap,g(),function(e){e.MULTI_GEOMETRY="MULTI_GEOMETRY",e.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(qo||(qo={}));var cs=globalThis.fetch;function Mt(){if(null==cs)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return cs}function qk(e){cs=e}u(Mt,"isomorphicFetch"),u(qk,"setFetchFn");var dc,pc,zf=null==(pc=null==(dc=_)?void 0:dc.env)?void 0:pc.npm_package_version;globalThis.btoa||(globalThis.btoa=lc.encode);var Af=["ar"];function Sn(e){let t={...zo,things:dl,...e};return t.headers={...t.headers,"mappedin-sdk-version":zf},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 Vk(e){let{venue:t,clientId:n,clientSecret:r,bundleBaseUri:i}=e,a=new wt({venue:t}),o=Fu(await Ef({clientId:n,clientSecret:r,venue:t,bundleBaseUri:i},!1));return a.hydrateFromMVF(o),a}async function Nf(e){let t=Sn({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,...e}}),n="public/1/"+(t.useDraftData?"draft/":""),r=new wt({...t,baseUrl:t.baseUrl+n});return await r.fetch(),r}function Uk(e){Nf=e}u(Sn,"parseOptions"),u(Vk,"getVenueMVF"),u(Nf,"getVenue"),u(Uk,"__setGetVenueMock");var ds={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function $k(e){let t=Sn({baseUrl:"https://api-gateway.mappedin.com/",...ds,...e}),{url:n,updated_at:r}=await Sf(e),i=await Mt()(n,{mode:"cors"}),{data:a,format:o="jsonstring"}=await i.json();if("jsonstring"!==o)throw new Error(`Unrecognized format ${o}`);let s=new wt(t);return await s.hydrate(a,t.shouldPopulateBundledImagesAsBlobs),s.updatedAt=r,s}async function Sf(e){let t=Sn({baseUrl:"https://api-gateway.mappedin.com/",...ds,...e}),{version:n,venue:r}=e,i=`${e.bundleBaseUri||t.baseUrl+`exports/legacy${null!=t.language&&Af.includes(t.language)?"-"+t.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return t.language=void 0,await Bi(t,i)}async function Wk(e,{url:t,updated_at:n}){let r=Sn({baseUrl:"https://api-gateway.mappedin.com/",...ds,...e}),i=await Mt()(t,{mode:"cors"}),{data:a,format:o="jsonstring"}=await i.json();if("jsonstring"!==o)throw new Error(`Unrecognized format${o}`);let s=new wt(r);return await s.hydrate(a,r.shouldPopulateBundledImagesAsBlobs),s.updatedAt=n,s}async function cc(e){let t=Sn({baseUrl:"https://api-gateway.mappedin.com/",...zo,...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 Bi(t,i)}async function Ef(e,t=!1){return new Promise((async(n,r)=>{try{let i=new TextDecoder,a=i.decode.bind(i),o=await Promise.resolve().then((()=>(uc(),sc)));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 cc(e),s=new Uint8Array(await Mt()(i).then((e=>e.arrayBuffer()))),l=o.unzipSync(s),h=Object.keys(l),c=Math.min(h.length,Math.min(4,navigator.hardwareConcurrency)||4),d=[],f=h.map((e=>[e,l[e].buffer])),p=1e6,g=[],m=[];for(let e=0;e<f.length;e++){let[,t]=f[e];t.byteLength>=p?g.push(f[e]):t.byteLength<p&&m.push(f[e])}let y={};if(0===m.length)f.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=m[o];if(null!=n){let[e,r]=n;t.postMessage(["task",e]),t.postMessage(r,[r]),o++}let[r,i]=e[1];y[r]=i,s++}else if("error"===e[0]){let[,t]=e;d.forEach((e=>e.terminate())),r(t)}s===h.length&&(n(y),d.forEach((e=>e.terminate())))};u(e,"handleMessage");let i=URL.createObjectURL(t);for(let e=0;e<Math.min(c,m.length);e++)d.push(new Worker(i));let o=0,s=0;d.forEach((t=>{if(t.onmessage=e,null!=m[o]){let[e,n]=m[o];t.postMessage(["task",e]),t.postMessage(n,[n]),o++}})),g.forEach((([e])=>{y[e]=JSON.parse(a(l[e])),s++}))}}else{let{url:t}=await cc(e),r=new Uint8Array(await Mt()(t).then((e=>e.arrayBuffer()))),i=o.unzipSync(r),s=Object.keys(i),l={};for(let e=0;e<s.length;e++){let t=s[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(e){L.warn("bad file",t)}}n(l)}}catch(e){r(e)}}))}u($k,"getVenueBundle"),u(Sf,"getVenueBundleURL"),u(Wk,"downloadBundle"),u(cc,"getVenueMVFURL"),u(Ef,"downloadVenueBundleMVF");export{qo as MAP_RENDER_MODE,wt as Mappedin,St as MappedinCategory,ot as MappedinCollectionType,$t as MappedinCoordinate,Sa as MappedinDestinationSet,Gt as MappedinDirections,Va as MappedinEvent,rt as MappedinLocation,Ya as MappedinMap,en as MappedinMapGroup,it as MappedinNavigatable,nn as MappedinNode,Nt as MappedinPolygon,on as MappedinRankings,ln as MappedinVenue,pn as MappedinVortex,Bo as OfflineSearch,Uk as __setGetVenueMock,Wk as downloadBundle,Ef as downloadVenueBundleMVF,Nf as getVenue,$k as getVenueBundle,Sf as getVenueBundleURL,Vk as getVenueMVF,cc as getVenueMVFURL,Mt as isomorphicFetch,qk as setFetchFn};