@mappedin/mappedin-js 4.0.9 → 4.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/get-venue/index.d.ts +38 -5
- package/lib/esm/get-venue/index.js +1 -1
- package/lib/esm/navigator/index.d.ts +5 -5
- package/lib/esm/renderer/index.d.ts +283 -36
- package/lib/esm/renderer/index.js +1 -1
- package/lib/mappedin.js +1 -1
- package/lib/node/index.js +1 -1
- package/package.json +4 -3
|
@@ -66,6 +66,22 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue' {
|
|
|
66
66
|
* Note 2: This may behave a lot slower for large venues, especially those with many images. We are actively working on improving load times.
|
|
67
67
|
*/
|
|
68
68
|
export function getVenueBundle(userOptions: TGetVenueBundleOptions): Promise<Mappedin>;
|
|
69
|
+
/**
|
|
70
|
+
* Get the bundle URL and updated_at time.
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
export function getVenueBundleURL(userOptions: TGetVenueBundleOptions): Promise<{
|
|
74
|
+
url: string;
|
|
75
|
+
updated_at: string;
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* Download a bundle and return a Mappedin instance
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
export function downloadBundle(userOptions: any, { url, updated_at }: {
|
|
82
|
+
url: any;
|
|
83
|
+
updated_at: any;
|
|
84
|
+
}): Promise<Mappedin>;
|
|
69
85
|
}
|
|
70
86
|
|
|
71
87
|
declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.types' {
|
|
@@ -679,6 +695,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinMap' {
|
|
|
679
695
|
scale?: number;
|
|
680
696
|
x_scale?: number;
|
|
681
697
|
perspectiveId?: string;
|
|
698
|
+
scene: any;
|
|
682
699
|
width: number;
|
|
683
700
|
height: number;
|
|
684
701
|
georeference: TGeoReference[];
|
|
@@ -1356,7 +1373,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/navigator/Directive' {
|
|
|
1356
1373
|
atLocation?: ILocation;
|
|
1357
1374
|
type?: BEARING_TYPE;
|
|
1358
1375
|
distance: number;
|
|
1359
|
-
constructor({ origin, action, distance, atLocation, instruction
|
|
1376
|
+
constructor({ origin, action, distance, atLocation, instruction }: {
|
|
1360
1377
|
origin?: INode;
|
|
1361
1378
|
action?: IAction;
|
|
1362
1379
|
distance?: number;
|
|
@@ -1433,6 +1450,22 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue' {
|
|
|
1433
1450
|
* Note 2: This may behave a lot slower for large venues, especially those with many images. We are actively working on improving load times.
|
|
1434
1451
|
*/
|
|
1435
1452
|
export function getVenueBundle(userOptions: TGetVenueBundleOptions): Promise<Mappedin>;
|
|
1453
|
+
/**
|
|
1454
|
+
* Get the bundle URL and updated_at time.
|
|
1455
|
+
* @internal
|
|
1456
|
+
*/
|
|
1457
|
+
export function getVenueBundleURL(userOptions: TGetVenueBundleOptions): Promise<{
|
|
1458
|
+
url: string;
|
|
1459
|
+
updated_at: string;
|
|
1460
|
+
}>;
|
|
1461
|
+
/**
|
|
1462
|
+
* Download a bundle and return a Mappedin instance
|
|
1463
|
+
* @internal
|
|
1464
|
+
*/
|
|
1465
|
+
export function downloadBundle(userOptions: any, { url, updated_at }: {
|
|
1466
|
+
url: any;
|
|
1467
|
+
updated_at: any;
|
|
1468
|
+
}): Promise<Mappedin>;
|
|
1436
1469
|
}
|
|
1437
1470
|
|
|
1438
1471
|
declare module '@mappedin/mappedin-js/lib/esm/get-venue/navigator/NavigationGraph' {
|
|
@@ -1452,7 +1485,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/navigator/NavigationGrap
|
|
|
1452
1485
|
mapsById: {
|
|
1453
1486
|
[propName: string]: IMap;
|
|
1454
1487
|
};
|
|
1455
|
-
constructor({ nodes, vortexes, maps, showVortexNames
|
|
1488
|
+
constructor({ nodes, vortexes, maps, showVortexNames }: {
|
|
1456
1489
|
nodes: INode[];
|
|
1457
1490
|
vortexes: IVortex[];
|
|
1458
1491
|
maps: IMap[];
|
|
@@ -1491,7 +1524,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/navigator/Navigator' {
|
|
|
1491
1524
|
instructions: Directive[];
|
|
1492
1525
|
}
|
|
1493
1526
|
class Navigator {
|
|
1494
|
-
constructor({ locations, nodes, vortexes, maps, showVortexNames
|
|
1527
|
+
constructor({ locations, nodes, vortexes, maps, showVortexNames }: {
|
|
1495
1528
|
locations: ILocation[];
|
|
1496
1529
|
nodes: INode[];
|
|
1497
1530
|
vortexes: IVortex[];
|
|
@@ -1513,7 +1546,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/navigator/Navigator' {
|
|
|
1513
1546
|
* @param departFrom ILocation - optional, id and name of a location to represent start of journey
|
|
1514
1547
|
* @param arriveAt ILocation - optional, id and name of a location to represent end of journey
|
|
1515
1548
|
*/
|
|
1516
|
-
getDirections({ originIds, destinationNodeIds, accessible, departFrom, arriveAt
|
|
1549
|
+
getDirections({ originIds, destinationNodeIds, accessible, departFrom, arriveAt }: {
|
|
1517
1550
|
originIds: string[];
|
|
1518
1551
|
destinationNodeIds: string[];
|
|
1519
1552
|
accessible: boolean;
|
|
@@ -1579,7 +1612,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/navigator/Edge' {
|
|
|
1579
1612
|
distance: number;
|
|
1580
1613
|
angle: number;
|
|
1581
1614
|
weight: number;
|
|
1582
|
-
constructor({ origin, destination, vortex, elevationDelta, distance, angle
|
|
1615
|
+
constructor({ origin, destination, vortex, elevationDelta, distance, angle }: {
|
|
1583
1616
|
origin: INode;
|
|
1584
1617
|
destination: INode;
|
|
1585
1618
|
vortex?: IVortex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var ja=Object.create,pt=Object.defineProperty,$a=Object.getOwnPropertyDescriptor,Ua=Object.getOwnPropertyNames,Ha=Object.getPrototypeOf,Wa=Object.prototype.hasOwnProperty,Ka=(t,e,n)=>e in t?pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Xa=t=>pt(t,"__esModule",{value:!0}),Ja=(t,e)=>()=>(t&&(e=t(t=0)),e),P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),za=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let a of Ua(e))!Wa.call(t,a)&&"default"!==a&&pt(t,a,{get:()=>e[a],enumerable:!(n=$a(e,a))||n.enumerable});return t},mr=t=>za(Xa(pt(null!=t?ja(Ha(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),c=(t,e,n)=>(Ka(t,"symbol"!=typeof e?e+"":e,n),n),Mr=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},h=(t,e,n)=>(Mr(t,e,"read from private field"),n?n.call(t):e.get(t)),b=(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)},O=(t,e,n,a)=>(Mr(t,e,"write to private field"),a?a.call(t,n):e.set(t,n),n),f=Ja((()=>{})),vr=P(((t,e)=>{f(),function(n){var a="object"==typeof t&&t,r="object"==typeof e&&e&&e.exports==a&&e,i="object"==typeof global&&global;(i.global===i||i.window===i)&&(n=i);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,a,r,i=t.length%3,o="",u=-1,h=t.length-i;++u<h;)e=t.charCodeAt(u)<<16,n=t.charCodeAt(++u)<<8,a=t.charCodeAt(++u),o+=l.charAt((r=e+n+a)>>18&63)+l.charAt(r>>12&63)+l.charAt(r>>6&63)+l.charAt(63&r);return 2==i?(e=t.charCodeAt(u)<<8,n=t.charCodeAt(++u),o+=l.charAt((r=e+n)>>10)+l.charAt(r>>4&63)+l.charAt(r<<2&63)+"="):1==i&&(r=t.charCodeAt(u),o+=l.charAt(r>>2)+l.charAt(r<<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,a,r=0,i="",o=-1;++o<e;)a=l.indexOf(t.charAt(o)),n=r%4?64*n+a:a,r++%4&&(i+=String.fromCharCode(255&n>>(-2*r&6)));return i},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return h}));else if(a&&!a.nodeType)if(r)r.exports=h;else for(var c in h)h.hasOwnProperty(c)&&(a[c]=h[c]);else n.base64=h}(t)})),W=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.areaConversion=t.timeConversion=t.distanceConversion=t.altitudeKeys=t.latitudeKeys=t.longitudeKeys=t.MAXLON=t.MINLON=t.MAXLAT=t.MINLAT=t.earthRadius=t.sexagesimalPattern=void 0;t.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;t.earthRadius=6378137;t.MINLAT=-90;t.MAXLAT=90;t.MINLON=-180;t.MAXLON=180;t.longitudeKeys=["lng","lon","longitude",0];t.latitudeKeys=["lat","latitude",1];t.altitudeKeys=["alt","altitude","elevation","elev",2];t.distanceConversion={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144};t.timeConversion={m:60,h:3600,d:86400};var e={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};t.areaConversion=e,e.sqm=e.m2,e.sqkm=e.km2,e.sqft=e.ft2,e.sqyd=e.yd2,e.sqin=e.in2})),Ae=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t,e){return e.reduce((function(e,n){if(null==t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&void 0!==n&&void 0===e?(e=n,n):e}),void 0)};t.default=e})),Le=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)};t.default=e})),Re=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=function(t){return e.sexagesimalPattern.test(t.toString().trim())};t.default=n})),Ee=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),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 a=Number(n[2])/60||0,r=Number(n[4])/3600||0,i=parseFloat(n[1])+a+r;return["S","W"].includes(n[7])?-i:i};t.default=n})),bt=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=W(),a=(e=Ae())&&e.__esModule?e:{default:e};function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(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},r=(0,a.default)(t,e.longitude),o=(0,a.default)(t,e.latitude),s=(0,a.default)(t,e.altitude);return i({latitude:o,longitude:r},s?{altitude:s}:{})};t.default=s})),Hn=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Le()),n=i(Re()),a=i(Ee()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function t(i){return(0,e.default)(i)?!(parseFloat(i)>r.MAXLAT||i<r.MINLAT):!!(0,n.default)(i)&&t((0,a.default)(i))};t.default=o})),Kn=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Le()),n=i(Re()),a=i(Ee()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function t(i){return(0,e.default)(i)?!(parseFloat(i)>r.MAXLON||i<r.MINLON):!!(0,n.default)(i)&&t((0,a.default)(i))};t.default=o})),Jn=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(bt()),n=r(Hn()),a=r(Kn());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t){var r=(0,e.default)(t),i=r.latitude,o=r.longitude;if(Array.isArray(t)&&t.length>=2)return(0,a.default)(t[0])&&(0,n.default)(t[1]);if(void 0===i||void 0===o)return!1;var s=t[o],l=t[i];return!(void 0===l||void 0===s||!1===(0,n.default)(l)||!1===(0,a.default)(s))};t.default=i})),Ot=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Le()),n=o(Re()),a=o(Ee()),r=o(Jn()),i=o(bt());function o(t){return t&&t.__esModule?t:{default:t}}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}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,a.default)(o);if((0,r.default)(o)){var s=(0,i.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,r.default)(e)?t(e):e})):o};t.default=h})),Q=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=r(Ae()),a=r(Ot());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r){var i=(0,n.default)(t,e.latitudeKeys);if(null!=i){var o=t[i];return!0===r?o:(0,a.default)(o)}};t.default=i})),ee=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=r(Ae()),a=r(Ot());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r){var i=(0,n.default)(t,e.longitudeKeys);if(null!=i){var o=t[i];return!0===r?o:(0,a.default)(o)}};t.default=i})),re=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t*Math.PI/180};t.default=e})),ye=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return 180*t/Math.PI};t.default=e})),Ar=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Q()),n=o(ee()),a=o(re()),r=o(ye()),i=W();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,a.default)(s),f=(0,a.default)(u),p=(0,a.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)),v=(0,r.default)(y);return(v<i.MINLON||v>i.MAXLON)&&(y=(y+3*Math.PI)%(2*Math.PI)-Math.PI,v=(0,r.default)(y)),{latitude:(0,r.default)(g),longitude:v}};t.default=s})),Lr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",a=e.areaConversion[n];if(a)return t*a;throw new Error("Invalid unit used for area conversion.")};t.default=n})),Rr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",a=e.distanceConversion[n];if(a)return t*a;throw new Error("Invalid unit used for distance conversion.")};t.default=n})),Er=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),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})),Sr=P((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=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{!a&&null!=s.return&&s.return()}finally{if(r)throw i}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);if("Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))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,a=new Array(e);n<e;n++)a[n]=t[n];return a}f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(t){var e=Math.pow(10,12);return Math.round(t*e)/e},r=function(t){var n=e(t.toString().split("."),2),r=n[0],i=n[1],o=Math.abs(Number(r)),s=a(60*Number("0."+(i||0))),l=Math.floor(s),u=a(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=r})),er=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t>1?1:t<-1?-1:t};t.default=e})),ce=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Q()),n=o(ee()),a=o(re()),r=o(er()),i=W();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,r.default)(Math.sin((0,a.default)(h))*Math.sin((0,a.default)(l))+Math.cos((0,a.default)(h))*Math.cos((0,a.default)(l))*Math.cos((0,a.default)(u)-(0,a.default)(c))))*i.earthRadius;return Math.round(d/s)*s};t.default=s})),tr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ce())&&e.__esModule?e:{default:e};var a=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default;return a="function"==typeof a?a:n.default,e.slice().sort((function(e,n){return a(t,e)-a(t,n)}))};t.default=a})),kr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=tr())&&e.__esModule?e:{default:e};var a=function(t,e){return(0,n.default)(t,e)[0]};t.default=a})),$r=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(re()),n=i(Q()),a=i(ee()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t){var i=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,a.default)(t[o]),c=(0,n.default)(t[s]),d=(0,a.default)(t[l]);i+=((0,e.default)(d)-(0,e.default)(h))*Math.sin((0,e.default)(c))}i=i*r.earthRadius*r.earthRadius/2}return Math.abs(i)};t.default=o})),ar=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Q()),n=a(ee());function a(t){return t&&t.__esModule?t:{default:t}}var r=function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,a){var r=(0,e.default)(a),i=(0,n.default)(a);return{maxLat:Math.max(r,t.maxLat),minLat:Math.min(r,t.minLat),maxLng:Math.max(i,t.maxLng),minLng:Math.min(i,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})};t.default=r})),Hr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Q()),n=o(ee()),a=o(re()),r=o(ye()),i=W();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,a.default)(u),d=(0,a.default)(h),f=o/i.earthRadius,p=c-f,g=c+f,y=(0,a.default)(i.MAXLAT),v=(0,a.default)(i.MINLAT),m=(0,a.default)(i.MAXLON),b=(0,a.default)(i.MINLON);if(p>v&&g<y){var M=Math.asin(Math.sin(f)/Math.cos(c));(s=d-M)<b&&(s+=2*Math.PI),(l=d+M)>m&&(l-=2*Math.PI)}else p=Math.max(p,v),g=Math.min(g,y),s=b,l=m;return[{latitude:(0,r.default)(p),longitude:(0,r.default)(s)},{latitude:(0,r.default)(g),longitude:(0,r.default)(l)}]};t.default=s})),Xr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Q()),n=i(ee()),a=i(re()),r=i(ye());function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var i=t.length,o=t.reduce((function(t,r){var i=(0,a.default)((0,e.default)(r)),o=(0,a.default)((0,n.default)(r));return{X:t.X+Math.cos(i)*Math.cos(o),Y:t.Y+Math.cos(i)*Math.sin(o),Z:t.Z+Math.sin(i)}}),{X:0,Y:0,Z:0}),s=o.X/i,l=o.Y/i,u=o.Z/i;return{longitude:(0,r.default)(Math.atan2(l,s)),latitude:(0,r.default)(Math.atan2(u,Math.sqrt(s*s+l*l)))}};t.default=o})),Jr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ar())&&e.__esModule?e:{default:e};var a=function(t){var e=(0,n.default)(t),a=e.minLat+(e.maxLat-e.minLat)/2,r=e.minLng+(e.maxLng-e.minLng)/2;return{latitude:parseFloat(a.toFixed(6)),longitude:parseFloat(r.toFixed(6))}};t.default=a})),ir=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Q()),n=i(ee()),a=i(re()),r=i(ye());function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t,i){var o=(0,a.default)((0,n.default)(i))-(0,a.default)((0,n.default)(t)),s=Math.log(Math.tan((0,a.default)((0,e.default)(i))/2+Math.PI/4)/Math.tan((0,a.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,r.default)(Math.atan2(o,s))+360)%360};t.default=o})),Qr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ir())&&e.__esModule?e:{default:e};var a=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,r="function"==typeof a?a(t,e):(0,n.default)(t,e);if(isNaN(r))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(r/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=a})),sr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(ce()),n=a(er());function a(t){return t&&t.__esModule?t:{default:t}}var r=function(t,a,r){var i=(0,e.default)(a,t),o=(0,e.default)(t,r),s=(0,e.default)(a,r),l=Math.acos((0,n.default)((i*i+s*s-o*o)/(2*i*s))),u=Math.acos((0,n.default)((o*o+s*s-i*i)/(2*o*s)));return l>Math.PI/2?i:u>Math.PI/2?o:Math.sin(l)*i};t.default=r})),aa=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Q()),n=i(ee()),a=i(re()),r=i(ye());function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t,i){var o=(0,e.default)(i),s=(0,n.default)(i),l=(0,e.default)(t),u=(0,n.default)(t);return((0,r.default)(Math.atan2(Math.sin((0,a.default)(s)-(0,a.default)(u))*Math.cos((0,a.default)(o)),Math.cos((0,a.default)(l))*Math.sin((0,a.default)(o))-Math.sin((0,a.default)(l))*Math.cos((0,a.default)(o))*Math.cos((0,a.default)(s)-(0,a.default)(u))))+360)%360};t.default=o})),ia=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ce())&&e.__esModule?e:{default:e};function a(t){return(a="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 r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.default;return t.reduce((function(t,n){return"object"===a(t)&&null!==t.last&&(t.distance+=e(n,t.last)),t.last=n,t}),{last:null,distance:0}).distance};t.default=r})),da=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Q()),n=i(ee()),a=i(re()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t,i){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)(i),v=(0,n.default)(i),m=6356752.314245,b=1/298.257223563,M=(0,a.default)(v-g),w=Math.atan((1-b)*Math.tan((0,a.default)(parseFloat(p)))),O=Math.atan((1-b)*Math.tan((0,a.default)(parseFloat(y)))),N=Math.sin(w),P=Math.cos(w),_=Math.sin(O),E=Math.cos(O),I=M,x=100;do{var j=Math.sin(I),T=Math.cos(I);if(0===(d=Math.sqrt(E*j*(E*j)+(P*_-N*E*T)*(P*_-N*E*T))))return 0;s=N*_+P*E*T,l=Math.atan2(d,s),c=s-2*N*_/(h=1-(u=P*E*j/d)*u),isNaN(c)&&(c=0);var A=b/16*h*(4+b*(4-3*h));f=I,I=M+(1-A)*b*u*(l+A*d*(c+A*s*(2*c*c-1)))}while(Math.abs(I-f)>1e-12&&--x>0);if(0===x)return NaN;var L=h*(r.earthRadius*r.earthRadius-m*m)/(m*m),S=1+L/16384*(4096+L*(L*(320-175*L)-768)),R=L/1024*(256+L*(L*(74-47*L)-128)),B=R*d*(c+R/4*(s*(2*c*c-1)-R/6*c*(4*d*d-3)*(4*c*c-3))),k=m*S*(l-B);return Math.round(k/o)*o};t.default=o})),ca=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0};t.default=e})),la=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ce())&&e.__esModule?e:{default:e};var a=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,r=a(t,e),i=Number(e.time)-Number(t.time),o=r/i*1e3;return o};t.default=a})),fa=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ce())&&e.__esModule?e:{default:e};var a=function(t,e,a){return(0,n.default)(e,t)+(0,n.default)(t,a)===(0,n.default)(e,a)};t.default=a})),ha=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Q()),n=a(ee());function a(t){return t&&t.__esModule?t:{default:t}}var r=function(t,a){for(var r=!1,i=a.length,o=-1,s=i-1;++o<i;s=o)((0,n.default)(a[o])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(a[s])||(0,n.default)(a[s])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(a[o]))&&(0,e.default)(t)<((0,e.default)(a[s])-(0,e.default)(a[o]))*((0,n.default)(t)-(0,n.default)(a[o]))/((0,n.default)(a[s])-(0,n.default)(a[o]))+(0,e.default)(a[o])&&(r=!r);return r};t.default=r})),ga=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=sr())&&e.__esModule?e:{default:e};var a=function(t,e,a,r){return(0,n.default)(t,e,a)<r};t.default=a})),ya=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ce())&&e.__esModule?e:{default:e};var a=function(t,e,a){return(0,n.default)(t,e)<a};t.default=a})),Ma=P((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=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{!a&&null!=s.return&&s.return()}finally{if(r)throw i}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);if("Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))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,a=new Array(e);n<e;n++)a[n]=t[n];return a}f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=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),a=n[0],r=n[1];return{longitude:parseFloat(a),latitude:parseFloat(r)}}))};t.default=a})),ba=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0});var e={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(t,"computeDestinationPoint",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"convertArea",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"convertDistance",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"convertSpeed",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"decimalToSexagesimal",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"getAreaOfPolygon",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"getBounds",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"getBoundsOfDistance",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"getCenter",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"getCenterOfBounds",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"getCompassDirection",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(t,"toRad",{enumerable:!0,get:function(){return U.default}}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:function(){return $.default}});var n=X(Ar()),a=X(Lr()),r=X(Rr()),i=X(Er()),o=X(Sr()),s=X(kr()),l=X($r()),u=X(ar()),h=X(Hr()),c=X(Xr()),d=X(Jr()),p=X(Qr()),g=X(Ae()),y=X(bt()),v=X(ce()),m=X(sr()),b=X(aa()),M=X(Q()),w=X(ee()),O=X(ia()),N=X(da()),P=X(ir()),_=X(ca()),E=X(la()),I=X(Le()),x=X(fa()),j=X(ha()),T=X(ga()),A=X(ya()),L=X(Re()),S=X(Jn()),R=X(Hn()),B=X(Kn()),k=X(tr()),D=X(Ee()),F=X(Ot()),U=X(re()),C=X(ye()),$=X(Ma()),G=W();function X(t){return t&&t.__esModule?t:{default:t}}Object.keys(G).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return G[n]}})}))})),Ca=P(((t,e)=>{var n,a;f(),n=t,a=function(t){"use strict";var e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e&&e,n="URLSearchParams"in e,a="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in e,o="ArrayBuffer"in e;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)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');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 a&&(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 v(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&r&&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):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(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)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):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),a=0;a<e.length;a++)n[a]=String.fromCharCode(e[a]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(M)}),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)},a&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(e=e||{}).body;if(t instanceof b){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 m.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");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function M(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),a=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(a),decodeURIComponent(r))}})),e}function w(t){var e=new d;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var n=t.split(":"),a=n.shift().trim();if(a){var r=n.join(":").trim();e.append(a,r)}})),e}function O(t,e){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},O.error=function(){var t=new O(null,{status:0,statusText:""});return t.type="error",t};var N=[301,302,303,307,308];O.redirect=function(t,e){if(-1===N.indexOf(e))throw new RangeError("Invalid status code");return new O(null,{status:e,headers:{location:t}})},t.DOMException=e.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 P(n,a){return new Promise((function(i,s){var l=new b(n,a);if(l.signal&&l.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function c(){u.abort()}u.onload=function(){var t={status:u.status,statusText:u.statusText,headers:w(u.getAllResponseHeaders()||"")};t.url="responseURL"in u?u.responseURL:t.headers.get("X-Request-URL");var e="response"in u?u.response:u.responseText;setTimeout((function(){i(new O(e,t))}),0)},u.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.onabort=function(){setTimeout((function(){s(new t.DOMException("Aborted","AbortError"))}),0)},u.open(l.method,function(t){try{return""===t&&e.location.href?e.location.href:t}catch(e){return t}}(l.url),!0),"include"===l.credentials?u.withCredentials=!0:"omit"===l.credentials&&(u.withCredentials=!1),"responseType"in u&&(r?u.responseType="blob":o&&l.headers.get("Content-Type")&&-1!==l.headers.get("Content-Type").indexOf("application/octet-stream")&&(u.responseType="arraybuffer")),!a||"object"!=typeof a.headers||a.headers instanceof d?l.headers.forEach((function(t,e){u.setRequestHeader(e,t)})):Object.getOwnPropertyNames(a.headers).forEach((function(t){u.setRequestHeader(t,h(a.headers[t]))})),l.signal&&(l.signal.addEventListener("abort",c),u.onreadystatechange=function(){4===u.readyState&&l.signal.removeEventListener("abort",c)}),u.send(void 0===l._bodyInit?null:l._bodyInit)}))}P.polyfill=!0,e.fetch||(e.fetch=P,e.Headers=d,e.Request=b,e.Response=O),t.Headers=d,t.Request=b,t.Response=O,t.fetch=P,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?a(t):"function"==typeof define&&define.amd?define(["exports"],a):a(n.WHATWGFetch={})})),Ga=P(((t,e)=>{f(),Ca(),e.exports=self.fetch.bind(self)}));f();var ka=mr(vr());f(),f(),f();var Na=mr(ba());f();var _a=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:a=0,distance:r=0,angle:i=0}){let o,s;if(c(this,"origin"),c(this,"destination"),c(this,"vortex"),c(this,"distance"),c(this,"angle"),c(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=r,this.angle=i,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=a*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")}},gn=_a;function Du(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],a=(0,Na.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),r=e.control.x-n.control.x,i=e.control.y-n.control.y;return Math.sqrt(r*r+i*i)/a}catch(t){return console.error(t),1}}function Au(t,e){let n=t.x-e.x,a=t.y-e.y;return(Math.atan2(a,n)+2.5*Math.PI)%(2*Math.PI)}var U,Y,le,Ta=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:a=!1}){c(this,"edges"),c(this,"nodesById"),c(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:Du(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let r=t.filter((t=>!!this.mapsById[t.map])).map((t=>({...t,paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=r.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let i=e.map((t=>({...t,name:a?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));r.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e})=>{let n=this.nodesById[e];return new gn({angle:Au(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),i.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 a=e;for(;a<t.nodes.length;){let e=this.nodesById[t.nodes[a]];if(a++,null==e)continue;let r=this.mapsById[n.map].elevation||0,i=this.mapsById[e.map].elevation||0,o=Math.abs(r-i);this.edges[n.id].push(new gn({destination:e,elevationDelta:o,origin:n,vortex:t})),this.edges[e.id].push(new gn({destination:n,elevationDelta:o,origin:e,vortex:t}))}}}))}aStar(t,e,n){let a=t.map((t=>this.nodesById[t])).filter((t=>t)),r=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===a.length||0===r.length)return[];let i=[],o={},s={};for(a.forEach((t=>{let e=this.getShortestEuclideanDistance(t,r);i.push({origin:t,priority:e}),o[t.id]=null,s[t.id]=0})),i.sort(((t,e)=>t.priority-e.priority));i.length>0;){let t=i[0];if(r.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 a=e.vortex&&!1===e.vortex.accessible;if(n&&(a||!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,r);i.push({origin:e.destination,priority:t}),o[e.destination.id]=e}}i.splice(0,1),i.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let n,a=t.x-e.x,r=t.y-e.y,i=a*a+r*r;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(i)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let a=this.getDistance(t,n);return Math.min(e,a)}),Number.MAX_VALUE)}},lr=Ta;function Lu(t){switch(t){case le.DOWN:case le.UP:return`${t} `;default:return""}}f(),f(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}(U||(U={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(Y||(Y={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(le||(le={}));var yn,Ia=class{constructor({origin:t,action:e,distance:n,atLocation:a,instruction:r}){c(this,"node"),c(this,"instruction"),c(this,"action"),c(this,"atLocation"),c(this,"type"),c(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=a,this.instruction="",r?this.instruction=r:(null!=e&&e.type===U.DEPARTURE?this.instruction=null!=a?`Depart from ${a.name}`:"Depart from current location":null!=e&&e.type===U.ARRIVAL?this.instruction=null!=a?`Arrive at ${a.name}`:"Arrive at destination":null!=e&&e.type===U.TAKEVORTEX?this.instruction=`Take ${a&&a.name} ${Lu(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===U.EXITVORTEX?this.instruction=`Exit ${a&&a.name} at ${e.toMap.name}`:null!=e&&e.bearing===Y.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===Y.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===Y.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===Y.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===Y.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===U.TURN&&a&&(this.instruction+=` at ${a.name}`))}},fe=Ia;(yn||(yn={})).NO_VALID_PATH="No Valid Path Available";var mn=.1*Math.PI;function Mn(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var Oa=class{constructor({locations:t,nodes:e,vortexes:n,maps:a,showVortexNames:r}){c(this,"graph"),c(this,"locationsByNodeId"),this.graph=new lr({maps:a,nodes:e,showVortexNames:r,vortexes:n}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((n=>{t[n.node]=e})),e.polygons&&e.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{t[n]=e}))})),t)),{})}getClosestLocationInRay(t,e=.5*Math.PI,n=10){let a=0,r=0,i=t;for(;Math.abs(a)<e&&r<n;){let t=this.graph.edges[i.destination.id],o=null,s=0;for(let e of t)if(e.distance>0)if(null!=o){let t=-Mn(i.angle,e.angle);Math.abs(t)<Math.abs(s)&&(o=e,s=t)}else o=e,s=-Mn(i.angle,e.angle);if(null==o)return null;{if(Math.abs(s)>=e||(a+=s,r+=o.distance,Math.abs(a)>=e||r>n))return null;let t=this.locationsByNodeId[o.destination.id];if(null!=t)return t;i=o}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:n,departFrom:a,arriveAt:r}){let i=this.graph.aStar(t,e,n);if(0===i.length)return{distance:0,instructions:[new fe({distance:0,instruction:yn.NO_VALID_PATH})],path:[]};let o=0,s=new Array(i.length+1);for(let t=0;t<i.length;t++)s[t]=i[t].origin;s[i.length]=i[i.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let t=0;t<i.length;t++){let e=i[t],n=e.origin,s=e.destination;if(o+=e.distance,c+=(null==h?void 0:h.distance)||0,0===t&&l.push(new fe({action:{type:U.DEPARTURE},atLocation:a,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],a=this.graph.mapsById[s.map],r=le.NONE;if(null!=t.elevation&&null!=a.elevation){let e=t.elevation-a.elevation;e>0?r=le.DOWN:e<0&&(r=le.UP)}l.push(new fe({action:{direction:r,fromMap:t,toMap:a,type:U.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 fe({action:{fromMap:t,toMap:e,type:U.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 a=-Mn(h.angle,e.angle),r=t.reduce(((t,n)=>{let a=-Mn(e.angle,n.angle);return Math.min(t,Math.abs(a))}),Math.PI);if(Math.abs(a)>=mn||Math.abs(r)<=mn){let t;t=a<=-Math.PI/4?Y.RIGHT:a<=-mn?Y.SLIGHTRIGHT:a<=mn?Y.STRAIGHT:a<=Math.PI/4?Y.SLIGHTLEFT:Y.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let a=new fe({action:{bearing:t,referencePosition:"At",type:U.TURN},atLocation:e,distance:c,origin:n});a.type=t,l.push(a)}else l.push(new fe({action:{bearing:t,referencePosition:"At",type:U.TURN},distance:c,origin:n}));d+=c,c=0}}}t===i.length-1&&(l.push(new fe({action:{type:U.ARRIVAL},atLocation:r,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===U.TAKEVORTEX?(p=e.node,f.unshift(e)):n&&n.type===U.TURN&&null!=p?this.graph.getDistance(e.node,p)>5&&f.unshift(e):f.unshift(e)}return{distance:o,instructions:f,path:s}}},fr=Oa;f(),f(),f(),f();var wa=" ",K=class{static get separator(){return wa}static set separator(t){wa=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 a=null,r=null,i=null,o=null;switch(e){default:case"d":case"deg":r=t.toFixed(n),r<100&&(r="0"+r),r<10&&(r="0"+r),a=r+"°";break;case"dm":case"deg+min":r=Math.floor(t),i=(60*t%60).toFixed(n),60==i&&(i=(0).toFixed(n),r++),r=("000"+r).slice(-3),i<10&&(i="0"+i),a=r+"°"+K.separator+i+"′";break;case"dms":case"deg+min+sec":r=Math.floor(t),i=Math.floor(3600*t/60)%60,o=(3600*t%60).toFixed(n),60==o&&(o=(0).toFixed(n),i++),60==i&&(i=0,r++),r=("000"+r).slice(-3),i=("00"+i).slice(-2),o<10&&(o="0"+o),a=r+"°"+K.separator+i+"′"+K.separator+o+"″"}return a}static toLat(t,e,n){let a=K.toDms(K.wrap90(t),e,n);return null===a?"–":a.slice(1)+K.separator+(t<0?"S":"N")}static toLon(t,e,n){let a=K.toDms(K.wrap180(t),e,n);return null===a?"–":a+K.separator+(t<0?"W":"E")}static toBrng(t,e,n){let a=K.toDms(K.wrap360(t),e,n);return null===a?"–":a.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=K.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 L=K,k=Math.PI,N=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=L.wrap90(Number(t)),this._lon=L.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?L.wrap90(L.parse(t)):L.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?L.wrap90(L.parse(t)):L.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)?L.wrap180(L.parse(t)):L.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?L.wrap180(L.parse(t)):L.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?L.wrap180(L.parse(t)):L.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=L.wrap90(L.parse(e)),n=L.wrap180(L.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=L.wrap90(L.parse(e)),n=L.wrap180(L.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let a=t[0];if("Point"==a.type&&Array.isArray(a.coordinates)?[n,e]=a.coordinates:(null!=a.latitude&&(e=a.latitude),null!=a.lat&&(e=a.lat),null!=a.longitude&&(n=a.longitude),null!=a.lng&&(n=a.lng),null!=a.lon&&(n=a.lon),e=L.wrap90(L.parse(e)),n=L.wrap180(L.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 N(e,n)}distanceTo(t,e=6371e3){if(t instanceof N||(t=N.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,a=this.lat.toRadians(),r=this.lon.toRadians(),i=t.lat.toRadians(),o=i-a,s=t.lon.toRadians()-r,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(a)*Math.cos(i)*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 N||(t=N.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),a=(t.lon-this.lon).toRadians(),r=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(a),i=Math.sin(a)*Math.cos(n),o=Math.atan2(i,r).toDegrees();return L.wrap360(o)}finalBearingTo(t){t instanceof N||(t=N.parse(t));let e=t.initialBearingTo(this)+180;return L.wrap360(e)}midpointTo(t){t instanceof N||(t=N.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),a=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),i=Math.cos(e),o=0,s=Math.sin(e),l={x:i+Math.cos(a)*Math.cos(r),y:o+Math.cos(a)*Math.sin(r),z:s+Math.sin(a)},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 N(c,d)}intermediatePointTo(t,e){if(t instanceof N||(t=N.parse(t)),this.equals(t))return new N(this.lat,this.lon);let n=this.lat.toRadians(),a=this.lon.toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians(),o=r-n,s=i-a,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(n)*Math.cos(r)*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(a)+c*Math.cos(r)*Math.cos(i),f=h*Math.cos(n)*Math.sin(a)+c*Math.cos(r)*Math.sin(i),p=h*Math.sin(n)+c*Math.sin(r),g=Math.atan2(p,Math.sqrt(d*d+f*f)),y=Math.atan2(f,d),v=g.toDegrees(),m=y.toDegrees();return new N(v,m)}destinationPoint(t,e,n=6371e3){let a=t/n,r=Number(e).toRadians(),i=this.lat.toRadians(),o=this.lon.toRadians(),s=Math.sin(i)*Math.cos(a)+Math.cos(i)*Math.sin(a)*Math.cos(r),l=Math.asin(s),u=Math.sin(r)*Math.sin(a)*Math.cos(i),h=Math.cos(a)-Math.sin(i)*s,c=o+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new N(d,f)}static intersection(t,e,n,a){if(t instanceof N||(t=N.parse(t)),n instanceof N||(n=N.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(a))throw new TypeError(`invalid brng2 ‘${a}’`);let r=t.lat.toRadians(),i=t.lon.toRadians(),o=n.lat.toRadians(),s=n.lon.toRadians(),l=Number(e).toRadians(),u=Number(a).toRadians(),h=o-r,c=s-i,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(r)*Math.cos(o)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new N(t.lat,t.lon);let f=(Math.sin(o)-Math.sin(r)*Math.cos(d))/(Math.sin(d)*Math.cos(r)),p=(Math.sin(r)-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)),v=l-(Math.sin(s-i)>0?g:2*k-g),m=(Math.sin(s-i)>0?2*k-y:y)-u;if(0==Math.sin(v)&&0==Math.sin(m)||Math.sin(v)*Math.sin(m)<0)return null;let b=-Math.cos(v)*Math.cos(m)+Math.sin(v)*Math.sin(m)*Math.cos(d),M=Math.atan2(Math.sin(d)*Math.sin(v)*Math.sin(m),Math.cos(m)+Math.cos(v)*b),w=Math.asin(Math.min(Math.max(Math.sin(r)*Math.cos(M)+Math.cos(r)*Math.sin(M)*Math.cos(l),-1),1)),O=i+Math.atan2(Math.sin(l)*Math.sin(M)*Math.cos(r),Math.cos(M)-Math.sin(r)*Math.sin(w)),P=w.toDegrees(),_=O.toDegrees();return new N(P,_)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof N||(t=N.parse(t)),e instanceof N||(e=N.parse(e));let a=n;if(this.equals(t))return 0;let r=t.distanceTo(this,a)/a,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(r)*Math.sin(i-o))*a}alongTrackDistanceTo(t,e,n=6371e3){t instanceof N||(t=N.parse(t)),e instanceof N||(e=N.parse(e));let a=n;if(this.equals(t))return 0;let r=t.distanceTo(this,a)/a,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians(),s=Math.asin(Math.sin(r)*Math.sin(i-o));return Math.acos(Math.cos(r)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-i))*a}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 a=Number(n).toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians(),o=e.lat.toRadians(),s=e.lon.toRadians()-i,l=Math.sin(r)*Math.cos(o)*Math.cos(a)*Math.sin(s),u=Math.sin(r)*Math.cos(o)*Math.cos(a)*Math.cos(s)-Math.cos(r)*Math.sin(o)*Math.cos(a),h=Math.cos(r)*Math.cos(o)*Math.sin(a)*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=i+c+d,p=(i+c-d).toDegrees(),g=f.toDegrees();return{lon1:L.wrap180(p),lon2:L.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof N||(t=N.parse(t));let n=e,a=this.lat.toRadians(),r=t.lat.toRadians(),i=r-a,o=Math.abs(t.lon-this.lon).toRadians();Math.abs(o)>k&&(o=o>0?-(2*k-o):2*k+o);let s=Math.log(Math.tan(r/2+k/4)/Math.tan(a/2+k/4)),l=Math.abs(s)>1e-11?i/s:Math.cos(a);return Math.sqrt(i*i+l*l*o*o)*n}rhumbBearingTo(t){if(t instanceof N||(t=N.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),a=(t.lon-this.lon).toRadians();Math.abs(a)>k&&(a=a>0?-(2*k-a):2*k+a);let r=Math.log(Math.tan(n/2+k/4)/Math.tan(e/2+k/4)),i=Math.atan2(a,r).toDegrees();return L.wrap360(i)}rhumbDestinationPoint(t,e,n=6371e3){let a=this.lat.toRadians(),r=this.lon.toRadians(),i=Number(e).toRadians(),o=t/n,s=o*Math.cos(i),l=a+s;Math.abs(l)>k/2&&(l=l>0?k-l:-k-l);let u=Math.log(Math.tan(l/2+k/4)/Math.tan(a/2+k/4)),h=Math.abs(u)>1e-11?s/u:Math.cos(a),c=r+o*Math.sin(i)/h,d=l.toDegrees(),f=c.toDegrees();return new N(d,f)}rhumbMidpointTo(t){t instanceof N||(t=N.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),a=t.lat.toRadians(),r=t.lon.toRadians();Math.abs(r-n)>k&&(n+=2*k);let i=(e+a)/2,o=Math.tan(k/4+e/2),s=Math.tan(k/4+a/2),l=Math.tan(k/4+i/2),u=((r-n)*Math.log(l)+n*Math.log(s)-r*Math.log(o))/Math.log(s/o);isFinite(u)||(u=(n+r)/2);let h=i.toDegrees(),c=u.toDegrees();return new N(h,c)}static areaOf(t,e=6371e3){let n=e,a=t[0].equals(t[t.length-1]);a||t.push(t[0]);let r=t.length-1,i=0;for(let e=0;e<r;e++){let n=t[e].lat.toRadians(),a=t[e+1].lat.toRadians(),r=(t[e+1].lon-t[e].lon).toRadians();i+=2*Math.atan2(Math.tan(r/2)*(Math.tan(n/2)+Math.tan(a/2)),1+Math.tan(n/2)*Math.tan(a/2))}(function(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let a=0;a<t.length-1;a++){let r=t[a].initialBearingTo(t[a+1]),i=t[a].finalBearingTo(t[a+1]);e+=(r-n+540)%360-180,e+=(i-r+540)%360-180,n=i}return e+=(t[0].initialBearingTo(t[1])-n+540)%360-180,Math.abs(e)<90})(t)&&(i=Math.abs(i)-2*k);let o=Math.abs(i*n*n);return a||t.pop(),o}equals(t){return t instanceof N||(t=N.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`${L.toLat(this.lat,t,e)}, ${L.toLon(this.lon,t,e)}`}};f(),f(),f();var vn=class{constructor(t){c(this,"destinations",[]),this.destinations=t}};f();var Ce,se,Se=class{constructor(t,e){b(this,Ce,void 0),b(this,se,void 0),c(this,"distance",0),c(this,"path",[]),c(this,"instructions",[]),O(this,se,t),O(this,Ce,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,a,r,i,o,s,l,u,c,d,f;let p={...t,action:{...t.action},atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(a=null==(n=h(this,se))?void 0:n._vortexesById)?void 0:a[t.atLocation.id]:void 0,node:(null==(r=t.node)?void 0:r.id)?null==(o=null==(i=h(this,se))?void 0:i._nodesById)?void 0:o[t.node.id]:void 0};return((null==(s=p.action)?void 0:s.type)===U.TAKEVORTEX||(null==(l=p.action)?void 0:l.type)===U.EXITVORTEX)&&(p.action.fromMap=null==(c=h(this,se)._mapsById)?void 0:c[null==(u=p.action)?void 0:u.fromMap.id],p.action.toMap=null==(f=h(this,se)._mapsById)?void 0:f[null==(d=p.action)?void 0:d.toMap.id]),p})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=h(this,se))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return h(this,Ce)}};Ce=new WeakMap,se=new WeakMap;var he,pe=class{constructor(t){b(this,he,void 0),O(this,he,t)}directionsTo(t,e){if(t instanceof vn){let n=[],a=this;for(let r=0;r<t.destinations.length;r++){let i=t.destinations[r],o=Ve(a),s=Ve(i),l=h(this,he).navigator.getDirections({originIds:o,destinationNodeIds:s,accessible:(null==e?void 0:e.accessible)||!1}),u=new Se(h(this,he),l);n.push(u),a=i}return n}{let n=Ve(this),a=Ve(t),r=h(this,he).navigator.getDirections({originIds:n,destinationNodeIds:a,accessible:(null==e?void 0:e.accessible)||!1});return new Se(h(this,he),r)}}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)}};he=new WeakMap;var Ru=0,Eu="9999-12-31T00:00:00.000Z";function Bu(t,e,n=new Date){if(!t.states)return;let a=n||new Date,r=t.states.find((t=>{let e=new Date(t.start||Ru),n=new Date(t.end||Eu);return e<a&&n>a}));return r?e.find((t=>t.value===r.type)):void 0}var ae,me,Z,Ge,ke,Fe,je=class extends pe{constructor(t,e){super(t),b(this,ae,void 0),b(this,me,void 0),b(this,Z,{}),c(this,"states"),c(this,"id",""),c(this,"name",""),c(this,"type",""),c(this,"description"),c(this,"sortOrder"),c(this,"logo"),c(this,"phone"),c(this,"social"),c(this,"color"),c(this,"shortName"),c(this,"detailsUrl"),c(this,"tags"),c(this,"externalId"),c(this,"showLabelWhenImagePresent"),c(this,"picture"),c(this,"operationHours"),c(this,"siblingGroups"),c(this,"gallery"),c(this,"categories",[]),b(this,Ge,void 0),b(this,ke,[]),b(this,Fe,void 0),O(this,ae,t),O(this,me,e),Object.assign(this,e)}get polygons(){let t=h(this,Z).polygons;if(void 0!==t)return t;let e=[],n=h(this,Ge),a=h(this,ae)._polygonsById;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t){let r=a[n[t].id];null!=r&&r.geometry.visible&&e.push(r)}return h(this,Z).polygons=e,e}set polygons(t){O(this,Ge,t)}get rank(){let t=h(this,Z).rank;if(void 0!==t)return t;let e=h(this,ae).locationRankings;if(!e||!e.locations)return null;let n=e.locations.find((t=>t.ids.find((t=>t===this.id))));return n?(h(this,Z).rank=n.score,n.score):null}get nodes(){let t=h(this,Z).nodes;if(void 0!==t)return t;let e=[],n=h(this,ke),a=h(this,ae)._nodesById;if(n)for(let t=0,r=n.length;t<r;++t){let r=a[n[t].node];null!=r&&e.push(r)}return h(this,Z).nodes=e,e}set nodes(t){O(this,ke,t)}get parent(){let t=h(this,Z).parent;if(void 0!==t)return t;let e,n=h(this,ae)._locationsById,a=h(this,Fe);return void 0!==a&&(e=n[a]),h(this,Z).parent=e,e}set parent(t){O(this,Fe,t)}get state(){return Bu(this,h(this,ae).locationStates)}clone(){return new je(h(this,ae),h(this,me))}get nodeOperationHours(){let t=h(this,Z).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=h(this,me).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return h(this,Z).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new je(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&j(e,"categories"),t.options.things.nodes&&j(e,"nodes"),t.options.things.polygons&&j(e,"polygons"),t.options.things.locationStates&&j(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await F(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new je(t,e)))}catch(t){return console.error("Fetch Locations:",t),[]}}toJSON(){return h(this,me)}},Ie=je;ae=new WeakMap,me=new WeakMap,Z=new WeakMap,Ge=new WeakMap,ke=new WeakMap,Fe=new WeakMap,f();var Me,$e,ie,Ue,bn=class extends pe{constructor(t,e){super(t),b(this,Me,void 0),b(this,$e,void 0),b(this,ie,{}),c(this,"geometry"),c(this,"id",""),c(this,"map",""),c(this,"layer"),c(this,"layerId"),c(this,"name"),c(this,"externalId"),c(this,"vertexes"),c(this,"canvasBounds"),b(this,Ue,void 0),O(this,Me,t),O(this,$e,e),Object.assign(this,e)}get locations(){let t=h(this,ie).locations;if(void 0!==t)return t;let e=[],{locations:n}=h(this,Me),{id:a}=this;for(let t=0,r=n.length;t<r;++t){let r=n[t],i=r.polygons;if(Array.isArray(i))for(let t=0,n=i.length;t<n;++t)if(i[t].id===a){e.push(r);break}}return h(this,ie).locations=e,e}get entrances(){let t=h(this,ie).entrances;if(void 0!==t)return t;let e=[],n=h(this,Ue),a=h(this,Me)._nodesById;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;++t){let r=a[n[t].id];null!=r&&e.push(r)}return h(this,ie).entrances=e,e}return[]}set entrances(t){O(this,Ue,t)}get rank(){let t=h(this,ie).rank;if(void 0!==t)return t;let{rankings:e}=h(this,Me);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(h(this,ie).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(h(this,ie).rank=null,null)}static hydrate(t,e){return t.map((t=>new bn(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&j(e,"map"),t.options.things.nodes&&j(e,"entrances");let n={fields:e,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await F(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new bn(t,e)))}catch(t){return console.error("Fetch Polygons:",t),[]}}toJSON(){return h(this,$e)}},Oe=bn;function Pa(t){return/^[\da-f]{24}$/i.test(t)}function xa(t,e=!1){let n="";if(null!=t){let a="?",r=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,i=r.length;e<i;++e){let i=r[e],o=t[i];null!=o&&(n+=`${a+encodeURIComponent(i)}=${encodeURIComponent(o)}`,a="&")}}return n}function qu(t,e,n,a=!1){var r,i;return a?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:(null==(r=t.baseUrl)?void 0:r.includes("gateway"))?`${t.baseUrl}${e}/${n.venue||n.slug}${xa(n,null==(i=t.baseUrl)?void 0:i.includes("gateway"))}`:t.baseUrl+e+xa(n)}async function F(t,e,n,a=!1){return He(t,e,n,a,!0)}async function He(t,e,n,a=!1,r=!1){let i=qu(t,e,n,a),o=await pr(t,i,a);if(!r&&Array.isArray(o)){if(1===o.length)return o[0];throw new Error("Invalid response object")}return o}async function pr(t,e,n=!1){let a={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete a.language,a.language&&(e+=`&lang=${encodeURIComponent(a.language)}`);let{headers:r}=t;r["Content-Type"]="text/json",t.authorization&&(r.Authorization=t.authorization),a.language&&(r["Accept-Language"]=a.language);let i=await fetch(e,{method:"GET",headers:r});if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);return i.json()}function j(t,e){t.indexOf(e)<0&&t.push(e)}function Da([t,e],[n,a]){let r=new N(t,e),i=new N(n,a);return r.distanceTo(i)}function Aa(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],a=t.georeference[2],r=new N(n.target.x,n.target.y),i=new N(a.target.x,a.target.y),o=r.distanceTo(i),s=n.control.x-a.control.x,l=n.control.y-a.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 Ve(t){var e;return t instanceof Oe?t.entrances.map((t=>t.id)):t instanceof Ie?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function La(t){let e={},{maps:n,images:a,scenes:r,polygons:i}=t;if(null!=a)try{let t=Object.keys(a).map((t=>fetch(`data:image/png;base64,${a[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)&&!r[t.id]||(null!=r&&r[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>r[t.id]})),null!=a&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,a;if((null==(n=null==t?void 0:t.image)?void 0:n.url)&&(null==(a=null==t?void 0:t.image)?void 0:a.url)){let n=t.image.url.split("/"),a=e[n[n.length-1]];a&&(t.image.url=a)}}))))})),null!=a&&i.forEach((t=>{var n;if(null==(n=null==t?void 0:t.image)?void 0:n.url){let n=t.image.url.split("/"),a=e[n[n.length-1]];a&&(t.image.url=a)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}function Ra(t,e){let n,a,r,i=e.x,o=e.y,s=Number.MAX_SAFE_INTEGER;return t.forEach((t=>{a=t.x,r=t.y;let e=(i-a)**2+(o-r)**2;e<s&&(s=e,n=t)})),n}Me=new WeakMap,$e=new WeakMap,ie=new WeakMap,Ue=new WeakMap;var We,Ke,Xe,Nn=class{constructor(t,e){b(this,We,void 0),b(this,Ke,{}),b(this,Xe,void 0),c(this,"name"),c(this,"externalId"),c(this,"parents"),c(this,"id"),c(this,"icon"),this.id=e.id,O(this,Xe,e),O(this,We,t),Object.assign(this,e)}get locations(){let t=h(this,Ke).locations;if(void 0!==t)return t;let e=[],{locations:n}=h(this,We),{id:a}=this;for(let t=0,r=n.length;t<r;++t){let r=n[t],i=r.categories;if(Array.isArray(i))for(let t=0,n=i.length;t<n;++t)if(i[t]===a){e.push(r);break}}return h(this,Ke).locations=e,e}static hydrate(t,e){return t.map((t=>new Nn(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await F(t.options,"category",e)).map((e=>new Nn(t,e)))}catch(t){return console.error("Fetch Categories:",t),[]}}toJSON(){return h(this,Xe)}},_n=Nn;We=new WeakMap,Ke=new WeakMap,Xe=new WeakMap,f();var Je,we,ze,In=class{constructor(t,e){b(this,Je,void 0),b(this,we,void 0),b(this,ze,{}),c(this,"id",""),c(this,"type",""),c(this,"name",""),c(this,"description"),c(this,"image"),c(this,"startDate"),c(this,"endDate"),c(this,"showDate"),O(this,we,e),O(this,Je,t),Object.assign(this,e)}location(){let t=h(this,ze).location;if(void 0!==t)return t;let e,n=h(this,Je)._locationsById,a=h(this,we).location;if(null!=a){let t=n[a];null!=t&&(e=t)}return h(this,ze).location=e,e}static hydrate(t,e){return t.map((t=>new In(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&j(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await F(t.options,"event",n)).map((e=>new In(t,e)))}catch(t){return console.error("Fetch Events:",t),[]}}toJSON(){return h(this,we)}},Tn=In;Je=new WeakMap,we=new WeakMap,ze=new WeakMap,f();var Ye,On=class{constructor(t){b(this,Ye,void 0),c(this,"locations",[]),O(this,Ye,t),Object.assign(this,t)}static hydrate(t){return new On(t)}static async fetch(t){try{let e=await He(t.options,"smart-labels/location-label-ranking",{venue:t.options.venue},!0);return new On(e)}catch(t){return console.error("Fetch Location Rankings:",t),{}}}toJSON(){return h(this,Ye)}},hr=On;Ye=new WeakMap,f();var Ze,wn=class{constructor(t){b(this,Ze,void 0),c(this,"id",""),c(this,"name",""),c(this,"value",""),O(this,Ze,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new wn(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await F(t.options,"location-state",e)).map((t=>new wn(t)))}catch(t){return console.error("Fetch Location States:",t),[]}}toJSON(){return h(this,Ze)}},gr=wn;Ze=new WeakMap,f(),f();var et,tt,Qe=class{constructor(t,e,n,a,r,i){c(this,"map"),c(this,"x",0),c(this,"y",0),c(this,"lat",0),c(this,"lon",0),b(this,et,{}),b(this,tt,void 0),this.lat=t,this.lon=e,this.map="string"==typeof r?r:r.id,this.x=n,this.y=a,O(this,tt,i)}absoluteDistanceTo(t){return Da([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=h(this,et).nearestNode;if(void 0!==t)return t;let e=Ra(h(this,tt).nodes.filter((t=>t.map===this.map)),this);return h(this,et).nearestNode=e,e}};et=new WeakMap,tt=new WeakMap;var ge,ve,nt,xn=class{constructor(t,e){b(this,ge,void 0),b(this,ve,{}),b(this,nt,void 0),c(this,"id",""),c(this,"group",""),c(this,"name",""),c(this,"shortName",""),c(this,"elevation",0),c(this,"scale",0),c(this,"x_scale"),c(this,"perspectiveId"),c(this,"width",0),c(this,"height",0),c(this,"georeference",[]),c(this,"_scale",0),O(this,ge,t),O(this,nt,e),Object.assign(this,e),this._scale=Aa(this),this.scale=this.x_scale}get polygons(){let t=h(this,ve).polygons;if(void 0!==t)return t;let e=[],{polygons:n}=h(this,ge),{id:a}=this;for(let t=0,r=n.length;t<r;++t){let r=n[t];r.map===a&&e.push(r)}return h(this,ve).polygons=e,e}get mapGroup(){let t=h(this,ve).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&h(this,ge)._mapGroupsById[e]||null;return h(this,ve).mapGroup=n,n}createCoordinateByXY(t,e){let n=this.georeference[0],a=new N(n.target.x,n.target.y),r=t-n.control.x,i=n.control.y-e,o=Math.atan2(r,i),s=r/Math.sin(o),l=o-this.getNorth(),u=s/this._scale,c=a.destinationPoint(u,180*l/Math.PI);return new Qe(c.lat,c.lon,t,e,this.id,h(this,ge))}createCoordinate(t,e){let n=this.georeference[0],a=new N(n.target.x,n.target.y),r=new N(t,e),i=a.distanceTo(r),o=(a.finalBearingTo(r)+360)%360*Math.PI/180,s=i*(1/this.scale),l=o+this.getNorth(),u=Math.sin(l)*s,c=Math.cos(l)*s;return new Qe(t,e,n.control.x+u,n.control.y-c,this.id,h(this,ge))}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],a=new N(e.target.x,e.target.y),r=new N(n.target.x,n.target.y);t=-((a.finalBearingTo(r)+0)*Math.PI/180-Math.atan2(n.control.y-e.control.y,n.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,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 xn(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&j(e,"perspectives"),t.options.things.mapGroups&&j(e,"group"),j(e,"elevation"),j(e,"x_scale"),j(e,"scale"),j(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let r=await F(t.options,"map",n),i=t=>{let e=a.layers.find((e=>e.id===t));e?e.visible=!0:a.layers.push({id:t,visible:!0})};for(let n=0,o=r.length;n<o;++n){var a=r[n];if(a){let n=a.perspective;null!=n&&(a.perspectiveId=n.id,t.options.do2D?(e.indexOf("width")>-1&&(a.width=n.size&&n.size.width||n.width),e.indexOf("height")>-1&&(a.height=n.size&&n.size.height||n.height),e.indexOf("tiles")>-1&&(a.tiles=n.tiles),e.indexOf("original")>-1&&(a.original=n.original)):(e.indexOf("scene")>-1&&(a.scene=n.scene),n.layers?(a.layers.forEach((t=>{t.visible=!1})),n.layers.forEach(i)):a.layers.forEach((t=>{t.visible=!0})))),delete a.perspective}r[n]=new xn(t,a)}return r}catch(t){return console.error("Fetch Maps:",t),[]}}toJSON(){return h(this,nt)}},Pn=xn;ge=new WeakMap,ve=new WeakMap,nt=new WeakMap,f();var rt,Pe,at,An=class{constructor(t,e){b(this,rt,void 0),b(this,Pe,void 0),b(this,at,{}),c(this,"id",""),c(this,"name",""),O(this,Pe,e),O(this,rt,t),Object.assign(this,e)}get maps(){let t=h(this,at).maps;if(void 0!==t)return t;let e=[],{maps:n}=h(this,rt),{id:a}=h(this,Pe);for(let t=0,r=n.length;t<r;++t){let r=n[t];r.group===a&&e.push(r)}return h(this,at).maps=e,e}static hydrate(t,e){return t.map((t=>new An(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await F(t.options,"map-group",e)).map((e=>new An(t,e)))}catch(t){return console.error("Fetch Map Groups:",t),[]}}toJSON(){return h(this,Pe)}},Dn=An;rt=new WeakMap,Pe=new WeakMap,at=new WeakMap,f();var ue,it,X,ot,Rn=class extends pe{constructor(t,e){super(t),b(this,ue,void 0),b(this,it,void 0),b(this,X,{}),c(this,"id",""),c(this,"map",""),c(this,"x",0),c(this,"y",0),c(this,"operationHours"),c(this,"externalId"),b(this,ot,void 0),O(this,ue,t),O(this,it,e),Object.assign(this,e)}get lat(){var t;let e=h(this,X).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=h(this,ue)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return h(this,X).cachedLatLon=n.createCoordinateByXY(this.x,this.y),h(this,X).cachedLatLon.lat}get lon(){var t;let e=h(this,X).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=h(this,ue)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return h(this,X).cachedLatLon=n.createCoordinateByXY(this.x,this.y),h(this,X).cachedLatLon.lon}get paths(){let t=h(this,X).paths;if(void 0!==t)return t;let e=[],n=h(this,ue)._nodesById,a=h(this,ot);if(Array.isArray(a))for(let t=0,r=a.length;t<r;++t){let r=n[a[t].node];null!=r&&e.push(r)}return h(this,X).paths=e,e}set paths(t){O(this,ot,t)}get locations(){let t=h(this,X).locations;if(void 0!==t)return t;let e=[],{locations:n}=h(this,ue),a=this.id;for(let t=0,r=n.length;t<r;++t){let r=n[t],i=r.nodes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;++t)if(i[t].id===a){e.push(r);break}}return h(this,X).locations=e,e}get polygon(){let t=h(this,X).polygon;if(void 0!==t)return t;let e,{polygons:n}=h(this,ue),a=this.id;for(let t=0,r=n.length;t<r;++t){let r=n[t];r.entrances.map((t=>t.id)).includes(a)&&(e=r)}return h(this,X).polygon=e,e}static hydrate(t,e){return t.map((t=>new Rn(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&j(e,"map"),["weight","multiplier","accessible"].forEach((function(t){j(e,t)}));let n={fields:e,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await F(t.options,"node",n)).map((e=>new Rn(t,e)))}catch(t){return console.error("Fetch Nodes:",t),[]}}toJSON(){return h(this,it)}},Ln=Rn;ue=new WeakMap,it=new WeakMap,X=new WeakMap,ot=new WeakMap,f();var st,Bn=class{constructor(t){b(this,st,void 0),c(this,"polygons",[]),O(this,st,t),Object.assign(this,t)}static hydrate(t){return new Bn(t)}static async fetch(t){try{let e=await He(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new Bn(e)}catch(t){return console.error("Fetch Rankings:",t),null}}toJSON(){return h(this,st)}},En=Bn;st=new WeakMap,f();var ut,qn=class{constructor(t){c(this,"id",""),b(this,ut,void 0),O(this,ut,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new qn(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await F(t.options,"apollo-theme",e)).map((t=>new qn(t)))}catch(t){return console.error("Fetch Theme:",t),[]}}toJSON(){return h(this,ut)}},yr=qn;ut=new WeakMap,f();var dt,Cn=class{constructor(t){b(this,dt,void 0),c(this,"defaultMap",""),c(this,"address",""),c(this,"city",""),c(this,"countrycode",""),c(this,"externalId",""),c(this,"id",""),c(this,"latitude"),c(this,"logo"),c(this,"longitude"),c(this,"metadata"),c(this,"name",""),c(this,"operationHours"),c(this,"postal",""),c(this,"slug",""),c(this,"state",""),c(this,"telephone",""),c(this,"tzid",""),c(this,"tzidOverride",""),c(this,"utcOffset",""),c(this,"website",""),O(this,dt,t),Object.assign(this,t)}static hydrate(t){return new Cn(t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await F(t.options,"venue",e);return new Cn(n[0])}catch(t){return console.error("Fetch Venue:",t),{}}}toJSON(){return h(this,dt)}},Sn=Cn;dt=new WeakMap,f();var ct,Gn=class{constructor(t){c(this,"id",""),b(this,ct,void 0),c(this,"name"),c(this,"type"),c(this,"weight"),c(this,"multiplier"),O(this,ct,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Gn(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){j(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await F(t.options,"vortex",n)).map((t=>new Gn(t)))}catch(t){return console.error("Fetch Vortexes:",t),[]}}toJSON(){return h(this,ct)}},Vn=Gn;ct=new WeakMap;var Ba,Ea={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"}(Ba||(Ba={}));var be,_e,xe={categories:_n,locations:Ie,vortexes:Vn,maps:Pn,nodes:Ln,polygons:Oe,venue:Sn,events:Tn,mapGroups:Dn,themes:yr,locationStates:gr,locationRankings:hr,rankings:En},lt=class{constructor(t){c(this,"perspective"),c(this,"things"),c(this,"options"),b(this,be,{}),b(this,_e,""),c(this,"updatedAt"),c(this,"categories",[]),c(this,"locations",[]),c(this,"vortexes",[]),c(this,"maps",[]),c(this,"nodes",[]),c(this,"polygons",[]),c(this,"venue",{}),c(this,"events",[]),c(this,"mapGroups",[]),c(this,"themes",[]),c(this,"locationStates",[]),c(this,"locationRankings",[]),c(this,"rankings"),c(this,"_categoriesById"),c(this,"_locationsById"),c(this,"_vortexesById"),c(this,"_mapsById"),c(this,"_nodesById"),c(this,"_polygonsById"),c(this,"_eventsById"),c(this,"_mapGroupsById"),c(this,"_locationStatesById"),c(this,"_locationRankingsById"),c(this,"_rankingsById"),c(this,"_categoriesByExternalId"),c(this,"_locationsByExternalId"),c(this,"_vortexesByExternalId"),c(this,"_mapsByExternalId"),c(this,"_nodesByExternalId"),c(this,"_polygonsByExternalId"),c(this,"_eventsByExternalId"),c(this,"_mapGroupsByExternalId"),c(this,"_locationStatesByExternalId"),c(this,"_locationRankingsByExternalId"),c(this,"_rankingsByExternalId"),c(this,"images"),c(this,"scenes"),c(this,"navigator"),this.options=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=h(this,be)[n];if(void 0!==t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),h(this,be)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=h(this,be)[n];if(void 0!==t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),h(this,be)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,a=this[`_${t}ById`];return null!=a&&null!=a[e]||(a=this[n],null!=a&&null!=a[e])?a[e]:null}async hydrate(t,e){let n;if("string"==typeof t)try{O(this,_e,t),n=JSON.parse(t)}catch(t){return void console.error("Unable to parse JSON",t)}else n=t,O(this,_e,JSON.stringify(n));let a=Object.keys(n);for(let t=0,e=a.length;t<e;++t){let e=a[t],r=n[e];null!=xe[e]&&"function"==typeof xe[e].hydrate&&(this[e]=xe[e].hydrate(r,this))}e&&await La(n);let{images:r,scenes:i}=n;this.images=r,this.scenes=i,this.generateGetters(a),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"]),Pa(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,a=n.length;t<a;++t){let a=n[t];xe[a]&&e.push(xe[a].fetch(this).then((t=>(this[a]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator(),O(this,_e,JSON.stringify(this.toJSON()))}))}initNavigator(){this.navigator=new fr({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 xe)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));return{...e,venue:this.venue.toJSON(),rankings:null==(t=this.rankings)?void 0:t.toJSON()}}toString(){return h(this,_e)}};be=new WeakMap,_e=new WeakMap,f();var qa={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:[]};function Fa(t){let e={...Ea,things:qa,...t};return 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 tl(t){let e=Fa({baseUrl:"https://api-gateway.mappedin.com/",...t}),n=new lt({...e,baseUrl:e.baseUrl+"public/1/"});return await n.fetch(),n}Ga(),globalThis.btoa||(globalThis.btoa=ka.encode);var Su={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function nl(t){let e=Fa({baseUrl:"https://api-gateway.mappedin.com/",...Su,...t}),{version:n,venue:a}=t,r=`${t.bundleBaseUri||e.baseUrl+"exports/legacy/1/bundle"}?venue=${a}&version=1.0.0`,i=await pr(e,r),{url:o,updated_at:s}=i,l=await fetch(o,{mode:"cors"}),{data:u,format:h="jsonstring"}=await l.json();if("jsonstring"!==h)throw new Error(`Unrecognized format${h}`);let c=new lt(e);return await c.hydrate(u,e.shouldPopulateBundledImagesAsBlobs),c.updatedAt=s,c}export{lt as Mappedin,_n as MappedinCategory,Qe as MappedinCoordinate,vn as MappedinDestinationSet,Se as MappedinDirections,Tn as MappedinEvent,Ie as MappedinLocation,Pn as MappedinMap,Dn as MappedinMapGroup,pe as MappedinNavigatable,Ln as MappedinNode,Oe as MappedinPolygon,En as MappedinRankings,Sn as MappedinVenue,Vn as MappedinVortex,tl as getVenue,nl as getVenueBundle};
|
|
1
|
+
var Ua=Object.create,pt=Object.defineProperty,$a=Object.getOwnPropertyDescriptor,Ha=Object.getOwnPropertyNames,Wa=Object.getPrototypeOf,Ka=Object.prototype.hasOwnProperty,Xa=(t,e,n)=>e in t?pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ja=t=>pt(t,"__esModule",{value:!0}),za=(t,e)=>()=>(t&&(e=t(t=0)),e),x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ya=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let a of Ha(e))!Ka.call(t,a)&&"default"!==a&&pt(t,a,{get:()=>e[a],enumerable:!(n=$a(e,a))||n.enumerable});return t},vr=t=>Ya(Ja(pt(null!=t?Ua(Wa(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),c=(t,e,n)=>(Xa(t,"symbol"!=typeof e?e+"":e,n),n),br=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},h=(t,e,n)=>(br(t,e,"read from private field"),n?n.call(t):e.get(t)),b=(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)},w=(t,e,n,a)=>(br(t,e,"write to private field"),a?a.call(t,n):e.set(t,n),n),f=za((()=>{})),_r=x(((t,e)=>{f(),function(n){var a="object"==typeof t&&t,r="object"==typeof e&&e&&e.exports==a&&e,i="object"==typeof global&&global;(i.global===i||i.window===i)&&(n=i);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,a,r,i=t.length%3,o="",u=-1,h=t.length-i;++u<h;)e=t.charCodeAt(u)<<16,n=t.charCodeAt(++u)<<8,a=t.charCodeAt(++u),o+=l.charAt((r=e+n+a)>>18&63)+l.charAt(r>>12&63)+l.charAt(r>>6&63)+l.charAt(63&r);return 2==i?(e=t.charCodeAt(u)<<8,n=t.charCodeAt(++u),o+=l.charAt((r=e+n)>>10)+l.charAt(r>>4&63)+l.charAt(r<<2&63)+"="):1==i&&(r=t.charCodeAt(u),o+=l.charAt(r>>2)+l.charAt(r<<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,a,r=0,i="",o=-1;++o<e;)a=l.indexOf(t.charAt(o)),n=r%4?64*n+a:a,r++%4&&(i+=String.fromCharCode(255&n>>(-2*r&6)));return i},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return h}));else if(a&&!a.nodeType)if(r)r.exports=h;else for(var c in h)h.hasOwnProperty(c)&&(a[c]=h[c]);else n.base64=h}(t)})),W=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.areaConversion=t.timeConversion=t.distanceConversion=t.altitudeKeys=t.latitudeKeys=t.longitudeKeys=t.MAXLON=t.MINLON=t.MAXLAT=t.MINLAT=t.earthRadius=t.sexagesimalPattern=void 0;t.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;t.earthRadius=6378137;t.MINLAT=-90;t.MAXLAT=90;t.MINLON=-180;t.MAXLON=180;t.longitudeKeys=["lng","lon","longitude",0];t.latitudeKeys=["lat","latitude",1];t.altitudeKeys=["alt","altitude","elevation","elev",2];t.distanceConversion={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144};t.timeConversion={m:60,h:3600,d:86400};var e={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};t.areaConversion=e,e.sqm=e.m2,e.sqkm=e.km2,e.sqft=e.ft2,e.sqyd=e.yd2,e.sqin=e.in2})),Le=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t,e){return e.reduce((function(e,n){if(null==t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&void 0!==n&&void 0===e?(e=n,n):e}),void 0)};t.default=e})),Re=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)};t.default=e})),Ee=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=function(t){return e.sexagesimalPattern.test(t.toString().trim())};t.default=n})),Be=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),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 a=Number(n[2])/60||0,r=Number(n[4])/3600||0,i=parseFloat(n[1])+a+r;return["S","W"].includes(n[7])?-i:i};t.default=n})),bt=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=W(),a=(e=Le())&&e.__esModule?e:{default:e};function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(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},r=(0,a.default)(t,e.longitude),o=(0,a.default)(t,e.latitude),s=(0,a.default)(t,e.altitude);return i({latitude:o,longitude:r},s?{altitude:s}:{})};t.default=s})),Wn=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Re()),n=i(Ee()),a=i(Be()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function t(i){return(0,e.default)(i)?!(parseFloat(i)>r.MAXLAT||i<r.MINLAT):!!(0,n.default)(i)&&t((0,a.default)(i))};t.default=o})),Xn=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Re()),n=i(Ee()),a=i(Be()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function t(i){return(0,e.default)(i)?!(parseFloat(i)>r.MAXLON||i<r.MINLON):!!(0,n.default)(i)&&t((0,a.default)(i))};t.default=o})),zn=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(bt()),n=r(Wn()),a=r(Xn());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t){var r=(0,e.default)(t),i=r.latitude,o=r.longitude;if(Array.isArray(t)&&t.length>=2)return(0,a.default)(t[0])&&(0,n.default)(t[1]);if(void 0===i||void 0===o)return!1;var s=t[o],l=t[i];return!(void 0===l||void 0===s||!1===(0,n.default)(l)||!1===(0,a.default)(s))};t.default=i})),wt=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Re()),n=o(Ee()),a=o(Be()),r=o(zn()),i=o(bt());function o(t){return t&&t.__esModule?t:{default:t}}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}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,a.default)(o);if((0,r.default)(o)){var s=(0,i.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,r.default)(e)?t(e):e})):o};t.default=h})),Q=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=r(Le()),a=r(wt());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r){var i=(0,n.default)(t,e.latitudeKeys);if(null!=i){var o=t[i];return!0===r?o:(0,a.default)(o)}};t.default=i})),ee=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=r(Le()),a=r(wt());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r){var i=(0,n.default)(t,e.longitudeKeys);if(null!=i){var o=t[i];return!0===r?o:(0,a.default)(o)}};t.default=i})),re=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t*Math.PI/180};t.default=e})),ye=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return 180*t/Math.PI};t.default=e})),Rr=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Q()),n=o(ee()),a=o(re()),r=o(ye()),i=W();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,a.default)(s),f=(0,a.default)(u),p=(0,a.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)),v=(0,r.default)(y);return(v<i.MINLON||v>i.MAXLON)&&(y=(y+3*Math.PI)%(2*Math.PI)-Math.PI,v=(0,r.default)(y)),{latitude:(0,r.default)(g),longitude:v}};t.default=s})),Er=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",a=e.areaConversion[n];if(a)return t*a;throw new Error("Invalid unit used for area conversion.")};t.default=n})),Br=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",a=e.distanceConversion[n];if(a)return t*a;throw new Error("Invalid unit used for distance conversion.")};t.default=n})),qr=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),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})),Cr=x((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=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{!a&&null!=s.return&&s.return()}finally{if(r)throw i}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);if("Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))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,a=new Array(e);n<e;n++)a[n]=t[n];return a}f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(t){var e=Math.pow(10,12);return Math.round(t*e)/e},r=function(t){var n=e(t.toString().split("."),2),r=n[0],i=n[1],o=Math.abs(Number(r)),s=a(60*Number("0."+(i||0))),l=Math.floor(s),u=a(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=r})),tr=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t>1?1:t<-1?-1:t};t.default=e})),ce=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Q()),n=o(ee()),a=o(re()),r=o(tr()),i=W();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,r.default)(Math.sin((0,a.default)(h))*Math.sin((0,a.default)(l))+Math.cos((0,a.default)(h))*Math.cos((0,a.default)(l))*Math.cos((0,a.default)(u)-(0,a.default)(c))))*i.earthRadius;return Math.round(d/s)*s};t.default=s})),nr=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ce())&&e.__esModule?e:{default:e};var a=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default;return a="function"==typeof a?a:n.default,e.slice().sort((function(e,n){return a(t,e)-a(t,n)}))};t.default=a})),jr=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=nr())&&e.__esModule?e:{default:e};var a=function(t,e){return(0,n.default)(t,e)[0]};t.default=a})),Hr=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(re()),n=i(Q()),a=i(ee()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t){var i=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,a.default)(t[o]),c=(0,n.default)(t[s]),d=(0,a.default)(t[l]);i+=((0,e.default)(d)-(0,e.default)(h))*Math.sin((0,e.default)(c))}i=i*r.earthRadius*r.earthRadius/2}return Math.abs(i)};t.default=o})),ir=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Q()),n=a(ee());function a(t){return t&&t.__esModule?t:{default:t}}var r=function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,a){var r=(0,e.default)(a),i=(0,n.default)(a);return{maxLat:Math.max(r,t.maxLat),minLat:Math.min(r,t.minLat),maxLng:Math.max(i,t.maxLng),minLng:Math.min(i,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})};t.default=r})),Kr=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Q()),n=o(ee()),a=o(re()),r=o(ye()),i=W();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,a.default)(u),d=(0,a.default)(h),f=o/i.earthRadius,p=c-f,g=c+f,y=(0,a.default)(i.MAXLAT),v=(0,a.default)(i.MINLAT),m=(0,a.default)(i.MAXLON),b=(0,a.default)(i.MINLON);if(p>v&&g<y){var M=Math.asin(Math.sin(f)/Math.cos(c));(s=d-M)<b&&(s+=2*Math.PI),(l=d+M)>m&&(l-=2*Math.PI)}else p=Math.max(p,v),g=Math.min(g,y),s=b,l=m;return[{latitude:(0,r.default)(p),longitude:(0,r.default)(s)},{latitude:(0,r.default)(g),longitude:(0,r.default)(l)}]};t.default=s})),zr=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Q()),n=i(ee()),a=i(re()),r=i(ye());function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var i=t.length,o=t.reduce((function(t,r){var i=(0,a.default)((0,e.default)(r)),o=(0,a.default)((0,n.default)(r));return{X:t.X+Math.cos(i)*Math.cos(o),Y:t.Y+Math.cos(i)*Math.sin(o),Z:t.Z+Math.sin(i)}}),{X:0,Y:0,Z:0}),s=o.X/i,l=o.Y/i,u=o.Z/i;return{longitude:(0,r.default)(Math.atan2(l,s)),latitude:(0,r.default)(Math.atan2(u,Math.sqrt(s*s+l*l)))}};t.default=o})),Yr=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ir())&&e.__esModule?e:{default:e};var a=function(t){var e=(0,n.default)(t),a=e.minLat+(e.maxLat-e.minLat)/2,r=e.minLng+(e.maxLng-e.minLng)/2;return{latitude:parseFloat(a.toFixed(6)),longitude:parseFloat(r.toFixed(6))}};t.default=a})),or=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Q()),n=i(ee()),a=i(re()),r=i(ye());function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t,i){var o=(0,a.default)((0,n.default)(i))-(0,a.default)((0,n.default)(t)),s=Math.log(Math.tan((0,a.default)((0,e.default)(i))/2+Math.PI/4)/Math.tan((0,a.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,r.default)(Math.atan2(o,s))+360)%360};t.default=o})),ta=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=or())&&e.__esModule?e:{default:e};var a=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,r="function"==typeof a?a(t,e):(0,n.default)(t,e);if(isNaN(r))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(r/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=a})),ur=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(ce()),n=a(tr());function a(t){return t&&t.__esModule?t:{default:t}}var r=function(t,a,r){var i=(0,e.default)(a,t),o=(0,e.default)(t,r),s=(0,e.default)(a,r),l=Math.acos((0,n.default)((i*i+s*s-o*o)/(2*i*s))),u=Math.acos((0,n.default)((o*o+s*s-i*i)/(2*o*s)));return l>Math.PI/2?i:u>Math.PI/2?o:Math.sin(l)*i};t.default=r})),oa=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Q()),n=i(ee()),a=i(re()),r=i(ye());function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t,i){var o=(0,e.default)(i),s=(0,n.default)(i),l=(0,e.default)(t),u=(0,n.default)(t);return((0,r.default)(Math.atan2(Math.sin((0,a.default)(s)-(0,a.default)(u))*Math.cos((0,a.default)(o)),Math.cos((0,a.default)(l))*Math.sin((0,a.default)(o))-Math.sin((0,a.default)(l))*Math.cos((0,a.default)(o))*Math.cos((0,a.default)(s)-(0,a.default)(u))))+360)%360};t.default=o})),sa=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ce())&&e.__esModule?e:{default:e};function a(t){return(a="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 r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.default;return t.reduce((function(t,n){return"object"===a(t)&&null!==t.last&&(t.distance+=e(n,t.last)),t.last=n,t}),{last:null,distance:0}).distance};t.default=r})),la=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Q()),n=i(ee()),a=i(re()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t,i){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)(i),v=(0,n.default)(i),m=6356752.314245,b=1/298.257223563,M=(0,a.default)(v-g),w=Math.atan((1-b)*Math.tan((0,a.default)(parseFloat(p)))),O=Math.atan((1-b)*Math.tan((0,a.default)(parseFloat(y)))),_=Math.sin(w),x=Math.cos(w),N=Math.sin(O),T=Math.cos(O),P=M,E=100;do{var I=Math.sin(P),j=Math.cos(P);if(0===(d=Math.sqrt(T*I*(T*I)+(x*N-_*T*j)*(x*N-_*T*j))))return 0;s=_*N+x*T*j,l=Math.atan2(d,s),c=s-2*_*N/(h=1-(u=x*T*I/d)*u),isNaN(c)&&(c=0);var A=b/16*h*(4+b*(4-3*h));f=P,P=M+(1-A)*b*u*(l+A*d*(c+A*s*(2*c*c-1)))}while(Math.abs(P-f)>1e-12&&--E>0);if(0===E)return NaN;var L=h*(r.earthRadius*r.earthRadius-m*m)/(m*m),S=1+L/16384*(4096+L*(L*(320-175*L)-768)),B=L/1024*(256+L*(L*(74-47*L)-128)),R=B*d*(c+B/4*(s*(2*c*c-1)-B/6*c*(4*d*d-3)*(4*c*c-3))),k=m*S*(l-R);return Math.round(k/o)*o};t.default=o})),fa=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0};t.default=e})),pa=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ce())&&e.__esModule?e:{default:e};var a=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,r=a(t,e),i=Number(e.time)-Number(t.time),o=r/i*1e3;return o};t.default=a})),ha=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ce())&&e.__esModule?e:{default:e};var a=function(t,e,a){return(0,n.default)(e,t)+(0,n.default)(t,a)===(0,n.default)(e,a)};t.default=a})),ya=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Q()),n=a(ee());function a(t){return t&&t.__esModule?t:{default:t}}var r=function(t,a){for(var r=!1,i=a.length,o=-1,s=i-1;++o<i;s=o)((0,n.default)(a[o])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(a[s])||(0,n.default)(a[s])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(a[o]))&&(0,e.default)(t)<((0,e.default)(a[s])-(0,e.default)(a[o]))*((0,n.default)(t)-(0,n.default)(a[o]))/((0,n.default)(a[s])-(0,n.default)(a[o]))+(0,e.default)(a[o])&&(r=!r);return r};t.default=r})),ma=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ur())&&e.__esModule?e:{default:e};var a=function(t,e,a,r){return(0,n.default)(t,e,a)<r};t.default=a})),Ma=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ce())&&e.__esModule?e:{default:e};var a=function(t,e,a){return(0,n.default)(t,e)<a};t.default=a})),ba=x((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=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{!a&&null!=s.return&&s.return()}finally{if(r)throw i}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);if("Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))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,a=new Array(e);n<e;n++)a[n]=t[n];return a}f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=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),a=n[0],r=n[1];return{longitude:parseFloat(a),latitude:parseFloat(r)}}))};t.default=a})),Ta=x((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0});var e={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(t,"computeDestinationPoint",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"convertArea",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"convertDistance",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"convertSpeed",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"decimalToSexagesimal",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"getAreaOfPolygon",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"getBounds",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"getBoundsOfDistance",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"getCenter",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"getCenterOfBounds",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"getCompassDirection",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(t,"toRad",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:function(){return U.default}});var n=X(Rr()),a=X(Er()),r=X(Br()),i=X(qr()),o=X(Cr()),s=X(jr()),l=X(Hr()),u=X(ir()),h=X(Kr()),c=X(zr()),d=X(Yr()),p=X(ta()),g=X(Le()),y=X(bt()),v=X(ce()),m=X(ur()),b=X(oa()),M=X(Q()),w=X(ee()),O=X(sa()),_=X(la()),x=X(or()),N=X(fa()),T=X(pa()),P=X(Re()),E=X(ha()),I=X(ya()),j=X(ma()),A=X(Ma()),L=X(Ee()),S=X(zn()),B=X(Wn()),R=X(Xn()),k=X(nr()),D=X(Be()),$=X(wt()),F=X(re()),C=X(ye()),U=X(ba()),G=W();function X(t){return t&&t.__esModule?t:{default:t}}Object.keys(G).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return G[n]}})}))})),Ga=x(((t,e)=>{var n,a;f(),n=t,a=function(t){"use strict";var e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e&&e,n="URLSearchParams"in e,a="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in e,o="ArrayBuffer"in e;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)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');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 a&&(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 v(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&r&&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):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(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)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):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),a=0;a<e.length;a++)n[a]=String.fromCharCode(e[a]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(M)}),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)},a&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(e=e||{}).body;if(t instanceof b){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 m.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");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function M(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),a=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(a),decodeURIComponent(r))}})),e}function w(t){var e=new d;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var n=t.split(":"),a=n.shift().trim();if(a){var r=n.join(":").trim();e.append(a,r)}})),e}function O(t,e){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},O.error=function(){var t=new O(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];O.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError("Invalid status code");return new O(null,{status:e,headers:{location:t}})},t.DOMException=e.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 x(n,a){return new Promise((function(i,s){var l=new b(n,a);if(l.signal&&l.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function c(){u.abort()}u.onload=function(){var t={status:u.status,statusText:u.statusText,headers:w(u.getAllResponseHeaders()||"")};t.url="responseURL"in u?u.responseURL:t.headers.get("X-Request-URL");var e="response"in u?u.response:u.responseText;setTimeout((function(){i(new O(e,t))}),0)},u.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.onabort=function(){setTimeout((function(){s(new t.DOMException("Aborted","AbortError"))}),0)},u.open(l.method,function(t){try{return""===t&&e.location.href?e.location.href:t}catch(e){return t}}(l.url),!0),"include"===l.credentials?u.withCredentials=!0:"omit"===l.credentials&&(u.withCredentials=!1),"responseType"in u&&(r?u.responseType="blob":o&&l.headers.get("Content-Type")&&-1!==l.headers.get("Content-Type").indexOf("application/octet-stream")&&(u.responseType="arraybuffer")),!a||"object"!=typeof a.headers||a.headers instanceof d?l.headers.forEach((function(t,e){u.setRequestHeader(e,t)})):Object.getOwnPropertyNames(a.headers).forEach((function(t){u.setRequestHeader(t,h(a.headers[t]))})),l.signal&&(l.signal.addEventListener("abort",c),u.onreadystatechange=function(){4===u.readyState&&l.signal.removeEventListener("abort",c)}),u.send(void 0===l._bodyInit?null:l._bodyInit)}))}x.polyfill=!0,e.fetch||(e.fetch=x,e.Headers=d,e.Request=b,e.Response=O),t.Headers=d,t.Request=b,t.Response=O,t.fetch=x,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?a(t):"function"==typeof define&&define.amd?define(["exports"],a):a(n.WHATWGFetch={})})),Fa=x(((t,e)=>{f(),Ga(),e.exports=self.fetch.bind(self)}));f();var ja=vr(_r());f(),f(),f();var Ia=vr(Ta());f();var Na=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:a=0,distance:r=0,angle:i=0}){let o,s;if(c(this,"origin"),c(this,"destination"),c(this,"vortex"),c(this,"distance"),c(this,"angle"),c(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=r,this.angle=i,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=a*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")}},gn=Na;function Au(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],a=(0,Ia.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),r=e.control.x-n.control.x,i=e.control.y-n.control.y;return Math.sqrt(r*r+i*i)/a}catch(t){return console.error(t),1}}function Lu(t,e){let n=t.x-e.x,a=t.y-e.y;return(Math.atan2(a,n)+2.5*Math.PI)%(2*Math.PI)}var $,Y,le,wa=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:a=!1}){c(this,"edges"),c(this,"nodesById"),c(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:Au(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let r=t.filter((t=>!!this.mapsById[t.map])).map((t=>({...t,paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=r.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let i=e.map((t=>({...t,name:a?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));r.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e})=>{let n=this.nodesById[e];return new gn({angle:Lu(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),i.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 a=e;for(;a<t.nodes.length;){let e=this.nodesById[t.nodes[a]];if(a++,null==e)continue;let r=this.mapsById[n.map].elevation||0,i=this.mapsById[e.map].elevation||0,o=Math.abs(r-i);this.edges[n.id].push(new gn({destination:e,elevationDelta:o,origin:n,vortex:t})),this.edges[e.id].push(new gn({destination:n,elevationDelta:o,origin:e,vortex:t}))}}}))}aStar(t,e,n){let a=t.map((t=>this.nodesById[t])).filter((t=>t)),r=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===a.length||0===r.length)return[];let i=[],o={},s={};for(a.forEach((t=>{let e=this.getShortestEuclideanDistance(t,r);i.push({origin:t,priority:e}),o[t.id]=null,s[t.id]=0})),i.sort(((t,e)=>t.priority-e.priority));i.length>0;){let t=i[0];if(r.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 a=e.vortex&&!1===e.vortex.accessible;if(n&&(a||!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,r);i.push({origin:e.destination,priority:t}),o[e.destination.id]=e}}i.splice(0,1),i.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let n,a=t.x-e.x,r=t.y-e.y,i=a*a+r*r;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(i)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let a=this.getDistance(t,n);return Math.min(e,a)}),Number.MAX_VALUE)}},fr=wa;function Ru(t){switch(t){case le.DOWN:case le.UP:return`${t} `;default:return""}}f(),f(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}($||($={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(Y||(Y={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(le||(le={}));var yn,Oa=class{constructor({origin:t,action:e,distance:n,atLocation:a,instruction:r}){c(this,"node"),c(this,"instruction"),c(this,"action"),c(this,"atLocation"),c(this,"type"),c(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=a,this.instruction="",r?this.instruction=r:(null!=e&&e.type===$.DEPARTURE?this.instruction=null!=a?`Depart from ${a.name}`:"Depart from current location":null!=e&&e.type===$.ARRIVAL?this.instruction=null!=a?`Arrive at ${a.name}`:"Arrive at destination":null!=e&&e.type===$.TAKEVORTEX?this.instruction=`Take ${a&&a.name} ${Ru(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===$.EXITVORTEX?this.instruction=`Exit ${a&&a.name} at ${e.toMap.name}`:null!=e&&e.bearing===Y.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===Y.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===Y.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===Y.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===Y.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===$.TURN&&a&&(this.instruction+=` at ${a.name}`))}},fe=Oa;(yn||(yn={})).NO_VALID_PATH="No Valid Path Available";var mn=.1*Math.PI;function Mn(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var xa=class{constructor({locations:t,nodes:e,vortexes:n,maps:a,showVortexNames:r}){c(this,"graph"),c(this,"locationsByNodeId"),this.graph=new fr({maps:a,nodes:e,showVortexNames:r,vortexes:n}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((n=>{t[n.node]=e})),e.polygons&&e.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{t[n]=e}))})),t)),{})}getClosestLocationInRay(t,e=.5*Math.PI,n=10){let a=0,r=0,i=t;for(;Math.abs(a)<e&&r<n;){let t=this.graph.edges[i.destination.id],o=null,s=0;for(let e of t)if(e.distance>0)if(null!=o){let t=-Mn(i.angle,e.angle);Math.abs(t)<Math.abs(s)&&(o=e,s=t)}else o=e,s=-Mn(i.angle,e.angle);if(null==o)return null;{if(Math.abs(s)>=e||(a+=s,r+=o.distance,Math.abs(a)>=e||r>n))return null;let t=this.locationsByNodeId[o.destination.id];if(null!=t)return t;i=o}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:n,departFrom:a,arriveAt:r}){let i=this.graph.aStar(t,e,n);if(0===i.length)return{distance:0,instructions:[new fe({distance:0,instruction:yn.NO_VALID_PATH})],path:[]};let o=0,s=new Array(i.length+1);for(let t=0;t<i.length;t++)s[t]=i[t].origin;s[i.length]=i[i.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let t=0;t<i.length;t++){let e=i[t],n=e.origin,s=e.destination;if(o+=e.distance,c+=(null==h?void 0:h.distance)||0,0===t&&l.push(new fe({action:{type:$.DEPARTURE},atLocation:a,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],a=this.graph.mapsById[s.map],r=le.NONE;if(null!=t.elevation&&null!=a.elevation){let e=t.elevation-a.elevation;e>0?r=le.DOWN:e<0&&(r=le.UP)}l.push(new fe({action:{direction:r,fromMap:t,toMap:a,type:$.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 fe({action:{fromMap:t,toMap:e,type:$.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 a=-Mn(h.angle,e.angle),r=t.reduce(((t,n)=>{let a=-Mn(e.angle,n.angle);return Math.min(t,Math.abs(a))}),Math.PI);if(Math.abs(a)>=mn||Math.abs(r)<=mn){let t;t=a<=-Math.PI/4?Y.RIGHT:a<=-mn?Y.SLIGHTRIGHT:a<=mn?Y.STRAIGHT:a<=Math.PI/4?Y.SLIGHTLEFT:Y.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let a=new fe({action:{bearing:t,referencePosition:"At",type:$.TURN},atLocation:e,distance:c,origin:n});a.type=t,l.push(a)}else l.push(new fe({action:{bearing:t,referencePosition:"At",type:$.TURN},distance:c,origin:n}));d+=c,c=0}}}t===i.length-1&&(l.push(new fe({action:{type:$.ARRIVAL},atLocation:r,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===$.TAKEVORTEX?(p=e.node,f.unshift(e)):n&&n.type===$.TURN&&null!=p?this.graph.getDistance(e.node,p)>5&&f.unshift(e):f.unshift(e)}return{distance:o,instructions:f,path:s}}},pr=xa;f(),f(),f(),f();var Pa=" ",K=class{static get separator(){return Pa}static set separator(t){Pa=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 a=null,r=null,i=null,o=null;switch(e){default:case"d":case"deg":r=t.toFixed(n),r<100&&(r="0"+r),r<10&&(r="0"+r),a=r+"°";break;case"dm":case"deg+min":r=Math.floor(t),i=(60*t%60).toFixed(n),60==i&&(i=(0).toFixed(n),r++),r=("000"+r).slice(-3),i<10&&(i="0"+i),a=r+"°"+K.separator+i+"′";break;case"dms":case"deg+min+sec":r=Math.floor(t),i=Math.floor(3600*t/60)%60,o=(3600*t%60).toFixed(n),60==o&&(o=(0).toFixed(n),i++),60==i&&(i=0,r++),r=("000"+r).slice(-3),i=("00"+i).slice(-2),o<10&&(o="0"+o),a=r+"°"+K.separator+i+"′"+K.separator+o+"″"}return a}static toLat(t,e,n){let a=K.toDms(K.wrap90(t),e,n);return null===a?"–":a.slice(1)+K.separator+(t<0?"S":"N")}static toLon(t,e,n){let a=K.toDms(K.wrap180(t),e,n);return null===a?"–":a+K.separator+(t<0?"W":"E")}static toBrng(t,e,n){let a=K.toDms(K.wrap360(t),e,n);return null===a?"–":a.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=K.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 L=K,k=Math.PI,T=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=L.wrap90(Number(t)),this._lon=L.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?L.wrap90(L.parse(t)):L.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?L.wrap90(L.parse(t)):L.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)?L.wrap180(L.parse(t)):L.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?L.wrap180(L.parse(t)):L.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?L.wrap180(L.parse(t)):L.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=L.wrap90(L.parse(e)),n=L.wrap180(L.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=L.wrap90(L.parse(e)),n=L.wrap180(L.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let a=t[0];if("Point"==a.type&&Array.isArray(a.coordinates)?[n,e]=a.coordinates:(null!=a.latitude&&(e=a.latitude),null!=a.lat&&(e=a.lat),null!=a.longitude&&(n=a.longitude),null!=a.lng&&(n=a.lng),null!=a.lon&&(n=a.lon),e=L.wrap90(L.parse(e)),n=L.wrap180(L.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 T(e,n)}distanceTo(t,e=6371e3){if(t instanceof T||(t=T.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,a=this.lat.toRadians(),r=this.lon.toRadians(),i=t.lat.toRadians(),o=i-a,s=t.lon.toRadians()-r,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(a)*Math.cos(i)*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 T||(t=T.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),a=(t.lon-this.lon).toRadians(),r=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(a),i=Math.sin(a)*Math.cos(n),o=Math.atan2(i,r).toDegrees();return L.wrap360(o)}finalBearingTo(t){t instanceof T||(t=T.parse(t));let e=t.initialBearingTo(this)+180;return L.wrap360(e)}midpointTo(t){t instanceof T||(t=T.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),a=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),i=Math.cos(e),o=0,s=Math.sin(e),l={x:i+Math.cos(a)*Math.cos(r),y:o+Math.cos(a)*Math.sin(r),z:s+Math.sin(a)},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 T(c,d)}intermediatePointTo(t,e){if(t instanceof T||(t=T.parse(t)),this.equals(t))return new T(this.lat,this.lon);let n=this.lat.toRadians(),a=this.lon.toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians(),o=r-n,s=i-a,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(n)*Math.cos(r)*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(a)+c*Math.cos(r)*Math.cos(i),f=h*Math.cos(n)*Math.sin(a)+c*Math.cos(r)*Math.sin(i),p=h*Math.sin(n)+c*Math.sin(r),g=Math.atan2(p,Math.sqrt(d*d+f*f)),y=Math.atan2(f,d),v=g.toDegrees(),m=y.toDegrees();return new T(v,m)}destinationPoint(t,e,n=6371e3){let a=t/n,r=Number(e).toRadians(),i=this.lat.toRadians(),o=this.lon.toRadians(),s=Math.sin(i)*Math.cos(a)+Math.cos(i)*Math.sin(a)*Math.cos(r),l=Math.asin(s),u=Math.sin(r)*Math.sin(a)*Math.cos(i),h=Math.cos(a)-Math.sin(i)*s,c=o+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new T(d,f)}static intersection(t,e,n,a){if(t instanceof T||(t=T.parse(t)),n instanceof T||(n=T.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(a))throw new TypeError(`invalid brng2 ‘${a}’`);let r=t.lat.toRadians(),i=t.lon.toRadians(),o=n.lat.toRadians(),s=n.lon.toRadians(),l=Number(e).toRadians(),u=Number(a).toRadians(),h=o-r,c=s-i,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(r)*Math.cos(o)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new T(t.lat,t.lon);let f=(Math.sin(o)-Math.sin(r)*Math.cos(d))/(Math.sin(d)*Math.cos(r)),p=(Math.sin(r)-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)),v=l-(Math.sin(s-i)>0?g:2*k-g),m=(Math.sin(s-i)>0?2*k-y:y)-u;if(0==Math.sin(v)&&0==Math.sin(m)||Math.sin(v)*Math.sin(m)<0)return null;let b=-Math.cos(v)*Math.cos(m)+Math.sin(v)*Math.sin(m)*Math.cos(d),M=Math.atan2(Math.sin(d)*Math.sin(v)*Math.sin(m),Math.cos(m)+Math.cos(v)*b),w=Math.asin(Math.min(Math.max(Math.sin(r)*Math.cos(M)+Math.cos(r)*Math.sin(M)*Math.cos(l),-1),1)),O=i+Math.atan2(Math.sin(l)*Math.sin(M)*Math.cos(r),Math.cos(M)-Math.sin(r)*Math.sin(w)),_=w.toDegrees(),x=O.toDegrees();return new T(_,x)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof T||(t=T.parse(t)),e instanceof T||(e=T.parse(e));let a=n;if(this.equals(t))return 0;let r=t.distanceTo(this,a)/a,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(r)*Math.sin(i-o))*a}alongTrackDistanceTo(t,e,n=6371e3){t instanceof T||(t=T.parse(t)),e instanceof T||(e=T.parse(e));let a=n;if(this.equals(t))return 0;let r=t.distanceTo(this,a)/a,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians(),s=Math.asin(Math.sin(r)*Math.sin(i-o));return Math.acos(Math.cos(r)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-i))*a}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 a=Number(n).toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians(),o=e.lat.toRadians(),s=e.lon.toRadians()-i,l=Math.sin(r)*Math.cos(o)*Math.cos(a)*Math.sin(s),u=Math.sin(r)*Math.cos(o)*Math.cos(a)*Math.cos(s)-Math.cos(r)*Math.sin(o)*Math.cos(a),h=Math.cos(r)*Math.cos(o)*Math.sin(a)*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=i+c+d,p=(i+c-d).toDegrees(),g=f.toDegrees();return{lon1:L.wrap180(p),lon2:L.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof T||(t=T.parse(t));let n=e,a=this.lat.toRadians(),r=t.lat.toRadians(),i=r-a,o=Math.abs(t.lon-this.lon).toRadians();Math.abs(o)>k&&(o=o>0?-(2*k-o):2*k+o);let s=Math.log(Math.tan(r/2+k/4)/Math.tan(a/2+k/4)),l=Math.abs(s)>1e-11?i/s:Math.cos(a);return Math.sqrt(i*i+l*l*o*o)*n}rhumbBearingTo(t){if(t instanceof T||(t=T.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),a=(t.lon-this.lon).toRadians();Math.abs(a)>k&&(a=a>0?-(2*k-a):2*k+a);let r=Math.log(Math.tan(n/2+k/4)/Math.tan(e/2+k/4)),i=Math.atan2(a,r).toDegrees();return L.wrap360(i)}rhumbDestinationPoint(t,e,n=6371e3){let a=this.lat.toRadians(),r=this.lon.toRadians(),i=Number(e).toRadians(),o=t/n,s=o*Math.cos(i),l=a+s;Math.abs(l)>k/2&&(l=l>0?k-l:-k-l);let u=Math.log(Math.tan(l/2+k/4)/Math.tan(a/2+k/4)),h=Math.abs(u)>1e-11?s/u:Math.cos(a),c=r+o*Math.sin(i)/h,d=l.toDegrees(),f=c.toDegrees();return new T(d,f)}rhumbMidpointTo(t){t instanceof T||(t=T.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),a=t.lat.toRadians(),r=t.lon.toRadians();Math.abs(r-n)>k&&(n+=2*k);let i=(e+a)/2,o=Math.tan(k/4+e/2),s=Math.tan(k/4+a/2),l=Math.tan(k/4+i/2),u=((r-n)*Math.log(l)+n*Math.log(s)-r*Math.log(o))/Math.log(s/o);isFinite(u)||(u=(n+r)/2);let h=i.toDegrees(),c=u.toDegrees();return new T(h,c)}static areaOf(t,e=6371e3){let n=e,a=t[0].equals(t[t.length-1]);a||t.push(t[0]);let r=t.length-1,i=0;for(let e=0;e<r;e++){let n=t[e].lat.toRadians(),a=t[e+1].lat.toRadians(),r=(t[e+1].lon-t[e].lon).toRadians();i+=2*Math.atan2(Math.tan(r/2)*(Math.tan(n/2)+Math.tan(a/2)),1+Math.tan(n/2)*Math.tan(a/2))}(function(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let a=0;a<t.length-1;a++){let r=t[a].initialBearingTo(t[a+1]),i=t[a].finalBearingTo(t[a+1]);e+=(r-n+540)%360-180,e+=(i-r+540)%360-180,n=i}return e+=(t[0].initialBearingTo(t[1])-n+540)%360-180,Math.abs(e)<90})(t)&&(i=Math.abs(i)-2*k);let o=Math.abs(i*n*n);return a||t.pop(),o}equals(t){return t instanceof T||(t=T.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`${L.toLat(this.lat,t,e)}, ${L.toLon(this.lon,t,e)}`}};f(),f(),f();var vn=class{constructor(t){c(this,"destinations",[]),this.destinations=t}};f();var Ce,se,Ve=class{constructor(t,e){b(this,Ce,void 0),b(this,se,void 0),c(this,"distance",0),c(this,"path",[]),c(this,"instructions",[]),w(this,se,t),w(this,Ce,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,a,r,i,o,s,l,u,c,d,f;let p={...t,action:{...t.action},atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(a=null==(n=h(this,se))?void 0:n._vortexesById)?void 0:a[t.atLocation.id]:void 0,node:(null==(r=t.node)?void 0:r.id)?null==(o=null==(i=h(this,se))?void 0:i._nodesById)?void 0:o[t.node.id]:void 0};return((null==(s=p.action)?void 0:s.type)===$.TAKEVORTEX||(null==(l=p.action)?void 0:l.type)===$.EXITVORTEX)&&(p.action.fromMap=null==(c=h(this,se)._mapsById)?void 0:c[null==(u=p.action)?void 0:u.fromMap.id],p.action.toMap=null==(f=h(this,se)._mapsById)?void 0:f[null==(d=p.action)?void 0:d.toMap.id]),p})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=h(this,se))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return h(this,Ce)}};Ce=new WeakMap,se=new WeakMap;var he,pe=class{constructor(t){b(this,he,void 0),w(this,he,t)}directionsTo(t,e){if(t instanceof vn){let n=[],a=this;for(let r=0;r<t.destinations.length;r++){let i=t.destinations[r],o=Ge(a),s=Ge(i),l=h(this,he).navigator.getDirections({originIds:o,destinationNodeIds:s,accessible:(null==e?void 0:e.accessible)||!1}),u=new Ve(h(this,he),l);n.push(u),a=i}return n}{let n=Ge(this),a=Ge(t),r=h(this,he).navigator.getDirections({originIds:n,destinationNodeIds:a,accessible:(null==e?void 0:e.accessible)||!1});return new Ve(h(this,he),r)}}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)}};he=new WeakMap;var Eu=0,Bu="9999-12-31T00:00:00.000Z";function qu(t,e,n=new Date){if(!t.states)return;let a=n||new Date,r=t.states.find((t=>{let e=new Date(t.start||Eu),n=new Date(t.end||Bu);return e<a&&n>a}));return r?e.find((t=>t.value===r.type)):void 0}var ae,me,Z,ke,Fe,je,Ue=class extends pe{constructor(t,e){super(t),b(this,ae,void 0),b(this,me,void 0),b(this,Z,{}),c(this,"states"),c(this,"id",""),c(this,"name",""),c(this,"type",""),c(this,"description"),c(this,"sortOrder"),c(this,"logo"),c(this,"phone"),c(this,"social"),c(this,"color"),c(this,"shortName"),c(this,"detailsUrl"),c(this,"tags"),c(this,"externalId"),c(this,"showLabelWhenImagePresent"),c(this,"picture"),c(this,"operationHours"),c(this,"siblingGroups"),c(this,"gallery"),c(this,"categories",[]),b(this,ke,void 0),b(this,Fe,[]),b(this,je,void 0),w(this,ae,t),w(this,me,e),Object.assign(this,e)}get polygons(){let t=h(this,Z).polygons;if(void 0!==t)return t;let e=[],n=h(this,ke),a=h(this,ae)._polygonsById;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t){let r=a[n[t].id];null!=r&&r.geometry.visible&&e.push(r)}return h(this,Z).polygons=e,e}set polygons(t){w(this,ke,t)}get rank(){let t=h(this,Z).rank;if(void 0!==t)return t;let e=h(this,ae).locationRankings;if(!e||!e.locations)return null;let n=e.locations.find((t=>t.ids.find((t=>t===this.id))));return n?(h(this,Z).rank=n.score,n.score):null}get nodes(){let t=h(this,Z).nodes;if(void 0!==t)return t;let e=[],n=h(this,Fe),a=h(this,ae)._nodesById;if(n)for(let t=0,r=n.length;t<r;++t){let r=a[n[t].node];null!=r&&e.push(r)}return h(this,Z).nodes=e,e}set nodes(t){w(this,Fe,t)}get parent(){let t=h(this,Z).parent;if(void 0!==t)return t;let e,n=h(this,ae)._locationsById,a=h(this,je);return void 0!==a&&(e=n[a]),h(this,Z).parent=e,e}set parent(t){w(this,je,t)}get state(){return qu(this,h(this,ae).locationStates)}clone(){return new Ue(h(this,ae),h(this,me))}get nodeOperationHours(){let t=h(this,Z).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=h(this,me).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return h(this,Z).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new Ue(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&j(e,"categories"),t.options.things.nodes&&j(e,"nodes"),t.options.things.polygons&&j(e,"polygons"),t.options.things.locationStates&&j(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await F(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new Ue(t,e)))}catch(t){return console.error("Fetch Locations:",t),[]}}toJSON(){return h(this,me)}},Ie=Ue;ae=new WeakMap,me=new WeakMap,Z=new WeakMap,ke=new WeakMap,Fe=new WeakMap,je=new WeakMap,f();var Me,$e,ie,He,bn=class extends pe{constructor(t,e){super(t),b(this,Me,void 0),b(this,$e,void 0),b(this,ie,{}),c(this,"geometry"),c(this,"id",""),c(this,"map",""),c(this,"layer"),c(this,"layerId"),c(this,"name"),c(this,"externalId"),c(this,"vertexes"),c(this,"canvasBounds"),b(this,He,void 0),w(this,Me,t),w(this,$e,e),Object.assign(this,e)}get locations(){let t=h(this,ie).locations;if(void 0!==t)return t;let e=[],{locations:n}=h(this,Me),{id:a}=this;for(let t=0,r=n.length;t<r;++t){let r=n[t],i=r.polygons;if(Array.isArray(i))for(let t=0,n=i.length;t<n;++t)if(i[t].id===a){e.push(r);break}}return h(this,ie).locations=e,e}get entrances(){let t=h(this,ie).entrances;if(void 0!==t)return t;let e=[],n=h(this,He),a=h(this,Me)._nodesById;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;++t){let r=a[n[t].id];null!=r&&e.push(r)}return h(this,ie).entrances=e,e}return[]}set entrances(t){w(this,He,t)}get rank(){let t=h(this,ie).rank;if(void 0!==t)return t;let{rankings:e}=h(this,Me);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(h(this,ie).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(h(this,ie).rank=null,null)}static hydrate(t,e){return t.map((t=>new bn(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&j(e,"map"),t.options.things.nodes&&j(e,"entrances");let n={fields:e,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await F(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new bn(t,e)))}catch(t){return console.error("Fetch Polygons:",t),[]}}toJSON(){return h(this,$e)}},we=bn;function Da(t){return/^[\da-f]{24}$/i.test(t)}function Aa(t,e=!1){let n="";if(null!=t){let a="?",r=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,i=r.length;e<i;++e){let i=r[e],o=t[i];null!=o&&(n+=`${a+encodeURIComponent(i)}=${encodeURIComponent(o)}`,a="&")}}return n}function Su(t,e,n,a=!1){var r,i;return a?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:(null==(r=t.baseUrl)?void 0:r.includes("gateway"))?`${t.baseUrl}${e}/${n.venue||n.slug}${Aa(n,null==(i=t.baseUrl)?void 0:i.includes("gateway"))}`:t.baseUrl+e+Aa(n)}async function F(t,e,n,a=!1){return We(t,e,n,a,!0)}async function We(t,e,n,a=!1,r=!1){let i=Su(t,e,n,a),o=await hr(t,i,a);if(!r&&Array.isArray(o)){if(1===o.length)return o[0];throw new Error("Invalid response object")}return o}async function hr(t,e,n=!1){let a={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete a.language,a.language&&(e+=`&lang=${encodeURIComponent(a.language)}`);let{headers:r}=t;r["Content-Type"]="text/json",t.authorization&&(r.Authorization=t.authorization),a.language&&(r["Accept-Language"]=a.language);let i=await fetch(e,{method:"GET",headers:r});if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);return i.json()}function j(t,e){t.indexOf(e)<0&&t.push(e)}function La([t,e],[n,a]){let r=new T(t,e),i=new T(n,a);return r.distanceTo(i)}function Ra(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],a=t.georeference[2],r=new T(n.target.x,n.target.y),i=new T(a.target.x,a.target.y),o=r.distanceTo(i),s=n.control.x-a.control.x,l=n.control.y-a.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 Ge(t){var e;return t instanceof we?t.entrances.map((t=>t.id)):t instanceof Ie?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function Ea(t){let e={},{maps:n,images:a,scenes:r,polygons:i}=t;if(null!=a)try{let t=Object.keys(a).map((t=>fetch(`data:image/png;base64,${a[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)&&!r[t.id]||(null!=r&&r[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>r[t.id]})),null!=a&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,a;if((null==(n=null==t?void 0:t.image)?void 0:n.url)&&(null==(a=null==t?void 0:t.image)?void 0:a.url)){let n=t.image.url.split("/"),a=e[n[n.length-1]];a&&(t.image.url=a)}}))))})),null!=a&&i.forEach((t=>{var n;if(null==(n=null==t?void 0:t.image)?void 0:n.url){let n=t.image.url.split("/"),a=e[n[n.length-1]];a&&(t.image.url=a)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}function Ba(t,e){let n,a,r,i=e.x,o=e.y,s=Number.MAX_SAFE_INTEGER;return t.forEach((t=>{a=t.x,r=t.y;let e=(i-a)**2+(o-r)**2;e<s&&(s=e,n=t)})),n}Me=new WeakMap,$e=new WeakMap,ie=new WeakMap,He=new WeakMap;var Ke,Xe,Je,Tn=class{constructor(t,e){b(this,Ke,void 0),b(this,Xe,{}),b(this,Je,void 0),c(this,"name"),c(this,"externalId"),c(this,"parents"),c(this,"id"),c(this,"icon"),this.id=e.id,w(this,Je,e),w(this,Ke,t),Object.assign(this,e)}get locations(){let t=h(this,Xe).locations;if(void 0!==t)return t;let e=[],{locations:n}=h(this,Ke),{id:a}=this;for(let t=0,r=n.length;t<r;++t){let r=n[t],i=r.categories;if(Array.isArray(i))for(let t=0,n=i.length;t<n;++t)if(i[t]===a){e.push(r);break}}return h(this,Xe).locations=e,e}static hydrate(t,e){return t.map((t=>new Tn(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await F(t.options,"category",e)).map((e=>new Tn(t,e)))}catch(t){return console.error("Fetch Categories:",t),[]}}toJSON(){return h(this,Je)}},_n=Tn;Ke=new WeakMap,Xe=new WeakMap,Je=new WeakMap,f();var ze,Oe,Ye,In=class{constructor(t,e){b(this,ze,void 0),b(this,Oe,void 0),b(this,Ye,{}),c(this,"id",""),c(this,"type",""),c(this,"name",""),c(this,"description"),c(this,"image"),c(this,"startDate"),c(this,"endDate"),c(this,"showDate"),w(this,Oe,e),w(this,ze,t),Object.assign(this,e)}location(){let t=h(this,Ye).location;if(void 0!==t)return t;let e,n=h(this,ze)._locationsById,a=h(this,Oe).location;if(null!=a){let t=n[a];null!=t&&(e=t)}return h(this,Ye).location=e,e}static hydrate(t,e){return t.map((t=>new In(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&j(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await F(t.options,"event",n)).map((e=>new In(t,e)))}catch(t){return console.error("Fetch Events:",t),[]}}toJSON(){return h(this,Oe)}},Nn=In;ze=new WeakMap,Oe=new WeakMap,Ye=new WeakMap,f();var Ze,wn=class{constructor(t){b(this,Ze,void 0),c(this,"locations",[]),w(this,Ze,t),Object.assign(this,t)}static hydrate(t){return new wn(t)}static async fetch(t){try{let e=await We(t.options,"smart-labels/location-label-ranking",{venue:t.options.venue},!0);return new wn(e)}catch(t){return console.error("Fetch Location Rankings:",t),{}}}toJSON(){return h(this,Ze)}},gr=wn;Ze=new WeakMap,f();var Qe,On=class{constructor(t){b(this,Qe,void 0),c(this,"id",""),c(this,"name",""),c(this,"value",""),w(this,Qe,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new On(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await F(t.options,"location-state",e)).map((t=>new On(t)))}catch(t){return console.error("Fetch Location States:",t),[]}}toJSON(){return h(this,Qe)}},yr=On;Qe=new WeakMap,f(),f();var tt,nt,et=class{constructor(t,e,n,a,r,i){c(this,"map"),c(this,"x",0),c(this,"y",0),c(this,"lat",0),c(this,"lon",0),b(this,tt,{}),b(this,nt,void 0),this.lat=t,this.lon=e,this.map="string"==typeof r?r:r.id,this.x=n,this.y=a,w(this,nt,i)}absoluteDistanceTo(t){return La([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=h(this,tt).nearestNode;if(void 0!==t)return t;let e=Ba(h(this,nt).nodes.filter((t=>t.map===this.map)),this);return h(this,tt).nearestNode=e,e}};tt=new WeakMap,nt=new WeakMap;var ge,ve,rt,Pn=class{constructor(t,e){b(this,ge,void 0),b(this,ve,{}),b(this,rt,void 0),c(this,"id",""),c(this,"group",""),c(this,"name",""),c(this,"shortName",""),c(this,"elevation",0),c(this,"scale",0),c(this,"x_scale"),c(this,"perspectiveId"),c(this,"scene"),c(this,"width",0),c(this,"height",0),c(this,"georeference",[]),c(this,"_scale",0),w(this,ge,t),w(this,rt,e),Object.assign(this,e),this._scale=Ra(this),this.scale=this.x_scale}get polygons(){let t=h(this,ve).polygons;if(void 0!==t)return t;let e=[],{polygons:n}=h(this,ge),{id:a}=this;for(let t=0,r=n.length;t<r;++t){let r=n[t];r.map===a&&e.push(r)}return h(this,ve).polygons=e,e}get mapGroup(){let t=h(this,ve).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&h(this,ge)._mapGroupsById[e]||null;return h(this,ve).mapGroup=n,n}createCoordinateByXY(t,e){let n=this.georeference[0],a=new T(n.target.x,n.target.y),r=t-n.control.x,i=n.control.y-e,o=Math.atan2(r,i),s=r/Math.sin(o),l=o-this.getNorth(),u=s/this._scale,c=a.destinationPoint(u,180*l/Math.PI);return new et(c.lat,c.lon,t,e,this.id,h(this,ge))}createCoordinate(t,e){let n=this.georeference[0],a=new T(n.target.x,n.target.y),r=new T(t,e),i=a.distanceTo(r),o=(a.finalBearingTo(r)+360)%360*Math.PI/180,s=i*(1/this.scale),l=o+this.getNorth(),u=Math.sin(l)*s,c=Math.cos(l)*s;return new et(t,e,n.control.x+u,n.control.y-c,this.id,h(this,ge))}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],a=new T(e.target.x,e.target.y),r=new T(n.target.x,n.target.y);t=-((a.finalBearingTo(r)+0)*Math.PI/180-Math.atan2(n.control.y-e.control.y,n.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,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 Pn(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&j(e,"perspectives"),t.options.things.mapGroups&&j(e,"group"),j(e,"elevation"),j(e,"x_scale"),j(e,"scale"),j(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let r=await F(t.options,"map",n),i=t=>{let e=a.layers.find((e=>e.id===t));e?e.visible=!0:a.layers.push({id:t,visible:!0})};for(let n=0,o=r.length;n<o;++n){var a=r[n];if(a){let n=a.perspective;null!=n&&(a.perspectiveId=n.id,t.options.do2D?(e.indexOf("width")>-1&&(a.width=n.size&&n.size.width||n.width),e.indexOf("height")>-1&&(a.height=n.size&&n.size.height||n.height),e.indexOf("tiles")>-1&&(a.tiles=n.tiles),e.indexOf("original")>-1&&(a.original=n.original)):(e.indexOf("scene")>-1&&(a.scene=n.scene),n.layers?(a.layers.forEach((t=>{t.visible=!1})),n.layers.forEach(i)):a.layers.forEach((t=>{t.visible=!0})))),delete a.perspective}r[n]=new Pn(t,a)}return r}catch(t){return console.error("Fetch Maps:",t),[]}}toJSON(){return h(this,rt)}},xn=Pn;ge=new WeakMap,ve=new WeakMap,rt=new WeakMap,f();var at,xe,it,An=class{constructor(t,e){b(this,at,void 0),b(this,xe,void 0),b(this,it,{}),c(this,"id",""),c(this,"name",""),w(this,xe,e),w(this,at,t),Object.assign(this,e)}get maps(){let t=h(this,it).maps;if(void 0!==t)return t;let e=[],{maps:n}=h(this,at),{id:a}=h(this,xe);for(let t=0,r=n.length;t<r;++t){let r=n[t];r.group===a&&e.push(r)}return h(this,it).maps=e,e}static hydrate(t,e){return t.map((t=>new An(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await F(t.options,"map-group",e)).map((e=>new An(t,e)))}catch(t){return console.error("Fetch Map Groups:",t),[]}}toJSON(){return h(this,xe)}},Dn=An;at=new WeakMap,xe=new WeakMap,it=new WeakMap,f();var ue,ot,X,st,Rn=class extends pe{constructor(t,e){super(t),b(this,ue,void 0),b(this,ot,void 0),b(this,X,{}),c(this,"id",""),c(this,"map",""),c(this,"x",0),c(this,"y",0),c(this,"operationHours"),c(this,"externalId"),b(this,st,void 0),w(this,ue,t),w(this,ot,e),Object.assign(this,e)}get lat(){var t;let e=h(this,X).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=h(this,ue)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return h(this,X).cachedLatLon=n.createCoordinateByXY(this.x,this.y),h(this,X).cachedLatLon.lat}get lon(){var t;let e=h(this,X).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=h(this,ue)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return h(this,X).cachedLatLon=n.createCoordinateByXY(this.x,this.y),h(this,X).cachedLatLon.lon}get paths(){let t=h(this,X).paths;if(void 0!==t)return t;let e=[],n=h(this,ue)._nodesById,a=h(this,st);if(Array.isArray(a))for(let t=0,r=a.length;t<r;++t){let r=n[a[t].node];null!=r&&e.push(r)}return h(this,X).paths=e,e}set paths(t){w(this,st,t)}get locations(){let t=h(this,X).locations;if(void 0!==t)return t;let e=[],{locations:n}=h(this,ue),a=this.id;for(let t=0,r=n.length;t<r;++t){let r=n[t],i=r.nodes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;++t)if(i[t].id===a){e.push(r);break}}return h(this,X).locations=e,e}get polygon(){let t=h(this,X).polygon;if(void 0!==t)return t;let e,{polygons:n}=h(this,ue),a=this.id;for(let t=0,r=n.length;t<r;++t){let r=n[t];r.entrances.map((t=>t.id)).includes(a)&&(e=r)}return h(this,X).polygon=e,e}static hydrate(t,e){return t.map((t=>new Rn(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&j(e,"map"),["weight","multiplier","accessible"].forEach((function(t){j(e,t)}));let n={fields:e,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await F(t.options,"node",n)).map((e=>new Rn(t,e)))}catch(t){return console.error("Fetch Nodes:",t),[]}}toJSON(){return h(this,ot)}},Ln=Rn;ue=new WeakMap,ot=new WeakMap,X=new WeakMap,st=new WeakMap,f();var ut,Bn=class{constructor(t){b(this,ut,void 0),c(this,"polygons",[]),w(this,ut,t),Object.assign(this,t)}static hydrate(t){return new Bn(t)}static async fetch(t){try{let e=await We(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new Bn(e)}catch(t){return console.error("Fetch Rankings:",t),null}}toJSON(){return h(this,ut)}},En=Bn;ut=new WeakMap,f();var dt,qn=class{constructor(t){c(this,"id",""),b(this,dt,void 0),w(this,dt,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new qn(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await F(t.options,"apollo-theme",e)).map((t=>new qn(t)))}catch(t){return console.error("Fetch Theme:",t),[]}}toJSON(){return h(this,dt)}},mr=qn;dt=new WeakMap,f();var ct,Vn=class{constructor(t){b(this,ct,void 0),c(this,"defaultMap",""),c(this,"address",""),c(this,"city",""),c(this,"countrycode",""),c(this,"externalId",""),c(this,"id",""),c(this,"latitude"),c(this,"logo"),c(this,"longitude"),c(this,"metadata"),c(this,"name",""),c(this,"operationHours"),c(this,"postal",""),c(this,"slug",""),c(this,"state",""),c(this,"telephone",""),c(this,"tzid",""),c(this,"tzidOverride",""),c(this,"utcOffset",""),c(this,"website",""),w(this,ct,t),Object.assign(this,t)}static hydrate(t){return new Vn(t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await F(t.options,"venue",e);return new Vn(n[0])}catch(t){return console.error("Fetch Venue:",t),{}}}toJSON(){return h(this,ct)}},Sn=Vn;ct=new WeakMap,f();var lt,Gn=class{constructor(t){c(this,"id",""),b(this,lt,void 0),c(this,"name"),c(this,"type"),c(this,"weight"),c(this,"multiplier"),w(this,lt,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Gn(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){j(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await F(t.options,"vortex",n)).map((t=>new Gn(t)))}catch(t){return console.error("Fetch Vortexes:",t),[]}}toJSON(){return h(this,lt)}},Cn=Gn;lt=new WeakMap;var Sa,qa={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"}(Sa||(Sa={}));var be,_e,Pe={categories:_n,locations:Ie,vortexes:Cn,maps:xn,nodes:Ln,polygons:we,venue:Sn,events:Nn,mapGroups:Dn,themes:mr,locationStates:yr,locationRankings:gr,rankings:En},De=class{constructor(t){c(this,"perspective"),c(this,"things"),c(this,"options"),b(this,be,{}),b(this,_e,""),c(this,"updatedAt"),c(this,"categories",[]),c(this,"locations",[]),c(this,"vortexes",[]),c(this,"maps",[]),c(this,"nodes",[]),c(this,"polygons",[]),c(this,"venue",{}),c(this,"events",[]),c(this,"mapGroups",[]),c(this,"themes",[]),c(this,"locationStates",[]),c(this,"locationRankings",[]),c(this,"rankings"),c(this,"_categoriesById"),c(this,"_locationsById"),c(this,"_vortexesById"),c(this,"_mapsById"),c(this,"_nodesById"),c(this,"_polygonsById"),c(this,"_eventsById"),c(this,"_mapGroupsById"),c(this,"_locationStatesById"),c(this,"_locationRankingsById"),c(this,"_rankingsById"),c(this,"_categoriesByExternalId"),c(this,"_locationsByExternalId"),c(this,"_vortexesByExternalId"),c(this,"_mapsByExternalId"),c(this,"_nodesByExternalId"),c(this,"_polygonsByExternalId"),c(this,"_eventsByExternalId"),c(this,"_mapGroupsByExternalId"),c(this,"_locationStatesByExternalId"),c(this,"_locationRankingsByExternalId"),c(this,"_rankingsByExternalId"),c(this,"images"),c(this,"scenes"),c(this,"navigator"),this.options=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=h(this,be)[n];if(void 0!==t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),h(this,be)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=h(this,be)[n];if(void 0!==t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),h(this,be)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,a=this[`_${t}ById`];return null!=a&&null!=a[e]||(a=this[n],null!=a&&null!=a[e])?a[e]:null}async hydrate(t,e){let n;if("string"==typeof t)try{w(this,_e,t),n=JSON.parse(t)}catch(t){return void console.error("Unable to parse JSON",t)}else n=t,w(this,_e,JSON.stringify(n));let a=Object.keys(n);for(let t=0,e=a.length;t<e;++t){let e=a[t],r=n[e];null!=Pe[e]&&"function"==typeof Pe[e].hydrate&&(this[e]=Pe[e].hydrate(r,this))}e&&await Ea(n);let{images:r,scenes:i}=n;this.images=r,this.scenes=i,this.generateGetters(a),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"]),Da(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,a=n.length;t<a;++t){let a=n[t];Pe[a]&&e.push(Pe[a].fetch(this).then((t=>(this[a]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator(),w(this,_e,JSON.stringify(this.toJSON()))}))}initNavigator(){this.navigator=new pr({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 Pe)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));return{...e,venue:this.venue.toJSON(),rankings:null==(t=this.rankings)?void 0:t.toJSON()}}toString(){return h(this,_e)}};be=new WeakMap,_e=new WeakMap,f();var Va={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:[]};function Fn(t){let e={...qa,things:Va,...t};return 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 nl(t){let e=Fn({baseUrl:"https://api-gateway.mappedin.com/",...t}),n=new De({...e,baseUrl:e.baseUrl+"public/1/"});return await n.fetch(),n}Fa(),globalThis.btoa||(globalThis.btoa=ja.encode);var Mr={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function rl(t){let e=Fn({baseUrl:"https://api-gateway.mappedin.com/",...Mr,...t}),{url:n,updated_at:a}=await Vu(t),r=await fetch(n,{mode:"cors"}),{data:i,format:o="jsonstring"}=await r.json();if("jsonstring"!==o)throw new Error(`Unrecognized format ${o}`);let s=new De(e);return await s.hydrate(i,e.shouldPopulateBundledImagesAsBlobs),s.updatedAt=a,s}async function Vu(t){let e=Fn({baseUrl:"https://api-gateway.mappedin.com/",...Mr,...t}),{version:n,venue:a}=t,r=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${e.language?"-"+e.language:""}/1/bundle`}?venue=${a}&version=1.0.0`;return e.language=void 0,await hr(e,r)}async function al(t,{url:e,updated_at:n}){let a=Fn({baseUrl:"https://api-gateway.mappedin.com/",...Mr,...t}),r=await fetch(e,{mode:"cors"}),{data:i,format:o="jsonstring"}=await r.json();if("jsonstring"!==o)throw new Error(`Unrecognized format${o}`);let s=new De(a);return await s.hydrate(i,a.shouldPopulateBundledImagesAsBlobs),s.updatedAt=n,s}export{De as Mappedin,_n as MappedinCategory,et as MappedinCoordinate,vn as MappedinDestinationSet,Ve as MappedinDirections,Nn as MappedinEvent,Ie as MappedinLocation,xn as MappedinMap,Dn as MappedinMapGroup,pe as MappedinNavigatable,Ln as MappedinNode,we as MappedinPolygon,En as MappedinRankings,Sn as MappedinVenue,Cn as MappedinVortex,al as downloadBundle,nl as getVenue,rl as getVenueBundle,Vu as getVenueBundleURL};
|
|
@@ -26,7 +26,7 @@ declare module '@mappedin/mappedin-js/lib/esm/navigator/navigator/NavigationGrap
|
|
|
26
26
|
mapsById: {
|
|
27
27
|
[propName: string]: IMap;
|
|
28
28
|
};
|
|
29
|
-
constructor({ nodes, vortexes, maps, showVortexNames
|
|
29
|
+
constructor({ nodes, vortexes, maps, showVortexNames }: {
|
|
30
30
|
nodes: INode[];
|
|
31
31
|
vortexes: IVortex[];
|
|
32
32
|
maps: IMap[];
|
|
@@ -65,7 +65,7 @@ declare module '@mappedin/mappedin-js/lib/esm/navigator/navigator/Navigator' {
|
|
|
65
65
|
instructions: Directive[];
|
|
66
66
|
}
|
|
67
67
|
class Navigator {
|
|
68
|
-
constructor({ locations, nodes, vortexes, maps, showVortexNames
|
|
68
|
+
constructor({ locations, nodes, vortexes, maps, showVortexNames }: {
|
|
69
69
|
locations: ILocation[];
|
|
70
70
|
nodes: INode[];
|
|
71
71
|
vortexes: IVortex[];
|
|
@@ -87,7 +87,7 @@ declare module '@mappedin/mappedin-js/lib/esm/navigator/navigator/Navigator' {
|
|
|
87
87
|
* @param departFrom ILocation - optional, id and name of a location to represent start of journey
|
|
88
88
|
* @param arriveAt ILocation - optional, id and name of a location to represent end of journey
|
|
89
89
|
*/
|
|
90
|
-
getDirections({ originIds, destinationNodeIds, accessible, departFrom, arriveAt
|
|
90
|
+
getDirections({ originIds, destinationNodeIds, accessible, departFrom, arriveAt }: {
|
|
91
91
|
originIds: string[];
|
|
92
92
|
destinationNodeIds: string[];
|
|
93
93
|
accessible: boolean;
|
|
@@ -151,7 +151,7 @@ declare module '@mappedin/mappedin-js/lib/esm/navigator/navigator/Directive' {
|
|
|
151
151
|
atLocation?: ILocation;
|
|
152
152
|
type?: BEARING_TYPE;
|
|
153
153
|
distance: number;
|
|
154
|
-
constructor({ origin, action, distance, atLocation, instruction
|
|
154
|
+
constructor({ origin, action, distance, atLocation, instruction }: {
|
|
155
155
|
origin?: INode;
|
|
156
156
|
action?: IAction;
|
|
157
157
|
distance?: number;
|
|
@@ -172,7 +172,7 @@ declare module '@mappedin/mappedin-js/lib/esm/navigator/navigator/Edge' {
|
|
|
172
172
|
distance: number;
|
|
173
173
|
angle: number;
|
|
174
174
|
weight: number;
|
|
175
|
-
constructor({ origin, destination, vortex, elevationDelta, distance, angle
|
|
175
|
+
constructor({ origin, destination, vortex, elevationDelta, distance, angle }: {
|
|
176
176
|
origin: INode;
|
|
177
177
|
destination: INode;
|
|
178
178
|
vortex?: IVortex;
|