@esvndev/es-react-template-chat 0.0.18 → 0.0.20

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
@@ -17,7 +17,6 @@ var require$$4 = require('https');
17
17
  var require$$0$1 = require('url');
18
18
  var require$$6 = require('fs');
19
19
  var require$$8 = require('crypto');
20
- var http2 = require('http2');
21
20
  var require$$4$1 = require('assert');
22
21
  var require$$1$2 = require('tty');
23
22
  var require$$0$2 = require('os');
@@ -53,7 +52,6 @@ var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4);
53
52
  var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
54
53
  var require$$6__default = /*#__PURE__*/_interopDefaultLegacy(require$$6);
55
54
  var require$$8__default = /*#__PURE__*/_interopDefaultLegacy(require$$8);
56
- var http2__default = /*#__PURE__*/_interopDefaultLegacy(http2);
57
55
  var require$$4__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$4$1);
58
56
  var require$$1__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$1$2);
59
57
  var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);
@@ -26278,13 +26276,6 @@ const FORM_CONFIG = {
26278
26276
  }
26279
26277
  };
26280
26278
 
26281
- /**
26282
- * Create a bound version of a function with a specified `this` context
26283
- *
26284
- * @param {Function} fn - The function to bind
26285
- * @param {*} thisArg - The value to be passed as the `this` parameter
26286
- * @returns {Function} A new function that will call the original function with the specified `this` context
26287
- */
26288
26279
  function bind$4(fn, thisArg) {
26289
26280
  return function wrap() {
26290
26281
  return fn.apply(thisArg, arguments);
@@ -26293,30 +26284,29 @@ function bind$4(fn, thisArg) {
26293
26284
 
26294
26285
  // utils is a library of generic helper functions non-specific to axios
26295
26286
 
26296
- const { toString } = Object.prototype;
26297
- const { getPrototypeOf } = Object;
26298
- const { iterator, toStringTag: toStringTag$1 } = Symbol;
26287
+ const {toString} = Object.prototype;
26288
+ const {getPrototypeOf} = Object;
26299
26289
 
26300
- const kindOf = ((cache) => (thing) => {
26301
- const str = toString.call(thing);
26302
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
26290
+ const kindOf = (cache => thing => {
26291
+ const str = toString.call(thing);
26292
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
26303
26293
  })(Object.create(null));
26304
26294
 
26305
26295
  const kindOfTest = (type) => {
26306
26296
  type = type.toLowerCase();
26307
- return (thing) => kindOf(thing) === type;
26297
+ return (thing) => kindOf(thing) === type
26308
26298
  };
26309
26299
 
26310
- const typeOfTest = (type) => (thing) => typeof thing === type;
26300
+ const typeOfTest = type => thing => typeof thing === type;
26311
26301
 
26312
26302
  /**
26313
- * Determine if a value is a non-null object
26303
+ * Determine if a value is an Array
26314
26304
  *
26315
26305
  * @param {Object} val The value to test
26316
26306
  *
26317
26307
  * @returns {boolean} True if value is an Array, otherwise false
26318
26308
  */
26319
- const { isArray } = Array;
26309
+ const {isArray} = Array;
26320
26310
 
26321
26311
  /**
26322
26312
  * Determine if a value is undefined
@@ -26325,7 +26315,7 @@ const { isArray } = Array;
26325
26315
  *
26326
26316
  * @returns {boolean} True if the value is undefined, otherwise false
26327
26317
  */
26328
- const isUndefined = typeOfTest("undefined");
26318
+ const isUndefined = typeOfTest('undefined');
26329
26319
 
26330
26320
  /**
26331
26321
  * Determine if a value is a Buffer
@@ -26335,14 +26325,8 @@ const isUndefined = typeOfTest("undefined");
26335
26325
  * @returns {boolean} True if value is a Buffer, otherwise false
26336
26326
  */
26337
26327
  function isBuffer$1(val) {
26338
- return (
26339
- val !== null &&
26340
- !isUndefined(val) &&
26341
- val.constructor !== null &&
26342
- !isUndefined(val.constructor) &&
26343
- isFunction$2(val.constructor.isBuffer) &&
26344
- val.constructor.isBuffer(val)
26345
- );
26328
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
26329
+ && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
26346
26330
  }
26347
26331
 
26348
26332
  /**
@@ -26352,7 +26336,8 @@ function isBuffer$1(val) {
26352
26336
  *
26353
26337
  * @returns {boolean} True if value is an ArrayBuffer, otherwise false
26354
26338
  */
26355
- const isArrayBuffer = kindOfTest("ArrayBuffer");
26339
+ const isArrayBuffer = kindOfTest('ArrayBuffer');
26340
+
26356
26341
 
26357
26342
  /**
26358
26343
  * Determine if a value is a view on an ArrayBuffer
@@ -26363,10 +26348,10 @@ const isArrayBuffer = kindOfTest("ArrayBuffer");
26363
26348
  */
26364
26349
  function isArrayBufferView(val) {
26365
26350
  let result;
26366
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
26351
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
26367
26352
  result = ArrayBuffer.isView(val);
26368
26353
  } else {
26369
- result = val && val.buffer && isArrayBuffer(val.buffer);
26354
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
26370
26355
  }
26371
26356
  return result;
26372
26357
  }
@@ -26378,7 +26363,7 @@ function isArrayBufferView(val) {
26378
26363
  *
26379
26364
  * @returns {boolean} True if value is a String, otherwise false
26380
26365
  */
26381
- const isString$1 = typeOfTest("string");
26366
+ const isString$1 = typeOfTest('string');
26382
26367
 
26383
26368
  /**
26384
26369
  * Determine if a value is a Function
@@ -26386,7 +26371,7 @@ const isString$1 = typeOfTest("string");
26386
26371
  * @param {*} val The value to test
26387
26372
  * @returns {boolean} True if value is a Function, otherwise false
26388
26373
  */
26389
- const isFunction$2 = typeOfTest("function");
26374
+ const isFunction$1 = typeOfTest('function');
26390
26375
 
26391
26376
  /**
26392
26377
  * Determine if a value is a Number
@@ -26395,7 +26380,7 @@ const isFunction$2 = typeOfTest("function");
26395
26380
  *
26396
26381
  * @returns {boolean} True if value is a Number, otherwise false
26397
26382
  */
26398
- const isNumber = typeOfTest("number");
26383
+ const isNumber = typeOfTest('number');
26399
26384
 
26400
26385
  /**
26401
26386
  * Determine if a value is an Object
@@ -26404,7 +26389,7 @@ const isNumber = typeOfTest("number");
26404
26389
  *
26405
26390
  * @returns {boolean} True if value is an Object, otherwise false
26406
26391
  */
26407
- const isObject = (thing) => thing !== null && typeof thing === "object";
26392
+ const isObject = (thing) => thing !== null && typeof thing === 'object';
26408
26393
 
26409
26394
  /**
26410
26395
  * Determine if a value is a Boolean
@@ -26412,7 +26397,7 @@ const isObject = (thing) => thing !== null && typeof thing === "object";
26412
26397
  * @param {*} thing The value to test
26413
26398
  * @returns {boolean} True if value is a Boolean, otherwise false
26414
26399
  */
26415
- const isBoolean = (thing) => thing === true || thing === false;
26400
+ const isBoolean = thing => thing === true || thing === false;
26416
26401
 
26417
26402
  /**
26418
26403
  * Determine if a value is a plain Object
@@ -26422,42 +26407,12 @@ const isBoolean = (thing) => thing === true || thing === false;
26422
26407
  * @returns {boolean} True if value is a plain Object, otherwise false
26423
26408
  */
26424
26409
  const isPlainObject = (val) => {
26425
- if (kindOf(val) !== "object") {
26410
+ if (kindOf(val) !== 'object') {
26426
26411
  return false;
26427
26412
  }
26428
26413
 
26429
26414
  const prototype = getPrototypeOf(val);
26430
- return (
26431
- (prototype === null ||
26432
- prototype === Object.prototype ||
26433
- Object.getPrototypeOf(prototype) === null) &&
26434
- !(toStringTag$1 in val) &&
26435
- !(iterator in val)
26436
- );
26437
- };
26438
-
26439
- /**
26440
- * Determine if a value is an empty object (safely handles Buffers)
26441
- *
26442
- * @param {*} val The value to test
26443
- *
26444
- * @returns {boolean} True if value is an empty object, otherwise false
26445
- */
26446
- const isEmptyObject = (val) => {
26447
- // Early return for non-objects or Buffers to prevent RangeError
26448
- if (!isObject(val) || isBuffer$1(val)) {
26449
- return false;
26450
- }
26451
-
26452
- try {
26453
- return (
26454
- Object.keys(val).length === 0 &&
26455
- Object.getPrototypeOf(val) === Object.prototype
26456
- );
26457
- } catch (e) {
26458
- // Fallback for any other objects that might cause RangeError with Object.keys()
26459
- return false;
26460
- }
26415
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
26461
26416
  };
26462
26417
 
26463
26418
  /**
@@ -26467,7 +26422,7 @@ const isEmptyObject = (val) => {
26467
26422
  *
26468
26423
  * @returns {boolean} True if value is a Date, otherwise false
26469
26424
  */
26470
- const isDate = kindOfTest("Date");
26425
+ const isDate = kindOfTest('Date');
26471
26426
 
26472
26427
  /**
26473
26428
  * Determine if a value is a File
@@ -26476,7 +26431,7 @@ const isDate = kindOfTest("Date");
26476
26431
  *
26477
26432
  * @returns {boolean} True if value is a File, otherwise false
26478
26433
  */
26479
- const isFile = kindOfTest("File");
26434
+ const isFile = kindOfTest('File');
26480
26435
 
26481
26436
  /**
26482
26437
  * Determine if a value is a Blob
@@ -26485,7 +26440,7 @@ const isFile = kindOfTest("File");
26485
26440
  *
26486
26441
  * @returns {boolean} True if value is a Blob, otherwise false
26487
26442
  */
26488
- const isBlob = kindOfTest("Blob");
26443
+ const isBlob = kindOfTest('Blob');
26489
26444
 
26490
26445
  /**
26491
26446
  * Determine if a value is a FileList
@@ -26494,7 +26449,7 @@ const isBlob = kindOfTest("Blob");
26494
26449
  *
26495
26450
  * @returns {boolean} True if value is a File, otherwise false
26496
26451
  */
26497
- const isFileList = kindOfTest("FileList");
26452
+ const isFileList = kindOfTest('FileList');
26498
26453
 
26499
26454
  /**
26500
26455
  * Determine if a value is a Stream
@@ -26503,7 +26458,7 @@ const isFileList = kindOfTest("FileList");
26503
26458
  *
26504
26459
  * @returns {boolean} True if value is a Stream, otherwise false
26505
26460
  */
26506
- const isStream = (val) => isObject(val) && isFunction$2(val.pipe);
26461
+ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
26507
26462
 
26508
26463
  /**
26509
26464
  * Determine if a value is a FormData
@@ -26514,16 +26469,15 @@ const isStream = (val) => isObject(val) && isFunction$2(val.pipe);
26514
26469
  */
26515
26470
  const isFormData = (thing) => {
26516
26471
  let kind;
26517
- return (
26518
- thing &&
26519
- ((typeof FormData === "function" && thing instanceof FormData) ||
26520
- (isFunction$2(thing.append) &&
26521
- ((kind = kindOf(thing)) === "formdata" ||
26522
- // detect form-data instance
26523
- (kind === "object" &&
26524
- isFunction$2(thing.toString) &&
26525
- thing.toString() === "[object FormData]"))))
26526
- );
26472
+ return thing && (
26473
+ (typeof FormData === 'function' && thing instanceof FormData) || (
26474
+ isFunction$1(thing.append) && (
26475
+ (kind = kindOf(thing)) === 'formdata' ||
26476
+ // detect form-data instance
26477
+ (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
26478
+ )
26479
+ )
26480
+ )
26527
26481
  };
26528
26482
 
26529
26483
  /**
@@ -26533,14 +26487,9 @@ const isFormData = (thing) => {
26533
26487
  *
26534
26488
  * @returns {boolean} True if value is a URLSearchParams object, otherwise false
26535
26489
  */
26536
- const isURLSearchParams = kindOfTest("URLSearchParams");
26490
+ const isURLSearchParams = kindOfTest('URLSearchParams');
26537
26491
 
26538
- const [isReadableStream, isRequest, isResponse, isHeaders] = [
26539
- "ReadableStream",
26540
- "Request",
26541
- "Response",
26542
- "Headers",
26543
- ].map(kindOfTest);
26492
+ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
26544
26493
 
26545
26494
  /**
26546
26495
  * Trim excess whitespace off the beginning and end of a string
@@ -26549,8 +26498,8 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = [
26549
26498
  *
26550
26499
  * @returns {String} The String freed of excess whitespace
26551
26500
  */
26552
- const trim = (str) =>
26553
- str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
26501
+ const trim = (str) => str.trim ?
26502
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
26554
26503
 
26555
26504
  /**
26556
26505
  * Iterate over an Array or an Object invoking a function for each item.
@@ -26561,16 +26510,15 @@ const trim = (str) =>
26561
26510
  * If 'obj' is an Object callback will be called passing
26562
26511
  * the value, key, and complete object for each property.
26563
26512
  *
26564
- * @param {Object|Array<unknown>} obj The object to iterate
26513
+ * @param {Object|Array} obj The object to iterate
26565
26514
  * @param {Function} fn The callback to invoke for each item
26566
26515
  *
26567
- * @param {Object} [options]
26568
- * @param {Boolean} [options.allOwnKeys = false]
26516
+ * @param {Boolean} [allOwnKeys = false]
26569
26517
  * @returns {any}
26570
26518
  */
26571
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
26519
+ function forEach(obj, fn, {allOwnKeys = false} = {}) {
26572
26520
  // Don't bother if no value provided
26573
- if (obj === null || typeof obj === "undefined") {
26521
+ if (obj === null || typeof obj === 'undefined') {
26574
26522
  return;
26575
26523
  }
26576
26524
 
@@ -26578,7 +26526,7 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
26578
26526
  let l;
26579
26527
 
26580
26528
  // Force an array if not already something iterable
26581
- if (typeof obj !== "object") {
26529
+ if (typeof obj !== 'object') {
26582
26530
  /*eslint no-param-reassign:0*/
26583
26531
  obj = [obj];
26584
26532
  }
@@ -26589,15 +26537,8 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
26589
26537
  fn.call(null, obj[i], i, obj);
26590
26538
  }
26591
26539
  } else {
26592
- // Buffer check
26593
- if (isBuffer$1(obj)) {
26594
- return;
26595
- }
26596
-
26597
26540
  // Iterate over object keys
26598
- const keys = allOwnKeys
26599
- ? Object.getOwnPropertyNames(obj)
26600
- : Object.keys(obj);
26541
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
26601
26542
  const len = keys.length;
26602
26543
  let key;
26603
26544
 
@@ -26609,10 +26550,6 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
26609
26550
  }
26610
26551
 
26611
26552
  function findKey(obj, key) {
26612
- if (isBuffer$1(obj)) {
26613
- return null;
26614
- }
26615
-
26616
26553
  key = key.toLowerCase();
26617
26554
  const keys = Object.keys(obj);
26618
26555
  let i = keys.length;
@@ -26629,15 +26566,10 @@ function findKey(obj, key) {
26629
26566
  const _global = (() => {
26630
26567
  /*eslint no-undef:0*/
26631
26568
  if (typeof globalThis !== "undefined") return globalThis;
26632
- return typeof self !== "undefined"
26633
- ? self
26634
- : typeof window !== "undefined"
26635
- ? window
26636
- : global;
26569
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
26637
26570
  })();
26638
26571
 
26639
- const isContextDefined = (context) =>
26640
- !isUndefined(context) && context !== _global;
26572
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
26641
26573
 
26642
26574
  /**
26643
26575
  * Accepts varargs expecting each argument to be an object, then
@@ -26649,7 +26581,7 @@ const isContextDefined = (context) =>
26649
26581
  * Example:
26650
26582
  *
26651
26583
  * ```js
26652
- * const result = merge({foo: 123}, {foo: 456});
26584
+ * var result = merge({foo: 123}, {foo: 456});
26653
26585
  * console.log(result.foo); // outputs 456
26654
26586
  * ```
26655
26587
  *
@@ -26658,22 +26590,17 @@ const isContextDefined = (context) =>
26658
26590
  * @returns {Object} Result of all merge properties
26659
26591
  */
26660
26592
  function merge(/* obj1, obj2, obj3, ... */) {
26661
- const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
26593
+ const {caseless} = isContextDefined(this) && this || {};
26662
26594
  const result = {};
26663
26595
  const assignValue = (val, key) => {
26664
- // Skip dangerous property names to prevent prototype pollution
26665
- if (key === "__proto__" || key === "constructor" || key === "prototype") {
26666
- return;
26667
- }
26668
-
26669
- const targetKey = (caseless && findKey(result, key)) || key;
26596
+ const targetKey = caseless && findKey(result, key) || key;
26670
26597
  if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
26671
26598
  result[targetKey] = merge(result[targetKey], val);
26672
26599
  } else if (isPlainObject(val)) {
26673
26600
  result[targetKey] = merge({}, val);
26674
26601
  } else if (isArray(val)) {
26675
26602
  result[targetKey] = val.slice();
26676
- } else if (!skipUndefined || !isUndefined(val)) {
26603
+ } else {
26677
26604
  result[targetKey] = val;
26678
26605
  }
26679
26606
  };
@@ -26691,32 +26618,17 @@ function merge(/* obj1, obj2, obj3, ... */) {
26691
26618
  * @param {Object} b The object to copy properties from
26692
26619
  * @param {Object} thisArg The object to bind function to
26693
26620
  *
26694
- * @param {Object} [options]
26695
- * @param {Boolean} [options.allOwnKeys]
26621
+ * @param {Boolean} [allOwnKeys]
26696
26622
  * @returns {Object} The resulting value of object a
26697
26623
  */
26698
- const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
26699
- forEach(
26700
- b,
26701
- (val, key) => {
26702
- if (thisArg && isFunction$2(val)) {
26703
- Object.defineProperty(a, key, {
26704
- value: bind$4(val, thisArg),
26705
- writable: true,
26706
- enumerable: true,
26707
- configurable: true,
26708
- });
26709
- } else {
26710
- Object.defineProperty(a, key, {
26711
- value: val,
26712
- writable: true,
26713
- enumerable: true,
26714
- configurable: true,
26715
- });
26716
- }
26717
- },
26718
- { allOwnKeys },
26719
- );
26624
+ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
26625
+ forEach(b, (val, key) => {
26626
+ if (thisArg && isFunction$1(val)) {
26627
+ a[key] = bind$4(val, thisArg);
26628
+ } else {
26629
+ a[key] = val;
26630
+ }
26631
+ }, {allOwnKeys});
26720
26632
  return a;
26721
26633
  };
26722
26634
 
@@ -26728,7 +26640,7 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
26728
26640
  * @returns {string} content value without BOM
26729
26641
  */
26730
26642
  const stripBOM = (content) => {
26731
- if (content.charCodeAt(0) === 0xfeff) {
26643
+ if (content.charCodeAt(0) === 0xFEFF) {
26732
26644
  content = content.slice(1);
26733
26645
  }
26734
26646
  return content;
@@ -26744,18 +26656,10 @@ const stripBOM = (content) => {
26744
26656
  * @returns {void}
26745
26657
  */
26746
26658
  const inherits = (constructor, superConstructor, props, descriptors) => {
26747
- constructor.prototype = Object.create(
26748
- superConstructor.prototype,
26749
- descriptors,
26750
- );
26751
- Object.defineProperty(constructor.prototype, "constructor", {
26752
- value: constructor,
26753
- writable: true,
26754
- enumerable: false,
26755
- configurable: true,
26756
- });
26757
- Object.defineProperty(constructor, "super", {
26758
- value: superConstructor.prototype,
26659
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
26660
+ constructor.prototype.constructor = constructor;
26661
+ Object.defineProperty(constructor, 'super', {
26662
+ value: superConstructor.prototype
26759
26663
  });
26760
26664
  props && Object.assign(constructor.prototype, props);
26761
26665
  };
@@ -26784,20 +26688,13 @@ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
26784
26688
  i = props.length;
26785
26689
  while (i-- > 0) {
26786
26690
  prop = props[i];
26787
- if (
26788
- (!propFilter || propFilter(prop, sourceObj, destObj)) &&
26789
- !merged[prop]
26790
- ) {
26691
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
26791
26692
  destObj[prop] = sourceObj[prop];
26792
26693
  merged[prop] = true;
26793
26694
  }
26794
26695
  }
26795
26696
  sourceObj = filter !== false && getPrototypeOf(sourceObj);
26796
- } while (
26797
- sourceObj &&
26798
- (!filter || filter(sourceObj, destObj)) &&
26799
- sourceObj !== Object.prototype
26800
- );
26697
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
26801
26698
 
26802
26699
  return destObj;
26803
26700
  };
@@ -26821,6 +26718,7 @@ const endsWith = (str, searchString, position) => {
26821
26718
  return lastIndex !== -1 && lastIndex === position;
26822
26719
  };
26823
26720
 
26721
+
26824
26722
  /**
26825
26723
  * Returns new array from array like object or null if failed
26826
26724
  *
@@ -26849,12 +26747,12 @@ const toArray = (thing) => {
26849
26747
  * @returns {Array}
26850
26748
  */
26851
26749
  // eslint-disable-next-line func-names
26852
- const isTypedArray = ((TypedArray) => {
26750
+ const isTypedArray = (TypedArray => {
26853
26751
  // eslint-disable-next-line func-names
26854
- return (thing) => {
26752
+ return thing => {
26855
26753
  return TypedArray && thing instanceof TypedArray;
26856
26754
  };
26857
- })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
26755
+ })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
26858
26756
 
26859
26757
  /**
26860
26758
  * For each entry in the object, call the function with the key and value.
@@ -26865,13 +26763,13 @@ const isTypedArray = ((TypedArray) => {
26865
26763
  * @returns {void}
26866
26764
  */
26867
26765
  const forEachEntry = (obj, fn) => {
26868
- const generator = obj && obj[iterator];
26766
+ const generator = obj && obj[Symbol.iterator];
26869
26767
 
26870
- const _iterator = generator.call(obj);
26768
+ const iterator = generator.call(obj);
26871
26769
 
26872
26770
  let result;
26873
26771
 
26874
- while ((result = _iterator.next()) && !result.done) {
26772
+ while ((result = iterator.next()) && !result.done) {
26875
26773
  const pair = result.value;
26876
26774
  fn.call(obj, pair[0], pair[1]);
26877
26775
  }
@@ -26897,22 +26795,18 @@ const matchAll = (regExp, str) => {
26897
26795
  };
26898
26796
 
26899
26797
  /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
26900
- const isHTMLForm = kindOfTest("HTMLFormElement");
26798
+ const isHTMLForm = kindOfTest('HTMLFormElement');
26901
26799
 
26902
- const toCamelCase = (str) => {
26903
- return str
26904
- .toLowerCase()
26905
- .replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
26800
+ const toCamelCase = str => {
26801
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
26802
+ function replacer(m, p1, p2) {
26906
26803
  return p1.toUpperCase() + p2;
26907
- });
26804
+ }
26805
+ );
26908
26806
  };
26909
26807
 
26910
26808
  /* Creating a function that will check if an object has a property. */
26911
- const hasOwnProperty = (
26912
- ({ hasOwnProperty }) =>
26913
- (obj, prop) =>
26914
- hasOwnProperty.call(obj, prop)
26915
- )(Object.prototype);
26809
+ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
26916
26810
 
26917
26811
  /**
26918
26812
  * Determine if a value is a RegExp object
@@ -26921,7 +26815,7 @@ const hasOwnProperty = (
26921
26815
  *
26922
26816
  * @returns {boolean} True if value is a RegExp object, otherwise false
26923
26817
  */
26924
- const isRegExp = kindOfTest("RegExp");
26818
+ const isRegExp = kindOfTest('RegExp');
26925
26819
 
26926
26820
  const reduceDescriptors = (obj, reducer) => {
26927
26821
  const descriptors = Object.getOwnPropertyDescriptors(obj);
@@ -26945,27 +26839,24 @@ const reduceDescriptors = (obj, reducer) => {
26945
26839
  const freezeMethods = (obj) => {
26946
26840
  reduceDescriptors(obj, (descriptor, name) => {
26947
26841
  // skip restricted props in strict mode
26948
- if (
26949
- isFunction$2(obj) &&
26950
- ["arguments", "caller", "callee"].indexOf(name) !== -1
26951
- ) {
26842
+ if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
26952
26843
  return false;
26953
26844
  }
26954
26845
 
26955
26846
  const value = obj[name];
26956
26847
 
26957
- if (!isFunction$2(value)) return;
26848
+ if (!isFunction$1(value)) return;
26958
26849
 
26959
26850
  descriptor.enumerable = false;
26960
26851
 
26961
- if ("writable" in descriptor) {
26852
+ if ('writable' in descriptor) {
26962
26853
  descriptor.writable = false;
26963
26854
  return;
26964
26855
  }
26965
26856
 
26966
26857
  if (!descriptor.set) {
26967
26858
  descriptor.set = () => {
26968
- throw Error("Can not rewrite read-only method '" + name + "'");
26859
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
26969
26860
  };
26970
26861
  }
26971
26862
  });
@@ -26975,14 +26866,12 @@ const toObjectSet = (arrayOrString, delimiter) => {
26975
26866
  const obj = {};
26976
26867
 
26977
26868
  const define = (arr) => {
26978
- arr.forEach((value) => {
26869
+ arr.forEach(value => {
26979
26870
  obj[value] = true;
26980
26871
  });
26981
26872
  };
26982
26873
 
26983
- isArray(arrayOrString)
26984
- ? define(arrayOrString)
26985
- : define(String(arrayOrString).split(delimiter));
26874
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
26986
26875
 
26987
26876
  return obj;
26988
26877
  };
@@ -26990,9 +26879,27 @@ const toObjectSet = (arrayOrString, delimiter) => {
26990
26879
  const noop$1 = () => {};
26991
26880
 
26992
26881
  const toFiniteNumber = (value, defaultValue) => {
26993
- return value != null && Number.isFinite((value = +value))
26994
- ? value
26995
- : defaultValue;
26882
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
26883
+ };
26884
+
26885
+ const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
26886
+
26887
+ const DIGIT = '0123456789';
26888
+
26889
+ const ALPHABET = {
26890
+ DIGIT,
26891
+ ALPHA,
26892
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
26893
+ };
26894
+
26895
+ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
26896
+ let str = '';
26897
+ const {length} = alphabet;
26898
+ while (size--) {
26899
+ str += alphabet[Math.random() * length|0];
26900
+ }
26901
+
26902
+ return str;
26996
26903
  };
26997
26904
 
26998
26905
  /**
@@ -27003,29 +26910,20 @@ const toFiniteNumber = (value, defaultValue) => {
27003
26910
  * @returns {boolean}
27004
26911
  */
27005
26912
  function isSpecCompliantForm(thing) {
27006
- return !!(
27007
- thing &&
27008
- isFunction$2(thing.append) &&
27009
- thing[toStringTag$1] === "FormData" &&
27010
- thing[iterator]
27011
- );
26913
+ return !!(thing && isFunction$1(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
27012
26914
  }
27013
26915
 
27014
26916
  const toJSONObject = (obj) => {
27015
26917
  const stack = new Array(10);
27016
26918
 
27017
26919
  const visit = (source, i) => {
26920
+
27018
26921
  if (isObject(source)) {
27019
26922
  if (stack.indexOf(source) >= 0) {
27020
26923
  return;
27021
26924
  }
27022
26925
 
27023
- //Buffer check
27024
- if (isBuffer$1(source)) {
27025
- return source;
27026
- }
27027
-
27028
- if (!("toJSON" in source)) {
26926
+ if(!('toJSON' in source)) {
27029
26927
  stack[i] = source;
27030
26928
  const target = isArray(source) ? [] : {};
27031
26929
 
@@ -27046,50 +26944,10 @@ const toJSONObject = (obj) => {
27046
26944
  return visit(obj, 0);
27047
26945
  };
27048
26946
 
27049
- const isAsyncFn = kindOfTest("AsyncFunction");
26947
+ const isAsyncFn = kindOfTest('AsyncFunction');
27050
26948
 
27051
26949
  const isThenable = (thing) =>
27052
- thing &&
27053
- (isObject(thing) || isFunction$2(thing)) &&
27054
- isFunction$2(thing.then) &&
27055
- isFunction$2(thing.catch);
27056
-
27057
- // original code
27058
- // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
27059
-
27060
- const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
27061
- if (setImmediateSupported) {
27062
- return setImmediate;
27063
- }
27064
-
27065
- return postMessageSupported
27066
- ? ((token, callbacks) => {
27067
- _global.addEventListener(
27068
- "message",
27069
- ({ source, data }) => {
27070
- if (source === _global && data === token) {
27071
- callbacks.length && callbacks.shift()();
27072
- }
27073
- },
27074
- false,
27075
- );
27076
-
27077
- return (cb) => {
27078
- callbacks.push(cb);
27079
- _global.postMessage(token, "*");
27080
- };
27081
- })(`axios@${Math.random()}`, [])
27082
- : (cb) => setTimeout(cb);
27083
- })(typeof setImmediate === "function", isFunction$2(_global.postMessage));
27084
-
27085
- const asap =
27086
- typeof queueMicrotask !== "undefined"
27087
- ? queueMicrotask.bind(_global)
27088
- : (typeof process !== "undefined" && process.nextTick) || _setImmediate;
27089
-
27090
- // *********************
27091
-
27092
- const isIterable = (thing) => thing != null && isFunction$2(thing[iterator]);
26950
+ thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
27093
26951
 
27094
26952
  var utils$1 = {
27095
26953
  isArray,
@@ -27102,7 +26960,6 @@ var utils$1 = {
27102
26960
  isBoolean,
27103
26961
  isObject,
27104
26962
  isPlainObject,
27105
- isEmptyObject,
27106
26963
  isReadableStream,
27107
26964
  isRequest,
27108
26965
  isResponse,
@@ -27112,7 +26969,7 @@ var utils$1 = {
27112
26969
  isFile,
27113
26970
  isBlob,
27114
26971
  isRegExp,
27115
- isFunction: isFunction$2,
26972
+ isFunction: isFunction$1,
27116
26973
  isStream,
27117
26974
  isURLSearchParams,
27118
26975
  isTypedArray,
@@ -27142,84 +26999,108 @@ var utils$1 = {
27142
26999
  findKey,
27143
27000
  global: _global,
27144
27001
  isContextDefined,
27002
+ ALPHABET,
27003
+ generateString,
27145
27004
  isSpecCompliantForm,
27146
27005
  toJSONObject,
27147
27006
  isAsyncFn,
27148
- isThenable,
27149
- setImmediate: _setImmediate,
27150
- asap,
27151
- isIterable,
27007
+ isThenable
27152
27008
  };
27153
27009
 
27154
- class AxiosError extends Error {
27155
- static from(error, code, config, request, response, customProps) {
27156
- const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
27157
- axiosError.cause = error;
27158
- axiosError.name = error.name;
27159
- customProps && Object.assign(axiosError, customProps);
27160
- return axiosError;
27161
- }
27010
+ /**
27011
+ * Create an Error with the specified message, config, error code, request and response.
27012
+ *
27013
+ * @param {string} message The error message.
27014
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
27015
+ * @param {Object} [config] The config.
27016
+ * @param {Object} [request] The request.
27017
+ * @param {Object} [response] The response.
27018
+ *
27019
+ * @returns {Error} The created error.
27020
+ */
27021
+ function AxiosError(message, code, config, request, response) {
27022
+ Error.call(this);
27162
27023
 
27163
- /**
27164
- * Create an Error with the specified message, config, error code, request and response.
27165
- *
27166
- * @param {string} message The error message.
27167
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
27168
- * @param {Object} [config] The config.
27169
- * @param {Object} [request] The request.
27170
- * @param {Object} [response] The response.
27171
- *
27172
- * @returns {Error} The created error.
27173
- */
27174
- constructor(message, code, config, request, response) {
27175
- super(message);
27176
- this.name = 'AxiosError';
27177
- this.isAxiosError = true;
27178
- code && (this.code = code);
27179
- config && (this.config = config);
27180
- request && (this.request = request);
27181
- if (response) {
27182
- this.response = response;
27183
- this.status = response.status;
27184
- }
27185
- }
27024
+ if (Error.captureStackTrace) {
27025
+ Error.captureStackTrace(this, this.constructor);
27026
+ } else {
27027
+ this.stack = (new Error()).stack;
27028
+ }
27186
27029
 
27187
- toJSON() {
27188
- return {
27189
- // Standard
27190
- message: this.message,
27191
- name: this.name,
27192
- // Microsoft
27193
- description: this.description,
27194
- number: this.number,
27195
- // Mozilla
27196
- fileName: this.fileName,
27197
- lineNumber: this.lineNumber,
27198
- columnNumber: this.columnNumber,
27199
- stack: this.stack,
27200
- // Axios
27201
- config: utils$1.toJSONObject(this.config),
27202
- code: this.code,
27203
- status: this.status,
27204
- };
27205
- }
27030
+ this.message = message;
27031
+ this.name = 'AxiosError';
27032
+ code && (this.code = code);
27033
+ config && (this.config = config);
27034
+ request && (this.request = request);
27035
+ response && (this.response = response);
27206
27036
  }
27207
27037
 
27208
- // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
27209
- AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
27210
- AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
27211
- AxiosError.ECONNABORTED = 'ECONNABORTED';
27212
- AxiosError.ETIMEDOUT = 'ETIMEDOUT';
27213
- AxiosError.ERR_NETWORK = 'ERR_NETWORK';
27214
- AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
27215
- AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
27216
- AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
27217
- AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
27218
- AxiosError.ERR_CANCELED = 'ERR_CANCELED';
27219
- AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
27220
- AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
27038
+ utils$1.inherits(AxiosError, Error, {
27039
+ toJSON: function toJSON() {
27040
+ return {
27041
+ // Standard
27042
+ message: this.message,
27043
+ name: this.name,
27044
+ // Microsoft
27045
+ description: this.description,
27046
+ number: this.number,
27047
+ // Mozilla
27048
+ fileName: this.fileName,
27049
+ lineNumber: this.lineNumber,
27050
+ columnNumber: this.columnNumber,
27051
+ stack: this.stack,
27052
+ // Axios
27053
+ config: utils$1.toJSONObject(this.config),
27054
+ code: this.code,
27055
+ status: this.response && this.response.status ? this.response.status : null
27056
+ };
27057
+ }
27058
+ });
27221
27059
 
27222
- var AxiosError$1 = AxiosError;
27060
+ const prototype$1 = AxiosError.prototype;
27061
+ const descriptors = {};
27062
+
27063
+ [
27064
+ 'ERR_BAD_OPTION_VALUE',
27065
+ 'ERR_BAD_OPTION',
27066
+ 'ECONNABORTED',
27067
+ 'ETIMEDOUT',
27068
+ 'ERR_NETWORK',
27069
+ 'ERR_FR_TOO_MANY_REDIRECTS',
27070
+ 'ERR_DEPRECATED',
27071
+ 'ERR_BAD_RESPONSE',
27072
+ 'ERR_BAD_REQUEST',
27073
+ 'ERR_CANCELED',
27074
+ 'ERR_NOT_SUPPORT',
27075
+ 'ERR_INVALID_URL'
27076
+ // eslint-disable-next-line func-names
27077
+ ].forEach(code => {
27078
+ descriptors[code] = {value: code};
27079
+ });
27080
+
27081
+ Object.defineProperties(AxiosError, descriptors);
27082
+ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
27083
+
27084
+ // eslint-disable-next-line func-names
27085
+ AxiosError.from = (error, code, config, request, response, customProps) => {
27086
+ const axiosError = Object.create(prototype$1);
27087
+
27088
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
27089
+ return obj !== Error.prototype;
27090
+ }, prop => {
27091
+ return prop !== 'isAxiosError';
27092
+ });
27093
+
27094
+ AxiosError.call(axiosError, error.message, code, config, request, response);
27095
+
27096
+ axiosError.cause = error;
27097
+
27098
+ axiosError.name = error.name;
27099
+
27100
+ customProps && Object.assign(axiosError, customProps);
27101
+
27102
+ return axiosError;
27103
+ };
27223
27104
 
27224
27105
  var Stream$2 = stream__default["default"].Stream;
27225
27106
  var util$2 = require$$1__default["default"];
@@ -40199,12 +40080,8 @@ function toFormData(obj, formData, options) {
40199
40080
  return value.toISOString();
40200
40081
  }
40201
40082
 
40202
- if (utils$1.isBoolean(value)) {
40203
- return value.toString();
40204
- }
40205
-
40206
40083
  if (!useBlob && utils$1.isBlob(value)) {
40207
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
40084
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
40208
40085
  }
40209
40086
 
40210
40087
  if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
@@ -40365,7 +40242,9 @@ function encode(val) {
40365
40242
  replace(/%3A/gi, ':').
40366
40243
  replace(/%24/g, '$').
40367
40244
  replace(/%2C/gi, ',').
40368
- replace(/%20/g, '+');
40245
+ replace(/%20/g, '+').
40246
+ replace(/%5B/gi, '[').
40247
+ replace(/%5D/gi, ']');
40369
40248
  }
40370
40249
 
40371
40250
  /**
@@ -40373,31 +40252,28 @@ function encode(val) {
40373
40252
  *
40374
40253
  * @param {string} url The base of the url (e.g., http://www.google.com)
40375
40254
  * @param {object} [params] The params to be appended
40376
- * @param {?(object|Function)} options
40255
+ * @param {?object} options
40377
40256
  *
40378
40257
  * @returns {string} The formatted url
40379
40258
  */
40380
40259
  function buildURL(url, params, options) {
40260
+ /*eslint no-param-reassign:0*/
40381
40261
  if (!params) {
40382
40262
  return url;
40383
40263
  }
40384
-
40264
+
40385
40265
  const _encode = options && options.encode || encode;
40386
40266
 
40387
- const _options = utils$1.isFunction(options) ? {
40388
- serialize: options
40389
- } : options;
40390
-
40391
- const serializeFn = _options && _options.serialize;
40267
+ const serializeFn = options && options.serialize;
40392
40268
 
40393
40269
  let serializedParams;
40394
40270
 
40395
40271
  if (serializeFn) {
40396
- serializedParams = serializeFn(params, _options);
40272
+ serializedParams = serializeFn(params, options);
40397
40273
  } else {
40398
40274
  serializedParams = utils$1.isURLSearchParams(params) ?
40399
40275
  params.toString() :
40400
- new AxiosURLSearchParams(params, _options).toString(_encode);
40276
+ new AxiosURLSearchParams(params, options).toString(_encode);
40401
40277
  }
40402
40278
 
40403
40279
  if (serializedParams) {
@@ -40422,7 +40298,6 @@ class InterceptorManager {
40422
40298
  *
40423
40299
  * @param {Function} fulfilled The function to handle `then` for a `Promise`
40424
40300
  * @param {Function} rejected The function to handle `reject` for a `Promise`
40425
- * @param {Object} options The options for the interceptor, synchronous and runWhen
40426
40301
  *
40427
40302
  * @return {Number} An ID used to remove interceptor later
40428
40303
  */
@@ -40441,7 +40316,7 @@ class InterceptorManager {
40441
40316
  *
40442
40317
  * @param {Number} id The ID that was returned by `use`
40443
40318
  *
40444
- * @returns {void}
40319
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
40445
40320
  */
40446
40321
  eject(id) {
40447
40322
  if (this.handlers[id]) {
@@ -40484,35 +40359,11 @@ var InterceptorManager$1 = InterceptorManager;
40484
40359
  var transitionalDefaults = {
40485
40360
  silentJSONParsing: true,
40486
40361
  forcedJSONParsing: true,
40487
- clarifyTimeoutError: false,
40488
- legacyInterceptorReqResOrdering: true
40362
+ clarifyTimeoutError: false
40489
40363
  };
40490
40364
 
40491
40365
  var URLSearchParams$1 = require$$0__default["default"].URLSearchParams;
40492
40366
 
40493
- const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
40494
-
40495
- const DIGIT = '0123456789';
40496
-
40497
- const ALPHABET = {
40498
- DIGIT,
40499
- ALPHA,
40500
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
40501
- };
40502
-
40503
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
40504
- let str = '';
40505
- const {length} = alphabet;
40506
- const randomValues = new Uint32Array(size);
40507
- require$$8__default["default"].randomFillSync(randomValues);
40508
- for (let i = 0; i < size; i++) {
40509
- str += alphabet[randomValues[i] % length];
40510
- }
40511
-
40512
- return str;
40513
- };
40514
-
40515
-
40516
40367
  var platform$1 = {
40517
40368
  isNode: true,
40518
40369
  classes: {
@@ -40520,15 +40371,11 @@ var platform$1 = {
40520
40371
  FormData: FormData$2,
40521
40372
  Blob: typeof Blob !== 'undefined' && Blob || null
40522
40373
  },
40523
- ALPHABET,
40524
- generateString,
40525
40374
  protocols: [ 'http', 'https', 'file', 'data' ]
40526
40375
  };
40527
40376
 
40528
40377
  const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
40529
40378
 
40530
- const _navigator = typeof navigator === 'object' && navigator || undefined;
40531
-
40532
40379
  /**
40533
40380
  * Determine if we're running in a standard browser environment
40534
40381
  *
@@ -40546,8 +40393,10 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
40546
40393
  *
40547
40394
  * @returns {boolean}
40548
40395
  */
40549
- const hasStandardBrowserEnv = hasBrowserEnv &&
40550
- (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
40396
+ const hasStandardBrowserEnv = (
40397
+ (product) => {
40398
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
40399
+ })(typeof navigator !== 'undefined' && navigator.product);
40551
40400
 
40552
40401
  /**
40553
40402
  * Determine if we're running in a standard browser webWorker environment
@@ -40574,7 +40423,6 @@ var utils = /*#__PURE__*/Object.freeze({
40574
40423
  hasBrowserEnv: hasBrowserEnv,
40575
40424
  hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
40576
40425
  hasStandardBrowserEnv: hasStandardBrowserEnv,
40577
- navigator: _navigator,
40578
40426
  origin: origin
40579
40427
  });
40580
40428
 
@@ -40584,7 +40432,7 @@ var platform = {
40584
40432
  };
40585
40433
 
40586
40434
  function toURLEncodedForm(data, options) {
40587
- return toFormData(data, new platform.classes.URLSearchParams(), {
40435
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
40588
40436
  visitor: function(value, key, path, helpers) {
40589
40437
  if (platform.isNode && utils$1.isBuffer(value)) {
40590
40438
  this.append(key, value.toString('base64'));
@@ -40592,9 +40440,8 @@ function toURLEncodedForm(data, options) {
40592
40440
  }
40593
40441
 
40594
40442
  return helpers.defaultVisitor.apply(this, arguments);
40595
- },
40596
- ...options
40597
- });
40443
+ }
40444
+ }, options));
40598
40445
  }
40599
40446
 
40600
40447
  /**
@@ -40790,11 +40637,11 @@ const defaults = {
40790
40637
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
40791
40638
 
40792
40639
  try {
40793
- return JSON.parse(data, this.parseReviver);
40640
+ return JSON.parse(data);
40794
40641
  } catch (e) {
40795
40642
  if (strictJSONParsing) {
40796
40643
  if (e.name === 'SyntaxError') {
40797
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
40644
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
40798
40645
  }
40799
40646
  throw e;
40800
40647
  }
@@ -40988,18 +40835,10 @@ class AxiosHeaders {
40988
40835
  setHeaders(header, valueOrRewrite);
40989
40836
  } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
40990
40837
  setHeaders(parseHeaders(header), valueOrRewrite);
40991
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
40992
- let obj = {}, dest, key;
40993
- for (const entry of header) {
40994
- if (!utils$1.isArray(entry)) {
40995
- throw TypeError('Object iterator must return a key-value pair');
40996
- }
40997
-
40998
- obj[key = entry[0]] = (dest = obj[key]) ?
40999
- (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
40838
+ } else if (utils$1.isHeaders(header)) {
40839
+ for (const [key, value] of header.entries()) {
40840
+ setHeader(value, key, rewrite);
41000
40841
  }
41001
-
41002
- setHeaders(obj, valueOrRewrite);
41003
40842
  } else {
41004
40843
  header != null && setHeader(valueOrRewrite, header, rewrite);
41005
40844
  }
@@ -41141,10 +40980,6 @@ class AxiosHeaders {
41141
40980
  return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
41142
40981
  }
41143
40982
 
41144
- getSetCookie() {
41145
- return this.get("set-cookie") || [];
41146
- }
41147
-
41148
40983
  get [Symbol.toStringTag]() {
41149
40984
  return 'AxiosHeaders';
41150
40985
  }
@@ -41228,24 +41063,24 @@ function isCancel(value) {
41228
41063
  return !!(value && value.__CANCEL__);
41229
41064
  }
41230
41065
 
41231
- class CanceledError extends AxiosError$1 {
41232
- /**
41233
- * A `CanceledError` is an object that is thrown when an operation is canceled.
41234
- *
41235
- * @param {string=} message The message.
41236
- * @param {Object=} config The config.
41237
- * @param {Object=} request The request.
41238
- *
41239
- * @returns {CanceledError} The created error.
41240
- */
41241
- constructor(message, config, request) {
41242
- super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
41243
- this.name = 'CanceledError';
41244
- this.__CANCEL__ = true;
41245
- }
41066
+ /**
41067
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
41068
+ *
41069
+ * @param {string=} message The message.
41070
+ * @param {Object=} config The config.
41071
+ * @param {Object=} request The request.
41072
+ *
41073
+ * @returns {CanceledError} The created error.
41074
+ */
41075
+ function CanceledError(message, config, request) {
41076
+ // eslint-disable-next-line no-eq-null,eqeqeq
41077
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
41078
+ this.name = 'CanceledError';
41246
41079
  }
41247
41080
 
41248
- var CanceledError$1 = CanceledError;
41081
+ utils$1.inherits(CanceledError, AxiosError, {
41082
+ __CANCEL__: true
41083
+ });
41249
41084
 
41250
41085
  /**
41251
41086
  * Resolve or reject a Promise based on response status.
@@ -41261,9 +41096,9 @@ function settle(resolve, reject, response) {
41261
41096
  if (!response.status || !validateStatus || validateStatus(response.status)) {
41262
41097
  resolve(response);
41263
41098
  } else {
41264
- reject(new AxiosError$1(
41099
+ reject(new AxiosError(
41265
41100
  'Request failed with status code ' + response.status,
41266
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
41101
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
41267
41102
  response.config,
41268
41103
  response.request,
41269
41104
  response
@@ -41282,10 +41117,6 @@ function isAbsoluteURL(url) {
41282
41117
  // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
41283
41118
  // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
41284
41119
  // by any combination of letters, digits, plus, period, or hyphen.
41285
- if (typeof url !== 'string') {
41286
- return false;
41287
- }
41288
-
41289
41120
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
41290
41121
  }
41291
41122
 
@@ -41313,16 +41144,13 @@ function combineURLs(baseURL, relativeURL) {
41313
41144
  *
41314
41145
  * @returns {string} The combined full path
41315
41146
  */
41316
- function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
41317
- let isRelativeUrl = !isAbsoluteURL(requestedURL);
41318
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
41147
+ function buildFullPath(baseURL, requestedURL) {
41148
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
41319
41149
  return combineURLs(baseURL, requestedURL);
41320
41150
  }
41321
41151
  return requestedURL;
41322
41152
  }
41323
41153
 
41324
- var proxyFromEnv = {};
41325
-
41326
41154
  var parseUrl$1 = require$$0__default["default"].parse;
41327
41155
 
41328
41156
  var DEFAULT_PORTS = {
@@ -41428,7 +41256,7 @@ function getEnv(key) {
41428
41256
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
41429
41257
  }
41430
41258
 
41431
- proxyFromEnv.getProxyForUrl = getProxyForUrl;
41259
+ var getProxyForUrl_1 = getProxyForUrl;
41432
41260
 
41433
41261
  var followRedirects$1 = {exports: {}};
41434
41262
 
@@ -42616,7 +42444,7 @@ var debug = debug_1;
42616
42444
  (function detectUnsupportedEnvironment() {
42617
42445
  var looksLikeNode = typeof process !== "undefined";
42618
42446
  var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
42619
- var looksLikeV8 = isFunction$1(Error.captureStackTrace);
42447
+ var looksLikeV8 = isFunction(Error.captureStackTrace);
42620
42448
  if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
42621
42449
  console.warn("The follow-redirects package should be excluded from browser builds.");
42622
42450
  }
@@ -42740,7 +42568,7 @@ RedirectableRequest.prototype.write = function (data, encoding, callback) {
42740
42568
  if (!isString(data) && !isBuffer(data)) {
42741
42569
  throw new TypeError("data should be a string, Buffer or Uint8Array");
42742
42570
  }
42743
- if (isFunction$1(encoding)) {
42571
+ if (isFunction(encoding)) {
42744
42572
  callback = encoding;
42745
42573
  encoding = null;
42746
42574
  }
@@ -42769,11 +42597,11 @@ RedirectableRequest.prototype.write = function (data, encoding, callback) {
42769
42597
  // Ends the current native request
42770
42598
  RedirectableRequest.prototype.end = function (data, encoding, callback) {
42771
42599
  // Shift parameters if necessary
42772
- if (isFunction$1(data)) {
42600
+ if (isFunction(data)) {
42773
42601
  callback = data;
42774
42602
  data = encoding = null;
42775
42603
  }
42776
- else if (isFunction$1(encoding)) {
42604
+ else if (isFunction(encoding)) {
42777
42605
  callback = encoding;
42778
42606
  encoding = null;
42779
42607
  }
@@ -43081,7 +42909,7 @@ RedirectableRequest.prototype._processResponse = function (response) {
43081
42909
  }
43082
42910
 
43083
42911
  // Evaluate the beforeRedirect callback
43084
- if (isFunction$1(beforeRedirect)) {
42912
+ if (isFunction(beforeRedirect)) {
43085
42913
  var responseDetails = {
43086
42914
  headers: response.headers,
43087
42915
  statusCode: statusCode,
@@ -43128,7 +42956,7 @@ function wrap(protocols) {
43128
42956
  options = validateUrl(input);
43129
42957
  input = { protocol: protocol };
43130
42958
  }
43131
- if (isFunction$1(options)) {
42959
+ if (isFunction(options)) {
43132
42960
  callback = options;
43133
42961
  options = null;
43134
42962
  }
@@ -43233,7 +43061,7 @@ function createErrorType(code, message, baseClass) {
43233
43061
  // Create constructor
43234
43062
  function CustomError(properties) {
43235
43063
  // istanbul ignore else
43236
- if (isFunction$1(Error.captureStackTrace)) {
43064
+ if (isFunction(Error.captureStackTrace)) {
43237
43065
  Error.captureStackTrace(this, this.constructor);
43238
43066
  }
43239
43067
  Object.assign(this, properties || {});
@@ -43274,7 +43102,7 @@ function isString(value) {
43274
43102
  return typeof value === "string" || value instanceof String;
43275
43103
  }
43276
43104
 
43277
- function isFunction$1(value) {
43105
+ function isFunction(value) {
43278
43106
  return typeof value === "function";
43279
43107
  }
43280
43108
 
@@ -43292,7 +43120,7 @@ followRedirects$1.exports.wrap = wrap;
43292
43120
 
43293
43121
  var followRedirects = followRedirects$1.exports;
43294
43122
 
43295
- const VERSION = "1.13.5";
43123
+ const VERSION = "1.7.2";
43296
43124
 
43297
43125
  function parseProtocol(url) {
43298
43126
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -43325,7 +43153,7 @@ function fromDataURI(uri, asBlob, options) {
43325
43153
  const match = DATA_URL_PATTERN.exec(uri);
43326
43154
 
43327
43155
  if (!match) {
43328
- throw new AxiosError$1('Invalid URL', AxiosError$1.ERR_INVALID_URL);
43156
+ throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
43329
43157
  }
43330
43158
 
43331
43159
  const mime = match[1];
@@ -43335,7 +43163,7 @@ function fromDataURI(uri, asBlob, options) {
43335
43163
 
43336
43164
  if (asBlob) {
43337
43165
  if (!_Blob) {
43338
- throw new AxiosError$1('Blob is not supported', AxiosError$1.ERR_NOT_SUPPORT);
43166
+ throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
43339
43167
  }
43340
43168
 
43341
43169
  return new _Blob([buffer], {type: mime});
@@ -43344,7 +43172,91 @@ function fromDataURI(uri, asBlob, options) {
43344
43172
  return buffer;
43345
43173
  }
43346
43174
 
43347
- throw new AxiosError$1('Unsupported protocol ' + protocol, AxiosError$1.ERR_NOT_SUPPORT);
43175
+ throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
43176
+ }
43177
+
43178
+ /**
43179
+ * Throttle decorator
43180
+ * @param {Function} fn
43181
+ * @param {Number} freq
43182
+ * @return {Function}
43183
+ */
43184
+ function throttle(fn, freq) {
43185
+ let timestamp = 0;
43186
+ const threshold = 1000 / freq;
43187
+ let timer = null;
43188
+ return function throttled() {
43189
+ const force = this === true;
43190
+
43191
+ const now = Date.now();
43192
+ if (force || now - timestamp > threshold) {
43193
+ if (timer) {
43194
+ clearTimeout(timer);
43195
+ timer = null;
43196
+ }
43197
+ timestamp = now;
43198
+ return fn.apply(null, arguments);
43199
+ }
43200
+ if (!timer) {
43201
+ timer = setTimeout(() => {
43202
+ timer = null;
43203
+ timestamp = Date.now();
43204
+ return fn.apply(null, arguments);
43205
+ }, threshold - (now - timestamp));
43206
+ }
43207
+ };
43208
+ }
43209
+
43210
+ /**
43211
+ * Calculate data maxRate
43212
+ * @param {Number} [samplesCount= 10]
43213
+ * @param {Number} [min= 1000]
43214
+ * @returns {Function}
43215
+ */
43216
+ function speedometer(samplesCount, min) {
43217
+ samplesCount = samplesCount || 10;
43218
+ const bytes = new Array(samplesCount);
43219
+ const timestamps = new Array(samplesCount);
43220
+ let head = 0;
43221
+ let tail = 0;
43222
+ let firstSampleTS;
43223
+
43224
+ min = min !== undefined ? min : 1000;
43225
+
43226
+ return function push(chunkLength) {
43227
+ const now = Date.now();
43228
+
43229
+ const startedAt = timestamps[tail];
43230
+
43231
+ if (!firstSampleTS) {
43232
+ firstSampleTS = now;
43233
+ }
43234
+
43235
+ bytes[head] = chunkLength;
43236
+ timestamps[head] = now;
43237
+
43238
+ let i = tail;
43239
+ let bytesCount = 0;
43240
+
43241
+ while (i !== head) {
43242
+ bytesCount += bytes[i++];
43243
+ i = i % samplesCount;
43244
+ }
43245
+
43246
+ head = (head + 1) % samplesCount;
43247
+
43248
+ if (head === tail) {
43249
+ tail = (tail + 1) % samplesCount;
43250
+ }
43251
+
43252
+ if (now - firstSampleTS < min) {
43253
+ return;
43254
+ }
43255
+
43256
+ const passed = startedAt && now - startedAt;
43257
+
43258
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
43259
+ };
43348
43260
  }
43349
43261
 
43350
43262
  const kInternals = Symbol('internals');
@@ -43366,8 +43278,12 @@ class AxiosTransformStream extends stream__default["default"].Transform{
43366
43278
  readableHighWaterMark: options.chunkSize
43367
43279
  });
43368
43280
 
43281
+ const self = this;
43282
+
43369
43283
  const internals = this[kInternals] = {
43284
+ length: options.length,
43370
43285
  timeWindow: options.timeWindow,
43286
+ ticksRate: options.ticksRate,
43371
43287
  chunkSize: options.chunkSize,
43372
43288
  maxRate: options.maxRate,
43373
43289
  minChunkSize: options.minChunkSize,
@@ -43379,6 +43295,8 @@ class AxiosTransformStream extends stream__default["default"].Transform{
43379
43295
  onReadCallback: null
43380
43296
  };
43381
43297
 
43298
+ const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);
43299
+
43382
43300
  this.on('newListener', event => {
43383
43301
  if (event === 'progress') {
43384
43302
  if (!internals.isCaptured) {
@@ -43386,6 +43304,39 @@ class AxiosTransformStream extends stream__default["default"].Transform{
43386
43304
  }
43387
43305
  }
43388
43306
  });
43307
+
43308
+ let bytesNotified = 0;
43309
+
43310
+ internals.updateProgress = throttle(function throttledHandler() {
43311
+ const totalBytes = internals.length;
43312
+ const bytesTransferred = internals.bytesSeen;
43313
+ const progressBytes = bytesTransferred - bytesNotified;
43314
+ if (!progressBytes || self.destroyed) return;
43315
+
43316
+ const rate = _speedometer(progressBytes);
43317
+
43318
+ bytesNotified = bytesTransferred;
43319
+
43320
+ process.nextTick(() => {
43321
+ self.emit('progress', {
43322
+ loaded: bytesTransferred,
43323
+ total: totalBytes,
43324
+ progress: totalBytes ? (bytesTransferred / totalBytes) : undefined,
43325
+ bytes: progressBytes,
43326
+ rate: rate ? rate : undefined,
43327
+ estimated: rate && totalBytes && bytesTransferred <= totalBytes ?
43328
+ (totalBytes - bytesTransferred) / rate : undefined,
43329
+ lengthComputable: totalBytes != null
43330
+ });
43331
+ });
43332
+ }, internals.ticksRate);
43333
+
43334
+ const onFinish = () => {
43335
+ internals.updateProgress.call(true);
43336
+ };
43337
+
43338
+ this.once('end', onFinish);
43339
+ this.once('error', onFinish);
43389
43340
  }
43390
43341
 
43391
43342
  _read(size) {
@@ -43399,6 +43350,7 @@ class AxiosTransformStream extends stream__default["default"].Transform{
43399
43350
  }
43400
43351
 
43401
43352
  _transform(chunk, encoding, callback) {
43353
+ const self = this;
43402
43354
  const internals = this[kInternals];
43403
43355
  const maxRate = internals.maxRate;
43404
43356
 
@@ -43410,14 +43362,16 @@ class AxiosTransformStream extends stream__default["default"].Transform{
43410
43362
  const bytesThreshold = (maxRate / divider);
43411
43363
  const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
43412
43364
 
43413
- const pushChunk = (_chunk, _callback) => {
43365
+ function pushChunk(_chunk, _callback) {
43414
43366
  const bytes = Buffer.byteLength(_chunk);
43415
43367
  internals.bytesSeen += bytes;
43416
43368
  internals.bytes += bytes;
43417
43369
 
43418
- internals.isCaptured && this.emit('progress', internals.bytesSeen);
43370
+ if (internals.isCaptured) {
43371
+ internals.updateProgress();
43372
+ }
43419
43373
 
43420
- if (this.push(_chunk)) {
43374
+ if (self.push(_chunk)) {
43421
43375
  process.nextTick(_callback);
43422
43376
  } else {
43423
43377
  internals.onReadCallback = () => {
@@ -43425,7 +43379,7 @@ class AxiosTransformStream extends stream__default["default"].Transform{
43425
43379
  process.nextTick(_callback);
43426
43380
  };
43427
43381
  }
43428
- };
43382
+ }
43429
43383
 
43430
43384
  const transformChunk = (_chunk, _callback) => {
43431
43385
  const chunkSize = Buffer.byteLength(_chunk);
@@ -43482,6 +43436,11 @@ class AxiosTransformStream extends stream__default["default"].Transform{
43482
43436
  }
43483
43437
  });
43484
43438
  }
43439
+
43440
+ setLength(length) {
43441
+ this[kInternals].length = +length;
43442
+ return this;
43443
+ }
43485
43444
  }
43486
43445
 
43487
43446
  var AxiosTransformStream$1 = AxiosTransformStream;
@@ -43502,9 +43461,9 @@ const readBlob = async function* (blob) {
43502
43461
 
43503
43462
  var readBlob$1 = readBlob;
43504
43463
 
43505
- const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
43464
+ const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';
43506
43465
 
43507
- const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new require$$1__default["default"].TextEncoder();
43466
+ const textEncoder = new require$$1.TextEncoder();
43508
43467
 
43509
43468
  const CRLF = '\r\n';
43510
43469
  const CRLF_BYTES = textEncoder.encode(CRLF);
@@ -43562,7 +43521,7 @@ const formDataToStream = (form, headersHandler, options) => {
43562
43521
  const {
43563
43522
  tag = 'form-data-boundary',
43564
43523
  size = 25,
43565
- boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
43524
+ boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET)
43566
43525
  } = options || {};
43567
43526
 
43568
43527
  if(!utils$1.isFormData(form)) {
@@ -43574,7 +43533,7 @@ const formDataToStream = (form, headersHandler, options) => {
43574
43533
  }
43575
43534
 
43576
43535
  const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
43577
- const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
43536
+ const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
43578
43537
  let contentLength = footerBytes.byteLength;
43579
43538
 
43580
43539
  const parts = Array.from(form.entries()).map(([name, value]) => {
@@ -43649,216 +43608,6 @@ const callbackify = (fn, reducer) => {
43649
43608
 
43650
43609
  var callbackify$1 = callbackify;
43651
43610
 
43652
- /**
43653
- * Calculate data maxRate
43654
- * @param {Number} [samplesCount= 10]
43655
- * @param {Number} [min= 1000]
43656
- * @returns {Function}
43657
- */
43658
- function speedometer(samplesCount, min) {
43659
- samplesCount = samplesCount || 10;
43660
- const bytes = new Array(samplesCount);
43661
- const timestamps = new Array(samplesCount);
43662
- let head = 0;
43663
- let tail = 0;
43664
- let firstSampleTS;
43665
-
43666
- min = min !== undefined ? min : 1000;
43667
-
43668
- return function push(chunkLength) {
43669
- const now = Date.now();
43670
-
43671
- const startedAt = timestamps[tail];
43672
-
43673
- if (!firstSampleTS) {
43674
- firstSampleTS = now;
43675
- }
43676
-
43677
- bytes[head] = chunkLength;
43678
- timestamps[head] = now;
43679
-
43680
- let i = tail;
43681
- let bytesCount = 0;
43682
-
43683
- while (i !== head) {
43684
- bytesCount += bytes[i++];
43685
- i = i % samplesCount;
43686
- }
43687
-
43688
- head = (head + 1) % samplesCount;
43689
-
43690
- if (head === tail) {
43691
- tail = (tail + 1) % samplesCount;
43692
- }
43693
-
43694
- if (now - firstSampleTS < min) {
43695
- return;
43696
- }
43697
-
43698
- const passed = startedAt && now - startedAt;
43699
-
43700
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
43701
- };
43702
- }
43703
-
43704
- /**
43705
- * Throttle decorator
43706
- * @param {Function} fn
43707
- * @param {Number} freq
43708
- * @return {Function}
43709
- */
43710
- function throttle(fn, freq) {
43711
- let timestamp = 0;
43712
- let threshold = 1000 / freq;
43713
- let lastArgs;
43714
- let timer;
43715
-
43716
- const invoke = (args, now = Date.now()) => {
43717
- timestamp = now;
43718
- lastArgs = null;
43719
- if (timer) {
43720
- clearTimeout(timer);
43721
- timer = null;
43722
- }
43723
- fn(...args);
43724
- };
43725
-
43726
- const throttled = (...args) => {
43727
- const now = Date.now();
43728
- const passed = now - timestamp;
43729
- if ( passed >= threshold) {
43730
- invoke(args, now);
43731
- } else {
43732
- lastArgs = args;
43733
- if (!timer) {
43734
- timer = setTimeout(() => {
43735
- timer = null;
43736
- invoke(lastArgs);
43737
- }, threshold - passed);
43738
- }
43739
- }
43740
- };
43741
-
43742
- const flush = () => lastArgs && invoke(lastArgs);
43743
-
43744
- return [throttled, flush];
43745
- }
43746
-
43747
- const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
43748
- let bytesNotified = 0;
43749
- const _speedometer = speedometer(50, 250);
43750
-
43751
- return throttle(e => {
43752
- const loaded = e.loaded;
43753
- const total = e.lengthComputable ? e.total : undefined;
43754
- const progressBytes = loaded - bytesNotified;
43755
- const rate = _speedometer(progressBytes);
43756
- const inRange = loaded <= total;
43757
-
43758
- bytesNotified = loaded;
43759
-
43760
- const data = {
43761
- loaded,
43762
- total,
43763
- progress: total ? (loaded / total) : undefined,
43764
- bytes: progressBytes,
43765
- rate: rate ? rate : undefined,
43766
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
43767
- event: e,
43768
- lengthComputable: total != null,
43769
- [isDownloadStream ? 'download' : 'upload']: true
43770
- };
43771
-
43772
- listener(data);
43773
- }, freq);
43774
- };
43775
-
43776
- const progressEventDecorator = (total, throttled) => {
43777
- const lengthComputable = total != null;
43778
-
43779
- return [(loaded) => throttled[0]({
43780
- lengthComputable,
43781
- total,
43782
- loaded
43783
- }), throttled[1]];
43784
- };
43785
-
43786
- const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
43787
-
43788
- /**
43789
- * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
43790
- * - For base64: compute exact decoded size using length and padding;
43791
- * handle %XX at the character-count level (no string allocation).
43792
- * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
43793
- *
43794
- * @param {string} url
43795
- * @returns {number}
43796
- */
43797
- function estimateDataURLDecodedBytes(url) {
43798
- if (!url || typeof url !== 'string') return 0;
43799
- if (!url.startsWith('data:')) return 0;
43800
-
43801
- const comma = url.indexOf(',');
43802
- if (comma < 0) return 0;
43803
-
43804
- const meta = url.slice(5, comma);
43805
- const body = url.slice(comma + 1);
43806
- const isBase64 = /;base64/i.test(meta);
43807
-
43808
- if (isBase64) {
43809
- let effectiveLen = body.length;
43810
- const len = body.length; // cache length
43811
-
43812
- for (let i = 0; i < len; i++) {
43813
- if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
43814
- const a = body.charCodeAt(i + 1);
43815
- const b = body.charCodeAt(i + 2);
43816
- const isHex =
43817
- ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
43818
- ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
43819
-
43820
- if (isHex) {
43821
- effectiveLen -= 2;
43822
- i += 2;
43823
- }
43824
- }
43825
- }
43826
-
43827
- let pad = 0;
43828
- let idx = len - 1;
43829
-
43830
- const tailIsPct3D = (j) =>
43831
- j >= 2 &&
43832
- body.charCodeAt(j - 2) === 37 && // '%'
43833
- body.charCodeAt(j - 1) === 51 && // '3'
43834
- (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
43835
-
43836
- if (idx >= 0) {
43837
- if (body.charCodeAt(idx) === 61 /* '=' */) {
43838
- pad++;
43839
- idx--;
43840
- } else if (tailIsPct3D(idx)) {
43841
- pad++;
43842
- idx -= 3;
43843
- }
43844
- }
43845
-
43846
- if (pad === 1 && idx >= 0) {
43847
- if (body.charCodeAt(idx) === 61 /* '=' */) {
43848
- pad++;
43849
- } else if (tailIsPct3D(idx)) {
43850
- pad++;
43851
- }
43852
- }
43853
-
43854
- const groups = Math.floor(effectiveLen / 4);
43855
- const bytes = groups * 3 - (pad || 0);
43856
- return bytes > 0 ? bytes : 0;
43857
- }
43858
-
43859
- return Buffer.byteLength(body, 'utf8');
43860
- }
43861
-
43862
43611
  const zlibOptions = {
43863
43612
  flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
43864
43613
  finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
@@ -43879,111 +43628,6 @@ const supportedProtocols = platform.protocols.map(protocol => {
43879
43628
  return protocol + ':';
43880
43629
  });
43881
43630
 
43882
-
43883
- const flushOnFinish = (stream, [throttled, flush]) => {
43884
- stream
43885
- .on('end', flush)
43886
- .on('error', flush);
43887
-
43888
- return throttled;
43889
- };
43890
-
43891
- class Http2Sessions {
43892
- constructor() {
43893
- this.sessions = Object.create(null);
43894
- }
43895
-
43896
- getSession(authority, options) {
43897
- options = Object.assign({
43898
- sessionTimeout: 1000
43899
- }, options);
43900
-
43901
- let authoritySessions = this.sessions[authority];
43902
-
43903
- if (authoritySessions) {
43904
- let len = authoritySessions.length;
43905
-
43906
- for (let i = 0; i < len; i++) {
43907
- const [sessionHandle, sessionOptions] = authoritySessions[i];
43908
- if (!sessionHandle.destroyed && !sessionHandle.closed && require$$1__default["default"].isDeepStrictEqual(sessionOptions, options)) {
43909
- return sessionHandle;
43910
- }
43911
- }
43912
- }
43913
-
43914
- const session = http2__default["default"].connect(authority, options);
43915
-
43916
- let removed;
43917
-
43918
- const removeSession = () => {
43919
- if (removed) {
43920
- return;
43921
- }
43922
-
43923
- removed = true;
43924
-
43925
- let entries = authoritySessions, len = entries.length, i = len;
43926
-
43927
- while (i--) {
43928
- if (entries[i][0] === session) {
43929
- if (len === 1) {
43930
- delete this.sessions[authority];
43931
- } else {
43932
- entries.splice(i, 1);
43933
- }
43934
- return;
43935
- }
43936
- }
43937
- };
43938
-
43939
- const originalRequestFn = session.request;
43940
-
43941
- const {sessionTimeout} = options;
43942
-
43943
- if(sessionTimeout != null) {
43944
-
43945
- let timer;
43946
- let streamsCount = 0;
43947
-
43948
- session.request = function () {
43949
- const stream = originalRequestFn.apply(this, arguments);
43950
-
43951
- streamsCount++;
43952
-
43953
- if (timer) {
43954
- clearTimeout(timer);
43955
- timer = null;
43956
- }
43957
-
43958
- stream.once('close', () => {
43959
- if (!--streamsCount) {
43960
- timer = setTimeout(() => {
43961
- timer = null;
43962
- removeSession();
43963
- }, sessionTimeout);
43964
- }
43965
- });
43966
-
43967
- return stream;
43968
- };
43969
- }
43970
-
43971
- session.once('close', removeSession);
43972
-
43973
- let entry = [
43974
- session,
43975
- options
43976
- ];
43977
-
43978
- authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
43979
-
43980
- return session;
43981
- }
43982
- }
43983
-
43984
- const http2Sessions = new Http2Sessions();
43985
-
43986
-
43987
43631
  /**
43988
43632
  * If the proxy or config beforeRedirects functions are defined, call them with the options
43989
43633
  * object.
@@ -44013,7 +43657,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
44013
43657
  function setProxy(options, configProxy, location) {
44014
43658
  let proxy = configProxy;
44015
43659
  if (!proxy && proxy !== false) {
44016
- const proxyUrl = proxyFromEnv.getProxyForUrl(location);
43660
+ const proxyUrl = getProxyForUrl_1(location);
44017
43661
  if (proxyUrl) {
44018
43662
  proxy = new URL(proxyUrl);
44019
43663
  }
@@ -44026,16 +43670,12 @@ function setProxy(options, configProxy, location) {
44026
43670
 
44027
43671
  if (proxy.auth) {
44028
43672
  // Support proxy auth object form
44029
- const validProxyAuth = Boolean(proxy.auth.username || proxy.auth.password);
44030
-
44031
- if (validProxyAuth) {
43673
+ if (proxy.auth.username || proxy.auth.password) {
44032
43674
  proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');
44033
- } else if (typeof proxy.auth === 'object') {
44034
- throw new AxiosError$1('Invalid proxy authorization', AxiosError$1.ERR_BAD_OPTION, { proxy });
44035
43675
  }
44036
-
44037
- const base64 = Buffer.from(proxy.auth, 'utf8').toString('base64');
44038
-
43676
+ const base64 = Buffer
43677
+ .from(proxy.auth, 'utf8')
43678
+ .toString('base64');
44039
43679
  options.headers['Proxy-Authorization'] = 'Basic ' + base64;
44040
43680
  }
44041
43681
 
@@ -44099,76 +43739,16 @@ const resolveFamily = ({address, family}) => {
44099
43739
 
44100
43740
  const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {address, family});
44101
43741
 
44102
- const http2Transport = {
44103
- request(options, cb) {
44104
- const authority = options.protocol + '//' + options.hostname + ':' + (options.port ||(options.protocol === 'https:' ? 443 : 80));
44105
-
44106
-
44107
- const {http2Options, headers} = options;
44108
-
44109
- const session = http2Sessions.getSession(authority, http2Options);
44110
-
44111
- const {
44112
- HTTP2_HEADER_SCHEME,
44113
- HTTP2_HEADER_METHOD,
44114
- HTTP2_HEADER_PATH,
44115
- HTTP2_HEADER_STATUS
44116
- } = http2__default["default"].constants;
44117
-
44118
- const http2Headers = {
44119
- [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
44120
- [HTTP2_HEADER_METHOD]: options.method,
44121
- [HTTP2_HEADER_PATH]: options.path,
44122
- };
44123
-
44124
- utils$1.forEach(headers, (header, name) => {
44125
- name.charAt(0) !== ':' && (http2Headers[name] = header);
44126
- });
44127
-
44128
- const req = session.request(http2Headers);
44129
-
44130
- req.once('response', (responseHeaders) => {
44131
- const response = req; //duplex
44132
-
44133
- responseHeaders = Object.assign({}, responseHeaders);
44134
-
44135
- const status = responseHeaders[HTTP2_HEADER_STATUS];
44136
-
44137
- delete responseHeaders[HTTP2_HEADER_STATUS];
44138
-
44139
- response.headers = responseHeaders;
44140
-
44141
- response.statusCode = +status;
44142
-
44143
- cb(response);
44144
- });
44145
-
44146
- return req;
44147
- }
44148
- };
44149
-
44150
43742
  /*eslint consistent-return:0*/
44151
43743
  var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44152
43744
  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
44153
- let {data, lookup, family, httpVersion = 1, http2Options} = config;
43745
+ let {data, lookup, family} = config;
44154
43746
  const {responseType, responseEncoding} = config;
44155
43747
  const method = config.method.toUpperCase();
44156
43748
  let isDone;
44157
43749
  let rejected = false;
44158
43750
  let req;
44159
43751
 
44160
- httpVersion = +httpVersion;
44161
-
44162
- if (Number.isNaN(httpVersion)) {
44163
- throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
44164
- }
44165
-
44166
- if (httpVersion !== 1 && httpVersion !== 2) {
44167
- throw TypeError(`Unsupported protocol version '${httpVersion}'`);
44168
- }
44169
-
44170
- const isHttp2 = httpVersion === 2;
44171
-
44172
43752
  if (lookup) {
44173
43753
  const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]);
44174
43754
  // hotfix to support opt.all option which is required for node 20.x
@@ -44185,17 +43765,8 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44185
43765
  };
44186
43766
  }
44187
43767
 
44188
- const abortEmitter = new events$1.EventEmitter();
44189
-
44190
- function abort(reason) {
44191
- try {
44192
- abortEmitter.emit('abort', !reason || reason.type ? new CanceledError$1(null, config, req) : reason);
44193
- } catch(err) {
44194
- console.warn('emit error', err);
44195
- }
44196
- }
44197
-
44198
- abortEmitter.once('abort', reject);
43768
+ // temporary internal emitter until the AxiosRequest class will be implemented
43769
+ const emitter = new events$1.EventEmitter();
44199
43770
 
44200
43771
  const onFinished = () => {
44201
43772
  if (config.cancelToken) {
@@ -44206,62 +43777,36 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44206
43777
  config.signal.removeEventListener('abort', abort);
44207
43778
  }
44208
43779
 
44209
- abortEmitter.removeAllListeners();
43780
+ emitter.removeAllListeners();
44210
43781
  };
44211
43782
 
44212
- if (config.cancelToken || config.signal) {
44213
- config.cancelToken && config.cancelToken.subscribe(abort);
44214
- if (config.signal) {
44215
- config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
44216
- }
44217
- }
44218
-
44219
- onDone((response, isRejected) => {
43783
+ onDone((value, isRejected) => {
44220
43784
  isDone = true;
44221
-
44222
43785
  if (isRejected) {
44223
43786
  rejected = true;
44224
43787
  onFinished();
44225
- return;
44226
- }
44227
-
44228
- const {data} = response;
44229
-
44230
- if (data instanceof stream__default["default"].Readable || data instanceof stream__default["default"].Duplex) {
44231
- const offListeners = stream__default["default"].finished(data, () => {
44232
- offListeners();
44233
- onFinished();
44234
- });
44235
- } else {
44236
- onFinished();
44237
43788
  }
44238
43789
  });
44239
43790
 
43791
+ function abort(reason) {
43792
+ emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
43793
+ }
44240
43794
 
43795
+ emitter.once('abort', reject);
44241
43796
 
44242
-
43797
+ if (config.cancelToken || config.signal) {
43798
+ config.cancelToken && config.cancelToken.subscribe(abort);
43799
+ if (config.signal) {
43800
+ config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
43801
+ }
43802
+ }
44243
43803
 
44244
43804
  // Parse url
44245
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
44246
- const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
43805
+ const fullPath = buildFullPath(config.baseURL, config.url);
43806
+ const parsed = new URL(fullPath, 'http://localhost');
44247
43807
  const protocol = parsed.protocol || supportedProtocols[0];
44248
43808
 
44249
43809
  if (protocol === 'data:') {
44250
- // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
44251
- if (config.maxContentLength > -1) {
44252
- // Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed.
44253
- const dataUrl = String(config.url || fullPath || '');
44254
- const estimated = estimateDataURLDecodedBytes(dataUrl);
44255
-
44256
- if (estimated > config.maxContentLength) {
44257
- return reject(new AxiosError$1(
44258
- 'maxContentLength size of ' + config.maxContentLength + ' exceeded',
44259
- AxiosError$1.ERR_BAD_RESPONSE,
44260
- config
44261
- ));
44262
- }
44263
- }
44264
-
44265
43810
  let convertedData;
44266
43811
 
44267
43812
  if (method !== 'GET') {
@@ -44278,7 +43823,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44278
43823
  Blob: config.env && config.env.Blob
44279
43824
  });
44280
43825
  } catch (err) {
44281
- throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config);
43826
+ throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
44282
43827
  }
44283
43828
 
44284
43829
  if (responseType === 'text') {
@@ -44301,9 +43846,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44301
43846
  }
44302
43847
 
44303
43848
  if (supportedProtocols.indexOf(protocol) === -1) {
44304
- return reject(new AxiosError$1(
43849
+ return reject(new AxiosError(
44305
43850
  'Unsupported protocol ' + protocol,
44306
- AxiosError$1.ERR_BAD_REQUEST,
43851
+ AxiosError.ERR_BAD_REQUEST,
44307
43852
  config
44308
43853
  ));
44309
43854
  }
@@ -44316,7 +43861,8 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44316
43861
  // Only set header if it hasn't been set in config
44317
43862
  headers.set('User-Agent', 'axios/' + VERSION, false);
44318
43863
 
44319
- const {onUploadProgress, onDownloadProgress} = config;
43864
+ const onDownloadProgress = config.onDownloadProgress;
43865
+ const onUploadProgress = config.onUploadProgress;
44320
43866
  const maxRate = config.maxRate;
44321
43867
  let maxUploadRate = undefined;
44322
43868
  let maxDownloadRate = undefined;
@@ -44343,7 +43889,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44343
43889
  } catch (e) {
44344
43890
  }
44345
43891
  }
44346
- } else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
43892
+ } else if (utils$1.isBlob(data)) {
44347
43893
  data.size && headers.setContentType(data.type || 'application/octet-stream');
44348
43894
  headers.setContentLength(data.size || 0);
44349
43895
  data = stream__default["default"].Readable.from(readBlob$1(data));
@@ -44353,9 +43899,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44353
43899
  } else if (utils$1.isString(data)) {
44354
43900
  data = Buffer.from(data, 'utf-8');
44355
43901
  } else {
44356
- return reject(new AxiosError$1(
43902
+ return reject(new AxiosError(
44357
43903
  'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
44358
- AxiosError$1.ERR_BAD_REQUEST,
43904
+ AxiosError.ERR_BAD_REQUEST,
44359
43905
  config
44360
43906
  ));
44361
43907
  }
@@ -44364,9 +43910,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44364
43910
  headers.setContentLength(data.length, false);
44365
43911
 
44366
43912
  if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
44367
- return reject(new AxiosError$1(
43913
+ return reject(new AxiosError(
44368
43914
  'Request body larger than maxBodyLength limit',
44369
- AxiosError$1.ERR_BAD_REQUEST,
43915
+ AxiosError.ERR_BAD_REQUEST,
44370
43916
  config
44371
43917
  ));
44372
43918
  }
@@ -44387,16 +43933,15 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44387
43933
  }
44388
43934
 
44389
43935
  data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({
43936
+ length: contentLength,
44390
43937
  maxRate: utils$1.toFiniteNumber(maxUploadRate)
44391
43938
  })], utils$1.noop);
44392
43939
 
44393
- onUploadProgress && data.on('progress', flushOnFinish(
44394
- data,
44395
- progressEventDecorator(
44396
- contentLength,
44397
- progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
44398
- )
44399
- ));
43940
+ onUploadProgress && data.on('progress', progress => {
43941
+ onUploadProgress(Object.assign(progress, {
43942
+ upload: true
43943
+ }));
43944
+ });
44400
43945
  }
44401
43946
 
44402
43947
  // HTTP basic authentication
@@ -44445,8 +43990,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44445
43990
  protocol,
44446
43991
  family,
44447
43992
  beforeRedirect: dispatchBeforeRedirect,
44448
- beforeRedirects: {},
44449
- http2Options
43993
+ beforeRedirects: {}
44450
43994
  };
44451
43995
 
44452
43996
  // cacheable-lookup integration hotfix
@@ -44455,7 +43999,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44455
43999
  if (config.socketPath) {
44456
44000
  options.socketPath = config.socketPath;
44457
44001
  } else {
44458
- options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
44002
+ options.hostname = parsed.hostname;
44459
44003
  options.port = parsed.port;
44460
44004
  setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
44461
44005
  }
@@ -44463,23 +44007,18 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44463
44007
  let transport;
44464
44008
  const isHttpsRequest = isHttps.test(options.protocol);
44465
44009
  options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
44466
-
44467
- if (isHttp2) {
44468
- transport = http2Transport;
44010
+ if (config.transport) {
44011
+ transport = config.transport;
44012
+ } else if (config.maxRedirects === 0) {
44013
+ transport = isHttpsRequest ? require$$4__default["default"] : require$$3__default["default"];
44469
44014
  } else {
44470
- if (config.transport) {
44471
- transport = config.transport;
44472
- } else if (config.maxRedirects === 0) {
44473
- transport = isHttpsRequest ? require$$4__default["default"] : require$$3__default["default"];
44474
- } else {
44475
- if (config.maxRedirects) {
44476
- options.maxRedirects = config.maxRedirects;
44477
- }
44478
- if (config.beforeRedirect) {
44479
- options.beforeRedirects.config = config.beforeRedirect;
44480
- }
44481
- transport = isHttpsRequest ? httpsFollow : httpFollow;
44015
+ if (config.maxRedirects) {
44016
+ options.maxRedirects = config.maxRedirects;
44017
+ }
44018
+ if (config.beforeRedirect) {
44019
+ options.beforeRedirects.config = config.beforeRedirect;
44482
44020
  }
44021
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
44483
44022
  }
44484
44023
 
44485
44024
  if (config.maxBodyLength > -1) {
@@ -44499,20 +44038,19 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44499
44038
 
44500
44039
  const streams = [res];
44501
44040
 
44502
- const responseLength = utils$1.toFiniteNumber(res.headers['content-length']);
44041
+ const responseLength = +res.headers['content-length'];
44503
44042
 
44504
- if (onDownloadProgress || maxDownloadRate) {
44043
+ if (onDownloadProgress) {
44505
44044
  const transformStream = new AxiosTransformStream$1({
44045
+ length: utils$1.toFiniteNumber(responseLength),
44506
44046
  maxRate: utils$1.toFiniteNumber(maxDownloadRate)
44507
44047
  });
44508
44048
 
44509
- onDownloadProgress && transformStream.on('progress', flushOnFinish(
44510
- transformStream,
44511
- progressEventDecorator(
44512
- responseLength,
44513
- progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
44514
- )
44515
- ));
44049
+ onDownloadProgress && transformStream.on('progress', progress => {
44050
+ onDownloadProgress(Object.assign(progress, {
44051
+ download: true
44052
+ }));
44053
+ });
44516
44054
 
44517
44055
  streams.push(transformStream);
44518
44056
  }
@@ -44562,7 +44100,10 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44562
44100
 
44563
44101
  responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0];
44564
44102
 
44565
-
44103
+ const offListeners = stream__default["default"].finished(responseStream, () => {
44104
+ offListeners();
44105
+ onFinished();
44106
+ });
44566
44107
 
44567
44108
  const response = {
44568
44109
  status: res.statusCode,
@@ -44588,8 +44129,8 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44588
44129
  // stream.destroy() emit aborted event before calling reject() on Node.js v16
44589
44130
  rejected = true;
44590
44131
  responseStream.destroy();
44591
- abort(new AxiosError$1('maxContentLength size of ' + config.maxContentLength + ' exceeded',
44592
- AxiosError$1.ERR_BAD_RESPONSE, config, lastRequest));
44132
+ reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
44133
+ AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
44593
44134
  }
44594
44135
  });
44595
44136
 
@@ -44598,9 +44139,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44598
44139
  return;
44599
44140
  }
44600
44141
 
44601
- const err = new AxiosError$1(
44602
- 'stream has been aborted',
44603
- AxiosError$1.ERR_BAD_RESPONSE,
44142
+ const err = new AxiosError(
44143
+ 'maxContentLength size of ' + config.maxContentLength + ' exceeded',
44144
+ AxiosError.ERR_BAD_RESPONSE,
44604
44145
  config,
44605
44146
  lastRequest
44606
44147
  );
@@ -44610,7 +44151,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44610
44151
 
44611
44152
  responseStream.on('error', function handleStreamError(err) {
44612
44153
  if (req.destroyed) return;
44613
- reject(AxiosError$1.from(err, null, config, lastRequest));
44154
+ reject(AxiosError.from(err, null, config, lastRequest));
44614
44155
  });
44615
44156
 
44616
44157
  responseStream.on('end', function handleStreamEnd() {
@@ -44624,13 +44165,13 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44624
44165
  }
44625
44166
  response.data = responseData;
44626
44167
  } catch (err) {
44627
- return reject(AxiosError$1.from(err, null, config, response.request, response));
44168
+ return reject(AxiosError.from(err, null, config, response.request, response));
44628
44169
  }
44629
44170
  settle(resolve, reject, response);
44630
44171
  });
44631
44172
  }
44632
44173
 
44633
- abortEmitter.once('abort', err => {
44174
+ emitter.once('abort', err => {
44634
44175
  if (!responseStream.destroyed) {
44635
44176
  responseStream.emit('error', err);
44636
44177
  responseStream.destroy();
@@ -44638,17 +44179,16 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44638
44179
  });
44639
44180
  });
44640
44181
 
44641
- abortEmitter.once('abort', err => {
44642
- if (req.close) {
44643
- req.close();
44644
- } else {
44645
- req.destroy(err);
44646
- }
44182
+ emitter.once('abort', err => {
44183
+ reject(err);
44184
+ req.destroy(err);
44647
44185
  });
44648
44186
 
44649
44187
  // Handle errors
44650
44188
  req.on('error', function handleRequestError(err) {
44651
- reject(AxiosError$1.from(err, null, config, req));
44189
+ // @todo remove
44190
+ // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
44191
+ reject(AxiosError.from(err, null, config, req));
44652
44192
  });
44653
44193
 
44654
44194
  // set tcp keep alive to prevent drop connection by peer
@@ -44663,9 +44203,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44663
44203
  const timeout = parseInt(config.timeout, 10);
44664
44204
 
44665
44205
  if (Number.isNaN(timeout)) {
44666
- abort(new AxiosError$1(
44206
+ reject(new AxiosError(
44667
44207
  'error trying to parse `config.timeout` to int',
44668
- AxiosError$1.ERR_BAD_OPTION_VALUE,
44208
+ AxiosError.ERR_BAD_OPTION_VALUE,
44669
44209
  config,
44670
44210
  req
44671
44211
  ));
@@ -44685,16 +44225,14 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44685
44225
  if (config.timeoutErrorMessage) {
44686
44226
  timeoutErrorMessage = config.timeoutErrorMessage;
44687
44227
  }
44688
- abort(new AxiosError$1(
44228
+ reject(new AxiosError(
44689
44229
  timeoutErrorMessage,
44690
- transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
44230
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
44691
44231
  config,
44692
44232
  req
44693
44233
  ));
44234
+ abort();
44694
44235
  });
44695
- } else {
44696
- // explicitly reset the socket timeout value for a possible `keep-alive` request
44697
- req.setTimeout(0);
44698
44236
  }
44699
44237
 
44700
44238
 
@@ -44714,67 +44252,135 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
44714
44252
 
44715
44253
  data.on('close', () => {
44716
44254
  if (!ended && !errored) {
44717
- abort(new CanceledError$1('Request stream has been aborted', config, req));
44255
+ abort(new CanceledError('Request stream has been aborted', config, req));
44718
44256
  }
44719
44257
  });
44720
44258
 
44721
44259
  data.pipe(req);
44722
44260
  } else {
44723
- data && req.write(data);
44724
- req.end();
44261
+ req.end(data);
44725
44262
  }
44726
44263
  });
44727
44264
  };
44728
44265
 
44729
- var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
44730
- url = new URL(url, platform.origin);
44266
+ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
44267
+ let bytesNotified = 0;
44268
+ const _speedometer = speedometer(50, 250);
44731
44269
 
44732
- return (
44733
- origin.protocol === url.protocol &&
44734
- origin.host === url.host &&
44735
- (isMSIE || origin.port === url.port)
44736
- );
44737
- })(
44738
- new URL(platform.origin),
44739
- platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
44740
- ) : () => true;
44270
+ return throttle(e => {
44271
+ const loaded = e.loaded;
44272
+ const total = e.lengthComputable ? e.total : undefined;
44273
+ const progressBytes = loaded - bytesNotified;
44274
+ const rate = _speedometer(progressBytes);
44275
+ const inRange = loaded <= total;
44276
+
44277
+ bytesNotified = loaded;
44278
+
44279
+ const data = {
44280
+ loaded,
44281
+ total,
44282
+ progress: total ? (loaded / total) : undefined,
44283
+ bytes: progressBytes,
44284
+ rate: rate ? rate : undefined,
44285
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
44286
+ event: e,
44287
+ lengthComputable: total != null
44288
+ };
44289
+
44290
+ data[isDownloadStream ? 'download' : 'upload'] = true;
44291
+
44292
+ listener(data);
44293
+ }, freq);
44294
+ };
44295
+
44296
+ var isURLSameOrigin = platform.hasStandardBrowserEnv ?
44297
+
44298
+ // Standard browser envs have full support of the APIs needed to test
44299
+ // whether the request URL is of the same origin as current location.
44300
+ (function standardBrowserEnv() {
44301
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
44302
+ const urlParsingNode = document.createElement('a');
44303
+ let originURL;
44304
+
44305
+ /**
44306
+ * Parse a URL to discover its components
44307
+ *
44308
+ * @param {String} url The URL to be parsed
44309
+ * @returns {Object}
44310
+ */
44311
+ function resolveURL(url) {
44312
+ let href = url;
44313
+
44314
+ if (msie) {
44315
+ // IE needs attribute set twice to normalize properties
44316
+ urlParsingNode.setAttribute('href', href);
44317
+ href = urlParsingNode.href;
44318
+ }
44319
+
44320
+ urlParsingNode.setAttribute('href', href);
44321
+
44322
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
44323
+ return {
44324
+ href: urlParsingNode.href,
44325
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
44326
+ host: urlParsingNode.host,
44327
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
44328
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
44329
+ hostname: urlParsingNode.hostname,
44330
+ port: urlParsingNode.port,
44331
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
44332
+ urlParsingNode.pathname :
44333
+ '/' + urlParsingNode.pathname
44334
+ };
44335
+ }
44336
+
44337
+ originURL = resolveURL(window.location.href);
44338
+
44339
+ /**
44340
+ * Determine if a URL shares the same origin as the current location
44341
+ *
44342
+ * @param {String} requestURL The URL to test
44343
+ * @returns {boolean} True if URL shares the same origin, otherwise false
44344
+ */
44345
+ return function isURLSameOrigin(requestURL) {
44346
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
44347
+ return (parsed.protocol === originURL.protocol &&
44348
+ parsed.host === originURL.host);
44349
+ };
44350
+ })() :
44351
+
44352
+ // Non standard browser envs (web workers, react-native) lack needed support.
44353
+ (function nonStandardBrowserEnv() {
44354
+ return function isURLSameOrigin() {
44355
+ return true;
44356
+ };
44357
+ })();
44741
44358
 
44742
44359
  var cookies = platform.hasStandardBrowserEnv ?
44743
44360
 
44744
44361
  // Standard browser envs support document.cookie
44745
44362
  {
44746
- write(name, value, expires, path, domain, secure, sameSite) {
44747
- if (typeof document === 'undefined') return;
44363
+ write(name, value, expires, path, domain, secure) {
44364
+ const cookie = [name + '=' + encodeURIComponent(value)];
44748
44365
 
44749
- const cookie = [`${name}=${encodeURIComponent(value)}`];
44366
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
44750
44367
 
44751
- if (utils$1.isNumber(expires)) {
44752
- cookie.push(`expires=${new Date(expires).toUTCString()}`);
44753
- }
44754
- if (utils$1.isString(path)) {
44755
- cookie.push(`path=${path}`);
44756
- }
44757
- if (utils$1.isString(domain)) {
44758
- cookie.push(`domain=${domain}`);
44759
- }
44760
- if (secure === true) {
44761
- cookie.push('secure');
44762
- }
44763
- if (utils$1.isString(sameSite)) {
44764
- cookie.push(`SameSite=${sameSite}`);
44765
- }
44368
+ utils$1.isString(path) && cookie.push('path=' + path);
44369
+
44370
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
44371
+
44372
+ secure === true && cookie.push('secure');
44766
44373
 
44767
44374
  document.cookie = cookie.join('; ');
44768
44375
  },
44769
44376
 
44770
44377
  read(name) {
44771
- if (typeof document === 'undefined') return null;
44772
- const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
44773
- return match ? decodeURIComponent(match[1]) : null;
44378
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
44379
+ return (match ? decodeURIComponent(match[3]) : null);
44774
44380
  },
44775
44381
 
44776
44382
  remove(name) {
44777
- this.write(name, '', Date.now() - 86400000, '/');
44383
+ this.write(name, '', Date.now() - 86400000);
44778
44384
  }
44779
44385
  }
44780
44386
 
@@ -44789,8 +44395,7 @@ var cookies = platform.hasStandardBrowserEnv ?
44789
44395
  remove() {}
44790
44396
  };
44791
44397
 
44792
- const headersToObject = (thing) =>
44793
- thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
44398
+ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
44794
44399
 
44795
44400
  /**
44796
44401
  * Config-specific merge-function which creates a new config-object
@@ -44806,9 +44411,9 @@ function mergeConfig(config1, config2) {
44806
44411
  config2 = config2 || {};
44807
44412
  const config = {};
44808
44413
 
44809
- function getMergedValue(target, source, prop, caseless) {
44414
+ function getMergedValue(target, source, caseless) {
44810
44415
  if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
44811
- return utils$1.merge.call({ caseless }, target, source);
44416
+ return utils$1.merge.call({caseless}, target, source);
44812
44417
  } else if (utils$1.isPlainObject(source)) {
44813
44418
  return utils$1.merge({}, source);
44814
44419
  } else if (utils$1.isArray(source)) {
@@ -44817,11 +44422,12 @@ function mergeConfig(config1, config2) {
44817
44422
  return source;
44818
44423
  }
44819
44424
 
44820
- function mergeDeepProperties(a, b, prop, caseless) {
44425
+ // eslint-disable-next-line consistent-return
44426
+ function mergeDeepProperties(a, b, caseless) {
44821
44427
  if (!utils$1.isUndefined(b)) {
44822
- return getMergedValue(a, b, prop, caseless);
44428
+ return getMergedValue(a, b, caseless);
44823
44429
  } else if (!utils$1.isUndefined(a)) {
44824
- return getMergedValue(undefined, a, prop, caseless);
44430
+ return getMergedValue(undefined, a, caseless);
44825
44431
  }
44826
44432
  }
44827
44433
 
@@ -44879,27 +44485,14 @@ function mergeConfig(config1, config2) {
44879
44485
  socketPath: defaultToConfig2,
44880
44486
  responseEncoding: defaultToConfig2,
44881
44487
  validateStatus: mergeDirectKeys,
44882
- headers: (a, b, prop) =>
44883
- mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
44488
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
44884
44489
  };
44885
44490
 
44886
- utils$1.forEach(
44887
- Object.keys({ ...config1, ...config2 }),
44888
- function computeConfigValue(prop) {
44889
- if (
44890
- prop === "__proto__" ||
44891
- prop === "constructor" ||
44892
- prop === "prototype"
44893
- )
44894
- return;
44895
- const merge = utils$1.hasOwnProp(mergeMap, prop)
44896
- ? mergeMap[prop]
44897
- : mergeDeepProperties;
44898
- const configValue = merge(config1[prop], config2[prop], prop);
44899
- (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) ||
44900
- (config[prop] = configValue);
44901
- },
44902
- );
44491
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
44492
+ const merge = mergeMap[prop] || mergeDeepProperties;
44493
+ const configValue = merge(config1[prop], config2[prop], prop);
44494
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
44495
+ });
44903
44496
 
44904
44497
  return config;
44905
44498
  }
@@ -44907,11 +44500,11 @@ function mergeConfig(config1, config2) {
44907
44500
  var resolveConfig = (config) => {
44908
44501
  const newConfig = mergeConfig({}, config);
44909
44502
 
44910
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
44503
+ let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
44911
44504
 
44912
44505
  newConfig.headers = headers = AxiosHeaders$1.from(headers);
44913
44506
 
44914
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
44507
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
44915
44508
 
44916
44509
  // HTTP basic authentication
44917
44510
  if (auth) {
@@ -44920,21 +44513,17 @@ var resolveConfig = (config) => {
44920
44513
  );
44921
44514
  }
44922
44515
 
44516
+ let contentType;
44517
+
44923
44518
  if (utils$1.isFormData(data)) {
44924
44519
  if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
44925
- headers.setContentType(undefined); // browser handles it
44926
- } else if (utils$1.isFunction(data.getHeaders)) {
44927
- // Node.js FormData (like form-data package)
44928
- const formHeaders = data.getHeaders();
44929
- // Only set safe headers to avoid overwriting security headers
44930
- const allowedHeaders = ['content-type', 'content-length'];
44931
- Object.entries(formHeaders).forEach(([key, val]) => {
44932
- if (allowedHeaders.includes(key.toLowerCase())) {
44933
- headers.set(key, val);
44934
- }
44935
- });
44520
+ headers.setContentType(undefined); // Let the browser set it
44521
+ } else if ((contentType = headers.getContentType()) !== false) {
44522
+ // fix semicolon duplication issue for ReactNative FormData implementation
44523
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
44524
+ headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
44936
44525
  }
44937
- }
44526
+ }
44938
44527
 
44939
44528
  // Add xsrf header
44940
44529
  // This is only done if running in a standard browser environment.
@@ -44963,18 +44552,16 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
44963
44552
  const _config = resolveConfig(config);
44964
44553
  let requestData = _config.data;
44965
44554
  const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
44966
- let {responseType, onUploadProgress, onDownloadProgress} = _config;
44555
+ let {responseType} = _config;
44967
44556
  let onCanceled;
44968
- let uploadThrottled, downloadThrottled;
44969
- let flushUpload, flushDownload;
44970
-
44971
44557
  function done() {
44972
- flushUpload && flushUpload(); // flush events
44973
- flushDownload && flushDownload(); // flush events
44974
-
44975
- _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
44558
+ if (_config.cancelToken) {
44559
+ _config.cancelToken.unsubscribe(onCanceled);
44560
+ }
44976
44561
 
44977
- _config.signal && _config.signal.removeEventListener('abort', onCanceled);
44562
+ if (_config.signal) {
44563
+ _config.signal.removeEventListener('abort', onCanceled);
44564
+ }
44978
44565
  }
44979
44566
 
44980
44567
  let request = new XMLHttpRequest();
@@ -45044,25 +44631,22 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45044
44631
  return;
45045
44632
  }
45046
44633
 
45047
- reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
44634
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, _config, request));
45048
44635
 
45049
44636
  // Clean up request
45050
44637
  request = null;
45051
44638
  };
45052
44639
 
45053
44640
  // Handle low level network errors
45054
- request.onerror = function handleError(event) {
45055
- // Browsers deliver a ProgressEvent in XHR onerror
45056
- // (message may be empty; when present, surface it)
45057
- // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
45058
- const msg = event && event.message ? event.message : 'Network Error';
45059
- const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
45060
- // attach the underlying event for consumers who want details
45061
- err.event = event || null;
45062
- reject(err);
45063
- request = null;
45064
- };
45065
-
44641
+ request.onerror = function handleError() {
44642
+ // Real errors are hidden from us by the browser
44643
+ // onerror should only fire if it's a network error
44644
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, _config, request));
44645
+
44646
+ // Clean up request
44647
+ request = null;
44648
+ };
44649
+
45066
44650
  // Handle timeout
45067
44651
  request.ontimeout = function handleTimeout() {
45068
44652
  let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
@@ -45070,10 +44654,10 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45070
44654
  if (_config.timeoutErrorMessage) {
45071
44655
  timeoutErrorMessage = _config.timeoutErrorMessage;
45072
44656
  }
45073
- reject(new AxiosError$1(
44657
+ reject(new AxiosError(
45074
44658
  timeoutErrorMessage,
45075
- transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
45076
- config,
44659
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
44660
+ _config,
45077
44661
  request));
45078
44662
 
45079
44663
  // Clean up request
@@ -45101,18 +44685,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45101
44685
  }
45102
44686
 
45103
44687
  // Handle progress if needed
45104
- if (onDownloadProgress) {
45105
- ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
45106
- request.addEventListener('progress', downloadThrottled);
44688
+ if (typeof _config.onDownloadProgress === 'function') {
44689
+ request.addEventListener('progress', progressEventReducer(_config.onDownloadProgress, true));
45107
44690
  }
45108
44691
 
45109
44692
  // Not all browsers support upload events
45110
- if (onUploadProgress && request.upload) {
45111
- ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
45112
-
45113
- request.upload.addEventListener('progress', uploadThrottled);
45114
-
45115
- request.upload.addEventListener('loadend', flushUpload);
44693
+ if (typeof _config.onUploadProgress === 'function' && request.upload) {
44694
+ request.upload.addEventListener('progress', progressEventReducer(_config.onUploadProgress));
45116
44695
  }
45117
44696
 
45118
44697
  if (_config.cancelToken || _config.signal) {
@@ -45122,7 +44701,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45122
44701
  if (!request) {
45123
44702
  return;
45124
44703
  }
45125
- reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
44704
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
45126
44705
  request.abort();
45127
44706
  request = null;
45128
44707
  };
@@ -45136,7 +44715,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45136
44715
  const protocol = parseProtocol(_config.url);
45137
44716
 
45138
44717
  if (protocol && platform.protocols.indexOf(protocol) === -1) {
45139
- reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
44718
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
45140
44719
  return;
45141
44720
  }
45142
44721
 
@@ -45147,46 +44726,45 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
45147
44726
  };
45148
44727
 
45149
44728
  const composeSignals = (signals, timeout) => {
45150
- const {length} = (signals = signals ? signals.filter(Boolean) : []);
44729
+ let controller = new AbortController();
45151
44730
 
45152
- if (timeout || length) {
45153
- let controller = new AbortController();
44731
+ let aborted;
45154
44732
 
45155
- let aborted;
44733
+ const onabort = function (cancel) {
44734
+ if (!aborted) {
44735
+ aborted = true;
44736
+ unsubscribe();
44737
+ const err = cancel instanceof Error ? cancel : this.reason;
44738
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
44739
+ }
44740
+ };
45156
44741
 
45157
- const onabort = function (reason) {
45158
- if (!aborted) {
45159
- aborted = true;
45160
- unsubscribe();
45161
- const err = reason instanceof Error ? reason : this.reason;
45162
- controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
45163
- }
45164
- };
44742
+ let timer = timeout && setTimeout(() => {
44743
+ onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
44744
+ }, timeout);
45165
44745
 
45166
- let timer = timeout && setTimeout(() => {
44746
+ const unsubscribe = () => {
44747
+ if (signals) {
44748
+ timer && clearTimeout(timer);
45167
44749
  timer = null;
45168
- onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
45169
- }, timeout);
45170
-
45171
- const unsubscribe = () => {
45172
- if (signals) {
45173
- timer && clearTimeout(timer);
45174
- timer = null;
45175
- signals.forEach(signal => {
45176
- signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
45177
- });
45178
- signals = null;
45179
- }
45180
- };
44750
+ signals.forEach(signal => {
44751
+ signal &&
44752
+ (signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
44753
+ });
44754
+ signals = null;
44755
+ }
44756
+ };
45181
44757
 
45182
- signals.forEach((signal) => signal.addEventListener('abort', onabort));
44758
+ signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
45183
44759
 
45184
- const {signal} = controller;
44760
+ const {signal} = controller;
45185
44761
 
45186
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
44762
+ signal.unsubscribe = unsubscribe;
45187
44763
 
45188
- return signal;
45189
- }
44764
+ return [signal, () => {
44765
+ timer && clearTimeout(timer);
44766
+ timer = null;
44767
+ }];
45190
44768
  };
45191
44769
 
45192
44770
  var composeSignals$1 = composeSignals;
@@ -45209,68 +44787,35 @@ const streamChunk = function* (chunk, chunkSize) {
45209
44787
  }
45210
44788
  };
45211
44789
 
45212
- const readBytes = async function* (iterable, chunkSize) {
45213
- for await (const chunk of readStream(iterable)) {
45214
- yield* streamChunk(chunk, chunkSize);
45215
- }
45216
- };
45217
-
45218
- const readStream = async function* (stream) {
45219
- if (stream[Symbol.asyncIterator]) {
45220
- yield* stream;
45221
- return;
45222
- }
45223
-
45224
- const reader = stream.getReader();
45225
- try {
45226
- for (;;) {
45227
- const {done, value} = await reader.read();
45228
- if (done) {
45229
- break;
45230
- }
45231
- yield value;
45232
- }
45233
- } finally {
45234
- await reader.cancel();
44790
+ const readBytes = async function* (iterable, chunkSize, encode) {
44791
+ for await (const chunk of iterable) {
44792
+ yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
45235
44793
  }
45236
44794
  };
45237
44795
 
45238
- const trackStream = (stream, chunkSize, onProgress, onFinish) => {
45239
- const iterator = readBytes(stream, chunkSize);
44796
+ const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
44797
+ const iterator = readBytes(stream, chunkSize, encode);
45240
44798
 
45241
44799
  let bytes = 0;
45242
- let done;
45243
- let _onFinish = (e) => {
45244
- if (!done) {
45245
- done = true;
45246
- onFinish && onFinish(e);
45247
- }
45248
- };
45249
44800
 
45250
44801
  return new ReadableStream({
45251
- async pull(controller) {
45252
- try {
45253
- const {done, value} = await iterator.next();
44802
+ type: 'bytes',
45254
44803
 
45255
- if (done) {
45256
- _onFinish();
45257
- controller.close();
45258
- return;
45259
- }
44804
+ async pull(controller) {
44805
+ const {done, value} = await iterator.next();
45260
44806
 
45261
- let len = value.byteLength;
45262
- if (onProgress) {
45263
- let loadedBytes = bytes += len;
45264
- onProgress(loadedBytes);
45265
- }
45266
- controller.enqueue(new Uint8Array(value));
45267
- } catch (err) {
45268
- _onFinish(err);
45269
- throw err;
44807
+ if (done) {
44808
+ controller.close();
44809
+ onFinish();
44810
+ return;
45270
44811
  }
44812
+
44813
+ let len = value.byteLength;
44814
+ onProgress && onProgress(bytes += len);
44815
+ controller.enqueue(new Uint8Array(value));
45271
44816
  },
45272
44817
  cancel(reason) {
45273
- _onFinish(reason);
44818
+ onFinish(reason);
45274
44819
  return iterator.return();
45275
44820
  }
45276
44821
  }, {
@@ -45278,401 +44823,293 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
45278
44823
  })
45279
44824
  };
45280
44825
 
45281
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
44826
+ const fetchProgressDecorator = (total, fn) => {
44827
+ const lengthComputable = total != null;
44828
+ return (loaded) => setTimeout(() => fn({
44829
+ lengthComputable,
44830
+ total,
44831
+ loaded
44832
+ }));
44833
+ };
44834
+
44835
+ const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
44836
+ const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
44837
+
44838
+ // used only inside the fetch adapter
44839
+ const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
44840
+ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
44841
+ async (str) => new Uint8Array(await new Response(str).arrayBuffer())
44842
+ );
45282
44843
 
45283
- const {isFunction} = utils$1;
44844
+ const supportsRequestStream = isReadableStreamSupported && (() => {
44845
+ let duplexAccessed = false;
45284
44846
 
45285
- const globalFetchAPI = (({Request, Response}) => ({
45286
- Request, Response
45287
- }))(utils$1.global);
44847
+ const hasContentType = new Request(platform.origin, {
44848
+ body: new ReadableStream(),
44849
+ method: 'POST',
44850
+ get duplex() {
44851
+ duplexAccessed = true;
44852
+ return 'half';
44853
+ },
44854
+ }).headers.has('Content-Type');
45288
44855
 
45289
- const {
45290
- ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1
45291
- } = utils$1.global;
44856
+ return duplexAccessed && !hasContentType;
44857
+ })();
45292
44858
 
44859
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
45293
44860
 
45294
- const test = (fn, ...args) => {
44861
+ const supportsResponseStream = isReadableStreamSupported && !!(()=> {
45295
44862
  try {
45296
- return !!fn(...args);
45297
- } catch (e) {
45298
- return false
44863
+ return utils$1.isReadableStream(new Response('').body);
44864
+ } catch(err) {
44865
+ // return undefined
45299
44866
  }
45300
- };
44867
+ })();
45301
44868
 
45302
- const factory = (env) => {
45303
- env = utils$1.merge.call({
45304
- skipUndefined: true
45305
- }, globalFetchAPI, env);
44869
+ const resolvers = {
44870
+ stream: supportsResponseStream && ((res) => res.body)
44871
+ };
45306
44872
 
45307
- const {fetch: envFetch, Request, Response} = env;
45308
- const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
45309
- const isRequestSupported = isFunction(Request);
45310
- const isResponseSupported = isFunction(Response);
44873
+ isFetchSupported && (((res) => {
44874
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
44875
+ !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
44876
+ (_, config) => {
44877
+ throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
44878
+ });
44879
+ });
44880
+ })(new Response));
45311
44881
 
45312
- if (!isFetchSupported) {
45313
- return false;
44882
+ const getBodyLength = async (body) => {
44883
+ if (body == null) {
44884
+ return 0;
45314
44885
  }
45315
44886
 
45316
- const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
45317
-
45318
- const encodeText = isFetchSupported && (typeof TextEncoder$1 === 'function' ?
45319
- ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) :
45320
- async (str) => new Uint8Array(await new Request(str).arrayBuffer())
45321
- );
45322
-
45323
- const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
45324
- let duplexAccessed = false;
44887
+ if(utils$1.isBlob(body)) {
44888
+ return body.size;
44889
+ }
45325
44890
 
45326
- const hasContentType = new Request(platform.origin, {
45327
- body: new ReadableStream$1(),
45328
- method: 'POST',
45329
- get duplex() {
45330
- duplexAccessed = true;
45331
- return 'half';
45332
- },
45333
- }).headers.has('Content-Type');
44891
+ if(utils$1.isSpecCompliantForm(body)) {
44892
+ return (await new Request(body).arrayBuffer()).byteLength;
44893
+ }
45334
44894
 
45335
- return duplexAccessed && !hasContentType;
45336
- });
44895
+ if(utils$1.isArrayBufferView(body)) {
44896
+ return body.byteLength;
44897
+ }
45337
44898
 
45338
- const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
45339
- test(() => utils$1.isReadableStream(new Response('').body));
44899
+ if(utils$1.isURLSearchParams(body)) {
44900
+ body = body + '';
44901
+ }
45340
44902
 
45341
- const resolvers = {
45342
- stream: supportsResponseStream && ((res) => res.body)
45343
- };
44903
+ if(utils$1.isString(body)) {
44904
+ return (await encodeText(body)).byteLength;
44905
+ }
44906
+ };
45344
44907
 
45345
- isFetchSupported && ((() => {
45346
- ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
45347
- !resolvers[type] && (resolvers[type] = (res, config) => {
45348
- let method = res && res[type];
44908
+ const resolveBodyLength = async (headers, body) => {
44909
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
45349
44910
 
45350
- if (method) {
45351
- return method.call(res);
45352
- }
44911
+ return length == null ? getBodyLength(body) : length;
44912
+ };
45353
44913
 
45354
- throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
45355
- });
44914
+ var fetchAdapter = isFetchSupported && (async (config) => {
44915
+ let {
44916
+ url,
44917
+ method,
44918
+ data,
44919
+ signal,
44920
+ cancelToken,
44921
+ timeout,
44922
+ onDownloadProgress,
44923
+ onUploadProgress,
44924
+ responseType,
44925
+ headers,
44926
+ withCredentials = 'same-origin',
44927
+ fetchOptions
44928
+ } = resolveConfig(config);
44929
+
44930
+ responseType = responseType ? (responseType + '').toLowerCase() : 'text';
44931
+
44932
+ let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
44933
+ composeSignals$1([signal, cancelToken], timeout) : [];
44934
+
44935
+ let finished, request;
44936
+
44937
+ const onFinish = () => {
44938
+ !finished && setTimeout(() => {
44939
+ composedSignal && composedSignal.unsubscribe();
45356
44940
  });
45357
- })());
45358
44941
 
45359
- const getBodyLength = async (body) => {
45360
- if (body == null) {
45361
- return 0;
45362
- }
44942
+ finished = true;
44943
+ };
45363
44944
 
45364
- if (utils$1.isBlob(body)) {
45365
- return body.size;
45366
- }
44945
+ let requestContentLength;
45367
44946
 
45368
- if (utils$1.isSpecCompliantForm(body)) {
45369
- const _request = new Request(platform.origin, {
44947
+ try {
44948
+ if (
44949
+ onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
44950
+ (requestContentLength = await resolveBodyLength(headers, data)) !== 0
44951
+ ) {
44952
+ let _request = new Request(url, {
45370
44953
  method: 'POST',
45371
- body,
44954
+ body: data,
44955
+ duplex: "half"
45372
44956
  });
45373
- return (await _request.arrayBuffer()).byteLength;
45374
- }
45375
-
45376
- if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
45377
- return body.byteLength;
45378
- }
45379
-
45380
- if (utils$1.isURLSearchParams(body)) {
45381
- body = body + '';
45382
- }
45383
-
45384
- if (utils$1.isString(body)) {
45385
- return (await encodeText(body)).byteLength;
45386
- }
45387
- };
45388
-
45389
- const resolveBodyLength = async (headers, body) => {
45390
- const length = utils$1.toFiniteNumber(headers.getContentLength());
45391
-
45392
- return length == null ? getBodyLength(body) : length;
45393
- };
45394
-
45395
- return async (config) => {
45396
- let {
45397
- url,
45398
- method,
45399
- data,
45400
- signal,
45401
- cancelToken,
45402
- timeout,
45403
- onDownloadProgress,
45404
- onUploadProgress,
45405
- responseType,
45406
- headers,
45407
- withCredentials = 'same-origin',
45408
- fetchOptions
45409
- } = resolveConfig(config);
45410
-
45411
- let _fetch = envFetch || fetch;
45412
-
45413
- responseType = responseType ? (responseType + '').toLowerCase() : 'text';
45414
-
45415
- let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
45416
-
45417
- let request = null;
45418
44957
 
45419
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
45420
- composedSignal.unsubscribe();
45421
- });
45422
-
45423
- let requestContentLength;
45424
-
45425
- try {
45426
- if (
45427
- onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
45428
- (requestContentLength = await resolveBodyLength(headers, data)) !== 0
45429
- ) {
45430
- let _request = new Request(url, {
45431
- method: 'POST',
45432
- body: data,
45433
- duplex: "half"
45434
- });
45435
-
45436
- let contentTypeHeader;
44958
+ let contentTypeHeader;
45437
44959
 
45438
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
45439
- headers.setContentType(contentTypeHeader);
45440
- }
45441
-
45442
- if (_request.body) {
45443
- const [onProgress, flush] = progressEventDecorator(
45444
- requestContentLength,
45445
- progressEventReducer(asyncDecorator(onUploadProgress))
45446
- );
45447
-
45448
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
45449
- }
44960
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
44961
+ headers.setContentType(contentTypeHeader);
45450
44962
  }
45451
44963
 
45452
- if (!utils$1.isString(withCredentials)) {
45453
- withCredentials = withCredentials ? 'include' : 'omit';
44964
+ if (_request.body) {
44965
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, fetchProgressDecorator(
44966
+ requestContentLength,
44967
+ progressEventReducer(onUploadProgress)
44968
+ ), null, encodeText);
45454
44969
  }
44970
+ }
45455
44971
 
45456
- // Cloudflare Workers throws when credentials are defined
45457
- // see https://github.com/cloudflare/workerd/issues/902
45458
- const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
45459
-
45460
- const resolvedOptions = {
45461
- ...fetchOptions,
45462
- signal: composedSignal,
45463
- method: method.toUpperCase(),
45464
- headers: headers.normalize().toJSON(),
45465
- body: data,
45466
- duplex: "half",
45467
- credentials: isCredentialsSupported ? withCredentials : undefined
45468
- };
44972
+ if (!utils$1.isString(withCredentials)) {
44973
+ withCredentials = withCredentials ? 'cors' : 'omit';
44974
+ }
45469
44975
 
45470
- request = isRequestSupported && new Request(url, resolvedOptions);
44976
+ request = new Request(url, {
44977
+ ...fetchOptions,
44978
+ signal: composedSignal,
44979
+ method: method.toUpperCase(),
44980
+ headers: headers.normalize().toJSON(),
44981
+ body: data,
44982
+ duplex: "half",
44983
+ withCredentials
44984
+ });
45471
44985
 
45472
- let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
44986
+ let response = await fetch(request);
45473
44987
 
45474
- const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
44988
+ const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
45475
44989
 
45476
- if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
45477
- const options = {};
44990
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
44991
+ const options = {};
45478
44992
 
45479
- ['status', 'statusText', 'headers'].forEach(prop => {
45480
- options[prop] = response[prop];
45481
- });
44993
+ ['status', 'statusText', 'headers'].forEach(prop => {
44994
+ options[prop] = response[prop];
44995
+ });
45482
44996
 
45483
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
44997
+ const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
45484
44998
 
45485
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
44999
+ response = new Response(
45000
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onDownloadProgress && fetchProgressDecorator(
45486
45001
  responseContentLength,
45487
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
45488
- ) || [];
45489
-
45490
- response = new Response(
45491
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
45492
- flush && flush();
45493
- unsubscribe && unsubscribe();
45494
- }),
45495
- options
45496
- );
45497
- }
45002
+ progressEventReducer(onDownloadProgress, true)
45003
+ ), isStreamResponse && onFinish, encodeText),
45004
+ options
45005
+ );
45006
+ }
45498
45007
 
45499
- responseType = responseType || 'text';
45008
+ responseType = responseType || 'text';
45500
45009
 
45501
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
45010
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
45502
45011
 
45503
- !isStreamResponse && unsubscribe && unsubscribe();
45012
+ !isStreamResponse && onFinish();
45504
45013
 
45505
- return await new Promise((resolve, reject) => {
45506
- settle(resolve, reject, {
45507
- data: responseData,
45508
- headers: AxiosHeaders$1.from(response.headers),
45509
- status: response.status,
45510
- statusText: response.statusText,
45511
- config,
45512
- request
45513
- });
45514
- })
45515
- } catch (err) {
45516
- unsubscribe && unsubscribe();
45014
+ stopTimeout && stopTimeout();
45517
45015
 
45518
- if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
45519
- throw Object.assign(
45520
- new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request, err && err.response),
45521
- {
45522
- cause: err.cause || err
45523
- }
45524
- )
45525
- }
45016
+ return await new Promise((resolve, reject) => {
45017
+ settle(resolve, reject, {
45018
+ data: responseData,
45019
+ headers: AxiosHeaders$1.from(response.headers),
45020
+ status: response.status,
45021
+ statusText: response.statusText,
45022
+ config,
45023
+ request
45024
+ });
45025
+ })
45026
+ } catch (err) {
45027
+ onFinish();
45526
45028
 
45527
- throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
45029
+ if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
45030
+ throw Object.assign(
45031
+ new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
45032
+ {
45033
+ cause: err.cause || err
45034
+ }
45035
+ )
45528
45036
  }
45529
- }
45530
- };
45531
-
45532
- const seedCache = new Map();
45533
-
45534
- const getFetch = (config) => {
45535
- let env = (config && config.env) || {};
45536
- const {fetch, Request, Response} = env;
45537
- const seeds = [
45538
- Request, Response, fetch
45539
- ];
45540
-
45541
- let len = seeds.length, i = len,
45542
- seed, target, map = seedCache;
45543
-
45544
- while (i--) {
45545
- seed = seeds[i];
45546
- target = map.get(seed);
45547
45037
 
45548
- target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
45549
-
45550
- map = target;
45038
+ throw AxiosError.from(err, err && err.code, config, request);
45551
45039
  }
45040
+ });
45552
45041
 
45553
- return target;
45554
- };
45555
-
45556
- getFetch();
45557
-
45558
- /**
45559
- * Known adapters mapping.
45560
- * Provides environment-specific adapters for Axios:
45561
- * - `http` for Node.js
45562
- * - `xhr` for browsers
45563
- * - `fetch` for fetch API-based requests
45564
- *
45565
- * @type {Object<string, Function|Object>}
45566
- */
45567
45042
  const knownAdapters = {
45568
45043
  http: httpAdapter,
45569
45044
  xhr: xhrAdapter,
45570
- fetch: {
45571
- get: getFetch,
45572
- }
45045
+ fetch: fetchAdapter
45573
45046
  };
45574
45047
 
45575
- // Assign adapter names for easier debugging and identification
45576
45048
  utils$1.forEach(knownAdapters, (fn, value) => {
45577
45049
  if (fn) {
45578
45050
  try {
45579
- Object.defineProperty(fn, 'name', { value });
45051
+ Object.defineProperty(fn, 'name', {value});
45580
45052
  } catch (e) {
45581
45053
  // eslint-disable-next-line no-empty
45582
45054
  }
45583
- Object.defineProperty(fn, 'adapterName', { value });
45055
+ Object.defineProperty(fn, 'adapterName', {value});
45584
45056
  }
45585
45057
  });
45586
45058
 
45587
- /**
45588
- * Render a rejection reason string for unknown or unsupported adapters
45589
- *
45590
- * @param {string} reason
45591
- * @returns {string}
45592
- */
45593
45059
  const renderReason = (reason) => `- ${reason}`;
45594
45060
 
45595
- /**
45596
- * Check if the adapter is resolved (function, null, or false)
45597
- *
45598
- * @param {Function|null|false} adapter
45599
- * @returns {boolean}
45600
- */
45601
45061
  const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
45602
45062
 
45603
- /**
45604
- * Get the first suitable adapter from the provided list.
45605
- * Tries each adapter in order until a supported one is found.
45606
- * Throws an AxiosError if no adapter is suitable.
45607
- *
45608
- * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
45609
- * @param {Object} config - Axios request configuration
45610
- * @throws {AxiosError} If no suitable adapter is available
45611
- * @returns {Function} The resolved adapter function
45612
- */
45613
- function getAdapter(adapters, config) {
45614
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
45063
+ var adapters = {
45064
+ getAdapter: (adapters) => {
45065
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
45615
45066
 
45616
- const { length } = adapters;
45617
- let nameOrAdapter;
45618
- let adapter;
45067
+ const {length} = adapters;
45068
+ let nameOrAdapter;
45069
+ let adapter;
45619
45070
 
45620
- const rejectedReasons = {};
45071
+ const rejectedReasons = {};
45621
45072
 
45622
- for (let i = 0; i < length; i++) {
45623
- nameOrAdapter = adapters[i];
45624
- let id;
45073
+ for (let i = 0; i < length; i++) {
45074
+ nameOrAdapter = adapters[i];
45075
+ let id;
45625
45076
 
45626
- adapter = nameOrAdapter;
45077
+ adapter = nameOrAdapter;
45627
45078
 
45628
- if (!isResolvedHandle(nameOrAdapter)) {
45629
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
45079
+ if (!isResolvedHandle(nameOrAdapter)) {
45080
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
45630
45081
 
45631
- if (adapter === undefined) {
45632
- throw new AxiosError$1(`Unknown adapter '${id}'`);
45082
+ if (adapter === undefined) {
45083
+ throw new AxiosError(`Unknown adapter '${id}'`);
45084
+ }
45633
45085
  }
45634
- }
45635
-
45636
- if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
45637
- break;
45638
- }
45639
45086
 
45640
- rejectedReasons[id || '#' + i] = adapter;
45641
- }
45087
+ if (adapter) {
45088
+ break;
45089
+ }
45642
45090
 
45643
- if (!adapter) {
45644
- const reasons = Object.entries(rejectedReasons)
45645
- .map(([id, state]) => `adapter ${id} ` +
45646
- (state === false ? 'is not supported by the environment' : 'is not available in the build')
45647
- );
45091
+ rejectedReasons[id || '#' + i] = adapter;
45092
+ }
45648
45093
 
45649
- let s = length ?
45650
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
45651
- 'as no adapter specified';
45094
+ if (!adapter) {
45652
45095
 
45653
- throw new AxiosError$1(
45654
- `There is no suitable adapter to dispatch the request ` + s,
45655
- 'ERR_NOT_SUPPORT'
45656
- );
45657
- }
45096
+ const reasons = Object.entries(rejectedReasons)
45097
+ .map(([id, state]) => `adapter ${id} ` +
45098
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
45099
+ );
45658
45100
 
45659
- return adapter;
45660
- }
45101
+ let s = length ?
45102
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
45103
+ 'as no adapter specified';
45661
45104
 
45662
- /**
45663
- * Exports Axios adapters and utility to resolve an adapter
45664
- */
45665
- var adapters = {
45666
- /**
45667
- * Resolve an adapter from a list of adapter names or functions.
45668
- * @type {Function}
45669
- */
45670
- getAdapter,
45105
+ throw new AxiosError(
45106
+ `There is no suitable adapter to dispatch the request ` + s,
45107
+ 'ERR_NOT_SUPPORT'
45108
+ );
45109
+ }
45671
45110
 
45672
- /**
45673
- * Exposes all known adapters
45674
- * @type {Object<string, Function|Object>}
45675
- */
45111
+ return adapter;
45112
+ },
45676
45113
  adapters: knownAdapters
45677
45114
  };
45678
45115
 
@@ -45689,7 +45126,7 @@ function throwIfCancellationRequested(config) {
45689
45126
  }
45690
45127
 
45691
45128
  if (config.signal && config.signal.aborted) {
45692
- throw new CanceledError$1(null, config);
45129
+ throw new CanceledError(null, config);
45693
45130
  }
45694
45131
  }
45695
45132
 
@@ -45715,7 +45152,7 @@ function dispatchRequest(config) {
45715
45152
  config.headers.setContentType('application/x-www-form-urlencoded', false);
45716
45153
  }
45717
45154
 
45718
- const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
45155
+ const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
45719
45156
 
45720
45157
  return adapter(config).then(function onAdapterResolution(response) {
45721
45158
  throwIfCancellationRequested(config);
@@ -45777,9 +45214,9 @@ validators$1.transitional = function transitional(validator, version, message) {
45777
45214
  // eslint-disable-next-line func-names
45778
45215
  return (value, opt, opts) => {
45779
45216
  if (validator === false) {
45780
- throw new AxiosError$1(
45217
+ throw new AxiosError(
45781
45218
  formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
45782
- AxiosError$1.ERR_DEPRECATED
45219
+ AxiosError.ERR_DEPRECATED
45783
45220
  );
45784
45221
  }
45785
45222
 
@@ -45798,14 +45235,6 @@ validators$1.transitional = function transitional(validator, version, message) {
45798
45235
  };
45799
45236
  };
45800
45237
 
45801
- validators$1.spelling = function spelling(correctSpelling) {
45802
- return (value, opt) => {
45803
- // eslint-disable-next-line no-console
45804
- console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
45805
- return true;
45806
- }
45807
- };
45808
-
45809
45238
  /**
45810
45239
  * Assert object's properties type
45811
45240
  *
@@ -45818,7 +45247,7 @@ validators$1.spelling = function spelling(correctSpelling) {
45818
45247
 
45819
45248
  function assertOptions(options, schema, allowUnknown) {
45820
45249
  if (typeof options !== 'object') {
45821
- throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
45250
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
45822
45251
  }
45823
45252
  const keys = Object.keys(options);
45824
45253
  let i = keys.length;
@@ -45829,12 +45258,12 @@ function assertOptions(options, schema, allowUnknown) {
45829
45258
  const value = options[opt];
45830
45259
  const result = value === undefined || validator(value, opt, options);
45831
45260
  if (result !== true) {
45832
- throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
45261
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
45833
45262
  }
45834
45263
  continue;
45835
45264
  }
45836
45265
  if (allowUnknown !== true) {
45837
- throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
45266
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
45838
45267
  }
45839
45268
  }
45840
45269
  }
@@ -45855,7 +45284,7 @@ const validators = validator.validators;
45855
45284
  */
45856
45285
  class Axios {
45857
45286
  constructor(instanceConfig) {
45858
- this.defaults = instanceConfig || {};
45287
+ this.defaults = instanceConfig;
45859
45288
  this.interceptors = {
45860
45289
  request: new InterceptorManager$1(),
45861
45290
  response: new InterceptorManager$1()
@@ -45875,9 +45304,9 @@ class Axios {
45875
45304
  return await this._request(configOrUrl, config);
45876
45305
  } catch (err) {
45877
45306
  if (err instanceof Error) {
45878
- let dummy = {};
45307
+ let dummy;
45879
45308
 
45880
- Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
45309
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
45881
45310
 
45882
45311
  // slice off the Error: ... line
45883
45312
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
@@ -45915,8 +45344,7 @@ class Axios {
45915
45344
  validator.assertOptions(transitional, {
45916
45345
  silentJSONParsing: validators.transitional(validators.boolean),
45917
45346
  forcedJSONParsing: validators.transitional(validators.boolean),
45918
- clarifyTimeoutError: validators.transitional(validators.boolean),
45919
- legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
45347
+ clarifyTimeoutError: validators.transitional(validators.boolean)
45920
45348
  }, false);
45921
45349
  }
45922
45350
 
@@ -45933,18 +45361,6 @@ class Axios {
45933
45361
  }
45934
45362
  }
45935
45363
 
45936
- // Set config.allowAbsoluteUrls
45937
- if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
45938
- config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
45939
- } else {
45940
- config.allowAbsoluteUrls = true;
45941
- }
45942
-
45943
- validator.assertOptions(config, {
45944
- baseUrl: validators.spelling('baseURL'),
45945
- withXsrfToken: validators.spelling('withXSRFToken')
45946
- }, true);
45947
-
45948
45364
  // Set config.method
45949
45365
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
45950
45366
 
@@ -45973,14 +45389,7 @@ class Axios {
45973
45389
 
45974
45390
  synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
45975
45391
 
45976
- const transitional = config.transitional || transitionalDefaults;
45977
- const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
45978
-
45979
- if (legacyInterceptorReqResOrdering) {
45980
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
45981
- } else {
45982
- requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
45983
- }
45392
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
45984
45393
  });
45985
45394
 
45986
45395
  const responseInterceptorChain = [];
@@ -45994,8 +45403,8 @@ class Axios {
45994
45403
 
45995
45404
  if (!synchronousRequestInterceptors) {
45996
45405
  const chain = [dispatchRequest.bind(this), undefined];
45997
- chain.unshift(...requestInterceptorChain);
45998
- chain.push(...responseInterceptorChain);
45406
+ chain.unshift.apply(chain, requestInterceptorChain);
45407
+ chain.push.apply(chain, responseInterceptorChain);
45999
45408
  len = chain.length;
46000
45409
 
46001
45410
  promise = Promise.resolve(config);
@@ -46011,6 +45420,8 @@ class Axios {
46011
45420
 
46012
45421
  let newConfig = config;
46013
45422
 
45423
+ i = 0;
45424
+
46014
45425
  while (i < len) {
46015
45426
  const onFulfilled = requestInterceptorChain[i++];
46016
45427
  const onRejected = requestInterceptorChain[i++];
@@ -46040,7 +45451,7 @@ class Axios {
46040
45451
 
46041
45452
  getUri(config) {
46042
45453
  config = mergeConfig(this.defaults, config);
46043
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
45454
+ const fullPath = buildFullPath(config.baseURL, config.url);
46044
45455
  return buildURL(fullPath, config.params, config.paramsSerializer);
46045
45456
  }
46046
45457
  }
@@ -46135,7 +45546,7 @@ class CancelToken {
46135
45546
  return;
46136
45547
  }
46137
45548
 
46138
- token.reason = new CanceledError$1(message, config, request);
45549
+ token.reason = new CanceledError(message, config, request);
46139
45550
  resolvePromise(token.reason);
46140
45551
  });
46141
45552
  }
@@ -46180,20 +45591,6 @@ class CancelToken {
46180
45591
  }
46181
45592
  }
46182
45593
 
46183
- toAbortSignal() {
46184
- const controller = new AbortController();
46185
-
46186
- const abort = (err) => {
46187
- controller.abort(err);
46188
- };
46189
-
46190
- this.subscribe(abort);
46191
-
46192
- controller.signal.unsubscribe = () => this.unsubscribe(abort);
46193
-
46194
- return controller.signal;
46195
- }
46196
-
46197
45594
  /**
46198
45595
  * Returns an object that contains a new `CancelToken` and a function that, when called,
46199
45596
  * cancels the `CancelToken`.
@@ -46219,7 +45616,7 @@ var CancelToken$1 = CancelToken;
46219
45616
  *
46220
45617
  * ```js
46221
45618
  * function f(x, y, z) {}
46222
- * const args = [1, 2, 3];
45619
+ * var args = [1, 2, 3];
46223
45620
  * f.apply(null, args);
46224
45621
  * ```
46225
45622
  *
@@ -46314,12 +45711,6 @@ const HttpStatusCode = {
46314
45711
  LoopDetected: 508,
46315
45712
  NotExtended: 510,
46316
45713
  NetworkAuthenticationRequired: 511,
46317
- WebServerIsDown: 521,
46318
- ConnectionTimedOut: 522,
46319
- OriginIsUnreachable: 523,
46320
- TimeoutOccurred: 524,
46321
- SslHandshakeFailed: 525,
46322
- InvalidSslCertificate: 526,
46323
45714
  };
46324
45715
 
46325
45716
  Object.entries(HttpStatusCode).forEach(([key, value]) => {
@@ -46360,14 +45751,14 @@ const axios = createInstance(defaults$1);
46360
45751
  axios.Axios = Axios$1;
46361
45752
 
46362
45753
  // Expose Cancel & CancelToken
46363
- axios.CanceledError = CanceledError$1;
45754
+ axios.CanceledError = CanceledError;
46364
45755
  axios.CancelToken = CancelToken$1;
46365
45756
  axios.isCancel = isCancel;
46366
45757
  axios.VERSION = VERSION;
46367
45758
  axios.toFormData = toFormData;
46368
45759
 
46369
45760
  // Expose AxiosError class
46370
- axios.AxiosError = AxiosError$1;
45761
+ axios.AxiosError = AxiosError;
46371
45762
 
46372
45763
  // alias for CanceledError for backward compatibility
46373
45764
  axios.Cancel = axios.CanceledError;
@@ -46646,7 +46037,8 @@ const initialState = {
46646
46037
  };
46647
46038
  const get_history = toolkit.createAsyncThunk(CHAT.ACTION_TYPES.GET_HISTORY, async (params, thunkAPI) => {
46648
46039
  try {
46649
- return await api.chatApi.getHistory(params);
46040
+ //return await api.chatApi.getHistory(params)
46041
+ return await [];
46650
46042
  }
46651
46043
  catch (error) {
46652
46044
  return thunkAPI.rejectWithValue({ error: error.response.data });
@@ -47210,7 +46602,6 @@ appChatSlice.actions;
47210
46602
  const useChat = () => {
47211
46603
  const dispatch = configureStore.useAppDispatch();
47212
46604
  const { active, checkInit, chatRoomId, userLogin, listContact, contactId, typeChat, loadChat, messageByGroup, listHistory, listChatType, archiveStore, checkScroll, listGeneralGroup, pinnedMessages, typingUsers } = configureStore.useAppSelector((state) => state.chat);
47213
- console.log('active', active);
47214
46605
  const getHistoryApi = (params) => {
47215
46606
  return dispatch(get_history(params));
47216
46607
  };