@gx-design-vue/pro-utils 0.2.0-beta.57 → 0.2.0-beta.59
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.
- package/dist/base64/index.d.ts +20 -0
- package/dist/index.d.ts +2 -1
- package/dist/pro-utils.js +418 -332
- package/dist/pro-utils.umd.cjs +2 -1
- package/dist/utils/index.d.ts +24 -0
- package/package.json +1 -1
package/dist/pro-utils.js
CHANGED
|
@@ -1,26 +1,71 @@
|
|
|
1
|
-
import { Comment as J, Fragment as
|
|
2
|
-
|
|
1
|
+
import { Comment as J, Fragment as _, isVNode as S } from "vue";
|
|
2
|
+
class we {
|
|
3
|
+
constructor() {
|
|
4
|
+
this._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
5
|
+
}
|
|
6
|
+
_utf8_encode(t) {
|
|
7
|
+
t = t.replace(/\r\n/g, `
|
|
8
|
+
`);
|
|
9
|
+
let n = "";
|
|
10
|
+
for (let r = 0; r < t.length; r++) {
|
|
11
|
+
const i = t.charCodeAt(r);
|
|
12
|
+
i < 128 ? n += String.fromCharCode(i) : i > 127 && i < 2048 ? (n += String.fromCharCode(i >> 6 | 192), n += String.fromCharCode(i & 63 | 128)) : (n += String.fromCharCode(i >> 12 | 224), n += String.fromCharCode(i >> 6 & 63 | 128), n += String.fromCharCode(i & 63 | 128));
|
|
13
|
+
}
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
16
|
+
_utf8_decode(t) {
|
|
17
|
+
let n = "", r = 0, i = 0, o = 0, c = 0;
|
|
18
|
+
for (; r < t.length; )
|
|
19
|
+
i = t.charCodeAt(r), i < 128 ? (n += String.fromCharCode(i), r++) : i > 191 && i < 224 ? (o = t.charCodeAt(r + 1), n += String.fromCharCode((i & 31) << 6 | o & 63), r += 2) : (o = t.charCodeAt(r + 1), c = t.charCodeAt(r + 2), n += String.fromCharCode((i & 15) << 12 | (o & 63) << 6 | c & 63), r += 3);
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @Author gx12358
|
|
24
|
+
* @DateTime 2024/12/21
|
|
25
|
+
* @lastTime 2024/12/21
|
|
26
|
+
* @description 加密方法
|
|
27
|
+
*/
|
|
28
|
+
encode(t) {
|
|
29
|
+
let n = "", r, i, o, c, f, u, l, s = 0;
|
|
30
|
+
for (t = this._utf8_encode(t); s < t.length; )
|
|
31
|
+
r = t.charCodeAt(s++), i = t.charCodeAt(s++), o = t.charCodeAt(s++), c = r >> 2, f = (r & 3) << 4 | i >> 4, u = (i & 15) << 2 | o >> 6, l = o & 63, Number.isNaN(i) ? u = l = 64 : Number.isNaN(o) && (l = 64), n = n + this._keyStr.charAt(c) + this._keyStr.charAt(f) + this._keyStr.charAt(u) + this._keyStr.charAt(l);
|
|
32
|
+
return n;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @Author gx12358
|
|
36
|
+
* @DateTime 2024/12/21
|
|
37
|
+
* @lastTime 2024/12/21
|
|
38
|
+
* @description 解密
|
|
39
|
+
*/
|
|
40
|
+
decode(t) {
|
|
41
|
+
let n = "", r, i, o, c, f, u, l, s = 0;
|
|
42
|
+
for (t = t.replace(/[^A-Z0-9+/=]/gi, ""); s < t.length; )
|
|
43
|
+
c = this._keyStr.indexOf(t.charAt(s++)), f = this._keyStr.indexOf(t.charAt(s++)), u = this._keyStr.indexOf(t.charAt(s++)), l = this._keyStr.indexOf(t.charAt(s++)), r = c << 2 | f >> 4, i = (f & 15) << 4 | u >> 2, o = (u & 3) << 6 | l, n = n + String.fromCharCode(r), u !== 64 && (n = n + String.fromCharCode(i)), l !== 64 && (n = n + String.fromCharCode(o));
|
|
44
|
+
return n = this._utf8_decode(n), n;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function Z(e, t) {
|
|
3
48
|
return Object.prototype.toString.call(e) === `[object ${t}]`;
|
|
4
49
|
}
|
|
5
|
-
function
|
|
50
|
+
function m(e) {
|
|
6
51
|
return typeof e == "boolean";
|
|
7
52
|
}
|
|
8
|
-
function
|
|
53
|
+
function a(e) {
|
|
9
54
|
return typeof e == "number";
|
|
10
55
|
}
|
|
11
|
-
function
|
|
56
|
+
function d(e) {
|
|
12
57
|
return typeof Array.isArray > "u" ? Object.prototype.toString.call(e) === "[object Array]" : Array.isArray(e);
|
|
13
58
|
}
|
|
14
|
-
function
|
|
15
|
-
return e !== null &&
|
|
59
|
+
function h(e) {
|
|
60
|
+
return e !== null && Z(e, "Object");
|
|
16
61
|
}
|
|
17
|
-
function
|
|
62
|
+
function X(e) {
|
|
18
63
|
return typeof e == "string" || e instanceof String;
|
|
19
64
|
}
|
|
20
|
-
function
|
|
65
|
+
function Ae(e) {
|
|
21
66
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
|
|
22
67
|
}
|
|
23
|
-
function
|
|
68
|
+
function xe(e) {
|
|
24
69
|
if (typeof e != "string")
|
|
25
70
|
return !1;
|
|
26
71
|
try {
|
|
@@ -30,7 +75,7 @@ function he(e) {
|
|
|
30
75
|
return !1;
|
|
31
76
|
}
|
|
32
77
|
}
|
|
33
|
-
function
|
|
78
|
+
function Se() {
|
|
34
79
|
const e = navigator.userAgent || navigator.vendor;
|
|
35
80
|
return !!(/iPhone/.test(e) || /Android/.test(e) && /Mobile/.test(e) || /Windows Phone/.test(e) || /Mobile/.test(e) && !Y());
|
|
36
81
|
}
|
|
@@ -43,21 +88,21 @@ function G(...e) {
|
|
|
43
88
|
for (let n = 0; n < e.length; n++) {
|
|
44
89
|
const r = e[n];
|
|
45
90
|
if (r) {
|
|
46
|
-
if (
|
|
91
|
+
if (X(r))
|
|
47
92
|
t.push(r);
|
|
48
|
-
else if (
|
|
93
|
+
else if (d(r))
|
|
49
94
|
for (let i = 0; i < r.length; i++) {
|
|
50
95
|
const o = G(r[i]);
|
|
51
96
|
o && t.push(o);
|
|
52
97
|
}
|
|
53
|
-
else if (
|
|
98
|
+
else if (h(r))
|
|
54
99
|
for (const i in r)
|
|
55
100
|
r[i] && t.push(i);
|
|
56
101
|
}
|
|
57
102
|
}
|
|
58
103
|
return t.filter((n) => n).join(" ");
|
|
59
104
|
}
|
|
60
|
-
function
|
|
105
|
+
function V(e, t) {
|
|
61
106
|
if (typeof t != "string" && !Array.isArray(t))
|
|
62
107
|
return;
|
|
63
108
|
const n = Array.isArray(t) ? t : t.split(":");
|
|
@@ -69,13 +114,13 @@ function z(e, t) {
|
|
|
69
114
|
return;
|
|
70
115
|
return r;
|
|
71
116
|
}
|
|
72
|
-
const
|
|
117
|
+
const v = typeof window > "u";
|
|
73
118
|
function Q(e) {
|
|
74
119
|
return e.replace(/[-_](.)/g, (t, n) => n.toUpperCase());
|
|
75
120
|
}
|
|
76
|
-
const
|
|
121
|
+
const C = function(e, t) {
|
|
77
122
|
var n;
|
|
78
|
-
if (
|
|
123
|
+
if (v || !e || !t)
|
|
79
124
|
return "";
|
|
80
125
|
t = Q(t), t === "float" && (t = "cssFloat");
|
|
81
126
|
try {
|
|
@@ -87,20 +132,20 @@ const E = function(e, t) {
|
|
|
87
132
|
} catch {
|
|
88
133
|
return e.style[t];
|
|
89
134
|
}
|
|
90
|
-
},
|
|
91
|
-
if (
|
|
135
|
+
}, k = (e, t) => v ? void 0 : (t == null ? C(e, "overflow") : t ? C(e, "overflow-y") : C(e, "overflow-x")).match(/(scroll|auto|overlay)/), ve = (e, t) => {
|
|
136
|
+
if (v)
|
|
92
137
|
return;
|
|
93
138
|
let n = e;
|
|
94
139
|
for (; n; ) {
|
|
95
140
|
if ([window, document, document.documentElement].includes(n))
|
|
96
141
|
return window;
|
|
97
|
-
if (
|
|
142
|
+
if (k(n, t))
|
|
98
143
|
return n;
|
|
99
144
|
n = n.parentNode;
|
|
100
145
|
}
|
|
101
146
|
return n;
|
|
102
|
-
},
|
|
103
|
-
if (
|
|
147
|
+
}, Oe = (e, t) => {
|
|
148
|
+
if (v || !e || !t)
|
|
104
149
|
return !1;
|
|
105
150
|
const n = e.getBoundingClientRect();
|
|
106
151
|
let r;
|
|
@@ -114,7 +159,7 @@ const E = function(e, t) {
|
|
|
114
159
|
function I(e) {
|
|
115
160
|
return e != null && e === e.window;
|
|
116
161
|
}
|
|
117
|
-
function
|
|
162
|
+
function K(e, t) {
|
|
118
163
|
var i;
|
|
119
164
|
if (typeof window > "u")
|
|
120
165
|
return 0;
|
|
@@ -122,44 +167,44 @@ function j(e, t) {
|
|
|
122
167
|
let r = 0;
|
|
123
168
|
return I(e) ? r = e[t ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? r = e.documentElement[n] : e && (r = e[n]), e && !I(e) && typeof r != "number" && (r = (i = (e.ownerDocument || e).documentElement) == null ? void 0 : i[n]), r;
|
|
124
169
|
}
|
|
125
|
-
let W = (e) => setTimeout(e, 16),
|
|
126
|
-
typeof window < "u" && "requestAnimationFrame" in window && (W = (e) => window.requestAnimationFrame(e),
|
|
127
|
-
let
|
|
128
|
-
const
|
|
129
|
-
function
|
|
130
|
-
|
|
170
|
+
let W = (e) => setTimeout(e, 16), b = (e) => clearTimeout(e);
|
|
171
|
+
typeof window < "u" && "requestAnimationFrame" in window && (W = (e) => window.requestAnimationFrame(e), b = (e) => window.cancelAnimationFrame(e));
|
|
172
|
+
let P = 0;
|
|
173
|
+
const U = /* @__PURE__ */ new Map();
|
|
174
|
+
function z(e) {
|
|
175
|
+
U.delete(e);
|
|
131
176
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
const n =
|
|
177
|
+
function R(e, t = 1) {
|
|
178
|
+
P += 1;
|
|
179
|
+
const n = P;
|
|
135
180
|
function r(i) {
|
|
136
181
|
if (i === 0)
|
|
137
|
-
|
|
182
|
+
z(n), e();
|
|
138
183
|
else {
|
|
139
184
|
const o = W(() => {
|
|
140
185
|
r(i - 1);
|
|
141
186
|
});
|
|
142
|
-
|
|
187
|
+
U.set(n, o);
|
|
143
188
|
}
|
|
144
189
|
}
|
|
145
190
|
return r(t), n;
|
|
146
191
|
}
|
|
147
|
-
|
|
148
|
-
const t =
|
|
149
|
-
return
|
|
192
|
+
R.cancel = (e) => {
|
|
193
|
+
const t = U.get(e);
|
|
194
|
+
return z(t), b(t);
|
|
150
195
|
};
|
|
151
|
-
function
|
|
196
|
+
function j(e, t, n, r) {
|
|
152
197
|
const i = n - t;
|
|
153
198
|
return e /= r / 2, e < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t;
|
|
154
199
|
}
|
|
155
|
-
function
|
|
156
|
-
const { getContainer: n = () => window, callback: r, duration: i = 450 } = t, o = n(),
|
|
157
|
-
const
|
|
158
|
-
I(o) ? o.scrollTo(window.pageXOffset,
|
|
200
|
+
function Ce(e, t = {}) {
|
|
201
|
+
const { getContainer: n = () => window, callback: r, duration: i = 450 } = t, o = n(), c = K(o, !0), f = Date.now(), u = () => {
|
|
202
|
+
const s = Date.now() - f, y = j(s > i ? i : s, c, e, i);
|
|
203
|
+
I(o) ? o.scrollTo(window.pageXOffset, y) : o instanceof HTMLDocument || o.constructor.name === "HTMLDocument" ? o.documentElement.scrollTop = y : o.scrollTop = y, s < i ? R(u) : typeof r == "function" && r();
|
|
159
204
|
};
|
|
160
|
-
o &&
|
|
205
|
+
o && R(u);
|
|
161
206
|
}
|
|
162
|
-
function
|
|
207
|
+
function Ee(e) {
|
|
163
208
|
let t;
|
|
164
209
|
const n = (i) => () => {
|
|
165
210
|
t = null, e(...i);
|
|
@@ -177,7 +222,7 @@ function te(e) {
|
|
|
177
222
|
function ne(e) {
|
|
178
223
|
return ArrayBuffer.isView(e) && !(e instanceof DataView);
|
|
179
224
|
}
|
|
180
|
-
function
|
|
225
|
+
function O(e) {
|
|
181
226
|
return p(e);
|
|
182
227
|
}
|
|
183
228
|
function p(e, t = /* @__PURE__ */ new Map()) {
|
|
@@ -248,23 +293,23 @@ function p(e, t = /* @__PURE__ */ new Map()) {
|
|
|
248
293
|
function g(e, t, n) {
|
|
249
294
|
const r = [...Object.keys(t), ...ee(t)];
|
|
250
295
|
for (let i = 0; i < r.length; i++) {
|
|
251
|
-
const o = r[i],
|
|
252
|
-
(
|
|
296
|
+
const o = r[i], c = Object.getOwnPropertyDescriptor(e, o);
|
|
297
|
+
(c == null || c.writable) && (e[o] = p(t[o], n));
|
|
253
298
|
}
|
|
254
299
|
}
|
|
255
|
-
const re = typeof process < "u" && process.versions != null && process.versions.node != null,
|
|
256
|
-
function
|
|
300
|
+
const re = typeof process < "u" && process.versions != null && process.versions.node != null, Ie = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !re;
|
|
301
|
+
function E(e, t, n, r) {
|
|
257
302
|
if (e === t)
|
|
258
303
|
return !0;
|
|
259
304
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
260
305
|
if (e.constructor !== t.constructor)
|
|
261
306
|
return !1;
|
|
262
|
-
let i, o,
|
|
307
|
+
let i, o, c;
|
|
263
308
|
if (Array.isArray(e)) {
|
|
264
309
|
if (i = e.length, i != t.length)
|
|
265
310
|
return !1;
|
|
266
311
|
for (o = i; o-- !== 0; )
|
|
267
|
-
if (!
|
|
312
|
+
if (!E(e[o], t[o], n, r))
|
|
268
313
|
return !1;
|
|
269
314
|
return !0;
|
|
270
315
|
}
|
|
@@ -275,7 +320,7 @@ function R(e, t, n, r) {
|
|
|
275
320
|
if (!t.has(o[0]))
|
|
276
321
|
return !1;
|
|
277
322
|
for (o of e.entries())
|
|
278
|
-
if (!
|
|
323
|
+
if (!E(o[1], t.get(o[0]), n, r))
|
|
279
324
|
return !1;
|
|
280
325
|
return !0;
|
|
281
326
|
}
|
|
@@ -301,14 +346,14 @@ function R(e, t, n, r) {
|
|
|
301
346
|
return e.valueOf() === t.valueOf();
|
|
302
347
|
if (e.toString !== Object.prototype.toString && e.toString)
|
|
303
348
|
return e.toString() === t.toString();
|
|
304
|
-
if (
|
|
349
|
+
if (c = Object.keys(e), i = c.length, i !== Object.keys(t).length)
|
|
305
350
|
return !1;
|
|
306
351
|
for (o = i; o-- !== 0; )
|
|
307
|
-
if (!Object.prototype.hasOwnProperty.call(t,
|
|
352
|
+
if (!Object.prototype.hasOwnProperty.call(t, c[o]))
|
|
308
353
|
return !1;
|
|
309
354
|
for (o = i; o-- !== 0; ) {
|
|
310
|
-
const f =
|
|
311
|
-
if (!(n != null && n.includes(f)) && !(f === "_owner" && e.$$typeof) && !
|
|
355
|
+
const f = c[o];
|
|
356
|
+
if (!(n != null && n.includes(f)) && !(f === "_owner" && e.$$typeof) && !E(e[f], t[f], n, r))
|
|
312
357
|
return r && console.log(f), !1;
|
|
313
358
|
}
|
|
314
359
|
return !0;
|
|
@@ -318,7 +363,7 @@ function R(e, t, n, r) {
|
|
|
318
363
|
function Re(e) {
|
|
319
364
|
return /\w.(?:png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e);
|
|
320
365
|
}
|
|
321
|
-
const ie = (e) => e == null,
|
|
366
|
+
const ie = (e) => e == null, Te = (e) => {
|
|
322
367
|
if (!e || !e.startsWith("http"))
|
|
323
368
|
return !1;
|
|
324
369
|
try {
|
|
@@ -327,13 +372,13 @@ const ie = (e) => e == null, Ie = (e) => {
|
|
|
327
372
|
return !1;
|
|
328
373
|
}
|
|
329
374
|
};
|
|
330
|
-
function
|
|
375
|
+
function F(e) {
|
|
331
376
|
if (!e || typeof e != "object")
|
|
332
377
|
return !1;
|
|
333
378
|
const t = Object.getPrototypeOf(e);
|
|
334
379
|
return t === null || t === Object.prototype || Object.getPrototypeOf(t) === null ? Object.prototype.toString.call(e) === "[object Object]" : !1;
|
|
335
380
|
}
|
|
336
|
-
const
|
|
381
|
+
const Ue = (...e) => {
|
|
337
382
|
const t = {}, n = e.length;
|
|
338
383
|
let r, i = 0;
|
|
339
384
|
for (; i < n; i += 1)
|
|
@@ -344,18 +389,18 @@ const Te = (...e) => {
|
|
|
344
389
|
} : t[r] = e[i][r]);
|
|
345
390
|
return t;
|
|
346
391
|
};
|
|
347
|
-
function
|
|
348
|
-
const r =
|
|
349
|
-
for (let
|
|
350
|
-
const f = o[
|
|
351
|
-
Array.isArray(
|
|
392
|
+
function w(e, t, n) {
|
|
393
|
+
const r = m(n == null ? void 0 : n.omitNil) ? n == null ? void 0 : n.omitNil : !0, i = m(n == null ? void 0 : n.omitEmpty) ? n == null ? void 0 : n.omitEmpty : !0, o = Object.keys(t);
|
|
394
|
+
for (let c = 0; c < o.length; c++) {
|
|
395
|
+
const f = o[c], u = t[f], l = e[f];
|
|
396
|
+
Array.isArray(u) ? Array.isArray(l) ? u.length === 0 && !i ? e[f] = u : e[f] = w(l, u, n) : e[f] = w([], u, n) : F(u) ? F(l) ? Object.keys(u).length === 0 && !i ? e[f] = u : e[f] = w(l, u, n) : e[f] = w({}, u, n) : r ? (l === void 0 || !ie(u)) && (e[f] = u) : e[f] = u;
|
|
352
397
|
}
|
|
353
398
|
return e;
|
|
354
399
|
}
|
|
355
|
-
let
|
|
356
|
-
const
|
|
400
|
+
let L = 0;
|
|
401
|
+
const N = (e = 21) => {
|
|
357
402
|
if (typeof window > "u" || !window.crypto)
|
|
358
|
-
return (
|
|
403
|
+
return (L += 1).toFixed(0);
|
|
359
404
|
let t = "";
|
|
360
405
|
const n = crypto.getRandomValues(new Uint8Array(e));
|
|
361
406
|
for (; e--; ) {
|
|
@@ -363,7 +408,7 @@ const M = (e = 21) => {
|
|
|
363
408
|
t += r < 36 ? r.toString(36) : r < 62 ? (r - 26).toString(36).toUpperCase() : r < 63 ? "_" : "-";
|
|
364
409
|
}
|
|
365
410
|
return t;
|
|
366
|
-
},
|
|
411
|
+
}, De = () => typeof window > "u" ? N() : window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : N(), Be = (e) => {
|
|
367
412
|
if (e && e !== !0)
|
|
368
413
|
return e;
|
|
369
414
|
}, Pe = (e) => {
|
|
@@ -372,158 +417,158 @@ const M = (e = 21) => {
|
|
|
372
417
|
e[n] !== void 0 && (t[n] = e[n]);
|
|
373
418
|
}), !(Object.keys(t).length < 1))
|
|
374
419
|
return t;
|
|
375
|
-
},
|
|
420
|
+
}, Fe = (e) => {
|
|
376
421
|
const t = {};
|
|
377
422
|
return Object.keys(e || {}).forEach((n) => {
|
|
378
423
|
var r;
|
|
379
424
|
Array.isArray(e[n]) && ((r = e[n]) == null ? void 0 : r.length) === 0 || e[n] !== void 0 && (t[n] = e[n]);
|
|
380
425
|
}), t;
|
|
381
426
|
};
|
|
382
|
-
function
|
|
427
|
+
function D(e) {
|
|
383
428
|
var t;
|
|
384
429
|
if (!(typeof e != "string" && !Array.isArray(e)))
|
|
385
430
|
return Array.isArray(e) ? e[e.length - 1] : (t = e.split(":")) == null ? void 0 : t.slice(-1)[0];
|
|
386
431
|
}
|
|
387
432
|
function oe(e) {
|
|
388
|
-
return e && (e.type === J || e.type ===
|
|
433
|
+
return e && (e.type === J || e.type === _ && e.children.length === 0 || e.type === Text && e.children.trim() === "");
|
|
389
434
|
}
|
|
390
|
-
function
|
|
435
|
+
function Le(e, t) {
|
|
391
436
|
var n;
|
|
392
|
-
return
|
|
437
|
+
return H((n = e[t]) == null ? void 0 : n.call(e));
|
|
393
438
|
}
|
|
394
|
-
function
|
|
439
|
+
function H(e = []) {
|
|
395
440
|
const t = [];
|
|
396
441
|
return e.forEach((n) => {
|
|
397
|
-
Array.isArray(n) ? t.push(...n) : (n == null ? void 0 : n.type) ===
|
|
442
|
+
Array.isArray(n) ? t.push(...n) : (n == null ? void 0 : n.type) === _ ? t.push(...H(n.children)) : t.push(n);
|
|
398
443
|
}), t.filter((n) => !oe(n));
|
|
399
444
|
}
|
|
400
|
-
function
|
|
445
|
+
function q(e, ...t) {
|
|
401
446
|
return typeof e == "function" ? e == null ? void 0 : e(...t) : e;
|
|
402
447
|
}
|
|
403
448
|
function fe(e, t, n = "default", r) {
|
|
404
|
-
const i =
|
|
449
|
+
const i = D(n);
|
|
405
450
|
if (i) {
|
|
406
451
|
let o;
|
|
407
|
-
const
|
|
408
|
-
return
|
|
452
|
+
const c = V(t, n);
|
|
453
|
+
return c === !1 ? o = !1 : c === !0 ? o = e == null ? void 0 : e[i] : h(c) && r ? S(c) ? o = c : o = e == null ? void 0 : e[i] : o = c || (e == null ? void 0 : e[i]), r ? S(o) ? o : q(o) : o;
|
|
409
454
|
}
|
|
410
455
|
}
|
|
411
|
-
function
|
|
412
|
-
var o,
|
|
413
|
-
const i =
|
|
456
|
+
function ce(e, t, n = "default", r) {
|
|
457
|
+
var o, c, f;
|
|
458
|
+
const i = D(n);
|
|
414
459
|
if (i) {
|
|
415
|
-
let
|
|
416
|
-
const
|
|
417
|
-
return
|
|
460
|
+
let u;
|
|
461
|
+
const l = V(t, n);
|
|
462
|
+
return l === !1 ? u = !1 : l === !0 ? u = (o = e == null ? void 0 : e[i]) == null ? void 0 : o.call(e, r) : h(l) ? S(l) ? u = l : u = (c = e == null ? void 0 : e[i]) == null ? void 0 : c.call(e, r) : u = l || ((f = e == null ? void 0 : e[i]) == null ? void 0 : f.call(e, r)), S(u) ? u : q(u, r);
|
|
418
463
|
}
|
|
419
464
|
}
|
|
420
|
-
function
|
|
465
|
+
function Ne(e, t, n, r) {
|
|
421
466
|
const i = {};
|
|
422
467
|
return e.forEach((o) => {
|
|
423
|
-
const
|
|
424
|
-
if (
|
|
425
|
-
const f = r != null && r.render ?
|
|
426
|
-
(
|
|
468
|
+
const c = D(o);
|
|
469
|
+
if (c) {
|
|
470
|
+
const f = r != null && r.render ? ce(t, n, o, r == null ? void 0 : r.params) : fe(t, n, o);
|
|
471
|
+
(m(f) || f) && (i[c] = f);
|
|
427
472
|
}
|
|
428
473
|
}), i;
|
|
429
474
|
}
|
|
430
|
-
const
|
|
475
|
+
const x = {
|
|
431
476
|
videoAllowType: [
|
|
432
477
|
"mp4",
|
|
433
478
|
"webm",
|
|
434
479
|
"ogg"
|
|
435
480
|
],
|
|
436
481
|
audioAllowType: [
|
|
437
|
-
"
|
|
482
|
+
"mp3",
|
|
438
483
|
// 最常见的音频格式,兼容性最广
|
|
439
|
-
"
|
|
484
|
+
"ogg",
|
|
440
485
|
// Ogg 容器,通常使用 Vorbis 或 Opus 编码
|
|
441
|
-
"
|
|
486
|
+
"wav",
|
|
442
487
|
// 无损音频格式,支持 PCM 编码
|
|
443
|
-
"
|
|
488
|
+
"aac",
|
|
444
489
|
// 广泛支持,特别是在移动设备和现代浏览器中
|
|
445
|
-
"
|
|
490
|
+
"m4a",
|
|
446
491
|
// 通常是 AAC 或 ALAC 编码,现代浏览器支持良好
|
|
447
|
-
"
|
|
492
|
+
"webm"
|
|
448
493
|
// WebM 容器,支持 Opus 编码,主要用于现代浏览器
|
|
449
494
|
],
|
|
450
495
|
imageType: [
|
|
451
496
|
// 位图格式 (Raster Graphics)
|
|
452
|
-
"
|
|
453
|
-
"
|
|
454
|
-
"
|
|
455
|
-
"
|
|
456
|
-
"
|
|
457
|
-
"
|
|
458
|
-
"
|
|
459
|
-
"
|
|
460
|
-
"
|
|
461
|
-
"
|
|
497
|
+
"jpeg",
|
|
498
|
+
"jpg",
|
|
499
|
+
"png",
|
|
500
|
+
"gif",
|
|
501
|
+
"bmp",
|
|
502
|
+
"tiff",
|
|
503
|
+
"tif",
|
|
504
|
+
"webp",
|
|
505
|
+
"heic",
|
|
506
|
+
"heif",
|
|
462
507
|
// 矢量格式 (Vector Graphics)
|
|
463
|
-
"
|
|
508
|
+
"svg",
|
|
464
509
|
// 特定场景格式
|
|
465
|
-
"
|
|
466
|
-
"
|
|
467
|
-
"
|
|
468
|
-
"
|
|
469
|
-
"
|
|
470
|
-
"
|
|
471
|
-
"
|
|
472
|
-
"
|
|
510
|
+
"ico",
|
|
511
|
+
"raw",
|
|
512
|
+
"cr2",
|
|
513
|
+
"nef",
|
|
514
|
+
"arw",
|
|
515
|
+
"dng",
|
|
516
|
+
"psd",
|
|
517
|
+
"eps"
|
|
473
518
|
],
|
|
474
519
|
videoType: [
|
|
475
520
|
// 常见视频格式
|
|
476
|
-
"
|
|
477
|
-
"
|
|
478
|
-
"
|
|
479
|
-
"
|
|
480
|
-
"
|
|
481
|
-
"
|
|
482
|
-
"
|
|
483
|
-
"
|
|
484
|
-
"
|
|
485
|
-
"
|
|
486
|
-
"
|
|
521
|
+
"mp4",
|
|
522
|
+
"avi",
|
|
523
|
+
"mov",
|
|
524
|
+
"wmv",
|
|
525
|
+
"mkv",
|
|
526
|
+
"flv",
|
|
527
|
+
"webm",
|
|
528
|
+
"mpeg",
|
|
529
|
+
"mpg",
|
|
530
|
+
"3gp",
|
|
531
|
+
"ogv",
|
|
487
532
|
// 专业或特定用途格式
|
|
488
|
-
"
|
|
489
|
-
"
|
|
490
|
-
"
|
|
491
|
-
"
|
|
492
|
-
"
|
|
493
|
-
"
|
|
494
|
-
"
|
|
533
|
+
"mxf",
|
|
534
|
+
"vob",
|
|
535
|
+
"rm",
|
|
536
|
+
"rmvb",
|
|
537
|
+
"ts",
|
|
538
|
+
"mts",
|
|
539
|
+
"m2ts",
|
|
495
540
|
// 视频编解码器封装格式
|
|
496
|
-
"
|
|
497
|
-
"
|
|
541
|
+
"divx",
|
|
542
|
+
"xvid"
|
|
498
543
|
],
|
|
499
544
|
audioType: [
|
|
500
545
|
// 常见音频格式
|
|
501
|
-
"
|
|
502
|
-
"
|
|
503
|
-
"
|
|
504
|
-
"
|
|
505
|
-
"
|
|
506
|
-
"
|
|
507
|
-
"
|
|
508
|
-
"
|
|
509
|
-
"
|
|
510
|
-
"
|
|
546
|
+
"mp3",
|
|
547
|
+
"wav",
|
|
548
|
+
"aac",
|
|
549
|
+
"flac",
|
|
550
|
+
"ogg",
|
|
551
|
+
"wma",
|
|
552
|
+
"m4a",
|
|
553
|
+
"alac",
|
|
554
|
+
"opus",
|
|
555
|
+
"amr",
|
|
511
556
|
// 专业或特定用途格式
|
|
512
|
-
"
|
|
513
|
-
"
|
|
514
|
-
"
|
|
515
|
-
"
|
|
557
|
+
"aiff",
|
|
558
|
+
"au",
|
|
559
|
+
"pcm",
|
|
560
|
+
"ape"
|
|
516
561
|
]
|
|
517
562
|
};
|
|
518
|
-
function
|
|
563
|
+
function Me(e) {
|
|
519
564
|
return e != null;
|
|
520
565
|
}
|
|
521
|
-
const
|
|
566
|
+
const $e = ({ suffixCls: e, customizePrefixCls: t, isPor: n, className: r }) => {
|
|
522
567
|
const i = r || (n ? "gx-pro" : "gx");
|
|
523
568
|
return t || (e ? `${i}-${e}` : i);
|
|
524
|
-
},
|
|
525
|
-
function
|
|
526
|
-
const r =
|
|
569
|
+
}, _e = (e, t) => e ? d(e) ? e.join("-") : e.toString() : `${t || 0}`;
|
|
570
|
+
function Ve(e, { align: t, showIndex: n }) {
|
|
571
|
+
const r = O(e);
|
|
527
572
|
if (n && e.length && e.every((i) => i.dataIndex !== "sortIndex")) {
|
|
528
573
|
const i = e[0];
|
|
529
574
|
r.unshift({
|
|
@@ -531,7 +576,7 @@ function Ne(e, { align: t, showIndex: n }) {
|
|
|
531
576
|
align: t,
|
|
532
577
|
fixed: i.fixed,
|
|
533
578
|
width: 60,
|
|
534
|
-
uuid:
|
|
579
|
+
uuid: se().uuid(15),
|
|
535
580
|
dataIndex: "sortIndex",
|
|
536
581
|
key: "sortIndex"
|
|
537
582
|
});
|
|
@@ -539,14 +584,14 @@ function Ne(e, { align: t, showIndex: n }) {
|
|
|
539
584
|
r.filter((i) => i.dataIndex !== "sortIndex");
|
|
540
585
|
return r;
|
|
541
586
|
}
|
|
542
|
-
function
|
|
587
|
+
function We(e, ...t) {
|
|
543
588
|
return typeof e == "function" ? e(...t) : e;
|
|
544
589
|
}
|
|
545
|
-
function
|
|
590
|
+
function be(e) {
|
|
546
591
|
return JSON.parse(JSON.stringify(e));
|
|
547
592
|
}
|
|
548
|
-
function
|
|
549
|
-
if (
|
|
593
|
+
function ze(e, t) {
|
|
594
|
+
if (h(e)) {
|
|
550
595
|
const { pageSize: n = 10, total: r = 0 } = e;
|
|
551
596
|
let { current: i = 1 } = e;
|
|
552
597
|
return r - t <= n * (i - 1) && (i = i - 1), i === 0 ? 1 : i;
|
|
@@ -555,52 +600,52 @@ function We(e, t) {
|
|
|
555
600
|
}
|
|
556
601
|
function He(e = [], t, n = "children") {
|
|
557
602
|
function r(i, o) {
|
|
558
|
-
return o.map((
|
|
559
|
-
const
|
|
560
|
-
return
|
|
603
|
+
return o.map((c, f) => {
|
|
604
|
+
const u = `${i}-${f + 1}`;
|
|
605
|
+
return c[n] && (c[n] = r(u, c[n])), c.sortIndex = u, c;
|
|
561
606
|
});
|
|
562
607
|
}
|
|
563
|
-
return
|
|
564
|
-
const
|
|
565
|
-
return i[n] && (i[n] = r(`${
|
|
608
|
+
return O(e).map((i, o) => {
|
|
609
|
+
const c = h(t) && t.current || 1, f = h(t) && t.pageSize || 10, u = `${c ? (c - 1) * f + (o + 1) : o + 1}`;
|
|
610
|
+
return i[n] && (i[n] = r(`${u}`, i[n])), i.sortIndex = u, i;
|
|
566
611
|
});
|
|
567
612
|
}
|
|
568
613
|
function qe(e, t) {
|
|
569
|
-
return
|
|
570
|
-
if (
|
|
614
|
+
return d(e) ? e == null ? void 0 : e.filter((n, r) => {
|
|
615
|
+
if (a(t))
|
|
571
616
|
return r <= t - 1;
|
|
572
|
-
if (
|
|
617
|
+
if (d(t) && t.length === 2) {
|
|
573
618
|
const i = t[0] - 1, o = t[1] ? t[1] - 1 : e.length - 1;
|
|
574
619
|
return r <= o && r >= i;
|
|
575
|
-
} else if (
|
|
620
|
+
} else if (d(t) && t.length === 1) {
|
|
576
621
|
const i = t[0] - 1, o = e.length - 1;
|
|
577
622
|
return r <= o && r >= i;
|
|
578
623
|
}
|
|
579
624
|
return !0;
|
|
580
625
|
}) : [];
|
|
581
626
|
}
|
|
582
|
-
function
|
|
583
|
-
const i =
|
|
627
|
+
function ue(e, t, n, r = 0) {
|
|
628
|
+
const i = a(r) && (r === 0 || r === 1) ? r : 0, o = e[n], c = t[n];
|
|
584
629
|
let f = 0;
|
|
585
|
-
return o <
|
|
630
|
+
return o < c ? f = i === 0 ? -1 : 0 : o > c && (f = i === 0 ? 0 : -1), f;
|
|
586
631
|
}
|
|
587
|
-
function
|
|
588
|
-
const i =
|
|
632
|
+
function le(e, t, n, r = 0) {
|
|
633
|
+
const i = a(r) && (r === 0 || r === 1) ? r : 0, o = new Date(e[n]), c = new Date(t[n]);
|
|
589
634
|
let f = 0;
|
|
590
|
-
return o <
|
|
635
|
+
return o < c ? f = i === 0 ? -1 : 0 : o > c && (f = i === 0 ? 0 : -1), f;
|
|
591
636
|
}
|
|
592
|
-
function
|
|
593
|
-
return e.sort((r, i) =>
|
|
637
|
+
function Je(e, t, n = 0) {
|
|
638
|
+
return e.sort((r, i) => ue(r, i, t, n));
|
|
594
639
|
}
|
|
595
|
-
function
|
|
596
|
-
return e.sort((r, i) =>
|
|
640
|
+
function Ze(e, t, n = 0) {
|
|
641
|
+
return e.sort((r, i) => le(r, i, t, n));
|
|
597
642
|
}
|
|
598
|
-
function
|
|
599
|
-
let t =
|
|
643
|
+
function Xe(e) {
|
|
644
|
+
let t = O(e);
|
|
600
645
|
const n = new Set(t);
|
|
601
646
|
return t = Array.from(n), t;
|
|
602
647
|
}
|
|
603
|
-
function
|
|
648
|
+
function Ye(e, t) {
|
|
604
649
|
const n = ["null", "undefined"];
|
|
605
650
|
let r = !0;
|
|
606
651
|
return e === 0 ? r = !0 : n.includes(e) ? r = !1 : e || (r = !1), r ? {
|
|
@@ -611,7 +656,7 @@ function Xe(e, t) {
|
|
|
611
656
|
success: r
|
|
612
657
|
};
|
|
613
658
|
}
|
|
614
|
-
function
|
|
659
|
+
function Ge(e) {
|
|
615
660
|
let t = "";
|
|
616
661
|
if (e > -1) {
|
|
617
662
|
const n = Math.floor(e / 3600), r = Math.floor(e / 60) % 60, i = Number.parseInt(String(e % 60));
|
|
@@ -619,18 +664,18 @@ function Ze(e) {
|
|
|
619
664
|
}
|
|
620
665
|
return t.split(":")[0] === "00" ? `${t.split(":")[1]}:${t.split(":")[2]}` : t;
|
|
621
666
|
}
|
|
622
|
-
function
|
|
667
|
+
function se() {
|
|
623
668
|
const e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
|
|
624
669
|
return {
|
|
625
670
|
uuid(t, n) {
|
|
626
671
|
const r = e, i = [], o = n || r.length;
|
|
627
|
-
let
|
|
672
|
+
let c, f;
|
|
628
673
|
if (t)
|
|
629
|
-
for (
|
|
630
|
-
i[
|
|
674
|
+
for (c = 0; c < t; c += 1)
|
|
675
|
+
i[c] = r[Number.parseInt(String(Math.random() * o))];
|
|
631
676
|
else
|
|
632
|
-
for (i[8] = "-", i[13] = "-", i[18] = "-", i[23] = "-", i[14] = "4",
|
|
633
|
-
i[
|
|
677
|
+
for (i[8] = "-", i[13] = "-", i[18] = "-", i[23] = "-", i[14] = "4", c = 0; c < 36; c += 1)
|
|
678
|
+
i[c] || (f = Math.random() * 16, i[c] = r[c === 19 ? f && 3 || 8 : f]);
|
|
634
679
|
return i.join("");
|
|
635
680
|
},
|
|
636
681
|
uuidFast() {
|
|
@@ -663,44 +708,67 @@ function ae(e, t) {
|
|
|
663
708
|
function de(e, t = "children") {
|
|
664
709
|
let n = [];
|
|
665
710
|
return e.forEach((r) => {
|
|
666
|
-
n.push(r),
|
|
711
|
+
n.push(r), d(r[t]) && r[t].length > 0 && (n = n.concat(de(r[t], t)));
|
|
667
712
|
}), n;
|
|
668
713
|
}
|
|
669
|
-
function
|
|
670
|
-
if (!e || !
|
|
714
|
+
function Qe(e, t) {
|
|
715
|
+
if (!e || !d(e) || (e == null ? void 0 : e.length) === 0)
|
|
671
716
|
return [];
|
|
672
|
-
const { id: n = "id", parentId: r = "parentId", children: i = "children", rootId: o = 0, emptyChildren:
|
|
673
|
-
return f.map((
|
|
674
|
-
var
|
|
675
|
-
return !
|
|
676
|
-
}).filter((
|
|
677
|
-
const
|
|
678
|
-
return
|
|
717
|
+
const { id: n = "id", parentId: r = "parentId", children: i = "children", rootId: o = 0, emptyChildren: c = !0 } = t || {}, f = O(e);
|
|
718
|
+
return f.map((u) => {
|
|
719
|
+
var l;
|
|
720
|
+
return !c && u[i] && ((l = u[i]) == null ? void 0 : l.length) === 0 && delete u[i], u;
|
|
721
|
+
}).filter((u) => {
|
|
722
|
+
const l = f.filter((s) => u[n] === s[r]);
|
|
723
|
+
return l.length > 0 ? u[i] = l : c && (u[i] = []), u[r] === o;
|
|
679
724
|
});
|
|
680
725
|
}
|
|
726
|
+
function he(e, t) {
|
|
727
|
+
return e.map((n) => {
|
|
728
|
+
const r = { ...n };
|
|
729
|
+
return r.children && (r.children = he(r.children, t)), t(r) || r.children && r.children.length > 0 ? r : null;
|
|
730
|
+
}).filter(Boolean);
|
|
731
|
+
}
|
|
732
|
+
function ke(e, t, n) {
|
|
733
|
+
let r = [];
|
|
734
|
+
function i(o, c) {
|
|
735
|
+
if (o[n.value] === t)
|
|
736
|
+
return r = [...c, o[n.value]], !0;
|
|
737
|
+
if (o[n.children]) {
|
|
738
|
+
for (const f of o[n.children])
|
|
739
|
+
if (i(f, [...c, o[n.value]]))
|
|
740
|
+
return !0;
|
|
741
|
+
}
|
|
742
|
+
return !1;
|
|
743
|
+
}
|
|
744
|
+
for (const o of e)
|
|
745
|
+
if (i(o, []))
|
|
746
|
+
break;
|
|
747
|
+
return r;
|
|
748
|
+
}
|
|
681
749
|
function pe(e, t, n) {
|
|
682
750
|
const r = (n == null ? void 0 : n.value) || "id", i = (n == null ? void 0 : n.children) || "children";
|
|
683
751
|
for (const o of e) {
|
|
684
752
|
if (o[r] === t)
|
|
685
753
|
return o;
|
|
686
|
-
const
|
|
687
|
-
if (
|
|
688
|
-
const f = pe(
|
|
754
|
+
const c = o[i];
|
|
755
|
+
if (c) {
|
|
756
|
+
const f = pe(c, t, n);
|
|
689
757
|
if (f)
|
|
690
758
|
return f;
|
|
691
759
|
}
|
|
692
760
|
}
|
|
693
761
|
}
|
|
694
|
-
function
|
|
762
|
+
function Ke(e) {
|
|
695
763
|
return URL.createObjectURL(e);
|
|
696
764
|
}
|
|
697
|
-
function
|
|
765
|
+
function je(e) {
|
|
698
766
|
return new Promise((t, n) => {
|
|
699
767
|
const r = new FileReader();
|
|
700
768
|
r.readAsDataURL(e), r.onload = () => t(r.result), r.onerror = (i) => n(i);
|
|
701
769
|
});
|
|
702
770
|
}
|
|
703
|
-
function
|
|
771
|
+
function et(e) {
|
|
704
772
|
const t = e.split(","), n = t[0].match(/:(.*?);/)[1], r = atob(t[1]);
|
|
705
773
|
let i = r.length;
|
|
706
774
|
const o = new Uint8Array(i);
|
|
@@ -708,15 +776,15 @@ function Ke(e) {
|
|
|
708
776
|
o[i] = r.charCodeAt(i);
|
|
709
777
|
return new Blob([o], { type: n });
|
|
710
778
|
}
|
|
711
|
-
function
|
|
779
|
+
function tt(e, t) {
|
|
712
780
|
const n = e.split(","), r = n[0].match(/:(.*?);/)[1], i = atob(n[1]);
|
|
713
781
|
let o = i.length;
|
|
714
|
-
const
|
|
782
|
+
const c = new Uint8Array(o);
|
|
715
783
|
for (; o--; )
|
|
716
|
-
|
|
717
|
-
return new File([
|
|
784
|
+
c[o] = i.charCodeAt(o);
|
|
785
|
+
return new File([c], t, { type: r });
|
|
718
786
|
}
|
|
719
|
-
function
|
|
787
|
+
function nt(e, t, n) {
|
|
720
788
|
return new window.File([e], t, { type: n });
|
|
721
789
|
}
|
|
722
790
|
function ye(e) {
|
|
@@ -725,51 +793,51 @@ function ye(e) {
|
|
|
725
793
|
const t = e.indexOf("?");
|
|
726
794
|
return t > 0 ? `${e.substring(0, t)}` : e;
|
|
727
795
|
}
|
|
728
|
-
function
|
|
729
|
-
var r, i, o,
|
|
796
|
+
function T(e) {
|
|
797
|
+
var r, i, o, c, f;
|
|
730
798
|
if (!e || typeof e != "string")
|
|
731
799
|
return "";
|
|
732
800
|
const t = ye(e), n = t.lastIndexOf(".");
|
|
733
|
-
return n > 0 && ((f = (
|
|
801
|
+
return n > 0 && ((f = (c = `${(o = (i = (r = t == null ? void 0 : t.substring) == null ? void 0 : r.call(t, n)) == null ? void 0 : i.split("?")) == null ? void 0 : o[0]}`) == null ? void 0 : c.split(".")) == null ? void 0 : f[1]) || "";
|
|
734
802
|
}
|
|
735
|
-
function
|
|
803
|
+
function A(e, t) {
|
|
736
804
|
if (t)
|
|
737
805
|
return t;
|
|
738
806
|
if (!e || e === "data:")
|
|
739
807
|
return "4";
|
|
740
808
|
let n = "4";
|
|
741
|
-
return B(e) ? e.includes("data:image/") ? n = "png" : e.includes("data:video/") ? n = "mp4" : e.includes("data:audio/") && (n = "mp3") : e instanceof Blob ? (e = String(e), e.includes("image") ? n = "png" : e.includes("video") ? n = "mp4" : e.includes("audio") && (n = "mp3")) : n =
|
|
809
|
+
return B(e) ? e.includes("data:image/") ? n = "png" : e.includes("data:video/") ? n = "mp4" : e.includes("data:audio/") && (n = "mp3") : e instanceof Blob ? (e = String(e), e.includes("image") ? n = "png" : e.includes("video") ? n = "mp4" : e.includes("audio") && (n = "mp3")) : n = T(e).toLowerCase(), x.imageType.includes(n) ? "1" : x.videoType.includes(n) ? "3" : x.audioType.includes(n) ? "2" : "4";
|
|
742
810
|
}
|
|
743
|
-
function
|
|
811
|
+
function ge(e) {
|
|
744
812
|
const { url: t = "", fileType: n = "1" } = e || {};
|
|
745
813
|
let r = "", i = { play: !1, height: 0, size: 0, width: 0, duration: 0 };
|
|
746
814
|
function o() {
|
|
747
815
|
i = { play: !1, height: 0, size: 0, width: 0, duration: 0 };
|
|
748
816
|
}
|
|
749
|
-
return t instanceof File ? r = URL.createObjectURL(t) : B(t) ? r = t : t instanceof Blob ? r = URL.createObjectURL(t) : (t.includes("https") || t.includes("http")) && (r = t), new Promise((
|
|
817
|
+
return t instanceof File ? r = URL.createObjectURL(t) : B(t) ? r = t : t instanceof Blob ? r = URL.createObjectURL(t) : (t.includes("https") || t.includes("http")) && (r = t), new Promise((c) => {
|
|
750
818
|
let f;
|
|
751
819
|
n === "1" ? (f = document.createElement("img"), f.src = r) : n === "2" ? (f = document.createElement("audio"), f.src = r) : n === "3" && (f = document.createElement("video"), f.src = r), n === "1" ? f.onload = function() {
|
|
752
|
-
o(), i.play = !0, i.width = f.width || 0, i.height = f.height || 0,
|
|
820
|
+
o(), i.play = !0, i.width = f.width || 0, i.height = f.height || 0, c(i), f = null;
|
|
753
821
|
} : f.oncanplay = function() {
|
|
754
|
-
o(), i.play = !0, i.width = (f == null ? void 0 : f.videoWidth) || 0, i.height = (f == null ? void 0 : f.videoHeight) || 0, i.duration = (f == null ? void 0 : f.duration) || 0,
|
|
822
|
+
o(), i.play = !0, i.width = (f == null ? void 0 : f.videoWidth) || 0, i.height = (f == null ? void 0 : f.videoHeight) || 0, i.duration = (f == null ? void 0 : f.duration) || 0, c(i), f = null;
|
|
755
823
|
}, f.onerror = function() {
|
|
756
|
-
o(),
|
|
824
|
+
o(), c(i), f = null;
|
|
757
825
|
};
|
|
758
826
|
});
|
|
759
827
|
}
|
|
760
|
-
async function
|
|
828
|
+
async function rt(e) {
|
|
761
829
|
const { url: t = "", currentTime: n, videoSuffix: r = "", vidoeAllowPlay: i = !1 } = e;
|
|
762
|
-
let o = "",
|
|
763
|
-
return t instanceof File ? (o = URL.createObjectURL(t),
|
|
830
|
+
let o = "", c = r, f = "1", u;
|
|
831
|
+
return t instanceof File ? (o = URL.createObjectURL(t), c = T(t.name), f = A(t.name)) : t instanceof Blob ? (o = URL.createObjectURL(t), f = A(t)) : B(t) ? (o = t, f = A(t)) : (t.includes("https") || t.includes("http")) && (o = t, c = T(t), f = A(t)), (c ? x.videoAllowType.includes(c.toLowerCase()) : !1) ? i ? M(o, n) : (u = await ge({
|
|
764
832
|
url: o,
|
|
765
833
|
fileType: f
|
|
766
|
-
}),
|
|
767
|
-
|
|
768
|
-
})) : new Promise((
|
|
769
|
-
|
|
834
|
+
}), u.play ? M(o, n) : new Promise((s) => {
|
|
835
|
+
s("");
|
|
836
|
+
})) : new Promise((s) => {
|
|
837
|
+
s("");
|
|
770
838
|
});
|
|
771
839
|
}
|
|
772
|
-
async function
|
|
840
|
+
async function M(e, t = 0) {
|
|
773
841
|
return new Promise((n) => {
|
|
774
842
|
let r = document.createElement("video");
|
|
775
843
|
r && (r.controls = !0, r.muted = !0, r.setAttribute("src", e), r.setAttribute("muted", String(!0)), r.setAttribute("crossorigin", "anonymous"), r.setAttribute("autoplay", String(!0)), r.addEventListener("loadeddata", async () => {
|
|
@@ -777,9 +845,9 @@ async function $(e, t = 0) {
|
|
|
777
845
|
for (r == null || r.addEventListener("seeked", async () => {
|
|
778
846
|
i && i();
|
|
779
847
|
}); t < ((r == null ? void 0 : r.duration) || 0); ) {
|
|
780
|
-
r && (r.currentTime = t), await new Promise((
|
|
781
|
-
const o = document.createElement("canvas"),
|
|
782
|
-
o.width = (r == null ? void 0 : r.videoWidth) || 0 *
|
|
848
|
+
r && (r.currentTime = t), await new Promise((y) => i = y);
|
|
849
|
+
const o = document.createElement("canvas"), c = 0.8, f = o.getContext("2d"), u = (r == null ? void 0 : r.videoWidth) || 0 * c, l = (r == null ? void 0 : r.videoHeight) || 0 * c, s = 0;
|
|
850
|
+
o.width = (r == null ? void 0 : r.videoWidth) || 0 * c, o.height = (r == null ? void 0 : r.videoHeight) || 0 * c, r && f.drawImage(r, 0, 0, u + s, l + s), r = null, n(u === 0 || l === 0 ? "" : o.toDataURL("image/png", 1));
|
|
783
851
|
}
|
|
784
852
|
}));
|
|
785
853
|
});
|
|
@@ -791,37 +859,37 @@ function B(e = "") {
|
|
|
791
859
|
"data:audio/"
|
|
792
860
|
].find((n) => e.includes(n)));
|
|
793
861
|
}
|
|
794
|
-
function
|
|
862
|
+
function it(e) {
|
|
795
863
|
return typeof e == "string" && /^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e);
|
|
796
864
|
}
|
|
797
|
-
function
|
|
865
|
+
function ot(e, t, n, r = !1) {
|
|
798
866
|
e && t && n && e.addEventListener(t, n, r);
|
|
799
867
|
}
|
|
800
|
-
function
|
|
868
|
+
function ft(e, t, n, r = !1) {
|
|
801
869
|
e && t && n && e.removeEventListener(t, n, r);
|
|
802
870
|
}
|
|
803
|
-
function
|
|
871
|
+
function ct() {
|
|
804
872
|
return /windows|win32/i.test(navigator.userAgent);
|
|
805
873
|
}
|
|
806
|
-
function
|
|
807
|
-
return
|
|
874
|
+
function ut(e) {
|
|
875
|
+
return m(e) ? e : !!e;
|
|
808
876
|
}
|
|
809
|
-
function
|
|
877
|
+
function $(e, t) {
|
|
810
878
|
const n = `^\\d+(?:\\.\\d{0,${e}})?`, r = new RegExp(n), i = t.toString().match(r);
|
|
811
879
|
if (i) {
|
|
812
880
|
const o = i[0];
|
|
813
881
|
if (o.includes(".")) {
|
|
814
|
-
const [
|
|
882
|
+
const [c, f] = o.split(".");
|
|
815
883
|
if (/^0*$/.test(f))
|
|
816
|
-
return
|
|
884
|
+
return c;
|
|
817
885
|
}
|
|
818
886
|
return o;
|
|
819
887
|
}
|
|
820
888
|
return t.toString();
|
|
821
889
|
}
|
|
822
|
-
function
|
|
823
|
-
const { toChinese: n = !1, fixed: r = 2, min: i = 1e4 } = t || {}, o =
|
|
824
|
-
if (!
|
|
890
|
+
function lt(e, t) {
|
|
891
|
+
const { toChinese: n = !1, fixed: r = 2, min: i = 1e4 } = t || {}, o = a(i) ? i : 1e4, c = a(r) ? r : 2, f = n ? e < o ? "" : e < 1e8 ? "万" : "亿" : e < o ? "" : e < 1e8 ? "w" : "亿";
|
|
892
|
+
if (!a(e))
|
|
825
893
|
return {
|
|
826
894
|
str: `${e}`,
|
|
827
895
|
number: `${e}`
|
|
@@ -831,28 +899,28 @@ function ft(e, t) {
|
|
|
831
899
|
str: `${e}`,
|
|
832
900
|
number: `${e}`
|
|
833
901
|
};
|
|
834
|
-
if (
|
|
835
|
-
const
|
|
902
|
+
if (c === 0) {
|
|
903
|
+
const l = (e / (e < 1e8 ? 1e4 : 1e8)).toFixed(1).split(".")[0];
|
|
836
904
|
return {
|
|
837
|
-
str: `${
|
|
838
|
-
number:
|
|
905
|
+
str: `${l}${f}`,
|
|
906
|
+
number: l,
|
|
839
907
|
unit: f
|
|
840
908
|
};
|
|
841
909
|
}
|
|
842
|
-
let
|
|
843
|
-
return e < 1e8 ? (
|
|
844
|
-
str:
|
|
845
|
-
number:
|
|
910
|
+
let u;
|
|
911
|
+
return e < 1e8 ? (u = $(c, e / 1e4), {
|
|
912
|
+
str: u + f,
|
|
913
|
+
number: u,
|
|
846
914
|
unit: f
|
|
847
|
-
}) : (
|
|
848
|
-
str:
|
|
849
|
-
number:
|
|
915
|
+
}) : (u = $(c, e / 1e8), {
|
|
916
|
+
str: u + f,
|
|
917
|
+
number: u,
|
|
850
918
|
unit: f
|
|
851
919
|
});
|
|
852
920
|
}
|
|
853
|
-
function
|
|
921
|
+
function st(e, t) {
|
|
854
922
|
let n = 0;
|
|
855
|
-
const r =
|
|
923
|
+
const r = m(t.removeAfter) ? t.removeAfter : !0, i = t.id || "hiddenElement", o = {
|
|
856
924
|
opacity: 0,
|
|
857
925
|
visibility: "hidden",
|
|
858
926
|
position: "fixed",
|
|
@@ -860,100 +928,118 @@ function ut(e, t) {
|
|
|
860
928
|
top: 0,
|
|
861
929
|
left: 0
|
|
862
930
|
};
|
|
863
|
-
let
|
|
864
|
-
if (!
|
|
865
|
-
const
|
|
866
|
-
|
|
931
|
+
let c = document.querySelector(`#${i}`);
|
|
932
|
+
if (!c) {
|
|
933
|
+
const u = document.createElement("div");
|
|
934
|
+
u.id = i, document.body.appendChild(u), c = document.querySelector(`#${i}`);
|
|
867
935
|
}
|
|
868
|
-
Object.assign(
|
|
936
|
+
Object.assign(c.style, o);
|
|
869
937
|
const f = document.createElement(t.createName || "span");
|
|
870
|
-
return f.innerHTML = e, (t.cssObject ||
|
|
938
|
+
return f.innerHTML = e, (t.cssObject || h(t.cssObject)) && Object.assign(f.style, t.cssObject), c.append(f), n = f.getBoundingClientRect()[t.type || "width"], r && c.removeChild(f), n;
|
|
939
|
+
}
|
|
940
|
+
function at(e) {
|
|
941
|
+
e = a(e) && !Number.isNaN(e) ? e : 0;
|
|
942
|
+
const t = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"], n = ["", "十", "百", "千", "万"];
|
|
943
|
+
e = Number.parseInt(`${e}`);
|
|
944
|
+
const r = (c) => {
|
|
945
|
+
const f = c.toString().split("").reverse();
|
|
946
|
+
let u = "";
|
|
947
|
+
for (let l = 0; l < f.length; l++)
|
|
948
|
+
u = (l === 0 && f[l] === "0" || l > 0 && f[l] === "0" && f[l - 1] === "0" ? "" : (e < 20 && l > 0 ? "" : t[f[l]]) + (f[l] === "0" ? n[0] : n[l])) + u;
|
|
949
|
+
return u;
|
|
950
|
+
}, i = Math.floor(e / 1e4);
|
|
951
|
+
let o = e % 1e4;
|
|
952
|
+
return o.toString().length < 4 && (o = "0" + o), i ? r(i) + "万" + r(o) : r(e);
|
|
871
953
|
}
|
|
872
954
|
export {
|
|
873
|
-
|
|
955
|
+
we as Base64,
|
|
956
|
+
Xe as arrayRepeat,
|
|
874
957
|
qe as arraySlice,
|
|
875
|
-
|
|
876
|
-
|
|
958
|
+
nt as blobToDataURL,
|
|
959
|
+
A as checkFileType,
|
|
877
960
|
G as classNames,
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
961
|
+
O as cloneDeep,
|
|
962
|
+
ue as compareArray,
|
|
963
|
+
Je as compareArraySort,
|
|
964
|
+
Ze as compareArrayTimeSort,
|
|
965
|
+
le as compareTime,
|
|
966
|
+
ut as convertValueBoolean,
|
|
884
967
|
g as copyProperties,
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
968
|
+
et as dataURLtoBlob,
|
|
969
|
+
tt as dataURLtoFile,
|
|
970
|
+
be as deepCopy,
|
|
971
|
+
w as deepMerge,
|
|
972
|
+
x as fileTypes,
|
|
973
|
+
H as filterEmpty,
|
|
974
|
+
he as filterTree,
|
|
891
975
|
pe as findSourceByTree,
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
$
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
976
|
+
ke as findValueAndAncestors,
|
|
977
|
+
Ge as formatDuraton,
|
|
978
|
+
$ as formatNumber,
|
|
979
|
+
_e as genColumnKey,
|
|
980
|
+
M as generateVidoePicture,
|
|
981
|
+
je as getBase64,
|
|
982
|
+
Ke as getBlobUrl,
|
|
983
|
+
T as getFileSuffix,
|
|
899
984
|
de as getLevelData,
|
|
900
985
|
ae as getMaxFloor,
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
986
|
+
ge as getMediaInfos,
|
|
987
|
+
$e as getPrefixCls,
|
|
988
|
+
se as getRandomNumber,
|
|
989
|
+
K as getScroll,
|
|
990
|
+
ve as getScrollContainer,
|
|
906
991
|
fe as getSlot,
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
992
|
+
ce as getSlotVNode,
|
|
993
|
+
Le as getSlotsChildren,
|
|
994
|
+
Ne as getSlotsProps,
|
|
910
995
|
He as getSortIndex,
|
|
911
996
|
ee as getSymbols,
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
997
|
+
st as getTextWidth,
|
|
998
|
+
V as getValueFromObjectByKey,
|
|
999
|
+
rt as getVideoCoverPicture,
|
|
915
1000
|
ye as getVideoFileUrl,
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
1001
|
+
ze as handleCurrentPage,
|
|
1002
|
+
Ve as handleShowIndex,
|
|
1003
|
+
Ye as hanndleEmptyField,
|
|
1004
|
+
Z as is,
|
|
1005
|
+
d as isArray,
|
|
921
1006
|
B as isBase64,
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1007
|
+
m as isBoolean,
|
|
1008
|
+
Ie as isBrowser,
|
|
1009
|
+
it as isDataURLBase64,
|
|
1010
|
+
E as isDeepEqualReact,
|
|
926
1011
|
oe as isEmptyElement,
|
|
927
|
-
|
|
1012
|
+
Ae as isFunction,
|
|
928
1013
|
Re as isImg,
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
1014
|
+
Oe as isInContainer,
|
|
1015
|
+
xe as isJSONStr,
|
|
1016
|
+
Se as isMobile,
|
|
932
1017
|
ie as isNil,
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
1018
|
+
Me as isNotNil,
|
|
1019
|
+
a as isNumber,
|
|
1020
|
+
h as isObject,
|
|
1021
|
+
F as isPlainObject,
|
|
937
1022
|
te as isPrimitive,
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
1023
|
+
k as isScroll,
|
|
1024
|
+
v as isServer,
|
|
1025
|
+
X as isString,
|
|
941
1026
|
Y as isTablet,
|
|
942
1027
|
ne as isTypedArray,
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1028
|
+
Te as isUrl,
|
|
1029
|
+
ct as isWindowsOs,
|
|
1030
|
+
Ue as merge,
|
|
1031
|
+
De as nanoid,
|
|
1032
|
+
ft as off,
|
|
1033
|
+
Be as omitBoolean,
|
|
949
1034
|
Pe as omitUndefined,
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
1035
|
+
Fe as omitUndefinedAndEmptyArr,
|
|
1036
|
+
ot as on,
|
|
1037
|
+
R as raf,
|
|
1038
|
+
We as runFunction,
|
|
1039
|
+
Ce as scrollTo,
|
|
1040
|
+
q as slotRender,
|
|
1041
|
+
Ee as throttleByAnimationFrame,
|
|
1042
|
+
at as toChinesNum,
|
|
1043
|
+
lt as toConvertNumberShow,
|
|
1044
|
+
Qe as treeData
|
|
959
1045
|
};
|