ss-component-new 1.1.19 → 1.1.21

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