@imtbl/sdk 0.4.0-alpha.1 → 0.4.0-alpha.2

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/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var axios$2 = require('axios');
3
+ var globalAxios$1 = require('axios');
4
4
  var coreSdk = require('@imtbl/core-sdk');
5
5
  var oidcClientTs = require('oidc-client-ts');
6
6
  var jwt_decode = require('jwt-decode');
@@ -57,3214 +57,6 @@ class ImmutableConfiguration {
57
57
  }
58
58
  }
59
59
 
60
- function bind$1(fn, thisArg) {
61
- return function wrap() {
62
- return fn.apply(thisArg, arguments);
63
- };
64
- }
65
-
66
- // utils is a library of generic helper functions non-specific to axios
67
-
68
- const {toString: toString$1} = Object.prototype;
69
- const {getPrototypeOf: getPrototypeOf$1} = Object;
70
-
71
- const kindOf$1 = (cache => thing => {
72
- const str = toString$1.call(thing);
73
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
74
- })(Object.create(null));
75
-
76
- const kindOfTest$1 = (type) => {
77
- type = type.toLowerCase();
78
- return (thing) => kindOf$1(thing) === type
79
- };
80
-
81
- const typeOfTest$1 = type => thing => typeof thing === type;
82
-
83
- /**
84
- * Determine if a value is an Array
85
- *
86
- * @param {Object} val The value to test
87
- *
88
- * @returns {boolean} True if value is an Array, otherwise false
89
- */
90
- const {isArray: isArray$1} = Array;
91
-
92
- /**
93
- * Determine if a value is undefined
94
- *
95
- * @param {*} val The value to test
96
- *
97
- * @returns {boolean} True if the value is undefined, otherwise false
98
- */
99
- const isUndefined$1 = typeOfTest$1('undefined');
100
-
101
- /**
102
- * Determine if a value is a Buffer
103
- *
104
- * @param {*} val The value to test
105
- *
106
- * @returns {boolean} True if value is a Buffer, otherwise false
107
- */
108
- function isBuffer$1(val) {
109
- return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor)
110
- && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
111
- }
112
-
113
- /**
114
- * Determine if a value is an ArrayBuffer
115
- *
116
- * @param {*} val The value to test
117
- *
118
- * @returns {boolean} True if value is an ArrayBuffer, otherwise false
119
- */
120
- const isArrayBuffer$1 = kindOfTest$1('ArrayBuffer');
121
-
122
-
123
- /**
124
- * Determine if a value is a view on an ArrayBuffer
125
- *
126
- * @param {*} val The value to test
127
- *
128
- * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
129
- */
130
- function isArrayBufferView$1(val) {
131
- let result;
132
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
133
- result = ArrayBuffer.isView(val);
134
- } else {
135
- result = (val) && (val.buffer) && (isArrayBuffer$1(val.buffer));
136
- }
137
- return result;
138
- }
139
-
140
- /**
141
- * Determine if a value is a String
142
- *
143
- * @param {*} val The value to test
144
- *
145
- * @returns {boolean} True if value is a String, otherwise false
146
- */
147
- const isString$2 = typeOfTest$1('string');
148
-
149
- /**
150
- * Determine if a value is a Function
151
- *
152
- * @param {*} val The value to test
153
- * @returns {boolean} True if value is a Function, otherwise false
154
- */
155
- const isFunction$1 = typeOfTest$1('function');
156
-
157
- /**
158
- * Determine if a value is a Number
159
- *
160
- * @param {*} val The value to test
161
- *
162
- * @returns {boolean} True if value is a Number, otherwise false
163
- */
164
- const isNumber$1 = typeOfTest$1('number');
165
-
166
- /**
167
- * Determine if a value is an Object
168
- *
169
- * @param {*} thing The value to test
170
- *
171
- * @returns {boolean} True if value is an Object, otherwise false
172
- */
173
- const isObject$1 = (thing) => thing !== null && typeof thing === 'object';
174
-
175
- /**
176
- * Determine if a value is a Boolean
177
- *
178
- * @param {*} thing The value to test
179
- * @returns {boolean} True if value is a Boolean, otherwise false
180
- */
181
- const isBoolean$1 = thing => thing === true || thing === false;
182
-
183
- /**
184
- * Determine if a value is a plain Object
185
- *
186
- * @param {*} val The value to test
187
- *
188
- * @returns {boolean} True if value is a plain Object, otherwise false
189
- */
190
- const isPlainObject$1 = (val) => {
191
- if (kindOf$1(val) !== 'object') {
192
- return false;
193
- }
194
-
195
- const prototype = getPrototypeOf$1(val);
196
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
197
- };
198
-
199
- /**
200
- * Determine if a value is a Date
201
- *
202
- * @param {*} val The value to test
203
- *
204
- * @returns {boolean} True if value is a Date, otherwise false
205
- */
206
- const isDate$1 = kindOfTest$1('Date');
207
-
208
- /**
209
- * Determine if a value is a File
210
- *
211
- * @param {*} val The value to test
212
- *
213
- * @returns {boolean} True if value is a File, otherwise false
214
- */
215
- const isFile$1 = kindOfTest$1('File');
216
-
217
- /**
218
- * Determine if a value is a Blob
219
- *
220
- * @param {*} val The value to test
221
- *
222
- * @returns {boolean} True if value is a Blob, otherwise false
223
- */
224
- const isBlob$2 = kindOfTest$1('Blob');
225
-
226
- /**
227
- * Determine if a value is a FileList
228
- *
229
- * @param {*} val The value to test
230
- *
231
- * @returns {boolean} True if value is a File, otherwise false
232
- */
233
- const isFileList$1 = kindOfTest$1('FileList');
234
-
235
- /**
236
- * Determine if a value is a Stream
237
- *
238
- * @param {*} val The value to test
239
- *
240
- * @returns {boolean} True if value is a Stream, otherwise false
241
- */
242
- const isStream$1 = (val) => isObject$1(val) && isFunction$1(val.pipe);
243
-
244
- /**
245
- * Determine if a value is a FormData
246
- *
247
- * @param {*} thing The value to test
248
- *
249
- * @returns {boolean} True if value is an FormData, otherwise false
250
- */
251
- const isFormData$2 = (thing) => {
252
- let kind;
253
- return thing && (
254
- (typeof FormData === 'function' && thing instanceof FormData) || (
255
- isFunction$1(thing.append) && (
256
- (kind = kindOf$1(thing)) === 'formdata' ||
257
- // detect form-data instance
258
- (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
259
- )
260
- )
261
- )
262
- };
263
-
264
- /**
265
- * Determine if a value is a URLSearchParams object
266
- *
267
- * @param {*} val The value to test
268
- *
269
- * @returns {boolean} True if value is a URLSearchParams object, otherwise false
270
- */
271
- const isURLSearchParams$1 = kindOfTest$1('URLSearchParams');
272
-
273
- /**
274
- * Trim excess whitespace off the beginning and end of a string
275
- *
276
- * @param {String} str The String to trim
277
- *
278
- * @returns {String} The String freed of excess whitespace
279
- */
280
- const trim$1 = (str) => str.trim ?
281
- str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
282
-
283
- /**
284
- * Iterate over an Array or an Object invoking a function for each item.
285
- *
286
- * If `obj` is an Array callback will be called passing
287
- * the value, index, and complete array for each item.
288
- *
289
- * If 'obj' is an Object callback will be called passing
290
- * the value, key, and complete object for each property.
291
- *
292
- * @param {Object|Array} obj The object to iterate
293
- * @param {Function} fn The callback to invoke for each item
294
- *
295
- * @param {Boolean} [allOwnKeys = false]
296
- * @returns {any}
297
- */
298
- function forEach$1(obj, fn, {allOwnKeys = false} = {}) {
299
- // Don't bother if no value provided
300
- if (obj === null || typeof obj === 'undefined') {
301
- return;
302
- }
303
-
304
- let i;
305
- let l;
306
-
307
- // Force an array if not already something iterable
308
- if (typeof obj !== 'object') {
309
- /*eslint no-param-reassign:0*/
310
- obj = [obj];
311
- }
312
-
313
- if (isArray$1(obj)) {
314
- // Iterate over array values
315
- for (i = 0, l = obj.length; i < l; i++) {
316
- fn.call(null, obj[i], i, obj);
317
- }
318
- } else {
319
- // Iterate over object keys
320
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
321
- const len = keys.length;
322
- let key;
323
-
324
- for (i = 0; i < len; i++) {
325
- key = keys[i];
326
- fn.call(null, obj[key], key, obj);
327
- }
328
- }
329
- }
330
-
331
- function findKey$1(obj, key) {
332
- key = key.toLowerCase();
333
- const keys = Object.keys(obj);
334
- let i = keys.length;
335
- let _key;
336
- while (i-- > 0) {
337
- _key = keys[i];
338
- if (key === _key.toLowerCase()) {
339
- return _key;
340
- }
341
- }
342
- return null;
343
- }
344
-
345
- const _global$1 = (() => {
346
- /*eslint no-undef:0*/
347
- if (typeof globalThis !== "undefined") return globalThis;
348
- return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
349
- })();
350
-
351
- const isContextDefined$1 = (context) => !isUndefined$1(context) && context !== _global$1;
352
-
353
- /**
354
- * Accepts varargs expecting each argument to be an object, then
355
- * immutably merges the properties of each object and returns result.
356
- *
357
- * When multiple objects contain the same key the later object in
358
- * the arguments list will take precedence.
359
- *
360
- * Example:
361
- *
362
- * ```js
363
- * var result = merge({foo: 123}, {foo: 456});
364
- * console.log(result.foo); // outputs 456
365
- * ```
366
- *
367
- * @param {Object} obj1 Object to merge
368
- *
369
- * @returns {Object} Result of all merge properties
370
- */
371
- function merge$1(/* obj1, obj2, obj3, ... */) {
372
- const {caseless} = isContextDefined$1(this) && this || {};
373
- const result = {};
374
- const assignValue = (val, key) => {
375
- const targetKey = caseless && findKey$1(result, key) || key;
376
- if (isPlainObject$1(result[targetKey]) && isPlainObject$1(val)) {
377
- result[targetKey] = merge$1(result[targetKey], val);
378
- } else if (isPlainObject$1(val)) {
379
- result[targetKey] = merge$1({}, val);
380
- } else if (isArray$1(val)) {
381
- result[targetKey] = val.slice();
382
- } else {
383
- result[targetKey] = val;
384
- }
385
- };
386
-
387
- for (let i = 0, l = arguments.length; i < l; i++) {
388
- arguments[i] && forEach$1(arguments[i], assignValue);
389
- }
390
- return result;
391
- }
392
-
393
- /**
394
- * Extends object a by mutably adding to it the properties of object b.
395
- *
396
- * @param {Object} a The object to be extended
397
- * @param {Object} b The object to copy properties from
398
- * @param {Object} thisArg The object to bind function to
399
- *
400
- * @param {Boolean} [allOwnKeys]
401
- * @returns {Object} The resulting value of object a
402
- */
403
- const extend$1 = (a, b, thisArg, {allOwnKeys}= {}) => {
404
- forEach$1(b, (val, key) => {
405
- if (thisArg && isFunction$1(val)) {
406
- a[key] = bind$1(val, thisArg);
407
- } else {
408
- a[key] = val;
409
- }
410
- }, {allOwnKeys});
411
- return a;
412
- };
413
-
414
- /**
415
- * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
416
- *
417
- * @param {string} content with BOM
418
- *
419
- * @returns {string} content value without BOM
420
- */
421
- const stripBOM$1 = (content) => {
422
- if (content.charCodeAt(0) === 0xFEFF) {
423
- content = content.slice(1);
424
- }
425
- return content;
426
- };
427
-
428
- /**
429
- * Inherit the prototype methods from one constructor into another
430
- * @param {function} constructor
431
- * @param {function} superConstructor
432
- * @param {object} [props]
433
- * @param {object} [descriptors]
434
- *
435
- * @returns {void}
436
- */
437
- const inherits$1 = (constructor, superConstructor, props, descriptors) => {
438
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
439
- constructor.prototype.constructor = constructor;
440
- Object.defineProperty(constructor, 'super', {
441
- value: superConstructor.prototype
442
- });
443
- props && Object.assign(constructor.prototype, props);
444
- };
445
-
446
- /**
447
- * Resolve object with deep prototype chain to a flat object
448
- * @param {Object} sourceObj source object
449
- * @param {Object} [destObj]
450
- * @param {Function|Boolean} [filter]
451
- * @param {Function} [propFilter]
452
- *
453
- * @returns {Object}
454
- */
455
- const toFlatObject$1 = (sourceObj, destObj, filter, propFilter) => {
456
- let props;
457
- let i;
458
- let prop;
459
- const merged = {};
460
-
461
- destObj = destObj || {};
462
- // eslint-disable-next-line no-eq-null,eqeqeq
463
- if (sourceObj == null) return destObj;
464
-
465
- do {
466
- props = Object.getOwnPropertyNames(sourceObj);
467
- i = props.length;
468
- while (i-- > 0) {
469
- prop = props[i];
470
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
471
- destObj[prop] = sourceObj[prop];
472
- merged[prop] = true;
473
- }
474
- }
475
- sourceObj = filter !== false && getPrototypeOf$1(sourceObj);
476
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
477
-
478
- return destObj;
479
- };
480
-
481
- /**
482
- * Determines whether a string ends with the characters of a specified string
483
- *
484
- * @param {String} str
485
- * @param {String} searchString
486
- * @param {Number} [position= 0]
487
- *
488
- * @returns {boolean}
489
- */
490
- const endsWith$1 = (str, searchString, position) => {
491
- str = String(str);
492
- if (position === undefined || position > str.length) {
493
- position = str.length;
494
- }
495
- position -= searchString.length;
496
- const lastIndex = str.indexOf(searchString, position);
497
- return lastIndex !== -1 && lastIndex === position;
498
- };
499
-
500
-
501
- /**
502
- * Returns new array from array like object or null if failed
503
- *
504
- * @param {*} [thing]
505
- *
506
- * @returns {?Array}
507
- */
508
- const toArray$1 = (thing) => {
509
- if (!thing) return null;
510
- if (isArray$1(thing)) return thing;
511
- let i = thing.length;
512
- if (!isNumber$1(i)) return null;
513
- const arr = new Array(i);
514
- while (i-- > 0) {
515
- arr[i] = thing[i];
516
- }
517
- return arr;
518
- };
519
-
520
- /**
521
- * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
522
- * thing passed in is an instance of Uint8Array
523
- *
524
- * @param {TypedArray}
525
- *
526
- * @returns {Array}
527
- */
528
- // eslint-disable-next-line func-names
529
- const isTypedArray$1 = (TypedArray => {
530
- // eslint-disable-next-line func-names
531
- return thing => {
532
- return TypedArray && thing instanceof TypedArray;
533
- };
534
- })(typeof Uint8Array !== 'undefined' && getPrototypeOf$1(Uint8Array));
535
-
536
- /**
537
- * For each entry in the object, call the function with the key and value.
538
- *
539
- * @param {Object<any, any>} obj - The object to iterate over.
540
- * @param {Function} fn - The function to call for each entry.
541
- *
542
- * @returns {void}
543
- */
544
- const forEachEntry$1 = (obj, fn) => {
545
- const generator = obj && obj[Symbol.iterator];
546
-
547
- const iterator = generator.call(obj);
548
-
549
- let result;
550
-
551
- while ((result = iterator.next()) && !result.done) {
552
- const pair = result.value;
553
- fn.call(obj, pair[0], pair[1]);
554
- }
555
- };
556
-
557
- /**
558
- * It takes a regular expression and a string, and returns an array of all the matches
559
- *
560
- * @param {string} regExp - The regular expression to match against.
561
- * @param {string} str - The string to search.
562
- *
563
- * @returns {Array<boolean>}
564
- */
565
- const matchAll$1 = (regExp, str) => {
566
- let matches;
567
- const arr = [];
568
-
569
- while ((matches = regExp.exec(str)) !== null) {
570
- arr.push(matches);
571
- }
572
-
573
- return arr;
574
- };
575
-
576
- /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
577
- const isHTMLForm$1 = kindOfTest$1('HTMLFormElement');
578
-
579
- const toCamelCase$1 = str => {
580
- return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
581
- function replacer(m, p1, p2) {
582
- return p1.toUpperCase() + p2;
583
- }
584
- );
585
- };
586
-
587
- /* Creating a function that will check if an object has a property. */
588
- const hasOwnProperty$1 = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
589
-
590
- /**
591
- * Determine if a value is a RegExp object
592
- *
593
- * @param {*} val The value to test
594
- *
595
- * @returns {boolean} True if value is a RegExp object, otherwise false
596
- */
597
- const isRegExp$1 = kindOfTest$1('RegExp');
598
-
599
- const reduceDescriptors$1 = (obj, reducer) => {
600
- const descriptors = Object.getOwnPropertyDescriptors(obj);
601
- const reducedDescriptors = {};
602
-
603
- forEach$1(descriptors, (descriptor, name) => {
604
- if (reducer(descriptor, name, obj) !== false) {
605
- reducedDescriptors[name] = descriptor;
606
- }
607
- });
608
-
609
- Object.defineProperties(obj, reducedDescriptors);
610
- };
611
-
612
- /**
613
- * Makes all methods read-only
614
- * @param {Object} obj
615
- */
616
-
617
- const freezeMethods$1 = (obj) => {
618
- reduceDescriptors$1(obj, (descriptor, name) => {
619
- // skip restricted props in strict mode
620
- if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
621
- return false;
622
- }
623
-
624
- const value = obj[name];
625
-
626
- if (!isFunction$1(value)) return;
627
-
628
- descriptor.enumerable = false;
629
-
630
- if ('writable' in descriptor) {
631
- descriptor.writable = false;
632
- return;
633
- }
634
-
635
- if (!descriptor.set) {
636
- descriptor.set = () => {
637
- throw Error('Can not rewrite read-only method \'' + name + '\'');
638
- };
639
- }
640
- });
641
- };
642
-
643
- const toObjectSet$1 = (arrayOrString, delimiter) => {
644
- const obj = {};
645
-
646
- const define = (arr) => {
647
- arr.forEach(value => {
648
- obj[value] = true;
649
- });
650
- };
651
-
652
- isArray$1(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
653
-
654
- return obj;
655
- };
656
-
657
- const noop$1 = () => {};
658
-
659
- const toFiniteNumber$1 = (value, defaultValue) => {
660
- value = +value;
661
- return Number.isFinite(value) ? value : defaultValue;
662
- };
663
-
664
- const ALPHA$1 = 'abcdefghijklmnopqrstuvwxyz';
665
-
666
- const DIGIT$1 = '0123456789';
667
-
668
- const ALPHABET$1 = {
669
- DIGIT: DIGIT$1,
670
- ALPHA: ALPHA$1,
671
- ALPHA_DIGIT: ALPHA$1 + ALPHA$1.toUpperCase() + DIGIT$1
672
- };
673
-
674
- const generateString$1 = (size = 16, alphabet = ALPHABET$1.ALPHA_DIGIT) => {
675
- let str = '';
676
- const {length} = alphabet;
677
- while (size--) {
678
- str += alphabet[Math.random() * length|0];
679
- }
680
-
681
- return str;
682
- };
683
-
684
- /**
685
- * If the thing is a FormData object, return true, otherwise return false.
686
- *
687
- * @param {unknown} thing - The thing to check.
688
- *
689
- * @returns {boolean}
690
- */
691
- function isSpecCompliantForm$1(thing) {
692
- return !!(thing && isFunction$1(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
693
- }
694
-
695
- const toJSONObject$1 = (obj) => {
696
- const stack = new Array(10);
697
-
698
- const visit = (source, i) => {
699
-
700
- if (isObject$1(source)) {
701
- if (stack.indexOf(source) >= 0) {
702
- return;
703
- }
704
-
705
- if(!('toJSON' in source)) {
706
- stack[i] = source;
707
- const target = isArray$1(source) ? [] : {};
708
-
709
- forEach$1(source, (value, key) => {
710
- const reducedValue = visit(value, i + 1);
711
- !isUndefined$1(reducedValue) && (target[key] = reducedValue);
712
- });
713
-
714
- stack[i] = undefined;
715
-
716
- return target;
717
- }
718
- }
719
-
720
- return source;
721
- };
722
-
723
- return visit(obj, 0);
724
- };
725
-
726
- const isAsyncFn$1 = kindOfTest$1('AsyncFunction');
727
-
728
- const isThenable$1 = (thing) =>
729
- thing && (isObject$1(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
730
-
731
- var utils$1 = {
732
- isArray: isArray$1,
733
- isArrayBuffer: isArrayBuffer$1,
734
- isBuffer: isBuffer$1,
735
- isFormData: isFormData$2,
736
- isArrayBufferView: isArrayBufferView$1,
737
- isString: isString$2,
738
- isNumber: isNumber$1,
739
- isBoolean: isBoolean$1,
740
- isObject: isObject$1,
741
- isPlainObject: isPlainObject$1,
742
- isUndefined: isUndefined$1,
743
- isDate: isDate$1,
744
- isFile: isFile$1,
745
- isBlob: isBlob$2,
746
- isRegExp: isRegExp$1,
747
- isFunction: isFunction$1,
748
- isStream: isStream$1,
749
- isURLSearchParams: isURLSearchParams$1,
750
- isTypedArray: isTypedArray$1,
751
- isFileList: isFileList$1,
752
- forEach: forEach$1,
753
- merge: merge$1,
754
- extend: extend$1,
755
- trim: trim$1,
756
- stripBOM: stripBOM$1,
757
- inherits: inherits$1,
758
- toFlatObject: toFlatObject$1,
759
- kindOf: kindOf$1,
760
- kindOfTest: kindOfTest$1,
761
- endsWith: endsWith$1,
762
- toArray: toArray$1,
763
- forEachEntry: forEachEntry$1,
764
- matchAll: matchAll$1,
765
- isHTMLForm: isHTMLForm$1,
766
- hasOwnProperty: hasOwnProperty$1,
767
- hasOwnProp: hasOwnProperty$1, // an alias to avoid ESLint no-prototype-builtins detection
768
- reduceDescriptors: reduceDescriptors$1,
769
- freezeMethods: freezeMethods$1,
770
- toObjectSet: toObjectSet$1,
771
- toCamelCase: toCamelCase$1,
772
- noop: noop$1,
773
- toFiniteNumber: toFiniteNumber$1,
774
- findKey: findKey$1,
775
- global: _global$1,
776
- isContextDefined: isContextDefined$1,
777
- ALPHABET: ALPHABET$1,
778
- generateString: generateString$1,
779
- isSpecCompliantForm: isSpecCompliantForm$1,
780
- toJSONObject: toJSONObject$1,
781
- isAsyncFn: isAsyncFn$1,
782
- isThenable: isThenable$1
783
- };
784
-
785
- /**
786
- * Create an Error with the specified message, config, error code, request and response.
787
- *
788
- * @param {string} message The error message.
789
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
790
- * @param {Object} [config] The config.
791
- * @param {Object} [request] The request.
792
- * @param {Object} [response] The response.
793
- *
794
- * @returns {Error} The created error.
795
- */
796
- function AxiosError$1(message, code, config, request, response) {
797
- Error.call(this);
798
-
799
- if (Error.captureStackTrace) {
800
- Error.captureStackTrace(this, this.constructor);
801
- } else {
802
- this.stack = (new Error()).stack;
803
- }
804
-
805
- this.message = message;
806
- this.name = 'AxiosError';
807
- code && (this.code = code);
808
- config && (this.config = config);
809
- request && (this.request = request);
810
- response && (this.response = response);
811
- }
812
-
813
- utils$1.inherits(AxiosError$1, Error, {
814
- toJSON: function toJSON() {
815
- return {
816
- // Standard
817
- message: this.message,
818
- name: this.name,
819
- // Microsoft
820
- description: this.description,
821
- number: this.number,
822
- // Mozilla
823
- fileName: this.fileName,
824
- lineNumber: this.lineNumber,
825
- columnNumber: this.columnNumber,
826
- stack: this.stack,
827
- // Axios
828
- config: utils$1.toJSONObject(this.config),
829
- code: this.code,
830
- status: this.response && this.response.status ? this.response.status : null
831
- };
832
- }
833
- });
834
-
835
- const prototype$1$1 = AxiosError$1.prototype;
836
- const descriptors$1 = {};
837
-
838
- [
839
- 'ERR_BAD_OPTION_VALUE',
840
- 'ERR_BAD_OPTION',
841
- 'ECONNABORTED',
842
- 'ETIMEDOUT',
843
- 'ERR_NETWORK',
844
- 'ERR_FR_TOO_MANY_REDIRECTS',
845
- 'ERR_DEPRECATED',
846
- 'ERR_BAD_RESPONSE',
847
- 'ERR_BAD_REQUEST',
848
- 'ERR_CANCELED',
849
- 'ERR_NOT_SUPPORT',
850
- 'ERR_INVALID_URL'
851
- // eslint-disable-next-line func-names
852
- ].forEach(code => {
853
- descriptors$1[code] = {value: code};
854
- });
855
-
856
- Object.defineProperties(AxiosError$1, descriptors$1);
857
- Object.defineProperty(prototype$1$1, 'isAxiosError', {value: true});
858
-
859
- // eslint-disable-next-line func-names
860
- AxiosError$1.from = (error, code, config, request, response, customProps) => {
861
- const axiosError = Object.create(prototype$1$1);
862
-
863
- utils$1.toFlatObject(error, axiosError, function filter(obj) {
864
- return obj !== Error.prototype;
865
- }, prop => {
866
- return prop !== 'isAxiosError';
867
- });
868
-
869
- AxiosError$1.call(axiosError, error.message, code, config, request, response);
870
-
871
- axiosError.cause = error;
872
-
873
- axiosError.name = error.name;
874
-
875
- customProps && Object.assign(axiosError, customProps);
876
-
877
- return axiosError;
878
- };
879
-
880
- // eslint-disable-next-line strict
881
- var httpAdapter$1 = null;
882
-
883
- /**
884
- * Determines if the given thing is a array or js object.
885
- *
886
- * @param {string} thing - The object or array to be visited.
887
- *
888
- * @returns {boolean}
889
- */
890
- function isVisitable$1(thing) {
891
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
892
- }
893
-
894
- /**
895
- * It removes the brackets from the end of a string
896
- *
897
- * @param {string} key - The key of the parameter.
898
- *
899
- * @returns {string} the key without the brackets.
900
- */
901
- function removeBrackets$1(key) {
902
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
903
- }
904
-
905
- /**
906
- * It takes a path, a key, and a boolean, and returns a string
907
- *
908
- * @param {string} path - The path to the current key.
909
- * @param {string} key - The key of the current object being iterated over.
910
- * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
911
- *
912
- * @returns {string} The path to the current key.
913
- */
914
- function renderKey$1(path, key, dots) {
915
- if (!path) return key;
916
- return path.concat(key).map(function each(token, i) {
917
- // eslint-disable-next-line no-param-reassign
918
- token = removeBrackets$1(token);
919
- return !dots && i ? '[' + token + ']' : token;
920
- }).join(dots ? '.' : '');
921
- }
922
-
923
- /**
924
- * If the array is an array and none of its elements are visitable, then it's a flat array.
925
- *
926
- * @param {Array<any>} arr - The array to check
927
- *
928
- * @returns {boolean}
929
- */
930
- function isFlatArray$1(arr) {
931
- return utils$1.isArray(arr) && !arr.some(isVisitable$1);
932
- }
933
-
934
- const predicates$1 = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
935
- return /^is[A-Z]/.test(prop);
936
- });
937
-
938
- /**
939
- * Convert a data object to FormData
940
- *
941
- * @param {Object} obj
942
- * @param {?Object} [formData]
943
- * @param {?Object} [options]
944
- * @param {Function} [options.visitor]
945
- * @param {Boolean} [options.metaTokens = true]
946
- * @param {Boolean} [options.dots = false]
947
- * @param {?Boolean} [options.indexes = false]
948
- *
949
- * @returns {Object}
950
- **/
951
-
952
- /**
953
- * It converts an object into a FormData object
954
- *
955
- * @param {Object<any, any>} obj - The object to convert to form data.
956
- * @param {string} formData - The FormData object to append to.
957
- * @param {Object<string, any>} options
958
- *
959
- * @returns
960
- */
961
- function toFormData$1(obj, formData, options) {
962
- if (!utils$1.isObject(obj)) {
963
- throw new TypeError('target must be an object');
964
- }
965
-
966
- // eslint-disable-next-line no-param-reassign
967
- formData = formData || new (FormData)();
968
-
969
- // eslint-disable-next-line no-param-reassign
970
- options = utils$1.toFlatObject(options, {
971
- metaTokens: true,
972
- dots: false,
973
- indexes: false
974
- }, false, function defined(option, source) {
975
- // eslint-disable-next-line no-eq-null,eqeqeq
976
- return !utils$1.isUndefined(source[option]);
977
- });
978
-
979
- const metaTokens = options.metaTokens;
980
- // eslint-disable-next-line no-use-before-define
981
- const visitor = options.visitor || defaultVisitor;
982
- const dots = options.dots;
983
- const indexes = options.indexes;
984
- const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
985
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
986
-
987
- if (!utils$1.isFunction(visitor)) {
988
- throw new TypeError('visitor must be a function');
989
- }
990
-
991
- function convertValue(value) {
992
- if (value === null) return '';
993
-
994
- if (utils$1.isDate(value)) {
995
- return value.toISOString();
996
- }
997
-
998
- if (!useBlob && utils$1.isBlob(value)) {
999
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
1000
- }
1001
-
1002
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
1003
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1004
- }
1005
-
1006
- return value;
1007
- }
1008
-
1009
- /**
1010
- * Default visitor.
1011
- *
1012
- * @param {*} value
1013
- * @param {String|Number} key
1014
- * @param {Array<String|Number>} path
1015
- * @this {FormData}
1016
- *
1017
- * @returns {boolean} return true to visit the each prop of the value recursively
1018
- */
1019
- function defaultVisitor(value, key, path) {
1020
- let arr = value;
1021
-
1022
- if (value && !path && typeof value === 'object') {
1023
- if (utils$1.endsWith(key, '{}')) {
1024
- // eslint-disable-next-line no-param-reassign
1025
- key = metaTokens ? key : key.slice(0, -2);
1026
- // eslint-disable-next-line no-param-reassign
1027
- value = JSON.stringify(value);
1028
- } else if (
1029
- (utils$1.isArray(value) && isFlatArray$1(value)) ||
1030
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
1031
- )) {
1032
- // eslint-disable-next-line no-param-reassign
1033
- key = removeBrackets$1(key);
1034
-
1035
- arr.forEach(function each(el, index) {
1036
- !(utils$1.isUndefined(el) || el === null) && formData.append(
1037
- // eslint-disable-next-line no-nested-ternary
1038
- indexes === true ? renderKey$1([key], index, dots) : (indexes === null ? key : key + '[]'),
1039
- convertValue(el)
1040
- );
1041
- });
1042
- return false;
1043
- }
1044
- }
1045
-
1046
- if (isVisitable$1(value)) {
1047
- return true;
1048
- }
1049
-
1050
- formData.append(renderKey$1(path, key, dots), convertValue(value));
1051
-
1052
- return false;
1053
- }
1054
-
1055
- const stack = [];
1056
-
1057
- const exposedHelpers = Object.assign(predicates$1, {
1058
- defaultVisitor,
1059
- convertValue,
1060
- isVisitable: isVisitable$1
1061
- });
1062
-
1063
- function build(value, path) {
1064
- if (utils$1.isUndefined(value)) return;
1065
-
1066
- if (stack.indexOf(value) !== -1) {
1067
- throw Error('Circular reference detected in ' + path.join('.'));
1068
- }
1069
-
1070
- stack.push(value);
1071
-
1072
- utils$1.forEach(value, function each(el, key) {
1073
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
1074
- formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
1075
- );
1076
-
1077
- if (result === true) {
1078
- build(el, path ? path.concat(key) : [key]);
1079
- }
1080
- });
1081
-
1082
- stack.pop();
1083
- }
1084
-
1085
- if (!utils$1.isObject(obj)) {
1086
- throw new TypeError('data must be an object');
1087
- }
1088
-
1089
- build(obj);
1090
-
1091
- return formData;
1092
- }
1093
-
1094
- /**
1095
- * It encodes a string by replacing all characters that are not in the unreserved set with
1096
- * their percent-encoded equivalents
1097
- *
1098
- * @param {string} str - The string to encode.
1099
- *
1100
- * @returns {string} The encoded string.
1101
- */
1102
- function encode$1$1(str) {
1103
- const charMap = {
1104
- '!': '%21',
1105
- "'": '%27',
1106
- '(': '%28',
1107
- ')': '%29',
1108
- '~': '%7E',
1109
- '%20': '+',
1110
- '%00': '\x00'
1111
- };
1112
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
1113
- return charMap[match];
1114
- });
1115
- }
1116
-
1117
- /**
1118
- * It takes a params object and converts it to a FormData object
1119
- *
1120
- * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1121
- * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1122
- *
1123
- * @returns {void}
1124
- */
1125
- function AxiosURLSearchParams$1(params, options) {
1126
- this._pairs = [];
1127
-
1128
- params && toFormData$1(params, this, options);
1129
- }
1130
-
1131
- const prototype$2 = AxiosURLSearchParams$1.prototype;
1132
-
1133
- prototype$2.append = function append(name, value) {
1134
- this._pairs.push([name, value]);
1135
- };
1136
-
1137
- prototype$2.toString = function toString(encoder) {
1138
- const _encode = encoder ? function(value) {
1139
- return encoder.call(this, value, encode$1$1);
1140
- } : encode$1$1;
1141
-
1142
- return this._pairs.map(function each(pair) {
1143
- return _encode(pair[0]) + '=' + _encode(pair[1]);
1144
- }, '').join('&');
1145
- };
1146
-
1147
- /**
1148
- * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
1149
- * URI encoded counterparts
1150
- *
1151
- * @param {string} val The value to be encoded.
1152
- *
1153
- * @returns {string} The encoded value.
1154
- */
1155
- function encode$3(val) {
1156
- return encodeURIComponent(val).
1157
- replace(/%3A/gi, ':').
1158
- replace(/%24/g, '$').
1159
- replace(/%2C/gi, ',').
1160
- replace(/%20/g, '+').
1161
- replace(/%5B/gi, '[').
1162
- replace(/%5D/gi, ']');
1163
- }
1164
-
1165
- /**
1166
- * Build a URL by appending params to the end
1167
- *
1168
- * @param {string} url The base of the url (e.g., http://www.google.com)
1169
- * @param {object} [params] The params to be appended
1170
- * @param {?object} options
1171
- *
1172
- * @returns {string} The formatted url
1173
- */
1174
- function buildURL$1(url, params, options) {
1175
- /*eslint no-param-reassign:0*/
1176
- if (!params) {
1177
- return url;
1178
- }
1179
-
1180
- const _encode = options && options.encode || encode$3;
1181
-
1182
- const serializeFn = options && options.serialize;
1183
-
1184
- let serializedParams;
1185
-
1186
- if (serializeFn) {
1187
- serializedParams = serializeFn(params, options);
1188
- } else {
1189
- serializedParams = utils$1.isURLSearchParams(params) ?
1190
- params.toString() :
1191
- new AxiosURLSearchParams$1(params, options).toString(_encode);
1192
- }
1193
-
1194
- if (serializedParams) {
1195
- const hashmarkIndex = url.indexOf("#");
1196
-
1197
- if (hashmarkIndex !== -1) {
1198
- url = url.slice(0, hashmarkIndex);
1199
- }
1200
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1201
- }
1202
-
1203
- return url;
1204
- }
1205
-
1206
- let InterceptorManager$2 = class InterceptorManager {
1207
- constructor() {
1208
- this.handlers = [];
1209
- }
1210
-
1211
- /**
1212
- * Add a new interceptor to the stack
1213
- *
1214
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1215
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1216
- *
1217
- * @return {Number} An ID used to remove interceptor later
1218
- */
1219
- use(fulfilled, rejected, options) {
1220
- this.handlers.push({
1221
- fulfilled,
1222
- rejected,
1223
- synchronous: options ? options.synchronous : false,
1224
- runWhen: options ? options.runWhen : null
1225
- });
1226
- return this.handlers.length - 1;
1227
- }
1228
-
1229
- /**
1230
- * Remove an interceptor from the stack
1231
- *
1232
- * @param {Number} id The ID that was returned by `use`
1233
- *
1234
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1235
- */
1236
- eject(id) {
1237
- if (this.handlers[id]) {
1238
- this.handlers[id] = null;
1239
- }
1240
- }
1241
-
1242
- /**
1243
- * Clear all interceptors from the stack
1244
- *
1245
- * @returns {void}
1246
- */
1247
- clear() {
1248
- if (this.handlers) {
1249
- this.handlers = [];
1250
- }
1251
- }
1252
-
1253
- /**
1254
- * Iterate over all the registered interceptors
1255
- *
1256
- * This method is particularly useful for skipping over any
1257
- * interceptors that may have become `null` calling `eject`.
1258
- *
1259
- * @param {Function} fn The function to call for each interceptor
1260
- *
1261
- * @returns {void}
1262
- */
1263
- forEach(fn) {
1264
- utils$1.forEach(this.handlers, function forEachHandler(h) {
1265
- if (h !== null) {
1266
- fn(h);
1267
- }
1268
- });
1269
- }
1270
- };
1271
-
1272
- var InterceptorManager$1$1 = InterceptorManager$2;
1273
-
1274
- var transitionalDefaults$1 = {
1275
- silentJSONParsing: true,
1276
- forcedJSONParsing: true,
1277
- clarifyTimeoutError: false
1278
- };
1279
-
1280
- var URLSearchParams$1$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams$1;
1281
-
1282
- var FormData$1$1 = typeof FormData !== 'undefined' ? FormData : null;
1283
-
1284
- var Blob$1$1 = typeof Blob !== 'undefined' ? Blob : null;
1285
-
1286
- /**
1287
- * Determine if we're running in a standard browser environment
1288
- *
1289
- * This allows axios to run in a web worker, and react-native.
1290
- * Both environments support XMLHttpRequest, but not fully standard globals.
1291
- *
1292
- * web workers:
1293
- * typeof window -> undefined
1294
- * typeof document -> undefined
1295
- *
1296
- * react-native:
1297
- * navigator.product -> 'ReactNative'
1298
- * nativescript
1299
- * navigator.product -> 'NativeScript' or 'NS'
1300
- *
1301
- * @returns {boolean}
1302
- */
1303
- const isStandardBrowserEnv$1 = (() => {
1304
- let product;
1305
- if (typeof navigator !== 'undefined' && (
1306
- (product = navigator.product) === 'ReactNative' ||
1307
- product === 'NativeScript' ||
1308
- product === 'NS')
1309
- ) {
1310
- return false;
1311
- }
1312
-
1313
- return typeof window !== 'undefined' && typeof document !== 'undefined';
1314
- })();
1315
-
1316
- /**
1317
- * Determine if we're running in a standard browser webWorker environment
1318
- *
1319
- * Although the `isStandardBrowserEnv` method indicates that
1320
- * `allows axios to run in a web worker`, the WebWorker will still be
1321
- * filtered out due to its judgment standard
1322
- * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
1323
- * This leads to a problem when axios post `FormData` in webWorker
1324
- */
1325
- const isStandardBrowserWebWorkerEnv$1 = (() => {
1326
- return (
1327
- typeof WorkerGlobalScope !== 'undefined' &&
1328
- // eslint-disable-next-line no-undef
1329
- self instanceof WorkerGlobalScope &&
1330
- typeof self.importScripts === 'function'
1331
- );
1332
- })();
1333
-
1334
-
1335
- var platform$1 = {
1336
- isBrowser: true,
1337
- classes: {
1338
- URLSearchParams: URLSearchParams$1$1,
1339
- FormData: FormData$1$1,
1340
- Blob: Blob$1$1
1341
- },
1342
- isStandardBrowserEnv: isStandardBrowserEnv$1,
1343
- isStandardBrowserWebWorkerEnv: isStandardBrowserWebWorkerEnv$1,
1344
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
1345
- };
1346
-
1347
- function toURLEncodedForm$1(data, options) {
1348
- return toFormData$1(data, new platform$1.classes.URLSearchParams(), Object.assign({
1349
- visitor: function(value, key, path, helpers) {
1350
- if (platform$1.isNode && utils$1.isBuffer(value)) {
1351
- this.append(key, value.toString('base64'));
1352
- return false;
1353
- }
1354
-
1355
- return helpers.defaultVisitor.apply(this, arguments);
1356
- }
1357
- }, options));
1358
- }
1359
-
1360
- /**
1361
- * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
1362
- *
1363
- * @param {string} name - The name of the property to get.
1364
- *
1365
- * @returns An array of strings.
1366
- */
1367
- function parsePropPath$1(name) {
1368
- // foo[x][y][z]
1369
- // foo.x.y.z
1370
- // foo-x-y-z
1371
- // foo x y z
1372
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
1373
- return match[0] === '[]' ? '' : match[1] || match[0];
1374
- });
1375
- }
1376
-
1377
- /**
1378
- * Convert an array to an object.
1379
- *
1380
- * @param {Array<any>} arr - The array to convert to an object.
1381
- *
1382
- * @returns An object with the same keys and values as the array.
1383
- */
1384
- function arrayToObject$1(arr) {
1385
- const obj = {};
1386
- const keys = Object.keys(arr);
1387
- let i;
1388
- const len = keys.length;
1389
- let key;
1390
- for (i = 0; i < len; i++) {
1391
- key = keys[i];
1392
- obj[key] = arr[key];
1393
- }
1394
- return obj;
1395
- }
1396
-
1397
- /**
1398
- * It takes a FormData object and returns a JavaScript object
1399
- *
1400
- * @param {string} formData The FormData object to convert to JSON.
1401
- *
1402
- * @returns {Object<string, any> | null} The converted object.
1403
- */
1404
- function formDataToJSON$1(formData) {
1405
- function buildPath(path, value, target, index) {
1406
- let name = path[index++];
1407
- const isNumericKey = Number.isFinite(+name);
1408
- const isLast = index >= path.length;
1409
- name = !name && utils$1.isArray(target) ? target.length : name;
1410
-
1411
- if (isLast) {
1412
- if (utils$1.hasOwnProp(target, name)) {
1413
- target[name] = [target[name], value];
1414
- } else {
1415
- target[name] = value;
1416
- }
1417
-
1418
- return !isNumericKey;
1419
- }
1420
-
1421
- if (!target[name] || !utils$1.isObject(target[name])) {
1422
- target[name] = [];
1423
- }
1424
-
1425
- const result = buildPath(path, value, target[name], index);
1426
-
1427
- if (result && utils$1.isArray(target[name])) {
1428
- target[name] = arrayToObject$1(target[name]);
1429
- }
1430
-
1431
- return !isNumericKey;
1432
- }
1433
-
1434
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
1435
- const obj = {};
1436
-
1437
- utils$1.forEachEntry(formData, (name, value) => {
1438
- buildPath(parsePropPath$1(name), value, obj, 0);
1439
- });
1440
-
1441
- return obj;
1442
- }
1443
-
1444
- return null;
1445
- }
1446
-
1447
- const DEFAULT_CONTENT_TYPE$1 = {
1448
- 'Content-Type': undefined
1449
- };
1450
-
1451
- /**
1452
- * It takes a string, tries to parse it, and if it fails, it returns the stringified version
1453
- * of the input
1454
- *
1455
- * @param {any} rawValue - The value to be stringified.
1456
- * @param {Function} parser - A function that parses a string into a JavaScript object.
1457
- * @param {Function} encoder - A function that takes a value and returns a string.
1458
- *
1459
- * @returns {string} A stringified version of the rawValue.
1460
- */
1461
- function stringifySafely$1(rawValue, parser, encoder) {
1462
- if (utils$1.isString(rawValue)) {
1463
- try {
1464
- (parser || JSON.parse)(rawValue);
1465
- return utils$1.trim(rawValue);
1466
- } catch (e) {
1467
- if (e.name !== 'SyntaxError') {
1468
- throw e;
1469
- }
1470
- }
1471
- }
1472
-
1473
- return (encoder || JSON.stringify)(rawValue);
1474
- }
1475
-
1476
- const defaults$2 = {
1477
-
1478
- transitional: transitionalDefaults$1,
1479
-
1480
- adapter: ['xhr', 'http'],
1481
-
1482
- transformRequest: [function transformRequest(data, headers) {
1483
- const contentType = headers.getContentType() || '';
1484
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
1485
- const isObjectPayload = utils$1.isObject(data);
1486
-
1487
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
1488
- data = new FormData(data);
1489
- }
1490
-
1491
- const isFormData = utils$1.isFormData(data);
1492
-
1493
- if (isFormData) {
1494
- if (!hasJSONContentType) {
1495
- return data;
1496
- }
1497
- return hasJSONContentType ? JSON.stringify(formDataToJSON$1(data)) : data;
1498
- }
1499
-
1500
- if (utils$1.isArrayBuffer(data) ||
1501
- utils$1.isBuffer(data) ||
1502
- utils$1.isStream(data) ||
1503
- utils$1.isFile(data) ||
1504
- utils$1.isBlob(data)
1505
- ) {
1506
- return data;
1507
- }
1508
- if (utils$1.isArrayBufferView(data)) {
1509
- return data.buffer;
1510
- }
1511
- if (utils$1.isURLSearchParams(data)) {
1512
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
1513
- return data.toString();
1514
- }
1515
-
1516
- let isFileList;
1517
-
1518
- if (isObjectPayload) {
1519
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
1520
- return toURLEncodedForm$1(data, this.formSerializer).toString();
1521
- }
1522
-
1523
- if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1524
- const _FormData = this.env && this.env.FormData;
1525
-
1526
- return toFormData$1(
1527
- isFileList ? {'files[]': data} : data,
1528
- _FormData && new _FormData(),
1529
- this.formSerializer
1530
- );
1531
- }
1532
- }
1533
-
1534
- if (isObjectPayload || hasJSONContentType ) {
1535
- headers.setContentType('application/json', false);
1536
- return stringifySafely$1(data);
1537
- }
1538
-
1539
- return data;
1540
- }],
1541
-
1542
- transformResponse: [function transformResponse(data) {
1543
- const transitional = this.transitional || defaults$2.transitional;
1544
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1545
- const JSONRequested = this.responseType === 'json';
1546
-
1547
- if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
1548
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
1549
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
1550
-
1551
- try {
1552
- return JSON.parse(data);
1553
- } catch (e) {
1554
- if (strictJSONParsing) {
1555
- if (e.name === 'SyntaxError') {
1556
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
1557
- }
1558
- throw e;
1559
- }
1560
- }
1561
- }
1562
-
1563
- return data;
1564
- }],
1565
-
1566
- /**
1567
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
1568
- * timeout is not created.
1569
- */
1570
- timeout: 0,
1571
-
1572
- xsrfCookieName: 'XSRF-TOKEN',
1573
- xsrfHeaderName: 'X-XSRF-TOKEN',
1574
-
1575
- maxContentLength: -1,
1576
- maxBodyLength: -1,
1577
-
1578
- env: {
1579
- FormData: platform$1.classes.FormData,
1580
- Blob: platform$1.classes.Blob
1581
- },
1582
-
1583
- validateStatus: function validateStatus(status) {
1584
- return status >= 200 && status < 300;
1585
- },
1586
-
1587
- headers: {
1588
- common: {
1589
- 'Accept': 'application/json, text/plain, */*'
1590
- }
1591
- }
1592
- };
1593
-
1594
- utils$1.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
1595
- defaults$2.headers[method] = {};
1596
- });
1597
-
1598
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
1599
- defaults$2.headers[method] = utils$1.merge(DEFAULT_CONTENT_TYPE$1);
1600
- });
1601
-
1602
- var defaults$1$1 = defaults$2;
1603
-
1604
- // RawAxiosHeaders whose duplicates are ignored by node
1605
- // c.f. https://nodejs.org/api/http.html#http_message_headers
1606
- const ignoreDuplicateOf$1 = utils$1.toObjectSet([
1607
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
1608
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
1609
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
1610
- 'referer', 'retry-after', 'user-agent'
1611
- ]);
1612
-
1613
- /**
1614
- * Parse headers into an object
1615
- *
1616
- * ```
1617
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
1618
- * Content-Type: application/json
1619
- * Connection: keep-alive
1620
- * Transfer-Encoding: chunked
1621
- * ```
1622
- *
1623
- * @param {String} rawHeaders Headers needing to be parsed
1624
- *
1625
- * @returns {Object} Headers parsed into an object
1626
- */
1627
- var parseHeaders$1 = rawHeaders => {
1628
- const parsed = {};
1629
- let key;
1630
- let val;
1631
- let i;
1632
-
1633
- rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
1634
- i = line.indexOf(':');
1635
- key = line.substring(0, i).trim().toLowerCase();
1636
- val = line.substring(i + 1).trim();
1637
-
1638
- if (!key || (parsed[key] && ignoreDuplicateOf$1[key])) {
1639
- return;
1640
- }
1641
-
1642
- if (key === 'set-cookie') {
1643
- if (parsed[key]) {
1644
- parsed[key].push(val);
1645
- } else {
1646
- parsed[key] = [val];
1647
- }
1648
- } else {
1649
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1650
- }
1651
- });
1652
-
1653
- return parsed;
1654
- };
1655
-
1656
- const $internals$1 = Symbol('internals');
1657
-
1658
- function normalizeHeader$1(header) {
1659
- return header && String(header).trim().toLowerCase();
1660
- }
1661
-
1662
- function normalizeValue$1(value) {
1663
- if (value === false || value == null) {
1664
- return value;
1665
- }
1666
-
1667
- return utils$1.isArray(value) ? value.map(normalizeValue$1) : String(value);
1668
- }
1669
-
1670
- function parseTokens$1(str) {
1671
- const tokens = Object.create(null);
1672
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1673
- let match;
1674
-
1675
- while ((match = tokensRE.exec(str))) {
1676
- tokens[match[1]] = match[2];
1677
- }
1678
-
1679
- return tokens;
1680
- }
1681
-
1682
- const isValidHeaderName$1 = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1683
-
1684
- function matchHeaderValue$1(context, value, header, filter, isHeaderNameFilter) {
1685
- if (utils$1.isFunction(filter)) {
1686
- return filter.call(this, value, header);
1687
- }
1688
-
1689
- if (isHeaderNameFilter) {
1690
- value = header;
1691
- }
1692
-
1693
- if (!utils$1.isString(value)) return;
1694
-
1695
- if (utils$1.isString(filter)) {
1696
- return value.indexOf(filter) !== -1;
1697
- }
1698
-
1699
- if (utils$1.isRegExp(filter)) {
1700
- return filter.test(value);
1701
- }
1702
- }
1703
-
1704
- function formatHeader$1(header) {
1705
- return header.trim()
1706
- .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1707
- return char.toUpperCase() + str;
1708
- });
1709
- }
1710
-
1711
- function buildAccessors$1(obj, header) {
1712
- const accessorName = utils$1.toCamelCase(' ' + header);
1713
-
1714
- ['get', 'set', 'has'].forEach(methodName => {
1715
- Object.defineProperty(obj, methodName + accessorName, {
1716
- value: function(arg1, arg2, arg3) {
1717
- return this[methodName].call(this, header, arg1, arg2, arg3);
1718
- },
1719
- configurable: true
1720
- });
1721
- });
1722
- }
1723
-
1724
- let AxiosHeaders$2 = class AxiosHeaders {
1725
- constructor(headers) {
1726
- headers && this.set(headers);
1727
- }
1728
-
1729
- set(header, valueOrRewrite, rewrite) {
1730
- const self = this;
1731
-
1732
- function setHeader(_value, _header, _rewrite) {
1733
- const lHeader = normalizeHeader$1(_header);
1734
-
1735
- if (!lHeader) {
1736
- throw new Error('header name must be a non-empty string');
1737
- }
1738
-
1739
- const key = utils$1.findKey(self, lHeader);
1740
-
1741
- if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
1742
- self[key || _header] = normalizeValue$1(_value);
1743
- }
1744
- }
1745
-
1746
- const setHeaders = (headers, _rewrite) =>
1747
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1748
-
1749
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1750
- setHeaders(header, valueOrRewrite);
1751
- } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName$1(header)) {
1752
- setHeaders(parseHeaders$1(header), valueOrRewrite);
1753
- } else {
1754
- header != null && setHeader(valueOrRewrite, header, rewrite);
1755
- }
1756
-
1757
- return this;
1758
- }
1759
-
1760
- get(header, parser) {
1761
- header = normalizeHeader$1(header);
1762
-
1763
- if (header) {
1764
- const key = utils$1.findKey(this, header);
1765
-
1766
- if (key) {
1767
- const value = this[key];
1768
-
1769
- if (!parser) {
1770
- return value;
1771
- }
1772
-
1773
- if (parser === true) {
1774
- return parseTokens$1(value);
1775
- }
1776
-
1777
- if (utils$1.isFunction(parser)) {
1778
- return parser.call(this, value, key);
1779
- }
1780
-
1781
- if (utils$1.isRegExp(parser)) {
1782
- return parser.exec(value);
1783
- }
1784
-
1785
- throw new TypeError('parser must be boolean|regexp|function');
1786
- }
1787
- }
1788
- }
1789
-
1790
- has(header, matcher) {
1791
- header = normalizeHeader$1(header);
1792
-
1793
- if (header) {
1794
- const key = utils$1.findKey(this, header);
1795
-
1796
- return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue$1(this, this[key], key, matcher)));
1797
- }
1798
-
1799
- return false;
1800
- }
1801
-
1802
- delete(header, matcher) {
1803
- const self = this;
1804
- let deleted = false;
1805
-
1806
- function deleteHeader(_header) {
1807
- _header = normalizeHeader$1(_header);
1808
-
1809
- if (_header) {
1810
- const key = utils$1.findKey(self, _header);
1811
-
1812
- if (key && (!matcher || matchHeaderValue$1(self, self[key], key, matcher))) {
1813
- delete self[key];
1814
-
1815
- deleted = true;
1816
- }
1817
- }
1818
- }
1819
-
1820
- if (utils$1.isArray(header)) {
1821
- header.forEach(deleteHeader);
1822
- } else {
1823
- deleteHeader(header);
1824
- }
1825
-
1826
- return deleted;
1827
- }
1828
-
1829
- clear(matcher) {
1830
- const keys = Object.keys(this);
1831
- let i = keys.length;
1832
- let deleted = false;
1833
-
1834
- while (i--) {
1835
- const key = keys[i];
1836
- if(!matcher || matchHeaderValue$1(this, this[key], key, matcher, true)) {
1837
- delete this[key];
1838
- deleted = true;
1839
- }
1840
- }
1841
-
1842
- return deleted;
1843
- }
1844
-
1845
- normalize(format) {
1846
- const self = this;
1847
- const headers = {};
1848
-
1849
- utils$1.forEach(this, (value, header) => {
1850
- const key = utils$1.findKey(headers, header);
1851
-
1852
- if (key) {
1853
- self[key] = normalizeValue$1(value);
1854
- delete self[header];
1855
- return;
1856
- }
1857
-
1858
- const normalized = format ? formatHeader$1(header) : String(header).trim();
1859
-
1860
- if (normalized !== header) {
1861
- delete self[header];
1862
- }
1863
-
1864
- self[normalized] = normalizeValue$1(value);
1865
-
1866
- headers[normalized] = true;
1867
- });
1868
-
1869
- return this;
1870
- }
1871
-
1872
- concat(...targets) {
1873
- return this.constructor.concat(this, ...targets);
1874
- }
1875
-
1876
- toJSON(asStrings) {
1877
- const obj = Object.create(null);
1878
-
1879
- utils$1.forEach(this, (value, header) => {
1880
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
1881
- });
1882
-
1883
- return obj;
1884
- }
1885
-
1886
- [Symbol.iterator]() {
1887
- return Object.entries(this.toJSON())[Symbol.iterator]();
1888
- }
1889
-
1890
- toString() {
1891
- return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
1892
- }
1893
-
1894
- get [Symbol.toStringTag]() {
1895
- return 'AxiosHeaders';
1896
- }
1897
-
1898
- static from(thing) {
1899
- return thing instanceof this ? thing : new this(thing);
1900
- }
1901
-
1902
- static concat(first, ...targets) {
1903
- const computed = new this(first);
1904
-
1905
- targets.forEach((target) => computed.set(target));
1906
-
1907
- return computed;
1908
- }
1909
-
1910
- static accessor(header) {
1911
- const internals = this[$internals$1] = (this[$internals$1] = {
1912
- accessors: {}
1913
- });
1914
-
1915
- const accessors = internals.accessors;
1916
- const prototype = this.prototype;
1917
-
1918
- function defineAccessor(_header) {
1919
- const lHeader = normalizeHeader$1(_header);
1920
-
1921
- if (!accessors[lHeader]) {
1922
- buildAccessors$1(prototype, _header);
1923
- accessors[lHeader] = true;
1924
- }
1925
- }
1926
-
1927
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1928
-
1929
- return this;
1930
- }
1931
- };
1932
-
1933
- AxiosHeaders$2.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
1934
-
1935
- utils$1.freezeMethods(AxiosHeaders$2.prototype);
1936
- utils$1.freezeMethods(AxiosHeaders$2);
1937
-
1938
- var AxiosHeaders$1$1 = AxiosHeaders$2;
1939
-
1940
- /**
1941
- * Transform the data for a request or a response
1942
- *
1943
- * @param {Array|Function} fns A single function or Array of functions
1944
- * @param {?Object} response The response object
1945
- *
1946
- * @returns {*} The resulting transformed data
1947
- */
1948
- function transformData$1(fns, response) {
1949
- const config = this || defaults$1$1;
1950
- const context = response || config;
1951
- const headers = AxiosHeaders$1$1.from(context.headers);
1952
- let data = context.data;
1953
-
1954
- utils$1.forEach(fns, function transform(fn) {
1955
- data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
1956
- });
1957
-
1958
- headers.normalize();
1959
-
1960
- return data;
1961
- }
1962
-
1963
- function isCancel$1(value) {
1964
- return !!(value && value.__CANCEL__);
1965
- }
1966
-
1967
- /**
1968
- * A `CanceledError` is an object that is thrown when an operation is canceled.
1969
- *
1970
- * @param {string=} message The message.
1971
- * @param {Object=} config The config.
1972
- * @param {Object=} request The request.
1973
- *
1974
- * @returns {CanceledError} The created error.
1975
- */
1976
- function CanceledError$1(message, config, request) {
1977
- // eslint-disable-next-line no-eq-null,eqeqeq
1978
- AxiosError$1.call(this, message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
1979
- this.name = 'CanceledError';
1980
- }
1981
-
1982
- utils$1.inherits(CanceledError$1, AxiosError$1, {
1983
- __CANCEL__: true
1984
- });
1985
-
1986
- /**
1987
- * Resolve or reject a Promise based on response status.
1988
- *
1989
- * @param {Function} resolve A function that resolves the promise.
1990
- * @param {Function} reject A function that rejects the promise.
1991
- * @param {object} response The response.
1992
- *
1993
- * @returns {object} The response.
1994
- */
1995
- function settle$1(resolve, reject, response) {
1996
- const validateStatus = response.config.validateStatus;
1997
- if (!response.status || !validateStatus || validateStatus(response.status)) {
1998
- resolve(response);
1999
- } else {
2000
- reject(new AxiosError$1(
2001
- 'Request failed with status code ' + response.status,
2002
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2003
- response.config,
2004
- response.request,
2005
- response
2006
- ));
2007
- }
2008
- }
2009
-
2010
- var cookies$1 = platform$1.isStandardBrowserEnv ?
2011
-
2012
- // Standard browser envs support document.cookie
2013
- (function standardBrowserEnv() {
2014
- return {
2015
- write: function write(name, value, expires, path, domain, secure) {
2016
- const cookie = [];
2017
- cookie.push(name + '=' + encodeURIComponent(value));
2018
-
2019
- if (utils$1.isNumber(expires)) {
2020
- cookie.push('expires=' + new Date(expires).toGMTString());
2021
- }
2022
-
2023
- if (utils$1.isString(path)) {
2024
- cookie.push('path=' + path);
2025
- }
2026
-
2027
- if (utils$1.isString(domain)) {
2028
- cookie.push('domain=' + domain);
2029
- }
2030
-
2031
- if (secure === true) {
2032
- cookie.push('secure');
2033
- }
2034
-
2035
- document.cookie = cookie.join('; ');
2036
- },
2037
-
2038
- read: function read(name) {
2039
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
2040
- return (match ? decodeURIComponent(match[3]) : null);
2041
- },
2042
-
2043
- remove: function remove(name) {
2044
- this.write(name, '', Date.now() - 86400000);
2045
- }
2046
- };
2047
- })() :
2048
-
2049
- // Non standard browser env (web workers, react-native) lack needed support.
2050
- (function nonStandardBrowserEnv() {
2051
- return {
2052
- write: function write() {},
2053
- read: function read() { return null; },
2054
- remove: function remove() {}
2055
- };
2056
- })();
2057
-
2058
- /**
2059
- * Determines whether the specified URL is absolute
2060
- *
2061
- * @param {string} url The URL to test
2062
- *
2063
- * @returns {boolean} True if the specified URL is absolute, otherwise false
2064
- */
2065
- function isAbsoluteURL$1(url) {
2066
- // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2067
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2068
- // by any combination of letters, digits, plus, period, or hyphen.
2069
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2070
- }
2071
-
2072
- /**
2073
- * Creates a new URL by combining the specified URLs
2074
- *
2075
- * @param {string} baseURL The base URL
2076
- * @param {string} relativeURL The relative URL
2077
- *
2078
- * @returns {string} The combined URL
2079
- */
2080
- function combineURLs$1(baseURL, relativeURL) {
2081
- return relativeURL
2082
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
2083
- : baseURL;
2084
- }
2085
-
2086
- /**
2087
- * Creates a new URL by combining the baseURL with the requestedURL,
2088
- * only when the requestedURL is not already an absolute URL.
2089
- * If the requestURL is absolute, this function returns the requestedURL untouched.
2090
- *
2091
- * @param {string} baseURL The base URL
2092
- * @param {string} requestedURL Absolute or relative URL to combine
2093
- *
2094
- * @returns {string} The combined full path
2095
- */
2096
- function buildFullPath$1(baseURL, requestedURL) {
2097
- if (baseURL && !isAbsoluteURL$1(requestedURL)) {
2098
- return combineURLs$1(baseURL, requestedURL);
2099
- }
2100
- return requestedURL;
2101
- }
2102
-
2103
- var isURLSameOrigin$1 = platform$1.isStandardBrowserEnv ?
2104
-
2105
- // Standard browser envs have full support of the APIs needed to test
2106
- // whether the request URL is of the same origin as current location.
2107
- (function standardBrowserEnv() {
2108
- const msie = /(msie|trident)/i.test(navigator.userAgent);
2109
- const urlParsingNode = document.createElement('a');
2110
- let originURL;
2111
-
2112
- /**
2113
- * Parse a URL to discover it's components
2114
- *
2115
- * @param {String} url The URL to be parsed
2116
- * @returns {Object}
2117
- */
2118
- function resolveURL(url) {
2119
- let href = url;
2120
-
2121
- if (msie) {
2122
- // IE needs attribute set twice to normalize properties
2123
- urlParsingNode.setAttribute('href', href);
2124
- href = urlParsingNode.href;
2125
- }
2126
-
2127
- urlParsingNode.setAttribute('href', href);
2128
-
2129
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
2130
- return {
2131
- href: urlParsingNode.href,
2132
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
2133
- host: urlParsingNode.host,
2134
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
2135
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
2136
- hostname: urlParsingNode.hostname,
2137
- port: urlParsingNode.port,
2138
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
2139
- urlParsingNode.pathname :
2140
- '/' + urlParsingNode.pathname
2141
- };
2142
- }
2143
-
2144
- originURL = resolveURL(window.location.href);
2145
-
2146
- /**
2147
- * Determine if a URL shares the same origin as the current location
2148
- *
2149
- * @param {String} requestURL The URL to test
2150
- * @returns {boolean} True if URL shares the same origin, otherwise false
2151
- */
2152
- return function isURLSameOrigin(requestURL) {
2153
- const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2154
- return (parsed.protocol === originURL.protocol &&
2155
- parsed.host === originURL.host);
2156
- };
2157
- })() :
2158
-
2159
- // Non standard browser envs (web workers, react-native) lack needed support.
2160
- (function nonStandardBrowserEnv() {
2161
- return function isURLSameOrigin() {
2162
- return true;
2163
- };
2164
- })();
2165
-
2166
- function parseProtocol$1(url) {
2167
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2168
- return match && match[1] || '';
2169
- }
2170
-
2171
- /**
2172
- * Calculate data maxRate
2173
- * @param {Number} [samplesCount= 10]
2174
- * @param {Number} [min= 1000]
2175
- * @returns {Function}
2176
- */
2177
- function speedometer$1(samplesCount, min) {
2178
- samplesCount = samplesCount || 10;
2179
- const bytes = new Array(samplesCount);
2180
- const timestamps = new Array(samplesCount);
2181
- let head = 0;
2182
- let tail = 0;
2183
- let firstSampleTS;
2184
-
2185
- min = min !== undefined ? min : 1000;
2186
-
2187
- return function push(chunkLength) {
2188
- const now = Date.now();
2189
-
2190
- const startedAt = timestamps[tail];
2191
-
2192
- if (!firstSampleTS) {
2193
- firstSampleTS = now;
2194
- }
2195
-
2196
- bytes[head] = chunkLength;
2197
- timestamps[head] = now;
2198
-
2199
- let i = tail;
2200
- let bytesCount = 0;
2201
-
2202
- while (i !== head) {
2203
- bytesCount += bytes[i++];
2204
- i = i % samplesCount;
2205
- }
2206
-
2207
- head = (head + 1) % samplesCount;
2208
-
2209
- if (head === tail) {
2210
- tail = (tail + 1) % samplesCount;
2211
- }
2212
-
2213
- if (now - firstSampleTS < min) {
2214
- return;
2215
- }
2216
-
2217
- const passed = startedAt && now - startedAt;
2218
-
2219
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
2220
- };
2221
- }
2222
-
2223
- function progressEventReducer$1(listener, isDownloadStream) {
2224
- let bytesNotified = 0;
2225
- const _speedometer = speedometer$1(50, 250);
2226
-
2227
- return e => {
2228
- const loaded = e.loaded;
2229
- const total = e.lengthComputable ? e.total : undefined;
2230
- const progressBytes = loaded - bytesNotified;
2231
- const rate = _speedometer(progressBytes);
2232
- const inRange = loaded <= total;
2233
-
2234
- bytesNotified = loaded;
2235
-
2236
- const data = {
2237
- loaded,
2238
- total,
2239
- progress: total ? (loaded / total) : undefined,
2240
- bytes: progressBytes,
2241
- rate: rate ? rate : undefined,
2242
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
2243
- event: e
2244
- };
2245
-
2246
- data[isDownloadStream ? 'download' : 'upload'] = true;
2247
-
2248
- listener(data);
2249
- };
2250
- }
2251
-
2252
- const isXHRAdapterSupported$1 = typeof XMLHttpRequest !== 'undefined';
2253
-
2254
- var xhrAdapter$1 = isXHRAdapterSupported$1 && function (config) {
2255
- return new Promise(function dispatchXhrRequest(resolve, reject) {
2256
- let requestData = config.data;
2257
- const requestHeaders = AxiosHeaders$1$1.from(config.headers).normalize();
2258
- const responseType = config.responseType;
2259
- let onCanceled;
2260
- function done() {
2261
- if (config.cancelToken) {
2262
- config.cancelToken.unsubscribe(onCanceled);
2263
- }
2264
-
2265
- if (config.signal) {
2266
- config.signal.removeEventListener('abort', onCanceled);
2267
- }
2268
- }
2269
-
2270
- if (utils$1.isFormData(requestData)) {
2271
- if (platform$1.isStandardBrowserEnv || platform$1.isStandardBrowserWebWorkerEnv) {
2272
- requestHeaders.setContentType(false); // Let the browser set it
2273
- } else {
2274
- requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
2275
- }
2276
- }
2277
-
2278
- let request = new XMLHttpRequest();
2279
-
2280
- // HTTP basic authentication
2281
- if (config.auth) {
2282
- const username = config.auth.username || '';
2283
- const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
2284
- requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
2285
- }
2286
-
2287
- const fullPath = buildFullPath$1(config.baseURL, config.url);
2288
-
2289
- request.open(config.method.toUpperCase(), buildURL$1(fullPath, config.params, config.paramsSerializer), true);
2290
-
2291
- // Set the request timeout in MS
2292
- request.timeout = config.timeout;
2293
-
2294
- function onloadend() {
2295
- if (!request) {
2296
- return;
2297
- }
2298
- // Prepare the response
2299
- const responseHeaders = AxiosHeaders$1$1.from(
2300
- 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
2301
- );
2302
- const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
2303
- request.responseText : request.response;
2304
- const response = {
2305
- data: responseData,
2306
- status: request.status,
2307
- statusText: request.statusText,
2308
- headers: responseHeaders,
2309
- config,
2310
- request
2311
- };
2312
-
2313
- settle$1(function _resolve(value) {
2314
- resolve(value);
2315
- done();
2316
- }, function _reject(err) {
2317
- reject(err);
2318
- done();
2319
- }, response);
2320
-
2321
- // Clean up request
2322
- request = null;
2323
- }
2324
-
2325
- if ('onloadend' in request) {
2326
- // Use onloadend if available
2327
- request.onloadend = onloadend;
2328
- } else {
2329
- // Listen for ready state to emulate onloadend
2330
- request.onreadystatechange = function handleLoad() {
2331
- if (!request || request.readyState !== 4) {
2332
- return;
2333
- }
2334
-
2335
- // The request errored out and we didn't get a response, this will be
2336
- // handled by onerror instead
2337
- // With one exception: request that using file: protocol, most browsers
2338
- // will return status as 0 even though it's a successful request
2339
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
2340
- return;
2341
- }
2342
- // readystate handler is calling before onerror or ontimeout handlers,
2343
- // so we should call onloadend on the next 'tick'
2344
- setTimeout(onloadend);
2345
- };
2346
- }
2347
-
2348
- // Handle browser request cancellation (as opposed to a manual cancellation)
2349
- request.onabort = function handleAbort() {
2350
- if (!request) {
2351
- return;
2352
- }
2353
-
2354
- reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
2355
-
2356
- // Clean up request
2357
- request = null;
2358
- };
2359
-
2360
- // Handle low level network errors
2361
- request.onerror = function handleError() {
2362
- // Real errors are hidden from us by the browser
2363
- // onerror should only fire if it's a network error
2364
- reject(new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request));
2365
-
2366
- // Clean up request
2367
- request = null;
2368
- };
2369
-
2370
- // Handle timeout
2371
- request.ontimeout = function handleTimeout() {
2372
- let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
2373
- const transitional = config.transitional || transitionalDefaults$1;
2374
- if (config.timeoutErrorMessage) {
2375
- timeoutErrorMessage = config.timeoutErrorMessage;
2376
- }
2377
- reject(new AxiosError$1(
2378
- timeoutErrorMessage,
2379
- transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
2380
- config,
2381
- request));
2382
-
2383
- // Clean up request
2384
- request = null;
2385
- };
2386
-
2387
- // Add xsrf header
2388
- // This is only done if running in a standard browser environment.
2389
- // Specifically not if we're in a web worker, or react-native.
2390
- if (platform$1.isStandardBrowserEnv) {
2391
- // Add xsrf header
2392
- const xsrfValue = (config.withCredentials || isURLSameOrigin$1(fullPath))
2393
- && config.xsrfCookieName && cookies$1.read(config.xsrfCookieName);
2394
-
2395
- if (xsrfValue) {
2396
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
2397
- }
2398
- }
2399
-
2400
- // Remove Content-Type if data is undefined
2401
- requestData === undefined && requestHeaders.setContentType(null);
2402
-
2403
- // Add headers to the request
2404
- if ('setRequestHeader' in request) {
2405
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2406
- request.setRequestHeader(key, val);
2407
- });
2408
- }
2409
-
2410
- // Add withCredentials to request if needed
2411
- if (!utils$1.isUndefined(config.withCredentials)) {
2412
- request.withCredentials = !!config.withCredentials;
2413
- }
2414
-
2415
- // Add responseType to request if needed
2416
- if (responseType && responseType !== 'json') {
2417
- request.responseType = config.responseType;
2418
- }
2419
-
2420
- // Handle progress if needed
2421
- if (typeof config.onDownloadProgress === 'function') {
2422
- request.addEventListener('progress', progressEventReducer$1(config.onDownloadProgress, true));
2423
- }
2424
-
2425
- // Not all browsers support upload events
2426
- if (typeof config.onUploadProgress === 'function' && request.upload) {
2427
- request.upload.addEventListener('progress', progressEventReducer$1(config.onUploadProgress));
2428
- }
2429
-
2430
- if (config.cancelToken || config.signal) {
2431
- // Handle cancellation
2432
- // eslint-disable-next-line func-names
2433
- onCanceled = cancel => {
2434
- if (!request) {
2435
- return;
2436
- }
2437
- reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
2438
- request.abort();
2439
- request = null;
2440
- };
2441
-
2442
- config.cancelToken && config.cancelToken.subscribe(onCanceled);
2443
- if (config.signal) {
2444
- config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
2445
- }
2446
- }
2447
-
2448
- const protocol = parseProtocol$1(fullPath);
2449
-
2450
- if (protocol && platform$1.protocols.indexOf(protocol) === -1) {
2451
- reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
2452
- return;
2453
- }
2454
-
2455
-
2456
- // Send the request
2457
- request.send(requestData || null);
2458
- });
2459
- };
2460
-
2461
- const knownAdapters$1 = {
2462
- http: httpAdapter$1,
2463
- xhr: xhrAdapter$1
2464
- };
2465
-
2466
- utils$1.forEach(knownAdapters$1, (fn, value) => {
2467
- if(fn) {
2468
- try {
2469
- Object.defineProperty(fn, 'name', {value});
2470
- } catch (e) {
2471
- // eslint-disable-next-line no-empty
2472
- }
2473
- Object.defineProperty(fn, 'adapterName', {value});
2474
- }
2475
- });
2476
-
2477
- var adapters$1 = {
2478
- getAdapter: (adapters) => {
2479
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
2480
-
2481
- const {length} = adapters;
2482
- let nameOrAdapter;
2483
- let adapter;
2484
-
2485
- for (let i = 0; i < length; i++) {
2486
- nameOrAdapter = adapters[i];
2487
- if((adapter = utils$1.isString(nameOrAdapter) ? knownAdapters$1[nameOrAdapter.toLowerCase()] : nameOrAdapter)) {
2488
- break;
2489
- }
2490
- }
2491
-
2492
- if (!adapter) {
2493
- if (adapter === false) {
2494
- throw new AxiosError$1(
2495
- `Adapter ${nameOrAdapter} is not supported by the environment`,
2496
- 'ERR_NOT_SUPPORT'
2497
- );
2498
- }
2499
-
2500
- throw new Error(
2501
- utils$1.hasOwnProp(knownAdapters$1, nameOrAdapter) ?
2502
- `Adapter '${nameOrAdapter}' is not available in the build` :
2503
- `Unknown adapter '${nameOrAdapter}'`
2504
- );
2505
- }
2506
-
2507
- if (!utils$1.isFunction(adapter)) {
2508
- throw new TypeError('adapter is not a function');
2509
- }
2510
-
2511
- return adapter;
2512
- },
2513
- adapters: knownAdapters$1
2514
- };
2515
-
2516
- /**
2517
- * Throws a `CanceledError` if cancellation has been requested.
2518
- *
2519
- * @param {Object} config The config that is to be used for the request
2520
- *
2521
- * @returns {void}
2522
- */
2523
- function throwIfCancellationRequested$1(config) {
2524
- if (config.cancelToken) {
2525
- config.cancelToken.throwIfRequested();
2526
- }
2527
-
2528
- if (config.signal && config.signal.aborted) {
2529
- throw new CanceledError$1(null, config);
2530
- }
2531
- }
2532
-
2533
- /**
2534
- * Dispatch a request to the server using the configured adapter.
2535
- *
2536
- * @param {object} config The config that is to be used for the request
2537
- *
2538
- * @returns {Promise} The Promise to be fulfilled
2539
- */
2540
- function dispatchRequest$1(config) {
2541
- throwIfCancellationRequested$1(config);
2542
-
2543
- config.headers = AxiosHeaders$1$1.from(config.headers);
2544
-
2545
- // Transform request data
2546
- config.data = transformData$1.call(
2547
- config,
2548
- config.transformRequest
2549
- );
2550
-
2551
- if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
2552
- config.headers.setContentType('application/x-www-form-urlencoded', false);
2553
- }
2554
-
2555
- const adapter = adapters$1.getAdapter(config.adapter || defaults$1$1.adapter);
2556
-
2557
- return adapter(config).then(function onAdapterResolution(response) {
2558
- throwIfCancellationRequested$1(config);
2559
-
2560
- // Transform response data
2561
- response.data = transformData$1.call(
2562
- config,
2563
- config.transformResponse,
2564
- response
2565
- );
2566
-
2567
- response.headers = AxiosHeaders$1$1.from(response.headers);
2568
-
2569
- return response;
2570
- }, function onAdapterRejection(reason) {
2571
- if (!isCancel$1(reason)) {
2572
- throwIfCancellationRequested$1(config);
2573
-
2574
- // Transform response data
2575
- if (reason && reason.response) {
2576
- reason.response.data = transformData$1.call(
2577
- config,
2578
- config.transformResponse,
2579
- reason.response
2580
- );
2581
- reason.response.headers = AxiosHeaders$1$1.from(reason.response.headers);
2582
- }
2583
- }
2584
-
2585
- return Promise.reject(reason);
2586
- });
2587
- }
2588
-
2589
- const headersToObject$1 = (thing) => thing instanceof AxiosHeaders$1$1 ? thing.toJSON() : thing;
2590
-
2591
- /**
2592
- * Config-specific merge-function which creates a new config-object
2593
- * by merging two configuration objects together.
2594
- *
2595
- * @param {Object} config1
2596
- * @param {Object} config2
2597
- *
2598
- * @returns {Object} New object resulting from merging config2 to config1
2599
- */
2600
- function mergeConfig$1(config1, config2) {
2601
- // eslint-disable-next-line no-param-reassign
2602
- config2 = config2 || {};
2603
- const config = {};
2604
-
2605
- function getMergedValue(target, source, caseless) {
2606
- if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
2607
- return utils$1.merge.call({caseless}, target, source);
2608
- } else if (utils$1.isPlainObject(source)) {
2609
- return utils$1.merge({}, source);
2610
- } else if (utils$1.isArray(source)) {
2611
- return source.slice();
2612
- }
2613
- return source;
2614
- }
2615
-
2616
- // eslint-disable-next-line consistent-return
2617
- function mergeDeepProperties(a, b, caseless) {
2618
- if (!utils$1.isUndefined(b)) {
2619
- return getMergedValue(a, b, caseless);
2620
- } else if (!utils$1.isUndefined(a)) {
2621
- return getMergedValue(undefined, a, caseless);
2622
- }
2623
- }
2624
-
2625
- // eslint-disable-next-line consistent-return
2626
- function valueFromConfig2(a, b) {
2627
- if (!utils$1.isUndefined(b)) {
2628
- return getMergedValue(undefined, b);
2629
- }
2630
- }
2631
-
2632
- // eslint-disable-next-line consistent-return
2633
- function defaultToConfig2(a, b) {
2634
- if (!utils$1.isUndefined(b)) {
2635
- return getMergedValue(undefined, b);
2636
- } else if (!utils$1.isUndefined(a)) {
2637
- return getMergedValue(undefined, a);
2638
- }
2639
- }
2640
-
2641
- // eslint-disable-next-line consistent-return
2642
- function mergeDirectKeys(a, b, prop) {
2643
- if (prop in config2) {
2644
- return getMergedValue(a, b);
2645
- } else if (prop in config1) {
2646
- return getMergedValue(undefined, a);
2647
- }
2648
- }
2649
-
2650
- const mergeMap = {
2651
- url: valueFromConfig2,
2652
- method: valueFromConfig2,
2653
- data: valueFromConfig2,
2654
- baseURL: defaultToConfig2,
2655
- transformRequest: defaultToConfig2,
2656
- transformResponse: defaultToConfig2,
2657
- paramsSerializer: defaultToConfig2,
2658
- timeout: defaultToConfig2,
2659
- timeoutMessage: defaultToConfig2,
2660
- withCredentials: defaultToConfig2,
2661
- adapter: defaultToConfig2,
2662
- responseType: defaultToConfig2,
2663
- xsrfCookieName: defaultToConfig2,
2664
- xsrfHeaderName: defaultToConfig2,
2665
- onUploadProgress: defaultToConfig2,
2666
- onDownloadProgress: defaultToConfig2,
2667
- decompress: defaultToConfig2,
2668
- maxContentLength: defaultToConfig2,
2669
- maxBodyLength: defaultToConfig2,
2670
- beforeRedirect: defaultToConfig2,
2671
- transport: defaultToConfig2,
2672
- httpAgent: defaultToConfig2,
2673
- httpsAgent: defaultToConfig2,
2674
- cancelToken: defaultToConfig2,
2675
- socketPath: defaultToConfig2,
2676
- responseEncoding: defaultToConfig2,
2677
- validateStatus: mergeDirectKeys,
2678
- headers: (a, b) => mergeDeepProperties(headersToObject$1(a), headersToObject$1(b), true)
2679
- };
2680
-
2681
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2682
- const merge = mergeMap[prop] || mergeDeepProperties;
2683
- const configValue = merge(config1[prop], config2[prop], prop);
2684
- (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2685
- });
2686
-
2687
- return config;
2688
- }
2689
-
2690
- const VERSION$1 = "1.4.0";
2691
-
2692
- const validators$1$1 = {};
2693
-
2694
- // eslint-disable-next-line func-names
2695
- ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
2696
- validators$1$1[type] = function validator(thing) {
2697
- return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
2698
- };
2699
- });
2700
-
2701
- const deprecatedWarnings$1 = {};
2702
-
2703
- /**
2704
- * Transitional option validator
2705
- *
2706
- * @param {function|boolean?} validator - set to false if the transitional option has been removed
2707
- * @param {string?} version - deprecated version / removed since version
2708
- * @param {string?} message - some message with additional info
2709
- *
2710
- * @returns {function}
2711
- */
2712
- validators$1$1.transitional = function transitional(validator, version, message) {
2713
- function formatMessage(opt, desc) {
2714
- return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
2715
- }
2716
-
2717
- // eslint-disable-next-line func-names
2718
- return (value, opt, opts) => {
2719
- if (validator === false) {
2720
- throw new AxiosError$1(
2721
- formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
2722
- AxiosError$1.ERR_DEPRECATED
2723
- );
2724
- }
2725
-
2726
- if (version && !deprecatedWarnings$1[opt]) {
2727
- deprecatedWarnings$1[opt] = true;
2728
- // eslint-disable-next-line no-console
2729
- console.warn(
2730
- formatMessage(
2731
- opt,
2732
- ' has been deprecated since v' + version + ' and will be removed in the near future'
2733
- )
2734
- );
2735
- }
2736
-
2737
- return validator ? validator(value, opt, opts) : true;
2738
- };
2739
- };
2740
-
2741
- /**
2742
- * Assert object's properties type
2743
- *
2744
- * @param {object} options
2745
- * @param {object} schema
2746
- * @param {boolean?} allowUnknown
2747
- *
2748
- * @returns {object}
2749
- */
2750
-
2751
- function assertOptions$1(options, schema, allowUnknown) {
2752
- if (typeof options !== 'object') {
2753
- throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
2754
- }
2755
- const keys = Object.keys(options);
2756
- let i = keys.length;
2757
- while (i-- > 0) {
2758
- const opt = keys[i];
2759
- const validator = schema[opt];
2760
- if (validator) {
2761
- const value = options[opt];
2762
- const result = value === undefined || validator(value, opt, options);
2763
- if (result !== true) {
2764
- throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
2765
- }
2766
- continue;
2767
- }
2768
- if (allowUnknown !== true) {
2769
- throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
2770
- }
2771
- }
2772
- }
2773
-
2774
- var validator$1 = {
2775
- assertOptions: assertOptions$1,
2776
- validators: validators$1$1
2777
- };
2778
-
2779
- const validators$2 = validator$1.validators;
2780
-
2781
- /**
2782
- * Create a new instance of Axios
2783
- *
2784
- * @param {Object} instanceConfig The default config for the instance
2785
- *
2786
- * @return {Axios} A new instance of Axios
2787
- */
2788
- let Axios$2 = class Axios {
2789
- constructor(instanceConfig) {
2790
- this.defaults = instanceConfig;
2791
- this.interceptors = {
2792
- request: new InterceptorManager$1$1(),
2793
- response: new InterceptorManager$1$1()
2794
- };
2795
- }
2796
-
2797
- /**
2798
- * Dispatch a request
2799
- *
2800
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2801
- * @param {?Object} config
2802
- *
2803
- * @returns {Promise} The Promise to be fulfilled
2804
- */
2805
- request(configOrUrl, config) {
2806
- /*eslint no-param-reassign:0*/
2807
- // Allow for axios('example/url'[, config]) a la fetch API
2808
- if (typeof configOrUrl === 'string') {
2809
- config = config || {};
2810
- config.url = configOrUrl;
2811
- } else {
2812
- config = configOrUrl || {};
2813
- }
2814
-
2815
- config = mergeConfig$1(this.defaults, config);
2816
-
2817
- const {transitional, paramsSerializer, headers} = config;
2818
-
2819
- if (transitional !== undefined) {
2820
- validator$1.assertOptions(transitional, {
2821
- silentJSONParsing: validators$2.transitional(validators$2.boolean),
2822
- forcedJSONParsing: validators$2.transitional(validators$2.boolean),
2823
- clarifyTimeoutError: validators$2.transitional(validators$2.boolean)
2824
- }, false);
2825
- }
2826
-
2827
- if (paramsSerializer != null) {
2828
- if (utils$1.isFunction(paramsSerializer)) {
2829
- config.paramsSerializer = {
2830
- serialize: paramsSerializer
2831
- };
2832
- } else {
2833
- validator$1.assertOptions(paramsSerializer, {
2834
- encode: validators$2.function,
2835
- serialize: validators$2.function
2836
- }, true);
2837
- }
2838
- }
2839
-
2840
- // Set config.method
2841
- config.method = (config.method || this.defaults.method || 'get').toLowerCase();
2842
-
2843
- let contextHeaders;
2844
-
2845
- // Flatten headers
2846
- contextHeaders = headers && utils$1.merge(
2847
- headers.common,
2848
- headers[config.method]
2849
- );
2850
-
2851
- contextHeaders && utils$1.forEach(
2852
- ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
2853
- (method) => {
2854
- delete headers[method];
2855
- }
2856
- );
2857
-
2858
- config.headers = AxiosHeaders$1$1.concat(contextHeaders, headers);
2859
-
2860
- // filter out skipped interceptors
2861
- const requestInterceptorChain = [];
2862
- let synchronousRequestInterceptors = true;
2863
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
2864
- if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
2865
- return;
2866
- }
2867
-
2868
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
2869
-
2870
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
2871
- });
2872
-
2873
- const responseInterceptorChain = [];
2874
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
2875
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
2876
- });
2877
-
2878
- let promise;
2879
- let i = 0;
2880
- let len;
2881
-
2882
- if (!synchronousRequestInterceptors) {
2883
- const chain = [dispatchRequest$1.bind(this), undefined];
2884
- chain.unshift.apply(chain, requestInterceptorChain);
2885
- chain.push.apply(chain, responseInterceptorChain);
2886
- len = chain.length;
2887
-
2888
- promise = Promise.resolve(config);
2889
-
2890
- while (i < len) {
2891
- promise = promise.then(chain[i++], chain[i++]);
2892
- }
2893
-
2894
- return promise;
2895
- }
2896
-
2897
- len = requestInterceptorChain.length;
2898
-
2899
- let newConfig = config;
2900
-
2901
- i = 0;
2902
-
2903
- while (i < len) {
2904
- const onFulfilled = requestInterceptorChain[i++];
2905
- const onRejected = requestInterceptorChain[i++];
2906
- try {
2907
- newConfig = onFulfilled(newConfig);
2908
- } catch (error) {
2909
- onRejected.call(this, error);
2910
- break;
2911
- }
2912
- }
2913
-
2914
- try {
2915
- promise = dispatchRequest$1.call(this, newConfig);
2916
- } catch (error) {
2917
- return Promise.reject(error);
2918
- }
2919
-
2920
- i = 0;
2921
- len = responseInterceptorChain.length;
2922
-
2923
- while (i < len) {
2924
- promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
2925
- }
2926
-
2927
- return promise;
2928
- }
2929
-
2930
- getUri(config) {
2931
- config = mergeConfig$1(this.defaults, config);
2932
- const fullPath = buildFullPath$1(config.baseURL, config.url);
2933
- return buildURL$1(fullPath, config.params, config.paramsSerializer);
2934
- }
2935
- };
2936
-
2937
- // Provide aliases for supported request methods
2938
- utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
2939
- /*eslint func-names:0*/
2940
- Axios$2.prototype[method] = function(url, config) {
2941
- return this.request(mergeConfig$1(config || {}, {
2942
- method,
2943
- url,
2944
- data: (config || {}).data
2945
- }));
2946
- };
2947
- });
2948
-
2949
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
2950
- /*eslint func-names:0*/
2951
-
2952
- function generateHTTPMethod(isForm) {
2953
- return function httpMethod(url, data, config) {
2954
- return this.request(mergeConfig$1(config || {}, {
2955
- method,
2956
- headers: isForm ? {
2957
- 'Content-Type': 'multipart/form-data'
2958
- } : {},
2959
- url,
2960
- data
2961
- }));
2962
- };
2963
- }
2964
-
2965
- Axios$2.prototype[method] = generateHTTPMethod();
2966
-
2967
- Axios$2.prototype[method + 'Form'] = generateHTTPMethod(true);
2968
- });
2969
-
2970
- var Axios$1$1 = Axios$2;
2971
-
2972
- /**
2973
- * A `CancelToken` is an object that can be used to request cancellation of an operation.
2974
- *
2975
- * @param {Function} executor The executor function.
2976
- *
2977
- * @returns {CancelToken}
2978
- */
2979
- let CancelToken$2 = class CancelToken {
2980
- constructor(executor) {
2981
- if (typeof executor !== 'function') {
2982
- throw new TypeError('executor must be a function.');
2983
- }
2984
-
2985
- let resolvePromise;
2986
-
2987
- this.promise = new Promise(function promiseExecutor(resolve) {
2988
- resolvePromise = resolve;
2989
- });
2990
-
2991
- const token = this;
2992
-
2993
- // eslint-disable-next-line func-names
2994
- this.promise.then(cancel => {
2995
- if (!token._listeners) return;
2996
-
2997
- let i = token._listeners.length;
2998
-
2999
- while (i-- > 0) {
3000
- token._listeners[i](cancel);
3001
- }
3002
- token._listeners = null;
3003
- });
3004
-
3005
- // eslint-disable-next-line func-names
3006
- this.promise.then = onfulfilled => {
3007
- let _resolve;
3008
- // eslint-disable-next-line func-names
3009
- const promise = new Promise(resolve => {
3010
- token.subscribe(resolve);
3011
- _resolve = resolve;
3012
- }).then(onfulfilled);
3013
-
3014
- promise.cancel = function reject() {
3015
- token.unsubscribe(_resolve);
3016
- };
3017
-
3018
- return promise;
3019
- };
3020
-
3021
- executor(function cancel(message, config, request) {
3022
- if (token.reason) {
3023
- // Cancellation has already been requested
3024
- return;
3025
- }
3026
-
3027
- token.reason = new CanceledError$1(message, config, request);
3028
- resolvePromise(token.reason);
3029
- });
3030
- }
3031
-
3032
- /**
3033
- * Throws a `CanceledError` if cancellation has been requested.
3034
- */
3035
- throwIfRequested() {
3036
- if (this.reason) {
3037
- throw this.reason;
3038
- }
3039
- }
3040
-
3041
- /**
3042
- * Subscribe to the cancel signal
3043
- */
3044
-
3045
- subscribe(listener) {
3046
- if (this.reason) {
3047
- listener(this.reason);
3048
- return;
3049
- }
3050
-
3051
- if (this._listeners) {
3052
- this._listeners.push(listener);
3053
- } else {
3054
- this._listeners = [listener];
3055
- }
3056
- }
3057
-
3058
- /**
3059
- * Unsubscribe from the cancel signal
3060
- */
3061
-
3062
- unsubscribe(listener) {
3063
- if (!this._listeners) {
3064
- return;
3065
- }
3066
- const index = this._listeners.indexOf(listener);
3067
- if (index !== -1) {
3068
- this._listeners.splice(index, 1);
3069
- }
3070
- }
3071
-
3072
- /**
3073
- * Returns an object that contains a new `CancelToken` and a function that, when called,
3074
- * cancels the `CancelToken`.
3075
- */
3076
- static source() {
3077
- let cancel;
3078
- const token = new CancelToken(function executor(c) {
3079
- cancel = c;
3080
- });
3081
- return {
3082
- token,
3083
- cancel
3084
- };
3085
- }
3086
- };
3087
-
3088
- var CancelToken$1$1 = CancelToken$2;
3089
-
3090
- /**
3091
- * Syntactic sugar for invoking a function and expanding an array for arguments.
3092
- *
3093
- * Common use case would be to use `Function.prototype.apply`.
3094
- *
3095
- * ```js
3096
- * function f(x, y, z) {}
3097
- * var args = [1, 2, 3];
3098
- * f.apply(null, args);
3099
- * ```
3100
- *
3101
- * With `spread` this example can be re-written.
3102
- *
3103
- * ```js
3104
- * spread(function(x, y, z) {})([1, 2, 3]);
3105
- * ```
3106
- *
3107
- * @param {Function} callback
3108
- *
3109
- * @returns {Function}
3110
- */
3111
- function spread$1(callback) {
3112
- return function wrap(arr) {
3113
- return callback.apply(null, arr);
3114
- };
3115
- }
3116
-
3117
- /**
3118
- * Determines whether the payload is an error thrown by Axios
3119
- *
3120
- * @param {*} payload The value to test
3121
- *
3122
- * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
3123
- */
3124
- function isAxiosError$1(payload) {
3125
- return utils$1.isObject(payload) && (payload.isAxiosError === true);
3126
- }
3127
-
3128
- const HttpStatusCode$2 = {
3129
- Continue: 100,
3130
- SwitchingProtocols: 101,
3131
- Processing: 102,
3132
- EarlyHints: 103,
3133
- Ok: 200,
3134
- Created: 201,
3135
- Accepted: 202,
3136
- NonAuthoritativeInformation: 203,
3137
- NoContent: 204,
3138
- ResetContent: 205,
3139
- PartialContent: 206,
3140
- MultiStatus: 207,
3141
- AlreadyReported: 208,
3142
- ImUsed: 226,
3143
- MultipleChoices: 300,
3144
- MovedPermanently: 301,
3145
- Found: 302,
3146
- SeeOther: 303,
3147
- NotModified: 304,
3148
- UseProxy: 305,
3149
- Unused: 306,
3150
- TemporaryRedirect: 307,
3151
- PermanentRedirect: 308,
3152
- BadRequest: 400,
3153
- Unauthorized: 401,
3154
- PaymentRequired: 402,
3155
- Forbidden: 403,
3156
- NotFound: 404,
3157
- MethodNotAllowed: 405,
3158
- NotAcceptable: 406,
3159
- ProxyAuthenticationRequired: 407,
3160
- RequestTimeout: 408,
3161
- Conflict: 409,
3162
- Gone: 410,
3163
- LengthRequired: 411,
3164
- PreconditionFailed: 412,
3165
- PayloadTooLarge: 413,
3166
- UriTooLong: 414,
3167
- UnsupportedMediaType: 415,
3168
- RangeNotSatisfiable: 416,
3169
- ExpectationFailed: 417,
3170
- ImATeapot: 418,
3171
- MisdirectedRequest: 421,
3172
- UnprocessableEntity: 422,
3173
- Locked: 423,
3174
- FailedDependency: 424,
3175
- TooEarly: 425,
3176
- UpgradeRequired: 426,
3177
- PreconditionRequired: 428,
3178
- TooManyRequests: 429,
3179
- RequestHeaderFieldsTooLarge: 431,
3180
- UnavailableForLegalReasons: 451,
3181
- InternalServerError: 500,
3182
- NotImplemented: 501,
3183
- BadGateway: 502,
3184
- ServiceUnavailable: 503,
3185
- GatewayTimeout: 504,
3186
- HttpVersionNotSupported: 505,
3187
- VariantAlsoNegotiates: 506,
3188
- InsufficientStorage: 507,
3189
- LoopDetected: 508,
3190
- NotExtended: 510,
3191
- NetworkAuthenticationRequired: 511,
3192
- };
3193
-
3194
- Object.entries(HttpStatusCode$2).forEach(([key, value]) => {
3195
- HttpStatusCode$2[value] = key;
3196
- });
3197
-
3198
- var HttpStatusCode$1$1 = HttpStatusCode$2;
3199
-
3200
- /**
3201
- * Create an instance of Axios
3202
- *
3203
- * @param {Object} defaultConfig The default config for the instance
3204
- *
3205
- * @returns {Axios} A new instance of Axios
3206
- */
3207
- function createInstance$1(defaultConfig) {
3208
- const context = new Axios$1$1(defaultConfig);
3209
- const instance = bind$1(Axios$1$1.prototype.request, context);
3210
-
3211
- // Copy axios.prototype to instance
3212
- utils$1.extend(instance, Axios$1$1.prototype, context, {allOwnKeys: true});
3213
-
3214
- // Copy context to instance
3215
- utils$1.extend(instance, context, null, {allOwnKeys: true});
3216
-
3217
- // Factory for creating new instances
3218
- instance.create = function create(instanceConfig) {
3219
- return createInstance$1(mergeConfig$1(defaultConfig, instanceConfig));
3220
- };
3221
-
3222
- return instance;
3223
- }
3224
-
3225
- // Create the default instance to be exported
3226
- const axios$1 = createInstance$1(defaults$1$1);
3227
-
3228
- // Expose Axios class to allow class inheritance
3229
- axios$1.Axios = Axios$1$1;
3230
-
3231
- // Expose Cancel & CancelToken
3232
- axios$1.CanceledError = CanceledError$1;
3233
- axios$1.CancelToken = CancelToken$1$1;
3234
- axios$1.isCancel = isCancel$1;
3235
- axios$1.VERSION = VERSION$1;
3236
- axios$1.toFormData = toFormData$1;
3237
-
3238
- // Expose AxiosError class
3239
- axios$1.AxiosError = AxiosError$1;
3240
-
3241
- // alias for CanceledError for backward compatibility
3242
- axios$1.Cancel = axios$1.CanceledError;
3243
-
3244
- // Expose all/spread
3245
- axios$1.all = function all(promises) {
3246
- return Promise.all(promises);
3247
- };
3248
-
3249
- axios$1.spread = spread$1;
3250
-
3251
- // Expose isAxiosError
3252
- axios$1.isAxiosError = isAxiosError$1;
3253
-
3254
- // Expose mergeConfig
3255
- axios$1.mergeConfig = mergeConfig$1;
3256
-
3257
- axios$1.AxiosHeaders = AxiosHeaders$1$1;
3258
-
3259
- axios$1.formToJSON = thing => formDataToJSON$1(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
3260
-
3261
- axios$1.HttpStatusCode = HttpStatusCode$1$1;
3262
-
3263
- axios$1.default = axios$1;
3264
-
3265
- // this module should only have a default export
3266
- var globalAxios$1 = axios$1;
3267
-
3268
60
  /* tslint:disable */
3269
61
  /* eslint-disable */
3270
62
  /**
@@ -5385,57 +2177,57 @@ const TokenContractType = {
5385
2177
  */
5386
2178
 
5387
2179
  var index = /*#__PURE__*/Object.freeze({
5388
- __proto__: null,
5389
- APIError400AllOfCodeEnum: APIError400AllOfCodeEnum,
5390
- APIError401AllOfCodeEnum: APIError401AllOfCodeEnum,
5391
- APIError403AllOfCodeEnum: APIError403AllOfCodeEnum,
5392
- APIError404AllOfCodeEnum: APIError404AllOfCodeEnum,
5393
- APIError429AllOfCodeEnum: APIError429AllOfCodeEnum,
5394
- APIError500AllOfCodeEnum: APIError500AllOfCodeEnum,
5395
- ActivitiesApi: ActivitiesApi,
5396
- ActivitiesApiAxiosParamCreator: ActivitiesApiAxiosParamCreator,
5397
- ActivitiesApiFactory: ActivitiesApiFactory,
5398
- ActivitiesApiFp: ActivitiesApiFp,
5399
- ActivityType: ActivityType,
5400
- ChainsApi: ChainsApi,
5401
- ChainsApiAxiosParamCreator: ChainsApiAxiosParamCreator,
5402
- ChainsApiFactory: ChainsApiFactory,
5403
- ChainsApiFp: ChainsApiFp,
5404
- CollectionContractType: CollectionContractType,
5405
- CollectionsApi: CollectionsApi,
5406
- CollectionsApiAxiosParamCreator: CollectionsApiAxiosParamCreator,
5407
- CollectionsApiFactory: CollectionsApiFactory,
5408
- CollectionsApiFp: CollectionsApiFp,
5409
- Configuration: Configuration$1,
5410
- CreateOrderProtocolDataOrderTypeEnum: CreateOrderProtocolDataOrderTypeEnum,
5411
- ERC20ItemItemTypeEnum: ERC20ItemItemTypeEnum,
5412
- ERC721ItemItemTypeEnum: ERC721ItemItemTypeEnum,
5413
- FeeFeeTypeEnum: FeeFeeTypeEnum,
5414
- NFTContractType: NFTContractType,
5415
- NativeItemItemTypeEnum: NativeItemItemTypeEnum,
5416
- NftOwnersApi: NftOwnersApi,
5417
- NftOwnersApiAxiosParamCreator: NftOwnersApiAxiosParamCreator,
5418
- NftOwnersApiFactory: NftOwnersApiFactory,
5419
- NftOwnersApiFp: NftOwnersApiFp,
5420
- NftsApi: NftsApi,
5421
- NftsApiAxiosParamCreator: NftsApiAxiosParamCreator,
5422
- NftsApiFactory: NftsApiFactory,
5423
- NftsApiFp: NftsApiFp,
5424
- OrderStatus: OrderStatus$1,
5425
- OrdersApi: OrdersApi,
5426
- OrdersApiAxiosParamCreator: OrdersApiAxiosParamCreator,
5427
- OrdersApiFactory: OrdersApiFactory,
5428
- OrdersApiFp: OrdersApiFp,
5429
- PassportApi: PassportApi,
5430
- PassportApiAxiosParamCreator: PassportApiAxiosParamCreator,
5431
- PassportApiFactory: PassportApiFactory,
5432
- PassportApiFp: PassportApiFp,
5433
- SaleFeeTypeEnum: SaleFeeTypeEnum,
5434
- TokenContractType: TokenContractType,
5435
- TokensApi: TokensApi,
5436
- TokensApiAxiosParamCreator: TokensApiAxiosParamCreator,
5437
- TokensApiFactory: TokensApiFactory,
5438
- TokensApiFp: TokensApiFp
2180
+ __proto__: null,
2181
+ APIError400AllOfCodeEnum: APIError400AllOfCodeEnum,
2182
+ APIError401AllOfCodeEnum: APIError401AllOfCodeEnum,
2183
+ APIError403AllOfCodeEnum: APIError403AllOfCodeEnum,
2184
+ APIError404AllOfCodeEnum: APIError404AllOfCodeEnum,
2185
+ APIError429AllOfCodeEnum: APIError429AllOfCodeEnum,
2186
+ APIError500AllOfCodeEnum: APIError500AllOfCodeEnum,
2187
+ ActivitiesApi: ActivitiesApi,
2188
+ ActivitiesApiAxiosParamCreator: ActivitiesApiAxiosParamCreator,
2189
+ ActivitiesApiFactory: ActivitiesApiFactory,
2190
+ ActivitiesApiFp: ActivitiesApiFp,
2191
+ ActivityType: ActivityType,
2192
+ ChainsApi: ChainsApi,
2193
+ ChainsApiAxiosParamCreator: ChainsApiAxiosParamCreator,
2194
+ ChainsApiFactory: ChainsApiFactory,
2195
+ ChainsApiFp: ChainsApiFp,
2196
+ CollectionContractType: CollectionContractType,
2197
+ CollectionsApi: CollectionsApi,
2198
+ CollectionsApiAxiosParamCreator: CollectionsApiAxiosParamCreator,
2199
+ CollectionsApiFactory: CollectionsApiFactory,
2200
+ CollectionsApiFp: CollectionsApiFp,
2201
+ Configuration: Configuration$1,
2202
+ CreateOrderProtocolDataOrderTypeEnum: CreateOrderProtocolDataOrderTypeEnum,
2203
+ ERC20ItemItemTypeEnum: ERC20ItemItemTypeEnum,
2204
+ ERC721ItemItemTypeEnum: ERC721ItemItemTypeEnum,
2205
+ FeeFeeTypeEnum: FeeFeeTypeEnum,
2206
+ NFTContractType: NFTContractType,
2207
+ NativeItemItemTypeEnum: NativeItemItemTypeEnum,
2208
+ NftOwnersApi: NftOwnersApi,
2209
+ NftOwnersApiAxiosParamCreator: NftOwnersApiAxiosParamCreator,
2210
+ NftOwnersApiFactory: NftOwnersApiFactory,
2211
+ NftOwnersApiFp: NftOwnersApiFp,
2212
+ NftsApi: NftsApi,
2213
+ NftsApiAxiosParamCreator: NftsApiAxiosParamCreator,
2214
+ NftsApiFactory: NftsApiFactory,
2215
+ NftsApiFp: NftsApiFp,
2216
+ OrderStatus: OrderStatus$1,
2217
+ OrdersApi: OrdersApi,
2218
+ OrdersApiAxiosParamCreator: OrdersApiAxiosParamCreator,
2219
+ OrdersApiFactory: OrdersApiFactory,
2220
+ OrdersApiFp: OrdersApiFp,
2221
+ PassportApi: PassportApi,
2222
+ PassportApiAxiosParamCreator: PassportApiAxiosParamCreator,
2223
+ PassportApiFactory: PassportApiFactory,
2224
+ PassportApiFp: PassportApiFp,
2225
+ SaleFeeTypeEnum: SaleFeeTypeEnum,
2226
+ TokenContractType: TokenContractType,
2227
+ TokensApi: TokensApi,
2228
+ TokensApiAxiosParamCreator: TokensApiAxiosParamCreator,
2229
+ TokensApiFactory: TokensApiFactory,
2230
+ TokensApiFp: TokensApiFp
5439
2231
  });
5440
2232
 
5441
2233
  /**
@@ -5457,7 +2249,7 @@ class APIError extends Error {
5457
2249
 
5458
2250
  /* eslint-disable implicit-arrow-linebreak */
5459
2251
  const defaultHeaders = {
5460
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.4.0-alpha.1',
2252
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.4.0-alpha.2',
5461
2253
  };
5462
2254
  /**
5463
2255
  * createAPIConfiguration to create a custom Configuration
@@ -5513,7 +2305,7 @@ class BlockchainDataConfiguration {
5513
2305
  * @returns APIError
5514
2306
  */
5515
2307
  function formatError(error) {
5516
- if (axios$2.isAxiosError(error) && error.response) {
2308
+ if (globalAxios$1.isAxiosError(error) && error.response) {
5517
2309
  const apiError = error.response.data;
5518
2310
  if (apiError.code && apiError.message) {
5519
2311
  return new APIError({
@@ -5723,7 +2515,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
5723
2515
  chainID,
5724
2516
  coreContractAddress,
5725
2517
  registrationContractAddress,
5726
- sdkVersion: 'ts-immutable-sdk-0.4.0-alpha.1',
2518
+ sdkVersion: 'ts-immutable-sdk-0.4.0-alpha.2',
5727
2519
  });
5728
2520
  /**
5729
2521
  * Sets `sdkVersion` at the time of build
@@ -10139,7 +6931,7 @@ class AuthManager {
10139
6931
  }
10140
6932
  async loginWithDeviceFlow() {
10141
6933
  return withPassportError(async () => {
10142
- const response = await axios$2.post(`${this.config.authenticationDomain}/oauth/device/code`, {
6934
+ const response = await globalAxios$1.post(`${this.config.authenticationDomain}/oauth/device/code`, {
10143
6935
  client_id: this.config.oidcConfiguration.clientId,
10144
6936
  scope: this.config.oidcConfiguration.scope,
10145
6937
  audience: this.config.oidcConfiguration.audience,
@@ -10172,7 +6964,7 @@ class AuthManager {
10172
6964
  return user;
10173
6965
  }
10174
6966
  catch (error) {
10175
- if (axios$2.isAxiosError(error)) {
6967
+ if (globalAxios$1.isAxiosError(error)) {
10176
6968
  const responseError = error.response?.data;
10177
6969
  switch (responseError.error) {
10178
6970
  case 'authorization_pending':
@@ -10197,7 +6989,7 @@ class AuthManager {
10197
6989
  }
10198
6990
  /* eslint-enable no-await-in-loop */
10199
6991
  async getDeviceFlowToken(deviceCode) {
10200
- const response = await axios$2.post(`${this.config.authenticationDomain}/oauth/token`, {
6992
+ const response = await globalAxios$1.post(`${this.config.authenticationDomain}/oauth/token`, {
10201
6993
  client_id: this.config.oidcConfiguration.clientId,
10202
6994
  grant_type: 'urn:ietf:params:oauth:grant-type:device_code',
10203
6995
  device_code: deviceCode,
@@ -10220,7 +7012,7 @@ class AuthManager {
10220
7012
  }, PassportErrorType.AUTHENTICATION_ERROR);
10221
7013
  }
10222
7014
  async refreshToken(refreshToken) {
10223
- const response = await axios$2.post(`${this.config.authenticationDomain}/oauth/token`, {
7015
+ const response = await globalAxios$1.post(`${this.config.authenticationDomain}/oauth/token`, {
10224
7016
  client_id: this.config.oidcConfiguration.clientId,
10225
7017
  grant_type: 'refresh_token',
10226
7018
  refresh_token: refreshToken,
@@ -11439,7 +8231,7 @@ const getRequestBody = (options) => {
11439
8231
  return undefined;
11440
8232
  };
11441
8233
  const sendRequest = async (config, options, url, body, formData, headers, onCancel) => {
11442
- const source = axios$2.CancelToken.source();
8234
+ const source = globalAxios$1.CancelToken.source();
11443
8235
  const requestConfig = {
11444
8236
  url,
11445
8237
  headers,
@@ -11450,7 +8242,7 @@ const sendRequest = async (config, options, url, body, formData, headers, onCanc
11450
8242
  };
11451
8243
  onCancel(() => source.cancel('The user aborted a request.'));
11452
8244
  try {
11453
- return await axios$2.request(requestConfig);
8245
+ return await globalAxios$1.request(requestConfig);
11454
8246
  }
11455
8247
  catch (error) {
11456
8248
  const axiosError = error;
@@ -27598,7 +24390,7 @@ class $a492ee374ae7b613$export$d902b56530cd5f87 {
27598
24390
  static async makeHttpRequest(url) {
27599
24391
  let response;
27600
24392
  try {
27601
- response = await (0, axios$2).get(url);
24393
+ response = await (0, globalAxios$1).get(url);
27602
24394
  } catch (error) {
27603
24395
  throw new Error(`Error fetching from api: ${error.message}`);
27604
24396
  }
@@ -27939,7 +24731,7 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
27939
24731
  function $parcel$export(e, n, v, s) {
27940
24732
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
27941
24733
  }
27942
- const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.4.0-alpha.1";
24734
+ const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.4.0-alpha.2";
27943
24735
  const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
27944
24736
  const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
27945
24737