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