@vtj/utils 0.17.8 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -11
- package/dist/index.iife.js +5 -5
- package/dist/index.mjs +449 -2564
- package/dist/index.umd.js +5 -5
- package/package.json +4 -4
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,2654 +1,539 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { omit as
|
|
1
|
+
var N = Object.defineProperty;
|
|
2
|
+
var $ = (n, e, t) => e in n ? N(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var p = (n, e, t) => $(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { omit as O, merge as v, debounce as H, throttle as V, isUrl as T, pathToRegexpCompile as z, uuid as X, rURL as Y, template as K } from "@vtj/base";
|
|
5
5
|
export * from "@vtj/base";
|
|
6
|
-
import { ref as
|
|
6
|
+
import { ref as R } from "vue";
|
|
7
|
+
import A from "axios";
|
|
8
|
+
import { default as Ge } from "axios";
|
|
7
9
|
(function() {
|
|
8
10
|
if (typeof window > "u" || typeof EventTarget > "u")
|
|
9
11
|
return;
|
|
10
|
-
const
|
|
11
|
-
EventTarget.prototype.addEventListener = function(e,
|
|
12
|
-
typeof
|
|
12
|
+
const n = EventTarget.prototype.addEventListener;
|
|
13
|
+
EventTarget.prototype.addEventListener = function(e, t, o) {
|
|
14
|
+
typeof o != "boolean" && (o = o || {}, o.passive = !1), n.call(this, e, t, o);
|
|
13
15
|
};
|
|
14
16
|
})();
|
|
15
17
|
/**!
|
|
16
18
|
* Copyright (c) 2026, VTJ.PRO All rights reserved.
|
|
17
19
|
* @name @vtj/utils
|
|
18
20
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
19
|
-
* @version 0.
|
|
21
|
+
* @version 0.18.1
|
|
20
22
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
21
23
|
*/
|
|
22
|
-
const
|
|
23
|
-
function gt(t, e) {
|
|
24
|
-
return function() {
|
|
25
|
-
return t.apply(e, arguments);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
const { toString: en } = Object.prototype, { getPrototypeOf: ge } = Object, { iterator: we, toStringTag: wt } = Symbol, be = /* @__PURE__ */ ((t) => (e) => {
|
|
29
|
-
const n = en.call(e);
|
|
30
|
-
return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
|
|
31
|
-
})(/* @__PURE__ */ Object.create(null)), U = (t) => (t = t.toLowerCase(), (e) => be(e) === t), Ee = (t) => (e) => typeof e === t, { isArray: X } = Array, K = Ee("undefined");
|
|
32
|
-
function re(t) {
|
|
33
|
-
return t !== null && !K(t) && t.constructor !== null && !K(t.constructor) && C(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
34
|
-
}
|
|
35
|
-
const bt = U("ArrayBuffer");
|
|
36
|
-
function tn(t) {
|
|
37
|
-
let e;
|
|
38
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && bt(t.buffer), e;
|
|
39
|
-
}
|
|
40
|
-
const nn = Ee("string"), C = Ee("function"), Et = Ee("number"), oe = (t) => t !== null && typeof t == "object", rn = (t) => t === !0 || t === !1, pe = (t) => {
|
|
41
|
-
if (be(t) !== "object")
|
|
42
|
-
return !1;
|
|
43
|
-
const e = ge(t);
|
|
44
|
-
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(wt in t) && !(we in t);
|
|
45
|
-
}, on = (t) => {
|
|
46
|
-
if (!oe(t) || re(t))
|
|
47
|
-
return !1;
|
|
48
|
-
try {
|
|
49
|
-
return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
|
|
50
|
-
} catch {
|
|
51
|
-
return !1;
|
|
52
|
-
}
|
|
53
|
-
}, sn = U("Date"), an = U("File"), cn = (t) => !!(t && typeof t.uri < "u"), ln = (t) => t && typeof t.getParts < "u", un = U("Blob"), fn = U("FileList"), dn = (t) => oe(t) && C(t.pipe);
|
|
54
|
-
function pn() {
|
|
55
|
-
return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
56
|
-
}
|
|
57
|
-
const Ze = pn(), et = typeof Ze.FormData < "u" ? Ze.FormData : void 0, hn = (t) => {
|
|
58
|
-
if (!t) return !1;
|
|
59
|
-
if (et && t instanceof et) return !0;
|
|
60
|
-
const e = ge(t);
|
|
61
|
-
if (!e || e === Object.prototype || !C(t.append)) return !1;
|
|
62
|
-
const n = be(t);
|
|
63
|
-
return n === "formdata" || // detect form-data instance
|
|
64
|
-
n === "object" && C(t.toString) && t.toString() === "[object FormData]";
|
|
65
|
-
}, mn = U("URLSearchParams"), [yn, gn, wn, bn] = [
|
|
66
|
-
"ReadableStream",
|
|
67
|
-
"Request",
|
|
68
|
-
"Response",
|
|
69
|
-
"Headers"
|
|
70
|
-
].map(U), En = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
71
|
-
function se(t, e, { allOwnKeys: n = !1 } = {}) {
|
|
72
|
-
if (t === null || typeof t > "u")
|
|
73
|
-
return;
|
|
74
|
-
let r, o;
|
|
75
|
-
if (typeof t != "object" && (t = [t]), X(t))
|
|
76
|
-
for (r = 0, o = t.length; r < o; r++)
|
|
77
|
-
e.call(null, t[r], r, t);
|
|
78
|
-
else {
|
|
79
|
-
if (re(t))
|
|
80
|
-
return;
|
|
81
|
-
const s = n ? Object.getOwnPropertyNames(t) : Object.keys(t), i = s.length;
|
|
82
|
-
let a;
|
|
83
|
-
for (r = 0; r < i; r++)
|
|
84
|
-
a = s[r], e.call(null, t[a], a, t);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function Rt(t, e) {
|
|
88
|
-
if (re(t))
|
|
89
|
-
return null;
|
|
90
|
-
e = e.toLowerCase();
|
|
91
|
-
const n = Object.keys(t);
|
|
92
|
-
let r = n.length, o;
|
|
93
|
-
for (; r-- > 0; )
|
|
94
|
-
if (o = n[r], e === o.toLowerCase())
|
|
95
|
-
return o;
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
const $ = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ot = (t) => !K(t) && t !== $;
|
|
99
|
-
function Ue(...t) {
|
|
100
|
-
const { caseless: e, skipUndefined: n } = Ot(this) && this || {}, r = {}, o = (s, i) => {
|
|
101
|
-
if (i === "__proto__" || i === "constructor" || i === "prototype")
|
|
102
|
-
return;
|
|
103
|
-
const a = e && Rt(r, i) || i, l = Fe(r, a) ? r[a] : void 0;
|
|
104
|
-
pe(l) && pe(s) ? r[a] = Ue(l, s) : pe(s) ? r[a] = Ue({}, s) : X(s) ? r[a] = s.slice() : (!n || !K(s)) && (r[a] = s);
|
|
105
|
-
};
|
|
106
|
-
for (let s = 0, i = t.length; s < i; s++)
|
|
107
|
-
t[s] && se(t[s], o);
|
|
108
|
-
return r;
|
|
109
|
-
}
|
|
110
|
-
const Rn = (t, e, n, { allOwnKeys: r } = {}) => (se(
|
|
111
|
-
e,
|
|
112
|
-
(o, s) => {
|
|
113
|
-
n && C(o) ? Object.defineProperty(t, s, {
|
|
114
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot
|
|
115
|
-
// hijack defineProperty's accessor-vs-data resolution.
|
|
116
|
-
__proto__: null,
|
|
117
|
-
value: gt(o, n),
|
|
118
|
-
writable: !0,
|
|
119
|
-
enumerable: !0,
|
|
120
|
-
configurable: !0
|
|
121
|
-
}) : Object.defineProperty(t, s, {
|
|
122
|
-
__proto__: null,
|
|
123
|
-
value: o,
|
|
124
|
-
writable: !0,
|
|
125
|
-
enumerable: !0,
|
|
126
|
-
configurable: !0
|
|
127
|
-
});
|
|
128
|
-
},
|
|
129
|
-
{ allOwnKeys: r }
|
|
130
|
-
), t), On = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Sn = (t, e, n, r) => {
|
|
131
|
-
t.prototype = Object.create(e.prototype, r), Object.defineProperty(t.prototype, "constructor", {
|
|
132
|
-
__proto__: null,
|
|
133
|
-
value: t,
|
|
134
|
-
writable: !0,
|
|
135
|
-
enumerable: !1,
|
|
136
|
-
configurable: !0
|
|
137
|
-
}), Object.defineProperty(t, "super", {
|
|
138
|
-
__proto__: null,
|
|
139
|
-
value: e.prototype
|
|
140
|
-
}), n && Object.assign(t.prototype, n);
|
|
141
|
-
}, _n = (t, e, n, r) => {
|
|
142
|
-
let o, s, i;
|
|
143
|
-
const a = {};
|
|
144
|
-
if (e = e || {}, t == null) return e;
|
|
145
|
-
do {
|
|
146
|
-
for (o = Object.getOwnPropertyNames(t), s = o.length; s-- > 0; )
|
|
147
|
-
i = o[s], (!r || r(i, t, e)) && !a[i] && (e[i] = t[i], a[i] = !0);
|
|
148
|
-
t = n !== !1 && ge(t);
|
|
149
|
-
} while (t && (!n || n(t, e)) && t !== Object.prototype);
|
|
150
|
-
return e;
|
|
151
|
-
}, An = (t, e, n) => {
|
|
152
|
-
t = String(t), (n === void 0 || n > t.length) && (n = t.length), n -= e.length;
|
|
153
|
-
const r = t.indexOf(e, n);
|
|
154
|
-
return r !== -1 && r === n;
|
|
155
|
-
}, Tn = (t) => {
|
|
156
|
-
if (!t) return null;
|
|
157
|
-
if (X(t)) return t;
|
|
158
|
-
let e = t.length;
|
|
159
|
-
if (!Et(e)) return null;
|
|
160
|
-
const n = new Array(e);
|
|
161
|
-
for (; e-- > 0; )
|
|
162
|
-
n[e] = t[e];
|
|
163
|
-
return n;
|
|
164
|
-
}, xn = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && ge(Uint8Array)), Cn = (t, e) => {
|
|
165
|
-
const r = (t && t[we]).call(t);
|
|
166
|
-
let o;
|
|
167
|
-
for (; (o = r.next()) && !o.done; ) {
|
|
168
|
-
const s = o.value;
|
|
169
|
-
e.call(t, s[0], s[1]);
|
|
170
|
-
}
|
|
171
|
-
}, Pn = (t, e) => {
|
|
172
|
-
let n;
|
|
173
|
-
const r = [];
|
|
174
|
-
for (; (n = t.exec(e)) !== null; )
|
|
175
|
-
r.push(n);
|
|
176
|
-
return r;
|
|
177
|
-
}, Ln = U("HTMLFormElement"), Nn = (t) => t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(n, r, o) {
|
|
178
|
-
return r.toUpperCase() + o;
|
|
179
|
-
}), Fe = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), Dn = U("RegExp"), St = (t, e) => {
|
|
180
|
-
const n = Object.getOwnPropertyDescriptors(t), r = {};
|
|
181
|
-
se(n, (o, s) => {
|
|
182
|
-
let i;
|
|
183
|
-
(i = e(o, s, t)) !== !1 && (r[s] = i || o);
|
|
184
|
-
}), Object.defineProperties(t, r);
|
|
185
|
-
}, Un = (t) => {
|
|
186
|
-
St(t, (e, n) => {
|
|
187
|
-
if (C(t) && ["arguments", "caller", "callee"].includes(n))
|
|
188
|
-
return !1;
|
|
189
|
-
const r = t[n];
|
|
190
|
-
if (C(r)) {
|
|
191
|
-
if (e.enumerable = !1, "writable" in e) {
|
|
192
|
-
e.writable = !1;
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
e.set || (e.set = () => {
|
|
196
|
-
throw Error("Can not rewrite read-only method '" + n + "'");
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
}, Fn = (t, e) => {
|
|
201
|
-
const n = {}, r = (o) => {
|
|
202
|
-
o.forEach((s) => {
|
|
203
|
-
n[s] = !0;
|
|
204
|
-
});
|
|
205
|
-
};
|
|
206
|
-
return X(t) ? r(t) : r(String(t).split(e)), n;
|
|
207
|
-
}, jn = () => {
|
|
208
|
-
}, kn = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
|
|
209
|
-
function Bn(t) {
|
|
210
|
-
return !!(t && C(t.append) && t[wt] === "FormData" && t[we]);
|
|
211
|
-
}
|
|
212
|
-
const vn = (t) => {
|
|
213
|
-
const e = /* @__PURE__ */ new WeakSet(), n = (r) => {
|
|
214
|
-
if (oe(r)) {
|
|
215
|
-
if (e.has(r))
|
|
216
|
-
return;
|
|
217
|
-
if (re(r))
|
|
218
|
-
return r;
|
|
219
|
-
if (!("toJSON" in r)) {
|
|
220
|
-
e.add(r);
|
|
221
|
-
const o = X(r) ? [] : {};
|
|
222
|
-
return se(r, (s, i) => {
|
|
223
|
-
const a = n(s);
|
|
224
|
-
!K(a) && (o[i] = a);
|
|
225
|
-
}), e.delete(r), o;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return r;
|
|
229
|
-
};
|
|
230
|
-
return n(t);
|
|
231
|
-
}, In = U("AsyncFunction"), qn = (t) => t && (oe(t) || C(t)) && C(t.then) && C(t.catch), _t = ((t, e) => t ? setImmediate : e ? ((n, r) => ($.addEventListener(
|
|
232
|
-
"message",
|
|
233
|
-
({ source: o, data: s }) => {
|
|
234
|
-
o === $ && s === n && r.length && r.shift()();
|
|
235
|
-
},
|
|
236
|
-
!1
|
|
237
|
-
), (o) => {
|
|
238
|
-
r.push(o), $.postMessage(n, "*");
|
|
239
|
-
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", C($.postMessage)), Mn = typeof queueMicrotask < "u" ? queueMicrotask.bind($) : typeof process < "u" && process.nextTick || _t, Hn = (t) => t != null && C(t[we]), c = {
|
|
240
|
-
isArray: X,
|
|
241
|
-
isArrayBuffer: bt,
|
|
242
|
-
isBuffer: re,
|
|
243
|
-
isFormData: hn,
|
|
244
|
-
isArrayBufferView: tn,
|
|
245
|
-
isString: nn,
|
|
246
|
-
isNumber: Et,
|
|
247
|
-
isBoolean: rn,
|
|
248
|
-
isObject: oe,
|
|
249
|
-
isPlainObject: pe,
|
|
250
|
-
isEmptyObject: on,
|
|
251
|
-
isReadableStream: yn,
|
|
252
|
-
isRequest: gn,
|
|
253
|
-
isResponse: wn,
|
|
254
|
-
isHeaders: bn,
|
|
255
|
-
isUndefined: K,
|
|
256
|
-
isDate: sn,
|
|
257
|
-
isFile: an,
|
|
258
|
-
isReactNativeBlob: cn,
|
|
259
|
-
isReactNative: ln,
|
|
260
|
-
isBlob: un,
|
|
261
|
-
isRegExp: Dn,
|
|
262
|
-
isFunction: C,
|
|
263
|
-
isStream: dn,
|
|
264
|
-
isURLSearchParams: mn,
|
|
265
|
-
isTypedArray: xn,
|
|
266
|
-
isFileList: fn,
|
|
267
|
-
forEach: se,
|
|
268
|
-
merge: Ue,
|
|
269
|
-
extend: Rn,
|
|
270
|
-
trim: En,
|
|
271
|
-
stripBOM: On,
|
|
272
|
-
inherits: Sn,
|
|
273
|
-
toFlatObject: _n,
|
|
274
|
-
kindOf: be,
|
|
275
|
-
kindOfTest: U,
|
|
276
|
-
endsWith: An,
|
|
277
|
-
toArray: Tn,
|
|
278
|
-
forEachEntry: Cn,
|
|
279
|
-
matchAll: Pn,
|
|
280
|
-
isHTMLForm: Ln,
|
|
281
|
-
hasOwnProperty: Fe,
|
|
282
|
-
hasOwnProp: Fe,
|
|
283
|
-
// an alias to avoid ESLint no-prototype-builtins detection
|
|
284
|
-
reduceDescriptors: St,
|
|
285
|
-
freezeMethods: Un,
|
|
286
|
-
toObjectSet: Fn,
|
|
287
|
-
toCamelCase: Nn,
|
|
288
|
-
noop: jn,
|
|
289
|
-
toFiniteNumber: kn,
|
|
290
|
-
findKey: Rt,
|
|
291
|
-
global: $,
|
|
292
|
-
isContextDefined: Ot,
|
|
293
|
-
isSpecCompliantForm: Bn,
|
|
294
|
-
toJSONObject: vn,
|
|
295
|
-
isAsyncFn: In,
|
|
296
|
-
isThenable: qn,
|
|
297
|
-
setImmediate: _t,
|
|
298
|
-
asap: Mn,
|
|
299
|
-
isIterable: Hn
|
|
300
|
-
}, $n = c.toObjectSet([
|
|
301
|
-
"age",
|
|
302
|
-
"authorization",
|
|
303
|
-
"content-length",
|
|
304
|
-
"content-type",
|
|
305
|
-
"etag",
|
|
306
|
-
"expires",
|
|
307
|
-
"from",
|
|
308
|
-
"host",
|
|
309
|
-
"if-modified-since",
|
|
310
|
-
"if-unmodified-since",
|
|
311
|
-
"last-modified",
|
|
312
|
-
"location",
|
|
313
|
-
"max-forwards",
|
|
314
|
-
"proxy-authorization",
|
|
315
|
-
"referer",
|
|
316
|
-
"retry-after",
|
|
317
|
-
"user-agent"
|
|
318
|
-
]), zn = (t) => {
|
|
319
|
-
const e = {};
|
|
320
|
-
let n, r, o;
|
|
321
|
-
return t && t.split(`
|
|
322
|
-
`).forEach(function(i) {
|
|
323
|
-
o = i.indexOf(":"), n = i.substring(0, o).trim().toLowerCase(), r = i.substring(o + 1).trim(), !(!n || e[n] && $n[n]) && (n === "set-cookie" ? e[n] ? e[n].push(r) : e[n] = [r] : e[n] = e[n] ? e[n] + ", " + r : r);
|
|
324
|
-
}), e;
|
|
325
|
-
};
|
|
326
|
-
function Jn(t) {
|
|
327
|
-
let e = 0, n = t.length;
|
|
328
|
-
for (; e < n; ) {
|
|
329
|
-
const r = t.charCodeAt(e);
|
|
330
|
-
if (r !== 9 && r !== 32)
|
|
331
|
-
break;
|
|
332
|
-
e += 1;
|
|
333
|
-
}
|
|
334
|
-
for (; n > e; ) {
|
|
335
|
-
const r = t.charCodeAt(n - 1);
|
|
336
|
-
if (r !== 9 && r !== 32)
|
|
337
|
-
break;
|
|
338
|
-
n -= 1;
|
|
339
|
-
}
|
|
340
|
-
return e === 0 && n === t.length ? t : t.slice(e, n);
|
|
341
|
-
}
|
|
342
|
-
const Wn = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g"), Vn = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
|
|
343
|
-
function qe(t, e) {
|
|
344
|
-
return c.isArray(t) ? t.map((n) => qe(n, e)) : Jn(String(t).replace(e, ""));
|
|
345
|
-
}
|
|
346
|
-
const Kn = (t) => qe(t, Wn), Xn = (t) => qe(t, Vn);
|
|
347
|
-
function At(t) {
|
|
348
|
-
const e = /* @__PURE__ */ Object.create(null);
|
|
349
|
-
return c.forEach(t.toJSON(), (n, r) => {
|
|
350
|
-
e[r] = Xn(n);
|
|
351
|
-
}), e;
|
|
352
|
-
}
|
|
353
|
-
const tt = Symbol("internals");
|
|
354
|
-
function Z(t) {
|
|
355
|
-
return t && String(t).trim().toLowerCase();
|
|
356
|
-
}
|
|
357
|
-
function he(t) {
|
|
358
|
-
return t === !1 || t == null ? t : c.isArray(t) ? t.map(he) : Kn(String(t));
|
|
359
|
-
}
|
|
360
|
-
function Gn(t) {
|
|
361
|
-
const e = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
362
|
-
let r;
|
|
363
|
-
for (; r = n.exec(t); )
|
|
364
|
-
e[r[1]] = r[2];
|
|
365
|
-
return e;
|
|
366
|
-
}
|
|
367
|
-
const Qn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
368
|
-
function Ce(t, e, n, r, o) {
|
|
369
|
-
if (c.isFunction(r))
|
|
370
|
-
return r.call(this, e, n);
|
|
371
|
-
if (o && (e = n), !!c.isString(e)) {
|
|
372
|
-
if (c.isString(r))
|
|
373
|
-
return e.indexOf(r) !== -1;
|
|
374
|
-
if (c.isRegExp(r))
|
|
375
|
-
return r.test(e);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
function Yn(t) {
|
|
379
|
-
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, n, r) => n.toUpperCase() + r);
|
|
380
|
-
}
|
|
381
|
-
function Zn(t, e) {
|
|
382
|
-
const n = c.toCamelCase(" " + e);
|
|
383
|
-
["get", "set", "has"].forEach((r) => {
|
|
384
|
-
Object.defineProperty(t, r + n, {
|
|
385
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
386
|
-
// this data descriptor into an accessor descriptor on the way in.
|
|
387
|
-
__proto__: null,
|
|
388
|
-
value: function(o, s, i) {
|
|
389
|
-
return this[r].call(this, e, o, s, i);
|
|
390
|
-
},
|
|
391
|
-
configurable: !0
|
|
392
|
-
});
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
let x = class {
|
|
396
|
-
constructor(e) {
|
|
397
|
-
e && this.set(e);
|
|
398
|
-
}
|
|
399
|
-
set(e, n, r) {
|
|
400
|
-
const o = this;
|
|
401
|
-
function s(a, l, f) {
|
|
402
|
-
const u = Z(l);
|
|
403
|
-
if (!u)
|
|
404
|
-
throw new Error("header name must be a non-empty string");
|
|
405
|
-
const p = c.findKey(o, u);
|
|
406
|
-
(!p || o[p] === void 0 || f === !0 || f === void 0 && o[p] !== !1) && (o[p || l] = he(a));
|
|
407
|
-
}
|
|
408
|
-
const i = (a, l) => c.forEach(a, (f, u) => s(f, u, l));
|
|
409
|
-
if (c.isPlainObject(e) || e instanceof this.constructor)
|
|
410
|
-
i(e, n);
|
|
411
|
-
else if (c.isString(e) && (e = e.trim()) && !Qn(e))
|
|
412
|
-
i(zn(e), n);
|
|
413
|
-
else if (c.isObject(e) && c.isIterable(e)) {
|
|
414
|
-
let a = {}, l, f;
|
|
415
|
-
for (const u of e) {
|
|
416
|
-
if (!c.isArray(u))
|
|
417
|
-
throw TypeError("Object iterator must return a key-value pair");
|
|
418
|
-
a[f = u[0]] = (l = a[f]) ? c.isArray(l) ? [...l, u[1]] : [l, u[1]] : u[1];
|
|
419
|
-
}
|
|
420
|
-
i(a, n);
|
|
421
|
-
} else
|
|
422
|
-
e != null && s(n, e, r);
|
|
423
|
-
return this;
|
|
424
|
-
}
|
|
425
|
-
get(e, n) {
|
|
426
|
-
if (e = Z(e), e) {
|
|
427
|
-
const r = c.findKey(this, e);
|
|
428
|
-
if (r) {
|
|
429
|
-
const o = this[r];
|
|
430
|
-
if (!n)
|
|
431
|
-
return o;
|
|
432
|
-
if (n === !0)
|
|
433
|
-
return Gn(o);
|
|
434
|
-
if (c.isFunction(n))
|
|
435
|
-
return n.call(this, o, r);
|
|
436
|
-
if (c.isRegExp(n))
|
|
437
|
-
return n.exec(o);
|
|
438
|
-
throw new TypeError("parser must be boolean|regexp|function");
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
has(e, n) {
|
|
443
|
-
if (e = Z(e), e) {
|
|
444
|
-
const r = c.findKey(this, e);
|
|
445
|
-
return !!(r && this[r] !== void 0 && (!n || Ce(this, this[r], r, n)));
|
|
446
|
-
}
|
|
447
|
-
return !1;
|
|
448
|
-
}
|
|
449
|
-
delete(e, n) {
|
|
450
|
-
const r = this;
|
|
451
|
-
let o = !1;
|
|
452
|
-
function s(i) {
|
|
453
|
-
if (i = Z(i), i) {
|
|
454
|
-
const a = c.findKey(r, i);
|
|
455
|
-
a && (!n || Ce(r, r[a], a, n)) && (delete r[a], o = !0);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
return c.isArray(e) ? e.forEach(s) : s(e), o;
|
|
459
|
-
}
|
|
460
|
-
clear(e) {
|
|
461
|
-
const n = Object.keys(this);
|
|
462
|
-
let r = n.length, o = !1;
|
|
463
|
-
for (; r--; ) {
|
|
464
|
-
const s = n[r];
|
|
465
|
-
(!e || Ce(this, this[s], s, e, !0)) && (delete this[s], o = !0);
|
|
466
|
-
}
|
|
467
|
-
return o;
|
|
468
|
-
}
|
|
469
|
-
normalize(e) {
|
|
470
|
-
const n = this, r = {};
|
|
471
|
-
return c.forEach(this, (o, s) => {
|
|
472
|
-
const i = c.findKey(r, s);
|
|
473
|
-
if (i) {
|
|
474
|
-
n[i] = he(o), delete n[s];
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
const a = e ? Yn(s) : String(s).trim();
|
|
478
|
-
a !== s && delete n[s], n[a] = he(o), r[a] = !0;
|
|
479
|
-
}), this;
|
|
480
|
-
}
|
|
481
|
-
concat(...e) {
|
|
482
|
-
return this.constructor.concat(this, ...e);
|
|
483
|
-
}
|
|
484
|
-
toJSON(e) {
|
|
485
|
-
const n = /* @__PURE__ */ Object.create(null);
|
|
486
|
-
return c.forEach(this, (r, o) => {
|
|
487
|
-
r != null && r !== !1 && (n[o] = e && c.isArray(r) ? r.join(", ") : r);
|
|
488
|
-
}), n;
|
|
489
|
-
}
|
|
490
|
-
[Symbol.iterator]() {
|
|
491
|
-
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
492
|
-
}
|
|
493
|
-
toString() {
|
|
494
|
-
return Object.entries(this.toJSON()).map(([e, n]) => e + ": " + n).join(`
|
|
495
|
-
`);
|
|
496
|
-
}
|
|
497
|
-
getSetCookie() {
|
|
498
|
-
return this.get("set-cookie") || [];
|
|
499
|
-
}
|
|
500
|
-
get [Symbol.toStringTag]() {
|
|
501
|
-
return "AxiosHeaders";
|
|
502
|
-
}
|
|
503
|
-
static from(e) {
|
|
504
|
-
return e instanceof this ? e : new this(e);
|
|
505
|
-
}
|
|
506
|
-
static concat(e, ...n) {
|
|
507
|
-
const r = new this(e);
|
|
508
|
-
return n.forEach((o) => r.set(o)), r;
|
|
509
|
-
}
|
|
510
|
-
static accessor(e) {
|
|
511
|
-
const r = (this[tt] = this[tt] = {
|
|
512
|
-
accessors: {}
|
|
513
|
-
}).accessors, o = this.prototype;
|
|
514
|
-
function s(i) {
|
|
515
|
-
const a = Z(i);
|
|
516
|
-
r[a] || (Zn(o, i), r[a] = !0);
|
|
517
|
-
}
|
|
518
|
-
return c.isArray(e) ? e.forEach(s) : s(e), this;
|
|
519
|
-
}
|
|
520
|
-
};
|
|
521
|
-
x.accessor([
|
|
522
|
-
"Content-Type",
|
|
523
|
-
"Content-Length",
|
|
524
|
-
"Accept",
|
|
525
|
-
"Accept-Encoding",
|
|
526
|
-
"User-Agent",
|
|
527
|
-
"Authorization"
|
|
528
|
-
]);
|
|
529
|
-
c.reduceDescriptors(x.prototype, ({ value: t }, e) => {
|
|
530
|
-
let n = e[0].toUpperCase() + e.slice(1);
|
|
531
|
-
return {
|
|
532
|
-
get: () => t,
|
|
533
|
-
set(r) {
|
|
534
|
-
this[n] = r;
|
|
535
|
-
}
|
|
536
|
-
};
|
|
537
|
-
});
|
|
538
|
-
c.freezeMethods(x);
|
|
539
|
-
const er = "[REDACTED ****]";
|
|
540
|
-
function tr(t) {
|
|
541
|
-
if (c.hasOwnProp(t, "toJSON"))
|
|
542
|
-
return !0;
|
|
543
|
-
let e = Object.getPrototypeOf(t);
|
|
544
|
-
for (; e && e !== Object.prototype; ) {
|
|
545
|
-
if (c.hasOwnProp(e, "toJSON"))
|
|
546
|
-
return !0;
|
|
547
|
-
e = Object.getPrototypeOf(e);
|
|
548
|
-
}
|
|
549
|
-
return !1;
|
|
550
|
-
}
|
|
551
|
-
function nr(t, e) {
|
|
552
|
-
const n = new Set(e.map((s) => String(s).toLowerCase())), r = [], o = (s) => {
|
|
553
|
-
if (s === null || typeof s != "object" || c.isBuffer(s)) return s;
|
|
554
|
-
if (r.indexOf(s) !== -1) return;
|
|
555
|
-
s instanceof x && (s = s.toJSON()), r.push(s);
|
|
556
|
-
let i;
|
|
557
|
-
if (c.isArray(s))
|
|
558
|
-
i = [], s.forEach((a, l) => {
|
|
559
|
-
const f = o(a);
|
|
560
|
-
c.isUndefined(f) || (i[l] = f);
|
|
561
|
-
});
|
|
562
|
-
else {
|
|
563
|
-
if (!c.isPlainObject(s) && tr(s))
|
|
564
|
-
return r.pop(), s;
|
|
565
|
-
i = /* @__PURE__ */ Object.create(null);
|
|
566
|
-
for (const [a, l] of Object.entries(s)) {
|
|
567
|
-
const f = n.has(a.toLowerCase()) ? er : o(l);
|
|
568
|
-
c.isUndefined(f) || (i[a] = f);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
return r.pop(), i;
|
|
572
|
-
};
|
|
573
|
-
return o(t);
|
|
574
|
-
}
|
|
575
|
-
let y = class Tt extends Error {
|
|
576
|
-
static from(e, n, r, o, s, i) {
|
|
577
|
-
const a = new Tt(e.message, n || e.code, r, o, s);
|
|
578
|
-
return a.cause = e, a.name = e.name, e.status != null && a.status == null && (a.status = e.status), i && Object.assign(a, i), a;
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* Create an Error with the specified message, config, error code, request and response.
|
|
582
|
-
*
|
|
583
|
-
* @param {string} message The error message.
|
|
584
|
-
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
585
|
-
* @param {Object} [config] The config.
|
|
586
|
-
* @param {Object} [request] The request.
|
|
587
|
-
* @param {Object} [response] The response.
|
|
588
|
-
*
|
|
589
|
-
* @returns {Error} The created error.
|
|
590
|
-
*/
|
|
591
|
-
constructor(e, n, r, o, s) {
|
|
592
|
-
super(e), Object.defineProperty(this, "message", {
|
|
593
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
594
|
-
// this data descriptor into an accessor descriptor on the way in.
|
|
595
|
-
__proto__: null,
|
|
596
|
-
value: e,
|
|
597
|
-
enumerable: !0,
|
|
598
|
-
writable: !0,
|
|
599
|
-
configurable: !0
|
|
600
|
-
}), this.name = "AxiosError", this.isAxiosError = !0, n && (this.code = n), r && (this.config = r), o && (this.request = o), s && (this.response = s, this.status = s.status);
|
|
601
|
-
}
|
|
602
|
-
toJSON() {
|
|
603
|
-
const e = this.config, n = e && c.hasOwnProp(e, "redact") ? e.redact : void 0, r = c.isArray(n) && n.length > 0 ? nr(e, n) : c.toJSONObject(e);
|
|
604
|
-
return {
|
|
605
|
-
// Standard
|
|
606
|
-
message: this.message,
|
|
607
|
-
name: this.name,
|
|
608
|
-
// Microsoft
|
|
609
|
-
description: this.description,
|
|
610
|
-
number: this.number,
|
|
611
|
-
// Mozilla
|
|
612
|
-
fileName: this.fileName,
|
|
613
|
-
lineNumber: this.lineNumber,
|
|
614
|
-
columnNumber: this.columnNumber,
|
|
615
|
-
stack: this.stack,
|
|
616
|
-
// Axios
|
|
617
|
-
config: r,
|
|
618
|
-
code: this.code,
|
|
619
|
-
status: this.status
|
|
620
|
-
};
|
|
621
|
-
}
|
|
622
|
-
};
|
|
623
|
-
y.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
624
|
-
y.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
625
|
-
y.ECONNABORTED = "ECONNABORTED";
|
|
626
|
-
y.ETIMEDOUT = "ETIMEDOUT";
|
|
627
|
-
y.ECONNREFUSED = "ECONNREFUSED";
|
|
628
|
-
y.ERR_NETWORK = "ERR_NETWORK";
|
|
629
|
-
y.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
630
|
-
y.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
631
|
-
y.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
632
|
-
y.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
633
|
-
y.ERR_CANCELED = "ERR_CANCELED";
|
|
634
|
-
y.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
635
|
-
y.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
636
|
-
y.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
|
|
637
|
-
const rr = null;
|
|
638
|
-
function je(t) {
|
|
639
|
-
return c.isPlainObject(t) || c.isArray(t);
|
|
640
|
-
}
|
|
641
|
-
function xt(t) {
|
|
642
|
-
return c.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
643
|
-
}
|
|
644
|
-
function Pe(t, e, n) {
|
|
645
|
-
return t ? t.concat(e).map(function(o, s) {
|
|
646
|
-
return o = xt(o), !n && s ? "[" + o + "]" : o;
|
|
647
|
-
}).join(n ? "." : "") : e;
|
|
648
|
-
}
|
|
649
|
-
function or(t) {
|
|
650
|
-
return c.isArray(t) && !t.some(je);
|
|
651
|
-
}
|
|
652
|
-
const sr = c.toFlatObject(c, {}, null, function(e) {
|
|
653
|
-
return /^is[A-Z]/.test(e);
|
|
654
|
-
});
|
|
655
|
-
function Re(t, e, n) {
|
|
656
|
-
if (!c.isObject(t))
|
|
657
|
-
throw new TypeError("target must be an object");
|
|
658
|
-
e = e || new FormData(), n = c.toFlatObject(
|
|
659
|
-
n,
|
|
660
|
-
{
|
|
661
|
-
metaTokens: !0,
|
|
662
|
-
dots: !1,
|
|
663
|
-
indexes: !1
|
|
664
|
-
},
|
|
665
|
-
!1,
|
|
666
|
-
function(d, m) {
|
|
667
|
-
return !c.isUndefined(m[d]);
|
|
668
|
-
}
|
|
669
|
-
);
|
|
670
|
-
const r = n.metaTokens, o = n.visitor || p, s = n.dots, i = n.indexes, a = n.Blob || typeof Blob < "u" && Blob, l = n.maxDepth === void 0 ? 100 : n.maxDepth, f = a && c.isSpecCompliantForm(e);
|
|
671
|
-
if (!c.isFunction(o))
|
|
672
|
-
throw new TypeError("visitor must be a function");
|
|
673
|
-
function u(h) {
|
|
674
|
-
if (h === null) return "";
|
|
675
|
-
if (c.isDate(h))
|
|
676
|
-
return h.toISOString();
|
|
677
|
-
if (c.isBoolean(h))
|
|
678
|
-
return h.toString();
|
|
679
|
-
if (!f && c.isBlob(h))
|
|
680
|
-
throw new y("Blob is not supported. Use a Buffer instead.");
|
|
681
|
-
return c.isArrayBuffer(h) || c.isTypedArray(h) ? f && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
|
|
682
|
-
}
|
|
683
|
-
function p(h, d, m) {
|
|
684
|
-
let O = h;
|
|
685
|
-
if (c.isReactNative(e) && c.isReactNativeBlob(h))
|
|
686
|
-
return e.append(Pe(m, d, s), u(h)), !1;
|
|
687
|
-
if (h && !m && typeof h == "object") {
|
|
688
|
-
if (c.endsWith(d, "{}"))
|
|
689
|
-
d = r ? d : d.slice(0, -2), h = JSON.stringify(h);
|
|
690
|
-
else if (c.isArray(h) && or(h) || (c.isFileList(h) || c.endsWith(d, "[]")) && (O = c.toArray(h)))
|
|
691
|
-
return d = xt(d), O.forEach(function(R, P) {
|
|
692
|
-
!(c.isUndefined(R) || R === null) && e.append(
|
|
693
|
-
// eslint-disable-next-line no-nested-ternary
|
|
694
|
-
i === !0 ? Pe([d], P, s) : i === null ? d : d + "[]",
|
|
695
|
-
u(R)
|
|
696
|
-
);
|
|
697
|
-
}), !1;
|
|
698
|
-
}
|
|
699
|
-
return je(h) ? !0 : (e.append(Pe(m, d, s), u(h)), !1);
|
|
700
|
-
}
|
|
701
|
-
const g = [], w = Object.assign(sr, {
|
|
702
|
-
defaultVisitor: p,
|
|
703
|
-
convertValue: u,
|
|
704
|
-
isVisitable: je
|
|
705
|
-
});
|
|
706
|
-
function b(h, d, m = 0) {
|
|
707
|
-
if (!c.isUndefined(h)) {
|
|
708
|
-
if (m > l)
|
|
709
|
-
throw new y(
|
|
710
|
-
"Object is too deeply nested (" + m + " levels). Max depth: " + l,
|
|
711
|
-
y.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
712
|
-
);
|
|
713
|
-
if (g.indexOf(h) !== -1)
|
|
714
|
-
throw Error("Circular reference detected in " + d.join("."));
|
|
715
|
-
g.push(h), c.forEach(h, function(E, R) {
|
|
716
|
-
(!(c.isUndefined(E) || E === null) && o.call(e, E, c.isString(R) ? R.trim() : R, d, w)) === !0 && b(E, d ? d.concat(R) : [R], m + 1);
|
|
717
|
-
}), g.pop();
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
if (!c.isObject(t))
|
|
721
|
-
throw new TypeError("data must be an object");
|
|
722
|
-
return b(t), e;
|
|
723
|
-
}
|
|
724
|
-
function nt(t) {
|
|
725
|
-
const e = {
|
|
726
|
-
"!": "%21",
|
|
727
|
-
"'": "%27",
|
|
728
|
-
"(": "%28",
|
|
729
|
-
")": "%29",
|
|
730
|
-
"~": "%7E",
|
|
731
|
-
"%20": "+"
|
|
732
|
-
};
|
|
733
|
-
return encodeURIComponent(t).replace(/[!'()~]|%20/g, function(r) {
|
|
734
|
-
return e[r];
|
|
735
|
-
});
|
|
736
|
-
}
|
|
737
|
-
function Me(t, e) {
|
|
738
|
-
this._pairs = [], t && Re(t, this, e);
|
|
739
|
-
}
|
|
740
|
-
const Ct = Me.prototype;
|
|
741
|
-
Ct.append = function(e, n) {
|
|
742
|
-
this._pairs.push([e, n]);
|
|
743
|
-
};
|
|
744
|
-
Ct.toString = function(e) {
|
|
745
|
-
const n = e ? function(r) {
|
|
746
|
-
return e.call(this, r, nt);
|
|
747
|
-
} : nt;
|
|
748
|
-
return this._pairs.map(function(o) {
|
|
749
|
-
return n(o[0]) + "=" + n(o[1]);
|
|
750
|
-
}, "").join("&");
|
|
751
|
-
};
|
|
752
|
-
function ir(t) {
|
|
753
|
-
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
754
|
-
}
|
|
755
|
-
function Pt(t, e, n) {
|
|
756
|
-
if (!e)
|
|
757
|
-
return t;
|
|
758
|
-
const r = n && n.encode || ir, o = c.isFunction(n) ? {
|
|
759
|
-
serialize: n
|
|
760
|
-
} : n, s = o && o.serialize;
|
|
761
|
-
let i;
|
|
762
|
-
if (s ? i = s(e, o) : i = c.isURLSearchParams(e) ? e.toString() : new Me(e, o).toString(r), i) {
|
|
763
|
-
const a = t.indexOf("#");
|
|
764
|
-
a !== -1 && (t = t.slice(0, a)), t += (t.indexOf("?") === -1 ? "?" : "&") + i;
|
|
765
|
-
}
|
|
766
|
-
return t;
|
|
767
|
-
}
|
|
768
|
-
class rt {
|
|
769
|
-
constructor() {
|
|
770
|
-
this.handlers = [];
|
|
771
|
-
}
|
|
772
|
-
/**
|
|
773
|
-
* Add a new interceptor to the stack
|
|
774
|
-
*
|
|
775
|
-
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
776
|
-
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
777
|
-
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
778
|
-
*
|
|
779
|
-
* @return {Number} An ID used to remove interceptor later
|
|
780
|
-
*/
|
|
781
|
-
use(e, n, r) {
|
|
782
|
-
return this.handlers.push({
|
|
783
|
-
fulfilled: e,
|
|
784
|
-
rejected: n,
|
|
785
|
-
synchronous: r ? r.synchronous : !1,
|
|
786
|
-
runWhen: r ? r.runWhen : null
|
|
787
|
-
}), this.handlers.length - 1;
|
|
788
|
-
}
|
|
789
|
-
/**
|
|
790
|
-
* Remove an interceptor from the stack
|
|
791
|
-
*
|
|
792
|
-
* @param {Number} id The ID that was returned by `use`
|
|
793
|
-
*
|
|
794
|
-
* @returns {void}
|
|
795
|
-
*/
|
|
796
|
-
eject(e) {
|
|
797
|
-
this.handlers[e] && (this.handlers[e] = null);
|
|
798
|
-
}
|
|
799
|
-
/**
|
|
800
|
-
* Clear all interceptors from the stack
|
|
801
|
-
*
|
|
802
|
-
* @returns {void}
|
|
803
|
-
*/
|
|
804
|
-
clear() {
|
|
805
|
-
this.handlers && (this.handlers = []);
|
|
806
|
-
}
|
|
807
|
-
/**
|
|
808
|
-
* Iterate over all the registered interceptors
|
|
809
|
-
*
|
|
810
|
-
* This method is particularly useful for skipping over any
|
|
811
|
-
* interceptors that may have become `null` calling `eject`.
|
|
812
|
-
*
|
|
813
|
-
* @param {Function} fn The function to call for each interceptor
|
|
814
|
-
*
|
|
815
|
-
* @returns {void}
|
|
816
|
-
*/
|
|
817
|
-
forEach(e) {
|
|
818
|
-
c.forEach(this.handlers, function(r) {
|
|
819
|
-
r !== null && e(r);
|
|
820
|
-
});
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
const He = {
|
|
824
|
-
silentJSONParsing: !0,
|
|
825
|
-
forcedJSONParsing: !0,
|
|
826
|
-
clarifyTimeoutError: !1,
|
|
827
|
-
legacyInterceptorReqResOrdering: !0
|
|
828
|
-
}, ar = typeof URLSearchParams < "u" ? URLSearchParams : Me, cr = typeof FormData < "u" ? FormData : null, lr = typeof Blob < "u" ? Blob : null, ur = {
|
|
829
|
-
isBrowser: !0,
|
|
830
|
-
classes: {
|
|
831
|
-
URLSearchParams: ar,
|
|
832
|
-
FormData: cr,
|
|
833
|
-
Blob: lr
|
|
834
|
-
},
|
|
835
|
-
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
836
|
-
}, $e = typeof window < "u" && typeof document < "u", ke = typeof navigator == "object" && navigator || void 0, fr = $e && (!ke || ["ReactNative", "NativeScript", "NS"].indexOf(ke.product) < 0), dr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
837
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", pr = $e && window.location.href || "http://localhost", hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
838
|
-
__proto__: null,
|
|
839
|
-
hasBrowserEnv: $e,
|
|
840
|
-
hasStandardBrowserEnv: fr,
|
|
841
|
-
hasStandardBrowserWebWorkerEnv: dr,
|
|
842
|
-
navigator: ke,
|
|
843
|
-
origin: pr
|
|
844
|
-
}, Symbol.toStringTag, { value: "Module" })), T = {
|
|
845
|
-
...hr,
|
|
846
|
-
...ur
|
|
847
|
-
};
|
|
848
|
-
function mr(t, e) {
|
|
849
|
-
return Re(t, new T.classes.URLSearchParams(), {
|
|
850
|
-
visitor: function(n, r, o, s) {
|
|
851
|
-
return T.isNode && c.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
852
|
-
},
|
|
853
|
-
...e
|
|
854
|
-
});
|
|
855
|
-
}
|
|
856
|
-
function yr(t) {
|
|
857
|
-
return c.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
858
|
-
}
|
|
859
|
-
function gr(t) {
|
|
860
|
-
const e = {}, n = Object.keys(t);
|
|
861
|
-
let r;
|
|
862
|
-
const o = n.length;
|
|
863
|
-
let s;
|
|
864
|
-
for (r = 0; r < o; r++)
|
|
865
|
-
s = n[r], e[s] = t[s];
|
|
866
|
-
return e;
|
|
867
|
-
}
|
|
868
|
-
function Lt(t) {
|
|
869
|
-
function e(n, r, o, s) {
|
|
870
|
-
let i = n[s++];
|
|
871
|
-
if (i === "__proto__") return !0;
|
|
872
|
-
const a = Number.isFinite(+i), l = s >= n.length;
|
|
873
|
-
return i = !i && c.isArray(o) ? o.length : i, l ? (c.hasOwnProp(o, i) ? o[i] = c.isArray(o[i]) ? o[i].concat(r) : [o[i], r] : o[i] = r, !a) : ((!c.hasOwnProp(o, i) || !c.isObject(o[i])) && (o[i] = []), e(n, r, o[i], s) && c.isArray(o[i]) && (o[i] = gr(o[i])), !a);
|
|
874
|
-
}
|
|
875
|
-
if (c.isFormData(t) && c.isFunction(t.entries)) {
|
|
876
|
-
const n = {};
|
|
877
|
-
return c.forEachEntry(t, (r, o) => {
|
|
878
|
-
e(yr(r), o, n, 0);
|
|
879
|
-
}), n;
|
|
880
|
-
}
|
|
881
|
-
return null;
|
|
882
|
-
}
|
|
883
|
-
const V = (t, e) => t != null && c.hasOwnProp(t, e) ? t[e] : void 0;
|
|
884
|
-
function wr(t, e, n) {
|
|
885
|
-
if (c.isString(t))
|
|
886
|
-
try {
|
|
887
|
-
return (e || JSON.parse)(t), c.trim(t);
|
|
888
|
-
} catch (r) {
|
|
889
|
-
if (r.name !== "SyntaxError")
|
|
890
|
-
throw r;
|
|
891
|
-
}
|
|
892
|
-
return (n || JSON.stringify)(t);
|
|
893
|
-
}
|
|
894
|
-
const ie = {
|
|
895
|
-
transitional: He,
|
|
896
|
-
adapter: ["xhr", "http", "fetch"],
|
|
897
|
-
transformRequest: [
|
|
898
|
-
function(e, n) {
|
|
899
|
-
const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = c.isObject(e);
|
|
900
|
-
if (s && c.isHTMLForm(e) && (e = new FormData(e)), c.isFormData(e))
|
|
901
|
-
return o ? JSON.stringify(Lt(e)) : e;
|
|
902
|
-
if (c.isArrayBuffer(e) || c.isBuffer(e) || c.isStream(e) || c.isFile(e) || c.isBlob(e) || c.isReadableStream(e))
|
|
903
|
-
return e;
|
|
904
|
-
if (c.isArrayBufferView(e))
|
|
905
|
-
return e.buffer;
|
|
906
|
-
if (c.isURLSearchParams(e))
|
|
907
|
-
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
908
|
-
let a;
|
|
909
|
-
if (s) {
|
|
910
|
-
const l = V(this, "formSerializer");
|
|
911
|
-
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
912
|
-
return mr(e, l).toString();
|
|
913
|
-
if ((a = c.isFileList(e)) || r.indexOf("multipart/form-data") > -1) {
|
|
914
|
-
const f = V(this, "env"), u = f && f.FormData;
|
|
915
|
-
return Re(
|
|
916
|
-
a ? { "files[]": e } : e,
|
|
917
|
-
u && new u(),
|
|
918
|
-
l
|
|
919
|
-
);
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
return s || o ? (n.setContentType("application/json", !1), wr(e)) : e;
|
|
923
|
-
}
|
|
924
|
-
],
|
|
925
|
-
transformResponse: [
|
|
926
|
-
function(e) {
|
|
927
|
-
const n = V(this, "transitional") || ie.transitional, r = n && n.forcedJSONParsing, o = V(this, "responseType"), s = o === "json";
|
|
928
|
-
if (c.isResponse(e) || c.isReadableStream(e))
|
|
929
|
-
return e;
|
|
930
|
-
if (e && c.isString(e) && (r && !o || s)) {
|
|
931
|
-
const a = !(n && n.silentJSONParsing) && s;
|
|
932
|
-
try {
|
|
933
|
-
return JSON.parse(e, V(this, "parseReviver"));
|
|
934
|
-
} catch (l) {
|
|
935
|
-
if (a)
|
|
936
|
-
throw l.name === "SyntaxError" ? y.from(l, y.ERR_BAD_RESPONSE, this, null, V(this, "response")) : l;
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
return e;
|
|
940
|
-
}
|
|
941
|
-
],
|
|
942
|
-
/**
|
|
943
|
-
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
944
|
-
* timeout is not created.
|
|
945
|
-
*/
|
|
946
|
-
timeout: 0,
|
|
947
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
948
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
949
|
-
maxContentLength: -1,
|
|
950
|
-
maxBodyLength: -1,
|
|
951
|
-
env: {
|
|
952
|
-
FormData: T.classes.FormData,
|
|
953
|
-
Blob: T.classes.Blob
|
|
954
|
-
},
|
|
955
|
-
validateStatus: function(e) {
|
|
956
|
-
return e >= 200 && e < 300;
|
|
957
|
-
},
|
|
958
|
-
headers: {
|
|
959
|
-
common: {
|
|
960
|
-
Accept: "application/json, text/plain, */*",
|
|
961
|
-
"Content-Type": void 0
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
};
|
|
965
|
-
c.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (t) => {
|
|
966
|
-
ie.headers[t] = {};
|
|
967
|
-
});
|
|
968
|
-
function Le(t, e) {
|
|
969
|
-
const n = this || ie, r = e || n, o = x.from(r.headers);
|
|
970
|
-
let s = r.data;
|
|
971
|
-
return c.forEach(t, function(a) {
|
|
972
|
-
s = a.call(n, s, o.normalize(), e ? e.status : void 0);
|
|
973
|
-
}), o.normalize(), s;
|
|
974
|
-
}
|
|
975
|
-
function Nt(t) {
|
|
976
|
-
return !!(t && t.__CANCEL__);
|
|
977
|
-
}
|
|
978
|
-
let ae = class extends y {
|
|
979
|
-
/**
|
|
980
|
-
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
981
|
-
*
|
|
982
|
-
* @param {string=} message The message.
|
|
983
|
-
* @param {Object=} config The config.
|
|
984
|
-
* @param {Object=} request The request.
|
|
985
|
-
*
|
|
986
|
-
* @returns {CanceledError} The created error.
|
|
987
|
-
*/
|
|
988
|
-
constructor(e, n, r) {
|
|
989
|
-
super(e ?? "canceled", y.ERR_CANCELED, n, r), this.name = "CanceledError", this.__CANCEL__ = !0;
|
|
990
|
-
}
|
|
991
|
-
};
|
|
992
|
-
function Dt(t, e, n) {
|
|
993
|
-
const r = n.config.validateStatus;
|
|
994
|
-
!n.status || !r || r(n.status) ? t(n) : e(new y(
|
|
995
|
-
"Request failed with status code " + n.status,
|
|
996
|
-
n.status >= 400 && n.status < 500 ? y.ERR_BAD_REQUEST : y.ERR_BAD_RESPONSE,
|
|
997
|
-
n.config,
|
|
998
|
-
n.request,
|
|
999
|
-
n
|
|
1000
|
-
));
|
|
1001
|
-
}
|
|
1002
|
-
function br(t) {
|
|
1003
|
-
const e = /^([-+\w]{1,25}):(?:\/\/)?/.exec(t);
|
|
1004
|
-
return e && e[1] || "";
|
|
1005
|
-
}
|
|
1006
|
-
function Er(t, e) {
|
|
1007
|
-
t = t || 10;
|
|
1008
|
-
const n = new Array(t), r = new Array(t);
|
|
1009
|
-
let o = 0, s = 0, i;
|
|
1010
|
-
return e = e !== void 0 ? e : 1e3, function(l) {
|
|
1011
|
-
const f = Date.now(), u = r[s];
|
|
1012
|
-
i || (i = f), n[o] = l, r[o] = f;
|
|
1013
|
-
let p = s, g = 0;
|
|
1014
|
-
for (; p !== o; )
|
|
1015
|
-
g += n[p++], p = p % t;
|
|
1016
|
-
if (o = (o + 1) % t, o === s && (s = (s + 1) % t), f - i < e)
|
|
1017
|
-
return;
|
|
1018
|
-
const w = u && f - u;
|
|
1019
|
-
return w ? Math.round(g * 1e3 / w) : void 0;
|
|
1020
|
-
};
|
|
1021
|
-
}
|
|
1022
|
-
function Rr(t, e) {
|
|
1023
|
-
let n = 0, r = 1e3 / e, o, s;
|
|
1024
|
-
const i = (f, u = Date.now()) => {
|
|
1025
|
-
n = u, o = null, s && (clearTimeout(s), s = null), t(...f);
|
|
1026
|
-
};
|
|
1027
|
-
return [(...f) => {
|
|
1028
|
-
const u = Date.now(), p = u - n;
|
|
1029
|
-
p >= r ? i(f, u) : (o = f, s || (s = setTimeout(() => {
|
|
1030
|
-
s = null, i(o);
|
|
1031
|
-
}, r - p)));
|
|
1032
|
-
}, () => o && i(o)];
|
|
1033
|
-
}
|
|
1034
|
-
const ye = (t, e, n = 3) => {
|
|
1035
|
-
let r = 0;
|
|
1036
|
-
const o = Er(50, 250);
|
|
1037
|
-
return Rr((s) => {
|
|
1038
|
-
if (!s || typeof s.loaded != "number")
|
|
1039
|
-
return;
|
|
1040
|
-
const i = s.loaded, a = s.lengthComputable ? s.total : void 0, l = a != null ? Math.min(i, a) : i, f = Math.max(0, l - r), u = o(f);
|
|
1041
|
-
r = Math.max(r, l);
|
|
1042
|
-
const p = {
|
|
1043
|
-
loaded: l,
|
|
1044
|
-
total: a,
|
|
1045
|
-
progress: a ? l / a : void 0,
|
|
1046
|
-
bytes: f,
|
|
1047
|
-
rate: u || void 0,
|
|
1048
|
-
estimated: u && a ? (a - l) / u : void 0,
|
|
1049
|
-
event: s,
|
|
1050
|
-
lengthComputable: a != null,
|
|
1051
|
-
[e ? "download" : "upload"]: !0
|
|
1052
|
-
};
|
|
1053
|
-
t(p);
|
|
1054
|
-
}, n);
|
|
1055
|
-
}, ot = (t, e) => {
|
|
1056
|
-
const n = t != null;
|
|
1057
|
-
return [
|
|
1058
|
-
(r) => e[0]({
|
|
1059
|
-
lengthComputable: n,
|
|
1060
|
-
total: t,
|
|
1061
|
-
loaded: r
|
|
1062
|
-
}),
|
|
1063
|
-
e[1]
|
|
1064
|
-
];
|
|
1065
|
-
}, st = (t) => (...e) => c.asap(() => t(...e)), Or = T.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (n) => (n = new URL(n, T.origin), t.protocol === n.protocol && t.host === n.host && (e || t.port === n.port)))(
|
|
1066
|
-
new URL(T.origin),
|
|
1067
|
-
T.navigator && /(msie|trident)/i.test(T.navigator.userAgent)
|
|
1068
|
-
) : () => !0, Sr = T.hasStandardBrowserEnv ? (
|
|
1069
|
-
// Standard browser envs support document.cookie
|
|
1070
|
-
{
|
|
1071
|
-
write(t, e, n, r, o, s, i) {
|
|
1072
|
-
if (typeof document > "u") return;
|
|
1073
|
-
const a = [`${t}=${encodeURIComponent(e)}`];
|
|
1074
|
-
c.isNumber(n) && a.push(`expires=${new Date(n).toUTCString()}`), c.isString(r) && a.push(`path=${r}`), c.isString(o) && a.push(`domain=${o}`), s === !0 && a.push("secure"), c.isString(i) && a.push(`SameSite=${i}`), document.cookie = a.join("; ");
|
|
1075
|
-
},
|
|
1076
|
-
read(t) {
|
|
1077
|
-
if (typeof document > "u") return null;
|
|
1078
|
-
const e = document.cookie.split(";");
|
|
1079
|
-
for (let n = 0; n < e.length; n++) {
|
|
1080
|
-
const r = e[n].replace(/^\s+/, ""), o = r.indexOf("=");
|
|
1081
|
-
if (o !== -1 && r.slice(0, o) === t)
|
|
1082
|
-
return decodeURIComponent(r.slice(o + 1));
|
|
1083
|
-
}
|
|
1084
|
-
return null;
|
|
1085
|
-
},
|
|
1086
|
-
remove(t) {
|
|
1087
|
-
this.write(t, "", Date.now() - 864e5, "/");
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
) : (
|
|
1091
|
-
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
1092
|
-
{
|
|
1093
|
-
write() {
|
|
1094
|
-
},
|
|
1095
|
-
read() {
|
|
1096
|
-
return null;
|
|
1097
|
-
},
|
|
1098
|
-
remove() {
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
);
|
|
1102
|
-
function _r(t) {
|
|
1103
|
-
return typeof t != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
1104
|
-
}
|
|
1105
|
-
function Ar(t, e) {
|
|
1106
|
-
return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
1107
|
-
}
|
|
1108
|
-
function Ut(t, e, n) {
|
|
1109
|
-
let r = !_r(e);
|
|
1110
|
-
return t && (r || n === !1) ? Ar(t, e) : e;
|
|
1111
|
-
}
|
|
1112
|
-
const it = (t) => t instanceof x ? { ...t } : t;
|
|
1113
|
-
function J(t, e) {
|
|
1114
|
-
e = e || {};
|
|
1115
|
-
const n = /* @__PURE__ */ Object.create(null);
|
|
1116
|
-
Object.defineProperty(n, "hasOwnProperty", {
|
|
1117
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
1118
|
-
// this data descriptor into an accessor descriptor on the way in.
|
|
1119
|
-
__proto__: null,
|
|
1120
|
-
value: Object.prototype.hasOwnProperty,
|
|
1121
|
-
enumerable: !1,
|
|
1122
|
-
writable: !0,
|
|
1123
|
-
configurable: !0
|
|
1124
|
-
});
|
|
1125
|
-
function r(f, u, p, g) {
|
|
1126
|
-
return c.isPlainObject(f) && c.isPlainObject(u) ? c.merge.call({ caseless: g }, f, u) : c.isPlainObject(u) ? c.merge({}, u) : c.isArray(u) ? u.slice() : u;
|
|
1127
|
-
}
|
|
1128
|
-
function o(f, u, p, g) {
|
|
1129
|
-
if (c.isUndefined(u)) {
|
|
1130
|
-
if (!c.isUndefined(f))
|
|
1131
|
-
return r(void 0, f, p, g);
|
|
1132
|
-
} else return r(f, u, p, g);
|
|
1133
|
-
}
|
|
1134
|
-
function s(f, u) {
|
|
1135
|
-
if (!c.isUndefined(u))
|
|
1136
|
-
return r(void 0, u);
|
|
1137
|
-
}
|
|
1138
|
-
function i(f, u) {
|
|
1139
|
-
if (c.isUndefined(u)) {
|
|
1140
|
-
if (!c.isUndefined(f))
|
|
1141
|
-
return r(void 0, f);
|
|
1142
|
-
} else return r(void 0, u);
|
|
1143
|
-
}
|
|
1144
|
-
function a(f, u, p) {
|
|
1145
|
-
if (c.hasOwnProp(e, p))
|
|
1146
|
-
return r(f, u);
|
|
1147
|
-
if (c.hasOwnProp(t, p))
|
|
1148
|
-
return r(void 0, f);
|
|
1149
|
-
}
|
|
1150
|
-
const l = {
|
|
1151
|
-
url: s,
|
|
1152
|
-
method: s,
|
|
1153
|
-
data: s,
|
|
1154
|
-
baseURL: i,
|
|
1155
|
-
transformRequest: i,
|
|
1156
|
-
transformResponse: i,
|
|
1157
|
-
paramsSerializer: i,
|
|
1158
|
-
timeout: i,
|
|
1159
|
-
timeoutMessage: i,
|
|
1160
|
-
withCredentials: i,
|
|
1161
|
-
withXSRFToken: i,
|
|
1162
|
-
adapter: i,
|
|
1163
|
-
responseType: i,
|
|
1164
|
-
xsrfCookieName: i,
|
|
1165
|
-
xsrfHeaderName: i,
|
|
1166
|
-
onUploadProgress: i,
|
|
1167
|
-
onDownloadProgress: i,
|
|
1168
|
-
decompress: i,
|
|
1169
|
-
maxContentLength: i,
|
|
1170
|
-
maxBodyLength: i,
|
|
1171
|
-
beforeRedirect: i,
|
|
1172
|
-
transport: i,
|
|
1173
|
-
httpAgent: i,
|
|
1174
|
-
httpsAgent: i,
|
|
1175
|
-
cancelToken: i,
|
|
1176
|
-
socketPath: i,
|
|
1177
|
-
allowedSocketPaths: i,
|
|
1178
|
-
responseEncoding: i,
|
|
1179
|
-
validateStatus: a,
|
|
1180
|
-
headers: (f, u, p) => o(it(f), it(u), p, !0)
|
|
1181
|
-
};
|
|
1182
|
-
return c.forEach(Object.keys({ ...t, ...e }), function(u) {
|
|
1183
|
-
if (u === "__proto__" || u === "constructor" || u === "prototype") return;
|
|
1184
|
-
const p = c.hasOwnProp(l, u) ? l[u] : o, g = c.hasOwnProp(t, u) ? t[u] : void 0, w = c.hasOwnProp(e, u) ? e[u] : void 0, b = p(g, w, u);
|
|
1185
|
-
c.isUndefined(b) && p !== a || (n[u] = b);
|
|
1186
|
-
}), n;
|
|
1187
|
-
}
|
|
1188
|
-
const Tr = ["content-type", "content-length"];
|
|
1189
|
-
function xr(t, e, n) {
|
|
1190
|
-
if (n !== "content-only") {
|
|
1191
|
-
t.set(e);
|
|
1192
|
-
return;
|
|
1193
|
-
}
|
|
1194
|
-
Object.entries(e).forEach(([r, o]) => {
|
|
1195
|
-
Tr.includes(r.toLowerCase()) && t.set(r, o);
|
|
1196
|
-
});
|
|
1197
|
-
}
|
|
1198
|
-
const Cr = (t) => encodeURIComponent(t).replace(
|
|
1199
|
-
/%([0-9A-F]{2})/gi,
|
|
1200
|
-
(e, n) => String.fromCharCode(parseInt(n, 16))
|
|
1201
|
-
), Ft = (t) => {
|
|
1202
|
-
const e = J({}, t), n = (g) => c.hasOwnProp(e, g) ? e[g] : void 0, r = n("data");
|
|
1203
|
-
let o = n("withXSRFToken");
|
|
1204
|
-
const s = n("xsrfHeaderName"), i = n("xsrfCookieName");
|
|
1205
|
-
let a = n("headers");
|
|
1206
|
-
const l = n("auth"), f = n("baseURL"), u = n("allowAbsoluteUrls"), p = n("url");
|
|
1207
|
-
if (e.headers = a = x.from(a), e.url = Pt(
|
|
1208
|
-
Ut(f, p, u),
|
|
1209
|
-
t.params,
|
|
1210
|
-
t.paramsSerializer
|
|
1211
|
-
), l && a.set(
|
|
1212
|
-
"Authorization",
|
|
1213
|
-
"Basic " + btoa((l.username || "") + ":" + (l.password ? Cr(l.password) : ""))
|
|
1214
|
-
), c.isFormData(r) && (T.hasStandardBrowserEnv || T.hasStandardBrowserWebWorkerEnv ? a.setContentType(void 0) : c.isFunction(r.getHeaders) && xr(a, r.getHeaders(), n("formDataHeaderPolicy"))), T.hasStandardBrowserEnv && (c.isFunction(o) && (o = o(e)), o === !0 || o == null && Or(e.url))) {
|
|
1215
|
-
const w = s && i && Sr.read(i);
|
|
1216
|
-
w && a.set(s, w);
|
|
1217
|
-
}
|
|
1218
|
-
return e;
|
|
1219
|
-
}, Pr = typeof XMLHttpRequest < "u", Lr = Pr && function(t) {
|
|
1220
|
-
return new Promise(function(n, r) {
|
|
1221
|
-
const o = Ft(t);
|
|
1222
|
-
let s = o.data;
|
|
1223
|
-
const i = x.from(o.headers).normalize();
|
|
1224
|
-
let { responseType: a, onUploadProgress: l, onDownloadProgress: f } = o, u, p, g, w, b;
|
|
1225
|
-
function h() {
|
|
1226
|
-
w && w(), b && b(), o.cancelToken && o.cancelToken.unsubscribe(u), o.signal && o.signal.removeEventListener("abort", u);
|
|
1227
|
-
}
|
|
1228
|
-
let d = new XMLHttpRequest();
|
|
1229
|
-
d.open(o.method.toUpperCase(), o.url, !0), d.timeout = o.timeout;
|
|
1230
|
-
function m() {
|
|
1231
|
-
if (!d)
|
|
1232
|
-
return;
|
|
1233
|
-
const E = x.from(
|
|
1234
|
-
"getAllResponseHeaders" in d && d.getAllResponseHeaders()
|
|
1235
|
-
), P = {
|
|
1236
|
-
data: !a || a === "text" || a === "json" ? d.responseText : d.response,
|
|
1237
|
-
status: d.status,
|
|
1238
|
-
statusText: d.statusText,
|
|
1239
|
-
headers: E,
|
|
1240
|
-
config: t,
|
|
1241
|
-
request: d
|
|
1242
|
-
};
|
|
1243
|
-
Dt(
|
|
1244
|
-
function(G) {
|
|
1245
|
-
n(G), h();
|
|
1246
|
-
},
|
|
1247
|
-
function(G) {
|
|
1248
|
-
r(G), h();
|
|
1249
|
-
},
|
|
1250
|
-
P
|
|
1251
|
-
), d = null;
|
|
1252
|
-
}
|
|
1253
|
-
"onloadend" in d ? d.onloadend = m : d.onreadystatechange = function() {
|
|
1254
|
-
!d || d.readyState !== 4 || d.status === 0 && !(d.responseURL && d.responseURL.startsWith("file:")) || setTimeout(m);
|
|
1255
|
-
}, d.onabort = function() {
|
|
1256
|
-
d && (r(new y("Request aborted", y.ECONNABORTED, t, d)), h(), d = null);
|
|
1257
|
-
}, d.onerror = function(R) {
|
|
1258
|
-
const P = R && R.message ? R.message : "Network Error", q = new y(P, y.ERR_NETWORK, t, d);
|
|
1259
|
-
q.event = R || null, r(q), h(), d = null;
|
|
1260
|
-
}, d.ontimeout = function() {
|
|
1261
|
-
let R = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1262
|
-
const P = o.transitional || He;
|
|
1263
|
-
o.timeoutErrorMessage && (R = o.timeoutErrorMessage), r(
|
|
1264
|
-
new y(
|
|
1265
|
-
R,
|
|
1266
|
-
P.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
|
|
1267
|
-
t,
|
|
1268
|
-
d
|
|
1269
|
-
)
|
|
1270
|
-
), h(), d = null;
|
|
1271
|
-
}, s === void 0 && i.setContentType(null), "setRequestHeader" in d && c.forEach(At(i), function(R, P) {
|
|
1272
|
-
d.setRequestHeader(P, R);
|
|
1273
|
-
}), c.isUndefined(o.withCredentials) || (d.withCredentials = !!o.withCredentials), a && a !== "json" && (d.responseType = o.responseType), f && ([g, b] = ye(f, !0), d.addEventListener("progress", g)), l && d.upload && ([p, w] = ye(l), d.upload.addEventListener("progress", p), d.upload.addEventListener("loadend", w)), (o.cancelToken || o.signal) && (u = (E) => {
|
|
1274
|
-
d && (r(!E || E.type ? new ae(null, t, d) : E), d.abort(), h(), d = null);
|
|
1275
|
-
}, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u)));
|
|
1276
|
-
const O = br(o.url);
|
|
1277
|
-
if (O && !T.protocols.includes(O)) {
|
|
1278
|
-
r(
|
|
1279
|
-
new y(
|
|
1280
|
-
"Unsupported protocol " + O + ":",
|
|
1281
|
-
y.ERR_BAD_REQUEST,
|
|
1282
|
-
t
|
|
1283
|
-
)
|
|
1284
|
-
);
|
|
1285
|
-
return;
|
|
1286
|
-
}
|
|
1287
|
-
d.send(s || null);
|
|
1288
|
-
});
|
|
1289
|
-
}, Nr = (t, e) => {
|
|
1290
|
-
if (t = t ? t.filter(Boolean) : [], !e && !t.length)
|
|
1291
|
-
return;
|
|
1292
|
-
const n = new AbortController();
|
|
1293
|
-
let r = !1;
|
|
1294
|
-
const o = function(l) {
|
|
1295
|
-
if (!r) {
|
|
1296
|
-
r = !0, i();
|
|
1297
|
-
const f = l instanceof Error ? l : this.reason;
|
|
1298
|
-
n.abort(
|
|
1299
|
-
f instanceof y ? f : new ae(f instanceof Error ? f.message : f)
|
|
1300
|
-
);
|
|
1301
|
-
}
|
|
1302
|
-
};
|
|
1303
|
-
let s = e && setTimeout(() => {
|
|
1304
|
-
s = null, o(new y(`timeout of ${e}ms exceeded`, y.ETIMEDOUT));
|
|
1305
|
-
}, e);
|
|
1306
|
-
const i = () => {
|
|
1307
|
-
t && (s && clearTimeout(s), s = null, t.forEach((l) => {
|
|
1308
|
-
l.unsubscribe ? l.unsubscribe(o) : l.removeEventListener("abort", o);
|
|
1309
|
-
}), t = null);
|
|
1310
|
-
};
|
|
1311
|
-
t.forEach((l) => l.addEventListener("abort", o));
|
|
1312
|
-
const { signal: a } = n;
|
|
1313
|
-
return a.unsubscribe = () => c.asap(i), a;
|
|
1314
|
-
}, Dr = function* (t, e) {
|
|
1315
|
-
let n = t.byteLength;
|
|
1316
|
-
if (n < e) {
|
|
1317
|
-
yield t;
|
|
1318
|
-
return;
|
|
1319
|
-
}
|
|
1320
|
-
let r = 0, o;
|
|
1321
|
-
for (; r < n; )
|
|
1322
|
-
o = r + e, yield t.slice(r, o), r = o;
|
|
1323
|
-
}, Ur = async function* (t, e) {
|
|
1324
|
-
for await (const n of Fr(t))
|
|
1325
|
-
yield* Dr(n, e);
|
|
1326
|
-
}, Fr = async function* (t) {
|
|
1327
|
-
if (t[Symbol.asyncIterator]) {
|
|
1328
|
-
yield* t;
|
|
1329
|
-
return;
|
|
1330
|
-
}
|
|
1331
|
-
const e = t.getReader();
|
|
1332
|
-
try {
|
|
1333
|
-
for (; ; ) {
|
|
1334
|
-
const { done: n, value: r } = await e.read();
|
|
1335
|
-
if (n)
|
|
1336
|
-
break;
|
|
1337
|
-
yield r;
|
|
1338
|
-
}
|
|
1339
|
-
} finally {
|
|
1340
|
-
await e.cancel();
|
|
1341
|
-
}
|
|
1342
|
-
}, at = (t, e, n, r) => {
|
|
1343
|
-
const o = Ur(t, e);
|
|
1344
|
-
let s = 0, i, a = (l) => {
|
|
1345
|
-
i || (i = !0, r && r(l));
|
|
1346
|
-
};
|
|
1347
|
-
return new ReadableStream(
|
|
1348
|
-
{
|
|
1349
|
-
async pull(l) {
|
|
1350
|
-
try {
|
|
1351
|
-
const { done: f, value: u } = await o.next();
|
|
1352
|
-
if (f) {
|
|
1353
|
-
a(), l.close();
|
|
1354
|
-
return;
|
|
1355
|
-
}
|
|
1356
|
-
let p = u.byteLength;
|
|
1357
|
-
if (n) {
|
|
1358
|
-
let g = s += p;
|
|
1359
|
-
n(g);
|
|
1360
|
-
}
|
|
1361
|
-
l.enqueue(new Uint8Array(u));
|
|
1362
|
-
} catch (f) {
|
|
1363
|
-
throw a(f), f;
|
|
1364
|
-
}
|
|
1365
|
-
},
|
|
1366
|
-
cancel(l) {
|
|
1367
|
-
return a(l), o.return();
|
|
1368
|
-
}
|
|
1369
|
-
},
|
|
1370
|
-
{
|
|
1371
|
-
highWaterMark: 2
|
|
1372
|
-
}
|
|
1373
|
-
);
|
|
1374
|
-
};
|
|
1375
|
-
function jr(t) {
|
|
1376
|
-
if (!t || typeof t != "string" || !t.startsWith("data:")) return 0;
|
|
1377
|
-
const e = t.indexOf(",");
|
|
1378
|
-
if (e < 0) return 0;
|
|
1379
|
-
const n = t.slice(5, e), r = t.slice(e + 1);
|
|
1380
|
-
if (/;base64/i.test(n)) {
|
|
1381
|
-
let i = r.length;
|
|
1382
|
-
const a = r.length;
|
|
1383
|
-
for (let w = 0; w < a; w++)
|
|
1384
|
-
if (r.charCodeAt(w) === 37 && w + 2 < a) {
|
|
1385
|
-
const b = r.charCodeAt(w + 1), h = r.charCodeAt(w + 2);
|
|
1386
|
-
(b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102) && (h >= 48 && h <= 57 || h >= 65 && h <= 70 || h >= 97 && h <= 102) && (i -= 2, w += 2);
|
|
1387
|
-
}
|
|
1388
|
-
let l = 0, f = a - 1;
|
|
1389
|
-
const u = (w) => w >= 2 && r.charCodeAt(w - 2) === 37 && // '%'
|
|
1390
|
-
r.charCodeAt(w - 1) === 51 && // '3'
|
|
1391
|
-
(r.charCodeAt(w) === 68 || r.charCodeAt(w) === 100);
|
|
1392
|
-
f >= 0 && (r.charCodeAt(f) === 61 ? (l++, f--) : u(f) && (l++, f -= 3)), l === 1 && f >= 0 && (r.charCodeAt(f) === 61 || u(f)) && l++;
|
|
1393
|
-
const g = Math.floor(i / 4) * 3 - (l || 0);
|
|
1394
|
-
return g > 0 ? g : 0;
|
|
1395
|
-
}
|
|
1396
|
-
if (typeof Buffer < "u" && typeof Buffer.byteLength == "function")
|
|
1397
|
-
return Buffer.byteLength(r, "utf8");
|
|
1398
|
-
let s = 0;
|
|
1399
|
-
for (let i = 0, a = r.length; i < a; i++) {
|
|
1400
|
-
const l = r.charCodeAt(i);
|
|
1401
|
-
if (l < 128)
|
|
1402
|
-
s += 1;
|
|
1403
|
-
else if (l < 2048)
|
|
1404
|
-
s += 2;
|
|
1405
|
-
else if (l >= 55296 && l <= 56319 && i + 1 < a) {
|
|
1406
|
-
const f = r.charCodeAt(i + 1);
|
|
1407
|
-
f >= 56320 && f <= 57343 ? (s += 4, i++) : s += 3;
|
|
1408
|
-
} else
|
|
1409
|
-
s += 3;
|
|
1410
|
-
}
|
|
1411
|
-
return s;
|
|
1412
|
-
}
|
|
1413
|
-
const ze = "1.16.1", ct = 64 * 1024, { isFunction: fe } = c, lt = (t, ...e) => {
|
|
1414
|
-
try {
|
|
1415
|
-
return !!t(...e);
|
|
1416
|
-
} catch {
|
|
1417
|
-
return !1;
|
|
1418
|
-
}
|
|
1419
|
-
}, kr = (t) => {
|
|
1420
|
-
const e = c.global !== void 0 && c.global !== null ? c.global : globalThis, { ReadableStream: n, TextEncoder: r } = e;
|
|
1421
|
-
t = c.merge.call(
|
|
1422
|
-
{
|
|
1423
|
-
skipUndefined: !0
|
|
1424
|
-
},
|
|
1425
|
-
{
|
|
1426
|
-
Request: e.Request,
|
|
1427
|
-
Response: e.Response
|
|
1428
|
-
},
|
|
1429
|
-
t
|
|
1430
|
-
);
|
|
1431
|
-
const { fetch: o, Request: s, Response: i } = t, a = o ? fe(o) : typeof fetch == "function", l = fe(s), f = fe(i);
|
|
1432
|
-
if (!a)
|
|
1433
|
-
return !1;
|
|
1434
|
-
const u = a && fe(n), p = a && (typeof r == "function" ? /* @__PURE__ */ ((m) => (O) => m.encode(O))(new r()) : async (m) => new Uint8Array(await new s(m).arrayBuffer())), g = l && u && lt(() => {
|
|
1435
|
-
let m = !1;
|
|
1436
|
-
const O = new s(T.origin, {
|
|
1437
|
-
body: new n(),
|
|
1438
|
-
method: "POST",
|
|
1439
|
-
get duplex() {
|
|
1440
|
-
return m = !0, "half";
|
|
1441
|
-
}
|
|
1442
|
-
}), E = O.headers.has("Content-Type");
|
|
1443
|
-
return O.body != null && O.body.cancel(), m && !E;
|
|
1444
|
-
}), w = f && u && lt(() => c.isReadableStream(new i("").body)), b = {
|
|
1445
|
-
stream: w && ((m) => m.body)
|
|
1446
|
-
};
|
|
1447
|
-
a && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((m) => {
|
|
1448
|
-
!b[m] && (b[m] = (O, E) => {
|
|
1449
|
-
let R = O && O[m];
|
|
1450
|
-
if (R)
|
|
1451
|
-
return R.call(O);
|
|
1452
|
-
throw new y(
|
|
1453
|
-
`Response type '${m}' is not supported`,
|
|
1454
|
-
y.ERR_NOT_SUPPORT,
|
|
1455
|
-
E
|
|
1456
|
-
);
|
|
1457
|
-
});
|
|
1458
|
-
});
|
|
1459
|
-
const h = async (m) => {
|
|
1460
|
-
if (m == null)
|
|
1461
|
-
return 0;
|
|
1462
|
-
if (c.isBlob(m))
|
|
1463
|
-
return m.size;
|
|
1464
|
-
if (c.isSpecCompliantForm(m))
|
|
1465
|
-
return (await new s(T.origin, {
|
|
1466
|
-
method: "POST",
|
|
1467
|
-
body: m
|
|
1468
|
-
}).arrayBuffer()).byteLength;
|
|
1469
|
-
if (c.isArrayBufferView(m) || c.isArrayBuffer(m))
|
|
1470
|
-
return m.byteLength;
|
|
1471
|
-
if (c.isURLSearchParams(m) && (m = m + ""), c.isString(m))
|
|
1472
|
-
return (await p(m)).byteLength;
|
|
1473
|
-
}, d = async (m, O) => {
|
|
1474
|
-
const E = c.toFiniteNumber(m.getContentLength());
|
|
1475
|
-
return E ?? h(O);
|
|
1476
|
-
};
|
|
1477
|
-
return async (m) => {
|
|
1478
|
-
let {
|
|
1479
|
-
url: O,
|
|
1480
|
-
method: E,
|
|
1481
|
-
data: R,
|
|
1482
|
-
signal: P,
|
|
1483
|
-
cancelToken: q,
|
|
1484
|
-
timeout: G,
|
|
1485
|
-
onDownloadProgress: Se,
|
|
1486
|
-
onUploadProgress: Ve,
|
|
1487
|
-
responseType: B,
|
|
1488
|
-
headers: M,
|
|
1489
|
-
withCredentials: ce = "same-origin",
|
|
1490
|
-
fetchOptions: Ke,
|
|
1491
|
-
maxContentLength: F,
|
|
1492
|
-
maxBodyLength: _e
|
|
1493
|
-
} = Ft(m);
|
|
1494
|
-
const Q = c.isNumber(F) && F > -1, zt = c.isNumber(_e) && _e > -1;
|
|
1495
|
-
let Xe = o || fetch;
|
|
1496
|
-
B = B ? (B + "").toLowerCase() : "text";
|
|
1497
|
-
let v = Nr(
|
|
1498
|
-
[P, q && q.toAbortSignal()],
|
|
1499
|
-
G
|
|
1500
|
-
), N = null;
|
|
1501
|
-
const H = v && v.unsubscribe && (() => {
|
|
1502
|
-
v.unsubscribe();
|
|
1503
|
-
});
|
|
1504
|
-
let Ge;
|
|
1505
|
-
try {
|
|
1506
|
-
if (Q && typeof O == "string" && O.startsWith("data:") && jr(O) > F)
|
|
1507
|
-
throw new y(
|
|
1508
|
-
"maxContentLength size of " + F + " exceeded",
|
|
1509
|
-
y.ERR_BAD_RESPONSE,
|
|
1510
|
-
m,
|
|
1511
|
-
N
|
|
1512
|
-
);
|
|
1513
|
-
if (zt && E !== "get" && E !== "head") {
|
|
1514
|
-
const S = await d(M, R);
|
|
1515
|
-
if (typeof S == "number" && isFinite(S) && S > _e)
|
|
1516
|
-
throw new y(
|
|
1517
|
-
"Request body larger than maxBodyLength limit",
|
|
1518
|
-
y.ERR_BAD_REQUEST,
|
|
1519
|
-
m,
|
|
1520
|
-
N
|
|
1521
|
-
);
|
|
1522
|
-
}
|
|
1523
|
-
if (Ve && g && E !== "get" && E !== "head" && (Ge = await d(M, R)) !== 0) {
|
|
1524
|
-
let S = new s(O, {
|
|
1525
|
-
method: "POST",
|
|
1526
|
-
body: R,
|
|
1527
|
-
duplex: "half"
|
|
1528
|
-
}), W;
|
|
1529
|
-
if (c.isFormData(R) && (W = S.headers.get("content-type")) && M.setContentType(W), S.body) {
|
|
1530
|
-
const [le, ue] = ot(
|
|
1531
|
-
Ge,
|
|
1532
|
-
ye(st(Ve))
|
|
1533
|
-
);
|
|
1534
|
-
R = at(S.body, ct, le, ue);
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
c.isString(ce) || (ce = ce ? "include" : "omit");
|
|
1538
|
-
const A = l && "credentials" in s.prototype;
|
|
1539
|
-
if (c.isFormData(R)) {
|
|
1540
|
-
const S = M.getContentType();
|
|
1541
|
-
S && /^multipart\/form-data/i.test(S) && !/boundary=/i.test(S) && M.delete("content-type");
|
|
1542
|
-
}
|
|
1543
|
-
M.set("User-Agent", "axios/" + ze, !1);
|
|
1544
|
-
const I = {
|
|
1545
|
-
...Ke,
|
|
1546
|
-
signal: v,
|
|
1547
|
-
method: E.toUpperCase(),
|
|
1548
|
-
headers: At(M.normalize()),
|
|
1549
|
-
body: R,
|
|
1550
|
-
duplex: "half",
|
|
1551
|
-
credentials: A ? ce : void 0
|
|
1552
|
-
};
|
|
1553
|
-
N = l && new s(O, I);
|
|
1554
|
-
let j = await (l ? Xe(N, Ke) : Xe(O, I));
|
|
1555
|
-
if (Q) {
|
|
1556
|
-
const S = c.toFiniteNumber(j.headers.get("content-length"));
|
|
1557
|
-
if (S != null && S > F)
|
|
1558
|
-
throw new y(
|
|
1559
|
-
"maxContentLength size of " + F + " exceeded",
|
|
1560
|
-
y.ERR_BAD_RESPONSE,
|
|
1561
|
-
m,
|
|
1562
|
-
N
|
|
1563
|
-
);
|
|
1564
|
-
}
|
|
1565
|
-
const Ae = w && (B === "stream" || B === "response");
|
|
1566
|
-
if (w && j.body && (Se || Q || Ae && H)) {
|
|
1567
|
-
const S = {};
|
|
1568
|
-
["status", "statusText", "headers"].forEach((Y) => {
|
|
1569
|
-
S[Y] = j[Y];
|
|
1570
|
-
});
|
|
1571
|
-
const W = c.toFiniteNumber(j.headers.get("content-length")), [le, ue] = Se && ot(
|
|
1572
|
-
W,
|
|
1573
|
-
ye(st(Se), !0)
|
|
1574
|
-
) || [];
|
|
1575
|
-
let Qe = 0;
|
|
1576
|
-
const Jt = (Y) => {
|
|
1577
|
-
if (Q && (Qe = Y, Qe > F))
|
|
1578
|
-
throw new y(
|
|
1579
|
-
"maxContentLength size of " + F + " exceeded",
|
|
1580
|
-
y.ERR_BAD_RESPONSE,
|
|
1581
|
-
m,
|
|
1582
|
-
N
|
|
1583
|
-
);
|
|
1584
|
-
le && le(Y);
|
|
1585
|
-
};
|
|
1586
|
-
j = new i(
|
|
1587
|
-
at(j.body, ct, Jt, () => {
|
|
1588
|
-
ue && ue(), H && H();
|
|
1589
|
-
}),
|
|
1590
|
-
S
|
|
1591
|
-
);
|
|
1592
|
-
}
|
|
1593
|
-
B = B || "text";
|
|
1594
|
-
let k = await b[c.findKey(b, B) || "text"](
|
|
1595
|
-
j,
|
|
1596
|
-
m
|
|
1597
|
-
);
|
|
1598
|
-
if (Q && !w && !Ae) {
|
|
1599
|
-
let S;
|
|
1600
|
-
if (k != null && (typeof k.byteLength == "number" ? S = k.byteLength : typeof k.size == "number" ? S = k.size : typeof k == "string" && (S = typeof r == "function" ? new r().encode(k).byteLength : k.length)), typeof S == "number" && S > F)
|
|
1601
|
-
throw new y(
|
|
1602
|
-
"maxContentLength size of " + F + " exceeded",
|
|
1603
|
-
y.ERR_BAD_RESPONSE,
|
|
1604
|
-
m,
|
|
1605
|
-
N
|
|
1606
|
-
);
|
|
1607
|
-
}
|
|
1608
|
-
return !Ae && H && H(), await new Promise((S, W) => {
|
|
1609
|
-
Dt(S, W, {
|
|
1610
|
-
data: k,
|
|
1611
|
-
headers: x.from(j.headers),
|
|
1612
|
-
status: j.status,
|
|
1613
|
-
statusText: j.statusText,
|
|
1614
|
-
config: m,
|
|
1615
|
-
request: N
|
|
1616
|
-
});
|
|
1617
|
-
});
|
|
1618
|
-
} catch (A) {
|
|
1619
|
-
if (H && H(), v && v.aborted && v.reason instanceof y) {
|
|
1620
|
-
const I = v.reason;
|
|
1621
|
-
throw I.config = m, N && (I.request = N), A !== I && (I.cause = A), I;
|
|
1622
|
-
}
|
|
1623
|
-
throw A && A.name === "TypeError" && /Load failed|fetch/i.test(A.message) ? Object.assign(
|
|
1624
|
-
new y(
|
|
1625
|
-
"Network Error",
|
|
1626
|
-
y.ERR_NETWORK,
|
|
1627
|
-
m,
|
|
1628
|
-
N,
|
|
1629
|
-
A && A.response
|
|
1630
|
-
),
|
|
1631
|
-
{
|
|
1632
|
-
cause: A.cause || A
|
|
1633
|
-
}
|
|
1634
|
-
) : y.from(A, A && A.code, m, N, A && A.response);
|
|
1635
|
-
}
|
|
1636
|
-
};
|
|
1637
|
-
}, Br = /* @__PURE__ */ new Map(), jt = (t) => {
|
|
1638
|
-
let e = t && t.env || {};
|
|
1639
|
-
const { fetch: n, Request: r, Response: o } = e, s = [r, o, n];
|
|
1640
|
-
let i = s.length, a = i, l, f, u = Br;
|
|
1641
|
-
for (; a--; )
|
|
1642
|
-
l = s[a], f = u.get(l), f === void 0 && u.set(l, f = a ? /* @__PURE__ */ new Map() : kr(e)), u = f;
|
|
1643
|
-
return f;
|
|
1644
|
-
};
|
|
1645
|
-
jt();
|
|
1646
|
-
const Je = {
|
|
1647
|
-
http: rr,
|
|
1648
|
-
xhr: Lr,
|
|
1649
|
-
fetch: {
|
|
1650
|
-
get: jt
|
|
1651
|
-
}
|
|
1652
|
-
};
|
|
1653
|
-
c.forEach(Je, (t, e) => {
|
|
1654
|
-
if (t) {
|
|
1655
|
-
try {
|
|
1656
|
-
Object.defineProperty(t, "name", { __proto__: null, value: e });
|
|
1657
|
-
} catch {
|
|
1658
|
-
}
|
|
1659
|
-
Object.defineProperty(t, "adapterName", { __proto__: null, value: e });
|
|
1660
|
-
}
|
|
1661
|
-
});
|
|
1662
|
-
const ut = (t) => `- ${t}`, vr = (t) => c.isFunction(t) || t === null || t === !1;
|
|
1663
|
-
function Ir(t, e) {
|
|
1664
|
-
t = c.isArray(t) ? t : [t];
|
|
1665
|
-
const { length: n } = t;
|
|
1666
|
-
let r, o;
|
|
1667
|
-
const s = {};
|
|
1668
|
-
for (let i = 0; i < n; i++) {
|
|
1669
|
-
r = t[i];
|
|
1670
|
-
let a;
|
|
1671
|
-
if (o = r, !vr(r) && (o = Je[(a = String(r)).toLowerCase()], o === void 0))
|
|
1672
|
-
throw new y(`Unknown adapter '${a}'`);
|
|
1673
|
-
if (o && (c.isFunction(o) || (o = o.get(e))))
|
|
1674
|
-
break;
|
|
1675
|
-
s[a || "#" + i] = o;
|
|
1676
|
-
}
|
|
1677
|
-
if (!o) {
|
|
1678
|
-
const i = Object.entries(s).map(
|
|
1679
|
-
([l, f]) => `adapter ${l} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1680
|
-
);
|
|
1681
|
-
let a = n ? i.length > 1 ? `since :
|
|
1682
|
-
` + i.map(ut).join(`
|
|
1683
|
-
`) : " " + ut(i[0]) : "as no adapter specified";
|
|
1684
|
-
throw new y(
|
|
1685
|
-
"There is no suitable adapter to dispatch the request " + a,
|
|
1686
|
-
"ERR_NOT_SUPPORT"
|
|
1687
|
-
);
|
|
1688
|
-
}
|
|
1689
|
-
return o;
|
|
1690
|
-
}
|
|
1691
|
-
const kt = {
|
|
1692
|
-
/**
|
|
1693
|
-
* Resolve an adapter from a list of adapter names or functions.
|
|
1694
|
-
* @type {Function}
|
|
1695
|
-
*/
|
|
1696
|
-
getAdapter: Ir,
|
|
1697
|
-
/**
|
|
1698
|
-
* Exposes all known adapters
|
|
1699
|
-
* @type {Object<string, Function|Object>}
|
|
1700
|
-
*/
|
|
1701
|
-
adapters: Je
|
|
1702
|
-
};
|
|
1703
|
-
function Ne(t) {
|
|
1704
|
-
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1705
|
-
throw new ae(null, t);
|
|
1706
|
-
}
|
|
1707
|
-
function ft(t) {
|
|
1708
|
-
return Ne(t), t.headers = x.from(t.headers), t.data = Le.call(t, t.transformRequest), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), kt.getAdapter(t.adapter || ie.adapter, t)(t).then(
|
|
1709
|
-
function(r) {
|
|
1710
|
-
Ne(t), t.response = r;
|
|
1711
|
-
try {
|
|
1712
|
-
r.data = Le.call(t, t.transformResponse, r);
|
|
1713
|
-
} finally {
|
|
1714
|
-
delete t.response;
|
|
1715
|
-
}
|
|
1716
|
-
return r.headers = x.from(r.headers), r;
|
|
1717
|
-
},
|
|
1718
|
-
function(r) {
|
|
1719
|
-
if (!Nt(r) && (Ne(t), r && r.response)) {
|
|
1720
|
-
t.response = r.response;
|
|
1721
|
-
try {
|
|
1722
|
-
r.response.data = Le.call(
|
|
1723
|
-
t,
|
|
1724
|
-
t.transformResponse,
|
|
1725
|
-
r.response
|
|
1726
|
-
);
|
|
1727
|
-
} finally {
|
|
1728
|
-
delete t.response;
|
|
1729
|
-
}
|
|
1730
|
-
r.response.headers = x.from(r.response.headers);
|
|
1731
|
-
}
|
|
1732
|
-
return Promise.reject(r);
|
|
1733
|
-
}
|
|
1734
|
-
);
|
|
1735
|
-
}
|
|
1736
|
-
const Oe = {};
|
|
1737
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
1738
|
-
Oe[t] = function(r) {
|
|
1739
|
-
return typeof r === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
1740
|
-
};
|
|
1741
|
-
});
|
|
1742
|
-
const dt = {};
|
|
1743
|
-
Oe.transitional = function(e, n, r) {
|
|
1744
|
-
function o(s, i) {
|
|
1745
|
-
return "[Axios v" + ze + "] Transitional option '" + s + "'" + i + (r ? ". " + r : "");
|
|
1746
|
-
}
|
|
1747
|
-
return (s, i, a) => {
|
|
1748
|
-
if (e === !1)
|
|
1749
|
-
throw new y(
|
|
1750
|
-
o(i, " has been removed" + (n ? " in " + n : "")),
|
|
1751
|
-
y.ERR_DEPRECATED
|
|
1752
|
-
);
|
|
1753
|
-
return n && !dt[i] && (dt[i] = !0, console.warn(
|
|
1754
|
-
o(
|
|
1755
|
-
i,
|
|
1756
|
-
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1757
|
-
)
|
|
1758
|
-
)), e ? e(s, i, a) : !0;
|
|
1759
|
-
};
|
|
1760
|
-
};
|
|
1761
|
-
Oe.spelling = function(e) {
|
|
1762
|
-
return (n, r) => (console.warn(`${r} is likely a misspelling of ${e}`), !0);
|
|
1763
|
-
};
|
|
1764
|
-
function qr(t, e, n) {
|
|
1765
|
-
if (typeof t != "object")
|
|
1766
|
-
throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
|
|
1767
|
-
const r = Object.keys(t);
|
|
1768
|
-
let o = r.length;
|
|
1769
|
-
for (; o-- > 0; ) {
|
|
1770
|
-
const s = r[o], i = Object.prototype.hasOwnProperty.call(e, s) ? e[s] : void 0;
|
|
1771
|
-
if (i) {
|
|
1772
|
-
const a = t[s], l = a === void 0 || i(a, s, t);
|
|
1773
|
-
if (l !== !0)
|
|
1774
|
-
throw new y(
|
|
1775
|
-
"option " + s + " must be " + l,
|
|
1776
|
-
y.ERR_BAD_OPTION_VALUE
|
|
1777
|
-
);
|
|
1778
|
-
continue;
|
|
1779
|
-
}
|
|
1780
|
-
if (n !== !0)
|
|
1781
|
-
throw new y("Unknown option " + s, y.ERR_BAD_OPTION);
|
|
1782
|
-
}
|
|
1783
|
-
}
|
|
1784
|
-
const me = {
|
|
1785
|
-
assertOptions: qr,
|
|
1786
|
-
validators: Oe
|
|
1787
|
-
}, D = me.validators;
|
|
1788
|
-
let z = class {
|
|
1789
|
-
constructor(e) {
|
|
1790
|
-
this.defaults = e || {}, this.interceptors = {
|
|
1791
|
-
request: new rt(),
|
|
1792
|
-
response: new rt()
|
|
1793
|
-
};
|
|
1794
|
-
}
|
|
1795
|
-
/**
|
|
1796
|
-
* Dispatch a request
|
|
1797
|
-
*
|
|
1798
|
-
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
1799
|
-
* @param {?Object} config
|
|
1800
|
-
*
|
|
1801
|
-
* @returns {Promise} The Promise to be fulfilled
|
|
1802
|
-
*/
|
|
1803
|
-
async request(e, n) {
|
|
1804
|
-
try {
|
|
1805
|
-
return await this._request(e, n);
|
|
1806
|
-
} catch (r) {
|
|
1807
|
-
if (r instanceof Error) {
|
|
1808
|
-
let o = {};
|
|
1809
|
-
Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
|
|
1810
|
-
const s = (() => {
|
|
1811
|
-
if (!o.stack)
|
|
1812
|
-
return "";
|
|
1813
|
-
const i = o.stack.indexOf(`
|
|
1814
|
-
`);
|
|
1815
|
-
return i === -1 ? "" : o.stack.slice(i + 1);
|
|
1816
|
-
})();
|
|
1817
|
-
try {
|
|
1818
|
-
if (!r.stack)
|
|
1819
|
-
r.stack = s;
|
|
1820
|
-
else if (s) {
|
|
1821
|
-
const i = s.indexOf(`
|
|
1822
|
-
`), a = i === -1 ? -1 : s.indexOf(`
|
|
1823
|
-
`, i + 1), l = a === -1 ? "" : s.slice(a + 1);
|
|
1824
|
-
String(r.stack).endsWith(l) || (r.stack += `
|
|
1825
|
-
` + s);
|
|
1826
|
-
}
|
|
1827
|
-
} catch {
|
|
1828
|
-
}
|
|
1829
|
-
}
|
|
1830
|
-
throw r;
|
|
1831
|
-
}
|
|
1832
|
-
}
|
|
1833
|
-
_request(e, n) {
|
|
1834
|
-
typeof e == "string" ? (n = n || {}, n.url = e) : n = e || {}, n = J(this.defaults, n);
|
|
1835
|
-
const { transitional: r, paramsSerializer: o, headers: s } = n;
|
|
1836
|
-
r !== void 0 && me.assertOptions(
|
|
1837
|
-
r,
|
|
1838
|
-
{
|
|
1839
|
-
silentJSONParsing: D.transitional(D.boolean),
|
|
1840
|
-
forcedJSONParsing: D.transitional(D.boolean),
|
|
1841
|
-
clarifyTimeoutError: D.transitional(D.boolean),
|
|
1842
|
-
legacyInterceptorReqResOrdering: D.transitional(D.boolean)
|
|
1843
|
-
},
|
|
1844
|
-
!1
|
|
1845
|
-
), o != null && (c.isFunction(o) ? n.paramsSerializer = {
|
|
1846
|
-
serialize: o
|
|
1847
|
-
} : me.assertOptions(
|
|
1848
|
-
o,
|
|
1849
|
-
{
|
|
1850
|
-
encode: D.function,
|
|
1851
|
-
serialize: D.function
|
|
1852
|
-
},
|
|
1853
|
-
!0
|
|
1854
|
-
)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), me.assertOptions(
|
|
1855
|
-
n,
|
|
1856
|
-
{
|
|
1857
|
-
baseUrl: D.spelling("baseURL"),
|
|
1858
|
-
withXsrfToken: D.spelling("withXSRFToken")
|
|
1859
|
-
},
|
|
1860
|
-
!0
|
|
1861
|
-
), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1862
|
-
let i = s && c.merge(s.common, s[n.method]);
|
|
1863
|
-
s && c.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (b) => {
|
|
1864
|
-
delete s[b];
|
|
1865
|
-
}), n.headers = x.concat(i, s);
|
|
1866
|
-
const a = [];
|
|
1867
|
-
let l = !0;
|
|
1868
|
-
this.interceptors.request.forEach(function(h) {
|
|
1869
|
-
if (typeof h.runWhen == "function" && h.runWhen(n) === !1)
|
|
1870
|
-
return;
|
|
1871
|
-
l = l && h.synchronous;
|
|
1872
|
-
const d = n.transitional || He;
|
|
1873
|
-
d && d.legacyInterceptorReqResOrdering ? a.unshift(h.fulfilled, h.rejected) : a.push(h.fulfilled, h.rejected);
|
|
1874
|
-
});
|
|
1875
|
-
const f = [];
|
|
1876
|
-
this.interceptors.response.forEach(function(h) {
|
|
1877
|
-
f.push(h.fulfilled, h.rejected);
|
|
1878
|
-
});
|
|
1879
|
-
let u, p = 0, g;
|
|
1880
|
-
if (!l) {
|
|
1881
|
-
const b = [ft.bind(this), void 0];
|
|
1882
|
-
for (b.unshift(...a), b.push(...f), g = b.length, u = Promise.resolve(n); p < g; )
|
|
1883
|
-
u = u.then(b[p++], b[p++]);
|
|
1884
|
-
return u;
|
|
1885
|
-
}
|
|
1886
|
-
g = a.length;
|
|
1887
|
-
let w = n;
|
|
1888
|
-
for (; p < g; ) {
|
|
1889
|
-
const b = a[p++], h = a[p++];
|
|
1890
|
-
try {
|
|
1891
|
-
w = b(w);
|
|
1892
|
-
} catch (d) {
|
|
1893
|
-
h.call(this, d);
|
|
1894
|
-
break;
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
|
-
try {
|
|
1898
|
-
u = ft.call(this, w);
|
|
1899
|
-
} catch (b) {
|
|
1900
|
-
return Promise.reject(b);
|
|
1901
|
-
}
|
|
1902
|
-
for (p = 0, g = f.length; p < g; )
|
|
1903
|
-
u = u.then(f[p++], f[p++]);
|
|
1904
|
-
return u;
|
|
1905
|
-
}
|
|
1906
|
-
getUri(e) {
|
|
1907
|
-
e = J(this.defaults, e);
|
|
1908
|
-
const n = Ut(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1909
|
-
return Pt(n, e.params, e.paramsSerializer);
|
|
1910
|
-
}
|
|
1911
|
-
};
|
|
1912
|
-
c.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1913
|
-
z.prototype[e] = function(n, r) {
|
|
1914
|
-
return this.request(
|
|
1915
|
-
J(r || {}, {
|
|
1916
|
-
method: e,
|
|
1917
|
-
url: n,
|
|
1918
|
-
data: (r || {}).data
|
|
1919
|
-
})
|
|
1920
|
-
);
|
|
1921
|
-
};
|
|
1922
|
-
});
|
|
1923
|
-
c.forEach(["post", "put", "patch", "query"], function(e) {
|
|
1924
|
-
function n(r) {
|
|
1925
|
-
return function(s, i, a) {
|
|
1926
|
-
return this.request(
|
|
1927
|
-
J(a || {}, {
|
|
1928
|
-
method: e,
|
|
1929
|
-
headers: r ? {
|
|
1930
|
-
"Content-Type": "multipart/form-data"
|
|
1931
|
-
} : {},
|
|
1932
|
-
url: s,
|
|
1933
|
-
data: i
|
|
1934
|
-
})
|
|
1935
|
-
);
|
|
1936
|
-
};
|
|
1937
|
-
}
|
|
1938
|
-
z.prototype[e] = n(), e !== "query" && (z.prototype[e + "Form"] = n(!0));
|
|
1939
|
-
});
|
|
1940
|
-
let Mr = class Bt {
|
|
1941
|
-
constructor(e) {
|
|
1942
|
-
if (typeof e != "function")
|
|
1943
|
-
throw new TypeError("executor must be a function.");
|
|
1944
|
-
let n;
|
|
1945
|
-
this.promise = new Promise(function(s) {
|
|
1946
|
-
n = s;
|
|
1947
|
-
});
|
|
1948
|
-
const r = this;
|
|
1949
|
-
this.promise.then((o) => {
|
|
1950
|
-
if (!r._listeners) return;
|
|
1951
|
-
let s = r._listeners.length;
|
|
1952
|
-
for (; s-- > 0; )
|
|
1953
|
-
r._listeners[s](o);
|
|
1954
|
-
r._listeners = null;
|
|
1955
|
-
}), this.promise.then = (o) => {
|
|
1956
|
-
let s;
|
|
1957
|
-
const i = new Promise((a) => {
|
|
1958
|
-
r.subscribe(a), s = a;
|
|
1959
|
-
}).then(o);
|
|
1960
|
-
return i.cancel = function() {
|
|
1961
|
-
r.unsubscribe(s);
|
|
1962
|
-
}, i;
|
|
1963
|
-
}, e(function(s, i, a) {
|
|
1964
|
-
r.reason || (r.reason = new ae(s, i, a), n(r.reason));
|
|
1965
|
-
});
|
|
1966
|
-
}
|
|
1967
|
-
/**
|
|
1968
|
-
* Throws a `CanceledError` if cancellation has been requested.
|
|
1969
|
-
*/
|
|
1970
|
-
throwIfRequested() {
|
|
1971
|
-
if (this.reason)
|
|
1972
|
-
throw this.reason;
|
|
1973
|
-
}
|
|
1974
|
-
/**
|
|
1975
|
-
* Subscribe to the cancel signal
|
|
1976
|
-
*/
|
|
1977
|
-
subscribe(e) {
|
|
1978
|
-
if (this.reason) {
|
|
1979
|
-
e(this.reason);
|
|
1980
|
-
return;
|
|
1981
|
-
}
|
|
1982
|
-
this._listeners ? this._listeners.push(e) : this._listeners = [e];
|
|
1983
|
-
}
|
|
1984
|
-
/**
|
|
1985
|
-
* Unsubscribe from the cancel signal
|
|
1986
|
-
*/
|
|
1987
|
-
unsubscribe(e) {
|
|
1988
|
-
if (!this._listeners)
|
|
1989
|
-
return;
|
|
1990
|
-
const n = this._listeners.indexOf(e);
|
|
1991
|
-
n !== -1 && this._listeners.splice(n, 1);
|
|
1992
|
-
}
|
|
1993
|
-
toAbortSignal() {
|
|
1994
|
-
const e = new AbortController(), n = (r) => {
|
|
1995
|
-
e.abort(r);
|
|
1996
|
-
};
|
|
1997
|
-
return this.subscribe(n), e.signal.unsubscribe = () => this.unsubscribe(n), e.signal;
|
|
1998
|
-
}
|
|
1999
|
-
/**
|
|
2000
|
-
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
2001
|
-
* cancels the `CancelToken`.
|
|
2002
|
-
*/
|
|
2003
|
-
static source() {
|
|
2004
|
-
let e;
|
|
2005
|
-
return {
|
|
2006
|
-
token: new Bt(function(o) {
|
|
2007
|
-
e = o;
|
|
2008
|
-
}),
|
|
2009
|
-
cancel: e
|
|
2010
|
-
};
|
|
2011
|
-
}
|
|
2012
|
-
};
|
|
2013
|
-
function Hr(t) {
|
|
2014
|
-
return function(n) {
|
|
2015
|
-
return t.apply(null, n);
|
|
2016
|
-
};
|
|
2017
|
-
}
|
|
2018
|
-
function $r(t) {
|
|
2019
|
-
return c.isObject(t) && t.isAxiosError === !0;
|
|
2020
|
-
}
|
|
2021
|
-
const Be = {
|
|
2022
|
-
Continue: 100,
|
|
2023
|
-
SwitchingProtocols: 101,
|
|
2024
|
-
Processing: 102,
|
|
2025
|
-
EarlyHints: 103,
|
|
2026
|
-
Ok: 200,
|
|
2027
|
-
Created: 201,
|
|
2028
|
-
Accepted: 202,
|
|
2029
|
-
NonAuthoritativeInformation: 203,
|
|
2030
|
-
NoContent: 204,
|
|
2031
|
-
ResetContent: 205,
|
|
2032
|
-
PartialContent: 206,
|
|
2033
|
-
MultiStatus: 207,
|
|
2034
|
-
AlreadyReported: 208,
|
|
2035
|
-
ImUsed: 226,
|
|
2036
|
-
MultipleChoices: 300,
|
|
2037
|
-
MovedPermanently: 301,
|
|
2038
|
-
Found: 302,
|
|
2039
|
-
SeeOther: 303,
|
|
2040
|
-
NotModified: 304,
|
|
2041
|
-
UseProxy: 305,
|
|
2042
|
-
Unused: 306,
|
|
2043
|
-
TemporaryRedirect: 307,
|
|
2044
|
-
PermanentRedirect: 308,
|
|
2045
|
-
BadRequest: 400,
|
|
2046
|
-
Unauthorized: 401,
|
|
2047
|
-
PaymentRequired: 402,
|
|
2048
|
-
Forbidden: 403,
|
|
2049
|
-
NotFound: 404,
|
|
2050
|
-
MethodNotAllowed: 405,
|
|
2051
|
-
NotAcceptable: 406,
|
|
2052
|
-
ProxyAuthenticationRequired: 407,
|
|
2053
|
-
RequestTimeout: 408,
|
|
2054
|
-
Conflict: 409,
|
|
2055
|
-
Gone: 410,
|
|
2056
|
-
LengthRequired: 411,
|
|
2057
|
-
PreconditionFailed: 412,
|
|
2058
|
-
PayloadTooLarge: 413,
|
|
2059
|
-
UriTooLong: 414,
|
|
2060
|
-
UnsupportedMediaType: 415,
|
|
2061
|
-
RangeNotSatisfiable: 416,
|
|
2062
|
-
ExpectationFailed: 417,
|
|
2063
|
-
ImATeapot: 418,
|
|
2064
|
-
MisdirectedRequest: 421,
|
|
2065
|
-
UnprocessableEntity: 422,
|
|
2066
|
-
Locked: 423,
|
|
2067
|
-
FailedDependency: 424,
|
|
2068
|
-
TooEarly: 425,
|
|
2069
|
-
UpgradeRequired: 426,
|
|
2070
|
-
PreconditionRequired: 428,
|
|
2071
|
-
TooManyRequests: 429,
|
|
2072
|
-
RequestHeaderFieldsTooLarge: 431,
|
|
2073
|
-
UnavailableForLegalReasons: 451,
|
|
2074
|
-
InternalServerError: 500,
|
|
2075
|
-
NotImplemented: 501,
|
|
2076
|
-
BadGateway: 502,
|
|
2077
|
-
ServiceUnavailable: 503,
|
|
2078
|
-
GatewayTimeout: 504,
|
|
2079
|
-
HttpVersionNotSupported: 505,
|
|
2080
|
-
VariantAlsoNegotiates: 506,
|
|
2081
|
-
InsufficientStorage: 507,
|
|
2082
|
-
LoopDetected: 508,
|
|
2083
|
-
NotExtended: 510,
|
|
2084
|
-
NetworkAuthenticationRequired: 511,
|
|
2085
|
-
WebServerIsDown: 521,
|
|
2086
|
-
ConnectionTimedOut: 522,
|
|
2087
|
-
OriginIsUnreachable: 523,
|
|
2088
|
-
TimeoutOccurred: 524,
|
|
2089
|
-
SslHandshakeFailed: 525,
|
|
2090
|
-
InvalidSslCertificate: 526
|
|
2091
|
-
};
|
|
2092
|
-
Object.entries(Be).forEach(([t, e]) => {
|
|
2093
|
-
Be[e] = t;
|
|
2094
|
-
});
|
|
2095
|
-
function vt(t) {
|
|
2096
|
-
const e = new z(t), n = gt(z.prototype.request, e);
|
|
2097
|
-
return c.extend(n, z.prototype, e, { allOwnKeys: !0 }), c.extend(n, e, null, { allOwnKeys: !0 }), n.create = function(o) {
|
|
2098
|
-
return vt(J(t, o));
|
|
2099
|
-
}, n;
|
|
2100
|
-
}
|
|
2101
|
-
const _ = vt(ie);
|
|
2102
|
-
_.Axios = z;
|
|
2103
|
-
_.CanceledError = ae;
|
|
2104
|
-
_.CancelToken = Mr;
|
|
2105
|
-
_.isCancel = Nt;
|
|
2106
|
-
_.VERSION = ze;
|
|
2107
|
-
_.toFormData = Re;
|
|
2108
|
-
_.AxiosError = y;
|
|
2109
|
-
_.Cancel = _.CanceledError;
|
|
2110
|
-
_.all = function(e) {
|
|
2111
|
-
return Promise.all(e);
|
|
2112
|
-
};
|
|
2113
|
-
_.spread = Hr;
|
|
2114
|
-
_.isAxiosError = $r;
|
|
2115
|
-
_.mergeConfig = J;
|
|
2116
|
-
_.AxiosHeaders = x;
|
|
2117
|
-
_.formToJSON = (t) => Lt(c.isHTMLForm(t) ? new FormData(t) : t);
|
|
2118
|
-
_.getAdapter = kt.getAdapter;
|
|
2119
|
-
_.HttpStatusCode = Be;
|
|
2120
|
-
_.default = _;
|
|
2121
|
-
const {
|
|
2122
|
-
Axios: To,
|
|
2123
|
-
AxiosError: xo,
|
|
2124
|
-
CanceledError: Co,
|
|
2125
|
-
isCancel: Po,
|
|
2126
|
-
CancelToken: Lo,
|
|
2127
|
-
VERSION: No,
|
|
2128
|
-
all: Do,
|
|
2129
|
-
Cancel: Uo,
|
|
2130
|
-
isAxiosError: Fo,
|
|
2131
|
-
spread: jo,
|
|
2132
|
-
toFormData: ko,
|
|
2133
|
-
AxiosHeaders: Bo,
|
|
2134
|
-
HttpStatusCode: vo,
|
|
2135
|
-
formToJSON: Io,
|
|
2136
|
-
getAdapter: qo,
|
|
2137
|
-
mergeConfig: Mo,
|
|
2138
|
-
create: Ho
|
|
2139
|
-
} = _, zr = {
|
|
24
|
+
const Le = "0.18.1", Q = {
|
|
2140
25
|
form: "application/x-www-form-urlencoded",
|
|
2141
26
|
json: "application/json",
|
|
2142
27
|
data: "multipart/form-data"
|
|
2143
|
-
},
|
|
2144
|
-
class
|
|
28
|
+
}, G = ["put", "post", "patch"], P = "Local-Request-Id", Z = 100, ee = 300, te = "/api/proxy";
|
|
29
|
+
class ne {
|
|
2145
30
|
constructor(e = {}) {
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
31
|
+
p(this, "axios");
|
|
32
|
+
p(this, "settings");
|
|
33
|
+
p(this, "records", {});
|
|
34
|
+
p(this, "isLoading", !1);
|
|
35
|
+
p(this, "stopSkipWarn");
|
|
36
|
+
p(this, "showLoading");
|
|
37
|
+
p(this, "showError");
|
|
2153
38
|
this.settings = Object.assign({ type: "form" }, e.settings || {});
|
|
2154
|
-
const
|
|
39
|
+
const t = O(e, [
|
|
2155
40
|
"settings",
|
|
2156
41
|
"query"
|
|
2157
42
|
]);
|
|
2158
|
-
this.axios =
|
|
2159
|
-
|
|
43
|
+
this.axios = A.create(
|
|
44
|
+
v(
|
|
2160
45
|
{
|
|
2161
46
|
headers: {
|
|
2162
47
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
2163
48
|
},
|
|
2164
49
|
timeout: 120 * 1e3
|
|
2165
50
|
},
|
|
2166
|
-
|
|
51
|
+
t
|
|
2167
52
|
)
|
|
2168
|
-
), this.setupSkipWarn(this.settings), this.showLoading =
|
|
53
|
+
), this.setupSkipWarn(this.settings), this.showLoading = H(this.openLoading.bind(this), Z), this.showError = V(this._showError.bind(this), ee, {
|
|
2169
54
|
leading: !0,
|
|
2170
55
|
trailing: !1
|
|
2171
56
|
});
|
|
2172
57
|
}
|
|
2173
58
|
setConfig(e = {}) {
|
|
2174
|
-
this.settings =
|
|
2175
|
-
const
|
|
59
|
+
this.settings = v(this.settings, e.settings || {});
|
|
60
|
+
const t = O(e, [
|
|
2176
61
|
"settings",
|
|
2177
62
|
"query"
|
|
2178
63
|
]);
|
|
2179
|
-
this.axios.defaults =
|
|
64
|
+
this.axios.defaults = v(this.axios.defaults, t), this.setupSkipWarn(this.settings);
|
|
2180
65
|
}
|
|
2181
|
-
cancel(e,
|
|
66
|
+
cancel(e, t = "请求已取消") {
|
|
2182
67
|
if (e) {
|
|
2183
|
-
const
|
|
2184
|
-
if (!
|
|
2185
|
-
|
|
68
|
+
const o = this.records[e];
|
|
69
|
+
if (!o) return;
|
|
70
|
+
o.source.cancel(t);
|
|
2186
71
|
} else
|
|
2187
|
-
for (const
|
|
2188
|
-
|
|
2189
|
-
}
|
|
2190
|
-
createHeaders(e,
|
|
2191
|
-
const
|
|
2192
|
-
"Content-Type":
|
|
2193
|
-
...
|
|
2194
|
-
...
|
|
72
|
+
for (const o of Object.values(this.records))
|
|
73
|
+
o.source.cancel(t);
|
|
74
|
+
}
|
|
75
|
+
createHeaders(e, t, o) {
|
|
76
|
+
const r = t.injectHeaders ? typeof t.headers == "function" ? t.headers(e, o, t) : t.headers || {} : {}, s = {
|
|
77
|
+
"Content-Type": Q[t.type || "form"],
|
|
78
|
+
...o.headers,
|
|
79
|
+
...r
|
|
2195
80
|
};
|
|
2196
|
-
return
|
|
81
|
+
return t.skipWarn && (s[P] = e), s;
|
|
2197
82
|
}
|
|
2198
83
|
isJsonType(e) {
|
|
2199
|
-
return Object.entries(e).some(([
|
|
84
|
+
return Object.entries(e).some(([t, o]) => t.toLowerCase() === "content-type" && String(o).includes("application/json"));
|
|
2200
85
|
}
|
|
2201
|
-
toFormData(e,
|
|
86
|
+
toFormData(e, t = "data") {
|
|
2202
87
|
if (e instanceof FormData || e instanceof URLSearchParams)
|
|
2203
88
|
return e;
|
|
2204
|
-
const
|
|
2205
|
-
return Object.entries(e).forEach(([
|
|
2206
|
-
|
|
2207
|
-
}),
|
|
2208
|
-
}
|
|
2209
|
-
createSendData(e,
|
|
2210
|
-
const { type: i, skipWarn:
|
|
2211
|
-
let { data:
|
|
2212
|
-
const
|
|
2213
|
-
return
|
|
89
|
+
const o = t === "data" ? new FormData() : new URLSearchParams();
|
|
90
|
+
return Object.entries(e).forEach(([r, s]) => {
|
|
91
|
+
o.append(r, s);
|
|
92
|
+
}), o;
|
|
93
|
+
}
|
|
94
|
+
createSendData(e, t, o, r, s = {}) {
|
|
95
|
+
const { type: i, skipWarn: c } = e, { name: a = "skipWarn" } = c || {};
|
|
96
|
+
let { data: d, params: l = {}, method: u = "get" } = t;
|
|
97
|
+
const h = r ? { [a]: !0 } : {};
|
|
98
|
+
return G.includes(u.toLowerCase()) ? (d = Object.assign(d || {}, h), d = i !== "json" || !this.isJsonType(o) ? this.toFormData(d, i) : d, l = {
|
|
2214
99
|
...s
|
|
2215
|
-
}) : i === "form" ?
|
|
2216
|
-
...
|
|
100
|
+
}) : i === "form" ? l = {
|
|
101
|
+
...d || {},
|
|
2217
102
|
...s,
|
|
2218
|
-
...
|
|
2219
|
-
} : (
|
|
103
|
+
...h
|
|
104
|
+
} : (d && (i !== "json" || !this.isJsonType(o)) && (d = this.toFormData(d, i)), l = {
|
|
2220
105
|
...s,
|
|
2221
|
-
...
|
|
106
|
+
...h
|
|
2222
107
|
}), {
|
|
2223
|
-
data:
|
|
2224
|
-
params:
|
|
108
|
+
data: d,
|
|
109
|
+
params: l
|
|
2225
110
|
};
|
|
2226
111
|
}
|
|
2227
112
|
createUrl(e) {
|
|
2228
|
-
let { url:
|
|
2229
|
-
if (
|
|
2230
|
-
let
|
|
2231
|
-
const s =
|
|
113
|
+
let { url: t, params: o } = e;
|
|
114
|
+
if (t) {
|
|
115
|
+
let r = T(t) ? new URL(t).origin : "";
|
|
116
|
+
const s = r ? t.replace(r, "") : t;
|
|
2232
117
|
try {
|
|
2233
|
-
const i =
|
|
118
|
+
const i = z(s, {
|
|
2234
119
|
encode: encodeURIComponent
|
|
2235
120
|
});
|
|
2236
|
-
return
|
|
121
|
+
return r + i(o || {});
|
|
2237
122
|
} catch {
|
|
2238
|
-
console.warn("createUrl", "pathToRegexpCompile error",
|
|
123
|
+
console.warn("createUrl", "pathToRegexpCompile error", t);
|
|
2239
124
|
}
|
|
2240
125
|
}
|
|
2241
|
-
return
|
|
126
|
+
return t;
|
|
2242
127
|
}
|
|
2243
|
-
createProxy(e,
|
|
128
|
+
createProxy(e, t, o) {
|
|
2244
129
|
if (!e.proxy)
|
|
2245
130
|
return {
|
|
2246
|
-
url:
|
|
2247
|
-
headers:
|
|
131
|
+
url: t,
|
|
132
|
+
headers: o
|
|
2248
133
|
};
|
|
2249
|
-
const
|
|
2250
|
-
return
|
|
2251
|
-
url:
|
|
2252
|
-
headers:
|
|
134
|
+
const r = e.proxyPath || te, { protocol: s, host: i } = location || {}, c = T(t) ? t : `${s}//${i}${t}`;
|
|
135
|
+
return o.Target = c, {
|
|
136
|
+
url: r,
|
|
137
|
+
headers: o
|
|
2253
138
|
};
|
|
2254
139
|
}
|
|
2255
140
|
openLoading(e) {
|
|
2256
|
-
const { loading:
|
|
2257
|
-
|
|
141
|
+
const { loading: t, showLoading: o } = e;
|
|
142
|
+
t && o && Object.keys(this.records).length > 0 && (this.isLoading = !0, o());
|
|
2258
143
|
}
|
|
2259
144
|
closeLoading(e) {
|
|
2260
|
-
const { hideLoading:
|
|
145
|
+
const { hideLoading: t } = e;
|
|
2261
146
|
this.isLoading = !1;
|
|
2262
|
-
const
|
|
2263
|
-
|
|
147
|
+
const o = Object.keys(this.records);
|
|
148
|
+
t && o.length === 0 && (this.isLoading = !1, t());
|
|
2264
149
|
}
|
|
2265
|
-
_showError(e,
|
|
2266
|
-
const { failMessage:
|
|
2267
|
-
if (
|
|
2268
|
-
const s =
|
|
2269
|
-
|
|
150
|
+
_showError(e, t) {
|
|
151
|
+
const { failMessage: o, showError: r } = e;
|
|
152
|
+
if (o && r) {
|
|
153
|
+
const s = t?.response?.data, i = s?.message || s?.msg || t?.message || t?.msg || "未知错误";
|
|
154
|
+
r(i, t);
|
|
2270
155
|
}
|
|
2271
156
|
}
|
|
2272
|
-
validResponse(e,
|
|
2273
|
-
const { validSuccess:
|
|
2274
|
-
return
|
|
157
|
+
validResponse(e, t) {
|
|
158
|
+
const { validSuccess: o, validate: r } = e;
|
|
159
|
+
return o && r ? !!r(t) : !0;
|
|
2275
160
|
}
|
|
2276
161
|
isSkipWarnResponse(e) {
|
|
2277
162
|
return !!e.promise;
|
|
2278
163
|
}
|
|
2279
|
-
send(e = {},
|
|
2280
|
-
const
|
|
164
|
+
send(e = {}, t = !1) {
|
|
165
|
+
const o = v({}, this.settings, e.settings || {}), r = e.query || {}, s = O(e, [
|
|
2281
166
|
"settings",
|
|
2282
167
|
"query"
|
|
2283
|
-
]), i =
|
|
2284
|
-
this.records[i] = { settings:
|
|
2285
|
-
const
|
|
2286
|
-
|
|
168
|
+
]), i = X(!1), c = A.CancelToken.source();
|
|
169
|
+
this.records[i] = { settings: o, config: s, source: c };
|
|
170
|
+
const a = this.createUrl(s) || "", d = this.createHeaders(i, o, s), { url: l, headers: u } = this.createProxy(o, a, d), { data: h, params: y } = this.createSendData(
|
|
171
|
+
o,
|
|
2287
172
|
s,
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
173
|
+
u,
|
|
174
|
+
t,
|
|
175
|
+
r
|
|
2291
176
|
);
|
|
2292
|
-
return this.showLoading(
|
|
177
|
+
return this.showLoading(o), new Promise((g, S) => {
|
|
2293
178
|
this.axios({
|
|
2294
|
-
cancelToken:
|
|
179
|
+
cancelToken: c.token,
|
|
2295
180
|
...s,
|
|
2296
|
-
url:
|
|
2297
|
-
headers:
|
|
2298
|
-
data:
|
|
2299
|
-
params:
|
|
2300
|
-
}).then((
|
|
2301
|
-
delete this.records[i], this.closeLoading(
|
|
181
|
+
url: l,
|
|
182
|
+
headers: u,
|
|
183
|
+
data: h,
|
|
184
|
+
params: y
|
|
185
|
+
}).then((f) => this.isSkipWarnResponse(f) ? g(f.promise) : this.validResponse(o, f) ? g(o.originResponse ? f : f.data?.data) : (this.showError(o, f.data), S(f.data))).catch((f) => (this.showError(o, f), S(f))).finally(() => {
|
|
186
|
+
delete this.records[i], this.closeLoading(o);
|
|
2302
187
|
});
|
|
2303
188
|
});
|
|
2304
189
|
}
|
|
2305
|
-
useResponse(e,
|
|
2306
|
-
const { response:
|
|
2307
|
-
return () =>
|
|
190
|
+
useResponse(e, t) {
|
|
191
|
+
const { response: o } = this.axios.interceptors, r = o.use(e, t);
|
|
192
|
+
return () => o.eject(r);
|
|
2308
193
|
}
|
|
2309
|
-
useRequest(e,
|
|
2310
|
-
const { request:
|
|
2311
|
-
return () =>
|
|
194
|
+
useRequest(e, t) {
|
|
195
|
+
const { request: o } = this.axios.interceptors, r = o.use(e, t);
|
|
196
|
+
return () => o.eject(r);
|
|
2312
197
|
}
|
|
2313
198
|
setupSkipWarn(e) {
|
|
2314
199
|
if (this.stopSkipWarn && (this.stopSkipWarn(), this.stopSkipWarn = void 0), !e.skipWarn) return;
|
|
2315
|
-
const { code:
|
|
200
|
+
const { code: t, executor: o, callback: r, complete: s } = e.skipWarn;
|
|
2316
201
|
this.stopSkipWarn = this.useResponse((i) => {
|
|
2317
|
-
const
|
|
2318
|
-
if (!
|
|
2319
|
-
const { data:
|
|
2320
|
-
if (!
|
|
2321
|
-
if (
|
|
2322
|
-
|
|
2323
|
-
const
|
|
202
|
+
const a = (i.config.headers || {})[P], d = this.records[a];
|
|
203
|
+
if (!d) return i;
|
|
204
|
+
const { data: l } = i;
|
|
205
|
+
if (!l || typeof l != "object") return i;
|
|
206
|
+
if (l?.code === t) {
|
|
207
|
+
r && r(i);
|
|
208
|
+
const u = new Promise(o).then(() => this.send(
|
|
2324
209
|
{
|
|
2325
|
-
...
|
|
2326
|
-
settings:
|
|
210
|
+
...d.config,
|
|
211
|
+
settings: d.settings
|
|
2327
212
|
},
|
|
2328
213
|
!0
|
|
2329
214
|
));
|
|
2330
|
-
|
|
215
|
+
u.catch((h) => h).finally(() => {
|
|
2331
216
|
s && s();
|
|
2332
|
-
}), i.promise =
|
|
217
|
+
}), i.promise = u;
|
|
2333
218
|
}
|
|
2334
219
|
return i;
|
|
2335
220
|
});
|
|
2336
221
|
}
|
|
2337
222
|
}
|
|
2338
|
-
function
|
|
2339
|
-
const e = new
|
|
2340
|
-
return Object.assign(
|
|
223
|
+
function oe(n = {}) {
|
|
224
|
+
const e = new ne(n), t = e.send.bind(e), o = e.cancel.bind(e), r = e.setConfig.bind(e), s = e.useRequest.bind(e), i = e.useResponse.bind(e);
|
|
225
|
+
return Object.assign(t, {
|
|
2341
226
|
...e,
|
|
2342
227
|
instance: e,
|
|
2343
|
-
send:
|
|
2344
|
-
cancel:
|
|
2345
|
-
setConfig:
|
|
228
|
+
send: t,
|
|
229
|
+
cancel: o,
|
|
230
|
+
setConfig: r,
|
|
2346
231
|
useRequest: s,
|
|
2347
232
|
useResponse: i
|
|
2348
233
|
});
|
|
2349
234
|
}
|
|
2350
|
-
const
|
|
235
|
+
const F = oe({
|
|
2351
236
|
settings: {
|
|
2352
237
|
injectHeaders: !0,
|
|
2353
238
|
loading: !0,
|
|
2354
239
|
originResponse: !0
|
|
2355
240
|
}
|
|
2356
241
|
});
|
|
2357
|
-
function
|
|
2358
|
-
const
|
|
2359
|
-
return (
|
|
2360
|
-
}
|
|
2361
|
-
function
|
|
2362
|
-
const
|
|
2363
|
-
for (const [
|
|
2364
|
-
|
|
2365
|
-
return
|
|
242
|
+
function re(n, e = F) {
|
|
243
|
+
const t = typeof n == "string" ? { url: n } : n;
|
|
244
|
+
return (o, r) => e.send(v({}, t, r || {}, { data: o }));
|
|
245
|
+
}
|
|
246
|
+
function Te(n, e = F) {
|
|
247
|
+
const t = {};
|
|
248
|
+
for (const [o, r] of Object.entries(n))
|
|
249
|
+
t[o] = re(r, e);
|
|
250
|
+
return t;
|
|
2366
251
|
}
|
|
2367
|
-
function
|
|
2368
|
-
const
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
}).catch((
|
|
2372
|
-
|
|
252
|
+
function Ae(n, e) {
|
|
253
|
+
const t = R(null), o = R(), r = R(!0), s = () => {
|
|
254
|
+
r.value = !0, o.value = void 0, (typeof n == "function" ? n() : n).then((c) => {
|
|
255
|
+
t.value = e ? e(c) : c;
|
|
256
|
+
}).catch((c) => {
|
|
257
|
+
o.value = c;
|
|
2373
258
|
}).finally(() => {
|
|
2374
|
-
|
|
259
|
+
r.value = !1;
|
|
2375
260
|
});
|
|
2376
261
|
};
|
|
2377
262
|
return s(), {
|
|
2378
|
-
data:
|
|
2379
|
-
error:
|
|
2380
|
-
loading:
|
|
263
|
+
data: t,
|
|
264
|
+
error: o,
|
|
265
|
+
loading: r,
|
|
2381
266
|
reload: s
|
|
2382
267
|
};
|
|
2383
268
|
}
|
|
2384
|
-
const
|
|
2385
|
-
const
|
|
2386
|
-
|
|
2387
|
-
e(
|
|
2388
|
-
},
|
|
2389
|
-
|
|
269
|
+
const x = typeof window < "u", Pe = (n) => new Promise((e, t) => {
|
|
270
|
+
const o = new FileReader();
|
|
271
|
+
o.readAsDataURL(n), o.onload = () => {
|
|
272
|
+
e(o.result);
|
|
273
|
+
}, o.onerror = (r) => {
|
|
274
|
+
t(r);
|
|
2390
275
|
};
|
|
2391
276
|
});
|
|
2392
|
-
function
|
|
277
|
+
function Ue(n) {
|
|
2393
278
|
const e = {};
|
|
2394
|
-
return
|
|
2395
|
-
e[
|
|
279
|
+
return n ? (n.forEach((t, o) => {
|
|
280
|
+
e[o] = typeof t == "string" ? decodeURIComponent(t) : t;
|
|
2396
281
|
}), e) : {};
|
|
2397
282
|
}
|
|
2398
|
-
function
|
|
2399
|
-
const e =
|
|
2400
|
-
let
|
|
2401
|
-
const s = new Uint8Array(
|
|
2402
|
-
for (;
|
|
2403
|
-
s[
|
|
2404
|
-
return new Blob([s], { type:
|
|
283
|
+
function Me(n) {
|
|
284
|
+
const e = n.split(","), t = e[0].match(/:(.*?);/)?.[1], o = atob(e[1]);
|
|
285
|
+
let r = o.length;
|
|
286
|
+
const s = new Uint8Array(r);
|
|
287
|
+
for (; r--; )
|
|
288
|
+
s[r] = o.charCodeAt(r);
|
|
289
|
+
return new Blob([s], { type: t });
|
|
2405
290
|
}
|
|
2406
|
-
function
|
|
2407
|
-
const
|
|
2408
|
-
return
|
|
291
|
+
function De(n, e) {
|
|
292
|
+
const t = n;
|
|
293
|
+
return t.lastModified = Date.now(), t.lastModifiedDate = /* @__PURE__ */ new Date(), t.name = e, t;
|
|
2409
294
|
}
|
|
2410
|
-
const
|
|
2411
|
-
class
|
|
295
|
+
const Fe = (n) => x ? window.requestAnimationFrame(n) : setTimeout(n, 16), Ie = (n) => x ? window.cancelAnimationFrame(n) : clearTimeout(n);
|
|
296
|
+
class se {
|
|
2412
297
|
constructor(e = {}) {
|
|
2413
|
-
|
|
298
|
+
p(this, "options", {
|
|
2414
299
|
type: "cache",
|
|
2415
300
|
expired: 0,
|
|
2416
301
|
prefix: "__VTJ_"
|
|
2417
302
|
});
|
|
2418
|
-
|
|
2419
|
-
|
|
303
|
+
p(this, "caches", {});
|
|
304
|
+
p(this, "types");
|
|
2420
305
|
this.types = {
|
|
2421
|
-
local:
|
|
2422
|
-
session:
|
|
306
|
+
local: x ? window.localStorage : this.caches,
|
|
307
|
+
session: x ? window.sessionStorage : this.caches,
|
|
2423
308
|
cache: this.caches
|
|
2424
309
|
}, this.config(e);
|
|
2425
310
|
}
|
|
2426
311
|
config(e = {}) {
|
|
2427
312
|
this.options = Object.assign(this.options, e);
|
|
2428
313
|
}
|
|
2429
|
-
save(e,
|
|
2430
|
-
const { type:
|
|
2431
|
-
value:
|
|
2432
|
-
timestamp:
|
|
314
|
+
save(e, t, o = {}) {
|
|
315
|
+
const { type: r, expired: s, prefix: i } = { ...this.options, ...o }, c = Date.now(), a = i + e, d = this.types[r] || this.caches, l = {
|
|
316
|
+
value: t,
|
|
317
|
+
timestamp: c,
|
|
2433
318
|
expired: s
|
|
2434
319
|
};
|
|
2435
|
-
|
|
320
|
+
d === this.caches ? d[a] = l : d.setItem(a, JSON.stringify(l));
|
|
2436
321
|
}
|
|
2437
|
-
get(e,
|
|
2438
|
-
const { type:
|
|
2439
|
-
let
|
|
322
|
+
get(e, t = {}) {
|
|
323
|
+
const { type: o, prefix: r } = { ...this.options, ...t }, s = r + e, i = this.types[o] || this.caches;
|
|
324
|
+
let c;
|
|
2440
325
|
if (i === this.caches)
|
|
2441
|
-
|
|
326
|
+
c = i[s];
|
|
2442
327
|
else {
|
|
2443
|
-
const
|
|
2444
|
-
if (
|
|
328
|
+
const h = i.getItem(s);
|
|
329
|
+
if (h)
|
|
2445
330
|
try {
|
|
2446
|
-
|
|
2447
|
-
} catch (
|
|
2448
|
-
console.warn("[Storage] JSON.parse",
|
|
331
|
+
c = JSON.parse(h);
|
|
332
|
+
} catch (y) {
|
|
333
|
+
console.warn("[Storage] JSON.parse", y);
|
|
2449
334
|
}
|
|
2450
335
|
}
|
|
2451
|
-
if (!
|
|
2452
|
-
const { value:
|
|
2453
|
-
return
|
|
336
|
+
if (!c) return null;
|
|
337
|
+
const { value: a, timestamp: d, expired: l } = c;
|
|
338
|
+
return l > 0 && d + l < Date.now() ? (this.remove(e, t), null) : a;
|
|
2454
339
|
}
|
|
2455
|
-
remove(e,
|
|
2456
|
-
const { type:
|
|
340
|
+
remove(e, t = {}) {
|
|
341
|
+
const { type: o, prefix: r } = { ...this.options, ...t }, s = this.types[o] || this.caches, i = r + e;
|
|
2457
342
|
s === this.caches ? delete s[i] : s.removeItem(i);
|
|
2458
343
|
}
|
|
2459
344
|
clear(e = {}) {
|
|
2460
|
-
const { type:
|
|
2461
|
-
|
|
345
|
+
const { type: t } = { ...this.options, ...e }, o = this.types[t] || this.caches;
|
|
346
|
+
o === this.caches ? this.caches = {} : o.clear();
|
|
2462
347
|
}
|
|
2463
348
|
}
|
|
2464
|
-
const
|
|
2465
|
-
function
|
|
2466
|
-
return
|
|
349
|
+
const Je = new se();
|
|
350
|
+
function I(n) {
|
|
351
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
2467
352
|
}
|
|
2468
|
-
var
|
|
2469
|
-
function
|
|
2470
|
-
return
|
|
2471
|
-
(function(
|
|
2472
|
-
|
|
2473
|
-
})(
|
|
2474
|
-
var
|
|
353
|
+
var b = { exports: {} }, ie = b.exports, U;
|
|
354
|
+
function ce() {
|
|
355
|
+
return U || (U = 1, (function(n, e) {
|
|
356
|
+
(function(t, o) {
|
|
357
|
+
o(e, n);
|
|
358
|
+
})(ie, function(t, o) {
|
|
359
|
+
var r = {
|
|
2475
360
|
timeout: 5e3,
|
|
2476
361
|
jsonpCallback: "callback"
|
|
2477
362
|
};
|
|
2478
363
|
function s() {
|
|
2479
364
|
return "jsonp_" + Date.now() + "_" + Math.ceil(Math.random() * 1e5);
|
|
2480
365
|
}
|
|
2481
|
-
function i(
|
|
366
|
+
function i(d) {
|
|
2482
367
|
try {
|
|
2483
|
-
delete window[
|
|
368
|
+
delete window[d];
|
|
2484
369
|
} catch {
|
|
2485
|
-
window[
|
|
370
|
+
window[d] = void 0;
|
|
2486
371
|
}
|
|
2487
372
|
}
|
|
2488
|
-
function
|
|
2489
|
-
var
|
|
2490
|
-
|
|
373
|
+
function c(d) {
|
|
374
|
+
var l = document.getElementById(d);
|
|
375
|
+
l && document.getElementsByTagName("head")[0].removeChild(l);
|
|
2491
376
|
}
|
|
2492
|
-
function
|
|
2493
|
-
var
|
|
2494
|
-
return new Promise(function(
|
|
2495
|
-
var m =
|
|
2496
|
-
window[m] = function(
|
|
2497
|
-
|
|
377
|
+
function a(d) {
|
|
378
|
+
var l = arguments.length <= 1 || arguments[1] === void 0 ? {} : arguments[1], u = d, h = l.timeout || r.timeout, y = l.jsonpCallback || r.jsonpCallback, g = void 0;
|
|
379
|
+
return new Promise(function(S, f) {
|
|
380
|
+
var m = l.jsonpCallbackFunction || s(), j = y + "_" + m;
|
|
381
|
+
window[m] = function(q) {
|
|
382
|
+
S({
|
|
2498
383
|
ok: !0,
|
|
2499
384
|
// keep consistent with fetch API
|
|
2500
385
|
json: function() {
|
|
2501
|
-
return Promise.resolve(
|
|
386
|
+
return Promise.resolve(q);
|
|
2502
387
|
}
|
|
2503
|
-
}),
|
|
2504
|
-
},
|
|
2505
|
-
var
|
|
2506
|
-
|
|
2507
|
-
|
|
388
|
+
}), g && clearTimeout(g), c(j), i(m);
|
|
389
|
+
}, u += u.indexOf("?") === -1 ? "?" : "&";
|
|
390
|
+
var w = document.createElement("script");
|
|
391
|
+
w.setAttribute("src", "" + u + y + "=" + m), l.charset && w.setAttribute("charset", l.charset), l.nonce && w.setAttribute("nonce", l.nonce), l.referrerPolicy && w.setAttribute("referrerPolicy", l.referrerPolicy), l.crossorigin && w.setAttribute("crossorigin", "true"), w.id = j, document.getElementsByTagName("head")[0].appendChild(w), g = setTimeout(function() {
|
|
392
|
+
f(new Error("JSONP request to " + d + " timed out")), i(m), c(j), window[m] = function() {
|
|
2508
393
|
i(m);
|
|
2509
394
|
};
|
|
2510
|
-
},
|
|
2511
|
-
|
|
395
|
+
}, h), w.onerror = function() {
|
|
396
|
+
f(new Error("JSONP request to " + d + " failed")), i(m), c(j), g && clearTimeout(g);
|
|
2512
397
|
};
|
|
2513
398
|
});
|
|
2514
399
|
}
|
|
2515
|
-
|
|
400
|
+
o.exports = a;
|
|
2516
401
|
});
|
|
2517
|
-
})(
|
|
2518
|
-
}
|
|
2519
|
-
var
|
|
2520
|
-
const
|
|
2521
|
-
function
|
|
2522
|
-
if (
|
|
2523
|
-
const { protocol: e, host:
|
|
2524
|
-
return `${e}//${
|
|
402
|
+
})(b, b.exports)), b.exports;
|
|
403
|
+
}
|
|
404
|
+
var ae = ce();
|
|
405
|
+
const le = /* @__PURE__ */ I(ae);
|
|
406
|
+
function de(n) {
|
|
407
|
+
if (x) {
|
|
408
|
+
const { protocol: e, host: t, pathname: o } = location;
|
|
409
|
+
return `${e}//${t}${n ? o : ""}`;
|
|
2525
410
|
} else
|
|
2526
411
|
return null;
|
|
2527
412
|
}
|
|
2528
|
-
function
|
|
2529
|
-
const e =
|
|
413
|
+
function ue(n = "") {
|
|
414
|
+
const e = n.match(Y);
|
|
2530
415
|
return e ? e[0] : "";
|
|
2531
416
|
}
|
|
2532
|
-
function
|
|
417
|
+
function J(n) {
|
|
2533
418
|
const e = [];
|
|
2534
|
-
for (const
|
|
2535
|
-
Object.prototype.hasOwnProperty.call(
|
|
419
|
+
for (const t in n)
|
|
420
|
+
Object.prototype.hasOwnProperty.call(n, t) && e.push([t, encodeURIComponent(n[t])].join("="));
|
|
2536
421
|
return e.join("&");
|
|
2537
422
|
}
|
|
2538
|
-
function
|
|
2539
|
-
const
|
|
2540
|
-
|
|
2541
|
-
let
|
|
423
|
+
function k(n, e, t) {
|
|
424
|
+
const o = {};
|
|
425
|
+
n = (n || location.search).replace(/^[^]*\?/, ""), e = e || "&", t = t || "=";
|
|
426
|
+
let r;
|
|
2542
427
|
const s = new RegExp(
|
|
2543
|
-
"(?:^|\\" + e + ")([^\\" +
|
|
428
|
+
"(?:^|\\" + e + ")([^\\" + t + "\\" + e + "]+)(?:\\" + t + "([^\\" + e + "]*))?",
|
|
2544
429
|
"g"
|
|
2545
430
|
);
|
|
2546
|
-
for (; (
|
|
2547
|
-
|
|
2548
|
-
return
|
|
431
|
+
for (; (r = s.exec(n)) !== null; )
|
|
432
|
+
r[1] !== n && (o[decodeURIComponent(r[1])] = decodeURIComponent(r[2] || ""));
|
|
433
|
+
return o;
|
|
2549
434
|
}
|
|
2550
|
-
function
|
|
2551
|
-
e = typeof e == "string" ?
|
|
2552
|
-
const
|
|
2553
|
-
return s ? [
|
|
435
|
+
function W(n, e) {
|
|
436
|
+
e = typeof e == "string" ? k(e) : e;
|
|
437
|
+
const t = n.split("?")[0], o = k(n), r = Object.assign({}, o, e), s = J(r);
|
|
438
|
+
return s ? [t, s].join("?") : n;
|
|
2554
439
|
}
|
|
2555
|
-
const
|
|
440
|
+
const We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2556
441
|
__proto__: null,
|
|
2557
|
-
append:
|
|
2558
|
-
getCurrentHost:
|
|
2559
|
-
getHost:
|
|
2560
|
-
parse:
|
|
2561
|
-
stringify:
|
|
442
|
+
append: W,
|
|
443
|
+
getCurrentHost: de,
|
|
444
|
+
getHost: ue,
|
|
445
|
+
parse: k,
|
|
446
|
+
stringify: J
|
|
2562
447
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2563
|
-
async function
|
|
2564
|
-
const { query:
|
|
2565
|
-
|
|
2566
|
-
const
|
|
2567
|
-
return await (await
|
|
2568
|
-
}
|
|
2569
|
-
var
|
|
2570
|
-
function
|
|
2571
|
-
if (
|
|
2572
|
-
|
|
2573
|
-
var
|
|
448
|
+
async function Be(n, e = {}) {
|
|
449
|
+
const { query: t = {} } = e;
|
|
450
|
+
n.includes("${") && (n = K(n)(t || {}));
|
|
451
|
+
const o = W(n, t);
|
|
452
|
+
return await (await le(o, e)).json();
|
|
453
|
+
}
|
|
454
|
+
var E, M;
|
|
455
|
+
function fe() {
|
|
456
|
+
if (M) return E;
|
|
457
|
+
M = 1, E = function(r, s, i) {
|
|
458
|
+
var c = document.head || document.getElementsByTagName("head")[0], a = document.createElement("script");
|
|
2574
459
|
typeof s == "function" && (i = s, s = {}), s = s || {}, i = i || function() {
|
|
2575
|
-
},
|
|
2576
|
-
var
|
|
2577
|
-
|
|
460
|
+
}, a.type = s.type || "text/javascript", a.charset = s.charset || "utf8", a.async = "async" in s ? !!s.async : !0, a.src = r, s.attrs && n(a, s.attrs), s.text && (a.text = "" + s.text);
|
|
461
|
+
var d = "onload" in a ? e : t;
|
|
462
|
+
d(a, i), a.onload || e(a, i), c.appendChild(a);
|
|
2578
463
|
};
|
|
2579
|
-
function
|
|
2580
|
-
for (var s in
|
|
2581
|
-
|
|
2582
|
-
}
|
|
2583
|
-
function e(
|
|
2584
|
-
|
|
2585
|
-
this.onerror = this.onload = null,
|
|
2586
|
-
},
|
|
2587
|
-
this.onerror = this.onload = null,
|
|
464
|
+
function n(o, r) {
|
|
465
|
+
for (var s in r)
|
|
466
|
+
o.setAttribute(s, r[s]);
|
|
467
|
+
}
|
|
468
|
+
function e(o, r) {
|
|
469
|
+
o.onload = function() {
|
|
470
|
+
this.onerror = this.onload = null, r(null, o);
|
|
471
|
+
}, o.onerror = function() {
|
|
472
|
+
this.onerror = this.onload = null, r(new Error("Failed to load " + this.src), o);
|
|
2588
473
|
};
|
|
2589
474
|
}
|
|
2590
|
-
function
|
|
2591
|
-
|
|
2592
|
-
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null,
|
|
475
|
+
function t(o, r) {
|
|
476
|
+
o.onreadystatechange = function() {
|
|
477
|
+
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, r(null, o));
|
|
2593
478
|
};
|
|
2594
479
|
}
|
|
2595
|
-
return
|
|
480
|
+
return E;
|
|
2596
481
|
}
|
|
2597
|
-
var
|
|
2598
|
-
const
|
|
2599
|
-
function
|
|
2600
|
-
return new Promise((
|
|
2601
|
-
const { library:
|
|
2602
|
-
|
|
2603
|
-
s ?
|
|
482
|
+
var pe = fe();
|
|
483
|
+
const he = /* @__PURE__ */ I(pe);
|
|
484
|
+
function qe(n, e = {}) {
|
|
485
|
+
return new Promise((t, o) => {
|
|
486
|
+
const { library: r } = e;
|
|
487
|
+
he(n, e, (s, i) => {
|
|
488
|
+
s ? o(s) : t(r ? window[r] : void 0);
|
|
2604
489
|
});
|
|
2605
490
|
});
|
|
2606
491
|
}
|
|
2607
|
-
const
|
|
2608
|
-
return function(...
|
|
2609
|
-
if (e &&
|
|
2610
|
-
console[
|
|
2611
|
-
return console[
|
|
492
|
+
const D = { debug: -1, log: 0, info: 0, warn: 1, error: 2 }, ge = function(n, e, t, o) {
|
|
493
|
+
return function(...r) {
|
|
494
|
+
if (e && D[e] <= D[n] && // @ts-ignore
|
|
495
|
+
console[n].apply && (o === "*" || t.startsWith(o)))
|
|
496
|
+
return console[n].apply(console, me(r, t));
|
|
2612
497
|
};
|
|
2613
498
|
};
|
|
2614
|
-
function
|
|
2615
|
-
return e !== "*" && (typeof
|
|
499
|
+
function me(n, e) {
|
|
500
|
+
return e !== "*" && (typeof n[0] == "string" ? n[0] = `[${e}] ${n[0]}` : n = ["[" + e + "]"].concat(n)), n;
|
|
2616
501
|
}
|
|
2617
|
-
function
|
|
2618
|
-
if (!
|
|
502
|
+
function we(n, e) {
|
|
503
|
+
if (!n)
|
|
2619
504
|
return {
|
|
2620
505
|
targetLevel: e.level,
|
|
2621
506
|
targetBizName: e.bizName
|
|
2622
507
|
};
|
|
2623
|
-
if (~
|
|
2624
|
-
const
|
|
508
|
+
if (~n.indexOf(":")) {
|
|
509
|
+
const t = n.split(":");
|
|
2625
510
|
return {
|
|
2626
|
-
targetLevel:
|
|
2627
|
-
targetBizName:
|
|
511
|
+
targetLevel: t[0],
|
|
512
|
+
targetBizName: t[1]
|
|
2628
513
|
};
|
|
2629
514
|
}
|
|
2630
515
|
return {
|
|
2631
|
-
targetLevel:
|
|
516
|
+
targetLevel: n,
|
|
2632
517
|
targetBizName: "*"
|
|
2633
518
|
};
|
|
2634
519
|
}
|
|
2635
|
-
const
|
|
520
|
+
const ye = {
|
|
2636
521
|
level: "warn",
|
|
2637
522
|
bizName: "*"
|
|
2638
523
|
};
|
|
2639
|
-
class
|
|
524
|
+
class ve {
|
|
2640
525
|
constructor(e) {
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
this.options = { ...
|
|
2644
|
-
const
|
|
2645
|
-
|
|
526
|
+
p(this, "config");
|
|
527
|
+
p(this, "options");
|
|
528
|
+
this.options = { ...ye, ...e };
|
|
529
|
+
const t = typeof location < "u" ? location : {}, o = (/__(?:logConf|logLevel)__=([^#/&]*)/.exec(
|
|
530
|
+
t.href
|
|
2646
531
|
) || [])[1];
|
|
2647
|
-
this.config =
|
|
532
|
+
this.config = we(o, e);
|
|
2648
533
|
}
|
|
2649
534
|
_log(e) {
|
|
2650
|
-
const { targetLevel:
|
|
2651
|
-
return
|
|
535
|
+
const { targetLevel: t, targetBizName: o } = this.config, { bizName: r } = this.options;
|
|
536
|
+
return ge(e, t, r, o);
|
|
2652
537
|
}
|
|
2653
538
|
debug(...e) {
|
|
2654
539
|
return this._log("debug")(...e);
|
|
@@ -2666,120 +551,120 @@ class po {
|
|
|
2666
551
|
return this._log("error")(...e);
|
|
2667
552
|
}
|
|
2668
553
|
}
|
|
2669
|
-
function
|
|
2670
|
-
return new
|
|
554
|
+
function be(n) {
|
|
555
|
+
return new ve(n);
|
|
2671
556
|
}
|
|
2672
|
-
const
|
|
557
|
+
const Ne = be({ level: "log", bizName: "VTJ" });
|
|
2673
558
|
/*! js-cookie v3.0.8 | MIT */
|
|
2674
|
-
function
|
|
559
|
+
function _(n) {
|
|
2675
560
|
for (var e = 1; e < arguments.length; e++) {
|
|
2676
|
-
var
|
|
2677
|
-
for (var
|
|
2678
|
-
|
|
561
|
+
var t = arguments[e];
|
|
562
|
+
for (var o in t)
|
|
563
|
+
o !== "__proto__" && (n[o] = t[o]);
|
|
2679
564
|
}
|
|
2680
|
-
return
|
|
565
|
+
return n;
|
|
2681
566
|
}
|
|
2682
|
-
var
|
|
2683
|
-
read: function(
|
|
2684
|
-
return
|
|
567
|
+
var xe = {
|
|
568
|
+
read: function(n) {
|
|
569
|
+
return n[0] === '"' && (n = n.slice(1, -1)), n.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
2685
570
|
},
|
|
2686
|
-
write: function(
|
|
2687
|
-
return encodeURIComponent(
|
|
571
|
+
write: function(n) {
|
|
572
|
+
return encodeURIComponent(n).replace(
|
|
2688
573
|
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
2689
574
|
decodeURIComponent
|
|
2690
575
|
);
|
|
2691
576
|
}
|
|
2692
577
|
};
|
|
2693
|
-
function
|
|
2694
|
-
function
|
|
578
|
+
function C(n, e) {
|
|
579
|
+
function t(r, s, i) {
|
|
2695
580
|
if (!(typeof document > "u")) {
|
|
2696
|
-
i =
|
|
2697
|
-
var
|
|
2698
|
-
for (var
|
|
2699
|
-
i[
|
|
2700
|
-
return document.cookie =
|
|
581
|
+
i = _({}, e, i), typeof i.expires == "number" && (i.expires = new Date(Date.now() + i.expires * 864e5)), i.expires && (i.expires = i.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
582
|
+
var c = "";
|
|
583
|
+
for (var a in i)
|
|
584
|
+
i[a] && (c += "; " + a, i[a] !== !0 && (c += "=" + i[a].split(";")[0]));
|
|
585
|
+
return document.cookie = r + "=" + n.write(s, r) + c;
|
|
2701
586
|
}
|
|
2702
587
|
}
|
|
2703
|
-
function r
|
|
2704
|
-
if (!(typeof document > "u" || arguments.length && !
|
|
2705
|
-
for (var s = document.cookie ? document.cookie.split("; ") : [], i = {},
|
|
2706
|
-
var
|
|
588
|
+
function o(r) {
|
|
589
|
+
if (!(typeof document > "u" || arguments.length && !r)) {
|
|
590
|
+
for (var s = document.cookie ? document.cookie.split("; ") : [], i = {}, c = 0; c < s.length; c++) {
|
|
591
|
+
var a = s[c].split("="), d = a.slice(1).join("=");
|
|
2707
592
|
try {
|
|
2708
|
-
var
|
|
2709
|
-
if (
|
|
593
|
+
var l = decodeURIComponent(a[0]);
|
|
594
|
+
if (l in i || (i[l] = n.read(d, l)), r === l)
|
|
2710
595
|
break;
|
|
2711
596
|
} catch {
|
|
2712
597
|
}
|
|
2713
598
|
}
|
|
2714
|
-
return
|
|
599
|
+
return r ? i[r] : i;
|
|
2715
600
|
}
|
|
2716
601
|
}
|
|
2717
602
|
return Object.create(
|
|
2718
603
|
{
|
|
2719
|
-
set:
|
|
2720
|
-
get:
|
|
2721
|
-
remove: function(
|
|
2722
|
-
|
|
2723
|
-
|
|
604
|
+
set: t,
|
|
605
|
+
get: o,
|
|
606
|
+
remove: function(r, s) {
|
|
607
|
+
t(
|
|
608
|
+
r,
|
|
2724
609
|
"",
|
|
2725
|
-
|
|
610
|
+
_({}, s, {
|
|
2726
611
|
expires: -1
|
|
2727
612
|
})
|
|
2728
613
|
);
|
|
2729
614
|
},
|
|
2730
|
-
withAttributes: function(
|
|
2731
|
-
return
|
|
615
|
+
withAttributes: function(r) {
|
|
616
|
+
return C(this.converter, _({}, this.attributes, r));
|
|
2732
617
|
},
|
|
2733
|
-
withConverter: function(
|
|
2734
|
-
return
|
|
618
|
+
withConverter: function(r) {
|
|
619
|
+
return C(_({}, this.converter, r), this.attributes);
|
|
2735
620
|
}
|
|
2736
621
|
},
|
|
2737
622
|
{
|
|
2738
623
|
attributes: { value: Object.freeze(e) },
|
|
2739
|
-
converter: { value: Object.freeze(
|
|
624
|
+
converter: { value: Object.freeze(n) }
|
|
2740
625
|
}
|
|
2741
626
|
);
|
|
2742
627
|
}
|
|
2743
|
-
var
|
|
2744
|
-
function
|
|
2745
|
-
|
|
628
|
+
var L = C(xe, { path: "/" });
|
|
629
|
+
function Se(n, e, t) {
|
|
630
|
+
L.set(n, e, t);
|
|
2746
631
|
}
|
|
2747
|
-
function
|
|
2748
|
-
return
|
|
632
|
+
function je(n) {
|
|
633
|
+
return L.get(n);
|
|
2749
634
|
}
|
|
2750
|
-
function
|
|
2751
|
-
|
|
635
|
+
function _e(n, e) {
|
|
636
|
+
L.remove(n, e);
|
|
2752
637
|
}
|
|
2753
|
-
const
|
|
638
|
+
const $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2754
639
|
__proto__: null,
|
|
2755
|
-
get:
|
|
2756
|
-
remove:
|
|
2757
|
-
set:
|
|
640
|
+
get: je,
|
|
641
|
+
remove: _e,
|
|
642
|
+
set: Se
|
|
2758
643
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2759
|
-
function
|
|
2760
|
-
const
|
|
2761
|
-
|
|
2762
|
-
}
|
|
2763
|
-
function
|
|
2764
|
-
const
|
|
2765
|
-
|
|
2766
|
-
}
|
|
2767
|
-
async function
|
|
2768
|
-
return fetch(
|
|
2769
|
-
const
|
|
2770
|
-
return
|
|
644
|
+
function He(n, e = "") {
|
|
645
|
+
const t = document.createElement("a");
|
|
646
|
+
t.download = e, t.href = n, t.target = "_blank", t.click();
|
|
647
|
+
}
|
|
648
|
+
function B(n, e = "", t) {
|
|
649
|
+
const o = new Blob([n], { type: t }), r = document.createElement("a");
|
|
650
|
+
r.download = e, r.style.display = "none", r.href = URL.createObjectURL(o), r.click(), URL.revokeObjectURL(r.href);
|
|
651
|
+
}
|
|
652
|
+
async function Ve(n, e = "", t) {
|
|
653
|
+
return fetch(n, { credentials: "include" }).then(async (o) => {
|
|
654
|
+
const r = await o.blob();
|
|
655
|
+
return B(r, e, t), r;
|
|
2771
656
|
});
|
|
2772
657
|
}
|
|
2773
|
-
function
|
|
2774
|
-
const
|
|
2775
|
-
|
|
658
|
+
function ze(n, e = "") {
|
|
659
|
+
const t = JSON.stringify(n);
|
|
660
|
+
B(t, e, "application/json");
|
|
2776
661
|
}
|
|
2777
|
-
function
|
|
2778
|
-
const
|
|
2779
|
-
let e = "Unknown",
|
|
2780
|
-
if (/Windows NT/i.test(
|
|
662
|
+
function Xe() {
|
|
663
|
+
const n = navigator.userAgent;
|
|
664
|
+
let e = "Unknown", t = "Unknown", o = "Unknown", r = "Unknown", s = !1;
|
|
665
|
+
if (/Windows NT/i.test(n)) {
|
|
2781
666
|
e = "Windows";
|
|
2782
|
-
const
|
|
667
|
+
const c = {
|
|
2783
668
|
"12.0": "12",
|
|
2784
669
|
"11.0": "11",
|
|
2785
670
|
"10.0": "10",
|
|
@@ -2789,87 +674,87 @@ function is() {
|
|
|
2789
674
|
"6.0": "Vista",
|
|
2790
675
|
"5.2": "XP 64-bit",
|
|
2791
676
|
"5.1": "XP"
|
|
2792
|
-
},
|
|
2793
|
-
|
|
2794
|
-
} else if (/Mac OS X/i.test(
|
|
677
|
+
}, a = n.match(/Windows NT (\d+\.\d+)/);
|
|
678
|
+
a && (t = c[a[1]] || a[1]);
|
|
679
|
+
} else if (/Mac OS X/i.test(n)) {
|
|
2795
680
|
e = "Mac OS";
|
|
2796
|
-
const
|
|
2797
|
-
|
|
2798
|
-
} else if (/(iPhone|iPad|iPod)/i.test(
|
|
681
|
+
const c = n.match(/Mac OS X (\d+[._]\d+[._]?\d*)/);
|
|
682
|
+
c && (t = c[1].replace(/_/g, "."));
|
|
683
|
+
} else if (/(iPhone|iPad|iPod)/i.test(n)) {
|
|
2799
684
|
e = "iOS";
|
|
2800
|
-
const
|
|
2801
|
-
|
|
2802
|
-
} else if (/Android/i.test(
|
|
685
|
+
const c = n.match(/OS (\d+[_\.]\d+[_\.]?\d*)/);
|
|
686
|
+
c && (t = c[1].replace(/_/g, "."));
|
|
687
|
+
} else if (/Android/i.test(n)) {
|
|
2803
688
|
e = "Android";
|
|
2804
|
-
const
|
|
2805
|
-
|
|
2806
|
-
} else /Linux/i.test(
|
|
2807
|
-
const i =
|
|
689
|
+
const c = n.match(/Android (\d+\.\d+)/);
|
|
690
|
+
c && (t = c[1]);
|
|
691
|
+
} else /Linux/i.test(n) && (e = "Linux");
|
|
692
|
+
const i = n.match(/(Edge|Edg|Edga|EdgA)\/(\d+)/i);
|
|
2808
693
|
if (i)
|
|
2809
|
-
|
|
694
|
+
o = "Microsoft Edge", r = i[2];
|
|
2810
695
|
else {
|
|
2811
|
-
const
|
|
2812
|
-
if (
|
|
2813
|
-
|
|
696
|
+
const c = n.match(/Firefox\/(\d+)/i);
|
|
697
|
+
if (c)
|
|
698
|
+
o = "Firefox", r = c[1];
|
|
2814
699
|
else {
|
|
2815
|
-
const
|
|
2816
|
-
if (
|
|
2817
|
-
|
|
700
|
+
const a = n.match(/(Opera|OPR)\/(\d+)/i);
|
|
701
|
+
if (a)
|
|
702
|
+
o = "Opera", r = a[2];
|
|
2818
703
|
else {
|
|
2819
|
-
const
|
|
2820
|
-
if (
|
|
2821
|
-
|
|
704
|
+
const d = n.match(/Chrome\/(\d+)/i);
|
|
705
|
+
if (d)
|
|
706
|
+
o = "Chrome", r = d[1];
|
|
2822
707
|
else {
|
|
2823
|
-
const
|
|
2824
|
-
if (
|
|
2825
|
-
|
|
708
|
+
const l = n.match(/Version\/(\d+\.\d+)/i);
|
|
709
|
+
if (l && /Safari/i.test(n))
|
|
710
|
+
o = "Safari", r = l[1];
|
|
2826
711
|
else {
|
|
2827
|
-
const
|
|
2828
|
-
|
|
712
|
+
const u = n.match(/(MSIE |Trident.*rv:)(\d+)/i);
|
|
713
|
+
u && (o = "Internet Explorer", r = u[2]);
|
|
2829
714
|
}
|
|
2830
715
|
}
|
|
2831
716
|
}
|
|
2832
717
|
}
|
|
2833
718
|
}
|
|
2834
719
|
return s = // 移动设备通用检测
|
|
2835
|
-
/(iPhone|iPod|iPad|Android|Windows Phone|Mobile)/i.test(
|
|
2836
|
-
["iOS", "Android"].includes(e), /(iPad|Tablet|Android(?!.*Mobile))/i.test(
|
|
720
|
+
/(iPhone|iPod|iPad|Android|Windows Phone|Mobile)/i.test(n) || // 根据已识别的操作系统补充判断
|
|
721
|
+
["iOS", "Android"].includes(e), /(iPad|Tablet|Android(?!.*Mobile))/i.test(n) && (s = !0), {
|
|
2837
722
|
os: e,
|
|
2838
|
-
osVersion:
|
|
2839
|
-
browser:
|
|
2840
|
-
browserVersion:
|
|
723
|
+
osVersion: t,
|
|
724
|
+
browser: o,
|
|
725
|
+
browserVersion: r,
|
|
2841
726
|
isMobile: s
|
|
2842
727
|
};
|
|
2843
728
|
}
|
|
2844
729
|
export {
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
730
|
+
P as LOCAL_REQUEST_ID,
|
|
731
|
+
ve as Logger,
|
|
732
|
+
ne as Request,
|
|
733
|
+
se as Storage,
|
|
734
|
+
Le as VTJ_UTILS_VERSION,
|
|
735
|
+
Ge as axios,
|
|
736
|
+
De as blobToFile,
|
|
737
|
+
Ie as cAF,
|
|
738
|
+
$e as cookie,
|
|
739
|
+
re as createApi,
|
|
740
|
+
Te as createApis,
|
|
741
|
+
oe as createRequest,
|
|
742
|
+
Me as dataURLtoBlob,
|
|
743
|
+
B as downloadBlob,
|
|
744
|
+
ze as downloadJson,
|
|
745
|
+
Ve as downloadRemoteFile,
|
|
746
|
+
He as downloadUrl,
|
|
747
|
+
Pe as fileToBase64,
|
|
748
|
+
Ue as formDataToJson,
|
|
749
|
+
Xe as getClientInfo,
|
|
750
|
+
be as getLogger,
|
|
751
|
+
x as isClient,
|
|
752
|
+
Be as jsonp,
|
|
753
|
+
qe as loadScript,
|
|
754
|
+
Ne as logger,
|
|
755
|
+
Fe as rAF,
|
|
756
|
+
F as request,
|
|
757
|
+
Je as storage,
|
|
758
|
+
We as url,
|
|
759
|
+
Ae as useApi
|
|
2875
760
|
};
|