@tryghost/content-api 1.5.16 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/content-api.js CHANGED
@@ -48,9 +48,15 @@ var descriptors = !fails(function () {
48
48
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
49
49
  });
50
50
 
51
+ var functionBindNative = !fails(function () {
52
+ var test = (function () { /* empty */ }).bind();
53
+ // eslint-disable-next-line no-prototype-builtins -- safe
54
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
55
+ });
56
+
51
57
  var call$2 = Function.prototype.call;
52
58
 
53
- var functionCall = call$2.bind ? call$2.bind(call$2) : function () {
59
+ var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
54
60
  return call$2.apply(call$2, arguments);
55
61
  };
56
62
 
@@ -63,13 +69,13 @@ var NASHORN_BUG = getOwnPropertyDescriptor$4 && !$propertyIsEnumerable.call({ 1:
63
69
 
64
70
  // `Object.prototype.propertyIsEnumerable` method implementation
65
71
  // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
66
- var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
72
+ var f$6 = NASHORN_BUG ? function propertyIsEnumerable(V) {
67
73
  var descriptor = getOwnPropertyDescriptor$4(this, V);
68
74
  return !!descriptor && descriptor.enumerable;
69
75
  } : $propertyIsEnumerable;
70
76
 
71
77
  var objectPropertyIsEnumerable = {
72
- f: f$5
78
+ f: f$6
73
79
  };
74
80
 
75
81
  var createPropertyDescriptor = function (bitmap, value) {
@@ -82,12 +88,12 @@ var createPropertyDescriptor = function (bitmap, value) {
82
88
  };
83
89
 
84
90
  var FunctionPrototype$3 = Function.prototype;
85
- var bind$4 = FunctionPrototype$3.bind;
91
+ var bind$3 = FunctionPrototype$3.bind;
86
92
  var call$1 = FunctionPrototype$3.call;
87
- var callBind = bind$4 && bind$4.bind(call$1);
93
+ var uncurryThis = functionBindNative && bind$3.bind(call$1, call$1);
88
94
 
89
- var functionUncurryThis = bind$4 ? function (fn) {
90
- return fn && callBind(call$1, fn);
95
+ var functionUncurryThis = functionBindNative ? function (fn) {
96
+ return fn && uncurryThis(fn);
91
97
  } : function (fn) {
92
98
  return fn && function () {
93
99
  return call$1.apply(fn, arguments);
@@ -113,12 +119,12 @@ var indexedObject = fails(function () {
113
119
  return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
114
120
  } : Object$4;
115
121
 
116
- var TypeError$f = global_1.TypeError;
122
+ var TypeError$g = global_1.TypeError;
117
123
 
118
124
  // `RequireObjectCoercible` abstract operation
119
125
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
120
126
  var requireObjectCoercible = function (it) {
121
- if (it == undefined) throw TypeError$f("Can't call method on " + it);
127
+ if (it == undefined) throw TypeError$g("Can't call method on " + it);
122
128
  return it;
123
129
  };
124
130
 
@@ -217,12 +223,12 @@ var tryToString = function (argument) {
217
223
  }
218
224
  };
219
225
 
220
- var TypeError$e = global_1.TypeError;
226
+ var TypeError$f = global_1.TypeError;
221
227
 
222
228
  // `Assert: IsCallable(argument) is true`
223
229
  var aCallable = function (argument) {
224
230
  if (isCallable(argument)) return argument;
225
- throw TypeError$e(tryToString(argument) + ' is not a function');
231
+ throw TypeError$f(tryToString(argument) + ' is not a function');
226
232
  };
227
233
 
228
234
  // `GetMethod` abstract operation
@@ -232,7 +238,7 @@ var getMethod = function (V, P) {
232
238
  return func == null ? undefined : aCallable(func);
233
239
  };
234
240
 
235
- var TypeError$d = global_1.TypeError;
241
+ var TypeError$e = global_1.TypeError;
236
242
 
237
243
  // `OrdinaryToPrimitive` abstract operation
238
244
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
@@ -241,7 +247,7 @@ var ordinaryToPrimitive = function (input, pref) {
241
247
  if (pref === 'string' && isCallable(fn = input.toString) && !isObject$1(val = functionCall(fn, input))) return val;
242
248
  if (isCallable(fn = input.valueOf) && !isObject$1(val = functionCall(fn, input))) return val;
243
249
  if (pref !== 'string' && isCallable(fn = input.toString) && !isObject$1(val = functionCall(fn, input))) return val;
244
- throw TypeError$d("Can't convert object to primitive value");
250
+ throw TypeError$e("Can't convert object to primitive value");
245
251
  };
246
252
 
247
253
  // eslint-disable-next-line es/no-object-defineproperty -- safe
@@ -264,9 +270,11 @@ var shared = createCommonjsModule(function (module) {
264
270
  (module.exports = function (key, value) {
265
271
  return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
266
272
  })('versions', []).push({
267
- version: '3.19.1',
273
+ version: '3.21.1',
268
274
  mode: 'global',
269
- copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
275
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
276
+ license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
277
+ source: 'https://github.com/zloirock/core-js'
270
278
  });
271
279
  });
272
280
 
@@ -312,7 +320,7 @@ var wellKnownSymbol = function (name) {
312
320
  } return WellKnownSymbolsStore[name];
313
321
  };
314
322
 
315
- var TypeError$c = global_1.TypeError;
323
+ var TypeError$d = global_1.TypeError;
316
324
  var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
317
325
 
318
326
  // `ToPrimitive` abstract operation
@@ -325,7 +333,7 @@ var toPrimitive = function (input, pref) {
325
333
  if (pref === undefined) pref = 'default';
326
334
  result = functionCall(exoticToPrim, input, pref);
327
335
  if (!isObject$1(result) || isSymbol(result)) return result;
328
- throw TypeError$c("Can't convert object to primitive value");
336
+ throw TypeError$d("Can't convert object to primitive value");
329
337
  }
330
338
  if (pref === undefined) pref = 'number';
331
339
  return ordinaryToPrimitive(input, pref);
@@ -346,61 +354,91 @@ var documentCreateElement = function (it) {
346
354
  return EXISTS$1 ? document$3.createElement(it) : {};
347
355
  };
348
356
 
349
- // Thank's IE8 for his funny defineProperty
357
+ // Thanks to IE8 for its funny defineProperty
350
358
  var ie8DomDefine = !descriptors && !fails(function () {
351
- // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
359
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
352
360
  return Object.defineProperty(documentCreateElement('div'), 'a', {
353
361
  get: function () { return 7; }
354
362
  }).a != 7;
355
363
  });
356
364
 
357
365
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
358
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
366
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
359
367
 
360
368
  // `Object.getOwnPropertyDescriptor` method
361
369
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
362
- var f$4 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
370
+ var f$5 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
363
371
  O = toIndexedObject(O);
364
372
  P = toPropertyKey(P);
365
373
  if (ie8DomDefine) try {
366
- return $getOwnPropertyDescriptor(O, P);
374
+ return $getOwnPropertyDescriptor$1(O, P);
367
375
  } catch (error) { /* empty */ }
368
376
  if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
369
377
  };
370
378
 
371
379
  var objectGetOwnPropertyDescriptor = {
372
- f: f$4
380
+ f: f$5
373
381
  };
374
382
 
383
+ // V8 ~ Chrome 36-
384
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
385
+ var v8PrototypeDefineBug = descriptors && fails(function () {
386
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
387
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
388
+ value: 42,
389
+ writable: false
390
+ }).prototype != 42;
391
+ });
392
+
375
393
  var String$4 = global_1.String;
376
- var TypeError$b = global_1.TypeError;
394
+ var TypeError$c = global_1.TypeError;
377
395
 
378
396
  // `Assert: Type(argument) is Object`
379
397
  var anObject = function (argument) {
380
398
  if (isObject$1(argument)) return argument;
381
- throw TypeError$b(String$4(argument) + ' is not an object');
399
+ throw TypeError$c(String$4(argument) + ' is not an object');
382
400
  };
383
401
 
384
- var TypeError$a = global_1.TypeError;
402
+ var TypeError$b = global_1.TypeError;
385
403
  // eslint-disable-next-line es/no-object-defineproperty -- safe
386
404
  var $defineProperty = Object.defineProperty;
405
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
406
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
407
+ var ENUMERABLE = 'enumerable';
408
+ var CONFIGURABLE$1 = 'configurable';
409
+ var WRITABLE = 'writable';
387
410
 
388
411
  // `Object.defineProperty` method
389
412
  // https://tc39.es/ecma262/#sec-object.defineproperty
390
- var f$3 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
413
+ var f$4 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
414
+ anObject(O);
415
+ P = toPropertyKey(P);
416
+ anObject(Attributes);
417
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
418
+ var current = $getOwnPropertyDescriptor(O, P);
419
+ if (current && current[WRITABLE]) {
420
+ O[P] = Attributes.value;
421
+ Attributes = {
422
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
423
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
424
+ writable: false
425
+ };
426
+ }
427
+ } return $defineProperty(O, P, Attributes);
428
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
391
429
  anObject(O);
392
430
  P = toPropertyKey(P);
393
431
  anObject(Attributes);
394
432
  if (ie8DomDefine) try {
395
433
  return $defineProperty(O, P, Attributes);
396
434
  } catch (error) { /* empty */ }
397
- if ('get' in Attributes || 'set' in Attributes) throw TypeError$a('Accessors not supported');
435
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError$b('Accessors not supported');
398
436
  if ('value' in Attributes) O[P] = Attributes.value;
399
437
  return O;
400
438
  };
401
439
 
402
440
  var objectDefineProperty = {
403
- f: f$3
441
+ f: f$4
404
442
  };
405
443
 
406
444
  var createNonEnumerableProperty = descriptors ? function (object, key, value) {
@@ -434,7 +472,7 @@ var sharedKey = function (key) {
434
472
  var hiddenKeys$1 = {};
435
473
 
436
474
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
437
- var TypeError$9 = global_1.TypeError;
475
+ var TypeError$a = global_1.TypeError;
438
476
  var WeakMap = global_1.WeakMap;
439
477
  var set$1, get, has;
440
478
 
@@ -446,7 +484,7 @@ var getterFor = function (TYPE) {
446
484
  return function (it) {
447
485
  var state;
448
486
  if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
449
- throw TypeError$9('Incompatible receiver, ' + TYPE + ' required');
487
+ throw TypeError$a('Incompatible receiver, ' + TYPE + ' required');
450
488
  } return state;
451
489
  };
452
490
  };
@@ -457,7 +495,7 @@ if (nativeWeakMap || sharedStore.state) {
457
495
  var wmhas = functionUncurryThis(store.has);
458
496
  var wmset = functionUncurryThis(store.set);
459
497
  set$1 = function (it, metadata) {
460
- if (wmhas(store, it)) throw new TypeError$9(OBJECT_ALREADY_INITIALIZED);
498
+ if (wmhas(store, it)) throw new TypeError$a(OBJECT_ALREADY_INITIALIZED);
461
499
  metadata.facade = it;
462
500
  wmset(store, it, metadata);
463
501
  return metadata;
@@ -472,7 +510,7 @@ if (nativeWeakMap || sharedStore.state) {
472
510
  var STATE = sharedKey('state');
473
511
  hiddenKeys$1[STATE] = true;
474
512
  set$1 = function (it, metadata) {
475
- if (hasOwnProperty_1(it, STATE)) throw new TypeError$9(OBJECT_ALREADY_INITIALIZED);
513
+ if (hasOwnProperty_1(it, STATE)) throw new TypeError$a(OBJECT_ALREADY_INITIALIZED);
476
514
  metadata.facade = it;
477
515
  createNonEnumerableProperty(it, STATE, metadata);
478
516
  return metadata;
@@ -649,19 +687,19 @@ var hiddenKeys = enumBugKeys.concat('length', 'prototype');
649
687
  // `Object.getOwnPropertyNames` method
650
688
  // https://tc39.es/ecma262/#sec-object.getownpropertynames
651
689
  // eslint-disable-next-line es/no-object-getownpropertynames -- safe
652
- var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
690
+ var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
653
691
  return objectKeysInternal(O, hiddenKeys);
654
692
  };
655
693
 
656
694
  var objectGetOwnPropertyNames = {
657
- f: f$2
695
+ f: f$3
658
696
  };
659
697
 
660
698
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
661
- var f$1 = Object.getOwnPropertySymbols;
699
+ var f$2 = Object.getOwnPropertySymbols;
662
700
 
663
701
  var objectGetOwnPropertySymbols = {
664
- f: f$1
702
+ f: f$2
665
703
  };
666
704
 
667
705
  var concat$1 = functionUncurryThis([].concat);
@@ -673,13 +711,15 @@ var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
673
711
  return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
674
712
  };
675
713
 
676
- var copyConstructorProperties = function (target, source) {
714
+ var copyConstructorProperties = function (target, source, exceptions) {
677
715
  var keys = ownKeys(source);
678
716
  var defineProperty = objectDefineProperty.f;
679
717
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
680
718
  for (var i = 0; i < keys.length; i++) {
681
719
  var key = keys[i];
682
- if (!hasOwnProperty_1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
720
+ if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
721
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
722
+ }
683
723
  }
684
724
  };
685
725
 
@@ -761,8 +801,8 @@ var _export = function (options, source) {
761
801
  var arrayMethodIsStrict = function (METHOD_NAME, argument) {
762
802
  var method = [][METHOD_NAME];
763
803
  return !!method && fails(function () {
764
- // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
765
- method.call(null, argument || function () { throw 1; }, 1);
804
+ // eslint-disable-next-line no-useless-call -- required for testing
805
+ method.call(null, argument || function () { return 1; }, 1);
766
806
  });
767
807
  };
768
808
 
@@ -789,7 +829,7 @@ var objectKeys = Object.keys || function keys(O) {
789
829
  // `Object.defineProperties` method
790
830
  // https://tc39.es/ecma262/#sec-object.defineproperties
791
831
  // eslint-disable-next-line es/no-object-defineproperties -- safe
792
- var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
832
+ var f$1 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
793
833
  anObject(O);
794
834
  var props = toIndexedObject(Properties);
795
835
  var keys = objectKeys(Properties);
@@ -800,6 +840,10 @@ var objectDefineProperties = descriptors ? Object.defineProperties : function de
800
840
  return O;
801
841
  };
802
842
 
843
+ var objectDefineProperties = {
844
+ f: f$1
845
+ };
846
+
803
847
  var html = getBuiltIn('document', 'documentElement');
804
848
 
805
849
  /* global ActiveXObject -- old IE, WSH */
@@ -882,7 +926,7 @@ var objectCreate = Object.create || function create(O, Properties) {
882
926
  // add "__proto__" for Object.getPrototypeOf polyfill
883
927
  result[IE_PROTO] = O;
884
928
  } else result = NullProtoObject();
885
- return Properties === undefined ? result : objectDefineProperties(result, Properties);
929
+ return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
886
930
  };
887
931
 
888
932
  var UNSCOPABLES = wellKnownSymbol('unscopables');
@@ -978,7 +1022,13 @@ var UNSUPPORTED_Y$1 = fails(function () {
978
1022
  return re.exec('abcd') != null;
979
1023
  });
980
1024
 
981
- var BROKEN_CARET = fails(function () {
1025
+ // UC Browser bug
1026
+ // https://github.com/zloirock/core-js/issues/1008
1027
+ var MISSED_STICKY = UNSUPPORTED_Y$1 || fails(function () {
1028
+ return !$RegExp$2('a', 'y').sticky;
1029
+ });
1030
+
1031
+ var BROKEN_CARET = UNSUPPORTED_Y$1 || fails(function () {
982
1032
  // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
983
1033
  var re = $RegExp$2('^r', 'gy');
984
1034
  re.lastIndex = 2;
@@ -986,8 +1036,9 @@ var BROKEN_CARET = fails(function () {
986
1036
  });
987
1037
 
988
1038
  var regexpStickyHelpers = {
989
- UNSUPPORTED_Y: UNSUPPORTED_Y$1,
990
- BROKEN_CARET: BROKEN_CARET
1039
+ BROKEN_CARET: BROKEN_CARET,
1040
+ MISSED_STICKY: MISSED_STICKY,
1041
+ UNSUPPORTED_Y: UNSUPPORTED_Y$1
991
1042
  };
992
1043
 
993
1044
  // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
@@ -1036,7 +1087,7 @@ var UPDATES_LAST_INDEX_WRONG = (function () {
1036
1087
  return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1037
1088
  })();
1038
1089
 
1039
- var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
1090
+ var UNSUPPORTED_Y = regexpStickyHelpers.BROKEN_CARET;
1040
1091
 
1041
1092
  // nonparticipating capturing group, copied from es5-shim's String#split patch.
1042
1093
  var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
@@ -1044,7 +1095,6 @@ var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1044
1095
  var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || regexpUnsupportedDotAll || regexpUnsupportedNcg;
1045
1096
 
1046
1097
  if (PATCH) {
1047
- // eslint-disable-next-line max-statements -- TODO
1048
1098
  patchedExec = function exec(string) {
1049
1099
  var re = this;
1050
1100
  var state = getInternalState$1(re);
@@ -1140,11 +1190,11 @@ var isRegexp = function (it) {
1140
1190
  return isObject$1(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
1141
1191
  };
1142
1192
 
1143
- var TypeError$8 = global_1.TypeError;
1193
+ var TypeError$9 = global_1.TypeError;
1144
1194
 
1145
1195
  var notARegexp = function (it) {
1146
1196
  if (isRegexp(it)) {
1147
- throw TypeError$8("The method doesn't accept regular expressions");
1197
+ throw TypeError$9("The method doesn't accept regular expressions");
1148
1198
  } return it;
1149
1199
  };
1150
1200
 
@@ -1252,11 +1302,11 @@ var redefineAll = function (target, src, options) {
1252
1302
  };
1253
1303
 
1254
1304
  var String$2 = global_1.String;
1255
- var TypeError$7 = global_1.TypeError;
1305
+ var TypeError$8 = global_1.TypeError;
1256
1306
 
1257
1307
  var aPossiblePrototype = function (argument) {
1258
1308
  if (typeof argument == 'object' || isCallable(argument)) return argument;
1259
- throw TypeError$7("Can't set " + String$2(argument) + ' as a prototype');
1309
+ throw TypeError$8("Can't set " + String$2(argument) + ' as a prototype');
1260
1310
  };
1261
1311
 
1262
1312
  /* eslint-disable no-proto -- safe */
@@ -1293,9 +1343,10 @@ var defineProperty$2 = objectDefineProperty.f;
1293
1343
 
1294
1344
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1295
1345
 
1296
- var setToStringTag = function (it, TAG, STATIC) {
1297
- if (it && !hasOwnProperty_1(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
1298
- defineProperty$2(it, TO_STRING_TAG, { configurable: true, value: TAG });
1346
+ var setToStringTag = function (target, TAG, STATIC) {
1347
+ if (target && !STATIC) target = target.prototype;
1348
+ if (target && !hasOwnProperty_1(target, TO_STRING_TAG)) {
1349
+ defineProperty$2(target, TO_STRING_TAG, { configurable: true, value: TAG });
1299
1350
  }
1300
1351
  };
1301
1352
 
@@ -1313,19 +1364,19 @@ var setSpecies = function (CONSTRUCTOR_NAME) {
1313
1364
  }
1314
1365
  };
1315
1366
 
1316
- var TypeError$6 = global_1.TypeError;
1367
+ var TypeError$7 = global_1.TypeError;
1317
1368
 
1318
1369
  var anInstance = function (it, Prototype) {
1319
1370
  if (objectIsPrototypeOf(Prototype, it)) return it;
1320
- throw TypeError$6('Incorrect invocation');
1371
+ throw TypeError$7('Incorrect invocation');
1321
1372
  };
1322
1373
 
1323
- var bind$3 = functionUncurryThis(functionUncurryThis.bind);
1374
+ var bind$2 = functionUncurryThis(functionUncurryThis.bind);
1324
1375
 
1325
1376
  // optional / simple context binding
1326
1377
  var functionBindContext = function (fn, that) {
1327
1378
  aCallable(fn);
1328
- return that === undefined ? fn : bind$3 ? bind$3(fn, that) : function (/* ...args */) {
1379
+ return that === undefined ? fn : functionBindNative ? bind$2(fn, that) : function (/* ...args */) {
1329
1380
  return fn.apply(that, arguments);
1330
1381
  };
1331
1382
  };
@@ -1348,12 +1399,12 @@ var getIteratorMethod = function (it) {
1348
1399
  || iterators[classof(it)];
1349
1400
  };
1350
1401
 
1351
- var TypeError$5 = global_1.TypeError;
1402
+ var TypeError$6 = global_1.TypeError;
1352
1403
 
1353
1404
  var getIterator = function (argument, usingIterator) {
1354
1405
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
1355
1406
  if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
1356
- throw TypeError$5(tryToString(argument) + ' is not iterable');
1407
+ throw TypeError$6(tryToString(argument) + ' is not iterable');
1357
1408
  };
1358
1409
 
1359
1410
  var iteratorClose = function (iterator, kind, value) {
@@ -1376,7 +1427,7 @@ var iteratorClose = function (iterator, kind, value) {
1376
1427
  return value;
1377
1428
  };
1378
1429
 
1379
- var TypeError$4 = global_1.TypeError;
1430
+ var TypeError$5 = global_1.TypeError;
1380
1431
 
1381
1432
  var Result = function (stopped, result) {
1382
1433
  this.stopped = stopped;
@@ -1409,7 +1460,7 @@ var iterate = function (iterable, unboundFunction, options) {
1409
1460
  iterator = iterable;
1410
1461
  } else {
1411
1462
  iterFn = getIteratorMethod(iterable);
1412
- if (!iterFn) throw TypeError$4(tryToString(iterable) + ' is not iterable');
1463
+ if (!iterFn) throw TypeError$5(tryToString(iterable) + ' is not iterable');
1413
1464
  // optimisation for array iterators
1414
1465
  if (isArrayIteratorMethod(iterFn)) {
1415
1466
  for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
@@ -1475,7 +1526,7 @@ var constructorRegExp = /^\s*(?:class|function)\b/;
1475
1526
  var exec = functionUncurryThis(constructorRegExp.exec);
1476
1527
  var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1477
1528
 
1478
- var isConstructorModern = function (argument) {
1529
+ var isConstructorModern = function isConstructor(argument) {
1479
1530
  if (!isCallable(argument)) return false;
1480
1531
  try {
1481
1532
  construct(noop, empty, argument);
@@ -1485,16 +1536,25 @@ var isConstructorModern = function (argument) {
1485
1536
  }
1486
1537
  };
1487
1538
 
1488
- var isConstructorLegacy = function (argument) {
1539
+ var isConstructorLegacy = function isConstructor(argument) {
1489
1540
  if (!isCallable(argument)) return false;
1490
1541
  switch (classof(argument)) {
1491
1542
  case 'AsyncFunction':
1492
1543
  case 'GeneratorFunction':
1493
1544
  case 'AsyncGeneratorFunction': return false;
1545
+ }
1546
+ try {
1494
1547
  // we can't check .prototype since constructors produced by .bind haven't it
1495
- } return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
1548
+ // `Function#toString` throws on some built-it function in some legacy engines
1549
+ // (for example, `DOMQuad` and similar in FF41-)
1550
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
1551
+ } catch (error) {
1552
+ return true;
1553
+ }
1496
1554
  };
1497
1555
 
1556
+ isConstructorLegacy.sham = true;
1557
+
1498
1558
  // `IsConstructor` abstract operation
1499
1559
  // https://tc39.es/ecma262/#sec-isconstructor
1500
1560
  var isConstructor = !construct || fails(function () {
@@ -1505,12 +1565,12 @@ var isConstructor = !construct || fails(function () {
1505
1565
  || called;
1506
1566
  }) ? isConstructorLegacy : isConstructorModern;
1507
1567
 
1508
- var TypeError$3 = global_1.TypeError;
1568
+ var TypeError$4 = global_1.TypeError;
1509
1569
 
1510
1570
  // `Assert: IsConstructor(argument) is true`
1511
1571
  var aConstructor = function (argument) {
1512
1572
  if (isConstructor(argument)) return argument;
1513
- throw TypeError$3(tryToString(argument) + ' is not a constructor');
1573
+ throw TypeError$4(tryToString(argument) + ' is not a constructor');
1514
1574
  };
1515
1575
 
1516
1576
  var SPECIES$3 = wellKnownSymbol('species');
@@ -1525,16 +1585,22 @@ var speciesConstructor = function (O, defaultConstructor) {
1525
1585
 
1526
1586
  var FunctionPrototype$1 = Function.prototype;
1527
1587
  var apply = FunctionPrototype$1.apply;
1528
- var bind$2 = FunctionPrototype$1.bind;
1529
1588
  var call = FunctionPrototype$1.call;
1530
1589
 
1531
1590
  // eslint-disable-next-line es/no-reflect -- safe
1532
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (bind$2 ? call.bind(apply) : function () {
1591
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
1533
1592
  return call.apply(apply, arguments);
1534
1593
  });
1535
1594
 
1536
1595
  var arraySlice = functionUncurryThis([].slice);
1537
1596
 
1597
+ var TypeError$3 = global_1.TypeError;
1598
+
1599
+ var validateArgumentsLength = function (passed, required) {
1600
+ if (passed < required) throw TypeError$3('Not enough arguments');
1601
+ return passed;
1602
+ };
1603
+
1538
1604
  var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(engineUserAgent);
1539
1605
 
1540
1606
  var engineIsNode = classofRaw(global_1.process) == 'process';
@@ -1547,7 +1613,7 @@ var Function$1 = global_1.Function;
1547
1613
  var MessageChannel = global_1.MessageChannel;
1548
1614
  var String$1 = global_1.String;
1549
1615
  var counter = 0;
1550
- var queue = {};
1616
+ var queue$1 = {};
1551
1617
  var ONREADYSTATECHANGE = 'onreadystatechange';
1552
1618
  var location, defer, channel, port;
1553
1619
 
@@ -1557,9 +1623,9 @@ try {
1557
1623
  } catch (error) { /* empty */ }
1558
1624
 
1559
1625
  var run = function (id) {
1560
- if (hasOwnProperty_1(queue, id)) {
1561
- var fn = queue[id];
1562
- delete queue[id];
1626
+ if (hasOwnProperty_1(queue$1, id)) {
1627
+ var fn = queue$1[id];
1628
+ delete queue$1[id];
1563
1629
  fn();
1564
1630
  }
1565
1631
  };
@@ -1581,16 +1647,18 @@ var post = function (id) {
1581
1647
 
1582
1648
  // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1583
1649
  if (!set || !clear) {
1584
- set = function setImmediate(fn) {
1650
+ set = function setImmediate(handler) {
1651
+ validateArgumentsLength(arguments.length, 1);
1652
+ var fn = isCallable(handler) ? handler : Function$1(handler);
1585
1653
  var args = arraySlice(arguments, 1);
1586
- queue[++counter] = function () {
1587
- functionApply(isCallable(fn) ? fn : Function$1(fn), undefined, args);
1654
+ queue$1[++counter] = function () {
1655
+ functionApply(fn, undefined, args);
1588
1656
  };
1589
1657
  defer(counter);
1590
1658
  return counter;
1591
1659
  };
1592
1660
  clear = function clearImmediate(id) {
1593
- delete queue[id];
1661
+ delete queue$1[id];
1594
1662
  };
1595
1663
  // Node.js 0.8-
1596
1664
  if (engineIsNode) {
@@ -1774,6 +1842,30 @@ var perform = function (exec) {
1774
1842
  }
1775
1843
  };
1776
1844
 
1845
+ var Queue = function () {
1846
+ this.head = null;
1847
+ this.tail = null;
1848
+ };
1849
+
1850
+ Queue.prototype = {
1851
+ add: function (item) {
1852
+ var entry = { item: item, next: null };
1853
+ if (this.head) this.tail.next = entry;
1854
+ else this.head = entry;
1855
+ this.tail = entry;
1856
+ },
1857
+ get: function () {
1858
+ var entry = this.head;
1859
+ if (entry) {
1860
+ this.head = entry.next;
1861
+ if (this.tail === entry) this.tail = null;
1862
+ return entry.item;
1863
+ }
1864
+ }
1865
+ };
1866
+
1867
+ var queue = Queue;
1868
+
1777
1869
  var engineIsBrowser = typeof window == 'object';
1778
1870
 
1779
1871
  var task = task$1.set;
@@ -1789,10 +1881,11 @@ var task = task$1.set;
1789
1881
 
1790
1882
 
1791
1883
 
1884
+
1792
1885
  var SPECIES$2 = wellKnownSymbol('species');
1793
1886
  var PROMISE = 'Promise';
1794
1887
 
1795
- var getInternalState = internalState.get;
1888
+ var getInternalState = internalState.getterFor(PROMISE);
1796
1889
  var setInternalState = internalState.set;
1797
1890
  var getInternalPromiseState = internalState.getterFor(PROMISE);
1798
1891
  var NativePromisePrototype = nativePromiseConstructor && nativePromiseConstructor.prototype;
@@ -1851,49 +1944,50 @@ var isThenable = function (it) {
1851
1944
  return isObject$1(it) && isCallable(then = it.then) ? then : false;
1852
1945
  };
1853
1946
 
1947
+ var callReaction = function (reaction, state) {
1948
+ var value = state.value;
1949
+ var ok = state.state == FULFILLED;
1950
+ var handler = ok ? reaction.ok : reaction.fail;
1951
+ var resolve = reaction.resolve;
1952
+ var reject = reaction.reject;
1953
+ var domain = reaction.domain;
1954
+ var result, then, exited;
1955
+ try {
1956
+ if (handler) {
1957
+ if (!ok) {
1958
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
1959
+ state.rejection = HANDLED;
1960
+ }
1961
+ if (handler === true) result = value;
1962
+ else {
1963
+ if (domain) domain.enter();
1964
+ result = handler(value); // can throw
1965
+ if (domain) {
1966
+ domain.exit();
1967
+ exited = true;
1968
+ }
1969
+ }
1970
+ if (result === reaction.promise) {
1971
+ reject(TypeError$2('Promise-chain cycle'));
1972
+ } else if (then = isThenable(result)) {
1973
+ functionCall(then, result, resolve, reject);
1974
+ } else resolve(result);
1975
+ } else reject(value);
1976
+ } catch (error) {
1977
+ if (domain && !exited) domain.exit();
1978
+ reject(error);
1979
+ }
1980
+ };
1981
+
1854
1982
  var notify = function (state, isReject) {
1855
1983
  if (state.notified) return;
1856
1984
  state.notified = true;
1857
- var chain = state.reactions;
1858
1985
  microtask(function () {
1859
- var value = state.value;
1860
- var ok = state.state == FULFILLED;
1861
- var index = 0;
1862
- // variable length - can't use forEach
1863
- while (chain.length > index) {
1864
- var reaction = chain[index++];
1865
- var handler = ok ? reaction.ok : reaction.fail;
1866
- var resolve = reaction.resolve;
1867
- var reject = reaction.reject;
1868
- var domain = reaction.domain;
1869
- var result, then, exited;
1870
- try {
1871
- if (handler) {
1872
- if (!ok) {
1873
- if (state.rejection === UNHANDLED) onHandleUnhandled(state);
1874
- state.rejection = HANDLED;
1875
- }
1876
- if (handler === true) result = value;
1877
- else {
1878
- if (domain) domain.enter();
1879
- result = handler(value); // can throw
1880
- if (domain) {
1881
- domain.exit();
1882
- exited = true;
1883
- }
1884
- }
1885
- if (result === reaction.promise) {
1886
- reject(TypeError$2('Promise-chain cycle'));
1887
- } else if (then = isThenable(result)) {
1888
- functionCall(then, result, resolve, reject);
1889
- } else resolve(result);
1890
- } else reject(value);
1891
- } catch (error) {
1892
- if (domain && !exited) domain.exit();
1893
- reject(error);
1894
- }
1986
+ var reactions = state.reactions;
1987
+ var reaction;
1988
+ while (reaction = reactions.get()) {
1989
+ callReaction(reaction, state);
1895
1990
  }
1896
- state.reactions = [];
1897
1991
  state.notified = false;
1898
1992
  if (isReject && !state.rejection) onUnhandled(state);
1899
1993
  });
@@ -2010,7 +2104,7 @@ if (FORCED$1) {
2010
2104
  done: false,
2011
2105
  notified: false,
2012
2106
  parent: false,
2013
- reactions: [],
2107
+ reactions: new queue(),
2014
2108
  rejection: false,
2015
2109
  state: PENDING,
2016
2110
  value: undefined
@@ -2019,16 +2113,18 @@ if (FORCED$1) {
2019
2113
  Internal.prototype = redefineAll(PromisePrototype, {
2020
2114
  // `Promise.prototype.then` method
2021
2115
  // https://tc39.es/ecma262/#sec-promise.prototype.then
2116
+ // eslint-disable-next-line unicorn/no-thenable -- safe
2022
2117
  then: function then(onFulfilled, onRejected) {
2023
2118
  var state = getInternalPromiseState(this);
2024
- var reactions = state.reactions;
2025
2119
  var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
2120
+ state.parent = true;
2026
2121
  reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
2027
2122
  reaction.fail = isCallable(onRejected) && onRejected;
2028
2123
  reaction.domain = engineIsNode ? process$1.domain : undefined;
2029
- state.parent = true;
2030
- reactions[reactions.length] = reaction;
2031
- if (state.state != PENDING) notify(state, false);
2124
+ if (state.state == PENDING) state.reactions.add(reaction);
2125
+ else microtask(function () {
2126
+ callReaction(reaction, state);
2127
+ });
2032
2128
  return reaction.promise;
2033
2129
  },
2034
2130
  // `Promise.prototype.catch` method
@@ -2326,7 +2422,7 @@ var defineProperty = objectDefineProperty.f;
2326
2422
 
2327
2423
  var FunctionPrototype = Function.prototype;
2328
2424
  var functionToString = functionUncurryThis(FunctionPrototype.toString);
2329
- var nameRE = /^\s*function ([^ (]*)/;
2425
+ var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/;
2330
2426
  var regExpExec = functionUncurryThis(nameRE.exec);
2331
2427
  var NAME = 'name';
2332
2428