@helpdice/theme 1.0.9 → 1.1.0

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.
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var reactDom = require('react-dom');
7
+ var sdk = require('@helpdice/sdk');
7
8
 
8
9
  function _arrayLikeToArray(r, a) {
9
10
  (null == a || a > r.length) && (a = r.length);
@@ -154,8 +155,6 @@ var useHUIContext = function useHUIContext() {
154
155
  };
155
156
 
156
157
  var shadows = {
157
- button: "0 2px #0000000b",
158
- text: "0 -1px 0 rgb(0 0 0 / 12%)",
159
158
  drop: {
160
159
  z1: "0px 2px 8px rgba(0, 0, 0, 0.4)",
161
160
  z2: "rgba(149, 157, 165, 0.2) 0px 8px 24px",
@@ -409,11 +408,11 @@ var themes = {
409
408
  shadows: shadows
410
409
  };
411
410
 
412
- var isObject = function isObject(target) {
411
+ var isObject$1 = function isObject(target) {
413
412
  return target && _typeof(target) === 'object';
414
413
  };
415
414
  var _deepDuplicable = function deepDuplicable(source, target) {
416
- if (!isObject(target) || !isObject(source)) return source;
415
+ if (!isObject$1(target) || !isObject$1(source)) return source;
417
416
  var sourceKeys = Object.keys(source);
418
417
  var result = {};
419
418
  for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
@@ -422,7 +421,7 @@ var _deepDuplicable = function deepDuplicable(source, target) {
422
421
  var targetValue = target[key];
423
422
  if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
424
423
  result[key] = targetValue.concat(sourceValue);
425
- } else if (isObject(sourceValue) && isObject(targetValue)) {
424
+ } else if (isObject$1(sourceValue) && isObject$1(targetValue)) {
426
425
  result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
427
426
  } else if (targetValue) {
428
427
  result[key] = targetValue;
@@ -1466,6 +1465,3976 @@ var ToastContainer = function ToastContainer() {
1466
1465
  }, ".toasts.__jsx-style-dynamic-selector{position:fixed;width:auto;max-width:100%;right:".concat(theme.layout.gap, ";bottom:").concat(theme.layout.gap, ";z-index:2000;-webkit-transition:all 400ms ease;transition:all 400ms ease;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.top.__jsx-style-dynamic-selector{bottom:unset;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;top:").concat(theme.layout.gap, ";}.left.__jsx-style-dynamic-selector{right:unset;left:").concat(theme.layout.gap, ";}"))), portal);
1467
1466
  };
1468
1467
 
1468
+ /**
1469
+ * Create a bound version of a function with a specified `this` context
1470
+ *
1471
+ * @param {Function} fn - The function to bind
1472
+ * @param {*} thisArg - The value to be passed as the `this` parameter
1473
+ * @returns {Function} A new function that will call the original function with the specified `this` context
1474
+ */
1475
+ function bind(fn, thisArg) {
1476
+ return function wrap() {
1477
+ return fn.apply(thisArg, arguments);
1478
+ };
1479
+ }
1480
+
1481
+ // utils is a library of generic helper functions non-specific to axios
1482
+
1483
+ const {toString} = Object.prototype;
1484
+ const {getPrototypeOf} = Object;
1485
+ const {iterator, toStringTag} = Symbol;
1486
+
1487
+ const kindOf = (cache => thing => {
1488
+ const str = toString.call(thing);
1489
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
1490
+ })(Object.create(null));
1491
+
1492
+ const kindOfTest = (type) => {
1493
+ type = type.toLowerCase();
1494
+ return (thing) => kindOf(thing) === type
1495
+ };
1496
+
1497
+ const typeOfTest = type => thing => typeof thing === type;
1498
+
1499
+ /**
1500
+ * Determine if a value is an Array
1501
+ *
1502
+ * @param {Object} val The value to test
1503
+ *
1504
+ * @returns {boolean} True if value is an Array, otherwise false
1505
+ */
1506
+ const {isArray} = Array;
1507
+
1508
+ /**
1509
+ * Determine if a value is undefined
1510
+ *
1511
+ * @param {*} val The value to test
1512
+ *
1513
+ * @returns {boolean} True if the value is undefined, otherwise false
1514
+ */
1515
+ const isUndefined = typeOfTest('undefined');
1516
+
1517
+ /**
1518
+ * Determine if a value is a Buffer
1519
+ *
1520
+ * @param {*} val The value to test
1521
+ *
1522
+ * @returns {boolean} True if value is a Buffer, otherwise false
1523
+ */
1524
+ function isBuffer(val) {
1525
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
1526
+ && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
1527
+ }
1528
+
1529
+ /**
1530
+ * Determine if a value is an ArrayBuffer
1531
+ *
1532
+ * @param {*} val The value to test
1533
+ *
1534
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
1535
+ */
1536
+ const isArrayBuffer = kindOfTest('ArrayBuffer');
1537
+
1538
+
1539
+ /**
1540
+ * Determine if a value is a view on an ArrayBuffer
1541
+ *
1542
+ * @param {*} val The value to test
1543
+ *
1544
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
1545
+ */
1546
+ function isArrayBufferView(val) {
1547
+ let result;
1548
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
1549
+ result = ArrayBuffer.isView(val);
1550
+ } else {
1551
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
1552
+ }
1553
+ return result;
1554
+ }
1555
+
1556
+ /**
1557
+ * Determine if a value is a String
1558
+ *
1559
+ * @param {*} val The value to test
1560
+ *
1561
+ * @returns {boolean} True if value is a String, otherwise false
1562
+ */
1563
+ const isString = typeOfTest('string');
1564
+
1565
+ /**
1566
+ * Determine if a value is a Function
1567
+ *
1568
+ * @param {*} val The value to test
1569
+ * @returns {boolean} True if value is a Function, otherwise false
1570
+ */
1571
+ const isFunction$1 = typeOfTest('function');
1572
+
1573
+ /**
1574
+ * Determine if a value is a Number
1575
+ *
1576
+ * @param {*} val The value to test
1577
+ *
1578
+ * @returns {boolean} True if value is a Number, otherwise false
1579
+ */
1580
+ const isNumber = typeOfTest('number');
1581
+
1582
+ /**
1583
+ * Determine if a value is an Object
1584
+ *
1585
+ * @param {*} thing The value to test
1586
+ *
1587
+ * @returns {boolean} True if value is an Object, otherwise false
1588
+ */
1589
+ const isObject = (thing) => thing !== null && typeof thing === 'object';
1590
+
1591
+ /**
1592
+ * Determine if a value is a Boolean
1593
+ *
1594
+ * @param {*} thing The value to test
1595
+ * @returns {boolean} True if value is a Boolean, otherwise false
1596
+ */
1597
+ const isBoolean = thing => thing === true || thing === false;
1598
+
1599
+ /**
1600
+ * Determine if a value is a plain Object
1601
+ *
1602
+ * @param {*} val The value to test
1603
+ *
1604
+ * @returns {boolean} True if value is a plain Object, otherwise false
1605
+ */
1606
+ const isPlainObject = (val) => {
1607
+ if (kindOf(val) !== 'object') {
1608
+ return false;
1609
+ }
1610
+
1611
+ const prototype = getPrototypeOf(val);
1612
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
1613
+ };
1614
+
1615
+ /**
1616
+ * Determine if a value is an empty object (safely handles Buffers)
1617
+ *
1618
+ * @param {*} val The value to test
1619
+ *
1620
+ * @returns {boolean} True if value is an empty object, otherwise false
1621
+ */
1622
+ const isEmptyObject = (val) => {
1623
+ // Early return for non-objects or Buffers to prevent RangeError
1624
+ if (!isObject(val) || isBuffer(val)) {
1625
+ return false;
1626
+ }
1627
+
1628
+ try {
1629
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
1630
+ } catch (e) {
1631
+ // Fallback for any other objects that might cause RangeError with Object.keys()
1632
+ return false;
1633
+ }
1634
+ };
1635
+
1636
+ /**
1637
+ * Determine if a value is a Date
1638
+ *
1639
+ * @param {*} val The value to test
1640
+ *
1641
+ * @returns {boolean} True if value is a Date, otherwise false
1642
+ */
1643
+ const isDate = kindOfTest('Date');
1644
+
1645
+ /**
1646
+ * Determine if a value is a File
1647
+ *
1648
+ * @param {*} val The value to test
1649
+ *
1650
+ * @returns {boolean} True if value is a File, otherwise false
1651
+ */
1652
+ const isFile = kindOfTest('File');
1653
+
1654
+ /**
1655
+ * Determine if a value is a Blob
1656
+ *
1657
+ * @param {*} val The value to test
1658
+ *
1659
+ * @returns {boolean} True if value is a Blob, otherwise false
1660
+ */
1661
+ const isBlob = kindOfTest('Blob');
1662
+
1663
+ /**
1664
+ * Determine if a value is a FileList
1665
+ *
1666
+ * @param {*} val The value to test
1667
+ *
1668
+ * @returns {boolean} True if value is a File, otherwise false
1669
+ */
1670
+ const isFileList = kindOfTest('FileList');
1671
+
1672
+ /**
1673
+ * Determine if a value is a Stream
1674
+ *
1675
+ * @param {*} val The value to test
1676
+ *
1677
+ * @returns {boolean} True if value is a Stream, otherwise false
1678
+ */
1679
+ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
1680
+
1681
+ /**
1682
+ * Determine if a value is a FormData
1683
+ *
1684
+ * @param {*} thing The value to test
1685
+ *
1686
+ * @returns {boolean} True if value is an FormData, otherwise false
1687
+ */
1688
+ const isFormData = (thing) => {
1689
+ let kind;
1690
+ return thing && (
1691
+ (typeof FormData === 'function' && thing instanceof FormData) || (
1692
+ isFunction$1(thing.append) && (
1693
+ (kind = kindOf(thing)) === 'formdata' ||
1694
+ // detect form-data instance
1695
+ (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
1696
+ )
1697
+ )
1698
+ )
1699
+ };
1700
+
1701
+ /**
1702
+ * Determine if a value is a URLSearchParams object
1703
+ *
1704
+ * @param {*} val The value to test
1705
+ *
1706
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
1707
+ */
1708
+ const isURLSearchParams = kindOfTest('URLSearchParams');
1709
+
1710
+ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
1711
+
1712
+ /**
1713
+ * Trim excess whitespace off the beginning and end of a string
1714
+ *
1715
+ * @param {String} str The String to trim
1716
+ *
1717
+ * @returns {String} The String freed of excess whitespace
1718
+ */
1719
+ const trim = (str) => str.trim ?
1720
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
1721
+
1722
+ /**
1723
+ * Iterate over an Array or an Object invoking a function for each item.
1724
+ *
1725
+ * If `obj` is an Array callback will be called passing
1726
+ * the value, index, and complete array for each item.
1727
+ *
1728
+ * If 'obj' is an Object callback will be called passing
1729
+ * the value, key, and complete object for each property.
1730
+ *
1731
+ * @param {Object|Array} obj The object to iterate
1732
+ * @param {Function} fn The callback to invoke for each item
1733
+ *
1734
+ * @param {Boolean} [allOwnKeys = false]
1735
+ * @returns {any}
1736
+ */
1737
+ function forEach(obj, fn, {allOwnKeys = false} = {}) {
1738
+ // Don't bother if no value provided
1739
+ if (obj === null || typeof obj === 'undefined') {
1740
+ return;
1741
+ }
1742
+
1743
+ let i;
1744
+ let l;
1745
+
1746
+ // Force an array if not already something iterable
1747
+ if (typeof obj !== 'object') {
1748
+ /*eslint no-param-reassign:0*/
1749
+ obj = [obj];
1750
+ }
1751
+
1752
+ if (isArray(obj)) {
1753
+ // Iterate over array values
1754
+ for (i = 0, l = obj.length; i < l; i++) {
1755
+ fn.call(null, obj[i], i, obj);
1756
+ }
1757
+ } else {
1758
+ // Buffer check
1759
+ if (isBuffer(obj)) {
1760
+ return;
1761
+ }
1762
+
1763
+ // Iterate over object keys
1764
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
1765
+ const len = keys.length;
1766
+ let key;
1767
+
1768
+ for (i = 0; i < len; i++) {
1769
+ key = keys[i];
1770
+ fn.call(null, obj[key], key, obj);
1771
+ }
1772
+ }
1773
+ }
1774
+
1775
+ function findKey(obj, key) {
1776
+ if (isBuffer(obj)){
1777
+ return null;
1778
+ }
1779
+
1780
+ key = key.toLowerCase();
1781
+ const keys = Object.keys(obj);
1782
+ let i = keys.length;
1783
+ let _key;
1784
+ while (i-- > 0) {
1785
+ _key = keys[i];
1786
+ if (key === _key.toLowerCase()) {
1787
+ return _key;
1788
+ }
1789
+ }
1790
+ return null;
1791
+ }
1792
+
1793
+ const _global = (() => {
1794
+ /*eslint no-undef:0*/
1795
+ if (typeof globalThis !== "undefined") return globalThis;
1796
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
1797
+ })();
1798
+
1799
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
1800
+
1801
+ /**
1802
+ * Accepts varargs expecting each argument to be an object, then
1803
+ * immutably merges the properties of each object and returns result.
1804
+ *
1805
+ * When multiple objects contain the same key the later object in
1806
+ * the arguments list will take precedence.
1807
+ *
1808
+ * Example:
1809
+ *
1810
+ * ```js
1811
+ * var result = merge({foo: 123}, {foo: 456});
1812
+ * console.log(result.foo); // outputs 456
1813
+ * ```
1814
+ *
1815
+ * @param {Object} obj1 Object to merge
1816
+ *
1817
+ * @returns {Object} Result of all merge properties
1818
+ */
1819
+ function merge(/* obj1, obj2, obj3, ... */) {
1820
+ const {caseless, skipUndefined} = isContextDefined(this) && this || {};
1821
+ const result = {};
1822
+ const assignValue = (val, key) => {
1823
+ const targetKey = caseless && findKey(result, key) || key;
1824
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
1825
+ result[targetKey] = merge(result[targetKey], val);
1826
+ } else if (isPlainObject(val)) {
1827
+ result[targetKey] = merge({}, val);
1828
+ } else if (isArray(val)) {
1829
+ result[targetKey] = val.slice();
1830
+ } else if (!skipUndefined || !isUndefined(val)) {
1831
+ result[targetKey] = val;
1832
+ }
1833
+ };
1834
+
1835
+ for (let i = 0, l = arguments.length; i < l; i++) {
1836
+ arguments[i] && forEach(arguments[i], assignValue);
1837
+ }
1838
+ return result;
1839
+ }
1840
+
1841
+ /**
1842
+ * Extends object a by mutably adding to it the properties of object b.
1843
+ *
1844
+ * @param {Object} a The object to be extended
1845
+ * @param {Object} b The object to copy properties from
1846
+ * @param {Object} thisArg The object to bind function to
1847
+ *
1848
+ * @param {Boolean} [allOwnKeys]
1849
+ * @returns {Object} The resulting value of object a
1850
+ */
1851
+ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
1852
+ forEach(b, (val, key) => {
1853
+ if (thisArg && isFunction$1(val)) {
1854
+ a[key] = bind(val, thisArg);
1855
+ } else {
1856
+ a[key] = val;
1857
+ }
1858
+ }, {allOwnKeys});
1859
+ return a;
1860
+ };
1861
+
1862
+ /**
1863
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
1864
+ *
1865
+ * @param {string} content with BOM
1866
+ *
1867
+ * @returns {string} content value without BOM
1868
+ */
1869
+ const stripBOM = (content) => {
1870
+ if (content.charCodeAt(0) === 0xFEFF) {
1871
+ content = content.slice(1);
1872
+ }
1873
+ return content;
1874
+ };
1875
+
1876
+ /**
1877
+ * Inherit the prototype methods from one constructor into another
1878
+ * @param {function} constructor
1879
+ * @param {function} superConstructor
1880
+ * @param {object} [props]
1881
+ * @param {object} [descriptors]
1882
+ *
1883
+ * @returns {void}
1884
+ */
1885
+ const inherits = (constructor, superConstructor, props, descriptors) => {
1886
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
1887
+ constructor.prototype.constructor = constructor;
1888
+ Object.defineProperty(constructor, 'super', {
1889
+ value: superConstructor.prototype
1890
+ });
1891
+ props && Object.assign(constructor.prototype, props);
1892
+ };
1893
+
1894
+ /**
1895
+ * Resolve object with deep prototype chain to a flat object
1896
+ * @param {Object} sourceObj source object
1897
+ * @param {Object} [destObj]
1898
+ * @param {Function|Boolean} [filter]
1899
+ * @param {Function} [propFilter]
1900
+ *
1901
+ * @returns {Object}
1902
+ */
1903
+ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
1904
+ let props;
1905
+ let i;
1906
+ let prop;
1907
+ const merged = {};
1908
+
1909
+ destObj = destObj || {};
1910
+ // eslint-disable-next-line no-eq-null,eqeqeq
1911
+ if (sourceObj == null) return destObj;
1912
+
1913
+ do {
1914
+ props = Object.getOwnPropertyNames(sourceObj);
1915
+ i = props.length;
1916
+ while (i-- > 0) {
1917
+ prop = props[i];
1918
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
1919
+ destObj[prop] = sourceObj[prop];
1920
+ merged[prop] = true;
1921
+ }
1922
+ }
1923
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
1924
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
1925
+
1926
+ return destObj;
1927
+ };
1928
+
1929
+ /**
1930
+ * Determines whether a string ends with the characters of a specified string
1931
+ *
1932
+ * @param {String} str
1933
+ * @param {String} searchString
1934
+ * @param {Number} [position= 0]
1935
+ *
1936
+ * @returns {boolean}
1937
+ */
1938
+ const endsWith = (str, searchString, position) => {
1939
+ str = String(str);
1940
+ if (position === undefined || position > str.length) {
1941
+ position = str.length;
1942
+ }
1943
+ position -= searchString.length;
1944
+ const lastIndex = str.indexOf(searchString, position);
1945
+ return lastIndex !== -1 && lastIndex === position;
1946
+ };
1947
+
1948
+
1949
+ /**
1950
+ * Returns new array from array like object or null if failed
1951
+ *
1952
+ * @param {*} [thing]
1953
+ *
1954
+ * @returns {?Array}
1955
+ */
1956
+ const toArray = (thing) => {
1957
+ if (!thing) return null;
1958
+ if (isArray(thing)) return thing;
1959
+ let i = thing.length;
1960
+ if (!isNumber(i)) return null;
1961
+ const arr = new Array(i);
1962
+ while (i-- > 0) {
1963
+ arr[i] = thing[i];
1964
+ }
1965
+ return arr;
1966
+ };
1967
+
1968
+ /**
1969
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
1970
+ * thing passed in is an instance of Uint8Array
1971
+ *
1972
+ * @param {TypedArray}
1973
+ *
1974
+ * @returns {Array}
1975
+ */
1976
+ // eslint-disable-next-line func-names
1977
+ const isTypedArray = (TypedArray => {
1978
+ // eslint-disable-next-line func-names
1979
+ return thing => {
1980
+ return TypedArray && thing instanceof TypedArray;
1981
+ };
1982
+ })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
1983
+
1984
+ /**
1985
+ * For each entry in the object, call the function with the key and value.
1986
+ *
1987
+ * @param {Object<any, any>} obj - The object to iterate over.
1988
+ * @param {Function} fn - The function to call for each entry.
1989
+ *
1990
+ * @returns {void}
1991
+ */
1992
+ const forEachEntry = (obj, fn) => {
1993
+ const generator = obj && obj[iterator];
1994
+
1995
+ const _iterator = generator.call(obj);
1996
+
1997
+ let result;
1998
+
1999
+ while ((result = _iterator.next()) && !result.done) {
2000
+ const pair = result.value;
2001
+ fn.call(obj, pair[0], pair[1]);
2002
+ }
2003
+ };
2004
+
2005
+ /**
2006
+ * It takes a regular expression and a string, and returns an array of all the matches
2007
+ *
2008
+ * @param {string} regExp - The regular expression to match against.
2009
+ * @param {string} str - The string to search.
2010
+ *
2011
+ * @returns {Array<boolean>}
2012
+ */
2013
+ const matchAll = (regExp, str) => {
2014
+ let matches;
2015
+ const arr = [];
2016
+
2017
+ while ((matches = regExp.exec(str)) !== null) {
2018
+ arr.push(matches);
2019
+ }
2020
+
2021
+ return arr;
2022
+ };
2023
+
2024
+ /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
2025
+ const isHTMLForm = kindOfTest('HTMLFormElement');
2026
+
2027
+ const toCamelCase = str => {
2028
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
2029
+ function replacer(m, p1, p2) {
2030
+ return p1.toUpperCase() + p2;
2031
+ }
2032
+ );
2033
+ };
2034
+
2035
+ /* Creating a function that will check if an object has a property. */
2036
+ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
2037
+
2038
+ /**
2039
+ * Determine if a value is a RegExp object
2040
+ *
2041
+ * @param {*} val The value to test
2042
+ *
2043
+ * @returns {boolean} True if value is a RegExp object, otherwise false
2044
+ */
2045
+ const isRegExp = kindOfTest('RegExp');
2046
+
2047
+ const reduceDescriptors = (obj, reducer) => {
2048
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
2049
+ const reducedDescriptors = {};
2050
+
2051
+ forEach(descriptors, (descriptor, name) => {
2052
+ let ret;
2053
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
2054
+ reducedDescriptors[name] = ret || descriptor;
2055
+ }
2056
+ });
2057
+
2058
+ Object.defineProperties(obj, reducedDescriptors);
2059
+ };
2060
+
2061
+ /**
2062
+ * Makes all methods read-only
2063
+ * @param {Object} obj
2064
+ */
2065
+
2066
+ const freezeMethods = (obj) => {
2067
+ reduceDescriptors(obj, (descriptor, name) => {
2068
+ // skip restricted props in strict mode
2069
+ if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
2070
+ return false;
2071
+ }
2072
+
2073
+ const value = obj[name];
2074
+
2075
+ if (!isFunction$1(value)) return;
2076
+
2077
+ descriptor.enumerable = false;
2078
+
2079
+ if ('writable' in descriptor) {
2080
+ descriptor.writable = false;
2081
+ return;
2082
+ }
2083
+
2084
+ if (!descriptor.set) {
2085
+ descriptor.set = () => {
2086
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
2087
+ };
2088
+ }
2089
+ });
2090
+ };
2091
+
2092
+ const toObjectSet = (arrayOrString, delimiter) => {
2093
+ const obj = {};
2094
+
2095
+ const define = (arr) => {
2096
+ arr.forEach(value => {
2097
+ obj[value] = true;
2098
+ });
2099
+ };
2100
+
2101
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
2102
+
2103
+ return obj;
2104
+ };
2105
+
2106
+ const noop = () => {};
2107
+
2108
+ const toFiniteNumber = (value, defaultValue) => {
2109
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
2110
+ };
2111
+
2112
+
2113
+
2114
+ /**
2115
+ * If the thing is a FormData object, return true, otherwise return false.
2116
+ *
2117
+ * @param {unknown} thing - The thing to check.
2118
+ *
2119
+ * @returns {boolean}
2120
+ */
2121
+ function isSpecCompliantForm(thing) {
2122
+ return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
2123
+ }
2124
+
2125
+ const toJSONObject = (obj) => {
2126
+ const stack = new Array(10);
2127
+
2128
+ const visit = (source, i) => {
2129
+
2130
+ if (isObject(source)) {
2131
+ if (stack.indexOf(source) >= 0) {
2132
+ return;
2133
+ }
2134
+
2135
+ //Buffer check
2136
+ if (isBuffer(source)) {
2137
+ return source;
2138
+ }
2139
+
2140
+ if(!('toJSON' in source)) {
2141
+ stack[i] = source;
2142
+ const target = isArray(source) ? [] : {};
2143
+
2144
+ forEach(source, (value, key) => {
2145
+ const reducedValue = visit(value, i + 1);
2146
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
2147
+ });
2148
+
2149
+ stack[i] = undefined;
2150
+
2151
+ return target;
2152
+ }
2153
+ }
2154
+
2155
+ return source;
2156
+ };
2157
+
2158
+ return visit(obj, 0);
2159
+ };
2160
+
2161
+ const isAsyncFn = kindOfTest('AsyncFunction');
2162
+
2163
+ const isThenable = (thing) =>
2164
+ thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
2165
+
2166
+ // original code
2167
+ // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
2168
+
2169
+ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
2170
+ if (setImmediateSupported) {
2171
+ return setImmediate;
2172
+ }
2173
+
2174
+ return postMessageSupported ? ((token, callbacks) => {
2175
+ _global.addEventListener("message", ({source, data}) => {
2176
+ if (source === _global && data === token) {
2177
+ callbacks.length && callbacks.shift()();
2178
+ }
2179
+ }, false);
2180
+
2181
+ return (cb) => {
2182
+ callbacks.push(cb);
2183
+ _global.postMessage(token, "*");
2184
+ }
2185
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
2186
+ })(
2187
+ typeof setImmediate === 'function',
2188
+ isFunction$1(_global.postMessage)
2189
+ );
2190
+
2191
+ const asap = typeof queueMicrotask !== 'undefined' ?
2192
+ queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
2193
+
2194
+ // *********************
2195
+
2196
+
2197
+ const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
2198
+
2199
+
2200
+ var utils$1 = {
2201
+ isArray,
2202
+ isArrayBuffer,
2203
+ isBuffer,
2204
+ isFormData,
2205
+ isArrayBufferView,
2206
+ isString,
2207
+ isNumber,
2208
+ isBoolean,
2209
+ isObject,
2210
+ isPlainObject,
2211
+ isEmptyObject,
2212
+ isReadableStream,
2213
+ isRequest,
2214
+ isResponse,
2215
+ isHeaders,
2216
+ isUndefined,
2217
+ isDate,
2218
+ isFile,
2219
+ isBlob,
2220
+ isRegExp,
2221
+ isFunction: isFunction$1,
2222
+ isStream,
2223
+ isURLSearchParams,
2224
+ isTypedArray,
2225
+ isFileList,
2226
+ forEach,
2227
+ merge,
2228
+ extend,
2229
+ trim,
2230
+ stripBOM,
2231
+ inherits,
2232
+ toFlatObject,
2233
+ kindOf,
2234
+ kindOfTest,
2235
+ endsWith,
2236
+ toArray,
2237
+ forEachEntry,
2238
+ matchAll,
2239
+ isHTMLForm,
2240
+ hasOwnProperty,
2241
+ hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
2242
+ reduceDescriptors,
2243
+ freezeMethods,
2244
+ toObjectSet,
2245
+ toCamelCase,
2246
+ noop,
2247
+ toFiniteNumber,
2248
+ findKey,
2249
+ global: _global,
2250
+ isContextDefined,
2251
+ isSpecCompliantForm,
2252
+ toJSONObject,
2253
+ isAsyncFn,
2254
+ isThenable,
2255
+ setImmediate: _setImmediate,
2256
+ asap,
2257
+ isIterable
2258
+ };
2259
+
2260
+ /**
2261
+ * Create an Error with the specified message, config, error code, request and response.
2262
+ *
2263
+ * @param {string} message The error message.
2264
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
2265
+ * @param {Object} [config] The config.
2266
+ * @param {Object} [request] The request.
2267
+ * @param {Object} [response] The response.
2268
+ *
2269
+ * @returns {Error} The created error.
2270
+ */
2271
+ function AxiosError$1(message, code, config, request, response) {
2272
+ Error.call(this);
2273
+
2274
+ if (Error.captureStackTrace) {
2275
+ Error.captureStackTrace(this, this.constructor);
2276
+ } else {
2277
+ this.stack = (new Error()).stack;
2278
+ }
2279
+
2280
+ this.message = message;
2281
+ this.name = 'AxiosError';
2282
+ code && (this.code = code);
2283
+ config && (this.config = config);
2284
+ request && (this.request = request);
2285
+ if (response) {
2286
+ this.response = response;
2287
+ this.status = response.status ? response.status : null;
2288
+ }
2289
+ }
2290
+
2291
+ utils$1.inherits(AxiosError$1, Error, {
2292
+ toJSON: function toJSON() {
2293
+ return {
2294
+ // Standard
2295
+ message: this.message,
2296
+ name: this.name,
2297
+ // Microsoft
2298
+ description: this.description,
2299
+ number: this.number,
2300
+ // Mozilla
2301
+ fileName: this.fileName,
2302
+ lineNumber: this.lineNumber,
2303
+ columnNumber: this.columnNumber,
2304
+ stack: this.stack,
2305
+ // Axios
2306
+ config: utils$1.toJSONObject(this.config),
2307
+ code: this.code,
2308
+ status: this.status
2309
+ };
2310
+ }
2311
+ });
2312
+
2313
+ const prototype$1 = AxiosError$1.prototype;
2314
+ const descriptors = {};
2315
+
2316
+ [
2317
+ 'ERR_BAD_OPTION_VALUE',
2318
+ 'ERR_BAD_OPTION',
2319
+ 'ECONNABORTED',
2320
+ 'ETIMEDOUT',
2321
+ 'ERR_NETWORK',
2322
+ 'ERR_FR_TOO_MANY_REDIRECTS',
2323
+ 'ERR_DEPRECATED',
2324
+ 'ERR_BAD_RESPONSE',
2325
+ 'ERR_BAD_REQUEST',
2326
+ 'ERR_CANCELED',
2327
+ 'ERR_NOT_SUPPORT',
2328
+ 'ERR_INVALID_URL'
2329
+ // eslint-disable-next-line func-names
2330
+ ].forEach(code => {
2331
+ descriptors[code] = {value: code};
2332
+ });
2333
+
2334
+ Object.defineProperties(AxiosError$1, descriptors);
2335
+ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
2336
+
2337
+ // eslint-disable-next-line func-names
2338
+ AxiosError$1.from = (error, code, config, request, response, customProps) => {
2339
+ const axiosError = Object.create(prototype$1);
2340
+
2341
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
2342
+ return obj !== Error.prototype;
2343
+ }, prop => {
2344
+ return prop !== 'isAxiosError';
2345
+ });
2346
+
2347
+ const msg = error && error.message ? error.message : 'Error';
2348
+
2349
+ // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
2350
+ const errCode = code == null && error ? error.code : code;
2351
+ AxiosError$1.call(axiosError, msg, errCode, config, request, response);
2352
+
2353
+ // Chain the original error on the standard field; non-enumerable to avoid JSON noise
2354
+ if (error && axiosError.cause == null) {
2355
+ Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
2356
+ }
2357
+
2358
+ axiosError.name = (error && error.name) || 'Error';
2359
+
2360
+ customProps && Object.assign(axiosError, customProps);
2361
+
2362
+ return axiosError;
2363
+ };
2364
+
2365
+ // eslint-disable-next-line strict
2366
+ var httpAdapter = null;
2367
+
2368
+ /**
2369
+ * Determines if the given thing is a array or js object.
2370
+ *
2371
+ * @param {string} thing - The object or array to be visited.
2372
+ *
2373
+ * @returns {boolean}
2374
+ */
2375
+ function isVisitable(thing) {
2376
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
2377
+ }
2378
+
2379
+ /**
2380
+ * It removes the brackets from the end of a string
2381
+ *
2382
+ * @param {string} key - The key of the parameter.
2383
+ *
2384
+ * @returns {string} the key without the brackets.
2385
+ */
2386
+ function removeBrackets(key) {
2387
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
2388
+ }
2389
+
2390
+ /**
2391
+ * It takes a path, a key, and a boolean, and returns a string
2392
+ *
2393
+ * @param {string} path - The path to the current key.
2394
+ * @param {string} key - The key of the current object being iterated over.
2395
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
2396
+ *
2397
+ * @returns {string} The path to the current key.
2398
+ */
2399
+ function renderKey(path, key, dots) {
2400
+ if (!path) return key;
2401
+ return path.concat(key).map(function each(token, i) {
2402
+ // eslint-disable-next-line no-param-reassign
2403
+ token = removeBrackets(token);
2404
+ return !dots && i ? '[' + token + ']' : token;
2405
+ }).join(dots ? '.' : '');
2406
+ }
2407
+
2408
+ /**
2409
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
2410
+ *
2411
+ * @param {Array<any>} arr - The array to check
2412
+ *
2413
+ * @returns {boolean}
2414
+ */
2415
+ function isFlatArray(arr) {
2416
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
2417
+ }
2418
+
2419
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
2420
+ return /^is[A-Z]/.test(prop);
2421
+ });
2422
+
2423
+ /**
2424
+ * Convert a data object to FormData
2425
+ *
2426
+ * @param {Object} obj
2427
+ * @param {?Object} [formData]
2428
+ * @param {?Object} [options]
2429
+ * @param {Function} [options.visitor]
2430
+ * @param {Boolean} [options.metaTokens = true]
2431
+ * @param {Boolean} [options.dots = false]
2432
+ * @param {?Boolean} [options.indexes = false]
2433
+ *
2434
+ * @returns {Object}
2435
+ **/
2436
+
2437
+ /**
2438
+ * It converts an object into a FormData object
2439
+ *
2440
+ * @param {Object<any, any>} obj - The object to convert to form data.
2441
+ * @param {string} formData - The FormData object to append to.
2442
+ * @param {Object<string, any>} options
2443
+ *
2444
+ * @returns
2445
+ */
2446
+ function toFormData$1(obj, formData, options) {
2447
+ if (!utils$1.isObject(obj)) {
2448
+ throw new TypeError('target must be an object');
2449
+ }
2450
+
2451
+ // eslint-disable-next-line no-param-reassign
2452
+ formData = formData || new (FormData)();
2453
+
2454
+ // eslint-disable-next-line no-param-reassign
2455
+ options = utils$1.toFlatObject(options, {
2456
+ metaTokens: true,
2457
+ dots: false,
2458
+ indexes: false
2459
+ }, false, function defined(option, source) {
2460
+ // eslint-disable-next-line no-eq-null,eqeqeq
2461
+ return !utils$1.isUndefined(source[option]);
2462
+ });
2463
+
2464
+ const metaTokens = options.metaTokens;
2465
+ // eslint-disable-next-line no-use-before-define
2466
+ const visitor = options.visitor || defaultVisitor;
2467
+ const dots = options.dots;
2468
+ const indexes = options.indexes;
2469
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
2470
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
2471
+
2472
+ if (!utils$1.isFunction(visitor)) {
2473
+ throw new TypeError('visitor must be a function');
2474
+ }
2475
+
2476
+ function convertValue(value) {
2477
+ if (value === null) return '';
2478
+
2479
+ if (utils$1.isDate(value)) {
2480
+ return value.toISOString();
2481
+ }
2482
+
2483
+ if (utils$1.isBoolean(value)) {
2484
+ return value.toString();
2485
+ }
2486
+
2487
+ if (!useBlob && utils$1.isBlob(value)) {
2488
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
2489
+ }
2490
+
2491
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
2492
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
2493
+ }
2494
+
2495
+ return value;
2496
+ }
2497
+
2498
+ /**
2499
+ * Default visitor.
2500
+ *
2501
+ * @param {*} value
2502
+ * @param {String|Number} key
2503
+ * @param {Array<String|Number>} path
2504
+ * @this {FormData}
2505
+ *
2506
+ * @returns {boolean} return true to visit the each prop of the value recursively
2507
+ */
2508
+ function defaultVisitor(value, key, path) {
2509
+ let arr = value;
2510
+
2511
+ if (value && !path && typeof value === 'object') {
2512
+ if (utils$1.endsWith(key, '{}')) {
2513
+ // eslint-disable-next-line no-param-reassign
2514
+ key = metaTokens ? key : key.slice(0, -2);
2515
+ // eslint-disable-next-line no-param-reassign
2516
+ value = JSON.stringify(value);
2517
+ } else if (
2518
+ (utils$1.isArray(value) && isFlatArray(value)) ||
2519
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
2520
+ )) {
2521
+ // eslint-disable-next-line no-param-reassign
2522
+ key = removeBrackets(key);
2523
+
2524
+ arr.forEach(function each(el, index) {
2525
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
2526
+ // eslint-disable-next-line no-nested-ternary
2527
+ indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
2528
+ convertValue(el)
2529
+ );
2530
+ });
2531
+ return false;
2532
+ }
2533
+ }
2534
+
2535
+ if (isVisitable(value)) {
2536
+ return true;
2537
+ }
2538
+
2539
+ formData.append(renderKey(path, key, dots), convertValue(value));
2540
+
2541
+ return false;
2542
+ }
2543
+
2544
+ const stack = [];
2545
+
2546
+ const exposedHelpers = Object.assign(predicates, {
2547
+ defaultVisitor,
2548
+ convertValue,
2549
+ isVisitable
2550
+ });
2551
+
2552
+ function build(value, path) {
2553
+ if (utils$1.isUndefined(value)) return;
2554
+
2555
+ if (stack.indexOf(value) !== -1) {
2556
+ throw Error('Circular reference detected in ' + path.join('.'));
2557
+ }
2558
+
2559
+ stack.push(value);
2560
+
2561
+ utils$1.forEach(value, function each(el, key) {
2562
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
2563
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
2564
+ );
2565
+
2566
+ if (result === true) {
2567
+ build(el, path ? path.concat(key) : [key]);
2568
+ }
2569
+ });
2570
+
2571
+ stack.pop();
2572
+ }
2573
+
2574
+ if (!utils$1.isObject(obj)) {
2575
+ throw new TypeError('data must be an object');
2576
+ }
2577
+
2578
+ build(obj);
2579
+
2580
+ return formData;
2581
+ }
2582
+
2583
+ /**
2584
+ * It encodes a string by replacing all characters that are not in the unreserved set with
2585
+ * their percent-encoded equivalents
2586
+ *
2587
+ * @param {string} str - The string to encode.
2588
+ *
2589
+ * @returns {string} The encoded string.
2590
+ */
2591
+ function encode$1(str) {
2592
+ const charMap = {
2593
+ '!': '%21',
2594
+ "'": '%27',
2595
+ '(': '%28',
2596
+ ')': '%29',
2597
+ '~': '%7E',
2598
+ '%20': '+',
2599
+ '%00': '\x00'
2600
+ };
2601
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
2602
+ return charMap[match];
2603
+ });
2604
+ }
2605
+
2606
+ /**
2607
+ * It takes a params object and converts it to a FormData object
2608
+ *
2609
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
2610
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
2611
+ *
2612
+ * @returns {void}
2613
+ */
2614
+ function AxiosURLSearchParams(params, options) {
2615
+ this._pairs = [];
2616
+
2617
+ params && toFormData$1(params, this, options);
2618
+ }
2619
+
2620
+ const prototype = AxiosURLSearchParams.prototype;
2621
+
2622
+ prototype.append = function append(name, value) {
2623
+ this._pairs.push([name, value]);
2624
+ };
2625
+
2626
+ prototype.toString = function toString(encoder) {
2627
+ const _encode = encoder ? function(value) {
2628
+ return encoder.call(this, value, encode$1);
2629
+ } : encode$1;
2630
+
2631
+ return this._pairs.map(function each(pair) {
2632
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
2633
+ }, '').join('&');
2634
+ };
2635
+
2636
+ /**
2637
+ * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
2638
+ * URI encoded counterparts
2639
+ *
2640
+ * @param {string} val The value to be encoded.
2641
+ *
2642
+ * @returns {string} The encoded value.
2643
+ */
2644
+ function encode(val) {
2645
+ return encodeURIComponent(val).
2646
+ replace(/%3A/gi, ':').
2647
+ replace(/%24/g, '$').
2648
+ replace(/%2C/gi, ',').
2649
+ replace(/%20/g, '+');
2650
+ }
2651
+
2652
+ /**
2653
+ * Build a URL by appending params to the end
2654
+ *
2655
+ * @param {string} url The base of the url (e.g., http://www.google.com)
2656
+ * @param {object} [params] The params to be appended
2657
+ * @param {?(object|Function)} options
2658
+ *
2659
+ * @returns {string} The formatted url
2660
+ */
2661
+ function buildURL(url, params, options) {
2662
+ /*eslint no-param-reassign:0*/
2663
+ if (!params) {
2664
+ return url;
2665
+ }
2666
+
2667
+ const _encode = options && options.encode || encode;
2668
+
2669
+ if (utils$1.isFunction(options)) {
2670
+ options = {
2671
+ serialize: options
2672
+ };
2673
+ }
2674
+
2675
+ const serializeFn = options && options.serialize;
2676
+
2677
+ let serializedParams;
2678
+
2679
+ if (serializeFn) {
2680
+ serializedParams = serializeFn(params, options);
2681
+ } else {
2682
+ serializedParams = utils$1.isURLSearchParams(params) ?
2683
+ params.toString() :
2684
+ new AxiosURLSearchParams(params, options).toString(_encode);
2685
+ }
2686
+
2687
+ if (serializedParams) {
2688
+ const hashmarkIndex = url.indexOf("#");
2689
+
2690
+ if (hashmarkIndex !== -1) {
2691
+ url = url.slice(0, hashmarkIndex);
2692
+ }
2693
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
2694
+ }
2695
+
2696
+ return url;
2697
+ }
2698
+
2699
+ class InterceptorManager {
2700
+ constructor() {
2701
+ this.handlers = [];
2702
+ }
2703
+
2704
+ /**
2705
+ * Add a new interceptor to the stack
2706
+ *
2707
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
2708
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
2709
+ *
2710
+ * @return {Number} An ID used to remove interceptor later
2711
+ */
2712
+ use(fulfilled, rejected, options) {
2713
+ this.handlers.push({
2714
+ fulfilled,
2715
+ rejected,
2716
+ synchronous: options ? options.synchronous : false,
2717
+ runWhen: options ? options.runWhen : null
2718
+ });
2719
+ return this.handlers.length - 1;
2720
+ }
2721
+
2722
+ /**
2723
+ * Remove an interceptor from the stack
2724
+ *
2725
+ * @param {Number} id The ID that was returned by `use`
2726
+ *
2727
+ * @returns {void}
2728
+ */
2729
+ eject(id) {
2730
+ if (this.handlers[id]) {
2731
+ this.handlers[id] = null;
2732
+ }
2733
+ }
2734
+
2735
+ /**
2736
+ * Clear all interceptors from the stack
2737
+ *
2738
+ * @returns {void}
2739
+ */
2740
+ clear() {
2741
+ if (this.handlers) {
2742
+ this.handlers = [];
2743
+ }
2744
+ }
2745
+
2746
+ /**
2747
+ * Iterate over all the registered interceptors
2748
+ *
2749
+ * This method is particularly useful for skipping over any
2750
+ * interceptors that may have become `null` calling `eject`.
2751
+ *
2752
+ * @param {Function} fn The function to call for each interceptor
2753
+ *
2754
+ * @returns {void}
2755
+ */
2756
+ forEach(fn) {
2757
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
2758
+ if (h !== null) {
2759
+ fn(h);
2760
+ }
2761
+ });
2762
+ }
2763
+ }
2764
+
2765
+ var transitionalDefaults = {
2766
+ silentJSONParsing: true,
2767
+ forcedJSONParsing: true,
2768
+ clarifyTimeoutError: false
2769
+ };
2770
+
2771
+ var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
2772
+
2773
+ var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
2774
+
2775
+ var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
2776
+
2777
+ var platform$1 = {
2778
+ isBrowser: true,
2779
+ classes: {
2780
+ URLSearchParams: URLSearchParams$1,
2781
+ FormData: FormData$1,
2782
+ Blob: Blob$1
2783
+ },
2784
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
2785
+ };
2786
+
2787
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
2788
+
2789
+ const _navigator = typeof navigator === 'object' && navigator || undefined;
2790
+
2791
+ /**
2792
+ * Determine if we're running in a standard browser environment
2793
+ *
2794
+ * This allows axios to run in a web worker, and react-native.
2795
+ * Both environments support XMLHttpRequest, but not fully standard globals.
2796
+ *
2797
+ * web workers:
2798
+ * typeof window -> undefined
2799
+ * typeof document -> undefined
2800
+ *
2801
+ * react-native:
2802
+ * navigator.product -> 'ReactNative'
2803
+ * nativescript
2804
+ * navigator.product -> 'NativeScript' or 'NS'
2805
+ *
2806
+ * @returns {boolean}
2807
+ */
2808
+ const hasStandardBrowserEnv = hasBrowserEnv &&
2809
+ (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
2810
+
2811
+ /**
2812
+ * Determine if we're running in a standard browser webWorker environment
2813
+ *
2814
+ * Although the `isStandardBrowserEnv` method indicates that
2815
+ * `allows axios to run in a web worker`, the WebWorker will still be
2816
+ * filtered out due to its judgment standard
2817
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
2818
+ * This leads to a problem when axios post `FormData` in webWorker
2819
+ */
2820
+ const hasStandardBrowserWebWorkerEnv = (() => {
2821
+ return (
2822
+ typeof WorkerGlobalScope !== 'undefined' &&
2823
+ // eslint-disable-next-line no-undef
2824
+ self instanceof WorkerGlobalScope &&
2825
+ typeof self.importScripts === 'function'
2826
+ );
2827
+ })();
2828
+
2829
+ const origin = hasBrowserEnv && window.location.href || 'http://localhost';
2830
+
2831
+ var utils = /*#__PURE__*/Object.freeze({
2832
+ __proto__: null,
2833
+ hasBrowserEnv: hasBrowserEnv,
2834
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
2835
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
2836
+ navigator: _navigator,
2837
+ origin: origin
2838
+ });
2839
+
2840
+ var platform = {
2841
+ ...utils,
2842
+ ...platform$1
2843
+ };
2844
+
2845
+ function toURLEncodedForm(data, options) {
2846
+ return toFormData$1(data, new platform.classes.URLSearchParams(), {
2847
+ visitor: function(value, key, path, helpers) {
2848
+ if (platform.isNode && utils$1.isBuffer(value)) {
2849
+ this.append(key, value.toString('base64'));
2850
+ return false;
2851
+ }
2852
+
2853
+ return helpers.defaultVisitor.apply(this, arguments);
2854
+ },
2855
+ ...options
2856
+ });
2857
+ }
2858
+
2859
+ /**
2860
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
2861
+ *
2862
+ * @param {string} name - The name of the property to get.
2863
+ *
2864
+ * @returns An array of strings.
2865
+ */
2866
+ function parsePropPath(name) {
2867
+ // foo[x][y][z]
2868
+ // foo.x.y.z
2869
+ // foo-x-y-z
2870
+ // foo x y z
2871
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
2872
+ return match[0] === '[]' ? '' : match[1] || match[0];
2873
+ });
2874
+ }
2875
+
2876
+ /**
2877
+ * Convert an array to an object.
2878
+ *
2879
+ * @param {Array<any>} arr - The array to convert to an object.
2880
+ *
2881
+ * @returns An object with the same keys and values as the array.
2882
+ */
2883
+ function arrayToObject(arr) {
2884
+ const obj = {};
2885
+ const keys = Object.keys(arr);
2886
+ let i;
2887
+ const len = keys.length;
2888
+ let key;
2889
+ for (i = 0; i < len; i++) {
2890
+ key = keys[i];
2891
+ obj[key] = arr[key];
2892
+ }
2893
+ return obj;
2894
+ }
2895
+
2896
+ /**
2897
+ * It takes a FormData object and returns a JavaScript object
2898
+ *
2899
+ * @param {string} formData The FormData object to convert to JSON.
2900
+ *
2901
+ * @returns {Object<string, any> | null} The converted object.
2902
+ */
2903
+ function formDataToJSON(formData) {
2904
+ function buildPath(path, value, target, index) {
2905
+ let name = path[index++];
2906
+
2907
+ if (name === '__proto__') return true;
2908
+
2909
+ const isNumericKey = Number.isFinite(+name);
2910
+ const isLast = index >= path.length;
2911
+ name = !name && utils$1.isArray(target) ? target.length : name;
2912
+
2913
+ if (isLast) {
2914
+ if (utils$1.hasOwnProp(target, name)) {
2915
+ target[name] = [target[name], value];
2916
+ } else {
2917
+ target[name] = value;
2918
+ }
2919
+
2920
+ return !isNumericKey;
2921
+ }
2922
+
2923
+ if (!target[name] || !utils$1.isObject(target[name])) {
2924
+ target[name] = [];
2925
+ }
2926
+
2927
+ const result = buildPath(path, value, target[name], index);
2928
+
2929
+ if (result && utils$1.isArray(target[name])) {
2930
+ target[name] = arrayToObject(target[name]);
2931
+ }
2932
+
2933
+ return !isNumericKey;
2934
+ }
2935
+
2936
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
2937
+ const obj = {};
2938
+
2939
+ utils$1.forEachEntry(formData, (name, value) => {
2940
+ buildPath(parsePropPath(name), value, obj, 0);
2941
+ });
2942
+
2943
+ return obj;
2944
+ }
2945
+
2946
+ return null;
2947
+ }
2948
+
2949
+ /**
2950
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
2951
+ * of the input
2952
+ *
2953
+ * @param {any} rawValue - The value to be stringified.
2954
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
2955
+ * @param {Function} encoder - A function that takes a value and returns a string.
2956
+ *
2957
+ * @returns {string} A stringified version of the rawValue.
2958
+ */
2959
+ function stringifySafely(rawValue, parser, encoder) {
2960
+ if (utils$1.isString(rawValue)) {
2961
+ try {
2962
+ (parser || JSON.parse)(rawValue);
2963
+ return utils$1.trim(rawValue);
2964
+ } catch (e) {
2965
+ if (e.name !== 'SyntaxError') {
2966
+ throw e;
2967
+ }
2968
+ }
2969
+ }
2970
+
2971
+ return (encoder || JSON.stringify)(rawValue);
2972
+ }
2973
+
2974
+ const defaults = {
2975
+
2976
+ transitional: transitionalDefaults,
2977
+
2978
+ adapter: ['xhr', 'http', 'fetch'],
2979
+
2980
+ transformRequest: [function transformRequest(data, headers) {
2981
+ const contentType = headers.getContentType() || '';
2982
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
2983
+ const isObjectPayload = utils$1.isObject(data);
2984
+
2985
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
2986
+ data = new FormData(data);
2987
+ }
2988
+
2989
+ const isFormData = utils$1.isFormData(data);
2990
+
2991
+ if (isFormData) {
2992
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
2993
+ }
2994
+
2995
+ if (utils$1.isArrayBuffer(data) ||
2996
+ utils$1.isBuffer(data) ||
2997
+ utils$1.isStream(data) ||
2998
+ utils$1.isFile(data) ||
2999
+ utils$1.isBlob(data) ||
3000
+ utils$1.isReadableStream(data)
3001
+ ) {
3002
+ return data;
3003
+ }
3004
+ if (utils$1.isArrayBufferView(data)) {
3005
+ return data.buffer;
3006
+ }
3007
+ if (utils$1.isURLSearchParams(data)) {
3008
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
3009
+ return data.toString();
3010
+ }
3011
+
3012
+ let isFileList;
3013
+
3014
+ if (isObjectPayload) {
3015
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
3016
+ return toURLEncodedForm(data, this.formSerializer).toString();
3017
+ }
3018
+
3019
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
3020
+ const _FormData = this.env && this.env.FormData;
3021
+
3022
+ return toFormData$1(
3023
+ isFileList ? {'files[]': data} : data,
3024
+ _FormData && new _FormData(),
3025
+ this.formSerializer
3026
+ );
3027
+ }
3028
+ }
3029
+
3030
+ if (isObjectPayload || hasJSONContentType ) {
3031
+ headers.setContentType('application/json', false);
3032
+ return stringifySafely(data);
3033
+ }
3034
+
3035
+ return data;
3036
+ }],
3037
+
3038
+ transformResponse: [function transformResponse(data) {
3039
+ const transitional = this.transitional || defaults.transitional;
3040
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
3041
+ const JSONRequested = this.responseType === 'json';
3042
+
3043
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
3044
+ return data;
3045
+ }
3046
+
3047
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
3048
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
3049
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
3050
+
3051
+ try {
3052
+ return JSON.parse(data, this.parseReviver);
3053
+ } catch (e) {
3054
+ if (strictJSONParsing) {
3055
+ if (e.name === 'SyntaxError') {
3056
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
3057
+ }
3058
+ throw e;
3059
+ }
3060
+ }
3061
+ }
3062
+
3063
+ return data;
3064
+ }],
3065
+
3066
+ /**
3067
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
3068
+ * timeout is not created.
3069
+ */
3070
+ timeout: 0,
3071
+
3072
+ xsrfCookieName: 'XSRF-TOKEN',
3073
+ xsrfHeaderName: 'X-XSRF-TOKEN',
3074
+
3075
+ maxContentLength: -1,
3076
+ maxBodyLength: -1,
3077
+
3078
+ env: {
3079
+ FormData: platform.classes.FormData,
3080
+ Blob: platform.classes.Blob
3081
+ },
3082
+
3083
+ validateStatus: function validateStatus(status) {
3084
+ return status >= 200 && status < 300;
3085
+ },
3086
+
3087
+ headers: {
3088
+ common: {
3089
+ 'Accept': 'application/json, text/plain, */*',
3090
+ 'Content-Type': undefined
3091
+ }
3092
+ }
3093
+ };
3094
+
3095
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
3096
+ defaults.headers[method] = {};
3097
+ });
3098
+
3099
+ // RawAxiosHeaders whose duplicates are ignored by node
3100
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
3101
+ const ignoreDuplicateOf = utils$1.toObjectSet([
3102
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
3103
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
3104
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
3105
+ 'referer', 'retry-after', 'user-agent'
3106
+ ]);
3107
+
3108
+ /**
3109
+ * Parse headers into an object
3110
+ *
3111
+ * ```
3112
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
3113
+ * Content-Type: application/json
3114
+ * Connection: keep-alive
3115
+ * Transfer-Encoding: chunked
3116
+ * ```
3117
+ *
3118
+ * @param {String} rawHeaders Headers needing to be parsed
3119
+ *
3120
+ * @returns {Object} Headers parsed into an object
3121
+ */
3122
+ var parseHeaders = rawHeaders => {
3123
+ const parsed = {};
3124
+ let key;
3125
+ let val;
3126
+ let i;
3127
+
3128
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
3129
+ i = line.indexOf(':');
3130
+ key = line.substring(0, i).trim().toLowerCase();
3131
+ val = line.substring(i + 1).trim();
3132
+
3133
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
3134
+ return;
3135
+ }
3136
+
3137
+ if (key === 'set-cookie') {
3138
+ if (parsed[key]) {
3139
+ parsed[key].push(val);
3140
+ } else {
3141
+ parsed[key] = [val];
3142
+ }
3143
+ } else {
3144
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
3145
+ }
3146
+ });
3147
+
3148
+ return parsed;
3149
+ };
3150
+
3151
+ const $internals = Symbol('internals');
3152
+
3153
+ function normalizeHeader(header) {
3154
+ return header && String(header).trim().toLowerCase();
3155
+ }
3156
+
3157
+ function normalizeValue(value) {
3158
+ if (value === false || value == null) {
3159
+ return value;
3160
+ }
3161
+
3162
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
3163
+ }
3164
+
3165
+ function parseTokens(str) {
3166
+ const tokens = Object.create(null);
3167
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
3168
+ let match;
3169
+
3170
+ while ((match = tokensRE.exec(str))) {
3171
+ tokens[match[1]] = match[2];
3172
+ }
3173
+
3174
+ return tokens;
3175
+ }
3176
+
3177
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
3178
+
3179
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
3180
+ if (utils$1.isFunction(filter)) {
3181
+ return filter.call(this, value, header);
3182
+ }
3183
+
3184
+ if (isHeaderNameFilter) {
3185
+ value = header;
3186
+ }
3187
+
3188
+ if (!utils$1.isString(value)) return;
3189
+
3190
+ if (utils$1.isString(filter)) {
3191
+ return value.indexOf(filter) !== -1;
3192
+ }
3193
+
3194
+ if (utils$1.isRegExp(filter)) {
3195
+ return filter.test(value);
3196
+ }
3197
+ }
3198
+
3199
+ function formatHeader(header) {
3200
+ return header.trim()
3201
+ .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
3202
+ return char.toUpperCase() + str;
3203
+ });
3204
+ }
3205
+
3206
+ function buildAccessors(obj, header) {
3207
+ const accessorName = utils$1.toCamelCase(' ' + header);
3208
+
3209
+ ['get', 'set', 'has'].forEach(methodName => {
3210
+ Object.defineProperty(obj, methodName + accessorName, {
3211
+ value: function(arg1, arg2, arg3) {
3212
+ return this[methodName].call(this, header, arg1, arg2, arg3);
3213
+ },
3214
+ configurable: true
3215
+ });
3216
+ });
3217
+ }
3218
+
3219
+ let AxiosHeaders$1 = class AxiosHeaders {
3220
+ constructor(headers) {
3221
+ headers && this.set(headers);
3222
+ }
3223
+
3224
+ set(header, valueOrRewrite, rewrite) {
3225
+ const self = this;
3226
+
3227
+ function setHeader(_value, _header, _rewrite) {
3228
+ const lHeader = normalizeHeader(_header);
3229
+
3230
+ if (!lHeader) {
3231
+ throw new Error('header name must be a non-empty string');
3232
+ }
3233
+
3234
+ const key = utils$1.findKey(self, lHeader);
3235
+
3236
+ if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
3237
+ self[key || _header] = normalizeValue(_value);
3238
+ }
3239
+ }
3240
+
3241
+ const setHeaders = (headers, _rewrite) =>
3242
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
3243
+
3244
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
3245
+ setHeaders(header, valueOrRewrite);
3246
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
3247
+ setHeaders(parseHeaders(header), valueOrRewrite);
3248
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
3249
+ let obj = {}, dest, key;
3250
+ for (const entry of header) {
3251
+ if (!utils$1.isArray(entry)) {
3252
+ throw TypeError('Object iterator must return a key-value pair');
3253
+ }
3254
+
3255
+ obj[key = entry[0]] = (dest = obj[key]) ?
3256
+ (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
3257
+ }
3258
+
3259
+ setHeaders(obj, valueOrRewrite);
3260
+ } else {
3261
+ header != null && setHeader(valueOrRewrite, header, rewrite);
3262
+ }
3263
+
3264
+ return this;
3265
+ }
3266
+
3267
+ get(header, parser) {
3268
+ header = normalizeHeader(header);
3269
+
3270
+ if (header) {
3271
+ const key = utils$1.findKey(this, header);
3272
+
3273
+ if (key) {
3274
+ const value = this[key];
3275
+
3276
+ if (!parser) {
3277
+ return value;
3278
+ }
3279
+
3280
+ if (parser === true) {
3281
+ return parseTokens(value);
3282
+ }
3283
+
3284
+ if (utils$1.isFunction(parser)) {
3285
+ return parser.call(this, value, key);
3286
+ }
3287
+
3288
+ if (utils$1.isRegExp(parser)) {
3289
+ return parser.exec(value);
3290
+ }
3291
+
3292
+ throw new TypeError('parser must be boolean|regexp|function');
3293
+ }
3294
+ }
3295
+ }
3296
+
3297
+ has(header, matcher) {
3298
+ header = normalizeHeader(header);
3299
+
3300
+ if (header) {
3301
+ const key = utils$1.findKey(this, header);
3302
+
3303
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
3304
+ }
3305
+
3306
+ return false;
3307
+ }
3308
+
3309
+ delete(header, matcher) {
3310
+ const self = this;
3311
+ let deleted = false;
3312
+
3313
+ function deleteHeader(_header) {
3314
+ _header = normalizeHeader(_header);
3315
+
3316
+ if (_header) {
3317
+ const key = utils$1.findKey(self, _header);
3318
+
3319
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
3320
+ delete self[key];
3321
+
3322
+ deleted = true;
3323
+ }
3324
+ }
3325
+ }
3326
+
3327
+ if (utils$1.isArray(header)) {
3328
+ header.forEach(deleteHeader);
3329
+ } else {
3330
+ deleteHeader(header);
3331
+ }
3332
+
3333
+ return deleted;
3334
+ }
3335
+
3336
+ clear(matcher) {
3337
+ const keys = Object.keys(this);
3338
+ let i = keys.length;
3339
+ let deleted = false;
3340
+
3341
+ while (i--) {
3342
+ const key = keys[i];
3343
+ if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
3344
+ delete this[key];
3345
+ deleted = true;
3346
+ }
3347
+ }
3348
+
3349
+ return deleted;
3350
+ }
3351
+
3352
+ normalize(format) {
3353
+ const self = this;
3354
+ const headers = {};
3355
+
3356
+ utils$1.forEach(this, (value, header) => {
3357
+ const key = utils$1.findKey(headers, header);
3358
+
3359
+ if (key) {
3360
+ self[key] = normalizeValue(value);
3361
+ delete self[header];
3362
+ return;
3363
+ }
3364
+
3365
+ const normalized = format ? formatHeader(header) : String(header).trim();
3366
+
3367
+ if (normalized !== header) {
3368
+ delete self[header];
3369
+ }
3370
+
3371
+ self[normalized] = normalizeValue(value);
3372
+
3373
+ headers[normalized] = true;
3374
+ });
3375
+
3376
+ return this;
3377
+ }
3378
+
3379
+ concat(...targets) {
3380
+ return this.constructor.concat(this, ...targets);
3381
+ }
3382
+
3383
+ toJSON(asStrings) {
3384
+ const obj = Object.create(null);
3385
+
3386
+ utils$1.forEach(this, (value, header) => {
3387
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
3388
+ });
3389
+
3390
+ return obj;
3391
+ }
3392
+
3393
+ [Symbol.iterator]() {
3394
+ return Object.entries(this.toJSON())[Symbol.iterator]();
3395
+ }
3396
+
3397
+ toString() {
3398
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
3399
+ }
3400
+
3401
+ getSetCookie() {
3402
+ return this.get("set-cookie") || [];
3403
+ }
3404
+
3405
+ get [Symbol.toStringTag]() {
3406
+ return 'AxiosHeaders';
3407
+ }
3408
+
3409
+ static from(thing) {
3410
+ return thing instanceof this ? thing : new this(thing);
3411
+ }
3412
+
3413
+ static concat(first, ...targets) {
3414
+ const computed = new this(first);
3415
+
3416
+ targets.forEach((target) => computed.set(target));
3417
+
3418
+ return computed;
3419
+ }
3420
+
3421
+ static accessor(header) {
3422
+ const internals = this[$internals] = (this[$internals] = {
3423
+ accessors: {}
3424
+ });
3425
+
3426
+ const accessors = internals.accessors;
3427
+ const prototype = this.prototype;
3428
+
3429
+ function defineAccessor(_header) {
3430
+ const lHeader = normalizeHeader(_header);
3431
+
3432
+ if (!accessors[lHeader]) {
3433
+ buildAccessors(prototype, _header);
3434
+ accessors[lHeader] = true;
3435
+ }
3436
+ }
3437
+
3438
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
3439
+
3440
+ return this;
3441
+ }
3442
+ };
3443
+
3444
+ AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
3445
+
3446
+ // reserved names hotfix
3447
+ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
3448
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
3449
+ return {
3450
+ get: () => value,
3451
+ set(headerValue) {
3452
+ this[mapped] = headerValue;
3453
+ }
3454
+ }
3455
+ });
3456
+
3457
+ utils$1.freezeMethods(AxiosHeaders$1);
3458
+
3459
+ /**
3460
+ * Transform the data for a request or a response
3461
+ *
3462
+ * @param {Array|Function} fns A single function or Array of functions
3463
+ * @param {?Object} response The response object
3464
+ *
3465
+ * @returns {*} The resulting transformed data
3466
+ */
3467
+ function transformData(fns, response) {
3468
+ const config = this || defaults;
3469
+ const context = response || config;
3470
+ const headers = AxiosHeaders$1.from(context.headers);
3471
+ let data = context.data;
3472
+
3473
+ utils$1.forEach(fns, function transform(fn) {
3474
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
3475
+ });
3476
+
3477
+ headers.normalize();
3478
+
3479
+ return data;
3480
+ }
3481
+
3482
+ function isCancel$1(value) {
3483
+ return !!(value && value.__CANCEL__);
3484
+ }
3485
+
3486
+ /**
3487
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
3488
+ *
3489
+ * @param {string=} message The message.
3490
+ * @param {Object=} config The config.
3491
+ * @param {Object=} request The request.
3492
+ *
3493
+ * @returns {CanceledError} The created error.
3494
+ */
3495
+ function CanceledError$1(message, config, request) {
3496
+ // eslint-disable-next-line no-eq-null,eqeqeq
3497
+ AxiosError$1.call(this, message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
3498
+ this.name = 'CanceledError';
3499
+ }
3500
+
3501
+ utils$1.inherits(CanceledError$1, AxiosError$1, {
3502
+ __CANCEL__: true
3503
+ });
3504
+
3505
+ /**
3506
+ * Resolve or reject a Promise based on response status.
3507
+ *
3508
+ * @param {Function} resolve A function that resolves the promise.
3509
+ * @param {Function} reject A function that rejects the promise.
3510
+ * @param {object} response The response.
3511
+ *
3512
+ * @returns {object} The response.
3513
+ */
3514
+ function settle(resolve, reject, response) {
3515
+ const validateStatus = response.config.validateStatus;
3516
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
3517
+ resolve(response);
3518
+ } else {
3519
+ reject(new AxiosError$1(
3520
+ 'Request failed with status code ' + response.status,
3521
+ [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
3522
+ response.config,
3523
+ response.request,
3524
+ response
3525
+ ));
3526
+ }
3527
+ }
3528
+
3529
+ function parseProtocol(url) {
3530
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
3531
+ return match && match[1] || '';
3532
+ }
3533
+
3534
+ /**
3535
+ * Calculate data maxRate
3536
+ * @param {Number} [samplesCount= 10]
3537
+ * @param {Number} [min= 1000]
3538
+ * @returns {Function}
3539
+ */
3540
+ function speedometer(samplesCount, min) {
3541
+ samplesCount = samplesCount || 10;
3542
+ const bytes = new Array(samplesCount);
3543
+ const timestamps = new Array(samplesCount);
3544
+ let head = 0;
3545
+ let tail = 0;
3546
+ let firstSampleTS;
3547
+
3548
+ min = min !== undefined ? min : 1000;
3549
+
3550
+ return function push(chunkLength) {
3551
+ const now = Date.now();
3552
+
3553
+ const startedAt = timestamps[tail];
3554
+
3555
+ if (!firstSampleTS) {
3556
+ firstSampleTS = now;
3557
+ }
3558
+
3559
+ bytes[head] = chunkLength;
3560
+ timestamps[head] = now;
3561
+
3562
+ let i = tail;
3563
+ let bytesCount = 0;
3564
+
3565
+ while (i !== head) {
3566
+ bytesCount += bytes[i++];
3567
+ i = i % samplesCount;
3568
+ }
3569
+
3570
+ head = (head + 1) % samplesCount;
3571
+
3572
+ if (head === tail) {
3573
+ tail = (tail + 1) % samplesCount;
3574
+ }
3575
+
3576
+ if (now - firstSampleTS < min) {
3577
+ return;
3578
+ }
3579
+
3580
+ const passed = startedAt && now - startedAt;
3581
+
3582
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
3583
+ };
3584
+ }
3585
+
3586
+ /**
3587
+ * Throttle decorator
3588
+ * @param {Function} fn
3589
+ * @param {Number} freq
3590
+ * @return {Function}
3591
+ */
3592
+ function throttle(fn, freq) {
3593
+ let timestamp = 0;
3594
+ let threshold = 1000 / freq;
3595
+ let lastArgs;
3596
+ let timer;
3597
+
3598
+ const invoke = (args, now = Date.now()) => {
3599
+ timestamp = now;
3600
+ lastArgs = null;
3601
+ if (timer) {
3602
+ clearTimeout(timer);
3603
+ timer = null;
3604
+ }
3605
+ fn(...args);
3606
+ };
3607
+
3608
+ const throttled = (...args) => {
3609
+ const now = Date.now();
3610
+ const passed = now - timestamp;
3611
+ if ( passed >= threshold) {
3612
+ invoke(args, now);
3613
+ } else {
3614
+ lastArgs = args;
3615
+ if (!timer) {
3616
+ timer = setTimeout(() => {
3617
+ timer = null;
3618
+ invoke(lastArgs);
3619
+ }, threshold - passed);
3620
+ }
3621
+ }
3622
+ };
3623
+
3624
+ const flush = () => lastArgs && invoke(lastArgs);
3625
+
3626
+ return [throttled, flush];
3627
+ }
3628
+
3629
+ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
3630
+ let bytesNotified = 0;
3631
+ const _speedometer = speedometer(50, 250);
3632
+
3633
+ return throttle(e => {
3634
+ const loaded = e.loaded;
3635
+ const total = e.lengthComputable ? e.total : undefined;
3636
+ const progressBytes = loaded - bytesNotified;
3637
+ const rate = _speedometer(progressBytes);
3638
+ const inRange = loaded <= total;
3639
+
3640
+ bytesNotified = loaded;
3641
+
3642
+ const data = {
3643
+ loaded,
3644
+ total,
3645
+ progress: total ? (loaded / total) : undefined,
3646
+ bytes: progressBytes,
3647
+ rate: rate ? rate : undefined,
3648
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
3649
+ event: e,
3650
+ lengthComputable: total != null,
3651
+ [isDownloadStream ? 'download' : 'upload']: true
3652
+ };
3653
+
3654
+ listener(data);
3655
+ }, freq);
3656
+ };
3657
+
3658
+ const progressEventDecorator = (total, throttled) => {
3659
+ const lengthComputable = total != null;
3660
+
3661
+ return [(loaded) => throttled[0]({
3662
+ lengthComputable,
3663
+ total,
3664
+ loaded
3665
+ }), throttled[1]];
3666
+ };
3667
+
3668
+ const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
3669
+
3670
+ var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
3671
+ url = new URL(url, platform.origin);
3672
+
3673
+ return (
3674
+ origin.protocol === url.protocol &&
3675
+ origin.host === url.host &&
3676
+ (isMSIE || origin.port === url.port)
3677
+ );
3678
+ })(
3679
+ new URL(platform.origin),
3680
+ platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
3681
+ ) : () => true;
3682
+
3683
+ var cookies = platform.hasStandardBrowserEnv ?
3684
+
3685
+ // Standard browser envs support document.cookie
3686
+ {
3687
+ write(name, value, expires, path, domain, secure, sameSite) {
3688
+ if (typeof document === 'undefined') return;
3689
+
3690
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
3691
+
3692
+ if (utils$1.isNumber(expires)) {
3693
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
3694
+ }
3695
+ if (utils$1.isString(path)) {
3696
+ cookie.push(`path=${path}`);
3697
+ }
3698
+ if (utils$1.isString(domain)) {
3699
+ cookie.push(`domain=${domain}`);
3700
+ }
3701
+ if (secure === true) {
3702
+ cookie.push('secure');
3703
+ }
3704
+ if (utils$1.isString(sameSite)) {
3705
+ cookie.push(`SameSite=${sameSite}`);
3706
+ }
3707
+
3708
+ document.cookie = cookie.join('; ');
3709
+ },
3710
+
3711
+ read(name) {
3712
+ if (typeof document === 'undefined') return null;
3713
+ const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
3714
+ return match ? decodeURIComponent(match[1]) : null;
3715
+ },
3716
+
3717
+ remove(name) {
3718
+ this.write(name, '', Date.now() - 86400000, '/');
3719
+ }
3720
+ }
3721
+
3722
+ :
3723
+
3724
+ // Non-standard browser env (web workers, react-native) lack needed support.
3725
+ {
3726
+ write() {},
3727
+ read() {
3728
+ return null;
3729
+ },
3730
+ remove() {}
3731
+ };
3732
+
3733
+ /**
3734
+ * Determines whether the specified URL is absolute
3735
+ *
3736
+ * @param {string} url The URL to test
3737
+ *
3738
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
3739
+ */
3740
+ function isAbsoluteURL(url) {
3741
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
3742
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
3743
+ // by any combination of letters, digits, plus, period, or hyphen.
3744
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
3745
+ }
3746
+
3747
+ /**
3748
+ * Creates a new URL by combining the specified URLs
3749
+ *
3750
+ * @param {string} baseURL The base URL
3751
+ * @param {string} relativeURL The relative URL
3752
+ *
3753
+ * @returns {string} The combined URL
3754
+ */
3755
+ function combineURLs(baseURL, relativeURL) {
3756
+ return relativeURL
3757
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
3758
+ : baseURL;
3759
+ }
3760
+
3761
+ /**
3762
+ * Creates a new URL by combining the baseURL with the requestedURL,
3763
+ * only when the requestedURL is not already an absolute URL.
3764
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
3765
+ *
3766
+ * @param {string} baseURL The base URL
3767
+ * @param {string} requestedURL Absolute or relative URL to combine
3768
+ *
3769
+ * @returns {string} The combined full path
3770
+ */
3771
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
3772
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
3773
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
3774
+ return combineURLs(baseURL, requestedURL);
3775
+ }
3776
+ return requestedURL;
3777
+ }
3778
+
3779
+ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
3780
+
3781
+ /**
3782
+ * Config-specific merge-function which creates a new config-object
3783
+ * by merging two configuration objects together.
3784
+ *
3785
+ * @param {Object} config1
3786
+ * @param {Object} config2
3787
+ *
3788
+ * @returns {Object} New object resulting from merging config2 to config1
3789
+ */
3790
+ function mergeConfig$1(config1, config2) {
3791
+ // eslint-disable-next-line no-param-reassign
3792
+ config2 = config2 || {};
3793
+ const config = {};
3794
+
3795
+ function getMergedValue(target, source, prop, caseless) {
3796
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
3797
+ return utils$1.merge.call({caseless}, target, source);
3798
+ } else if (utils$1.isPlainObject(source)) {
3799
+ return utils$1.merge({}, source);
3800
+ } else if (utils$1.isArray(source)) {
3801
+ return source.slice();
3802
+ }
3803
+ return source;
3804
+ }
3805
+
3806
+ // eslint-disable-next-line consistent-return
3807
+ function mergeDeepProperties(a, b, prop, caseless) {
3808
+ if (!utils$1.isUndefined(b)) {
3809
+ return getMergedValue(a, b, prop, caseless);
3810
+ } else if (!utils$1.isUndefined(a)) {
3811
+ return getMergedValue(undefined, a, prop, caseless);
3812
+ }
3813
+ }
3814
+
3815
+ // eslint-disable-next-line consistent-return
3816
+ function valueFromConfig2(a, b) {
3817
+ if (!utils$1.isUndefined(b)) {
3818
+ return getMergedValue(undefined, b);
3819
+ }
3820
+ }
3821
+
3822
+ // eslint-disable-next-line consistent-return
3823
+ function defaultToConfig2(a, b) {
3824
+ if (!utils$1.isUndefined(b)) {
3825
+ return getMergedValue(undefined, b);
3826
+ } else if (!utils$1.isUndefined(a)) {
3827
+ return getMergedValue(undefined, a);
3828
+ }
3829
+ }
3830
+
3831
+ // eslint-disable-next-line consistent-return
3832
+ function mergeDirectKeys(a, b, prop) {
3833
+ if (prop in config2) {
3834
+ return getMergedValue(a, b);
3835
+ } else if (prop in config1) {
3836
+ return getMergedValue(undefined, a);
3837
+ }
3838
+ }
3839
+
3840
+ const mergeMap = {
3841
+ url: valueFromConfig2,
3842
+ method: valueFromConfig2,
3843
+ data: valueFromConfig2,
3844
+ baseURL: defaultToConfig2,
3845
+ transformRequest: defaultToConfig2,
3846
+ transformResponse: defaultToConfig2,
3847
+ paramsSerializer: defaultToConfig2,
3848
+ timeout: defaultToConfig2,
3849
+ timeoutMessage: defaultToConfig2,
3850
+ withCredentials: defaultToConfig2,
3851
+ withXSRFToken: defaultToConfig2,
3852
+ adapter: defaultToConfig2,
3853
+ responseType: defaultToConfig2,
3854
+ xsrfCookieName: defaultToConfig2,
3855
+ xsrfHeaderName: defaultToConfig2,
3856
+ onUploadProgress: defaultToConfig2,
3857
+ onDownloadProgress: defaultToConfig2,
3858
+ decompress: defaultToConfig2,
3859
+ maxContentLength: defaultToConfig2,
3860
+ maxBodyLength: defaultToConfig2,
3861
+ beforeRedirect: defaultToConfig2,
3862
+ transport: defaultToConfig2,
3863
+ httpAgent: defaultToConfig2,
3864
+ httpsAgent: defaultToConfig2,
3865
+ cancelToken: defaultToConfig2,
3866
+ socketPath: defaultToConfig2,
3867
+ responseEncoding: defaultToConfig2,
3868
+ validateStatus: mergeDirectKeys,
3869
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
3870
+ };
3871
+
3872
+ utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
3873
+ const merge = mergeMap[prop] || mergeDeepProperties;
3874
+ const configValue = merge(config1[prop], config2[prop], prop);
3875
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
3876
+ });
3877
+
3878
+ return config;
3879
+ }
3880
+
3881
+ var resolveConfig = (config) => {
3882
+ const newConfig = mergeConfig$1({}, config);
3883
+
3884
+ let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
3885
+
3886
+ newConfig.headers = headers = AxiosHeaders$1.from(headers);
3887
+
3888
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
3889
+
3890
+ // HTTP basic authentication
3891
+ if (auth) {
3892
+ headers.set('Authorization', 'Basic ' +
3893
+ btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
3894
+ );
3895
+ }
3896
+
3897
+ if (utils$1.isFormData(data)) {
3898
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
3899
+ headers.setContentType(undefined); // browser handles it
3900
+ } else if (utils$1.isFunction(data.getHeaders)) {
3901
+ // Node.js FormData (like form-data package)
3902
+ const formHeaders = data.getHeaders();
3903
+ // Only set safe headers to avoid overwriting security headers
3904
+ const allowedHeaders = ['content-type', 'content-length'];
3905
+ Object.entries(formHeaders).forEach(([key, val]) => {
3906
+ if (allowedHeaders.includes(key.toLowerCase())) {
3907
+ headers.set(key, val);
3908
+ }
3909
+ });
3910
+ }
3911
+ }
3912
+
3913
+ // Add xsrf header
3914
+ // This is only done if running in a standard browser environment.
3915
+ // Specifically not if we're in a web worker, or react-native.
3916
+
3917
+ if (platform.hasStandardBrowserEnv) {
3918
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
3919
+
3920
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
3921
+ // Add xsrf header
3922
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
3923
+
3924
+ if (xsrfValue) {
3925
+ headers.set(xsrfHeaderName, xsrfValue);
3926
+ }
3927
+ }
3928
+ }
3929
+
3930
+ return newConfig;
3931
+ };
3932
+
3933
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
3934
+
3935
+ var xhrAdapter = isXHRAdapterSupported && function (config) {
3936
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
3937
+ const _config = resolveConfig(config);
3938
+ let requestData = _config.data;
3939
+ const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
3940
+ let {responseType, onUploadProgress, onDownloadProgress} = _config;
3941
+ let onCanceled;
3942
+ let uploadThrottled, downloadThrottled;
3943
+ let flushUpload, flushDownload;
3944
+
3945
+ function done() {
3946
+ flushUpload && flushUpload(); // flush events
3947
+ flushDownload && flushDownload(); // flush events
3948
+
3949
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
3950
+
3951
+ _config.signal && _config.signal.removeEventListener('abort', onCanceled);
3952
+ }
3953
+
3954
+ let request = new XMLHttpRequest();
3955
+
3956
+ request.open(_config.method.toUpperCase(), _config.url, true);
3957
+
3958
+ // Set the request timeout in MS
3959
+ request.timeout = _config.timeout;
3960
+
3961
+ function onloadend() {
3962
+ if (!request) {
3963
+ return;
3964
+ }
3965
+ // Prepare the response
3966
+ const responseHeaders = AxiosHeaders$1.from(
3967
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
3968
+ );
3969
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
3970
+ request.responseText : request.response;
3971
+ const response = {
3972
+ data: responseData,
3973
+ status: request.status,
3974
+ statusText: request.statusText,
3975
+ headers: responseHeaders,
3976
+ config,
3977
+ request
3978
+ };
3979
+
3980
+ settle(function _resolve(value) {
3981
+ resolve(value);
3982
+ done();
3983
+ }, function _reject(err) {
3984
+ reject(err);
3985
+ done();
3986
+ }, response);
3987
+
3988
+ // Clean up request
3989
+ request = null;
3990
+ }
3991
+
3992
+ if ('onloadend' in request) {
3993
+ // Use onloadend if available
3994
+ request.onloadend = onloadend;
3995
+ } else {
3996
+ // Listen for ready state to emulate onloadend
3997
+ request.onreadystatechange = function handleLoad() {
3998
+ if (!request || request.readyState !== 4) {
3999
+ return;
4000
+ }
4001
+
4002
+ // The request errored out and we didn't get a response, this will be
4003
+ // handled by onerror instead
4004
+ // With one exception: request that using file: protocol, most browsers
4005
+ // will return status as 0 even though it's a successful request
4006
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
4007
+ return;
4008
+ }
4009
+ // readystate handler is calling before onerror or ontimeout handlers,
4010
+ // so we should call onloadend on the next 'tick'
4011
+ setTimeout(onloadend);
4012
+ };
4013
+ }
4014
+
4015
+ // Handle browser request cancellation (as opposed to a manual cancellation)
4016
+ request.onabort = function handleAbort() {
4017
+ if (!request) {
4018
+ return;
4019
+ }
4020
+
4021
+ reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
4022
+
4023
+ // Clean up request
4024
+ request = null;
4025
+ };
4026
+
4027
+ // Handle low level network errors
4028
+ request.onerror = function handleError(event) {
4029
+ // Browsers deliver a ProgressEvent in XHR onerror
4030
+ // (message may be empty; when present, surface it)
4031
+ // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
4032
+ const msg = event && event.message ? event.message : 'Network Error';
4033
+ const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
4034
+ // attach the underlying event for consumers who want details
4035
+ err.event = event || null;
4036
+ reject(err);
4037
+ request = null;
4038
+ };
4039
+
4040
+ // Handle timeout
4041
+ request.ontimeout = function handleTimeout() {
4042
+ let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
4043
+ const transitional = _config.transitional || transitionalDefaults;
4044
+ if (_config.timeoutErrorMessage) {
4045
+ timeoutErrorMessage = _config.timeoutErrorMessage;
4046
+ }
4047
+ reject(new AxiosError$1(
4048
+ timeoutErrorMessage,
4049
+ transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
4050
+ config,
4051
+ request));
4052
+
4053
+ // Clean up request
4054
+ request = null;
4055
+ };
4056
+
4057
+ // Remove Content-Type if data is undefined
4058
+ requestData === undefined && requestHeaders.setContentType(null);
4059
+
4060
+ // Add headers to the request
4061
+ if ('setRequestHeader' in request) {
4062
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
4063
+ request.setRequestHeader(key, val);
4064
+ });
4065
+ }
4066
+
4067
+ // Add withCredentials to request if needed
4068
+ if (!utils$1.isUndefined(_config.withCredentials)) {
4069
+ request.withCredentials = !!_config.withCredentials;
4070
+ }
4071
+
4072
+ // Add responseType to request if needed
4073
+ if (responseType && responseType !== 'json') {
4074
+ request.responseType = _config.responseType;
4075
+ }
4076
+
4077
+ // Handle progress if needed
4078
+ if (onDownloadProgress) {
4079
+ ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
4080
+ request.addEventListener('progress', downloadThrottled);
4081
+ }
4082
+
4083
+ // Not all browsers support upload events
4084
+ if (onUploadProgress && request.upload) {
4085
+ ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
4086
+
4087
+ request.upload.addEventListener('progress', uploadThrottled);
4088
+
4089
+ request.upload.addEventListener('loadend', flushUpload);
4090
+ }
4091
+
4092
+ if (_config.cancelToken || _config.signal) {
4093
+ // Handle cancellation
4094
+ // eslint-disable-next-line func-names
4095
+ onCanceled = cancel => {
4096
+ if (!request) {
4097
+ return;
4098
+ }
4099
+ reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
4100
+ request.abort();
4101
+ request = null;
4102
+ };
4103
+
4104
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
4105
+ if (_config.signal) {
4106
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
4107
+ }
4108
+ }
4109
+
4110
+ const protocol = parseProtocol(_config.url);
4111
+
4112
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
4113
+ reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
4114
+ return;
4115
+ }
4116
+
4117
+
4118
+ // Send the request
4119
+ request.send(requestData || null);
4120
+ });
4121
+ };
4122
+
4123
+ const composeSignals = (signals, timeout) => {
4124
+ const {length} = (signals = signals ? signals.filter(Boolean) : []);
4125
+
4126
+ if (timeout || length) {
4127
+ let controller = new AbortController();
4128
+
4129
+ let aborted;
4130
+
4131
+ const onabort = function (reason) {
4132
+ if (!aborted) {
4133
+ aborted = true;
4134
+ unsubscribe();
4135
+ const err = reason instanceof Error ? reason : this.reason;
4136
+ controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
4137
+ }
4138
+ };
4139
+
4140
+ let timer = timeout && setTimeout(() => {
4141
+ timer = null;
4142
+ onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
4143
+ }, timeout);
4144
+
4145
+ const unsubscribe = () => {
4146
+ if (signals) {
4147
+ timer && clearTimeout(timer);
4148
+ timer = null;
4149
+ signals.forEach(signal => {
4150
+ signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
4151
+ });
4152
+ signals = null;
4153
+ }
4154
+ };
4155
+
4156
+ signals.forEach((signal) => signal.addEventListener('abort', onabort));
4157
+
4158
+ const {signal} = controller;
4159
+
4160
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
4161
+
4162
+ return signal;
4163
+ }
4164
+ };
4165
+
4166
+ const streamChunk = function* (chunk, chunkSize) {
4167
+ let len = chunk.byteLength;
4168
+
4169
+ if (len < chunkSize) {
4170
+ yield chunk;
4171
+ return;
4172
+ }
4173
+
4174
+ let pos = 0;
4175
+ let end;
4176
+
4177
+ while (pos < len) {
4178
+ end = pos + chunkSize;
4179
+ yield chunk.slice(pos, end);
4180
+ pos = end;
4181
+ }
4182
+ };
4183
+
4184
+ const readBytes = async function* (iterable, chunkSize) {
4185
+ for await (const chunk of readStream(iterable)) {
4186
+ yield* streamChunk(chunk, chunkSize);
4187
+ }
4188
+ };
4189
+
4190
+ const readStream = async function* (stream) {
4191
+ if (stream[Symbol.asyncIterator]) {
4192
+ yield* stream;
4193
+ return;
4194
+ }
4195
+
4196
+ const reader = stream.getReader();
4197
+ try {
4198
+ for (;;) {
4199
+ const {done, value} = await reader.read();
4200
+ if (done) {
4201
+ break;
4202
+ }
4203
+ yield value;
4204
+ }
4205
+ } finally {
4206
+ await reader.cancel();
4207
+ }
4208
+ };
4209
+
4210
+ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
4211
+ const iterator = readBytes(stream, chunkSize);
4212
+
4213
+ let bytes = 0;
4214
+ let done;
4215
+ let _onFinish = (e) => {
4216
+ if (!done) {
4217
+ done = true;
4218
+ onFinish && onFinish(e);
4219
+ }
4220
+ };
4221
+
4222
+ return new ReadableStream({
4223
+ async pull(controller) {
4224
+ try {
4225
+ const {done, value} = await iterator.next();
4226
+
4227
+ if (done) {
4228
+ _onFinish();
4229
+ controller.close();
4230
+ return;
4231
+ }
4232
+
4233
+ let len = value.byteLength;
4234
+ if (onProgress) {
4235
+ let loadedBytes = bytes += len;
4236
+ onProgress(loadedBytes);
4237
+ }
4238
+ controller.enqueue(new Uint8Array(value));
4239
+ } catch (err) {
4240
+ _onFinish(err);
4241
+ throw err;
4242
+ }
4243
+ },
4244
+ cancel(reason) {
4245
+ _onFinish(reason);
4246
+ return iterator.return();
4247
+ }
4248
+ }, {
4249
+ highWaterMark: 2
4250
+ })
4251
+ };
4252
+
4253
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
4254
+
4255
+ const {isFunction} = utils$1;
4256
+
4257
+ const globalFetchAPI = (({Request, Response}) => ({
4258
+ Request, Response
4259
+ }))(utils$1.global);
4260
+
4261
+ const {
4262
+ ReadableStream: ReadableStream$1, TextEncoder
4263
+ } = utils$1.global;
4264
+
4265
+
4266
+ const test = (fn, ...args) => {
4267
+ try {
4268
+ return !!fn(...args);
4269
+ } catch (e) {
4270
+ return false
4271
+ }
4272
+ };
4273
+
4274
+ const factory = (env) => {
4275
+ env = utils$1.merge.call({
4276
+ skipUndefined: true
4277
+ }, globalFetchAPI, env);
4278
+
4279
+ const {fetch: envFetch, Request, Response} = env;
4280
+ const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
4281
+ const isRequestSupported = isFunction(Request);
4282
+ const isResponseSupported = isFunction(Response);
4283
+
4284
+ if (!isFetchSupported) {
4285
+ return false;
4286
+ }
4287
+
4288
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
4289
+
4290
+ const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
4291
+ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
4292
+ async (str) => new Uint8Array(await new Request(str).arrayBuffer())
4293
+ );
4294
+
4295
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
4296
+ let duplexAccessed = false;
4297
+
4298
+ const hasContentType = new Request(platform.origin, {
4299
+ body: new ReadableStream$1(),
4300
+ method: 'POST',
4301
+ get duplex() {
4302
+ duplexAccessed = true;
4303
+ return 'half';
4304
+ },
4305
+ }).headers.has('Content-Type');
4306
+
4307
+ return duplexAccessed && !hasContentType;
4308
+ });
4309
+
4310
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
4311
+ test(() => utils$1.isReadableStream(new Response('').body));
4312
+
4313
+ const resolvers = {
4314
+ stream: supportsResponseStream && ((res) => res.body)
4315
+ };
4316
+
4317
+ isFetchSupported && ((() => {
4318
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
4319
+ !resolvers[type] && (resolvers[type] = (res, config) => {
4320
+ let method = res && res[type];
4321
+
4322
+ if (method) {
4323
+ return method.call(res);
4324
+ }
4325
+
4326
+ throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
4327
+ });
4328
+ });
4329
+ })());
4330
+
4331
+ const getBodyLength = async (body) => {
4332
+ if (body == null) {
4333
+ return 0;
4334
+ }
4335
+
4336
+ if (utils$1.isBlob(body)) {
4337
+ return body.size;
4338
+ }
4339
+
4340
+ if (utils$1.isSpecCompliantForm(body)) {
4341
+ const _request = new Request(platform.origin, {
4342
+ method: 'POST',
4343
+ body,
4344
+ });
4345
+ return (await _request.arrayBuffer()).byteLength;
4346
+ }
4347
+
4348
+ if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
4349
+ return body.byteLength;
4350
+ }
4351
+
4352
+ if (utils$1.isURLSearchParams(body)) {
4353
+ body = body + '';
4354
+ }
4355
+
4356
+ if (utils$1.isString(body)) {
4357
+ return (await encodeText(body)).byteLength;
4358
+ }
4359
+ };
4360
+
4361
+ const resolveBodyLength = async (headers, body) => {
4362
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
4363
+
4364
+ return length == null ? getBodyLength(body) : length;
4365
+ };
4366
+
4367
+ return async (config) => {
4368
+ let {
4369
+ url,
4370
+ method,
4371
+ data,
4372
+ signal,
4373
+ cancelToken,
4374
+ timeout,
4375
+ onDownloadProgress,
4376
+ onUploadProgress,
4377
+ responseType,
4378
+ headers,
4379
+ withCredentials = 'same-origin',
4380
+ fetchOptions
4381
+ } = resolveConfig(config);
4382
+
4383
+ let _fetch = envFetch || fetch;
4384
+
4385
+ responseType = responseType ? (responseType + '').toLowerCase() : 'text';
4386
+
4387
+ let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
4388
+
4389
+ let request = null;
4390
+
4391
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
4392
+ composedSignal.unsubscribe();
4393
+ });
4394
+
4395
+ let requestContentLength;
4396
+
4397
+ try {
4398
+ if (
4399
+ onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
4400
+ (requestContentLength = await resolveBodyLength(headers, data)) !== 0
4401
+ ) {
4402
+ let _request = new Request(url, {
4403
+ method: 'POST',
4404
+ body: data,
4405
+ duplex: "half"
4406
+ });
4407
+
4408
+ let contentTypeHeader;
4409
+
4410
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
4411
+ headers.setContentType(contentTypeHeader);
4412
+ }
4413
+
4414
+ if (_request.body) {
4415
+ const [onProgress, flush] = progressEventDecorator(
4416
+ requestContentLength,
4417
+ progressEventReducer(asyncDecorator(onUploadProgress))
4418
+ );
4419
+
4420
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
4421
+ }
4422
+ }
4423
+
4424
+ if (!utils$1.isString(withCredentials)) {
4425
+ withCredentials = withCredentials ? 'include' : 'omit';
4426
+ }
4427
+
4428
+ // Cloudflare Workers throws when credentials are defined
4429
+ // see https://github.com/cloudflare/workerd/issues/902
4430
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
4431
+
4432
+ const resolvedOptions = {
4433
+ ...fetchOptions,
4434
+ signal: composedSignal,
4435
+ method: method.toUpperCase(),
4436
+ headers: headers.normalize().toJSON(),
4437
+ body: data,
4438
+ duplex: "half",
4439
+ credentials: isCredentialsSupported ? withCredentials : undefined
4440
+ };
4441
+
4442
+ request = isRequestSupported && new Request(url, resolvedOptions);
4443
+
4444
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
4445
+
4446
+ const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
4447
+
4448
+ if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
4449
+ const options = {};
4450
+
4451
+ ['status', 'statusText', 'headers'].forEach(prop => {
4452
+ options[prop] = response[prop];
4453
+ });
4454
+
4455
+ const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
4456
+
4457
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
4458
+ responseContentLength,
4459
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
4460
+ ) || [];
4461
+
4462
+ response = new Response(
4463
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
4464
+ flush && flush();
4465
+ unsubscribe && unsubscribe();
4466
+ }),
4467
+ options
4468
+ );
4469
+ }
4470
+
4471
+ responseType = responseType || 'text';
4472
+
4473
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
4474
+
4475
+ !isStreamResponse && unsubscribe && unsubscribe();
4476
+
4477
+ return await new Promise((resolve, reject) => {
4478
+ settle(resolve, reject, {
4479
+ data: responseData,
4480
+ headers: AxiosHeaders$1.from(response.headers),
4481
+ status: response.status,
4482
+ statusText: response.statusText,
4483
+ config,
4484
+ request
4485
+ });
4486
+ })
4487
+ } catch (err) {
4488
+ unsubscribe && unsubscribe();
4489
+
4490
+ if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
4491
+ throw Object.assign(
4492
+ new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
4493
+ {
4494
+ cause: err.cause || err
4495
+ }
4496
+ )
4497
+ }
4498
+
4499
+ throw AxiosError$1.from(err, err && err.code, config, request);
4500
+ }
4501
+ }
4502
+ };
4503
+
4504
+ const seedCache = new Map();
4505
+
4506
+ const getFetch = (config) => {
4507
+ let env = (config && config.env) || {};
4508
+ const {fetch, Request, Response} = env;
4509
+ const seeds = [
4510
+ Request, Response, fetch
4511
+ ];
4512
+
4513
+ let len = seeds.length, i = len,
4514
+ seed, target, map = seedCache;
4515
+
4516
+ while (i--) {
4517
+ seed = seeds[i];
4518
+ target = map.get(seed);
4519
+
4520
+ target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
4521
+
4522
+ map = target;
4523
+ }
4524
+
4525
+ return target;
4526
+ };
4527
+
4528
+ getFetch();
4529
+
4530
+ /**
4531
+ * Known adapters mapping.
4532
+ * Provides environment-specific adapters for Axios:
4533
+ * - `http` for Node.js
4534
+ * - `xhr` for browsers
4535
+ * - `fetch` for fetch API-based requests
4536
+ *
4537
+ * @type {Object<string, Function|Object>}
4538
+ */
4539
+ const knownAdapters = {
4540
+ http: httpAdapter,
4541
+ xhr: xhrAdapter,
4542
+ fetch: {
4543
+ get: getFetch,
4544
+ }
4545
+ };
4546
+
4547
+ // Assign adapter names for easier debugging and identification
4548
+ utils$1.forEach(knownAdapters, (fn, value) => {
4549
+ if (fn) {
4550
+ try {
4551
+ Object.defineProperty(fn, 'name', { value });
4552
+ } catch (e) {
4553
+ // eslint-disable-next-line no-empty
4554
+ }
4555
+ Object.defineProperty(fn, 'adapterName', { value });
4556
+ }
4557
+ });
4558
+
4559
+ /**
4560
+ * Render a rejection reason string for unknown or unsupported adapters
4561
+ *
4562
+ * @param {string} reason
4563
+ * @returns {string}
4564
+ */
4565
+ const renderReason = (reason) => `- ${reason}`;
4566
+
4567
+ /**
4568
+ * Check if the adapter is resolved (function, null, or false)
4569
+ *
4570
+ * @param {Function|null|false} adapter
4571
+ * @returns {boolean}
4572
+ */
4573
+ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
4574
+
4575
+ /**
4576
+ * Get the first suitable adapter from the provided list.
4577
+ * Tries each adapter in order until a supported one is found.
4578
+ * Throws an AxiosError if no adapter is suitable.
4579
+ *
4580
+ * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
4581
+ * @param {Object} config - Axios request configuration
4582
+ * @throws {AxiosError} If no suitable adapter is available
4583
+ * @returns {Function} The resolved adapter function
4584
+ */
4585
+ function getAdapter$1(adapters, config) {
4586
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
4587
+
4588
+ const { length } = adapters;
4589
+ let nameOrAdapter;
4590
+ let adapter;
4591
+
4592
+ const rejectedReasons = {};
4593
+
4594
+ for (let i = 0; i < length; i++) {
4595
+ nameOrAdapter = adapters[i];
4596
+ let id;
4597
+
4598
+ adapter = nameOrAdapter;
4599
+
4600
+ if (!isResolvedHandle(nameOrAdapter)) {
4601
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
4602
+
4603
+ if (adapter === undefined) {
4604
+ throw new AxiosError$1(`Unknown adapter '${id}'`);
4605
+ }
4606
+ }
4607
+
4608
+ if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
4609
+ break;
4610
+ }
4611
+
4612
+ rejectedReasons[id || '#' + i] = adapter;
4613
+ }
4614
+
4615
+ if (!adapter) {
4616
+ const reasons = Object.entries(rejectedReasons)
4617
+ .map(([id, state]) => `adapter ${id} ` +
4618
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
4619
+ );
4620
+
4621
+ let s = length ?
4622
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
4623
+ 'as no adapter specified';
4624
+
4625
+ throw new AxiosError$1(
4626
+ `There is no suitable adapter to dispatch the request ` + s,
4627
+ 'ERR_NOT_SUPPORT'
4628
+ );
4629
+ }
4630
+
4631
+ return adapter;
4632
+ }
4633
+
4634
+ /**
4635
+ * Exports Axios adapters and utility to resolve an adapter
4636
+ */
4637
+ var adapters = {
4638
+ /**
4639
+ * Resolve an adapter from a list of adapter names or functions.
4640
+ * @type {Function}
4641
+ */
4642
+ getAdapter: getAdapter$1,
4643
+
4644
+ /**
4645
+ * Exposes all known adapters
4646
+ * @type {Object<string, Function|Object>}
4647
+ */
4648
+ adapters: knownAdapters
4649
+ };
4650
+
4651
+ /**
4652
+ * Throws a `CanceledError` if cancellation has been requested.
4653
+ *
4654
+ * @param {Object} config The config that is to be used for the request
4655
+ *
4656
+ * @returns {void}
4657
+ */
4658
+ function throwIfCancellationRequested(config) {
4659
+ if (config.cancelToken) {
4660
+ config.cancelToken.throwIfRequested();
4661
+ }
4662
+
4663
+ if (config.signal && config.signal.aborted) {
4664
+ throw new CanceledError$1(null, config);
4665
+ }
4666
+ }
4667
+
4668
+ /**
4669
+ * Dispatch a request to the server using the configured adapter.
4670
+ *
4671
+ * @param {object} config The config that is to be used for the request
4672
+ *
4673
+ * @returns {Promise} The Promise to be fulfilled
4674
+ */
4675
+ function dispatchRequest(config) {
4676
+ throwIfCancellationRequested(config);
4677
+
4678
+ config.headers = AxiosHeaders$1.from(config.headers);
4679
+
4680
+ // Transform request data
4681
+ config.data = transformData.call(
4682
+ config,
4683
+ config.transformRequest
4684
+ );
4685
+
4686
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
4687
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
4688
+ }
4689
+
4690
+ const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
4691
+
4692
+ return adapter(config).then(function onAdapterResolution(response) {
4693
+ throwIfCancellationRequested(config);
4694
+
4695
+ // Transform response data
4696
+ response.data = transformData.call(
4697
+ config,
4698
+ config.transformResponse,
4699
+ response
4700
+ );
4701
+
4702
+ response.headers = AxiosHeaders$1.from(response.headers);
4703
+
4704
+ return response;
4705
+ }, function onAdapterRejection(reason) {
4706
+ if (!isCancel$1(reason)) {
4707
+ throwIfCancellationRequested(config);
4708
+
4709
+ // Transform response data
4710
+ if (reason && reason.response) {
4711
+ reason.response.data = transformData.call(
4712
+ config,
4713
+ config.transformResponse,
4714
+ reason.response
4715
+ );
4716
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
4717
+ }
4718
+ }
4719
+
4720
+ return Promise.reject(reason);
4721
+ });
4722
+ }
4723
+
4724
+ const VERSION$1 = "1.13.2";
4725
+
4726
+ const validators$1 = {};
4727
+
4728
+ // eslint-disable-next-line func-names
4729
+ ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
4730
+ validators$1[type] = function validator(thing) {
4731
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
4732
+ };
4733
+ });
4734
+
4735
+ const deprecatedWarnings = {};
4736
+
4737
+ /**
4738
+ * Transitional option validator
4739
+ *
4740
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
4741
+ * @param {string?} version - deprecated version / removed since version
4742
+ * @param {string?} message - some message with additional info
4743
+ *
4744
+ * @returns {function}
4745
+ */
4746
+ validators$1.transitional = function transitional(validator, version, message) {
4747
+ function formatMessage(opt, desc) {
4748
+ return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
4749
+ }
4750
+
4751
+ // eslint-disable-next-line func-names
4752
+ return (value, opt, opts) => {
4753
+ if (validator === false) {
4754
+ throw new AxiosError$1(
4755
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
4756
+ AxiosError$1.ERR_DEPRECATED
4757
+ );
4758
+ }
4759
+
4760
+ if (version && !deprecatedWarnings[opt]) {
4761
+ deprecatedWarnings[opt] = true;
4762
+ // eslint-disable-next-line no-console
4763
+ console.warn(
4764
+ formatMessage(
4765
+ opt,
4766
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
4767
+ )
4768
+ );
4769
+ }
4770
+
4771
+ return validator ? validator(value, opt, opts) : true;
4772
+ };
4773
+ };
4774
+
4775
+ validators$1.spelling = function spelling(correctSpelling) {
4776
+ return (value, opt) => {
4777
+ // eslint-disable-next-line no-console
4778
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
4779
+ return true;
4780
+ }
4781
+ };
4782
+
4783
+ /**
4784
+ * Assert object's properties type
4785
+ *
4786
+ * @param {object} options
4787
+ * @param {object} schema
4788
+ * @param {boolean?} allowUnknown
4789
+ *
4790
+ * @returns {object}
4791
+ */
4792
+
4793
+ function assertOptions(options, schema, allowUnknown) {
4794
+ if (typeof options !== 'object') {
4795
+ throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
4796
+ }
4797
+ const keys = Object.keys(options);
4798
+ let i = keys.length;
4799
+ while (i-- > 0) {
4800
+ const opt = keys[i];
4801
+ const validator = schema[opt];
4802
+ if (validator) {
4803
+ const value = options[opt];
4804
+ const result = value === undefined || validator(value, opt, options);
4805
+ if (result !== true) {
4806
+ throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
4807
+ }
4808
+ continue;
4809
+ }
4810
+ if (allowUnknown !== true) {
4811
+ throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
4812
+ }
4813
+ }
4814
+ }
4815
+
4816
+ var validator = {
4817
+ assertOptions,
4818
+ validators: validators$1
4819
+ };
4820
+
4821
+ const validators = validator.validators;
4822
+
4823
+ /**
4824
+ * Create a new instance of Axios
4825
+ *
4826
+ * @param {Object} instanceConfig The default config for the instance
4827
+ *
4828
+ * @return {Axios} A new instance of Axios
4829
+ */
4830
+ let Axios$1 = class Axios {
4831
+ constructor(instanceConfig) {
4832
+ this.defaults = instanceConfig || {};
4833
+ this.interceptors = {
4834
+ request: new InterceptorManager(),
4835
+ response: new InterceptorManager()
4836
+ };
4837
+ }
4838
+
4839
+ /**
4840
+ * Dispatch a request
4841
+ *
4842
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
4843
+ * @param {?Object} config
4844
+ *
4845
+ * @returns {Promise} The Promise to be fulfilled
4846
+ */
4847
+ async request(configOrUrl, config) {
4848
+ try {
4849
+ return await this._request(configOrUrl, config);
4850
+ } catch (err) {
4851
+ if (err instanceof Error) {
4852
+ let dummy = {};
4853
+
4854
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
4855
+
4856
+ // slice off the Error: ... line
4857
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
4858
+ try {
4859
+ if (!err.stack) {
4860
+ err.stack = stack;
4861
+ // match without the 2 top stack lines
4862
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
4863
+ err.stack += '\n' + stack;
4864
+ }
4865
+ } catch (e) {
4866
+ // ignore the case where "stack" is an un-writable property
4867
+ }
4868
+ }
4869
+
4870
+ throw err;
4871
+ }
4872
+ }
4873
+
4874
+ _request(configOrUrl, config) {
4875
+ /*eslint no-param-reassign:0*/
4876
+ // Allow for axios('example/url'[, config]) a la fetch API
4877
+ if (typeof configOrUrl === 'string') {
4878
+ config = config || {};
4879
+ config.url = configOrUrl;
4880
+ } else {
4881
+ config = configOrUrl || {};
4882
+ }
4883
+
4884
+ config = mergeConfig$1(this.defaults, config);
4885
+
4886
+ const {transitional, paramsSerializer, headers} = config;
4887
+
4888
+ if (transitional !== undefined) {
4889
+ validator.assertOptions(transitional, {
4890
+ silentJSONParsing: validators.transitional(validators.boolean),
4891
+ forcedJSONParsing: validators.transitional(validators.boolean),
4892
+ clarifyTimeoutError: validators.transitional(validators.boolean)
4893
+ }, false);
4894
+ }
4895
+
4896
+ if (paramsSerializer != null) {
4897
+ if (utils$1.isFunction(paramsSerializer)) {
4898
+ config.paramsSerializer = {
4899
+ serialize: paramsSerializer
4900
+ };
4901
+ } else {
4902
+ validator.assertOptions(paramsSerializer, {
4903
+ encode: validators.function,
4904
+ serialize: validators.function
4905
+ }, true);
4906
+ }
4907
+ }
4908
+
4909
+ // Set config.allowAbsoluteUrls
4910
+ if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
4911
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
4912
+ } else {
4913
+ config.allowAbsoluteUrls = true;
4914
+ }
4915
+
4916
+ validator.assertOptions(config, {
4917
+ baseUrl: validators.spelling('baseURL'),
4918
+ withXsrfToken: validators.spelling('withXSRFToken')
4919
+ }, true);
4920
+
4921
+ // Set config.method
4922
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
4923
+
4924
+ // Flatten headers
4925
+ let contextHeaders = headers && utils$1.merge(
4926
+ headers.common,
4927
+ headers[config.method]
4928
+ );
4929
+
4930
+ headers && utils$1.forEach(
4931
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
4932
+ (method) => {
4933
+ delete headers[method];
4934
+ }
4935
+ );
4936
+
4937
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
4938
+
4939
+ // filter out skipped interceptors
4940
+ const requestInterceptorChain = [];
4941
+ let synchronousRequestInterceptors = true;
4942
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
4943
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
4944
+ return;
4945
+ }
4946
+
4947
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
4948
+
4949
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
4950
+ });
4951
+
4952
+ const responseInterceptorChain = [];
4953
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
4954
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
4955
+ });
4956
+
4957
+ let promise;
4958
+ let i = 0;
4959
+ let len;
4960
+
4961
+ if (!synchronousRequestInterceptors) {
4962
+ const chain = [dispatchRequest.bind(this), undefined];
4963
+ chain.unshift(...requestInterceptorChain);
4964
+ chain.push(...responseInterceptorChain);
4965
+ len = chain.length;
4966
+
4967
+ promise = Promise.resolve(config);
4968
+
4969
+ while (i < len) {
4970
+ promise = promise.then(chain[i++], chain[i++]);
4971
+ }
4972
+
4973
+ return promise;
4974
+ }
4975
+
4976
+ len = requestInterceptorChain.length;
4977
+
4978
+ let newConfig = config;
4979
+
4980
+ while (i < len) {
4981
+ const onFulfilled = requestInterceptorChain[i++];
4982
+ const onRejected = requestInterceptorChain[i++];
4983
+ try {
4984
+ newConfig = onFulfilled(newConfig);
4985
+ } catch (error) {
4986
+ onRejected.call(this, error);
4987
+ break;
4988
+ }
4989
+ }
4990
+
4991
+ try {
4992
+ promise = dispatchRequest.call(this, newConfig);
4993
+ } catch (error) {
4994
+ return Promise.reject(error);
4995
+ }
4996
+
4997
+ i = 0;
4998
+ len = responseInterceptorChain.length;
4999
+
5000
+ while (i < len) {
5001
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
5002
+ }
5003
+
5004
+ return promise;
5005
+ }
5006
+
5007
+ getUri(config) {
5008
+ config = mergeConfig$1(this.defaults, config);
5009
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
5010
+ return buildURL(fullPath, config.params, config.paramsSerializer);
5011
+ }
5012
+ };
5013
+
5014
+ // Provide aliases for supported request methods
5015
+ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
5016
+ /*eslint func-names:0*/
5017
+ Axios$1.prototype[method] = function(url, config) {
5018
+ return this.request(mergeConfig$1(config || {}, {
5019
+ method,
5020
+ url,
5021
+ data: (config || {}).data
5022
+ }));
5023
+ };
5024
+ });
5025
+
5026
+ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
5027
+ /*eslint func-names:0*/
5028
+
5029
+ function generateHTTPMethod(isForm) {
5030
+ return function httpMethod(url, data, config) {
5031
+ return this.request(mergeConfig$1(config || {}, {
5032
+ method,
5033
+ headers: isForm ? {
5034
+ 'Content-Type': 'multipart/form-data'
5035
+ } : {},
5036
+ url,
5037
+ data
5038
+ }));
5039
+ };
5040
+ }
5041
+
5042
+ Axios$1.prototype[method] = generateHTTPMethod();
5043
+
5044
+ Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
5045
+ });
5046
+
5047
+ /**
5048
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
5049
+ *
5050
+ * @param {Function} executor The executor function.
5051
+ *
5052
+ * @returns {CancelToken}
5053
+ */
5054
+ let CancelToken$1 = class CancelToken {
5055
+ constructor(executor) {
5056
+ if (typeof executor !== 'function') {
5057
+ throw new TypeError('executor must be a function.');
5058
+ }
5059
+
5060
+ let resolvePromise;
5061
+
5062
+ this.promise = new Promise(function promiseExecutor(resolve) {
5063
+ resolvePromise = resolve;
5064
+ });
5065
+
5066
+ const token = this;
5067
+
5068
+ // eslint-disable-next-line func-names
5069
+ this.promise.then(cancel => {
5070
+ if (!token._listeners) return;
5071
+
5072
+ let i = token._listeners.length;
5073
+
5074
+ while (i-- > 0) {
5075
+ token._listeners[i](cancel);
5076
+ }
5077
+ token._listeners = null;
5078
+ });
5079
+
5080
+ // eslint-disable-next-line func-names
5081
+ this.promise.then = onfulfilled => {
5082
+ let _resolve;
5083
+ // eslint-disable-next-line func-names
5084
+ const promise = new Promise(resolve => {
5085
+ token.subscribe(resolve);
5086
+ _resolve = resolve;
5087
+ }).then(onfulfilled);
5088
+
5089
+ promise.cancel = function reject() {
5090
+ token.unsubscribe(_resolve);
5091
+ };
5092
+
5093
+ return promise;
5094
+ };
5095
+
5096
+ executor(function cancel(message, config, request) {
5097
+ if (token.reason) {
5098
+ // Cancellation has already been requested
5099
+ return;
5100
+ }
5101
+
5102
+ token.reason = new CanceledError$1(message, config, request);
5103
+ resolvePromise(token.reason);
5104
+ });
5105
+ }
5106
+
5107
+ /**
5108
+ * Throws a `CanceledError` if cancellation has been requested.
5109
+ */
5110
+ throwIfRequested() {
5111
+ if (this.reason) {
5112
+ throw this.reason;
5113
+ }
5114
+ }
5115
+
5116
+ /**
5117
+ * Subscribe to the cancel signal
5118
+ */
5119
+
5120
+ subscribe(listener) {
5121
+ if (this.reason) {
5122
+ listener(this.reason);
5123
+ return;
5124
+ }
5125
+
5126
+ if (this._listeners) {
5127
+ this._listeners.push(listener);
5128
+ } else {
5129
+ this._listeners = [listener];
5130
+ }
5131
+ }
5132
+
5133
+ /**
5134
+ * Unsubscribe from the cancel signal
5135
+ */
5136
+
5137
+ unsubscribe(listener) {
5138
+ if (!this._listeners) {
5139
+ return;
5140
+ }
5141
+ const index = this._listeners.indexOf(listener);
5142
+ if (index !== -1) {
5143
+ this._listeners.splice(index, 1);
5144
+ }
5145
+ }
5146
+
5147
+ toAbortSignal() {
5148
+ const controller = new AbortController();
5149
+
5150
+ const abort = (err) => {
5151
+ controller.abort(err);
5152
+ };
5153
+
5154
+ this.subscribe(abort);
5155
+
5156
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
5157
+
5158
+ return controller.signal;
5159
+ }
5160
+
5161
+ /**
5162
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
5163
+ * cancels the `CancelToken`.
5164
+ */
5165
+ static source() {
5166
+ let cancel;
5167
+ const token = new CancelToken(function executor(c) {
5168
+ cancel = c;
5169
+ });
5170
+ return {
5171
+ token,
5172
+ cancel
5173
+ };
5174
+ }
5175
+ };
5176
+
5177
+ /**
5178
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
5179
+ *
5180
+ * Common use case would be to use `Function.prototype.apply`.
5181
+ *
5182
+ * ```js
5183
+ * function f(x, y, z) {}
5184
+ * var args = [1, 2, 3];
5185
+ * f.apply(null, args);
5186
+ * ```
5187
+ *
5188
+ * With `spread` this example can be re-written.
5189
+ *
5190
+ * ```js
5191
+ * spread(function(x, y, z) {})([1, 2, 3]);
5192
+ * ```
5193
+ *
5194
+ * @param {Function} callback
5195
+ *
5196
+ * @returns {Function}
5197
+ */
5198
+ function spread$1(callback) {
5199
+ return function wrap(arr) {
5200
+ return callback.apply(null, arr);
5201
+ };
5202
+ }
5203
+
5204
+ /**
5205
+ * Determines whether the payload is an error thrown by Axios
5206
+ *
5207
+ * @param {*} payload The value to test
5208
+ *
5209
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
5210
+ */
5211
+ function isAxiosError$1(payload) {
5212
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
5213
+ }
5214
+
5215
+ const HttpStatusCode$1 = {
5216
+ Continue: 100,
5217
+ SwitchingProtocols: 101,
5218
+ Processing: 102,
5219
+ EarlyHints: 103,
5220
+ Ok: 200,
5221
+ Created: 201,
5222
+ Accepted: 202,
5223
+ NonAuthoritativeInformation: 203,
5224
+ NoContent: 204,
5225
+ ResetContent: 205,
5226
+ PartialContent: 206,
5227
+ MultiStatus: 207,
5228
+ AlreadyReported: 208,
5229
+ ImUsed: 226,
5230
+ MultipleChoices: 300,
5231
+ MovedPermanently: 301,
5232
+ Found: 302,
5233
+ SeeOther: 303,
5234
+ NotModified: 304,
5235
+ UseProxy: 305,
5236
+ Unused: 306,
5237
+ TemporaryRedirect: 307,
5238
+ PermanentRedirect: 308,
5239
+ BadRequest: 400,
5240
+ Unauthorized: 401,
5241
+ PaymentRequired: 402,
5242
+ Forbidden: 403,
5243
+ NotFound: 404,
5244
+ MethodNotAllowed: 405,
5245
+ NotAcceptable: 406,
5246
+ ProxyAuthenticationRequired: 407,
5247
+ RequestTimeout: 408,
5248
+ Conflict: 409,
5249
+ Gone: 410,
5250
+ LengthRequired: 411,
5251
+ PreconditionFailed: 412,
5252
+ PayloadTooLarge: 413,
5253
+ UriTooLong: 414,
5254
+ UnsupportedMediaType: 415,
5255
+ RangeNotSatisfiable: 416,
5256
+ ExpectationFailed: 417,
5257
+ ImATeapot: 418,
5258
+ MisdirectedRequest: 421,
5259
+ UnprocessableEntity: 422,
5260
+ Locked: 423,
5261
+ FailedDependency: 424,
5262
+ TooEarly: 425,
5263
+ UpgradeRequired: 426,
5264
+ PreconditionRequired: 428,
5265
+ TooManyRequests: 429,
5266
+ RequestHeaderFieldsTooLarge: 431,
5267
+ UnavailableForLegalReasons: 451,
5268
+ InternalServerError: 500,
5269
+ NotImplemented: 501,
5270
+ BadGateway: 502,
5271
+ ServiceUnavailable: 503,
5272
+ GatewayTimeout: 504,
5273
+ HttpVersionNotSupported: 505,
5274
+ VariantAlsoNegotiates: 506,
5275
+ InsufficientStorage: 507,
5276
+ LoopDetected: 508,
5277
+ NotExtended: 510,
5278
+ NetworkAuthenticationRequired: 511,
5279
+ WebServerIsDown: 521,
5280
+ ConnectionTimedOut: 522,
5281
+ OriginIsUnreachable: 523,
5282
+ TimeoutOccurred: 524,
5283
+ SslHandshakeFailed: 525,
5284
+ InvalidSslCertificate: 526,
5285
+ };
5286
+
5287
+ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
5288
+ HttpStatusCode$1[value] = key;
5289
+ });
5290
+
5291
+ /**
5292
+ * Create an instance of Axios
5293
+ *
5294
+ * @param {Object} defaultConfig The default config for the instance
5295
+ *
5296
+ * @returns {Axios} A new instance of Axios
5297
+ */
5298
+ function createInstance(defaultConfig) {
5299
+ const context = new Axios$1(defaultConfig);
5300
+ const instance = bind(Axios$1.prototype.request, context);
5301
+
5302
+ // Copy axios.prototype to instance
5303
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
5304
+
5305
+ // Copy context to instance
5306
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
5307
+
5308
+ // Factory for creating new instances
5309
+ instance.create = function create(instanceConfig) {
5310
+ return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
5311
+ };
5312
+
5313
+ return instance;
5314
+ }
5315
+
5316
+ // Create the default instance to be exported
5317
+ const axios = createInstance(defaults);
5318
+
5319
+ // Expose Axios class to allow class inheritance
5320
+ axios.Axios = Axios$1;
5321
+
5322
+ // Expose Cancel & CancelToken
5323
+ axios.CanceledError = CanceledError$1;
5324
+ axios.CancelToken = CancelToken$1;
5325
+ axios.isCancel = isCancel$1;
5326
+ axios.VERSION = VERSION$1;
5327
+ axios.toFormData = toFormData$1;
5328
+
5329
+ // Expose AxiosError class
5330
+ axios.AxiosError = AxiosError$1;
5331
+
5332
+ // alias for CanceledError for backward compatibility
5333
+ axios.Cancel = axios.CanceledError;
5334
+
5335
+ // Expose all/spread
5336
+ axios.all = function all(promises) {
5337
+ return Promise.all(promises);
5338
+ };
5339
+
5340
+ axios.spread = spread$1;
5341
+
5342
+ // Expose isAxiosError
5343
+ axios.isAxiosError = isAxiosError$1;
5344
+
5345
+ // Expose mergeConfig
5346
+ axios.mergeConfig = mergeConfig$1;
5347
+
5348
+ axios.AxiosHeaders = AxiosHeaders$1;
5349
+
5350
+ axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
5351
+
5352
+ axios.getAdapter = adapters.getAdapter;
5353
+
5354
+ axios.HttpStatusCode = HttpStatusCode$1;
5355
+
5356
+ axios.default = axios;
5357
+
5358
+ // This module is intended to unwrap Axios default export as named.
5359
+ // Keep top-level export same with static properties
5360
+ // so that it can keep same with es module or cjs
5361
+ const {
5362
+ Axios,
5363
+ AxiosError,
5364
+ CanceledError,
5365
+ isCancel,
5366
+ CancelToken,
5367
+ VERSION,
5368
+ all,
5369
+ Cancel,
5370
+ isAxiosError,
5371
+ spread,
5372
+ toFormData,
5373
+ AxiosHeaders,
5374
+ HttpStatusCode,
5375
+ formToJSON,
5376
+ getAdapter,
5377
+ mergeConfig
5378
+ } = axios;
5379
+
5380
+ var SubscriptionContext = /*#__PURE__*/React.createContext({
5381
+ status: 'loading'
5382
+ });
5383
+ var SubscriptionProvider = function SubscriptionProvider(_ref) {
5384
+ var children = _ref.children;
5385
+ var _useState = React.useState({
5386
+ status: 'loading'
5387
+ }),
5388
+ _useState2 = _slicedToArray(_useState, 2),
5389
+ state = _useState2[0],
5390
+ setState = _useState2[1];
5391
+ React.useEffect(function () {
5392
+ var controller = new AbortController();
5393
+ try {
5394
+ sdk.Account.verifySubscription({
5395
+ config: {
5396
+ signal: controller.signal,
5397
+ // AbortController supported in axios v1+
5398
+ timeout: 8000 // prevents hanging forever
5399
+ },
5400
+ onSuccess: function onSuccess(res) {
5401
+ setState({
5402
+ status: res === null || res === void 0 ? void 0 : res.data.status
5403
+ });
5404
+ },
5405
+ onError: function onError(err) {
5406
+ // Request cancelled
5407
+ if (axios.isCancel(err)) {
5408
+ throw err;
5409
+ }
5410
+
5411
+ // No response → server down or CORS or offline
5412
+ if (!err.response) {
5413
+ if (!navigator.onLine) throw 'OFFLINE';
5414
+ throw 'SERVER_DOWN';
5415
+ }
5416
+ if (err.response.status === 401) throw 'UNAUTHORIZED';
5417
+ if (err.response.status >= 500) throw 'SERVER_DOWN';
5418
+ throw 'UNKNOWN';
5419
+ }
5420
+ });
5421
+ } catch (reason) {
5422
+ if (reason !== 'AbortError') {
5423
+ setState({
5424
+ status: 'error',
5425
+ reason: reason !== null && reason !== void 0 ? reason : 'SERVER_DOWN'
5426
+ });
5427
+ }
5428
+ }
5429
+ return function () {
5430
+ return controller.abort();
5431
+ };
5432
+ }, []);
5433
+ return /*#__PURE__*/React.createElement(SubscriptionContext.Provider, {
5434
+ value: state
5435
+ }, children);
5436
+ };
5437
+
1469
5438
  var HuiProvider = function HuiProvider(_ref) {
1470
5439
  var themes = _ref.themes,
1471
5440
  themeType = _ref.themeType,
@@ -1510,7 +5479,7 @@ var HuiProvider = function HuiProvider(_ref) {
1510
5479
  }, /*#__PURE__*/React.createElement(ThemeProvider, {
1511
5480
  themes: themes,
1512
5481
  themeType: themeType
1513
- }, children, /*#__PURE__*/React.createElement(ToastContainer, null)));
5482
+ }, /*#__PURE__*/React.createElement(SubscriptionProvider, null, children), /*#__PURE__*/React.createElement(ToastContainer, null)));
1514
5483
  };
1515
5484
 
1516
5485
  /* "use client" */