@tryghost/content-api 1.12.6 → 1.12.7
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/cjs/content-api.js +8 -8
- package/es/content-api.js +1225 -97
- package/es/content-api.js.map +1 -1
- package/package.json +8 -8
- package/umd/content-api.min.js +1 -1
- package/umd/content-api.min.js.map +1 -1
package/es/content-api.js
CHANGED
|
@@ -1,3 +1,1014 @@
|
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
|
+
|
|
3
|
+
function createCommonjsModule(fn, module) {
|
|
4
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
var check = function (it) {
|
|
8
|
+
return it && it.Math === Math && it;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
12
|
+
var globalThis_1 =
|
|
13
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
14
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
|
15
|
+
check(typeof window == 'object' && window) ||
|
|
16
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
17
|
+
check(typeof self == 'object' && self) ||
|
|
18
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
19
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
20
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
21
|
+
(function () { return this; })() || Function('return this')();
|
|
22
|
+
|
|
23
|
+
var fails = function (exec) {
|
|
24
|
+
try {
|
|
25
|
+
return !!exec();
|
|
26
|
+
} catch (error) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Detect IE8's incomplete defineProperty implementation
|
|
32
|
+
var descriptors = !fails(function () {
|
|
33
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
34
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
var functionBindNative = !fails(function () {
|
|
38
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
39
|
+
var test = function () { /* empty */ }.bind();
|
|
40
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
41
|
+
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
var call$1 = Function.prototype.call;
|
|
45
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
46
|
+
var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
|
|
47
|
+
return call$1.apply(call$1, arguments);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
51
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
52
|
+
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
53
|
+
|
|
54
|
+
// Nashorn ~ JDK8 bug
|
|
55
|
+
var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
56
|
+
|
|
57
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
58
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
59
|
+
var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
60
|
+
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
61
|
+
return !!descriptor && descriptor.enumerable;
|
|
62
|
+
} : $propertyIsEnumerable;
|
|
63
|
+
|
|
64
|
+
var objectPropertyIsEnumerable = {
|
|
65
|
+
f: f$5
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var createPropertyDescriptor = function (bitmap, value) {
|
|
69
|
+
return {
|
|
70
|
+
enumerable: !(bitmap & 1),
|
|
71
|
+
configurable: !(bitmap & 2),
|
|
72
|
+
writable: !(bitmap & 4),
|
|
73
|
+
value: value
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
var FunctionPrototype$1 = Function.prototype;
|
|
78
|
+
var call = FunctionPrototype$1.call;
|
|
79
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
80
|
+
var uncurryThisWithBind = functionBindNative && FunctionPrototype$1.bind.bind(call, call);
|
|
81
|
+
|
|
82
|
+
var functionUncurryThis = functionBindNative ? uncurryThisWithBind : function (fn) {
|
|
83
|
+
return function () {
|
|
84
|
+
return call.apply(fn, arguments);
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
var toString$2 = functionUncurryThis({}.toString);
|
|
89
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
90
|
+
|
|
91
|
+
var classofRaw = function (it) {
|
|
92
|
+
return stringSlice(toString$2(it), 8, -1);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
var $Object$2 = Object;
|
|
96
|
+
var split = functionUncurryThis(''.split);
|
|
97
|
+
|
|
98
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
99
|
+
var indexedObject = fails(function () {
|
|
100
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
101
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
102
|
+
return !$Object$2('z').propertyIsEnumerable(0);
|
|
103
|
+
}) ? function (it) {
|
|
104
|
+
return classofRaw(it) === 'String' ? split(it, '') : $Object$2(it);
|
|
105
|
+
} : $Object$2;
|
|
106
|
+
|
|
107
|
+
// we can't use just `it == null` since of `document.all` special case
|
|
108
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
109
|
+
var isNullOrUndefined = function (it) {
|
|
110
|
+
return it === null || it === undefined;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
var $TypeError$5 = TypeError;
|
|
114
|
+
|
|
115
|
+
// `RequireObjectCoercible` abstract operation
|
|
116
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
117
|
+
var requireObjectCoercible = function (it) {
|
|
118
|
+
if (isNullOrUndefined(it)) throw new $TypeError$5("Can't call method on " + it);
|
|
119
|
+
return it;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// toObject with fallback for non-array-like ES3 strings
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
var toIndexedObject = function (it) {
|
|
127
|
+
return indexedObject(requireObjectCoercible(it));
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
131
|
+
var documentAll = typeof document == 'object' && document.all;
|
|
132
|
+
|
|
133
|
+
// `IsCallable` abstract operation
|
|
134
|
+
// https://tc39.es/ecma262/#sec-iscallable
|
|
135
|
+
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
136
|
+
var isCallable = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
137
|
+
return typeof argument == 'function' || argument === documentAll;
|
|
138
|
+
} : function (argument) {
|
|
139
|
+
return typeof argument == 'function';
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
var isObject$1 = function (it) {
|
|
143
|
+
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
var aFunction = function (argument) {
|
|
147
|
+
return isCallable(argument) ? argument : undefined;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
var getBuiltIn = function (namespace, method) {
|
|
151
|
+
return arguments.length < 2 ? aFunction(globalThis_1[namespace]) : globalThis_1[namespace] && globalThis_1[namespace][method];
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
155
|
+
|
|
156
|
+
var navigator$1 = globalThis_1.navigator;
|
|
157
|
+
var userAgent = navigator$1 && navigator$1.userAgent;
|
|
158
|
+
|
|
159
|
+
var environmentUserAgent = userAgent ? String(userAgent) : '';
|
|
160
|
+
|
|
161
|
+
var process$1 = globalThis_1.process;
|
|
162
|
+
var Deno = globalThis_1.Deno;
|
|
163
|
+
var versions = process$1 && process$1.versions || Deno && Deno.version;
|
|
164
|
+
var v8 = versions && versions.v8;
|
|
165
|
+
var match, version$1;
|
|
166
|
+
|
|
167
|
+
if (v8) {
|
|
168
|
+
match = v8.split('.');
|
|
169
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
170
|
+
// but their correct versions are not interesting for us
|
|
171
|
+
version$1 = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
175
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
176
|
+
if (!version$1 && environmentUserAgent) {
|
|
177
|
+
match = environmentUserAgent.match(/Edge\/(\d+)/);
|
|
178
|
+
if (!match || match[1] >= 74) {
|
|
179
|
+
match = environmentUserAgent.match(/Chrome\/(\d+)/);
|
|
180
|
+
if (match) version$1 = +match[1];
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
var environmentV8Version = version$1;
|
|
185
|
+
|
|
186
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
var $String$2 = globalThis_1.String;
|
|
192
|
+
|
|
193
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
194
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
195
|
+
var symbol = Symbol('symbol detection');
|
|
196
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
197
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
198
|
+
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
199
|
+
// of course, fail.
|
|
200
|
+
return !$String$2(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
201
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
202
|
+
!Symbol.sham && environmentV8Version && environmentV8Version < 41;
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
var useSymbolAsUid = symbolConstructorDetection &&
|
|
209
|
+
!Symbol.sham &&
|
|
210
|
+
typeof Symbol.iterator == 'symbol';
|
|
211
|
+
|
|
212
|
+
var $Object$1 = Object;
|
|
213
|
+
|
|
214
|
+
var isSymbol = useSymbolAsUid ? function (it) {
|
|
215
|
+
return typeof it == 'symbol';
|
|
216
|
+
} : function (it) {
|
|
217
|
+
var $Symbol = getBuiltIn('Symbol');
|
|
218
|
+
return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, $Object$1(it));
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
var $String$1 = String;
|
|
222
|
+
|
|
223
|
+
var tryToString = function (argument) {
|
|
224
|
+
try {
|
|
225
|
+
return $String$1(argument);
|
|
226
|
+
} catch (error) {
|
|
227
|
+
return 'Object';
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
var $TypeError$4 = TypeError;
|
|
232
|
+
|
|
233
|
+
// `Assert: IsCallable(argument) is true`
|
|
234
|
+
var aCallable = function (argument) {
|
|
235
|
+
if (isCallable(argument)) return argument;
|
|
236
|
+
throw new $TypeError$4(tryToString(argument) + ' is not a function');
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
// `GetMethod` abstract operation
|
|
240
|
+
// https://tc39.es/ecma262/#sec-getmethod
|
|
241
|
+
var getMethod = function (V, P) {
|
|
242
|
+
var func = V[P];
|
|
243
|
+
return isNullOrUndefined(func) ? undefined : aCallable(func);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
var $TypeError$3 = TypeError;
|
|
247
|
+
|
|
248
|
+
// `OrdinaryToPrimitive` abstract operation
|
|
249
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
250
|
+
var ordinaryToPrimitive = function (input, pref) {
|
|
251
|
+
var fn, val;
|
|
252
|
+
if (pref === 'string' && isCallable(fn = input.toString) && !isObject$1(val = functionCall(fn, input))) return val;
|
|
253
|
+
if (isCallable(fn = input.valueOf) && !isObject$1(val = functionCall(fn, input))) return val;
|
|
254
|
+
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject$1(val = functionCall(fn, input))) return val;
|
|
255
|
+
throw new $TypeError$3("Can't convert object to primitive value");
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
259
|
+
var defineProperty$1 = Object.defineProperty;
|
|
260
|
+
|
|
261
|
+
var defineGlobalProperty = function (key, value) {
|
|
262
|
+
try {
|
|
263
|
+
defineProperty$1(globalThis_1, key, { value: value, configurable: true, writable: true });
|
|
264
|
+
} catch (error) {
|
|
265
|
+
globalThis_1[key] = value;
|
|
266
|
+
} return value;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
var sharedStore = createCommonjsModule(function (module) {
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
var SHARED = '__core-js_shared__';
|
|
275
|
+
var store = module.exports = globalThis_1[SHARED] || defineGlobalProperty(SHARED, {});
|
|
276
|
+
|
|
277
|
+
(store.versions || (store.versions = [])).push({
|
|
278
|
+
version: '3.49.0',
|
|
279
|
+
mode: 'global',
|
|
280
|
+
copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
|
|
281
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE',
|
|
282
|
+
source: 'https://github.com/zloirock/core-js'
|
|
283
|
+
});
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
var shared = function (key, value) {
|
|
287
|
+
return sharedStore[key] || (sharedStore[key] = value || {});
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
var $Object = Object;
|
|
291
|
+
|
|
292
|
+
// `ToObject` abstract operation
|
|
293
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
294
|
+
var toObject = function (argument) {
|
|
295
|
+
return $Object(requireObjectCoercible(argument));
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
var hasOwnProperty$1 = functionUncurryThis({}.hasOwnProperty);
|
|
299
|
+
|
|
300
|
+
// `HasOwnProperty` abstract operation
|
|
301
|
+
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
302
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
303
|
+
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
304
|
+
return hasOwnProperty$1(toObject(it), key);
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
var id = 0;
|
|
308
|
+
var postfix = Math.random();
|
|
309
|
+
var toString$1 = functionUncurryThis(1.1.toString);
|
|
310
|
+
|
|
311
|
+
var uid = function (key) {
|
|
312
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$1(++id + postfix, 36);
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
var Symbol$1 = globalThis_1.Symbol;
|
|
316
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
317
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
318
|
+
|
|
319
|
+
var wellKnownSymbol = function (name) {
|
|
320
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name)) {
|
|
321
|
+
WellKnownSymbolsStore[name] = symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)
|
|
322
|
+
? Symbol$1[name]
|
|
323
|
+
: createWellKnownSymbol('Symbol.' + name);
|
|
324
|
+
} return WellKnownSymbolsStore[name];
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
var $TypeError$2 = TypeError;
|
|
328
|
+
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
|
329
|
+
|
|
330
|
+
// `ToPrimitive` abstract operation
|
|
331
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
332
|
+
var toPrimitive = function (input, pref) {
|
|
333
|
+
if (!isObject$1(input) || isSymbol(input)) return input;
|
|
334
|
+
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
335
|
+
var result;
|
|
336
|
+
if (exoticToPrim) {
|
|
337
|
+
if (pref === undefined) pref = 'default';
|
|
338
|
+
result = functionCall(exoticToPrim, input, pref);
|
|
339
|
+
if (!isObject$1(result) || isSymbol(result)) return result;
|
|
340
|
+
throw new $TypeError$2("Can't convert object to primitive value");
|
|
341
|
+
}
|
|
342
|
+
if (pref === undefined) pref = 'number';
|
|
343
|
+
return ordinaryToPrimitive(input, pref);
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
// `ToPropertyKey` abstract operation
|
|
347
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
|
348
|
+
var toPropertyKey = function (argument) {
|
|
349
|
+
var key = toPrimitive(argument, 'string');
|
|
350
|
+
return isSymbol(key) ? key : key + '';
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
var document$1 = globalThis_1.document;
|
|
354
|
+
// typeof document.createElement is 'object' in old IE
|
|
355
|
+
var EXISTS$1 = isObject$1(document$1) && isObject$1(document$1.createElement);
|
|
356
|
+
|
|
357
|
+
var documentCreateElement = function (it) {
|
|
358
|
+
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
// Thanks to IE8 for its funny defineProperty
|
|
362
|
+
var ie8DomDefine = !descriptors && !fails(function () {
|
|
363
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
364
|
+
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
365
|
+
get: function () { return 7; }
|
|
366
|
+
}).a !== 7;
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
370
|
+
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
371
|
+
|
|
372
|
+
// `Object.getOwnPropertyDescriptor` method
|
|
373
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
374
|
+
var f$4 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
375
|
+
O = toIndexedObject(O);
|
|
376
|
+
P = toPropertyKey(P);
|
|
377
|
+
if (ie8DomDefine) try {
|
|
378
|
+
return $getOwnPropertyDescriptor$1(O, P);
|
|
379
|
+
} catch (error) { /* empty */ }
|
|
380
|
+
if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
var objectGetOwnPropertyDescriptor = {
|
|
384
|
+
f: f$4
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
// V8 ~ Chrome 36-
|
|
388
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
389
|
+
var v8PrototypeDefineBug = descriptors && fails(function () {
|
|
390
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
391
|
+
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
392
|
+
value: 42,
|
|
393
|
+
writable: false
|
|
394
|
+
}).prototype !== 42;
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
var $String = String;
|
|
398
|
+
var $TypeError$1 = TypeError;
|
|
399
|
+
|
|
400
|
+
// `Assert: Type(argument) is Object`
|
|
401
|
+
var anObject = function (argument) {
|
|
402
|
+
if (isObject$1(argument)) return argument;
|
|
403
|
+
throw new $TypeError$1($String(argument) + ' is not an object');
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
var $TypeError = TypeError;
|
|
407
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
408
|
+
var $defineProperty = Object.defineProperty;
|
|
409
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
410
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
411
|
+
var ENUMERABLE = 'enumerable';
|
|
412
|
+
var CONFIGURABLE$1 = 'configurable';
|
|
413
|
+
var WRITABLE = 'writable';
|
|
414
|
+
|
|
415
|
+
// `Object.defineProperty` method
|
|
416
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
417
|
+
var f$3 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
|
|
418
|
+
anObject(O);
|
|
419
|
+
P = toPropertyKey(P);
|
|
420
|
+
anObject(Attributes);
|
|
421
|
+
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
422
|
+
var current = $getOwnPropertyDescriptor(O, P);
|
|
423
|
+
if (current && current[WRITABLE]) {
|
|
424
|
+
O[P] = Attributes.value;
|
|
425
|
+
Attributes = {
|
|
426
|
+
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
427
|
+
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
428
|
+
writable: false
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
} return $defineProperty(O, P, Attributes);
|
|
432
|
+
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
433
|
+
anObject(O);
|
|
434
|
+
P = toPropertyKey(P);
|
|
435
|
+
anObject(Attributes);
|
|
436
|
+
if (ie8DomDefine) try {
|
|
437
|
+
return $defineProperty(O, P, Attributes);
|
|
438
|
+
} catch (error) { /* empty */ }
|
|
439
|
+
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');
|
|
440
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
|
441
|
+
return O;
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
var objectDefineProperty = {
|
|
445
|
+
f: f$3
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
449
|
+
return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
|
450
|
+
} : function (object, key, value) {
|
|
451
|
+
object[key] = value;
|
|
452
|
+
return object;
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
var FunctionPrototype = Function.prototype;
|
|
456
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
457
|
+
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
458
|
+
|
|
459
|
+
var EXISTS = hasOwnProperty_1(FunctionPrototype, 'name');
|
|
460
|
+
// additional protection from minified / mangled / dropped function names
|
|
461
|
+
var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
|
|
462
|
+
var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
463
|
+
|
|
464
|
+
var functionName = {
|
|
465
|
+
EXISTS: EXISTS,
|
|
466
|
+
PROPER: PROPER,
|
|
467
|
+
CONFIGURABLE: CONFIGURABLE
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
var functionToString = functionUncurryThis(Function.toString);
|
|
471
|
+
|
|
472
|
+
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
473
|
+
if (!isCallable(sharedStore.inspectSource)) {
|
|
474
|
+
sharedStore.inspectSource = function (it) {
|
|
475
|
+
return functionToString(it);
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
var inspectSource = sharedStore.inspectSource;
|
|
480
|
+
|
|
481
|
+
var WeakMap$1 = globalThis_1.WeakMap;
|
|
482
|
+
|
|
483
|
+
var weakMapBasicDetection = isCallable(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
484
|
+
|
|
485
|
+
var keys = shared('keys');
|
|
486
|
+
|
|
487
|
+
var sharedKey = function (key) {
|
|
488
|
+
return keys[key] || (keys[key] = uid(key));
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
var hiddenKeys$1 = {};
|
|
492
|
+
|
|
493
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
494
|
+
var TypeError$1 = globalThis_1.TypeError;
|
|
495
|
+
var WeakMap = globalThis_1.WeakMap;
|
|
496
|
+
var set, get, has;
|
|
497
|
+
|
|
498
|
+
var enforce = function (it) {
|
|
499
|
+
return has(it) ? get(it) : set(it, {});
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
var getterFor = function (TYPE) {
|
|
503
|
+
return function (it) {
|
|
504
|
+
var state;
|
|
505
|
+
if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
|
|
506
|
+
throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
507
|
+
} return state;
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
if (weakMapBasicDetection || sharedStore.state) {
|
|
512
|
+
var store = sharedStore.state || (sharedStore.state = new WeakMap());
|
|
513
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
514
|
+
store.get = store.get;
|
|
515
|
+
store.has = store.has;
|
|
516
|
+
store.set = store.set;
|
|
517
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
518
|
+
set = function (it, metadata) {
|
|
519
|
+
if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
520
|
+
metadata.facade = it;
|
|
521
|
+
store.set(it, metadata);
|
|
522
|
+
return metadata;
|
|
523
|
+
};
|
|
524
|
+
get = function (it) {
|
|
525
|
+
return store.get(it) || {};
|
|
526
|
+
};
|
|
527
|
+
has = function (it) {
|
|
528
|
+
return store.has(it);
|
|
529
|
+
};
|
|
530
|
+
} else {
|
|
531
|
+
var STATE = sharedKey('state');
|
|
532
|
+
hiddenKeys$1[STATE] = true;
|
|
533
|
+
set = function (it, metadata) {
|
|
534
|
+
if (hasOwnProperty_1(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
535
|
+
metadata.facade = it;
|
|
536
|
+
createNonEnumerableProperty(it, STATE, metadata);
|
|
537
|
+
return metadata;
|
|
538
|
+
};
|
|
539
|
+
get = function (it) {
|
|
540
|
+
return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
|
|
541
|
+
};
|
|
542
|
+
has = function (it) {
|
|
543
|
+
return hasOwnProperty_1(it, STATE);
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
var internalState = {
|
|
548
|
+
set: set,
|
|
549
|
+
get: get,
|
|
550
|
+
has: has,
|
|
551
|
+
enforce: enforce,
|
|
552
|
+
getterFor: getterFor
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
var makeBuiltIn_1 = createCommonjsModule(function (module) {
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
var enforceInternalState = internalState.enforce;
|
|
566
|
+
var getInternalState = internalState.get;
|
|
567
|
+
var $String = String;
|
|
568
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
569
|
+
var defineProperty = Object.defineProperty;
|
|
570
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
571
|
+
var replace = functionUncurryThis(''.replace);
|
|
572
|
+
var join = functionUncurryThis([].join);
|
|
573
|
+
|
|
574
|
+
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
575
|
+
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
var TEMPLATE = String(String).split('String');
|
|
579
|
+
|
|
580
|
+
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
581
|
+
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
|
582
|
+
name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
583
|
+
}
|
|
584
|
+
if (options && options.getter) name = 'get ' + name;
|
|
585
|
+
if (options && options.setter) name = 'set ' + name;
|
|
586
|
+
if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
587
|
+
if (descriptors) defineProperty(value, 'name', { value: name, configurable: true });
|
|
588
|
+
else value.name = name;
|
|
589
|
+
}
|
|
590
|
+
if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
|
|
591
|
+
defineProperty(value, 'length', { value: options.arity });
|
|
592
|
+
}
|
|
593
|
+
try {
|
|
594
|
+
if (options && hasOwnProperty_1(options, 'constructor') && options.constructor) {
|
|
595
|
+
if (descriptors) defineProperty(value, 'prototype', { writable: false });
|
|
596
|
+
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
597
|
+
} else if (value.prototype) value.prototype = undefined;
|
|
598
|
+
} catch (error) { /* empty */ }
|
|
599
|
+
var state = enforceInternalState(value);
|
|
600
|
+
if (!hasOwnProperty_1(state, 'source')) {
|
|
601
|
+
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
|
602
|
+
} return value;
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
606
|
+
// eslint-disable-next-line no-extend-native -- required
|
|
607
|
+
Function.prototype.toString = makeBuiltIn(function toString() {
|
|
608
|
+
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
609
|
+
}, 'toString');
|
|
610
|
+
});
|
|
611
|
+
|
|
612
|
+
var defineBuiltIn = function (O, key, value, options) {
|
|
613
|
+
if (!options) options = {};
|
|
614
|
+
var simple = options.enumerable;
|
|
615
|
+
var name = options.name !== undefined ? options.name : key;
|
|
616
|
+
if (isCallable(value)) makeBuiltIn_1(value, name, options);
|
|
617
|
+
if (options.global) {
|
|
618
|
+
if (simple) O[key] = value;
|
|
619
|
+
else defineGlobalProperty(key, value);
|
|
620
|
+
} else {
|
|
621
|
+
try {
|
|
622
|
+
if (!options.unsafe) delete O[key];
|
|
623
|
+
else if (O[key]) simple = true;
|
|
624
|
+
} catch (error) { /* empty */ }
|
|
625
|
+
if (simple) O[key] = value;
|
|
626
|
+
else objectDefineProperty.f(O, key, {
|
|
627
|
+
value: value,
|
|
628
|
+
enumerable: false,
|
|
629
|
+
configurable: !options.nonConfigurable,
|
|
630
|
+
writable: !options.nonWritable
|
|
631
|
+
});
|
|
632
|
+
} return O;
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
var ceil = Math.ceil;
|
|
636
|
+
var floor = Math.floor;
|
|
637
|
+
|
|
638
|
+
// `Math.trunc` method
|
|
639
|
+
// https://tc39.es/ecma262/#sec-math.trunc
|
|
640
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
641
|
+
var mathTrunc = Math.trunc || function trunc(x) {
|
|
642
|
+
var n = +x;
|
|
643
|
+
return (n > 0 ? floor : ceil)(n);
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
// `ToIntegerOrInfinity` abstract operation
|
|
647
|
+
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
648
|
+
var toIntegerOrInfinity = function (argument) {
|
|
649
|
+
var number = +argument;
|
|
650
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
651
|
+
return number !== number || number === 0 ? 0 : mathTrunc(number);
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
var max = Math.max;
|
|
655
|
+
var min$1 = Math.min;
|
|
656
|
+
|
|
657
|
+
// Helper for a popular repeating case of the spec:
|
|
658
|
+
// Let integer be ? ToInteger(index).
|
|
659
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
660
|
+
var toAbsoluteIndex = function (index, length) {
|
|
661
|
+
var integer = toIntegerOrInfinity(index);
|
|
662
|
+
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
var min = Math.min;
|
|
666
|
+
|
|
667
|
+
// `ToLength` abstract operation
|
|
668
|
+
// https://tc39.es/ecma262/#sec-tolength
|
|
669
|
+
var toLength = function (argument) {
|
|
670
|
+
var len = toIntegerOrInfinity(argument);
|
|
671
|
+
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
// `LengthOfArrayLike` abstract operation
|
|
675
|
+
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
676
|
+
var lengthOfArrayLike = function (obj) {
|
|
677
|
+
return toLength(obj.length);
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
681
|
+
var createMethod = function (IS_INCLUDES) {
|
|
682
|
+
return function ($this, el, fromIndex) {
|
|
683
|
+
var O = toIndexedObject($this);
|
|
684
|
+
var length = lengthOfArrayLike(O);
|
|
685
|
+
if (length === 0) return !IS_INCLUDES && -1;
|
|
686
|
+
var index = toAbsoluteIndex(fromIndex, length);
|
|
687
|
+
var value;
|
|
688
|
+
// Array#includes uses SameValueZero equality algorithm
|
|
689
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
690
|
+
if (IS_INCLUDES && el !== el) while (length > index) {
|
|
691
|
+
value = O[index++];
|
|
692
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
693
|
+
if (value !== value) return true;
|
|
694
|
+
// Array#indexOf ignores holes, Array#includes - not
|
|
695
|
+
} else for (;length > index; index++) {
|
|
696
|
+
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
697
|
+
} return !IS_INCLUDES && -1;
|
|
698
|
+
};
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
var arrayIncludes = {
|
|
702
|
+
// `Array.prototype.includes` method
|
|
703
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
704
|
+
includes: createMethod(true),
|
|
705
|
+
// `Array.prototype.indexOf` method
|
|
706
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
707
|
+
indexOf: createMethod(false)
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
var indexOf = arrayIncludes.indexOf;
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
var push = functionUncurryThis([].push);
|
|
714
|
+
|
|
715
|
+
var objectKeysInternal = function (object, names) {
|
|
716
|
+
var O = toIndexedObject(object);
|
|
717
|
+
var i = 0;
|
|
718
|
+
var result = [];
|
|
719
|
+
var key;
|
|
720
|
+
for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push(result, key);
|
|
721
|
+
// Don't enum bug & hidden keys
|
|
722
|
+
while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
|
|
723
|
+
~indexOf(result, key) || push(result, key);
|
|
724
|
+
}
|
|
725
|
+
return result;
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
// IE8- don't enum bug keys
|
|
729
|
+
var enumBugKeys = [
|
|
730
|
+
'constructor',
|
|
731
|
+
'hasOwnProperty',
|
|
732
|
+
'isPrototypeOf',
|
|
733
|
+
'propertyIsEnumerable',
|
|
734
|
+
'toLocaleString',
|
|
735
|
+
'toString',
|
|
736
|
+
'valueOf'
|
|
737
|
+
];
|
|
738
|
+
|
|
739
|
+
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
|
740
|
+
|
|
741
|
+
// `Object.getOwnPropertyNames` method
|
|
742
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
743
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
744
|
+
var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
745
|
+
return objectKeysInternal(O, hiddenKeys);
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
var objectGetOwnPropertyNames = {
|
|
749
|
+
f: f$2
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
753
|
+
var f$1 = Object.getOwnPropertySymbols;
|
|
754
|
+
|
|
755
|
+
var objectGetOwnPropertySymbols = {
|
|
756
|
+
f: f$1
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
var concat = functionUncurryThis([].concat);
|
|
760
|
+
|
|
761
|
+
// all object keys, includes non-enumerable and symbols
|
|
762
|
+
var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
763
|
+
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
|
764
|
+
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
|
765
|
+
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
var copyConstructorProperties = function (target, source, exceptions) {
|
|
769
|
+
var keys = ownKeys(source);
|
|
770
|
+
var defineProperty = objectDefineProperty.f;
|
|
771
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
772
|
+
for (var i = 0; i < keys.length; i++) {
|
|
773
|
+
var key = keys[i];
|
|
774
|
+
if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
|
|
775
|
+
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
var replacement = /#|\.prototype\./;
|
|
781
|
+
|
|
782
|
+
var isForced = function (feature, detection) {
|
|
783
|
+
var value = data[normalize(feature)];
|
|
784
|
+
return value === POLYFILL ? true
|
|
785
|
+
: value === NATIVE ? false
|
|
786
|
+
: isCallable(detection) ? fails(detection)
|
|
787
|
+
: !!detection;
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
var normalize = isForced.normalize = function (string) {
|
|
791
|
+
return String(string).replace(replacement, '.').toLowerCase();
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
var data = isForced.data = {};
|
|
795
|
+
var NATIVE = isForced.NATIVE = 'N';
|
|
796
|
+
var POLYFILL = isForced.POLYFILL = 'P';
|
|
797
|
+
|
|
798
|
+
var isForced_1 = isForced;
|
|
799
|
+
|
|
800
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
/*
|
|
808
|
+
options.target - name of the target object
|
|
809
|
+
options.global - target is the global object
|
|
810
|
+
options.stat - export as static methods of target
|
|
811
|
+
options.proto - export as prototype methods of target
|
|
812
|
+
options.real - real prototype method for the `pure` version
|
|
813
|
+
options.forced - export even if the native feature is available
|
|
814
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
815
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
816
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
817
|
+
options.sham - add a flag to not completely full polyfills
|
|
818
|
+
options.enumerable - export as enumerable property
|
|
819
|
+
options.dontCallGetSet - prevent calling a getter on target
|
|
820
|
+
options.name - the .name of the function if it does not match the key
|
|
821
|
+
*/
|
|
822
|
+
var _export = function (options, source) {
|
|
823
|
+
var TARGET = options.target;
|
|
824
|
+
var GLOBAL = options.global;
|
|
825
|
+
var STATIC = options.stat;
|
|
826
|
+
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
827
|
+
if (GLOBAL) {
|
|
828
|
+
target = globalThis_1;
|
|
829
|
+
} else if (STATIC) {
|
|
830
|
+
target = globalThis_1[TARGET] || defineGlobalProperty(TARGET, {});
|
|
831
|
+
} else {
|
|
832
|
+
target = globalThis_1[TARGET] && globalThis_1[TARGET].prototype;
|
|
833
|
+
}
|
|
834
|
+
if (target) for (key in source) {
|
|
835
|
+
sourceProperty = source[key];
|
|
836
|
+
if (options.dontCallGetSet) {
|
|
837
|
+
descriptor = getOwnPropertyDescriptor(target, key);
|
|
838
|
+
targetProperty = descriptor && descriptor.value;
|
|
839
|
+
} else targetProperty = target[key];
|
|
840
|
+
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
841
|
+
// contained in target
|
|
842
|
+
if (!FORCED && targetProperty !== undefined) {
|
|
843
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
844
|
+
copyConstructorProperties(sourceProperty, targetProperty);
|
|
845
|
+
}
|
|
846
|
+
// add a flag to not completely full polyfills
|
|
847
|
+
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
848
|
+
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
849
|
+
}
|
|
850
|
+
defineBuiltIn(target, key, sourceProperty, options);
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
// `Object.keys` method
|
|
855
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
856
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
857
|
+
var objectKeys = Object.keys || function keys(O) {
|
|
858
|
+
return objectKeysInternal(O, enumBugKeys);
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
// `Object.defineProperties` method
|
|
862
|
+
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
863
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
864
|
+
var f = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
865
|
+
anObject(O);
|
|
866
|
+
var props = toIndexedObject(Properties);
|
|
867
|
+
var keys = objectKeys(Properties);
|
|
868
|
+
var length = keys.length;
|
|
869
|
+
var index = 0;
|
|
870
|
+
var key;
|
|
871
|
+
while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
|
|
872
|
+
return O;
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
var objectDefineProperties = {
|
|
876
|
+
f: f
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
var html = getBuiltIn('document', 'documentElement');
|
|
880
|
+
|
|
881
|
+
/* global ActiveXObject -- old IE, WSH */
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
var GT = '>';
|
|
891
|
+
var LT = '<';
|
|
892
|
+
var PROTOTYPE = 'prototype';
|
|
893
|
+
var SCRIPT = 'script';
|
|
894
|
+
var IE_PROTO = sharedKey('IE_PROTO');
|
|
895
|
+
|
|
896
|
+
var EmptyConstructor = function () { /* empty */ };
|
|
897
|
+
|
|
898
|
+
var scriptTag = function (content) {
|
|
899
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
903
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
904
|
+
activeXDocument.write(scriptTag(''));
|
|
905
|
+
activeXDocument.close();
|
|
906
|
+
var temp = activeXDocument.parentWindow.Object;
|
|
907
|
+
// eslint-disable-next-line no-useless-assignment -- avoid memory leak
|
|
908
|
+
activeXDocument = null;
|
|
909
|
+
return temp;
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
913
|
+
var NullProtoObjectViaIFrame = function () {
|
|
914
|
+
// Thrash, waste and sodomy: IE GC bug
|
|
915
|
+
var iframe = documentCreateElement('iframe');
|
|
916
|
+
var JS = 'java' + SCRIPT + ':';
|
|
917
|
+
var iframeDocument;
|
|
918
|
+
iframe.style.display = 'none';
|
|
919
|
+
html.appendChild(iframe);
|
|
920
|
+
// https://github.com/zloirock/core-js/issues/475
|
|
921
|
+
iframe.src = String(JS);
|
|
922
|
+
iframeDocument = iframe.contentWindow.document;
|
|
923
|
+
iframeDocument.open();
|
|
924
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
|
925
|
+
iframeDocument.close();
|
|
926
|
+
return iframeDocument.F;
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
// Check for document.domain and active x support
|
|
930
|
+
// No need to use active x approach when document.domain is not set
|
|
931
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
|
932
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
933
|
+
// avoid IE GC bug
|
|
934
|
+
var activeXDocument;
|
|
935
|
+
var NullProtoObject = function () {
|
|
936
|
+
try {
|
|
937
|
+
activeXDocument = new ActiveXObject('htmlfile');
|
|
938
|
+
} catch (error) { /* ignore */ }
|
|
939
|
+
NullProtoObject = typeof document != 'undefined'
|
|
940
|
+
? document.domain && activeXDocument
|
|
941
|
+
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
942
|
+
: NullProtoObjectViaIFrame()
|
|
943
|
+
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
944
|
+
var length = enumBugKeys.length;
|
|
945
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
946
|
+
return NullProtoObject();
|
|
947
|
+
};
|
|
948
|
+
|
|
949
|
+
hiddenKeys$1[IE_PROTO] = true;
|
|
950
|
+
|
|
951
|
+
// `Object.create` method
|
|
952
|
+
// https://tc39.es/ecma262/#sec-object.create
|
|
953
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
954
|
+
var objectCreate = Object.create || function create(O, Properties) {
|
|
955
|
+
var result;
|
|
956
|
+
if (O !== null) {
|
|
957
|
+
EmptyConstructor[PROTOTYPE] = anObject(O);
|
|
958
|
+
result = new EmptyConstructor();
|
|
959
|
+
EmptyConstructor[PROTOTYPE] = null;
|
|
960
|
+
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
961
|
+
result[IE_PROTO] = O;
|
|
962
|
+
} else result = NullProtoObject();
|
|
963
|
+
return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
|
|
964
|
+
};
|
|
965
|
+
|
|
966
|
+
var defineProperty = objectDefineProperty.f;
|
|
967
|
+
|
|
968
|
+
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
969
|
+
var ArrayPrototype = Array.prototype;
|
|
970
|
+
|
|
971
|
+
// Array.prototype[@@unscopables]
|
|
972
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
973
|
+
if (ArrayPrototype[UNSCOPABLES] === undefined) {
|
|
974
|
+
defineProperty(ArrayPrototype, UNSCOPABLES, {
|
|
975
|
+
configurable: true,
|
|
976
|
+
value: objectCreate(null)
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
// add a key to Array.prototype[@@unscopables]
|
|
981
|
+
var addToUnscopables = function (key) {
|
|
982
|
+
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
983
|
+
};
|
|
984
|
+
|
|
985
|
+
var $includes = arrayIncludes.includes;
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
// FF99+ bug
|
|
990
|
+
var BROKEN_ON_SPARSE = fails(function () {
|
|
991
|
+
// eslint-disable-next-line es/no-array-prototype-includes -- detection
|
|
992
|
+
return !Array(1).includes();
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
// Safari 26.4- bug
|
|
996
|
+
var BROKEN_ON_SPARSE_WITH_FROM_INDEX = fails(function () {
|
|
997
|
+
// eslint-disable-next-line no-sparse-arrays, es/no-array-prototype-includes -- detection
|
|
998
|
+
return [, 1].includes(undefined, 1);
|
|
999
|
+
});
|
|
1000
|
+
|
|
1001
|
+
// `Array.prototype.includes` method
|
|
1002
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
1003
|
+
_export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
|
|
1004
|
+
includes: function includes(el /* , fromIndex = 0 */) {
|
|
1005
|
+
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
1006
|
+
}
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1009
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1010
|
+
addToUnscopables('includes');
|
|
1011
|
+
|
|
1
1012
|
/**
|
|
2
1013
|
* Create a bound version of a function with a specified `this` context
|
|
3
1014
|
*
|
|
@@ -266,16 +1277,16 @@ const G = getGlobal();
|
|
|
266
1277
|
const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
|
|
267
1278
|
|
|
268
1279
|
const isFormData = (thing) => {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
1280
|
+
if (!thing) return false;
|
|
1281
|
+
if (FormDataCtor && thing instanceof FormDataCtor) return true;
|
|
1282
|
+
// Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
|
|
1283
|
+
const proto = getPrototypeOf(thing);
|
|
1284
|
+
if (!proto || proto === Object.prototype) return false;
|
|
1285
|
+
if (!isFunction$1(thing.append)) return false;
|
|
1286
|
+
const kind = kindOf(thing);
|
|
1287
|
+
return kind === 'formdata' ||
|
|
1288
|
+
// detect form-data instance
|
|
1289
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
|
|
279
1290
|
};
|
|
280
1291
|
|
|
281
1292
|
/**
|
|
@@ -942,40 +1953,40 @@ class AxiosError extends Error {
|
|
|
942
1953
|
return axiosError;
|
|
943
1954
|
}
|
|
944
1955
|
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
1958
|
+
*
|
|
1959
|
+
* @param {string} message The error message.
|
|
1960
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
1961
|
+
* @param {Object} [config] The config.
|
|
1962
|
+
* @param {Object} [request] The request.
|
|
1963
|
+
* @param {Object} [response] The response.
|
|
1964
|
+
*
|
|
1965
|
+
* @returns {Error} The created error.
|
|
1966
|
+
*/
|
|
1967
|
+
constructor(message, code, config, request, response) {
|
|
1968
|
+
super(message);
|
|
1969
|
+
|
|
1970
|
+
// Make message enumerable to maintain backward compatibility
|
|
1971
|
+
// The native Error constructor sets message as non-enumerable,
|
|
1972
|
+
// but axios < v1.13.3 had it as enumerable
|
|
1973
|
+
Object.defineProperty(this, 'message', {
|
|
1974
|
+
value: message,
|
|
1975
|
+
enumerable: true,
|
|
1976
|
+
writable: true,
|
|
1977
|
+
configurable: true,
|
|
1978
|
+
});
|
|
1979
|
+
|
|
1980
|
+
this.name = 'AxiosError';
|
|
1981
|
+
this.isAxiosError = true;
|
|
1982
|
+
code && (this.code = code);
|
|
1983
|
+
config && (this.config = config);
|
|
1984
|
+
request && (this.request = request);
|
|
1985
|
+
if (response) {
|
|
1986
|
+
this.response = response;
|
|
1987
|
+
this.status = response.status;
|
|
978
1988
|
}
|
|
1989
|
+
}
|
|
979
1990
|
|
|
980
1991
|
toJSON() {
|
|
981
1992
|
return {
|
|
@@ -1011,6 +2022,7 @@ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
|
1011
2022
|
AxiosError.ERR_CANCELED = 'ERR_CANCELED';
|
|
1012
2023
|
AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
1013
2024
|
AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
2025
|
+
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
|
1014
2026
|
|
|
1015
2027
|
var AxiosError$1 = AxiosError;
|
|
1016
2028
|
|
|
@@ -1127,6 +2139,7 @@ function toFormData(obj, formData, options) {
|
|
|
1127
2139
|
const dots = options.dots;
|
|
1128
2140
|
const indexes = options.indexes;
|
|
1129
2141
|
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
2142
|
+
const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
|
|
1130
2143
|
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
1131
2144
|
|
|
1132
2145
|
if (!utils$1.isFunction(visitor)) {
|
|
@@ -1219,9 +2232,16 @@ function toFormData(obj, formData, options) {
|
|
|
1219
2232
|
isVisitable,
|
|
1220
2233
|
});
|
|
1221
2234
|
|
|
1222
|
-
function build(value, path) {
|
|
2235
|
+
function build(value, path, depth = 0) {
|
|
1223
2236
|
if (utils$1.isUndefined(value)) return;
|
|
1224
2237
|
|
|
2238
|
+
if (depth > maxDepth) {
|
|
2239
|
+
throw new AxiosError$1(
|
|
2240
|
+
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
2241
|
+
AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
2242
|
+
);
|
|
2243
|
+
}
|
|
2244
|
+
|
|
1225
2245
|
if (stack.indexOf(value) !== -1) {
|
|
1226
2246
|
throw Error('Circular reference detected in ' + path.join('.'));
|
|
1227
2247
|
}
|
|
@@ -1234,7 +2254,7 @@ function toFormData(obj, formData, options) {
|
|
|
1234
2254
|
visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
1235
2255
|
|
|
1236
2256
|
if (result === true) {
|
|
1237
|
-
build(el, path ? path.concat(key) : [key]);
|
|
2257
|
+
build(el, path ? path.concat(key) : [key], depth + 1);
|
|
1238
2258
|
}
|
|
1239
2259
|
});
|
|
1240
2260
|
|
|
@@ -1266,9 +2286,8 @@ function encode$1(str) {
|
|
|
1266
2286
|
')': '%29',
|
|
1267
2287
|
'~': '%7E',
|
|
1268
2288
|
'%20': '+',
|
|
1269
|
-
'%00': '\x00',
|
|
1270
2289
|
};
|
|
1271
|
-
return encodeURIComponent(str).replace(/[!'()~]|%20
|
|
2290
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
|
|
1272
2291
|
return charMap[match];
|
|
1273
2292
|
});
|
|
1274
2293
|
}
|
|
@@ -1308,8 +2327,8 @@ prototype.toString = function toString(encoder) {
|
|
|
1308
2327
|
};
|
|
1309
2328
|
|
|
1310
2329
|
/**
|
|
1311
|
-
* It replaces
|
|
1312
|
-
*
|
|
2330
|
+
* It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
|
|
2331
|
+
* their plain counterparts (`:`, `$`, `,`, `+`).
|
|
1313
2332
|
*
|
|
1314
2333
|
* @param {string} val The value to be encoded.
|
|
1315
2334
|
*
|
|
@@ -1507,12 +2526,12 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
1507
2526
|
const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
|
|
1508
2527
|
|
|
1509
2528
|
var utils = /*#__PURE__*/Object.freeze({
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
2529
|
+
__proto__: null,
|
|
2530
|
+
hasBrowserEnv: hasBrowserEnv,
|
|
2531
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
2532
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
2533
|
+
navigator: _navigator,
|
|
2534
|
+
origin: origin
|
|
1516
2535
|
});
|
|
1517
2536
|
|
|
1518
2537
|
var platform = {
|
|
@@ -1590,7 +2609,9 @@ function formDataToJSON(formData) {
|
|
|
1590
2609
|
|
|
1591
2610
|
if (isLast) {
|
|
1592
2611
|
if (utils$1.hasOwnProp(target, name)) {
|
|
1593
|
-
target[name] =
|
|
2612
|
+
target[name] = utils$1.isArray(target[name])
|
|
2613
|
+
? target[name].concat(value)
|
|
2614
|
+
: [target[name], value];
|
|
1594
2615
|
} else {
|
|
1595
2616
|
target[name] = value;
|
|
1596
2617
|
}
|
|
@@ -1624,6 +2645,8 @@ function formDataToJSON(formData) {
|
|
|
1624
2645
|
return null;
|
|
1625
2646
|
}
|
|
1626
2647
|
|
|
2648
|
+
const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
|
|
2649
|
+
|
|
1627
2650
|
/**
|
|
1628
2651
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
1629
2652
|
* of the input
|
|
@@ -1691,20 +2714,22 @@ const defaults = {
|
|
|
1691
2714
|
let isFileList;
|
|
1692
2715
|
|
|
1693
2716
|
if (isObjectPayload) {
|
|
2717
|
+
const formSerializer = own(this, 'formSerializer');
|
|
1694
2718
|
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
1695
|
-
return toURLEncodedForm(data,
|
|
2719
|
+
return toURLEncodedForm(data, formSerializer).toString();
|
|
1696
2720
|
}
|
|
1697
2721
|
|
|
1698
2722
|
if (
|
|
1699
2723
|
(isFileList = utils$1.isFileList(data)) ||
|
|
1700
2724
|
contentType.indexOf('multipart/form-data') > -1
|
|
1701
2725
|
) {
|
|
1702
|
-
const
|
|
2726
|
+
const env = own(this, 'env');
|
|
2727
|
+
const _FormData = env && env.FormData;
|
|
1703
2728
|
|
|
1704
2729
|
return toFormData(
|
|
1705
2730
|
isFileList ? { 'files[]': data } : data,
|
|
1706
2731
|
_FormData && new _FormData(),
|
|
1707
|
-
|
|
2732
|
+
formSerializer
|
|
1708
2733
|
);
|
|
1709
2734
|
}
|
|
1710
2735
|
}
|
|
@@ -1720,9 +2745,10 @@ const defaults = {
|
|
|
1720
2745
|
|
|
1721
2746
|
transformResponse: [
|
|
1722
2747
|
function transformResponse(data) {
|
|
1723
|
-
const transitional = this
|
|
2748
|
+
const transitional = own(this, 'transitional') || defaults.transitional;
|
|
1724
2749
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
1725
|
-
const
|
|
2750
|
+
const responseType = own(this, 'responseType');
|
|
2751
|
+
const JSONRequested = responseType === 'json';
|
|
1726
2752
|
|
|
1727
2753
|
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
1728
2754
|
return data;
|
|
@@ -1731,17 +2757,17 @@ const defaults = {
|
|
|
1731
2757
|
if (
|
|
1732
2758
|
data &&
|
|
1733
2759
|
utils$1.isString(data) &&
|
|
1734
|
-
((forcedJSONParsing && !
|
|
2760
|
+
((forcedJSONParsing && !responseType) || JSONRequested)
|
|
1735
2761
|
) {
|
|
1736
2762
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
1737
2763
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
1738
2764
|
|
|
1739
2765
|
try {
|
|
1740
|
-
return JSON.parse(data, this
|
|
2766
|
+
return JSON.parse(data, own(this, 'parseReviver'));
|
|
1741
2767
|
} catch (e) {
|
|
1742
2768
|
if (strictJSONParsing) {
|
|
1743
2769
|
if (e.name === 'SyntaxError') {
|
|
1744
|
-
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this
|
|
2770
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
|
|
1745
2771
|
}
|
|
1746
2772
|
throw e;
|
|
1747
2773
|
}
|
|
@@ -1855,16 +2881,49 @@ var parseHeaders = (rawHeaders) => {
|
|
|
1855
2881
|
|
|
1856
2882
|
const $internals = Symbol('internals');
|
|
1857
2883
|
|
|
2884
|
+
const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
|
|
2885
|
+
|
|
2886
|
+
function trimSPorHTAB(str) {
|
|
2887
|
+
let start = 0;
|
|
2888
|
+
let end = str.length;
|
|
2889
|
+
|
|
2890
|
+
while (start < end) {
|
|
2891
|
+
const code = str.charCodeAt(start);
|
|
2892
|
+
|
|
2893
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
2894
|
+
break;
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2897
|
+
start += 1;
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
while (end > start) {
|
|
2901
|
+
const code = str.charCodeAt(end - 1);
|
|
2902
|
+
|
|
2903
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
2904
|
+
break;
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
end -= 1;
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
2911
|
+
}
|
|
2912
|
+
|
|
1858
2913
|
function normalizeHeader(header) {
|
|
1859
2914
|
return header && String(header).trim().toLowerCase();
|
|
1860
2915
|
}
|
|
1861
2916
|
|
|
2917
|
+
function sanitizeHeaderValue(str) {
|
|
2918
|
+
return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
|
|
2919
|
+
}
|
|
2920
|
+
|
|
1862
2921
|
function normalizeValue(value) {
|
|
1863
2922
|
if (value === false || value == null) {
|
|
1864
2923
|
return value;
|
|
1865
2924
|
}
|
|
1866
2925
|
|
|
1867
|
-
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
2926
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
|
|
1868
2927
|
}
|
|
1869
2928
|
|
|
1870
2929
|
function parseTokens(str) {
|
|
@@ -2372,13 +3431,13 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
2372
3431
|
const _speedometer = speedometer(50, 250);
|
|
2373
3432
|
|
|
2374
3433
|
return throttle((e) => {
|
|
2375
|
-
const
|
|
3434
|
+
const rawLoaded = e.loaded;
|
|
2376
3435
|
const total = e.lengthComputable ? e.total : undefined;
|
|
2377
|
-
const
|
|
3436
|
+
const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
|
|
3437
|
+
const progressBytes = Math.max(0, loaded - bytesNotified);
|
|
2378
3438
|
const rate = _speedometer(progressBytes);
|
|
2379
|
-
const inRange = loaded <= total;
|
|
2380
3439
|
|
|
2381
|
-
bytesNotified = loaded;
|
|
3440
|
+
bytesNotified = Math.max(bytesNotified, loaded);
|
|
2382
3441
|
|
|
2383
3442
|
const data = {
|
|
2384
3443
|
loaded,
|
|
@@ -2386,7 +3445,7 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
2386
3445
|
progress: total ? loaded / total : undefined,
|
|
2387
3446
|
bytes: progressBytes,
|
|
2388
3447
|
rate: rate ? rate : undefined,
|
|
2389
|
-
estimated: rate && total
|
|
3448
|
+
estimated: rate && total ? (total - loaded) / rate : undefined,
|
|
2390
3449
|
event: e,
|
|
2391
3450
|
lengthComputable: total != null,
|
|
2392
3451
|
[isDownloadStream ? 'download' : 'upload']: true,
|
|
@@ -2520,7 +3579,7 @@ function combineURLs(baseURL, relativeURL) {
|
|
|
2520
3579
|
*/
|
|
2521
3580
|
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
2522
3581
|
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
2523
|
-
if (baseURL && (isRelativeUrl || allowAbsoluteUrls
|
|
3582
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
|
|
2524
3583
|
return combineURLs(baseURL, requestedURL);
|
|
2525
3584
|
}
|
|
2526
3585
|
return requestedURL;
|
|
@@ -2540,7 +3599,18 @@ const headersToObject = (thing) => (thing instanceof AxiosHeaders$1 ? { ...thing
|
|
|
2540
3599
|
function mergeConfig(config1, config2) {
|
|
2541
3600
|
// eslint-disable-next-line no-param-reassign
|
|
2542
3601
|
config2 = config2 || {};
|
|
2543
|
-
|
|
3602
|
+
|
|
3603
|
+
// Use a null-prototype object so that downstream reads such as `config.auth`
|
|
3604
|
+
// or `config.baseURL` cannot inherit polluted values from Object.prototype
|
|
3605
|
+
// (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
|
|
3606
|
+
// own slot to preserve ergonomics for user code that relies on it.
|
|
3607
|
+
const config = Object.create(null);
|
|
3608
|
+
Object.defineProperty(config, 'hasOwnProperty', {
|
|
3609
|
+
value: Object.prototype.hasOwnProperty,
|
|
3610
|
+
enumerable: false,
|
|
3611
|
+
writable: true,
|
|
3612
|
+
configurable: true,
|
|
3613
|
+
});
|
|
2544
3614
|
|
|
2545
3615
|
function getMergedValue(target, source, prop, caseless) {
|
|
2546
3616
|
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
@@ -2579,9 +3649,9 @@ function mergeConfig(config1, config2) {
|
|
|
2579
3649
|
|
|
2580
3650
|
// eslint-disable-next-line consistent-return
|
|
2581
3651
|
function mergeDirectKeys(a, b, prop) {
|
|
2582
|
-
if (prop
|
|
3652
|
+
if (utils$1.hasOwnProp(config2, prop)) {
|
|
2583
3653
|
return getMergedValue(a, b);
|
|
2584
|
-
} else if (prop
|
|
3654
|
+
} else if (utils$1.hasOwnProp(config1, prop)) {
|
|
2585
3655
|
return getMergedValue(undefined, a);
|
|
2586
3656
|
}
|
|
2587
3657
|
}
|
|
@@ -2613,6 +3683,7 @@ function mergeConfig(config1, config2) {
|
|
|
2613
3683
|
httpsAgent: defaultToConfig2,
|
|
2614
3684
|
cancelToken: defaultToConfig2,
|
|
2615
3685
|
socketPath: defaultToConfig2,
|
|
3686
|
+
allowedSocketPaths: defaultToConfig2,
|
|
2616
3687
|
responseEncoding: defaultToConfig2,
|
|
2617
3688
|
validateStatus: mergeDirectKeys,
|
|
2618
3689
|
headers: (a, b, prop) =>
|
|
@@ -2622,7 +3693,9 @@ function mergeConfig(config1, config2) {
|
|
|
2622
3693
|
utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
2623
3694
|
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
2624
3695
|
const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
2625
|
-
const
|
|
3696
|
+
const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
|
|
3697
|
+
const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
|
|
3698
|
+
const configValue = merge(a, b, prop);
|
|
2626
3699
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
2627
3700
|
});
|
|
2628
3701
|
|
|
@@ -2632,12 +3705,24 @@ function mergeConfig(config1, config2) {
|
|
|
2632
3705
|
var resolveConfig = (config) => {
|
|
2633
3706
|
const newConfig = mergeConfig({}, config);
|
|
2634
3707
|
|
|
2635
|
-
|
|
3708
|
+
// Read only own properties to prevent prototype pollution gadgets
|
|
3709
|
+
// (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
|
|
3710
|
+
const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
|
|
3711
|
+
|
|
3712
|
+
const data = own('data');
|
|
3713
|
+
let withXSRFToken = own('withXSRFToken');
|
|
3714
|
+
const xsrfHeaderName = own('xsrfHeaderName');
|
|
3715
|
+
const xsrfCookieName = own('xsrfCookieName');
|
|
3716
|
+
let headers = own('headers');
|
|
3717
|
+
const auth = own('auth');
|
|
3718
|
+
const baseURL = own('baseURL');
|
|
3719
|
+
const allowAbsoluteUrls = own('allowAbsoluteUrls');
|
|
3720
|
+
const url = own('url');
|
|
2636
3721
|
|
|
2637
3722
|
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
2638
3723
|
|
|
2639
3724
|
newConfig.url = buildURL(
|
|
2640
|
-
buildFullPath(
|
|
3725
|
+
buildFullPath(baseURL, url, allowAbsoluteUrls),
|
|
2641
3726
|
config.params,
|
|
2642
3727
|
config.paramsSerializer
|
|
2643
3728
|
);
|
|
@@ -2676,10 +3761,18 @@ var resolveConfig = (config) => {
|
|
|
2676
3761
|
// Specifically not if we're in a web worker, or react-native.
|
|
2677
3762
|
|
|
2678
3763
|
if (platform.hasStandardBrowserEnv) {
|
|
2679
|
-
|
|
3764
|
+
if (utils$1.isFunction(withXSRFToken)) {
|
|
3765
|
+
withXSRFToken = withXSRFToken(newConfig);
|
|
3766
|
+
}
|
|
2680
3767
|
|
|
2681
|
-
|
|
2682
|
-
|
|
3768
|
+
// Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
|
|
3769
|
+
// and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
|
|
3770
|
+
// the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
|
|
3771
|
+
const shouldSendXSRF =
|
|
3772
|
+
withXSRFToken === true ||
|
|
3773
|
+
(withXSRFToken == null && isURLSameOrigin(newConfig.url));
|
|
3774
|
+
|
|
3775
|
+
if (shouldSendXSRF) {
|
|
2683
3776
|
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
2684
3777
|
|
|
2685
3778
|
if (xsrfValue) {
|
|
@@ -3100,14 +4193,20 @@ const factory = (env) => {
|
|
|
3100
4193
|
test(() => {
|
|
3101
4194
|
let duplexAccessed = false;
|
|
3102
4195
|
|
|
3103
|
-
const
|
|
4196
|
+
const request = new Request(platform.origin, {
|
|
3104
4197
|
body: new ReadableStream$1(),
|
|
3105
4198
|
method: 'POST',
|
|
3106
4199
|
get duplex() {
|
|
3107
4200
|
duplexAccessed = true;
|
|
3108
4201
|
return 'half';
|
|
3109
4202
|
},
|
|
3110
|
-
})
|
|
4203
|
+
});
|
|
4204
|
+
|
|
4205
|
+
const hasContentType = request.headers.has('Content-Type');
|
|
4206
|
+
|
|
4207
|
+
if (request.body != null) {
|
|
4208
|
+
request.body.cancel();
|
|
4209
|
+
}
|
|
3111
4210
|
|
|
3112
4211
|
return duplexAccessed && !hasContentType;
|
|
3113
4212
|
});
|
|
@@ -3251,6 +4350,19 @@ const factory = (env) => {
|
|
|
3251
4350
|
// see https://github.com/cloudflare/workerd/issues/902
|
|
3252
4351
|
const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
|
|
3253
4352
|
|
|
4353
|
+
// If data is FormData and Content-Type is multipart/form-data without boundary,
|
|
4354
|
+
// delete it so fetch can set it correctly with the boundary
|
|
4355
|
+
if (utils$1.isFormData(data)) {
|
|
4356
|
+
const contentType = headers.getContentType();
|
|
4357
|
+
if (
|
|
4358
|
+
contentType &&
|
|
4359
|
+
/^multipart\/form-data/i.test(contentType) &&
|
|
4360
|
+
!/boundary=/i.test(contentType)
|
|
4361
|
+
) {
|
|
4362
|
+
headers.delete('content-type');
|
|
4363
|
+
}
|
|
4364
|
+
}
|
|
4365
|
+
|
|
3254
4366
|
const resolvedOptions = {
|
|
3255
4367
|
...fetchOptions,
|
|
3256
4368
|
signal: composedSignal,
|
|
@@ -3559,7 +4671,7 @@ function dispatchRequest(config) {
|
|
|
3559
4671
|
);
|
|
3560
4672
|
}
|
|
3561
4673
|
|
|
3562
|
-
const VERSION = "1.
|
|
4674
|
+
const VERSION = "1.15.2";
|
|
3563
4675
|
|
|
3564
4676
|
const validators$1 = {};
|
|
3565
4677
|
|
|
@@ -3644,7 +4756,9 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
3644
4756
|
let i = keys.length;
|
|
3645
4757
|
while (i-- > 0) {
|
|
3646
4758
|
const opt = keys[i];
|
|
3647
|
-
|
|
4759
|
+
// Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
|
|
4760
|
+
// a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
|
|
4761
|
+
const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
|
|
3648
4762
|
if (validator) {
|
|
3649
4763
|
const value = options[opt];
|
|
3650
4764
|
const result = value === undefined || validator(value, opt, options);
|
|
@@ -3703,13 +4817,29 @@ class Axios {
|
|
|
3703
4817
|
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
|
3704
4818
|
|
|
3705
4819
|
// slice off the Error: ... line
|
|
3706
|
-
const stack =
|
|
4820
|
+
const stack = (() => {
|
|
4821
|
+
if (!dummy.stack) {
|
|
4822
|
+
return '';
|
|
4823
|
+
}
|
|
4824
|
+
|
|
4825
|
+
const firstNewlineIndex = dummy.stack.indexOf('\n');
|
|
4826
|
+
|
|
4827
|
+
return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
|
|
4828
|
+
})();
|
|
3707
4829
|
try {
|
|
3708
4830
|
if (!err.stack) {
|
|
3709
4831
|
err.stack = stack;
|
|
3710
4832
|
// match without the 2 top stack lines
|
|
3711
|
-
} else if (stack
|
|
3712
|
-
|
|
4833
|
+
} else if (stack) {
|
|
4834
|
+
const firstNewlineIndex = stack.indexOf('\n');
|
|
4835
|
+
const secondNewlineIndex =
|
|
4836
|
+
firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
|
|
4837
|
+
const stackWithoutTwoTopLines =
|
|
4838
|
+
secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
|
|
4839
|
+
|
|
4840
|
+
if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
|
|
4841
|
+
err.stack += '\n' + stack;
|
|
4842
|
+
}
|
|
3713
4843
|
}
|
|
3714
4844
|
} catch (e) {
|
|
3715
4845
|
// ignore the case where "stack" is an un-writable property
|
|
@@ -3891,8 +5021,6 @@ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa
|
|
|
3891
5021
|
});
|
|
3892
5022
|
|
|
3893
5023
|
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
3894
|
-
/*eslint func-names:0*/
|
|
3895
|
-
|
|
3896
5024
|
function generateHTTPMethod(isForm) {
|
|
3897
5025
|
return function httpMethod(url, data, config) {
|
|
3898
5026
|
return this.request(
|
|
@@ -4236,7 +5364,7 @@ axios.default = axios;
|
|
|
4236
5364
|
var axios$1 = axios;
|
|
4237
5365
|
|
|
4238
5366
|
var name$1 = "@tryghost/content-api";
|
|
4239
|
-
var version = "1.12.
|
|
5367
|
+
var version = "1.12.7";
|
|
4240
5368
|
var repository = {
|
|
4241
5369
|
type: "git",
|
|
4242
5370
|
url: "git+https://github.com/TryGhost/SDK.git",
|
|
@@ -4271,13 +5399,13 @@ var publishConfig = {
|
|
|
4271
5399
|
var devDependencies = {
|
|
4272
5400
|
"@babel/core": "7.29.0",
|
|
4273
5401
|
"@babel/polyfill": "7.12.1",
|
|
4274
|
-
"@babel/preset-env": "7.29.
|
|
4275
|
-
"@rollup/plugin-babel": "
|
|
5402
|
+
"@babel/preset-env": "7.29.2",
|
|
5403
|
+
"@rollup/plugin-babel": "7.0.0",
|
|
4276
5404
|
"@rollup/plugin-json": "6.1.0",
|
|
4277
5405
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
4278
|
-
"@rollup/plugin-terser": "0.
|
|
5406
|
+
"@rollup/plugin-terser": "1.0.0",
|
|
4279
5407
|
c8: "11.0.0",
|
|
4280
|
-
"core-js": "3.
|
|
5408
|
+
"core-js": "3.49.0",
|
|
4281
5409
|
"eslint-plugin-ghost": "3.5.0",
|
|
4282
5410
|
mocha: "11.7.5",
|
|
4283
5411
|
rollup: "2.80.0",
|
|
@@ -4285,12 +5413,12 @@ var devDependencies = {
|
|
|
4285
5413
|
"rollup-plugin-polyfill-node": "0.13.0",
|
|
4286
5414
|
"rollup-plugin-replace": "2.2.0",
|
|
4287
5415
|
should: "13.2.3",
|
|
4288
|
-
sinon: "21.
|
|
5416
|
+
sinon: "21.1.2"
|
|
4289
5417
|
};
|
|
4290
5418
|
var dependencies = {
|
|
4291
|
-
axios: "1.
|
|
5419
|
+
axios: "1.15.2"
|
|
4292
5420
|
};
|
|
4293
|
-
var gitHead = "
|
|
5421
|
+
var gitHead = "d3a36d061599ea90a30b19964e6fd76c038ff226";
|
|
4294
5422
|
var packageInfo = {
|
|
4295
5423
|
name: name$1,
|
|
4296
5424
|
version: version,
|