@shipengine/elements 0.1.14

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/index.cjs ADDED
@@ -0,0 +1,3030 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var elementsCore = require('@shipengine/elements-core');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var react = require('react');
8
+ var elementsUi = require('@shipengine/elements-ui');
9
+ var elementsUncontrolled = require('@shipengine/elements-uncontrolled');
10
+
11
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
12
+
13
+ var fails$d = function (exec) {
14
+ try {
15
+ return !!exec();
16
+ } catch (error) {
17
+ return true;
18
+ }
19
+ };
20
+
21
+ var fails$c = fails$d;
22
+
23
+ var functionBindNative = !fails$c(function () {
24
+ // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
25
+ var test = (function () { /* empty */ }).bind();
26
+ // eslint-disable-next-line no-prototype-builtins -- safe
27
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
28
+ });
29
+
30
+ var NATIVE_BIND$3 = functionBindNative;
31
+
32
+ var FunctionPrototype$2 = Function.prototype;
33
+ var bind$5 = FunctionPrototype$2.bind;
34
+ var call$e = FunctionPrototype$2.call;
35
+ var uncurryThis$e = NATIVE_BIND$3 && bind$5.bind(call$e, call$e);
36
+
37
+ var functionUncurryThis = NATIVE_BIND$3 ? function (fn) {
38
+ return fn && uncurryThis$e(fn);
39
+ } : function (fn) {
40
+ return fn && function () {
41
+ return call$e.apply(fn, arguments);
42
+ };
43
+ };
44
+
45
+ var uncurryThis$d = functionUncurryThis;
46
+
47
+ var toString$1 = uncurryThis$d({}.toString);
48
+ var stringSlice = uncurryThis$d(''.slice);
49
+
50
+ var classofRaw$1 = function (it) {
51
+ return stringSlice(toString$1(it), 8, -1);
52
+ };
53
+
54
+ var uncurryThis$c = functionUncurryThis;
55
+ var fails$b = fails$d;
56
+ var classof$4 = classofRaw$1;
57
+
58
+ var $Object$4 = Object;
59
+ var split = uncurryThis$c(''.split);
60
+
61
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
62
+ var indexedObject = fails$b(function () {
63
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
64
+ // eslint-disable-next-line no-prototype-builtins -- safe
65
+ return !$Object$4('z').propertyIsEnumerable(0);
66
+ }) ? function (it) {
67
+ return classof$4(it) == 'String' ? split(it, '') : $Object$4(it);
68
+ } : $Object$4;
69
+
70
+ var $TypeError$b = TypeError;
71
+
72
+ // `RequireObjectCoercible` abstract operation
73
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
74
+ var requireObjectCoercible$2 = function (it) {
75
+ if (it == undefined) throw $TypeError$b("Can't call method on " + it);
76
+ return it;
77
+ };
78
+
79
+ // toObject with fallback for non-array-like ES3 strings
80
+ var IndexedObject$1 = indexedObject;
81
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
82
+
83
+ var toIndexedObject$5 = function (it) {
84
+ return IndexedObject$1(requireObjectCoercible$1(it));
85
+ };
86
+
87
+ var check = function (it) {
88
+ return it && it.Math == Math && it;
89
+ };
90
+
91
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
92
+ var global$j =
93
+ // eslint-disable-next-line es-x/no-global-this -- safe
94
+ check(typeof globalThis == 'object' && globalThis) ||
95
+ check(typeof window == 'object' && window) ||
96
+ // eslint-disable-next-line no-restricted-globals -- safe
97
+ check(typeof self == 'object' && self) ||
98
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
99
+ // eslint-disable-next-line no-new-func -- fallback
100
+ (function () { return this; })() || Function('return this')();
101
+
102
+ var shared$3 = {exports: {}};
103
+
104
+ var global$i = global$j;
105
+
106
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
107
+ var defineProperty$5 = Object.defineProperty;
108
+
109
+ var defineGlobalProperty$3 = function (key, value) {
110
+ try {
111
+ defineProperty$5(global$i, key, { value: value, configurable: true, writable: true });
112
+ } catch (error) {
113
+ global$i[key] = value;
114
+ } return value;
115
+ };
116
+
117
+ var global$h = global$j;
118
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
119
+
120
+ var SHARED = '__core-js_shared__';
121
+ var store$3 = global$h[SHARED] || defineGlobalProperty$2(SHARED, {});
122
+
123
+ var sharedStore = store$3;
124
+
125
+ var store$2 = sharedStore;
126
+
127
+ (shared$3.exports = function (key, value) {
128
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
129
+ })('versions', []).push({
130
+ version: '3.24.1',
131
+ mode: 'global',
132
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
133
+ license: 'https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE',
134
+ source: 'https://github.com/zloirock/core-js'
135
+ });
136
+
137
+ var requireObjectCoercible = requireObjectCoercible$2;
138
+
139
+ var $Object$3 = Object;
140
+
141
+ // `ToObject` abstract operation
142
+ // https://tc39.es/ecma262/#sec-toobject
143
+ var toObject$3 = function (argument) {
144
+ return $Object$3(requireObjectCoercible(argument));
145
+ };
146
+
147
+ var uncurryThis$b = functionUncurryThis;
148
+ var toObject$2 = toObject$3;
149
+
150
+ var hasOwnProperty = uncurryThis$b({}.hasOwnProperty);
151
+
152
+ // `HasOwnProperty` abstract operation
153
+ // https://tc39.es/ecma262/#sec-hasownproperty
154
+ // eslint-disable-next-line es-x/no-object-hasown -- safe
155
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
156
+ return hasOwnProperty(toObject$2(it), key);
157
+ };
158
+
159
+ var uncurryThis$a = functionUncurryThis;
160
+
161
+ var id = 0;
162
+ var postfix = Math.random();
163
+ var toString = uncurryThis$a(1.0.toString);
164
+
165
+ var uid$2 = function (key) {
166
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
167
+ };
168
+
169
+ // `IsCallable` abstract operation
170
+ // https://tc39.es/ecma262/#sec-iscallable
171
+ var isCallable$k = function (argument) {
172
+ return typeof argument == 'function';
173
+ };
174
+
175
+ var global$g = global$j;
176
+ var isCallable$j = isCallable$k;
177
+
178
+ var aFunction = function (argument) {
179
+ return isCallable$j(argument) ? argument : undefined;
180
+ };
181
+
182
+ var getBuiltIn$8 = function (namespace, method) {
183
+ return arguments.length < 2 ? aFunction(global$g[namespace]) : global$g[namespace] && global$g[namespace][method];
184
+ };
185
+
186
+ var getBuiltIn$7 = getBuiltIn$8;
187
+
188
+ var engineUserAgent = getBuiltIn$7('navigator', 'userAgent') || '';
189
+
190
+ var global$f = global$j;
191
+ var userAgent$3 = engineUserAgent;
192
+
193
+ var process$3 = global$f.process;
194
+ var Deno$1 = global$f.Deno;
195
+ var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
196
+ var v8 = versions && versions.v8;
197
+ var match, version;
198
+
199
+ if (v8) {
200
+ match = v8.split('.');
201
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
202
+ // but their correct versions are not interesting for us
203
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
204
+ }
205
+
206
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
207
+ // so check `userAgent` even if `.v8` exists, but 0
208
+ if (!version && userAgent$3) {
209
+ match = userAgent$3.match(/Edge\/(\d+)/);
210
+ if (!match || match[1] >= 74) {
211
+ match = userAgent$3.match(/Chrome\/(\d+)/);
212
+ if (match) version = +match[1];
213
+ }
214
+ }
215
+
216
+ var engineV8Version = version;
217
+
218
+ /* eslint-disable es-x/no-symbol -- required for testing */
219
+
220
+ var V8_VERSION$1 = engineV8Version;
221
+ var fails$a = fails$d;
222
+
223
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
224
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$a(function () {
225
+ var symbol = Symbol();
226
+ // Chrome 38 Symbol has incorrect toString conversion
227
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
228
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
229
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
230
+ !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
231
+ });
232
+
233
+ /* eslint-disable es-x/no-symbol -- required for testing */
234
+
235
+ var NATIVE_SYMBOL$1 = nativeSymbol;
236
+
237
+ var useSymbolAsUid = NATIVE_SYMBOL$1
238
+ && !Symbol.sham
239
+ && typeof Symbol.iterator == 'symbol';
240
+
241
+ var global$e = global$j;
242
+ var shared$2 = shared$3.exports;
243
+ var hasOwn$9 = hasOwnProperty_1;
244
+ var uid$1 = uid$2;
245
+ var NATIVE_SYMBOL = nativeSymbol;
246
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
247
+
248
+ var WellKnownSymbolsStore = shared$2('wks');
249
+ var Symbol$1 = global$e.Symbol;
250
+ var symbolFor = Symbol$1 && Symbol$1['for'];
251
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
252
+
253
+ var wellKnownSymbol$e = function (name) {
254
+ if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
255
+ var description = 'Symbol.' + name;
256
+ if (NATIVE_SYMBOL && hasOwn$9(Symbol$1, name)) {
257
+ WellKnownSymbolsStore[name] = Symbol$1[name];
258
+ } else if (USE_SYMBOL_AS_UID$1 && symbolFor) {
259
+ WellKnownSymbolsStore[name] = symbolFor(description);
260
+ } else {
261
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
262
+ }
263
+ } return WellKnownSymbolsStore[name];
264
+ };
265
+
266
+ var isCallable$i = isCallable$k;
267
+
268
+ var isObject$7 = function (it) {
269
+ return typeof it == 'object' ? it !== null : isCallable$i(it);
270
+ };
271
+
272
+ var isObject$6 = isObject$7;
273
+
274
+ var $String$2 = String;
275
+ var $TypeError$a = TypeError;
276
+
277
+ // `Assert: Type(argument) is Object`
278
+ var anObject$a = function (argument) {
279
+ if (isObject$6(argument)) return argument;
280
+ throw $TypeError$a($String$2(argument) + ' is not an object');
281
+ };
282
+
283
+ var objectDefineProperties = {};
284
+
285
+ var fails$9 = fails$d;
286
+
287
+ // Detect IE8's incomplete defineProperty implementation
288
+ var descriptors = !fails$9(function () {
289
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
290
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
291
+ });
292
+
293
+ var DESCRIPTORS$a = descriptors;
294
+ var fails$8 = fails$d;
295
+
296
+ // V8 ~ Chrome 36-
297
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
298
+ var v8PrototypeDefineBug = DESCRIPTORS$a && fails$8(function () {
299
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
300
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
301
+ value: 42,
302
+ writable: false
303
+ }).prototype != 42;
304
+ });
305
+
306
+ var objectDefineProperty = {};
307
+
308
+ var global$d = global$j;
309
+ var isObject$5 = isObject$7;
310
+
311
+ var document$3 = global$d.document;
312
+ // typeof document.createElement is 'object' in old IE
313
+ var EXISTS$1 = isObject$5(document$3) && isObject$5(document$3.createElement);
314
+
315
+ var documentCreateElement$2 = function (it) {
316
+ return EXISTS$1 ? document$3.createElement(it) : {};
317
+ };
318
+
319
+ var DESCRIPTORS$9 = descriptors;
320
+ var fails$7 = fails$d;
321
+ var createElement$1 = documentCreateElement$2;
322
+
323
+ // Thanks to IE8 for its funny defineProperty
324
+ var ie8DomDefine = !DESCRIPTORS$9 && !fails$7(function () {
325
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
326
+ return Object.defineProperty(createElement$1('div'), 'a', {
327
+ get: function () { return 7; }
328
+ }).a != 7;
329
+ });
330
+
331
+ var NATIVE_BIND$2 = functionBindNative;
332
+
333
+ var call$d = Function.prototype.call;
334
+
335
+ var functionCall = NATIVE_BIND$2 ? call$d.bind(call$d) : function () {
336
+ return call$d.apply(call$d, arguments);
337
+ };
338
+
339
+ var uncurryThis$9 = functionUncurryThis;
340
+
341
+ var objectIsPrototypeOf = uncurryThis$9({}.isPrototypeOf);
342
+
343
+ var getBuiltIn$6 = getBuiltIn$8;
344
+ var isCallable$h = isCallable$k;
345
+ var isPrototypeOf$2 = objectIsPrototypeOf;
346
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
347
+
348
+ var $Object$2 = Object;
349
+
350
+ var isSymbol$2 = USE_SYMBOL_AS_UID ? function (it) {
351
+ return typeof it == 'symbol';
352
+ } : function (it) {
353
+ var $Symbol = getBuiltIn$6('Symbol');
354
+ return isCallable$h($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$2(it));
355
+ };
356
+
357
+ var $String$1 = String;
358
+
359
+ var tryToString$4 = function (argument) {
360
+ try {
361
+ return $String$1(argument);
362
+ } catch (error) {
363
+ return 'Object';
364
+ }
365
+ };
366
+
367
+ var isCallable$g = isCallable$k;
368
+ var tryToString$3 = tryToString$4;
369
+
370
+ var $TypeError$9 = TypeError;
371
+
372
+ // `Assert: IsCallable(argument) is true`
373
+ var aCallable$7 = function (argument) {
374
+ if (isCallable$g(argument)) return argument;
375
+ throw $TypeError$9(tryToString$3(argument) + ' is not a function');
376
+ };
377
+
378
+ var aCallable$6 = aCallable$7;
379
+
380
+ // `GetMethod` abstract operation
381
+ // https://tc39.es/ecma262/#sec-getmethod
382
+ var getMethod$3 = function (V, P) {
383
+ var func = V[P];
384
+ return func == null ? undefined : aCallable$6(func);
385
+ };
386
+
387
+ var call$c = functionCall;
388
+ var isCallable$f = isCallable$k;
389
+ var isObject$4 = isObject$7;
390
+
391
+ var $TypeError$8 = TypeError;
392
+
393
+ // `OrdinaryToPrimitive` abstract operation
394
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
395
+ var ordinaryToPrimitive$1 = function (input, pref) {
396
+ var fn, val;
397
+ if (pref === 'string' && isCallable$f(fn = input.toString) && !isObject$4(val = call$c(fn, input))) return val;
398
+ if (isCallable$f(fn = input.valueOf) && !isObject$4(val = call$c(fn, input))) return val;
399
+ if (pref !== 'string' && isCallable$f(fn = input.toString) && !isObject$4(val = call$c(fn, input))) return val;
400
+ throw $TypeError$8("Can't convert object to primitive value");
401
+ };
402
+
403
+ var call$b = functionCall;
404
+ var isObject$3 = isObject$7;
405
+ var isSymbol$1 = isSymbol$2;
406
+ var getMethod$2 = getMethod$3;
407
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
408
+ var wellKnownSymbol$d = wellKnownSymbol$e;
409
+
410
+ var $TypeError$7 = TypeError;
411
+ var TO_PRIMITIVE = wellKnownSymbol$d('toPrimitive');
412
+
413
+ // `ToPrimitive` abstract operation
414
+ // https://tc39.es/ecma262/#sec-toprimitive
415
+ var toPrimitive$1 = function (input, pref) {
416
+ if (!isObject$3(input) || isSymbol$1(input)) return input;
417
+ var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
418
+ var result;
419
+ if (exoticToPrim) {
420
+ if (pref === undefined) pref = 'default';
421
+ result = call$b(exoticToPrim, input, pref);
422
+ if (!isObject$3(result) || isSymbol$1(result)) return result;
423
+ throw $TypeError$7("Can't convert object to primitive value");
424
+ }
425
+ if (pref === undefined) pref = 'number';
426
+ return ordinaryToPrimitive(input, pref);
427
+ };
428
+
429
+ var toPrimitive = toPrimitive$1;
430
+ var isSymbol = isSymbol$2;
431
+
432
+ // `ToPropertyKey` abstract operation
433
+ // https://tc39.es/ecma262/#sec-topropertykey
434
+ var toPropertyKey$2 = function (argument) {
435
+ var key = toPrimitive(argument, 'string');
436
+ return isSymbol(key) ? key : key + '';
437
+ };
438
+
439
+ var DESCRIPTORS$8 = descriptors;
440
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
441
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
442
+ var anObject$9 = anObject$a;
443
+ var toPropertyKey$1 = toPropertyKey$2;
444
+
445
+ var $TypeError$6 = TypeError;
446
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
447
+ var $defineProperty = Object.defineProperty;
448
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
449
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
450
+ var ENUMERABLE = 'enumerable';
451
+ var CONFIGURABLE$1 = 'configurable';
452
+ var WRITABLE = 'writable';
453
+
454
+ // `Object.defineProperty` method
455
+ // https://tc39.es/ecma262/#sec-object.defineproperty
456
+ objectDefineProperty.f = DESCRIPTORS$8 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
457
+ anObject$9(O);
458
+ P = toPropertyKey$1(P);
459
+ anObject$9(Attributes);
460
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
461
+ var current = $getOwnPropertyDescriptor$1(O, P);
462
+ if (current && current[WRITABLE]) {
463
+ O[P] = Attributes.value;
464
+ Attributes = {
465
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
466
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
467
+ writable: false
468
+ };
469
+ }
470
+ } return $defineProperty(O, P, Attributes);
471
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
472
+ anObject$9(O);
473
+ P = toPropertyKey$1(P);
474
+ anObject$9(Attributes);
475
+ if (IE8_DOM_DEFINE$1) try {
476
+ return $defineProperty(O, P, Attributes);
477
+ } catch (error) { /* empty */ }
478
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError$6('Accessors not supported');
479
+ if ('value' in Attributes) O[P] = Attributes.value;
480
+ return O;
481
+ };
482
+
483
+ var ceil = Math.ceil;
484
+ var floor = Math.floor;
485
+
486
+ // `Math.trunc` method
487
+ // https://tc39.es/ecma262/#sec-math.trunc
488
+ // eslint-disable-next-line es-x/no-math-trunc -- safe
489
+ var mathTrunc = Math.trunc || function trunc(x) {
490
+ var n = +x;
491
+ return (n > 0 ? floor : ceil)(n);
492
+ };
493
+
494
+ var trunc = mathTrunc;
495
+
496
+ // `ToIntegerOrInfinity` abstract operation
497
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
498
+ var toIntegerOrInfinity$2 = function (argument) {
499
+ var number = +argument;
500
+ // eslint-disable-next-line no-self-compare -- NaN check
501
+ return number !== number || number === 0 ? 0 : trunc(number);
502
+ };
503
+
504
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
505
+
506
+ var max = Math.max;
507
+ var min$1 = Math.min;
508
+
509
+ // Helper for a popular repeating case of the spec:
510
+ // Let integer be ? ToInteger(index).
511
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
512
+ var toAbsoluteIndex$1 = function (index, length) {
513
+ var integer = toIntegerOrInfinity$1(index);
514
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
515
+ };
516
+
517
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
518
+
519
+ var min = Math.min;
520
+
521
+ // `ToLength` abstract operation
522
+ // https://tc39.es/ecma262/#sec-tolength
523
+ var toLength$1 = function (argument) {
524
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
525
+ };
526
+
527
+ var toLength = toLength$1;
528
+
529
+ // `LengthOfArrayLike` abstract operation
530
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
531
+ var lengthOfArrayLike$2 = function (obj) {
532
+ return toLength(obj.length);
533
+ };
534
+
535
+ var toIndexedObject$4 = toIndexedObject$5;
536
+ var toAbsoluteIndex = toAbsoluteIndex$1;
537
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
538
+
539
+ // `Array.prototype.{ indexOf, includes }` methods implementation
540
+ var createMethod = function (IS_INCLUDES) {
541
+ return function ($this, el, fromIndex) {
542
+ var O = toIndexedObject$4($this);
543
+ var length = lengthOfArrayLike$1(O);
544
+ var index = toAbsoluteIndex(fromIndex, length);
545
+ var value;
546
+ // Array#includes uses SameValueZero equality algorithm
547
+ // eslint-disable-next-line no-self-compare -- NaN check
548
+ if (IS_INCLUDES && el != el) while (length > index) {
549
+ value = O[index++];
550
+ // eslint-disable-next-line no-self-compare -- NaN check
551
+ if (value != value) return true;
552
+ // Array#indexOf ignores holes, Array#includes - not
553
+ } else for (;length > index; index++) {
554
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
555
+ } return !IS_INCLUDES && -1;
556
+ };
557
+ };
558
+
559
+ var arrayIncludes = {
560
+ // `Array.prototype.includes` method
561
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
562
+ includes: createMethod(true),
563
+ // `Array.prototype.indexOf` method
564
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
565
+ indexOf: createMethod(false)
566
+ };
567
+
568
+ var hiddenKeys$4 = {};
569
+
570
+ var uncurryThis$8 = functionUncurryThis;
571
+ var hasOwn$8 = hasOwnProperty_1;
572
+ var toIndexedObject$3 = toIndexedObject$5;
573
+ var indexOf = arrayIncludes.indexOf;
574
+ var hiddenKeys$3 = hiddenKeys$4;
575
+
576
+ var push = uncurryThis$8([].push);
577
+
578
+ var objectKeysInternal = function (object, names) {
579
+ var O = toIndexedObject$3(object);
580
+ var i = 0;
581
+ var result = [];
582
+ var key;
583
+ for (key in O) !hasOwn$8(hiddenKeys$3, key) && hasOwn$8(O, key) && push(result, key);
584
+ // Don't enum bug & hidden keys
585
+ while (names.length > i) if (hasOwn$8(O, key = names[i++])) {
586
+ ~indexOf(result, key) || push(result, key);
587
+ }
588
+ return result;
589
+ };
590
+
591
+ // IE8- don't enum bug keys
592
+ var enumBugKeys$3 = [
593
+ 'constructor',
594
+ 'hasOwnProperty',
595
+ 'isPrototypeOf',
596
+ 'propertyIsEnumerable',
597
+ 'toLocaleString',
598
+ 'toString',
599
+ 'valueOf'
600
+ ];
601
+
602
+ var internalObjectKeys$1 = objectKeysInternal;
603
+ var enumBugKeys$2 = enumBugKeys$3;
604
+
605
+ // `Object.keys` method
606
+ // https://tc39.es/ecma262/#sec-object.keys
607
+ // eslint-disable-next-line es-x/no-object-keys -- safe
608
+ var objectKeys$2 = Object.keys || function keys(O) {
609
+ return internalObjectKeys$1(O, enumBugKeys$2);
610
+ };
611
+
612
+ var DESCRIPTORS$7 = descriptors;
613
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
614
+ var definePropertyModule$4 = objectDefineProperty;
615
+ var anObject$8 = anObject$a;
616
+ var toIndexedObject$2 = toIndexedObject$5;
617
+ var objectKeys$1 = objectKeys$2;
618
+
619
+ // `Object.defineProperties` method
620
+ // https://tc39.es/ecma262/#sec-object.defineproperties
621
+ // eslint-disable-next-line es-x/no-object-defineproperties -- safe
622
+ objectDefineProperties.f = DESCRIPTORS$7 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
623
+ anObject$8(O);
624
+ var props = toIndexedObject$2(Properties);
625
+ var keys = objectKeys$1(Properties);
626
+ var length = keys.length;
627
+ var index = 0;
628
+ var key;
629
+ while (length > index) definePropertyModule$4.f(O, key = keys[index++], props[key]);
630
+ return O;
631
+ };
632
+
633
+ var getBuiltIn$5 = getBuiltIn$8;
634
+
635
+ var html$2 = getBuiltIn$5('document', 'documentElement');
636
+
637
+ var shared$1 = shared$3.exports;
638
+ var uid = uid$2;
639
+
640
+ var keys = shared$1('keys');
641
+
642
+ var sharedKey$3 = function (key) {
643
+ return keys[key] || (keys[key] = uid(key));
644
+ };
645
+
646
+ /* global ActiveXObject -- old IE, WSH */
647
+
648
+ var anObject$7 = anObject$a;
649
+ var definePropertiesModule = objectDefineProperties;
650
+ var enumBugKeys$1 = enumBugKeys$3;
651
+ var hiddenKeys$2 = hiddenKeys$4;
652
+ var html$1 = html$2;
653
+ var documentCreateElement$1 = documentCreateElement$2;
654
+ var sharedKey$2 = sharedKey$3;
655
+
656
+ var GT = '>';
657
+ var LT = '<';
658
+ var PROTOTYPE = 'prototype';
659
+ var SCRIPT = 'script';
660
+ var IE_PROTO$1 = sharedKey$2('IE_PROTO');
661
+
662
+ var EmptyConstructor = function () { /* empty */ };
663
+
664
+ var scriptTag = function (content) {
665
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
666
+ };
667
+
668
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
669
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
670
+ activeXDocument.write(scriptTag(''));
671
+ activeXDocument.close();
672
+ var temp = activeXDocument.parentWindow.Object;
673
+ activeXDocument = null; // avoid memory leak
674
+ return temp;
675
+ };
676
+
677
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
678
+ var NullProtoObjectViaIFrame = function () {
679
+ // Thrash, waste and sodomy: IE GC bug
680
+ var iframe = documentCreateElement$1('iframe');
681
+ var JS = 'java' + SCRIPT + ':';
682
+ var iframeDocument;
683
+ iframe.style.display = 'none';
684
+ html$1.appendChild(iframe);
685
+ // https://github.com/zloirock/core-js/issues/475
686
+ iframe.src = String(JS);
687
+ iframeDocument = iframe.contentWindow.document;
688
+ iframeDocument.open();
689
+ iframeDocument.write(scriptTag('document.F=Object'));
690
+ iframeDocument.close();
691
+ return iframeDocument.F;
692
+ };
693
+
694
+ // Check for document.domain and active x support
695
+ // No need to use active x approach when document.domain is not set
696
+ // see https://github.com/es-shims/es5-shim/issues/150
697
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
698
+ // avoid IE GC bug
699
+ var activeXDocument;
700
+ var NullProtoObject = function () {
701
+ try {
702
+ activeXDocument = new ActiveXObject('htmlfile');
703
+ } catch (error) { /* ignore */ }
704
+ NullProtoObject = typeof document != 'undefined'
705
+ ? document.domain && activeXDocument
706
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
707
+ : NullProtoObjectViaIFrame()
708
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
709
+ var length = enumBugKeys$1.length;
710
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys$1[length]];
711
+ return NullProtoObject();
712
+ };
713
+
714
+ hiddenKeys$2[IE_PROTO$1] = true;
715
+
716
+ // `Object.create` method
717
+ // https://tc39.es/ecma262/#sec-object.create
718
+ // eslint-disable-next-line es-x/no-object-create -- safe
719
+ var objectCreate = Object.create || function create(O, Properties) {
720
+ var result;
721
+ if (O !== null) {
722
+ EmptyConstructor[PROTOTYPE] = anObject$7(O);
723
+ result = new EmptyConstructor();
724
+ EmptyConstructor[PROTOTYPE] = null;
725
+ // add "__proto__" for Object.getPrototypeOf polyfill
726
+ result[IE_PROTO$1] = O;
727
+ } else result = NullProtoObject();
728
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
729
+ };
730
+
731
+ var wellKnownSymbol$c = wellKnownSymbol$e;
732
+ var create$1 = objectCreate;
733
+ var defineProperty$4 = objectDefineProperty.f;
734
+
735
+ var UNSCOPABLES = wellKnownSymbol$c('unscopables');
736
+ var ArrayPrototype$1 = Array.prototype;
737
+
738
+ // Array.prototype[@@unscopables]
739
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
740
+ if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
741
+ defineProperty$4(ArrayPrototype$1, UNSCOPABLES, {
742
+ configurable: true,
743
+ value: create$1(null)
744
+ });
745
+ }
746
+
747
+ // add a key to Array.prototype[@@unscopables]
748
+ var addToUnscopables$1 = function (key) {
749
+ ArrayPrototype$1[UNSCOPABLES][key] = true;
750
+ };
751
+
752
+ var iterators = {};
753
+
754
+ var uncurryThis$7 = functionUncurryThis;
755
+ var isCallable$e = isCallable$k;
756
+ var store$1 = sharedStore;
757
+
758
+ var functionToString = uncurryThis$7(Function.toString);
759
+
760
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
761
+ if (!isCallable$e(store$1.inspectSource)) {
762
+ store$1.inspectSource = function (it) {
763
+ return functionToString(it);
764
+ };
765
+ }
766
+
767
+ var inspectSource$4 = store$1.inspectSource;
768
+
769
+ var global$c = global$j;
770
+ var isCallable$d = isCallable$k;
771
+ var inspectSource$3 = inspectSource$4;
772
+
773
+ var WeakMap$1 = global$c.WeakMap;
774
+
775
+ var nativeWeakMap = isCallable$d(WeakMap$1) && /native code/.test(inspectSource$3(WeakMap$1));
776
+
777
+ var createPropertyDescriptor$3 = function (bitmap, value) {
778
+ return {
779
+ enumerable: !(bitmap & 1),
780
+ configurable: !(bitmap & 2),
781
+ writable: !(bitmap & 4),
782
+ value: value
783
+ };
784
+ };
785
+
786
+ var DESCRIPTORS$6 = descriptors;
787
+ var definePropertyModule$3 = objectDefineProperty;
788
+ var createPropertyDescriptor$2 = createPropertyDescriptor$3;
789
+
790
+ var createNonEnumerableProperty$4 = DESCRIPTORS$6 ? function (object, key, value) {
791
+ return definePropertyModule$3.f(object, key, createPropertyDescriptor$2(1, value));
792
+ } : function (object, key, value) {
793
+ object[key] = value;
794
+ return object;
795
+ };
796
+
797
+ var NATIVE_WEAK_MAP = nativeWeakMap;
798
+ var global$b = global$j;
799
+ var uncurryThis$6 = functionUncurryThis;
800
+ var isObject$2 = isObject$7;
801
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
802
+ var hasOwn$7 = hasOwnProperty_1;
803
+ var shared = sharedStore;
804
+ var sharedKey$1 = sharedKey$3;
805
+ var hiddenKeys$1 = hiddenKeys$4;
806
+
807
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
808
+ var TypeError$2 = global$b.TypeError;
809
+ var WeakMap = global$b.WeakMap;
810
+ var set$1, get, has;
811
+
812
+ var enforce = function (it) {
813
+ return has(it) ? get(it) : set$1(it, {});
814
+ };
815
+
816
+ var getterFor = function (TYPE) {
817
+ return function (it) {
818
+ var state;
819
+ if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
820
+ throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
821
+ } return state;
822
+ };
823
+ };
824
+
825
+ if (NATIVE_WEAK_MAP || shared.state) {
826
+ var store = shared.state || (shared.state = new WeakMap());
827
+ var wmget = uncurryThis$6(store.get);
828
+ var wmhas = uncurryThis$6(store.has);
829
+ var wmset = uncurryThis$6(store.set);
830
+ set$1 = function (it, metadata) {
831
+ if (wmhas(store, it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
832
+ metadata.facade = it;
833
+ wmset(store, it, metadata);
834
+ return metadata;
835
+ };
836
+ get = function (it) {
837
+ return wmget(store, it) || {};
838
+ };
839
+ has = function (it) {
840
+ return wmhas(store, it);
841
+ };
842
+ } else {
843
+ var STATE = sharedKey$1('state');
844
+ hiddenKeys$1[STATE] = true;
845
+ set$1 = function (it, metadata) {
846
+ if (hasOwn$7(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
847
+ metadata.facade = it;
848
+ createNonEnumerableProperty$3(it, STATE, metadata);
849
+ return metadata;
850
+ };
851
+ get = function (it) {
852
+ return hasOwn$7(it, STATE) ? it[STATE] : {};
853
+ };
854
+ has = function (it) {
855
+ return hasOwn$7(it, STATE);
856
+ };
857
+ }
858
+
859
+ var internalState = {
860
+ set: set$1,
861
+ get: get,
862
+ has: has,
863
+ enforce: enforce,
864
+ getterFor: getterFor
865
+ };
866
+
867
+ var objectGetOwnPropertyDescriptor = {};
868
+
869
+ var objectPropertyIsEnumerable = {};
870
+
871
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
872
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
873
+ var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
874
+
875
+ // Nashorn ~ JDK8 bug
876
+ var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
877
+
878
+ // `Object.prototype.propertyIsEnumerable` method implementation
879
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
880
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
881
+ var descriptor = getOwnPropertyDescriptor$2(this, V);
882
+ return !!descriptor && descriptor.enumerable;
883
+ } : $propertyIsEnumerable;
884
+
885
+ var DESCRIPTORS$5 = descriptors;
886
+ var call$a = functionCall;
887
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
888
+ var createPropertyDescriptor$1 = createPropertyDescriptor$3;
889
+ var toIndexedObject$1 = toIndexedObject$5;
890
+ var toPropertyKey = toPropertyKey$2;
891
+ var hasOwn$6 = hasOwnProperty_1;
892
+ var IE8_DOM_DEFINE = ie8DomDefine;
893
+
894
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
895
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
896
+
897
+ // `Object.getOwnPropertyDescriptor` method
898
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
899
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
900
+ O = toIndexedObject$1(O);
901
+ P = toPropertyKey(P);
902
+ if (IE8_DOM_DEFINE) try {
903
+ return $getOwnPropertyDescriptor(O, P);
904
+ } catch (error) { /* empty */ }
905
+ if (hasOwn$6(O, P)) return createPropertyDescriptor$1(!call$a(propertyIsEnumerableModule$1.f, O, P), O[P]);
906
+ };
907
+
908
+ var makeBuiltIn$2 = {exports: {}};
909
+
910
+ var DESCRIPTORS$4 = descriptors;
911
+ var hasOwn$5 = hasOwnProperty_1;
912
+
913
+ var FunctionPrototype$1 = Function.prototype;
914
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
915
+ var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
916
+
917
+ var EXISTS = hasOwn$5(FunctionPrototype$1, 'name');
918
+ // additional protection from minified / mangled / dropped function names
919
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
920
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype$1, 'name').configurable));
921
+
922
+ var functionName = {
923
+ EXISTS: EXISTS,
924
+ PROPER: PROPER,
925
+ CONFIGURABLE: CONFIGURABLE
926
+ };
927
+
928
+ var fails$6 = fails$d;
929
+ var isCallable$c = isCallable$k;
930
+ var hasOwn$4 = hasOwnProperty_1;
931
+ var DESCRIPTORS$3 = descriptors;
932
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
933
+ var inspectSource$2 = inspectSource$4;
934
+ var InternalStateModule$2 = internalState;
935
+
936
+ var enforceInternalState = InternalStateModule$2.enforce;
937
+ var getInternalState$1 = InternalStateModule$2.get;
938
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
939
+ var defineProperty$3 = Object.defineProperty;
940
+
941
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$6(function () {
942
+ return defineProperty$3(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
943
+ });
944
+
945
+ var TEMPLATE = String(String).split('String');
946
+
947
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
948
+ if (String(name).slice(0, 7) === 'Symbol(') {
949
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
950
+ }
951
+ if (options && options.getter) name = 'get ' + name;
952
+ if (options && options.setter) name = 'set ' + name;
953
+ if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
954
+ if (DESCRIPTORS$3) defineProperty$3(value, 'name', { value: name, configurable: true });
955
+ else value.name = name;
956
+ }
957
+ if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
958
+ defineProperty$3(value, 'length', { value: options.arity });
959
+ }
960
+ try {
961
+ if (options && hasOwn$4(options, 'constructor') && options.constructor) {
962
+ if (DESCRIPTORS$3) defineProperty$3(value, 'prototype', { writable: false });
963
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
964
+ } else if (value.prototype) value.prototype = undefined;
965
+ } catch (error) { /* empty */ }
966
+ var state = enforceInternalState(value);
967
+ if (!hasOwn$4(state, 'source')) {
968
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
969
+ } return value;
970
+ };
971
+
972
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
973
+ // eslint-disable-next-line no-extend-native -- required
974
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
975
+ return isCallable$c(this) && getInternalState$1(this).source || inspectSource$2(this);
976
+ }, 'toString');
977
+
978
+ var isCallable$b = isCallable$k;
979
+ var definePropertyModule$2 = objectDefineProperty;
980
+ var makeBuiltIn = makeBuiltIn$2.exports;
981
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
982
+
983
+ var defineBuiltIn$5 = function (O, key, value, options) {
984
+ if (!options) options = {};
985
+ var simple = options.enumerable;
986
+ var name = options.name !== undefined ? options.name : key;
987
+ if (isCallable$b(value)) makeBuiltIn(value, name, options);
988
+ if (options.global) {
989
+ if (simple) O[key] = value;
990
+ else defineGlobalProperty$1(key, value);
991
+ } else {
992
+ try {
993
+ if (!options.unsafe) delete O[key];
994
+ else if (O[key]) simple = true;
995
+ } catch (error) { /* empty */ }
996
+ if (simple) O[key] = value;
997
+ else definePropertyModule$2.f(O, key, {
998
+ value: value,
999
+ enumerable: false,
1000
+ configurable: !options.nonConfigurable,
1001
+ writable: !options.nonWritable
1002
+ });
1003
+ } return O;
1004
+ };
1005
+
1006
+ var objectGetOwnPropertyNames = {};
1007
+
1008
+ var internalObjectKeys = objectKeysInternal;
1009
+ var enumBugKeys = enumBugKeys$3;
1010
+
1011
+ var hiddenKeys = enumBugKeys.concat('length', 'prototype');
1012
+
1013
+ // `Object.getOwnPropertyNames` method
1014
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
1015
+ // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
1016
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1017
+ return internalObjectKeys(O, hiddenKeys);
1018
+ };
1019
+
1020
+ var objectGetOwnPropertySymbols = {};
1021
+
1022
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
1023
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1024
+
1025
+ var getBuiltIn$4 = getBuiltIn$8;
1026
+ var uncurryThis$5 = functionUncurryThis;
1027
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1028
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
1029
+ var anObject$6 = anObject$a;
1030
+
1031
+ var concat$1 = uncurryThis$5([].concat);
1032
+
1033
+ // all object keys, includes non-enumerable and symbols
1034
+ var ownKeys$1 = getBuiltIn$4('Reflect', 'ownKeys') || function ownKeys(it) {
1035
+ var keys = getOwnPropertyNamesModule.f(anObject$6(it));
1036
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
1037
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
1038
+ };
1039
+
1040
+ var hasOwn$3 = hasOwnProperty_1;
1041
+ var ownKeys = ownKeys$1;
1042
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1043
+ var definePropertyModule$1 = objectDefineProperty;
1044
+
1045
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
1046
+ var keys = ownKeys(source);
1047
+ var defineProperty = definePropertyModule$1.f;
1048
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1049
+ for (var i = 0; i < keys.length; i++) {
1050
+ var key = keys[i];
1051
+ if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
1052
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1053
+ }
1054
+ }
1055
+ };
1056
+
1057
+ var fails$5 = fails$d;
1058
+ var isCallable$a = isCallable$k;
1059
+
1060
+ var replacement = /#|\.prototype\./;
1061
+
1062
+ var isForced$2 = function (feature, detection) {
1063
+ var value = data[normalize(feature)];
1064
+ return value == POLYFILL ? true
1065
+ : value == NATIVE ? false
1066
+ : isCallable$a(detection) ? fails$5(detection)
1067
+ : !!detection;
1068
+ };
1069
+
1070
+ var normalize = isForced$2.normalize = function (string) {
1071
+ return String(string).replace(replacement, '.').toLowerCase();
1072
+ };
1073
+
1074
+ var data = isForced$2.data = {};
1075
+ var NATIVE = isForced$2.NATIVE = 'N';
1076
+ var POLYFILL = isForced$2.POLYFILL = 'P';
1077
+
1078
+ var isForced_1 = isForced$2;
1079
+
1080
+ var global$a = global$j;
1081
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
1082
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
1083
+ var defineBuiltIn$4 = defineBuiltIn$5;
1084
+ var defineGlobalProperty = defineGlobalProperty$3;
1085
+ var copyConstructorProperties = copyConstructorProperties$1;
1086
+ var isForced$1 = isForced_1;
1087
+
1088
+ /*
1089
+ options.target - name of the target object
1090
+ options.global - target is the global object
1091
+ options.stat - export as static methods of target
1092
+ options.proto - export as prototype methods of target
1093
+ options.real - real prototype method for the `pure` version
1094
+ options.forced - export even if the native feature is available
1095
+ options.bind - bind methods to the target, required for the `pure` version
1096
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1097
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
1098
+ options.sham - add a flag to not completely full polyfills
1099
+ options.enumerable - export as enumerable property
1100
+ options.dontCallGetSet - prevent calling a getter on target
1101
+ options.name - the .name of the function if it does not match the key
1102
+ */
1103
+ var _export = function (options, source) {
1104
+ var TARGET = options.target;
1105
+ var GLOBAL = options.global;
1106
+ var STATIC = options.stat;
1107
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1108
+ if (GLOBAL) {
1109
+ target = global$a;
1110
+ } else if (STATIC) {
1111
+ target = global$a[TARGET] || defineGlobalProperty(TARGET, {});
1112
+ } else {
1113
+ target = (global$a[TARGET] || {}).prototype;
1114
+ }
1115
+ if (target) for (key in source) {
1116
+ sourceProperty = source[key];
1117
+ if (options.dontCallGetSet) {
1118
+ descriptor = getOwnPropertyDescriptor$1(target, key);
1119
+ targetProperty = descriptor && descriptor.value;
1120
+ } else targetProperty = target[key];
1121
+ FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1122
+ // contained in target
1123
+ if (!FORCED && targetProperty !== undefined) {
1124
+ if (typeof sourceProperty == typeof targetProperty) continue;
1125
+ copyConstructorProperties(sourceProperty, targetProperty);
1126
+ }
1127
+ // add a flag to not completely full polyfills
1128
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1129
+ createNonEnumerableProperty$2(sourceProperty, 'sham', true);
1130
+ }
1131
+ defineBuiltIn$4(target, key, sourceProperty, options);
1132
+ }
1133
+ };
1134
+
1135
+ var fails$4 = fails$d;
1136
+
1137
+ var correctPrototypeGetter = !fails$4(function () {
1138
+ function F() { /* empty */ }
1139
+ F.prototype.constructor = null;
1140
+ // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
1141
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1142
+ });
1143
+
1144
+ var hasOwn$2 = hasOwnProperty_1;
1145
+ var isCallable$9 = isCallable$k;
1146
+ var toObject$1 = toObject$3;
1147
+ var sharedKey = sharedKey$3;
1148
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1149
+
1150
+ var IE_PROTO = sharedKey('IE_PROTO');
1151
+ var $Object$1 = Object;
1152
+ var ObjectPrototype = $Object$1.prototype;
1153
+
1154
+ // `Object.getPrototypeOf` method
1155
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1156
+ // eslint-disable-next-line es-x/no-object-getprototypeof -- safe
1157
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1158
+ var object = toObject$1(O);
1159
+ if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1160
+ var constructor = object.constructor;
1161
+ if (isCallable$9(constructor) && object instanceof constructor) {
1162
+ return constructor.prototype;
1163
+ } return object instanceof $Object$1 ? ObjectPrototype : null;
1164
+ };
1165
+
1166
+ var fails$3 = fails$d;
1167
+ var isCallable$8 = isCallable$k;
1168
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1169
+ var defineBuiltIn$3 = defineBuiltIn$5;
1170
+ var wellKnownSymbol$b = wellKnownSymbol$e;
1171
+
1172
+ var ITERATOR$5 = wellKnownSymbol$b('iterator');
1173
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1174
+
1175
+ // `%IteratorPrototype%` object
1176
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1177
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1178
+
1179
+ /* eslint-disable es-x/no-array-prototype-keys -- safe */
1180
+ if ([].keys) {
1181
+ arrayIterator = [].keys();
1182
+ // Safari 8 has buggy iterators w/o `next`
1183
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1184
+ else {
1185
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1186
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1187
+ }
1188
+ }
1189
+
1190
+ var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$3(function () {
1191
+ var test = {};
1192
+ // FF44- legacy iterators case
1193
+ return IteratorPrototype$2[ITERATOR$5].call(test) !== test;
1194
+ });
1195
+
1196
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1197
+
1198
+ // `%IteratorPrototype%[@@iterator]()` method
1199
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1200
+ if (!isCallable$8(IteratorPrototype$2[ITERATOR$5])) {
1201
+ defineBuiltIn$3(IteratorPrototype$2, ITERATOR$5, function () {
1202
+ return this;
1203
+ });
1204
+ }
1205
+
1206
+ var iteratorsCore = {
1207
+ IteratorPrototype: IteratorPrototype$2,
1208
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1209
+ };
1210
+
1211
+ var defineProperty$2 = objectDefineProperty.f;
1212
+ var hasOwn$1 = hasOwnProperty_1;
1213
+ var wellKnownSymbol$a = wellKnownSymbol$e;
1214
+
1215
+ var TO_STRING_TAG$3 = wellKnownSymbol$a('toStringTag');
1216
+
1217
+ var setToStringTag$3 = function (target, TAG, STATIC) {
1218
+ if (target && !STATIC) target = target.prototype;
1219
+ if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1220
+ defineProperty$2(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1221
+ }
1222
+ };
1223
+
1224
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1225
+ var create = objectCreate;
1226
+ var createPropertyDescriptor = createPropertyDescriptor$3;
1227
+ var setToStringTag$2 = setToStringTag$3;
1228
+ var Iterators$4 = iterators;
1229
+
1230
+ var returnThis$1 = function () { return this; };
1231
+
1232
+ var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1233
+ var TO_STRING_TAG = NAME + ' Iterator';
1234
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1235
+ setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
1236
+ Iterators$4[TO_STRING_TAG] = returnThis$1;
1237
+ return IteratorConstructor;
1238
+ };
1239
+
1240
+ var isCallable$7 = isCallable$k;
1241
+
1242
+ var $String = String;
1243
+ var $TypeError$5 = TypeError;
1244
+
1245
+ var aPossiblePrototype$1 = function (argument) {
1246
+ if (typeof argument == 'object' || isCallable$7(argument)) return argument;
1247
+ throw $TypeError$5("Can't set " + $String(argument) + ' as a prototype');
1248
+ };
1249
+
1250
+ /* eslint-disable no-proto -- safe */
1251
+
1252
+ var uncurryThis$4 = functionUncurryThis;
1253
+ var anObject$5 = anObject$a;
1254
+ var aPossiblePrototype = aPossiblePrototype$1;
1255
+
1256
+ // `Object.setPrototypeOf` method
1257
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1258
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1259
+ // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
1260
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1261
+ var CORRECT_SETTER = false;
1262
+ var test = {};
1263
+ var setter;
1264
+ try {
1265
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
1266
+ setter = uncurryThis$4(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1267
+ setter(test, []);
1268
+ CORRECT_SETTER = test instanceof Array;
1269
+ } catch (error) { /* empty */ }
1270
+ return function setPrototypeOf(O, proto) {
1271
+ anObject$5(O);
1272
+ aPossiblePrototype(proto);
1273
+ if (CORRECT_SETTER) setter(O, proto);
1274
+ else O.__proto__ = proto;
1275
+ return O;
1276
+ };
1277
+ }() : undefined);
1278
+
1279
+ var $$7 = _export;
1280
+ var call$9 = functionCall;
1281
+ var FunctionName = functionName;
1282
+ var isCallable$6 = isCallable$k;
1283
+ var createIteratorConstructor = createIteratorConstructor$1;
1284
+ var getPrototypeOf = objectGetPrototypeOf;
1285
+ var setPrototypeOf$1 = objectSetPrototypeOf;
1286
+ var setToStringTag$1 = setToStringTag$3;
1287
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
1288
+ var defineBuiltIn$2 = defineBuiltIn$5;
1289
+ var wellKnownSymbol$9 = wellKnownSymbol$e;
1290
+ var Iterators$3 = iterators;
1291
+ var IteratorsCore = iteratorsCore;
1292
+
1293
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1294
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1295
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
1296
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1297
+ var ITERATOR$4 = wellKnownSymbol$9('iterator');
1298
+ var KEYS = 'keys';
1299
+ var VALUES = 'values';
1300
+ var ENTRIES = 'entries';
1301
+
1302
+ var returnThis = function () { return this; };
1303
+
1304
+ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1305
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1306
+
1307
+ var getIterationMethod = function (KIND) {
1308
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1309
+ if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1310
+ switch (KIND) {
1311
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1312
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1313
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1314
+ } return function () { return new IteratorConstructor(this); };
1315
+ };
1316
+
1317
+ var TO_STRING_TAG = NAME + ' Iterator';
1318
+ var INCORRECT_VALUES_NAME = false;
1319
+ var IterablePrototype = Iterable.prototype;
1320
+ var nativeIterator = IterablePrototype[ITERATOR$4]
1321
+ || IterablePrototype['@@iterator']
1322
+ || DEFAULT && IterablePrototype[DEFAULT];
1323
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1324
+ var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1325
+ var CurrentIteratorPrototype, methods, KEY;
1326
+
1327
+ // fix native
1328
+ if (anyNativeIterator) {
1329
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1330
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1331
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1332
+ if (setPrototypeOf$1) {
1333
+ setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
1334
+ } else if (!isCallable$6(CurrentIteratorPrototype[ITERATOR$4])) {
1335
+ defineBuiltIn$2(CurrentIteratorPrototype, ITERATOR$4, returnThis);
1336
+ }
1337
+ }
1338
+ // Set @@toStringTag to native iterators
1339
+ setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
1340
+ }
1341
+ }
1342
+
1343
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1344
+ if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1345
+ if (CONFIGURABLE_FUNCTION_NAME) {
1346
+ createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1347
+ } else {
1348
+ INCORRECT_VALUES_NAME = true;
1349
+ defaultIterator = function values() { return call$9(nativeIterator, this); };
1350
+ }
1351
+ }
1352
+
1353
+ // export additional methods
1354
+ if (DEFAULT) {
1355
+ methods = {
1356
+ values: getIterationMethod(VALUES),
1357
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1358
+ entries: getIterationMethod(ENTRIES)
1359
+ };
1360
+ if (FORCED) for (KEY in methods) {
1361
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1362
+ defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
1363
+ }
1364
+ } else $$7({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1365
+ }
1366
+
1367
+ // define iterator
1368
+ if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
1369
+ defineBuiltIn$2(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
1370
+ }
1371
+ Iterators$3[NAME] = defaultIterator;
1372
+
1373
+ return methods;
1374
+ };
1375
+
1376
+ var toIndexedObject = toIndexedObject$5;
1377
+ var addToUnscopables = addToUnscopables$1;
1378
+ var Iterators$2 = iterators;
1379
+ var InternalStateModule$1 = internalState;
1380
+ var defineProperty$1 = objectDefineProperty.f;
1381
+ var defineIterator = defineIterator$1;
1382
+ var DESCRIPTORS$2 = descriptors;
1383
+
1384
+ var ARRAY_ITERATOR = 'Array Iterator';
1385
+ var setInternalState$1 = InternalStateModule$1.set;
1386
+ var getInternalState = InternalStateModule$1.getterFor(ARRAY_ITERATOR);
1387
+
1388
+ // `Array.prototype.entries` method
1389
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1390
+ // `Array.prototype.keys` method
1391
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1392
+ // `Array.prototype.values` method
1393
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1394
+ // `Array.prototype[@@iterator]` method
1395
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1396
+ // `CreateArrayIterator` internal method
1397
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1398
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1399
+ setInternalState$1(this, {
1400
+ type: ARRAY_ITERATOR,
1401
+ target: toIndexedObject(iterated), // target
1402
+ index: 0, // next index
1403
+ kind: kind // kind
1404
+ });
1405
+ // `%ArrayIteratorPrototype%.next` method
1406
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1407
+ }, function () {
1408
+ var state = getInternalState(this);
1409
+ var target = state.target;
1410
+ var kind = state.kind;
1411
+ var index = state.index++;
1412
+ if (!target || index >= target.length) {
1413
+ state.target = undefined;
1414
+ return { value: undefined, done: true };
1415
+ }
1416
+ if (kind == 'keys') return { value: index, done: false };
1417
+ if (kind == 'values') return { value: target[index], done: false };
1418
+ return { value: [index, target[index]], done: false };
1419
+ }, 'values');
1420
+
1421
+ // argumentsList[@@iterator] is %ArrayProto_values%
1422
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1423
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1424
+ var values = Iterators$2.Arguments = Iterators$2.Array;
1425
+
1426
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1427
+ addToUnscopables('keys');
1428
+ addToUnscopables('values');
1429
+ addToUnscopables('entries');
1430
+
1431
+ // V8 ~ Chrome 45- bug
1432
+ if (DESCRIPTORS$2 && values.name !== 'values') try {
1433
+ defineProperty$1(values, 'name', { value: 'values' });
1434
+ } catch (error) { /* empty */ }
1435
+
1436
+ var classof$3 = classofRaw$1;
1437
+ var global$9 = global$j;
1438
+
1439
+ var engineIsNode = classof$3(global$9.process) == 'process';
1440
+
1441
+ var getBuiltIn$3 = getBuiltIn$8;
1442
+ var definePropertyModule = objectDefineProperty;
1443
+ var wellKnownSymbol$8 = wellKnownSymbol$e;
1444
+ var DESCRIPTORS$1 = descriptors;
1445
+
1446
+ var SPECIES$2 = wellKnownSymbol$8('species');
1447
+
1448
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1449
+ var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
1450
+ var defineProperty = definePropertyModule.f;
1451
+
1452
+ if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES$2]) {
1453
+ defineProperty(Constructor, SPECIES$2, {
1454
+ configurable: true,
1455
+ get: function () { return this; }
1456
+ });
1457
+ }
1458
+ };
1459
+
1460
+ var isPrototypeOf$1 = objectIsPrototypeOf;
1461
+
1462
+ var $TypeError$4 = TypeError;
1463
+
1464
+ var anInstance$1 = function (it, Prototype) {
1465
+ if (isPrototypeOf$1(Prototype, it)) return it;
1466
+ throw $TypeError$4('Incorrect invocation');
1467
+ };
1468
+
1469
+ var wellKnownSymbol$7 = wellKnownSymbol$e;
1470
+
1471
+ var TO_STRING_TAG$2 = wellKnownSymbol$7('toStringTag');
1472
+ var test = {};
1473
+
1474
+ test[TO_STRING_TAG$2] = 'z';
1475
+
1476
+ var toStringTagSupport = String(test) === '[object z]';
1477
+
1478
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1479
+ var isCallable$5 = isCallable$k;
1480
+ var classofRaw = classofRaw$1;
1481
+ var wellKnownSymbol$6 = wellKnownSymbol$e;
1482
+
1483
+ var TO_STRING_TAG$1 = wellKnownSymbol$6('toStringTag');
1484
+ var $Object = Object;
1485
+
1486
+ // ES3 wrong here
1487
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1488
+
1489
+ // fallback for IE11 Script Access Denied error
1490
+ var tryGet = function (it, key) {
1491
+ try {
1492
+ return it[key];
1493
+ } catch (error) { /* empty */ }
1494
+ };
1495
+
1496
+ // getting tag from ES6+ `Object.prototype.toString`
1497
+ var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1498
+ var O, tag, result;
1499
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1500
+ // @@toStringTag case
1501
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG$1)) == 'string' ? tag
1502
+ // builtinTag case
1503
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1504
+ // ES3 arguments fallback
1505
+ : (result = classofRaw(O)) == 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1506
+ };
1507
+
1508
+ var uncurryThis$3 = functionUncurryThis;
1509
+ var fails$2 = fails$d;
1510
+ var isCallable$4 = isCallable$k;
1511
+ var classof$1 = classof$2;
1512
+ var getBuiltIn$2 = getBuiltIn$8;
1513
+ var inspectSource$1 = inspectSource$4;
1514
+
1515
+ var noop = function () { /* empty */ };
1516
+ var empty = [];
1517
+ var construct = getBuiltIn$2('Reflect', 'construct');
1518
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1519
+ var exec = uncurryThis$3(constructorRegExp.exec);
1520
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1521
+
1522
+ var isConstructorModern = function isConstructor(argument) {
1523
+ if (!isCallable$4(argument)) return false;
1524
+ try {
1525
+ construct(noop, empty, argument);
1526
+ return true;
1527
+ } catch (error) {
1528
+ return false;
1529
+ }
1530
+ };
1531
+
1532
+ var isConstructorLegacy = function isConstructor(argument) {
1533
+ if (!isCallable$4(argument)) return false;
1534
+ switch (classof$1(argument)) {
1535
+ case 'AsyncFunction':
1536
+ case 'GeneratorFunction':
1537
+ case 'AsyncGeneratorFunction': return false;
1538
+ }
1539
+ try {
1540
+ // we can't check .prototype since constructors produced by .bind haven't it
1541
+ // `Function#toString` throws on some built-it function in some legacy engines
1542
+ // (for example, `DOMQuad` and similar in FF41-)
1543
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
1544
+ } catch (error) {
1545
+ return true;
1546
+ }
1547
+ };
1548
+
1549
+ isConstructorLegacy.sham = true;
1550
+
1551
+ // `IsConstructor` abstract operation
1552
+ // https://tc39.es/ecma262/#sec-isconstructor
1553
+ var isConstructor$1 = !construct || fails$2(function () {
1554
+ var called;
1555
+ return isConstructorModern(isConstructorModern.call)
1556
+ || !isConstructorModern(Object)
1557
+ || !isConstructorModern(function () { called = true; })
1558
+ || called;
1559
+ }) ? isConstructorLegacy : isConstructorModern;
1560
+
1561
+ var isConstructor = isConstructor$1;
1562
+ var tryToString$2 = tryToString$4;
1563
+
1564
+ var $TypeError$3 = TypeError;
1565
+
1566
+ // `Assert: IsConstructor(argument) is true`
1567
+ var aConstructor$1 = function (argument) {
1568
+ if (isConstructor(argument)) return argument;
1569
+ throw $TypeError$3(tryToString$2(argument) + ' is not a constructor');
1570
+ };
1571
+
1572
+ var anObject$4 = anObject$a;
1573
+ var aConstructor = aConstructor$1;
1574
+ var wellKnownSymbol$5 = wellKnownSymbol$e;
1575
+
1576
+ var SPECIES$1 = wellKnownSymbol$5('species');
1577
+
1578
+ // `SpeciesConstructor` abstract operation
1579
+ // https://tc39.es/ecma262/#sec-speciesconstructor
1580
+ var speciesConstructor$1 = function (O, defaultConstructor) {
1581
+ var C = anObject$4(O).constructor;
1582
+ var S;
1583
+ return C === undefined || (S = anObject$4(C)[SPECIES$1]) == undefined ? defaultConstructor : aConstructor(S);
1584
+ };
1585
+
1586
+ var NATIVE_BIND$1 = functionBindNative;
1587
+
1588
+ var FunctionPrototype = Function.prototype;
1589
+ var apply$1 = FunctionPrototype.apply;
1590
+ var call$8 = FunctionPrototype.call;
1591
+
1592
+ // eslint-disable-next-line es-x/no-reflect -- safe
1593
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$8.bind(apply$1) : function () {
1594
+ return call$8.apply(apply$1, arguments);
1595
+ });
1596
+
1597
+ var uncurryThis$2 = functionUncurryThis;
1598
+ var aCallable$5 = aCallable$7;
1599
+ var NATIVE_BIND = functionBindNative;
1600
+
1601
+ var bind$4 = uncurryThis$2(uncurryThis$2.bind);
1602
+
1603
+ // optional / simple context binding
1604
+ var functionBindContext = function (fn, that) {
1605
+ aCallable$5(fn);
1606
+ return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
1607
+ return fn.apply(that, arguments);
1608
+ };
1609
+ };
1610
+
1611
+ var uncurryThis$1 = functionUncurryThis;
1612
+
1613
+ var arraySlice$1 = uncurryThis$1([].slice);
1614
+
1615
+ var $TypeError$2 = TypeError;
1616
+
1617
+ var validateArgumentsLength$1 = function (passed, required) {
1618
+ if (passed < required) throw $TypeError$2('Not enough arguments');
1619
+ return passed;
1620
+ };
1621
+
1622
+ var userAgent$2 = engineUserAgent;
1623
+
1624
+ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
1625
+
1626
+ var global$8 = global$j;
1627
+ var apply = functionApply;
1628
+ var bind$3 = functionBindContext;
1629
+ var isCallable$3 = isCallable$k;
1630
+ var hasOwn = hasOwnProperty_1;
1631
+ var fails$1 = fails$d;
1632
+ var html = html$2;
1633
+ var arraySlice = arraySlice$1;
1634
+ var createElement = documentCreateElement$2;
1635
+ var validateArgumentsLength = validateArgumentsLength$1;
1636
+ var IS_IOS$1 = engineIsIos;
1637
+ var IS_NODE$3 = engineIsNode;
1638
+
1639
+ var set = global$8.setImmediate;
1640
+ var clear = global$8.clearImmediate;
1641
+ var process$2 = global$8.process;
1642
+ var Dispatch = global$8.Dispatch;
1643
+ var Function$1 = global$8.Function;
1644
+ var MessageChannel = global$8.MessageChannel;
1645
+ var String$1 = global$8.String;
1646
+ var counter = 0;
1647
+ var queue$1 = {};
1648
+ var ONREADYSTATECHANGE = 'onreadystatechange';
1649
+ var location, defer, channel, port;
1650
+
1651
+ try {
1652
+ // Deno throws a ReferenceError on `location` access without `--location` flag
1653
+ location = global$8.location;
1654
+ } catch (error) { /* empty */ }
1655
+
1656
+ var run = function (id) {
1657
+ if (hasOwn(queue$1, id)) {
1658
+ var fn = queue$1[id];
1659
+ delete queue$1[id];
1660
+ fn();
1661
+ }
1662
+ };
1663
+
1664
+ var runner = function (id) {
1665
+ return function () {
1666
+ run(id);
1667
+ };
1668
+ };
1669
+
1670
+ var listener = function (event) {
1671
+ run(event.data);
1672
+ };
1673
+
1674
+ var post = function (id) {
1675
+ // old engines have not location.origin
1676
+ global$8.postMessage(String$1(id), location.protocol + '//' + location.host);
1677
+ };
1678
+
1679
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1680
+ if (!set || !clear) {
1681
+ set = function setImmediate(handler) {
1682
+ validateArgumentsLength(arguments.length, 1);
1683
+ var fn = isCallable$3(handler) ? handler : Function$1(handler);
1684
+ var args = arraySlice(arguments, 1);
1685
+ queue$1[++counter] = function () {
1686
+ apply(fn, undefined, args);
1687
+ };
1688
+ defer(counter);
1689
+ return counter;
1690
+ };
1691
+ clear = function clearImmediate(id) {
1692
+ delete queue$1[id];
1693
+ };
1694
+ // Node.js 0.8-
1695
+ if (IS_NODE$3) {
1696
+ defer = function (id) {
1697
+ process$2.nextTick(runner(id));
1698
+ };
1699
+ // Sphere (JS game engine) Dispatch API
1700
+ } else if (Dispatch && Dispatch.now) {
1701
+ defer = function (id) {
1702
+ Dispatch.now(runner(id));
1703
+ };
1704
+ // Browsers with MessageChannel, includes WebWorkers
1705
+ // except iOS - https://github.com/zloirock/core-js/issues/624
1706
+ } else if (MessageChannel && !IS_IOS$1) {
1707
+ channel = new MessageChannel();
1708
+ port = channel.port2;
1709
+ channel.port1.onmessage = listener;
1710
+ defer = bind$3(port.postMessage, port);
1711
+ // Browsers with postMessage, skip WebWorkers
1712
+ // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
1713
+ } else if (
1714
+ global$8.addEventListener &&
1715
+ isCallable$3(global$8.postMessage) &&
1716
+ !global$8.importScripts &&
1717
+ location && location.protocol !== 'file:' &&
1718
+ !fails$1(post)
1719
+ ) {
1720
+ defer = post;
1721
+ global$8.addEventListener('message', listener, false);
1722
+ // IE8-
1723
+ } else if (ONREADYSTATECHANGE in createElement('script')) {
1724
+ defer = function (id) {
1725
+ html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
1726
+ html.removeChild(this);
1727
+ run(id);
1728
+ };
1729
+ };
1730
+ // Rest old browsers
1731
+ } else {
1732
+ defer = function (id) {
1733
+ setTimeout(runner(id), 0);
1734
+ };
1735
+ }
1736
+ }
1737
+
1738
+ var task$1 = {
1739
+ set: set,
1740
+ clear: clear
1741
+ };
1742
+
1743
+ var userAgent$1 = engineUserAgent;
1744
+ var global$7 = global$j;
1745
+
1746
+ var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$7.Pebble !== undefined;
1747
+
1748
+ var userAgent = engineUserAgent;
1749
+
1750
+ var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
1751
+
1752
+ var global$6 = global$j;
1753
+ var bind$2 = functionBindContext;
1754
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1755
+ var macrotask = task$1.set;
1756
+ var IS_IOS = engineIsIos;
1757
+ var IS_IOS_PEBBLE = engineIsIosPebble;
1758
+ var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
1759
+ var IS_NODE$2 = engineIsNode;
1760
+
1761
+ var MutationObserver = global$6.MutationObserver || global$6.WebKitMutationObserver;
1762
+ var document$2 = global$6.document;
1763
+ var process$1 = global$6.process;
1764
+ var Promise$1 = global$6.Promise;
1765
+ // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
1766
+ var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$6, 'queueMicrotask');
1767
+ var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
1768
+
1769
+ var flush, head, last, notify$1, toggle, node, promise, then;
1770
+
1771
+ // modern engines have queueMicrotask method
1772
+ if (!queueMicrotask) {
1773
+ flush = function () {
1774
+ var parent, fn;
1775
+ if (IS_NODE$2 && (parent = process$1.domain)) parent.exit();
1776
+ while (head) {
1777
+ fn = head.fn;
1778
+ head = head.next;
1779
+ try {
1780
+ fn();
1781
+ } catch (error) {
1782
+ if (head) notify$1();
1783
+ else last = undefined;
1784
+ throw error;
1785
+ }
1786
+ } last = undefined;
1787
+ if (parent) parent.enter();
1788
+ };
1789
+
1790
+ // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
1791
+ // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
1792
+ if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
1793
+ toggle = true;
1794
+ node = document$2.createTextNode('');
1795
+ new MutationObserver(flush).observe(node, { characterData: true });
1796
+ notify$1 = function () {
1797
+ node.data = toggle = !toggle;
1798
+ };
1799
+ // environments with maybe non-completely correct, but existent Promise
1800
+ } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
1801
+ // Promise.resolve without an argument throws an error in LG WebOS 2
1802
+ promise = Promise$1.resolve(undefined);
1803
+ // workaround of WebKit ~ iOS Safari 10.1 bug
1804
+ promise.constructor = Promise$1;
1805
+ then = bind$2(promise.then, promise);
1806
+ notify$1 = function () {
1807
+ then(flush);
1808
+ };
1809
+ // Node.js without promises
1810
+ } else if (IS_NODE$2) {
1811
+ notify$1 = function () {
1812
+ process$1.nextTick(flush);
1813
+ };
1814
+ // for other environments - macrotask based on:
1815
+ // - setImmediate
1816
+ // - MessageChannel
1817
+ // - window.postMessage
1818
+ // - onreadystatechange
1819
+ // - setTimeout
1820
+ } else {
1821
+ // strange IE + webpack dev server bug - use .bind(global)
1822
+ macrotask = bind$2(macrotask, global$6);
1823
+ notify$1 = function () {
1824
+ macrotask(flush);
1825
+ };
1826
+ }
1827
+ }
1828
+
1829
+ var microtask$1 = queueMicrotask || function (fn) {
1830
+ var task = { fn: fn, next: undefined };
1831
+ if (last) last.next = task;
1832
+ if (!head) {
1833
+ head = task;
1834
+ notify$1();
1835
+ } last = task;
1836
+ };
1837
+
1838
+ var global$5 = global$j;
1839
+
1840
+ var hostReportErrors$1 = function (a, b) {
1841
+ var console = global$5.console;
1842
+ if (console && console.error) {
1843
+ arguments.length == 1 ? console.error(a) : console.error(a, b);
1844
+ }
1845
+ };
1846
+
1847
+ var perform$3 = function (exec) {
1848
+ try {
1849
+ return { error: false, value: exec() };
1850
+ } catch (error) {
1851
+ return { error: true, value: error };
1852
+ }
1853
+ };
1854
+
1855
+ var Queue$1 = function () {
1856
+ this.head = null;
1857
+ this.tail = null;
1858
+ };
1859
+
1860
+ Queue$1.prototype = {
1861
+ add: function (item) {
1862
+ var entry = { item: item, next: null };
1863
+ if (this.head) this.tail.next = entry;
1864
+ else this.head = entry;
1865
+ this.tail = entry;
1866
+ },
1867
+ get: function () {
1868
+ var entry = this.head;
1869
+ if (entry) {
1870
+ this.head = entry.next;
1871
+ if (this.tail === entry) this.tail = null;
1872
+ return entry.item;
1873
+ }
1874
+ }
1875
+ };
1876
+
1877
+ var queue = Queue$1;
1878
+
1879
+ var global$4 = global$j;
1880
+
1881
+ var promiseNativeConstructor = global$4.Promise;
1882
+
1883
+ /* global Deno -- Deno case */
1884
+
1885
+ var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
1886
+
1887
+ var IS_DENO$1 = engineIsDeno;
1888
+ var IS_NODE$1 = engineIsNode;
1889
+
1890
+ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
1891
+ && typeof window == 'object'
1892
+ && typeof document == 'object';
1893
+
1894
+ var global$3 = global$j;
1895
+ var NativePromiseConstructor$3 = promiseNativeConstructor;
1896
+ var isCallable$2 = isCallable$k;
1897
+ var isForced = isForced_1;
1898
+ var inspectSource = inspectSource$4;
1899
+ var wellKnownSymbol$4 = wellKnownSymbol$e;
1900
+ var IS_BROWSER = engineIsBrowser;
1901
+ var IS_DENO = engineIsDeno;
1902
+ var V8_VERSION = engineV8Version;
1903
+
1904
+ NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
1905
+ var SPECIES = wellKnownSymbol$4('species');
1906
+ var SUBCLASSING = false;
1907
+ var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$2(global$3.PromiseRejectionEvent);
1908
+
1909
+ var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
1910
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
1911
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
1912
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1913
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1914
+ // We can't detect it synchronously, so just check versions
1915
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
1916
+ // We can't use @@species feature detection in V8 since it causes
1917
+ // deoptimization and performance degradation
1918
+ // https://github.com/zloirock/core-js/issues/679
1919
+ if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
1920
+ // Detect correctness of subclassing with @@species support
1921
+ var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
1922
+ var FakePromise = function (exec) {
1923
+ exec(function () { /* empty */ }, function () { /* empty */ });
1924
+ };
1925
+ var constructor = promise.constructor = {};
1926
+ constructor[SPECIES] = FakePromise;
1927
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
1928
+ if (!SUBCLASSING) return true;
1929
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1930
+ } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
1931
+ });
1932
+
1933
+ var promiseConstructorDetection = {
1934
+ CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
1935
+ REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
1936
+ SUBCLASSING: SUBCLASSING
1937
+ };
1938
+
1939
+ var newPromiseCapability$2 = {};
1940
+
1941
+ var aCallable$4 = aCallable$7;
1942
+
1943
+ var PromiseCapability = function (C) {
1944
+ var resolve, reject;
1945
+ this.promise = new C(function ($$resolve, $$reject) {
1946
+ if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
1947
+ resolve = $$resolve;
1948
+ reject = $$reject;
1949
+ });
1950
+ this.resolve = aCallable$4(resolve);
1951
+ this.reject = aCallable$4(reject);
1952
+ };
1953
+
1954
+ // `NewPromiseCapability` abstract operation
1955
+ // https://tc39.es/ecma262/#sec-newpromisecapability
1956
+ newPromiseCapability$2.f = function (C) {
1957
+ return new PromiseCapability(C);
1958
+ };
1959
+
1960
+ var $$6 = _export;
1961
+ var IS_NODE = engineIsNode;
1962
+ var global$2 = global$j;
1963
+ var call$7 = functionCall;
1964
+ var defineBuiltIn$1 = defineBuiltIn$5;
1965
+ var setPrototypeOf = objectSetPrototypeOf;
1966
+ var setToStringTag = setToStringTag$3;
1967
+ var setSpecies = setSpecies$1;
1968
+ var aCallable$3 = aCallable$7;
1969
+ var isCallable$1 = isCallable$k;
1970
+ var isObject$1 = isObject$7;
1971
+ var anInstance = anInstance$1;
1972
+ var speciesConstructor = speciesConstructor$1;
1973
+ var task = task$1.set;
1974
+ var microtask = microtask$1;
1975
+ var hostReportErrors = hostReportErrors$1;
1976
+ var perform$2 = perform$3;
1977
+ var Queue = queue;
1978
+ var InternalStateModule = internalState;
1979
+ var NativePromiseConstructor$2 = promiseNativeConstructor;
1980
+ var PromiseConstructorDetection = promiseConstructorDetection;
1981
+ var newPromiseCapabilityModule$3 = newPromiseCapability$2;
1982
+
1983
+ var PROMISE = 'Promise';
1984
+ var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
1985
+ var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
1986
+ var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
1987
+ var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
1988
+ var setInternalState = InternalStateModule.set;
1989
+ var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
1990
+ var PromiseConstructor = NativePromiseConstructor$2;
1991
+ var PromisePrototype = NativePromisePrototype$1;
1992
+ var TypeError$1 = global$2.TypeError;
1993
+ var document$1 = global$2.document;
1994
+ var process = global$2.process;
1995
+ var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
1996
+ var newGenericPromiseCapability = newPromiseCapability$1;
1997
+
1998
+ var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$2.dispatchEvent);
1999
+ var UNHANDLED_REJECTION = 'unhandledrejection';
2000
+ var REJECTION_HANDLED = 'rejectionhandled';
2001
+ var PENDING = 0;
2002
+ var FULFILLED = 1;
2003
+ var REJECTED = 2;
2004
+ var HANDLED = 1;
2005
+ var UNHANDLED = 2;
2006
+
2007
+ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
2008
+
2009
+ // helpers
2010
+ var isThenable = function (it) {
2011
+ var then;
2012
+ return isObject$1(it) && isCallable$1(then = it.then) ? then : false;
2013
+ };
2014
+
2015
+ var callReaction = function (reaction, state) {
2016
+ var value = state.value;
2017
+ var ok = state.state == FULFILLED;
2018
+ var handler = ok ? reaction.ok : reaction.fail;
2019
+ var resolve = reaction.resolve;
2020
+ var reject = reaction.reject;
2021
+ var domain = reaction.domain;
2022
+ var result, then, exited;
2023
+ try {
2024
+ if (handler) {
2025
+ if (!ok) {
2026
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
2027
+ state.rejection = HANDLED;
2028
+ }
2029
+ if (handler === true) result = value;
2030
+ else {
2031
+ if (domain) domain.enter();
2032
+ result = handler(value); // can throw
2033
+ if (domain) {
2034
+ domain.exit();
2035
+ exited = true;
2036
+ }
2037
+ }
2038
+ if (result === reaction.promise) {
2039
+ reject(TypeError$1('Promise-chain cycle'));
2040
+ } else if (then = isThenable(result)) {
2041
+ call$7(then, result, resolve, reject);
2042
+ } else resolve(result);
2043
+ } else reject(value);
2044
+ } catch (error) {
2045
+ if (domain && !exited) domain.exit();
2046
+ reject(error);
2047
+ }
2048
+ };
2049
+
2050
+ var notify = function (state, isReject) {
2051
+ if (state.notified) return;
2052
+ state.notified = true;
2053
+ microtask(function () {
2054
+ var reactions = state.reactions;
2055
+ var reaction;
2056
+ while (reaction = reactions.get()) {
2057
+ callReaction(reaction, state);
2058
+ }
2059
+ state.notified = false;
2060
+ if (isReject && !state.rejection) onUnhandled(state);
2061
+ });
2062
+ };
2063
+
2064
+ var dispatchEvent = function (name, promise, reason) {
2065
+ var event, handler;
2066
+ if (DISPATCH_EVENT) {
2067
+ event = document$1.createEvent('Event');
2068
+ event.promise = promise;
2069
+ event.reason = reason;
2070
+ event.initEvent(name, false, true);
2071
+ global$2.dispatchEvent(event);
2072
+ } else event = { promise: promise, reason: reason };
2073
+ if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$2['on' + name])) handler(event);
2074
+ else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
2075
+ };
2076
+
2077
+ var onUnhandled = function (state) {
2078
+ call$7(task, global$2, function () {
2079
+ var promise = state.facade;
2080
+ var value = state.value;
2081
+ var IS_UNHANDLED = isUnhandled(state);
2082
+ var result;
2083
+ if (IS_UNHANDLED) {
2084
+ result = perform$2(function () {
2085
+ if (IS_NODE) {
2086
+ process.emit('unhandledRejection', value, promise);
2087
+ } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
2088
+ });
2089
+ // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
2090
+ state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
2091
+ if (result.error) throw result.value;
2092
+ }
2093
+ });
2094
+ };
2095
+
2096
+ var isUnhandled = function (state) {
2097
+ return state.rejection !== HANDLED && !state.parent;
2098
+ };
2099
+
2100
+ var onHandleUnhandled = function (state) {
2101
+ call$7(task, global$2, function () {
2102
+ var promise = state.facade;
2103
+ if (IS_NODE) {
2104
+ process.emit('rejectionHandled', promise);
2105
+ } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
2106
+ });
2107
+ };
2108
+
2109
+ var bind$1 = function (fn, state, unwrap) {
2110
+ return function (value) {
2111
+ fn(state, value, unwrap);
2112
+ };
2113
+ };
2114
+
2115
+ var internalReject = function (state, value, unwrap) {
2116
+ if (state.done) return;
2117
+ state.done = true;
2118
+ if (unwrap) state = unwrap;
2119
+ state.value = value;
2120
+ state.state = REJECTED;
2121
+ notify(state, true);
2122
+ };
2123
+
2124
+ var internalResolve = function (state, value, unwrap) {
2125
+ if (state.done) return;
2126
+ state.done = true;
2127
+ if (unwrap) state = unwrap;
2128
+ try {
2129
+ if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
2130
+ var then = isThenable(value);
2131
+ if (then) {
2132
+ microtask(function () {
2133
+ var wrapper = { done: false };
2134
+ try {
2135
+ call$7(then, value,
2136
+ bind$1(internalResolve, wrapper, state),
2137
+ bind$1(internalReject, wrapper, state)
2138
+ );
2139
+ } catch (error) {
2140
+ internalReject(wrapper, error, state);
2141
+ }
2142
+ });
2143
+ } else {
2144
+ state.value = value;
2145
+ state.state = FULFILLED;
2146
+ notify(state, false);
2147
+ }
2148
+ } catch (error) {
2149
+ internalReject({ done: false }, error, state);
2150
+ }
2151
+ };
2152
+
2153
+ // constructor polyfill
2154
+ if (FORCED_PROMISE_CONSTRUCTOR$4) {
2155
+ // 25.4.3.1 Promise(executor)
2156
+ PromiseConstructor = function Promise(executor) {
2157
+ anInstance(this, PromisePrototype);
2158
+ aCallable$3(executor);
2159
+ call$7(Internal, this);
2160
+ var state = getInternalPromiseState(this);
2161
+ try {
2162
+ executor(bind$1(internalResolve, state), bind$1(internalReject, state));
2163
+ } catch (error) {
2164
+ internalReject(state, error);
2165
+ }
2166
+ };
2167
+
2168
+ PromisePrototype = PromiseConstructor.prototype;
2169
+
2170
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
2171
+ Internal = function Promise(executor) {
2172
+ setInternalState(this, {
2173
+ type: PROMISE,
2174
+ done: false,
2175
+ notified: false,
2176
+ parent: false,
2177
+ reactions: new Queue(),
2178
+ rejection: false,
2179
+ state: PENDING,
2180
+ value: undefined
2181
+ });
2182
+ };
2183
+
2184
+ // `Promise.prototype.then` method
2185
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
2186
+ Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
2187
+ var state = getInternalPromiseState(this);
2188
+ var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
2189
+ state.parent = true;
2190
+ reaction.ok = isCallable$1(onFulfilled) ? onFulfilled : true;
2191
+ reaction.fail = isCallable$1(onRejected) && onRejected;
2192
+ reaction.domain = IS_NODE ? process.domain : undefined;
2193
+ if (state.state == PENDING) state.reactions.add(reaction);
2194
+ else microtask(function () {
2195
+ callReaction(reaction, state);
2196
+ });
2197
+ return reaction.promise;
2198
+ });
2199
+
2200
+ OwnPromiseCapability = function () {
2201
+ var promise = new Internal();
2202
+ var state = getInternalPromiseState(promise);
2203
+ this.promise = promise;
2204
+ this.resolve = bind$1(internalResolve, state);
2205
+ this.reject = bind$1(internalReject, state);
2206
+ };
2207
+
2208
+ newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
2209
+ return C === PromiseConstructor || C === PromiseWrapper
2210
+ ? new OwnPromiseCapability(C)
2211
+ : newGenericPromiseCapability(C);
2212
+ };
2213
+
2214
+ if (isCallable$1(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
2215
+ nativeThen = NativePromisePrototype$1.then;
2216
+
2217
+ if (!NATIVE_PROMISE_SUBCLASSING) {
2218
+ // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
2219
+ defineBuiltIn$1(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
2220
+ var that = this;
2221
+ return new PromiseConstructor(function (resolve, reject) {
2222
+ call$7(nativeThen, that, resolve, reject);
2223
+ }).then(onFulfilled, onRejected);
2224
+ // https://github.com/zloirock/core-js/issues/640
2225
+ }, { unsafe: true });
2226
+ }
2227
+
2228
+ // make `.constructor === Promise` work for native promise-based APIs
2229
+ try {
2230
+ delete NativePromisePrototype$1.constructor;
2231
+ } catch (error) { /* empty */ }
2232
+
2233
+ // make `instanceof Promise` work for native promise-based APIs
2234
+ if (setPrototypeOf) {
2235
+ setPrototypeOf(NativePromisePrototype$1, PromisePrototype);
2236
+ }
2237
+ }
2238
+ }
2239
+
2240
+ $$6({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
2241
+ Promise: PromiseConstructor
2242
+ });
2243
+
2244
+ setToStringTag(PromiseConstructor, PROMISE, false);
2245
+ setSpecies(PROMISE);
2246
+
2247
+ var wellKnownSymbol$3 = wellKnownSymbol$e;
2248
+ var Iterators$1 = iterators;
2249
+
2250
+ var ITERATOR$3 = wellKnownSymbol$3('iterator');
2251
+ var ArrayPrototype = Array.prototype;
2252
+
2253
+ // check on default Array iterator
2254
+ var isArrayIteratorMethod$1 = function (it) {
2255
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$3] === it);
2256
+ };
2257
+
2258
+ var classof = classof$2;
2259
+ var getMethod$1 = getMethod$3;
2260
+ var Iterators = iterators;
2261
+ var wellKnownSymbol$2 = wellKnownSymbol$e;
2262
+
2263
+ var ITERATOR$2 = wellKnownSymbol$2('iterator');
2264
+
2265
+ var getIteratorMethod$2 = function (it) {
2266
+ if (it != undefined) return getMethod$1(it, ITERATOR$2)
2267
+ || getMethod$1(it, '@@iterator')
2268
+ || Iterators[classof(it)];
2269
+ };
2270
+
2271
+ var call$6 = functionCall;
2272
+ var aCallable$2 = aCallable$7;
2273
+ var anObject$3 = anObject$a;
2274
+ var tryToString$1 = tryToString$4;
2275
+ var getIteratorMethod$1 = getIteratorMethod$2;
2276
+
2277
+ var $TypeError$1 = TypeError;
2278
+
2279
+ var getIterator$1 = function (argument, usingIterator) {
2280
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
2281
+ if (aCallable$2(iteratorMethod)) return anObject$3(call$6(iteratorMethod, argument));
2282
+ throw $TypeError$1(tryToString$1(argument) + ' is not iterable');
2283
+ };
2284
+
2285
+ var call$5 = functionCall;
2286
+ var anObject$2 = anObject$a;
2287
+ var getMethod = getMethod$3;
2288
+
2289
+ var iteratorClose$1 = function (iterator, kind, value) {
2290
+ var innerResult, innerError;
2291
+ anObject$2(iterator);
2292
+ try {
2293
+ innerResult = getMethod(iterator, 'return');
2294
+ if (!innerResult) {
2295
+ if (kind === 'throw') throw value;
2296
+ return value;
2297
+ }
2298
+ innerResult = call$5(innerResult, iterator);
2299
+ } catch (error) {
2300
+ innerError = true;
2301
+ innerResult = error;
2302
+ }
2303
+ if (kind === 'throw') throw value;
2304
+ if (innerError) throw innerResult;
2305
+ anObject$2(innerResult);
2306
+ return value;
2307
+ };
2308
+
2309
+ var bind = functionBindContext;
2310
+ var call$4 = functionCall;
2311
+ var anObject$1 = anObject$a;
2312
+ var tryToString = tryToString$4;
2313
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
2314
+ var lengthOfArrayLike = lengthOfArrayLike$2;
2315
+ var isPrototypeOf = objectIsPrototypeOf;
2316
+ var getIterator = getIterator$1;
2317
+ var getIteratorMethod = getIteratorMethod$2;
2318
+ var iteratorClose = iteratorClose$1;
2319
+
2320
+ var $TypeError = TypeError;
2321
+
2322
+ var Result = function (stopped, result) {
2323
+ this.stopped = stopped;
2324
+ this.result = result;
2325
+ };
2326
+
2327
+ var ResultPrototype = Result.prototype;
2328
+
2329
+ var iterate$2 = function (iterable, unboundFunction, options) {
2330
+ var that = options && options.that;
2331
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2332
+ var IS_RECORD = !!(options && options.IS_RECORD);
2333
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2334
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
2335
+ var fn = bind(unboundFunction, that);
2336
+ var iterator, iterFn, index, length, result, next, step;
2337
+
2338
+ var stop = function (condition) {
2339
+ if (iterator) iteratorClose(iterator, 'normal', condition);
2340
+ return new Result(true, condition);
2341
+ };
2342
+
2343
+ var callFn = function (value) {
2344
+ if (AS_ENTRIES) {
2345
+ anObject$1(value);
2346
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2347
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
2348
+ };
2349
+
2350
+ if (IS_RECORD) {
2351
+ iterator = iterable.iterator;
2352
+ } else if (IS_ITERATOR) {
2353
+ iterator = iterable;
2354
+ } else {
2355
+ iterFn = getIteratorMethod(iterable);
2356
+ if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
2357
+ // optimisation for array iterators
2358
+ if (isArrayIteratorMethod(iterFn)) {
2359
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2360
+ result = callFn(iterable[index]);
2361
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
2362
+ } return new Result(false);
2363
+ }
2364
+ iterator = getIterator(iterable, iterFn);
2365
+ }
2366
+
2367
+ next = IS_RECORD ? iterable.next : iterator.next;
2368
+ while (!(step = call$4(next, iterator)).done) {
2369
+ try {
2370
+ result = callFn(step.value);
2371
+ } catch (error) {
2372
+ iteratorClose(iterator, 'throw', error);
2373
+ }
2374
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
2375
+ } return new Result(false);
2376
+ };
2377
+
2378
+ var wellKnownSymbol$1 = wellKnownSymbol$e;
2379
+
2380
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
2381
+ var SAFE_CLOSING = false;
2382
+
2383
+ try {
2384
+ var called = 0;
2385
+ var iteratorWithReturn = {
2386
+ next: function () {
2387
+ return { done: !!called++ };
2388
+ },
2389
+ 'return': function () {
2390
+ SAFE_CLOSING = true;
2391
+ }
2392
+ };
2393
+ iteratorWithReturn[ITERATOR$1] = function () {
2394
+ return this;
2395
+ };
2396
+ // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
2397
+ Array.from(iteratorWithReturn, function () { throw 2; });
2398
+ } catch (error) { /* empty */ }
2399
+
2400
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
2401
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2402
+ var ITERATION_SUPPORT = false;
2403
+ try {
2404
+ var object = {};
2405
+ object[ITERATOR$1] = function () {
2406
+ return {
2407
+ next: function () {
2408
+ return { done: ITERATION_SUPPORT = true };
2409
+ }
2410
+ };
2411
+ };
2412
+ exec(object);
2413
+ } catch (error) { /* empty */ }
2414
+ return ITERATION_SUPPORT;
2415
+ };
2416
+
2417
+ var NativePromiseConstructor$1 = promiseNativeConstructor;
2418
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
2419
+ var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
2420
+
2421
+ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
2422
+ NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
2423
+ });
2424
+
2425
+ var $$5 = _export;
2426
+ var call$3 = functionCall;
2427
+ var aCallable$1 = aCallable$7;
2428
+ var newPromiseCapabilityModule$2 = newPromiseCapability$2;
2429
+ var perform$1 = perform$3;
2430
+ var iterate$1 = iterate$2;
2431
+ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
2432
+
2433
+ // `Promise.all` method
2434
+ // https://tc39.es/ecma262/#sec-promise.all
2435
+ $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2436
+ all: function all(iterable) {
2437
+ var C = this;
2438
+ var capability = newPromiseCapabilityModule$2.f(C);
2439
+ var resolve = capability.resolve;
2440
+ var reject = capability.reject;
2441
+ var result = perform$1(function () {
2442
+ var $promiseResolve = aCallable$1(C.resolve);
2443
+ var values = [];
2444
+ var counter = 0;
2445
+ var remaining = 1;
2446
+ iterate$1(iterable, function (promise) {
2447
+ var index = counter++;
2448
+ var alreadyCalled = false;
2449
+ remaining++;
2450
+ call$3($promiseResolve, C, promise).then(function (value) {
2451
+ if (alreadyCalled) return;
2452
+ alreadyCalled = true;
2453
+ values[index] = value;
2454
+ --remaining || resolve(values);
2455
+ }, reject);
2456
+ });
2457
+ --remaining || resolve(values);
2458
+ });
2459
+ if (result.error) reject(result.value);
2460
+ return capability.promise;
2461
+ }
2462
+ });
2463
+
2464
+ var $$4 = _export;
2465
+ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2466
+ var NativePromiseConstructor = promiseNativeConstructor;
2467
+ var getBuiltIn$1 = getBuiltIn$8;
2468
+ var isCallable = isCallable$k;
2469
+ var defineBuiltIn = defineBuiltIn$5;
2470
+
2471
+ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
2472
+
2473
+ // `Promise.prototype.catch` method
2474
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
2475
+ $$4({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2476
+ 'catch': function (onRejected) {
2477
+ return this.then(undefined, onRejected);
2478
+ }
2479
+ });
2480
+
2481
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
2482
+ if (isCallable(NativePromiseConstructor)) {
2483
+ var method = getBuiltIn$1('Promise').prototype['catch'];
2484
+ if (NativePromisePrototype['catch'] !== method) {
2485
+ defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
2486
+ }
2487
+ }
2488
+
2489
+ var $$3 = _export;
2490
+ var call$2 = functionCall;
2491
+ var aCallable = aCallable$7;
2492
+ var newPromiseCapabilityModule$1 = newPromiseCapability$2;
2493
+ var perform = perform$3;
2494
+ var iterate = iterate$2;
2495
+ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
2496
+
2497
+ // `Promise.race` method
2498
+ // https://tc39.es/ecma262/#sec-promise.race
2499
+ $$3({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2500
+ race: function race(iterable) {
2501
+ var C = this;
2502
+ var capability = newPromiseCapabilityModule$1.f(C);
2503
+ var reject = capability.reject;
2504
+ var result = perform(function () {
2505
+ var $promiseResolve = aCallable(C.resolve);
2506
+ iterate(iterable, function (promise) {
2507
+ call$2($promiseResolve, C, promise).then(capability.resolve, reject);
2508
+ });
2509
+ });
2510
+ if (result.error) reject(result.value);
2511
+ return capability.promise;
2512
+ }
2513
+ });
2514
+
2515
+ var $$2 = _export;
2516
+ var call$1 = functionCall;
2517
+ var newPromiseCapabilityModule = newPromiseCapability$2;
2518
+ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2519
+
2520
+ // `Promise.reject` method
2521
+ // https://tc39.es/ecma262/#sec-promise.reject
2522
+ $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2523
+ reject: function reject(r) {
2524
+ var capability = newPromiseCapabilityModule.f(this);
2525
+ call$1(capability.reject, undefined, r);
2526
+ return capability.promise;
2527
+ }
2528
+ });
2529
+
2530
+ var anObject = anObject$a;
2531
+ var isObject = isObject$7;
2532
+ var newPromiseCapability = newPromiseCapability$2;
2533
+
2534
+ var promiseResolve$1 = function (C, x) {
2535
+ anObject(C);
2536
+ if (isObject(x) && x.constructor === C) return x;
2537
+ var promiseCapability = newPromiseCapability.f(C);
2538
+ var resolve = promiseCapability.resolve;
2539
+ resolve(x);
2540
+ return promiseCapability.promise;
2541
+ };
2542
+
2543
+ var $$1 = _export;
2544
+ var getBuiltIn = getBuiltIn$8;
2545
+ var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2546
+ var promiseResolve = promiseResolve$1;
2547
+
2548
+ getBuiltIn('Promise');
2549
+
2550
+ // `Promise.resolve` method
2551
+ // https://tc39.es/ecma262/#sec-promise.resolve
2552
+ $$1({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2553
+ resolve: function resolve(x) {
2554
+ return promiseResolve(this, x);
2555
+ }
2556
+ });
2557
+
2558
+ // iterable DOM collections
2559
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2560
+ var domIterables = {
2561
+ CSSRuleList: 0,
2562
+ CSSStyleDeclaration: 0,
2563
+ CSSValueList: 0,
2564
+ ClientRectList: 0,
2565
+ DOMRectList: 0,
2566
+ DOMStringList: 0,
2567
+ DOMTokenList: 1,
2568
+ DataTransferItemList: 0,
2569
+ FileList: 0,
2570
+ HTMLAllCollection: 0,
2571
+ HTMLCollection: 0,
2572
+ HTMLFormElement: 0,
2573
+ HTMLSelectElement: 0,
2574
+ MediaList: 0,
2575
+ MimeTypeArray: 0,
2576
+ NamedNodeMap: 0,
2577
+ NodeList: 1,
2578
+ PaintRequestList: 0,
2579
+ Plugin: 0,
2580
+ PluginArray: 0,
2581
+ SVGLengthList: 0,
2582
+ SVGNumberList: 0,
2583
+ SVGPathSegList: 0,
2584
+ SVGPointList: 0,
2585
+ SVGStringList: 0,
2586
+ SVGTransformList: 0,
2587
+ SourceBufferList: 0,
2588
+ StyleSheetList: 0,
2589
+ TextTrackCueList: 0,
2590
+ TextTrackList: 0,
2591
+ TouchList: 0
2592
+ };
2593
+
2594
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
2595
+ var documentCreateElement = documentCreateElement$2;
2596
+
2597
+ var classList = documentCreateElement('span').classList;
2598
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
2599
+
2600
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
2601
+
2602
+ var global$1 = global$j;
2603
+ var DOMIterables = domIterables;
2604
+ var DOMTokenListPrototype = domTokenListPrototype;
2605
+ var ArrayIteratorMethods = es_array_iterator;
2606
+ var createNonEnumerableProperty = createNonEnumerableProperty$4;
2607
+ var wellKnownSymbol = wellKnownSymbol$e;
2608
+
2609
+ var ITERATOR = wellKnownSymbol('iterator');
2610
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2611
+ var ArrayValues = ArrayIteratorMethods.values;
2612
+
2613
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
2614
+ if (CollectionPrototype) {
2615
+ // some Chrome versions have non-configurable methods on DOMTokenList
2616
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
2617
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
2618
+ } catch (error) {
2619
+ CollectionPrototype[ITERATOR] = ArrayValues;
2620
+ }
2621
+ if (!CollectionPrototype[TO_STRING_TAG]) {
2622
+ createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
2623
+ }
2624
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
2625
+ // some Chrome versions have non-configurable methods on DOMTokenList
2626
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
2627
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
2628
+ } catch (error) {
2629
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
2630
+ }
2631
+ }
2632
+ }
2633
+ };
2634
+
2635
+ for (var COLLECTION_NAME in DOMIterables) {
2636
+ handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
2637
+ }
2638
+
2639
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
2640
+
2641
+ var DESCRIPTORS = descriptors;
2642
+ var uncurryThis = functionUncurryThis;
2643
+ var call = functionCall;
2644
+ var fails = fails$d;
2645
+ var objectKeys = objectKeys$2;
2646
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2647
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
2648
+ var toObject = toObject$3;
2649
+ var IndexedObject = indexedObject;
2650
+
2651
+ // eslint-disable-next-line es-x/no-object-assign -- safe
2652
+ var $assign = Object.assign;
2653
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
2654
+ var defineProperty = Object.defineProperty;
2655
+ var concat = uncurryThis([].concat);
2656
+
2657
+ // `Object.assign` method
2658
+ // https://tc39.es/ecma262/#sec-object.assign
2659
+ var objectAssign = !$assign || fails(function () {
2660
+ // should have correct order of operations (Edge bug)
2661
+ if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
2662
+ enumerable: true,
2663
+ get: function () {
2664
+ defineProperty(this, 'b', {
2665
+ value: 3,
2666
+ enumerable: false
2667
+ });
2668
+ }
2669
+ }), { b: 2 })).b !== 1) return true;
2670
+ // should work with symbols and should have deterministic property order (V8 bug)
2671
+ var A = {};
2672
+ var B = {};
2673
+ // eslint-disable-next-line es-x/no-symbol -- safe
2674
+ var symbol = Symbol();
2675
+ var alphabet = 'abcdefghijklmnopqrst';
2676
+ A[symbol] = 7;
2677
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
2678
+ return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
2679
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
2680
+ var T = toObject(target);
2681
+ var argumentsLength = arguments.length;
2682
+ var index = 1;
2683
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
2684
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
2685
+ while (argumentsLength > index) {
2686
+ var S = IndexedObject(arguments[index++]);
2687
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
2688
+ var length = keys.length;
2689
+ var j = 0;
2690
+ var key;
2691
+ while (length > j) {
2692
+ key = keys[j++];
2693
+ if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
2694
+ }
2695
+ } return T;
2696
+ } : $assign;
2697
+
2698
+ var $ = _export;
2699
+ var assign = objectAssign;
2700
+
2701
+ // `Object.assign` method
2702
+ // https://tc39.es/ecma262/#sec-object.assign
2703
+ // eslint-disable-next-line es-x/no-object-assign -- required for testing
2704
+ $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
2705
+ assign: assign
2706
+ });
2707
+
2708
+ /******************************************************************************
2709
+ Copyright (c) Microsoft Corporation.
2710
+
2711
+ Permission to use, copy, modify, and/or distribute this software for any
2712
+ purpose with or without fee is hereby granted.
2713
+
2714
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2715
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2716
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2717
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2718
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2719
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2720
+ PERFORMANCE OF THIS SOFTWARE.
2721
+ ***************************************************************************** */
2722
+
2723
+ function __awaiter(thisArg, _arguments, P, generator) {
2724
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2725
+ return new (P || (P = Promise))(function (resolve, reject) {
2726
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2727
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2728
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2729
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2730
+ });
2731
+ }
2732
+
2733
+ const ShipmentForm = ({
2734
+ onShipmentDirty,
2735
+ // Must be referentially stable
2736
+ onShipmentUpdated,
2737
+ salesOrder,
2738
+ shipment
2739
+ }) => {
2740
+ var _a;
2741
+
2742
+ const {
2743
+ t
2744
+ } = elementsCore.useTranslation(["purchase-label"]);
2745
+ const logger = elementsCore.useLogger();
2746
+ const warehouses = elementsCore.useListWarehouses();
2747
+ const carriers = elementsCore.useListCarriers();
2748
+ const createShipment = elementsCore.useCreateShipment({
2749
+ salesOrderId: salesOrder.salesOrderId
2750
+ });
2751
+ const updateShipment = elementsCore.useUpdateShipment({
2752
+ shipmentId: shipment === null || shipment === void 0 ? void 0 : shipment.shipmentId
2753
+ });
2754
+ const validateAddresses = elementsCore.useValidateAddresses();
2755
+
2756
+ const handleSubmit = values => __awaiter(void 0, void 0, void 0, function* () {
2757
+ try {
2758
+ let newOrUpdatedShipment; // If a shipment exists, update it. Otherwise, create a new shipment.
2759
+
2760
+ if (shipment) {
2761
+ newOrUpdatedShipment = yield updateShipment.trigger(values);
2762
+ } else {
2763
+ if (!salesOrder) throw new Error(t("purchase-label:salesOrderNotLoaded"));
2764
+ newOrUpdatedShipment = yield createShipment.trigger(values);
2765
+ }
2766
+
2767
+ if (newOrUpdatedShipment) onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(newOrUpdatedShipment);
2768
+ } catch (err) {
2769
+ logger.error({
2770
+ err
2771
+ }, "Error updating shipment: %s", err.message);
2772
+ }
2773
+ }); // Validates the address on the sales order when it loads. The result of the
2774
+ // validation will be available on validateAddresses.data.
2775
+
2776
+
2777
+ react.useEffect(() => {
2778
+ if (salesOrder && !validateAddresses.data && !validateAddresses.isMutating) {
2779
+ validateAddresses.trigger({
2780
+ addresses: [salesOrder.shipTo]
2781
+ });
2782
+ }
2783
+ }, [validateAddresses, salesOrder]);
2784
+ const errors = [...(updateShipment.errors || []), ...(createShipment.errors || [])];
2785
+ return jsxRuntime.jsx(elementsUncontrolled.UncontrolledShipmentForm, {
2786
+ errors: errors,
2787
+ onDirty: onShipmentDirty,
2788
+ shipToValidationStatus: (_a = validateAddresses.data) === null || _a === void 0 ? void 0 : _a[0].status,
2789
+ onSubmit: handleSubmit,
2790
+ carriers: carriers.data,
2791
+ warehouses: warehouses.data,
2792
+ salesOrder: salesOrder,
2793
+ shipment: shipment
2794
+ });
2795
+ };
2796
+
2797
+ const RateForm = ({
2798
+ rates,
2799
+ loading: _loading = false,
2800
+ errors,
2801
+ onLabelCreated
2802
+ }) => {
2803
+ var _a;
2804
+
2805
+ const createLabel = elementsCore.useCreateLabel();
2806
+
2807
+ const handleSubmit = values => __awaiter(void 0, void 0, void 0, function* () {
2808
+ const label = yield createLabel.trigger(values);
2809
+ if (label) onLabelCreated === null || onLabelCreated === void 0 ? void 0 : onLabelCreated(label);
2810
+ });
2811
+
2812
+ const carriers = elementsCore.useListCarriers();
2813
+ const mergedErrors = [...(errors !== null && errors !== void 0 ? errors : []), ...((_a = createLabel.errors) !== null && _a !== void 0 ? _a : [])];
2814
+ return jsxRuntime.jsx(elementsUncontrolled.UncontrolledRateForm, {
2815
+ errors: mergedErrors,
2816
+ rates: rates,
2817
+ carriers: carriers.data,
2818
+ onSubmit: handleSubmit,
2819
+ loading: _loading
2820
+ });
2821
+ };
2822
+
2823
+ const SalesOrder = ({
2824
+ externalOrderId,
2825
+ externalOrderNumber,
2826
+ onLoad,
2827
+ onPurchase,
2828
+ orderSourceCode,
2829
+ salesOrderId
2830
+ }) => {
2831
+ var _a, _b, _c, _d;
2832
+
2833
+ const {
2834
+ t
2835
+ } = elementsCore.useTranslation(["common", "purchase-label"]);
2836
+ const logger = elementsCore.useLogger();
2837
+ const carriers = elementsCore.useListCarriers();
2838
+ const salesOrders = elementsCore.useListSalesOrders({
2839
+ externalOrderId,
2840
+ externalOrderNumber,
2841
+ salesOrderIds: salesOrderId ? [salesOrderId] : undefined
2842
+ });
2843
+ const orderSources = elementsCore.useListOrderSources({
2844
+ orderSourceCode
2845
+ });
2846
+ const refreshOrderSource = elementsCore.useRefreshOrderSource();
2847
+ const calculateRates = elementsCore.useCalculateRates();
2848
+ const shipments = elementsCore.useListShipments({
2849
+ salesOrderIds: salesOrders.data ? salesOrders.data.map(s => s.salesOrderId) : undefined
2850
+ });
2851
+ react.useEffect(() => {
2852
+ // Refreshes the matching order sources and re-executes the sales-order fetch
2853
+ // to handle scenarios where the sales order has not yet been imported. If the
2854
+ // order source has already refreshed and there is still no matching order, bubble it up
2855
+ // to the error boundary.
2856
+ const refresh = () => __awaiter(void 0, void 0, void 0, function* () {
2857
+ if (orderSources.data && salesOrders.data) {
2858
+ if (salesOrders.data.length === 0) {
2859
+ if (!refreshOrderSource.data) {
2860
+ yield Promise.all(orderSources.data.map(o => refreshOrderSource.trigger(o)));
2861
+ salesOrders.mutate();
2862
+ } else {
2863
+ throw new Error("errorMessages.unableToLoad.salesOrder");
2864
+ }
2865
+ }
2866
+ }
2867
+ });
2868
+
2869
+ refresh();
2870
+ }, [orderSourceCode, refreshOrderSource, salesOrders, orderSources]);
2871
+ react.useEffect(() => {
2872
+ // Executes the onLoad callback when both the sales order and it's shipments
2873
+ // have been loaded. This can be used to react to various states the order
2874
+ // or shipments may be in – for instance, redirecting to a shipment when the
2875
+ // order has already been fulfilled.
2876
+ if (onLoad && salesOrders.data && shipments.data) {
2877
+ onLoad(salesOrders.data[0], shipments.data);
2878
+ }
2879
+ }, [onLoad, salesOrders.data, shipments.data]);
2880
+ const handleShipmentUpdated = react.useCallback(shipment => __awaiter(void 0, void 0, void 0, function* () {
2881
+ var _e, _f;
2882
+
2883
+ const result = yield calculateRates.trigger({
2884
+ shipmentId: shipment.shipmentId,
2885
+ rateOptions: {
2886
+ carrierIds: shipment.carrierId ? [shipment.carrierId] : (_f = (_e = carriers.data) === null || _e === void 0 ? void 0 : _e.map(c => c.carrierId)) !== null && _f !== void 0 ? _f : [],
2887
+ packageTypes: shipment.packages.map(pkg => pkg.packageCode),
2888
+ serviceCodes: shipment.serviceCode ? [shipment.serviceCode] : undefined
2889
+ }
2890
+ }); // We are hiding, from the user, any errors in the rate response if the response
2891
+ // contains rates. Log to the console any rate errors if the response has rates.
2892
+
2893
+ if ((result === null || result === void 0 ? void 0 : result.errors.length) && result.rates.length) {
2894
+ logger.error({
2895
+ obj: result.errors
2896
+ }, `Rate response had errors`);
2897
+ }
2898
+ }), [calculateRates, carriers.data, logger]);
2899
+ const handleShipmentDirty = react.useCallback(() => {
2900
+ calculateRates.reset();
2901
+ }, [calculateRates]);
2902
+ const handleLabelCreated = react.useCallback(label => __awaiter(void 0, void 0, void 0, function* () {
2903
+ if (label) onPurchase === null || onPurchase === void 0 ? void 0 : onPurchase(label);
2904
+ }), [onPurchase]);
2905
+ if (salesOrders.isLoading) return jsxRuntime.jsx(elementsUi.Spinner, {
2906
+ children: t("loading.salesOrder")
2907
+ });
2908
+ if (salesOrders.errors) throw new Error(salesOrders.errors.map(e => e.message).join(", "));
2909
+ if (orderSources.isLoading) return jsxRuntime.jsx(elementsUi.Spinner, {
2910
+ children: t("loading.importingSalesOrder")
2911
+ });
2912
+ if (orderSources.errors) throw new Error(orderSources.errors.map(e => e.message).join(", "));
2913
+ if (!salesOrders.data) throw new Error(t("errorMessages.unableToLoad.salesOrder"));
2914
+ if (salesOrders.data.length === 0) return jsxRuntime.jsx(elementsUi.Spinner, {
2915
+ children: t("loading.importingSalesOrder")
2916
+ });
2917
+ if (shipments.isLoading) return jsxRuntime.jsx(elementsUi.Spinner, {
2918
+ children: t("loading.shipment")
2919
+ });
2920
+ if (shipments.errors) throw new Error(shipments.errors.map(e => e.message).join(", "));
2921
+ if (!shipments.data) throw new Error(t("errorMessages.unableToLoad.shipment"));
2922
+ const salesOrder = salesOrders.data[0];
2923
+ const shipment = shipments.data.find(s => s.shipmentStatus === "pending");
2924
+ return jsxRuntime.jsxs(elementsUncontrolled.UncontrolledSalesOrder, Object.assign({
2925
+ salesOrder: salesOrder
2926
+ }, {
2927
+ children: [jsxRuntime.jsx(ShipmentForm, {
2928
+ onShipmentDirty: handleShipmentDirty,
2929
+ onShipmentUpdated: handleShipmentUpdated,
2930
+ salesOrder: salesOrder,
2931
+ shipment: shipment
2932
+ }), jsxRuntime.jsx(RateForm, {
2933
+ errors: [...((_a = calculateRates.errors) !== null && _a !== void 0 ? _a : []), ...((_c = (_b = calculateRates.data) === null || _b === void 0 ? void 0 : _b.errors) !== null && _c !== void 0 ? _c : [])],
2934
+ loading: calculateRates.isMutating,
2935
+ onLabelCreated: handleLabelCreated,
2936
+ rates: (_d = calculateRates.data) === null || _d === void 0 ? void 0 : _d.rates
2937
+ })]
2938
+ }));
2939
+ };
2940
+
2941
+ var config = {
2942
+ sentryDSN: "https://94ade54a9f5046d5a9c84a93874fcc75@o106853.ingest.sentry.io/6624796"
2943
+ };
2944
+
2945
+ const Element$2 = elementsCore.registerElement("purchase-label", SalesOrder, config);
2946
+
2947
+ const Shipment = ({
2948
+ shipmentId,
2949
+ onClickVoidLabel,
2950
+ onClickPurchaseLabel
2951
+ }) => {
2952
+ var _a, _b, _c;
2953
+
2954
+ const {
2955
+ t
2956
+ } = elementsCore.useTranslation(["common", "view-shipment"]);
2957
+ const shipment = elementsCore.useGetShipment({
2958
+ shipmentId
2959
+ });
2960
+ const labels = elementsCore.useListLabels({
2961
+ shipmentId
2962
+ });
2963
+ const salesOrders = elementsCore.useListSalesOrders({
2964
+ salesOrderIds: (_a = shipment.data) === null || _a === void 0 ? void 0 : _a.salesOrderIds
2965
+ });
2966
+ const warehouses = elementsCore.useListWarehouses();
2967
+ const carriers = elementsCore.useListCarriers();
2968
+ if (!shipment.data && !shipment.errors) return jsxRuntime.jsx(elementsUi.Spinner, {
2969
+ children: t("loading.shipment")
2970
+ });
2971
+ if (shipment.errors) throw new Error(shipment.errors.map(e => e.message).join(", "));
2972
+ if (!shipment.data) throw new Error("errorMessages.unableToLoad.shipment");
2973
+ const warehouse = (_b = warehouses.data) === null || _b === void 0 ? void 0 : _b.find(w => {
2974
+ var _a;
2975
+
2976
+ return w.warehouseId === ((_a = shipment.data) === null || _a === void 0 ? void 0 : _a.warehouseId);
2977
+ });
2978
+ const salesOrder = (_c = salesOrders.data) === null || _c === void 0 ? void 0 : _c[0];
2979
+ return jsxRuntime.jsx(elementsUncontrolled.UncontrolledShipment, {
2980
+ carriers: carriers.data,
2981
+ labels: labels.data,
2982
+ onClickPurchaseLabel: onClickPurchaseLabel,
2983
+ onClickVoidLabel: onClickVoidLabel,
2984
+ salesOrder: salesOrder,
2985
+ shipment: shipment.data,
2986
+ warehouse: warehouse
2987
+ });
2988
+ };
2989
+
2990
+ const VoidLabel = ({
2991
+ labelId,
2992
+ onViewShipment,
2993
+ onComplete
2994
+ }) => {
2995
+ var _a, _b, _c;
2996
+
2997
+ const label = elementsCore.useGetLabel({
2998
+ labelId
2999
+ });
3000
+ const shipment = elementsCore.useGetShipment({
3001
+ shipmentId: (_a = label.data) === null || _a === void 0 ? void 0 : _a.shipmentId
3002
+ });
3003
+ const salesOrders = elementsCore.useListSalesOrders({
3004
+ salesOrderIds: (_b = shipment.data) === null || _b === void 0 ? void 0 : _b.salesOrderIds
3005
+ });
3006
+ const voidLabel = elementsCore.useVoidLabel({
3007
+ labelId
3008
+ });
3009
+
3010
+ const handleVoidLabelSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
3011
+ yield voidLabel.trigger(label.data);
3012
+ });
3013
+
3014
+ return jsxRuntime.jsx(elementsUncontrolled.UncontrolledVoidLabel, {
3015
+ salesOrder: (_c = salesOrders.data) === null || _c === void 0 ? void 0 : _c[0],
3016
+ shipment: shipment.data,
3017
+ onComplete: onComplete,
3018
+ onSubmit: handleVoidLabelSubmit,
3019
+ onViewShipment: onViewShipment,
3020
+ voidLabel: voidLabel.data
3021
+ });
3022
+ };
3023
+
3024
+ const Element$1 = elementsCore.registerElement("view-shipment", Shipment, config);
3025
+
3026
+ const Element = elementsCore.registerElement("void-label", VoidLabel, config);
3027
+
3028
+ exports.PurchaseLabel = Element$2;
3029
+ exports.ViewShipment = Element$1;
3030
+ exports.VoidLabel = Element;