ss-component-new 1.1.32 → 1.1.34

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