@intrig/next 0.0.8 → 0.0.9

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.esm.js ADDED
@@ -0,0 +1,4224 @@
1
+ import { createContext, useContext, useReducer, useMemo, useState, useCallback, useRef, useEffect, useId } from 'react';
2
+ import axios, { isAxiosError } from 'axios';
3
+ import log from 'loglevel';
4
+ import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
5
+ import { headers } from 'next/headers';
6
+
7
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
8
+
9
+ var check = function (it) {
10
+ return it && it.Math === Math && it;
11
+ };
12
+
13
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
14
+ var globalThis_1 =
15
+ // eslint-disable-next-line es/no-global-this -- safe
16
+ check(typeof globalThis == 'object' && globalThis) ||
17
+ check(typeof window == 'object' && window) ||
18
+ // eslint-disable-next-line no-restricted-globals -- safe
19
+ check(typeof self == 'object' && self) ||
20
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
21
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
22
+ // eslint-disable-next-line no-new-func -- fallback
23
+ (function () { return this; })() || Function('return this')();
24
+
25
+ var objectGetOwnPropertyDescriptor = {};
26
+
27
+ var fails$h = function (exec) {
28
+ try {
29
+ return !!exec();
30
+ } catch (error) {
31
+ return true;
32
+ }
33
+ };
34
+
35
+ var fails$g = fails$h;
36
+
37
+ // Detect IE8's incomplete defineProperty implementation
38
+ var descriptors = !fails$g(function () {
39
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
40
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
41
+ });
42
+
43
+ var fails$f = fails$h;
44
+
45
+ var functionBindNative = !fails$f(function () {
46
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
47
+ var test = (function () { /* empty */ }).bind();
48
+ // eslint-disable-next-line no-prototype-builtins -- safe
49
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
50
+ });
51
+
52
+ var NATIVE_BIND$3 = functionBindNative;
53
+
54
+ var call$g = Function.prototype.call;
55
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
56
+ var functionCall = NATIVE_BIND$3 ? call$g.bind(call$g) : function () {
57
+ return call$g.apply(call$g, arguments);
58
+ };
59
+
60
+ var objectPropertyIsEnumerable = {};
61
+
62
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
63
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
64
+ var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
65
+
66
+ // Nashorn ~ JDK8 bug
67
+ var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
68
+
69
+ // `Object.prototype.propertyIsEnumerable` method implementation
70
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
71
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
72
+ var descriptor = getOwnPropertyDescriptor$2(this, V);
73
+ return !!descriptor && descriptor.enumerable;
74
+ } : $propertyIsEnumerable;
75
+
76
+ var createPropertyDescriptor$4 = function (bitmap, value) {
77
+ return {
78
+ enumerable: !(bitmap & 1),
79
+ configurable: !(bitmap & 2),
80
+ writable: !(bitmap & 4),
81
+ value: value
82
+ };
83
+ };
84
+
85
+ var NATIVE_BIND$2 = functionBindNative;
86
+
87
+ var FunctionPrototype$2 = Function.prototype;
88
+ var call$f = FunctionPrototype$2.call;
89
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
90
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$f, call$f);
91
+
92
+ var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
93
+ return function () {
94
+ return call$f.apply(fn, arguments);
95
+ };
96
+ };
97
+
98
+ var uncurryThis$f = functionUncurryThis;
99
+
100
+ var toString$3 = uncurryThis$f({}.toString);
101
+ var stringSlice$1 = uncurryThis$f(''.slice);
102
+
103
+ var classofRaw$2 = function (it) {
104
+ return stringSlice$1(toString$3(it), 8, -1);
105
+ };
106
+
107
+ var uncurryThis$e = functionUncurryThis;
108
+ var fails$e = fails$h;
109
+ var classof$6 = classofRaw$2;
110
+
111
+ var $Object$4 = Object;
112
+ var split = uncurryThis$e(''.split);
113
+
114
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
115
+ var indexedObject = fails$e(function () {
116
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
117
+ // eslint-disable-next-line no-prototype-builtins -- safe
118
+ return !$Object$4('z').propertyIsEnumerable(0);
119
+ }) ? function (it) {
120
+ return classof$6(it) === 'String' ? split(it, '') : $Object$4(it);
121
+ } : $Object$4;
122
+
123
+ // we can't use just `it == null` since of `document.all` special case
124
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
125
+ var isNullOrUndefined$4 = function (it) {
126
+ return it === null || it === undefined;
127
+ };
128
+
129
+ var isNullOrUndefined$3 = isNullOrUndefined$4;
130
+
131
+ var $TypeError$g = TypeError;
132
+
133
+ // `RequireObjectCoercible` abstract operation
134
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
135
+ var requireObjectCoercible$4 = function (it) {
136
+ if (isNullOrUndefined$3(it)) throw new $TypeError$g("Can't call method on " + it);
137
+ return it;
138
+ };
139
+
140
+ // toObject with fallback for non-array-like ES3 strings
141
+ var IndexedObject$2 = indexedObject;
142
+ var requireObjectCoercible$3 = requireObjectCoercible$4;
143
+
144
+ var toIndexedObject$5 = function (it) {
145
+ return IndexedObject$2(requireObjectCoercible$3(it));
146
+ };
147
+
148
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
149
+ var documentAll = typeof document == 'object' && document.all;
150
+
151
+ // `IsCallable` abstract operation
152
+ // https://tc39.es/ecma262/#sec-iscallable
153
+ // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
154
+ var isCallable$k = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
155
+ return typeof argument == 'function' || argument === documentAll;
156
+ } : function (argument) {
157
+ return typeof argument == 'function';
158
+ };
159
+
160
+ var isCallable$j = isCallable$k;
161
+
162
+ var isObject$b = function (it) {
163
+ return typeof it == 'object' ? it !== null : isCallable$j(it);
164
+ };
165
+
166
+ var globalThis$m = globalThis_1;
167
+ var isCallable$i = isCallable$k;
168
+
169
+ var aFunction = function (argument) {
170
+ return isCallable$i(argument) ? argument : undefined;
171
+ };
172
+
173
+ var getBuiltIn$7 = function (namespace, method) {
174
+ return arguments.length < 2 ? aFunction(globalThis$m[namespace]) : globalThis$m[namespace] && globalThis$m[namespace][method];
175
+ };
176
+
177
+ var uncurryThis$d = functionUncurryThis;
178
+
179
+ var objectIsPrototypeOf = uncurryThis$d({}.isPrototypeOf);
180
+
181
+ var globalThis$l = globalThis_1;
182
+
183
+ var navigator = globalThis$l.navigator;
184
+ var userAgent$5 = navigator && navigator.userAgent;
185
+
186
+ var environmentUserAgent = userAgent$5 ? String(userAgent$5) : '';
187
+
188
+ var globalThis$k = globalThis_1;
189
+ var userAgent$4 = environmentUserAgent;
190
+
191
+ var process$4 = globalThis$k.process;
192
+ var Deno$1 = globalThis$k.Deno;
193
+ var versions = process$4 && process$4.versions || Deno$1 && Deno$1.version;
194
+ var v8 = versions && versions.v8;
195
+ var match, version;
196
+
197
+ if (v8) {
198
+ match = v8.split('.');
199
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
200
+ // but their correct versions are not interesting for us
201
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
202
+ }
203
+
204
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
205
+ // so check `userAgent` even if `.v8` exists, but 0
206
+ if (!version && userAgent$4) {
207
+ match = userAgent$4.match(/Edge\/(\d+)/);
208
+ if (!match || match[1] >= 74) {
209
+ match = userAgent$4.match(/Chrome\/(\d+)/);
210
+ if (match) version = +match[1];
211
+ }
212
+ }
213
+
214
+ var environmentV8Version = version;
215
+
216
+ /* eslint-disable es/no-symbol -- required for testing */
217
+ var V8_VERSION$1 = environmentV8Version;
218
+ var fails$d = fails$h;
219
+ var globalThis$j = globalThis_1;
220
+
221
+ var $String$5 = globalThis$j.String;
222
+
223
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
224
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$d(function () {
225
+ var symbol = Symbol('symbol detection');
226
+ // Chrome 38 Symbol has incorrect toString conversion
227
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
228
+ // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
229
+ // of course, fail.
230
+ return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) ||
231
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
232
+ !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
233
+ });
234
+
235
+ /* eslint-disable es/no-symbol -- required for testing */
236
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
237
+
238
+ var useSymbolAsUid = NATIVE_SYMBOL$1 &&
239
+ !Symbol.sham &&
240
+ typeof Symbol.iterator == 'symbol';
241
+
242
+ var getBuiltIn$6 = getBuiltIn$7;
243
+ var isCallable$h = isCallable$k;
244
+ var isPrototypeOf$2 = objectIsPrototypeOf;
245
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
246
+
247
+ var $Object$3 = Object;
248
+
249
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
250
+ return typeof it == 'symbol';
251
+ } : function (it) {
252
+ var $Symbol = getBuiltIn$6('Symbol');
253
+ return isCallable$h($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$3(it));
254
+ };
255
+
256
+ var $String$4 = String;
257
+
258
+ var tryToString$4 = function (argument) {
259
+ try {
260
+ return $String$4(argument);
261
+ } catch (error) {
262
+ return 'Object';
263
+ }
264
+ };
265
+
266
+ var isCallable$g = isCallable$k;
267
+ var tryToString$3 = tryToString$4;
268
+
269
+ var $TypeError$f = TypeError;
270
+
271
+ // `Assert: IsCallable(argument) is true`
272
+ var aCallable$c = function (argument) {
273
+ if (isCallable$g(argument)) return argument;
274
+ throw new $TypeError$f(tryToString$3(argument) + ' is not a function');
275
+ };
276
+
277
+ var aCallable$b = aCallable$c;
278
+ var isNullOrUndefined$2 = isNullOrUndefined$4;
279
+
280
+ // `GetMethod` abstract operation
281
+ // https://tc39.es/ecma262/#sec-getmethod
282
+ var getMethod$4 = function (V, P) {
283
+ var func = V[P];
284
+ return isNullOrUndefined$2(func) ? undefined : aCallable$b(func);
285
+ };
286
+
287
+ var call$e = functionCall;
288
+ var isCallable$f = isCallable$k;
289
+ var isObject$a = isObject$b;
290
+
291
+ var $TypeError$e = TypeError;
292
+
293
+ // `OrdinaryToPrimitive` abstract operation
294
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
295
+ var ordinaryToPrimitive$1 = function (input, pref) {
296
+ var fn, val;
297
+ if (pref === 'string' && isCallable$f(fn = input.toString) && !isObject$a(val = call$e(fn, input))) return val;
298
+ if (isCallable$f(fn = input.valueOf) && !isObject$a(val = call$e(fn, input))) return val;
299
+ if (pref !== 'string' && isCallable$f(fn = input.toString) && !isObject$a(val = call$e(fn, input))) return val;
300
+ throw new $TypeError$e("Can't convert object to primitive value");
301
+ };
302
+
303
+ var sharedStore = {exports: {}};
304
+
305
+ var globalThis$i = globalThis_1;
306
+
307
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
308
+ var defineProperty$6 = Object.defineProperty;
309
+
310
+ var defineGlobalProperty$3 = function (key, value) {
311
+ try {
312
+ defineProperty$6(globalThis$i, key, { value: value, configurable: true, writable: true });
313
+ } catch (error) {
314
+ globalThis$i[key] = value;
315
+ } return value;
316
+ };
317
+
318
+ var globalThis$h = globalThis_1;
319
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
320
+
321
+ var SHARED = '__core-js_shared__';
322
+ var store$3 = sharedStore.exports = globalThis$h[SHARED] || defineGlobalProperty$2(SHARED, {});
323
+
324
+ (store$3.versions || (store$3.versions = [])).push({
325
+ version: '3.43.0',
326
+ mode: 'global',
327
+ copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
328
+ license: 'https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE',
329
+ source: 'https://github.com/zloirock/core-js'
330
+ });
331
+
332
+ var sharedStoreExports = sharedStore.exports;
333
+
334
+ var store$2 = sharedStoreExports;
335
+
336
+ var shared$3 = function (key, value) {
337
+ return store$2[key] || (store$2[key] = value || {});
338
+ };
339
+
340
+ var requireObjectCoercible$2 = requireObjectCoercible$4;
341
+
342
+ var $Object$2 = Object;
343
+
344
+ // `ToObject` abstract operation
345
+ // https://tc39.es/ecma262/#sec-toobject
346
+ var toObject$4 = function (argument) {
347
+ return $Object$2(requireObjectCoercible$2(argument));
348
+ };
349
+
350
+ var uncurryThis$c = functionUncurryThis;
351
+ var toObject$3 = toObject$4;
352
+
353
+ var hasOwnProperty = uncurryThis$c({}.hasOwnProperty);
354
+
355
+ // `HasOwnProperty` abstract operation
356
+ // https://tc39.es/ecma262/#sec-hasownproperty
357
+ // eslint-disable-next-line es/no-object-hasown -- safe
358
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
359
+ return hasOwnProperty(toObject$3(it), key);
360
+ };
361
+
362
+ var uncurryThis$b = functionUncurryThis;
363
+
364
+ var id = 0;
365
+ var postfix = Math.random();
366
+ var toString$2 = uncurryThis$b(1.1.toString);
367
+
368
+ var uid$2 = function (key) {
369
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
370
+ };
371
+
372
+ var globalThis$g = globalThis_1;
373
+ var shared$2 = shared$3;
374
+ var hasOwn$a = hasOwnProperty_1;
375
+ var uid$1 = uid$2;
376
+ var NATIVE_SYMBOL = symbolConstructorDetection;
377
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
378
+
379
+ var Symbol$1 = globalThis$g.Symbol;
380
+ var WellKnownSymbolsStore = shared$2('wks');
381
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
382
+
383
+ var wellKnownSymbol$i = function (name) {
384
+ if (!hasOwn$a(WellKnownSymbolsStore, name)) {
385
+ WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$a(Symbol$1, name)
386
+ ? Symbol$1[name]
387
+ : createWellKnownSymbol('Symbol.' + name);
388
+ } return WellKnownSymbolsStore[name];
389
+ };
390
+
391
+ var call$d = functionCall;
392
+ var isObject$9 = isObject$b;
393
+ var isSymbol$1 = isSymbol$2;
394
+ var getMethod$3 = getMethod$4;
395
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
396
+ var wellKnownSymbol$h = wellKnownSymbol$i;
397
+
398
+ var $TypeError$d = TypeError;
399
+ var TO_PRIMITIVE = wellKnownSymbol$h('toPrimitive');
400
+
401
+ // `ToPrimitive` abstract operation
402
+ // https://tc39.es/ecma262/#sec-toprimitive
403
+ var toPrimitive$1 = function (input, pref) {
404
+ if (!isObject$9(input) || isSymbol$1(input)) return input;
405
+ var exoticToPrim = getMethod$3(input, TO_PRIMITIVE);
406
+ var result;
407
+ if (exoticToPrim) {
408
+ if (pref === undefined) pref = 'default';
409
+ result = call$d(exoticToPrim, input, pref);
410
+ if (!isObject$9(result) || isSymbol$1(result)) return result;
411
+ throw new $TypeError$d("Can't convert object to primitive value");
412
+ }
413
+ if (pref === undefined) pref = 'number';
414
+ return ordinaryToPrimitive(input, pref);
415
+ };
416
+
417
+ var toPrimitive = toPrimitive$1;
418
+ var isSymbol = isSymbol$2;
419
+
420
+ // `ToPropertyKey` abstract operation
421
+ // https://tc39.es/ecma262/#sec-topropertykey
422
+ var toPropertyKey$2 = function (argument) {
423
+ var key = toPrimitive(argument, 'string');
424
+ return isSymbol(key) ? key : key + '';
425
+ };
426
+
427
+ var globalThis$f = globalThis_1;
428
+ var isObject$8 = isObject$b;
429
+
430
+ var document$3 = globalThis$f.document;
431
+ // typeof document.createElement is 'object' in old IE
432
+ var EXISTS$1 = isObject$8(document$3) && isObject$8(document$3.createElement);
433
+
434
+ var documentCreateElement$2 = function (it) {
435
+ return EXISTS$1 ? document$3.createElement(it) : {};
436
+ };
437
+
438
+ var DESCRIPTORS$d = descriptors;
439
+ var fails$c = fails$h;
440
+ var createElement$1 = documentCreateElement$2;
441
+
442
+ // Thanks to IE8 for its funny defineProperty
443
+ var ie8DomDefine = !DESCRIPTORS$d && !fails$c(function () {
444
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
445
+ return Object.defineProperty(createElement$1('div'), 'a', {
446
+ get: function () { return 7; }
447
+ }).a !== 7;
448
+ });
449
+
450
+ var DESCRIPTORS$c = descriptors;
451
+ var call$c = functionCall;
452
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
453
+ var createPropertyDescriptor$3 = createPropertyDescriptor$4;
454
+ var toIndexedObject$4 = toIndexedObject$5;
455
+ var toPropertyKey$1 = toPropertyKey$2;
456
+ var hasOwn$9 = hasOwnProperty_1;
457
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
458
+
459
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
460
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
461
+
462
+ // `Object.getOwnPropertyDescriptor` method
463
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
464
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$c ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
465
+ O = toIndexedObject$4(O);
466
+ P = toPropertyKey$1(P);
467
+ if (IE8_DOM_DEFINE$1) try {
468
+ return $getOwnPropertyDescriptor$1(O, P);
469
+ } catch (error) { /* empty */ }
470
+ if (hasOwn$9(O, P)) return createPropertyDescriptor$3(!call$c(propertyIsEnumerableModule$1.f, O, P), O[P]);
471
+ };
472
+
473
+ var objectDefineProperty = {};
474
+
475
+ var DESCRIPTORS$b = descriptors;
476
+ var fails$b = fails$h;
477
+
478
+ // V8 ~ Chrome 36-
479
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
480
+ var v8PrototypeDefineBug = DESCRIPTORS$b && fails$b(function () {
481
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
482
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
483
+ value: 42,
484
+ writable: false
485
+ }).prototype !== 42;
486
+ });
487
+
488
+ var isObject$7 = isObject$b;
489
+
490
+ var $String$3 = String;
491
+ var $TypeError$c = TypeError;
492
+
493
+ // `Assert: Type(argument) is Object`
494
+ var anObject$e = function (argument) {
495
+ if (isObject$7(argument)) return argument;
496
+ throw new $TypeError$c($String$3(argument) + ' is not an object');
497
+ };
498
+
499
+ var DESCRIPTORS$a = descriptors;
500
+ var IE8_DOM_DEFINE = ie8DomDefine;
501
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
502
+ var anObject$d = anObject$e;
503
+ var toPropertyKey = toPropertyKey$2;
504
+
505
+ var $TypeError$b = TypeError;
506
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
507
+ var $defineProperty = Object.defineProperty;
508
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
509
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
510
+ var ENUMERABLE = 'enumerable';
511
+ var CONFIGURABLE$1 = 'configurable';
512
+ var WRITABLE = 'writable';
513
+
514
+ // `Object.defineProperty` method
515
+ // https://tc39.es/ecma262/#sec-object.defineproperty
516
+ objectDefineProperty.f = DESCRIPTORS$a ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
517
+ anObject$d(O);
518
+ P = toPropertyKey(P);
519
+ anObject$d(Attributes);
520
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
521
+ var current = $getOwnPropertyDescriptor(O, P);
522
+ if (current && current[WRITABLE]) {
523
+ O[P] = Attributes.value;
524
+ Attributes = {
525
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
526
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
527
+ writable: false
528
+ };
529
+ }
530
+ } return $defineProperty(O, P, Attributes);
531
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
532
+ anObject$d(O);
533
+ P = toPropertyKey(P);
534
+ anObject$d(Attributes);
535
+ if (IE8_DOM_DEFINE) try {
536
+ return $defineProperty(O, P, Attributes);
537
+ } catch (error) { /* empty */ }
538
+ if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$b('Accessors not supported');
539
+ if ('value' in Attributes) O[P] = Attributes.value;
540
+ return O;
541
+ };
542
+
543
+ var DESCRIPTORS$9 = descriptors;
544
+ var definePropertyModule$4 = objectDefineProperty;
545
+ var createPropertyDescriptor$2 = createPropertyDescriptor$4;
546
+
547
+ var createNonEnumerableProperty$5 = DESCRIPTORS$9 ? function (object, key, value) {
548
+ return definePropertyModule$4.f(object, key, createPropertyDescriptor$2(1, value));
549
+ } : function (object, key, value) {
550
+ object[key] = value;
551
+ return object;
552
+ };
553
+
554
+ var makeBuiltIn$3 = {exports: {}};
555
+
556
+ var DESCRIPTORS$8 = descriptors;
557
+ var hasOwn$8 = hasOwnProperty_1;
558
+
559
+ var FunctionPrototype$1 = Function.prototype;
560
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
561
+ var getDescriptor = DESCRIPTORS$8 && Object.getOwnPropertyDescriptor;
562
+
563
+ var EXISTS = hasOwn$8(FunctionPrototype$1, 'name');
564
+ // additional protection from minified / mangled / dropped function names
565
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
566
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$8 || (DESCRIPTORS$8 && getDescriptor(FunctionPrototype$1, 'name').configurable));
567
+
568
+ var functionName = {
569
+ PROPER: PROPER,
570
+ CONFIGURABLE: CONFIGURABLE
571
+ };
572
+
573
+ var uncurryThis$a = functionUncurryThis;
574
+ var isCallable$e = isCallable$k;
575
+ var store$1 = sharedStoreExports;
576
+
577
+ var functionToString = uncurryThis$a(Function.toString);
578
+
579
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
580
+ if (!isCallable$e(store$1.inspectSource)) {
581
+ store$1.inspectSource = function (it) {
582
+ return functionToString(it);
583
+ };
584
+ }
585
+
586
+ var inspectSource$3 = store$1.inspectSource;
587
+
588
+ var globalThis$e = globalThis_1;
589
+ var isCallable$d = isCallable$k;
590
+
591
+ var WeakMap$1 = globalThis$e.WeakMap;
592
+
593
+ var weakMapBasicDetection = isCallable$d(WeakMap$1) && /native code/.test(String(WeakMap$1));
594
+
595
+ var shared$1 = shared$3;
596
+ var uid = uid$2;
597
+
598
+ var keys = shared$1('keys');
599
+
600
+ var sharedKey$3 = function (key) {
601
+ return keys[key] || (keys[key] = uid(key));
602
+ };
603
+
604
+ var hiddenKeys$4 = {};
605
+
606
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
607
+ var globalThis$d = globalThis_1;
608
+ var isObject$6 = isObject$b;
609
+ var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
610
+ var hasOwn$7 = hasOwnProperty_1;
611
+ var shared = sharedStoreExports;
612
+ var sharedKey$2 = sharedKey$3;
613
+ var hiddenKeys$3 = hiddenKeys$4;
614
+
615
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
616
+ var TypeError$2 = globalThis$d.TypeError;
617
+ var WeakMap = globalThis$d.WeakMap;
618
+ var set$1, get, has;
619
+
620
+ var enforce = function (it) {
621
+ return has(it) ? get(it) : set$1(it, {});
622
+ };
623
+
624
+ var getterFor = function (TYPE) {
625
+ return function (it) {
626
+ var state;
627
+ if (!isObject$6(it) || (state = get(it)).type !== TYPE) {
628
+ throw new TypeError$2('Incompatible receiver, ' + TYPE + ' required');
629
+ } return state;
630
+ };
631
+ };
632
+
633
+ if (NATIVE_WEAK_MAP || shared.state) {
634
+ var store = shared.state || (shared.state = new WeakMap());
635
+ /* eslint-disable no-self-assign -- prototype methods protection */
636
+ store.get = store.get;
637
+ store.has = store.has;
638
+ store.set = store.set;
639
+ /* eslint-enable no-self-assign -- prototype methods protection */
640
+ set$1 = function (it, metadata) {
641
+ if (store.has(it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
642
+ metadata.facade = it;
643
+ store.set(it, metadata);
644
+ return metadata;
645
+ };
646
+ get = function (it) {
647
+ return store.get(it) || {};
648
+ };
649
+ has = function (it) {
650
+ return store.has(it);
651
+ };
652
+ } else {
653
+ var STATE = sharedKey$2('state');
654
+ hiddenKeys$3[STATE] = true;
655
+ set$1 = function (it, metadata) {
656
+ if (hasOwn$7(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
657
+ metadata.facade = it;
658
+ createNonEnumerableProperty$4(it, STATE, metadata);
659
+ return metadata;
660
+ };
661
+ get = function (it) {
662
+ return hasOwn$7(it, STATE) ? it[STATE] : {};
663
+ };
664
+ has = function (it) {
665
+ return hasOwn$7(it, STATE);
666
+ };
667
+ }
668
+
669
+ var internalState = {
670
+ set: set$1,
671
+ get: get,
672
+ has: has,
673
+ enforce: enforce,
674
+ getterFor: getterFor
675
+ };
676
+
677
+ var uncurryThis$9 = functionUncurryThis;
678
+ var fails$a = fails$h;
679
+ var isCallable$c = isCallable$k;
680
+ var hasOwn$6 = hasOwnProperty_1;
681
+ var DESCRIPTORS$7 = descriptors;
682
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
683
+ var inspectSource$2 = inspectSource$3;
684
+ var InternalStateModule$3 = internalState;
685
+
686
+ var enforceInternalState = InternalStateModule$3.enforce;
687
+ var getInternalState$1 = InternalStateModule$3.get;
688
+ var $String$2 = String;
689
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
690
+ var defineProperty$5 = Object.defineProperty;
691
+ var stringSlice = uncurryThis$9(''.slice);
692
+ var replace = uncurryThis$9(''.replace);
693
+ var join = uncurryThis$9([].join);
694
+
695
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$7 && !fails$a(function () {
696
+ return defineProperty$5(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
697
+ });
698
+
699
+ var TEMPLATE = String(String).split('String');
700
+
701
+ var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
702
+ if (stringSlice($String$2(name), 0, 7) === 'Symbol(') {
703
+ name = '[' + replace($String$2(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
704
+ }
705
+ if (options && options.getter) name = 'get ' + name;
706
+ if (options && options.setter) name = 'set ' + name;
707
+ if (!hasOwn$6(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
708
+ if (DESCRIPTORS$7) defineProperty$5(value, 'name', { value: name, configurable: true });
709
+ else value.name = name;
710
+ }
711
+ if (CONFIGURABLE_LENGTH && options && hasOwn$6(options, 'arity') && value.length !== options.arity) {
712
+ defineProperty$5(value, 'length', { value: options.arity });
713
+ }
714
+ try {
715
+ if (options && hasOwn$6(options, 'constructor') && options.constructor) {
716
+ if (DESCRIPTORS$7) defineProperty$5(value, 'prototype', { writable: false });
717
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
718
+ } else if (value.prototype) value.prototype = undefined;
719
+ } catch (error) { /* empty */ }
720
+ var state = enforceInternalState(value);
721
+ if (!hasOwn$6(state, 'source')) {
722
+ state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
723
+ } return value;
724
+ };
725
+
726
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
727
+ // eslint-disable-next-line no-extend-native -- required
728
+ Function.prototype.toString = makeBuiltIn$2(function toString() {
729
+ return isCallable$c(this) && getInternalState$1(this).source || inspectSource$2(this);
730
+ }, 'toString');
731
+
732
+ var makeBuiltInExports = makeBuiltIn$3.exports;
733
+
734
+ var isCallable$b = isCallable$k;
735
+ var definePropertyModule$3 = objectDefineProperty;
736
+ var makeBuiltIn$1 = makeBuiltInExports;
737
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
738
+
739
+ var defineBuiltIn$6 = function (O, key, value, options) {
740
+ if (!options) options = {};
741
+ var simple = options.enumerable;
742
+ var name = options.name !== undefined ? options.name : key;
743
+ if (isCallable$b(value)) makeBuiltIn$1(value, name, options);
744
+ if (options.global) {
745
+ if (simple) O[key] = value;
746
+ else defineGlobalProperty$1(key, value);
747
+ } else {
748
+ try {
749
+ if (!options.unsafe) delete O[key];
750
+ else if (O[key]) simple = true;
751
+ } catch (error) { /* empty */ }
752
+ if (simple) O[key] = value;
753
+ else definePropertyModule$3.f(O, key, {
754
+ value: value,
755
+ enumerable: false,
756
+ configurable: !options.nonConfigurable,
757
+ writable: !options.nonWritable
758
+ });
759
+ } return O;
760
+ };
761
+
762
+ var objectGetOwnPropertyNames = {};
763
+
764
+ var ceil = Math.ceil;
765
+ var floor = Math.floor;
766
+
767
+ // `Math.trunc` method
768
+ // https://tc39.es/ecma262/#sec-math.trunc
769
+ // eslint-disable-next-line es/no-math-trunc -- safe
770
+ var mathTrunc = Math.trunc || function trunc(x) {
771
+ var n = +x;
772
+ return (n > 0 ? floor : ceil)(n);
773
+ };
774
+
775
+ var trunc = mathTrunc;
776
+
777
+ // `ToIntegerOrInfinity` abstract operation
778
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
779
+ var toIntegerOrInfinity$2 = function (argument) {
780
+ var number = +argument;
781
+ // eslint-disable-next-line no-self-compare -- NaN check
782
+ return number !== number || number === 0 ? 0 : trunc(number);
783
+ };
784
+
785
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
786
+
787
+ var max = Math.max;
788
+ var min$1 = Math.min;
789
+
790
+ // Helper for a popular repeating case of the spec:
791
+ // Let integer be ? ToInteger(index).
792
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
793
+ var toAbsoluteIndex$1 = function (index, length) {
794
+ var integer = toIntegerOrInfinity$1(index);
795
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
796
+ };
797
+
798
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
799
+
800
+ var min = Math.min;
801
+
802
+ // `ToLength` abstract operation
803
+ // https://tc39.es/ecma262/#sec-tolength
804
+ var toLength$1 = function (argument) {
805
+ var len = toIntegerOrInfinity(argument);
806
+ return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
807
+ };
808
+
809
+ var toLength = toLength$1;
810
+
811
+ // `LengthOfArrayLike` abstract operation
812
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
813
+ var lengthOfArrayLike$3 = function (obj) {
814
+ return toLength(obj.length);
815
+ };
816
+
817
+ var toIndexedObject$3 = toIndexedObject$5;
818
+ var toAbsoluteIndex = toAbsoluteIndex$1;
819
+ var lengthOfArrayLike$2 = lengthOfArrayLike$3;
820
+
821
+ // `Array.prototype.{ indexOf, includes }` methods implementation
822
+ var createMethod$1 = function (IS_INCLUDES) {
823
+ return function ($this, el, fromIndex) {
824
+ var O = toIndexedObject$3($this);
825
+ var length = lengthOfArrayLike$2(O);
826
+ if (length === 0) return !IS_INCLUDES && -1;
827
+ var index = toAbsoluteIndex(fromIndex, length);
828
+ var value;
829
+ // Array#includes uses SameValueZero equality algorithm
830
+ // eslint-disable-next-line no-self-compare -- NaN check
831
+ if (IS_INCLUDES && el !== el) while (length > index) {
832
+ value = O[index++];
833
+ // eslint-disable-next-line no-self-compare -- NaN check
834
+ if (value !== value) return true;
835
+ // Array#indexOf ignores holes, Array#includes - not
836
+ } else for (;length > index; index++) {
837
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
838
+ } return !IS_INCLUDES && -1;
839
+ };
840
+ };
841
+
842
+ var arrayIncludes = {
843
+ // `Array.prototype.includes` method
844
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
845
+ includes: createMethod$1(true),
846
+ // `Array.prototype.indexOf` method
847
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
848
+ indexOf: createMethod$1(false)
849
+ };
850
+
851
+ var uncurryThis$8 = functionUncurryThis;
852
+ var hasOwn$5 = hasOwnProperty_1;
853
+ var toIndexedObject$2 = toIndexedObject$5;
854
+ var indexOf = arrayIncludes.indexOf;
855
+ var hiddenKeys$2 = hiddenKeys$4;
856
+
857
+ var push = uncurryThis$8([].push);
858
+
859
+ var objectKeysInternal = function (object, names) {
860
+ var O = toIndexedObject$2(object);
861
+ var i = 0;
862
+ var result = [];
863
+ var key;
864
+ for (key in O) !hasOwn$5(hiddenKeys$2, key) && hasOwn$5(O, key) && push(result, key);
865
+ // Don't enum bug & hidden keys
866
+ while (names.length > i) if (hasOwn$5(O, key = names[i++])) {
867
+ ~indexOf(result, key) || push(result, key);
868
+ }
869
+ return result;
870
+ };
871
+
872
+ // IE8- don't enum bug keys
873
+ var enumBugKeys$3 = [
874
+ 'constructor',
875
+ 'hasOwnProperty',
876
+ 'isPrototypeOf',
877
+ 'propertyIsEnumerable',
878
+ 'toLocaleString',
879
+ 'toString',
880
+ 'valueOf'
881
+ ];
882
+
883
+ var internalObjectKeys$1 = objectKeysInternal;
884
+ var enumBugKeys$2 = enumBugKeys$3;
885
+
886
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
887
+
888
+ // `Object.getOwnPropertyNames` method
889
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
890
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
891
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
892
+ return internalObjectKeys$1(O, hiddenKeys$1);
893
+ };
894
+
895
+ var objectGetOwnPropertySymbols = {};
896
+
897
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
898
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
899
+
900
+ var getBuiltIn$5 = getBuiltIn$7;
901
+ var uncurryThis$7 = functionUncurryThis;
902
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
903
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
904
+ var anObject$c = anObject$e;
905
+
906
+ var concat$1 = uncurryThis$7([].concat);
907
+
908
+ // all object keys, includes non-enumerable and symbols
909
+ var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
910
+ var keys = getOwnPropertyNamesModule.f(anObject$c(it));
911
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
912
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
913
+ };
914
+
915
+ var hasOwn$4 = hasOwnProperty_1;
916
+ var ownKeys = ownKeys$1;
917
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
918
+ var definePropertyModule$2 = objectDefineProperty;
919
+
920
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
921
+ var keys = ownKeys(source);
922
+ var defineProperty = definePropertyModule$2.f;
923
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
924
+ for (var i = 0; i < keys.length; i++) {
925
+ var key = keys[i];
926
+ if (!hasOwn$4(target, key) && !(exceptions && hasOwn$4(exceptions, key))) {
927
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
928
+ }
929
+ }
930
+ };
931
+
932
+ var fails$9 = fails$h;
933
+ var isCallable$a = isCallable$k;
934
+
935
+ var replacement = /#|\.prototype\./;
936
+
937
+ var isForced$2 = function (feature, detection) {
938
+ var value = data[normalize(feature)];
939
+ return value === POLYFILL ? true
940
+ : value === NATIVE ? false
941
+ : isCallable$a(detection) ? fails$9(detection)
942
+ : !!detection;
943
+ };
944
+
945
+ var normalize = isForced$2.normalize = function (string) {
946
+ return String(string).replace(replacement, '.').toLowerCase();
947
+ };
948
+
949
+ var data = isForced$2.data = {};
950
+ var NATIVE = isForced$2.NATIVE = 'N';
951
+ var POLYFILL = isForced$2.POLYFILL = 'P';
952
+
953
+ var isForced_1 = isForced$2;
954
+
955
+ var globalThis$c = globalThis_1;
956
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
957
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
958
+ var defineBuiltIn$5 = defineBuiltIn$6;
959
+ var defineGlobalProperty = defineGlobalProperty$3;
960
+ var copyConstructorProperties = copyConstructorProperties$1;
961
+ var isForced$1 = isForced_1;
962
+
963
+ /*
964
+ options.target - name of the target object
965
+ options.global - target is the global object
966
+ options.stat - export as static methods of target
967
+ options.proto - export as prototype methods of target
968
+ options.real - real prototype method for the `pure` version
969
+ options.forced - export even if the native feature is available
970
+ options.bind - bind methods to the target, required for the `pure` version
971
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
972
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
973
+ options.sham - add a flag to not completely full polyfills
974
+ options.enumerable - export as enumerable property
975
+ options.dontCallGetSet - prevent calling a getter on target
976
+ options.name - the .name of the function if it does not match the key
977
+ */
978
+ var _export = function (options, source) {
979
+ var TARGET = options.target;
980
+ var GLOBAL = options.global;
981
+ var STATIC = options.stat;
982
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
983
+ if (GLOBAL) {
984
+ target = globalThis$c;
985
+ } else if (STATIC) {
986
+ target = globalThis$c[TARGET] || defineGlobalProperty(TARGET, {});
987
+ } else {
988
+ target = globalThis$c[TARGET] && globalThis$c[TARGET].prototype;
989
+ }
990
+ if (target) for (key in source) {
991
+ sourceProperty = source[key];
992
+ if (options.dontCallGetSet) {
993
+ descriptor = getOwnPropertyDescriptor$1(target, key);
994
+ targetProperty = descriptor && descriptor.value;
995
+ } else targetProperty = target[key];
996
+ FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
997
+ // contained in target
998
+ if (!FORCED && targetProperty !== undefined) {
999
+ if (typeof sourceProperty == typeof targetProperty) continue;
1000
+ copyConstructorProperties(sourceProperty, targetProperty);
1001
+ }
1002
+ // add a flag to not completely full polyfills
1003
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1004
+ createNonEnumerableProperty$3(sourceProperty, 'sham', true);
1005
+ }
1006
+ defineBuiltIn$5(target, key, sourceProperty, options);
1007
+ }
1008
+ };
1009
+
1010
+ var objectDefineProperties = {};
1011
+
1012
+ var internalObjectKeys = objectKeysInternal;
1013
+ var enumBugKeys$1 = enumBugKeys$3;
1014
+
1015
+ // `Object.keys` method
1016
+ // https://tc39.es/ecma262/#sec-object.keys
1017
+ // eslint-disable-next-line es/no-object-keys -- safe
1018
+ var objectKeys$2 = Object.keys || function keys(O) {
1019
+ return internalObjectKeys(O, enumBugKeys$1);
1020
+ };
1021
+
1022
+ var DESCRIPTORS$6 = descriptors;
1023
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1024
+ var definePropertyModule$1 = objectDefineProperty;
1025
+ var anObject$b = anObject$e;
1026
+ var toIndexedObject$1 = toIndexedObject$5;
1027
+ var objectKeys$1 = objectKeys$2;
1028
+
1029
+ // `Object.defineProperties` method
1030
+ // https://tc39.es/ecma262/#sec-object.defineproperties
1031
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
1032
+ objectDefineProperties.f = DESCRIPTORS$6 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1033
+ anObject$b(O);
1034
+ var props = toIndexedObject$1(Properties);
1035
+ var keys = objectKeys$1(Properties);
1036
+ var length = keys.length;
1037
+ var index = 0;
1038
+ var key;
1039
+ while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
1040
+ return O;
1041
+ };
1042
+
1043
+ var getBuiltIn$4 = getBuiltIn$7;
1044
+
1045
+ var html$2 = getBuiltIn$4('document', 'documentElement');
1046
+
1047
+ /* global ActiveXObject -- old IE, WSH */
1048
+ var anObject$a = anObject$e;
1049
+ var definePropertiesModule = objectDefineProperties;
1050
+ var enumBugKeys = enumBugKeys$3;
1051
+ var hiddenKeys = hiddenKeys$4;
1052
+ var html$1 = html$2;
1053
+ var documentCreateElement$1 = documentCreateElement$2;
1054
+ var sharedKey$1 = sharedKey$3;
1055
+
1056
+ var GT = '>';
1057
+ var LT = '<';
1058
+ var PROTOTYPE = 'prototype';
1059
+ var SCRIPT = 'script';
1060
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1061
+
1062
+ var EmptyConstructor = function () { /* empty */ };
1063
+
1064
+ var scriptTag = function (content) {
1065
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1066
+ };
1067
+
1068
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1069
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1070
+ activeXDocument.write(scriptTag(''));
1071
+ activeXDocument.close();
1072
+ var temp = activeXDocument.parentWindow.Object;
1073
+ // eslint-disable-next-line no-useless-assignment -- avoid memory leak
1074
+ activeXDocument = null;
1075
+ return temp;
1076
+ };
1077
+
1078
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1079
+ var NullProtoObjectViaIFrame = function () {
1080
+ // Thrash, waste and sodomy: IE GC bug
1081
+ var iframe = documentCreateElement$1('iframe');
1082
+ var JS = 'java' + SCRIPT + ':';
1083
+ var iframeDocument;
1084
+ iframe.style.display = 'none';
1085
+ html$1.appendChild(iframe);
1086
+ // https://github.com/zloirock/core-js/issues/475
1087
+ iframe.src = String(JS);
1088
+ iframeDocument = iframe.contentWindow.document;
1089
+ iframeDocument.open();
1090
+ iframeDocument.write(scriptTag('document.F=Object'));
1091
+ iframeDocument.close();
1092
+ return iframeDocument.F;
1093
+ };
1094
+
1095
+ // Check for document.domain and active x support
1096
+ // No need to use active x approach when document.domain is not set
1097
+ // see https://github.com/es-shims/es5-shim/issues/150
1098
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1099
+ // avoid IE GC bug
1100
+ var activeXDocument;
1101
+ var NullProtoObject = function () {
1102
+ try {
1103
+ activeXDocument = new ActiveXObject('htmlfile');
1104
+ } catch (error) { /* ignore */ }
1105
+ NullProtoObject = typeof document != 'undefined'
1106
+ ? document.domain && activeXDocument
1107
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1108
+ : NullProtoObjectViaIFrame()
1109
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1110
+ var length = enumBugKeys.length;
1111
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1112
+ return NullProtoObject();
1113
+ };
1114
+
1115
+ hiddenKeys[IE_PROTO$1] = true;
1116
+
1117
+ // `Object.create` method
1118
+ // https://tc39.es/ecma262/#sec-object.create
1119
+ // eslint-disable-next-line es/no-object-create -- safe
1120
+ var objectCreate = Object.create || function create(O, Properties) {
1121
+ var result;
1122
+ if (O !== null) {
1123
+ EmptyConstructor[PROTOTYPE] = anObject$a(O);
1124
+ result = new EmptyConstructor();
1125
+ EmptyConstructor[PROTOTYPE] = null;
1126
+ // add "__proto__" for Object.getPrototypeOf polyfill
1127
+ result[IE_PROTO$1] = O;
1128
+ } else result = NullProtoObject();
1129
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1130
+ };
1131
+
1132
+ var wellKnownSymbol$g = wellKnownSymbol$i;
1133
+ var create$2 = objectCreate;
1134
+ var defineProperty$4 = objectDefineProperty.f;
1135
+
1136
+ var UNSCOPABLES = wellKnownSymbol$g('unscopables');
1137
+ var ArrayPrototype$1 = Array.prototype;
1138
+
1139
+ // Array.prototype[@@unscopables]
1140
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1141
+ if (ArrayPrototype$1[UNSCOPABLES] === undefined) {
1142
+ defineProperty$4(ArrayPrototype$1, UNSCOPABLES, {
1143
+ configurable: true,
1144
+ value: create$2(null)
1145
+ });
1146
+ }
1147
+
1148
+ // add a key to Array.prototype[@@unscopables]
1149
+ var addToUnscopables$2 = function (key) {
1150
+ ArrayPrototype$1[UNSCOPABLES][key] = true;
1151
+ };
1152
+
1153
+ var $$f = _export;
1154
+ var $includes = arrayIncludes.includes;
1155
+ var fails$8 = fails$h;
1156
+ var addToUnscopables$1 = addToUnscopables$2;
1157
+
1158
+ // FF99+ bug
1159
+ var BROKEN_ON_SPARSE = fails$8(function () {
1160
+ // eslint-disable-next-line es/no-array-prototype-includes -- detection
1161
+ return !Array(1).includes();
1162
+ });
1163
+
1164
+ // `Array.prototype.includes` method
1165
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
1166
+ $$f({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
1167
+ includes: function includes(el /* , fromIndex = 0 */) {
1168
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
1169
+ }
1170
+ });
1171
+
1172
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1173
+ addToUnscopables$1('includes');
1174
+
1175
+ var iterators = {};
1176
+
1177
+ var fails$7 = fails$h;
1178
+
1179
+ var correctPrototypeGetter = !fails$7(function () {
1180
+ function F() { /* empty */ }
1181
+ F.prototype.constructor = null;
1182
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1183
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1184
+ });
1185
+
1186
+ var hasOwn$3 = hasOwnProperty_1;
1187
+ var isCallable$9 = isCallable$k;
1188
+ var toObject$2 = toObject$4;
1189
+ var sharedKey = sharedKey$3;
1190
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1191
+
1192
+ var IE_PROTO = sharedKey('IE_PROTO');
1193
+ var $Object$1 = Object;
1194
+ var ObjectPrototype = $Object$1.prototype;
1195
+
1196
+ // `Object.getPrototypeOf` method
1197
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1198
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
1199
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1200
+ var object = toObject$2(O);
1201
+ if (hasOwn$3(object, IE_PROTO)) return object[IE_PROTO];
1202
+ var constructor = object.constructor;
1203
+ if (isCallable$9(constructor) && object instanceof constructor) {
1204
+ return constructor.prototype;
1205
+ } return object instanceof $Object$1 ? ObjectPrototype : null;
1206
+ };
1207
+
1208
+ var fails$6 = fails$h;
1209
+ var isCallable$8 = isCallable$k;
1210
+ var isObject$5 = isObject$b;
1211
+ var getPrototypeOf$2 = objectGetPrototypeOf;
1212
+ var defineBuiltIn$4 = defineBuiltIn$6;
1213
+ var wellKnownSymbol$f = wellKnownSymbol$i;
1214
+
1215
+ var ITERATOR$6 = wellKnownSymbol$f('iterator');
1216
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1217
+
1218
+ // `%IteratorPrototype%` object
1219
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1220
+ var IteratorPrototype$4, PrototypeOfArrayIteratorPrototype, arrayIterator;
1221
+
1222
+ /* eslint-disable es/no-array-prototype-keys -- safe */
1223
+ if ([].keys) {
1224
+ arrayIterator = [].keys();
1225
+ // Safari 8 has buggy iterators w/o `next`
1226
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1227
+ else {
1228
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$2(getPrototypeOf$2(arrayIterator));
1229
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$4 = PrototypeOfArrayIteratorPrototype;
1230
+ }
1231
+ }
1232
+
1233
+ var NEW_ITERATOR_PROTOTYPE = !isObject$5(IteratorPrototype$4) || fails$6(function () {
1234
+ var test = {};
1235
+ // FF44- legacy iterators case
1236
+ return IteratorPrototype$4[ITERATOR$6].call(test) !== test;
1237
+ });
1238
+
1239
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$4 = {};
1240
+
1241
+ // `%IteratorPrototype%[@@iterator]()` method
1242
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1243
+ if (!isCallable$8(IteratorPrototype$4[ITERATOR$6])) {
1244
+ defineBuiltIn$4(IteratorPrototype$4, ITERATOR$6, function () {
1245
+ return this;
1246
+ });
1247
+ }
1248
+
1249
+ var iteratorsCore = {
1250
+ IteratorPrototype: IteratorPrototype$4,
1251
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1252
+ };
1253
+
1254
+ var defineProperty$3 = objectDefineProperty.f;
1255
+ var hasOwn$2 = hasOwnProperty_1;
1256
+ var wellKnownSymbol$e = wellKnownSymbol$i;
1257
+
1258
+ var TO_STRING_TAG$4 = wellKnownSymbol$e('toStringTag');
1259
+
1260
+ var setToStringTag$4 = function (target, TAG, STATIC) {
1261
+ if (target && !STATIC) target = target.prototype;
1262
+ if (target && !hasOwn$2(target, TO_STRING_TAG$4)) {
1263
+ defineProperty$3(target, TO_STRING_TAG$4, { configurable: true, value: TAG });
1264
+ }
1265
+ };
1266
+
1267
+ var IteratorPrototype$3 = iteratorsCore.IteratorPrototype;
1268
+ var create$1 = objectCreate;
1269
+ var createPropertyDescriptor$1 = createPropertyDescriptor$4;
1270
+ var setToStringTag$3 = setToStringTag$4;
1271
+ var Iterators$4 = iterators;
1272
+
1273
+ var returnThis$1 = function () { return this; };
1274
+
1275
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1276
+ var TO_STRING_TAG = NAME + ' Iterator';
1277
+ IteratorConstructor.prototype = create$1(IteratorPrototype$3, { next: createPropertyDescriptor$1(+!ENUMERABLE_NEXT, next) });
1278
+ setToStringTag$3(IteratorConstructor, TO_STRING_TAG, false);
1279
+ Iterators$4[TO_STRING_TAG] = returnThis$1;
1280
+ return IteratorConstructor;
1281
+ };
1282
+
1283
+ var uncurryThis$6 = functionUncurryThis;
1284
+ var aCallable$a = aCallable$c;
1285
+
1286
+ var functionUncurryThisAccessor = function (object, key, method) {
1287
+ try {
1288
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1289
+ return uncurryThis$6(aCallable$a(Object.getOwnPropertyDescriptor(object, key)[method]));
1290
+ } catch (error) { /* empty */ }
1291
+ };
1292
+
1293
+ var isObject$4 = isObject$b;
1294
+
1295
+ var isPossiblePrototype$1 = function (argument) {
1296
+ return isObject$4(argument) || argument === null;
1297
+ };
1298
+
1299
+ var isPossiblePrototype = isPossiblePrototype$1;
1300
+
1301
+ var $String$1 = String;
1302
+ var $TypeError$a = TypeError;
1303
+
1304
+ var aPossiblePrototype$1 = function (argument) {
1305
+ if (isPossiblePrototype(argument)) return argument;
1306
+ throw new $TypeError$a("Can't set " + $String$1(argument) + ' as a prototype');
1307
+ };
1308
+
1309
+ /* eslint-disable no-proto -- safe */
1310
+ var uncurryThisAccessor = functionUncurryThisAccessor;
1311
+ var isObject$3 = isObject$b;
1312
+ var requireObjectCoercible$1 = requireObjectCoercible$4;
1313
+ var aPossiblePrototype = aPossiblePrototype$1;
1314
+
1315
+ // `Object.setPrototypeOf` method
1316
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1317
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1318
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1319
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1320
+ var CORRECT_SETTER = false;
1321
+ var test = {};
1322
+ var setter;
1323
+ try {
1324
+ setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
1325
+ setter(test, []);
1326
+ CORRECT_SETTER = test instanceof Array;
1327
+ } catch (error) { /* empty */ }
1328
+ return function setPrototypeOf(O, proto) {
1329
+ requireObjectCoercible$1(O);
1330
+ aPossiblePrototype(proto);
1331
+ if (!isObject$3(O)) return O;
1332
+ if (CORRECT_SETTER) setter(O, proto);
1333
+ else O.__proto__ = proto;
1334
+ return O;
1335
+ };
1336
+ }() : undefined);
1337
+
1338
+ var $$e = _export;
1339
+ var call$b = functionCall;
1340
+ var FunctionName = functionName;
1341
+ var isCallable$7 = isCallable$k;
1342
+ var createIteratorConstructor = iteratorCreateConstructor;
1343
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1344
+ var setPrototypeOf$1 = objectSetPrototypeOf;
1345
+ var setToStringTag$2 = setToStringTag$4;
1346
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1347
+ var defineBuiltIn$3 = defineBuiltIn$6;
1348
+ var wellKnownSymbol$d = wellKnownSymbol$i;
1349
+ var Iterators$3 = iterators;
1350
+ var IteratorsCore = iteratorsCore;
1351
+
1352
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1353
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1354
+ var IteratorPrototype$2 = IteratorsCore.IteratorPrototype;
1355
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1356
+ var ITERATOR$5 = wellKnownSymbol$d('iterator');
1357
+ var KEYS = 'keys';
1358
+ var VALUES = 'values';
1359
+ var ENTRIES = 'entries';
1360
+
1361
+ var returnThis = function () { return this; };
1362
+
1363
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1364
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1365
+
1366
+ var getIterationMethod = function (KIND) {
1367
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1368
+ if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
1369
+
1370
+ switch (KIND) {
1371
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1372
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1373
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1374
+ }
1375
+
1376
+ return function () { return new IteratorConstructor(this); };
1377
+ };
1378
+
1379
+ var TO_STRING_TAG = NAME + ' Iterator';
1380
+ var INCORRECT_VALUES_NAME = false;
1381
+ var IterablePrototype = Iterable.prototype;
1382
+ var nativeIterator = IterablePrototype[ITERATOR$5]
1383
+ || IterablePrototype['@@iterator']
1384
+ || DEFAULT && IterablePrototype[DEFAULT];
1385
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1386
+ var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1387
+ var CurrentIteratorPrototype, methods, KEY;
1388
+
1389
+ // fix native
1390
+ if (anyNativeIterator) {
1391
+ CurrentIteratorPrototype = getPrototypeOf$1(anyNativeIterator.call(new Iterable()));
1392
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1393
+ if (getPrototypeOf$1(CurrentIteratorPrototype) !== IteratorPrototype$2) {
1394
+ if (setPrototypeOf$1) {
1395
+ setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype$2);
1396
+ } else if (!isCallable$7(CurrentIteratorPrototype[ITERATOR$5])) {
1397
+ defineBuiltIn$3(CurrentIteratorPrototype, ITERATOR$5, returnThis);
1398
+ }
1399
+ }
1400
+ // Set @@toStringTag to native iterators
1401
+ setToStringTag$2(CurrentIteratorPrototype, TO_STRING_TAG, true);
1402
+ }
1403
+ }
1404
+
1405
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1406
+ if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1407
+ if (CONFIGURABLE_FUNCTION_NAME) {
1408
+ createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
1409
+ } else {
1410
+ INCORRECT_VALUES_NAME = true;
1411
+ defaultIterator = function values() { return call$b(nativeIterator, this); };
1412
+ }
1413
+ }
1414
+
1415
+ // export additional methods
1416
+ if (DEFAULT) {
1417
+ methods = {
1418
+ values: getIterationMethod(VALUES),
1419
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1420
+ entries: getIterationMethod(ENTRIES)
1421
+ };
1422
+ if (FORCED) for (KEY in methods) {
1423
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1424
+ defineBuiltIn$3(IterablePrototype, KEY, methods[KEY]);
1425
+ }
1426
+ } else $$e({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1427
+ }
1428
+
1429
+ // define iterator
1430
+ if (IterablePrototype[ITERATOR$5] !== defaultIterator) {
1431
+ defineBuiltIn$3(IterablePrototype, ITERATOR$5, defaultIterator, { name: DEFAULT });
1432
+ }
1433
+ Iterators$3[NAME] = defaultIterator;
1434
+
1435
+ return methods;
1436
+ };
1437
+
1438
+ // `CreateIterResultObject` abstract operation
1439
+ // https://tc39.es/ecma262/#sec-createiterresultobject
1440
+ var createIterResultObject$2 = function (value, done) {
1441
+ return { value: value, done: done };
1442
+ };
1443
+
1444
+ var toIndexedObject = toIndexedObject$5;
1445
+ var addToUnscopables = addToUnscopables$2;
1446
+ var Iterators$2 = iterators;
1447
+ var InternalStateModule$2 = internalState;
1448
+ var defineProperty$2 = objectDefineProperty.f;
1449
+ var defineIterator = iteratorDefine;
1450
+ var createIterResultObject$1 = createIterResultObject$2;
1451
+ var DESCRIPTORS$5 = descriptors;
1452
+
1453
+ var ARRAY_ITERATOR = 'Array Iterator';
1454
+ var setInternalState$2 = InternalStateModule$2.set;
1455
+ var getInternalState = InternalStateModule$2.getterFor(ARRAY_ITERATOR);
1456
+
1457
+ // `Array.prototype.entries` method
1458
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1459
+ // `Array.prototype.keys` method
1460
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1461
+ // `Array.prototype.values` method
1462
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1463
+ // `Array.prototype[@@iterator]` method
1464
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1465
+ // `CreateArrayIterator` internal method
1466
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1467
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1468
+ setInternalState$2(this, {
1469
+ type: ARRAY_ITERATOR,
1470
+ target: toIndexedObject(iterated), // target
1471
+ index: 0, // next index
1472
+ kind: kind // kind
1473
+ });
1474
+ // `%ArrayIteratorPrototype%.next` method
1475
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1476
+ }, function () {
1477
+ var state = getInternalState(this);
1478
+ var target = state.target;
1479
+ var index = state.index++;
1480
+ if (!target || index >= target.length) {
1481
+ state.target = null;
1482
+ return createIterResultObject$1(undefined, true);
1483
+ }
1484
+ switch (state.kind) {
1485
+ case 'keys': return createIterResultObject$1(index, false);
1486
+ case 'values': return createIterResultObject$1(target[index], false);
1487
+ } return createIterResultObject$1([index, target[index]], false);
1488
+ }, 'values');
1489
+
1490
+ // argumentsList[@@iterator] is %ArrayProto_values%
1491
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1492
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1493
+ var values = Iterators$2.Arguments = Iterators$2.Array;
1494
+
1495
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1496
+ addToUnscopables('keys');
1497
+ addToUnscopables('values');
1498
+ addToUnscopables('entries');
1499
+
1500
+ // V8 ~ Chrome 45- bug
1501
+ if (DESCRIPTORS$5 && values.name !== 'values') try {
1502
+ defineProperty$2(values, 'name', { value: 'values' });
1503
+ } catch (error) { /* empty */ }
1504
+
1505
+ var aCallable$9 = aCallable$c;
1506
+ var toObject$1 = toObject$4;
1507
+ var IndexedObject$1 = indexedObject;
1508
+ var lengthOfArrayLike$1 = lengthOfArrayLike$3;
1509
+
1510
+ var $TypeError$9 = TypeError;
1511
+
1512
+ var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
1513
+
1514
+ // `Array.prototype.{ reduce, reduceRight }` methods implementation
1515
+ var createMethod = function (IS_RIGHT) {
1516
+ return function (that, callbackfn, argumentsLength, memo) {
1517
+ var O = toObject$1(that);
1518
+ var self = IndexedObject$1(O);
1519
+ var length = lengthOfArrayLike$1(O);
1520
+ aCallable$9(callbackfn);
1521
+ if (length === 0 && argumentsLength < 2) throw new $TypeError$9(REDUCE_EMPTY);
1522
+ var index = IS_RIGHT ? length - 1 : 0;
1523
+ var i = IS_RIGHT ? -1 : 1;
1524
+ if (argumentsLength < 2) while (true) {
1525
+ if (index in self) {
1526
+ memo = self[index];
1527
+ index += i;
1528
+ break;
1529
+ }
1530
+ index += i;
1531
+ if (IS_RIGHT ? index < 0 : length <= index) {
1532
+ throw new $TypeError$9(REDUCE_EMPTY);
1533
+ }
1534
+ }
1535
+ for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
1536
+ memo = callbackfn(memo, self[index], index, O);
1537
+ }
1538
+ return memo;
1539
+ };
1540
+ };
1541
+
1542
+ var arrayReduce = {
1543
+ // `Array.prototype.reduce` method
1544
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
1545
+ left: createMethod(false)};
1546
+
1547
+ var fails$5 = fails$h;
1548
+
1549
+ var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1550
+ var method = [][METHOD_NAME];
1551
+ return !!method && fails$5(function () {
1552
+ // eslint-disable-next-line no-useless-call -- required for testing
1553
+ method.call(null, argument || function () { return 1; }, 1);
1554
+ });
1555
+ };
1556
+
1557
+ /* global Bun, Deno -- detection */
1558
+ var globalThis$b = globalThis_1;
1559
+ var userAgent$3 = environmentUserAgent;
1560
+ var classof$5 = classofRaw$2;
1561
+
1562
+ var userAgentStartsWith = function (string) {
1563
+ return userAgent$3.slice(0, string.length) === string;
1564
+ };
1565
+
1566
+ var environment = (function () {
1567
+ if (userAgentStartsWith('Bun/')) return 'BUN';
1568
+ if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE';
1569
+ if (userAgentStartsWith('Deno/')) return 'DENO';
1570
+ if (userAgentStartsWith('Node.js/')) return 'NODE';
1571
+ if (globalThis$b.Bun && typeof Bun.version == 'string') return 'BUN';
1572
+ if (globalThis$b.Deno && typeof Deno.version == 'object') return 'DENO';
1573
+ if (classof$5(globalThis$b.process) === 'process') return 'NODE';
1574
+ if (globalThis$b.window && globalThis$b.document) return 'BROWSER';
1575
+ return 'REST';
1576
+ })();
1577
+
1578
+ var ENVIRONMENT$1 = environment;
1579
+
1580
+ var environmentIsNode = ENVIRONMENT$1 === 'NODE';
1581
+
1582
+ var $$d = _export;
1583
+ var $reduce = arrayReduce.left;
1584
+ var arrayMethodIsStrict = arrayMethodIsStrict$1;
1585
+ var CHROME_VERSION = environmentV8Version;
1586
+ var IS_NODE$3 = environmentIsNode;
1587
+
1588
+ // Chrome 80-82 has a critical bug
1589
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
1590
+ var CHROME_BUG = !IS_NODE$3 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1591
+ var FORCED$3 = CHROME_BUG || !arrayMethodIsStrict('reduce');
1592
+
1593
+ // `Array.prototype.reduce` method
1594
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
1595
+ $$d({ target: 'Array', proto: true, forced: FORCED$3 }, {
1596
+ reduce: function reduce(callbackfn /* , initialValue */) {
1597
+ var length = arguments.length;
1598
+ return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
1599
+ }
1600
+ });
1601
+
1602
+ var isPrototypeOf$1 = objectIsPrototypeOf;
1603
+
1604
+ var $TypeError$8 = TypeError;
1605
+
1606
+ var anInstance$2 = function (it, Prototype) {
1607
+ if (isPrototypeOf$1(Prototype, it)) return it;
1608
+ throw new $TypeError$8('Incorrect invocation');
1609
+ };
1610
+
1611
+ var makeBuiltIn = makeBuiltInExports;
1612
+ var defineProperty$1 = objectDefineProperty;
1613
+
1614
+ var defineBuiltInAccessor$2 = function (target, name, descriptor) {
1615
+ if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
1616
+ if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
1617
+ return defineProperty$1.f(target, name, descriptor);
1618
+ };
1619
+
1620
+ var DESCRIPTORS$4 = descriptors;
1621
+ var definePropertyModule = objectDefineProperty;
1622
+ var createPropertyDescriptor = createPropertyDescriptor$4;
1623
+
1624
+ var createProperty$2 = function (object, key, value) {
1625
+ if (DESCRIPTORS$4) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
1626
+ else object[key] = value;
1627
+ };
1628
+
1629
+ var $$c = _export;
1630
+ var globalThis$a = globalThis_1;
1631
+ var anInstance$1 = anInstance$2;
1632
+ var anObject$9 = anObject$e;
1633
+ var isCallable$6 = isCallable$k;
1634
+ var getPrototypeOf = objectGetPrototypeOf;
1635
+ var defineBuiltInAccessor$1 = defineBuiltInAccessor$2;
1636
+ var createProperty$1 = createProperty$2;
1637
+ var fails$4 = fails$h;
1638
+ var hasOwn$1 = hasOwnProperty_1;
1639
+ var wellKnownSymbol$c = wellKnownSymbol$i;
1640
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1641
+ var DESCRIPTORS$3 = descriptors;
1642
+
1643
+ var CONSTRUCTOR = 'constructor';
1644
+ var ITERATOR$4 = 'Iterator';
1645
+ var TO_STRING_TAG$3 = wellKnownSymbol$c('toStringTag');
1646
+
1647
+ var $TypeError$7 = TypeError;
1648
+ var NativeIterator = globalThis$a[ITERATOR$4];
1649
+
1650
+ // FF56- have non-standard global helper `Iterator`
1651
+ var FORCED$2 = !isCallable$6(NativeIterator)
1652
+ || NativeIterator.prototype !== IteratorPrototype$1
1653
+ // FF44- non-standard `Iterator` passes previous tests
1654
+ || !fails$4(function () { NativeIterator({}); });
1655
+
1656
+ var IteratorConstructor = function Iterator() {
1657
+ anInstance$1(this, IteratorPrototype$1);
1658
+ if (getPrototypeOf(this) === IteratorPrototype$1) throw new $TypeError$7('Abstract class Iterator not directly constructable');
1659
+ };
1660
+
1661
+ var defineIteratorPrototypeAccessor = function (key, value) {
1662
+ if (DESCRIPTORS$3) {
1663
+ defineBuiltInAccessor$1(IteratorPrototype$1, key, {
1664
+ configurable: true,
1665
+ get: function () {
1666
+ return value;
1667
+ },
1668
+ set: function (replacement) {
1669
+ anObject$9(this);
1670
+ if (this === IteratorPrototype$1) throw new $TypeError$7("You can't redefine this property");
1671
+ if (hasOwn$1(this, key)) this[key] = replacement;
1672
+ else createProperty$1(this, key, replacement);
1673
+ }
1674
+ });
1675
+ } else IteratorPrototype$1[key] = value;
1676
+ };
1677
+
1678
+ if (!hasOwn$1(IteratorPrototype$1, TO_STRING_TAG$3)) defineIteratorPrototypeAccessor(TO_STRING_TAG$3, ITERATOR$4);
1679
+
1680
+ if (FORCED$2 || !hasOwn$1(IteratorPrototype$1, CONSTRUCTOR) || IteratorPrototype$1[CONSTRUCTOR] === Object) {
1681
+ defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
1682
+ }
1683
+
1684
+ IteratorConstructor.prototype = IteratorPrototype$1;
1685
+
1686
+ // `Iterator` constructor
1687
+ // https://tc39.es/ecma262/#sec-iterator
1688
+ $$c({ global: true, constructor: true, forced: FORCED$2 }, {
1689
+ Iterator: IteratorConstructor
1690
+ });
1691
+
1692
+ // `GetIteratorDirect(obj)` abstract operation
1693
+ // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
1694
+ var getIteratorDirect$3 = function (obj) {
1695
+ return {
1696
+ iterator: obj,
1697
+ next: obj.next,
1698
+ done: false
1699
+ };
1700
+ };
1701
+
1702
+ var defineBuiltIn$2 = defineBuiltIn$6;
1703
+
1704
+ var defineBuiltIns$1 = function (target, src, options) {
1705
+ for (var key in src) defineBuiltIn$2(target, key, src[key], options);
1706
+ return target;
1707
+ };
1708
+
1709
+ var call$a = functionCall;
1710
+ var anObject$8 = anObject$e;
1711
+ var getMethod$2 = getMethod$4;
1712
+
1713
+ var iteratorClose$7 = function (iterator, kind, value) {
1714
+ var innerResult, innerError;
1715
+ anObject$8(iterator);
1716
+ try {
1717
+ innerResult = getMethod$2(iterator, 'return');
1718
+ if (!innerResult) {
1719
+ if (kind === 'throw') throw value;
1720
+ return value;
1721
+ }
1722
+ innerResult = call$a(innerResult, iterator);
1723
+ } catch (error) {
1724
+ innerError = true;
1725
+ innerResult = error;
1726
+ }
1727
+ if (kind === 'throw') throw value;
1728
+ if (innerError) throw innerResult;
1729
+ anObject$8(innerResult);
1730
+ return value;
1731
+ };
1732
+
1733
+ var iteratorClose$6 = iteratorClose$7;
1734
+
1735
+ var iteratorCloseAll$1 = function (iters, kind, value) {
1736
+ for (var i = iters.length - 1; i >= 0; i--) {
1737
+ if (iters[i] === undefined) continue;
1738
+ try {
1739
+ value = iteratorClose$6(iters[i].iterator, kind, value);
1740
+ } catch (error) {
1741
+ kind = 'throw';
1742
+ value = error;
1743
+ }
1744
+ }
1745
+ if (kind === 'throw') throw value;
1746
+ return value;
1747
+ };
1748
+
1749
+ var call$9 = functionCall;
1750
+ var create = objectCreate;
1751
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
1752
+ var defineBuiltIns = defineBuiltIns$1;
1753
+ var wellKnownSymbol$b = wellKnownSymbol$i;
1754
+ var InternalStateModule$1 = internalState;
1755
+ var getMethod$1 = getMethod$4;
1756
+ var IteratorPrototype = iteratorsCore.IteratorPrototype;
1757
+ var createIterResultObject = createIterResultObject$2;
1758
+ var iteratorClose$5 = iteratorClose$7;
1759
+ var iteratorCloseAll = iteratorCloseAll$1;
1760
+
1761
+ var TO_STRING_TAG$2 = wellKnownSymbol$b('toStringTag');
1762
+ var ITERATOR_HELPER = 'IteratorHelper';
1763
+ var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
1764
+ var NORMAL = 'normal';
1765
+ var THROW = 'throw';
1766
+ var setInternalState$1 = InternalStateModule$1.set;
1767
+
1768
+ var createIteratorProxyPrototype = function (IS_ITERATOR) {
1769
+ var getInternalState = InternalStateModule$1.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
1770
+
1771
+ return defineBuiltIns(create(IteratorPrototype), {
1772
+ next: function next() {
1773
+ var state = getInternalState(this);
1774
+ // for simplification:
1775
+ // for `%WrapForValidIteratorPrototype%.next` or with `state.returnHandlerResult` our `nextHandler` returns `IterResultObject`
1776
+ // for `%IteratorHelperPrototype%.next` - just a value
1777
+ if (IS_ITERATOR) return state.nextHandler();
1778
+ if (state.done) return createIterResultObject(undefined, true);
1779
+ try {
1780
+ var result = state.nextHandler();
1781
+ return state.returnHandlerResult ? result : createIterResultObject(result, state.done);
1782
+ } catch (error) {
1783
+ state.done = true;
1784
+ throw error;
1785
+ }
1786
+ },
1787
+ 'return': function () {
1788
+ var state = getInternalState(this);
1789
+ var iterator = state.iterator;
1790
+ state.done = true;
1791
+ if (IS_ITERATOR) {
1792
+ var returnMethod = getMethod$1(iterator, 'return');
1793
+ return returnMethod ? call$9(returnMethod, iterator) : createIterResultObject(undefined, true);
1794
+ }
1795
+ if (state.inner) try {
1796
+ iteratorClose$5(state.inner.iterator, NORMAL);
1797
+ } catch (error) {
1798
+ return iteratorClose$5(iterator, THROW, error);
1799
+ }
1800
+ if (state.openIters) try {
1801
+ iteratorCloseAll(state.openIters, NORMAL);
1802
+ } catch (error) {
1803
+ return iteratorClose$5(iterator, THROW, error);
1804
+ }
1805
+ if (iterator) iteratorClose$5(iterator, NORMAL);
1806
+ return createIterResultObject(undefined, true);
1807
+ }
1808
+ });
1809
+ };
1810
+
1811
+ var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
1812
+ var IteratorHelperPrototype = createIteratorProxyPrototype(false);
1813
+
1814
+ createNonEnumerableProperty$1(IteratorHelperPrototype, TO_STRING_TAG$2, 'Iterator Helper');
1815
+
1816
+ var iteratorCreateProxy = function (nextHandler, IS_ITERATOR, RETURN_HANDLER_RESULT) {
1817
+ var IteratorProxy = function Iterator(record, state) {
1818
+ if (state) {
1819
+ state.iterator = record.iterator;
1820
+ state.next = record.next;
1821
+ } else state = record;
1822
+ state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
1823
+ state.returnHandlerResult = !!RETURN_HANDLER_RESULT;
1824
+ state.nextHandler = nextHandler;
1825
+ state.counter = 0;
1826
+ state.done = false;
1827
+ setInternalState$1(this, state);
1828
+ };
1829
+
1830
+ IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
1831
+
1832
+ return IteratorProxy;
1833
+ };
1834
+
1835
+ var anObject$7 = anObject$e;
1836
+ var iteratorClose$4 = iteratorClose$7;
1837
+
1838
+ // call something on iterator step with safe closing on error
1839
+ var callWithSafeIterationClosing$2 = function (iterator, fn, value, ENTRIES) {
1840
+ try {
1841
+ return ENTRIES ? fn(anObject$7(value)[0], value[1]) : fn(value);
1842
+ } catch (error) {
1843
+ iteratorClose$4(iterator, 'throw', error);
1844
+ }
1845
+ };
1846
+
1847
+ // Should throw an error on invalid iterator
1848
+ // https://issues.chromium.org/issues/336839115
1849
+ var iteratorHelperThrowsOnInvalidIterator$2 = function (methodName, argument) {
1850
+ // eslint-disable-next-line es/no-iterator -- required for testing
1851
+ var method = typeof Iterator == 'function' && Iterator.prototype[methodName];
1852
+ if (method) try {
1853
+ method.call({ next: null }, argument).next();
1854
+ } catch (error) {
1855
+ return true;
1856
+ }
1857
+ };
1858
+
1859
+ var globalThis$9 = globalThis_1;
1860
+
1861
+ // https://github.com/tc39/ecma262/pull/3467
1862
+ var iteratorHelperWithoutClosingOnEarlyError$3 = function (METHOD_NAME, ExpectedError) {
1863
+ var Iterator = globalThis$9.Iterator;
1864
+ var IteratorPrototype = Iterator && Iterator.prototype;
1865
+ var method = IteratorPrototype && IteratorPrototype[METHOD_NAME];
1866
+
1867
+ var CLOSED = false;
1868
+
1869
+ if (method) try {
1870
+ method.call({
1871
+ next: function () { return { done: true }; },
1872
+ 'return': function () { CLOSED = true; }
1873
+ }, -1);
1874
+ } catch (error) {
1875
+ // https://bugs.webkit.org/show_bug.cgi?id=291195
1876
+ if (!(error instanceof ExpectedError)) CLOSED = false;
1877
+ }
1878
+
1879
+ if (!CLOSED) return method;
1880
+ };
1881
+
1882
+ var $$b = _export;
1883
+ var call$8 = functionCall;
1884
+ var aCallable$8 = aCallable$c;
1885
+ var anObject$6 = anObject$e;
1886
+ var getIteratorDirect$2 = getIteratorDirect$3;
1887
+ var createIteratorProxy$1 = iteratorCreateProxy;
1888
+ var callWithSafeIterationClosing$1 = callWithSafeIterationClosing$2;
1889
+ var iteratorClose$3 = iteratorClose$7;
1890
+ var iteratorHelperThrowsOnInvalidIterator$1 = iteratorHelperThrowsOnInvalidIterator$2;
1891
+ var iteratorHelperWithoutClosingOnEarlyError$2 = iteratorHelperWithoutClosingOnEarlyError$3;
1892
+
1893
+ var FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR = !iteratorHelperThrowsOnInvalidIterator$1('filter', function () { /* empty */ });
1894
+ var filterWithoutClosingOnEarlyError = !FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR
1895
+ && iteratorHelperWithoutClosingOnEarlyError$2('filter', TypeError);
1896
+
1897
+ var FORCED$1 = FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR || filterWithoutClosingOnEarlyError;
1898
+
1899
+ var IteratorProxy$1 = createIteratorProxy$1(function () {
1900
+ var iterator = this.iterator;
1901
+ var predicate = this.predicate;
1902
+ var next = this.next;
1903
+ var result, done, value;
1904
+ while (true) {
1905
+ result = anObject$6(call$8(next, iterator));
1906
+ done = this.done = !!result.done;
1907
+ if (done) return;
1908
+ value = result.value;
1909
+ if (callWithSafeIterationClosing$1(iterator, predicate, [value, this.counter++], true)) return value;
1910
+ }
1911
+ });
1912
+
1913
+ // `Iterator.prototype.filter` method
1914
+ // https://tc39.es/ecma262/#sec-iterator.prototype.filter
1915
+ $$b({ target: 'Iterator', proto: true, real: true, forced: FORCED$1 }, {
1916
+ filter: function filter(predicate) {
1917
+ anObject$6(this);
1918
+ try {
1919
+ aCallable$8(predicate);
1920
+ } catch (error) {
1921
+ iteratorClose$3(this, 'throw', error);
1922
+ }
1923
+
1924
+ if (filterWithoutClosingOnEarlyError) return call$8(filterWithoutClosingOnEarlyError, this, predicate);
1925
+
1926
+ return new IteratorProxy$1(getIteratorDirect$2(this), {
1927
+ predicate: predicate
1928
+ });
1929
+ }
1930
+ });
1931
+
1932
+ var $$a = _export;
1933
+ var call$7 = functionCall;
1934
+ var aCallable$7 = aCallable$c;
1935
+ var anObject$5 = anObject$e;
1936
+ var getIteratorDirect$1 = getIteratorDirect$3;
1937
+ var createIteratorProxy = iteratorCreateProxy;
1938
+ var callWithSafeIterationClosing = callWithSafeIterationClosing$2;
1939
+ var iteratorClose$2 = iteratorClose$7;
1940
+ var iteratorHelperThrowsOnInvalidIterator = iteratorHelperThrowsOnInvalidIterator$2;
1941
+ var iteratorHelperWithoutClosingOnEarlyError$1 = iteratorHelperWithoutClosingOnEarlyError$3;
1942
+
1943
+ var MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR = !iteratorHelperThrowsOnInvalidIterator('map', function () { /* empty */ });
1944
+ var mapWithoutClosingOnEarlyError = !MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR
1945
+ && iteratorHelperWithoutClosingOnEarlyError$1('map', TypeError);
1946
+
1947
+ var FORCED = MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR || mapWithoutClosingOnEarlyError;
1948
+
1949
+ var IteratorProxy = createIteratorProxy(function () {
1950
+ var iterator = this.iterator;
1951
+ var result = anObject$5(call$7(this.next, iterator));
1952
+ var done = this.done = !!result.done;
1953
+ if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
1954
+ });
1955
+
1956
+ // `Iterator.prototype.map` method
1957
+ // https://tc39.es/ecma262/#sec-iterator.prototype.map
1958
+ $$a({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
1959
+ map: function map(mapper) {
1960
+ anObject$5(this);
1961
+ try {
1962
+ aCallable$7(mapper);
1963
+ } catch (error) {
1964
+ iteratorClose$2(this, 'throw', error);
1965
+ }
1966
+
1967
+ if (mapWithoutClosingOnEarlyError) return call$7(mapWithoutClosingOnEarlyError, this, mapper);
1968
+
1969
+ return new IteratorProxy(getIteratorDirect$1(this), {
1970
+ mapper: mapper
1971
+ });
1972
+ }
1973
+ });
1974
+
1975
+ var classofRaw$1 = classofRaw$2;
1976
+ var uncurryThis$5 = functionUncurryThis;
1977
+
1978
+ var functionUncurryThisClause = function (fn) {
1979
+ // Nashorn bug:
1980
+ // https://github.com/zloirock/core-js/issues/1128
1981
+ // https://github.com/zloirock/core-js/issues/1130
1982
+ if (classofRaw$1(fn) === 'Function') return uncurryThis$5(fn);
1983
+ };
1984
+
1985
+ var uncurryThis$4 = functionUncurryThisClause;
1986
+ var aCallable$6 = aCallable$c;
1987
+ var NATIVE_BIND$1 = functionBindNative;
1988
+
1989
+ var bind$4 = uncurryThis$4(uncurryThis$4.bind);
1990
+
1991
+ // optional / simple context binding
1992
+ var functionBindContext = function (fn, that) {
1993
+ aCallable$6(fn);
1994
+ return that === undefined ? fn : NATIVE_BIND$1 ? bind$4(fn, that) : function (/* ...args */) {
1995
+ return fn.apply(that, arguments);
1996
+ };
1997
+ };
1998
+
1999
+ var wellKnownSymbol$a = wellKnownSymbol$i;
2000
+ var Iterators$1 = iterators;
2001
+
2002
+ var ITERATOR$3 = wellKnownSymbol$a('iterator');
2003
+ var ArrayPrototype = Array.prototype;
2004
+
2005
+ // check on default Array iterator
2006
+ var isArrayIteratorMethod$1 = function (it) {
2007
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$3] === it);
2008
+ };
2009
+
2010
+ var wellKnownSymbol$9 = wellKnownSymbol$i;
2011
+
2012
+ var TO_STRING_TAG$1 = wellKnownSymbol$9('toStringTag');
2013
+ var test = {};
2014
+
2015
+ test[TO_STRING_TAG$1] = 'z';
2016
+
2017
+ var toStringTagSupport = String(test) === '[object z]';
2018
+
2019
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2020
+ var isCallable$5 = isCallable$k;
2021
+ var classofRaw = classofRaw$2;
2022
+ var wellKnownSymbol$8 = wellKnownSymbol$i;
2023
+
2024
+ var TO_STRING_TAG = wellKnownSymbol$8('toStringTag');
2025
+ var $Object = Object;
2026
+
2027
+ // ES3 wrong here
2028
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
2029
+
2030
+ // fallback for IE11 Script Access Denied error
2031
+ var tryGet = function (it, key) {
2032
+ try {
2033
+ return it[key];
2034
+ } catch (error) { /* empty */ }
2035
+ };
2036
+
2037
+ // getting tag from ES6+ `Object.prototype.toString`
2038
+ var classof$4 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2039
+ var O, tag, result;
2040
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
2041
+ // @@toStringTag case
2042
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
2043
+ // builtinTag case
2044
+ : CORRECT_ARGUMENTS ? classofRaw(O)
2045
+ // ES3 arguments fallback
2046
+ : (result = classofRaw(O)) === 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
2047
+ };
2048
+
2049
+ var classof$3 = classof$4;
2050
+ var getMethod = getMethod$4;
2051
+ var isNullOrUndefined$1 = isNullOrUndefined$4;
2052
+ var Iterators = iterators;
2053
+ var wellKnownSymbol$7 = wellKnownSymbol$i;
2054
+
2055
+ var ITERATOR$2 = wellKnownSymbol$7('iterator');
2056
+
2057
+ var getIteratorMethod$2 = function (it) {
2058
+ if (!isNullOrUndefined$1(it)) return getMethod(it, ITERATOR$2)
2059
+ || getMethod(it, '@@iterator')
2060
+ || Iterators[classof$3(it)];
2061
+ };
2062
+
2063
+ var call$6 = functionCall;
2064
+ var aCallable$5 = aCallable$c;
2065
+ var anObject$4 = anObject$e;
2066
+ var tryToString$2 = tryToString$4;
2067
+ var getIteratorMethod$1 = getIteratorMethod$2;
2068
+
2069
+ var $TypeError$6 = TypeError;
2070
+
2071
+ var getIterator$1 = function (argument, usingIterator) {
2072
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
2073
+ if (aCallable$5(iteratorMethod)) return anObject$4(call$6(iteratorMethod, argument));
2074
+ throw new $TypeError$6(tryToString$2(argument) + ' is not iterable');
2075
+ };
2076
+
2077
+ var bind$3 = functionBindContext;
2078
+ var call$5 = functionCall;
2079
+ var anObject$3 = anObject$e;
2080
+ var tryToString$1 = tryToString$4;
2081
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
2082
+ var lengthOfArrayLike = lengthOfArrayLike$3;
2083
+ var isPrototypeOf = objectIsPrototypeOf;
2084
+ var getIterator = getIterator$1;
2085
+ var getIteratorMethod = getIteratorMethod$2;
2086
+ var iteratorClose$1 = iteratorClose$7;
2087
+
2088
+ var $TypeError$5 = TypeError;
2089
+
2090
+ var Result = function (stopped, result) {
2091
+ this.stopped = stopped;
2092
+ this.result = result;
2093
+ };
2094
+
2095
+ var ResultPrototype = Result.prototype;
2096
+
2097
+ var iterate$4 = function (iterable, unboundFunction, options) {
2098
+ var that = options && options.that;
2099
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2100
+ var IS_RECORD = !!(options && options.IS_RECORD);
2101
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2102
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
2103
+ var fn = bind$3(unboundFunction, that);
2104
+ var iterator, iterFn, index, length, result, next, step;
2105
+
2106
+ var stop = function (condition) {
2107
+ if (iterator) iteratorClose$1(iterator, 'normal');
2108
+ return new Result(true, condition);
2109
+ };
2110
+
2111
+ var callFn = function (value) {
2112
+ if (AS_ENTRIES) {
2113
+ anObject$3(value);
2114
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2115
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
2116
+ };
2117
+
2118
+ if (IS_RECORD) {
2119
+ iterator = iterable.iterator;
2120
+ } else if (IS_ITERATOR) {
2121
+ iterator = iterable;
2122
+ } else {
2123
+ iterFn = getIteratorMethod(iterable);
2124
+ if (!iterFn) throw new $TypeError$5(tryToString$1(iterable) + ' is not iterable');
2125
+ // optimisation for array iterators
2126
+ if (isArrayIteratorMethod(iterFn)) {
2127
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2128
+ result = callFn(iterable[index]);
2129
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
2130
+ } return new Result(false);
2131
+ }
2132
+ iterator = getIterator(iterable, iterFn);
2133
+ }
2134
+
2135
+ next = IS_RECORD ? iterable.next : iterator.next;
2136
+ while (!(step = call$5(next, iterator)).done) {
2137
+ try {
2138
+ result = callFn(step.value);
2139
+ } catch (error) {
2140
+ iteratorClose$1(iterator, 'throw', error);
2141
+ }
2142
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
2143
+ } return new Result(false);
2144
+ };
2145
+
2146
+ var NATIVE_BIND = functionBindNative;
2147
+
2148
+ var FunctionPrototype = Function.prototype;
2149
+ var apply$2 = FunctionPrototype.apply;
2150
+ var call$4 = FunctionPrototype.call;
2151
+
2152
+ // eslint-disable-next-line es/no-function-prototype-bind, es/no-reflect -- safe
2153
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$4.bind(apply$2) : function () {
2154
+ return call$4.apply(apply$2, arguments);
2155
+ });
2156
+
2157
+ var $$9 = _export;
2158
+ var iterate$3 = iterate$4;
2159
+ var aCallable$4 = aCallable$c;
2160
+ var anObject$2 = anObject$e;
2161
+ var getIteratorDirect = getIteratorDirect$3;
2162
+ var iteratorClose = iteratorClose$7;
2163
+ var iteratorHelperWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError$3;
2164
+ var apply$1 = functionApply;
2165
+ var fails$3 = fails$h;
2166
+
2167
+ var $TypeError$4 = TypeError;
2168
+
2169
+ // https://bugs.webkit.org/show_bug.cgi?id=291651
2170
+ var FAILS_ON_INITIAL_UNDEFINED = fails$3(function () {
2171
+ // eslint-disable-next-line es/no-iterator-prototype-reduce, es/no-array-prototype-keys, array-callback-return -- required for testing
2172
+ [].keys().reduce(function () { /* empty */ }, undefined);
2173
+ });
2174
+
2175
+ var reduceWithoutClosingOnEarlyError = !FAILS_ON_INITIAL_UNDEFINED && iteratorHelperWithoutClosingOnEarlyError('reduce', $TypeError$4);
2176
+
2177
+ // `Iterator.prototype.reduce` method
2178
+ // https://tc39.es/ecma262/#sec-iterator.prototype.reduce
2179
+ $$9({ target: 'Iterator', proto: true, real: true, forced: FAILS_ON_INITIAL_UNDEFINED || reduceWithoutClosingOnEarlyError }, {
2180
+ reduce: function reduce(reducer /* , initialValue */) {
2181
+ anObject$2(this);
2182
+ try {
2183
+ aCallable$4(reducer);
2184
+ } catch (error) {
2185
+ iteratorClose(this, 'throw', error);
2186
+ }
2187
+
2188
+ var noInitial = arguments.length < 2;
2189
+ var accumulator = noInitial ? undefined : arguments[1];
2190
+ if (reduceWithoutClosingOnEarlyError) {
2191
+ return apply$1(reduceWithoutClosingOnEarlyError, this, noInitial ? [reducer] : [reducer, accumulator]);
2192
+ }
2193
+ var record = getIteratorDirect(this);
2194
+ var counter = 0;
2195
+ iterate$3(record, function (value) {
2196
+ if (noInitial) {
2197
+ noInitial = false;
2198
+ accumulator = value;
2199
+ } else {
2200
+ accumulator = reducer(accumulator, value, counter);
2201
+ }
2202
+ counter++;
2203
+ }, { IS_RECORD: true });
2204
+ if (noInitial) throw new $TypeError$4('Reduce of empty iterator with no initial value');
2205
+ return accumulator;
2206
+ }
2207
+ });
2208
+
2209
+ var DESCRIPTORS$2 = descriptors;
2210
+ var uncurryThis$3 = functionUncurryThis;
2211
+ var call$3 = functionCall;
2212
+ var fails$2 = fails$h;
2213
+ var objectKeys = objectKeys$2;
2214
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2215
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
2216
+ var toObject = toObject$4;
2217
+ var IndexedObject = indexedObject;
2218
+
2219
+ // eslint-disable-next-line es/no-object-assign -- safe
2220
+ var $assign = Object.assign;
2221
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
2222
+ var defineProperty = Object.defineProperty;
2223
+ var concat = uncurryThis$3([].concat);
2224
+
2225
+ // `Object.assign` method
2226
+ // https://tc39.es/ecma262/#sec-object.assign
2227
+ var objectAssign = !$assign || fails$2(function () {
2228
+ // should have correct order of operations (Edge bug)
2229
+ if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
2230
+ enumerable: true,
2231
+ get: function () {
2232
+ defineProperty(this, 'b', {
2233
+ value: 3,
2234
+ enumerable: false
2235
+ });
2236
+ }
2237
+ }), { b: 2 })).b !== 1) return true;
2238
+ // should work with symbols and should have deterministic property order (V8 bug)
2239
+ var A = {};
2240
+ var B = {};
2241
+ // eslint-disable-next-line es/no-symbol -- safe
2242
+ var symbol = Symbol('assign detection');
2243
+ var alphabet = 'abcdefghijklmnopqrst';
2244
+ A[symbol] = 7;
2245
+ // eslint-disable-next-line es/no-array-prototype-foreach -- safe
2246
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
2247
+ return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
2248
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
2249
+ var T = toObject(target);
2250
+ var argumentsLength = arguments.length;
2251
+ var index = 1;
2252
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
2253
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
2254
+ while (argumentsLength > index) {
2255
+ var S = IndexedObject(arguments[index++]);
2256
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
2257
+ var length = keys.length;
2258
+ var j = 0;
2259
+ var key;
2260
+ while (length > j) {
2261
+ key = keys[j++];
2262
+ if (!DESCRIPTORS$2 || call$3(propertyIsEnumerable, S, key)) T[key] = S[key];
2263
+ }
2264
+ } return T;
2265
+ } : $assign;
2266
+
2267
+ var $$8 = _export;
2268
+ var assign = objectAssign;
2269
+
2270
+ // `Object.assign` method
2271
+ // https://tc39.es/ecma262/#sec-object.assign
2272
+ // eslint-disable-next-line es/no-object-assign -- required for testing
2273
+ $$8({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
2274
+ assign: assign
2275
+ });
2276
+
2277
+ var $$7 = _export;
2278
+ var iterate$2 = iterate$4;
2279
+ var createProperty = createProperty$2;
2280
+
2281
+ // `Object.fromEntries` method
2282
+ // https://tc39.es/ecma262/#sec-object.fromentries
2283
+ $$7({ target: 'Object', stat: true }, {
2284
+ fromEntries: function fromEntries(iterable) {
2285
+ var obj = {};
2286
+ iterate$2(iterable, function (k, v) {
2287
+ createProperty(obj, k, v);
2288
+ }, { AS_ENTRIES: true });
2289
+ return obj;
2290
+ }
2291
+ });
2292
+
2293
+ var globalThis$8 = globalThis_1;
2294
+
2295
+ var path$1 = globalThis$8;
2296
+
2297
+ var getBuiltIn$3 = getBuiltIn$7;
2298
+ var defineBuiltInAccessor = defineBuiltInAccessor$2;
2299
+ var wellKnownSymbol$6 = wellKnownSymbol$i;
2300
+ var DESCRIPTORS$1 = descriptors;
2301
+
2302
+ var SPECIES$2 = wellKnownSymbol$6('species');
2303
+
2304
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
2305
+ var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
2306
+
2307
+ if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES$2]) {
2308
+ defineBuiltInAccessor(Constructor, SPECIES$2, {
2309
+ configurable: true,
2310
+ get: function () { return this; }
2311
+ });
2312
+ }
2313
+ };
2314
+
2315
+ var uncurryThis$2 = functionUncurryThis;
2316
+ var fails$1 = fails$h;
2317
+ var isCallable$4 = isCallable$k;
2318
+ var classof$2 = classof$4;
2319
+ var getBuiltIn$2 = getBuiltIn$7;
2320
+ var inspectSource$1 = inspectSource$3;
2321
+
2322
+ var noop = function () { /* empty */ };
2323
+ var construct = getBuiltIn$2('Reflect', 'construct');
2324
+ var constructorRegExp = /^\s*(?:class|function)\b/;
2325
+ var exec = uncurryThis$2(constructorRegExp.exec);
2326
+ var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
2327
+
2328
+ var isConstructorModern = function isConstructor(argument) {
2329
+ if (!isCallable$4(argument)) return false;
2330
+ try {
2331
+ construct(noop, [], argument);
2332
+ return true;
2333
+ } catch (error) {
2334
+ return false;
2335
+ }
2336
+ };
2337
+
2338
+ var isConstructorLegacy = function isConstructor(argument) {
2339
+ if (!isCallable$4(argument)) return false;
2340
+ switch (classof$2(argument)) {
2341
+ case 'AsyncFunction':
2342
+ case 'GeneratorFunction':
2343
+ case 'AsyncGeneratorFunction': return false;
2344
+ }
2345
+ try {
2346
+ // we can't check .prototype since constructors produced by .bind haven't it
2347
+ // `Function#toString` throws on some built-it function in some legacy engines
2348
+ // (for example, `DOMQuad` and similar in FF41-)
2349
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
2350
+ } catch (error) {
2351
+ return true;
2352
+ }
2353
+ };
2354
+
2355
+ isConstructorLegacy.sham = true;
2356
+
2357
+ // `IsConstructor` abstract operation
2358
+ // https://tc39.es/ecma262/#sec-isconstructor
2359
+ var isConstructor$1 = !construct || fails$1(function () {
2360
+ var called;
2361
+ return isConstructorModern(isConstructorModern.call)
2362
+ || !isConstructorModern(Object)
2363
+ || !isConstructorModern(function () { called = true; })
2364
+ || called;
2365
+ }) ? isConstructorLegacy : isConstructorModern;
2366
+
2367
+ var isConstructor = isConstructor$1;
2368
+ var tryToString = tryToString$4;
2369
+
2370
+ var $TypeError$3 = TypeError;
2371
+
2372
+ // `Assert: IsConstructor(argument) is true`
2373
+ var aConstructor$1 = function (argument) {
2374
+ if (isConstructor(argument)) return argument;
2375
+ throw new $TypeError$3(tryToString(argument) + ' is not a constructor');
2376
+ };
2377
+
2378
+ var anObject$1 = anObject$e;
2379
+ var aConstructor = aConstructor$1;
2380
+ var isNullOrUndefined = isNullOrUndefined$4;
2381
+ var wellKnownSymbol$5 = wellKnownSymbol$i;
2382
+
2383
+ var SPECIES$1 = wellKnownSymbol$5('species');
2384
+
2385
+ // `SpeciesConstructor` abstract operation
2386
+ // https://tc39.es/ecma262/#sec-speciesconstructor
2387
+ var speciesConstructor$1 = function (O, defaultConstructor) {
2388
+ var C = anObject$1(O).constructor;
2389
+ var S;
2390
+ return C === undefined || isNullOrUndefined(S = anObject$1(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
2391
+ };
2392
+
2393
+ var uncurryThis$1 = functionUncurryThis;
2394
+
2395
+ var arraySlice$1 = uncurryThis$1([].slice);
2396
+
2397
+ var $TypeError$2 = TypeError;
2398
+
2399
+ var validateArgumentsLength$1 = function (passed, required) {
2400
+ if (passed < required) throw new $TypeError$2('Not enough arguments');
2401
+ return passed;
2402
+ };
2403
+
2404
+ var userAgent$2 = environmentUserAgent;
2405
+
2406
+ // eslint-disable-next-line redos/no-vulnerable -- safe
2407
+ var environmentIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
2408
+
2409
+ var globalThis$7 = globalThis_1;
2410
+ var apply = functionApply;
2411
+ var bind$2 = functionBindContext;
2412
+ var isCallable$3 = isCallable$k;
2413
+ var hasOwn = hasOwnProperty_1;
2414
+ var fails = fails$h;
2415
+ var html = html$2;
2416
+ var arraySlice = arraySlice$1;
2417
+ var createElement = documentCreateElement$2;
2418
+ var validateArgumentsLength = validateArgumentsLength$1;
2419
+ var IS_IOS$1 = environmentIsIos;
2420
+ var IS_NODE$2 = environmentIsNode;
2421
+
2422
+ var set = globalThis$7.setImmediate;
2423
+ var clear = globalThis$7.clearImmediate;
2424
+ var process$3 = globalThis$7.process;
2425
+ var Dispatch = globalThis$7.Dispatch;
2426
+ var Function$1 = globalThis$7.Function;
2427
+ var MessageChannel = globalThis$7.MessageChannel;
2428
+ var String$1 = globalThis$7.String;
2429
+ var counter = 0;
2430
+ var queue$2 = {};
2431
+ var ONREADYSTATECHANGE = 'onreadystatechange';
2432
+ var $location, defer, channel, port;
2433
+
2434
+ fails(function () {
2435
+ // Deno throws a ReferenceError on `location` access without `--location` flag
2436
+ $location = globalThis$7.location;
2437
+ });
2438
+
2439
+ var run = function (id) {
2440
+ if (hasOwn(queue$2, id)) {
2441
+ var fn = queue$2[id];
2442
+ delete queue$2[id];
2443
+ fn();
2444
+ }
2445
+ };
2446
+
2447
+ var runner = function (id) {
2448
+ return function () {
2449
+ run(id);
2450
+ };
2451
+ };
2452
+
2453
+ var eventListener = function (event) {
2454
+ run(event.data);
2455
+ };
2456
+
2457
+ var globalPostMessageDefer = function (id) {
2458
+ // old engines have not location.origin
2459
+ globalThis$7.postMessage(String$1(id), $location.protocol + '//' + $location.host);
2460
+ };
2461
+
2462
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
2463
+ if (!set || !clear) {
2464
+ set = function setImmediate(handler) {
2465
+ validateArgumentsLength(arguments.length, 1);
2466
+ var fn = isCallable$3(handler) ? handler : Function$1(handler);
2467
+ var args = arraySlice(arguments, 1);
2468
+ queue$2[++counter] = function () {
2469
+ apply(fn, undefined, args);
2470
+ };
2471
+ defer(counter);
2472
+ return counter;
2473
+ };
2474
+ clear = function clearImmediate(id) {
2475
+ delete queue$2[id];
2476
+ };
2477
+ // Node.js 0.8-
2478
+ if (IS_NODE$2) {
2479
+ defer = function (id) {
2480
+ process$3.nextTick(runner(id));
2481
+ };
2482
+ // Sphere (JS game engine) Dispatch API
2483
+ } else if (Dispatch && Dispatch.now) {
2484
+ defer = function (id) {
2485
+ Dispatch.now(runner(id));
2486
+ };
2487
+ // Browsers with MessageChannel, includes WebWorkers
2488
+ // except iOS - https://github.com/zloirock/core-js/issues/624
2489
+ } else if (MessageChannel && !IS_IOS$1) {
2490
+ channel = new MessageChannel();
2491
+ port = channel.port2;
2492
+ channel.port1.onmessage = eventListener;
2493
+ defer = bind$2(port.postMessage, port);
2494
+ // Browsers with postMessage, skip WebWorkers
2495
+ // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
2496
+ } else if (
2497
+ globalThis$7.addEventListener &&
2498
+ isCallable$3(globalThis$7.postMessage) &&
2499
+ !globalThis$7.importScripts &&
2500
+ $location && $location.protocol !== 'file:' &&
2501
+ !fails(globalPostMessageDefer)
2502
+ ) {
2503
+ defer = globalPostMessageDefer;
2504
+ globalThis$7.addEventListener('message', eventListener, false);
2505
+ // IE8-
2506
+ } else if (ONREADYSTATECHANGE in createElement('script')) {
2507
+ defer = function (id) {
2508
+ html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
2509
+ html.removeChild(this);
2510
+ run(id);
2511
+ };
2512
+ };
2513
+ // Rest old browsers
2514
+ } else {
2515
+ defer = function (id) {
2516
+ setTimeout(runner(id), 0);
2517
+ };
2518
+ }
2519
+ }
2520
+
2521
+ var task$1 = {
2522
+ set: set};
2523
+
2524
+ var globalThis$6 = globalThis_1;
2525
+ var DESCRIPTORS = descriptors;
2526
+
2527
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2528
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
2529
+
2530
+ // Avoid NodeJS experimental warning
2531
+ var safeGetBuiltIn$1 = function (name) {
2532
+ if (!DESCRIPTORS) return globalThis$6[name];
2533
+ var descriptor = getOwnPropertyDescriptor(globalThis$6, name);
2534
+ return descriptor && descriptor.value;
2535
+ };
2536
+
2537
+ var Queue$2 = function () {
2538
+ this.head = null;
2539
+ this.tail = null;
2540
+ };
2541
+
2542
+ Queue$2.prototype = {
2543
+ add: function (item) {
2544
+ var entry = { item: item, next: null };
2545
+ var tail = this.tail;
2546
+ if (tail) tail.next = entry;
2547
+ else this.head = entry;
2548
+ this.tail = entry;
2549
+ },
2550
+ get: function () {
2551
+ var entry = this.head;
2552
+ if (entry) {
2553
+ var next = this.head = entry.next;
2554
+ if (next === null) this.tail = null;
2555
+ return entry.item;
2556
+ }
2557
+ }
2558
+ };
2559
+
2560
+ var queue$1 = Queue$2;
2561
+
2562
+ var userAgent$1 = environmentUserAgent;
2563
+
2564
+ var environmentIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && typeof Pebble != 'undefined';
2565
+
2566
+ var userAgent = environmentUserAgent;
2567
+
2568
+ var environmentIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
2569
+
2570
+ var globalThis$5 = globalThis_1;
2571
+ var safeGetBuiltIn = safeGetBuiltIn$1;
2572
+ var bind$1 = functionBindContext;
2573
+ var macrotask = task$1.set;
2574
+ var Queue$1 = queue$1;
2575
+ var IS_IOS = environmentIsIos;
2576
+ var IS_IOS_PEBBLE = environmentIsIosPebble;
2577
+ var IS_WEBOS_WEBKIT = environmentIsWebosWebkit;
2578
+ var IS_NODE$1 = environmentIsNode;
2579
+
2580
+ var MutationObserver = globalThis$5.MutationObserver || globalThis$5.WebKitMutationObserver;
2581
+ var document$2 = globalThis$5.document;
2582
+ var process$2 = globalThis$5.process;
2583
+ var Promise$1 = globalThis$5.Promise;
2584
+ var microtask$1 = safeGetBuiltIn('queueMicrotask');
2585
+ var notify$1, toggle, node, promise, then;
2586
+
2587
+ // modern engines have queueMicrotask method
2588
+ if (!microtask$1) {
2589
+ var queue = new Queue$1();
2590
+
2591
+ var flush = function () {
2592
+ var parent, fn;
2593
+ if (IS_NODE$1 && (parent = process$2.domain)) parent.exit();
2594
+ while (fn = queue.get()) try {
2595
+ fn();
2596
+ } catch (error) {
2597
+ if (queue.head) notify$1();
2598
+ throw error;
2599
+ }
2600
+ if (parent) parent.enter();
2601
+ };
2602
+
2603
+ // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
2604
+ // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
2605
+ if (!IS_IOS && !IS_NODE$1 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
2606
+ toggle = true;
2607
+ node = document$2.createTextNode('');
2608
+ new MutationObserver(flush).observe(node, { characterData: true });
2609
+ notify$1 = function () {
2610
+ node.data = toggle = !toggle;
2611
+ };
2612
+ // environments with maybe non-completely correct, but existent Promise
2613
+ } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
2614
+ // Promise.resolve without an argument throws an error in LG WebOS 2
2615
+ promise = Promise$1.resolve(undefined);
2616
+ // workaround of WebKit ~ iOS Safari 10.1 bug
2617
+ promise.constructor = Promise$1;
2618
+ then = bind$1(promise.then, promise);
2619
+ notify$1 = function () {
2620
+ then(flush);
2621
+ };
2622
+ // Node.js without promises
2623
+ } else if (IS_NODE$1) {
2624
+ notify$1 = function () {
2625
+ process$2.nextTick(flush);
2626
+ };
2627
+ // for other environments - macrotask based on:
2628
+ // - setImmediate
2629
+ // - MessageChannel
2630
+ // - window.postMessage
2631
+ // - onreadystatechange
2632
+ // - setTimeout
2633
+ } else {
2634
+ // `webpack` dev server bug on IE global methods - use bind(fn, global)
2635
+ macrotask = bind$1(macrotask, globalThis$5);
2636
+ notify$1 = function () {
2637
+ macrotask(flush);
2638
+ };
2639
+ }
2640
+
2641
+ microtask$1 = function (fn) {
2642
+ if (!queue.head) notify$1();
2643
+ queue.add(fn);
2644
+ };
2645
+ }
2646
+
2647
+ var microtask_1 = microtask$1;
2648
+
2649
+ var hostReportErrors$1 = function (a, b) {
2650
+ try {
2651
+ // eslint-disable-next-line no-console -- safe
2652
+ arguments.length === 1 ? console.error(a) : console.error(a, b);
2653
+ } catch (error) { /* empty */ }
2654
+ };
2655
+
2656
+ var perform$3 = function (exec) {
2657
+ try {
2658
+ return { error: false, value: exec() };
2659
+ } catch (error) {
2660
+ return { error: true, value: error };
2661
+ }
2662
+ };
2663
+
2664
+ var globalThis$4 = globalThis_1;
2665
+
2666
+ var promiseNativeConstructor = globalThis$4.Promise;
2667
+
2668
+ var globalThis$3 = globalThis_1;
2669
+ var NativePromiseConstructor$3 = promiseNativeConstructor;
2670
+ var isCallable$2 = isCallable$k;
2671
+ var isForced = isForced_1;
2672
+ var inspectSource = inspectSource$3;
2673
+ var wellKnownSymbol$4 = wellKnownSymbol$i;
2674
+ var ENVIRONMENT = environment;
2675
+ var V8_VERSION = environmentV8Version;
2676
+
2677
+ NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
2678
+ var SPECIES = wellKnownSymbol$4('species');
2679
+ var SUBCLASSING = false;
2680
+ var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$2(globalThis$3.PromiseRejectionEvent);
2681
+
2682
+ var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
2683
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
2684
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
2685
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
2686
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
2687
+ // We can't detect it synchronously, so just check versions
2688
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
2689
+ // We can't use @@species feature detection in V8 since it causes
2690
+ // deoptimization and performance degradation
2691
+ // https://github.com/zloirock/core-js/issues/679
2692
+ if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
2693
+ // Detect correctness of subclassing with @@species support
2694
+ var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
2695
+ var FakePromise = function (exec) {
2696
+ exec(function () { /* empty */ }, function () { /* empty */ });
2697
+ };
2698
+ var constructor = promise.constructor = {};
2699
+ constructor[SPECIES] = FakePromise;
2700
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
2701
+ if (!SUBCLASSING) return true;
2702
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
2703
+ } return !GLOBAL_CORE_JS_PROMISE && (ENVIRONMENT === 'BROWSER' || ENVIRONMENT === 'DENO') && !NATIVE_PROMISE_REJECTION_EVENT$1;
2704
+ });
2705
+
2706
+ var promiseConstructorDetection = {
2707
+ CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
2708
+ REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
2709
+ SUBCLASSING: SUBCLASSING
2710
+ };
2711
+
2712
+ var newPromiseCapability$2 = {};
2713
+
2714
+ var aCallable$3 = aCallable$c;
2715
+
2716
+ var $TypeError$1 = TypeError;
2717
+
2718
+ var PromiseCapability = function (C) {
2719
+ var resolve, reject;
2720
+ this.promise = new C(function ($$resolve, $$reject) {
2721
+ if (resolve !== undefined || reject !== undefined) throw new $TypeError$1('Bad Promise constructor');
2722
+ resolve = $$resolve;
2723
+ reject = $$reject;
2724
+ });
2725
+ this.resolve = aCallable$3(resolve);
2726
+ this.reject = aCallable$3(reject);
2727
+ };
2728
+
2729
+ // `NewPromiseCapability` abstract operation
2730
+ // https://tc39.es/ecma262/#sec-newpromisecapability
2731
+ newPromiseCapability$2.f = function (C) {
2732
+ return new PromiseCapability(C);
2733
+ };
2734
+
2735
+ var $$6 = _export;
2736
+ var IS_NODE = environmentIsNode;
2737
+ var globalThis$2 = globalThis_1;
2738
+ var path = path$1;
2739
+ var call$2 = functionCall;
2740
+ var defineBuiltIn$1 = defineBuiltIn$6;
2741
+ var setPrototypeOf = objectSetPrototypeOf;
2742
+ var setToStringTag$1 = setToStringTag$4;
2743
+ var setSpecies = setSpecies$1;
2744
+ var aCallable$2 = aCallable$c;
2745
+ var isCallable$1 = isCallable$k;
2746
+ var isObject$2 = isObject$b;
2747
+ var anInstance = anInstance$2;
2748
+ var speciesConstructor = speciesConstructor$1;
2749
+ var task = task$1.set;
2750
+ var microtask = microtask_1;
2751
+ var hostReportErrors = hostReportErrors$1;
2752
+ var perform$2 = perform$3;
2753
+ var Queue = queue$1;
2754
+ var InternalStateModule = internalState;
2755
+ var NativePromiseConstructor$2 = promiseNativeConstructor;
2756
+ var PromiseConstructorDetection = promiseConstructorDetection;
2757
+ var newPromiseCapabilityModule$3 = newPromiseCapability$2;
2758
+
2759
+ var PROMISE = 'Promise';
2760
+ var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
2761
+ var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
2762
+ var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
2763
+ var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
2764
+ var setInternalState = InternalStateModule.set;
2765
+ var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
2766
+ var PromiseConstructor = NativePromiseConstructor$2;
2767
+ var PromisePrototype = NativePromisePrototype$1;
2768
+ var TypeError$1 = globalThis$2.TypeError;
2769
+ var document$1 = globalThis$2.document;
2770
+ var process$1 = globalThis$2.process;
2771
+ var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
2772
+ var newGenericPromiseCapability = newPromiseCapability$1;
2773
+
2774
+ var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && globalThis$2.dispatchEvent);
2775
+ var UNHANDLED_REJECTION = 'unhandledrejection';
2776
+ var REJECTION_HANDLED = 'rejectionhandled';
2777
+ var PENDING = 0;
2778
+ var FULFILLED = 1;
2779
+ var REJECTED = 2;
2780
+ var HANDLED = 1;
2781
+ var UNHANDLED = 2;
2782
+
2783
+ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
2784
+
2785
+ // helpers
2786
+ var isThenable = function (it) {
2787
+ var then;
2788
+ return isObject$2(it) && isCallable$1(then = it.then) ? then : false;
2789
+ };
2790
+
2791
+ var callReaction = function (reaction, state) {
2792
+ var value = state.value;
2793
+ var ok = state.state === FULFILLED;
2794
+ var handler = ok ? reaction.ok : reaction.fail;
2795
+ var resolve = reaction.resolve;
2796
+ var reject = reaction.reject;
2797
+ var domain = reaction.domain;
2798
+ var result, then, exited;
2799
+ try {
2800
+ if (handler) {
2801
+ if (!ok) {
2802
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
2803
+ state.rejection = HANDLED;
2804
+ }
2805
+ if (handler === true) result = value;
2806
+ else {
2807
+ if (domain) domain.enter();
2808
+ result = handler(value); // can throw
2809
+ if (domain) {
2810
+ domain.exit();
2811
+ exited = true;
2812
+ }
2813
+ }
2814
+ if (result === reaction.promise) {
2815
+ reject(new TypeError$1('Promise-chain cycle'));
2816
+ } else if (then = isThenable(result)) {
2817
+ call$2(then, result, resolve, reject);
2818
+ } else resolve(result);
2819
+ } else reject(value);
2820
+ } catch (error) {
2821
+ if (domain && !exited) domain.exit();
2822
+ reject(error);
2823
+ }
2824
+ };
2825
+
2826
+ var notify = function (state, isReject) {
2827
+ if (state.notified) return;
2828
+ state.notified = true;
2829
+ microtask(function () {
2830
+ var reactions = state.reactions;
2831
+ var reaction;
2832
+ while (reaction = reactions.get()) {
2833
+ callReaction(reaction, state);
2834
+ }
2835
+ state.notified = false;
2836
+ if (isReject && !state.rejection) onUnhandled(state);
2837
+ });
2838
+ };
2839
+
2840
+ var dispatchEvent = function (name, promise, reason) {
2841
+ var event, handler;
2842
+ if (DISPATCH_EVENT) {
2843
+ event = document$1.createEvent('Event');
2844
+ event.promise = promise;
2845
+ event.reason = reason;
2846
+ event.initEvent(name, false, true);
2847
+ globalThis$2.dispatchEvent(event);
2848
+ } else event = { promise: promise, reason: reason };
2849
+ if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = globalThis$2['on' + name])) handler(event);
2850
+ else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
2851
+ };
2852
+
2853
+ var onUnhandled = function (state) {
2854
+ call$2(task, globalThis$2, function () {
2855
+ var promise = state.facade;
2856
+ var value = state.value;
2857
+ var IS_UNHANDLED = isUnhandled(state);
2858
+ var result;
2859
+ if (IS_UNHANDLED) {
2860
+ result = perform$2(function () {
2861
+ if (IS_NODE) {
2862
+ process$1.emit('unhandledRejection', value, promise);
2863
+ } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
2864
+ });
2865
+ // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
2866
+ state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
2867
+ if (result.error) throw result.value;
2868
+ }
2869
+ });
2870
+ };
2871
+
2872
+ var isUnhandled = function (state) {
2873
+ return state.rejection !== HANDLED && !state.parent;
2874
+ };
2875
+
2876
+ var onHandleUnhandled = function (state) {
2877
+ call$2(task, globalThis$2, function () {
2878
+ var promise = state.facade;
2879
+ if (IS_NODE) {
2880
+ process$1.emit('rejectionHandled', promise);
2881
+ } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
2882
+ });
2883
+ };
2884
+
2885
+ var bind = function (fn, state, unwrap) {
2886
+ return function (value) {
2887
+ fn(state, value, unwrap);
2888
+ };
2889
+ };
2890
+
2891
+ var internalReject = function (state, value, unwrap) {
2892
+ if (state.done) return;
2893
+ state.done = true;
2894
+ if (unwrap) state = unwrap;
2895
+ state.value = value;
2896
+ state.state = REJECTED;
2897
+ notify(state, true);
2898
+ };
2899
+
2900
+ var internalResolve = function (state, value, unwrap) {
2901
+ if (state.done) return;
2902
+ state.done = true;
2903
+ if (unwrap) state = unwrap;
2904
+ try {
2905
+ if (state.facade === value) throw new TypeError$1("Promise can't be resolved itself");
2906
+ var then = isThenable(value);
2907
+ if (then) {
2908
+ microtask(function () {
2909
+ var wrapper = { done: false };
2910
+ try {
2911
+ call$2(then, value,
2912
+ bind(internalResolve, wrapper, state),
2913
+ bind(internalReject, wrapper, state)
2914
+ );
2915
+ } catch (error) {
2916
+ internalReject(wrapper, error, state);
2917
+ }
2918
+ });
2919
+ } else {
2920
+ state.value = value;
2921
+ state.state = FULFILLED;
2922
+ notify(state, false);
2923
+ }
2924
+ } catch (error) {
2925
+ internalReject({ done: false }, error, state);
2926
+ }
2927
+ };
2928
+
2929
+ // constructor polyfill
2930
+ if (FORCED_PROMISE_CONSTRUCTOR$4) {
2931
+ // 25.4.3.1 Promise(executor)
2932
+ PromiseConstructor = function Promise(executor) {
2933
+ anInstance(this, PromisePrototype);
2934
+ aCallable$2(executor);
2935
+ call$2(Internal, this);
2936
+ var state = getInternalPromiseState(this);
2937
+ try {
2938
+ executor(bind(internalResolve, state), bind(internalReject, state));
2939
+ } catch (error) {
2940
+ internalReject(state, error);
2941
+ }
2942
+ };
2943
+
2944
+ PromisePrototype = PromiseConstructor.prototype;
2945
+
2946
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
2947
+ Internal = function Promise(executor) {
2948
+ setInternalState(this, {
2949
+ type: PROMISE,
2950
+ done: false,
2951
+ notified: false,
2952
+ parent: false,
2953
+ reactions: new Queue(),
2954
+ rejection: false,
2955
+ state: PENDING,
2956
+ value: null
2957
+ });
2958
+ };
2959
+
2960
+ // `Promise.prototype.then` method
2961
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
2962
+ Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
2963
+ var state = getInternalPromiseState(this);
2964
+ var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
2965
+ state.parent = true;
2966
+ reaction.ok = isCallable$1(onFulfilled) ? onFulfilled : true;
2967
+ reaction.fail = isCallable$1(onRejected) && onRejected;
2968
+ reaction.domain = IS_NODE ? process$1.domain : undefined;
2969
+ if (state.state === PENDING) state.reactions.add(reaction);
2970
+ else microtask(function () {
2971
+ callReaction(reaction, state);
2972
+ });
2973
+ return reaction.promise;
2974
+ });
2975
+
2976
+ OwnPromiseCapability = function () {
2977
+ var promise = new Internal();
2978
+ var state = getInternalPromiseState(promise);
2979
+ this.promise = promise;
2980
+ this.resolve = bind(internalResolve, state);
2981
+ this.reject = bind(internalReject, state);
2982
+ };
2983
+
2984
+ newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
2985
+ return C === PromiseConstructor || C === PromiseWrapper
2986
+ ? new OwnPromiseCapability(C)
2987
+ : newGenericPromiseCapability(C);
2988
+ };
2989
+
2990
+ if (isCallable$1(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
2991
+ nativeThen = NativePromisePrototype$1.then;
2992
+
2993
+ if (!NATIVE_PROMISE_SUBCLASSING) {
2994
+ // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
2995
+ defineBuiltIn$1(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
2996
+ var that = this;
2997
+ return new PromiseConstructor(function (resolve, reject) {
2998
+ call$2(nativeThen, that, resolve, reject);
2999
+ }).then(onFulfilled, onRejected);
3000
+ // https://github.com/zloirock/core-js/issues/640
3001
+ }, { unsafe: true });
3002
+ }
3003
+
3004
+ // make `.constructor === Promise` work for native promise-based APIs
3005
+ try {
3006
+ delete NativePromisePrototype$1.constructor;
3007
+ } catch (error) { /* empty */ }
3008
+
3009
+ // make `instanceof Promise` work for native promise-based APIs
3010
+ if (setPrototypeOf) {
3011
+ setPrototypeOf(NativePromisePrototype$1, PromisePrototype);
3012
+ }
3013
+ }
3014
+ }
3015
+
3016
+ // `Promise` constructor
3017
+ // https://tc39.es/ecma262/#sec-promise-executor
3018
+ $$6({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
3019
+ Promise: PromiseConstructor
3020
+ });
3021
+
3022
+ PromiseWrapper = path.Promise;
3023
+
3024
+ setToStringTag$1(PromiseConstructor, PROMISE, false);
3025
+ setSpecies(PROMISE);
3026
+
3027
+ var wellKnownSymbol$3 = wellKnownSymbol$i;
3028
+
3029
+ var ITERATOR$1 = wellKnownSymbol$3('iterator');
3030
+ var SAFE_CLOSING = false;
3031
+
3032
+ try {
3033
+ var called = 0;
3034
+ var iteratorWithReturn = {
3035
+ next: function () {
3036
+ return { done: !!called++ };
3037
+ },
3038
+ 'return': function () {
3039
+ SAFE_CLOSING = true;
3040
+ }
3041
+ };
3042
+ iteratorWithReturn[ITERATOR$1] = function () {
3043
+ return this;
3044
+ };
3045
+ // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
3046
+ Array.from(iteratorWithReturn, function () { throw 2; });
3047
+ } catch (error) { /* empty */ }
3048
+
3049
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
3050
+ try {
3051
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
3052
+ } catch (error) { return false; } // workaround of old WebKit + `eval` bug
3053
+ var ITERATION_SUPPORT = false;
3054
+ try {
3055
+ var object = {};
3056
+ object[ITERATOR$1] = function () {
3057
+ return {
3058
+ next: function () {
3059
+ return { done: ITERATION_SUPPORT = true };
3060
+ }
3061
+ };
3062
+ };
3063
+ exec(object);
3064
+ } catch (error) { /* empty */ }
3065
+ return ITERATION_SUPPORT;
3066
+ };
3067
+
3068
+ var NativePromiseConstructor$1 = promiseNativeConstructor;
3069
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
3070
+ var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
3071
+
3072
+ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
3073
+ NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
3074
+ });
3075
+
3076
+ var $$5 = _export;
3077
+ var call$1 = functionCall;
3078
+ var aCallable$1 = aCallable$c;
3079
+ var newPromiseCapabilityModule$2 = newPromiseCapability$2;
3080
+ var perform$1 = perform$3;
3081
+ var iterate$1 = iterate$4;
3082
+ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
3083
+
3084
+ // `Promise.all` method
3085
+ // https://tc39.es/ecma262/#sec-promise.all
3086
+ $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
3087
+ all: function all(iterable) {
3088
+ var C = this;
3089
+ var capability = newPromiseCapabilityModule$2.f(C);
3090
+ var resolve = capability.resolve;
3091
+ var reject = capability.reject;
3092
+ var result = perform$1(function () {
3093
+ var $promiseResolve = aCallable$1(C.resolve);
3094
+ var values = [];
3095
+ var counter = 0;
3096
+ var remaining = 1;
3097
+ iterate$1(iterable, function (promise) {
3098
+ var index = counter++;
3099
+ var alreadyCalled = false;
3100
+ remaining++;
3101
+ call$1($promiseResolve, C, promise).then(function (value) {
3102
+ if (alreadyCalled) return;
3103
+ alreadyCalled = true;
3104
+ values[index] = value;
3105
+ --remaining || resolve(values);
3106
+ }, reject);
3107
+ });
3108
+ --remaining || resolve(values);
3109
+ });
3110
+ if (result.error) reject(result.value);
3111
+ return capability.promise;
3112
+ }
3113
+ });
3114
+
3115
+ var $$4 = _export;
3116
+ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
3117
+ var NativePromiseConstructor = promiseNativeConstructor;
3118
+ var getBuiltIn$1 = getBuiltIn$7;
3119
+ var isCallable = isCallable$k;
3120
+ var defineBuiltIn = defineBuiltIn$6;
3121
+
3122
+ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
3123
+
3124
+ // `Promise.prototype.catch` method
3125
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
3126
+ $$4({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
3127
+ 'catch': function (onRejected) {
3128
+ return this.then(undefined, onRejected);
3129
+ }
3130
+ });
3131
+
3132
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
3133
+ if (isCallable(NativePromiseConstructor)) {
3134
+ var method = getBuiltIn$1('Promise').prototype['catch'];
3135
+ if (NativePromisePrototype['catch'] !== method) {
3136
+ defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
3137
+ }
3138
+ }
3139
+
3140
+ var $$3 = _export;
3141
+ var call = functionCall;
3142
+ var aCallable = aCallable$c;
3143
+ var newPromiseCapabilityModule$1 = newPromiseCapability$2;
3144
+ var perform = perform$3;
3145
+ var iterate = iterate$4;
3146
+ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
3147
+
3148
+ // `Promise.race` method
3149
+ // https://tc39.es/ecma262/#sec-promise.race
3150
+ $$3({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
3151
+ race: function race(iterable) {
3152
+ var C = this;
3153
+ var capability = newPromiseCapabilityModule$1.f(C);
3154
+ var reject = capability.reject;
3155
+ var result = perform(function () {
3156
+ var $promiseResolve = aCallable(C.resolve);
3157
+ iterate(iterable, function (promise) {
3158
+ call($promiseResolve, C, promise).then(capability.resolve, reject);
3159
+ });
3160
+ });
3161
+ if (result.error) reject(result.value);
3162
+ return capability.promise;
3163
+ }
3164
+ });
3165
+
3166
+ var $$2 = _export;
3167
+ var newPromiseCapabilityModule = newPromiseCapability$2;
3168
+ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
3169
+
3170
+ // `Promise.reject` method
3171
+ // https://tc39.es/ecma262/#sec-promise.reject
3172
+ $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
3173
+ reject: function reject(r) {
3174
+ var capability = newPromiseCapabilityModule.f(this);
3175
+ var capabilityReject = capability.reject;
3176
+ capabilityReject(r);
3177
+ return capability.promise;
3178
+ }
3179
+ });
3180
+
3181
+ var anObject = anObject$e;
3182
+ var isObject$1 = isObject$b;
3183
+ var newPromiseCapability = newPromiseCapability$2;
3184
+
3185
+ var promiseResolve$1 = function (C, x) {
3186
+ anObject(C);
3187
+ if (isObject$1(x) && x.constructor === C) return x;
3188
+ var promiseCapability = newPromiseCapability.f(C);
3189
+ var resolve = promiseCapability.resolve;
3190
+ resolve(x);
3191
+ return promiseCapability.promise;
3192
+ };
3193
+
3194
+ var $$1 = _export;
3195
+ var getBuiltIn = getBuiltIn$7;
3196
+ var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
3197
+ var promiseResolve = promiseResolve$1;
3198
+
3199
+ getBuiltIn('Promise');
3200
+
3201
+ // `Promise.resolve` method
3202
+ // https://tc39.es/ecma262/#sec-promise.resolve
3203
+ $$1({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
3204
+ resolve: function resolve(x) {
3205
+ return promiseResolve(this, x);
3206
+ }
3207
+ });
3208
+
3209
+ var isObject = isObject$b;
3210
+ var classof$1 = classofRaw$2;
3211
+ var wellKnownSymbol$2 = wellKnownSymbol$i;
3212
+
3213
+ var MATCH$1 = wellKnownSymbol$2('match');
3214
+
3215
+ // `IsRegExp` abstract operation
3216
+ // https://tc39.es/ecma262/#sec-isregexp
3217
+ var isRegexp = function (it) {
3218
+ var isRegExp;
3219
+ return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$1(it) === 'RegExp');
3220
+ };
3221
+
3222
+ var isRegExp = isRegexp;
3223
+
3224
+ var $TypeError = TypeError;
3225
+
3226
+ var notARegexp = function (it) {
3227
+ if (isRegExp(it)) {
3228
+ throw new $TypeError("The method doesn't accept regular expressions");
3229
+ } return it;
3230
+ };
3231
+
3232
+ var classof = classof$4;
3233
+
3234
+ var $String = String;
3235
+
3236
+ var toString$1 = function (argument) {
3237
+ if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
3238
+ return $String(argument);
3239
+ };
3240
+
3241
+ var wellKnownSymbol$1 = wellKnownSymbol$i;
3242
+
3243
+ var MATCH = wellKnownSymbol$1('match');
3244
+
3245
+ var correctIsRegexpLogic = function (METHOD_NAME) {
3246
+ var regexp = /./;
3247
+ try {
3248
+ '/./'[METHOD_NAME](regexp);
3249
+ } catch (error1) {
3250
+ try {
3251
+ regexp[MATCH] = false;
3252
+ return '/./'[METHOD_NAME](regexp);
3253
+ } catch (error2) { /* empty */ }
3254
+ } return false;
3255
+ };
3256
+
3257
+ var $ = _export;
3258
+ var uncurryThis = functionUncurryThis;
3259
+ var notARegExp = notARegexp;
3260
+ var requireObjectCoercible = requireObjectCoercible$4;
3261
+ var toString = toString$1;
3262
+ var correctIsRegExpLogic = correctIsRegexpLogic;
3263
+
3264
+ var stringIndexOf = uncurryThis(''.indexOf);
3265
+
3266
+ // `String.prototype.includes` method
3267
+ // https://tc39.es/ecma262/#sec-string.prototype.includes
3268
+ $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
3269
+ includes: function includes(searchString /* , position = 0 */) {
3270
+ return !!~stringIndexOf(
3271
+ toString(requireObjectCoercible(this)),
3272
+ toString(notARegExp(searchString)),
3273
+ arguments.length > 1 ? arguments[1] : undefined
3274
+ );
3275
+ }
3276
+ });
3277
+
3278
+ // iterable DOM collections
3279
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
3280
+ var domIterables = {
3281
+ CSSRuleList: 0,
3282
+ CSSStyleDeclaration: 0,
3283
+ CSSValueList: 0,
3284
+ ClientRectList: 0,
3285
+ DOMRectList: 0,
3286
+ DOMStringList: 0,
3287
+ DOMTokenList: 1,
3288
+ DataTransferItemList: 0,
3289
+ FileList: 0,
3290
+ HTMLAllCollection: 0,
3291
+ HTMLCollection: 0,
3292
+ HTMLFormElement: 0,
3293
+ HTMLSelectElement: 0,
3294
+ MediaList: 0,
3295
+ MimeTypeArray: 0,
3296
+ NamedNodeMap: 0,
3297
+ NodeList: 1,
3298
+ PaintRequestList: 0,
3299
+ Plugin: 0,
3300
+ PluginArray: 0,
3301
+ SVGLengthList: 0,
3302
+ SVGNumberList: 0,
3303
+ SVGPathSegList: 0,
3304
+ SVGPointList: 0,
3305
+ SVGStringList: 0,
3306
+ SVGTransformList: 0,
3307
+ SourceBufferList: 0,
3308
+ StyleSheetList: 0,
3309
+ TextTrackCueList: 0,
3310
+ TextTrackList: 0,
3311
+ TouchList: 0
3312
+ };
3313
+
3314
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
3315
+ var documentCreateElement = documentCreateElement$2;
3316
+
3317
+ var classList = documentCreateElement('span').classList;
3318
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
3319
+
3320
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
3321
+
3322
+ var globalThis$1 = globalThis_1;
3323
+ var DOMIterables = domIterables;
3324
+ var DOMTokenListPrototype = domTokenListPrototype;
3325
+ var ArrayIteratorMethods = es_array_iterator;
3326
+ var createNonEnumerableProperty = createNonEnumerableProperty$5;
3327
+ var setToStringTag = setToStringTag$4;
3328
+ var wellKnownSymbol = wellKnownSymbol$i;
3329
+
3330
+ var ITERATOR = wellKnownSymbol('iterator');
3331
+ var ArrayValues = ArrayIteratorMethods.values;
3332
+
3333
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
3334
+ if (CollectionPrototype) {
3335
+ // some Chrome versions have non-configurable methods on DOMTokenList
3336
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
3337
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
3338
+ } catch (error) {
3339
+ CollectionPrototype[ITERATOR] = ArrayValues;
3340
+ }
3341
+ setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
3342
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
3343
+ // some Chrome versions have non-configurable methods on DOMTokenList
3344
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
3345
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
3346
+ } catch (error) {
3347
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
3348
+ }
3349
+ }
3350
+ }
3351
+ };
3352
+
3353
+ for (var COLLECTION_NAME in DOMIterables) {
3354
+ handlePrototype(globalThis$1[COLLECTION_NAME] && globalThis$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
3355
+ }
3356
+
3357
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
3358
+
3359
+ /**
3360
+ * State of an asynchronous call. Network state follows the state diagram given below.
3361
+ *
3362
+ *
3363
+ * <pre>
3364
+ * ┌──────┐
3365
+ * ┌─────────────► Init ◄────────────┐
3366
+ * │ └▲────┬┘ │
3367
+ * │ │ │ │
3368
+ * │ Reset Execute │
3369
+ * Reset │ │ Reset
3370
+ * │ ┌──┴────┴──┐ │
3371
+ * │ ┌────► Pending ◄────┐ │
3372
+ * │ │ └──┬────┬──┘ │ │
3373
+ * │ Execute │ │ Execute │
3374
+ * │ │ │ │ │ │
3375
+ * │ │ OnSuccess OnError │ │
3376
+ * │ ┌────┴──┐ │ │ ┌──┴───┐ │
3377
+ * └─┤Success◄────┘ └────►Error ├─┘
3378
+ * └───────┘ └──────┘
3379
+ *
3380
+ * </pre>
3381
+ */
3382
+
3383
+ /**
3384
+ * Network call is not yet started
3385
+ */
3386
+
3387
+ /**
3388
+ * Checks whether the state is init state
3389
+ * @param state
3390
+ */
3391
+ function isInit(state) {
3392
+ return state.state === 'init';
3393
+ }
3394
+
3395
+ /**
3396
+ * Initializes a new state.
3397
+ *
3398
+ * @template T The type of the state.
3399
+ * @return {InitState<T>} An object representing the initial state.
3400
+ */
3401
+ function init() {
3402
+ return {
3403
+ state: 'init'
3404
+ };
3405
+ }
3406
+
3407
+ /**
3408
+ * Network call is not yet completed
3409
+ */
3410
+
3411
+ /**
3412
+ * Interface representing progress information for an upload or download operation.
3413
+ *
3414
+ * @typedef {object} Progress
3415
+ *
3416
+ * @property {'upload' | 'download'} type - The type of the operation.
3417
+ *
3418
+ * @property {number} loaded - The amount of data that has been loaded so far.
3419
+ *
3420
+ * @property {number} [total] - The total amount of data to be loaded (if known).
3421
+ */
3422
+
3423
+ /**
3424
+ * Checks whether the state is pending state
3425
+ * @param state
3426
+ */
3427
+ function isPending(state) {
3428
+ return state.state === 'pending';
3429
+ }
3430
+
3431
+ /**
3432
+ * Generates a PendingState object with a state of "pending".
3433
+ *
3434
+ * @return {PendingState<T>} An object representing the pending state.
3435
+ */
3436
+ function pending(progress = undefined) {
3437
+ return {
3438
+ state: 'pending',
3439
+ progress
3440
+ };
3441
+ }
3442
+
3443
+ /**
3444
+ * Network call is completed with success state
3445
+ */
3446
+
3447
+ /**
3448
+ * Checks whether the state is success response
3449
+ * @param state
3450
+ */
3451
+ function isSuccess(state) {
3452
+ return state.state === 'success';
3453
+ }
3454
+
3455
+ /**
3456
+ * Creates a success state object with the provided data.
3457
+ *
3458
+ * @param {T} data - The data to be included in the success state.
3459
+ * @return {SuccessState<T>} An object representing a success state containing the provided data.
3460
+ */
3461
+ function success(data) {
3462
+ return {
3463
+ state: 'success',
3464
+ data
3465
+ };
3466
+ }
3467
+
3468
+ /**
3469
+ * Network call is completed with error response
3470
+ */
3471
+
3472
+ /**
3473
+ * Checks whether the state is error state
3474
+ * @param state
3475
+ */
3476
+ function isError(state) {
3477
+ return state.state === 'error';
3478
+ }
3479
+
3480
+ /**
3481
+ * Constructs an ErrorState object representing an error.
3482
+ *
3483
+ * @param {any} error - The error object or message.
3484
+ * @param {string} [statusCode] - An optional status code associated with the error.
3485
+ * @return {ErrorState<T>} An object representing the error state.
3486
+ */
3487
+ function error(error, statusCode, request) {
3488
+ return {
3489
+ state: 'error',
3490
+ error,
3491
+ statusCode,
3492
+ request
3493
+ };
3494
+ }
3495
+
3496
+ /**
3497
+ * Represents an error state with additional contextual information.
3498
+ *
3499
+ * @typedef {Object} ErrorWithContext
3500
+ * @template T
3501
+ * @extends ErrorState<T>
3502
+ *
3503
+ * @property {string} source - The origin of the error.
3504
+ * @property {string} operation - The operation being performed when the error occurred.
3505
+ * @property {string} key - A unique key identifying the specific error instance.
3506
+ */
3507
+
3508
+ /**
3509
+ * Represents an action in the network context.
3510
+ *
3511
+ * @template T - The type of data associated with the network action
3512
+ *
3513
+ * @property {NetworkState<any>} state - The current state of the network action
3514
+ * @property {string} key - The unique identifier for the network action
3515
+ */
3516
+
3517
+ /**
3518
+ * Represents the dispatch state of a process.
3519
+ *
3520
+ * @template T The type of the state information.
3521
+ * @interface
3522
+ *
3523
+ * @property {string} state The current state of the dispatch process.
3524
+ */
3525
+
3526
+ /**
3527
+ * Represents a successful dispatch state.
3528
+ *
3529
+ * @template T - Type of the data associated with the dispatch.
3530
+ *
3531
+ * @extends DispatchState<T>
3532
+ *
3533
+ * @property {string} state - The state of the dispatch, always 'success'.
3534
+ */
3535
+
3536
+ /**
3537
+ * Indicates a successful dispatch state.
3538
+ *
3539
+ * @return {DispatchState<T>} An object representing a successful state.
3540
+ */
3541
+ function successfulDispatch() {
3542
+ return {
3543
+ state: 'success'
3544
+ };
3545
+ }
3546
+
3547
+ /**
3548
+ * Determines if the provided dispatch state represents a successful dispatch.
3549
+ *
3550
+ * @param {DispatchState<T>} value - The dispatch state to check.
3551
+ * @return {value is SuccessfulDispatch<T>} - True if the dispatch state indicates success, false otherwise.
3552
+ */
3553
+ function isSuccessfulDispatch(value) {
3554
+ return value.state === 'success';
3555
+ }
3556
+
3557
+ /**
3558
+ * ValidationError interface represents a specific type of dispatch state
3559
+ * where a validation error has occurred.
3560
+ *
3561
+ * @typeparam T - The type of the data associated with this dispatch state.
3562
+ */
3563
+
3564
+ /**
3565
+ * Generates a ValidationError object.
3566
+ *
3567
+ * @param error The error details that caused the validation to fail.
3568
+ * @return The ValidationError object containing the error state and details.
3569
+ */
3570
+ function validationError(error) {
3571
+ return {
3572
+ state: 'validation-error',
3573
+ error
3574
+ };
3575
+ }
3576
+
3577
+ /**
3578
+ * Determines if a provided DispatchState object is a ValidationError.
3579
+ *
3580
+ * @param {DispatchState<T>} value - The DispatchState object to evaluate.
3581
+ * @return {boolean} - Returns true if the provided DispatchState object is a ValidationError, otherwise returns false.
3582
+ */
3583
+ function isValidationError(value) {
3584
+ return value.state === 'validation-error';
3585
+ }
3586
+
3587
+ /**
3588
+ * Represents an error structure with a specified type and associated data.
3589
+ *
3590
+ * @template T - The type of the data associated with the error.
3591
+ * @template E - The type of the error detail.
3592
+ *
3593
+ * @property {string} type - A string representing the type of the error.
3594
+ */
3595
+
3596
+ /**
3597
+ * Represents an error encountered during a network operation.
3598
+ * Extends from the `IntrigError` interface, adding network-specific properties.
3599
+ *
3600
+ * @template T - The type of the intrinsic data associated with the error.
3601
+ * @template E - The type of the error details, defaulting to `unknown`.
3602
+ *
3603
+ * @property {string} type - A constant property representing the error type, always set to 'network'.
3604
+ * @property {string} statusCode - A string representation of the HTTP status code associated with the error, indicating the nature of the network failure.
3605
+ * @property {E} error - The detailed error information specific to the failure, type extends from the generic E, allowing flexibility in the error details.
3606
+ * @property {any} request - The request object that was attempted when the network error occurred, providing context for what operation failed.
3607
+ */
3608
+
3609
+ /**
3610
+ * Constructs a network error object.
3611
+ *
3612
+ * @param error The error object corresponding to the network request.
3613
+ * @param statusCode A string representing the HTTP status code returned.
3614
+ * @param request The request object associated with the network operation.
3615
+ * @return A NetworkError object containing the error type, status code, error details, and the original request.
3616
+ */
3617
+ function networkError(error, statusCode, request) {
3618
+ return {
3619
+ type: 'network',
3620
+ statusCode,
3621
+ error,
3622
+ request
3623
+ };
3624
+ }
3625
+
3626
+ /**
3627
+ * Determines if the provided IntrigError is of type 'network'.
3628
+ *
3629
+ * @param {IntrigError<T, E>} value - The error value to check the type of.
3630
+ * @return {boolean} - Returns true if the error is of type 'network', otherwise false.
3631
+ */
3632
+ function isNetworkError(value) {
3633
+ return value.type === 'network';
3634
+ }
3635
+
3636
+ /**
3637
+ * Interface representing a request validation error.
3638
+ *
3639
+ * This error occurs when a validation process on a request fails. It extends the IntrigError interface
3640
+ * by adding specific properties related to request validation.
3641
+ *
3642
+ * @template T - The type of the data associated with the error.
3643
+ * @template E - The optional type of additional error information. Defaults to unknown.
3644
+ *
3645
+ * @extends IntrigError<T, E>
3646
+ *
3647
+ * @property {string} type - A string literal indicating the error type as 'request-validation'.
3648
+ * @property {ZodError} error - An instance of ZodError containing detailed validation error information.
3649
+ */
3650
+
3651
+ /**
3652
+ * Constructs a RequestValidationError object encapsulating the ZodError.
3653
+ *
3654
+ * @param {ZodError} error - The error object resulting from Zod schema validation.
3655
+ * @return {RequestValidationError<T, E>} A RequestValidationError object containing the validation error information.
3656
+ */
3657
+ function requestValidationError(error) {
3658
+ return {
3659
+ type: 'request-validation',
3660
+ error
3661
+ };
3662
+ }
3663
+
3664
+ /**
3665
+ * Determines if a given error is of type RequestValidationError.
3666
+ *
3667
+ * @param value The error object to check, which implements the IntrigError interface.
3668
+ * @return A boolean indicating whether the error is a RequestValidationError.
3669
+ */
3670
+ function isRequestValidationError(value) {
3671
+ return value.type === 'request-validation';
3672
+ }
3673
+
3674
+ /**
3675
+ * ResponseValidationError interface is designed to extend the capabilities of the IntrigError interface,
3676
+ * specifically for handling errors related to response validation.
3677
+ *
3678
+ * @template T - Represents the type of the data or payload associated with the error.
3679
+ * @template E - Represents the type of any additional error information. Defaults to unknown.
3680
+ *
3681
+ * @extends IntrigError
3682
+ *
3683
+ * @property type - A string literal that identifies the type of error as 'response-validation'.
3684
+ * @property error - An instance of ZodError representing the validation error encountered.
3685
+ */
3686
+
3687
+ /**
3688
+ * Constructs a ResponseValidationError object with a specified error.
3689
+ *
3690
+ * @param {ZodError} error - The validation error encountered during response validation.
3691
+ * @return {ResponseValidationError<T, E>} An error object containing the type of error and the validation error details.
3692
+ */
3693
+ function responseValidationError(error) {
3694
+ return {
3695
+ type: 'response-validation',
3696
+ error
3697
+ };
3698
+ }
3699
+
3700
+ /**
3701
+ * Determines if the given error is a response validation error.
3702
+ *
3703
+ * @param {IntrigError<T, E>} value - The error object to assess.
3704
+ * @return {boolean} True if the error is a response validation error, otherwise false.
3705
+ */
3706
+ function isResponseValidationError(value) {
3707
+ return value.type === 'response-validation';
3708
+ }
3709
+
3710
+ // Set the default logging level (can be overridden via environment variables)
3711
+ log.setLevel(process.env.LOG_LEVEL || 'error');
3712
+ const logWrapper = {
3713
+ info: (msg, meta) => meta ? log.info(msg, meta) : log.info(msg),
3714
+ warn: (msg, meta) => meta ? log.warn(msg, meta) : log.warn(msg),
3715
+ error: (msg, meta) => meta ? log.error(msg, meta) : log.error(msg),
3716
+ debug: (msg, meta) => meta ? log.debug(msg, meta) : log.debug(msg)
3717
+ };
3718
+
3719
+ /**
3720
+ * Defines the ContextType interface for managing global state, dispatching actions,
3721
+ * and holding a collection of Axios instances.
3722
+ *
3723
+ * @interface ContextType
3724
+ * @property {GlobalState} state - The global state of the application.
3725
+ * @property {React.Dispatch<NetworkAction<unknown>>} dispatch - The dispatch function to send network actions.
3726
+ * @property {Record<string, AxiosInstance>} axios - A record of Axios instances for making HTTP requests.
3727
+ */
3728
+
3729
+ /**
3730
+ * Context object created using `createContext` function. Provides a way to share state, dispatch functions,
3731
+ * and axios instance across components without having to pass props down manually at every level.
3732
+ *
3733
+ * @type {ContextType}
3734
+ */
3735
+ const Context = /*#__PURE__*/createContext({
3736
+ state: {},
3737
+ filteredState: {},
3738
+ dispatch() {
3739
+ // intentionally kept empty
3740
+ },
3741
+ configs: {},
3742
+ async execute() {
3743
+ // intentionally kept empty
3744
+ }
3745
+ });
3746
+ function useIntrigContext() {
3747
+ return useContext(Context);
3748
+ }
3749
+
3750
+ var _jsxFileName$1 = "/home/tiran-intrigsoft/IdeaProjects/intrig-core/lib/next-client/src/intrig-provider.tsx";
3751
+ function requestReducer(state, action) {
3752
+ return Object.assign({}, state, {
3753
+ [`${action.source}:${action.operation}:${action.key}`]: action.state
3754
+ });
3755
+ }
3756
+ /**
3757
+ * IntrigProvider is a context provider component that sets up global state management
3758
+ * and provides Axios instances for API requests.
3759
+ *
3760
+ * @param {Object} props - The properties object.
3761
+ * @param {React.ReactNode} props.children - The child components to be wrapped by the provider.
3762
+ * @param {Object} [props.configs={}] - Configuration object for Axios instances.
3763
+ * @param {Object} [props.configs.defaults={}] - Default configuration for Axios.
3764
+ * @param {Object} [props.configs.petstore={}] - Configuration specific to the petstore API.
3765
+ * @return {JSX.Element} A context provider component that wraps the provided children.
3766
+ */
3767
+ function IntrigProvider({
3768
+ children,
3769
+ configs = {},
3770
+ initState = {}
3771
+ }) {
3772
+ const [state, dispatch] = useReducer(requestReducer, initState);
3773
+ const axiosInstance = useMemo(() => {
3774
+ return axios.create(Object.assign({}, configs != null ? configs : {}));
3775
+ }, [configs]);
3776
+ const contextValue = useMemo(() => {
3777
+ async function execute(request, dispatch, schema, errorSchema) {
3778
+ try {
3779
+ dispatch(pending());
3780
+ const response = await axiosInstance.request(request);
3781
+ if (response.status >= 200 && response.status < 300) {
3782
+ if (schema) {
3783
+ const data = schema.safeParse(response.data);
3784
+ if (!data.success) {
3785
+ dispatch(error(data.error.issues, response.status, request));
3786
+ return;
3787
+ }
3788
+ dispatch(success(data.data));
3789
+ } else {
3790
+ dispatch(success(response.data));
3791
+ }
3792
+ } else {
3793
+ var _errorSchema$safePars, _response$data, _ref;
3794
+ const {
3795
+ data
3796
+ } = (_errorSchema$safePars = errorSchema == null ? void 0 : errorSchema.safeParse((_response$data = response.data) != null ? _response$data : {})) != null ? _errorSchema$safePars : {};
3797
+ //todo: handle error validation error.
3798
+ dispatch(error((_ref = data != null ? data : response.data) != null ? _ref : response.statusText, response.status));
3799
+ }
3800
+ } catch (e) {
3801
+ if (isAxiosError(e)) {
3802
+ var _errorSchema$safePars2, _e$response$data, _e$response, _e$response2, _e$response3;
3803
+ const {
3804
+ data
3805
+ } = (_errorSchema$safePars2 = errorSchema == null ? void 0 : errorSchema.safeParse((_e$response$data = (_e$response = e.response) == null ? void 0 : _e$response.data) != null ? _e$response$data : {})) != null ? _errorSchema$safePars2 : {};
3806
+ dispatch(error(data != null ? data : (_e$response2 = e.response) == null ? void 0 : _e$response2.data, (_e$response3 = e.response) == null ? void 0 : _e$response3.status, request));
3807
+ } else {
3808
+ dispatch(error(e));
3809
+ }
3810
+ }
3811
+ }
3812
+ return {
3813
+ state,
3814
+ dispatch,
3815
+ filteredState: state,
3816
+ configs,
3817
+ execute
3818
+ };
3819
+ }, [state, axiosInstance]);
3820
+ return /*#__PURE__*/jsxDEV(Context.Provider, {
3821
+ value: contextValue,
3822
+ children: children
3823
+ }, void 0, false, {
3824
+ fileName: _jsxFileName$1,
3825
+ lineNumber: 141,
3826
+ columnNumber: 10
3827
+ }, this);
3828
+ }
3829
+ function IntrigProviderStub({
3830
+ children,
3831
+ configs = {},
3832
+ stubs = () => {
3833
+ // intentionally kept empty
3834
+ }
3835
+ }) {
3836
+ const [state, dispatch] = useReducer(requestReducer, {});
3837
+ const collectedStubs = useMemo(() => {
3838
+ const fns = {};
3839
+ function stub(hook, fn) {
3840
+ fns[hook.key] = fn;
3841
+ }
3842
+ stubs(stub);
3843
+ return fns;
3844
+ }, [stubs]);
3845
+ const contextValue = useMemo(() => {
3846
+ async function execute(request, dispatch, schema) {
3847
+ const stub = collectedStubs[request.key];
3848
+ if (stub) {
3849
+ try {
3850
+ await stub(request.params, request.data, dispatch);
3851
+ } catch (e) {
3852
+ dispatch(error(e));
3853
+ }
3854
+ } else {
3855
+ dispatch(init());
3856
+ }
3857
+ }
3858
+ return {
3859
+ state,
3860
+ dispatch,
3861
+ filteredState: state,
3862
+ configs,
3863
+ execute
3864
+ };
3865
+ }, [state, dispatch, configs, collectedStubs]);
3866
+ return /*#__PURE__*/jsxDEV(Context.Provider, {
3867
+ value: contextValue,
3868
+ children: children
3869
+ }, void 0, false, {
3870
+ fileName: _jsxFileName$1,
3871
+ lineNumber: 225,
3872
+ columnNumber: 10
3873
+ }, this);
3874
+ }
3875
+ /**
3876
+ * StatusTrap component is used to track and manage network request states.
3877
+ *
3878
+ * @param {Object} props - The properties object.
3879
+ * @param {React.ReactNode} props.children - The child elements to be rendered.
3880
+ * @param {string} props.type - The type of network state to handle ("error", "pending", "pending + error").
3881
+ * @param {boolean} [props.propagate=true] - Whether to propagate the event to the parent context.
3882
+ * @return {React.ReactElement} The context provider component with filtered state and custom dispatch.
3883
+ */
3884
+ function StatusTrap({
3885
+ children,
3886
+ type,
3887
+ propagate = true
3888
+ }) {
3889
+ const ctx = useContext(Context);
3890
+ const [requests, setRequests] = useState([]);
3891
+ const shouldHandleEvent = useCallback(state => {
3892
+ switch (type) {
3893
+ case 'error':
3894
+ return isError(state);
3895
+ case 'pending':
3896
+ return isPending(state);
3897
+ case 'pending + error':
3898
+ return isPending(state) || isError(state);
3899
+ default:
3900
+ return false;
3901
+ }
3902
+ }, [type]);
3903
+ const dispatch = useCallback(event => {
3904
+ if (!event.handled) {
3905
+ if (shouldHandleEvent(event.state)) {
3906
+ setRequests(prev => [...prev, event.key]);
3907
+ if (!propagate) {
3908
+ ctx.dispatch(Object.assign({}, event, {
3909
+ handled: true
3910
+ }));
3911
+ return;
3912
+ }
3913
+ } else {
3914
+ setRequests(prev => prev.filter(k => k !== event.key));
3915
+ }
3916
+ }
3917
+ ctx.dispatch(event);
3918
+ }, [ctx, propagate, shouldHandleEvent]);
3919
+ const filteredState = useMemo(() => {
3920
+ return Object.fromEntries(Object.entries(ctx.state).filter(([key]) => requests.includes(key)));
3921
+ }, [ctx.state, requests]);
3922
+ return /*#__PURE__*/jsxDEV(Context.Provider, {
3923
+ value: Object.assign({}, ctx, {
3924
+ dispatch,
3925
+ filteredState
3926
+ }),
3927
+ children: children
3928
+ }, void 0, false, {
3929
+ fileName: _jsxFileName$1,
3930
+ lineNumber: 295,
3931
+ columnNumber: 5
3932
+ }, this);
3933
+ }
3934
+ /**
3935
+ * useNetworkState is a custom hook that manages the network state within the specified context.
3936
+ * It handles making network requests, dispatching appropriate states based on the request lifecycle,
3937
+ * and allows aborting ongoing requests.
3938
+ *
3939
+ * @param {Object} params - The parameters required to configure and use the network state.
3940
+ * @param {string} params.key - A unique identifier for the network request.
3941
+ * @param {string} params.operation - The operation type related to the request.
3942
+ * @param {string} params.source - The source or endpoint for the network request.
3943
+ * @param {Object} params.schema - The schema used for validating the response data.
3944
+ * @param {number} [params.debounceDelay] - The debounce delay for executing the network request.
3945
+ *
3946
+ * @return {[NetworkState<T>, (request: AxiosRequestConfig) => void, () => void]}
3947
+ * Returns a state object representing the current network state,
3948
+ * a function to execute the network request, and a function to clear the request.
3949
+ */
3950
+ function useNetworkState({
3951
+ key,
3952
+ operation,
3953
+ source,
3954
+ schema,
3955
+ errorSchema,
3956
+ debounceDelay: requestDebounceDelay
3957
+ }) {
3958
+ var _context$state3;
3959
+ const context = useContext(Context);
3960
+ const [abortController, setAbortController] = useState();
3961
+ const networkState = useMemo(() => {
3962
+ var _context$state, _ref2, _context$state2;
3963
+ logWrapper.info(`Updating status ${key} ${operation} ${source}`);
3964
+ logWrapper.debug('⇦', (_context$state = context.state) == null ? void 0 : _context$state[`${source}:${operation}:${key}`]);
3965
+ return (_ref2 = (_context$state2 = context.state) == null ? void 0 : _context$state2[`${source}:${operation}:${key}`]) != null ? _ref2 : init();
3966
+ }, [(_context$state3 = context.state) == null ? void 0 : _context$state3[`${source}:${operation}:${key}`]]);
3967
+ const dispatch = useCallback(state => {
3968
+ context.dispatch({
3969
+ key,
3970
+ operation,
3971
+ source,
3972
+ state
3973
+ });
3974
+ }, [key, operation, source, context.dispatch]);
3975
+ const debounceDelay = useMemo(() => {
3976
+ var _ref3, _context$configs;
3977
+ return (_ref3 = requestDebounceDelay != null ? requestDebounceDelay : (_context$configs = context.configs) == null ? void 0 : _context$configs.debounceDelay) != null ? _ref3 : 0;
3978
+ }, [context.configs, requestDebounceDelay]);
3979
+ const execute = useCallback(async request => {
3980
+ logWrapper.info(`Executing request ${key} ${operation} ${source}`);
3981
+ logWrapper.debug('⇨', request);
3982
+ const abortController = new AbortController();
3983
+ setAbortController(abortController);
3984
+ const requestConfig = Object.assign({}, request, {
3985
+ onUploadProgress(event) {
3986
+ dispatch(pending({
3987
+ type: 'upload',
3988
+ loaded: event.loaded,
3989
+ total: event.total
3990
+ }));
3991
+ request.onUploadProgress == null || request.onUploadProgress(event);
3992
+ },
3993
+ onDownloadProgress(event) {
3994
+ dispatch(pending({
3995
+ type: 'download',
3996
+ loaded: event.loaded,
3997
+ total: event.total
3998
+ }));
3999
+ request.onDownloadProgress == null || request.onDownloadProgress(event);
4000
+ },
4001
+ signal: abortController.signal
4002
+ });
4003
+ await context.execute(requestConfig, dispatch, schema, errorSchema);
4004
+ }, [networkState, context.dispatch, axios]);
4005
+ const deboundedExecute = useMemo(() => debounce(execute, debounceDelay != null ? debounceDelay : 0), [execute]);
4006
+ const clear = useCallback(() => {
4007
+ logWrapper.info(`Clearing request ${key} ${operation} ${source}`);
4008
+ dispatch(init());
4009
+ setAbortController(abortController => {
4010
+ logWrapper.info(`Aborting request ${key} ${operation} ${source}`);
4011
+ abortController == null || abortController.abort();
4012
+ return undefined;
4013
+ });
4014
+ }, [dispatch, abortController]);
4015
+ return [networkState, deboundedExecute, clear, dispatch];
4016
+ }
4017
+ function debounce(func, delay) {
4018
+ let timeoutId;
4019
+ return (...args) => {
4020
+ if (timeoutId) {
4021
+ clearTimeout(timeoutId);
4022
+ }
4023
+ timeoutId = setTimeout(() => {
4024
+ func(...args);
4025
+ }, delay);
4026
+ };
4027
+ }
4028
+
4029
+ /**
4030
+ * Handles central error extraction from the provided context.
4031
+ * It filters the state to retain error states and maps them to a structured error object with additional context information.
4032
+ * @return {Object[]} An array of objects representing the error states with context information such as source, operation, and key.
4033
+ */
4034
+ function useCentralError() {
4035
+ const ctx = useContext(Context);
4036
+ return useMemo(() => {
4037
+ return Object.entries(ctx.filteredState).filter(([, state]) => isError(state)).map(([k, state]) => {
4038
+ const [source, operation, key] = k.split(':');
4039
+ return Object.assign({}, state, {
4040
+ source,
4041
+ operation,
4042
+ key
4043
+ });
4044
+ });
4045
+ }, [ctx.filteredState]);
4046
+ }
4047
+
4048
+ /**
4049
+ * Uses central pending state handling by aggregating pending states from context.
4050
+ * It calculates the overall progress of pending states if any, or returns an initial state otherwise.
4051
+ *
4052
+ * @return {NetworkState} The aggregated network state based on the pending states and their progress.
4053
+ */
4054
+ function useCentralPendingState() {
4055
+ const ctx = useContext(Context);
4056
+ const result = useMemo(() => {
4057
+ const pendingStates = Object.values(ctx.filteredState).filter(isPending);
4058
+ if (!pendingStates.length) {
4059
+ return init();
4060
+ }
4061
+ const progress = pendingStates.filter(a => a.progress).reduce((progress, current) => {
4062
+ var _current$progress$tot, _current$progress, _current$progress$loa, _current$progress2;
4063
+ return {
4064
+ total: progress.total + ((_current$progress$tot = (_current$progress = current.progress) == null ? void 0 : _current$progress.total) != null ? _current$progress$tot : 0),
4065
+ loaded: progress.loaded + ((_current$progress$loa = (_current$progress2 = current.progress) == null ? void 0 : _current$progress2.loaded) != null ? _current$progress$loa : 0)
4066
+ };
4067
+ }, {
4068
+ total: 0,
4069
+ loaded: 0
4070
+ });
4071
+ return pending(progress.total ? progress : undefined);
4072
+ }, [ctx.filteredState]);
4073
+ return result;
4074
+ }
4075
+
4076
+ var _jsxFileName = "/home/tiran-intrigsoft/IdeaProjects/intrig-core/lib/next-client/src/intrig-layout.tsx";
4077
+ async function IntrigLayout({
4078
+ children,
4079
+ configs
4080
+ }) {
4081
+ const headersData = await headers();
4082
+ const hydratedResponsesStr = headersData.get('INTRIG_HYDRATED');
4083
+ const hydratedResponses = hydratedResponsesStr ? JSON.parse(hydratedResponsesStr) : {};
4084
+ headersData.delete('INTRIG_HYDRATED');
4085
+ return /*#__PURE__*/jsxDEV(Fragment, {
4086
+ children: /*#__PURE__*/jsxDEV(IntrigProvider, {
4087
+ configs: configs,
4088
+ initState: hydratedResponses,
4089
+ children: children
4090
+ }, void 0, false, {
4091
+ fileName: _jsxFileName,
4092
+ lineNumber: 23,
4093
+ columnNumber: 7
4094
+ }, this)
4095
+ }, void 0, false);
4096
+ }
4097
+
4098
+ /**
4099
+ * Converts a given hook into a promise-based function.
4100
+ *
4101
+ * @param {IntrigHook<P, B, T>} hook - The hook function to be converted.
4102
+ * @param options
4103
+ *
4104
+ * @return {[(...params: Parameters<ReturnType<IntrigHook<P, B, T>>[1]>) => Promise<T>, () => void]}
4105
+ * Returns a tuple containing a function that invokes the hook as a promise and a function to clear the state.
4106
+ */
4107
+
4108
+ // **Implementation**
4109
+ function useAsPromise(hook, options) {
4110
+ // <- Compatible return type
4111
+ const resolveRef = useRef(() => {
4112
+ // intentionally kept empty
4113
+ });
4114
+ const rejectRef = useRef(() => {
4115
+ // intentionally kept empty
4116
+ });
4117
+ const [state, dispatch, clear] = hook(options);
4118
+ useEffect(() => {
4119
+ if (isSuccess(state)) {
4120
+ resolveRef.current == null || resolveRef.current(state.data);
4121
+ clear();
4122
+ } else if (isError(state)) {
4123
+ rejectRef.current == null || rejectRef.current(state.error);
4124
+ clear();
4125
+ }
4126
+ }, [state]);
4127
+ const promiseFn = useCallback((...args) => {
4128
+ return new Promise((resolve, reject) => {
4129
+ resolveRef.current = resolve;
4130
+ rejectRef.current = reject;
4131
+ const dispatchState = dispatch(...args);
4132
+ if (isValidationError(dispatchState)) {
4133
+ reject(dispatchState.error);
4134
+ }
4135
+ });
4136
+ }, [dispatch]);
4137
+ return [promiseFn, clear];
4138
+ }
4139
+
4140
+ /**
4141
+ * A custom hook that manages and returns the network state of a promise-based function,
4142
+ * providing a way to execute the function and clear its state.
4143
+ *
4144
+ * @param fn The promise-based function whose network state is to be managed. It should be a function that returns a promise.
4145
+ * @param key An optional identifier for the network state. Defaults to 'default'.
4146
+ * @return A tuple containing the current network state, a function to execute the promise, and a function to clear the state.
4147
+ */
4148
+ function useAsNetworkState(fn, key = 'default') {
4149
+ var _context$state3;
4150
+ const id = useId();
4151
+ const context = useIntrigContext();
4152
+ const networkState = useMemo(() => {
4153
+ var _context$state, _context$state2;
4154
+ return (_context$state = (_context$state2 = context.state) == null ? void 0 : _context$state2[`promiseState:${id}:${key}`]) != null ? _context$state : init();
4155
+ }, [(_context$state3 = context.state) == null ? void 0 : _context$state3[`promiseState:${id}:${key}`]]);
4156
+ const dispatch = useCallback(state => {
4157
+ context.dispatch({
4158
+ key,
4159
+ operation: id,
4160
+ source: 'promiseState',
4161
+ state
4162
+ });
4163
+ }, [key, context.dispatch]);
4164
+ const execute = useCallback((...args) => {
4165
+ dispatch(pending());
4166
+ return fn(...args).then(data => {
4167
+ dispatch(success(data));
4168
+ }, e => {
4169
+ dispatch(error(e));
4170
+ });
4171
+ }, []);
4172
+ const clear = useCallback(() => {
4173
+ dispatch(init());
4174
+ }, []);
4175
+ return [networkState, execute, clear];
4176
+ }
4177
+
4178
+ /**
4179
+ * A custom hook that resolves the value from the provided hook's state and updates it whenever the state changes.
4180
+ *
4181
+ * @param {IntrigHook<P, B, T>} hook - The hook that provides the state to observe and resolve data from.
4182
+ * @param options
4183
+ * @return {T | undefined} The resolved value from the hook's state or undefined if the state is not successful.
4184
+ */
4185
+
4186
+ // **Implementation**
4187
+ function useResolvedValue(hook, options) {
4188
+ const [value, setValue] = useState();
4189
+ const [state] = hook(options); // Ensure compatibility with different hook types
4190
+
4191
+ useEffect(() => {
4192
+ if (isSuccess(state)) {
4193
+ setValue(state.data);
4194
+ } else {
4195
+ setValue(undefined);
4196
+ }
4197
+ }, [state]);
4198
+ return value;
4199
+ }
4200
+
4201
+ /**
4202
+ * A custom hook that resolves and caches the value from a successful state provided by the given hook.
4203
+ * The state is updated only when it is in a successful state.
4204
+ *
4205
+ * @param {IntrigHook<P, B, T>} hook - The hook that provides the state to observe and cache data from.
4206
+ * @param options
4207
+ * @return {T | undefined} The cached value from the hook's state or undefined if the state is not successful.
4208
+ */
4209
+
4210
+ // **Implementation**
4211
+ function useResolvedCachedValue(hook, options) {
4212
+ const [cachedValue, setCachedValue] = useState();
4213
+ const [state] = hook(options); // Ensure compatibility with different hook types
4214
+
4215
+ useEffect(() => {
4216
+ if (isSuccess(state)) {
4217
+ setCachedValue(state.data);
4218
+ }
4219
+ // Do not clear cached value if state is unsuccessful
4220
+ }, [state]);
4221
+ return cachedValue;
4222
+ }
4223
+
4224
+ export { IntrigLayout, IntrigProvider, IntrigProviderStub, StatusTrap, error, init, isError, isInit, isNetworkError, isPending, isRequestValidationError, isResponseValidationError, isSuccess, isSuccessfulDispatch, isValidationError, networkError, pending, requestValidationError, responseValidationError, success, successfulDispatch, useAsNetworkState, useAsPromise, useCentralError, useCentralPendingState, useNetworkState, useResolvedCachedValue, useResolvedValue, validationError };