@ninetailed/experience.js-plugin-preview 3.0.0-beta.23 → 3.0.0-beta.25

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.
Files changed (3) hide show
  1. package/index.cjs +2510 -0
  2. package/index.js +1470 -252
  3. package/package.json +5 -5
package/index.cjs ADDED
@@ -0,0 +1,2510 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var union = require('lodash/union');
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var union__default = /*#__PURE__*/_interopDefaultLegacy(union);
28
+
29
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
30
+
31
+ var check = function (it) {
32
+ return it && it.Math == Math && it;
33
+ };
34
+
35
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
36
+ var global$i =
37
+ // eslint-disable-next-line es/no-global-this -- safe
38
+ check(typeof globalThis == 'object' && globalThis) ||
39
+ check(typeof window == 'object' && window) ||
40
+ // eslint-disable-next-line no-restricted-globals -- safe
41
+ check(typeof self == 'object' && self) ||
42
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
43
+ // eslint-disable-next-line no-new-func -- fallback
44
+ (function () { return this; })() || Function('return this')();
45
+
46
+ var objectGetOwnPropertyDescriptor = {};
47
+
48
+ var fails$b = function (exec) {
49
+ try {
50
+ return !!exec();
51
+ } catch (error) {
52
+ return true;
53
+ }
54
+ };
55
+
56
+ var fails$a = fails$b;
57
+
58
+ // Detect IE8's incomplete defineProperty implementation
59
+ var descriptors = !fails$a(function () {
60
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
61
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
62
+ });
63
+
64
+ var fails$9 = fails$b;
65
+
66
+ var functionBindNative = !fails$9(function () {
67
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
68
+ var test = (function () { /* empty */ }).bind();
69
+ // eslint-disable-next-line no-prototype-builtins -- safe
70
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
71
+ });
72
+
73
+ var NATIVE_BIND$3 = functionBindNative;
74
+
75
+ var call$d = Function.prototype.call;
76
+
77
+ var functionCall = NATIVE_BIND$3 ? call$d.bind(call$d) : function () {
78
+ return call$d.apply(call$d, arguments);
79
+ };
80
+
81
+ var objectPropertyIsEnumerable = {};
82
+
83
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
84
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
85
+ var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
86
+
87
+ // Nashorn ~ JDK8 bug
88
+ var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
89
+
90
+ // `Object.prototype.propertyIsEnumerable` method implementation
91
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
92
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
93
+ var descriptor = getOwnPropertyDescriptor$2(this, V);
94
+ return !!descriptor && descriptor.enumerable;
95
+ } : $propertyIsEnumerable;
96
+
97
+ var createPropertyDescriptor$2 = function (bitmap, value) {
98
+ return {
99
+ enumerable: !(bitmap & 1),
100
+ configurable: !(bitmap & 2),
101
+ writable: !(bitmap & 4),
102
+ value: value
103
+ };
104
+ };
105
+
106
+ var NATIVE_BIND$2 = functionBindNative;
107
+
108
+ var FunctionPrototype$2 = Function.prototype;
109
+ var call$c = FunctionPrototype$2.call;
110
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$c, call$c);
111
+
112
+ var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
113
+ return function () {
114
+ return call$c.apply(fn, arguments);
115
+ };
116
+ };
117
+
118
+ var uncurryThis$d = functionUncurryThis;
119
+
120
+ var toString$1 = uncurryThis$d({}.toString);
121
+ var stringSlice = uncurryThis$d(''.slice);
122
+
123
+ var classofRaw$2 = function (it) {
124
+ return stringSlice(toString$1(it), 8, -1);
125
+ };
126
+
127
+ var uncurryThis$c = functionUncurryThis;
128
+ var fails$8 = fails$b;
129
+ var classof$4 = classofRaw$2;
130
+
131
+ var $Object$3 = Object;
132
+ var split = uncurryThis$c(''.split);
133
+
134
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
135
+ var indexedObject = fails$8(function () {
136
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
137
+ // eslint-disable-next-line no-prototype-builtins -- safe
138
+ return !$Object$3('z').propertyIsEnumerable(0);
139
+ }) ? function (it) {
140
+ return classof$4(it) == 'String' ? split(it, '') : $Object$3(it);
141
+ } : $Object$3;
142
+
143
+ // we can't use just `it == null` since of `document.all` special case
144
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
145
+ var isNullOrUndefined$4 = function (it) {
146
+ return it === null || it === undefined;
147
+ };
148
+
149
+ var isNullOrUndefined$3 = isNullOrUndefined$4;
150
+
151
+ var $TypeError$c = TypeError;
152
+
153
+ // `RequireObjectCoercible` abstract operation
154
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
155
+ var requireObjectCoercible$2 = function (it) {
156
+ if (isNullOrUndefined$3(it)) throw $TypeError$c("Can't call method on " + it);
157
+ return it;
158
+ };
159
+
160
+ // toObject with fallback for non-array-like ES3 strings
161
+ var IndexedObject$1 = indexedObject;
162
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
163
+
164
+ var toIndexedObject$3 = function (it) {
165
+ return IndexedObject$1(requireObjectCoercible$1(it));
166
+ };
167
+
168
+ var documentAll$2 = typeof document == 'object' && document.all;
169
+
170
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
171
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
172
+
173
+ var documentAll_1 = {
174
+ all: documentAll$2,
175
+ IS_HTMLDDA: IS_HTMLDDA
176
+ };
177
+
178
+ var $documentAll$1 = documentAll_1;
179
+
180
+ var documentAll$1 = $documentAll$1.all;
181
+
182
+ // `IsCallable` abstract operation
183
+ // https://tc39.es/ecma262/#sec-iscallable
184
+ var isCallable$h = $documentAll$1.IS_HTMLDDA ? function (argument) {
185
+ return typeof argument == 'function' || argument === documentAll$1;
186
+ } : function (argument) {
187
+ return typeof argument == 'function';
188
+ };
189
+
190
+ var isCallable$g = isCallable$h;
191
+ var $documentAll = documentAll_1;
192
+
193
+ var documentAll = $documentAll.all;
194
+
195
+ var isObject$7 = $documentAll.IS_HTMLDDA ? function (it) {
196
+ return typeof it == 'object' ? it !== null : isCallable$g(it) || it === documentAll;
197
+ } : function (it) {
198
+ return typeof it == 'object' ? it !== null : isCallable$g(it);
199
+ };
200
+
201
+ var global$h = global$i;
202
+ var isCallable$f = isCallable$h;
203
+
204
+ var aFunction = function (argument) {
205
+ return isCallable$f(argument) ? argument : undefined;
206
+ };
207
+
208
+ var getBuiltIn$8 = function (namespace, method) {
209
+ return arguments.length < 2 ? aFunction(global$h[namespace]) : global$h[namespace] && global$h[namespace][method];
210
+ };
211
+
212
+ var uncurryThis$b = functionUncurryThis;
213
+
214
+ var objectIsPrototypeOf = uncurryThis$b({}.isPrototypeOf);
215
+
216
+ var getBuiltIn$7 = getBuiltIn$8;
217
+
218
+ var engineUserAgent = getBuiltIn$7('navigator', 'userAgent') || '';
219
+
220
+ var global$g = global$i;
221
+ var userAgent$3 = engineUserAgent;
222
+
223
+ var process$3 = global$g.process;
224
+ var Deno$1 = global$g.Deno;
225
+ var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
226
+ var v8 = versions && versions.v8;
227
+ var match, version;
228
+
229
+ if (v8) {
230
+ match = v8.split('.');
231
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
232
+ // but their correct versions are not interesting for us
233
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
234
+ }
235
+
236
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
237
+ // so check `userAgent` even if `.v8` exists, but 0
238
+ if (!version && userAgent$3) {
239
+ match = userAgent$3.match(/Edge\/(\d+)/);
240
+ if (!match || match[1] >= 74) {
241
+ match = userAgent$3.match(/Chrome\/(\d+)/);
242
+ if (match) version = +match[1];
243
+ }
244
+ }
245
+
246
+ var engineV8Version = version;
247
+
248
+ /* eslint-disable es/no-symbol -- required for testing */
249
+
250
+ var V8_VERSION$1 = engineV8Version;
251
+ var fails$7 = fails$b;
252
+
253
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
254
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$7(function () {
255
+ var symbol = Symbol();
256
+ // Chrome 38 Symbol has incorrect toString conversion
257
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
258
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
259
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
260
+ !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
261
+ });
262
+
263
+ /* eslint-disable es/no-symbol -- required for testing */
264
+
265
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
266
+
267
+ var useSymbolAsUid = NATIVE_SYMBOL$1
268
+ && !Symbol.sham
269
+ && typeof Symbol.iterator == 'symbol';
270
+
271
+ var getBuiltIn$6 = getBuiltIn$8;
272
+ var isCallable$e = isCallable$h;
273
+ var isPrototypeOf$2 = objectIsPrototypeOf;
274
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
275
+
276
+ var $Object$2 = Object;
277
+
278
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
279
+ return typeof it == 'symbol';
280
+ } : function (it) {
281
+ var $Symbol = getBuiltIn$6('Symbol');
282
+ return isCallable$e($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$2(it));
283
+ };
284
+
285
+ var $String$2 = String;
286
+
287
+ var tryToString$4 = function (argument) {
288
+ try {
289
+ return $String$2(argument);
290
+ } catch (error) {
291
+ return 'Object';
292
+ }
293
+ };
294
+
295
+ var isCallable$d = isCallable$h;
296
+ var tryToString$3 = tryToString$4;
297
+
298
+ var $TypeError$b = TypeError;
299
+
300
+ // `Assert: IsCallable(argument) is true`
301
+ var aCallable$7 = function (argument) {
302
+ if (isCallable$d(argument)) return argument;
303
+ throw $TypeError$b(tryToString$3(argument) + ' is not a function');
304
+ };
305
+
306
+ var aCallable$6 = aCallable$7;
307
+ var isNullOrUndefined$2 = isNullOrUndefined$4;
308
+
309
+ // `GetMethod` abstract operation
310
+ // https://tc39.es/ecma262/#sec-getmethod
311
+ var getMethod$3 = function (V, P) {
312
+ var func = V[P];
313
+ return isNullOrUndefined$2(func) ? undefined : aCallable$6(func);
314
+ };
315
+
316
+ var call$b = functionCall;
317
+ var isCallable$c = isCallable$h;
318
+ var isObject$6 = isObject$7;
319
+
320
+ var $TypeError$a = TypeError;
321
+
322
+ // `OrdinaryToPrimitive` abstract operation
323
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
324
+ var ordinaryToPrimitive$1 = function (input, pref) {
325
+ var fn, val;
326
+ if (pref === 'string' && isCallable$c(fn = input.toString) && !isObject$6(val = call$b(fn, input))) return val;
327
+ if (isCallable$c(fn = input.valueOf) && !isObject$6(val = call$b(fn, input))) return val;
328
+ if (pref !== 'string' && isCallable$c(fn = input.toString) && !isObject$6(val = call$b(fn, input))) return val;
329
+ throw $TypeError$a("Can't convert object to primitive value");
330
+ };
331
+
332
+ var shared$3 = {exports: {}};
333
+
334
+ var global$f = global$i;
335
+
336
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
337
+ var defineProperty$3 = Object.defineProperty;
338
+
339
+ var defineGlobalProperty$3 = function (key, value) {
340
+ try {
341
+ defineProperty$3(global$f, key, { value: value, configurable: true, writable: true });
342
+ } catch (error) {
343
+ global$f[key] = value;
344
+ } return value;
345
+ };
346
+
347
+ var global$e = global$i;
348
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
349
+
350
+ var SHARED = '__core-js_shared__';
351
+ var store$3 = global$e[SHARED] || defineGlobalProperty$2(SHARED, {});
352
+
353
+ var sharedStore = store$3;
354
+
355
+ var store$2 = sharedStore;
356
+
357
+ (shared$3.exports = function (key, value) {
358
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
359
+ })('versions', []).push({
360
+ version: '3.26.1',
361
+ mode: 'global',
362
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
363
+ license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',
364
+ source: 'https://github.com/zloirock/core-js'
365
+ });
366
+
367
+ var requireObjectCoercible = requireObjectCoercible$2;
368
+
369
+ var $Object$1 = Object;
370
+
371
+ // `ToObject` abstract operation
372
+ // https://tc39.es/ecma262/#sec-toobject
373
+ var toObject$2 = function (argument) {
374
+ return $Object$1(requireObjectCoercible(argument));
375
+ };
376
+
377
+ var uncurryThis$a = functionUncurryThis;
378
+ var toObject$1 = toObject$2;
379
+
380
+ var hasOwnProperty = uncurryThis$a({}.hasOwnProperty);
381
+
382
+ // `HasOwnProperty` abstract operation
383
+ // https://tc39.es/ecma262/#sec-hasownproperty
384
+ // eslint-disable-next-line es/no-object-hasown -- safe
385
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
386
+ return hasOwnProperty(toObject$1(it), key);
387
+ };
388
+
389
+ var uncurryThis$9 = functionUncurryThis;
390
+
391
+ var id = 0;
392
+ var postfix = Math.random();
393
+ var toString = uncurryThis$9(1.0.toString);
394
+
395
+ var uid$2 = function (key) {
396
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
397
+ };
398
+
399
+ var global$d = global$i;
400
+ var shared$2 = shared$3.exports;
401
+ var hasOwn$8 = hasOwnProperty_1;
402
+ var uid$1 = uid$2;
403
+ var NATIVE_SYMBOL = symbolConstructorDetection;
404
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
405
+
406
+ var WellKnownSymbolsStore = shared$2('wks');
407
+ var Symbol$1 = global$d.Symbol;
408
+ var symbolFor = Symbol$1 && Symbol$1['for'];
409
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
410
+
411
+ var wellKnownSymbol$a = function (name) {
412
+ if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
413
+ var description = 'Symbol.' + name;
414
+ if (NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)) {
415
+ WellKnownSymbolsStore[name] = Symbol$1[name];
416
+ } else if (USE_SYMBOL_AS_UID && symbolFor) {
417
+ WellKnownSymbolsStore[name] = symbolFor(description);
418
+ } else {
419
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
420
+ }
421
+ } return WellKnownSymbolsStore[name];
422
+ };
423
+
424
+ var call$a = functionCall;
425
+ var isObject$5 = isObject$7;
426
+ var isSymbol$1 = isSymbol$2;
427
+ var getMethod$2 = getMethod$3;
428
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
429
+ var wellKnownSymbol$9 = wellKnownSymbol$a;
430
+
431
+ var $TypeError$9 = TypeError;
432
+ var TO_PRIMITIVE = wellKnownSymbol$9('toPrimitive');
433
+
434
+ // `ToPrimitive` abstract operation
435
+ // https://tc39.es/ecma262/#sec-toprimitive
436
+ var toPrimitive$1 = function (input, pref) {
437
+ if (!isObject$5(input) || isSymbol$1(input)) return input;
438
+ var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
439
+ var result;
440
+ if (exoticToPrim) {
441
+ if (pref === undefined) pref = 'default';
442
+ result = call$a(exoticToPrim, input, pref);
443
+ if (!isObject$5(result) || isSymbol$1(result)) return result;
444
+ throw $TypeError$9("Can't convert object to primitive value");
445
+ }
446
+ if (pref === undefined) pref = 'number';
447
+ return ordinaryToPrimitive(input, pref);
448
+ };
449
+
450
+ var toPrimitive = toPrimitive$1;
451
+ var isSymbol = isSymbol$2;
452
+
453
+ // `ToPropertyKey` abstract operation
454
+ // https://tc39.es/ecma262/#sec-topropertykey
455
+ var toPropertyKey$2 = function (argument) {
456
+ var key = toPrimitive(argument, 'string');
457
+ return isSymbol(key) ? key : key + '';
458
+ };
459
+
460
+ var global$c = global$i;
461
+ var isObject$4 = isObject$7;
462
+
463
+ var document$3 = global$c.document;
464
+ // typeof document.createElement is 'object' in old IE
465
+ var EXISTS$1 = isObject$4(document$3) && isObject$4(document$3.createElement);
466
+
467
+ var documentCreateElement = function (it) {
468
+ return EXISTS$1 ? document$3.createElement(it) : {};
469
+ };
470
+
471
+ var DESCRIPTORS$8 = descriptors;
472
+ var fails$6 = fails$b;
473
+ var createElement$1 = documentCreateElement;
474
+
475
+ // Thanks to IE8 for its funny defineProperty
476
+ var ie8DomDefine = !DESCRIPTORS$8 && !fails$6(function () {
477
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
478
+ return Object.defineProperty(createElement$1('div'), 'a', {
479
+ get: function () { return 7; }
480
+ }).a != 7;
481
+ });
482
+
483
+ var DESCRIPTORS$7 = descriptors;
484
+ var call$9 = functionCall;
485
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
486
+ var createPropertyDescriptor$1 = createPropertyDescriptor$2;
487
+ var toIndexedObject$2 = toIndexedObject$3;
488
+ var toPropertyKey$1 = toPropertyKey$2;
489
+ var hasOwn$7 = hasOwnProperty_1;
490
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
491
+
492
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
493
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
494
+
495
+ // `Object.getOwnPropertyDescriptor` method
496
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
497
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$7 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
498
+ O = toIndexedObject$2(O);
499
+ P = toPropertyKey$1(P);
500
+ if (IE8_DOM_DEFINE$1) try {
501
+ return $getOwnPropertyDescriptor$1(O, P);
502
+ } catch (error) { /* empty */ }
503
+ if (hasOwn$7(O, P)) return createPropertyDescriptor$1(!call$9(propertyIsEnumerableModule$1.f, O, P), O[P]);
504
+ };
505
+
506
+ var objectDefineProperty = {};
507
+
508
+ var DESCRIPTORS$6 = descriptors;
509
+ var fails$5 = fails$b;
510
+
511
+ // V8 ~ Chrome 36-
512
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
513
+ var v8PrototypeDefineBug = DESCRIPTORS$6 && fails$5(function () {
514
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
515
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
516
+ value: 42,
517
+ writable: false
518
+ }).prototype != 42;
519
+ });
520
+
521
+ var isObject$3 = isObject$7;
522
+
523
+ var $String$1 = String;
524
+ var $TypeError$8 = TypeError;
525
+
526
+ // `Assert: Type(argument) is Object`
527
+ var anObject$8 = function (argument) {
528
+ if (isObject$3(argument)) return argument;
529
+ throw $TypeError$8($String$1(argument) + ' is not an object');
530
+ };
531
+
532
+ var DESCRIPTORS$5 = descriptors;
533
+ var IE8_DOM_DEFINE = ie8DomDefine;
534
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
535
+ var anObject$7 = anObject$8;
536
+ var toPropertyKey = toPropertyKey$2;
537
+
538
+ var $TypeError$7 = TypeError;
539
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
540
+ var $defineProperty = Object.defineProperty;
541
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
542
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
543
+ var ENUMERABLE = 'enumerable';
544
+ var CONFIGURABLE$1 = 'configurable';
545
+ var WRITABLE = 'writable';
546
+
547
+ // `Object.defineProperty` method
548
+ // https://tc39.es/ecma262/#sec-object.defineproperty
549
+ objectDefineProperty.f = DESCRIPTORS$5 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
550
+ anObject$7(O);
551
+ P = toPropertyKey(P);
552
+ anObject$7(Attributes);
553
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
554
+ var current = $getOwnPropertyDescriptor(O, P);
555
+ if (current && current[WRITABLE]) {
556
+ O[P] = Attributes.value;
557
+ Attributes = {
558
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
559
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
560
+ writable: false
561
+ };
562
+ }
563
+ } return $defineProperty(O, P, Attributes);
564
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
565
+ anObject$7(O);
566
+ P = toPropertyKey(P);
567
+ anObject$7(Attributes);
568
+ if (IE8_DOM_DEFINE) try {
569
+ return $defineProperty(O, P, Attributes);
570
+ } catch (error) { /* empty */ }
571
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError$7('Accessors not supported');
572
+ if ('value' in Attributes) O[P] = Attributes.value;
573
+ return O;
574
+ };
575
+
576
+ var DESCRIPTORS$4 = descriptors;
577
+ var definePropertyModule$3 = objectDefineProperty;
578
+ var createPropertyDescriptor = createPropertyDescriptor$2;
579
+
580
+ var createNonEnumerableProperty$2 = DESCRIPTORS$4 ? function (object, key, value) {
581
+ return definePropertyModule$3.f(object, key, createPropertyDescriptor(1, value));
582
+ } : function (object, key, value) {
583
+ object[key] = value;
584
+ return object;
585
+ };
586
+
587
+ var makeBuiltIn$2 = {exports: {}};
588
+
589
+ var DESCRIPTORS$3 = descriptors;
590
+ var hasOwn$6 = hasOwnProperty_1;
591
+
592
+ var FunctionPrototype$1 = Function.prototype;
593
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
594
+ var getDescriptor = DESCRIPTORS$3 && Object.getOwnPropertyDescriptor;
595
+
596
+ var EXISTS = hasOwn$6(FunctionPrototype$1, 'name');
597
+ // additional protection from minified / mangled / dropped function names
598
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
599
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$3 || (DESCRIPTORS$3 && getDescriptor(FunctionPrototype$1, 'name').configurable));
600
+
601
+ var functionName = {
602
+ EXISTS: EXISTS,
603
+ PROPER: PROPER,
604
+ CONFIGURABLE: CONFIGURABLE
605
+ };
606
+
607
+ var uncurryThis$8 = functionUncurryThis;
608
+ var isCallable$b = isCallable$h;
609
+ var store$1 = sharedStore;
610
+
611
+ var functionToString = uncurryThis$8(Function.toString);
612
+
613
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
614
+ if (!isCallable$b(store$1.inspectSource)) {
615
+ store$1.inspectSource = function (it) {
616
+ return functionToString(it);
617
+ };
618
+ }
619
+
620
+ var inspectSource$3 = store$1.inspectSource;
621
+
622
+ var global$b = global$i;
623
+ var isCallable$a = isCallable$h;
624
+
625
+ var WeakMap$1 = global$b.WeakMap;
626
+
627
+ var weakMapBasicDetection = isCallable$a(WeakMap$1) && /native code/.test(String(WeakMap$1));
628
+
629
+ var shared$1 = shared$3.exports;
630
+ var uid = uid$2;
631
+
632
+ var keys = shared$1('keys');
633
+
634
+ var sharedKey$1 = function (key) {
635
+ return keys[key] || (keys[key] = uid(key));
636
+ };
637
+
638
+ var hiddenKeys$3 = {};
639
+
640
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
641
+ var global$a = global$i;
642
+ var isObject$2 = isObject$7;
643
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
644
+ var hasOwn$5 = hasOwnProperty_1;
645
+ var shared = sharedStore;
646
+ var sharedKey = sharedKey$1;
647
+ var hiddenKeys$2 = hiddenKeys$3;
648
+
649
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
650
+ var TypeError$2 = global$a.TypeError;
651
+ var WeakMap = global$a.WeakMap;
652
+ var set$1, get, has;
653
+
654
+ var enforce = function (it) {
655
+ return has(it) ? get(it) : set$1(it, {});
656
+ };
657
+
658
+ var getterFor = function (TYPE) {
659
+ return function (it) {
660
+ var state;
661
+ if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
662
+ throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
663
+ } return state;
664
+ };
665
+ };
666
+
667
+ if (NATIVE_WEAK_MAP || shared.state) {
668
+ var store = shared.state || (shared.state = new WeakMap());
669
+ /* eslint-disable no-self-assign -- prototype methods protection */
670
+ store.get = store.get;
671
+ store.has = store.has;
672
+ store.set = store.set;
673
+ /* eslint-enable no-self-assign -- prototype methods protection */
674
+ set$1 = function (it, metadata) {
675
+ if (store.has(it)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
676
+ metadata.facade = it;
677
+ store.set(it, metadata);
678
+ return metadata;
679
+ };
680
+ get = function (it) {
681
+ return store.get(it) || {};
682
+ };
683
+ has = function (it) {
684
+ return store.has(it);
685
+ };
686
+ } else {
687
+ var STATE = sharedKey('state');
688
+ hiddenKeys$2[STATE] = true;
689
+ set$1 = function (it, metadata) {
690
+ if (hasOwn$5(it, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
691
+ metadata.facade = it;
692
+ createNonEnumerableProperty$1(it, STATE, metadata);
693
+ return metadata;
694
+ };
695
+ get = function (it) {
696
+ return hasOwn$5(it, STATE) ? it[STATE] : {};
697
+ };
698
+ has = function (it) {
699
+ return hasOwn$5(it, STATE);
700
+ };
701
+ }
702
+
703
+ var internalState = {
704
+ set: set$1,
705
+ get: get,
706
+ has: has,
707
+ enforce: enforce,
708
+ getterFor: getterFor
709
+ };
710
+
711
+ var fails$4 = fails$b;
712
+ var isCallable$9 = isCallable$h;
713
+ var hasOwn$4 = hasOwnProperty_1;
714
+ var DESCRIPTORS$2 = descriptors;
715
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
716
+ var inspectSource$2 = inspectSource$3;
717
+ var InternalStateModule$1 = internalState;
718
+
719
+ var enforceInternalState = InternalStateModule$1.enforce;
720
+ var getInternalState = InternalStateModule$1.get;
721
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
722
+ var defineProperty$2 = Object.defineProperty;
723
+
724
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$4(function () {
725
+ return defineProperty$2(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
726
+ });
727
+
728
+ var TEMPLATE = String(String).split('String');
729
+
730
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
731
+ if (String(name).slice(0, 7) === 'Symbol(') {
732
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
733
+ }
734
+ if (options && options.getter) name = 'get ' + name;
735
+ if (options && options.setter) name = 'set ' + name;
736
+ if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
737
+ if (DESCRIPTORS$2) defineProperty$2(value, 'name', { value: name, configurable: true });
738
+ else value.name = name;
739
+ }
740
+ if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
741
+ defineProperty$2(value, 'length', { value: options.arity });
742
+ }
743
+ try {
744
+ if (options && hasOwn$4(options, 'constructor') && options.constructor) {
745
+ if (DESCRIPTORS$2) defineProperty$2(value, 'prototype', { writable: false });
746
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
747
+ } else if (value.prototype) value.prototype = undefined;
748
+ } catch (error) { /* empty */ }
749
+ var state = enforceInternalState(value);
750
+ if (!hasOwn$4(state, 'source')) {
751
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
752
+ } return value;
753
+ };
754
+
755
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
756
+ // eslint-disable-next-line no-extend-native -- required
757
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
758
+ return isCallable$9(this) && getInternalState(this).source || inspectSource$2(this);
759
+ }, 'toString');
760
+
761
+ var isCallable$8 = isCallable$h;
762
+ var definePropertyModule$2 = objectDefineProperty;
763
+ var makeBuiltIn = makeBuiltIn$2.exports;
764
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
765
+
766
+ var defineBuiltIn$3 = function (O, key, value, options) {
767
+ if (!options) options = {};
768
+ var simple = options.enumerable;
769
+ var name = options.name !== undefined ? options.name : key;
770
+ if (isCallable$8(value)) makeBuiltIn(value, name, options);
771
+ if (options.global) {
772
+ if (simple) O[key] = value;
773
+ else defineGlobalProperty$1(key, value);
774
+ } else {
775
+ try {
776
+ if (!options.unsafe) delete O[key];
777
+ else if (O[key]) simple = true;
778
+ } catch (error) { /* empty */ }
779
+ if (simple) O[key] = value;
780
+ else definePropertyModule$2.f(O, key, {
781
+ value: value,
782
+ enumerable: false,
783
+ configurable: !options.nonConfigurable,
784
+ writable: !options.nonWritable
785
+ });
786
+ } return O;
787
+ };
788
+
789
+ var objectGetOwnPropertyNames = {};
790
+
791
+ var ceil = Math.ceil;
792
+ var floor = Math.floor;
793
+
794
+ // `Math.trunc` method
795
+ // https://tc39.es/ecma262/#sec-math.trunc
796
+ // eslint-disable-next-line es/no-math-trunc -- safe
797
+ var mathTrunc = Math.trunc || function trunc(x) {
798
+ var n = +x;
799
+ return (n > 0 ? floor : ceil)(n);
800
+ };
801
+
802
+ var trunc = mathTrunc;
803
+
804
+ // `ToIntegerOrInfinity` abstract operation
805
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
806
+ var toIntegerOrInfinity$2 = function (argument) {
807
+ var number = +argument;
808
+ // eslint-disable-next-line no-self-compare -- NaN check
809
+ return number !== number || number === 0 ? 0 : trunc(number);
810
+ };
811
+
812
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
813
+
814
+ var max = Math.max;
815
+ var min$1 = Math.min;
816
+
817
+ // Helper for a popular repeating case of the spec:
818
+ // Let integer be ? ToInteger(index).
819
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
820
+ var toAbsoluteIndex$1 = function (index, length) {
821
+ var integer = toIntegerOrInfinity$1(index);
822
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
823
+ };
824
+
825
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
826
+
827
+ var min = Math.min;
828
+
829
+ // `ToLength` abstract operation
830
+ // https://tc39.es/ecma262/#sec-tolength
831
+ var toLength$1 = function (argument) {
832
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
833
+ };
834
+
835
+ var toLength = toLength$1;
836
+
837
+ // `LengthOfArrayLike` abstract operation
838
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
839
+ var lengthOfArrayLike$2 = function (obj) {
840
+ return toLength(obj.length);
841
+ };
842
+
843
+ var toIndexedObject$1 = toIndexedObject$3;
844
+ var toAbsoluteIndex = toAbsoluteIndex$1;
845
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
846
+
847
+ // `Array.prototype.{ indexOf, includes }` methods implementation
848
+ var createMethod = function (IS_INCLUDES) {
849
+ return function ($this, el, fromIndex) {
850
+ var O = toIndexedObject$1($this);
851
+ var length = lengthOfArrayLike$1(O);
852
+ var index = toAbsoluteIndex(fromIndex, length);
853
+ var value;
854
+ // Array#includes uses SameValueZero equality algorithm
855
+ // eslint-disable-next-line no-self-compare -- NaN check
856
+ if (IS_INCLUDES && el != el) while (length > index) {
857
+ value = O[index++];
858
+ // eslint-disable-next-line no-self-compare -- NaN check
859
+ if (value != value) return true;
860
+ // Array#indexOf ignores holes, Array#includes - not
861
+ } else for (;length > index; index++) {
862
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
863
+ } return !IS_INCLUDES && -1;
864
+ };
865
+ };
866
+
867
+ var arrayIncludes = {
868
+ // `Array.prototype.includes` method
869
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
870
+ includes: createMethod(true),
871
+ // `Array.prototype.indexOf` method
872
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
873
+ indexOf: createMethod(false)
874
+ };
875
+
876
+ var uncurryThis$7 = functionUncurryThis;
877
+ var hasOwn$3 = hasOwnProperty_1;
878
+ var toIndexedObject = toIndexedObject$3;
879
+ var indexOf = arrayIncludes.indexOf;
880
+ var hiddenKeys$1 = hiddenKeys$3;
881
+
882
+ var push = uncurryThis$7([].push);
883
+
884
+ var objectKeysInternal = function (object, names) {
885
+ var O = toIndexedObject(object);
886
+ var i = 0;
887
+ var result = [];
888
+ var key;
889
+ for (key in O) !hasOwn$3(hiddenKeys$1, key) && hasOwn$3(O, key) && push(result, key);
890
+ // Don't enum bug & hidden keys
891
+ while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
892
+ ~indexOf(result, key) || push(result, key);
893
+ }
894
+ return result;
895
+ };
896
+
897
+ // IE8- don't enum bug keys
898
+ var enumBugKeys$2 = [
899
+ 'constructor',
900
+ 'hasOwnProperty',
901
+ 'isPrototypeOf',
902
+ 'propertyIsEnumerable',
903
+ 'toLocaleString',
904
+ 'toString',
905
+ 'valueOf'
906
+ ];
907
+
908
+ var internalObjectKeys$1 = objectKeysInternal;
909
+ var enumBugKeys$1 = enumBugKeys$2;
910
+
911
+ var hiddenKeys = enumBugKeys$1.concat('length', 'prototype');
912
+
913
+ // `Object.getOwnPropertyNames` method
914
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
915
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
916
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
917
+ return internalObjectKeys$1(O, hiddenKeys);
918
+ };
919
+
920
+ var objectGetOwnPropertySymbols = {};
921
+
922
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
923
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
924
+
925
+ var getBuiltIn$5 = getBuiltIn$8;
926
+ var uncurryThis$6 = functionUncurryThis;
927
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
928
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
929
+ var anObject$6 = anObject$8;
930
+
931
+ var concat$1 = uncurryThis$6([].concat);
932
+
933
+ // all object keys, includes non-enumerable and symbols
934
+ var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
935
+ var keys = getOwnPropertyNamesModule.f(anObject$6(it));
936
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
937
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
938
+ };
939
+
940
+ var hasOwn$2 = hasOwnProperty_1;
941
+ var ownKeys = ownKeys$1;
942
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
943
+ var definePropertyModule$1 = objectDefineProperty;
944
+
945
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
946
+ var keys = ownKeys(source);
947
+ var defineProperty = definePropertyModule$1.f;
948
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
949
+ for (var i = 0; i < keys.length; i++) {
950
+ var key = keys[i];
951
+ if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
952
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
953
+ }
954
+ }
955
+ };
956
+
957
+ var fails$3 = fails$b;
958
+ var isCallable$7 = isCallable$h;
959
+
960
+ var replacement = /#|\.prototype\./;
961
+
962
+ var isForced$2 = function (feature, detection) {
963
+ var value = data[normalize(feature)];
964
+ return value == POLYFILL ? true
965
+ : value == NATIVE ? false
966
+ : isCallable$7(detection) ? fails$3(detection)
967
+ : !!detection;
968
+ };
969
+
970
+ var normalize = isForced$2.normalize = function (string) {
971
+ return String(string).replace(replacement, '.').toLowerCase();
972
+ };
973
+
974
+ var data = isForced$2.data = {};
975
+ var NATIVE = isForced$2.NATIVE = 'N';
976
+ var POLYFILL = isForced$2.POLYFILL = 'P';
977
+
978
+ var isForced_1 = isForced$2;
979
+
980
+ var global$9 = global$i;
981
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
982
+ var createNonEnumerableProperty = createNonEnumerableProperty$2;
983
+ var defineBuiltIn$2 = defineBuiltIn$3;
984
+ var defineGlobalProperty = defineGlobalProperty$3;
985
+ var copyConstructorProperties = copyConstructorProperties$1;
986
+ var isForced$1 = isForced_1;
987
+
988
+ /*
989
+ options.target - name of the target object
990
+ options.global - target is the global object
991
+ options.stat - export as static methods of target
992
+ options.proto - export as prototype methods of target
993
+ options.real - real prototype method for the `pure` version
994
+ options.forced - export even if the native feature is available
995
+ options.bind - bind methods to the target, required for the `pure` version
996
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
997
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
998
+ options.sham - add a flag to not completely full polyfills
999
+ options.enumerable - export as enumerable property
1000
+ options.dontCallGetSet - prevent calling a getter on target
1001
+ options.name - the .name of the function if it does not match the key
1002
+ */
1003
+ var _export = function (options, source) {
1004
+ var TARGET = options.target;
1005
+ var GLOBAL = options.global;
1006
+ var STATIC = options.stat;
1007
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1008
+ if (GLOBAL) {
1009
+ target = global$9;
1010
+ } else if (STATIC) {
1011
+ target = global$9[TARGET] || defineGlobalProperty(TARGET, {});
1012
+ } else {
1013
+ target = (global$9[TARGET] || {}).prototype;
1014
+ }
1015
+ if (target) for (key in source) {
1016
+ sourceProperty = source[key];
1017
+ if (options.dontCallGetSet) {
1018
+ descriptor = getOwnPropertyDescriptor$1(target, key);
1019
+ targetProperty = descriptor && descriptor.value;
1020
+ } else targetProperty = target[key];
1021
+ FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1022
+ // contained in target
1023
+ if (!FORCED && targetProperty !== undefined) {
1024
+ if (typeof sourceProperty == typeof targetProperty) continue;
1025
+ copyConstructorProperties(sourceProperty, targetProperty);
1026
+ }
1027
+ // add a flag to not completely full polyfills
1028
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1029
+ createNonEnumerableProperty(sourceProperty, 'sham', true);
1030
+ }
1031
+ defineBuiltIn$2(target, key, sourceProperty, options);
1032
+ }
1033
+ };
1034
+
1035
+ var classof$3 = classofRaw$2;
1036
+ var global$8 = global$i;
1037
+
1038
+ var engineIsNode = classof$3(global$8.process) == 'process';
1039
+
1040
+ var isCallable$6 = isCallable$h;
1041
+
1042
+ var $String = String;
1043
+ var $TypeError$6 = TypeError;
1044
+
1045
+ var aPossiblePrototype$1 = function (argument) {
1046
+ if (typeof argument == 'object' || isCallable$6(argument)) return argument;
1047
+ throw $TypeError$6("Can't set " + $String(argument) + ' as a prototype');
1048
+ };
1049
+
1050
+ /* eslint-disable no-proto -- safe */
1051
+
1052
+ var uncurryThis$5 = functionUncurryThis;
1053
+ var anObject$5 = anObject$8;
1054
+ var aPossiblePrototype = aPossiblePrototype$1;
1055
+
1056
+ // `Object.setPrototypeOf` method
1057
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1058
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1059
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1060
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1061
+ var CORRECT_SETTER = false;
1062
+ var test = {};
1063
+ var setter;
1064
+ try {
1065
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1066
+ setter = uncurryThis$5(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1067
+ setter(test, []);
1068
+ CORRECT_SETTER = test instanceof Array;
1069
+ } catch (error) { /* empty */ }
1070
+ return function setPrototypeOf(O, proto) {
1071
+ anObject$5(O);
1072
+ aPossiblePrototype(proto);
1073
+ if (CORRECT_SETTER) setter(O, proto);
1074
+ else O.__proto__ = proto;
1075
+ return O;
1076
+ };
1077
+ }() : undefined);
1078
+
1079
+ var defineProperty$1 = objectDefineProperty.f;
1080
+ var hasOwn$1 = hasOwnProperty_1;
1081
+ var wellKnownSymbol$8 = wellKnownSymbol$a;
1082
+
1083
+ var TO_STRING_TAG$2 = wellKnownSymbol$8('toStringTag');
1084
+
1085
+ var setToStringTag$1 = function (target, TAG, STATIC) {
1086
+ if (target && !STATIC) target = target.prototype;
1087
+ if (target && !hasOwn$1(target, TO_STRING_TAG$2)) {
1088
+ defineProperty$1(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
1089
+ }
1090
+ };
1091
+
1092
+ var getBuiltIn$4 = getBuiltIn$8;
1093
+ var definePropertyModule = objectDefineProperty;
1094
+ var wellKnownSymbol$7 = wellKnownSymbol$a;
1095
+ var DESCRIPTORS$1 = descriptors;
1096
+
1097
+ var SPECIES$2 = wellKnownSymbol$7('species');
1098
+
1099
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1100
+ var Constructor = getBuiltIn$4(CONSTRUCTOR_NAME);
1101
+ var defineProperty = definePropertyModule.f;
1102
+
1103
+ if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES$2]) {
1104
+ defineProperty(Constructor, SPECIES$2, {
1105
+ configurable: true,
1106
+ get: function () { return this; }
1107
+ });
1108
+ }
1109
+ };
1110
+
1111
+ var isPrototypeOf$1 = objectIsPrototypeOf;
1112
+
1113
+ var $TypeError$5 = TypeError;
1114
+
1115
+ var anInstance$1 = function (it, Prototype) {
1116
+ if (isPrototypeOf$1(Prototype, it)) return it;
1117
+ throw $TypeError$5('Incorrect invocation');
1118
+ };
1119
+
1120
+ var wellKnownSymbol$6 = wellKnownSymbol$a;
1121
+
1122
+ var TO_STRING_TAG$1 = wellKnownSymbol$6('toStringTag');
1123
+ var test = {};
1124
+
1125
+ test[TO_STRING_TAG$1] = 'z';
1126
+
1127
+ var toStringTagSupport = String(test) === '[object z]';
1128
+
1129
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1130
+ var isCallable$5 = isCallable$h;
1131
+ var classofRaw$1 = classofRaw$2;
1132
+ var wellKnownSymbol$5 = wellKnownSymbol$a;
1133
+
1134
+ var TO_STRING_TAG = wellKnownSymbol$5('toStringTag');
1135
+ var $Object = Object;
1136
+
1137
+ // ES3 wrong here
1138
+ var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) == 'Arguments';
1139
+
1140
+ // fallback for IE11 Script Access Denied error
1141
+ var tryGet = function (it, key) {
1142
+ try {
1143
+ return it[key];
1144
+ } catch (error) { /* empty */ }
1145
+ };
1146
+
1147
+ // getting tag from ES6+ `Object.prototype.toString`
1148
+ var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1149
+ var O, tag, result;
1150
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1151
+ // @@toStringTag case
1152
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1153
+ // builtinTag case
1154
+ : CORRECT_ARGUMENTS ? classofRaw$1(O)
1155
+ // ES3 arguments fallback
1156
+ : (result = classofRaw$1(O)) == 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1157
+ };
1158
+
1159
+ var uncurryThis$4 = functionUncurryThis;
1160
+ var fails$2 = fails$b;
1161
+ var isCallable$4 = isCallable$h;
1162
+ var classof$1 = classof$2;
1163
+ var getBuiltIn$3 = getBuiltIn$8;
1164
+ var inspectSource$1 = inspectSource$3;
1165
+
1166
+ var noop = function () { /* empty */ };
1167
+ var empty = [];
1168
+ var construct = getBuiltIn$3('Reflect', 'construct');
1169
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1170
+ var exec = uncurryThis$4(constructorRegExp.exec);
1171
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1172
+
1173
+ var isConstructorModern = function isConstructor(argument) {
1174
+ if (!isCallable$4(argument)) return false;
1175
+ try {
1176
+ construct(noop, empty, argument);
1177
+ return true;
1178
+ } catch (error) {
1179
+ return false;
1180
+ }
1181
+ };
1182
+
1183
+ var isConstructorLegacy = function isConstructor(argument) {
1184
+ if (!isCallable$4(argument)) return false;
1185
+ switch (classof$1(argument)) {
1186
+ case 'AsyncFunction':
1187
+ case 'GeneratorFunction':
1188
+ case 'AsyncGeneratorFunction': return false;
1189
+ }
1190
+ try {
1191
+ // we can't check .prototype since constructors produced by .bind haven't it
1192
+ // `Function#toString` throws on some built-it function in some legacy engines
1193
+ // (for example, `DOMQuad` and similar in FF41-)
1194
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
1195
+ } catch (error) {
1196
+ return true;
1197
+ }
1198
+ };
1199
+
1200
+ isConstructorLegacy.sham = true;
1201
+
1202
+ // `IsConstructor` abstract operation
1203
+ // https://tc39.es/ecma262/#sec-isconstructor
1204
+ var isConstructor$1 = !construct || fails$2(function () {
1205
+ var called;
1206
+ return isConstructorModern(isConstructorModern.call)
1207
+ || !isConstructorModern(Object)
1208
+ || !isConstructorModern(function () { called = true; })
1209
+ || called;
1210
+ }) ? isConstructorLegacy : isConstructorModern;
1211
+
1212
+ var isConstructor = isConstructor$1;
1213
+ var tryToString$2 = tryToString$4;
1214
+
1215
+ var $TypeError$4 = TypeError;
1216
+
1217
+ // `Assert: IsConstructor(argument) is true`
1218
+ var aConstructor$1 = function (argument) {
1219
+ if (isConstructor(argument)) return argument;
1220
+ throw $TypeError$4(tryToString$2(argument) + ' is not a constructor');
1221
+ };
1222
+
1223
+ var anObject$4 = anObject$8;
1224
+ var aConstructor = aConstructor$1;
1225
+ var isNullOrUndefined$1 = isNullOrUndefined$4;
1226
+ var wellKnownSymbol$4 = wellKnownSymbol$a;
1227
+
1228
+ var SPECIES$1 = wellKnownSymbol$4('species');
1229
+
1230
+ // `SpeciesConstructor` abstract operation
1231
+ // https://tc39.es/ecma262/#sec-speciesconstructor
1232
+ var speciesConstructor$1 = function (O, defaultConstructor) {
1233
+ var C = anObject$4(O).constructor;
1234
+ var S;
1235
+ return C === undefined || isNullOrUndefined$1(S = anObject$4(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
1236
+ };
1237
+
1238
+ var NATIVE_BIND$1 = functionBindNative;
1239
+
1240
+ var FunctionPrototype = Function.prototype;
1241
+ var apply$1 = FunctionPrototype.apply;
1242
+ var call$8 = FunctionPrototype.call;
1243
+
1244
+ // eslint-disable-next-line es/no-reflect -- safe
1245
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$8.bind(apply$1) : function () {
1246
+ return call$8.apply(apply$1, arguments);
1247
+ });
1248
+
1249
+ var classofRaw = classofRaw$2;
1250
+ var uncurryThis$3 = functionUncurryThis;
1251
+
1252
+ var functionUncurryThisClause = function (fn) {
1253
+ // Nashorn bug:
1254
+ // https://github.com/zloirock/core-js/issues/1128
1255
+ // https://github.com/zloirock/core-js/issues/1130
1256
+ if (classofRaw(fn) === 'Function') return uncurryThis$3(fn);
1257
+ };
1258
+
1259
+ var uncurryThis$2 = functionUncurryThisClause;
1260
+ var aCallable$5 = aCallable$7;
1261
+ var NATIVE_BIND = functionBindNative;
1262
+
1263
+ var bind$4 = uncurryThis$2(uncurryThis$2.bind);
1264
+
1265
+ // optional / simple context binding
1266
+ var functionBindContext = function (fn, that) {
1267
+ aCallable$5(fn);
1268
+ return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
1269
+ return fn.apply(that, arguments);
1270
+ };
1271
+ };
1272
+
1273
+ var getBuiltIn$2 = getBuiltIn$8;
1274
+
1275
+ var html$1 = getBuiltIn$2('document', 'documentElement');
1276
+
1277
+ var uncurryThis$1 = functionUncurryThis;
1278
+
1279
+ var arraySlice$1 = uncurryThis$1([].slice);
1280
+
1281
+ var $TypeError$3 = TypeError;
1282
+
1283
+ var validateArgumentsLength$1 = function (passed, required) {
1284
+ if (passed < required) throw $TypeError$3('Not enough arguments');
1285
+ return passed;
1286
+ };
1287
+
1288
+ var userAgent$2 = engineUserAgent;
1289
+
1290
+ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
1291
+
1292
+ var global$7 = global$i;
1293
+ var apply = functionApply;
1294
+ var bind$3 = functionBindContext;
1295
+ var isCallable$3 = isCallable$h;
1296
+ var hasOwn = hasOwnProperty_1;
1297
+ var fails$1 = fails$b;
1298
+ var html = html$1;
1299
+ var arraySlice = arraySlice$1;
1300
+ var createElement = documentCreateElement;
1301
+ var validateArgumentsLength = validateArgumentsLength$1;
1302
+ var IS_IOS$1 = engineIsIos;
1303
+ var IS_NODE$3 = engineIsNode;
1304
+
1305
+ var set = global$7.setImmediate;
1306
+ var clear = global$7.clearImmediate;
1307
+ var process$2 = global$7.process;
1308
+ var Dispatch = global$7.Dispatch;
1309
+ var Function$1 = global$7.Function;
1310
+ var MessageChannel = global$7.MessageChannel;
1311
+ var String$1 = global$7.String;
1312
+ var counter = 0;
1313
+ var queue$1 = {};
1314
+ var ONREADYSTATECHANGE = 'onreadystatechange';
1315
+ var $location, defer, channel, port;
1316
+
1317
+ try {
1318
+ // Deno throws a ReferenceError on `location` access without `--location` flag
1319
+ $location = global$7.location;
1320
+ } catch (error) { /* empty */ }
1321
+
1322
+ var run = function (id) {
1323
+ if (hasOwn(queue$1, id)) {
1324
+ var fn = queue$1[id];
1325
+ delete queue$1[id];
1326
+ fn();
1327
+ }
1328
+ };
1329
+
1330
+ var runner = function (id) {
1331
+ return function () {
1332
+ run(id);
1333
+ };
1334
+ };
1335
+
1336
+ var listener = function (event) {
1337
+ run(event.data);
1338
+ };
1339
+
1340
+ var post = function (id) {
1341
+ // old engines have not location.origin
1342
+ global$7.postMessage(String$1(id), $location.protocol + '//' + $location.host);
1343
+ };
1344
+
1345
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1346
+ if (!set || !clear) {
1347
+ set = function setImmediate(handler) {
1348
+ validateArgumentsLength(arguments.length, 1);
1349
+ var fn = isCallable$3(handler) ? handler : Function$1(handler);
1350
+ var args = arraySlice(arguments, 1);
1351
+ queue$1[++counter] = function () {
1352
+ apply(fn, undefined, args);
1353
+ };
1354
+ defer(counter);
1355
+ return counter;
1356
+ };
1357
+ clear = function clearImmediate(id) {
1358
+ delete queue$1[id];
1359
+ };
1360
+ // Node.js 0.8-
1361
+ if (IS_NODE$3) {
1362
+ defer = function (id) {
1363
+ process$2.nextTick(runner(id));
1364
+ };
1365
+ // Sphere (JS game engine) Dispatch API
1366
+ } else if (Dispatch && Dispatch.now) {
1367
+ defer = function (id) {
1368
+ Dispatch.now(runner(id));
1369
+ };
1370
+ // Browsers with MessageChannel, includes WebWorkers
1371
+ // except iOS - https://github.com/zloirock/core-js/issues/624
1372
+ } else if (MessageChannel && !IS_IOS$1) {
1373
+ channel = new MessageChannel();
1374
+ port = channel.port2;
1375
+ channel.port1.onmessage = listener;
1376
+ defer = bind$3(port.postMessage, port);
1377
+ // Browsers with postMessage, skip WebWorkers
1378
+ // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
1379
+ } else if (
1380
+ global$7.addEventListener &&
1381
+ isCallable$3(global$7.postMessage) &&
1382
+ !global$7.importScripts &&
1383
+ $location && $location.protocol !== 'file:' &&
1384
+ !fails$1(post)
1385
+ ) {
1386
+ defer = post;
1387
+ global$7.addEventListener('message', listener, false);
1388
+ // IE8-
1389
+ } else if (ONREADYSTATECHANGE in createElement('script')) {
1390
+ defer = function (id) {
1391
+ html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
1392
+ html.removeChild(this);
1393
+ run(id);
1394
+ };
1395
+ };
1396
+ // Rest old browsers
1397
+ } else {
1398
+ defer = function (id) {
1399
+ setTimeout(runner(id), 0);
1400
+ };
1401
+ }
1402
+ }
1403
+
1404
+ var task$1 = {
1405
+ set: set,
1406
+ clear: clear
1407
+ };
1408
+
1409
+ var userAgent$1 = engineUserAgent;
1410
+ var global$6 = global$i;
1411
+
1412
+ var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$6.Pebble !== undefined;
1413
+
1414
+ var userAgent = engineUserAgent;
1415
+
1416
+ var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
1417
+
1418
+ var global$5 = global$i;
1419
+ var bind$2 = functionBindContext;
1420
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1421
+ var macrotask = task$1.set;
1422
+ var IS_IOS = engineIsIos;
1423
+ var IS_IOS_PEBBLE = engineIsIosPebble;
1424
+ var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
1425
+ var IS_NODE$2 = engineIsNode;
1426
+
1427
+ var MutationObserver = global$5.MutationObserver || global$5.WebKitMutationObserver;
1428
+ var document$2 = global$5.document;
1429
+ var process$1 = global$5.process;
1430
+ var Promise$1 = global$5.Promise;
1431
+ // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
1432
+ var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$5, 'queueMicrotask');
1433
+ var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
1434
+
1435
+ var flush, head, last, notify$1, toggle, node, promise, then;
1436
+
1437
+ // modern engines have queueMicrotask method
1438
+ if (!queueMicrotask) {
1439
+ flush = function () {
1440
+ var parent, fn;
1441
+ if (IS_NODE$2 && (parent = process$1.domain)) parent.exit();
1442
+ while (head) {
1443
+ fn = head.fn;
1444
+ head = head.next;
1445
+ try {
1446
+ fn();
1447
+ } catch (error) {
1448
+ if (head) notify$1();
1449
+ else last = undefined;
1450
+ throw error;
1451
+ }
1452
+ } last = undefined;
1453
+ if (parent) parent.enter();
1454
+ };
1455
+
1456
+ // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
1457
+ // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
1458
+ if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
1459
+ toggle = true;
1460
+ node = document$2.createTextNode('');
1461
+ new MutationObserver(flush).observe(node, { characterData: true });
1462
+ notify$1 = function () {
1463
+ node.data = toggle = !toggle;
1464
+ };
1465
+ // environments with maybe non-completely correct, but existent Promise
1466
+ } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
1467
+ // Promise.resolve without an argument throws an error in LG WebOS 2
1468
+ promise = Promise$1.resolve(undefined);
1469
+ // workaround of WebKit ~ iOS Safari 10.1 bug
1470
+ promise.constructor = Promise$1;
1471
+ then = bind$2(promise.then, promise);
1472
+ notify$1 = function () {
1473
+ then(flush);
1474
+ };
1475
+ // Node.js without promises
1476
+ } else if (IS_NODE$2) {
1477
+ notify$1 = function () {
1478
+ process$1.nextTick(flush);
1479
+ };
1480
+ // for other environments - macrotask based on:
1481
+ // - setImmediate
1482
+ // - MessageChannel
1483
+ // - window.postMessage
1484
+ // - onreadystatechange
1485
+ // - setTimeout
1486
+ } else {
1487
+ // strange IE + webpack dev server bug - use .bind(global)
1488
+ macrotask = bind$2(macrotask, global$5);
1489
+ notify$1 = function () {
1490
+ macrotask(flush);
1491
+ };
1492
+ }
1493
+ }
1494
+
1495
+ var microtask$1 = queueMicrotask || function (fn) {
1496
+ var task = { fn: fn, next: undefined };
1497
+ if (last) last.next = task;
1498
+ if (!head) {
1499
+ head = task;
1500
+ notify$1();
1501
+ } last = task;
1502
+ };
1503
+
1504
+ var global$4 = global$i;
1505
+
1506
+ var hostReportErrors$1 = function (a, b) {
1507
+ var console = global$4.console;
1508
+ if (console && console.error) {
1509
+ arguments.length == 1 ? console.error(a) : console.error(a, b);
1510
+ }
1511
+ };
1512
+
1513
+ var perform$3 = function (exec) {
1514
+ try {
1515
+ return { error: false, value: exec() };
1516
+ } catch (error) {
1517
+ return { error: true, value: error };
1518
+ }
1519
+ };
1520
+
1521
+ var Queue$1 = function () {
1522
+ this.head = null;
1523
+ this.tail = null;
1524
+ };
1525
+
1526
+ Queue$1.prototype = {
1527
+ add: function (item) {
1528
+ var entry = { item: item, next: null };
1529
+ if (this.head) this.tail.next = entry;
1530
+ else this.head = entry;
1531
+ this.tail = entry;
1532
+ },
1533
+ get: function () {
1534
+ var entry = this.head;
1535
+ if (entry) {
1536
+ this.head = entry.next;
1537
+ if (this.tail === entry) this.tail = null;
1538
+ return entry.item;
1539
+ }
1540
+ }
1541
+ };
1542
+
1543
+ var queue = Queue$1;
1544
+
1545
+ var global$3 = global$i;
1546
+
1547
+ var promiseNativeConstructor = global$3.Promise;
1548
+
1549
+ /* global Deno -- Deno case */
1550
+
1551
+ var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
1552
+
1553
+ var IS_DENO$1 = engineIsDeno;
1554
+ var IS_NODE$1 = engineIsNode;
1555
+
1556
+ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
1557
+ && typeof window == 'object'
1558
+ && typeof document == 'object';
1559
+
1560
+ var global$2 = global$i;
1561
+ var NativePromiseConstructor$3 = promiseNativeConstructor;
1562
+ var isCallable$2 = isCallable$h;
1563
+ var isForced = isForced_1;
1564
+ var inspectSource = inspectSource$3;
1565
+ var wellKnownSymbol$3 = wellKnownSymbol$a;
1566
+ var IS_BROWSER = engineIsBrowser;
1567
+ var IS_DENO = engineIsDeno;
1568
+ var V8_VERSION = engineV8Version;
1569
+
1570
+ NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
1571
+ var SPECIES = wellKnownSymbol$3('species');
1572
+ var SUBCLASSING = false;
1573
+ var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$2(global$2.PromiseRejectionEvent);
1574
+
1575
+ var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
1576
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
1577
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
1578
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1579
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1580
+ // We can't detect it synchronously, so just check versions
1581
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
1582
+ // We can't use @@species feature detection in V8 since it causes
1583
+ // deoptimization and performance degradation
1584
+ // https://github.com/zloirock/core-js/issues/679
1585
+ if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
1586
+ // Detect correctness of subclassing with @@species support
1587
+ var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
1588
+ var FakePromise = function (exec) {
1589
+ exec(function () { /* empty */ }, function () { /* empty */ });
1590
+ };
1591
+ var constructor = promise.constructor = {};
1592
+ constructor[SPECIES] = FakePromise;
1593
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
1594
+ if (!SUBCLASSING) return true;
1595
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1596
+ } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
1597
+ });
1598
+
1599
+ var promiseConstructorDetection = {
1600
+ CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
1601
+ REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
1602
+ SUBCLASSING: SUBCLASSING
1603
+ };
1604
+
1605
+ var newPromiseCapability$2 = {};
1606
+
1607
+ var aCallable$4 = aCallable$7;
1608
+
1609
+ var $TypeError$2 = TypeError;
1610
+
1611
+ var PromiseCapability = function (C) {
1612
+ var resolve, reject;
1613
+ this.promise = new C(function ($$resolve, $$reject) {
1614
+ if (resolve !== undefined || reject !== undefined) throw $TypeError$2('Bad Promise constructor');
1615
+ resolve = $$resolve;
1616
+ reject = $$reject;
1617
+ });
1618
+ this.resolve = aCallable$4(resolve);
1619
+ this.reject = aCallable$4(reject);
1620
+ };
1621
+
1622
+ // `NewPromiseCapability` abstract operation
1623
+ // https://tc39.es/ecma262/#sec-newpromisecapability
1624
+ newPromiseCapability$2.f = function (C) {
1625
+ return new PromiseCapability(C);
1626
+ };
1627
+
1628
+ var $$6 = _export;
1629
+ var IS_NODE = engineIsNode;
1630
+ var global$1 = global$i;
1631
+ var call$7 = functionCall;
1632
+ var defineBuiltIn$1 = defineBuiltIn$3;
1633
+ var setPrototypeOf = objectSetPrototypeOf;
1634
+ var setToStringTag = setToStringTag$1;
1635
+ var setSpecies = setSpecies$1;
1636
+ var aCallable$3 = aCallable$7;
1637
+ var isCallable$1 = isCallable$h;
1638
+ var isObject$1 = isObject$7;
1639
+ var anInstance = anInstance$1;
1640
+ var speciesConstructor = speciesConstructor$1;
1641
+ var task = task$1.set;
1642
+ var microtask = microtask$1;
1643
+ var hostReportErrors = hostReportErrors$1;
1644
+ var perform$2 = perform$3;
1645
+ var Queue = queue;
1646
+ var InternalStateModule = internalState;
1647
+ var NativePromiseConstructor$2 = promiseNativeConstructor;
1648
+ var PromiseConstructorDetection = promiseConstructorDetection;
1649
+ var newPromiseCapabilityModule$3 = newPromiseCapability$2;
1650
+
1651
+ var PROMISE = 'Promise';
1652
+ var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
1653
+ var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
1654
+ var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
1655
+ var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
1656
+ var setInternalState = InternalStateModule.set;
1657
+ var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
1658
+ var PromiseConstructor = NativePromiseConstructor$2;
1659
+ var PromisePrototype = NativePromisePrototype$1;
1660
+ var TypeError$1 = global$1.TypeError;
1661
+ var document$1 = global$1.document;
1662
+ var process = global$1.process;
1663
+ var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
1664
+ var newGenericPromiseCapability = newPromiseCapability$1;
1665
+
1666
+ var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$1.dispatchEvent);
1667
+ var UNHANDLED_REJECTION = 'unhandledrejection';
1668
+ var REJECTION_HANDLED = 'rejectionhandled';
1669
+ var PENDING = 0;
1670
+ var FULFILLED = 1;
1671
+ var REJECTED = 2;
1672
+ var HANDLED = 1;
1673
+ var UNHANDLED = 2;
1674
+
1675
+ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
1676
+
1677
+ // helpers
1678
+ var isThenable = function (it) {
1679
+ var then;
1680
+ return isObject$1(it) && isCallable$1(then = it.then) ? then : false;
1681
+ };
1682
+
1683
+ var callReaction = function (reaction, state) {
1684
+ var value = state.value;
1685
+ var ok = state.state == FULFILLED;
1686
+ var handler = ok ? reaction.ok : reaction.fail;
1687
+ var resolve = reaction.resolve;
1688
+ var reject = reaction.reject;
1689
+ var domain = reaction.domain;
1690
+ var result, then, exited;
1691
+ try {
1692
+ if (handler) {
1693
+ if (!ok) {
1694
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
1695
+ state.rejection = HANDLED;
1696
+ }
1697
+ if (handler === true) result = value;
1698
+ else {
1699
+ if (domain) domain.enter();
1700
+ result = handler(value); // can throw
1701
+ if (domain) {
1702
+ domain.exit();
1703
+ exited = true;
1704
+ }
1705
+ }
1706
+ if (result === reaction.promise) {
1707
+ reject(TypeError$1('Promise-chain cycle'));
1708
+ } else if (then = isThenable(result)) {
1709
+ call$7(then, result, resolve, reject);
1710
+ } else resolve(result);
1711
+ } else reject(value);
1712
+ } catch (error) {
1713
+ if (domain && !exited) domain.exit();
1714
+ reject(error);
1715
+ }
1716
+ };
1717
+
1718
+ var notify = function (state, isReject) {
1719
+ if (state.notified) return;
1720
+ state.notified = true;
1721
+ microtask(function () {
1722
+ var reactions = state.reactions;
1723
+ var reaction;
1724
+ while (reaction = reactions.get()) {
1725
+ callReaction(reaction, state);
1726
+ }
1727
+ state.notified = false;
1728
+ if (isReject && !state.rejection) onUnhandled(state);
1729
+ });
1730
+ };
1731
+
1732
+ var dispatchEvent = function (name, promise, reason) {
1733
+ var event, handler;
1734
+ if (DISPATCH_EVENT) {
1735
+ event = document$1.createEvent('Event');
1736
+ event.promise = promise;
1737
+ event.reason = reason;
1738
+ event.initEvent(name, false, true);
1739
+ global$1.dispatchEvent(event);
1740
+ } else event = { promise: promise, reason: reason };
1741
+ if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$1['on' + name])) handler(event);
1742
+ else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
1743
+ };
1744
+
1745
+ var onUnhandled = function (state) {
1746
+ call$7(task, global$1, function () {
1747
+ var promise = state.facade;
1748
+ var value = state.value;
1749
+ var IS_UNHANDLED = isUnhandled(state);
1750
+ var result;
1751
+ if (IS_UNHANDLED) {
1752
+ result = perform$2(function () {
1753
+ if (IS_NODE) {
1754
+ process.emit('unhandledRejection', value, promise);
1755
+ } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
1756
+ });
1757
+ // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
1758
+ state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
1759
+ if (result.error) throw result.value;
1760
+ }
1761
+ });
1762
+ };
1763
+
1764
+ var isUnhandled = function (state) {
1765
+ return state.rejection !== HANDLED && !state.parent;
1766
+ };
1767
+
1768
+ var onHandleUnhandled = function (state) {
1769
+ call$7(task, global$1, function () {
1770
+ var promise = state.facade;
1771
+ if (IS_NODE) {
1772
+ process.emit('rejectionHandled', promise);
1773
+ } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
1774
+ });
1775
+ };
1776
+
1777
+ var bind$1 = function (fn, state, unwrap) {
1778
+ return function (value) {
1779
+ fn(state, value, unwrap);
1780
+ };
1781
+ };
1782
+
1783
+ var internalReject = function (state, value, unwrap) {
1784
+ if (state.done) return;
1785
+ state.done = true;
1786
+ if (unwrap) state = unwrap;
1787
+ state.value = value;
1788
+ state.state = REJECTED;
1789
+ notify(state, true);
1790
+ };
1791
+
1792
+ var internalResolve = function (state, value, unwrap) {
1793
+ if (state.done) return;
1794
+ state.done = true;
1795
+ if (unwrap) state = unwrap;
1796
+ try {
1797
+ if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
1798
+ var then = isThenable(value);
1799
+ if (then) {
1800
+ microtask(function () {
1801
+ var wrapper = { done: false };
1802
+ try {
1803
+ call$7(then, value,
1804
+ bind$1(internalResolve, wrapper, state),
1805
+ bind$1(internalReject, wrapper, state)
1806
+ );
1807
+ } catch (error) {
1808
+ internalReject(wrapper, error, state);
1809
+ }
1810
+ });
1811
+ } else {
1812
+ state.value = value;
1813
+ state.state = FULFILLED;
1814
+ notify(state, false);
1815
+ }
1816
+ } catch (error) {
1817
+ internalReject({ done: false }, error, state);
1818
+ }
1819
+ };
1820
+
1821
+ // constructor polyfill
1822
+ if (FORCED_PROMISE_CONSTRUCTOR$4) {
1823
+ // 25.4.3.1 Promise(executor)
1824
+ PromiseConstructor = function Promise(executor) {
1825
+ anInstance(this, PromisePrototype);
1826
+ aCallable$3(executor);
1827
+ call$7(Internal, this);
1828
+ var state = getInternalPromiseState(this);
1829
+ try {
1830
+ executor(bind$1(internalResolve, state), bind$1(internalReject, state));
1831
+ } catch (error) {
1832
+ internalReject(state, error);
1833
+ }
1834
+ };
1835
+
1836
+ PromisePrototype = PromiseConstructor.prototype;
1837
+
1838
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
1839
+ Internal = function Promise(executor) {
1840
+ setInternalState(this, {
1841
+ type: PROMISE,
1842
+ done: false,
1843
+ notified: false,
1844
+ parent: false,
1845
+ reactions: new Queue(),
1846
+ rejection: false,
1847
+ state: PENDING,
1848
+ value: undefined
1849
+ });
1850
+ };
1851
+
1852
+ // `Promise.prototype.then` method
1853
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
1854
+ Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
1855
+ var state = getInternalPromiseState(this);
1856
+ var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
1857
+ state.parent = true;
1858
+ reaction.ok = isCallable$1(onFulfilled) ? onFulfilled : true;
1859
+ reaction.fail = isCallable$1(onRejected) && onRejected;
1860
+ reaction.domain = IS_NODE ? process.domain : undefined;
1861
+ if (state.state == PENDING) state.reactions.add(reaction);
1862
+ else microtask(function () {
1863
+ callReaction(reaction, state);
1864
+ });
1865
+ return reaction.promise;
1866
+ });
1867
+
1868
+ OwnPromiseCapability = function () {
1869
+ var promise = new Internal();
1870
+ var state = getInternalPromiseState(promise);
1871
+ this.promise = promise;
1872
+ this.resolve = bind$1(internalResolve, state);
1873
+ this.reject = bind$1(internalReject, state);
1874
+ };
1875
+
1876
+ newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
1877
+ return C === PromiseConstructor || C === PromiseWrapper
1878
+ ? new OwnPromiseCapability(C)
1879
+ : newGenericPromiseCapability(C);
1880
+ };
1881
+
1882
+ if (isCallable$1(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
1883
+ nativeThen = NativePromisePrototype$1.then;
1884
+
1885
+ if (!NATIVE_PROMISE_SUBCLASSING) {
1886
+ // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
1887
+ defineBuiltIn$1(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
1888
+ var that = this;
1889
+ return new PromiseConstructor(function (resolve, reject) {
1890
+ call$7(nativeThen, that, resolve, reject);
1891
+ }).then(onFulfilled, onRejected);
1892
+ // https://github.com/zloirock/core-js/issues/640
1893
+ }, { unsafe: true });
1894
+ }
1895
+
1896
+ // make `.constructor === Promise` work for native promise-based APIs
1897
+ try {
1898
+ delete NativePromisePrototype$1.constructor;
1899
+ } catch (error) { /* empty */ }
1900
+
1901
+ // make `instanceof Promise` work for native promise-based APIs
1902
+ if (setPrototypeOf) {
1903
+ setPrototypeOf(NativePromisePrototype$1, PromisePrototype);
1904
+ }
1905
+ }
1906
+ }
1907
+
1908
+ $$6({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
1909
+ Promise: PromiseConstructor
1910
+ });
1911
+
1912
+ setToStringTag(PromiseConstructor, PROMISE, false);
1913
+ setSpecies(PROMISE);
1914
+
1915
+ var iterators = {};
1916
+
1917
+ var wellKnownSymbol$2 = wellKnownSymbol$a;
1918
+ var Iterators$1 = iterators;
1919
+
1920
+ var ITERATOR$2 = wellKnownSymbol$2('iterator');
1921
+ var ArrayPrototype = Array.prototype;
1922
+
1923
+ // check on default Array iterator
1924
+ var isArrayIteratorMethod$1 = function (it) {
1925
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
1926
+ };
1927
+
1928
+ var classof = classof$2;
1929
+ var getMethod$1 = getMethod$3;
1930
+ var isNullOrUndefined = isNullOrUndefined$4;
1931
+ var Iterators = iterators;
1932
+ var wellKnownSymbol$1 = wellKnownSymbol$a;
1933
+
1934
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
1935
+
1936
+ var getIteratorMethod$2 = function (it) {
1937
+ if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR$1)
1938
+ || getMethod$1(it, '@@iterator')
1939
+ || Iterators[classof(it)];
1940
+ };
1941
+
1942
+ var call$6 = functionCall;
1943
+ var aCallable$2 = aCallable$7;
1944
+ var anObject$3 = anObject$8;
1945
+ var tryToString$1 = tryToString$4;
1946
+ var getIteratorMethod$1 = getIteratorMethod$2;
1947
+
1948
+ var $TypeError$1 = TypeError;
1949
+
1950
+ var getIterator$1 = function (argument, usingIterator) {
1951
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
1952
+ if (aCallable$2(iteratorMethod)) return anObject$3(call$6(iteratorMethod, argument));
1953
+ throw $TypeError$1(tryToString$1(argument) + ' is not iterable');
1954
+ };
1955
+
1956
+ var call$5 = functionCall;
1957
+ var anObject$2 = anObject$8;
1958
+ var getMethod = getMethod$3;
1959
+
1960
+ var iteratorClose$1 = function (iterator, kind, value) {
1961
+ var innerResult, innerError;
1962
+ anObject$2(iterator);
1963
+ try {
1964
+ innerResult = getMethod(iterator, 'return');
1965
+ if (!innerResult) {
1966
+ if (kind === 'throw') throw value;
1967
+ return value;
1968
+ }
1969
+ innerResult = call$5(innerResult, iterator);
1970
+ } catch (error) {
1971
+ innerError = true;
1972
+ innerResult = error;
1973
+ }
1974
+ if (kind === 'throw') throw value;
1975
+ if (innerError) throw innerResult;
1976
+ anObject$2(innerResult);
1977
+ return value;
1978
+ };
1979
+
1980
+ var bind = functionBindContext;
1981
+ var call$4 = functionCall;
1982
+ var anObject$1 = anObject$8;
1983
+ var tryToString = tryToString$4;
1984
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
1985
+ var lengthOfArrayLike = lengthOfArrayLike$2;
1986
+ var isPrototypeOf = objectIsPrototypeOf;
1987
+ var getIterator = getIterator$1;
1988
+ var getIteratorMethod = getIteratorMethod$2;
1989
+ var iteratorClose = iteratorClose$1;
1990
+
1991
+ var $TypeError = TypeError;
1992
+
1993
+ var Result = function (stopped, result) {
1994
+ this.stopped = stopped;
1995
+ this.result = result;
1996
+ };
1997
+
1998
+ var ResultPrototype = Result.prototype;
1999
+
2000
+ var iterate$2 = function (iterable, unboundFunction, options) {
2001
+ var that = options && options.that;
2002
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2003
+ var IS_RECORD = !!(options && options.IS_RECORD);
2004
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2005
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
2006
+ var fn = bind(unboundFunction, that);
2007
+ var iterator, iterFn, index, length, result, next, step;
2008
+
2009
+ var stop = function (condition) {
2010
+ if (iterator) iteratorClose(iterator, 'normal', condition);
2011
+ return new Result(true, condition);
2012
+ };
2013
+
2014
+ var callFn = function (value) {
2015
+ if (AS_ENTRIES) {
2016
+ anObject$1(value);
2017
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2018
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
2019
+ };
2020
+
2021
+ if (IS_RECORD) {
2022
+ iterator = iterable.iterator;
2023
+ } else if (IS_ITERATOR) {
2024
+ iterator = iterable;
2025
+ } else {
2026
+ iterFn = getIteratorMethod(iterable);
2027
+ if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
2028
+ // optimisation for array iterators
2029
+ if (isArrayIteratorMethod(iterFn)) {
2030
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2031
+ result = callFn(iterable[index]);
2032
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
2033
+ } return new Result(false);
2034
+ }
2035
+ iterator = getIterator(iterable, iterFn);
2036
+ }
2037
+
2038
+ next = IS_RECORD ? iterable.next : iterator.next;
2039
+ while (!(step = call$4(next, iterator)).done) {
2040
+ try {
2041
+ result = callFn(step.value);
2042
+ } catch (error) {
2043
+ iteratorClose(iterator, 'throw', error);
2044
+ }
2045
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
2046
+ } return new Result(false);
2047
+ };
2048
+
2049
+ var wellKnownSymbol = wellKnownSymbol$a;
2050
+
2051
+ var ITERATOR = wellKnownSymbol('iterator');
2052
+ var SAFE_CLOSING = false;
2053
+
2054
+ try {
2055
+ var called = 0;
2056
+ var iteratorWithReturn = {
2057
+ next: function () {
2058
+ return { done: !!called++ };
2059
+ },
2060
+ 'return': function () {
2061
+ SAFE_CLOSING = true;
2062
+ }
2063
+ };
2064
+ iteratorWithReturn[ITERATOR] = function () {
2065
+ return this;
2066
+ };
2067
+ // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2068
+ Array.from(iteratorWithReturn, function () { throw 2; });
2069
+ } catch (error) { /* empty */ }
2070
+
2071
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
2072
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2073
+ var ITERATION_SUPPORT = false;
2074
+ try {
2075
+ var object = {};
2076
+ object[ITERATOR] = function () {
2077
+ return {
2078
+ next: function () {
2079
+ return { done: ITERATION_SUPPORT = true };
2080
+ }
2081
+ };
2082
+ };
2083
+ exec(object);
2084
+ } catch (error) { /* empty */ }
2085
+ return ITERATION_SUPPORT;
2086
+ };
2087
+
2088
+ var NativePromiseConstructor$1 = promiseNativeConstructor;
2089
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
2090
+ var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
2091
+
2092
+ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
2093
+ NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
2094
+ });
2095
+
2096
+ var $$5 = _export;
2097
+ var call$3 = functionCall;
2098
+ var aCallable$1 = aCallable$7;
2099
+ var newPromiseCapabilityModule$2 = newPromiseCapability$2;
2100
+ var perform$1 = perform$3;
2101
+ var iterate$1 = iterate$2;
2102
+ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
2103
+
2104
+ // `Promise.all` method
2105
+ // https://tc39.es/ecma262/#sec-promise.all
2106
+ $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2107
+ all: function all(iterable) {
2108
+ var C = this;
2109
+ var capability = newPromiseCapabilityModule$2.f(C);
2110
+ var resolve = capability.resolve;
2111
+ var reject = capability.reject;
2112
+ var result = perform$1(function () {
2113
+ var $promiseResolve = aCallable$1(C.resolve);
2114
+ var values = [];
2115
+ var counter = 0;
2116
+ var remaining = 1;
2117
+ iterate$1(iterable, function (promise) {
2118
+ var index = counter++;
2119
+ var alreadyCalled = false;
2120
+ remaining++;
2121
+ call$3($promiseResolve, C, promise).then(function (value) {
2122
+ if (alreadyCalled) return;
2123
+ alreadyCalled = true;
2124
+ values[index] = value;
2125
+ --remaining || resolve(values);
2126
+ }, reject);
2127
+ });
2128
+ --remaining || resolve(values);
2129
+ });
2130
+ if (result.error) reject(result.value);
2131
+ return capability.promise;
2132
+ }
2133
+ });
2134
+
2135
+ var $$4 = _export;
2136
+ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2137
+ var NativePromiseConstructor = promiseNativeConstructor;
2138
+ var getBuiltIn$1 = getBuiltIn$8;
2139
+ var isCallable = isCallable$h;
2140
+ var defineBuiltIn = defineBuiltIn$3;
2141
+
2142
+ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
2143
+
2144
+ // `Promise.prototype.catch` method
2145
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
2146
+ $$4({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2147
+ 'catch': function (onRejected) {
2148
+ return this.then(undefined, onRejected);
2149
+ }
2150
+ });
2151
+
2152
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
2153
+ if (isCallable(NativePromiseConstructor)) {
2154
+ var method = getBuiltIn$1('Promise').prototype['catch'];
2155
+ if (NativePromisePrototype['catch'] !== method) {
2156
+ defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
2157
+ }
2158
+ }
2159
+
2160
+ var $$3 = _export;
2161
+ var call$2 = functionCall;
2162
+ var aCallable = aCallable$7;
2163
+ var newPromiseCapabilityModule$1 = newPromiseCapability$2;
2164
+ var perform = perform$3;
2165
+ var iterate = iterate$2;
2166
+ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
2167
+
2168
+ // `Promise.race` method
2169
+ // https://tc39.es/ecma262/#sec-promise.race
2170
+ $$3({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2171
+ race: function race(iterable) {
2172
+ var C = this;
2173
+ var capability = newPromiseCapabilityModule$1.f(C);
2174
+ var reject = capability.reject;
2175
+ var result = perform(function () {
2176
+ var $promiseResolve = aCallable(C.resolve);
2177
+ iterate(iterable, function (promise) {
2178
+ call$2($promiseResolve, C, promise).then(capability.resolve, reject);
2179
+ });
2180
+ });
2181
+ if (result.error) reject(result.value);
2182
+ return capability.promise;
2183
+ }
2184
+ });
2185
+
2186
+ var $$2 = _export;
2187
+ var call$1 = functionCall;
2188
+ var newPromiseCapabilityModule = newPromiseCapability$2;
2189
+ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2190
+
2191
+ // `Promise.reject` method
2192
+ // https://tc39.es/ecma262/#sec-promise.reject
2193
+ $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2194
+ reject: function reject(r) {
2195
+ var capability = newPromiseCapabilityModule.f(this);
2196
+ call$1(capability.reject, undefined, r);
2197
+ return capability.promise;
2198
+ }
2199
+ });
2200
+
2201
+ var anObject = anObject$8;
2202
+ var isObject = isObject$7;
2203
+ var newPromiseCapability = newPromiseCapability$2;
2204
+
2205
+ var promiseResolve$1 = function (C, x) {
2206
+ anObject(C);
2207
+ if (isObject(x) && x.constructor === C) return x;
2208
+ var promiseCapability = newPromiseCapability.f(C);
2209
+ var resolve = promiseCapability.resolve;
2210
+ resolve(x);
2211
+ return promiseCapability.promise;
2212
+ };
2213
+
2214
+ var $$1 = _export;
2215
+ var getBuiltIn = getBuiltIn$8;
2216
+ var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2217
+ var promiseResolve = promiseResolve$1;
2218
+
2219
+ getBuiltIn('Promise');
2220
+
2221
+ // `Promise.resolve` method
2222
+ // https://tc39.es/ecma262/#sec-promise.resolve
2223
+ $$1({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2224
+ resolve: function resolve(x) {
2225
+ return promiseResolve(this, x);
2226
+ }
2227
+ });
2228
+
2229
+ var internalObjectKeys = objectKeysInternal;
2230
+ var enumBugKeys = enumBugKeys$2;
2231
+
2232
+ // `Object.keys` method
2233
+ // https://tc39.es/ecma262/#sec-object.keys
2234
+ // eslint-disable-next-line es/no-object-keys -- safe
2235
+ var objectKeys$1 = Object.keys || function keys(O) {
2236
+ return internalObjectKeys(O, enumBugKeys);
2237
+ };
2238
+
2239
+ var DESCRIPTORS = descriptors;
2240
+ var uncurryThis = functionUncurryThis;
2241
+ var call = functionCall;
2242
+ var fails = fails$b;
2243
+ var objectKeys = objectKeys$1;
2244
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2245
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
2246
+ var toObject = toObject$2;
2247
+ var IndexedObject = indexedObject;
2248
+
2249
+ // eslint-disable-next-line es/no-object-assign -- safe
2250
+ var $assign = Object.assign;
2251
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
2252
+ var defineProperty = Object.defineProperty;
2253
+ var concat = uncurryThis([].concat);
2254
+
2255
+ // `Object.assign` method
2256
+ // https://tc39.es/ecma262/#sec-object.assign
2257
+ var objectAssign = !$assign || fails(function () {
2258
+ // should have correct order of operations (Edge bug)
2259
+ if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
2260
+ enumerable: true,
2261
+ get: function () {
2262
+ defineProperty(this, 'b', {
2263
+ value: 3,
2264
+ enumerable: false
2265
+ });
2266
+ }
2267
+ }), { b: 2 })).b !== 1) return true;
2268
+ // should work with symbols and should have deterministic property order (V8 bug)
2269
+ var A = {};
2270
+ var B = {};
2271
+ // eslint-disable-next-line es/no-symbol -- safe
2272
+ var symbol = Symbol();
2273
+ var alphabet = 'abcdefghijklmnopqrst';
2274
+ A[symbol] = 7;
2275
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
2276
+ return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
2277
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
2278
+ var T = toObject(target);
2279
+ var argumentsLength = arguments.length;
2280
+ var index = 1;
2281
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
2282
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
2283
+ while (argumentsLength > index) {
2284
+ var S = IndexedObject(arguments[index++]);
2285
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
2286
+ var length = keys.length;
2287
+ var j = 0;
2288
+ var key;
2289
+ while (length > j) {
2290
+ key = keys[j++];
2291
+ if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
2292
+ }
2293
+ } return T;
2294
+ } : $assign;
2295
+
2296
+ var $ = _export;
2297
+ var assign = objectAssign;
2298
+
2299
+ // `Object.assign` method
2300
+ // https://tc39.es/ecma262/#sec-object.assign
2301
+ // eslint-disable-next-line es/no-object-assign -- required for testing
2302
+ $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
2303
+ assign: assign
2304
+ });
2305
+
2306
+ /******************************************************************************
2307
+ Copyright (c) Microsoft Corporation.
2308
+
2309
+ Permission to use, copy, modify, and/or distribute this software for any
2310
+ purpose with or without fee is hereby granted.
2311
+
2312
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2313
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2314
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2315
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2316
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2317
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2318
+ PERFORMANCE OF THIS SOFTWARE.
2319
+ ***************************************************************************** */
2320
+
2321
+ function __awaiter(thisArg, _arguments, P, generator) {
2322
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2323
+ return new (P || (P = Promise))(function (resolve, reject) {
2324
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2325
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2326
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2327
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2328
+ });
2329
+ }
2330
+
2331
+ const CONTAINER_WIDTH = 432;
2332
+ const BUTTON_WIDTH = 48;
2333
+ const BUTTON_HEIGHT = 192;
2334
+ const BUTTON_BOTTOM_POSITION = 128;
2335
+ const TRANSFORM_CLOSED = `translate(${CONTAINER_WIDTH - BUTTON_WIDTH}px, 0px)`;
2336
+ const TRANSFORM_CLOSED_HIDE = `translate(${CONTAINER_WIDTH}px, 0px)`;
2337
+ const TRANSFORM_OPEN = `translate(0px, 0px)`;
2338
+ class WidgetContainer {
2339
+ constructor(options) {
2340
+ var _a, _b;
2341
+ this.options = options;
2342
+ this.container = document.createElement('div');
2343
+ this.container.style.position = 'fixed';
2344
+ this.container.style.zIndex = '999999';
2345
+ this.container.style.right = '0px';
2346
+ this.container.style.bottom = `${BUTTON_BOTTOM_POSITION}px`;
2347
+ this.container.style.width = `${CONTAINER_WIDTH}px`;
2348
+ this.container.style.height = `${BUTTON_HEIGHT}px`;
2349
+ if ((_b = (_a = options.ui) === null || _a === void 0 ? void 0 : _a.opener) === null || _b === void 0 ? void 0 : _b.hide) {
2350
+ this.container.style.transform = TRANSFORM_CLOSED_HIDE;
2351
+ } else {
2352
+ this.container.style.transform = TRANSFORM_CLOSED;
2353
+ }
2354
+ this.container.style.transitionTimingFunction = 'cubic-bezier(0.4, 0, 0.2, 1)';
2355
+ this.container.style.transitionDuration = '700ms';
2356
+ this.container.style.transitionProperty = 'transform';
2357
+ document.body.appendChild(this.container);
2358
+ }
2359
+ open() {
2360
+ this.container.style.transform = TRANSFORM_OPEN;
2361
+ this.container.style.height = '100vh';
2362
+ this.container.style.bottom = `0px`;
2363
+ }
2364
+ close() {
2365
+ var _a, _b;
2366
+ if ((_b = (_a = this.options.ui) === null || _a === void 0 ? void 0 : _a.opener) === null || _b === void 0 ? void 0 : _b.hide) {
2367
+ this.container.style.transform = TRANSFORM_CLOSED_HIDE;
2368
+ } else {
2369
+ this.container.style.transform = TRANSFORM_CLOSED;
2370
+ }
2371
+ setTimeout(() => {
2372
+ this.container.style.height = `${BUTTON_HEIGHT}px`;
2373
+ this.container.style.bottom = `${BUTTON_BOTTOM_POSITION}px`;
2374
+ }, 700);
2375
+ }
2376
+ get element() {
2377
+ return this.container;
2378
+ }
2379
+ }
2380
+
2381
+ const NinetailedPreviewPlugin = ({
2382
+ clientId,
2383
+ secret,
2384
+ url,
2385
+ environment,
2386
+ ui
2387
+ }) => {
2388
+ let isOpen = false;
2389
+ let activatedAudiences = [];
2390
+ let audiences = [];
2391
+ let lastProfile;
2392
+ return {
2393
+ name: 'ninetailed:preview' + Math.random(),
2394
+ config: {},
2395
+ initialize: ({
2396
+ instance
2397
+ }) => __awaiter(void 0, void 0, void 0, function* () {
2398
+ var _a;
2399
+ if (typeof window !== 'undefined') {
2400
+ const {
2401
+ PreviewBridge
2402
+ } = yield Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@ninetailed/experience.js-preview-bridge')); });
2403
+ const container = new WidgetContainer({
2404
+ ui
2405
+ });
2406
+ const preview = PreviewBridge({
2407
+ url
2408
+ });
2409
+ preview.render(container.element);
2410
+ const open = () => {
2411
+ container.open();
2412
+ isOpen = true;
2413
+ instance.dispatch({
2414
+ type: 'preview:change'
2415
+ });
2416
+ };
2417
+ const close = () => {
2418
+ container.close();
2419
+ setTimeout(() => {
2420
+ isOpen = false;
2421
+ instance.dispatch({
2422
+ type: 'preview:change'
2423
+ });
2424
+ }, 700);
2425
+ };
2426
+ const toggle = () => {
2427
+ if (isOpen) {
2428
+ close();
2429
+ } else {
2430
+ open();
2431
+ }
2432
+ };
2433
+ const activateAudience = id => {
2434
+ activatedAudiences = union__default["default"](activatedAudiences, [id]);
2435
+ instance.dispatch({
2436
+ type: 'profile',
2437
+ profile: lastProfile
2438
+ });
2439
+ };
2440
+ const deactivateAudience = id => {
2441
+ activatedAudiences = activatedAudiences.filter(activatedAudience => activatedAudience !== id);
2442
+ instance.dispatch({
2443
+ type: 'profile',
2444
+ profile: lastProfile
2445
+ });
2446
+ };
2447
+ const buildPreviewPlugin = () => ({
2448
+ open: () => open(),
2449
+ close: () => close(),
2450
+ toggle: () => toggle(),
2451
+ isOpen,
2452
+ activateAudience: id => activateAudience(id),
2453
+ deactivateAudience: id => deactivateAudience(id),
2454
+ activatedAudiences,
2455
+ audiences
2456
+ });
2457
+ window.ninetailed = Object.assign({}, window.ninetailed, {
2458
+ plugins: Object.assign(Object.assign({}, (_a = window.ninetailed) === null || _a === void 0 ? void 0 : _a.plugins), {
2459
+ preview: buildPreviewPlugin()
2460
+ })
2461
+ });
2462
+ const buildNinetailed = () => {
2463
+ var _a;
2464
+ return Object.assign({}, window.ninetailed, {
2465
+ version: '1.5.1',
2466
+ plugins: Object.assign(Object.assign({}, (_a = window.ninetailed) === null || _a === void 0 ? void 0 : _a.plugins), {
2467
+ preview: buildPreviewPlugin()
2468
+ }),
2469
+ credentials: {
2470
+ clientId,
2471
+ secret,
2472
+ environment
2473
+ }
2474
+ });
2475
+ };
2476
+ instance.on('profile', () => {
2477
+ preview.updateProps({
2478
+ props: buildNinetailed()
2479
+ });
2480
+ });
2481
+ instance.on('preview:change', () => {
2482
+ preview.updateProps({
2483
+ props: buildNinetailed()
2484
+ });
2485
+ });
2486
+ }
2487
+ }),
2488
+ profile: ({
2489
+ payload
2490
+ }) => {
2491
+ var _a;
2492
+ audiences = ((_a = payload === null || payload === void 0 ? void 0 : payload.profile) === null || _a === void 0 ? void 0 : _a.audiences) || [];
2493
+ lastProfile = payload.profile;
2494
+ return Object.assign(Object.assign({}, payload), {
2495
+ profile: Object.assign(Object.assign({}, payload.profile), {
2496
+ audiences: union__default["default"](audiences, activatedAudiences)
2497
+ })
2498
+ });
2499
+ },
2500
+ loaded: () => true
2501
+ };
2502
+ };
2503
+
2504
+ if (typeof window === 'object' && !('process' in window)) {
2505
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2506
+ window.process = {};
2507
+ }
2508
+
2509
+ exports.NinetailedPreviewPlugin = NinetailedPreviewPlugin;
2510
+ exports["default"] = NinetailedPreviewPlugin;