halo-fe 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/main.js CHANGED
@@ -1,21 +1,105 @@
1
- import { defineAsyncComponent as qt } from "vue";
2
- import { _ as At } from "./vendor-underscore.string-vrHhfBaT.js";
3
- import { _ as lt } from "./vendor-underscore-DVTek3G4.js";
4
- import { F as $t } from "./vendor-file-saver-DKXzEV2Q.js";
5
- import { b as Ut } from "./vendor-clone-NGbTzSwJ.js";
6
- import { l as Lt } from "./vendor-@monaco-editor-DKC4UNw_.js";
7
- import { h as E } from "./vendor-moment-h96o7c8I.js";
8
- import { d as L } from "./vendor-pinia-DVLspbiC.js";
9
- import { C as P } from "./vendor-crypto-js-B6Qe-gIg.js";
10
- import { a as Nt, A as Rt } from "./vendor-axios-ud9O0vdJ.js";
11
- import { utils as it, writeFile as Dt } from "xlsx-js-style";
12
- const B = class B {
1
+ import { C as z } from "./vendor-crypto-js-B6Qe-gIg.js";
2
+ import { defineAsyncComponent as jt } from "vue";
3
+ import { _ as Bt } from "./vendor-underscore.string-vrHhfBaT.js";
4
+ import { _ as rt } from "./vendor-underscore-DVTek3G4.js";
5
+ import { F as At } from "./vendor-file-saver-DKXzEV2Q.js";
6
+ import { b as qt } from "./vendor-clone-NGbTzSwJ.js";
7
+ import { l as Ut } from "./vendor-@monaco-editor-DKC4UNw_.js";
8
+ import { h as I } from "./vendor-moment-h96o7c8I.js";
9
+ import { d as P } from "./vendor-pinia-DVLspbiC.js";
10
+ import { a as Lt, A as Nt } from "./vendor-axios-ud9O0vdJ.js";
11
+ import { utils as nt, writeFile as $t } from "xlsx-js-style";
12
+ class Pt {
13
+ }
14
+ class ht {
15
+ post(t, e) {
16
+ let s = new Pt();
17
+ return s.path = t, s.method = "POST", s.body = e, this.send(s);
18
+ }
19
+ }
20
+ class Ft extends ht {
21
+ constructor() {
22
+ super(...arguments), this.type = "Default";
23
+ }
24
+ open(t) {
25
+ }
26
+ send(t) {
27
+ return new Promise((e, s) => {
28
+ let r = (/* @__PURE__ */ new Date()).getTime(), n = new XMLHttpRequest();
29
+ if (n.open(t.method, t.url), t.headers != null)
30
+ for (let l of t.headers)
31
+ n.setRequestHeader(l, t.headers[l]);
32
+ t.contentType != null && n.setRequestHeader("content-type", t.contentType), n.onreadystatechange = () => {
33
+ if (n.readyState == 4) {
34
+ let i = { elapsed: (/* @__PURE__ */ new Date()).getTime() - r, body: n.responseText, request: t };
35
+ e(i);
36
+ }
37
+ }, n.onerror = (l) => {
38
+ let a = { elapsed: (/* @__PURE__ */ new Date()).getTime() - r, body: n.responseText, request: t };
39
+ e(a);
40
+ }, n.send(t.body);
41
+ });
42
+ }
43
+ }
44
+ class Ct {
45
+ }
46
+ class Rt extends Ct {
47
+ constructor() {
48
+ super(...arguments), this.type = "Sha256";
49
+ }
50
+ open(t) {
51
+ }
52
+ async compute(t) {
53
+ let s = new TextEncoder().encode(t), r = await crypto.subtle.digest("SHA-256", s);
54
+ return Array.from(new Uint8Array(r)).map((i) => i.toString(16).padStart(2, "0")).join("");
55
+ }
56
+ }
57
+ class Dt extends Ct {
58
+ constructor() {
59
+ super(...arguments), this.type = "Md5";
60
+ }
61
+ open(t) {
62
+ }
63
+ compute(t) {
64
+ let e = z.MD5(t).toString();
65
+ return Promise.resolve(e);
66
+ }
67
+ }
68
+ class E {
69
+ /**
70
+ * 创建指定类型驱动
71
+ */
72
+ create(t, e) {
73
+ if (!t)
74
+ throw new Error("驱动类型不能为空");
75
+ let r = this.getInstances().find((n) => n.type.toLowerCase() == t.toLowerCase());
76
+ if (r == null)
77
+ throw new Error(`未实现的驱动类型:${t}`);
78
+ return r;
79
+ }
80
+ }
81
+ class gt extends E {
82
+ getInstances() {
83
+ return [new Rt(), new Dt()];
84
+ }
85
+ create(t, e) {
86
+ let s = super.create(t);
87
+ return s.open(null), s;
88
+ }
89
+ /**
90
+ * 获取MD5 Hash对象
91
+ */
92
+ getMd5() {
93
+ return this.md5 != null ? this.md5 : (this.md5 = this.create("Md5"), this.md5);
94
+ }
95
+ }
96
+ const q = class q {
13
97
  };
14
- B.isString = (t) => Object.prototype.toString.call(t) == "[object String]", B.isObject = (t) => Object.prototype.toString.call(t) == "[object Object]", B.isArray = (t) => Object.prototype.toString.call(t) == "[object Array]", B.isNumber = (t) => {
98
+ q.isString = (t) => Object.prototype.toString.call(t) == "[object String]", q.isObject = (t) => Object.prototype.toString.call(t) == "[object Object]", q.isArray = (t) => Object.prototype.toString.call(t) == "[object Array]", q.isNumber = (t) => {
15
99
  let e = Object.prototype.toString.call(t);
16
100
  return e == "[object Number]" || e == "[object BigInt]";
17
- }, B.isBoolean = (t) => Object.prototype.toString.call(t) == "[object Boolean]";
18
- let y = B;
101
+ }, q.isBoolean = (t) => Object.prototype.toString.call(t) == "[object Boolean]";
102
+ let y = q;
19
103
  const h = class h {
20
104
  /**
21
105
  * 根据字符串或数组,自动返回数组
@@ -34,7 +118,7 @@ const h = class h {
34
118
  h.getUniqueId = () => {
35
119
  let t = Date.now().toString(36);
36
120
  return t += Math.random().toString(36).substring(2), t;
37
- }, h.padLeft = (t, e, s) => At.pad(t, e, s), h.trimStart = (t, e) => {
121
+ }, h.padLeft = (t, e, s) => Bt.pad(t, e, s), h.trimStart = (t, e) => {
38
122
  if (e == null)
39
123
  return t;
40
124
  let s = t.indexOf(e);
@@ -106,8 +190,8 @@ h.getUniqueId = () => {
106
190
  let n = r + e.length, l = t.substring(n), i = l.indexOf(s);
107
191
  return i == -1 ? null : l.substring(0, i);
108
192
  };
109
- let S = h;
110
- class $e {
193
+ let C = h;
194
+ class qe {
111
195
  /**
112
196
  * 根据动态加载的组件对象,得到组件集合
113
197
  */
@@ -117,27 +201,27 @@ class $e {
117
201
  return r;
118
202
  for (let l = 0; l < n.length; l++) {
119
203
  const i = n[l];
120
- let u = S.trim(i, e, ".vue"), c = (s ? s + "-" : "") + S.getDashName(u), g = t[i];
204
+ let a = C.trim(i, e, ".vue"), c = (s ? s + "-" : "") + C.getDashName(a), g = t[i];
121
205
  if (g.default)
122
206
  r[c] = g.default;
123
207
  else {
124
- let p = qt(g);
208
+ let p = jt(g);
125
209
  r[c] = p;
126
210
  }
127
211
  }
128
212
  return r;
129
213
  }
130
214
  }
131
- const d = class d {
215
+ const f = class f {
132
216
  };
133
- d.getChunks = (t, e) => {
217
+ f.getChunks = (t, e) => {
134
218
  let s = [];
135
219
  for (let r = 0; r < t.length; r += e) {
136
220
  let n = t.slice(r, r + e);
137
221
  s.push(n);
138
222
  }
139
223
  return s;
140
- }, d.intersect = (t, e) => t.filter((r) => e.indexOf(r) > -1), d.except = (t, e, s = null) => {
224
+ }, f.intersect = (t, e) => t.filter((r) => e.indexOf(r) > -1), f.except = (t, e, s = null) => {
141
225
  let r = e instanceof Array ? e : [e], n = [];
142
226
  if (s == null)
143
227
  n = t.filter((l) => r.indexOf(l) == -1);
@@ -147,7 +231,7 @@ d.getChunks = (t, e) => {
147
231
  r.find((o) => s(i, o)) || n.push(i);
148
232
  }
149
233
  return n;
150
- }, d.contains = (t, e) => t.indexOf(e) > -1, d.filterContains = (t, e, s) => {
234
+ }, f.contains = (t, e) => t.indexOf(e) > -1, f.filterContains = (t, e, s) => {
151
235
  let r = [];
152
236
  if (!s)
153
237
  return t;
@@ -155,12 +239,12 @@ d.getChunks = (t, e) => {
155
239
  let l = t[n];
156
240
  if (l)
157
241
  for (let i = 0; i < e.length; i++) {
158
- let u = e[i];
159
- l[u].toString().toUpperCase().includes(s.toUpperCase()) && r.push(l);
242
+ let a = e[i];
243
+ l[a].toString().toUpperCase().includes(s.toUpperCase()) && r.push(l);
160
244
  }
161
245
  }
162
246
  return r;
163
- }, d.same = (t, e) => {
247
+ }, f.same = (t, e) => {
164
248
  if (t.length != e.length)
165
249
  return !1;
166
250
  let s = t.length >= e.length ? t : e, r = t.length < e.length ? t : e;
@@ -168,77 +252,77 @@ d.getChunks = (t, e) => {
168
252
  if (s[n] != r[n])
169
253
  return !1;
170
254
  return !0;
171
- }, d.max = (t, e) => lt.max(t, e), d.min = (t, e) => lt.min(t, e), d.sum = (t, e, s = null) => {
255
+ }, f.max = (t, e) => rt.max(t, e), f.min = (t, e) => rt.min(t, e), f.sum = (t, e, s = null) => {
172
256
  let r = 0;
173
257
  for (let l = 0; l < t.length; l++)
174
258
  r += e(t[l]);
175
259
  return s == null ? r : parseFloat(r.toFixed(s));
176
- }, d.avg = (t, e, s = null) => {
177
- let n = d.sum(t, e) / t.length;
260
+ }, f.avg = (t, e, s = null) => {
261
+ let n = f.sum(t, e) / t.length;
178
262
  return s == null ? n : parseFloat(n.toFixed(s));
179
- }, d.distinct = (t, e) => {
263
+ }, f.distinct = (t, e) => {
180
264
  let s = new Set(t.map((n) => e(n)));
181
265
  return Array.from(s);
182
- }, d.pushIfNotExist = (t, e) => {
266
+ }, f.pushIfNotExist = (t, e) => {
183
267
  t.indexOf(e) == -1 && t.push(e);
184
- }, d.fromValues = (t, e, s, r) => {
268
+ }, f.fromValues = (t, e, s, r) => {
185
269
  if (!t || t.length == 0 || !e || e.length == 0)
186
270
  return [];
187
271
  let n = [];
188
272
  return t.forEach((l) => {
189
- let i = e.find((u) => u[s] == l);
273
+ let i = e.find((a) => a[s] == l);
190
274
  i || (i = { [s]: l, [r]: l }), n.push(i);
191
275
  }), n;
192
- }, d.removeIndex = (t, e, s) => {
276
+ }, f.removeIndex = (t, e, s) => {
193
277
  let r = t.split(s);
194
278
  return r.splice(e, 1), r.join(s);
195
- }, d.split = (t, e, s = null) => {
279
+ }, f.split = (t, e, s = null) => {
196
280
  let r = [];
197
281
  return t && (r = t.split(e)), s != null && r.push(s), r;
198
- }, d.combine = (...t) => {
199
- let e = [], s = lt.max(t, (r) => r.length);
282
+ }, f.combine = (...t) => {
283
+ let e = [], s = rt.max(t, (r) => r.length);
200
284
  for (let r = 0; r < s.length; r++) {
201
285
  let n = [], l;
202
286
  for (let i = 0; i < t.length; i++) {
203
- let u = t[i][r];
204
- u != null && (l = u);
287
+ let a = t[i][r];
288
+ a != null && (l = a);
205
289
  break;
206
290
  }
207
291
  for (let i = 0; i < t.length; i++) {
208
- let u = t[i][r];
209
- u != null ? n.push(u) : n.push(l);
292
+ let a = t[i][r];
293
+ a != null ? n.push(a) : n.push(l);
210
294
  }
211
295
  e.push(n);
212
296
  }
213
297
  return e;
214
- }, d.insert = (t, e, s) => {
298
+ }, f.insert = (t, e, s) => {
215
299
  let r = t.indexOf(e);
216
300
  return t.splice(r, 0, s), r;
217
- }, d.append = (t, e, s) => {
301
+ }, f.append = (t, e, s) => {
218
302
  let r = t.indexOf(e) + 1;
219
303
  return t.splice(r, 0, s), r;
220
- }, d.remove = (t, e) => {
304
+ }, f.remove = (t, e) => {
221
305
  if (y.isNumber(e))
222
306
  t.splice(e, 1);
223
307
  else if (y.isArray(e))
224
308
  for (let s = 0; s < e.length; s++)
225
- d.remove(t, e[s]);
309
+ f.remove(t, e[s]);
226
310
  else
227
311
  t.splice(t.indexOf(e), 1);
228
- }, d.orderBy = (t, e, s = !0) => {
312
+ }, f.orderBy = (t, e, s = !0) => {
229
313
  y.isArray(e) || (e = [e]);
230
314
  let r = t.sort((n, l) => {
231
315
  let i = e[0](n) - e[0](l);
232
316
  return i == 0 && e[1] ? e[1](n) - e[1](l) : i;
233
317
  });
234
318
  return s ? r.reverse() : r;
235
- }, d.groupByArray = (t, e) => {
319
+ }, f.groupByArray = (t, e) => {
236
320
  let s = [];
237
321
  return t.forEach((r) => {
238
322
  let n = e(r), l = s.find((i) => i.key == n);
239
323
  l == null && (l = { key: n, value: [] }, s.push(l)), l.value.push(r);
240
324
  }), s;
241
- }, d.groupBy = (t, e, s = null) => {
325
+ }, f.groupBy = (t, e, s = null) => {
242
326
  let r = {};
243
327
  return t.forEach((n) => {
244
328
  let l = e(n);
@@ -247,10 +331,10 @@ d.getChunks = (t, e) => {
247
331
  r[n] = s(r[n]);
248
332
  }), r;
249
333
  };
250
- let z = d;
334
+ let T = f;
251
335
  class Ue {
252
336
  }
253
- const T = class T {
337
+ const J = class J {
254
338
  /**
255
339
  * 根据字符串Ascii码得到固定颜色字典
256
340
  */
@@ -266,8 +350,8 @@ const T = class T {
266
350
  let n = t[r], l = 0;
267
351
  for (let g = 0; g < n.length; g++)
268
352
  l += n.charCodeAt(g);
269
- let i = l / s, u = 255 * i, o = 255 * (1 - i), c = 255 * (1 - i);
270
- e[n] = `rgb(${u}, ${o}, ${c})`;
353
+ let i = l / s, a = 255 * i, o = 255 * (1 - i), c = 255 * (1 - i);
354
+ e[n] = `rgb(${a}, ${o}, ${c})`;
271
355
  }
272
356
  return e;
273
357
  }
@@ -281,7 +365,7 @@ const T = class T {
281
365
  let e = "";
282
366
  for (let s = 0; s < t.length; s++) {
283
367
  let r = t[s];
284
- S.isNullOrEmpty(r) || (e += r, s != t.length - 1 && (e += " "));
368
+ C.isNullOrEmpty(r) || (e += r, s != t.length - 1 && (e += " "));
285
369
  }
286
370
  return e;
287
371
  }
@@ -390,13 +474,13 @@ const T = class T {
390
474
  let l = t.querySelector(s);
391
475
  if (!l)
392
476
  return null;
393
- let i = {}, u = t.getBoundingClientRect(), o = r.getBoundingClientRect(), g = t.querySelector(e).getBoundingClientRect(), p = l.getBoundingClientRect(), v = o.height - g.top;
477
+ let i = {}, a = t.getBoundingClientRect(), o = r.getBoundingClientRect(), g = t.querySelector(e).getBoundingClientRect(), p = l.getBoundingClientRect(), j = o.height - g.top;
394
478
  if (n == "right") {
395
- i.left = `${u.left + u.width}px`;
396
- let F;
397
- p.height > o.height ? F = o.height : F = p.height, i.height = `${F}px`, F + g.top > o.height ? (i.top = "initial", i.bottom = "0px") : i.top = `${u.top}px`;
479
+ i.left = `${a.left + a.width}px`;
480
+ let D;
481
+ p.height > o.height ? D = o.height : D = p.height, i.height = `${D}px`, D + g.top > o.height ? (i.top = "initial", i.bottom = "0px") : i.top = `${a.top}px`;
398
482
  } else if (n == "bottom")
399
- v -= g.height, i.left = `${u.left}px`, i.top = `${u.top + u.height}px`, v < p.height ? i.height = `${v}px` : i.height = `${p.height}px`;
483
+ j -= g.height, i.left = `${a.left}px`, i.top = `${a.top + a.height}px`, j < p.height ? i.height = `${j}px` : i.height = `${p.height}px`;
400
484
  else
401
485
  throw new Error(`暂未支持的position:${n}`);
402
486
  return i;
@@ -410,8 +494,8 @@ const T = class T {
410
494
  return 0;
411
495
  let s = [];
412
496
  for (let n = 0; n < e.length; n++) {
413
- let l = e[n], i = getComputedStyle(l), u = i.zIndex == "auto" ? 0 : i.zIndex;
414
- s.push(u);
497
+ let l = e[n], i = getComputedStyle(l), a = i.zIndex == "auto" ? 0 : i.zIndex;
498
+ s.push(a);
415
499
  }
416
500
  return Math.max(...s);
417
501
  }
@@ -457,7 +541,7 @@ const T = class T {
457
541
  }
458
542
  //#endregion
459
543
  };
460
- T.addClass = (t, e, s = null) => {
544
+ J.addClass = (t, e, s = null) => {
461
545
  let r;
462
546
  if (e == null || e == "") {
463
547
  if (s == null || s == "")
@@ -466,7 +550,7 @@ T.addClass = (t, e, s = null) => {
466
550
  } else
467
551
  r = e;
468
552
  t.classList.add(r);
469
- }, T.removeClass = (t, e, s = null) => {
553
+ }, J.removeClass = (t, e, s = null) => {
470
554
  if (e == null || e == "")
471
555
  return;
472
556
  let r = [];
@@ -479,19 +563,19 @@ T.addClass = (t, e, s = null) => {
479
563
  let l = r[n];
480
564
  s != l && l.classList.remove(e);
481
565
  }
482
- }, T.getWidthOrHeight = (t, e, s = null) => {
566
+ }, J.getWidthOrHeight = (t, e, s = null) => {
483
567
  let r = 0, n = [];
484
568
  y.isArray(t) ? n.push(...t) : n.push(t);
485
569
  for (let l = 0; l < n.length; l++) {
486
570
  let i = n[l];
487
571
  if (!i || !i.getBoundingClientRect)
488
572
  continue;
489
- let u = i.getBoundingClientRect();
490
- r += u[e], s && (r += s(i));
573
+ let a = i.getBoundingClientRect();
574
+ r += a[e], s && (r += s(i));
491
575
  }
492
576
  return r;
493
577
  };
494
- let U = T;
578
+ let $ = J;
495
579
  class X {
496
580
  /**
497
581
  * 从指定字典中提取忽略大小写的key的值
@@ -524,60 +608,60 @@ class X {
524
608
  return n;
525
609
  let l = Object.keys(t);
526
610
  for (let i = 0; i < l.length; i++) {
527
- let u = l[i], o = e == null ? t[u] : e(t[u]);
528
- n = n.concat(u).concat(s).concat(o), i != l.length - 1 && (n += r);
611
+ let a = l[i], o = e == null ? t[a] : e(t[a]);
612
+ n = n.concat(a).concat(s).concat(o), i != l.length - 1 && (n += r);
529
613
  }
530
614
  return n;
531
615
  }
532
616
  // #endregion
533
617
  }
534
- const j = class j {
618
+ const B = class B {
535
619
  };
536
- j.bind = (t, e, s) => {
620
+ B.bind = (t, e, s) => {
537
621
  e && t.forEach((r) => {
538
622
  e.addEventListener(r, s, !0);
539
623
  });
540
- }, j.unbind = (t, e, s) => {
624
+ }, B.unbind = (t, e, s) => {
541
625
  e && t.forEach((r) => {
542
626
  e.removeEventListener(r, s, !0);
543
627
  });
544
- }, j.click = (t, e) => {
628
+ }, B.click = (t, e) => {
545
629
  t && t.addEventListener("click", e, !0);
546
- }, j.unclick = (t, e) => {
630
+ }, B.unclick = (t, e) => {
547
631
  t && t.removeEventListener("click", e, !0);
548
- }, j.scroll = (t, e) => {
632
+ }, B.scroll = (t, e) => {
549
633
  t && t.addEventListener("scroll", e, !0);
550
- }, j.unscroll = (t, e) => {
634
+ }, B.unscroll = (t, e) => {
551
635
  t && t.removeEventListener("scroll", e, !0);
552
636
  };
553
- let bt = j;
554
- const I = class I {
637
+ let pt = B;
638
+ const A = class A {
555
639
  };
556
- I.save = (t, e) => {
640
+ A.save = (t, e) => {
557
641
  let s = window.atob(t), r = s.length, n = new Uint8Array(r);
558
642
  for (; r--; )
559
643
  n[r] = s.charCodeAt(r);
560
644
  let l = new Blob([n]);
561
- $t.saveAs(l, e);
562
- }, I.getExtension = (t) => {
645
+ At.saveAs(l, e);
646
+ }, A.getExtension = (t) => {
563
647
  let e = t.lastIndexOf(".");
564
648
  return e == -1 ? "" : t.substring(e).split("?")[0];
565
- }, I.isExcel = (t) => {
566
- let e = I.getExtension(t);
649
+ }, A.isExcel = (t) => {
650
+ let e = A.getExtension(t);
567
651
  return [".xls", ".xlsx"].indexOf(e) > -1;
568
- }, I.isImage = (t) => {
569
- let e = I.getExtension(t);
652
+ }, A.isImage = (t) => {
653
+ let e = A.getExtension(t);
570
654
  return [".png", ".jpg", ".jpeg", ".bmp", ".gif"].indexOf(e) > -1;
571
655
  };
572
- let Z = I;
573
- const mt = class mt {
656
+ let Z = A;
657
+ const dt = class dt {
574
658
  };
575
- mt.getHtml = (t) => y.isNumber(t) ? t : t && t.replace(/\n/g, "<br/>");
576
- let wt = mt;
577
- const pt = class pt {
659
+ dt.getHtml = (t) => y.isNumber(t) ? t : t && t.replace(/\n/g, "<br/>");
660
+ let yt = dt;
661
+ const ft = class ft {
578
662
  };
579
- pt.base64 = (t) => "data:image/png;base64," + t;
580
- let St = pt;
663
+ ft.base64 = (t) => "data:image/png;base64," + t;
664
+ let bt = ft;
581
665
  const b = class b {
582
666
  /**
583
667
  * 生成指定范围内的随机数
@@ -596,7 +680,7 @@ const b = class b {
596
680
  };
597
681
  b.filterPage = (t, e, s) => {
598
682
  let r = (e - 1) * s, n = e * s;
599
- return t.filter((i, u) => u >= r && u < n);
683
+ return t.filter((i, a) => a >= r && a < n);
600
684
  }, b.pageCount = (t, e) => Math.ceil(t / e), b.round = (t, e) => t.toFixed(e), b.ceil = (t) => Math.ceil(t), b.getPercentage = (t, e) => {
601
685
  if (!t || !e)
602
686
  return 0;
@@ -620,11 +704,11 @@ b.filterPage = (t, e, s) => {
620
704
  throw new Error("暂未支持比TB更大的大小");
621
705
  };
622
706
  let xt = b;
623
- const yt = class yt {
707
+ const mt = class mt {
624
708
  };
625
- yt.load = function(t, e, s, r) {
709
+ mt.load = function(t, e, s, r) {
626
710
  };
627
- let kt = yt;
711
+ let wt = mt;
628
712
  const M = class M {
629
713
  };
630
714
  M.emit = (t, e) => {
@@ -637,7 +721,7 @@ M.emit = (t, e) => {
637
721
  });
638
722
  };
639
723
  let G = M;
640
- const q = class q {
724
+ const U = class U {
641
725
  /**
642
726
  * 净化对象,返回不带默认属性的对象
643
727
  */
@@ -671,20 +755,20 @@ const q = class q {
671
755
  return r;
672
756
  }
673
757
  };
674
- q.copy = (t, e = null) => {
758
+ U.copy = (t, e = null) => {
675
759
  let s = [];
676
760
  y.isObject(t) && s.push(t);
677
761
  let r = [];
678
762
  for (let n = 0; n < s.length; n++) {
679
763
  let l = s[n], i = {};
680
- Object.keys(l).forEach((u) => {
681
- let o = l[u];
682
- e && e[u] ? i[u] = e[u]() : i[u] = o;
764
+ Object.keys(l).forEach((a) => {
765
+ let o = l[a];
766
+ e && e[a] ? i[a] = e[a]() : i[a] = o;
683
767
  }), r.push(i);
684
768
  }
685
769
  return y.isObject(t) ? r[0] : r;
686
- }, q.clone = (t, e = null) => {
687
- let s = Ut(t, !0);
770
+ }, U.clone = (t, e = null) => {
771
+ let s = qt(t, !0);
688
772
  if (e == null)
689
773
  return s;
690
774
  if (y.isArray(t))
@@ -692,46 +776,46 @@ q.copy = (t, e = null) => {
692
776
  e(s[r]);
693
777
  else y.isObject(t) && e(s);
694
778
  return s;
695
- }, q.mergeTo = (t, e) => t == null ? e : e == null ? t : y.isArray(e) ? e.slice() : (Object.keys(e).forEach((r) => {
779
+ }, U.mergeTo = (t, e) => t == null ? e : e == null ? t : y.isArray(e) ? e.slice() : (Object.keys(e).forEach((r) => {
696
780
  let n = e[r];
697
- typeof n == "object" ? t[r] = q.mergeTo(t[r], n) : t[r] = n;
698
- }), t), q.addProperties = (t, e, s) => {
781
+ typeof n == "object" ? t[r] = U.mergeTo(t[r], n) : t[r] = n;
782
+ }), t), U.addProperties = (t, e, s) => {
699
783
  let r = t;
700
784
  for (let n = 0; n < e.length; n++) {
701
785
  let l = e[n];
702
786
  n == e.length - 1 ? r[l] = s : (r[l] || (r[l] = {}), r = r[l]);
703
787
  }
704
788
  };
705
- let R = q;
706
- const C = class C {
789
+ let F = U;
790
+ const O = class O {
707
791
  };
708
- C.loadContentAsync = async (t) => {
792
+ O.loadContentAsync = async (t) => {
709
793
  let e = t instanceof Array ? t : [t], s = [];
710
794
  for (let r = 0; r < e.length; r++) {
711
- let n = e[r], l = new Promise((i, u) => {
795
+ let n = e[r], l = new Promise((i, a) => {
712
796
  let o = new XMLHttpRequest();
713
797
  o.open("GET", n, !1), o.onreadystatechange = () => {
714
798
  if (o.readyState == 4) {
715
- let c = C.getInnerTagByUrl(n);
799
+ let c = O.getInnerTagByUrl(n);
716
800
  c.appendChild(document.createTextNode(o.responseText)), document.head.appendChild(c), i();
717
801
  }
718
802
  }, o.onerror = () => {
719
- u();
803
+ a();
720
804
  }, o.send(null);
721
805
  });
722
806
  s.push(l);
723
807
  }
724
808
  return Promise.all(s);
725
- }, C.loadPathAsync = async (t, e) => {
809
+ }, O.loadPathAsync = async (t, e) => {
726
810
  let s = [];
727
811
  for (let r = 0; r < e.length; r++)
728
812
  s.push(t + e[r]);
729
- await C.loadAsync(s);
730
- }, C.loadAsync = async (t) => {
731
- let e = S.getArray(t), s = [];
813
+ await O.loadAsync(s);
814
+ }, O.loadAsync = async (t) => {
815
+ let e = C.getArray(t), s = [];
732
816
  for (let r = 0; r < e.length; r++) {
733
817
  let n = new Promise((l, i) => {
734
- let u = e[r], o = C.getOuterTagByUrl(u);
818
+ let a = e[r], o = O.getOuterTagByUrl(a);
735
819
  document.head.appendChild(o), o.onload = (c) => {
736
820
  l(c);
737
821
  }, o.onerror = (c) => {
@@ -747,7 +831,7 @@ C.loadContentAsync = async (t) => {
747
831
  n();
748
832
  });
749
833
  });
750
- }, C.loadAll = (...t) => Promise.all(t), C.getInnerTagByUrl = (t) => Z.getExtension(t).substring(1) == "css" ? document.createElement("style") : document.createElement("script"), C.getOuterTagByUrl = (t) => {
834
+ }, O.loadAll = (...t) => Promise.all(t), O.getInnerTagByUrl = (t) => Z.getExtension(t).substring(1) == "css" ? document.createElement("style") : document.createElement("script"), O.getOuterTagByUrl = (t) => {
751
835
  if (Z.getExtension(t).substring(1) == "css") {
752
836
  let r = document.createElement("link");
753
837
  return r.rel = "stylesheet", r.href = t, r;
@@ -755,10 +839,10 @@ C.loadContentAsync = async (t) => {
755
839
  let s = document.createElement("script");
756
840
  return s.src = t, s;
757
841
  };
758
- let H = C;
759
- const A = class A {
842
+ let H = O;
843
+ const L = class L {
760
844
  };
761
- A.delay = (t, e) => setTimeout(t, e), A.execute = (t, e, s) => {
845
+ L.delay = (t, e) => setTimeout(t, e), L.execute = (t, e, s) => {
762
846
  if (!s) {
763
847
  let r = setInterval(t, e);
764
848
  return Promise.resolve(r);
@@ -769,14 +853,14 @@ A.delay = (t, e) => setTimeout(t, e), A.execute = (t, e, s) => {
769
853
  r(n);
770
854
  }, s);
771
855
  });
772
- }, A.clearInterval = (t) => {
856
+ }, L.clearInterval = (t) => {
773
857
  clearInterval(t);
774
- }, A.debounce = (t, e) => {
858
+ }, L.debounce = (t, e) => {
775
859
  let s = null;
776
860
  return (r) => {
777
861
  s && clearTimeout(s), s = setTimeout(t, e, r);
778
862
  };
779
- }, A.throttle = (t, e) => {
863
+ }, L.throttle = (t, e) => {
780
864
  let s = !0;
781
865
  return (r) => {
782
866
  if (!s)
@@ -786,82 +870,82 @@ A.delay = (t, e) => setTimeout(t, e), A.execute = (t, e, s) => {
786
870
  }, e, r);
787
871
  };
788
872
  };
789
- let Ct = A;
873
+ let St = L;
790
874
  const m = class m {
791
875
  };
792
- m.getTimestamp = (t = null) => (t ? new Date(t) : /* @__PURE__ */ new Date()).getTime(), m.getTime = (t = null) => t ? new Date(t) : /* @__PURE__ */ new Date(), m.format = (t, e) => E(t).format(e), m.getDateTimeString = () => m.formatSecondTime(/* @__PURE__ */ new Date()), m.getDateString = () => m.formatDate(/* @__PURE__ */ new Date()), m.getTimeString = () => m.formatTime(/* @__PURE__ */ new Date()), m.formatSecondTime = (t) => E(t).format("YYYY-MM-DD HH:mm:ss"), m.formatMillisecondTime = (t) => t ? E(t).format("YYYY-MM-DD HH:mm:ss SSS") : null, m.formatTime = (t) => t ? E(t).format("HH:mm:ss SSS") : null, m.formatDate = (t) => t ? E(t).format("YYYY-MM-DD") : null, m.addDays = (t, e) => t ? E(t).add(e, "days").format() : null, m.addMonths = (t, e) => t ? E(t).add(e, "months").format() : null, m.isWeekend = (t) => {
876
+ m.getTimestamp = (t = null) => (t ? new Date(t) : /* @__PURE__ */ new Date()).getTime(), m.getTime = (t = null) => t ? new Date(t) : /* @__PURE__ */ new Date(), m.format = (t, e) => I(t).format(e), m.getDateTimeString = () => m.formatSecondTime(/* @__PURE__ */ new Date()), m.getDateString = () => m.formatDate(/* @__PURE__ */ new Date()), m.getTimeString = () => m.formatTime(/* @__PURE__ */ new Date()), m.formatSecondTime = (t) => I(t).format("YYYY-MM-DD HH:mm:ss"), m.formatMillisecondTime = (t) => t ? I(t).format("YYYY-MM-DD HH:mm:ss SSS") : null, m.formatTime = (t) => t ? I(t).format("HH:mm:ss SSS") : null, m.formatDate = (t) => t ? I(t).format("YYYY-MM-DD") : null, m.addDays = (t, e) => t ? I(t).add(e, "days").format() : null, m.addMonths = (t, e) => t ? I(t).add(e, "months").format() : null, m.isWeekend = (t) => {
793
877
  if (!t)
794
878
  return !1;
795
- let e = E(t).format("d");
879
+ let e = I(t).format("d");
796
880
  return e == "6" || e == "0";
797
881
  }, m.localeTime = (t) => {
798
882
  if (!t)
799
883
  return null;
800
884
  let s = (/* @__PURE__ */ new Date()).getTimezoneOffset() + 480;
801
- return E(t).add(s, "minutes").format();
885
+ return I(t).add(s, "minutes").format();
802
886
  };
803
- let D = m;
804
- const f = class f {
887
+ let R = m;
888
+ const d = class d {
805
889
  };
806
- f.getById = (t, e, s, r) => {
890
+ d.getById = (t, e, s, r) => {
807
891
  if (!s)
808
892
  return null;
809
893
  let n = s.find((l) => l[e] == t) || null;
810
894
  if (n != null)
811
895
  return n;
812
896
  for (let l = 0; l < s.length; l++) {
813
- let i = f.getById(t, e, s[l][r], r);
897
+ let i = d.getById(t, e, s[l][r], r);
814
898
  if (i != null) {
815
899
  n = i;
816
900
  break;
817
901
  }
818
902
  }
819
903
  return n;
820
- }, f.getByIds = (t, e, s, r) => {
821
- let n = z.distinct(t, (i) => i), l = [];
904
+ }, d.getByIds = (t, e, s, r) => {
905
+ let n = T.distinct(t, (i) => i), l = [];
822
906
  return n.forEach((i) => {
823
- let u = f.getById(i, e, s, r);
824
- l.push(u);
907
+ let a = d.getById(i, e, s, r);
908
+ l.push(a);
825
909
  }), l;
826
- }, f.getNextById = (t, e, s, r) => {
827
- let n = f.getById(t, e, s, r), l = f.getParentsById(t, e, s, r);
910
+ }, d.getNextById = (t, e, s, r) => {
911
+ let n = d.getById(t, e, s, r), l = d.getParentsById(t, e, s, r);
828
912
  if (l.length == 0) {
829
913
  if (s.length == 1)
830
914
  return null;
831
915
  let c = s.indexOf(n);
832
916
  return c == s.length - 1 ? s[c - 1] : s[c + 1];
833
917
  }
834
- let i = l[l.length - 1], u = i[r];
835
- if (u.length == 1)
918
+ let i = l[l.length - 1], a = i[r];
919
+ if (a.length == 1)
836
920
  return i;
837
- let o = u.indexOf(n);
838
- return o == u.length - 1 ? u[o - 1] : u[o + 1];
839
- }, f.getSiblingsById = (t, e, s, r) => {
840
- let n = f.getParentById(t, e, s, r);
921
+ let o = a.indexOf(n);
922
+ return o == a.length - 1 ? a[o - 1] : a[o + 1];
923
+ }, d.getSiblingsById = (t, e, s, r) => {
924
+ let n = d.getParentById(t, e, s, r);
841
925
  return n == null ? s : n[r];
842
- }, f.getParentById = (t, e, s, r) => {
843
- let n = f.getParentsById(t, e, s, r, !1);
926
+ }, d.getParentById = (t, e, s, r) => {
927
+ let n = d.getParentsById(t, e, s, r, !1);
844
928
  return n[n.length - 1];
845
- }, f.getParentsById = (t, e, s, r, n = !1) => {
929
+ }, d.getParentsById = (t, e, s, r, n = !1) => {
846
930
  let l = [];
847
931
  return vt(t, e, s, r, l, n), l;
848
- }, f.getChildrenById = (t, e, s, r, n = !1) => {
849
- let l = f.getById(t, e, s, r), i = [];
850
- return n && i.push(l), ut(l, r, i), i;
851
- }, f.getChildren = (t, e, s = !1) => {
932
+ }, d.getChildrenById = (t, e, s, r, n = !1) => {
933
+ let l = d.getById(t, e, s, r), i = [];
934
+ return n && i.push(l), it(l, r, i), i;
935
+ }, d.getChildren = (t, e, s = !1) => {
852
936
  let r = [];
853
- return s && r.push(t), ut(t, e, r), r;
854
- }, f.searchTree = (t, e, s, r) => {
937
+ return s && r.push(t), it(t, e, r), r;
938
+ }, d.searchTree = (t, e, s, r) => {
855
939
  let n = [];
856
940
  if (!e)
857
941
  return n;
858
942
  let l = t ? t.toUpperCase() : "", i = y.isString(r) ? [r] : r;
859
- for (let u of e) {
860
- let o = !1, c = f.getChildren(u, s, !0);
943
+ for (let a of e) {
944
+ let o = !1, c = d.getChildren(a, s, !0);
861
945
  for (let g of c) {
862
946
  for (let p of i) {
863
- let v = g[p];
864
- if ((v ? v.toUpperCase() : "").indexOf(l) > -1) {
947
+ let j = g[p];
948
+ if ((j ? j.toUpperCase() : "").indexOf(l) > -1) {
865
949
  o = !0;
866
950
  break;
867
951
  }
@@ -870,95 +954,95 @@ f.getById = (t, e, s, r) => {
870
954
  break;
871
955
  }
872
956
  if (o) {
873
- let g = f.searchTree(t, u[s], s, r), p = { ...u, [s]: g };
957
+ let g = d.searchTree(t, a[s], s, r), p = { ...a, [s]: g };
874
958
  n.push(p);
875
959
  }
876
960
  }
877
961
  return n;
878
- }, f.removeById = (t, e, s, r) => {
879
- let n = f.getById(t, e, s, r), l = f.getParentsById(t, e, s, r);
962
+ }, d.removeById = (t, e, s, r) => {
963
+ let n = d.getById(t, e, s, r), l = d.getParentsById(t, e, s, r);
880
964
  if (l.length == 0) {
881
- z.remove(s, n);
965
+ T.remove(s, n);
882
966
  return;
883
967
  }
884
968
  let i = l[l.length - 1];
885
- z.remove(i[r], n);
886
- }, f.getFlat = (t, e) => {
969
+ T.remove(i[r], n);
970
+ }, d.getFlat = (t, e) => {
887
971
  let s = [...t];
888
972
  for (let r = 0; r < t.length; r++) {
889
973
  let l = t[r][e];
890
974
  if (l.length > 0) {
891
- let i = f.getFlat(l, e);
975
+ let i = d.getFlat(l, e);
892
976
  s.push(...i);
893
977
  }
894
978
  }
895
979
  return s;
896
- }, f.map = (t, e, s, r) => {
980
+ }, d.map = (t, e, s, r) => {
897
981
  let n = [];
898
982
  for (let l = 0; l < t.length; l++) {
899
- let i = t[l], u = r(i);
900
- n.push(u);
983
+ let i = t[l], a = r(i);
984
+ n.push(a);
901
985
  let o = i[e];
902
986
  if (o && o.length > 0) {
903
- let c = f.map(o, e, s, r);
904
- u[s] = c;
987
+ let c = d.map(o, e, s, r);
988
+ a[s] = c;
905
989
  }
906
990
  }
907
991
  return n;
908
992
  };
909
- let _ = f;
910
- function vt(a, t, e, s, r, n) {
993
+ let _ = d;
994
+ function vt(u, t, e, s, r, n) {
911
995
  for (let l = 0; l < e.length; l++) {
912
996
  let i = e[l];
913
- if (i[t] == a) {
997
+ if (i[t] == u) {
914
998
  n && r.push(i);
915
999
  break;
916
1000
  } else
917
- _.getById(a, t, i[s], s) != null && (r.push(i), vt(a, t, i[s], s, r, n));
1001
+ _.getById(u, t, i[s], s) != null && (r.push(i), vt(u, t, i[s], s, r, n));
918
1002
  }
919
1003
  return r;
920
1004
  }
921
- function ut(a, t, e) {
922
- let s = a[t];
1005
+ function it(u, t, e) {
1006
+ let s = u[t];
923
1007
  if (!s || s.length == 0)
924
1008
  return e;
925
1009
  for (let r = 0; r < s.length; r++) {
926
1010
  let n = s[r];
927
- e.push(n), ut(n, t, e);
1011
+ e.push(n), it(n, t, e);
928
1012
  }
929
1013
  return e;
930
1014
  }
931
- const O = class O {
1015
+ const v = class v {
932
1016
  };
933
- O.get = (t, e = null) => localStorage.getItem(t) ?? e, O.set = (t, e) => localStorage.setItem(t, e), O.getObject = (t) => JSON.parse(localStorage.getItem(t)), O.setObject = (t, e) => localStorage.setItem(t, JSON.stringify(e)), O.remove = (t) => localStorage.removeItem(t), O.getLeftStorage = () => {
1017
+ v.get = (t, e = null) => localStorage.getItem(t) ?? e, v.set = (t, e) => localStorage.setItem(t, e), v.getObject = (t) => JSON.parse(localStorage.getItem(t)), v.setObject = (t, e) => localStorage.setItem(t, JSON.stringify(e)), v.remove = (t) => localStorage.removeItem(t), v.getLeftStorage = () => {
934
1018
  let t = 0;
935
1019
  return Object.keys(localStorage).forEach((s) => {
936
1020
  t += localStorage.getItem(s).length;
937
1021
  }), 1e-4 * 1024 - t / 1024;
938
- }, O.canStorage = (t) => {
1022
+ }, v.canStorage = (t) => {
939
1023
  let e = JSON.stringify(t).length / 1024;
940
- return O.getLeftStorage() > e;
1024
+ return v.getLeftStorage() > e;
941
1025
  };
942
- let w = O;
943
- const rt = class rt {
1026
+ let x = v;
1027
+ const et = class et {
944
1028
  };
945
- rt.isBottom = (t) => {
1029
+ et.isBottom = (t) => {
946
1030
  let e = document.querySelector(t);
947
1031
  return e ? e.scrollTop + e.clientHeight == e.scrollHeight : !1;
948
- }, rt.scrollToBottom = (t) => {
1032
+ }, et.scrollToBottom = (t) => {
949
1033
  let e = document.querySelector(t);
950
1034
  if (!e)
951
1035
  return;
952
1036
  let s = e.scrollHeight - e.clientHeight;
953
1037
  e.scrollTop = s;
954
1038
  };
955
- let Ot = rt;
956
- class Ft {
1039
+ let kt = et;
1040
+ class zt {
957
1041
  /**
958
1042
  * 从树集合构建出Json对象
959
1043
  */
960
1044
  static buildObject(t, e, s) {
961
- return ot(t, e, 1, s);
1045
+ return ut(t, e, 1, s);
962
1046
  }
963
1047
  /**
964
1048
  * 把字符串格式化为Json字符串
@@ -999,7 +1083,7 @@ class Ft {
999
1083
  * 把json字符串合并到目标对象上
1000
1084
  */
1001
1085
  static mergeTo(t, e) {
1002
- if (S.isNullOrEmpty(e))
1086
+ if (C.isNullOrEmpty(e))
1003
1087
  return;
1004
1088
  let s = JSON.parse(e);
1005
1089
  Object.keys(s).forEach((n) => {
@@ -1008,246 +1092,31 @@ class Ft {
1008
1092
  });
1009
1093
  }
1010
1094
  }
1011
- function ot(a, t, e, s) {
1012
- if (!a || a.length == 0)
1095
+ function ut(u, t, e, s) {
1096
+ if (!u || u.length == 0)
1013
1097
  return "{}";
1014
1098
  let r = `{
1015
1099
  `;
1016
- for (let n = 0; n < a.length; n++) {
1017
- let l = a[n], i = s(l);
1100
+ for (let n = 0; n < u.length; n++) {
1101
+ let l = u[n], i = s(l);
1018
1102
  i.type == "array" ? (i.remark && (r += Q(2 * e) + "//" + i.remark + `
1019
- `), r += at(2 * e, i.key) + "[", r += ot(l[t], t, e + 1, s), r += "]", n != a.length - 1 && (r += ",")) : i.type == "object" ? (i.remark && (r += Q(2 * e) + "//" + i.remark + `
1020
- `), r += at(2 * e, i.key), r += ot(l[t], t, e + 1, s), n != a.length - 1 && (r += ",")) : (r += at(2 * e, i.key), i.type == "string" ? r += '""' : i.type == "date" ? r += `"${D.getDateTimeString()}"` : i.type == "int" || i.type == "number" ? r += "0" : i.type == "boolean" ? r += "false" : r += null, n != a.length - 1 && (r += ","), i.remark && (r += " //" + i.remark)), r += `
1103
+ `), r += lt(2 * e, i.key) + "[", r += ut(l[t], t, e + 1, s), r += "]", n != u.length - 1 && (r += ",")) : i.type == "object" ? (i.remark && (r += Q(2 * e) + "//" + i.remark + `
1104
+ `), r += lt(2 * e, i.key), r += ut(l[t], t, e + 1, s), n != u.length - 1 && (r += ",")) : (r += lt(2 * e, i.key), i.type == "string" ? r += '""' : i.type == "date" ? r += `"${R.getDateTimeString()}"` : i.type == "int" || i.type == "number" ? r += "0" : i.type == "boolean" ? r += "false" : r += null, n != u.length - 1 && (r += ","), i.remark && (r += " //" + i.remark)), r += `
1021
1105
  `;
1022
1106
  }
1023
1107
  return r += Q(2 * (e - 1)), r += "}", r;
1024
1108
  }
1025
- function Q(a) {
1109
+ function Q(u) {
1026
1110
  let t = "";
1027
- for (let e = 0; e < a; e++)
1111
+ for (let e = 0; e < u; e++)
1028
1112
  t += " ";
1029
1113
  return t;
1030
1114
  }
1031
- function at(a, t) {
1032
- let e = Q(a);
1115
+ function lt(u, t) {
1116
+ let e = Q(u);
1033
1117
  return e += '"' + t + '": ', e;
1034
1118
  }
1035
- class dt {
1036
- }
1037
- class Pt extends dt {
1038
- constructor() {
1039
- super(...arguments), this.type = "Default";
1040
- }
1041
- open(t) {
1042
- }
1043
- send(t) {
1044
- return new Promise((e, s) => {
1045
- let r = (/* @__PURE__ */ new Date()).getTime(), n = new XMLHttpRequest();
1046
- if (n.open(t.method, t.url), t.headers != null)
1047
- for (let l of t.headers)
1048
- n.setRequestHeader(l, t.headers[l]);
1049
- t.contentType != null && n.setRequestHeader("content-type", t.contentType), n.onreadystatechange = () => {
1050
- if (n.readyState == 4) {
1051
- let i = { elapsed: (/* @__PURE__ */ new Date()).getTime() - r, body: n.responseText, request: t };
1052
- e(i);
1053
- }
1054
- }, n.onerror = (l) => {
1055
- let u = { elapsed: (/* @__PURE__ */ new Date()).getTime() - r, body: n.responseText, request: t };
1056
- e(u);
1057
- }, n.send(t.body);
1058
- });
1059
- }
1060
- }
1061
- class jt {
1062
- }
1063
- class zt extends jt {
1064
- constructor() {
1065
- super(...arguments), this.type = "Sha256";
1066
- }
1067
- open(t) {
1068
- }
1069
- async compute(t) {
1070
- let s = new TextEncoder().encode(t), r = await crypto.subtle.digest("SHA-256", s);
1071
- return Array.from(new Uint8Array(r)).map((i) => i.toString(16).padStart(2, "0")).join("");
1072
- }
1073
- }
1074
- class Tt extends jt {
1075
- constructor() {
1076
- super(...arguments), this.type = "Md5";
1077
- }
1078
- open(t) {
1079
- }
1080
- compute(t) {
1081
- let e = P.MD5(t).toString();
1082
- return Promise.resolve(e);
1083
- }
1084
- }
1085
- class tt {
1086
- /**
1087
- * 创建执行类型的Hash实例
1088
- */
1089
- static create(t) {
1090
- let s = [new zt(), new Tt()].find((r) => S.equalsIgnoreCase(r.type, t));
1091
- if (s == null)
1092
- throw new Error(`未实现IHasher: ${t}`);
1093
- return s;
1094
- }
1095
- /**
1096
- * 获取MD5 Hash对象
1097
- */
1098
- static getMd5() {
1099
- return this.md5 != null ? this.md5 : (this.md5 = this.create("Md5"), this.md5);
1100
- }
1101
- }
1102
- class Mt extends dt {
1103
- constructor() {
1104
- super(...arguments), this.type = "Mk";
1105
- }
1106
- /**
1107
- * 危险操作,会暴露敏感信息
1108
- */
1109
- open(t) {
1110
- Ft.mergeTo(this, t), this.requester = N.getRequester().getDefault(), this.hasher = tt.create("Sha256");
1111
- }
1112
- /**
1113
- * 危险操作,会暴露敏感信息
1114
- */
1115
- async send(t) {
1116
- let e = D.getTimestamp(), s = {
1117
- app_id: this.appId,
1118
- hash_type: "sha256",
1119
- timestamp: parseInt((e / 1e3).toString())
1120
- };
1121
- S.isNullOrEmpty(t.body) || (s.jsonBody = t.body);
1122
- let r = k.deserialize(t.path);
1123
- for (let g in r)
1124
- s[g] = r[g];
1125
- let n = k.getPath(t.path);
1126
- s = X.sort(s);
1127
- let l = te.signDictionary(s, !1), i = `POST${n}?${l}${this.appSecret}`, u = await this.hasher.compute(i);
1128
- s.sign = u.toLowerCase(), delete s.jsonBody, s = X.sort(s);
1129
- let o = k.serialize(s);
1130
- return t.url = k.concatUrl(this.baseUrl, n + "?" + o), await this.requester.send(t);
1131
- }
1132
- }
1133
- class Jt {
1134
- }
1135
- let ct;
1136
- window._setting ? ct = window._setting : ct = window.setting;
1137
- const K = ct;
1138
- class Wt extends dt {
1139
- constructor() {
1140
- super(...arguments), this.type = "Local";
1141
- }
1142
- open(t) {
1143
- this.request = Nt.create({
1144
- baseURL: K.api.url
1145
- // withCredentials: true, // send cookies when cross-domain requests
1146
- // timeout: 15000
1147
- }), this.request.interceptors.request.use(
1148
- async (e) => {
1149
- if (k.httpOrHttps(e.url))
1150
- return e;
1151
- let s = Bt(), r = k.getUrl(e.baseURL + e.url, e.params);
1152
- if (e.headers.Authorization = await s.getAuthorization(r, e.data), !e.headers["Accept-Language"]) {
1153
- let n = et();
1154
- e.headers["Accept-Language"] = n.language;
1155
- }
1156
- return e;
1157
- },
1158
- (e) => (console.log(e), Promise.reject(e))
1159
- );
1160
- }
1161
- send(t) {
1162
- return Promise.resolve(void 0);
1163
- }
1164
- /**
1165
- * GET请求
1166
- */
1167
- async get(t, e = null, s = null) {
1168
- let r = { method: "get", url: t, params: e, headers: s };
1169
- return this.request(r).then((n) => this.handleResponse(n)).catch((n) => this.handleError(n));
1170
- }
1171
- /**
1172
- * POST请求
1173
- */
1174
- async post(t, e = null, s = null) {
1175
- return this.request.post(t, e, s).then((r) => this.handleResponse(r)).catch((r) => this.handleError(r));
1176
- }
1177
- /**
1178
- * PATCH请求
1179
- */
1180
- async patch(t, e = null, s = null) {
1181
- return this.request.patch(t, e, s).then((r) => this.handleResponse(r)).catch((r) => this.handleError(r));
1182
- }
1183
- /**
1184
- * 处理响应信息 或 响应体信息
1185
- */
1186
- handleResponse(t) {
1187
- if (k.httpOrHttps(t.config.url))
1188
- return Promise.resolve(t.data);
1189
- let e = t.config.tip;
1190
- return this.handleResponseBody(t.data, e);
1191
- }
1192
- /**
1193
- * 处理响应体信息,并自动添加响应通知
1194
- */
1195
- handleResponseBody(t, e = !1) {
1196
- return Et().add(t.code, t.message, t.stack, t.elapsed), e && t.code == "Ok" && this.messageService.success(t.message), t.code != "Ok" ? Promise.reject(t) : Promise.resolve(t);
1197
- }
1198
- /**
1199
- * 处理网络错误和响应错误场景
1200
- */
1201
- handleError(t) {
1202
- if (t instanceof Rt) {
1203
- Et().add("error", t.message, t.stack);
1204
- let s = t.message;
1205
- t.message == "Network Error" && (k.httpOrHttps(t.config.url) ? s = "接口网络错误: " + t.config.url : s = "接口网络错误: " + t.config.baseURL + t.config.url), this.messageService.error(s);
1206
- } else
1207
- this.messageService.error(t.message);
1208
- return Promise.reject(t);
1209
- }
1210
- }
1211
- class Vt extends Jt {
1212
- create(t) {
1213
- let s = [new Pt(), new Mt(), new Wt()].find((r) => S.equalsIgnoreCase(r.type, t));
1214
- if (s == null)
1215
- throw Error(`不存在请求器: ${t}`);
1216
- return s;
1217
- }
1218
- /**
1219
- * 获取默认请求器
1220
- */
1221
- getDefault() {
1222
- return this._default != null ? this._default : (this._default = this.create("Default"), this._default);
1223
- }
1224
- /**
1225
- * 获取本地请求实例
1226
- * 获取完毕后,下游第一行代码就要配置消息服务
1227
- */
1228
- getLocal() {
1229
- return this.local == null && (this.local = this.create("Local")), this.local;
1230
- }
1231
- }
1232
- const J = class J {
1233
- /**
1234
- * 获取并缓存工厂实例
1235
- */
1236
- static create(t, e) {
1237
- let s = J.mappings[t];
1238
- return s || (s = new e(), J.mappings[t] = s), s;
1239
- }
1240
- /**
1241
- *获取请求器工厂
1242
- */
1243
- static getRequester() {
1244
- return this.create("RequesterFactory", Vt);
1245
- }
1246
- };
1247
- J.mappings = {};
1248
- let ht = J;
1249
- const N = ht;
1250
- let It = L("setting", {
1119
+ let Et = P("setting", {
1251
1120
  state() {
1252
1121
  return {
1253
1122
  loaded: !1,
@@ -1289,7 +1158,7 @@ let It = L("setting", {
1289
1158
  /**
1290
1159
  * 请求器
1291
1160
  */
1292
- requester: N.getRequester().getLocal()
1161
+ requester: k.getRequester().getLocal()
1293
1162
  };
1294
1163
  },
1295
1164
  actions: {
@@ -1303,13 +1172,13 @@ let It = L("setting", {
1303
1172
  * 加载设置
1304
1173
  */
1305
1174
  async loadSetting() {
1306
- return this.requester.get("/app/setting").then(({ data: a }) => (Object.keys(a).forEach((t) => {
1307
- let e = a[t];
1175
+ return this.requester.get("/app/setting").then(({ data: u }) => (Object.keys(u).forEach((t) => {
1176
+ let e = u[t];
1308
1177
  e && (this[t] = e);
1309
- }), U.addClass(document.documentElement, this.theme, window.setting.web.theme), G.emits({ theme: this.theme }), Promise.resolve(a))).catch((a) => Promise.reject(a));
1178
+ }), $.addClass(document.documentElement, this.theme, window.setting.web.theme), G.emits({ theme: this.theme }), Promise.resolve(u))).catch((u) => Promise.reject(u));
1310
1179
  }
1311
1180
  }
1312
- }), Yt = L("config", {
1181
+ }), tt = P("config", {
1313
1182
  state() {
1314
1183
  return {
1315
1184
  /**
@@ -1339,43 +1208,43 @@ let It = L("setting", {
1339
1208
  /**
1340
1209
  * 请求器
1341
1210
  */
1342
- requester: N.getRequester().getLocal()
1211
+ requester: k.getRequester().getLocal()
1343
1212
  };
1344
1213
  },
1345
1214
  actions: {
1346
1215
  /**
1347
1216
  * 初始化配置值(不一定跟登录用户相关,这也是单独分离的好处)
1348
1217
  */
1349
- init(a) {
1350
- let t = It();
1351
- this.background = t.background, this.theme = t.theme, this.layout = t.layout, this.language = t.language, this.font = t.font, a.forEach((e) => {
1218
+ init(u) {
1219
+ let t = Et();
1220
+ this.background = t.background, this.theme = t.theme, this.layout = t.layout, this.language = t.language, this.font = t.font, u.forEach((e) => {
1352
1221
  let s = this.getLocalConfig(e.type);
1353
1222
  this[e.type] = s ?? e.content;
1354
- }), U.removeClass(document.documentElement, t.theme), U.addClass(document.documentElement, this.theme), G.emit("theme", this.theme), U.addClass(document.documentElement, this.layout), this.setBackground(this.background), U.addStyle(document.documentElement, "font-family", this.font);
1223
+ }), $.removeClass(document.documentElement, t.theme), $.addClass(document.documentElement, this.theme), G.emit("theme", this.theme), $.addClass(document.documentElement, this.layout), this.setBackground(this.background), $.addStyle(document.documentElement, "font-family", this.font);
1355
1224
  },
1356
1225
  /**
1357
1226
  * 获取本地配置
1358
1227
  */
1359
- getLocalConfig(a) {
1360
- return w.getObject(a);
1228
+ getLocalConfig(u) {
1229
+ return x.getObject(u);
1361
1230
  },
1362
1231
  /**
1363
1232
  * 设置背景
1364
1233
  */
1365
- setBackground(a) {
1366
- let t = `url("/default/backgrounds/${a}") center / cover no-repeat`, e = this.layout == "desktop" ? "unset" : 0.05, s = document.createElement("style");
1367
- s.innerText = `html::before{content:'';width:100%;height:100%;position:absolute;background:${t};opacity:${e};`, document.head.appendChild(s), this.background = a;
1234
+ setBackground(u) {
1235
+ let t = `url("/default/backgrounds/${u}") center / cover no-repeat`, e = this.layout == "desktop" ? "unset" : 0.05, s = document.createElement("style");
1236
+ s.innerText = `html::before{content:'';width:100%;height:100%;position:absolute;background:${t};opacity:${e};`, document.head.appendChild(s), this.background = u;
1368
1237
  },
1369
1238
  /**
1370
1239
  * 加载用户配置
1371
1240
  */
1372
- async loadConfig(a, t = !0) {
1241
+ async loadConfig(u, t = !0) {
1373
1242
  if (t) {
1374
- let e = this.getLocalConfig(a);
1243
+ let e = this.getLocalConfig(u);
1375
1244
  if (e)
1376
1245
  return Promise.resolve(e);
1377
1246
  }
1378
- return this.requester.get(`/user/config?type=${a}`).then((e) => {
1247
+ return this.requester.get(`/user/config?type=${u}`).then((e) => {
1379
1248
  let s = e.data ? JSON.parse(e.data) : null;
1380
1249
  return Promise.resolve(s);
1381
1250
  });
@@ -1383,19 +1252,17 @@ let It = L("setting", {
1383
1252
  /**
1384
1253
  * 全量保存用户配置
1385
1254
  */
1386
- async saveConfig(a, t, e = !0) {
1387
- return e && w.setObject(a, t), this.requester.post(`/user/config?type=${a}`, t).then((s) => Promise.resolve(!0));
1255
+ async saveConfig(u, t, e = !0) {
1256
+ return e && x.setObject(u, t), this.requester.post(`/user/config?type=${u}`, t).then((s) => Promise.resolve(!0));
1388
1257
  },
1389
1258
  /**
1390
1259
  * 部分保存用户配置
1391
1260
  */
1392
- async patchConfig(a, t) {
1393
- return this.requester.patch(`/user/config?type=${a}`, t).then((e) => Promise.resolve(!0));
1261
+ async patchConfig(u, t) {
1262
+ return this.requester.patch(`/user/config?type=${u}`, t).then((e) => Promise.resolve(!0));
1394
1263
  }
1395
1264
  }
1396
- });
1397
- const et = Yt;
1398
- let Qt = L("log", {
1265
+ }), Ot = P("log", {
1399
1266
  state() {
1400
1267
  return {
1401
1268
  logs: []
@@ -1405,15 +1272,15 @@ let Qt = L("log", {
1405
1272
  /**
1406
1273
  * 手动添加日志
1407
1274
  */
1408
- add(a, t, e, s = null) {
1409
- let r = D.getTimeString();
1410
- this.logs.unshift({ time: r, code: a, message: t, stack: e, elapsed: s });
1275
+ add(u, t, e, s = null) {
1276
+ let r = R.getTimeString();
1277
+ this.logs.unshift({ time: r, code: u, message: t, stack: e, elapsed: s });
1411
1278
  },
1412
1279
  /**
1413
1280
  * 删除日志
1414
1281
  */
1415
- remove(a) {
1416
- this.logs.splice(a, 1);
1282
+ remove(u) {
1283
+ this.logs.splice(u, 1);
1417
1284
  },
1418
1285
  /**
1419
1286
  * 清空日志
@@ -1422,9 +1289,7 @@ let Qt = L("log", {
1422
1289
  this.logs = [];
1423
1290
  }
1424
1291
  }
1425
- });
1426
- const Et = Qt;
1427
- let Kt = L("env", {
1292
+ }), Tt = P("env", {
1428
1293
  state() {
1429
1294
  return {
1430
1295
  //环境变量
@@ -1435,11 +1300,14 @@ let Kt = L("env", {
1435
1300
  /**
1436
1301
  * 使用环境变量
1437
1302
  */
1438
- useEnv(a) {
1439
- this.env = a, this.env.base = S.trimEnd(a.VITE_ROOT, "/");
1303
+ useEnv(u) {
1304
+ this.env = u, this.env.base = C.trimEnd(u.VITE_ROOT, "/");
1440
1305
  }
1441
1306
  }
1442
- }), Xt = L("socket", {
1307
+ }), at;
1308
+ window._setting ? at = window._setting : at = window.setting;
1309
+ const K = at;
1310
+ let Jt = P("socket", {
1443
1311
  state() {
1444
1312
  return {
1445
1313
  socket: null,
@@ -1460,25 +1328,25 @@ let Kt = L("env", {
1460
1328
  if (!K.api.ws)
1461
1329
  return;
1462
1330
  if (this.socket == null || this.reconnect) {
1463
- let t = K.api.ws, s = await Bt().getAuthorization(t), r = k.encode(s), n = `${t}?authorization=${r}`;
1331
+ let t = K.api.ws, s = await It().getAuthorization(t), r = S.encode(s), n = `${t}?authorization=${r}`;
1464
1332
  this.socket = new WebSocket(n);
1465
1333
  }
1466
- let a;
1334
+ let u;
1467
1335
  this.socket.onopen = (t) => {
1468
- clearTimeout(a), this.connected = !0;
1336
+ clearTimeout(u), this.connected = !0;
1469
1337
  }, this.socket.onmessage = (t) => {
1470
1338
  this.handler && this.handler(t);
1471
1339
  }, this.socket.onerror = (t) => {
1472
1340
  this.reconnect = !0, console.warn(`Socket连接失败:${K.api.ws}`);
1473
1341
  }, this.socket.onclose = (t) => {
1474
- this.connected = !1, this.reconnect && (a = setTimeout(async () => await this.connect(), 1e3));
1342
+ this.connected = !1, this.reconnect && (u = setTimeout(async () => await this.connect(), 1e3));
1475
1343
  };
1476
1344
  },
1477
1345
  /**
1478
1346
  * 订阅并替换Socket事件处理程序
1479
1347
  */
1480
- subscribe(a = null) {
1481
- this.handler = a;
1348
+ subscribe(u = null) {
1349
+ this.handler = u;
1482
1350
  },
1483
1351
  /**
1484
1352
  * 取消订阅Socket事件处理程序,防止内存泄漏
@@ -1494,7 +1362,7 @@ let Kt = L("env", {
1494
1362
  }
1495
1363
  }
1496
1364
  });
1497
- const Zt = L("user", {
1365
+ const It = P("user", {
1498
1366
  state: () => ({
1499
1367
  user: null,
1500
1368
  //用户信息
@@ -1508,71 +1376,71 @@ const Zt = L("user", {
1508
1376
  /**
1509
1377
  * 请求器
1510
1378
  */
1511
- requester: N.getRequester().getLocal()
1379
+ requester: k.getRequester().getLocal()
1512
1380
  }),
1513
1381
  actions: {
1514
1382
  /**
1515
1383
  * 获取本地缓存中的用户信息;好处:即使手动更改storage数据,也可以里面获取到
1516
1384
  */
1517
1385
  getSso() {
1518
- return w.getObject("sso");
1386
+ return x.getObject("sso");
1519
1387
  },
1520
1388
  /**
1521
1389
  * 登录后,获取用户信息
1522
1390
  */
1523
1391
  async loadInfo() {
1524
- return this.requester.get("/user/info").then(({ data: a }) => {
1525
- let t = Kt(), e = et();
1526
- e.init(a.configs);
1527
- let s = t.env.VITE_CDN == "true" ? "StaticFile" : "Local", r = t.env.VITE_BASE, n = Y.getCdn(s, r);
1528
- this.user = a, this.debugger = a.debugger;
1392
+ return this.requester.get("/user/info").then(({ data: u }) => {
1393
+ let t = Tt(), e = tt();
1394
+ e.init(u.configs);
1395
+ let s = t.env.VITE_CDN == "true" ? "StaticFile" : "Local", r = t.env.VITE_BASE, n = k.getCdn().create(s, r);
1396
+ this.user = u, this.debugger = u.debugger;
1529
1397
  let l = e.language == "en" ? null : e.language, i = {
1530
1398
  paths: { vs: n.getPath("monaco-editor") },
1531
1399
  //加载monaco cdn压缩资源包,可以大幅减少本地请求数量
1532
1400
  "vs/nls": { availableLanguages: { "*": l } }
1533
1401
  //设置编辑器默认语言
1534
1402
  };
1535
- return Lt.config(i), Promise.resolve(a);
1403
+ return Ut.config(i), Promise.resolve(u);
1536
1404
  });
1537
1405
  },
1538
1406
  /**
1539
1407
  * 通过完整url和请求体,获取授权头
1540
1408
  */
1541
- async getAuthorization(a, t = null) {
1409
+ async getAuthorization(u, t = null) {
1542
1410
  let e = this.getSso();
1543
1411
  if (e == null)
1544
1412
  return "pc";
1545
- let s = D.getTimestamp(), n = await Y.getSigner("default").getSign(e.userId, a, t, s, e.secret);
1546
- return Y.getSso(e.type).getAuthorization(e.identity.token, s, n, this.env);
1413
+ let s = R.getTimestamp(), n = await k.getSigner().create("default").getSign(e.userId, u, t, s, e.secret);
1414
+ return k.getSso().create(e.type).getAuthorization(e.identity.token, s, n, this.env);
1547
1415
  },
1548
1416
  /**
1549
1417
  * 未登录,获取匿名登录信息
1550
1418
  */
1551
1419
  getAnonymous() {
1552
- et().init([]);
1420
+ tt().init([]);
1553
1421
  },
1554
1422
  /**
1555
1423
  * 根据路径获取路由
1556
1424
  */
1557
- getMenuByUrl(a) {
1558
- let t = k.getPath(a);
1425
+ getMenuByUrl(u) {
1426
+ let t = S.getPath(u);
1559
1427
  return this.menusFlat.find((s) => s.url.split("?")[0] == t);
1560
1428
  },
1561
1429
  /**
1562
1430
  * 加载服务端路由
1563
1431
  */
1564
1432
  async loadMenus() {
1565
- return this.requester.get("/user/menu").then(({ data: a }) => (this.menus = a, this.menusFlat = _.getFlat(a, "children"), Promise.resolve(a)));
1433
+ return this.requester.get("/user/menu").then(({ data: u }) => (this.menus = u, this.menusFlat = _.getFlat(u, "children"), Promise.resolve(u)));
1566
1434
  },
1567
1435
  /**
1568
1436
  * 退出登录
1569
1437
  */
1570
1438
  async logout() {
1571
- return this.requester.post("/user/logout").then(() => (this.user = null, this.menus = null, Y.getSso(this.getSso().type).logout(), Xt().disconnect(), Promise.resolve()));
1439
+ return this.requester.post("/user/logout").then(() => (this.user = null, this.menus = null, k.getSso().create(this.getSso().type).logout(), Jt().disconnect(), Promise.resolve()));
1572
1440
  }
1573
1441
  }
1574
- }), Bt = Zt;
1575
- L("driver", {
1442
+ });
1443
+ P("driver", {
1576
1444
  state() {
1577
1445
  return {
1578
1446
  /**
@@ -1600,15 +1468,15 @@ L("driver", {
1600
1468
  /**
1601
1469
  * 请求器
1602
1470
  */
1603
- requester: N.getRequester().getLocal()
1471
+ requester: k.getRequester().getLocal()
1604
1472
  };
1605
1473
  },
1606
1474
  actions: {
1607
1475
  /**
1608
1476
  * 加载应用选项
1609
1477
  */
1610
- async loadApps(a = !1) {
1611
- if (!this.loading.apps && !(!a && this.loaded.apps))
1478
+ async loadApps(u = !1) {
1479
+ if (!this.loading.apps && !(!u && this.loaded.apps))
1612
1480
  return this.loading.apps = !0, this.requester.post("/app/options").then((t) => {
1613
1481
  this.apps = t.data, this.loaded.apps = !0;
1614
1482
  }).finally(() => {
@@ -1618,8 +1486,8 @@ L("driver", {
1618
1486
  /**
1619
1487
  * 加载环境选项
1620
1488
  */
1621
- async loadEnvs(a = !1) {
1622
- if (!this.loading.envs && (this.loading.envs = !0, !(!a && this.loaded.envs)))
1489
+ async loadEnvs(u = !1) {
1490
+ if (!this.loading.envs && (this.loading.envs = !0, !(!u && this.loaded.envs)))
1623
1491
  return this.requester.post("/env/options").then((t) => {
1624
1492
  this.envs = t.data, this.loaded.envs = !0;
1625
1493
  }).finally(() => {
@@ -1639,45 +1507,11 @@ class Le {
1639
1507
  * 获取当前语言
1640
1508
  */
1641
1509
  static getCurrentLanguage() {
1642
- let t = et(), e = this.getBrowserLanguage();
1510
+ let t = tt(), e = this.getBrowserLanguage();
1643
1511
  return t.language || e || "zh-cn";
1644
1512
  }
1645
1513
  }
1646
- class Gt {
1647
- }
1648
- class Ht extends Gt {
1649
- constructor() {
1650
- super(...arguments), this.type = "Base64";
1651
- }
1652
- open(t) {
1653
- }
1654
- encode(t) {
1655
- let e = P.enc.Utf8.parse(t);
1656
- return P.enc.Base64.stringify(e);
1657
- }
1658
- decode(t) {
1659
- let e = P.enc.Base64.parse(t);
1660
- return P.enc.Utf8.stringify(e);
1661
- }
1662
- }
1663
- class st {
1664
- /**
1665
- * 创建执行类型的Hash实例
1666
- */
1667
- static create(t) {
1668
- let s = [new Ht()].find((r) => S.equalsIgnoreCase(r.type, t));
1669
- if (s == null)
1670
- throw new Error(`未实现 IHasher: ${t}`);
1671
- return s;
1672
- }
1673
- /**
1674
- * 获取Base64 编码器对象
1675
- */
1676
- static getBase64() {
1677
- return this.base64 != null ? this.base64 : (this.base64 = this.create("Base64"), this.base64);
1678
- }
1679
- }
1680
- const x = class x {
1514
+ const w = class w {
1681
1515
  /**
1682
1516
  * 获取指定地址路由对象
1683
1517
  */
@@ -1794,8 +1628,8 @@ const x = class x {
1794
1628
  static deserializeQs(t, e = !0) {
1795
1629
  let s = {}, r = t.split("&");
1796
1630
  for (let n = 0; n < r.length; n++) {
1797
- let l = r[n], i = l.indexOf("="), u = l.substring(0, i), o = l.substring(i + 1);
1798
- s[u] = e ? decodeURIComponent(o) : o;
1631
+ let l = r[n], i = l.indexOf("="), a = l.substring(0, i), o = l.substring(i + 1);
1632
+ s[a] = e ? decodeURIComponent(o) : o;
1799
1633
  }
1800
1634
  return s;
1801
1635
  }
@@ -1819,13 +1653,13 @@ const x = class x {
1819
1653
  */
1820
1654
  static base64(t) {
1821
1655
  let e = JSON.stringify(t);
1822
- return st.getBase64().encode(e);
1656
+ return k.getEncoder().getBase64().encode(e);
1823
1657
  }
1824
1658
  /**
1825
1659
  * 把指定base64字符串解析为原对象
1826
1660
  */
1827
1661
  static base64Decode(t) {
1828
- let e = st.getBase64().decode(t);
1662
+ let e = k.getEncoder().getBase64().decode(t);
1829
1663
  return JSON.parse(e);
1830
1664
  }
1831
1665
  //endregion
@@ -1836,21 +1670,21 @@ const x = class x {
1836
1670
  return t ? t.indexOf("http://") > -1 || t.indexOf("https://") > -1 : !1;
1837
1671
  }
1838
1672
  };
1839
- x.handleQueryValue = (t, e) => {
1673
+ w.handleQueryValue = (t, e) => {
1840
1674
  let s = "";
1841
1675
  if (t == null)
1842
1676
  return s;
1843
1677
  if (t instanceof Array) {
1844
1678
  if (t.length > 0)
1845
1679
  for (let r = 0; r < t.length; r++) {
1846
- let n = R.clone(e);
1847
- n.push(""), s += x.handleQueryValue(t[r], n);
1680
+ let n = F.clone(e);
1681
+ n.push(""), s += w.handleQueryValue(t[r], n);
1848
1682
  }
1849
1683
  } else if (t instanceof Object) {
1850
1684
  let r = Object.keys(t);
1851
1685
  for (let n of r) {
1852
- let l = R.clone(e);
1853
- l.push(n), s += x.handleQueryValue(t[n], l);
1686
+ let l = F.clone(e);
1687
+ l.push(n), s += w.handleQueryValue(t[n], l);
1854
1688
  }
1855
1689
  } else {
1856
1690
  let r = "";
@@ -1860,20 +1694,19 @@ x.handleQueryValue = (t, e) => {
1860
1694
  n = n.replace(/'/g, "%27"), n = n.replace(/%20/g, "+"), n = n.replace(/%5B/g, "["), n = n.replace(/%5D/g, "]"), n = n.replace(/%2C/g, ","), n = n.replace(/%3A/g, ":"), n = n.replace(/%24/g, "$"), s += `&${r}=${n}`;
1861
1695
  }
1862
1696
  return s;
1863
- }, x.concatUrl = (t, e) => x.httpOrHttps(e) ? e : t + e, x.getUrl = (t, e = null) => {
1697
+ }, w.concatUrl = (t, e) => w.httpOrHttps(e) ? e : t + e, w.getUrl = (t, e = null) => {
1864
1698
  if (t == null)
1865
1699
  return null;
1866
1700
  if (e == null)
1867
1701
  return t;
1868
- let s = x.deserialize(t), r = R.mergeTo(s, e);
1869
- return x.getPath(t) + "?" + x.getQuery(r);
1870
- }, x.getAnchor = (t, e = null) => {
1702
+ let s = w.deserialize(t), r = F.mergeTo(s, e);
1703
+ return w.getPath(t) + "?" + w.getQuery(r);
1704
+ }, w.getAnchor = (t, e = null) => {
1871
1705
  let s = { href: null, target: null };
1872
- return x.httpOrHttps(t) ? (s.href = t, s.target = "_blank", s) : (s.href = x.getUrl(t, e), s);
1706
+ return w.httpOrHttps(t) ? (s.href = t, s.target = "_blank", s) : (s.href = w.getUrl(t, e), s);
1873
1707
  };
1874
- let gt = x;
1875
- const k = gt;
1876
- class _t {
1708
+ let S = w;
1709
+ class Mt {
1877
1710
  /**
1878
1711
  * 清空对象中的空值
1879
1712
  */
@@ -1886,27 +1719,220 @@ class _t {
1886
1719
  * 签名字典
1887
1720
  */
1888
1721
  static signDictionary(t, e = !0) {
1889
- return this.clean(t), k.serialize(t, e);
1722
+ return this.clean(t), S.serialize(t, e);
1723
+ }
1724
+ }
1725
+ class Wt extends ht {
1726
+ constructor() {
1727
+ super(...arguments), this.type = "Mk";
1728
+ }
1729
+ /**
1730
+ * 危险操作,会暴露敏感信息
1731
+ */
1732
+ open(t) {
1733
+ zt.mergeTo(this, t), this.requester = k.getRequester().getDefault(), this.hasher = gt.create("Sha256");
1734
+ }
1735
+ /**
1736
+ * 危险操作,会暴露敏感信息
1737
+ */
1738
+ async send(t) {
1739
+ let e = R.getTimestamp(), s = {
1740
+ app_id: this.appId,
1741
+ hash_type: "sha256",
1742
+ timestamp: parseInt((e / 1e3).toString())
1743
+ };
1744
+ C.isNullOrEmpty(t.body) || (s.jsonBody = t.body);
1745
+ let r = S.deserialize(t.path);
1746
+ for (let g in r)
1747
+ s[g] = r[g];
1748
+ let n = S.getPath(t.path);
1749
+ s = X.sort(s);
1750
+ let l = Mt.signDictionary(s, !1), i = `POST${n}?${l}${this.appSecret}`, a = await this.hasher.compute(i);
1751
+ s.sign = a.toLowerCase(), delete s.jsonBody, s = X.sort(s);
1752
+ let o = S.serialize(s);
1753
+ return t.url = S.concatUrl(this.baseUrl, n + "?" + o), await this.requester.send(t);
1754
+ }
1755
+ }
1756
+ class Vt extends ht {
1757
+ constructor() {
1758
+ super(...arguments), this.type = "Local";
1759
+ }
1760
+ open(t) {
1761
+ this.request = Lt.create({
1762
+ baseURL: K.api.url
1763
+ // withCredentials: true, // send cookies when cross-domain requests
1764
+ // timeout: 15000
1765
+ }), this.request.interceptors.request.use(
1766
+ async (e) => {
1767
+ if (S.httpOrHttps(e.url))
1768
+ return e;
1769
+ let s = It(), r = S.getUrl(e.baseURL + e.url, e.params);
1770
+ if (e.headers.Authorization = await s.getAuthorization(r, e.data), !e.headers["Accept-Language"]) {
1771
+ let n = tt();
1772
+ e.headers["Accept-Language"] = n.language;
1773
+ }
1774
+ return e;
1775
+ },
1776
+ (e) => (console.log(e), Promise.reject(e))
1777
+ );
1778
+ }
1779
+ send(t) {
1780
+ return Promise.resolve(void 0);
1781
+ }
1782
+ /**
1783
+ * GET请求
1784
+ */
1785
+ async get(t, e = null, s = null) {
1786
+ let r = { method: "get", url: t, params: e, headers: s };
1787
+ return this.request(r).then((n) => this.handleResponse(n)).catch((n) => this.handleError(n));
1788
+ }
1789
+ /**
1790
+ * POST请求
1791
+ */
1792
+ async post(t, e = null, s = null) {
1793
+ return this.request.post(t, e, s).then((r) => this.handleResponse(r)).catch((r) => this.handleError(r));
1794
+ }
1795
+ /**
1796
+ * PATCH请求
1797
+ */
1798
+ async patch(t, e = null, s = null) {
1799
+ return this.request.patch(t, e, s).then((r) => this.handleResponse(r)).catch((r) => this.handleError(r));
1800
+ }
1801
+ /**
1802
+ * 处理响应信息 或 响应体信息
1803
+ */
1804
+ handleResponse(t) {
1805
+ if (S.httpOrHttps(t.config.url))
1806
+ return Promise.resolve(t.data);
1807
+ let e = t.config.tip;
1808
+ return this.handleResponseBody(t.data, e);
1809
+ }
1810
+ /**
1811
+ * 处理响应体信息,并自动添加响应通知
1812
+ */
1813
+ handleResponseBody(t, e = !1) {
1814
+ return Ot().add(t.code, t.message, t.stack, t.elapsed), e && t.code == "Ok" && this.messageService.success(t.message), t.code != "Ok" ? Promise.reject(t) : Promise.resolve(t);
1815
+ }
1816
+ /**
1817
+ * 处理网络错误和响应错误场景
1818
+ */
1819
+ handleError(t) {
1820
+ if (t instanceof Nt) {
1821
+ Ot().add("error", t.message, t.stack);
1822
+ let s = t.message;
1823
+ t.message == "Network Error" && (S.httpOrHttps(t.config.url) ? s = "接口网络错误: " + t.config.url : s = "接口网络错误: " + t.config.baseURL + t.config.url), this.messageService.error(s);
1824
+ } else
1825
+ this.messageService.error(t.message);
1826
+ return Promise.reject(t);
1890
1827
  }
1891
1828
  }
1892
- const te = _t, nt = class nt {
1829
+ class Yt extends E {
1830
+ getInstances() {
1831
+ return [new Ft(), new Wt(), new Vt()];
1832
+ }
1833
+ create(t, e) {
1834
+ return super.create(t);
1835
+ }
1836
+ /**
1837
+ * 获取默认请求器
1838
+ */
1839
+ getDefault() {
1840
+ return this._default != null ? this._default : (this._default = this.create("Default"), this._default);
1841
+ }
1842
+ /**
1843
+ * 获取本地请求实例
1844
+ * 获取完毕后,下游第一行代码就要配置消息服务
1845
+ */
1846
+ getLocal() {
1847
+ return this.local == null && (this.local = this.create("Local")), this.local;
1848
+ }
1849
+ }
1850
+ class Qt {
1851
+ }
1852
+ class Kt extends Qt {
1853
+ constructor() {
1854
+ super(...arguments), this.type = "Base64";
1855
+ }
1856
+ open(t) {
1857
+ }
1858
+ encode(t) {
1859
+ let e = z.enc.Utf8.parse(t);
1860
+ return z.enc.Base64.stringify(e);
1861
+ }
1862
+ decode(t) {
1863
+ let e = z.enc.Base64.parse(t);
1864
+ return z.enc.Utf8.stringify(e);
1865
+ }
1866
+ }
1867
+ class Xt extends E {
1868
+ getInstances() {
1869
+ return [new Kt()];
1870
+ }
1871
+ /**
1872
+ * 创建执行类型的Hash实例
1873
+ */
1874
+ create(t, e) {
1875
+ let s = super.create(t);
1876
+ return s.open(null), s;
1877
+ }
1878
+ /**
1879
+ * 获取Base64 编码器对象
1880
+ */
1881
+ getBase64() {
1882
+ return this.base64 != null ? this.base64 : (this.base64 = this.create("Base64"), this.base64);
1883
+ }
1884
+ }
1885
+ class Zt {
1886
+ constructor() {
1887
+ this.type = "Default";
1888
+ }
1889
+ open(t) {
1890
+ this.hasher = gt.getMd5();
1891
+ }
1892
+ callback(t) {
1893
+ }
1894
+ async getSign(t, e, s, r, n) {
1895
+ let l = "";
1896
+ s && (y.isString(s) ? l = s.toString() : l = JSON.stringify(s));
1897
+ let i = `${t}.${e}.${l}.${r}.${n}`;
1898
+ return (await this.hasher.compute(i)).toUpperCase();
1899
+ }
1900
+ loginUrl(t) {
1901
+ return "";
1902
+ }
1903
+ dispose() {
1904
+ }
1905
+ }
1906
+ class Gt extends E {
1907
+ getInstances() {
1908
+ return [new Zt()];
1909
+ }
1910
+ /**
1911
+ * 获取指定签名实例
1912
+ */
1913
+ create(t, e) {
1914
+ let s = super.create(t);
1915
+ return s.open(null), s;
1916
+ }
1917
+ }
1918
+ const st = class st {
1893
1919
  constructor() {
1894
1920
  this.type = "Bearer";
1895
1921
  }
1896
1922
  open(t) {
1897
- this.requester = N.getRequester().getLocal();
1923
+ this.requester = k.getRequester().getLocal();
1898
1924
  }
1899
1925
  async login(t) {
1900
1926
  return this.requester.post(`/user/login?type=${this.type}`, t).then((e) => {
1901
1927
  let s = e.data;
1902
- return w.setObject("sso", s), Promise.resolve(e);
1928
+ return x.setObject("sso", s), Promise.resolve(e);
1903
1929
  });
1904
1930
  }
1905
1931
  loginUrl(t) {
1906
1932
  return "";
1907
1933
  }
1908
1934
  getUser() {
1909
- let t = w.getObject("sso");
1935
+ let t = x.getObject("sso");
1910
1936
  return { userId: t.userId, token: t.token, secret: t.userSecret };
1911
1937
  }
1912
1938
  getAuthorization(t, e, s, r = "") {
@@ -1914,12 +1940,12 @@ const te = _t, nt = class nt {
1914
1940
  return r && (n += " " + r), n;
1915
1941
  }
1916
1942
  logout() {
1917
- w.remove(nt.loginKey), w.remove("sso");
1943
+ x.remove(st.loginKey), x.remove("sso");
1918
1944
  }
1919
1945
  };
1920
- nt.loginKey = "user";
1921
- let W = nt;
1922
- class ee {
1946
+ st.loginKey = "user";
1947
+ let V = st;
1948
+ class Ht {
1923
1949
  constructor() {
1924
1950
  this.type = "Nio";
1925
1951
  }
@@ -1927,23 +1953,23 @@ class ee {
1927
1953
  this.url = t.url, this.app_id = t.app_id;
1928
1954
  }
1929
1955
  async login(t) {
1930
- w.setObject("sso", t);
1956
+ x.setObject("sso", t);
1931
1957
  }
1932
1958
  loginUrl(t) {
1933
1959
  let e = encodeURIComponent(t);
1934
1960
  return `${this.url}/oauth2/authorize?client_id=${this.app_id}&redirect_uri=${e}&response_type=code`;
1935
1961
  }
1936
1962
  getUser() {
1937
- return w.getObject(W.loginKey);
1963
+ return x.getObject(V.loginKey);
1938
1964
  }
1939
1965
  getAuthorization(t, e, s, r) {
1940
1966
  return `${this.type} ${t} ${e} ${s} pc`;
1941
1967
  }
1942
1968
  logout() {
1943
- w.remove("sso");
1969
+ x.remove("sso");
1944
1970
  }
1945
1971
  }
1946
- class se {
1972
+ class _t {
1947
1973
  constructor() {
1948
1974
  this.type = "WeiXin";
1949
1975
  }
@@ -1963,7 +1989,7 @@ class se {
1963
1989
  logout() {
1964
1990
  }
1965
1991
  }
1966
- class re {
1992
+ class te {
1967
1993
  constructor() {
1968
1994
  this.type = "Anonymous";
1969
1995
  }
@@ -1975,10 +2001,10 @@ class re {
1975
2001
  return "";
1976
2002
  }
1977
2003
  getUser() {
1978
- let t = w.get("anonymous");
2004
+ let t = x.get("anonymous");
1979
2005
  if (!t) {
1980
- let e = S.getUniqueId();
1981
- w.set("anonymous", e), t = e;
2006
+ let e = C.getUniqueId();
2007
+ x.set("anonymous", e), t = e;
1982
2008
  }
1983
2009
  return { userId: "", token: t, secret: "" };
1984
2010
  }
@@ -1988,24 +2014,24 @@ class re {
1988
2014
  logout() {
1989
2015
  }
1990
2016
  }
1991
- class ne {
2017
+ class ee {
1992
2018
  constructor() {
1993
2019
  this.type = "Secret";
1994
2020
  }
1995
2021
  open(t) {
1996
- this.requester = N.getRequester().getLocal();
2022
+ this.requester = k.getRequester().getLocal();
1997
2023
  }
1998
2024
  async login(t) {
1999
2025
  return this.requester.post(`/user/login?type=${this.type}`, t).then((e) => {
2000
2026
  let s = e.data;
2001
- return w.setObject("sso", s), Promise.resolve(e);
2027
+ return x.setObject("sso", s), Promise.resolve(e);
2002
2028
  });
2003
2029
  }
2004
2030
  loginUrl(t) {
2005
2031
  return "";
2006
2032
  }
2007
2033
  getUser() {
2008
- let t = w.getObject(W.loginKey);
2034
+ let t = x.getObject(V.loginKey);
2009
2035
  return { userId: t.userId, token: t.token, secret: t.userSecret };
2010
2036
  }
2011
2037
  getAuthorization(t, e, s, r) {
@@ -2014,50 +2040,185 @@ class ne {
2014
2040
  logout() {
2015
2041
  }
2016
2042
  }
2017
- class le {
2043
+ class se extends E {
2044
+ /**
2045
+ * @extends {getInstances}
2046
+ */
2047
+ getInstances() {
2048
+ return [new ee(), new Ht(), new _t(), new V(), new te()];
2049
+ }
2018
2050
  /**
2019
2051
  * 获取指定SSO实例
2020
2052
  */
2021
- static getSso(t) {
2022
- let s = [new ne(), new ee(), new se(), new W(), new re()].find((r) => r.type.toLowerCase() == t.toLowerCase());
2023
- if (s == null)
2024
- throw new Error(`未支持的SSO类型:${t}`);
2025
- return s;
2053
+ create(t, e) {
2054
+ let r = Et().ssos.find((i) => i.type.toUpperCase() == t.toUpperCase()), n = { url: r == null ? void 0 : r.url, app_id: r == null ? void 0 : r.appId }, l = super.create(t);
2055
+ return l.open(n), l;
2026
2056
  }
2027
2057
  }
2028
- class ie {
2058
+ class Y {
2059
+ getPath(t) {
2060
+ let e = X.getValueIgnoreCase(t, this.mappings);
2061
+ return S.httpOrHttps(e) ? e : this.baseUrl + e;
2062
+ }
2063
+ async loadPathAsync(t, e) {
2064
+ let s = this.baseUrl + t;
2065
+ await H.loadPathAsync(s, e);
2066
+ }
2067
+ async loadAsync(t) {
2068
+ let e = C.getArray(t), s = [];
2069
+ for (let r = 0; r < e.length; r++) {
2070
+ let n = this.getPath(e[r]);
2071
+ s.push(n);
2072
+ }
2073
+ return await H.loadAsync(s);
2074
+ }
2075
+ }
2076
+ class re extends Y {
2029
2077
  constructor() {
2030
- this.type = "Default";
2078
+ super(...arguments), this.type = "Jsdelivr", this.mappings = {
2079
+ "monaco-editor": "/npm/monaco-editor@0.49.0/min/vs"
2080
+ };
2031
2081
  }
2032
2082
  open(t) {
2033
- this.hasher = tt.getMd5();
2083
+ this.baseUrl = "https://cdn.jsdelivr.net";
2034
2084
  }
2035
- callback(t) {
2085
+ }
2086
+ class ne extends Y {
2087
+ constructor() {
2088
+ super(...arguments), this.type = "StaticFile", this.mappings = {
2089
+ //通过cdn引入样式文件,并且打包文件中不会包括样式文件
2090
+ "element-plus": "/element-plus/2.7.5/index.css",
2091
+ // 加载monaco cdn压缩资源包,可以大幅减少本地请求数量
2092
+ //首次加载4.11s
2093
+ //不能使用,偶发404:https://cdn.staticfile.net/monaco-editor/0.45.0/min/vs
2094
+ "monaco-editor": "https://cdn.jsdelivr.net/npm/monaco-editor@0.49.0/min/vs",
2095
+ quill: "/quill/2.0.2/quill.snow.min.css",
2096
+ "fort-awesome": "https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css"
2097
+ };
2036
2098
  }
2037
- async getSign(t, e, s, r, n) {
2038
- let l = "";
2039
- s && (y.isString(s) ? l = s.toString() : l = JSON.stringify(s));
2040
- let i = `${t}.${e}.${l}.${r}.${n}`;
2041
- return (await this.hasher.compute(i)).toUpperCase();
2099
+ open(t) {
2100
+ this.baseUrl = "https://cdn.staticfile.net";
2042
2101
  }
2043
- loginUrl(t) {
2044
- return "";
2102
+ }
2103
+ class le extends Y {
2104
+ constructor() {
2105
+ super(...arguments), this.type = "BootCdn", this.mappings = {
2106
+ "element-plus": "/ajax/libs/element-plus/2.4.4/index.css",
2107
+ "monaco-editor": "/ajax/libs/monaco-editor/0.45.0/min/vs",
2108
+ quill: "/ajax/libs/quill/1.3.7/quill.snow.min.css"
2109
+ };
2045
2110
  }
2046
- dispose() {
2111
+ open(t) {
2112
+ this.baseUrl = "https://cdn.bootcdn.net";
2047
2113
  }
2048
2114
  }
2049
- class ae {
2115
+ class ie extends Y {
2116
+ constructor() {
2117
+ super(...arguments), this.type = "Local", this.mappings = {
2118
+ //引入本地样式文件,会导致始终打包进打包文件
2119
+ //后续可以改进为:发包后,单独存放静态样式文件,框架加载时,自动通过异步方式加载样式文件
2120
+ //为了同时让下游同时支持CDN引入和本地引入样式表文件,所以需要把element-plus的样式文件,独立打包到一个文件中,让下游:
2121
+ //1. 启用CDN时,能够使用CDN加载,而不加载本地element-plus的样式文件
2122
+ //2. 不启用CDN时,采用本地打包方式,支持载入本地element-plus样式表文件
2123
+ //所以,上游包,必须同时包含独立的element-plus样式表文件
2124
+ //复制包内的样式表文件,方便cdn方式不加载样式表 和 未启用cdn方式加载 样式表
2125
+ "element-plus": "element-plus/dist/index.css",
2126
+ quill: "quill/dist/quill.snow.css",
2127
+ "fort-awesome": "@fortawesome/fontawesome-free/css/all.min.css"
2128
+ };
2129
+ }
2130
+ open(t) {
2131
+ this.baseUrl = t;
2132
+ }
2133
+ }
2134
+ class ue extends Y {
2135
+ constructor() {
2136
+ super(...arguments), this.type = "Unpkg", this.mappings = {
2137
+ //首次加载很不稳定: 30s+, 稳定后: 首次加载2.5s(使用https加载,可以防止本地http访问外部http资源时的请求警告)
2138
+ "monaco-editor": ["/monaco-editor@0.49.0/min/vs"]
2139
+ };
2140
+ }
2141
+ open(t) {
2142
+ this.baseUrl = "https://unpkg.com";
2143
+ }
2144
+ }
2145
+ class ae extends E {
2146
+ getInstances() {
2147
+ return [new re(), new ne(), new le(), new ie(), new ue()];
2148
+ }
2050
2149
  /**
2051
- * 获取指定签名实例
2150
+ * 获取指定CDN实例
2052
2151
  */
2053
- static create(t) {
2054
- let s = [new ie()].find((r) => r.type.toLowerCase() == t.toLowerCase());
2055
- if (s == null)
2056
- throw new Error(`未支持的Signer类型:${t}`);
2057
- return s;
2152
+ create(t, e) {
2153
+ let s = super.create(t);
2154
+ return s.open(e), s;
2155
+ }
2156
+ }
2157
+ class oe {
2158
+ constructor() {
2159
+ this.type = "Json";
2058
2160
  }
2059
2161
  }
2060
- class ue {
2162
+ class ce extends oe {
2163
+ }
2164
+ class he extends E {
2165
+ getInstances() {
2166
+ return [new ce()];
2167
+ }
2168
+ }
2169
+ class ge {
2170
+ constructor() {
2171
+ this.type = "xlsx";
2172
+ }
2173
+ open(t) {
2174
+ }
2175
+ export(t, e) {
2176
+ if (!e)
2177
+ throw new Error("Excel名称不能为空");
2178
+ t || (t = []);
2179
+ let s;
2180
+ t.length > 0 ? s = Object.keys(t[0]) : s = [];
2181
+ let r = [], n = [];
2182
+ if (s.forEach((c) => {
2183
+ n.push(c);
2184
+ }), r.push(n), t.length > 0)
2185
+ for (let c = 0; c < t.length; c++) {
2186
+ let g = t[c], p = [];
2187
+ Object.keys(g).forEach((j) => {
2188
+ p.push(g[j]);
2189
+ }), r.push(p);
2190
+ }
2191
+ let l = nt.book_new(), i = nt.json_to_sheet(r, { skipHeader: !0 });
2192
+ nt.book_append_sheet(l, i, "abc");
2193
+ let a = 65;
2194
+ for (let c = 0; c < s.length; c++) {
2195
+ let p = `${String.fromCharCode(a + c)}1`;
2196
+ i[p].s = {
2197
+ alignment: { horizontal: "center" },
2198
+ font: { bold: !0, color: { rgb: "000000" } },
2199
+ fill: { fgColor: { rgb: "409eff" } }
2200
+ };
2201
+ }
2202
+ let o = [];
2203
+ s.forEach((c) => {
2204
+ let g = t[0][c], p = { wpx: 50 };
2205
+ typeof g == "string" && (p.wpx = 100), o.push(p);
2206
+ }), i["!cols"] = o, $t(l, e);
2207
+ }
2208
+ }
2209
+ class de extends E {
2210
+ getInstances() {
2211
+ return [new ge()];
2212
+ }
2213
+ /**
2214
+ * 获取Excel实例
2215
+ */
2216
+ create(t, e) {
2217
+ let s = super.create(t);
2218
+ return s.open(e), s;
2219
+ }
2220
+ }
2221
+ class fe {
2061
2222
  constructor() {
2062
2223
  this.type = "Sort";
2063
2224
  }
@@ -2082,7 +2243,7 @@ class ue {
2082
2243
  }
2083
2244
  }
2084
2245
  }
2085
- class oe {
2246
+ class me {
2086
2247
  constructor() {
2087
2248
  this.type = "I18N";
2088
2249
  }
@@ -2095,7 +2256,7 @@ class oe {
2095
2256
  copy(t, e, s) {
2096
2257
  }
2097
2258
  }
2098
- class ce {
2259
+ class pe {
2099
2260
  constructor() {
2100
2261
  this.type = "Expression";
2101
2262
  }
@@ -2108,20 +2269,48 @@ class ce {
2108
2269
  copy(t, e, s) {
2109
2270
  }
2110
2271
  }
2111
- class he {
2272
+ class ye extends E {
2273
+ getInstances() {
2274
+ return [new fe(), new me(), new pe()];
2275
+ }
2112
2276
  /**
2113
2277
  * 获取指定特征实例
2114
2278
  */
2115
- static create(t) {
2116
- let s = [new ue(), new oe(), new ce()].find((r) => r.type.toLowerCase() == t.toLowerCase());
2117
- if (s == null)
2118
- throw new Error(`未支持的Feature类型:${t}`);
2119
- return s;
2279
+ create(t, e) {
2280
+ let s = super.create(t);
2281
+ return s.open(null), s;
2120
2282
  }
2121
2283
  }
2122
- const $ = class $ {
2284
+ class be {
2285
+ createAsync(t) {
2286
+ return Promise.resolve(void 0);
2287
+ }
2288
+ deleteAsync(t) {
2289
+ return Promise.resolve(void 0);
2290
+ }
2291
+ getAsync(t) {
2292
+ return Promise.resolve(void 0);
2293
+ }
2294
+ insertAsync(t, e) {
2295
+ return Promise.resolve(void 0);
2296
+ }
2297
+ openAsync(t) {
2298
+ return Promise.resolve(0);
2299
+ }
2300
+ saveAsync(t, e) {
2301
+ return Promise.resolve(void 0);
2302
+ }
2303
+ updateAsync(t, e) {
2304
+ return Promise.resolve(void 0);
2305
+ }
2306
+ commit() {
2307
+ }
2308
+ dispose() {
2309
+ }
2310
+ }
2311
+ const N = class N extends be {
2123
2312
  constructor() {
2124
- this.type = "IndexedDb", this.database = null, this.store = null, this.objectStoreNames = null;
2313
+ super(...arguments), this.type = "IndexedDb", this.database = null, this.store = null, this.objectStoreNames = null;
2125
2314
  }
2126
2315
  /**
2127
2316
  * 进行数据库初始化 或 从现有数据库中得到最新版本号(数据库首次初始化和open是版本号升级时,会触发升级事件)
@@ -2131,7 +2320,7 @@ const $ = class $ {
2131
2320
  let r = indexedDB.open(t);
2132
2321
  r.onsuccess = (n) => {
2133
2322
  let l = n.target.result;
2134
- $.version = l.version, this.objectStoreNames = l.objectStoreNames, e($.version);
2323
+ N.version = l.version, this.objectStoreNames = l.objectStoreNames, e(N.version);
2135
2324
  }, r.onerror = (n) => {
2136
2325
  s(n.target);
2137
2326
  };
@@ -2142,7 +2331,7 @@ const $ = class $ {
2142
2331
  */
2143
2332
  async createAsync(t) {
2144
2333
  return this.store = t, this.objectStoreNames.contains(t) ? Promise.resolve(!0) : new Promise((e, s) => {
2145
- let r = indexedDB.open(this.database, ++$.version);
2334
+ let r = indexedDB.open(this.database, ++N.version);
2146
2335
  r.onupgradeneeded = (n) => {
2147
2336
  let l = n.target.result;
2148
2337
  l.objectStoreNames.contains(this.store) || l.createObjectStore(this.store);
@@ -2158,7 +2347,7 @@ const $ = class $ {
2158
2347
  */
2159
2348
  async openDbAsync() {
2160
2349
  return new Promise((t, e) => {
2161
- let s = indexedDB.open(this.database, $.version);
2350
+ let s = indexedDB.open(this.database, N.version);
2162
2351
  s.onsuccess = (r) => {
2163
2352
  let n = r.target.result;
2164
2353
  t(n);
@@ -2178,17 +2367,17 @@ const $ = class $ {
2178
2367
  return;
2179
2368
  }
2180
2369
  let n = e.transaction(this.store, "readonly");
2181
- n.oncomplete = (u) => {
2370
+ n.oncomplete = (a) => {
2182
2371
  e.close();
2183
- }, n.onerror = (u) => {
2184
- r(u);
2372
+ }, n.onerror = (a) => {
2373
+ r(a);
2185
2374
  };
2186
2375
  let i = n.objectStore(this.store).get(t);
2187
- i.onsuccess = (u) => {
2188
- let o = u.target.result;
2376
+ i.onsuccess = (a) => {
2377
+ let o = a.target.result;
2189
2378
  s(o);
2190
- }, i.onerror = (u) => {
2191
- r(u.target);
2379
+ }, i.onerror = (a) => {
2380
+ r(a.target);
2192
2381
  };
2193
2382
  });
2194
2383
  }
@@ -2206,11 +2395,11 @@ const $ = class $ {
2206
2395
  }, l.onerror = (o) => {
2207
2396
  n(o);
2208
2397
  };
2209
- let u = l.objectStore(this.store).add(e, t);
2210
- u.onsuccess = (o) => {
2398
+ let a = l.objectStore(this.store).add(e, t);
2399
+ a.onsuccess = (o) => {
2211
2400
  let c = o.target.result;
2212
2401
  r(c);
2213
- }, u.onerror = (o) => {
2402
+ }, a.onerror = (o) => {
2214
2403
  let c = o.target.error;
2215
2404
  n(c.message);
2216
2405
  };
@@ -2235,7 +2424,7 @@ const $ = class $ {
2235
2424
  }, l.onerror = (c) => {
2236
2425
  n(c);
2237
2426
  };
2238
- let i = R.clone(e), o = l.objectStore(this.store).put(i, t);
2427
+ let i = F.clone(e), o = l.objectStore(this.store).put(i, t);
2239
2428
  o.onsuccess = (c) => {
2240
2429
  let g = c.target.result;
2241
2430
  r(g);
@@ -2254,17 +2443,17 @@ const $ = class $ {
2254
2443
  let e = await this.openDbAsync();
2255
2444
  return new Promise((s, r) => {
2256
2445
  let n = e.transaction(this.store, "readwrite");
2257
- n.oncomplete = (u) => {
2446
+ n.oncomplete = (a) => {
2258
2447
  e.close();
2259
- }, n.onerror = (u) => {
2260
- r(u);
2448
+ }, n.onerror = (a) => {
2449
+ r(a);
2261
2450
  };
2262
2451
  let i = n.objectStore(this.store).delete(t);
2263
- i.onsuccess = (u) => {
2264
- let o = u.target.result;
2452
+ i.onsuccess = (a) => {
2453
+ let o = a.target.result;
2265
2454
  s(o);
2266
- }, i.onerror = (u) => {
2267
- let o = u.target.error.message;
2455
+ }, i.onerror = (a) => {
2456
+ let o = a.target.error.message;
2268
2457
  r(o);
2269
2458
  };
2270
2459
  });
@@ -2280,260 +2469,127 @@ const $ = class $ {
2280
2469
  dispose() {
2281
2470
  }
2282
2471
  };
2283
- $.version = null;
2284
- let ft = $;
2285
- class ge {
2472
+ N.version = null;
2473
+ let ot = N;
2474
+ class xe extends E {
2475
+ getInstances() {
2476
+ return [new ot()];
2477
+ }
2286
2478
  /**
2287
2479
  * 获取指定类型的提供程序
2288
2480
  */
2289
- static create(t) {
2290
- let s = [new ft()].find((r) => r.type == t);
2291
- if (s == null)
2292
- throw new Error(`未实现数据库提供程序:${t}`);
2293
- return s;
2294
- }
2295
- }
2296
- class fe {
2297
- constructor() {
2298
- this.type = "xlsx";
2299
- }
2300
- open(t) {
2301
- }
2302
- export(t, e) {
2303
- if (!e)
2304
- throw new Error("Excel名称不能为空");
2305
- t || (t = []);
2306
- let s;
2307
- t.length > 0 ? s = Object.keys(t[0]) : s = [];
2308
- let r = [], n = [];
2309
- if (s.forEach((c) => {
2310
- n.push(c);
2311
- }), r.push(n), t.length > 0)
2312
- for (let c = 0; c < t.length; c++) {
2313
- let g = t[c], p = [];
2314
- Object.keys(g).forEach((v) => {
2315
- p.push(g[v]);
2316
- }), r.push(p);
2317
- }
2318
- let l = it.book_new(), i = it.json_to_sheet(r, { skipHeader: !0 });
2319
- it.book_append_sheet(l, i, "abc");
2320
- let u = 65;
2321
- for (let c = 0; c < s.length; c++) {
2322
- let p = `${String.fromCharCode(u + c)}1`;
2323
- i[p].s = {
2324
- alignment: { horizontal: "center" },
2325
- font: { bold: !0, color: { rgb: "000000" } },
2326
- fill: { fgColor: { rgb: "409eff" } }
2327
- };
2328
- }
2329
- let o = [];
2330
- s.forEach((c) => {
2331
- let g = t[0][c], p = { wpx: 50 };
2332
- typeof g == "string" && (p.wpx = 100), o.push(p);
2333
- }), i["!cols"] = o, Dt(l, e);
2481
+ create(t, e) {
2482
+ return super.create(t);
2334
2483
  }
2335
- }
2336
- class de {
2337
2484
  /**
2338
- * 获取Excel实例
2485
+ * 获取并开启 指定类型的驱动程序
2339
2486
  */
2340
- static create(t) {
2341
- let s = [new fe()].find((r) => r.type.toLowerCase() == t.toLowerCase());
2342
- if (s == null)
2343
- throw new Error(`未支持的 Excel 类型:${t}`);
2344
- return s;
2345
- }
2346
- }
2347
- class V {
2348
- getPath(t) {
2349
- let e = X.getValueIgnoreCase(t, this.mappings);
2350
- return k.httpOrHttps(e) ? e : this.baseUrl + e;
2351
- }
2352
- async loadPathAsync(t, e) {
2353
- let s = this.baseUrl + t;
2354
- await H.loadPathAsync(s, e);
2355
- }
2356
- async loadAsync(t) {
2357
- let e = S.getArray(t), s = [];
2358
- for (let r = 0; r < e.length; r++) {
2359
- let n = this.getPath(e[r]);
2360
- s.push(n);
2361
- }
2362
- return await H.loadAsync(s);
2487
+ async getDefault(t, e = null) {
2488
+ return this._default != null ? this._default : (this._default = this.create(t), await this._default.openAsync("halo"), e != null && await this._default.createAsync(e), this._default);
2363
2489
  }
2364
2490
  }
2365
- class me extends V {
2366
- constructor() {
2367
- super(...arguments), this.type = "Jsdelivr", this.mappings = {
2368
- "monaco-editor": "/npm/monaco-editor@0.49.0/min/vs"
2369
- };
2370
- }
2371
- open(t) {
2372
- this.baseUrl = "https://cdn.jsdelivr.net";
2373
- }
2374
- }
2375
- class pe extends V {
2376
- constructor() {
2377
- super(...arguments), this.type = "StaticFile", this.mappings = {
2378
- //通过cdn引入样式文件,并且打包文件中不会包括样式文件
2379
- "element-plus": "/element-plus/2.7.5/index.css",
2380
- // 加载monaco cdn压缩资源包,可以大幅减少本地请求数量
2381
- //首次加载4.11s
2382
- //不能使用,偶发404:https://cdn.staticfile.net/monaco-editor/0.45.0/min/vs
2383
- "monaco-editor": "https://cdn.jsdelivr.net/npm/monaco-editor@0.49.0/min/vs",
2384
- quill: "/quill/2.0.2/quill.snow.min.css",
2385
- "fort-awesome": "https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css"
2386
- };
2387
- }
2388
- open(t) {
2389
- this.baseUrl = "https://cdn.staticfile.net";
2390
- }
2391
- }
2392
- class ye extends V {
2393
- constructor() {
2394
- super(...arguments), this.type = "BootCdn", this.mappings = {
2395
- "element-plus": "/ajax/libs/element-plus/2.4.4/index.css",
2396
- "monaco-editor": "/ajax/libs/monaco-editor/0.45.0/min/vs",
2397
- quill: "/ajax/libs/quill/1.3.7/quill.snow.min.css"
2398
- };
2399
- }
2400
- open(t) {
2401
- this.baseUrl = "https://cdn.bootcdn.net";
2402
- }
2403
- }
2404
- class be extends V {
2405
- constructor() {
2406
- super(...arguments), this.type = "Local", this.mappings = {
2407
- //引入本地样式文件,会导致始终打包进打包文件
2408
- //后续可以改进为:发包后,单独存放静态样式文件,框架加载时,自动通过异步方式加载样式文件
2409
- //为了同时让下游同时支持CDN引入和本地引入样式表文件,所以需要把element-plus的样式文件,独立打包到一个文件中,让下游:
2410
- //1. 启用CDN时,能够使用CDN加载,而不加载本地element-plus的样式文件
2411
- //2. 不启用CDN时,采用本地打包方式,支持载入本地element-plus样式表文件
2412
- //所以,上游包,必须同时包含独立的element-plus样式表文件
2413
- //复制包内的样式表文件,方便cdn方式不加载样式表 和 未启用cdn方式加载 样式表
2414
- "element-plus": "element-plus/dist/index.css",
2415
- quill: "quill/dist/quill.snow.css",
2416
- "fort-awesome": "@fortawesome/fontawesome-free/css/all.min.css"
2417
- };
2418
- }
2419
- open(t) {
2420
- this.baseUrl = t;
2421
- }
2422
- }
2423
- class we extends V {
2424
- constructor() {
2425
- super(...arguments), this.type = "Unpkg", this.mappings = {
2426
- //首次加载很不稳定: 30s+, 稳定后: 首次加载2.5s(使用https加载,可以防止本地http访问外部http资源时的请求警告)
2427
- "monaco-editor": ["/monaco-editor@0.49.0/min/vs"]
2428
- };
2491
+ const W = class W {
2492
+ /**
2493
+ * 获取并缓存工厂实例
2494
+ */
2495
+ static create(t, e) {
2496
+ let s = W.mappings[t];
2497
+ return s || (s = new e(), W.mappings[t] = s), s;
2429
2498
  }
2430
- open(t) {
2431
- this.baseUrl = "https://unpkg.com";
2499
+ //#endregion
2500
+ //#region 工厂实例
2501
+ /**
2502
+ *获取CDN工厂
2503
+ */
2504
+ static getCdn() {
2505
+ return this.create("CdnFactory", ae);
2432
2506
  }
2433
- }
2434
- class Se {
2435
2507
  /**
2436
- * 获取指定CDN实例
2508
+ *获取编码器工厂
2437
2509
  */
2438
- static create(t) {
2439
- let s = [new me(), new pe(), new ye(), new be(), new we()].find((r) => r.type.toLowerCase() == t.toLowerCase());
2440
- if (s == null)
2441
- throw new Error(`未支持的Cdn类型:${t}`);
2442
- return s;
2510
+ static getEncoder() {
2511
+ return this.create("EncoderFactory", Xt);
2443
2512
  }
2444
- }
2445
- class Y {
2446
2513
  /**
2447
- * 获取SSO
2514
+ *获取Excel工厂
2448
2515
  */
2449
- static getSso(t) {
2450
- if (!t)
2451
- throw new Error("SSO 配置类型不能为空");
2452
- let s = It().ssos.find((l) => l.type.toUpperCase() == t.toUpperCase()), r = { url: s == null ? void 0 : s.url, app_id: s == null ? void 0 : s.appId }, n = le.getSso(t);
2453
- return n.open(r), n;
2516
+ static getExcel() {
2517
+ return this.create("ExcelFactory", de);
2454
2518
  }
2455
2519
  /**
2456
- * 获取签名器
2520
+ *获取Explainer工厂
2457
2521
  */
2458
- static getSigner(t) {
2459
- if (!t)
2460
- throw new Error("Signer 配置类型不能为空");
2461
- let e = ae.create(t);
2462
- return e.open(null), e;
2522
+ static getExplainer() {
2523
+ return this.create("ExplainerFactory", he);
2463
2524
  }
2464
2525
  /**
2465
- * 获取特征
2526
+ *获取特征工厂
2466
2527
  */
2467
- static getFeature(t) {
2468
- if (!t)
2469
- throw new Error("Feature 配置类型不能为空");
2470
- let e = he.create(t);
2471
- return e.open(null), e;
2528
+ static getFeature() {
2529
+ return this.create("FeatureFactory", ye);
2472
2530
  }
2473
2531
  /**
2474
- * 获取并开启 指定类型的驱动程序
2532
+ *获取哈希工厂
2475
2533
  */
2476
- static async getProviderAsync(t, e = null) {
2477
- let s = ge.create(t);
2478
- return await s.openAsync("halo"), e != null && await s.createAsync(e), s;
2534
+ static getHasher() {
2535
+ return this.create("HasherFactory", gt);
2479
2536
  }
2480
2537
  /**
2481
- * 获取Excel实例
2538
+ *获取提供程序工厂
2482
2539
  */
2483
- static getExcel(t) {
2484
- let e = de.create(t);
2485
- return e.open(null), e;
2540
+ static getProvider() {
2541
+ return this.create("ProviderFactory", xe);
2486
2542
  }
2487
2543
  /**
2488
- * 获取CDN实例
2544
+ *获取请求器工厂
2489
2545
  */
2490
- static getCdn(t, e = null) {
2491
- let s = Se.create(t);
2492
- return s.open(e), s;
2546
+ static getRequester() {
2547
+ return this.create("RequesterFactory", Yt);
2493
2548
  }
2494
2549
  /**
2495
- * 获取编码器
2550
+ *获取签名工厂
2496
2551
  */
2497
- static getEncoder(t) {
2498
- let e;
2499
- return S.equalsIgnoreCase(t, "base64") ? e = st.getBase64() : e = st.create(t), e.open(null), e;
2552
+ static getSigner() {
2553
+ return this.create("SignerFactory", Gt);
2500
2554
  }
2501
2555
  /**
2502
- * 获取Hasher
2556
+ *获取SSO工厂
2503
2557
  */
2504
- static getHasher(t) {
2505
- let e;
2506
- return S.equalsIgnoreCase(t, "md5") ? e = tt.getMd5() : e = tt.create(t), e.open(null), e;
2558
+ static getSso() {
2559
+ return this.create("SsoFactory", se);
2507
2560
  }
2508
- }
2561
+ //#endregion
2562
+ };
2563
+ W.mappings = {};
2564
+ let ct = W;
2565
+ const k = ct;
2509
2566
  export {
2510
- z as ArrayHelper,
2511
- $e as ComponentHelper,
2567
+ T as ArrayHelper,
2568
+ qe as ComponentHelper,
2512
2569
  Ue as CookieHelper,
2513
2570
  X as DictionaryHelper,
2514
- U as DomHelper,
2515
- N as DriverFactory,
2516
- Y as DriverHelper,
2517
- bt as EventHelper,
2571
+ $ as DomHelper,
2572
+ k as DriverFactory,
2573
+ pt as EventHelper,
2518
2574
  Z as FileHelper,
2519
- wt as HtmlHelper,
2575
+ yt as HtmlHelper,
2520
2576
  Le as I18nHelper,
2521
- St as ImageHelper,
2522
- Ft as JsonHelper,
2577
+ bt as ImageHelper,
2578
+ zt as JsonHelper,
2523
2579
  xt as MathHelper,
2524
- kt as MicroHelper,
2580
+ wt as MicroHelper,
2525
2581
  G as MountHelper,
2526
- R as ObjectHelper,
2527
- Vt as RequesterFactory,
2582
+ F as ObjectHelper,
2583
+ Yt as RequesterFactory,
2528
2584
  H as ScriptHelper,
2529
- Ot as ScrollHelper,
2585
+ kt as ScrollHelper,
2530
2586
  K as SettingService,
2531
- te as SignHelper,
2532
- w as StorageHelper,
2533
- S as StringHelper,
2534
- Ct as TaskHelper,
2535
- D as TimeHelper,
2587
+ Mt as SignHelper,
2588
+ x as StorageHelper,
2589
+ C as StringHelper,
2590
+ St as TaskHelper,
2591
+ R as TimeHelper,
2536
2592
  _ as TreeHelper,
2537
2593
  y as TypeHelper,
2538
- k as UrlHelper
2594
+ S as UrlHelper
2539
2595
  };