nhanh-pure-function 2.0.6 → 3.0.0
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/Animate/index.d.ts +45 -0
- package/dist/Animate/type.d.ts +0 -0
- package/dist/Blob/index.d.ts +10 -0
- package/dist/Blob/type.d.ts +0 -0
- package/dist/Browser/index.d.ts +52 -0
- package/dist/Browser/type.d.ts +0 -0
- package/dist/{User → Element}/index.d.ts +11 -20
- package/dist/File/index.d.ts +19 -0
- package/dist/File/type.d.ts +0 -0
- package/dist/Format/index.d.ts +75 -0
- package/dist/Format/type.d.ts +0 -0
- package/dist/Math/index.d.ts +13 -76
- package/dist/Math/type.d.ts +0 -4
- package/dist/Utility/index.d.ts +21 -226
- package/dist/Valid/index.d.ts +122 -0
- package/dist/Valid/type.d.ts +4 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.es.js +624 -571
- package/package.json +1 -1
- /package/dist/{User → Element}/type.d.ts +0 -0
package/dist/index.es.js
CHANGED
|
@@ -1,12 +1,209 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".nhanh-pure-function{--nhanh: 2233}.no-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}")),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
|
|
2
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var it = Object.defineProperty;
|
|
3
|
+
var Q = (n) => {
|
|
4
4
|
throw TypeError(n);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var c = (n, e, t) => (
|
|
9
|
-
|
|
6
|
+
var st = (n, e, t) => e in n ? it(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
7
|
+
var E = (n, e, t) => st(n, typeof e != "symbol" ? e + "" : e, t), tt = (n, e, t) => e.has(n) || Q("Cannot " + t);
|
|
8
|
+
var c = (n, e, t) => (tt(n, e, "read from private field"), t ? t.call(n) : e.get(n)), h = (n, e, t) => e.has(n) ? Q("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), m = (n, e, t, o) => (tt(n, e, "write to private field"), o ? o.call(n, t) : e.set(n, t), t);
|
|
9
|
+
function vt(n, e = 500) {
|
|
10
|
+
let t, o = !0;
|
|
11
|
+
function r(i) {
|
|
12
|
+
if (!o) return;
|
|
13
|
+
t || (t = i);
|
|
14
|
+
let s = Math.min((i - t) / e, 1);
|
|
15
|
+
n(s), i - t < e && requestAnimationFrame(r);
|
|
16
|
+
}
|
|
17
|
+
return requestAnimationFrame(r), () => o = !1;
|
|
18
|
+
}
|
|
19
|
+
function bt(n, e, t, o, r = 2) {
|
|
20
|
+
let i = n, s = !1, a = 1, u = n, l = e, d = t;
|
|
21
|
+
const f = () => {
|
|
22
|
+
const x = (l - u) / d;
|
|
23
|
+
return Number(x.toFixed(r));
|
|
24
|
+
};
|
|
25
|
+
let w = f();
|
|
26
|
+
const L = (x) => Math.min(Math.max(x, u), l), A = (x) => Number(x.toFixed(r)), B = (x, X, H) => {
|
|
27
|
+
const I = [];
|
|
28
|
+
return x >= X && I.push("最小值必须小于最大值"), H <= 0 && I.push("分段数必须为正数"), I;
|
|
29
|
+
}, rt = (x, X, H) => {
|
|
30
|
+
const I = B(x, X, H);
|
|
31
|
+
return I.length > 0 ? (console.error(`参数更新失败: ${I.join("; ")}`), !1) : (u = x, l = X, d = H, w = f(), i = L(i), !0);
|
|
32
|
+
}, J = () => {
|
|
33
|
+
s && (a = i >= l ? -1 : i <= u ? 1 : a, i = L(i + w * a), o(A(i)), requestAnimationFrame(J));
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
/** 启动/继续动画 */
|
|
37
|
+
play(x = i) {
|
|
38
|
+
if (i = L(x), B(u, l, d).length)
|
|
39
|
+
return console.warn("配置参数错误", this.getParams());
|
|
40
|
+
s || (s = !0, J());
|
|
41
|
+
},
|
|
42
|
+
/** 暂停动画 */
|
|
43
|
+
pause() {
|
|
44
|
+
s = !1;
|
|
45
|
+
},
|
|
46
|
+
/** 获取当前值 */
|
|
47
|
+
getCurrent: () => A(i),
|
|
48
|
+
/** 是否正在运行 */
|
|
49
|
+
isPlaying: () => s,
|
|
50
|
+
/** 更新参数(不中断动画) */
|
|
51
|
+
updateParams: rt,
|
|
52
|
+
/** 获取当前参数 */
|
|
53
|
+
getParams: () => ({ min: u, max: l, steps: d, precision: r, stepSize: w })
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function _t(n, e, t, o, r = 2) {
|
|
57
|
+
if (t <= 0) return;
|
|
58
|
+
const i = (f) => Number(f.toFixed(r)), s = e - n, a = i(Math.abs(s) / t);
|
|
59
|
+
if (a === 0) return;
|
|
60
|
+
const u = Math.sign(s);
|
|
61
|
+
let l = n;
|
|
62
|
+
const d = () => {
|
|
63
|
+
l = i(l + a * u), (u > 0 ? l < e : l > e) ? (o(l), requestAnimationFrame(d)) : o(e);
|
|
64
|
+
};
|
|
65
|
+
d();
|
|
66
|
+
}
|
|
67
|
+
function Et(n, e = "image/png") {
|
|
68
|
+
try {
|
|
69
|
+
let t, o = e;
|
|
70
|
+
if (n instanceof File)
|
|
71
|
+
return URL.createObjectURL(n);
|
|
72
|
+
if (typeof n == "string") {
|
|
73
|
+
let i = n;
|
|
74
|
+
const s = i.match(/^data:([^;]*)(;base64)?,(.*)$/i);
|
|
75
|
+
if (s) {
|
|
76
|
+
if (!s[2])
|
|
77
|
+
return console.error("无效的数据 URL:缺少 base64 编码声明");
|
|
78
|
+
if (o = s[1] || o, i = s[3], !i)
|
|
79
|
+
return console.error("数据 URL 包含空有效负载");
|
|
80
|
+
}
|
|
81
|
+
i = i.replace(/[^A-Za-z0-9+/=]/g, "");
|
|
82
|
+
const a = atob(i);
|
|
83
|
+
t = new Uint8Array(a.length);
|
|
84
|
+
for (let u = 0; u < a.length; u++)
|
|
85
|
+
t[u] = a.charCodeAt(u);
|
|
86
|
+
} else if (n instanceof ArrayBuffer)
|
|
87
|
+
t = new Uint8Array(n);
|
|
88
|
+
else if (n instanceof Uint8Array)
|
|
89
|
+
t = n;
|
|
90
|
+
else
|
|
91
|
+
return console.error(
|
|
92
|
+
"不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array"
|
|
93
|
+
);
|
|
94
|
+
const r = new Blob([t], { type: o });
|
|
95
|
+
return URL.createObjectURL(r);
|
|
96
|
+
} catch (t) {
|
|
97
|
+
return console.error(
|
|
98
|
+
"数据到 ImageURL 的转换失败:",
|
|
99
|
+
t.message,
|
|
100
|
+
t.stack || "没有可用的堆栈跟踪"
|
|
101
|
+
), null;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function Mt(n, e = 10) {
|
|
105
|
+
let t = 0, o = e;
|
|
106
|
+
function r() {
|
|
107
|
+
if (o > 0)
|
|
108
|
+
o--, requestAnimationFrame(r);
|
|
109
|
+
else {
|
|
110
|
+
const s = (+/* @__PURE__ */ new Date() - t) / e, a = 1e3 / s;
|
|
111
|
+
n(Number(a.toFixed(2)), Number(s.toFixed(2)));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
requestAnimationFrame(() => {
|
|
115
|
+
t = +/* @__PURE__ */ new Date(), r();
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function Ft(n) {
|
|
119
|
+
const e = () => Promise.resolve(), t = (a) => (console.error(a), Promise.reject(a));
|
|
120
|
+
function o() {
|
|
121
|
+
return navigator.clipboard.writeText(n).then(e).catch(t);
|
|
122
|
+
}
|
|
123
|
+
function r() {
|
|
124
|
+
const a = document.createElement("div");
|
|
125
|
+
a.innerText = n, document.body.appendChild(a);
|
|
126
|
+
const u = document.createRange();
|
|
127
|
+
u.selectNodeContents(a);
|
|
128
|
+
const l = window.getSelection();
|
|
129
|
+
let d = !1;
|
|
130
|
+
return l && (l.removeAllRanges(), l.addRange(u), d = document.execCommand("copy")), document.body.removeChild(a), d ? Promise.resolve() : Promise.reject();
|
|
131
|
+
}
|
|
132
|
+
function i() {
|
|
133
|
+
const a = document.createElement("textarea");
|
|
134
|
+
a.value = n, document.body.appendChild(a), a.select(), a.setSelectionRange(0, n.length);
|
|
135
|
+
let u = !1;
|
|
136
|
+
return document.activeElement === a && (u = document.execCommand("Copy", !0)), document.body.removeChild(a), u ? Promise.resolve() : Promise.reject();
|
|
137
|
+
}
|
|
138
|
+
function s() {
|
|
139
|
+
return r().then(e).catch(() => {
|
|
140
|
+
i().then(e).catch(() => t("复制方式尽皆失效"));
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return navigator.clipboard ? o().catch(s) : s();
|
|
144
|
+
}
|
|
145
|
+
class ct {
|
|
146
|
+
/** 请使用静态方法 */
|
|
147
|
+
constructor() {
|
|
148
|
+
}
|
|
149
|
+
/** 添加已有窗口 */
|
|
150
|
+
static add(e, t) {
|
|
151
|
+
this.keys.set(e, t);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* 根据键打开或聚焦窗口
|
|
155
|
+
* @param key 窗口的唯一键
|
|
156
|
+
* @param url 要打开的URL
|
|
157
|
+
* @param target 窗口的目标
|
|
158
|
+
* @param windowFeatures 新窗口的特性
|
|
159
|
+
* @returns 返回已打开或新打开的窗口
|
|
160
|
+
*/
|
|
161
|
+
static open(e, t, o, r) {
|
|
162
|
+
const i = this.keys.get(e);
|
|
163
|
+
if (i && !i.closed)
|
|
164
|
+
return i.focus(), i;
|
|
165
|
+
{
|
|
166
|
+
const s = window.open(t, o, r);
|
|
167
|
+
if (s)
|
|
168
|
+
return this.keys.set(e, s), s;
|
|
169
|
+
console.error("window.open failed: 可能是浏览器阻止了弹出窗口"), this.keys.delete(e);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* 检查指定键的窗口是否打开
|
|
174
|
+
* @param key 窗口的唯一键
|
|
175
|
+
* @returns 如果窗口打开则返回true,否则返回false
|
|
176
|
+
*/
|
|
177
|
+
static isOpen(e) {
|
|
178
|
+
const t = this.keys.get(e);
|
|
179
|
+
return t != null && t.closed && this.keys.delete(e), this.keys.has(e);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* 获取与指定键关联的窗口
|
|
183
|
+
* @param key 窗口的唯一键
|
|
184
|
+
* @returns 返回对应的窗口,如果窗口已关闭则返回undefined
|
|
185
|
+
*/
|
|
186
|
+
static getWindow(e) {
|
|
187
|
+
if (this.isOpen(e)) return this.keys.get(e);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* 关闭与指定键关联的窗口
|
|
191
|
+
* @param key 窗口的唯一键
|
|
192
|
+
*/
|
|
193
|
+
static close(e) {
|
|
194
|
+
const t = this.keys.get(e);
|
|
195
|
+
t && (t.close(), this.keys.delete(e));
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* 关闭所有打开的窗口并清空Map
|
|
199
|
+
*/
|
|
200
|
+
static closeAll() {
|
|
201
|
+
this.keys.forEach((e, t) => e.close()), this.keys.clear();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// 存储键与对应窗口的Map
|
|
205
|
+
E(ct, "keys", /* @__PURE__ */ new Map());
|
|
206
|
+
const at = {
|
|
10
207
|
/* 常见扩展名映射 */
|
|
11
208
|
".mp3": "audio/mpeg",
|
|
12
209
|
".mp4": "video/mp4",
|
|
@@ -70,7 +267,7 @@ const et = {
|
|
|
70
267
|
".eot": "application/vnd.ms-fontobject",
|
|
71
268
|
".map": "application/json"
|
|
72
269
|
// 可根据需要继续扩展
|
|
73
|
-
},
|
|
270
|
+
}, V = {
|
|
74
271
|
image: [
|
|
75
272
|
".jpg",
|
|
76
273
|
".jpeg",
|
|
@@ -250,7 +447,7 @@ const et = {
|
|
|
250
447
|
".awk",
|
|
251
448
|
".php"
|
|
252
449
|
]
|
|
253
|
-
},
|
|
450
|
+
}, et = [
|
|
254
451
|
"",
|
|
255
452
|
"万",
|
|
256
453
|
"亿",
|
|
@@ -265,67 +462,37 @@ const et = {
|
|
|
265
462
|
"载",
|
|
266
463
|
"极"
|
|
267
464
|
];
|
|
268
|
-
function
|
|
269
|
-
return n
|
|
270
|
-
}
|
|
271
|
-
function ht(n) {
|
|
272
|
-
return !(n === null || typeof n != "object" || Array.isArray(n));
|
|
273
|
-
}
|
|
274
|
-
function pt(n) {
|
|
275
|
-
if (typeof n != "function")
|
|
276
|
-
return console.error("非函数:", n);
|
|
277
|
-
const e = function(t) {
|
|
278
|
-
t.didTimeout || t.timeRemaining() <= 0 ? requestIdleCallback(e) : n();
|
|
279
|
-
};
|
|
280
|
-
requestIdleCallback(e);
|
|
465
|
+
function Ct(n) {
|
|
466
|
+
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
281
467
|
}
|
|
282
|
-
function
|
|
283
|
-
|
|
284
|
-
return new Promise((o, r) => {
|
|
285
|
-
const i = () => {
|
|
286
|
-
if (+/* @__PURE__ */ new Date() - t >= e) return r("超时");
|
|
287
|
-
if (n()) return o("完成");
|
|
288
|
-
requestIdleCallback(i);
|
|
289
|
-
};
|
|
290
|
-
i();
|
|
291
|
-
});
|
|
468
|
+
function Pt(n, e, t = 2) {
|
|
469
|
+
return !Number.isFinite(n) || !Number.isFinite(e) || !Number.isFinite(t) ? (console.error("所有参数必须是有限的数字"), "") : e === 0 ? (console.error("分母不能为零"), "") : t < 0 ? (console.error("小数位数不能为负数"), "") : (n / e * 100).toFixed(t) + "%";
|
|
292
470
|
}
|
|
293
|
-
function
|
|
294
|
-
const o =
|
|
295
|
-
|
|
296
|
-
"g"
|
|
297
|
-
);
|
|
298
|
-
return n.replace(o, function(r, i, s) {
|
|
299
|
-
return i === s ? t : "";
|
|
300
|
-
});
|
|
471
|
+
function Lt(n) {
|
|
472
|
+
const t = n.toString().split("."), o = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
473
|
+
return t.length > 1 ? o + "." + t[1] : o;
|
|
301
474
|
}
|
|
302
|
-
function
|
|
303
|
-
|
|
475
|
+
function Ut(n, e) {
|
|
476
|
+
const t = {
|
|
477
|
+
join: !0,
|
|
478
|
+
suffix: "",
|
|
479
|
+
decimalPlaces: 2
|
|
480
|
+
}, { join: o, suffix: r, decimalPlaces: i } = {
|
|
481
|
+
...t,
|
|
482
|
+
...e || {}
|
|
483
|
+
}, s = Number(n);
|
|
484
|
+
if (isNaN(s)) return o ? `0${r}` : [0, r];
|
|
485
|
+
const a = Math.abs(s), u = s >= 0, l = Math.max(0, Math.floor(Math.log10(a) / 4)), d = Math.pow(1e4, l), f = a / d, w = (u ? 1 : -1) * parseFloat(f.toFixed(Math.max(0, i)));
|
|
486
|
+
return o ? `${w}${et[l]}${r}` : [w, et[l] + r];
|
|
304
487
|
}
|
|
305
|
-
function
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
if (r != i) return e;
|
|
312
|
-
if (r == "object" || r == "array") {
|
|
313
|
-
if (t.some(([s, a]) => s == n && a == e)) return n;
|
|
314
|
-
if (t.push([n, e]), r == "object") {
|
|
315
|
-
for (const s in e)
|
|
316
|
-
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
317
|
-
const a = e[s], l = n[s], u = H(l, a, t, o);
|
|
318
|
-
n[s] = u;
|
|
319
|
-
}
|
|
320
|
-
return n;
|
|
321
|
-
} else if (r == "array")
|
|
322
|
-
return e.forEach((s, a) => {
|
|
323
|
-
const l = s, u = n[a], d = H(u, l, t, o);
|
|
324
|
-
n[a] = d;
|
|
325
|
-
}), n;
|
|
326
|
-
} else return e;
|
|
488
|
+
function Tt(n) {
|
|
489
|
+
const e = ["B", "KB", "MB", "GB", "TB", "PB"];
|
|
490
|
+
let t = 0;
|
|
491
|
+
for (; n > 1024; )
|
|
492
|
+
n /= 1024, t++;
|
|
493
|
+
return `${Math.round(n * 100) / 100} ${e[t]}`;
|
|
327
494
|
}
|
|
328
|
-
function
|
|
495
|
+
function jt(n, e = "YYYY-MM-DD hh:mm:ss", t = !0) {
|
|
329
496
|
const o = new Date(n);
|
|
330
497
|
if (isNaN(o.getTime()))
|
|
331
498
|
return console.error("Invalid date"), "";
|
|
@@ -344,126 +511,72 @@ function vt(n, e = "YYYY-MM-DD hh:mm:ss", t = !0) {
|
|
|
344
511
|
return t ? String(s).padStart(2, "0") : String(s);
|
|
345
512
|
});
|
|
346
513
|
}
|
|
347
|
-
function
|
|
348
|
-
return new Promise((e, t) => {
|
|
349
|
-
fetch(n).then((o) => e(o.text())).catch((o) => {
|
|
350
|
-
console.error("Error fetching :", o), t(o);
|
|
351
|
-
});
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
function X(n, e = "file") {
|
|
514
|
+
function Z(n, e = "file") {
|
|
355
515
|
if (!n || (n = String(n).trim(), n === "")) return e;
|
|
356
516
|
const t = n.split("/");
|
|
357
517
|
return t[t.length - 1].split("?")[0];
|
|
358
518
|
}
|
|
359
|
-
function
|
|
360
|
-
return
|
|
361
|
-
try {
|
|
362
|
-
e = e || X(n, "downloaded_file"), fetch(n).then((r) => (r.ok || o(`文件下载失败,状态码: ${r.status}`), r.blob())).then((r) => {
|
|
363
|
-
const i = URL.createObjectURL(r), s = document.createElement("a");
|
|
364
|
-
s.href = i, s.download = decodeURIComponent(e), document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(i), t(r);
|
|
365
|
-
}).catch(o);
|
|
366
|
-
} catch (r) {
|
|
367
|
-
o(r);
|
|
368
|
-
}
|
|
369
|
-
});
|
|
519
|
+
function Rt(n, e) {
|
|
520
|
+
return n = n.replace(/([^a-zA-Z][a-z])/g, (t) => t.toUpperCase()), e ? n.replace(/[^a-zA-Z]+/g, "") : n;
|
|
370
521
|
}
|
|
371
|
-
function
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
n(Number(a.toFixed(2)), Number(s.toFixed(2)));
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
requestAnimationFrame(() => {
|
|
382
|
-
t = +/* @__PURE__ */ new Date(), r();
|
|
522
|
+
function At(n, e, t = ",") {
|
|
523
|
+
const o = new RegExp(
|
|
524
|
+
`(^|${t})${e}(${t}|$)`,
|
|
525
|
+
"g"
|
|
526
|
+
);
|
|
527
|
+
return n.replace(o, function(r, i, s) {
|
|
528
|
+
return i === s ? t : "";
|
|
383
529
|
});
|
|
384
530
|
}
|
|
385
|
-
function
|
|
386
|
-
return n
|
|
531
|
+
function It(n) {
|
|
532
|
+
return !(n === null || typeof n != "object" || Array.isArray(n));
|
|
387
533
|
}
|
|
388
|
-
function
|
|
389
|
-
|
|
390
|
-
let s = e.replace(/^[^.]+./, "");
|
|
391
|
-
s = s == e ? "text/plain" : "application/" + s, t = { type: s };
|
|
392
|
-
}
|
|
393
|
-
const o = new Blob(n, t), r = URL.createObjectURL(o), i = document.createElement("a");
|
|
394
|
-
i.href = r, i.download = e, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
|
|
534
|
+
function lt(n, e = 2) {
|
|
535
|
+
return Array.isArray(n) && n.length >= e && n.every((t) => typeof t == "number" && Number.isFinite(t));
|
|
395
536
|
}
|
|
396
|
-
function
|
|
397
|
-
return n
|
|
398
|
-
const t = Math.random() * 16 | 0;
|
|
399
|
-
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
400
|
-
});
|
|
537
|
+
function kt(n, e = 1, t = 2) {
|
|
538
|
+
return Array.isArray(n) && n.length >= e && n.every((o) => lt(o, t));
|
|
401
539
|
}
|
|
402
|
-
function
|
|
403
|
-
|
|
404
|
-
return function(...o) {
|
|
405
|
-
clearTimeout(t), t = setTimeout(() => {
|
|
406
|
-
n(...o), t = void 0;
|
|
407
|
-
}, e);
|
|
408
|
-
};
|
|
540
|
+
function St(n, e, t) {
|
|
541
|
+
return Math.abs(n - e) <= t;
|
|
409
542
|
}
|
|
410
|
-
function
|
|
411
|
-
let t =
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
try {
|
|
417
|
-
n(...o);
|
|
418
|
-
} catch (i) {
|
|
419
|
-
console.error("Throttled function execution failed:", i);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
|
-
function Z(n) {
|
|
425
|
-
return Array.isArray(n) ? "array" : n === null ? "null" : typeof n;
|
|
426
|
-
}
|
|
427
|
-
function Tt(n) {
|
|
428
|
-
const e = () => Promise.resolve(), t = (a) => (console.error(a), Promise.reject(a));
|
|
429
|
-
function o() {
|
|
430
|
-
return navigator.clipboard.writeText(n).then(e).catch(t);
|
|
431
|
-
}
|
|
432
|
-
function r() {
|
|
433
|
-
const a = document.createElement("div");
|
|
434
|
-
a.innerText = n, document.body.appendChild(a);
|
|
435
|
-
const l = document.createRange();
|
|
436
|
-
l.selectNodeContents(a);
|
|
437
|
-
const u = window.getSelection();
|
|
438
|
-
let d = !1;
|
|
439
|
-
return u && (u.removeAllRanges(), u.addRange(l), d = document.execCommand("copy")), document.body.removeChild(a), d ? Promise.resolve() : Promise.reject();
|
|
440
|
-
}
|
|
441
|
-
function i() {
|
|
442
|
-
const a = document.createElement("textarea");
|
|
443
|
-
a.value = n, document.body.appendChild(a), a.select(), a.setSelectionRange(0, n.length);
|
|
444
|
-
let l = !1;
|
|
445
|
-
return document.activeElement === a && (l = document.execCommand("Copy", !0)), document.body.removeChild(a), l ? Promise.resolve() : Promise.reject();
|
|
446
|
-
}
|
|
447
|
-
function s() {
|
|
448
|
-
return r().then(e).catch(() => {
|
|
449
|
-
i().then(e).catch(() => t("复制方式尽皆失效"));
|
|
450
|
-
});
|
|
543
|
+
function Dt(n, e) {
|
|
544
|
+
let t = !1;
|
|
545
|
+
const { x: o, y: r } = n, i = e.length;
|
|
546
|
+
for (let s = 0, a = i - 1; s < i; a = s++) {
|
|
547
|
+
const u = e[s].x, l = e[s].y, d = e[a].x, f = e[a].y;
|
|
548
|
+
l > r != f > r && o < (d - u) * (r - l) / (f - l) + u && (t = !t);
|
|
451
549
|
}
|
|
452
|
-
return
|
|
453
|
-
}
|
|
454
|
-
function Rt(n, e) {
|
|
455
|
-
const t = e.split(".");
|
|
456
|
-
return t.reduce((o, r, i) => (r in o || (i === t.length - 1 ? o[r] = void 0 : o[r] = {}), o[r]), n);
|
|
550
|
+
return t;
|
|
457
551
|
}
|
|
458
|
-
function
|
|
459
|
-
|
|
460
|
-
return t.reduce((o, r, i) => o.hasOwnProperty(r) ? o[r] : o[r] = i == t.length - 1 ? void 0 : {}, n);
|
|
552
|
+
function nt(n) {
|
|
553
|
+
return Array.isArray(n) ? "array" : n === null ? "null" : typeof n;
|
|
461
554
|
}
|
|
462
|
-
function
|
|
463
|
-
|
|
464
|
-
|
|
555
|
+
function zt(n) {
|
|
556
|
+
return [
|
|
557
|
+
"https:",
|
|
558
|
+
// HTTPS协议,用于安全地浏览网页
|
|
559
|
+
"wss:",
|
|
560
|
+
// WebSocket Secure协议,用于安全的WebSocket通信
|
|
561
|
+
"ftps:",
|
|
562
|
+
// FTP Secure协议,用于安全的文件传输
|
|
563
|
+
"sftp:",
|
|
564
|
+
// SSH File Transfer Protocol,通过SSH安全地传输文件
|
|
565
|
+
"smpts:",
|
|
566
|
+
// Secure SMTP协议,用于安全地发送邮件
|
|
567
|
+
"smtp+tls:",
|
|
568
|
+
// SMTP协议结合STARTTLS扩展,用于升级到安全连接
|
|
569
|
+
"imap+tls:",
|
|
570
|
+
// IMAP协议结合STARTTLS扩展,用于安全地访问邮件
|
|
571
|
+
"pop3+tls:",
|
|
572
|
+
// POP3协议结合STARTTLS扩展,用于安全地接收邮件
|
|
573
|
+
"rdp:",
|
|
574
|
+
// Remote Desktop Protocol,用于安全的远程桌面连接
|
|
575
|
+
"vpn:"
|
|
576
|
+
// VPN协议,用于创建安全的网络连接
|
|
577
|
+
].some((t) => n.startsWith(t));
|
|
465
578
|
}
|
|
466
|
-
function
|
|
579
|
+
function Ot(n) {
|
|
467
580
|
return new Promise((e, t) => {
|
|
468
581
|
if (typeof n != "string" || n.trim() === "" || !n.includes("://")) {
|
|
469
582
|
t(new Error("Invalid URL: Must be a non-empty string"));
|
|
@@ -490,30 +603,6 @@ function _t(n) {
|
|
|
490
603
|
}
|
|
491
604
|
});
|
|
492
605
|
}
|
|
493
|
-
function kt(n) {
|
|
494
|
-
return [
|
|
495
|
-
"https:",
|
|
496
|
-
// HTTPS协议,用于安全地浏览网页
|
|
497
|
-
"wss:",
|
|
498
|
-
// WebSocket Secure协议,用于安全的WebSocket通信
|
|
499
|
-
"ftps:",
|
|
500
|
-
// FTP Secure协议,用于安全的文件传输
|
|
501
|
-
"sftp:",
|
|
502
|
-
// SSH File Transfer Protocol,通过SSH安全地传输文件
|
|
503
|
-
"smpts:",
|
|
504
|
-
// Secure SMTP协议,用于安全地发送邮件
|
|
505
|
-
"smtp+tls:",
|
|
506
|
-
// SMTP协议结合STARTTLS扩展,用于升级到安全连接
|
|
507
|
-
"imap+tls:",
|
|
508
|
-
// IMAP协议结合STARTTLS扩展,用于安全地访问邮件
|
|
509
|
-
"pop3+tls:",
|
|
510
|
-
// POP3协议结合STARTTLS扩展,用于安全地接收邮件
|
|
511
|
-
"rdp:",
|
|
512
|
-
// Remote Desktop Protocol,用于安全的远程桌面连接
|
|
513
|
-
"vpn:"
|
|
514
|
-
// VPN协议,用于创建安全的网络连接
|
|
515
|
-
].some((t) => n.startsWith(t));
|
|
516
|
-
}
|
|
517
606
|
const C = class C {
|
|
518
607
|
constructor() {
|
|
519
608
|
if (new.target === C)
|
|
@@ -522,11 +611,11 @@ const C = class C {
|
|
|
522
611
|
static check(e, t) {
|
|
523
612
|
if (!e || typeof e != "string")
|
|
524
613
|
return console.error("Invalid URL provided"), t ? !1 : "unknown";
|
|
525
|
-
const o =
|
|
614
|
+
const o = Z(e).toLowerCase();
|
|
526
615
|
if (t) {
|
|
527
|
-
if (!
|
|
616
|
+
if (!V.hasOwnProperty(t))
|
|
528
617
|
return console.error(`Unknown file type: ${t}`), "unknown";
|
|
529
|
-
const r =
|
|
618
|
+
const r = V[t];
|
|
530
619
|
return C._checkExtension(o, r);
|
|
531
620
|
}
|
|
532
621
|
return C._detectFileType(o);
|
|
@@ -541,7 +630,7 @@ const C = class C {
|
|
|
541
630
|
*/
|
|
542
631
|
static parseAddresses(e) {
|
|
543
632
|
return !e || typeof e != "string" ? (console.error("Invalid URL provided"), []) : e.split(",").map((t) => {
|
|
544
|
-
const o =
|
|
633
|
+
const o = Z(t), r = this.check(t);
|
|
545
634
|
return { url: t, name: o, type: r };
|
|
546
635
|
});
|
|
547
636
|
}
|
|
@@ -556,8 +645,8 @@ const C = class C {
|
|
|
556
645
|
if (typeof e != "string" || typeof t != "string") return !1;
|
|
557
646
|
const o = C._normalizeType(e), r = t.split(",").map((a) => C._normalizeType(a.trim())), [i, s = "*"] = o.split("/");
|
|
558
647
|
return r.some((a) => {
|
|
559
|
-
const [
|
|
560
|
-
return (
|
|
648
|
+
const [u, l = "*"] = a.split("/");
|
|
649
|
+
return (u === "*" || i === "*" || u === i) && (l === "*" || s === "*" || l === s);
|
|
561
650
|
});
|
|
562
651
|
}
|
|
563
652
|
/**
|
|
@@ -569,7 +658,7 @@ const C = class C {
|
|
|
569
658
|
* @returns {string} 标准化的MIME类型字符串,如果无法识别则返回原始输入
|
|
570
659
|
*/
|
|
571
660
|
static _normalizeType(e) {
|
|
572
|
-
return e.startsWith(".") && !e.includes("/") ?
|
|
661
|
+
return e.startsWith(".") && !e.includes("/") ? at[e.toLowerCase()] || e : e.includes("/") ? e : `${e}/*`;
|
|
573
662
|
}
|
|
574
663
|
/**
|
|
575
664
|
* 检查URL是否具有任何指定的文件扩展名
|
|
@@ -593,143 +682,150 @@ const C = class C {
|
|
|
593
682
|
}
|
|
594
683
|
};
|
|
595
684
|
// 缓存文件扩展名的条目,以提高性能
|
|
596
|
-
|
|
597
|
-
let
|
|
598
|
-
function
|
|
599
|
-
|
|
685
|
+
E(C, "cachedEntries", Object.entries(V));
|
|
686
|
+
let ot = C;
|
|
687
|
+
function Nt(n) {
|
|
688
|
+
if (typeof n != "function")
|
|
689
|
+
return console.error("非函数:", n);
|
|
690
|
+
const e = function(t) {
|
|
691
|
+
t.didTimeout || t.timeRemaining() <= 0 ? requestIdleCallback(e) : n();
|
|
692
|
+
};
|
|
693
|
+
requestIdleCallback(e);
|
|
600
694
|
}
|
|
601
|
-
function
|
|
602
|
-
const
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
695
|
+
function qt(n, e) {
|
|
696
|
+
const t = +/* @__PURE__ */ new Date();
|
|
697
|
+
return new Promise((o, r) => {
|
|
698
|
+
const i = () => {
|
|
699
|
+
if (+/* @__PURE__ */ new Date() - t >= e) return r("超时");
|
|
700
|
+
if (n()) return o("完成");
|
|
701
|
+
requestIdleCallback(i);
|
|
702
|
+
};
|
|
703
|
+
i();
|
|
704
|
+
});
|
|
608
705
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
/** 添加已有窗口 */
|
|
614
|
-
static add(e, t) {
|
|
615
|
-
this.keys.set(e, t);
|
|
706
|
+
function K(n, e, t = [], o = +/* @__PURE__ */ new Date()) {
|
|
707
|
+
if (o < +/* @__PURE__ */ new Date() - 50) {
|
|
708
|
+
console.error("_MergeObjects 合并异常:疑似死循环");
|
|
709
|
+
return;
|
|
616
710
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
711
|
+
const r = nt(n), i = nt(e);
|
|
712
|
+
if (r != i) return e;
|
|
713
|
+
if (r == "object" || r == "array") {
|
|
714
|
+
if (t.some(([s, a]) => s == n && a == e)) return n;
|
|
715
|
+
if (t.push([n, e]), r == "object") {
|
|
716
|
+
for (const s in e)
|
|
717
|
+
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
718
|
+
const a = e[s], u = n[s], l = K(
|
|
719
|
+
u,
|
|
720
|
+
a,
|
|
721
|
+
t,
|
|
722
|
+
o
|
|
723
|
+
);
|
|
724
|
+
n[s] = l;
|
|
725
|
+
}
|
|
726
|
+
return n;
|
|
727
|
+
} else if (r == "array")
|
|
728
|
+
return e.forEach((s, a) => {
|
|
729
|
+
const u = s, l = n[a], d = K(
|
|
730
|
+
l,
|
|
731
|
+
u,
|
|
732
|
+
t,
|
|
733
|
+
o
|
|
734
|
+
);
|
|
735
|
+
n[a] = d;
|
|
736
|
+
}), n;
|
|
737
|
+
} else return e;
|
|
738
|
+
}
|
|
739
|
+
function $t(n = "") {
|
|
740
|
+
return n + "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
741
|
+
const t = Math.random() * 16 | 0;
|
|
742
|
+
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
function ut(n, e) {
|
|
746
|
+
let t;
|
|
747
|
+
return function(...o) {
|
|
748
|
+
clearTimeout(t), t = setTimeout(() => {
|
|
749
|
+
n(...o), t = void 0;
|
|
750
|
+
}, e);
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
function Yt(n, e) {
|
|
754
|
+
let t = -1 / 0;
|
|
755
|
+
return function(...o) {
|
|
756
|
+
const r = performance.now();
|
|
757
|
+
if (r - t > e) {
|
|
758
|
+
t = r;
|
|
759
|
+
try {
|
|
760
|
+
n(...o);
|
|
761
|
+
} catch (i) {
|
|
762
|
+
console.error("Throttled function execution failed:", i);
|
|
763
|
+
}
|
|
634
764
|
}
|
|
635
|
-
}
|
|
636
|
-
/**
|
|
637
|
-
* 检查指定键的窗口是否打开
|
|
638
|
-
* @param key 窗口的唯一键
|
|
639
|
-
* @returns 如果窗口打开则返回true,否则返回false
|
|
640
|
-
*/
|
|
641
|
-
static isOpen(e) {
|
|
642
|
-
const t = this.keys.get(e);
|
|
643
|
-
return t != null && t.closed && this.keys.delete(e), this.keys.has(e);
|
|
644
|
-
}
|
|
645
|
-
/**
|
|
646
|
-
* 获取与指定键关联的窗口
|
|
647
|
-
* @param key 窗口的唯一键
|
|
648
|
-
* @returns 返回对应的窗口,如果窗口已关闭则返回undefined
|
|
649
|
-
*/
|
|
650
|
-
static getWindow(e) {
|
|
651
|
-
if (this.isOpen(e)) return this.keys.get(e);
|
|
652
|
-
}
|
|
653
|
-
/**
|
|
654
|
-
* 关闭与指定键关联的窗口
|
|
655
|
-
* @param key 窗口的唯一键
|
|
656
|
-
*/
|
|
657
|
-
static close(e) {
|
|
658
|
-
const t = this.keys.get(e);
|
|
659
|
-
t && (t.close(), this.keys.delete(e));
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* 关闭所有打开的窗口并清空Map
|
|
663
|
-
*/
|
|
664
|
-
static closeAll() {
|
|
665
|
-
this.keys.forEach((e, t) => e.close()), this.keys.clear();
|
|
666
|
-
}
|
|
765
|
+
};
|
|
667
766
|
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
767
|
+
function Bt(n, e) {
|
|
768
|
+
const t = e.split(".");
|
|
769
|
+
return t.reduce((o, r, i) => (r in o || (i === t.length - 1 ? o[r] = void 0 : o[r] = {}), o[r]), n);
|
|
770
|
+
}
|
|
771
|
+
function Xt(n, e) {
|
|
772
|
+
const t = e.split(".");
|
|
773
|
+
return t.reduce((o, r, i) => o.hasOwnProperty(r) ? o[r] : o[r] = i == t.length - 1 ? void 0 : {}, n);
|
|
774
|
+
}
|
|
775
|
+
function Ht(n, e, t) {
|
|
776
|
+
const o = e.split(".");
|
|
777
|
+
return o.reduce((r, i, s) => (s === o.length - 1 && (r[i] = t), r[i]), n);
|
|
778
|
+
}
|
|
779
|
+
function Wt(n) {
|
|
780
|
+
return n.map((e, t) => n.slice(t).concat(n.slice(0, t)));
|
|
781
|
+
}
|
|
782
|
+
function Gt(n) {
|
|
783
|
+
const e = window.structuredClone, t = (o) => o === null || typeof o != "object" ? o : K(Array.isArray(o) ? [] : {}, o);
|
|
671
784
|
try {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
if (typeof n == "string") {
|
|
676
|
-
let i = n;
|
|
677
|
-
const s = i.match(/^data:([^;]*)(;base64)?,(.*)$/i);
|
|
678
|
-
if (s) {
|
|
679
|
-
if (!s[2])
|
|
680
|
-
throw new Error("无效的数据 URL:缺少 base64 编码声明");
|
|
681
|
-
if (o = s[1] || o, i = s[3], !i)
|
|
682
|
-
throw new Error("数据 URL 包含空有效负载");
|
|
683
|
-
}
|
|
684
|
-
i = i.replace(/[^A-Za-z0-9+/=]/g, "");
|
|
685
|
-
const a = atob(i);
|
|
686
|
-
t = new Uint8Array(a.length);
|
|
687
|
-
for (let l = 0; l < a.length; l++)
|
|
688
|
-
t[l] = a.charCodeAt(l);
|
|
689
|
-
} else if (n instanceof ArrayBuffer)
|
|
690
|
-
t = new Uint8Array(n);
|
|
691
|
-
else if (n instanceof Uint8Array)
|
|
692
|
-
t = n;
|
|
693
|
-
else
|
|
694
|
-
throw new Error(
|
|
695
|
-
"不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array"
|
|
696
|
-
);
|
|
697
|
-
const r = new Blob([t], { type: o });
|
|
698
|
-
return URL.createObjectURL(r);
|
|
699
|
-
} catch (t) {
|
|
700
|
-
return console.error(
|
|
701
|
-
"数据到 ImageURL 的转换失败:",
|
|
702
|
-
t.message,
|
|
703
|
-
t.stack || "没有可用的堆栈跟踪"
|
|
704
|
-
), null;
|
|
785
|
+
return e ? e(n) : t(n);
|
|
786
|
+
} catch (o) {
|
|
787
|
+
return console.error("structuredClone error:", o), e && t(n);
|
|
705
788
|
}
|
|
706
789
|
}
|
|
707
|
-
function
|
|
790
|
+
function Vt(n, e, t = 30) {
|
|
708
791
|
if (typeof n != "function")
|
|
709
|
-
|
|
792
|
+
return console.error("第一个参数必须是一个函数。");
|
|
710
793
|
if (!Array.isArray(e))
|
|
711
|
-
|
|
794
|
+
return console.error("第二个参数必须是一个数组。");
|
|
712
795
|
let o = [], r = 0;
|
|
713
796
|
const i = (s, a) => {
|
|
714
|
-
for (const [
|
|
715
|
-
if (s >=
|
|
716
|
-
return
|
|
797
|
+
for (const [u, l] of a)
|
|
798
|
+
if (s >= u)
|
|
799
|
+
return l;
|
|
717
800
|
return "black";
|
|
718
801
|
};
|
|
719
802
|
return function(...s) {
|
|
720
|
-
const a = performance.now(),
|
|
721
|
-
o.push(
|
|
722
|
-
const d = i(
|
|
803
|
+
const a = performance.now(), u = n(...s), l = performance.now() - a;
|
|
804
|
+
o.push(l), o.length > t && o.shift(), r = o.reduce((w, L) => w + L, 0) / o.length || 0;
|
|
805
|
+
const d = i(l, e), f = i(r, e);
|
|
723
806
|
return console.log(
|
|
724
|
-
`%c单次耗时:${
|
|
807
|
+
`%c单次耗时:${l.toFixed(2)}ms
|
|
725
808
|
%c平均耗时(${o.length}次):${r.toFixed(2)}ms`,
|
|
726
809
|
`color: ${d}; padding: 2px 0;`,
|
|
727
|
-
`color: ${
|
|
728
|
-
),
|
|
810
|
+
`color: ${f}; padding: 2px 0;`
|
|
811
|
+
), u;
|
|
729
812
|
};
|
|
730
813
|
}
|
|
731
|
-
function
|
|
732
|
-
const e =
|
|
814
|
+
function Zt(n) {
|
|
815
|
+
const e = Date.now();
|
|
816
|
+
let t = performance.now();
|
|
817
|
+
for (; Date.now() - e < n; ) {
|
|
818
|
+
t = Math.sin(t) * 1e6, (t > 1e6 || t < -1e6) && (t = 0);
|
|
819
|
+
try {
|
|
820
|
+
const o = t.toString().substring(0, 8);
|
|
821
|
+
history.replaceState(null, "", `#${o}`);
|
|
822
|
+
} catch {
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
return Date.now() - e;
|
|
826
|
+
}
|
|
827
|
+
function Kt(n) {
|
|
828
|
+
const e = ut(n, 100);
|
|
733
829
|
let t = 0, o = 0;
|
|
734
830
|
return function(r) {
|
|
735
831
|
const i = r.target;
|
|
@@ -737,32 +833,32 @@ function St(n) {
|
|
|
737
833
|
const {
|
|
738
834
|
scrollTop: s,
|
|
739
835
|
scrollHeight: a,
|
|
740
|
-
clientHeight:
|
|
741
|
-
scrollLeft:
|
|
836
|
+
clientHeight: u,
|
|
837
|
+
scrollLeft: l,
|
|
742
838
|
scrollWidth: d,
|
|
743
|
-
clientWidth:
|
|
839
|
+
clientWidth: f
|
|
744
840
|
} = i;
|
|
745
|
-
function
|
|
841
|
+
function w() {
|
|
746
842
|
if (t == s) return;
|
|
747
|
-
const
|
|
748
|
-
if (t = s,
|
|
749
|
-
a - s -
|
|
843
|
+
const A = t > s;
|
|
844
|
+
if (t = s, A) return;
|
|
845
|
+
a - s - u <= 1 && e("vertical");
|
|
750
846
|
}
|
|
751
|
-
function
|
|
752
|
-
if (o ==
|
|
753
|
-
const
|
|
754
|
-
if (o =
|
|
755
|
-
d -
|
|
847
|
+
function L() {
|
|
848
|
+
if (o == l) return;
|
|
849
|
+
const A = o > l;
|
|
850
|
+
if (o = l, A) return;
|
|
851
|
+
d - l - f <= 1 && e("horizontal");
|
|
756
852
|
}
|
|
757
|
-
|
|
853
|
+
w(), L();
|
|
758
854
|
};
|
|
759
855
|
}
|
|
760
|
-
function
|
|
761
|
-
const { isClickAllowed: o, uiLibrary: r = ["naiveUI", "ElementPlus", "Element"] } = t || {}, i = function(
|
|
762
|
-
const
|
|
763
|
-
for (const d in
|
|
764
|
-
Object.hasOwnProperty.call(
|
|
765
|
-
return
|
|
856
|
+
function Jt(n, e, t) {
|
|
857
|
+
const { isClickAllowed: o, uiLibrary: r = ["naiveUI", "ElementPlus", "Element"] } = t || {}, i = function(u) {
|
|
858
|
+
const l = [];
|
|
859
|
+
for (const d in u)
|
|
860
|
+
Object.hasOwnProperty.call(u, d) && r.includes(d) && l.push(...u[d]);
|
|
861
|
+
return l;
|
|
766
862
|
}({
|
|
767
863
|
naiveUI: [
|
|
768
864
|
".v-binder-follower-container",
|
|
@@ -775,35 +871,35 @@ function Ot(n, e, t) {
|
|
|
775
871
|
function s() {
|
|
776
872
|
e(), document.removeEventListener("mousedown", a);
|
|
777
873
|
}
|
|
778
|
-
function a(
|
|
874
|
+
function a(u) {
|
|
779
875
|
if (o) {
|
|
780
|
-
const
|
|
781
|
-
if (
|
|
782
|
-
if (
|
|
876
|
+
const f = o(u);
|
|
877
|
+
if (f) return;
|
|
878
|
+
if (f === !1) return s();
|
|
783
879
|
}
|
|
784
|
-
const
|
|
785
|
-
if (!(
|
|
786
|
-
n.concat(i).some((
|
|
880
|
+
const l = u.target;
|
|
881
|
+
if (!(l instanceof Element) || !l.isConnected) return;
|
|
882
|
+
n.concat(i).some((f) => !!(l != null && l.closest(f))) || s();
|
|
787
883
|
}
|
|
788
884
|
requestAnimationFrame(
|
|
789
885
|
() => document.addEventListener("mousedown", a)
|
|
790
886
|
);
|
|
791
887
|
}
|
|
792
|
-
var
|
|
793
|
-
class
|
|
888
|
+
var y, U, T, S, D, M, F, P, z;
|
|
889
|
+
class Qt {
|
|
794
890
|
constructor() {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
891
|
+
h(this, y);
|
|
892
|
+
h(this, U, !1);
|
|
893
|
+
h(this, T, {});
|
|
894
|
+
h(this, S, 0);
|
|
895
|
+
h(this, D, 0);
|
|
896
|
+
h(this, M, 0);
|
|
897
|
+
h(this, F, 0);
|
|
898
|
+
h(this, P);
|
|
899
|
+
h(this, z);
|
|
804
900
|
}
|
|
805
901
|
init(e, t) {
|
|
806
|
-
m(this,
|
|
902
|
+
m(this, y, e), m(this, P, t == null ? void 0 : t.limit), m(this, z, t == null ? void 0 : t.dragDom), m(this, T, {
|
|
807
903
|
mousedown: this.mousedown.bind(this),
|
|
808
904
|
mousemove: this.mousemove.bind(this),
|
|
809
905
|
mouseup: this.mouseup.bind(this)
|
|
@@ -814,45 +910,45 @@ class zt {
|
|
|
814
910
|
}
|
|
815
911
|
bindOrUnbindEvent(e) {
|
|
816
912
|
const t = e === "bind" ? "addEventListener" : "removeEventListener";
|
|
817
|
-
if (!c(this,
|
|
818
|
-
c(this,
|
|
913
|
+
if (!c(this, y)) return console.error("No DOM");
|
|
914
|
+
c(this, y)[t]("mousedown", c(this, T).mousedown), document[t]("mousemove", c(this, T).mousemove), document[t]("mouseup", c(this, T).mouseup);
|
|
819
915
|
}
|
|
820
916
|
alterLocation() {
|
|
821
|
-
if (!c(this,
|
|
822
|
-
c(this,
|
|
917
|
+
if (!c(this, y)) return console.error("No DOM");
|
|
918
|
+
c(this, P) && (m(this, M, Math.min(c(this, M), c(this, P).max.top)), m(this, M, Math.max(c(this, M), c(this, P).min.top)), m(this, F, Math.min(c(this, F), c(this, P).max.left)), m(this, F, Math.max(c(this, F), c(this, P).min.left))), c(this, y).style.setProperty("--top", c(this, M) + "px"), c(this, y).style.setProperty("--left", c(this, F) + "px");
|
|
823
919
|
}
|
|
824
920
|
mousedown(e) {
|
|
825
|
-
if (!c(this,
|
|
826
|
-
if (c(this,
|
|
827
|
-
document.body.classList.add("no-select"), m(this,
|
|
828
|
-
const t = c(this,
|
|
829
|
-
m(this,
|
|
921
|
+
if (!c(this, y)) return console.error("No DOM");
|
|
922
|
+
if (c(this, z) && e.target != c(this, z)) return;
|
|
923
|
+
document.body.classList.add("no-select"), m(this, U, !0);
|
|
924
|
+
const t = c(this, y).getBoundingClientRect(), { pageX: o, pageY: r } = e;
|
|
925
|
+
m(this, S, o), m(this, D, r), m(this, M, t.y), m(this, F, t.x);
|
|
830
926
|
}
|
|
831
927
|
mousemove(e) {
|
|
832
928
|
const { pageX: t, pageY: o } = e;
|
|
833
|
-
c(this,
|
|
929
|
+
c(this, U) && (m(this, M, c(this, M) + (o - c(this, D))), m(this, F, c(this, F) + (t - c(this, S))), m(this, S, t), m(this, D, o), this.alterLocation());
|
|
834
930
|
}
|
|
835
931
|
mouseup() {
|
|
836
|
-
c(this,
|
|
932
|
+
c(this, U) && (m(this, U, !1), document.body.classList.remove("no-select"));
|
|
837
933
|
}
|
|
838
934
|
}
|
|
839
|
-
|
|
840
|
-
var
|
|
841
|
-
class
|
|
935
|
+
y = new WeakMap(), U = new WeakMap(), T = new WeakMap(), S = new WeakMap(), D = new WeakMap(), M = new WeakMap(), F = new WeakMap(), P = new WeakMap(), z = new WeakMap();
|
|
936
|
+
var v, j, R, O, N, b, _, g, q, $;
|
|
937
|
+
class te {
|
|
842
938
|
constructor() {
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
939
|
+
h(this, v);
|
|
940
|
+
h(this, j, !1);
|
|
941
|
+
h(this, R, {});
|
|
942
|
+
h(this, O, 0);
|
|
943
|
+
h(this, N, 0);
|
|
944
|
+
h(this, b, 0);
|
|
945
|
+
h(this, _, 0);
|
|
946
|
+
h(this, g);
|
|
947
|
+
h(this, q);
|
|
948
|
+
h(this, $);
|
|
853
949
|
}
|
|
854
950
|
init(e, t = {}) {
|
|
855
|
-
m(this,
|
|
951
|
+
m(this, v, e), m(this, g, t.limit), m(this, q, t.update_move), m(this, $, t.update_up), m(this, R, {
|
|
856
952
|
mousedown: this.mousedown.bind(this),
|
|
857
953
|
mousemove: this.mousemove.bind(this),
|
|
858
954
|
mouseup: this.mouseup.bind(this)
|
|
@@ -863,13 +959,13 @@ class Nt {
|
|
|
863
959
|
}
|
|
864
960
|
bindOrUnbindEvent(e) {
|
|
865
961
|
const t = e === "bind" ? "addEventListener" : "removeEventListener";
|
|
866
|
-
if (!c(this,
|
|
867
|
-
c(this,
|
|
962
|
+
if (!c(this, v)) return console.error("No DOM");
|
|
963
|
+
c(this, v)[t]("mousedown", c(this, R).mousedown), document[t]("mousemove", c(this, R).mousemove), document[t]("mouseup", c(this, R).mouseup);
|
|
868
964
|
}
|
|
869
965
|
updateValue() {
|
|
870
966
|
const e = {
|
|
871
|
-
top: c(this,
|
|
872
|
-
left: c(this,
|
|
967
|
+
top: c(this, b),
|
|
968
|
+
left: c(this, _),
|
|
873
969
|
percentage: { top: 0, left: 0 }
|
|
874
970
|
};
|
|
875
971
|
if (c(this, g)) {
|
|
@@ -882,55 +978,44 @@ class Nt {
|
|
|
882
978
|
return e;
|
|
883
979
|
}
|
|
884
980
|
alterLocation() {
|
|
885
|
-
if (!c(this,
|
|
886
|
-
c(this, g) && (m(this,
|
|
981
|
+
if (!c(this, v)) return console.error("No DOM");
|
|
982
|
+
c(this, g) && (m(this, b, Math.min(c(this, b), c(this, g).max.top)), m(this, b, Math.max(c(this, b), c(this, g).min.top)), m(this, _, Math.min(c(this, _), c(this, g).max.left)), m(this, _, Math.max(c(this, _), c(this, g).min.left))), c(this, q) && c(this, q).call(this, this.updateValue()), c(this, v).style.setProperty("--top", c(this, b) + "px"), c(this, v).style.setProperty("--left", c(this, _) + "px");
|
|
887
983
|
}
|
|
888
984
|
mousedown(e) {
|
|
889
|
-
if (!c(this,
|
|
985
|
+
if (!c(this, v)) return console.error("No DOM");
|
|
890
986
|
document.body.classList.add("no-select"), m(this, j, !0);
|
|
891
|
-
const t = c(this,
|
|
892
|
-
m(this,
|
|
987
|
+
const t = c(this, v).getBoundingClientRect();
|
|
988
|
+
m(this, N, t.y), m(this, O, t.x);
|
|
893
989
|
const { pageX: o, pageY: r } = e;
|
|
894
|
-
m(this,
|
|
990
|
+
m(this, b, r - c(this, N)), m(this, _, o - c(this, O)), this.alterLocation();
|
|
895
991
|
}
|
|
896
992
|
mousemove(e) {
|
|
897
993
|
const { pageX: t, pageY: o } = e;
|
|
898
|
-
c(this, j) && (m(this,
|
|
994
|
+
c(this, j) && (m(this, b, o - c(this, N)), m(this, _, t - c(this, O)), this.alterLocation());
|
|
899
995
|
}
|
|
900
996
|
mouseup() {
|
|
901
|
-
c(this, j) && (m(this, j, !1), document.body.classList.remove("no-select"), c(this,
|
|
997
|
+
c(this, j) && (m(this, j, !1), document.body.classList.remove("no-select"), c(this, $) && c(this, $).call(this, this.updateValue()));
|
|
902
998
|
}
|
|
903
999
|
}
|
|
904
|
-
|
|
905
|
-
function
|
|
1000
|
+
v = new WeakMap(), j = new WeakMap(), R = new WeakMap(), O = new WeakMap(), N = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), q = new WeakMap(), $ = new WeakMap();
|
|
1001
|
+
function mt(n) {
|
|
906
1002
|
const e = n || document.documentElement;
|
|
907
|
-
|
|
908
|
-
if (n.requestFullscreen)
|
|
909
|
-
return n.requestFullscreen();
|
|
910
|
-
if (e.mozRequestFullScreen)
|
|
911
|
-
return e.mozRequestFullScreen();
|
|
912
|
-
if (e.webkitRequestFullscreen)
|
|
913
|
-
return e.webkitRequestFullscreen();
|
|
914
|
-
if (e.msRequestFullscreen)
|
|
915
|
-
return e.msRequestFullscreen();
|
|
916
|
-
} else return Promise.reject("No DOM");
|
|
917
|
-
return Promise.reject("No Fullscreen API");
|
|
1003
|
+
return e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen() : e.msRequestFullscreen ? e.msRequestFullscreen() : Promise.reject("No Fullscreen API");
|
|
918
1004
|
}
|
|
919
|
-
function
|
|
1005
|
+
function dt() {
|
|
920
1006
|
const n = document;
|
|
921
1007
|
return document.exitFullscreen ? document.exitFullscreen() : n.mozCancelFullScreen ? n.mozCancelFullScreen() : n.webkitExitFullscreen ? n.webkitExitFullscreen() : n.msExitFullscreen ? n.msExitFullscreen() : Promise.reject("No ExitFullscreen API");
|
|
922
1008
|
}
|
|
923
|
-
function
|
|
924
|
-
n = n || document.documentElement;
|
|
1009
|
+
function ft(n) {
|
|
925
1010
|
const e = document, t = document.fullscreenElement || e.webkitFullscreenElement || e.mozFullScreenElement || e.msFullscreenElement;
|
|
926
|
-
return n == t;
|
|
1011
|
+
return n ? n == t : document.documentElement == t || screen.width == window.innerWidth && screen.height == window.innerHeight;
|
|
927
1012
|
}
|
|
928
|
-
function
|
|
1013
|
+
function ee(n) {
|
|
929
1014
|
return function() {
|
|
930
|
-
|
|
1015
|
+
ft(n) ? dt() : mt(n);
|
|
931
1016
|
};
|
|
932
1017
|
}
|
|
933
|
-
function
|
|
1018
|
+
function ne(n, e) {
|
|
934
1019
|
if (typeof n == "number") return n;
|
|
935
1020
|
if (/px/.test(n)) return Number(n.replace(/px/, "")) || 0;
|
|
936
1021
|
const t = document.createElement("div");
|
|
@@ -938,7 +1023,7 @@ function $t(n, e) {
|
|
|
938
1023
|
const o = t.getBoundingClientRect().width;
|
|
939
1024
|
return e.removeChild(t), o;
|
|
940
1025
|
}
|
|
941
|
-
function
|
|
1026
|
+
function oe(n, e) {
|
|
942
1027
|
if (!n) return;
|
|
943
1028
|
let t, o;
|
|
944
1029
|
if (typeof e == "string") {
|
|
@@ -955,7 +1040,7 @@ function Yt(n, e) {
|
|
|
955
1040
|
const r = t / o;
|
|
956
1041
|
return r > n ? [n * o, o] : r < n ? [t, t / n] : [t, o];
|
|
957
1042
|
}
|
|
958
|
-
function
|
|
1043
|
+
function re(n, e = 5e3) {
|
|
959
1044
|
return new Promise((t, o) => {
|
|
960
1045
|
const r = new Image();
|
|
961
1046
|
r.src = n;
|
|
@@ -964,109 +1049,75 @@ function Bt(n, e = 5e3) {
|
|
|
964
1049
|
}, e);
|
|
965
1050
|
r.onload = () => {
|
|
966
1051
|
clearTimeout(i);
|
|
967
|
-
const s = r.naturalWidth, a = r.naturalHeight,
|
|
968
|
-
t([r,
|
|
1052
|
+
const s = r.naturalWidth, a = r.naturalHeight, u = s / a;
|
|
1053
|
+
t([r, u]);
|
|
969
1054
|
}, r.onerror = () => {
|
|
970
1055
|
clearTimeout(i), o(new Error("图片加载失败"));
|
|
971
1056
|
}, r.crossOrigin = "Anonymous";
|
|
972
1057
|
});
|
|
973
1058
|
}
|
|
974
|
-
function
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1059
|
+
function ie(n) {
|
|
1060
|
+
return new Promise((e, t) => {
|
|
1061
|
+
fetch(n).then((o) => e(o.text())).catch((o) => {
|
|
1062
|
+
console.error("Error fetching :", o), t(o);
|
|
1063
|
+
});
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
function ht(n, e) {
|
|
1067
|
+
return new Promise((t, o) => {
|
|
979
1068
|
try {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
1069
|
+
e = e || Z(n, "downloaded_file"), fetch(n).then((r) => (r.ok || o(`文件下载失败,状态码: ${r.status}`), r.blob())).then((r) => {
|
|
1070
|
+
const i = URL.createObjectURL(r), s = document.createElement("a");
|
|
1071
|
+
s.href = i, s.download = decodeURIComponent(e), document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(i), t(r);
|
|
1072
|
+
}).catch(o);
|
|
1073
|
+
} catch (r) {
|
|
1074
|
+
o(r);
|
|
983
1075
|
}
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
function se(n, e, t) {
|
|
1079
|
+
if (!t) {
|
|
1080
|
+
let i = e.replace(/^[^.]+./, "");
|
|
1081
|
+
i = i == e ? "text/plain" : "application/" + i, t = { type: i };
|
|
984
1082
|
}
|
|
985
|
-
|
|
1083
|
+
const o = new Blob(n, t), r = URL.createObjectURL(o);
|
|
1084
|
+
ht(r, e);
|
|
986
1085
|
}
|
|
987
|
-
const
|
|
988
|
-
function
|
|
989
|
-
const t = Math.max(Math.min(n, 180), -180), o = Math.max(Math.min(e,
|
|
1086
|
+
const pt = Math.PI / 2, W = Math.PI / 180, G = 6378137, gt = 85.05112878;
|
|
1087
|
+
function ce(n, e) {
|
|
1088
|
+
const t = Math.max(Math.min(n, 180), -180), o = Math.max(Math.min(e, gt), -85.05112878), r = t * W * G, i = o * W, s = Math.log(Math.tan(Math.PI / 4 + i / 2)) * G;
|
|
990
1089
|
return [r, s];
|
|
991
1090
|
}
|
|
992
|
-
function
|
|
993
|
-
const t = n /
|
|
1091
|
+
function ae(n, e) {
|
|
1092
|
+
const t = n / G / W, o = (2 * Math.atan(Math.exp(e / G)) - pt) / W;
|
|
994
1093
|
return [t, o];
|
|
995
1094
|
}
|
|
996
|
-
function
|
|
997
|
-
const [o, r] = n, [i, s] = e, [a,
|
|
998
|
-
if (
|
|
999
|
-
let d = ((o - i) * (a - i) + (r - s) * (
|
|
1095
|
+
function le(n, e, t) {
|
|
1096
|
+
const [o, r] = n, [i, s] = e, [a, u] = t, l = (a - i) ** 2 + (u - s) ** 2;
|
|
1097
|
+
if (l === 0) return Math.sqrt((o - i) ** 2 + (r - s) ** 2);
|
|
1098
|
+
let d = ((o - i) * (a - i) + (r - s) * (u - s)) / l;
|
|
1000
1099
|
return d = Math.max(0, Math.min(1, d)), Math.sqrt(
|
|
1001
|
-
(o - (i + d * (a - i))) ** 2 + (r - (s + d * (
|
|
1100
|
+
(o - (i + d * (a - i))) ** 2 + (r - (s + d * (u - s))) ** 2
|
|
1002
1101
|
);
|
|
1003
1102
|
}
|
|
1004
|
-
function
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
function Zt(n, e, t = 2) {
|
|
1011
|
-
return !Number.isFinite(n) || !Number.isFinite(e) || !Number.isFinite(t) ? (console.error("所有参数必须是有限的数字"), "") : e === 0 ? (console.error("分母不能为零"), "") : t < 0 ? (console.error("小数位数不能为负数"), "") : (n / e * 100).toFixed(t) + "%";
|
|
1012
|
-
}
|
|
1013
|
-
function Kt(n, e, t) {
|
|
1014
|
-
return Math.abs(n - e) <= t;
|
|
1015
|
-
}
|
|
1016
|
-
function Jt(n, e = 500) {
|
|
1017
|
-
let t, o = !0;
|
|
1018
|
-
function r(i) {
|
|
1019
|
-
if (!o) return;
|
|
1020
|
-
t || (t = i);
|
|
1021
|
-
let s = Math.min((i - t) / e, 1);
|
|
1022
|
-
n(s), i - t < e && requestAnimationFrame(r);
|
|
1023
|
-
}
|
|
1024
|
-
return requestAnimationFrame(r), () => o = !1;
|
|
1025
|
-
}
|
|
1026
|
-
function Qt(n) {
|
|
1027
|
-
const t = n.toString().split("."), o = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1028
|
-
return t.length > 1 ? o + "." + t[1] : o;
|
|
1029
|
-
}
|
|
1030
|
-
function te(n, e) {
|
|
1031
|
-
const t = {
|
|
1032
|
-
join: !0,
|
|
1033
|
-
suffix: "",
|
|
1034
|
-
decimalPlaces: 2
|
|
1035
|
-
}, { join: o, suffix: r, decimalPlaces: i } = {
|
|
1036
|
-
...t,
|
|
1037
|
-
...e || {}
|
|
1038
|
-
}, s = Number(n);
|
|
1039
|
-
if (isNaN(s)) return o ? `0${r}` : [0, r];
|
|
1040
|
-
const a = Math.abs(s), l = s >= 0, u = Math.max(0, Math.floor(Math.log10(a) / 4)), d = Math.pow(1e4, u), p = a / d, L = (l ? 1 : -1) * parseFloat(p.toFixed(Math.max(0, i)));
|
|
1041
|
-
return o ? `${L}${V[u]}${r}` : [L, V[u] + r];
|
|
1042
|
-
}
|
|
1043
|
-
function ee(n, e) {
|
|
1044
|
-
let t = !1;
|
|
1045
|
-
const { x: o, y: r } = n, i = e.length;
|
|
1046
|
-
for (let s = 0, a = i - 1; s < i; a = s++) {
|
|
1047
|
-
const l = e[s].x, u = e[s].y, d = e[a].x, p = e[a].y;
|
|
1048
|
-
u > r != p > r && o < (d - l) * (r - u) / (p - u) + l && (t = !t);
|
|
1049
|
-
}
|
|
1050
|
-
return t;
|
|
1051
|
-
}
|
|
1052
|
-
function ne(n) {
|
|
1053
|
-
const e = ["B", "KB", "MB", "GB", "TB", "PB"];
|
|
1054
|
-
let t = 0;
|
|
1055
|
-
for (; n > 1024; )
|
|
1056
|
-
n /= 1024, t++;
|
|
1057
|
-
return `${Math.round(n * 100) / 100} ${e[t]}`;
|
|
1103
|
+
function ue(n, e, t, o, r) {
|
|
1104
|
+
const i = n + t * Math.cos(o), s = e + t * Math.sin(o), a = n + t * Math.cos(r), u = e + t * Math.sin(r);
|
|
1105
|
+
return [
|
|
1106
|
+
[i, s],
|
|
1107
|
+
[a, u]
|
|
1108
|
+
];
|
|
1058
1109
|
}
|
|
1059
|
-
function
|
|
1110
|
+
function me(n, e, t, o) {
|
|
1060
1111
|
return Math.sqrt(Math.pow(t - n, 2) + Math.pow(o - e, 2));
|
|
1061
1112
|
}
|
|
1062
|
-
function
|
|
1113
|
+
function de(n, e, t, o) {
|
|
1063
1114
|
const r = (n + t) / 2, i = (e + o) / 2;
|
|
1064
1115
|
return { x: r, y: i };
|
|
1065
1116
|
}
|
|
1066
|
-
class
|
|
1117
|
+
class k {
|
|
1067
1118
|
constructor(e, t) {
|
|
1068
|
-
|
|
1069
|
-
|
|
1119
|
+
E(this, "resolve");
|
|
1120
|
+
E(this, "reject");
|
|
1070
1121
|
this.resolve = e, this.reject = t;
|
|
1071
1122
|
}
|
|
1072
1123
|
run(e) {
|
|
@@ -1080,140 +1131,142 @@ class _ {
|
|
|
1080
1131
|
}) : e ? (t = this.resolve) == null || t.call(this) : (o = this.reject) == null || o.call(this), e;
|
|
1081
1132
|
}
|
|
1082
1133
|
}
|
|
1083
|
-
class
|
|
1134
|
+
class xt extends k {
|
|
1084
1135
|
constructor(e) {
|
|
1085
1136
|
super(), this.resolve = e;
|
|
1086
1137
|
}
|
|
1087
1138
|
warning(...e) {
|
|
1088
1139
|
const t = () => {
|
|
1089
1140
|
var o, r;
|
|
1090
|
-
return (r = (o =
|
|
1141
|
+
return (r = (o = Y.tips).warning) == null ? void 0 : r.call(o, ...e);
|
|
1091
1142
|
};
|
|
1092
|
-
return new
|
|
1143
|
+
return new k(this.resolve, t);
|
|
1093
1144
|
}
|
|
1094
1145
|
error(...e) {
|
|
1095
1146
|
const t = () => {
|
|
1096
1147
|
var o, r;
|
|
1097
|
-
return (r = (o =
|
|
1148
|
+
return (r = (o = Y.tips).error) == null ? void 0 : r.call(o, ...e);
|
|
1098
1149
|
};
|
|
1099
|
-
return new
|
|
1150
|
+
return new k(this.resolve, t);
|
|
1100
1151
|
}
|
|
1101
1152
|
}
|
|
1102
|
-
class
|
|
1153
|
+
class wt extends k {
|
|
1103
1154
|
constructor(e) {
|
|
1104
1155
|
super(), this.reject = e;
|
|
1105
1156
|
}
|
|
1106
1157
|
info(...e) {
|
|
1107
1158
|
const t = () => {
|
|
1108
1159
|
var o, r;
|
|
1109
|
-
return (r = (o =
|
|
1160
|
+
return (r = (o = Y.tips).info) == null ? void 0 : r.call(o, ...e);
|
|
1110
1161
|
};
|
|
1111
|
-
return new
|
|
1162
|
+
return new k(t, this.reject);
|
|
1112
1163
|
}
|
|
1113
1164
|
success(...e) {
|
|
1114
1165
|
const t = () => {
|
|
1115
1166
|
var o, r;
|
|
1116
|
-
return (r = (o =
|
|
1167
|
+
return (r = (o = Y.tips).success) == null ? void 0 : r.call(o, ...e);
|
|
1117
1168
|
};
|
|
1118
|
-
return new
|
|
1169
|
+
return new k(t, this.reject);
|
|
1119
1170
|
}
|
|
1120
1171
|
}
|
|
1121
|
-
const
|
|
1172
|
+
const p = class p {
|
|
1122
1173
|
/**
|
|
1123
1174
|
* 构造函数
|
|
1124
1175
|
* @throws 如果尝试实例化该类,则抛出错误,因为应该使用静态方法
|
|
1125
1176
|
*/
|
|
1126
1177
|
constructor() {
|
|
1127
|
-
if (new.target ===
|
|
1178
|
+
if (new.target === p)
|
|
1128
1179
|
throw new Error("请直接使用静态方法,而不是实例化此类");
|
|
1129
1180
|
}
|
|
1130
1181
|
static register(e, t) {
|
|
1131
1182
|
if (typeof t != "function")
|
|
1132
1183
|
return console.error("TipHandler must be a function");
|
|
1133
|
-
|
|
1184
|
+
p.tips[e] = t;
|
|
1134
1185
|
}
|
|
1135
1186
|
static resolveTip(e) {
|
|
1136
1187
|
return function(...t) {
|
|
1137
1188
|
const o = () => {
|
|
1138
1189
|
var r, i;
|
|
1139
|
-
return (i = (r =
|
|
1190
|
+
return (i = (r = p.tips)[e]) == null ? void 0 : i.call(r, ...t);
|
|
1140
1191
|
};
|
|
1141
|
-
return new
|
|
1192
|
+
return new xt(o);
|
|
1142
1193
|
};
|
|
1143
1194
|
}
|
|
1144
1195
|
static rejectTip(e) {
|
|
1145
1196
|
return function(...t) {
|
|
1146
1197
|
const o = () => {
|
|
1147
1198
|
var r, i;
|
|
1148
|
-
return (i = (r =
|
|
1199
|
+
return (i = (r = p.tips)[e]) == null ? void 0 : i.call(r, ...t);
|
|
1149
1200
|
};
|
|
1150
|
-
return new
|
|
1201
|
+
return new wt(o);
|
|
1151
1202
|
};
|
|
1152
1203
|
}
|
|
1153
1204
|
};
|
|
1154
|
-
|
|
1205
|
+
E(p, "tips", {
|
|
1155
1206
|
info: void 0,
|
|
1156
1207
|
success: void 0,
|
|
1157
1208
|
warning: void 0,
|
|
1158
1209
|
error: void 0
|
|
1159
|
-
}),
|
|
1160
|
-
let
|
|
1210
|
+
}), E(p, "info", p.resolveTip("info")), E(p, "success", p.resolveTip("success")), E(p, "warning", p.rejectTip("warning")), E(p, "error", p.rejectTip("error"));
|
|
1211
|
+
let Y = p;
|
|
1161
1212
|
export {
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
Wt as
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1213
|
+
bt as _Animate_CreateOscillator,
|
|
1214
|
+
_t as _Animate_NumericTransition,
|
|
1215
|
+
vt as _Animate_Schedule,
|
|
1216
|
+
Et as _Blob_ConvertDataToImageUrl,
|
|
1217
|
+
Ft as _Browser_CopyToClipboard,
|
|
1218
|
+
Mt as _Browser_GetFrameRate,
|
|
1219
|
+
ct as _Browser_KeyedWindowManager,
|
|
1220
|
+
oe as _Element_CalculateCanvasSize,
|
|
1221
|
+
Jt as _Element_CloseOnOutsideClick,
|
|
1222
|
+
Qt as _Element_Drag,
|
|
1223
|
+
mt as _Element_EnterFullscreen,
|
|
1224
|
+
dt as _Element_ExitFullscreen,
|
|
1225
|
+
ee as _Element_Fullscreen,
|
|
1226
|
+
ne as _Element_GetOtherSizeInPixels,
|
|
1227
|
+
ft as _Element_IsFullscreen,
|
|
1228
|
+
re as _Element_LoadImage,
|
|
1229
|
+
te as _Element_LocalDrag,
|
|
1230
|
+
Kt as _Element_ScrollEndListener,
|
|
1231
|
+
se as _File_CreateAndDownload,
|
|
1232
|
+
ht as _File_Download,
|
|
1233
|
+
ie as _File_Read,
|
|
1234
|
+
Rt as _Format_CamelCase,
|
|
1235
|
+
Ct as _Format_CapitalizeFirstLetter,
|
|
1236
|
+
At as _Format_ExcludeSubstring,
|
|
1237
|
+
Tt as _Format_FileSize,
|
|
1238
|
+
Z as _Format_HrefName,
|
|
1239
|
+
Lt as _Format_NumberWithCommas,
|
|
1240
|
+
Ut as _Format_NumberWithUnit,
|
|
1241
|
+
Pt as _Format_Percentage,
|
|
1242
|
+
jt as _Format_Timestamp,
|
|
1243
|
+
me as _Math_CalculateDistance2D,
|
|
1244
|
+
ue as _Math_GetArcPoints,
|
|
1245
|
+
de as _Math_GetMidpoint,
|
|
1246
|
+
ce as _Math_LngLatToPlane,
|
|
1247
|
+
ae as _Math_PlaneToLngLat,
|
|
1248
|
+
le as _Math_PointToLineDistance,
|
|
1249
|
+
Y as _Tip,
|
|
1250
|
+
Gt as _Utility_Clone,
|
|
1251
|
+
ut as _Utility_Debounce,
|
|
1252
|
+
Nt as _Utility_ExecuteWhenIdle,
|
|
1253
|
+
$t as _Utility_GenerateUUID,
|
|
1254
|
+
Xt as _Utility_GetTargetByPath,
|
|
1255
|
+
Bt as _Utility_InitTargetByPath,
|
|
1256
|
+
K as _Utility_MergeObjects,
|
|
1257
|
+
Wt as _Utility_RotateList,
|
|
1258
|
+
Zt as _Utility_Sleep,
|
|
1259
|
+
Yt as _Utility_Throttle,
|
|
1260
|
+
Vt as _Utility_TimeConsumption,
|
|
1261
|
+
Ht as _Utility_UpdateTargetByPath,
|
|
1262
|
+
qt as _Utility_WaitForCondition,
|
|
1263
|
+
Ot as _Valid_CheckConnectionWithXHR,
|
|
1264
|
+
nt as _Valid_DataType,
|
|
1265
|
+
ot as _Valid_FileTypeChecker,
|
|
1266
|
+
kt as _Valid_Is2DNumberArray,
|
|
1267
|
+
St as _Valid_IsInMargin,
|
|
1268
|
+
lt as _Valid_IsNumberArray,
|
|
1269
|
+
It as _Valid_IsObject,
|
|
1270
|
+
Dt as _Valid_IsPointInPolygon,
|
|
1271
|
+
zt as _Valid_IsSecureContext
|
|
1219
1272
|
};
|