ss-component-new 1.1.63 → 1.1.65

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.
@@ -1,3347 +0,0 @@
1
- import { ref as U, onMounted as Ln, watch as de, createElementBlock as re, openBlock as X, createBlock as Be, createVNode as Y, createSlots as qn, withCtx as ce, Fragment as Ze, renderList as Qe, createElementVNode as M, normalizeStyle as Jn, toDisplayString as Z, createCommentVNode as Yt, resolveComponent as We, createTextVNode as Ue, unref as en, resolveDynamicComponent as Et } from "vue";
2
- import { g as Mn, c as zn, d as tn, s as Ee, E as Hn, u as In } from "./menu-D6yKPqgS.js";
3
- import { u as Ye } from "./modelComp-Cr1QF6ip.js";
4
- import { c as v, _ as Re } from "./_plugin-vue_export-helper-B7R8Jogt.js";
5
- import { s as Te, a as Vn, b as et, f as Wn, E as Fe } from "./index-BtYQ1bjb.js";
6
- import { _ as Kn } from "./index.vue_vue_type_script_setup_true_lang-DQ2k4Z7D.js";
7
- const Lt = (e, t) => {
8
- const n = e.storage || sessionStorage, r = e.key || t.$id;
9
- if (e.paths) {
10
- const o = e.paths.reduce((s, a) => (s[a] = t.$state[a], s), {});
11
- n.setItem(r, JSON.stringify(o));
12
- } else
13
- n.setItem(r, JSON.stringify(t.$state));
14
- };
15
- var Gn = ({ options: e, store: t }) => {
16
- var n, r, o, s;
17
- if ((n = e.persist) != null && n.enabled) {
18
- const a = [{
19
- key: t.$id,
20
- storage: sessionStorage
21
- }], l = (o = (r = e.persist) == null ? void 0 : r.strategies) != null && o.length ? (s = e.persist) == null ? void 0 : s.strategies : a;
22
- l.forEach((d) => {
23
- const i = d.storage || sessionStorage, y = d.key || t.$id, c = i.getItem(y);
24
- c && (t.$patch(JSON.parse(c)), Lt(d, t));
25
- }), t.$subscribe(() => {
26
- l.forEach((d) => {
27
- Lt(d, t);
28
- });
29
- });
30
- }
31
- };
32
- const he = Mn() || zn();
33
- he.use(Gn);
34
- const nn = tn("formToTableComp", {
35
- state: () => ({
36
- selectArray: [],
37
- selectString: ""
38
- }),
39
- actions: {
40
- setSelectArray(e) {
41
- this.selectArray = e;
42
- },
43
- setSelectString(e) {
44
- this.selectString = e;
45
- }
46
- }
47
- }), Xn = tn("unit", {
48
- state: () => ({
49
- selectIndex: "",
50
- selectMenu: "",
51
- selectTitle: []
52
- }),
53
- actions: {
54
- setSelectIndex(e) {
55
- this.selectIndex = e;
56
- },
57
- setSelectMenu(e) {
58
- this.selectMenu = e;
59
- },
60
- setSelectTitle(e) {
61
- this.selectTitle = e;
62
- }
63
- }
64
- }), Zn = (e, t) => {
65
- const n = t == null ? void 0 : t.split("-");
66
- return rn(e, n);
67
- }, rn = (e, t) => {
68
- var o;
69
- let n = e, r = t;
70
- return Array.isArray(n) ? n = n == null ? void 0 : n[parseInt(v(r == null ? void 0 : r[0]))] : Array.isArray(n == null ? void 0 : n.children) && (n = (o = n == null ? void 0 : n.children) == null ? void 0 : o[parseInt(v(r == null ? void 0 : r[0]))]), r == null || r.shift(), (r == null ? void 0 : r.length) > 0 && (n = rn(n, r)), n;
71
- }, on = (e, t) => {
72
- let n = e, r = t == null ? void 0 : t.filter((o) => (o == null ? void 0 : o.prop) !== "index");
73
- return Array.isArray(n) && (n = n == null ? void 0 : n.map((o, s) => {
74
- if (Array.isArray(o)) {
75
- let a = {};
76
- return o = o == null ? void 0 : o.forEach((l, d) => {
77
- var i;
78
- (i = r == null ? void 0 : r[d]) != null && i.prop ? a[r[d].prop] = l : Array.isArray(l) && (a.children = on(l, r));
79
- }), Object.assign(a, { id: s });
80
- } else
81
- return o;
82
- })), n;
83
- }, Qn = (e, t, n) => {
84
- if (t === "")
85
- return e == null ? void 0 : e.filter((r) => (r == null ? void 0 : r.id) === n);
86
- {
87
- const r = t.split("-");
88
- return Yn(e, r, n);
89
- }
90
- }, Yn = (e, t, n) => {
91
- let r = e, o = t;
92
- return (o == null ? void 0 : o.length) === 0 ? r = r == null ? void 0 : r.filter((s) => s.id !== n) : r = r == null ? void 0 : r.map((s) => (s.id.toString() === (o == null ? void 0 : o[0]) && (o == null || o.shift(), s = sn(s, o, n)), s)), r;
93
- }, sn = (e, t, n) => {
94
- var s, a;
95
- let r = e, o = t;
96
- return (o == null ? void 0 : o.length) === 0 ? r.children = (s = r.children) == null ? void 0 : s.filter((l) => l.id !== n) : r.children = (a = r.children) == null ? void 0 : a.map((l) => (l.id.toString() === (o == null ? void 0 : o[0]) && (o == null || o.shift(), l = sn(l, o, n)), l)), r;
97
- }, er = (e, t, n) => {
98
- if (t === "")
99
- return n;
100
- {
101
- const r = t.split("-");
102
- return tr(e, r, n);
103
- }
104
- }, tr = (e, t, n) => {
105
- let r = e, o = t;
106
- return (o == null ? void 0 : o.length) === 0 ? r = n : r = r == null ? void 0 : r.map((s) => (s.id.toString() === (o == null ? void 0 : o[0]) && (o == null || o.shift(), s = an(s, o, n)), s)), r;
107
- }, an = (e, t, n) => {
108
- var s;
109
- let r = e, o = t;
110
- return (o == null ? void 0 : o.length) === 0 ? r.children = n : r.children = (s = r.children) == null ? void 0 : s.map((a) => (a.id.toString() === (o == null ? void 0 : o[0]) && (o == null || o.shift(), a = an(a, o, n)), a)), r;
111
- }, nr = { class: "table-content" }, rr = ["onClick"], or = {
112
- key: 0,
113
- class: "dialog-footer"
114
- }, sr = {
115
- __name: "index",
116
- props: {
117
- itemData: {
118
- type: Array,
119
- default: () => []
120
- },
121
- childItemData: {
122
- type: Array,
123
- default: () => []
124
- },
125
- index: Number
126
- },
127
- emits: ["change", "contentChange"],
128
- setup(e, { emit: t }) {
129
- const n = e, r = t, o = U([]), s = U([]), a = U(""), l = U(), d = U(!0), i = U(0), y = U(!1), c = U(""), T = U(!1), w = U([]), g = U(!1), C = U([]), p = U([]), h = U(), u = U(), R = nn(he), b = U(), m = Xn(he), { selectIndex: E, selectMenu: S, selectTitle: D } = Ee(m), { selectString: N } = Ee(R), O = U(720), K = () => {
130
- T.value = !1;
131
- }, F = (A) => {
132
- var j, $, x, L, W;
133
- if (J(A), A != null && A.children && Array.isArray(A == null ? void 0 : A.children)) {
134
- const q = D.value;
135
- q.push({ key: S.value === "" ? (j = A == null ? void 0 : A.id) == null ? void 0 : j.toString() : S.value + "-" + (($ = A == null ? void 0 : A.id) == null ? void 0 : $.toString()), value: A[(x = Object.keys(A)) == null ? void 0 : x.filter((V) => V !== "index" && V !== "id")[0]] }), m.setSelectMenu(S.value === "" ? (L = A == null ? void 0 : A.id) == null ? void 0 : L.toString() : S.value + "-" + ((W = A == null ? void 0 : A.id) == null ? void 0 : W.toString())), m.setSelectTitle(q), m.setSelectIndex(n != null && n.index ? n == null ? void 0 : n.index.toString() : "");
136
- }
137
- }, J = (A) => {
138
- var j, $, x;
139
- if (A != null && A.children && Array.isArray(A == null ? void 0 : A.children)) {
140
- let L = [];
141
- const W = (j = v(h.value)) == null ? void 0 : j.filter((q) => (q == null ? void 0 : q.prop) !== "index");
142
- ($ = A == null ? void 0 : A.children) == null || $.forEach((q, V) => {
143
- if (!Array.isArray(q))
144
- L.push(q);
145
- else {
146
- let ae = {};
147
- q == null || q.forEach((le, _e) => {
148
- var xe;
149
- (xe = W == null ? void 0 : W[_e]) != null && xe.prop ? ae[W[_e].prop] = le : Array.isArray(le) && (ae.children = le);
150
- }), L.push(Object.assign(ae, { id: V }));
151
- }
152
- }), o.value = (x = v(o.value)) == null ? void 0 : x.filter((q) => (q == null ? void 0 : q.prop) !== "index"), s.value = L;
153
- }
154
- }, z = (A, j) => {
155
- var $;
156
- if (a.value = "", g.value = !0, d.value = !0, A === "删除") {
157
- s.value = ($ = v(s.value)) == null ? void 0 : $.filter((L) => (L == null ? void 0 : L.id) !== (j == null ? void 0 : j.id));
158
- const x = Qn(b.value, S.value, j == null ? void 0 : j.id);
159
- k(x), r("change", {
160
- content: x,
161
- index: n == null ? void 0 : n.index,
162
- buttonName: A
163
- });
164
- } else A === "新增" ? (c.value = "新增", H(""), T.value = !0) : A === "编辑" ? (c.value = "编辑", H(j), T.value = !0) : A === "详情" && (c.value = "详情", H(j), g.value = !1, d.value = !1, T.value = !0);
165
- }, H = (A) => {
166
- var $;
167
- const j = [];
168
- ($ = v(o.value)) == null || $.forEach((x, L) => {
169
- x.label !== "" && (x == null ? void 0 : x.label) !== "操作" && j.push({
170
- label: (x == null ? void 0 : x.label) ?? "",
171
- name: (x == null ? void 0 : x.prop) ?? "t" + L,
172
- type: !(x != null && x.type) || (x == null ? void 0 : x.type) === "" ? "Input" : x == null ? void 0 : x.type,
173
- value: (A == null ? void 0 : A[x == null ? void 0 : x.prop]) ?? "",
174
- id: (x == null ? void 0 : x.id) ?? L,
175
- contents: (x == null ? void 0 : x.options) ?? [],
176
- width: 1
177
- });
178
- }), A === "" || !A || (a.value = A == null ? void 0 : A.id), p.value = j;
179
- };
180
- Ln(() => {
181
- });
182
- const I = () => {
183
- let A = v(s.value);
184
- a.value === "" ? (i.value++, A.push(Object.assign(u.value, { id: i.value }))) : A = A == null ? void 0 : A.map(($) => (($ == null ? void 0 : $.id) === a.value && ($ = Object.assign($, u.value)), $)), s.value = A;
185
- const j = er(b.value, S.value, A);
186
- k(j), T.value = !1, r("change", {
187
- content: j,
188
- index: n == null ? void 0 : n.index,
189
- buttonName: c.value
190
- });
191
- }, k = (A) => {
192
- var $;
193
- const j = ($ = v(n.itemData)) == null ? void 0 : $.map((x) => ((x == null ? void 0 : x.key) === "tableContents" && (x.contents = A), x));
194
- r("contentChange", {
195
- contents: j,
196
- index: n.index
197
- });
198
- }, Q = (A) => {
199
- u.value = A;
200
- };
201
- return de(
202
- () => [n.itemData, N.value, E.value, S.value],
203
- () => {
204
- var ae, le, _e, xe, Ot, Tt, At, Ct, _t, xt, Dt, Ft, Nt, Pt, Ut, Bt, jt, $t;
205
- const A = (ae = v(n.itemData)) == null ? void 0 : ae.filter((P) => (P == null ? void 0 : P.key) === "header"), j = (le = v(n.itemData)) == null ? void 0 : le.find((P) => (P == null ? void 0 : P.key) === "page"), $ = (_e = v(n.itemData)) == null ? void 0 : _e.find((P) => (P == null ? void 0 : P.key) === "rowButton"), x = (xe = v(n.itemData)) == null ? void 0 : xe.find((P) => (P == null ? void 0 : P.key) === "extraButton"), L = (Ot = v(n.itemData)) == null ? void 0 : Ot.filter((P) => (P == null ? void 0 : P.key) === "tableContents"), W = (Tt = v(n.itemData)) == null ? void 0 : Tt.filter((P) => (P == null ? void 0 : P.key) === "tableIndex");
206
- y.value = (j == null ? void 0 : j.contents) ?? !0;
207
- let q = [];
208
- N.value === "" ? q = A == null ? void 0 : A[0] : q = (A == null ? void 0 : A.find((P) => (P == null ? void 0 : P.selectLabel) === "(" + N.value + ")")) ?? (A == null ? void 0 : A.find((P) => !(P != null && P.selectLabel)));
209
- let V = [];
210
- if (N.value === "" ? V = W == null ? void 0 : W[0] : V = (W == null ? void 0 : W.find((P) => (P == null ? void 0 : P.selectLabel) === "(" + N.value + ")")) ?? (W == null ? void 0 : W.find((P) => !(P != null && P.selectLabel))), ((At = q == null ? void 0 : q.contents) == null ? void 0 : At.length) > 0) {
211
- const P = [];
212
- V != null && V.contents && ((Ct = V == null ? void 0 : V.contents) == null ? void 0 : Ct.length) !== 0 && P.push({
213
- label: "",
214
- prop: "index",
215
- sortable: !1
216
- }), (_t = q == null ? void 0 : q.contents) == null || _t.forEach((_, fe) => {
217
- (_ == null ? void 0 : _.label) !== "" && P.push({
218
- label: (_ == null ? void 0 : _.label) ?? "",
219
- prop: (_ == null ? void 0 : _.label) === "操作" ? "operate" : (_ == null ? void 0 : _.prop) ?? "a" + fe,
220
- width: _ != null && _.width ? parseInt(_.width) : "",
221
- fixed: (_ == null ? void 0 : _.fixed) ?? void 0,
222
- sortable: (_ == null ? void 0 : _.sortable) ?? !1,
223
- align: (_ == null ? void 0 : _.align) ?? "center",
224
- showOverflowTooltip: (_ == null ? void 0 : _.showOverflowTooltip) ?? !0,
225
- isNotDrag: (_ == null ? void 0 : _.isNotDrag) ?? !1,
226
- isEditCol: (_ == null ? void 0 : _.isEditCol) ?? !1,
227
- isOperate: (_ == null ? void 0 : _.isOperate) ?? !1,
228
- id: (_ == null ? void 0 : _.id) ?? fe,
229
- type: (_ == null ? void 0 : _.label) === "操作" ? "operate" : void 0
230
- });
231
- }), o.value = P;
232
- let ye = (Dt = (xt = v(o.value)) == null ? void 0 : xt.filter((_) => (_ == null ? void 0 : _.type) !== "operate")) == null ? void 0 : Dt.map((_, fe) => ({
233
- prop: (_ == null ? void 0 : _.prop) ?? "a" + fe
234
- }));
235
- h.value = ye;
236
- let me = [];
237
- if (N.value === "" ? me = L == null ? void 0 : L[0] : me = (L == null ? void 0 : L.find((_) => (_ == null ? void 0 : _.selectLabel) === "(" + N.value + ")")) ?? (L == null ? void 0 : L.find((_) => !(_ != null && _.selectLabel))), ((Ft = me == null ? void 0 : me.contents) == null ? void 0 : Ft.length) !== 0) {
238
- let _ = v(me == null ? void 0 : me.contents);
239
- V != null && V.contents && ((Nt = V == null ? void 0 : V.contents) == null ? void 0 : Nt.length) !== 0 && (_ = (Pt = v(_)) == null ? void 0 : Pt.map((ie, it) => {
240
- var we, Oe;
241
- if (!Array.isArray(ie)) {
242
- let De = {};
243
- for (let be in ie)
244
- be !== "id" && be !== "index" && (De[be] = ie[be]);
245
- ie = Object.values(De);
246
- }
247
- return ie.unshift(((Oe = (we = V == null ? void 0 : V.contents) == null ? void 0 : we[it]) == null ? void 0 : Oe.label) ?? ""), ie;
248
- }));
249
- const fe = [];
250
- _ == null || _.forEach((ie, it) => {
251
- let we = {};
252
- ie == null || ie.forEach((Oe, De) => {
253
- var be;
254
- (be = ye == null ? void 0 : ye[De]) != null && be.prop ? we[ye[De].prop] = Oe : Array.isArray(Oe) && (we.children = on(Oe, ye));
255
- }), fe.push(Object.assign(we, { id: it }));
256
- }), s.value = fe;
257
- } else {
258
- let _ = (Ut = v(ye)) == null ? void 0 : Ut.reduce((fe, ie) => (fe[ie.prop] = "测试数据", fe), {});
259
- l.value = _, s.value = [Object.assign({}, l.value, { id: i.value })];
260
- }
261
- } else
262
- o.value = [], s.value = [];
263
- if (((Bt = $ == null ? void 0 : $.contents) == null ? void 0 : Bt.length) > 0 ? w.value = $ == null ? void 0 : $.contents : w.value = [], ((jt = x == null ? void 0 : x.contents) == null ? void 0 : jt.length) > 0 ? C.value = x == null ? void 0 : x.contents : C.value = [], i.value = (($t = s == null ? void 0 : s.value) == null ? void 0 : $t.length) ?? 0, E.value !== "") {
264
- const P = Zn(v(s.value), S.value);
265
- b.value = s.value, J(P);
266
- }
267
- },
268
- { deep: !0, immediate: !0 }
269
- ), (A, j) => {
270
- var $;
271
- return X(), re("div", nr, [
272
- (X(), Be(Te, {
273
- columns: o.value,
274
- key: o.value,
275
- tableData: s.value,
276
- isShowPagination: y.value,
277
- isShowEdit: !1,
278
- isShowDelete: !1,
279
- onDbClickRow: F,
280
- extraButton: C.value,
281
- onButtonClick: j[0] || (j[0] = (x) => z(x, ""))
282
- }, qn({ _: 2 }, [
283
- (($ = w.value) == null ? void 0 : $.length) > 0 ? {
284
- name: "actions",
285
- fn: ce(({ item: x }) => [
286
- (X(!0), re(Ze, null, Qe(w.value, (L, W) => (X(), re("div", { key: W }, [
287
- M("div", {
288
- style: Jn({ color: L == null ? void 0 : L.textColor }),
289
- class: "extra-button-label",
290
- onClick: (q) => z(L == null ? void 0 : L.label, x)
291
- }, Z(L == null ? void 0 : L.label), 13, rr)
292
- ]))), 128))
293
- ]),
294
- key: "0"
295
- } : void 0
296
- ]), 1032, ["columns", "tableData", "isShowPagination", "extraButton"])),
297
- Y(Vn, {
298
- title: c.value,
299
- visible: T.value,
300
- width: O.value,
301
- onBeforeDestroy: K
302
- }, {
303
- default: ce(() => [
304
- Y(et, {
305
- rowContents: p.value,
306
- isEnableWrap: !1,
307
- onChange: Q,
308
- isEdit: d.value
309
- }, null, 8, ["rowContents", "isEdit"])
310
- ]),
311
- footer: ce(() => [
312
- g.value ? (X(), re("div", or, [
313
- M("div", {
314
- onClick: j[1] || (j[1] = (x) => T.value = !1),
315
- class: "cancel-button"
316
- }, Z("取消")),
317
- M("div", {
318
- class: "ok-button",
319
- onClick: I
320
- }, Z("确认"))
321
- ])) : Yt("", !0)
322
- ]),
323
- _: 1
324
- }, 8, ["title", "visible", "width"])
325
- ]);
326
- };
327
- }
328
- }, ar = /* @__PURE__ */ Re(sr, [["__scopeId", "data-v-781eace3"]]), qe = [
329
- {
330
- key: "单选",
331
- value: "Select"
332
- },
333
- {
334
- key: "日期",
335
- value: "Date"
336
- },
337
- {
338
- key: "长文本",
339
- value: "TextArea"
340
- },
341
- {
342
- key: "上传",
343
- value: "Upload"
344
- }
345
- ], lr = { class: "form-content" }, ir = {
346
- __name: "index",
347
- props: {
348
- itemData: {
349
- type: Array,
350
- default: () => []
351
- },
352
- childItemData: {
353
- type: Array,
354
- default: () => []
355
- },
356
- index: Number
357
- },
358
- emits: ["change", "contentChange"],
359
- setup(e, { emit: t }) {
360
- const n = e, r = t, o = U([]), s = U(!1), a = U([]), l = nn(he), d = U(), i = (c) => {
361
- var p, h, u, R;
362
- const T = (h = (p = v(n.itemData)) == null ? void 0 : p.find((b) => (b == null ? void 0 : b.key) === "formContent")) == null ? void 0 : h.contents, w = v(c.content);
363
- let g = {};
364
- w && ((u = Object.values(w)) == null ? void 0 : u.length) > 0 && ((R = Object.values(w)) == null || R.forEach((b, m) => {
365
- g[T[m].key] = b;
366
- }));
367
- const C = {
368
- content: g,
369
- index: n == null ? void 0 : n.index,
370
- buttonName: c == null ? void 0 : c.buttonName
371
- };
372
- r("change", C);
373
- }, y = (c) => {
374
- var g, C;
375
- if (!c) return;
376
- if (((g = Object.values(v(c))) == null ? void 0 : g.length) > 0) {
377
- const p = (C = Object.values(v(c))) == null ? void 0 : C.map((u) => u);
378
- let h = "";
379
- p == null || p.forEach((u) => {
380
- u !== "" && u !== void 0 && (h = h === "" ? u : h + "/" + u);
381
- }), l.setSelectArray(p), l.setSelectString(h);
382
- }
383
- const T = v(n.itemData), w = T == null ? void 0 : T.map((p) => {
384
- var h;
385
- return (p == null ? void 0 : p.key) === "formContent" && ((h = p.contents) == null || h.map((u, R) => {
386
- var b, m, E, S, D, N, O, K, F, J, z, H, I, k;
387
- return u.type = u != null && u.type ? u.type : (E = (m = (b = u == null ? void 0 : u.key.split("$")) == null ? void 0 : b[1]) == null ? void 0 : m.split("(")) != null && E[0] ? (S = qe == null ? void 0 : qe.find((Q) => {
388
- var A, j, $;
389
- return (Q == null ? void 0 : Q.key) === (($ = (j = (A = u == null ? void 0 : u.key.split("$")) == null ? void 0 : A[1]) == null ? void 0 : j.split("(")) == null ? void 0 : $[0]);
390
- })) == null ? void 0 : S.value : "Input", u.options = u != null && u.options ? u.options : ((N = (D = u == null ? void 0 : u.key.split("$")) == null ? void 0 : D[1]) == null ? void 0 : N.length) > 0 ? (F = (K = Wn((O = u == null ? void 0 : u.key.split("$")) == null ? void 0 : O[1])) == null ? void 0 : K.split(",")) == null ? void 0 : F.map((Q) => ({
391
- label: Q,
392
- value: Q
393
- })) : [], u != null && u.key.includes("$") && (u.key = (J = u == null ? void 0 : u.key.split("$")) == null ? void 0 : J[0]), u.value = u != null && u.value ? u.value : Array.isArray((z = Object.values(c)) == null ? void 0 : z[R]) ? (I = (H = Object.values(c)) == null ? void 0 : H[R]) == null ? void 0 : I[0] : (k = Object.values(c)) == null ? void 0 : k[R], u;
394
- })), p;
395
- });
396
- r("contentChange", {
397
- contents: w,
398
- index: n.index
399
- });
400
- };
401
- return de(
402
- () => n.itemData,
403
- () => {
404
- var C, p, h, u, R, b, m, E, S, D;
405
- const c = (C = v(n.itemData)) == null ? void 0 : C.find((N) => (N == null ? void 0 : N.key) === "formContent"), T = (p = v(n.itemData)) == null ? void 0 : p.find((N) => (N == null ? void 0 : N.key) === "formButton"), w = (h = v(n.itemData)) == null ? void 0 : h.find((N) => (N == null ? void 0 : N.key) === "formFlex"), g = (u = v(n.itemData)) == null ? void 0 : u.find((N) => (N == null ? void 0 : N.key) === "formWrap");
406
- if ((g == null ? void 0 : g.contents) === "纵向" ? s.value = !1 : s.value = !0, d.value = typeof (w == null ? void 0 : w.contents) != "boolean" ? !(!(w != null && w.contents) === "" || ((R = w == null ? void 0 : w.contents) == null ? void 0 : R.toUpperCase()) === "VERTICAL") : w == null ? void 0 : w.contents, ((b = c == null ? void 0 : c.contents) == null ? void 0 : b.length) > 0 && Array.isArray(c == null ? void 0 : c.contents)) {
407
- const N = [];
408
- (m = c == null ? void 0 : c.contents) == null || m.forEach((F, J) => {
409
- var z, H, I, k, Q, A, j, $, x;
410
- if ((F == null ? void 0 : F.label) !== "") {
411
- let L = (F == null ? void 0 : F.key) ?? "", W = (F == null ? void 0 : F.type) ?? "", q = (F == null ? void 0 : F.options) ?? [];
412
- if (F != null && F.key.includes("$") && (L = (z = v(F == null ? void 0 : F.key).split("$")) == null ? void 0 : z[0], ((I = (H = v(F == null ? void 0 : F.key).split("$")) == null ? void 0 : H[1]) == null ? void 0 : I.length) > 0)) {
413
- const [V, ae] = (Q = (k = v(F == null ? void 0 : F.key).split("$")) == null ? void 0 : k[1]) == null ? void 0 : Q.split(/[()]/);
414
- W = ((A = qe.find((le) => (le == null ? void 0 : le.key) === V)) == null ? void 0 : A.value) ?? "", ((j = ae == null ? void 0 : ae.split(",")) == null ? void 0 : j.length) > 0 && (q = ($ = ae == null ? void 0 : ae.split(",")) == null ? void 0 : $.map((le) => ({
415
- label: le,
416
- value: le
417
- })));
418
- }
419
- N.push({
420
- label: L ?? "",
421
- name: "t" + J,
422
- type: W === "" ? "Input" : W,
423
- value: F != null && F.value ? F.value : (q == null ? void 0 : q.length) > 0 ? (x = q == null ? void 0 : q[0]) == null ? void 0 : x.value : (F == null ? void 0 : F.value) ?? "",
424
- id: (F == null ? void 0 : F.id) ?? J,
425
- contents: q ?? [],
426
- width: (F == null ? void 0 : F.width) ?? 1
427
- });
428
- }
429
- });
430
- const O = (E = v(N)) == null ? void 0 : E.map((F) => F.value);
431
- let K = "";
432
- O == null || O.forEach((F) => {
433
- F !== "" && F !== void 0 && (K = K === "" ? F : K + "/" + F);
434
- }), l.setSelectArray(O), l.setSelectString(K), o.value = N;
435
- } else
436
- o.value = [];
437
- if (((S = T == null ? void 0 : T.contents) == null ? void 0 : S.length) > 0) {
438
- const N = [];
439
- (D = T == null ? void 0 : T.contents) == null || D.forEach((O, K) => {
440
- (O == null ? void 0 : O.label) !== "" && N.push({
441
- label: (O == null ? void 0 : O.label) ?? "",
442
- id: (O == null ? void 0 : O.id) ?? K,
443
- type: (O == null ? void 0 : O.type) ?? "",
444
- background: O == null ? void 0 : O.background
445
- });
446
- }), a.value = N;
447
- } else
448
- a.value = [];
449
- },
450
- { deep: !0, immediate: !0 }
451
- ), (c, T) => (X(), re("div", lr, [
452
- Y(et, {
453
- rowContents: o.value,
454
- buttonValue: a.value,
455
- isRowFlex: d.value,
456
- isEnableWrap: !1,
457
- onOnButtonClick: i,
458
- onChange: y,
459
- isButtonRow: s.value
460
- }, null, 8, ["rowContents", "buttonValue", "isRowFlex", "isButtonRow"])
461
- ]));
462
- }
463
- }, cr = /* @__PURE__ */ Re(ir, [["__scopeId", "data-v-156885e4"]]), ur = { class: "table-operate-content" }, fr = { class: "table-operate-item" }, pr = { class: "operate-title" }, dr = { class: "operate-content" }, hr = { class: "operate-title" }, mr = { class: "operate-content" }, yr = { class: "operate-title" }, br = { class: "operate-content" }, gr = { class: "operate-content" }, vr = {
464
- __name: "operate",
465
- props: {
466
- itemContents: {
467
- type: Array,
468
- default: () => []
469
- },
470
- originalItemContents: {
471
- type: Array,
472
- default: () => []
473
- }
474
- },
475
- emits: ["change"],
476
- setup(e, { emit: t }) {
477
- const n = e, r = t, o = U([]), s = U([]), a = U([]), l = U([{
478
- label: "按钮名称",
479
- prop: "label",
480
- type: "edit"
481
- }, {
482
- label: "按钮类型",
483
- prop: "type",
484
- type: "edit"
485
- }, {
486
- label: "按钮背景颜色",
487
- prop: "background",
488
- type: "edit",
489
- columnType: "Color"
490
- }, {
491
- label: "操作",
492
- prop: "operate",
493
- type: "operate",
494
- sortable: !1
495
- }]), d = U([{
496
- label: "标签名称",
497
- prop: "label",
498
- type: "edit"
499
- }, {
500
- label: "标签类型",
501
- prop: "type",
502
- type: "edit"
503
- }, {
504
- label: "按钮文字颜色",
505
- prop: "textColor",
506
- type: "edit",
507
- columnType: "Color"
508
- }, {
509
- label: "操作",
510
- prop: "operate",
511
- type: "operate",
512
- sortable: !1
513
- }]), i = U([]), y = U(0), c = U([{
514
- name: "isPagination",
515
- label: "是否显示分页",
516
- type: "Switch",
517
- value: !0
518
- }]), T = [{
519
- label: "标签名",
520
- prop: "label",
521
- type: "edit"
522
- }, {
523
- label: "属性名",
524
- prop: "prop",
525
- type: "edit"
526
- }, {
527
- label: "宽度",
528
- prop: "width",
529
- type: "edit",
530
- columnType: "Number"
531
- }, {
532
- label: "是否固定列",
533
- prop: "fixed",
534
- type: "edit",
535
- columnType: "Radio",
536
- contents: [{
537
- label: "left",
538
- value: "左"
539
- }, {
540
- label: "right",
541
- value: "右"
542
- }]
543
- }, {
544
- label: "是否支持排序",
545
- prop: "sortable",
546
- type: "edit",
547
- columnType: "Switch"
548
- }, {
549
- label: "文本所在位置",
550
- prop: "align",
551
- type: "edit",
552
- columnType: "Radio",
553
- contents: [{
554
- label: "left",
555
- value: "左"
556
- }, {
557
- label: "center",
558
- value: "中"
559
- }, {
560
- label: "right",
561
- value: "右"
562
- }]
563
- }, {
564
- label: "溢出悬浮文字",
565
- prop: "showOverflowTooltip",
566
- type: "edit",
567
- columnType: "Switch"
568
- }, {
569
- label: "是否不可拖动",
570
- prop: "isNotDrag",
571
- type: "edit",
572
- columnType: "Switch"
573
- }, {
574
- label: "是否可编辑列名",
575
- //暂不支持
576
- prop: "isEditCol",
577
- type: "edit",
578
- columnType: "Switch"
579
- }, {
580
- label: "是否出现在附属界面",
581
- //暂不支持
582
- prop: "isOperate",
583
- type: "edit",
584
- columnType: "Switch"
585
- }, {
586
- label: "操作",
587
- prop: "operate",
588
- type: "operate",
589
- sortable: !1
590
- }], w = (b) => {
591
- let m = v(o.value);
592
- const E = m == null ? void 0 : m.find((S) => S.key === "page");
593
- (E == null ? void 0 : E.contents) !== void 0 ? m = m == null ? void 0 : m.map((S) => ((S == null ? void 0 : S.key) === "page" && (S.contents = b == null ? void 0 : b.isPagination), S)) : m.push({
594
- key: "page",
595
- contents: b == null ? void 0 : b.isPagination
596
- }), o.value = m;
597
- };
598
- de(
599
- () => n.originalItemContents,
600
- () => {
601
- var b, m, E, S, D, N, O, K, F, J, z, H, I;
602
- !n.originalItemContents || n.originalItemContents.length === 0 || (o.value = v(n.originalItemContents), s.value = (m = (b = o.value) == null ? void 0 : b.find((k) => (k == null ? void 0 : k.key) === "header")) == null ? void 0 : m.contents, a.value = (S = (E = o.value) == null ? void 0 : E.find((k) => (k == null ? void 0 : k.key) === "rowButton")) == null ? void 0 : S.contents, l.value = (N = (D = o.value) == null ? void 0 : D.find((k) => (k == null ? void 0 : k.key) === "extraButton")) == null ? void 0 : N.contents, c.value = (K = (O = o.value) == null ? void 0 : O.find((k) => (k == null ? void 0 : k.key) === "page")) != null && K.contents ? [{
603
- name: "isPagination",
604
- label: "是否显示分页",
605
- type: "Switch",
606
- value: (J = (F = o.value) == null ? void 0 : F.find((k) => (k == null ? void 0 : k.key) === "page")) == null ? void 0 : J.contents
607
- }] : [{
608
- name: "isPagination",
609
- label: "是否显示分页",
610
- type: "Switch",
611
- value: !0
612
- }], s.value = (z = s.value) == null ? void 0 : z.map((k, Q) => k = {
613
- label: (k == null ? void 0 : k.label) ?? "",
614
- prop: (k == null ? void 0 : k.label) === "操作" ? "operate" : k == null ? void 0 : k.prop,
615
- width: k != null && k.width ? parseInt(k.width) : "",
616
- fixed: (k == null ? void 0 : k.fixed) ?? void 0,
617
- sortable: (k == null ? void 0 : k.sortable) ?? !1,
618
- align: (k == null ? void 0 : k.align) ?? "center",
619
- showOverflowTooltip: (k == null ? void 0 : k.showOverflowTooltip) ?? !0,
620
- isNotDrag: (k == null ? void 0 : k.isNotDrag) ?? !1,
621
- isEditCol: (k == null ? void 0 : k.isEditCol) ?? !1,
622
- isOperate: (k == null ? void 0 : k.isOperate) ?? !1,
623
- id: (k == null ? void 0 : k.id) ?? Q
624
- }), a.value = (H = a.value) == null ? void 0 : H.map((k, Q) => k = {
625
- label: (k == null ? void 0 : k.label) ?? "",
626
- type: (k == null ? void 0 : k.type) ?? "",
627
- textColor: (k == null ? void 0 : k.textColor) ?? "#000000",
628
- id: (k == null ? void 0 : k.id) ?? Q
629
- }), l.value = (I = l.value) == null ? void 0 : I.map((k, Q) => k = {
630
- label: (k == null ? void 0 : k.label) ?? "",
631
- type: (k == null ? void 0 : k.type) ?? "",
632
- background: (k == null ? void 0 : k.textColor) ?? "#FFFFFF",
633
- id: (k == null ? void 0 : k.id) ?? Q
634
- }));
635
- },
636
- { deep: !0, immediate: !0 }
637
- ), de(
638
- () => c.value,
639
- () => {
640
- var E;
641
- let b = v(o.value);
642
- const m = b == null ? void 0 : b.find((S) => S.key === "page");
643
- m != null && m.contents ? b = b == null ? void 0 : b.map((S) => {
644
- var D;
645
- return (S == null ? void 0 : S.key) === "page" && (S.contents = (D = c.value) == null ? void 0 : D[0].value), S;
646
- }) : b.push({
647
- key: "page",
648
- contents: (E = c.value) == null ? void 0 : E[0].value
649
- }), o.value = b;
650
- },
651
- { immediate: !0, deep: !0 }
652
- );
653
- const g = () => {
654
- const b = v(s.value);
655
- let m = v(o.value);
656
- b.push({
657
- label: "",
658
- prop: "",
659
- width: "",
660
- fixed: void 0,
661
- sortable: !1,
662
- align: "center",
663
- showOverflowTooltip: !0,
664
- isNotDrag: !1,
665
- isEditCol: !1,
666
- isOperate: !1,
667
- id: y.value
668
- }), s.value = b, y.value++;
669
- const E = m == null ? void 0 : m.find((S) => (S == null ? void 0 : S.key) === "header");
670
- E != null && E.contents ? (E.contents = b, m = m == null ? void 0 : m.map((S) => ((S == null ? void 0 : S.key) === "header" && (S.contents = b), S))) : m.push({
671
- key: "header",
672
- contents: b
673
- }), o.value = m;
674
- }, C = () => {
675
- const b = v(a.value);
676
- let m = v(o.value);
677
- b.push({
678
- label: "",
679
- type: "",
680
- textColor: "#000000",
681
- id: y.value
682
- }), a.value = b, y.value++;
683
- const E = m == null ? void 0 : m.find((S) => (S == null ? void 0 : S.key) === "rowButton");
684
- E != null && E.contents ? (E.contents = b, m = m == null ? void 0 : m.map((S) => ((S == null ? void 0 : S.key) === "rowButton" && (S.contents = b), S))) : m.push({
685
- key: "rowButton",
686
- contents: b
687
- }), o.value = m;
688
- }, p = () => {
689
- const b = v(i.value);
690
- let m = v(o.value);
691
- b.push({
692
- label: "",
693
- type: "",
694
- background: "#FFFFFF",
695
- id: y.value
696
- }), i.value = b, y.value++;
697
- const E = m == null ? void 0 : m.find((S) => (S == null ? void 0 : S.key) === "extraButton");
698
- E != null && E.contents ? (E.contents = b, m = m == null ? void 0 : m.map((S) => ((S == null ? void 0 : S.key) === "extraButton" && (S.contents = b), S))) : m.push({
699
- key: "extraButton",
700
- contents: b
701
- }), o.value = m;
702
- }, h = (b) => {
703
- const m = v(a.value);
704
- let E = v(o.value);
705
- a.value = m.filter((D) => D.id !== b.id);
706
- const S = E == null ? void 0 : E.find((D) => D.key === "rowButton");
707
- S != null && S.contents && (E = E == null ? void 0 : E.map((D) => ((D == null ? void 0 : D.key) === "rowButton" && (D.contents = m.filter((N) => N.id !== b.id)), D))), o.value = E;
708
- }, u = (b) => {
709
- const m = v(i.value);
710
- let E = v(o.value);
711
- i.value = m.filter((D) => D.id !== b.id);
712
- const S = E == null ? void 0 : E.find((D) => D.key === "extraButton");
713
- S != null && S.contents && (E = E == null ? void 0 : E.map((D) => ((D == null ? void 0 : D.key) === "extraButton" && (D.contents = m.filter((N) => N.id !== b.id)), D))), o.value = E;
714
- }, R = (b) => {
715
- const m = v(s.value);
716
- let E = v(o.value);
717
- s.value = m.filter((D) => D.id !== b.id);
718
- const S = E == null ? void 0 : E.find((D) => D.key === "header");
719
- S != null && S.contents && (E = E == null ? void 0 : E.map((D) => ((D == null ? void 0 : D.key) === "header" && (D.contents = m.filter((N) => N.id !== b.id)), D))), o.value = E;
720
- };
721
- return de(
722
- () => [o.value, s.value],
723
- () => {
724
- let b = v(o.value);
725
- const m = b == null ? void 0 : b.find((E) => (E == null ? void 0 : E.key) === "header");
726
- m != null && m.contents ? (m.contents = s.value, b = b == null ? void 0 : b.map((E) => ((E == null ? void 0 : E.key) === "header" && (E.contents = s.value), E))) : b.push({
727
- key: "header",
728
- contents: s.value
729
- }), r("change", b);
730
- },
731
- { deep: !0, immediate: !0 }
732
- ), (b, m) => {
733
- const E = We("el-button");
734
- return X(), re("div", ur, [
735
- M("div", fr, [
736
- M("div", pr, [
737
- m[1] || (m[1] = M("div", null, Z("表头"), -1)),
738
- Y(E, {
739
- class: "blue-operate-button",
740
- icon: "ele-Plus",
741
- onClick: g
742
- }, {
743
- default: ce(() => m[0] || (m[0] = [
744
- Ue(Z("新建"))
745
- ])),
746
- _: 1
747
- })
748
- ]),
749
- M("div", dr, [
750
- Y(Te, {
751
- columns: T,
752
- isShowPagination: !1,
753
- isShowEdit: !1,
754
- isMoveColumn: !1,
755
- tableData: s.value,
756
- onDeleteRow: R
757
- }, null, 8, ["tableData"])
758
- ]),
759
- M("div", hr, [
760
- m[3] || (m[3] = M("div", null, Z("行内按钮"), -1)),
761
- Y(E, {
762
- class: "blue-operate-button",
763
- icon: "ele-Plus",
764
- onClick: C
765
- }, {
766
- default: ce(() => m[2] || (m[2] = [
767
- Ue(Z("新建"))
768
- ])),
769
- _: 1
770
- })
771
- ]),
772
- M("div", mr, [
773
- Y(Te, {
774
- columns: d.value,
775
- isShowPagination: !1,
776
- isShowEdit: !1,
777
- isMoveColumn: !1,
778
- tableData: a.value,
779
- onDeleteRow: h
780
- }, null, 8, ["columns", "tableData"])
781
- ]),
782
- M("div", yr, [
783
- m[5] || (m[5] = M("div", null, Z("表格外部按钮"), -1)),
784
- Y(E, {
785
- class: "blue-operate-button",
786
- icon: "ele-Plus",
787
- onClick: p
788
- }, {
789
- default: ce(() => m[4] || (m[4] = [
790
- Ue(Z("新建"))
791
- ])),
792
- _: 1
793
- })
794
- ]),
795
- M("div", br, [
796
- Y(Te, {
797
- columns: l.value,
798
- isShowPagination: !1,
799
- isShowEdit: !1,
800
- isMoveColumn: !1,
801
- tableData: i.value,
802
- onDeleteRow: u
803
- }, null, 8, ["columns", "tableData"])
804
- ]),
805
- m[6] || (m[6] = M("div", { class: "operate-title" }, [
806
- M("div", null, Z("分页"))
807
- ], -1)),
808
- M("div", gr, [
809
- Y(et, {
810
- rowContents: c.value,
811
- onChange: w
812
- }, null, 8, ["rowContents"])
813
- ])
814
- ])
815
- ]);
816
- };
817
- }
818
- }, kr = /* @__PURE__ */ Re(vr, [["__scopeId", "data-v-877911eb"]]), Er = { class: "form-operate-content" }, Sr = { class: "form-operate-item" }, Rr = { class: "operate-title" }, wr = { class: "operate-content" }, Or = { class: "operate-title" }, Tr = { class: "operate-content" }, Ar = { class: "operate-content" }, Cr = {
819
- __name: "operate",
820
- props: {
821
- itemContents: {
822
- type: Array,
823
- default: () => []
824
- },
825
- originalItemContents: {
826
- type: Array,
827
- default: () => []
828
- }
829
- },
830
- emits: ["change"],
831
- setup(e, { emit: t }) {
832
- const n = e, r = t, o = U([{
833
- name: "isRowFlex",
834
- label: "是否横向布局",
835
- type: "Switch",
836
- value: !0
837
- }]), s = U([{
838
- label: "字段名称",
839
- prop: "label",
840
- type: "edit"
841
- }, {
842
- label: "字段类型",
843
- prop: "type",
844
- type: "edit"
845
- }, {
846
- label: "字段值",
847
- prop: "key",
848
- type: "edit"
849
- }, {
850
- label: "字段选项值",
851
- prop: "options",
852
- type: "edit"
853
- }, {
854
- label: "操作",
855
- prop: "operate",
856
- type: "operate",
857
- sortable: !1
858
- }]), a = U([{
859
- label: "字段名称",
860
- prop: "label",
861
- type: "edit"
862
- }, {
863
- label: "字段类型",
864
- prop: "type",
865
- type: "edit"
866
- }, {
867
- label: "按钮背景颜色",
868
- prop: "background",
869
- type: "edit",
870
- columnType: "Color"
871
- }, {
872
- label: "操作",
873
- prop: "operate",
874
- type: "operate",
875
- sortable: !1
876
- }]), l = U([]), d = U([]), i = U([]), y = U(0);
877
- de(
878
- () => n.originalItemContents,
879
- () => {
880
- var p, h, u, R, b, m, E, S, D, N;
881
- !n.originalItemContents || n.originalItemContents.length === 0 || (d.value = v(n.originalItemContents), i.value = (h = (p = d.value) == null ? void 0 : p.find((O) => (O == null ? void 0 : O.key) === "formContent")) == null ? void 0 : h.contents, l.value = (R = (u = d.value) == null ? void 0 : u.find((O) => (O == null ? void 0 : O.key) === "formButton")) == null ? void 0 : R.contents, i.value = (b = i.value) == null ? void 0 : b.map((O, K) => O = {
882
- label: (O == null ? void 0 : O.label) ?? "",
883
- type: (O == null ? void 0 : O.type) ?? "",
884
- key: (O == null ? void 0 : O.key) ?? "",
885
- options: (O == null ? void 0 : O.options) ?? "",
886
- id: (O == null ? void 0 : O.id) ?? K
887
- }), l.value = (m = l.value) == null ? void 0 : m.map((O, K) => O = {
888
- label: (O == null ? void 0 : O.label) ?? "",
889
- type: (O == null ? void 0 : O.type) ?? "",
890
- background: (O == null ? void 0 : O.background) ?? "#000000",
891
- id: (O == null ? void 0 : O.id) ?? K
892
- }), o.value = (S = (E = d.value) == null ? void 0 : E.find((O) => (O == null ? void 0 : O.key) === "formFlex")) != null && S.contents ? [{
893
- name: "isRowFlex",
894
- label: "是否横向布局",
895
- type: "Switch",
896
- value: (N = (D = d.value) == null ? void 0 : D.find((O) => (O == null ? void 0 : O.key) === "formFlex")) == null ? void 0 : N.contents
897
- }] : [{
898
- name: "isRowFlex",
899
- label: "是否横向布局",
900
- type: "Switch",
901
- value: !0
902
- }]);
903
- },
904
- { deep: !0, immediate: !0 }
905
- );
906
- const c = () => {
907
- const p = v(l.value);
908
- let h = v(d.value);
909
- p.push({
910
- label: "",
911
- type: "",
912
- background: "#000000",
913
- id: y.value
914
- }), l.value = p, y.value++;
915
- const u = h == null ? void 0 : h.find((R) => (R == null ? void 0 : R.key) === "formButton");
916
- u != null && u.contents ? (u.contents = p, h = h == null ? void 0 : h.map((R) => ((R == null ? void 0 : R.key) === "formButton" && (R.contents = p), R))) : h.push({
917
- key: "formButton",
918
- contents: p
919
- }), d.value = h;
920
- }, T = () => {
921
- const p = v(i.value);
922
- let h = v(d.value);
923
- p.push({
924
- label: "",
925
- type: "",
926
- key: "",
927
- options: "",
928
- id: y.value
929
- }), i.value = p, y.value++;
930
- const u = h == null ? void 0 : h.find((R) => (R == null ? void 0 : R.key) === "formContent");
931
- u != null && u.contents ? (u.contents = p, h = h == null ? void 0 : h.map((R) => ((R == null ? void 0 : R.key) === "formContent" && (R.contents = p), R))) : h.push({
932
- key: "formContent",
933
- contents: p
934
- }), d.value = h;
935
- }, w = (p) => {
936
- const h = v(l.value);
937
- let u = v(d.value);
938
- l.value = h.filter((b) => b.id !== p.id);
939
- const R = u == null ? void 0 : u.find((b) => b.key === "formButton");
940
- R != null && R.contents && (u = u == null ? void 0 : u.map((b) => ((b == null ? void 0 : b.key) === "formButton" && (b.contents = h.filter((m) => m.id !== p.id)), b))), d.value = u;
941
- }, g = (p) => {
942
- const h = v(i.value);
943
- let u = v(d.value);
944
- i.value = h.filter((b) => b.id !== p.id);
945
- const R = u == null ? void 0 : u.find((b) => b.key === "formContent");
946
- R != null && R.contents && (u = u == null ? void 0 : u.map((b) => ((b == null ? void 0 : b.key) === "formContent" && (b.contents = h.filter((m) => m.id !== p.id)), b))), d.value = u;
947
- }, C = (p) => {
948
- let h = v(d.value);
949
- const u = h == null ? void 0 : h.find((R) => R.key === "formFlex");
950
- (u == null ? void 0 : u.contents) !== void 0 ? h = h == null ? void 0 : h.map((R) => ((R == null ? void 0 : R.key) === "formFlex" && (R.contents = p == null ? void 0 : p.isRowFlex), R)) : h.push({
951
- key: "formFlex",
952
- contents: p == null ? void 0 : p.isRowFlex
953
- }), d.value = h;
954
- };
955
- return de(
956
- () => [d.value, i.value],
957
- () => {
958
- let p = v(d.value);
959
- const h = p == null ? void 0 : p.find((u) => (u == null ? void 0 : u.key) === "formContent");
960
- h != null && h.contents ? (h.contents = i.value, p = p == null ? void 0 : p.map((u) => ((u == null ? void 0 : u.key) === "formContent" && (u.contents = i.value), u))) : p.push({
961
- key: "formContent",
962
- contents: i.value
963
- }), r("change", p);
964
- },
965
- { deep: !0, immediate: !0 }
966
- ), (p, h) => {
967
- const u = We("el-button");
968
- return X(), re("div", Er, [
969
- M("div", Sr, [
970
- M("div", Rr, [
971
- h[1] || (h[1] = M("div", null, Z("表单信息"), -1)),
972
- Y(u, {
973
- class: "blue-operate-button",
974
- icon: "ele-Plus",
975
- onClick: T
976
- }, {
977
- default: ce(() => h[0] || (h[0] = [
978
- Ue(Z("新建"))
979
- ])),
980
- _: 1
981
- })
982
- ]),
983
- M("div", wr, [
984
- Y(Te, {
985
- columns: s.value,
986
- isShowPagination: !1,
987
- isShowEdit: !1,
988
- isMoveColumn: !1,
989
- tableData: i.value,
990
- onDeleteRow: g
991
- }, null, 8, ["columns", "tableData"])
992
- ]),
993
- M("div", Or, [
994
- h[3] || (h[3] = M("div", null, Z("表单按钮"), -1)),
995
- Y(u, {
996
- class: "blue-operate-button",
997
- icon: "ele-Plus",
998
- onClick: c
999
- }, {
1000
- default: ce(() => h[2] || (h[2] = [
1001
- Ue(Z("新建"))
1002
- ])),
1003
- _: 1
1004
- })
1005
- ]),
1006
- M("div", Tr, [
1007
- Y(Te, {
1008
- columns: a.value,
1009
- isShowPagination: !1,
1010
- isShowEdit: !1,
1011
- isMoveColumn: !1,
1012
- tableData: l.value,
1013
- onDeleteRow: w
1014
- }, null, 8, ["columns", "tableData"])
1015
- ]),
1016
- h[4] || (h[4] = M("div", { class: "operate-title" }, [
1017
- M("div", null, Z("表单布局"))
1018
- ], -1)),
1019
- M("div", Ar, [
1020
- Y(et, {
1021
- rowContents: o.value,
1022
- onChange: C
1023
- }, null, 8, ["rowContents"])
1024
- ])
1025
- ])
1026
- ]);
1027
- };
1028
- }
1029
- }, _r = /* @__PURE__ */ Re(Cr, [["__scopeId", "data-v-a36b8468"]]), xr = U([
1030
- {
1031
- name: "表格",
1032
- type: "table",
1033
- comp: "Table",
1034
- icon: "Grid"
1035
- },
1036
- {
1037
- name: "表单",
1038
- type: "form",
1039
- comp: "Form",
1040
- icon: "Film"
1041
- },
1042
- {
1043
- name: "折叠",
1044
- type: "fold",
1045
- comp: "Fold",
1046
- icon: "Fold"
1047
- }
1048
- ]), Dr = {
1049
- Table: ar,
1050
- Form: cr,
1051
- TableOperate: kr,
1052
- FormOperate: _r,
1053
- Fold: Kn
1054
- // 添加其他组件...
1055
- };
1056
- function ln(e) {
1057
- return Dr[e] || null;
1058
- }
1059
- const Fr = { class: "type-select" }, Nr = ["onClick"], Pr = { class: "list-icon" }, Ur = {
1060
- __name: "index",
1061
- setup(e) {
1062
- const t = Ye(he), { itemData: n } = Ee(t), r = (s) => Hn[s], o = (s) => {
1063
- const a = v(n.value);
1064
- a.push({
1065
- comp: s.comp,
1066
- name: s.name,
1067
- compData: []
1068
- }), t.setItemData(a);
1069
- };
1070
- return (s, a) => (X(), re("div", Fr, [
1071
- (X(!0), re(Ze, null, Qe(en(xr), (l, d) => (X(), re("div", {
1072
- class: "type-list",
1073
- key: d
1074
- }, [
1075
- M("div", {
1076
- class: "list-content",
1077
- onClick: (i) => o(l)
1078
- }, [
1079
- M("div", Pr, [
1080
- (X(), Be(Et(r(l.icon))))
1081
- ]),
1082
- M("div", null, Z(l.name), 1)
1083
- ], 8, Nr)
1084
- ]))), 128))
1085
- ]));
1086
- }
1087
- }, $s = /* @__PURE__ */ Re(Ur, [["__scopeId", "data-v-fe4aecc8"]]), Br = { class: "fill-content" }, jr = { class: "operate-content" }, $r = { class: "collapse-title" }, Lr = { class: "comp-child" }, qr = {
1088
- __name: "index",
1089
- setup(e) {
1090
- const t = Ye(he), { itemData: n, originalData: r } = Ee(t), o = U([]), s = U([]);
1091
- de(
1092
- () => n.value,
1093
- () => {
1094
- var d;
1095
- !n.value || ((d = n.value) == null ? void 0 : d.length) === 0 || (o.value = v(n.value));
1096
- },
1097
- { deep: !0, immediate: !0 }
1098
- );
1099
- const a = (d) => ln(d), l = (d, i, y) => {
1100
- if (!d || d.length === 0) return;
1101
- let c = v(n.value);
1102
- const T = v(i);
1103
- T.compData = d, c = c == null ? void 0 : c.map((w, g) => (g === y && (w = T), w)), t.setItemData(c);
1104
- };
1105
- return (d, i) => {
1106
- const y = We("el-collapse-item"), c = We("el-collapse");
1107
- return X(), re("div", Br, [
1108
- i[1] || (i[1] = M("div", { class: "fill-operate" }, Z("操作栏"), -1)),
1109
- M("div", jr, [
1110
- Y(c, {
1111
- modelValue: s.value,
1112
- "onUpdate:modelValue": i[0] || (i[0] = (T) => s.value = T),
1113
- class: "collapse-content"
1114
- }, {
1115
- default: ce(() => [
1116
- (X(!0), re(Ze, null, Qe(o.value, (T, w) => (X(), Be(y, {
1117
- key: w,
1118
- name: w
1119
- }, {
1120
- title: ce(() => [
1121
- M("div", $r, Z(T.name), 1)
1122
- ]),
1123
- default: ce(() => {
1124
- var g, C;
1125
- return [
1126
- M("div", Lr, [
1127
- (X(), Be(Et(a(T.comp + "Operate")), {
1128
- itemContents: T == null ? void 0 : T.compData,
1129
- originalItemContents: (C = (g = en(r)) == null ? void 0 : g.find((p, h) => h === w)) == null ? void 0 : C.compData,
1130
- onChange: (p) => l(p, T, w)
1131
- }, null, 40, ["itemContents", "originalItemContents", "onChange"]))
1132
- ])
1133
- ];
1134
- }),
1135
- _: 2
1136
- }, 1032, ["name"]))), 128))
1137
- ]),
1138
- _: 1
1139
- }, 8, ["modelValue"])
1140
- ])
1141
- ]);
1142
- };
1143
- }
1144
- }, Ls = /* @__PURE__ */ Re(qr, [["__scopeId", "data-v-a216b035"]]), Jr = {
1145
- key: 0,
1146
- class: "show-content"
1147
- }, Mr = {
1148
- __name: "index",
1149
- setup(e) {
1150
- const t = Ye(he), { itemData: n } = Ee(t), r = U([]);
1151
- de(
1152
- () => n.value,
1153
- () => {
1154
- var s;
1155
- !n.value || ((s = n.value) == null ? void 0 : s.length) === 0 || (r.value = v(n.value));
1156
- },
1157
- { deep: !0, immediate: !0 }
1158
- );
1159
- const o = (s) => ln(s);
1160
- return (s, a) => {
1161
- var l;
1162
- return ((l = r.value) == null ? void 0 : l.length) > 0 ? (X(), re("div", Jr, [
1163
- (X(!0), re(Ze, null, Qe(r.value, (d, i) => (X(), re("div", {
1164
- class: "item-content",
1165
- key: i
1166
- }, [
1167
- M("div", null, Z(d.name), 1),
1168
- (X(), Be(Et(o(d.comp)), {
1169
- itemData: d == null ? void 0 : d.compData,
1170
- childItemData: d == null ? void 0 : d.itemChildData,
1171
- key: i
1172
- }, null, 8, ["itemData", "childItemData"]))
1173
- ]))), 128))
1174
- ])) : Yt("", !0);
1175
- };
1176
- }
1177
- }, qs = /* @__PURE__ */ Re(Mr, [["__scopeId", "data-v-79320497"]]), ne = [
1178
- {
1179
- key: "FormName",
1180
- value: "Form"
1181
- },
1182
- {
1183
- key: "TableName",
1184
- value: "Table"
1185
- },
1186
- {
1187
- key: "MenuName",
1188
- value: "Menu"
1189
- },
1190
- {
1191
- key: "GroupName",
1192
- value: "Group"
1193
- },
1194
- {
1195
- key: "SystemKey",
1196
- value: "System"
1197
- }
1198
- ], te = [
1199
- {
1200
- key: "FormDirect",
1201
- value: "formFlex"
1202
- },
1203
- {
1204
- key: "Form",
1205
- value: "formContent"
1206
- },
1207
- {
1208
- key: "FormButton",
1209
- value: "formButton"
1210
- },
1211
- {
1212
- key: "FormFlex",
1213
- value: "formWrap"
1214
- },
1215
- {
1216
- key: "TableColumns",
1217
- value: "header"
1218
- },
1219
- {
1220
- key: "TableButton",
1221
- value: "extraButton"
1222
- },
1223
- {
1224
- key: "TableLineButton",
1225
- value: "rowButton"
1226
- },
1227
- {
1228
- key: "Table",
1229
- value: "tableContents"
1230
- },
1231
- {
1232
- key: "TableIndex",
1233
- value: "tableIndex"
1234
- },
1235
- {
1236
- key: "Menus",
1237
- value: "menuContents"
1238
- },
1239
- {
1240
- key: "GroupContents",
1241
- value: "groupContents"
1242
- }
1243
- ], Je = U(0), ct = U(0), zr = (e) => {
1244
- let t;
1245
- e.includes(`\r
1246
- `) ? t = e.split(`\r
1247
- `).filter((o) => o.trim() !== "") : t = e.split(`
1248
- `).filter((o) => o.trim() !== "");
1249
- const n = [];
1250
- let r = "";
1251
- for (const o of t)
1252
- o.includes("{") || r.includes("{") || o.includes("[") || r.includes("[") || o.includes("【") || r.includes("【") || o.includes("(") || r.includes("(") || o.includes("(") || r.includes("(") ? (r += o.trim(), v(r).split("{").length - 1 === v(r).split("}").length - 1 && v(r).split("【").length - 1 === v(r).split("】").length - 1 && v(r).split("[").length - 1 === v(r).split("]").length - 1 && v(r).split("(").length - 1 === v(r).split(")").length - 1 && v(r).split("(").length - 1 === v(r).split(")").length - 1 && (n.push(r), r = "")) : n.push(o.trim());
1253
- return n;
1254
- }, Hr = (e) => {
1255
- const t = e.trim().replace(/^'|'$/g, ""), n = /((?:\$?[a-zA-Z_][a-zA-Z0-9_]*\$?\([^)]*\))|[a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(.*?)(?=\s*(?:(?:\$?[a-zA-Z_][a-zA-Z0-9_]*\$?\([^)]*\))|[a-zA-Z_][a-zA-Z0-9_]*)\s*=|$)/g, r = {};
1256
- let o;
1257
- for (; (o = n.exec(t)) !== null; ) {
1258
- const s = o[1];
1259
- let a = o[2].trim();
1260
- (a.match(/\[/g) || []).length !== (a.match(/\]/g) || []).length && (a = a == null ? void 0 : a.replace(/]$/, "")), r[s] ? (r[s + ct.value] && ct.value++, r[s + ct.value] = s + "=" + a) : r[s] = s + "=" + a;
1261
- }
1262
- return r;
1263
- }, cn = (e) => {
1264
- const [t, n] = e.split("=").map((s) => s.trim()), r = t.replace(/['"]/g, ""), o = n.replace(/^['"]|['"]$/g, "");
1265
- return { key: r, value: o };
1266
- }, Ir = (e) => {
1267
- var a;
1268
- let t = [];
1269
- const [n, r] = e.split(/=(.+)/), o = n.replace(/['"]/g, "").trim(), s = r.replace(/^['"]|['"]$/g, "");
1270
- return (a = Object.values(Hr(s))) == null || a.forEach((l) => {
1271
- t.push(cn(l));
1272
- }), { key: o, value: t };
1273
- }, ze = (e) => {
1274
- try {
1275
- return JSON.parse(e), !0;
1276
- } catch {
1277
- return !1;
1278
- }
1279
- }, un = (e) => {
1280
- try {
1281
- const t = e.replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",").replace(/:/g, ":").replace(/:\s*(?=,|}|$)/g, ': ""');
1282
- if (v(t).split("{").length - 1 > 1) {
1283
- let n = v(t).replace(/^\{(.*)\}$/, "[$1]");
1284
- if (ze(n) && !n.includes("$") || (n = n.replace(/"([^"]+)"\$([\w\u4e00-\u9fa5]+\([^)]*\))/g, '"$1$$$2"')), ze(n)) {
1285
- const r = JSON.parse(n);
1286
- let o = [];
1287
- return r == null || r.forEach((s) => {
1288
- var a;
1289
- (a = Object.entries(v(s))) == null || a.forEach((l) => {
1290
- Je.value++, o.push({
1291
- id: Je.value,
1292
- key: (l == null ? void 0 : l[0]) ?? "",
1293
- value: (l == null ? void 0 : l[1]) === "" ? "" : l == null ? void 0 : l[1],
1294
- // 如果值为空,则key设为空字符串,否则保留原值
1295
- width: Object.keys(v(s)).length
1296
- });
1297
- });
1298
- }), o;
1299
- } else
1300
- return console.error("转换类型不正确:"), [];
1301
- } else if (ze(t)) {
1302
- const n = JSON.parse(t);
1303
- return Object.entries(n).map(([r, o]) => (Je.value++, {
1304
- id: Je.value,
1305
- key: r,
1306
- value: o === "" ? "" : o,
1307
- // 如果值为空,则key设为空字符串,否则保留原值
1308
- width: 1
1309
- }));
1310
- } else
1311
- return t;
1312
- } catch (t) {
1313
- return console.error("转换失败:", t), [];
1314
- }
1315
- }, Vr = (e, t) => {
1316
- try {
1317
- if (ne != null && ne.find((n) => (n == null ? void 0 : n.key) === t))
1318
- return JSON.parse(e.replace(/[’]|[‘]|[']/g, '"'));
1319
- if (v(e).split("[").length - 1 > 1) {
1320
- const n = v(e).replace(/[’]|[‘]|[']/g, '"').replaceAll(/,/g, ",").replaceAll("(", "[").replaceAll(")", "]").replaceAll("],]", "]]");
1321
- return JSON.parse(n);
1322
- } else {
1323
- const n = v(e).replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",");
1324
- if (ze(n)) {
1325
- const r = JSON.parse(n);
1326
- return Array.isArray(r) ? r.map((o) => ({ label: o })) : r;
1327
- } else
1328
- return un(v(e));
1329
- }
1330
- } catch (n) {
1331
- return console.error("解析失败:", n), e;
1332
- }
1333
- }, Wr = (e) => ({ [e == null ? void 0 : e.key]: Vr(e == null ? void 0 : e.value, e == null ? void 0 : e.key) }), Kr = (e) => {
1334
- try {
1335
- if (v(e).split("[").length - 1 > 1) {
1336
- const t = v(e).replace(/[’]|[‘]|[']/g, '"').replaceAll(/,/g, ",").replaceAll("(", "[").replaceAll(")", "]").replaceAll("],]", "]]");
1337
- return JSON.parse(t);
1338
- } else
1339
- return JSON.parse(v(e).replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",")).map((n) => ({ label: n }));
1340
- } catch (t) {
1341
- return console.error("解析失败:", t), e;
1342
- }
1343
- }, fn = (e) => {
1344
- var t, n, r, o, s, a;
1345
- try {
1346
- const l = zr((n = (t = v(e)) == null ? void 0 : t.replace("(", "(")) == null ? void 0 : n.replace(")", ")")), d = (r = v(l)) == null ? void 0 : r.map((c) => {
1347
- var w, g;
1348
- let T = (g = (w = v(c)) == null ? void 0 : w.split("=")) == null ? void 0 : g[0];
1349
- return T != null && T.includes("GroupContents") ? Ir(c) : cn(c);
1350
- }), i = [];
1351
- (o = v(d)) == null || o.forEach((c) => {
1352
- var T, w, g, C, p;
1353
- ne != null && ne.find((h) => {
1354
- var u, R;
1355
- return ((u = h == null ? void 0 : h.key) == null ? void 0 : u.toUpperCase()) === ((R = c == null ? void 0 : c.key) == null ? void 0 : R.toUpperCase());
1356
- }) ? i.push({
1357
- comp: ((T = ne == null ? void 0 : ne.find((h) => {
1358
- var u, R;
1359
- return ((u = h == null ? void 0 : h.key) == null ? void 0 : u.toUpperCase()) === ((R = c == null ? void 0 : c.key) == null ? void 0 : R.toUpperCase());
1360
- })) == null ? void 0 : T.value) ?? "",
1361
- name: (w = c == null ? void 0 : c.value) == null ? void 0 : w.replace(/[’]|[‘]|[']/g, ""),
1362
- compData: []
1363
- }) : te != null && te.find((h) => {
1364
- var u, R;
1365
- return ((u = h == null ? void 0 : h.key) == null ? void 0 : u.toUpperCase()) === ((R = c == null ? void 0 : c.key) == null ? void 0 : R.toUpperCase());
1366
- }) && ((i == null ? void 0 : i.length) === 0 && (g = c.key) != null && g.includes("Menus") && i.push({
1367
- comp: "Menu",
1368
- name: "",
1369
- compData: []
1370
- }), (C = i == null ? void 0 : i[(i == null ? void 0 : i.length) - 1]) != null && C.compData && i[(i == null ? void 0 : i.length) - 1].compData.push({
1371
- key: (p = te == null ? void 0 : te.find((h) => {
1372
- var u, R;
1373
- return ((u = h == null ? void 0 : h.key) == null ? void 0 : u.toUpperCase()) === ((R = c == null ? void 0 : c.key) == null ? void 0 : R.toUpperCase());
1374
- })) == null ? void 0 : p.value,
1375
- contents: c == null ? void 0 : c.value
1376
- }));
1377
- }), console.log("newContents", i);
1378
- let y = (s = v(i)) == null ? void 0 : s.map((c) => {
1379
- var T;
1380
- return c != null && c.compData && (c.compData = (T = c == null ? void 0 : c.compData) == null ? void 0 : T.map((w) => {
1381
- var g, C, p, h, u, R, b, m, E, S, D;
1382
- if ((w == null ? void 0 : w.key) === "formFlex")
1383
- w.contents = ((C = (g = w.contents) == null ? void 0 : g.replace(/[’]|[‘]|[']/g, "")) == null ? void 0 : C.toUpperCase()) !== "Vertical".toUpperCase();
1384
- else if ((w == null ? void 0 : w.key) === "groupContents")
1385
- w.contents = (p = v(w.contents)) == null ? void 0 : p.map((N) => Wr(v(N)));
1386
- else if (((u = (h = w.contents) == null ? void 0 : h.trim()) != null && u.startsWith("[") || (b = (R = w.contents) == null ? void 0 : R.trim()) != null && b.startsWith("【")) && ((E = (m = w.contents) == null ? void 0 : m.trim()) != null && E.endsWith("]") || (D = (S = w.contents) == null ? void 0 : S.trim()) != null && D.endsWith("】")))
1387
- w.contents = Kr(v(w.contents));
1388
- else {
1389
- if (!w.contents) return;
1390
- w.contents = un(v(w.contents));
1391
- }
1392
- return w;
1393
- })), c;
1394
- });
1395
- return y = (a = v(y)) == null ? void 0 : a.map((c) => {
1396
- var T;
1397
- return (c == null ? void 0 : c.comp) === "Group" && (c.compData = (T = c.compData) == null ? void 0 : T.map((w) => {
1398
- var C;
1399
- let g = [];
1400
- return (C = w.contents) == null || C.forEach((p) => {
1401
- var h, u, R, b, m, E, S, D, N, O, K, F;
1402
- if (ne != null && ne.find((J) => {
1403
- var z, H, I;
1404
- return ((z = J == null ? void 0 : J.key) == null ? void 0 : z.toUpperCase()) === ((I = (H = Object.keys(p)) == null ? void 0 : H[0]) == null ? void 0 : I.toUpperCase());
1405
- }))
1406
- g.push({
1407
- comp: (h = ne == null ? void 0 : ne.find((J) => {
1408
- var z, H, I;
1409
- return ((z = J == null ? void 0 : J.key) == null ? void 0 : z.toUpperCase()) === ((I = (H = Object.keys(p)) == null ? void 0 : H[0]) == null ? void 0 : I.toUpperCase());
1410
- })) == null ? void 0 : h.value,
1411
- name: (R = (u = Object.values(p)) == null ? void 0 : u[0]) == null ? void 0 : R.replace(/[’]|[‘]|[']/g, ""),
1412
- compData: []
1413
- });
1414
- else if (te != null && te.find((J) => {
1415
- var z, H, I;
1416
- return ((z = J == null ? void 0 : J.key) == null ? void 0 : z.toUpperCase()) === ((I = (H = Object.keys(p)) == null ? void 0 : H[0]) == null ? void 0 : I.toUpperCase());
1417
- })) {
1418
- if ((g == null ? void 0 : g.length) === 0) return;
1419
- (b = g == null ? void 0 : g[(g == null ? void 0 : g.length) - 1]) != null && b.compData && g[(g == null ? void 0 : g.length) - 1].compData.push({
1420
- key: (m = te == null ? void 0 : te.find((J) => {
1421
- var z, H, I;
1422
- return ((z = J == null ? void 0 : J.key) == null ? void 0 : z.toUpperCase()) === ((I = (H = Object.keys(p)) == null ? void 0 : H[0]) == null ? void 0 : I.toUpperCase());
1423
- })) == null ? void 0 : m.value,
1424
- contents: (E = Object.values(p)) == null ? void 0 : E[0]
1425
- });
1426
- } else if ((D = (S = Object.keys(p)) == null ? void 0 : S[0]) != null && D.includes("$")) {
1427
- const J = (O = (N = Object.keys(v(p))) == null ? void 0 : N[0]) == null ? void 0 : O.split("$");
1428
- g[(g == null ? void 0 : g.length) - 1].compData.push({
1429
- key: (K = te == null ? void 0 : te.find((z) => {
1430
- var H, I;
1431
- return ((H = z == null ? void 0 : z.key) == null ? void 0 : H.toUpperCase()) === ((I = J == null ? void 0 : J[0]) == null ? void 0 : I.toUpperCase());
1432
- })) == null ? void 0 : K.value,
1433
- contents: (F = Object.values(p)) == null ? void 0 : F[0],
1434
- selectLabel: J == null ? void 0 : J[1]
1435
- });
1436
- }
1437
- return p;
1438
- }), w.contents = g, w;
1439
- })), c;
1440
- }), y;
1441
- } catch {
1442
- return !1;
1443
- }
1444
- }, Js = (e) => fn(e), Ms = (e) => !!fn(e);
1445
- function pn(e, t) {
1446
- return function() {
1447
- return e.apply(t, arguments);
1448
- };
1449
- }
1450
- const { toString: Gr } = Object.prototype, { getPrototypeOf: St } = Object, { iterator: tt, toStringTag: dn } = Symbol, nt = /* @__PURE__ */ ((e) => (t) => {
1451
- const n = Gr.call(t);
1452
- return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
1453
- })(/* @__PURE__ */ Object.create(null)), ue = (e) => (e = e.toLowerCase(), (t) => nt(t) === e), rt = (e) => (t) => typeof t === e, { isArray: Ae } = Array, je = rt("undefined");
1454
- function Xr(e) {
1455
- return e !== null && !je(e) && e.constructor !== null && !je(e.constructor) && oe(e.constructor.isBuffer) && e.constructor.isBuffer(e);
1456
- }
1457
- const hn = ue("ArrayBuffer");
1458
- function Zr(e) {
1459
- let t;
1460
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && hn(e.buffer), t;
1461
- }
1462
- const Qr = rt("string"), oe = rt("function"), mn = rt("number"), ot = (e) => e !== null && typeof e == "object", Yr = (e) => e === !0 || e === !1, He = (e) => {
1463
- if (nt(e) !== "object")
1464
- return !1;
1465
- const t = St(e);
1466
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(dn in e) && !(tt in e);
1467
- }, eo = ue("Date"), to = ue("File"), no = ue("Blob"), ro = ue("FileList"), oo = (e) => ot(e) && oe(e.pipe), so = (e) => {
1468
- let t;
1469
- return e && (typeof FormData == "function" && e instanceof FormData || oe(e.append) && ((t = nt(e)) === "formdata" || // detect form-data instance
1470
- t === "object" && oe(e.toString) && e.toString() === "[object FormData]"));
1471
- }, ao = ue("URLSearchParams"), [lo, io, co, uo] = ["ReadableStream", "Request", "Response", "Headers"].map(ue), fo = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
1472
- function $e(e, t, { allOwnKeys: n = !1 } = {}) {
1473
- if (e === null || typeof e > "u")
1474
- return;
1475
- let r, o;
1476
- if (typeof e != "object" && (e = [e]), Ae(e))
1477
- for (r = 0, o = e.length; r < o; r++)
1478
- t.call(null, e[r], r, e);
1479
- else {
1480
- const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), a = s.length;
1481
- let l;
1482
- for (r = 0; r < a; r++)
1483
- l = s[r], t.call(null, e[l], l, e);
1484
- }
1485
- }
1486
- function yn(e, t) {
1487
- t = t.toLowerCase();
1488
- const n = Object.keys(e);
1489
- let r = n.length, o;
1490
- for (; r-- > 0; )
1491
- if (o = n[r], t === o.toLowerCase())
1492
- return o;
1493
- return null;
1494
- }
1495
- const ge = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, bn = (e) => !je(e) && e !== ge;
1496
- function dt() {
1497
- const { caseless: e } = bn(this) && this || {}, t = {}, n = (r, o) => {
1498
- const s = e && yn(t, o) || o;
1499
- He(t[s]) && He(r) ? t[s] = dt(t[s], r) : He(r) ? t[s] = dt({}, r) : Ae(r) ? t[s] = r.slice() : t[s] = r;
1500
- };
1501
- for (let r = 0, o = arguments.length; r < o; r++)
1502
- arguments[r] && $e(arguments[r], n);
1503
- return t;
1504
- }
1505
- const po = (e, t, n, { allOwnKeys: r } = {}) => ($e(t, (o, s) => {
1506
- n && oe(o) ? e[s] = pn(o, n) : e[s] = o;
1507
- }, { allOwnKeys: r }), e), ho = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), mo = (e, t, n, r) => {
1508
- e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
1509
- value: t.prototype
1510
- }), n && Object.assign(e.prototype, n);
1511
- }, yo = (e, t, n, r) => {
1512
- let o, s, a;
1513
- const l = {};
1514
- if (t = t || {}, e == null) return t;
1515
- do {
1516
- for (o = Object.getOwnPropertyNames(e), s = o.length; s-- > 0; )
1517
- a = o[s], (!r || r(a, e, t)) && !l[a] && (t[a] = e[a], l[a] = !0);
1518
- e = n !== !1 && St(e);
1519
- } while (e && (!n || n(e, t)) && e !== Object.prototype);
1520
- return t;
1521
- }, bo = (e, t, n) => {
1522
- e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
1523
- const r = e.indexOf(t, n);
1524
- return r !== -1 && r === n;
1525
- }, go = (e) => {
1526
- if (!e) return null;
1527
- if (Ae(e)) return e;
1528
- let t = e.length;
1529
- if (!mn(t)) return null;
1530
- const n = new Array(t);
1531
- for (; t-- > 0; )
1532
- n[t] = e[t];
1533
- return n;
1534
- }, vo = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && St(Uint8Array)), ko = (e, t) => {
1535
- const r = (e && e[tt]).call(e);
1536
- let o;
1537
- for (; (o = r.next()) && !o.done; ) {
1538
- const s = o.value;
1539
- t.call(e, s[0], s[1]);
1540
- }
1541
- }, Eo = (e, t) => {
1542
- let n;
1543
- const r = [];
1544
- for (; (n = e.exec(t)) !== null; )
1545
- r.push(n);
1546
- return r;
1547
- }, So = ue("HTMLFormElement"), Ro = (e) => e.toLowerCase().replace(
1548
- /[-_\s]([a-z\d])(\w*)/g,
1549
- function(n, r, o) {
1550
- return r.toUpperCase() + o;
1551
- }
1552
- ), qt = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), wo = ue("RegExp"), gn = (e, t) => {
1553
- const n = Object.getOwnPropertyDescriptors(e), r = {};
1554
- $e(n, (o, s) => {
1555
- let a;
1556
- (a = t(o, s, e)) !== !1 && (r[s] = a || o);
1557
- }), Object.defineProperties(e, r);
1558
- }, Oo = (e) => {
1559
- gn(e, (t, n) => {
1560
- if (oe(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
1561
- return !1;
1562
- const r = e[n];
1563
- if (oe(r)) {
1564
- if (t.enumerable = !1, "writable" in t) {
1565
- t.writable = !1;
1566
- return;
1567
- }
1568
- t.set || (t.set = () => {
1569
- throw Error("Can not rewrite read-only method '" + n + "'");
1570
- });
1571
- }
1572
- });
1573
- }, To = (e, t) => {
1574
- const n = {}, r = (o) => {
1575
- o.forEach((s) => {
1576
- n[s] = !0;
1577
- });
1578
- };
1579
- return Ae(e) ? r(e) : r(String(e).split(t)), n;
1580
- }, Ao = () => {
1581
- }, Co = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
1582
- function _o(e) {
1583
- return !!(e && oe(e.append) && e[dn] === "FormData" && e[tt]);
1584
- }
1585
- const xo = (e) => {
1586
- const t = new Array(10), n = (r, o) => {
1587
- if (ot(r)) {
1588
- if (t.indexOf(r) >= 0)
1589
- return;
1590
- if (!("toJSON" in r)) {
1591
- t[o] = r;
1592
- const s = Ae(r) ? [] : {};
1593
- return $e(r, (a, l) => {
1594
- const d = n(a, o + 1);
1595
- !je(d) && (s[l] = d);
1596
- }), t[o] = void 0, s;
1597
- }
1598
- }
1599
- return r;
1600
- };
1601
- return n(e, 0);
1602
- }, Do = ue("AsyncFunction"), Fo = (e) => e && (ot(e) || oe(e)) && oe(e.then) && oe(e.catch), vn = ((e, t) => e ? setImmediate : t ? ((n, r) => (ge.addEventListener("message", ({ source: o, data: s }) => {
1603
- o === ge && s === n && r.length && r.shift()();
1604
- }, !1), (o) => {
1605
- r.push(o), ge.postMessage(n, "*");
1606
- }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
1607
- typeof setImmediate == "function",
1608
- oe(ge.postMessage)
1609
- ), No = typeof queueMicrotask < "u" ? queueMicrotask.bind(ge) : typeof process < "u" && process.nextTick || vn, Po = (e) => e != null && oe(e[tt]), f = {
1610
- isArray: Ae,
1611
- isArrayBuffer: hn,
1612
- isBuffer: Xr,
1613
- isFormData: so,
1614
- isArrayBufferView: Zr,
1615
- isString: Qr,
1616
- isNumber: mn,
1617
- isBoolean: Yr,
1618
- isObject: ot,
1619
- isPlainObject: He,
1620
- isReadableStream: lo,
1621
- isRequest: io,
1622
- isResponse: co,
1623
- isHeaders: uo,
1624
- isUndefined: je,
1625
- isDate: eo,
1626
- isFile: to,
1627
- isBlob: no,
1628
- isRegExp: wo,
1629
- isFunction: oe,
1630
- isStream: oo,
1631
- isURLSearchParams: ao,
1632
- isTypedArray: vo,
1633
- isFileList: ro,
1634
- forEach: $e,
1635
- merge: dt,
1636
- extend: po,
1637
- trim: fo,
1638
- stripBOM: ho,
1639
- inherits: mo,
1640
- toFlatObject: yo,
1641
- kindOf: nt,
1642
- kindOfTest: ue,
1643
- endsWith: bo,
1644
- toArray: go,
1645
- forEachEntry: ko,
1646
- matchAll: Eo,
1647
- isHTMLForm: So,
1648
- hasOwnProperty: qt,
1649
- hasOwnProp: qt,
1650
- // an alias to avoid ESLint no-prototype-builtins detection
1651
- reduceDescriptors: gn,
1652
- freezeMethods: Oo,
1653
- toObjectSet: To,
1654
- toCamelCase: Ro,
1655
- noop: Ao,
1656
- toFiniteNumber: Co,
1657
- findKey: yn,
1658
- global: ge,
1659
- isContextDefined: bn,
1660
- isSpecCompliantForm: _o,
1661
- toJSONObject: xo,
1662
- isAsyncFn: Do,
1663
- isThenable: Fo,
1664
- setImmediate: vn,
1665
- asap: No,
1666
- isIterable: Po
1667
- };
1668
- function B(e, t, n, r, o) {
1669
- 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), o && (this.response = o, this.status = o.status ? o.status : null);
1670
- }
1671
- f.inherits(B, Error, {
1672
- toJSON: function() {
1673
- return {
1674
- // Standard
1675
- message: this.message,
1676
- name: this.name,
1677
- // Microsoft
1678
- description: this.description,
1679
- number: this.number,
1680
- // Mozilla
1681
- fileName: this.fileName,
1682
- lineNumber: this.lineNumber,
1683
- columnNumber: this.columnNumber,
1684
- stack: this.stack,
1685
- // Axios
1686
- config: f.toJSONObject(this.config),
1687
- code: this.code,
1688
- status: this.status
1689
- };
1690
- }
1691
- });
1692
- const kn = B.prototype, En = {};
1693
- [
1694
- "ERR_BAD_OPTION_VALUE",
1695
- "ERR_BAD_OPTION",
1696
- "ECONNABORTED",
1697
- "ETIMEDOUT",
1698
- "ERR_NETWORK",
1699
- "ERR_FR_TOO_MANY_REDIRECTS",
1700
- "ERR_DEPRECATED",
1701
- "ERR_BAD_RESPONSE",
1702
- "ERR_BAD_REQUEST",
1703
- "ERR_CANCELED",
1704
- "ERR_NOT_SUPPORT",
1705
- "ERR_INVALID_URL"
1706
- // eslint-disable-next-line func-names
1707
- ].forEach((e) => {
1708
- En[e] = { value: e };
1709
- });
1710
- Object.defineProperties(B, En);
1711
- Object.defineProperty(kn, "isAxiosError", { value: !0 });
1712
- B.from = (e, t, n, r, o, s) => {
1713
- const a = Object.create(kn);
1714
- return f.toFlatObject(e, a, function(d) {
1715
- return d !== Error.prototype;
1716
- }, (l) => l !== "isAxiosError"), B.call(a, e.message, t, n, r, o), a.cause = e, a.name = e.name, s && Object.assign(a, s), a;
1717
- };
1718
- const Uo = null;
1719
- function ht(e) {
1720
- return f.isPlainObject(e) || f.isArray(e);
1721
- }
1722
- function Sn(e) {
1723
- return f.endsWith(e, "[]") ? e.slice(0, -2) : e;
1724
- }
1725
- function Jt(e, t, n) {
1726
- return e ? e.concat(t).map(function(o, s) {
1727
- return o = Sn(o), !n && s ? "[" + o + "]" : o;
1728
- }).join(n ? "." : "") : t;
1729
- }
1730
- function Bo(e) {
1731
- return f.isArray(e) && !e.some(ht);
1732
- }
1733
- const jo = f.toFlatObject(f, {}, null, function(t) {
1734
- return /^is[A-Z]/.test(t);
1735
- });
1736
- function st(e, t, n) {
1737
- if (!f.isObject(e))
1738
- throw new TypeError("target must be an object");
1739
- t = t || new FormData(), n = f.toFlatObject(n, {
1740
- metaTokens: !0,
1741
- dots: !1,
1742
- indexes: !1
1743
- }, !1, function(C, p) {
1744
- return !f.isUndefined(p[C]);
1745
- });
1746
- const r = n.metaTokens, o = n.visitor || y, s = n.dots, a = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && f.isSpecCompliantForm(t);
1747
- if (!f.isFunction(o))
1748
- throw new TypeError("visitor must be a function");
1749
- function i(g) {
1750
- if (g === null) return "";
1751
- if (f.isDate(g))
1752
- return g.toISOString();
1753
- if (!d && f.isBlob(g))
1754
- throw new B("Blob is not supported. Use a Buffer instead.");
1755
- return f.isArrayBuffer(g) || f.isTypedArray(g) ? d && typeof Blob == "function" ? new Blob([g]) : Buffer.from(g) : g;
1756
- }
1757
- function y(g, C, p) {
1758
- let h = g;
1759
- if (g && !p && typeof g == "object") {
1760
- if (f.endsWith(C, "{}"))
1761
- C = r ? C : C.slice(0, -2), g = JSON.stringify(g);
1762
- else if (f.isArray(g) && Bo(g) || (f.isFileList(g) || f.endsWith(C, "[]")) && (h = f.toArray(g)))
1763
- return C = Sn(C), h.forEach(function(R, b) {
1764
- !(f.isUndefined(R) || R === null) && t.append(
1765
- // eslint-disable-next-line no-nested-ternary
1766
- a === !0 ? Jt([C], b, s) : a === null ? C : C + "[]",
1767
- i(R)
1768
- );
1769
- }), !1;
1770
- }
1771
- return ht(g) ? !0 : (t.append(Jt(p, C, s), i(g)), !1);
1772
- }
1773
- const c = [], T = Object.assign(jo, {
1774
- defaultVisitor: y,
1775
- convertValue: i,
1776
- isVisitable: ht
1777
- });
1778
- function w(g, C) {
1779
- if (!f.isUndefined(g)) {
1780
- if (c.indexOf(g) !== -1)
1781
- throw Error("Circular reference detected in " + C.join("."));
1782
- c.push(g), f.forEach(g, function(h, u) {
1783
- (!(f.isUndefined(h) || h === null) && o.call(
1784
- t,
1785
- h,
1786
- f.isString(u) ? u.trim() : u,
1787
- C,
1788
- T
1789
- )) === !0 && w(h, C ? C.concat(u) : [u]);
1790
- }), c.pop();
1791
- }
1792
- }
1793
- if (!f.isObject(e))
1794
- throw new TypeError("data must be an object");
1795
- return w(e), t;
1796
- }
1797
- function Mt(e) {
1798
- const t = {
1799
- "!": "%21",
1800
- "'": "%27",
1801
- "(": "%28",
1802
- ")": "%29",
1803
- "~": "%7E",
1804
- "%20": "+",
1805
- "%00": "\0"
1806
- };
1807
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
1808
- return t[r];
1809
- });
1810
- }
1811
- function Rt(e, t) {
1812
- this._pairs = [], e && st(e, this, t);
1813
- }
1814
- const Rn = Rt.prototype;
1815
- Rn.append = function(t, n) {
1816
- this._pairs.push([t, n]);
1817
- };
1818
- Rn.toString = function(t) {
1819
- const n = t ? function(r) {
1820
- return t.call(this, r, Mt);
1821
- } : Mt;
1822
- return this._pairs.map(function(o) {
1823
- return n(o[0]) + "=" + n(o[1]);
1824
- }, "").join("&");
1825
- };
1826
- function $o(e) {
1827
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1828
- }
1829
- function wn(e, t, n) {
1830
- if (!t)
1831
- return e;
1832
- const r = n && n.encode || $o;
1833
- f.isFunction(n) && (n = {
1834
- serialize: n
1835
- });
1836
- const o = n && n.serialize;
1837
- let s;
1838
- if (o ? s = o(t, n) : s = f.isURLSearchParams(t) ? t.toString() : new Rt(t, n).toString(r), s) {
1839
- const a = e.indexOf("#");
1840
- a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
1841
- }
1842
- return e;
1843
- }
1844
- class zt {
1845
- constructor() {
1846
- this.handlers = [];
1847
- }
1848
- /**
1849
- * Add a new interceptor to the stack
1850
- *
1851
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1852
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1853
- *
1854
- * @return {Number} An ID used to remove interceptor later
1855
- */
1856
- use(t, n, r) {
1857
- return this.handlers.push({
1858
- fulfilled: t,
1859
- rejected: n,
1860
- synchronous: r ? r.synchronous : !1,
1861
- runWhen: r ? r.runWhen : null
1862
- }), this.handlers.length - 1;
1863
- }
1864
- /**
1865
- * Remove an interceptor from the stack
1866
- *
1867
- * @param {Number} id The ID that was returned by `use`
1868
- *
1869
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1870
- */
1871
- eject(t) {
1872
- this.handlers[t] && (this.handlers[t] = null);
1873
- }
1874
- /**
1875
- * Clear all interceptors from the stack
1876
- *
1877
- * @returns {void}
1878
- */
1879
- clear() {
1880
- this.handlers && (this.handlers = []);
1881
- }
1882
- /**
1883
- * Iterate over all the registered interceptors
1884
- *
1885
- * This method is particularly useful for skipping over any
1886
- * interceptors that may have become `null` calling `eject`.
1887
- *
1888
- * @param {Function} fn The function to call for each interceptor
1889
- *
1890
- * @returns {void}
1891
- */
1892
- forEach(t) {
1893
- f.forEach(this.handlers, function(r) {
1894
- r !== null && t(r);
1895
- });
1896
- }
1897
- }
1898
- const On = {
1899
- silentJSONParsing: !0,
1900
- forcedJSONParsing: !0,
1901
- clarifyTimeoutError: !1
1902
- }, Lo = typeof URLSearchParams < "u" ? URLSearchParams : Rt, qo = typeof FormData < "u" ? FormData : null, Jo = typeof Blob < "u" ? Blob : null, Mo = {
1903
- isBrowser: !0,
1904
- classes: {
1905
- URLSearchParams: Lo,
1906
- FormData: qo,
1907
- Blob: Jo
1908
- },
1909
- protocols: ["http", "https", "file", "blob", "url", "data"]
1910
- }, wt = typeof window < "u" && typeof document < "u", mt = typeof navigator == "object" && navigator || void 0, zo = wt && (!mt || ["ReactNative", "NativeScript", "NS"].indexOf(mt.product) < 0), Ho = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
1911
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Io = wt && window.location.href || "http://localhost", Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1912
- __proto__: null,
1913
- hasBrowserEnv: wt,
1914
- hasStandardBrowserEnv: zo,
1915
- hasStandardBrowserWebWorkerEnv: Ho,
1916
- navigator: mt,
1917
- origin: Io
1918
- }, Symbol.toStringTag, { value: "Module" })), ee = {
1919
- ...Vo,
1920
- ...Mo
1921
- };
1922
- function Wo(e, t) {
1923
- return st(e, new ee.classes.URLSearchParams(), Object.assign({
1924
- visitor: function(n, r, o, s) {
1925
- return ee.isNode && f.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1926
- }
1927
- }, t));
1928
- }
1929
- function Ko(e) {
1930
- return f.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
1931
- }
1932
- function Go(e) {
1933
- const t = {}, n = Object.keys(e);
1934
- let r;
1935
- const o = n.length;
1936
- let s;
1937
- for (r = 0; r < o; r++)
1938
- s = n[r], t[s] = e[s];
1939
- return t;
1940
- }
1941
- function Tn(e) {
1942
- function t(n, r, o, s) {
1943
- let a = n[s++];
1944
- if (a === "__proto__") return !0;
1945
- const l = Number.isFinite(+a), d = s >= n.length;
1946
- return a = !a && f.isArray(o) ? o.length : a, d ? (f.hasOwnProp(o, a) ? o[a] = [o[a], r] : o[a] = r, !l) : ((!o[a] || !f.isObject(o[a])) && (o[a] = []), t(n, r, o[a], s) && f.isArray(o[a]) && (o[a] = Go(o[a])), !l);
1947
- }
1948
- if (f.isFormData(e) && f.isFunction(e.entries)) {
1949
- const n = {};
1950
- return f.forEachEntry(e, (r, o) => {
1951
- t(Ko(r), o, n, 0);
1952
- }), n;
1953
- }
1954
- return null;
1955
- }
1956
- function Xo(e, t, n) {
1957
- if (f.isString(e))
1958
- try {
1959
- return (t || JSON.parse)(e), f.trim(e);
1960
- } catch (r) {
1961
- if (r.name !== "SyntaxError")
1962
- throw r;
1963
- }
1964
- return (n || JSON.stringify)(e);
1965
- }
1966
- const Le = {
1967
- transitional: On,
1968
- adapter: ["xhr", "http", "fetch"],
1969
- transformRequest: [function(t, n) {
1970
- const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = f.isObject(t);
1971
- if (s && f.isHTMLForm(t) && (t = new FormData(t)), f.isFormData(t))
1972
- return o ? JSON.stringify(Tn(t)) : t;
1973
- if (f.isArrayBuffer(t) || f.isBuffer(t) || f.isStream(t) || f.isFile(t) || f.isBlob(t) || f.isReadableStream(t))
1974
- return t;
1975
- if (f.isArrayBufferView(t))
1976
- return t.buffer;
1977
- if (f.isURLSearchParams(t))
1978
- return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
1979
- let l;
1980
- if (s) {
1981
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
1982
- return Wo(t, this.formSerializer).toString();
1983
- if ((l = f.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
1984
- const d = this.env && this.env.FormData;
1985
- return st(
1986
- l ? { "files[]": t } : t,
1987
- d && new d(),
1988
- this.formSerializer
1989
- );
1990
- }
1991
- }
1992
- return s || o ? (n.setContentType("application/json", !1), Xo(t)) : t;
1993
- }],
1994
- transformResponse: [function(t) {
1995
- const n = this.transitional || Le.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
1996
- if (f.isResponse(t) || f.isReadableStream(t))
1997
- return t;
1998
- if (t && f.isString(t) && (r && !this.responseType || o)) {
1999
- const a = !(n && n.silentJSONParsing) && o;
2000
- try {
2001
- return JSON.parse(t);
2002
- } catch (l) {
2003
- if (a)
2004
- throw l.name === "SyntaxError" ? B.from(l, B.ERR_BAD_RESPONSE, this, null, this.response) : l;
2005
- }
2006
- }
2007
- return t;
2008
- }],
2009
- /**
2010
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
2011
- * timeout is not created.
2012
- */
2013
- timeout: 0,
2014
- xsrfCookieName: "XSRF-TOKEN",
2015
- xsrfHeaderName: "X-XSRF-TOKEN",
2016
- maxContentLength: -1,
2017
- maxBodyLength: -1,
2018
- env: {
2019
- FormData: ee.classes.FormData,
2020
- Blob: ee.classes.Blob
2021
- },
2022
- validateStatus: function(t) {
2023
- return t >= 200 && t < 300;
2024
- },
2025
- headers: {
2026
- common: {
2027
- Accept: "application/json, text/plain, */*",
2028
- "Content-Type": void 0
2029
- }
2030
- }
2031
- };
2032
- f.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
2033
- Le.headers[e] = {};
2034
- });
2035
- const Zo = f.toObjectSet([
2036
- "age",
2037
- "authorization",
2038
- "content-length",
2039
- "content-type",
2040
- "etag",
2041
- "expires",
2042
- "from",
2043
- "host",
2044
- "if-modified-since",
2045
- "if-unmodified-since",
2046
- "last-modified",
2047
- "location",
2048
- "max-forwards",
2049
- "proxy-authorization",
2050
- "referer",
2051
- "retry-after",
2052
- "user-agent"
2053
- ]), Qo = (e) => {
2054
- const t = {};
2055
- let n, r, o;
2056
- return e && e.split(`
2057
- `).forEach(function(a) {
2058
- o = a.indexOf(":"), n = a.substring(0, o).trim().toLowerCase(), r = a.substring(o + 1).trim(), !(!n || t[n] && Zo[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
2059
- }), t;
2060
- }, Ht = Symbol("internals");
2061
- function Ne(e) {
2062
- return e && String(e).trim().toLowerCase();
2063
- }
2064
- function Ie(e) {
2065
- return e === !1 || e == null ? e : f.isArray(e) ? e.map(Ie) : String(e);
2066
- }
2067
- function Yo(e) {
2068
- const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
2069
- let r;
2070
- for (; r = n.exec(e); )
2071
- t[r[1]] = r[2];
2072
- return t;
2073
- }
2074
- const es = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
2075
- function ut(e, t, n, r, o) {
2076
- if (f.isFunction(r))
2077
- return r.call(this, t, n);
2078
- if (o && (t = n), !!f.isString(t)) {
2079
- if (f.isString(r))
2080
- return t.indexOf(r) !== -1;
2081
- if (f.isRegExp(r))
2082
- return r.test(t);
2083
- }
2084
- }
2085
- function ts(e) {
2086
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
2087
- }
2088
- function ns(e, t) {
2089
- const n = f.toCamelCase(" " + t);
2090
- ["get", "set", "has"].forEach((r) => {
2091
- Object.defineProperty(e, r + n, {
2092
- value: function(o, s, a) {
2093
- return this[r].call(this, t, o, s, a);
2094
- },
2095
- configurable: !0
2096
- });
2097
- });
2098
- }
2099
- let se = class {
2100
- constructor(t) {
2101
- t && this.set(t);
2102
- }
2103
- set(t, n, r) {
2104
- const o = this;
2105
- function s(l, d, i) {
2106
- const y = Ne(d);
2107
- if (!y)
2108
- throw new Error("header name must be a non-empty string");
2109
- const c = f.findKey(o, y);
2110
- (!c || o[c] === void 0 || i === !0 || i === void 0 && o[c] !== !1) && (o[c || d] = Ie(l));
2111
- }
2112
- const a = (l, d) => f.forEach(l, (i, y) => s(i, y, d));
2113
- if (f.isPlainObject(t) || t instanceof this.constructor)
2114
- a(t, n);
2115
- else if (f.isString(t) && (t = t.trim()) && !es(t))
2116
- a(Qo(t), n);
2117
- else if (f.isObject(t) && f.isIterable(t)) {
2118
- let l = {}, d, i;
2119
- for (const y of t) {
2120
- if (!f.isArray(y))
2121
- throw TypeError("Object iterator must return a key-value pair");
2122
- l[i = y[0]] = (d = l[i]) ? f.isArray(d) ? [...d, y[1]] : [d, y[1]] : y[1];
2123
- }
2124
- a(l, n);
2125
- } else
2126
- t != null && s(n, t, r);
2127
- return this;
2128
- }
2129
- get(t, n) {
2130
- if (t = Ne(t), t) {
2131
- const r = f.findKey(this, t);
2132
- if (r) {
2133
- const o = this[r];
2134
- if (!n)
2135
- return o;
2136
- if (n === !0)
2137
- return Yo(o);
2138
- if (f.isFunction(n))
2139
- return n.call(this, o, r);
2140
- if (f.isRegExp(n))
2141
- return n.exec(o);
2142
- throw new TypeError("parser must be boolean|regexp|function");
2143
- }
2144
- }
2145
- }
2146
- has(t, n) {
2147
- if (t = Ne(t), t) {
2148
- const r = f.findKey(this, t);
2149
- return !!(r && this[r] !== void 0 && (!n || ut(this, this[r], r, n)));
2150
- }
2151
- return !1;
2152
- }
2153
- delete(t, n) {
2154
- const r = this;
2155
- let o = !1;
2156
- function s(a) {
2157
- if (a = Ne(a), a) {
2158
- const l = f.findKey(r, a);
2159
- l && (!n || ut(r, r[l], l, n)) && (delete r[l], o = !0);
2160
- }
2161
- }
2162
- return f.isArray(t) ? t.forEach(s) : s(t), o;
2163
- }
2164
- clear(t) {
2165
- const n = Object.keys(this);
2166
- let r = n.length, o = !1;
2167
- for (; r--; ) {
2168
- const s = n[r];
2169
- (!t || ut(this, this[s], s, t, !0)) && (delete this[s], o = !0);
2170
- }
2171
- return o;
2172
- }
2173
- normalize(t) {
2174
- const n = this, r = {};
2175
- return f.forEach(this, (o, s) => {
2176
- const a = f.findKey(r, s);
2177
- if (a) {
2178
- n[a] = Ie(o), delete n[s];
2179
- return;
2180
- }
2181
- const l = t ? ts(s) : String(s).trim();
2182
- l !== s && delete n[s], n[l] = Ie(o), r[l] = !0;
2183
- }), this;
2184
- }
2185
- concat(...t) {
2186
- return this.constructor.concat(this, ...t);
2187
- }
2188
- toJSON(t) {
2189
- const n = /* @__PURE__ */ Object.create(null);
2190
- return f.forEach(this, (r, o) => {
2191
- r != null && r !== !1 && (n[o] = t && f.isArray(r) ? r.join(", ") : r);
2192
- }), n;
2193
- }
2194
- [Symbol.iterator]() {
2195
- return Object.entries(this.toJSON())[Symbol.iterator]();
2196
- }
2197
- toString() {
2198
- return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
2199
- `);
2200
- }
2201
- getSetCookie() {
2202
- return this.get("set-cookie") || [];
2203
- }
2204
- get [Symbol.toStringTag]() {
2205
- return "AxiosHeaders";
2206
- }
2207
- static from(t) {
2208
- return t instanceof this ? t : new this(t);
2209
- }
2210
- static concat(t, ...n) {
2211
- const r = new this(t);
2212
- return n.forEach((o) => r.set(o)), r;
2213
- }
2214
- static accessor(t) {
2215
- const r = (this[Ht] = this[Ht] = {
2216
- accessors: {}
2217
- }).accessors, o = this.prototype;
2218
- function s(a) {
2219
- const l = Ne(a);
2220
- r[l] || (ns(o, a), r[l] = !0);
2221
- }
2222
- return f.isArray(t) ? t.forEach(s) : s(t), this;
2223
- }
2224
- };
2225
- se.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
2226
- f.reduceDescriptors(se.prototype, ({ value: e }, t) => {
2227
- let n = t[0].toUpperCase() + t.slice(1);
2228
- return {
2229
- get: () => e,
2230
- set(r) {
2231
- this[n] = r;
2232
- }
2233
- };
2234
- });
2235
- f.freezeMethods(se);
2236
- function ft(e, t) {
2237
- const n = this || Le, r = t || n, o = se.from(r.headers);
2238
- let s = r.data;
2239
- return f.forEach(e, function(l) {
2240
- s = l.call(n, s, o.normalize(), t ? t.status : void 0);
2241
- }), o.normalize(), s;
2242
- }
2243
- function An(e) {
2244
- return !!(e && e.__CANCEL__);
2245
- }
2246
- function Ce(e, t, n) {
2247
- B.call(this, e ?? "canceled", B.ERR_CANCELED, t, n), this.name = "CanceledError";
2248
- }
2249
- f.inherits(Ce, B, {
2250
- __CANCEL__: !0
2251
- });
2252
- function Cn(e, t, n) {
2253
- const r = n.config.validateStatus;
2254
- !n.status || !r || r(n.status) ? e(n) : t(new B(
2255
- "Request failed with status code " + n.status,
2256
- [B.ERR_BAD_REQUEST, B.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
2257
- n.config,
2258
- n.request,
2259
- n
2260
- ));
2261
- }
2262
- function rs(e) {
2263
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
2264
- return t && t[1] || "";
2265
- }
2266
- function os(e, t) {
2267
- e = e || 10;
2268
- const n = new Array(e), r = new Array(e);
2269
- let o = 0, s = 0, a;
2270
- return t = t !== void 0 ? t : 1e3, function(d) {
2271
- const i = Date.now(), y = r[s];
2272
- a || (a = i), n[o] = d, r[o] = i;
2273
- let c = s, T = 0;
2274
- for (; c !== o; )
2275
- T += n[c++], c = c % e;
2276
- if (o = (o + 1) % e, o === s && (s = (s + 1) % e), i - a < t)
2277
- return;
2278
- const w = y && i - y;
2279
- return w ? Math.round(T * 1e3 / w) : void 0;
2280
- };
2281
- }
2282
- function ss(e, t) {
2283
- let n = 0, r = 1e3 / t, o, s;
2284
- const a = (i, y = Date.now()) => {
2285
- n = y, o = null, s && (clearTimeout(s), s = null), e.apply(null, i);
2286
- };
2287
- return [(...i) => {
2288
- const y = Date.now(), c = y - n;
2289
- c >= r ? a(i, y) : (o = i, s || (s = setTimeout(() => {
2290
- s = null, a(o);
2291
- }, r - c)));
2292
- }, () => o && a(o)];
2293
- }
2294
- const Ke = (e, t, n = 3) => {
2295
- let r = 0;
2296
- const o = os(50, 250);
2297
- return ss((s) => {
2298
- const a = s.loaded, l = s.lengthComputable ? s.total : void 0, d = a - r, i = o(d), y = a <= l;
2299
- r = a;
2300
- const c = {
2301
- loaded: a,
2302
- total: l,
2303
- progress: l ? a / l : void 0,
2304
- bytes: d,
2305
- rate: i || void 0,
2306
- estimated: i && l && y ? (l - a) / i : void 0,
2307
- event: s,
2308
- lengthComputable: l != null,
2309
- [t ? "download" : "upload"]: !0
2310
- };
2311
- e(c);
2312
- }, n);
2313
- }, It = (e, t) => {
2314
- const n = e != null;
2315
- return [(r) => t[0]({
2316
- lengthComputable: n,
2317
- total: e,
2318
- loaded: r
2319
- }), t[1]];
2320
- }, Vt = (e) => (...t) => f.asap(() => e(...t)), as = ee.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, ee.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
2321
- new URL(ee.origin),
2322
- ee.navigator && /(msie|trident)/i.test(ee.navigator.userAgent)
2323
- ) : () => !0, ls = ee.hasStandardBrowserEnv ? (
2324
- // Standard browser envs support document.cookie
2325
- {
2326
- write(e, t, n, r, o, s) {
2327
- const a = [e + "=" + encodeURIComponent(t)];
2328
- f.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()), f.isString(r) && a.push("path=" + r), f.isString(o) && a.push("domain=" + o), s === !0 && a.push("secure"), document.cookie = a.join("; ");
2329
- },
2330
- read(e) {
2331
- const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
2332
- return t ? decodeURIComponent(t[3]) : null;
2333
- },
2334
- remove(e) {
2335
- this.write(e, "", Date.now() - 864e5);
2336
- }
2337
- }
2338
- ) : (
2339
- // Non-standard browser env (web workers, react-native) lack needed support.
2340
- {
2341
- write() {
2342
- },
2343
- read() {
2344
- return null;
2345
- },
2346
- remove() {
2347
- }
2348
- }
2349
- );
2350
- function is(e) {
2351
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
2352
- }
2353
- function cs(e, t) {
2354
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
2355
- }
2356
- function _n(e, t, n) {
2357
- let r = !is(t);
2358
- return e && (r || n == !1) ? cs(e, t) : t;
2359
- }
2360
- const Wt = (e) => e instanceof se ? { ...e } : e;
2361
- function Se(e, t) {
2362
- t = t || {};
2363
- const n = {};
2364
- function r(i, y, c, T) {
2365
- return f.isPlainObject(i) && f.isPlainObject(y) ? f.merge.call({ caseless: T }, i, y) : f.isPlainObject(y) ? f.merge({}, y) : f.isArray(y) ? y.slice() : y;
2366
- }
2367
- function o(i, y, c, T) {
2368
- if (f.isUndefined(y)) {
2369
- if (!f.isUndefined(i))
2370
- return r(void 0, i, c, T);
2371
- } else return r(i, y, c, T);
2372
- }
2373
- function s(i, y) {
2374
- if (!f.isUndefined(y))
2375
- return r(void 0, y);
2376
- }
2377
- function a(i, y) {
2378
- if (f.isUndefined(y)) {
2379
- if (!f.isUndefined(i))
2380
- return r(void 0, i);
2381
- } else return r(void 0, y);
2382
- }
2383
- function l(i, y, c) {
2384
- if (c in t)
2385
- return r(i, y);
2386
- if (c in e)
2387
- return r(void 0, i);
2388
- }
2389
- const d = {
2390
- url: s,
2391
- method: s,
2392
- data: s,
2393
- baseURL: a,
2394
- transformRequest: a,
2395
- transformResponse: a,
2396
- paramsSerializer: a,
2397
- timeout: a,
2398
- timeoutMessage: a,
2399
- withCredentials: a,
2400
- withXSRFToken: a,
2401
- adapter: a,
2402
- responseType: a,
2403
- xsrfCookieName: a,
2404
- xsrfHeaderName: a,
2405
- onUploadProgress: a,
2406
- onDownloadProgress: a,
2407
- decompress: a,
2408
- maxContentLength: a,
2409
- maxBodyLength: a,
2410
- beforeRedirect: a,
2411
- transport: a,
2412
- httpAgent: a,
2413
- httpsAgent: a,
2414
- cancelToken: a,
2415
- socketPath: a,
2416
- responseEncoding: a,
2417
- validateStatus: l,
2418
- headers: (i, y, c) => o(Wt(i), Wt(y), c, !0)
2419
- };
2420
- return f.forEach(Object.keys(Object.assign({}, e, t)), function(y) {
2421
- const c = d[y] || o, T = c(e[y], t[y], y);
2422
- f.isUndefined(T) && c !== l || (n[y] = T);
2423
- }), n;
2424
- }
2425
- const xn = (e) => {
2426
- const t = Se({}, e);
2427
- let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: a, auth: l } = t;
2428
- t.headers = a = se.from(a), t.url = wn(_n(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), l && a.set(
2429
- "Authorization",
2430
- "Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
2431
- );
2432
- let d;
2433
- if (f.isFormData(n)) {
2434
- if (ee.hasStandardBrowserEnv || ee.hasStandardBrowserWebWorkerEnv)
2435
- a.setContentType(void 0);
2436
- else if ((d = a.getContentType()) !== !1) {
2437
- const [i, ...y] = d ? d.split(";").map((c) => c.trim()).filter(Boolean) : [];
2438
- a.setContentType([i || "multipart/form-data", ...y].join("; "));
2439
- }
2440
- }
2441
- if (ee.hasStandardBrowserEnv && (r && f.isFunction(r) && (r = r(t)), r || r !== !1 && as(t.url))) {
2442
- const i = o && s && ls.read(s);
2443
- i && a.set(o, i);
2444
- }
2445
- return t;
2446
- }, us = typeof XMLHttpRequest < "u", fs = us && function(e) {
2447
- return new Promise(function(n, r) {
2448
- const o = xn(e);
2449
- let s = o.data;
2450
- const a = se.from(o.headers).normalize();
2451
- let { responseType: l, onUploadProgress: d, onDownloadProgress: i } = o, y, c, T, w, g;
2452
- function C() {
2453
- w && w(), g && g(), o.cancelToken && o.cancelToken.unsubscribe(y), o.signal && o.signal.removeEventListener("abort", y);
2454
- }
2455
- let p = new XMLHttpRequest();
2456
- p.open(o.method.toUpperCase(), o.url, !0), p.timeout = o.timeout;
2457
- function h() {
2458
- if (!p)
2459
- return;
2460
- const R = se.from(
2461
- "getAllResponseHeaders" in p && p.getAllResponseHeaders()
2462
- ), m = {
2463
- data: !l || l === "text" || l === "json" ? p.responseText : p.response,
2464
- status: p.status,
2465
- statusText: p.statusText,
2466
- headers: R,
2467
- config: e,
2468
- request: p
2469
- };
2470
- Cn(function(S) {
2471
- n(S), C();
2472
- }, function(S) {
2473
- r(S), C();
2474
- }, m), p = null;
2475
- }
2476
- "onloadend" in p ? p.onloadend = h : p.onreadystatechange = function() {
2477
- !p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(h);
2478
- }, p.onabort = function() {
2479
- p && (r(new B("Request aborted", B.ECONNABORTED, e, p)), p = null);
2480
- }, p.onerror = function() {
2481
- r(new B("Network Error", B.ERR_NETWORK, e, p)), p = null;
2482
- }, p.ontimeout = function() {
2483
- let b = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
2484
- const m = o.transitional || On;
2485
- o.timeoutErrorMessage && (b = o.timeoutErrorMessage), r(new B(
2486
- b,
2487
- m.clarifyTimeoutError ? B.ETIMEDOUT : B.ECONNABORTED,
2488
- e,
2489
- p
2490
- )), p = null;
2491
- }, s === void 0 && a.setContentType(null), "setRequestHeader" in p && f.forEach(a.toJSON(), function(b, m) {
2492
- p.setRequestHeader(m, b);
2493
- }), f.isUndefined(o.withCredentials) || (p.withCredentials = !!o.withCredentials), l && l !== "json" && (p.responseType = o.responseType), i && ([T, g] = Ke(i, !0), p.addEventListener("progress", T)), d && p.upload && ([c, w] = Ke(d), p.upload.addEventListener("progress", c), p.upload.addEventListener("loadend", w)), (o.cancelToken || o.signal) && (y = (R) => {
2494
- p && (r(!R || R.type ? new Ce(null, e, p) : R), p.abort(), p = null);
2495
- }, o.cancelToken && o.cancelToken.subscribe(y), o.signal && (o.signal.aborted ? y() : o.signal.addEventListener("abort", y)));
2496
- const u = rs(o.url);
2497
- if (u && ee.protocols.indexOf(u) === -1) {
2498
- r(new B("Unsupported protocol " + u + ":", B.ERR_BAD_REQUEST, e));
2499
- return;
2500
- }
2501
- p.send(s || null);
2502
- });
2503
- }, ps = (e, t) => {
2504
- const { length: n } = e = e ? e.filter(Boolean) : [];
2505
- if (t || n) {
2506
- let r = new AbortController(), o;
2507
- const s = function(i) {
2508
- if (!o) {
2509
- o = !0, l();
2510
- const y = i instanceof Error ? i : this.reason;
2511
- r.abort(y instanceof B ? y : new Ce(y instanceof Error ? y.message : y));
2512
- }
2513
- };
2514
- let a = t && setTimeout(() => {
2515
- a = null, s(new B(`timeout ${t} of ms exceeded`, B.ETIMEDOUT));
2516
- }, t);
2517
- const l = () => {
2518
- e && (a && clearTimeout(a), a = null, e.forEach((i) => {
2519
- i.unsubscribe ? i.unsubscribe(s) : i.removeEventListener("abort", s);
2520
- }), e = null);
2521
- };
2522
- e.forEach((i) => i.addEventListener("abort", s));
2523
- const { signal: d } = r;
2524
- return d.unsubscribe = () => f.asap(l), d;
2525
- }
2526
- }, ds = function* (e, t) {
2527
- let n = e.byteLength;
2528
- if (n < t) {
2529
- yield e;
2530
- return;
2531
- }
2532
- let r = 0, o;
2533
- for (; r < n; )
2534
- o = r + t, yield e.slice(r, o), r = o;
2535
- }, hs = async function* (e, t) {
2536
- for await (const n of ms(e))
2537
- yield* ds(n, t);
2538
- }, ms = async function* (e) {
2539
- if (e[Symbol.asyncIterator]) {
2540
- yield* e;
2541
- return;
2542
- }
2543
- const t = e.getReader();
2544
- try {
2545
- for (; ; ) {
2546
- const { done: n, value: r } = await t.read();
2547
- if (n)
2548
- break;
2549
- yield r;
2550
- }
2551
- } finally {
2552
- await t.cancel();
2553
- }
2554
- }, Kt = (e, t, n, r) => {
2555
- const o = hs(e, t);
2556
- let s = 0, a, l = (d) => {
2557
- a || (a = !0, r && r(d));
2558
- };
2559
- return new ReadableStream({
2560
- async pull(d) {
2561
- try {
2562
- const { done: i, value: y } = await o.next();
2563
- if (i) {
2564
- l(), d.close();
2565
- return;
2566
- }
2567
- let c = y.byteLength;
2568
- if (n) {
2569
- let T = s += c;
2570
- n(T);
2571
- }
2572
- d.enqueue(new Uint8Array(y));
2573
- } catch (i) {
2574
- throw l(i), i;
2575
- }
2576
- },
2577
- cancel(d) {
2578
- return l(d), o.return();
2579
- }
2580
- }, {
2581
- highWaterMark: 2
2582
- });
2583
- }, at = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Dn = at && typeof ReadableStream == "function", ys = at && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Fn = (e, ...t) => {
2584
- try {
2585
- return !!e(...t);
2586
- } catch {
2587
- return !1;
2588
- }
2589
- }, bs = Dn && Fn(() => {
2590
- let e = !1;
2591
- const t = new Request(ee.origin, {
2592
- body: new ReadableStream(),
2593
- method: "POST",
2594
- get duplex() {
2595
- return e = !0, "half";
2596
- }
2597
- }).headers.has("Content-Type");
2598
- return e && !t;
2599
- }), Gt = 64 * 1024, yt = Dn && Fn(() => f.isReadableStream(new Response("").body)), Ge = {
2600
- stream: yt && ((e) => e.body)
2601
- };
2602
- at && ((e) => {
2603
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
2604
- !Ge[t] && (Ge[t] = f.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
2605
- throw new B(`Response type '${t}' is not supported`, B.ERR_NOT_SUPPORT, r);
2606
- });
2607
- });
2608
- })(new Response());
2609
- const gs = async (e) => {
2610
- if (e == null)
2611
- return 0;
2612
- if (f.isBlob(e))
2613
- return e.size;
2614
- if (f.isSpecCompliantForm(e))
2615
- return (await new Request(ee.origin, {
2616
- method: "POST",
2617
- body: e
2618
- }).arrayBuffer()).byteLength;
2619
- if (f.isArrayBufferView(e) || f.isArrayBuffer(e))
2620
- return e.byteLength;
2621
- if (f.isURLSearchParams(e) && (e = e + ""), f.isString(e))
2622
- return (await ys(e)).byteLength;
2623
- }, vs = async (e, t) => {
2624
- const n = f.toFiniteNumber(e.getContentLength());
2625
- return n ?? gs(t);
2626
- }, ks = at && (async (e) => {
2627
- let {
2628
- url: t,
2629
- method: n,
2630
- data: r,
2631
- signal: o,
2632
- cancelToken: s,
2633
- timeout: a,
2634
- onDownloadProgress: l,
2635
- onUploadProgress: d,
2636
- responseType: i,
2637
- headers: y,
2638
- withCredentials: c = "same-origin",
2639
- fetchOptions: T
2640
- } = xn(e);
2641
- i = i ? (i + "").toLowerCase() : "text";
2642
- let w = ps([o, s && s.toAbortSignal()], a), g;
2643
- const C = w && w.unsubscribe && (() => {
2644
- w.unsubscribe();
2645
- });
2646
- let p;
2647
- try {
2648
- if (d && bs && n !== "get" && n !== "head" && (p = await vs(y, r)) !== 0) {
2649
- let m = new Request(t, {
2650
- method: "POST",
2651
- body: r,
2652
- duplex: "half"
2653
- }), E;
2654
- if (f.isFormData(r) && (E = m.headers.get("content-type")) && y.setContentType(E), m.body) {
2655
- const [S, D] = It(
2656
- p,
2657
- Ke(Vt(d))
2658
- );
2659
- r = Kt(m.body, Gt, S, D);
2660
- }
2661
- }
2662
- f.isString(c) || (c = c ? "include" : "omit");
2663
- const h = "credentials" in Request.prototype;
2664
- g = new Request(t, {
2665
- ...T,
2666
- signal: w,
2667
- method: n.toUpperCase(),
2668
- headers: y.normalize().toJSON(),
2669
- body: r,
2670
- duplex: "half",
2671
- credentials: h ? c : void 0
2672
- });
2673
- let u = await fetch(g);
2674
- const R = yt && (i === "stream" || i === "response");
2675
- if (yt && (l || R && C)) {
2676
- const m = {};
2677
- ["status", "statusText", "headers"].forEach((N) => {
2678
- m[N] = u[N];
2679
- });
2680
- const E = f.toFiniteNumber(u.headers.get("content-length")), [S, D] = l && It(
2681
- E,
2682
- Ke(Vt(l), !0)
2683
- ) || [];
2684
- u = new Response(
2685
- Kt(u.body, Gt, S, () => {
2686
- D && D(), C && C();
2687
- }),
2688
- m
2689
- );
2690
- }
2691
- i = i || "text";
2692
- let b = await Ge[f.findKey(Ge, i) || "text"](u, e);
2693
- return !R && C && C(), await new Promise((m, E) => {
2694
- Cn(m, E, {
2695
- data: b,
2696
- headers: se.from(u.headers),
2697
- status: u.status,
2698
- statusText: u.statusText,
2699
- config: e,
2700
- request: g
2701
- });
2702
- });
2703
- } catch (h) {
2704
- throw C && C(), h && h.name === "TypeError" && /Load failed|fetch/i.test(h.message) ? Object.assign(
2705
- new B("Network Error", B.ERR_NETWORK, e, g),
2706
- {
2707
- cause: h.cause || h
2708
- }
2709
- ) : B.from(h, h && h.code, e, g);
2710
- }
2711
- }), bt = {
2712
- http: Uo,
2713
- xhr: fs,
2714
- fetch: ks
2715
- };
2716
- f.forEach(bt, (e, t) => {
2717
- if (e) {
2718
- try {
2719
- Object.defineProperty(e, "name", { value: t });
2720
- } catch {
2721
- }
2722
- Object.defineProperty(e, "adapterName", { value: t });
2723
- }
2724
- });
2725
- const Xt = (e) => `- ${e}`, Es = (e) => f.isFunction(e) || e === null || e === !1, Nn = {
2726
- getAdapter: (e) => {
2727
- e = f.isArray(e) ? e : [e];
2728
- const { length: t } = e;
2729
- let n, r;
2730
- const o = {};
2731
- for (let s = 0; s < t; s++) {
2732
- n = e[s];
2733
- let a;
2734
- if (r = n, !Es(n) && (r = bt[(a = String(n)).toLowerCase()], r === void 0))
2735
- throw new B(`Unknown adapter '${a}'`);
2736
- if (r)
2737
- break;
2738
- o[a || "#" + s] = r;
2739
- }
2740
- if (!r) {
2741
- const s = Object.entries(o).map(
2742
- ([l, d]) => `adapter ${l} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
2743
- );
2744
- let a = t ? s.length > 1 ? `since :
2745
- ` + s.map(Xt).join(`
2746
- `) : " " + Xt(s[0]) : "as no adapter specified";
2747
- throw new B(
2748
- "There is no suitable adapter to dispatch the request " + a,
2749
- "ERR_NOT_SUPPORT"
2750
- );
2751
- }
2752
- return r;
2753
- },
2754
- adapters: bt
2755
- };
2756
- function pt(e) {
2757
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
2758
- throw new Ce(null, e);
2759
- }
2760
- function Zt(e) {
2761
- return pt(e), e.headers = se.from(e.headers), e.data = ft.call(
2762
- e,
2763
- e.transformRequest
2764
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Nn.getAdapter(e.adapter || Le.adapter)(e).then(function(r) {
2765
- return pt(e), r.data = ft.call(
2766
- e,
2767
- e.transformResponse,
2768
- r
2769
- ), r.headers = se.from(r.headers), r;
2770
- }, function(r) {
2771
- return An(r) || (pt(e), r && r.response && (r.response.data = ft.call(
2772
- e,
2773
- e.transformResponse,
2774
- r.response
2775
- ), r.response.headers = se.from(r.response.headers))), Promise.reject(r);
2776
- });
2777
- }
2778
- const Pn = "1.9.0", lt = {};
2779
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
2780
- lt[e] = function(r) {
2781
- return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
2782
- };
2783
- });
2784
- const Qt = {};
2785
- lt.transitional = function(t, n, r) {
2786
- function o(s, a) {
2787
- return "[Axios v" + Pn + "] Transitional option '" + s + "'" + a + (r ? ". " + r : "");
2788
- }
2789
- return (s, a, l) => {
2790
- if (t === !1)
2791
- throw new B(
2792
- o(a, " has been removed" + (n ? " in " + n : "")),
2793
- B.ERR_DEPRECATED
2794
- );
2795
- return n && !Qt[a] && (Qt[a] = !0, console.warn(
2796
- o(
2797
- a,
2798
- " has been deprecated since v" + n + " and will be removed in the near future"
2799
- )
2800
- )), t ? t(s, a, l) : !0;
2801
- };
2802
- };
2803
- lt.spelling = function(t) {
2804
- return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
2805
- };
2806
- function Ss(e, t, n) {
2807
- if (typeof e != "object")
2808
- throw new B("options must be an object", B.ERR_BAD_OPTION_VALUE);
2809
- const r = Object.keys(e);
2810
- let o = r.length;
2811
- for (; o-- > 0; ) {
2812
- const s = r[o], a = t[s];
2813
- if (a) {
2814
- const l = e[s], d = l === void 0 || a(l, s, e);
2815
- if (d !== !0)
2816
- throw new B("option " + s + " must be " + d, B.ERR_BAD_OPTION_VALUE);
2817
- continue;
2818
- }
2819
- if (n !== !0)
2820
- throw new B("Unknown option " + s, B.ERR_BAD_OPTION);
2821
- }
2822
- }
2823
- const Ve = {
2824
- assertOptions: Ss,
2825
- validators: lt
2826
- }, pe = Ve.validators;
2827
- let ve = class {
2828
- constructor(t) {
2829
- this.defaults = t || {}, this.interceptors = {
2830
- request: new zt(),
2831
- response: new zt()
2832
- };
2833
- }
2834
- /**
2835
- * Dispatch a request
2836
- *
2837
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2838
- * @param {?Object} config
2839
- *
2840
- * @returns {Promise} The Promise to be fulfilled
2841
- */
2842
- async request(t, n) {
2843
- try {
2844
- return await this._request(t, n);
2845
- } catch (r) {
2846
- if (r instanceof Error) {
2847
- let o = {};
2848
- Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
2849
- const s = o.stack ? o.stack.replace(/^.+\n/, "") : "";
2850
- try {
2851
- r.stack ? s && !String(r.stack).endsWith(s.replace(/^.+\n.+\n/, "")) && (r.stack += `
2852
- ` + s) : r.stack = s;
2853
- } catch {
2854
- }
2855
- }
2856
- throw r;
2857
- }
2858
- }
2859
- _request(t, n) {
2860
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = Se(this.defaults, n);
2861
- const { transitional: r, paramsSerializer: o, headers: s } = n;
2862
- r !== void 0 && Ve.assertOptions(r, {
2863
- silentJSONParsing: pe.transitional(pe.boolean),
2864
- forcedJSONParsing: pe.transitional(pe.boolean),
2865
- clarifyTimeoutError: pe.transitional(pe.boolean)
2866
- }, !1), o != null && (f.isFunction(o) ? n.paramsSerializer = {
2867
- serialize: o
2868
- } : Ve.assertOptions(o, {
2869
- encode: pe.function,
2870
- serialize: pe.function
2871
- }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Ve.assertOptions(n, {
2872
- baseUrl: pe.spelling("baseURL"),
2873
- withXsrfToken: pe.spelling("withXSRFToken")
2874
- }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
2875
- let a = s && f.merge(
2876
- s.common,
2877
- s[n.method]
2878
- );
2879
- s && f.forEach(
2880
- ["delete", "get", "head", "post", "put", "patch", "common"],
2881
- (g) => {
2882
- delete s[g];
2883
- }
2884
- ), n.headers = se.concat(a, s);
2885
- const l = [];
2886
- let d = !0;
2887
- this.interceptors.request.forEach(function(C) {
2888
- typeof C.runWhen == "function" && C.runWhen(n) === !1 || (d = d && C.synchronous, l.unshift(C.fulfilled, C.rejected));
2889
- });
2890
- const i = [];
2891
- this.interceptors.response.forEach(function(C) {
2892
- i.push(C.fulfilled, C.rejected);
2893
- });
2894
- let y, c = 0, T;
2895
- if (!d) {
2896
- const g = [Zt.bind(this), void 0];
2897
- for (g.unshift.apply(g, l), g.push.apply(g, i), T = g.length, y = Promise.resolve(n); c < T; )
2898
- y = y.then(g[c++], g[c++]);
2899
- return y;
2900
- }
2901
- T = l.length;
2902
- let w = n;
2903
- for (c = 0; c < T; ) {
2904
- const g = l[c++], C = l[c++];
2905
- try {
2906
- w = g(w);
2907
- } catch (p) {
2908
- C.call(this, p);
2909
- break;
2910
- }
2911
- }
2912
- try {
2913
- y = Zt.call(this, w);
2914
- } catch (g) {
2915
- return Promise.reject(g);
2916
- }
2917
- for (c = 0, T = i.length; c < T; )
2918
- y = y.then(i[c++], i[c++]);
2919
- return y;
2920
- }
2921
- getUri(t) {
2922
- t = Se(this.defaults, t);
2923
- const n = _n(t.baseURL, t.url, t.allowAbsoluteUrls);
2924
- return wn(n, t.params, t.paramsSerializer);
2925
- }
2926
- };
2927
- f.forEach(["delete", "get", "head", "options"], function(t) {
2928
- ve.prototype[t] = function(n, r) {
2929
- return this.request(Se(r || {}, {
2930
- method: t,
2931
- url: n,
2932
- data: (r || {}).data
2933
- }));
2934
- };
2935
- });
2936
- f.forEach(["post", "put", "patch"], function(t) {
2937
- function n(r) {
2938
- return function(s, a, l) {
2939
- return this.request(Se(l || {}, {
2940
- method: t,
2941
- headers: r ? {
2942
- "Content-Type": "multipart/form-data"
2943
- } : {},
2944
- url: s,
2945
- data: a
2946
- }));
2947
- };
2948
- }
2949
- ve.prototype[t] = n(), ve.prototype[t + "Form"] = n(!0);
2950
- });
2951
- let Rs = class Un {
2952
- constructor(t) {
2953
- if (typeof t != "function")
2954
- throw new TypeError("executor must be a function.");
2955
- let n;
2956
- this.promise = new Promise(function(s) {
2957
- n = s;
2958
- });
2959
- const r = this;
2960
- this.promise.then((o) => {
2961
- if (!r._listeners) return;
2962
- let s = r._listeners.length;
2963
- for (; s-- > 0; )
2964
- r._listeners[s](o);
2965
- r._listeners = null;
2966
- }), this.promise.then = (o) => {
2967
- let s;
2968
- const a = new Promise((l) => {
2969
- r.subscribe(l), s = l;
2970
- }).then(o);
2971
- return a.cancel = function() {
2972
- r.unsubscribe(s);
2973
- }, a;
2974
- }, t(function(s, a, l) {
2975
- r.reason || (r.reason = new Ce(s, a, l), n(r.reason));
2976
- });
2977
- }
2978
- /**
2979
- * Throws a `CanceledError` if cancellation has been requested.
2980
- */
2981
- throwIfRequested() {
2982
- if (this.reason)
2983
- throw this.reason;
2984
- }
2985
- /**
2986
- * Subscribe to the cancel signal
2987
- */
2988
- subscribe(t) {
2989
- if (this.reason) {
2990
- t(this.reason);
2991
- return;
2992
- }
2993
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
2994
- }
2995
- /**
2996
- * Unsubscribe from the cancel signal
2997
- */
2998
- unsubscribe(t) {
2999
- if (!this._listeners)
3000
- return;
3001
- const n = this._listeners.indexOf(t);
3002
- n !== -1 && this._listeners.splice(n, 1);
3003
- }
3004
- toAbortSignal() {
3005
- const t = new AbortController(), n = (r) => {
3006
- t.abort(r);
3007
- };
3008
- return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
3009
- }
3010
- /**
3011
- * Returns an object that contains a new `CancelToken` and a function that, when called,
3012
- * cancels the `CancelToken`.
3013
- */
3014
- static source() {
3015
- let t;
3016
- return {
3017
- token: new Un(function(o) {
3018
- t = o;
3019
- }),
3020
- cancel: t
3021
- };
3022
- }
3023
- };
3024
- function ws(e) {
3025
- return function(n) {
3026
- return e.apply(null, n);
3027
- };
3028
- }
3029
- function Os(e) {
3030
- return f.isObject(e) && e.isAxiosError === !0;
3031
- }
3032
- const gt = {
3033
- Continue: 100,
3034
- SwitchingProtocols: 101,
3035
- Processing: 102,
3036
- EarlyHints: 103,
3037
- Ok: 200,
3038
- Created: 201,
3039
- Accepted: 202,
3040
- NonAuthoritativeInformation: 203,
3041
- NoContent: 204,
3042
- ResetContent: 205,
3043
- PartialContent: 206,
3044
- MultiStatus: 207,
3045
- AlreadyReported: 208,
3046
- ImUsed: 226,
3047
- MultipleChoices: 300,
3048
- MovedPermanently: 301,
3049
- Found: 302,
3050
- SeeOther: 303,
3051
- NotModified: 304,
3052
- UseProxy: 305,
3053
- Unused: 306,
3054
- TemporaryRedirect: 307,
3055
- PermanentRedirect: 308,
3056
- BadRequest: 400,
3057
- Unauthorized: 401,
3058
- PaymentRequired: 402,
3059
- Forbidden: 403,
3060
- NotFound: 404,
3061
- MethodNotAllowed: 405,
3062
- NotAcceptable: 406,
3063
- ProxyAuthenticationRequired: 407,
3064
- RequestTimeout: 408,
3065
- Conflict: 409,
3066
- Gone: 410,
3067
- LengthRequired: 411,
3068
- PreconditionFailed: 412,
3069
- PayloadTooLarge: 413,
3070
- UriTooLong: 414,
3071
- UnsupportedMediaType: 415,
3072
- RangeNotSatisfiable: 416,
3073
- ExpectationFailed: 417,
3074
- ImATeapot: 418,
3075
- MisdirectedRequest: 421,
3076
- UnprocessableEntity: 422,
3077
- Locked: 423,
3078
- FailedDependency: 424,
3079
- TooEarly: 425,
3080
- UpgradeRequired: 426,
3081
- PreconditionRequired: 428,
3082
- TooManyRequests: 429,
3083
- RequestHeaderFieldsTooLarge: 431,
3084
- UnavailableForLegalReasons: 451,
3085
- InternalServerError: 500,
3086
- NotImplemented: 501,
3087
- BadGateway: 502,
3088
- ServiceUnavailable: 503,
3089
- GatewayTimeout: 504,
3090
- HttpVersionNotSupported: 505,
3091
- VariantAlsoNegotiates: 506,
3092
- InsufficientStorage: 507,
3093
- LoopDetected: 508,
3094
- NotExtended: 510,
3095
- NetworkAuthenticationRequired: 511
3096
- };
3097
- Object.entries(gt).forEach(([e, t]) => {
3098
- gt[t] = e;
3099
- });
3100
- function Bn(e) {
3101
- const t = new ve(e), n = pn(ve.prototype.request, t);
3102
- return f.extend(n, ve.prototype, t, { allOwnKeys: !0 }), f.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
3103
- return Bn(Se(e, o));
3104
- }, n;
3105
- }
3106
- const G = Bn(Le);
3107
- G.Axios = ve;
3108
- G.CanceledError = Ce;
3109
- G.CancelToken = Rs;
3110
- G.isCancel = An;
3111
- G.VERSION = Pn;
3112
- G.toFormData = st;
3113
- G.AxiosError = B;
3114
- G.Cancel = G.CanceledError;
3115
- G.all = function(t) {
3116
- return Promise.all(t);
3117
- };
3118
- G.spread = ws;
3119
- G.isAxiosError = Os;
3120
- G.mergeConfig = Se;
3121
- G.AxiosHeaders = se;
3122
- G.formToJSON = (e) => Tn(f.isHTMLForm(e) ? new FormData(e) : e);
3123
- G.getAdapter = Nn.getAdapter;
3124
- G.HttpStatusCode = gt;
3125
- G.default = G;
3126
- const {
3127
- Axios: Is,
3128
- AxiosError: Vs,
3129
- CanceledError: Ws,
3130
- isCancel: Ks,
3131
- CancelToken: Gs,
3132
- VERSION: Xs,
3133
- all: Zs,
3134
- Cancel: Qs,
3135
- isAxiosError: Ys,
3136
- spread: ea,
3137
- toFormData: ta,
3138
- AxiosHeaders: na,
3139
- HttpStatusCode: ra,
3140
- formToJSON: oa,
3141
- getAdapter: sa,
3142
- mergeConfig: aa
3143
- } = G;
3144
- /*! js-cookie v3.0.5 | MIT */
3145
- function Me(e) {
3146
- for (var t = 1; t < arguments.length; t++) {
3147
- var n = arguments[t];
3148
- for (var r in n)
3149
- e[r] = n[r];
3150
- }
3151
- return e;
3152
- }
3153
- var Ts = {
3154
- read: function(e) {
3155
- return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
3156
- },
3157
- write: function(e) {
3158
- return encodeURIComponent(e).replace(
3159
- /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
3160
- decodeURIComponent
3161
- );
3162
- }
3163
- };
3164
- function vt(e, t) {
3165
- function n(o, s, a) {
3166
- if (!(typeof document > "u")) {
3167
- a = Me({}, t, a), typeof a.expires == "number" && (a.expires = new Date(Date.now() + a.expires * 864e5)), a.expires && (a.expires = a.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
3168
- var l = "";
3169
- for (var d in a)
3170
- a[d] && (l += "; " + d, a[d] !== !0 && (l += "=" + a[d].split(";")[0]));
3171
- return document.cookie = o + "=" + e.write(s, o) + l;
3172
- }
3173
- }
3174
- function r(o) {
3175
- if (!(typeof document > "u" || arguments.length && !o)) {
3176
- for (var s = document.cookie ? document.cookie.split("; ") : [], a = {}, l = 0; l < s.length; l++) {
3177
- var d = s[l].split("="), i = d.slice(1).join("=");
3178
- try {
3179
- var y = decodeURIComponent(d[0]);
3180
- if (a[y] = e.read(i, y), o === y)
3181
- break;
3182
- } catch {
3183
- }
3184
- }
3185
- return o ? a[o] : a;
3186
- }
3187
- }
3188
- return Object.create(
3189
- {
3190
- set: n,
3191
- get: r,
3192
- remove: function(o, s) {
3193
- n(
3194
- o,
3195
- "",
3196
- Me({}, s, {
3197
- expires: -1
3198
- })
3199
- );
3200
- },
3201
- withAttributes: function(o) {
3202
- return vt(this.converter, Me({}, this.attributes, o));
3203
- },
3204
- withConverter: function(o) {
3205
- return vt(Me({}, this.converter, o), this.attributes);
3206
- }
3207
- },
3208
- {
3209
- attributes: { value: Object.freeze(t) },
3210
- converter: { value: Object.freeze(e) }
3211
- }
3212
- );
3213
- }
3214
- vt(Ts, { path: "/" });
3215
- const ke = {
3216
- // 查看 v2.4.3版本更新日志
3217
- setKey(e) {
3218
- return `ss-component-new:${e}`;
3219
- },
3220
- // 设置永久缓存
3221
- set(e, t) {
3222
- window.localStorage.setItem(ke.setKey(e), JSON.stringify(t));
3223
- },
3224
- // 获取永久缓存
3225
- get(e) {
3226
- let t = window.localStorage.getItem(ke.setKey(e));
3227
- return JSON.parse(t);
3228
- },
3229
- // 移除永久缓存
3230
- remove(e) {
3231
- window.localStorage.removeItem(ke.setKey(e));
3232
- },
3233
- // 移除全部永久缓存
3234
- clear() {
3235
- window.localStorage.clear();
3236
- }
3237
- }, jn = /* @__PURE__ */ new Map();
3238
- console.log("import.meta.env.VITE_API_URL", "http://139.196.154.85:20013");
3239
- const $n = G.create({
3240
- baseURL: "http://139.196.154.85:20013",
3241
- timeout: 5e4
3242
- //headers: { 'Content-Type': 'application/json' }, 这个会导致生成代码的上传文件 file为空
3243
- }), Xe = "access-token", kt = `x-${Xe}`;
3244
- $n.interceptors.request.use(
3245
- (e) => {
3246
- var o;
3247
- const t = new AbortController();
3248
- e.signal = t.signal;
3249
- const n = e.url || "";
3250
- jn.set(n, t);
3251
- const r = ke.get(Xe);
3252
- if (r) {
3253
- e.headers.Authorization = `Bearer ${r}`;
3254
- const s = Cs(r), a = _s(s.exp);
3255
- if (/* @__PURE__ */ new Date() >= a) {
3256
- const l = ke.get(kt);
3257
- l && (e.headers["X-Authorization"] = `Bearer ${l}`);
3258
- }
3259
- if (((o = e.method) == null ? void 0 : o.toLowerCase()) === "get" && e.data) {
3260
- let l = e.url + "?" + As(e.data);
3261
- l = l.slice(0, -1), e.data = {}, e.url = l;
3262
- }
3263
- }
3264
- return e;
3265
- },
3266
- (e) => Promise.reject(e)
3267
- );
3268
- $n.interceptors.response.use(
3269
- (e) => {
3270
- const t = e.config.url || "";
3271
- jn.delete(t);
3272
- var n = e.status, r = e.data;
3273
- if (n === 401)
3274
- throw new Error(e.statusText || "Request Error.");
3275
- if (n >= 400)
3276
- throw new Error(e.statusText || "Request Error.");
3277
- if (r && r.hasOwnProperty("errors") && r.errors)
3278
- throw new Error(JSON.stringify(r.errors || "Request Error."));
3279
- var o = e.headers[Xe], s = e.headers[kt];
3280
- if (o === "invalid_token")
3281
- throw new Error(e.statusText || "Request Error.");
3282
- if (s && o && (ke.set(Xe, o), ke.set(kt, s)), r.code === 401)
3283
- throw new Error(e.statusText || "Request Error.");
3284
- if (r.code === void 0)
3285
- return Promise.resolve(e);
3286
- if (r.code !== 200) {
3287
- var a;
3288
- throw r.message && typeof r.message == "object" ? a = JSON.stringify(r.message) : a = r.message, Fe({
3289
- dangerouslyUseHTMLString: !0,
3290
- message: a,
3291
- type: "error"
3292
- }), new Error(a);
3293
- }
3294
- return e;
3295
- },
3296
- (e) => {
3297
- var t, n;
3298
- if (e.response && e.response.status === 401)
3299
- throw new Error(res.statusText || "Request Error.");
3300
- return e.message.indexOf("timeout") != -1 ? Fe.error("网络超时") : e.message == "Network Error" ? Fe.error("网络连接错误") : (t = e.response) != null && t.data ? Fe.error((n = e.response) == null ? void 0 : n.statusText) : Fe.error("接口路径找不到"), Promise.reject(e);
3301
- }
3302
- );
3303
- function As(e) {
3304
- let t = "";
3305
- for (const o of Object.keys(e)) {
3306
- const s = e[o];
3307
- var n = encodeURIComponent(o) + "=";
3308
- if (s !== null && s !== "" && typeof s < "u")
3309
- if (typeof s == "object") {
3310
- for (const a of Object.keys(s))
3311
- if (s[a] !== null && s[a] !== "" && typeof s[a] < "u") {
3312
- let l = o + "[" + a + "]";
3313
- var r = encodeURIComponent(l) + "=";
3314
- t += r + encodeURIComponent(s[a]) + "&";
3315
- }
3316
- } else
3317
- t += n + encodeURIComponent(s) + "&";
3318
- }
3319
- return t;
3320
- }
3321
- function Cs(e) {
3322
- e = e.replace(/_/g, "/").replace(/-/g, "+");
3323
- var t = decodeURIComponent(escape(window.atob(e.split(".")[1])));
3324
- return JSON.parse(t);
3325
- }
3326
- function _s(e) {
3327
- return new Date(e * 1e3);
3328
- }
3329
- const xs = Ye(he), { itemData: la } = Ee(xs), Ds = In(he), { systemKey: ia, activeMenuPath: ca } = Ee(Ds), Pe = U(0), ua = (e) => e.reduce((n, r) => {
3330
- var s, a;
3331
- const o = Object.values(n);
3332
- return (((s = Object.keys(n)) == null ? void 0 : s.length) === 0 || o[o.length - 1].length >= (r == null ? void 0 : r.width)) && (n[Pe.value] = [], Pe.value++), n[Pe.value - 1].push(r), ((a = Object.keys(n)) == null ? void 0 : a.length) === (r == null ? void 0 : r.width) && (n[Pe.value] = [], Pe.value++), n;
3333
- }, {});
3334
- export {
3335
- qs as a,
3336
- Ls as b,
3337
- ua as c,
3338
- te as d,
3339
- Js as e,
3340
- Xn as f,
3341
- ln as g,
3342
- Ms as i,
3343
- $s as m,
3344
- he as p,
3345
- nn as u,
3346
- ne as v
3347
- };