@tryghost/content-api 1.11.6 → 1.11.8

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
@@ -1,996 +1,3214 @@
1
- var bind = function bind(fn, thisArg) {
2
- return function wrap() {
3
- var args = new Array(arguments.length);
4
- for (var i = 0; i < args.length; i++) {
5
- args[i] = arguments[i];
6
- }
7
- return fn.apply(thisArg, args);
8
- };
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
9
  };
10
10
 
11
- // utils is a library of generic helper functions non-specific to axios
11
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
12
+ var global_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
+ // eslint-disable-next-line no-new-func -- fallback
20
+ (function () { return this; })() || Function('return this')();
21
+
22
+ var fails = function (exec) {
23
+ try {
24
+ return !!exec();
25
+ } catch (error) {
26
+ return true;
27
+ }
28
+ };
12
29
 
13
- var toString = Object.prototype.toString;
30
+ // Detect IE8's incomplete defineProperty implementation
31
+ var descriptors$1 = !fails(function () {
32
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
33
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
34
+ });
14
35
 
15
- // eslint-disable-next-line func-names
16
- var kindOf = (function(cache) {
17
- // eslint-disable-next-line func-names
18
- return function(thing) {
19
- var str = toString.call(thing);
20
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
36
+ var functionBindNative = !fails(function () {
37
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
38
+ var test = (function () { /* empty */ }).bind();
39
+ // eslint-disable-next-line no-prototype-builtins -- safe
40
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
41
+ });
42
+
43
+ var call$1 = Function.prototype.call;
44
+
45
+ var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
46
+ return call$1.apply(call$1, arguments);
47
+ };
48
+
49
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
50
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
51
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
52
+
53
+ // Nashorn ~ JDK8 bug
54
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
55
+
56
+ // `Object.prototype.propertyIsEnumerable` method implementation
57
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
58
+ var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
59
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
60
+ return !!descriptor && descriptor.enumerable;
61
+ } : $propertyIsEnumerable;
62
+
63
+ var objectPropertyIsEnumerable = {
64
+ f: f$5
65
+ };
66
+
67
+ var createPropertyDescriptor = function (bitmap, value) {
68
+ return {
69
+ enumerable: !(bitmap & 1),
70
+ configurable: !(bitmap & 2),
71
+ writable: !(bitmap & 4),
72
+ value: value
21
73
  };
22
- })(Object.create(null));
74
+ };
23
75
 
24
- function kindOfTest(type) {
25
- type = type.toLowerCase();
26
- return function isKindOf(thing) {
27
- return kindOf(thing) === type;
76
+ var FunctionPrototype$1 = Function.prototype;
77
+ var call = FunctionPrototype$1.call;
78
+ var uncurryThisWithBind = functionBindNative && FunctionPrototype$1.bind.bind(call, call);
79
+
80
+ var functionUncurryThisRaw = functionBindNative ? uncurryThisWithBind : function (fn) {
81
+ return function () {
82
+ return call.apply(fn, arguments);
28
83
  };
29
- }
84
+ };
30
85
 
31
- /**
32
- * Determine if a value is an Array
33
- *
34
- * @param {Object} val The value to test
35
- * @returns {boolean} True if value is an Array, otherwise false
36
- */
37
- function isArray(val) {
38
- return Array.isArray(val);
39
- }
86
+ var toString$2 = functionUncurryThisRaw({}.toString);
87
+ var stringSlice = functionUncurryThisRaw(''.slice);
40
88
 
41
- /**
42
- * Determine if a value is undefined
43
- *
44
- * @param {Object} val The value to test
45
- * @returns {boolean} True if the value is undefined, otherwise false
46
- */
47
- function isUndefined(val) {
48
- return typeof val === 'undefined';
49
- }
89
+ var classofRaw = function (it) {
90
+ return stringSlice(toString$2(it), 8, -1);
91
+ };
50
92
 
51
- /**
52
- * Determine if a value is a Buffer
53
- *
54
- * @param {Object} val The value to test
55
- * @returns {boolean} True if value is a Buffer, otherwise false
56
- */
57
- function isBuffer(val) {
58
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
59
- && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
60
- }
93
+ var functionUncurryThis = function (fn) {
94
+ // Nashorn bug:
95
+ // https://github.com/zloirock/core-js/issues/1128
96
+ // https://github.com/zloirock/core-js/issues/1130
97
+ if (classofRaw(fn) === 'Function') return functionUncurryThisRaw(fn);
98
+ };
61
99
 
62
- /**
63
- * Determine if a value is an ArrayBuffer
64
- *
65
- * @function
66
- * @param {Object} val The value to test
67
- * @returns {boolean} True if value is an ArrayBuffer, otherwise false
68
- */
69
- var isArrayBuffer = kindOfTest('ArrayBuffer');
100
+ var $Object$2 = Object;
101
+ var split = functionUncurryThis(''.split);
102
+
103
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
104
+ var indexedObject = fails(function () {
105
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
106
+ // eslint-disable-next-line no-prototype-builtins -- safe
107
+ return !$Object$2('z').propertyIsEnumerable(0);
108
+ }) ? function (it) {
109
+ return classofRaw(it) == 'String' ? split(it, '') : $Object$2(it);
110
+ } : $Object$2;
111
+
112
+ // we can't use just `it == null` since of `document.all` special case
113
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
114
+ var isNullOrUndefined$1 = function (it) {
115
+ return it === null || it === undefined;
116
+ };
70
117
 
118
+ var $TypeError$5 = TypeError;
71
119
 
72
- /**
73
- * Determine if a value is a view on an ArrayBuffer
74
- *
75
- * @param {Object} val The value to test
76
- * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
77
- */
78
- function isArrayBufferView(val) {
79
- var result;
80
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
81
- result = ArrayBuffer.isView(val);
82
- } else {
83
- result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
84
- }
85
- return result;
86
- }
120
+ // `RequireObjectCoercible` abstract operation
121
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
122
+ var requireObjectCoercible = function (it) {
123
+ if (isNullOrUndefined$1(it)) throw $TypeError$5("Can't call method on " + it);
124
+ return it;
125
+ };
87
126
 
88
- /**
89
- * Determine if a value is a String
90
- *
91
- * @param {Object} val The value to test
92
- * @returns {boolean} True if value is a String, otherwise false
93
- */
94
- function isString(val) {
95
- return typeof val === 'string';
96
- }
127
+ // toObject with fallback for non-array-like ES3 strings
97
128
 
98
- /**
99
- * Determine if a value is a Number
100
- *
101
- * @param {Object} val The value to test
102
- * @returns {boolean} True if value is a Number, otherwise false
103
- */
104
- function isNumber(val) {
105
- return typeof val === 'number';
106
- }
107
129
 
108
- /**
109
- * Determine if a value is an Object
110
- *
111
- * @param {Object} val The value to test
112
- * @returns {boolean} True if value is an Object, otherwise false
113
- */
114
- function isObject(val) {
115
- return val !== null && typeof val === 'object';
116
- }
117
130
 
118
- /**
119
- * Determine if a value is a plain Object
120
- *
121
- * @param {Object} val The value to test
122
- * @return {boolean} True if value is a plain Object, otherwise false
123
- */
124
- function isPlainObject(val) {
125
- if (kindOf(val) !== 'object') {
126
- return false;
127
- }
131
+ var toIndexedObject = function (it) {
132
+ return indexedObject(requireObjectCoercible(it));
133
+ };
128
134
 
129
- var prototype = Object.getPrototypeOf(val);
130
- return prototype === null || prototype === Object.prototype;
131
- }
135
+ var documentAll$2 = typeof document == 'object' && document.all;
132
136
 
133
- /**
134
- * Determine if a value is a Date
135
- *
136
- * @function
137
- * @param {Object} val The value to test
138
- * @returns {boolean} True if value is a Date, otherwise false
139
- */
140
- var isDate = kindOfTest('Date');
137
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
138
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
141
139
 
142
- /**
143
- * Determine if a value is a File
144
- *
145
- * @function
146
- * @param {Object} val The value to test
147
- * @returns {boolean} True if value is a File, otherwise false
148
- */
149
- var isFile = kindOfTest('File');
140
+ var documentAll_1 = {
141
+ all: documentAll$2,
142
+ IS_HTMLDDA: IS_HTMLDDA
143
+ };
150
144
 
151
- /**
152
- * Determine if a value is a Blob
153
- *
154
- * @function
155
- * @param {Object} val The value to test
156
- * @returns {boolean} True if value is a Blob, otherwise false
157
- */
158
- var isBlob = kindOfTest('Blob');
145
+ var documentAll$1 = documentAll_1.all;
159
146
 
160
- /**
161
- * Determine if a value is a FileList
162
- *
163
- * @function
164
- * @param {Object} val The value to test
165
- * @returns {boolean} True if value is a File, otherwise false
166
- */
167
- var isFileList = kindOfTest('FileList');
147
+ // `IsCallable` abstract operation
148
+ // https://tc39.es/ecma262/#sec-iscallable
149
+ var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) {
150
+ return typeof argument == 'function' || argument === documentAll$1;
151
+ } : function (argument) {
152
+ return typeof argument == 'function';
153
+ };
168
154
 
169
- /**
170
- * Determine if a value is a Function
171
- *
172
- * @param {Object} val The value to test
173
- * @returns {boolean} True if value is a Function, otherwise false
174
- */
175
- function isFunction(val) {
176
- return toString.call(val) === '[object Function]';
177
- }
155
+ var documentAll = documentAll_1.all;
178
156
 
179
- /**
180
- * Determine if a value is a Stream
181
- *
182
- * @param {Object} val The value to test
183
- * @returns {boolean} True if value is a Stream, otherwise false
184
- */
185
- function isStream(val) {
186
- return isObject(val) && isFunction(val.pipe);
187
- }
157
+ var isObject$2 = documentAll_1.IS_HTMLDDA ? function (it) {
158
+ return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;
159
+ } : function (it) {
160
+ return typeof it == 'object' ? it !== null : isCallable(it);
161
+ };
188
162
 
189
- /**
190
- * Determine if a value is a FormData
191
- *
192
- * @param {Object} thing The value to test
193
- * @returns {boolean} True if value is an FormData, otherwise false
194
- */
195
- function isFormData(thing) {
196
- var pattern = '[object FormData]';
197
- return thing && (
198
- (typeof FormData === 'function' && thing instanceof FormData) ||
199
- toString.call(thing) === pattern ||
200
- (isFunction(thing.toString) && thing.toString() === pattern)
201
- );
202
- }
163
+ var aFunction = function (argument) {
164
+ return isCallable(argument) ? argument : undefined;
165
+ };
203
166
 
204
- /**
205
- * Determine if a value is a URLSearchParams object
206
- * @function
207
- * @param {Object} val The value to test
208
- * @returns {boolean} True if value is a URLSearchParams object, otherwise false
209
- */
210
- var isURLSearchParams = kindOfTest('URLSearchParams');
167
+ var getBuiltIn = function (namespace, method) {
168
+ return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
169
+ };
211
170
 
212
- /**
213
- * Trim excess whitespace off the beginning and end of a string
214
- *
215
- * @param {String} str The String to trim
216
- * @returns {String} The String freed of excess whitespace
217
- */
218
- function trim(str) {
219
- return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
171
+ var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
172
+
173
+ var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
174
+
175
+ var process$1 = global_1.process;
176
+ var Deno = global_1.Deno;
177
+ var versions = process$1 && process$1.versions || Deno && Deno.version;
178
+ var v8 = versions && versions.v8;
179
+ var match, version$1;
180
+
181
+ if (v8) {
182
+ match = v8.split('.');
183
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
184
+ // but their correct versions are not interesting for us
185
+ version$1 = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
220
186
  }
221
187
 
222
- /**
223
- * Determine if we're running in a standard browser environment
224
- *
225
- * This allows axios to run in a web worker, and react-native.
226
- * Both environments support XMLHttpRequest, but not fully standard globals.
227
- *
228
- * web workers:
229
- * typeof window -> undefined
230
- * typeof document -> undefined
231
- *
232
- * react-native:
233
- * navigator.product -> 'ReactNative'
234
- * nativescript
235
- * navigator.product -> 'NativeScript' or 'NS'
236
- */
237
- function isStandardBrowserEnv() {
238
- if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
239
- navigator.product === 'NativeScript' ||
240
- navigator.product === 'NS')) {
241
- return false;
188
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
189
+ // so check `userAgent` even if `.v8` exists, but 0
190
+ if (!version$1 && engineUserAgent) {
191
+ match = engineUserAgent.match(/Edge\/(\d+)/);
192
+ if (!match || match[1] >= 74) {
193
+ match = engineUserAgent.match(/Chrome\/(\d+)/);
194
+ if (match) version$1 = +match[1];
242
195
  }
243
- return (
244
- typeof window !== 'undefined' &&
245
- typeof document !== 'undefined'
246
- );
247
196
  }
248
197
 
249
- /**
250
- * Iterate over an Array or an Object invoking a function for each item.
251
- *
252
- * If `obj` is an Array callback will be called passing
253
- * the value, index, and complete array for each item.
254
- *
255
- * If 'obj' is an Object callback will be called passing
256
- * the value, key, and complete object for each property.
257
- *
198
+ var engineV8Version = version$1;
199
+
200
+ /* eslint-disable es/no-symbol -- required for testing */
201
+
202
+
203
+
204
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
205
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(function () {
206
+ var symbol = Symbol();
207
+ // Chrome 38 Symbol has incorrect toString conversion
208
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
209
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
210
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
211
+ !Symbol.sham && engineV8Version && engineV8Version < 41;
212
+ });
213
+
214
+ /* eslint-disable es/no-symbol -- required for testing */
215
+
216
+
217
+ var useSymbolAsUid = symbolConstructorDetection
218
+ && !Symbol.sham
219
+ && typeof Symbol.iterator == 'symbol';
220
+
221
+ var $Object$1 = Object;
222
+
223
+ var isSymbol = useSymbolAsUid ? function (it) {
224
+ return typeof it == 'symbol';
225
+ } : function (it) {
226
+ var $Symbol = getBuiltIn('Symbol');
227
+ return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, $Object$1(it));
228
+ };
229
+
230
+ var $String$1 = String;
231
+
232
+ var tryToString = function (argument) {
233
+ try {
234
+ return $String$1(argument);
235
+ } catch (error) {
236
+ return 'Object';
237
+ }
238
+ };
239
+
240
+ var $TypeError$4 = TypeError;
241
+
242
+ // `Assert: IsCallable(argument) is true`
243
+ var aCallable = function (argument) {
244
+ if (isCallable(argument)) return argument;
245
+ throw $TypeError$4(tryToString(argument) + ' is not a function');
246
+ };
247
+
248
+ // `GetMethod` abstract operation
249
+ // https://tc39.es/ecma262/#sec-getmethod
250
+ var getMethod = function (V, P) {
251
+ var func = V[P];
252
+ return isNullOrUndefined$1(func) ? undefined : aCallable(func);
253
+ };
254
+
255
+ var $TypeError$3 = TypeError;
256
+
257
+ // `OrdinaryToPrimitive` abstract operation
258
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
259
+ var ordinaryToPrimitive = function (input, pref) {
260
+ var fn, val;
261
+ if (pref === 'string' && isCallable(fn = input.toString) && !isObject$2(val = functionCall(fn, input))) return val;
262
+ if (isCallable(fn = input.valueOf) && !isObject$2(val = functionCall(fn, input))) return val;
263
+ if (pref !== 'string' && isCallable(fn = input.toString) && !isObject$2(val = functionCall(fn, input))) return val;
264
+ throw $TypeError$3("Can't convert object to primitive value");
265
+ };
266
+
267
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
268
+ var defineProperty$1 = Object.defineProperty;
269
+
270
+ var defineGlobalProperty = function (key, value) {
271
+ try {
272
+ defineProperty$1(global_1, key, { value: value, configurable: true, writable: true });
273
+ } catch (error) {
274
+ global_1[key] = value;
275
+ } return value;
276
+ };
277
+
278
+ var SHARED = '__core-js_shared__';
279
+ var store$1 = global_1[SHARED] || defineGlobalProperty(SHARED, {});
280
+
281
+ var sharedStore = store$1;
282
+
283
+ var shared = createCommonjsModule(function (module) {
284
+ (module.exports = function (key, value) {
285
+ return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
286
+ })('versions', []).push({
287
+ version: '3.26.0',
288
+ mode: 'global',
289
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
290
+ license: 'https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE',
291
+ source: 'https://github.com/zloirock/core-js'
292
+ });
293
+ });
294
+
295
+ var $Object = Object;
296
+
297
+ // `ToObject` abstract operation
298
+ // https://tc39.es/ecma262/#sec-toobject
299
+ var toObject = function (argument) {
300
+ return $Object(requireObjectCoercible(argument));
301
+ };
302
+
303
+ var hasOwnProperty$1 = functionUncurryThis({}.hasOwnProperty);
304
+
305
+ // `HasOwnProperty` abstract operation
306
+ // https://tc39.es/ecma262/#sec-hasownproperty
307
+ // eslint-disable-next-line es/no-object-hasown -- safe
308
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
309
+ return hasOwnProperty$1(toObject(it), key);
310
+ };
311
+
312
+ var id = 0;
313
+ var postfix = Math.random();
314
+ var toString$1 = functionUncurryThis(1.0.toString);
315
+
316
+ var uid = function (key) {
317
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$1(++id + postfix, 36);
318
+ };
319
+
320
+ var WellKnownSymbolsStore = shared('wks');
321
+ var Symbol$1 = global_1.Symbol;
322
+ var symbolFor = Symbol$1 && Symbol$1['for'];
323
+ var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
324
+
325
+ var wellKnownSymbol = function (name) {
326
+ if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(symbolConstructorDetection || typeof WellKnownSymbolsStore[name] == 'string')) {
327
+ var description = 'Symbol.' + name;
328
+ if (symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)) {
329
+ WellKnownSymbolsStore[name] = Symbol$1[name];
330
+ } else if (useSymbolAsUid && symbolFor) {
331
+ WellKnownSymbolsStore[name] = symbolFor(description);
332
+ } else {
333
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
334
+ }
335
+ } return WellKnownSymbolsStore[name];
336
+ };
337
+
338
+ var $TypeError$2 = TypeError;
339
+ var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
340
+
341
+ // `ToPrimitive` abstract operation
342
+ // https://tc39.es/ecma262/#sec-toprimitive
343
+ var toPrimitive = function (input, pref) {
344
+ if (!isObject$2(input) || isSymbol(input)) return input;
345
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
346
+ var result;
347
+ if (exoticToPrim) {
348
+ if (pref === undefined) pref = 'default';
349
+ result = functionCall(exoticToPrim, input, pref);
350
+ if (!isObject$2(result) || isSymbol(result)) return result;
351
+ throw $TypeError$2("Can't convert object to primitive value");
352
+ }
353
+ if (pref === undefined) pref = 'number';
354
+ return ordinaryToPrimitive(input, pref);
355
+ };
356
+
357
+ // `ToPropertyKey` abstract operation
358
+ // https://tc39.es/ecma262/#sec-topropertykey
359
+ var toPropertyKey = function (argument) {
360
+ var key = toPrimitive(argument, 'string');
361
+ return isSymbol(key) ? key : key + '';
362
+ };
363
+
364
+ var document$1 = global_1.document;
365
+ // typeof document.createElement is 'object' in old IE
366
+ var EXISTS$1 = isObject$2(document$1) && isObject$2(document$1.createElement);
367
+
368
+ var documentCreateElement = function (it) {
369
+ return EXISTS$1 ? document$1.createElement(it) : {};
370
+ };
371
+
372
+ // Thanks to IE8 for its funny defineProperty
373
+ var ie8DomDefine = !descriptors$1 && !fails(function () {
374
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
375
+ return Object.defineProperty(documentCreateElement('div'), 'a', {
376
+ get: function () { return 7; }
377
+ }).a != 7;
378
+ });
379
+
380
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
381
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
382
+
383
+ // `Object.getOwnPropertyDescriptor` method
384
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
385
+ var f$4 = descriptors$1 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
386
+ O = toIndexedObject(O);
387
+ P = toPropertyKey(P);
388
+ if (ie8DomDefine) try {
389
+ return $getOwnPropertyDescriptor$1(O, P);
390
+ } catch (error) { /* empty */ }
391
+ if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
392
+ };
393
+
394
+ var objectGetOwnPropertyDescriptor = {
395
+ f: f$4
396
+ };
397
+
398
+ // V8 ~ Chrome 36-
399
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
400
+ var v8PrototypeDefineBug = descriptors$1 && fails(function () {
401
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
402
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
403
+ value: 42,
404
+ writable: false
405
+ }).prototype != 42;
406
+ });
407
+
408
+ var $String = String;
409
+ var $TypeError$1 = TypeError;
410
+
411
+ // `Assert: Type(argument) is Object`
412
+ var anObject = function (argument) {
413
+ if (isObject$2(argument)) return argument;
414
+ throw $TypeError$1($String(argument) + ' is not an object');
415
+ };
416
+
417
+ var $TypeError = TypeError;
418
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
419
+ var $defineProperty = Object.defineProperty;
420
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
421
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
422
+ var ENUMERABLE = 'enumerable';
423
+ var CONFIGURABLE$1 = 'configurable';
424
+ var WRITABLE = 'writable';
425
+
426
+ // `Object.defineProperty` method
427
+ // https://tc39.es/ecma262/#sec-object.defineproperty
428
+ var f$3 = descriptors$1 ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
429
+ anObject(O);
430
+ P = toPropertyKey(P);
431
+ anObject(Attributes);
432
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
433
+ var current = $getOwnPropertyDescriptor(O, P);
434
+ if (current && current[WRITABLE]) {
435
+ O[P] = Attributes.value;
436
+ Attributes = {
437
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
438
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
439
+ writable: false
440
+ };
441
+ }
442
+ } return $defineProperty(O, P, Attributes);
443
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
444
+ anObject(O);
445
+ P = toPropertyKey(P);
446
+ anObject(Attributes);
447
+ if (ie8DomDefine) try {
448
+ return $defineProperty(O, P, Attributes);
449
+ } catch (error) { /* empty */ }
450
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
451
+ if ('value' in Attributes) O[P] = Attributes.value;
452
+ return O;
453
+ };
454
+
455
+ var objectDefineProperty = {
456
+ f: f$3
457
+ };
458
+
459
+ var createNonEnumerableProperty = descriptors$1 ? function (object, key, value) {
460
+ return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
461
+ } : function (object, key, value) {
462
+ object[key] = value;
463
+ return object;
464
+ };
465
+
466
+ var FunctionPrototype = Function.prototype;
467
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
468
+ var getDescriptor = descriptors$1 && Object.getOwnPropertyDescriptor;
469
+
470
+ var EXISTS = hasOwnProperty_1(FunctionPrototype, 'name');
471
+ // additional protection from minified / mangled / dropped function names
472
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
473
+ var CONFIGURABLE = EXISTS && (!descriptors$1 || (descriptors$1 && getDescriptor(FunctionPrototype, 'name').configurable));
474
+
475
+ var functionName = {
476
+ EXISTS: EXISTS,
477
+ PROPER: PROPER,
478
+ CONFIGURABLE: CONFIGURABLE
479
+ };
480
+
481
+ var functionToString = functionUncurryThis(Function.toString);
482
+
483
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
484
+ if (!isCallable(sharedStore.inspectSource)) {
485
+ sharedStore.inspectSource = function (it) {
486
+ return functionToString(it);
487
+ };
488
+ }
489
+
490
+ var inspectSource = sharedStore.inspectSource;
491
+
492
+ var WeakMap$1 = global_1.WeakMap;
493
+
494
+ var weakMapBasicDetection = isCallable(WeakMap$1) && /native code/.test(String(WeakMap$1));
495
+
496
+ var keys = shared('keys');
497
+
498
+ var sharedKey = function (key) {
499
+ return keys[key] || (keys[key] = uid(key));
500
+ };
501
+
502
+ var hiddenKeys$1 = {};
503
+
504
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
505
+ var TypeError$1 = global_1.TypeError;
506
+ var WeakMap = global_1.WeakMap;
507
+ var set, get, has;
508
+
509
+ var enforce = function (it) {
510
+ return has(it) ? get(it) : set(it, {});
511
+ };
512
+
513
+ var getterFor = function (TYPE) {
514
+ return function (it) {
515
+ var state;
516
+ if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
517
+ throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
518
+ } return state;
519
+ };
520
+ };
521
+
522
+ if (weakMapBasicDetection || sharedStore.state) {
523
+ var store = sharedStore.state || (sharedStore.state = new WeakMap());
524
+ /* eslint-disable no-self-assign -- prototype methods protection */
525
+ store.get = store.get;
526
+ store.has = store.has;
527
+ store.set = store.set;
528
+ /* eslint-enable no-self-assign -- prototype methods protection */
529
+ set = function (it, metadata) {
530
+ if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
531
+ metadata.facade = it;
532
+ store.set(it, metadata);
533
+ return metadata;
534
+ };
535
+ get = function (it) {
536
+ return store.get(it) || {};
537
+ };
538
+ has = function (it) {
539
+ return store.has(it);
540
+ };
541
+ } else {
542
+ var STATE = sharedKey('state');
543
+ hiddenKeys$1[STATE] = true;
544
+ set = function (it, metadata) {
545
+ if (hasOwnProperty_1(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
546
+ metadata.facade = it;
547
+ createNonEnumerableProperty(it, STATE, metadata);
548
+ return metadata;
549
+ };
550
+ get = function (it) {
551
+ return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
552
+ };
553
+ has = function (it) {
554
+ return hasOwnProperty_1(it, STATE);
555
+ };
556
+ }
557
+
558
+ var internalState = {
559
+ set: set,
560
+ get: get,
561
+ has: has,
562
+ enforce: enforce,
563
+ getterFor: getterFor
564
+ };
565
+
566
+ var makeBuiltIn_1 = createCommonjsModule(function (module) {
567
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
568
+
569
+
570
+
571
+ var enforceInternalState = internalState.enforce;
572
+ var getInternalState = internalState.get;
573
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
574
+ var defineProperty = Object.defineProperty;
575
+
576
+ var CONFIGURABLE_LENGTH = descriptors$1 && !fails(function () {
577
+ return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
578
+ });
579
+
580
+ var TEMPLATE = String(String).split('String');
581
+
582
+ var makeBuiltIn = module.exports = function (value, name, options) {
583
+ if (String(name).slice(0, 7) === 'Symbol(') {
584
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
585
+ }
586
+ if (options && options.getter) name = 'get ' + name;
587
+ if (options && options.setter) name = 'set ' + name;
588
+ if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
589
+ if (descriptors$1) defineProperty(value, 'name', { value: name, configurable: true });
590
+ else value.name = name;
591
+ }
592
+ if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
593
+ defineProperty(value, 'length', { value: options.arity });
594
+ }
595
+ try {
596
+ if (options && hasOwnProperty_1(options, 'constructor') && options.constructor) {
597
+ if (descriptors$1) defineProperty(value, 'prototype', { writable: false });
598
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
599
+ } else if (value.prototype) value.prototype = undefined;
600
+ } catch (error) { /* empty */ }
601
+ var state = enforceInternalState(value);
602
+ if (!hasOwnProperty_1(state, 'source')) {
603
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
604
+ } return value;
605
+ };
606
+
607
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
608
+ // eslint-disable-next-line no-extend-native -- required
609
+ Function.prototype.toString = makeBuiltIn(function toString() {
610
+ return isCallable(this) && getInternalState(this).source || inspectSource(this);
611
+ }, 'toString');
612
+ });
613
+
614
+ var defineBuiltIn = function (O, key, value, options) {
615
+ if (!options) options = {};
616
+ var simple = options.enumerable;
617
+ var name = options.name !== undefined ? options.name : key;
618
+ if (isCallable(value)) makeBuiltIn_1(value, name, options);
619
+ if (options.global) {
620
+ if (simple) O[key] = value;
621
+ else defineGlobalProperty(key, value);
622
+ } else {
623
+ try {
624
+ if (!options.unsafe) delete O[key];
625
+ else if (O[key]) simple = true;
626
+ } catch (error) { /* empty */ }
627
+ if (simple) O[key] = value;
628
+ else objectDefineProperty.f(O, key, {
629
+ value: value,
630
+ enumerable: false,
631
+ configurable: !options.nonConfigurable,
632
+ writable: !options.nonWritable
633
+ });
634
+ } return O;
635
+ };
636
+
637
+ var ceil = Math.ceil;
638
+ var floor$1 = Math.floor;
639
+
640
+ // `Math.trunc` method
641
+ // https://tc39.es/ecma262/#sec-math.trunc
642
+ // eslint-disable-next-line es/no-math-trunc -- safe
643
+ var mathTrunc = Math.trunc || function trunc(x) {
644
+ var n = +x;
645
+ return (n > 0 ? floor$1 : ceil)(n);
646
+ };
647
+
648
+ // `ToIntegerOrInfinity` abstract operation
649
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
650
+ var toIntegerOrInfinity = function (argument) {
651
+ var number = +argument;
652
+ // eslint-disable-next-line no-self-compare -- NaN check
653
+ return number !== number || number === 0 ? 0 : mathTrunc(number);
654
+ };
655
+
656
+ var max = Math.max;
657
+ var min$1 = Math.min;
658
+
659
+ // Helper for a popular repeating case of the spec:
660
+ // Let integer be ? ToInteger(index).
661
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
662
+ var toAbsoluteIndex = function (index, length) {
663
+ var integer = toIntegerOrInfinity(index);
664
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
665
+ };
666
+
667
+ var min = Math.min;
668
+
669
+ // `ToLength` abstract operation
670
+ // https://tc39.es/ecma262/#sec-tolength
671
+ var toLength = function (argument) {
672
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
673
+ };
674
+
675
+ // `LengthOfArrayLike` abstract operation
676
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
677
+ var lengthOfArrayLike = function (obj) {
678
+ return toLength(obj.length);
679
+ };
680
+
681
+ // `Array.prototype.{ indexOf, includes }` methods implementation
682
+ var createMethod = function (IS_INCLUDES) {
683
+ return function ($this, el, fromIndex) {
684
+ var O = toIndexedObject($this);
685
+ var length = lengthOfArrayLike(O);
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$1[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$1 = 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 = global_1;
829
+ } else if (STATIC) {
830
+ target = global_1[TARGET] || defineGlobalProperty(TARGET, {});
831
+ } else {
832
+ target = (global_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$1 = 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$1 && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
865
+ anObject(O);
866
+ var props = toIndexedObject(Properties);
867
+ var keys = objectKeys$1(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
+ activeXDocument = null; // avoid memory leak
908
+ return temp;
909
+ };
910
+
911
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
912
+ var NullProtoObjectViaIFrame = function () {
913
+ // Thrash, waste and sodomy: IE GC bug
914
+ var iframe = documentCreateElement('iframe');
915
+ var JS = 'java' + SCRIPT + ':';
916
+ var iframeDocument;
917
+ iframe.style.display = 'none';
918
+ html.appendChild(iframe);
919
+ // https://github.com/zloirock/core-js/issues/475
920
+ iframe.src = String(JS);
921
+ iframeDocument = iframe.contentWindow.document;
922
+ iframeDocument.open();
923
+ iframeDocument.write(scriptTag('document.F=Object'));
924
+ iframeDocument.close();
925
+ return iframeDocument.F;
926
+ };
927
+
928
+ // Check for document.domain and active x support
929
+ // No need to use active x approach when document.domain is not set
930
+ // see https://github.com/es-shims/es5-shim/issues/150
931
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
932
+ // avoid IE GC bug
933
+ var activeXDocument;
934
+ var NullProtoObject = function () {
935
+ try {
936
+ activeXDocument = new ActiveXObject('htmlfile');
937
+ } catch (error) { /* ignore */ }
938
+ NullProtoObject = typeof document != 'undefined'
939
+ ? document.domain && activeXDocument
940
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
941
+ : NullProtoObjectViaIFrame()
942
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
943
+ var length = enumBugKeys.length;
944
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
945
+ return NullProtoObject();
946
+ };
947
+
948
+ hiddenKeys$1[IE_PROTO] = true;
949
+
950
+ // `Object.create` method
951
+ // https://tc39.es/ecma262/#sec-object.create
952
+ // eslint-disable-next-line es/no-object-create -- safe
953
+ var objectCreate = Object.create || function create(O, Properties) {
954
+ var result;
955
+ if (O !== null) {
956
+ EmptyConstructor[PROTOTYPE] = anObject(O);
957
+ result = new EmptyConstructor();
958
+ EmptyConstructor[PROTOTYPE] = null;
959
+ // add "__proto__" for Object.getPrototypeOf polyfill
960
+ result[IE_PROTO] = O;
961
+ } else result = NullProtoObject();
962
+ return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
963
+ };
964
+
965
+ var defineProperty = objectDefineProperty.f;
966
+
967
+ var UNSCOPABLES = wellKnownSymbol('unscopables');
968
+ var ArrayPrototype = Array.prototype;
969
+
970
+ // Array.prototype[@@unscopables]
971
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
972
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
973
+ defineProperty(ArrayPrototype, UNSCOPABLES, {
974
+ configurable: true,
975
+ value: objectCreate(null)
976
+ });
977
+ }
978
+
979
+ // add a key to Array.prototype[@@unscopables]
980
+ var addToUnscopables = function (key) {
981
+ ArrayPrototype[UNSCOPABLES][key] = true;
982
+ };
983
+
984
+ var $includes = arrayIncludes.includes;
985
+
986
+
987
+
988
+ // FF99+ bug
989
+ var BROKEN_ON_SPARSE = fails(function () {
990
+ return !Array(1).includes();
991
+ });
992
+
993
+ // `Array.prototype.includes` method
994
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
995
+ _export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
996
+ includes: function includes(el /* , fromIndex = 0 */) {
997
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
998
+ }
999
+ });
1000
+
1001
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1002
+ addToUnscopables('includes');
1003
+
1004
+ var bind = function bind(fn, thisArg) {
1005
+ return function wrap() {
1006
+ var args = new Array(arguments.length);
1007
+ for (var i = 0; i < args.length; i++) {
1008
+ args[i] = arguments[i];
1009
+ }
1010
+ return fn.apply(thisArg, args);
1011
+ };
1012
+ };
1013
+
1014
+ // utils is a library of generic helper functions non-specific to axios
1015
+
1016
+ var toString = Object.prototype.toString;
1017
+
1018
+ // eslint-disable-next-line func-names
1019
+ var kindOf = (function(cache) {
1020
+ // eslint-disable-next-line func-names
1021
+ return function(thing) {
1022
+ var str = toString.call(thing);
1023
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
1024
+ };
1025
+ })(Object.create(null));
1026
+
1027
+ function kindOfTest(type) {
1028
+ type = type.toLowerCase();
1029
+ return function isKindOf(thing) {
1030
+ return kindOf(thing) === type;
1031
+ };
1032
+ }
1033
+
1034
+ /**
1035
+ * Array with axios supported protocols.
1036
+ */
1037
+ var supportedProtocols = [ 'http:', 'https:', 'file:' ];
1038
+
1039
+ /**
1040
+ * Returns URL protocol passed as param if is not undefined or null,
1041
+ * otherwise just returns 'http:'
1042
+ *
1043
+ * @param {String} protocol The String value of URL protocol
1044
+ * @returns {String} Protocol if the value is not undefined or null
1045
+ */
1046
+ function getProtocol(protocol) {
1047
+ return protocol || 'http:';
1048
+ }
1049
+
1050
+ /**
1051
+ * Determine if a value is an Array
1052
+ *
1053
+ * @param {Object} val The value to test
1054
+ * @returns {boolean} True if value is an Array, otherwise false
1055
+ */
1056
+ function isArray$1(val) {
1057
+ return Array.isArray(val);
1058
+ }
1059
+
1060
+ /**
1061
+ * Determine if a value is undefined
1062
+ *
1063
+ * @param {Object} val The value to test
1064
+ * @returns {boolean} True if the value is undefined, otherwise false
1065
+ */
1066
+ function isUndefined(val) {
1067
+ return typeof val === 'undefined';
1068
+ }
1069
+
1070
+ /**
1071
+ * Determine if a value is a Buffer
1072
+ *
1073
+ * @param {Object} val The value to test
1074
+ * @returns {boolean} True if value is a Buffer, otherwise false
1075
+ */
1076
+ function isBuffer(val) {
1077
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
1078
+ && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
1079
+ }
1080
+
1081
+ /**
1082
+ * Determine if a value is an ArrayBuffer
1083
+ *
1084
+ * @function
1085
+ * @param {Object} val The value to test
1086
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
1087
+ */
1088
+ var isArrayBuffer = kindOfTest('ArrayBuffer');
1089
+
1090
+
1091
+ /**
1092
+ * Determine if a value is a view on an ArrayBuffer
1093
+ *
1094
+ * @param {Object} val The value to test
1095
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
1096
+ */
1097
+ function isArrayBufferView(val) {
1098
+ var result;
1099
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
1100
+ result = ArrayBuffer.isView(val);
1101
+ } else {
1102
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
1103
+ }
1104
+ return result;
1105
+ }
1106
+
1107
+ /**
1108
+ * Determine if a value is a String
1109
+ *
1110
+ * @param {Object} val The value to test
1111
+ * @returns {boolean} True if value is a String, otherwise false
1112
+ */
1113
+ function isString$1(val) {
1114
+ return typeof val === 'string';
1115
+ }
1116
+
1117
+ /**
1118
+ * Determine if a value is a Number
1119
+ *
1120
+ * @param {Object} val The value to test
1121
+ * @returns {boolean} True if value is a Number, otherwise false
1122
+ */
1123
+ function isNumber(val) {
1124
+ return typeof val === 'number';
1125
+ }
1126
+
1127
+ /**
1128
+ * Determine if a value is an Object
1129
+ *
1130
+ * @param {Object} val The value to test
1131
+ * @returns {boolean} True if value is an Object, otherwise false
1132
+ */
1133
+ function isObject$1(val) {
1134
+ return val !== null && typeof val === 'object';
1135
+ }
1136
+
1137
+ /**
1138
+ * Determine if a value is a plain Object
1139
+ *
1140
+ * @param {Object} val The value to test
1141
+ * @return {boolean} True if value is a plain Object, otherwise false
1142
+ */
1143
+ function isPlainObject(val) {
1144
+ if (kindOf(val) !== 'object') {
1145
+ return false;
1146
+ }
1147
+
1148
+ var prototype = Object.getPrototypeOf(val);
1149
+ return prototype === null || prototype === Object.prototype;
1150
+ }
1151
+
1152
+ /**
1153
+ * Determine if a value is a Date
1154
+ *
1155
+ * @function
1156
+ * @param {Object} val The value to test
1157
+ * @returns {boolean} True if value is a Date, otherwise false
1158
+ */
1159
+ var isDate = kindOfTest('Date');
1160
+
1161
+ /**
1162
+ * Determine if a value is a File
1163
+ *
1164
+ * @function
1165
+ * @param {Object} val The value to test
1166
+ * @returns {boolean} True if value is a File, otherwise false
1167
+ */
1168
+ var isFile = kindOfTest('File');
1169
+
1170
+ /**
1171
+ * Determine if a value is a Blob
1172
+ *
1173
+ * @function
1174
+ * @param {Object} val The value to test
1175
+ * @returns {boolean} True if value is a Blob, otherwise false
1176
+ */
1177
+ var isBlob = kindOfTest('Blob');
1178
+
1179
+ /**
1180
+ * Determine if a value is a FileList
1181
+ *
1182
+ * @function
1183
+ * @param {Object} val The value to test
1184
+ * @returns {boolean} True if value is a File, otherwise false
1185
+ */
1186
+ var isFileList = kindOfTest('FileList');
1187
+
1188
+ /**
1189
+ * Determine if a value is a Function
1190
+ *
1191
+ * @param {Object} val The value to test
1192
+ * @returns {boolean} True if value is a Function, otherwise false
1193
+ */
1194
+ function isFunction(val) {
1195
+ return toString.call(val) === '[object Function]';
1196
+ }
1197
+
1198
+ /**
1199
+ * Determine if a value is a Stream
1200
+ *
1201
+ * @param {Object} val The value to test
1202
+ * @returns {boolean} True if value is a Stream, otherwise false
1203
+ */
1204
+ function isStream(val) {
1205
+ return isObject$1(val) && isFunction(val.pipe);
1206
+ }
1207
+
1208
+ /**
1209
+ * Determine if a value is a FormData
1210
+ *
1211
+ * @param {Object} thing The value to test
1212
+ * @returns {boolean} True if value is an FormData, otherwise false
1213
+ */
1214
+ function isFormData(thing) {
1215
+ var pattern = '[object FormData]';
1216
+ return thing && (
1217
+ (typeof FormData === 'function' && thing instanceof FormData) ||
1218
+ toString.call(thing) === pattern ||
1219
+ (isFunction(thing.toString) && thing.toString() === pattern)
1220
+ );
1221
+ }
1222
+
1223
+ /**
1224
+ * Determine if a value is a URLSearchParams object
1225
+ * @function
1226
+ * @param {Object} val The value to test
1227
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
1228
+ */
1229
+ var isURLSearchParams = kindOfTest('URLSearchParams');
1230
+
1231
+ /**
1232
+ * Trim excess whitespace off the beginning and end of a string
1233
+ *
1234
+ * @param {String} str The String to trim
1235
+ * @returns {String} The String freed of excess whitespace
1236
+ */
1237
+ function trim(str) {
1238
+ return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
1239
+ }
1240
+
1241
+ /**
1242
+ * Determine if we're running in a standard browser environment
1243
+ *
1244
+ * This allows axios to run in a web worker, and react-native.
1245
+ * Both environments support XMLHttpRequest, but not fully standard globals.
1246
+ *
1247
+ * web workers:
1248
+ * typeof window -> undefined
1249
+ * typeof document -> undefined
1250
+ *
1251
+ * react-native:
1252
+ * navigator.product -> 'ReactNative'
1253
+ * nativescript
1254
+ * navigator.product -> 'NativeScript' or 'NS'
1255
+ */
1256
+ function isStandardBrowserEnv() {
1257
+ if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
1258
+ navigator.product === 'NativeScript' ||
1259
+ navigator.product === 'NS')) {
1260
+ return false;
1261
+ }
1262
+ return (
1263
+ typeof window !== 'undefined' &&
1264
+ typeof document !== 'undefined'
1265
+ );
1266
+ }
1267
+
1268
+ /**
1269
+ * Iterate over an Array or an Object invoking a function for each item.
1270
+ *
1271
+ * If `obj` is an Array callback will be called passing
1272
+ * the value, index, and complete array for each item.
1273
+ *
1274
+ * If 'obj' is an Object callback will be called passing
1275
+ * the value, key, and complete object for each property.
1276
+ *
258
1277
  * @param {Object|Array} obj The object to iterate
259
1278
  * @param {Function} fn The callback to invoke for each item
260
1279
  */
261
- function forEach(obj, fn) {
262
- // Don't bother if no value provided
263
- if (obj === null || typeof obj === 'undefined') {
264
- return;
1280
+ function forEach(obj, fn) {
1281
+ // Don't bother if no value provided
1282
+ if (obj === null || typeof obj === 'undefined') {
1283
+ return;
1284
+ }
1285
+
1286
+ // Force an array if not already something iterable
1287
+ if (typeof obj !== 'object') {
1288
+ /*eslint no-param-reassign:0*/
1289
+ obj = [obj];
1290
+ }
1291
+
1292
+ if (isArray$1(obj)) {
1293
+ // Iterate over array values
1294
+ for (var i = 0, l = obj.length; i < l; i++) {
1295
+ fn.call(null, obj[i], i, obj);
1296
+ }
1297
+ } else {
1298
+ // Iterate over object keys
1299
+ for (var key in obj) {
1300
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
1301
+ fn.call(null, obj[key], key, obj);
1302
+ }
1303
+ }
1304
+ }
1305
+ }
1306
+
1307
+ /**
1308
+ * Accepts varargs expecting each argument to be an object, then
1309
+ * immutably merges the properties of each object and returns result.
1310
+ *
1311
+ * When multiple objects contain the same key the later object in
1312
+ * the arguments list will take precedence.
1313
+ *
1314
+ * Example:
1315
+ *
1316
+ * ```js
1317
+ * var result = merge({foo: 123}, {foo: 456});
1318
+ * console.log(result.foo); // outputs 456
1319
+ * ```
1320
+ *
1321
+ * @param {Object} obj1 Object to merge
1322
+ * @returns {Object} Result of all merge properties
1323
+ */
1324
+ function merge(/* obj1, obj2, obj3, ... */) {
1325
+ var result = {};
1326
+ function assignValue(val, key) {
1327
+ if (isPlainObject(result[key]) && isPlainObject(val)) {
1328
+ result[key] = merge(result[key], val);
1329
+ } else if (isPlainObject(val)) {
1330
+ result[key] = merge({}, val);
1331
+ } else if (isArray$1(val)) {
1332
+ result[key] = val.slice();
1333
+ } else {
1334
+ result[key] = val;
1335
+ }
1336
+ }
1337
+
1338
+ for (var i = 0, l = arguments.length; i < l; i++) {
1339
+ forEach(arguments[i], assignValue);
1340
+ }
1341
+ return result;
1342
+ }
1343
+
1344
+ /**
1345
+ * Extends object a by mutably adding to it the properties of object b.
1346
+ *
1347
+ * @param {Object} a The object to be extended
1348
+ * @param {Object} b The object to copy properties from
1349
+ * @param {Object} thisArg The object to bind function to
1350
+ * @return {Object} The resulting value of object a
1351
+ */
1352
+ function extend(a, b, thisArg) {
1353
+ forEach(b, function assignValue(val, key) {
1354
+ if (thisArg && typeof val === 'function') {
1355
+ a[key] = bind(val, thisArg);
1356
+ } else {
1357
+ a[key] = val;
1358
+ }
1359
+ });
1360
+ return a;
1361
+ }
1362
+
1363
+ /**
1364
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
1365
+ *
1366
+ * @param {string} content with BOM
1367
+ * @return {string} content value without BOM
1368
+ */
1369
+ function stripBOM(content) {
1370
+ if (content.charCodeAt(0) === 0xFEFF) {
1371
+ content = content.slice(1);
1372
+ }
1373
+ return content;
1374
+ }
1375
+
1376
+ /**
1377
+ * Inherit the prototype methods from one constructor into another
1378
+ * @param {function} constructor
1379
+ * @param {function} superConstructor
1380
+ * @param {object} [props]
1381
+ * @param {object} [descriptors]
1382
+ */
1383
+
1384
+ function inherits(constructor, superConstructor, props, descriptors) {
1385
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
1386
+ constructor.prototype.constructor = constructor;
1387
+ props && Object.assign(constructor.prototype, props);
1388
+ }
1389
+
1390
+ /**
1391
+ * Resolve object with deep prototype chain to a flat object
1392
+ * @param {Object} sourceObj source object
1393
+ * @param {Object} [destObj]
1394
+ * @param {Function} [filter]
1395
+ * @returns {Object}
1396
+ */
1397
+
1398
+ function toFlatObject(sourceObj, destObj, filter) {
1399
+ var props;
1400
+ var i;
1401
+ var prop;
1402
+ var merged = {};
1403
+
1404
+ destObj = destObj || {};
1405
+
1406
+ do {
1407
+ props = Object.getOwnPropertyNames(sourceObj);
1408
+ i = props.length;
1409
+ while (i-- > 0) {
1410
+ prop = props[i];
1411
+ if (!merged[prop]) {
1412
+ destObj[prop] = sourceObj[prop];
1413
+ merged[prop] = true;
1414
+ }
1415
+ }
1416
+ sourceObj = Object.getPrototypeOf(sourceObj);
1417
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
1418
+
1419
+ return destObj;
1420
+ }
1421
+
1422
+ /*
1423
+ * determines whether a string ends with the characters of a specified string
1424
+ * @param {String} str
1425
+ * @param {String} searchString
1426
+ * @param {Number} [position= 0]
1427
+ * @returns {boolean}
1428
+ */
1429
+ function endsWith(str, searchString, position) {
1430
+ str = String(str);
1431
+ if (position === undefined || position > str.length) {
1432
+ position = str.length;
1433
+ }
1434
+ position -= searchString.length;
1435
+ var lastIndex = str.indexOf(searchString, position);
1436
+ return lastIndex !== -1 && lastIndex === position;
1437
+ }
1438
+
1439
+
1440
+ /**
1441
+ * Returns new array from array like object
1442
+ * @param {*} [thing]
1443
+ * @returns {Array}
1444
+ */
1445
+ function toArray(thing) {
1446
+ if (!thing) return null;
1447
+ var i = thing.length;
1448
+ if (isUndefined(i)) return null;
1449
+ var arr = new Array(i);
1450
+ while (i-- > 0) {
1451
+ arr[i] = thing[i];
1452
+ }
1453
+ return arr;
1454
+ }
1455
+
1456
+ // eslint-disable-next-line func-names
1457
+ var isTypedArray = (function(TypedArray) {
1458
+ // eslint-disable-next-line func-names
1459
+ return function(thing) {
1460
+ return TypedArray && thing instanceof TypedArray;
1461
+ };
1462
+ })(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
1463
+
1464
+ var utils = {
1465
+ supportedProtocols: supportedProtocols,
1466
+ getProtocol: getProtocol,
1467
+ isArray: isArray$1,
1468
+ isArrayBuffer: isArrayBuffer,
1469
+ isBuffer: isBuffer,
1470
+ isFormData: isFormData,
1471
+ isArrayBufferView: isArrayBufferView,
1472
+ isString: isString$1,
1473
+ isNumber: isNumber,
1474
+ isObject: isObject$1,
1475
+ isPlainObject: isPlainObject,
1476
+ isUndefined: isUndefined,
1477
+ isDate: isDate,
1478
+ isFile: isFile,
1479
+ isBlob: isBlob,
1480
+ isFunction: isFunction,
1481
+ isStream: isStream,
1482
+ isURLSearchParams: isURLSearchParams,
1483
+ isStandardBrowserEnv: isStandardBrowserEnv,
1484
+ forEach: forEach,
1485
+ merge: merge,
1486
+ extend: extend,
1487
+ trim: trim,
1488
+ stripBOM: stripBOM,
1489
+ inherits: inherits,
1490
+ toFlatObject: toFlatObject,
1491
+ kindOf: kindOf,
1492
+ kindOfTest: kindOfTest,
1493
+ endsWith: endsWith,
1494
+ toArray: toArray,
1495
+ isTypedArray: isTypedArray,
1496
+ isFileList: isFileList
1497
+ };
1498
+
1499
+ function encode$1(val) {
1500
+ return encodeURIComponent(val).
1501
+ replace(/%3A/gi, ':').
1502
+ replace(/%24/g, '$').
1503
+ replace(/%2C/gi, ',').
1504
+ replace(/%20/g, '+').
1505
+ replace(/%5B/gi, '[').
1506
+ replace(/%5D/gi, ']');
1507
+ }
1508
+
1509
+ /**
1510
+ * Build a URL by appending params to the end
1511
+ *
1512
+ * @param {string} url The base of the url (e.g., http://www.google.com)
1513
+ * @param {object} [params] The params to be appended
1514
+ * @returns {string} The formatted url
1515
+ */
1516
+ var buildURL = function buildURL(url, params, paramsSerializer) {
1517
+ /*eslint no-param-reassign:0*/
1518
+ if (!params) {
1519
+ return url;
1520
+ }
1521
+
1522
+ var serializedParams;
1523
+ if (paramsSerializer) {
1524
+ serializedParams = paramsSerializer(params);
1525
+ } else if (utils.isURLSearchParams(params)) {
1526
+ serializedParams = params.toString();
1527
+ } else {
1528
+ var parts = [];
1529
+
1530
+ utils.forEach(params, function serialize(val, key) {
1531
+ if (val === null || typeof val === 'undefined') {
1532
+ return;
1533
+ }
1534
+
1535
+ if (utils.isArray(val)) {
1536
+ key = key + '[]';
1537
+ } else {
1538
+ val = [val];
1539
+ }
1540
+
1541
+ utils.forEach(val, function parseValue(v) {
1542
+ if (utils.isDate(v)) {
1543
+ v = v.toISOString();
1544
+ } else if (utils.isObject(v)) {
1545
+ v = JSON.stringify(v);
1546
+ }
1547
+ parts.push(encode$1(key) + '=' + encode$1(v));
1548
+ });
1549
+ });
1550
+
1551
+ serializedParams = parts.join('&');
1552
+ }
1553
+
1554
+ if (serializedParams) {
1555
+ var hashmarkIndex = url.indexOf('#');
1556
+ if (hashmarkIndex !== -1) {
1557
+ url = url.slice(0, hashmarkIndex);
1558
+ }
1559
+
1560
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1561
+ }
1562
+
1563
+ return url;
1564
+ };
1565
+
1566
+ function InterceptorManager() {
1567
+ this.handlers = [];
1568
+ }
1569
+
1570
+ /**
1571
+ * Add a new interceptor to the stack
1572
+ *
1573
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
1574
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
1575
+ *
1576
+ * @return {Number} An ID used to remove interceptor later
1577
+ */
1578
+ InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
1579
+ this.handlers.push({
1580
+ fulfilled: fulfilled,
1581
+ rejected: rejected,
1582
+ synchronous: options ? options.synchronous : false,
1583
+ runWhen: options ? options.runWhen : null
1584
+ });
1585
+ return this.handlers.length - 1;
1586
+ };
1587
+
1588
+ /**
1589
+ * Remove an interceptor from the stack
1590
+ *
1591
+ * @param {Number} id The ID that was returned by `use`
1592
+ */
1593
+ InterceptorManager.prototype.eject = function eject(id) {
1594
+ if (this.handlers[id]) {
1595
+ this.handlers[id] = null;
1596
+ }
1597
+ };
1598
+
1599
+ /**
1600
+ * Iterate over all the registered interceptors
1601
+ *
1602
+ * This method is particularly useful for skipping over any
1603
+ * interceptors that may have become `null` calling `eject`.
1604
+ *
1605
+ * @param {Function} fn The function to call for each interceptor
1606
+ */
1607
+ InterceptorManager.prototype.forEach = function forEach(fn) {
1608
+ utils.forEach(this.handlers, function forEachHandler(h) {
1609
+ if (h !== null) {
1610
+ fn(h);
1611
+ }
1612
+ });
1613
+ };
1614
+
1615
+ var InterceptorManager_1 = InterceptorManager;
1616
+
1617
+ var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
1618
+ utils.forEach(headers, function processHeader(value, name) {
1619
+ if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
1620
+ headers[normalizedName] = value;
1621
+ delete headers[name];
1622
+ }
1623
+ });
1624
+ };
1625
+
1626
+ /**
1627
+ * Create an Error with the specified message, config, error code, request and response.
1628
+ *
1629
+ * @param {string} message The error message.
1630
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
1631
+ * @param {Object} [config] The config.
1632
+ * @param {Object} [request] The request.
1633
+ * @param {Object} [response] The response.
1634
+ * @returns {Error} The created error.
1635
+ */
1636
+ function AxiosError(message, code, config, request, response) {
1637
+ Error.call(this);
1638
+ this.message = message;
1639
+ this.name = 'AxiosError';
1640
+ code && (this.code = code);
1641
+ config && (this.config = config);
1642
+ request && (this.request = request);
1643
+ response && (this.response = response);
1644
+ }
1645
+
1646
+ utils.inherits(AxiosError, Error, {
1647
+ toJSON: function toJSON() {
1648
+ return {
1649
+ // Standard
1650
+ message: this.message,
1651
+ name: this.name,
1652
+ // Microsoft
1653
+ description: this.description,
1654
+ number: this.number,
1655
+ // Mozilla
1656
+ fileName: this.fileName,
1657
+ lineNumber: this.lineNumber,
1658
+ columnNumber: this.columnNumber,
1659
+ stack: this.stack,
1660
+ // Axios
1661
+ config: this.config,
1662
+ code: this.code,
1663
+ status: this.response && this.response.status ? this.response.status : null
1664
+ };
265
1665
  }
1666
+ });
1667
+
1668
+ var prototype = AxiosError.prototype;
1669
+ var descriptors = {};
1670
+
1671
+ [
1672
+ 'ERR_BAD_OPTION_VALUE',
1673
+ 'ERR_BAD_OPTION',
1674
+ 'ECONNABORTED',
1675
+ 'ETIMEDOUT',
1676
+ 'ERR_NETWORK',
1677
+ 'ERR_FR_TOO_MANY_REDIRECTS',
1678
+ 'ERR_DEPRECATED',
1679
+ 'ERR_BAD_RESPONSE',
1680
+ 'ERR_BAD_REQUEST',
1681
+ 'ERR_CANCELED'
1682
+ // eslint-disable-next-line func-names
1683
+ ].forEach(function(code) {
1684
+ descriptors[code] = {value: code};
1685
+ });
1686
+
1687
+ Object.defineProperties(AxiosError, descriptors);
1688
+ Object.defineProperty(prototype, 'isAxiosError', {value: true});
1689
+
1690
+ // eslint-disable-next-line func-names
1691
+ AxiosError.from = function(error, code, config, request, response, customProps) {
1692
+ var axiosError = Object.create(prototype);
1693
+
1694
+ utils.toFlatObject(error, axiosError, function filter(obj) {
1695
+ return obj !== Error.prototype;
1696
+ });
1697
+
1698
+ AxiosError.call(axiosError, error.message, code, config, request, response);
1699
+
1700
+ axiosError.name = error.name;
1701
+
1702
+ customProps && Object.assign(axiosError, customProps);
1703
+
1704
+ return axiosError;
1705
+ };
1706
+
1707
+ var AxiosError_1 = AxiosError;
1708
+
1709
+ var transitional = {
1710
+ silentJSONParsing: true,
1711
+ forcedJSONParsing: true,
1712
+ clarifyTimeoutError: false
1713
+ };
1714
+ transitional.silentJSONParsing;
1715
+ transitional.forcedJSONParsing;
1716
+ transitional.clarifyTimeoutError;
266
1717
 
267
- // Force an array if not already something iterable
268
- if (typeof obj !== 'object') {
269
- /*eslint no-param-reassign:0*/
270
- obj = [obj];
271
- }
1718
+ /**
1719
+ * Convert a data object to FormData
1720
+ * @param {Object} obj
1721
+ * @param {?Object} [formData]
1722
+ * @returns {Object}
1723
+ **/
272
1724
 
273
- if (isArray(obj)) {
274
- // Iterate over array values
275
- for (var i = 0, l = obj.length; i < l; i++) {
276
- fn.call(null, obj[i], i, obj);
1725
+ function toFormData(obj, formData) {
1726
+ // eslint-disable-next-line no-param-reassign
1727
+ formData = formData || new FormData();
1728
+
1729
+ var stack = [];
1730
+
1731
+ function convertValue(value) {
1732
+ if (value === null) return '';
1733
+
1734
+ if (utils.isDate(value)) {
1735
+ return value.toISOString();
277
1736
  }
278
- } else {
279
- // Iterate over object keys
280
- for (var key in obj) {
281
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
282
- fn.call(null, obj[key], key, obj);
283
- }
1737
+
1738
+ if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
1739
+ return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
284
1740
  }
1741
+
1742
+ return value;
285
1743
  }
286
- }
287
1744
 
288
- /**
289
- * Accepts varargs expecting each argument to be an object, then
290
- * immutably merges the properties of each object and returns result.
291
- *
292
- * When multiple objects contain the same key the later object in
293
- * the arguments list will take precedence.
294
- *
295
- * Example:
296
- *
297
- * ```js
298
- * var result = merge({foo: 123}, {foo: 456});
299
- * console.log(result.foo); // outputs 456
300
- * ```
301
- *
302
- * @param {Object} obj1 Object to merge
303
- * @returns {Object} Result of all merge properties
304
- */
305
- function merge(/* obj1, obj2, obj3, ... */) {
306
- var result = {};
307
- function assignValue(val, key) {
308
- if (isPlainObject(result[key]) && isPlainObject(val)) {
309
- result[key] = merge(result[key], val);
310
- } else if (isPlainObject(val)) {
311
- result[key] = merge({}, val);
312
- } else if (isArray(val)) {
313
- result[key] = val.slice();
1745
+ function build(data, parentKey) {
1746
+ if (utils.isPlainObject(data) || utils.isArray(data)) {
1747
+ if (stack.indexOf(data) !== -1) {
1748
+ throw Error('Circular reference detected in ' + parentKey);
1749
+ }
1750
+
1751
+ stack.push(data);
1752
+
1753
+ utils.forEach(data, function each(value, key) {
1754
+ if (utils.isUndefined(value)) return;
1755
+ var fullKey = parentKey ? parentKey + '.' + key : key;
1756
+ var arr;
1757
+
1758
+ if (value && !parentKey && typeof value === 'object') {
1759
+ if (utils.endsWith(key, '{}')) {
1760
+ // eslint-disable-next-line no-param-reassign
1761
+ value = JSON.stringify(value);
1762
+ } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
1763
+ // eslint-disable-next-line func-names
1764
+ arr.forEach(function(el) {
1765
+ !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
1766
+ });
1767
+ return;
1768
+ }
1769
+ }
1770
+
1771
+ build(value, fullKey);
1772
+ });
1773
+
1774
+ stack.pop();
314
1775
  } else {
315
- result[key] = val;
1776
+ formData.append(parentKey, convertValue(data));
316
1777
  }
317
1778
  }
318
1779
 
319
- for (var i = 0, l = arguments.length; i < l; i++) {
320
- forEach(arguments[i], assignValue);
321
- }
322
- return result;
323
- }
1780
+ build(obj);
324
1781
 
325
- /**
326
- * Extends object a by mutably adding to it the properties of object b.
327
- *
328
- * @param {Object} a The object to be extended
329
- * @param {Object} b The object to copy properties from
330
- * @param {Object} thisArg The object to bind function to
331
- * @return {Object} The resulting value of object a
332
- */
333
- function extend(a, b, thisArg) {
334
- forEach(b, function assignValue(val, key) {
335
- if (thisArg && typeof val === 'function') {
336
- a[key] = bind(val, thisArg);
337
- } else {
338
- a[key] = val;
339
- }
340
- });
341
- return a;
1782
+ return formData;
342
1783
  }
343
1784
 
1785
+ var toFormData_1 = toFormData;
1786
+
344
1787
  /**
345
- * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
1788
+ * Resolve or reject a Promise based on response status.
346
1789
  *
347
- * @param {string} content with BOM
348
- * @return {string} content value without BOM
1790
+ * @param {Function} resolve A function that resolves the promise.
1791
+ * @param {Function} reject A function that rejects the promise.
1792
+ * @param {object} response The response.
349
1793
  */
350
- function stripBOM(content) {
351
- if (content.charCodeAt(0) === 0xFEFF) {
352
- content = content.slice(1);
1794
+ var settle = function settle(resolve, reject, response) {
1795
+ var validateStatus = response.config.validateStatus;
1796
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
1797
+ resolve(response);
1798
+ } else {
1799
+ reject(new AxiosError_1(
1800
+ 'Request failed with status code ' + response.status,
1801
+ [AxiosError_1.ERR_BAD_REQUEST, AxiosError_1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
1802
+ response.config,
1803
+ response.request,
1804
+ response
1805
+ ));
353
1806
  }
354
- return content;
355
- }
1807
+ };
356
1808
 
357
- /**
358
- * Inherit the prototype methods from one constructor into another
359
- * @param {function} constructor
360
- * @param {function} superConstructor
361
- * @param {object} [props]
362
- * @param {object} [descriptors]
363
- */
1809
+ var cookies = (
1810
+ utils.isStandardBrowserEnv() ?
364
1811
 
365
- function inherits(constructor, superConstructor, props, descriptors) {
366
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
367
- constructor.prototype.constructor = constructor;
368
- props && Object.assign(constructor.prototype, props);
369
- }
1812
+ // Standard browser envs support document.cookie
1813
+ (function standardBrowserEnv() {
1814
+ return {
1815
+ write: function write(name, value, expires, path, domain, secure) {
1816
+ var cookie = [];
1817
+ cookie.push(name + '=' + encodeURIComponent(value));
370
1818
 
371
- /**
372
- * Resolve object with deep prototype chain to a flat object
373
- * @param {Object} sourceObj source object
374
- * @param {Object} [destObj]
375
- * @param {Function} [filter]
376
- * @returns {Object}
377
- */
1819
+ if (utils.isNumber(expires)) {
1820
+ cookie.push('expires=' + new Date(expires).toGMTString());
1821
+ }
378
1822
 
379
- function toFlatObject(sourceObj, destObj, filter) {
380
- var props;
381
- var i;
382
- var prop;
383
- var merged = {};
1823
+ if (utils.isString(path)) {
1824
+ cookie.push('path=' + path);
1825
+ }
384
1826
 
385
- destObj = destObj || {};
1827
+ if (utils.isString(domain)) {
1828
+ cookie.push('domain=' + domain);
1829
+ }
386
1830
 
387
- do {
388
- props = Object.getOwnPropertyNames(sourceObj);
389
- i = props.length;
390
- while (i-- > 0) {
391
- prop = props[i];
392
- if (!merged[prop]) {
393
- destObj[prop] = sourceObj[prop];
394
- merged[prop] = true;
395
- }
396
- }
397
- sourceObj = Object.getPrototypeOf(sourceObj);
398
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
1831
+ if (secure === true) {
1832
+ cookie.push('secure');
1833
+ }
399
1834
 
400
- return destObj;
401
- }
1835
+ document.cookie = cookie.join('; ');
1836
+ },
402
1837
 
403
- /*
404
- * determines whether a string ends with the characters of a specified string
405
- * @param {String} str
406
- * @param {String} searchString
407
- * @param {Number} [position= 0]
408
- * @returns {boolean}
1838
+ read: function read(name) {
1839
+ var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
1840
+ return (match ? decodeURIComponent(match[3]) : null);
1841
+ },
1842
+
1843
+ remove: function remove(name) {
1844
+ this.write(name, '', Date.now() - 86400000);
1845
+ }
1846
+ };
1847
+ })() :
1848
+
1849
+ // Non standard browser env (web workers, react-native) lack needed support.
1850
+ (function nonStandardBrowserEnv() {
1851
+ return {
1852
+ write: function write() {},
1853
+ read: function read() { return null; },
1854
+ remove: function remove() {}
1855
+ };
1856
+ })()
1857
+ );
1858
+
1859
+ /**
1860
+ * Determines whether the specified URL is absolute
1861
+ *
1862
+ * @param {string} url The URL to test
1863
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
409
1864
  */
410
- function endsWith(str, searchString, position) {
411
- str = String(str);
412
- if (position === undefined || position > str.length) {
413
- position = str.length;
414
- }
415
- position -= searchString.length;
416
- var lastIndex = str.indexOf(searchString, position);
417
- return lastIndex !== -1 && lastIndex === position;
418
- }
1865
+ var isAbsoluteURL = function isAbsoluteURL(url) {
1866
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
1867
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
1868
+ // by any combination of letters, digits, plus, period, or hyphen.
1869
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
1870
+ };
419
1871
 
1872
+ /**
1873
+ * Creates a new URL by combining the specified URLs
1874
+ *
1875
+ * @param {string} baseURL The base URL
1876
+ * @param {string} relativeURL The relative URL
1877
+ * @returns {string} The combined URL
1878
+ */
1879
+ var combineURLs = function combineURLs(baseURL, relativeURL) {
1880
+ return relativeURL
1881
+ ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
1882
+ : baseURL;
1883
+ };
420
1884
 
421
1885
  /**
422
- * Returns new array from array like object
423
- * @param {*} [thing]
424
- * @returns {Array}
1886
+ * Creates a new URL by combining the baseURL with the requestedURL,
1887
+ * only when the requestedURL is not already an absolute URL.
1888
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
1889
+ *
1890
+ * @param {string} baseURL The base URL
1891
+ * @param {string} requestedURL Absolute or relative URL to combine
1892
+ * @returns {string} The combined full path
425
1893
  */
426
- function toArray(thing) {
427
- if (!thing) return null;
428
- var i = thing.length;
429
- if (isUndefined(i)) return null;
430
- var arr = new Array(i);
431
- while (i-- > 0) {
432
- arr[i] = thing[i];
1894
+ var buildFullPath = function buildFullPath(baseURL, requestedURL) {
1895
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
1896
+ return combineURLs(baseURL, requestedURL);
433
1897
  }
434
- return arr;
435
- }
436
-
437
- // eslint-disable-next-line func-names
438
- var isTypedArray = (function(TypedArray) {
439
- // eslint-disable-next-line func-names
440
- return function(thing) {
441
- return TypedArray && thing instanceof TypedArray;
442
- };
443
- })(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
444
-
445
- var utils = {
446
- isArray: isArray,
447
- isArrayBuffer: isArrayBuffer,
448
- isBuffer: isBuffer,
449
- isFormData: isFormData,
450
- isArrayBufferView: isArrayBufferView,
451
- isString: isString,
452
- isNumber: isNumber,
453
- isObject: isObject,
454
- isPlainObject: isPlainObject,
455
- isUndefined: isUndefined,
456
- isDate: isDate,
457
- isFile: isFile,
458
- isBlob: isBlob,
459
- isFunction: isFunction,
460
- isStream: isStream,
461
- isURLSearchParams: isURLSearchParams,
462
- isStandardBrowserEnv: isStandardBrowserEnv,
463
- forEach: forEach,
464
- merge: merge,
465
- extend: extend,
466
- trim: trim,
467
- stripBOM: stripBOM,
468
- inherits: inherits,
469
- toFlatObject: toFlatObject,
470
- kindOf: kindOf,
471
- kindOfTest: kindOfTest,
472
- endsWith: endsWith,
473
- toArray: toArray,
474
- isTypedArray: isTypedArray,
475
- isFileList: isFileList
1898
+ return requestedURL;
476
1899
  };
477
1900
 
478
- function encode(val) {
479
- return encodeURIComponent(val).
480
- replace(/%3A/gi, ':').
481
- replace(/%24/g, '$').
482
- replace(/%2C/gi, ',').
483
- replace(/%20/g, '+').
484
- replace(/%5B/gi, '[').
485
- replace(/%5D/gi, ']');
486
- }
1901
+ // Headers whose duplicates are ignored by node
1902
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
1903
+ var ignoreDuplicateOf = [
1904
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
1905
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
1906
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
1907
+ 'referer', 'retry-after', 'user-agent'
1908
+ ];
487
1909
 
488
1910
  /**
489
- * Build a URL by appending params to the end
1911
+ * Parse headers into an object
490
1912
  *
491
- * @param {string} url The base of the url (e.g., http://www.google.com)
492
- * @param {object} [params] The params to be appended
493
- * @returns {string} The formatted url
1913
+ * ```
1914
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
1915
+ * Content-Type: application/json
1916
+ * Connection: keep-alive
1917
+ * Transfer-Encoding: chunked
1918
+ * ```
1919
+ *
1920
+ * @param {String} headers Headers needing to be parsed
1921
+ * @returns {Object} Headers parsed into an object
494
1922
  */
495
- var buildURL = function buildURL(url, params, paramsSerializer) {
496
- /*eslint no-param-reassign:0*/
497
- if (!params) {
498
- return url;
499
- }
1923
+ var parseHeaders = function parseHeaders(headers) {
1924
+ var parsed = {};
1925
+ var key;
1926
+ var val;
1927
+ var i;
500
1928
 
501
- var serializedParams;
502
- if (paramsSerializer) {
503
- serializedParams = paramsSerializer(params);
504
- } else if (utils.isURLSearchParams(params)) {
505
- serializedParams = params.toString();
506
- } else {
507
- var parts = [];
1929
+ if (!headers) { return parsed; }
508
1930
 
509
- utils.forEach(params, function serialize(val, key) {
510
- if (val === null || typeof val === 'undefined') {
1931
+ utils.forEach(headers.split('\n'), function parser(line) {
1932
+ i = line.indexOf(':');
1933
+ key = utils.trim(line.substr(0, i)).toLowerCase();
1934
+ val = utils.trim(line.substr(i + 1));
1935
+
1936
+ if (key) {
1937
+ if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
511
1938
  return;
512
1939
  }
513
-
514
- if (utils.isArray(val)) {
515
- key = key + '[]';
1940
+ if (key === 'set-cookie') {
1941
+ parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
516
1942
  } else {
517
- val = [val];
1943
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
518
1944
  }
1945
+ }
1946
+ });
519
1947
 
520
- utils.forEach(val, function parseValue(v) {
521
- if (utils.isDate(v)) {
522
- v = v.toISOString();
523
- } else if (utils.isObject(v)) {
524
- v = JSON.stringify(v);
1948
+ return parsed;
1949
+ };
1950
+
1951
+ var isURLSameOrigin = (
1952
+ utils.isStandardBrowserEnv() ?
1953
+
1954
+ // Standard browser envs have full support of the APIs needed to test
1955
+ // whether the request URL is of the same origin as current location.
1956
+ (function standardBrowserEnv() {
1957
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
1958
+ var urlParsingNode = document.createElement('a');
1959
+ var originURL;
1960
+
1961
+ /**
1962
+ * Parse a URL to discover it's components
1963
+ *
1964
+ * @param {String} url The URL to be parsed
1965
+ * @returns {Object}
1966
+ */
1967
+ function resolveURL(url) {
1968
+ var href = url;
1969
+
1970
+ if (msie) {
1971
+ // IE needs attribute set twice to normalize properties
1972
+ urlParsingNode.setAttribute('href', href);
1973
+ href = urlParsingNode.href;
525
1974
  }
526
- parts.push(encode(key) + '=' + encode(v));
527
- });
528
- });
529
1975
 
530
- serializedParams = parts.join('&');
531
- }
1976
+ urlParsingNode.setAttribute('href', href);
532
1977
 
533
- if (serializedParams) {
534
- var hashmarkIndex = url.indexOf('#');
535
- if (hashmarkIndex !== -1) {
536
- url = url.slice(0, hashmarkIndex);
537
- }
1978
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
1979
+ return {
1980
+ href: urlParsingNode.href,
1981
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
1982
+ host: urlParsingNode.host,
1983
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
1984
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
1985
+ hostname: urlParsingNode.hostname,
1986
+ port: urlParsingNode.port,
1987
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
1988
+ urlParsingNode.pathname :
1989
+ '/' + urlParsingNode.pathname
1990
+ };
1991
+ }
538
1992
 
539
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
540
- }
1993
+ originURL = resolveURL(window.location.href);
541
1994
 
542
- return url;
1995
+ /**
1996
+ * Determine if a URL shares the same origin as the current location
1997
+ *
1998
+ * @param {String} requestURL The URL to test
1999
+ * @returns {boolean} True if URL shares the same origin, otherwise false
2000
+ */
2001
+ return function isURLSameOrigin(requestURL) {
2002
+ var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2003
+ return (parsed.protocol === originURL.protocol &&
2004
+ parsed.host === originURL.host);
2005
+ };
2006
+ })() :
2007
+
2008
+ // Non standard browser envs (web workers, react-native) lack needed support.
2009
+ (function nonStandardBrowserEnv() {
2010
+ return function isURLSameOrigin() {
2011
+ return true;
2012
+ };
2013
+ })()
2014
+ );
2015
+
2016
+ var global$1 = (typeof global !== "undefined" ? global :
2017
+ typeof self !== "undefined" ? self :
2018
+ typeof window !== "undefined" ? window : {});
2019
+
2020
+ /*! https://mths.be/punycode v1.4.1 by @mathias */
2021
+
2022
+
2023
+ /** Highest positive signed 32-bit float value */
2024
+ var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
2025
+
2026
+ /** Bootstring parameters */
2027
+ var base = 36;
2028
+ var tMin = 1;
2029
+ var tMax = 26;
2030
+ var skew = 38;
2031
+ var damp = 700;
2032
+ var initialBias = 72;
2033
+ var initialN = 128; // 0x80
2034
+ var delimiter = '-'; // '\x2D'
2035
+ var regexNonASCII = /[^\x20-\x7E]/; // unprintable ASCII chars + non-ASCII chars
2036
+ var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
2037
+
2038
+ /** Error messages */
2039
+ var errors = {
2040
+ 'overflow': 'Overflow: input needs wider integers to process',
2041
+ 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
2042
+ 'invalid-input': 'Invalid input'
543
2043
  };
544
2044
 
545
- function InterceptorManager() {
546
- this.handlers = [];
2045
+ /** Convenience shortcuts */
2046
+ var baseMinusTMin = base - tMin;
2047
+ var floor = Math.floor;
2048
+ var stringFromCharCode = String.fromCharCode;
2049
+
2050
+ /*--------------------------------------------------------------------------*/
2051
+
2052
+ /**
2053
+ * A generic error utility function.
2054
+ * @private
2055
+ * @param {String} type The error type.
2056
+ * @returns {Error} Throws a `RangeError` with the applicable error message.
2057
+ */
2058
+ function error(type) {
2059
+ throw new RangeError(errors[type]);
547
2060
  }
548
2061
 
549
2062
  /**
550
- * Add a new interceptor to the stack
551
- *
552
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
553
- * @param {Function} rejected The function to handle `reject` for a `Promise`
554
- *
555
- * @return {Number} An ID used to remove interceptor later
2063
+ * A generic `Array#map` utility function.
2064
+ * @private
2065
+ * @param {Array} array The array to iterate over.
2066
+ * @param {Function} callback The function that gets called for every array
2067
+ * item.
2068
+ * @returns {Array} A new array of values returned by the callback function.
556
2069
  */
557
- InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
558
- this.handlers.push({
559
- fulfilled: fulfilled,
560
- rejected: rejected,
561
- synchronous: options ? options.synchronous : false,
562
- runWhen: options ? options.runWhen : null
563
- });
564
- return this.handlers.length - 1;
565
- };
2070
+ function map$1(array, fn) {
2071
+ var length = array.length;
2072
+ var result = [];
2073
+ while (length--) {
2074
+ result[length] = fn(array[length]);
2075
+ }
2076
+ return result;
2077
+ }
2078
+
2079
+ /**
2080
+ * A simple `Array#map`-like wrapper to work with domain name strings or email
2081
+ * addresses.
2082
+ * @private
2083
+ * @param {String} domain The domain name or email address.
2084
+ * @param {Function} callback The function that gets called for every
2085
+ * character.
2086
+ * @returns {Array} A new string of characters returned by the callback
2087
+ * function.
2088
+ */
2089
+ function mapDomain(string, fn) {
2090
+ var parts = string.split('@');
2091
+ var result = '';
2092
+ if (parts.length > 1) {
2093
+ // In email addresses, only the domain name should be punycoded. Leave
2094
+ // the local part (i.e. everything up to `@`) intact.
2095
+ result = parts[0] + '@';
2096
+ string = parts[1];
2097
+ }
2098
+ // Avoid `split(regex)` for IE8 compatibility. See #17.
2099
+ string = string.replace(regexSeparators, '\x2E');
2100
+ var labels = string.split('.');
2101
+ var encoded = map$1(labels, fn).join('.');
2102
+ return result + encoded;
2103
+ }
2104
+
2105
+ /**
2106
+ * Creates an array containing the numeric code points of each Unicode
2107
+ * character in the string. While JavaScript uses UCS-2 internally,
2108
+ * this function will convert a pair of surrogate halves (each of which
2109
+ * UCS-2 exposes as separate characters) into a single code point,
2110
+ * matching UTF-16.
2111
+ * @see `punycode.ucs2.encode`
2112
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
2113
+ * @memberOf punycode.ucs2
2114
+ * @name decode
2115
+ * @param {String} string The Unicode input string (UCS-2).
2116
+ * @returns {Array} The new array of code points.
2117
+ */
2118
+ function ucs2decode(string) {
2119
+ var output = [],
2120
+ counter = 0,
2121
+ length = string.length,
2122
+ value,
2123
+ extra;
2124
+ while (counter < length) {
2125
+ value = string.charCodeAt(counter++);
2126
+ if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
2127
+ // high surrogate, and there is a next character
2128
+ extra = string.charCodeAt(counter++);
2129
+ if ((extra & 0xFC00) == 0xDC00) { // low surrogate
2130
+ output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
2131
+ } else {
2132
+ // unmatched surrogate; only append this code unit, in case the next
2133
+ // code unit is the high surrogate of a surrogate pair
2134
+ output.push(value);
2135
+ counter--;
2136
+ }
2137
+ } else {
2138
+ output.push(value);
2139
+ }
2140
+ }
2141
+ return output;
2142
+ }
566
2143
 
567
2144
  /**
568
- * Remove an interceptor from the stack
569
- *
570
- * @param {Number} id The ID that was returned by `use`
2145
+ * Converts a digit/integer into a basic code point.
2146
+ * @see `basicToDigit()`
2147
+ * @private
2148
+ * @param {Number} digit The numeric value of a basic code point.
2149
+ * @returns {Number} The basic code point whose value (when used for
2150
+ * representing integers) is `digit`, which needs to be in the range
2151
+ * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
2152
+ * used; else, the lowercase form is used. The behavior is undefined
2153
+ * if `flag` is non-zero and `digit` has no uppercase form.
571
2154
  */
572
- InterceptorManager.prototype.eject = function eject(id) {
573
- if (this.handlers[id]) {
574
- this.handlers[id] = null;
2155
+ function digitToBasic(digit, flag) {
2156
+ // 0..25 map to ASCII a..z or A..Z
2157
+ // 26..35 map to ASCII 0..9
2158
+ return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
2159
+ }
2160
+
2161
+ /**
2162
+ * Bias adaptation function as per section 3.4 of RFC 3492.
2163
+ * https://tools.ietf.org/html/rfc3492#section-3.4
2164
+ * @private
2165
+ */
2166
+ function adapt(delta, numPoints, firstTime) {
2167
+ var k = 0;
2168
+ delta = firstTime ? floor(delta / damp) : delta >> 1;
2169
+ delta += floor(delta / numPoints);
2170
+ for ( /* no initialization */ ; delta > baseMinusTMin * tMax >> 1; k += base) {
2171
+ delta = floor(delta / baseMinusTMin);
575
2172
  }
576
- };
2173
+ return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
2174
+ }
577
2175
 
578
2176
  /**
579
- * Iterate over all the registered interceptors
580
- *
581
- * This method is particularly useful for skipping over any
582
- * interceptors that may have become `null` calling `eject`.
583
- *
584
- * @param {Function} fn The function to call for each interceptor
2177
+ * Converts a string of Unicode symbols (e.g. a domain name label) to a
2178
+ * Punycode string of ASCII-only symbols.
2179
+ * @memberOf punycode
2180
+ * @param {String} input The string of Unicode symbols.
2181
+ * @returns {String} The resulting Punycode string of ASCII-only symbols.
585
2182
  */
586
- InterceptorManager.prototype.forEach = function forEach(fn) {
587
- utils.forEach(this.handlers, function forEachHandler(h) {
588
- if (h !== null) {
589
- fn(h);
2183
+ function encode(input) {
2184
+ var n,
2185
+ delta,
2186
+ handledCPCount,
2187
+ basicLength,
2188
+ bias,
2189
+ j,
2190
+ m,
2191
+ q,
2192
+ k,
2193
+ t,
2194
+ currentValue,
2195
+ output = [],
2196
+ /** `inputLength` will hold the number of code points in `input`. */
2197
+ inputLength,
2198
+ /** Cached calculation results */
2199
+ handledCPCountPlusOne,
2200
+ baseMinusT,
2201
+ qMinusT;
2202
+
2203
+ // Convert the input in UCS-2 to Unicode
2204
+ input = ucs2decode(input);
2205
+
2206
+ // Cache the length
2207
+ inputLength = input.length;
2208
+
2209
+ // Initialize the state
2210
+ n = initialN;
2211
+ delta = 0;
2212
+ bias = initialBias;
2213
+
2214
+ // Handle the basic code points
2215
+ for (j = 0; j < inputLength; ++j) {
2216
+ currentValue = input[j];
2217
+ if (currentValue < 0x80) {
2218
+ output.push(stringFromCharCode(currentValue));
590
2219
  }
591
- });
592
- };
2220
+ }
593
2221
 
594
- var InterceptorManager_1 = InterceptorManager;
2222
+ handledCPCount = basicLength = output.length;
595
2223
 
596
- var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
597
- utils.forEach(headers, function processHeader(value, name) {
598
- if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
599
- headers[normalizedName] = value;
600
- delete headers[name];
2224
+ // `handledCPCount` is the number of code points that have been handled;
2225
+ // `basicLength` is the number of basic code points.
2226
+
2227
+ // Finish the basic string - if it is not empty - with a delimiter
2228
+ if (basicLength) {
2229
+ output.push(delimiter);
2230
+ }
2231
+
2232
+ // Main encoding loop:
2233
+ while (handledCPCount < inputLength) {
2234
+
2235
+ // All non-basic code points < n have been handled already. Find the next
2236
+ // larger one:
2237
+ for (m = maxInt, j = 0; j < inputLength; ++j) {
2238
+ currentValue = input[j];
2239
+ if (currentValue >= n && currentValue < m) {
2240
+ m = currentValue;
2241
+ }
601
2242
  }
602
- });
603
- };
2243
+
2244
+ // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
2245
+ // but guard against overflow
2246
+ handledCPCountPlusOne = handledCPCount + 1;
2247
+ if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
2248
+ error('overflow');
2249
+ }
2250
+
2251
+ delta += (m - n) * handledCPCountPlusOne;
2252
+ n = m;
2253
+
2254
+ for (j = 0; j < inputLength; ++j) {
2255
+ currentValue = input[j];
2256
+
2257
+ if (currentValue < n && ++delta > maxInt) {
2258
+ error('overflow');
2259
+ }
2260
+
2261
+ if (currentValue == n) {
2262
+ // Represent delta as a generalized variable-length integer
2263
+ for (q = delta, k = base; /* no condition */ ; k += base) {
2264
+ t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
2265
+ if (q < t) {
2266
+ break;
2267
+ }
2268
+ qMinusT = q - t;
2269
+ baseMinusT = base - t;
2270
+ output.push(
2271
+ stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
2272
+ );
2273
+ q = floor(qMinusT / baseMinusT);
2274
+ }
2275
+
2276
+ output.push(stringFromCharCode(digitToBasic(q, 0)));
2277
+ bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
2278
+ delta = 0;
2279
+ ++handledCPCount;
2280
+ }
2281
+ }
2282
+
2283
+ ++delta;
2284
+ ++n;
2285
+
2286
+ }
2287
+ return output.join('');
2288
+ }
604
2289
 
605
2290
  /**
606
- * Create an Error with the specified message, config, error code, request and response.
607
- *
608
- * @param {string} message The error message.
609
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
610
- * @param {Object} [config] The config.
611
- * @param {Object} [request] The request.
612
- * @param {Object} [response] The response.
613
- * @returns {Error} The created error.
2291
+ * Converts a Unicode string representing a domain name or an email address to
2292
+ * Punycode. Only the non-ASCII parts of the domain name will be converted,
2293
+ * i.e. it doesn't matter if you call it with a domain that's already in
2294
+ * ASCII.
2295
+ * @memberOf punycode
2296
+ * @param {String} input The domain name or email address to convert, as a
2297
+ * Unicode string.
2298
+ * @returns {String} The Punycode representation of the given domain name or
2299
+ * email address.
614
2300
  */
615
- function AxiosError(message, code, config, request, response) {
616
- Error.call(this);
617
- this.message = message;
618
- this.name = 'AxiosError';
619
- code && (this.code = code);
620
- config && (this.config = config);
621
- request && (this.request = request);
622
- response && (this.response = response);
2301
+ function toASCII(input) {
2302
+ return mapDomain(input, function(string) {
2303
+ return regexNonASCII.test(string) ?
2304
+ 'xn--' + encode(string) :
2305
+ string;
2306
+ });
623
2307
  }
624
2308
 
625
- utils.inherits(AxiosError, Error, {
626
- toJSON: function toJSON() {
627
- return {
628
- // Standard
629
- message: this.message,
630
- name: this.name,
631
- // Microsoft
632
- description: this.description,
633
- number: this.number,
634
- // Mozilla
635
- fileName: this.fileName,
636
- lineNumber: this.lineNumber,
637
- columnNumber: this.columnNumber,
638
- stack: this.stack,
639
- // Axios
640
- config: this.config,
641
- code: this.code,
642
- status: this.response && this.response.status ? this.response.status : null
643
- };
644
- }
645
- });
2309
+ function isNull(arg) {
2310
+ return arg === null;
2311
+ }
646
2312
 
647
- var prototype = AxiosError.prototype;
648
- var descriptors = {};
2313
+ function isNullOrUndefined(arg) {
2314
+ return arg == null;
2315
+ }
649
2316
 
650
- [
651
- 'ERR_BAD_OPTION_VALUE',
652
- 'ERR_BAD_OPTION',
653
- 'ECONNABORTED',
654
- 'ETIMEDOUT',
655
- 'ERR_NETWORK',
656
- 'ERR_FR_TOO_MANY_REDIRECTS',
657
- 'ERR_DEPRECATED',
658
- 'ERR_BAD_RESPONSE',
659
- 'ERR_BAD_REQUEST',
660
- 'ERR_CANCELED'
661
- // eslint-disable-next-line func-names
662
- ].forEach(function(code) {
663
- descriptors[code] = {value: code};
664
- });
2317
+ function isString(arg) {
2318
+ return typeof arg === 'string';
2319
+ }
665
2320
 
666
- Object.defineProperties(AxiosError, descriptors);
667
- Object.defineProperty(prototype, 'isAxiosError', {value: true});
2321
+ function isObject(arg) {
2322
+ return typeof arg === 'object' && arg !== null;
2323
+ }
668
2324
 
669
- // eslint-disable-next-line func-names
670
- AxiosError.from = function(error, code, config, request, response, customProps) {
671
- var axiosError = Object.create(prototype);
2325
+ // Copyright Joyent, Inc. and other Node contributors.
2326
+ //
2327
+ // Permission is hereby granted, free of charge, to any person obtaining a
2328
+ // copy of this software and associated documentation files (the
2329
+ // "Software"), to deal in the Software without restriction, including
2330
+ // without limitation the rights to use, copy, modify, merge, publish,
2331
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
2332
+ // persons to whom the Software is furnished to do so, subject to the
2333
+ // following conditions:
2334
+ //
2335
+ // The above copyright notice and this permission notice shall be included
2336
+ // in all copies or substantial portions of the Software.
2337
+ //
2338
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2339
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2340
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2341
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2342
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2343
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2344
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
2345
+
2346
+
2347
+ // If obj.hasOwnProperty has been overridden, then calling
2348
+ // obj.hasOwnProperty(prop) will break.
2349
+ // See: https://github.com/joyent/node/issues/1707
2350
+ function hasOwnProperty(obj, prop) {
2351
+ return Object.prototype.hasOwnProperty.call(obj, prop);
2352
+ }
2353
+ var isArray = Array.isArray || function (xs) {
2354
+ return Object.prototype.toString.call(xs) === '[object Array]';
2355
+ };
2356
+ function stringifyPrimitive(v) {
2357
+ switch (typeof v) {
2358
+ case 'string':
2359
+ return v;
672
2360
 
673
- utils.toFlatObject(error, axiosError, function filter(obj) {
674
- return obj !== Error.prototype;
675
- });
2361
+ case 'boolean':
2362
+ return v ? 'true' : 'false';
676
2363
 
677
- AxiosError.call(axiosError, error.message, code, config, request, response);
2364
+ case 'number':
2365
+ return isFinite(v) ? v : '';
678
2366
 
679
- axiosError.name = error.name;
2367
+ default:
2368
+ return '';
2369
+ }
2370
+ }
680
2371
 
681
- customProps && Object.assign(axiosError, customProps);
2372
+ function stringify (obj, sep, eq, name) {
2373
+ sep = sep || '&';
2374
+ eq = eq || '=';
2375
+ if (obj === null) {
2376
+ obj = undefined;
2377
+ }
682
2378
 
683
- return axiosError;
684
- };
2379
+ if (typeof obj === 'object') {
2380
+ return map(objectKeys(obj), function(k) {
2381
+ var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
2382
+ if (isArray(obj[k])) {
2383
+ return map(obj[k], function(v) {
2384
+ return ks + encodeURIComponent(stringifyPrimitive(v));
2385
+ }).join(sep);
2386
+ } else {
2387
+ return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
2388
+ }
2389
+ }).join(sep);
685
2390
 
686
- var AxiosError_1 = AxiosError;
2391
+ }
687
2392
 
688
- var transitional = {
689
- silentJSONParsing: true,
690
- forcedJSONParsing: true,
691
- clarifyTimeoutError: false
2393
+ if (!name) return '';
2394
+ return encodeURIComponent(stringifyPrimitive(name)) + eq +
2395
+ encodeURIComponent(stringifyPrimitive(obj));
2396
+ }
2397
+ function map (xs, f) {
2398
+ if (xs.map) return xs.map(f);
2399
+ var res = [];
2400
+ for (var i = 0; i < xs.length; i++) {
2401
+ res.push(f(xs[i], i));
2402
+ }
2403
+ return res;
2404
+ }
2405
+
2406
+ var objectKeys = Object.keys || function (obj) {
2407
+ var res = [];
2408
+ for (var key in obj) {
2409
+ if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
2410
+ }
2411
+ return res;
692
2412
  };
693
- transitional.silentJSONParsing;
694
- transitional.forcedJSONParsing;
695
- transitional.clarifyTimeoutError;
696
2413
 
697
- /**
698
- * Convert a data object to FormData
699
- * @param {Object} obj
700
- * @param {?Object} [formData]
701
- * @returns {Object}
702
- **/
2414
+ function parse$1(qs, sep, eq, options) {
2415
+ sep = sep || '&';
2416
+ eq = eq || '=';
2417
+ var obj = {};
703
2418
 
704
- function toFormData(obj, formData) {
705
- // eslint-disable-next-line no-param-reassign
706
- formData = formData || new FormData();
2419
+ if (typeof qs !== 'string' || qs.length === 0) {
2420
+ return obj;
2421
+ }
707
2422
 
708
- var stack = [];
2423
+ var regexp = /\+/g;
2424
+ qs = qs.split(sep);
709
2425
 
710
- function convertValue(value) {
711
- if (value === null) return '';
2426
+ var maxKeys = 1000;
2427
+ if (options && typeof options.maxKeys === 'number') {
2428
+ maxKeys = options.maxKeys;
2429
+ }
712
2430
 
713
- if (utils.isDate(value)) {
714
- return value.toISOString();
2431
+ var len = qs.length;
2432
+ // maxKeys <= 0 means that we should not limit keys count
2433
+ if (maxKeys > 0 && len > maxKeys) {
2434
+ len = maxKeys;
2435
+ }
2436
+
2437
+ for (var i = 0; i < len; ++i) {
2438
+ var x = qs[i].replace(regexp, '%20'),
2439
+ idx = x.indexOf(eq),
2440
+ kstr, vstr, k, v;
2441
+
2442
+ if (idx >= 0) {
2443
+ kstr = x.substr(0, idx);
2444
+ vstr = x.substr(idx + 1);
2445
+ } else {
2446
+ kstr = x;
2447
+ vstr = '';
715
2448
  }
716
2449
 
717
- if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
718
- return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
2450
+ k = decodeURIComponent(kstr);
2451
+ v = decodeURIComponent(vstr);
2452
+
2453
+ if (!hasOwnProperty(obj, k)) {
2454
+ obj[k] = v;
2455
+ } else if (isArray(obj[k])) {
2456
+ obj[k].push(v);
2457
+ } else {
2458
+ obj[k] = [obj[k], v];
719
2459
  }
2460
+ }
720
2461
 
721
- return value;
2462
+ return obj;
2463
+ }
2464
+
2465
+ // WHATWG API
2466
+ const URL = global$1.URL;
2467
+ const URLSearchParams = global$1.URLSearchParams;
2468
+ var url = {
2469
+ parse: urlParse,
2470
+ resolve: urlResolve,
2471
+ resolveObject: urlResolveObject,
2472
+ fileURLToPath: urlFileURLToPath,
2473
+ format: urlFormat,
2474
+ Url: Url,
2475
+
2476
+ // WHATWG API
2477
+ URL,
2478
+ URLSearchParams,
2479
+ };
2480
+ function Url() {
2481
+ this.protocol = null;
2482
+ this.slashes = null;
2483
+ this.auth = null;
2484
+ this.host = null;
2485
+ this.port = null;
2486
+ this.hostname = null;
2487
+ this.hash = null;
2488
+ this.search = null;
2489
+ this.query = null;
2490
+ this.pathname = null;
2491
+ this.path = null;
2492
+ this.href = null;
2493
+ }
2494
+
2495
+ // Reference: RFC 3986, RFC 1808, RFC 2396
2496
+
2497
+ // define these here so at least they only have to be
2498
+ // compiled once on the first module load.
2499
+ var protocolPattern = /^([a-z0-9.+-]+:)/i,
2500
+ portPattern = /:[0-9]*$/,
2501
+
2502
+ // Special case for a simple path URL
2503
+ simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
2504
+
2505
+ // RFC 2396: characters reserved for delimiting URLs.
2506
+ // We actually just auto-escape these.
2507
+ delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
2508
+
2509
+ // RFC 2396: characters not allowed for various reasons.
2510
+ unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),
2511
+
2512
+ // Allowed by RFCs, but cause of XSS attacks. Always escape these.
2513
+ autoEscape = ['\''].concat(unwise),
2514
+ // Characters that are never ever allowed in a hostname.
2515
+ // Note that any invalid chars are also handled, but these
2516
+ // are the ones that are *expected* to be seen, so we fast-path
2517
+ // them.
2518
+ nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
2519
+ hostEndingChars = ['/', '?', '#'],
2520
+ hostnameMaxLen = 255,
2521
+ hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
2522
+ hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
2523
+ // protocols that can allow "unsafe" and "unwise" chars.
2524
+ unsafeProtocol = {
2525
+ 'javascript': true,
2526
+ 'javascript:': true
2527
+ },
2528
+ // protocols that never have a hostname.
2529
+ hostlessProtocol = {
2530
+ 'javascript': true,
2531
+ 'javascript:': true
2532
+ },
2533
+ // protocols that always contain a // bit.
2534
+ slashedProtocol = {
2535
+ 'http': true,
2536
+ 'https': true,
2537
+ 'ftp': true,
2538
+ 'gopher': true,
2539
+ 'file': true,
2540
+ 'http:': true,
2541
+ 'https:': true,
2542
+ 'ftp:': true,
2543
+ 'gopher:': true,
2544
+ 'file:': true
2545
+ };
2546
+
2547
+ function urlParse(url, parseQueryString, slashesDenoteHost) {
2548
+ if (url && isObject(url) && url instanceof Url) return url;
2549
+
2550
+ var u = new Url;
2551
+ u.parse(url, parseQueryString, slashesDenoteHost);
2552
+ return u;
2553
+ }
2554
+ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
2555
+ return parse(this, url, parseQueryString, slashesDenoteHost);
2556
+ };
2557
+
2558
+ function parse(self, url, parseQueryString, slashesDenoteHost) {
2559
+ if (!isString(url)) {
2560
+ throw new TypeError('Parameter \'url\' must be a string, not ' + typeof url);
722
2561
  }
723
2562
 
724
- function build(data, parentKey) {
725
- if (utils.isPlainObject(data) || utils.isArray(data)) {
726
- if (stack.indexOf(data) !== -1) {
727
- throw Error('Circular reference detected in ' + parentKey);
2563
+ // Copy chrome, IE, opera backslash-handling behavior.
2564
+ // Back slashes before the query string get converted to forward slashes
2565
+ // See: https://code.google.com/p/chromium/issues/detail?id=25916
2566
+ var queryIndex = url.indexOf('?'),
2567
+ splitter =
2568
+ (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',
2569
+ uSplit = url.split(splitter),
2570
+ slashRegex = /\\/g;
2571
+ uSplit[0] = uSplit[0].replace(slashRegex, '/');
2572
+ url = uSplit.join(splitter);
2573
+
2574
+ var rest = url;
2575
+
2576
+ // trim before proceeding.
2577
+ // This is to support parse stuff like " http://foo.com \n"
2578
+ rest = rest.trim();
2579
+
2580
+ if (!slashesDenoteHost && url.split('#').length === 1) {
2581
+ // Try fast path regexp
2582
+ var simplePath = simplePathPattern.exec(rest);
2583
+ if (simplePath) {
2584
+ self.path = rest;
2585
+ self.href = rest;
2586
+ self.pathname = simplePath[1];
2587
+ if (simplePath[2]) {
2588
+ self.search = simplePath[2];
2589
+ if (parseQueryString) {
2590
+ self.query = parse$1(self.search.substr(1));
2591
+ } else {
2592
+ self.query = self.search.substr(1);
2593
+ }
2594
+ } else if (parseQueryString) {
2595
+ self.search = '';
2596
+ self.query = {};
728
2597
  }
2598
+ return self;
2599
+ }
2600
+ }
729
2601
 
730
- stack.push(data);
2602
+ var proto = protocolPattern.exec(rest);
2603
+ if (proto) {
2604
+ proto = proto[0];
2605
+ var lowerProto = proto.toLowerCase();
2606
+ self.protocol = lowerProto;
2607
+ rest = rest.substr(proto.length);
2608
+ }
731
2609
 
732
- utils.forEach(data, function each(value, key) {
733
- if (utils.isUndefined(value)) return;
734
- var fullKey = parentKey ? parentKey + '.' + key : key;
735
- var arr;
2610
+ // figure out if it's got a host
2611
+ // user@server is *always* interpreted as a hostname, and url
2612
+ // resolution will treat //foo/bar as host=foo,path=bar because that's
2613
+ // how the browser resolves relative URLs.
2614
+ if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
2615
+ var slashes = rest.substr(0, 2) === '//';
2616
+ if (slashes && !(proto && hostlessProtocol[proto])) {
2617
+ rest = rest.substr(2);
2618
+ self.slashes = true;
2619
+ }
2620
+ }
2621
+ var i, hec, l, p;
2622
+ if (!hostlessProtocol[proto] &&
2623
+ (slashes || (proto && !slashedProtocol[proto]))) {
2624
+
2625
+ // there's a hostname.
2626
+ // the first instance of /, ?, ;, or # ends the host.
2627
+ //
2628
+ // If there is an @ in the hostname, then non-host chars *are* allowed
2629
+ // to the left of the last @ sign, unless some host-ending character
2630
+ // comes *before* the @-sign.
2631
+ // URLs are obnoxious.
2632
+ //
2633
+ // ex:
2634
+ // http://a@b@c/ => user:a@b host:c
2635
+ // http://a@b?@c => user:a host:c path:/?@c
2636
+
2637
+ // v0.12 TODO(isaacs): This is not quite how Chrome does things.
2638
+ // Review our test case against browsers more comprehensively.
2639
+
2640
+ // find the first instance of any hostEndingChars
2641
+ var hostEnd = -1;
2642
+ for (i = 0; i < hostEndingChars.length; i++) {
2643
+ hec = rest.indexOf(hostEndingChars[i]);
2644
+ if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
2645
+ hostEnd = hec;
2646
+ }
736
2647
 
737
- if (value && !parentKey && typeof value === 'object') {
738
- if (utils.endsWith(key, '{}')) {
739
- // eslint-disable-next-line no-param-reassign
740
- value = JSON.stringify(value);
741
- } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
742
- // eslint-disable-next-line func-names
743
- arr.forEach(function(el) {
744
- !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
745
- });
746
- return;
2648
+ // at this point, either we have an explicit point where the
2649
+ // auth portion cannot go past, or the last @ char is the decider.
2650
+ var auth, atSign;
2651
+ if (hostEnd === -1) {
2652
+ // atSign can be anywhere.
2653
+ atSign = rest.lastIndexOf('@');
2654
+ } else {
2655
+ // atSign must be in auth portion.
2656
+ // http://a@b/c@d => host:b auth:a path:/c@d
2657
+ atSign = rest.lastIndexOf('@', hostEnd);
2658
+ }
2659
+
2660
+ // Now we have a portion which is definitely the auth.
2661
+ // Pull that off.
2662
+ if (atSign !== -1) {
2663
+ auth = rest.slice(0, atSign);
2664
+ rest = rest.slice(atSign + 1);
2665
+ self.auth = decodeURIComponent(auth);
2666
+ }
2667
+
2668
+ // the host is the remaining to the left of the first non-host char
2669
+ hostEnd = -1;
2670
+ for (i = 0; i < nonHostChars.length; i++) {
2671
+ hec = rest.indexOf(nonHostChars[i]);
2672
+ if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
2673
+ hostEnd = hec;
2674
+ }
2675
+ // if we still have not hit it, then the entire thing is a host.
2676
+ if (hostEnd === -1)
2677
+ hostEnd = rest.length;
2678
+
2679
+ self.host = rest.slice(0, hostEnd);
2680
+ rest = rest.slice(hostEnd);
2681
+
2682
+ // pull out port.
2683
+ parseHost(self);
2684
+
2685
+ // we've indicated that there is a hostname,
2686
+ // so even if it's empty, it has to be present.
2687
+ self.hostname = self.hostname || '';
2688
+
2689
+ // if hostname begins with [ and ends with ]
2690
+ // assume that it's an IPv6 address.
2691
+ var ipv6Hostname = self.hostname[0] === '[' &&
2692
+ self.hostname[self.hostname.length - 1] === ']';
2693
+
2694
+ // validate a little.
2695
+ if (!ipv6Hostname) {
2696
+ var hostparts = self.hostname.split(/\./);
2697
+ for (i = 0, l = hostparts.length; i < l; i++) {
2698
+ var part = hostparts[i];
2699
+ if (!part) continue;
2700
+ if (!part.match(hostnamePartPattern)) {
2701
+ var newpart = '';
2702
+ for (var j = 0, k = part.length; j < k; j++) {
2703
+ if (part.charCodeAt(j) > 127) {
2704
+ // we replace non-ASCII char with a temporary placeholder
2705
+ // we need this to make sure size of hostname is not
2706
+ // broken by replacing non-ASCII by nothing
2707
+ newpart += 'x';
2708
+ } else {
2709
+ newpart += part[j];
2710
+ }
2711
+ }
2712
+ // we test again with ASCII char only
2713
+ if (!newpart.match(hostnamePartPattern)) {
2714
+ var validParts = hostparts.slice(0, i);
2715
+ var notHost = hostparts.slice(i + 1);
2716
+ var bit = part.match(hostnamePartStart);
2717
+ if (bit) {
2718
+ validParts.push(bit[1]);
2719
+ notHost.unshift(bit[2]);
2720
+ }
2721
+ if (notHost.length) {
2722
+ rest = '/' + notHost.join('.') + rest;
2723
+ }
2724
+ self.hostname = validParts.join('.');
2725
+ break;
747
2726
  }
748
2727
  }
2728
+ }
2729
+ }
749
2730
 
750
- build(value, fullKey);
751
- });
752
-
753
- stack.pop();
2731
+ if (self.hostname.length > hostnameMaxLen) {
2732
+ self.hostname = '';
754
2733
  } else {
755
- formData.append(parentKey, convertValue(data));
2734
+ // hostnames are always lower case.
2735
+ self.hostname = self.hostname.toLowerCase();
2736
+ }
2737
+
2738
+ if (!ipv6Hostname) {
2739
+ // IDNA Support: Returns a punycoded representation of "domain".
2740
+ // It only converts parts of the domain name that
2741
+ // have non-ASCII characters, i.e. it doesn't matter if
2742
+ // you call it with a domain that already is ASCII-only.
2743
+ self.hostname = toASCII(self.hostname);
2744
+ }
2745
+
2746
+ p = self.port ? ':' + self.port : '';
2747
+ var h = self.hostname || '';
2748
+ self.host = h + p;
2749
+ self.href += self.host;
2750
+
2751
+ // strip [ and ] from the hostname
2752
+ // the host field still retains them, though
2753
+ if (ipv6Hostname) {
2754
+ self.hostname = self.hostname.substr(1, self.hostname.length - 2);
2755
+ if (rest[0] !== '/') {
2756
+ rest = '/' + rest;
2757
+ }
756
2758
  }
757
2759
  }
758
2760
 
759
- build(obj);
2761
+ // now rest is set to the post-host stuff.
2762
+ // chop off any delim chars.
2763
+ if (!unsafeProtocol[lowerProto]) {
2764
+
2765
+ // First, make 100% sure that any "autoEscape" chars get
2766
+ // escaped, even if encodeURIComponent doesn't think they
2767
+ // need to be.
2768
+ for (i = 0, l = autoEscape.length; i < l; i++) {
2769
+ var ae = autoEscape[i];
2770
+ if (rest.indexOf(ae) === -1)
2771
+ continue;
2772
+ var esc = encodeURIComponent(ae);
2773
+ if (esc === ae) {
2774
+ esc = escape(ae);
2775
+ }
2776
+ rest = rest.split(ae).join(esc);
2777
+ }
2778
+ }
760
2779
 
761
- return formData;
2780
+
2781
+ // chop off from the tail first.
2782
+ var hash = rest.indexOf('#');
2783
+ if (hash !== -1) {
2784
+ // got a fragment string.
2785
+ self.hash = rest.substr(hash);
2786
+ rest = rest.slice(0, hash);
2787
+ }
2788
+ var qm = rest.indexOf('?');
2789
+ if (qm !== -1) {
2790
+ self.search = rest.substr(qm);
2791
+ self.query = rest.substr(qm + 1);
2792
+ if (parseQueryString) {
2793
+ self.query = parse$1(self.query);
2794
+ }
2795
+ rest = rest.slice(0, qm);
2796
+ } else if (parseQueryString) {
2797
+ // no query string, but parseQueryString still requested
2798
+ self.search = '';
2799
+ self.query = {};
2800
+ }
2801
+ if (rest) self.pathname = rest;
2802
+ if (slashedProtocol[lowerProto] &&
2803
+ self.hostname && !self.pathname) {
2804
+ self.pathname = '/';
2805
+ }
2806
+
2807
+ //to support http.request
2808
+ if (self.pathname || self.search) {
2809
+ p = self.pathname || '';
2810
+ var s = self.search || '';
2811
+ self.path = p + s;
2812
+ }
2813
+
2814
+ // finally, reconstruct the href based on what has been validated.
2815
+ self.href = format(self);
2816
+ return self;
2817
+ }
2818
+
2819
+ function urlFileURLToPath(path) {
2820
+ if (typeof path === 'string')
2821
+ path = new Url().parse(path);
2822
+ else if (!(path instanceof Url))
2823
+ throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type ' + (typeof path) + String(path));
2824
+ if (path.protocol !== 'file:')
2825
+ throw new TypeError('The URL must be of scheme file');
2826
+ return getPathFromURLPosix(path);
2827
+ }
2828
+
2829
+ function getPathFromURLPosix(url) {
2830
+ const pathname = url.pathname;
2831
+ for (let n = 0; n < pathname.length; n++) {
2832
+ if (pathname[n] === '%') {
2833
+ const third = pathname.codePointAt(n + 2) | 0x20;
2834
+ if (pathname[n + 1] === '2' && third === 102) {
2835
+ throw new TypeError(
2836
+ 'must not include encoded / characters'
2837
+ );
2838
+ }
2839
+ }
2840
+ }
2841
+ return decodeURIComponent(pathname);
762
2842
  }
763
2843
 
764
- var toFormData_1 = toFormData;
2844
+ // format a parsed object into a url string
2845
+ function urlFormat(obj) {
2846
+ // ensure it's an object, and not a string url.
2847
+ // If it's an obj, this is a no-op.
2848
+ // this way, you can call url_format() on strings
2849
+ // to clean up potentially wonky urls.
2850
+ if (isString(obj)) obj = parse({}, obj);
2851
+ return format(obj);
2852
+ }
765
2853
 
766
- /**
767
- * Resolve or reject a Promise based on response status.
768
- *
769
- * @param {Function} resolve A function that resolves the promise.
770
- * @param {Function} reject A function that rejects the promise.
771
- * @param {object} response The response.
772
- */
773
- var settle = function settle(resolve, reject, response) {
774
- var validateStatus = response.config.validateStatus;
775
- if (!response.status || !validateStatus || validateStatus(response.status)) {
776
- resolve(response);
777
- } else {
778
- reject(new AxiosError_1(
779
- 'Request failed with status code ' + response.status,
780
- [AxiosError_1.ERR_BAD_REQUEST, AxiosError_1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
781
- response.config,
782
- response.request,
783
- response
784
- ));
2854
+ function format(self) {
2855
+ var auth = self.auth || '';
2856
+ if (auth) {
2857
+ auth = encodeURIComponent(auth);
2858
+ auth = auth.replace(/%3A/i, ':');
2859
+ auth += '@';
785
2860
  }
786
- };
787
2861
 
788
- var cookies = (
789
- utils.isStandardBrowserEnv() ?
2862
+ var protocol = self.protocol || '',
2863
+ pathname = self.pathname || '',
2864
+ hash = self.hash || '',
2865
+ host = false,
2866
+ query = '';
2867
+
2868
+ if (self.host) {
2869
+ host = auth + self.host;
2870
+ } else if (self.hostname) {
2871
+ host = auth + (self.hostname.indexOf(':') === -1 ?
2872
+ self.hostname :
2873
+ '[' + this.hostname + ']');
2874
+ if (self.port) {
2875
+ host += ':' + self.port;
2876
+ }
2877
+ }
790
2878
 
791
- // Standard browser envs support document.cookie
792
- (function standardBrowserEnv() {
793
- return {
794
- write: function write(name, value, expires, path, domain, secure) {
795
- var cookie = [];
796
- cookie.push(name + '=' + encodeURIComponent(value));
2879
+ if (self.query &&
2880
+ isObject(self.query) &&
2881
+ Object.keys(self.query).length) {
2882
+ query = stringify(self.query);
2883
+ }
797
2884
 
798
- if (utils.isNumber(expires)) {
799
- cookie.push('expires=' + new Date(expires).toGMTString());
800
- }
2885
+ var search = self.search || (query && ('?' + query)) || '';
801
2886
 
802
- if (utils.isString(path)) {
803
- cookie.push('path=' + path);
804
- }
2887
+ if (protocol && protocol.substr(-1) !== ':') protocol += ':';
805
2888
 
806
- if (utils.isString(domain)) {
807
- cookie.push('domain=' + domain);
808
- }
2889
+ // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.
2890
+ // unless they had them to begin with.
2891
+ if (self.slashes ||
2892
+ (!protocol || slashedProtocol[protocol]) && host !== false) {
2893
+ host = '//' + (host || '');
2894
+ if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
2895
+ } else if (!host) {
2896
+ host = '';
2897
+ }
809
2898
 
810
- if (secure === true) {
811
- cookie.push('secure');
812
- }
2899
+ if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
2900
+ if (search && search.charAt(0) !== '?') search = '?' + search;
813
2901
 
814
- document.cookie = cookie.join('; ');
815
- },
2902
+ pathname = pathname.replace(/[?#]/g, function(match) {
2903
+ return encodeURIComponent(match);
2904
+ });
2905
+ search = search.replace('#', '%23');
816
2906
 
817
- read: function read(name) {
818
- var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
819
- return (match ? decodeURIComponent(match[3]) : null);
820
- },
2907
+ return protocol + host + pathname + search + hash;
2908
+ }
821
2909
 
822
- remove: function remove(name) {
823
- this.write(name, '', Date.now() - 86400000);
824
- }
825
- };
826
- })() :
2910
+ Url.prototype.format = function() {
2911
+ return format(this);
2912
+ };
827
2913
 
828
- // Non standard browser env (web workers, react-native) lack needed support.
829
- (function nonStandardBrowserEnv() {
830
- return {
831
- write: function write() {},
832
- read: function read() { return null; },
833
- remove: function remove() {}
834
- };
835
- })()
836
- );
2914
+ function urlResolve(source, relative) {
2915
+ return urlParse(source, false, true).resolve(relative);
2916
+ }
837
2917
 
838
- /**
839
- * Determines whether the specified URL is absolute
840
- *
841
- * @param {string} url The URL to test
842
- * @returns {boolean} True if the specified URL is absolute, otherwise false
843
- */
844
- var isAbsoluteURL = function isAbsoluteURL(url) {
845
- // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
846
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
847
- // by any combination of letters, digits, plus, period, or hyphen.
848
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2918
+ Url.prototype.resolve = function(relative) {
2919
+ return this.resolveObject(urlParse(relative, false, true)).format();
849
2920
  };
850
2921
 
851
- /**
852
- * Creates a new URL by combining the specified URLs
853
- *
854
- * @param {string} baseURL The base URL
855
- * @param {string} relativeURL The relative URL
856
- * @returns {string} The combined URL
857
- */
858
- var combineURLs = function combineURLs(baseURL, relativeURL) {
859
- return relativeURL
860
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
861
- : baseURL;
862
- };
2922
+ function urlResolveObject(source, relative) {
2923
+ if (!source) return relative;
2924
+ return urlParse(source, false, true).resolveObject(relative);
2925
+ }
863
2926
 
864
- /**
865
- * Creates a new URL by combining the baseURL with the requestedURL,
866
- * only when the requestedURL is not already an absolute URL.
867
- * If the requestURL is absolute, this function returns the requestedURL untouched.
868
- *
869
- * @param {string} baseURL The base URL
870
- * @param {string} requestedURL Absolute or relative URL to combine
871
- * @returns {string} The combined full path
872
- */
873
- var buildFullPath = function buildFullPath(baseURL, requestedURL) {
874
- if (baseURL && !isAbsoluteURL(requestedURL)) {
875
- return combineURLs(baseURL, requestedURL);
2927
+ Url.prototype.resolveObject = function(relative) {
2928
+ if (isString(relative)) {
2929
+ var rel = new Url();
2930
+ rel.parse(relative, false, true);
2931
+ relative = rel;
876
2932
  }
877
- return requestedURL;
878
- };
879
2933
 
880
- // Headers whose duplicates are ignored by node
881
- // c.f. https://nodejs.org/api/http.html#http_message_headers
882
- var ignoreDuplicateOf = [
883
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
884
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
885
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
886
- 'referer', 'retry-after', 'user-agent'
887
- ];
2934
+ var result = new Url();
2935
+ var tkeys = Object.keys(this);
2936
+ for (var tk = 0; tk < tkeys.length; tk++) {
2937
+ var tkey = tkeys[tk];
2938
+ result[tkey] = this[tkey];
2939
+ }
888
2940
 
889
- /**
890
- * Parse headers into an object
891
- *
892
- * ```
893
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
894
- * Content-Type: application/json
895
- * Connection: keep-alive
896
- * Transfer-Encoding: chunked
897
- * ```
898
- *
899
- * @param {String} headers Headers needing to be parsed
900
- * @returns {Object} Headers parsed into an object
901
- */
902
- var parseHeaders = function parseHeaders(headers) {
903
- var parsed = {};
904
- var key;
905
- var val;
906
- var i;
2941
+ // hash is always overridden, no matter what.
2942
+ // even href="" will remove it.
2943
+ result.hash = relative.hash;
907
2944
 
908
- if (!headers) { return parsed; }
2945
+ // if the relative url is empty, then there's nothing left to do here.
2946
+ if (relative.href === '') {
2947
+ result.href = result.format();
2948
+ return result;
2949
+ }
909
2950
 
910
- utils.forEach(headers.split('\n'), function parser(line) {
911
- i = line.indexOf(':');
912
- key = utils.trim(line.substr(0, i)).toLowerCase();
913
- val = utils.trim(line.substr(i + 1));
2951
+ // hrefs like //foo/bar always cut to the protocol.
2952
+ if (relative.slashes && !relative.protocol) {
2953
+ // take everything except the protocol from relative
2954
+ var rkeys = Object.keys(relative);
2955
+ for (var rk = 0; rk < rkeys.length; rk++) {
2956
+ var rkey = rkeys[rk];
2957
+ if (rkey !== 'protocol')
2958
+ result[rkey] = relative[rkey];
2959
+ }
914
2960
 
915
- if (key) {
916
- if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
917
- return;
2961
+ //urlParse appends trailing / to urls like http://www.example.com
2962
+ if (slashedProtocol[result.protocol] &&
2963
+ result.hostname && !result.pathname) {
2964
+ result.path = result.pathname = '/';
2965
+ }
2966
+
2967
+ result.href = result.format();
2968
+ return result;
2969
+ }
2970
+ var relPath;
2971
+ if (relative.protocol && relative.protocol !== result.protocol) {
2972
+ // if it's a known url protocol, then changing
2973
+ // the protocol does weird things
2974
+ // first, if it's not file:, then we MUST have a host,
2975
+ // and if there was a path
2976
+ // to begin with, then we MUST have a path.
2977
+ // if it is file:, then the host is dropped,
2978
+ // because that's known to be hostless.
2979
+ // anything else is assumed to be absolute.
2980
+ if (!slashedProtocol[relative.protocol]) {
2981
+ var keys = Object.keys(relative);
2982
+ for (var v = 0; v < keys.length; v++) {
2983
+ var k = keys[v];
2984
+ result[k] = relative[k];
918
2985
  }
919
- if (key === 'set-cookie') {
920
- parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
921
- } else {
922
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
2986
+ result.href = result.format();
2987
+ return result;
2988
+ }
2989
+
2990
+ result.protocol = relative.protocol;
2991
+ if (!relative.host && !hostlessProtocol[relative.protocol]) {
2992
+ relPath = (relative.pathname || '').split('/');
2993
+ while (relPath.length && !(relative.host = relPath.shift()));
2994
+ if (!relative.host) relative.host = '';
2995
+ if (!relative.hostname) relative.hostname = '';
2996
+ if (relPath[0] !== '') relPath.unshift('');
2997
+ if (relPath.length < 2) relPath.unshift('');
2998
+ result.pathname = relPath.join('/');
2999
+ } else {
3000
+ result.pathname = relative.pathname;
3001
+ }
3002
+ result.search = relative.search;
3003
+ result.query = relative.query;
3004
+ result.host = relative.host || '';
3005
+ result.auth = relative.auth;
3006
+ result.hostname = relative.hostname || relative.host;
3007
+ result.port = relative.port;
3008
+ // to support http.request
3009
+ if (result.pathname || result.search) {
3010
+ var p = result.pathname || '';
3011
+ var s = result.search || '';
3012
+ result.path = p + s;
3013
+ }
3014
+ result.slashes = result.slashes || relative.slashes;
3015
+ result.href = result.format();
3016
+ return result;
3017
+ }
3018
+
3019
+ var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),
3020
+ isRelAbs = (
3021
+ relative.host ||
3022
+ relative.pathname && relative.pathname.charAt(0) === '/'
3023
+ ),
3024
+ mustEndAbs = (isRelAbs || isSourceAbs ||
3025
+ (result.host && relative.pathname)),
3026
+ removeAllDots = mustEndAbs,
3027
+ srcPath = result.pathname && result.pathname.split('/') || [],
3028
+ psychotic = result.protocol && !slashedProtocol[result.protocol];
3029
+ relPath = relative.pathname && relative.pathname.split('/') || [];
3030
+ // if the url is a non-slashed url, then relative
3031
+ // links like ../.. should be able
3032
+ // to crawl up to the hostname, as well. This is strange.
3033
+ // result.protocol has already been set by now.
3034
+ // Later on, put the first path part into the host field.
3035
+ if (psychotic) {
3036
+ result.hostname = '';
3037
+ result.port = null;
3038
+ if (result.host) {
3039
+ if (srcPath[0] === '') srcPath[0] = result.host;
3040
+ else srcPath.unshift(result.host);
3041
+ }
3042
+ result.host = '';
3043
+ if (relative.protocol) {
3044
+ relative.hostname = null;
3045
+ relative.port = null;
3046
+ if (relative.host) {
3047
+ if (relPath[0] === '') relPath[0] = relative.host;
3048
+ else relPath.unshift(relative.host);
923
3049
  }
3050
+ relative.host = null;
924
3051
  }
925
- });
3052
+ mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
3053
+ }
3054
+ var authInHost;
3055
+ if (isRelAbs) {
3056
+ // it's absolute.
3057
+ result.host = (relative.host || relative.host === '') ?
3058
+ relative.host : result.host;
3059
+ result.hostname = (relative.hostname || relative.hostname === '') ?
3060
+ relative.hostname : result.hostname;
3061
+ result.search = relative.search;
3062
+ result.query = relative.query;
3063
+ srcPath = relPath;
3064
+ // fall through to the dot-handling below.
3065
+ } else if (relPath.length) {
3066
+ // it's relative
3067
+ // throw away the existing file, and take the new path instead.
3068
+ if (!srcPath) srcPath = [];
3069
+ srcPath.pop();
3070
+ srcPath = srcPath.concat(relPath);
3071
+ result.search = relative.search;
3072
+ result.query = relative.query;
3073
+ } else if (!isNullOrUndefined(relative.search)) {
3074
+ // just pull out the search.
3075
+ // like href='?foo'.
3076
+ // Put this after the other two cases because it simplifies the booleans
3077
+ if (psychotic) {
3078
+ result.hostname = result.host = srcPath.shift();
3079
+ //occationaly the auth can get stuck only in host
3080
+ //this especially happens in cases like
3081
+ //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
3082
+ authInHost = result.host && result.host.indexOf('@') > 0 ?
3083
+ result.host.split('@') : false;
3084
+ if (authInHost) {
3085
+ result.auth = authInHost.shift();
3086
+ result.host = result.hostname = authInHost.shift();
3087
+ }
3088
+ }
3089
+ result.search = relative.search;
3090
+ result.query = relative.query;
3091
+ //to support http.request
3092
+ if (!isNull(result.pathname) || !isNull(result.search)) {
3093
+ result.path = (result.pathname ? result.pathname : '') +
3094
+ (result.search ? result.search : '');
3095
+ }
3096
+ result.href = result.format();
3097
+ return result;
3098
+ }
926
3099
 
927
- return parsed;
928
- };
3100
+ if (!srcPath.length) {
3101
+ // no path at all. easy.
3102
+ // we've already handled the other stuff above.
3103
+ result.pathname = null;
3104
+ //to support http.request
3105
+ if (result.search) {
3106
+ result.path = '/' + result.search;
3107
+ } else {
3108
+ result.path = null;
3109
+ }
3110
+ result.href = result.format();
3111
+ return result;
3112
+ }
929
3113
 
930
- var isURLSameOrigin = (
931
- utils.isStandardBrowserEnv() ?
3114
+ // if a url ENDs in . or .., then it must get a trailing slash.
3115
+ // however, if it ends in anything else non-slashy,
3116
+ // then it must NOT get a trailing slash.
3117
+ var last = srcPath.slice(-1)[0];
3118
+ var hasTrailingSlash = (
3119
+ (result.host || relative.host || srcPath.length > 1) &&
3120
+ (last === '.' || last === '..') || last === '');
3121
+
3122
+ // strip single dots, resolve double dots to parent dir
3123
+ // if the path tries to go above the root, `up` ends up > 0
3124
+ var up = 0;
3125
+ for (var i = srcPath.length; i >= 0; i--) {
3126
+ last = srcPath[i];
3127
+ if (last === '.') {
3128
+ srcPath.splice(i, 1);
3129
+ } else if (last === '..') {
3130
+ srcPath.splice(i, 1);
3131
+ up++;
3132
+ } else if (up) {
3133
+ srcPath.splice(i, 1);
3134
+ up--;
3135
+ }
3136
+ }
932
3137
 
933
- // Standard browser envs have full support of the APIs needed to test
934
- // whether the request URL is of the same origin as current location.
935
- (function standardBrowserEnv() {
936
- var msie = /(msie|trident)/i.test(navigator.userAgent);
937
- var urlParsingNode = document.createElement('a');
938
- var originURL;
3138
+ // if the path is allowed to go above the root, restore leading ..s
3139
+ if (!mustEndAbs && !removeAllDots) {
3140
+ for (; up--; up) {
3141
+ srcPath.unshift('..');
3142
+ }
3143
+ }
939
3144
 
940
- /**
941
- * Parse a URL to discover it's components
942
- *
943
- * @param {String} url The URL to be parsed
944
- * @returns {Object}
945
- */
946
- function resolveURL(url) {
947
- var href = url;
3145
+ if (mustEndAbs && srcPath[0] !== '' &&
3146
+ (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
3147
+ srcPath.unshift('');
3148
+ }
948
3149
 
949
- if (msie) {
950
- // IE needs attribute set twice to normalize properties
951
- urlParsingNode.setAttribute('href', href);
952
- href = urlParsingNode.href;
953
- }
3150
+ if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
3151
+ srcPath.push('');
3152
+ }
954
3153
 
955
- urlParsingNode.setAttribute('href', href);
3154
+ var isAbsolute = srcPath[0] === '' ||
3155
+ (srcPath[0] && srcPath[0].charAt(0) === '/');
3156
+
3157
+ // put the host back
3158
+ if (psychotic) {
3159
+ result.hostname = result.host = isAbsolute ? '' :
3160
+ srcPath.length ? srcPath.shift() : '';
3161
+ //occationaly the auth can get stuck only in host
3162
+ //this especially happens in cases like
3163
+ //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
3164
+ authInHost = result.host && result.host.indexOf('@') > 0 ?
3165
+ result.host.split('@') : false;
3166
+ if (authInHost) {
3167
+ result.auth = authInHost.shift();
3168
+ result.host = result.hostname = authInHost.shift();
3169
+ }
3170
+ }
956
3171
 
957
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
958
- return {
959
- href: urlParsingNode.href,
960
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
961
- host: urlParsingNode.host,
962
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
963
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
964
- hostname: urlParsingNode.hostname,
965
- port: urlParsingNode.port,
966
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
967
- urlParsingNode.pathname :
968
- '/' + urlParsingNode.pathname
969
- };
970
- }
3172
+ mustEndAbs = mustEndAbs || (result.host && srcPath.length);
971
3173
 
972
- originURL = resolveURL(window.location.href);
3174
+ if (mustEndAbs && !isAbsolute) {
3175
+ srcPath.unshift('');
3176
+ }
973
3177
 
974
- /**
975
- * Determine if a URL shares the same origin as the current location
976
- *
977
- * @param {String} requestURL The URL to test
978
- * @returns {boolean} True if URL shares the same origin, otherwise false
979
- */
980
- return function isURLSameOrigin(requestURL) {
981
- var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
982
- return (parsed.protocol === originURL.protocol &&
983
- parsed.host === originURL.host);
984
- };
985
- })() :
3178
+ if (!srcPath.length) {
3179
+ result.pathname = null;
3180
+ result.path = null;
3181
+ } else {
3182
+ result.pathname = srcPath.join('/');
3183
+ }
986
3184
 
987
- // Non standard browser envs (web workers, react-native) lack needed support.
988
- (function nonStandardBrowserEnv() {
989
- return function isURLSameOrigin() {
990
- return true;
991
- };
992
- })()
993
- );
3185
+ //to support request.http
3186
+ if (!isNull(result.pathname) || !isNull(result.search)) {
3187
+ result.path = (result.pathname ? result.pathname : '') +
3188
+ (result.search ? result.search : '');
3189
+ }
3190
+ result.auth = relative.auth || result.auth;
3191
+ result.slashes = result.slashes || relative.slashes;
3192
+ result.href = result.format();
3193
+ return result;
3194
+ };
3195
+
3196
+ Url.prototype.parseHost = function() {
3197
+ return parseHost(this);
3198
+ };
3199
+
3200
+ function parseHost(self) {
3201
+ var host = self.host;
3202
+ var port = portPattern.exec(host);
3203
+ if (port) {
3204
+ port = port[0];
3205
+ if (port !== ':') {
3206
+ self.port = port.substr(1);
3207
+ }
3208
+ host = host.substr(0, host.length - port.length);
3209
+ }
3210
+ if (host) self.hostname = host;
3211
+ }
994
3212
 
995
3213
  /**
996
3214
  * A `CanceledError` is an object that is thrown when an operation is canceled.
@@ -1010,11 +3228,6 @@ utils.inherits(CanceledError, AxiosError_1, {
1010
3228
 
1011
3229
  var CanceledError_1 = CanceledError;
1012
3230
 
1013
- var parseProtocol = function parseProtocol(url) {
1014
- var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
1015
- return match && match[1] || '';
1016
- };
1017
-
1018
3231
  var xhr = function xhrAdapter(config) {
1019
3232
  return new Promise(function dispatchXhrRequest(resolve, reject) {
1020
3233
  var requestData = config.data;
@@ -1031,10 +3244,6 @@ var xhr = function xhrAdapter(config) {
1031
3244
  }
1032
3245
  }
1033
3246
 
1034
- if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
1035
- delete requestHeaders['Content-Type']; // Let the browser set it
1036
- }
1037
-
1038
3247
  var request = new XMLHttpRequest();
1039
3248
 
1040
3249
  // HTTP basic authentication
@@ -1045,6 +3254,8 @@ var xhr = function xhrAdapter(config) {
1045
3254
  }
1046
3255
 
1047
3256
  var fullPath = buildFullPath(config.baseURL, config.url);
3257
+ var parsed = url.parse(fullPath);
3258
+ var protocol = utils.getProtocol(parsed.protocol);
1048
3259
 
1049
3260
  request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
1050
3261
 
@@ -1211,13 +3422,15 @@ var xhr = function xhrAdapter(config) {
1211
3422
  requestData = null;
1212
3423
  }
1213
3424
 
1214
- var protocol = parseProtocol(fullPath);
1215
-
1216
- if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
1217
- reject(new AxiosError_1('Unsupported protocol ' + protocol + ':', AxiosError_1.ERR_BAD_REQUEST, config));
3425
+ if (parsed.path === null) {
3426
+ reject(new AxiosError_1('Malformed URL ' + fullPath, AxiosError_1.ERR_BAD_REQUEST, config));
1218
3427
  return;
1219
3428
  }
1220
3429
 
3430
+ if (!utils.supportedProtocols.includes(protocol)) {
3431
+ reject(new AxiosError_1('Unsupported protocol ' + protocol, AxiosError_1.ERR_BAD_REQUEST, config));
3432
+ return;
3433
+ }
1221
3434
 
1222
3435
  // Send the request
1223
3436
  request.send(requestData);
@@ -1566,7 +3779,7 @@ var mergeConfig = function mergeConfig(config1, config2) {
1566
3779
  };
1567
3780
 
1568
3781
  var data = {
1569
- "version": "0.27.2"
3782
+ "version": "0.27.0"
1570
3783
  };
1571
3784
 
1572
3785
  var VERSION = data.version;
@@ -2018,7 +4231,7 @@ axios_1.default = default_1;
2018
4231
  var axios = axios_1;
2019
4232
 
2020
4233
  var name$1 = "@tryghost/content-api";
2021
- var version = "1.11.6";
4234
+ var version = "1.11.8";
2022
4235
  var repository = "https://github.com/TryGhost/SDK/tree/master/packages/content-api";
2023
4236
  var author = "Ghost Foundation";
2024
4237
  var license = "MIT";
@@ -2047,12 +4260,12 @@ var publishConfig = {
2047
4260
  access: "public"
2048
4261
  };
2049
4262
  var devDependencies = {
2050
- "@babel/core": "7.21.0",
4263
+ "@babel/core": "7.21.4",
2051
4264
  "@babel/polyfill": "7.12.1",
2052
- "@babel/preset-env": "7.20.2",
4265
+ "@babel/preset-env": "7.21.4",
2053
4266
  "@rollup/plugin-json": "6.0.0",
2054
4267
  c8: "7.13.0",
2055
- "core-js": "3.29.0",
4268
+ "core-js": "3.30.0",
2056
4269
  "eslint-plugin-ghost": "2.16.0",
2057
4270
  mocha: "10.2.0",
2058
4271
  rollup: "2.79.1",
@@ -2063,12 +4276,12 @@ var devDependencies = {
2063
4276
  "rollup-plugin-replace": "2.2.0",
2064
4277
  "rollup-plugin-terser": "7.0.2",
2065
4278
  should: "13.2.3",
2066
- sinon: "15.0.1"
4279
+ sinon: "15.0.3"
2067
4280
  };
2068
4281
  var dependencies = {
2069
4282
  axios: "^0.27.0"
2070
4283
  };
2071
- var gitHead = "1046738d867fc64428bbd3a80a340d89b7ccbea2";
4284
+ var gitHead = "cf56126d88e83961e52e001031cc8c3f43fd050a";
2072
4285
  var packageInfo = {
2073
4286
  name: name$1,
2074
4287
  version: version,