nhanh-pure-function 3.0.2 → 3.0.4

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,4 +1,4 @@
1
- import { WindowTarget } from '../Constant';
1
+ import { PaperType, WindowTarget } from '../Constant';
2
2
  /**
3
3
  * 获取帧率
4
4
  * @param {(fps , frameTime)=>void} callback callback( 帧率 , 每帧时间 )
@@ -50,3 +50,28 @@ export declare class _Browser_KeyedWindowManager {
50
50
  */
51
51
  static closeAll(): void;
52
52
  }
53
+ /**
54
+ * 计算内容可用宽高及边距(考虑设备DPI)
55
+ * 确保:contentWidth + 2*paddingPx = 纸张宽度像素
56
+ * @param type 纸张类型
57
+ * @param padding 边距(毫米)
58
+ * @returns {
59
+ * contentWidth: number; // 内容可用宽度(px)
60
+ * contentHeight: number; // 内容可用高度(px)
61
+ * paddingPx: number; // 边距(px) - 单边值
62
+ * paperWidthPx: number; // 纸张总宽度(px)
63
+ * paperHeightPx: number; // 纸张总高度(px)
64
+ * }
65
+ */
66
+ export declare function _Browser_CalculatePrintableArea(type: PaperType, padding: number): {
67
+ /** 内容宽度(像素) */
68
+ contentWidth: number;
69
+ /** 内容高度(像素) */
70
+ contentHeight: number;
71
+ /** 边距(像素) */
72
+ paddingPx: number;
73
+ /** 纸张宽度(像素) */
74
+ paperWidthPx: number;
75
+ /** 纸张高度(像素) */
76
+ paperHeightPx: number;
77
+ };
@@ -61,6 +61,7 @@ export declare const EXTENSION_TO_MIME: {
61
61
  ".eot": string;
62
62
  ".map": string;
63
63
  };
64
+ /** 文件扩展名对应的MIME类型 */
64
65
  export declare const FILE_EXTENSIONS: {
65
66
  image: string[];
66
67
  ppt: string[];
@@ -79,7 +80,177 @@ export declare const FILE_EXTENSIONS: {
79
80
  logs: string[];
80
81
  script: string[];
81
82
  };
83
+ /** 文件扩展名 */
82
84
  export type FileType = keyof typeof FILE_EXTENSIONS;
85
+ /** 单位标签 */
83
86
  export declare const UNIT_LABELS: readonly ["", "万", "亿", "兆", "京", "垓", "秭", "穰", "沟", "涧", "正", "载", "极"];
87
+ /** 浏览器窗口目标 */
84
88
  export declare const WINDOW_TARGET: readonly ["_self", "_blank", "_parent", "_top"];
89
+ /** 浏览器窗口目标类型 */
85
90
  export type WindowTarget = (typeof WINDOW_TARGET)[number];
91
+ /** 纸张尺寸 */
92
+ export declare const PAPER_SIZE_DEFINITIONS: {
93
+ readonly Letter: {
94
+ readonly width: 215.9;
95
+ readonly height: 279.4;
96
+ };
97
+ readonly Legal: {
98
+ readonly width: 215.9;
99
+ readonly height: 355.6;
100
+ };
101
+ readonly Tabloid: {
102
+ readonly width: 279.4;
103
+ readonly height: 431.8;
104
+ };
105
+ readonly Ledger: {
106
+ readonly width: 431.8;
107
+ readonly height: 279.4;
108
+ };
109
+ readonly Executive: {
110
+ readonly width: 184.2;
111
+ readonly height: 266.7;
112
+ };
113
+ readonly Folio: {
114
+ readonly width: 215.9;
115
+ readonly height: 330.2;
116
+ };
117
+ readonly Quarto: {
118
+ readonly width: 215;
119
+ readonly height: 275;
120
+ };
121
+ readonly "Government-Letter": {
122
+ readonly width: 203.2;
123
+ readonly height: 266.7;
124
+ };
125
+ readonly A0: {
126
+ readonly width: 841;
127
+ readonly height: 1189;
128
+ };
129
+ readonly A1: {
130
+ readonly width: 594;
131
+ readonly height: 841;
132
+ };
133
+ readonly A2: {
134
+ readonly width: 420;
135
+ readonly height: 594;
136
+ };
137
+ readonly A3: {
138
+ readonly width: 297;
139
+ readonly height: 420;
140
+ };
141
+ readonly A4: {
142
+ readonly width: 210;
143
+ readonly height: 297;
144
+ };
145
+ readonly A5: {
146
+ readonly width: 148;
147
+ readonly height: 210;
148
+ };
149
+ readonly A6: {
150
+ readonly width: 105;
151
+ readonly height: 148;
152
+ };
153
+ readonly A7: {
154
+ readonly width: 74;
155
+ readonly height: 105;
156
+ };
157
+ readonly A8: {
158
+ readonly width: 52;
159
+ readonly height: 74;
160
+ };
161
+ readonly A9: {
162
+ readonly width: 37;
163
+ readonly height: 52;
164
+ };
165
+ readonly A10: {
166
+ readonly width: 26;
167
+ readonly height: 37;
168
+ };
169
+ readonly B0: {
170
+ readonly width: 1000;
171
+ readonly height: 1414;
172
+ };
173
+ readonly B1: {
174
+ readonly width: 707;
175
+ readonly height: 1000;
176
+ };
177
+ readonly B2: {
178
+ readonly width: 500;
179
+ readonly height: 707;
180
+ };
181
+ readonly B3: {
182
+ readonly width: 353;
183
+ readonly height: 500;
184
+ };
185
+ readonly B4: {
186
+ readonly width: 250;
187
+ readonly height: 353;
188
+ };
189
+ readonly B5: {
190
+ readonly width: 176;
191
+ readonly height: 250;
192
+ };
193
+ readonly B6: {
194
+ readonly width: 125;
195
+ readonly height: 176;
196
+ };
197
+ readonly B7: {
198
+ readonly width: 88;
199
+ readonly height: 125;
200
+ };
201
+ readonly B8: {
202
+ readonly width: 62;
203
+ readonly height: 88;
204
+ };
205
+ readonly B9: {
206
+ readonly width: 44;
207
+ readonly height: 62;
208
+ };
209
+ readonly B10: {
210
+ readonly width: 31;
211
+ readonly height: 44;
212
+ };
213
+ readonly C0: {
214
+ readonly width: 917;
215
+ readonly height: 1297;
216
+ };
217
+ readonly C1: {
218
+ readonly width: 648;
219
+ readonly height: 917;
220
+ };
221
+ readonly C2: {
222
+ readonly width: 458;
223
+ readonly height: 648;
224
+ };
225
+ readonly C3: {
226
+ readonly width: 324;
227
+ readonly height: 458;
228
+ };
229
+ readonly C4: {
230
+ readonly width: 229;
231
+ readonly height: 324;
232
+ };
233
+ readonly C5: {
234
+ readonly width: 162;
235
+ readonly height: 229;
236
+ };
237
+ readonly C6: {
238
+ readonly width: 114;
239
+ readonly height: 162;
240
+ };
241
+ readonly C7: {
242
+ readonly width: 81;
243
+ readonly height: 114;
244
+ };
245
+ readonly C8: {
246
+ readonly width: 57;
247
+ readonly height: 81;
248
+ };
249
+ };
250
+ /** 纸张尺寸 */
251
+ export type PaperType = keyof typeof PAPER_SIZE_DEFINITIONS;
252
+ /** 纸张尺寸列表 */
253
+ export declare const PAPER_SIZE_OPTIONS: {
254
+ value: string;
255
+ label: string;
256
+ }[];
@@ -48,17 +48,17 @@ export declare class _Element_LocalDrag {
48
48
  mouseup(): void;
49
49
  }
50
50
  /** 进入全屏模式 */
51
- export declare function _Element_EnterFullscreen(content?: HTMLElement | string): Promise<void>;
51
+ export declare function _Element_EnterFullscreen(element?: HTMLElement | string): Promise<void>;
52
52
  /** 退出全屏模式 */
53
53
  export declare function _Element_ExitFullscreen(): Promise<void>;
54
54
  /** 判断是否处于全屏模式 */
55
- export declare function _Element_IsFullscreen(content?: HTMLElement | string): boolean;
55
+ export declare function _Element_IsFullscreen(element?: HTMLElement | string): boolean;
56
56
  /**
57
57
  * 返回一个用于切换全屏模式的函数
58
58
  * @param {HTMLElement} content - 需要进入全屏的元素
59
59
  * 该函数通过检查不同浏览器的特定方法来实现全屏切换
60
60
  */
61
- export declare function _Element_Fullscreen(content?: HTMLElement | string): () => void;
61
+ export declare function _Element_Fullscreen(element?: HTMLElement | string): () => void;
62
62
  /**
63
63
  * 元素全屏状态观察器
64
64
  * 监听元素的全屏状态变化,并通过回调函数通知状态改变
@@ -87,7 +87,7 @@ export declare function _Utility_RotateList<T>(list: T[]): T[][];
87
87
  * @param {any} val - 需要克隆的值
88
88
  * @returns {any} - 克隆后的值
89
89
  */
90
- export declare function _Utility_Clone<T>(val: T): T | undefined;
90
+ export declare function _Utility_Clone<T>(val: T): T;
91
91
  /**
92
92
  * 函数装饰器,用于测量并记录另一个函数的执行时间
93
93
  * @param func 要测量执行时间的函数
@@ -1,5 +1,5 @@
1
1
  import { FileType } from '../Constant';
2
- import { Point } from './type';
2
+ import { DataType, Point } from './type';
3
3
  /**
4
4
  * 是正常对象吗
5
5
  * @param {} value
@@ -50,7 +50,7 @@ export declare function _Valid_DoesInfiniteLineIntersectRectangle(rectCorner1: [
50
50
  * @param {any} value
51
51
  * @returns string
52
52
  */
53
- export declare function _Valid_DataType(value: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "array" | "null";
53
+ export declare function _Valid_DataType(value: any): DataType;
54
54
  /**
55
55
  * 判断给定URL是否指向一个安全上下文
56
56
  *
@@ -2,3 +2,5 @@ export interface Point {
2
2
  x: number;
3
3
  y: number;
4
4
  }
5
+ /** 定义所有可能的数据类型字符串 */
6
+ export type DataType = "null" | "undefined" | "boolean" | "number" | "string" | "symbol" | "bigint" | "function" | "array" | "object" | "date" | "regexp" | "map" | "set" | "error" | "promise" | "weakmap" | "weakset" | "arraybuffer" | "dataview" | "int8array" | "uint8array" | "uint8clampedarray" | "int16array" | "uint16array" | "int32array" | "uint32array" | "float32array" | "float64array" | "bigint64array" | "biguint64array";
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(".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 dt=Object.defineProperty;var it=n=>{throw TypeError(n)};var ht=(n,t,e)=>t in n?dt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var F=(n,t,e)=>ht(n,typeof t!="symbol"?t+"":t,e),ot=(n,t,e)=>t.has(n)||it("Cannot "+e);var a=(n,t,e)=>(ot(n,t,"read from private field"),e?e.call(n):t.get(n)),h=(n,t,e)=>t.has(n)?it("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),f=(n,t,e,r)=>(ot(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function pt(n,t=500){let e,r=!0;function i(o){if(!r)return;e||(e=o);let s=Math.min((o-e)/t,1);n(s),o-e<t&&requestAnimationFrame(i)}return requestAnimationFrame(i),()=>r=!1}function _t(n,t,e,r,i=2){let o=n,s=!1,c=1,u=n,l=t,m=e;const d=()=>{const y=(l-u)/m;return Number(y.toFixed(i))};let _=d();const x=y=>Math.min(Math.max(y,u),l),M=y=>Number(y.toFixed(i)),T=(y,W,H)=>{const I=[];return y>=W&&I.push("最小值必须小于最大值"),H<=0?I.push("分段数必须为正数"):d()==0&&I.push("数值精度过低,致使动画步长为 0"),I},k=(y,W,H)=>{const I=T(y,W,H);return I.length>0?(console.error(`参数更新失败: ${I.join("; ")}`),!1):(u=y,l=W,m=H,_=d(),o=x(o),!0)},V=()=>{s&&(c=o>=l?-1:o<=u?1:c,o=x(o+_*c),r(M(o)),requestAnimationFrame(V))};return{play(y=o){if(o=x(y),T(u,l,m).length)return console.error("配置参数错误",this.getParams());s||(s=!0,V())},pause(){s=!1},getCurrent:()=>M(o),isPlaying:()=>s,updateParams:k,getParams:()=>({min:u,max:l,steps:m,precision:i,stepSize:_})}}function gt(n,t,e,r,i=2){if(e<=0)return console.error("动画步数 必须为正数");const o=d=>Number(d.toFixed(i)),s=t-n,c=o(Math.abs(s)/e);if(c===0)return console.error("数值精度过低,致使动画步长为 0");const u=Math.sign(s);let l=n;const m=()=>{l=o(l+c*u),(u>0?l<t:l>t)?(r(l),requestAnimationFrame(m)):r(t)};m()}function yt(n,t="image/png"){try{let e,r=t;if(n instanceof File)return URL.createObjectURL(n);if(typeof n=="string"){let o=n;const s=o.match(/^data:([^;]*)(;base64)?,(.*)$/i);if(s){if(!s[2])return console.error("无效的数据 URL:缺少 base64 编码声明");if(r=s[1]||r,o=s[3],!o)return console.error("数据 URL 包含空有效负载")}o=o.replace(/[^A-Za-z0-9+/=]/g,"");const c=atob(o);e=new Uint8Array(c.length);for(let u=0;u<c.length;u++)e[u]=c.charCodeAt(u)}else if(n instanceof ArrayBuffer)e=new Uint8Array(n);else if(n instanceof Uint8Array)e=n;else return console.error("不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array");const i=new Blob([e],{type:r});return URL.createObjectURL(i)}catch(e){return console.error("数据到 ImageURL 的转换失败:",e.message,e.stack||"没有可用的堆栈跟踪"),null}}function xt(n,t=10){let e=0,r=t;function i(){if(r>0)r--,requestAnimationFrame(i);else{const s=(+new Date-e)/t,c=1e3/s;n(Number(c.toFixed(2)),Number(s.toFixed(2)))}}requestAnimationFrame(()=>{e=+new Date,i()})}function wt(n){const t=()=>Promise.resolve(),e=c=>(console.error(c),Promise.reject(c));function r(){return navigator.clipboard.writeText(n).then(t).catch(e)}function i(){const c=document.createElement("div");c.innerText=n,document.body.appendChild(c);const u=document.createRange();u.selectNodeContents(c);const l=window.getSelection();let m=!1;return l&&(l.removeAllRanges(),l.addRange(u),m=document.execCommand("copy")),document.body.removeChild(c),m?Promise.resolve():Promise.reject()}function o(){const c=document.createElement("textarea");c.value=n,document.body.appendChild(c),c.select(),c.setSelectionRange(0,n.length);let u=!1;return document.activeElement===c&&(u=document.execCommand("Copy",!0)),document.body.removeChild(c),u?Promise.resolve():Promise.reject()}function s(){return i().then(t).catch(()=>{o().then(t).catch(()=>e("复制方式尽皆失效"))})}return navigator.clipboard?r().catch(s):s()}class ct{constructor(){}static add(t,e){this.keys.set(t,e)}static open(t,e,r,i){const o=this.keys.get(t);if(o&&!o.closed)return o.focus(),o;{const s=window.open(e,r,i);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()}}F(ct,"keys",new Map);const bt={".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"},tt={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"]},st=["","万","亿","兆","京","垓","秭","穰","沟","涧","正","载","极"];function vt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Et(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 Mt(n){const e=n.toString().split("."),r=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");return e.length>1?r+"."+e[1]:r}function Ft(n,t){const e={join:!0,suffix:"",decimalPlaces:2},{join:r,suffix:i,decimalPlaces:o}={...e,...t||{}},s=Number(n);if(isNaN(s))return r?`0${i}`:[0,i];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,_=(u?1:-1)*parseFloat(d.toFixed(Math.max(0,o)));return r?`${_}${st[l]}${i}`:[_,st[l]+i]}function Ct(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 Lt(n,t="YYYY-MM-DD hh:mm:ss",e=!0){const r=new Date(n);if(isNaN(r.getTime()))return console.error("Invalid date"),"";const i={YYYY:o=>o.getFullYear(),MM:o=>o.getMonth()+1,DD:o=>o.getDate(),hh:o=>o.getHours(),mm:o=>o.getMinutes(),ss:o=>o.getSeconds(),ms:o=>o.getMilliseconds()};return t.replace(/YYYY|MM|DD|hh|mm|ss|ms/g,o=>{const s=i[o](r);return e?String(s).padStart(2,"0"):String(s)})}function G(n,t="file"){if(!n||(n=String(n).trim(),n===""))return t;const e=n.split("/");return e[e.length-1].split("?")[0]}function Tt(n,t){return n=n.replace(/([^a-zA-Z][a-z])/g,e=>e.toUpperCase()),t?n.replace(/[^a-zA-Z]+/g,""):n}function Ut(n,t,e=","){const r=new RegExp(`(^|${e})${t}(${e}|$)`,"g");return n.replace(r,function(i,o,s){return o===s?e:""})}function Pt(n){return!(n===null||typeof n!="object"||Array.isArray(n))}function at(n,t=2){if(Array.isArray(n)&&n.length>=t){for(let r=0;r<n.length;r++)if(typeof n[r]!="number"||!Number.isFinite(n[r]))return!1}else return!1;return!0}function It(n,t=1,e=2){if(Array.isArray(n)&&n.length>=t){for(let i=0;i<n.length;i++)if(!at(n[i],e))return!1}else return!1;return!0}function St(n,t,e){return Math.abs(n-t)<=e}function At(n,t){let e=!1;const{x:r,y:i}=n,o=t.length;for(let s=0,c=o-1;s<o;c=s++){const u=t[s].x,l=t[s].y,m=t[c].x,d=t[c].y;l>i!=d>i&&r<(m-u)*(i-l)/(d-l)+u&&(e=!e)}return e}function Rt(n,t,e,r){const i=Math.min(n[0],t[0]),o=Math.max(n[0],t[0]),s=Math.min(n[1],t[1]),c=Math.max(n[1],t[1]),u=[[i,s],[o,s],[o,c],[i,c]],l=r[1]-e[1],m=e[0]-r[0],d=r[0]*e[1]-e[0]*r[1];if(l===0&&m===0){const[T,k]=e;return T>=i&&T<=o&&k>=s&&k<=c}const _=1e-10;let x=!1,M=!1;for(const[T,k]of u){const V=l*T+m*k+d;if(Math.abs(V)<_||(V>_?x=!0:M=!0,x&&M))return!0}return x&&M}function et(n){return Array.isArray(n)?"array":n===null?"null":typeof n}function Dt(n){return["https:","wss:","ftps:","sftp:","smpts:","smtp+tls:","imap+tls:","pop3+tls:","rdp:","vpn:"].some(e=>n.startsWith(e))}function jt(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(o){e(new Error(`Invalid URL format: ${o.message}`));return}const r=new XMLHttpRequest;r.open("HEAD",n,!0);const i=o=>{e(new Error(`Request failed: ${o.type}`))};r.onreadystatechange=function(){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}`)))},r.onerror=i,r.onabort=i,r.ontimeout=i;try{r.send()}catch(o){e(new Error(`Request send failed: ${o.message}`))}})}const U=class U{constructor(){if(new.target===U)throw new Error("请直接使用静态方法,而不是实例化此类")}static check(t,e){if(!t||typeof t!="string")return console.error("Invalid URL provided"),e?!1:"unknown";const r=G(t).toLowerCase();if(e){if(!tt.hasOwnProperty(e))return console.error(`Unknown file type: ${e}`),"unknown";const i=tt[e];return U._checkExtension(r,i)}return U._detectFileType(r)}static parseAddresses(t){return!t||typeof t!="string"?(console.error("Invalid URL provided"),[]):t.split(",").map(e=>{const r=G(e),i=this.check(e);return{url:e,name:r,type:i}})}static matchesMimeType(t,e){if(!e)return!0;if(typeof t!="string"||typeof e!="string")return!1;const r=U._normalizeType(t),i=e.split(",").map(c=>U._normalizeType(c.trim())),[o,s="*"]=r.split("/");return i.some(c=>{const[u,l="*"]=c.split("/");return(u==="*"||o==="*"||u===o)&&(l==="*"||s==="*"||l===s)})}static _normalizeType(t){return t.startsWith(".")&&!t.includes("/")?bt[t.toLowerCase()]||t:t.includes("/")?t:`${t}/*`}static _checkExtension(t,e){return e.some(r=>t.endsWith(r))}static _detectFileType(t){for(const[e,r]of U.cachedEntries)if(r.some(i=>t.endsWith(i)))return e;return"unknown"}};F(U,"cachedEntries",Object.entries(tt));let nt=U;function kt(n){if(typeof n!="function")return console.error("非函数:",n);const t=function(e){e.didTimeout||e.timeRemaining()<=0?requestIdleCallback(t):n()};requestIdleCallback(t)}function Ot(n,t){const e=+new Date;return new Promise((r,i)=>{const o=()=>{if(+new Date-e>=t)return i("超时");if(n())return r("完成");requestIdleCallback(o)};o()})}function Z(n,t,e=[],r=+new Date){if(r<+new Date-50){console.error("_MergeObjects 合并异常:疑似死循环");return}const i=et(n),o=et(t);if(i!=o)return t;if(i=="object"||i=="array"){if(e.some(([s,c])=>s==n&&c==t))return n;if(e.push([n,t]),i=="object"){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const c=t[s],u=n[s],l=Z(u,c,e,r);n[s]=l}return n}else if(i=="array")return t.forEach((s,c)=>{const u=s,l=n[c],m=Z(l,u,e,r);n[c]=m}),n}else return t}function zt(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 lt(n,t){let e;return function(...r){clearTimeout(e),e=setTimeout(()=>{n(...r),e=void 0},t)}}function Nt(n,t){let e=-1/0;return function(...r){const i=performance.now();if(i-e>t){e=i;try{n(...r)}catch(o){console.error("Throttled function execution failed:",o)}}}}function qt(n,t,e){if(!n||!t)return n;const r=t.split(".");return r.reduce((i,o,s)=>i.hasOwnProperty(o)?i[o]:s===r.length-1?i[o]=e:i[o]={},n)}function Bt(n,t){if(!n||!t)return n;const e=t.split(".");return e.reduce((r,i,o)=>r.hasOwnProperty(i)?r[i]:o==e.length-1?void 0:{},n)}function $t(n,t,e){if(!n||!t)return n;const r=t.split(".");return r.reduce((i,o,s)=>(s===r.length-1&&(i[o]=e),i.hasOwnProperty(o)?i[o]:i[o]={}),n)}function Yt(n){return n.map((t,e)=>n.slice(e).concat(n.slice(0,e)))}function Xt(n){const t=window.structuredClone,e=r=>r===null||typeof r!="object"?r:Z(Array.isArray(r)?[]:{},r);try{return t?t(n):e(n)}catch(r){return console.error("structuredClone error:",r),t&&e(n)}}function Vt(n,t,e=30){if(typeof n!="function")return console.error("第一个参数必须是一个函数。");if(!Array.isArray(t))return console.error("第二个参数必须是一个数组。");let r=[],i=0;const o=(s,c)=>{for(const[u,l]of c)if(s>=u)return l;return"black"};return function(...s){const c=performance.now(),u=n(...s),l=performance.now()-c;r.push(l),r.length>e&&r.shift(),i=r.reduce((_,x)=>_+x,0)/r.length||0;const m=o(l,t),d=o(i,t);return console.log(`%c单次耗时:${l.toFixed(2)}ms
3
- %c平均耗时(${r.length}次):${i.toFixed(2)}ms`,`color: ${m}; padding: 2px 0;`,`color: ${d}; padding: 2px 0;`),u}}function Wt(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 r=e.toString().substring(0,8);history.replaceState(null,"",`#${r}`)}catch{}}return Date.now()-t}function Ht(n){const t=lt(n,100);let e=0,r=0;return function(i){const o=i.target;if(!o||!(o instanceof Element))return;const{scrollTop:s,scrollHeight:c,clientHeight:u,scrollLeft:l,scrollWidth:m,clientWidth:d}=o;function _(){if(e==s)return;const M=e>s;if(e=s,M)return;c-s-u<=1&&t("vertical")}function x(){if(r==l)return;const M=r>l;if(r=l,M)return;m-l-d<=1&&t("horizontal")}_(),x()}}function Gt(n,t,e){const{isClickAllowed:r,uiLibrary:i=["naiveUI","ElementPlus","Element"]}=e||{},o=function(u){const l=[];for(const m in u)Object.hasOwnProperty.call(u,m)&&i.includes(m)&&l.push(...u[m]);return l}({naiveUI:[".v-binder-follower-container",".n-image-preview-container",".n-modal-container"],ElementPlus:[".el-popper"],Element:[".el-popper"]});function s(){t(),document.removeEventListener("mousedown",c)}function c(u){if(r){const d=r(u);if(d)return;if(d===!1)return s()}const l=u.target;if(!(l instanceof Element)||!l.isConnected)return;n.concat(o).some(d=>!!(l!=null&&l.closest(d)))||s()}requestAnimationFrame(()=>document.addEventListener("mousedown",c))}var w,S,A,z,N,C,L,P,q;class Zt{constructor(){h(this,w);h(this,S,!1);h(this,A,{});h(this,z,0);h(this,N,0);h(this,C,0);h(this,L,0);h(this,P);h(this,q)}init(t,e){f(this,w,t),f(this,P,e==null?void 0:e.limit),f(this,q,e==null?void 0:e.dragDom),f(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(t){const e=t==="bind"?"addEventListener":"removeEventListener";if(!a(this,w))return console.error("No DOM");a(this,w)[e]("mousedown",a(this,A).mousedown),document[e]("mousemove",a(this,A).mousemove),document[e]("mouseup",a(this,A).mouseup)}alterLocation(){if(!a(this,w))return console.error("No DOM");a(this,P)&&(f(this,C,Math.min(a(this,C),a(this,P).max.top)),f(this,C,Math.max(a(this,C),a(this,P).min.top)),f(this,L,Math.min(a(this,L),a(this,P).max.left)),f(this,L,Math.max(a(this,L),a(this,P).min.left))),a(this,w).style.setProperty("--top",a(this,C)+"px"),a(this,w).style.setProperty("--left",a(this,L)+"px")}mousedown(t){if(!a(this,w))return console.error("No DOM");if(a(this,q)&&t.target!=a(this,q))return;document.body.classList.add("no-select"),f(this,S,!0);const e=a(this,w).getBoundingClientRect(),{pageX:r,pageY:i}=t;f(this,z,r),f(this,N,i),f(this,C,e.y),f(this,L,e.x)}mousemove(t){const{pageX:e,pageY:r}=t;a(this,S)&&(f(this,C,a(this,C)+(r-a(this,N))),f(this,L,a(this,L)+(e-a(this,z))),f(this,z,e),f(this,N,r),this.alterLocation())}mouseup(){a(this,S)&&(f(this,S,!1),document.body.classList.remove("no-select"))}}w=new WeakMap,S=new WeakMap,A=new WeakMap,z=new WeakMap,N=new WeakMap,C=new WeakMap,L=new WeakMap,P=new WeakMap,q=new WeakMap;var b,R,D,B,$,v,E,g,Y,X;class Kt{constructor(){h(this,b);h(this,R,!1);h(this,D,{});h(this,B,0);h(this,$,0);h(this,v,0);h(this,E,0);h(this,g);h(this,Y);h(this,X)}init(t,e={}){f(this,b,t),f(this,g,e.limit),f(this,Y,e.update_move),f(this,X,e.update_up),f(this,D,{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(!a(this,b))return console.error("No DOM");a(this,b)[e]("mousedown",a(this,D).mousedown),document[e]("mousemove",a(this,D).mousemove),document[e]("mouseup",a(this,D).mouseup)}updateValue(){const t={top:a(this,v),left:a(this,E),percentage:{top:0,left:0}};if(a(this,g)){const e=r=>a(this,g)?(t[r]-a(this,g).min[r])/(a(this,g).max[r]-a(this,g).min[r]):0;t.percentage={top:e("top")||0,left:e("left")||0}}return t}alterLocation(){if(!a(this,b))return console.error("No DOM");a(this,g)&&(f(this,v,Math.min(a(this,v),a(this,g).max.top)),f(this,v,Math.max(a(this,v),a(this,g).min.top)),f(this,E,Math.min(a(this,E),a(this,g).max.left)),f(this,E,Math.max(a(this,E),a(this,g).min.left))),a(this,Y)&&a(this,Y).call(this,this.updateValue()),a(this,b).style.setProperty("--top",a(this,v)+"px"),a(this,b).style.setProperty("--left",a(this,E)+"px")}mousedown(t){if(!a(this,b))return console.error("No DOM");document.body.classList.add("no-select"),f(this,R,!0);const e=a(this,b).getBoundingClientRect();f(this,$,e.y),f(this,B,e.x);const{pageX:r,pageY:i}=t;f(this,v,i-a(this,$)),f(this,E,r-a(this,B)),this.alterLocation()}mousemove(t){const{pageX:e,pageY:r}=t;a(this,R)&&(f(this,v,r-a(this,$)),f(this,E,e-a(this,B)),this.alterLocation())}mouseup(){a(this,R)&&(f(this,R,!1),document.body.classList.remove("no-select"),a(this,X)&&a(this,X).call(this,this.updateValue()))}}b=new WeakMap,R=new WeakMap,D=new WeakMap,B=new WeakMap,$=new WeakMap,v=new WeakMap,E=new WeakMap,g=new WeakMap,Y=new WeakMap,X=new WeakMap;function Q(n){if(typeof n=="string"){const t=document.querySelector(n);if(!t)throw new Error(`Element "${n}" not found`);return t}else return n||document.documentElement}function ut(n){const t=Q(n);return t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():Promise.reject("No Fullscreen API")}function mt(){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 rt(n){const t=Q(n),e=document,r=document.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement;return t==r}function Jt(n){return n=Q(n),function(){rt(n)?mt():ut(n)}}function Qt(n,t){const e=Q(t),r=()=>{n(rt(e))};return document.addEventListener("fullscreenchange",r),document.addEventListener("webkitfullscreenchange",r),document.addEventListener("mozfullscreenchange",r),document.addEventListener("MSFullscreenChange",r),r(),()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("webkitfullscreenchange",r),document.removeEventListener("mozfullscreenchange",r),document.removeEventListener("MSFullscreenChange",r)}}function te(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 r=e.getBoundingClientRect().width;return t.removeChild(e),r}function ee(n,t){if(!n)return;let e,r;if(typeof t=="string"){const o=document.querySelector(t);if(!o)return;const s=o.getBoundingClientRect();e=s.width,r=s.height}else if(Array.isArray(t))e=t[0],r=t[1];else{const o=t.getBoundingClientRect();e=o.width,r=o.height}const i=e/r;return i>n?[n*r,r]:i<n?[e,e/n]:[e,r]}function ne(n,t=5e3){return new Promise((e,r)=>{const i=new Image;i.src=n;const o=setTimeout(()=>{r(new Error("图片加载超时")),i.onload=null,i.onerror=null},t);i.onload=()=>{clearTimeout(o);const s=i.naturalWidth,c=i.naturalHeight,u=s/c;e([i,u])},i.onerror=()=>{clearTimeout(o),r(new Error("图片加载失败"))},i.crossOrigin="Anonymous"})}function re(n){return new Promise((t,e)=>{fetch(n).then(r=>t(r.text())).catch(r=>{console.error("Error fetching :",r),e(r)})})}function ft(n,t){return new Promise((e,r)=>{try{t=t||G(n,"downloaded_file"),fetch(n).then(i=>(i.ok||r(`文件下载失败,状态码: ${i.status}`),i.blob())).then(i=>{const o=URL.createObjectURL(i),s=document.createElement("a");s.href=o,s.download=decodeURIComponent(t),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o),e(i)}).catch(r)}catch(i){r(i)}})}function ie(n,t,e){if(!e){let o=t.replace(/^[^.]+./,"");o=o==t?"text/plain":"application/"+o,e={type:o}}const r=new Blob(n,e),i=URL.createObjectURL(r);ft(i,t)}const oe=Math.PI/2,K=Math.PI/180,J=6378137,se=85.05112878;function ce(n,t){const e=Math.max(Math.min(n,180),-180),r=Math.max(Math.min(t,se),-85.05112878),i=e*K*J,o=r*K,s=Math.log(Math.tan(Math.PI/4+o/2))*J;return[i,s]}function ae(n,t){const e=n/J/K,r=(2*Math.atan(Math.exp(t/J))-oe)/K;return[e,r]}function le(n,t,e){const[r,i]=n,[o,s]=t,[c,u]=e,l=(c-o)**2+(u-s)**2;if(l===0)return Math.sqrt((r-o)**2+(i-s)**2);let m=((r-o)*(c-o)+(i-s)*(u-s))/l;return m=Math.max(0,Math.min(1,m)),Math.sqrt((r-(o+m*(c-o)))**2+(i-(s+m*(u-s)))**2)}function ue(n,t,e,r,i,o=1,s=1){const c=n+e*Math.cos(r)*o,u=t+e*Math.sin(r)*s,l=n+e*Math.cos(i)*o,m=t+e*Math.sin(i)*s;return[[c,u],[l,m]]}function me(n,t,e,r){return Math.hypot(Math.abs(e-n),Math.abs(r-t))}function fe(n,t,e,r){const i=(n+e)/2,o=(t+r)/2;return{x:i,y:o}}function de(n,t,e,r){const[i,o]=n,[s,c]=t;let u=1/0;if(s!==0){const l=s>0?(e-i)/s:-i/s;l>0&&(u=Math.min(u,l))}if(c!==0){const l=c>0?(r-o)/c:-o/c;l>0&&(u=Math.min(u,l))}return u===1/0?n:[i+s*u,o+c*u]}class O{constructor(t,e){F(this,"resolve");F(this,"reject");this.resolve=t,this.reject=e}run(t){var e,r;return t instanceof Promise?t.then(i=>{var o;return(o=this.resolve)==null||o.call(this),i}).catch(i=>{var o;return(o=this.reject)==null||o.call(this),Promise.reject(i)}):t?(e=this.resolve)==null||e.call(this):(r=this.reject)==null||r.call(this),t}}class he extends O{constructor(t){super(),this.resolve=t}warning(...t){const e=()=>{var r,i;return(i=(r=j.tips).warning)==null?void 0:i.call(r,...t)};return new O(this.resolve,e)}error(...t){const e=()=>{var r,i;return(i=(r=j.tips).error)==null?void 0:i.call(r,...t)};return new O(this.resolve,e)}}class pe extends O{constructor(t){super(),this.reject=t}info(...t){const e=()=>{var r,i;return(i=(r=j.tips).info)==null?void 0:i.call(r,...t)};return new O(e,this.reject)}success(...t){const e=()=>{var r,i;return(i=(r=j.tips).success)==null?void 0:i.call(r,...t)};return new O(e,this.reject)}}const p=class p{constructor(){if(new.target===p)throw new Error("请直接使用静态方法,而不是实例化此类")}static register(t,e){if(typeof e!="function")return console.error("TipHandler must be a function");p.tips[t]=e}static resolveTip(t){return function(...e){const r=()=>{var i,o;return(o=(i=p.tips)[t])==null?void 0:o.call(i,...e)};return new he(r)}}static rejectTip(t){return function(...e){const r=()=>{var i,o;return(o=(i=p.tips)[t])==null?void 0:o.call(i,...e)};return new pe(r)}}};F(p,"tips",{info:void 0,success:void 0,warning:void 0,error:void 0}),F(p,"info",p.resolveTip("info")),F(p,"success",p.resolveTip("success")),F(p,"warning",p.rejectTip("warning")),F(p,"error",p.rejectTip("error"));let j=p;exports._Animate_CreateOscillator=_t;exports._Animate_NumericTransition=gt;exports._Animate_Schedule=pt;exports._Blob_ConvertDataToImageUrl=yt;exports._Browser_CopyToClipboard=wt;exports._Browser_GetFrameRate=xt;exports._Browser_KeyedWindowManager=ct;exports._Element_CalculateCanvasSize=ee;exports._Element_CloseOnOutsideClick=Gt;exports._Element_Drag=Zt;exports._Element_EnterFullscreen=ut;exports._Element_ExitFullscreen=mt;exports._Element_Fullscreen=Jt;exports._Element_FullscreenObserver=Qt;exports._Element_GetOtherSizeInPixels=te;exports._Element_IsFullscreen=rt;exports._Element_LoadImage=ne;exports._Element_LocalDrag=Kt;exports._Element_ScrollEndListener=Ht;exports._File_CreateAndDownload=ie;exports._File_Download=ft;exports._File_Read=re;exports._Format_CamelCase=Tt;exports._Format_CapitalizeFirstLetter=vt;exports._Format_ExcludeSubstring=Ut;exports._Format_FileSize=Ct;exports._Format_HrefName=G;exports._Format_NumberWithCommas=Mt;exports._Format_NumberWithUnit=Ft;exports._Format_Percentage=Et;exports._Format_Timestamp=Lt;exports._Math_CalculateDistance2D=me;exports._Math_GetArcPoints=ue;exports._Math_GetBoundaryIntersection=de;exports._Math_GetMidpoint=fe;exports._Math_LngLatToPlane=ce;exports._Math_PlaneToLngLat=ae;exports._Math_PointToLineDistance=le;exports._Tip=j;exports._Utility_Clone=Xt;exports._Utility_Debounce=lt;exports._Utility_ExecuteWhenIdle=kt;exports._Utility_GenerateUUID=zt;exports._Utility_GetTargetByPath=Bt;exports._Utility_InitTargetByPath=qt;exports._Utility_MergeObjects=Z;exports._Utility_RotateList=Yt;exports._Utility_SetTargetByPath=$t;exports._Utility_Sleep=Wt;exports._Utility_Throttle=Nt;exports._Utility_TimeConsumption=Vt;exports._Utility_WaitForCondition=Ot;exports._Valid_CheckConnectionWithXHR=jt;exports._Valid_DataType=et;exports._Valid_DoesInfiniteLineIntersectRectangle=Rt;exports._Valid_FileTypeChecker=nt;exports._Valid_Is2DNumberArray=It;exports._Valid_IsInMargin=St;exports._Valid_IsNumberArray=at;exports._Valid_IsObject=Pt;exports._Valid_IsPointInPolygon=At;exports._Valid_IsSecureContext=Dt;
2
+ "use strict";var ft=Object.defineProperty;var rt=n=>{throw TypeError(n)};var pt=(n,e,t)=>e in n?ft(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>pt(n,typeof e!="symbol"?e+"":e,t),ot=(n,e,t)=>e.has(n)||rt("Cannot "+t);var u=(n,e,t)=>(ot(n,e,"read from private field"),t?t.call(n):e.get(n)),f=(n,e,t)=>e.has(n)?rt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),m=(n,e,t,i)=>(ot(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function gt(n,e=500){let t,i=!0;function o(r){if(!i)return;t||(t=r);let a=Math.min((r-t)/e,1);n(a),r-t<e&&requestAnimationFrame(o)}return requestAnimationFrame(o),()=>i=!1}function _t(n,e,t,i,o=2){let r=n,a=!1,s=1,c=n,l=e,h=t;const d=()=>{const x=(l-c)/h;return Number(x.toFixed(o))};let p=d();const y=x=>Math.min(Math.max(x,c),l),_=x=>Number(x.toFixed(o)),T=(x,H,V)=>{const U=[];return x>=H&&U.push("最小值必须小于最大值"),V<=0?U.push("分段数必须为正数"):d()==0&&U.push("数值精度过低,致使动画步长为 0"),U},O=(x,H,V)=>{const U=T(x,H,V);return U.length>0?(console.error(`参数更新失败: ${U.join("; ")}`),!1):(c=x,l=H,h=V,p=d(),r=y(r),!0)},X=()=>{a&&(s=r>=l?-1:r<=c?1:s,r=y(r+p*s),i(_(r)),requestAnimationFrame(X))};return{play(x=r){if(r=y(x),T(c,l,h).length)return console.error("配置参数错误",this.getParams());a||(a=!0,X())},pause(){a=!1},getCurrent:()=>_(r),isPlaying:()=>a,updateParams:O,getParams:()=>({min:c,max:l,steps:h,precision:o,stepSize:p})}}function wt(n,e,t,i,o=2){if(t<=0)return console.error("动画步数 必须为正数");const r=d=>Number(d.toFixed(o)),a=e-n,s=r(Math.abs(a)/t);if(s===0)return console.error("数值精度过低,致使动画步长为 0");const c=Math.sign(a);let l=n;const h=()=>{l=r(l+s*c),(c>0?l<e:l>e)?(i(l),requestAnimationFrame(h)):i(e)};h()}function yt(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 a=r.match(/^data:([^;]*)(;base64)?,(.*)$/i);if(a){if(!a[2])return console.error("无效的数据 URL:缺少 base64 编码声明");if(i=a[1]||i,r=a[3],!r)return console.error("数据 URL 包含空有效负载")}r=r.replace(/[^A-Za-z0-9+/=]/g,"");const s=atob(r);t=new Uint8Array(s.length);for(let c=0;c<s.length;c++)t[c]=s.charCodeAt(c)}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}}const xt={".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"},tt={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"]},st=["","万","亿","兆","京","垓","秭","穰","沟","涧","正","载","极"],at={Letter:{width:215.9,height:279.4},Legal:{width:215.9,height:355.6},Tabloid:{width:279.4,height:431.8},Ledger:{width:431.8,height:279.4},Executive:{width:184.2,height:266.7},Folio:{width:215.9,height:330.2},Quarto:{width:215,height:275},"Government-Letter":{width:203.2,height:266.7},A0:{width:841,height:1189},A1:{width:594,height:841},A2:{width:420,height:594},A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},A6:{width:105,height:148},A7:{width:74,height:105},A8:{width:52,height:74},A9:{width:37,height:52},A10:{width:26,height:37},B0:{width:1e3,height:1414},B1:{width:707,height:1e3},B2:{width:500,height:707},B3:{width:353,height:500},B4:{width:250,height:353},B5:{width:176,height:250},B6:{width:125,height:176},B7:{width:88,height:125},B8:{width:62,height:88},B9:{width:44,height:62},B10:{width:31,height:44},C0:{width:917,height:1297},C1:{width:648,height:917},C2:{width:458,height:648},C3:{width:324,height:458},C4:{width:229,height:324},C5:{width:162,height:229},C6:{width:114,height:162},C7:{width:81,height:114},C8:{width:57,height:81}};Object.keys(at).map(n=>({value:n,label:n}));function bt(n,e=10){let t=0,i=e;function o(){if(i>0)i--,requestAnimationFrame(o);else{const a=(+new Date-t)/e,s=1e3/a;n(Number(s.toFixed(2)),Number(a.toFixed(2)))}}requestAnimationFrame(()=>{t=+new Date,o()})}function vt(n){const e=()=>Promise.resolve(),t=s=>(console.error(s),Promise.reject(s));function i(){return navigator.clipboard.writeText(n).then(e).catch(t)}function o(){const s=document.createElement("div");s.innerText=n,document.body.appendChild(s);const c=document.createRange();c.selectNodeContents(s);const l=window.getSelection();let h=!1;return l&&(l.removeAllRanges(),l.addRange(c),h=document.execCommand("copy")),document.body.removeChild(s),h?Promise.resolve():Promise.reject()}function r(){const s=document.createElement("textarea");s.value=n,document.body.appendChild(s),s.select(),s.setSelectionRange(0,n.length);let c=!1;return document.activeElement===s&&(c=document.execCommand("Copy",!0)),document.body.removeChild(s),c?Promise.resolve():Promise.reject()}function a(){return o().then(e).catch(()=>{r().then(e).catch(()=>t("复制方式尽皆失效"))})}return navigator.clipboard?i().catch(a):a()}class ct{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 a=window.open(t,i,o);if(a)return this.keys.set(e,a),a;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()}}C(ct,"keys",new Map);function Et(n,e){const t=at[n];if(!t)throw new Error(`未知纸张类型: ${n}`);const{width:i,height:o}=t,r=_=>_/25.4,s=typeof window<"u"?window.devicePixelRatio*96:300,c=_=>Math.round(r(_)*s),l=c(i),h=c(o),d=c(e),p=Math.max(0,l-2*d),y=Math.max(0,h-2*d);return{contentWidth:p,contentHeight:y,paddingPx:d,paperWidthPx:l,paperHeightPx:h}}function Mt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Ct(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 Ft(n){const t=n.toString().split("."),i=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");return t.length>1?i+"."+t[1]:i}function Lt(n,e){const t={join:!0,suffix:"",decimalPlaces:2},{join:i,suffix:o,decimalPlaces:r}={...t,...e||{}},a=Number(n);if(isNaN(a))return i?`0${o}`:[0,o];const s=Math.abs(a),c=a>=0,l=Math.max(0,Math.floor(Math.log10(s)/4)),h=Math.pow(1e4,l),d=s/h,p=(c?1:-1)*parseFloat(d.toFixed(Math.max(0,r)));return i?`${p}${st[l]}${o}`:[p,st[l]+o]}function Tt(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 Pt(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 a=o[r](i);return t?String(a).padStart(2,"0"):String(a)})}function G(n,e="file"){if(!n||(n=String(n).trim(),n===""))return e;const t=n.split("/");return t[t.length-1].split("?")[0]}function It(n,e){return n=n.replace(/([^a-zA-Z][a-z])/g,t=>t.toUpperCase()),e?n.replace(/[^a-zA-Z]+/g,""):n}function Ut(n,e,t=","){const i=new RegExp(`(^|${t})${e}(${t}|$)`,"g");return n.replace(i,function(o,r,a){return r===a?t:""})}function At(n){return!(n===null||typeof n!="object"||Array.isArray(n))}function lt(n,e=2){if(Array.isArray(n)&&n.length>=e){for(let i=0;i<n.length;i++)if(typeof n[i]!="number"||!Number.isFinite(n[i]))return!1}else return!1;return!0}function St(n,e=1,t=2){if(Array.isArray(n)&&n.length>=e){for(let o=0;o<n.length;o++)if(!lt(n[o],t))return!1}else return!1;return!0}function Dt(n,e,t){return Math.abs(n-e)<=t}function Rt(n,e){let t=!1;const{x:i,y:o}=n,r=e.length;for(let a=0,s=r-1;a<r;s=a++){const c=e[a].x,l=e[a].y,h=e[s].x,d=e[s].y;l>o!=d>o&&i<(h-c)*(o-l)/(d-l)+c&&(t=!t)}return t}function jt(n,e,t,i){const o=Math.min(n[0],e[0]),r=Math.max(n[0],e[0]),a=Math.min(n[1],e[1]),s=Math.max(n[1],e[1]),c=[[o,a],[r,a],[r,s],[o,s]],l=i[1]-t[1],h=t[0]-i[0],d=i[0]*t[1]-t[0]*i[1];if(l===0&&h===0){const[T,O]=t;return T>=o&&T<=r&&O>=a&&O<=s}const p=1e-10;let y=!1,_=!1;for(const[T,O]of c){const X=l*T+h*O+d;if(Math.abs(X)<p||(X>p?y=!0:_=!0,y&&_))return!0}return y&&_}function Z(n){return Object.prototype.toString.call(n).slice(8,-1).toLowerCase()}function Ot(n){return["https:","wss:","ftps:","sftp:","smpts:","smtp+tls:","imap+tls:","pop3+tls:","rdp:","vpn:"].some(t=>n.startsWith(t))}function kt(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 P=class P{constructor(){if(new.target===P)throw new Error("请直接使用静态方法,而不是实例化此类")}static check(e,t){if(!e||typeof e!="string")return console.error("Invalid URL provided"),t?!1:"unknown";const i=G(e).toLowerCase();if(t){if(!tt.hasOwnProperty(t))return console.error(`Unknown file type: ${t}`),"unknown";const o=tt[t];return P._checkExtension(i,o)}return P._detectFileType(i)}static parseAddresses(e){return!e||typeof e!="string"?(console.error("Invalid URL provided"),[]):e.split(",").map(t=>{const i=G(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=P._normalizeType(e),o=t.split(",").map(s=>P._normalizeType(s.trim())),[r,a="*"]=i.split("/");return o.some(s=>{const[c,l="*"]=s.split("/");return(c==="*"||r==="*"||c===r)&&(l==="*"||a==="*"||l===a)})}static _normalizeType(e){return e.startsWith(".")&&!e.includes("/")?xt[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 P.cachedEntries)if(i.some(o=>e.endsWith(o)))return t;return"unknown"}};C(P,"cachedEntries",Object.entries(tt));let et=P;function zt(n){if(typeof n!="function")return console.error("非函数:",n);const e=function(t){t.didTimeout||t.timeRemaining()<=0?requestIdleCallback(e):n()};requestIdleCallback(e)}function Nt(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 nt(n,e,t=[],i=+new Date){if(i<+new Date-50){console.error("_MergeObjects 合并异常:疑似死循环");return}const o=Z(n),r=Z(e);if(o!=r)return e;if(o=="object"||o=="array"){if(t.some(([a,s])=>a==n&&s==e))return n;if(t.push([n,e]),o=="object"){for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const s=e[a],c=n[a],l=nt(c,s,t,i);n[a]=l}return n}else if(o=="array")return e.forEach((a,s)=>{const c=a,l=n[s],h=nt(l,c,t,i);n[s]=h}),n}else return e}function Bt(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 ut(n,e){let t;return function(...i){clearTimeout(t),t=setTimeout(()=>{n(...i),t=void 0},e)}}function qt(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 $t(n,e,t){if(!n||!e)return n;const i=e.split(".");return i.reduce((o,r,a)=>o.hasOwnProperty(r)?o[r]:a===i.length-1?o[r]=t:o[r]={},n)}function Yt(n,e){if(!n||!e)return n;const t=e.split(".");return t.reduce((i,o,r)=>i.hasOwnProperty(o)?i[o]:r==t.length-1?void 0:{},n)}function Wt(n,e,t){if(!n||!e)return n;const i=e.split(".");return i.reduce((o,r,a)=>(a===i.length-1&&(o[r]=t),o.hasOwnProperty(r)?o[r]:o[r]={}),n)}function Xt(n){return n.map((e,t)=>n.slice(t).concat(n.slice(0,t)))}function Ht(n){const e=window.structuredClone,t=(i,o=new WeakMap)=>{const r=i;if(r===null||typeof r!="object")return r;if(o.has(r))return o.get(r);switch(Z(r)){case"array":{const s=[];o.set(r,s);for(const c of r)s.push(t(c,o));return s}case"object":{if(r===null)return r;const s={};o.set(r,s);for(const c in r)Object.prototype.hasOwnProperty.call(r,c)&&(s[c]=t(r[c],o));return s}case"date":{const s=new Date(r.getTime());return o.set(r,s),s}case"regexp":{const s=r,c=new RegExp(s.source,s.flags);return c.lastIndex=s.lastIndex,o.set(r,c),c}case"map":{const s=new Map;return o.set(r,s),r.forEach((c,l)=>{s.set(t(l,o),t(c,o))}),s}case"set":{const s=new Set;return o.set(r,s),r.forEach(c=>{s.add(t(c,o))}),s}case"arraybuffer":case"dataview":case"int8array":case"uint8array":case"uint8clampedarray":case"int16array":case"uint16array":case"int32array":case"uint32array":case"float32array":case"float64array":case"bigint64array":case"biguint64array":{const s=r,c=s.constructor,l=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),h=new c(l,s.byteOffset,s.byteLength/s.BYTES_PER_ELEMENT);return o.set(r,h),h}case"error":{const s=r,c=new s.constructor(s.message);return c.stack=s.stack,c.name=s.name,o.set(r,c),c}case"function":case"promise":case"weakmap":case"weakset":default:return r}};try{return e?e(n):t(n)}catch(i){return console.error("structuredClone error:",i),e&&t(n)}}function Vt(n,e,t=30){if(typeof n!="function")return console.error("第一个参数必须是一个函数。");if(!Array.isArray(e))return console.error("第二个参数必须是一个数组。");let i=[],o=0;const r=(a,s)=>{for(const[c,l]of s)if(a>=c)return l;return"black"};return function(...a){const s=performance.now(),c=n(...a),l=performance.now()-s;i.push(l),i.length>t&&i.shift(),o=i.reduce((p,y)=>p+y,0)/i.length||0;const h=r(l,e),d=r(o,e);return console.log(`%c单次耗时:${l.toFixed(2)}ms
3
+ %c平均耗时(${i.length}次):${o.toFixed(2)}ms`,`color: ${h}; padding: 2px 0;`,`color: ${d}; padding: 2px 0;`),c}}function Gt(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 Zt(n){const e=ut(n,100);let t=0,i=0;return function(o){const r=o.target;if(!r||!(r instanceof Element))return;const{scrollTop:a,scrollHeight:s,clientHeight:c,scrollLeft:l,scrollWidth:h,clientWidth:d}=r;function p(){if(t==a)return;const _=t>a;if(t=a,_)return;s-a-c<=1&&e("vertical")}function y(){if(i==l)return;const _=i>l;if(i=l,_)return;h-l-d<=1&&e("horizontal")}p(),y()}}function Kt(n,e,t){const{isClickAllowed:i,uiLibrary:o=["naiveUI","ElementPlus","Element"]}=t||{},r=function(c){const l=[];for(const h in c)Object.hasOwnProperty.call(c,h)&&o.includes(h)&&l.push(...c[h]);return l}({naiveUI:[".v-binder-follower-container",".n-image-preview-container",".n-modal-container"],ElementPlus:[".el-popper"],Element:[".el-popper"]});function a(){e(),document.removeEventListener("mousedown",s)}function s(c){if(i){const d=i(c);if(d)return;if(d===!1)return a()}const l=c.target;if(!(l instanceof Element)||!l.isConnected)return;n.concat(r).some(d=>!!(l!=null&&l.closest(d)))||a()}requestAnimationFrame(()=>document.addEventListener("mousedown",s))}var b,A,S,z,N,F,L,I,B;class Qt{constructor(){f(this,b);f(this,A,!1);f(this,S,{});f(this,z,0);f(this,N,0);f(this,F,0);f(this,L,0);f(this,I);f(this,B)}init(e,t){m(this,b,e),m(this,I,t==null?void 0:t.limit),m(this,B,t==null?void 0:t.dragDom),m(this,S,{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(!u(this,b))return console.error("No DOM");u(this,b)[t]("mousedown",u(this,S).mousedown),document[t]("mousemove",u(this,S).mousemove),document[t]("mouseup",u(this,S).mouseup)}alterLocation(){if(!u(this,b))return console.error("No DOM");u(this,I)&&(m(this,F,Math.min(u(this,F),u(this,I).max.top)),m(this,F,Math.max(u(this,F),u(this,I).min.top)),m(this,L,Math.min(u(this,L),u(this,I).max.left)),m(this,L,Math.max(u(this,L),u(this,I).min.left))),u(this,b).style.setProperty("--top",u(this,F)+"px"),u(this,b).style.setProperty("--left",u(this,L)+"px")}mousedown(e){if(!u(this,b))return console.error("No DOM");if(u(this,B)&&e.target!=u(this,B))return;document.body.classList.add("no-select"),m(this,A,!0);const t=u(this,b).getBoundingClientRect(),{pageX:i,pageY:o}=e;m(this,z,i),m(this,N,o),m(this,F,t.y),m(this,L,t.x)}mousemove(e){const{pageX:t,pageY:i}=e;u(this,A)&&(m(this,F,u(this,F)+(i-u(this,N))),m(this,L,u(this,L)+(t-u(this,z))),m(this,z,t),m(this,N,i),this.alterLocation())}mouseup(){u(this,A)&&(m(this,A,!1),document.body.classList.remove("no-select"))}}b=new WeakMap,A=new WeakMap,S=new WeakMap,z=new WeakMap,N=new WeakMap,F=new WeakMap,L=new WeakMap,I=new WeakMap,B=new WeakMap;var v,D,R,q,$,E,M,w,Y,W;class Jt{constructor(){f(this,v);f(this,D,!1);f(this,R,{});f(this,q,0);f(this,$,0);f(this,E,0);f(this,M,0);f(this,w);f(this,Y);f(this,W)}init(e,t={}){m(this,v,e),m(this,w,t.limit),m(this,Y,t.update_move),m(this,W,t.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(e){const t=e==="bind"?"addEventListener":"removeEventListener";if(!u(this,v))return console.error("No DOM");u(this,v)[t]("mousedown",u(this,R).mousedown),document[t]("mousemove",u(this,R).mousemove),document[t]("mouseup",u(this,R).mouseup)}updateValue(){const e={top:u(this,E),left:u(this,M),percentage:{top:0,left:0}};if(u(this,w)){const t=i=>u(this,w)?(e[i]-u(this,w).min[i])/(u(this,w).max[i]-u(this,w).min[i]):0;e.percentage={top:t("top")||0,left:t("left")||0}}return e}alterLocation(){if(!u(this,v))return console.error("No DOM");u(this,w)&&(m(this,E,Math.min(u(this,E),u(this,w).max.top)),m(this,E,Math.max(u(this,E),u(this,w).min.top)),m(this,M,Math.min(u(this,M),u(this,w).max.left)),m(this,M,Math.max(u(this,M),u(this,w).min.left))),u(this,Y)&&u(this,Y).call(this,this.updateValue()),u(this,v).style.setProperty("--top",u(this,E)+"px"),u(this,v).style.setProperty("--left",u(this,M)+"px")}mousedown(e){if(!u(this,v))return console.error("No DOM");document.body.classList.add("no-select"),m(this,D,!0);const t=u(this,v).getBoundingClientRect();m(this,$,t.y),m(this,q,t.x);const{pageX:i,pageY:o}=e;m(this,E,o-u(this,$)),m(this,M,i-u(this,q)),this.alterLocation()}mousemove(e){const{pageX:t,pageY:i}=e;u(this,D)&&(m(this,E,i-u(this,$)),m(this,M,t-u(this,q)),this.alterLocation())}mouseup(){u(this,D)&&(m(this,D,!1),document.body.classList.remove("no-select"),u(this,W)&&u(this,W).call(this,this.updateValue()))}}v=new WeakMap,D=new WeakMap,R=new WeakMap,q=new WeakMap,$=new WeakMap,E=new WeakMap,M=new WeakMap,w=new WeakMap,Y=new WeakMap,W=new WeakMap;function J(n){if(typeof n=="string"){const e=document.querySelector(n);if(!e)throw new Error(`Element "${n}" not found`);return e}else return n||document.documentElement}function ht(n){const e=J(n);return e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():Promise.reject("No Fullscreen API")}function mt(){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 it(n){const e=J(n),t=document,i=document.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement;return e==i||!n&&window.innerWidth==screen.width&&window.innerHeight==screen.height}function te(n){return n=J(n),function(){it(n)?mt():ht(n)}}function ee(n,e){const t=J(e),i=()=>{n(it(t))};return document.addEventListener("fullscreenchange",i),document.addEventListener("webkitfullscreenchange",i),document.addEventListener("mozfullscreenchange",i),document.addEventListener("MSFullscreenChange",i),i(),()=>{document.removeEventListener("fullscreenchange",i),document.removeEventListener("webkitfullscreenchange",i),document.removeEventListener("mozfullscreenchange",i),document.removeEventListener("MSFullscreenChange",i)}}function ne(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 ie(n,e){if(!n)return;let t,i;if(typeof e=="string"){const r=document.querySelector(e);if(!r)return;const a=r.getBoundingClientRect();t=a.width,i=a.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 re(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 a=o.naturalWidth,s=o.naturalHeight,c=a/s;t([o,c])},o.onerror=()=>{clearTimeout(r),i(new Error("图片加载失败"))},o.crossOrigin="Anonymous"})}function oe(n){return new Promise((e,t)=>{fetch(n).then(i=>e(i.text())).catch(i=>{console.error("Error fetching :",i),t(i)})})}function dt(n,e){return new Promise((t,i)=>{try{e=e||G(n,"downloaded_file"),fetch(n).then(o=>(o.ok||i(`文件下载失败,状态码: ${o.status}`),o.blob())).then(o=>{const r=URL.createObjectURL(o),a=document.createElement("a");a.href=r,a.download=decodeURIComponent(e),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r),t(o)}).catch(i)}catch(o){i(o)}})}function se(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);dt(o,e)}const ae=Math.PI/2,K=Math.PI/180,Q=6378137,ce=85.05112878;function le(n,e){const t=Math.max(Math.min(n,180),-180),i=Math.max(Math.min(e,ce),-85.05112878),o=t*K*Q,r=i*K,a=Math.log(Math.tan(Math.PI/4+r/2))*Q;return[o,a]}function ue(n,e){const t=n/Q/K,i=(2*Math.atan(Math.exp(e/Q))-ae)/K;return[t,i]}function he(n,e,t){const[i,o]=n,[r,a]=e,[s,c]=t,l=(s-r)**2+(c-a)**2;if(l===0)return Math.sqrt((i-r)**2+(o-a)**2);let h=((i-r)*(s-r)+(o-a)*(c-a))/l;return h=Math.max(0,Math.min(1,h)),Math.sqrt((i-(r+h*(s-r)))**2+(o-(a+h*(c-a)))**2)}function me(n,e,t,i,o,r=1,a=1){const s=n+t*Math.cos(i)*r,c=e+t*Math.sin(i)*a,l=n+t*Math.cos(o)*r,h=e+t*Math.sin(o)*a;return[[s,c],[l,h]]}function de(n,e,t,i){return Math.hypot(Math.abs(t-n),Math.abs(i-e))}function fe(n,e,t,i){const o=(n+t)/2,r=(e+i)/2;return{x:o,y:r}}function pe(n,e,t,i){const[o,r]=n,[a,s]=e;let c=1/0;if(a!==0){const l=a>0?(t-o)/a:-o/a;l>0&&(c=Math.min(c,l))}if(s!==0){const l=s>0?(i-r)/s:-r/s;l>0&&(c=Math.min(c,l))}return c===1/0?n:[o+a*c,r+s*c]}class k{constructor(e,t){C(this,"resolve");C(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 ge extends k{constructor(e){super(),this.resolve=e}warning(...e){const t=()=>{var i,o;return(o=(i=j.tips).warning)==null?void 0:o.call(i,...e)};return new k(this.resolve,t)}error(...e){const t=()=>{var i,o;return(o=(i=j.tips).error)==null?void 0:o.call(i,...e)};return new k(this.resolve,t)}}class _e extends k{constructor(e){super(),this.reject=e}info(...e){const t=()=>{var i,o;return(o=(i=j.tips).info)==null?void 0:o.call(i,...e)};return new k(t,this.reject)}success(...e){const t=()=>{var i,o;return(o=(i=j.tips).success)==null?void 0:o.call(i,...e)};return new k(t,this.reject)}}const g=class g{constructor(){if(new.target===g)throw new Error("请直接使用静态方法,而不是实例化此类")}static register(e,t){if(typeof t!="function")return console.error("TipHandler must be a function");g.tips[e]=t}static resolveTip(e){return function(...t){const i=()=>{var o,r;return(r=(o=g.tips)[e])==null?void 0:r.call(o,...t)};return new ge(i)}}static rejectTip(e){return function(...t){const i=()=>{var o,r;return(r=(o=g.tips)[e])==null?void 0:r.call(o,...t)};return new _e(i)}}};C(g,"tips",{info:void 0,success:void 0,warning:void 0,error:void 0}),C(g,"info",g.resolveTip("info")),C(g,"success",g.resolveTip("success")),C(g,"warning",g.rejectTip("warning")),C(g,"error",g.rejectTip("error"));let j=g;exports._Animate_CreateOscillator=_t;exports._Animate_NumericTransition=wt;exports._Animate_Schedule=gt;exports._Blob_ConvertDataToImageUrl=yt;exports._Browser_CalculatePrintableArea=Et;exports._Browser_CopyToClipboard=vt;exports._Browser_GetFrameRate=bt;exports._Browser_KeyedWindowManager=ct;exports._Element_CalculateCanvasSize=ie;exports._Element_CloseOnOutsideClick=Kt;exports._Element_Drag=Qt;exports._Element_EnterFullscreen=ht;exports._Element_ExitFullscreen=mt;exports._Element_Fullscreen=te;exports._Element_FullscreenObserver=ee;exports._Element_GetOtherSizeInPixels=ne;exports._Element_IsFullscreen=it;exports._Element_LoadImage=re;exports._Element_LocalDrag=Jt;exports._Element_ScrollEndListener=Zt;exports._File_CreateAndDownload=se;exports._File_Download=dt;exports._File_Read=oe;exports._Format_CamelCase=It;exports._Format_CapitalizeFirstLetter=Mt;exports._Format_ExcludeSubstring=Ut;exports._Format_FileSize=Tt;exports._Format_HrefName=G;exports._Format_NumberWithCommas=Ft;exports._Format_NumberWithUnit=Lt;exports._Format_Percentage=Ct;exports._Format_Timestamp=Pt;exports._Math_CalculateDistance2D=de;exports._Math_GetArcPoints=me;exports._Math_GetBoundaryIntersection=pe;exports._Math_GetMidpoint=fe;exports._Math_LngLatToPlane=le;exports._Math_PlaneToLngLat=ue;exports._Math_PointToLineDistance=he;exports._Tip=j;exports._Utility_Clone=Ht;exports._Utility_Debounce=ut;exports._Utility_ExecuteWhenIdle=zt;exports._Utility_GenerateUUID=Bt;exports._Utility_GetTargetByPath=Yt;exports._Utility_InitTargetByPath=$t;exports._Utility_MergeObjects=nt;exports._Utility_RotateList=Xt;exports._Utility_SetTargetByPath=Wt;exports._Utility_Sleep=Gt;exports._Utility_Throttle=qt;exports._Utility_TimeConsumption=Vt;exports._Utility_WaitForCondition=Nt;exports._Valid_CheckConnectionWithXHR=kt;exports._Valid_DataType=Z;exports._Valid_DoesInfiniteLineIntersectRectangle=jt;exports._Valid_FileTypeChecker=et;exports._Valid_Is2DNumberArray=St;exports._Valid_IsInMargin=Dt;exports._Valid_IsNumberArray=lt;exports._Valid_IsObject=At;exports._Valid_IsPointInPolygon=Rt;exports._Valid_IsSecureContext=Ot;