@zahlen/checkout-react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js ADDED
@@ -0,0 +1,3592 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { createContext, useState, useEffect, useCallback, useMemo, useContext, useRef } from 'react';
3
+ import { Zahlen } from '@zahlen/checkout';
4
+ export { Zahlen, formatAmount, getCurrencySymbol } from '@zahlen/checkout';
5
+
6
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
7
+
8
+ var check = function (it) {
9
+ return it && it.Math === Math && it;
10
+ };
11
+
12
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
13
+ var globalThis_1 =
14
+ // eslint-disable-next-line es/no-global-this -- safe
15
+ check(typeof globalThis == 'object' && globalThis) ||
16
+ check(typeof window == 'object' && window) ||
17
+ // eslint-disable-next-line no-restricted-globals -- safe
18
+ check(typeof self == 'object' && self) ||
19
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
20
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
21
+ // eslint-disable-next-line no-new-func -- fallback
22
+ (function () { return this; })() || Function('return this')();
23
+
24
+ var objectGetOwnPropertyDescriptor = {};
25
+
26
+ var fails$g = function (exec) {
27
+ try {
28
+ return !!exec();
29
+ } catch (error) {
30
+ return true;
31
+ }
32
+ };
33
+
34
+ var fails$f = fails$g;
35
+
36
+ // Detect IE8's incomplete defineProperty implementation
37
+ var descriptors = !fails$f(function () {
38
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
39
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
40
+ });
41
+
42
+ var fails$e = fails$g;
43
+
44
+ var functionBindNative = !fails$e(function () {
45
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
46
+ var test = (function () { /* empty */ }).bind();
47
+ // eslint-disable-next-line no-prototype-builtins -- safe
48
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
49
+ });
50
+
51
+ var NATIVE_BIND$3 = functionBindNative;
52
+
53
+ var call$d = Function.prototype.call;
54
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
55
+ var functionCall = NATIVE_BIND$3 ? call$d.bind(call$d) : function () {
56
+ return call$d.apply(call$d, arguments);
57
+ };
58
+
59
+ var objectPropertyIsEnumerable = {};
60
+
61
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
62
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
63
+ var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
64
+
65
+ // Nashorn ~ JDK8 bug
66
+ var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
67
+
68
+ // `Object.prototype.propertyIsEnumerable` method implementation
69
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
70
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
71
+ var descriptor = getOwnPropertyDescriptor$2(this, V);
72
+ return !!descriptor && descriptor.enumerable;
73
+ } : $propertyIsEnumerable;
74
+
75
+ var createPropertyDescriptor$4 = function (bitmap, value) {
76
+ return {
77
+ enumerable: !(bitmap & 1),
78
+ configurable: !(bitmap & 2),
79
+ writable: !(bitmap & 4),
80
+ value: value
81
+ };
82
+ };
83
+
84
+ var NATIVE_BIND$2 = functionBindNative;
85
+
86
+ var FunctionPrototype$2 = Function.prototype;
87
+ var call$c = FunctionPrototype$2.call;
88
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
89
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$c, call$c);
90
+
91
+ var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
92
+ return function () {
93
+ return call$c.apply(fn, arguments);
94
+ };
95
+ };
96
+
97
+ var uncurryThis$j = functionUncurryThis;
98
+
99
+ var toString$6 = uncurryThis$j({}.toString);
100
+ var stringSlice$3 = uncurryThis$j(''.slice);
101
+
102
+ var classofRaw$2 = function (it) {
103
+ return stringSlice$3(toString$6(it), 8, -1);
104
+ };
105
+
106
+ var uncurryThis$i = functionUncurryThis;
107
+ var fails$d = fails$g;
108
+ var classof$5 = classofRaw$2;
109
+
110
+ var $Object$4 = Object;
111
+ var split = uncurryThis$i(''.split);
112
+
113
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
114
+ var indexedObject = fails$d(function () {
115
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
116
+ // eslint-disable-next-line no-prototype-builtins -- safe
117
+ return !$Object$4('z').propertyIsEnumerable(0);
118
+ }) ? function (it) {
119
+ return classof$5(it) === 'String' ? split(it, '') : $Object$4(it);
120
+ } : $Object$4;
121
+
122
+ // we can't use just `it == null` since of `document.all` special case
123
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
124
+ var isNullOrUndefined$4 = function (it) {
125
+ return it === null || it === undefined;
126
+ };
127
+
128
+ var isNullOrUndefined$3 = isNullOrUndefined$4;
129
+
130
+ var $TypeError$c = TypeError;
131
+
132
+ // `RequireObjectCoercible` abstract operation
133
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
134
+ var requireObjectCoercible$5 = function (it) {
135
+ if (isNullOrUndefined$3(it)) throw new $TypeError$c("Can't call method on " + it);
136
+ return it;
137
+ };
138
+
139
+ // toObject with fallback for non-array-like ES3 strings
140
+ var IndexedObject$1 = indexedObject;
141
+ var requireObjectCoercible$4 = requireObjectCoercible$5;
142
+
143
+ var toIndexedObject$5 = function (it) {
144
+ return IndexedObject$1(requireObjectCoercible$4(it));
145
+ };
146
+
147
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
148
+ var documentAll = typeof document == 'object' && document.all;
149
+
150
+ // `IsCallable` abstract operation
151
+ // https://tc39.es/ecma262/#sec-iscallable
152
+ // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
153
+ var isCallable$l = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
154
+ return typeof argument == 'function' || argument === documentAll;
155
+ } : function (argument) {
156
+ return typeof argument == 'function';
157
+ };
158
+
159
+ var isCallable$k = isCallable$l;
160
+
161
+ var isObject$c = function (it) {
162
+ return typeof it == 'object' ? it !== null : isCallable$k(it);
163
+ };
164
+
165
+ var globalThis$m = globalThis_1;
166
+ var isCallable$j = isCallable$l;
167
+
168
+ var aFunction = function (argument) {
169
+ return isCallable$j(argument) ? argument : undefined;
170
+ };
171
+
172
+ var getBuiltIn$8 = function (namespace, method) {
173
+ return arguments.length < 2 ? aFunction(globalThis$m[namespace]) : globalThis$m[namespace] && globalThis$m[namespace][method];
174
+ };
175
+
176
+ var uncurryThis$h = functionUncurryThis;
177
+
178
+ var objectIsPrototypeOf = uncurryThis$h({}.isPrototypeOf);
179
+
180
+ var globalThis$l = globalThis_1;
181
+
182
+ var navigator = globalThis$l.navigator;
183
+ var userAgent$5 = navigator && navigator.userAgent;
184
+
185
+ var environmentUserAgent = userAgent$5 ? String(userAgent$5) : '';
186
+
187
+ var globalThis$k = globalThis_1;
188
+ var userAgent$4 = environmentUserAgent;
189
+
190
+ var process$3 = globalThis$k.process;
191
+ var Deno$1 = globalThis$k.Deno;
192
+ var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
193
+ var v8 = versions && versions.v8;
194
+ var match, version;
195
+
196
+ if (v8) {
197
+ match = v8.split('.');
198
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
199
+ // but their correct versions are not interesting for us
200
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
201
+ }
202
+
203
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
204
+ // so check `userAgent` even if `.v8` exists, but 0
205
+ if (!version && userAgent$4) {
206
+ match = userAgent$4.match(/Edge\/(\d+)/);
207
+ if (!match || match[1] >= 74) {
208
+ match = userAgent$4.match(/Chrome\/(\d+)/);
209
+ if (match) version = +match[1];
210
+ }
211
+ }
212
+
213
+ var environmentV8Version = version;
214
+
215
+ /* eslint-disable es/no-symbol -- required for testing */
216
+ var V8_VERSION$1 = environmentV8Version;
217
+ var fails$c = fails$g;
218
+ var globalThis$j = globalThis_1;
219
+
220
+ var $String$6 = globalThis$j.String;
221
+
222
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
223
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$c(function () {
224
+ var symbol = Symbol('symbol detection');
225
+ // Chrome 38 Symbol has incorrect toString conversion
226
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
227
+ // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
228
+ // of course, fail.
229
+ return !$String$6(symbol) || !(Object(symbol) instanceof Symbol) ||
230
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
231
+ !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
232
+ });
233
+
234
+ /* eslint-disable es/no-symbol -- required for testing */
235
+ var NATIVE_SYMBOL$2 = symbolConstructorDetection;
236
+
237
+ var useSymbolAsUid = NATIVE_SYMBOL$2 &&
238
+ !Symbol.sham &&
239
+ typeof Symbol.iterator == 'symbol';
240
+
241
+ var getBuiltIn$7 = getBuiltIn$8;
242
+ var isCallable$i = isCallable$l;
243
+ var isPrototypeOf$4 = objectIsPrototypeOf;
244
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
245
+
246
+ var $Object$3 = Object;
247
+
248
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
249
+ return typeof it == 'symbol';
250
+ } : function (it) {
251
+ var $Symbol = getBuiltIn$7('Symbol');
252
+ return isCallable$i($Symbol) && isPrototypeOf$4($Symbol.prototype, $Object$3(it));
253
+ };
254
+
255
+ var $String$5 = String;
256
+
257
+ var tryToString$4 = function (argument) {
258
+ try {
259
+ return $String$5(argument);
260
+ } catch (error) {
261
+ return 'Object';
262
+ }
263
+ };
264
+
265
+ var isCallable$h = isCallable$l;
266
+ var tryToString$3 = tryToString$4;
267
+
268
+ var $TypeError$b = TypeError;
269
+
270
+ // `Assert: IsCallable(argument) is true`
271
+ var aCallable$8 = function (argument) {
272
+ if (isCallable$h(argument)) return argument;
273
+ throw new $TypeError$b(tryToString$3(argument) + ' is not a function');
274
+ };
275
+
276
+ var aCallable$7 = aCallable$8;
277
+ var isNullOrUndefined$2 = isNullOrUndefined$4;
278
+
279
+ // `GetMethod` abstract operation
280
+ // https://tc39.es/ecma262/#sec-getmethod
281
+ var getMethod$3 = function (V, P) {
282
+ var func = V[P];
283
+ return isNullOrUndefined$2(func) ? undefined : aCallable$7(func);
284
+ };
285
+
286
+ var call$b = functionCall;
287
+ var isCallable$g = isCallable$l;
288
+ var isObject$b = isObject$c;
289
+
290
+ var $TypeError$a = TypeError;
291
+
292
+ // `OrdinaryToPrimitive` abstract operation
293
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
294
+ var ordinaryToPrimitive$1 = function (input, pref) {
295
+ var fn, val;
296
+ if (pref === 'string' && isCallable$g(fn = input.toString) && !isObject$b(val = call$b(fn, input))) return val;
297
+ if (isCallable$g(fn = input.valueOf) && !isObject$b(val = call$b(fn, input))) return val;
298
+ if (pref !== 'string' && isCallable$g(fn = input.toString) && !isObject$b(val = call$b(fn, input))) return val;
299
+ throw new $TypeError$a("Can't convert object to primitive value");
300
+ };
301
+
302
+ var sharedStore = {exports: {}};
303
+
304
+ var globalThis$i = globalThis_1;
305
+
306
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
307
+ var defineProperty$7 = Object.defineProperty;
308
+
309
+ var defineGlobalProperty$3 = function (key, value) {
310
+ try {
311
+ defineProperty$7(globalThis$i, key, { value: value, configurable: true, writable: true });
312
+ } catch (error) {
313
+ globalThis$i[key] = value;
314
+ } return value;
315
+ };
316
+
317
+ var globalThis$h = globalThis_1;
318
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
319
+
320
+ var SHARED = '__core-js_shared__';
321
+ var store$3 = sharedStore.exports = globalThis$h[SHARED] || defineGlobalProperty$2(SHARED, {});
322
+
323
+ (store$3.versions || (store$3.versions = [])).push({
324
+ version: '3.47.0',
325
+ mode: 'global',
326
+ copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)',
327
+ license: 'https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE',
328
+ source: 'https://github.com/zloirock/core-js'
329
+ });
330
+
331
+ var sharedStoreExports = sharedStore.exports;
332
+
333
+ var store$2 = sharedStoreExports;
334
+
335
+ var shared$3 = function (key, value) {
336
+ return store$2[key] || (store$2[key] = value || {});
337
+ };
338
+
339
+ var requireObjectCoercible$3 = requireObjectCoercible$5;
340
+
341
+ var $Object$2 = Object;
342
+
343
+ // `ToObject` abstract operation
344
+ // https://tc39.es/ecma262/#sec-toobject
345
+ var toObject$3 = function (argument) {
346
+ return $Object$2(requireObjectCoercible$3(argument));
347
+ };
348
+
349
+ var uncurryThis$g = functionUncurryThis;
350
+ var toObject$2 = toObject$3;
351
+
352
+ var hasOwnProperty = uncurryThis$g({}.hasOwnProperty);
353
+
354
+ // `HasOwnProperty` abstract operation
355
+ // https://tc39.es/ecma262/#sec-hasownproperty
356
+ // eslint-disable-next-line es/no-object-hasown -- safe
357
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
358
+ return hasOwnProperty(toObject$2(it), key);
359
+ };
360
+
361
+ var uncurryThis$f = functionUncurryThis;
362
+
363
+ var id = 0;
364
+ var postfix = Math.random();
365
+ var toString$5 = uncurryThis$f(1.1.toString);
366
+
367
+ var uid$2 = function (key) {
368
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$5(++id + postfix, 36);
369
+ };
370
+
371
+ var globalThis$g = globalThis_1;
372
+ var shared$2 = shared$3;
373
+ var hasOwn$b = hasOwnProperty_1;
374
+ var uid$1 = uid$2;
375
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
376
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
377
+
378
+ var Symbol$1 = globalThis$g.Symbol;
379
+ var WellKnownSymbolsStore = shared$2('wks');
380
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
381
+
382
+ var wellKnownSymbol$e = function (name) {
383
+ if (!hasOwn$b(WellKnownSymbolsStore, name)) {
384
+ WellKnownSymbolsStore[name] = NATIVE_SYMBOL$1 && hasOwn$b(Symbol$1, name)
385
+ ? Symbol$1[name]
386
+ : createWellKnownSymbol('Symbol.' + name);
387
+ } return WellKnownSymbolsStore[name];
388
+ };
389
+
390
+ var call$a = functionCall;
391
+ var isObject$a = isObject$c;
392
+ var isSymbol$1 = isSymbol$2;
393
+ var getMethod$2 = getMethod$3;
394
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
395
+ var wellKnownSymbol$d = wellKnownSymbol$e;
396
+
397
+ var $TypeError$9 = TypeError;
398
+ var TO_PRIMITIVE = wellKnownSymbol$d('toPrimitive');
399
+
400
+ // `ToPrimitive` abstract operation
401
+ // https://tc39.es/ecma262/#sec-toprimitive
402
+ var toPrimitive$1 = function (input, pref) {
403
+ if (!isObject$a(input) || isSymbol$1(input)) return input;
404
+ var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
405
+ var result;
406
+ if (exoticToPrim) {
407
+ if (pref === undefined) pref = 'default';
408
+ result = call$a(exoticToPrim, input, pref);
409
+ if (!isObject$a(result) || isSymbol$1(result)) return result;
410
+ throw new $TypeError$9("Can't convert object to primitive value");
411
+ }
412
+ if (pref === undefined) pref = 'number';
413
+ return ordinaryToPrimitive(input, pref);
414
+ };
415
+
416
+ var toPrimitive = toPrimitive$1;
417
+ var isSymbol = isSymbol$2;
418
+
419
+ // `ToPropertyKey` abstract operation
420
+ // https://tc39.es/ecma262/#sec-topropertykey
421
+ var toPropertyKey$2 = function (argument) {
422
+ var key = toPrimitive(argument, 'string');
423
+ return isSymbol(key) ? key : key + '';
424
+ };
425
+
426
+ var globalThis$f = globalThis_1;
427
+ var isObject$9 = isObject$c;
428
+
429
+ var document$3 = globalThis$f.document;
430
+ // typeof document.createElement is 'object' in old IE
431
+ var EXISTS$1 = isObject$9(document$3) && isObject$9(document$3.createElement);
432
+
433
+ var documentCreateElement$2 = function (it) {
434
+ return EXISTS$1 ? document$3.createElement(it) : {};
435
+ };
436
+
437
+ var DESCRIPTORS$d = descriptors;
438
+ var fails$b = fails$g;
439
+ var createElement$1 = documentCreateElement$2;
440
+
441
+ // Thanks to IE8 for its funny defineProperty
442
+ var ie8DomDefine = !DESCRIPTORS$d && !fails$b(function () {
443
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
444
+ return Object.defineProperty(createElement$1('div'), 'a', {
445
+ get: function () { return 7; }
446
+ }).a !== 7;
447
+ });
448
+
449
+ var DESCRIPTORS$c = descriptors;
450
+ var call$9 = functionCall;
451
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
452
+ var createPropertyDescriptor$3 = createPropertyDescriptor$4;
453
+ var toIndexedObject$4 = toIndexedObject$5;
454
+ var toPropertyKey$1 = toPropertyKey$2;
455
+ var hasOwn$a = hasOwnProperty_1;
456
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
457
+
458
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
459
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
460
+
461
+ // `Object.getOwnPropertyDescriptor` method
462
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
463
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$c ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
464
+ O = toIndexedObject$4(O);
465
+ P = toPropertyKey$1(P);
466
+ if (IE8_DOM_DEFINE$1) try {
467
+ return $getOwnPropertyDescriptor$1(O, P);
468
+ } catch (error) { /* empty */ }
469
+ if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$9(propertyIsEnumerableModule$1.f, O, P), O[P]);
470
+ };
471
+
472
+ var objectDefineProperty = {};
473
+
474
+ var DESCRIPTORS$b = descriptors;
475
+ var fails$a = fails$g;
476
+
477
+ // V8 ~ Chrome 36-
478
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
479
+ var v8PrototypeDefineBug = DESCRIPTORS$b && fails$a(function () {
480
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
481
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
482
+ value: 42,
483
+ writable: false
484
+ }).prototype !== 42;
485
+ });
486
+
487
+ var isObject$8 = isObject$c;
488
+
489
+ var $String$4 = String;
490
+ var $TypeError$8 = TypeError;
491
+
492
+ // `Assert: Type(argument) is Object`
493
+ var anObject$9 = function (argument) {
494
+ if (isObject$8(argument)) return argument;
495
+ throw new $TypeError$8($String$4(argument) + ' is not an object');
496
+ };
497
+
498
+ var DESCRIPTORS$a = descriptors;
499
+ var IE8_DOM_DEFINE = ie8DomDefine;
500
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
501
+ var anObject$8 = anObject$9;
502
+ var toPropertyKey = toPropertyKey$2;
503
+
504
+ var $TypeError$7 = TypeError;
505
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
506
+ var $defineProperty = Object.defineProperty;
507
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
508
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
509
+ var ENUMERABLE = 'enumerable';
510
+ var CONFIGURABLE$1 = 'configurable';
511
+ var WRITABLE = 'writable';
512
+
513
+ // `Object.defineProperty` method
514
+ // https://tc39.es/ecma262/#sec-object.defineproperty
515
+ objectDefineProperty.f = DESCRIPTORS$a ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
516
+ anObject$8(O);
517
+ P = toPropertyKey(P);
518
+ anObject$8(Attributes);
519
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
520
+ var current = $getOwnPropertyDescriptor(O, P);
521
+ if (current && current[WRITABLE]) {
522
+ O[P] = Attributes.value;
523
+ Attributes = {
524
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
525
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
526
+ writable: false
527
+ };
528
+ }
529
+ } return $defineProperty(O, P, Attributes);
530
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
531
+ anObject$8(O);
532
+ P = toPropertyKey(P);
533
+ anObject$8(Attributes);
534
+ if (IE8_DOM_DEFINE) try {
535
+ return $defineProperty(O, P, Attributes);
536
+ } catch (error) { /* empty */ }
537
+ if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$7('Accessors not supported');
538
+ if ('value' in Attributes) O[P] = Attributes.value;
539
+ return O;
540
+ };
541
+
542
+ var DESCRIPTORS$9 = descriptors;
543
+ var definePropertyModule$3 = objectDefineProperty;
544
+ var createPropertyDescriptor$2 = createPropertyDescriptor$4;
545
+
546
+ var createNonEnumerableProperty$7 = DESCRIPTORS$9 ? function (object, key, value) {
547
+ return definePropertyModule$3.f(object, key, createPropertyDescriptor$2(1, value));
548
+ } : function (object, key, value) {
549
+ object[key] = value;
550
+ return object;
551
+ };
552
+
553
+ var makeBuiltIn$3 = {exports: {}};
554
+
555
+ var DESCRIPTORS$8 = descriptors;
556
+ var hasOwn$9 = hasOwnProperty_1;
557
+
558
+ var FunctionPrototype$1 = Function.prototype;
559
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
560
+ var getDescriptor = DESCRIPTORS$8 && Object.getOwnPropertyDescriptor;
561
+
562
+ var EXISTS = hasOwn$9(FunctionPrototype$1, 'name');
563
+ // additional protection from minified / mangled / dropped function names
564
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
565
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$8 || (DESCRIPTORS$8 && getDescriptor(FunctionPrototype$1, 'name').configurable));
566
+
567
+ var functionName = {
568
+ PROPER: PROPER,
569
+ CONFIGURABLE: CONFIGURABLE
570
+ };
571
+
572
+ var uncurryThis$e = functionUncurryThis;
573
+ var isCallable$f = isCallable$l;
574
+ var store$1 = sharedStoreExports;
575
+
576
+ var functionToString = uncurryThis$e(Function.toString);
577
+
578
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
579
+ if (!isCallable$f(store$1.inspectSource)) {
580
+ store$1.inspectSource = function (it) {
581
+ return functionToString(it);
582
+ };
583
+ }
584
+
585
+ var inspectSource$3 = store$1.inspectSource;
586
+
587
+ var globalThis$e = globalThis_1;
588
+ var isCallable$e = isCallable$l;
589
+
590
+ var WeakMap$1 = globalThis$e.WeakMap;
591
+
592
+ var weakMapBasicDetection = isCallable$e(WeakMap$1) && /native code/.test(String(WeakMap$1));
593
+
594
+ var shared$1 = shared$3;
595
+ var uid = uid$2;
596
+
597
+ var keys = shared$1('keys');
598
+
599
+ var sharedKey$3 = function (key) {
600
+ return keys[key] || (keys[key] = uid(key));
601
+ };
602
+
603
+ var hiddenKeys$4 = {};
604
+
605
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
606
+ var globalThis$d = globalThis_1;
607
+ var isObject$7 = isObject$c;
608
+ var createNonEnumerableProperty$6 = createNonEnumerableProperty$7;
609
+ var hasOwn$8 = hasOwnProperty_1;
610
+ var shared = sharedStoreExports;
611
+ var sharedKey$2 = sharedKey$3;
612
+ var hiddenKeys$3 = hiddenKeys$4;
613
+
614
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
615
+ var TypeError$2 = globalThis$d.TypeError;
616
+ var WeakMap = globalThis$d.WeakMap;
617
+ var set$1, get, has;
618
+
619
+ var enforce = function (it) {
620
+ return has(it) ? get(it) : set$1(it, {});
621
+ };
622
+
623
+ var getterFor = function (TYPE) {
624
+ return function (it) {
625
+ var state;
626
+ if (!isObject$7(it) || (state = get(it)).type !== TYPE) {
627
+ throw new TypeError$2('Incompatible receiver, ' + TYPE + ' required');
628
+ } return state;
629
+ };
630
+ };
631
+
632
+ if (NATIVE_WEAK_MAP || shared.state) {
633
+ var store = shared.state || (shared.state = new WeakMap());
634
+ /* eslint-disable no-self-assign -- prototype methods protection */
635
+ store.get = store.get;
636
+ store.has = store.has;
637
+ store.set = store.set;
638
+ /* eslint-enable no-self-assign -- prototype methods protection */
639
+ set$1 = function (it, metadata) {
640
+ if (store.has(it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
641
+ metadata.facade = it;
642
+ store.set(it, metadata);
643
+ return metadata;
644
+ };
645
+ get = function (it) {
646
+ return store.get(it) || {};
647
+ };
648
+ has = function (it) {
649
+ return store.has(it);
650
+ };
651
+ } else {
652
+ var STATE = sharedKey$2('state');
653
+ hiddenKeys$3[STATE] = true;
654
+ set$1 = function (it, metadata) {
655
+ if (hasOwn$8(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
656
+ metadata.facade = it;
657
+ createNonEnumerableProperty$6(it, STATE, metadata);
658
+ return metadata;
659
+ };
660
+ get = function (it) {
661
+ return hasOwn$8(it, STATE) ? it[STATE] : {};
662
+ };
663
+ has = function (it) {
664
+ return hasOwn$8(it, STATE);
665
+ };
666
+ }
667
+
668
+ var internalState = {
669
+ set: set$1,
670
+ get: get,
671
+ has: has,
672
+ enforce: enforce,
673
+ getterFor: getterFor
674
+ };
675
+
676
+ var uncurryThis$d = functionUncurryThis;
677
+ var fails$9 = fails$g;
678
+ var isCallable$d = isCallable$l;
679
+ var hasOwn$7 = hasOwnProperty_1;
680
+ var DESCRIPTORS$7 = descriptors;
681
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
682
+ var inspectSource$2 = inspectSource$3;
683
+ var InternalStateModule$2 = internalState;
684
+
685
+ var enforceInternalState = InternalStateModule$2.enforce;
686
+ var getInternalState$1 = InternalStateModule$2.get;
687
+ var $String$3 = String;
688
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
689
+ var defineProperty$6 = Object.defineProperty;
690
+ var stringSlice$2 = uncurryThis$d(''.slice);
691
+ var replace$3 = uncurryThis$d(''.replace);
692
+ var join = uncurryThis$d([].join);
693
+
694
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$7 && !fails$9(function () {
695
+ return defineProperty$6(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
696
+ });
697
+
698
+ var TEMPLATE = String(String).split('String');
699
+
700
+ var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
701
+ if (stringSlice$2($String$3(name), 0, 7) === 'Symbol(') {
702
+ name = '[' + replace$3($String$3(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
703
+ }
704
+ if (options && options.getter) name = 'get ' + name;
705
+ if (options && options.setter) name = 'set ' + name;
706
+ if (!hasOwn$7(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
707
+ if (DESCRIPTORS$7) defineProperty$6(value, 'name', { value: name, configurable: true });
708
+ else value.name = name;
709
+ }
710
+ if (CONFIGURABLE_LENGTH && options && hasOwn$7(options, 'arity') && value.length !== options.arity) {
711
+ defineProperty$6(value, 'length', { value: options.arity });
712
+ }
713
+ try {
714
+ if (options && hasOwn$7(options, 'constructor') && options.constructor) {
715
+ if (DESCRIPTORS$7) defineProperty$6(value, 'prototype', { writable: false });
716
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
717
+ } else if (value.prototype) value.prototype = undefined;
718
+ } catch (error) { /* empty */ }
719
+ var state = enforceInternalState(value);
720
+ if (!hasOwn$7(state, 'source')) {
721
+ state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
722
+ } return value;
723
+ };
724
+
725
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
726
+ // eslint-disable-next-line no-extend-native -- required
727
+ Function.prototype.toString = makeBuiltIn$2(function toString() {
728
+ return isCallable$d(this) && getInternalState$1(this).source || inspectSource$2(this);
729
+ }, 'toString');
730
+
731
+ var makeBuiltInExports = makeBuiltIn$3.exports;
732
+
733
+ var isCallable$c = isCallable$l;
734
+ var definePropertyModule$2 = objectDefineProperty;
735
+ var makeBuiltIn$1 = makeBuiltInExports;
736
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
737
+
738
+ var defineBuiltIn$5 = function (O, key, value, options) {
739
+ if (!options) options = {};
740
+ var simple = options.enumerable;
741
+ var name = options.name !== undefined ? options.name : key;
742
+ if (isCallable$c(value)) makeBuiltIn$1(value, name, options);
743
+ if (options.global) {
744
+ if (simple) O[key] = value;
745
+ else defineGlobalProperty$1(key, value);
746
+ } else {
747
+ try {
748
+ if (!options.unsafe) delete O[key];
749
+ else if (O[key]) simple = true;
750
+ } catch (error) { /* empty */ }
751
+ if (simple) O[key] = value;
752
+ else definePropertyModule$2.f(O, key, {
753
+ value: value,
754
+ enumerable: false,
755
+ configurable: !options.nonConfigurable,
756
+ writable: !options.nonWritable
757
+ });
758
+ } return O;
759
+ };
760
+
761
+ var objectGetOwnPropertyNames = {};
762
+
763
+ var ceil = Math.ceil;
764
+ var floor$1 = Math.floor;
765
+
766
+ // `Math.trunc` method
767
+ // https://tc39.es/ecma262/#sec-math.trunc
768
+ // eslint-disable-next-line es/no-math-trunc -- safe
769
+ var mathTrunc = Math.trunc || function trunc(x) {
770
+ var n = +x;
771
+ return (n > 0 ? floor$1 : ceil)(n);
772
+ };
773
+
774
+ var trunc = mathTrunc;
775
+
776
+ // `ToIntegerOrInfinity` abstract operation
777
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
778
+ var toIntegerOrInfinity$4 = function (argument) {
779
+ var number = +argument;
780
+ // eslint-disable-next-line no-self-compare -- NaN check
781
+ return number !== number || number === 0 ? 0 : trunc(number);
782
+ };
783
+
784
+ var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
785
+
786
+ var max = Math.max;
787
+ var min$1 = Math.min;
788
+
789
+ // Helper for a popular repeating case of the spec:
790
+ // Let integer be ? ToInteger(index).
791
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
792
+ var toAbsoluteIndex$1 = function (index, length) {
793
+ var integer = toIntegerOrInfinity$3(index);
794
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
795
+ };
796
+
797
+ var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
798
+
799
+ var min = Math.min;
800
+
801
+ // `ToLength` abstract operation
802
+ // https://tc39.es/ecma262/#sec-tolength
803
+ var toLength$1 = function (argument) {
804
+ var len = toIntegerOrInfinity$2(argument);
805
+ return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
806
+ };
807
+
808
+ var toLength = toLength$1;
809
+
810
+ // `LengthOfArrayLike` abstract operation
811
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
812
+ var lengthOfArrayLike$2 = function (obj) {
813
+ return toLength(obj.length);
814
+ };
815
+
816
+ var toIndexedObject$3 = toIndexedObject$5;
817
+ var toAbsoluteIndex = toAbsoluteIndex$1;
818
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
819
+
820
+ // `Array.prototype.{ indexOf, includes }` methods implementation
821
+ var createMethod$1 = function (IS_INCLUDES) {
822
+ return function ($this, el, fromIndex) {
823
+ var O = toIndexedObject$3($this);
824
+ var length = lengthOfArrayLike$1(O);
825
+ if (length === 0) return !IS_INCLUDES && -1;
826
+ var index = toAbsoluteIndex(fromIndex, length);
827
+ var value;
828
+ // Array#includes uses SameValueZero equality algorithm
829
+ // eslint-disable-next-line no-self-compare -- NaN check
830
+ if (IS_INCLUDES && el !== el) while (length > index) {
831
+ value = O[index++];
832
+ // eslint-disable-next-line no-self-compare -- NaN check
833
+ if (value !== value) return true;
834
+ // Array#indexOf ignores holes, Array#includes - not
835
+ } else for (;length > index; index++) {
836
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
837
+ } return !IS_INCLUDES && -1;
838
+ };
839
+ };
840
+
841
+ var arrayIncludes = {
842
+ // `Array.prototype.indexOf` method
843
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
844
+ indexOf: createMethod$1(false)
845
+ };
846
+
847
+ var uncurryThis$c = functionUncurryThis;
848
+ var hasOwn$6 = hasOwnProperty_1;
849
+ var toIndexedObject$2 = toIndexedObject$5;
850
+ var indexOf = arrayIncludes.indexOf;
851
+ var hiddenKeys$2 = hiddenKeys$4;
852
+
853
+ var push = uncurryThis$c([].push);
854
+
855
+ var objectKeysInternal = function (object, names) {
856
+ var O = toIndexedObject$2(object);
857
+ var i = 0;
858
+ var result = [];
859
+ var key;
860
+ for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push(result, key);
861
+ // Don't enum bug & hidden keys
862
+ while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
863
+ ~indexOf(result, key) || push(result, key);
864
+ }
865
+ return result;
866
+ };
867
+
868
+ // IE8- don't enum bug keys
869
+ var enumBugKeys$3 = [
870
+ 'constructor',
871
+ 'hasOwnProperty',
872
+ 'isPrototypeOf',
873
+ 'propertyIsEnumerable',
874
+ 'toLocaleString',
875
+ 'toString',
876
+ 'valueOf'
877
+ ];
878
+
879
+ var internalObjectKeys$1 = objectKeysInternal;
880
+ var enumBugKeys$2 = enumBugKeys$3;
881
+
882
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
883
+
884
+ // `Object.getOwnPropertyNames` method
885
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
886
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
887
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
888
+ return internalObjectKeys$1(O, hiddenKeys$1);
889
+ };
890
+
891
+ var objectGetOwnPropertySymbols = {};
892
+
893
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
894
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
895
+
896
+ var getBuiltIn$6 = getBuiltIn$8;
897
+ var uncurryThis$b = functionUncurryThis;
898
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
899
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
900
+ var anObject$7 = anObject$9;
901
+
902
+ var concat$1 = uncurryThis$b([].concat);
903
+
904
+ // all object keys, includes non-enumerable and symbols
905
+ var ownKeys$1 = getBuiltIn$6('Reflect', 'ownKeys') || function ownKeys(it) {
906
+ var keys = getOwnPropertyNamesModule.f(anObject$7(it));
907
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
908
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
909
+ };
910
+
911
+ var hasOwn$5 = hasOwnProperty_1;
912
+ var ownKeys = ownKeys$1;
913
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
914
+ var definePropertyModule$1 = objectDefineProperty;
915
+
916
+ var copyConstructorProperties$3 = function (target, source, exceptions) {
917
+ var keys = ownKeys(source);
918
+ var defineProperty = definePropertyModule$1.f;
919
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
920
+ for (var i = 0; i < keys.length; i++) {
921
+ var key = keys[i];
922
+ if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
923
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
924
+ }
925
+ }
926
+ };
927
+
928
+ var fails$8 = fails$g;
929
+ var isCallable$b = isCallable$l;
930
+
931
+ var replacement = /#|\.prototype\./;
932
+
933
+ var isForced$2 = function (feature, detection) {
934
+ var value = data[normalize(feature)];
935
+ return value === POLYFILL ? true
936
+ : value === NATIVE ? false
937
+ : isCallable$b(detection) ? fails$8(detection)
938
+ : !!detection;
939
+ };
940
+
941
+ var normalize = isForced$2.normalize = function (string) {
942
+ return String(string).replace(replacement, '.').toLowerCase();
943
+ };
944
+
945
+ var data = isForced$2.data = {};
946
+ var NATIVE = isForced$2.NATIVE = 'N';
947
+ var POLYFILL = isForced$2.POLYFILL = 'P';
948
+
949
+ var isForced_1 = isForced$2;
950
+
951
+ var globalThis$c = globalThis_1;
952
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
953
+ var createNonEnumerableProperty$5 = createNonEnumerableProperty$7;
954
+ var defineBuiltIn$4 = defineBuiltIn$5;
955
+ var defineGlobalProperty = defineGlobalProperty$3;
956
+ var copyConstructorProperties$2 = copyConstructorProperties$3;
957
+ var isForced$1 = isForced_1;
958
+
959
+ /*
960
+ options.target - name of the target object
961
+ options.global - target is the global object
962
+ options.stat - export as static methods of target
963
+ options.proto - export as prototype methods of target
964
+ options.real - real prototype method for the `pure` version
965
+ options.forced - export even if the native feature is available
966
+ options.bind - bind methods to the target, required for the `pure` version
967
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
968
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
969
+ options.sham - add a flag to not completely full polyfills
970
+ options.enumerable - export as enumerable property
971
+ options.dontCallGetSet - prevent calling a getter on target
972
+ options.name - the .name of the function if it does not match the key
973
+ */
974
+ var _export = function (options, source) {
975
+ var TARGET = options.target;
976
+ var GLOBAL = options.global;
977
+ var STATIC = options.stat;
978
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
979
+ if (GLOBAL) {
980
+ target = globalThis$c;
981
+ } else if (STATIC) {
982
+ target = globalThis$c[TARGET] || defineGlobalProperty(TARGET, {});
983
+ } else {
984
+ target = globalThis$c[TARGET] && globalThis$c[TARGET].prototype;
985
+ }
986
+ if (target) for (key in source) {
987
+ sourceProperty = source[key];
988
+ if (options.dontCallGetSet) {
989
+ descriptor = getOwnPropertyDescriptor$1(target, key);
990
+ targetProperty = descriptor && descriptor.value;
991
+ } else targetProperty = target[key];
992
+ FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
993
+ // contained in target
994
+ if (!FORCED && targetProperty !== undefined) {
995
+ if (typeof sourceProperty == typeof targetProperty) continue;
996
+ copyConstructorProperties$2(sourceProperty, targetProperty);
997
+ }
998
+ // add a flag to not completely full polyfills
999
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1000
+ createNonEnumerableProperty$5(sourceProperty, 'sham', true);
1001
+ }
1002
+ defineBuiltIn$4(target, key, sourceProperty, options);
1003
+ }
1004
+ };
1005
+
1006
+ var NATIVE_BIND$1 = functionBindNative;
1007
+
1008
+ var FunctionPrototype = Function.prototype;
1009
+ var apply$2 = FunctionPrototype.apply;
1010
+ var call$8 = FunctionPrototype.call;
1011
+
1012
+ // eslint-disable-next-line es/no-function-prototype-bind, es/no-reflect -- safe
1013
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$8.bind(apply$2) : function () {
1014
+ return call$8.apply(apply$2, arguments);
1015
+ });
1016
+
1017
+ var uncurryThis$a = functionUncurryThis;
1018
+ var aCallable$6 = aCallable$8;
1019
+
1020
+ var functionUncurryThisAccessor = function (object, key, method) {
1021
+ try {
1022
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1023
+ return uncurryThis$a(aCallable$6(Object.getOwnPropertyDescriptor(object, key)[method]));
1024
+ } catch (error) { /* empty */ }
1025
+ };
1026
+
1027
+ var isObject$6 = isObject$c;
1028
+
1029
+ var isPossiblePrototype$1 = function (argument) {
1030
+ return isObject$6(argument) || argument === null;
1031
+ };
1032
+
1033
+ var isPossiblePrototype = isPossiblePrototype$1;
1034
+
1035
+ var $String$2 = String;
1036
+ var $TypeError$6 = TypeError;
1037
+
1038
+ var aPossiblePrototype$1 = function (argument) {
1039
+ if (isPossiblePrototype(argument)) return argument;
1040
+ throw new $TypeError$6("Can't set " + $String$2(argument) + ' as a prototype');
1041
+ };
1042
+
1043
+ /* eslint-disable no-proto -- safe */
1044
+ var uncurryThisAccessor = functionUncurryThisAccessor;
1045
+ var isObject$5 = isObject$c;
1046
+ var requireObjectCoercible$2 = requireObjectCoercible$5;
1047
+ var aPossiblePrototype = aPossiblePrototype$1;
1048
+
1049
+ // `Object.setPrototypeOf` method
1050
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1051
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1052
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1053
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1054
+ var CORRECT_SETTER = false;
1055
+ var test = {};
1056
+ var setter;
1057
+ try {
1058
+ setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
1059
+ setter(test, []);
1060
+ CORRECT_SETTER = test instanceof Array;
1061
+ } catch (error) { /* empty */ }
1062
+ return function setPrototypeOf(O, proto) {
1063
+ requireObjectCoercible$2(O);
1064
+ aPossiblePrototype(proto);
1065
+ if (!isObject$5(O)) return O;
1066
+ if (CORRECT_SETTER) setter(O, proto);
1067
+ else O.__proto__ = proto;
1068
+ return O;
1069
+ };
1070
+ }() : undefined);
1071
+
1072
+ var defineProperty$5 = objectDefineProperty.f;
1073
+
1074
+ var proxyAccessor$1 = function (Target, Source, key) {
1075
+ key in Target || defineProperty$5(Target, key, {
1076
+ configurable: true,
1077
+ get: function () { return Source[key]; },
1078
+ set: function (it) { Source[key] = it; }
1079
+ });
1080
+ };
1081
+
1082
+ var isCallable$a = isCallable$l;
1083
+ var isObject$4 = isObject$c;
1084
+ var setPrototypeOf$3 = objectSetPrototypeOf;
1085
+
1086
+ // makes subclassing work correct for wrapped built-ins
1087
+ var inheritIfRequired$1 = function ($this, dummy, Wrapper) {
1088
+ var NewTarget, NewTargetPrototype;
1089
+ if (
1090
+ // it can work only with native `setPrototypeOf`
1091
+ setPrototypeOf$3 &&
1092
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
1093
+ isCallable$a(NewTarget = dummy.constructor) &&
1094
+ NewTarget !== Wrapper &&
1095
+ isObject$4(NewTargetPrototype = NewTarget.prototype) &&
1096
+ NewTargetPrototype !== Wrapper.prototype
1097
+ ) setPrototypeOf$3($this, NewTargetPrototype);
1098
+ return $this;
1099
+ };
1100
+
1101
+ var wellKnownSymbol$c = wellKnownSymbol$e;
1102
+
1103
+ var TO_STRING_TAG$2 = wellKnownSymbol$c('toStringTag');
1104
+ var test = {};
1105
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1106
+ test[TO_STRING_TAG$2] = 'z';
1107
+
1108
+ var toStringTagSupport = String(test) === '[object z]';
1109
+
1110
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1111
+ var isCallable$9 = isCallable$l;
1112
+ var classofRaw$1 = classofRaw$2;
1113
+ var wellKnownSymbol$b = wellKnownSymbol$e;
1114
+
1115
+ var TO_STRING_TAG$1 = wellKnownSymbol$b('toStringTag');
1116
+ var $Object$1 = Object;
1117
+
1118
+ // ES3 wrong here
1119
+ var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
1120
+
1121
+ // fallback for IE11 Script Access Denied error
1122
+ var tryGet = function (it, key) {
1123
+ try {
1124
+ return it[key];
1125
+ } catch (error) { /* empty */ }
1126
+ };
1127
+
1128
+ // getting tag from ES6+ `Object.prototype.toString`
1129
+ var classof$4 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1130
+ var O, tag, result;
1131
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1132
+ // @@toStringTag case
1133
+ : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
1134
+ // builtinTag case
1135
+ : CORRECT_ARGUMENTS ? classofRaw$1(O)
1136
+ // ES3 arguments fallback
1137
+ : (result = classofRaw$1(O)) === 'Object' && isCallable$9(O.callee) ? 'Arguments' : result;
1138
+ };
1139
+
1140
+ var classof$3 = classof$4;
1141
+
1142
+ var $String$1 = String;
1143
+
1144
+ var toString$4 = function (argument) {
1145
+ if (classof$3(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1146
+ return $String$1(argument);
1147
+ };
1148
+
1149
+ var toString$3 = toString$4;
1150
+
1151
+ var normalizeStringArgument$1 = function (argument, $default) {
1152
+ return argument === undefined ? arguments.length < 2 ? '' : $default : toString$3(argument);
1153
+ };
1154
+
1155
+ var isObject$3 = isObject$c;
1156
+ var createNonEnumerableProperty$4 = createNonEnumerableProperty$7;
1157
+
1158
+ // `InstallErrorCause` abstract operation
1159
+ // https://tc39.es/ecma262/#sec-installerrorcause
1160
+ var installErrorCause$1 = function (O, options) {
1161
+ if (isObject$3(options) && 'cause' in options) {
1162
+ createNonEnumerableProperty$4(O, 'cause', options.cause);
1163
+ }
1164
+ };
1165
+
1166
+ var uncurryThis$9 = functionUncurryThis;
1167
+
1168
+ var $Error = Error;
1169
+ var replace$2 = uncurryThis$9(''.replace);
1170
+
1171
+ var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
1172
+ // eslint-disable-next-line redos/no-vulnerable, sonarjs/slow-regex -- safe
1173
+ var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
1174
+ var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
1175
+
1176
+ var errorStackClear = function (stack, dropEntries) {
1177
+ if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
1178
+ while (dropEntries--) stack = replace$2(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
1179
+ } return stack;
1180
+ };
1181
+
1182
+ var fails$7 = fails$g;
1183
+ var createPropertyDescriptor$1 = createPropertyDescriptor$4;
1184
+
1185
+ var errorStackInstallable = !fails$7(function () {
1186
+ var error = new Error('a');
1187
+ if (!('stack' in error)) return true;
1188
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
1189
+ Object.defineProperty(error, 'stack', createPropertyDescriptor$1(1, 7));
1190
+ return error.stack !== 7;
1191
+ });
1192
+
1193
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$7;
1194
+ var clearErrorStack = errorStackClear;
1195
+ var ERROR_STACK_INSTALLABLE = errorStackInstallable;
1196
+
1197
+ // non-standard V8
1198
+ // eslint-disable-next-line es/no-nonstandard-error-properties -- safe
1199
+ var captureStackTrace = Error.captureStackTrace;
1200
+
1201
+ var errorStackInstall = function (error, C, stack, dropEntries) {
1202
+ if (ERROR_STACK_INSTALLABLE) {
1203
+ if (captureStackTrace) captureStackTrace(error, C);
1204
+ else createNonEnumerableProperty$3(error, 'stack', clearErrorStack(stack, dropEntries));
1205
+ }
1206
+ };
1207
+
1208
+ var getBuiltIn$5 = getBuiltIn$8;
1209
+ var hasOwn$4 = hasOwnProperty_1;
1210
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$7;
1211
+ var isPrototypeOf$3 = objectIsPrototypeOf;
1212
+ var setPrototypeOf$2 = objectSetPrototypeOf;
1213
+ var copyConstructorProperties$1 = copyConstructorProperties$3;
1214
+ var proxyAccessor = proxyAccessor$1;
1215
+ var inheritIfRequired = inheritIfRequired$1;
1216
+ var normalizeStringArgument = normalizeStringArgument$1;
1217
+ var installErrorCause = installErrorCause$1;
1218
+ var installErrorStack = errorStackInstall;
1219
+ var DESCRIPTORS$6 = descriptors;
1220
+
1221
+ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
1222
+ var STACK_TRACE_LIMIT = 'stackTraceLimit';
1223
+ var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
1224
+ var path = FULL_NAME.split('.');
1225
+ var ERROR_NAME = path[path.length - 1];
1226
+ var OriginalError = getBuiltIn$5.apply(null, path);
1227
+
1228
+ if (!OriginalError) return;
1229
+
1230
+ var OriginalErrorPrototype = OriginalError.prototype;
1231
+
1232
+ // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
1233
+ if (hasOwn$4(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
1234
+
1235
+ if (!FORCED) return OriginalError;
1236
+
1237
+ var BaseError = getBuiltIn$5('Error');
1238
+
1239
+ var WrappedError = wrapper(function (a, b) {
1240
+ var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
1241
+ var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
1242
+ if (message !== undefined) createNonEnumerableProperty$2(result, 'message', message);
1243
+ installErrorStack(result, WrappedError, result.stack, 2);
1244
+ if (this && isPrototypeOf$3(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
1245
+ if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
1246
+ return result;
1247
+ });
1248
+
1249
+ WrappedError.prototype = OriginalErrorPrototype;
1250
+
1251
+ if (ERROR_NAME !== 'Error') {
1252
+ if (setPrototypeOf$2) setPrototypeOf$2(WrappedError, BaseError);
1253
+ else copyConstructorProperties$1(WrappedError, BaseError, { name: true });
1254
+ } else if (DESCRIPTORS$6 && STACK_TRACE_LIMIT in OriginalError) {
1255
+ proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
1256
+ proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
1257
+ }
1258
+
1259
+ copyConstructorProperties$1(WrappedError, OriginalError);
1260
+
1261
+ try {
1262
+ // Safari 13- bug: WebAssembly errors does not have a proper `.name`
1263
+ if (OriginalErrorPrototype.name !== ERROR_NAME) {
1264
+ createNonEnumerableProperty$2(OriginalErrorPrototype, 'name', ERROR_NAME);
1265
+ }
1266
+ OriginalErrorPrototype.constructor = WrappedError;
1267
+ } catch (error) { /* empty */ }
1268
+
1269
+ return WrappedError;
1270
+ };
1271
+
1272
+ /* eslint-disable no-unused-vars -- required for functions `.length` */
1273
+ var $$b = _export;
1274
+ var globalThis$b = globalThis_1;
1275
+ var apply$1 = functionApply;
1276
+ var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
1277
+
1278
+ var WEB_ASSEMBLY = 'WebAssembly';
1279
+ var WebAssembly = globalThis$b[WEB_ASSEMBLY];
1280
+
1281
+ // eslint-disable-next-line es/no-error-cause -- feature detection
1282
+ var FORCED$1 = new Error('e', { cause: 7 }).cause !== 7;
1283
+
1284
+ var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
1285
+ var O = {};
1286
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1287
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED$1);
1288
+ $$b({ global: true, constructor: true, arity: 1, forced: FORCED$1 }, O);
1289
+ };
1290
+
1291
+ var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
1292
+ if (WebAssembly && WebAssembly[ERROR_NAME]) {
1293
+ var O = {};
1294
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1295
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED$1);
1296
+ $$b({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$1 }, O);
1297
+ }
1298
+ };
1299
+
1300
+ // https://tc39.es/ecma262/#sec-nativeerror
1301
+ exportGlobalErrorCauseWrapper('Error', function (init) {
1302
+ return function Error(message) { return apply$1(init, this, arguments); };
1303
+ });
1304
+ exportGlobalErrorCauseWrapper('EvalError', function (init) {
1305
+ return function EvalError(message) { return apply$1(init, this, arguments); };
1306
+ });
1307
+ exportGlobalErrorCauseWrapper('RangeError', function (init) {
1308
+ return function RangeError(message) { return apply$1(init, this, arguments); };
1309
+ });
1310
+ exportGlobalErrorCauseWrapper('ReferenceError', function (init) {
1311
+ return function ReferenceError(message) { return apply$1(init, this, arguments); };
1312
+ });
1313
+ exportGlobalErrorCauseWrapper('SyntaxError', function (init) {
1314
+ return function SyntaxError(message) { return apply$1(init, this, arguments); };
1315
+ });
1316
+ exportGlobalErrorCauseWrapper('TypeError', function (init) {
1317
+ return function TypeError(message) { return apply$1(init, this, arguments); };
1318
+ });
1319
+ exportGlobalErrorCauseWrapper('URIError', function (init) {
1320
+ return function URIError(message) { return apply$1(init, this, arguments); };
1321
+ });
1322
+ exportWebAssemblyErrorCauseWrapper('CompileError', function (init) {
1323
+ return function CompileError(message) { return apply$1(init, this, arguments); };
1324
+ });
1325
+ exportWebAssemblyErrorCauseWrapper('LinkError', function (init) {
1326
+ return function LinkError(message) { return apply$1(init, this, arguments); };
1327
+ });
1328
+ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
1329
+ return function RuntimeError(message) { return apply$1(init, this, arguments); };
1330
+ });
1331
+
1332
+ var objectDefineProperties = {};
1333
+
1334
+ var internalObjectKeys = objectKeysInternal;
1335
+ var enumBugKeys$1 = enumBugKeys$3;
1336
+
1337
+ // `Object.keys` method
1338
+ // https://tc39.es/ecma262/#sec-object.keys
1339
+ // eslint-disable-next-line es/no-object-keys -- safe
1340
+ var objectKeys$2 = Object.keys || function keys(O) {
1341
+ return internalObjectKeys(O, enumBugKeys$1);
1342
+ };
1343
+
1344
+ var DESCRIPTORS$5 = descriptors;
1345
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1346
+ var definePropertyModule = objectDefineProperty;
1347
+ var anObject$6 = anObject$9;
1348
+ var toIndexedObject$1 = toIndexedObject$5;
1349
+ var objectKeys$1 = objectKeys$2;
1350
+
1351
+ // `Object.defineProperties` method
1352
+ // https://tc39.es/ecma262/#sec-object.defineproperties
1353
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
1354
+ objectDefineProperties.f = DESCRIPTORS$5 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1355
+ anObject$6(O);
1356
+ var props = toIndexedObject$1(Properties);
1357
+ var keys = objectKeys$1(Properties);
1358
+ var length = keys.length;
1359
+ var index = 0;
1360
+ var key;
1361
+ while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1362
+ return O;
1363
+ };
1364
+
1365
+ var getBuiltIn$4 = getBuiltIn$8;
1366
+
1367
+ var html$2 = getBuiltIn$4('document', 'documentElement');
1368
+
1369
+ /* global ActiveXObject -- old IE, WSH */
1370
+ var anObject$5 = anObject$9;
1371
+ var definePropertiesModule = objectDefineProperties;
1372
+ var enumBugKeys = enumBugKeys$3;
1373
+ var hiddenKeys = hiddenKeys$4;
1374
+ var html$1 = html$2;
1375
+ var documentCreateElement$1 = documentCreateElement$2;
1376
+ var sharedKey$1 = sharedKey$3;
1377
+
1378
+ var GT = '>';
1379
+ var LT = '<';
1380
+ var PROTOTYPE = 'prototype';
1381
+ var SCRIPT = 'script';
1382
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1383
+
1384
+ var EmptyConstructor = function () { /* empty */ };
1385
+
1386
+ var scriptTag = function (content) {
1387
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1388
+ };
1389
+
1390
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1391
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1392
+ activeXDocument.write(scriptTag(''));
1393
+ activeXDocument.close();
1394
+ var temp = activeXDocument.parentWindow.Object;
1395
+ // eslint-disable-next-line no-useless-assignment -- avoid memory leak
1396
+ activeXDocument = null;
1397
+ return temp;
1398
+ };
1399
+
1400
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1401
+ var NullProtoObjectViaIFrame = function () {
1402
+ // Thrash, waste and sodomy: IE GC bug
1403
+ var iframe = documentCreateElement$1('iframe');
1404
+ var JS = 'java' + SCRIPT + ':';
1405
+ var iframeDocument;
1406
+ iframe.style.display = 'none';
1407
+ html$1.appendChild(iframe);
1408
+ // https://github.com/zloirock/core-js/issues/475
1409
+ iframe.src = String(JS);
1410
+ iframeDocument = iframe.contentWindow.document;
1411
+ iframeDocument.open();
1412
+ iframeDocument.write(scriptTag('document.F=Object'));
1413
+ iframeDocument.close();
1414
+ return iframeDocument.F;
1415
+ };
1416
+
1417
+ // Check for document.domain and active x support
1418
+ // No need to use active x approach when document.domain is not set
1419
+ // see https://github.com/es-shims/es5-shim/issues/150
1420
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1421
+ // avoid IE GC bug
1422
+ var activeXDocument;
1423
+ var NullProtoObject = function () {
1424
+ try {
1425
+ activeXDocument = new ActiveXObject('htmlfile');
1426
+ } catch (error) { /* ignore */ }
1427
+ NullProtoObject = typeof document != 'undefined'
1428
+ ? document.domain && activeXDocument
1429
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1430
+ : NullProtoObjectViaIFrame()
1431
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1432
+ var length = enumBugKeys.length;
1433
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1434
+ return NullProtoObject();
1435
+ };
1436
+
1437
+ hiddenKeys[IE_PROTO$1] = true;
1438
+
1439
+ // `Object.create` method
1440
+ // https://tc39.es/ecma262/#sec-object.create
1441
+ // eslint-disable-next-line es/no-object-create -- safe
1442
+ var objectCreate = Object.create || function create(O, Properties) {
1443
+ var result;
1444
+ if (O !== null) {
1445
+ EmptyConstructor[PROTOTYPE] = anObject$5(O);
1446
+ result = new EmptyConstructor();
1447
+ EmptyConstructor[PROTOTYPE] = null;
1448
+ // add "__proto__" for Object.getPrototypeOf polyfill
1449
+ result[IE_PROTO$1] = O;
1450
+ } else result = NullProtoObject();
1451
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1452
+ };
1453
+
1454
+ var wellKnownSymbol$a = wellKnownSymbol$e;
1455
+ var create$1 = objectCreate;
1456
+ var defineProperty$4 = objectDefineProperty.f;
1457
+
1458
+ var UNSCOPABLES = wellKnownSymbol$a('unscopables');
1459
+ var ArrayPrototype$1 = Array.prototype;
1460
+
1461
+ // Array.prototype[@@unscopables]
1462
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1463
+ if (ArrayPrototype$1[UNSCOPABLES] === undefined) {
1464
+ defineProperty$4(ArrayPrototype$1, UNSCOPABLES, {
1465
+ configurable: true,
1466
+ value: create$1(null)
1467
+ });
1468
+ }
1469
+
1470
+ // add a key to Array.prototype[@@unscopables]
1471
+ var addToUnscopables$1 = function (key) {
1472
+ ArrayPrototype$1[UNSCOPABLES][key] = true;
1473
+ };
1474
+
1475
+ var iterators = {};
1476
+
1477
+ var fails$6 = fails$g;
1478
+
1479
+ var correctPrototypeGetter = !fails$6(function () {
1480
+ function F() { /* empty */ }
1481
+ F.prototype.constructor = null;
1482
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1483
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1484
+ });
1485
+
1486
+ var hasOwn$3 = hasOwnProperty_1;
1487
+ var isCallable$8 = isCallable$l;
1488
+ var toObject$1 = toObject$3;
1489
+ var sharedKey = sharedKey$3;
1490
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1491
+
1492
+ var IE_PROTO = sharedKey('IE_PROTO');
1493
+ var $Object = Object;
1494
+ var ObjectPrototype = $Object.prototype;
1495
+
1496
+ // `Object.getPrototypeOf` method
1497
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1498
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
1499
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
1500
+ var object = toObject$1(O);
1501
+ if (hasOwn$3(object, IE_PROTO)) return object[IE_PROTO];
1502
+ var constructor = object.constructor;
1503
+ if (isCallable$8(constructor) && object instanceof constructor) {
1504
+ return constructor.prototype;
1505
+ } return object instanceof $Object ? ObjectPrototype : null;
1506
+ };
1507
+
1508
+ var fails$5 = fails$g;
1509
+ var isCallable$7 = isCallable$l;
1510
+ var isObject$2 = isObject$c;
1511
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1512
+ var defineBuiltIn$3 = defineBuiltIn$5;
1513
+ var wellKnownSymbol$9 = wellKnownSymbol$e;
1514
+
1515
+ var ITERATOR$5 = wellKnownSymbol$9('iterator');
1516
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1517
+
1518
+ // `%IteratorPrototype%` object
1519
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1520
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1521
+
1522
+ /* eslint-disable es/no-array-prototype-keys -- safe */
1523
+ if ([].keys) {
1524
+ arrayIterator = [].keys();
1525
+ // Safari 8 has buggy iterators w/o `next`
1526
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1527
+ else {
1528
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1529
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1530
+ }
1531
+ }
1532
+
1533
+ var NEW_ITERATOR_PROTOTYPE = !isObject$2(IteratorPrototype$2) || fails$5(function () {
1534
+ var test = {};
1535
+ // FF44- legacy iterators case
1536
+ return IteratorPrototype$2[ITERATOR$5].call(test) !== test;
1537
+ });
1538
+
1539
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1540
+
1541
+ // `%IteratorPrototype%[@@iterator]()` method
1542
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1543
+ if (!isCallable$7(IteratorPrototype$2[ITERATOR$5])) {
1544
+ defineBuiltIn$3(IteratorPrototype$2, ITERATOR$5, function () {
1545
+ return this;
1546
+ });
1547
+ }
1548
+
1549
+ var iteratorsCore = {
1550
+ IteratorPrototype: IteratorPrototype$2,
1551
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1552
+ };
1553
+
1554
+ var defineProperty$3 = objectDefineProperty.f;
1555
+ var hasOwn$2 = hasOwnProperty_1;
1556
+ var wellKnownSymbol$8 = wellKnownSymbol$e;
1557
+
1558
+ var TO_STRING_TAG = wellKnownSymbol$8('toStringTag');
1559
+
1560
+ var setToStringTag$4 = function (target, TAG, STATIC) {
1561
+ if (target && !STATIC) target = target.prototype;
1562
+ if (target && !hasOwn$2(target, TO_STRING_TAG)) {
1563
+ defineProperty$3(target, TO_STRING_TAG, { configurable: true, value: TAG });
1564
+ }
1565
+ };
1566
+
1567
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1568
+ var create = objectCreate;
1569
+ var createPropertyDescriptor = createPropertyDescriptor$4;
1570
+ var setToStringTag$3 = setToStringTag$4;
1571
+ var Iterators$4 = iterators;
1572
+
1573
+ var returnThis$1 = function () { return this; };
1574
+
1575
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1576
+ var TO_STRING_TAG = NAME + ' Iterator';
1577
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1578
+ setToStringTag$3(IteratorConstructor, TO_STRING_TAG, false);
1579
+ Iterators$4[TO_STRING_TAG] = returnThis$1;
1580
+ return IteratorConstructor;
1581
+ };
1582
+
1583
+ var $$a = _export;
1584
+ var call$7 = functionCall;
1585
+ var FunctionName = functionName;
1586
+ var isCallable$6 = isCallable$l;
1587
+ var createIteratorConstructor = iteratorCreateConstructor;
1588
+ var getPrototypeOf = objectGetPrototypeOf;
1589
+ var setPrototypeOf$1 = objectSetPrototypeOf;
1590
+ var setToStringTag$2 = setToStringTag$4;
1591
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$7;
1592
+ var defineBuiltIn$2 = defineBuiltIn$5;
1593
+ var wellKnownSymbol$7 = wellKnownSymbol$e;
1594
+ var Iterators$3 = iterators;
1595
+ var IteratorsCore = iteratorsCore;
1596
+
1597
+ var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
1598
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1599
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
1600
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1601
+ var ITERATOR$4 = wellKnownSymbol$7('iterator');
1602
+ var KEYS = 'keys';
1603
+ var VALUES = 'values';
1604
+ var ENTRIES = 'entries';
1605
+
1606
+ var returnThis = function () { return this; };
1607
+
1608
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1609
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1610
+
1611
+ var getIterationMethod = function (KIND) {
1612
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1613
+ if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
1614
+
1615
+ switch (KIND) {
1616
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1617
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1618
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1619
+ }
1620
+
1621
+ return function () { return new IteratorConstructor(this); };
1622
+ };
1623
+
1624
+ var TO_STRING_TAG = NAME + ' Iterator';
1625
+ var INCORRECT_VALUES_NAME = false;
1626
+ var IterablePrototype = Iterable.prototype;
1627
+ var nativeIterator = IterablePrototype[ITERATOR$4]
1628
+ || IterablePrototype['@@iterator']
1629
+ || DEFAULT && IterablePrototype[DEFAULT];
1630
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1631
+ var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1632
+ var CurrentIteratorPrototype, methods, KEY;
1633
+
1634
+ // fix native
1635
+ if (anyNativeIterator) {
1636
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1637
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1638
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1639
+ if (setPrototypeOf$1) {
1640
+ setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
1641
+ } else if (!isCallable$6(CurrentIteratorPrototype[ITERATOR$4])) {
1642
+ defineBuiltIn$2(CurrentIteratorPrototype, ITERATOR$4, returnThis);
1643
+ }
1644
+ }
1645
+ // Set @@toStringTag to native iterators
1646
+ setToStringTag$2(CurrentIteratorPrototype, TO_STRING_TAG, true);
1647
+ }
1648
+ }
1649
+
1650
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1651
+ if (PROPER_FUNCTION_NAME$1 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1652
+ if (CONFIGURABLE_FUNCTION_NAME) {
1653
+ createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1654
+ } else {
1655
+ INCORRECT_VALUES_NAME = true;
1656
+ defaultIterator = function values() { return call$7(nativeIterator, this); };
1657
+ }
1658
+ }
1659
+
1660
+ // export additional methods
1661
+ if (DEFAULT) {
1662
+ methods = {
1663
+ values: getIterationMethod(VALUES),
1664
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1665
+ entries: getIterationMethod(ENTRIES)
1666
+ };
1667
+ if (FORCED) for (KEY in methods) {
1668
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1669
+ defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
1670
+ }
1671
+ } else $$a({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1672
+ }
1673
+
1674
+ // define iterator
1675
+ if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
1676
+ defineBuiltIn$2(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
1677
+ }
1678
+ Iterators$3[NAME] = defaultIterator;
1679
+
1680
+ return methods;
1681
+ };
1682
+
1683
+ // `CreateIterResultObject` abstract operation
1684
+ // https://tc39.es/ecma262/#sec-createiterresultobject
1685
+ var createIterResultObject$1 = function (value, done) {
1686
+ return { value: value, done: done };
1687
+ };
1688
+
1689
+ var toIndexedObject = toIndexedObject$5;
1690
+ var addToUnscopables = addToUnscopables$1;
1691
+ var Iterators$2 = iterators;
1692
+ var InternalStateModule$1 = internalState;
1693
+ var defineProperty$2 = objectDefineProperty.f;
1694
+ var defineIterator = iteratorDefine;
1695
+ var createIterResultObject = createIterResultObject$1;
1696
+ var DESCRIPTORS$4 = descriptors;
1697
+
1698
+ var ARRAY_ITERATOR = 'Array Iterator';
1699
+ var setInternalState$1 = InternalStateModule$1.set;
1700
+ var getInternalState = InternalStateModule$1.getterFor(ARRAY_ITERATOR);
1701
+
1702
+ // `Array.prototype.entries` method
1703
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1704
+ // `Array.prototype.keys` method
1705
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1706
+ // `Array.prototype.values` method
1707
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1708
+ // `Array.prototype[@@iterator]` method
1709
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1710
+ // `CreateArrayIterator` internal method
1711
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1712
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1713
+ setInternalState$1(this, {
1714
+ type: ARRAY_ITERATOR,
1715
+ target: toIndexedObject(iterated), // target
1716
+ index: 0, // next index
1717
+ kind: kind // kind
1718
+ });
1719
+ // `%ArrayIteratorPrototype%.next` method
1720
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1721
+ }, function () {
1722
+ var state = getInternalState(this);
1723
+ var target = state.target;
1724
+ var index = state.index++;
1725
+ if (!target || index >= target.length) {
1726
+ state.target = null;
1727
+ return createIterResultObject(undefined, true);
1728
+ }
1729
+ switch (state.kind) {
1730
+ case 'keys': return createIterResultObject(index, false);
1731
+ case 'values': return createIterResultObject(target[index], false);
1732
+ } return createIterResultObject([index, target[index]], false);
1733
+ }, 'values');
1734
+
1735
+ // argumentsList[@@iterator] is %ArrayProto_values%
1736
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1737
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1738
+ var values = Iterators$2.Arguments = Iterators$2.Array;
1739
+
1740
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1741
+ addToUnscopables('keys');
1742
+ addToUnscopables('values');
1743
+ addToUnscopables('entries');
1744
+
1745
+ // V8 ~ Chrome 45- bug
1746
+ if (DESCRIPTORS$4 && values.name !== 'values') try {
1747
+ defineProperty$2(values, 'name', { value: 'values' });
1748
+ } catch (error) { /* empty */ }
1749
+
1750
+ var DESCRIPTORS$3 = descriptors;
1751
+ var uncurryThis$8 = functionUncurryThis;
1752
+ var call$6 = functionCall;
1753
+ var fails$4 = fails$g;
1754
+ var objectKeys = objectKeys$2;
1755
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1756
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1757
+ var toObject = toObject$3;
1758
+ var IndexedObject = indexedObject;
1759
+
1760
+ // eslint-disable-next-line es/no-object-assign -- safe
1761
+ var $assign = Object.assign;
1762
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1763
+ var defineProperty$1 = Object.defineProperty;
1764
+ var concat = uncurryThis$8([].concat);
1765
+
1766
+ // `Object.assign` method
1767
+ // https://tc39.es/ecma262/#sec-object.assign
1768
+ var objectAssign = !$assign || fails$4(function () {
1769
+ // should have correct order of operations (Edge bug)
1770
+ if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$1({}, 'a', {
1771
+ enumerable: true,
1772
+ get: function () {
1773
+ defineProperty$1(this, 'b', {
1774
+ value: 3,
1775
+ enumerable: false
1776
+ });
1777
+ }
1778
+ }), { b: 2 })).b !== 1) return true;
1779
+ // should work with symbols and should have deterministic property order (V8 bug)
1780
+ var A = {};
1781
+ var B = {};
1782
+ // eslint-disable-next-line es/no-symbol -- safe
1783
+ var symbol = Symbol('assign detection');
1784
+ var alphabet = 'abcdefghijklmnopqrst';
1785
+ A[symbol] = 7;
1786
+ // eslint-disable-next-line es/no-array-prototype-foreach -- safe
1787
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1788
+ return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
1789
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1790
+ var T = toObject(target);
1791
+ var argumentsLength = arguments.length;
1792
+ var index = 1;
1793
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1794
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1795
+ while (argumentsLength > index) {
1796
+ var S = IndexedObject(arguments[index++]);
1797
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1798
+ var length = keys.length;
1799
+ var j = 0;
1800
+ var key;
1801
+ while (length > j) {
1802
+ key = keys[j++];
1803
+ if (!DESCRIPTORS$3 || call$6(propertyIsEnumerable, S, key)) T[key] = S[key];
1804
+ }
1805
+ } return T;
1806
+ } : $assign;
1807
+
1808
+ var $$9 = _export;
1809
+ var assign = objectAssign;
1810
+
1811
+ // `Object.assign` method
1812
+ // https://tc39.es/ecma262/#sec-object.assign
1813
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1814
+ $$9({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1815
+ assign: assign
1816
+ });
1817
+
1818
+ /* global Bun, Deno -- detection */
1819
+ var globalThis$a = globalThis_1;
1820
+ var userAgent$3 = environmentUserAgent;
1821
+ var classof$2 = classofRaw$2;
1822
+
1823
+ var userAgentStartsWith = function (string) {
1824
+ return userAgent$3.slice(0, string.length) === string;
1825
+ };
1826
+
1827
+ var environment = (function () {
1828
+ if (userAgentStartsWith('Bun/')) return 'BUN';
1829
+ if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE';
1830
+ if (userAgentStartsWith('Deno/')) return 'DENO';
1831
+ if (userAgentStartsWith('Node.js/')) return 'NODE';
1832
+ if (globalThis$a.Bun && typeof Bun.version == 'string') return 'BUN';
1833
+ if (globalThis$a.Deno && typeof Deno.version == 'object') return 'DENO';
1834
+ if (classof$2(globalThis$a.process) === 'process') return 'NODE';
1835
+ if (globalThis$a.window && globalThis$a.document) return 'BROWSER';
1836
+ return 'REST';
1837
+ })();
1838
+
1839
+ var ENVIRONMENT$1 = environment;
1840
+
1841
+ var environmentIsNode = ENVIRONMENT$1 === 'NODE';
1842
+
1843
+ var globalThis$9 = globalThis_1;
1844
+
1845
+ var path$1 = globalThis$9;
1846
+
1847
+ var makeBuiltIn = makeBuiltInExports;
1848
+ var defineProperty = objectDefineProperty;
1849
+
1850
+ var defineBuiltInAccessor$2 = function (target, name, descriptor) {
1851
+ if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
1852
+ if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
1853
+ return defineProperty.f(target, name, descriptor);
1854
+ };
1855
+
1856
+ var getBuiltIn$3 = getBuiltIn$8;
1857
+ var defineBuiltInAccessor$1 = defineBuiltInAccessor$2;
1858
+ var wellKnownSymbol$6 = wellKnownSymbol$e;
1859
+ var DESCRIPTORS$2 = descriptors;
1860
+
1861
+ var SPECIES$2 = wellKnownSymbol$6('species');
1862
+
1863
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1864
+ var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
1865
+
1866
+ if (DESCRIPTORS$2 && Constructor && !Constructor[SPECIES$2]) {
1867
+ defineBuiltInAccessor$1(Constructor, SPECIES$2, {
1868
+ configurable: true,
1869
+ get: function () { return this; }
1870
+ });
1871
+ }
1872
+ };
1873
+
1874
+ var isPrototypeOf$2 = objectIsPrototypeOf;
1875
+
1876
+ var $TypeError$5 = TypeError;
1877
+
1878
+ var anInstance$1 = function (it, Prototype) {
1879
+ if (isPrototypeOf$2(Prototype, it)) return it;
1880
+ throw new $TypeError$5('Incorrect invocation');
1881
+ };
1882
+
1883
+ var uncurryThis$7 = functionUncurryThis;
1884
+ var fails$3 = fails$g;
1885
+ var isCallable$5 = isCallable$l;
1886
+ var classof$1 = classof$4;
1887
+ var getBuiltIn$2 = getBuiltIn$8;
1888
+ var inspectSource$1 = inspectSource$3;
1889
+
1890
+ var noop = function () { /* empty */ };
1891
+ var construct = getBuiltIn$2('Reflect', 'construct');
1892
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1893
+ var exec = uncurryThis$7(constructorRegExp.exec);
1894
+ var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
1895
+
1896
+ var isConstructorModern = function isConstructor(argument) {
1897
+ if (!isCallable$5(argument)) return false;
1898
+ try {
1899
+ construct(noop, [], argument);
1900
+ return true;
1901
+ } catch (error) {
1902
+ return false;
1903
+ }
1904
+ };
1905
+
1906
+ var isConstructorLegacy = function isConstructor(argument) {
1907
+ if (!isCallable$5(argument)) return false;
1908
+ switch (classof$1(argument)) {
1909
+ case 'AsyncFunction':
1910
+ case 'GeneratorFunction':
1911
+ case 'AsyncGeneratorFunction': return false;
1912
+ }
1913
+ try {
1914
+ // we can't check .prototype since constructors produced by .bind haven't it
1915
+ // `Function#toString` throws on some built-it function in some legacy engines
1916
+ // (for example, `DOMQuad` and similar in FF41-)
1917
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
1918
+ } catch (error) {
1919
+ return true;
1920
+ }
1921
+ };
1922
+
1923
+ isConstructorLegacy.sham = true;
1924
+
1925
+ // `IsConstructor` abstract operation
1926
+ // https://tc39.es/ecma262/#sec-isconstructor
1927
+ var isConstructor$1 = !construct || fails$3(function () {
1928
+ var called;
1929
+ return isConstructorModern(isConstructorModern.call)
1930
+ || !isConstructorModern(Object)
1931
+ || !isConstructorModern(function () { called = true; })
1932
+ || called;
1933
+ }) ? isConstructorLegacy : isConstructorModern;
1934
+
1935
+ var isConstructor = isConstructor$1;
1936
+ var tryToString$2 = tryToString$4;
1937
+
1938
+ var $TypeError$4 = TypeError;
1939
+
1940
+ // `Assert: IsConstructor(argument) is true`
1941
+ var aConstructor$1 = function (argument) {
1942
+ if (isConstructor(argument)) return argument;
1943
+ throw new $TypeError$4(tryToString$2(argument) + ' is not a constructor');
1944
+ };
1945
+
1946
+ var anObject$4 = anObject$9;
1947
+ var aConstructor = aConstructor$1;
1948
+ var isNullOrUndefined$1 = isNullOrUndefined$4;
1949
+ var wellKnownSymbol$5 = wellKnownSymbol$e;
1950
+
1951
+ var SPECIES$1 = wellKnownSymbol$5('species');
1952
+
1953
+ // `SpeciesConstructor` abstract operation
1954
+ // https://tc39.es/ecma262/#sec-speciesconstructor
1955
+ var speciesConstructor$1 = function (O, defaultConstructor) {
1956
+ var C = anObject$4(O).constructor;
1957
+ var S;
1958
+ return C === undefined || isNullOrUndefined$1(S = anObject$4(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
1959
+ };
1960
+
1961
+ var classofRaw = classofRaw$2;
1962
+ var uncurryThis$6 = functionUncurryThis;
1963
+
1964
+ var functionUncurryThisClause = function (fn) {
1965
+ // Nashorn bug:
1966
+ // https://github.com/zloirock/core-js/issues/1128
1967
+ // https://github.com/zloirock/core-js/issues/1130
1968
+ if (classofRaw(fn) === 'Function') return uncurryThis$6(fn);
1969
+ };
1970
+
1971
+ var uncurryThis$5 = functionUncurryThisClause;
1972
+ var aCallable$5 = aCallable$8;
1973
+ var NATIVE_BIND = functionBindNative;
1974
+
1975
+ var bind$4 = uncurryThis$5(uncurryThis$5.bind);
1976
+
1977
+ // optional / simple context binding
1978
+ var functionBindContext = function (fn, that) {
1979
+ aCallable$5(fn);
1980
+ return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
1981
+ return fn.apply(that, arguments);
1982
+ };
1983
+ };
1984
+
1985
+ var uncurryThis$4 = functionUncurryThis;
1986
+
1987
+ var arraySlice$1 = uncurryThis$4([].slice);
1988
+
1989
+ var $TypeError$3 = TypeError;
1990
+
1991
+ var validateArgumentsLength$1 = function (passed, required) {
1992
+ if (passed < required) throw new $TypeError$3('Not enough arguments');
1993
+ return passed;
1994
+ };
1995
+
1996
+ var userAgent$2 = environmentUserAgent;
1997
+
1998
+ // eslint-disable-next-line redos/no-vulnerable -- safe
1999
+ var environmentIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
2000
+
2001
+ var globalThis$8 = globalThis_1;
2002
+ var apply = functionApply;
2003
+ var bind$3 = functionBindContext;
2004
+ var isCallable$4 = isCallable$l;
2005
+ var hasOwn$1 = hasOwnProperty_1;
2006
+ var fails$2 = fails$g;
2007
+ var html = html$2;
2008
+ var arraySlice = arraySlice$1;
2009
+ var createElement = documentCreateElement$2;
2010
+ var validateArgumentsLength = validateArgumentsLength$1;
2011
+ var IS_IOS$1 = environmentIsIos;
2012
+ var IS_NODE$2 = environmentIsNode;
2013
+
2014
+ var set = globalThis$8.setImmediate;
2015
+ var clear = globalThis$8.clearImmediate;
2016
+ var process$2 = globalThis$8.process;
2017
+ var Dispatch = globalThis$8.Dispatch;
2018
+ var Function$1 = globalThis$8.Function;
2019
+ var MessageChannel = globalThis$8.MessageChannel;
2020
+ var String$1 = globalThis$8.String;
2021
+ var counter = 0;
2022
+ var queue$2 = {};
2023
+ var ONREADYSTATECHANGE = 'onreadystatechange';
2024
+ var $location, defer, channel, port;
2025
+
2026
+ fails$2(function () {
2027
+ // Deno throws a ReferenceError on `location` access without `--location` flag
2028
+ $location = globalThis$8.location;
2029
+ });
2030
+
2031
+ var run = function (id) {
2032
+ if (hasOwn$1(queue$2, id)) {
2033
+ var fn = queue$2[id];
2034
+ delete queue$2[id];
2035
+ fn();
2036
+ }
2037
+ };
2038
+
2039
+ var runner = function (id) {
2040
+ return function () {
2041
+ run(id);
2042
+ };
2043
+ };
2044
+
2045
+ var eventListener = function (event) {
2046
+ run(event.data);
2047
+ };
2048
+
2049
+ var globalPostMessageDefer = function (id) {
2050
+ // old engines have not location.origin
2051
+ globalThis$8.postMessage(String$1(id), $location.protocol + '//' + $location.host);
2052
+ };
2053
+
2054
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
2055
+ if (!set || !clear) {
2056
+ set = function setImmediate(handler) {
2057
+ validateArgumentsLength(arguments.length, 1);
2058
+ var fn = isCallable$4(handler) ? handler : Function$1(handler);
2059
+ var args = arraySlice(arguments, 1);
2060
+ queue$2[++counter] = function () {
2061
+ apply(fn, undefined, args);
2062
+ };
2063
+ defer(counter);
2064
+ return counter;
2065
+ };
2066
+ clear = function clearImmediate(id) {
2067
+ delete queue$2[id];
2068
+ };
2069
+ // Node.js 0.8-
2070
+ if (IS_NODE$2) {
2071
+ defer = function (id) {
2072
+ process$2.nextTick(runner(id));
2073
+ };
2074
+ // Sphere (JS game engine) Dispatch API
2075
+ } else if (Dispatch && Dispatch.now) {
2076
+ defer = function (id) {
2077
+ Dispatch.now(runner(id));
2078
+ };
2079
+ // Browsers with MessageChannel, includes WebWorkers
2080
+ // except iOS - https://github.com/zloirock/core-js/issues/624
2081
+ } else if (MessageChannel && !IS_IOS$1) {
2082
+ channel = new MessageChannel();
2083
+ port = channel.port2;
2084
+ channel.port1.onmessage = eventListener;
2085
+ defer = bind$3(port.postMessage, port);
2086
+ // Browsers with postMessage, skip WebWorkers
2087
+ // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
2088
+ } else if (
2089
+ globalThis$8.addEventListener &&
2090
+ isCallable$4(globalThis$8.postMessage) &&
2091
+ !globalThis$8.importScripts &&
2092
+ $location && $location.protocol !== 'file:' &&
2093
+ !fails$2(globalPostMessageDefer)
2094
+ ) {
2095
+ defer = globalPostMessageDefer;
2096
+ globalThis$8.addEventListener('message', eventListener, false);
2097
+ // IE8-
2098
+ } else if (ONREADYSTATECHANGE in createElement('script')) {
2099
+ defer = function (id) {
2100
+ html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
2101
+ html.removeChild(this);
2102
+ run(id);
2103
+ };
2104
+ };
2105
+ // Rest old browsers
2106
+ } else {
2107
+ defer = function (id) {
2108
+ setTimeout(runner(id), 0);
2109
+ };
2110
+ }
2111
+ }
2112
+
2113
+ var task$1 = {
2114
+ set: set};
2115
+
2116
+ var globalThis$7 = globalThis_1;
2117
+ var DESCRIPTORS$1 = descriptors;
2118
+
2119
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2120
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
2121
+
2122
+ // Avoid NodeJS experimental warning
2123
+ var safeGetBuiltIn$1 = function (name) {
2124
+ if (!DESCRIPTORS$1) return globalThis$7[name];
2125
+ var descriptor = getOwnPropertyDescriptor(globalThis$7, name);
2126
+ return descriptor && descriptor.value;
2127
+ };
2128
+
2129
+ var Queue$2 = function () {
2130
+ this.head = null;
2131
+ this.tail = null;
2132
+ };
2133
+
2134
+ Queue$2.prototype = {
2135
+ add: function (item) {
2136
+ var entry = { item: item, next: null };
2137
+ var tail = this.tail;
2138
+ if (tail) tail.next = entry;
2139
+ else this.head = entry;
2140
+ this.tail = entry;
2141
+ },
2142
+ get: function () {
2143
+ var entry = this.head;
2144
+ if (entry) {
2145
+ var next = this.head = entry.next;
2146
+ if (next === null) this.tail = null;
2147
+ return entry.item;
2148
+ }
2149
+ }
2150
+ };
2151
+
2152
+ var queue$1 = Queue$2;
2153
+
2154
+ var userAgent$1 = environmentUserAgent;
2155
+
2156
+ var environmentIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && typeof Pebble != 'undefined';
2157
+
2158
+ var userAgent = environmentUserAgent;
2159
+
2160
+ var environmentIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
2161
+
2162
+ var globalThis$6 = globalThis_1;
2163
+ var safeGetBuiltIn = safeGetBuiltIn$1;
2164
+ var bind$2 = functionBindContext;
2165
+ var macrotask = task$1.set;
2166
+ var Queue$1 = queue$1;
2167
+ var IS_IOS = environmentIsIos;
2168
+ var IS_IOS_PEBBLE = environmentIsIosPebble;
2169
+ var IS_WEBOS_WEBKIT = environmentIsWebosWebkit;
2170
+ var IS_NODE$1 = environmentIsNode;
2171
+
2172
+ var MutationObserver = globalThis$6.MutationObserver || globalThis$6.WebKitMutationObserver;
2173
+ var document$2 = globalThis$6.document;
2174
+ var process$1 = globalThis$6.process;
2175
+ var Promise$1 = globalThis$6.Promise;
2176
+ var microtask$1 = safeGetBuiltIn('queueMicrotask');
2177
+ var notify$1, toggle, node, promise, then;
2178
+
2179
+ // modern engines have queueMicrotask method
2180
+ if (!microtask$1) {
2181
+ var queue = new Queue$1();
2182
+
2183
+ var flush = function () {
2184
+ var parent, fn;
2185
+ if (IS_NODE$1 && (parent = process$1.domain)) parent.exit();
2186
+ while (fn = queue.get()) try {
2187
+ fn();
2188
+ } catch (error) {
2189
+ if (queue.head) notify$1();
2190
+ throw error;
2191
+ }
2192
+ if (parent) parent.enter();
2193
+ };
2194
+
2195
+ // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
2196
+ // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
2197
+ if (!IS_IOS && !IS_NODE$1 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
2198
+ toggle = true;
2199
+ node = document$2.createTextNode('');
2200
+ new MutationObserver(flush).observe(node, { characterData: true });
2201
+ notify$1 = function () {
2202
+ node.data = toggle = !toggle;
2203
+ };
2204
+ // environments with maybe non-completely correct, but existent Promise
2205
+ } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
2206
+ // Promise.resolve without an argument throws an error in LG WebOS 2
2207
+ promise = Promise$1.resolve(undefined);
2208
+ // workaround of WebKit ~ iOS Safari 10.1 bug
2209
+ promise.constructor = Promise$1;
2210
+ then = bind$2(promise.then, promise);
2211
+ notify$1 = function () {
2212
+ then(flush);
2213
+ };
2214
+ // Node.js without promises
2215
+ } else if (IS_NODE$1) {
2216
+ notify$1 = function () {
2217
+ process$1.nextTick(flush);
2218
+ };
2219
+ // for other environments - macrotask based on:
2220
+ // - setImmediate
2221
+ // - MessageChannel
2222
+ // - window.postMessage
2223
+ // - onreadystatechange
2224
+ // - setTimeout
2225
+ } else {
2226
+ // `webpack` dev server bug on IE global methods - use bind(fn, global)
2227
+ macrotask = bind$2(macrotask, globalThis$6);
2228
+ notify$1 = function () {
2229
+ macrotask(flush);
2230
+ };
2231
+ }
2232
+
2233
+ microtask$1 = function (fn) {
2234
+ if (!queue.head) notify$1();
2235
+ queue.add(fn);
2236
+ };
2237
+ }
2238
+
2239
+ var microtask_1 = microtask$1;
2240
+
2241
+ var hostReportErrors$1 = function (a, b) {
2242
+ try {
2243
+ // eslint-disable-next-line no-console -- safe
2244
+ arguments.length === 1 ? console.error(a) : console.error(a, b);
2245
+ } catch (error) { /* empty */ }
2246
+ };
2247
+
2248
+ var perform$3 = function (exec) {
2249
+ try {
2250
+ return { error: false, value: exec() };
2251
+ } catch (error) {
2252
+ return { error: true, value: error };
2253
+ }
2254
+ };
2255
+
2256
+ var globalThis$5 = globalThis_1;
2257
+
2258
+ var promiseNativeConstructor = globalThis$5.Promise;
2259
+
2260
+ var globalThis$4 = globalThis_1;
2261
+ var NativePromiseConstructor$3 = promiseNativeConstructor;
2262
+ var isCallable$3 = isCallable$l;
2263
+ var isForced = isForced_1;
2264
+ var inspectSource = inspectSource$3;
2265
+ var wellKnownSymbol$4 = wellKnownSymbol$e;
2266
+ var ENVIRONMENT = environment;
2267
+ var V8_VERSION = environmentV8Version;
2268
+
2269
+ NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
2270
+ var SPECIES = wellKnownSymbol$4('species');
2271
+ var SUBCLASSING = false;
2272
+ var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$3(globalThis$4.PromiseRejectionEvent);
2273
+
2274
+ var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
2275
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
2276
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
2277
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
2278
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
2279
+ // We can't detect it synchronously, so just check versions
2280
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
2281
+ // We can't use @@species feature detection in V8 since it causes
2282
+ // deoptimization and performance degradation
2283
+ // https://github.com/zloirock/core-js/issues/679
2284
+ if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
2285
+ // Detect correctness of subclassing with @@species support
2286
+ var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
2287
+ var FakePromise = function (exec) {
2288
+ exec(function () { /* empty */ }, function () { /* empty */ });
2289
+ };
2290
+ var constructor = promise.constructor = {};
2291
+ constructor[SPECIES] = FakePromise;
2292
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
2293
+ if (!SUBCLASSING) return true;
2294
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
2295
+ } return !GLOBAL_CORE_JS_PROMISE && (ENVIRONMENT === 'BROWSER' || ENVIRONMENT === 'DENO') && !NATIVE_PROMISE_REJECTION_EVENT$1;
2296
+ });
2297
+
2298
+ var promiseConstructorDetection = {
2299
+ CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
2300
+ REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
2301
+ SUBCLASSING: SUBCLASSING
2302
+ };
2303
+
2304
+ var newPromiseCapability$2 = {};
2305
+
2306
+ var aCallable$4 = aCallable$8;
2307
+
2308
+ var $TypeError$2 = TypeError;
2309
+
2310
+ var PromiseCapability = function (C) {
2311
+ var resolve, reject;
2312
+ this.promise = new C(function ($$resolve, $$reject) {
2313
+ if (resolve !== undefined || reject !== undefined) throw new $TypeError$2('Bad Promise constructor');
2314
+ resolve = $$resolve;
2315
+ reject = $$reject;
2316
+ });
2317
+ this.resolve = aCallable$4(resolve);
2318
+ this.reject = aCallable$4(reject);
2319
+ };
2320
+
2321
+ // `NewPromiseCapability` abstract operation
2322
+ // https://tc39.es/ecma262/#sec-newpromisecapability
2323
+ newPromiseCapability$2.f = function (C) {
2324
+ return new PromiseCapability(C);
2325
+ };
2326
+
2327
+ var $$8 = _export;
2328
+ var IS_NODE = environmentIsNode;
2329
+ var globalThis$3 = globalThis_1;
2330
+ var path = path$1;
2331
+ var call$5 = functionCall;
2332
+ var defineBuiltIn$1 = defineBuiltIn$5;
2333
+ var setPrototypeOf = objectSetPrototypeOf;
2334
+ var setToStringTag$1 = setToStringTag$4;
2335
+ var setSpecies = setSpecies$1;
2336
+ var aCallable$3 = aCallable$8;
2337
+ var isCallable$2 = isCallable$l;
2338
+ var isObject$1 = isObject$c;
2339
+ var anInstance = anInstance$1;
2340
+ var speciesConstructor = speciesConstructor$1;
2341
+ var task = task$1.set;
2342
+ var microtask = microtask_1;
2343
+ var hostReportErrors = hostReportErrors$1;
2344
+ var perform$2 = perform$3;
2345
+ var Queue = queue$1;
2346
+ var InternalStateModule = internalState;
2347
+ var NativePromiseConstructor$2 = promiseNativeConstructor;
2348
+ var PromiseConstructorDetection = promiseConstructorDetection;
2349
+ var newPromiseCapabilityModule$3 = newPromiseCapability$2;
2350
+
2351
+ var PROMISE = 'Promise';
2352
+ var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
2353
+ var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
2354
+ var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
2355
+ var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
2356
+ var setInternalState = InternalStateModule.set;
2357
+ var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
2358
+ var PromiseConstructor = NativePromiseConstructor$2;
2359
+ var PromisePrototype = NativePromisePrototype$1;
2360
+ var TypeError$1 = globalThis$3.TypeError;
2361
+ var document$1 = globalThis$3.document;
2362
+ var process = globalThis$3.process;
2363
+ var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
2364
+ var newGenericPromiseCapability = newPromiseCapability$1;
2365
+
2366
+ var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && globalThis$3.dispatchEvent);
2367
+ var UNHANDLED_REJECTION = 'unhandledrejection';
2368
+ var REJECTION_HANDLED = 'rejectionhandled';
2369
+ var PENDING = 0;
2370
+ var FULFILLED = 1;
2371
+ var REJECTED = 2;
2372
+ var HANDLED = 1;
2373
+ var UNHANDLED = 2;
2374
+
2375
+ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
2376
+
2377
+ // helpers
2378
+ var isThenable = function (it) {
2379
+ var then;
2380
+ return isObject$1(it) && isCallable$2(then = it.then) ? then : false;
2381
+ };
2382
+
2383
+ var callReaction = function (reaction, state) {
2384
+ var value = state.value;
2385
+ var ok = state.state === FULFILLED;
2386
+ var handler = ok ? reaction.ok : reaction.fail;
2387
+ var resolve = reaction.resolve;
2388
+ var reject = reaction.reject;
2389
+ var domain = reaction.domain;
2390
+ var result, then, exited;
2391
+ try {
2392
+ if (handler) {
2393
+ if (!ok) {
2394
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
2395
+ state.rejection = HANDLED;
2396
+ }
2397
+ if (handler === true) result = value;
2398
+ else {
2399
+ if (domain) domain.enter();
2400
+ result = handler(value); // can throw
2401
+ if (domain) {
2402
+ domain.exit();
2403
+ exited = true;
2404
+ }
2405
+ }
2406
+ if (result === reaction.promise) {
2407
+ reject(new TypeError$1('Promise-chain cycle'));
2408
+ } else if (then = isThenable(result)) {
2409
+ call$5(then, result, resolve, reject);
2410
+ } else resolve(result);
2411
+ } else reject(value);
2412
+ } catch (error) {
2413
+ if (domain && !exited) domain.exit();
2414
+ reject(error);
2415
+ }
2416
+ };
2417
+
2418
+ var notify = function (state, isReject) {
2419
+ if (state.notified) return;
2420
+ state.notified = true;
2421
+ microtask(function () {
2422
+ var reactions = state.reactions;
2423
+ var reaction;
2424
+ while (reaction = reactions.get()) {
2425
+ callReaction(reaction, state);
2426
+ }
2427
+ state.notified = false;
2428
+ if (isReject && !state.rejection) onUnhandled(state);
2429
+ });
2430
+ };
2431
+
2432
+ var dispatchEvent = function (name, promise, reason) {
2433
+ var event, handler;
2434
+ if (DISPATCH_EVENT) {
2435
+ event = document$1.createEvent('Event');
2436
+ event.promise = promise;
2437
+ event.reason = reason;
2438
+ event.initEvent(name, false, true);
2439
+ globalThis$3.dispatchEvent(event);
2440
+ } else event = { promise: promise, reason: reason };
2441
+ if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = globalThis$3['on' + name])) handler(event);
2442
+ else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
2443
+ };
2444
+
2445
+ var onUnhandled = function (state) {
2446
+ call$5(task, globalThis$3, function () {
2447
+ var promise = state.facade;
2448
+ var value = state.value;
2449
+ var IS_UNHANDLED = isUnhandled(state);
2450
+ var result;
2451
+ if (IS_UNHANDLED) {
2452
+ result = perform$2(function () {
2453
+ if (IS_NODE) {
2454
+ process.emit('unhandledRejection', value, promise);
2455
+ } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
2456
+ });
2457
+ // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
2458
+ state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
2459
+ if (result.error) throw result.value;
2460
+ }
2461
+ });
2462
+ };
2463
+
2464
+ var isUnhandled = function (state) {
2465
+ return state.rejection !== HANDLED && !state.parent;
2466
+ };
2467
+
2468
+ var onHandleUnhandled = function (state) {
2469
+ call$5(task, globalThis$3, function () {
2470
+ var promise = state.facade;
2471
+ if (IS_NODE) {
2472
+ process.emit('rejectionHandled', promise);
2473
+ } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
2474
+ });
2475
+ };
2476
+
2477
+ var bind$1 = function (fn, state, unwrap) {
2478
+ return function (value) {
2479
+ fn(state, value, unwrap);
2480
+ };
2481
+ };
2482
+
2483
+ var internalReject = function (state, value, unwrap) {
2484
+ if (state.done) return;
2485
+ state.done = true;
2486
+ if (unwrap) state = unwrap;
2487
+ state.value = value;
2488
+ state.state = REJECTED;
2489
+ notify(state, true);
2490
+ };
2491
+
2492
+ var internalResolve = function (state, value, unwrap) {
2493
+ if (state.done) return;
2494
+ state.done = true;
2495
+ if (unwrap) state = unwrap;
2496
+ try {
2497
+ if (state.facade === value) throw new TypeError$1("Promise can't be resolved itself");
2498
+ var then = isThenable(value);
2499
+ if (then) {
2500
+ microtask(function () {
2501
+ var wrapper = { done: false };
2502
+ try {
2503
+ call$5(then, value,
2504
+ bind$1(internalResolve, wrapper, state),
2505
+ bind$1(internalReject, wrapper, state)
2506
+ );
2507
+ } catch (error) {
2508
+ internalReject(wrapper, error, state);
2509
+ }
2510
+ });
2511
+ } else {
2512
+ state.value = value;
2513
+ state.state = FULFILLED;
2514
+ notify(state, false);
2515
+ }
2516
+ } catch (error) {
2517
+ internalReject({ done: false }, error, state);
2518
+ }
2519
+ };
2520
+
2521
+ // constructor polyfill
2522
+ if (FORCED_PROMISE_CONSTRUCTOR$4) {
2523
+ // 25.4.3.1 Promise(executor)
2524
+ PromiseConstructor = function Promise(executor) {
2525
+ anInstance(this, PromisePrototype);
2526
+ aCallable$3(executor);
2527
+ call$5(Internal, this);
2528
+ var state = getInternalPromiseState(this);
2529
+ try {
2530
+ executor(bind$1(internalResolve, state), bind$1(internalReject, state));
2531
+ } catch (error) {
2532
+ internalReject(state, error);
2533
+ }
2534
+ };
2535
+
2536
+ PromisePrototype = PromiseConstructor.prototype;
2537
+
2538
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
2539
+ Internal = function Promise(executor) {
2540
+ setInternalState(this, {
2541
+ type: PROMISE,
2542
+ done: false,
2543
+ notified: false,
2544
+ parent: false,
2545
+ reactions: new Queue(),
2546
+ rejection: false,
2547
+ state: PENDING,
2548
+ value: null
2549
+ });
2550
+ };
2551
+
2552
+ // `Promise.prototype.then` method
2553
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
2554
+ Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
2555
+ var state = getInternalPromiseState(this);
2556
+ var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
2557
+ state.parent = true;
2558
+ reaction.ok = isCallable$2(onFulfilled) ? onFulfilled : true;
2559
+ reaction.fail = isCallable$2(onRejected) && onRejected;
2560
+ reaction.domain = IS_NODE ? process.domain : undefined;
2561
+ if (state.state === PENDING) state.reactions.add(reaction);
2562
+ else microtask(function () {
2563
+ callReaction(reaction, state);
2564
+ });
2565
+ return reaction.promise;
2566
+ });
2567
+
2568
+ OwnPromiseCapability = function () {
2569
+ var promise = new Internal();
2570
+ var state = getInternalPromiseState(promise);
2571
+ this.promise = promise;
2572
+ this.resolve = bind$1(internalResolve, state);
2573
+ this.reject = bind$1(internalReject, state);
2574
+ };
2575
+
2576
+ newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
2577
+ return C === PromiseConstructor || C === PromiseWrapper
2578
+ ? new OwnPromiseCapability(C)
2579
+ : newGenericPromiseCapability(C);
2580
+ };
2581
+
2582
+ if (isCallable$2(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
2583
+ nativeThen = NativePromisePrototype$1.then;
2584
+
2585
+ if (!NATIVE_PROMISE_SUBCLASSING) {
2586
+ // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
2587
+ defineBuiltIn$1(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
2588
+ var that = this;
2589
+ return new PromiseConstructor(function (resolve, reject) {
2590
+ call$5(nativeThen, that, resolve, reject);
2591
+ }).then(onFulfilled, onRejected);
2592
+ // https://github.com/zloirock/core-js/issues/640
2593
+ }, { unsafe: true });
2594
+ }
2595
+
2596
+ // make `.constructor === Promise` work for native promise-based APIs
2597
+ try {
2598
+ delete NativePromisePrototype$1.constructor;
2599
+ } catch (error) { /* empty */ }
2600
+
2601
+ // make `instanceof Promise` work for native promise-based APIs
2602
+ if (setPrototypeOf) {
2603
+ setPrototypeOf(NativePromisePrototype$1, PromisePrototype);
2604
+ }
2605
+ }
2606
+ }
2607
+
2608
+ // `Promise` constructor
2609
+ // https://tc39.es/ecma262/#sec-promise-executor
2610
+ $$8({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
2611
+ Promise: PromiseConstructor
2612
+ });
2613
+
2614
+ PromiseWrapper = path.Promise;
2615
+
2616
+ setToStringTag$1(PromiseConstructor, PROMISE, false);
2617
+ setSpecies(PROMISE);
2618
+
2619
+ var wellKnownSymbol$3 = wellKnownSymbol$e;
2620
+ var Iterators$1 = iterators;
2621
+
2622
+ var ITERATOR$3 = wellKnownSymbol$3('iterator');
2623
+ var ArrayPrototype = Array.prototype;
2624
+
2625
+ // check on default Array iterator
2626
+ var isArrayIteratorMethod$1 = function (it) {
2627
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$3] === it);
2628
+ };
2629
+
2630
+ var classof = classof$4;
2631
+ var getMethod$1 = getMethod$3;
2632
+ var isNullOrUndefined = isNullOrUndefined$4;
2633
+ var Iterators = iterators;
2634
+ var wellKnownSymbol$2 = wellKnownSymbol$e;
2635
+
2636
+ var ITERATOR$2 = wellKnownSymbol$2('iterator');
2637
+
2638
+ var getIteratorMethod$2 = function (it) {
2639
+ if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR$2)
2640
+ || getMethod$1(it, '@@iterator')
2641
+ || Iterators[classof(it)];
2642
+ };
2643
+
2644
+ var call$4 = functionCall;
2645
+ var aCallable$2 = aCallable$8;
2646
+ var anObject$3 = anObject$9;
2647
+ var tryToString$1 = tryToString$4;
2648
+ var getIteratorMethod$1 = getIteratorMethod$2;
2649
+
2650
+ var $TypeError$1 = TypeError;
2651
+
2652
+ var getIterator$1 = function (argument, usingIterator) {
2653
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
2654
+ if (aCallable$2(iteratorMethod)) return anObject$3(call$4(iteratorMethod, argument));
2655
+ throw new $TypeError$1(tryToString$1(argument) + ' is not iterable');
2656
+ };
2657
+
2658
+ var call$3 = functionCall;
2659
+ var anObject$2 = anObject$9;
2660
+ var getMethod = getMethod$3;
2661
+
2662
+ var iteratorClose$1 = function (iterator, kind, value) {
2663
+ var innerResult, innerError;
2664
+ anObject$2(iterator);
2665
+ try {
2666
+ innerResult = getMethod(iterator, 'return');
2667
+ if (!innerResult) {
2668
+ if (kind === 'throw') throw value;
2669
+ return value;
2670
+ }
2671
+ innerResult = call$3(innerResult, iterator);
2672
+ } catch (error) {
2673
+ innerError = true;
2674
+ innerResult = error;
2675
+ }
2676
+ if (kind === 'throw') throw value;
2677
+ if (innerError) throw innerResult;
2678
+ anObject$2(innerResult);
2679
+ return value;
2680
+ };
2681
+
2682
+ var bind = functionBindContext;
2683
+ var call$2 = functionCall;
2684
+ var anObject$1 = anObject$9;
2685
+ var tryToString = tryToString$4;
2686
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
2687
+ var lengthOfArrayLike = lengthOfArrayLike$2;
2688
+ var isPrototypeOf$1 = objectIsPrototypeOf;
2689
+ var getIterator = getIterator$1;
2690
+ var getIteratorMethod = getIteratorMethod$2;
2691
+ var iteratorClose = iteratorClose$1;
2692
+
2693
+ var $TypeError = TypeError;
2694
+
2695
+ var Result = function (stopped, result) {
2696
+ this.stopped = stopped;
2697
+ this.result = result;
2698
+ };
2699
+
2700
+ var ResultPrototype = Result.prototype;
2701
+
2702
+ var iterate$2 = function (iterable, unboundFunction, options) {
2703
+ var that = options && options.that;
2704
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2705
+ var IS_RECORD = !!(options && options.IS_RECORD);
2706
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2707
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
2708
+ var fn = bind(unboundFunction, that);
2709
+ var iterator, iterFn, index, length, result, next, step;
2710
+
2711
+ var stop = function (condition) {
2712
+ if (iterator) iteratorClose(iterator, 'normal');
2713
+ return new Result(true, condition);
2714
+ };
2715
+
2716
+ var callFn = function (value) {
2717
+ if (AS_ENTRIES) {
2718
+ anObject$1(value);
2719
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2720
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
2721
+ };
2722
+
2723
+ if (IS_RECORD) {
2724
+ iterator = iterable.iterator;
2725
+ } else if (IS_ITERATOR) {
2726
+ iterator = iterable;
2727
+ } else {
2728
+ iterFn = getIteratorMethod(iterable);
2729
+ if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
2730
+ // optimisation for array iterators
2731
+ if (isArrayIteratorMethod(iterFn)) {
2732
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2733
+ result = callFn(iterable[index]);
2734
+ if (result && isPrototypeOf$1(ResultPrototype, result)) return result;
2735
+ } return new Result(false);
2736
+ }
2737
+ iterator = getIterator(iterable, iterFn);
2738
+ }
2739
+
2740
+ next = IS_RECORD ? iterable.next : iterator.next;
2741
+ while (!(step = call$2(next, iterator)).done) {
2742
+ try {
2743
+ result = callFn(step.value);
2744
+ } catch (error) {
2745
+ iteratorClose(iterator, 'throw', error);
2746
+ }
2747
+ if (typeof result == 'object' && result && isPrototypeOf$1(ResultPrototype, result)) return result;
2748
+ } return new Result(false);
2749
+ };
2750
+
2751
+ var wellKnownSymbol$1 = wellKnownSymbol$e;
2752
+
2753
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
2754
+ var SAFE_CLOSING = false;
2755
+
2756
+ try {
2757
+ var called = 0;
2758
+ var iteratorWithReturn = {
2759
+ next: function () {
2760
+ return { done: !!called++ };
2761
+ },
2762
+ 'return': function () {
2763
+ SAFE_CLOSING = true;
2764
+ }
2765
+ };
2766
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
2767
+ iteratorWithReturn[ITERATOR$1] = function () {
2768
+ return this;
2769
+ };
2770
+ // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2771
+ Array.from(iteratorWithReturn, function () { throw 2; });
2772
+ } catch (error) { /* empty */ }
2773
+
2774
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
2775
+ try {
2776
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2777
+ } catch (error) { return false; } // workaround of old WebKit + `eval` bug
2778
+ var ITERATION_SUPPORT = false;
2779
+ try {
2780
+ var object = {};
2781
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
2782
+ object[ITERATOR$1] = function () {
2783
+ return {
2784
+ next: function () {
2785
+ return { done: ITERATION_SUPPORT = true };
2786
+ }
2787
+ };
2788
+ };
2789
+ exec(object);
2790
+ } catch (error) { /* empty */ }
2791
+ return ITERATION_SUPPORT;
2792
+ };
2793
+
2794
+ var NativePromiseConstructor$1 = promiseNativeConstructor;
2795
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
2796
+ var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
2797
+
2798
+ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
2799
+ NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
2800
+ });
2801
+
2802
+ var $$7 = _export;
2803
+ var call$1 = functionCall;
2804
+ var aCallable$1 = aCallable$8;
2805
+ var newPromiseCapabilityModule$2 = newPromiseCapability$2;
2806
+ var perform$1 = perform$3;
2807
+ var iterate$1 = iterate$2;
2808
+ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
2809
+
2810
+ // `Promise.all` method
2811
+ // https://tc39.es/ecma262/#sec-promise.all
2812
+ $$7({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2813
+ all: function all(iterable) {
2814
+ var C = this;
2815
+ var capability = newPromiseCapabilityModule$2.f(C);
2816
+ var resolve = capability.resolve;
2817
+ var reject = capability.reject;
2818
+ var result = perform$1(function () {
2819
+ var $promiseResolve = aCallable$1(C.resolve);
2820
+ var values = [];
2821
+ var counter = 0;
2822
+ var remaining = 1;
2823
+ iterate$1(iterable, function (promise) {
2824
+ var index = counter++;
2825
+ var alreadyCalled = false;
2826
+ remaining++;
2827
+ call$1($promiseResolve, C, promise).then(function (value) {
2828
+ if (alreadyCalled) return;
2829
+ alreadyCalled = true;
2830
+ values[index] = value;
2831
+ --remaining || resolve(values);
2832
+ }, reject);
2833
+ });
2834
+ --remaining || resolve(values);
2835
+ });
2836
+ if (result.error) reject(result.value);
2837
+ return capability.promise;
2838
+ }
2839
+ });
2840
+
2841
+ var $$6 = _export;
2842
+ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2843
+ var NativePromiseConstructor = promiseNativeConstructor;
2844
+ var getBuiltIn$1 = getBuiltIn$8;
2845
+ var isCallable$1 = isCallable$l;
2846
+ var defineBuiltIn = defineBuiltIn$5;
2847
+
2848
+ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
2849
+
2850
+ // `Promise.prototype.catch` method
2851
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
2852
+ $$6({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2853
+ 'catch': function (onRejected) {
2854
+ return this.then(undefined, onRejected);
2855
+ }
2856
+ });
2857
+
2858
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
2859
+ if (isCallable$1(NativePromiseConstructor)) {
2860
+ var method = getBuiltIn$1('Promise').prototype['catch'];
2861
+ if (NativePromisePrototype['catch'] !== method) {
2862
+ defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
2863
+ }
2864
+ }
2865
+
2866
+ var $$5 = _export;
2867
+ var call = functionCall;
2868
+ var aCallable = aCallable$8;
2869
+ var newPromiseCapabilityModule$1 = newPromiseCapability$2;
2870
+ var perform = perform$3;
2871
+ var iterate = iterate$2;
2872
+ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
2873
+
2874
+ // `Promise.race` method
2875
+ // https://tc39.es/ecma262/#sec-promise.race
2876
+ $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2877
+ race: function race(iterable) {
2878
+ var C = this;
2879
+ var capability = newPromiseCapabilityModule$1.f(C);
2880
+ var reject = capability.reject;
2881
+ var result = perform(function () {
2882
+ var $promiseResolve = aCallable(C.resolve);
2883
+ iterate(iterable, function (promise) {
2884
+ call($promiseResolve, C, promise).then(capability.resolve, reject);
2885
+ });
2886
+ });
2887
+ if (result.error) reject(result.value);
2888
+ return capability.promise;
2889
+ }
2890
+ });
2891
+
2892
+ var $$4 = _export;
2893
+ var newPromiseCapabilityModule = newPromiseCapability$2;
2894
+ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2895
+
2896
+ // `Promise.reject` method
2897
+ // https://tc39.es/ecma262/#sec-promise.reject
2898
+ $$4({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2899
+ reject: function reject(r) {
2900
+ var capability = newPromiseCapabilityModule.f(this);
2901
+ var capabilityReject = capability.reject;
2902
+ capabilityReject(r);
2903
+ return capability.promise;
2904
+ }
2905
+ });
2906
+
2907
+ var anObject = anObject$9;
2908
+ var isObject = isObject$c;
2909
+ var newPromiseCapability = newPromiseCapability$2;
2910
+
2911
+ var promiseResolve$1 = function (C, x) {
2912
+ anObject(C);
2913
+ if (isObject(x) && x.constructor === C) return x;
2914
+ var promiseCapability = newPromiseCapability.f(C);
2915
+ var resolve = promiseCapability.resolve;
2916
+ resolve(x);
2917
+ return promiseCapability.promise;
2918
+ };
2919
+
2920
+ var $$3 = _export;
2921
+ var getBuiltIn = getBuiltIn$8;
2922
+ var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2923
+ var promiseResolve = promiseResolve$1;
2924
+
2925
+ getBuiltIn('Promise');
2926
+
2927
+ // `Promise.resolve` method
2928
+ // https://tc39.es/ecma262/#sec-promise.resolve
2929
+ $$3({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2930
+ resolve: function resolve(x) {
2931
+ return promiseResolve(this, x);
2932
+ }
2933
+ });
2934
+
2935
+ // iterable DOM collections
2936
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2937
+ var domIterables = {
2938
+ CSSRuleList: 0,
2939
+ CSSStyleDeclaration: 0,
2940
+ CSSValueList: 0,
2941
+ ClientRectList: 0,
2942
+ DOMRectList: 0,
2943
+ DOMStringList: 0,
2944
+ DOMTokenList: 1,
2945
+ DataTransferItemList: 0,
2946
+ FileList: 0,
2947
+ HTMLAllCollection: 0,
2948
+ HTMLCollection: 0,
2949
+ HTMLFormElement: 0,
2950
+ HTMLSelectElement: 0,
2951
+ MediaList: 0,
2952
+ MimeTypeArray: 0,
2953
+ NamedNodeMap: 0,
2954
+ NodeList: 1,
2955
+ PaintRequestList: 0,
2956
+ Plugin: 0,
2957
+ PluginArray: 0,
2958
+ SVGLengthList: 0,
2959
+ SVGNumberList: 0,
2960
+ SVGPathSegList: 0,
2961
+ SVGPointList: 0,
2962
+ SVGStringList: 0,
2963
+ SVGTransformList: 0,
2964
+ SourceBufferList: 0,
2965
+ StyleSheetList: 0,
2966
+ TextTrackCueList: 0,
2967
+ TextTrackList: 0,
2968
+ TouchList: 0
2969
+ };
2970
+
2971
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
2972
+ var documentCreateElement = documentCreateElement$2;
2973
+
2974
+ var classList = documentCreateElement('span').classList;
2975
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
2976
+
2977
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
2978
+
2979
+ var globalThis$2 = globalThis_1;
2980
+ var DOMIterables = domIterables;
2981
+ var DOMTokenListPrototype = domTokenListPrototype;
2982
+ var ArrayIteratorMethods = es_array_iterator;
2983
+ var createNonEnumerableProperty = createNonEnumerableProperty$7;
2984
+ var setToStringTag = setToStringTag$4;
2985
+ var wellKnownSymbol = wellKnownSymbol$e;
2986
+
2987
+ var ITERATOR = wellKnownSymbol('iterator');
2988
+ var ArrayValues = ArrayIteratorMethods.values;
2989
+
2990
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
2991
+ if (CollectionPrototype) {
2992
+ // some Chrome versions have non-configurable methods on DOMTokenList
2993
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
2994
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
2995
+ } catch (error) {
2996
+ CollectionPrototype[ITERATOR] = ArrayValues;
2997
+ }
2998
+ setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
2999
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
3000
+ // some Chrome versions have non-configurable methods on DOMTokenList
3001
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
3002
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
3003
+ } catch (error) {
3004
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
3005
+ }
3006
+ }
3007
+ }
3008
+ };
3009
+
3010
+ for (var COLLECTION_NAME in DOMIterables) {
3011
+ handlePrototype(globalThis$2[COLLECTION_NAME] && globalThis$2[COLLECTION_NAME].prototype, COLLECTION_NAME);
3012
+ }
3013
+
3014
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
3015
+
3016
+ // Create context with undefined default
3017
+ const ZahlenContext = /*#__PURE__*/createContext(undefined);
3018
+ /**
3019
+ * ZahlenProvider - Wrap your app with this provider to use Zahlen hooks
3020
+ *
3021
+ * @example
3022
+ * ```tsx
3023
+ * import { ZahlenProvider } from '@zahlen/checkout-react';
3024
+ *
3025
+ * function App() {
3026
+ * return (
3027
+ * <ZahlenProvider apiKey="pk_live_xxx" theme="dark">
3028
+ * <YourApp />
3029
+ * </ZahlenProvider>
3030
+ * );
3031
+ * }
3032
+ * ```
3033
+ */
3034
+ function ZahlenProvider({
3035
+ apiKey,
3036
+ theme = 'dark',
3037
+ children
3038
+ }) {
3039
+ const [isInitialized, setIsInitialized] = useState(false);
3040
+ const [isProcessing, setIsProcessing] = useState(false);
3041
+ // Initialize Zahlen on mount
3042
+ useEffect(() => {
3043
+ if (apiKey && !isInitialized) {
3044
+ Zahlen.init({
3045
+ apiKey,
3046
+ theme
3047
+ });
3048
+ setIsInitialized(true);
3049
+ }
3050
+ }, [apiKey, theme, isInitialized]);
3051
+ // Open checkout with promise interface
3052
+ const openCheckout = useCallback(options => {
3053
+ return new Promise((resolve, reject) => {
3054
+ setIsProcessing(true);
3055
+ Zahlen.checkout(Object.assign(Object.assign({}, options), {
3056
+ onSuccess: result => {
3057
+ setIsProcessing(false);
3058
+ resolve(result);
3059
+ },
3060
+ onError: error => {
3061
+ setIsProcessing(false);
3062
+ reject(error);
3063
+ },
3064
+ onClose: () => {
3065
+ setIsProcessing(false);
3066
+ }
3067
+ }));
3068
+ });
3069
+ }, []);
3070
+ // Close checkout
3071
+ const closeCheckout = useCallback(() => {
3072
+ Zahlen.closeModal();
3073
+ setIsProcessing(false);
3074
+ }, []);
3075
+ // Set theme
3076
+ const setTheme = useCallback(newTheme => {
3077
+ Zahlen.setTheme(newTheme);
3078
+ }, []);
3079
+ // Memoize context value
3080
+ const value = useMemo(() => ({
3081
+ isInitialized,
3082
+ isProcessing,
3083
+ openCheckout,
3084
+ closeCheckout,
3085
+ setTheme
3086
+ }), [isInitialized, isProcessing, openCheckout, closeCheckout, setTheme]);
3087
+ return jsx(ZahlenContext.Provider, {
3088
+ value: value,
3089
+ children: children
3090
+ });
3091
+ }
3092
+ /**
3093
+ * useZahlen - Hook to access Zahlen checkout functionality
3094
+ *
3095
+ * @example
3096
+ * ```tsx
3097
+ * import { useZahlen } from '@zahlen/checkout-react';
3098
+ *
3099
+ * function PayButton() {
3100
+ * const { openCheckout, isProcessing } = useZahlen();
3101
+ *
3102
+ * const handlePay = async () => {
3103
+ * try {
3104
+ * const result = await openCheckout({
3105
+ * amount: 4999,
3106
+ * currency: 'NGN',
3107
+ * });
3108
+ * console.log('Paid!', result);
3109
+ * } catch (error) {
3110
+ * console.error('Failed', error);
3111
+ * }
3112
+ * };
3113
+ *
3114
+ * return (
3115
+ * <button onClick={handlePay} disabled={isProcessing}>
3116
+ * {isProcessing ? 'Processing...' : 'Pay Now'}
3117
+ * </button>
3118
+ * );
3119
+ * }
3120
+ * ```
3121
+ */
3122
+ function useZahlen() {
3123
+ const context = useContext(ZahlenContext);
3124
+ if (context === undefined) {
3125
+ throw new Error('useZahlen must be used within a ZahlenProvider');
3126
+ }
3127
+ return context;
3128
+ }
3129
+
3130
+ var $$2 = _export;
3131
+ var DESCRIPTORS = descriptors;
3132
+ var globalThis$1 = globalThis_1;
3133
+ var uncurryThis$3 = functionUncurryThis;
3134
+ var hasOwn = hasOwnProperty_1;
3135
+ var isCallable = isCallable$l;
3136
+ var isPrototypeOf = objectIsPrototypeOf;
3137
+ var toString$2 = toString$4;
3138
+ var defineBuiltInAccessor = defineBuiltInAccessor$2;
3139
+ var copyConstructorProperties = copyConstructorProperties$3;
3140
+
3141
+ var NativeSymbol = globalThis$1.Symbol;
3142
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
3143
+
3144
+ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
3145
+ // Safari 12 bug
3146
+ NativeSymbol().description !== undefined
3147
+ )) {
3148
+ var EmptyStringDescriptionStore = {};
3149
+ // wrap Symbol constructor for correct work with undefined description
3150
+ var SymbolWrapper = function Symbol() {
3151
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$2(arguments[0]);
3152
+ var result = isPrototypeOf(SymbolPrototype, this)
3153
+ // eslint-disable-next-line sonarjs/inconsistent-function-call -- ok
3154
+ ? new NativeSymbol(description)
3155
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
3156
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
3157
+ if (description === '') EmptyStringDescriptionStore[result] = true;
3158
+ return result;
3159
+ };
3160
+
3161
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
3162
+ SymbolWrapper.prototype = SymbolPrototype;
3163
+ SymbolPrototype.constructor = SymbolWrapper;
3164
+
3165
+ var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';
3166
+ var thisSymbolValue = uncurryThis$3(SymbolPrototype.valueOf);
3167
+ var symbolDescriptiveString = uncurryThis$3(SymbolPrototype.toString);
3168
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
3169
+ var replace$1 = uncurryThis$3(''.replace);
3170
+ var stringSlice$1 = uncurryThis$3(''.slice);
3171
+
3172
+ defineBuiltInAccessor(SymbolPrototype, 'description', {
3173
+ configurable: true,
3174
+ get: function description() {
3175
+ var symbol = thisSymbolValue(this);
3176
+ if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
3177
+ var string = symbolDescriptiveString(symbol);
3178
+ var desc = NATIVE_SYMBOL ? stringSlice$1(string, 7, -1) : replace$1(string, regexp, '$1');
3179
+ return desc === '' ? undefined : desc;
3180
+ }
3181
+ });
3182
+
3183
+ $$2({ global: true, constructor: true, forced: true }, {
3184
+ Symbol: SymbolWrapper
3185
+ });
3186
+ }
3187
+
3188
+ var uncurryThis$2 = functionUncurryThis;
3189
+
3190
+ // `thisNumberValue` abstract operation
3191
+ // https://tc39.es/ecma262/#sec-thisnumbervalue
3192
+ var thisNumberValue$1 = uncurryThis$2(1.1.valueOf);
3193
+
3194
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
3195
+ var toString$1 = toString$4;
3196
+ var requireObjectCoercible$1 = requireObjectCoercible$5;
3197
+
3198
+ var $RangeError$1 = RangeError;
3199
+
3200
+ // `String.prototype.repeat` method implementation
3201
+ // https://tc39.es/ecma262/#sec-string.prototype.repeat
3202
+ var stringRepeat = function repeat(count) {
3203
+ var str = toString$1(requireObjectCoercible$1(this));
3204
+ var result = '';
3205
+ var n = toIntegerOrInfinity$1(count);
3206
+ if (n < 0 || n === Infinity) throw new $RangeError$1('Wrong number of repetitions');
3207
+ for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
3208
+ return result;
3209
+ };
3210
+
3211
+ var $$1 = _export;
3212
+ var uncurryThis$1 = functionUncurryThis;
3213
+ var toIntegerOrInfinity = toIntegerOrInfinity$4;
3214
+ var thisNumberValue = thisNumberValue$1;
3215
+ var $repeat = stringRepeat;
3216
+ var fails$1 = fails$g;
3217
+
3218
+ var $RangeError = RangeError;
3219
+ var $String = String;
3220
+ var floor = Math.floor;
3221
+ var repeat = uncurryThis$1($repeat);
3222
+ var stringSlice = uncurryThis$1(''.slice);
3223
+ var nativeToFixed = uncurryThis$1(1.1.toFixed);
3224
+
3225
+ var pow = function (x, n, acc) {
3226
+ return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
3227
+ };
3228
+
3229
+ var log = function (x) {
3230
+ var n = 0;
3231
+ var x2 = x;
3232
+ while (x2 >= 4096) {
3233
+ n += 12;
3234
+ x2 /= 4096;
3235
+ }
3236
+ while (x2 >= 2) {
3237
+ n += 1;
3238
+ x2 /= 2;
3239
+ } return n;
3240
+ };
3241
+
3242
+ var multiply = function (data, n, c) {
3243
+ var index = -1;
3244
+ var c2 = c;
3245
+ while (++index < 6) {
3246
+ c2 += n * data[index];
3247
+ data[index] = c2 % 1e7;
3248
+ c2 = floor(c2 / 1e7);
3249
+ }
3250
+ };
3251
+
3252
+ var divide = function (data, n) {
3253
+ var index = 6;
3254
+ var c = 0;
3255
+ while (--index >= 0) {
3256
+ c += data[index];
3257
+ data[index] = floor(c / n);
3258
+ c = (c % n) * 1e7;
3259
+ }
3260
+ };
3261
+
3262
+ var dataToString = function (data) {
3263
+ var index = 6;
3264
+ var s = '';
3265
+ while (--index >= 0) {
3266
+ if (s !== '' || index === 0 || data[index] !== 0) {
3267
+ var t = $String(data[index]);
3268
+ s = s === '' ? t : s + repeat('0', 7 - t.length) + t;
3269
+ }
3270
+ } return s;
3271
+ };
3272
+
3273
+ var FORCED = fails$1(function () {
3274
+ return nativeToFixed(0.00008, 3) !== '0.000' ||
3275
+ nativeToFixed(0.9, 0) !== '1' ||
3276
+ nativeToFixed(1.255, 2) !== '1.25' ||
3277
+ nativeToFixed(1000000000000000128.0, 0) !== '1000000000000000128';
3278
+ }) || !fails$1(function () {
3279
+ // V8 ~ Android 4.3-
3280
+ nativeToFixed({});
3281
+ });
3282
+
3283
+ // `Number.prototype.toFixed` method
3284
+ // https://tc39.es/ecma262/#sec-number.prototype.tofixed
3285
+ $$1({ target: 'Number', proto: true, forced: FORCED }, {
3286
+ toFixed: function toFixed(fractionDigits) {
3287
+ var number = thisNumberValue(this);
3288
+ var fractDigits = toIntegerOrInfinity(fractionDigits);
3289
+ var data = [0, 0, 0, 0, 0, 0];
3290
+ var sign = '';
3291
+ var result = '0';
3292
+ var e, z, j, k;
3293
+
3294
+ // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation
3295
+ if (fractDigits < 0 || fractDigits > 20) throw new $RangeError('Incorrect fraction digits');
3296
+ // eslint-disable-next-line no-self-compare -- NaN check
3297
+ if (number !== number) return 'NaN';
3298
+ if (number <= -1e21 || number >= 1e21) return $String(number);
3299
+ if (number < 0) {
3300
+ sign = '-';
3301
+ number = -number;
3302
+ }
3303
+ if (number > 1e-21) {
3304
+ e = log(number * pow(2, 69, 1)) - 69;
3305
+ z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
3306
+ z *= 0x10000000000000;
3307
+ e = 52 - e;
3308
+ if (e > 0) {
3309
+ multiply(data, 0, z);
3310
+ j = fractDigits;
3311
+ while (j >= 7) {
3312
+ multiply(data, 1e7, 0);
3313
+ j -= 7;
3314
+ }
3315
+ multiply(data, pow(10, j, 1), 0);
3316
+ j = e - 1;
3317
+ while (j >= 23) {
3318
+ divide(data, 1 << 23);
3319
+ j -= 23;
3320
+ }
3321
+ divide(data, 1 << j);
3322
+ multiply(data, 1, 1);
3323
+ divide(data, 2);
3324
+ result = dataToString(data);
3325
+ } else {
3326
+ multiply(data, 0, z);
3327
+ multiply(data, 1 << -e, 0);
3328
+ result = dataToString(data) + repeat('0', fractDigits);
3329
+ }
3330
+ }
3331
+ if (fractDigits > 0) {
3332
+ k = result.length;
3333
+ result = sign + (k <= fractDigits
3334
+ ? '0.' + repeat('0', fractDigits - k) + result
3335
+ : stringSlice(result, 0, k - fractDigits) + '.' + stringSlice(result, k - fractDigits));
3336
+ } else {
3337
+ result = sign + result;
3338
+ } return result;
3339
+ }
3340
+ });
3341
+
3342
+ // a string of all valid unicode whitespaces
3343
+ var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
3344
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
3345
+
3346
+ var uncurryThis = functionUncurryThis;
3347
+ var requireObjectCoercible = requireObjectCoercible$5;
3348
+ var toString = toString$4;
3349
+ var whitespaces$1 = whitespaces$2;
3350
+
3351
+ var replace = uncurryThis(''.replace);
3352
+ var ltrim = RegExp('^[' + whitespaces$1 + ']+');
3353
+ var rtrim = RegExp('(^|[^' + whitespaces$1 + '])[' + whitespaces$1 + ']+$');
3354
+
3355
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
3356
+ var createMethod = function (TYPE) {
3357
+ return function ($this) {
3358
+ var string = toString(requireObjectCoercible($this));
3359
+ if (TYPE & 1) string = replace(string, ltrim, '');
3360
+ if (TYPE & 2) string = replace(string, rtrim, '$1');
3361
+ return string;
3362
+ };
3363
+ };
3364
+
3365
+ var stringTrim = {
3366
+ // `String.prototype.trim` method
3367
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
3368
+ trim: createMethod(3)
3369
+ };
3370
+
3371
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
3372
+ var fails = fails$g;
3373
+ var whitespaces = whitespaces$2;
3374
+
3375
+ var non = '\u200B\u0085\u180E';
3376
+
3377
+ // check that a method works with the correct list
3378
+ // of whitespaces and has a correct name
3379
+ var stringTrimForced = function (METHOD_NAME) {
3380
+ return fails(function () {
3381
+ return !!whitespaces[METHOD_NAME]()
3382
+ || non[METHOD_NAME]() !== non
3383
+ || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
3384
+ });
3385
+ };
3386
+
3387
+ var $ = _export;
3388
+ var $trim = stringTrim.trim;
3389
+ var forcedStringTrimMethod = stringTrimForced;
3390
+
3391
+ // `String.prototype.trim` method
3392
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
3393
+ $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
3394
+ trim: function trim() {
3395
+ return $trim(this);
3396
+ }
3397
+ });
3398
+
3399
+ /**
3400
+ * ZahlenButton - A pre-styled button that opens the checkout modal
3401
+ *
3402
+ * @example
3403
+ * ```tsx
3404
+ * import { ZahlenButton } from '@zahlen/checkout-react';
3405
+ *
3406
+ * function ProductPage() {
3407
+ * return (
3408
+ * <ZahlenButton
3409
+ * amount={4999}
3410
+ * currency="NGN"
3411
+ * description="Premium Plan"
3412
+ * onSuccess={(result) => router.push('/success')}
3413
+ * onError={(error) => toast.error(error.message)}
3414
+ * >
3415
+ * 💳 Pay ₦4,999
3416
+ * </ZahlenButton>
3417
+ * );
3418
+ * }
3419
+ * ```
3420
+ */
3421
+ function ZahlenButton({
3422
+ amount,
3423
+ currency,
3424
+ description,
3425
+ customerEmail,
3426
+ metadata,
3427
+ onSuccess,
3428
+ onError,
3429
+ onClose,
3430
+ children,
3431
+ className = '',
3432
+ style,
3433
+ disabled = false
3434
+ }) {
3435
+ const [isLoading, setIsLoading] = useState(false);
3436
+ const handleClick = useCallback(() => {
3437
+ if (disabled || isLoading) return;
3438
+ setIsLoading(true);
3439
+ Zahlen.checkout({
3440
+ amount,
3441
+ currency,
3442
+ description,
3443
+ customerEmail,
3444
+ metadata,
3445
+ onSuccess: result => {
3446
+ setIsLoading(false);
3447
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(result);
3448
+ },
3449
+ onError: error => {
3450
+ setIsLoading(false);
3451
+ onError === null || onError === void 0 ? void 0 : onError(error);
3452
+ },
3453
+ onClose: () => {
3454
+ setIsLoading(false);
3455
+ onClose === null || onClose === void 0 ? void 0 : onClose();
3456
+ }
3457
+ });
3458
+ }, [amount, currency, description, customerEmail, metadata, onSuccess, onError, onClose, disabled, isLoading]);
3459
+ // Default button styles
3460
+ const defaultStyles = Object.assign({
3461
+ padding: '14px 28px',
3462
+ background: 'linear-gradient(135deg, #7C3AED, #4F46E5)',
3463
+ border: 'none',
3464
+ borderRadius: '10px',
3465
+ color: 'white',
3466
+ fontSize: '1rem',
3467
+ fontWeight: 600,
3468
+ fontFamily: 'inherit',
3469
+ cursor: disabled || isLoading ? 'not-allowed' : 'pointer',
3470
+ opacity: disabled || isLoading ? 0.6 : 1,
3471
+ display: 'inline-flex',
3472
+ alignItems: 'center',
3473
+ justifyContent: 'center',
3474
+ gap: '8px',
3475
+ transition: 'all 0.15s ease'
3476
+ }, style);
3477
+ return jsx("button", {
3478
+ type: "button",
3479
+ onClick: handleClick,
3480
+ disabled: disabled || isLoading,
3481
+ className: `zahlen-button ${className}`.trim(),
3482
+ style: defaultStyles,
3483
+ children: isLoading ? jsxs(Fragment, {
3484
+ children: [jsx("span", {
3485
+ style: {
3486
+ width: '16px',
3487
+ height: '16px',
3488
+ border: '2px solid rgba(255,255,255,0.3)',
3489
+ borderTopColor: 'white',
3490
+ borderRadius: '50%',
3491
+ animation: 'zahlen-spin 0.8s linear infinite'
3492
+ }
3493
+ }), "Processing..."]
3494
+ }) : children || `Pay ${currency} ${(amount / 100).toFixed(2)}`
3495
+ });
3496
+ }
3497
+ // Add CSS animation
3498
+ if (typeof document !== 'undefined') {
3499
+ const style = document.createElement('style');
3500
+ style.textContent = `
3501
+ @keyframes zahlen-spin {
3502
+ to { transform: rotate(360deg); }
3503
+ }
3504
+ `;
3505
+ if (!document.getElementById('zahlen-react-styles')) {
3506
+ style.id = 'zahlen-react-styles';
3507
+ document.head.appendChild(style);
3508
+ }
3509
+ }
3510
+
3511
+ /**
3512
+ * ZahlenCheckout - Controlled component for programmatic control
3513
+ *
3514
+ * @example
3515
+ * ```tsx
3516
+ * import { useState } from 'react';
3517
+ * import { ZahlenCheckout } from '@zahlen/checkout-react';
3518
+ *
3519
+ * function ProductPage() {
3520
+ * const [isOpen, setIsOpen] = useState(false);
3521
+ *
3522
+ * return (
3523
+ * <>
3524
+ * <button onClick={() => setIsOpen(true)}>Buy Now</button>
3525
+ *
3526
+ * <ZahlenCheckout
3527
+ * open={isOpen}
3528
+ * onClose={() => setIsOpen(false)}
3529
+ * amount={4999}
3530
+ * currency="NGN"
3531
+ * onSuccess={(result) => {
3532
+ * setIsOpen(false);
3533
+ * router.push('/success');
3534
+ * }}
3535
+ * />
3536
+ * </>
3537
+ * );
3538
+ * }
3539
+ * ```
3540
+ */
3541
+ function ZahlenCheckout({
3542
+ open,
3543
+ onClose,
3544
+ amount,
3545
+ currency,
3546
+ description,
3547
+ customerEmail,
3548
+ metadata,
3549
+ onSuccess,
3550
+ onError
3551
+ }) {
3552
+ const isOpenRef = useRef(false);
3553
+ useEffect(() => {
3554
+ if (open && !isOpenRef.current) {
3555
+ isOpenRef.current = true;
3556
+ Zahlen.checkout({
3557
+ amount,
3558
+ currency,
3559
+ description,
3560
+ customerEmail,
3561
+ metadata,
3562
+ onSuccess: result => {
3563
+ isOpenRef.current = false;
3564
+ onSuccess(result);
3565
+ },
3566
+ onError: error => {
3567
+ isOpenRef.current = false;
3568
+ onError === null || onError === void 0 ? void 0 : onError(error);
3569
+ },
3570
+ onClose: () => {
3571
+ isOpenRef.current = false;
3572
+ onClose();
3573
+ }
3574
+ });
3575
+ } else if (!open && isOpenRef.current) {
3576
+ isOpenRef.current = false;
3577
+ Zahlen.closeModal();
3578
+ }
3579
+ }, [open, amount, currency, description, customerEmail, metadata, onSuccess, onError, onClose]);
3580
+ // Cleanup on unmount
3581
+ useEffect(() => {
3582
+ return () => {
3583
+ if (isOpenRef.current) {
3584
+ Zahlen.closeModal();
3585
+ }
3586
+ };
3587
+ }, []);
3588
+ // This component doesn't render anything - the modal is managed by Zahlen
3589
+ return null;
3590
+ }
3591
+
3592
+ export { ZahlenButton, ZahlenCheckout, ZahlenContext, ZahlenProvider, useZahlen };