@orderingstack/front-hooks 3.6.0 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2134 -2258
- package/dist/index.es.js.map +1 -1
- package/dist/src/useAvailability.d.ts +2 -2
- package/dist/src/useAvailability.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -185,17 +185,17 @@ var getNative$4 = _getNative, root$3 = _root;
|
|
|
185
185
|
var Promise$2 = getNative$4(root$3, "Promise");
|
|
186
186
|
var _Promise = Promise$2;
|
|
187
187
|
var getNative$3 = _getNative, root$2 = _root;
|
|
188
|
-
var Set$
|
|
189
|
-
var _Set = Set$
|
|
188
|
+
var Set$1 = getNative$3(root$2, "Set");
|
|
189
|
+
var _Set = Set$1;
|
|
190
190
|
var getNative$2 = _getNative, root$1 = _root;
|
|
191
191
|
var WeakMap$1 = getNative$2(root$1, "WeakMap");
|
|
192
192
|
var _WeakMap = WeakMap$1;
|
|
193
|
-
var DataView = _DataView, Map$2 = _Map, Promise$1 = _Promise, Set
|
|
193
|
+
var DataView = _DataView, Map$2 = _Map, Promise$1 = _Promise, Set = _Set, WeakMap = _WeakMap, baseGetTag$2 = _baseGetTag, toSource = _toSource;
|
|
194
194
|
var mapTag$6 = "[object Map]", objectTag$3 = "[object Object]", promiseTag = "[object Promise]", setTag$6 = "[object Set]", weakMapTag$2 = "[object WeakMap]";
|
|
195
195
|
var dataViewTag$4 = "[object DataView]";
|
|
196
|
-
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$2), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set
|
|
196
|
+
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$2), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
|
|
197
197
|
var getTag$5 = baseGetTag$2;
|
|
198
|
-
if (DataView && getTag$5(new DataView(new ArrayBuffer(1))) != dataViewTag$4 || Map$2 && getTag$5(new Map$2()) != mapTag$6 || Promise$1 && getTag$5(Promise$1.resolve()) != promiseTag || Set
|
|
198
|
+
if (DataView && getTag$5(new DataView(new ArrayBuffer(1))) != dataViewTag$4 || Map$2 && getTag$5(new Map$2()) != mapTag$6 || Promise$1 && getTag$5(Promise$1.resolve()) != promiseTag || Set && getTag$5(new Set()) != setTag$6 || WeakMap && getTag$5(new WeakMap()) != weakMapTag$2) {
|
|
199
199
|
getTag$5 = function(value) {
|
|
200
200
|
var result = baseGetTag$2(value), Ctor = result == objectTag$3 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
201
201
|
if (ctorString) {
|
|
@@ -1007,12 +1007,12 @@ MapCache$2.prototype.has = mapCacheHas;
|
|
|
1007
1007
|
MapCache$2.prototype.set = mapCacheSet;
|
|
1008
1008
|
var _MapCache = MapCache$2;
|
|
1009
1009
|
var ListCache$1 = _ListCache, Map = _Map, MapCache$1 = _MapCache;
|
|
1010
|
-
var LARGE_ARRAY_SIZE
|
|
1010
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
1011
1011
|
function stackSet$1(key, value) {
|
|
1012
1012
|
var data = this.__data__;
|
|
1013
1013
|
if (data instanceof ListCache$1) {
|
|
1014
1014
|
var pairs = data.__data__;
|
|
1015
|
-
if (!Map || pairs.length < LARGE_ARRAY_SIZE
|
|
1015
|
+
if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
1016
1016
|
pairs.push([key, value]);
|
|
1017
1017
|
this.size = ++data.size;
|
|
1018
1018
|
return this;
|
|
@@ -1046,16 +1046,16 @@ function setCacheHas$1(value) {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
var _setCacheHas = setCacheHas$1;
|
|
1048
1048
|
var MapCache = _MapCache, setCacheAdd = _setCacheAdd, setCacheHas = _setCacheHas;
|
|
1049
|
-
function SetCache$
|
|
1049
|
+
function SetCache$1(values) {
|
|
1050
1050
|
var index = -1, length = values == null ? 0 : values.length;
|
|
1051
1051
|
this.__data__ = new MapCache();
|
|
1052
1052
|
while (++index < length) {
|
|
1053
1053
|
this.add(values[index]);
|
|
1054
1054
|
}
|
|
1055
1055
|
}
|
|
1056
|
-
SetCache$
|
|
1057
|
-
SetCache$
|
|
1058
|
-
var _SetCache = SetCache$
|
|
1056
|
+
SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
|
|
1057
|
+
SetCache$1.prototype.has = setCacheHas;
|
|
1058
|
+
var _SetCache = SetCache$1;
|
|
1059
1059
|
function arraySome$1(array, predicate) {
|
|
1060
1060
|
var index = -1, length = array == null ? 0 : array.length;
|
|
1061
1061
|
while (++index < length) {
|
|
@@ -1066,11 +1066,11 @@ function arraySome$1(array, predicate) {
|
|
|
1066
1066
|
return false;
|
|
1067
1067
|
}
|
|
1068
1068
|
var _arraySome = arraySome$1;
|
|
1069
|
-
function cacheHas$
|
|
1069
|
+
function cacheHas$1(cache, key) {
|
|
1070
1070
|
return cache.has(key);
|
|
1071
1071
|
}
|
|
1072
|
-
var _cacheHas = cacheHas$
|
|
1073
|
-
var SetCache
|
|
1072
|
+
var _cacheHas = cacheHas$1;
|
|
1073
|
+
var SetCache = _SetCache, arraySome = _arraySome, cacheHas = _cacheHas;
|
|
1074
1074
|
var COMPARE_PARTIAL_FLAG$3 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
|
|
1075
1075
|
function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
|
|
1076
1076
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, arrLength = array.length, othLength = other.length;
|
|
@@ -1082,7 +1082,7 @@ function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
|
|
|
1082
1082
|
if (arrStacked && othStacked) {
|
|
1083
1083
|
return arrStacked == other && othStacked == array;
|
|
1084
1084
|
}
|
|
1085
|
-
var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache
|
|
1085
|
+
var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
|
|
1086
1086
|
stack.set(array, other);
|
|
1087
1087
|
stack.set(other, array);
|
|
1088
1088
|
while (++index < arrLength) {
|
|
@@ -1099,7 +1099,7 @@ function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
if (seen) {
|
|
1101
1101
|
if (!arraySome(other, function(othValue2, othIndex) {
|
|
1102
|
-
if (!cacheHas
|
|
1102
|
+
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
1103
1103
|
return seen.push(othIndex);
|
|
1104
1104
|
}
|
|
1105
1105
|
})) {
|
|
@@ -1127,15 +1127,15 @@ function mapToArray$1(map) {
|
|
|
1127
1127
|
return result;
|
|
1128
1128
|
}
|
|
1129
1129
|
var _mapToArray = mapToArray$1;
|
|
1130
|
-
function setToArray$
|
|
1130
|
+
function setToArray$1(set) {
|
|
1131
1131
|
var index = -1, result = Array(set.size);
|
|
1132
1132
|
set.forEach(function(value) {
|
|
1133
1133
|
result[++index] = value;
|
|
1134
1134
|
});
|
|
1135
1135
|
return result;
|
|
1136
1136
|
}
|
|
1137
|
-
var _setToArray = setToArray$
|
|
1138
|
-
var Symbol$2 = _Symbol, Uint8Array$1 = _Uint8Array, eq$1 = eq_1, equalArrays$1 = _equalArrays, mapToArray = _mapToArray, setToArray
|
|
1137
|
+
var _setToArray = setToArray$1;
|
|
1138
|
+
var Symbol$2 = _Symbol, Uint8Array$1 = _Uint8Array, eq$1 = eq_1, equalArrays$1 = _equalArrays, mapToArray = _mapToArray, setToArray = _setToArray;
|
|
1139
1139
|
var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
1140
1140
|
var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", errorTag$1 = "[object Error]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]";
|
|
1141
1141
|
var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]";
|
|
@@ -1166,7 +1166,7 @@ function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack)
|
|
|
1166
1166
|
var convert = mapToArray;
|
|
1167
1167
|
case setTag$3:
|
|
1168
1168
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
|
|
1169
|
-
convert || (convert = setToArray
|
|
1169
|
+
convert || (convert = setToArray);
|
|
1170
1170
|
if (object.size != other.size && !isPartial) {
|
|
1171
1171
|
return false;
|
|
1172
1172
|
}
|
|
@@ -1369,2444 +1369,2320 @@ function isEqual(value, other) {
|
|
|
1369
1369
|
return baseIsEqual(value, other);
|
|
1370
1370
|
}
|
|
1371
1371
|
var isEqual_1 = isEqual;
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
} catch (err) {
|
|
1381
|
-
}
|
|
1382
|
-
if (components.length === 1) {
|
|
1383
|
-
return components;
|
|
1384
|
-
}
|
|
1385
|
-
split = split || 1;
|
|
1386
|
-
var left = components.slice(0, split);
|
|
1387
|
-
var right = components.slice(split);
|
|
1388
|
-
return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
|
|
1389
|
-
}
|
|
1390
|
-
function decode(input) {
|
|
1391
|
-
try {
|
|
1392
|
-
return decodeURIComponent(input);
|
|
1393
|
-
} catch (err) {
|
|
1394
|
-
var tokens = input.match(singleMatcher) || [];
|
|
1395
|
-
for (var i = 1; i < tokens.length; i++) {
|
|
1396
|
-
input = decodeComponents(tokens, i).join("");
|
|
1397
|
-
tokens = input.match(singleMatcher) || [];
|
|
1372
|
+
function useAvailability(originalMenu, markOnly = false, timeZone = void 0, interval = 60) {
|
|
1373
|
+
const [menu, setMenu] = useState(originalMenu ? filterTimeAvailabilityOfProducts(originalMenu, timeZone, void 0, markOnly) : originalMenu);
|
|
1374
|
+
useInterval(checkAvailability, interval * 1e3);
|
|
1375
|
+
function checkAvailability() {
|
|
1376
|
+
const filtered = originalMenu ? filterTimeAvailabilityOfProducts(originalMenu, timeZone, void 0, markOnly) : originalMenu;
|
|
1377
|
+
if (!isEqual_1(filtered, menu)) {
|
|
1378
|
+
console.log("menu has changed", filtered);
|
|
1379
|
+
setMenu(filtered);
|
|
1398
1380
|
}
|
|
1399
|
-
return input;
|
|
1400
1381
|
}
|
|
1382
|
+
useEffect(checkAvailability, [menu, originalMenu]);
|
|
1383
|
+
return menu;
|
|
1401
1384
|
}
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1385
|
+
var EPaymentStatus;
|
|
1386
|
+
(function(EPaymentStatus2) {
|
|
1387
|
+
EPaymentStatus2["UNINITIALIZED"] = "UNINITIALIZED";
|
|
1388
|
+
EPaymentStatus2["PROCESSING"] = "PROCESSING";
|
|
1389
|
+
EPaymentStatus2["PAID"] = "PAID";
|
|
1390
|
+
EPaymentStatus2["FAILED"] = "FAILED";
|
|
1391
|
+
EPaymentStatus2["PRINTING_RECEIPT"] = "PRINTING_RECEIPT";
|
|
1392
|
+
EPaymentStatus2["PRINTING_RECEIPT_SUCCESS"] = "PRINTING_RECEIPT_SUCCESS";
|
|
1393
|
+
EPaymentStatus2["SENDING_RECEIPT"] = "SENDING_RECEIPT";
|
|
1394
|
+
EPaymentStatus2["SENDING_RECEIPT_SUCCESS"] = "SENDING_RECEIPT_SUCCESS";
|
|
1395
|
+
EPaymentStatus2["ERROR"] = "ERROR";
|
|
1396
|
+
})(EPaymentStatus || (EPaymentStatus = {}));
|
|
1397
|
+
var ECouponViewType;
|
|
1398
|
+
(function(ECouponViewType2) {
|
|
1399
|
+
ECouponViewType2["CAROUSEL"] = "carousel";
|
|
1400
|
+
ECouponViewType2["NORMAL"] = "normal";
|
|
1401
|
+
ECouponViewType2["IMAGE"] = "image";
|
|
1402
|
+
})(ECouponViewType || (ECouponViewType = {}));
|
|
1403
|
+
var EProductKind;
|
|
1404
|
+
(function(EProductKind2) {
|
|
1405
|
+
EProductKind2["GROUP"] = "3e/group";
|
|
1406
|
+
EProductKind2["PRODUCT"] = "3e/product";
|
|
1407
|
+
EProductKind2["CATEGORY"] = "3e/group/category";
|
|
1408
|
+
EProductKind2["OPTIONS"] = "3e/group/options";
|
|
1409
|
+
EProductKind2["CONFIG"] = "3e/group/config";
|
|
1410
|
+
EProductKind2["STATIC"] = "3e/static";
|
|
1411
|
+
EProductKind2["REF"] = "3e/ref";
|
|
1412
|
+
EProductKind2["QUERY"] = "3e/query";
|
|
1413
|
+
})(EProductKind || (EProductKind = {}));
|
|
1414
|
+
var EProductKindBucket;
|
|
1415
|
+
(function(EProductKindBucket2) {
|
|
1416
|
+
EProductKindBucket2["GROUP"] = "group";
|
|
1417
|
+
EProductKindBucket2["PRODUCT"] = "product";
|
|
1418
|
+
})(EProductKindBucket || (EProductKindBucket = {}));
|
|
1419
|
+
var EOrderType;
|
|
1420
|
+
(function(EOrderType2) {
|
|
1421
|
+
EOrderType2["TAKE_AWAY"] = "TAKE_AWAY";
|
|
1422
|
+
EOrderType2["DELIVERY"] = "DELIVERY";
|
|
1423
|
+
EOrderType2["DINE_IN"] = "DINE_IN";
|
|
1424
|
+
EOrderType2["DINE_IN_OPEN"] = "DINE_IN_OPEN";
|
|
1425
|
+
EOrderType2["GLOVO_DELIVERY"] = "GLOVO_DELIVERY";
|
|
1426
|
+
EOrderType2["GLOVO_TAKE_AWAY"] = "GLOVO_TAKE_AWAY";
|
|
1427
|
+
EOrderType2["JUSTEAT_DELIVERY"] = "JUSTEAT_DELIVERY";
|
|
1428
|
+
EOrderType2["JUSTEAT_TAKE_AWAY"] = "JUSTEAT_TAKE_AWAY";
|
|
1429
|
+
EOrderType2["UBER_DELIVERY"] = "UBER_DELIVERY";
|
|
1430
|
+
EOrderType2["UBER_TAKE_AWAY"] = "UBER_TAKE_AWAY";
|
|
1431
|
+
EOrderType2["UBER_DINE_IN"] = "UBER_DINE_IN";
|
|
1432
|
+
EOrderType2["BOLT_DELIVERY"] = "BOLT_DELIVERY";
|
|
1433
|
+
EOrderType2["BOLT_TAKE_AWAY"] = "BOLT_TAKE_AWAY";
|
|
1434
|
+
EOrderType2["WOLT_DELIVERY"] = "WOLT_DELIVERY";
|
|
1435
|
+
EOrderType2["WOLT_TAKE_AWAY"] = "WOLT_TAKE_AWAY";
|
|
1436
|
+
EOrderType2["WOLT_DINE_IN"] = "WOLT_DINE_IN";
|
|
1437
|
+
})(EOrderType || (EOrderType = {}));
|
|
1438
|
+
var EOrderStatus;
|
|
1439
|
+
(function(EOrderStatus2) {
|
|
1440
|
+
EOrderStatus2["NEW"] = "NEW";
|
|
1441
|
+
EOrderStatus2["COMPLETED"] = "COMPLETED";
|
|
1442
|
+
EOrderStatus2["VERIFIED"] = "VERIFIED";
|
|
1443
|
+
EOrderStatus2["DELIVER"] = "DELIVER";
|
|
1444
|
+
EOrderStatus2["DELIVERED"] = "DELIVERED";
|
|
1445
|
+
EOrderStatus2["CLOSED"] = "CLOSED";
|
|
1446
|
+
EOrderStatus2["ABANDONED"] = "ABANDONED";
|
|
1447
|
+
EOrderStatus2["CANCELLED"] = "CANCELLED";
|
|
1448
|
+
EOrderStatus2["PICKED"] = "PICKED";
|
|
1449
|
+
})(EOrderStatus || (EOrderStatus = {}));
|
|
1450
|
+
var EOrderPaymentType;
|
|
1451
|
+
(function(EOrderPaymentType2) {
|
|
1452
|
+
EOrderPaymentType2["CASH"] = "CASH";
|
|
1453
|
+
EOrderPaymentType2["CARD"] = "CARD";
|
|
1454
|
+
EOrderPaymentType2["COD"] = "COD";
|
|
1455
|
+
EOrderPaymentType2["TERMINAL"] = "TERMINAL";
|
|
1456
|
+
EOrderPaymentType2["EPAYMENT"] = "EPAYMENT";
|
|
1457
|
+
EOrderPaymentType2["COUPON"] = "COUPON";
|
|
1458
|
+
EOrderPaymentType2["WALLET"] = "WALLET";
|
|
1459
|
+
EOrderPaymentType2["PREAUTHORIZED"] = "PREAUTHORIZED";
|
|
1460
|
+
EOrderPaymentType2["RETURN"] = "RETURN";
|
|
1461
|
+
EOrderPaymentType2["EXTERNAL"] = "EXTERNAL";
|
|
1462
|
+
})(EOrderPaymentType || (EOrderPaymentType = {}));
|
|
1463
|
+
var OrderSource;
|
|
1464
|
+
(function(OrderSource2) {
|
|
1465
|
+
OrderSource2["KIOSK"] = "KIOSK";
|
|
1466
|
+
OrderSource2["WEB"] = "WEB";
|
|
1467
|
+
OrderSource2["JUST_EAT_TAKE_AWAY"] = "JUSTEATTAKEAWAY";
|
|
1468
|
+
OrderSource2["GLOVO"] = "GLOVO";
|
|
1469
|
+
OrderSource2["PYSZNE"] = "PYSZNE";
|
|
1470
|
+
OrderSource2["WOLT"] = "WOLT";
|
|
1471
|
+
OrderSource2["UBER"] = "UBER";
|
|
1472
|
+
OrderSource2["BOLT"] = "BOLT";
|
|
1473
|
+
})(OrderSource || (OrderSource = {}));
|
|
1474
|
+
var EOrderLineStatus;
|
|
1475
|
+
(function(EOrderLineStatus2) {
|
|
1476
|
+
EOrderLineStatus2["NEW"] = "NEW";
|
|
1477
|
+
EOrderLineStatus2["TECHNICAL"] = "TECHNICAL";
|
|
1478
|
+
EOrderLineStatus2["CONFIRMED"] = "CONFIRMED";
|
|
1479
|
+
EOrderLineStatus2["PROCESSING"] = "PROCESSING";
|
|
1480
|
+
EOrderLineStatus2["PROCESSED"] = "PROCESSED";
|
|
1481
|
+
EOrderLineStatus2["VOID"] = "VOID";
|
|
1482
|
+
EOrderLineStatus2["WASTE"] = "WASTE";
|
|
1483
|
+
})(EOrderLineStatus || (EOrderLineStatus = {}));
|
|
1484
|
+
var EOrderProductKind;
|
|
1485
|
+
(function(EOrderProductKind2) {
|
|
1486
|
+
EOrderProductKind2["GROUP"] = "group";
|
|
1487
|
+
EOrderProductKind2["PRODUCT"] = "product";
|
|
1488
|
+
})(EOrderProductKind || (EOrderProductKind = {}));
|
|
1489
|
+
var EChannelName;
|
|
1490
|
+
(function(EChannelName2) {
|
|
1491
|
+
EChannelName2["DINE_IN"] = "DINE_IN";
|
|
1492
|
+
EChannelName2["TAKE_AWAY"] = "TAKE_AWAY";
|
|
1493
|
+
EChannelName2["DELIVERY"] = "DELIVERY";
|
|
1494
|
+
EChannelName2["GLOVO_DELIVERY"] = "GLOVO_DELIVERY";
|
|
1495
|
+
EChannelName2["JUSTEAT_DELIVERY"] = "JUSTEAT_DELIVERY";
|
|
1496
|
+
EChannelName2["UBER_DELIVERY"] = "UBER_DELIVERY";
|
|
1497
|
+
EChannelName2["BOLT_DELIVERY"] = "BOLT_DELIVERY";
|
|
1498
|
+
EChannelName2["WOLT_DELIVERY"] = "WOLT_DELIVERY";
|
|
1499
|
+
})(EChannelName || (EChannelName = {}));
|
|
1500
|
+
function arrayEach$1(array, iteratee) {
|
|
1501
|
+
var index = -1, length = array == null ? 0 : array.length;
|
|
1502
|
+
while (++index < length) {
|
|
1503
|
+
if (iteratee(array[index], index, array) === false) {
|
|
1504
|
+
break;
|
|
1416
1505
|
}
|
|
1417
|
-
match = multiMatcher.exec(input);
|
|
1418
|
-
}
|
|
1419
|
-
replaceMap["%C2"] = "\uFFFD";
|
|
1420
|
-
var entries = Object.keys(replaceMap);
|
|
1421
|
-
for (var i = 0; i < entries.length; i++) {
|
|
1422
|
-
var key = entries[i];
|
|
1423
|
-
input = input.replace(new RegExp(key, "g"), replaceMap[key]);
|
|
1424
1506
|
}
|
|
1425
|
-
return
|
|
1507
|
+
return array;
|
|
1426
1508
|
}
|
|
1427
|
-
var
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
}
|
|
1509
|
+
var _arrayEach = arrayEach$1;
|
|
1510
|
+
var getNative = _getNative;
|
|
1511
|
+
var defineProperty$1 = function() {
|
|
1431
1512
|
try {
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
}
|
|
1437
|
-
};
|
|
1438
|
-
var splitOnFirst = (string, separator) => {
|
|
1439
|
-
if (!(typeof string === "string" && typeof separator === "string")) {
|
|
1440
|
-
throw new TypeError("Expected the arguments to be of type `string`");
|
|
1513
|
+
var func = getNative(Object, "defineProperty");
|
|
1514
|
+
func({}, "", {});
|
|
1515
|
+
return func;
|
|
1516
|
+
} catch (e) {
|
|
1441
1517
|
}
|
|
1442
|
-
|
|
1443
|
-
|
|
1518
|
+
}();
|
|
1519
|
+
var _defineProperty = defineProperty$1;
|
|
1520
|
+
var defineProperty = _defineProperty;
|
|
1521
|
+
function baseAssignValue$2(object, key, value) {
|
|
1522
|
+
if (key == "__proto__" && defineProperty) {
|
|
1523
|
+
defineProperty(object, key, {
|
|
1524
|
+
"configurable": true,
|
|
1525
|
+
"enumerable": true,
|
|
1526
|
+
"value": value,
|
|
1527
|
+
"writable": true
|
|
1528
|
+
});
|
|
1529
|
+
} else {
|
|
1530
|
+
object[key] = value;
|
|
1444
1531
|
}
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1532
|
+
}
|
|
1533
|
+
var _baseAssignValue = baseAssignValue$2;
|
|
1534
|
+
var baseAssignValue$1 = _baseAssignValue, eq = eq_1;
|
|
1535
|
+
var objectProto$2 = Object.prototype;
|
|
1536
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
1537
|
+
function assignValue$2(object, key, value) {
|
|
1538
|
+
var objValue = object[key];
|
|
1539
|
+
if (!(hasOwnProperty$2.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
|
|
1540
|
+
baseAssignValue$1(object, key, value);
|
|
1448
1541
|
}
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
var
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
if (isArr ? predicate.indexOf(key) !== -1 : predicate(key, val, obj)) {
|
|
1462
|
-
ret[key] = val;
|
|
1542
|
+
}
|
|
1543
|
+
var _assignValue = assignValue$2;
|
|
1544
|
+
var assignValue$1 = _assignValue, baseAssignValue = _baseAssignValue;
|
|
1545
|
+
function copyObject$4(source2, props, object, customizer) {
|
|
1546
|
+
var isNew = !object;
|
|
1547
|
+
object || (object = {});
|
|
1548
|
+
var index = -1, length = props.length;
|
|
1549
|
+
while (++index < length) {
|
|
1550
|
+
var key = props[index];
|
|
1551
|
+
var newValue = customizer ? customizer(object[key], source2[key], key, object, source2) : void 0;
|
|
1552
|
+
if (newValue === void 0) {
|
|
1553
|
+
newValue = source2[key];
|
|
1463
1554
|
}
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
}
|
|
1467
|
-
(
|
|
1468
|
-
const strictUriEncode$1 = strictUriEncode;
|
|
1469
|
-
const decodeComponent = decodeUriComponent;
|
|
1470
|
-
const splitOnFirst$1 = splitOnFirst;
|
|
1471
|
-
const filterObject = filterObj;
|
|
1472
|
-
const isNullOrUndefined = (value) => value === null || value === void 0;
|
|
1473
|
-
const encodeFragmentIdentifier = Symbol("encodeFragmentIdentifier");
|
|
1474
|
-
function encoderForArrayFormat(options) {
|
|
1475
|
-
switch (options.arrayFormat) {
|
|
1476
|
-
case "index":
|
|
1477
|
-
return (key) => (result, value) => {
|
|
1478
|
-
const index = result.length;
|
|
1479
|
-
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
1480
|
-
return result;
|
|
1481
|
-
}
|
|
1482
|
-
if (value === null) {
|
|
1483
|
-
return [...result, [encode2(key, options), "[", index, "]"].join("")];
|
|
1484
|
-
}
|
|
1485
|
-
return [
|
|
1486
|
-
...result,
|
|
1487
|
-
[encode2(key, options), "[", encode2(index, options), "]=", encode2(value, options)].join("")
|
|
1488
|
-
];
|
|
1489
|
-
};
|
|
1490
|
-
case "bracket":
|
|
1491
|
-
return (key) => (result, value) => {
|
|
1492
|
-
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
1493
|
-
return result;
|
|
1494
|
-
}
|
|
1495
|
-
if (value === null) {
|
|
1496
|
-
return [...result, [encode2(key, options), "[]"].join("")];
|
|
1497
|
-
}
|
|
1498
|
-
return [...result, [encode2(key, options), "[]=", encode2(value, options)].join("")];
|
|
1499
|
-
};
|
|
1500
|
-
case "colon-list-separator":
|
|
1501
|
-
return (key) => (result, value) => {
|
|
1502
|
-
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
1503
|
-
return result;
|
|
1504
|
-
}
|
|
1505
|
-
if (value === null) {
|
|
1506
|
-
return [...result, [encode2(key, options), ":list="].join("")];
|
|
1507
|
-
}
|
|
1508
|
-
return [...result, [encode2(key, options), ":list=", encode2(value, options)].join("")];
|
|
1509
|
-
};
|
|
1510
|
-
case "comma":
|
|
1511
|
-
case "separator":
|
|
1512
|
-
case "bracket-separator": {
|
|
1513
|
-
const keyValueSep = options.arrayFormat === "bracket-separator" ? "[]=" : "=";
|
|
1514
|
-
return (key) => (result, value) => {
|
|
1515
|
-
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
1516
|
-
return result;
|
|
1517
|
-
}
|
|
1518
|
-
value = value === null ? "" : value;
|
|
1519
|
-
if (result.length === 0) {
|
|
1520
|
-
return [[encode2(key, options), keyValueSep, encode2(value, options)].join("")];
|
|
1521
|
-
}
|
|
1522
|
-
return [[result, encode2(value, options)].join(options.arrayFormatSeparator)];
|
|
1523
|
-
};
|
|
1524
|
-
}
|
|
1525
|
-
default:
|
|
1526
|
-
return (key) => (result, value) => {
|
|
1527
|
-
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
1528
|
-
return result;
|
|
1529
|
-
}
|
|
1530
|
-
if (value === null) {
|
|
1531
|
-
return [...result, encode2(key, options)];
|
|
1532
|
-
}
|
|
1533
|
-
return [...result, [encode2(key, options), "=", encode2(value, options)].join("")];
|
|
1534
|
-
};
|
|
1555
|
+
if (isNew) {
|
|
1556
|
+
baseAssignValue(object, key, newValue);
|
|
1557
|
+
} else {
|
|
1558
|
+
assignValue$1(object, key, newValue);
|
|
1535
1559
|
}
|
|
1536
1560
|
}
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
}
|
|
1551
|
-
accumulator[key][result[1]] = value;
|
|
1552
|
-
};
|
|
1553
|
-
case "bracket":
|
|
1554
|
-
return (key, value, accumulator) => {
|
|
1555
|
-
result = /(\[\])$/.exec(key);
|
|
1556
|
-
key = key.replace(/\[\]$/, "");
|
|
1557
|
-
if (!result) {
|
|
1558
|
-
accumulator[key] = value;
|
|
1559
|
-
return;
|
|
1560
|
-
}
|
|
1561
|
-
if (accumulator[key] === void 0) {
|
|
1562
|
-
accumulator[key] = [value];
|
|
1563
|
-
return;
|
|
1564
|
-
}
|
|
1565
|
-
accumulator[key] = [].concat(accumulator[key], value);
|
|
1566
|
-
};
|
|
1567
|
-
case "colon-list-separator":
|
|
1568
|
-
return (key, value, accumulator) => {
|
|
1569
|
-
result = /(:list)$/.exec(key);
|
|
1570
|
-
key = key.replace(/:list$/, "");
|
|
1571
|
-
if (!result) {
|
|
1572
|
-
accumulator[key] = value;
|
|
1573
|
-
return;
|
|
1574
|
-
}
|
|
1575
|
-
if (accumulator[key] === void 0) {
|
|
1576
|
-
accumulator[key] = [value];
|
|
1577
|
-
return;
|
|
1578
|
-
}
|
|
1579
|
-
accumulator[key] = [].concat(accumulator[key], value);
|
|
1580
|
-
};
|
|
1581
|
-
case "comma":
|
|
1582
|
-
case "separator":
|
|
1583
|
-
return (key, value, accumulator) => {
|
|
1584
|
-
const isArray2 = typeof value === "string" && value.includes(options.arrayFormatSeparator);
|
|
1585
|
-
const isEncodedArray = typeof value === "string" && !isArray2 && decode2(value, options).includes(options.arrayFormatSeparator);
|
|
1586
|
-
value = isEncodedArray ? decode2(value, options) : value;
|
|
1587
|
-
const newValue = isArray2 || isEncodedArray ? value.split(options.arrayFormatSeparator).map((item) => decode2(item, options)) : value === null ? value : decode2(value, options);
|
|
1588
|
-
accumulator[key] = newValue;
|
|
1589
|
-
};
|
|
1590
|
-
case "bracket-separator":
|
|
1591
|
-
return (key, value, accumulator) => {
|
|
1592
|
-
const isArray2 = /(\[\])$/.test(key);
|
|
1593
|
-
key = key.replace(/\[\]$/, "");
|
|
1594
|
-
if (!isArray2) {
|
|
1595
|
-
accumulator[key] = value ? decode2(value, options) : value;
|
|
1596
|
-
return;
|
|
1597
|
-
}
|
|
1598
|
-
const arrayValue = value === null ? [] : value.split(options.arrayFormatSeparator).map((item) => decode2(item, options));
|
|
1599
|
-
if (accumulator[key] === void 0) {
|
|
1600
|
-
accumulator[key] = arrayValue;
|
|
1601
|
-
return;
|
|
1602
|
-
}
|
|
1603
|
-
accumulator[key] = [].concat(accumulator[key], arrayValue);
|
|
1604
|
-
};
|
|
1605
|
-
default:
|
|
1606
|
-
return (key, value, accumulator) => {
|
|
1607
|
-
if (accumulator[key] === void 0) {
|
|
1608
|
-
accumulator[key] = value;
|
|
1609
|
-
return;
|
|
1610
|
-
}
|
|
1611
|
-
accumulator[key] = [].concat(accumulator[key], value);
|
|
1612
|
-
};
|
|
1561
|
+
return object;
|
|
1562
|
+
}
|
|
1563
|
+
var _copyObject = copyObject$4;
|
|
1564
|
+
var copyObject$3 = _copyObject, keys$1 = keys_1;
|
|
1565
|
+
function baseAssign$1(object, source2) {
|
|
1566
|
+
return object && copyObject$3(source2, keys$1(source2), object);
|
|
1567
|
+
}
|
|
1568
|
+
var _baseAssign = baseAssign$1;
|
|
1569
|
+
function nativeKeysIn$1(object) {
|
|
1570
|
+
var result = [];
|
|
1571
|
+
if (object != null) {
|
|
1572
|
+
for (var key in Object(object)) {
|
|
1573
|
+
result.push(key);
|
|
1613
1574
|
}
|
|
1614
1575
|
}
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1576
|
+
return result;
|
|
1577
|
+
}
|
|
1578
|
+
var _nativeKeysIn = nativeKeysIn$1;
|
|
1579
|
+
var isObject$3 = isObject_1, isPrototype$1 = _isPrototype, nativeKeysIn = _nativeKeysIn;
|
|
1580
|
+
var objectProto$1 = Object.prototype;
|
|
1581
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
1582
|
+
function baseKeysIn$1(object) {
|
|
1583
|
+
if (!isObject$3(object)) {
|
|
1584
|
+
return nativeKeysIn(object);
|
|
1619
1585
|
}
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1586
|
+
var isProto = isPrototype$1(object), result = [];
|
|
1587
|
+
for (var key in object) {
|
|
1588
|
+
if (!(key == "constructor" && (isProto || !hasOwnProperty$1.call(object, key)))) {
|
|
1589
|
+
result.push(key);
|
|
1623
1590
|
}
|
|
1624
|
-
return value;
|
|
1625
1591
|
}
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1592
|
+
return result;
|
|
1593
|
+
}
|
|
1594
|
+
var _baseKeysIn = baseKeysIn$1;
|
|
1595
|
+
var arrayLikeKeys = _arrayLikeKeys, baseKeysIn = _baseKeysIn, isArrayLike = isArrayLike_1;
|
|
1596
|
+
function keysIn$3(object) {
|
|
1597
|
+
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
|
|
1598
|
+
}
|
|
1599
|
+
var keysIn_1 = keysIn$3;
|
|
1600
|
+
var copyObject$2 = _copyObject, keysIn$2 = keysIn_1;
|
|
1601
|
+
function baseAssignIn$1(object, source2) {
|
|
1602
|
+
return object && copyObject$2(source2, keysIn$2(source2), object);
|
|
1603
|
+
}
|
|
1604
|
+
var _baseAssignIn = baseAssignIn$1;
|
|
1605
|
+
var _cloneBuffer = { exports: {} };
|
|
1606
|
+
(function(module, exports) {
|
|
1607
|
+
var root2 = _root;
|
|
1608
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
1609
|
+
var freeModule = freeExports && true && module && !module.nodeType && module;
|
|
1610
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
1611
|
+
var Buffer = moduleExports ? root2.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
|
|
1612
|
+
function cloneBuffer2(buffer, isDeep) {
|
|
1613
|
+
if (isDeep) {
|
|
1614
|
+
return buffer.slice();
|
|
1629
1615
|
}
|
|
1630
|
-
|
|
1616
|
+
var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
1617
|
+
buffer.copy(result);
|
|
1618
|
+
return result;
|
|
1631
1619
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
return input;
|
|
1620
|
+
module.exports = cloneBuffer2;
|
|
1621
|
+
})(_cloneBuffer, _cloneBuffer.exports);
|
|
1622
|
+
function copyArray$1(source2, array) {
|
|
1623
|
+
var index = -1, length = source2.length;
|
|
1624
|
+
array || (array = Array(length));
|
|
1625
|
+
while (++index < length) {
|
|
1626
|
+
array[index] = source2[index];
|
|
1640
1627
|
}
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1628
|
+
return array;
|
|
1629
|
+
}
|
|
1630
|
+
var _copyArray = copyArray$1;
|
|
1631
|
+
var copyObject$1 = _copyObject, getSymbols$1 = _getSymbols;
|
|
1632
|
+
function copySymbols$1(source2, object) {
|
|
1633
|
+
return copyObject$1(source2, getSymbols$1(source2), object);
|
|
1634
|
+
}
|
|
1635
|
+
var _copySymbols = copySymbols$1;
|
|
1636
|
+
var overArg = _overArg;
|
|
1637
|
+
var getPrototype$2 = overArg(Object.getPrototypeOf, Object);
|
|
1638
|
+
var _getPrototype = getPrototype$2;
|
|
1639
|
+
var arrayPush = _arrayPush, getPrototype$1 = _getPrototype, getSymbols = _getSymbols, stubArray = stubArray_1;
|
|
1640
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
1641
|
+
var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object) {
|
|
1642
|
+
var result = [];
|
|
1643
|
+
while (object) {
|
|
1644
|
+
arrayPush(result, getSymbols(object));
|
|
1645
|
+
object = getPrototype$1(object);
|
|
1647
1646
|
}
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1647
|
+
return result;
|
|
1648
|
+
};
|
|
1649
|
+
var _getSymbolsIn = getSymbolsIn$2;
|
|
1650
|
+
var copyObject = _copyObject, getSymbolsIn$1 = _getSymbolsIn;
|
|
1651
|
+
function copySymbolsIn$1(source2, object) {
|
|
1652
|
+
return copyObject(source2, getSymbolsIn$1(source2), object);
|
|
1653
|
+
}
|
|
1654
|
+
var _copySymbolsIn = copySymbolsIn$1;
|
|
1655
|
+
var baseGetAllKeys = _baseGetAllKeys, getSymbolsIn = _getSymbolsIn, keysIn$1 = keysIn_1;
|
|
1656
|
+
function getAllKeysIn$1(object) {
|
|
1657
|
+
return baseGetAllKeys(object, keysIn$1, getSymbolsIn);
|
|
1658
|
+
}
|
|
1659
|
+
var _getAllKeysIn = getAllKeysIn$1;
|
|
1660
|
+
var objectProto = Object.prototype;
|
|
1661
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1662
|
+
function initCloneArray$1(array) {
|
|
1663
|
+
var length = array.length, result = new array.constructor(length);
|
|
1664
|
+
if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
|
|
1665
|
+
result.index = array.index;
|
|
1666
|
+
result.input = array.input;
|
|
1655
1667
|
}
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1668
|
+
return result;
|
|
1669
|
+
}
|
|
1670
|
+
var _initCloneArray = initCloneArray$1;
|
|
1671
|
+
var Uint8Array = _Uint8Array;
|
|
1672
|
+
function cloneArrayBuffer$3(arrayBuffer) {
|
|
1673
|
+
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
1674
|
+
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
|
1675
|
+
return result;
|
|
1676
|
+
}
|
|
1677
|
+
var _cloneArrayBuffer = cloneArrayBuffer$3;
|
|
1678
|
+
var cloneArrayBuffer$2 = _cloneArrayBuffer;
|
|
1679
|
+
function cloneDataView$1(dataView, isDeep) {
|
|
1680
|
+
var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
|
|
1681
|
+
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|
1682
|
+
}
|
|
1683
|
+
var _cloneDataView = cloneDataView$1;
|
|
1684
|
+
var reFlags = /\w*$/;
|
|
1685
|
+
function cloneRegExp$1(regexp) {
|
|
1686
|
+
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
|
1687
|
+
result.lastIndex = regexp.lastIndex;
|
|
1688
|
+
return result;
|
|
1689
|
+
}
|
|
1690
|
+
var _cloneRegExp = cloneRegExp$1;
|
|
1691
|
+
var Symbol$1 = _Symbol;
|
|
1692
|
+
var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
1693
|
+
function cloneSymbol$1(symbol) {
|
|
1694
|
+
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
|
|
1695
|
+
}
|
|
1696
|
+
var _cloneSymbol = cloneSymbol$1;
|
|
1697
|
+
var cloneArrayBuffer$1 = _cloneArrayBuffer;
|
|
1698
|
+
function cloneTypedArray$1(typedArray, isDeep) {
|
|
1699
|
+
var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
|
|
1700
|
+
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
1701
|
+
}
|
|
1702
|
+
var _cloneTypedArray = cloneTypedArray$1;
|
|
1703
|
+
var cloneArrayBuffer = _cloneArrayBuffer, cloneDataView = _cloneDataView, cloneRegExp = _cloneRegExp, cloneSymbol = _cloneSymbol, cloneTypedArray = _cloneTypedArray;
|
|
1704
|
+
var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]";
|
|
1705
|
+
var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
|
|
1706
|
+
function initCloneByTag$1(object, tag, isDeep) {
|
|
1707
|
+
var Ctor = object.constructor;
|
|
1708
|
+
switch (tag) {
|
|
1709
|
+
case arrayBufferTag$1:
|
|
1710
|
+
return cloneArrayBuffer(object);
|
|
1711
|
+
case boolTag$1:
|
|
1712
|
+
case dateTag$1:
|
|
1713
|
+
return new Ctor(+object);
|
|
1714
|
+
case dataViewTag$1:
|
|
1715
|
+
return cloneDataView(object, isDeep);
|
|
1716
|
+
case float32Tag$1:
|
|
1717
|
+
case float64Tag$1:
|
|
1718
|
+
case int8Tag$1:
|
|
1719
|
+
case int16Tag$1:
|
|
1720
|
+
case int32Tag$1:
|
|
1721
|
+
case uint8Tag$1:
|
|
1722
|
+
case uint8ClampedTag$1:
|
|
1723
|
+
case uint16Tag$1:
|
|
1724
|
+
case uint32Tag$1:
|
|
1725
|
+
return cloneTypedArray(object, isDeep);
|
|
1726
|
+
case mapTag$2:
|
|
1727
|
+
return new Ctor();
|
|
1728
|
+
case numberTag$1:
|
|
1729
|
+
case stringTag$1:
|
|
1730
|
+
return new Ctor(object);
|
|
1731
|
+
case regexpTag$1:
|
|
1732
|
+
return cloneRegExp(object);
|
|
1733
|
+
case setTag$2:
|
|
1734
|
+
return new Ctor();
|
|
1735
|
+
case symbolTag$1:
|
|
1736
|
+
return cloneSymbol(object);
|
|
1663
1737
|
}
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1738
|
+
}
|
|
1739
|
+
var _initCloneByTag = initCloneByTag$1;
|
|
1740
|
+
var isObject$2 = isObject_1;
|
|
1741
|
+
var objectCreate = Object.create;
|
|
1742
|
+
var baseCreate$1 = function() {
|
|
1743
|
+
function object() {
|
|
1744
|
+
}
|
|
1745
|
+
return function(proto) {
|
|
1746
|
+
if (!isObject$2(proto)) {
|
|
1747
|
+
return {};
|
|
1748
|
+
}
|
|
1749
|
+
if (objectCreate) {
|
|
1750
|
+
return objectCreate(proto);
|
|
1669
1751
|
}
|
|
1752
|
+
object.prototype = proto;
|
|
1753
|
+
var result = new object();
|
|
1754
|
+
object.prototype = void 0;
|
|
1755
|
+
return result;
|
|
1756
|
+
};
|
|
1757
|
+
}();
|
|
1758
|
+
var _baseCreate = baseCreate$1;
|
|
1759
|
+
var baseCreate = _baseCreate, getPrototype = _getPrototype, isPrototype = _isPrototype;
|
|
1760
|
+
function initCloneObject$1(object) {
|
|
1761
|
+
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
|
|
1762
|
+
}
|
|
1763
|
+
var _initCloneObject = initCloneObject$1;
|
|
1764
|
+
var getTag$2 = _getTag, isObjectLike$1 = isObjectLike_1;
|
|
1765
|
+
var mapTag$1 = "[object Map]";
|
|
1766
|
+
function baseIsMap$1(value) {
|
|
1767
|
+
return isObjectLike$1(value) && getTag$2(value) == mapTag$1;
|
|
1768
|
+
}
|
|
1769
|
+
var _baseIsMap = baseIsMap$1;
|
|
1770
|
+
var baseIsMap = _baseIsMap, baseUnary$1 = _baseUnary, nodeUtil$1 = _nodeUtil.exports;
|
|
1771
|
+
var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
|
|
1772
|
+
var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
|
|
1773
|
+
var isMap_1 = isMap$1;
|
|
1774
|
+
var getTag$1 = _getTag, isObjectLike = isObjectLike_1;
|
|
1775
|
+
var setTag$1 = "[object Set]";
|
|
1776
|
+
function baseIsSet$1(value) {
|
|
1777
|
+
return isObjectLike(value) && getTag$1(value) == setTag$1;
|
|
1778
|
+
}
|
|
1779
|
+
var _baseIsSet = baseIsSet$1;
|
|
1780
|
+
var baseIsSet = _baseIsSet, baseUnary = _baseUnary, nodeUtil = _nodeUtil.exports;
|
|
1781
|
+
var nodeIsSet = nodeUtil && nodeUtil.isSet;
|
|
1782
|
+
var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
1783
|
+
var isSet_1 = isSet$1;
|
|
1784
|
+
var Stack = _Stack, arrayEach = _arrayEach, assignValue = _assignValue, baseAssign = _baseAssign, baseAssignIn = _baseAssignIn, cloneBuffer = _cloneBuffer.exports, copyArray = _copyArray, copySymbols = _copySymbols, copySymbolsIn = _copySymbolsIn, getAllKeys = _getAllKeys, getAllKeysIn = _getAllKeysIn, getTag = _getTag, initCloneArray = _initCloneArray, initCloneByTag = _initCloneByTag, initCloneObject = _initCloneObject, isArray$1 = isArray_1, isBuffer$1 = isBuffer$5.exports, isMap = isMap_1, isObject$1 = isObject_1, isSet = isSet_1, keys = keys_1, keysIn = keysIn_1;
|
|
1785
|
+
var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$1 = 4;
|
|
1786
|
+
var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
|
|
1787
|
+
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
1788
|
+
var cloneableTags = {};
|
|
1789
|
+
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
1790
|
+
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
|
|
1791
|
+
function baseClone$1(value, bitmask, customizer, key, object, stack) {
|
|
1792
|
+
var result, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
|
|
1793
|
+
if (customizer) {
|
|
1794
|
+
result = object ? customizer(value, key, object, stack) : customizer(value);
|
|
1795
|
+
}
|
|
1796
|
+
if (result !== void 0) {
|
|
1797
|
+
return result;
|
|
1798
|
+
}
|
|
1799
|
+
if (!isObject$1(value)) {
|
|
1670
1800
|
return value;
|
|
1671
1801
|
}
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
arrayFormatSeparator: ",",
|
|
1678
|
-
parseNumbers: false,
|
|
1679
|
-
parseBooleans: false
|
|
1680
|
-
}, options);
|
|
1681
|
-
validateArrayFormatSeparator(options.arrayFormatSeparator);
|
|
1682
|
-
const formatter = parserForArrayFormat(options);
|
|
1683
|
-
const ret = /* @__PURE__ */ Object.create(null);
|
|
1684
|
-
if (typeof query !== "string") {
|
|
1685
|
-
return ret;
|
|
1802
|
+
var isArr = isArray$1(value);
|
|
1803
|
+
if (isArr) {
|
|
1804
|
+
result = initCloneArray(value);
|
|
1805
|
+
if (!isDeep) {
|
|
1806
|
+
return copyArray(value, result);
|
|
1686
1807
|
}
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1808
|
+
} else {
|
|
1809
|
+
var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
|
|
1810
|
+
if (isBuffer$1(value)) {
|
|
1811
|
+
return cloneBuffer(value, isDeep);
|
|
1690
1812
|
}
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1813
|
+
if (tag == objectTag || tag == argsTag || isFunc && !object) {
|
|
1814
|
+
result = isFlat || isFunc ? {} : initCloneObject(value);
|
|
1815
|
+
if (!isDeep) {
|
|
1816
|
+
return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
|
|
1694
1817
|
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
}
|
|
1699
|
-
for (const key of Object.keys(ret)) {
|
|
1700
|
-
const value = ret[key];
|
|
1701
|
-
if (typeof value === "object" && value !== null) {
|
|
1702
|
-
for (const k of Object.keys(value)) {
|
|
1703
|
-
value[k] = parseValue(value[k], options);
|
|
1704
|
-
}
|
|
1705
|
-
} else {
|
|
1706
|
-
ret[key] = parseValue(value, options);
|
|
1818
|
+
} else {
|
|
1819
|
+
if (!cloneableTags[tag]) {
|
|
1820
|
+
return object ? value : {};
|
|
1707
1821
|
}
|
|
1822
|
+
result = initCloneByTag(value, tag, isDeep);
|
|
1708
1823
|
}
|
|
1709
|
-
if (options.sort === false) {
|
|
1710
|
-
return ret;
|
|
1711
|
-
}
|
|
1712
|
-
return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {
|
|
1713
|
-
const value = ret[key];
|
|
1714
|
-
if (Boolean(value) && typeof value === "object" && !Array.isArray(value)) {
|
|
1715
|
-
result[key] = keysSorter(value);
|
|
1716
|
-
} else {
|
|
1717
|
-
result[key] = value;
|
|
1718
|
-
}
|
|
1719
|
-
return result;
|
|
1720
|
-
}, /* @__PURE__ */ Object.create(null));
|
|
1721
1824
|
}
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1825
|
+
stack || (stack = new Stack());
|
|
1826
|
+
var stacked = stack.get(value);
|
|
1827
|
+
if (stacked) {
|
|
1828
|
+
return stacked;
|
|
1829
|
+
}
|
|
1830
|
+
stack.set(value, result);
|
|
1831
|
+
if (isSet(value)) {
|
|
1832
|
+
value.forEach(function(subValue) {
|
|
1833
|
+
result.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack));
|
|
1834
|
+
});
|
|
1835
|
+
} else if (isMap(value)) {
|
|
1836
|
+
value.forEach(function(subValue, key2) {
|
|
1837
|
+
result.set(key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1840
|
+
var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
|
|
1841
|
+
var props = isArr ? void 0 : keysFunc(value);
|
|
1842
|
+
arrayEach(props || value, function(subValue, key2) {
|
|
1843
|
+
if (props) {
|
|
1844
|
+
key2 = subValue;
|
|
1845
|
+
subValue = value[key2];
|
|
1727
1846
|
}
|
|
1728
|
-
|
|
1729
|
-
encode: true,
|
|
1730
|
-
strict: true,
|
|
1731
|
-
arrayFormat: "none",
|
|
1732
|
-
arrayFormatSeparator: ","
|
|
1733
|
-
}, options);
|
|
1734
|
-
validateArrayFormatSeparator(options.arrayFormatSeparator);
|
|
1735
|
-
const shouldFilter = (key) => options.skipNull && isNullOrUndefined(object[key]) || options.skipEmptyString && object[key] === "";
|
|
1736
|
-
const formatter = encoderForArrayFormat(options);
|
|
1737
|
-
const objectCopy = {};
|
|
1738
|
-
for (const key of Object.keys(object)) {
|
|
1739
|
-
if (!shouldFilter(key)) {
|
|
1740
|
-
objectCopy[key] = object[key];
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
const keys2 = Object.keys(objectCopy);
|
|
1744
|
-
if (options.sort !== false) {
|
|
1745
|
-
keys2.sort(options.sort);
|
|
1746
|
-
}
|
|
1747
|
-
return keys2.map((key) => {
|
|
1748
|
-
const value = object[key];
|
|
1749
|
-
if (value === void 0) {
|
|
1750
|
-
return "";
|
|
1751
|
-
}
|
|
1752
|
-
if (value === null) {
|
|
1753
|
-
return encode2(key, options);
|
|
1754
|
-
}
|
|
1755
|
-
if (Array.isArray(value)) {
|
|
1756
|
-
if (value.length === 0 && options.arrayFormat === "bracket-separator") {
|
|
1757
|
-
return encode2(key, options) + "[]";
|
|
1758
|
-
}
|
|
1759
|
-
return value.reduce(formatter(key), []).join("&");
|
|
1760
|
-
}
|
|
1761
|
-
return encode2(key, options) + "=" + encode2(value, options);
|
|
1762
|
-
}).filter((x) => x.length > 0).join("&");
|
|
1763
|
-
};
|
|
1764
|
-
exports.parseUrl = (url, options) => {
|
|
1765
|
-
options = Object.assign({
|
|
1766
|
-
decode: true
|
|
1767
|
-
}, options);
|
|
1768
|
-
const [url_, hash] = splitOnFirst$1(url, "#");
|
|
1769
|
-
return Object.assign({
|
|
1770
|
-
url: url_.split("?")[0] || "",
|
|
1771
|
-
query: parse(extract(url), options)
|
|
1772
|
-
}, options && options.parseFragmentIdentifier && hash ? { fragmentIdentifier: decode2(hash, options) } : {});
|
|
1773
|
-
};
|
|
1774
|
-
exports.stringifyUrl = (object, options) => {
|
|
1775
|
-
options = Object.assign({
|
|
1776
|
-
encode: true,
|
|
1777
|
-
strict: true,
|
|
1778
|
-
[encodeFragmentIdentifier]: true
|
|
1779
|
-
}, options);
|
|
1780
|
-
const url = removeHash(object.url).split("?")[0] || "";
|
|
1781
|
-
const queryFromUrl = exports.extract(object.url);
|
|
1782
|
-
const parsedQueryFromUrl = exports.parse(queryFromUrl, { sort: false });
|
|
1783
|
-
const query = Object.assign(parsedQueryFromUrl, object.query);
|
|
1784
|
-
let queryString2 = exports.stringify(query, options);
|
|
1785
|
-
if (queryString2) {
|
|
1786
|
-
queryString2 = `?${queryString2}`;
|
|
1787
|
-
}
|
|
1788
|
-
let hash = getHash(object.url);
|
|
1789
|
-
if (object.fragmentIdentifier) {
|
|
1790
|
-
hash = `#${options[encodeFragmentIdentifier] ? encode2(object.fragmentIdentifier, options) : object.fragmentIdentifier}`;
|
|
1791
|
-
}
|
|
1792
|
-
return `${url}${queryString2}${hash}`;
|
|
1793
|
-
};
|
|
1794
|
-
exports.pick = (input, filter, options) => {
|
|
1795
|
-
options = Object.assign({
|
|
1796
|
-
parseFragmentIdentifier: true,
|
|
1797
|
-
[encodeFragmentIdentifier]: false
|
|
1798
|
-
}, options);
|
|
1799
|
-
const { url, query, fragmentIdentifier } = exports.parseUrl(input, options);
|
|
1800
|
-
return exports.stringifyUrl({
|
|
1801
|
-
url,
|
|
1802
|
-
query: filterObject(query, filter),
|
|
1803
|
-
fragmentIdentifier
|
|
1804
|
-
}, options);
|
|
1805
|
-
};
|
|
1806
|
-
exports.exclude = (input, filter, options) => {
|
|
1807
|
-
const exclusionFilter = Array.isArray(filter) ? (key) => !filter.includes(key) : (key, value) => !filter(key, value);
|
|
1808
|
-
return exports.pick(input, exclusionFilter, options);
|
|
1809
|
-
};
|
|
1810
|
-
})(queryString);
|
|
1811
|
-
const supported = [".png", ".jpg", ".jpeg", ".webp", ".bmp", ".tiff"];
|
|
1812
|
-
function getMediaUrl(url, size = 500) {
|
|
1813
|
-
const link = queryString.parseUrl(url);
|
|
1814
|
-
if (!(url.startsWith("https://orderingstackmedia.blob.core.windows.net/pictures") || url.startsWith("https://orderingstack-mmedia-tools.azurewebsites.net/api/img/"))) {
|
|
1815
|
-
return url;
|
|
1816
|
-
}
|
|
1817
|
-
const extension = link.url.substring(link.url.lastIndexOf("."));
|
|
1818
|
-
if (!supported.includes(extension)) {
|
|
1819
|
-
return url;
|
|
1820
|
-
}
|
|
1821
|
-
return queryString.stringifyUrl({
|
|
1822
|
-
url: link.url.replace("https://orderingstackmedia.blob.core.windows.net/pictures/", "https://orderingstack-mmedia-tools.azurewebsites.net/api/img/"),
|
|
1823
|
-
query: { ...link.query, w: size }
|
|
1847
|
+
assignValue(result, key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
|
|
1824
1848
|
});
|
|
1849
|
+
return result;
|
|
1825
1850
|
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1851
|
+
var _baseClone = baseClone$1;
|
|
1852
|
+
var baseClone = _baseClone;
|
|
1853
|
+
var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4;
|
|
1854
|
+
function cloneDeep(value) {
|
|
1855
|
+
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
1828
1856
|
}
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1857
|
+
var cloneDeep_1 = cloneDeep;
|
|
1858
|
+
function shouldShow(product, state) {
|
|
1859
|
+
if (!state || !state.filter || !product || !product.filter || product.kind !== EProductKind.CONFIG)
|
|
1860
|
+
return true;
|
|
1861
|
+
if (product.filter && product.items) {
|
|
1862
|
+
const filteredConfig = Object.values(product.filter).flat().filter((item) => {
|
|
1863
|
+
var _a, _b, _c, _d;
|
|
1864
|
+
return state.filter[(_b = (_a = product.items) == null ? void 0 : _a[0]) == null ? void 0 : _b.fltCtx] && Object.values(state.filter[(_d = (_c = product.items) == null ? void 0 : _c[0]) == null ? void 0 : _d.fltCtx]).includes(item);
|
|
1865
|
+
});
|
|
1866
|
+
if (Array.isArray(filteredConfig) && filteredConfig.length === 0) {
|
|
1867
|
+
return false;
|
|
1834
1868
|
}
|
|
1835
1869
|
}
|
|
1836
|
-
return
|
|
1837
|
-
}
|
|
1838
|
-
var _baseFindIndex = baseFindIndex$1;
|
|
1839
|
-
function baseIsNaN$1(value) {
|
|
1840
|
-
return value !== value;
|
|
1870
|
+
return true;
|
|
1841
1871
|
}
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1872
|
+
const calculateProductPrice = (product, rootState, level = 0) => {
|
|
1873
|
+
if (!product)
|
|
1874
|
+
return 0;
|
|
1875
|
+
let price = parseFloat(product.price) || 0;
|
|
1876
|
+
const { items } = product;
|
|
1877
|
+
const state = cloneDeep_1(rootState);
|
|
1878
|
+
if (shouldShow(product, state)) {
|
|
1879
|
+
if (Array.isArray(items)) {
|
|
1880
|
+
items.forEach((item) => {
|
|
1881
|
+
let itemPrice = 0;
|
|
1882
|
+
if (item.kind !== "3e/product") {
|
|
1883
|
+
itemPrice = calculateProductPrice(item, state, level + 1);
|
|
1884
|
+
} else {
|
|
1885
|
+
const { selected = {} } = state;
|
|
1886
|
+
const { selCtx, id } = item;
|
|
1887
|
+
if (selCtx in selected && id in selected[selCtx]) {
|
|
1888
|
+
itemPrice = calculateProductPrice(item, state, level + 1) * selected[selCtx][id];
|
|
1889
|
+
delete state.selected[selCtx][id];
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
price += itemPrice;
|
|
1893
|
+
});
|
|
1848
1894
|
}
|
|
1849
1895
|
}
|
|
1850
|
-
return
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
var
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
var index = -1, length = array == null ? 0 : array.length;
|
|
1866
|
-
while (++index < length) {
|
|
1867
|
-
if (comparator(value, array[index])) {
|
|
1868
|
-
return true;
|
|
1869
|
-
}
|
|
1896
|
+
return Math.round(100 * price) / 100;
|
|
1897
|
+
};
|
|
1898
|
+
const useDisplayPrice = ({
|
|
1899
|
+
product,
|
|
1900
|
+
state,
|
|
1901
|
+
selected,
|
|
1902
|
+
cheapestGroupOptionsProduct
|
|
1903
|
+
}) => {
|
|
1904
|
+
var _a;
|
|
1905
|
+
const calculatedPrice = state ? calculateProductPrice(product, state) : 0;
|
|
1906
|
+
const calculatedPriceDefaultProductState = product.state && !isEmpty_1((_a = product == null ? void 0 : product.state) == null ? void 0 : _a.selected) ? calculateProductPrice(product, product.state) : 0;
|
|
1907
|
+
const showAsMinPrice = product.minPrice && parseFloat(product.price) === calculatedPrice;
|
|
1908
|
+
let displayPrice = selected || !!cheapestGroupOptionsProduct || parseFloat(product.price) === 0 ? calculatedPrice || calculatedPriceDefaultProductState : parseFloat(product.price);
|
|
1909
|
+
if (cheapestGroupOptionsProduct !== void 0) {
|
|
1910
|
+
displayPrice -= cheapestGroupOptionsProduct;
|
|
1870
1911
|
}
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
function noop$1() {
|
|
1875
|
-
}
|
|
1876
|
-
var noop_1 = noop$1;
|
|
1877
|
-
var Set = _Set, noop = noop_1, setToArray$1 = _setToArray;
|
|
1878
|
-
var INFINITY = 1 / 0;
|
|
1879
|
-
var createSet$1 = !(Set && 1 / setToArray$1(new Set([, -0]))[1] == INFINITY) ? noop : function(values) {
|
|
1880
|
-
return new Set(values);
|
|
1912
|
+
if (showAsMinPrice && product.minPrice)
|
|
1913
|
+
displayPrice = parseFloat(product.minPrice);
|
|
1914
|
+
return { displayPrice, showAsMinPrice, calculatedPriceDefaultProductState };
|
|
1881
1915
|
};
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
while (seenIndex--) {
|
|
1908
|
-
if (seen[seenIndex] === computed) {
|
|
1909
|
-
continue outer;
|
|
1910
|
-
}
|
|
1911
|
-
}
|
|
1912
|
-
if (iteratee) {
|
|
1913
|
-
seen.push(computed);
|
|
1914
|
-
}
|
|
1915
|
-
result.push(value);
|
|
1916
|
-
} else if (!includes(seen, computed, comparator)) {
|
|
1917
|
-
if (seen !== result) {
|
|
1918
|
-
seen.push(computed);
|
|
1916
|
+
function groupOrderLines(array) {
|
|
1917
|
+
const result = [];
|
|
1918
|
+
array.reduce((res, value) => {
|
|
1919
|
+
if (!res[value.hash]) {
|
|
1920
|
+
res[value.hash] = {
|
|
1921
|
+
...value,
|
|
1922
|
+
quantity: 0,
|
|
1923
|
+
discounted: 0,
|
|
1924
|
+
discounts: [],
|
|
1925
|
+
firstProductQuantity: value.quantity,
|
|
1926
|
+
itemsToRemove: []
|
|
1927
|
+
};
|
|
1928
|
+
result.push(res[value.hash]);
|
|
1929
|
+
}
|
|
1930
|
+
res[value.hash].quantity += value.quantity;
|
|
1931
|
+
res[value.hash].itemsToRemove.push(value.id);
|
|
1932
|
+
if (value.discounts) {
|
|
1933
|
+
if (!res[value.hash].discounts) {
|
|
1934
|
+
res[value.hash].discounts = [];
|
|
1935
|
+
}
|
|
1936
|
+
res[value.hash].discounts = res[value.hash].discounts.concat(value.discounts);
|
|
1937
|
+
res[value.hash].discounted = 0;
|
|
1938
|
+
for (let i = 0; i < res[value.hash].discounts.length; i += 1) {
|
|
1939
|
+
if (res[value.hash].discounts[i]) {
|
|
1940
|
+
res[value.hash].discounted += parseFloat(res[value.hash].discounts[i].discountPrice);
|
|
1919
1941
|
}
|
|
1920
|
-
result.push(value);
|
|
1921
1942
|
}
|
|
1922
1943
|
}
|
|
1944
|
+
return res;
|
|
1945
|
+
}, {});
|
|
1923
1946
|
return result;
|
|
1924
1947
|
}
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
function uniq(array) {
|
|
1928
|
-
return array && array.length ? baseUniq(array) : [];
|
|
1948
|
+
function useGroupOrderLines(array) {
|
|
1949
|
+
return groupOrderLines(array);
|
|
1929
1950
|
}
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
useInterval(checkAvailability, interval * 1e3);
|
|
1934
|
-
function checkAvailability() {
|
|
1935
|
-
const filtered = originalMenu ? filterTimeAvailabilityOfProducts(originalMenu, timeZone, void 0, markOnly) : originalMenu;
|
|
1936
|
-
if (!isEqual_1(filtered, menu)) {
|
|
1937
|
-
console.log("menu has changed", filtered);
|
|
1938
|
-
setMenu(filtered);
|
|
1939
|
-
}
|
|
1951
|
+
function getGroupedBucketLines(buckets) {
|
|
1952
|
+
if (!buckets || buckets.length === 0) {
|
|
1953
|
+
return null;
|
|
1940
1954
|
}
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
});
|
|
1955
|
+
return groupOrderLines(buckets.flatMap((bucket) => bucket.lines));
|
|
1956
|
+
}
|
|
1957
|
+
var axios$2 = { exports: {} };
|
|
1958
|
+
var bind$2 = function bind(fn, thisArg) {
|
|
1959
|
+
return function wrap() {
|
|
1960
|
+
var args = new Array(arguments.length);
|
|
1961
|
+
for (var i = 0; i < args.length; i++) {
|
|
1962
|
+
args[i] = arguments[i];
|
|
1950
1963
|
}
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1964
|
+
return fn.apply(thisArg, args);
|
|
1965
|
+
};
|
|
1966
|
+
};
|
|
1967
|
+
var bind$1 = bind$2;
|
|
1968
|
+
var toString = Object.prototype.toString;
|
|
1969
|
+
function isArray(val) {
|
|
1970
|
+
return toString.call(val) === "[object Array]";
|
|
1954
1971
|
}
|
|
1955
|
-
function
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1972
|
+
function isUndefined(val) {
|
|
1973
|
+
return typeof val === "undefined";
|
|
1974
|
+
}
|
|
1975
|
+
function isBuffer(val) {
|
|
1976
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
|
|
1977
|
+
}
|
|
1978
|
+
function isArrayBuffer(val) {
|
|
1979
|
+
return toString.call(val) === "[object ArrayBuffer]";
|
|
1980
|
+
}
|
|
1981
|
+
function isFormData(val) {
|
|
1982
|
+
return typeof FormData !== "undefined" && val instanceof FormData;
|
|
1983
|
+
}
|
|
1984
|
+
function isArrayBufferView(val) {
|
|
1985
|
+
var result;
|
|
1986
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
1987
|
+
result = ArrayBuffer.isView(val);
|
|
1988
|
+
} else {
|
|
1989
|
+
result = val && val.buffer && val.buffer instanceof ArrayBuffer;
|
|
1963
1990
|
}
|
|
1964
|
-
return
|
|
1991
|
+
return result;
|
|
1965
1992
|
}
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
EPaymentStatus2["UNINITIALIZED"] = "UNINITIALIZED";
|
|
1969
|
-
EPaymentStatus2["PROCESSING"] = "PROCESSING";
|
|
1970
|
-
EPaymentStatus2["PAID"] = "PAID";
|
|
1971
|
-
EPaymentStatus2["FAILED"] = "FAILED";
|
|
1972
|
-
EPaymentStatus2["PRINTING_RECEIPT"] = "PRINTING_RECEIPT";
|
|
1973
|
-
EPaymentStatus2["PRINTING_RECEIPT_SUCCESS"] = "PRINTING_RECEIPT_SUCCESS";
|
|
1974
|
-
EPaymentStatus2["SENDING_RECEIPT"] = "SENDING_RECEIPT";
|
|
1975
|
-
EPaymentStatus2["SENDING_RECEIPT_SUCCESS"] = "SENDING_RECEIPT_SUCCESS";
|
|
1976
|
-
EPaymentStatus2["ERROR"] = "ERROR";
|
|
1977
|
-
})(EPaymentStatus || (EPaymentStatus = {}));
|
|
1978
|
-
var ECouponViewType;
|
|
1979
|
-
(function(ECouponViewType2) {
|
|
1980
|
-
ECouponViewType2["CAROUSEL"] = "carousel";
|
|
1981
|
-
ECouponViewType2["NORMAL"] = "normal";
|
|
1982
|
-
ECouponViewType2["IMAGE"] = "image";
|
|
1983
|
-
})(ECouponViewType || (ECouponViewType = {}));
|
|
1984
|
-
var EProductKind;
|
|
1985
|
-
(function(EProductKind2) {
|
|
1986
|
-
EProductKind2["GROUP"] = "3e/group";
|
|
1987
|
-
EProductKind2["PRODUCT"] = "3e/product";
|
|
1988
|
-
EProductKind2["CATEGORY"] = "3e/group/category";
|
|
1989
|
-
EProductKind2["OPTIONS"] = "3e/group/options";
|
|
1990
|
-
EProductKind2["CONFIG"] = "3e/group/config";
|
|
1991
|
-
EProductKind2["STATIC"] = "3e/static";
|
|
1992
|
-
EProductKind2["REF"] = "3e/ref";
|
|
1993
|
-
EProductKind2["QUERY"] = "3e/query";
|
|
1994
|
-
})(EProductKind || (EProductKind = {}));
|
|
1995
|
-
var EProductKindBucket;
|
|
1996
|
-
(function(EProductKindBucket2) {
|
|
1997
|
-
EProductKindBucket2["GROUP"] = "group";
|
|
1998
|
-
EProductKindBucket2["PRODUCT"] = "product";
|
|
1999
|
-
})(EProductKindBucket || (EProductKindBucket = {}));
|
|
2000
|
-
var EOrderType;
|
|
2001
|
-
(function(EOrderType2) {
|
|
2002
|
-
EOrderType2["TAKE_AWAY"] = "TAKE_AWAY";
|
|
2003
|
-
EOrderType2["DELIVERY"] = "DELIVERY";
|
|
2004
|
-
EOrderType2["DINE_IN"] = "DINE_IN";
|
|
2005
|
-
EOrderType2["DINE_IN_OPEN"] = "DINE_IN_OPEN";
|
|
2006
|
-
EOrderType2["GLOVO_DELIVERY"] = "GLOVO_DELIVERY";
|
|
2007
|
-
EOrderType2["GLOVO_TAKE_AWAY"] = "GLOVO_TAKE_AWAY";
|
|
2008
|
-
EOrderType2["JUSTEAT_DELIVERY"] = "JUSTEAT_DELIVERY";
|
|
2009
|
-
EOrderType2["JUSTEAT_TAKE_AWAY"] = "JUSTEAT_TAKE_AWAY";
|
|
2010
|
-
EOrderType2["UBER_DELIVERY"] = "UBER_DELIVERY";
|
|
2011
|
-
EOrderType2["UBER_TAKE_AWAY"] = "UBER_TAKE_AWAY";
|
|
2012
|
-
EOrderType2["UBER_DINE_IN"] = "UBER_DINE_IN";
|
|
2013
|
-
EOrderType2["BOLT_DELIVERY"] = "BOLT_DELIVERY";
|
|
2014
|
-
EOrderType2["BOLT_TAKE_AWAY"] = "BOLT_TAKE_AWAY";
|
|
2015
|
-
EOrderType2["WOLT_DELIVERY"] = "WOLT_DELIVERY";
|
|
2016
|
-
EOrderType2["WOLT_TAKE_AWAY"] = "WOLT_TAKE_AWAY";
|
|
2017
|
-
EOrderType2["WOLT_DINE_IN"] = "WOLT_DINE_IN";
|
|
2018
|
-
})(EOrderType || (EOrderType = {}));
|
|
2019
|
-
var EOrderStatus;
|
|
2020
|
-
(function(EOrderStatus2) {
|
|
2021
|
-
EOrderStatus2["NEW"] = "NEW";
|
|
2022
|
-
EOrderStatus2["COMPLETED"] = "COMPLETED";
|
|
2023
|
-
EOrderStatus2["VERIFIED"] = "VERIFIED";
|
|
2024
|
-
EOrderStatus2["DELIVER"] = "DELIVER";
|
|
2025
|
-
EOrderStatus2["DELIVERED"] = "DELIVERED";
|
|
2026
|
-
EOrderStatus2["CLOSED"] = "CLOSED";
|
|
2027
|
-
EOrderStatus2["ABANDONED"] = "ABANDONED";
|
|
2028
|
-
EOrderStatus2["CANCELLED"] = "CANCELLED";
|
|
2029
|
-
EOrderStatus2["PICKED"] = "PICKED";
|
|
2030
|
-
})(EOrderStatus || (EOrderStatus = {}));
|
|
2031
|
-
var EOrderPaymentType;
|
|
2032
|
-
(function(EOrderPaymentType2) {
|
|
2033
|
-
EOrderPaymentType2["CASH"] = "CASH";
|
|
2034
|
-
EOrderPaymentType2["CARD"] = "CARD";
|
|
2035
|
-
EOrderPaymentType2["COD"] = "COD";
|
|
2036
|
-
EOrderPaymentType2["TERMINAL"] = "TERMINAL";
|
|
2037
|
-
EOrderPaymentType2["EPAYMENT"] = "EPAYMENT";
|
|
2038
|
-
EOrderPaymentType2["COUPON"] = "COUPON";
|
|
2039
|
-
EOrderPaymentType2["WALLET"] = "WALLET";
|
|
2040
|
-
EOrderPaymentType2["PREAUTHORIZED"] = "PREAUTHORIZED";
|
|
2041
|
-
EOrderPaymentType2["RETURN"] = "RETURN";
|
|
2042
|
-
EOrderPaymentType2["EXTERNAL"] = "EXTERNAL";
|
|
2043
|
-
})(EOrderPaymentType || (EOrderPaymentType = {}));
|
|
2044
|
-
var OrderSource;
|
|
2045
|
-
(function(OrderSource2) {
|
|
2046
|
-
OrderSource2["KIOSK"] = "KIOSK";
|
|
2047
|
-
OrderSource2["WEB"] = "WEB";
|
|
2048
|
-
OrderSource2["JUST_EAT_TAKE_AWAY"] = "JUSTEATTAKEAWAY";
|
|
2049
|
-
OrderSource2["GLOVO"] = "GLOVO";
|
|
2050
|
-
OrderSource2["PYSZNE"] = "PYSZNE";
|
|
2051
|
-
OrderSource2["WOLT"] = "WOLT";
|
|
2052
|
-
OrderSource2["UBER"] = "UBER";
|
|
2053
|
-
OrderSource2["BOLT"] = "BOLT";
|
|
2054
|
-
})(OrderSource || (OrderSource = {}));
|
|
2055
|
-
var EOrderLineStatus;
|
|
2056
|
-
(function(EOrderLineStatus2) {
|
|
2057
|
-
EOrderLineStatus2["NEW"] = "NEW";
|
|
2058
|
-
EOrderLineStatus2["TECHNICAL"] = "TECHNICAL";
|
|
2059
|
-
EOrderLineStatus2["CONFIRMED"] = "CONFIRMED";
|
|
2060
|
-
EOrderLineStatus2["PROCESSING"] = "PROCESSING";
|
|
2061
|
-
EOrderLineStatus2["PROCESSED"] = "PROCESSED";
|
|
2062
|
-
EOrderLineStatus2["VOID"] = "VOID";
|
|
2063
|
-
EOrderLineStatus2["WASTE"] = "WASTE";
|
|
2064
|
-
})(EOrderLineStatus || (EOrderLineStatus = {}));
|
|
2065
|
-
var EOrderProductKind;
|
|
2066
|
-
(function(EOrderProductKind2) {
|
|
2067
|
-
EOrderProductKind2["GROUP"] = "group";
|
|
2068
|
-
EOrderProductKind2["PRODUCT"] = "product";
|
|
2069
|
-
})(EOrderProductKind || (EOrderProductKind = {}));
|
|
2070
|
-
var EChannelName;
|
|
2071
|
-
(function(EChannelName2) {
|
|
2072
|
-
EChannelName2["DINE_IN"] = "DINE_IN";
|
|
2073
|
-
EChannelName2["TAKE_AWAY"] = "TAKE_AWAY";
|
|
2074
|
-
EChannelName2["DELIVERY"] = "DELIVERY";
|
|
2075
|
-
EChannelName2["GLOVO_DELIVERY"] = "GLOVO_DELIVERY";
|
|
2076
|
-
EChannelName2["JUSTEAT_DELIVERY"] = "JUSTEAT_DELIVERY";
|
|
2077
|
-
EChannelName2["UBER_DELIVERY"] = "UBER_DELIVERY";
|
|
2078
|
-
EChannelName2["BOLT_DELIVERY"] = "BOLT_DELIVERY";
|
|
2079
|
-
EChannelName2["WOLT_DELIVERY"] = "WOLT_DELIVERY";
|
|
2080
|
-
})(EChannelName || (EChannelName = {}));
|
|
2081
|
-
function arrayEach$1(array, iteratee) {
|
|
2082
|
-
var index = -1, length = array == null ? 0 : array.length;
|
|
2083
|
-
while (++index < length) {
|
|
2084
|
-
if (iteratee(array[index], index, array) === false) {
|
|
2085
|
-
break;
|
|
2086
|
-
}
|
|
2087
|
-
}
|
|
2088
|
-
return array;
|
|
1993
|
+
function isString(val) {
|
|
1994
|
+
return typeof val === "string";
|
|
2089
1995
|
}
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
}();
|
|
2100
|
-
var _defineProperty = defineProperty$1;
|
|
2101
|
-
var defineProperty = _defineProperty;
|
|
2102
|
-
function baseAssignValue$2(object, key, value) {
|
|
2103
|
-
if (key == "__proto__" && defineProperty) {
|
|
2104
|
-
defineProperty(object, key, {
|
|
2105
|
-
"configurable": true,
|
|
2106
|
-
"enumerable": true,
|
|
2107
|
-
"value": value,
|
|
2108
|
-
"writable": true
|
|
2109
|
-
});
|
|
2110
|
-
} else {
|
|
2111
|
-
object[key] = value;
|
|
1996
|
+
function isNumber(val) {
|
|
1997
|
+
return typeof val === "number";
|
|
1998
|
+
}
|
|
1999
|
+
function isObject(val) {
|
|
2000
|
+
return val !== null && typeof val === "object";
|
|
2001
|
+
}
|
|
2002
|
+
function isPlainObject(val) {
|
|
2003
|
+
if (toString.call(val) !== "[object Object]") {
|
|
2004
|
+
return false;
|
|
2112
2005
|
}
|
|
2006
|
+
var prototype = Object.getPrototypeOf(val);
|
|
2007
|
+
return prototype === null || prototype === Object.prototype;
|
|
2113
2008
|
}
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2009
|
+
function isDate(val) {
|
|
2010
|
+
return toString.call(val) === "[object Date]";
|
|
2011
|
+
}
|
|
2012
|
+
function isFile(val) {
|
|
2013
|
+
return toString.call(val) === "[object File]";
|
|
2014
|
+
}
|
|
2015
|
+
function isBlob(val) {
|
|
2016
|
+
return toString.call(val) === "[object Blob]";
|
|
2017
|
+
}
|
|
2018
|
+
function isFunction(val) {
|
|
2019
|
+
return toString.call(val) === "[object Function]";
|
|
2020
|
+
}
|
|
2021
|
+
function isStream(val) {
|
|
2022
|
+
return isObject(val) && isFunction(val.pipe);
|
|
2023
|
+
}
|
|
2024
|
+
function isURLSearchParams(val) {
|
|
2025
|
+
return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
|
|
2026
|
+
}
|
|
2027
|
+
function trim(str) {
|
|
2028
|
+
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
|
|
2029
|
+
}
|
|
2030
|
+
function isStandardBrowserEnv() {
|
|
2031
|
+
if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
|
|
2032
|
+
return false;
|
|
2122
2033
|
}
|
|
2034
|
+
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
2123
2035
|
}
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
var
|
|
2133
|
-
|
|
2134
|
-
newValue = source2[key];
|
|
2036
|
+
function forEach(obj, fn) {
|
|
2037
|
+
if (obj === null || typeof obj === "undefined") {
|
|
2038
|
+
return;
|
|
2039
|
+
}
|
|
2040
|
+
if (typeof obj !== "object") {
|
|
2041
|
+
obj = [obj];
|
|
2042
|
+
}
|
|
2043
|
+
if (isArray(obj)) {
|
|
2044
|
+
for (var i = 0, l = obj.length; i < l; i++) {
|
|
2045
|
+
fn.call(null, obj[i], i, obj);
|
|
2135
2046
|
}
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2047
|
+
} else {
|
|
2048
|
+
for (var key in obj) {
|
|
2049
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2050
|
+
fn.call(null, obj[key], key, obj);
|
|
2051
|
+
}
|
|
2140
2052
|
}
|
|
2141
2053
|
}
|
|
2142
|
-
return object;
|
|
2143
|
-
}
|
|
2144
|
-
var _copyObject = copyObject$4;
|
|
2145
|
-
var copyObject$3 = _copyObject, keys$1 = keys_1;
|
|
2146
|
-
function baseAssign$1(object, source2) {
|
|
2147
|
-
return object && copyObject$3(source2, keys$1(source2), object);
|
|
2148
2054
|
}
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2055
|
+
function merge() {
|
|
2056
|
+
var result = {};
|
|
2057
|
+
function assignValue2(val, key) {
|
|
2058
|
+
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
|
2059
|
+
result[key] = merge(result[key], val);
|
|
2060
|
+
} else if (isPlainObject(val)) {
|
|
2061
|
+
result[key] = merge({}, val);
|
|
2062
|
+
} else if (isArray(val)) {
|
|
2063
|
+
result[key] = val.slice();
|
|
2064
|
+
} else {
|
|
2065
|
+
result[key] = val;
|
|
2155
2066
|
}
|
|
2156
2067
|
}
|
|
2068
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
2069
|
+
forEach(arguments[i], assignValue2);
|
|
2070
|
+
}
|
|
2157
2071
|
return result;
|
|
2158
2072
|
}
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
return nativeKeysIn(object);
|
|
2166
|
-
}
|
|
2167
|
-
var isProto = isPrototype$1(object), result = [];
|
|
2168
|
-
for (var key in object) {
|
|
2169
|
-
if (!(key == "constructor" && (isProto || !hasOwnProperty$1.call(object, key)))) {
|
|
2170
|
-
result.push(key);
|
|
2073
|
+
function extend(a, b, thisArg) {
|
|
2074
|
+
forEach(b, function assignValue2(val, key) {
|
|
2075
|
+
if (thisArg && typeof val === "function") {
|
|
2076
|
+
a[key] = bind$1(val, thisArg);
|
|
2077
|
+
} else {
|
|
2078
|
+
a[key] = val;
|
|
2171
2079
|
}
|
|
2172
|
-
}
|
|
2173
|
-
return
|
|
2174
|
-
}
|
|
2175
|
-
var _baseKeysIn = baseKeysIn$1;
|
|
2176
|
-
var arrayLikeKeys = _arrayLikeKeys, baseKeysIn = _baseKeysIn, isArrayLike = isArrayLike_1;
|
|
2177
|
-
function keysIn$3(object) {
|
|
2178
|
-
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
|
|
2179
|
-
}
|
|
2180
|
-
var keysIn_1 = keysIn$3;
|
|
2181
|
-
var copyObject$2 = _copyObject, keysIn$2 = keysIn_1;
|
|
2182
|
-
function baseAssignIn$1(object, source2) {
|
|
2183
|
-
return object && copyObject$2(source2, keysIn$2(source2), object);
|
|
2080
|
+
});
|
|
2081
|
+
return a;
|
|
2184
2082
|
}
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
(
|
|
2188
|
-
var root2 = _root;
|
|
2189
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
2190
|
-
var freeModule = freeExports && true && module && !module.nodeType && module;
|
|
2191
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2192
|
-
var Buffer = moduleExports ? root2.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
|
|
2193
|
-
function cloneBuffer2(buffer, isDeep) {
|
|
2194
|
-
if (isDeep) {
|
|
2195
|
-
return buffer.slice();
|
|
2196
|
-
}
|
|
2197
|
-
var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
2198
|
-
buffer.copy(result);
|
|
2199
|
-
return result;
|
|
2200
|
-
}
|
|
2201
|
-
module.exports = cloneBuffer2;
|
|
2202
|
-
})(_cloneBuffer, _cloneBuffer.exports);
|
|
2203
|
-
function copyArray$1(source2, array) {
|
|
2204
|
-
var index = -1, length = source2.length;
|
|
2205
|
-
array || (array = Array(length));
|
|
2206
|
-
while (++index < length) {
|
|
2207
|
-
array[index] = source2[index];
|
|
2083
|
+
function stripBOM(content) {
|
|
2084
|
+
if (content.charCodeAt(0) === 65279) {
|
|
2085
|
+
content = content.slice(1);
|
|
2208
2086
|
}
|
|
2209
|
-
return
|
|
2210
|
-
}
|
|
2211
|
-
var _copyArray = copyArray$1;
|
|
2212
|
-
var copyObject$1 = _copyObject, getSymbols$1 = _getSymbols;
|
|
2213
|
-
function copySymbols$1(source2, object) {
|
|
2214
|
-
return copyObject$1(source2, getSymbols$1(source2), object);
|
|
2087
|
+
return content;
|
|
2215
2088
|
}
|
|
2216
|
-
var
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2089
|
+
var utils$d = {
|
|
2090
|
+
isArray,
|
|
2091
|
+
isArrayBuffer,
|
|
2092
|
+
isBuffer,
|
|
2093
|
+
isFormData,
|
|
2094
|
+
isArrayBufferView,
|
|
2095
|
+
isString,
|
|
2096
|
+
isNumber,
|
|
2097
|
+
isObject,
|
|
2098
|
+
isPlainObject,
|
|
2099
|
+
isUndefined,
|
|
2100
|
+
isDate,
|
|
2101
|
+
isFile,
|
|
2102
|
+
isBlob,
|
|
2103
|
+
isFunction,
|
|
2104
|
+
isStream,
|
|
2105
|
+
isURLSearchParams,
|
|
2106
|
+
isStandardBrowserEnv,
|
|
2107
|
+
forEach,
|
|
2108
|
+
merge,
|
|
2109
|
+
extend,
|
|
2110
|
+
trim,
|
|
2111
|
+
stripBOM
|
|
2229
2112
|
};
|
|
2230
|
-
var
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
return copyObject(source2, getSymbolsIn$1(source2), object);
|
|
2234
|
-
}
|
|
2235
|
-
var _copySymbolsIn = copySymbolsIn$1;
|
|
2236
|
-
var baseGetAllKeys = _baseGetAllKeys, getSymbolsIn = _getSymbolsIn, keysIn$1 = keysIn_1;
|
|
2237
|
-
function getAllKeysIn$1(object) {
|
|
2238
|
-
return baseGetAllKeys(object, keysIn$1, getSymbolsIn);
|
|
2113
|
+
var utils$c = utils$d;
|
|
2114
|
+
function encode(val) {
|
|
2115
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
2239
2116
|
}
|
|
2240
|
-
var
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
function initCloneArray$1(array) {
|
|
2244
|
-
var length = array.length, result = new array.constructor(length);
|
|
2245
|
-
if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
|
|
2246
|
-
result.index = array.index;
|
|
2247
|
-
result.input = array.input;
|
|
2117
|
+
var buildURL$2 = function buildURL(url, params, paramsSerializer) {
|
|
2118
|
+
if (!params) {
|
|
2119
|
+
return url;
|
|
2248
2120
|
}
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
}
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
var
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
}
|
|
2283
|
-
var _cloneTypedArray = cloneTypedArray$1;
|
|
2284
|
-
var cloneArrayBuffer = _cloneArrayBuffer, cloneDataView = _cloneDataView, cloneRegExp = _cloneRegExp, cloneSymbol = _cloneSymbol, cloneTypedArray = _cloneTypedArray;
|
|
2285
|
-
var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]";
|
|
2286
|
-
var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
|
|
2287
|
-
function initCloneByTag$1(object, tag, isDeep) {
|
|
2288
|
-
var Ctor = object.constructor;
|
|
2289
|
-
switch (tag) {
|
|
2290
|
-
case arrayBufferTag$1:
|
|
2291
|
-
return cloneArrayBuffer(object);
|
|
2292
|
-
case boolTag$1:
|
|
2293
|
-
case dateTag$1:
|
|
2294
|
-
return new Ctor(+object);
|
|
2295
|
-
case dataViewTag$1:
|
|
2296
|
-
return cloneDataView(object, isDeep);
|
|
2297
|
-
case float32Tag$1:
|
|
2298
|
-
case float64Tag$1:
|
|
2299
|
-
case int8Tag$1:
|
|
2300
|
-
case int16Tag$1:
|
|
2301
|
-
case int32Tag$1:
|
|
2302
|
-
case uint8Tag$1:
|
|
2303
|
-
case uint8ClampedTag$1:
|
|
2304
|
-
case uint16Tag$1:
|
|
2305
|
-
case uint32Tag$1:
|
|
2306
|
-
return cloneTypedArray(object, isDeep);
|
|
2307
|
-
case mapTag$2:
|
|
2308
|
-
return new Ctor();
|
|
2309
|
-
case numberTag$1:
|
|
2310
|
-
case stringTag$1:
|
|
2311
|
-
return new Ctor(object);
|
|
2312
|
-
case regexpTag$1:
|
|
2313
|
-
return cloneRegExp(object);
|
|
2314
|
-
case setTag$2:
|
|
2315
|
-
return new Ctor();
|
|
2316
|
-
case symbolTag$1:
|
|
2317
|
-
return cloneSymbol(object);
|
|
2121
|
+
var serializedParams;
|
|
2122
|
+
if (paramsSerializer) {
|
|
2123
|
+
serializedParams = paramsSerializer(params);
|
|
2124
|
+
} else if (utils$c.isURLSearchParams(params)) {
|
|
2125
|
+
serializedParams = params.toString();
|
|
2126
|
+
} else {
|
|
2127
|
+
var parts = [];
|
|
2128
|
+
utils$c.forEach(params, function serialize(val, key) {
|
|
2129
|
+
if (val === null || typeof val === "undefined") {
|
|
2130
|
+
return;
|
|
2131
|
+
}
|
|
2132
|
+
if (utils$c.isArray(val)) {
|
|
2133
|
+
key = key + "[]";
|
|
2134
|
+
} else {
|
|
2135
|
+
val = [val];
|
|
2136
|
+
}
|
|
2137
|
+
utils$c.forEach(val, function parseValue(v) {
|
|
2138
|
+
if (utils$c.isDate(v)) {
|
|
2139
|
+
v = v.toISOString();
|
|
2140
|
+
} else if (utils$c.isObject(v)) {
|
|
2141
|
+
v = JSON.stringify(v);
|
|
2142
|
+
}
|
|
2143
|
+
parts.push(encode(key) + "=" + encode(v));
|
|
2144
|
+
});
|
|
2145
|
+
});
|
|
2146
|
+
serializedParams = parts.join("&");
|
|
2147
|
+
}
|
|
2148
|
+
if (serializedParams) {
|
|
2149
|
+
var hashmarkIndex = url.indexOf("#");
|
|
2150
|
+
if (hashmarkIndex !== -1) {
|
|
2151
|
+
url = url.slice(0, hashmarkIndex);
|
|
2152
|
+
}
|
|
2153
|
+
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
2318
2154
|
}
|
|
2155
|
+
return url;
|
|
2156
|
+
};
|
|
2157
|
+
var utils$b = utils$d;
|
|
2158
|
+
function InterceptorManager$1() {
|
|
2159
|
+
this.handlers = [];
|
|
2319
2160
|
}
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2161
|
+
InterceptorManager$1.prototype.use = function use(fulfilled, rejected, options) {
|
|
2162
|
+
this.handlers.push({
|
|
2163
|
+
fulfilled,
|
|
2164
|
+
rejected,
|
|
2165
|
+
synchronous: options ? options.synchronous : false,
|
|
2166
|
+
runWhen: options ? options.runWhen : null
|
|
2167
|
+
});
|
|
2168
|
+
return this.handlers.length - 1;
|
|
2169
|
+
};
|
|
2170
|
+
InterceptorManager$1.prototype.eject = function eject(id) {
|
|
2171
|
+
if (this.handlers[id]) {
|
|
2172
|
+
this.handlers[id] = null;
|
|
2325
2173
|
}
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2174
|
+
};
|
|
2175
|
+
InterceptorManager$1.prototype.forEach = function forEach2(fn) {
|
|
2176
|
+
utils$b.forEach(this.handlers, function forEachHandler(h) {
|
|
2177
|
+
if (h !== null) {
|
|
2178
|
+
fn(h);
|
|
2329
2179
|
}
|
|
2330
|
-
|
|
2331
|
-
|
|
2180
|
+
});
|
|
2181
|
+
};
|
|
2182
|
+
var InterceptorManager_1 = InterceptorManager$1;
|
|
2183
|
+
var utils$a = utils$d;
|
|
2184
|
+
var normalizeHeaderName$1 = function normalizeHeaderName(headers, normalizedName) {
|
|
2185
|
+
utils$a.forEach(headers, function processHeader(value, name2) {
|
|
2186
|
+
if (name2 !== normalizedName && name2.toUpperCase() === normalizedName.toUpperCase()) {
|
|
2187
|
+
headers[normalizedName] = value;
|
|
2188
|
+
delete headers[name2];
|
|
2332
2189
|
}
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
var _baseCreate = baseCreate$1;
|
|
2340
|
-
var baseCreate = _baseCreate, getPrototype = _getPrototype, isPrototype = _isPrototype;
|
|
2341
|
-
function initCloneObject$1(object) {
|
|
2342
|
-
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
|
|
2343
|
-
}
|
|
2344
|
-
var _initCloneObject = initCloneObject$1;
|
|
2345
|
-
var getTag$2 = _getTag, isObjectLike$1 = isObjectLike_1;
|
|
2346
|
-
var mapTag$1 = "[object Map]";
|
|
2347
|
-
function baseIsMap$1(value) {
|
|
2348
|
-
return isObjectLike$1(value) && getTag$2(value) == mapTag$1;
|
|
2349
|
-
}
|
|
2350
|
-
var _baseIsMap = baseIsMap$1;
|
|
2351
|
-
var baseIsMap = _baseIsMap, baseUnary$1 = _baseUnary, nodeUtil$1 = _nodeUtil.exports;
|
|
2352
|
-
var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
|
|
2353
|
-
var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
|
|
2354
|
-
var isMap_1 = isMap$1;
|
|
2355
|
-
var getTag$1 = _getTag, isObjectLike = isObjectLike_1;
|
|
2356
|
-
var setTag$1 = "[object Set]";
|
|
2357
|
-
function baseIsSet$1(value) {
|
|
2358
|
-
return isObjectLike(value) && getTag$1(value) == setTag$1;
|
|
2359
|
-
}
|
|
2360
|
-
var _baseIsSet = baseIsSet$1;
|
|
2361
|
-
var baseIsSet = _baseIsSet, baseUnary = _baseUnary, nodeUtil = _nodeUtil.exports;
|
|
2362
|
-
var nodeIsSet = nodeUtil && nodeUtil.isSet;
|
|
2363
|
-
var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
2364
|
-
var isSet_1 = isSet$1;
|
|
2365
|
-
var Stack = _Stack, arrayEach = _arrayEach, assignValue = _assignValue, baseAssign = _baseAssign, baseAssignIn = _baseAssignIn, cloneBuffer = _cloneBuffer.exports, copyArray = _copyArray, copySymbols = _copySymbols, copySymbolsIn = _copySymbolsIn, getAllKeys = _getAllKeys, getAllKeysIn = _getAllKeysIn, getTag = _getTag, initCloneArray = _initCloneArray, initCloneByTag = _initCloneByTag, initCloneObject = _initCloneObject, isArray$1 = isArray_1, isBuffer$1 = isBuffer$5.exports, isMap = isMap_1, isObject$1 = isObject_1, isSet = isSet_1, keys = keys_1, keysIn = keysIn_1;
|
|
2366
|
-
var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$1 = 4;
|
|
2367
|
-
var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
|
|
2368
|
-
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
2369
|
-
var cloneableTags = {};
|
|
2370
|
-
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
2371
|
-
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
|
|
2372
|
-
function baseClone$1(value, bitmask, customizer, key, object, stack) {
|
|
2373
|
-
var result, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
|
|
2374
|
-
if (customizer) {
|
|
2375
|
-
result = object ? customizer(value, key, object, stack) : customizer(value);
|
|
2376
|
-
}
|
|
2377
|
-
if (result !== void 0) {
|
|
2378
|
-
return result;
|
|
2379
|
-
}
|
|
2380
|
-
if (!isObject$1(value)) {
|
|
2381
|
-
return value;
|
|
2190
|
+
});
|
|
2191
|
+
};
|
|
2192
|
+
var enhanceError$2 = function enhanceError(error, config, code, request2, response) {
|
|
2193
|
+
error.config = config;
|
|
2194
|
+
if (code) {
|
|
2195
|
+
error.code = code;
|
|
2382
2196
|
}
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2197
|
+
error.request = request2;
|
|
2198
|
+
error.response = response;
|
|
2199
|
+
error.isAxiosError = true;
|
|
2200
|
+
error.toJSON = function toJSON() {
|
|
2201
|
+
return {
|
|
2202
|
+
message: this.message,
|
|
2203
|
+
name: this.name,
|
|
2204
|
+
description: this.description,
|
|
2205
|
+
number: this.number,
|
|
2206
|
+
fileName: this.fileName,
|
|
2207
|
+
lineNumber: this.lineNumber,
|
|
2208
|
+
columnNumber: this.columnNumber,
|
|
2209
|
+
stack: this.stack,
|
|
2210
|
+
config: this.config,
|
|
2211
|
+
code: this.code
|
|
2212
|
+
};
|
|
2213
|
+
};
|
|
2214
|
+
return error;
|
|
2215
|
+
};
|
|
2216
|
+
var enhanceError$1 = enhanceError$2;
|
|
2217
|
+
var createError$2 = function createError(message, config, code, request2, response) {
|
|
2218
|
+
var error = new Error(message);
|
|
2219
|
+
return enhanceError$1(error, config, code, request2, response);
|
|
2220
|
+
};
|
|
2221
|
+
var createError$1 = createError$2;
|
|
2222
|
+
var settle$1 = function settle(resolve, reject, response) {
|
|
2223
|
+
var validateStatus2 = response.config.validateStatus;
|
|
2224
|
+
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
2225
|
+
resolve(response);
|
|
2389
2226
|
} else {
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2227
|
+
reject(createError$1("Request failed with status code " + response.status, response.config, null, response.request, response));
|
|
2228
|
+
}
|
|
2229
|
+
};
|
|
2230
|
+
var utils$9 = utils$d;
|
|
2231
|
+
var cookies$1 = utils$9.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
2232
|
+
return {
|
|
2233
|
+
write: function write(name2, value, expires, path, domain, secure) {
|
|
2234
|
+
var cookie = [];
|
|
2235
|
+
cookie.push(name2 + "=" + encodeURIComponent(value));
|
|
2236
|
+
if (utils$9.isNumber(expires)) {
|
|
2237
|
+
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
2398
2238
|
}
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
return object ? value : {};
|
|
2239
|
+
if (utils$9.isString(path)) {
|
|
2240
|
+
cookie.push("path=" + path);
|
|
2402
2241
|
}
|
|
2403
|
-
|
|
2242
|
+
if (utils$9.isString(domain)) {
|
|
2243
|
+
cookie.push("domain=" + domain);
|
|
2244
|
+
}
|
|
2245
|
+
if (secure === true) {
|
|
2246
|
+
cookie.push("secure");
|
|
2247
|
+
}
|
|
2248
|
+
document.cookie = cookie.join("; ");
|
|
2249
|
+
},
|
|
2250
|
+
read: function read(name2) {
|
|
2251
|
+
var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name2 + ")=([^;]*)"));
|
|
2252
|
+
return match ? decodeURIComponent(match[3]) : null;
|
|
2253
|
+
},
|
|
2254
|
+
remove: function remove(name2) {
|
|
2255
|
+
this.write(name2, "", Date.now() - 864e5);
|
|
2404
2256
|
}
|
|
2257
|
+
};
|
|
2258
|
+
}() : function nonStandardBrowserEnv() {
|
|
2259
|
+
return {
|
|
2260
|
+
write: function write() {
|
|
2261
|
+
},
|
|
2262
|
+
read: function read() {
|
|
2263
|
+
return null;
|
|
2264
|
+
},
|
|
2265
|
+
remove: function remove() {
|
|
2266
|
+
}
|
|
2267
|
+
};
|
|
2268
|
+
}();
|
|
2269
|
+
var isAbsoluteURL$1 = function isAbsoluteURL(url) {
|
|
2270
|
+
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
2271
|
+
};
|
|
2272
|
+
var combineURLs$1 = function combineURLs(baseURL, relativeURL) {
|
|
2273
|
+
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
2274
|
+
};
|
|
2275
|
+
var isAbsoluteURL2 = isAbsoluteURL$1;
|
|
2276
|
+
var combineURLs2 = combineURLs$1;
|
|
2277
|
+
var buildFullPath$1 = function buildFullPath(baseURL, requestedURL) {
|
|
2278
|
+
if (baseURL && !isAbsoluteURL2(requestedURL)) {
|
|
2279
|
+
return combineURLs2(baseURL, requestedURL);
|
|
2405
2280
|
}
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2281
|
+
return requestedURL;
|
|
2282
|
+
};
|
|
2283
|
+
var utils$8 = utils$d;
|
|
2284
|
+
var ignoreDuplicateOf = [
|
|
2285
|
+
"age",
|
|
2286
|
+
"authorization",
|
|
2287
|
+
"content-length",
|
|
2288
|
+
"content-type",
|
|
2289
|
+
"etag",
|
|
2290
|
+
"expires",
|
|
2291
|
+
"from",
|
|
2292
|
+
"host",
|
|
2293
|
+
"if-modified-since",
|
|
2294
|
+
"if-unmodified-since",
|
|
2295
|
+
"last-modified",
|
|
2296
|
+
"location",
|
|
2297
|
+
"max-forwards",
|
|
2298
|
+
"proxy-authorization",
|
|
2299
|
+
"referer",
|
|
2300
|
+
"retry-after",
|
|
2301
|
+
"user-agent"
|
|
2302
|
+
];
|
|
2303
|
+
var parseHeaders$1 = function parseHeaders(headers) {
|
|
2304
|
+
var parsed = {};
|
|
2305
|
+
var key;
|
|
2306
|
+
var val;
|
|
2307
|
+
var i;
|
|
2308
|
+
if (!headers) {
|
|
2309
|
+
return parsed;
|
|
2420
2310
|
}
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2311
|
+
utils$8.forEach(headers.split("\n"), function parser(line) {
|
|
2312
|
+
i = line.indexOf(":");
|
|
2313
|
+
key = utils$8.trim(line.substr(0, i)).toLowerCase();
|
|
2314
|
+
val = utils$8.trim(line.substr(i + 1));
|
|
2315
|
+
if (key) {
|
|
2316
|
+
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
2317
|
+
return;
|
|
2318
|
+
}
|
|
2319
|
+
if (key === "set-cookie") {
|
|
2320
|
+
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
2321
|
+
} else {
|
|
2322
|
+
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
2323
|
+
}
|
|
2427
2324
|
}
|
|
2428
|
-
assignValue(result, key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
|
|
2429
2325
|
});
|
|
2430
|
-
return
|
|
2431
|
-
}
|
|
2432
|
-
var
|
|
2433
|
-
var
|
|
2434
|
-
var
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
var
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
if (product.filter && product.items) {
|
|
2443
|
-
const filteredConfig = Object.values(product.filter).flat().filter((item) => {
|
|
2444
|
-
var _a, _b, _c, _d;
|
|
2445
|
-
return state.filter[(_b = (_a = product.items) == null ? void 0 : _a[0]) == null ? void 0 : _b.fltCtx] && Object.values(state.filter[(_d = (_c = product.items) == null ? void 0 : _c[0]) == null ? void 0 : _d.fltCtx]).includes(item);
|
|
2446
|
-
});
|
|
2447
|
-
if (Array.isArray(filteredConfig) && filteredConfig.length === 0) {
|
|
2448
|
-
return false;
|
|
2326
|
+
return parsed;
|
|
2327
|
+
};
|
|
2328
|
+
var utils$7 = utils$d;
|
|
2329
|
+
var isURLSameOrigin$1 = utils$7.isStandardBrowserEnv() ? function standardBrowserEnv2() {
|
|
2330
|
+
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
2331
|
+
var urlParsingNode = document.createElement("a");
|
|
2332
|
+
var originURL;
|
|
2333
|
+
function resolveURL(url) {
|
|
2334
|
+
var href = url;
|
|
2335
|
+
if (msie) {
|
|
2336
|
+
urlParsingNode.setAttribute("href", href);
|
|
2337
|
+
href = urlParsingNode.href;
|
|
2449
2338
|
}
|
|
2339
|
+
urlParsingNode.setAttribute("href", href);
|
|
2340
|
+
return {
|
|
2341
|
+
href: urlParsingNode.href,
|
|
2342
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
2343
|
+
host: urlParsingNode.host,
|
|
2344
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
2345
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
2346
|
+
hostname: urlParsingNode.hostname,
|
|
2347
|
+
port: urlParsingNode.port,
|
|
2348
|
+
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
2349
|
+
};
|
|
2450
2350
|
}
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2351
|
+
originURL = resolveURL(window.location.href);
|
|
2352
|
+
return function isURLSameOrigin2(requestURL) {
|
|
2353
|
+
var parsed = utils$7.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
2354
|
+
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
2355
|
+
};
|
|
2356
|
+
}() : function nonStandardBrowserEnv2() {
|
|
2357
|
+
return function isURLSameOrigin2() {
|
|
2358
|
+
return true;
|
|
2359
|
+
};
|
|
2360
|
+
}();
|
|
2361
|
+
var utils$6 = utils$d;
|
|
2362
|
+
var settle2 = settle$1;
|
|
2363
|
+
var cookies = cookies$1;
|
|
2364
|
+
var buildURL$1 = buildURL$2;
|
|
2365
|
+
var buildFullPath2 = buildFullPath$1;
|
|
2366
|
+
var parseHeaders2 = parseHeaders$1;
|
|
2367
|
+
var isURLSameOrigin = isURLSameOrigin$1;
|
|
2368
|
+
var createError2 = createError$2;
|
|
2369
|
+
var xhr = function xhrAdapter(config) {
|
|
2370
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
2371
|
+
var requestData = config.data;
|
|
2372
|
+
var requestHeaders = config.headers;
|
|
2373
|
+
var responseType = config.responseType;
|
|
2374
|
+
if (utils$6.isFormData(requestData)) {
|
|
2375
|
+
delete requestHeaders["Content-Type"];
|
|
2376
|
+
}
|
|
2377
|
+
var request2 = new XMLHttpRequest();
|
|
2378
|
+
if (config.auth) {
|
|
2379
|
+
var username = config.auth.username || "";
|
|
2380
|
+
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
2381
|
+
requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
|
|
2382
|
+
}
|
|
2383
|
+
var fullPath = buildFullPath2(config.baseURL, config.url);
|
|
2384
|
+
request2.open(config.method.toUpperCase(), buildURL$1(fullPath, config.params, config.paramsSerializer), true);
|
|
2385
|
+
request2.timeout = config.timeout;
|
|
2386
|
+
function onloadend() {
|
|
2387
|
+
if (!request2) {
|
|
2388
|
+
return;
|
|
2389
|
+
}
|
|
2390
|
+
var responseHeaders = "getAllResponseHeaders" in request2 ? parseHeaders2(request2.getAllResponseHeaders()) : null;
|
|
2391
|
+
var responseData = !responseType || responseType === "text" || responseType === "json" ? request2.responseText : request2.response;
|
|
2392
|
+
var response = {
|
|
2393
|
+
data: responseData,
|
|
2394
|
+
status: request2.status,
|
|
2395
|
+
statusText: request2.statusText,
|
|
2396
|
+
headers: responseHeaders,
|
|
2397
|
+
config,
|
|
2398
|
+
request: request2
|
|
2399
|
+
};
|
|
2400
|
+
settle2(resolve, reject, response);
|
|
2401
|
+
request2 = null;
|
|
2402
|
+
}
|
|
2403
|
+
if ("onloadend" in request2) {
|
|
2404
|
+
request2.onloadend = onloadend;
|
|
2405
|
+
} else {
|
|
2406
|
+
request2.onreadystatechange = function handleLoad() {
|
|
2407
|
+
if (!request2 || request2.readyState !== 4) {
|
|
2408
|
+
return;
|
|
2409
|
+
}
|
|
2410
|
+
if (request2.status === 0 && !(request2.responseURL && request2.responseURL.indexOf("file:") === 0)) {
|
|
2411
|
+
return;
|
|
2412
|
+
}
|
|
2413
|
+
setTimeout(onloadend);
|
|
2414
|
+
};
|
|
2415
|
+
}
|
|
2416
|
+
request2.onabort = function handleAbort() {
|
|
2417
|
+
if (!request2) {
|
|
2418
|
+
return;
|
|
2419
|
+
}
|
|
2420
|
+
reject(createError2("Request aborted", config, "ECONNABORTED", request2));
|
|
2421
|
+
request2 = null;
|
|
2422
|
+
};
|
|
2423
|
+
request2.onerror = function handleError() {
|
|
2424
|
+
reject(createError2("Network Error", config, null, request2));
|
|
2425
|
+
request2 = null;
|
|
2426
|
+
};
|
|
2427
|
+
request2.ontimeout = function handleTimeout() {
|
|
2428
|
+
var timeoutErrorMessage = "timeout of " + config.timeout + "ms exceeded";
|
|
2429
|
+
if (config.timeoutErrorMessage) {
|
|
2430
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
2431
|
+
}
|
|
2432
|
+
reject(createError2(timeoutErrorMessage, config, config.transitional && config.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", request2));
|
|
2433
|
+
request2 = null;
|
|
2434
|
+
};
|
|
2435
|
+
if (utils$6.isStandardBrowserEnv()) {
|
|
2436
|
+
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : void 0;
|
|
2437
|
+
if (xsrfValue) {
|
|
2438
|
+
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
if ("setRequestHeader" in request2) {
|
|
2442
|
+
utils$6.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
2443
|
+
if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
|
|
2444
|
+
delete requestHeaders[key];
|
|
2465
2445
|
} else {
|
|
2466
|
-
|
|
2467
|
-
const { selCtx, id } = item;
|
|
2468
|
-
if (selCtx in selected && id in selected[selCtx]) {
|
|
2469
|
-
itemPrice = calculateProductPrice(item, state, level + 1) * selected[selCtx][id];
|
|
2470
|
-
delete state.selected[selCtx][id];
|
|
2471
|
-
}
|
|
2446
|
+
request2.setRequestHeader(key, val);
|
|
2472
2447
|
}
|
|
2473
|
-
price += itemPrice;
|
|
2474
2448
|
});
|
|
2475
2449
|
}
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
};
|
|
2479
|
-
const useDisplayPrice = ({
|
|
2480
|
-
product,
|
|
2481
|
-
state,
|
|
2482
|
-
selected,
|
|
2483
|
-
cheapestGroupOptionsProduct
|
|
2484
|
-
}) => {
|
|
2485
|
-
var _a;
|
|
2486
|
-
const calculatedPrice = state ? calculateProductPrice(product, state) : 0;
|
|
2487
|
-
const calculatedPriceDefaultProductState = product.state && !isEmpty_1((_a = product == null ? void 0 : product.state) == null ? void 0 : _a.selected) ? calculateProductPrice(product, product.state) : 0;
|
|
2488
|
-
const showAsMinPrice = product.minPrice && parseFloat(product.price) === calculatedPrice;
|
|
2489
|
-
let displayPrice = selected || !!cheapestGroupOptionsProduct || parseFloat(product.price) === 0 ? calculatedPrice || calculatedPriceDefaultProductState : parseFloat(product.price);
|
|
2490
|
-
if (cheapestGroupOptionsProduct !== void 0) {
|
|
2491
|
-
displayPrice -= cheapestGroupOptionsProduct;
|
|
2492
|
-
}
|
|
2493
|
-
if (showAsMinPrice && product.minPrice)
|
|
2494
|
-
displayPrice = parseFloat(product.minPrice);
|
|
2495
|
-
return { displayPrice, showAsMinPrice, calculatedPriceDefaultProductState };
|
|
2496
|
-
};
|
|
2497
|
-
function groupOrderLines(array) {
|
|
2498
|
-
const result = [];
|
|
2499
|
-
array.reduce((res, value) => {
|
|
2500
|
-
if (!res[value.hash]) {
|
|
2501
|
-
res[value.hash] = {
|
|
2502
|
-
...value,
|
|
2503
|
-
quantity: 0,
|
|
2504
|
-
discounted: 0,
|
|
2505
|
-
discounts: [],
|
|
2506
|
-
firstProductQuantity: value.quantity,
|
|
2507
|
-
itemsToRemove: []
|
|
2508
|
-
};
|
|
2509
|
-
result.push(res[value.hash]);
|
|
2450
|
+
if (!utils$6.isUndefined(config.withCredentials)) {
|
|
2451
|
+
request2.withCredentials = !!config.withCredentials;
|
|
2510
2452
|
}
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2453
|
+
if (responseType && responseType !== "json") {
|
|
2454
|
+
request2.responseType = config.responseType;
|
|
2455
|
+
}
|
|
2456
|
+
if (typeof config.onDownloadProgress === "function") {
|
|
2457
|
+
request2.addEventListener("progress", config.onDownloadProgress);
|
|
2458
|
+
}
|
|
2459
|
+
if (typeof config.onUploadProgress === "function" && request2.upload) {
|
|
2460
|
+
request2.upload.addEventListener("progress", config.onUploadProgress);
|
|
2461
|
+
}
|
|
2462
|
+
if (config.cancelToken) {
|
|
2463
|
+
config.cancelToken.promise.then(function onCanceled(cancel) {
|
|
2464
|
+
if (!request2) {
|
|
2465
|
+
return;
|
|
2522
2466
|
}
|
|
2523
|
-
|
|
2467
|
+
request2.abort();
|
|
2468
|
+
reject(cancel);
|
|
2469
|
+
request2 = null;
|
|
2470
|
+
});
|
|
2524
2471
|
}
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
return result;
|
|
2528
|
-
}
|
|
2529
|
-
function useGroupOrderLines(array) {
|
|
2530
|
-
return groupOrderLines(array);
|
|
2531
|
-
}
|
|
2532
|
-
function getGroupedBucketLines(buckets) {
|
|
2533
|
-
if (!buckets || buckets.length === 0) {
|
|
2534
|
-
return null;
|
|
2535
|
-
}
|
|
2536
|
-
return groupOrderLines(buckets.flatMap((bucket) => bucket.lines));
|
|
2537
|
-
}
|
|
2538
|
-
var axios$2 = { exports: {} };
|
|
2539
|
-
var bind$2 = function bind(fn, thisArg) {
|
|
2540
|
-
return function wrap() {
|
|
2541
|
-
var args = new Array(arguments.length);
|
|
2542
|
-
for (var i = 0; i < args.length; i++) {
|
|
2543
|
-
args[i] = arguments[i];
|
|
2472
|
+
if (!requestData) {
|
|
2473
|
+
requestData = null;
|
|
2544
2474
|
}
|
|
2545
|
-
|
|
2546
|
-
};
|
|
2475
|
+
request2.send(requestData);
|
|
2476
|
+
});
|
|
2547
2477
|
};
|
|
2548
|
-
var
|
|
2549
|
-
var
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
|
|
2558
|
-
}
|
|
2559
|
-
function isArrayBuffer(val) {
|
|
2560
|
-
return toString.call(val) === "[object ArrayBuffer]";
|
|
2561
|
-
}
|
|
2562
|
-
function isFormData(val) {
|
|
2563
|
-
return typeof FormData !== "undefined" && val instanceof FormData;
|
|
2564
|
-
}
|
|
2565
|
-
function isArrayBufferView(val) {
|
|
2566
|
-
var result;
|
|
2567
|
-
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
2568
|
-
result = ArrayBuffer.isView(val);
|
|
2569
|
-
} else {
|
|
2570
|
-
result = val && val.buffer && val.buffer instanceof ArrayBuffer;
|
|
2478
|
+
var utils$5 = utils$d;
|
|
2479
|
+
var normalizeHeaderName2 = normalizeHeaderName$1;
|
|
2480
|
+
var enhanceError2 = enhanceError$2;
|
|
2481
|
+
var DEFAULT_CONTENT_TYPE = {
|
|
2482
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
2483
|
+
};
|
|
2484
|
+
function setContentTypeIfUnset(headers, value) {
|
|
2485
|
+
if (!utils$5.isUndefined(headers) && utils$5.isUndefined(headers["Content-Type"])) {
|
|
2486
|
+
headers["Content-Type"] = value;
|
|
2571
2487
|
}
|
|
2572
|
-
return result;
|
|
2573
|
-
}
|
|
2574
|
-
function isString(val) {
|
|
2575
|
-
return typeof val === "string";
|
|
2576
|
-
}
|
|
2577
|
-
function isNumber(val) {
|
|
2578
|
-
return typeof val === "number";
|
|
2579
2488
|
}
|
|
2580
|
-
function
|
|
2581
|
-
|
|
2489
|
+
function getDefaultAdapter() {
|
|
2490
|
+
var adapter;
|
|
2491
|
+
if (typeof XMLHttpRequest !== "undefined") {
|
|
2492
|
+
adapter = xhr;
|
|
2493
|
+
} else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") {
|
|
2494
|
+
adapter = xhr;
|
|
2495
|
+
}
|
|
2496
|
+
return adapter;
|
|
2582
2497
|
}
|
|
2583
|
-
function
|
|
2584
|
-
if (
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
return toString.call(val) === "[object Date]";
|
|
2592
|
-
}
|
|
2593
|
-
function isFile(val) {
|
|
2594
|
-
return toString.call(val) === "[object File]";
|
|
2595
|
-
}
|
|
2596
|
-
function isBlob(val) {
|
|
2597
|
-
return toString.call(val) === "[object Blob]";
|
|
2598
|
-
}
|
|
2599
|
-
function isFunction(val) {
|
|
2600
|
-
return toString.call(val) === "[object Function]";
|
|
2601
|
-
}
|
|
2602
|
-
function isStream(val) {
|
|
2603
|
-
return isObject(val) && isFunction(val.pipe);
|
|
2604
|
-
}
|
|
2605
|
-
function isURLSearchParams(val) {
|
|
2606
|
-
return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
|
|
2607
|
-
}
|
|
2608
|
-
function trim(str) {
|
|
2609
|
-
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
|
|
2610
|
-
}
|
|
2611
|
-
function isStandardBrowserEnv() {
|
|
2612
|
-
if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
|
|
2613
|
-
return false;
|
|
2614
|
-
}
|
|
2615
|
-
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
2616
|
-
}
|
|
2617
|
-
function forEach(obj, fn) {
|
|
2618
|
-
if (obj === null || typeof obj === "undefined") {
|
|
2619
|
-
return;
|
|
2620
|
-
}
|
|
2621
|
-
if (typeof obj !== "object") {
|
|
2622
|
-
obj = [obj];
|
|
2623
|
-
}
|
|
2624
|
-
if (isArray(obj)) {
|
|
2625
|
-
for (var i = 0, l = obj.length; i < l; i++) {
|
|
2626
|
-
fn.call(null, obj[i], i, obj);
|
|
2627
|
-
}
|
|
2628
|
-
} else {
|
|
2629
|
-
for (var key in obj) {
|
|
2630
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2631
|
-
fn.call(null, obj[key], key, obj);
|
|
2498
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
2499
|
+
if (utils$5.isString(rawValue)) {
|
|
2500
|
+
try {
|
|
2501
|
+
(parser || JSON.parse)(rawValue);
|
|
2502
|
+
return utils$5.trim(rawValue);
|
|
2503
|
+
} catch (e) {
|
|
2504
|
+
if (e.name !== "SyntaxError") {
|
|
2505
|
+
throw e;
|
|
2632
2506
|
}
|
|
2633
2507
|
}
|
|
2634
2508
|
}
|
|
2509
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
2635
2510
|
}
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2511
|
+
var defaults$3 = {
|
|
2512
|
+
transitional: {
|
|
2513
|
+
silentJSONParsing: true,
|
|
2514
|
+
forcedJSONParsing: true,
|
|
2515
|
+
clarifyTimeoutError: false
|
|
2516
|
+
},
|
|
2517
|
+
adapter: getDefaultAdapter(),
|
|
2518
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
2519
|
+
normalizeHeaderName2(headers, "Accept");
|
|
2520
|
+
normalizeHeaderName2(headers, "Content-Type");
|
|
2521
|
+
if (utils$5.isFormData(data) || utils$5.isArrayBuffer(data) || utils$5.isBuffer(data) || utils$5.isStream(data) || utils$5.isFile(data) || utils$5.isBlob(data)) {
|
|
2522
|
+
return data;
|
|
2647
2523
|
}
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
forEach(arguments[i], assignValue2);
|
|
2651
|
-
}
|
|
2652
|
-
return result;
|
|
2653
|
-
}
|
|
2654
|
-
function extend(a, b, thisArg) {
|
|
2655
|
-
forEach(b, function assignValue2(val, key) {
|
|
2656
|
-
if (thisArg && typeof val === "function") {
|
|
2657
|
-
a[key] = bind$1(val, thisArg);
|
|
2658
|
-
} else {
|
|
2659
|
-
a[key] = val;
|
|
2524
|
+
if (utils$5.isArrayBufferView(data)) {
|
|
2525
|
+
return data.buffer;
|
|
2660
2526
|
}
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
isStream,
|
|
2686
|
-
isURLSearchParams,
|
|
2687
|
-
isStandardBrowserEnv,
|
|
2688
|
-
forEach,
|
|
2689
|
-
merge,
|
|
2690
|
-
extend,
|
|
2691
|
-
trim,
|
|
2692
|
-
stripBOM
|
|
2693
|
-
};
|
|
2694
|
-
var utils$c = utils$d;
|
|
2695
|
-
function encode(val) {
|
|
2696
|
-
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
2697
|
-
}
|
|
2698
|
-
var buildURL$2 = function buildURL(url, params, paramsSerializer) {
|
|
2699
|
-
if (!params) {
|
|
2700
|
-
return url;
|
|
2701
|
-
}
|
|
2702
|
-
var serializedParams;
|
|
2703
|
-
if (paramsSerializer) {
|
|
2704
|
-
serializedParams = paramsSerializer(params);
|
|
2705
|
-
} else if (utils$c.isURLSearchParams(params)) {
|
|
2706
|
-
serializedParams = params.toString();
|
|
2707
|
-
} else {
|
|
2708
|
-
var parts = [];
|
|
2709
|
-
utils$c.forEach(params, function serialize(val, key) {
|
|
2710
|
-
if (val === null || typeof val === "undefined") {
|
|
2711
|
-
return;
|
|
2712
|
-
}
|
|
2713
|
-
if (utils$c.isArray(val)) {
|
|
2714
|
-
key = key + "[]";
|
|
2715
|
-
} else {
|
|
2716
|
-
val = [val];
|
|
2717
|
-
}
|
|
2718
|
-
utils$c.forEach(val, function parseValue(v) {
|
|
2719
|
-
if (utils$c.isDate(v)) {
|
|
2720
|
-
v = v.toISOString();
|
|
2721
|
-
} else if (utils$c.isObject(v)) {
|
|
2722
|
-
v = JSON.stringify(v);
|
|
2527
|
+
if (utils$5.isURLSearchParams(data)) {
|
|
2528
|
+
setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
|
|
2529
|
+
return data.toString();
|
|
2530
|
+
}
|
|
2531
|
+
if (utils$5.isObject(data) || headers && headers["Content-Type"] === "application/json") {
|
|
2532
|
+
setContentTypeIfUnset(headers, "application/json");
|
|
2533
|
+
return stringifySafely(data);
|
|
2534
|
+
}
|
|
2535
|
+
return data;
|
|
2536
|
+
}],
|
|
2537
|
+
transformResponse: [function transformResponse(data) {
|
|
2538
|
+
var transitional2 = this.transitional;
|
|
2539
|
+
var silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
2540
|
+
var forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
2541
|
+
var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
|
|
2542
|
+
if (strictJSONParsing || forcedJSONParsing && utils$5.isString(data) && data.length) {
|
|
2543
|
+
try {
|
|
2544
|
+
return JSON.parse(data);
|
|
2545
|
+
} catch (e) {
|
|
2546
|
+
if (strictJSONParsing) {
|
|
2547
|
+
if (e.name === "SyntaxError") {
|
|
2548
|
+
throw enhanceError2(e, this, "E_JSON_PARSE");
|
|
2549
|
+
}
|
|
2550
|
+
throw e;
|
|
2723
2551
|
}
|
|
2724
|
-
|
|
2725
|
-
});
|
|
2726
|
-
});
|
|
2727
|
-
serializedParams = parts.join("&");
|
|
2728
|
-
}
|
|
2729
|
-
if (serializedParams) {
|
|
2730
|
-
var hashmarkIndex = url.indexOf("#");
|
|
2731
|
-
if (hashmarkIndex !== -1) {
|
|
2732
|
-
url = url.slice(0, hashmarkIndex);
|
|
2552
|
+
}
|
|
2733
2553
|
}
|
|
2734
|
-
|
|
2554
|
+
return data;
|
|
2555
|
+
}],
|
|
2556
|
+
timeout: 0,
|
|
2557
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
2558
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
2559
|
+
maxContentLength: -1,
|
|
2560
|
+
maxBodyLength: -1,
|
|
2561
|
+
validateStatus: function validateStatus(status) {
|
|
2562
|
+
return status >= 200 && status < 300;
|
|
2735
2563
|
}
|
|
2736
|
-
return url;
|
|
2737
|
-
};
|
|
2738
|
-
var utils$b = utils$d;
|
|
2739
|
-
function InterceptorManager$1() {
|
|
2740
|
-
this.handlers = [];
|
|
2741
|
-
}
|
|
2742
|
-
InterceptorManager$1.prototype.use = function use(fulfilled, rejected, options) {
|
|
2743
|
-
this.handlers.push({
|
|
2744
|
-
fulfilled,
|
|
2745
|
-
rejected,
|
|
2746
|
-
synchronous: options ? options.synchronous : false,
|
|
2747
|
-
runWhen: options ? options.runWhen : null
|
|
2748
|
-
});
|
|
2749
|
-
return this.handlers.length - 1;
|
|
2750
2564
|
};
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2565
|
+
defaults$3.headers = {
|
|
2566
|
+
common: {
|
|
2567
|
+
"Accept": "application/json, text/plain, */*"
|
|
2754
2568
|
}
|
|
2755
2569
|
};
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2570
|
+
utils$5.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
|
|
2571
|
+
defaults$3.headers[method] = {};
|
|
2572
|
+
});
|
|
2573
|
+
utils$5.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
2574
|
+
defaults$3.headers[method] = utils$5.merge(DEFAULT_CONTENT_TYPE);
|
|
2575
|
+
});
|
|
2576
|
+
var defaults_1 = defaults$3;
|
|
2577
|
+
var utils$4 = utils$d;
|
|
2578
|
+
var defaults$2 = defaults_1;
|
|
2579
|
+
var transformData$1 = function transformData(data, headers, fns) {
|
|
2580
|
+
var context = this || defaults$2;
|
|
2581
|
+
utils$4.forEach(fns, function transform(fn) {
|
|
2582
|
+
data = fn.call(context, data, headers);
|
|
2761
2583
|
});
|
|
2584
|
+
return data;
|
|
2762
2585
|
};
|
|
2763
|
-
var
|
|
2764
|
-
|
|
2765
|
-
var normalizeHeaderName$1 = function normalizeHeaderName(headers, normalizedName) {
|
|
2766
|
-
utils$a.forEach(headers, function processHeader(value, name2) {
|
|
2767
|
-
if (name2 !== normalizedName && name2.toUpperCase() === normalizedName.toUpperCase()) {
|
|
2768
|
-
headers[normalizedName] = value;
|
|
2769
|
-
delete headers[name2];
|
|
2770
|
-
}
|
|
2771
|
-
});
|
|
2586
|
+
var isCancel$1 = function isCancel(value) {
|
|
2587
|
+
return !!(value && value.__CANCEL__);
|
|
2772
2588
|
};
|
|
2773
|
-
var
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
error.isAxiosError = true;
|
|
2781
|
-
error.toJSON = function toJSON() {
|
|
2782
|
-
return {
|
|
2783
|
-
message: this.message,
|
|
2784
|
-
name: this.name,
|
|
2785
|
-
description: this.description,
|
|
2786
|
-
number: this.number,
|
|
2787
|
-
fileName: this.fileName,
|
|
2788
|
-
lineNumber: this.lineNumber,
|
|
2789
|
-
columnNumber: this.columnNumber,
|
|
2790
|
-
stack: this.stack,
|
|
2791
|
-
config: this.config,
|
|
2792
|
-
code: this.code
|
|
2793
|
-
};
|
|
2794
|
-
};
|
|
2795
|
-
return error;
|
|
2796
|
-
};
|
|
2797
|
-
var enhanceError$1 = enhanceError$2;
|
|
2798
|
-
var createError$2 = function createError(message, config, code, request2, response) {
|
|
2799
|
-
var error = new Error(message);
|
|
2800
|
-
return enhanceError$1(error, config, code, request2, response);
|
|
2801
|
-
};
|
|
2802
|
-
var createError$1 = createError$2;
|
|
2803
|
-
var settle$1 = function settle(resolve, reject, response) {
|
|
2804
|
-
var validateStatus2 = response.config.validateStatus;
|
|
2805
|
-
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
2806
|
-
resolve(response);
|
|
2807
|
-
} else {
|
|
2808
|
-
reject(createError$1("Request failed with status code " + response.status, response.config, null, response.request, response));
|
|
2809
|
-
}
|
|
2810
|
-
};
|
|
2811
|
-
var utils$9 = utils$d;
|
|
2812
|
-
var cookies$1 = utils$9.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
2813
|
-
return {
|
|
2814
|
-
write: function write(name2, value, expires, path, domain, secure) {
|
|
2815
|
-
var cookie = [];
|
|
2816
|
-
cookie.push(name2 + "=" + encodeURIComponent(value));
|
|
2817
|
-
if (utils$9.isNumber(expires)) {
|
|
2818
|
-
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
2819
|
-
}
|
|
2820
|
-
if (utils$9.isString(path)) {
|
|
2821
|
-
cookie.push("path=" + path);
|
|
2822
|
-
}
|
|
2823
|
-
if (utils$9.isString(domain)) {
|
|
2824
|
-
cookie.push("domain=" + domain);
|
|
2825
|
-
}
|
|
2826
|
-
if (secure === true) {
|
|
2827
|
-
cookie.push("secure");
|
|
2828
|
-
}
|
|
2829
|
-
document.cookie = cookie.join("; ");
|
|
2830
|
-
},
|
|
2831
|
-
read: function read(name2) {
|
|
2832
|
-
var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name2 + ")=([^;]*)"));
|
|
2833
|
-
return match ? decodeURIComponent(match[3]) : null;
|
|
2834
|
-
},
|
|
2835
|
-
remove: function remove(name2) {
|
|
2836
|
-
this.write(name2, "", Date.now() - 864e5);
|
|
2837
|
-
}
|
|
2838
|
-
};
|
|
2839
|
-
}() : function nonStandardBrowserEnv() {
|
|
2840
|
-
return {
|
|
2841
|
-
write: function write() {
|
|
2842
|
-
},
|
|
2843
|
-
read: function read() {
|
|
2844
|
-
return null;
|
|
2845
|
-
},
|
|
2846
|
-
remove: function remove() {
|
|
2847
|
-
}
|
|
2848
|
-
};
|
|
2849
|
-
}();
|
|
2850
|
-
var isAbsoluteURL$1 = function isAbsoluteURL(url) {
|
|
2851
|
-
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
2852
|
-
};
|
|
2853
|
-
var combineURLs$1 = function combineURLs(baseURL, relativeURL) {
|
|
2854
|
-
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
2855
|
-
};
|
|
2856
|
-
var isAbsoluteURL2 = isAbsoluteURL$1;
|
|
2857
|
-
var combineURLs2 = combineURLs$1;
|
|
2858
|
-
var buildFullPath$1 = function buildFullPath(baseURL, requestedURL) {
|
|
2859
|
-
if (baseURL && !isAbsoluteURL2(requestedURL)) {
|
|
2860
|
-
return combineURLs2(baseURL, requestedURL);
|
|
2861
|
-
}
|
|
2862
|
-
return requestedURL;
|
|
2863
|
-
};
|
|
2864
|
-
var utils$8 = utils$d;
|
|
2865
|
-
var ignoreDuplicateOf = [
|
|
2866
|
-
"age",
|
|
2867
|
-
"authorization",
|
|
2868
|
-
"content-length",
|
|
2869
|
-
"content-type",
|
|
2870
|
-
"etag",
|
|
2871
|
-
"expires",
|
|
2872
|
-
"from",
|
|
2873
|
-
"host",
|
|
2874
|
-
"if-modified-since",
|
|
2875
|
-
"if-unmodified-since",
|
|
2876
|
-
"last-modified",
|
|
2877
|
-
"location",
|
|
2878
|
-
"max-forwards",
|
|
2879
|
-
"proxy-authorization",
|
|
2880
|
-
"referer",
|
|
2881
|
-
"retry-after",
|
|
2882
|
-
"user-agent"
|
|
2883
|
-
];
|
|
2884
|
-
var parseHeaders$1 = function parseHeaders(headers) {
|
|
2885
|
-
var parsed = {};
|
|
2886
|
-
var key;
|
|
2887
|
-
var val;
|
|
2888
|
-
var i;
|
|
2889
|
-
if (!headers) {
|
|
2890
|
-
return parsed;
|
|
2589
|
+
var utils$3 = utils$d;
|
|
2590
|
+
var transformData2 = transformData$1;
|
|
2591
|
+
var isCancel2 = isCancel$1;
|
|
2592
|
+
var defaults$1 = defaults_1;
|
|
2593
|
+
function throwIfCancellationRequested(config) {
|
|
2594
|
+
if (config.cancelToken) {
|
|
2595
|
+
config.cancelToken.throwIfRequested();
|
|
2891
2596
|
}
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2597
|
+
}
|
|
2598
|
+
var dispatchRequest$1 = function dispatchRequest(config) {
|
|
2599
|
+
throwIfCancellationRequested(config);
|
|
2600
|
+
config.headers = config.headers || {};
|
|
2601
|
+
config.data = transformData2.call(config, config.data, config.headers, config.transformRequest);
|
|
2602
|
+
config.headers = utils$3.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);
|
|
2603
|
+
utils$3.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function cleanHeaderConfig(method) {
|
|
2604
|
+
delete config.headers[method];
|
|
2605
|
+
});
|
|
2606
|
+
var adapter = config.adapter || defaults$1.adapter;
|
|
2607
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
2608
|
+
throwIfCancellationRequested(config);
|
|
2609
|
+
response.data = transformData2.call(config, response.data, response.headers, config.transformResponse);
|
|
2610
|
+
return response;
|
|
2611
|
+
}, function onAdapterRejection(reason) {
|
|
2612
|
+
if (!isCancel2(reason)) {
|
|
2613
|
+
throwIfCancellationRequested(config);
|
|
2614
|
+
if (reason && reason.response) {
|
|
2615
|
+
reason.response.data = transformData2.call(config, reason.response.data, reason.response.headers, config.transformResponse);
|
|
2904
2616
|
}
|
|
2905
2617
|
}
|
|
2618
|
+
return Promise.reject(reason);
|
|
2906
2619
|
});
|
|
2907
|
-
return parsed;
|
|
2908
2620
|
};
|
|
2909
|
-
var utils$
|
|
2910
|
-
var
|
|
2911
|
-
|
|
2912
|
-
var
|
|
2913
|
-
var
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2621
|
+
var utils$2 = utils$d;
|
|
2622
|
+
var mergeConfig$2 = function mergeConfig(config1, config2) {
|
|
2623
|
+
config2 = config2 || {};
|
|
2624
|
+
var config = {};
|
|
2625
|
+
var valueFromConfig2Keys = ["url", "method", "data"];
|
|
2626
|
+
var mergeDeepPropertiesKeys = ["headers", "auth", "proxy", "params"];
|
|
2627
|
+
var defaultToConfig2Keys = [
|
|
2628
|
+
"baseURL",
|
|
2629
|
+
"transformRequest",
|
|
2630
|
+
"transformResponse",
|
|
2631
|
+
"paramsSerializer",
|
|
2632
|
+
"timeout",
|
|
2633
|
+
"timeoutMessage",
|
|
2634
|
+
"withCredentials",
|
|
2635
|
+
"adapter",
|
|
2636
|
+
"responseType",
|
|
2637
|
+
"xsrfCookieName",
|
|
2638
|
+
"xsrfHeaderName",
|
|
2639
|
+
"onUploadProgress",
|
|
2640
|
+
"onDownloadProgress",
|
|
2641
|
+
"decompress",
|
|
2642
|
+
"maxContentLength",
|
|
2643
|
+
"maxBodyLength",
|
|
2644
|
+
"maxRedirects",
|
|
2645
|
+
"transport",
|
|
2646
|
+
"httpAgent",
|
|
2647
|
+
"httpsAgent",
|
|
2648
|
+
"cancelToken",
|
|
2649
|
+
"socketPath",
|
|
2650
|
+
"responseEncoding"
|
|
2651
|
+
];
|
|
2652
|
+
var directMergeKeys = ["validateStatus"];
|
|
2653
|
+
function getMergedValue(target, source2) {
|
|
2654
|
+
if (utils$2.isPlainObject(target) && utils$2.isPlainObject(source2)) {
|
|
2655
|
+
return utils$2.merge(target, source2);
|
|
2656
|
+
} else if (utils$2.isPlainObject(source2)) {
|
|
2657
|
+
return utils$2.merge({}, source2);
|
|
2658
|
+
} else if (utils$2.isArray(source2)) {
|
|
2659
|
+
return source2.slice();
|
|
2919
2660
|
}
|
|
2920
|
-
|
|
2921
|
-
return {
|
|
2922
|
-
href: urlParsingNode.href,
|
|
2923
|
-
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
2924
|
-
host: urlParsingNode.host,
|
|
2925
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
2926
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
2927
|
-
hostname: urlParsingNode.hostname,
|
|
2928
|
-
port: urlParsingNode.port,
|
|
2929
|
-
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
2930
|
-
};
|
|
2661
|
+
return source2;
|
|
2931
2662
|
}
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
}() : function nonStandardBrowserEnv2() {
|
|
2938
|
-
return function isURLSameOrigin2() {
|
|
2939
|
-
return true;
|
|
2940
|
-
};
|
|
2941
|
-
}();
|
|
2942
|
-
var utils$6 = utils$d;
|
|
2943
|
-
var settle2 = settle$1;
|
|
2944
|
-
var cookies = cookies$1;
|
|
2945
|
-
var buildURL$1 = buildURL$2;
|
|
2946
|
-
var buildFullPath2 = buildFullPath$1;
|
|
2947
|
-
var parseHeaders2 = parseHeaders$1;
|
|
2948
|
-
var isURLSameOrigin = isURLSameOrigin$1;
|
|
2949
|
-
var createError2 = createError$2;
|
|
2950
|
-
var xhr = function xhrAdapter(config) {
|
|
2951
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
2952
|
-
var requestData = config.data;
|
|
2953
|
-
var requestHeaders = config.headers;
|
|
2954
|
-
var responseType = config.responseType;
|
|
2955
|
-
if (utils$6.isFormData(requestData)) {
|
|
2956
|
-
delete requestHeaders["Content-Type"];
|
|
2663
|
+
function mergeDeepProperties(prop) {
|
|
2664
|
+
if (!utils$2.isUndefined(config2[prop])) {
|
|
2665
|
+
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
|
2666
|
+
} else if (!utils$2.isUndefined(config1[prop])) {
|
|
2667
|
+
config[prop] = getMergedValue(void 0, config1[prop]);
|
|
2957
2668
|
}
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
|
|
2669
|
+
}
|
|
2670
|
+
utils$2.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
|
|
2671
|
+
if (!utils$2.isUndefined(config2[prop])) {
|
|
2672
|
+
config[prop] = getMergedValue(void 0, config2[prop]);
|
|
2963
2673
|
}
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
var responseHeaders = "getAllResponseHeaders" in request2 ? parseHeaders2(request2.getAllResponseHeaders()) : null;
|
|
2972
|
-
var responseData = !responseType || responseType === "text" || responseType === "json" ? request2.responseText : request2.response;
|
|
2973
|
-
var response = {
|
|
2974
|
-
data: responseData,
|
|
2975
|
-
status: request2.status,
|
|
2976
|
-
statusText: request2.statusText,
|
|
2977
|
-
headers: responseHeaders,
|
|
2978
|
-
config,
|
|
2979
|
-
request: request2
|
|
2980
|
-
};
|
|
2981
|
-
settle2(resolve, reject, response);
|
|
2982
|
-
request2 = null;
|
|
2983
|
-
}
|
|
2984
|
-
if ("onloadend" in request2) {
|
|
2985
|
-
request2.onloadend = onloadend;
|
|
2986
|
-
} else {
|
|
2987
|
-
request2.onreadystatechange = function handleLoad() {
|
|
2988
|
-
if (!request2 || request2.readyState !== 4) {
|
|
2989
|
-
return;
|
|
2990
|
-
}
|
|
2991
|
-
if (request2.status === 0 && !(request2.responseURL && request2.responseURL.indexOf("file:") === 0)) {
|
|
2992
|
-
return;
|
|
2993
|
-
}
|
|
2994
|
-
setTimeout(onloadend);
|
|
2995
|
-
};
|
|
2996
|
-
}
|
|
2997
|
-
request2.onabort = function handleAbort() {
|
|
2998
|
-
if (!request2) {
|
|
2999
|
-
return;
|
|
3000
|
-
}
|
|
3001
|
-
reject(createError2("Request aborted", config, "ECONNABORTED", request2));
|
|
3002
|
-
request2 = null;
|
|
3003
|
-
};
|
|
3004
|
-
request2.onerror = function handleError() {
|
|
3005
|
-
reject(createError2("Network Error", config, null, request2));
|
|
3006
|
-
request2 = null;
|
|
3007
|
-
};
|
|
3008
|
-
request2.ontimeout = function handleTimeout() {
|
|
3009
|
-
var timeoutErrorMessage = "timeout of " + config.timeout + "ms exceeded";
|
|
3010
|
-
if (config.timeoutErrorMessage) {
|
|
3011
|
-
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
3012
|
-
}
|
|
3013
|
-
reject(createError2(timeoutErrorMessage, config, config.transitional && config.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", request2));
|
|
3014
|
-
request2 = null;
|
|
3015
|
-
};
|
|
3016
|
-
if (utils$6.isStandardBrowserEnv()) {
|
|
3017
|
-
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : void 0;
|
|
3018
|
-
if (xsrfValue) {
|
|
3019
|
-
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
3020
|
-
}
|
|
3021
|
-
}
|
|
3022
|
-
if ("setRequestHeader" in request2) {
|
|
3023
|
-
utils$6.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
3024
|
-
if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
|
|
3025
|
-
delete requestHeaders[key];
|
|
3026
|
-
} else {
|
|
3027
|
-
request2.setRequestHeader(key, val);
|
|
3028
|
-
}
|
|
3029
|
-
});
|
|
3030
|
-
}
|
|
3031
|
-
if (!utils$6.isUndefined(config.withCredentials)) {
|
|
3032
|
-
request2.withCredentials = !!config.withCredentials;
|
|
3033
|
-
}
|
|
3034
|
-
if (responseType && responseType !== "json") {
|
|
3035
|
-
request2.responseType = config.responseType;
|
|
3036
|
-
}
|
|
3037
|
-
if (typeof config.onDownloadProgress === "function") {
|
|
3038
|
-
request2.addEventListener("progress", config.onDownloadProgress);
|
|
3039
|
-
}
|
|
3040
|
-
if (typeof config.onUploadProgress === "function" && request2.upload) {
|
|
3041
|
-
request2.upload.addEventListener("progress", config.onUploadProgress);
|
|
3042
|
-
}
|
|
3043
|
-
if (config.cancelToken) {
|
|
3044
|
-
config.cancelToken.promise.then(function onCanceled(cancel) {
|
|
3045
|
-
if (!request2) {
|
|
3046
|
-
return;
|
|
3047
|
-
}
|
|
3048
|
-
request2.abort();
|
|
3049
|
-
reject(cancel);
|
|
3050
|
-
request2 = null;
|
|
3051
|
-
});
|
|
2674
|
+
});
|
|
2675
|
+
utils$2.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
|
|
2676
|
+
utils$2.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
|
|
2677
|
+
if (!utils$2.isUndefined(config2[prop])) {
|
|
2678
|
+
config[prop] = getMergedValue(void 0, config2[prop]);
|
|
2679
|
+
} else if (!utils$2.isUndefined(config1[prop])) {
|
|
2680
|
+
config[prop] = getMergedValue(void 0, config1[prop]);
|
|
3052
2681
|
}
|
|
3053
|
-
|
|
3054
|
-
|
|
2682
|
+
});
|
|
2683
|
+
utils$2.forEach(directMergeKeys, function merge2(prop) {
|
|
2684
|
+
if (prop in config2) {
|
|
2685
|
+
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
|
2686
|
+
} else if (prop in config1) {
|
|
2687
|
+
config[prop] = getMergedValue(void 0, config1[prop]);
|
|
3055
2688
|
}
|
|
3056
|
-
request2.send(requestData);
|
|
3057
2689
|
});
|
|
2690
|
+
var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys).concat(directMergeKeys);
|
|
2691
|
+
var otherKeys = Object.keys(config1).concat(Object.keys(config2)).filter(function filterAxiosKeys(key) {
|
|
2692
|
+
return axiosKeys.indexOf(key) === -1;
|
|
2693
|
+
});
|
|
2694
|
+
utils$2.forEach(otherKeys, mergeDeepProperties);
|
|
2695
|
+
return config;
|
|
3058
2696
|
};
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
2697
|
+
const name = "axios";
|
|
2698
|
+
const version = "0.21.4";
|
|
2699
|
+
const description = "Promise based HTTP client for the browser and node.js";
|
|
2700
|
+
const main = "index.js";
|
|
2701
|
+
const scripts = {
|
|
2702
|
+
test: "grunt test",
|
|
2703
|
+
start: "node ./sandbox/server.js",
|
|
2704
|
+
build: "NODE_ENV=production grunt build",
|
|
2705
|
+
preversion: "npm test",
|
|
2706
|
+
version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",
|
|
2707
|
+
postversion: "git push && git push --tags",
|
|
2708
|
+
examples: "node ./examples/server.js",
|
|
2709
|
+
coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
|
2710
|
+
fix: "eslint --fix lib/**/*.js"
|
|
3064
2711
|
};
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
2712
|
+
const repository = {
|
|
2713
|
+
type: "git",
|
|
2714
|
+
url: "https://github.com/axios/axios.git"
|
|
2715
|
+
};
|
|
2716
|
+
const keywords = [
|
|
2717
|
+
"xhr",
|
|
2718
|
+
"http",
|
|
2719
|
+
"ajax",
|
|
2720
|
+
"promise",
|
|
2721
|
+
"node"
|
|
2722
|
+
];
|
|
2723
|
+
const author = "Matt Zabriskie";
|
|
2724
|
+
const license = "MIT";
|
|
2725
|
+
const bugs = {
|
|
2726
|
+
url: "https://github.com/axios/axios/issues"
|
|
2727
|
+
};
|
|
2728
|
+
const homepage = "https://axios-http.com";
|
|
2729
|
+
const devDependencies = {
|
|
2730
|
+
coveralls: "^3.0.0",
|
|
2731
|
+
"es6-promise": "^4.2.4",
|
|
2732
|
+
grunt: "^1.3.0",
|
|
2733
|
+
"grunt-banner": "^0.6.0",
|
|
2734
|
+
"grunt-cli": "^1.2.0",
|
|
2735
|
+
"grunt-contrib-clean": "^1.1.0",
|
|
2736
|
+
"grunt-contrib-watch": "^1.0.0",
|
|
2737
|
+
"grunt-eslint": "^23.0.0",
|
|
2738
|
+
"grunt-karma": "^4.0.0",
|
|
2739
|
+
"grunt-mocha-test": "^0.13.3",
|
|
2740
|
+
"grunt-ts": "^6.0.0-beta.19",
|
|
2741
|
+
"grunt-webpack": "^4.0.2",
|
|
2742
|
+
"istanbul-instrumenter-loader": "^1.0.0",
|
|
2743
|
+
"jasmine-core": "^2.4.1",
|
|
2744
|
+
karma: "^6.3.2",
|
|
2745
|
+
"karma-chrome-launcher": "^3.1.0",
|
|
2746
|
+
"karma-firefox-launcher": "^2.1.0",
|
|
2747
|
+
"karma-jasmine": "^1.1.1",
|
|
2748
|
+
"karma-jasmine-ajax": "^0.1.13",
|
|
2749
|
+
"karma-safari-launcher": "^1.0.0",
|
|
2750
|
+
"karma-sauce-launcher": "^4.3.6",
|
|
2751
|
+
"karma-sinon": "^1.0.5",
|
|
2752
|
+
"karma-sourcemap-loader": "^0.3.8",
|
|
2753
|
+
"karma-webpack": "^4.0.2",
|
|
2754
|
+
"load-grunt-tasks": "^3.5.2",
|
|
2755
|
+
minimist: "^1.2.0",
|
|
2756
|
+
mocha: "^8.2.1",
|
|
2757
|
+
sinon: "^4.5.0",
|
|
2758
|
+
"terser-webpack-plugin": "^4.2.3",
|
|
2759
|
+
typescript: "^4.0.5",
|
|
2760
|
+
"url-search-params": "^0.10.0",
|
|
2761
|
+
webpack: "^4.44.2",
|
|
2762
|
+
"webpack-dev-server": "^3.11.0"
|
|
2763
|
+
};
|
|
2764
|
+
const browser = {
|
|
2765
|
+
"./lib/adapters/http.js": "./lib/adapters/xhr.js"
|
|
2766
|
+
};
|
|
2767
|
+
const jsdelivr = "dist/axios.min.js";
|
|
2768
|
+
const unpkg = "dist/axios.min.js";
|
|
2769
|
+
const typings = "./index.d.ts";
|
|
2770
|
+
const dependencies = {
|
|
2771
|
+
"follow-redirects": "^1.14.0"
|
|
2772
|
+
};
|
|
2773
|
+
const bundlesize = [
|
|
2774
|
+
{
|
|
2775
|
+
path: "./dist/axios.min.js",
|
|
2776
|
+
threshold: "5kB"
|
|
3076
2777
|
}
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
2778
|
+
];
|
|
2779
|
+
var require$$0 = {
|
|
2780
|
+
name,
|
|
2781
|
+
version,
|
|
2782
|
+
description,
|
|
2783
|
+
main,
|
|
2784
|
+
scripts,
|
|
2785
|
+
repository,
|
|
2786
|
+
keywords,
|
|
2787
|
+
author,
|
|
2788
|
+
license,
|
|
2789
|
+
bugs,
|
|
2790
|
+
homepage,
|
|
2791
|
+
devDependencies,
|
|
2792
|
+
browser,
|
|
2793
|
+
jsdelivr,
|
|
2794
|
+
unpkg,
|
|
2795
|
+
typings,
|
|
2796
|
+
dependencies,
|
|
2797
|
+
bundlesize
|
|
2798
|
+
};
|
|
2799
|
+
var pkg = require$$0;
|
|
2800
|
+
var validators$1 = {};
|
|
2801
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
|
|
2802
|
+
validators$1[type] = function validator2(thing) {
|
|
2803
|
+
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
2804
|
+
};
|
|
2805
|
+
});
|
|
2806
|
+
var deprecatedWarnings = {};
|
|
2807
|
+
var currentVerArr = pkg.version.split(".");
|
|
2808
|
+
function isOlderVersion(version2, thanVersion) {
|
|
2809
|
+
var pkgVersionArr = thanVersion ? thanVersion.split(".") : currentVerArr;
|
|
2810
|
+
var destVer = version2.split(".");
|
|
2811
|
+
for (var i = 0; i < 3; i++) {
|
|
2812
|
+
if (pkgVersionArr[i] > destVer[i]) {
|
|
2813
|
+
return true;
|
|
2814
|
+
} else if (pkgVersionArr[i] < destVer[i]) {
|
|
2815
|
+
return false;
|
|
3088
2816
|
}
|
|
3089
2817
|
}
|
|
3090
|
-
return
|
|
2818
|
+
return false;
|
|
3091
2819
|
}
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
normalizeHeaderName2(headers, "Accept");
|
|
3101
|
-
normalizeHeaderName2(headers, "Content-Type");
|
|
3102
|
-
if (utils$5.isFormData(data) || utils$5.isArrayBuffer(data) || utils$5.isBuffer(data) || utils$5.isStream(data) || utils$5.isFile(data) || utils$5.isBlob(data)) {
|
|
3103
|
-
return data;
|
|
3104
|
-
}
|
|
3105
|
-
if (utils$5.isArrayBufferView(data)) {
|
|
3106
|
-
return data.buffer;
|
|
3107
|
-
}
|
|
3108
|
-
if (utils$5.isURLSearchParams(data)) {
|
|
3109
|
-
setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
|
|
3110
|
-
return data.toString();
|
|
2820
|
+
validators$1.transitional = function transitional(validator2, version2, message) {
|
|
2821
|
+
var isDeprecated = version2 && isOlderVersion(version2);
|
|
2822
|
+
function formatMessage(opt, desc) {
|
|
2823
|
+
return "[Axios v" + pkg.version + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
2824
|
+
}
|
|
2825
|
+
return function(value, opt, opts) {
|
|
2826
|
+
if (validator2 === false) {
|
|
2827
|
+
throw new Error(formatMessage(opt, " has been removed in " + version2));
|
|
3111
2828
|
}
|
|
3112
|
-
if (
|
|
3113
|
-
|
|
3114
|
-
|
|
2829
|
+
if (isDeprecated && !deprecatedWarnings[opt]) {
|
|
2830
|
+
deprecatedWarnings[opt] = true;
|
|
2831
|
+
console.warn(formatMessage(opt, " has been deprecated since v" + version2 + " and will be removed in the near future"));
|
|
3115
2832
|
}
|
|
3116
|
-
return
|
|
3117
|
-
}
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
2833
|
+
return validator2 ? validator2(value, opt, opts) : true;
|
|
2834
|
+
};
|
|
2835
|
+
};
|
|
2836
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
2837
|
+
if (typeof options !== "object") {
|
|
2838
|
+
throw new TypeError("options must be an object");
|
|
2839
|
+
}
|
|
2840
|
+
var keys2 = Object.keys(options);
|
|
2841
|
+
var i = keys2.length;
|
|
2842
|
+
while (i-- > 0) {
|
|
2843
|
+
var opt = keys2[i];
|
|
2844
|
+
var validator2 = schema[opt];
|
|
2845
|
+
if (validator2) {
|
|
2846
|
+
var value = options[opt];
|
|
2847
|
+
var result = value === void 0 || validator2(value, opt, options);
|
|
2848
|
+
if (result !== true) {
|
|
2849
|
+
throw new TypeError("option " + opt + " must be " + result);
|
|
3133
2850
|
}
|
|
2851
|
+
continue;
|
|
2852
|
+
}
|
|
2853
|
+
if (allowUnknown !== true) {
|
|
2854
|
+
throw Error("Unknown option " + opt);
|
|
3134
2855
|
}
|
|
3135
|
-
return data;
|
|
3136
|
-
}],
|
|
3137
|
-
timeout: 0,
|
|
3138
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
3139
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
3140
|
-
maxContentLength: -1,
|
|
3141
|
-
maxBodyLength: -1,
|
|
3142
|
-
validateStatus: function validateStatus(status) {
|
|
3143
|
-
return status >= 200 && status < 300;
|
|
3144
2856
|
}
|
|
2857
|
+
}
|
|
2858
|
+
var validator$1 = {
|
|
2859
|
+
isOlderVersion,
|
|
2860
|
+
assertOptions,
|
|
2861
|
+
validators: validators$1
|
|
3145
2862
|
};
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
2863
|
+
var utils$1 = utils$d;
|
|
2864
|
+
var buildURL2 = buildURL$2;
|
|
2865
|
+
var InterceptorManager = InterceptorManager_1;
|
|
2866
|
+
var dispatchRequest2 = dispatchRequest$1;
|
|
2867
|
+
var mergeConfig$1 = mergeConfig$2;
|
|
2868
|
+
var validator = validator$1;
|
|
2869
|
+
var validators = validator.validators;
|
|
2870
|
+
function Axios$1(instanceConfig) {
|
|
2871
|
+
this.defaults = instanceConfig;
|
|
2872
|
+
this.interceptors = {
|
|
2873
|
+
request: new InterceptorManager(),
|
|
2874
|
+
response: new InterceptorManager()
|
|
2875
|
+
};
|
|
2876
|
+
}
|
|
2877
|
+
Axios$1.prototype.request = function request(config) {
|
|
2878
|
+
if (typeof config === "string") {
|
|
2879
|
+
config = arguments[1] || {};
|
|
2880
|
+
config.url = arguments[0];
|
|
2881
|
+
} else {
|
|
2882
|
+
config = config || {};
|
|
2883
|
+
}
|
|
2884
|
+
config = mergeConfig$1(this.defaults, config);
|
|
2885
|
+
if (config.method) {
|
|
2886
|
+
config.method = config.method.toLowerCase();
|
|
2887
|
+
} else if (this.defaults.method) {
|
|
2888
|
+
config.method = this.defaults.method.toLowerCase();
|
|
2889
|
+
} else {
|
|
2890
|
+
config.method = "get";
|
|
2891
|
+
}
|
|
2892
|
+
var transitional2 = config.transitional;
|
|
2893
|
+
if (transitional2 !== void 0) {
|
|
2894
|
+
validator.assertOptions(transitional2, {
|
|
2895
|
+
silentJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
|
|
2896
|
+
forcedJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
|
|
2897
|
+
clarifyTimeoutError: validators.transitional(validators.boolean, "1.0.0")
|
|
2898
|
+
}, false);
|
|
2899
|
+
}
|
|
2900
|
+
var requestInterceptorChain = [];
|
|
2901
|
+
var synchronousRequestInterceptors = true;
|
|
2902
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
2903
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
2904
|
+
return;
|
|
2905
|
+
}
|
|
2906
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
2907
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
2908
|
+
});
|
|
2909
|
+
var responseInterceptorChain = [];
|
|
2910
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
2911
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
2912
|
+
});
|
|
2913
|
+
var promise;
|
|
2914
|
+
if (!synchronousRequestInterceptors) {
|
|
2915
|
+
var chain = [dispatchRequest2, void 0];
|
|
2916
|
+
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
2917
|
+
chain = chain.concat(responseInterceptorChain);
|
|
2918
|
+
promise = Promise.resolve(config);
|
|
2919
|
+
while (chain.length) {
|
|
2920
|
+
promise = promise.then(chain.shift(), chain.shift());
|
|
2921
|
+
}
|
|
2922
|
+
return promise;
|
|
2923
|
+
}
|
|
2924
|
+
var newConfig = config;
|
|
2925
|
+
while (requestInterceptorChain.length) {
|
|
2926
|
+
var onFulfilled = requestInterceptorChain.shift();
|
|
2927
|
+
var onRejected = requestInterceptorChain.shift();
|
|
2928
|
+
try {
|
|
2929
|
+
newConfig = onFulfilled(newConfig);
|
|
2930
|
+
} catch (error) {
|
|
2931
|
+
onRejected(error);
|
|
2932
|
+
break;
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
try {
|
|
2936
|
+
promise = dispatchRequest2(newConfig);
|
|
2937
|
+
} catch (error) {
|
|
2938
|
+
return Promise.reject(error);
|
|
3149
2939
|
}
|
|
2940
|
+
while (responseInterceptorChain.length) {
|
|
2941
|
+
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
|
|
2942
|
+
}
|
|
2943
|
+
return promise;
|
|
3150
2944
|
};
|
|
3151
|
-
|
|
3152
|
-
|
|
2945
|
+
Axios$1.prototype.getUri = function getUri(config) {
|
|
2946
|
+
config = mergeConfig$1(this.defaults, config);
|
|
2947
|
+
return buildURL2(config.url, config.params, config.paramsSerializer).replace(/^\?/, "");
|
|
2948
|
+
};
|
|
2949
|
+
utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
|
|
2950
|
+
Axios$1.prototype[method] = function(url, config) {
|
|
2951
|
+
return this.request(mergeConfig$1(config || {}, {
|
|
2952
|
+
method,
|
|
2953
|
+
url,
|
|
2954
|
+
data: (config || {}).data
|
|
2955
|
+
}));
|
|
2956
|
+
};
|
|
3153
2957
|
});
|
|
3154
|
-
utils$
|
|
3155
|
-
|
|
2958
|
+
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
|
|
2959
|
+
Axios$1.prototype[method] = function(url, data, config) {
|
|
2960
|
+
return this.request(mergeConfig$1(config || {}, {
|
|
2961
|
+
method,
|
|
2962
|
+
url,
|
|
2963
|
+
data
|
|
2964
|
+
}));
|
|
2965
|
+
};
|
|
3156
2966
|
});
|
|
3157
|
-
var
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
data = fn.call(context, data, headers);
|
|
3164
|
-
});
|
|
3165
|
-
return data;
|
|
3166
|
-
};
|
|
3167
|
-
var isCancel$1 = function isCancel(value) {
|
|
3168
|
-
return !!(value && value.__CANCEL__);
|
|
2967
|
+
var Axios_1 = Axios$1;
|
|
2968
|
+
function Cancel$1(message) {
|
|
2969
|
+
this.message = message;
|
|
2970
|
+
}
|
|
2971
|
+
Cancel$1.prototype.toString = function toString2() {
|
|
2972
|
+
return "Cancel" + (this.message ? ": " + this.message : "");
|
|
3169
2973
|
};
|
|
3170
|
-
|
|
3171
|
-
var
|
|
3172
|
-
var
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
config.cancelToken.throwIfRequested();
|
|
2974
|
+
Cancel$1.prototype.__CANCEL__ = true;
|
|
2975
|
+
var Cancel_1 = Cancel$1;
|
|
2976
|
+
var Cancel = Cancel_1;
|
|
2977
|
+
function CancelToken(executor) {
|
|
2978
|
+
if (typeof executor !== "function") {
|
|
2979
|
+
throw new TypeError("executor must be a function.");
|
|
3177
2980
|
}
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
config.headers = config.headers || {};
|
|
3182
|
-
config.data = transformData2.call(config, config.data, config.headers, config.transformRequest);
|
|
3183
|
-
config.headers = utils$3.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);
|
|
3184
|
-
utils$3.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function cleanHeaderConfig(method) {
|
|
3185
|
-
delete config.headers[method];
|
|
2981
|
+
var resolvePromise;
|
|
2982
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
2983
|
+
resolvePromise = resolve;
|
|
3186
2984
|
});
|
|
3187
|
-
var
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
return response;
|
|
3192
|
-
}, function onAdapterRejection(reason) {
|
|
3193
|
-
if (!isCancel2(reason)) {
|
|
3194
|
-
throwIfCancellationRequested(config);
|
|
3195
|
-
if (reason && reason.response) {
|
|
3196
|
-
reason.response.data = transformData2.call(config, reason.response.data, reason.response.headers, config.transformResponse);
|
|
3197
|
-
}
|
|
2985
|
+
var token2 = this;
|
|
2986
|
+
executor(function cancel(message) {
|
|
2987
|
+
if (token2.reason) {
|
|
2988
|
+
return;
|
|
3198
2989
|
}
|
|
3199
|
-
|
|
2990
|
+
token2.reason = new Cancel(message);
|
|
2991
|
+
resolvePromise(token2.reason);
|
|
3200
2992
|
});
|
|
2993
|
+
}
|
|
2994
|
+
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
2995
|
+
if (this.reason) {
|
|
2996
|
+
throw this.reason;
|
|
2997
|
+
}
|
|
3201
2998
|
};
|
|
3202
|
-
|
|
3203
|
-
var
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
var valueFromConfig2Keys = ["url", "method", "data"];
|
|
3207
|
-
var mergeDeepPropertiesKeys = ["headers", "auth", "proxy", "params"];
|
|
3208
|
-
var defaultToConfig2Keys = [
|
|
3209
|
-
"baseURL",
|
|
3210
|
-
"transformRequest",
|
|
3211
|
-
"transformResponse",
|
|
3212
|
-
"paramsSerializer",
|
|
3213
|
-
"timeout",
|
|
3214
|
-
"timeoutMessage",
|
|
3215
|
-
"withCredentials",
|
|
3216
|
-
"adapter",
|
|
3217
|
-
"responseType",
|
|
3218
|
-
"xsrfCookieName",
|
|
3219
|
-
"xsrfHeaderName",
|
|
3220
|
-
"onUploadProgress",
|
|
3221
|
-
"onDownloadProgress",
|
|
3222
|
-
"decompress",
|
|
3223
|
-
"maxContentLength",
|
|
3224
|
-
"maxBodyLength",
|
|
3225
|
-
"maxRedirects",
|
|
3226
|
-
"transport",
|
|
3227
|
-
"httpAgent",
|
|
3228
|
-
"httpsAgent",
|
|
3229
|
-
"cancelToken",
|
|
3230
|
-
"socketPath",
|
|
3231
|
-
"responseEncoding"
|
|
3232
|
-
];
|
|
3233
|
-
var directMergeKeys = ["validateStatus"];
|
|
3234
|
-
function getMergedValue(target, source2) {
|
|
3235
|
-
if (utils$2.isPlainObject(target) && utils$2.isPlainObject(source2)) {
|
|
3236
|
-
return utils$2.merge(target, source2);
|
|
3237
|
-
} else if (utils$2.isPlainObject(source2)) {
|
|
3238
|
-
return utils$2.merge({}, source2);
|
|
3239
|
-
} else if (utils$2.isArray(source2)) {
|
|
3240
|
-
return source2.slice();
|
|
3241
|
-
}
|
|
3242
|
-
return source2;
|
|
3243
|
-
}
|
|
3244
|
-
function mergeDeepProperties(prop) {
|
|
3245
|
-
if (!utils$2.isUndefined(config2[prop])) {
|
|
3246
|
-
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
|
3247
|
-
} else if (!utils$2.isUndefined(config1[prop])) {
|
|
3248
|
-
config[prop] = getMergedValue(void 0, config1[prop]);
|
|
3249
|
-
}
|
|
3250
|
-
}
|
|
3251
|
-
utils$2.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
|
|
3252
|
-
if (!utils$2.isUndefined(config2[prop])) {
|
|
3253
|
-
config[prop] = getMergedValue(void 0, config2[prop]);
|
|
3254
|
-
}
|
|
3255
|
-
});
|
|
3256
|
-
utils$2.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
|
|
3257
|
-
utils$2.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
|
|
3258
|
-
if (!utils$2.isUndefined(config2[prop])) {
|
|
3259
|
-
config[prop] = getMergedValue(void 0, config2[prop]);
|
|
3260
|
-
} else if (!utils$2.isUndefined(config1[prop])) {
|
|
3261
|
-
config[prop] = getMergedValue(void 0, config1[prop]);
|
|
3262
|
-
}
|
|
3263
|
-
});
|
|
3264
|
-
utils$2.forEach(directMergeKeys, function merge2(prop) {
|
|
3265
|
-
if (prop in config2) {
|
|
3266
|
-
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
|
3267
|
-
} else if (prop in config1) {
|
|
3268
|
-
config[prop] = getMergedValue(void 0, config1[prop]);
|
|
3269
|
-
}
|
|
3270
|
-
});
|
|
3271
|
-
var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys).concat(directMergeKeys);
|
|
3272
|
-
var otherKeys = Object.keys(config1).concat(Object.keys(config2)).filter(function filterAxiosKeys(key) {
|
|
3273
|
-
return axiosKeys.indexOf(key) === -1;
|
|
2999
|
+
CancelToken.source = function source() {
|
|
3000
|
+
var cancel;
|
|
3001
|
+
var token2 = new CancelToken(function executor(c) {
|
|
3002
|
+
cancel = c;
|
|
3274
3003
|
});
|
|
3275
|
-
|
|
3276
|
-
|
|
3004
|
+
return {
|
|
3005
|
+
token: token2,
|
|
3006
|
+
cancel
|
|
3007
|
+
};
|
|
3277
3008
|
};
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
test: "grunt test",
|
|
3284
|
-
start: "node ./sandbox/server.js",
|
|
3285
|
-
build: "NODE_ENV=production grunt build",
|
|
3286
|
-
preversion: "npm test",
|
|
3287
|
-
version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",
|
|
3288
|
-
postversion: "git push && git push --tags",
|
|
3289
|
-
examples: "node ./examples/server.js",
|
|
3290
|
-
coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
|
3291
|
-
fix: "eslint --fix lib/**/*.js"
|
|
3009
|
+
var CancelToken_1 = CancelToken;
|
|
3010
|
+
var spread = function spread2(callback) {
|
|
3011
|
+
return function wrap(arr) {
|
|
3012
|
+
return callback.apply(null, arr);
|
|
3013
|
+
};
|
|
3292
3014
|
};
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
url: "https://github.com/axios/axios.git"
|
|
3015
|
+
var isAxiosError = function isAxiosError2(payload) {
|
|
3016
|
+
return typeof payload === "object" && payload.isAxiosError === true;
|
|
3296
3017
|
};
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3018
|
+
var utils = utils$d;
|
|
3019
|
+
var bind2 = bind$2;
|
|
3020
|
+
var Axios = Axios_1;
|
|
3021
|
+
var mergeConfig2 = mergeConfig$2;
|
|
3022
|
+
var defaults = defaults_1;
|
|
3023
|
+
function createInstance(defaultConfig) {
|
|
3024
|
+
var context = new Axios(defaultConfig);
|
|
3025
|
+
var instance = bind2(Axios.prototype.request, context);
|
|
3026
|
+
utils.extend(instance, Axios.prototype, context);
|
|
3027
|
+
utils.extend(instance, context);
|
|
3028
|
+
return instance;
|
|
3029
|
+
}
|
|
3030
|
+
var axios$1 = createInstance(defaults);
|
|
3031
|
+
axios$1.Axios = Axios;
|
|
3032
|
+
axios$1.create = function create(instanceConfig) {
|
|
3033
|
+
return createInstance(mergeConfig2(axios$1.defaults, instanceConfig));
|
|
3308
3034
|
};
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
"grunt-banner": "^0.6.0",
|
|
3315
|
-
"grunt-cli": "^1.2.0",
|
|
3316
|
-
"grunt-contrib-clean": "^1.1.0",
|
|
3317
|
-
"grunt-contrib-watch": "^1.0.0",
|
|
3318
|
-
"grunt-eslint": "^23.0.0",
|
|
3319
|
-
"grunt-karma": "^4.0.0",
|
|
3320
|
-
"grunt-mocha-test": "^0.13.3",
|
|
3321
|
-
"grunt-ts": "^6.0.0-beta.19",
|
|
3322
|
-
"grunt-webpack": "^4.0.2",
|
|
3323
|
-
"istanbul-instrumenter-loader": "^1.0.0",
|
|
3324
|
-
"jasmine-core": "^2.4.1",
|
|
3325
|
-
karma: "^6.3.2",
|
|
3326
|
-
"karma-chrome-launcher": "^3.1.0",
|
|
3327
|
-
"karma-firefox-launcher": "^2.1.0",
|
|
3328
|
-
"karma-jasmine": "^1.1.1",
|
|
3329
|
-
"karma-jasmine-ajax": "^0.1.13",
|
|
3330
|
-
"karma-safari-launcher": "^1.0.0",
|
|
3331
|
-
"karma-sauce-launcher": "^4.3.6",
|
|
3332
|
-
"karma-sinon": "^1.0.5",
|
|
3333
|
-
"karma-sourcemap-loader": "^0.3.8",
|
|
3334
|
-
"karma-webpack": "^4.0.2",
|
|
3335
|
-
"load-grunt-tasks": "^3.5.2",
|
|
3336
|
-
minimist: "^1.2.0",
|
|
3337
|
-
mocha: "^8.2.1",
|
|
3338
|
-
sinon: "^4.5.0",
|
|
3339
|
-
"terser-webpack-plugin": "^4.2.3",
|
|
3340
|
-
typescript: "^4.0.5",
|
|
3341
|
-
"url-search-params": "^0.10.0",
|
|
3342
|
-
webpack: "^4.44.2",
|
|
3343
|
-
"webpack-dev-server": "^3.11.0"
|
|
3035
|
+
axios$1.Cancel = Cancel_1;
|
|
3036
|
+
axios$1.CancelToken = CancelToken_1;
|
|
3037
|
+
axios$1.isCancel = isCancel$1;
|
|
3038
|
+
axios$1.all = function all(promises) {
|
|
3039
|
+
return Promise.all(promises);
|
|
3344
3040
|
};
|
|
3345
|
-
|
|
3346
|
-
|
|
3041
|
+
axios$1.spread = spread;
|
|
3042
|
+
axios$1.isAxiosError = isAxiosError;
|
|
3043
|
+
axios$2.exports = axios$1;
|
|
3044
|
+
axios$2.exports.default = axios$1;
|
|
3045
|
+
var axios = axios$2.exports;
|
|
3046
|
+
const getUrlFromLocalizedVenueMedia = (localizedVenueMedia, locale) => {
|
|
3047
|
+
var _a, _b, _c;
|
|
3048
|
+
if (localizedVenueMedia && ((_a = localizedVenueMedia == null ? void 0 : localizedVenueMedia.url) == null ? void 0 : _a.length) > 0) {
|
|
3049
|
+
return ((_b = localizedVenueMedia.url.find((item) => item.locale === locale)) == null ? void 0 : _b.value) || ((_c = localizedVenueMedia.url.find((item) => item.locale === "*")) == null ? void 0 : _c.value) || null;
|
|
3050
|
+
}
|
|
3051
|
+
return null;
|
|
3347
3052
|
};
|
|
3348
|
-
const
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
const dependencies = {
|
|
3352
|
-
"follow-redirects": "^1.14.0"
|
|
3053
|
+
const getLocalizedVenueMediaFromArray = (localizedVenueMedia, venue) => {
|
|
3054
|
+
var _a, _b;
|
|
3055
|
+
return ((_a = localizedVenueMedia == null ? void 0 : localizedVenueMedia.find) == null ? void 0 : _a.call(localizedVenueMedia, (item) => item.venue === venue)) || ((_b = localizedVenueMedia == null ? void 0 : localizedVenueMedia.find) == null ? void 0 : _b.call(localizedVenueMedia, (item) => item.venue === "*"));
|
|
3353
3056
|
};
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3057
|
+
function useCms(id, intervalSeconds = 600, withLocalStorage = true, baseUrl, tenant) {
|
|
3058
|
+
var _a, _b;
|
|
3059
|
+
if (!baseUrl || !tenant) {
|
|
3060
|
+
throw new Error("baseUrl or tenant was not provided");
|
|
3358
3061
|
}
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
}
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3062
|
+
const key = `${id}_${tenant}_${baseUrl}`;
|
|
3063
|
+
const url = `${baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl}/cms-api/content/${tenant}/${id}`;
|
|
3064
|
+
const loadedData = ((_a = getFromLocalStorage()) == null ? void 0 : _a.value) || null;
|
|
3065
|
+
const [timestamp, setTimestamp] = useState(((_b = getFromLocalStorage()) == null ? void 0 : _b.timestamp) || 0);
|
|
3066
|
+
const [state, setState] = useState(loadedData || null);
|
|
3067
|
+
const [error, setError] = useState(false);
|
|
3068
|
+
function getCms() {
|
|
3069
|
+
axios.get(url).then((res) => {
|
|
3070
|
+
if (isEmpty_1(res.data)) {
|
|
3071
|
+
throw new Error(`CMS data '${id}' is an empty object`);
|
|
3072
|
+
}
|
|
3073
|
+
if (!isEqual_1(res.data, state)) {
|
|
3074
|
+
setState(res.data);
|
|
3075
|
+
}
|
|
3076
|
+
if (error) {
|
|
3077
|
+
setError(false);
|
|
3078
|
+
}
|
|
3079
|
+
if (withLocalStorage) {
|
|
3080
|
+
saveToLocalStorage(res.data);
|
|
3081
|
+
}
|
|
3082
|
+
}).catch((e) => {
|
|
3083
|
+
console.error(e);
|
|
3084
|
+
setError(true);
|
|
3085
|
+
});
|
|
3086
|
+
return;
|
|
3087
|
+
}
|
|
3088
|
+
function saveToLocalStorage(data) {
|
|
3089
|
+
const t = new Date().valueOf();
|
|
3090
|
+
const value = JSON.stringify({
|
|
3091
|
+
value: data,
|
|
3092
|
+
timestamp: t
|
|
3093
|
+
});
|
|
3094
|
+
localStorage.setItem(key, value);
|
|
3095
|
+
setTimestamp(t);
|
|
3096
|
+
}
|
|
3097
|
+
function getFromLocalStorage() {
|
|
3098
|
+
try {
|
|
3099
|
+
const value = localStorage.getItem(key);
|
|
3100
|
+
if (value) {
|
|
3101
|
+
return JSON.parse(value);
|
|
3102
|
+
}
|
|
3103
|
+
} catch (e) {
|
|
3104
|
+
console.warn(e);
|
|
3397
3105
|
}
|
|
3106
|
+
return null;
|
|
3398
3107
|
}
|
|
3399
|
-
|
|
3108
|
+
useEffect(() => {
|
|
3109
|
+
if (new Date().valueOf() - timestamp > intervalSeconds * 1e3) {
|
|
3110
|
+
getCms();
|
|
3111
|
+
}
|
|
3112
|
+
}, []);
|
|
3113
|
+
useInterval(getCms, intervalSeconds * 1e3);
|
|
3114
|
+
return { value: state, isError: error, isLoading: !error && !state };
|
|
3400
3115
|
}
|
|
3401
|
-
|
|
3402
|
-
var
|
|
3403
|
-
|
|
3404
|
-
|
|
3116
|
+
function useVenueCms(id, intervalSeconds = 600, withLocalStorage = true, baseUrl, tenant, venue) {
|
|
3117
|
+
var _a, _b, _c, _d;
|
|
3118
|
+
if (!baseUrl || !tenant || !venue) {
|
|
3119
|
+
throw new Error("baseUrl, tenant or venue was not provided");
|
|
3405
3120
|
}
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3121
|
+
const arrayOfEntries = useCms(id, intervalSeconds, withLocalStorage, baseUrl, tenant);
|
|
3122
|
+
return {
|
|
3123
|
+
value: ((_b = (_a = arrayOfEntries.value) == null ? void 0 : _a.find) == null ? void 0 : _b.call(_a, (item) => item.venue === venue)) || ((_d = (_c = arrayOfEntries.value) == null ? void 0 : _c.find) == null ? void 0 : _d.call(_c, (item) => item.venue === "*")) || null,
|
|
3124
|
+
isError: arrayOfEntries.isError
|
|
3125
|
+
};
|
|
3126
|
+
}
|
|
3127
|
+
function useLocalizedVenueMedia(id, venue, locale, intervalSeconds = 300, withLocalStorage = true) {
|
|
3128
|
+
var _a, _b, _c, _d;
|
|
3129
|
+
const config = useContext(ConfigContext);
|
|
3130
|
+
if (!config) {
|
|
3131
|
+
throw new Error("Missing config context");
|
|
3132
|
+
}
|
|
3133
|
+
const { value, isError } = useVenueCms(id, intervalSeconds, withLocalStorage, config.baseUrl, config.tenant, venue);
|
|
3134
|
+
let localizedValue = null;
|
|
3135
|
+
let fallbackUrl = null;
|
|
3136
|
+
if (value && ((_a = value == null ? void 0 : value.url) == null ? void 0 : _a.length) > 0) {
|
|
3137
|
+
localizedValue = ((_b = value.url.find((item) => item.locale === locale)) == null ? void 0 : _b.value) || ((_c = value.url.find((item) => item.locale === "*")) == null ? void 0 : _c.value) || null;
|
|
3138
|
+
}
|
|
3139
|
+
if (!localizedValue && value && ((_d = value == null ? void 0 : value.url) == null ? void 0 : _d.length) > 0) {
|
|
3140
|
+
fallbackUrl = value.url[0].value;
|
|
3141
|
+
}
|
|
3142
|
+
return { url: localizedValue, fallbackUrl, isError };
|
|
3143
|
+
}
|
|
3144
|
+
function useKioskMediaCms({
|
|
3145
|
+
kioskMediaId,
|
|
3146
|
+
kioskMediaType,
|
|
3147
|
+
intervalSeconds = 600,
|
|
3148
|
+
withLocalStorage = true,
|
|
3149
|
+
baseUrl,
|
|
3150
|
+
tenant,
|
|
3151
|
+
venue,
|
|
3152
|
+
locale
|
|
3153
|
+
}) {
|
|
3154
|
+
var _a;
|
|
3155
|
+
const { value, isError, isLoading } = useCms(kioskMediaId, intervalSeconds, withLocalStorage, baseUrl, tenant);
|
|
3156
|
+
const kioskMediaFoundType = (value == null ? void 0 : value[kioskMediaType]) || [];
|
|
3157
|
+
const kioskMediaFoundTypeVenue = getLocalizedVenueMediaFromArray(kioskMediaFoundType, venue);
|
|
3158
|
+
const localizedValue = getUrlFromLocalizedVenueMedia(kioskMediaFoundTypeVenue, locale);
|
|
3159
|
+
const fallbackUrl = !localizedValue && kioskMediaFoundTypeVenue && ((_a = kioskMediaFoundTypeVenue == null ? void 0 : kioskMediaFoundTypeVenue.url) == null ? void 0 : _a.length) > 0 ? kioskMediaFoundTypeVenue.url[0].value : null;
|
|
3160
|
+
return {
|
|
3161
|
+
url: localizedValue,
|
|
3162
|
+
fallbackUrl,
|
|
3163
|
+
mediaType: kioskMediaFoundTypeVenue == null ? void 0 : kioskMediaFoundTypeVenue.mediaType,
|
|
3164
|
+
isError,
|
|
3165
|
+
isLoading
|
|
3166
|
+
};
|
|
3167
|
+
}
|
|
3168
|
+
function useKioskMediaCmsWithContext({
|
|
3169
|
+
kioskMediaId,
|
|
3170
|
+
kioskMediaType,
|
|
3171
|
+
venue,
|
|
3172
|
+
intervalSeconds = 600,
|
|
3173
|
+
withLocalStorage = true
|
|
3174
|
+
}) {
|
|
3175
|
+
const config = useContext(ConfigContext);
|
|
3176
|
+
if (!config) {
|
|
3177
|
+
throw new Error("Missing config context");
|
|
3178
|
+
}
|
|
3179
|
+
const {
|
|
3180
|
+
i18n: { language }
|
|
3181
|
+
} = useTranslation();
|
|
3182
|
+
return useKioskMediaCms({
|
|
3183
|
+
kioskMediaId,
|
|
3184
|
+
kioskMediaType,
|
|
3185
|
+
intervalSeconds,
|
|
3186
|
+
withLocalStorage,
|
|
3187
|
+
venue,
|
|
3188
|
+
baseUrl: config.baseUrl,
|
|
3189
|
+
tenant: config.tenant,
|
|
3190
|
+
locale: language
|
|
3191
|
+
});
|
|
3192
|
+
}
|
|
3193
|
+
function useOnClickOutside(ref, handler) {
|
|
3194
|
+
useEffect(() => {
|
|
3195
|
+
const listener = (event) => {
|
|
3196
|
+
if (!ref.current || ref.current.contains(event.target)) {
|
|
3197
|
+
return;
|
|
3198
|
+
}
|
|
3199
|
+
handler(event);
|
|
3200
|
+
};
|
|
3201
|
+
document.addEventListener("mousedown", listener);
|
|
3202
|
+
document.addEventListener("touchstart", listener);
|
|
3203
|
+
return () => {
|
|
3204
|
+
document.removeEventListener("mousedown", listener);
|
|
3205
|
+
document.removeEventListener("touchstart", listener);
|
|
3206
|
+
};
|
|
3207
|
+
}, [ref, handler]);
|
|
3208
|
+
}
|
|
3209
|
+
function useKioskChannelsAvailability(channelConstraints) {
|
|
3210
|
+
const [dineInOpen, setDineInOpen] = useState(isChannelOpen(channelConstraints == null ? void 0 : channelConstraints.DINE_IN));
|
|
3211
|
+
const [takeAwayOpen, setTakeAwayOpen] = useState(isChannelOpen(channelConstraints == null ? void 0 : channelConstraints.TAKE_AWAY));
|
|
3212
|
+
function checkOpen() {
|
|
3213
|
+
const dineIn = isChannelOpen(channelConstraints == null ? void 0 : channelConstraints.DINE_IN);
|
|
3214
|
+
const takeAway = isChannelOpen(channelConstraints == null ? void 0 : channelConstraints.TAKE_AWAY);
|
|
3215
|
+
if (dineIn !== dineInOpen) {
|
|
3216
|
+
console.log("dine in open changed", dineInOpen, "=>", dineIn);
|
|
3217
|
+
setDineInOpen(dineIn);
|
|
3409
3218
|
}
|
|
3410
|
-
if (
|
|
3411
|
-
|
|
3412
|
-
|
|
3219
|
+
if (takeAway !== takeAwayOpen) {
|
|
3220
|
+
console.log("take away open changed", takeAwayOpen, "=>", takeAway);
|
|
3221
|
+
setTakeAwayOpen(takeAway);
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
useEffect(() => {
|
|
3225
|
+
checkOpen();
|
|
3226
|
+
}, [channelConstraints]);
|
|
3227
|
+
useInterval(checkOpen, 6e4);
|
|
3228
|
+
return { dineInOpen, takeAwayOpen, loaded: !!channelConstraints };
|
|
3229
|
+
}
|
|
3230
|
+
var queryString = {};
|
|
3231
|
+
var strictUriEncode = (str) => encodeURIComponent(str).replace(/[!'()*]/g, (x) => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
3232
|
+
var token = "%[a-f0-9]{2}";
|
|
3233
|
+
var singleMatcher = new RegExp("(" + token + ")|([^%]+?)", "gi");
|
|
3234
|
+
var multiMatcher = new RegExp("(" + token + ")+", "gi");
|
|
3235
|
+
function decodeComponents(components, split) {
|
|
3236
|
+
try {
|
|
3237
|
+
return [decodeURIComponent(components.join(""))];
|
|
3238
|
+
} catch (err) {
|
|
3239
|
+
}
|
|
3240
|
+
if (components.length === 1) {
|
|
3241
|
+
return components;
|
|
3242
|
+
}
|
|
3243
|
+
split = split || 1;
|
|
3244
|
+
var left = components.slice(0, split);
|
|
3245
|
+
var right = components.slice(split);
|
|
3246
|
+
return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
|
|
3247
|
+
}
|
|
3248
|
+
function decode(input) {
|
|
3249
|
+
try {
|
|
3250
|
+
return decodeURIComponent(input);
|
|
3251
|
+
} catch (err) {
|
|
3252
|
+
var tokens = input.match(singleMatcher) || [];
|
|
3253
|
+
for (var i = 1; i < tokens.length; i++) {
|
|
3254
|
+
input = decodeComponents(tokens, i).join("");
|
|
3255
|
+
tokens = input.match(singleMatcher) || [];
|
|
3413
3256
|
}
|
|
3414
|
-
return
|
|
3415
|
-
};
|
|
3416
|
-
};
|
|
3417
|
-
function assertOptions(options, schema, allowUnknown) {
|
|
3418
|
-
if (typeof options !== "object") {
|
|
3419
|
-
throw new TypeError("options must be an object");
|
|
3257
|
+
return input;
|
|
3420
3258
|
}
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3259
|
+
}
|
|
3260
|
+
function customDecodeURIComponent(input) {
|
|
3261
|
+
var replaceMap = {
|
|
3262
|
+
"%FE%FF": "\uFFFD\uFFFD",
|
|
3263
|
+
"%FF%FE": "\uFFFD\uFFFD"
|
|
3264
|
+
};
|
|
3265
|
+
var match = multiMatcher.exec(input);
|
|
3266
|
+
while (match) {
|
|
3267
|
+
try {
|
|
3268
|
+
replaceMap[match[0]] = decodeURIComponent(match[0]);
|
|
3269
|
+
} catch (err) {
|
|
3270
|
+
var result = decode(match[0]);
|
|
3271
|
+
if (result !== match[0]) {
|
|
3272
|
+
replaceMap[match[0]] = result;
|
|
3431
3273
|
}
|
|
3432
|
-
continue;
|
|
3433
|
-
}
|
|
3434
|
-
if (allowUnknown !== true) {
|
|
3435
|
-
throw Error("Unknown option " + opt);
|
|
3436
3274
|
}
|
|
3275
|
+
match = multiMatcher.exec(input);
|
|
3276
|
+
}
|
|
3277
|
+
replaceMap["%C2"] = "\uFFFD";
|
|
3278
|
+
var entries = Object.keys(replaceMap);
|
|
3279
|
+
for (var i = 0; i < entries.length; i++) {
|
|
3280
|
+
var key = entries[i];
|
|
3281
|
+
input = input.replace(new RegExp(key, "g"), replaceMap[key]);
|
|
3437
3282
|
}
|
|
3283
|
+
return input;
|
|
3438
3284
|
}
|
|
3439
|
-
var
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3285
|
+
var decodeUriComponent = function(encodedURI) {
|
|
3286
|
+
if (typeof encodedURI !== "string") {
|
|
3287
|
+
throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof encodedURI + "`");
|
|
3288
|
+
}
|
|
3289
|
+
try {
|
|
3290
|
+
encodedURI = encodedURI.replace(/\+/g, " ");
|
|
3291
|
+
return decodeURIComponent(encodedURI);
|
|
3292
|
+
} catch (err) {
|
|
3293
|
+
return customDecodeURIComponent(encodedURI);
|
|
3294
|
+
}
|
|
3443
3295
|
};
|
|
3444
|
-
var
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
var dispatchRequest2 = dispatchRequest$1;
|
|
3448
|
-
var mergeConfig$1 = mergeConfig$2;
|
|
3449
|
-
var validator = validator$1;
|
|
3450
|
-
var validators = validator.validators;
|
|
3451
|
-
function Axios$1(instanceConfig) {
|
|
3452
|
-
this.defaults = instanceConfig;
|
|
3453
|
-
this.interceptors = {
|
|
3454
|
-
request: new InterceptorManager(),
|
|
3455
|
-
response: new InterceptorManager()
|
|
3456
|
-
};
|
|
3457
|
-
}
|
|
3458
|
-
Axios$1.prototype.request = function request(config) {
|
|
3459
|
-
if (typeof config === "string") {
|
|
3460
|
-
config = arguments[1] || {};
|
|
3461
|
-
config.url = arguments[0];
|
|
3462
|
-
} else {
|
|
3463
|
-
config = config || {};
|
|
3296
|
+
var splitOnFirst = (string, separator) => {
|
|
3297
|
+
if (!(typeof string === "string" && typeof separator === "string")) {
|
|
3298
|
+
throw new TypeError("Expected the arguments to be of type `string`");
|
|
3464
3299
|
}
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
config.method = config.method.toLowerCase();
|
|
3468
|
-
} else if (this.defaults.method) {
|
|
3469
|
-
config.method = this.defaults.method.toLowerCase();
|
|
3470
|
-
} else {
|
|
3471
|
-
config.method = "get";
|
|
3300
|
+
if (separator === "") {
|
|
3301
|
+
return [string];
|
|
3472
3302
|
}
|
|
3473
|
-
|
|
3474
|
-
if (
|
|
3475
|
-
|
|
3476
|
-
silentJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
|
|
3477
|
-
forcedJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
|
|
3478
|
-
clarifyTimeoutError: validators.transitional(validators.boolean, "1.0.0")
|
|
3479
|
-
}, false);
|
|
3303
|
+
const separatorIndex = string.indexOf(separator);
|
|
3304
|
+
if (separatorIndex === -1) {
|
|
3305
|
+
return [string];
|
|
3480
3306
|
}
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3307
|
+
return [
|
|
3308
|
+
string.slice(0, separatorIndex),
|
|
3309
|
+
string.slice(separatorIndex + separator.length)
|
|
3310
|
+
];
|
|
3311
|
+
};
|
|
3312
|
+
var filterObj = function(obj, predicate) {
|
|
3313
|
+
var ret = {};
|
|
3314
|
+
var keys2 = Object.keys(obj);
|
|
3315
|
+
var isArr = Array.isArray(predicate);
|
|
3316
|
+
for (var i = 0; i < keys2.length; i++) {
|
|
3317
|
+
var key = keys2[i];
|
|
3318
|
+
var val = obj[key];
|
|
3319
|
+
if (isArr ? predicate.indexOf(key) !== -1 : predicate(key, val, obj)) {
|
|
3320
|
+
ret[key] = val;
|
|
3321
|
+
}
|
|
3322
|
+
}
|
|
3323
|
+
return ret;
|
|
3324
|
+
};
|
|
3325
|
+
(function(exports) {
|
|
3326
|
+
const strictUriEncode$1 = strictUriEncode;
|
|
3327
|
+
const decodeComponent = decodeUriComponent;
|
|
3328
|
+
const splitOnFirst$1 = splitOnFirst;
|
|
3329
|
+
const filterObject = filterObj;
|
|
3330
|
+
const isNullOrUndefined = (value) => value === null || value === void 0;
|
|
3331
|
+
const encodeFragmentIdentifier = Symbol("encodeFragmentIdentifier");
|
|
3332
|
+
function encoderForArrayFormat(options) {
|
|
3333
|
+
switch (options.arrayFormat) {
|
|
3334
|
+
case "index":
|
|
3335
|
+
return (key) => (result, value) => {
|
|
3336
|
+
const index = result.length;
|
|
3337
|
+
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
3338
|
+
return result;
|
|
3339
|
+
}
|
|
3340
|
+
if (value === null) {
|
|
3341
|
+
return [...result, [encode2(key, options), "[", index, "]"].join("")];
|
|
3342
|
+
}
|
|
3343
|
+
return [
|
|
3344
|
+
...result,
|
|
3345
|
+
[encode2(key, options), "[", encode2(index, options), "]=", encode2(value, options)].join("")
|
|
3346
|
+
];
|
|
3347
|
+
};
|
|
3348
|
+
case "bracket":
|
|
3349
|
+
return (key) => (result, value) => {
|
|
3350
|
+
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
3351
|
+
return result;
|
|
3352
|
+
}
|
|
3353
|
+
if (value === null) {
|
|
3354
|
+
return [...result, [encode2(key, options), "[]"].join("")];
|
|
3355
|
+
}
|
|
3356
|
+
return [...result, [encode2(key, options), "[]=", encode2(value, options)].join("")];
|
|
3357
|
+
};
|
|
3358
|
+
case "colon-list-separator":
|
|
3359
|
+
return (key) => (result, value) => {
|
|
3360
|
+
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
3361
|
+
return result;
|
|
3362
|
+
}
|
|
3363
|
+
if (value === null) {
|
|
3364
|
+
return [...result, [encode2(key, options), ":list="].join("")];
|
|
3365
|
+
}
|
|
3366
|
+
return [...result, [encode2(key, options), ":list=", encode2(value, options)].join("")];
|
|
3367
|
+
};
|
|
3368
|
+
case "comma":
|
|
3369
|
+
case "separator":
|
|
3370
|
+
case "bracket-separator": {
|
|
3371
|
+
const keyValueSep = options.arrayFormat === "bracket-separator" ? "[]=" : "=";
|
|
3372
|
+
return (key) => (result, value) => {
|
|
3373
|
+
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
3374
|
+
return result;
|
|
3375
|
+
}
|
|
3376
|
+
value = value === null ? "" : value;
|
|
3377
|
+
if (result.length === 0) {
|
|
3378
|
+
return [[encode2(key, options), keyValueSep, encode2(value, options)].join("")];
|
|
3379
|
+
}
|
|
3380
|
+
return [[result, encode2(value, options)].join(options.arrayFormatSeparator)];
|
|
3381
|
+
};
|
|
3382
|
+
}
|
|
3383
|
+
default:
|
|
3384
|
+
return (key) => (result, value) => {
|
|
3385
|
+
if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") {
|
|
3386
|
+
return result;
|
|
3387
|
+
}
|
|
3388
|
+
if (value === null) {
|
|
3389
|
+
return [...result, encode2(key, options)];
|
|
3390
|
+
}
|
|
3391
|
+
return [...result, [encode2(key, options), "=", encode2(value, options)].join("")];
|
|
3392
|
+
};
|
|
3393
|
+
}
|
|
3394
|
+
}
|
|
3395
|
+
function parserForArrayFormat(options) {
|
|
3396
|
+
let result;
|
|
3397
|
+
switch (options.arrayFormat) {
|
|
3398
|
+
case "index":
|
|
3399
|
+
return (key, value, accumulator) => {
|
|
3400
|
+
result = /\[(\d*)\]$/.exec(key);
|
|
3401
|
+
key = key.replace(/\[\d*\]$/, "");
|
|
3402
|
+
if (!result) {
|
|
3403
|
+
accumulator[key] = value;
|
|
3404
|
+
return;
|
|
3405
|
+
}
|
|
3406
|
+
if (accumulator[key] === void 0) {
|
|
3407
|
+
accumulator[key] = {};
|
|
3408
|
+
}
|
|
3409
|
+
accumulator[key][result[1]] = value;
|
|
3410
|
+
};
|
|
3411
|
+
case "bracket":
|
|
3412
|
+
return (key, value, accumulator) => {
|
|
3413
|
+
result = /(\[\])$/.exec(key);
|
|
3414
|
+
key = key.replace(/\[\]$/, "");
|
|
3415
|
+
if (!result) {
|
|
3416
|
+
accumulator[key] = value;
|
|
3417
|
+
return;
|
|
3418
|
+
}
|
|
3419
|
+
if (accumulator[key] === void 0) {
|
|
3420
|
+
accumulator[key] = [value];
|
|
3421
|
+
return;
|
|
3422
|
+
}
|
|
3423
|
+
accumulator[key] = [].concat(accumulator[key], value);
|
|
3424
|
+
};
|
|
3425
|
+
case "colon-list-separator":
|
|
3426
|
+
return (key, value, accumulator) => {
|
|
3427
|
+
result = /(:list)$/.exec(key);
|
|
3428
|
+
key = key.replace(/:list$/, "");
|
|
3429
|
+
if (!result) {
|
|
3430
|
+
accumulator[key] = value;
|
|
3431
|
+
return;
|
|
3432
|
+
}
|
|
3433
|
+
if (accumulator[key] === void 0) {
|
|
3434
|
+
accumulator[key] = [value];
|
|
3435
|
+
return;
|
|
3436
|
+
}
|
|
3437
|
+
accumulator[key] = [].concat(accumulator[key], value);
|
|
3438
|
+
};
|
|
3439
|
+
case "comma":
|
|
3440
|
+
case "separator":
|
|
3441
|
+
return (key, value, accumulator) => {
|
|
3442
|
+
const isArray2 = typeof value === "string" && value.includes(options.arrayFormatSeparator);
|
|
3443
|
+
const isEncodedArray = typeof value === "string" && !isArray2 && decode2(value, options).includes(options.arrayFormatSeparator);
|
|
3444
|
+
value = isEncodedArray ? decode2(value, options) : value;
|
|
3445
|
+
const newValue = isArray2 || isEncodedArray ? value.split(options.arrayFormatSeparator).map((item) => decode2(item, options)) : value === null ? value : decode2(value, options);
|
|
3446
|
+
accumulator[key] = newValue;
|
|
3447
|
+
};
|
|
3448
|
+
case "bracket-separator":
|
|
3449
|
+
return (key, value, accumulator) => {
|
|
3450
|
+
const isArray2 = /(\[\])$/.test(key);
|
|
3451
|
+
key = key.replace(/\[\]$/, "");
|
|
3452
|
+
if (!isArray2) {
|
|
3453
|
+
accumulator[key] = value ? decode2(value, options) : value;
|
|
3454
|
+
return;
|
|
3455
|
+
}
|
|
3456
|
+
const arrayValue = value === null ? [] : value.split(options.arrayFormatSeparator).map((item) => decode2(item, options));
|
|
3457
|
+
if (accumulator[key] === void 0) {
|
|
3458
|
+
accumulator[key] = arrayValue;
|
|
3459
|
+
return;
|
|
3460
|
+
}
|
|
3461
|
+
accumulator[key] = [].concat(accumulator[key], arrayValue);
|
|
3462
|
+
};
|
|
3463
|
+
default:
|
|
3464
|
+
return (key, value, accumulator) => {
|
|
3465
|
+
if (accumulator[key] === void 0) {
|
|
3466
|
+
accumulator[key] = value;
|
|
3467
|
+
return;
|
|
3468
|
+
}
|
|
3469
|
+
accumulator[key] = [].concat(accumulator[key], value);
|
|
3470
|
+
};
|
|
3486
3471
|
}
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
3492
|
-
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
3493
|
-
});
|
|
3494
|
-
var promise;
|
|
3495
|
-
if (!synchronousRequestInterceptors) {
|
|
3496
|
-
var chain = [dispatchRequest2, void 0];
|
|
3497
|
-
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
3498
|
-
chain = chain.concat(responseInterceptorChain);
|
|
3499
|
-
promise = Promise.resolve(config);
|
|
3500
|
-
while (chain.length) {
|
|
3501
|
-
promise = promise.then(chain.shift(), chain.shift());
|
|
3472
|
+
}
|
|
3473
|
+
function validateArrayFormatSeparator(value) {
|
|
3474
|
+
if (typeof value !== "string" || value.length !== 1) {
|
|
3475
|
+
throw new TypeError("arrayFormatSeparator must be single character string");
|
|
3502
3476
|
}
|
|
3503
|
-
return promise;
|
|
3504
3477
|
}
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
var onRejected = requestInterceptorChain.shift();
|
|
3509
|
-
try {
|
|
3510
|
-
newConfig = onFulfilled(newConfig);
|
|
3511
|
-
} catch (error) {
|
|
3512
|
-
onRejected(error);
|
|
3513
|
-
break;
|
|
3478
|
+
function encode2(value, options) {
|
|
3479
|
+
if (options.encode) {
|
|
3480
|
+
return options.strict ? strictUriEncode$1(value) : encodeURIComponent(value);
|
|
3514
3481
|
}
|
|
3482
|
+
return value;
|
|
3515
3483
|
}
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3484
|
+
function decode2(value, options) {
|
|
3485
|
+
if (options.decode) {
|
|
3486
|
+
return decodeComponent(value);
|
|
3487
|
+
}
|
|
3488
|
+
return value;
|
|
3520
3489
|
}
|
|
3521
|
-
|
|
3522
|
-
|
|
3490
|
+
function keysSorter(input) {
|
|
3491
|
+
if (Array.isArray(input)) {
|
|
3492
|
+
return input.sort();
|
|
3493
|
+
}
|
|
3494
|
+
if (typeof input === "object") {
|
|
3495
|
+
return keysSorter(Object.keys(input)).sort((a, b) => Number(a) - Number(b)).map((key) => input[key]);
|
|
3496
|
+
}
|
|
3497
|
+
return input;
|
|
3523
3498
|
}
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
|
|
3531
|
-
Axios$1.prototype[method] = function(url, config) {
|
|
3532
|
-
return this.request(mergeConfig$1(config || {}, {
|
|
3533
|
-
method,
|
|
3534
|
-
url,
|
|
3535
|
-
data: (config || {}).data
|
|
3536
|
-
}));
|
|
3537
|
-
};
|
|
3538
|
-
});
|
|
3539
|
-
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
|
|
3540
|
-
Axios$1.prototype[method] = function(url, data, config) {
|
|
3541
|
-
return this.request(mergeConfig$1(config || {}, {
|
|
3542
|
-
method,
|
|
3543
|
-
url,
|
|
3544
|
-
data
|
|
3545
|
-
}));
|
|
3546
|
-
};
|
|
3547
|
-
});
|
|
3548
|
-
var Axios_1 = Axios$1;
|
|
3549
|
-
function Cancel$1(message) {
|
|
3550
|
-
this.message = message;
|
|
3551
|
-
}
|
|
3552
|
-
Cancel$1.prototype.toString = function toString2() {
|
|
3553
|
-
return "Cancel" + (this.message ? ": " + this.message : "");
|
|
3554
|
-
};
|
|
3555
|
-
Cancel$1.prototype.__CANCEL__ = true;
|
|
3556
|
-
var Cancel_1 = Cancel$1;
|
|
3557
|
-
var Cancel = Cancel_1;
|
|
3558
|
-
function CancelToken(executor) {
|
|
3559
|
-
if (typeof executor !== "function") {
|
|
3560
|
-
throw new TypeError("executor must be a function.");
|
|
3499
|
+
function removeHash(input) {
|
|
3500
|
+
const hashStart = input.indexOf("#");
|
|
3501
|
+
if (hashStart !== -1) {
|
|
3502
|
+
input = input.slice(0, hashStart);
|
|
3503
|
+
}
|
|
3504
|
+
return input;
|
|
3561
3505
|
}
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
executor(function cancel(message) {
|
|
3568
|
-
if (token2.reason) {
|
|
3569
|
-
return;
|
|
3506
|
+
function getHash(url) {
|
|
3507
|
+
let hash = "";
|
|
3508
|
+
const hashStart = url.indexOf("#");
|
|
3509
|
+
if (hashStart !== -1) {
|
|
3510
|
+
hash = url.slice(hashStart);
|
|
3570
3511
|
}
|
|
3571
|
-
|
|
3572
|
-
resolvePromise(token2.reason);
|
|
3573
|
-
});
|
|
3574
|
-
}
|
|
3575
|
-
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
3576
|
-
if (this.reason) {
|
|
3577
|
-
throw this.reason;
|
|
3512
|
+
return hash;
|
|
3578
3513
|
}
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
token: token2,
|
|
3587
|
-
cancel
|
|
3588
|
-
};
|
|
3589
|
-
};
|
|
3590
|
-
var CancelToken_1 = CancelToken;
|
|
3591
|
-
var spread = function spread2(callback) {
|
|
3592
|
-
return function wrap(arr) {
|
|
3593
|
-
return callback.apply(null, arr);
|
|
3594
|
-
};
|
|
3595
|
-
};
|
|
3596
|
-
var isAxiosError = function isAxiosError2(payload) {
|
|
3597
|
-
return typeof payload === "object" && payload.isAxiosError === true;
|
|
3598
|
-
};
|
|
3599
|
-
var utils = utils$d;
|
|
3600
|
-
var bind2 = bind$2;
|
|
3601
|
-
var Axios = Axios_1;
|
|
3602
|
-
var mergeConfig2 = mergeConfig$2;
|
|
3603
|
-
var defaults = defaults_1;
|
|
3604
|
-
function createInstance(defaultConfig) {
|
|
3605
|
-
var context = new Axios(defaultConfig);
|
|
3606
|
-
var instance = bind2(Axios.prototype.request, context);
|
|
3607
|
-
utils.extend(instance, Axios.prototype, context);
|
|
3608
|
-
utils.extend(instance, context);
|
|
3609
|
-
return instance;
|
|
3610
|
-
}
|
|
3611
|
-
var axios$1 = createInstance(defaults);
|
|
3612
|
-
axios$1.Axios = Axios;
|
|
3613
|
-
axios$1.create = function create(instanceConfig) {
|
|
3614
|
-
return createInstance(mergeConfig2(axios$1.defaults, instanceConfig));
|
|
3615
|
-
};
|
|
3616
|
-
axios$1.Cancel = Cancel_1;
|
|
3617
|
-
axios$1.CancelToken = CancelToken_1;
|
|
3618
|
-
axios$1.isCancel = isCancel$1;
|
|
3619
|
-
axios$1.all = function all(promises) {
|
|
3620
|
-
return Promise.all(promises);
|
|
3621
|
-
};
|
|
3622
|
-
axios$1.spread = spread;
|
|
3623
|
-
axios$1.isAxiosError = isAxiosError;
|
|
3624
|
-
axios$2.exports = axios$1;
|
|
3625
|
-
axios$2.exports.default = axios$1;
|
|
3626
|
-
var axios = axios$2.exports;
|
|
3627
|
-
const getUrlFromLocalizedVenueMedia = (localizedVenueMedia, locale) => {
|
|
3628
|
-
var _a, _b, _c;
|
|
3629
|
-
if (localizedVenueMedia && ((_a = localizedVenueMedia == null ? void 0 : localizedVenueMedia.url) == null ? void 0 : _a.length) > 0) {
|
|
3630
|
-
return ((_b = localizedVenueMedia.url.find((item) => item.locale === locale)) == null ? void 0 : _b.value) || ((_c = localizedVenueMedia.url.find((item) => item.locale === "*")) == null ? void 0 : _c.value) || null;
|
|
3514
|
+
function extract(input) {
|
|
3515
|
+
input = removeHash(input);
|
|
3516
|
+
const queryStart = input.indexOf("?");
|
|
3517
|
+
if (queryStart === -1) {
|
|
3518
|
+
return "";
|
|
3519
|
+
}
|
|
3520
|
+
return input.slice(queryStart + 1);
|
|
3631
3521
|
}
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
}
|
|
3638
|
-
|
|
3639
|
-
var _a, _b;
|
|
3640
|
-
if (!baseUrl || !tenant) {
|
|
3641
|
-
throw new Error("baseUrl or tenant was not provided");
|
|
3522
|
+
function parseValue(value, options) {
|
|
3523
|
+
if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === "string" && value.trim() !== "")) {
|
|
3524
|
+
value = Number(value);
|
|
3525
|
+
} else if (options.parseBooleans && value !== null && (value.toLowerCase() === "true" || value.toLowerCase() === "false")) {
|
|
3526
|
+
value = value.toLowerCase() === "true";
|
|
3527
|
+
}
|
|
3528
|
+
return value;
|
|
3642
3529
|
}
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3530
|
+
function parse(query, options) {
|
|
3531
|
+
options = Object.assign({
|
|
3532
|
+
decode: true,
|
|
3533
|
+
sort: true,
|
|
3534
|
+
arrayFormat: "none",
|
|
3535
|
+
arrayFormatSeparator: ",",
|
|
3536
|
+
parseNumbers: false,
|
|
3537
|
+
parseBooleans: false
|
|
3538
|
+
}, options);
|
|
3539
|
+
validateArrayFormatSeparator(options.arrayFormatSeparator);
|
|
3540
|
+
const formatter = parserForArrayFormat(options);
|
|
3541
|
+
const ret = /* @__PURE__ */ Object.create(null);
|
|
3542
|
+
if (typeof query !== "string") {
|
|
3543
|
+
return ret;
|
|
3544
|
+
}
|
|
3545
|
+
query = query.trim().replace(/^[?#&]/, "");
|
|
3546
|
+
if (!query) {
|
|
3547
|
+
return ret;
|
|
3548
|
+
}
|
|
3549
|
+
for (const param of query.split("&")) {
|
|
3550
|
+
if (param === "") {
|
|
3551
|
+
continue;
|
|
3552
|
+
}
|
|
3553
|
+
let [key, value] = splitOnFirst$1(options.decode ? param.replace(/\+/g, " ") : param, "=");
|
|
3554
|
+
value = value === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(options.arrayFormat) ? value : decode2(value, options);
|
|
3555
|
+
formatter(decode2(key, options), value, ret);
|
|
3556
|
+
}
|
|
3557
|
+
for (const key of Object.keys(ret)) {
|
|
3558
|
+
const value = ret[key];
|
|
3559
|
+
if (typeof value === "object" && value !== null) {
|
|
3560
|
+
for (const k of Object.keys(value)) {
|
|
3561
|
+
value[k] = parseValue(value[k], options);
|
|
3562
|
+
}
|
|
3563
|
+
} else {
|
|
3564
|
+
ret[key] = parseValue(value, options);
|
|
3653
3565
|
}
|
|
3654
|
-
|
|
3655
|
-
|
|
3566
|
+
}
|
|
3567
|
+
if (options.sort === false) {
|
|
3568
|
+
return ret;
|
|
3569
|
+
}
|
|
3570
|
+
return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {
|
|
3571
|
+
const value = ret[key];
|
|
3572
|
+
if (Boolean(value) && typeof value === "object" && !Array.isArray(value)) {
|
|
3573
|
+
result[key] = keysSorter(value);
|
|
3574
|
+
} else {
|
|
3575
|
+
result[key] = value;
|
|
3656
3576
|
}
|
|
3657
|
-
|
|
3658
|
-
|
|
3577
|
+
return result;
|
|
3578
|
+
}, /* @__PURE__ */ Object.create(null));
|
|
3579
|
+
}
|
|
3580
|
+
exports.extract = extract;
|
|
3581
|
+
exports.parse = parse;
|
|
3582
|
+
exports.stringify = (object, options) => {
|
|
3583
|
+
if (!object) {
|
|
3584
|
+
return "";
|
|
3585
|
+
}
|
|
3586
|
+
options = Object.assign({
|
|
3587
|
+
encode: true,
|
|
3588
|
+
strict: true,
|
|
3589
|
+
arrayFormat: "none",
|
|
3590
|
+
arrayFormatSeparator: ","
|
|
3591
|
+
}, options);
|
|
3592
|
+
validateArrayFormatSeparator(options.arrayFormatSeparator);
|
|
3593
|
+
const shouldFilter = (key) => options.skipNull && isNullOrUndefined(object[key]) || options.skipEmptyString && object[key] === "";
|
|
3594
|
+
const formatter = encoderForArrayFormat(options);
|
|
3595
|
+
const objectCopy = {};
|
|
3596
|
+
for (const key of Object.keys(object)) {
|
|
3597
|
+
if (!shouldFilter(key)) {
|
|
3598
|
+
objectCopy[key] = object[key];
|
|
3659
3599
|
}
|
|
3660
|
-
|
|
3661
|
-
|
|
3600
|
+
}
|
|
3601
|
+
const keys2 = Object.keys(objectCopy);
|
|
3602
|
+
if (options.sort !== false) {
|
|
3603
|
+
keys2.sort(options.sort);
|
|
3604
|
+
}
|
|
3605
|
+
return keys2.map((key) => {
|
|
3606
|
+
const value = object[key];
|
|
3607
|
+
if (value === void 0) {
|
|
3608
|
+
return "";
|
|
3662
3609
|
}
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
setError(true);
|
|
3666
|
-
});
|
|
3667
|
-
return;
|
|
3668
|
-
}
|
|
3669
|
-
function saveToLocalStorage(data) {
|
|
3670
|
-
const t = new Date().valueOf();
|
|
3671
|
-
const value = JSON.stringify({
|
|
3672
|
-
value: data,
|
|
3673
|
-
timestamp: t
|
|
3674
|
-
});
|
|
3675
|
-
localStorage.setItem(key, value);
|
|
3676
|
-
setTimestamp(t);
|
|
3677
|
-
}
|
|
3678
|
-
function getFromLocalStorage() {
|
|
3679
|
-
try {
|
|
3680
|
-
const value = localStorage.getItem(key);
|
|
3681
|
-
if (value) {
|
|
3682
|
-
return JSON.parse(value);
|
|
3610
|
+
if (value === null) {
|
|
3611
|
+
return encode2(key, options);
|
|
3683
3612
|
}
|
|
3684
|
-
|
|
3685
|
-
|
|
3613
|
+
if (Array.isArray(value)) {
|
|
3614
|
+
if (value.length === 0 && options.arrayFormat === "bracket-separator") {
|
|
3615
|
+
return encode2(key, options) + "[]";
|
|
3616
|
+
}
|
|
3617
|
+
return value.reduce(formatter(key), []).join("&");
|
|
3618
|
+
}
|
|
3619
|
+
return encode2(key, options) + "=" + encode2(value, options);
|
|
3620
|
+
}).filter((x) => x.length > 0).join("&");
|
|
3621
|
+
};
|
|
3622
|
+
exports.parseUrl = (url, options) => {
|
|
3623
|
+
options = Object.assign({
|
|
3624
|
+
decode: true
|
|
3625
|
+
}, options);
|
|
3626
|
+
const [url_, hash] = splitOnFirst$1(url, "#");
|
|
3627
|
+
return Object.assign({
|
|
3628
|
+
url: url_.split("?")[0] || "",
|
|
3629
|
+
query: parse(extract(url), options)
|
|
3630
|
+
}, options && options.parseFragmentIdentifier && hash ? { fragmentIdentifier: decode2(hash, options) } : {});
|
|
3631
|
+
};
|
|
3632
|
+
exports.stringifyUrl = (object, options) => {
|
|
3633
|
+
options = Object.assign({
|
|
3634
|
+
encode: true,
|
|
3635
|
+
strict: true,
|
|
3636
|
+
[encodeFragmentIdentifier]: true
|
|
3637
|
+
}, options);
|
|
3638
|
+
const url = removeHash(object.url).split("?")[0] || "";
|
|
3639
|
+
const queryFromUrl = exports.extract(object.url);
|
|
3640
|
+
const parsedQueryFromUrl = exports.parse(queryFromUrl, { sort: false });
|
|
3641
|
+
const query = Object.assign(parsedQueryFromUrl, object.query);
|
|
3642
|
+
let queryString2 = exports.stringify(query, options);
|
|
3643
|
+
if (queryString2) {
|
|
3644
|
+
queryString2 = `?${queryString2}`;
|
|
3686
3645
|
}
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
if (new Date().valueOf() - timestamp > intervalSeconds * 1e3) {
|
|
3691
|
-
getCms();
|
|
3646
|
+
let hash = getHash(object.url);
|
|
3647
|
+
if (object.fragmentIdentifier) {
|
|
3648
|
+
hash = `#${options[encodeFragmentIdentifier] ? encode2(object.fragmentIdentifier, options) : object.fragmentIdentifier}`;
|
|
3692
3649
|
}
|
|
3693
|
-
|
|
3694
|
-
useInterval(getCms, intervalSeconds * 1e3);
|
|
3695
|
-
return { value: state, isError: error, isLoading: !error && !state };
|
|
3696
|
-
}
|
|
3697
|
-
function useVenueCms(id, intervalSeconds = 600, withLocalStorage = true, baseUrl, tenant, venue) {
|
|
3698
|
-
var _a, _b, _c, _d;
|
|
3699
|
-
if (!baseUrl || !tenant || !venue) {
|
|
3700
|
-
throw new Error("baseUrl, tenant or venue was not provided");
|
|
3701
|
-
}
|
|
3702
|
-
const arrayOfEntries = useCms(id, intervalSeconds, withLocalStorage, baseUrl, tenant);
|
|
3703
|
-
return {
|
|
3704
|
-
value: ((_b = (_a = arrayOfEntries.value) == null ? void 0 : _a.find) == null ? void 0 : _b.call(_a, (item) => item.venue === venue)) || ((_d = (_c = arrayOfEntries.value) == null ? void 0 : _c.find) == null ? void 0 : _d.call(_c, (item) => item.venue === "*")) || null,
|
|
3705
|
-
isError: arrayOfEntries.isError
|
|
3650
|
+
return `${url}${queryString2}${hash}`;
|
|
3706
3651
|
};
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
localizedValue = ((_b = value.url.find((item) => item.locale === locale)) == null ? void 0 : _b.value) || ((_c = value.url.find((item) => item.locale === "*")) == null ? void 0 : _c.value) || null;
|
|
3719
|
-
}
|
|
3720
|
-
if (!localizedValue && value && ((_d = value == null ? void 0 : value.url) == null ? void 0 : _d.length) > 0) {
|
|
3721
|
-
fallbackUrl = value.url[0].value;
|
|
3722
|
-
}
|
|
3723
|
-
return { url: localizedValue, fallbackUrl, isError };
|
|
3724
|
-
}
|
|
3725
|
-
function useKioskMediaCms({
|
|
3726
|
-
kioskMediaId,
|
|
3727
|
-
kioskMediaType,
|
|
3728
|
-
intervalSeconds = 600,
|
|
3729
|
-
withLocalStorage = true,
|
|
3730
|
-
baseUrl,
|
|
3731
|
-
tenant,
|
|
3732
|
-
venue,
|
|
3733
|
-
locale
|
|
3734
|
-
}) {
|
|
3735
|
-
var _a;
|
|
3736
|
-
const { value, isError, isLoading } = useCms(kioskMediaId, intervalSeconds, withLocalStorage, baseUrl, tenant);
|
|
3737
|
-
const kioskMediaFoundType = (value == null ? void 0 : value[kioskMediaType]) || [];
|
|
3738
|
-
const kioskMediaFoundTypeVenue = getLocalizedVenueMediaFromArray(kioskMediaFoundType, venue);
|
|
3739
|
-
const localizedValue = getUrlFromLocalizedVenueMedia(kioskMediaFoundTypeVenue, locale);
|
|
3740
|
-
const fallbackUrl = !localizedValue && kioskMediaFoundTypeVenue && ((_a = kioskMediaFoundTypeVenue == null ? void 0 : kioskMediaFoundTypeVenue.url) == null ? void 0 : _a.length) > 0 ? kioskMediaFoundTypeVenue.url[0].value : null;
|
|
3741
|
-
return {
|
|
3742
|
-
url: localizedValue,
|
|
3743
|
-
fallbackUrl,
|
|
3744
|
-
mediaType: kioskMediaFoundTypeVenue == null ? void 0 : kioskMediaFoundTypeVenue.mediaType,
|
|
3745
|
-
isError,
|
|
3746
|
-
isLoading
|
|
3652
|
+
exports.pick = (input, filter, options) => {
|
|
3653
|
+
options = Object.assign({
|
|
3654
|
+
parseFragmentIdentifier: true,
|
|
3655
|
+
[encodeFragmentIdentifier]: false
|
|
3656
|
+
}, options);
|
|
3657
|
+
const { url, query, fragmentIdentifier } = exports.parseUrl(input, options);
|
|
3658
|
+
return exports.stringifyUrl({
|
|
3659
|
+
url,
|
|
3660
|
+
query: filterObject(query, filter),
|
|
3661
|
+
fragmentIdentifier
|
|
3662
|
+
}, options);
|
|
3747
3663
|
};
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
throw new Error("Missing config context");
|
|
3664
|
+
exports.exclude = (input, filter, options) => {
|
|
3665
|
+
const exclusionFilter = Array.isArray(filter) ? (key) => !filter.includes(key) : (key, value) => !filter(key, value);
|
|
3666
|
+
return exports.pick(input, exclusionFilter, options);
|
|
3667
|
+
};
|
|
3668
|
+
})(queryString);
|
|
3669
|
+
const supported = [".png", ".jpg", ".jpeg", ".webp", ".bmp", ".tiff"];
|
|
3670
|
+
function getMediaUrl(url, size = 500) {
|
|
3671
|
+
const link = queryString.parseUrl(url);
|
|
3672
|
+
if (!(url.startsWith("https://orderingstackmedia.blob.core.windows.net/pictures") || url.startsWith("https://orderingstack-mmedia-tools.azurewebsites.net/api/img/"))) {
|
|
3673
|
+
return url;
|
|
3759
3674
|
}
|
|
3760
|
-
const
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
withLocalStorage,
|
|
3768
|
-
venue,
|
|
3769
|
-
baseUrl: config.baseUrl,
|
|
3770
|
-
tenant: config.tenant,
|
|
3771
|
-
locale: language
|
|
3675
|
+
const extension = link.url.substring(link.url.lastIndexOf("."));
|
|
3676
|
+
if (!supported.includes(extension)) {
|
|
3677
|
+
return url;
|
|
3678
|
+
}
|
|
3679
|
+
return queryString.stringifyUrl({
|
|
3680
|
+
url: link.url.replace("https://orderingstackmedia.blob.core.windows.net/pictures/", "https://orderingstack-mmedia-tools.azurewebsites.net/api/img/"),
|
|
3681
|
+
query: { ...link.query, w: size }
|
|
3772
3682
|
});
|
|
3773
3683
|
}
|
|
3774
|
-
function
|
|
3775
|
-
|
|
3776
|
-
const listener = (event) => {
|
|
3777
|
-
if (!ref.current || ref.current.contains(event.target)) {
|
|
3778
|
-
return;
|
|
3779
|
-
}
|
|
3780
|
-
handler(event);
|
|
3781
|
-
};
|
|
3782
|
-
document.addEventListener("mousedown", listener);
|
|
3783
|
-
document.addEventListener("touchstart", listener);
|
|
3784
|
-
return () => {
|
|
3785
|
-
document.removeEventListener("mousedown", listener);
|
|
3786
|
-
document.removeEventListener("touchstart", listener);
|
|
3787
|
-
};
|
|
3788
|
-
}, [ref, handler]);
|
|
3789
|
-
}
|
|
3790
|
-
function useKioskChannelsAvailability(channelConstraints) {
|
|
3791
|
-
const [dineInOpen, setDineInOpen] = useState(isChannelOpen(channelConstraints == null ? void 0 : channelConstraints.DINE_IN));
|
|
3792
|
-
const [takeAwayOpen, setTakeAwayOpen] = useState(isChannelOpen(channelConstraints == null ? void 0 : channelConstraints.TAKE_AWAY));
|
|
3793
|
-
function checkOpen() {
|
|
3794
|
-
const dineIn = isChannelOpen(channelConstraints == null ? void 0 : channelConstraints.DINE_IN);
|
|
3795
|
-
const takeAway = isChannelOpen(channelConstraints == null ? void 0 : channelConstraints.TAKE_AWAY);
|
|
3796
|
-
if (dineIn !== dineInOpen) {
|
|
3797
|
-
console.log("dine in open changed", dineInOpen, "=>", dineIn);
|
|
3798
|
-
setDineInOpen(dineIn);
|
|
3799
|
-
}
|
|
3800
|
-
if (takeAway !== takeAwayOpen) {
|
|
3801
|
-
console.log("take away open changed", takeAwayOpen, "=>", takeAway);
|
|
3802
|
-
setTakeAwayOpen(takeAway);
|
|
3803
|
-
}
|
|
3804
|
-
}
|
|
3805
|
-
useEffect(() => {
|
|
3806
|
-
checkOpen();
|
|
3807
|
-
}, [channelConstraints]);
|
|
3808
|
-
useInterval(checkOpen, 6e4);
|
|
3809
|
-
return { dineInOpen, takeAwayOpen, loaded: !!channelConstraints };
|
|
3684
|
+
function useMediaUrl(url, size = 500) {
|
|
3685
|
+
return getMediaUrl(url, size);
|
|
3810
3686
|
}
|
|
3811
3687
|
function addDiscounts(discounts) {
|
|
3812
3688
|
let value = 0;
|