yxuse 3.0.39 → 3.0.40

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.
Files changed (49) hide show
  1. package/lib/api.cjs.js +1 -1
  2. package/lib/api.es.js +9 -9
  3. package/lib/components.cjs.js +1 -1
  4. package/lib/components.es.js +11 -11
  5. package/lib/directives.cjs.js +1 -1
  6. package/lib/directives.es.js +2 -2
  7. package/lib/hooks.cjs.js +1 -1
  8. package/lib/hooks.es.js +2 -2
  9. package/lib/index.cjs.js +1 -1
  10. package/lib/index.cjs10.js +1 -1
  11. package/lib/index.cjs11.js +1 -3
  12. package/lib/index.cjs11.js.gz +0 -0
  13. package/lib/index.cjs12.js +1 -1
  14. package/lib/index.cjs13.js +1 -1
  15. package/lib/index.cjs2.js +1 -1
  16. package/lib/index.cjs3.js +1 -1
  17. package/lib/index.cjs4.js +1 -1
  18. package/lib/index.cjs5.js +8 -28
  19. package/lib/index.cjs5.js.gz +0 -0
  20. package/lib/index.cjs6.js +1 -1
  21. package/lib/index.cjs6.js.gz +0 -0
  22. package/lib/index.cjs7.js +1 -1
  23. package/lib/index.cjs9.js +1 -1
  24. package/lib/index.es.js +43 -39
  25. package/lib/index.es10.js +245 -241
  26. package/lib/index.es10.js.gz +0 -0
  27. package/lib/index.es11.js +1854 -1146
  28. package/lib/index.es11.js.gz +0 -0
  29. package/lib/index.es12.js +181 -103
  30. package/lib/index.es13.js +15 -12
  31. package/lib/index.es2.js +13 -13
  32. package/lib/index.es3.js +58 -40
  33. package/lib/index.es4.js +47 -37
  34. package/lib/index.es5.js +9697 -5929
  35. package/lib/index.es5.js.gz +0 -0
  36. package/lib/index.es6.js +821 -615
  37. package/lib/index.es6.js.gz +0 -0
  38. package/lib/index.es7.js +21 -17
  39. package/lib/index.es8.js +4 -4
  40. package/lib/index.es9.js +9 -7
  41. package/lib/theme.cjs.js +1 -1
  42. package/lib/theme.es.js +11 -11
  43. package/lib/translate.cjs.js +1 -1
  44. package/lib/translate.es.js +6 -6
  45. package/lib/utils.cjs.js +1 -1
  46. package/lib/utils.es.js +11 -11
  47. package/lib/yxIcon.cjs.js +1 -1
  48. package/lib/yxIcon.es.js +2 -2
  49. package/package.json +2 -1
package/lib/index.es11.js CHANGED
@@ -1,258 +1,416 @@
1
- var rt = Object.defineProperty;
2
- var we = Object.getOwnPropertySymbols;
3
- var st = Object.prototype.hasOwnProperty, ot = Object.prototype.propertyIsEnumerable;
4
- var Q = (e, t, n) => t in e ? rt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, U = (e, t) => {
5
- for (var n in t || (t = {}))
6
- st.call(t, n) && Q(e, n, t[n]);
7
- if (we)
8
- for (var n of we(t))
9
- ot.call(t, n) && Q(e, n, t[n]);
10
- return e;
11
- };
12
- var Y = (e, t, n) => (Q(e, typeof t != "symbol" ? t + "" : t, n), n);
13
- var M = (e, t, n) => new Promise((r, s) => {
14
- var i = (l) => {
15
- try {
16
- c(n.next(l));
17
- } catch (u) {
18
- s(u);
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
19
14
  }
20
- }, o = (l) => {
21
- try {
22
- c(n.throw(l));
23
- } catch (u) {
24
- s(u);
25
- }
26
- }, c = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(i, o);
27
- c((n = n.apply(e, t)).next());
28
- });
29
- import { ElMessage as S, ElLoading as it, ElNotification as Se } from "element-plus";
30
- function Ue(e, t) {
31
- return function() {
32
- return e.apply(t, arguments);
15
+ return a;
16
+ };
17
+ var __publicField = (obj, key, value) => {
18
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
19
+ return value;
20
+ };
21
+ var __async = (__this, __arguments, generator) => {
22
+ return new Promise((resolve, reject) => {
23
+ var fulfilled = (value) => {
24
+ try {
25
+ step(generator.next(value));
26
+ } catch (e) {
27
+ reject(e);
28
+ }
29
+ };
30
+ var rejected = (value) => {
31
+ try {
32
+ step(generator.throw(value));
33
+ } catch (e) {
34
+ reject(e);
35
+ }
36
+ };
37
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
38
+ step((generator = generator.apply(__this, __arguments)).next());
39
+ });
40
+ };
41
+ import { ElMessage, ElLoading, ElNotification } from "element-plus";
42
+ function bind(fn, thisArg) {
43
+ return function wrap() {
44
+ return fn.apply(thisArg, arguments);
33
45
  };
34
46
  }
35
- const { toString: _e } = Object.prototype, { getPrototypeOf: ce } = Object, ue = /* @__PURE__ */ ((e) => (t) => {
36
- const n = _e.call(t);
37
- return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
38
- })(/* @__PURE__ */ Object.create(null)), A = (e) => (e = e.toLowerCase(), (t) => ue(t) === e), G = (e) => (t) => typeof t === e, { isArray: L } = Array, F = G("undefined");
39
- function at(e) {
40
- return e !== null && !F(e) && e.constructor !== null && !F(e.constructor) && N(e.constructor.isBuffer) && e.constructor.isBuffer(e);
47
+ const { toString } = Object.prototype;
48
+ const { getPrototypeOf } = Object;
49
+ const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
50
+ const str = toString.call(thing);
51
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
52
+ })(/* @__PURE__ */ Object.create(null));
53
+ const kindOfTest = (type) => {
54
+ type = type.toLowerCase();
55
+ return (thing) => kindOf(thing) === type;
56
+ };
57
+ const typeOfTest = (type) => (thing) => typeof thing === type;
58
+ const { isArray } = Array;
59
+ const isUndefined = typeOfTest("undefined");
60
+ function isBuffer(val) {
61
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
41
62
  }
42
- const Be = A("ArrayBuffer");
43
- function ct(e) {
44
- let t;
45
- return typeof ArrayBuffer != "undefined" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Be(e.buffer), t;
63
+ const isArrayBuffer = kindOfTest("ArrayBuffer");
64
+ function isArrayBufferView(val) {
65
+ let result;
66
+ if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
67
+ result = ArrayBuffer.isView(val);
68
+ } else {
69
+ result = val && val.buffer && isArrayBuffer(val.buffer);
70
+ }
71
+ return result;
46
72
  }
47
- const ut = G("string"), N = G("function"), Fe = G("number"), le = (e) => e !== null && typeof e == "object", lt = (e) => e === !0 || e === !1, H = (e) => {
48
- if (ue(e) !== "object")
49
- return !1;
50
- const t = ce(e);
51
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
52
- }, ft = A("Date"), dt = A("File"), pt = A("Blob"), ht = A("FileList"), mt = (e) => le(e) && N(e.pipe), yt = (e) => {
53
- const t = "[object FormData]";
54
- return e && (typeof FormData == "function" && e instanceof FormData || _e.call(e) === t || N(e.toString) && e.toString() === t);
55
- }, Et = A("URLSearchParams"), wt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
56
- function D(e, t, { allOwnKeys: n = !1 } = {}) {
57
- if (e === null || typeof e == "undefined")
73
+ const isString = typeOfTest("string");
74
+ const isFunction = typeOfTest("function");
75
+ const isNumber = typeOfTest("number");
76
+ const isObject = (thing) => thing !== null && typeof thing === "object";
77
+ const isBoolean = (thing) => thing === true || thing === false;
78
+ const isPlainObject = (val) => {
79
+ if (kindOf(val) !== "object") {
80
+ return false;
81
+ }
82
+ const prototype2 = getPrototypeOf(val);
83
+ return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
84
+ };
85
+ const isDate = kindOfTest("Date");
86
+ const isFile = kindOfTest("File");
87
+ const isBlob = kindOfTest("Blob");
88
+ const isFileList = kindOfTest("FileList");
89
+ const isStream = (val) => isObject(val) && isFunction(val.pipe);
90
+ const isFormData = (thing) => {
91
+ const pattern = "[object FormData]";
92
+ return thing && (typeof FormData === "function" && thing instanceof FormData || toString.call(thing) === pattern || isFunction(thing.toString) && thing.toString() === pattern);
93
+ };
94
+ const isURLSearchParams = kindOfTest("URLSearchParams");
95
+ const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
96
+ function forEach(obj, fn, { allOwnKeys = false } = {}) {
97
+ if (obj === null || typeof obj === "undefined") {
58
98
  return;
59
- let r, s;
60
- if (typeof e != "object" && (e = [e]), L(e))
61
- for (r = 0, s = e.length; r < s; r++)
62
- t.call(null, e[r], r, e);
63
- else {
64
- const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), o = i.length;
65
- let c;
66
- for (r = 0; r < o; r++)
67
- c = i[r], t.call(null, e[c], c, e);
99
+ }
100
+ let i;
101
+ let l;
102
+ if (typeof obj !== "object") {
103
+ obj = [obj];
104
+ }
105
+ if (isArray(obj)) {
106
+ for (i = 0, l = obj.length; i < l; i++) {
107
+ fn.call(null, obj[i], i, obj);
108
+ }
109
+ } else {
110
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
111
+ const len = keys.length;
112
+ let key;
113
+ for (i = 0; i < len; i++) {
114
+ key = keys[i];
115
+ fn.call(null, obj[key], key, obj);
116
+ }
68
117
  }
69
118
  }
70
- function De(e, t) {
71
- t = t.toLowerCase();
72
- const n = Object.keys(e);
73
- let r = n.length, s;
74
- for (; r-- > 0; )
75
- if (s = n[r], t === s.toLowerCase())
76
- return s;
119
+ function findKey(obj, key) {
120
+ key = key.toLowerCase();
121
+ const keys = Object.keys(obj);
122
+ let i = keys.length;
123
+ let _key;
124
+ while (i-- > 0) {
125
+ _key = keys[i];
126
+ if (key === _key.toLowerCase()) {
127
+ return _key;
128
+ }
129
+ }
77
130
  return null;
78
131
  }
79
- const ke = typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : global, Ie = (e) => !F(e) && e !== ke;
80
- function re() {
81
- const { caseless: e } = Ie(this) && this || {}, t = {}, n = (r, s) => {
82
- const i = e && De(t, s) || s;
83
- H(t[i]) && H(r) ? t[i] = re(t[i], r) : H(r) ? t[i] = re({}, r) : L(r) ? t[i] = r.slice() : t[i] = r;
132
+ const _global = (() => {
133
+ if (typeof globalThis !== "undefined")
134
+ return globalThis;
135
+ return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
136
+ })();
137
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
138
+ function merge() {
139
+ const { caseless } = isContextDefined(this) && this || {};
140
+ const result = {};
141
+ const assignValue = (val, key) => {
142
+ const targetKey = caseless && findKey(result, key) || key;
143
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
144
+ result[targetKey] = merge(result[targetKey], val);
145
+ } else if (isPlainObject(val)) {
146
+ result[targetKey] = merge({}, val);
147
+ } else if (isArray(val)) {
148
+ result[targetKey] = val.slice();
149
+ } else {
150
+ result[targetKey] = val;
151
+ }
84
152
  };
85
- for (let r = 0, s = arguments.length; r < s; r++)
86
- arguments[r] && D(arguments[r], n);
87
- return t;
153
+ for (let i = 0, l = arguments.length; i < l; i++) {
154
+ arguments[i] && forEach(arguments[i], assignValue);
155
+ }
156
+ return result;
88
157
  }
89
- const St = (e, t, n, { allOwnKeys: r } = {}) => (D(t, (s, i) => {
90
- n && N(s) ? e[i] = Ue(s, n) : e[i] = s;
91
- }, { allOwnKeys: r }), e), bt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Rt = (e, t, n, r) => {
92
- e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
93
- value: t.prototype
94
- }), n && Object.assign(e.prototype, n);
95
- }, Ot = (e, t, n, r) => {
96
- let s, i, o;
97
- const c = {};
98
- if (t = t || {}, e == null)
99
- return t;
158
+ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
159
+ forEach(b, (val, key) => {
160
+ if (thisArg && isFunction(val)) {
161
+ a[key] = bind(val, thisArg);
162
+ } else {
163
+ a[key] = val;
164
+ }
165
+ }, { allOwnKeys });
166
+ return a;
167
+ };
168
+ const stripBOM = (content) => {
169
+ if (content.charCodeAt(0) === 65279) {
170
+ content = content.slice(1);
171
+ }
172
+ return content;
173
+ };
174
+ const inherits = (constructor, superConstructor, props, descriptors2) => {
175
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
176
+ constructor.prototype.constructor = constructor;
177
+ Object.defineProperty(constructor, "super", {
178
+ value: superConstructor.prototype
179
+ });
180
+ props && Object.assign(constructor.prototype, props);
181
+ };
182
+ const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
183
+ let props;
184
+ let i;
185
+ let prop;
186
+ const merged = {};
187
+ destObj = destObj || {};
188
+ if (sourceObj == null)
189
+ return destObj;
100
190
  do {
101
- for (s = Object.getOwnPropertyNames(e), i = s.length; i-- > 0; )
102
- o = s[i], (!r || r(o, e, t)) && !c[o] && (t[o] = e[o], c[o] = !0);
103
- e = n !== !1 && ce(e);
104
- } while (e && (!n || n(e, t)) && e !== Object.prototype);
105
- return t;
106
- }, gt = (e, t, n) => {
107
- e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
108
- const r = e.indexOf(t, n);
109
- return r !== -1 && r === n;
110
- }, At = (e) => {
111
- if (!e)
191
+ props = Object.getOwnPropertyNames(sourceObj);
192
+ i = props.length;
193
+ while (i-- > 0) {
194
+ prop = props[i];
195
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
196
+ destObj[prop] = sourceObj[prop];
197
+ merged[prop] = true;
198
+ }
199
+ }
200
+ sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
201
+ } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
202
+ return destObj;
203
+ };
204
+ const endsWith = (str, searchString, position) => {
205
+ str = String(str);
206
+ if (position === void 0 || position > str.length) {
207
+ position = str.length;
208
+ }
209
+ position -= searchString.length;
210
+ const lastIndex = str.indexOf(searchString, position);
211
+ return lastIndex !== -1 && lastIndex === position;
212
+ };
213
+ const toArray = (thing) => {
214
+ if (!thing)
112
215
  return null;
113
- if (L(e))
114
- return e;
115
- let t = e.length;
116
- if (!Fe(t))
216
+ if (isArray(thing))
217
+ return thing;
218
+ let i = thing.length;
219
+ if (!isNumber(i))
117
220
  return null;
118
- const n = new Array(t);
119
- for (; t-- > 0; )
120
- n[t] = e[t];
121
- return n;
122
- }, Tt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array != "undefined" && ce(Uint8Array)), Nt = (e, t) => {
123
- const r = (e && e[Symbol.iterator]).call(e);
124
- let s;
125
- for (; (s = r.next()) && !s.done; ) {
126
- const i = s.value;
127
- t.call(e, i[0], i[1]);
128
- }
129
- }, Pt = (e, t) => {
130
- let n;
131
- const r = [];
132
- for (; (n = e.exec(t)) !== null; )
133
- r.push(n);
134
- return r;
135
- }, xt = A("HTMLFormElement"), Ct = (e) => e.toLowerCase().replace(
136
- /[-_\s]([a-z\d])(\w*)/g,
137
- function(n, r, s) {
138
- return r.toUpperCase() + s;
139
- }
140
- ), be = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Lt = A("RegExp"), je = (e, t) => {
141
- const n = Object.getOwnPropertyDescriptors(e), r = {};
142
- D(n, (s, i) => {
143
- t(s, i, e) !== !1 && (r[i] = s);
144
- }), Object.defineProperties(e, r);
145
- }, Ut = (e) => {
146
- je(e, (t, n) => {
147
- if (N(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
148
- return !1;
149
- const r = e[n];
150
- if (N(r)) {
151
- if (t.enumerable = !1, "writable" in t) {
152
- t.writable = !1;
153
- return;
154
- }
155
- t.set || (t.set = () => {
156
- throw Error("Can not rewrite read-only method '" + n + "'");
157
- });
221
+ const arr = new Array(i);
222
+ while (i-- > 0) {
223
+ arr[i] = thing[i];
224
+ }
225
+ return arr;
226
+ };
227
+ const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
228
+ return (thing) => {
229
+ return TypedArray && thing instanceof TypedArray;
230
+ };
231
+ })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
232
+ const forEachEntry = (obj, fn) => {
233
+ const generator = obj && obj[Symbol.iterator];
234
+ const iterator = generator.call(obj);
235
+ let result;
236
+ while ((result = iterator.next()) && !result.done) {
237
+ const pair = result.value;
238
+ fn.call(obj, pair[0], pair[1]);
239
+ }
240
+ };
241
+ const matchAll = (regExp, str) => {
242
+ let matches;
243
+ const arr = [];
244
+ while ((matches = regExp.exec(str)) !== null) {
245
+ arr.push(matches);
246
+ }
247
+ return arr;
248
+ };
249
+ const isHTMLForm = kindOfTest("HTMLFormElement");
250
+ const toCamelCase = (str) => {
251
+ return str.toLowerCase().replace(
252
+ /[-_\s]([a-z\d])(\w*)/g,
253
+ function replacer(m, p1, p2) {
254
+ return p1.toUpperCase() + p2;
255
+ }
256
+ );
257
+ };
258
+ const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
259
+ const isRegExp = kindOfTest("RegExp");
260
+ const reduceDescriptors = (obj, reducer) => {
261
+ const descriptors2 = Object.getOwnPropertyDescriptors(obj);
262
+ const reducedDescriptors = {};
263
+ forEach(descriptors2, (descriptor, name) => {
264
+ if (reducer(descriptor, name, obj) !== false) {
265
+ reducedDescriptors[name] = descriptor;
158
266
  }
159
267
  });
160
- }, _t = (e, t) => {
161
- const n = {}, r = (s) => {
162
- s.forEach((i) => {
163
- n[i] = !0;
268
+ Object.defineProperties(obj, reducedDescriptors);
269
+ };
270
+ const freezeMethods = (obj) => {
271
+ reduceDescriptors(obj, (descriptor, name) => {
272
+ if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
273
+ return false;
274
+ }
275
+ const value = obj[name];
276
+ if (!isFunction(value))
277
+ return;
278
+ descriptor.enumerable = false;
279
+ if ("writable" in descriptor) {
280
+ descriptor.writable = false;
281
+ return;
282
+ }
283
+ if (!descriptor.set) {
284
+ descriptor.set = () => {
285
+ throw Error("Can not rewrite read-only method '" + name + "'");
286
+ };
287
+ }
288
+ });
289
+ };
290
+ const toObjectSet = (arrayOrString, delimiter) => {
291
+ const obj = {};
292
+ const define = (arr) => {
293
+ arr.forEach((value) => {
294
+ obj[value] = true;
164
295
  });
165
296
  };
166
- return L(e) ? r(e) : r(String(e).split(t)), n;
167
- }, Bt = () => {
168
- }, Ft = (e, t) => (e = +e, Number.isFinite(e) ? e : t), Z = "abcdefghijklmnopqrstuvwxyz", Re = "0123456789", Me = {
169
- DIGIT: Re,
170
- ALPHA: Z,
171
- ALPHA_DIGIT: Z + Z.toUpperCase() + Re
172
- }, Dt = (e = 16, t = Me.ALPHA_DIGIT) => {
173
- let n = "";
174
- const { length: r } = t;
175
- for (; e--; )
176
- n += t[Math.random() * r | 0];
177
- return n;
297
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
298
+ return obj;
299
+ };
300
+ const noop = () => {
301
+ };
302
+ const toFiniteNumber = (value, defaultValue) => {
303
+ value = +value;
304
+ return Number.isFinite(value) ? value : defaultValue;
178
305
  };
179
- function kt(e) {
180
- return !!(e && N(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
306
+ const ALPHA = "abcdefghijklmnopqrstuvwxyz";
307
+ const DIGIT = "0123456789";
308
+ const ALPHABET = {
309
+ DIGIT,
310
+ ALPHA,
311
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
312
+ };
313
+ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
314
+ let str = "";
315
+ const { length } = alphabet;
316
+ while (size--) {
317
+ str += alphabet[Math.random() * length | 0];
318
+ }
319
+ return str;
320
+ };
321
+ function isSpecCompliantForm(thing) {
322
+ return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
181
323
  }
182
- const It = (e) => {
183
- const t = new Array(10), n = (r, s) => {
184
- if (le(r)) {
185
- if (t.indexOf(r) >= 0)
324
+ const toJSONObject = (obj) => {
325
+ const stack = new Array(10);
326
+ const visit = (source, i) => {
327
+ if (isObject(source)) {
328
+ if (stack.indexOf(source) >= 0) {
186
329
  return;
187
- if (!("toJSON" in r)) {
188
- t[s] = r;
189
- const i = L(r) ? [] : {};
190
- return D(r, (o, c) => {
191
- const l = n(o, s + 1);
192
- !F(l) && (i[c] = l);
193
- }), t[s] = void 0, i;
330
+ }
331
+ if (!("toJSON" in source)) {
332
+ stack[i] = source;
333
+ const target = isArray(source) ? [] : {};
334
+ forEach(source, (value, key) => {
335
+ const reducedValue = visit(value, i + 1);
336
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
337
+ });
338
+ stack[i] = void 0;
339
+ return target;
194
340
  }
195
341
  }
196
- return r;
342
+ return source;
197
343
  };
198
- return n(e, 0);
199
- }, a = {
200
- isArray: L,
201
- isArrayBuffer: Be,
202
- isBuffer: at,
203
- isFormData: yt,
204
- isArrayBufferView: ct,
205
- isString: ut,
206
- isNumber: Fe,
207
- isBoolean: lt,
208
- isObject: le,
209
- isPlainObject: H,
210
- isUndefined: F,
211
- isDate: ft,
212
- isFile: dt,
213
- isBlob: pt,
214
- isRegExp: Lt,
215
- isFunction: N,
216
- isStream: mt,
217
- isURLSearchParams: Et,
218
- isTypedArray: Tt,
219
- isFileList: ht,
220
- forEach: D,
221
- merge: re,
222
- extend: St,
223
- trim: wt,
224
- stripBOM: bt,
225
- inherits: Rt,
226
- toFlatObject: Ot,
227
- kindOf: ue,
228
- kindOfTest: A,
229
- endsWith: gt,
230
- toArray: At,
231
- forEachEntry: Nt,
232
- matchAll: Pt,
233
- isHTMLForm: xt,
234
- hasOwnProperty: be,
235
- hasOwnProp: be,
344
+ return visit(obj, 0);
345
+ };
346
+ const utils = {
347
+ isArray,
348
+ isArrayBuffer,
349
+ isBuffer,
350
+ isFormData,
351
+ isArrayBufferView,
352
+ isString,
353
+ isNumber,
354
+ isBoolean,
355
+ isObject,
356
+ isPlainObject,
357
+ isUndefined,
358
+ isDate,
359
+ isFile,
360
+ isBlob,
361
+ isRegExp,
362
+ isFunction,
363
+ isStream,
364
+ isURLSearchParams,
365
+ isTypedArray,
366
+ isFileList,
367
+ forEach,
368
+ merge,
369
+ extend,
370
+ trim,
371
+ stripBOM,
372
+ inherits,
373
+ toFlatObject,
374
+ kindOf,
375
+ kindOfTest,
376
+ endsWith,
377
+ toArray,
378
+ forEachEntry,
379
+ matchAll,
380
+ isHTMLForm,
381
+ hasOwnProperty,
382
+ hasOwnProp: hasOwnProperty,
236
383
  // an alias to avoid ESLint no-prototype-builtins detection
237
- reduceDescriptors: je,
238
- freezeMethods: Ut,
239
- toObjectSet: _t,
240
- toCamelCase: Ct,
241
- noop: Bt,
242
- toFiniteNumber: Ft,
243
- findKey: De,
244
- global: ke,
245
- isContextDefined: Ie,
246
- ALPHABET: Me,
247
- generateString: Dt,
248
- isSpecCompliantForm: kt,
249
- toJSONObject: It
384
+ reduceDescriptors,
385
+ freezeMethods,
386
+ toObjectSet,
387
+ toCamelCase,
388
+ noop,
389
+ toFiniteNumber,
390
+ findKey,
391
+ global: _global,
392
+ isContextDefined,
393
+ ALPHABET,
394
+ generateString,
395
+ isSpecCompliantForm,
396
+ toJSONObject
250
397
  };
251
- function m(e, t, n, r, s) {
252
- Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), s && (this.response = s);
398
+ function AxiosError(message, code, config2, request, response) {
399
+ Error.call(this);
400
+ if (Error.captureStackTrace) {
401
+ Error.captureStackTrace(this, this.constructor);
402
+ } else {
403
+ this.stack = new Error().stack;
404
+ }
405
+ this.message = message;
406
+ this.name = "AxiosError";
407
+ code && (this.code = code);
408
+ config2 && (this.config = config2);
409
+ request && (this.request = request);
410
+ response && (this.response = response);
253
411
  }
254
- a.inherits(m, Error, {
255
- toJSON: function() {
412
+ utils.inherits(AxiosError, Error, {
413
+ toJSON: function toJSON() {
256
414
  return {
257
415
  // Standard
258
416
  message: this.message,
@@ -266,13 +424,14 @@ a.inherits(m, Error, {
266
424
  columnNumber: this.columnNumber,
267
425
  stack: this.stack,
268
426
  // Axios
269
- config: a.toJSONObject(this.config),
427
+ config: utils.toJSONObject(this.config),
270
428
  code: this.code,
271
429
  status: this.response && this.response.status ? this.response.status : null
272
430
  };
273
431
  }
274
432
  });
275
- const He = m.prototype, qe = {};
433
+ const prototype$1 = AxiosError.prototype;
434
+ const descriptors = {};
276
435
  [
277
436
  "ERR_BAD_OPTION_VALUE",
278
437
  "ERR_BAD_OPTION",
@@ -287,99 +446,139 @@ const He = m.prototype, qe = {};
287
446
  "ERR_NOT_SUPPORT",
288
447
  "ERR_INVALID_URL"
289
448
  // eslint-disable-next-line func-names
290
- ].forEach((e) => {
291
- qe[e] = { value: e };
449
+ ].forEach((code) => {
450
+ descriptors[code] = { value: code };
292
451
  });
293
- Object.defineProperties(m, qe);
294
- Object.defineProperty(He, "isAxiosError", { value: !0 });
295
- m.from = (e, t, n, r, s, i) => {
296
- const o = Object.create(He);
297
- return a.toFlatObject(e, o, function(l) {
298
- return l !== Error.prototype;
299
- }, (c) => c !== "isAxiosError"), m.call(o, e.message, t, n, r, s), o.cause = e, o.name = e.name, i && Object.assign(o, i), o;
452
+ Object.defineProperties(AxiosError, descriptors);
453
+ Object.defineProperty(prototype$1, "isAxiosError", { value: true });
454
+ AxiosError.from = (error, code, config2, request, response, customProps) => {
455
+ const axiosError = Object.create(prototype$1);
456
+ utils.toFlatObject(error, axiosError, function filter2(obj) {
457
+ return obj !== Error.prototype;
458
+ }, (prop) => {
459
+ return prop !== "isAxiosError";
460
+ });
461
+ AxiosError.call(axiosError, error.message, code, config2, request, response);
462
+ axiosError.cause = error;
463
+ axiosError.name = error.name;
464
+ customProps && Object.assign(axiosError, customProps);
465
+ return axiosError;
300
466
  };
301
- const jt = null;
302
- function se(e) {
303
- return a.isPlainObject(e) || a.isArray(e);
467
+ const httpAdapter = null;
468
+ function isVisitable(thing) {
469
+ return utils.isPlainObject(thing) || utils.isArray(thing);
304
470
  }
305
- function Je(e) {
306
- return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
471
+ function removeBrackets(key) {
472
+ return utils.endsWith(key, "[]") ? key.slice(0, -2) : key;
307
473
  }
308
- function Oe(e, t, n) {
309
- return e ? e.concat(t).map(function(s, i) {
310
- return s = Je(s), !n && i ? "[" + s + "]" : s;
311
- }).join(n ? "." : "") : t;
474
+ function renderKey(path, key, dots) {
475
+ if (!path)
476
+ return key;
477
+ return path.concat(key).map(function each(token, i) {
478
+ token = removeBrackets(token);
479
+ return !dots && i ? "[" + token + "]" : token;
480
+ }).join(dots ? "." : "");
312
481
  }
313
- function Mt(e) {
314
- return a.isArray(e) && !e.some(se);
482
+ function isFlatArray(arr) {
483
+ return utils.isArray(arr) && !arr.some(isVisitable);
315
484
  }
316
- const Ht = a.toFlatObject(a, {}, null, function(t) {
317
- return /^is[A-Z]/.test(t);
485
+ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
486
+ return /^is[A-Z]/.test(prop);
318
487
  });
319
- function $(e, t, n) {
320
- if (!a.isObject(e))
488
+ function toFormData(obj, formData, options) {
489
+ if (!utils.isObject(obj)) {
321
490
  throw new TypeError("target must be an object");
322
- t = t || new FormData(), n = a.toFlatObject(n, {
323
- metaTokens: !0,
324
- dots: !1,
325
- indexes: !1
326
- }, !1, function(h, O) {
327
- return !a.isUndefined(O[h]);
491
+ }
492
+ formData = formData || new FormData();
493
+ options = utils.toFlatObject(options, {
494
+ metaTokens: true,
495
+ dots: false,
496
+ indexes: false
497
+ }, false, function defined(option, source) {
498
+ return !utils.isUndefined(source[option]);
328
499
  });
329
- const r = n.metaTokens, s = n.visitor || f, i = n.dots, o = n.indexes, l = (n.Blob || typeof Blob != "undefined" && Blob) && a.isSpecCompliantForm(t);
330
- if (!a.isFunction(s))
500
+ const metaTokens = options.metaTokens;
501
+ const visitor = options.visitor || defaultVisitor;
502
+ const dots = options.dots;
503
+ const indexes = options.indexes;
504
+ const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
505
+ const useBlob = _Blob && utils.isSpecCompliantForm(formData);
506
+ if (!utils.isFunction(visitor)) {
331
507
  throw new TypeError("visitor must be a function");
332
- function u(d) {
333
- if (d === null)
508
+ }
509
+ function convertValue(value) {
510
+ if (value === null)
334
511
  return "";
335
- if (a.isDate(d))
336
- return d.toISOString();
337
- if (!l && a.isBlob(d))
338
- throw new m("Blob is not supported. Use a Buffer instead.");
339
- return a.isArrayBuffer(d) || a.isTypedArray(d) ? l && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
340
- }
341
- function f(d, h, O) {
342
- let b = d;
343
- if (d && !O && typeof d == "object") {
344
- if (a.endsWith(h, "{}"))
345
- h = r ? h : h.slice(0, -2), d = JSON.stringify(d);
346
- else if (a.isArray(d) && Mt(d) || (a.isFileList(d) || a.endsWith(h, "[]")) && (b = a.toArray(d)))
347
- return h = Je(h), b.forEach(function(j, nt) {
348
- !(a.isUndefined(j) || j === null) && t.append(
512
+ if (utils.isDate(value)) {
513
+ return value.toISOString();
514
+ }
515
+ if (!useBlob && utils.isBlob(value)) {
516
+ throw new AxiosError("Blob is not supported. Use a Buffer instead.");
517
+ }
518
+ if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
519
+ return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
520
+ }
521
+ return value;
522
+ }
523
+ function defaultVisitor(value, key, path) {
524
+ let arr = value;
525
+ if (value && !path && typeof value === "object") {
526
+ if (utils.endsWith(key, "{}")) {
527
+ key = metaTokens ? key : key.slice(0, -2);
528
+ value = JSON.stringify(value);
529
+ } else if (utils.isArray(value) && isFlatArray(value) || (utils.isFileList(value) || utils.endsWith(key, "[]")) && (arr = utils.toArray(value))) {
530
+ key = removeBrackets(key);
531
+ arr.forEach(function each(el, index2) {
532
+ !(utils.isUndefined(el) || el === null) && formData.append(
349
533
  // eslint-disable-next-line no-nested-ternary
350
- o === !0 ? Oe([h], nt, i) : o === null ? h : h + "[]",
351
- u(j)
534
+ indexes === true ? renderKey([key], index2, dots) : indexes === null ? key : key + "[]",
535
+ convertValue(el)
352
536
  );
353
- }), !1;
537
+ });
538
+ return false;
539
+ }
540
+ }
541
+ if (isVisitable(value)) {
542
+ return true;
354
543
  }
355
- return se(d) ? !0 : (t.append(Oe(O, h, i), u(d)), !1);
544
+ formData.append(renderKey(path, key, dots), convertValue(value));
545
+ return false;
356
546
  }
357
- const p = [], w = Object.assign(Ht, {
358
- defaultVisitor: f,
359
- convertValue: u,
360
- isVisitable: se
547
+ const stack = [];
548
+ const exposedHelpers = Object.assign(predicates, {
549
+ defaultVisitor,
550
+ convertValue,
551
+ isVisitable
361
552
  });
362
- function y(d, h) {
363
- if (!a.isUndefined(d)) {
364
- if (p.indexOf(d) !== -1)
365
- throw Error("Circular reference detected in " + h.join("."));
366
- p.push(d), a.forEach(d, function(b, P) {
367
- (!(a.isUndefined(b) || b === null) && s.call(
368
- t,
369
- b,
370
- a.isString(P) ? P.trim() : P,
371
- h,
372
- w
373
- )) === !0 && y(b, h ? h.concat(P) : [P]);
374
- }), p.pop();
375
- }
376
- }
377
- if (!a.isObject(e))
553
+ function build(value, path) {
554
+ if (utils.isUndefined(value))
555
+ return;
556
+ if (stack.indexOf(value) !== -1) {
557
+ throw Error("Circular reference detected in " + path.join("."));
558
+ }
559
+ stack.push(value);
560
+ utils.forEach(value, function each(el, key) {
561
+ const result = !(utils.isUndefined(el) || el === null) && visitor.call(
562
+ formData,
563
+ el,
564
+ utils.isString(key) ? key.trim() : key,
565
+ path,
566
+ exposedHelpers
567
+ );
568
+ if (result === true) {
569
+ build(el, path ? path.concat(key) : [key]);
570
+ }
571
+ });
572
+ stack.pop();
573
+ }
574
+ if (!utils.isObject(obj)) {
378
575
  throw new TypeError("data must be an object");
379
- return y(e), t;
576
+ }
577
+ build(obj);
578
+ return formData;
380
579
  }
381
- function ge(e) {
382
- const t = {
580
+ function encode$1(str) {
581
+ const charMap = {
383
582
  "!": "%21",
384
583
  "'": "%27",
385
584
  "(": "%28",
@@ -388,40 +587,51 @@ function ge(e) {
388
587
  "%20": "+",
389
588
  "%00": "\0"
390
589
  };
391
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
392
- return t[r];
590
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
591
+ return charMap[match];
393
592
  });
394
593
  }
395
- function fe(e, t) {
396
- this._pairs = [], e && $(e, this, t);
594
+ function AxiosURLSearchParams(params, options) {
595
+ this._pairs = [];
596
+ params && toFormData(params, this, options);
397
597
  }
398
- const ze = fe.prototype;
399
- ze.append = function(t, n) {
400
- this._pairs.push([t, n]);
598
+ const prototype = AxiosURLSearchParams.prototype;
599
+ prototype.append = function append(name, value) {
600
+ this._pairs.push([name, value]);
401
601
  };
402
- ze.toString = function(t) {
403
- const n = t ? function(r) {
404
- return t.call(this, r, ge);
405
- } : ge;
406
- return this._pairs.map(function(s) {
407
- return n(s[0]) + "=" + n(s[1]);
602
+ prototype.toString = function toString2(encoder) {
603
+ const _encode = encoder ? function(value) {
604
+ return encoder.call(this, value, encode$1);
605
+ } : encode$1;
606
+ return this._pairs.map(function each(pair) {
607
+ return _encode(pair[0]) + "=" + _encode(pair[1]);
408
608
  }, "").join("&");
409
609
  };
410
- function qt(e) {
411
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
610
+ function encode(val) {
611
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
412
612
  }
413
- function Ve(e, t, n) {
414
- if (!t)
415
- return e;
416
- const r = n && n.encode || qt, s = n && n.serialize;
417
- let i;
418
- if (s ? i = s(t, n) : i = a.isURLSearchParams(t) ? t.toString() : new fe(t, n).toString(r), i) {
419
- const o = e.indexOf("#");
420
- o !== -1 && (e = e.slice(0, o)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
613
+ function buildURL(url, params, options) {
614
+ if (!params) {
615
+ return url;
421
616
  }
422
- return e;
617
+ const _encode = options && options.encode || encode;
618
+ const serializeFn = options && options.serialize;
619
+ let serializedParams;
620
+ if (serializeFn) {
621
+ serializedParams = serializeFn(params, options);
622
+ } else {
623
+ serializedParams = utils.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
624
+ }
625
+ if (serializedParams) {
626
+ const hashmarkIndex = url.indexOf("#");
627
+ if (hashmarkIndex !== -1) {
628
+ url = url.slice(0, hashmarkIndex);
629
+ }
630
+ url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
631
+ }
632
+ return url;
423
633
  }
424
- class Ae {
634
+ class InterceptorManager {
425
635
  constructor() {
426
636
  this.handlers = [];
427
637
  }
@@ -433,13 +643,14 @@ class Ae {
433
643
  *
434
644
  * @return {Number} An ID used to remove interceptor later
435
645
  */
436
- use(t, n, r) {
437
- return this.handlers.push({
438
- fulfilled: t,
439
- rejected: n,
440
- synchronous: r ? r.synchronous : !1,
441
- runWhen: r ? r.runWhen : null
442
- }), this.handlers.length - 1;
646
+ use(fulfilled, rejected, options) {
647
+ this.handlers.push({
648
+ fulfilled,
649
+ rejected,
650
+ synchronous: options ? options.synchronous : false,
651
+ runWhen: options ? options.runWhen : null
652
+ });
653
+ return this.handlers.length - 1;
443
654
  }
444
655
  /**
445
656
  * Remove an interceptor from the stack
@@ -448,8 +659,10 @@ class Ae {
448
659
  *
449
660
  * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
450
661
  */
451
- eject(t) {
452
- this.handlers[t] && (this.handlers[t] = null);
662
+ eject(id) {
663
+ if (this.handlers[id]) {
664
+ this.handlers[id] = null;
665
+ }
453
666
  }
454
667
  /**
455
668
  * Clear all interceptors from the stack
@@ -457,7 +670,9 @@ class Ae {
457
670
  * @returns {void}
458
671
  */
459
672
  clear() {
460
- this.handlers && (this.handlers = []);
673
+ if (this.handlers) {
674
+ this.handlers = [];
675
+ }
461
676
  }
462
677
  /**
463
678
  * Iterate over all the registered interceptors
@@ -469,117 +684,185 @@ class Ae {
469
684
  *
470
685
  * @returns {void}
471
686
  */
472
- forEach(t) {
473
- a.forEach(this.handlers, function(r) {
474
- r !== null && t(r);
687
+ forEach(fn) {
688
+ utils.forEach(this.handlers, function forEachHandler(h) {
689
+ if (h !== null) {
690
+ fn(h);
691
+ }
475
692
  });
476
693
  }
477
694
  }
478
- const Ge = {
479
- silentJSONParsing: !0,
480
- forcedJSONParsing: !0,
481
- clarifyTimeoutError: !1
482
- }, Jt = typeof URLSearchParams != "undefined" ? URLSearchParams : fe, zt = typeof FormData != "undefined" ? FormData : null, Vt = (() => {
483
- let e;
484
- return typeof navigator != "undefined" && ((e = navigator.product) === "ReactNative" || e === "NativeScript" || e === "NS") ? !1 : typeof window != "undefined" && typeof document != "undefined";
485
- })(), Gt = typeof WorkerGlobalScope != "undefined" && // eslint-disable-next-line no-undef
486
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", R = {
487
- isBrowser: !0,
695
+ const transitionalDefaults = {
696
+ silentJSONParsing: true,
697
+ forcedJSONParsing: true,
698
+ clarifyTimeoutError: false
699
+ };
700
+ const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
701
+ const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
702
+ const isStandardBrowserEnv = (() => {
703
+ let product;
704
+ if (typeof navigator !== "undefined" && ((product = navigator.product) === "ReactNative" || product === "NativeScript" || product === "NS")) {
705
+ return false;
706
+ }
707
+ return typeof window !== "undefined" && typeof document !== "undefined";
708
+ })();
709
+ const isStandardBrowserWebWorkerEnv = (() => {
710
+ return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
711
+ self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
712
+ })();
713
+ const platform = {
714
+ isBrowser: true,
488
715
  classes: {
489
- URLSearchParams: Jt,
490
- FormData: zt,
716
+ URLSearchParams: URLSearchParams$1,
717
+ FormData: FormData$1,
491
718
  Blob
492
719
  },
493
- isStandardBrowserEnv: Vt,
494
- isStandardBrowserWebWorkerEnv: Gt,
720
+ isStandardBrowserEnv,
721
+ isStandardBrowserWebWorkerEnv,
495
722
  protocols: ["http", "https", "file", "blob", "url", "data"]
496
723
  };
497
- function $t(e, t) {
498
- return $(e, new R.classes.URLSearchParams(), Object.assign({
499
- visitor: function(n, r, s, i) {
500
- return R.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
724
+ function toURLEncodedForm(data, options) {
725
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
726
+ visitor: function(value, key, path, helpers) {
727
+ if (platform.isNode && utils.isBuffer(value)) {
728
+ this.append(key, value.toString("base64"));
729
+ return false;
730
+ }
731
+ return helpers.defaultVisitor.apply(this, arguments);
501
732
  }
502
- }, t));
733
+ }, options));
503
734
  }
504
- function vt(e) {
505
- return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
735
+ function parsePropPath(name) {
736
+ return utils.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
737
+ return match[0] === "[]" ? "" : match[1] || match[0];
738
+ });
506
739
  }
507
- function Kt(e) {
508
- const t = {}, n = Object.keys(e);
509
- let r;
510
- const s = n.length;
740
+ function arrayToObject(arr) {
741
+ const obj = {};
742
+ const keys = Object.keys(arr);
511
743
  let i;
512
- for (r = 0; r < s; r++)
513
- i = n[r], t[i] = e[i];
514
- return t;
744
+ const len = keys.length;
745
+ let key;
746
+ for (i = 0; i < len; i++) {
747
+ key = keys[i];
748
+ obj[key] = arr[key];
749
+ }
750
+ return obj;
515
751
  }
516
- function $e(e) {
517
- function t(n, r, s, i) {
518
- let o = n[i++];
519
- const c = Number.isFinite(+o), l = i >= n.length;
520
- return o = !o && a.isArray(s) ? s.length : o, l ? (a.hasOwnProp(s, o) ? s[o] = [s[o], r] : s[o] = r, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []), t(n, r, s[o], i) && a.isArray(s[o]) && (s[o] = Kt(s[o])), !c);
521
- }
522
- if (a.isFormData(e) && a.isFunction(e.entries)) {
523
- const n = {};
524
- return a.forEachEntry(e, (r, s) => {
525
- t(vt(r), s, n, 0);
526
- }), n;
752
+ function formDataToJSON(formData) {
753
+ function buildPath(path, value, target, index2) {
754
+ let name = path[index2++];
755
+ const isNumericKey = Number.isFinite(+name);
756
+ const isLast = index2 >= path.length;
757
+ name = !name && utils.isArray(target) ? target.length : name;
758
+ if (isLast) {
759
+ if (utils.hasOwnProp(target, name)) {
760
+ target[name] = [target[name], value];
761
+ } else {
762
+ target[name] = value;
763
+ }
764
+ return !isNumericKey;
765
+ }
766
+ if (!target[name] || !utils.isObject(target[name])) {
767
+ target[name] = [];
768
+ }
769
+ const result = buildPath(path, value, target[name], index2);
770
+ if (result && utils.isArray(target[name])) {
771
+ target[name] = arrayToObject(target[name]);
772
+ }
773
+ return !isNumericKey;
774
+ }
775
+ if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
776
+ const obj = {};
777
+ utils.forEachEntry(formData, (name, value) => {
778
+ buildPath(parsePropPath(name), value, obj, 0);
779
+ });
780
+ return obj;
527
781
  }
528
782
  return null;
529
783
  }
530
- const Wt = {
784
+ const DEFAULT_CONTENT_TYPE = {
531
785
  "Content-Type": void 0
532
786
  };
533
- function Xt(e, t, n) {
534
- if (a.isString(e))
787
+ function stringifySafely(rawValue, parser, encoder) {
788
+ if (utils.isString(rawValue)) {
535
789
  try {
536
- return (t || JSON.parse)(e), a.trim(e);
537
- } catch (r) {
538
- if (r.name !== "SyntaxError")
539
- throw r;
790
+ (parser || JSON.parse)(rawValue);
791
+ return utils.trim(rawValue);
792
+ } catch (e) {
793
+ if (e.name !== "SyntaxError") {
794
+ throw e;
795
+ }
540
796
  }
541
- return (n || JSON.stringify)(e);
797
+ }
798
+ return (encoder || JSON.stringify)(rawValue);
542
799
  }
543
- const v = {
544
- transitional: Ge,
800
+ const defaults = {
801
+ transitional: transitionalDefaults,
545
802
  adapter: ["xhr", "http"],
546
- transformRequest: [function(t, n) {
547
- const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, i = a.isObject(t);
548
- if (i && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
549
- return s && s ? JSON.stringify($e(t)) : t;
550
- if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t))
551
- return t;
552
- if (a.isArrayBufferView(t))
553
- return t.buffer;
554
- if (a.isURLSearchParams(t))
555
- return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
556
- let c;
557
- if (i) {
558
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
559
- return $t(t, this.formSerializer).toString();
560
- if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
561
- const l = this.env && this.env.FormData;
562
- return $(
563
- c ? { "files[]": t } : t,
564
- l && new l(),
803
+ transformRequest: [function transformRequest(data, headers) {
804
+ const contentType = headers.getContentType() || "";
805
+ const hasJSONContentType = contentType.indexOf("application/json") > -1;
806
+ const isObjectPayload = utils.isObject(data);
807
+ if (isObjectPayload && utils.isHTMLForm(data)) {
808
+ data = new FormData(data);
809
+ }
810
+ const isFormData2 = utils.isFormData(data);
811
+ if (isFormData2) {
812
+ if (!hasJSONContentType) {
813
+ return data;
814
+ }
815
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
816
+ }
817
+ if (utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {
818
+ return data;
819
+ }
820
+ if (utils.isArrayBufferView(data)) {
821
+ return data.buffer;
822
+ }
823
+ if (utils.isURLSearchParams(data)) {
824
+ headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
825
+ return data.toString();
826
+ }
827
+ let isFileList2;
828
+ if (isObjectPayload) {
829
+ if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
830
+ return toURLEncodedForm(data, this.formSerializer).toString();
831
+ }
832
+ if ((isFileList2 = utils.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
833
+ const _FormData = this.env && this.env.FormData;
834
+ return toFormData(
835
+ isFileList2 ? { "files[]": data } : data,
836
+ _FormData && new _FormData(),
565
837
  this.formSerializer
566
838
  );
567
839
  }
568
840
  }
569
- return i || s ? (n.setContentType("application/json", !1), Xt(t)) : t;
841
+ if (isObjectPayload || hasJSONContentType) {
842
+ headers.setContentType("application/json", false);
843
+ return stringifySafely(data);
844
+ }
845
+ return data;
570
846
  }],
571
- transformResponse: [function(t) {
572
- const n = this.transitional || v.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
573
- if (t && a.isString(t) && (r && !this.responseType || s)) {
574
- const o = !(n && n.silentJSONParsing) && s;
847
+ transformResponse: [function transformResponse(data) {
848
+ const transitional2 = this.transitional || defaults.transitional;
849
+ const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
850
+ const JSONRequested = this.responseType === "json";
851
+ if (data && utils.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
852
+ const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
853
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
575
854
  try {
576
- return JSON.parse(t);
577
- } catch (c) {
578
- if (o)
579
- throw c.name === "SyntaxError" ? m.from(c, m.ERR_BAD_RESPONSE, this, null, this.response) : c;
855
+ return JSON.parse(data);
856
+ } catch (e) {
857
+ if (strictJSONParsing) {
858
+ if (e.name === "SyntaxError") {
859
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
860
+ }
861
+ throw e;
862
+ }
580
863
  }
581
864
  }
582
- return t;
865
+ return data;
583
866
  }],
584
867
  /**
585
868
  * A timeout in milliseconds to abort a request. If set to 0 (default) a
@@ -591,25 +874,26 @@ const v = {
591
874
  maxContentLength: -1,
592
875
  maxBodyLength: -1,
593
876
  env: {
594
- FormData: R.classes.FormData,
595
- Blob: R.classes.Blob
877
+ FormData: platform.classes.FormData,
878
+ Blob: platform.classes.Blob
596
879
  },
597
- validateStatus: function(t) {
598
- return t >= 200 && t < 300;
880
+ validateStatus: function validateStatus(status) {
881
+ return status >= 200 && status < 300;
599
882
  },
600
883
  headers: {
601
884
  common: {
602
- Accept: "application/json, text/plain, */*"
885
+ "Accept": "application/json, text/plain, */*"
603
886
  }
604
887
  }
605
888
  };
606
- a.forEach(["delete", "get", "head"], function(t) {
607
- v.headers[t] = {};
889
+ utils.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
890
+ defaults.headers[method] = {};
608
891
  });
609
- a.forEach(["post", "put", "patch"], function(t) {
610
- v.headers[t] = a.merge(Wt);
892
+ utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
893
+ defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
611
894
  });
612
- const de = v, Qt = a.toObjectSet([
895
+ const defaults$1 = defaults;
896
+ const ignoreDuplicateOf = utils.toObjectSet([
613
897
  "age",
614
898
  "authorization",
615
899
  "content-length",
@@ -627,541 +911,794 @@ const de = v, Qt = a.toObjectSet([
627
911
  "referer",
628
912
  "retry-after",
629
913
  "user-agent"
630
- ]), Yt = (e) => {
631
- const t = {};
632
- let n, r, s;
633
- return e && e.split(`
634
- `).forEach(function(o) {
635
- s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.substring(s + 1).trim(), !(!n || t[n] && Qt[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
636
- }), t;
637
- }, Te = Symbol("internals");
638
- function _(e) {
639
- return e && String(e).trim().toLowerCase();
914
+ ]);
915
+ const parseHeaders = (rawHeaders) => {
916
+ const parsed = {};
917
+ let key;
918
+ let val;
919
+ let i;
920
+ rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
921
+ i = line.indexOf(":");
922
+ key = line.substring(0, i).trim().toLowerCase();
923
+ val = line.substring(i + 1).trim();
924
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
925
+ return;
926
+ }
927
+ if (key === "set-cookie") {
928
+ if (parsed[key]) {
929
+ parsed[key].push(val);
930
+ } else {
931
+ parsed[key] = [val];
932
+ }
933
+ } else {
934
+ parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
935
+ }
936
+ });
937
+ return parsed;
938
+ };
939
+ const $internals = Symbol("internals");
940
+ function normalizeHeader(header) {
941
+ return header && String(header).trim().toLowerCase();
640
942
  }
641
- function q(e) {
642
- return e === !1 || e == null ? e : a.isArray(e) ? e.map(q) : String(e);
943
+ function normalizeValue(value) {
944
+ if (value === false || value == null) {
945
+ return value;
946
+ }
947
+ return utils.isArray(value) ? value.map(normalizeValue) : String(value);
643
948
  }
644
- function Zt(e) {
645
- const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
646
- let r;
647
- for (; r = n.exec(e); )
648
- t[r[1]] = r[2];
649
- return t;
949
+ function parseTokens(str) {
950
+ const tokens = /* @__PURE__ */ Object.create(null);
951
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
952
+ let match;
953
+ while (match = tokensRE.exec(str)) {
954
+ tokens[match[1]] = match[2];
955
+ }
956
+ return tokens;
650
957
  }
651
- function en(e) {
652
- return /^[-_a-zA-Z]+$/.test(e.trim());
958
+ function isValidHeaderName(str) {
959
+ return /^[-_a-zA-Z]+$/.test(str.trim());
653
960
  }
654
- function ee(e, t, n, r, s) {
655
- if (a.isFunction(r))
656
- return r.call(this, t, n);
657
- if (s && (t = n), !!a.isString(t)) {
658
- if (a.isString(r))
659
- return t.indexOf(r) !== -1;
660
- if (a.isRegExp(r))
661
- return r.test(t);
961
+ function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
962
+ if (utils.isFunction(filter2)) {
963
+ return filter2.call(this, value, header);
964
+ }
965
+ if (isHeaderNameFilter) {
966
+ value = header;
967
+ }
968
+ if (!utils.isString(value))
969
+ return;
970
+ if (utils.isString(filter2)) {
971
+ return value.indexOf(filter2) !== -1;
972
+ }
973
+ if (utils.isRegExp(filter2)) {
974
+ return filter2.test(value);
662
975
  }
663
976
  }
664
- function tn(e) {
665
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
977
+ function formatHeader(header) {
978
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
979
+ return char.toUpperCase() + str;
980
+ });
666
981
  }
667
- function nn(e, t) {
668
- const n = a.toCamelCase(" " + t);
669
- ["get", "set", "has"].forEach((r) => {
670
- Object.defineProperty(e, r + n, {
671
- value: function(s, i, o) {
672
- return this[r].call(this, t, s, i, o);
982
+ function buildAccessors(obj, header) {
983
+ const accessorName = utils.toCamelCase(" " + header);
984
+ ["get", "set", "has"].forEach((methodName) => {
985
+ Object.defineProperty(obj, methodName + accessorName, {
986
+ value: function(arg1, arg2, arg3) {
987
+ return this[methodName].call(this, header, arg1, arg2, arg3);
673
988
  },
674
- configurable: !0
989
+ configurable: true
675
990
  });
676
991
  });
677
992
  }
678
- class K {
679
- constructor(t) {
680
- t && this.set(t);
681
- }
682
- set(t, n, r) {
683
- const s = this;
684
- function i(c, l, u) {
685
- const f = _(l);
686
- if (!f)
993
+ class AxiosHeaders {
994
+ constructor(headers) {
995
+ headers && this.set(headers);
996
+ }
997
+ set(header, valueOrRewrite, rewrite) {
998
+ const self2 = this;
999
+ function setHeader(_value, _header, _rewrite) {
1000
+ const lHeader = normalizeHeader(_header);
1001
+ if (!lHeader) {
687
1002
  throw new Error("header name must be a non-empty string");
688
- const p = a.findKey(s, f);
689
- (!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || l] = q(c));
690
- }
691
- const o = (c, l) => a.forEach(c, (u, f) => i(u, f, l));
692
- return a.isPlainObject(t) || t instanceof this.constructor ? o(t, n) : a.isString(t) && (t = t.trim()) && !en(t) ? o(Yt(t), n) : t != null && i(n, t, r), this;
693
- }
694
- get(t, n) {
695
- if (t = _(t), t) {
696
- const r = a.findKey(this, t);
697
- if (r) {
698
- const s = this[r];
699
- if (!n)
700
- return s;
701
- if (n === !0)
702
- return Zt(s);
703
- if (a.isFunction(n))
704
- return n.call(this, s, r);
705
- if (a.isRegExp(n))
706
- return n.exec(s);
1003
+ }
1004
+ const key = utils.findKey(self2, lHeader);
1005
+ if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
1006
+ self2[key || _header] = normalizeValue(_value);
1007
+ }
1008
+ }
1009
+ const setHeaders = (headers, _rewrite) => utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1010
+ if (utils.isPlainObject(header) || header instanceof this.constructor) {
1011
+ setHeaders(header, valueOrRewrite);
1012
+ } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1013
+ setHeaders(parseHeaders(header), valueOrRewrite);
1014
+ } else {
1015
+ header != null && setHeader(valueOrRewrite, header, rewrite);
1016
+ }
1017
+ return this;
1018
+ }
1019
+ get(header, parser) {
1020
+ header = normalizeHeader(header);
1021
+ if (header) {
1022
+ const key = utils.findKey(this, header);
1023
+ if (key) {
1024
+ const value = this[key];
1025
+ if (!parser) {
1026
+ return value;
1027
+ }
1028
+ if (parser === true) {
1029
+ return parseTokens(value);
1030
+ }
1031
+ if (utils.isFunction(parser)) {
1032
+ return parser.call(this, value, key);
1033
+ }
1034
+ if (utils.isRegExp(parser)) {
1035
+ return parser.exec(value);
1036
+ }
707
1037
  throw new TypeError("parser must be boolean|regexp|function");
708
1038
  }
709
1039
  }
710
1040
  }
711
- has(t, n) {
712
- if (t = _(t), t) {
713
- const r = a.findKey(this, t);
714
- return !!(r && this[r] !== void 0 && (!n || ee(this, this[r], r, n)));
1041
+ has(header, matcher) {
1042
+ header = normalizeHeader(header);
1043
+ if (header) {
1044
+ const key = utils.findKey(this, header);
1045
+ return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
715
1046
  }
716
- return !1;
1047
+ return false;
717
1048
  }
718
- delete(t, n) {
719
- const r = this;
720
- let s = !1;
721
- function i(o) {
722
- if (o = _(o), o) {
723
- const c = a.findKey(r, o);
724
- c && (!n || ee(r, r[c], c, n)) && (delete r[c], s = !0);
1049
+ delete(header, matcher) {
1050
+ const self2 = this;
1051
+ let deleted = false;
1052
+ function deleteHeader(_header) {
1053
+ _header = normalizeHeader(_header);
1054
+ if (_header) {
1055
+ const key = utils.findKey(self2, _header);
1056
+ if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
1057
+ delete self2[key];
1058
+ deleted = true;
1059
+ }
725
1060
  }
726
1061
  }
727
- return a.isArray(t) ? t.forEach(i) : i(t), s;
1062
+ if (utils.isArray(header)) {
1063
+ header.forEach(deleteHeader);
1064
+ } else {
1065
+ deleteHeader(header);
1066
+ }
1067
+ return deleted;
728
1068
  }
729
- clear(t) {
730
- const n = Object.keys(this);
731
- let r = n.length, s = !1;
732
- for (; r--; ) {
733
- const i = n[r];
734
- (!t || ee(this, this[i], i, t, !0)) && (delete this[i], s = !0);
1069
+ clear(matcher) {
1070
+ const keys = Object.keys(this);
1071
+ let i = keys.length;
1072
+ let deleted = false;
1073
+ while (i--) {
1074
+ const key = keys[i];
1075
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1076
+ delete this[key];
1077
+ deleted = true;
1078
+ }
735
1079
  }
736
- return s;
1080
+ return deleted;
737
1081
  }
738
- normalize(t) {
739
- const n = this, r = {};
740
- return a.forEach(this, (s, i) => {
741
- const o = a.findKey(r, i);
742
- if (o) {
743
- n[o] = q(s), delete n[i];
1082
+ normalize(format) {
1083
+ const self2 = this;
1084
+ const headers = {};
1085
+ utils.forEach(this, (value, header) => {
1086
+ const key = utils.findKey(headers, header);
1087
+ if (key) {
1088
+ self2[key] = normalizeValue(value);
1089
+ delete self2[header];
744
1090
  return;
745
1091
  }
746
- const c = t ? tn(i) : String(i).trim();
747
- c !== i && delete n[i], n[c] = q(s), r[c] = !0;
748
- }), this;
1092
+ const normalized = format ? formatHeader(header) : String(header).trim();
1093
+ if (normalized !== header) {
1094
+ delete self2[header];
1095
+ }
1096
+ self2[normalized] = normalizeValue(value);
1097
+ headers[normalized] = true;
1098
+ });
1099
+ return this;
749
1100
  }
750
- concat(...t) {
751
- return this.constructor.concat(this, ...t);
1101
+ concat(...targets) {
1102
+ return this.constructor.concat(this, ...targets);
752
1103
  }
753
- toJSON(t) {
754
- const n = /* @__PURE__ */ Object.create(null);
755
- return a.forEach(this, (r, s) => {
756
- r != null && r !== !1 && (n[s] = t && a.isArray(r) ? r.join(", ") : r);
757
- }), n;
1104
+ toJSON(asStrings) {
1105
+ const obj = /* @__PURE__ */ Object.create(null);
1106
+ utils.forEach(this, (value, header) => {
1107
+ value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(", ") : value);
1108
+ });
1109
+ return obj;
758
1110
  }
759
1111
  [Symbol.iterator]() {
760
1112
  return Object.entries(this.toJSON())[Symbol.iterator]();
761
1113
  }
762
1114
  toString() {
763
- return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
764
- `);
1115
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
765
1116
  }
766
1117
  get [Symbol.toStringTag]() {
767
1118
  return "AxiosHeaders";
768
1119
  }
769
- static from(t) {
770
- return t instanceof this ? t : new this(t);
1120
+ static from(thing) {
1121
+ return thing instanceof this ? thing : new this(thing);
771
1122
  }
772
- static concat(t, ...n) {
773
- const r = new this(t);
774
- return n.forEach((s) => r.set(s)), r;
1123
+ static concat(first, ...targets) {
1124
+ const computed = new this(first);
1125
+ targets.forEach((target) => computed.set(target));
1126
+ return computed;
775
1127
  }
776
- static accessor(t) {
777
- const r = (this[Te] = this[Te] = {
1128
+ static accessor(header) {
1129
+ const internals = this[$internals] = this[$internals] = {
778
1130
  accessors: {}
779
- }).accessors, s = this.prototype;
780
- function i(o) {
781
- const c = _(o);
782
- r[c] || (nn(s, o), r[c] = !0);
1131
+ };
1132
+ const accessors = internals.accessors;
1133
+ const prototype2 = this.prototype;
1134
+ function defineAccessor(_header) {
1135
+ const lHeader = normalizeHeader(_header);
1136
+ if (!accessors[lHeader]) {
1137
+ buildAccessors(prototype2, _header);
1138
+ accessors[lHeader] = true;
1139
+ }
783
1140
  }
784
- return a.isArray(t) ? t.forEach(i) : i(t), this;
1141
+ utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1142
+ return this;
785
1143
  }
786
1144
  }
787
- K.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
788
- a.freezeMethods(K.prototype);
789
- a.freezeMethods(K);
790
- const g = K;
791
- function te(e, t) {
792
- const n = this || de, r = t || n, s = g.from(r.headers);
793
- let i = r.data;
794
- return a.forEach(e, function(c) {
795
- i = c.call(n, i, s.normalize(), t ? t.status : void 0);
796
- }), s.normalize(), i;
1145
+ AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1146
+ utils.freezeMethods(AxiosHeaders.prototype);
1147
+ utils.freezeMethods(AxiosHeaders);
1148
+ const AxiosHeaders$1 = AxiosHeaders;
1149
+ function transformData(fns, response) {
1150
+ const config2 = this || defaults$1;
1151
+ const context = response || config2;
1152
+ const headers = AxiosHeaders$1.from(context.headers);
1153
+ let data = context.data;
1154
+ utils.forEach(fns, function transform(fn) {
1155
+ data = fn.call(config2, data, headers.normalize(), response ? response.status : void 0);
1156
+ });
1157
+ headers.normalize();
1158
+ return data;
797
1159
  }
798
- function ve(e) {
799
- return !!(e && e.__CANCEL__);
1160
+ function isCancel(value) {
1161
+ return !!(value && value.__CANCEL__);
800
1162
  }
801
- function k(e, t, n) {
802
- m.call(this, e == null ? "canceled" : e, m.ERR_CANCELED, t, n), this.name = "CanceledError";
1163
+ function CanceledError(message, config2, request) {
1164
+ AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config2, request);
1165
+ this.name = "CanceledError";
803
1166
  }
804
- a.inherits(k, m, {
805
- __CANCEL__: !0
1167
+ utils.inherits(CanceledError, AxiosError, {
1168
+ __CANCEL__: true
806
1169
  });
807
- function rn(e, t, n) {
808
- const r = n.config.validateStatus;
809
- !n.status || !r || r(n.status) ? e(n) : t(new m(
810
- "Request failed with status code " + n.status,
811
- [m.ERR_BAD_REQUEST, m.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
812
- n.config,
813
- n.request,
814
- n
815
- ));
1170
+ function settle(resolve, reject, response) {
1171
+ const validateStatus2 = response.config.validateStatus;
1172
+ if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
1173
+ resolve(response);
1174
+ } else {
1175
+ reject(new AxiosError(
1176
+ "Request failed with status code " + response.status,
1177
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
1178
+ response.config,
1179
+ response.request,
1180
+ response
1181
+ ));
1182
+ }
816
1183
  }
817
- const sn = R.isStandardBrowserEnv ? (
1184
+ const cookies = platform.isStandardBrowserEnv ? (
818
1185
  // Standard browser envs support document.cookie
819
- /* @__PURE__ */ function() {
1186
+ /* @__PURE__ */ function standardBrowserEnv() {
820
1187
  return {
821
- write: function(n, r, s, i, o, c) {
822
- const l = [];
823
- l.push(n + "=" + encodeURIComponent(r)), a.isNumber(s) && l.push("expires=" + new Date(s).toGMTString()), a.isString(i) && l.push("path=" + i), a.isString(o) && l.push("domain=" + o), c === !0 && l.push("secure"), document.cookie = l.join("; ");
1188
+ write: function write(name, value, expires, path, domain, secure) {
1189
+ const cookie = [];
1190
+ cookie.push(name + "=" + encodeURIComponent(value));
1191
+ if (utils.isNumber(expires)) {
1192
+ cookie.push("expires=" + new Date(expires).toGMTString());
1193
+ }
1194
+ if (utils.isString(path)) {
1195
+ cookie.push("path=" + path);
1196
+ }
1197
+ if (utils.isString(domain)) {
1198
+ cookie.push("domain=" + domain);
1199
+ }
1200
+ if (secure === true) {
1201
+ cookie.push("secure");
1202
+ }
1203
+ document.cookie = cookie.join("; ");
824
1204
  },
825
- read: function(n) {
826
- const r = document.cookie.match(new RegExp("(^|;\\s*)(" + n + ")=([^;]*)"));
827
- return r ? decodeURIComponent(r[3]) : null;
1205
+ read: function read(name) {
1206
+ const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
1207
+ return match ? decodeURIComponent(match[3]) : null;
828
1208
  },
829
- remove: function(n) {
830
- this.write(n, "", Date.now() - 864e5);
1209
+ remove: function remove(name) {
1210
+ this.write(name, "", Date.now() - 864e5);
831
1211
  }
832
1212
  };
833
1213
  }()
834
1214
  ) : (
835
1215
  // Non standard browser env (web workers, react-native) lack needed support.
836
- /* @__PURE__ */ function() {
1216
+ /* @__PURE__ */ function nonStandardBrowserEnv() {
837
1217
  return {
838
- write: function() {
1218
+ write: function write() {
839
1219
  },
840
- read: function() {
1220
+ read: function read() {
841
1221
  return null;
842
1222
  },
843
- remove: function() {
1223
+ remove: function remove() {
844
1224
  }
845
1225
  };
846
1226
  }()
847
1227
  );
848
- function on(e) {
849
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1228
+ function isAbsoluteURL(url) {
1229
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
850
1230
  }
851
- function an(e, t) {
852
- return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
1231
+ function combineURLs(baseURL, relativeURL) {
1232
+ return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
853
1233
  }
854
- function Ke(e, t) {
855
- return e && !on(t) ? an(e, t) : t;
1234
+ function buildFullPath(baseURL, requestedURL) {
1235
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
1236
+ return combineURLs(baseURL, requestedURL);
1237
+ }
1238
+ return requestedURL;
856
1239
  }
857
- const cn = R.isStandardBrowserEnv ? (
1240
+ const isURLSameOrigin = platform.isStandardBrowserEnv ? (
858
1241
  // Standard browser envs have full support of the APIs needed to test
859
1242
  // whether the request URL is of the same origin as current location.
860
- function() {
861
- const t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
862
- let r;
863
- function s(i) {
864
- let o = i;
865
- return t && (n.setAttribute("href", o), o = n.href), n.setAttribute("href", o), {
866
- href: n.href,
867
- protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
868
- host: n.host,
869
- search: n.search ? n.search.replace(/^\?/, "") : "",
870
- hash: n.hash ? n.hash.replace(/^#/, "") : "",
871
- hostname: n.hostname,
872
- port: n.port,
873
- pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
1243
+ function standardBrowserEnv2() {
1244
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
1245
+ const urlParsingNode = document.createElement("a");
1246
+ let originURL;
1247
+ function resolveURL(url) {
1248
+ let href = url;
1249
+ if (msie) {
1250
+ urlParsingNode.setAttribute("href", href);
1251
+ href = urlParsingNode.href;
1252
+ }
1253
+ urlParsingNode.setAttribute("href", href);
1254
+ return {
1255
+ href: urlParsingNode.href,
1256
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
1257
+ host: urlParsingNode.host,
1258
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
1259
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
1260
+ hostname: urlParsingNode.hostname,
1261
+ port: urlParsingNode.port,
1262
+ pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
874
1263
  };
875
1264
  }
876
- return r = s(window.location.href), function(o) {
877
- const c = a.isString(o) ? s(o) : o;
878
- return c.protocol === r.protocol && c.host === r.host;
1265
+ originURL = resolveURL(window.location.href);
1266
+ return function isURLSameOrigin2(requestURL) {
1267
+ const parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
1268
+ return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
879
1269
  };
880
1270
  }()
881
1271
  ) : (
882
1272
  // Non standard browser envs (web workers, react-native) lack needed support.
883
- /* @__PURE__ */ function() {
884
- return function() {
885
- return !0;
1273
+ /* @__PURE__ */ function nonStandardBrowserEnv2() {
1274
+ return function isURLSameOrigin2() {
1275
+ return true;
886
1276
  };
887
1277
  }()
888
1278
  );
889
- function un(e) {
890
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
891
- return t && t[1] || "";
1279
+ function parseProtocol(url) {
1280
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
1281
+ return match && match[1] || "";
892
1282
  }
893
- function ln(e, t) {
894
- e = e || 10;
895
- const n = new Array(e), r = new Array(e);
896
- let s = 0, i = 0, o;
897
- return t = t !== void 0 ? t : 1e3, function(l) {
898
- const u = Date.now(), f = r[i];
899
- o || (o = u), n[s] = l, r[s] = u;
900
- let p = i, w = 0;
901
- for (; p !== s; )
902
- w += n[p++], p = p % e;
903
- if (s = (s + 1) % e, s === i && (i = (i + 1) % e), u - o < t)
1283
+ function speedometer(samplesCount, min) {
1284
+ samplesCount = samplesCount || 10;
1285
+ const bytes = new Array(samplesCount);
1286
+ const timestamps = new Array(samplesCount);
1287
+ let head = 0;
1288
+ let tail = 0;
1289
+ let firstSampleTS;
1290
+ min = min !== void 0 ? min : 1e3;
1291
+ return function push(chunkLength) {
1292
+ const now = Date.now();
1293
+ const startedAt = timestamps[tail];
1294
+ if (!firstSampleTS) {
1295
+ firstSampleTS = now;
1296
+ }
1297
+ bytes[head] = chunkLength;
1298
+ timestamps[head] = now;
1299
+ let i = tail;
1300
+ let bytesCount = 0;
1301
+ while (i !== head) {
1302
+ bytesCount += bytes[i++];
1303
+ i = i % samplesCount;
1304
+ }
1305
+ head = (head + 1) % samplesCount;
1306
+ if (head === tail) {
1307
+ tail = (tail + 1) % samplesCount;
1308
+ }
1309
+ if (now - firstSampleTS < min) {
904
1310
  return;
905
- const y = f && u - f;
906
- return y ? Math.round(w * 1e3 / y) : void 0;
1311
+ }
1312
+ const passed = startedAt && now - startedAt;
1313
+ return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
907
1314
  };
908
1315
  }
909
- function Ne(e, t) {
910
- let n = 0;
911
- const r = ln(50, 250);
912
- return (s) => {
913
- const i = s.loaded, o = s.lengthComputable ? s.total : void 0, c = i - n, l = r(c), u = i <= o;
914
- n = i;
915
- const f = {
916
- loaded: i,
917
- total: o,
918
- progress: o ? i / o : void 0,
919
- bytes: c,
920
- rate: l || void 0,
921
- estimated: l && o && u ? (o - i) / l : void 0,
922
- event: s
1316
+ function progressEventReducer(listener, isDownloadStream) {
1317
+ let bytesNotified = 0;
1318
+ const _speedometer = speedometer(50, 250);
1319
+ return (e) => {
1320
+ const loaded = e.loaded;
1321
+ const total = e.lengthComputable ? e.total : void 0;
1322
+ const progressBytes = loaded - bytesNotified;
1323
+ const rate = _speedometer(progressBytes);
1324
+ const inRange = loaded <= total;
1325
+ bytesNotified = loaded;
1326
+ const data = {
1327
+ loaded,
1328
+ total,
1329
+ progress: total ? loaded / total : void 0,
1330
+ bytes: progressBytes,
1331
+ rate: rate ? rate : void 0,
1332
+ estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
1333
+ event: e
923
1334
  };
924
- f[t ? "download" : "upload"] = !0, e(f);
1335
+ data[isDownloadStream ? "download" : "upload"] = true;
1336
+ listener(data);
925
1337
  };
926
1338
  }
927
- const fn = typeof XMLHttpRequest != "undefined", dn = fn && function(e) {
928
- return new Promise(function(n, r) {
929
- let s = e.data;
930
- const i = g.from(e.headers).normalize(), o = e.responseType;
931
- let c;
932
- function l() {
933
- e.cancelToken && e.cancelToken.unsubscribe(c), e.signal && e.signal.removeEventListener("abort", c);
934
- }
935
- a.isFormData(s) && (R.isStandardBrowserEnv || R.isStandardBrowserWebWorkerEnv) && i.setContentType(!1);
936
- let u = new XMLHttpRequest();
937
- if (e.auth) {
938
- const y = e.auth.username || "", d = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
939
- i.set("Authorization", "Basic " + btoa(y + ":" + d));
940
- }
941
- const f = Ke(e.baseURL, e.url);
942
- u.open(e.method.toUpperCase(), Ve(f, e.params, e.paramsSerializer), !0), u.timeout = e.timeout;
943
- function p() {
944
- if (!u)
1339
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
1340
+ const xhrAdapter = isXHRAdapterSupported && function(config2) {
1341
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
1342
+ let requestData = config2.data;
1343
+ const requestHeaders = AxiosHeaders$1.from(config2.headers).normalize();
1344
+ const responseType = config2.responseType;
1345
+ let onCanceled;
1346
+ function done() {
1347
+ if (config2.cancelToken) {
1348
+ config2.cancelToken.unsubscribe(onCanceled);
1349
+ }
1350
+ if (config2.signal) {
1351
+ config2.signal.removeEventListener("abort", onCanceled);
1352
+ }
1353
+ }
1354
+ if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
1355
+ requestHeaders.setContentType(false);
1356
+ }
1357
+ let request = new XMLHttpRequest();
1358
+ if (config2.auth) {
1359
+ const username = config2.auth.username || "";
1360
+ const password = config2.auth.password ? unescape(encodeURIComponent(config2.auth.password)) : "";
1361
+ requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
1362
+ }
1363
+ const fullPath = buildFullPath(config2.baseURL, config2.url);
1364
+ request.open(config2.method.toUpperCase(), buildURL(fullPath, config2.params, config2.paramsSerializer), true);
1365
+ request.timeout = config2.timeout;
1366
+ function onloadend() {
1367
+ if (!request) {
945
1368
  return;
946
- const y = g.from(
947
- "getAllResponseHeaders" in u && u.getAllResponseHeaders()
948
- ), h = {
949
- data: !o || o === "text" || o === "json" ? u.responseText : u.response,
950
- status: u.status,
951
- statusText: u.statusText,
952
- headers: y,
953
- config: e,
954
- request: u
1369
+ }
1370
+ const responseHeaders = AxiosHeaders$1.from(
1371
+ "getAllResponseHeaders" in request && request.getAllResponseHeaders()
1372
+ );
1373
+ const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
1374
+ const response = {
1375
+ data: responseData,
1376
+ status: request.status,
1377
+ statusText: request.statusText,
1378
+ headers: responseHeaders,
1379
+ config: config2,
1380
+ request
1381
+ };
1382
+ settle(function _resolve(value) {
1383
+ resolve(value);
1384
+ done();
1385
+ }, function _reject(err) {
1386
+ reject(err);
1387
+ done();
1388
+ }, response);
1389
+ request = null;
1390
+ }
1391
+ if ("onloadend" in request) {
1392
+ request.onloadend = onloadend;
1393
+ } else {
1394
+ request.onreadystatechange = function handleLoad() {
1395
+ if (!request || request.readyState !== 4) {
1396
+ return;
1397
+ }
1398
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
1399
+ return;
1400
+ }
1401
+ setTimeout(onloadend);
1402
+ };
1403
+ }
1404
+ request.onabort = function handleAbort() {
1405
+ if (!request) {
1406
+ return;
1407
+ }
1408
+ reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config2, request));
1409
+ request = null;
1410
+ };
1411
+ request.onerror = function handleError() {
1412
+ reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config2, request));
1413
+ request = null;
1414
+ };
1415
+ request.ontimeout = function handleTimeout() {
1416
+ let timeoutErrorMessage = config2.timeout ? "timeout of " + config2.timeout + "ms exceeded" : "timeout exceeded";
1417
+ const transitional2 = config2.transitional || transitionalDefaults;
1418
+ if (config2.timeoutErrorMessage) {
1419
+ timeoutErrorMessage = config2.timeoutErrorMessage;
1420
+ }
1421
+ reject(new AxiosError(
1422
+ timeoutErrorMessage,
1423
+ transitional2.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
1424
+ config2,
1425
+ request
1426
+ ));
1427
+ request = null;
1428
+ };
1429
+ if (platform.isStandardBrowserEnv) {
1430
+ const xsrfValue = (config2.withCredentials || isURLSameOrigin(fullPath)) && config2.xsrfCookieName && cookies.read(config2.xsrfCookieName);
1431
+ if (xsrfValue) {
1432
+ requestHeaders.set(config2.xsrfHeaderName, xsrfValue);
1433
+ }
1434
+ }
1435
+ requestData === void 0 && requestHeaders.setContentType(null);
1436
+ if ("setRequestHeader" in request) {
1437
+ utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
1438
+ request.setRequestHeader(key, val);
1439
+ });
1440
+ }
1441
+ if (!utils.isUndefined(config2.withCredentials)) {
1442
+ request.withCredentials = !!config2.withCredentials;
1443
+ }
1444
+ if (responseType && responseType !== "json") {
1445
+ request.responseType = config2.responseType;
1446
+ }
1447
+ if (typeof config2.onDownloadProgress === "function") {
1448
+ request.addEventListener("progress", progressEventReducer(config2.onDownloadProgress, true));
1449
+ }
1450
+ if (typeof config2.onUploadProgress === "function" && request.upload) {
1451
+ request.upload.addEventListener("progress", progressEventReducer(config2.onUploadProgress));
1452
+ }
1453
+ if (config2.cancelToken || config2.signal) {
1454
+ onCanceled = (cancel) => {
1455
+ if (!request) {
1456
+ return;
1457
+ }
1458
+ reject(!cancel || cancel.type ? new CanceledError(null, config2, request) : cancel);
1459
+ request.abort();
1460
+ request = null;
955
1461
  };
956
- rn(function(b) {
957
- n(b), l();
958
- }, function(b) {
959
- r(b), l();
960
- }, h), u = null;
961
- }
962
- if ("onloadend" in u ? u.onloadend = p : u.onreadystatechange = function() {
963
- !u || u.readyState !== 4 || u.status === 0 && !(u.responseURL && u.responseURL.indexOf("file:") === 0) || setTimeout(p);
964
- }, u.onabort = function() {
965
- u && (r(new m("Request aborted", m.ECONNABORTED, e, u)), u = null);
966
- }, u.onerror = function() {
967
- r(new m("Network Error", m.ERR_NETWORK, e, u)), u = null;
968
- }, u.ontimeout = function() {
969
- let d = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded";
970
- const h = e.transitional || Ge;
971
- e.timeoutErrorMessage && (d = e.timeoutErrorMessage), r(new m(
972
- d,
973
- h.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
974
- e,
975
- u
976
- )), u = null;
977
- }, R.isStandardBrowserEnv) {
978
- const y = (e.withCredentials || cn(f)) && e.xsrfCookieName && sn.read(e.xsrfCookieName);
979
- y && i.set(e.xsrfHeaderName, y);
980
- }
981
- s === void 0 && i.setContentType(null), "setRequestHeader" in u && a.forEach(i.toJSON(), function(d, h) {
982
- u.setRequestHeader(h, d);
983
- }), a.isUndefined(e.withCredentials) || (u.withCredentials = !!e.withCredentials), o && o !== "json" && (u.responseType = e.responseType), typeof e.onDownloadProgress == "function" && u.addEventListener("progress", Ne(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && u.upload && u.upload.addEventListener("progress", Ne(e.onUploadProgress)), (e.cancelToken || e.signal) && (c = (y) => {
984
- u && (r(!y || y.type ? new k(null, e, u) : y), u.abort(), u = null);
985
- }, e.cancelToken && e.cancelToken.subscribe(c), e.signal && (e.signal.aborted ? c() : e.signal.addEventListener("abort", c)));
986
- const w = un(f);
987
- if (w && R.protocols.indexOf(w) === -1) {
988
- r(new m("Unsupported protocol " + w + ":", m.ERR_BAD_REQUEST, e));
1462
+ config2.cancelToken && config2.cancelToken.subscribe(onCanceled);
1463
+ if (config2.signal) {
1464
+ config2.signal.aborted ? onCanceled() : config2.signal.addEventListener("abort", onCanceled);
1465
+ }
1466
+ }
1467
+ const protocol = parseProtocol(fullPath);
1468
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
1469
+ reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config2));
989
1470
  return;
990
1471
  }
991
- u.send(s || null);
1472
+ request.send(requestData || null);
992
1473
  });
993
- }, J = {
994
- http: jt,
995
- xhr: dn
996
1474
  };
997
- a.forEach(J, (e, t) => {
998
- if (e) {
1475
+ const knownAdapters = {
1476
+ http: httpAdapter,
1477
+ xhr: xhrAdapter
1478
+ };
1479
+ utils.forEach(knownAdapters, (fn, value) => {
1480
+ if (fn) {
999
1481
  try {
1000
- Object.defineProperty(e, "name", { value: t });
1001
- } catch (n) {
1482
+ Object.defineProperty(fn, "name", { value });
1483
+ } catch (e) {
1002
1484
  }
1003
- Object.defineProperty(e, "adapterName", { value: t });
1485
+ Object.defineProperty(fn, "adapterName", { value });
1004
1486
  }
1005
1487
  });
1006
- const pn = {
1007
- getAdapter: (e) => {
1008
- e = a.isArray(e) ? e : [e];
1009
- const { length: t } = e;
1010
- let n, r;
1011
- for (let s = 0; s < t && (n = e[s], !(r = a.isString(n) ? J[n.toLowerCase()] : n)); s++)
1012
- ;
1013
- if (!r)
1014
- throw r === !1 ? new m(
1015
- `Adapter ${n} is not supported by the environment`,
1016
- "ERR_NOT_SUPPORT"
1017
- ) : new Error(
1018
- a.hasOwnProp(J, n) ? `Adapter '${n}' is not available in the build` : `Unknown adapter '${n}'`
1488
+ const adapters = {
1489
+ getAdapter: (adapters2) => {
1490
+ adapters2 = utils.isArray(adapters2) ? adapters2 : [adapters2];
1491
+ const { length } = adapters2;
1492
+ let nameOrAdapter;
1493
+ let adapter;
1494
+ for (let i = 0; i < length; i++) {
1495
+ nameOrAdapter = adapters2[i];
1496
+ if (adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter) {
1497
+ break;
1498
+ }
1499
+ }
1500
+ if (!adapter) {
1501
+ if (adapter === false) {
1502
+ throw new AxiosError(
1503
+ `Adapter ${nameOrAdapter} is not supported by the environment`,
1504
+ "ERR_NOT_SUPPORT"
1505
+ );
1506
+ }
1507
+ throw new Error(
1508
+ utils.hasOwnProp(knownAdapters, nameOrAdapter) ? `Adapter '${nameOrAdapter}' is not available in the build` : `Unknown adapter '${nameOrAdapter}'`
1019
1509
  );
1020
- if (!a.isFunction(r))
1510
+ }
1511
+ if (!utils.isFunction(adapter)) {
1021
1512
  throw new TypeError("adapter is not a function");
1022
- return r;
1513
+ }
1514
+ return adapter;
1023
1515
  },
1024
- adapters: J
1516
+ adapters: knownAdapters
1025
1517
  };
1026
- function ne(e) {
1027
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1028
- throw new k(null, e);
1518
+ function throwIfCancellationRequested(config2) {
1519
+ if (config2.cancelToken) {
1520
+ config2.cancelToken.throwIfRequested();
1521
+ }
1522
+ if (config2.signal && config2.signal.aborted) {
1523
+ throw new CanceledError(null, config2);
1524
+ }
1029
1525
  }
1030
- function Pe(e) {
1031
- return ne(e), e.headers = g.from(e.headers), e.data = te.call(
1032
- e,
1033
- e.transformRequest
1034
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), pn.getAdapter(e.adapter || de.adapter)(e).then(function(r) {
1035
- return ne(e), r.data = te.call(
1036
- e,
1037
- e.transformResponse,
1038
- r
1039
- ), r.headers = g.from(r.headers), r;
1040
- }, function(r) {
1041
- return ve(r) || (ne(e), r && r.response && (r.response.data = te.call(
1042
- e,
1043
- e.transformResponse,
1044
- r.response
1045
- ), r.response.headers = g.from(r.response.headers))), Promise.reject(r);
1526
+ function dispatchRequest(config2) {
1527
+ throwIfCancellationRequested(config2);
1528
+ config2.headers = AxiosHeaders$1.from(config2.headers);
1529
+ config2.data = transformData.call(
1530
+ config2,
1531
+ config2.transformRequest
1532
+ );
1533
+ if (["post", "put", "patch"].indexOf(config2.method) !== -1) {
1534
+ config2.headers.setContentType("application/x-www-form-urlencoded", false);
1535
+ }
1536
+ const adapter = adapters.getAdapter(config2.adapter || defaults$1.adapter);
1537
+ return adapter(config2).then(function onAdapterResolution(response) {
1538
+ throwIfCancellationRequested(config2);
1539
+ response.data = transformData.call(
1540
+ config2,
1541
+ config2.transformResponse,
1542
+ response
1543
+ );
1544
+ response.headers = AxiosHeaders$1.from(response.headers);
1545
+ return response;
1546
+ }, function onAdapterRejection(reason) {
1547
+ if (!isCancel(reason)) {
1548
+ throwIfCancellationRequested(config2);
1549
+ if (reason && reason.response) {
1550
+ reason.response.data = transformData.call(
1551
+ config2,
1552
+ config2.transformResponse,
1553
+ reason.response
1554
+ );
1555
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
1556
+ }
1557
+ }
1558
+ return Promise.reject(reason);
1046
1559
  });
1047
1560
  }
1048
- const xe = (e) => e instanceof g ? e.toJSON() : e;
1049
- function C(e, t) {
1050
- t = t || {};
1051
- const n = {};
1052
- function r(u, f, p) {
1053
- return a.isPlainObject(u) && a.isPlainObject(f) ? a.merge.call({ caseless: p }, u, f) : a.isPlainObject(f) ? a.merge({}, f) : a.isArray(f) ? f.slice() : f;
1054
- }
1055
- function s(u, f, p) {
1056
- if (a.isUndefined(f)) {
1057
- if (!a.isUndefined(u))
1058
- return r(void 0, u, p);
1059
- } else
1060
- return r(u, f, p);
1061
- }
1062
- function i(u, f) {
1063
- if (!a.isUndefined(f))
1064
- return r(void 0, f);
1065
- }
1066
- function o(u, f) {
1067
- if (a.isUndefined(f)) {
1068
- if (!a.isUndefined(u))
1069
- return r(void 0, u);
1070
- } else
1071
- return r(void 0, f);
1072
- }
1073
- function c(u, f, p) {
1074
- if (p in t)
1075
- return r(u, f);
1076
- if (p in e)
1077
- return r(void 0, u);
1078
- }
1079
- const l = {
1080
- url: i,
1081
- method: i,
1082
- data: i,
1083
- baseURL: o,
1084
- transformRequest: o,
1085
- transformResponse: o,
1086
- paramsSerializer: o,
1087
- timeout: o,
1088
- timeoutMessage: o,
1089
- withCredentials: o,
1090
- adapter: o,
1091
- responseType: o,
1092
- xsrfCookieName: o,
1093
- xsrfHeaderName: o,
1094
- onUploadProgress: o,
1095
- onDownloadProgress: o,
1096
- decompress: o,
1097
- maxContentLength: o,
1098
- maxBodyLength: o,
1099
- beforeRedirect: o,
1100
- transport: o,
1101
- httpAgent: o,
1102
- httpsAgent: o,
1103
- cancelToken: o,
1104
- socketPath: o,
1105
- responseEncoding: o,
1106
- validateStatus: c,
1107
- headers: (u, f) => s(xe(u), xe(f), !0)
1561
+ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing;
1562
+ function mergeConfig(config1, config2) {
1563
+ config2 = config2 || {};
1564
+ const config3 = {};
1565
+ function getMergedValue(target, source, caseless) {
1566
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
1567
+ return utils.merge.call({ caseless }, target, source);
1568
+ } else if (utils.isPlainObject(source)) {
1569
+ return utils.merge({}, source);
1570
+ } else if (utils.isArray(source)) {
1571
+ return source.slice();
1572
+ }
1573
+ return source;
1574
+ }
1575
+ function mergeDeepProperties(a, b, caseless) {
1576
+ if (!utils.isUndefined(b)) {
1577
+ return getMergedValue(a, b, caseless);
1578
+ } else if (!utils.isUndefined(a)) {
1579
+ return getMergedValue(void 0, a, caseless);
1580
+ }
1581
+ }
1582
+ function valueFromConfig2(a, b) {
1583
+ if (!utils.isUndefined(b)) {
1584
+ return getMergedValue(void 0, b);
1585
+ }
1586
+ }
1587
+ function defaultToConfig2(a, b) {
1588
+ if (!utils.isUndefined(b)) {
1589
+ return getMergedValue(void 0, b);
1590
+ } else if (!utils.isUndefined(a)) {
1591
+ return getMergedValue(void 0, a);
1592
+ }
1593
+ }
1594
+ function mergeDirectKeys(a, b, prop) {
1595
+ if (prop in config2) {
1596
+ return getMergedValue(a, b);
1597
+ } else if (prop in config1) {
1598
+ return getMergedValue(void 0, a);
1599
+ }
1600
+ }
1601
+ const mergeMap = {
1602
+ url: valueFromConfig2,
1603
+ method: valueFromConfig2,
1604
+ data: valueFromConfig2,
1605
+ baseURL: defaultToConfig2,
1606
+ transformRequest: defaultToConfig2,
1607
+ transformResponse: defaultToConfig2,
1608
+ paramsSerializer: defaultToConfig2,
1609
+ timeout: defaultToConfig2,
1610
+ timeoutMessage: defaultToConfig2,
1611
+ withCredentials: defaultToConfig2,
1612
+ adapter: defaultToConfig2,
1613
+ responseType: defaultToConfig2,
1614
+ xsrfCookieName: defaultToConfig2,
1615
+ xsrfHeaderName: defaultToConfig2,
1616
+ onUploadProgress: defaultToConfig2,
1617
+ onDownloadProgress: defaultToConfig2,
1618
+ decompress: defaultToConfig2,
1619
+ maxContentLength: defaultToConfig2,
1620
+ maxBodyLength: defaultToConfig2,
1621
+ beforeRedirect: defaultToConfig2,
1622
+ transport: defaultToConfig2,
1623
+ httpAgent: defaultToConfig2,
1624
+ httpsAgent: defaultToConfig2,
1625
+ cancelToken: defaultToConfig2,
1626
+ socketPath: defaultToConfig2,
1627
+ responseEncoding: defaultToConfig2,
1628
+ validateStatus: mergeDirectKeys,
1629
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
1108
1630
  };
1109
- return a.forEach(Object.keys(e).concat(Object.keys(t)), function(f) {
1110
- const p = l[f] || s, w = p(e[f], t[f], f);
1111
- a.isUndefined(w) && p !== c || (n[f] = w);
1112
- }), n;
1631
+ utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
1632
+ const merge2 = mergeMap[prop] || mergeDeepProperties;
1633
+ const configValue = merge2(config1[prop], config2[prop], prop);
1634
+ utils.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config3[prop] = configValue);
1635
+ });
1636
+ return config3;
1113
1637
  }
1114
- const We = "1.3.3", pe = {};
1115
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1116
- pe[e] = function(r) {
1117
- return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1638
+ const VERSION = "1.3.3";
1639
+ const validators$1 = {};
1640
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
1641
+ validators$1[type] = function validator2(thing) {
1642
+ return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
1118
1643
  };
1119
1644
  });
1120
- const Ce = {};
1121
- pe.transitional = function(t, n, r) {
1122
- function s(i, o) {
1123
- return "[Axios v" + We + "] Transitional option '" + i + "'" + o + (r ? ". " + r : "");
1124
- }
1125
- return (i, o, c) => {
1126
- if (t === !1)
1127
- throw new m(
1128
- s(o, " has been removed" + (n ? " in " + n : "")),
1129
- m.ERR_DEPRECATED
1645
+ const deprecatedWarnings = {};
1646
+ validators$1.transitional = function transitional(validator2, version, message) {
1647
+ function formatMessage(opt, desc) {
1648
+ return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
1649
+ }
1650
+ return (value, opt, opts) => {
1651
+ if (validator2 === false) {
1652
+ throw new AxiosError(
1653
+ formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
1654
+ AxiosError.ERR_DEPRECATED
1130
1655
  );
1131
- return n && !Ce[o] && (Ce[o] = !0, console.warn(
1132
- s(
1133
- o,
1134
- " has been deprecated since v" + n + " and will be removed in the near future"
1135
- )
1136
- )), t ? t(i, o, c) : !0;
1656
+ }
1657
+ if (version && !deprecatedWarnings[opt]) {
1658
+ deprecatedWarnings[opt] = true;
1659
+ console.warn(
1660
+ formatMessage(
1661
+ opt,
1662
+ " has been deprecated since v" + version + " and will be removed in the near future"
1663
+ )
1664
+ );
1665
+ }
1666
+ return validator2 ? validator2(value, opt, opts) : true;
1137
1667
  };
1138
1668
  };
1139
- function hn(e, t, n) {
1140
- if (typeof e != "object")
1141
- throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
1142
- const r = Object.keys(e);
1143
- let s = r.length;
1144
- for (; s-- > 0; ) {
1145
- const i = r[s], o = t[i];
1146
- if (o) {
1147
- const c = e[i], l = c === void 0 || o(c, i, e);
1148
- if (l !== !0)
1149
- throw new m("option " + i + " must be " + l, m.ERR_BAD_OPTION_VALUE);
1669
+ function assertOptions(options, schema, allowUnknown) {
1670
+ if (typeof options !== "object") {
1671
+ throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
1672
+ }
1673
+ const keys = Object.keys(options);
1674
+ let i = keys.length;
1675
+ while (i-- > 0) {
1676
+ const opt = keys[i];
1677
+ const validator2 = schema[opt];
1678
+ if (validator2) {
1679
+ const value = options[opt];
1680
+ const result = value === void 0 || validator2(value, opt, options);
1681
+ if (result !== true) {
1682
+ throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE);
1683
+ }
1150
1684
  continue;
1151
1685
  }
1152
- if (n !== !0)
1153
- throw new m("Unknown option " + i, m.ERR_BAD_OPTION);
1686
+ if (allowUnknown !== true) {
1687
+ throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION);
1688
+ }
1154
1689
  }
1155
1690
  }
1156
- const oe = {
1157
- assertOptions: hn,
1158
- validators: pe
1159
- }, T = oe.validators;
1160
- class V {
1161
- constructor(t) {
1162
- this.defaults = t, this.interceptors = {
1163
- request: new Ae(),
1164
- response: new Ae()
1691
+ const validator = {
1692
+ assertOptions,
1693
+ validators: validators$1
1694
+ };
1695
+ const validators = validator.validators;
1696
+ class Axios {
1697
+ constructor(instanceConfig) {
1698
+ this.defaults = instanceConfig;
1699
+ this.interceptors = {
1700
+ request: new InterceptorManager(),
1701
+ response: new InterceptorManager()
1165
1702
  };
1166
1703
  }
1167
1704
  /**
@@ -1172,172 +1709,222 @@ class V {
1172
1709
  *
1173
1710
  * @returns {Promise} The Promise to be fulfilled
1174
1711
  */
1175
- request(t, n) {
1176
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = C(this.defaults, n);
1177
- const { transitional: r, paramsSerializer: s, headers: i } = n;
1178
- r !== void 0 && oe.assertOptions(r, {
1179
- silentJSONParsing: T.transitional(T.boolean),
1180
- forcedJSONParsing: T.transitional(T.boolean),
1181
- clarifyTimeoutError: T.transitional(T.boolean)
1182
- }, !1), s !== void 0 && oe.assertOptions(s, {
1183
- encode: T.function,
1184
- serialize: T.function
1185
- }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1186
- let o;
1187
- o = i && a.merge(
1188
- i.common,
1189
- i[n.method]
1190
- ), o && a.forEach(
1712
+ request(configOrUrl, config2) {
1713
+ if (typeof configOrUrl === "string") {
1714
+ config2 = config2 || {};
1715
+ config2.url = configOrUrl;
1716
+ } else {
1717
+ config2 = configOrUrl || {};
1718
+ }
1719
+ config2 = mergeConfig(this.defaults, config2);
1720
+ const { transitional: transitional2, paramsSerializer, headers } = config2;
1721
+ if (transitional2 !== void 0) {
1722
+ validator.assertOptions(transitional2, {
1723
+ silentJSONParsing: validators.transitional(validators.boolean),
1724
+ forcedJSONParsing: validators.transitional(validators.boolean),
1725
+ clarifyTimeoutError: validators.transitional(validators.boolean)
1726
+ }, false);
1727
+ }
1728
+ if (paramsSerializer !== void 0) {
1729
+ validator.assertOptions(paramsSerializer, {
1730
+ encode: validators.function,
1731
+ serialize: validators.function
1732
+ }, true);
1733
+ }
1734
+ config2.method = (config2.method || this.defaults.method || "get").toLowerCase();
1735
+ let contextHeaders;
1736
+ contextHeaders = headers && utils.merge(
1737
+ headers.common,
1738
+ headers[config2.method]
1739
+ );
1740
+ contextHeaders && utils.forEach(
1191
1741
  ["delete", "get", "head", "post", "put", "patch", "common"],
1192
- (d) => {
1193
- delete i[d];
1742
+ (method) => {
1743
+ delete headers[method];
1744
+ }
1745
+ );
1746
+ config2.headers = AxiosHeaders$1.concat(contextHeaders, headers);
1747
+ const requestInterceptorChain = [];
1748
+ let synchronousRequestInterceptors = true;
1749
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
1750
+ if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config2) === false) {
1751
+ return;
1194
1752
  }
1195
- ), n.headers = g.concat(o, i);
1196
- const c = [];
1197
- let l = !0;
1198
- this.interceptors.request.forEach(function(h) {
1199
- typeof h.runWhen == "function" && h.runWhen(n) === !1 || (l = l && h.synchronous, c.unshift(h.fulfilled, h.rejected));
1753
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
1754
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
1200
1755
  });
1201
- const u = [];
1202
- this.interceptors.response.forEach(function(h) {
1203
- u.push(h.fulfilled, h.rejected);
1756
+ const responseInterceptorChain = [];
1757
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
1758
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
1204
1759
  });
1205
- let f, p = 0, w;
1206
- if (!l) {
1207
- const d = [Pe.bind(this), void 0];
1208
- for (d.unshift.apply(d, c), d.push.apply(d, u), w = d.length, f = Promise.resolve(n); p < w; )
1209
- f = f.then(d[p++], d[p++]);
1210
- return f;
1211
- }
1212
- w = c.length;
1213
- let y = n;
1214
- for (p = 0; p < w; ) {
1215
- const d = c[p++], h = c[p++];
1760
+ let promise;
1761
+ let i = 0;
1762
+ let len;
1763
+ if (!synchronousRequestInterceptors) {
1764
+ const chain = [dispatchRequest.bind(this), void 0];
1765
+ chain.unshift.apply(chain, requestInterceptorChain);
1766
+ chain.push.apply(chain, responseInterceptorChain);
1767
+ len = chain.length;
1768
+ promise = Promise.resolve(config2);
1769
+ while (i < len) {
1770
+ promise = promise.then(chain[i++], chain[i++]);
1771
+ }
1772
+ return promise;
1773
+ }
1774
+ len = requestInterceptorChain.length;
1775
+ let newConfig = config2;
1776
+ i = 0;
1777
+ while (i < len) {
1778
+ const onFulfilled = requestInterceptorChain[i++];
1779
+ const onRejected = requestInterceptorChain[i++];
1216
1780
  try {
1217
- y = d(y);
1218
- } catch (O) {
1219
- h.call(this, O);
1781
+ newConfig = onFulfilled(newConfig);
1782
+ } catch (error) {
1783
+ onRejected.call(this, error);
1220
1784
  break;
1221
1785
  }
1222
1786
  }
1223
1787
  try {
1224
- f = Pe.call(this, y);
1225
- } catch (d) {
1226
- return Promise.reject(d);
1788
+ promise = dispatchRequest.call(this, newConfig);
1789
+ } catch (error) {
1790
+ return Promise.reject(error);
1227
1791
  }
1228
- for (p = 0, w = u.length; p < w; )
1229
- f = f.then(u[p++], u[p++]);
1230
- return f;
1792
+ i = 0;
1793
+ len = responseInterceptorChain.length;
1794
+ while (i < len) {
1795
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
1796
+ }
1797
+ return promise;
1231
1798
  }
1232
- getUri(t) {
1233
- t = C(this.defaults, t);
1234
- const n = Ke(t.baseURL, t.url);
1235
- return Ve(n, t.params, t.paramsSerializer);
1799
+ getUri(config2) {
1800
+ config2 = mergeConfig(this.defaults, config2);
1801
+ const fullPath = buildFullPath(config2.baseURL, config2.url);
1802
+ return buildURL(fullPath, config2.params, config2.paramsSerializer);
1236
1803
  }
1237
1804
  }
1238
- a.forEach(["delete", "get", "head", "options"], function(t) {
1239
- V.prototype[t] = function(n, r) {
1240
- return this.request(C(r || {}, {
1241
- method: t,
1242
- url: n,
1243
- data: (r || {}).data
1805
+ utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
1806
+ Axios.prototype[method] = function(url, config2) {
1807
+ return this.request(mergeConfig(config2 || {}, {
1808
+ method,
1809
+ url,
1810
+ data: (config2 || {}).data
1244
1811
  }));
1245
1812
  };
1246
1813
  });
1247
- a.forEach(["post", "put", "patch"], function(t) {
1248
- function n(r) {
1249
- return function(i, o, c) {
1250
- return this.request(C(c || {}, {
1251
- method: t,
1252
- headers: r ? {
1814
+ utils.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
1815
+ function generateHTTPMethod(isForm) {
1816
+ return function httpMethod(url, data, config2) {
1817
+ return this.request(mergeConfig(config2 || {}, {
1818
+ method,
1819
+ headers: isForm ? {
1253
1820
  "Content-Type": "multipart/form-data"
1254
1821
  } : {},
1255
- url: i,
1256
- data: o
1822
+ url,
1823
+ data
1257
1824
  }));
1258
1825
  };
1259
1826
  }
1260
- V.prototype[t] = n(), V.prototype[t + "Form"] = n(!0);
1827
+ Axios.prototype[method] = generateHTTPMethod();
1828
+ Axios.prototype[method + "Form"] = generateHTTPMethod(true);
1261
1829
  });
1262
- const z = V;
1263
- class he {
1264
- constructor(t) {
1265
- if (typeof t != "function")
1830
+ const Axios$1 = Axios;
1831
+ class CancelToken {
1832
+ constructor(executor) {
1833
+ if (typeof executor !== "function") {
1266
1834
  throw new TypeError("executor must be a function.");
1267
- let n;
1268
- this.promise = new Promise(function(i) {
1269
- n = i;
1835
+ }
1836
+ let resolvePromise;
1837
+ this.promise = new Promise(function promiseExecutor(resolve) {
1838
+ resolvePromise = resolve;
1270
1839
  });
1271
- const r = this;
1272
- this.promise.then((s) => {
1273
- if (!r._listeners)
1840
+ const token = this;
1841
+ this.promise.then((cancel) => {
1842
+ if (!token._listeners)
1274
1843
  return;
1275
- let i = r._listeners.length;
1276
- for (; i-- > 0; )
1277
- r._listeners[i](s);
1278
- r._listeners = null;
1279
- }), this.promise.then = (s) => {
1280
- let i;
1281
- const o = new Promise((c) => {
1282
- r.subscribe(c), i = c;
1283
- }).then(s);
1284
- return o.cancel = function() {
1285
- r.unsubscribe(i);
1286
- }, o;
1287
- }, t(function(i, o, c) {
1288
- r.reason || (r.reason = new k(i, o, c), n(r.reason));
1844
+ let i = token._listeners.length;
1845
+ while (i-- > 0) {
1846
+ token._listeners[i](cancel);
1847
+ }
1848
+ token._listeners = null;
1849
+ });
1850
+ this.promise.then = (onfulfilled) => {
1851
+ let _resolve;
1852
+ const promise = new Promise((resolve) => {
1853
+ token.subscribe(resolve);
1854
+ _resolve = resolve;
1855
+ }).then(onfulfilled);
1856
+ promise.cancel = function reject() {
1857
+ token.unsubscribe(_resolve);
1858
+ };
1859
+ return promise;
1860
+ };
1861
+ executor(function cancel(message, config2, request) {
1862
+ if (token.reason) {
1863
+ return;
1864
+ }
1865
+ token.reason = new CanceledError(message, config2, request);
1866
+ resolvePromise(token.reason);
1289
1867
  });
1290
1868
  }
1291
1869
  /**
1292
1870
  * Throws a `CanceledError` if cancellation has been requested.
1293
1871
  */
1294
1872
  throwIfRequested() {
1295
- if (this.reason)
1873
+ if (this.reason) {
1296
1874
  throw this.reason;
1875
+ }
1297
1876
  }
1298
1877
  /**
1299
1878
  * Subscribe to the cancel signal
1300
1879
  */
1301
- subscribe(t) {
1880
+ subscribe(listener) {
1302
1881
  if (this.reason) {
1303
- t(this.reason);
1882
+ listener(this.reason);
1304
1883
  return;
1305
1884
  }
1306
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
1885
+ if (this._listeners) {
1886
+ this._listeners.push(listener);
1887
+ } else {
1888
+ this._listeners = [listener];
1889
+ }
1307
1890
  }
1308
1891
  /**
1309
1892
  * Unsubscribe from the cancel signal
1310
1893
  */
1311
- unsubscribe(t) {
1312
- if (!this._listeners)
1894
+ unsubscribe(listener) {
1895
+ if (!this._listeners) {
1313
1896
  return;
1314
- const n = this._listeners.indexOf(t);
1315
- n !== -1 && this._listeners.splice(n, 1);
1897
+ }
1898
+ const index2 = this._listeners.indexOf(listener);
1899
+ if (index2 !== -1) {
1900
+ this._listeners.splice(index2, 1);
1901
+ }
1316
1902
  }
1317
1903
  /**
1318
1904
  * Returns an object that contains a new `CancelToken` and a function that, when called,
1319
1905
  * cancels the `CancelToken`.
1320
1906
  */
1321
1907
  static source() {
1322
- let t;
1908
+ let cancel;
1909
+ const token = new CancelToken(function executor(c) {
1910
+ cancel = c;
1911
+ });
1323
1912
  return {
1324
- token: new he(function(s) {
1325
- t = s;
1326
- }),
1327
- cancel: t
1913
+ token,
1914
+ cancel
1328
1915
  };
1329
1916
  }
1330
1917
  }
1331
- const mn = he;
1332
- function yn(e) {
1333
- return function(n) {
1334
- return e.apply(null, n);
1918
+ const CancelToken$1 = CancelToken;
1919
+ function spread(callback) {
1920
+ return function wrap(arr) {
1921
+ return callback.apply(null, arr);
1335
1922
  };
1336
1923
  }
1337
- function En(e) {
1338
- return a.isObject(e) && e.isAxiosError === !0;
1924
+ function isAxiosError(payload) {
1925
+ return utils.isObject(payload) && payload.isAxiosError === true;
1339
1926
  }
1340
- const ie = {
1927
+ const HttpStatusCode = {
1341
1928
  Continue: 100,
1342
1929
  SwitchingProtocols: 101,
1343
1930
  Processing: 102,
@@ -1402,233 +1989,354 @@ const ie = {
1402
1989
  NotExtended: 510,
1403
1990
  NetworkAuthenticationRequired: 511
1404
1991
  };
1405
- Object.entries(ie).forEach(([e, t]) => {
1406
- ie[t] = e;
1992
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
1993
+ HttpStatusCode[value] = key;
1407
1994
  });
1408
- const wn = ie;
1409
- function Xe(e) {
1410
- const t = new z(e), n = Ue(z.prototype.request, t);
1411
- return a.extend(n, z.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
1412
- return Xe(C(e, s));
1413
- }, n;
1995
+ const HttpStatusCode$1 = HttpStatusCode;
1996
+ function createInstance(defaultConfig) {
1997
+ const context = new Axios$1(defaultConfig);
1998
+ const instance = bind(Axios$1.prototype.request, context);
1999
+ utils.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
2000
+ utils.extend(instance, context, null, { allOwnKeys: true });
2001
+ instance.create = function create(instanceConfig) {
2002
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
2003
+ };
2004
+ return instance;
1414
2005
  }
1415
- const E = Xe(de);
1416
- E.Axios = z;
1417
- E.CanceledError = k;
1418
- E.CancelToken = mn;
1419
- E.isCancel = ve;
1420
- E.VERSION = We;
1421
- E.toFormData = $;
1422
- E.AxiosError = m;
1423
- E.Cancel = E.CanceledError;
1424
- E.all = function(t) {
1425
- return Promise.all(t);
2006
+ const axios = createInstance(defaults$1);
2007
+ axios.Axios = Axios$1;
2008
+ axios.CanceledError = CanceledError;
2009
+ axios.CancelToken = CancelToken$1;
2010
+ axios.isCancel = isCancel;
2011
+ axios.VERSION = VERSION;
2012
+ axios.toFormData = toFormData;
2013
+ axios.AxiosError = AxiosError;
2014
+ axios.Cancel = axios.CanceledError;
2015
+ axios.all = function all(promises) {
2016
+ return Promise.all(promises);
1426
2017
  };
1427
- E.spread = yn;
1428
- E.isAxiosError = En;
1429
- E.mergeConfig = C;
1430
- E.AxiosHeaders = g;
1431
- E.formToJSON = (e) => $e(a.isHTMLForm(e) ? new FormData(e) : e);
1432
- E.HttpStatusCode = wn;
1433
- E.default = E;
1434
- const Sn = {
2018
+ axios.spread = spread;
2019
+ axios.isAxiosError = isAxiosError;
2020
+ axios.mergeConfig = mergeConfig;
2021
+ axios.AxiosHeaders = AxiosHeaders$1;
2022
+ axios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
2023
+ axios.HttpStatusCode = HttpStatusCode$1;
2024
+ axios.default = axios;
2025
+ const ttc = {
1435
2026
  LOGIN_URL: `${window.location.origin}/ttc/cloud/#/login`,
1436
2027
  HOME_URL: `${window.location.origin}/ttc/cloud/#/cloud`,
1437
- INTEGRATED_BASE_URL: "/gateway/integrated-management/api/v1"
1438
- }, Qe = {
1439
- ttc: Sn
1440
- }, In = "THEME", jn = "LANG", bn = (e = "ttc") => Ee.get(`${Qe[e].INTEGRATED_BASE_URL}/account/auth/route/list`), Rn = (e = "ttc") => Ee.get(`${Qe[e].INTEGRATED_BASE_URL}/account/home/menu`), me = (e = "ttc") => {
1441
- ye({ token: "" });
1442
- }, W = (e = "ttc") => {
1443
- var s;
1444
- const t = `${e}GlobalState`, n = (s = localStorage.getItem(t)) != null ? s : "{}";
1445
- return JSON.parse(n) ? JSON.parse(n).token : null;
1446
- }, Ye = (r, ...s) => M(void 0, [r, ...s], function* ({ userName: e, password: t }, n = "ttc") {
1447
- const i = I("loginApiUrl"), { data: o } = yield Ee.post(i, { userName: e, password: t });
1448
- o.tokenValue && S.success("登录成功"), ye({ token: o.tokenValue, userInfo: o });
1449
- }), On = (e = "ttc") => {
1450
- var s;
1451
- const t = `${e}GlobalState`, n = (s = localStorage.getItem(t)) != null ? s : "{}";
1452
- return JSON.parse(n) ? JSON.parse(n).userInfo : null;
1453
- }, gn = () => M(void 0, null, function* () {
1454
- return W() ? yield Rn() : [];
1455
- }), X = () => {
1456
- if (et()) {
1457
- me();
1458
- const e = location.pathname;
1459
- if (console.log("跳转至登录页", e, e.includes(x())), e.includes(x()))
2028
+ INTEGRATED_BASE_URL: `/gateway/integrated-management/api/v1`
2029
+ };
2030
+ const URL = {
2031
+ ttc
2032
+ };
2033
+ const BC_THEME_NAME = "THEME";
2034
+ const BC_LANG_NAME = "LANG";
2035
+ const getAuthRouteList = (systemName = "ttc") => {
2036
+ return http.get(`${URL[systemName].INTEGRATED_BASE_URL}/account/auth/route/list`);
2037
+ };
2038
+ const getHomeMenuList = (systemName = "ttc") => {
2039
+ return http.get(`${URL[systemName].INTEGRATED_BASE_URL}/account/home/menu`);
2040
+ };
2041
+ const removeToken = (systemName = "ttc") => {
2042
+ setSystemConfig({ token: "" });
2043
+ };
2044
+ const getToken = (systemName = "ttc") => {
2045
+ var _a;
2046
+ const GlobalStateKey = `${systemName}GlobalState`;
2047
+ const GlobalState = (_a = localStorage.getItem(GlobalStateKey)) != null ? _a : "{}";
2048
+ const token = JSON.parse(GlobalState) ? JSON.parse(GlobalState).token : null;
2049
+ return token;
2050
+ };
2051
+ const autoLogin = (_0, ..._1) => __async(void 0, [_0, ..._1], function* ({ userName, password }, systemName = "ttc") {
2052
+ const loginApiUrl = getSystemConfig("loginApiUrl");
2053
+ const { data } = yield http.post(loginApiUrl, { userName, password });
2054
+ if (data.tokenValue) {
2055
+ ElMessage.success("登录成功");
2056
+ }
2057
+ setSystemConfig({ token: data.tokenValue, userInfo: data });
2058
+ });
2059
+ const getUserInfo = (systemName = "ttc") => {
2060
+ var _a;
2061
+ const GlobalStateKey = `${systemName}GlobalState`;
2062
+ const GlobalState = (_a = localStorage.getItem(GlobalStateKey)) != null ? _a : "{}";
2063
+ const userInfo = JSON.parse(GlobalState) ? JSON.parse(GlobalState).userInfo : null;
2064
+ return userInfo;
2065
+ };
2066
+ const getUserRouteList = () => __async(void 0, null, function* () {
2067
+ if (!getToken())
2068
+ return [];
2069
+ const data = yield getHomeMenuList();
2070
+ return data;
2071
+ });
2072
+ const jumpToLogin = () => {
2073
+ if (isProduction()) {
2074
+ removeToken();
2075
+ const curRoute = location.pathname;
2076
+ console.log("跳转至登录页", curRoute, curRoute.includes(getLoginUrl()));
2077
+ if (curRoute.includes(getLoginUrl())) {
1460
2078
  return;
1461
- console.log("跳转至登录页", x()), location.replace(x());
2079
+ } else {
2080
+ console.log("跳转至登录页", getLoginUrl());
2081
+ location.replace(getLoginUrl());
2082
+ }
1462
2083
  } else {
1463
2084
  console.log("开发环境!!!");
1464
- const e = window.prompt("当前系统处于开发环境,当前登录过期,请输入登录账号", "");
1465
- if (e !== null) {
1466
- const t = window.prompt("请输入登录密码", "");
1467
- (t === null || t == "") && window.prompt("请输入登录密码", ""), Ye({ userName: e, password: t });
1468
- }
1469
- }
1470
- }, An = () => {
1471
- window.location.replace(Ze());
1472
- }, x = () => I("loginUrl"), Ze = () => I("homeUrl"), ye = (e) => {
1473
- var r;
1474
- const t = (r = localStorage.getItem("ttcGlobalState")) != null ? r : "{}", n = U(U({}, JSON.parse(t)), e);
1475
- localStorage.setItem("ttcGlobalState", JSON.stringify(n));
1476
- }, I = (e) => {
1477
- var n, r;
1478
- return (r = JSON.parse((n = localStorage.getItem("ttcGlobalState")) != null ? n : "{}")[e]) != null ? r : "";
1479
- }, et = () => I("environment") === "production", Tn = (e, t = !0, n) => M(void 0, null, function* () {
1480
- if (!W() && t)
1481
- return X();
2085
+ const userName = window.prompt("当前系统处于开发环境,当前登录过期,请输入登录账号", "");
2086
+ if (userName !== null) {
2087
+ const password = window.prompt("请输入登录密码", "");
2088
+ if (password === null || password == "")
2089
+ window.prompt("请输入登录密码", "");
2090
+ autoLogin({ userName, password });
2091
+ }
2092
+ }
2093
+ };
2094
+ const jumpToHome = () => {
2095
+ window.location.replace(getHomeUrl());
2096
+ };
2097
+ const getLoginUrl = () => {
2098
+ return getSystemConfig("loginUrl");
2099
+ };
2100
+ const getHomeUrl = () => {
2101
+ return getSystemConfig("homeUrl");
2102
+ };
2103
+ const setSystemConfig = (config2) => {
2104
+ var _a;
2105
+ const GlobalState = (_a = localStorage.getItem("ttcGlobalState")) != null ? _a : "{}";
2106
+ const newGlobalState = __spreadValues(__spreadValues({}, JSON.parse(GlobalState)), config2);
2107
+ localStorage.setItem("ttcGlobalState", JSON.stringify(newGlobalState));
2108
+ };
2109
+ const getSystemConfig = (key) => {
2110
+ var _a, _b;
2111
+ const GlobalState = JSON.parse((_a = localStorage.getItem("ttcGlobalState")) != null ? _a : "{}");
2112
+ return (_b = GlobalState[key]) != null ? _b : "";
2113
+ };
2114
+ const isProduction = () => {
2115
+ return getSystemConfig("environment") === "production";
2116
+ };
2117
+ const getUserPermissions = (systemName, isJumpLogin = true, serverName) => __async(void 0, null, function* () {
2118
+ if (!getToken() && isJumpLogin)
2119
+ return jumpToLogin();
1482
2120
  try {
1483
- const { data: r } = yield bn(n), s = r.filter((c) => c.routeTag.includes(e)), i = s.filter((c) => c.routeType === "VIEW"), o = s.filter((c) => c.routeType === "BTN");
1484
- return sessionStorage.setItem("ttcUserBtnList", JSON.stringify(o.map((c) => c.routeTag))), {
1485
- userMenuList: i,
1486
- userBtnList: o
2121
+ const { data } = yield getAuthRouteList(serverName);
2122
+ const systemPermissionList = data.filter((route) => route.routeTag.includes(systemName));
2123
+ const userMenuList = systemPermissionList.filter((item) => item.routeType === "VIEW");
2124
+ const userBtnList = systemPermissionList.filter((item) => item.routeType === "BTN");
2125
+ sessionStorage.setItem("ttcUserBtnList", JSON.stringify(userBtnList.map((item) => item.routeTag)));
2126
+ return {
2127
+ userMenuList,
2128
+ userBtnList
1487
2129
  };
1488
- } catch (r) {
1489
- }
1490
- }), Nn = (e, t, n) => {
1491
- let r = [];
1492
- return e.forEach((s) => {
1493
- const i = `/src/views${s.routeView}/config.ts`, o = `/src/views${s.routeView}/index.vue`;
1494
- if (t[o] && n[i]) {
1495
- const c = n[i], l = {
1496
- path: s.routeView,
1497
- name: s.routeView.split("/")[1],
2130
+ } catch (err) {
2131
+ }
2132
+ });
2133
+ const getUserRouter = (userMenuList, viewModules, viewConfig) => {
2134
+ let menuList = [];
2135
+ userMenuList.forEach((item) => {
2136
+ const configKey = `/src/views${item.routeView}/config.ts`;
2137
+ const viewKey = `/src/views${item.routeView}/index.vue`;
2138
+ if (viewModules[viewKey] && viewConfig[configKey]) {
2139
+ const pageConfig = viewConfig[configKey];
2140
+ const routerObject = {
2141
+ path: item.routeView,
2142
+ name: item.routeView.split("/")[1],
1498
2143
  meta: {
1499
- title: c.title,
1500
- icon: c.icon
2144
+ title: pageConfig.title,
2145
+ icon: pageConfig.icon
1501
2146
  },
1502
- component: t[o]
2147
+ component: viewModules[viewKey]
1503
2148
  };
1504
- r.push(l);
1505
- }
1506
- }), r;
1507
- }, Pn = (e) => {
1508
- var n;
1509
- if (!e)
1510
- return !1;
1511
- const t = (n = sessionStorage.getItem("ttcUserBtnList")) != null ? n : "[]";
1512
- return JSON.parse(t).includes(e);
1513
- }, Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2149
+ menuList.push(routerObject);
2150
+ }
2151
+ });
2152
+ return menuList;
2153
+ };
2154
+ const getUserIsHaveBtnPower = (routeTag) => {
2155
+ var _a;
2156
+ if (!routeTag)
2157
+ return false;
2158
+ const authButtonListGet = (_a = sessionStorage.getItem("ttcUserBtnList")) != null ? _a : "[]";
2159
+ return JSON.parse(authButtonListGet).includes(routeTag);
2160
+ };
2161
+ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1514
2162
  __proto__: null,
1515
- autoLogin: Ye,
1516
- getHomeUrl: Ze,
1517
- getLoginUrl: x,
1518
- getSystemConfig: I,
1519
- getToken: W,
1520
- getUserInfo: On,
1521
- getUserIsHaveBtnPower: Pn,
1522
- getUserPermissions: Tn,
1523
- getUserRouteList: gn,
1524
- getUserRouter: Nn,
1525
- isProduction: et,
1526
- jumpToHome: An,
1527
- jumpToLogin: X,
1528
- removeToken: me,
1529
- setSystemConfig: ye
2163
+ autoLogin,
2164
+ getHomeUrl,
2165
+ getLoginUrl,
2166
+ getSystemConfig,
2167
+ getToken,
2168
+ getUserInfo,
2169
+ getUserIsHaveBtnPower,
2170
+ getUserPermissions,
2171
+ getUserRouteList,
2172
+ getUserRouter,
2173
+ isProduction,
2174
+ jumpToHome,
2175
+ jumpToLogin,
2176
+ removeToken,
2177
+ setSystemConfig
1530
2178
  }, Symbol.toStringTag, { value: "Module" }));
1531
- let tt;
1532
- const xn = {
1533
- lock: !0,
2179
+ let loadingInstance;
2180
+ const loadingOptions = {
2181
+ lock: true,
1534
2182
  text: "加载中...",
1535
- fullscreen: !0,
2183
+ fullscreen: true,
1536
2184
  background: "rgba(0, 0, 0, 0.6)"
1537
- }, Cn = () => {
1538
- tt = it.service(xn);
1539
- }, Ln = () => {
1540
- tt.close();
1541
2185
  };
1542
- let B = 0;
1543
- const Un = () => {
1544
- B === 0 && Cn(), B++;
1545
- }, Le = () => {
1546
- B <= 0 || (B--, B === 0 && Ln());
2186
+ const startLoading = () => {
2187
+ loadingInstance = ElLoading.service(loadingOptions);
2188
+ };
2189
+ const endLoading = () => {
2190
+ loadingInstance.close();
2191
+ };
2192
+ let needLoadingRequestCount = 0;
2193
+ const showFullScreenLoading = () => {
2194
+ if (needLoadingRequestCount === 0) {
2195
+ startLoading();
2196
+ }
2197
+ needLoadingRequestCount++;
1547
2198
  };
1548
- var ae = /* @__PURE__ */ ((e) => (e[e.SUCCESS = 200] = "SUCCESS", e[e.ERROR = 500] = "ERROR", e[e.OVERDUE = 401] = "OVERDUE", e[e.TIMEOUT = 3e4] = "TIMEOUT", e))(ae || {});
1549
- const _n = {
2199
+ const hideFullScreenLoading = () => {
2200
+ if (needLoadingRequestCount <= 0)
2201
+ return;
2202
+ needLoadingRequestCount--;
2203
+ if (needLoadingRequestCount === 0) {
2204
+ endLoading();
2205
+ }
2206
+ };
2207
+ var ResultEnum = /* @__PURE__ */ ((ResultEnum2) => {
2208
+ ResultEnum2[ResultEnum2["SUCCESS"] = 200] = "SUCCESS";
2209
+ ResultEnum2[ResultEnum2["ERROR"] = 500] = "ERROR";
2210
+ ResultEnum2[ResultEnum2["OVERDUE"] = 401] = "OVERDUE";
2211
+ ResultEnum2[ResultEnum2["TIMEOUT"] = 3e4] = "TIMEOUT";
2212
+ return ResultEnum2;
2213
+ })(ResultEnum || {});
2214
+ const config = {
1550
2215
  // 默认地址请求地址,可在 .env.*** 文件中修改
1551
2216
  // 设置超时时间(30s)
1552
2217
  timeout: 3e4,
1553
2218
  // 跨域时候允许携带凭证
1554
- withCredentials: !0
1555
- }, Bn = (e, t) => {
1556
- switch (e) {
2219
+ withCredentials: true
2220
+ };
2221
+ const checkStatus = (status, msg) => {
2222
+ switch (status) {
1557
2223
  case 400:
1558
- S.error(t || "请求失败!请您稍后重试");
2224
+ ElMessage.error(msg || "请求失败!请您稍后重试");
1559
2225
  break;
1560
2226
  case 401:
1561
- location.href.includes(x()) || (S.error(t || "登录失效!请您重新登录"), X());
2227
+ if (!location.href.includes(getLoginUrl())) {
2228
+ ElMessage.error(msg || "登录失效!请您重新登录");
2229
+ jumpToLogin();
2230
+ }
1562
2231
  break;
1563
2232
  case 403:
1564
- S.error(t || "当前账号无权限访问!");
2233
+ ElMessage.error(msg || "当前账号无权限访问!");
1565
2234
  break;
1566
2235
  case 404:
1567
- S.error("你所访问的资源不存在!");
2236
+ ElMessage.error("你所访问的资源不存在!");
1568
2237
  break;
1569
2238
  case 405:
1570
- S.error(t || "请求方式错误!请您稍后重试");
2239
+ ElMessage.error(msg || "请求方式错误!请您稍后重试");
1571
2240
  break;
1572
2241
  case 408:
1573
- S.error(t || "请求超时!请您稍后重试");
2242
+ ElMessage.error(msg || "请求超时!请您稍后重试");
1574
2243
  break;
1575
2244
  case 500:
1576
- S.error(t || "服务异常!");
2245
+ ElMessage.error(msg || "服务异常!");
1577
2246
  break;
1578
2247
  case 502:
1579
- S.error("网关错误!");
2248
+ ElMessage.error("网关错误!");
1580
2249
  break;
1581
2250
  case 503:
1582
- S.error("服务不可用!");
2251
+ ElMessage.error("服务不可用!");
1583
2252
  break;
1584
2253
  case 504:
1585
- S.error("网关超时!");
2254
+ ElMessage.error("网关超时!");
1586
2255
  break;
1587
2256
  default:
1588
- S.error("请求失败!");
2257
+ ElMessage.error("请求失败!");
1589
2258
  }
1590
2259
  };
1591
- class Fn {
1592
- constructor(t) {
1593
- Y(this, "service");
2260
+ class YxHttp {
2261
+ constructor(config2) {
2262
+ __publicField(this, "service");
1594
2263
  /** 自定义响应处理map */
1595
- Y(this, "customResMap");
1596
- this.service = E.create(t), this.setupInterceptors(), this.customResMap = {};
2264
+ __publicField(this, "customResMap");
2265
+ this.service = axios.create(config2);
2266
+ this.setupInterceptors();
2267
+ this.customResMap = {};
1597
2268
  }
1598
2269
  setupInterceptors() {
1599
2270
  this.service.interceptors.request.use(
1600
- (t) => {
1601
- var n;
1602
- return (n = t.headers) != null && n.noLoading || Un(), t.headers.token = W(), t != null && t.customResHandler && (t != null && t.url) && (this.customResMap[t == null ? void 0 : t.url] = t.customResHandler), t;
2271
+ (config2) => {
2272
+ var _a;
2273
+ if (!((_a = config2.headers) == null ? void 0 : _a.noLoading)) {
2274
+ showFullScreenLoading();
2275
+ }
2276
+ config2.headers.token = getToken();
2277
+ if ((config2 == null ? void 0 : config2.customResHandler) && (config2 == null ? void 0 : config2.url)) {
2278
+ this.customResMap[config2 == null ? void 0 : config2.url] = config2.customResHandler;
2279
+ }
2280
+ return config2;
1603
2281
  },
1604
- (t) => Promise.reject(t)
1605
- ), this.service.interceptors.response.use(
1606
- (t) => {
1607
- const { data: n, config: r } = t;
1608
- return Le(), r.url && this.customResMap[r.url] ? this.customResMap[r.url](n) : (n.code == ae.OVERDUE ? this.handleOverdueResponse(n) : n.code !== ae.SUCCESS && this.handleErrorResponse(n), n);
2282
+ (error) => {
2283
+ return Promise.reject(error);
2284
+ }
2285
+ );
2286
+ this.service.interceptors.response.use(
2287
+ (response) => {
2288
+ const { data, config: config2 } = response;
2289
+ hideFullScreenLoading();
2290
+ if (config2.url && this.customResMap[config2.url]) {
2291
+ return this.customResMap[config2.url](data);
2292
+ }
2293
+ if (data.code == ResultEnum.OVERDUE) {
2294
+ this.handleOverdueResponse(data);
2295
+ } else if (data.code !== ResultEnum.SUCCESS) {
2296
+ this.handleErrorResponse(data);
2297
+ }
2298
+ return data;
1609
2299
  },
1610
- (t) => {
1611
- Le();
1612
- const { config: n } = t;
1613
- return n != null && n.url && this.customResMap[n.url] && this.customResMap[n.url](t.response), t.message.includes("timeout") ? S.error("请求超时!请稍后重试") : t.message.includes("Network Error") && S.error("网络错误!请稍后重试"), t.response && Bn(t.response.status), window.navigator.onLine || Se({
1614
- title: "提示",
1615
- message: "当前网络似乎开小差了",
1616
- type: "warning",
1617
- duration: 5e3
1618
- }), Promise.reject(t);
2300
+ (error) => {
2301
+ hideFullScreenLoading();
2302
+ const { config: config2 } = error;
2303
+ if ((config2 == null ? void 0 : config2.url) && this.customResMap[config2.url]) {
2304
+ this.customResMap[config2.url](error.response);
2305
+ }
2306
+ if (error.message.includes("timeout")) {
2307
+ ElMessage.error("请求超时!请稍后重试");
2308
+ } else if (error.message.includes("Network Error")) {
2309
+ ElMessage.error("网络错误!请稍后重试");
2310
+ }
2311
+ if (error.response) {
2312
+ checkStatus(error.response.status);
2313
+ }
2314
+ if (!window.navigator.onLine) {
2315
+ ElNotification({
2316
+ title: "提示",
2317
+ message: "当前网络似乎开小差了",
2318
+ type: "warning",
2319
+ duration: 5e3
2320
+ });
2321
+ }
2322
+ return Promise.reject(error);
1619
2323
  }
1620
2324
  );
1621
2325
  }
1622
- handleOverdueResponse(t) {
1623
- return me(), X(), Se({
2326
+ handleOverdueResponse(data) {
2327
+ removeToken();
2328
+ jumpToLogin();
2329
+ ElNotification({
1624
2330
  title: "登录过期提醒",
1625
- message: t.resultMsg || "当前登录失效",
2331
+ message: data.resultMsg || "当前登录失效",
1626
2332
  type: "warning",
1627
2333
  duration: 5e3
1628
- }), Promise.reject(t);
2334
+ });
2335
+ return Promise.reject(data);
1629
2336
  }
1630
- handleErrorResponse(t) {
1631
- return S.error(t.resultMsg), Promise.reject(t);
2337
+ handleErrorResponse(data) {
2338
+ ElMessage.error(data.resultMsg);
2339
+ return Promise.reject(data);
1632
2340
  }
1633
2341
  /**
1634
2342
  *
@@ -1637,8 +2345,8 @@ class Fn {
1637
2345
  * @param options : AxiosRequestConfig
1638
2346
  * @description get 请求
1639
2347
  */
1640
- get(t, n, r = {}) {
1641
- return this.service.get(t, U({ params: n }, r));
2348
+ get(url, params, options = {}) {
2349
+ return this.service.get(url, __spreadValues({ params }, options));
1642
2350
  }
1643
2351
  /**
1644
2352
  *
@@ -1647,8 +2355,8 @@ class Fn {
1647
2355
  * @param options : AxiosRequestConfig
1648
2356
  * @description post 请求
1649
2357
  */
1650
- post(t, n, r = {}) {
1651
- return this.service.post(t, n, r);
2358
+ post(url, params, options = {}) {
2359
+ return this.service.post(url, params, options);
1652
2360
  }
1653
2361
  /**
1654
2362
  *
@@ -1656,8 +2364,8 @@ class Fn {
1656
2364
  * @param params
1657
2365
  * @param options : AxiosRequestConfig
1658
2366
  */
1659
- put(t, n, r = {}) {
1660
- return this.service.put(t, n, r);
2367
+ put(url, params, options = {}) {
2368
+ return this.service.put(url, params, options);
1661
2369
  }
1662
2370
  /**
1663
2371
  *
@@ -1665,18 +2373,18 @@ class Fn {
1665
2373
  * @param params
1666
2374
  * @param options : AxiosRequestConfig
1667
2375
  */
1668
- delete(t, n, r = {}) {
1669
- return this.service.delete(t, U({ params: n }, r));
2376
+ delete(url, params, options = {}) {
2377
+ return this.service.delete(url, __spreadValues({ params }, options));
1670
2378
  }
1671
2379
  }
1672
- const Ee = new Fn(_n);
2380
+ const http = new YxHttp(config);
1673
2381
  export {
1674
- jn as B,
1675
- Qe as U,
1676
- I as a,
1677
- In as b,
1678
- Pn as g,
1679
- Ee as h,
1680
- Mn as i,
1681
- ye as s
2382
+ BC_LANG_NAME as B,
2383
+ URL as U,
2384
+ getSystemConfig as a,
2385
+ BC_THEME_NAME as b,
2386
+ getUserIsHaveBtnPower as g,
2387
+ http as h,
2388
+ index as i,
2389
+ setSystemConfig as s
1682
2390
  };