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.
@@ -1,97 +1,22 @@
1
- import { FileType, WindowTarget } from '../Constant';
2
- /**
3
- * 非null | undefined判断
4
- * @param value any
5
- * @returns boolean
6
- */
7
- export declare function _NotNull(value: any): boolean;
8
- /**
9
- * 是正常对象吗
10
- * @param {} value
11
- * @returns boolean
12
- */
13
- export declare function _IsObject(value: any): boolean;
14
1
  /**
15
2
  * 寻找空闲时机执行传入方法
16
3
  * @param callback 需执行的方法
17
4
  */
18
- export declare function _ExecuteWhenIdle(callback: Function): void;
5
+ export declare function _Utility_ExecuteWhenIdle(callback: Function): void;
19
6
  /**
20
7
  * 等待条件满足
21
8
  * @param conditionChecker 条件检查器
22
9
  * @param timeoutMillis 超时毫秒数
23
10
  * @returns Promise<unknown>
24
11
  */
25
- export declare function _WaitForCondition(conditionChecker: () => boolean, timeoutMillis: number): Promise<"完成" | "超时">;
26
- /**
27
- * 排除子串
28
- * @param inputString 需裁剪字符串
29
- * @param substringToDelete 被裁减字符串
30
- * @param delimiter 分隔符
31
- * @returns 裁减后的字符串
32
- */
33
- export declare function _ExcludeSubstring(inputString: string, substringToDelete: string, delimiter?: string): string;
34
- /**
35
- * 首字母大写
36
- * @param str
37
- * @returns string
38
- */
39
- export declare function _CapitalizeFirstLetter(string: string): string;
12
+ export declare function _Utility_WaitForCondition(conditionChecker: () => boolean, timeoutMillis: number): Promise<"完成" | "超时">;
40
13
  /**
41
14
  * 合并对象 注意: 本函数会直接操作 A
42
15
  * @param {Object | Array} A
43
16
  * @param {Object | Array} B
44
17
  * @returns (A & B) | A | B | undefined
45
18
  */
46
- export declare function _MergeObjects<T, T1>(A: T, B: T1, visitedObjects?: [any, any][], outTime?: number): (T & T1) | T | T1 | undefined;
47
- /**
48
- * 时间戳转换字符串
49
- * @param {Number | Date} time 时间戳或Date对象
50
- * @param {String} template 完整模板 --> YYYY MM DD hh mm ss ms
51
- * @param {Boolean} pad 补0
52
- */
53
- export declare function _TimeTransition(time: number | Date, template?: string, pad?: boolean): string;
54
- /**
55
- * 读取文件
56
- * @param src 文件地址
57
- * @returns 文件的字符串内容
58
- */
59
- export declare function _ReadFile(src: string): Promise<string>;
60
- /**
61
- * 从给定的href中提取名称部分
62
- * 该函数旨在处理URL字符串,并返回URL路径的最后一部分,去除查询参数
63
- *
64
- * @param {string} href - 待处理的URL字符串
65
- * @param {string} [defaultName="file"] - 默认的文件名,当无法提取时使用
66
- * @returns {string} URL路径的最后一部分,不包括查询参数
67
- */
68
- export declare function _GetHrefName(href: string, defaultName?: string): string;
69
- /**
70
- * 下载文件
71
- * @param {string} href - 文件路径
72
- * @param {string} [fileName] - 导出文件名
73
- */
74
- export declare function _DownloadFile(href: string, fileName?: string): Promise<unknown>;
75
- /**
76
- * 获取帧率
77
- * @param {(fps , frameTime)=>void} callback callback( 帧率 , 每帧时间 )
78
- * @param {Number} referenceNode 参考节点数量
79
- */
80
- export declare function _GetFrameRate(callback: (fps: number, frameTime: number) => void, referenceNode?: number): void;
81
- /**
82
- * 驼峰命名
83
- * @param {字符串} str
84
- * @param {是否删除分割字符} isRemoveDelimiter
85
- * @returns 'wq1wqw-qw2qw' -> 'wq1Wqw-Qw2Qw' / 'wqWqwQwQw'
86
- */
87
- export declare function _ConvertToCamelCase(str: string, isRemoveDelimiter?: boolean): string;
88
- /**
89
- * 创建文件并下载
90
- * @param {BlobPart[]} content 文件内容
91
- * @param {string} fileName 文件名称
92
- * @param {BlobPropertyBag} options Blob 配置
93
- */
94
- export declare function _CreateAndDownloadFile(content: BlobPart[], fileName: string, options?: BlobPropertyBag): void;
19
+ export declare function _Utility_MergeObjects<T, T1>(A: T, B: T1, visitedObjects?: [any, any][], outTime?: number): (T & T1) | T | T1 | undefined;
95
20
  /**
96
21
  * 生成一个UUID(通用唯一标识符)字符串
97
22
  * 可以选择性地在UUID前面添加前缀
@@ -99,32 +24,21 @@ export declare function _CreateAndDownloadFile(content: BlobPart[], fileName: st
99
24
  * @param {string} prefix - 可选参数,要添加到UUID前面的前缀
100
25
  * @returns {string} 一个带有可选前缀的UUID字符串
101
26
  */
102
- export declare function _GenerateUUID(prefix?: string): string;
27
+ export declare function _Utility_GenerateUUID(prefix?: string): string;
103
28
  /**
104
29
  * 防抖
105
30
  * @param {Function} fn
106
31
  * @param {number} delay
107
32
  * @returns {Function}
108
33
  */
109
- export declare function _Debounce<T extends (...args: any[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
34
+ export declare function _Utility_Debounce<T extends (...args: any[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
110
35
  /**
111
36
  * 节流
112
37
  * @param {Function} fn
113
38
  * @param {number} delay
114
39
  * @returns {Function}
115
40
  */
116
- export declare function _Throttle<T extends (...args: any[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
117
- /**
118
- * 数据类型
119
- * @param {any} value
120
- * @returns string
121
- */
122
- export declare function _DataType(value: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "array" | "null";
123
- /**
124
- * 复制到剪贴板
125
- * @param {string} text
126
- */
127
- export declare function _CopyToClipboard(text: string): Promise<void>;
41
+ export declare function _Utility_Throttle<T extends (...args: any[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
128
42
  /**
129
43
  * 根据路径初始化目标对象
130
44
  * 如果路径中某个属性不存在,则会创建该属性及其所有父属性
@@ -134,7 +48,7 @@ export declare function _CopyToClipboard(text: string): Promise<void>;
134
48
  * @param {string} path - 属性路径,使用英文句点分隔
135
49
  * @returns {any} 路径的最后一个属性对应的值或undefined
136
50
  */
137
- export declare function _InitTargetByPath(model: any, path: string): any;
51
+ export declare function _Utility_InitTargetByPath(model: any, path: string): any;
138
52
  /**
139
53
  * 根据路径获取目标对象
140
54
  * 该函数用于在给定的模型中,通过路径字符串来获取深层嵌套的目标对象如果路径中的某一部分不存在,则会创建一个新的对象(除非已经是路径的最后一部分)
@@ -143,7 +57,7 @@ export declare function _InitTargetByPath(model: any, path: string): any;
143
57
  * @param {string} path - 用点分隔的路径字符串,表示要访问的对象属性路径
144
58
  * @returns {Object|undefined} - 返回目标对象,如果路径不存在则返回undefined
145
59
  */
146
- export declare function _GetTargetByPath(model: any, path: string): any;
60
+ export declare function _Utility_GetTargetByPath(model: any, path: string): any;
147
61
  /**
148
62
  * 根据路径更新目标值
149
63
  *
@@ -155,85 +69,7 @@ export declare function _GetTargetByPath(model: any, path: string): any;
155
69
  * @param {*} value - 要设置的新值
156
70
  * @returns {*} - 返回更新后的模型对象中的值
157
71
  */
158
- export declare function _UpdateTargetByPath(model: any, path: string, value: any): any;
159
- /**
160
- * 使用 XMLHttpRequest 检查指定 URL 的连接状态
161
- *
162
- * 此函数通过发送一个 HEAD 请求来检查给定 URL 是否可访问 HEAD 请求仅请求文档头部信息,
163
- * 而不是整个页面,因此比 GET 或 POST 请求更快此方法常用于检查 URL 是否有效,以及服务器的响应时间等
164
- *
165
- * @param {string} url - 需要检查连接的 URL 地址
166
- * @returns {Promise} - 返回一个 Promise 对象,该对象在连接成功时解析,在连接失败时拒绝
167
- */
168
- export declare function _CheckConnectionWithXHR(url: string): Promise<unknown>;
169
- /**
170
- * 判断给定URL是否指向一个安全上下文
171
- *
172
- * 安全上下文是指通过一系列安全协议访问的资源,这些协议提供了数据的加密传输和身份验证
173
- * 本函数通过检查URL的协议前缀来判断是否属于安全上下文
174
- *
175
- * @param {string} url - 待检查的URL字符串
176
- * @returns {boolean} - 如果URL指向安全上下文,则返回true;否则返回false
177
- */
178
- export declare function _IsSecureContext(url: string): boolean;
179
- /**
180
- * 文件类型检查器类
181
- * 用于检查文件URL的类型
182
- */
183
- export declare class _FileTypeChecker {
184
- private static cachedEntries;
185
- constructor();
186
- /**
187
- * 检查给定URL的文件类型
188
- * @param {string} url - 文件的URL
189
- * @param {string} [type] - 可选参数,指定要检查的文件类型
190
- * @returns {string} - 如果URL与指定类型或任何已知类型匹配,则返回文件类型,否则返回"unknown"
191
- */
192
- static check(url: string): FileType | "unknown";
193
- static check(url: string, type: FileType): boolean;
194
- /**
195
- * 静态方法,用于解析地址信息
196
- * 该方法接受一个URL字符串,将其解析为一个包含地址详情的对象数组
197
- * 主要用于批量处理以逗号分隔的URL列表,为每个URL生成相应的名称和类型
198
- *
199
- * @param {string} url - 以逗号分隔的URL字符串,每个URL代表一个资源的位置
200
- * @returns {Array} - 包含每个URL及其相关信息(名称和类型)的对象数组
201
- */
202
- static parseAddresses(url: string): {
203
- url: string;
204
- name: string;
205
- type: "audio" | "code" | "script" | "video" | "image" | "ppt" | "word" | "excel" | "pdf" | "text" | "archive" | "font" | "database" | "markup" | "configuration" | "logs" | "unknown";
206
- }[];
207
- /**
208
- * 检查 MIME 类型是否与指定的模式匹配
209
- * @param {string} type - 要检查的 MIME 类型(如 "image/png")
210
- * @param {string} [accept] - 可接受的 MIME 类型模式(如 "image/*, text/plain")
211
- * @returns {boolean} - 如果类型匹配,则返回 true,否则返回 false
212
- */
213
- static matchesMimeType(type: string, accept?: string): boolean;
214
- /**
215
- * 类型标准化函数
216
- * 该函数旨在将文件类型或MIME类型字符串转换为标准格式
217
- * 主要处理三种情况:带扩展名的字符串、简写格式的类型以及已标准格式的类型
218
- *
219
- * @param {string} type - 文件类型或MIME类型字符串
220
- * @returns {string} 标准化的MIME类型字符串,如果无法识别则返回原始输入
221
- */
222
- static _normalizeType(type: string): string;
223
- /**
224
- * 检查URL是否具有任何指定的文件扩展名
225
- * @param {string} url - 文件的URL
226
- * @param {string[]} validExtensions - 有效文件扩展名的数组
227
- * @returns {boolean} - 如果URL具有任何指定的文件扩展名,则返回true,否则返回false
228
- */
229
- static _checkExtension(url: string, validExtensions: string[]): boolean;
230
- /**
231
- * 检测文件URL的类型
232
- * @param {string} url - 文件的URL
233
- * @returns {string} - 如果URL与任何已知类型匹配,则返回文件类型,否则返回"unknown"
234
- */
235
- static _detectFileType(url: string): "audio" | "code" | "script" | "video" | "image" | "ppt" | "word" | "excel" | "pdf" | "text" | "archive" | "font" | "database" | "markup" | "configuration" | "logs" | "unknown";
236
- }
72
+ export declare function _Utility_UpdateTargetByPath(model: any, path: string, value: any): any;
237
73
  /**
238
74
  * 旋转列表函数
239
75
  *
@@ -243,68 +79,27 @@ export declare class _FileTypeChecker {
243
79
  * @param list T[] - 需要旋转的列表,列表元素类型为泛型T
244
80
  * @returns T[][] - 返回一个二维数组,每个内部数组代表原列表的一种旋转形式
245
81
  */
246
- export declare function _RotateList<T>(list: T[]): T[][];
82
+ export declare function _Utility_RotateList<T>(list: T[]): T[][];
247
83
  /**
248
84
  * 克隆给定值的函数
249
85
  * 该函数尝试使用window.structuredClone方法进行深克隆,如果失败则使用自定义方法
250
86
  * @param {any} val - 需要克隆的值
251
87
  * @returns {any} - 克隆后的值
252
88
  */
253
- export declare function _Clone<T>(val: T): T | undefined;
254
- /**
255
- * 管理通过键值对打开的窗口
256
- */
257
- export declare class _KeyedWindowManager {
258
- private static keys;
259
- /** 请使用静态方法 */
260
- private constructor();
261
- /** 添加已有窗口 */
262
- static add(key: string, win: Window): void;
263
- /**
264
- * 根据键打开或聚焦窗口
265
- * @param key 窗口的唯一键
266
- * @param url 要打开的URL
267
- * @param target 窗口的目标
268
- * @param windowFeatures 新窗口的特性
269
- * @returns 返回已打开或新打开的窗口
270
- */
271
- static open(key: string, url?: string | URL, target?: WindowTarget, windowFeatures?: string): Window | undefined;
272
- /**
273
- * 检查指定键的窗口是否打开
274
- * @param key 窗口的唯一键
275
- * @returns 如果窗口打开则返回true,否则返回false
276
- */
277
- static isOpen(key: string): boolean;
278
- /**
279
- * 获取与指定键关联的窗口
280
- * @param key 窗口的唯一键
281
- * @returns 返回对应的窗口,如果窗口已关闭则返回undefined
282
- */
283
- static getWindow(key: string): Window | undefined;
284
- /**
285
- * 关闭与指定键关联的窗口
286
- * @param key 窗口的唯一键
287
- */
288
- static close(key: string): void;
289
- /**
290
- * 关闭所有打开的窗口并清空Map
291
- */
292
- static closeAll(): void;
293
- }
294
- /**
295
- * 将不同格式的数据转换为图像 URL
296
- * 此函数支持多种类型的数据输入,包括字符串(Base64/Data URL)、ArrayBuffer、Uint8Array和File,
297
- * 并尝试将这些数据转换为指定MIME类型的图像URL
298
- *
299
- * @param data - 输入数据,可以是字符串(Base64/Data URL)、ArrayBuffer、Uint8Array或File实例
300
- * @param mimeType - 期望的图像MIME类型,默认为'image/png'
301
- * @returns 成功时返回图像的URL,失败时返回null
302
- */
303
- export declare function _Danger_ConvertDataToImageUrl(data: string | ArrayBuffer | Uint8Array | File, mimeType?: string): string | null;
89
+ export declare function _Utility_Clone<T>(val: T): T | undefined;
304
90
  /**
305
91
  * 函数装饰器,用于测量并记录另一个函数的执行时间
306
92
  * @param func 要测量执行时间的函数
307
93
  * @param level 耗时与颜色对应的数组,用于在控制台中着色显示
308
94
  * @param maxHistory 保留的最大历史记录数,默认为30
309
95
  */
310
- export declare function _TimeConsumption(func: Function, level: [number, string][], maxHistory?: number): (...args: any[]) => any;
96
+ export declare function _Utility_TimeConsumption(func: Function, level: [number, string][], maxHistory?: number): void | ((...args: any[]) => any);
97
+ /**
98
+ * 暂停执行指定毫秒数的操作
99
+ * 此函数通过 busy-wait(忙等待)的方式实现,它会持续执行一些无用的操作以消耗时间
100
+ * 这种方法虽然简单,但会占用CPU资源,因此不推荐在实际应用中使用
101
+ *
102
+ * @param ms 暂停的毫秒数
103
+ * @returns 实际暂停的毫秒数
104
+ */
105
+ export declare function _Utility_Sleep(ms: number): number;
@@ -0,0 +1,122 @@
1
+ import { FileType } from '../Constant';
2
+ import { Point } from './type';
3
+ /**
4
+ * 是正常对象吗
5
+ * @param {} value
6
+ * @returns boolean
7
+ */
8
+ export declare function _Valid_IsObject(value: any): boolean;
9
+ /**
10
+ * 检查单个一维数组参数是否合法(元素为有限数字)
11
+ * @param arr - 待检查的数组
12
+ * @param minLength - 数组最小长度 (默认2)
13
+ * @returns 参数合法返回 true,否则返回 false
14
+ */
15
+ export declare function _Valid_IsNumberArray(arr: unknown, minLength?: number): boolean;
16
+ /**
17
+ * 检查二维数组结构是否合法(每个元素都是有效的一维数组)
18
+ * @param arr - 待检查的二维数组
19
+ * @param minLength - 外层数组最小长度 (默认1)
20
+ * @param innerMinLength - 内层数组最小长度 (默认2)
21
+ * @returns 所有元素都合法返回 true,否则返回 false
22
+ */
23
+ export declare function _Valid_Is2DNumberArray(arr: unknown, minLength?: number, innerMinLength?: number): boolean;
24
+ /**
25
+ * 误差范围
26
+ * @param value 需要判断的数字
27
+ * @param target 目标数字
28
+ * @param errorMargin 正负误差范围
29
+ * @returns 是否在误差内
30
+ */
31
+ export declare function _Valid_IsInMargin(value: number, target: number, errorMargin: number): boolean;
32
+ /**
33
+ * 判断点是否在多边形内
34
+ * @param point - 待检测的点,包含 x 和 y 坐标
35
+ * @param polygon - 多边形的点集,数组形式,每个点包含 x 和 y 坐标
36
+ * @returns boolean - 点是否在多边形内
37
+ */
38
+ export declare function _Valid_IsPointInPolygon(point: Point, polygon: Point[]): boolean;
39
+ /**
40
+ * 数据类型
41
+ * @param {any} value
42
+ * @returns string
43
+ */
44
+ export declare function _Valid_DataType(value: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "array" | "null";
45
+ /**
46
+ * 判断给定URL是否指向一个安全上下文
47
+ *
48
+ * 安全上下文是指通过一系列安全协议访问的资源,这些协议提供了数据的加密传输和身份验证
49
+ * 本函数通过检查URL的协议前缀来判断是否属于安全上下文
50
+ *
51
+ * @param {string} url - 待检查的URL字符串
52
+ * @returns {boolean} - 如果URL指向安全上下文,则返回true;否则返回false
53
+ */
54
+ export declare function _Valid_IsSecureContext(url: string): boolean;
55
+ /**
56
+ * 使用 XMLHttpRequest 检查指定 URL 的连接状态
57
+ *
58
+ * 此函数通过发送一个 HEAD 请求来检查给定 URL 是否可访问 HEAD 请求仅请求文档头部信息,
59
+ * 而不是整个页面,因此比 GET 或 POST 请求更快此方法常用于检查 URL 是否有效,以及服务器的响应时间等
60
+ *
61
+ * @param {string} url - 需要检查连接的 URL 地址
62
+ * @returns {Promise} - 返回一个 Promise 对象,该对象在连接成功时解析,在连接失败时拒绝
63
+ */
64
+ export declare function _Valid_CheckConnectionWithXHR(url: string): Promise<unknown>;
65
+ /**
66
+ * 文件类型检查器类
67
+ * 用于检查文件URL的类型
68
+ */
69
+ export declare class _Valid_FileTypeChecker {
70
+ private static cachedEntries;
71
+ constructor();
72
+ /**
73
+ * 检查给定URL的文件类型
74
+ * @param {string} url - 文件的URL
75
+ * @param {string} [type] - 可选参数,指定要检查的文件类型
76
+ * @returns {string} - 如果URL与指定类型或任何已知类型匹配,则返回文件类型,否则返回"unknown"
77
+ */
78
+ static check(url: string): FileType | "unknown";
79
+ static check(url: string, type: FileType): boolean;
80
+ /**
81
+ * 静态方法,用于解析地址信息
82
+ * 该方法接受一个URL字符串,将其解析为一个包含地址详情的对象数组
83
+ * 主要用于批量处理以逗号分隔的URL列表,为每个URL生成相应的名称和类型
84
+ *
85
+ * @param {string} url - 以逗号分隔的URL字符串,每个URL代表一个资源的位置
86
+ * @returns {Array} - 包含每个URL及其相关信息(名称和类型)的对象数组
87
+ */
88
+ static parseAddresses(url: string): {
89
+ url: string;
90
+ name: string;
91
+ type: "audio" | "code" | "script" | "video" | "image" | "ppt" | "word" | "excel" | "pdf" | "text" | "archive" | "font" | "database" | "markup" | "configuration" | "logs" | "unknown";
92
+ }[];
93
+ /**
94
+ * 检查 MIME 类型是否与指定的模式匹配
95
+ * @param {string} type - 要检查的 MIME 类型(如 "image/png")
96
+ * @param {string} [accept] - 可接受的 MIME 类型模式(如 "image/*, text/plain")
97
+ * @returns {boolean} - 如果类型匹配,则返回 true,否则返回 false
98
+ */
99
+ static matchesMimeType(type: string, accept?: string): boolean;
100
+ /**
101
+ * 类型标准化函数
102
+ * 该函数旨在将文件类型或MIME类型字符串转换为标准格式
103
+ * 主要处理三种情况:带扩展名的字符串、简写格式的类型以及已标准格式的类型
104
+ *
105
+ * @param {string} type - 文件类型或MIME类型字符串
106
+ * @returns {string} 标准化的MIME类型字符串,如果无法识别则返回原始输入
107
+ */
108
+ static _normalizeType(type: string): string;
109
+ /**
110
+ * 检查URL是否具有任何指定的文件扩展名
111
+ * @param {string} url - 文件的URL
112
+ * @param {string[]} validExtensions - 有效文件扩展名的数组
113
+ * @returns {boolean} - 如果URL具有任何指定的文件扩展名,则返回true,否则返回false
114
+ */
115
+ static _checkExtension(url: string, validExtensions: string[]): boolean;
116
+ /**
117
+ * 检测文件URL的类型
118
+ * @param {string} url - 文件的URL
119
+ * @returns {string} - 如果URL与任何已知类型匹配,则返回文件类型,否则返回"unknown"
120
+ */
121
+ static _detectFileType(url: string): "audio" | "code" | "script" | "video" | "image" | "ppt" | "word" | "excel" | "pdf" | "text" | "archive" | "font" | "database" | "markup" | "configuration" | "logs" | "unknown";
122
+ }
@@ -0,0 +1,4 @@
1
+ export interface Point {
2
+ x: number;
3
+ y: number;
4
+ }
package/dist/index.cjs.js CHANGED
@@ -1,3 +1,3 @@
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
- "use strict";var ie=Object.defineProperty;var V=n=>{throw TypeError(n)};var se=(n,t,e)=>t in n?ie(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var y=(n,t,e)=>se(n,typeof t!="symbol"?t+"":t,e),Z=(n,t,e)=>t.has(n)||V("Cannot "+e);var c=(n,t,e)=>(Z(n,t,"read from private field"),e?e.call(n):t.get(n)),f=(n,t,e)=>t.has(n)?V("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),m=(n,t,e,o)=>(Z(n,t,"write to private field"),o?o.call(n,e):t.set(n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ce={".mp3":"audio/mpeg",".mp4":"video/mp4",".m4a":"audio/mp4",".aac":"audio/aac",".ogg":"audio/ogg",".wav":"audio/wav",".flac":"audio/flac",".opus":"audio/opus",".webm":"video/webm",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".bmp":"image/bmp",".tiff":"image/tiff",".ico":"image/vnd.microsoft.icon",".svg":"image/svg+xml",".webp":"image/webp",".heif":"image/heif",".heic":"image/heic",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript",".ts":"application/typescript",".csv":"text/csv",".tsv":"text/tab-separated-values",".txt":"text/plain",".md":"text/markdown",".rtf":"application/rtf",".pdf":"application/pdf",".zip":"application/zip",".rar":"application/x-rar-compressed",".tar":"application/x-tar",".gz":"application/gzip",".7z":"application/x-7z-compressed",".exe":"application/x-msdownload",".apk":"application/vnd.android.package-archive",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".odt":"application/vnd.oasis.opendocument.text",".ods":"application/vnd.oasis.opendocument.spreadsheet",".odp":"application/vnd.oasis.opendocument.presentation",".jsonld":"application/ld+json",".yaml":"application/x-yaml",".yml":"application/x-yaml",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject",".map":"application/json"},H={image:[".jpg",".jpeg",".png",".gif",".bmp",".webp",".tiff",".svg",".heif",".heic",".ico",".raw",".jfif",".avif",".png8",".indd",".eps",".ai"],ppt:[".ppt",".pptx",".odp"],word:[".doc",".docx",".odt",".rtf"],excel:[".xls",".xlsx",".ods",".csv",".tsv"],pdf:[".pdf"],text:[".txt",".csv",".md",".json",".yaml",".yml",".log",".ini",".rtf"],audio:[".mp3",".wav",".ogg",".flac",".aac",".wma",".m4a",".alac",".ape",".opus",".amr",".ra",".mid",".midi",".aiff",".pcm",".au",".wavpack",".spx"],video:[".mp4",".avi",".mkv",".mov",".wmv",".flv",".webm",".mpg",".mpeg",".3gp",".vob",".ogv",".m4v",".ts",".rm",".rmvb",".m2ts",".divx",".xvid",".swf",".f4v"],archive:[".zip",".rar",".tar",".gz",".bz2",".xz",".7z",".tar.gz",".tar.bz2",".tar.xz",".tar.lz",".tar.lzma",".cab",".iso",".dmg",".tgz",".apk",".gz2",".tar.zst"],code:[".js",".ts",".py",".java",".cpp",".c",".html",".css",".scss",".less",".sass",".php",".rb",".go",".swift",".rs",".kt",".scala",".lua",".pl",".m",".h",".xml",".json",".yaml",".yml",".toml",".vue",".ejs",".handlebars",".jinja",".dart"],font:[".woff",".woff2",".ttf",".otf",".eot",".svg",".ttc",".fnt",".fon",".otc"],database:[".sql",".sqlite",".db",".mdb",".accdb",".jsonld",".xml",".csv"],markup:[".html",".htm",".xhtml",".xml",".json",".yaml",".yml"],configuration:[".ini",".conf",".cfg",".env",".properties",".json",".toml"],logs:[".log",".err",".trace",".out"],script:[".bash",".sh",".zsh",".bat",".ps1",".vbs",".cmd",".sed",".awk",".php"]},K=["","万","亿","兆","京","垓","秭","穰","沟","涧","正","载","极"];function ae(n){return n!=null}function le(n){return!(n===null||typeof n!="object"||Array.isArray(n))}function ue(n){if(typeof n!="function")return console.error("非函数:",n);const t=function(e){e.didTimeout||e.timeRemaining()<=0?requestIdleCallback(t):n()};requestIdleCallback(t)}function me(n,t){const e=+new Date;return new Promise((o,r)=>{const i=()=>{if(+new Date-e>=t)return r("超时");if(n())return o("完成");requestIdleCallback(i)};i()})}function de(n,t,e=","){const o=new RegExp(`(^|${e})${t}(${e}|$)`,"g");return n.replace(o,function(r,i,s){return i===s?e:""})}function fe(n){return n.charAt(0).toUpperCase()+n.slice(1)}function N(n,t,e=[],o=+new Date){if(o<+new Date-50){console.error("_MergeObjects 合并异常:疑似死循环");return}const r=X(n),i=X(t);if(r!=i)return t;if(r=="object"||r=="array"){if(e.some(([s,a])=>s==n&&a==t))return n;if(e.push([n,t]),r=="object"){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const a=t[s],l=n[s],u=N(l,a,e,o);n[s]=u}return n}else if(r=="array")return t.forEach((s,a)=>{const l=s,u=n[a],d=N(u,l,e,o);n[a]=d}),n}else return t}function he(n,t="YYYY-MM-DD hh:mm:ss",e=!0){const o=new Date(n);if(isNaN(o.getTime()))return console.error("Invalid date"),"";const r={YYYY:i=>i.getFullYear(),MM:i=>i.getMonth()+1,DD:i=>i.getDate(),hh:i=>i.getHours(),mm:i=>i.getMinutes(),ss:i=>i.getSeconds(),ms:i=>i.getMilliseconds()};return t.replace(/YYYY|MM|DD|hh|mm|ss|ms/g,i=>{const s=r[i](o);return e?String(s).padStart(2,"0"):String(s)})}function pe(n){return new Promise((t,e)=>{fetch(n).then(o=>t(o.text())).catch(o=>{console.error("Error fetching :",o),e(o)})})}function q(n,t="file"){if(!n||(n=String(n).trim(),n===""))return t;const e=n.split("/");return e[e.length-1].split("?")[0]}function ge(n,t){return new Promise((e,o)=>{try{t=t||q(n,"downloaded_file"),fetch(n).then(r=>(r.ok||o(`文件下载失败,状态码: ${r.status}`),r.blob())).then(r=>{const i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=decodeURIComponent(t),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i),e(r)}).catch(o)}catch(r){o(r)}})}function we(n,t=10){let e=0,o=t;function r(){if(o>0)o--,requestAnimationFrame(r);else{const s=(+new Date-e)/t,a=1e3/s;n(Number(a.toFixed(2)),Number(s.toFixed(2)))}}requestAnimationFrame(()=>{e=+new Date,r()})}function xe(n,t){return n=n.replace(/([^a-zA-Z][a-z])/g,e=>e.toUpperCase()),t?n.replace(/[^a-zA-Z]+/g,""):n}function ve(n,t,e){if(!e){let s=t.replace(/^[^.]+./,"");s=s==t?"text/plain":"application/"+s,e={type:s}}const o=new Blob(n,e),r=URL.createObjectURL(o),i=document.createElement("a");i.href=r,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}function be(n=""){return n+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function J(n,t){let e;return function(...o){clearTimeout(e),e=setTimeout(()=>{n(...o),e=void 0},t)}}function ye(n,t){let e=-1/0;return function(...o){const r=performance.now();if(r-e>t){e=r;try{n(...o)}catch(i){console.error("Throttled function execution failed:",i)}}}}function X(n){return Array.isArray(n)?"array":n===null?"null":typeof n}function _e(n){const t=()=>Promise.resolve(),e=a=>(console.error(a),Promise.reject(a));function o(){return navigator.clipboard.writeText(n).then(t).catch(e)}function r(){const a=document.createElement("div");a.innerText=n,document.body.appendChild(a);const l=document.createRange();l.selectNodeContents(a);const u=window.getSelection();let d=!1;return u&&(u.removeAllRanges(),u.addRange(l),d=document.execCommand("copy")),document.body.removeChild(a),d?Promise.resolve():Promise.reject()}function i(){const a=document.createElement("textarea");a.value=n,document.body.appendChild(a),a.select(),a.setSelectionRange(0,n.length);let l=!1;return document.activeElement===a&&(l=document.execCommand("Copy",!0)),document.body.removeChild(a),l?Promise.resolve():Promise.reject()}function s(){return r().then(t).catch(()=>{i().then(t).catch(()=>e("复制方式尽皆失效"))})}return navigator.clipboard?o().catch(s):s()}function Ce(n,t){const e=t.split(".");return e.reduce((o,r,i)=>(r in o||(i===e.length-1?o[r]=void 0:o[r]={}),o[r]),n)}function Ee(n,t){const e=t.split(".");return e.reduce((o,r,i)=>o.hasOwnProperty(r)?o[r]:o[r]=i==e.length-1?void 0:{},n)}function Me(n,t,e){const o=t.split(".");return o.reduce((r,i,s)=>(s===o.length-1&&(r[i]=e),r[i]),n)}function Fe(n){return new Promise((t,e)=>{if(typeof n!="string"||n.trim()===""||!n.includes("://")){e(new Error("Invalid URL: Must be a non-empty string"));return}try{new XMLHttpRequest().open("HEAD",n,!0)}catch(i){e(new Error(`Invalid URL format: ${i.message}`));return}const o=new XMLHttpRequest;o.open("HEAD",n,!0);const r=i=>{e(new Error(`Request failed: ${i.type}`))};o.onreadystatechange=function(){o.readyState===XMLHttpRequest.DONE&&(o.status===0?e(new Error("Network error or CORS blocked")):o.status>=200&&o.status<300?t(!0):e(new Error(`HTTP Error: ${o.status}`)))},o.onerror=r,o.onabort=r,o.ontimeout=r;try{o.send()}catch(i){e(new Error(`Request send failed: ${i.message}`))}})}function Te(n){return["https:","wss:","ftps:","sftp:","smpts:","smtp+tls:","imap+tls:","pop3+tls:","rdp:","vpn:"].some(e=>n.startsWith(e))}const E=class E{constructor(){if(new.target===E)throw new Error("请直接使用静态方法,而不是实例化此类")}static check(t,e){if(!t||typeof t!="string")return console.error("Invalid URL provided"),e?!1:"unknown";const o=q(t).toLowerCase();if(e){if(!H.hasOwnProperty(e))return console.error(`Unknown file type: ${e}`),"unknown";const r=H[e];return E._checkExtension(o,r)}return E._detectFileType(o)}static parseAddresses(t){return!t||typeof t!="string"?(console.error("Invalid URL provided"),[]):t.split(",").map(e=>{const o=q(e),r=this.check(e);return{url:e,name:o,type:r}})}static matchesMimeType(t,e){if(!e)return!0;if(typeof t!="string"||typeof e!="string")return!1;const o=E._normalizeType(t),r=e.split(",").map(a=>E._normalizeType(a.trim())),[i,s="*"]=o.split("/");return r.some(a=>{const[l,u="*"]=a.split("/");return(l==="*"||i==="*"||l===i)&&(u==="*"||s==="*"||u===s)})}static _normalizeType(t){return t.startsWith(".")&&!t.includes("/")?ce[t.toLowerCase()]||t:t.includes("/")?t:`${t}/*`}static _checkExtension(t,e){return e.some(o=>t.endsWith(o))}static _detectFileType(t){for(const[e,o]of E.cachedEntries)if(o.some(r=>t.endsWith(r)))return e;return"unknown"}};y(E,"cachedEntries",Object.entries(H));let G=E;function Le(n){return n.map((t,e)=>n.slice(e).concat(n.slice(0,e)))}function Pe(n){const t=window.structuredClone,e=o=>o===null||typeof o!="object"?o:N(Array.isArray(o)?[]:{},o);try{return t?t(n):e(n)}catch(o){return console.error("structuredClone error:",o),t&&e(n)}}class Q{constructor(){}static add(t,e){this.keys.set(t,e)}static open(t,e,o,r){const i=this.keys.get(t);if(i&&!i.closed)return i.focus(),i;{const s=window.open(e,o,r);if(s)return this.keys.set(t,s),s;console.error("window.open failed: 可能是浏览器阻止了弹出窗口"),this.keys.delete(t)}}static isOpen(t){const e=this.keys.get(t);return e!=null&&e.closed&&this.keys.delete(t),this.keys.has(t)}static getWindow(t){if(this.isOpen(t))return this.keys.get(t)}static close(t){const e=this.keys.get(t);e&&(e.close(),this.keys.delete(t))}static closeAll(){this.keys.forEach((t,e)=>t.close()),this.keys.clear()}}y(Q,"keys",new Map);function Re(n,t="image/png"){try{let e,o=t;if(n instanceof File)return URL.createObjectURL(n);if(typeof n=="string"){let i=n;const s=i.match(/^data:([^;]*)(;base64)?,(.*)$/i);if(s){if(!s[2])throw new Error("无效的数据 URL:缺少 base64 编码声明");if(o=s[1]||o,i=s[3],!i)throw new Error("数据 URL 包含空有效负载")}i=i.replace(/[^A-Za-z0-9+/=]/g,"");const a=atob(i);e=new Uint8Array(a.length);for(let l=0;l<a.length;l++)e[l]=a.charCodeAt(l)}else if(n instanceof ArrayBuffer)e=new Uint8Array(n);else if(n instanceof Uint8Array)e=n;else throw new Error("不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array");const r=new Blob([e],{type:o});return URL.createObjectURL(r)}catch(e){return console.error("数据到 ImageURL 的转换失败:",e.message,e.stack||"没有可用的堆栈跟踪"),null}}function Ie(n,t,e=30){if(typeof n!="function")throw new Error("The first argument must be a function.");if(!Array.isArray(t))throw new Error("The second argument must be an array.");let o=[],r=0;const i=(s,a)=>{for(const[l,u]of a)if(s>=l)return u;return"black"};return function(...s){const a=performance.now(),l=n(...s),u=performance.now()-a;o.push(u),o.length>e&&o.shift(),r=o.reduce((F,W)=>F+W,0)/o.length||0;const d=i(u,t),p=i(r,t);return console.log(`%c单次耗时:${u.toFixed(2)}ms
3
- %c平均耗时(${o.length}次):${r.toFixed(2)}ms`,`color: ${d}; padding: 2px 0;`,`color: ${p}; padding: 2px 0;`),l}}function je(n){const t=J(n,100);let e=0,o=0;return function(r){const i=r.target;if(!i||!(i instanceof Element))return;const{scrollTop:s,scrollHeight:a,clientHeight:l,scrollLeft:u,scrollWidth:d,clientWidth:p}=i;function F(){if(e==s)return;const Y=e>s;if(e=s,Y)return;a-s-l<=1&&t("vertical")}function W(){if(o==u)return;const Y=o>u;if(o=u,Y)return;d-u-p<=1&&t("horizontal")}F(),W()}}function De(n,t,e){const{isClickAllowed:o,uiLibrary:r=["naiveUI","ElementPlus","Element"]}=e||{},i=function(l){const u=[];for(const d in l)Object.hasOwnProperty.call(l,d)&&r.includes(d)&&u.push(...l[d]);return u}({naiveUI:[".v-binder-follower-container",".n-image-preview-container",".n-modal-container"],ElementPlus:[".el-popper"],Element:[".el-popper"]});function s(){t(),document.removeEventListener("mousedown",a)}function a(l){if(o){const p=o(l);if(p)return;if(p===!1)return s()}const u=l.target;if(!(u instanceof Element)||!u.isConnected)return;n.concat(i).some(p=>!!(u!=null&&u.closest(p)))||s()}requestAnimationFrame(()=>document.addEventListener("mousedown",a))}var w,T,L,D,k,_,C,M,A;class ke{constructor(){f(this,w);f(this,T,!1);f(this,L,{});f(this,D,0);f(this,k,0);f(this,_,0);f(this,C,0);f(this,M);f(this,A)}init(t,e){m(this,w,t),m(this,M,e==null?void 0:e.limit),m(this,A,e==null?void 0:e.dragDom),m(this,L,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(t){const e=t==="bind"?"addEventListener":"removeEventListener";if(!c(this,w))return console.error("No DOM");c(this,w)[e]("mousedown",c(this,L).mousedown),document[e]("mousemove",c(this,L).mousemove),document[e]("mouseup",c(this,L).mouseup)}alterLocation(){if(!c(this,w))return console.error("No DOM");c(this,M)&&(m(this,_,Math.min(c(this,_),c(this,M).max.top)),m(this,_,Math.max(c(this,_),c(this,M).min.top)),m(this,C,Math.min(c(this,C),c(this,M).max.left)),m(this,C,Math.max(c(this,C),c(this,M).min.left))),c(this,w).style.setProperty("--top",c(this,_)+"px"),c(this,w).style.setProperty("--left",c(this,C)+"px")}mousedown(t){if(!c(this,w))return console.error("No DOM");if(c(this,A)&&t.target!=c(this,A))return;document.body.classList.add("no-select"),m(this,T,!0);const e=c(this,w).getBoundingClientRect(),{pageX:o,pageY:r}=t;m(this,D,o),m(this,k,r),m(this,_,e.y),m(this,C,e.x)}mousemove(t){const{pageX:e,pageY:o}=t;c(this,T)&&(m(this,_,c(this,_)+(o-c(this,k))),m(this,C,c(this,C)+(e-c(this,D))),m(this,D,e),m(this,k,o),this.alterLocation())}mouseup(){c(this,T)&&(m(this,T,!1),document.body.classList.remove("no-select"))}}w=new WeakMap,T=new WeakMap,L=new WeakMap,D=new WeakMap,k=new WeakMap,_=new WeakMap,C=new WeakMap,M=new WeakMap,A=new WeakMap;var x,P,R,S,U,v,b,g,O,z;class Ae{constructor(){f(this,x);f(this,P,!1);f(this,R,{});f(this,S,0);f(this,U,0);f(this,v,0);f(this,b,0);f(this,g);f(this,O);f(this,z)}init(t,e={}){m(this,x,t),m(this,g,e.limit),m(this,O,e.update_move),m(this,z,e.update_up),m(this,R,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(t){const e=t==="bind"?"addEventListener":"removeEventListener";if(!c(this,x))return console.error("No DOM");c(this,x)[e]("mousedown",c(this,R).mousedown),document[e]("mousemove",c(this,R).mousemove),document[e]("mouseup",c(this,R).mouseup)}updateValue(){const t={top:c(this,v),left:c(this,b),percentage:{top:0,left:0}};if(c(this,g)){const e=o=>c(this,g)?(t[o]-c(this,g).min[o])/(c(this,g).max[o]-c(this,g).min[o]):0;t.percentage={top:e("top")||0,left:e("left")||0}}return t}alterLocation(){if(!c(this,x))return console.error("No DOM");c(this,g)&&(m(this,v,Math.min(c(this,v),c(this,g).max.top)),m(this,v,Math.max(c(this,v),c(this,g).min.top)),m(this,b,Math.min(c(this,b),c(this,g).max.left)),m(this,b,Math.max(c(this,b),c(this,g).min.left))),c(this,O)&&c(this,O).call(this,this.updateValue()),c(this,x).style.setProperty("--top",c(this,v)+"px"),c(this,x).style.setProperty("--left",c(this,b)+"px")}mousedown(t){if(!c(this,x))return console.error("No DOM");document.body.classList.add("no-select"),m(this,P,!0);const e=c(this,x).getBoundingClientRect();m(this,U,e.y),m(this,S,e.x);const{pageX:o,pageY:r}=t;m(this,v,r-c(this,U)),m(this,b,o-c(this,S)),this.alterLocation()}mousemove(t){const{pageX:e,pageY:o}=t;c(this,P)&&(m(this,v,o-c(this,U)),m(this,b,e-c(this,S)),this.alterLocation())}mouseup(){c(this,P)&&(m(this,P,!1),document.body.classList.remove("no-select"),c(this,z)&&c(this,z).call(this,this.updateValue()))}}x=new WeakMap,P=new WeakMap,R=new WeakMap,S=new WeakMap,U=new WeakMap,v=new WeakMap,b=new WeakMap,g=new WeakMap,O=new WeakMap,z=new WeakMap;function ee(n){const t=n||document.documentElement;if(n){if(n.requestFullscreen)return n.requestFullscreen();if(t.mozRequestFullScreen)return t.mozRequestFullScreen();if(t.webkitRequestFullscreen)return t.webkitRequestFullscreen();if(t.msRequestFullscreen)return t.msRequestFullscreen()}else return Promise.reject("No DOM");return Promise.reject("No Fullscreen API")}function te(){const n=document;return document.exitFullscreen?document.exitFullscreen():n.mozCancelFullScreen?n.mozCancelFullScreen():n.webkitExitFullscreen?n.webkitExitFullscreen():n.msExitFullscreen?n.msExitFullscreen():Promise.reject("No ExitFullscreen API")}function ne(n){n=n||document.documentElement;const t=document,e=document.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement;return n==e}function Se(n){return function(){ne(n)?te():ee(n)}}function Ue(n,t){if(typeof n=="number")return n;if(/px/.test(n))return Number(n.replace(/px/,""))||0;const e=document.createElement("div");e.style.width=n,t=t||document.body,t.appendChild(e);const o=e.getBoundingClientRect().width;return t.removeChild(e),o}function Oe(n,t){if(!n)return;let e,o;if(typeof t=="string"){const i=document.querySelector(t);if(!i)return;const s=i.getBoundingClientRect();e=s.width,o=s.height}else if(Array.isArray(t))e=t[0],o=t[1];else{const i=t.getBoundingClientRect();e=i.width,o=i.height}const r=e/o;return r>n?[n*o,o]:r<n?[e,e/n]:[e,o]}function ze(n,t=5e3){return new Promise((e,o)=>{const r=new Image;r.src=n;const i=setTimeout(()=>{o(new Error("图片加载超时")),r.onload=null,r.onerror=null},t);r.onload=()=>{clearTimeout(i);const s=r.naturalWidth,a=r.naturalHeight,l=s/a;e([r,l])},r.onerror=()=>{clearTimeout(i),o(new Error("图片加载失败"))},r.crossOrigin="Anonymous"})}function Ne(n){const t=Date.now();let e=performance.now();for(;Date.now()-t<n;){e=Math.sin(e)*1e6,(e>1e6||e<-1e6)&&(e=0);try{const o=e.toString().substring(0,8);history.replaceState(null,"",`#${o}`)}catch{}}return Date.now()-t}const qe=Math.PI/2,$=Math.PI/180,B=6378137,$e=85.05112878;function Be(n,t){const e=Math.max(Math.min(n,180),-180),o=Math.max(Math.min(t,$e),-85.05112878),r=e*$*B,i=o*$,s=Math.log(Math.tan(Math.PI/4+i/2))*B;return[r,s]}function We(n,t){const e=n/B/$,o=(2*Math.atan(Math.exp(t/B))-qe)/$;return[e,o]}function Ye(n,t,e){const[o,r]=n,[i,s]=t,[a,l]=e,u=(a-i)**2+(l-s)**2;if(u===0)return Math.sqrt((o-i)**2+(r-s)**2);let d=((o-i)*(a-i)+(r-s)*(l-s))/u;return d=Math.max(0,Math.min(1,d)),Math.sqrt((o-(i+d*(a-i)))**2+(r-(s+d*(l-s)))**2)}function oe(n){return Array.isArray(n)&&typeof n[0]=="number"&&typeof n[1]=="number"&&isFinite(n[0])&&isFinite(n[1])}function He(n){return Array.isArray(n)&&n.every(t=>oe(t))}function Xe(n,t,e=2){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)+"%"}function Ge(n,t,e){return Math.abs(n-t)<=e}function Ve(n,t=500){let e,o=!0;function r(i){if(!o)return;e||(e=i);let s=Math.min((i-e)/t,1);n(s),i-e<t&&requestAnimationFrame(r)}return requestAnimationFrame(r),()=>o=!1}function Ze(n){const e=n.toString().split("."),o=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");return e.length>1?o+"."+e[1]:o}function Ke(n,t){const e={join:!0,suffix:"",decimalPlaces:2},{join:o,suffix:r,decimalPlaces:i}={...e,...t||{}},s=Number(n);if(isNaN(s))return o?`0${r}`:[0,r];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,F=(l?1:-1)*parseFloat(p.toFixed(Math.max(0,i)));return o?`${F}${K[u]}${r}`:[F,K[u]+r]}function Je(n,t){let e=!1;const{x:o,y:r}=n,i=t.length;for(let s=0,a=i-1;s<i;a=s++){const l=t[s].x,u=t[s].y,d=t[a].x,p=t[a].y;u>r!=p>r&&o<(d-l)*(r-u)/(p-u)+l&&(e=!e)}return e}function Qe(n){const t=["B","KB","MB","GB","TB","PB"];let e=0;for(;n>1024;)n/=1024,e++;return`${Math.round(n*100)/100} ${t[e]}`}function et(n,t,e,o){return Math.sqrt(Math.pow(e-n,2)+Math.pow(o-t,2))}function tt(n,t,e,o){const r=(n+e)/2,i=(t+o)/2;return{x:r,y:i}}class j{constructor(t,e){y(this,"resolve");y(this,"reject");this.resolve=t,this.reject=e}run(t){var e,o;return t instanceof Promise?t.then(r=>{var i;return(i=this.resolve)==null||i.call(this),r}).catch(r=>{var i;return(i=this.reject)==null||i.call(this),Promise.reject(r)}):t?(e=this.resolve)==null||e.call(this):(o=this.reject)==null||o.call(this),t}}class nt extends j{constructor(t){super(),this.resolve=t}warning(...t){const e=()=>{var o,r;return(r=(o=I.tips).warning)==null?void 0:r.call(o,...t)};return new j(this.resolve,e)}error(...t){const e=()=>{var o,r;return(r=(o=I.tips).error)==null?void 0:r.call(o,...t)};return new j(this.resolve,e)}}class ot extends j{constructor(t){super(),this.reject=t}info(...t){const e=()=>{var o,r;return(r=(o=I.tips).info)==null?void 0:r.call(o,...t)};return new j(e,this.reject)}success(...t){const e=()=>{var o,r;return(r=(o=I.tips).success)==null?void 0:r.call(o,...t)};return new j(e,this.reject)}}const h=class h{constructor(){if(new.target===h)throw new Error("请直接使用静态方法,而不是实例化此类")}static register(t,e){if(typeof e!="function")return console.error("TipHandler must be a function");h.tips[t]=e}static resolveTip(t){return function(...e){const o=()=>{var r,i;return(i=(r=h.tips)[t])==null?void 0:i.call(r,...e)};return new nt(o)}}static rejectTip(t){return function(...e){const o=()=>{var r,i;return(i=(r=h.tips)[t])==null?void 0:i.call(r,...e)};return new ot(o)}}};y(h,"tips",{info:void 0,success:void 0,warning:void 0,error:void 0}),y(h,"info",h.resolveTip("info")),y(h,"success",h.resolveTip("success")),y(h,"warning",h.rejectTip("warning")),y(h,"error",h.rejectTip("error"));let I=h;exports._AreAllArraysValid=He;exports._CalculateCanvasSize=Oe;exports._CalculateDistance2D=et;exports._CapitalizeFirstLetter=fe;exports._CheckConnectionWithXHR=Fe;exports._Clone=Pe;exports._CloseOnOutsideClick=De;exports._ConvertToCamelCase=xe;exports._ConvertToPercentage=Xe;exports._CopyToClipboard=_e;exports._CreateAndDownloadFile=ve;exports._Danger_ConvertDataToImageUrl=Re;exports._DataType=X;exports._Debounce=J;exports._DownloadFile=ge;exports._Drag=ke;exports._EnterFullscreen=ee;exports._ExcludeSubstring=de;exports._ExecuteWhenIdle=ue;exports._ExitFullscreen=te;exports._FileTypeChecker=G;exports._FormatFileSize=Qe;exports._FormatNumber=Ze;exports._FormatNumberWithUnit=Ke;exports._Fullscreen=Se;exports._GenerateUUID=be;exports._GetFrameRate=we;exports._GetHrefName=q;exports._GetMidpoint=tt;exports._GetOtherSizeInPixels=Ue;exports._GetTargetByPath=Ee;exports._InitTargetByPath=Ce;exports._IsFullscreen=ne;exports._IsObject=le;exports._IsPointInPolygon=Je;exports._IsSecureContext=Te;exports._IsSingleArrayValid=oe;exports._IsWithinErrorMargin=Ge;exports._KeyedWindowManager=Q;exports._LngLatToPlane=Be;exports._LoadImage=ze;exports._LocalDrag=Ae;exports._MergeObjects=N;exports._NotNull=ae;exports._PlaneToLngLat=We;exports._PointToLineDistance=Ye;exports._ReadFile=pe;exports._RotateList=Le;exports._Schedule=Ve;exports._ScrollEndListener=je;exports._Sleep=Ne;exports._Throttle=ye;exports._TimeConsumption=Ie;exports._TimeTransition=he;exports._Tip=I;exports._UpdateTargetByPath=Me;exports._WaitForCondition=me;
2
+ "use strict";var dt=Object.defineProperty;var et=n=>{throw TypeError(n)};var ht=(n,e,t)=>e in n?dt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var E=(n,e,t)=>ht(n,typeof e!="symbol"?e+"":e,t),nt=(n,e,t)=>e.has(n)||et("Cannot "+t);var c=(n,e,t)=>(nt(n,e,"read from private field"),t?t.call(n):e.get(n)),f=(n,e,t)=>e.has(n)?et("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),m=(n,e,t,i)=>(nt(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ft(n,e=500){let t,i=!0;function o(r){if(!i)return;t||(t=r);let s=Math.min((r-t)/e,1);n(s),r-t<e&&requestAnimationFrame(o)}return requestAnimationFrame(o),()=>i=!1}function pt(n,e,t,i,o=2){let r=n,s=!1,a=1,u=n,l=e,d=t;const h=()=>{const g=(l-u)/d;return Number(g.toFixed(o))};let y=h();const P=g=>Math.min(Math.max(g,u),l),j=g=>Number(g.toFixed(o)),Y=(g,W,H)=>{const D=[];return g>=W&&D.push("最小值必须小于最大值"),H<=0&&D.push("分段数必须为正数"),D},mt=(g,W,H)=>{const D=Y(g,W,H);return D.length>0?(console.error(`参数更新失败: ${D.join("; ")}`),!1):(u=g,l=W,d=H,y=h(),r=P(r),!0)},tt=()=>{s&&(a=r>=l?-1:r<=u?1:a,r=P(r+y*a),i(j(r)),requestAnimationFrame(tt))};return{play(g=r){if(r=P(g),Y(u,l,d).length)return console.warn("配置参数错误",this.getParams());s||(s=!0,tt())},pause(){s=!1},getCurrent:()=>j(r),isPlaying:()=>s,updateParams:mt,getParams:()=>({min:u,max:l,steps:d,precision:o,stepSize:y})}}function _t(n,e,t,i,o=2){if(t<=0)return;const r=h=>Number(h.toFixed(o)),s=e-n,a=r(Math.abs(s)/t);if(a===0)return;const u=Math.sign(s);let l=n;const d=()=>{l=r(l+a*u),(u>0?l<e:l>e)?(i(l),requestAnimationFrame(d)):i(e)};d()}function gt(n,e="image/png"){try{let t,i=e;if(n instanceof File)return URL.createObjectURL(n);if(typeof n=="string"){let r=n;const s=r.match(/^data:([^;]*)(;base64)?,(.*)$/i);if(s){if(!s[2])return console.error("无效的数据 URL:缺少 base64 编码声明");if(i=s[1]||i,r=s[3],!r)return console.error("数据 URL 包含空有效负载")}r=r.replace(/[^A-Za-z0-9+/=]/g,"");const a=atob(r);t=new Uint8Array(a.length);for(let u=0;u<a.length;u++)t[u]=a.charCodeAt(u)}else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof Uint8Array)t=n;else return console.error("不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array");const o=new Blob([t],{type:i});return URL.createObjectURL(o)}catch(t){return console.error("数据到 ImageURL 的转换失败:",t.message,t.stack||"没有可用的堆栈跟踪"),null}}function yt(n,e=10){let t=0,i=e;function o(){if(i>0)i--,requestAnimationFrame(o);else{const s=(+new Date-t)/e,a=1e3/s;n(Number(a.toFixed(2)),Number(s.toFixed(2)))}}requestAnimationFrame(()=>{t=+new Date,o()})}function xt(n){const e=()=>Promise.resolve(),t=a=>(console.error(a),Promise.reject(a));function i(){return navigator.clipboard.writeText(n).then(e).catch(t)}function o(){const a=document.createElement("div");a.innerText=n,document.body.appendChild(a);const u=document.createRange();u.selectNodeContents(a);const l=window.getSelection();let d=!1;return l&&(l.removeAllRanges(),l.addRange(u),d=document.execCommand("copy")),document.body.removeChild(a),d?Promise.resolve():Promise.reject()}function r(){const a=document.createElement("textarea");a.value=n,document.body.appendChild(a),a.select(),a.setSelectionRange(0,n.length);let u=!1;return document.activeElement===a&&(u=document.execCommand("Copy",!0)),document.body.removeChild(a),u?Promise.resolve():Promise.reject()}function s(){return o().then(e).catch(()=>{r().then(e).catch(()=>t("复制方式尽皆失效"))})}return navigator.clipboard?i().catch(s):s()}class ot{constructor(){}static add(e,t){this.keys.set(e,t)}static open(e,t,i,o){const r=this.keys.get(e);if(r&&!r.closed)return r.focus(),r;{const s=window.open(t,i,o);if(s)return this.keys.set(e,s),s;console.error("window.open failed: 可能是浏览器阻止了弹出窗口"),this.keys.delete(e)}}static isOpen(e){const t=this.keys.get(e);return t!=null&&t.closed&&this.keys.delete(e),this.keys.has(e)}static getWindow(e){if(this.isOpen(e))return this.keys.get(e)}static close(e){const t=this.keys.get(e);t&&(t.close(),this.keys.delete(e))}static closeAll(){this.keys.forEach((e,t)=>e.close()),this.keys.clear()}}E(ot,"keys",new Map);const wt={".mp3":"audio/mpeg",".mp4":"video/mp4",".m4a":"audio/mp4",".aac":"audio/aac",".ogg":"audio/ogg",".wav":"audio/wav",".flac":"audio/flac",".opus":"audio/opus",".webm":"video/webm",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".bmp":"image/bmp",".tiff":"image/tiff",".ico":"image/vnd.microsoft.icon",".svg":"image/svg+xml",".webp":"image/webp",".heif":"image/heif",".heic":"image/heic",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript",".ts":"application/typescript",".csv":"text/csv",".tsv":"text/tab-separated-values",".txt":"text/plain",".md":"text/markdown",".rtf":"application/rtf",".pdf":"application/pdf",".zip":"application/zip",".rar":"application/x-rar-compressed",".tar":"application/x-tar",".gz":"application/gzip",".7z":"application/x-7z-compressed",".exe":"application/x-msdownload",".apk":"application/vnd.android.package-archive",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".odt":"application/vnd.oasis.opendocument.text",".ods":"application/vnd.oasis.opendocument.spreadsheet",".odp":"application/vnd.oasis.opendocument.presentation",".jsonld":"application/ld+json",".yaml":"application/x-yaml",".yml":"application/x-yaml",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject",".map":"application/json"},K={image:[".jpg",".jpeg",".png",".gif",".bmp",".webp",".tiff",".svg",".heif",".heic",".ico",".raw",".jfif",".avif",".png8",".indd",".eps",".ai"],ppt:[".ppt",".pptx",".odp"],word:[".doc",".docx",".odt",".rtf"],excel:[".xls",".xlsx",".ods",".csv",".tsv"],pdf:[".pdf"],text:[".txt",".csv",".md",".json",".yaml",".yml",".log",".ini",".rtf"],audio:[".mp3",".wav",".ogg",".flac",".aac",".wma",".m4a",".alac",".ape",".opus",".amr",".ra",".mid",".midi",".aiff",".pcm",".au",".wavpack",".spx"],video:[".mp4",".avi",".mkv",".mov",".wmv",".flv",".webm",".mpg",".mpeg",".3gp",".vob",".ogv",".m4v",".ts",".rm",".rmvb",".m2ts",".divx",".xvid",".swf",".f4v"],archive:[".zip",".rar",".tar",".gz",".bz2",".xz",".7z",".tar.gz",".tar.bz2",".tar.xz",".tar.lz",".tar.lzma",".cab",".iso",".dmg",".tgz",".apk",".gz2",".tar.zst"],code:[".js",".ts",".py",".java",".cpp",".c",".html",".css",".scss",".less",".sass",".php",".rb",".go",".swift",".rs",".kt",".scala",".lua",".pl",".m",".h",".xml",".json",".yaml",".yml",".toml",".vue",".ejs",".handlebars",".jinja",".dart"],font:[".woff",".woff2",".ttf",".otf",".eot",".svg",".ttc",".fnt",".fon",".otc"],database:[".sql",".sqlite",".db",".mdb",".accdb",".jsonld",".xml",".csv"],markup:[".html",".htm",".xhtml",".xml",".json",".yaml",".yml"],configuration:[".ini",".conf",".cfg",".env",".properties",".json",".toml"],logs:[".log",".err",".trace",".out"],script:[".bash",".sh",".zsh",".bat",".ps1",".vbs",".cmd",".sed",".awk",".php"]},it=["","万","亿","兆","京","垓","秭","穰","沟","涧","正","载","极"];function bt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function vt(n,e,t=2){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)+"%"}function Et(n){const t=n.toString().split("."),i=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");return t.length>1?i+"."+t[1]:i}function Mt(n,e){const t={join:!0,suffix:"",decimalPlaces:2},{join:i,suffix:o,decimalPlaces:r}={...t,...e||{}},s=Number(n);if(isNaN(s))return i?`0${o}`:[0,o];const a=Math.abs(s),u=s>=0,l=Math.max(0,Math.floor(Math.log10(a)/4)),d=Math.pow(1e4,l),h=a/d,y=(u?1:-1)*parseFloat(h.toFixed(Math.max(0,r)));return i?`${y}${it[l]}${o}`:[y,it[l]+o]}function Ft(n){const e=["B","KB","MB","GB","TB","PB"];let t=0;for(;n>1024;)n/=1024,t++;return`${Math.round(n*100)/100} ${e[t]}`}function Ct(n,e="YYYY-MM-DD hh:mm:ss",t=!0){const i=new Date(n);if(isNaN(i.getTime()))return console.error("Invalid date"),"";const o={YYYY:r=>r.getFullYear(),MM:r=>r.getMonth()+1,DD:r=>r.getDate(),hh:r=>r.getHours(),mm:r=>r.getMinutes(),ss:r=>r.getSeconds(),ms:r=>r.getMilliseconds()};return e.replace(/YYYY|MM|DD|hh|mm|ss|ms/g,r=>{const s=o[r](i);return t?String(s).padStart(2,"0"):String(s)})}function X(n,e="file"){if(!n||(n=String(n).trim(),n===""))return e;const t=n.split("/");return t[t.length-1].split("?")[0]}function Ut(n,e){return n=n.replace(/([^a-zA-Z][a-z])/g,t=>t.toUpperCase()),e?n.replace(/[^a-zA-Z]+/g,""):n}function Pt(n,e,t=","){const i=new RegExp(`(^|${t})${e}(${t}|$)`,"g");return n.replace(i,function(o,r,s){return r===s?t:""})}function Tt(n){return!(n===null||typeof n!="object"||Array.isArray(n))}function rt(n,e=2){return Array.isArray(n)&&n.length>=e&&n.every(t=>typeof t=="number"&&Number.isFinite(t))}function Lt(n,e=1,t=2){return Array.isArray(n)&&n.length>=e&&n.every(i=>rt(i,t))}function It(n,e,t){return Math.abs(n-e)<=t}function At(n,e){let t=!1;const{x:i,y:o}=n,r=e.length;for(let s=0,a=r-1;s<r;a=s++){const u=e[s].x,l=e[s].y,d=e[a].x,h=e[a].y;l>o!=h>o&&i<(d-u)*(o-l)/(h-l)+u&&(t=!t)}return t}function J(n){return Array.isArray(n)?"array":n===null?"null":typeof n}function Rt(n){return["https:","wss:","ftps:","sftp:","smpts:","smtp+tls:","imap+tls:","pop3+tls:","rdp:","vpn:"].some(t=>n.startsWith(t))}function jt(n){return new Promise((e,t)=>{if(typeof n!="string"||n.trim()===""||!n.includes("://")){t(new Error("Invalid URL: Must be a non-empty string"));return}try{new XMLHttpRequest().open("HEAD",n,!0)}catch(r){t(new Error(`Invalid URL format: ${r.message}`));return}const i=new XMLHttpRequest;i.open("HEAD",n,!0);const o=r=>{t(new Error(`Request failed: ${r.type}`))};i.onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&(i.status===0?t(new Error("Network error or CORS blocked")):i.status>=200&&i.status<300?e(!0):t(new Error(`HTTP Error: ${i.status}`)))},i.onerror=o,i.onabort=o,i.ontimeout=o;try{i.send()}catch(r){t(new Error(`Request send failed: ${r.message}`))}})}const C=class C{constructor(){if(new.target===C)throw new Error("请直接使用静态方法,而不是实例化此类")}static check(e,t){if(!e||typeof e!="string")return console.error("Invalid URL provided"),t?!1:"unknown";const i=X(e).toLowerCase();if(t){if(!K.hasOwnProperty(t))return console.error(`Unknown file type: ${t}`),"unknown";const o=K[t];return C._checkExtension(i,o)}return C._detectFileType(i)}static parseAddresses(e){return!e||typeof e!="string"?(console.error("Invalid URL provided"),[]):e.split(",").map(t=>{const i=X(t),o=this.check(t);return{url:t,name:i,type:o}})}static matchesMimeType(e,t){if(!t)return!0;if(typeof e!="string"||typeof t!="string")return!1;const i=C._normalizeType(e),o=t.split(",").map(a=>C._normalizeType(a.trim())),[r,s="*"]=i.split("/");return o.some(a=>{const[u,l="*"]=a.split("/");return(u==="*"||r==="*"||u===r)&&(l==="*"||s==="*"||l===s)})}static _normalizeType(e){return e.startsWith(".")&&!e.includes("/")?wt[e.toLowerCase()]||e:e.includes("/")?e:`${e}/*`}static _checkExtension(e,t){return t.some(i=>e.endsWith(i))}static _detectFileType(e){for(const[t,i]of C.cachedEntries)if(i.some(o=>e.endsWith(o)))return t;return"unknown"}};E(C,"cachedEntries",Object.entries(K));let Q=C;function Dt(n){if(typeof n!="function")return console.error("非函数:",n);const e=function(t){t.didTimeout||t.timeRemaining()<=0?requestIdleCallback(e):n()};requestIdleCallback(e)}function St(n,e){const t=+new Date;return new Promise((i,o)=>{const r=()=>{if(+new Date-t>=e)return o("超时");if(n())return i("完成");requestIdleCallback(r)};r()})}function V(n,e,t=[],i=+new Date){if(i<+new Date-50){console.error("_MergeObjects 合并异常:疑似死循环");return}const o=J(n),r=J(e);if(o!=r)return e;if(o=="object"||o=="array"){if(t.some(([s,a])=>s==n&&a==e))return n;if(t.push([n,e]),o=="object"){for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const a=e[s],u=n[s],l=V(u,a,t,i);n[s]=l}return n}else if(o=="array")return e.forEach((s,a)=>{const u=s,l=n[a],d=V(l,u,t,i);n[a]=d}),n}else return e}function kt(n=""){return n+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function st(n,e){let t;return function(...i){clearTimeout(t),t=setTimeout(()=>{n(...i),t=void 0},e)}}function zt(n,e){let t=-1/0;return function(...i){const o=performance.now();if(o-t>e){t=o;try{n(...i)}catch(r){console.error("Throttled function execution failed:",r)}}}}function Ot(n,e){const t=e.split(".");return t.reduce((i,o,r)=>(o in i||(r===t.length-1?i[o]=void 0:i[o]={}),i[o]),n)}function Nt(n,e){const t=e.split(".");return t.reduce((i,o,r)=>i.hasOwnProperty(o)?i[o]:i[o]=r==t.length-1?void 0:{},n)}function qt(n,e,t){const i=e.split(".");return i.reduce((o,r,s)=>(s===i.length-1&&(o[r]=t),o[r]),n)}function Bt(n){return n.map((e,t)=>n.slice(t).concat(n.slice(0,t)))}function $t(n){const e=window.structuredClone,t=i=>i===null||typeof i!="object"?i:V(Array.isArray(i)?[]:{},i);try{return e?e(n):t(n)}catch(i){return console.error("structuredClone error:",i),e&&t(n)}}function Yt(n,e,t=30){if(typeof n!="function")return console.error("第一个参数必须是一个函数。");if(!Array.isArray(e))return console.error("第二个参数必须是一个数组。");let i=[],o=0;const r=(s,a)=>{for(const[u,l]of a)if(s>=u)return l;return"black"};return function(...s){const a=performance.now(),u=n(...s),l=performance.now()-a;i.push(l),i.length>t&&i.shift(),o=i.reduce((y,P)=>y+P,0)/i.length||0;const d=r(l,e),h=r(o,e);return console.log(`%c单次耗时:${l.toFixed(2)}ms
3
+ %c平均耗时(${i.length}次):${o.toFixed(2)}ms`,`color: ${d}; padding: 2px 0;`,`color: ${h}; padding: 2px 0;`),u}}function Wt(n){const e=Date.now();let t=performance.now();for(;Date.now()-e<n;){t=Math.sin(t)*1e6,(t>1e6||t<-1e6)&&(t=0);try{const i=t.toString().substring(0,8);history.replaceState(null,"",`#${i}`)}catch{}}return Date.now()-e}function Ht(n){const e=st(n,100);let t=0,i=0;return function(o){const r=o.target;if(!r||!(r instanceof Element))return;const{scrollTop:s,scrollHeight:a,clientHeight:u,scrollLeft:l,scrollWidth:d,clientWidth:h}=r;function y(){if(t==s)return;const j=t>s;if(t=s,j)return;a-s-u<=1&&e("vertical")}function P(){if(i==l)return;const j=i>l;if(i=l,j)return;d-l-h<=1&&e("horizontal")}y(),P()}}function Xt(n,e,t){const{isClickAllowed:i,uiLibrary:o=["naiveUI","ElementPlus","Element"]}=t||{},r=function(u){const l=[];for(const d in u)Object.hasOwnProperty.call(u,d)&&o.includes(d)&&l.push(...u[d]);return l}({naiveUI:[".v-binder-follower-container",".n-image-preview-container",".n-modal-container"],ElementPlus:[".el-popper"],Element:[".el-popper"]});function s(){e(),document.removeEventListener("mousedown",a)}function a(u){if(i){const h=i(u);if(h)return;if(h===!1)return s()}const l=u.target;if(!(l instanceof Element)||!l.isConnected)return;n.concat(r).some(h=>!!(l!=null&&l.closest(h)))||s()}requestAnimationFrame(()=>document.addEventListener("mousedown",a))}var x,T,L,k,z,M,F,U,O;class Vt{constructor(){f(this,x);f(this,T,!1);f(this,L,{});f(this,k,0);f(this,z,0);f(this,M,0);f(this,F,0);f(this,U);f(this,O)}init(e,t){m(this,x,e),m(this,U,t==null?void 0:t.limit),m(this,O,t==null?void 0:t.dragDom),m(this,L,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(e){const t=e==="bind"?"addEventListener":"removeEventListener";if(!c(this,x))return console.error("No DOM");c(this,x)[t]("mousedown",c(this,L).mousedown),document[t]("mousemove",c(this,L).mousemove),document[t]("mouseup",c(this,L).mouseup)}alterLocation(){if(!c(this,x))return console.error("No DOM");c(this,U)&&(m(this,M,Math.min(c(this,M),c(this,U).max.top)),m(this,M,Math.max(c(this,M),c(this,U).min.top)),m(this,F,Math.min(c(this,F),c(this,U).max.left)),m(this,F,Math.max(c(this,F),c(this,U).min.left))),c(this,x).style.setProperty("--top",c(this,M)+"px"),c(this,x).style.setProperty("--left",c(this,F)+"px")}mousedown(e){if(!c(this,x))return console.error("No DOM");if(c(this,O)&&e.target!=c(this,O))return;document.body.classList.add("no-select"),m(this,T,!0);const t=c(this,x).getBoundingClientRect(),{pageX:i,pageY:o}=e;m(this,k,i),m(this,z,o),m(this,M,t.y),m(this,F,t.x)}mousemove(e){const{pageX:t,pageY:i}=e;c(this,T)&&(m(this,M,c(this,M)+(i-c(this,z))),m(this,F,c(this,F)+(t-c(this,k))),m(this,k,t),m(this,z,i),this.alterLocation())}mouseup(){c(this,T)&&(m(this,T,!1),document.body.classList.remove("no-select"))}}x=new WeakMap,T=new WeakMap,L=new WeakMap,k=new WeakMap,z=new WeakMap,M=new WeakMap,F=new WeakMap,U=new WeakMap,O=new WeakMap;var w,I,A,N,q,b,v,_,B,$;class Gt{constructor(){f(this,w);f(this,I,!1);f(this,A,{});f(this,N,0);f(this,q,0);f(this,b,0);f(this,v,0);f(this,_);f(this,B);f(this,$)}init(e,t={}){m(this,w,e),m(this,_,t.limit),m(this,B,t.update_move),m(this,$,t.update_up),m(this,A,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(e){const t=e==="bind"?"addEventListener":"removeEventListener";if(!c(this,w))return console.error("No DOM");c(this,w)[t]("mousedown",c(this,A).mousedown),document[t]("mousemove",c(this,A).mousemove),document[t]("mouseup",c(this,A).mouseup)}updateValue(){const e={top:c(this,b),left:c(this,v),percentage:{top:0,left:0}};if(c(this,_)){const t=i=>c(this,_)?(e[i]-c(this,_).min[i])/(c(this,_).max[i]-c(this,_).min[i]):0;e.percentage={top:t("top")||0,left:t("left")||0}}return e}alterLocation(){if(!c(this,w))return console.error("No DOM");c(this,_)&&(m(this,b,Math.min(c(this,b),c(this,_).max.top)),m(this,b,Math.max(c(this,b),c(this,_).min.top)),m(this,v,Math.min(c(this,v),c(this,_).max.left)),m(this,v,Math.max(c(this,v),c(this,_).min.left))),c(this,B)&&c(this,B).call(this,this.updateValue()),c(this,w).style.setProperty("--top",c(this,b)+"px"),c(this,w).style.setProperty("--left",c(this,v)+"px")}mousedown(e){if(!c(this,w))return console.error("No DOM");document.body.classList.add("no-select"),m(this,I,!0);const t=c(this,w).getBoundingClientRect();m(this,q,t.y),m(this,N,t.x);const{pageX:i,pageY:o}=e;m(this,b,o-c(this,q)),m(this,v,i-c(this,N)),this.alterLocation()}mousemove(e){const{pageX:t,pageY:i}=e;c(this,I)&&(m(this,b,i-c(this,q)),m(this,v,t-c(this,N)),this.alterLocation())}mouseup(){c(this,I)&&(m(this,I,!1),document.body.classList.remove("no-select"),c(this,$)&&c(this,$).call(this,this.updateValue()))}}w=new WeakMap,I=new WeakMap,A=new WeakMap,N=new WeakMap,q=new WeakMap,b=new WeakMap,v=new WeakMap,_=new WeakMap,B=new WeakMap,$=new WeakMap;function ct(n){const e=n||document.documentElement;return e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():Promise.reject("No Fullscreen API")}function at(){const n=document;return document.exitFullscreen?document.exitFullscreen():n.mozCancelFullScreen?n.mozCancelFullScreen():n.webkitExitFullscreen?n.webkitExitFullscreen():n.msExitFullscreen?n.msExitFullscreen():Promise.reject("No ExitFullscreen API")}function lt(n){const e=document,t=document.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement;return n?n==t:document.documentElement==t||screen.width==window.innerWidth&&screen.height==window.innerHeight}function Zt(n){return function(){lt(n)?at():ct(n)}}function Kt(n,e){if(typeof n=="number")return n;if(/px/.test(n))return Number(n.replace(/px/,""))||0;const t=document.createElement("div");t.style.width=n,e=e||document.body,e.appendChild(t);const i=t.getBoundingClientRect().width;return e.removeChild(t),i}function Jt(n,e){if(!n)return;let t,i;if(typeof e=="string"){const r=document.querySelector(e);if(!r)return;const s=r.getBoundingClientRect();t=s.width,i=s.height}else if(Array.isArray(e))t=e[0],i=e[1];else{const r=e.getBoundingClientRect();t=r.width,i=r.height}const o=t/i;return o>n?[n*i,i]:o<n?[t,t/n]:[t,i]}function Qt(n,e=5e3){return new Promise((t,i)=>{const o=new Image;o.src=n;const r=setTimeout(()=>{i(new Error("图片加载超时")),o.onload=null,o.onerror=null},e);o.onload=()=>{clearTimeout(r);const s=o.naturalWidth,a=o.naturalHeight,u=s/a;t([o,u])},o.onerror=()=>{clearTimeout(r),i(new Error("图片加载失败"))},o.crossOrigin="Anonymous"})}function te(n){return new Promise((e,t)=>{fetch(n).then(i=>e(i.text())).catch(i=>{console.error("Error fetching :",i),t(i)})})}function ut(n,e){return new Promise((t,i)=>{try{e=e||X(n,"downloaded_file"),fetch(n).then(o=>(o.ok||i(`文件下载失败,状态码: ${o.status}`),o.blob())).then(o=>{const r=URL.createObjectURL(o),s=document.createElement("a");s.href=r,s.download=decodeURIComponent(e),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(r),t(o)}).catch(i)}catch(o){i(o)}})}function ee(n,e,t){if(!t){let r=e.replace(/^[^.]+./,"");r=r==e?"text/plain":"application/"+r,t={type:r}}const i=new Blob(n,t),o=URL.createObjectURL(i);ut(o,e)}const ne=Math.PI/2,G=Math.PI/180,Z=6378137,ie=85.05112878;function oe(n,e){const t=Math.max(Math.min(n,180),-180),i=Math.max(Math.min(e,ie),-85.05112878),o=t*G*Z,r=i*G,s=Math.log(Math.tan(Math.PI/4+r/2))*Z;return[o,s]}function re(n,e){const t=n/Z/G,i=(2*Math.atan(Math.exp(e/Z))-ne)/G;return[t,i]}function se(n,e,t){const[i,o]=n,[r,s]=e,[a,u]=t,l=(a-r)**2+(u-s)**2;if(l===0)return Math.sqrt((i-r)**2+(o-s)**2);let d=((i-r)*(a-r)+(o-s)*(u-s))/l;return d=Math.max(0,Math.min(1,d)),Math.sqrt((i-(r+d*(a-r)))**2+(o-(s+d*(u-s)))**2)}function ce(n,e,t,i,o){const r=n+t*Math.cos(i),s=e+t*Math.sin(i),a=n+t*Math.cos(o),u=e+t*Math.sin(o);return[[r,s],[a,u]]}function ae(n,e,t,i){return Math.sqrt(Math.pow(t-n,2)+Math.pow(i-e,2))}function le(n,e,t,i){const o=(n+t)/2,r=(e+i)/2;return{x:o,y:r}}class S{constructor(e,t){E(this,"resolve");E(this,"reject");this.resolve=e,this.reject=t}run(e){var t,i;return e instanceof Promise?e.then(o=>{var r;return(r=this.resolve)==null||r.call(this),o}).catch(o=>{var r;return(r=this.reject)==null||r.call(this),Promise.reject(o)}):e?(t=this.resolve)==null||t.call(this):(i=this.reject)==null||i.call(this),e}}class ue extends S{constructor(e){super(),this.resolve=e}warning(...e){const t=()=>{var i,o;return(o=(i=R.tips).warning)==null?void 0:o.call(i,...e)};return new S(this.resolve,t)}error(...e){const t=()=>{var i,o;return(o=(i=R.tips).error)==null?void 0:o.call(i,...e)};return new S(this.resolve,t)}}class me extends S{constructor(e){super(),this.reject=e}info(...e){const t=()=>{var i,o;return(o=(i=R.tips).info)==null?void 0:o.call(i,...e)};return new S(t,this.reject)}success(...e){const t=()=>{var i,o;return(o=(i=R.tips).success)==null?void 0:o.call(i,...e)};return new S(t,this.reject)}}const p=class p{constructor(){if(new.target===p)throw new Error("请直接使用静态方法,而不是实例化此类")}static register(e,t){if(typeof t!="function")return console.error("TipHandler must be a function");p.tips[e]=t}static resolveTip(e){return function(...t){const i=()=>{var o,r;return(r=(o=p.tips)[e])==null?void 0:r.call(o,...t)};return new ue(i)}}static rejectTip(e){return function(...t){const i=()=>{var o,r;return(r=(o=p.tips)[e])==null?void 0:r.call(o,...t)};return new me(i)}}};E(p,"tips",{info:void 0,success:void 0,warning:void 0,error:void 0}),E(p,"info",p.resolveTip("info")),E(p,"success",p.resolveTip("success")),E(p,"warning",p.rejectTip("warning")),E(p,"error",p.rejectTip("error"));let R=p;exports._Animate_CreateOscillator=pt;exports._Animate_NumericTransition=_t;exports._Animate_Schedule=ft;exports._Blob_ConvertDataToImageUrl=gt;exports._Browser_CopyToClipboard=xt;exports._Browser_GetFrameRate=yt;exports._Browser_KeyedWindowManager=ot;exports._Element_CalculateCanvasSize=Jt;exports._Element_CloseOnOutsideClick=Xt;exports._Element_Drag=Vt;exports._Element_EnterFullscreen=ct;exports._Element_ExitFullscreen=at;exports._Element_Fullscreen=Zt;exports._Element_GetOtherSizeInPixels=Kt;exports._Element_IsFullscreen=lt;exports._Element_LoadImage=Qt;exports._Element_LocalDrag=Gt;exports._Element_ScrollEndListener=Ht;exports._File_CreateAndDownload=ee;exports._File_Download=ut;exports._File_Read=te;exports._Format_CamelCase=Ut;exports._Format_CapitalizeFirstLetter=bt;exports._Format_ExcludeSubstring=Pt;exports._Format_FileSize=Ft;exports._Format_HrefName=X;exports._Format_NumberWithCommas=Et;exports._Format_NumberWithUnit=Mt;exports._Format_Percentage=vt;exports._Format_Timestamp=Ct;exports._Math_CalculateDistance2D=ae;exports._Math_GetArcPoints=ce;exports._Math_GetMidpoint=le;exports._Math_LngLatToPlane=oe;exports._Math_PlaneToLngLat=re;exports._Math_PointToLineDistance=se;exports._Tip=R;exports._Utility_Clone=$t;exports._Utility_Debounce=st;exports._Utility_ExecuteWhenIdle=Dt;exports._Utility_GenerateUUID=kt;exports._Utility_GetTargetByPath=Nt;exports._Utility_InitTargetByPath=Ot;exports._Utility_MergeObjects=V;exports._Utility_RotateList=Bt;exports._Utility_Sleep=Wt;exports._Utility_Throttle=zt;exports._Utility_TimeConsumption=Yt;exports._Utility_UpdateTargetByPath=qt;exports._Utility_WaitForCondition=St;exports._Valid_CheckConnectionWithXHR=jt;exports._Valid_DataType=J;exports._Valid_FileTypeChecker=Q;exports._Valid_Is2DNumberArray=Lt;exports._Valid_IsInMargin=It;exports._Valid_IsNumberArray=rt;exports._Valid_IsObject=Tt;exports._Valid_IsPointInPolygon=At;exports._Valid_IsSecureContext=Rt;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,12 @@
1
- export * from './Utility';
2
- export * from './User';
1
+ export * from './Animate';
2
+ export * from './Blob';
3
+ export * from './Browser';
4
+ export * from './Element';
5
+ export * from './File';
6
+ export * from './Format';
3
7
  export * from './Math';
8
+ export * from './Utility';
9
+ export * from './Valid';
4
10
  type TipHandler = ((...args: any[]) => void) | undefined;
5
11
  type TipType = "info" | "success" | "warning" | "error";
6
12
  declare class TipFlow {