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