@mapvx/web-js 1.7.0-dev.1 → 1.8.0-dev.1
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/dist/cjs/logger/logger.js +1 -1
- package/dist/cjs/logger/rollbar.js +1 -1
- package/dist/cjs/map/map.js +61 -0
- package/dist/cjs/map/map.js.map +1 -1
- package/dist/cjs/repository/repository.js +19 -0
- package/dist/cjs/repository/repository.js.map +1 -1
- package/dist/cjs/repository/requester.js +16 -0
- package/dist/cjs/repository/requester.js.map +1 -1
- package/dist/cjs/sdk.js +11 -0
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/es/logger/logger.js +1 -1
- package/dist/es/logger/rollbar.js +1 -1
- package/dist/es/map/map.d.ts +38 -0
- package/dist/es/map/map.d.ts.map +1 -1
- package/dist/es/map/map.js +61 -0
- package/dist/es/map/map.js.map +1 -1
- package/dist/es/repository/repository.d.ts +1 -0
- package/dist/es/repository/repository.d.ts.map +1 -1
- package/dist/es/repository/repository.js +19 -0
- package/dist/es/repository/repository.js.map +1 -1
- package/dist/es/repository/requester.d.ts +6 -0
- package/dist/es/repository/requester.d.ts.map +1 -1
- package/dist/es/repository/requester.js +16 -0
- package/dist/es/repository/requester.js.map +1 -1
- package/dist/es/sdk.d.ts +9 -0
- package/dist/es/sdk.d.ts.map +1 -1
- package/dist/es/sdk.js +11 -0
- package/dist/es/sdk.js.map +1 -1
- package/dist/umd/index.js +649 -448
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/umd/index.js
CHANGED
|
@@ -6814,7 +6814,7 @@ var rollbar_umd_min_default = /*#__PURE__*/__webpack_require__.n(rollbar_umd_min
|
|
|
6814
6814
|
// version placeholder is replaced with the package version by
|
|
6815
6815
|
// scripts/inject-build-defines.js. The access token falls back to the MapVX
|
|
6816
6816
|
// SDK-web Rollbar project token when none is injected at build time.
|
|
6817
|
-
var SDK_VERSION = true ? "1.
|
|
6817
|
+
var SDK_VERSION = true ? "1.8.0-dev.1" : 0;
|
|
6818
6818
|
var ACCESS_TOKEN = false ? 0 : "28279d52df43411ebd138c2bee0ab1df";
|
|
6819
6819
|
var _rollbarConfig = {
|
|
6820
6820
|
accessToken: ACCESS_TOKEN,
|
|
@@ -6861,7 +6861,7 @@ function logger_toPrimitive(t, r) { if ("object" != logger_typeof(t) || !t) retu
|
|
|
6861
6861
|
// by scripts/inject-build-defines.js. The Countly key falls back to the
|
|
6862
6862
|
// MapVX key when none is injected at build time.
|
|
6863
6863
|
var IS_DEBUG = true ? false : 0;
|
|
6864
|
-
var logger_SDK_VERSION = true ? "1.
|
|
6864
|
+
var logger_SDK_VERSION = true ? "1.8.0-dev.1" : 0;
|
|
6865
6865
|
var COUNTLY_API_KEY = false ? 0 : "f0c8d3b96d336e857a8628f49dd1baf7d7add0e9";
|
|
6866
6866
|
var logger_countly = {
|
|
6867
6867
|
apiKey: COUNTLY_API_KEY,
|
|
@@ -11980,6 +11980,37 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11980
11980
|
}
|
|
11981
11981
|
return fetchRouteV2;
|
|
11982
11982
|
}()
|
|
11983
|
+
/**
|
|
11984
|
+
* To obtain the route from the live routing endpoint (`/sdk/liveroute`).
|
|
11985
|
+
* @param routeConfig
|
|
11986
|
+
* @returns
|
|
11987
|
+
*/
|
|
11988
|
+
)
|
|
11989
|
+
}, {
|
|
11990
|
+
key: "fetchLiveRoute",
|
|
11991
|
+
value: (function () {
|
|
11992
|
+
var _fetchLiveRoute = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee12(routeConfig, token) {
|
|
11993
|
+
var options, cleanParams;
|
|
11994
|
+
return requester_regenerator().w(function (_context12) {
|
|
11995
|
+
while (1) switch (_context12.n) {
|
|
11996
|
+
case 0:
|
|
11997
|
+
options = {
|
|
11998
|
+
method: "GET",
|
|
11999
|
+
headers: {
|
|
12000
|
+
"content-type": "application/json",
|
|
12001
|
+
Authorization: "Bearer ".concat(token)
|
|
12002
|
+
}
|
|
12003
|
+
};
|
|
12004
|
+
cleanParams = this.buildRouteParams(routeConfig);
|
|
12005
|
+
return _context12.a(2, this.fetchFromUrl(this.routeBaseUrl + "liveroute", cleanParams, options));
|
|
12006
|
+
}
|
|
12007
|
+
}, _callee12, this);
|
|
12008
|
+
}));
|
|
12009
|
+
function fetchLiveRoute(_x32, _x33) {
|
|
12010
|
+
return _fetchLiveRoute.apply(this, arguments);
|
|
12011
|
+
}
|
|
12012
|
+
return fetchLiveRoute;
|
|
12013
|
+
}()
|
|
11983
12014
|
/**
|
|
11984
12015
|
* To obtain info associated to an Institution based on id provided
|
|
11985
12016
|
* It return 403 if the institution id
|
|
@@ -11991,10 +12022,10 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11991
12022
|
}, {
|
|
11992
12023
|
key: "fetchInstitutions",
|
|
11993
12024
|
value: (function () {
|
|
11994
|
-
var _fetchInstitutions = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function
|
|
12025
|
+
var _fetchInstitutions = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee13(token) {
|
|
11995
12026
|
var options, params;
|
|
11996
|
-
return requester_regenerator().w(function (
|
|
11997
|
-
while (1) switch (
|
|
12027
|
+
return requester_regenerator().w(function (_context13) {
|
|
12028
|
+
while (1) switch (_context13.n) {
|
|
11998
12029
|
case 0:
|
|
11999
12030
|
options = {
|
|
12000
12031
|
method: "GET",
|
|
@@ -12006,11 +12037,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12006
12037
|
params = {
|
|
12007
12038
|
lang: this.lang
|
|
12008
12039
|
};
|
|
12009
|
-
return
|
|
12040
|
+
return _context13.a(2, this.fetchFromUrl(this.baseUrl + "institution", params, options));
|
|
12010
12041
|
}
|
|
12011
|
-
},
|
|
12042
|
+
}, _callee13, this);
|
|
12012
12043
|
}));
|
|
12013
|
-
function fetchInstitutions(
|
|
12044
|
+
function fetchInstitutions(_x34) {
|
|
12014
12045
|
return _fetchInstitutions.apply(this, arguments);
|
|
12015
12046
|
}
|
|
12016
12047
|
return fetchInstitutions;
|
|
@@ -12031,10 +12062,10 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12031
12062
|
}, {
|
|
12032
12063
|
key: "fetchSearchResults",
|
|
12033
12064
|
value: (function () {
|
|
12034
|
-
var _fetchSearchResults = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function
|
|
12065
|
+
var _fetchSearchResults = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee14(institutionId, input, token, parentIds, origin, lat, lng, floor) {
|
|
12035
12066
|
var options, params;
|
|
12036
|
-
return requester_regenerator().w(function (
|
|
12037
|
-
while (1) switch (
|
|
12067
|
+
return requester_regenerator().w(function (_context14) {
|
|
12068
|
+
while (1) switch (_context14.n) {
|
|
12038
12069
|
case 0:
|
|
12039
12070
|
options = {
|
|
12040
12071
|
method: "GET",
|
|
@@ -12063,11 +12094,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12063
12094
|
if (floor) {
|
|
12064
12095
|
params.floor = floor;
|
|
12065
12096
|
}
|
|
12066
|
-
return
|
|
12097
|
+
return _context14.a(2, this.fetchFromUrl(this.baseUrl + "searchPlacesWithFilters", params, options));
|
|
12067
12098
|
}
|
|
12068
|
-
},
|
|
12099
|
+
}, _callee14, this);
|
|
12069
12100
|
}));
|
|
12070
|
-
function fetchSearchResults(
|
|
12101
|
+
function fetchSearchResults(_x35, _x36, _x37, _x38, _x39, _x40, _x41, _x42) {
|
|
12071
12102
|
return _fetchSearchResults.apply(this, arguments);
|
|
12072
12103
|
}
|
|
12073
12104
|
return fetchSearchResults;
|
|
@@ -12094,10 +12125,10 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12094
12125
|
}, {
|
|
12095
12126
|
key: "fetchSearchPlacesByTags",
|
|
12096
12127
|
value: (function () {
|
|
12097
|
-
var _fetchSearchPlacesByTags = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function
|
|
12128
|
+
var _fetchSearchPlacesByTags = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee15(institutionId, tags, token, parentPlaces, sort, origin, lat, lng, floor) {
|
|
12098
12129
|
var options, params;
|
|
12099
|
-
return requester_regenerator().w(function (
|
|
12100
|
-
while (1) switch (
|
|
12130
|
+
return requester_regenerator().w(function (_context15) {
|
|
12131
|
+
while (1) switch (_context15.n) {
|
|
12101
12132
|
case 0:
|
|
12102
12133
|
// The v2 endpoints authenticate via the Authorization header (Bearer),
|
|
12103
12134
|
// not via a `token` query parameter like the legacy /api/sdk/* routes.
|
|
@@ -12131,11 +12162,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12131
12162
|
if (floor) {
|
|
12132
12163
|
params.floor = floor;
|
|
12133
12164
|
}
|
|
12134
|
-
return
|
|
12165
|
+
return _context15.a(2, this.fetchFromUrl(this.baseUrl + "searchPlacesByTags", params, options));
|
|
12135
12166
|
}
|
|
12136
|
-
},
|
|
12167
|
+
}, _callee15, this);
|
|
12137
12168
|
}));
|
|
12138
|
-
function fetchSearchPlacesByTags(
|
|
12169
|
+
function fetchSearchPlacesByTags(_x43, _x44, _x45, _x46, _x47, _x48, _x49, _x50, _x51) {
|
|
12139
12170
|
return _fetchSearchPlacesByTags.apply(this, arguments);
|
|
12140
12171
|
}
|
|
12141
12172
|
return fetchSearchPlacesByTags;
|
|
@@ -12143,10 +12174,10 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12143
12174
|
}, {
|
|
12144
12175
|
key: "fetchConfiguration",
|
|
12145
12176
|
value: function () {
|
|
12146
|
-
var _fetchConfiguration = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function
|
|
12177
|
+
var _fetchConfiguration = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee16(token, place_id, product) {
|
|
12147
12178
|
var options, params;
|
|
12148
|
-
return requester_regenerator().w(function (
|
|
12149
|
-
while (1) switch (
|
|
12179
|
+
return requester_regenerator().w(function (_context16) {
|
|
12180
|
+
while (1) switch (_context16.n) {
|
|
12150
12181
|
case 0:
|
|
12151
12182
|
options = {
|
|
12152
12183
|
method: "GET",
|
|
@@ -12160,11 +12191,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12160
12191
|
};
|
|
12161
12192
|
if (place_id) params.place_id = place_id;
|
|
12162
12193
|
if (product) params.product = product;
|
|
12163
|
-
return
|
|
12194
|
+
return _context16.a(2, this.fetchFromUrl(this.baseUrl + "configuration", params, options));
|
|
12164
12195
|
}
|
|
12165
|
-
},
|
|
12196
|
+
}, _callee16, this);
|
|
12166
12197
|
}));
|
|
12167
|
-
function fetchConfiguration(
|
|
12198
|
+
function fetchConfiguration(_x52, _x53, _x54) {
|
|
12168
12199
|
return _fetchConfiguration.apply(this, arguments);
|
|
12169
12200
|
}
|
|
12170
12201
|
return fetchConfiguration;
|
|
@@ -12172,10 +12203,10 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12172
12203
|
}, {
|
|
12173
12204
|
key: "fetchCategories",
|
|
12174
12205
|
value: function () {
|
|
12175
|
-
var _fetchCategories = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function
|
|
12206
|
+
var _fetchCategories = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee17(token, place_id) {
|
|
12176
12207
|
var options, params;
|
|
12177
|
-
return requester_regenerator().w(function (
|
|
12178
|
-
while (1) switch (
|
|
12208
|
+
return requester_regenerator().w(function (_context17) {
|
|
12209
|
+
while (1) switch (_context17.n) {
|
|
12179
12210
|
case 0:
|
|
12180
12211
|
options = {
|
|
12181
12212
|
method: "GET",
|
|
@@ -12188,11 +12219,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12188
12219
|
lang: this.lang
|
|
12189
12220
|
};
|
|
12190
12221
|
if (place_id) params.id = place_id;
|
|
12191
|
-
return
|
|
12222
|
+
return _context17.a(2, this.fetchFromUrl(this.baseUrl + "category", params, options));
|
|
12192
12223
|
}
|
|
12193
|
-
},
|
|
12224
|
+
}, _callee17, this);
|
|
12194
12225
|
}));
|
|
12195
|
-
function fetchCategories(
|
|
12226
|
+
function fetchCategories(_x55, _x56) {
|
|
12196
12227
|
return _fetchCategories.apply(this, arguments);
|
|
12197
12228
|
}
|
|
12198
12229
|
return fetchCategories;
|
|
@@ -12200,10 +12231,10 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12200
12231
|
}, {
|
|
12201
12232
|
key: "fetchRoutesForOrigin",
|
|
12202
12233
|
value: function () {
|
|
12203
|
-
var _fetchRoutesForOrigin = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function
|
|
12234
|
+
var _fetchRoutesForOrigin = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee18(token, parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode) {
|
|
12204
12235
|
var options, params;
|
|
12205
|
-
return requester_regenerator().w(function (
|
|
12206
|
-
while (1) switch (
|
|
12236
|
+
return requester_regenerator().w(function (_context18) {
|
|
12237
|
+
while (1) switch (_context18.n) {
|
|
12207
12238
|
case 0:
|
|
12208
12239
|
options = {
|
|
12209
12240
|
method: "GET",
|
|
@@ -12220,11 +12251,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12220
12251
|
mode: mode,
|
|
12221
12252
|
lang: this.lang
|
|
12222
12253
|
};
|
|
12223
|
-
return
|
|
12254
|
+
return _context18.a(2, this.fetchFromUrl(this.routeBaseUrl + "routes_for_origin", params, options));
|
|
12224
12255
|
}
|
|
12225
|
-
},
|
|
12256
|
+
}, _callee18, this);
|
|
12226
12257
|
}));
|
|
12227
|
-
function fetchRoutesForOrigin(
|
|
12258
|
+
function fetchRoutesForOrigin(_x57, _x58, _x59, _x60, _x61, _x62) {
|
|
12228
12259
|
return _fetchRoutesForOrigin.apply(this, arguments);
|
|
12229
12260
|
}
|
|
12230
12261
|
return fetchRoutesForOrigin;
|
|
@@ -12232,10 +12263,10 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12232
12263
|
}, {
|
|
12233
12264
|
key: "fetchCacheTimestamp",
|
|
12234
12265
|
value: function () {
|
|
12235
|
-
var _fetchCacheTimestamp = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function
|
|
12266
|
+
var _fetchCacheTimestamp = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee19(token, placeId) {
|
|
12236
12267
|
var options, params;
|
|
12237
|
-
return requester_regenerator().w(function (
|
|
12238
|
-
while (1) switch (
|
|
12268
|
+
return requester_regenerator().w(function (_context19) {
|
|
12269
|
+
while (1) switch (_context19.n) {
|
|
12239
12270
|
case 0:
|
|
12240
12271
|
options = {
|
|
12241
12272
|
method: "GET",
|
|
@@ -12247,11 +12278,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12247
12278
|
params = {
|
|
12248
12279
|
placeId: placeId
|
|
12249
12280
|
};
|
|
12250
|
-
return
|
|
12281
|
+
return _context19.a(2, this.fetchFromUrl(this.routeBaseUrl + "cache_timestamp", params, options));
|
|
12251
12282
|
}
|
|
12252
|
-
},
|
|
12283
|
+
}, _callee19, this);
|
|
12253
12284
|
}));
|
|
12254
|
-
function fetchCacheTimestamp(
|
|
12285
|
+
function fetchCacheTimestamp(_x63, _x64) {
|
|
12255
12286
|
return _fetchCacheTimestamp.apply(this, arguments);
|
|
12256
12287
|
}
|
|
12257
12288
|
return fetchCacheTimestamp;
|
|
@@ -12259,10 +12290,10 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12259
12290
|
}, {
|
|
12260
12291
|
key: "fetchCssCustomization",
|
|
12261
12292
|
value: function () {
|
|
12262
|
-
var _fetchCssCustomization = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function
|
|
12293
|
+
var _fetchCssCustomization = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee20(token, type) {
|
|
12263
12294
|
var options, params;
|
|
12264
|
-
return requester_regenerator().w(function (
|
|
12265
|
-
while (1) switch (
|
|
12295
|
+
return requester_regenerator().w(function (_context20) {
|
|
12296
|
+
while (1) switch (_context20.n) {
|
|
12266
12297
|
case 0:
|
|
12267
12298
|
options = {
|
|
12268
12299
|
method: "GET",
|
|
@@ -12274,11 +12305,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12274
12305
|
params = {
|
|
12275
12306
|
type: type
|
|
12276
12307
|
};
|
|
12277
|
-
return
|
|
12308
|
+
return _context20.a(2, this.fetchFromUrl(this.baseUrl + "styles/customStyles", params, options));
|
|
12278
12309
|
}
|
|
12279
|
-
},
|
|
12310
|
+
}, _callee20, this);
|
|
12280
12311
|
}));
|
|
12281
|
-
function fetchCssCustomization(
|
|
12312
|
+
function fetchCssCustomization(_x65, _x66) {
|
|
12282
12313
|
return _fetchCssCustomization.apply(this, arguments);
|
|
12283
12314
|
}
|
|
12284
12315
|
return fetchCssCustomization;
|
|
@@ -12286,10 +12317,10 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12286
12317
|
}, {
|
|
12287
12318
|
key: "postHealth",
|
|
12288
12319
|
value: function () {
|
|
12289
|
-
var _postHealth = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function
|
|
12320
|
+
var _postHealth = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee21(token, healthPingId, placeId, totemId, status) {
|
|
12290
12321
|
var requestData, params, options;
|
|
12291
|
-
return requester_regenerator().w(function (
|
|
12292
|
-
while (1) switch (
|
|
12322
|
+
return requester_regenerator().w(function (_context21) {
|
|
12323
|
+
while (1) switch (_context21.n) {
|
|
12293
12324
|
case 0:
|
|
12294
12325
|
requestData = JSON.stringify({
|
|
12295
12326
|
healthPingId: healthPingId,
|
|
@@ -12307,11 +12338,11 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12307
12338
|
},
|
|
12308
12339
|
body: requestData
|
|
12309
12340
|
};
|
|
12310
|
-
return
|
|
12341
|
+
return _context21.a(2, this.fetchFromUrl(this.baseUrlHealth, params, options));
|
|
12311
12342
|
}
|
|
12312
|
-
},
|
|
12343
|
+
}, _callee21, this);
|
|
12313
12344
|
}));
|
|
12314
|
-
function postHealth(
|
|
12345
|
+
function postHealth(_x67, _x68, _x69, _x70, _x71) {
|
|
12315
12346
|
return _postHealth.apply(this, arguments);
|
|
12316
12347
|
}
|
|
12317
12348
|
return postHealth;
|
|
@@ -13111,54 +13142,99 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13111
13142
|
return fetchAndParseRouteV2;
|
|
13112
13143
|
}()
|
|
13113
13144
|
}, {
|
|
13114
|
-
key: "
|
|
13145
|
+
key: "fetchAndParseLiveRoute",
|
|
13115
13146
|
value: function () {
|
|
13116
|
-
var
|
|
13117
|
-
var
|
|
13118
|
-
var cachedResponse, response, errorBody, typedResponseData, stopsPromises, stops, transport, _cachedResponse, _transport, _t10;
|
|
13147
|
+
var _fetchAndParseLiveRoute = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee10(config) {
|
|
13148
|
+
var response, errorBody, responseData, route, _t10;
|
|
13119
13149
|
return repository_regenerator().w(function (_context10) {
|
|
13120
13150
|
while (1) switch (_context10.p = _context10.n) {
|
|
13121
13151
|
case 0:
|
|
13122
13152
|
_context10.p = 0;
|
|
13153
|
+
_context10.n = 1;
|
|
13154
|
+
return this.requester.fetchLiveRoute(config, this.token);
|
|
13155
|
+
case 1:
|
|
13156
|
+
response = _context10.v;
|
|
13157
|
+
if (response.ok) {
|
|
13158
|
+
_context10.n = 3;
|
|
13159
|
+
break;
|
|
13160
|
+
}
|
|
13161
|
+
_context10.n = 2;
|
|
13162
|
+
return response.json();
|
|
13163
|
+
case 2:
|
|
13164
|
+
errorBody = _context10.v;
|
|
13165
|
+
throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
|
|
13166
|
+
case 3:
|
|
13167
|
+
_context10.n = 4;
|
|
13168
|
+
return response.json();
|
|
13169
|
+
case 4:
|
|
13170
|
+
responseData = _context10.v;
|
|
13171
|
+
route = new MVXRoute(responseData[0]);
|
|
13172
|
+
this.logEvent("fetchAndParseLiveRoute");
|
|
13173
|
+
this.debugLog("Live route fetched.");
|
|
13174
|
+
return _context10.a(2, route);
|
|
13175
|
+
case 5:
|
|
13176
|
+
_context10.p = 5;
|
|
13177
|
+
_t10 = _context10.v;
|
|
13178
|
+
throw new Error("Failed to fetch and parse route");
|
|
13179
|
+
case 6:
|
|
13180
|
+
return _context10.a(2);
|
|
13181
|
+
}
|
|
13182
|
+
}, _callee10, this, [[0, 5]]);
|
|
13183
|
+
}));
|
|
13184
|
+
function fetchAndParseLiveRoute(_x12) {
|
|
13185
|
+
return _fetchAndParseLiveRoute.apply(this, arguments);
|
|
13186
|
+
}
|
|
13187
|
+
return fetchAndParseLiveRoute;
|
|
13188
|
+
}()
|
|
13189
|
+
}, {
|
|
13190
|
+
key: "fetchAndParseTransport",
|
|
13191
|
+
value: function () {
|
|
13192
|
+
var _fetchAndParseTransport = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee11(stopId) {
|
|
13193
|
+
var _this7 = this;
|
|
13194
|
+
var cachedResponse, response, errorBody, typedResponseData, stopsPromises, stops, transport, _cachedResponse, _transport, _t11;
|
|
13195
|
+
return repository_regenerator().w(function (_context11) {
|
|
13196
|
+
while (1) switch (_context11.p = _context11.n) {
|
|
13197
|
+
case 0:
|
|
13198
|
+
_context11.p = 0;
|
|
13123
13199
|
cachedResponse = this.cache.getVehicle(stopId, this.currentLang);
|
|
13124
13200
|
if (!(cachedResponse != null && (Date.now() - cachedResponse.timestamp < 60 * 1000 || cachedResponse.data.routes.length === 0))) {
|
|
13125
|
-
|
|
13201
|
+
_context11.n = 1;
|
|
13126
13202
|
break;
|
|
13127
13203
|
}
|
|
13128
13204
|
this.logEvent("fetchAndParseTransport", {
|
|
13129
13205
|
cached: "true"
|
|
13130
13206
|
});
|
|
13131
|
-
return
|
|
13207
|
+
return _context11.a(2, cachedResponse.data);
|
|
13132
13208
|
case 1:
|
|
13133
|
-
|
|
13209
|
+
_context11.n = 2;
|
|
13134
13210
|
return this.requester.fetchTransport(this.token, stopId);
|
|
13135
13211
|
case 2:
|
|
13136
|
-
response =
|
|
13212
|
+
response = _context11.v;
|
|
13137
13213
|
if (response.ok) {
|
|
13138
|
-
|
|
13214
|
+
_context11.n = 4;
|
|
13139
13215
|
break;
|
|
13140
13216
|
}
|
|
13141
|
-
|
|
13217
|
+
_context11.n = 3;
|
|
13142
13218
|
return response.json();
|
|
13143
13219
|
case 3:
|
|
13144
|
-
errorBody =
|
|
13220
|
+
errorBody = _context11.v;
|
|
13145
13221
|
throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
|
|
13146
13222
|
case 4:
|
|
13147
|
-
|
|
13223
|
+
_context11.n = 5;
|
|
13148
13224
|
return response.json();
|
|
13149
13225
|
case 5:
|
|
13150
|
-
typedResponseData =
|
|
13226
|
+
typedResponseData = _context11.v;
|
|
13151
13227
|
if (!(typedResponseData.realtimeSchedules.length > 0)) {
|
|
13152
|
-
|
|
13228
|
+
_context11.n = 7;
|
|
13153
13229
|
break;
|
|
13154
13230
|
}
|
|
13155
13231
|
stopsPromises = typedResponseData.realtimeSchedules.map(function (e) {
|
|
13156
13232
|
return _this7.fetchAndParseStops(stopId, e.vehicleId);
|
|
13157
13233
|
});
|
|
13158
|
-
|
|
13234
|
+
_context11.n = 6;
|
|
13159
13235
|
return Promise.all(stopsPromises);
|
|
13160
13236
|
case 6:
|
|
13161
|
-
stops =
|
|
13237
|
+
stops = _context11.v;
|
|
13162
13238
|
if (stops.length > 0) {
|
|
13163
13239
|
typedResponseData.realtimeSchedules.forEach(function (vehicle) {
|
|
13164
13240
|
var _stops$find$places, _stops$find;
|
|
@@ -13176,13 +13252,13 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13176
13252
|
this.logEvent("fetchAndParseTransport", {
|
|
13177
13253
|
cached: "false"
|
|
13178
13254
|
});
|
|
13179
|
-
return
|
|
13255
|
+
return _context11.a(2, transport);
|
|
13180
13256
|
case 8:
|
|
13181
|
-
|
|
13182
|
-
|
|
13257
|
+
_context11.p = 8;
|
|
13258
|
+
_t11 = _context11.v;
|
|
13183
13259
|
_cachedResponse = this.cache.getVehicle(stopId, this.currentLang);
|
|
13184
13260
|
if (!(_cachedResponse != null)) {
|
|
13185
|
-
|
|
13261
|
+
_context11.n = 9;
|
|
13186
13262
|
break;
|
|
13187
13263
|
}
|
|
13188
13264
|
_transport = new MVXTransport({
|
|
@@ -13192,15 +13268,15 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13192
13268
|
this.logEvent("fetchAndParseTransport", {
|
|
13193
13269
|
cached: "true"
|
|
13194
13270
|
});
|
|
13195
|
-
return
|
|
13271
|
+
return _context11.a(2, _transport);
|
|
13196
13272
|
case 9:
|
|
13197
13273
|
throw new Error("Failed to fetch and parse transport");
|
|
13198
13274
|
case 10:
|
|
13199
|
-
return
|
|
13275
|
+
return _context11.a(2);
|
|
13200
13276
|
}
|
|
13201
|
-
},
|
|
13277
|
+
}, _callee11, this, [[0, 8]]);
|
|
13202
13278
|
}));
|
|
13203
|
-
function fetchAndParseTransport(
|
|
13279
|
+
function fetchAndParseTransport(_x13) {
|
|
13204
13280
|
return _fetchAndParseTransport.apply(this, arguments);
|
|
13205
13281
|
}
|
|
13206
13282
|
return fetchAndParseTransport;
|
|
@@ -13208,43 +13284,43 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13208
13284
|
}, {
|
|
13209
13285
|
key: "fetchAndParseStops",
|
|
13210
13286
|
value: function () {
|
|
13211
|
-
var _fetchAndParseStops = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function
|
|
13212
|
-
var cachedResponse, response, errorBody, typedResponseData, data,
|
|
13213
|
-
return repository_regenerator().w(function (
|
|
13214
|
-
while (1) switch (
|
|
13287
|
+
var _fetchAndParseStops = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee12(stopId, vehicleId) {
|
|
13288
|
+
var cachedResponse, response, errorBody, typedResponseData, data, _t12;
|
|
13289
|
+
return repository_regenerator().w(function (_context12) {
|
|
13290
|
+
while (1) switch (_context12.p = _context12.n) {
|
|
13215
13291
|
case 0:
|
|
13216
|
-
|
|
13292
|
+
_context12.p = 0;
|
|
13217
13293
|
cachedResponse = this.cache.getStops(stopId + vehicleId, this.currentLang);
|
|
13218
13294
|
if (!(cachedResponse != null && Date.now() - cachedResponse.timestamp < 60 * 1000)) {
|
|
13219
|
-
|
|
13295
|
+
_context12.n = 1;
|
|
13220
13296
|
break;
|
|
13221
13297
|
}
|
|
13222
13298
|
this.logEvent("fetchAndParseStops", {
|
|
13223
13299
|
cached: "true"
|
|
13224
13300
|
});
|
|
13225
|
-
return
|
|
13301
|
+
return _context12.a(2, {
|
|
13226
13302
|
id: vehicleId,
|
|
13227
13303
|
places: cachedResponse.data
|
|
13228
13304
|
});
|
|
13229
13305
|
case 1:
|
|
13230
|
-
|
|
13306
|
+
_context12.n = 2;
|
|
13231
13307
|
return this.requester.fetchStops(this.token, stopId, vehicleId);
|
|
13232
13308
|
case 2:
|
|
13233
|
-
response =
|
|
13309
|
+
response = _context12.v;
|
|
13234
13310
|
if (response.ok) {
|
|
13235
|
-
|
|
13311
|
+
_context12.n = 4;
|
|
13236
13312
|
break;
|
|
13237
13313
|
}
|
|
13238
|
-
|
|
13314
|
+
_context12.n = 3;
|
|
13239
13315
|
return response.json();
|
|
13240
13316
|
case 3:
|
|
13241
|
-
errorBody =
|
|
13317
|
+
errorBody = _context12.v;
|
|
13242
13318
|
throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
|
|
13243
13319
|
case 4:
|
|
13244
|
-
|
|
13320
|
+
_context12.n = 5;
|
|
13245
13321
|
return response.json();
|
|
13246
13322
|
case 5:
|
|
13247
|
-
typedResponseData =
|
|
13323
|
+
typedResponseData = _context12.v;
|
|
13248
13324
|
data = typedResponseData.map(function (e) {
|
|
13249
13325
|
return new place_MVXPlace(e);
|
|
13250
13326
|
});
|
|
@@ -13255,20 +13331,20 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13255
13331
|
this.logEvent("fetchAndParseStops", {
|
|
13256
13332
|
cached: "false"
|
|
13257
13333
|
});
|
|
13258
|
-
return
|
|
13334
|
+
return _context12.a(2, {
|
|
13259
13335
|
id: vehicleId,
|
|
13260
13336
|
places: data
|
|
13261
13337
|
});
|
|
13262
13338
|
case 6:
|
|
13263
|
-
|
|
13264
|
-
|
|
13339
|
+
_context12.p = 6;
|
|
13340
|
+
_t12 = _context12.v;
|
|
13265
13341
|
throw new Error("Failed to fetch and parse stops");
|
|
13266
13342
|
case 7:
|
|
13267
|
-
return
|
|
13343
|
+
return _context12.a(2);
|
|
13268
13344
|
}
|
|
13269
|
-
},
|
|
13345
|
+
}, _callee12, this, [[0, 6]]);
|
|
13270
13346
|
}));
|
|
13271
|
-
function fetchAndParseStops(
|
|
13347
|
+
function fetchAndParseStops(_x14, _x15) {
|
|
13272
13348
|
return _fetchAndParseStops.apply(this, arguments);
|
|
13273
13349
|
}
|
|
13274
13350
|
return fetchAndParseStops;
|
|
@@ -13276,44 +13352,44 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13276
13352
|
}, {
|
|
13277
13353
|
key: "fetchAndParseSearchResults",
|
|
13278
13354
|
value: function () {
|
|
13279
|
-
var _fetchAndParseSearchResults = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function
|
|
13280
|
-
var response, errorBody, responseData, searchResults,
|
|
13281
|
-
return repository_regenerator().w(function (
|
|
13282
|
-
while (1) switch (
|
|
13355
|
+
var _fetchAndParseSearchResults = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee13(institutionId, input, parentPlaces, origin, lat, lng, floor) {
|
|
13356
|
+
var response, errorBody, responseData, searchResults, _t13;
|
|
13357
|
+
return repository_regenerator().w(function (_context13) {
|
|
13358
|
+
while (1) switch (_context13.p = _context13.n) {
|
|
13283
13359
|
case 0:
|
|
13284
|
-
|
|
13285
|
-
|
|
13360
|
+
_context13.p = 0;
|
|
13361
|
+
_context13.n = 1;
|
|
13286
13362
|
return this.requester.fetchSearchResults(institutionId, input, this.token, parentPlaces, origin, lat, lng, floor);
|
|
13287
13363
|
case 1:
|
|
13288
|
-
response =
|
|
13364
|
+
response = _context13.v;
|
|
13289
13365
|
if (response.ok) {
|
|
13290
|
-
|
|
13366
|
+
_context13.n = 3;
|
|
13291
13367
|
break;
|
|
13292
13368
|
}
|
|
13293
|
-
|
|
13369
|
+
_context13.n = 2;
|
|
13294
13370
|
return response.json();
|
|
13295
13371
|
case 2:
|
|
13296
|
-
errorBody =
|
|
13372
|
+
errorBody = _context13.v;
|
|
13297
13373
|
throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
|
|
13298
13374
|
case 3:
|
|
13299
|
-
|
|
13375
|
+
_context13.n = 4;
|
|
13300
13376
|
return response.json();
|
|
13301
13377
|
case 4:
|
|
13302
|
-
responseData =
|
|
13378
|
+
responseData = _context13.v;
|
|
13303
13379
|
searchResults = responseData.map(function (result) {
|
|
13304
13380
|
return new place_MVXPlace(result);
|
|
13305
13381
|
});
|
|
13306
|
-
return
|
|
13382
|
+
return _context13.a(2, searchResults);
|
|
13307
13383
|
case 5:
|
|
13308
|
-
|
|
13309
|
-
|
|
13384
|
+
_context13.p = 5;
|
|
13385
|
+
_t13 = _context13.v;
|
|
13310
13386
|
throw new Error("Failed to fetch and parse search results");
|
|
13311
13387
|
case 6:
|
|
13312
|
-
return
|
|
13388
|
+
return _context13.a(2);
|
|
13313
13389
|
}
|
|
13314
|
-
},
|
|
13390
|
+
}, _callee13, this, [[0, 5]]);
|
|
13315
13391
|
}));
|
|
13316
|
-
function fetchAndParseSearchResults(
|
|
13392
|
+
function fetchAndParseSearchResults(_x16, _x17, _x18, _x19, _x20, _x21, _x22) {
|
|
13317
13393
|
return _fetchAndParseSearchResults.apply(this, arguments);
|
|
13318
13394
|
}
|
|
13319
13395
|
return fetchAndParseSearchResults;
|
|
@@ -13321,31 +13397,31 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13321
13397
|
}, {
|
|
13322
13398
|
key: "fetchAndParseSearchPlacesByTags",
|
|
13323
13399
|
value: function () {
|
|
13324
|
-
var _fetchAndParseSearchPlacesByTags = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function
|
|
13400
|
+
var _fetchAndParseSearchPlacesByTags = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee14(institutionId, tags, parentPlaces, sort, origin, lat, lng, floor) {
|
|
13325
13401
|
var _this8 = this;
|
|
13326
|
-
var response, errorBody, responseData, places,
|
|
13327
|
-
return repository_regenerator().w(function (
|
|
13328
|
-
while (1) switch (
|
|
13402
|
+
var response, errorBody, responseData, places, _t14;
|
|
13403
|
+
return repository_regenerator().w(function (_context14) {
|
|
13404
|
+
while (1) switch (_context14.p = _context14.n) {
|
|
13329
13405
|
case 0:
|
|
13330
|
-
|
|
13331
|
-
|
|
13406
|
+
_context14.p = 0;
|
|
13407
|
+
_context14.n = 1;
|
|
13332
13408
|
return this.requester.fetchSearchPlacesByTags(institutionId, tags, this.token, parentPlaces, sort, origin, lat, lng, floor);
|
|
13333
13409
|
case 1:
|
|
13334
|
-
response =
|
|
13410
|
+
response = _context14.v;
|
|
13335
13411
|
if (response.ok) {
|
|
13336
|
-
|
|
13412
|
+
_context14.n = 3;
|
|
13337
13413
|
break;
|
|
13338
13414
|
}
|
|
13339
|
-
|
|
13415
|
+
_context14.n = 2;
|
|
13340
13416
|
return response.json();
|
|
13341
13417
|
case 2:
|
|
13342
|
-
errorBody =
|
|
13418
|
+
errorBody = _context14.v;
|
|
13343
13419
|
throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
|
|
13344
13420
|
case 3:
|
|
13345
|
-
|
|
13421
|
+
_context14.n = 4;
|
|
13346
13422
|
return response.json();
|
|
13347
13423
|
case 4:
|
|
13348
|
-
responseData =
|
|
13424
|
+
responseData = _context14.v;
|
|
13349
13425
|
places = responseData.map(function (place) {
|
|
13350
13426
|
return new place_MVXPlace(place);
|
|
13351
13427
|
});
|
|
@@ -13358,17 +13434,17 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13358
13434
|
_this8.cache.setPlace(place.clientId, place, _this8.currentLang);
|
|
13359
13435
|
}
|
|
13360
13436
|
});
|
|
13361
|
-
return
|
|
13437
|
+
return _context14.a(2, places);
|
|
13362
13438
|
case 5:
|
|
13363
|
-
|
|
13364
|
-
|
|
13439
|
+
_context14.p = 5;
|
|
13440
|
+
_t14 = _context14.v;
|
|
13365
13441
|
throw new Error("Failed to fetch and parse search places by tags");
|
|
13366
13442
|
case 6:
|
|
13367
|
-
return
|
|
13443
|
+
return _context14.a(2);
|
|
13368
13444
|
}
|
|
13369
|
-
},
|
|
13445
|
+
}, _callee14, this, [[0, 5]]);
|
|
13370
13446
|
}));
|
|
13371
|
-
function fetchAndParseSearchPlacesByTags(
|
|
13447
|
+
function fetchAndParseSearchPlacesByTags(_x23, _x24, _x25, _x26, _x27, _x28, _x29, _x30) {
|
|
13372
13448
|
return _fetchAndParseSearchPlacesByTags.apply(this, arguments);
|
|
13373
13449
|
}
|
|
13374
13450
|
return fetchAndParseSearchPlacesByTags;
|
|
@@ -13376,31 +13452,31 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13376
13452
|
}, {
|
|
13377
13453
|
key: "fetchAndParseRoutesFromOrigin",
|
|
13378
13454
|
value: function () {
|
|
13379
|
-
var _fetchAndParseRoutesFromOrigin = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function
|
|
13455
|
+
var _fetchAndParseRoutesFromOrigin = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee15(parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode) {
|
|
13380
13456
|
var _this9 = this;
|
|
13381
|
-
var response, errorBody, _ref, routes, accessibleRoutes,
|
|
13382
|
-
return repository_regenerator().w(function (
|
|
13383
|
-
while (1) switch (
|
|
13457
|
+
var response, errorBody, _ref, routes, accessibleRoutes, _t15;
|
|
13458
|
+
return repository_regenerator().w(function (_context15) {
|
|
13459
|
+
while (1) switch (_context15.p = _context15.n) {
|
|
13384
13460
|
case 0:
|
|
13385
|
-
|
|
13386
|
-
|
|
13461
|
+
_context15.p = 0;
|
|
13462
|
+
_context15.n = 1;
|
|
13387
13463
|
return this.requester.fetchRoutesForOrigin(this.token, parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode);
|
|
13388
13464
|
case 1:
|
|
13389
|
-
response =
|
|
13465
|
+
response = _context15.v;
|
|
13390
13466
|
if (response.ok) {
|
|
13391
|
-
|
|
13467
|
+
_context15.n = 3;
|
|
13392
13468
|
break;
|
|
13393
13469
|
}
|
|
13394
|
-
|
|
13470
|
+
_context15.n = 2;
|
|
13395
13471
|
return response.json();
|
|
13396
13472
|
case 2:
|
|
13397
|
-
errorBody =
|
|
13473
|
+
errorBody = _context15.v;
|
|
13398
13474
|
throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
|
|
13399
13475
|
case 3:
|
|
13400
|
-
|
|
13476
|
+
_context15.n = 4;
|
|
13401
13477
|
return response.json();
|
|
13402
13478
|
case 4:
|
|
13403
|
-
_ref =
|
|
13479
|
+
_ref = _context15.v;
|
|
13404
13480
|
routes = _ref.routes;
|
|
13405
13481
|
accessibleRoutes = _ref.accessibleRoutes;
|
|
13406
13482
|
Object.entries(routes).forEach(function (_ref2) {
|
|
@@ -13424,18 +13500,18 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13424
13500
|
});
|
|
13425
13501
|
});
|
|
13426
13502
|
this.debugLog("Route cache testing. Cache populated!");
|
|
13427
|
-
|
|
13503
|
+
_context15.n = 6;
|
|
13428
13504
|
break;
|
|
13429
13505
|
case 5:
|
|
13430
|
-
|
|
13431
|
-
|
|
13506
|
+
_context15.p = 5;
|
|
13507
|
+
_t15 = _context15.v;
|
|
13432
13508
|
throw new Error("Failed to fetch and parse routes from origin results");
|
|
13433
13509
|
case 6:
|
|
13434
|
-
return
|
|
13510
|
+
return _context15.a(2);
|
|
13435
13511
|
}
|
|
13436
|
-
},
|
|
13512
|
+
}, _callee15, this, [[0, 5]]);
|
|
13437
13513
|
}));
|
|
13438
|
-
function fetchAndParseRoutesFromOrigin(
|
|
13514
|
+
function fetchAndParseRoutesFromOrigin(_x31, _x32, _x33, _x34, _x35) {
|
|
13439
13515
|
return _fetchAndParseRoutesFromOrigin.apply(this, arguments);
|
|
13440
13516
|
}
|
|
13441
13517
|
return fetchAndParseRoutesFromOrigin;
|
|
@@ -13443,42 +13519,42 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13443
13519
|
}, {
|
|
13444
13520
|
key: "fetchAndParseCacheTimestamp",
|
|
13445
13521
|
value: function () {
|
|
13446
|
-
var _fetchAndParseCacheTimestamp = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function
|
|
13447
|
-
var response, errorBody, _ref6, lastUpdate,
|
|
13448
|
-
return repository_regenerator().w(function (
|
|
13449
|
-
while (1) switch (
|
|
13522
|
+
var _fetchAndParseCacheTimestamp = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee16(parentPlaceId) {
|
|
13523
|
+
var response, errorBody, _ref6, lastUpdate, _t16;
|
|
13524
|
+
return repository_regenerator().w(function (_context16) {
|
|
13525
|
+
while (1) switch (_context16.p = _context16.n) {
|
|
13450
13526
|
case 0:
|
|
13451
|
-
|
|
13452
|
-
|
|
13527
|
+
_context16.p = 0;
|
|
13528
|
+
_context16.n = 1;
|
|
13453
13529
|
return this.requester.fetchCacheTimestamp(this.token, parentPlaceId);
|
|
13454
13530
|
case 1:
|
|
13455
|
-
response =
|
|
13531
|
+
response = _context16.v;
|
|
13456
13532
|
if (response.ok) {
|
|
13457
|
-
|
|
13533
|
+
_context16.n = 3;
|
|
13458
13534
|
break;
|
|
13459
13535
|
}
|
|
13460
|
-
|
|
13536
|
+
_context16.n = 2;
|
|
13461
13537
|
return response.json();
|
|
13462
13538
|
case 2:
|
|
13463
|
-
errorBody =
|
|
13539
|
+
errorBody = _context16.v;
|
|
13464
13540
|
throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
|
|
13465
13541
|
case 3:
|
|
13466
|
-
|
|
13542
|
+
_context16.n = 4;
|
|
13467
13543
|
return response.json();
|
|
13468
13544
|
case 4:
|
|
13469
|
-
_ref6 =
|
|
13545
|
+
_ref6 = _context16.v;
|
|
13470
13546
|
lastUpdate = _ref6.lastUpdate;
|
|
13471
|
-
return
|
|
13547
|
+
return _context16.a(2, lastUpdate);
|
|
13472
13548
|
case 5:
|
|
13473
|
-
|
|
13474
|
-
|
|
13549
|
+
_context16.p = 5;
|
|
13550
|
+
_t16 = _context16.v;
|
|
13475
13551
|
throw new Error("Failed to fetch and parse cache timestamp");
|
|
13476
13552
|
case 6:
|
|
13477
|
-
return
|
|
13553
|
+
return _context16.a(2);
|
|
13478
13554
|
}
|
|
13479
|
-
},
|
|
13555
|
+
}, _callee16, this, [[0, 5]]);
|
|
13480
13556
|
}));
|
|
13481
|
-
function fetchAndParseCacheTimestamp(
|
|
13557
|
+
function fetchAndParseCacheTimestamp(_x36) {
|
|
13482
13558
|
return _fetchAndParseCacheTimestamp.apply(this, arguments);
|
|
13483
13559
|
}
|
|
13484
13560
|
return fetchAndParseCacheTimestamp;
|
|
@@ -13492,41 +13568,41 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13492
13568
|
}, {
|
|
13493
13569
|
key: "fetchAndParseConfiguration",
|
|
13494
13570
|
value: function () {
|
|
13495
|
-
var _fetchAndParseConfiguration = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function
|
|
13496
|
-
var cachedConfig, response, errorBody, config,
|
|
13497
|
-
return repository_regenerator().w(function (
|
|
13498
|
-
while (1) switch (
|
|
13571
|
+
var _fetchAndParseConfiguration = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee17(placeId, product) {
|
|
13572
|
+
var cachedConfig, response, errorBody, config, _t17;
|
|
13573
|
+
return repository_regenerator().w(function (_context17) {
|
|
13574
|
+
while (1) switch (_context17.p = _context17.n) {
|
|
13499
13575
|
case 0:
|
|
13500
|
-
|
|
13576
|
+
_context17.p = 0;
|
|
13501
13577
|
// Check cache first
|
|
13502
13578
|
cachedConfig = this.cache.getConfiguration(placeId || "default", product || "default", this.currentLang);
|
|
13503
13579
|
if (!(cachedConfig != null)) {
|
|
13504
|
-
|
|
13580
|
+
_context17.n = 1;
|
|
13505
13581
|
break;
|
|
13506
13582
|
}
|
|
13507
13583
|
this.logEvent("fetchAndParseConfiguration", {
|
|
13508
13584
|
cached: "true"
|
|
13509
13585
|
});
|
|
13510
|
-
return
|
|
13586
|
+
return _context17.a(2, cachedConfig.data);
|
|
13511
13587
|
case 1:
|
|
13512
|
-
|
|
13588
|
+
_context17.n = 2;
|
|
13513
13589
|
return this.requester.fetchConfiguration(this.token, placeId, product);
|
|
13514
13590
|
case 2:
|
|
13515
|
-
response =
|
|
13591
|
+
response = _context17.v;
|
|
13516
13592
|
if (response.ok) {
|
|
13517
|
-
|
|
13593
|
+
_context17.n = 4;
|
|
13518
13594
|
break;
|
|
13519
13595
|
}
|
|
13520
|
-
|
|
13596
|
+
_context17.n = 3;
|
|
13521
13597
|
return response.json();
|
|
13522
13598
|
case 3:
|
|
13523
|
-
errorBody =
|
|
13599
|
+
errorBody = _context17.v;
|
|
13524
13600
|
throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
|
|
13525
13601
|
case 4:
|
|
13526
|
-
|
|
13602
|
+
_context17.n = 5;
|
|
13527
13603
|
return response.json();
|
|
13528
13604
|
case 5:
|
|
13529
|
-
config =
|
|
13605
|
+
config = _context17.v;
|
|
13530
13606
|
// Cache the result
|
|
13531
13607
|
this.cache.setConfiguration(placeId || "default", product || "default", this.currentLang, {
|
|
13532
13608
|
timestamp: Date.now(),
|
|
@@ -13535,20 +13611,20 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13535
13611
|
this.logEvent("fetchAndParseConfiguration", {
|
|
13536
13612
|
cached: "false"
|
|
13537
13613
|
});
|
|
13538
|
-
return
|
|
13614
|
+
return _context17.a(2, config);
|
|
13539
13615
|
case 6:
|
|
13540
|
-
|
|
13541
|
-
|
|
13542
|
-
this.logError(
|
|
13616
|
+
_context17.p = 6;
|
|
13617
|
+
_t17 = _context17.v;
|
|
13618
|
+
this.logError(_t17, {
|
|
13543
13619
|
functionName: "fetchAndParseConfiguration"
|
|
13544
13620
|
});
|
|
13545
13621
|
throw new Error("Failed to fetch and parse configuration");
|
|
13546
13622
|
case 7:
|
|
13547
|
-
return
|
|
13623
|
+
return _context17.a(2);
|
|
13548
13624
|
}
|
|
13549
|
-
},
|
|
13625
|
+
}, _callee17, this, [[0, 6]]);
|
|
13550
13626
|
}));
|
|
13551
|
-
function fetchAndParseConfiguration(
|
|
13627
|
+
function fetchAndParseConfiguration(_x37, _x38) {
|
|
13552
13628
|
return _fetchAndParseConfiguration.apply(this, arguments);
|
|
13553
13629
|
}
|
|
13554
13630
|
return fetchAndParseConfiguration;
|
|
@@ -13556,41 +13632,41 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13556
13632
|
}, {
|
|
13557
13633
|
key: "fetchAndParseCategories",
|
|
13558
13634
|
value: function () {
|
|
13559
|
-
var _fetchAndParseCategories = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function
|
|
13560
|
-
var cachedCategories, response, errorBody, categories,
|
|
13561
|
-
return repository_regenerator().w(function (
|
|
13562
|
-
while (1) switch (
|
|
13635
|
+
var _fetchAndParseCategories = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee18(placeId) {
|
|
13636
|
+
var cachedCategories, response, errorBody, categories, _t18;
|
|
13637
|
+
return repository_regenerator().w(function (_context18) {
|
|
13638
|
+
while (1) switch (_context18.p = _context18.n) {
|
|
13563
13639
|
case 0:
|
|
13564
|
-
|
|
13640
|
+
_context18.p = 0;
|
|
13565
13641
|
// Check cache first
|
|
13566
13642
|
cachedCategories = this.cache.getCategories(placeId || "default", this.currentLang);
|
|
13567
13643
|
if (!(cachedCategories != null)) {
|
|
13568
|
-
|
|
13644
|
+
_context18.n = 1;
|
|
13569
13645
|
break;
|
|
13570
13646
|
}
|
|
13571
13647
|
this.logEvent("fetchAndParseCategories", {
|
|
13572
13648
|
cached: "true"
|
|
13573
13649
|
});
|
|
13574
|
-
return
|
|
13650
|
+
return _context18.a(2, cachedCategories.data);
|
|
13575
13651
|
case 1:
|
|
13576
|
-
|
|
13652
|
+
_context18.n = 2;
|
|
13577
13653
|
return this.requester.fetchCategories(this.token, placeId);
|
|
13578
13654
|
case 2:
|
|
13579
|
-
response =
|
|
13655
|
+
response = _context18.v;
|
|
13580
13656
|
if (response.ok) {
|
|
13581
|
-
|
|
13657
|
+
_context18.n = 4;
|
|
13582
13658
|
break;
|
|
13583
13659
|
}
|
|
13584
|
-
|
|
13660
|
+
_context18.n = 3;
|
|
13585
13661
|
return response.json();
|
|
13586
13662
|
case 3:
|
|
13587
|
-
errorBody =
|
|
13663
|
+
errorBody = _context18.v;
|
|
13588
13664
|
throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
|
|
13589
13665
|
case 4:
|
|
13590
|
-
|
|
13666
|
+
_context18.n = 5;
|
|
13591
13667
|
return response.json();
|
|
13592
13668
|
case 5:
|
|
13593
|
-
categories =
|
|
13669
|
+
categories = _context18.v;
|
|
13594
13670
|
// Cache the result
|
|
13595
13671
|
this.cache.setCategories(placeId || "default", this.currentLang, {
|
|
13596
13672
|
timestamp: Date.now(),
|
|
@@ -13599,17 +13675,17 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13599
13675
|
this.logEvent("fetchAndParseCategories", {
|
|
13600
13676
|
cached: "false"
|
|
13601
13677
|
});
|
|
13602
|
-
return
|
|
13678
|
+
return _context18.a(2, categories);
|
|
13603
13679
|
case 6:
|
|
13604
|
-
|
|
13605
|
-
|
|
13680
|
+
_context18.p = 6;
|
|
13681
|
+
_t18 = _context18.v;
|
|
13606
13682
|
throw new Error("Failed to fetch and parse categories");
|
|
13607
13683
|
case 7:
|
|
13608
|
-
return
|
|
13684
|
+
return _context18.a(2);
|
|
13609
13685
|
}
|
|
13610
|
-
},
|
|
13686
|
+
}, _callee18, this, [[0, 6]]);
|
|
13611
13687
|
}));
|
|
13612
|
-
function fetchAndParseCategories(
|
|
13688
|
+
function fetchAndParseCategories(_x39) {
|
|
13613
13689
|
return _fetchAndParseCategories.apply(this, arguments);
|
|
13614
13690
|
}
|
|
13615
13691
|
return fetchAndParseCategories;
|
|
@@ -13617,41 +13693,41 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13617
13693
|
}, {
|
|
13618
13694
|
key: "fetchAndParseCssCustomization",
|
|
13619
13695
|
value: function () {
|
|
13620
|
-
var _fetchAndParseCssCustomization = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function
|
|
13621
|
-
var response, errorBody, cssCustomization,
|
|
13622
|
-
return repository_regenerator().w(function (
|
|
13623
|
-
while (1) switch (
|
|
13696
|
+
var _fetchAndParseCssCustomization = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee19(type) {
|
|
13697
|
+
var response, errorBody, cssCustomization, _t19;
|
|
13698
|
+
return repository_regenerator().w(function (_context19) {
|
|
13699
|
+
while (1) switch (_context19.p = _context19.n) {
|
|
13624
13700
|
case 0:
|
|
13625
|
-
|
|
13626
|
-
|
|
13701
|
+
_context19.p = 0;
|
|
13702
|
+
_context19.n = 1;
|
|
13627
13703
|
return this.requester.fetchCssCustomization(this.token, type);
|
|
13628
13704
|
case 1:
|
|
13629
|
-
response =
|
|
13705
|
+
response = _context19.v;
|
|
13630
13706
|
if (response.ok) {
|
|
13631
|
-
|
|
13707
|
+
_context19.n = 3;
|
|
13632
13708
|
break;
|
|
13633
13709
|
}
|
|
13634
|
-
|
|
13710
|
+
_context19.n = 2;
|
|
13635
13711
|
return response.json();
|
|
13636
13712
|
case 2:
|
|
13637
|
-
errorBody =
|
|
13713
|
+
errorBody = _context19.v;
|
|
13638
13714
|
throw new Error("Fetch failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
|
|
13639
13715
|
case 3:
|
|
13640
|
-
|
|
13716
|
+
_context19.n = 4;
|
|
13641
13717
|
return response.json();
|
|
13642
13718
|
case 4:
|
|
13643
|
-
cssCustomization =
|
|
13644
|
-
return
|
|
13719
|
+
cssCustomization = _context19.v;
|
|
13720
|
+
return _context19.a(2, cssCustomization);
|
|
13645
13721
|
case 5:
|
|
13646
|
-
|
|
13647
|
-
|
|
13722
|
+
_context19.p = 5;
|
|
13723
|
+
_t19 = _context19.v;
|
|
13648
13724
|
throw new Error("Failed to fetch and parse css customization");
|
|
13649
13725
|
case 6:
|
|
13650
|
-
return
|
|
13726
|
+
return _context19.a(2);
|
|
13651
13727
|
}
|
|
13652
|
-
},
|
|
13728
|
+
}, _callee19, this, [[0, 5]]);
|
|
13653
13729
|
}));
|
|
13654
|
-
function fetchAndParseCssCustomization(
|
|
13730
|
+
function fetchAndParseCssCustomization(_x40) {
|
|
13655
13731
|
return _fetchAndParseCssCustomization.apply(this, arguments);
|
|
13656
13732
|
}
|
|
13657
13733
|
return fetchAndParseCssCustomization;
|
|
@@ -13659,34 +13735,34 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
13659
13735
|
}, {
|
|
13660
13736
|
key: "postAndParseHealthPing",
|
|
13661
13737
|
value: function () {
|
|
13662
|
-
var _postAndParseHealthPing = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function
|
|
13738
|
+
var _postAndParseHealthPing = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee20(healthPingId, placeId, totemId, status) {
|
|
13663
13739
|
var response, errorBody, data;
|
|
13664
|
-
return repository_regenerator().w(function (
|
|
13665
|
-
while (1) switch (
|
|
13740
|
+
return repository_regenerator().w(function (_context20) {
|
|
13741
|
+
while (1) switch (_context20.n) {
|
|
13666
13742
|
case 0:
|
|
13667
|
-
|
|
13743
|
+
_context20.n = 1;
|
|
13668
13744
|
return this.requester.postHealth(this.token, healthPingId, placeId, totemId, status);
|
|
13669
13745
|
case 1:
|
|
13670
|
-
response =
|
|
13746
|
+
response = _context20.v;
|
|
13671
13747
|
if (response.ok) {
|
|
13672
|
-
|
|
13748
|
+
_context20.n = 3;
|
|
13673
13749
|
break;
|
|
13674
13750
|
}
|
|
13675
|
-
|
|
13751
|
+
_context20.n = 2;
|
|
13676
13752
|
return response.json();
|
|
13677
13753
|
case 2:
|
|
13678
|
-
errorBody =
|
|
13754
|
+
errorBody = _context20.v;
|
|
13679
13755
|
throw new Error("Post failed with status ".concat(response.status, ": ").concat(extractErrorMessage(errorBody)));
|
|
13680
13756
|
case 3:
|
|
13681
|
-
|
|
13757
|
+
_context20.n = 4;
|
|
13682
13758
|
return response.json();
|
|
13683
13759
|
case 4:
|
|
13684
|
-
data =
|
|
13685
|
-
return
|
|
13760
|
+
data = _context20.v;
|
|
13761
|
+
return _context20.a(2, data);
|
|
13686
13762
|
}
|
|
13687
|
-
},
|
|
13763
|
+
}, _callee20, this);
|
|
13688
13764
|
}));
|
|
13689
|
-
function postAndParseHealthPing(
|
|
13765
|
+
function postAndParseHealthPing(_x41, _x42, _x43, _x44) {
|
|
13690
13766
|
return _postAndParseHealthPing.apply(this, arguments);
|
|
13691
13767
|
}
|
|
13692
13768
|
return postAndParseHealthPing;
|
|
@@ -14223,6 +14299,18 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14223
14299
|
var _this;
|
|
14224
14300
|
map_classCallCheck(this, InternalMapVXMap);
|
|
14225
14301
|
_this = map_callSuper(this, InternalMapVXMap);
|
|
14302
|
+
/**
|
|
14303
|
+
* Id of the live route currently drawn by {@link addLiveRoute}. A live route is
|
|
14304
|
+
* refreshed repeatedly as the user moves, so each refresh replaces this one
|
|
14305
|
+
* instead of stacking another set of layers on the map.
|
|
14306
|
+
*/
|
|
14307
|
+
/**
|
|
14308
|
+
* Monotonic counter for {@link addLiveRoute} calls. Refreshes overlap (each one
|
|
14309
|
+
* awaits a fetch), so only the call holding the latest ticket may touch the
|
|
14310
|
+
* map — an older response resolving last is discarded instead of clobbering
|
|
14311
|
+
* the newer route.
|
|
14312
|
+
*/
|
|
14313
|
+
map_defineProperty(_this, "liveRouteTicket", 0);
|
|
14226
14314
|
map_defineProperty(_this, "potentialParentPlaces", []);
|
|
14227
14315
|
map_defineProperty(_this, "innerFloors", []);
|
|
14228
14316
|
map_defineProperty(_this, "subPlaces", []);
|
|
@@ -15572,18 +15660,83 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15572
15660
|
this.routeController.addRoute(_route, drawRouteConfig);
|
|
15573
15661
|
return _context.a(2, _route);
|
|
15574
15662
|
case 3:
|
|
15575
|
-
_context.p = 3;
|
|
15576
|
-
_t = _context.v;
|
|
15577
|
-
throw new Error("Error: Failed to add route");
|
|
15663
|
+
_context.p = 3;
|
|
15664
|
+
_t = _context.v;
|
|
15665
|
+
throw new Error("Error: Failed to add route");
|
|
15666
|
+
case 4:
|
|
15667
|
+
return _context.a(2);
|
|
15668
|
+
}
|
|
15669
|
+
}, _callee, this, [[1, 3]]);
|
|
15670
|
+
}));
|
|
15671
|
+
function addRoute(_x) {
|
|
15672
|
+
return _addRoute.apply(this, arguments);
|
|
15673
|
+
}
|
|
15674
|
+
return addRoute;
|
|
15675
|
+
}()
|
|
15676
|
+
}, {
|
|
15677
|
+
key: "addLiveRoute",
|
|
15678
|
+
value: function () {
|
|
15679
|
+
var _addLiveRoute = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee2(config) {
|
|
15680
|
+
var drawConfig,
|
|
15681
|
+
fetchRouteConfig,
|
|
15682
|
+
drawRouteConfig,
|
|
15683
|
+
ticket,
|
|
15684
|
+
_route2,
|
|
15685
|
+
cause,
|
|
15686
|
+
_args2 = arguments,
|
|
15687
|
+
_t2;
|
|
15688
|
+
return map_regenerator().w(function (_context2) {
|
|
15689
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
15690
|
+
case 0:
|
|
15691
|
+
drawConfig = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
|
15692
|
+
_context2.p = 1;
|
|
15693
|
+
this.logEvent("addLiveRoute");
|
|
15694
|
+
fetchRouteConfig = new InternalGetRouteConfiguration(config);
|
|
15695
|
+
drawRouteConfig = new InternalDrawRouteConfiguration(drawConfig); // Take a ticket BEFORE awaiting: refreshes overlap, and an older response
|
|
15696
|
+
// resolving after a newer one must not clobber it (stale route drawn,
|
|
15697
|
+
// liveRouteId pointing at the wrong instance).
|
|
15698
|
+
ticket = ++this.liveRouteTicket;
|
|
15699
|
+
_context2.n = 2;
|
|
15700
|
+
return this.repository.fetchAndParseLiveRoute(fetchRouteConfig);
|
|
15701
|
+
case 2:
|
|
15702
|
+
_route2 = _context2.v;
|
|
15703
|
+
if (!(ticket !== this.liveRouteTicket)) {
|
|
15704
|
+
_context2.n = 3;
|
|
15705
|
+
break;
|
|
15706
|
+
}
|
|
15707
|
+
return _context2.a(2, _route2);
|
|
15708
|
+
case 3:
|
|
15709
|
+
// Replace the previous live route so repeated refreshes don't stack paths
|
|
15710
|
+
// on the map. Removal happens AFTER the fetch, so a failed refresh leaves
|
|
15711
|
+
// the current route on screen. Targeted by id, so routes drawn with
|
|
15712
|
+
// addRoute are untouched.
|
|
15713
|
+
if (this.liveRouteId !== undefined && this.liveRouteId !== _route2.id) {
|
|
15714
|
+
this.routeController.removeRoute(this.liveRouteId);
|
|
15715
|
+
}
|
|
15716
|
+
// Clear any instance already using this id (a same-id refresh, or the same
|
|
15717
|
+
// route previously drawn via addRoute) — the controller derives its
|
|
15718
|
+
// source/layer ids from the route id, so re-adding without removing would
|
|
15719
|
+
// throw "Source already exists".
|
|
15720
|
+
if (this.routeController.getRouteIds().includes(_route2.id)) {
|
|
15721
|
+
this.routeController.removeRoute(_route2.id);
|
|
15722
|
+
}
|
|
15723
|
+
this.routeController.addRoute(_route2, drawRouteConfig);
|
|
15724
|
+
this.liveRouteId = _route2.id;
|
|
15725
|
+
return _context2.a(2, _route2);
|
|
15578
15726
|
case 4:
|
|
15579
|
-
|
|
15727
|
+
_context2.p = 4;
|
|
15728
|
+
_t2 = _context2.v;
|
|
15729
|
+
cause = _t2 instanceof Error ? _t2.message : String(_t2);
|
|
15730
|
+
throw new Error("Error: Failed to add route: ".concat(cause));
|
|
15731
|
+
case 5:
|
|
15732
|
+
return _context2.a(2);
|
|
15580
15733
|
}
|
|
15581
|
-
},
|
|
15734
|
+
}, _callee2, this, [[1, 4]]);
|
|
15582
15735
|
}));
|
|
15583
|
-
function
|
|
15584
|
-
return
|
|
15736
|
+
function addLiveRoute(_x2) {
|
|
15737
|
+
return _addLiveRoute.apply(this, arguments);
|
|
15585
15738
|
}
|
|
15586
|
-
return
|
|
15739
|
+
return addLiveRoute;
|
|
15587
15740
|
}()
|
|
15588
15741
|
}, {
|
|
15589
15742
|
key: "updateRouteProgress",
|
|
@@ -15610,6 +15763,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15610
15763
|
} catch (error) {
|
|
15611
15764
|
// Remove route may fail if no route exists
|
|
15612
15765
|
}
|
|
15766
|
+
this.syncLiveRouteId();
|
|
15613
15767
|
}
|
|
15614
15768
|
}, {
|
|
15615
15769
|
key: "removeRouteById",
|
|
@@ -15620,6 +15774,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15620
15774
|
} catch (error) {
|
|
15621
15775
|
// Remove route may fail if route doesn't exist
|
|
15622
15776
|
}
|
|
15777
|
+
this.syncLiveRouteId();
|
|
15623
15778
|
}
|
|
15624
15779
|
}, {
|
|
15625
15780
|
key: "removeAllRoutes",
|
|
@@ -15630,6 +15785,22 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15630
15785
|
} catch (error) {
|
|
15631
15786
|
// Remove all routes may fail
|
|
15632
15787
|
}
|
|
15788
|
+
this.syncLiveRouteId();
|
|
15789
|
+
}
|
|
15790
|
+
|
|
15791
|
+
/**
|
|
15792
|
+
* Drop {@link liveRouteId} when the instance it points at is no longer on the
|
|
15793
|
+
* map (removed via removeRoute/removeRouteById/removeAllRoutes — including the
|
|
15794
|
+
* no-arg removeRoute, which removes the last-added route). Keeps the live
|
|
15795
|
+
* bookkeeping in sync so a later {@link addLiveRoute} doesn't act on a
|
|
15796
|
+
* dangling id.
|
|
15797
|
+
*/
|
|
15798
|
+
}, {
|
|
15799
|
+
key: "syncLiveRouteId",
|
|
15800
|
+
value: function syncLiveRouteId() {
|
|
15801
|
+
if (this.liveRouteId !== undefined && !this.routeController.getRouteIds().includes(this.liveRouteId)) {
|
|
15802
|
+
this.liveRouteId = undefined;
|
|
15803
|
+
}
|
|
15633
15804
|
}
|
|
15634
15805
|
}, {
|
|
15635
15806
|
key: "getActiveRouteIds",
|
|
@@ -15670,10 +15841,10 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15670
15841
|
value: function defaultClickListener() {
|
|
15671
15842
|
var _this12 = this;
|
|
15672
15843
|
this.map.on("click", /*#__PURE__*/function () {
|
|
15673
|
-
var _ref4 = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function
|
|
15674
|
-
var features, roomFeatures, touchedFeature, ref, _clickedPlace, _ref5, _clickedPlace$mapvxId, _clickedPlace2, _clickedPlace3, clickedPlace, _iterator3, _step3, potentialParentPlace, cachedSubPlaces, cachedPlaces, clickedPlaceId,
|
|
15675
|
-
return map_regenerator().w(function (
|
|
15676
|
-
while (1) switch (
|
|
15844
|
+
var _ref4 = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee3(e) {
|
|
15845
|
+
var features, roomFeatures, touchedFeature, ref, _clickedPlace, _ref5, _clickedPlace$mapvxId, _clickedPlace2, _clickedPlace3, clickedPlace, _iterator3, _step3, potentialParentPlace, cachedSubPlaces, cachedPlaces, clickedPlaceId, _t3;
|
|
15846
|
+
return map_regenerator().w(function (_context3) {
|
|
15847
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
15677
15848
|
case 0:
|
|
15678
15849
|
features = _this12.map.queryRenderedFeatures(e.point); // Filter room features by current floor
|
|
15679
15850
|
roomFeatures = features.filter(function (feature) {
|
|
@@ -15683,7 +15854,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15683
15854
|
touchedFeature = roomFeatures[0];
|
|
15684
15855
|
ref = touchedFeature === null || touchedFeature === void 0 ? void 0 : touchedFeature.properties.ref;
|
|
15685
15856
|
if (!(ref != null && typeof ref === "string" && ref.length > 0)) {
|
|
15686
|
-
|
|
15857
|
+
_context3.n = 11;
|
|
15687
15858
|
break;
|
|
15688
15859
|
}
|
|
15689
15860
|
console.log("touchedFeature", ref);
|
|
@@ -15693,63 +15864,63 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15693
15864
|
return subPlace.mapvxId === ref;
|
|
15694
15865
|
}); // If not found, search in subplaces of potential parent places
|
|
15695
15866
|
if (!(clickedPlace === undefined)) {
|
|
15696
|
-
|
|
15867
|
+
_context3.n = 7;
|
|
15697
15868
|
break;
|
|
15698
15869
|
}
|
|
15699
15870
|
_iterator3 = map_createForOfIteratorHelper(_this12.potentialParentPlaces);
|
|
15700
|
-
|
|
15871
|
+
_context3.p = 1;
|
|
15701
15872
|
_iterator3.s();
|
|
15702
15873
|
case 2:
|
|
15703
15874
|
if ((_step3 = _iterator3.n()).done) {
|
|
15704
|
-
|
|
15875
|
+
_context3.n = 4;
|
|
15705
15876
|
break;
|
|
15706
15877
|
}
|
|
15707
15878
|
potentialParentPlace = _step3.value;
|
|
15708
15879
|
cachedSubPlaces = _this12.repository.getCachedSubPlaces(potentialParentPlace.mapvxId);
|
|
15709
15880
|
if (!cachedSubPlaces) {
|
|
15710
|
-
|
|
15881
|
+
_context3.n = 3;
|
|
15711
15882
|
break;
|
|
15712
15883
|
}
|
|
15713
15884
|
clickedPlace = cachedSubPlaces.find(function (subPlace) {
|
|
15714
15885
|
return subPlace.mapvxId === ref;
|
|
15715
15886
|
});
|
|
15716
15887
|
if (!(clickedPlace !== undefined)) {
|
|
15717
|
-
|
|
15888
|
+
_context3.n = 3;
|
|
15718
15889
|
break;
|
|
15719
15890
|
}
|
|
15720
|
-
return
|
|
15891
|
+
return _context3.a(3, 4);
|
|
15721
15892
|
case 3:
|
|
15722
|
-
|
|
15893
|
+
_context3.n = 2;
|
|
15723
15894
|
break;
|
|
15724
15895
|
case 4:
|
|
15725
|
-
|
|
15896
|
+
_context3.n = 6;
|
|
15726
15897
|
break;
|
|
15727
15898
|
case 5:
|
|
15728
|
-
|
|
15729
|
-
|
|
15730
|
-
_iterator3.e(
|
|
15899
|
+
_context3.p = 5;
|
|
15900
|
+
_t3 = _context3.v;
|
|
15901
|
+
_iterator3.e(_t3);
|
|
15731
15902
|
case 6:
|
|
15732
|
-
|
|
15903
|
+
_context3.p = 6;
|
|
15733
15904
|
_iterator3.f();
|
|
15734
|
-
return
|
|
15905
|
+
return _context3.f(6);
|
|
15735
15906
|
case 7:
|
|
15736
15907
|
if (!(clickedPlace === undefined)) {
|
|
15737
|
-
|
|
15908
|
+
_context3.n = 10;
|
|
15738
15909
|
break;
|
|
15739
15910
|
}
|
|
15740
15911
|
cachedPlaces = _this12.repository.getCachedPlaces([ref]);
|
|
15741
15912
|
if (!(cachedPlaces.length === 0)) {
|
|
15742
|
-
|
|
15913
|
+
_context3.n = 9;
|
|
15743
15914
|
break;
|
|
15744
15915
|
}
|
|
15745
15916
|
console.log("fetching place detail from server", ref);
|
|
15746
|
-
|
|
15917
|
+
_context3.n = 8;
|
|
15747
15918
|
return _this12.repository.fetchAndParsePlaceDetail({
|
|
15748
15919
|
id: ref
|
|
15749
15920
|
});
|
|
15750
15921
|
case 8:
|
|
15751
|
-
clickedPlace =
|
|
15752
|
-
|
|
15922
|
+
clickedPlace = _context3.v;
|
|
15923
|
+
_context3.n = 10;
|
|
15753
15924
|
break;
|
|
15754
15925
|
case 9:
|
|
15755
15926
|
console.log("using cached place detail", ref);
|
|
@@ -15761,11 +15932,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15761
15932
|
_this12.clickCallback(clickedPlaceId);
|
|
15762
15933
|
}
|
|
15763
15934
|
case 11:
|
|
15764
|
-
return
|
|
15935
|
+
return _context3.a(2);
|
|
15765
15936
|
}
|
|
15766
|
-
},
|
|
15937
|
+
}, _callee3, null, [[1, 5, 6, 7]]);
|
|
15767
15938
|
}));
|
|
15768
|
-
return function (
|
|
15939
|
+
return function (_x3) {
|
|
15769
15940
|
return _ref4.apply(this, arguments);
|
|
15770
15941
|
};
|
|
15771
15942
|
}());
|
|
@@ -15904,49 +16075,49 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15904
16075
|
}, {
|
|
15905
16076
|
key: "startAnimateRoute",
|
|
15906
16077
|
value: function () {
|
|
15907
|
-
var _startAnimateRoute = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function
|
|
16078
|
+
var _startAnimateRoute = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee4(routeConfig) {
|
|
15908
16079
|
var drawConfig,
|
|
15909
16080
|
animationConfig,
|
|
15910
|
-
|
|
16081
|
+
_route3,
|
|
15911
16082
|
fetchRouteConfig,
|
|
15912
16083
|
drawRouteConfig,
|
|
15913
16084
|
animationRouteConfig,
|
|
15914
|
-
|
|
15915
|
-
|
|
15916
|
-
return map_regenerator().w(function (
|
|
15917
|
-
while (1) switch (
|
|
16085
|
+
_args4 = arguments,
|
|
16086
|
+
_t4;
|
|
16087
|
+
return map_regenerator().w(function (_context4) {
|
|
16088
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
15918
16089
|
case 0:
|
|
15919
|
-
drawConfig =
|
|
15920
|
-
animationConfig =
|
|
15921
|
-
|
|
16090
|
+
drawConfig = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
|
16091
|
+
animationConfig = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
|
|
16092
|
+
_context4.p = 1;
|
|
15922
16093
|
if (!(routeConfig instanceof MVXRoute)) {
|
|
15923
|
-
|
|
16094
|
+
_context4.n = 2;
|
|
15924
16095
|
break;
|
|
15925
16096
|
}
|
|
15926
|
-
|
|
15927
|
-
|
|
16097
|
+
_route3 = routeConfig;
|
|
16098
|
+
_context4.n = 4;
|
|
15928
16099
|
break;
|
|
15929
16100
|
case 2:
|
|
15930
16101
|
fetchRouteConfig = new InternalGetRouteConfiguration(routeConfig);
|
|
15931
|
-
|
|
16102
|
+
_context4.n = 3;
|
|
15932
16103
|
return this.repository.fetchAndParseRoute(fetchRouteConfig);
|
|
15933
16104
|
case 3:
|
|
15934
|
-
|
|
16105
|
+
_route3 = _context4.v;
|
|
15935
16106
|
case 4:
|
|
15936
16107
|
drawRouteConfig = new InternalAnimationDrawingConfig(drawConfig);
|
|
15937
16108
|
animationRouteConfig = new InternalAnimationConfig(animationConfig);
|
|
15938
|
-
this.routeController.startAnimating(
|
|
15939
|
-
return
|
|
16109
|
+
this.routeController.startAnimating(_route3, drawRouteConfig, animationRouteConfig);
|
|
16110
|
+
return _context4.a(2, _route3);
|
|
15940
16111
|
case 5:
|
|
15941
|
-
|
|
15942
|
-
|
|
16112
|
+
_context4.p = 5;
|
|
16113
|
+
_t4 = _context4.v;
|
|
15943
16114
|
throw new Error("Error: Failed to start animating route");
|
|
15944
16115
|
case 6:
|
|
15945
|
-
return
|
|
16116
|
+
return _context4.a(2);
|
|
15946
16117
|
}
|
|
15947
|
-
},
|
|
16118
|
+
}, _callee4, this, [[1, 5]]);
|
|
15948
16119
|
}));
|
|
15949
|
-
function startAnimateRoute(
|
|
16120
|
+
function startAnimateRoute(_x4) {
|
|
15950
16121
|
return _startAnimateRoute.apply(this, arguments);
|
|
15951
16122
|
}
|
|
15952
16123
|
return startAnimateRoute;
|
|
@@ -15954,49 +16125,49 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15954
16125
|
}, {
|
|
15955
16126
|
key: "startAnimateRouteV2",
|
|
15956
16127
|
value: function () {
|
|
15957
|
-
var _startAnimateRouteV = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function
|
|
16128
|
+
var _startAnimateRouteV = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee5(routeConfig) {
|
|
15958
16129
|
var drawConfig,
|
|
15959
16130
|
animationConfig,
|
|
15960
|
-
|
|
16131
|
+
_route4,
|
|
15961
16132
|
fetchRouteConfig,
|
|
15962
16133
|
drawRouteConfig,
|
|
15963
16134
|
animationRouteConfig,
|
|
15964
|
-
|
|
15965
|
-
|
|
15966
|
-
return map_regenerator().w(function (
|
|
15967
|
-
while (1) switch (
|
|
16135
|
+
_args5 = arguments,
|
|
16136
|
+
_t5;
|
|
16137
|
+
return map_regenerator().w(function (_context5) {
|
|
16138
|
+
while (1) switch (_context5.p = _context5.n) {
|
|
15968
16139
|
case 0:
|
|
15969
|
-
drawConfig =
|
|
15970
|
-
animationConfig =
|
|
15971
|
-
|
|
16140
|
+
drawConfig = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
|
16141
|
+
animationConfig = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
|
|
16142
|
+
_context5.p = 1;
|
|
15972
16143
|
if (!(routeConfig instanceof MVXRoute)) {
|
|
15973
|
-
|
|
16144
|
+
_context5.n = 2;
|
|
15974
16145
|
break;
|
|
15975
16146
|
}
|
|
15976
|
-
|
|
15977
|
-
|
|
16147
|
+
_route4 = routeConfig;
|
|
16148
|
+
_context5.n = 4;
|
|
15978
16149
|
break;
|
|
15979
16150
|
case 2:
|
|
15980
16151
|
fetchRouteConfig = new InternalGetRouteConfiguration(routeConfig);
|
|
15981
|
-
|
|
16152
|
+
_context5.n = 3;
|
|
15982
16153
|
return this.repository.fetchAndParseRouteV2(fetchRouteConfig);
|
|
15983
16154
|
case 3:
|
|
15984
|
-
|
|
16155
|
+
_route4 = _context5.v;
|
|
15985
16156
|
case 4:
|
|
15986
16157
|
drawRouteConfig = new InternalAnimationDrawingConfig(drawConfig);
|
|
15987
16158
|
animationRouteConfig = new InternalAnimationConfig(animationConfig);
|
|
15988
|
-
this.routeController.startAnimating(
|
|
15989
|
-
return
|
|
16159
|
+
this.routeController.startAnimating(_route4, drawRouteConfig, animationRouteConfig);
|
|
16160
|
+
return _context5.a(2, _route4);
|
|
15990
16161
|
case 5:
|
|
15991
|
-
|
|
15992
|
-
|
|
16162
|
+
_context5.p = 5;
|
|
16163
|
+
_t5 = _context5.v;
|
|
15993
16164
|
throw new Error("Error: Failed to start animating route");
|
|
15994
16165
|
case 6:
|
|
15995
|
-
return
|
|
16166
|
+
return _context5.a(2);
|
|
15996
16167
|
}
|
|
15997
|
-
},
|
|
16168
|
+
}, _callee5, this, [[1, 5]]);
|
|
15998
16169
|
}));
|
|
15999
|
-
function startAnimateRouteV2(
|
|
16170
|
+
function startAnimateRouteV2(_x5) {
|
|
16000
16171
|
return _startAnimateRouteV.apply(this, arguments);
|
|
16001
16172
|
}
|
|
16002
16173
|
return startAnimateRouteV2;
|
|
@@ -16041,50 +16212,50 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
16041
16212
|
}, {
|
|
16042
16213
|
key: "addStepAnimation",
|
|
16043
16214
|
value: function () {
|
|
16044
|
-
var _addStepAnimation = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function
|
|
16215
|
+
var _addStepAnimation = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee6(routeConfig) {
|
|
16045
16216
|
var drawConfig,
|
|
16046
16217
|
animationConfig,
|
|
16047
|
-
|
|
16218
|
+
_route5,
|
|
16048
16219
|
fetchRouteConfig,
|
|
16049
16220
|
drawRouteConfig,
|
|
16050
16221
|
animationRouteConfig,
|
|
16051
|
-
|
|
16052
|
-
|
|
16053
|
-
return map_regenerator().w(function (
|
|
16054
|
-
while (1) switch (
|
|
16222
|
+
_args6 = arguments,
|
|
16223
|
+
_t6;
|
|
16224
|
+
return map_regenerator().w(function (_context6) {
|
|
16225
|
+
while (1) switch (_context6.p = _context6.n) {
|
|
16055
16226
|
case 0:
|
|
16056
|
-
drawConfig =
|
|
16057
|
-
animationConfig =
|
|
16058
|
-
|
|
16227
|
+
drawConfig = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
|
16228
|
+
animationConfig = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
|
|
16229
|
+
_context6.p = 1;
|
|
16059
16230
|
if (!(routeConfig instanceof MVXRoute)) {
|
|
16060
|
-
|
|
16231
|
+
_context6.n = 2;
|
|
16061
16232
|
break;
|
|
16062
16233
|
}
|
|
16063
|
-
|
|
16064
|
-
|
|
16234
|
+
_route5 = routeConfig;
|
|
16235
|
+
_context6.n = 4;
|
|
16065
16236
|
break;
|
|
16066
16237
|
case 2:
|
|
16067
16238
|
fetchRouteConfig = new InternalGetRouteConfiguration(routeConfig);
|
|
16068
|
-
|
|
16239
|
+
_context6.n = 3;
|
|
16069
16240
|
return this.repository.fetchAndParseRoute(fetchRouteConfig);
|
|
16070
16241
|
case 3:
|
|
16071
|
-
|
|
16242
|
+
_route5 = _context6.v;
|
|
16072
16243
|
case 4:
|
|
16073
16244
|
drawRouteConfig = new InternalAnimationDrawingConfig(drawConfig);
|
|
16074
16245
|
animationRouteConfig = new InternalAnimationConfig(animationConfig);
|
|
16075
|
-
this.routeController.addStepAnimation(
|
|
16246
|
+
this.routeController.addStepAnimation(_route5, drawRouteConfig, animationRouteConfig);
|
|
16076
16247
|
this.logEvent("addStepAnimation");
|
|
16077
|
-
return
|
|
16248
|
+
return _context6.a(2, _route5);
|
|
16078
16249
|
case 5:
|
|
16079
|
-
|
|
16080
|
-
|
|
16250
|
+
_context6.p = 5;
|
|
16251
|
+
_t6 = _context6.v;
|
|
16081
16252
|
throw new Error("Error: Failed to add step animation");
|
|
16082
16253
|
case 6:
|
|
16083
|
-
return
|
|
16254
|
+
return _context6.a(2);
|
|
16084
16255
|
}
|
|
16085
|
-
},
|
|
16256
|
+
}, _callee6, this, [[1, 5]]);
|
|
16086
16257
|
}));
|
|
16087
|
-
function addStepAnimation(
|
|
16258
|
+
function addStepAnimation(_x6) {
|
|
16088
16259
|
return _addStepAnimation.apply(this, arguments);
|
|
16089
16260
|
}
|
|
16090
16261
|
return addStepAnimation;
|
|
@@ -16092,50 +16263,50 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
16092
16263
|
}, {
|
|
16093
16264
|
key: "addStepAnimationV2",
|
|
16094
16265
|
value: function () {
|
|
16095
|
-
var _addStepAnimationV = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function
|
|
16266
|
+
var _addStepAnimationV = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee7(routeConfig) {
|
|
16096
16267
|
var drawConfig,
|
|
16097
16268
|
animationConfig,
|
|
16098
|
-
|
|
16269
|
+
_route6,
|
|
16099
16270
|
fetchRouteConfig,
|
|
16100
16271
|
drawRouteConfig,
|
|
16101
16272
|
animationRouteConfig,
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
return map_regenerator().w(function (
|
|
16105
|
-
while (1) switch (
|
|
16273
|
+
_args7 = arguments,
|
|
16274
|
+
_t7;
|
|
16275
|
+
return map_regenerator().w(function (_context7) {
|
|
16276
|
+
while (1) switch (_context7.p = _context7.n) {
|
|
16106
16277
|
case 0:
|
|
16107
|
-
drawConfig =
|
|
16108
|
-
animationConfig =
|
|
16109
|
-
|
|
16278
|
+
drawConfig = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
|
16279
|
+
animationConfig = _args7.length > 2 && _args7[2] !== undefined ? _args7[2] : {};
|
|
16280
|
+
_context7.p = 1;
|
|
16110
16281
|
if (!(routeConfig instanceof MVXRoute)) {
|
|
16111
|
-
|
|
16282
|
+
_context7.n = 2;
|
|
16112
16283
|
break;
|
|
16113
16284
|
}
|
|
16114
|
-
|
|
16115
|
-
|
|
16285
|
+
_route6 = routeConfig;
|
|
16286
|
+
_context7.n = 4;
|
|
16116
16287
|
break;
|
|
16117
16288
|
case 2:
|
|
16118
16289
|
fetchRouteConfig = new InternalGetRouteConfiguration(routeConfig);
|
|
16119
|
-
|
|
16290
|
+
_context7.n = 3;
|
|
16120
16291
|
return this.repository.fetchAndParseRouteV2(fetchRouteConfig);
|
|
16121
16292
|
case 3:
|
|
16122
|
-
|
|
16293
|
+
_route6 = _context7.v;
|
|
16123
16294
|
case 4:
|
|
16124
16295
|
drawRouteConfig = new InternalAnimationDrawingConfig(drawConfig);
|
|
16125
16296
|
animationRouteConfig = new InternalAnimationConfig(animationConfig);
|
|
16126
|
-
this.routeController.addStepAnimation(
|
|
16297
|
+
this.routeController.addStepAnimation(_route6, drawRouteConfig, animationRouteConfig);
|
|
16127
16298
|
this.logEvent("addStepAnimationV2");
|
|
16128
|
-
return
|
|
16299
|
+
return _context7.a(2, _route6);
|
|
16129
16300
|
case 5:
|
|
16130
|
-
|
|
16131
|
-
|
|
16301
|
+
_context7.p = 5;
|
|
16302
|
+
_t7 = _context7.v;
|
|
16132
16303
|
throw new Error("Error: Failed to add step animation");
|
|
16133
16304
|
case 6:
|
|
16134
|
-
return
|
|
16305
|
+
return _context7.a(2);
|
|
16135
16306
|
}
|
|
16136
|
-
},
|
|
16307
|
+
}, _callee7, this, [[1, 5]]);
|
|
16137
16308
|
}));
|
|
16138
|
-
function addStepAnimationV2(
|
|
16309
|
+
function addStepAnimationV2(_x7) {
|
|
16139
16310
|
return _addStepAnimationV.apply(this, arguments);
|
|
16140
16311
|
}
|
|
16141
16312
|
return addStepAnimationV2;
|
|
@@ -16985,32 +17156,62 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
16985
17156
|
return getRouteV2;
|
|
16986
17157
|
}()
|
|
16987
17158
|
}, {
|
|
16988
|
-
key: "
|
|
17159
|
+
key: "getLiveRoute",
|
|
16989
17160
|
value: function () {
|
|
16990
|
-
var
|
|
16991
|
-
var
|
|
17161
|
+
var _getLiveRoute = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee11(routeConfig) {
|
|
17162
|
+
var config, route, _t11;
|
|
16992
17163
|
return sdk_regenerator().w(function (_context11) {
|
|
16993
17164
|
while (1) switch (_context11.p = _context11.n) {
|
|
16994
17165
|
case 0:
|
|
16995
17166
|
_context11.p = 0;
|
|
16996
|
-
|
|
16997
|
-
parentPlaces = parentPlaceId ? otherParentPlacesIds ? [parentPlaceId].concat(sdk_toConsumableArray(otherParentPlacesIds)) : [parentPlaceId] : otherParentPlacesIds;
|
|
17167
|
+
config = new InternalGetRouteConfiguration(routeConfig);
|
|
16998
17168
|
_context11.n = 1;
|
|
16999
|
-
return this.repository.
|
|
17169
|
+
return this.repository.fetchAndParseLiveRoute(config);
|
|
17000
17170
|
case 1:
|
|
17001
|
-
|
|
17002
|
-
this.logEvent("
|
|
17003
|
-
return _context11.a(2,
|
|
17171
|
+
route = _context11.v;
|
|
17172
|
+
this.logEvent("getLiveRoute");
|
|
17173
|
+
return _context11.a(2, route);
|
|
17004
17174
|
case 2:
|
|
17005
17175
|
_context11.p = 2;
|
|
17006
17176
|
_t11 = _context11.v;
|
|
17007
|
-
throw new Error("Failed to get
|
|
17177
|
+
throw new Error("Failed to get route");
|
|
17008
17178
|
case 3:
|
|
17009
17179
|
return _context11.a(2);
|
|
17010
17180
|
}
|
|
17011
17181
|
}, _callee11, this, [[0, 2]]);
|
|
17012
17182
|
}));
|
|
17013
|
-
function
|
|
17183
|
+
function getLiveRoute(_x13) {
|
|
17184
|
+
return _getLiveRoute.apply(this, arguments);
|
|
17185
|
+
}
|
|
17186
|
+
return getLiveRoute;
|
|
17187
|
+
}()
|
|
17188
|
+
}, {
|
|
17189
|
+
key: "getPlacesByInput",
|
|
17190
|
+
value: function () {
|
|
17191
|
+
var _getPlacesByInput = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee12(input, institutionId, parentPlaceId, otherParentPlacesIds, origin, lat, lng, floor) {
|
|
17192
|
+
var parentPlaces, places, _t12;
|
|
17193
|
+
return sdk_regenerator().w(function (_context12) {
|
|
17194
|
+
while (1) switch (_context12.p = _context12.n) {
|
|
17195
|
+
case 0:
|
|
17196
|
+
_context12.p = 0;
|
|
17197
|
+
// TODO: se debe cambiar a usar un solo parámetro en la siguiente version major.
|
|
17198
|
+
parentPlaces = parentPlaceId ? otherParentPlacesIds ? [parentPlaceId].concat(sdk_toConsumableArray(otherParentPlacesIds)) : [parentPlaceId] : otherParentPlacesIds;
|
|
17199
|
+
_context12.n = 1;
|
|
17200
|
+
return this.repository.fetchAndParseSearchResults(institutionId, input, parentPlaces, origin, lat, lng, floor);
|
|
17201
|
+
case 1:
|
|
17202
|
+
places = _context12.v;
|
|
17203
|
+
this.logEvent("getPlacesByInput");
|
|
17204
|
+
return _context12.a(2, places);
|
|
17205
|
+
case 2:
|
|
17206
|
+
_context12.p = 2;
|
|
17207
|
+
_t12 = _context12.v;
|
|
17208
|
+
throw new Error("Failed to get places by input");
|
|
17209
|
+
case 3:
|
|
17210
|
+
return _context12.a(2);
|
|
17211
|
+
}
|
|
17212
|
+
}, _callee12, this, [[0, 2]]);
|
|
17213
|
+
}));
|
|
17214
|
+
function getPlacesByInput(_x14, _x15, _x16, _x17, _x18, _x19, _x20, _x21) {
|
|
17014
17215
|
return _getPlacesByInput.apply(this, arguments);
|
|
17015
17216
|
}
|
|
17016
17217
|
return getPlacesByInput;
|
|
@@ -17018,7 +17219,7 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
17018
17219
|
}, {
|
|
17019
17220
|
key: "searchPlacesByTags",
|
|
17020
17221
|
value: function () {
|
|
17021
|
-
var _searchPlacesByTags = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function
|
|
17222
|
+
var _searchPlacesByTags = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee13(institutionId, tags) {
|
|
17022
17223
|
var options,
|
|
17023
17224
|
parentPlaces,
|
|
17024
17225
|
sort,
|
|
@@ -17028,47 +17229,47 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
17028
17229
|
floor,
|
|
17029
17230
|
hasCoordinateContext,
|
|
17030
17231
|
places,
|
|
17031
|
-
|
|
17032
|
-
|
|
17033
|
-
return sdk_regenerator().w(function (
|
|
17034
|
-
while (1) switch (
|
|
17232
|
+
_args13 = arguments,
|
|
17233
|
+
_t13;
|
|
17234
|
+
return sdk_regenerator().w(function (_context13) {
|
|
17235
|
+
while (1) switch (_context13.p = _context13.n) {
|
|
17035
17236
|
case 0:
|
|
17036
|
-
options =
|
|
17237
|
+
options = _args13.length > 2 && _args13[2] !== undefined ? _args13[2] : {};
|
|
17037
17238
|
if (!(!tags || tags.length === 0)) {
|
|
17038
|
-
|
|
17239
|
+
_context13.n = 1;
|
|
17039
17240
|
break;
|
|
17040
17241
|
}
|
|
17041
17242
|
throw new Error("searchPlacesByTags requires at least one tag");
|
|
17042
17243
|
case 1:
|
|
17043
17244
|
parentPlaces = options.parentPlaces, sort = options.sort, origin = options.origin, lat = options.lat, lng = options.lng, floor = options.floor;
|
|
17044
17245
|
if (!(sort === "distance")) {
|
|
17045
|
-
|
|
17246
|
+
_context13.n = 2;
|
|
17046
17247
|
break;
|
|
17047
17248
|
}
|
|
17048
17249
|
hasCoordinateContext = lat != null && lng != null && floor != null && parentPlaces != null && parentPlaces.length > 0;
|
|
17049
17250
|
if (!(!origin && !hasCoordinateContext)) {
|
|
17050
|
-
|
|
17251
|
+
_context13.n = 2;
|
|
17051
17252
|
break;
|
|
17052
17253
|
}
|
|
17053
17254
|
throw new Error('searchPlacesByTags with sort "distance" requires "origin" or "lat" + "lng" + "floor" + "parentPlaces"');
|
|
17054
17255
|
case 2:
|
|
17055
|
-
|
|
17056
|
-
|
|
17256
|
+
_context13.p = 2;
|
|
17257
|
+
_context13.n = 3;
|
|
17057
17258
|
return this.repository.fetchAndParseSearchPlacesByTags(institutionId, tags, parentPlaces, sort, origin, lat, lng, floor);
|
|
17058
17259
|
case 3:
|
|
17059
|
-
places =
|
|
17260
|
+
places = _context13.v;
|
|
17060
17261
|
this.logEvent("searchPlacesByTags");
|
|
17061
|
-
return
|
|
17262
|
+
return _context13.a(2, places);
|
|
17062
17263
|
case 4:
|
|
17063
|
-
|
|
17064
|
-
|
|
17264
|
+
_context13.p = 4;
|
|
17265
|
+
_t13 = _context13.v;
|
|
17065
17266
|
throw new Error("Failed to search places by tags");
|
|
17066
17267
|
case 5:
|
|
17067
|
-
return
|
|
17268
|
+
return _context13.a(2);
|
|
17068
17269
|
}
|
|
17069
|
-
},
|
|
17270
|
+
}, _callee13, this, [[2, 4]]);
|
|
17070
17271
|
}));
|
|
17071
|
-
function searchPlacesByTags(
|
|
17272
|
+
function searchPlacesByTags(_x22, _x23) {
|
|
17072
17273
|
return _searchPlacesByTags.apply(this, arguments);
|
|
17073
17274
|
}
|
|
17074
17275
|
return searchPlacesByTags;
|
|
@@ -17076,26 +17277,26 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
17076
17277
|
}, {
|
|
17077
17278
|
key: "getPlacesByCategory",
|
|
17078
17279
|
value: function () {
|
|
17079
|
-
var _getPlacesByCategory = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function
|
|
17080
|
-
var
|
|
17081
|
-
return sdk_regenerator().w(function (
|
|
17082
|
-
while (1) switch (
|
|
17280
|
+
var _getPlacesByCategory = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee14(category) {
|
|
17281
|
+
var _t14;
|
|
17282
|
+
return sdk_regenerator().w(function (_context14) {
|
|
17283
|
+
while (1) switch (_context14.p = _context14.n) {
|
|
17083
17284
|
case 0:
|
|
17084
|
-
|
|
17285
|
+
_context14.p = 0;
|
|
17085
17286
|
// TODO: Implement proper category-based search when API endpoint is available
|
|
17086
17287
|
// For now, return an empty array as a placeholder implementation
|
|
17087
17288
|
this.logEvent("getPlacesByCategory");
|
|
17088
|
-
return
|
|
17289
|
+
return _context14.a(2, []);
|
|
17089
17290
|
case 1:
|
|
17090
|
-
|
|
17091
|
-
|
|
17291
|
+
_context14.p = 1;
|
|
17292
|
+
_t14 = _context14.v;
|
|
17092
17293
|
throw new Error("Failed to get places by category");
|
|
17093
17294
|
case 2:
|
|
17094
|
-
return
|
|
17295
|
+
return _context14.a(2);
|
|
17095
17296
|
}
|
|
17096
|
-
},
|
|
17297
|
+
}, _callee14, this, [[0, 1]]);
|
|
17097
17298
|
}));
|
|
17098
|
-
function getPlacesByCategory(
|
|
17299
|
+
function getPlacesByCategory(_x24) {
|
|
17099
17300
|
return _getPlacesByCategory.apply(this, arguments);
|
|
17100
17301
|
}
|
|
17101
17302
|
return getPlacesByCategory;
|
|
@@ -17190,18 +17391,18 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
17190
17391
|
}, {
|
|
17191
17392
|
key: "loadRoutesForOriginCache",
|
|
17192
17393
|
value: function () {
|
|
17193
|
-
var _loadRoutesForOriginCache = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function
|
|
17194
|
-
return sdk_regenerator().w(function (
|
|
17195
|
-
while (1) switch (
|
|
17394
|
+
var _loadRoutesForOriginCache = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee15(parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode) {
|
|
17395
|
+
return sdk_regenerator().w(function (_context15) {
|
|
17396
|
+
while (1) switch (_context15.n) {
|
|
17196
17397
|
case 0:
|
|
17197
|
-
|
|
17398
|
+
_context15.n = 1;
|
|
17198
17399
|
return this.repository.fetchAndParseRoutesFromOrigin(parentPlaceId, fromPlaceId, announceFormat, unitSystem, mode);
|
|
17199
17400
|
case 1:
|
|
17200
|
-
return
|
|
17401
|
+
return _context15.a(2);
|
|
17201
17402
|
}
|
|
17202
|
-
},
|
|
17403
|
+
}, _callee15, this);
|
|
17203
17404
|
}));
|
|
17204
|
-
function loadRoutesForOriginCache(
|
|
17405
|
+
function loadRoutesForOriginCache(_x25, _x26, _x27, _x28, _x29) {
|
|
17205
17406
|
return _loadRoutesForOriginCache.apply(this, arguments);
|
|
17206
17407
|
}
|
|
17207
17408
|
return loadRoutesForOriginCache;
|
|
@@ -17209,28 +17410,28 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
17209
17410
|
}, {
|
|
17210
17411
|
key: "getCacheTimestamp",
|
|
17211
17412
|
value: function () {
|
|
17212
|
-
var _getCacheTimestamp = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function
|
|
17213
|
-
var cacheTimestamp,
|
|
17214
|
-
return sdk_regenerator().w(function (
|
|
17215
|
-
while (1) switch (
|
|
17413
|
+
var _getCacheTimestamp = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee16(parentPlaceId) {
|
|
17414
|
+
var cacheTimestamp, _t15;
|
|
17415
|
+
return sdk_regenerator().w(function (_context16) {
|
|
17416
|
+
while (1) switch (_context16.p = _context16.n) {
|
|
17216
17417
|
case 0:
|
|
17217
|
-
|
|
17218
|
-
|
|
17418
|
+
_context16.p = 0;
|
|
17419
|
+
_context16.n = 1;
|
|
17219
17420
|
return this.repository.fetchAndParseCacheTimestamp(parentPlaceId);
|
|
17220
17421
|
case 1:
|
|
17221
|
-
cacheTimestamp =
|
|
17422
|
+
cacheTimestamp = _context16.v;
|
|
17222
17423
|
this.logEvent("getCacheTimestamp");
|
|
17223
|
-
return
|
|
17424
|
+
return _context16.a(2, cacheTimestamp);
|
|
17224
17425
|
case 2:
|
|
17225
|
-
|
|
17226
|
-
|
|
17426
|
+
_context16.p = 2;
|
|
17427
|
+
_t15 = _context16.v;
|
|
17227
17428
|
throw new Error("Failed to get cache timestamp");
|
|
17228
17429
|
case 3:
|
|
17229
|
-
return
|
|
17430
|
+
return _context16.a(2);
|
|
17230
17431
|
}
|
|
17231
|
-
},
|
|
17432
|
+
}, _callee16, this, [[0, 2]]);
|
|
17232
17433
|
}));
|
|
17233
|
-
function getCacheTimestamp(
|
|
17434
|
+
function getCacheTimestamp(_x30) {
|
|
17234
17435
|
return _getCacheTimestamp.apply(this, arguments);
|
|
17235
17436
|
}
|
|
17236
17437
|
return getCacheTimestamp;
|
|
@@ -17243,28 +17444,28 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
17243
17444
|
}, {
|
|
17244
17445
|
key: "getCssCustomization",
|
|
17245
17446
|
value: function () {
|
|
17246
|
-
var _getCssCustomization = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function
|
|
17247
|
-
var cssCustomization,
|
|
17248
|
-
return sdk_regenerator().w(function (
|
|
17249
|
-
while (1) switch (
|
|
17447
|
+
var _getCssCustomization = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee17(type) {
|
|
17448
|
+
var cssCustomization, _t16;
|
|
17449
|
+
return sdk_regenerator().w(function (_context17) {
|
|
17450
|
+
while (1) switch (_context17.p = _context17.n) {
|
|
17250
17451
|
case 0:
|
|
17251
|
-
|
|
17252
|
-
|
|
17452
|
+
_context17.p = 0;
|
|
17453
|
+
_context17.n = 1;
|
|
17253
17454
|
return this.repository.fetchAndParseCssCustomization(type);
|
|
17254
17455
|
case 1:
|
|
17255
|
-
cssCustomization =
|
|
17456
|
+
cssCustomization = _context17.v;
|
|
17256
17457
|
this.logEvent("cssCustomization");
|
|
17257
|
-
return
|
|
17458
|
+
return _context17.a(2, cssCustomization);
|
|
17258
17459
|
case 2:
|
|
17259
|
-
|
|
17260
|
-
|
|
17460
|
+
_context17.p = 2;
|
|
17461
|
+
_t16 = _context17.v;
|
|
17261
17462
|
throw new Error("Failed to get css customization");
|
|
17262
17463
|
case 3:
|
|
17263
|
-
return
|
|
17464
|
+
return _context17.a(2);
|
|
17264
17465
|
}
|
|
17265
|
-
},
|
|
17466
|
+
}, _callee17, this, [[0, 2]]);
|
|
17266
17467
|
}));
|
|
17267
|
-
function getCssCustomization(
|
|
17468
|
+
function getCssCustomization(_x31) {
|
|
17268
17469
|
return _getCssCustomization.apply(this, arguments);
|
|
17269
17470
|
}
|
|
17270
17471
|
return getCssCustomization;
|
|
@@ -17272,27 +17473,27 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
17272
17473
|
}, {
|
|
17273
17474
|
key: "notifyHealth",
|
|
17274
17475
|
value: function () {
|
|
17275
|
-
var _notifyHealth = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function
|
|
17276
|
-
var health,
|
|
17277
|
-
return sdk_regenerator().w(function (
|
|
17278
|
-
while (1) switch (
|
|
17476
|
+
var _notifyHealth = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee18(healthPingId, placeId, totemId, status) {
|
|
17477
|
+
var health, _t17;
|
|
17478
|
+
return sdk_regenerator().w(function (_context18) {
|
|
17479
|
+
while (1) switch (_context18.p = _context18.n) {
|
|
17279
17480
|
case 0:
|
|
17280
|
-
|
|
17281
|
-
|
|
17481
|
+
_context18.p = 0;
|
|
17482
|
+
_context18.n = 1;
|
|
17282
17483
|
return this.repository.postAndParseHealthPing(healthPingId, placeId, totemId, status);
|
|
17283
17484
|
case 1:
|
|
17284
|
-
health =
|
|
17285
|
-
return
|
|
17485
|
+
health = _context18.v;
|
|
17486
|
+
return _context18.a(2, health);
|
|
17286
17487
|
case 2:
|
|
17287
|
-
|
|
17288
|
-
|
|
17488
|
+
_context18.p = 2;
|
|
17489
|
+
_t17 = _context18.v;
|
|
17289
17490
|
throw new Error("Failed to notify health");
|
|
17290
17491
|
case 3:
|
|
17291
|
-
return
|
|
17492
|
+
return _context18.a(2);
|
|
17292
17493
|
}
|
|
17293
|
-
},
|
|
17494
|
+
}, _callee18, this, [[0, 2]]);
|
|
17294
17495
|
}));
|
|
17295
|
-
function notifyHealth(
|
|
17496
|
+
function notifyHealth(_x32, _x33, _x34, _x35) {
|
|
17296
17497
|
return _notifyHealth.apply(this, arguments);
|
|
17297
17498
|
}
|
|
17298
17499
|
return notifyHealth;
|