@shipengine/elements 0.9.1 → 0.9.4
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/components/configure-shipment/configure-shipment.d.ts +3 -4
- package/components/configure-shipment/hooks/use-address.d.ts +1 -1
- package/components/configure-shipment/hooks/use-customs.d.ts +1 -1
- package/components/configure-shipment/hooks/use-presets.d.ts +2 -2
- package/components/configure-shipment/hooks/use-rates-form.d.ts +1 -1
- package/components/configure-shipment/hooks/use-request-rates.d.ts +1 -1
- package/components/configure-shipment/hooks/use-shipment-form.d.ts +3 -3
- package/components/sales-order/hooks/use-configure-shipment.d.ts +1 -1
- package/components/sales-order/hooks/use-import-sales-order.d.ts +1 -1
- package/components/sales-order/hooks/use-pending-shipment.d.ts +2 -2
- package/components/sales-order/sales-order.d.ts +2 -3
- package/components/shipment/shipment.d.ts +2 -3
- package/components/void-label/void-label.d.ts +2 -3
- package/index.cjs +237 -217
- package/index.js +237 -217
- package/package.json +6 -6
- package/purchase-label.d.ts +1 -1
- package/view-shipment.d.ts +1 -1
- package/void-label.d.ts +1 -1
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useValidateAddresses, useUpdateShipment, useParseAddress, isDomesticAddress, useListCarriers, useListCustomPackageTypes, useCalculateRates, useCreateLabel, useListWarehouses, useListShipments, useCreateShipment, getPendingShipment, getIsCustomsRequiredForSalesOrder, getCustomsFromSalesOrder, useListSalesOrders, useListOrderSources, useRefreshOrderSource, registerElement, useGetShipment, useListLabels, useGetLabel, useVoidLabel } from '@shipengine/elements-core';
|
|
2
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { jsxs, Fragment, jsx } from '@emotion/react/jsx-runtime';
|
|
3
3
|
import { Templates, Loader } from '@shipengine/elements-ui';
|
|
4
4
|
import { useState, useCallback, useEffect } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
@@ -12,7 +12,7 @@ var check = function (it) {
|
|
|
12
12
|
|
|
13
13
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
14
14
|
var global$j =
|
|
15
|
-
// eslint-disable-next-line es
|
|
15
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
16
16
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
17
17
|
check(typeof window == 'object' && window) ||
|
|
18
18
|
// eslint-disable-next-line no-restricted-globals -- safe
|
|
@@ -35,14 +35,14 @@ var fails$c = fails$d;
|
|
|
35
35
|
|
|
36
36
|
// Detect IE8's incomplete defineProperty implementation
|
|
37
37
|
var descriptors = !fails$c(function () {
|
|
38
|
-
// eslint-disable-next-line es
|
|
38
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
39
39
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
var fails$b = fails$d;
|
|
43
43
|
|
|
44
44
|
var functionBindNative = !fails$b(function () {
|
|
45
|
-
// eslint-disable-next-line es
|
|
45
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
46
46
|
var test = (function () { /* empty */ }).bind();
|
|
47
47
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
48
48
|
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
@@ -59,7 +59,7 @@ var functionCall = NATIVE_BIND$3 ? call$e.bind(call$e) : function () {
|
|
|
59
59
|
var objectPropertyIsEnumerable = {};
|
|
60
60
|
|
|
61
61
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
62
|
-
// eslint-disable-next-line es
|
|
62
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
63
63
|
var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
|
|
64
64
|
|
|
65
65
|
// Nashorn ~ JDK8 bug
|
|
@@ -84,14 +84,11 @@ var createPropertyDescriptor$3 = function (bitmap, value) {
|
|
|
84
84
|
var NATIVE_BIND$2 = functionBindNative;
|
|
85
85
|
|
|
86
86
|
var FunctionPrototype$2 = Function.prototype;
|
|
87
|
-
var bind$6 = FunctionPrototype$2.bind;
|
|
88
87
|
var call$d = FunctionPrototype$2.call;
|
|
89
|
-
var
|
|
88
|
+
var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$d, call$d);
|
|
90
89
|
|
|
91
|
-
var functionUncurryThis = NATIVE_BIND$2 ? function (fn) {
|
|
92
|
-
return
|
|
93
|
-
} : function (fn) {
|
|
94
|
-
return fn && function () {
|
|
90
|
+
var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
|
|
91
|
+
return function () {
|
|
95
92
|
return call$d.apply(fn, arguments);
|
|
96
93
|
};
|
|
97
94
|
};
|
|
@@ -101,13 +98,13 @@ var uncurryThis$d = functionUncurryThis;
|
|
|
101
98
|
var toString$1 = uncurryThis$d({}.toString);
|
|
102
99
|
var stringSlice = uncurryThis$d(''.slice);
|
|
103
100
|
|
|
104
|
-
var classofRaw$
|
|
101
|
+
var classofRaw$2 = function (it) {
|
|
105
102
|
return stringSlice(toString$1(it), 8, -1);
|
|
106
103
|
};
|
|
107
104
|
|
|
108
105
|
var uncurryThis$c = functionUncurryThis;
|
|
109
106
|
var fails$a = fails$d;
|
|
110
|
-
var classof$5 = classofRaw$
|
|
107
|
+
var classof$5 = classofRaw$2;
|
|
111
108
|
|
|
112
109
|
var $Object$4 = Object;
|
|
113
110
|
var split = uncurryThis$c(''.split);
|
|
@@ -121,12 +118,20 @@ var indexedObject = fails$a(function () {
|
|
|
121
118
|
return classof$5(it) == 'String' ? split(it, '') : $Object$4(it);
|
|
122
119
|
} : $Object$4;
|
|
123
120
|
|
|
124
|
-
|
|
121
|
+
// we can't use just `it == null` since of `document.all` special case
|
|
122
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
123
|
+
var isNullOrUndefined$4 = function (it) {
|
|
124
|
+
return it === null || it === undefined;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
var isNullOrUndefined$3 = isNullOrUndefined$4;
|
|
128
|
+
|
|
129
|
+
var $TypeError$d = TypeError;
|
|
125
130
|
|
|
126
131
|
// `RequireObjectCoercible` abstract operation
|
|
127
132
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
128
133
|
var requireObjectCoercible$2 = function (it) {
|
|
129
|
-
if (it
|
|
134
|
+
if (isNullOrUndefined$3(it)) throw $TypeError$d("Can't call method on " + it);
|
|
130
135
|
return it;
|
|
131
136
|
};
|
|
132
137
|
|
|
@@ -138,15 +143,36 @@ var toIndexedObject$5 = function (it) {
|
|
|
138
143
|
return IndexedObject$1(requireObjectCoercible$1(it));
|
|
139
144
|
};
|
|
140
145
|
|
|
146
|
+
var documentAll$2 = typeof document == 'object' && document.all;
|
|
147
|
+
|
|
148
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
149
|
+
var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
|
150
|
+
|
|
151
|
+
var documentAll_1 = {
|
|
152
|
+
all: documentAll$2,
|
|
153
|
+
IS_HTMLDDA: IS_HTMLDDA
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
var $documentAll$1 = documentAll_1;
|
|
157
|
+
|
|
158
|
+
var documentAll$1 = $documentAll$1.all;
|
|
159
|
+
|
|
141
160
|
// `IsCallable` abstract operation
|
|
142
161
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
143
|
-
var isCallable$k = function (argument) {
|
|
162
|
+
var isCallable$k = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
|
163
|
+
return typeof argument == 'function' || argument === documentAll$1;
|
|
164
|
+
} : function (argument) {
|
|
144
165
|
return typeof argument == 'function';
|
|
145
166
|
};
|
|
146
167
|
|
|
147
168
|
var isCallable$j = isCallable$k;
|
|
169
|
+
var $documentAll = documentAll_1;
|
|
170
|
+
|
|
171
|
+
var documentAll = $documentAll.all;
|
|
148
172
|
|
|
149
|
-
var isObject$
|
|
173
|
+
var isObject$9 = $documentAll.IS_HTMLDDA ? function (it) {
|
|
174
|
+
return typeof it == 'object' ? it !== null : isCallable$j(it) || it === documentAll;
|
|
175
|
+
} : function (it) {
|
|
150
176
|
return typeof it == 'object' ? it !== null : isCallable$j(it);
|
|
151
177
|
};
|
|
152
178
|
|
|
@@ -197,13 +223,13 @@ if (!version && userAgent$3) {
|
|
|
197
223
|
|
|
198
224
|
var engineV8Version = version;
|
|
199
225
|
|
|
200
|
-
/* eslint-disable es
|
|
226
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
201
227
|
|
|
202
228
|
var V8_VERSION$1 = engineV8Version;
|
|
203
229
|
var fails$9 = fails$d;
|
|
204
230
|
|
|
205
|
-
// eslint-disable-next-line es
|
|
206
|
-
var
|
|
231
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
232
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$9(function () {
|
|
207
233
|
var symbol = Symbol();
|
|
208
234
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
209
235
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
@@ -212,9 +238,9 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$9(function () {
|
|
|
212
238
|
!Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
|
|
213
239
|
});
|
|
214
240
|
|
|
215
|
-
/* eslint-disable es
|
|
241
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
216
242
|
|
|
217
|
-
var NATIVE_SYMBOL$1 =
|
|
243
|
+
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
218
244
|
|
|
219
245
|
var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
220
246
|
&& !Symbol.sham
|
|
@@ -247,44 +273,45 @@ var tryToString$4 = function (argument) {
|
|
|
247
273
|
var isCallable$g = isCallable$k;
|
|
248
274
|
var tryToString$3 = tryToString$4;
|
|
249
275
|
|
|
250
|
-
var $TypeError$
|
|
276
|
+
var $TypeError$c = TypeError;
|
|
251
277
|
|
|
252
278
|
// `Assert: IsCallable(argument) is true`
|
|
253
279
|
var aCallable$8 = function (argument) {
|
|
254
280
|
if (isCallable$g(argument)) return argument;
|
|
255
|
-
throw $TypeError$
|
|
281
|
+
throw $TypeError$c(tryToString$3(argument) + ' is not a function');
|
|
256
282
|
};
|
|
257
283
|
|
|
258
284
|
var aCallable$7 = aCallable$8;
|
|
285
|
+
var isNullOrUndefined$2 = isNullOrUndefined$4;
|
|
259
286
|
|
|
260
287
|
// `GetMethod` abstract operation
|
|
261
288
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
262
289
|
var getMethod$3 = function (V, P) {
|
|
263
290
|
var func = V[P];
|
|
264
|
-
return func
|
|
291
|
+
return isNullOrUndefined$2(func) ? undefined : aCallable$7(func);
|
|
265
292
|
};
|
|
266
293
|
|
|
267
294
|
var call$c = functionCall;
|
|
268
295
|
var isCallable$f = isCallable$k;
|
|
269
|
-
var isObject$
|
|
296
|
+
var isObject$8 = isObject$9;
|
|
270
297
|
|
|
271
|
-
var $TypeError$
|
|
298
|
+
var $TypeError$b = TypeError;
|
|
272
299
|
|
|
273
300
|
// `OrdinaryToPrimitive` abstract operation
|
|
274
301
|
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
275
302
|
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
276
303
|
var fn, val;
|
|
277
|
-
if (pref === 'string' && isCallable$f(fn = input.toString) && !isObject$
|
|
278
|
-
if (isCallable$f(fn = input.valueOf) && !isObject$
|
|
279
|
-
if (pref !== 'string' && isCallable$f(fn = input.toString) && !isObject$
|
|
280
|
-
throw $TypeError$
|
|
304
|
+
if (pref === 'string' && isCallable$f(fn = input.toString) && !isObject$8(val = call$c(fn, input))) return val;
|
|
305
|
+
if (isCallable$f(fn = input.valueOf) && !isObject$8(val = call$c(fn, input))) return val;
|
|
306
|
+
if (pref !== 'string' && isCallable$f(fn = input.toString) && !isObject$8(val = call$c(fn, input))) return val;
|
|
307
|
+
throw $TypeError$b("Can't convert object to primitive value");
|
|
281
308
|
};
|
|
282
309
|
|
|
283
310
|
var shared$3 = {exports: {}};
|
|
284
311
|
|
|
285
312
|
var global$g = global$j;
|
|
286
313
|
|
|
287
|
-
// eslint-disable-next-line es
|
|
314
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
288
315
|
var defineProperty$5 = Object.defineProperty;
|
|
289
316
|
|
|
290
317
|
var defineGlobalProperty$3 = function (key, value) {
|
|
@@ -308,10 +335,10 @@ var store$2 = sharedStore;
|
|
|
308
335
|
(shared$3.exports = function (key, value) {
|
|
309
336
|
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
310
337
|
})('versions', []).push({
|
|
311
|
-
version: '3.
|
|
338
|
+
version: '3.26.1',
|
|
312
339
|
mode: 'global',
|
|
313
340
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
314
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
341
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',
|
|
315
342
|
source: 'https://github.com/zloirock/core-js'
|
|
316
343
|
});
|
|
317
344
|
|
|
@@ -332,7 +359,7 @@ var hasOwnProperty = uncurryThis$a({}.hasOwnProperty);
|
|
|
332
359
|
|
|
333
360
|
// `HasOwnProperty` abstract operation
|
|
334
361
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
335
|
-
// eslint-disable-next-line es
|
|
362
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
336
363
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
337
364
|
return hasOwnProperty(toObject$3(it), key);
|
|
338
365
|
};
|
|
@@ -351,7 +378,7 @@ var global$e = global$j;
|
|
|
351
378
|
var shared$2 = shared$3.exports;
|
|
352
379
|
var hasOwn$9 = hasOwnProperty_1;
|
|
353
380
|
var uid$1 = uid$2;
|
|
354
|
-
var NATIVE_SYMBOL =
|
|
381
|
+
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
355
382
|
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
356
383
|
|
|
357
384
|
var WellKnownSymbolsStore = shared$2('wks');
|
|
@@ -373,26 +400,26 @@ var wellKnownSymbol$f = function (name) {
|
|
|
373
400
|
};
|
|
374
401
|
|
|
375
402
|
var call$b = functionCall;
|
|
376
|
-
var isObject$
|
|
403
|
+
var isObject$7 = isObject$9;
|
|
377
404
|
var isSymbol$1 = isSymbol$2;
|
|
378
405
|
var getMethod$2 = getMethod$3;
|
|
379
406
|
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
380
407
|
var wellKnownSymbol$e = wellKnownSymbol$f;
|
|
381
408
|
|
|
382
|
-
var $TypeError$
|
|
409
|
+
var $TypeError$a = TypeError;
|
|
383
410
|
var TO_PRIMITIVE = wellKnownSymbol$e('toPrimitive');
|
|
384
411
|
|
|
385
412
|
// `ToPrimitive` abstract operation
|
|
386
413
|
// https://tc39.es/ecma262/#sec-toprimitive
|
|
387
414
|
var toPrimitive$1 = function (input, pref) {
|
|
388
|
-
if (!isObject$
|
|
415
|
+
if (!isObject$7(input) || isSymbol$1(input)) return input;
|
|
389
416
|
var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
|
|
390
417
|
var result;
|
|
391
418
|
if (exoticToPrim) {
|
|
392
419
|
if (pref === undefined) pref = 'default';
|
|
393
420
|
result = call$b(exoticToPrim, input, pref);
|
|
394
|
-
if (!isObject$
|
|
395
|
-
throw $TypeError$
|
|
421
|
+
if (!isObject$7(result) || isSymbol$1(result)) return result;
|
|
422
|
+
throw $TypeError$a("Can't convert object to primitive value");
|
|
396
423
|
}
|
|
397
424
|
if (pref === undefined) pref = 'number';
|
|
398
425
|
return ordinaryToPrimitive(input, pref);
|
|
@@ -409,11 +436,11 @@ var toPropertyKey$2 = function (argument) {
|
|
|
409
436
|
};
|
|
410
437
|
|
|
411
438
|
var global$d = global$j;
|
|
412
|
-
var isObject$
|
|
439
|
+
var isObject$6 = isObject$9;
|
|
413
440
|
|
|
414
441
|
var document$3 = global$d.document;
|
|
415
442
|
// typeof document.createElement is 'object' in old IE
|
|
416
|
-
var EXISTS$1 = isObject$
|
|
443
|
+
var EXISTS$1 = isObject$6(document$3) && isObject$6(document$3.createElement);
|
|
417
444
|
|
|
418
445
|
var documentCreateElement$2 = function (it) {
|
|
419
446
|
return EXISTS$1 ? document$3.createElement(it) : {};
|
|
@@ -425,7 +452,7 @@ var createElement$1 = documentCreateElement$2;
|
|
|
425
452
|
|
|
426
453
|
// Thanks to IE8 for its funny defineProperty
|
|
427
454
|
var ie8DomDefine = !DESCRIPTORS$a && !fails$8(function () {
|
|
428
|
-
// eslint-disable-next-line es
|
|
455
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
429
456
|
return Object.defineProperty(createElement$1('div'), 'a', {
|
|
430
457
|
get: function () { return 7; }
|
|
431
458
|
}).a != 7;
|
|
@@ -440,7 +467,7 @@ var toPropertyKey$1 = toPropertyKey$2;
|
|
|
440
467
|
var hasOwn$8 = hasOwnProperty_1;
|
|
441
468
|
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
442
469
|
|
|
443
|
-
// eslint-disable-next-line es
|
|
470
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
444
471
|
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
445
472
|
|
|
446
473
|
// `Object.getOwnPropertyDescriptor` method
|
|
@@ -462,22 +489,22 @@ var fails$7 = fails$d;
|
|
|
462
489
|
// V8 ~ Chrome 36-
|
|
463
490
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
464
491
|
var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$7(function () {
|
|
465
|
-
// eslint-disable-next-line es
|
|
492
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
466
493
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
467
494
|
value: 42,
|
|
468
495
|
writable: false
|
|
469
496
|
}).prototype != 42;
|
|
470
497
|
});
|
|
471
498
|
|
|
472
|
-
var isObject$
|
|
499
|
+
var isObject$5 = isObject$9;
|
|
473
500
|
|
|
474
501
|
var $String$1 = String;
|
|
475
|
-
var $TypeError$
|
|
502
|
+
var $TypeError$9 = TypeError;
|
|
476
503
|
|
|
477
504
|
// `Assert: Type(argument) is Object`
|
|
478
505
|
var anObject$a = function (argument) {
|
|
479
|
-
if (isObject$
|
|
480
|
-
throw $TypeError$
|
|
506
|
+
if (isObject$5(argument)) return argument;
|
|
507
|
+
throw $TypeError$9($String$1(argument) + ' is not an object');
|
|
481
508
|
};
|
|
482
509
|
|
|
483
510
|
var DESCRIPTORS$7 = descriptors;
|
|
@@ -486,10 +513,10 @@ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
|
486
513
|
var anObject$9 = anObject$a;
|
|
487
514
|
var toPropertyKey = toPropertyKey$2;
|
|
488
515
|
|
|
489
|
-
var $TypeError$
|
|
490
|
-
// eslint-disable-next-line es
|
|
516
|
+
var $TypeError$8 = TypeError;
|
|
517
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
491
518
|
var $defineProperty = Object.defineProperty;
|
|
492
|
-
// eslint-disable-next-line es
|
|
519
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
493
520
|
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
494
521
|
var ENUMERABLE = 'enumerable';
|
|
495
522
|
var CONFIGURABLE$1 = 'configurable';
|
|
@@ -519,7 +546,7 @@ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
|
|
|
519
546
|
if (IE8_DOM_DEFINE) try {
|
|
520
547
|
return $defineProperty(O, P, Attributes);
|
|
521
548
|
} catch (error) { /* empty */ }
|
|
522
|
-
if ('get' in Attributes || 'set' in Attributes) throw $TypeError$
|
|
549
|
+
if ('get' in Attributes || 'set' in Attributes) throw $TypeError$8('Accessors not supported');
|
|
523
550
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
524
551
|
return O;
|
|
525
552
|
};
|
|
@@ -541,7 +568,7 @@ var DESCRIPTORS$5 = descriptors;
|
|
|
541
568
|
var hasOwn$7 = hasOwnProperty_1;
|
|
542
569
|
|
|
543
570
|
var FunctionPrototype$1 = Function.prototype;
|
|
544
|
-
// eslint-disable-next-line es
|
|
571
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
545
572
|
var getDescriptor = DESCRIPTORS$5 && Object.getOwnPropertyDescriptor;
|
|
546
573
|
|
|
547
574
|
var EXISTS = hasOwn$7(FunctionPrototype$1, 'name');
|
|
@@ -568,15 +595,14 @@ if (!isCallable$e(store$1.inspectSource)) {
|
|
|
568
595
|
};
|
|
569
596
|
}
|
|
570
597
|
|
|
571
|
-
var inspectSource$
|
|
598
|
+
var inspectSource$3 = store$1.inspectSource;
|
|
572
599
|
|
|
573
600
|
var global$c = global$j;
|
|
574
601
|
var isCallable$d = isCallable$k;
|
|
575
|
-
var inspectSource$3 = inspectSource$4;
|
|
576
602
|
|
|
577
603
|
var WeakMap$1 = global$c.WeakMap;
|
|
578
604
|
|
|
579
|
-
var
|
|
605
|
+
var weakMapBasicDetection = isCallable$d(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
580
606
|
|
|
581
607
|
var shared$1 = shared$3.exports;
|
|
582
608
|
var uid = uid$2;
|
|
@@ -589,10 +615,9 @@ var sharedKey$3 = function (key) {
|
|
|
589
615
|
|
|
590
616
|
var hiddenKeys$4 = {};
|
|
591
617
|
|
|
592
|
-
var NATIVE_WEAK_MAP =
|
|
618
|
+
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
593
619
|
var global$b = global$j;
|
|
594
|
-
var
|
|
595
|
-
var isObject$3 = isObject$8;
|
|
620
|
+
var isObject$4 = isObject$9;
|
|
596
621
|
var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
|
|
597
622
|
var hasOwn$6 = hasOwnProperty_1;
|
|
598
623
|
var shared = sharedStore;
|
|
@@ -611,7 +636,7 @@ var enforce = function (it) {
|
|
|
611
636
|
var getterFor = function (TYPE) {
|
|
612
637
|
return function (it) {
|
|
613
638
|
var state;
|
|
614
|
-
if (!isObject$
|
|
639
|
+
if (!isObject$4(it) || (state = get(it)).type !== TYPE) {
|
|
615
640
|
throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
|
|
616
641
|
} return state;
|
|
617
642
|
};
|
|
@@ -619,26 +644,28 @@ var getterFor = function (TYPE) {
|
|
|
619
644
|
|
|
620
645
|
if (NATIVE_WEAK_MAP || shared.state) {
|
|
621
646
|
var store = shared.state || (shared.state = new WeakMap());
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
647
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
648
|
+
store.get = store.get;
|
|
649
|
+
store.has = store.has;
|
|
650
|
+
store.set = store.set;
|
|
651
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
625
652
|
set$1 = function (it, metadata) {
|
|
626
|
-
if (
|
|
653
|
+
if (store.has(it)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
|
|
627
654
|
metadata.facade = it;
|
|
628
|
-
|
|
655
|
+
store.set(it, metadata);
|
|
629
656
|
return metadata;
|
|
630
657
|
};
|
|
631
658
|
get = function (it) {
|
|
632
|
-
return
|
|
659
|
+
return store.get(it) || {};
|
|
633
660
|
};
|
|
634
661
|
has = function (it) {
|
|
635
|
-
return
|
|
662
|
+
return store.has(it);
|
|
636
663
|
};
|
|
637
664
|
} else {
|
|
638
665
|
var STATE = sharedKey$2('state');
|
|
639
666
|
hiddenKeys$3[STATE] = true;
|
|
640
667
|
set$1 = function (it, metadata) {
|
|
641
|
-
if (hasOwn$6(it, STATE)) throw
|
|
668
|
+
if (hasOwn$6(it, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
|
|
642
669
|
metadata.facade = it;
|
|
643
670
|
createNonEnumerableProperty$3(it, STATE, metadata);
|
|
644
671
|
return metadata;
|
|
@@ -664,12 +691,12 @@ var isCallable$c = isCallable$k;
|
|
|
664
691
|
var hasOwn$5 = hasOwnProperty_1;
|
|
665
692
|
var DESCRIPTORS$4 = descriptors;
|
|
666
693
|
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
|
667
|
-
var inspectSource$2 = inspectSource$
|
|
694
|
+
var inspectSource$2 = inspectSource$3;
|
|
668
695
|
var InternalStateModule$2 = internalState;
|
|
669
696
|
|
|
670
697
|
var enforceInternalState = InternalStateModule$2.enforce;
|
|
671
698
|
var getInternalState$1 = InternalStateModule$2.get;
|
|
672
|
-
// eslint-disable-next-line es
|
|
699
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
673
700
|
var defineProperty$4 = Object.defineProperty;
|
|
674
701
|
|
|
675
702
|
var CONFIGURABLE_LENGTH = DESCRIPTORS$4 && !fails$6(function () {
|
|
@@ -744,7 +771,7 @@ var floor = Math.floor;
|
|
|
744
771
|
|
|
745
772
|
// `Math.trunc` method
|
|
746
773
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
747
|
-
// eslint-disable-next-line es
|
|
774
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
748
775
|
var mathTrunc = Math.trunc || function trunc(x) {
|
|
749
776
|
var n = +x;
|
|
750
777
|
return (n > 0 ? floor : ceil)(n);
|
|
@@ -824,13 +851,13 @@ var arrayIncludes = {
|
|
|
824
851
|
indexOf: createMethod(false)
|
|
825
852
|
};
|
|
826
853
|
|
|
827
|
-
var uncurryThis$
|
|
854
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
828
855
|
var hasOwn$4 = hasOwnProperty_1;
|
|
829
856
|
var toIndexedObject$2 = toIndexedObject$5;
|
|
830
857
|
var indexOf = arrayIncludes.indexOf;
|
|
831
858
|
var hiddenKeys$2 = hiddenKeys$4;
|
|
832
859
|
|
|
833
|
-
var push = uncurryThis$
|
|
860
|
+
var push = uncurryThis$7([].push);
|
|
834
861
|
|
|
835
862
|
var objectKeysInternal = function (object, names) {
|
|
836
863
|
var O = toIndexedObject$2(object);
|
|
@@ -863,23 +890,23 @@ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
|
|
863
890
|
|
|
864
891
|
// `Object.getOwnPropertyNames` method
|
|
865
892
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
866
|
-
// eslint-disable-next-line es
|
|
893
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
867
894
|
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
868
895
|
return internalObjectKeys$1(O, hiddenKeys$1);
|
|
869
896
|
};
|
|
870
897
|
|
|
871
898
|
var objectGetOwnPropertySymbols = {};
|
|
872
899
|
|
|
873
|
-
// eslint-disable-next-line es
|
|
900
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
874
901
|
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
875
902
|
|
|
876
903
|
var getBuiltIn$5 = getBuiltIn$8;
|
|
877
|
-
var uncurryThis$
|
|
904
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
878
905
|
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
879
906
|
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
880
907
|
var anObject$8 = anObject$a;
|
|
881
908
|
|
|
882
|
-
var concat$1 = uncurryThis$
|
|
909
|
+
var concat$1 = uncurryThis$6([].concat);
|
|
883
910
|
|
|
884
911
|
// all object keys, includes non-enumerable and symbols
|
|
885
912
|
var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
@@ -988,13 +1015,13 @@ var enumBugKeys$1 = enumBugKeys$3;
|
|
|
988
1015
|
|
|
989
1016
|
// `Object.keys` method
|
|
990
1017
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
991
|
-
// eslint-disable-next-line es
|
|
1018
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
992
1019
|
var objectKeys$2 = Object.keys || function keys(O) {
|
|
993
1020
|
return internalObjectKeys(O, enumBugKeys$1);
|
|
994
1021
|
};
|
|
995
1022
|
|
|
996
1023
|
var DESCRIPTORS$3 = descriptors;
|
|
997
|
-
var uncurryThis$
|
|
1024
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
998
1025
|
var call$9 = functionCall;
|
|
999
1026
|
var fails$4 = fails$d;
|
|
1000
1027
|
var objectKeys$1 = objectKeys$2;
|
|
@@ -1003,11 +1030,11 @@ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
|
1003
1030
|
var toObject$2 = toObject$4;
|
|
1004
1031
|
var IndexedObject = indexedObject;
|
|
1005
1032
|
|
|
1006
|
-
// eslint-disable-next-line es
|
|
1033
|
+
// eslint-disable-next-line es/no-object-assign -- safe
|
|
1007
1034
|
var $assign = Object.assign;
|
|
1008
|
-
// eslint-disable-next-line es
|
|
1035
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1009
1036
|
var defineProperty$3 = Object.defineProperty;
|
|
1010
|
-
var concat = uncurryThis$
|
|
1037
|
+
var concat = uncurryThis$5([].concat);
|
|
1011
1038
|
|
|
1012
1039
|
// `Object.assign` method
|
|
1013
1040
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
@@ -1025,7 +1052,7 @@ var objectAssign = !$assign || fails$4(function () {
|
|
|
1025
1052
|
// should work with symbols and should have deterministic property order (V8 bug)
|
|
1026
1053
|
var A = {};
|
|
1027
1054
|
var B = {};
|
|
1028
|
-
// eslint-disable-next-line es
|
|
1055
|
+
// eslint-disable-next-line es/no-symbol -- safe
|
|
1029
1056
|
var symbol = Symbol();
|
|
1030
1057
|
var alphabet = 'abcdefghijklmnopqrst';
|
|
1031
1058
|
A[symbol] = 7;
|
|
@@ -1055,7 +1082,7 @@ var assign = objectAssign;
|
|
|
1055
1082
|
|
|
1056
1083
|
// `Object.assign` method
|
|
1057
1084
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
1058
|
-
// eslint-disable-next-line es
|
|
1085
|
+
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1059
1086
|
$$8({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
1060
1087
|
assign: assign
|
|
1061
1088
|
});
|
|
@@ -1108,7 +1135,7 @@ var objectKeys = objectKeys$2;
|
|
|
1108
1135
|
|
|
1109
1136
|
// `Object.defineProperties` method
|
|
1110
1137
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1111
|
-
// eslint-disable-next-line es
|
|
1138
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1112
1139
|
objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1113
1140
|
anObject$7(O);
|
|
1114
1141
|
var props = toIndexedObject$1(Properties);
|
|
@@ -1196,7 +1223,7 @@ hiddenKeys[IE_PROTO$1] = true;
|
|
|
1196
1223
|
|
|
1197
1224
|
// `Object.create` method
|
|
1198
1225
|
// https://tc39.es/ecma262/#sec-object.create
|
|
1199
|
-
// eslint-disable-next-line es
|
|
1226
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
1200
1227
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
1201
1228
|
var result;
|
|
1202
1229
|
if (O !== null) {
|
|
@@ -1237,7 +1264,7 @@ var fails$3 = fails$d;
|
|
|
1237
1264
|
var correctPrototypeGetter = !fails$3(function () {
|
|
1238
1265
|
function F() { /* empty */ }
|
|
1239
1266
|
F.prototype.constructor = null;
|
|
1240
|
-
// eslint-disable-next-line es
|
|
1267
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
1241
1268
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
1242
1269
|
});
|
|
1243
1270
|
|
|
@@ -1253,7 +1280,7 @@ var ObjectPrototype = $Object$1.prototype;
|
|
|
1253
1280
|
|
|
1254
1281
|
// `Object.getPrototypeOf` method
|
|
1255
1282
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1256
|
-
// eslint-disable-next-line es
|
|
1283
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
1257
1284
|
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
|
|
1258
1285
|
var object = toObject$1(O);
|
|
1259
1286
|
if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
|
|
@@ -1265,6 +1292,7 @@ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf :
|
|
|
1265
1292
|
|
|
1266
1293
|
var fails$2 = fails$d;
|
|
1267
1294
|
var isCallable$8 = isCallable$k;
|
|
1295
|
+
var isObject$3 = isObject$9;
|
|
1268
1296
|
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1269
1297
|
var defineBuiltIn$3 = defineBuiltIn$5;
|
|
1270
1298
|
var wellKnownSymbol$c = wellKnownSymbol$f;
|
|
@@ -1276,7 +1304,7 @@ var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
|
1276
1304
|
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
1277
1305
|
var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
1278
1306
|
|
|
1279
|
-
/* eslint-disable es
|
|
1307
|
+
/* eslint-disable es/no-array-prototype-keys -- safe */
|
|
1280
1308
|
if ([].keys) {
|
|
1281
1309
|
arrayIterator = [].keys();
|
|
1282
1310
|
// Safari 8 has buggy iterators w/o `next`
|
|
@@ -1287,7 +1315,7 @@ if ([].keys) {
|
|
|
1287
1315
|
}
|
|
1288
1316
|
}
|
|
1289
1317
|
|
|
1290
|
-
var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2
|
|
1318
|
+
var NEW_ITERATOR_PROTOTYPE = !isObject$3(IteratorPrototype$2) || fails$2(function () {
|
|
1291
1319
|
var test = {};
|
|
1292
1320
|
// FF44- legacy iterators case
|
|
1293
1321
|
return IteratorPrototype$2[ITERATOR$5].call(test) !== test;
|
|
@@ -1329,7 +1357,7 @@ var Iterators$4 = iterators;
|
|
|
1329
1357
|
|
|
1330
1358
|
var returnThis$1 = function () { return this; };
|
|
1331
1359
|
|
|
1332
|
-
var
|
|
1360
|
+
var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1333
1361
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1334
1362
|
IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1335
1363
|
setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
|
|
@@ -1340,30 +1368,30 @@ var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENU
|
|
|
1340
1368
|
var isCallable$7 = isCallable$k;
|
|
1341
1369
|
|
|
1342
1370
|
var $String = String;
|
|
1343
|
-
var $TypeError$
|
|
1371
|
+
var $TypeError$7 = TypeError;
|
|
1344
1372
|
|
|
1345
1373
|
var aPossiblePrototype$1 = function (argument) {
|
|
1346
1374
|
if (typeof argument == 'object' || isCallable$7(argument)) return argument;
|
|
1347
|
-
throw $TypeError$
|
|
1375
|
+
throw $TypeError$7("Can't set " + $String(argument) + ' as a prototype');
|
|
1348
1376
|
};
|
|
1349
1377
|
|
|
1350
1378
|
/* eslint-disable no-proto -- safe */
|
|
1351
1379
|
|
|
1352
|
-
var uncurryThis$
|
|
1380
|
+
var uncurryThis$4 = functionUncurryThis;
|
|
1353
1381
|
var anObject$5 = anObject$a;
|
|
1354
1382
|
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1355
1383
|
|
|
1356
1384
|
// `Object.setPrototypeOf` method
|
|
1357
1385
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
1358
1386
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
1359
|
-
// eslint-disable-next-line es
|
|
1387
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
1360
1388
|
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
1361
1389
|
var CORRECT_SETTER = false;
|
|
1362
1390
|
var test = {};
|
|
1363
1391
|
var setter;
|
|
1364
1392
|
try {
|
|
1365
|
-
// eslint-disable-next-line es
|
|
1366
|
-
setter = uncurryThis$
|
|
1393
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1394
|
+
setter = uncurryThis$4(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1367
1395
|
setter(test, []);
|
|
1368
1396
|
CORRECT_SETTER = test instanceof Array;
|
|
1369
1397
|
} catch (error) { /* empty */ }
|
|
@@ -1380,7 +1408,7 @@ var $$7 = _export;
|
|
|
1380
1408
|
var call$8 = functionCall;
|
|
1381
1409
|
var FunctionName = functionName;
|
|
1382
1410
|
var isCallable$6 = isCallable$k;
|
|
1383
|
-
var createIteratorConstructor =
|
|
1411
|
+
var createIteratorConstructor = iteratorCreateConstructor;
|
|
1384
1412
|
var getPrototypeOf = objectGetPrototypeOf;
|
|
1385
1413
|
var setPrototypeOf$1 = objectSetPrototypeOf;
|
|
1386
1414
|
var setToStringTag$1 = setToStringTag$3;
|
|
@@ -1401,7 +1429,7 @@ var ENTRIES = 'entries';
|
|
|
1401
1429
|
|
|
1402
1430
|
var returnThis = function () { return this; };
|
|
1403
1431
|
|
|
1404
|
-
var
|
|
1432
|
+
var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
|
1405
1433
|
createIteratorConstructor(IteratorConstructor, NAME, next);
|
|
1406
1434
|
|
|
1407
1435
|
var getIterationMethod = function (KIND) {
|
|
@@ -1473,12 +1501,19 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
|
|
|
1473
1501
|
return methods;
|
|
1474
1502
|
};
|
|
1475
1503
|
|
|
1504
|
+
// `CreateIterResultObject` abstract operation
|
|
1505
|
+
// https://tc39.es/ecma262/#sec-createiterresultobject
|
|
1506
|
+
var createIterResultObject$1 = function (value, done) {
|
|
1507
|
+
return { value: value, done: done };
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1476
1510
|
var toIndexedObject = toIndexedObject$5;
|
|
1477
1511
|
var addToUnscopables$1 = addToUnscopables$2;
|
|
1478
1512
|
var Iterators$2 = iterators;
|
|
1479
1513
|
var InternalStateModule$1 = internalState;
|
|
1480
1514
|
var defineProperty = objectDefineProperty.f;
|
|
1481
|
-
var defineIterator =
|
|
1515
|
+
var defineIterator = iteratorDefine;
|
|
1516
|
+
var createIterResultObject = createIterResultObject$1;
|
|
1482
1517
|
var DESCRIPTORS$1 = descriptors;
|
|
1483
1518
|
|
|
1484
1519
|
var ARRAY_ITERATOR = 'Array Iterator';
|
|
@@ -1511,11 +1546,11 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
|
|
|
1511
1546
|
var index = state.index++;
|
|
1512
1547
|
if (!target || index >= target.length) {
|
|
1513
1548
|
state.target = undefined;
|
|
1514
|
-
return
|
|
1549
|
+
return createIterResultObject(undefined, true);
|
|
1515
1550
|
}
|
|
1516
|
-
if (kind == 'keys') return
|
|
1517
|
-
if (kind == 'values') return
|
|
1518
|
-
return
|
|
1551
|
+
if (kind == 'keys') return createIterResultObject(index, false);
|
|
1552
|
+
if (kind == 'values') return createIterResultObject(target[index], false);
|
|
1553
|
+
return createIterResultObject([index, target[index]], false);
|
|
1519
1554
|
}, 'values');
|
|
1520
1555
|
|
|
1521
1556
|
// argumentsList[@@iterator] is %ArrayProto_values%
|
|
@@ -18827,7 +18862,6 @@ const useAddress = ({
|
|
|
18827
18862
|
}) => {
|
|
18828
18863
|
const {
|
|
18829
18864
|
errors: validateAddressErrors,
|
|
18830
|
-
isMutating: isAddressValidating,
|
|
18831
18865
|
trigger: validateAddresses
|
|
18832
18866
|
} = useValidateAddresses();
|
|
18833
18867
|
const {
|
|
@@ -18862,9 +18896,9 @@ const useAddress = ({
|
|
|
18862
18896
|
matchedAddress,
|
|
18863
18897
|
originalAddress,
|
|
18864
18898
|
status
|
|
18865
|
-
} = validation;
|
|
18899
|
+
} = validation;
|
|
18900
|
+
// If the address is domestic, we always default to the matchedAddress if it exists.
|
|
18866
18901
|
// If the address is international, we always default to the original due to issues with SE-API's validation
|
|
18867
|
-
|
|
18868
18902
|
const selectionSource = isDomesticAddress(originalAddress) && status !== "error" ? matchedAddress ? "matchedAddress" : "originalAddress" : "originalAddress";
|
|
18869
18903
|
const alternativeSource = selectionSource === "matchedAddress" ? "originalAddress" : "matchedAddress";
|
|
18870
18904
|
const newAddressPreference = Object.assign(Object.assign(Object.assign({}, validation), _.isEqual(originalAddress, matchedAddress) ? {
|
|
@@ -18891,7 +18925,6 @@ const useAddress = ({
|
|
|
18891
18925
|
setAddressPreference(updatedAddressPreference);
|
|
18892
18926
|
return updatedAddressPreference;
|
|
18893
18927
|
}, [toggle]);
|
|
18894
|
-
|
|
18895
18928
|
const handleParseShipTo = ({
|
|
18896
18929
|
fullAddress
|
|
18897
18930
|
}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -18900,15 +18933,12 @@ const useAddress = ({
|
|
|
18900
18933
|
});
|
|
18901
18934
|
return parseResult;
|
|
18902
18935
|
});
|
|
18903
|
-
|
|
18904
18936
|
const handleValidateAddress = useCallback((address, fallbackAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18905
|
-
if (isAddressValidating) return;
|
|
18906
18937
|
setAddressPreference(undefined);
|
|
18907
18938
|
const result = yield validateAddresses({
|
|
18908
18939
|
addresses: [address]
|
|
18909
18940
|
});
|
|
18910
18941
|
const [addressValidation] = result !== null && result !== void 0 ? result : [];
|
|
18911
|
-
|
|
18912
18942
|
if (addressValidation) {
|
|
18913
18943
|
const updatedAddressPreference = resetAddressPreference(addressValidation, fallbackAddress);
|
|
18914
18944
|
yield onValidation === null || onValidation === void 0 ? void 0 : onValidation(updatedAddressPreference);
|
|
@@ -18923,7 +18953,7 @@ const useAddress = ({
|
|
|
18923
18953
|
status: "error"
|
|
18924
18954
|
});
|
|
18925
18955
|
}
|
|
18926
|
-
}), [
|
|
18956
|
+
}), [onValidation, resetAddressPreference, validateAddresses]);
|
|
18927
18957
|
const handleChangeAddress = useCallback((shipTo, {
|
|
18928
18958
|
shouldValidate
|
|
18929
18959
|
}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -18934,7 +18964,6 @@ const useAddress = ({
|
|
|
18934
18964
|
yield onChange === null || onChange === void 0 ? void 0 : onChange(shipment, Object.assign(Object.assign({}, shipment), {
|
|
18935
18965
|
shipTo
|
|
18936
18966
|
}));
|
|
18937
|
-
|
|
18938
18967
|
if (shouldValidate) {
|
|
18939
18968
|
yield handleValidateAddress(shipTo);
|
|
18940
18969
|
}
|
|
@@ -18967,7 +18996,6 @@ const useCustoms = ({
|
|
|
18967
18996
|
const updatedShipment = yield updateShipment(Object.assign(Object.assign({}, shipment), {
|
|
18968
18997
|
customs
|
|
18969
18998
|
}));
|
|
18970
|
-
|
|
18971
18999
|
if (updatedShipment) {
|
|
18972
19000
|
yield onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(updatedShipment);
|
|
18973
19001
|
}
|
|
@@ -18988,7 +19016,6 @@ const usePresets = ({
|
|
|
18988
19016
|
} = useUpdateShipment({
|
|
18989
19017
|
shipmentId: shipment === null || shipment === void 0 ? void 0 : shipment.shipmentId
|
|
18990
19018
|
});
|
|
18991
|
-
|
|
18992
19019
|
const handleApplyPreset = preset => __awaiter(void 0, void 0, void 0, function* () {
|
|
18993
19020
|
const updatedShipment = yield updateShipment(Object.assign(Object.assign(Object.assign({}, shipment), preset.serviceCode && preset.carrierId && {
|
|
18994
19021
|
carrierId: preset.carrierId,
|
|
@@ -19012,36 +19039,44 @@ const usePresets = ({
|
|
|
19012
19039
|
packageCode: preset.packageCode
|
|
19013
19040
|
}] : undefined
|
|
19014
19041
|
}));
|
|
19015
|
-
|
|
19016
19042
|
if (updatedShipment) {
|
|
19017
19043
|
yield onApply === null || onApply === void 0 ? void 0 : onApply(preset, updatedShipment);
|
|
19018
19044
|
}
|
|
19019
19045
|
});
|
|
19020
|
-
|
|
19021
19046
|
return {
|
|
19022
19047
|
handleApplyPreset,
|
|
19023
19048
|
presetErrors: updateShipmentErrors
|
|
19024
19049
|
};
|
|
19025
19050
|
};
|
|
19026
19051
|
|
|
19027
|
-
var classof$4 = classofRaw$
|
|
19052
|
+
var classof$4 = classofRaw$2;
|
|
19028
19053
|
|
|
19029
19054
|
// `IsArray` abstract operation
|
|
19030
19055
|
// https://tc39.es/ecma262/#sec-isarray
|
|
19031
|
-
// eslint-disable-next-line es
|
|
19056
|
+
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
19032
19057
|
var isArray$2 = Array.isArray || function isArray(argument) {
|
|
19033
19058
|
return classof$4(argument) == 'Array';
|
|
19034
19059
|
};
|
|
19035
19060
|
|
|
19036
|
-
var $TypeError$
|
|
19061
|
+
var $TypeError$6 = TypeError;
|
|
19037
19062
|
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
|
|
19038
19063
|
|
|
19039
19064
|
var doesNotExceedSafeInteger$1 = function (it) {
|
|
19040
|
-
if (it > MAX_SAFE_INTEGER) throw $TypeError$
|
|
19065
|
+
if (it > MAX_SAFE_INTEGER) throw $TypeError$6('Maximum allowed index exceeded');
|
|
19041
19066
|
return it;
|
|
19042
19067
|
};
|
|
19043
19068
|
|
|
19044
|
-
var
|
|
19069
|
+
var classofRaw$1 = classofRaw$2;
|
|
19070
|
+
var uncurryThis$3 = functionUncurryThis;
|
|
19071
|
+
|
|
19072
|
+
var functionUncurryThisClause = function (fn) {
|
|
19073
|
+
// Nashorn bug:
|
|
19074
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
19075
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
19076
|
+
if (classofRaw$1(fn) === 'Function') return uncurryThis$3(fn);
|
|
19077
|
+
};
|
|
19078
|
+
|
|
19079
|
+
var uncurryThis$2 = functionUncurryThisClause;
|
|
19045
19080
|
var aCallable$6 = aCallable$8;
|
|
19046
19081
|
var NATIVE_BIND$1 = functionBindNative;
|
|
19047
19082
|
|
|
@@ -19100,7 +19135,7 @@ var toStringTagSupport = String(test) === '[object z]';
|
|
|
19100
19135
|
|
|
19101
19136
|
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
19102
19137
|
var isCallable$5 = isCallable$k;
|
|
19103
|
-
var classofRaw = classofRaw$
|
|
19138
|
+
var classofRaw = classofRaw$2;
|
|
19104
19139
|
var wellKnownSymbol$7 = wellKnownSymbol$f;
|
|
19105
19140
|
|
|
19106
19141
|
var TO_STRING_TAG = wellKnownSymbol$7('toStringTag');
|
|
@@ -19133,7 +19168,7 @@ var fails$1 = fails$d;
|
|
|
19133
19168
|
var isCallable$4 = isCallable$k;
|
|
19134
19169
|
var classof$2 = classof$3;
|
|
19135
19170
|
var getBuiltIn$3 = getBuiltIn$8;
|
|
19136
|
-
var inspectSource$1 = inspectSource$
|
|
19171
|
+
var inspectSource$1 = inspectSource$3;
|
|
19137
19172
|
|
|
19138
19173
|
var noop = function () { /* empty */ };
|
|
19139
19174
|
var empty = [];
|
|
@@ -19183,7 +19218,7 @@ var isConstructor$2 = !construct || fails$1(function () {
|
|
|
19183
19218
|
|
|
19184
19219
|
var isArray = isArray$2;
|
|
19185
19220
|
var isConstructor$1 = isConstructor$2;
|
|
19186
|
-
var isObject$2 = isObject$
|
|
19221
|
+
var isObject$2 = isObject$9;
|
|
19187
19222
|
var wellKnownSymbol$6 = wellKnownSymbol$f;
|
|
19188
19223
|
|
|
19189
19224
|
var SPECIES$3 = wellKnownSymbol$6('species');
|
|
@@ -19258,7 +19293,6 @@ const useRequestRates = ({
|
|
|
19258
19293
|
} = useCalculateRates();
|
|
19259
19294
|
const requestRates = useCallback(shipment => __awaiter(void 0, void 0, void 0, function* () {
|
|
19260
19295
|
var _a;
|
|
19261
|
-
|
|
19262
19296
|
const result = yield calculateRates({
|
|
19263
19297
|
rateOptions: {
|
|
19264
19298
|
carrierIds: shipment.carrierId ? [shipment.carrierId] : (_a = carriers === null || carriers === void 0 ? void 0 : carriers.map(c => c.carrierId)) !== null && _a !== void 0 ? _a : [],
|
|
@@ -19290,7 +19324,6 @@ const useRatesForm = ({
|
|
|
19290
19324
|
shipment
|
|
19291
19325
|
}) => {
|
|
19292
19326
|
var _a, _b;
|
|
19293
|
-
|
|
19294
19327
|
const [beforeCreateError, setBeforeCreateError] = useState();
|
|
19295
19328
|
const {
|
|
19296
19329
|
data: carriers
|
|
@@ -19316,7 +19349,6 @@ const useRatesForm = ({
|
|
|
19316
19349
|
setBeforeCreateError(undefined);
|
|
19317
19350
|
if (!shipment) return;
|
|
19318
19351
|
const rate = ratesResponse === null || ratesResponse === void 0 ? void 0 : ratesResponse.rates.find(r => r.rateId === rateId);
|
|
19319
|
-
|
|
19320
19352
|
if (rate) {
|
|
19321
19353
|
try {
|
|
19322
19354
|
yield onBeforeLabelCreate === null || onBeforeLabelCreate === void 0 ? void 0 : onBeforeLabelCreate(rate, shipment);
|
|
@@ -19329,12 +19361,10 @@ const useRatesForm = ({
|
|
|
19329
19361
|
});
|
|
19330
19362
|
return;
|
|
19331
19363
|
}
|
|
19332
|
-
|
|
19333
19364
|
try {
|
|
19334
19365
|
const label = yield createLabel({
|
|
19335
19366
|
rateId
|
|
19336
19367
|
});
|
|
19337
|
-
|
|
19338
19368
|
if (label) {
|
|
19339
19369
|
yield onLabelCreateSuccess === null || onLabelCreateSuccess === void 0 ? void 0 : onLabelCreateSuccess(label, shipment);
|
|
19340
19370
|
} else {
|
|
@@ -19353,17 +19383,16 @@ const useRatesForm = ({
|
|
|
19353
19383
|
carrierId,
|
|
19354
19384
|
serviceCode
|
|
19355
19385
|
}));
|
|
19356
|
-
|
|
19357
19386
|
if (updatedShipment) {
|
|
19358
19387
|
yield onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(updatedShipment);
|
|
19359
19388
|
yield onRateSaved === null || onRateSaved === void 0 ? void 0 : onRateSaved(updatedShipment);
|
|
19360
19389
|
}
|
|
19361
19390
|
}), [onRateSaved, onShipmentUpdated, shipment, updateShipment]);
|
|
19362
19391
|
let errors = [...(ratesErrors !== null && ratesErrors !== void 0 ? ratesErrors : []), ...((_a = ratesResponse === null || ratesResponse === void 0 ? void 0 : ratesResponse.errors) !== null && _a !== void 0 ? _a : [])];
|
|
19363
|
-
if (beforeCreateError) errors = [...errors, beforeCreateError];
|
|
19392
|
+
if (beforeCreateError) errors = [...errors, beforeCreateError];
|
|
19393
|
+
// Sometimes no rates are returned and no top-level errors are returned
|
|
19364
19394
|
// but there are invalid rates with errors. This will expose those to the user
|
|
19365
19395
|
// so the rate list isn't empty after calculating rates.
|
|
19366
|
-
|
|
19367
19396
|
if (!errors.length) {
|
|
19368
19397
|
errors = (_b = ratesResponse === null || ratesResponse === void 0 ? void 0 : ratesResponse.invalidRates.flatMap(r => r.errorMessages.map(m => ({
|
|
19369
19398
|
errorSource: "shipengine",
|
|
@@ -19372,7 +19401,6 @@ const useRatesForm = ({
|
|
|
19372
19401
|
message: m
|
|
19373
19402
|
})))) !== null && _b !== void 0 ? _b : [];
|
|
19374
19403
|
}
|
|
19375
|
-
|
|
19376
19404
|
return {
|
|
19377
19405
|
carriers,
|
|
19378
19406
|
errors: errors.length > 0 ? errors : undefined,
|
|
@@ -19443,7 +19471,6 @@ const useShipmentForm = ({
|
|
|
19443
19471
|
});
|
|
19444
19472
|
const handleSubmit = useCallback(values => __awaiter(void 0, void 0, void 0, function* () {
|
|
19445
19473
|
const updatedShipment = yield updateShipment(values);
|
|
19446
|
-
|
|
19447
19474
|
if (updatedShipment) {
|
|
19448
19475
|
yield onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(updatedShipment);
|
|
19449
19476
|
yield onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(updatedShipment);
|
|
@@ -19468,37 +19495,35 @@ const useShipmentForm = ({
|
|
|
19468
19495
|
|
|
19469
19496
|
const ConfigureShipment = _a => {
|
|
19470
19497
|
var {
|
|
19471
|
-
|
|
19472
|
-
|
|
19473
|
-
|
|
19474
|
-
|
|
19475
|
-
|
|
19476
|
-
|
|
19477
|
-
|
|
19478
|
-
|
|
19479
|
-
|
|
19480
|
-
|
|
19481
|
-
|
|
19482
|
-
|
|
19483
|
-
|
|
19484
|
-
|
|
19485
|
-
|
|
19498
|
+
onAddressValidation,
|
|
19499
|
+
onApplyPreset,
|
|
19500
|
+
onBeforeLabelCreate,
|
|
19501
|
+
onChangeAddress,
|
|
19502
|
+
onLabelCreateFailure,
|
|
19503
|
+
onLabelCreateSuccess,
|
|
19504
|
+
onRateSaved,
|
|
19505
|
+
onRatesCalculated,
|
|
19506
|
+
onShipmentUpdated,
|
|
19507
|
+
printLabelLayout,
|
|
19508
|
+
salesOrder,
|
|
19509
|
+
shipment
|
|
19510
|
+
} = _a,
|
|
19511
|
+
props = __rest(_a, ["onAddressValidation", "onApplyPreset", "onBeforeLabelCreate", "onChangeAddress", "onLabelCreateFailure", "onLabelCreateSuccess", "onRateSaved", "onRatesCalculated", "onShipmentUpdated", "printLabelLayout", "salesOrder", "shipment"]);
|
|
19486
19512
|
const _b = useRatesForm({
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
|
|
19490
|
-
|
|
19491
|
-
|
|
19492
|
-
|
|
19493
|
-
|
|
19494
|
-
|
|
19495
|
-
|
|
19496
|
-
|
|
19497
|
-
|
|
19498
|
-
|
|
19499
|
-
|
|
19500
|
-
|
|
19501
|
-
|
|
19513
|
+
onBeforeLabelCreate,
|
|
19514
|
+
onLabelCreateFailure,
|
|
19515
|
+
onLabelCreateSuccess,
|
|
19516
|
+
onRateSaved,
|
|
19517
|
+
onRatesCalculated,
|
|
19518
|
+
onShipmentUpdated,
|
|
19519
|
+
printLabelLayout,
|
|
19520
|
+
shipment
|
|
19521
|
+
}),
|
|
19522
|
+
{
|
|
19523
|
+
resetRates,
|
|
19524
|
+
requestRates
|
|
19525
|
+
} = _b,
|
|
19526
|
+
rateFormProps = __rest(_b, ["resetRates", "requestRates"]);
|
|
19502
19527
|
const shipmentFormProps = useShipmentForm({
|
|
19503
19528
|
onAddressValidation,
|
|
19504
19529
|
onApplyPreset: useCallback((_preset, shipment) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -19527,7 +19552,6 @@ const usePendingShipment = ({
|
|
|
19527
19552
|
warehouseId
|
|
19528
19553
|
}) => {
|
|
19529
19554
|
var _a;
|
|
19530
|
-
|
|
19531
19555
|
const {
|
|
19532
19556
|
data: warehouses,
|
|
19533
19557
|
errors: listWarehouseErrors
|
|
@@ -19549,8 +19573,8 @@ const usePendingShipment = ({
|
|
|
19549
19573
|
salesOrderId: salesOrder === null || salesOrder === void 0 ? void 0 : salesOrder.salesOrderId
|
|
19550
19574
|
});
|
|
19551
19575
|
const pendingShipment = getPendingShipment(shipments);
|
|
19552
|
-
const defaultWarehouse = (_a = warehouses === null || warehouses === void 0 ? void 0 : warehouses.find(w => w.warehouseId === warehouseId)) !== null && _a !== void 0 ? _a : warehouses === null || warehouses === void 0 ? void 0 : warehouses[0];
|
|
19553
|
-
|
|
19576
|
+
const defaultWarehouse = (_a = warehouses === null || warehouses === void 0 ? void 0 : warehouses.find(w => w.warehouseId === warehouseId)) !== null && _a !== void 0 ? _a : warehouses === null || warehouses === void 0 ? void 0 : warehouses[0];
|
|
19577
|
+
// On page load, if no shipment exists, create a shipment.
|
|
19554
19578
|
useEffect(() => {
|
|
19555
19579
|
if (!salesOrder || !defaultWarehouse || !shipments || pendingShipment) return;
|
|
19556
19580
|
if (isListShipmentsLoading || isListShipmentsValidating || isShipmentCreating) return;
|
|
@@ -19609,7 +19633,7 @@ const useConfigureShipment = ({
|
|
|
19609
19633
|
};
|
|
19610
19634
|
};
|
|
19611
19635
|
|
|
19612
|
-
var classof$1 = classofRaw$
|
|
19636
|
+
var classof$1 = classofRaw$2;
|
|
19613
19637
|
var global$8 = global$j;
|
|
19614
19638
|
|
|
19615
19639
|
var engineIsNode = classof$1(global$8.process) == 'process';
|
|
@@ -19635,26 +19659,27 @@ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
|
|
|
19635
19659
|
|
|
19636
19660
|
var isPrototypeOf$1 = objectIsPrototypeOf;
|
|
19637
19661
|
|
|
19638
|
-
var $TypeError$
|
|
19662
|
+
var $TypeError$5 = TypeError;
|
|
19639
19663
|
|
|
19640
19664
|
var anInstance$1 = function (it, Prototype) {
|
|
19641
19665
|
if (isPrototypeOf$1(Prototype, it)) return it;
|
|
19642
|
-
throw $TypeError$
|
|
19666
|
+
throw $TypeError$5('Incorrect invocation');
|
|
19643
19667
|
};
|
|
19644
19668
|
|
|
19645
19669
|
var isConstructor = isConstructor$2;
|
|
19646
19670
|
var tryToString$2 = tryToString$4;
|
|
19647
19671
|
|
|
19648
|
-
var $TypeError$
|
|
19672
|
+
var $TypeError$4 = TypeError;
|
|
19649
19673
|
|
|
19650
19674
|
// `Assert: IsConstructor(argument) is true`
|
|
19651
19675
|
var aConstructor$1 = function (argument) {
|
|
19652
19676
|
if (isConstructor(argument)) return argument;
|
|
19653
|
-
throw $TypeError$
|
|
19677
|
+
throw $TypeError$4(tryToString$2(argument) + ' is not a constructor');
|
|
19654
19678
|
};
|
|
19655
19679
|
|
|
19656
19680
|
var anObject$4 = anObject$a;
|
|
19657
19681
|
var aConstructor = aConstructor$1;
|
|
19682
|
+
var isNullOrUndefined$1 = isNullOrUndefined$4;
|
|
19658
19683
|
var wellKnownSymbol$4 = wellKnownSymbol$f;
|
|
19659
19684
|
|
|
19660
19685
|
var SPECIES$1 = wellKnownSymbol$4('species');
|
|
@@ -19664,7 +19689,7 @@ var SPECIES$1 = wellKnownSymbol$4('species');
|
|
|
19664
19689
|
var speciesConstructor$1 = function (O, defaultConstructor) {
|
|
19665
19690
|
var C = anObject$4(O).constructor;
|
|
19666
19691
|
var S;
|
|
19667
|
-
return C === undefined || (S = anObject$4(C)[SPECIES$1])
|
|
19692
|
+
return C === undefined || isNullOrUndefined$1(S = anObject$4(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
|
|
19668
19693
|
};
|
|
19669
19694
|
|
|
19670
19695
|
var NATIVE_BIND = functionBindNative;
|
|
@@ -19673,7 +19698,7 @@ var FunctionPrototype = Function.prototype;
|
|
|
19673
19698
|
var apply$1 = FunctionPrototype.apply;
|
|
19674
19699
|
var call$7 = FunctionPrototype.call;
|
|
19675
19700
|
|
|
19676
|
-
// eslint-disable-next-line es
|
|
19701
|
+
// eslint-disable-next-line es/no-reflect -- safe
|
|
19677
19702
|
var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$7.bind(apply$1) : function () {
|
|
19678
19703
|
return call$7.apply(apply$1, arguments);
|
|
19679
19704
|
});
|
|
@@ -19682,10 +19707,10 @@ var uncurryThis = functionUncurryThis;
|
|
|
19682
19707
|
|
|
19683
19708
|
var arraySlice$1 = uncurryThis([].slice);
|
|
19684
19709
|
|
|
19685
|
-
var $TypeError$
|
|
19710
|
+
var $TypeError$3 = TypeError;
|
|
19686
19711
|
|
|
19687
19712
|
var validateArgumentsLength$1 = function (passed, required) {
|
|
19688
|
-
if (passed < required) throw $TypeError$
|
|
19713
|
+
if (passed < required) throw $TypeError$3('Not enough arguments');
|
|
19689
19714
|
return passed;
|
|
19690
19715
|
};
|
|
19691
19716
|
|
|
@@ -19716,11 +19741,11 @@ var String$1 = global$7.String;
|
|
|
19716
19741
|
var counter = 0;
|
|
19717
19742
|
var queue$1 = {};
|
|
19718
19743
|
var ONREADYSTATECHANGE = 'onreadystatechange';
|
|
19719
|
-
var location, defer, channel, port;
|
|
19744
|
+
var $location, defer, channel, port;
|
|
19720
19745
|
|
|
19721
19746
|
try {
|
|
19722
19747
|
// Deno throws a ReferenceError on `location` access without `--location` flag
|
|
19723
|
-
location = global$7.location;
|
|
19748
|
+
$location = global$7.location;
|
|
19724
19749
|
} catch (error) { /* empty */ }
|
|
19725
19750
|
|
|
19726
19751
|
var run = function (id) {
|
|
@@ -19743,7 +19768,7 @@ var listener = function (event) {
|
|
|
19743
19768
|
|
|
19744
19769
|
var post = function (id) {
|
|
19745
19770
|
// old engines have not location.origin
|
|
19746
|
-
global$7.postMessage(String$1(id), location.protocol + '//' + location.host);
|
|
19771
|
+
global$7.postMessage(String$1(id), $location.protocol + '//' + $location.host);
|
|
19747
19772
|
};
|
|
19748
19773
|
|
|
19749
19774
|
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
|
@@ -19784,7 +19809,7 @@ if (!set || !clear) {
|
|
|
19784
19809
|
global$7.addEventListener &&
|
|
19785
19810
|
isCallable$3(global$7.postMessage) &&
|
|
19786
19811
|
!global$7.importScripts &&
|
|
19787
|
-
location && location.protocol !== 'file:' &&
|
|
19812
|
+
$location && $location.protocol !== 'file:' &&
|
|
19788
19813
|
!fails(post)
|
|
19789
19814
|
) {
|
|
19790
19815
|
defer = post;
|
|
@@ -19965,7 +19990,7 @@ var global$2 = global$j;
|
|
|
19965
19990
|
var NativePromiseConstructor$3 = promiseNativeConstructor;
|
|
19966
19991
|
var isCallable$2 = isCallable$k;
|
|
19967
19992
|
var isForced = isForced_1;
|
|
19968
|
-
var inspectSource = inspectSource$
|
|
19993
|
+
var inspectSource = inspectSource$3;
|
|
19969
19994
|
var wellKnownSymbol$3 = wellKnownSymbol$f;
|
|
19970
19995
|
var IS_BROWSER = engineIsBrowser;
|
|
19971
19996
|
var IS_DENO = engineIsDeno;
|
|
@@ -20010,10 +20035,12 @@ var newPromiseCapability$2 = {};
|
|
|
20010
20035
|
|
|
20011
20036
|
var aCallable$4 = aCallable$8;
|
|
20012
20037
|
|
|
20038
|
+
var $TypeError$2 = TypeError;
|
|
20039
|
+
|
|
20013
20040
|
var PromiseCapability = function (C) {
|
|
20014
20041
|
var resolve, reject;
|
|
20015
20042
|
this.promise = new C(function ($$resolve, $$reject) {
|
|
20016
|
-
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
|
20043
|
+
if (resolve !== undefined || reject !== undefined) throw $TypeError$2('Bad Promise constructor');
|
|
20017
20044
|
resolve = $$resolve;
|
|
20018
20045
|
reject = $$reject;
|
|
20019
20046
|
});
|
|
@@ -20037,7 +20064,7 @@ var setToStringTag = setToStringTag$3;
|
|
|
20037
20064
|
var setSpecies = setSpecies$1;
|
|
20038
20065
|
var aCallable$3 = aCallable$8;
|
|
20039
20066
|
var isCallable$1 = isCallable$k;
|
|
20040
|
-
var isObject$1 = isObject$
|
|
20067
|
+
var isObject$1 = isObject$9;
|
|
20041
20068
|
var anInstance = anInstance$1;
|
|
20042
20069
|
var speciesConstructor = speciesConstructor$1;
|
|
20043
20070
|
var task = task$1.set;
|
|
@@ -20327,13 +20354,14 @@ var isArrayIteratorMethod$1 = function (it) {
|
|
|
20327
20354
|
|
|
20328
20355
|
var classof = classof$3;
|
|
20329
20356
|
var getMethod$1 = getMethod$3;
|
|
20357
|
+
var isNullOrUndefined = isNullOrUndefined$4;
|
|
20330
20358
|
var Iterators = iterators;
|
|
20331
20359
|
var wellKnownSymbol$1 = wellKnownSymbol$f;
|
|
20332
20360
|
|
|
20333
20361
|
var ITERATOR$1 = wellKnownSymbol$1('iterator');
|
|
20334
20362
|
|
|
20335
20363
|
var getIteratorMethod$2 = function (it) {
|
|
20336
|
-
if (it
|
|
20364
|
+
if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR$1)
|
|
20337
20365
|
|| getMethod$1(it, '@@iterator')
|
|
20338
20366
|
|| Iterators[classof(it)];
|
|
20339
20367
|
};
|
|
@@ -20463,7 +20491,7 @@ try {
|
|
|
20463
20491
|
iteratorWithReturn[ITERATOR] = function () {
|
|
20464
20492
|
return this;
|
|
20465
20493
|
};
|
|
20466
|
-
// eslint-disable-next-line es
|
|
20494
|
+
// eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
|
|
20467
20495
|
Array.from(iteratorWithReturn, function () { throw 2; });
|
|
20468
20496
|
} catch (error) { /* empty */ }
|
|
20469
20497
|
|
|
@@ -20598,7 +20626,7 @@ $$1({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
|
|
|
20598
20626
|
});
|
|
20599
20627
|
|
|
20600
20628
|
var anObject = anObject$a;
|
|
20601
|
-
var isObject = isObject$
|
|
20629
|
+
var isObject = isObject$9;
|
|
20602
20630
|
var newPromiseCapability = newPromiseCapability$2;
|
|
20603
20631
|
|
|
20604
20632
|
var promiseResolve$1 = function (C, x) {
|
|
@@ -20667,7 +20695,6 @@ const useImportSalesOrder = ({
|
|
|
20667
20695
|
}, [hasRefreshedOrderSource, orderSources, refreshOrderSource, refreshedOrderSource, revalidateSalesOrders, salesOrders]);
|
|
20668
20696
|
const errors = [...(listOrderSourcesErrors !== null && listOrderSourcesErrors !== void 0 ? listOrderSourcesErrors : []), ...(listSalesOrdersErrors !== null && listSalesOrdersErrors !== void 0 ? listSalesOrdersErrors : []), ...(refreshOrderSourceErrors !== null && refreshOrderSourceErrors !== void 0 ? refreshOrderSourceErrors : [])];
|
|
20669
20697
|
const salesOrder = salesOrders === null || salesOrders === void 0 ? void 0 : salesOrders[0]; // Assume there's only one sales order matching the given identifier
|
|
20670
|
-
|
|
20671
20698
|
return {
|
|
20672
20699
|
errors: errors.length > 0 ? errors : undefined,
|
|
20673
20700
|
isLoading: !salesOrder && !hasRefreshedOrderSource && errors.length === 0,
|
|
@@ -20677,27 +20704,25 @@ const useImportSalesOrder = ({
|
|
|
20677
20704
|
|
|
20678
20705
|
const SalesOrder = _a => {
|
|
20679
20706
|
var {
|
|
20680
|
-
|
|
20681
|
-
|
|
20682
|
-
|
|
20683
|
-
|
|
20684
|
-
|
|
20685
|
-
|
|
20686
|
-
|
|
20687
|
-
|
|
20688
|
-
|
|
20689
|
-
|
|
20707
|
+
externalOrderId,
|
|
20708
|
+
externalOrderNumber,
|
|
20709
|
+
onLoad,
|
|
20710
|
+
onShipmentUpdated,
|
|
20711
|
+
orderSourceCode,
|
|
20712
|
+
salesOrderId,
|
|
20713
|
+
warehouseId
|
|
20714
|
+
} = _a,
|
|
20715
|
+
props = __rest(_a, ["externalOrderId", "externalOrderNumber", "onLoad", "onShipmentUpdated", "orderSourceCode", "salesOrderId", "warehouseId"]);
|
|
20690
20716
|
const _b = useImportSalesOrder({
|
|
20691
|
-
|
|
20692
|
-
|
|
20693
|
-
|
|
20694
|
-
|
|
20695
|
-
|
|
20696
|
-
|
|
20697
|
-
|
|
20698
|
-
|
|
20699
|
-
|
|
20700
|
-
|
|
20717
|
+
externalOrderId,
|
|
20718
|
+
externalOrderNumber,
|
|
20719
|
+
orderSourceCode,
|
|
20720
|
+
salesOrderId
|
|
20721
|
+
}),
|
|
20722
|
+
{
|
|
20723
|
+
salesOrder
|
|
20724
|
+
} = _b,
|
|
20725
|
+
salesOrderProps = __rest(_b, ["salesOrder"]);
|
|
20701
20726
|
const configureShipmentProps = useConfigureShipment({
|
|
20702
20727
|
onLoad,
|
|
20703
20728
|
onShipmentUpdated,
|
|
@@ -20722,7 +20747,6 @@ const Shipment = ({
|
|
|
20722
20747
|
shipmentId
|
|
20723
20748
|
}) => {
|
|
20724
20749
|
var _a, _b, _c;
|
|
20725
|
-
|
|
20726
20750
|
const {
|
|
20727
20751
|
t
|
|
20728
20752
|
} = useTranslation(["common", "view-shipment"]);
|
|
@@ -20744,7 +20768,6 @@ const Shipment = ({
|
|
|
20744
20768
|
if (!shipment.data) throw new Error("errorMessages.unableToLoad.shipment");
|
|
20745
20769
|
const warehouse = (_b = warehouses.data) === null || _b === void 0 ? void 0 : _b.find(w => {
|
|
20746
20770
|
var _a;
|
|
20747
|
-
|
|
20748
20771
|
return w.warehouseId === ((_a = shipment.data) === null || _a === void 0 ? void 0 : _a.warehouseId);
|
|
20749
20772
|
});
|
|
20750
20773
|
const salesOrder = (_c = salesOrders.data) === null || _c === void 0 ? void 0 : _c[0];
|
|
@@ -20767,7 +20790,6 @@ const VoidLabel = ({
|
|
|
20767
20790
|
onViewShipment
|
|
20768
20791
|
}) => {
|
|
20769
20792
|
var _a;
|
|
20770
|
-
|
|
20771
20793
|
const label = useGetLabel({
|
|
20772
20794
|
labelId
|
|
20773
20795
|
});
|
|
@@ -20777,16 +20799,14 @@ const VoidLabel = ({
|
|
|
20777
20799
|
const voidLabel = useVoidLabel({
|
|
20778
20800
|
labelId
|
|
20779
20801
|
});
|
|
20780
|
-
|
|
20781
20802
|
const handleVoidLabelSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
20782
|
-
const result = yield voidLabel.trigger(label.data);
|
|
20803
|
+
const result = yield voidLabel.trigger(label.data);
|
|
20804
|
+
// We should always have label.data and shipment.data if the request was approved,
|
|
20783
20805
|
// but we aren't using Suspense so we still need to check.
|
|
20784
|
-
|
|
20785
20806
|
if ((result === null || result === void 0 ? void 0 : result.approved) && label.data && shipment.data) {
|
|
20786
20807
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(label.data, shipment.data);
|
|
20787
20808
|
}
|
|
20788
20809
|
});
|
|
20789
|
-
|
|
20790
20810
|
return jsx(Templates.VoidLabel, {
|
|
20791
20811
|
onComplete: onComplete,
|
|
20792
20812
|
onSubmit: handleVoidLabelSubmit,
|