@das-fed/utils 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/api-services/index.js +6840 -19720
  2. package/api-services/modules/app-manage.js +6966 -6
  3. package/api-services/modules/authentication.js +6966 -6
  4. package/api-services/modules/bems.js +6970 -11
  5. package/api-services/modules/contract.js +6966 -6
  6. package/api-services/modules/duty-manage.js +6970 -10
  7. package/api-services/modules/enterpriseright.js +6966 -6
  8. package/api-services/modules/file.js +7108 -353
  9. package/api-services/modules/gateway-edge.js +6966 -6
  10. package/api-services/modules/index.js +7163 -437
  11. package/api-services/modules/iot.js +6979 -19
  12. package/api-services/modules/justauth.js +6967 -7
  13. package/api-services/modules/knowledge.js +6966 -6
  14. package/api-services/modules/link.js +6966 -6
  15. package/api-services/modules/permission.js +6966 -6
  16. package/api-services/modules/platformManage.js +6974 -14
  17. package/api-services/modules/portal.js +6966 -6
  18. package/api-services/modules/space-manage.js +6966 -6
  19. package/api-services/modules/super-admin.js +6969 -9
  20. package/api-services/modules/supplier.js +6968 -8
  21. package/api-services/modules/supplychain-manage.js +6966 -6
  22. package/api-services/modules/systemConfiguration.js +6966 -6
  23. package/api-services/modules/tool.js +6966 -6
  24. package/api-services/src/create-service.js +6840 -19720
  25. package/api-services/src/sso.js +1711 -157
  26. package/api-services/src/util.js +1466 -19
  27. package/atob/index.js +9 -10
  28. package/common-info/getIframeUrl.js +14 -11
  29. package/common-info/index.js +194 -269
  30. package/common-info/setInfoFromUrl.js +60 -128
  31. package/common-tools/arr-tools.js +6 -13
  32. package/common-tools/date-format.js +18 -21
  33. package/common-tools/get-url-params.js +47 -88
  34. package/common-tools/handle-data.js +3 -4
  35. package/common-tools/index.js +108 -204
  36. package/common-tools/nest-tree-format.js +22 -49
  37. package/common-tools/obj-tools.js +17 -18
  38. package/common-tools/setHtmlMinWH.js +6 -10
  39. package/common-tools/throttled.js +7 -16
  40. package/config/index.js +8 -25
  41. package/curring-http/index.js +5150 -17289
  42. package/directive/auth.js +205 -97
  43. package/directive/clickOutside.js +25 -49
  44. package/directive/hoverInside.js +18 -35
  45. package/directive/index.js +238 -159
  46. package/directive/utils.js +6 -11
  47. package/dom-check-in/index.js +7 -15
  48. package/dom-watcher/index.js +7 -8
  49. package/hooks/popup-manager/use-zindex.js +17 -36
  50. package/index.js +242 -191
  51. package/load-js/index.js +14 -20
  52. package/oss/index.js +15 -15
  53. package/package.json +7 -11
  54. package/pinyin-first-character/index.js +25011 -12217
  55. package/process-engine-info/index.js +8 -10
  56. package/pure-image-src/index.js +3 -29
  57. package/set-personal-info/index.js +1566 -16
  58. package/size-watcher/index.js +17 -24
  59. package/style/index.js +62 -103
  60. package/style/math.js +16 -31
  61. package/style/style.js +49 -72
  62. package/token-tools/index.js +1594 -152
  63. package/vue/hooks/use-model-value.js +9 -10
  64. package/vue/index.js +9 -10
  65. package/webSocket-service/index.js +162 -135
  66. package/with-install/index.js +5 -7
@@ -1,200 +1,1754 @@
1
- import axios from 'axios';
2
- import { ref, watch } from 'vue';
3
- import { encryption } from '@das-fed/utils/atob';
4
- import { getConfig } from '@das-fed/utils/config';
5
- import { getUrlParams, funcUrlDel } from '@das-fed/utils/common-tools';
6
- import { setAccessToken, getAccessToken, removeAccessToken } from '@das-fed/utils/token-tools';
7
- import { setProcessEngineToken } from '@das-fed/utils/process-engine-info';
8
- import { setPersonalInfo } from '@das-fed/utils/set-personal-info';
9
-
10
- const getQuery = (name) => new URL(location.href).searchParams.get(name);
11
- const apis = {
1
+ import { ref as tt, watch as nt } from "vue";
2
+ function Pe(e, t) {
3
+ return function() {
4
+ return e.apply(t, arguments);
5
+ };
6
+ }
7
+ const { toString: rt } = Object.prototype, { getPrototypeOf: ce } = Object, K = /* @__PURE__ */ ((e) => (t) => {
8
+ const n = rt.call(t);
9
+ return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
10
+ })(/* @__PURE__ */ Object.create(null)), O = (e) => (e = e.toLowerCase(), (t) => K(t) === e), V = (e) => (t) => typeof t === e, { isArray: I } = Array, L = V("undefined");
11
+ function st(e) {
12
+ return e !== null && !L(e) && e.constructor !== null && !L(e.constructor) && b(e.constructor.isBuffer) && e.constructor.isBuffer(e);
13
+ }
14
+ const Ce = O("ArrayBuffer");
15
+ function ot(e) {
16
+ let t;
17
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ce(e.buffer), t;
18
+ }
19
+ const it = V("string"), b = V("function"), Ie = V("number"), W = (e) => e !== null && typeof e == "object", at = (e) => e === !0 || e === !1, H = (e) => {
20
+ if (K(e) !== "object")
21
+ return !1;
22
+ const t = ce(e);
23
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
24
+ }, ct = O("Date"), ut = O("File"), lt = O("Blob"), ft = O("FileList"), dt = (e) => W(e) && b(e.pipe), pt = (e) => {
25
+ let t;
26
+ return e && (typeof FormData == "function" && e instanceof FormData || b(e.append) && ((t = K(e)) === "formdata" || // detect form-data instance
27
+ t === "object" && b(e.toString) && e.toString() === "[object FormData]"));
28
+ }, ht = O("URLSearchParams"), mt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
29
+ function F(e, t, { allOwnKeys: n = !1 } = {}) {
30
+ if (e === null || typeof e > "u")
31
+ return;
32
+ let r, s;
33
+ if (typeof e != "object" && (e = [e]), I(e))
34
+ for (r = 0, s = e.length; r < s; r++)
35
+ t.call(null, e[r], r, e);
36
+ else {
37
+ const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
38
+ let c;
39
+ for (r = 0; r < i; r++)
40
+ c = o[r], t.call(null, e[c], c, e);
41
+ }
42
+ }
43
+ function Ue(e, t) {
44
+ t = t.toLowerCase();
45
+ const n = Object.keys(e);
46
+ let r = n.length, s;
47
+ for (; r-- > 0; )
48
+ if (s = n[r], t === s.toLowerCase())
49
+ return s;
50
+ return null;
51
+ }
52
+ const Le = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, De = (e) => !L(e) && e !== Le;
53
+ function te() {
54
+ const { caseless: e } = De(this) && this || {}, t = {}, n = (r, s) => {
55
+ const o = e && Ue(t, s) || s;
56
+ H(t[o]) && H(r) ? t[o] = te(t[o], r) : H(r) ? t[o] = te({}, r) : I(r) ? t[o] = r.slice() : t[o] = r;
57
+ };
58
+ for (let r = 0, s = arguments.length; r < s; r++)
59
+ arguments[r] && F(arguments[r], n);
60
+ return t;
61
+ }
62
+ const yt = (e, t, n, { allOwnKeys: r } = {}) => (F(t, (s, o) => {
63
+ n && b(s) ? e[o] = Pe(s, n) : e[o] = s;
64
+ }, { allOwnKeys: r }), e), gt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), wt = (e, t, n, r) => {
65
+ e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
66
+ value: t.prototype
67
+ }), n && Object.assign(e.prototype, n);
68
+ }, St = (e, t, n, r) => {
69
+ let s, o, i;
70
+ const c = {};
71
+ if (t = t || {}, e == null)
72
+ return t;
73
+ do {
74
+ for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
75
+ i = s[o], (!r || r(i, e, t)) && !c[i] && (t[i] = e[i], c[i] = !0);
76
+ e = n !== !1 && ce(e);
77
+ } while (e && (!n || n(e, t)) && e !== Object.prototype);
78
+ return t;
79
+ }, Et = (e, t, n) => {
80
+ e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
81
+ const r = e.indexOf(t, n);
82
+ return r !== -1 && r === n;
83
+ }, bt = (e) => {
84
+ if (!e)
85
+ return null;
86
+ if (I(e))
87
+ return e;
88
+ let t = e.length;
89
+ if (!Ie(t))
90
+ return null;
91
+ const n = new Array(t);
92
+ for (; t-- > 0; )
93
+ n[t] = e[t];
94
+ return n;
95
+ }, Rt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ce(Uint8Array)), Tt = (e, t) => {
96
+ const r = (e && e[Symbol.iterator]).call(e);
97
+ let s;
98
+ for (; (s = r.next()) && !s.done; ) {
99
+ const o = s.value;
100
+ t.call(e, o[0], o[1]);
101
+ }
102
+ }, kt = (e, t) => {
103
+ let n;
104
+ const r = [];
105
+ for (; (n = e.exec(t)) !== null; )
106
+ r.push(n);
107
+ return r;
108
+ }, Ot = O("HTMLFormElement"), At = (e) => e.toLowerCase().replace(
109
+ /[-_\s]([a-z\d])(\w*)/g,
110
+ function(n, r, s) {
111
+ return r.toUpperCase() + s;
112
+ }
113
+ ), ge = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), _t = O("RegExp"), Fe = (e, t) => {
114
+ const n = Object.getOwnPropertyDescriptors(e), r = {};
115
+ F(n, (s, o) => {
116
+ let i;
117
+ (i = t(s, o, e)) !== !1 && (r[o] = i || s);
118
+ }), Object.defineProperties(e, r);
119
+ }, xt = (e) => {
120
+ Fe(e, (t, n) => {
121
+ if (b(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
122
+ return !1;
123
+ const r = e[n];
124
+ if (b(r)) {
125
+ if (t.enumerable = !1, "writable" in t) {
126
+ t.writable = !1;
127
+ return;
128
+ }
129
+ t.set || (t.set = () => {
130
+ throw Error("Can not rewrite read-only method '" + n + "'");
131
+ });
132
+ }
133
+ });
134
+ }, Nt = (e, t) => {
135
+ const n = {}, r = (s) => {
136
+ s.forEach((o) => {
137
+ n[o] = !0;
138
+ });
139
+ };
140
+ return I(e) ? r(e) : r(String(e).split(t)), n;
141
+ }, Pt = () => {
142
+ }, Ct = (e, t) => (e = +e, Number.isFinite(e) ? e : t), Q = "abcdefghijklmnopqrstuvwxyz", we = "0123456789", Be = {
143
+ DIGIT: we,
144
+ ALPHA: Q,
145
+ ALPHA_DIGIT: Q + Q.toUpperCase() + we
146
+ }, It = (e = 16, t = Be.ALPHA_DIGIT) => {
147
+ let n = "";
148
+ const { length: r } = t;
149
+ for (; e--; )
150
+ n += t[Math.random() * r | 0];
151
+ return n;
152
+ };
153
+ function Ut(e) {
154
+ return !!(e && b(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
155
+ }
156
+ const Lt = (e) => {
157
+ const t = new Array(10), n = (r, s) => {
158
+ if (W(r)) {
159
+ if (t.indexOf(r) >= 0)
160
+ return;
161
+ if (!("toJSON" in r)) {
162
+ t[s] = r;
163
+ const o = I(r) ? [] : {};
164
+ return F(r, (i, c) => {
165
+ const l = n(i, s + 1);
166
+ !L(l) && (o[c] = l);
167
+ }), t[s] = void 0, o;
168
+ }
169
+ }
170
+ return r;
171
+ };
172
+ return n(e, 0);
173
+ }, Dt = O("AsyncFunction"), Ft = (e) => e && (W(e) || b(e)) && b(e.then) && b(e.catch), a = {
174
+ isArray: I,
175
+ isArrayBuffer: Ce,
176
+ isBuffer: st,
177
+ isFormData: pt,
178
+ isArrayBufferView: ot,
179
+ isString: it,
180
+ isNumber: Ie,
181
+ isBoolean: at,
182
+ isObject: W,
183
+ isPlainObject: H,
184
+ isUndefined: L,
185
+ isDate: ct,
186
+ isFile: ut,
187
+ isBlob: lt,
188
+ isRegExp: _t,
189
+ isFunction: b,
190
+ isStream: dt,
191
+ isURLSearchParams: ht,
192
+ isTypedArray: Rt,
193
+ isFileList: ft,
194
+ forEach: F,
195
+ merge: te,
196
+ extend: yt,
197
+ trim: mt,
198
+ stripBOM: gt,
199
+ inherits: wt,
200
+ toFlatObject: St,
201
+ kindOf: K,
202
+ kindOfTest: O,
203
+ endsWith: Et,
204
+ toArray: bt,
205
+ forEachEntry: Tt,
206
+ matchAll: kt,
207
+ isHTMLForm: Ot,
208
+ hasOwnProperty: ge,
209
+ hasOwnProp: ge,
210
+ // an alias to avoid ESLint no-prototype-builtins detection
211
+ reduceDescriptors: Fe,
212
+ freezeMethods: xt,
213
+ toObjectSet: Nt,
214
+ toCamelCase: At,
215
+ noop: Pt,
216
+ toFiniteNumber: Ct,
217
+ findKey: Ue,
218
+ global: Le,
219
+ isContextDefined: De,
220
+ ALPHABET: Be,
221
+ generateString: It,
222
+ isSpecCompliantForm: Ut,
223
+ toJSONObject: Lt,
224
+ isAsyncFn: Dt,
225
+ isThenable: Ft
226
+ };
227
+ function m(e, t, n, r, s) {
228
+ Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), s && (this.response = s);
229
+ }
230
+ a.inherits(m, Error, {
231
+ toJSON: function() {
232
+ return {
233
+ // Standard
234
+ message: this.message,
235
+ name: this.name,
236
+ // Microsoft
237
+ description: this.description,
238
+ number: this.number,
239
+ // Mozilla
240
+ fileName: this.fileName,
241
+ lineNumber: this.lineNumber,
242
+ columnNumber: this.columnNumber,
243
+ stack: this.stack,
244
+ // Axios
245
+ config: a.toJSONObject(this.config),
246
+ code: this.code,
247
+ status: this.response && this.response.status ? this.response.status : null
248
+ };
249
+ }
250
+ });
251
+ const je = m.prototype, ve = {};
252
+ [
253
+ "ERR_BAD_OPTION_VALUE",
254
+ "ERR_BAD_OPTION",
255
+ "ECONNABORTED",
256
+ "ETIMEDOUT",
257
+ "ERR_NETWORK",
258
+ "ERR_FR_TOO_MANY_REDIRECTS",
259
+ "ERR_DEPRECATED",
260
+ "ERR_BAD_RESPONSE",
261
+ "ERR_BAD_REQUEST",
262
+ "ERR_CANCELED",
263
+ "ERR_NOT_SUPPORT",
264
+ "ERR_INVALID_URL"
265
+ // eslint-disable-next-line func-names
266
+ ].forEach((e) => {
267
+ ve[e] = { value: e };
268
+ });
269
+ Object.defineProperties(m, ve);
270
+ Object.defineProperty(je, "isAxiosError", { value: !0 });
271
+ m.from = (e, t, n, r, s, o) => {
272
+ const i = Object.create(je);
273
+ return a.toFlatObject(e, i, function(l) {
274
+ return l !== Error.prototype;
275
+ }, (c) => c !== "isAxiosError"), m.call(i, e.message, t, n, r, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
276
+ };
277
+ const Bt = null;
278
+ function ne(e) {
279
+ return a.isPlainObject(e) || a.isArray(e);
280
+ }
281
+ function He(e) {
282
+ return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
283
+ }
284
+ function Se(e, t, n) {
285
+ return e ? e.concat(t).map(function(s, o) {
286
+ return s = He(s), !n && o ? "[" + s + "]" : s;
287
+ }).join(n ? "." : "") : t;
288
+ }
289
+ function jt(e) {
290
+ return a.isArray(e) && !e.some(ne);
291
+ }
292
+ const vt = a.toFlatObject(a, {}, null, function(t) {
293
+ return /^is[A-Z]/.test(t);
294
+ });
295
+ function G(e, t, n) {
296
+ if (!a.isObject(e))
297
+ throw new TypeError("target must be an object");
298
+ t = t || new FormData(), n = a.toFlatObject(n, {
299
+ metaTokens: !0,
300
+ dots: !1,
301
+ indexes: !1
302
+ }, !1, function(h, w) {
303
+ return !a.isUndefined(w[h]);
304
+ });
305
+ const r = n.metaTokens, s = n.visitor || f, o = n.dots, i = n.indexes, l = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
306
+ if (!a.isFunction(s))
307
+ throw new TypeError("visitor must be a function");
308
+ function d(p) {
309
+ if (p === null)
310
+ return "";
311
+ if (a.isDate(p))
312
+ return p.toISOString();
313
+ if (!l && a.isBlob(p))
314
+ throw new m("Blob is not supported. Use a Buffer instead.");
315
+ return a.isArrayBuffer(p) || a.isTypedArray(p) ? l && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
316
+ }
317
+ function f(p, h, w) {
318
+ let E = p;
319
+ if (p && !w && typeof p == "object") {
320
+ if (a.endsWith(h, "{}"))
321
+ h = r ? h : h.slice(0, -2), p = JSON.stringify(p);
322
+ else if (a.isArray(p) && jt(p) || (a.isFileList(p) || a.endsWith(h, "[]")) && (E = a.toArray(p)))
323
+ return h = He(h), E.forEach(function(x, et) {
324
+ !(a.isUndefined(x) || x === null) && t.append(
325
+ // eslint-disable-next-line no-nested-ternary
326
+ i === !0 ? Se([h], et, o) : i === null ? h : h + "[]",
327
+ d(x)
328
+ );
329
+ }), !1;
330
+ }
331
+ return ne(p) ? !0 : (t.append(Se(w, h, o), d(p)), !1);
332
+ }
333
+ const u = [], g = Object.assign(vt, {
334
+ defaultVisitor: f,
335
+ convertValue: d,
336
+ isVisitable: ne
337
+ });
338
+ function S(p, h) {
339
+ if (!a.isUndefined(p)) {
340
+ if (u.indexOf(p) !== -1)
341
+ throw Error("Circular reference detected in " + h.join("."));
342
+ u.push(p), a.forEach(p, function(E, _) {
343
+ (!(a.isUndefined(E) || E === null) && s.call(
344
+ t,
345
+ E,
346
+ a.isString(_) ? _.trim() : _,
347
+ h,
348
+ g
349
+ )) === !0 && S(E, h ? h.concat(_) : [_]);
350
+ }), u.pop();
351
+ }
352
+ }
353
+ if (!a.isObject(e))
354
+ throw new TypeError("data must be an object");
355
+ return S(e), t;
356
+ }
357
+ function Ee(e) {
358
+ const t = {
359
+ "!": "%21",
360
+ "'": "%27",
361
+ "(": "%28",
362
+ ")": "%29",
363
+ "~": "%7E",
364
+ "%20": "+",
365
+ "%00": "\0"
366
+ };
367
+ return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
368
+ return t[r];
369
+ });
370
+ }
371
+ function ue(e, t) {
372
+ this._pairs = [], e && G(e, this, t);
373
+ }
374
+ const Je = ue.prototype;
375
+ Je.append = function(t, n) {
376
+ this._pairs.push([t, n]);
377
+ };
378
+ Je.toString = function(t) {
379
+ const n = t ? function(r) {
380
+ return t.call(this, r, Ee);
381
+ } : Ee;
382
+ return this._pairs.map(function(s) {
383
+ return n(s[0]) + "=" + n(s[1]);
384
+ }, "").join("&");
385
+ };
386
+ function Ht(e) {
387
+ return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
388
+ }
389
+ function qe(e, t, n) {
390
+ if (!t)
391
+ return e;
392
+ const r = n && n.encode || Ht, s = n && n.serialize;
393
+ let o;
394
+ if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new ue(t, n).toString(r), o) {
395
+ const i = e.indexOf("#");
396
+ i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
397
+ }
398
+ return e;
399
+ }
400
+ class be {
401
+ constructor() {
402
+ this.handlers = [];
403
+ }
404
+ /**
405
+ * Add a new interceptor to the stack
406
+ *
407
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
408
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
409
+ *
410
+ * @return {Number} An ID used to remove interceptor later
411
+ */
412
+ use(t, n, r) {
413
+ return this.handlers.push({
414
+ fulfilled: t,
415
+ rejected: n,
416
+ synchronous: r ? r.synchronous : !1,
417
+ runWhen: r ? r.runWhen : null
418
+ }), this.handlers.length - 1;
419
+ }
420
+ /**
421
+ * Remove an interceptor from the stack
422
+ *
423
+ * @param {Number} id The ID that was returned by `use`
424
+ *
425
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
426
+ */
427
+ eject(t) {
428
+ this.handlers[t] && (this.handlers[t] = null);
429
+ }
430
+ /**
431
+ * Clear all interceptors from the stack
432
+ *
433
+ * @returns {void}
434
+ */
435
+ clear() {
436
+ this.handlers && (this.handlers = []);
437
+ }
438
+ /**
439
+ * Iterate over all the registered interceptors
440
+ *
441
+ * This method is particularly useful for skipping over any
442
+ * interceptors that may have become `null` calling `eject`.
443
+ *
444
+ * @param {Function} fn The function to call for each interceptor
445
+ *
446
+ * @returns {void}
447
+ */
448
+ forEach(t) {
449
+ a.forEach(this.handlers, function(r) {
450
+ r !== null && t(r);
451
+ });
452
+ }
453
+ }
454
+ const $e = {
455
+ silentJSONParsing: !0,
456
+ forcedJSONParsing: !0,
457
+ clarifyTimeoutError: !1
458
+ }, Jt = typeof URLSearchParams < "u" ? URLSearchParams : ue, qt = typeof FormData < "u" ? FormData : null, $t = typeof Blob < "u" ? Blob : null, Mt = {
459
+ isBrowser: !0,
460
+ classes: {
461
+ URLSearchParams: Jt,
462
+ FormData: qt,
463
+ Blob: $t
464
+ },
465
+ protocols: ["http", "https", "file", "blob", "url", "data"]
466
+ }, Me = typeof window < "u" && typeof document < "u", zt = ((e) => Me && ["ReactNative", "NativeScript", "NS"].indexOf(e) < 0)(typeof navigator < "u" && navigator.product), Kt = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
467
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
468
+ __proto__: null,
469
+ hasBrowserEnv: Me,
470
+ hasStandardBrowserEnv: zt,
471
+ hasStandardBrowserWebWorkerEnv: Kt
472
+ }, Symbol.toStringTag, { value: "Module" })), k = {
473
+ ...Vt,
474
+ ...Mt
475
+ };
476
+ function Wt(e, t) {
477
+ return G(e, new k.classes.URLSearchParams(), Object.assign({
478
+ visitor: function(n, r, s, o) {
479
+ return k.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
480
+ }
481
+ }, t));
482
+ }
483
+ function Gt(e) {
484
+ return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
485
+ }
486
+ function Xt(e) {
487
+ const t = {}, n = Object.keys(e);
488
+ let r;
489
+ const s = n.length;
490
+ let o;
491
+ for (r = 0; r < s; r++)
492
+ o = n[r], t[o] = e[o];
493
+ return t;
494
+ }
495
+ function ze(e) {
496
+ function t(n, r, s, o) {
497
+ let i = n[o++];
498
+ if (i === "__proto__")
499
+ return !0;
500
+ const c = Number.isFinite(+i), l = o >= n.length;
501
+ return i = !i && a.isArray(s) ? s.length : i, l ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = Xt(s[i])), !c);
502
+ }
503
+ if (a.isFormData(e) && a.isFunction(e.entries)) {
504
+ const n = {};
505
+ return a.forEachEntry(e, (r, s) => {
506
+ t(Gt(r), s, n, 0);
507
+ }), n;
508
+ }
509
+ return null;
510
+ }
511
+ function Qt(e, t, n) {
512
+ if (a.isString(e))
513
+ try {
514
+ return (t || JSON.parse)(e), a.trim(e);
515
+ } catch (r) {
516
+ if (r.name !== "SyntaxError")
517
+ throw r;
518
+ }
519
+ return (n || JSON.stringify)(e);
520
+ }
521
+ const le = {
522
+ transitional: $e,
523
+ adapter: ["xhr", "http"],
524
+ transformRequest: [function(t, n) {
525
+ const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(t);
526
+ if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
527
+ return s ? JSON.stringify(ze(t)) : t;
528
+ if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t))
529
+ return t;
530
+ if (a.isArrayBufferView(t))
531
+ return t.buffer;
532
+ if (a.isURLSearchParams(t))
533
+ return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
534
+ let c;
535
+ if (o) {
536
+ if (r.indexOf("application/x-www-form-urlencoded") > -1)
537
+ return Wt(t, this.formSerializer).toString();
538
+ if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
539
+ const l = this.env && this.env.FormData;
540
+ return G(
541
+ c ? { "files[]": t } : t,
542
+ l && new l(),
543
+ this.formSerializer
544
+ );
545
+ }
546
+ }
547
+ return o || s ? (n.setContentType("application/json", !1), Qt(t)) : t;
548
+ }],
549
+ transformResponse: [function(t) {
550
+ const n = this.transitional || le.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
551
+ if (t && a.isString(t) && (r && !this.responseType || s)) {
552
+ const i = !(n && n.silentJSONParsing) && s;
553
+ try {
554
+ return JSON.parse(t);
555
+ } catch (c) {
556
+ if (i)
557
+ throw c.name === "SyntaxError" ? m.from(c, m.ERR_BAD_RESPONSE, this, null, this.response) : c;
558
+ }
559
+ }
560
+ return t;
561
+ }],
562
+ /**
563
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
564
+ * timeout is not created.
565
+ */
566
+ timeout: 0,
567
+ xsrfCookieName: "XSRF-TOKEN",
568
+ xsrfHeaderName: "X-XSRF-TOKEN",
569
+ maxContentLength: -1,
570
+ maxBodyLength: -1,
571
+ env: {
572
+ FormData: k.classes.FormData,
573
+ Blob: k.classes.Blob
574
+ },
575
+ validateStatus: function(t) {
576
+ return t >= 200 && t < 300;
577
+ },
578
+ headers: {
579
+ common: {
580
+ Accept: "application/json, text/plain, */*",
581
+ "Content-Type": void 0
582
+ }
583
+ }
584
+ };
585
+ a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
586
+ le.headers[e] = {};
587
+ });
588
+ const fe = le, Yt = a.toObjectSet([
589
+ "age",
590
+ "authorization",
591
+ "content-length",
592
+ "content-type",
593
+ "etag",
594
+ "expires",
595
+ "from",
596
+ "host",
597
+ "if-modified-since",
598
+ "if-unmodified-since",
599
+ "last-modified",
600
+ "location",
601
+ "max-forwards",
602
+ "proxy-authorization",
603
+ "referer",
604
+ "retry-after",
605
+ "user-agent"
606
+ ]), Zt = (e) => {
607
+ const t = {};
608
+ let n, r, s;
609
+ return e && e.split(`
610
+ `).forEach(function(i) {
611
+ s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && Yt[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
612
+ }), t;
613
+ }, Re = Symbol("internals");
614
+ function U(e) {
615
+ return e && String(e).trim().toLowerCase();
616
+ }
617
+ function J(e) {
618
+ return e === !1 || e == null ? e : a.isArray(e) ? e.map(J) : String(e);
619
+ }
620
+ function en(e) {
621
+ const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
622
+ let r;
623
+ for (; r = n.exec(e); )
624
+ t[r[1]] = r[2];
625
+ return t;
626
+ }
627
+ const tn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
628
+ function Y(e, t, n, r, s) {
629
+ if (a.isFunction(r))
630
+ return r.call(this, t, n);
631
+ if (s && (t = n), !!a.isString(t)) {
632
+ if (a.isString(r))
633
+ return t.indexOf(r) !== -1;
634
+ if (a.isRegExp(r))
635
+ return r.test(t);
636
+ }
637
+ }
638
+ function nn(e) {
639
+ return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
640
+ }
641
+ function rn(e, t) {
642
+ const n = a.toCamelCase(" " + t);
643
+ ["get", "set", "has"].forEach((r) => {
644
+ Object.defineProperty(e, r + n, {
645
+ value: function(s, o, i) {
646
+ return this[r].call(this, t, s, o, i);
647
+ },
648
+ configurable: !0
649
+ });
650
+ });
651
+ }
652
+ class X {
653
+ constructor(t) {
654
+ t && this.set(t);
655
+ }
656
+ set(t, n, r) {
657
+ const s = this;
658
+ function o(c, l, d) {
659
+ const f = U(l);
660
+ if (!f)
661
+ throw new Error("header name must be a non-empty string");
662
+ const u = a.findKey(s, f);
663
+ (!u || s[u] === void 0 || d === !0 || d === void 0 && s[u] !== !1) && (s[u || l] = J(c));
664
+ }
665
+ const i = (c, l) => a.forEach(c, (d, f) => o(d, f, l));
666
+ return a.isPlainObject(t) || t instanceof this.constructor ? i(t, n) : a.isString(t) && (t = t.trim()) && !tn(t) ? i(Zt(t), n) : t != null && o(n, t, r), this;
667
+ }
668
+ get(t, n) {
669
+ if (t = U(t), t) {
670
+ const r = a.findKey(this, t);
671
+ if (r) {
672
+ const s = this[r];
673
+ if (!n)
674
+ return s;
675
+ if (n === !0)
676
+ return en(s);
677
+ if (a.isFunction(n))
678
+ return n.call(this, s, r);
679
+ if (a.isRegExp(n))
680
+ return n.exec(s);
681
+ throw new TypeError("parser must be boolean|regexp|function");
682
+ }
683
+ }
684
+ }
685
+ has(t, n) {
686
+ if (t = U(t), t) {
687
+ const r = a.findKey(this, t);
688
+ return !!(r && this[r] !== void 0 && (!n || Y(this, this[r], r, n)));
689
+ }
690
+ return !1;
691
+ }
692
+ delete(t, n) {
693
+ const r = this;
694
+ let s = !1;
695
+ function o(i) {
696
+ if (i = U(i), i) {
697
+ const c = a.findKey(r, i);
698
+ c && (!n || Y(r, r[c], c, n)) && (delete r[c], s = !0);
699
+ }
700
+ }
701
+ return a.isArray(t) ? t.forEach(o) : o(t), s;
702
+ }
703
+ clear(t) {
704
+ const n = Object.keys(this);
705
+ let r = n.length, s = !1;
706
+ for (; r--; ) {
707
+ const o = n[r];
708
+ (!t || Y(this, this[o], o, t, !0)) && (delete this[o], s = !0);
709
+ }
710
+ return s;
711
+ }
712
+ normalize(t) {
713
+ const n = this, r = {};
714
+ return a.forEach(this, (s, o) => {
715
+ const i = a.findKey(r, o);
716
+ if (i) {
717
+ n[i] = J(s), delete n[o];
718
+ return;
719
+ }
720
+ const c = t ? nn(o) : String(o).trim();
721
+ c !== o && delete n[o], n[c] = J(s), r[c] = !0;
722
+ }), this;
723
+ }
724
+ concat(...t) {
725
+ return this.constructor.concat(this, ...t);
726
+ }
727
+ toJSON(t) {
728
+ const n = /* @__PURE__ */ Object.create(null);
729
+ return a.forEach(this, (r, s) => {
730
+ r != null && r !== !1 && (n[s] = t && a.isArray(r) ? r.join(", ") : r);
731
+ }), n;
732
+ }
733
+ [Symbol.iterator]() {
734
+ return Object.entries(this.toJSON())[Symbol.iterator]();
735
+ }
736
+ toString() {
737
+ return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
738
+ `);
739
+ }
740
+ get [Symbol.toStringTag]() {
741
+ return "AxiosHeaders";
742
+ }
743
+ static from(t) {
744
+ return t instanceof this ? t : new this(t);
745
+ }
746
+ static concat(t, ...n) {
747
+ const r = new this(t);
748
+ return n.forEach((s) => r.set(s)), r;
749
+ }
750
+ static accessor(t) {
751
+ const r = (this[Re] = this[Re] = {
752
+ accessors: {}
753
+ }).accessors, s = this.prototype;
754
+ function o(i) {
755
+ const c = U(i);
756
+ r[c] || (rn(s, i), r[c] = !0);
757
+ }
758
+ return a.isArray(t) ? t.forEach(o) : o(t), this;
759
+ }
760
+ }
761
+ X.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
762
+ a.reduceDescriptors(X.prototype, ({ value: e }, t) => {
763
+ let n = t[0].toUpperCase() + t.slice(1);
764
+ return {
765
+ get: () => e,
766
+ set(r) {
767
+ this[n] = r;
768
+ }
769
+ };
770
+ });
771
+ a.freezeMethods(X);
772
+ const A = X;
773
+ function Z(e, t) {
774
+ const n = this || fe, r = t || n, s = A.from(r.headers);
775
+ let o = r.data;
776
+ return a.forEach(e, function(c) {
777
+ o = c.call(n, o, s.normalize(), t ? t.status : void 0);
778
+ }), s.normalize(), o;
779
+ }
780
+ function Ke(e) {
781
+ return !!(e && e.__CANCEL__);
782
+ }
783
+ function B(e, t, n) {
784
+ m.call(this, e ?? "canceled", m.ERR_CANCELED, t, n), this.name = "CanceledError";
785
+ }
786
+ a.inherits(B, m, {
787
+ __CANCEL__: !0
788
+ });
789
+ function sn(e, t, n) {
790
+ const r = n.config.validateStatus;
791
+ !n.status || !r || r(n.status) ? e(n) : t(new m(
792
+ "Request failed with status code " + n.status,
793
+ [m.ERR_BAD_REQUEST, m.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
794
+ n.config,
795
+ n.request,
796
+ n
797
+ ));
798
+ }
799
+ const on = k.hasStandardBrowserEnv ? (
800
+ // Standard browser envs support document.cookie
801
+ {
802
+ write(e, t, n, r, s, o) {
803
+ const i = [e + "=" + encodeURIComponent(t)];
804
+ a.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), a.isString(r) && i.push("path=" + r), a.isString(s) && i.push("domain=" + s), o === !0 && i.push("secure"), document.cookie = i.join("; ");
805
+ },
806
+ read(e) {
807
+ const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
808
+ return t ? decodeURIComponent(t[3]) : null;
809
+ },
810
+ remove(e) {
811
+ this.write(e, "", Date.now() - 864e5);
812
+ }
813
+ }
814
+ ) : (
815
+ // Non-standard browser env (web workers, react-native) lack needed support.
816
+ {
817
+ write() {
818
+ },
819
+ read() {
820
+ return null;
821
+ },
822
+ remove() {
823
+ }
824
+ }
825
+ );
826
+ function an(e) {
827
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
828
+ }
829
+ function cn(e, t) {
830
+ return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
831
+ }
832
+ function Ve(e, t) {
833
+ return e && !an(t) ? cn(e, t) : t;
834
+ }
835
+ const un = k.hasStandardBrowserEnv ? (
836
+ // Standard browser envs have full support of the APIs needed to test
837
+ // whether the request URL is of the same origin as current location.
838
+ function() {
839
+ const t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
840
+ let r;
841
+ function s(o) {
842
+ let i = o;
843
+ return t && (n.setAttribute("href", i), i = n.href), n.setAttribute("href", i), {
844
+ href: n.href,
845
+ protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
846
+ host: n.host,
847
+ search: n.search ? n.search.replace(/^\?/, "") : "",
848
+ hash: n.hash ? n.hash.replace(/^#/, "") : "",
849
+ hostname: n.hostname,
850
+ port: n.port,
851
+ pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
852
+ };
853
+ }
854
+ return r = s(window.location.href), function(i) {
855
+ const c = a.isString(i) ? s(i) : i;
856
+ return c.protocol === r.protocol && c.host === r.host;
857
+ };
858
+ }()
859
+ ) : (
860
+ // Non standard browser envs (web workers, react-native) lack needed support.
861
+ /* @__PURE__ */ function() {
862
+ return function() {
863
+ return !0;
864
+ };
865
+ }()
866
+ );
867
+ function ln(e) {
868
+ const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
869
+ return t && t[1] || "";
870
+ }
871
+ function fn(e, t) {
872
+ e = e || 10;
873
+ const n = new Array(e), r = new Array(e);
874
+ let s = 0, o = 0, i;
875
+ return t = t !== void 0 ? t : 1e3, function(l) {
876
+ const d = Date.now(), f = r[o];
877
+ i || (i = d), n[s] = l, r[s] = d;
878
+ let u = o, g = 0;
879
+ for (; u !== s; )
880
+ g += n[u++], u = u % e;
881
+ if (s = (s + 1) % e, s === o && (o = (o + 1) % e), d - i < t)
882
+ return;
883
+ const S = f && d - f;
884
+ return S ? Math.round(g * 1e3 / S) : void 0;
885
+ };
886
+ }
887
+ function Te(e, t) {
888
+ let n = 0;
889
+ const r = fn(50, 250);
890
+ return (s) => {
891
+ const o = s.loaded, i = s.lengthComputable ? s.total : void 0, c = o - n, l = r(c), d = o <= i;
892
+ n = o;
893
+ const f = {
894
+ loaded: o,
895
+ total: i,
896
+ progress: i ? o / i : void 0,
897
+ bytes: c,
898
+ rate: l || void 0,
899
+ estimated: l && i && d ? (i - o) / l : void 0,
900
+ event: s
901
+ };
902
+ f[t ? "download" : "upload"] = !0, e(f);
903
+ };
904
+ }
905
+ const dn = typeof XMLHttpRequest < "u", pn = dn && function(e) {
906
+ return new Promise(function(n, r) {
907
+ let s = e.data;
908
+ const o = A.from(e.headers).normalize();
909
+ let { responseType: i, withXSRFToken: c } = e, l;
910
+ function d() {
911
+ e.cancelToken && e.cancelToken.unsubscribe(l), e.signal && e.signal.removeEventListener("abort", l);
912
+ }
913
+ let f;
914
+ if (a.isFormData(s)) {
915
+ if (k.hasStandardBrowserEnv || k.hasStandardBrowserWebWorkerEnv)
916
+ o.setContentType(!1);
917
+ else if ((f = o.getContentType()) !== !1) {
918
+ const [h, ...w] = f ? f.split(";").map((E) => E.trim()).filter(Boolean) : [];
919
+ o.setContentType([h || "multipart/form-data", ...w].join("; "));
920
+ }
921
+ }
922
+ let u = new XMLHttpRequest();
923
+ if (e.auth) {
924
+ const h = e.auth.username || "", w = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
925
+ o.set("Authorization", "Basic " + btoa(h + ":" + w));
926
+ }
927
+ const g = Ve(e.baseURL, e.url);
928
+ u.open(e.method.toUpperCase(), qe(g, e.params, e.paramsSerializer), !0), u.timeout = e.timeout;
929
+ function S() {
930
+ if (!u)
931
+ return;
932
+ const h = A.from(
933
+ "getAllResponseHeaders" in u && u.getAllResponseHeaders()
934
+ ), E = {
935
+ data: !i || i === "text" || i === "json" ? u.responseText : u.response,
936
+ status: u.status,
937
+ statusText: u.statusText,
938
+ headers: h,
939
+ config: e,
940
+ request: u
941
+ };
942
+ sn(function(x) {
943
+ n(x), d();
944
+ }, function(x) {
945
+ r(x), d();
946
+ }, E), u = null;
947
+ }
948
+ if ("onloadend" in u ? u.onloadend = S : u.onreadystatechange = function() {
949
+ !u || u.readyState !== 4 || u.status === 0 && !(u.responseURL && u.responseURL.indexOf("file:") === 0) || setTimeout(S);
950
+ }, u.onabort = function() {
951
+ u && (r(new m("Request aborted", m.ECONNABORTED, e, u)), u = null);
952
+ }, u.onerror = function() {
953
+ r(new m("Network Error", m.ERR_NETWORK, e, u)), u = null;
954
+ }, u.ontimeout = function() {
955
+ let w = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded";
956
+ const E = e.transitional || $e;
957
+ e.timeoutErrorMessage && (w = e.timeoutErrorMessage), r(new m(
958
+ w,
959
+ E.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
960
+ e,
961
+ u
962
+ )), u = null;
963
+ }, k.hasStandardBrowserEnv && (c && a.isFunction(c) && (c = c(e)), c || c !== !1 && un(g))) {
964
+ const h = e.xsrfHeaderName && e.xsrfCookieName && on.read(e.xsrfCookieName);
965
+ h && o.set(e.xsrfHeaderName, h);
966
+ }
967
+ s === void 0 && o.setContentType(null), "setRequestHeader" in u && a.forEach(o.toJSON(), function(w, E) {
968
+ u.setRequestHeader(E, w);
969
+ }), a.isUndefined(e.withCredentials) || (u.withCredentials = !!e.withCredentials), i && i !== "json" && (u.responseType = e.responseType), typeof e.onDownloadProgress == "function" && u.addEventListener("progress", Te(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && u.upload && u.upload.addEventListener("progress", Te(e.onUploadProgress)), (e.cancelToken || e.signal) && (l = (h) => {
970
+ u && (r(!h || h.type ? new B(null, e, u) : h), u.abort(), u = null);
971
+ }, e.cancelToken && e.cancelToken.subscribe(l), e.signal && (e.signal.aborted ? l() : e.signal.addEventListener("abort", l)));
972
+ const p = ln(g);
973
+ if (p && k.protocols.indexOf(p) === -1) {
974
+ r(new m("Unsupported protocol " + p + ":", m.ERR_BAD_REQUEST, e));
975
+ return;
976
+ }
977
+ u.send(s || null);
978
+ });
979
+ }, re = {
980
+ http: Bt,
981
+ xhr: pn
982
+ };
983
+ a.forEach(re, (e, t) => {
984
+ if (e) {
985
+ try {
986
+ Object.defineProperty(e, "name", { value: t });
987
+ } catch {
988
+ }
989
+ Object.defineProperty(e, "adapterName", { value: t });
990
+ }
991
+ });
992
+ const ke = (e) => `- ${e}`, hn = (e) => a.isFunction(e) || e === null || e === !1, We = {
993
+ getAdapter: (e) => {
994
+ e = a.isArray(e) ? e : [e];
995
+ const { length: t } = e;
996
+ let n, r;
997
+ const s = {};
998
+ for (let o = 0; o < t; o++) {
999
+ n = e[o];
1000
+ let i;
1001
+ if (r = n, !hn(n) && (r = re[(i = String(n)).toLowerCase()], r === void 0))
1002
+ throw new m(`Unknown adapter '${i}'`);
1003
+ if (r)
1004
+ break;
1005
+ s[i || "#" + o] = r;
1006
+ }
1007
+ if (!r) {
1008
+ const o = Object.entries(s).map(
1009
+ ([c, l]) => `adapter ${c} ` + (l === !1 ? "is not supported by the environment" : "is not available in the build")
1010
+ );
1011
+ let i = t ? o.length > 1 ? `since :
1012
+ ` + o.map(ke).join(`
1013
+ `) : " " + ke(o[0]) : "as no adapter specified";
1014
+ throw new m(
1015
+ "There is no suitable adapter to dispatch the request " + i,
1016
+ "ERR_NOT_SUPPORT"
1017
+ );
1018
+ }
1019
+ return r;
1020
+ },
1021
+ adapters: re
1022
+ };
1023
+ function ee(e) {
1024
+ if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1025
+ throw new B(null, e);
1026
+ }
1027
+ function Oe(e) {
1028
+ return ee(e), e.headers = A.from(e.headers), e.data = Z.call(
1029
+ e,
1030
+ e.transformRequest
1031
+ ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), We.getAdapter(e.adapter || fe.adapter)(e).then(function(r) {
1032
+ return ee(e), r.data = Z.call(
1033
+ e,
1034
+ e.transformResponse,
1035
+ r
1036
+ ), r.headers = A.from(r.headers), r;
1037
+ }, function(r) {
1038
+ return Ke(r) || (ee(e), r && r.response && (r.response.data = Z.call(
1039
+ e,
1040
+ e.transformResponse,
1041
+ r.response
1042
+ ), r.response.headers = A.from(r.response.headers))), Promise.reject(r);
1043
+ });
1044
+ }
1045
+ const Ae = (e) => e instanceof A ? e.toJSON() : e;
1046
+ function C(e, t) {
1047
+ t = t || {};
1048
+ const n = {};
1049
+ function r(d, f, u) {
1050
+ return a.isPlainObject(d) && a.isPlainObject(f) ? a.merge.call({ caseless: u }, d, f) : a.isPlainObject(f) ? a.merge({}, f) : a.isArray(f) ? f.slice() : f;
1051
+ }
1052
+ function s(d, f, u) {
1053
+ if (a.isUndefined(f)) {
1054
+ if (!a.isUndefined(d))
1055
+ return r(void 0, d, u);
1056
+ } else
1057
+ return r(d, f, u);
1058
+ }
1059
+ function o(d, f) {
1060
+ if (!a.isUndefined(f))
1061
+ return r(void 0, f);
1062
+ }
1063
+ function i(d, f) {
1064
+ if (a.isUndefined(f)) {
1065
+ if (!a.isUndefined(d))
1066
+ return r(void 0, d);
1067
+ } else
1068
+ return r(void 0, f);
1069
+ }
1070
+ function c(d, f, u) {
1071
+ if (u in t)
1072
+ return r(d, f);
1073
+ if (u in e)
1074
+ return r(void 0, d);
1075
+ }
1076
+ const l = {
1077
+ url: o,
1078
+ method: o,
1079
+ data: o,
1080
+ baseURL: i,
1081
+ transformRequest: i,
1082
+ transformResponse: i,
1083
+ paramsSerializer: i,
1084
+ timeout: i,
1085
+ timeoutMessage: i,
1086
+ withCredentials: i,
1087
+ withXSRFToken: i,
1088
+ adapter: i,
1089
+ responseType: i,
1090
+ xsrfCookieName: i,
1091
+ xsrfHeaderName: i,
1092
+ onUploadProgress: i,
1093
+ onDownloadProgress: i,
1094
+ decompress: i,
1095
+ maxContentLength: i,
1096
+ maxBodyLength: i,
1097
+ beforeRedirect: i,
1098
+ transport: i,
1099
+ httpAgent: i,
1100
+ httpsAgent: i,
1101
+ cancelToken: i,
1102
+ socketPath: i,
1103
+ responseEncoding: i,
1104
+ validateStatus: c,
1105
+ headers: (d, f) => s(Ae(d), Ae(f), !0)
1106
+ };
1107
+ return a.forEach(Object.keys(Object.assign({}, e, t)), function(f) {
1108
+ const u = l[f] || s, g = u(e[f], t[f], f);
1109
+ a.isUndefined(g) && u !== c || (n[f] = g);
1110
+ }), n;
1111
+ }
1112
+ const Ge = "1.6.7", de = {};
1113
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1114
+ de[e] = function(r) {
1115
+ return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1116
+ };
1117
+ });
1118
+ const _e = {};
1119
+ de.transitional = function(t, n, r) {
1120
+ function s(o, i) {
1121
+ return "[Axios v" + Ge + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
1122
+ }
1123
+ return (o, i, c) => {
1124
+ if (t === !1)
1125
+ throw new m(
1126
+ s(i, " has been removed" + (n ? " in " + n : "")),
1127
+ m.ERR_DEPRECATED
1128
+ );
1129
+ return n && !_e[i] && (_e[i] = !0, console.warn(
1130
+ s(
1131
+ i,
1132
+ " has been deprecated since v" + n + " and will be removed in the near future"
1133
+ )
1134
+ )), t ? t(o, i, c) : !0;
1135
+ };
1136
+ };
1137
+ function mn(e, t, n) {
1138
+ if (typeof e != "object")
1139
+ throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
1140
+ const r = Object.keys(e);
1141
+ let s = r.length;
1142
+ for (; s-- > 0; ) {
1143
+ const o = r[s], i = t[o];
1144
+ if (i) {
1145
+ const c = e[o], l = c === void 0 || i(c, o, e);
1146
+ if (l !== !0)
1147
+ throw new m("option " + o + " must be " + l, m.ERR_BAD_OPTION_VALUE);
1148
+ continue;
1149
+ }
1150
+ if (n !== !0)
1151
+ throw new m("Unknown option " + o, m.ERR_BAD_OPTION);
1152
+ }
1153
+ }
1154
+ const se = {
1155
+ assertOptions: mn,
1156
+ validators: de
1157
+ }, N = se.validators;
1158
+ class M {
1159
+ constructor(t) {
1160
+ this.defaults = t, this.interceptors = {
1161
+ request: new be(),
1162
+ response: new be()
1163
+ };
1164
+ }
1165
+ /**
1166
+ * Dispatch a request
1167
+ *
1168
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1169
+ * @param {?Object} config
1170
+ *
1171
+ * @returns {Promise} The Promise to be fulfilled
1172
+ */
1173
+ async request(t, n) {
1174
+ try {
1175
+ return await this._request(t, n);
1176
+ } catch (r) {
1177
+ if (r instanceof Error) {
1178
+ let s;
1179
+ Error.captureStackTrace ? Error.captureStackTrace(s = {}) : s = new Error();
1180
+ const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1181
+ r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
1182
+ ` + o) : r.stack = o;
1183
+ }
1184
+ throw r;
1185
+ }
1186
+ }
1187
+ _request(t, n) {
1188
+ typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = C(this.defaults, n);
1189
+ const { transitional: r, paramsSerializer: s, headers: o } = n;
1190
+ r !== void 0 && se.assertOptions(r, {
1191
+ silentJSONParsing: N.transitional(N.boolean),
1192
+ forcedJSONParsing: N.transitional(N.boolean),
1193
+ clarifyTimeoutError: N.transitional(N.boolean)
1194
+ }, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
1195
+ serialize: s
1196
+ } : se.assertOptions(s, {
1197
+ encode: N.function,
1198
+ serialize: N.function
1199
+ }, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1200
+ let i = o && a.merge(
1201
+ o.common,
1202
+ o[n.method]
1203
+ );
1204
+ o && a.forEach(
1205
+ ["delete", "get", "head", "post", "put", "patch", "common"],
1206
+ (p) => {
1207
+ delete o[p];
1208
+ }
1209
+ ), n.headers = A.concat(i, o);
1210
+ const c = [];
1211
+ let l = !0;
1212
+ this.interceptors.request.forEach(function(h) {
1213
+ typeof h.runWhen == "function" && h.runWhen(n) === !1 || (l = l && h.synchronous, c.unshift(h.fulfilled, h.rejected));
1214
+ });
1215
+ const d = [];
1216
+ this.interceptors.response.forEach(function(h) {
1217
+ d.push(h.fulfilled, h.rejected);
1218
+ });
1219
+ let f, u = 0, g;
1220
+ if (!l) {
1221
+ const p = [Oe.bind(this), void 0];
1222
+ for (p.unshift.apply(p, c), p.push.apply(p, d), g = p.length, f = Promise.resolve(n); u < g; )
1223
+ f = f.then(p[u++], p[u++]);
1224
+ return f;
1225
+ }
1226
+ g = c.length;
1227
+ let S = n;
1228
+ for (u = 0; u < g; ) {
1229
+ const p = c[u++], h = c[u++];
1230
+ try {
1231
+ S = p(S);
1232
+ } catch (w) {
1233
+ h.call(this, w);
1234
+ break;
1235
+ }
1236
+ }
1237
+ try {
1238
+ f = Oe.call(this, S);
1239
+ } catch (p) {
1240
+ return Promise.reject(p);
1241
+ }
1242
+ for (u = 0, g = d.length; u < g; )
1243
+ f = f.then(d[u++], d[u++]);
1244
+ return f;
1245
+ }
1246
+ getUri(t) {
1247
+ t = C(this.defaults, t);
1248
+ const n = Ve(t.baseURL, t.url);
1249
+ return qe(n, t.params, t.paramsSerializer);
1250
+ }
1251
+ }
1252
+ a.forEach(["delete", "get", "head", "options"], function(t) {
1253
+ M.prototype[t] = function(n, r) {
1254
+ return this.request(C(r || {}, {
1255
+ method: t,
1256
+ url: n,
1257
+ data: (r || {}).data
1258
+ }));
1259
+ };
1260
+ });
1261
+ a.forEach(["post", "put", "patch"], function(t) {
1262
+ function n(r) {
1263
+ return function(o, i, c) {
1264
+ return this.request(C(c || {}, {
1265
+ method: t,
1266
+ headers: r ? {
1267
+ "Content-Type": "multipart/form-data"
1268
+ } : {},
1269
+ url: o,
1270
+ data: i
1271
+ }));
1272
+ };
1273
+ }
1274
+ M.prototype[t] = n(), M.prototype[t + "Form"] = n(!0);
1275
+ });
1276
+ const q = M;
1277
+ class pe {
1278
+ constructor(t) {
1279
+ if (typeof t != "function")
1280
+ throw new TypeError("executor must be a function.");
1281
+ let n;
1282
+ this.promise = new Promise(function(o) {
1283
+ n = o;
1284
+ });
1285
+ const r = this;
1286
+ this.promise.then((s) => {
1287
+ if (!r._listeners)
1288
+ return;
1289
+ let o = r._listeners.length;
1290
+ for (; o-- > 0; )
1291
+ r._listeners[o](s);
1292
+ r._listeners = null;
1293
+ }), this.promise.then = (s) => {
1294
+ let o;
1295
+ const i = new Promise((c) => {
1296
+ r.subscribe(c), o = c;
1297
+ }).then(s);
1298
+ return i.cancel = function() {
1299
+ r.unsubscribe(o);
1300
+ }, i;
1301
+ }, t(function(o, i, c) {
1302
+ r.reason || (r.reason = new B(o, i, c), n(r.reason));
1303
+ });
1304
+ }
1305
+ /**
1306
+ * Throws a `CanceledError` if cancellation has been requested.
1307
+ */
1308
+ throwIfRequested() {
1309
+ if (this.reason)
1310
+ throw this.reason;
1311
+ }
1312
+ /**
1313
+ * Subscribe to the cancel signal
1314
+ */
1315
+ subscribe(t) {
1316
+ if (this.reason) {
1317
+ t(this.reason);
1318
+ return;
1319
+ }
1320
+ this._listeners ? this._listeners.push(t) : this._listeners = [t];
1321
+ }
1322
+ /**
1323
+ * Unsubscribe from the cancel signal
1324
+ */
1325
+ unsubscribe(t) {
1326
+ if (!this._listeners)
1327
+ return;
1328
+ const n = this._listeners.indexOf(t);
1329
+ n !== -1 && this._listeners.splice(n, 1);
1330
+ }
1331
+ /**
1332
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
1333
+ * cancels the `CancelToken`.
1334
+ */
1335
+ static source() {
1336
+ let t;
1337
+ return {
1338
+ token: new pe(function(s) {
1339
+ t = s;
1340
+ }),
1341
+ cancel: t
1342
+ };
1343
+ }
1344
+ }
1345
+ const yn = pe;
1346
+ function gn(e) {
1347
+ return function(n) {
1348
+ return e.apply(null, n);
1349
+ };
1350
+ }
1351
+ function wn(e) {
1352
+ return a.isObject(e) && e.isAxiosError === !0;
1353
+ }
1354
+ const oe = {
1355
+ Continue: 100,
1356
+ SwitchingProtocols: 101,
1357
+ Processing: 102,
1358
+ EarlyHints: 103,
1359
+ Ok: 200,
1360
+ Created: 201,
1361
+ Accepted: 202,
1362
+ NonAuthoritativeInformation: 203,
1363
+ NoContent: 204,
1364
+ ResetContent: 205,
1365
+ PartialContent: 206,
1366
+ MultiStatus: 207,
1367
+ AlreadyReported: 208,
1368
+ ImUsed: 226,
1369
+ MultipleChoices: 300,
1370
+ MovedPermanently: 301,
1371
+ Found: 302,
1372
+ SeeOther: 303,
1373
+ NotModified: 304,
1374
+ UseProxy: 305,
1375
+ Unused: 306,
1376
+ TemporaryRedirect: 307,
1377
+ PermanentRedirect: 308,
1378
+ BadRequest: 400,
1379
+ Unauthorized: 401,
1380
+ PaymentRequired: 402,
1381
+ Forbidden: 403,
1382
+ NotFound: 404,
1383
+ MethodNotAllowed: 405,
1384
+ NotAcceptable: 406,
1385
+ ProxyAuthenticationRequired: 407,
1386
+ RequestTimeout: 408,
1387
+ Conflict: 409,
1388
+ Gone: 410,
1389
+ LengthRequired: 411,
1390
+ PreconditionFailed: 412,
1391
+ PayloadTooLarge: 413,
1392
+ UriTooLong: 414,
1393
+ UnsupportedMediaType: 415,
1394
+ RangeNotSatisfiable: 416,
1395
+ ExpectationFailed: 417,
1396
+ ImATeapot: 418,
1397
+ MisdirectedRequest: 421,
1398
+ UnprocessableEntity: 422,
1399
+ Locked: 423,
1400
+ FailedDependency: 424,
1401
+ TooEarly: 425,
1402
+ UpgradeRequired: 426,
1403
+ PreconditionRequired: 428,
1404
+ TooManyRequests: 429,
1405
+ RequestHeaderFieldsTooLarge: 431,
1406
+ UnavailableForLegalReasons: 451,
1407
+ InternalServerError: 500,
1408
+ NotImplemented: 501,
1409
+ BadGateway: 502,
1410
+ ServiceUnavailable: 503,
1411
+ GatewayTimeout: 504,
1412
+ HttpVersionNotSupported: 505,
1413
+ VariantAlsoNegotiates: 506,
1414
+ InsufficientStorage: 507,
1415
+ LoopDetected: 508,
1416
+ NotExtended: 510,
1417
+ NetworkAuthenticationRequired: 511
1418
+ };
1419
+ Object.entries(oe).forEach(([e, t]) => {
1420
+ oe[t] = e;
1421
+ });
1422
+ const Sn = oe;
1423
+ function Xe(e) {
1424
+ const t = new q(e), n = Pe(q.prototype.request, t);
1425
+ return a.extend(n, q.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
1426
+ return Xe(C(e, s));
1427
+ }, n;
1428
+ }
1429
+ const y = Xe(fe);
1430
+ y.Axios = q;
1431
+ y.CanceledError = B;
1432
+ y.CancelToken = yn;
1433
+ y.isCancel = Ke;
1434
+ y.VERSION = Ge;
1435
+ y.toFormData = G;
1436
+ y.AxiosError = m;
1437
+ y.Cancel = y.CanceledError;
1438
+ y.all = function(t) {
1439
+ return Promise.all(t);
1440
+ };
1441
+ y.spread = gn;
1442
+ y.isAxiosError = wn;
1443
+ y.mergeConfig = C;
1444
+ y.AxiosHeaders = A;
1445
+ y.formToJSON = (e) => ze(a.isHTMLForm(e) ? new FormData(e) : e);
1446
+ y.getAdapter = We.getAdapter;
1447
+ y.HttpStatusCode = Sn;
1448
+ y.default = y;
1449
+ const En = (e) => {
1450
+ var t = encodeURIComponent(e);
1451
+ return t = btoa(t), t;
1452
+ }, j = () => {
1453
+ let t = { ...(window == null ? void 0 : window.config) || {} };
1454
+ t.rootContainer || (t.rootContainer = "#app"), t.baseURL || (t.baseURL = location.origin), t.ossBaseURL || (t.ossBaseURL = "/oss"), t.ossBaseURL.startsWith("/") && (t.ossBaseURL = `${t.baseURL}/oss`), t.ssoBaseURL || (t.ssoBaseURL = t.baseURL);
1455
+ let { microAppName: n, publicPath: r, mainAppName: s } = t;
1456
+ return n && !0 && !r && (r = `/${n}/`.replace(/\/\//g, "/")), r || (r = "/"), t.publicPath = r, t.autoOssBucket || (t.autoOssBucket = s || n), t;
1457
+ }, Qe = (e, t) => {
1458
+ let n = window.location.search || "";
1459
+ if (e && e !== location.href) {
1460
+ const s = e.indexOf("?");
1461
+ s !== -1 ? n = e.slice(s) : n = "";
1462
+ }
1463
+ const r = new URLSearchParams(n);
1464
+ if (t)
1465
+ return r.get(t);
1466
+ {
1467
+ let s = {};
1468
+ for (let [o, i] of r.entries())
1469
+ s[o] = i;
1470
+ return s;
1471
+ }
1472
+ }, bn = (e, t) => {
1473
+ const n = t || location.href, r = Qe(n), s = Object.keys(r) || [];
1474
+ if (!s || !s.length)
1475
+ return n.includes("?") ? n.split("?")[0] : n.split("&")[0];
1476
+ let o = s.filter((c) => !e.includes(c));
1477
+ if (!o || !o.length)
1478
+ return n.includes("?") ? n.split("?")[0] : n.split("&")[0];
1479
+ let i = "";
1480
+ return o.forEach((c, l) => {
1481
+ l === s.length - 1 ? i += `${c}=${r[c]}` : i += `${c}=${r[c]}&`;
1482
+ }), n.includes("?") ? n.split("?")[0] + `?${i}` : n.split("&")[0] + `?${i}`;
1483
+ };
1484
+ /*! js-cookie v3.0.5 | MIT */
1485
+ function v(e) {
1486
+ for (var t = 1; t < arguments.length; t++) {
1487
+ var n = arguments[t];
1488
+ for (var r in n)
1489
+ e[r] = n[r];
1490
+ }
1491
+ return e;
1492
+ }
1493
+ var Rn = {
1494
+ read: function(e) {
1495
+ return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
1496
+ },
1497
+ write: function(e) {
1498
+ return encodeURIComponent(e).replace(
1499
+ /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
1500
+ decodeURIComponent
1501
+ );
1502
+ }
1503
+ };
1504
+ function ie(e, t) {
1505
+ function n(s, o, i) {
1506
+ if (!(typeof document > "u")) {
1507
+ i = v({}, t, i), typeof i.expires == "number" && (i.expires = new Date(Date.now() + i.expires * 864e5)), i.expires && (i.expires = i.expires.toUTCString()), s = encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
1508
+ var c = "";
1509
+ for (var l in i)
1510
+ i[l] && (c += "; " + l, i[l] !== !0 && (c += "=" + i[l].split(";")[0]));
1511
+ return document.cookie = s + "=" + e.write(o, s) + c;
1512
+ }
1513
+ }
1514
+ function r(s) {
1515
+ if (!(typeof document > "u" || arguments.length && !s)) {
1516
+ for (var o = document.cookie ? document.cookie.split("; ") : [], i = {}, c = 0; c < o.length; c++) {
1517
+ var l = o[c].split("="), d = l.slice(1).join("=");
1518
+ try {
1519
+ var f = decodeURIComponent(l[0]);
1520
+ if (i[f] = e.read(d, f), s === f)
1521
+ break;
1522
+ } catch {
1523
+ }
1524
+ }
1525
+ return s ? i[s] : i;
1526
+ }
1527
+ }
1528
+ return Object.create(
1529
+ {
1530
+ set: n,
1531
+ get: r,
1532
+ remove: function(s, o) {
1533
+ n(
1534
+ s,
1535
+ "",
1536
+ v({}, o, {
1537
+ expires: -1
1538
+ })
1539
+ );
1540
+ },
1541
+ withAttributes: function(s) {
1542
+ return ie(this.converter, v({}, this.attributes, s));
1543
+ },
1544
+ withConverter: function(s) {
1545
+ return ie(v({}, this.converter, s), this.attributes);
1546
+ }
1547
+ },
1548
+ {
1549
+ attributes: { value: Object.freeze(t) },
1550
+ converter: { value: Object.freeze(e) }
1551
+ }
1552
+ );
1553
+ }
1554
+ var R = ie(Rn, { path: "/" });
1555
+ const Ye = (e) => {
1556
+ var t, n, r, s;
1557
+ sessionStorage.setItem("hotentToken", e.accessToken || ""), sessionStorage.setItem("currentUser", JSON.stringify({ token: e.accessToken || "" })), e.info && JSON.stringify(e.info) !== "{}" && sessionStorage.setItem("hotentUserInfo", JSON.stringify({ id: ((t = e.info) == null ? void 0 : t.sub) ?? "", name: ((n = e.info) == null ? void 0 : n.name) ?? "", flag: (r = e.info) == null ? void 0 : r.flag, tenantId: ((s = e.info) == null ? void 0 : s.tenant) ?? "" }));
1558
+ }, Tn = () => {
1559
+ const e = new URL(location.href).searchParams, t = e.get("token") || e.get("accessToken") || e.get("accesstoken") || "";
1560
+ if (t) {
1561
+ const n = JSON.stringify({ access_token: t });
1562
+ sessionStorage.setItem("accessToken", t), sessionStorage.setItem("tokenInfo", n), R.set("accessToken", t), R.set("accessTokenInfo", n);
1563
+ }
1564
+ }, kn = () => {
1565
+ const e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}"), t = new URL(location.href).searchParams, n = t.get("project") || t.get("projectId") || "";
1566
+ if (!n)
1567
+ return;
1568
+ const r = t.get("projectParent") || t.get("projectParentId") || (e == null ? void 0 : e.parentId) || "", s = t.get("projectName") || (e == null ? void 0 : e.name) || "";
1569
+ sessionStorage.setItem("project", n), sessionStorage.setItem("projectInfo", JSON.stringify({ ...e, id: n, name: s, parentId: r }));
1570
+ }, On = () => R.get("accessToken") ?? "", An = () => {
1571
+ const e = j(), t = (e == null ? void 0 : e.infoStrict) ?? !0;
1572
+ let n = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
1573
+ return t || e.projectInfo && (n = e.projectInfo), {
1574
+ id: (n == null ? void 0 : n.id) ?? "",
1575
+ parentId: (n == null ? void 0 : n.parentId) ?? "",
1576
+ name: (n == null ? void 0 : n.name) ?? "",
1577
+ tenantId: (n == null ? void 0 : n.tenant) ?? ""
1578
+ };
1579
+ };
1580
+ On() || Tn();
1581
+ kn();
1582
+ const _n = {
1583
+ personalInfo: "/api/personal-center/personal-server/v1/info"
1584
+ }, he = async (e) => {
1585
+ var n;
1586
+ const t = await y.create().get(_n.personalInfo, {
1587
+ baseURL: j().baseURL,
1588
+ params: {
1589
+ project: ((n = An()) == null ? void 0 : n.id) || "",
1590
+ timestamp: (/* @__PURE__ */ new Date()).getTime()
1591
+ },
1592
+ headers: {
1593
+ Authorization: `Bearer ${e}`
1594
+ }
1595
+ });
1596
+ t != null && t.data && sessionStorage.setItem("userInfo", JSON.stringify(t.data));
1597
+ }, z = "accessToken", D = "accessTokenInfo", xe = () => {
1598
+ var n, r, s, o, i, c, l;
1599
+ const e = R.get(z) ?? "";
1600
+ let t = "";
1601
+ if ((n = T().getData()) != null && n.info && JSON.stringify((r = T().getData()) == null ? void 0 : r.info) !== "{}" && (t = ((o = (s = T().getData()) == null ? void 0 : s.info) == null ? void 0 : o.access_token) ?? ((c = (i = T().getData()) == null ? void 0 : i.info) == null ? void 0 : c.accessToken) ?? ""), e && !t) {
1602
+ const d = xn();
1603
+ if (d && JSON.stringify(d) !== "{}") {
1604
+ const { access_token: f, refresh_token: u, expires_in: g } = d, S = {
1605
+ accessToken: f,
1606
+ accessTokenExpiredAt: +/* @__PURE__ */ new Date() + g * 1e3,
1607
+ refreshToken: u,
1608
+ info: d
1609
+ };
1610
+ T().save(S), he(f), Ye(S);
1611
+ }
1612
+ }
1613
+ return R.get(z) ?? ((l = T().getData()) == null ? void 0 : l.accessToken) ?? "";
1614
+ }, xn = () => R.get(D) ? JSON.parse(R.get(D)) : {}, Ze = (e, t) => {
1615
+ R.set(z, e), t && R.set(D, JSON.stringify(t));
1616
+ }, Nn = () => {
1617
+ R.remove(z), R.get(D) && R.remove(D);
1618
+ }, Ne = (e) => new URL(location.href).searchParams.get(e), me = {
12
1619
  oauth: "/api/justauth/oauth-server/v1/visitor/oauth/authorize",
13
1620
  // 重定向到登录页
14
1621
  token: "/api/justauth/oauth-server/v1/visitor/oauth/token"
15
1622
  // 通过code获取token
16
- };
17
- const refreshing = ref(false);
18
- const { baseURL, mainAppName, microAppName } = getConfig();
19
- const real_uri = mainAppName || window.__IN_MICRO_APP__ ? `${location.origin}/` : location.origin + location.pathname;
20
- const getTokenParams = {
1623
+ }, P = tt(!1), { baseURL: Pn, mainAppName: Cn, microAppName: In } = j(), ae = Cn || window.__IN_MICRO_APP__ ? `${location.origin}/` : location.origin + location.pathname, $ = {
21
1624
  response_type: "code",
22
1625
  scope: "sever",
23
1626
  client_id: "sys",
24
- client_secret: encryption("das123"),
1627
+ client_secret: En("das123"),
25
1628
  state: +/* @__PURE__ */ new Date()
26
- };
27
- const getTokenFromCode = async (code, data, redirectUri, keepLogin) => {
28
- const kingdee_token = getUrlParams(location.href, "kingdee_token") || "";
29
- let tokenRes = {};
30
- const tokenParams = {
1629
+ }, Un = async (e, t, n, r) => {
1630
+ const s = Qe(location.href, "kingdee_token") || "";
1631
+ let o = {};
1632
+ const i = {
31
1633
  grant_type: "authorization_code",
32
- code,
33
- client_id: data.client_id,
34
- client_secret: data.client_secret,
35
- redirect_uri: redirectUri || real_uri
1634
+ code: e,
1635
+ client_id: t.client_id,
1636
+ client_secret: t.client_secret,
1637
+ redirect_uri: n || ae
36
1638
  };
37
1639
  try {
38
- if (keepLogin) {
39
- tokenParams.keep_login = true;
40
- tokenParams.redirect_uri = `${tokenParams.redirect_uri}?keep_login=true`;
41
- }
42
- if (kingdee_token) {
43
- sessionStorage.setItem("kingdee_token", kingdee_token);
44
- tokenParams.redirect_uri = `${tokenParams.redirect_uri}?kingdee_token=${kingdee_token}`;
45
- }
46
- tokenRes = await axios.create().post(
47
- apis.token,
1640
+ r && (i.keep_login = !0, i.redirect_uri = `${i.redirect_uri}?keep_login=true`), s && (sessionStorage.setItem("kingdee_token", s), i.redirect_uri = `${i.redirect_uri}?kingdee_token=${s}`), o = await y.create().post(
1641
+ me.token,
48
1642
  {},
49
1643
  {
50
- baseURL,
51
- params: tokenParams,
1644
+ baseURL: Pn,
1645
+ params: i,
52
1646
  headers: {
53
1647
  "Content-Type": "application/x-www-form-urlencoded"
54
1648
  }
55
1649
  }
56
1650
  );
57
- const { access_token, refresh_token, expires_in } = tokenRes.data;
58
- const tokenData = {
59
- accessToken: access_token,
60
- accessTokenExpiredAt: +/* @__PURE__ */ new Date() + expires_in * 1e3,
61
- refreshToken: refresh_token,
62
- info: tokenRes.data
1651
+ const { access_token: c, refresh_token: l, expires_in: d } = o.data, f = {
1652
+ accessToken: c,
1653
+ accessTokenExpiredAt: +/* @__PURE__ */ new Date() + d * 1e3,
1654
+ refreshToken: l,
1655
+ info: o.data
63
1656
  };
64
- setAccessToken(access_token, tokenRes.data);
65
- tokenStorage().save(tokenData);
66
- setPersonalInfo(access_token);
67
- let filterParams = ["code", "state", "keep_login", "kingdee_token"];
68
- window.history.replaceState(null, "", funcUrlDel(filterParams));
69
- return access_token;
1657
+ Ze(c, o.data), T().save(f), he(c);
1658
+ let u = ["code", "state", "keep_login", "kingdee_token"];
1659
+ return window.history.replaceState(null, "", bn(u)), c;
70
1660
  } catch {
71
- return login({ ...getTokenParams, redirect_uri: redirectUri || real_uri });
1661
+ return ye({ ...$, redirect_uri: n || ae });
72
1662
  }
73
- };
74
- const getToken = async (config) => {
75
- if (config.public)
1663
+ }, Fn = async (e) => {
1664
+ if (e.public)
76
1665
  return;
77
- if (refreshing.value) {
78
- return await new Promise(async (res) => {
79
- watch(
80
- () => refreshing.value,
81
- (value) => {
82
- if (!value) {
83
- const token = getAccessToken();
84
- res(token);
1666
+ if (P.value)
1667
+ return await new Promise(async (l) => {
1668
+ nt(
1669
+ () => P.value,
1670
+ (d) => {
1671
+ if (!d) {
1672
+ const f = xe();
1673
+ l(f);
85
1674
  }
86
1675
  }
87
1676
  );
88
1677
  });
89
- }
90
- const accessToken = getAccessToken();
91
- const { accessTokenExpiredAt, redirectUri } = tokenStorage().getData();
92
- const oauthCode = getQuery("code") || "";
93
- const keepLogin = !!getQuery("keep_login");
94
- refreshing.value = true;
95
- const whiteList = JSON.parse(sessionStorage.getItem("noLogin-page")) || [];
96
- if ((!accessToken || accessTokenExpiredAt === 0) && microAppName !== "oauth" && !whiteList.includes(location.pathname)) {
97
- const needLogin = !oauthCode;
98
- if (needLogin) {
99
- return login({ ...getTokenParams, redirect_uri: real_uri });
100
- }
101
- }
102
- const tokenExpired = accessTokenExpiredAt > 0 && +/* @__PURE__ */ new Date() + 60 * 1e3 > accessTokenExpiredAt;
103
- if (tokenExpired)
104
- return refreshToken(getTokenParams);
105
- if (accessToken)
106
- return accessToken;
107
- if (!oauthCode) {
108
- refreshing.value = false;
1678
+ const t = xe(), { accessTokenExpiredAt: n, redirectUri: r } = T().getData(), s = Ne("code") || "", o = !!Ne("keep_login");
1679
+ P.value = !0;
1680
+ const i = JSON.parse(sessionStorage.getItem("noLogin-page")) || [];
1681
+ if ((!t || n === 0) && In !== "oauth" && !i.includes(location.pathname) && !s)
1682
+ return ye({ ...$, redirect_uri: ae });
1683
+ if (n > 0 && +/* @__PURE__ */ new Date() + 60 * 1e3 > n)
1684
+ return Ln($);
1685
+ if (t)
1686
+ return t;
1687
+ if (!s) {
1688
+ P.value = !1;
109
1689
  return;
110
1690
  }
111
1691
  try {
112
- const accessToken2 = await getTokenFromCode(oauthCode, getTokenParams, redirectUri, keepLogin);
113
- refreshing.value = false;
114
- return accessToken2;
1692
+ const l = await Un(s, $, r, o);
1693
+ return P.value = !1, l;
115
1694
  } catch {
116
- refreshing.value = false;
117
- }
118
- };
119
- const login = (params) => {
120
- const { baseURL: baseURL2, ssoLocale } = getConfig();
121
- params.logout = "true";
122
- if (ssoLocale)
123
- params.locale = "locale";
124
- const query = Object.keys(params).filter((key) => key !== "client_secret").map((key) => `${key}=${params[key]}`).join("&");
125
- const ssoUrl = `${baseURL2}${apis.oauth}?${query}`;
126
- removeAccessToken();
127
- sessionStorage.clear();
128
- tokenStorage().save({ redirectUri: params.redirect_uri });
129
- window.__isAutoCloseApp = false;
130
- location.replace(ssoUrl);
131
- };
132
- const refreshToken = async (params) => {
133
- const { baseURL: baseURL2 } = getConfig();
134
- const { refreshToken: refreshToken2, redirectUri } = tokenStorage().getData();
135
- params.redirect_uri = redirectUri;
1695
+ P.value = !1;
1696
+ }
1697
+ }, ye = (e) => {
1698
+ const { baseURL: t, ssoLocale: n } = j();
1699
+ e.logout = "true", n && (e.locale = "locale");
1700
+ const r = Object.keys(e).filter((o) => o !== "client_secret").map((o) => `${o}=${e[o]}`).join("&"), s = `${t}${me.oauth}?${r}`;
1701
+ Nn(), sessionStorage.clear(), T().save({ redirectUri: e.redirect_uri }), window.__isAutoCloseApp = !1, location.replace(s);
1702
+ }, Ln = async (e) => {
1703
+ const { baseURL: t } = j(), { refreshToken: n, redirectUri: r } = T().getData();
1704
+ e.redirect_uri = r;
136
1705
  try {
137
- const tokenRes = await axios.create().post(apis.token, {
138
- baseURL: baseURL2,
1706
+ const s = await y.create().post(me.token, {
1707
+ baseURL: t,
139
1708
  params: {
140
- refresh_token: refreshToken2,
1709
+ refresh_token: n,
141
1710
  grant_type: "refresh_token",
142
- client_id: params.client_id,
143
- client_secret: params.client_secret,
144
- redirect_uri: redirectUri
1711
+ client_id: e.client_id,
1712
+ client_secret: e.client_secret,
1713
+ redirect_uri: r
145
1714
  }
146
- });
147
- const { access_token, refresh_token, expires_in } = tokenRes.data;
148
- const tokenData = {
149
- accessToken: access_token,
150
- accessTokenExpiredAt: +/* @__PURE__ */ new Date() + expires_in * 1e3,
151
- refreshToken: refresh_token,
152
- info: tokenRes.data
1715
+ }), { access_token: o, refresh_token: i, expires_in: c } = s.data, l = {
1716
+ accessToken: o,
1717
+ accessTokenExpiredAt: +/* @__PURE__ */ new Date() + c * 1e3,
1718
+ refreshToken: i,
1719
+ info: s.data
153
1720
  };
154
- setAccessToken(access_token, tokenRes.data);
155
- tokenStorage().save(tokenData);
156
- setPersonalInfo(access_token);
157
- return access_token;
1721
+ return Ze(o, s.data), T().save(l), he(o), o;
158
1722
  } catch {
159
- return login(params);
1723
+ return ye(e);
160
1724
  }
161
- };
162
- const tokenStorage = () => {
163
- const accessTokenKey = "accessToken";
164
- const accessTokenExpiredAtKey = "accessTokenExpiredAt";
165
- const refreshTokenKey = "refreshToken";
166
- const tokenInfoKey = "tokenInfo";
167
- const redirectUriKey = "redirectUri";
1725
+ }, T = () => {
1726
+ const e = "accessToken", t = "accessTokenExpiredAt", n = "refreshToken", r = "tokenInfo", s = "redirectUri";
168
1727
  return {
169
- getData: () => {
170
- return {
171
- accessToken: sessionStorage.getItem(accessTokenKey) || "",
172
- accessTokenExpiredAt: Number(sessionStorage.getItem(accessTokenExpiredAtKey) || "0"),
173
- refreshToken: sessionStorage.getItem(refreshTokenKey) || "",
174
- info: JSON.parse(
175
- sessionStorage.getItem(tokenInfoKey) === "undefined" ? "{}" : sessionStorage.getItem(tokenInfoKey) || "{}"
176
- ),
177
- redirectUri: sessionStorage.getItem(redirectUriKey) || ""
178
- };
179
- },
180
- save: (data) => {
181
- const accessTokenExpiredAt = data.accessTokenExpiredAt || 0;
182
- sessionStorage.setItem(accessTokenKey, data.accessToken || "");
183
- sessionStorage.setItem(accessTokenExpiredAtKey, accessTokenExpiredAt.toString());
184
- sessionStorage.setItem(refreshTokenKey, data.refreshToken || "");
185
- sessionStorage.setItem(tokenInfoKey, JSON.stringify(data.info || {}));
186
- if (data.redirectUri)
187
- sessionStorage.setItem(redirectUriKey, data.redirectUri || "");
188
- setProcessEngineToken(data);
1728
+ getData: () => ({
1729
+ accessToken: sessionStorage.getItem(e) || "",
1730
+ accessTokenExpiredAt: Number(sessionStorage.getItem(t) || "0"),
1731
+ refreshToken: sessionStorage.getItem(n) || "",
1732
+ info: JSON.parse(
1733
+ sessionStorage.getItem(r) === "undefined" ? "{}" : sessionStorage.getItem(r) || "{}"
1734
+ ),
1735
+ redirectUri: sessionStorage.getItem(s) || ""
1736
+ }),
1737
+ save: (o) => {
1738
+ const i = o.accessTokenExpiredAt || 0;
1739
+ sessionStorage.setItem(e, o.accessToken || ""), sessionStorage.setItem(t, i.toString()), sessionStorage.setItem(n, o.refreshToken || ""), sessionStorage.setItem(r, JSON.stringify(o.info || {})), o.redirectUri && sessionStorage.setItem(s, o.redirectUri || ""), Ye(o);
189
1740
  },
190
1741
  remove: () => {
191
- sessionStorage.removeItem(accessTokenKey);
192
- sessionStorage.removeItem(accessTokenExpiredAtKey);
193
- sessionStorage.removeItem(refreshTokenKey);
194
- sessionStorage.removeItem(tokenInfoKey);
195
- sessionStorage.removeItem(redirectUriKey);
1742
+ sessionStorage.removeItem(e), sessionStorage.removeItem(t), sessionStorage.removeItem(n), sessionStorage.removeItem(r), sessionStorage.removeItem(s);
196
1743
  }
197
1744
  };
198
1745
  };
199
-
200
- export { getQuery, getToken, getTokenFromCode, getTokenParams, login, real_uri, tokenStorage };
1746
+ export {
1747
+ Ne as getQuery,
1748
+ Fn as getToken,
1749
+ Un as getTokenFromCode,
1750
+ $ as getTokenParams,
1751
+ ye as login,
1752
+ ae as real_uri,
1753
+ T as tokenStorage
1754
+ };