@cubejs-client/ws-transport 0.34.25 → 0.34.32

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.
@@ -122,7 +122,7 @@
122
122
  }
123
123
 
124
124
  var check = function (it) {
125
- return it && it.Math == Math && it;
125
+ return it && it.Math === Math && it;
126
126
  };
127
127
 
128
128
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
@@ -133,6 +133,7 @@
133
133
  // eslint-disable-next-line no-restricted-globals -- safe
134
134
  check(typeof self == 'object' && self) ||
135
135
  check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
136
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
136
137
  // eslint-disable-next-line no-new-func -- fallback
137
138
  (function () { return this; })() || Function('return this')();
138
139
 
@@ -147,12 +148,19 @@
147
148
  // Detect IE8's incomplete defineProperty implementation
148
149
  var descriptors = !fails(function () {
149
150
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
150
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
151
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
152
+ });
153
+
154
+ var functionBindNative = !fails(function () {
155
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
156
+ var test = (function () { /* empty */ }).bind();
157
+ // eslint-disable-next-line no-prototype-builtins -- safe
158
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
151
159
  });
152
160
 
153
161
  var call$2 = Function.prototype.call;
154
162
 
155
- var functionCall = call$2.bind ? call$2.bind(call$2) : function () {
163
+ var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
156
164
  return call$2.apply(call$2, arguments);
157
165
  };
158
166
 
@@ -165,13 +173,13 @@
165
173
 
166
174
  // `Object.prototype.propertyIsEnumerable` method implementation
167
175
  // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
168
- var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
176
+ var f$6 = NASHORN_BUG ? function propertyIsEnumerable(V) {
169
177
  var descriptor = getOwnPropertyDescriptor$2(this, V);
170
178
  return !!descriptor && descriptor.enumerable;
171
179
  } : $propertyIsEnumerable;
172
180
 
173
181
  var objectPropertyIsEnumerable = {
174
- f: f$5
182
+ f: f$6
175
183
  };
176
184
 
177
185
  var createPropertyDescriptor = function (bitmap, value) {
@@ -184,14 +192,11 @@
184
192
  };
185
193
 
186
194
  var FunctionPrototype$2 = Function.prototype;
187
- var bind$3 = FunctionPrototype$2.bind;
188
195
  var call$1 = FunctionPrototype$2.call;
189
- var callBind = bind$3 && bind$3.bind(call$1);
196
+ var uncurryThisWithBind = functionBindNative && FunctionPrototype$2.bind.bind(call$1, call$1);
190
197
 
191
- var functionUncurryThis = bind$3 ? function (fn) {
192
- return fn && callBind(call$1, fn);
193
- } : function (fn) {
194
- return fn && function () {
198
+ var functionUncurryThis = functionBindNative ? uncurryThisWithBind : function (fn) {
199
+ return function () {
195
200
  return call$1.apply(fn, arguments);
196
201
  };
197
202
  };
@@ -203,24 +208,30 @@
203
208
  return stringSlice(toString$1(it), 8, -1);
204
209
  };
205
210
 
206
- var Object$4 = global$1.Object;
211
+ var $Object$3 = Object;
207
212
  var split = functionUncurryThis(''.split);
208
213
 
209
214
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
210
215
  var indexedObject = fails(function () {
211
216
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
212
217
  // eslint-disable-next-line no-prototype-builtins -- safe
213
- return !Object$4('z').propertyIsEnumerable(0);
218
+ return !$Object$3('z').propertyIsEnumerable(0);
214
219
  }) ? function (it) {
215
- return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
216
- } : Object$4;
220
+ return classofRaw(it) === 'String' ? split(it, '') : $Object$3(it);
221
+ } : $Object$3;
222
+
223
+ // we can't use just `it == null` since of `document.all` special case
224
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
225
+ var isNullOrUndefined = function (it) {
226
+ return it === null || it === undefined;
227
+ };
217
228
 
218
- var TypeError$d = global$1.TypeError;
229
+ var $TypeError$c = TypeError;
219
230
 
220
231
  // `RequireObjectCoercible` abstract operation
221
232
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
222
233
  var requireObjectCoercible = function (it) {
223
- if (it == undefined) throw TypeError$d("Can't call method on " + it);
234
+ if (isNullOrUndefined(it)) throw new $TypeError$c("Can't call method on " + it);
224
235
  return it;
225
236
  };
226
237
 
@@ -232,13 +243,32 @@
232
243
  return indexedObject(requireObjectCoercible(it));
233
244
  };
234
245
 
246
+ var documentAll$2 = typeof document == 'object' && document.all;
247
+
248
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
249
+ // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
250
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
251
+
252
+ var documentAll_1 = {
253
+ all: documentAll$2,
254
+ IS_HTMLDDA: IS_HTMLDDA
255
+ };
256
+
257
+ var documentAll$1 = documentAll_1.all;
258
+
235
259
  // `IsCallable` abstract operation
236
260
  // https://tc39.es/ecma262/#sec-iscallable
237
- var isCallable = function (argument) {
261
+ var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) {
262
+ return typeof argument == 'function' || argument === documentAll$1;
263
+ } : function (argument) {
238
264
  return typeof argument == 'function';
239
265
  };
240
266
 
241
- var isObject = function (it) {
267
+ var documentAll = documentAll_1.all;
268
+
269
+ var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
270
+ return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;
271
+ } : function (it) {
242
272
  return typeof it == 'object' ? it !== null : isCallable(it);
243
273
  };
244
274
 
@@ -252,11 +282,11 @@
252
282
 
253
283
  var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
254
284
 
255
- var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
285
+ var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
256
286
 
257
287
  var process$3 = global$1.process;
258
- var Deno = global$1.Deno;
259
- var versions = process$3 && process$3.versions || Deno && Deno.version;
288
+ var Deno$1 = global$1.Deno;
289
+ var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
260
290
  var v8 = versions && versions.v8;
261
291
  var match, version;
262
292
 
@@ -281,57 +311,65 @@
281
311
 
282
312
  /* eslint-disable es/no-symbol -- required for testing */
283
313
 
314
+
315
+
316
+
317
+ var $String$3 = global$1.String;
318
+
284
319
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
285
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
286
- var symbol = Symbol();
320
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(function () {
321
+ var symbol = Symbol('symbol detection');
287
322
  // Chrome 38 Symbol has incorrect toString conversion
288
323
  // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
289
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
324
+ // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
325
+ // of course, fail.
326
+ return !$String$3(symbol) || !(Object(symbol) instanceof Symbol) ||
290
327
  // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
291
328
  !Symbol.sham && engineV8Version && engineV8Version < 41;
292
329
  });
293
330
 
294
331
  /* eslint-disable es/no-symbol -- required for testing */
295
332
 
296
- var useSymbolAsUid = nativeSymbol
333
+
334
+ var useSymbolAsUid = symbolConstructorDetection
297
335
  && !Symbol.sham
298
336
  && typeof Symbol.iterator == 'symbol';
299
337
 
300
- var Object$3 = global$1.Object;
338
+ var $Object$2 = Object;
301
339
 
302
340
  var isSymbol = useSymbolAsUid ? function (it) {
303
341
  return typeof it == 'symbol';
304
342
  } : function (it) {
305
343
  var $Symbol = getBuiltIn('Symbol');
306
- return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
344
+ return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, $Object$2(it));
307
345
  };
308
346
 
309
- var String$4 = global$1.String;
347
+ var $String$2 = String;
310
348
 
311
349
  var tryToString = function (argument) {
312
350
  try {
313
- return String$4(argument);
351
+ return $String$2(argument);
314
352
  } catch (error) {
315
353
  return 'Object';
316
354
  }
317
355
  };
318
356
 
319
- var TypeError$c = global$1.TypeError;
357
+ var $TypeError$b = TypeError;
320
358
 
321
359
  // `Assert: IsCallable(argument) is true`
322
360
  var aCallable = function (argument) {
323
361
  if (isCallable(argument)) return argument;
324
- throw TypeError$c(tryToString(argument) + ' is not a function');
362
+ throw new $TypeError$b(tryToString(argument) + ' is not a function');
325
363
  };
326
364
 
327
365
  // `GetMethod` abstract operation
328
366
  // https://tc39.es/ecma262/#sec-getmethod
329
367
  var getMethod = function (V, P) {
330
368
  var func = V[P];
331
- return func == null ? undefined : aCallable(func);
369
+ return isNullOrUndefined(func) ? undefined : aCallable(func);
332
370
  };
333
371
 
334
- var TypeError$b = global$1.TypeError;
372
+ var $TypeError$a = TypeError;
335
373
 
336
374
  // `OrdinaryToPrimitive` abstract operation
337
375
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
@@ -340,47 +378,53 @@
340
378
  if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
341
379
  if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
342
380
  if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
343
- throw TypeError$b("Can't convert object to primitive value");
381
+ throw new $TypeError$a("Can't convert object to primitive value");
344
382
  };
345
383
 
346
384
  // eslint-disable-next-line es/no-object-defineproperty -- safe
347
- var defineProperty$1 = Object.defineProperty;
385
+ var defineProperty$2 = Object.defineProperty;
348
386
 
349
- var setGlobal = function (key, value) {
387
+ var defineGlobalProperty = function (key, value) {
350
388
  try {
351
- defineProperty$1(global$1, key, { value: value, configurable: true, writable: true });
389
+ defineProperty$2(global$1, key, { value: value, configurable: true, writable: true });
352
390
  } catch (error) {
353
391
  global$1[key] = value;
354
392
  } return value;
355
393
  };
356
394
 
357
395
  var SHARED = '__core-js_shared__';
358
- var store$1 = global$1[SHARED] || setGlobal(SHARED, {});
396
+ var store$1 = global$1[SHARED] || defineGlobalProperty(SHARED, {});
359
397
 
360
398
  var sharedStore = store$1;
361
399
 
362
400
  var shared = createCommonjsModule(function (module) {
401
+
402
+
403
+
363
404
  (module.exports = function (key, value) {
364
405
  return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
365
406
  })('versions', []).push({
366
- version: '3.19.3',
407
+ version: '3.34.0',
367
408
  mode: 'global',
368
- copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
409
+ copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
410
+ license: 'https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE',
411
+ source: 'https://github.com/zloirock/core-js'
369
412
  });
370
413
  });
371
414
 
372
- var Object$2 = global$1.Object;
415
+ var $Object$1 = Object;
373
416
 
374
417
  // `ToObject` abstract operation
375
418
  // https://tc39.es/ecma262/#sec-toobject
376
419
  var toObject = function (argument) {
377
- return Object$2(requireObjectCoercible(argument));
420
+ return $Object$1(requireObjectCoercible(argument));
378
421
  };
379
422
 
380
423
  var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
381
424
 
382
425
  // `HasOwnProperty` abstract operation
383
426
  // https://tc39.es/ecma262/#sec-hasownproperty
427
+ // eslint-disable-next-line es/no-object-hasown -- safe
384
428
  var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
385
429
  return hasOwnProperty(toObject(it), key);
386
430
  };
@@ -393,25 +437,19 @@
393
437
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
394
438
  };
395
439
 
396
- var WellKnownSymbolsStore = shared('wks');
397
440
  var Symbol$1 = global$1.Symbol;
398
- var symbolFor = Symbol$1 && Symbol$1['for'];
399
- var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
441
+ var WellKnownSymbolsStore = shared('wks');
442
+ var createWellKnownSymbol = useSymbolAsUid ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
400
443
 
401
444
  var wellKnownSymbol = function (name) {
402
- if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
403
- var description = 'Symbol.' + name;
404
- if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
405
- WellKnownSymbolsStore[name] = Symbol$1[name];
406
- } else if (useSymbolAsUid && symbolFor) {
407
- WellKnownSymbolsStore[name] = symbolFor(description);
408
- } else {
409
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
410
- }
445
+ if (!hasOwnProperty_1(WellKnownSymbolsStore, name)) {
446
+ WellKnownSymbolsStore[name] = symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)
447
+ ? Symbol$1[name]
448
+ : createWellKnownSymbol('Symbol.' + name);
411
449
  } return WellKnownSymbolsStore[name];
412
450
  };
413
451
 
414
- var TypeError$a = global$1.TypeError;
452
+ var $TypeError$9 = TypeError;
415
453
  var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
416
454
 
417
455
  // `ToPrimitive` abstract operation
@@ -424,7 +462,7 @@
424
462
  if (pref === undefined) pref = 'default';
425
463
  result = functionCall(exoticToPrim, input, pref);
426
464
  if (!isObject(result) || isSymbol(result)) return result;
427
- throw TypeError$a("Can't convert object to primitive value");
465
+ throw new $TypeError$9("Can't convert object to primitive value");
428
466
  }
429
467
  if (pref === undefined) pref = 'number';
430
468
  return ordinaryToPrimitive(input, pref);
@@ -445,61 +483,91 @@
445
483
  return EXISTS$1 ? document$3.createElement(it) : {};
446
484
  };
447
485
 
448
- // Thank's IE8 for his funny defineProperty
486
+ // Thanks to IE8 for its funny defineProperty
449
487
  var ie8DomDefine = !descriptors && !fails(function () {
450
- // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
488
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
451
489
  return Object.defineProperty(documentCreateElement('div'), 'a', {
452
490
  get: function () { return 7; }
453
- }).a != 7;
491
+ }).a !== 7;
454
492
  });
455
493
 
456
494
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
457
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
495
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
458
496
 
459
497
  // `Object.getOwnPropertyDescriptor` method
460
498
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
461
- var f$4 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
499
+ var f$5 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
462
500
  O = toIndexedObject(O);
463
501
  P = toPropertyKey(P);
464
502
  if (ie8DomDefine) try {
465
- return $getOwnPropertyDescriptor(O, P);
503
+ return $getOwnPropertyDescriptor$1(O, P);
466
504
  } catch (error) { /* empty */ }
467
505
  if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
468
506
  };
469
507
 
470
508
  var objectGetOwnPropertyDescriptor = {
471
- f: f$4
509
+ f: f$5
472
510
  };
473
511
 
474
- var String$3 = global$1.String;
475
- var TypeError$9 = global$1.TypeError;
512
+ // V8 ~ Chrome 36-
513
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
514
+ var v8PrototypeDefineBug = descriptors && fails(function () {
515
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
516
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
517
+ value: 42,
518
+ writable: false
519
+ }).prototype !== 42;
520
+ });
521
+
522
+ var $String$1 = String;
523
+ var $TypeError$8 = TypeError;
476
524
 
477
525
  // `Assert: Type(argument) is Object`
478
526
  var anObject = function (argument) {
479
527
  if (isObject(argument)) return argument;
480
- throw TypeError$9(String$3(argument) + ' is not an object');
528
+ throw new $TypeError$8($String$1(argument) + ' is not an object');
481
529
  };
482
530
 
483
- var TypeError$8 = global$1.TypeError;
531
+ var $TypeError$7 = TypeError;
484
532
  // eslint-disable-next-line es/no-object-defineproperty -- safe
485
533
  var $defineProperty = Object.defineProperty;
534
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
535
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
536
+ var ENUMERABLE = 'enumerable';
537
+ var CONFIGURABLE$1 = 'configurable';
538
+ var WRITABLE = 'writable';
486
539
 
487
540
  // `Object.defineProperty` method
488
541
  // https://tc39.es/ecma262/#sec-object.defineproperty
489
- var f$3 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
542
+ var f$4 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
543
+ anObject(O);
544
+ P = toPropertyKey(P);
545
+ anObject(Attributes);
546
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
547
+ var current = $getOwnPropertyDescriptor(O, P);
548
+ if (current && current[WRITABLE]) {
549
+ O[P] = Attributes.value;
550
+ Attributes = {
551
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
552
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
553
+ writable: false
554
+ };
555
+ }
556
+ } return $defineProperty(O, P, Attributes);
557
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
490
558
  anObject(O);
491
559
  P = toPropertyKey(P);
492
560
  anObject(Attributes);
493
561
  if (ie8DomDefine) try {
494
562
  return $defineProperty(O, P, Attributes);
495
563
  } catch (error) { /* empty */ }
496
- if ('get' in Attributes || 'set' in Attributes) throw TypeError$8('Accessors not supported');
564
+ if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$7('Accessors not supported');
497
565
  if ('value' in Attributes) O[P] = Attributes.value;
498
566
  return O;
499
567
  };
500
568
 
501
569
  var objectDefineProperty = {
502
- f: f$3
570
+ f: f$4
503
571
  };
504
572
 
505
573
  var createNonEnumerableProperty = descriptors ? function (object, key, value) {
@@ -509,6 +577,21 @@
509
577
  return object;
510
578
  };
511
579
 
580
+ var FunctionPrototype$1 = Function.prototype;
581
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
582
+ var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
583
+
584
+ var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
585
+ // additional protection from minified / mangled / dropped function names
586
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
587
+ var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
588
+
589
+ var functionName = {
590
+ EXISTS: EXISTS,
591
+ PROPER: PROPER,
592
+ CONFIGURABLE: CONFIGURABLE
593
+ };
594
+
512
595
  var functionToString = functionUncurryThis(Function.toString);
513
596
 
514
597
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
@@ -522,7 +605,7 @@
522
605
 
523
606
  var WeakMap$1 = global$1.WeakMap;
524
607
 
525
- var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
608
+ var weakMapBasicDetection = isCallable(WeakMap$1) && /native code/.test(String(WeakMap$1));
526
609
 
527
610
  var keys = shared('keys');
528
611
 
@@ -533,7 +616,7 @@
533
616
  var hiddenKeys$1 = {};
534
617
 
535
618
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
536
- var TypeError$7 = global$1.TypeError;
619
+ var TypeError$2 = global$1.TypeError;
537
620
  var WeakMap = global$1.WeakMap;
538
621
  var set$1, get, has;
539
622
 
@@ -545,33 +628,35 @@
545
628
  return function (it) {
546
629
  var state;
547
630
  if (!isObject(it) || (state = get(it)).type !== TYPE) {
548
- throw TypeError$7('Incompatible receiver, ' + TYPE + ' required');
631
+ throw new TypeError$2('Incompatible receiver, ' + TYPE + ' required');
549
632
  } return state;
550
633
  };
551
634
  };
552
635
 
553
- if (nativeWeakMap || sharedStore.state) {
636
+ if (weakMapBasicDetection || sharedStore.state) {
554
637
  var store = sharedStore.state || (sharedStore.state = new WeakMap());
555
- var wmget = functionUncurryThis(store.get);
556
- var wmhas = functionUncurryThis(store.has);
557
- var wmset = functionUncurryThis(store.set);
638
+ /* eslint-disable no-self-assign -- prototype methods protection */
639
+ store.get = store.get;
640
+ store.has = store.has;
641
+ store.set = store.set;
642
+ /* eslint-enable no-self-assign -- prototype methods protection */
558
643
  set$1 = function (it, metadata) {
559
- if (wmhas(store, it)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
644
+ if (store.has(it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
560
645
  metadata.facade = it;
561
- wmset(store, it, metadata);
646
+ store.set(it, metadata);
562
647
  return metadata;
563
648
  };
564
649
  get = function (it) {
565
- return wmget(store, it) || {};
650
+ return store.get(it) || {};
566
651
  };
567
652
  has = function (it) {
568
- return wmhas(store, it);
653
+ return store.has(it);
569
654
  };
570
655
  } else {
571
656
  var STATE = sharedKey('state');
572
657
  hiddenKeys$1[STATE] = true;
573
658
  set$1 = function (it, metadata) {
574
- if (hasOwnProperty_1(it, STATE)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
659
+ if (hasOwnProperty_1(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
575
660
  metadata.facade = it;
576
661
  createNonEnumerableProperty(it, STATE, metadata);
577
662
  return metadata;
@@ -592,72 +677,103 @@
592
677
  getterFor: getterFor
593
678
  };
594
679
 
595
- var FunctionPrototype$1 = Function.prototype;
596
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
597
- var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
680
+ var makeBuiltIn_1 = createCommonjsModule(function (module) {
681
+
682
+
598
683
 
599
- var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
600
- // additional protection from minified / mangled / dropped function names
601
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
602
- var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
603
684
 
604
- var functionName = {
605
- EXISTS: EXISTS,
606
- PROPER: PROPER,
607
- CONFIGURABLE: CONFIGURABLE
608
- };
609
685
 
610
- var redefine = createCommonjsModule(function (module) {
611
686
  var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
612
687
 
613
- var getInternalState = internalState.get;
688
+
689
+
614
690
  var enforceInternalState = internalState.enforce;
691
+ var getInternalState = internalState.get;
692
+ var $String = String;
693
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
694
+ var defineProperty = Object.defineProperty;
695
+ var stringSlice = functionUncurryThis(''.slice);
696
+ var replace = functionUncurryThis(''.replace);
697
+ var join = functionUncurryThis([].join);
698
+
699
+ var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
700
+ return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
701
+ });
702
+
615
703
  var TEMPLATE = String(String).split('String');
616
704
 
617
- (module.exports = function (O, key, value, options) {
618
- var unsafe = options ? !!options.unsafe : false;
619
- var simple = options ? !!options.enumerable : false;
620
- var noTargetGet = options ? !!options.noTargetGet : false;
621
- var name = options && options.name !== undefined ? options.name : key;
622
- var state;
623
- if (isCallable(value)) {
624
- if (String(name).slice(0, 7) === 'Symbol(') {
625
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
626
- }
627
- if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
628
- createNonEnumerableProperty(value, 'name', name);
629
- }
630
- state = enforceInternalState(value);
631
- if (!state.source) {
632
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
633
- }
705
+ var makeBuiltIn = module.exports = function (value, name, options) {
706
+ if (stringSlice($String(name), 0, 7) === 'Symbol(') {
707
+ name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
634
708
  }
635
- if (O === global$1) {
636
- if (simple) O[key] = value;
637
- else setGlobal(key, value);
638
- return;
639
- } else if (!unsafe) {
640
- delete O[key];
641
- } else if (!noTargetGet && O[key]) {
642
- simple = true;
709
+ if (options && options.getter) name = 'get ' + name;
710
+ if (options && options.setter) name = 'set ' + name;
711
+ if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
712
+ if (descriptors) defineProperty(value, 'name', { value: name, configurable: true });
713
+ else value.name = name;
643
714
  }
644
- if (simple) O[key] = value;
645
- else createNonEnumerableProperty(O, key, value);
715
+ if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
716
+ defineProperty(value, 'length', { value: options.arity });
717
+ }
718
+ try {
719
+ if (options && hasOwnProperty_1(options, 'constructor') && options.constructor) {
720
+ if (descriptors) defineProperty(value, 'prototype', { writable: false });
721
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
722
+ } else if (value.prototype) value.prototype = undefined;
723
+ } catch (error) { /* empty */ }
724
+ var state = enforceInternalState(value);
725
+ if (!hasOwnProperty_1(state, 'source')) {
726
+ state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
727
+ } return value;
728
+ };
729
+
646
730
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
647
- })(Function.prototype, 'toString', function toString() {
731
+ // eslint-disable-next-line no-extend-native -- required
732
+ Function.prototype.toString = makeBuiltIn(function toString() {
648
733
  return isCallable(this) && getInternalState(this).source || inspectSource(this);
734
+ }, 'toString');
649
735
  });
650
- });
736
+
737
+ var defineBuiltIn = function (O, key, value, options) {
738
+ if (!options) options = {};
739
+ var simple = options.enumerable;
740
+ var name = options.name !== undefined ? options.name : key;
741
+ if (isCallable(value)) makeBuiltIn_1(value, name, options);
742
+ if (options.global) {
743
+ if (simple) O[key] = value;
744
+ else defineGlobalProperty(key, value);
745
+ } else {
746
+ try {
747
+ if (!options.unsafe) delete O[key];
748
+ else if (O[key]) simple = true;
749
+ } catch (error) { /* empty */ }
750
+ if (simple) O[key] = value;
751
+ else objectDefineProperty.f(O, key, {
752
+ value: value,
753
+ enumerable: false,
754
+ configurable: !options.nonConfigurable,
755
+ writable: !options.nonWritable
756
+ });
757
+ } return O;
758
+ };
651
759
 
652
760
  var ceil = Math.ceil;
653
761
  var floor = Math.floor;
654
762
 
763
+ // `Math.trunc` method
764
+ // https://tc39.es/ecma262/#sec-math.trunc
765
+ // eslint-disable-next-line es/no-math-trunc -- safe
766
+ var mathTrunc = Math.trunc || function trunc(x) {
767
+ var n = +x;
768
+ return (n > 0 ? floor : ceil)(n);
769
+ };
770
+
655
771
  // `ToIntegerOrInfinity` abstract operation
656
772
  // https://tc39.es/ecma262/#sec-tointegerorinfinity
657
773
  var toIntegerOrInfinity = function (argument) {
658
774
  var number = +argument;
659
- // eslint-disable-next-line no-self-compare -- safe
660
- return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
775
+ // eslint-disable-next-line no-self-compare -- NaN check
776
+ return number !== number || number === 0 ? 0 : mathTrunc(number);
661
777
  };
662
778
 
663
779
  var max = Math.max;
@@ -694,10 +810,10 @@
694
810
  var value;
695
811
  // Array#includes uses SameValueZero equality algorithm
696
812
  // eslint-disable-next-line no-self-compare -- NaN check
697
- if (IS_INCLUDES && el != el) while (length > index) {
813
+ if (IS_INCLUDES && el !== el) while (length > index) {
698
814
  value = O[index++];
699
815
  // eslint-disable-next-line no-self-compare -- NaN check
700
- if (value != value) return true;
816
+ if (value !== value) return true;
701
817
  // Array#indexOf ignores holes, Array#includes - not
702
818
  } else for (;length > index; index++) {
703
819
  if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
@@ -748,19 +864,19 @@
748
864
  // `Object.getOwnPropertyNames` method
749
865
  // https://tc39.es/ecma262/#sec-object.getownpropertynames
750
866
  // eslint-disable-next-line es/no-object-getownpropertynames -- safe
751
- var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
867
+ var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
752
868
  return objectKeysInternal(O, hiddenKeys);
753
869
  };
754
870
 
755
871
  var objectGetOwnPropertyNames = {
756
- f: f$2
872
+ f: f$3
757
873
  };
758
874
 
759
875
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
760
- var f$1 = Object.getOwnPropertySymbols;
876
+ var f$2 = Object.getOwnPropertySymbols;
761
877
 
762
878
  var objectGetOwnPropertySymbols = {
763
- f: f$1
879
+ f: f$2
764
880
  };
765
881
 
766
882
  var concat = functionUncurryThis([].concat);
@@ -772,13 +888,15 @@
772
888
  return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
773
889
  };
774
890
 
775
- var copyConstructorProperties = function (target, source) {
891
+ var copyConstructorProperties = function (target, source, exceptions) {
776
892
  var keys = ownKeys(source);
777
893
  var defineProperty = objectDefineProperty.f;
778
894
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
779
895
  for (var i = 0; i < keys.length; i++) {
780
896
  var key = keys[i];
781
- if (!hasOwnProperty_1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
897
+ if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
898
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
899
+ }
782
900
  }
783
901
  };
784
902
 
@@ -786,8 +904,8 @@
786
904
 
787
905
  var isForced = function (feature, detection) {
788
906
  var value = data[normalize(feature)];
789
- return value == POLYFILL ? true
790
- : value == NATIVE ? false
907
+ return value === POLYFILL ? true
908
+ : value === NATIVE ? false
791
909
  : isCallable(detection) ? fails(detection)
792
910
  : !!detection;
793
911
  };
@@ -810,19 +928,19 @@
810
928
 
811
929
 
812
930
  /*
813
- options.target - name of the target object
814
- options.global - target is the global object
815
- options.stat - export as static methods of target
816
- options.proto - export as prototype methods of target
817
- options.real - real prototype method for the `pure` version
818
- options.forced - export even if the native feature is available
819
- options.bind - bind methods to the target, required for the `pure` version
820
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
821
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
822
- options.sham - add a flag to not completely full polyfills
823
- options.enumerable - export as enumerable property
824
- options.noTargetGet - prevent calling a getter on target
825
- options.name - the .name of the function if it does not match the key
931
+ options.target - name of the target object
932
+ options.global - target is the global object
933
+ options.stat - export as static methods of target
934
+ options.proto - export as prototype methods of target
935
+ options.real - real prototype method for the `pure` version
936
+ options.forced - export even if the native feature is available
937
+ options.bind - bind methods to the target, required for the `pure` version
938
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
939
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
940
+ options.sham - add a flag to not completely full polyfills
941
+ options.enumerable - export as enumerable property
942
+ options.dontCallGetSet - prevent calling a getter on target
943
+ options.name - the .name of the function if it does not match the key
826
944
  */
827
945
  var _export = function (options, source) {
828
946
  var TARGET = options.target;
@@ -832,13 +950,13 @@
832
950
  if (GLOBAL) {
833
951
  target = global$1;
834
952
  } else if (STATIC) {
835
- target = global$1[TARGET] || setGlobal(TARGET, {});
953
+ target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
836
954
  } else {
837
955
  target = (global$1[TARGET] || {}).prototype;
838
956
  }
839
957
  if (target) for (key in source) {
840
958
  sourceProperty = source[key];
841
- if (options.noTargetGet) {
959
+ if (options.dontCallGetSet) {
842
960
  descriptor = getOwnPropertyDescriptor$1(target, key);
843
961
  targetProperty = descriptor && descriptor.value;
844
962
  } else targetProperty = target[key];
@@ -852,17 +970,23 @@
852
970
  if (options.sham || (targetProperty && targetProperty.sham)) {
853
971
  createNonEnumerableProperty(sourceProperty, 'sham', true);
854
972
  }
855
- // extend global
856
- redefine(target, key, sourceProperty, options);
973
+ defineBuiltIn(target, key, sourceProperty, options);
857
974
  }
858
975
  };
859
976
 
860
- var bind$2 = functionUncurryThis(functionUncurryThis.bind);
977
+ var functionUncurryThisClause = function (fn) {
978
+ // Nashorn bug:
979
+ // https://github.com/zloirock/core-js/issues/1128
980
+ // https://github.com/zloirock/core-js/issues/1130
981
+ if (classofRaw(fn) === 'Function') return functionUncurryThis(fn);
982
+ };
983
+
984
+ var bind$1 = functionUncurryThisClause(functionUncurryThisClause.bind);
861
985
 
862
986
  // optional / simple context binding
863
987
  var functionBindContext = function (fn, that) {
864
988
  aCallable(fn);
865
- return that === undefined ? fn : bind$2 ? bind$2(fn, that) : function (/* ...args */) {
989
+ return that === undefined ? fn : functionBindNative ? bind$1(fn, that) : function (/* ...args */) {
866
990
  return fn.apply(that, arguments);
867
991
  };
868
992
  };
@@ -871,7 +995,7 @@
871
995
  // https://tc39.es/ecma262/#sec-isarray
872
996
  // eslint-disable-next-line es/no-array-isarray -- safe
873
997
  var isArray = Array.isArray || function isArray(argument) {
874
- return classofRaw(argument) == 'Array';
998
+ return classofRaw(argument) === 'Array';
875
999
  };
876
1000
 
877
1001
  var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
@@ -882,10 +1006,10 @@
882
1006
  var toStringTagSupport = String(test) === '[object z]';
883
1007
 
884
1008
  var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
885
- var Object$1 = global$1.Object;
1009
+ var $Object = Object;
886
1010
 
887
1011
  // ES3 wrong here
888
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1012
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
889
1013
 
890
1014
  // fallback for IE11 Script Access Denied error
891
1015
  var tryGet = function (it, key) {
@@ -899,11 +1023,11 @@
899
1023
  var O, tag, result;
900
1024
  return it === undefined ? 'Undefined' : it === null ? 'Null'
901
1025
  // @@toStringTag case
902
- : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
1026
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG$1)) == 'string' ? tag
903
1027
  // builtinTag case
904
1028
  : CORRECT_ARGUMENTS ? classofRaw(O)
905
1029
  // ES3 arguments fallback
906
- : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
1030
+ : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
907
1031
  };
908
1032
 
909
1033
  var noop = function () { /* empty */ };
@@ -911,9 +1035,9 @@
911
1035
  var construct = getBuiltIn('Reflect', 'construct');
912
1036
  var constructorRegExp = /^\s*(?:class|function)\b/;
913
1037
  var exec = functionUncurryThis(constructorRegExp.exec);
914
- var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1038
+ var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
915
1039
 
916
- var isConstructorModern = function (argument) {
1040
+ var isConstructorModern = function isConstructor(argument) {
917
1041
  if (!isCallable(argument)) return false;
918
1042
  try {
919
1043
  construct(noop, empty, argument);
@@ -923,16 +1047,25 @@
923
1047
  }
924
1048
  };
925
1049
 
926
- var isConstructorLegacy = function (argument) {
1050
+ var isConstructorLegacy = function isConstructor(argument) {
927
1051
  if (!isCallable(argument)) return false;
928
1052
  switch (classof(argument)) {
929
1053
  case 'AsyncFunction':
930
1054
  case 'GeneratorFunction':
931
1055
  case 'AsyncGeneratorFunction': return false;
1056
+ }
1057
+ try {
932
1058
  // we can't check .prototype since constructors produced by .bind haven't it
933
- } return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
1059
+ // `Function#toString` throws on some built-it function in some legacy engines
1060
+ // (for example, `DOMQuad` and similar in FF41-)
1061
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
1062
+ } catch (error) {
1063
+ return true;
1064
+ }
934
1065
  };
935
1066
 
1067
+ isConstructorLegacy.sham = true;
1068
+
936
1069
  // `IsConstructor` abstract operation
937
1070
  // https://tc39.es/ecma262/#sec-isconstructor
938
1071
  var isConstructor = !construct || fails(function () {
@@ -944,7 +1077,7 @@
944
1077
  }) ? isConstructorLegacy : isConstructorModern;
945
1078
 
946
1079
  var SPECIES$4 = wellKnownSymbol('species');
947
- var Array$1 = global$1.Array;
1080
+ var $Array = Array;
948
1081
 
949
1082
  // a part of `ArraySpeciesCreate` abstract operation
950
1083
  // https://tc39.es/ecma262/#sec-arrayspeciescreate
@@ -953,12 +1086,12 @@
953
1086
  if (isArray(originalArray)) {
954
1087
  C = originalArray.constructor;
955
1088
  // cross-realm fallback
956
- if (isConstructor(C) && (C === Array$1 || isArray(C.prototype))) C = undefined;
1089
+ if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
957
1090
  else if (isObject(C)) {
958
1091
  C = C[SPECIES$4];
959
1092
  if (C === null) C = undefined;
960
1093
  }
961
- } return C === undefined ? Array$1 : C;
1094
+ } return C === undefined ? $Array : C;
962
1095
  };
963
1096
 
964
1097
  // `ArraySpeciesCreate` abstract operation
@@ -971,18 +1104,18 @@
971
1104
 
972
1105
  // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
973
1106
  var createMethod = function (TYPE) {
974
- var IS_MAP = TYPE == 1;
975
- var IS_FILTER = TYPE == 2;
976
- var IS_SOME = TYPE == 3;
977
- var IS_EVERY = TYPE == 4;
978
- var IS_FIND_INDEX = TYPE == 6;
979
- var IS_FILTER_REJECT = TYPE == 7;
980
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
1107
+ var IS_MAP = TYPE === 1;
1108
+ var IS_FILTER = TYPE === 2;
1109
+ var IS_SOME = TYPE === 3;
1110
+ var IS_EVERY = TYPE === 4;
1111
+ var IS_FIND_INDEX = TYPE === 6;
1112
+ var IS_FILTER_REJECT = TYPE === 7;
1113
+ var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
981
1114
  return function ($this, callbackfn, that, specificCreate) {
982
1115
  var O = toObject($this);
983
1116
  var self = indexedObject(O);
984
- var boundFunction = functionBindContext(callbackfn, that);
985
1117
  var length = lengthOfArrayLike(self);
1118
+ var boundFunction = functionBindContext(callbackfn, that);
986
1119
  var index = 0;
987
1120
  var create = specificCreate || arraySpeciesCreate;
988
1121
  var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
@@ -1037,8 +1170,8 @@
1037
1170
  var arrayMethodIsStrict = function (METHOD_NAME, argument) {
1038
1171
  var method = [][METHOD_NAME];
1039
1172
  return !!method && fails(function () {
1040
- // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
1041
- method.call(null, argument || function () { throw 1; }, 1);
1173
+ // eslint-disable-next-line no-useless-call -- required for testing
1174
+ method.call(null, argument || function () { return 1; }, 1);
1042
1175
  });
1043
1176
  };
1044
1177
 
@@ -1057,7 +1190,7 @@
1057
1190
  // `Array.prototype.forEach` method
1058
1191
  // https://tc39.es/ecma262/#sec-array.prototype.foreach
1059
1192
  // eslint-disable-next-line es/no-array-prototype-foreach -- safe
1060
- _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, {
1193
+ _export({ target: 'Array', proto: true, forced: [].forEach !== arrayForEach }, {
1061
1194
  forEach: arrayForEach
1062
1195
  });
1063
1196
 
@@ -1070,7 +1203,7 @@
1070
1203
  // `Object.prototype.toString` method
1071
1204
  // https://tc39.es/ecma262/#sec-object.prototype.tostring
1072
1205
  if (!toStringTagSupport) {
1073
- redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
1206
+ defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
1074
1207
  }
1075
1208
 
1076
1209
  // iterable DOM collections
@@ -1134,19 +1267,23 @@
1134
1267
 
1135
1268
  handlePrototype(domTokenListPrototype);
1136
1269
 
1270
+ // TODO: Remove from `core-js@4`
1271
+
1272
+
1273
+
1137
1274
  var DatePrototype = Date.prototype;
1138
1275
  var INVALID_DATE = 'Invalid Date';
1139
1276
  var TO_STRING = 'toString';
1140
- var un$DateToString = functionUncurryThis(DatePrototype[TO_STRING]);
1141
- var getTime = functionUncurryThis(DatePrototype.getTime);
1277
+ var nativeDateToString = functionUncurryThis(DatePrototype[TO_STRING]);
1278
+ var thisTimeValue = functionUncurryThis(DatePrototype.getTime);
1142
1279
 
1143
1280
  // `Date.prototype.toString` method
1144
1281
  // https://tc39.es/ecma262/#sec-date.prototype.tostring
1145
- if (String(new Date(NaN)) != INVALID_DATE) {
1146
- redefine(DatePrototype, TO_STRING, function toString() {
1147
- var value = getTime(this);
1282
+ if (String(new Date(NaN)) !== INVALID_DATE) {
1283
+ defineBuiltIn(DatePrototype, TO_STRING, function toString() {
1284
+ var value = thisTimeValue(this);
1148
1285
  // eslint-disable-next-line no-self-compare -- NaN check
1149
- return value === value ? un$DateToString(this) : INVALID_DATE;
1286
+ return value === value ? nativeDateToString(this) : INVALID_DATE;
1150
1287
  });
1151
1288
  }
1152
1289
 
@@ -1167,23 +1304,28 @@
1167
1304
  }
1168
1305
  });
1169
1306
 
1170
- var nativePromiseConstructor = global$1.Promise;
1307
+ var engineIsNode = classofRaw(global$1.process) === 'process';
1171
1308
 
1172
- var redefineAll = function (target, src, options) {
1173
- for (var key in src) redefine(target, key, src[key], options);
1174
- return target;
1309
+ var functionUncurryThisAccessor = function (object, key, method) {
1310
+ try {
1311
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1312
+ return functionUncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
1313
+ } catch (error) { /* empty */ }
1175
1314
  };
1176
1315
 
1177
- var String$2 = global$1.String;
1178
- var TypeError$6 = global$1.TypeError;
1316
+ var $String = String;
1317
+ var $TypeError$6 = TypeError;
1179
1318
 
1180
1319
  var aPossiblePrototype = function (argument) {
1181
1320
  if (typeof argument == 'object' || isCallable(argument)) return argument;
1182
- throw TypeError$6("Can't set " + String$2(argument) + ' as a prototype');
1321
+ throw new $TypeError$6("Can't set " + $String(argument) + ' as a prototype');
1183
1322
  };
1184
1323
 
1185
1324
  /* eslint-disable no-proto -- safe */
1186
1325
 
1326
+
1327
+
1328
+
1187
1329
  // `Object.setPrototypeOf` method
1188
1330
  // https://tc39.es/ecma262/#sec-object.setprototypeof
1189
1331
  // Works with __proto__ only. Old v8 can't work with null proto objects.
@@ -1193,8 +1335,7 @@
1193
1335
  var test = {};
1194
1336
  var setter;
1195
1337
  try {
1196
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1197
- setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1338
+ setter = functionUncurryThisAccessor(Object.prototype, '__proto__', 'set');
1198
1339
  setter(test, []);
1199
1340
  CORRECT_SETTER = test instanceof Array;
1200
1341
  } catch (error) { /* empty */ }
@@ -1207,265 +1348,140 @@
1207
1348
  };
1208
1349
  }() : undefined);
1209
1350
 
1210
- var defineProperty = objectDefineProperty.f;
1351
+ var defineProperty$1 = objectDefineProperty.f;
1211
1352
 
1212
1353
 
1213
1354
 
1214
1355
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1215
1356
 
1216
- var setToStringTag = function (it, TAG, STATIC) {
1217
- if (it && !hasOwnProperty_1(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
1218
- defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
1357
+ var setToStringTag = function (target, TAG, STATIC) {
1358
+ if (target && !STATIC) target = target.prototype;
1359
+ if (target && !hasOwnProperty_1(target, TO_STRING_TAG)) {
1360
+ defineProperty$1(target, TO_STRING_TAG, { configurable: true, value: TAG });
1219
1361
  }
1220
1362
  };
1221
1363
 
1364
+ var defineBuiltInAccessor = function (target, name, descriptor) {
1365
+ if (descriptor.get) makeBuiltIn_1(descriptor.get, name, { getter: true });
1366
+ if (descriptor.set) makeBuiltIn_1(descriptor.set, name, { setter: true });
1367
+ return objectDefineProperty.f(target, name, descriptor);
1368
+ };
1369
+
1222
1370
  var SPECIES$3 = wellKnownSymbol('species');
1223
1371
 
1224
1372
  var setSpecies = function (CONSTRUCTOR_NAME) {
1225
1373
  var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
1226
- var defineProperty = objectDefineProperty.f;
1227
1374
 
1228
1375
  if (descriptors && Constructor && !Constructor[SPECIES$3]) {
1229
- defineProperty(Constructor, SPECIES$3, {
1376
+ defineBuiltInAccessor(Constructor, SPECIES$3, {
1230
1377
  configurable: true,
1231
1378
  get: function () { return this; }
1232
1379
  });
1233
1380
  }
1234
1381
  };
1235
1382
 
1236
- var TypeError$5 = global$1.TypeError;
1383
+ var $TypeError$5 = TypeError;
1237
1384
 
1238
1385
  var anInstance = function (it, Prototype) {
1239
1386
  if (objectIsPrototypeOf(Prototype, it)) return it;
1240
- throw TypeError$5('Incorrect invocation');
1387
+ throw new $TypeError$5('Incorrect invocation');
1241
1388
  };
1242
1389
 
1243
- var iterators = {};
1244
-
1245
- var ITERATOR$2 = wellKnownSymbol('iterator');
1246
- var ArrayPrototype$1 = Array.prototype;
1390
+ var $TypeError$4 = TypeError;
1247
1391
 
1248
- // check on default Array iterator
1249
- var isArrayIteratorMethod = function (it) {
1250
- return it !== undefined && (iterators.Array === it || ArrayPrototype$1[ITERATOR$2] === it);
1392
+ // `Assert: IsConstructor(argument) is true`
1393
+ var aConstructor = function (argument) {
1394
+ if (isConstructor(argument)) return argument;
1395
+ throw new $TypeError$4(tryToString(argument) + ' is not a constructor');
1251
1396
  };
1252
1397
 
1253
- var ITERATOR$1 = wellKnownSymbol('iterator');
1398
+ var SPECIES$2 = wellKnownSymbol('species');
1254
1399
 
1255
- var getIteratorMethod = function (it) {
1256
- if (it != undefined) return getMethod(it, ITERATOR$1)
1257
- || getMethod(it, '@@iterator')
1258
- || iterators[classof(it)];
1400
+ // `SpeciesConstructor` abstract operation
1401
+ // https://tc39.es/ecma262/#sec-speciesconstructor
1402
+ var speciesConstructor = function (O, defaultConstructor) {
1403
+ var C = anObject(O).constructor;
1404
+ var S;
1405
+ return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES$2]) ? defaultConstructor : aConstructor(S);
1259
1406
  };
1260
1407
 
1261
- var TypeError$4 = global$1.TypeError;
1408
+ var FunctionPrototype = Function.prototype;
1409
+ var apply = FunctionPrototype.apply;
1410
+ var call = FunctionPrototype.call;
1262
1411
 
1263
- var getIterator = function (argument, usingIterator) {
1264
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
1265
- if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
1266
- throw TypeError$4(tryToString(argument) + ' is not iterable');
1267
- };
1412
+ // eslint-disable-next-line es/no-reflect -- safe
1413
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
1414
+ return call.apply(apply, arguments);
1415
+ });
1268
1416
 
1269
- var iteratorClose = function (iterator, kind, value) {
1270
- var innerResult, innerError;
1271
- anObject(iterator);
1272
- try {
1273
- innerResult = getMethod(iterator, 'return');
1274
- if (!innerResult) {
1275
- if (kind === 'throw') throw value;
1276
- return value;
1277
- }
1278
- innerResult = functionCall(innerResult, iterator);
1279
- } catch (error) {
1280
- innerError = true;
1281
- innerResult = error;
1282
- }
1283
- if (kind === 'throw') throw value;
1284
- if (innerError) throw innerResult;
1285
- anObject(innerResult);
1286
- return value;
1287
- };
1417
+ var html = getBuiltIn('document', 'documentElement');
1288
1418
 
1289
- var TypeError$3 = global$1.TypeError;
1419
+ var arraySlice = functionUncurryThis([].slice);
1290
1420
 
1291
- var Result = function (stopped, result) {
1292
- this.stopped = stopped;
1293
- this.result = result;
1294
- };
1421
+ var $TypeError$3 = TypeError;
1295
1422
 
1296
- var ResultPrototype = Result.prototype;
1423
+ var validateArgumentsLength = function (passed, required) {
1424
+ if (passed < required) throw new $TypeError$3('Not enough arguments');
1425
+ return passed;
1426
+ };
1297
1427
 
1298
- var iterate = function (iterable, unboundFunction, options) {
1299
- var that = options && options.that;
1300
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
1301
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
1302
- var INTERRUPTED = !!(options && options.INTERRUPTED);
1303
- var fn = functionBindContext(unboundFunction, that);
1304
- var iterator, iterFn, index, length, result, next, step;
1428
+ // eslint-disable-next-line redos/no-vulnerable -- safe
1429
+ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(engineUserAgent);
1305
1430
 
1306
- var stop = function (condition) {
1307
- if (iterator) iteratorClose(iterator, 'normal', condition);
1308
- return new Result(true, condition);
1309
- };
1431
+ var set = global$1.setImmediate;
1432
+ var clear = global$1.clearImmediate;
1433
+ var process$2 = global$1.process;
1434
+ var Dispatch = global$1.Dispatch;
1435
+ var Function$2 = global$1.Function;
1436
+ var MessageChannel = global$1.MessageChannel;
1437
+ var String$1 = global$1.String;
1438
+ var counter = 0;
1439
+ var queue$2 = {};
1440
+ var ONREADYSTATECHANGE = 'onreadystatechange';
1441
+ var $location, defer, channel, port;
1310
1442
 
1311
- var callFn = function (value) {
1312
- if (AS_ENTRIES) {
1313
- anObject(value);
1314
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
1315
- } return INTERRUPTED ? fn(value, stop) : fn(value);
1316
- };
1443
+ fails(function () {
1444
+ // Deno throws a ReferenceError on `location` access without `--location` flag
1445
+ $location = global$1.location;
1446
+ });
1317
1447
 
1318
- if (IS_ITERATOR) {
1319
- iterator = iterable;
1320
- } else {
1321
- iterFn = getIteratorMethod(iterable);
1322
- if (!iterFn) throw TypeError$3(tryToString(iterable) + ' is not iterable');
1323
- // optimisation for array iterators
1324
- if (isArrayIteratorMethod(iterFn)) {
1325
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
1326
- result = callFn(iterable[index]);
1327
- if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
1328
- } return new Result(false);
1329
- }
1330
- iterator = getIterator(iterable, iterFn);
1448
+ var run = function (id) {
1449
+ if (hasOwnProperty_1(queue$2, id)) {
1450
+ var fn = queue$2[id];
1451
+ delete queue$2[id];
1452
+ fn();
1331
1453
  }
1454
+ };
1332
1455
 
1333
- next = iterator.next;
1334
- while (!(step = functionCall(next, iterator)).done) {
1335
- try {
1336
- result = callFn(step.value);
1337
- } catch (error) {
1338
- iteratorClose(iterator, 'throw', error);
1339
- }
1340
- if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
1341
- } return new Result(false);
1456
+ var runner = function (id) {
1457
+ return function () {
1458
+ run(id);
1459
+ };
1342
1460
  };
1343
1461
 
1344
- var ITERATOR = wellKnownSymbol('iterator');
1345
- var SAFE_CLOSING = false;
1462
+ var eventListener = function (event) {
1463
+ run(event.data);
1464
+ };
1346
1465
 
1347
- try {
1348
- var called = 0;
1349
- var iteratorWithReturn = {
1350
- next: function () {
1351
- return { done: !!called++ };
1352
- },
1353
- 'return': function () {
1354
- SAFE_CLOSING = true;
1355
- }
1356
- };
1357
- iteratorWithReturn[ITERATOR] = function () {
1358
- return this;
1359
- };
1360
- // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
1361
- Array.from(iteratorWithReturn, function () { throw 2; });
1362
- } catch (error) { /* empty */ }
1363
-
1364
- var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
1365
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
1366
- var ITERATION_SUPPORT = false;
1367
- try {
1368
- var object = {};
1369
- object[ITERATOR] = function () {
1370
- return {
1371
- next: function () {
1372
- return { done: ITERATION_SUPPORT = true };
1373
- }
1374
- };
1375
- };
1376
- exec(object);
1377
- } catch (error) { /* empty */ }
1378
- return ITERATION_SUPPORT;
1379
- };
1380
-
1381
- var TypeError$2 = global$1.TypeError;
1382
-
1383
- // `Assert: IsConstructor(argument) is true`
1384
- var aConstructor = function (argument) {
1385
- if (isConstructor(argument)) return argument;
1386
- throw TypeError$2(tryToString(argument) + ' is not a constructor');
1387
- };
1388
-
1389
- var SPECIES$2 = wellKnownSymbol('species');
1390
-
1391
- // `SpeciesConstructor` abstract operation
1392
- // https://tc39.es/ecma262/#sec-speciesconstructor
1393
- var speciesConstructor = function (O, defaultConstructor) {
1394
- var C = anObject(O).constructor;
1395
- var S;
1396
- return C === undefined || (S = anObject(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor(S);
1397
- };
1398
-
1399
- var FunctionPrototype = Function.prototype;
1400
- var apply = FunctionPrototype.apply;
1401
- var bind$1 = FunctionPrototype.bind;
1402
- var call = FunctionPrototype.call;
1403
-
1404
- // eslint-disable-next-line es/no-reflect -- safe
1405
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (bind$1 ? call.bind(apply) : function () {
1406
- return call.apply(apply, arguments);
1407
- });
1408
-
1409
- var html = getBuiltIn('document', 'documentElement');
1410
-
1411
- var arraySlice = functionUncurryThis([].slice);
1412
-
1413
- var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(engineUserAgent);
1414
-
1415
- var engineIsNode = classofRaw(global$1.process) == 'process';
1416
-
1417
- var set = global$1.setImmediate;
1418
- var clear = global$1.clearImmediate;
1419
- var process$2 = global$1.process;
1420
- var Dispatch = global$1.Dispatch;
1421
- var Function$2 = global$1.Function;
1422
- var MessageChannel = global$1.MessageChannel;
1423
- var String$1 = global$1.String;
1424
- var counter = 0;
1425
- var queue = {};
1426
- var ONREADYSTATECHANGE = 'onreadystatechange';
1427
- var location, defer, channel, port;
1428
-
1429
- try {
1430
- // Deno throws a ReferenceError on `location` access without `--location` flag
1431
- location = global$1.location;
1432
- } catch (error) { /* empty */ }
1433
-
1434
- var run = function (id) {
1435
- if (hasOwnProperty_1(queue, id)) {
1436
- var fn = queue[id];
1437
- delete queue[id];
1438
- fn();
1439
- }
1440
- };
1441
-
1442
- var runner = function (id) {
1443
- return function () {
1444
- run(id);
1445
- };
1446
- };
1447
-
1448
- var listener = function (event) {
1449
- run(event.data);
1450
- };
1451
-
1452
- var post = function (id) {
1466
+ var globalPostMessageDefer = function (id) {
1453
1467
  // old engines have not location.origin
1454
- global$1.postMessage(String$1(id), location.protocol + '//' + location.host);
1468
+ global$1.postMessage(String$1(id), $location.protocol + '//' + $location.host);
1455
1469
  };
1456
1470
 
1457
1471
  // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1458
1472
  if (!set || !clear) {
1459
- set = function setImmediate(fn) {
1473
+ set = function setImmediate(handler) {
1474
+ validateArgumentsLength(arguments.length, 1);
1475
+ var fn = isCallable(handler) ? handler : Function$2(handler);
1460
1476
  var args = arraySlice(arguments, 1);
1461
- queue[++counter] = function () {
1462
- functionApply(isCallable(fn) ? fn : Function$2(fn), undefined, args);
1477
+ queue$2[++counter] = function () {
1478
+ functionApply(fn, undefined, args);
1463
1479
  };
1464
1480
  defer(counter);
1465
1481
  return counter;
1466
1482
  };
1467
1483
  clear = function clearImmediate(id) {
1468
- delete queue[id];
1484
+ delete queue$2[id];
1469
1485
  };
1470
1486
  // Node.js 0.8-
1471
1487
  if (engineIsNode) {
@@ -1482,7 +1498,7 @@
1482
1498
  } else if (MessageChannel && !engineIsIos) {
1483
1499
  channel = new MessageChannel();
1484
1500
  port = channel.port2;
1485
- channel.port1.onmessage = listener;
1501
+ channel.port1.onmessage = eventListener;
1486
1502
  defer = functionBindContext(port.postMessage, port);
1487
1503
  // Browsers with postMessage, skip WebWorkers
1488
1504
  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
@@ -1490,11 +1506,11 @@
1490
1506
  global$1.addEventListener &&
1491
1507
  isCallable(global$1.postMessage) &&
1492
1508
  !global$1.importScripts &&
1493
- location && location.protocol !== 'file:' &&
1494
- !fails(post)
1509
+ $location && $location.protocol !== 'file:' &&
1510
+ !fails(globalPostMessageDefer)
1495
1511
  ) {
1496
- defer = post;
1497
- global$1.addEventListener('message', listener, false);
1512
+ defer = globalPostMessageDefer;
1513
+ global$1.addEventListener('message', eventListener, false);
1498
1514
  // IE8-
1499
1515
  } else if (ONREADYSTATECHANGE in documentCreateElement('script')) {
1500
1516
  defer = function (id) {
@@ -1516,7 +1532,32 @@
1516
1532
  clear: clear
1517
1533
  };
1518
1534
 
1519
- var engineIsIosPebble = /ipad|iphone|ipod/i.test(engineUserAgent) && global$1.Pebble !== undefined;
1535
+ var Queue = function () {
1536
+ this.head = null;
1537
+ this.tail = null;
1538
+ };
1539
+
1540
+ Queue.prototype = {
1541
+ add: function (item) {
1542
+ var entry = { item: item, next: null };
1543
+ var tail = this.tail;
1544
+ if (tail) tail.next = entry;
1545
+ else this.head = entry;
1546
+ this.tail = entry;
1547
+ },
1548
+ get: function () {
1549
+ var entry = this.head;
1550
+ if (entry) {
1551
+ var next = this.head = entry.next;
1552
+ if (next === null) this.tail = null;
1553
+ return entry.item;
1554
+ }
1555
+ }
1556
+ };
1557
+
1558
+ var queue$1 = Queue;
1559
+
1560
+ var engineIsIosPebble = /ipad|iphone|ipod/i.test(engineUserAgent) && typeof Pebble != 'undefined';
1520
1561
 
1521
1562
  var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(engineUserAgent);
1522
1563
 
@@ -1527,32 +1568,29 @@
1527
1568
 
1528
1569
 
1529
1570
 
1571
+
1530
1572
  var MutationObserver = global$1.MutationObserver || global$1.WebKitMutationObserver;
1531
1573
  var document$2 = global$1.document;
1532
1574
  var process$1 = global$1.process;
1533
1575
  var Promise$1 = global$1.Promise;
1534
1576
  // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
1535
1577
  var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$1, 'queueMicrotask');
1536
- var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
1537
-
1538
- var flush, head, last, notify$1, toggle, node, promise, then;
1578
+ var microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
1579
+ var notify$1, toggle, node, promise, then;
1539
1580
 
1540
1581
  // modern engines have queueMicrotask method
1541
- if (!queueMicrotask) {
1542
- flush = function () {
1582
+ if (!microtask) {
1583
+ var queue = new queue$1();
1584
+
1585
+ var flush = function () {
1543
1586
  var parent, fn;
1544
1587
  if (engineIsNode && (parent = process$1.domain)) parent.exit();
1545
- while (head) {
1546
- fn = head.fn;
1547
- head = head.next;
1548
- try {
1549
- fn();
1550
- } catch (error) {
1551
- if (head) notify$1();
1552
- else last = undefined;
1553
- throw error;
1554
- }
1555
- } last = undefined;
1588
+ while (fn = queue.get()) try {
1589
+ fn();
1590
+ } catch (error) {
1591
+ if (queue.head) notify$1();
1592
+ throw error;
1593
+ }
1556
1594
  if (parent) parent.enter();
1557
1595
  };
1558
1596
 
@@ -1583,31 +1621,90 @@
1583
1621
  // for other environments - macrotask based on:
1584
1622
  // - setImmediate
1585
1623
  // - MessageChannel
1586
- // - window.postMessag
1624
+ // - window.postMessage
1587
1625
  // - onreadystatechange
1588
1626
  // - setTimeout
1589
1627
  } else {
1590
- // strange IE + webpack dev server bug - use .bind(global)
1628
+ // `webpack` dev server bug on IE global methods - use bind(fn, global)
1591
1629
  macrotask = functionBindContext(macrotask, global$1);
1592
1630
  notify$1 = function () {
1593
1631
  macrotask(flush);
1594
1632
  };
1595
1633
  }
1634
+
1635
+ microtask = function (fn) {
1636
+ if (!queue.head) notify$1();
1637
+ queue.add(fn);
1638
+ };
1596
1639
  }
1597
1640
 
1598
- var microtask = queueMicrotask || function (fn) {
1599
- var task = { fn: fn, next: undefined };
1600
- if (last) last.next = task;
1601
- if (!head) {
1602
- head = task;
1603
- notify$1();
1604
- } last = task;
1641
+ var microtask_1 = microtask;
1642
+
1643
+ var hostReportErrors = function (a, b) {
1644
+ try {
1645
+ // eslint-disable-next-line no-console -- safe
1646
+ arguments.length === 1 ? console.error(a) : console.error(a, b);
1647
+ } catch (error) { /* empty */ }
1648
+ };
1649
+
1650
+ var perform = function (exec) {
1651
+ try {
1652
+ return { error: false, value: exec() };
1653
+ } catch (error) {
1654
+ return { error: true, value: error };
1655
+ }
1656
+ };
1657
+
1658
+ var promiseNativeConstructor = global$1.Promise;
1659
+
1660
+ /* global Deno -- Deno case */
1661
+ var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
1662
+
1663
+ var engineIsBrowser = !engineIsDeno && !engineIsNode
1664
+ && typeof window == 'object'
1665
+ && typeof document == 'object';
1666
+
1667
+ promiseNativeConstructor && promiseNativeConstructor.prototype;
1668
+ var SPECIES$1 = wellKnownSymbol('species');
1669
+ var SUBCLASSING = false;
1670
+ var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable(global$1.PromiseRejectionEvent);
1671
+
1672
+ var FORCED_PROMISE_CONSTRUCTOR$5 = isForced_1('Promise', function () {
1673
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(promiseNativeConstructor);
1674
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(promiseNativeConstructor);
1675
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1676
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1677
+ // We can't detect it synchronously, so just check versions
1678
+ if (!GLOBAL_CORE_JS_PROMISE && engineV8Version === 66) return true;
1679
+ // We can't use @@species feature detection in V8 since it causes
1680
+ // deoptimization and performance degradation
1681
+ // https://github.com/zloirock/core-js/issues/679
1682
+ if (!engineV8Version || engineV8Version < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
1683
+ // Detect correctness of subclassing with @@species support
1684
+ var promise = new promiseNativeConstructor(function (resolve) { resolve(1); });
1685
+ var FakePromise = function (exec) {
1686
+ exec(function () { /* empty */ }, function () { /* empty */ });
1687
+ };
1688
+ var constructor = promise.constructor = {};
1689
+ constructor[SPECIES$1] = FakePromise;
1690
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
1691
+ if (!SUBCLASSING) return true;
1692
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1693
+ } return !GLOBAL_CORE_JS_PROMISE && (engineIsBrowser || engineIsDeno) && !NATIVE_PROMISE_REJECTION_EVENT$1;
1694
+ });
1695
+
1696
+ var promiseConstructorDetection = {
1697
+ CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
1698
+ REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
1699
+ SUBCLASSING: SUBCLASSING
1605
1700
  };
1606
1701
 
1702
+ var $TypeError$2 = TypeError;
1703
+
1607
1704
  var PromiseCapability = function (C) {
1608
1705
  var resolve, reject;
1609
1706
  this.promise = new C(function ($$resolve, $$reject) {
1610
- if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
1707
+ if (resolve !== undefined || reject !== undefined) throw new $TypeError$2('Bad Promise constructor');
1611
1708
  resolve = $$resolve;
1612
1709
  reject = $$reject;
1613
1710
  });
@@ -1617,40 +1714,14 @@
1617
1714
 
1618
1715
  // `NewPromiseCapability` abstract operation
1619
1716
  // https://tc39.es/ecma262/#sec-newpromisecapability
1620
- var f = function (C) {
1717
+ var f$1 = function (C) {
1621
1718
  return new PromiseCapability(C);
1622
1719
  };
1623
1720
 
1624
1721
  var newPromiseCapability$1 = {
1625
- f: f
1626
- };
1627
-
1628
- var promiseResolve = function (C, x) {
1629
- anObject(C);
1630
- if (isObject(x) && x.constructor === C) return x;
1631
- var promiseCapability = newPromiseCapability$1.f(C);
1632
- var resolve = promiseCapability.resolve;
1633
- resolve(x);
1634
- return promiseCapability.promise;
1635
- };
1636
-
1637
- var hostReportErrors = function (a, b) {
1638
- var console = global$1.console;
1639
- if (console && console.error) {
1640
- arguments.length == 1 ? console.error(a) : console.error(a, b);
1641
- }
1642
- };
1643
-
1644
- var perform = function (exec) {
1645
- try {
1646
- return { error: false, value: exec() };
1647
- } catch (error) {
1648
- return { error: true, value: error };
1649
- }
1722
+ f: f$1
1650
1723
  };
1651
1724
 
1652
- var engineIsBrowser = typeof window == 'object';
1653
-
1654
1725
  var task = task$1.set;
1655
1726
 
1656
1727
 
@@ -1661,18 +1732,15 @@
1661
1732
 
1662
1733
 
1663
1734
 
1664
-
1665
-
1666
-
1667
- var SPECIES$1 = wellKnownSymbol('species');
1668
1735
  var PROMISE = 'Promise';
1669
-
1670
- var getInternalState = internalState.getterFor(PROMISE);
1671
- var setInternalState = internalState.set;
1736
+ var FORCED_PROMISE_CONSTRUCTOR$4 = promiseConstructorDetection.CONSTRUCTOR;
1737
+ var NATIVE_PROMISE_REJECTION_EVENT = promiseConstructorDetection.REJECTION_EVENT;
1738
+ var NATIVE_PROMISE_SUBCLASSING = promiseConstructorDetection.SUBCLASSING;
1672
1739
  var getInternalPromiseState = internalState.getterFor(PROMISE);
1673
- var NativePromisePrototype = nativePromiseConstructor && nativePromiseConstructor.prototype;
1674
- var PromiseConstructor = nativePromiseConstructor;
1675
- var PromisePrototype = NativePromisePrototype;
1740
+ var setInternalState = internalState.set;
1741
+ var NativePromisePrototype$1 = promiseNativeConstructor && promiseNativeConstructor.prototype;
1742
+ var PromiseConstructor = promiseNativeConstructor;
1743
+ var PromisePrototype = NativePromisePrototype$1;
1676
1744
  var TypeError$1 = global$1.TypeError;
1677
1745
  var document$1 = global$1.document;
1678
1746
  var process = global$1.process;
@@ -1680,7 +1748,6 @@
1680
1748
  var newGenericPromiseCapability = newPromiseCapability;
1681
1749
 
1682
1750
  var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$1.dispatchEvent);
1683
- var NATIVE_REJECTION_EVENT = isCallable(global$1.PromiseRejectionEvent);
1684
1751
  var UNHANDLED_REJECTION = 'unhandledrejection';
1685
1752
  var REJECTION_HANDLED = 'rejectionhandled';
1686
1753
  var PENDING = 0;
@@ -1688,87 +1755,59 @@
1688
1755
  var REJECTED = 2;
1689
1756
  var HANDLED = 1;
1690
1757
  var UNHANDLED = 2;
1691
- var SUBCLASSING = false;
1692
1758
 
1693
1759
  var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
1694
1760
 
1695
- var FORCED = isForced_1(PROMISE, function () {
1696
- var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
1697
- var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
1698
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1699
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1700
- // We can't detect it synchronously, so just check versions
1701
- if (!GLOBAL_CORE_JS_PROMISE && engineV8Version === 66) return true;
1702
- // We can't use @@species feature detection in V8 since it causes
1703
- // deoptimization and performance degradation
1704
- // https://github.com/zloirock/core-js/issues/679
1705
- if (engineV8Version >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
1706
- // Detect correctness of subclassing with @@species support
1707
- var promise = new PromiseConstructor(function (resolve) { resolve(1); });
1708
- var FakePromise = function (exec) {
1709
- exec(function () { /* empty */ }, function () { /* empty */ });
1710
- };
1711
- var constructor = promise.constructor = {};
1712
- constructor[SPECIES$1] = FakePromise;
1713
- SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
1714
- if (!SUBCLASSING) return true;
1715
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1716
- return !GLOBAL_CORE_JS_PROMISE && engineIsBrowser && !NATIVE_REJECTION_EVENT;
1717
- });
1718
-
1719
- var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
1720
- PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
1721
- });
1722
-
1723
1761
  // helpers
1724
1762
  var isThenable = function (it) {
1725
1763
  var then;
1726
1764
  return isObject(it) && isCallable(then = it.then) ? then : false;
1727
1765
  };
1728
1766
 
1767
+ var callReaction = function (reaction, state) {
1768
+ var value = state.value;
1769
+ var ok = state.state === FULFILLED;
1770
+ var handler = ok ? reaction.ok : reaction.fail;
1771
+ var resolve = reaction.resolve;
1772
+ var reject = reaction.reject;
1773
+ var domain = reaction.domain;
1774
+ var result, then, exited;
1775
+ try {
1776
+ if (handler) {
1777
+ if (!ok) {
1778
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
1779
+ state.rejection = HANDLED;
1780
+ }
1781
+ if (handler === true) result = value;
1782
+ else {
1783
+ if (domain) domain.enter();
1784
+ result = handler(value); // can throw
1785
+ if (domain) {
1786
+ domain.exit();
1787
+ exited = true;
1788
+ }
1789
+ }
1790
+ if (result === reaction.promise) {
1791
+ reject(new TypeError$1('Promise-chain cycle'));
1792
+ } else if (then = isThenable(result)) {
1793
+ functionCall(then, result, resolve, reject);
1794
+ } else resolve(result);
1795
+ } else reject(value);
1796
+ } catch (error) {
1797
+ if (domain && !exited) domain.exit();
1798
+ reject(error);
1799
+ }
1800
+ };
1801
+
1729
1802
  var notify = function (state, isReject) {
1730
1803
  if (state.notified) return;
1731
1804
  state.notified = true;
1732
- var chain = state.reactions;
1733
- microtask(function () {
1734
- var value = state.value;
1735
- var ok = state.state == FULFILLED;
1736
- var index = 0;
1737
- // variable length - can't use forEach
1738
- while (chain.length > index) {
1739
- var reaction = chain[index++];
1740
- var handler = ok ? reaction.ok : reaction.fail;
1741
- var resolve = reaction.resolve;
1742
- var reject = reaction.reject;
1743
- var domain = reaction.domain;
1744
- var result, then, exited;
1745
- try {
1746
- if (handler) {
1747
- if (!ok) {
1748
- if (state.rejection === UNHANDLED) onHandleUnhandled(state);
1749
- state.rejection = HANDLED;
1750
- }
1751
- if (handler === true) result = value;
1752
- else {
1753
- if (domain) domain.enter();
1754
- result = handler(value); // can throw
1755
- if (domain) {
1756
- domain.exit();
1757
- exited = true;
1758
- }
1759
- }
1760
- if (result === reaction.promise) {
1761
- reject(TypeError$1('Promise-chain cycle'));
1762
- } else if (then = isThenable(result)) {
1763
- functionCall(then, result, resolve, reject);
1764
- } else resolve(result);
1765
- } else reject(value);
1766
- } catch (error) {
1767
- if (domain && !exited) domain.exit();
1768
- reject(error);
1769
- }
1805
+ microtask_1(function () {
1806
+ var reactions = state.reactions;
1807
+ var reaction;
1808
+ while (reaction = reactions.get()) {
1809
+ callReaction(reaction, state);
1770
1810
  }
1771
- state.reactions = [];
1772
1811
  state.notified = false;
1773
1812
  if (isReject && !state.rejection) onUnhandled(state);
1774
1813
  });
@@ -1783,7 +1822,7 @@
1783
1822
  event.initEvent(name, false, true);
1784
1823
  global$1.dispatchEvent(event);
1785
1824
  } else event = { promise: promise, reason: reason };
1786
- if (!NATIVE_REJECTION_EVENT && (handler = global$1['on' + name])) handler(event);
1825
+ if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$1['on' + name])) handler(event);
1787
1826
  else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
1788
1827
  };
1789
1828
 
@@ -1839,10 +1878,10 @@
1839
1878
  state.done = true;
1840
1879
  if (unwrap) state = unwrap;
1841
1880
  try {
1842
- if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
1881
+ if (state.facade === value) throw new TypeError$1("Promise can't be resolved itself");
1843
1882
  var then = isThenable(value);
1844
1883
  if (then) {
1845
- microtask(function () {
1884
+ microtask_1(function () {
1846
1885
  var wrapper = { done: false };
1847
1886
  try {
1848
1887
  functionCall(then, value,
@@ -1864,20 +1903,22 @@
1864
1903
  };
1865
1904
 
1866
1905
  // constructor polyfill
1867
- if (FORCED) {
1906
+ if (FORCED_PROMISE_CONSTRUCTOR$4) {
1868
1907
  // 25.4.3.1 Promise(executor)
1869
1908
  PromiseConstructor = function Promise(executor) {
1870
1909
  anInstance(this, PromisePrototype);
1871
1910
  aCallable(executor);
1872
1911
  functionCall(Internal, this);
1873
- var state = getInternalState(this);
1912
+ var state = getInternalPromiseState(this);
1874
1913
  try {
1875
1914
  executor(bind(internalResolve, state), bind(internalReject, state));
1876
1915
  } catch (error) {
1877
1916
  internalReject(state, error);
1878
1917
  }
1879
1918
  };
1919
+
1880
1920
  PromisePrototype = PromiseConstructor.prototype;
1921
+
1881
1922
  // eslint-disable-next-line no-unused-vars -- required for `.length`
1882
1923
  Internal = function Promise(executor) {
1883
1924
  setInternalState(this, {
@@ -1885,109 +1926,231 @@
1885
1926
  done: false,
1886
1927
  notified: false,
1887
1928
  parent: false,
1888
- reactions: [],
1929
+ reactions: new queue$1(),
1889
1930
  rejection: false,
1890
1931
  state: PENDING,
1891
1932
  value: undefined
1892
1933
  });
1893
1934
  };
1894
- Internal.prototype = redefineAll(PromisePrototype, {
1895
- // `Promise.prototype.then` method
1896
- // https://tc39.es/ecma262/#sec-promise.prototype.then
1897
- then: function then(onFulfilled, onRejected) {
1898
- var state = getInternalPromiseState(this);
1899
- var reactions = state.reactions;
1900
- var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
1901
- reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
1902
- reaction.fail = isCallable(onRejected) && onRejected;
1903
- reaction.domain = engineIsNode ? process.domain : undefined;
1904
- state.parent = true;
1905
- reactions[reactions.length] = reaction;
1906
- if (state.state != PENDING) notify(state, false);
1907
- return reaction.promise;
1908
- },
1909
- // `Promise.prototype.catch` method
1910
- // https://tc39.es/ecma262/#sec-promise.prototype.catch
1911
- 'catch': function (onRejected) {
1912
- return this.then(undefined, onRejected);
1913
- }
1935
+
1936
+ // `Promise.prototype.then` method
1937
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
1938
+ Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
1939
+ var state = getInternalPromiseState(this);
1940
+ var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
1941
+ state.parent = true;
1942
+ reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
1943
+ reaction.fail = isCallable(onRejected) && onRejected;
1944
+ reaction.domain = engineIsNode ? process.domain : undefined;
1945
+ if (state.state === PENDING) state.reactions.add(reaction);
1946
+ else microtask_1(function () {
1947
+ callReaction(reaction, state);
1948
+ });
1949
+ return reaction.promise;
1914
1950
  });
1951
+
1915
1952
  OwnPromiseCapability = function () {
1916
1953
  var promise = new Internal();
1917
- var state = getInternalState(promise);
1954
+ var state = getInternalPromiseState(promise);
1918
1955
  this.promise = promise;
1919
1956
  this.resolve = bind(internalResolve, state);
1920
1957
  this.reject = bind(internalReject, state);
1921
1958
  };
1959
+
1922
1960
  newPromiseCapability$1.f = newPromiseCapability = function (C) {
1923
1961
  return C === PromiseConstructor || C === PromiseWrapper
1924
1962
  ? new OwnPromiseCapability(C)
1925
1963
  : newGenericPromiseCapability(C);
1926
1964
  };
1927
1965
 
1928
- if (isCallable(nativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
1929
- nativeThen = NativePromisePrototype.then;
1966
+ if (isCallable(promiseNativeConstructor) && NativePromisePrototype$1 !== Object.prototype) {
1967
+ nativeThen = NativePromisePrototype$1.then;
1930
1968
 
1931
- if (!SUBCLASSING) {
1969
+ if (!NATIVE_PROMISE_SUBCLASSING) {
1932
1970
  // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
1933
- redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
1971
+ defineBuiltIn(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
1934
1972
  var that = this;
1935
1973
  return new PromiseConstructor(function (resolve, reject) {
1936
1974
  functionCall(nativeThen, that, resolve, reject);
1937
1975
  }).then(onFulfilled, onRejected);
1938
1976
  // https://github.com/zloirock/core-js/issues/640
1939
1977
  }, { unsafe: true });
1940
-
1941
- // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
1942
- redefine(NativePromisePrototype, 'catch', PromisePrototype['catch'], { unsafe: true });
1943
1978
  }
1944
1979
 
1945
1980
  // make `.constructor === Promise` work for native promise-based APIs
1946
1981
  try {
1947
- delete NativePromisePrototype.constructor;
1982
+ delete NativePromisePrototype$1.constructor;
1948
1983
  } catch (error) { /* empty */ }
1949
1984
 
1950
1985
  // make `instanceof Promise` work for native promise-based APIs
1951
1986
  if (objectSetPrototypeOf) {
1952
- objectSetPrototypeOf(NativePromisePrototype, PromisePrototype);
1987
+ objectSetPrototypeOf(NativePromisePrototype$1, PromisePrototype);
1953
1988
  }
1954
1989
  }
1955
1990
  }
1956
1991
 
1957
- _export({ global: true, wrap: true, forced: FORCED }, {
1992
+ _export({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
1958
1993
  Promise: PromiseConstructor
1959
1994
  });
1960
1995
 
1961
1996
  setToStringTag(PromiseConstructor, PROMISE, false);
1962
1997
  setSpecies(PROMISE);
1963
1998
 
1964
- PromiseWrapper = getBuiltIn(PROMISE);
1999
+ var iterators = {};
1965
2000
 
1966
- // statics
1967
- _export({ target: PROMISE, stat: true, forced: FORCED }, {
1968
- // `Promise.reject` method
1969
- // https://tc39.es/ecma262/#sec-promise.reject
1970
- reject: function reject(r) {
1971
- var capability = newPromiseCapability(this);
1972
- functionCall(capability.reject, undefined, r);
1973
- return capability.promise;
2001
+ var ITERATOR$2 = wellKnownSymbol('iterator');
2002
+ var ArrayPrototype$1 = Array.prototype;
2003
+
2004
+ // check on default Array iterator
2005
+ var isArrayIteratorMethod = function (it) {
2006
+ return it !== undefined && (iterators.Array === it || ArrayPrototype$1[ITERATOR$2] === it);
2007
+ };
2008
+
2009
+ var ITERATOR$1 = wellKnownSymbol('iterator');
2010
+
2011
+ var getIteratorMethod = function (it) {
2012
+ if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR$1)
2013
+ || getMethod(it, '@@iterator')
2014
+ || iterators[classof(it)];
2015
+ };
2016
+
2017
+ var $TypeError$1 = TypeError;
2018
+
2019
+ var getIterator = function (argument, usingIterator) {
2020
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
2021
+ if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
2022
+ throw new $TypeError$1(tryToString(argument) + ' is not iterable');
2023
+ };
2024
+
2025
+ var iteratorClose = function (iterator, kind, value) {
2026
+ var innerResult, innerError;
2027
+ anObject(iterator);
2028
+ try {
2029
+ innerResult = getMethod(iterator, 'return');
2030
+ if (!innerResult) {
2031
+ if (kind === 'throw') throw value;
2032
+ return value;
2033
+ }
2034
+ innerResult = functionCall(innerResult, iterator);
2035
+ } catch (error) {
2036
+ innerError = true;
2037
+ innerResult = error;
1974
2038
  }
1975
- });
2039
+ if (kind === 'throw') throw value;
2040
+ if (innerError) throw innerResult;
2041
+ anObject(innerResult);
2042
+ return value;
2043
+ };
1976
2044
 
1977
- _export({ target: PROMISE, stat: true, forced: FORCED }, {
1978
- // `Promise.resolve` method
1979
- // https://tc39.es/ecma262/#sec-promise.resolve
1980
- resolve: function resolve(x) {
1981
- return promiseResolve(this, x);
2045
+ var $TypeError = TypeError;
2046
+
2047
+ var Result = function (stopped, result) {
2048
+ this.stopped = stopped;
2049
+ this.result = result;
2050
+ };
2051
+
2052
+ var ResultPrototype = Result.prototype;
2053
+
2054
+ var iterate = function (iterable, unboundFunction, options) {
2055
+ var that = options && options.that;
2056
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2057
+ var IS_RECORD = !!(options && options.IS_RECORD);
2058
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2059
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
2060
+ var fn = functionBindContext(unboundFunction, that);
2061
+ var iterator, iterFn, index, length, result, next, step;
2062
+
2063
+ var stop = function (condition) {
2064
+ if (iterator) iteratorClose(iterator, 'normal', condition);
2065
+ return new Result(true, condition);
2066
+ };
2067
+
2068
+ var callFn = function (value) {
2069
+ if (AS_ENTRIES) {
2070
+ anObject(value);
2071
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2072
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
2073
+ };
2074
+
2075
+ if (IS_RECORD) {
2076
+ iterator = iterable.iterator;
2077
+ } else if (IS_ITERATOR) {
2078
+ iterator = iterable;
2079
+ } else {
2080
+ iterFn = getIteratorMethod(iterable);
2081
+ if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
2082
+ // optimisation for array iterators
2083
+ if (isArrayIteratorMethod(iterFn)) {
2084
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2085
+ result = callFn(iterable[index]);
2086
+ if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
2087
+ } return new Result(false);
2088
+ }
2089
+ iterator = getIterator(iterable, iterFn);
1982
2090
  }
2091
+
2092
+ next = IS_RECORD ? iterable.next : iterator.next;
2093
+ while (!(step = functionCall(next, iterator)).done) {
2094
+ try {
2095
+ result = callFn(step.value);
2096
+ } catch (error) {
2097
+ iteratorClose(iterator, 'throw', error);
2098
+ }
2099
+ if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
2100
+ } return new Result(false);
2101
+ };
2102
+
2103
+ var ITERATOR = wellKnownSymbol('iterator');
2104
+ var SAFE_CLOSING = false;
2105
+
2106
+ try {
2107
+ var called = 0;
2108
+ var iteratorWithReturn = {
2109
+ next: function () {
2110
+ return { done: !!called++ };
2111
+ },
2112
+ 'return': function () {
2113
+ SAFE_CLOSING = true;
2114
+ }
2115
+ };
2116
+ iteratorWithReturn[ITERATOR] = function () {
2117
+ return this;
2118
+ };
2119
+ // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2120
+ Array.from(iteratorWithReturn, function () { throw 2; });
2121
+ } catch (error) { /* empty */ }
2122
+
2123
+ var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
2124
+ try {
2125
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2126
+ } catch (error) { return false; } // workaround of old WebKit + `eval` bug
2127
+ var ITERATION_SUPPORT = false;
2128
+ try {
2129
+ var object = {};
2130
+ object[ITERATOR] = function () {
2131
+ return {
2132
+ next: function () {
2133
+ return { done: ITERATION_SUPPORT = true };
2134
+ }
2135
+ };
2136
+ };
2137
+ exec(object);
2138
+ } catch (error) { /* empty */ }
2139
+ return ITERATION_SUPPORT;
2140
+ };
2141
+
2142
+ var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
2143
+
2144
+ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
2145
+ promiseNativeConstructor.all(iterable).then(undefined, function () { /* empty */ });
1983
2146
  });
1984
2147
 
1985
- _export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
1986
- // `Promise.all` method
1987
- // https://tc39.es/ecma262/#sec-promise.all
2148
+ // `Promise.all` method
2149
+ // https://tc39.es/ecma262/#sec-promise.all
2150
+ _export({ target: 'Promise', stat: true, forced: promiseStaticsIncorrectIteration }, {
1988
2151
  all: function all(iterable) {
1989
2152
  var C = this;
1990
- var capability = newPromiseCapability(C);
2153
+ var capability = newPromiseCapability$1.f(C);
1991
2154
  var resolve = capability.resolve;
1992
2155
  var reject = capability.reject;
1993
2156
  var result = perform(function () {
@@ -2010,12 +2173,39 @@
2010
2173
  });
2011
2174
  if (result.error) reject(result.value);
2012
2175
  return capability.promise;
2013
- },
2014
- // `Promise.race` method
2015
- // https://tc39.es/ecma262/#sec-promise.race
2176
+ }
2177
+ });
2178
+
2179
+ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2180
+
2181
+
2182
+
2183
+
2184
+
2185
+ var NativePromisePrototype = promiseNativeConstructor && promiseNativeConstructor.prototype;
2186
+
2187
+ // `Promise.prototype.catch` method
2188
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
2189
+ _export({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2190
+ 'catch': function (onRejected) {
2191
+ return this.then(undefined, onRejected);
2192
+ }
2193
+ });
2194
+
2195
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
2196
+ if (isCallable(promiseNativeConstructor)) {
2197
+ var method = getBuiltIn('Promise').prototype['catch'];
2198
+ if (NativePromisePrototype['catch'] !== method) {
2199
+ defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
2200
+ }
2201
+ }
2202
+
2203
+ // `Promise.race` method
2204
+ // https://tc39.es/ecma262/#sec-promise.race
2205
+ _export({ target: 'Promise', stat: true, forced: promiseStaticsIncorrectIteration }, {
2016
2206
  race: function race(iterable) {
2017
2207
  var C = this;
2018
- var capability = newPromiseCapability(C);
2208
+ var capability = newPromiseCapability$1.f(C);
2019
2209
  var reject = capability.reject;
2020
2210
  var result = perform(function () {
2021
2211
  var $promiseResolve = aCallable(C.resolve);
@@ -2028,34 +2218,86 @@
2028
2218
  }
2029
2219
  });
2030
2220
 
2031
- var MSIE = /MSIE .\./.test(engineUserAgent); // <- dirty ie9- check
2032
- var Function$1 = global$1.Function;
2221
+ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2033
2222
 
2034
- var wrap = function (scheduler) {
2035
- return function (handler, timeout /* , ...arguments */) {
2036
- var boundArgs = arguments.length > 2;
2037
- var args = boundArgs ? arraySlice(arguments, 2) : undefined;
2038
- return scheduler(boundArgs ? function () {
2039
- functionApply(isCallable(handler) ? handler : Function$1(handler), this, args);
2040
- } : handler, timeout);
2041
- };
2223
+ // `Promise.reject` method
2224
+ // https://tc39.es/ecma262/#sec-promise.reject
2225
+ _export({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2226
+ reject: function reject(r) {
2227
+ var capability = newPromiseCapability$1.f(this);
2228
+ functionCall(capability.reject, undefined, r);
2229
+ return capability.promise;
2230
+ }
2231
+ });
2232
+
2233
+ var promiseResolve = function (C, x) {
2234
+ anObject(C);
2235
+ if (isObject(x) && x.constructor === C) return x;
2236
+ var promiseCapability = newPromiseCapability$1.f(C);
2237
+ var resolve = promiseCapability.resolve;
2238
+ resolve(x);
2239
+ return promiseCapability.promise;
2042
2240
  };
2043
2241
 
2044
- // ie9- setTimeout & setInterval additional parameters fix
2242
+ var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2243
+
2244
+
2245
+ getBuiltIn('Promise');
2246
+
2247
+ // `Promise.resolve` method
2248
+ // https://tc39.es/ecma262/#sec-promise.resolve
2249
+ _export({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2250
+ resolve: function resolve(x) {
2251
+ return promiseResolve(this, x);
2252
+ }
2253
+ });
2254
+
2255
+ /* global Bun -- Bun case */
2256
+ var engineIsBun = typeof Bun == 'function' && Bun && typeof Bun.version == 'string';
2257
+
2258
+ var Function$1 = global$1.Function;
2259
+ // dirty IE9- and Bun 0.3.0- checks
2260
+ var WRAP = /MSIE .\./.test(engineUserAgent) || engineIsBun && (function () {
2261
+ var version = global$1.Bun.version.split('.');
2262
+ return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0');
2263
+ })();
2264
+
2265
+ // IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix
2045
2266
  // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
2046
- _export({ global: true, bind: true, forced: MSIE }, {
2047
- // `setTimeout` method
2048
- // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
2049
- setTimeout: wrap(global$1.setTimeout),
2050
- // `setInterval` method
2051
- // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
2052
- setInterval: wrap(global$1.setInterval)
2267
+ // https://github.com/oven-sh/bun/issues/1633
2268
+ var schedulersFix = function (scheduler, hasTimeArg) {
2269
+ var firstParamIndex = hasTimeArg ? 2 : 1;
2270
+ return WRAP ? function (handler, timeout /* , ...arguments */) {
2271
+ var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
2272
+ var fn = isCallable(handler) ? handler : Function$1(handler);
2273
+ var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];
2274
+ var callback = boundArgs ? function () {
2275
+ functionApply(fn, this, params);
2276
+ } : fn;
2277
+ return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
2278
+ } : scheduler;
2279
+ };
2280
+
2281
+ var setInterval$1 = schedulersFix(global$1.setInterval, true);
2282
+
2283
+ // Bun / IE9- setInterval additional parameters fix
2284
+ // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
2285
+ _export({ global: true, bind: true, forced: global$1.setInterval !== setInterval$1 }, {
2286
+ setInterval: setInterval$1
2287
+ });
2288
+
2289
+ var setTimeout$1 = schedulersFix(global$1.setTimeout, true);
2290
+
2291
+ // Bun / IE9- setTimeout additional parameters fix
2292
+ // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
2293
+ _export({ global: true, bind: true, forced: global$1.setTimeout !== setTimeout$1 }, {
2294
+ setTimeout: setTimeout$1
2053
2295
  });
2054
2296
 
2055
2297
  // `Object.defineProperties` method
2056
2298
  // https://tc39.es/ecma262/#sec-object.defineproperties
2057
2299
  // eslint-disable-next-line es/no-object-defineproperties -- safe
2058
- var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
2300
+ var f = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
2059
2301
  anObject(O);
2060
2302
  var props = toIndexedObject(Properties);
2061
2303
  var keys = objectKeys(Properties);
@@ -2066,8 +2308,19 @@
2066
2308
  return O;
2067
2309
  };
2068
2310
 
2311
+ var objectDefineProperties = {
2312
+ f: f
2313
+ };
2314
+
2069
2315
  /* global ActiveXObject -- old IE, WSH */
2070
2316
 
2317
+
2318
+
2319
+
2320
+
2321
+
2322
+
2323
+
2071
2324
  var GT = '>';
2072
2325
  var LT = '<';
2073
2326
  var PROTOTYPE = 'prototype';
@@ -2130,6 +2383,7 @@
2130
2383
 
2131
2384
  // `Object.create` method
2132
2385
  // https://tc39.es/ecma262/#sec-object.create
2386
+ // eslint-disable-next-line es/no-object-create -- safe
2133
2387
  var objectCreate = Object.create || function create(O, Properties) {
2134
2388
  var result;
2135
2389
  if (O !== null) {
@@ -2139,16 +2393,18 @@
2139
2393
  // add "__proto__" for Object.getPrototypeOf polyfill
2140
2394
  result[IE_PROTO] = O;
2141
2395
  } else result = NullProtoObject();
2142
- return Properties === undefined ? result : objectDefineProperties(result, Properties);
2396
+ return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
2143
2397
  };
2144
2398
 
2399
+ var defineProperty = objectDefineProperty.f;
2400
+
2145
2401
  var UNSCOPABLES = wellKnownSymbol('unscopables');
2146
2402
  var ArrayPrototype = Array.prototype;
2147
2403
 
2148
2404
  // Array.prototype[@@unscopables]
2149
2405
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2150
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
2151
- objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
2406
+ if (ArrayPrototype[UNSCOPABLES] === undefined) {
2407
+ defineProperty(ArrayPrototype, UNSCOPABLES, {
2152
2408
  configurable: true,
2153
2409
  value: objectCreate(null)
2154
2410
  });
@@ -2166,6 +2422,7 @@
2166
2422
  var SKIPS_HOLES = true;
2167
2423
 
2168
2424
  // Shouldn't skip holes
2425
+ // eslint-disable-next-line es/no-array-prototype-find -- testing
2169
2426
  if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
2170
2427
 
2171
2428
  // `Array.prototype.find` method