@mappedin/mappedin-js 4.1.4 → 4.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var dc,I,nc=Object.create,ca=Object.defineProperty,rc=Object.getOwnPropertyDescriptor,ic=Object.getOwnPropertyNames,oc=Object.getPrototypeOf,sc=Object.prototype.hasOwnProperty,uc=(t,e,n)=>e in t?ca(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ro=t=>ca(t,"__esModule",{value:!0}),Co=(t,e)=>()=>(t&&(e=t(t=0)),e),B=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),lc=(t,e)=>{for(var n in Ro(t),e)ca(t,n,{get:e[n],enumerable:!0})},cc=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of ic(e))!sc.call(t,r)&&"default"!==r&&ca(t,r,{get:()=>e[r],enumerable:!(n=rc(e,r))||n.enumerable});return t},vn=t=>cc(Ro(ca(null!=t?nc(oc(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),p=(t,e,n)=>(uc(t,"symbol"!=typeof e?e+"":e,n),n),pi=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},f=(t,e,n)=>(pi(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(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)},S=(t,e,n,r)=>(pi(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Bo=(t,e,n)=>(pi(t,e,"access private method"),n),g=Co((()=>{I={env:dc={NODE_ENV:"production",npm_package_version:"4.1.4"}}})),Go=B(((t,e)=>{g(),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)})),se=B((t=>{g(),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})),pa=B((t=>{g(),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})),ha=B((t=>{g(),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})),fa=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),n=function(t){return e.sexagesimalPattern.test(t.toString().trim())};t.default=n})),ma=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),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})),_n=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=se(),r=(e=pa())&&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})),gi=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(ha()),n=a(fa()),r=a(ma()),i=se();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})),vi=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(ha()),n=a(fa()),r=a(ma()),i=se();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})),bi=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(_n()),n=i(gi()),r=i(vi());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})),An=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(ha()),n=o(fa()),r=o(ma()),i=o(bi()),a=o(_n());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})),Ie=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),n=i(pa()),r=i(An());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})),Oe=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),n=i(pa()),r=i(An());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})),Re=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t*Math.PI/180};t.default=e})),gt=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return 180*t/Math.PI};t.default=e})),Qo=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ie()),n=o(Oe()),r=o(Re()),i=o(gt()),a=se();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),g=Math.asin(Math.sin(f)*Math.cos(c)+Math.cos(f)*Math.sin(c)*Math.cos(d)),y=p+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(g)),m=(0,i.default)(y);return(m<a.MINLON||m>a.MAXLON)&&(y=(y+3*Math.PI)%(2*Math.PI)-Math.PI,m=(0,i.default)(y)),{latitude:(0,i.default)(g),longitude:m}};t.default=s})),es=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),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})),ts=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),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})),as=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),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})),is=B((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}g(),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})),_i=B((t=>{g(),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})),at=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ie()),n=o(Oe()),r=o(Re()),i=o(_i()),a=se();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})),Ti=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=at())&&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})),ls=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ti())&&e.__esModule?e:{default:e};var r=function(t,e){return(0,n.default)(t,e)[0]};t.default=r})),ps=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Re()),n=a(Ie()),r=a(Oe()),i=se();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})),zi=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Ie()),n=r(Oe());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})),fs=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ie()),n=o(Oe()),r=o(Re()),i=o(gt()),a=se();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,g=c+f,y=(0,r.default)(a.MAXLAT),m=(0,r.default)(a.MINLAT),v=(0,r.default)(a.MAXLON),_=(0,r.default)(a.MINLON);if(p>m&&g<y){var w=Math.asin(Math.sin(f)/Math.cos(c));(s=d-w)<_&&(s+=2*Math.PI),(l=d+w)>v&&(l-=2*Math.PI)}else p=Math.max(p,m),g=Math.min(g,y),s=_,l=v;return[{latitude:(0,i.default)(p),longitude:(0,i.default)(s)},{latitude:(0,i.default)(g),longitude:(0,i.default)(l)}]};t.default=s})),ys=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ie()),n=a(Oe()),r=a(Re()),i=a(gt());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})),vs=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=zi())&&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})),Ai=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ie()),n=a(Oe()),r=a(Re()),i=a(gt());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})),ws=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ai())&&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})),Ei=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(at()),n=r(_i());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})),Is=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ie()),n=a(Oe()),r=a(Re()),i=a(gt());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})),Os=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=at())&&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})),Es=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ie()),n=a(Oe()),r=a(Re()),i=se();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),g=(0,n.default)(t),y=(0,e.default)(a),m=(0,n.default)(a),v=6356752.314245,_=1/298.257223563,w=(0,r.default)(m-g),b=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(p)))),M=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(y)))),x=Math.sin(b),O=Math.cos(b),E=Math.sin(M),T=Math.cos(M),k=w,I=100;do{var A=Math.sin(k),S=Math.cos(k);if(0===(d=Math.sqrt(T*A*(T*A)+(O*E-x*T*S)*(O*E-x*T*S))))return 0;s=x*E+O*T*S,l=Math.atan2(d,s),c=s-2*x*E/(h=1-(u=O*T*A/d)*u),isNaN(c)&&(c=0);var N=_/16*h*(4+_*(4-3*h));f=k,k=w+(1-N)*_*u*(l+N*d*(c+N*s*(2*c*c-1)))}while(Math.abs(k-f)>1e-12&&--I>0);if(0===I)return NaN;var F=h*(i.earthRadius*i.earthRadius-v*v)/(v*v),R=1+F/16384*(4096+F*(F*(320-175*F)-768)),B=F/1024*(256+F*(F*(74-47*F)-128)),P=B*d*(c+B/4*(s*(2*c*c-1)-B/6*c*(4*d*d-3)*(4*c*c-3))),C=v*R*(l-P);return Math.round(C/o)*o};t.default=o})),Ss=B((t=>{g(),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})),Ps=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=at())&&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})),Fs=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=at())&&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})),Ls=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Ie()),n=r(Oe());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})),Rs=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ei())&&e.__esModule?e:{default:e};var r=function(t,e,r,i){return(0,n.default)(t,e,r)<i};t.default=r})),Cs=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=at())&&e.__esModule?e:{default:e};var r=function(t,e,r){return(0,n.default)(t,e)<r};t.default=r})),qs=B((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}g(),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})),Us=B((t=>{g(),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 f.default}}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:function(){return m.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 b.default}}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"toRad",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:function(){return W.default}});var n=$(Qo()),r=$(es()),i=$(ts()),a=$(as()),o=$(is()),s=$(ls()),l=$(ps()),u=$(zi()),h=$(fs()),c=$(ys()),d=$(vs()),f=$(ws()),p=$(pa()),y=$(_n()),m=$(at()),v=$(Ei()),_=$(Is()),w=$(Ie()),b=$(Oe()),M=$(Os()),x=$(Es()),O=$(Ai()),E=$(Ss()),T=$(Ps()),k=$(ha()),I=$(Fs()),A=$(Ls()),S=$(Rs()),N=$(Cs()),F=$(fa()),R=$(bi()),B=$(gi()),P=$(vi()),C=$(Ti()),j=$(ma()),D=$(An()),L=$(Re()),z=$(gt()),W=$(qs()),U=se();function $(t){return t&&t.__esModule?t:{default:t}}Object.keys(U).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return U[n]}})}))})),Tu=B(((t,e)=>{g(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),Nu=B(((t,e)=>{g();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)}}})),Su=B(((t,e)=>{g(),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)]}})),Fu=B(((t,e)=>{g(),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}})),Uu=B((t=>{g();var e=Tu(),n=Nu(),r=Su(),i=Fu(),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 f(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=f,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:f(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)}})),Yu=B(((t,e)=>{g();var n,r="undefined"!=typeof self?self:t,i=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();n=i,function(t){var e="URLSearchParams"in n,r="Symbol"in n&&"iterator"in Symbol,i="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(t){return!1}}(),a="FormData"in n,o="ArrayBuffer"in n;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function c(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function g(t){var e=new FileReader,n=p(e);return e.readAsArrayBuffer(t),n}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&i&&function(t){return t&&DataView.prototype.isPrototypeOf(t)}(t)?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,n=p(e);return e.readAsText(t),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=u(t),e=h(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},d.prototype.delete=function(t){delete this.map[u(t)]},d.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},d.prototype.set=function(t,e){this.map[u(t)]=h(e)},d.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},d.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),c(t)},d.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),c(t)},d.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),c(t)},r&&(d.prototype[Symbol.iterator]=d.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function _(t,e){var n=(e=e||{}).body;if(t instanceof _){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!n&&null!=t._bodyInit&&(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new d(e.headers)),this.method=function(t){var e=t.toUpperCase();return v.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function b(t){var e=new d;return t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}})),e}function M(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},m.call(_.prototype),m.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},M.error=function(){var t=new M(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];M.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new M(null,{status:e,headers:{location:t}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function O(e,n){return new Promise((function(r,a){var o=new _(e,n);if(o.signal&&o.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var t={status:s.status,statusText:s.statusText,headers:b(s.getAllResponseHeaders()||"")};t.url="responseURL"in s?s.responseURL:t.headers.get("X-Request-URL");var e="response"in s?s.response:s.responseText;r(new M(e,t))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),o.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",l)}),s.send(void 0===o._bodyInit?null:o._bodyInit)}))}O.polyfill=!0,n.fetch||(n.fetch=O,n.Headers=d,n.Request=_,n.Response=M),t.Headers=d,t.Request=_,t.Response=M,t.fetch=O,Object.defineProperty(t,"__esModule",{value:!0})}({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var a=i;(t=a.fetch).default=a.fetch,t.fetch=a.fetch,t.Headers=a.Headers,t.Request=a.Request,t.Response=a.Response,e.exports=t})),Kl={};function wo(t,e){return!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,t}function Fl(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[ra],(function(t){return ht(fn(t.data[0],t.data[1]))}),0,n)}function fn(t,e){return Tt(t,e||{},0,0)}function jo(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[na],(function(t){return ht(sa(t.data[0],go(t.data[1])))}),1,n)}function sa(t,e){return pn(t,e)}function Yf(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[ra,Ol,function(){return[To]}],(function(t){return ht(To(t.data[0],t.data[1]))}),2,n)}function To(t,e){e||(e={});var n=aa(),r=t.length;n.p(t);var i=Tt(t,e,bo(e),8),a=i.length;return vo(i,e),K(i,a-8,n.d()),K(i,a-4,r),i}function Ll(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[na,zl,function(){return[si]}],(function(t){return ht(si(t.data[0]))}),3,n)}function si(t,e){return pn(t.subarray(ko(t),-8),e||new H(El(t)))}function Qf(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[ra,Al,function(){return[Oo]}],(function(t){return ht(Oo(t.data[0],t.data[1]))}),4,n)}function Oo(t,e){e||(e={});var n=mo();n.p(t);var r=Tt(t,e,2,4);return Mo(r,e),K(r,r.length-4,n.d()),r}function Cl(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[na,Nl,function(){return[li]}],(function(t){return ht(li(t.data[0],go(t.data[1])))}),5,n)}function li(t,e){return pn((Sl(t),t.subarray(2,-4)),e)}function tm(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),31==t[0]&&139==t[1]&&8==t[2]?Ll(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?jo(t,e,n):Cl(t,e,n)}function am(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?si(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?sa(t,e):li(t,e)}function ft(t,e){if(e){for(var n=new H(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(ql)return ql.encode(t);var i=t.length,a=new H(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 H(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 Se(a,0,o)}function No(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(Ao)return Ao.decode(t);var i=Ul(t),a=i[0];return i[1].length&&C(8),a}function um(t,e,n){n||(n=e,e={}),"function"!=typeof n&&C(7);var r={};zo(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){ci((function(){n(t,e)}))};ci((function(){d=n}));var f=function(){var t=new H(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;ua(t,s,i,i.f,i.u,a);var h=30+i.f.length+mt(i.extra),c=s+h;t.set(i.c,c),ua(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)}}Eo(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],g=aa(),y=l.length;g.p(l);var m=ft(e),v=m.length,_=p.comment,w=_&&ft(_),b=w&&w.length,M=mt(p.extra),x=0==p.level?0:8,O=function(n,r){if(n)c(),d(n,null);else{var i=r.length;u[t]=hn(p,{size:y,crc:g.d(),c:r,f:m,m:w,u:v!=e.length||w&&_.length!=b,compression:x}),o+=30+v+M+i,s+=76+2*(v+M)+(b||0)+i,--a||f()}};if(v>65535&&O(C(11,0,1),null),x)if(y<16e4)try{O(null,fn(l,p))}catch(t){O(t,null)}else h.push(Fl(l,p,O));else O(null,l)},g=0;g<l;++g)p(g);return c}function lm(t,e){e||(e={});var n={},r=[];zo(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=(x=ft(o)).length,d=u.comment,f=d&&ft(d),p=f&&f.length,g=mt(u.extra);c>65535&&C(11);var y=h?fn(l,u):l,m=y.length,v=aa();v.p(l),r.push(hn(u,{size:l.length,crc:v.d(),c:y,f:x,m:f,u:c!=o.length||f&&d.length!=p,o:i,compression:h})),i+=30+c+g+m,a+=76+2*(c+g)+(p||0)+m}for(var _=new H(a+22),w=i,b=a-i,M=0;M<r.length;++M){var x=r[M];ua(_,x.o,x,x.f,x.u,x.c.length);var O=30+x.f.length+mt(x.extra);_.set(x.c,x.o+O),ua(_,i,x,x.f,x.u,x.c.length,x.o,x.m),i+=16+O+(x.m?x.m.length:0)}return Eo(_,i,r.length,b,w),_}function hm(t,e,n){n||(n=e,e={}),"function"!=typeof n&&C(7);var r=[],i=function(){for(var t=0;t<r.length;++t)r[t]()},a={},o=function(t,e){ci((function(){n(t,e)}))};ci((function(){o=n}));for(var s=t.length-22;101010256!=te(t,s);--s)if(!s||t.length-s>65558)return o(C(13,0,1),null),i;var l=ye(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(C(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=Hl(t,h,c),s=n[0],u=n[1],f=n[2],p=n[3],g=n[4],y=n[5],m=$l(t,y);h=g;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(m,m+u);if(u<32e4)try{v(null,sa(_,new H(f)))}catch(t){v(t,null)}else r.push(jo(_,{size:f},v))}else v(C(14,"unknown compression type "+s,1),null);else v(null,Se(t,m,m+u));else v(null,null)},p=0;p<u;++p)f()}else o(null,{});return i}function fm(t,e){for(var n={},r=t.length-22;101010256!=te(t,r);--r)(!r||t.length-r>65558)&&C(13);var i=ye(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)&&C(13),i=te(t,r+32),a=te(t,r+48));for(var s=e&&e.filter,l=0;l<i;++l){var u=Hl(t,a,o),h=u[0],c=u[1],d=u[2],f=u[3],p=u[4],g=u[5],y=$l(t,g);a=p,(!s||s({name:f,size:c,originalSize:d,compression:h}))&&(h?8==h?n[f]=sa(t.subarray(y,y+c),new H(d)):C(14,"unknown compression type "+h):n[f]=Se(t,y,y+c))}return n}lc(Kl,{AsyncCompress:()=>Jf,AsyncDecompress:()=>em,AsyncDeflate:()=>Pl,AsyncGunzip:()=>Dl,AsyncGzip:()=>Jf,AsyncInflate:()=>xo,AsyncUnzipInflate:()=>dm,AsyncUnzlib:()=>Rl,AsyncZipDeflate:()=>om,AsyncZlib:()=>Zf,Compress:()=>_o,DecodeUTF8:()=>nm,Decompress:()=>Bl,Deflate:()=>$e,EncodeUTF8:()=>rm,FlateErrorCode:()=>Xf,Gunzip:()=>oi,Gzip:()=>_o,Inflate:()=>xe,Unzip:()=>pm,UnzipInflate:()=>cm,UnzipPassThrough:()=>Xl,Unzlib:()=>ui,Zip:()=>sm,ZipDeflate:()=>im,ZipPassThrough:()=>mn,Zlib:()=>Io,compress:()=>Yf,compressSync:()=>To,decompress:()=>tm,decompressSync:()=>am,deflate:()=>Fl,deflateSync:()=>fn,gunzip:()=>Ll,gunzipSync:()=>si,gzip:()=>Yf,gzipSync:()=>To,inflate:()=>jo,inflateSync:()=>sa,strFromU8:()=>No,strToU8:()=>ft,unzip:()=>hm,unzipSync:()=>fm,unzlib:()=>Cl,unzlibSync:()=>li,zip:()=>um,zipSync:()=>lm,zlib:()=>Qf,zlibSync:()=>Oo});var hl,Wf,H,pe,Jt,Yt,Zt,ln,fl,ml,co,Qr,gl,yl,po,cn,Qe,Ne,et,Qt,X,vl,kl,bl,Ml,ei,Ee,ti,dn,Se,Xf,wl,C,pn,Ve,ea,ai,ni,ho,ta,ri,fo,xl,tt,jl,_l,aa,mo,Tt,hn,Tl,ii,Kf,Il,na,ra,Ol,zl,Al,Nl,ht,go,ia,Pe,oa,ye,te,yo,K,vo,ko,El,bo,Mo,Sl,$e,Pl,xe,xo,_o,Jf,oi,Dl,Io,Zf,ui,Rl,Bl,em,zo,ql,Ao,Gl,Ul,nm,rm,Vl,$l,Hl,Wl,mt,ua,Eo,mn,im,om,sm,Xl,cm,dm,pm,ci,Jl=Co((()=>{for(g(),hl={},Wf=function(t,e,n,r,i){var a=new Worker(hl[e]||(hl[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},H=Uint8Array,pe=Uint16Array,Jt=Uint32Array,Yt=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]),Zt=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]),ln=new H([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ml=(fl=function(t,e){for(var n=new pe(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new Jt(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]})(Yt,2),co=ml[0],Qr=ml[1],co[28]=258,Qr[258]=28,gl=fl(Zt,0),yl=gl[0],po=gl[1],cn=new pe(32768),X=0;X<32768;++X)Qe=(61680&(Qe=(52428&(Qe=(43690&X)>>>1|(21845&X)<<1))>>>2|(13107&Qe)<<2))>>>4|(3855&Qe)<<4,cn[X]=((65280&Qe)>>>8|(255&Qe)<<8)>>>1;for(Ne=function(t,e,n){for(var r=t.length,i=0,a=new pe(e);i<r;++i)t[i]&&++a[t[i]-1];var o,s=new pe(e);for(i=0;i<e;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new pe(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[cn[c]>>>l]=u}else for(o=new pe(r),i=0;i<r;++i)t[i]&&(o[i]=cn[s[t[i]-1]++]>>>15-t[i]);return o},et=new H(288),X=0;X<144;++X)et[X]=8;for(X=144;X<256;++X)et[X]=9;for(X=256;X<280;++X)et[X]=7;for(X=280;X<288;++X)et[X]=8;for(Qt=new H(32),X=0;X<32;++X)Qt[X]=5;vl=Ne(et,9,0),kl=Ne(et,9,1),bl=Ne(Qt,5,0),Ml=Ne(Qt,5,1),ei=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Ee=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},ti=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},dn=function(t){return(t+7)/8|0},Se=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?pe:4==t.BYTES_PER_ELEMENT?Jt:H)(n-e);return r.set(t.subarray(e,n)),r},Xf={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},wl=["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"],C=function(t,e,n){var r=new Error(e||wl[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,C),!n)throw r;return r},pn=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new H(0);var i=!e||n,a=!n||n.i;n||(n={}),e||(e=new H(3*r));var o=function(t){var n=e.length;if(t>n){var r=new H(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=Ee(t,l,1);var g=Ee(t,l+1,3);if(l+=3,!g){var y=t[(k=dn(l)+4)-4]|t[k-3]<<8,m=k+y;if(m>r){a&&C(0);break}i&&o(u+y),e.set(t.subarray(k,m),u),n.b=u+=y,n.p=l=8*m,n.f=s;continue}if(1==g)h=kl,c=Ml,d=9,f=5;else if(2==g){var v=Ee(t,l,31)+257,_=Ee(t,l+10,15)+4,w=v+Ee(t,l+5,31)+1;l+=14;for(var b=new H(w),M=new H(19),x=0;x<_;++x)M[ln[x]]=Ee(t,l+3*x,7);l+=3*_;var O=ei(M),E=(1<<O)-1,T=Ne(M,O,1);for(x=0;x<w;){var k,I=T[Ee(t,l,E)];if(l+=15&I,(k=I>>>4)<16)b[x++]=k;else{var A=0,S=0;for(16==k?(S=3+Ee(t,l,3),l+=2,A=b[x-1]):17==k?(S=3+Ee(t,l,7),l+=3):18==k&&(S=11+Ee(t,l,127),l+=7);S--;)b[x++]=A}}var N=b.subarray(0,v),F=b.subarray(v);d=ei(N),f=ei(F),h=Ne(N,d,1),c=Ne(F,f,1)}else C(1);if(l>p){a&&C(0);break}}i&&o(u+131072);for(var R=(1<<d)-1,B=(1<<f)-1,P=l;;P=l){var j=(A=h[ti(t,l)&R])>>>4;if((l+=15&A)>p){a&&C(0);break}if(A||C(2),j<256)e[u++]=j;else{if(256==j){P=l,h=null;break}var D=j-254;if(j>264){var L=Yt[x=j-257];D=Ee(t,l,(1<<L)-1)+co[x],l+=L}var z=c[ti(t,l)&B],W=z>>>4;z||C(3),l+=15&z;F=yl[W];if(W>3){L=Zt[W];F+=ti(t,l)&(1<<L)-1,l+=L}if(l>p){a&&C(0);break}i&&o(u+131072);for(var U=u+D;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=P,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:Se(e,0,u)},Ve=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8},ea=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},ai=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[tt,0];if(1==i){var o=new H(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 pe(d+1),p=ni(n[h-1],f,0);if(p>e){r=0;var g=0,y=p-e,m=1<<y;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;g+=m-(1<<p-f[v]),f[v]=e}for(g>>>=y;g>0;){var _=a[r].s;f[_]<e?g-=1<<e-f[_]++-1:++r}for(;r>=0&&g;--r){var w=a[r].s;f[w]==e&&(--f[w],++g)}p=e}return[new H(f),p]},ni=function(t,e,n){return-1==t.s?Math.max(ni(t.l,e,n+1),ni(t.r,e,n+1)):e[t.s]=n},ho=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new pe(++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]},ta=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},ri=function(t,e,n){var r=n.length,i=dn(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)},fo=function(t,e,n,r,i,a,o,s,l,u,h){Ve(e,h++,n),++i[256];for(var c=ai(i,15),d=c[0],f=c[1],p=ai(a,15),g=p[0],y=p[1],m=ho(d),v=m[0],_=m[1],w=ho(g),b=w[0],M=w[1],x=new pe(19),O=0;O<v.length;++O)x[31&v[O]]++;for(O=0;O<b.length;++O)x[31&b[O]]++;for(var E=ai(x,7),T=E[0],k=E[1],I=19;I>4&&!T[ln[I-1]];--I);var A,S,N,F,R=u+5<<3,B=ta(i,et)+ta(a,Qt)+o,P=ta(i,d)+ta(a,g)+o+14+3*I+ta(x,T)+(2*x[16]+3*x[17]+7*x[18]);if(R<=B&&R<=P)return ri(e,h,t.subarray(l,l+u));if(Ve(e,h,1+(P<B)),h+=2,P<B){A=Ne(d,f,0),S=d,N=Ne(g,y,0),F=g;var C=Ne(T,k,0);Ve(e,h,_-257),Ve(e,h+5,M-1),Ve(e,h+10,I-4),h+=14;for(O=0;O<I;++O)Ve(e,h+3*O,T[ln[O]]);h+=3*I;for(var j=[v,b],D=0;D<2;++D){var L=j[D];for(O=0;O<L.length;++O){var z=31&L[O];Ve(e,h,C[z]),h+=T[z],z>15&&(Ve(e,h,L[O]>>>5&127),h+=L[O]>>>12)}}}else A=vl,S=et,N=bl,F=Qt;for(O=0;O<s;++O)if(r[O]>255){z=r[O]>>>18&31;ea(e,h,A[z+257]),h+=S[z+257],z>7&&(Ve(e,h,r[O]>>>23&31),h+=Yt[z]);var W=31&r[O];ea(e,h,N[W]),h+=F[W],W>3&&(ea(e,h,r[O]>>>5&8191),h+=Zt[W])}else ea(e,h,A[r[O]]),h+=S[r[O]];return ea(e,h,A[256]),h+S[256]},xl=new Jt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),tt=new H(0),jl=function(t,e,n,r,i,a){var o=t.length,s=new H(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=ri(l,u+1,t.subarray(h,c))}else{for(var d=xl[e-1],f=d>>>13,p=8191&d,g=(1<<n)-1,y=new pe(32768),m=new pe(g+1),v=Math.ceil(n/3),_=2*v,w=function(e){return(t[e]^t[e+1]<<v^t[e+2]<<_)&g},b=new Jt(25e3),M=new pe(288),x=new pe(32),O=0,E=0,T=(h=0,0),k=0,I=0;h<o;++h){var A=w(h),S=32767&h,N=m[A];if(y[S]=N,m[A]=S,k<=h){var F=o-h;if((O>7e3||T>24576)&&F>423){u=fo(t,l,0,b,M,x,E,T,I,h-I,u),T=O=E=0,I=h;for(var R=0;R<286;++R)M[R]=0;for(R=0;R<30;++R)x[R]=0}var B=2,P=0,C=p,j=S-N&32767;if(F>2&&A==w(h-j))for(var D=Math.min(f,F)-1,L=Math.min(32767,h),z=Math.min(258,F);j<=L&&--C&&S!=N;){if(t[h+B]==t[h+B-j]){for(var W=0;W<z&&t[h+W]==t[h+W-j];++W);if(W>B){if(B=W,P=j,W>D)break;var U=Math.min(j,W-2),$=0;for(R=0;R<U;++R){var G=h-j+R+32768&32767,X=G-y[G]+32768&32767;X>$&&($=X,N=G)}}}j+=(S=N)-(N=y[S])+32768&32767}if(P){b[T++]=268435456|Qr[B]<<18|po[P];var q=31&Qr[B],K=31&po[P];E+=Yt[q]+Zt[K],++M[257+q],++x[K],k=h+B,++O}else b[T++]=t[h],++M[t[h]]}}u=fo(t,l,a,b,M,x,E,T,I,h-I,u),!a&&7&u&&(u=ri(l,u+1,tt))}return Se(s,0,r+dn(u)+i)},_l=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}(),aa=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=_l[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},mo=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}}},Tt=function(t,e,n,r,i){return jl(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)},hn=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},Tl=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]},ii=[],Kf=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},Il=function(t,e,n,r){var i;if(!ii[n]){for(var a="",o={},s=t.length-1,l=0;l<s;++l)a=(i=Tl(t[l],a,o))[0],o=i[1];ii[n]=Tl(t[s],a,o)}var u=hn({},ii[n][1]);return Wf(ii[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,Kf(u),r)},na=function(){return[H,pe,Jt,Yt,Zt,ln,co,yl,kl,Ml,cn,wl,Ne,ei,Ee,ti,dn,Se,C,pn,sa,ht,go]},ra=function(){return[H,pe,Jt,Yt,Zt,ln,Qr,po,vl,et,bl,Qt,cn,xl,tt,Ne,Ve,ea,ai,ni,ho,ta,ri,fo,dn,Se,jl,Tt,fn,ht]},Ol=function(){return[vo,bo,K,aa,_l]},zl=function(){return[ko,El]},Al=function(){return[Mo,K,mo]},Nl=function(){return[Sl]},ht=function(t){return postMessage(t,[t.buffer])},go=function(t){return t&&t.size&&new H(t.size)},ia=function(t,e,n,r,i,a){var o=Il(n,r,i,(function(t,e){o.terminate(),a(t,e)}));return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Pe=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])}},oa=function(t,e,n,r,i){var a,o=Il(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||C(5),a&&e.ondata(C(4,0,1),null,!!n),o.postMessage([t,a=n],[t.buffer])},e.terminate=function(){o.terminate()}},ye=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},yo=function(t,e){return te(t,e)+4294967296*te(t,e+4)},K=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},vo=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&&K(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)}},ko=function(t){(31!=t[0]||139!=t[1]||8!=t[2])&&C(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)},El=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},bo=function(t){return 10+(t.filename&&t.filename.length+1||0)},Mo=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)},Sl=function(t){(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&C(6,"invalid zlib data"),32&t[1]&&C(6,"invalid zlib data: preset dictionaries not supported")},$e=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(Tt(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){this.ondata||C(5),this.d&&C(4),this.d=e,this.p(t,e||!1)},t}(),Pl=function(t,e){oa([ra,function(){return[Pe,$e]}],this,wo.call(this,t,e),(function(t){var e=new $e(t.data);onmessage=Pe(e)}),6)},xe=function(){function t(t){this.s={},this.p=new H(0),this.ondata=t}return t.prototype.e=function(t){this.ondata||C(5),this.d&&C(4);var e=this.p.length,n=new H(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=pn(this.p,this.o,this.s);this.ondata(Se(n,e,this.s.b),this.d),this.o=Se(n,this.s.b-32768),this.s.b=this.o.length,this.p=Se(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),xo=function(t){this.ondata=t,oa([na,function(){return[Pe,xe]}],this,0,(function(){var t=new xe;onmessage=Pe(t)}),7)},_o=function(){function t(t,e){this.c=aa(),this.l=0,this.v=1,$e.call(this,t,e)}return t.prototype.push=function(t,e){$e.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=Tt(t,this.o,this.v&&bo(this.o),e&&8,!e);this.v&&(vo(n,this.o),this.v=0),e&&(K(n,n.length-8,this.c.d()),K(n,n.length-4,this.l)),this.ondata(n,e)},t}(),Jf=function(t,e){oa([ra,Ol,function(){return[Pe,$e,_o]}],this,wo.call(this,t,e),(function(t){var e=new _o(t.data);onmessage=Pe(e)}),8)},oi=function(){function t(t){this.v=1,xe.call(this,t)}return t.prototype.push=function(t,e){if(xe.prototype.e.call(this,t),this.v){var n=this.p.length>3?ko(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}e&&(this.p.length<8&&C(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),xe.prototype.c.call(this,e)},t}(),Dl=function(t){this.ondata=t,oa([na,zl,function(){return[Pe,xe,oi]}],this,0,(function(){var t=new oi;onmessage=Pe(t)}),9)},Io=function(){function t(t,e){this.c=mo(),this.v=1,$e.call(this,t,e)}return t.prototype.push=function(t,e){$e.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=Tt(t,this.o,this.v&&2,e&&4,!e);this.v&&(Mo(n,this.o),this.v=0),e&&K(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),Zf=function(t,e){oa([ra,Al,function(){return[Pe,$e,Io]}],this,wo.call(this,t,e),(function(t){var e=new Io(t.data);onmessage=Pe(e)}),10)},ui=function(){function t(t){this.v=1,xe.call(this,t)}return t.prototype.push=function(t,e){if(xe.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&&C(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),xe.prototype.c.call(this,e)},t}(),Rl=function(t){this.ondata=t,oa([na,Nl,function(){return[Pe,xe,ui]}],this,0,(function(){var t=new ui;onmessage=Pe(t)}),11)},Bl=function(){function t(t){this.G=oi,this.I=xe,this.Z=ui,this.ondata=t}return t.prototype.push=function(t,e){if(this.ondata||C(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new H(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}(),em=function(){function t(t){this.G=Dl,this.I=xo,this.Z=Rl,this.ondata=t}return t.prototype.push=function(t,e){Bl.prototype.push.call(this,t,e)},t}(),zo=function(t,e,n,r){for(var i in t){var a=t[i],o=e+i,s=r;Array.isArray(a)&&(s=hn(r,a[1]),a=a[0]),a instanceof H?n[o]=[a,s]:(n[o+="/"]=[new H(0),s],zo(a,o,n,r))}},ql="undefined"!=typeof TextEncoder&&new TextEncoder,Ao="undefined"!=typeof TextDecoder&&new TextDecoder,Gl=0;try{Ao.decode(tt,{stream:!0}),Gl=1}catch(t){}Ul=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,Se(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)}},nm=function(){function t(t){this.ondata=t,Gl?this.t=new TextDecoder:this.p=tt}return t.prototype.push=function(t,e){if(this.ondata||C(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&C(8),this.t=null));this.p||C(4);var n=new H(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=Ul(n),i=r[0],a=r[1];e?(a.length&&C(8),this.p=null):this.p=a,this.ondata(i,e)},t}(),rm=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||C(5),this.d&&C(4),this.ondata(ft(t),this.d=e||!1)},t}(),Vl=function(t){return 1==t?3:t<6?2:9==t?1:0},$l=function(t,e){return e+30+ye(t,e+26)+ye(t,e+28)},Hl=function(t,e,n){var r=ye(t,e+28),i=No(t.subarray(e+46,e+46+r),!(2048&ye(t,e+8))),a=e+46+r,o=te(t,e+20),s=n&&4294967295==o?Wl(t,a):[o,te(t,e+24),te(t,e+42)],l=s[0],u=s[1],h=s[2];return[ye(t,e+10),l,u,i,a+ye(t,e+30)+ye(t,e+32),h]},Wl=function(t,e){for(;1!=ye(t,e);e+=4+ye(t,e+2));return[yo(t,e+12),yo(t,e+4),yo(t,e+20)]},mt=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&C(9),e+=r+4}return e},ua=function(t,e,n,r,i,a,o,s){var l=r.length,u=n.extra,h=s&&s.length,c=mt(u);K(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)&&C(10),K(t,e,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),e+=4,null!=a&&(K(t,e,n.crc),K(t,e+4,a),K(t,e+8,n.size)),K(t,e+12,l),K(t,e+14,c),e+=16,null!=o&&(K(t,e,h),K(t,e+6,n.attrs),K(t,e+10,o),e+=14),t.set(r,e),e+=l,c)for(var p in u){var g=u[p],y=g.length;K(t,e,+p),K(t,e+2,y),t.set(g,e+4),e+=4+y}return h&&(t.set(s,e),e+=h),e},Eo=function(t,e,n,r,i){K(t,e,101010256),K(t,e+8,n),K(t,e+10,n),K(t,e+12,r),K(t,e+16,i)},mn=function(){function t(t){this.filename=t,this.c=aa(),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||C(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),im=function(){function t(t,e){var n=this;e||(e={}),mn.call(this,t),this.d=new $e(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=Vl(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){mn.prototype.push.call(this,t,e)},t}(),om=function(){function t(t,e){var n=this;e||(e={}),mn.call(this,t),this.d=new Pl(e,(function(t,e,r){n.ondata(t,e,r)})),this.compression=8,this.flag=Vl(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){mn.prototype.push.call(this,t,e)},t}(),sm=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||C(5),2&this.d)this.ondata(C(4+8*(1&this.d),0,1),null,!1);else{var n=ft(t.filename),r=n.length,i=t.comment,a=i&&ft(i),o=r!=t.filename.length||a&&i.length!=a.length,s=r+mt(t.extra)+30;r>65535&&this.ondata(C(11,0,1),null,!1);var l=new H(s);ua(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=hn(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 H(16);K(a,0,134695760),K(a,4,t.crc),K(a,8,p),K(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(C(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+mt(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];ua(a,t,l,l.f,l.u,l.c,e,l.o),t+=46+l.f.length+mt(l.extra)+(l.o?l.o.length:0),e+=l.b}Eo(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}(),Xl=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),cm=function(){function t(){var t=this;this.i=new xe((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}(),dm=function(){function t(t,e){var n=this;e<32e4?this.i=new xe((function(t,e){n.ondata(null,t,e)})):(this.i=new xo((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=Se(t,0)),this.i.push(t,e)},t.compression=8,t}(),pm=function(){function t(t){this.onfile=t,this.k=[],this.o={0:Xl},this.p=tt}return t.prototype.push=function(t,e){var n=this;if(this.onfile||C(5),this.p||C(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 H(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=ye(l,o+6),i=ye(l,o+8),c=2048&r,d=8&r,p=ye(l,o+26),g=ye(l,o+28);if(u>o+30+p+g){var y=[];f.k.unshift(y),a=2;var m=te(l,o+18),v=te(l,o+22),_=No(l.subarray(o+30,o+=30+p),!c);4294967295==m?(t=d?[-2]:Wl(l,o),m=t[0],v=t[1]):d&&(m=-1),o+=g,f.c=m;var w,b={name:_,compression:i,start:function(){if(b.ondata||C(5),m){var t=n.o[i];t||b.ondata(C(14,"unknown compression type "+i,1),null,!1),(w=m<0?new t(_):new t(_,m,v)).ondata=function(t,e,n){b.ondata(t,e,n)};for(var e=0,r=y;e<r.length;e++){var a=r[e];w.push(a,!1)}n.k[0]==y&&n.c?n.d=w:w.push(tt,!0)}else b.ondata(null,tt,!0)},terminate:function(){w&&w.terminate&&w.terminate()}};m>=0&&(b.size=m,b.originalSize=v),f.onfile(b)}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=tt,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&&C(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}(),ci="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()}}));g();var Yl=vn(Go());g(),g(),g();var $s=vn(Us());g();var Vs=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:r=0,distance:i=0,angle:a=0}){let o,s;if(p(this,"origin"),p(this,"destination"),p(this,"vortex"),p(this,"distance"),p(this,"angle"),p(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")}},kr=Vs;function Uh(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,$s.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 console.error(t),1}}function Vh(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,be,nt,Hs=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:r=!1}){p(this,"edges"),p(this,"nodesById"),p(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:Uh(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 kr({angle:Vh(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 kr({destination:e,elevationDelta:o,origin:n,vortex:t})),this.edges[e.id].push(new kr({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)}},Di=Hs;function $h(t){switch(t){case nt.DOWN:case nt.UP:return`${t} `;default:return""}}g(),g(),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"}(be||(be={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(nt||(nt={}));var br,Ws=class{constructor({origin:t,action:e,distance:n,atLocation:r,instruction:i}){p(this,"node"),p(this,"instruction"),p(this,"action"),p(this,"atLocation"),p(this,"type"),p(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} ${$h(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===be.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===be.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===be.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===be.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===be.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===ae.TURN&&r&&(this.instruction+=` at ${r.name}`))}},rt=Ws;(br||(br={})).NO_VALID_PATH="No Valid Path Available";var Mr=.1*Math.PI;function wr(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var Xs=class{constructor({locations:t,nodes:e,vortexes:n,maps:r,showVortexNames:i}){p(this,"graph"),p(this,"locationsByNodeId"),this.graph=new Di({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=-wr(a.angle,e.angle);Math.abs(t)<Math.abs(s)&&(o=e,s=t)}else o=e,s=-wr(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 rt({distance:0,instruction:br.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 rt({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=nt.NONE;if(null!=t.elevation&&null!=r.elevation){let e=t.elevation-r.elevation;e>0?i=nt.DOWN:e<0&&(i=nt.UP)}l.push(new rt({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 rt({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=-wr(h.angle,e.angle),i=t.reduce(((t,n)=>{let r=-wr(e.angle,n.angle);return Math.min(t,Math.abs(r))}),Math.PI);if(Math.abs(r)>=Mr||Math.abs(i)<=Mr){let t;t=r<=-Math.PI/4?be.RIGHT:r<=-Mr?be.SLIGHTRIGHT:r<=Mr?be.STRAIGHT:r<=Math.PI/4?be.SLIGHTLEFT:be.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let r=new rt({action:{bearing:t,referencePosition:"At",type:ae.TURN},atLocation:e,distance:c,origin:n});r.type=t,l.push(r)}else l.push(new rt({action:{bearing:t,referencePosition:"At",type:ae.TURN},distance:c,origin:n}));d+=c,c=0}}}t===a.length-1&&(l.push(new rt({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}}},Li=Xs;function Ks(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return Js(this.cover(e,n),e,n,t)}function Js(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},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(!f)return t._root=p,t;for(;f.length;)if((u=e>=(a=(g+m)/2))?g=a:m=a,(h=n>=(o=(y+v)/2))?y=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=(g+m)/2))?g=a:m=a,(h=n>=(o=(y+v)/2))?y=o:v=o}while((c=h<<1|u)==(d=(l>=o)<<1|s>=a));return i[d]=f,i[c]=p,t}function Ys(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)Js(this,o[n],s[n],t[n]);return this}function Zs(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 Qs(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function eu(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 ie(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function tu(t,e,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 ie(g,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(!(!(g=l.node)||(i=l.x0)>d||(a=l.y0)>f||(o=l.x1)<h||(s=l.y1)<c))if(g.length){var y=(i+o)/2,m=(a+s)/2;p.push(new ie(g[3],y,m,o,s),new ie(g[2],i,m,y,s),new ie(g[1],y,a,o,m),new ie(g[0],i,a,y,m)),(u=(e>=m)<<1|t>=y)&&(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,g.data),_=e-+this._y.call(null,g.data),w=v*v+_*_;if(w<n){var b=Math.sqrt(n=w);h=t-b,c=e-b,d=t+b,f=e+b,r=g.data}}return r}function au(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,g=this._y0,y=this._x1,m=this._y1;if(!f)return this;if(f.length)for(;;){if((u=a>=(s=(p+y)/2))?p=s:y=s,(h=o>=(l=(g+m)/2))?g=l:m=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 nu(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function ru(){return this._root}function iu(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function ou(t){var e,n,r,i,a,o,s=[],l=this._root;for(l&&s.push(new ie(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 ie(n,u,h,a,o)),(n=l[2])&&s.push(new ie(n,r,h,u,o)),(n=l[1])&&s.push(new ie(n,u,i,a,h)),(n=l[0])&&s.push(new ie(n,r,i,u,h))}return this}function su(t){var e,n=[],r=[];for(this._root&&n.push(new ie(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 ie(a,o,s,h,c)),(a=i[1])&&n.push(new ie(a,h,s,l,c)),(a=i[2])&&n.push(new ie(a,o,c,h,u)),(a=i[3])&&n.push(new ie(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 uu(t){return t[0]}function lu(t){return arguments.length?(this._x=t,this):this._x}function cu(t){return t[1]}function du(t){return arguments.length?(this._y=t,this):this._y}function va(t,e,n){var r=new Ri(null==e?uu:e,null==n?cu:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Ri(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 pu(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g();var fe=va.prototype=Ri.prototype;fe.copy=function(){var t,e,n=new Ri(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=pu(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]=pu(e));return n},fe.add=Ks,fe.addAll=Ys,fe.cover=Zs,fe.data=Qs,fe.extent=eu,fe.find=tu,fe.remove=au,fe.removeAll=nu,fe.root=ru,fe.size=iu,fe.visit=ou,fe.visitAfter=su,fe.x=lu,fe.y=du;var Ce,ne,yt=class{constructor(t){z(this,Ce,void 0),p(this,"categories"),p(this,"locations"),p(this,"vortexes"),p(this,"maps"),p(this,"nodes"),p(this,"polygons"),p(this,"events"),p(this,"mapGroups"),p(this,"locationStates"),p(this,"locationRankings"),p(this,"rankings"),z(this,ne,{}),S(this,Ce,t)}get polygonsByMapId(){if(f(this,ne).polygonsByMapId)return f(this,ne).polygonsByMapId;let t,e={};for(let n=0,r=f(this,Ce).polygons.length;n<r;++n)t=f(this,Ce).polygons[n],e[t.map]||(e[t.map]=[]),e[t.map].push(t);return f(this,ne).polygonsByMapId=e,f(this,ne).polygonsByMapId}get nodesByMapId(){if(f(this,ne).nodesByMapId)return f(this,ne).nodesByMapId;let t,e={};for(let n=0,r=f(this,Ce).nodes.length;n<r;++n)t=f(this,Ce).nodes[n],e[t.map]||(e[t.map]=[]),e[t.map].push(t);return f(this,ne).nodesByMapId=e,f(this,ne).nodesByMapId}findNearestNodeOnMap(t,e){if(f(this,ne).nodeTreesByMap||(f(this,ne).nodeTreesByMap=new Map),!f(this,ne).nodeTreesByMap.has(t)){let e=this.nodesByMapId[t],n=va();n.x((t=>t.x)),n.y((t=>t.y)),n.addAll(e),f(this,ne).nodeTreesByMap.set(t,n)}return f(this,ne).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(f(this,ne).locationsByMapId)return f(this,ne).locationsByMapId;let t,e={};for(let n=0,r=f(this,Ce).locations.length;n<r;++n){t=f(this,Ce).locations[n];for(let n=0,r=t.polygons.length;n<r;++n)e[t.polygons[n].map]||(e[t.polygons[n].map]=[]),e[t.polygons[n].map].push(t)}return f(this,ne).locationsByMapId=e,f(this,ne).locationsByMapId}static create(t){return yt.instances.has(t)||yt.instances.set(t,new yt(t)),yt.instances.get(t)}static clear(){yt.instances.clear()}},Ci=yt;Ce=new WeakMap,ne=new WeakMap,p(Ci,"instances",new Map);var je=Ci;g(),g(),g(),g();var hu=" ",me=class{static get separator(){return hu}static set separator(t){hu=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+"°"+me.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+"°"+me.separator+a+"′"+me.separator+o+"″"}return r}static toLat(t,e,n){let r=me.toDms(me.wrap90(t),e,n);return null===r?"–":r.slice(1)+me.separator+(t<0?"S":"N")}static toLon(t,e,n){let r=me.toDms(me.wrap180(t),e,n);return null===r?"–":r+me.separator+(t<0?"W":"E")}static toBrng(t,e,n){let r=me.toDms(me.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=me.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 $=me,Z=Math.PI,R=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=$.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 R(e,n)}distanceTo(t,e=6371e3){if(t instanceof R||(t=R.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,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 R||(t=R.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 R||(t=R.parse(t));let e=t.initialBearingTo(this)+180;return $.wrap360(e)}midpointTo(t){t instanceof R||(t=R.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 R(c,d)}intermediatePointTo(t,e){if(t instanceof R||(t=R.parse(t)),this.equals(t))return new R(this.lat,this.lon);let n=this.lat.toRadians(),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),g=Math.atan2(p,Math.sqrt(d*d+f*f)),y=Math.atan2(f,d),m=g.toDegrees(),v=y.toDegrees();return new R(m,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 R(d,f)}static intersection(t,e,n,r){if(t instanceof R||(t=R.parse(t)),n instanceof R||(n=R.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(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 R(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)),g=Math.acos(Math.min(Math.max(f,-1),1)),y=Math.acos(Math.min(Math.max(p,-1),1)),m=l-(Math.sin(s-a)>0?g:2*Z-g),v=(Math.sin(s-a)>0?2*Z-y:y)-u;if(0==Math.sin(m)&&0==Math.sin(v)||Math.sin(m)*Math.sin(v)<0)return null;let _=-Math.cos(m)*Math.cos(v)+Math.sin(m)*Math.sin(v)*Math.cos(d),w=Math.atan2(Math.sin(d)*Math.sin(m)*Math.sin(v),Math.cos(v)+Math.cos(m)*_),b=Math.asin(Math.min(Math.max(Math.sin(i)*Math.cos(w)+Math.cos(i)*Math.sin(w)*Math.cos(l),-1),1)),M=a+Math.atan2(Math.sin(l)*Math.sin(w)*Math.cos(i),Math.cos(w)-Math.sin(i)*Math.sin(b)),x=b.toDegrees(),O=M.toDegrees();return new R(x,O)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof R||(t=R.parse(t)),e instanceof R||(e=R.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 R||(t=R.parse(t)),e instanceof R||(e=R.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(),g=f.toDegrees();return{lon1:$.wrap180(p),lon2:$.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof R||(t=R.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 R||(t=R.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 R(d,f)}rhumbMidpointTo(t){t instanceof R||(t=R.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 R(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 R||(t=R.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${$.toLat(this.lat,t,e)}, ${$.toLon(this.lon,t,e)}`}};g(),g(),g();var xr=class{constructor(t){p(this,"destinations",[]),this.destinations=t}};g();var ba,We,ka=class{constructor(t,e){z(this,ba,void 0),z(this,We,void 0),p(this,"distance",0),p(this,"path",[]),p(this,"instructions",[]),S(this,We,t),S(this,ba,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 p={...t,action:{...t.action},atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(r=null==(n=f(this,We))?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=f(this,We))?void 0:a._nodesById)?void 0:o[t.node.id]:void 0};return((null==(s=p.action)?void 0:s.type)===ae.TAKEVORTEX||(null==(l=p.action)?void 0:l.type)===ae.EXITVORTEX)&&(p.action.fromMap=null==(h=f(this,We)._mapsById)?void 0:h[null==(u=p.action)?void 0:u.fromMap.id],p.action.toMap=null==(d=f(this,We)._mapsById)?void 0:d[null==(c=p.action)?void 0:c.toMap.id]),p})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=f(this,We))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return f(this,ba)}};ba=new WeakMap,We=new WeakMap;var ot,it=class{constructor(t){z(this,ot,void 0),S(this,ot,t)}directionsTo(t,e){if(t instanceof xr){let n=[],r=this;for(let i=0;i<t.destinations.length;i++){let a=t.destinations[i],o=Ma(r),s=Ma(a),l=f(this,ot).navigator.getDirections({originIds:o,destinationNodeIds:s,accessible:(null==e?void 0:e.accessible)||!1}),u=new ka(f(this,ot),l);n.push(u),r=a}return n}{let n=Ma(this),r=Ma(t),i=f(this,ot).navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:(null==e?void 0:e.accessible)||!1});return new ka(f(this,ot),i)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}directionsToCallback(t,e){return this.directionsTo(t,e)}};ot=new WeakMap;var Hh=0,Wh="9999-12-31T00:00:00.000Z";function Xh(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||Hh),n=new Date(t.end||Wh);return e<r&&n>r}));return i?e.find((t=>t.value===i.type)):void 0}var Be,vt,_e,wa,xa,ja,_a=class extends it{constructor(t,e){super(t),z(this,Be,void 0),z(this,vt,void 0),z(this,_e,{}),p(this,"states"),p(this,"id",""),p(this,"name",""),p(this,"type",""),p(this,"description"),p(this,"sortOrder"),p(this,"logo"),p(this,"phone"),p(this,"social"),p(this,"color"),p(this,"shortName"),p(this,"detailsUrl"),p(this,"tags"),p(this,"externalId"),p(this,"showLabelWhenImagePresent"),p(this,"picture"),p(this,"operationHours"),p(this,"siblingGroups"),p(this,"gallery"),p(this,"categories",[]),z(this,wa,void 0),z(this,xa,[]),z(this,ja,void 0),S(this,Be,t),S(this,vt,e),Object.assign(this,e)}get polygons(){let t=f(this,_e).polygons;if(void 0!==t)return t;let e=[],n=f(this,wa),r=f(this,Be)._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 f(this,_e).polygons=e,e}set polygons(t){S(this,wa,t)}get rank(){let t=f(this,_e).rank;if(void 0!==t)return t;let e=f(this,Be).locationRankings;if(!e||!e.locations)return null;let n=e.locations.find((t=>t.ids.find((t=>t===this.id))));return n?(f(this,_e).rank=n.score,n.score):null}get nodes(){let t=f(this,_e).nodes;if(void 0!==t)return t;let e=[],n=f(this,xa),r=f(this,Be)._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 f(this,_e).nodes=e,e}set nodes(t){S(this,xa,t)}get parent(){let t=f(this,_e).parent;if(void 0!==t)return t;let e,n=f(this,Be)._locationsById,r=f(this,ja);return void 0!==r&&(e=n[r]),f(this,_e).parent=e,e}set parent(t){S(this,ja,t)}get state(){return Xh(this,f(this,Be).locationStates)}clone(){return new _a(f(this,Be),f(this,vt))}get nodeOperationHours(){let t=f(this,_e).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=f(this,vt).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return f(this,_e).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new _a(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 _a(t,e)))}catch(t){return console.error("Fetch Locations:",t),[]}}toJSON(){let t=f(this,vt);return delete t.color,t}},st=_a;Be=new WeakMap,vt=new WeakMap,_e=new WeakMap,wa=new WeakMap,xa=new WeakMap,ja=new WeakMap,g();var kt,Ta,qe,Ia,jr=class extends it{constructor(t,e){super(t),z(this,kt,void 0),z(this,Ta,void 0),z(this,qe,{}),p(this,"geometry"),p(this,"image"),p(this,"holes"),p(this,"textures"),p(this,"material"),p(this,"label"),p(this,"id",""),p(this,"map",""),p(this,"layer"),p(this,"layerId"),p(this,"name"),p(this,"externalId"),p(this,"vertexes"),p(this,"canvasBounds"),z(this,Ia,void 0),S(this,kt,t),S(this,Ta,e),Object.assign(this,e)}get locations(){let t=f(this,qe).locations;if(void 0!==t)return t;let e=[],n=je.instances.get(f(this,kt)).locationsByMapId[this.map],{id:r}=this;for(let t=0,i=n.length;t<i;++t){let i=n[t],a=i.polygons;if(Array.isArray(a))for(let t=0,n=a.length;t<n;++t)if(a[t].id===r){e.push(i);break}}return f(this,qe).locations=e,e}get entrances(){let t=f(this,qe).entrances;if(void 0!==t)return t;let e=[],n=f(this,Ia),r=f(this,kt)._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 f(this,qe).entrances=e,e}return[]}set entrances(t){S(this,Ia,t)}get rank(){let t=f(this,qe).rank;if(void 0!==t)return t;let{rankings:e}=f(this,kt);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(f(this,qe).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(f(this,qe).rank=null,null)}static hydrate(t,e){return t.map((t=>new jr(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,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await Q(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new jr(t,e)))}catch(t){return console.error("Fetch Polygons:",t),[]}}toJSON(){return f(this,Ta)}},At=jr;function fu(t){return/^[\da-f]{24}$/i.test(t)}function mu(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 Kh(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}${mu(n,null==(a=t.baseUrl)?void 0:a.includes("gateway"))}`:t.baseUrl+e+mu(n)}async function Q(t,e,n,r=!1){return Oa(t,e,n,r,!0)}async function Oa(t,e,n,r=!1,i=!1){let a=Kh(t,e,n,r),o=await _r(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 _r(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 ut()(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 gu([t,e],[n,r]){let i=new R(t,e),a=new R(n,r);return i.distanceTo(a)}function yu(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 R(n.target.x,n.target.y),a=new R(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,console.warn(n),console.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function Ma(t){var e;return t instanceof At?t.entrances.map((t=>t.id)):t instanceof st?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function vu(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=>{console.error(t)}))));await Promise.all(t)}catch(t){console.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 Bi(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)}}kt=new WeakMap,Ta=new WeakMap,qe=new WeakMap,Ia=new WeakMap;var za,Aa,Na,Tr=class{constructor(t,e){z(this,za,void 0),z(this,Aa,{}),z(this,Na,void 0),p(this,"name"),p(this,"externalId"),p(this,"parents"),p(this,"id"),p(this,"icon"),this.id=e.id,S(this,Na,e),S(this,za,t),Object.assign(this,e)}get locations(){let t=f(this,Aa).locations;if(void 0!==t)return t;let e=[],{locations:n}=f(this,za),{id:r}=this;for(let t=0,i=n.length;t<i;++t){let i=n[t],a=i.categories;if(Array.isArray(a))for(let t=0,n=a.length;t<n;++t)if(a[t]===r){e.push(i);break}}return f(this,Aa).locations=e,e}static hydrate(t,e){return t.map((t=>new Tr(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 Tr(t,e)))}catch(t){return console.error("Fetch Categories:",t),[]}}toJSON(){return f(this,Na)}},Nt=Tr;za=new WeakMap,Aa=new WeakMap,Na=new WeakMap,g();var Ea,Et,Sa,Or=class{constructor(t,e){z(this,Ea,void 0),z(this,Et,void 0),z(this,Sa,{}),p(this,"id",""),p(this,"type",""),p(this,"name",""),p(this,"description"),p(this,"image"),p(this,"startDate"),p(this,"endDate"),p(this,"showDate"),S(this,Et,e),S(this,Ea,t),Object.assign(this,e)}location(){let t=f(this,Sa).location;if(void 0!==t)return t;let e,n=f(this,Ea)._locationsById,r=f(this,Et).location;if(null!=r){let t=n[r];null!=t&&(e=t)}return f(this,Sa).location=e,e}static hydrate(t,e){return t.map((t=>new Or(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 Or(t,e)))}catch(t){return console.error("Fetch Events:",t),[]}}toJSON(){return f(this,Et)}},Ir=Or;Ea=new WeakMap,Et=new WeakMap,Sa=new WeakMap,g();var Pa,zr=class{constructor(t){z(this,Pa,void 0),p(this,"locations",[]),S(this,Pa,t),Object.assign(this,t)}static hydrate(t){return new zr(t)}static async fetch(t){try{let e=await Oa(t.options,"smart-labels/location-label-ranking",{venue:t.options.venue},!0);return new zr(e)}catch(t){return console.error("Fetch Location Rankings:",t),{}}}toJSON(){return f(this,Pa)}},qi=zr;Pa=new WeakMap,g();var Fa,Ar=class{constructor(t){z(this,Fa,void 0),p(this,"id",""),p(this,"name",""),p(this,"value",""),S(this,Fa,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Ar(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 Ar(t)))}catch(t){return console.error("Fetch Location States:",t),[]}}toJSON(){return f(this,Fa)}},Gi=Ar;Fa=new WeakMap,g(),g();var La,Ra,Da=class{constructor(t,e,n,r,i,a){p(this,"map"),p(this,"x",0),p(this,"y",0),p(this,"lat",0),p(this,"lon",0),z(this,La,{}),z(this,Ra,void 0),this.lat=t,this.lon=e,this.map="string"==typeof i?i:i.id,this.x=n,this.y=r,S(this,Ra,a)}absoluteDistanceTo(t){return gu([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=f(this,La).nearestNode;if(void 0!==t)return t;let e=je.instances.get(f(this,Ra)).findNearestNodeOnMap(this.map,this);return f(this,La).nearestNode=e,e}};La=new WeakMap,Ra=new WeakMap;var Ge,Ca,Ba,Er=class{constructor(t,e){z(this,Ge,void 0),z(this,Ca,{}),z(this,Ba,void 0),p(this,"id",""),p(this,"group",""),p(this,"name",""),p(this,"shortName",""),p(this,"elevation",0),p(this,"scale",0),p(this,"layers"),p(this,"x_scale"),p(this,"perspectiveId"),p(this,"scene"),p(this,"width",0),p(this,"height",0),p(this,"georeference",[]),p(this,"_scale",0),S(this,Ge,t),S(this,Ba,e),Object.assign(this,e),this._scale=yu(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t;return(null==(t=je.instances.get(f(this,Ge)))?void 0:t.polygonsByMapId[this.id])||[]}get locations(){var t;return(null==(t=je.instances.get(f(this,Ge)))?void 0:t.locationsByMapId[this.id])||[]}get nodes(){var t;return(null==(t=je.instances.get(f(this,Ge)))?void 0:t.nodesByMapId[this.id])||[]}get mapGroup(){let t=f(this,Ca).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&f(this,Ge)._mapGroupsById[e]||null;return f(this,Ca).mapGroup=n,n}createCoordinateByXY(t,e){let n,r=this.georeference[0],i=new R(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.getNorth(),u=n/this._scale,h=i.destinationPoint(u,180*l/Math.PI);return new Da(h.lat,h.lon,t,e,this.id,f(this,Ge))}createCoordinate(t,e){let n=this.georeference[0],r=new R(n.target.x,n.target.y),i=new R(t,e),a=r.distanceTo(i),o=(r.finalBearingTo(i)+360)%360*Math.PI/180||0,s=a*(1/this.scale),l=o+this.getNorth(),u=Math.sin(l)*s,h=Math.cos(l)*s;return new Da(t,e,n.control.x+u,n.control.y-h,this.id,f(this,Ge))}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],r=new R(e.target.x,e.target.y),i=new R(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,console.warn(e),console.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 Er(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 n=r.perspective;null!=n&&(r.perspectiveId=n.id,t.options.do2D?(e.indexOf("width")>-1&&(r.width=n.size&&n.size.width||n.width),e.indexOf("height")>-1&&(r.height=n.size&&n.size.height||n.height),e.indexOf("tiles")>-1&&(r.tiles=n.tiles),e.indexOf("original")>-1&&(r.original=n.original)):(e.indexOf("scene")>-1&&(r.scene=n.scene),n.layers?(r.layers.forEach((t=>{t.visible=!1})),n.layers.forEach(a)):r.layers.forEach((t=>{t.visible=!0})))),delete r.perspective}i[n]=new Er(t,r)}return i}catch(t){return console.error("Fetch Maps:",t),[]}}toJSON(){return f(this,Ba)}},Nr=Er;Ge=new WeakMap,Ca=new WeakMap,Ba=new WeakMap,g();var qa,St,Ga,Pr=class{constructor(t,e){z(this,qa,void 0),z(this,St,void 0),z(this,Ga,{}),p(this,"id",""),p(this,"name",""),S(this,St,e),S(this,qa,t),Object.assign(this,e)}get maps(){let t=f(this,Ga).maps;if(void 0!==t)return t;let e=[],{maps:n}=f(this,qa),{id:r}=f(this,St);for(let t=0,i=n.length;t<i;++t){let i=n[t];i.group===r&&e.push(i)}return f(this,Ga).maps=e,e}static hydrate(t,e){return t.map((t=>new Pr(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 Pr(t,e)))}catch(t){return console.error("Fetch Map Groups:",t),[]}}toJSON(){return f(this,St)}},Sr=Pr;qa=new WeakMap,St=new WeakMap,Ga=new WeakMap,g();var Xe,Ua,ge,Va,Dr=class extends it{constructor(t,e){super(t),z(this,Xe,void 0),z(this,Ua,void 0),z(this,ge,{}),p(this,"id",""),p(this,"map",""),p(this,"x",0),p(this,"y",0),p(this,"operationHours"),p(this,"externalId"),z(this,Va,void 0),S(this,Xe,t),S(this,Ua,e),Object.assign(this,e)}get lat(){var t;let e=f(this,ge).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=f(this,Xe)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return f(this,ge).cachedLatLon=n.createCoordinateByXY(this.x,this.y),f(this,ge).cachedLatLon.lat}get lon(){var t;let e=f(this,ge).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=f(this,Xe)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return f(this,ge).cachedLatLon=n.createCoordinateByXY(this.x,this.y),f(this,ge).cachedLatLon.lon}get paths(){let t=f(this,ge).paths;if(void 0!==t)return t;let e=[],n=f(this,Xe)._nodesById,r=f(this,Va);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 f(this,ge).paths=e,e}set paths(t){S(this,Va,t)}get locations(){var t;let e=f(this,ge).locations;if(void 0!==e)return e;let n=[],r=null==(t=je.instances.get(f(this,Xe)))?void 0:t.locationsByMapId[this.map],i=this.id;for(let t=0,e=r.length;t<e;++t){let e=r[t],a=e.nodes;if(Array.isArray(a))for(let t=0,r=a.length;t<r;++t)if(a[t].id===i){n.push(e);break}}return f(this,ge).locations=n,n}get polygon(){let t=f(this,ge).polygon;if(void 0!==t)return t;let e,n=je.instances.get(f(this,Xe)).polygonsByMapId[this.map],r=this.id;for(let t=0,i=n.length;t<i;++t){let i=n[t];i.entrances.map((t=>t.id)).includes(r)&&(e=i)}return f(this,ge).polygon=e,e}static hydrate(t,e){return t.map((t=>new Dr(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,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await Q(t.options,"node",n)).map((e=>new Dr(t,e)))}catch(t){return console.error("Fetch Nodes:",t),[]}}toJSON(){return f(this,Ua)}},Fr=Dr;Xe=new WeakMap,Ua=new WeakMap,ge=new WeakMap,Va=new WeakMap,g();var $a,Rr=class{constructor(t){z(this,$a,void 0),p(this,"polygons",[]),S(this,$a,t),Object.assign(this,t)}static hydrate(t){return new Rr(t)}static async fetch(t){try{let e=await Oa(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new Rr(e)}catch(t){return console.error("Fetch Rankings:",t),null}}toJSON(){return f(this,$a)}},Lr=Rr;$a=new WeakMap,g();var Ha,Cr=class{constructor(t){p(this,"id",""),z(this,Ha,void 0),S(this,Ha,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Cr(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 Cr(t)))}catch(t){return console.error("Fetch Theme:",t),[]}}toJSON(){return f(this,Ha)}},Ui=Cr;Ha=new WeakMap,g();var Wa,Xa,Pt,qr=class{constructor(t,e){z(this,Wa,void 0),z(this,Xa,void 0),z(this,Pt,{}),p(this,"defaultMap",""),p(this,"address",""),p(this,"city",""),p(this,"countrycode",""),p(this,"externalId",""),p(this,"id",""),p(this,"latitude"),p(this,"logo"),p(this,"longitude"),p(this,"metadata"),p(this,"name",""),p(this,"operationHours"),p(this,"postal",""),p(this,"slug",""),p(this,"state",""),p(this,"telephone",""),p(this,"tzid",""),p(this,"tzidOverride",""),p(this,"utcOffset",""),p(this,"website",""),S(this,Xa,t),S(this,Wa,e),Object.assign(this,e)}static hydrate(t,e){return new qr(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 qr(t,n[0])}catch(t){return console.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==f(this,Pt).isMultiBuilding){let t=f(this,Xa).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;f(this,Pt).isMultiBuilding=n}return f(this,Pt).isMultiBuilding}toJSON(){return f(this,Wa)}},Br=qr;Wa=new WeakMap,Xa=new WeakMap,Pt=new WeakMap,g();var Ka,Ur=class{constructor(t){p(this,"id",""),z(this,Ka,void 0),p(this,"name"),p(this,"type"),p(this,"weight"),p(this,"multiplier"),S(this,Ka,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Ur(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 Ur(t)))}catch(t){return console.error("Fetch Vortexes:",t),[]}}toJSON(){return f(this,Ka)}},Gr=Ur;function Jh(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 Yh(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 Zh(t){let e=[];return t.features.forEach((t=>{let n={...t.properties,icon:t.properties.picture};delete n.picture,e.push(n)})),e}function Qh(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 ef(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}Ka=new WeakMap,g();var ku=class{constructor(t){p(this,"mapExtent"),p(this,"stretchRatio"),p(this,"midLat"),p(this,"midLong"),p(this,"mapUnitRatio",1e6),p(this,"latDistance"),p(this,"longDistance"),p(this,"mapScale"),p(this,"widthInMapUnits"),p(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 R(a,i),l=new R(a,n),u=new R(e,o),h=new R(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 tf(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 bu=(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 af(t,e,n,r,i,a){let o=bu(t,n,r,i,a),s=bu(e,n,r,i,a);return o.concat(s)}function nf(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 rf(t){let e=[];return t.features.forEach((t=>{let n={...t.properties};e.push(n)})),e}function Mu(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=Qh(e),i=new ku(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]=af(d,o,a,p,f,i);let g=t.node.get(n);h.push(...tf(g,i))}));let d=Object.values(u).flat(),f=nf(e),p=n.map((t=>{let e=t.features[0].properties.id,n=c.get(e);return ef(t,u[e],n)})).flat(),g=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{g.set(t.properties.id,t.properties.entrances)}))}));let y=rf(r),m=Jh(o,g),v=Zh(i),_=Yh(o),w=t.manifest.features[0].properties.name,b=t.manifest.features[0].geometry.coordinates[0],M=t.manifest.features[0].geometry.coordinates[1],x=t.imageBinaries;return{locations:m,categories:v,nodes:h,maps:p,polygons:d,vortexes:f,mapGroups:y,locationStates:_,themes:[],venue:{name:w,latitude:M,longitude:b},imageBinaries:x}}g(),g(),g();var Mt,wt,Vi=[0,4,6,8,10],bt=()=>{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],Vi.map(((t,e)=>n.slice(t,e===Vi.length-1?void 0:Vi[e+1]).join(""))).join("-")};function wu(t){return/^[\da-f]{24}$/i.test(t)}function xu(){if(!Mt)try{let t="mi-uuid";(Mt=localStorage.getItem(t))||(Mt=bt(),localStorage.setItem(t,Mt))}catch(t){Mt="NLS-"+bt()}return Mt}function ju(){if(!wt)try{let t="mi-session";(wt=sessionStorage.getItem(t))||(wt=bt(),sessionStorage.setItem(t,wt))}catch(t){wt="NSS-"+bt()}return wt}var Hu,Wu,Ja,Ft,Dt,Ya,Lt,Rt,Ct,xt,Za,Bt,qt,Qa,Vu=vn(Uu()),mf=null==(Wu=null==(Hu=I)?void 0:Hu.env)?void 0:Wu.npm_package_version,$u=["websdk","web","webv2"],Xi=class{constructor(t){var e;z(this,Ja,void 0),z(this,Ft,void 0),z(this,Dt,void 0),z(this,Ya,void 0),z(this,Lt,void 0),z(this,Rt,void 0),z(this,Ct,void 0),z(this,xt,void 0),z(this,Za,void 0),z(this,Bt,void 0),z(this,qt,void 0),z(this,Qa,void 0),S(this,xt,t.clientId),S(this,Za,t.clientSecret),S(this,Bt,t.accessToken),S(this,Ct,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!f(this,Ct)&&f(this,xt)&&!wu(f(this,xt))&&(n="https://web-proxy.mappedin.com/a/"),S(this,Dt,n),S(this,Dt,f(this,Dt)+(t.venue+"/")),S(this,Ft,!1),S(this,Ja,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),S(this,Ya,$u.find((e=>e===t.context))||$u[0]),S(this,Lt,xu()),S(this,Rt,ju()),S(this,qt,new Set),S(this,Qa,t.platformString||"")}track(t,e){if(f(this,Ja))return;let n={...e,g:f(this,Ft)},r=f(this,Dt)+t+"?"+Vu.default.stringify(n),i={"mi-context":f(this,Ya),"mi-session":f(this,Rt),"mi-device":f(this,Lt),"mappedin-sdk-version":mf,"mappedin-platform-version":f(this,Qa)};f(this,Bt)?i.Authorization=`Bearer ${f(this,Bt)}`:f(this,Ct)||(i.Authorization=`Basic ${btoa(`${f(this,xt)}:${f(this,Za)}`)}`),ut()(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,end:e,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return f(this,Rt)}getDeviceID(){return f(this,Lt)}setGeolocationMode(t){S(this,Ft,t)}trackBlueDotEvent(t){t&&Object.values(Xi.BLUEDOT_EVENT).includes(t)&&!f(this,qt).has(t)?(this.track(t),f(this,qt).add(t)):console.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)}},Wi=Xi;Ja=new WeakMap,Ft=new WeakMap,Dt=new WeakMap,Ya=new WeakMap,Lt=new WeakMap,Rt=new WeakMap,Ct=new WeakMap,xt=new WeakMap,Za=new WeakMap,Bt=new WeakMap,qt=new WeakMap,Qa=new WeakMap,p(Wi,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var Ji,Vr=Wi,Ki={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,do2D:!1,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"}(Ji||(Ji={}));var lt,Vt,Gt={categories:Nt,locations:st,vortexes:Gr,maps:Nr,nodes:Fr,polygons:At,venue:Br,events:Ir,mapGroups:Sr,themes:Ui,locationStates:Gi,locationRankings:qi,rankings:Lr},Ut=class{constructor(t){p(this,"perspective"),p(this,"things"),p(this,"options"),z(this,lt,void 0),z(this,Vt,""),p(this,"updatedAt"),p(this,"categories",[]),p(this,"locations",[]),p(this,"vortexes",[]),p(this,"maps",[]),p(this,"nodes",[]),p(this,"polygons",[]),p(this,"venue",{}),p(this,"events",[]),p(this,"mapGroups",[]),p(this,"themes",[]),p(this,"locationStates",[]),p(this,"locationRankings",[]),p(this,"rankings"),p(this,"_categoriesById"),p(this,"_locationsById"),p(this,"_vortexesById"),p(this,"_mapsById"),p(this,"_nodesById"),p(this,"_polygonsById"),p(this,"_eventsById"),p(this,"_mapGroupsById"),p(this,"_locationStatesById"),p(this,"_locationRankingsById"),p(this,"_rankingsById"),p(this,"_categoriesByExternalId"),p(this,"_locationsByExternalId"),p(this,"_vortexesByExternalId"),p(this,"_mapsByExternalId"),p(this,"_nodesByExternalId"),p(this,"_polygonsByExternalId"),p(this,"_eventsByExternalId"),p(this,"_mapGroupsByExternalId"),p(this,"_locationStatesByExternalId"),p(this,"_locationRankingsByExternalId"),p(this,"_rankingsByExternalId"),p(this,"images"),p(this,"imageBinaries"),p(this,"scenes"),p(this,"analytics"),p(this,"navigator"),this.options=t,S(this,lt,je.create(this)),this.analytics=new Vr(t)}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=f(this,lt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),f(this,lt)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=f(this,lt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),f(this,lt)[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=Mu(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{S(this,Vt,t),n=JSON.parse(t)}catch(t){return void console.error("Unable to parse JSON",t)}else n=t,S(this,Vt,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!=Gt[e]&&"function"==typeof Gt[e].hydrate&&(this[e]=Gt[e].hydrate(i,this))}e&&await vu(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"]),fu(this.options.clientId)||(this.options.things.rankings&&delete this.options.things.rankings,this.options.things.locationRankings&&delete this.options.things.locationRankings);let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,r=n.length;t<r;++t){let r=n[t];Gt[r]&&e.push(Gt[r].fetch(this).then((t=>(this[r]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new Li({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 Gt)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 f(this,Vt)||JSON.stringify(this.toJSON())}};lt=new WeakMap,Vt=new WeakMap,g();var Xu={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"],locationRankings:[]},Zl=vn(Yu());g(),g();var re=function(){return re=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},re.apply(this,arguments)};function W(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 ue(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 en,gf="ENTRIES",Zu="KEYS",Qu="VALUES",le="",Yi=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=Ht(this._path),e=t.node,n=t.keys;if(Ht(n)===le)return{done:!1,value:this.result()};var r=e.get(Ht(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=Ht(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 Ht(e)})).filter((function(t){return t!==le})).join("")},t.prototype.value=function(){return Ht(this._path).node.get(le)},t.prototype.result=function(){switch(this._type){case Qu:return this.value();case Zu:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),Ht=function(t){return t[t.length-1]},yf=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 el(t,e,n,r,o,1,i,""),r},el=function(t,e,n,r,i,a,o,s){var l,u,h=a*o;try{t:for(var c=W(t.keys()),d=c.next();!d.done;d=c.next()){var f=d.value;if(f===le){var p=i[h-1];p<=n&&r.set(s,[t.get(f),p])}else{for(var g=a,y=0;y<f.length;++y,++g){for(var m=f[y],v=o*g,_=v-o,w=i[v],b=Math.max(0,g-n-1),M=Math.min(o-1,g+n),x=b;x<M;++x){var O=m!==e[x],E=i[_+x]+ +O,T=i[_+x+1]+1,k=i[v+x]+1,I=i[v+x+1]=Math.min(E,T,k);I<w&&(w=I)}if(w>n)continue t}el(t.get(f),e,n,r,i,g,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}}},Zi=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=ue(Hr(this._tree,e.slice(this._prefix.length)),2),a=i[0],o=i[1];if(void 0===a){var s=ue(to(o),2),l=s[0],u=s[1];try{for(var h=W(l.keys()),c=h.next();!c.done;c=h.next()){var d=c.value;if(d!==le&&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,vf(this._tree,t)},t.prototype.entries=function(){return new Yi(this,gf)},t.prototype.forEach=function(t){var e,n;try{for(var r=W(this),i=r.next();!i.done;i=r.next()){var a=ue(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 yf(this._tree,t,e)},t.prototype.get=function(t){var e=Qi(this._tree,t);return void 0!==e?e.get(le):void 0},t.prototype.has=function(t){var e=Qi(this._tree,t);return void 0!==e&&e.has(le)},t.prototype.keys=function(){return new Yi(this,Zu)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,eo(this._tree,t).set(le,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=eo(this._tree,t);return n.set(le,e(n.get(le))),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=eo(this._tree,t),r=n.get(le);return void 0===r&&n.set(le,r=e()),r},t.prototype.values=function(){return new Yi(this,Qu)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(e){var n,r,i=new t;try{for(var a=W(e),o=a.next();!o.done;o=a.next()){var s=ue(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}(),Hr=function(t,e,n){var r,i;if(void 0===n&&(n=[]),0===e.length||null==t)return[t,n];try{for(var a=W(t.keys()),o=a.next();!o.done;o=a.next()){var s=o.value;if(s!==le&&e.startsWith(s))return n.push([t,s]),Hr(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]),Hr(void 0,"",n)},Qi=function(t,e){var n,r;if(0===e.length||null==t)return t;try{for(var i=W(t.keys()),a=i.next();!a.done;a=i.next()){var o=a.value;if(o!==le&&e.startsWith(o))return Qi(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}}},eo=function(t,e){var n,r,i=e.length;t:for(var a=0;t&&a<i;){try{for(var o=(n=void 0,W(t.keys())),s=o.next();!s.done;s=o.next()){var l=s.value;if(l!==le&&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},vf=function(t,e){var n=ue(Hr(t,e),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(le),0===r.size)tl(i);else if(1===r.size){var a=ue(r.entries().next().value,2),o=a[0],s=a[1];al(i,o,s)}},tl=function(t){if(0!==t.length){var e=ue(to(t),2),n=e[0],r=e[1];if(n.delete(r),0===n.size)tl(t.slice(0,-1));else if(1===n.size){var i=ue(n.entries().next().value,2),a=i[0],o=i[1];a!==le&&al(t.slice(0,-1),a,o)}}},al=function(t,e,n){if(0!==t.length){var r=ue(to(t),2),i=r[0],a=r[1];i.set(a+e,n),i.delete(a)}},to=function(t){return t[t.length-1]},ao="or",kf="and",bf="and_not",jt=function(){function t(t){if(null==(null==t?void 0:t.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=re(re(re({},ro),t),{searchOptions:re(re({},il),t.searchOptions||{})}),this._index=new Zi,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=W(u),p=f.next();!p.done;p=f.next()){var g=p.value,y=o(t,g);if(null!=y){var m=s(y.toString(),g),v=this._fieldIds[g],_=new Set(m).size;this.addFieldLength(d,v,this._documentCount-1,_);try{for(var w=(r=void 0,W(m)),b=w.next();!b.done;b=w.next()){var M=l(b.value,g);M&&this.addTerm(v,d,M)}}catch(t){r={error:t}}finally{try{b&&!b.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=W(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=W(this._documentIds),g=p.next();!g.done;g=p.next()){var y=ue(g.value,2),m=y[0];if(f===y[1]){try{for(var v=(r=void 0,W(c)),_=v.next();!_.done;_=v.next()){var w=_.value,b=h(t,w);if(null!=b){var M=l(b.toString(),w),x=this._fieldIds[w],O=new Set(M).size;this.removeFieldLength(m,x,this._documentCount,O);try{for(var E=(a=void 0,W(M)),T=E.next();!T.done;T=E.next()){var k=u(T.value,w);k&&this.removeTerm(x,m,k)}}catch(t){a={error:t}}finally{try{T&&!T.done&&(o=E.return)&&o.call(E)}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(m),this._documentIds.delete(m),this._fieldLength.delete(m),void(this._documentCount-=1)}}}catch(t){e={error:t}}finally{try{g&&!g.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=W(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 Zi,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=W(i),s=o.next();!s.done;s=o.next()){var l=ue(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==e.filter||e.filter(g))&&a.push(g)}}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(sl),a},t.prototype.autoSuggest=function(t,e){var n,r,i,a;void 0===e&&(e={}),e=re(re({},_f),e);var o=new Map;try{for(var s=W(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!=(y=o.get(c))?(y.score+=h,y.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=W(o),p=f.next();!p.done;p=f.next()){var g=ue(p.value,2),y=g[0],m=g[1],v=(h=m.score,m.terms),_=m.count;d.push({suggestion:y,terms:v,score:h/_})}}catch(t){i={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return d.sort(sl),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(ro.hasOwnProperty(t))return no(ro,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,g=e.serializationVersion;if(1!==g&&2!==g)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var y=new t(n);y._documentCount=l,y._nextId=u,y._documentIds=Wr(h),y._fieldIds=c,y._fieldLength=Wr(d),y._avgFieldLength=f,y._storedFields=Wr(p),y._index=new Zi;try{for(var m=W(s),v=m.next();!v.done;v=m.next()){var _=ue(v.value,2),w=_[0],b=_[1],M=new Map;try{for(var x=(a=void 0,W(Object.keys(b))),O=x.next();!O.done;O=x.next()){var E=O.value,T=b[E];1===g&&(T=T.ds),M.set(parseInt(E,10),Wr(T))}}catch(t){a={error:t}}finally{try{O&&!O.done&&(o=x.return)&&o.call(x)}finally{if(a)throw a.error}}y._index.set(w,M)}}catch(t){r={error:t}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}return y},t.prototype.executeQuery=function(t,e){var n=this;if(void 0===e&&(e={}),"string"!=typeof t){var r=re(re(re({},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=re(re({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(jf(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=re(re({},this._options.searchOptions),e),u=(l.fields||this._options.fields).reduce((function(t,e){var n;return re(re({},t),((n={})[e]=no(t,e)||1,n))}),l.boost||{}),h=l.boostDocument,c=l.weights,d=l.maxFuzzy,f=re(re({},il.weights),c),p=f.fuzzy,g=f.prefix,y=this._index.get(t.term),m=this.termResults(t.term,t.term,1,y,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=W(o),b=w.next();!b.done;b=w.next()){var M=ue(b.value,2),x=M[0],O=M[1];if(I=x.length-t.term.length){null==s||s.delete(x);var E=g*x.length/(x.length+.3*I);this.termResults(t.term,x,E,O,u,h,m)}}}catch(t){n={error:t}}finally{try{b&&!b.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}if(s)try{for(var T=W(s.keys()),k=T.next();!k.done;k=T.next()){x=k.value;var I,A=ue(s.get(x),2),S=A[0];if(I=A[1]){E=p*x.length/(x.length+I);this.termResults(t.term,x,E,S,u,h,m)}}}catch(t){i={error:t}}finally{try{k&&!k.done&&(a=T.return)&&a.call(T)}finally{if(i)throw i.error}}return m},t.prototype.combineResults=function(t,e){if(void 0===e&&(e=ao),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(Mf[n])||new Map},t.prototype.toJSON=function(){var t,e,n,r,i=[];try{for(var a=W(this._index),o=a.next();!o.done;o=a.next()){var s=ue(o.value,2),l=s[0],u=s[1],h={};try{for(var c=(n=void 0,W(u)),d=c.next();!d.done;d=c.next()){var f=ue(d.value,2),p=f[0],g=f[1];h[p]=Object.fromEntries(g)}}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=W(Object.keys(i)),f=d.next();!f.done;f=d.next()){var p=f.value,g=i[p],y=this._fieldIds[p],m=r.get(y);if(null!=m){var v=m.size,_=this._avgFieldLength[y];try{for(var w=(u=void 0,W(m.keys())),b=w.next();!b.done;b=w.next()){var M=b.value,x=a?a(this._documentIds.get(M),e):1;if(x){var O=m.get(M),E=this._fieldLength.get(M)[y],T=n*g*x*xf(O,v,this._documentCount,E,_),k=o.get(M);if(k){k.score+=T,Tf(k.terms,t);var I=no(k.match,e);I?I.push(p):k.match[e]=[p]}else o.set(M,{score:T,terms:[t],match:(c={},c[e]=[p],c)})}}}catch(t){u={error:t}}finally{try{b&&!b.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,ul),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,ul),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=W(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=W(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}(),no=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},Mf=((en={})[ao]=function(t,e){var n,r;try{for(var i=W(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),ol(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},en[kf]=function(t,e){var n,r,i=new Map;try{for(var a=W(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;ol(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},en[bf]=function(t,e){var n,r;try{for(var i=W(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},en),nl=1.2,rl=.7,wf=.5,xf=function(t,e,n,r,i){return Math.log(1+(n-e+.5)/(e+.5))*(wf+t*(nl+1)/(t+nl*(1-rl+rl*r/i)))},jf=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}}},ro={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(If)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},il={combineWith:ao,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},_f={prefix:function(t,e,n){return e===n.length-1}},Tf=function(t,e){t.includes(e)||t.push(e)},ol=function(t,e){var n,r;try{for(var i=W(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}}},sl=function(t,e){var n=t.score;return e.score-n},ul=function(){return new Map},Wr=function(t){var e,n,r=new Map;try{for(var i=W(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},If=/[\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 Of=["0","1","2","3","4","5","6","7","8","9"],zf=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],Af=["0","1","2","3","4","5","6","7","8","9"],Nf=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],Dv=[...Of,...zf,...Af,...Nf],ll=["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 _t,Ae,dt,Ue,ce,an,nn,Xt,rn,Kt,Ze,Xr,Kr,pt,on,Jr,Yr,Zr,Hf,sn,un,lo,Ef=32,we=!1,Sf=120,io=0,oo=class{constructor(t){p(this,"_callback"),p(this,"_frameCount"),p(this,"_ordering"),p(this,"_supersededBy"),p(this,"name"),p(this,"_remainingFrameCount"),p(this,"_lastFrameTime"),p(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,we&&console.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}},ct=class{constructor(t){if(p(this,"_postponed"),p(this,"userdata"),p(this,"_priority"),p(this,"_group"),p(this,"name"),p(this,"_lastFrameTime"),p(this,"_callback"),p(this,"_complete"),p(this,"_scheduled"),p(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,we&&console.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},so=class{constructor(t){p(this,"_postponed"),p(this,"_onComplete"),p(this,"_priority"),p(this,"userdata"),p(this,"name"),p(this,"_tasks"),p(this,"_scheduledTasks"),p(this,"_scheduled"),p(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,we&&console.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}},cl=class{constructor(t){p(this,"_maxMillisecondsPerFrame"),p(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:Ef,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},uo=class{constructor(t){p(this,"_timer"),p(this,"_performance"),p(this,"_scheduledUpdatesByOrdering"),p(this,"_scheduledTasksByPriority"),p(this,"_postponedTasks"),p(this,"_requestAnimationFrameHandle"),p(this,"_updatesToRunThisFrame"),p(this,"_lastFrameTime",0),p(this,"_updatesRunLastFrame"),this._timer=null!=(null==t?void 0:t.timer)?t.timer:new cl,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new tn,this._scheduledTasksByPriority=new tn,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),we&&console.log("task scheduler instantiated")}clear(){for(let t of this._scheduledTasksByPriority.values())t._cancelled=!0;for(let t of this._postponedTasks.values())t._cancelled=!0;this._scheduledUpdatesByOrdering=new tn,this._scheduledTasksByPriority=new tn,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),we&&console.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle=requestAnimationFrame(this.update))}update(t){let e;this._timer.beginFrame(),this._performance&&(e=performance.now());let n=!1;we&&(0===io&&(n=!0),++io,io%=Sf);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&&console.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&&console.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&&console.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;console.assert(void 0!==n),Object.getPrototypeOf(n)===so.prototype&&(r=n,n=r._popTask()),console.assert(void 0!==n),console.assert(Object.getPrototypeOf(n)===ct.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),we&&console.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),we&&console.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)===so)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,we&&console.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),we&&console.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)===ct.prototype?t._cancelled=!0:"clear"in t&&t.clear(),we&&console.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)===ct.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)===ct.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,we&&console.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)===ct.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)===ct.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),we&&console.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===ct.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,we&&console.log("task priority changed",t.name,e)}},tn=class{constructor(){p(this,"_map"),p(this,"_size"),p(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(console.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 console.assert(t===this._size),t}},Ye=t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),Wt="",Pf=.09,Ff=1,Df=.025,Lf=.5,Rf=5e-4,Cf=5e-4,Bf=.01,qf=.05,dl=1,Gf=.01,Uf=.2,Vf={MappedinCategory:"categories",MappedinLocation:"locations"},$f={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:ll,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===I.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:Pf,PRIMARY_INDEX_WEIGHT:Ff,SECONDARY_INDEX_WEIGHT:Df,CATEGORY_NAME_WEIGHT:Lf,LOCATION_NAME_WEIGHT:dl,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:Rf,CATEGORY_LOCATION_TAGS_WEIGHT:Cf,CATEGORY_LOCATION_NAME_WEIGHT:Bf,PRIMARY_INDEX_TAGS_NAME_WEIGHT:qf,LOCATION_DEFAULT_RANK:dl,RATIO_OF_FUZZY_TO_EXACT:Gf,RATIO_OF_PREFIX_TO_EXACT:Uf}},pl=class{constructor(t,e){var n,r,i;z(this,Zr),z(this,_t,void 0),z(this,Ae,void 0),z(this,dt,void 0),z(this,Ue,void 0),z(this,ce,void 0),z(this,an,new uo({performance:!0})),z(this,nn,void 0),z(this,Xt,void 0),z(this,rn,new Map),z(this,Kt,0),z(this,Ze,(t=>{S(this,Kt,1+ +f(this,Kt)),f(this,an).scheduleUpdate(new oo({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),S(this,Kt,+f(this,Kt)-1),0===f(this,Kt)&&f(this,on).call(this)}}))})),z(this,Xr,(t=>{var e,n,r;let{SECONDARY_INDEX_WEIGHT:i,LOCATION_DEFAULT_RANK:a,PRIMARY_INDEX_TAGS_NAME_WEIGHT:o}=f(this,ce).constants,s=a;(null==(e=f(this,ce))?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),f(this,Ze).call(this,(()=>{f(this,Ae).add({name:Ye(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:a,rank:s})})),(null==(n=f(this,ce))?void 0:n.searchTags)&&Array.isArray(t.tags)&&t.tags.forEach((e=>{f(this,Ae).add({name:"",tag:Ye(e),id:"MappedinLocation_"+t.id,weight:o,rank:s})})),(null==(r=f(this,ce))?void 0:r.searchDescriptions)&&f(this,Ze).call(this,(()=>f(this,dt).add({description:Ye(t.description||""),id:"MappedinLocation_"+t.id,weight:i,rank:s})))})),z(this,Kr,(t=>{var e,n;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:r,CATEGORY_LOCATION_TAGS_WEIGHT:i,CATEGORY_LOCATION_NAME_WEIGHT:a,CATEGORY_NAME_WEIGHT:o}=f(this,ce).constants;f(this,Ze).call(this,(()=>f(this,Ae).add({name:Ye(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:o})));let s=t.locations.reduce(((t,e)=>t+` ${Wt} `+e.name),"")+` ${Wt}`;if((null==(e=f(this,ce))?void 0:e.searchDescriptionsInCategories)&&t.locations.forEach((e=>{null!=e.description&&f(this,Ze).call(this,(()=>f(this,Ue).add({id:"MappedinCategory_"+t.id,"category.locations.description":Ye(e.description),ref:e.name,weight:r})))})),null==(n=f(this,ce))?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+` ${Wt} `+e),""))+` ${Wt}`}),"");f(this,Ze).call(this,(()=>f(this,Ue).add({"category.locations.tags":Ye(e),id:"MappedinCategory_"+t.id,weight:i})))}f(this,Ze).call(this,(()=>f(this,Ue).add({"category.locations.name":Ye(s),id:"MappedinCategory_"+t.id,weight:a})))})),z(this,pt,void 0),z(this,on,void 0),z(this,Jr,(t=>{var e;let n=t.score,{object:r,id:i,weight:a,rank:o}=t,[s,l]=i.split("_"),u=r||f(this,_t).getCollectionItemById(Vf[s],l);return o&&(null==(e=f(this,ce))?void 0:e.useLocationRank)&&(n+=o),a&&(n*=a),{score:n,type:s,object:u}})),z(this,Yr,((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(`[^${Wt}]* `+n+` [^${Wt}]*`,"ig").exec(t[r]);null!=e&&(i=e[0].slice(1,-1))}e.matches.push({term:n,weight:t.weight,matchesOn:r,value:i})}))})),z(this,sn,void 0),z(this,un,void 0),S(this,Xt,new Vr({...t.options,testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)})),S(this,ce,{...$f,...e}),S(this,_t,t),S(this,nn,new Set(null==(n=f(this,ce))?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}=f(this,ce).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},p={fields:["description"],storeFields:c,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return(null==(n=f(this,nn))?void 0:n.has(t.toLowerCase()))?null:t.toLowerCase()}},g={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(null==(r=f(this,ce))?void 0:r.jsonIndex){let{primary:t,secondary:e,extra:n}=JSON.parse(null==(i=f(this,ce))?void 0:i.jsonIndex);S(this,Ae,jt.loadJS(t,d)),S(this,dt,jt.loadJS(e,p)),S(this,Ue,jt.loadJS(n,g))}else S(this,Ae,new jt(d)),S(this,dt,new jt(p)),S(this,Ue,new jt(g)),f(this,_t).locations.forEach(f(this,Xr)),f(this,_t).categories.forEach(f(this,Kr));S(this,pt,new Promise((t=>{S(this,on,t)}))),f(this,an).update(performance.now()),S(this,sn,Bi(((t,e)=>{f(this,Xt).trackSearchSuggest({query:t,hits:e})}),300)),S(this,un,Bi(((t,e)=>{f(this,Xt).trackSearch({query:t,hits:e})}),300))}async suggest(t){await f(this,pt);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}=f(this,ce).constants,o=f(this,Ae).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 f(this,sn).call(this,t,o.length),{total:o.length,hits:o.map((t=>({text:t.suggestion})))}}async search(t){await f(this,pt);let e=Bo(this,Zr,Hf).call(this,t);return f(this,un).call(this,t,e.length),e}async toJSON(){return await f(this,pt),JSON.stringify({primary:f(this,Ae),secondary:f(this,dt),extra:f(this,Ue)})}async addQuery(t){let e,n,{query:r,object:i,weight:a=1}=t;await f(this,pt),e=i instanceof st?"MappedinLocation":i instanceof Nt?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=f(this,rn).get(i),n||(n="Custom_"+bt(),f(this,rn).set(i,n))),f(this,Ae).add({id:n,weight:a,object:i,query:Ye(r)})}};_t=new WeakMap,Ae=new WeakMap,dt=new WeakMap,Ue=new WeakMap,ce=new WeakMap,an=new WeakMap,nn=new WeakMap,Xt=new WeakMap,rn=new WeakMap,Kt=new WeakMap,Ze=new WeakMap,Xr=new WeakMap,Kr=new WeakMap,pt=new WeakMap,on=new WeakMap,Jr=new WeakMap,Yr=new WeakMap,Zr=new WeakSet,Hf=function(t){let e=[],n=Ye(t);e=[...f(this,Ae).search(n),...f(this,dt).search(n),...f(this,Ue).search(n)].sort(((t,e)=>e.score-t.score));let r={};for(let t of e){let e=f(this,Jr).call(this,t);r[t.id]?r[t.id].score+=e.score:r[t.id]={...e,matches:[]},f(this,Yr).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))},sn=new WeakMap,un=new WeakMap,g(),function(t){t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(lo||(lo={}));var So=globalThis.fetch||Zl.default;function ut(){if(null==So)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return So}function Qv(t){So=t}var ec,tc,mm=null==(tc=null==(ec=I)?void 0:ec.env)?void 0:tc.npm_package_version;globalThis.btoa||(globalThis.btoa=Yl.encode);var gm=["ar"];function gn(t){let e={...Ki,things:Xu,...t};return e.headers={...e.headers,"mappedin-sdk-version":mm},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 ym(t){let e=gn({baseUrl:"https://api-gateway.mappedin.com/",...t}),n="public/1/"+(e.useDraftData?"draft/":""),r=new Ut({...e,baseUrl:e.baseUrl+n});return await r.fetch(),r}function tk(t){ym=t}var Po={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function ak(t){let e=gn({baseUrl:"https://api-gateway.mappedin.com/",...Po,...t}),{url:n,updated_at:r}=await vm(t),i=await ut()(n,{mode:"cors"}),{data:a,format:o="jsonstring"}=await i.json();if("jsonstring"!==o)throw new Error(`Unrecognized format ${o}`);let s=new Ut(e);return await s.hydrate(a,e.shouldPopulateBundledImagesAsBlobs),s.updatedAt=r,s}async function vm(t){let e=gn({baseUrl:"https://api-gateway.mappedin.com/",...Po,...t}),{version:n,venue:r}=t,i=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&gm.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return e.language=void 0,await _r(e,i)}async function nk(t,{url:e,updated_at:n}){let r=gn({baseUrl:"https://api-gateway.mappedin.com/",...Po,...t}),i=await ut()(e,{mode:"cors"}),{data:a,format:o="jsonstring"}=await i.json();if("jsonstring"!==o)throw new Error(`Unrecognized format${o}`);let s=new Ut(r);return await s.hydrate(a,r.shouldPopulateBundledImagesAsBlobs),s.updatedAt=n,s}async function Ql(t){let e=gn({baseUrl:"https://api-gateway.mappedin.com/",...Ki,...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 _r(e,i)}async function rk(t,e=!1){return new Promise((async(n,r)=>{try{let i=new TextDecoder,a=i.decode.bind(i),o=await Promise.resolve().then((()=>(Jl(),Kl)));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 Ql(t),s=new Uint8Array(await ut()(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=[],g=[];for(let t=0;t<d.length;t++){let[,e]=d[t];e.byteLength>=f?p.push(d[t]):e.byteLength<f&&g.push(d[t])}let y={};if(0===g.length)d.forEach((([t])=>{y[t]=JSON.parse(a(l[t]))})),n(y);else{let t=function({data:t}){let e=this;if("finished"===t[0]){let n=g[o];if(null!=n){let[t,r]=n;e.postMessage(["task",t]),e.postMessage(r,[r]),o++}let[r,i]=t[1];y[r]=i,s++}else if("error"===t[0]){let[,e]=t;c.forEach((t=>t.terminate())),r(e)}s===u.length&&(n(y),c.forEach((t=>t.terminate())))},i=URL.createObjectURL(e);for(let t=0;t<Math.min(h,g.length);t++)c.push(new Worker(i));let o=0,s=0;c.forEach((e=>{if(e.onmessage=t,null!=g[o]){let[t,n]=g[o];e.postMessage(["task",t]),e.postMessage(n,[n]),o++}})),p.forEach((([t])=>{y[t]=JSON.parse(a(l[t])),s++}))}}else{let{url:e}=await Ql(t),r=new Uint8Array(await ut()(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){console.warn("bad file",e)}}n(l)}}catch(t){r(t)}}))}export{lo as MAP_RENDER_MODE,Ut as Mappedin,Nt as MappedinCategory,Ji as MappedinCollectionType,Da as MappedinCoordinate,xr as MappedinDestinationSet,ka as MappedinDirections,Ir as MappedinEvent,st as MappedinLocation,Nr as MappedinMap,Sr as MappedinMapGroup,it as MappedinNavigatable,Fr as MappedinNode,At as MappedinPolygon,Lr as MappedinRankings,Br as MappedinVenue,Gr as MappedinVortex,pl as OfflineSearch,tk as __setGetVenueMock,nk as downloadBundle,rk as downloadVenueBundleMVF,ym as getVenue,ak as getVenueBundle,vm as getVenueBundleURL,Ql as getVenueMVFURL,ut as isomorphicFetch,Qv as setFetchFn};
1
+ var dc,I,nc=Object.create,ca=Object.defineProperty,rc=Object.getOwnPropertyDescriptor,ic=Object.getOwnPropertyNames,oc=Object.getPrototypeOf,sc=Object.prototype.hasOwnProperty,uc=(t,e,n)=>e in t?ca(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ro=t=>ca(t,"__esModule",{value:!0}),Co=(t,e)=>()=>(t&&(e=t(t=0)),e),B=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),lc=(t,e)=>{for(var n in Ro(t),e)ca(t,n,{get:e[n],enumerable:!0})},cc=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of ic(e))!sc.call(t,r)&&"default"!==r&&ca(t,r,{get:()=>e[r],enumerable:!(n=rc(e,r))||n.enumerable});return t},vn=t=>cc(Ro(ca(null!=t?nc(oc(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),p=(t,e,n)=>(uc(t,"symbol"!=typeof e?e+"":e,n),n),pi=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},f=(t,e,n)=>(pi(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(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)},S=(t,e,n,r)=>(pi(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Bo=(t,e,n)=>(pi(t,e,"access private method"),n),g=Co((()=>{I={env:dc={NODE_ENV:"production",npm_package_version:"4.1.5"}}})),Go=B(((t,e)=>{g(),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)})),se=B((t=>{g(),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})),pa=B((t=>{g(),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})),ha=B((t=>{g(),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})),fa=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),n=function(t){return e.sexagesimalPattern.test(t.toString().trim())};t.default=n})),ma=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),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})),_n=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=se(),r=(e=pa())&&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})),gi=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(ha()),n=a(fa()),r=a(ma()),i=se();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})),vi=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(ha()),n=a(fa()),r=a(ma()),i=se();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})),bi=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(_n()),n=i(gi()),r=i(vi());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})),An=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(ha()),n=o(fa()),r=o(ma()),i=o(bi()),a=o(_n());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})),Ie=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),n=i(pa()),r=i(An());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})),Oe=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),n=i(pa()),r=i(An());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})),Re=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t*Math.PI/180};t.default=e})),gt=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return 180*t/Math.PI};t.default=e})),Qo=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ie()),n=o(Oe()),r=o(Re()),i=o(gt()),a=se();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),g=Math.asin(Math.sin(f)*Math.cos(c)+Math.cos(f)*Math.sin(c)*Math.cos(d)),y=p+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(g)),m=(0,i.default)(y);return(m<a.MINLON||m>a.MAXLON)&&(y=(y+3*Math.PI)%(2*Math.PI)-Math.PI,m=(0,i.default)(y)),{latitude:(0,i.default)(g),longitude:m}};t.default=s})),es=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),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})),ts=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),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})),as=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=se(),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})),is=B((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}g(),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})),_i=B((t=>{g(),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})),at=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ie()),n=o(Oe()),r=o(Re()),i=o(_i()),a=se();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})),Ti=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=at())&&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})),ls=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ti())&&e.__esModule?e:{default:e};var r=function(t,e){return(0,n.default)(t,e)[0]};t.default=r})),ps=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Re()),n=a(Ie()),r=a(Oe()),i=se();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})),zi=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Ie()),n=r(Oe());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})),fs=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ie()),n=o(Oe()),r=o(Re()),i=o(gt()),a=se();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,g=c+f,y=(0,r.default)(a.MAXLAT),m=(0,r.default)(a.MINLAT),v=(0,r.default)(a.MAXLON),_=(0,r.default)(a.MINLON);if(p>m&&g<y){var w=Math.asin(Math.sin(f)/Math.cos(c));(s=d-w)<_&&(s+=2*Math.PI),(l=d+w)>v&&(l-=2*Math.PI)}else p=Math.max(p,m),g=Math.min(g,y),s=_,l=v;return[{latitude:(0,i.default)(p),longitude:(0,i.default)(s)},{latitude:(0,i.default)(g),longitude:(0,i.default)(l)}]};t.default=s})),ys=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ie()),n=a(Oe()),r=a(Re()),i=a(gt());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})),vs=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=zi())&&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})),Ai=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ie()),n=a(Oe()),r=a(Re()),i=a(gt());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})),ws=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ai())&&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})),Ei=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(at()),n=r(_i());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})),Is=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ie()),n=a(Oe()),r=a(Re()),i=a(gt());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})),Os=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=at())&&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})),Es=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ie()),n=a(Oe()),r=a(Re()),i=se();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),g=(0,n.default)(t),y=(0,e.default)(a),m=(0,n.default)(a),v=6356752.314245,_=1/298.257223563,w=(0,r.default)(m-g),b=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(p)))),M=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(y)))),x=Math.sin(b),O=Math.cos(b),E=Math.sin(M),T=Math.cos(M),k=w,I=100;do{var A=Math.sin(k),S=Math.cos(k);if(0===(d=Math.sqrt(T*A*(T*A)+(O*E-x*T*S)*(O*E-x*T*S))))return 0;s=x*E+O*T*S,l=Math.atan2(d,s),c=s-2*x*E/(h=1-(u=O*T*A/d)*u),isNaN(c)&&(c=0);var N=_/16*h*(4+_*(4-3*h));f=k,k=w+(1-N)*_*u*(l+N*d*(c+N*s*(2*c*c-1)))}while(Math.abs(k-f)>1e-12&&--I>0);if(0===I)return NaN;var F=h*(i.earthRadius*i.earthRadius-v*v)/(v*v),R=1+F/16384*(4096+F*(F*(320-175*F)-768)),B=F/1024*(256+F*(F*(74-47*F)-128)),P=B*d*(c+B/4*(s*(2*c*c-1)-B/6*c*(4*d*d-3)*(4*c*c-3))),C=v*R*(l-P);return Math.round(C/o)*o};t.default=o})),Ss=B((t=>{g(),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})),Ps=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=at())&&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})),Fs=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=at())&&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})),Ls=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Ie()),n=r(Oe());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})),Rs=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=Ei())&&e.__esModule?e:{default:e};var r=function(t,e,r,i){return(0,n.default)(t,e,r)<i};t.default=r})),Cs=B((t=>{g(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=at())&&e.__esModule?e:{default:e};var r=function(t,e,r){return(0,n.default)(t,e)<r};t.default=r})),qs=B((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}g(),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})),Us=B((t=>{g(),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 f.default}}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:function(){return m.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 b.default}}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"toRad",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:function(){return W.default}});var n=$(Qo()),r=$(es()),i=$(ts()),a=$(as()),o=$(is()),s=$(ls()),l=$(ps()),u=$(zi()),h=$(fs()),c=$(ys()),d=$(vs()),f=$(ws()),p=$(pa()),y=$(_n()),m=$(at()),v=$(Ei()),_=$(Is()),w=$(Ie()),b=$(Oe()),M=$(Os()),x=$(Es()),O=$(Ai()),E=$(Ss()),T=$(Ps()),k=$(ha()),I=$(Fs()),A=$(Ls()),S=$(Rs()),N=$(Cs()),F=$(fa()),R=$(bi()),B=$(gi()),P=$(vi()),C=$(Ti()),j=$(ma()),D=$(An()),L=$(Re()),z=$(gt()),W=$(qs()),U=se();function $(t){return t&&t.__esModule?t:{default:t}}Object.keys(U).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return U[n]}})}))})),Tu=B(((t,e)=>{g(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),Nu=B(((t,e)=>{g();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)}}})),Su=B(((t,e)=>{g(),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)]}})),Fu=B(((t,e)=>{g(),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}})),Uu=B((t=>{g();var e=Tu(),n=Nu(),r=Su(),i=Fu(),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 f(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=f,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:f(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)}})),Yu=B(((t,e)=>{g();var n,r="undefined"!=typeof self?self:t,i=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();n=i,function(t){var e="URLSearchParams"in n,r="Symbol"in n&&"iterator"in Symbol,i="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(t){return!1}}(),a="FormData"in n,o="ArrayBuffer"in n;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function c(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function g(t){var e=new FileReader,n=p(e);return e.readAsArrayBuffer(t),n}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&i&&function(t){return t&&DataView.prototype.isPrototypeOf(t)}(t)?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,n=p(e);return e.readAsText(t),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=u(t),e=h(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},d.prototype.delete=function(t){delete this.map[u(t)]},d.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},d.prototype.set=function(t,e){this.map[u(t)]=h(e)},d.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},d.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),c(t)},d.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),c(t)},d.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),c(t)},r&&(d.prototype[Symbol.iterator]=d.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function _(t,e){var n=(e=e||{}).body;if(t instanceof _){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!n&&null!=t._bodyInit&&(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new d(e.headers)),this.method=function(t){var e=t.toUpperCase();return v.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function b(t){var e=new d;return t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}})),e}function M(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},m.call(_.prototype),m.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},M.error=function(){var t=new M(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];M.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new M(null,{status:e,headers:{location:t}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function O(e,n){return new Promise((function(r,a){var o=new _(e,n);if(o.signal&&o.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var t={status:s.status,statusText:s.statusText,headers:b(s.getAllResponseHeaders()||"")};t.url="responseURL"in s?s.responseURL:t.headers.get("X-Request-URL");var e="response"in s?s.response:s.responseText;r(new M(e,t))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),o.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",l)}),s.send(void 0===o._bodyInit?null:o._bodyInit)}))}O.polyfill=!0,n.fetch||(n.fetch=O,n.Headers=d,n.Request=_,n.Response=M),t.Headers=d,t.Request=_,t.Response=M,t.fetch=O,Object.defineProperty(t,"__esModule",{value:!0})}({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var a=i;(t=a.fetch).default=a.fetch,t.fetch=a.fetch,t.Headers=a.Headers,t.Request=a.Request,t.Response=a.Response,e.exports=t})),Kl={};function wo(t,e){return!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,t}function Fl(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[ra],(function(t){return ht(fn(t.data[0],t.data[1]))}),0,n)}function fn(t,e){return Tt(t,e||{},0,0)}function jo(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[na],(function(t){return ht(sa(t.data[0],go(t.data[1])))}),1,n)}function sa(t,e){return pn(t,e)}function Yf(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[ra,Ol,function(){return[To]}],(function(t){return ht(To(t.data[0],t.data[1]))}),2,n)}function To(t,e){e||(e={});var n=aa(),r=t.length;n.p(t);var i=Tt(t,e,bo(e),8),a=i.length;return vo(i,e),K(i,a-8,n.d()),K(i,a-4,r),i}function Ll(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[na,zl,function(){return[si]}],(function(t){return ht(si(t.data[0]))}),3,n)}function si(t,e){return pn(t.subarray(ko(t),-8),e||new H(El(t)))}function Qf(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[ra,Al,function(){return[Oo]}],(function(t){return ht(Oo(t.data[0],t.data[1]))}),4,n)}function Oo(t,e){e||(e={});var n=mo();n.p(t);var r=Tt(t,e,2,4);return Mo(r,e),K(r,r.length-4,n.d()),r}function Cl(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),ia(t,e,[na,Nl,function(){return[li]}],(function(t){return ht(li(t.data[0],go(t.data[1])))}),5,n)}function li(t,e){return pn((Sl(t),t.subarray(2,-4)),e)}function tm(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&C(7),31==t[0]&&139==t[1]&&8==t[2]?Ll(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?jo(t,e,n):Cl(t,e,n)}function am(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?si(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?sa(t,e):li(t,e)}function ft(t,e){if(e){for(var n=new H(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(ql)return ql.encode(t);var i=t.length,a=new H(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 H(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 Se(a,0,o)}function No(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(Ao)return Ao.decode(t);var i=Ul(t),a=i[0];return i[1].length&&C(8),a}function um(t,e,n){n||(n=e,e={}),"function"!=typeof n&&C(7);var r={};zo(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){ci((function(){n(t,e)}))};ci((function(){d=n}));var f=function(){var t=new H(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;ua(t,s,i,i.f,i.u,a);var h=30+i.f.length+mt(i.extra),c=s+h;t.set(i.c,c),ua(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)}}Eo(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],g=aa(),y=l.length;g.p(l);var m=ft(e),v=m.length,_=p.comment,w=_&&ft(_),b=w&&w.length,M=mt(p.extra),x=0==p.level?0:8,O=function(n,r){if(n)c(),d(n,null);else{var i=r.length;u[t]=hn(p,{size:y,crc:g.d(),c:r,f:m,m:w,u:v!=e.length||w&&_.length!=b,compression:x}),o+=30+v+M+i,s+=76+2*(v+M)+(b||0)+i,--a||f()}};if(v>65535&&O(C(11,0,1),null),x)if(y<16e4)try{O(null,fn(l,p))}catch(t){O(t,null)}else h.push(Fl(l,p,O));else O(null,l)},g=0;g<l;++g)p(g);return c}function lm(t,e){e||(e={});var n={},r=[];zo(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=(x=ft(o)).length,d=u.comment,f=d&&ft(d),p=f&&f.length,g=mt(u.extra);c>65535&&C(11);var y=h?fn(l,u):l,m=y.length,v=aa();v.p(l),r.push(hn(u,{size:l.length,crc:v.d(),c:y,f:x,m:f,u:c!=o.length||f&&d.length!=p,o:i,compression:h})),i+=30+c+g+m,a+=76+2*(c+g)+(p||0)+m}for(var _=new H(a+22),w=i,b=a-i,M=0;M<r.length;++M){var x=r[M];ua(_,x.o,x,x.f,x.u,x.c.length);var O=30+x.f.length+mt(x.extra);_.set(x.c,x.o+O),ua(_,i,x,x.f,x.u,x.c.length,x.o,x.m),i+=16+O+(x.m?x.m.length:0)}return Eo(_,i,r.length,b,w),_}function hm(t,e,n){n||(n=e,e={}),"function"!=typeof n&&C(7);var r=[],i=function(){for(var t=0;t<r.length;++t)r[t]()},a={},o=function(t,e){ci((function(){n(t,e)}))};ci((function(){o=n}));for(var s=t.length-22;101010256!=te(t,s);--s)if(!s||t.length-s>65558)return o(C(13,0,1),null),i;var l=ye(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(C(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=Hl(t,h,c),s=n[0],u=n[1],f=n[2],p=n[3],g=n[4],y=n[5],m=$l(t,y);h=g;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(m,m+u);if(u<32e4)try{v(null,sa(_,new H(f)))}catch(t){v(t,null)}else r.push(jo(_,{size:f},v))}else v(C(14,"unknown compression type "+s,1),null);else v(null,Se(t,m,m+u));else v(null,null)},p=0;p<u;++p)f()}else o(null,{});return i}function fm(t,e){for(var n={},r=t.length-22;101010256!=te(t,r);--r)(!r||t.length-r>65558)&&C(13);var i=ye(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)&&C(13),i=te(t,r+32),a=te(t,r+48));for(var s=e&&e.filter,l=0;l<i;++l){var u=Hl(t,a,o),h=u[0],c=u[1],d=u[2],f=u[3],p=u[4],g=u[5],y=$l(t,g);a=p,(!s||s({name:f,size:c,originalSize:d,compression:h}))&&(h?8==h?n[f]=sa(t.subarray(y,y+c),new H(d)):C(14,"unknown compression type "+h):n[f]=Se(t,y,y+c))}return n}lc(Kl,{AsyncCompress:()=>Jf,AsyncDecompress:()=>em,AsyncDeflate:()=>Pl,AsyncGunzip:()=>Dl,AsyncGzip:()=>Jf,AsyncInflate:()=>xo,AsyncUnzipInflate:()=>dm,AsyncUnzlib:()=>Rl,AsyncZipDeflate:()=>om,AsyncZlib:()=>Zf,Compress:()=>_o,DecodeUTF8:()=>nm,Decompress:()=>Bl,Deflate:()=>$e,EncodeUTF8:()=>rm,FlateErrorCode:()=>Xf,Gunzip:()=>oi,Gzip:()=>_o,Inflate:()=>xe,Unzip:()=>pm,UnzipInflate:()=>cm,UnzipPassThrough:()=>Xl,Unzlib:()=>ui,Zip:()=>sm,ZipDeflate:()=>im,ZipPassThrough:()=>mn,Zlib:()=>Io,compress:()=>Yf,compressSync:()=>To,decompress:()=>tm,decompressSync:()=>am,deflate:()=>Fl,deflateSync:()=>fn,gunzip:()=>Ll,gunzipSync:()=>si,gzip:()=>Yf,gzipSync:()=>To,inflate:()=>jo,inflateSync:()=>sa,strFromU8:()=>No,strToU8:()=>ft,unzip:()=>hm,unzipSync:()=>fm,unzlib:()=>Cl,unzlibSync:()=>li,zip:()=>um,zipSync:()=>lm,zlib:()=>Qf,zlibSync:()=>Oo});var hl,Wf,H,pe,Jt,Yt,Zt,ln,fl,ml,co,Qr,gl,yl,po,cn,Qe,Ne,et,Qt,X,vl,kl,bl,Ml,ei,Ee,ti,dn,Se,Xf,wl,C,pn,Ve,ea,ai,ni,ho,ta,ri,fo,xl,tt,jl,_l,aa,mo,Tt,hn,Tl,ii,Kf,Il,na,ra,Ol,zl,Al,Nl,ht,go,ia,Pe,oa,ye,te,yo,K,vo,ko,El,bo,Mo,Sl,$e,Pl,xe,xo,_o,Jf,oi,Dl,Io,Zf,ui,Rl,Bl,em,zo,ql,Ao,Gl,Ul,nm,rm,Vl,$l,Hl,Wl,mt,ua,Eo,mn,im,om,sm,Xl,cm,dm,pm,ci,Jl=Co((()=>{for(g(),hl={},Wf=function(t,e,n,r,i){var a=new Worker(hl[e]||(hl[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},H=Uint8Array,pe=Uint16Array,Jt=Uint32Array,Yt=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]),Zt=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]),ln=new H([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ml=(fl=function(t,e){for(var n=new pe(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new Jt(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]})(Yt,2),co=ml[0],Qr=ml[1],co[28]=258,Qr[258]=28,gl=fl(Zt,0),yl=gl[0],po=gl[1],cn=new pe(32768),X=0;X<32768;++X)Qe=(61680&(Qe=(52428&(Qe=(43690&X)>>>1|(21845&X)<<1))>>>2|(13107&Qe)<<2))>>>4|(3855&Qe)<<4,cn[X]=((65280&Qe)>>>8|(255&Qe)<<8)>>>1;for(Ne=function(t,e,n){for(var r=t.length,i=0,a=new pe(e);i<r;++i)t[i]&&++a[t[i]-1];var o,s=new pe(e);for(i=0;i<e;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new pe(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[cn[c]>>>l]=u}else for(o=new pe(r),i=0;i<r;++i)t[i]&&(o[i]=cn[s[t[i]-1]++]>>>15-t[i]);return o},et=new H(288),X=0;X<144;++X)et[X]=8;for(X=144;X<256;++X)et[X]=9;for(X=256;X<280;++X)et[X]=7;for(X=280;X<288;++X)et[X]=8;for(Qt=new H(32),X=0;X<32;++X)Qt[X]=5;vl=Ne(et,9,0),kl=Ne(et,9,1),bl=Ne(Qt,5,0),Ml=Ne(Qt,5,1),ei=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Ee=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},ti=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},dn=function(t){return(t+7)/8|0},Se=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?pe:4==t.BYTES_PER_ELEMENT?Jt:H)(n-e);return r.set(t.subarray(e,n)),r},Xf={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},wl=["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"],C=function(t,e,n){var r=new Error(e||wl[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,C),!n)throw r;return r},pn=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new H(0);var i=!e||n,a=!n||n.i;n||(n={}),e||(e=new H(3*r));var o=function(t){var n=e.length;if(t>n){var r=new H(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=Ee(t,l,1);var g=Ee(t,l+1,3);if(l+=3,!g){var y=t[(k=dn(l)+4)-4]|t[k-3]<<8,m=k+y;if(m>r){a&&C(0);break}i&&o(u+y),e.set(t.subarray(k,m),u),n.b=u+=y,n.p=l=8*m,n.f=s;continue}if(1==g)h=kl,c=Ml,d=9,f=5;else if(2==g){var v=Ee(t,l,31)+257,_=Ee(t,l+10,15)+4,w=v+Ee(t,l+5,31)+1;l+=14;for(var b=new H(w),M=new H(19),x=0;x<_;++x)M[ln[x]]=Ee(t,l+3*x,7);l+=3*_;var O=ei(M),E=(1<<O)-1,T=Ne(M,O,1);for(x=0;x<w;){var k,I=T[Ee(t,l,E)];if(l+=15&I,(k=I>>>4)<16)b[x++]=k;else{var A=0,S=0;for(16==k?(S=3+Ee(t,l,3),l+=2,A=b[x-1]):17==k?(S=3+Ee(t,l,7),l+=3):18==k&&(S=11+Ee(t,l,127),l+=7);S--;)b[x++]=A}}var N=b.subarray(0,v),F=b.subarray(v);d=ei(N),f=ei(F),h=Ne(N,d,1),c=Ne(F,f,1)}else C(1);if(l>p){a&&C(0);break}}i&&o(u+131072);for(var R=(1<<d)-1,B=(1<<f)-1,P=l;;P=l){var j=(A=h[ti(t,l)&R])>>>4;if((l+=15&A)>p){a&&C(0);break}if(A||C(2),j<256)e[u++]=j;else{if(256==j){P=l,h=null;break}var D=j-254;if(j>264){var L=Yt[x=j-257];D=Ee(t,l,(1<<L)-1)+co[x],l+=L}var z=c[ti(t,l)&B],W=z>>>4;z||C(3),l+=15&z;F=yl[W];if(W>3){L=Zt[W];F+=ti(t,l)&(1<<L)-1,l+=L}if(l>p){a&&C(0);break}i&&o(u+131072);for(var U=u+D;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=P,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:Se(e,0,u)},Ve=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8},ea=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},ai=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[tt,0];if(1==i){var o=new H(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 pe(d+1),p=ni(n[h-1],f,0);if(p>e){r=0;var g=0,y=p-e,m=1<<y;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;g+=m-(1<<p-f[v]),f[v]=e}for(g>>>=y;g>0;){var _=a[r].s;f[_]<e?g-=1<<e-f[_]++-1:++r}for(;r>=0&&g;--r){var w=a[r].s;f[w]==e&&(--f[w],++g)}p=e}return[new H(f),p]},ni=function(t,e,n){return-1==t.s?Math.max(ni(t.l,e,n+1),ni(t.r,e,n+1)):e[t.s]=n},ho=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new pe(++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]},ta=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},ri=function(t,e,n){var r=n.length,i=dn(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)},fo=function(t,e,n,r,i,a,o,s,l,u,h){Ve(e,h++,n),++i[256];for(var c=ai(i,15),d=c[0],f=c[1],p=ai(a,15),g=p[0],y=p[1],m=ho(d),v=m[0],_=m[1],w=ho(g),b=w[0],M=w[1],x=new pe(19),O=0;O<v.length;++O)x[31&v[O]]++;for(O=0;O<b.length;++O)x[31&b[O]]++;for(var E=ai(x,7),T=E[0],k=E[1],I=19;I>4&&!T[ln[I-1]];--I);var A,S,N,F,R=u+5<<3,B=ta(i,et)+ta(a,Qt)+o,P=ta(i,d)+ta(a,g)+o+14+3*I+ta(x,T)+(2*x[16]+3*x[17]+7*x[18]);if(R<=B&&R<=P)return ri(e,h,t.subarray(l,l+u));if(Ve(e,h,1+(P<B)),h+=2,P<B){A=Ne(d,f,0),S=d,N=Ne(g,y,0),F=g;var C=Ne(T,k,0);Ve(e,h,_-257),Ve(e,h+5,M-1),Ve(e,h+10,I-4),h+=14;for(O=0;O<I;++O)Ve(e,h+3*O,T[ln[O]]);h+=3*I;for(var j=[v,b],D=0;D<2;++D){var L=j[D];for(O=0;O<L.length;++O){var z=31&L[O];Ve(e,h,C[z]),h+=T[z],z>15&&(Ve(e,h,L[O]>>>5&127),h+=L[O]>>>12)}}}else A=vl,S=et,N=bl,F=Qt;for(O=0;O<s;++O)if(r[O]>255){z=r[O]>>>18&31;ea(e,h,A[z+257]),h+=S[z+257],z>7&&(Ve(e,h,r[O]>>>23&31),h+=Yt[z]);var W=31&r[O];ea(e,h,N[W]),h+=F[W],W>3&&(ea(e,h,r[O]>>>5&8191),h+=Zt[W])}else ea(e,h,A[r[O]]),h+=S[r[O]];return ea(e,h,A[256]),h+S[256]},xl=new Jt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),tt=new H(0),jl=function(t,e,n,r,i,a){var o=t.length,s=new H(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=ri(l,u+1,t.subarray(h,c))}else{for(var d=xl[e-1],f=d>>>13,p=8191&d,g=(1<<n)-1,y=new pe(32768),m=new pe(g+1),v=Math.ceil(n/3),_=2*v,w=function(e){return(t[e]^t[e+1]<<v^t[e+2]<<_)&g},b=new Jt(25e3),M=new pe(288),x=new pe(32),O=0,E=0,T=(h=0,0),k=0,I=0;h<o;++h){var A=w(h),S=32767&h,N=m[A];if(y[S]=N,m[A]=S,k<=h){var F=o-h;if((O>7e3||T>24576)&&F>423){u=fo(t,l,0,b,M,x,E,T,I,h-I,u),T=O=E=0,I=h;for(var R=0;R<286;++R)M[R]=0;for(R=0;R<30;++R)x[R]=0}var B=2,P=0,C=p,j=S-N&32767;if(F>2&&A==w(h-j))for(var D=Math.min(f,F)-1,L=Math.min(32767,h),z=Math.min(258,F);j<=L&&--C&&S!=N;){if(t[h+B]==t[h+B-j]){for(var W=0;W<z&&t[h+W]==t[h+W-j];++W);if(W>B){if(B=W,P=j,W>D)break;var U=Math.min(j,W-2),$=0;for(R=0;R<U;++R){var G=h-j+R+32768&32767,X=G-y[G]+32768&32767;X>$&&($=X,N=G)}}}j+=(S=N)-(N=y[S])+32768&32767}if(P){b[T++]=268435456|Qr[B]<<18|po[P];var q=31&Qr[B],K=31&po[P];E+=Yt[q]+Zt[K],++M[257+q],++x[K],k=h+B,++O}else b[T++]=t[h],++M[t[h]]}}u=fo(t,l,a,b,M,x,E,T,I,h-I,u),!a&&7&u&&(u=ri(l,u+1,tt))}return Se(s,0,r+dn(u)+i)},_l=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}(),aa=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=_l[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},mo=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}}},Tt=function(t,e,n,r,i){return jl(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)},hn=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},Tl=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]},ii=[],Kf=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},Il=function(t,e,n,r){var i;if(!ii[n]){for(var a="",o={},s=t.length-1,l=0;l<s;++l)a=(i=Tl(t[l],a,o))[0],o=i[1];ii[n]=Tl(t[s],a,o)}var u=hn({},ii[n][1]);return Wf(ii[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,Kf(u),r)},na=function(){return[H,pe,Jt,Yt,Zt,ln,co,yl,kl,Ml,cn,wl,Ne,ei,Ee,ti,dn,Se,C,pn,sa,ht,go]},ra=function(){return[H,pe,Jt,Yt,Zt,ln,Qr,po,vl,et,bl,Qt,cn,xl,tt,Ne,Ve,ea,ai,ni,ho,ta,ri,fo,dn,Se,jl,Tt,fn,ht]},Ol=function(){return[vo,bo,K,aa,_l]},zl=function(){return[ko,El]},Al=function(){return[Mo,K,mo]},Nl=function(){return[Sl]},ht=function(t){return postMessage(t,[t.buffer])},go=function(t){return t&&t.size&&new H(t.size)},ia=function(t,e,n,r,i,a){var o=Il(n,r,i,(function(t,e){o.terminate(),a(t,e)}));return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Pe=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])}},oa=function(t,e,n,r,i){var a,o=Il(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||C(5),a&&e.ondata(C(4,0,1),null,!!n),o.postMessage([t,a=n],[t.buffer])},e.terminate=function(){o.terminate()}},ye=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},yo=function(t,e){return te(t,e)+4294967296*te(t,e+4)},K=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},vo=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&&K(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)}},ko=function(t){(31!=t[0]||139!=t[1]||8!=t[2])&&C(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)},El=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},bo=function(t){return 10+(t.filename&&t.filename.length+1||0)},Mo=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)},Sl=function(t){(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&C(6,"invalid zlib data"),32&t[1]&&C(6,"invalid zlib data: preset dictionaries not supported")},$e=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(Tt(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){this.ondata||C(5),this.d&&C(4),this.d=e,this.p(t,e||!1)},t}(),Pl=function(t,e){oa([ra,function(){return[Pe,$e]}],this,wo.call(this,t,e),(function(t){var e=new $e(t.data);onmessage=Pe(e)}),6)},xe=function(){function t(t){this.s={},this.p=new H(0),this.ondata=t}return t.prototype.e=function(t){this.ondata||C(5),this.d&&C(4);var e=this.p.length,n=new H(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=pn(this.p,this.o,this.s);this.ondata(Se(n,e,this.s.b),this.d),this.o=Se(n,this.s.b-32768),this.s.b=this.o.length,this.p=Se(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),xo=function(t){this.ondata=t,oa([na,function(){return[Pe,xe]}],this,0,(function(){var t=new xe;onmessage=Pe(t)}),7)},_o=function(){function t(t,e){this.c=aa(),this.l=0,this.v=1,$e.call(this,t,e)}return t.prototype.push=function(t,e){$e.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=Tt(t,this.o,this.v&&bo(this.o),e&&8,!e);this.v&&(vo(n,this.o),this.v=0),e&&(K(n,n.length-8,this.c.d()),K(n,n.length-4,this.l)),this.ondata(n,e)},t}(),Jf=function(t,e){oa([ra,Ol,function(){return[Pe,$e,_o]}],this,wo.call(this,t,e),(function(t){var e=new _o(t.data);onmessage=Pe(e)}),8)},oi=function(){function t(t){this.v=1,xe.call(this,t)}return t.prototype.push=function(t,e){if(xe.prototype.e.call(this,t),this.v){var n=this.p.length>3?ko(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}e&&(this.p.length<8&&C(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),xe.prototype.c.call(this,e)},t}(),Dl=function(t){this.ondata=t,oa([na,zl,function(){return[Pe,xe,oi]}],this,0,(function(){var t=new oi;onmessage=Pe(t)}),9)},Io=function(){function t(t,e){this.c=mo(),this.v=1,$e.call(this,t,e)}return t.prototype.push=function(t,e){$e.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=Tt(t,this.o,this.v&&2,e&&4,!e);this.v&&(Mo(n,this.o),this.v=0),e&&K(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),Zf=function(t,e){oa([ra,Al,function(){return[Pe,$e,Io]}],this,wo.call(this,t,e),(function(t){var e=new Io(t.data);onmessage=Pe(e)}),10)},ui=function(){function t(t){this.v=1,xe.call(this,t)}return t.prototype.push=function(t,e){if(xe.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&&C(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),xe.prototype.c.call(this,e)},t}(),Rl=function(t){this.ondata=t,oa([na,Nl,function(){return[Pe,xe,ui]}],this,0,(function(){var t=new ui;onmessage=Pe(t)}),11)},Bl=function(){function t(t){this.G=oi,this.I=xe,this.Z=ui,this.ondata=t}return t.prototype.push=function(t,e){if(this.ondata||C(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new H(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}(),em=function(){function t(t){this.G=Dl,this.I=xo,this.Z=Rl,this.ondata=t}return t.prototype.push=function(t,e){Bl.prototype.push.call(this,t,e)},t}(),zo=function(t,e,n,r){for(var i in t){var a=t[i],o=e+i,s=r;Array.isArray(a)&&(s=hn(r,a[1]),a=a[0]),a instanceof H?n[o]=[a,s]:(n[o+="/"]=[new H(0),s],zo(a,o,n,r))}},ql="undefined"!=typeof TextEncoder&&new TextEncoder,Ao="undefined"!=typeof TextDecoder&&new TextDecoder,Gl=0;try{Ao.decode(tt,{stream:!0}),Gl=1}catch(t){}Ul=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,Se(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)}},nm=function(){function t(t){this.ondata=t,Gl?this.t=new TextDecoder:this.p=tt}return t.prototype.push=function(t,e){if(this.ondata||C(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&C(8),this.t=null));this.p||C(4);var n=new H(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=Ul(n),i=r[0],a=r[1];e?(a.length&&C(8),this.p=null):this.p=a,this.ondata(i,e)},t}(),rm=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||C(5),this.d&&C(4),this.ondata(ft(t),this.d=e||!1)},t}(),Vl=function(t){return 1==t?3:t<6?2:9==t?1:0},$l=function(t,e){return e+30+ye(t,e+26)+ye(t,e+28)},Hl=function(t,e,n){var r=ye(t,e+28),i=No(t.subarray(e+46,e+46+r),!(2048&ye(t,e+8))),a=e+46+r,o=te(t,e+20),s=n&&4294967295==o?Wl(t,a):[o,te(t,e+24),te(t,e+42)],l=s[0],u=s[1],h=s[2];return[ye(t,e+10),l,u,i,a+ye(t,e+30)+ye(t,e+32),h]},Wl=function(t,e){for(;1!=ye(t,e);e+=4+ye(t,e+2));return[yo(t,e+12),yo(t,e+4),yo(t,e+20)]},mt=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&C(9),e+=r+4}return e},ua=function(t,e,n,r,i,a,o,s){var l=r.length,u=n.extra,h=s&&s.length,c=mt(u);K(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)&&C(10),K(t,e,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),e+=4,null!=a&&(K(t,e,n.crc),K(t,e+4,a),K(t,e+8,n.size)),K(t,e+12,l),K(t,e+14,c),e+=16,null!=o&&(K(t,e,h),K(t,e+6,n.attrs),K(t,e+10,o),e+=14),t.set(r,e),e+=l,c)for(var p in u){var g=u[p],y=g.length;K(t,e,+p),K(t,e+2,y),t.set(g,e+4),e+=4+y}return h&&(t.set(s,e),e+=h),e},Eo=function(t,e,n,r,i){K(t,e,101010256),K(t,e+8,n),K(t,e+10,n),K(t,e+12,r),K(t,e+16,i)},mn=function(){function t(t){this.filename=t,this.c=aa(),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||C(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),im=function(){function t(t,e){var n=this;e||(e={}),mn.call(this,t),this.d=new $e(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=Vl(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){mn.prototype.push.call(this,t,e)},t}(),om=function(){function t(t,e){var n=this;e||(e={}),mn.call(this,t),this.d=new Pl(e,(function(t,e,r){n.ondata(t,e,r)})),this.compression=8,this.flag=Vl(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){mn.prototype.push.call(this,t,e)},t}(),sm=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||C(5),2&this.d)this.ondata(C(4+8*(1&this.d),0,1),null,!1);else{var n=ft(t.filename),r=n.length,i=t.comment,a=i&&ft(i),o=r!=t.filename.length||a&&i.length!=a.length,s=r+mt(t.extra)+30;r>65535&&this.ondata(C(11,0,1),null,!1);var l=new H(s);ua(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=hn(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 H(16);K(a,0,134695760),K(a,4,t.crc),K(a,8,p),K(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(C(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+mt(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];ua(a,t,l,l.f,l.u,l.c,e,l.o),t+=46+l.f.length+mt(l.extra)+(l.o?l.o.length:0),e+=l.b}Eo(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}(),Xl=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),cm=function(){function t(){var t=this;this.i=new xe((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}(),dm=function(){function t(t,e){var n=this;e<32e4?this.i=new xe((function(t,e){n.ondata(null,t,e)})):(this.i=new xo((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=Se(t,0)),this.i.push(t,e)},t.compression=8,t}(),pm=function(){function t(t){this.onfile=t,this.k=[],this.o={0:Xl},this.p=tt}return t.prototype.push=function(t,e){var n=this;if(this.onfile||C(5),this.p||C(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 H(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=ye(l,o+6),i=ye(l,o+8),c=2048&r,d=8&r,p=ye(l,o+26),g=ye(l,o+28);if(u>o+30+p+g){var y=[];f.k.unshift(y),a=2;var m=te(l,o+18),v=te(l,o+22),_=No(l.subarray(o+30,o+=30+p),!c);4294967295==m?(t=d?[-2]:Wl(l,o),m=t[0],v=t[1]):d&&(m=-1),o+=g,f.c=m;var w,b={name:_,compression:i,start:function(){if(b.ondata||C(5),m){var t=n.o[i];t||b.ondata(C(14,"unknown compression type "+i,1),null,!1),(w=m<0?new t(_):new t(_,m,v)).ondata=function(t,e,n){b.ondata(t,e,n)};for(var e=0,r=y;e<r.length;e++){var a=r[e];w.push(a,!1)}n.k[0]==y&&n.c?n.d=w:w.push(tt,!0)}else b.ondata(null,tt,!0)},terminate:function(){w&&w.terminate&&w.terminate()}};m>=0&&(b.size=m,b.originalSize=v),f.onfile(b)}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=tt,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&&C(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}(),ci="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()}}));g();var Yl=vn(Go());g(),g(),g();var $s=vn(Us());g();var Vs=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:r=0,distance:i=0,angle:a=0}){let o,s;if(p(this,"origin"),p(this,"destination"),p(this,"vortex"),p(this,"distance"),p(this,"angle"),p(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")}},kr=Vs;function Uh(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,$s.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 console.error(t),1}}function Vh(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,be,nt,Hs=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:r=!1}){p(this,"edges"),p(this,"nodesById"),p(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:Uh(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 kr({angle:Vh(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 kr({destination:e,elevationDelta:o,origin:n,vortex:t})),this.edges[e.id].push(new kr({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)}},Di=Hs;function $h(t){switch(t){case nt.DOWN:case nt.UP:return`${t} `;default:return""}}g(),g(),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"}(be||(be={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(nt||(nt={}));var br,Ws=class{constructor({origin:t,action:e,distance:n,atLocation:r,instruction:i}){p(this,"node"),p(this,"instruction"),p(this,"action"),p(this,"atLocation"),p(this,"type"),p(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} ${$h(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===be.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===be.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===be.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===be.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===be.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===ae.TURN&&r&&(this.instruction+=` at ${r.name}`))}},rt=Ws;(br||(br={})).NO_VALID_PATH="No Valid Path Available";var Mr=.1*Math.PI;function wr(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var Xs=class{constructor({locations:t,nodes:e,vortexes:n,maps:r,showVortexNames:i}){p(this,"graph"),p(this,"locationsByNodeId"),this.graph=new Di({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=-wr(a.angle,e.angle);Math.abs(t)<Math.abs(s)&&(o=e,s=t)}else o=e,s=-wr(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 rt({distance:0,instruction:br.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 rt({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=nt.NONE;if(null!=t.elevation&&null!=r.elevation){let e=t.elevation-r.elevation;e>0?i=nt.DOWN:e<0&&(i=nt.UP)}l.push(new rt({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 rt({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=-wr(h.angle,e.angle),i=t.reduce(((t,n)=>{let r=-wr(e.angle,n.angle);return Math.min(t,Math.abs(r))}),Math.PI);if(Math.abs(r)>=Mr||Math.abs(i)<=Mr){let t;t=r<=-Math.PI/4?be.RIGHT:r<=-Mr?be.SLIGHTRIGHT:r<=Mr?be.STRAIGHT:r<=Math.PI/4?be.SLIGHTLEFT:be.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let r=new rt({action:{bearing:t,referencePosition:"At",type:ae.TURN},atLocation:e,distance:c,origin:n});r.type=t,l.push(r)}else l.push(new rt({action:{bearing:t,referencePosition:"At",type:ae.TURN},distance:c,origin:n}));d+=c,c=0}}}t===a.length-1&&(l.push(new rt({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}}},Li=Xs;function Ks(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return Js(this.cover(e,n),e,n,t)}function Js(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},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(!f)return t._root=p,t;for(;f.length;)if((u=e>=(a=(g+m)/2))?g=a:m=a,(h=n>=(o=(y+v)/2))?y=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=(g+m)/2))?g=a:m=a,(h=n>=(o=(y+v)/2))?y=o:v=o}while((c=h<<1|u)==(d=(l>=o)<<1|s>=a));return i[d]=f,i[c]=p,t}function Ys(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)Js(this,o[n],s[n],t[n]);return this}function Zs(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 Qs(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function eu(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 ie(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function tu(t,e,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 ie(g,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(!(!(g=l.node)||(i=l.x0)>d||(a=l.y0)>f||(o=l.x1)<h||(s=l.y1)<c))if(g.length){var y=(i+o)/2,m=(a+s)/2;p.push(new ie(g[3],y,m,o,s),new ie(g[2],i,m,y,s),new ie(g[1],y,a,o,m),new ie(g[0],i,a,y,m)),(u=(e>=m)<<1|t>=y)&&(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,g.data),_=e-+this._y.call(null,g.data),w=v*v+_*_;if(w<n){var b=Math.sqrt(n=w);h=t-b,c=e-b,d=t+b,f=e+b,r=g.data}}return r}function au(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,g=this._y0,y=this._x1,m=this._y1;if(!f)return this;if(f.length)for(;;){if((u=a>=(s=(p+y)/2))?p=s:y=s,(h=o>=(l=(g+m)/2))?g=l:m=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 nu(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function ru(){return this._root}function iu(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function ou(t){var e,n,r,i,a,o,s=[],l=this._root;for(l&&s.push(new ie(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 ie(n,u,h,a,o)),(n=l[2])&&s.push(new ie(n,r,h,u,o)),(n=l[1])&&s.push(new ie(n,u,i,a,h)),(n=l[0])&&s.push(new ie(n,r,i,u,h))}return this}function su(t){var e,n=[],r=[];for(this._root&&n.push(new ie(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 ie(a,o,s,h,c)),(a=i[1])&&n.push(new ie(a,h,s,l,c)),(a=i[2])&&n.push(new ie(a,o,c,h,u)),(a=i[3])&&n.push(new ie(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 uu(t){return t[0]}function lu(t){return arguments.length?(this._x=t,this):this._x}function cu(t){return t[1]}function du(t){return arguments.length?(this._y=t,this):this._y}function va(t,e,n){var r=new Ri(null==e?uu:e,null==n?cu:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Ri(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 pu(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g(),g();var fe=va.prototype=Ri.prototype;fe.copy=function(){var t,e,n=new Ri(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=pu(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]=pu(e));return n},fe.add=Ks,fe.addAll=Ys,fe.cover=Zs,fe.data=Qs,fe.extent=eu,fe.find=tu,fe.remove=au,fe.removeAll=nu,fe.root=ru,fe.size=iu,fe.visit=ou,fe.visitAfter=su,fe.x=lu,fe.y=du;var Ce,ne,yt=class{constructor(t){z(this,Ce,void 0),p(this,"categories"),p(this,"locations"),p(this,"vortexes"),p(this,"maps"),p(this,"nodes"),p(this,"polygons"),p(this,"events"),p(this,"mapGroups"),p(this,"locationStates"),p(this,"locationRankings"),p(this,"rankings"),z(this,ne,{}),S(this,Ce,t)}get polygonsByMapId(){if(f(this,ne).polygonsByMapId)return f(this,ne).polygonsByMapId;let t,e={};for(let n=0,r=f(this,Ce).polygons.length;n<r;++n)t=f(this,Ce).polygons[n],e[t.map]||(e[t.map]=[]),e[t.map].push(t);return f(this,ne).polygonsByMapId=e,f(this,ne).polygonsByMapId}get nodesByMapId(){if(f(this,ne).nodesByMapId)return f(this,ne).nodesByMapId;let t,e={};for(let n=0,r=f(this,Ce).nodes.length;n<r;++n)t=f(this,Ce).nodes[n],e[t.map]||(e[t.map]=[]),e[t.map].push(t);return f(this,ne).nodesByMapId=e,f(this,ne).nodesByMapId}findNearestNodeOnMap(t,e){if(f(this,ne).nodeTreesByMap||(f(this,ne).nodeTreesByMap=new Map),!f(this,ne).nodeTreesByMap.has(t)){let e=this.nodesByMapId[t],n=va();n.x((t=>t.x)),n.y((t=>t.y)),n.addAll(e),f(this,ne).nodeTreesByMap.set(t,n)}return f(this,ne).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(f(this,ne).locationsByMapId)return f(this,ne).locationsByMapId;let t,e={};for(let n=0,r=f(this,Ce).locations.length;n<r;++n){t=f(this,Ce).locations[n];for(let n=0,r=t.polygons.length;n<r;++n)e[t.polygons[n].map]||(e[t.polygons[n].map]=[]),e[t.polygons[n].map].push(t)}return f(this,ne).locationsByMapId=e,f(this,ne).locationsByMapId}static create(t){return yt.instances.has(t)||yt.instances.set(t,new yt(t)),yt.instances.get(t)}static clear(){yt.instances.clear()}},Ci=yt;Ce=new WeakMap,ne=new WeakMap,p(Ci,"instances",new Map);var je=Ci;g(),g(),g(),g();var hu=" ",me=class{static get separator(){return hu}static set separator(t){hu=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+"°"+me.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+"°"+me.separator+a+"′"+me.separator+o+"″"}return r}static toLat(t,e,n){let r=me.toDms(me.wrap90(t),e,n);return null===r?"–":r.slice(1)+me.separator+(t<0?"S":"N")}static toLon(t,e,n){let r=me.toDms(me.wrap180(t),e,n);return null===r?"–":r+me.separator+(t<0?"W":"E")}static toBrng(t,e,n){let r=me.toDms(me.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=me.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 $=me,Z=Math.PI,R=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=$.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 R(e,n)}distanceTo(t,e=6371e3){if(t instanceof R||(t=R.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,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 R||(t=R.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 R||(t=R.parse(t));let e=t.initialBearingTo(this)+180;return $.wrap360(e)}midpointTo(t){t instanceof R||(t=R.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 R(c,d)}intermediatePointTo(t,e){if(t instanceof R||(t=R.parse(t)),this.equals(t))return new R(this.lat,this.lon);let n=this.lat.toRadians(),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),g=Math.atan2(p,Math.sqrt(d*d+f*f)),y=Math.atan2(f,d),m=g.toDegrees(),v=y.toDegrees();return new R(m,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 R(d,f)}static intersection(t,e,n,r){if(t instanceof R||(t=R.parse(t)),n instanceof R||(n=R.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(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 R(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)),g=Math.acos(Math.min(Math.max(f,-1),1)),y=Math.acos(Math.min(Math.max(p,-1),1)),m=l-(Math.sin(s-a)>0?g:2*Z-g),v=(Math.sin(s-a)>0?2*Z-y:y)-u;if(0==Math.sin(m)&&0==Math.sin(v)||Math.sin(m)*Math.sin(v)<0)return null;let _=-Math.cos(m)*Math.cos(v)+Math.sin(m)*Math.sin(v)*Math.cos(d),w=Math.atan2(Math.sin(d)*Math.sin(m)*Math.sin(v),Math.cos(v)+Math.cos(m)*_),b=Math.asin(Math.min(Math.max(Math.sin(i)*Math.cos(w)+Math.cos(i)*Math.sin(w)*Math.cos(l),-1),1)),M=a+Math.atan2(Math.sin(l)*Math.sin(w)*Math.cos(i),Math.cos(w)-Math.sin(i)*Math.sin(b)),x=b.toDegrees(),O=M.toDegrees();return new R(x,O)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof R||(t=R.parse(t)),e instanceof R||(e=R.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 R||(t=R.parse(t)),e instanceof R||(e=R.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(),g=f.toDegrees();return{lon1:$.wrap180(p),lon2:$.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof R||(t=R.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 R||(t=R.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 R(d,f)}rhumbMidpointTo(t){t instanceof R||(t=R.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 R(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 R||(t=R.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${$.toLat(this.lat,t,e)}, ${$.toLon(this.lon,t,e)}`}};g(),g(),g();var xr=class{constructor(t){p(this,"destinations",[]),this.destinations=t}};g();var ba,We,ka=class{constructor(t,e){z(this,ba,void 0),z(this,We,void 0),p(this,"distance",0),p(this,"path",[]),p(this,"instructions",[]),S(this,We,t),S(this,ba,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 p={...t,action:{...t.action},atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(r=null==(n=f(this,We))?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=f(this,We))?void 0:a._nodesById)?void 0:o[t.node.id]:void 0};return((null==(s=p.action)?void 0:s.type)===ae.TAKEVORTEX||(null==(l=p.action)?void 0:l.type)===ae.EXITVORTEX)&&(p.action.fromMap=null==(h=f(this,We)._mapsById)?void 0:h[null==(u=p.action)?void 0:u.fromMap.id],p.action.toMap=null==(d=f(this,We)._mapsById)?void 0:d[null==(c=p.action)?void 0:c.toMap.id]),p})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=f(this,We))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return f(this,ba)}};ba=new WeakMap,We=new WeakMap;var ot,it=class{constructor(t){z(this,ot,void 0),S(this,ot,t)}directionsTo(t,e){if(t instanceof xr){let n=[],r=this;for(let i=0;i<t.destinations.length;i++){let a=t.destinations[i],o=Ma(r),s=Ma(a),l=f(this,ot).navigator.getDirections({originIds:o,destinationNodeIds:s,accessible:(null==e?void 0:e.accessible)||!1}),u=new ka(f(this,ot),l);n.push(u),r=a}return n}{let n=Ma(this),r=Ma(t),i=f(this,ot).navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:(null==e?void 0:e.accessible)||!1});return new ka(f(this,ot),i)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}directionsToCallback(t,e){return this.directionsTo(t,e)}};ot=new WeakMap;var Hh=0,Wh="9999-12-31T00:00:00.000Z";function Xh(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||Hh),n=new Date(t.end||Wh);return e<r&&n>r}));return i?e.find((t=>t.value===i.type)):void 0}var Be,vt,_e,wa,xa,ja,_a=class extends it{constructor(t,e){super(t),z(this,Be,void 0),z(this,vt,void 0),z(this,_e,{}),p(this,"states"),p(this,"id",""),p(this,"name",""),p(this,"type",""),p(this,"description"),p(this,"sortOrder"),p(this,"logo"),p(this,"phone"),p(this,"social"),p(this,"color"),p(this,"shortName"),p(this,"detailsUrl"),p(this,"tags"),p(this,"externalId"),p(this,"showLabelWhenImagePresent"),p(this,"picture"),p(this,"operationHours"),p(this,"siblingGroups"),p(this,"gallery"),p(this,"categories",[]),z(this,wa,void 0),z(this,xa,[]),z(this,ja,void 0),S(this,Be,t),S(this,vt,e),Object.assign(this,e)}get polygons(){let t=f(this,_e).polygons;if(void 0!==t)return t;let e=[],n=f(this,wa),r=f(this,Be)._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 f(this,_e).polygons=e,e}set polygons(t){S(this,wa,t)}get rank(){let t=f(this,_e).rank;if(void 0!==t)return t;let e=f(this,Be).locationRankings;if(!e||!e.locations)return null;let n=e.locations.find((t=>t.ids.find((t=>t===this.id))));return n?(f(this,_e).rank=n.score,n.score):null}get nodes(){let t=f(this,_e).nodes;if(void 0!==t)return t;let e=[],n=f(this,xa),r=f(this,Be)._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 f(this,_e).nodes=e,e}set nodes(t){S(this,xa,t)}get parent(){let t=f(this,_e).parent;if(void 0!==t)return t;let e,n=f(this,Be)._locationsById,r=f(this,ja);return void 0!==r&&(e=n[r]),f(this,_e).parent=e,e}set parent(t){S(this,ja,t)}get state(){return Xh(this,f(this,Be).locationStates)}clone(){return new _a(f(this,Be),f(this,vt))}get nodeOperationHours(){let t=f(this,_e).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=f(this,vt).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return f(this,_e).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new _a(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 _a(t,e)))}catch(t){return console.error("Fetch Locations:",t),[]}}toJSON(){let t=f(this,vt);return delete t.color,t}},st=_a;Be=new WeakMap,vt=new WeakMap,_e=new WeakMap,wa=new WeakMap,xa=new WeakMap,ja=new WeakMap,g();var kt,Ta,qe,Ia,jr=class extends it{constructor(t,e){super(t),z(this,kt,void 0),z(this,Ta,void 0),z(this,qe,{}),p(this,"geometry"),p(this,"image"),p(this,"holes"),p(this,"textures"),p(this,"material"),p(this,"label"),p(this,"id",""),p(this,"map",""),p(this,"layer"),p(this,"layerId"),p(this,"name"),p(this,"externalId"),p(this,"vertexes"),p(this,"canvasBounds"),z(this,Ia,void 0),S(this,kt,t),S(this,Ta,e),Object.assign(this,e)}get locations(){let t=f(this,qe).locations;if(void 0!==t)return t;let e=[],n=je.instances.get(f(this,kt)).locationsByMapId[this.map],{id:r}=this;for(let t=0,i=n.length;t<i;++t){let i=n[t],a=i.polygons;if(Array.isArray(a))for(let t=0,n=a.length;t<n;++t)if(a[t].id===r){e.push(i);break}}return f(this,qe).locations=e,e}get entrances(){let t=f(this,qe).entrances;if(void 0!==t)return t;let e=[],n=f(this,Ia),r=f(this,kt)._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 f(this,qe).entrances=e,e}return[]}set entrances(t){S(this,Ia,t)}get rank(){let t=f(this,qe).rank;if(void 0!==t)return t;let{rankings:e}=f(this,kt);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(f(this,qe).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(f(this,qe).rank=null,null)}static hydrate(t,e){return t.map((t=>new jr(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,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await Q(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new jr(t,e)))}catch(t){return console.error("Fetch Polygons:",t),[]}}toJSON(){return f(this,Ta)}},At=jr;function fu(t){return/^[\da-f]{24}$/i.test(t)}function mu(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 Kh(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}${mu(n,null==(a=t.baseUrl)?void 0:a.includes("gateway"))}`:t.baseUrl+e+mu(n)}async function Q(t,e,n,r=!1){return Oa(t,e,n,r,!0)}async function Oa(t,e,n,r=!1,i=!1){let a=Kh(t,e,n,r),o=await _r(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 _r(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 ut()(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 gu([t,e],[n,r]){let i=new R(t,e),a=new R(n,r);return i.distanceTo(a)}function yu(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 R(n.target.x,n.target.y),a=new R(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,console.warn(n),console.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function Ma(t){var e;return t instanceof At?t.entrances.map((t=>t.id)):t instanceof st?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function vu(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=>{console.error(t)}))));await Promise.all(t)}catch(t){console.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 Bi(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)}}kt=new WeakMap,Ta=new WeakMap,qe=new WeakMap,Ia=new WeakMap;var za,Aa,Na,Tr=class{constructor(t,e){z(this,za,void 0),z(this,Aa,{}),z(this,Na,void 0),p(this,"name"),p(this,"externalId"),p(this,"parents"),p(this,"id"),p(this,"icon"),this.id=e.id,S(this,Na,e),S(this,za,t),Object.assign(this,e)}get locations(){let t=f(this,Aa).locations;if(void 0!==t)return t;let e=[],{locations:n}=f(this,za),{id:r}=this;for(let t=0,i=n.length;t<i;++t){let i=n[t],a=i.categories;if(Array.isArray(a))for(let t=0,n=a.length;t<n;++t)if(a[t]===r){e.push(i);break}}return f(this,Aa).locations=e,e}static hydrate(t,e){return t.map((t=>new Tr(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 Tr(t,e)))}catch(t){return console.error("Fetch Categories:",t),[]}}toJSON(){return f(this,Na)}},Nt=Tr;za=new WeakMap,Aa=new WeakMap,Na=new WeakMap,g();var Ea,Et,Sa,Or=class{constructor(t,e){z(this,Ea,void 0),z(this,Et,void 0),z(this,Sa,{}),p(this,"id",""),p(this,"type",""),p(this,"name",""),p(this,"description"),p(this,"image"),p(this,"startDate"),p(this,"endDate"),p(this,"showDate"),S(this,Et,e),S(this,Ea,t),Object.assign(this,e)}location(){let t=f(this,Sa).location;if(void 0!==t)return t;let e,n=f(this,Ea)._locationsById,r=f(this,Et).location;if(null!=r){let t=n[r];null!=t&&(e=t)}return f(this,Sa).location=e,e}static hydrate(t,e){return t.map((t=>new Or(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 Or(t,e)))}catch(t){return console.error("Fetch Events:",t),[]}}toJSON(){return f(this,Et)}},Ir=Or;Ea=new WeakMap,Et=new WeakMap,Sa=new WeakMap,g();var Pa,zr=class{constructor(t){z(this,Pa,void 0),p(this,"locations",[]),S(this,Pa,t),Object.assign(this,t)}static hydrate(t){return new zr(t)}static async fetch(t){try{let e=await Oa(t.options,"smart-labels/location-label-ranking",{venue:t.options.venue},!0);return new zr(e)}catch(t){return console.error("Fetch Location Rankings:",t),{}}}toJSON(){return f(this,Pa)}},qi=zr;Pa=new WeakMap,g();var Fa,Ar=class{constructor(t){z(this,Fa,void 0),p(this,"id",""),p(this,"name",""),p(this,"value",""),S(this,Fa,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Ar(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 Ar(t)))}catch(t){return console.error("Fetch Location States:",t),[]}}toJSON(){return f(this,Fa)}},Gi=Ar;Fa=new WeakMap,g(),g();var La,Ra,Da=class{constructor(t,e,n,r,i,a){p(this,"map"),p(this,"x",0),p(this,"y",0),p(this,"lat",0),p(this,"lon",0),z(this,La,{}),z(this,Ra,void 0),this.lat=t,this.lon=e,this.map="string"==typeof i?i:i.id,this.x=n,this.y=r,S(this,Ra,a)}absoluteDistanceTo(t){return gu([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=f(this,La).nearestNode;if(void 0!==t)return t;let e=je.instances.get(f(this,Ra)).findNearestNodeOnMap(this.map,this);return f(this,La).nearestNode=e,e}};La=new WeakMap,Ra=new WeakMap;var Ge,Ca,Ba,Er=class{constructor(t,e){z(this,Ge,void 0),z(this,Ca,{}),z(this,Ba,void 0),p(this,"id",""),p(this,"group",""),p(this,"name",""),p(this,"shortName",""),p(this,"elevation",0),p(this,"scale",0),p(this,"layers"),p(this,"x_scale"),p(this,"perspectiveId"),p(this,"scene"),p(this,"width",0),p(this,"height",0),p(this,"georeference",[]),p(this,"_scale",0),S(this,Ge,t),S(this,Ba,e),Object.assign(this,e),this._scale=yu(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t;return(null==(t=je.instances.get(f(this,Ge)))?void 0:t.polygonsByMapId[this.id])||[]}get locations(){var t;return(null==(t=je.instances.get(f(this,Ge)))?void 0:t.locationsByMapId[this.id])||[]}get nodes(){var t;return(null==(t=je.instances.get(f(this,Ge)))?void 0:t.nodesByMapId[this.id])||[]}get mapGroup(){let t=f(this,Ca).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&f(this,Ge)._mapGroupsById[e]||null;return f(this,Ca).mapGroup=n,n}createCoordinateByXY(t,e){let n,r=this.georeference[0],i=new R(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.getNorth(),u=n/this._scale,h=i.destinationPoint(u,180*l/Math.PI);return new Da(h.lat,h.lon,t,e,this.id,f(this,Ge))}createCoordinate(t,e){let n=this.georeference[0],r=new R(n.target.x,n.target.y),i=new R(t,e),a=r.distanceTo(i),o=(r.finalBearingTo(i)+360)%360*Math.PI/180||0,s=a*(1/this.scale),l=o+this.getNorth(),u=Math.sin(l)*s,h=Math.cos(l)*s;return new Da(t,e,n.control.x+u,n.control.y-h,this.id,f(this,Ge))}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],r=new R(e.target.x,e.target.y),i=new R(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,console.warn(e),console.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 Er(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 n=r.perspective;null!=n&&(r.perspectiveId=n.id,t.options.do2D?(e.indexOf("width")>-1&&(r.width=n.size&&n.size.width||n.width),e.indexOf("height")>-1&&(r.height=n.size&&n.size.height||n.height),e.indexOf("tiles")>-1&&(r.tiles=n.tiles),e.indexOf("original")>-1&&(r.original=n.original)):(e.indexOf("scene")>-1&&(r.scene=n.scene),n.layers?(r.layers.forEach((t=>{t.visible=!1})),n.layers.forEach(a)):r.layers.forEach((t=>{t.visible=!0})))),delete r.perspective}i[n]=new Er(t,r)}return i}catch(t){return console.error("Fetch Maps:",t),[]}}toJSON(){return f(this,Ba)}},Nr=Er;Ge=new WeakMap,Ca=new WeakMap,Ba=new WeakMap,g();var qa,St,Ga,Pr=class{constructor(t,e){z(this,qa,void 0),z(this,St,void 0),z(this,Ga,{}),p(this,"id",""),p(this,"name",""),S(this,St,e),S(this,qa,t),Object.assign(this,e)}get maps(){let t=f(this,Ga).maps;if(void 0!==t)return t;let e=[],{maps:n}=f(this,qa),{id:r}=f(this,St);for(let t=0,i=n.length;t<i;++t){let i=n[t];i.group===r&&e.push(i)}return f(this,Ga).maps=e,e}static hydrate(t,e){return t.map((t=>new Pr(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 Pr(t,e)))}catch(t){return console.error("Fetch Map Groups:",t),[]}}toJSON(){return f(this,St)}},Sr=Pr;qa=new WeakMap,St=new WeakMap,Ga=new WeakMap,g();var Xe,Ua,ge,Va,Dr=class extends it{constructor(t,e){super(t),z(this,Xe,void 0),z(this,Ua,void 0),z(this,ge,{}),p(this,"id",""),p(this,"map",""),p(this,"x",0),p(this,"y",0),p(this,"operationHours"),p(this,"externalId"),z(this,Va,void 0),S(this,Xe,t),S(this,Ua,e),Object.assign(this,e)}get lat(){var t;let e=f(this,ge).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=f(this,Xe)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return f(this,ge).cachedLatLon=n.createCoordinateByXY(this.x,this.y),f(this,ge).cachedLatLon.lat}get lon(){var t;let e=f(this,ge).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=f(this,Xe)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return f(this,ge).cachedLatLon=n.createCoordinateByXY(this.x,this.y),f(this,ge).cachedLatLon.lon}get paths(){let t=f(this,ge).paths;if(void 0!==t)return t;let e=[],n=f(this,Xe)._nodesById,r=f(this,Va);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 f(this,ge).paths=e,e}set paths(t){S(this,Va,t)}get locations(){var t;let e=f(this,ge).locations;if(void 0!==e)return e;let n=[],r=null==(t=je.instances.get(f(this,Xe)))?void 0:t.locationsByMapId[this.map],i=this.id;for(let t=0,e=r.length;t<e;++t){let e=r[t],a=e.nodes;if(Array.isArray(a))for(let t=0,r=a.length;t<r;++t)if(a[t].id===i){n.push(e);break}}return f(this,ge).locations=n,n}get polygon(){let t=f(this,ge).polygon;if(void 0!==t)return t;let e,n=je.instances.get(f(this,Xe)).polygonsByMapId[this.map],r=this.id;for(let t=0,i=n.length;t<i;++t){let i=n[t];i.entrances.map((t=>t.id)).includes(r)&&(e=i)}return f(this,ge).polygon=e,e}static hydrate(t,e){return t.map((t=>new Dr(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,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await Q(t.options,"node",n)).map((e=>new Dr(t,e)))}catch(t){return console.error("Fetch Nodes:",t),[]}}toJSON(){return f(this,Ua)}},Fr=Dr;Xe=new WeakMap,Ua=new WeakMap,ge=new WeakMap,Va=new WeakMap,g();var $a,Rr=class{constructor(t){z(this,$a,void 0),p(this,"polygons",[]),S(this,$a,t),Object.assign(this,t)}static hydrate(t){return new Rr(t)}static async fetch(t){try{let e=await Oa(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new Rr(e)}catch(t){return console.error("Fetch Rankings:",t),null}}toJSON(){return f(this,$a)}},Lr=Rr;$a=new WeakMap,g();var Ha,Cr=class{constructor(t){p(this,"id",""),z(this,Ha,void 0),S(this,Ha,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Cr(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 Cr(t)))}catch(t){return console.error("Fetch Theme:",t),[]}}toJSON(){return f(this,Ha)}},Ui=Cr;Ha=new WeakMap,g();var Wa,Xa,Pt,qr=class{constructor(t,e){z(this,Wa,void 0),z(this,Xa,void 0),z(this,Pt,{}),p(this,"defaultMap",""),p(this,"address",""),p(this,"city",""),p(this,"countrycode",""),p(this,"externalId",""),p(this,"id",""),p(this,"latitude"),p(this,"logo"),p(this,"longitude"),p(this,"metadata"),p(this,"name",""),p(this,"operationHours"),p(this,"postal",""),p(this,"slug",""),p(this,"state",""),p(this,"telephone",""),p(this,"tzid",""),p(this,"tzidOverride",""),p(this,"utcOffset",""),p(this,"website",""),S(this,Xa,t),S(this,Wa,e),Object.assign(this,e)}static hydrate(t,e){return new qr(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 qr(t,n[0])}catch(t){return console.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==f(this,Pt).isMultiBuilding){let t=f(this,Xa).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;f(this,Pt).isMultiBuilding=n}return f(this,Pt).isMultiBuilding}toJSON(){return f(this,Wa)}},Br=qr;Wa=new WeakMap,Xa=new WeakMap,Pt=new WeakMap,g();var Ka,Ur=class{constructor(t){p(this,"id",""),z(this,Ka,void 0),p(this,"name"),p(this,"type"),p(this,"weight"),p(this,"multiplier"),S(this,Ka,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Ur(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 Ur(t)))}catch(t){return console.error("Fetch Vortexes:",t),[]}}toJSON(){return f(this,Ka)}},Gr=Ur;function Jh(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 Yh(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 Zh(t){let e=[];return t.features.forEach((t=>{let n={...t.properties,icon:t.properties.picture};delete n.picture,e.push(n)})),e}function Qh(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 ef(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}Ka=new WeakMap,g();var ku=class{constructor(t){p(this,"mapExtent"),p(this,"stretchRatio"),p(this,"midLat"),p(this,"midLong"),p(this,"mapUnitRatio",1e6),p(this,"latDistance"),p(this,"longDistance"),p(this,"mapScale"),p(this,"widthInMapUnits"),p(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 R(a,i),l=new R(a,n),u=new R(e,o),h=new R(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 tf(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 bu=(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 af(t,e,n,r,i,a){let o=bu(t,n,r,i,a),s=bu(e,n,r,i,a);return o.concat(s)}function nf(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 rf(t){let e=[];return t.features.forEach((t=>{let n={...t.properties};e.push(n)})),e}function Mu(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=Qh(e),i=new ku(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]=af(d,o,a,p,f,i);let g=t.node.get(n);h.push(...tf(g,i))}));let d=Object.values(u).flat(),f=nf(e),p=n.map((t=>{let e=t.features[0].properties.id,n=c.get(e);return ef(t,u[e],n)})).flat(),g=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{g.set(t.properties.id,t.properties.entrances)}))}));let y=rf(r),m=Jh(o,g),v=Zh(i),_=Yh(o),w=t.manifest.features[0].properties.name,b=t.manifest.features[0].geometry.coordinates[0],M=t.manifest.features[0].geometry.coordinates[1],x=t.imageBinaries;return{locations:m,categories:v,nodes:h,maps:p,polygons:d,vortexes:f,mapGroups:y,locationStates:_,themes:[],venue:{name:w,latitude:M,longitude:b},imageBinaries:x}}g(),g(),g();var Mt,wt,Vi=[0,4,6,8,10],bt=()=>{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],Vi.map(((t,e)=>n.slice(t,e===Vi.length-1?void 0:Vi[e+1]).join(""))).join("-")};function wu(t){return/^[\da-f]{24}$/i.test(t)}function xu(){if(!Mt)try{let t="mi-uuid";(Mt=localStorage.getItem(t))||(Mt=bt(),localStorage.setItem(t,Mt))}catch(t){Mt="NLS-"+bt()}return Mt}function ju(){if(!wt)try{let t="mi-session";(wt=sessionStorage.getItem(t))||(wt=bt(),sessionStorage.setItem(t,wt))}catch(t){wt="NSS-"+bt()}return wt}var Hu,Wu,Ja,Ft,Dt,Ya,Lt,Rt,Ct,xt,Za,Bt,qt,Qa,Vu=vn(Uu()),mf=null==(Wu=null==(Hu=I)?void 0:Hu.env)?void 0:Wu.npm_package_version,$u=["websdk","web","webv2"],Xi=class{constructor(t){var e;z(this,Ja,void 0),z(this,Ft,void 0),z(this,Dt,void 0),z(this,Ya,void 0),z(this,Lt,void 0),z(this,Rt,void 0),z(this,Ct,void 0),z(this,xt,void 0),z(this,Za,void 0),z(this,Bt,void 0),z(this,qt,void 0),z(this,Qa,void 0),S(this,xt,t.clientId),S(this,Za,t.clientSecret),S(this,Bt,t.accessToken),S(this,Ct,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!f(this,Ct)&&f(this,xt)&&!wu(f(this,xt))&&(n="https://web-proxy.mappedin.com/a/"),S(this,Dt,n),S(this,Dt,f(this,Dt)+(t.venue+"/")),S(this,Ft,!1),S(this,Ja,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),S(this,Ya,$u.find((e=>e===t.context))||$u[0]),S(this,Lt,xu()),S(this,Rt,ju()),S(this,qt,new Set),S(this,Qa,t.platformString||"")}track(t,e){if(f(this,Ja))return;let n={...e,g:f(this,Ft)},r=f(this,Dt)+t+"?"+Vu.default.stringify(n),i={"mi-context":f(this,Ya),"mi-session":f(this,Rt),"mi-device":f(this,Lt),"mappedin-sdk-version":mf,"mappedin-platform-version":f(this,Qa)};f(this,Bt)?i.Authorization=`Bearer ${f(this,Bt)}`:f(this,Ct)||(i.Authorization=`Basic ${btoa(`${f(this,xt)}:${f(this,Za)}`)}`),ut()(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,end:e,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return f(this,Rt)}getDeviceID(){return f(this,Lt)}setGeolocationMode(t){S(this,Ft,t)}trackBlueDotEvent(t){t&&Object.values(Xi.BLUEDOT_EVENT).includes(t)&&!f(this,qt).has(t)?(this.track(t),f(this,qt).add(t)):console.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)}},Wi=Xi;Ja=new WeakMap,Ft=new WeakMap,Dt=new WeakMap,Ya=new WeakMap,Lt=new WeakMap,Rt=new WeakMap,Ct=new WeakMap,xt=new WeakMap,Za=new WeakMap,Bt=new WeakMap,qt=new WeakMap,Qa=new WeakMap,p(Wi,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var Ji,Vr=Wi,Ki={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,do2D:!1,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"}(Ji||(Ji={}));var lt,Vt,Gt={categories:Nt,locations:st,vortexes:Gr,maps:Nr,nodes:Fr,polygons:At,venue:Br,events:Ir,mapGroups:Sr,themes:Ui,locationStates:Gi,locationRankings:qi,rankings:Lr},Ut=class{constructor(t){p(this,"perspective"),p(this,"things"),p(this,"options"),z(this,lt,void 0),z(this,Vt,""),p(this,"updatedAt"),p(this,"categories",[]),p(this,"locations",[]),p(this,"vortexes",[]),p(this,"maps",[]),p(this,"nodes",[]),p(this,"polygons",[]),p(this,"venue",{}),p(this,"events",[]),p(this,"mapGroups",[]),p(this,"themes",[]),p(this,"locationStates",[]),p(this,"locationRankings",[]),p(this,"rankings"),p(this,"_categoriesById"),p(this,"_locationsById"),p(this,"_vortexesById"),p(this,"_mapsById"),p(this,"_nodesById"),p(this,"_polygonsById"),p(this,"_eventsById"),p(this,"_mapGroupsById"),p(this,"_locationStatesById"),p(this,"_locationRankingsById"),p(this,"_rankingsById"),p(this,"_categoriesByExternalId"),p(this,"_locationsByExternalId"),p(this,"_vortexesByExternalId"),p(this,"_mapsByExternalId"),p(this,"_nodesByExternalId"),p(this,"_polygonsByExternalId"),p(this,"_eventsByExternalId"),p(this,"_mapGroupsByExternalId"),p(this,"_locationStatesByExternalId"),p(this,"_locationRankingsByExternalId"),p(this,"_rankingsByExternalId"),p(this,"images"),p(this,"imageBinaries"),p(this,"scenes"),p(this,"analytics"),p(this,"navigator"),this.options=t,S(this,lt,je.create(this)),this.analytics=new Vr(t)}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=f(this,lt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),f(this,lt)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=f(this,lt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),f(this,lt)[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=Mu(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{S(this,Vt,t),n=JSON.parse(t)}catch(t){return void console.error("Unable to parse JSON",t)}else n=t,S(this,Vt,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!=Gt[e]&&"function"==typeof Gt[e].hydrate&&(this[e]=Gt[e].hydrate(i,this))}e&&await vu(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"]),fu(this.options.clientId)||(this.options.things.rankings&&delete this.options.things.rankings,this.options.things.locationRankings&&delete this.options.things.locationRankings);let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,r=n.length;t<r;++t){let r=n[t];Gt[r]&&e.push(Gt[r].fetch(this).then((t=>(this[r]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new Li({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 Gt)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 f(this,Vt)||JSON.stringify(this.toJSON())}};lt=new WeakMap,Vt=new WeakMap,g();var Xu={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"],locationRankings:[]},Zl=vn(Yu());g(),g();var re=function(){return re=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},re.apply(this,arguments)};function W(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 ue(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 en,gf="ENTRIES",Zu="KEYS",Qu="VALUES",le="",Yi=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=Ht(this._path),e=t.node,n=t.keys;if(Ht(n)===le)return{done:!1,value:this.result()};var r=e.get(Ht(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=Ht(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 Ht(e)})).filter((function(t){return t!==le})).join("")},t.prototype.value=function(){return Ht(this._path).node.get(le)},t.prototype.result=function(){switch(this._type){case Qu:return this.value();case Zu:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),Ht=function(t){return t[t.length-1]},yf=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 el(t,e,n,r,o,1,i,""),r},el=function(t,e,n,r,i,a,o,s){var l,u,h=a*o;try{t:for(var c=W(t.keys()),d=c.next();!d.done;d=c.next()){var f=d.value;if(f===le){var p=i[h-1];p<=n&&r.set(s,[t.get(f),p])}else{for(var g=a,y=0;y<f.length;++y,++g){for(var m=f[y],v=o*g,_=v-o,w=i[v],b=Math.max(0,g-n-1),M=Math.min(o-1,g+n),x=b;x<M;++x){var O=m!==e[x],E=i[_+x]+ +O,T=i[_+x+1]+1,k=i[v+x]+1,I=i[v+x+1]=Math.min(E,T,k);I<w&&(w=I)}if(w>n)continue t}el(t.get(f),e,n,r,i,g,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}}},Zi=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=ue(Hr(this._tree,e.slice(this._prefix.length)),2),a=i[0],o=i[1];if(void 0===a){var s=ue(to(o),2),l=s[0],u=s[1];try{for(var h=W(l.keys()),c=h.next();!c.done;c=h.next()){var d=c.value;if(d!==le&&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,vf(this._tree,t)},t.prototype.entries=function(){return new Yi(this,gf)},t.prototype.forEach=function(t){var e,n;try{for(var r=W(this),i=r.next();!i.done;i=r.next()){var a=ue(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 yf(this._tree,t,e)},t.prototype.get=function(t){var e=Qi(this._tree,t);return void 0!==e?e.get(le):void 0},t.prototype.has=function(t){var e=Qi(this._tree,t);return void 0!==e&&e.has(le)},t.prototype.keys=function(){return new Yi(this,Zu)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,eo(this._tree,t).set(le,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=eo(this._tree,t);return n.set(le,e(n.get(le))),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=eo(this._tree,t),r=n.get(le);return void 0===r&&n.set(le,r=e()),r},t.prototype.values=function(){return new Yi(this,Qu)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(e){var n,r,i=new t;try{for(var a=W(e),o=a.next();!o.done;o=a.next()){var s=ue(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}(),Hr=function(t,e,n){var r,i;if(void 0===n&&(n=[]),0===e.length||null==t)return[t,n];try{for(var a=W(t.keys()),o=a.next();!o.done;o=a.next()){var s=o.value;if(s!==le&&e.startsWith(s))return n.push([t,s]),Hr(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]),Hr(void 0,"",n)},Qi=function(t,e){var n,r;if(0===e.length||null==t)return t;try{for(var i=W(t.keys()),a=i.next();!a.done;a=i.next()){var o=a.value;if(o!==le&&e.startsWith(o))return Qi(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}}},eo=function(t,e){var n,r,i=e.length;t:for(var a=0;t&&a<i;){try{for(var o=(n=void 0,W(t.keys())),s=o.next();!s.done;s=o.next()){var l=s.value;if(l!==le&&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},vf=function(t,e){var n=ue(Hr(t,e),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(le),0===r.size)tl(i);else if(1===r.size){var a=ue(r.entries().next().value,2),o=a[0],s=a[1];al(i,o,s)}},tl=function(t){if(0!==t.length){var e=ue(to(t),2),n=e[0],r=e[1];if(n.delete(r),0===n.size)tl(t.slice(0,-1));else if(1===n.size){var i=ue(n.entries().next().value,2),a=i[0],o=i[1];a!==le&&al(t.slice(0,-1),a,o)}}},al=function(t,e,n){if(0!==t.length){var r=ue(to(t),2),i=r[0],a=r[1];i.set(a+e,n),i.delete(a)}},to=function(t){return t[t.length-1]},ao="or",kf="and",bf="and_not",jt=function(){function t(t){if(null==(null==t?void 0:t.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=re(re(re({},ro),t),{searchOptions:re(re({},il),t.searchOptions||{})}),this._index=new Zi,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=W(u),p=f.next();!p.done;p=f.next()){var g=p.value,y=o(t,g);if(null!=y){var m=s(y.toString(),g),v=this._fieldIds[g],_=new Set(m).size;this.addFieldLength(d,v,this._documentCount-1,_);try{for(var w=(r=void 0,W(m)),b=w.next();!b.done;b=w.next()){var M=l(b.value,g);M&&this.addTerm(v,d,M)}}catch(t){r={error:t}}finally{try{b&&!b.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=W(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=W(this._documentIds),g=p.next();!g.done;g=p.next()){var y=ue(g.value,2),m=y[0];if(f===y[1]){try{for(var v=(r=void 0,W(c)),_=v.next();!_.done;_=v.next()){var w=_.value,b=h(t,w);if(null!=b){var M=l(b.toString(),w),x=this._fieldIds[w],O=new Set(M).size;this.removeFieldLength(m,x,this._documentCount,O);try{for(var E=(a=void 0,W(M)),T=E.next();!T.done;T=E.next()){var k=u(T.value,w);k&&this.removeTerm(x,m,k)}}catch(t){a={error:t}}finally{try{T&&!T.done&&(o=E.return)&&o.call(E)}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(m),this._documentIds.delete(m),this._fieldLength.delete(m),void(this._documentCount-=1)}}}catch(t){e={error:t}}finally{try{g&&!g.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=W(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 Zi,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=W(i),s=o.next();!s.done;s=o.next()){var l=ue(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==e.filter||e.filter(g))&&a.push(g)}}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(sl),a},t.prototype.autoSuggest=function(t,e){var n,r,i,a;void 0===e&&(e={}),e=re(re({},_f),e);var o=new Map;try{for(var s=W(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!=(y=o.get(c))?(y.score+=h,y.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=W(o),p=f.next();!p.done;p=f.next()){var g=ue(p.value,2),y=g[0],m=g[1],v=(h=m.score,m.terms),_=m.count;d.push({suggestion:y,terms:v,score:h/_})}}catch(t){i={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return d.sort(sl),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(ro.hasOwnProperty(t))return no(ro,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,g=e.serializationVersion;if(1!==g&&2!==g)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var y=new t(n);y._documentCount=l,y._nextId=u,y._documentIds=Wr(h),y._fieldIds=c,y._fieldLength=Wr(d),y._avgFieldLength=f,y._storedFields=Wr(p),y._index=new Zi;try{for(var m=W(s),v=m.next();!v.done;v=m.next()){var _=ue(v.value,2),w=_[0],b=_[1],M=new Map;try{for(var x=(a=void 0,W(Object.keys(b))),O=x.next();!O.done;O=x.next()){var E=O.value,T=b[E];1===g&&(T=T.ds),M.set(parseInt(E,10),Wr(T))}}catch(t){a={error:t}}finally{try{O&&!O.done&&(o=x.return)&&o.call(x)}finally{if(a)throw a.error}}y._index.set(w,M)}}catch(t){r={error:t}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}return y},t.prototype.executeQuery=function(t,e){var n=this;if(void 0===e&&(e={}),"string"!=typeof t){var r=re(re(re({},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=re(re({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(jf(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=re(re({},this._options.searchOptions),e),u=(l.fields||this._options.fields).reduce((function(t,e){var n;return re(re({},t),((n={})[e]=no(t,e)||1,n))}),l.boost||{}),h=l.boostDocument,c=l.weights,d=l.maxFuzzy,f=re(re({},il.weights),c),p=f.fuzzy,g=f.prefix,y=this._index.get(t.term),m=this.termResults(t.term,t.term,1,y,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=W(o),b=w.next();!b.done;b=w.next()){var M=ue(b.value,2),x=M[0],O=M[1];if(I=x.length-t.term.length){null==s||s.delete(x);var E=g*x.length/(x.length+.3*I);this.termResults(t.term,x,E,O,u,h,m)}}}catch(t){n={error:t}}finally{try{b&&!b.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}if(s)try{for(var T=W(s.keys()),k=T.next();!k.done;k=T.next()){x=k.value;var I,A=ue(s.get(x),2),S=A[0];if(I=A[1]){E=p*x.length/(x.length+I);this.termResults(t.term,x,E,S,u,h,m)}}}catch(t){i={error:t}}finally{try{k&&!k.done&&(a=T.return)&&a.call(T)}finally{if(i)throw i.error}}return m},t.prototype.combineResults=function(t,e){if(void 0===e&&(e=ao),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(Mf[n])||new Map},t.prototype.toJSON=function(){var t,e,n,r,i=[];try{for(var a=W(this._index),o=a.next();!o.done;o=a.next()){var s=ue(o.value,2),l=s[0],u=s[1],h={};try{for(var c=(n=void 0,W(u)),d=c.next();!d.done;d=c.next()){var f=ue(d.value,2),p=f[0],g=f[1];h[p]=Object.fromEntries(g)}}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=W(Object.keys(i)),f=d.next();!f.done;f=d.next()){var p=f.value,g=i[p],y=this._fieldIds[p],m=r.get(y);if(null!=m){var v=m.size,_=this._avgFieldLength[y];try{for(var w=(u=void 0,W(m.keys())),b=w.next();!b.done;b=w.next()){var M=b.value,x=a?a(this._documentIds.get(M),e):1;if(x){var O=m.get(M),E=this._fieldLength.get(M)[y],T=n*g*x*xf(O,v,this._documentCount,E,_),k=o.get(M);if(k){k.score+=T,Tf(k.terms,t);var I=no(k.match,e);I?I.push(p):k.match[e]=[p]}else o.set(M,{score:T,terms:[t],match:(c={},c[e]=[p],c)})}}}catch(t){u={error:t}}finally{try{b&&!b.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,ul),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,ul),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=W(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=W(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}(),no=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},Mf=((en={})[ao]=function(t,e){var n,r;try{for(var i=W(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),ol(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},en[kf]=function(t,e){var n,r,i=new Map;try{for(var a=W(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;ol(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},en[bf]=function(t,e){var n,r;try{for(var i=W(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},en),nl=1.2,rl=.7,wf=.5,xf=function(t,e,n,r,i){return Math.log(1+(n-e+.5)/(e+.5))*(wf+t*(nl+1)/(t+nl*(1-rl+rl*r/i)))},jf=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}}},ro={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(If)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},il={combineWith:ao,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},_f={prefix:function(t,e,n){return e===n.length-1}},Tf=function(t,e){t.includes(e)||t.push(e)},ol=function(t,e){var n,r;try{for(var i=W(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}}},sl=function(t,e){var n=t.score;return e.score-n},ul=function(){return new Map},Wr=function(t){var e,n,r=new Map;try{for(var i=W(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},If=/[\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 Of=["0","1","2","3","4","5","6","7","8","9"],zf=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],Af=["0","1","2","3","4","5","6","7","8","9"],Nf=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],Dv=[...Of,...zf,...Af,...Nf],ll=["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 _t,Ae,dt,Ue,ce,an,nn,Xt,rn,Kt,Ze,Xr,Kr,pt,on,Jr,Yr,Zr,Hf,sn,un,lo,Ef=32,we=!1,Sf=120,io=0,oo=class{constructor(t){p(this,"_callback"),p(this,"_frameCount"),p(this,"_ordering"),p(this,"_supersededBy"),p(this,"name"),p(this,"_remainingFrameCount"),p(this,"_lastFrameTime"),p(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,we&&console.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}},ct=class{constructor(t){if(p(this,"_postponed"),p(this,"userdata"),p(this,"_priority"),p(this,"_group"),p(this,"name"),p(this,"_lastFrameTime"),p(this,"_callback"),p(this,"_complete"),p(this,"_scheduled"),p(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,we&&console.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},so=class{constructor(t){p(this,"_postponed"),p(this,"_onComplete"),p(this,"_priority"),p(this,"userdata"),p(this,"name"),p(this,"_tasks"),p(this,"_scheduledTasks"),p(this,"_scheduled"),p(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,we&&console.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}},cl=class{constructor(t){p(this,"_maxMillisecondsPerFrame"),p(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:Ef,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},uo=class{constructor(t){p(this,"_timer"),p(this,"_performance"),p(this,"_scheduledUpdatesByOrdering"),p(this,"_scheduledTasksByPriority"),p(this,"_postponedTasks"),p(this,"_requestAnimationFrameHandle"),p(this,"_updatesToRunThisFrame"),p(this,"_lastFrameTime",0),p(this,"_updatesRunLastFrame"),this._timer=null!=(null==t?void 0:t.timer)?t.timer:new cl,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new tn,this._scheduledTasksByPriority=new tn,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),we&&console.log("task scheduler instantiated")}clear(){for(let t of this._scheduledTasksByPriority.values())t._cancelled=!0;for(let t of this._postponedTasks.values())t._cancelled=!0;this._scheduledUpdatesByOrdering=new tn,this._scheduledTasksByPriority=new tn,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),we&&console.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle=requestAnimationFrame(this.update))}update(t){let e;this._timer.beginFrame(),this._performance&&(e=performance.now());let n=!1;we&&(0===io&&(n=!0),++io,io%=Sf);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&&console.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&&console.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&&console.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;console.assert(void 0!==n),Object.getPrototypeOf(n)===so.prototype&&(r=n,n=r._popTask()),console.assert(void 0!==n),console.assert(Object.getPrototypeOf(n)===ct.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),we&&console.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),we&&console.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)===so)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,we&&console.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),we&&console.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)===ct.prototype?t._cancelled=!0:"clear"in t&&t.clear(),we&&console.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)===ct.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)===ct.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,we&&console.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)===ct.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)===ct.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),we&&console.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===ct.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,we&&console.log("task priority changed",t.name,e)}},tn=class{constructor(){p(this,"_map"),p(this,"_size"),p(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(console.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 console.assert(t===this._size),t}},Ye=t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),Wt="",Pf=.09,Ff=1,Df=.025,Lf=.5,Rf=5e-4,Cf=5e-4,Bf=.01,qf=.05,dl=1,Gf=.01,Uf=.2,Vf={MappedinCategory:"categories",MappedinLocation:"locations"},$f={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:ll,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===I.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:Pf,PRIMARY_INDEX_WEIGHT:Ff,SECONDARY_INDEX_WEIGHT:Df,CATEGORY_NAME_WEIGHT:Lf,LOCATION_NAME_WEIGHT:dl,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:Rf,CATEGORY_LOCATION_TAGS_WEIGHT:Cf,CATEGORY_LOCATION_NAME_WEIGHT:Bf,PRIMARY_INDEX_TAGS_NAME_WEIGHT:qf,LOCATION_DEFAULT_RANK:dl,RATIO_OF_FUZZY_TO_EXACT:Gf,RATIO_OF_PREFIX_TO_EXACT:Uf}},pl=class{constructor(t,e){var n,r,i;z(this,Zr),z(this,_t,void 0),z(this,Ae,void 0),z(this,dt,void 0),z(this,Ue,void 0),z(this,ce,void 0),z(this,an,new uo({performance:!0})),z(this,nn,void 0),z(this,Xt,void 0),z(this,rn,new Map),z(this,Kt,0),z(this,Ze,(t=>{S(this,Kt,1+ +f(this,Kt)),f(this,an).scheduleUpdate(new oo({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),S(this,Kt,+f(this,Kt)-1),0===f(this,Kt)&&f(this,on).call(this)}}))})),z(this,Xr,(t=>{var e,n,r;let{SECONDARY_INDEX_WEIGHT:i,LOCATION_DEFAULT_RANK:a,PRIMARY_INDEX_TAGS_NAME_WEIGHT:o}=f(this,ce).constants,s=a;(null==(e=f(this,ce))?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),f(this,Ze).call(this,(()=>{f(this,Ae).add({name:Ye(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:a,rank:s})})),(null==(n=f(this,ce))?void 0:n.searchTags)&&Array.isArray(t.tags)&&t.tags.forEach((e=>{f(this,Ae).add({name:"",tag:Ye(e),id:"MappedinLocation_"+t.id,weight:o,rank:s})})),(null==(r=f(this,ce))?void 0:r.searchDescriptions)&&f(this,Ze).call(this,(()=>f(this,dt).add({description:Ye(t.description||""),id:"MappedinLocation_"+t.id,weight:i,rank:s})))})),z(this,Kr,(t=>{var e,n;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:r,CATEGORY_LOCATION_TAGS_WEIGHT:i,CATEGORY_LOCATION_NAME_WEIGHT:a,CATEGORY_NAME_WEIGHT:o}=f(this,ce).constants;f(this,Ze).call(this,(()=>f(this,Ae).add({name:Ye(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:o})));let s=t.locations.reduce(((t,e)=>t+` ${Wt} `+e.name),"")+` ${Wt}`;if((null==(e=f(this,ce))?void 0:e.searchDescriptionsInCategories)&&t.locations.forEach((e=>{null!=e.description&&f(this,Ze).call(this,(()=>f(this,Ue).add({id:"MappedinCategory_"+t.id,"category.locations.description":Ye(e.description),ref:e.name,weight:r})))})),null==(n=f(this,ce))?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+` ${Wt} `+e),""))+` ${Wt}`}),"");f(this,Ze).call(this,(()=>f(this,Ue).add({"category.locations.tags":Ye(e),id:"MappedinCategory_"+t.id,weight:i})))}f(this,Ze).call(this,(()=>f(this,Ue).add({"category.locations.name":Ye(s),id:"MappedinCategory_"+t.id,weight:a})))})),z(this,pt,void 0),z(this,on,void 0),z(this,Jr,(t=>{var e;let n=t.score,{object:r,id:i,weight:a,rank:o}=t,[s,l]=i.split("_"),u=r||f(this,_t).getCollectionItemById(Vf[s],l);return o&&(null==(e=f(this,ce))?void 0:e.useLocationRank)&&(n+=o),a&&(n*=a),{score:n,type:s,object:u}})),z(this,Yr,((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(`[^${Wt}]* `+n+` [^${Wt}]*`,"ig").exec(t[r]);null!=e&&(i=e[0].slice(1,-1))}e.matches.push({term:n,weight:t.weight,matchesOn:r,value:i})}))})),z(this,sn,void 0),z(this,un,void 0),S(this,Xt,new Vr({...t.options,testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)})),S(this,ce,{...$f,...e}),S(this,_t,t),S(this,nn,new Set(null==(n=f(this,ce))?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}=f(this,ce).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},p={fields:["description"],storeFields:c,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return(null==(n=f(this,nn))?void 0:n.has(t.toLowerCase()))?null:t.toLowerCase()}},g={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(null==(r=f(this,ce))?void 0:r.jsonIndex){let{primary:t,secondary:e,extra:n}=JSON.parse(null==(i=f(this,ce))?void 0:i.jsonIndex);S(this,Ae,jt.loadJS(t,d)),S(this,dt,jt.loadJS(e,p)),S(this,Ue,jt.loadJS(n,g))}else S(this,Ae,new jt(d)),S(this,dt,new jt(p)),S(this,Ue,new jt(g)),f(this,_t).locations.forEach(f(this,Xr)),f(this,_t).categories.forEach(f(this,Kr));S(this,pt,new Promise((t=>{S(this,on,t)}))),f(this,an).update(performance.now()),S(this,sn,Bi(((t,e)=>{f(this,Xt).trackSearchSuggest({query:t,hits:e})}),300)),S(this,un,Bi(((t,e)=>{f(this,Xt).trackSearch({query:t,hits:e})}),300))}async suggest(t){await f(this,pt);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}=f(this,ce).constants,o=f(this,Ae).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 f(this,sn).call(this,t,o.length),{total:o.length,hits:o.map((t=>({text:t.suggestion})))}}async search(t){await f(this,pt);let e=Bo(this,Zr,Hf).call(this,t);return f(this,un).call(this,t,e.length),e}async toJSON(){return await f(this,pt),JSON.stringify({primary:f(this,Ae),secondary:f(this,dt),extra:f(this,Ue)})}async addQuery(t){let e,n,{query:r,object:i,weight:a=1}=t;await f(this,pt),e=i instanceof st?"MappedinLocation":i instanceof Nt?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=f(this,rn).get(i),n||(n="Custom_"+bt(),f(this,rn).set(i,n))),f(this,Ae).add({id:n,weight:a,object:i,query:Ye(r)})}};_t=new WeakMap,Ae=new WeakMap,dt=new WeakMap,Ue=new WeakMap,ce=new WeakMap,an=new WeakMap,nn=new WeakMap,Xt=new WeakMap,rn=new WeakMap,Kt=new WeakMap,Ze=new WeakMap,Xr=new WeakMap,Kr=new WeakMap,pt=new WeakMap,on=new WeakMap,Jr=new WeakMap,Yr=new WeakMap,Zr=new WeakSet,Hf=function(t){let e=[],n=Ye(t);e=[...f(this,Ae).search(n),...f(this,dt).search(n),...f(this,Ue).search(n)].sort(((t,e)=>e.score-t.score));let r={};for(let t of e){let e=f(this,Jr).call(this,t);r[t.id]?r[t.id].score+=e.score:r[t.id]={...e,matches:[]},f(this,Yr).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))},sn=new WeakMap,un=new WeakMap,g(),function(t){t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(lo||(lo={}));var So=globalThis.fetch||Zl.default;function ut(){if(null==So)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return So}function Qv(t){So=t}var ec,tc,mm=null==(tc=null==(ec=I)?void 0:ec.env)?void 0:tc.npm_package_version;globalThis.btoa||(globalThis.btoa=Yl.encode);var gm=["ar"];function gn(t){let e={...Ki,things:Xu,...t};return e.headers={...e.headers,"mappedin-sdk-version":mm},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 ym(t){let e=gn({baseUrl:"https://api-gateway.mappedin.com/",...t}),n="public/1/"+(e.useDraftData?"draft/":""),r=new Ut({...e,baseUrl:e.baseUrl+n});return await r.fetch(),r}function tk(t){ym=t}var Po={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function ak(t){let e=gn({baseUrl:"https://api-gateway.mappedin.com/",...Po,...t}),{url:n,updated_at:r}=await vm(t),i=await ut()(n,{mode:"cors"}),{data:a,format:o="jsonstring"}=await i.json();if("jsonstring"!==o)throw new Error(`Unrecognized format ${o}`);let s=new Ut(e);return await s.hydrate(a,e.shouldPopulateBundledImagesAsBlobs),s.updatedAt=r,s}async function vm(t){let e=gn({baseUrl:"https://api-gateway.mappedin.com/",...Po,...t}),{version:n,venue:r}=t,i=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&gm.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return e.language=void 0,await _r(e,i)}async function nk(t,{url:e,updated_at:n}){let r=gn({baseUrl:"https://api-gateway.mappedin.com/",...Po,...t}),i=await ut()(e,{mode:"cors"}),{data:a,format:o="jsonstring"}=await i.json();if("jsonstring"!==o)throw new Error(`Unrecognized format${o}`);let s=new Ut(r);return await s.hydrate(a,r.shouldPopulateBundledImagesAsBlobs),s.updatedAt=n,s}async function Ql(t){let e=gn({baseUrl:"https://api-gateway.mappedin.com/",...Ki,...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 _r(e,i)}async function rk(t,e=!1){return new Promise((async(n,r)=>{try{let i=new TextDecoder,a=i.decode.bind(i),o=await Promise.resolve().then((()=>(Jl(),Kl)));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 Ql(t),s=new Uint8Array(await ut()(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=[],g=[];for(let t=0;t<d.length;t++){let[,e]=d[t];e.byteLength>=f?p.push(d[t]):e.byteLength<f&&g.push(d[t])}let y={};if(0===g.length)d.forEach((([t])=>{y[t]=JSON.parse(a(l[t]))})),n(y);else{let t=function({data:t}){let e=this;if("finished"===t[0]){let n=g[o];if(null!=n){let[t,r]=n;e.postMessage(["task",t]),e.postMessage(r,[r]),o++}let[r,i]=t[1];y[r]=i,s++}else if("error"===t[0]){let[,e]=t;c.forEach((t=>t.terminate())),r(e)}s===u.length&&(n(y),c.forEach((t=>t.terminate())))},i=URL.createObjectURL(e);for(let t=0;t<Math.min(h,g.length);t++)c.push(new Worker(i));let o=0,s=0;c.forEach((e=>{if(e.onmessage=t,null!=g[o]){let[t,n]=g[o];e.postMessage(["task",t]),e.postMessage(n,[n]),o++}})),p.forEach((([t])=>{y[t]=JSON.parse(a(l[t])),s++}))}}else{let{url:e}=await Ql(t),r=new Uint8Array(await ut()(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){console.warn("bad file",e)}}n(l)}}catch(t){r(t)}}))}export{lo as MAP_RENDER_MODE,Ut as Mappedin,Nt as MappedinCategory,Ji as MappedinCollectionType,Da as MappedinCoordinate,xr as MappedinDestinationSet,ka as MappedinDirections,Ir as MappedinEvent,st as MappedinLocation,Nr as MappedinMap,Sr as MappedinMapGroup,it as MappedinNavigatable,Fr as MappedinNode,At as MappedinPolygon,Lr as MappedinRankings,Br as MappedinVenue,Gr as MappedinVortex,pl as OfflineSearch,tk as __setGetVenueMock,nk as downloadBundle,rk as downloadVenueBundleMVF,ym as getVenue,ak as getVenueBundle,vm as getVenueBundleURL,Ql as getVenueMVFURL,ut as isomorphicFetch,Qv as setFetchFn};