@intrig/react 0.0.15-27 → 0.0.15-29

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