nhanh-pure-function 3.0.3 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Browser/index.d.ts +2 -2
- package/dist/Constant.d.ts +3 -3
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +229 -222
- package/package.json +1 -1
package/dist/Browser/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare class _Browser_KeyedWindowManager {
|
|
|
51
51
|
static closeAll(): void;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* 计算纸张内容可用宽高及边距(考虑设备DPI)
|
|
55
55
|
* 确保:contentWidth + 2*paddingPx = 纸张宽度像素
|
|
56
56
|
* @param type 纸张类型
|
|
57
57
|
* @param padding 边距(毫米)
|
|
@@ -63,7 +63,7 @@ export declare class _Browser_KeyedWindowManager {
|
|
|
63
63
|
* paperHeightPx: number; // 纸张总高度(px)
|
|
64
64
|
* }
|
|
65
65
|
*/
|
|
66
|
-
export declare function
|
|
66
|
+
export declare function _Browser_CalculatePrintableArea(type: PaperType, padding: number): {
|
|
67
67
|
/** 内容宽度(像素) */
|
|
68
68
|
contentWidth: number;
|
|
69
69
|
/** 内容高度(像素) */
|
package/dist/Constant.d.ts
CHANGED
|
@@ -89,7 +89,7 @@ export declare const WINDOW_TARGET: readonly ["_self", "_blank", "_parent", "_to
|
|
|
89
89
|
/** 浏览器窗口目标类型 */
|
|
90
90
|
export type WindowTarget = (typeof WINDOW_TARGET)[number];
|
|
91
91
|
/** 纸张尺寸 */
|
|
92
|
-
export declare const
|
|
92
|
+
export declare const PAPER_SIZE_DEFINITIONS: {
|
|
93
93
|
readonly Letter: {
|
|
94
94
|
readonly width: 215.9;
|
|
95
95
|
readonly height: 279.4;
|
|
@@ -248,9 +248,9 @@ export declare const PAPER_SIZES: {
|
|
|
248
248
|
};
|
|
249
249
|
};
|
|
250
250
|
/** 纸张尺寸 */
|
|
251
|
-
export type PaperType = keyof typeof
|
|
251
|
+
export type PaperType = keyof typeof PAPER_SIZE_DEFINITIONS;
|
|
252
252
|
/** 纸张尺寸列表 */
|
|
253
|
-
export declare const
|
|
253
|
+
export declare const PAPER_SIZE_OPTIONS: {
|
|
254
254
|
value: string;
|
|
255
255
|
label: string;
|
|
256
256
|
}[];
|
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 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)),P=(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=P(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),P(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 Pt(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 Tt(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[P,O]=t;return P>=o&&P<=r&&O>=a&&O<=s}const p=1e-10;let y=!1,_=!1;for(const[P,O]of c){const X=l*P+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 T=class T{constructor(){if(new.target===T)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 T._checkExtension(i,o)}return T._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=T._normalizeType(e),o=t.split(",").map(s=>T._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 T.cachedEntries)if(i.some(o=>e.endsWith(o)))return t;return"unknown"}};C(T,"cachedEntries",Object.entries(tt));let et=T;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 Bt(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 Nt(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,B,F,L,I,N;class Qt{constructor(){f(this,b);f(this,A,!1);f(this,S,{});f(this,z,0);f(this,B,0);f(this,F,0);f(this,L,0);f(this,I);f(this,N)}init(e,t){m(this,b,e),m(this,I,t==null?void 0:t.limit),m(this,N,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,N)&&e.target!=u(this,N))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,B,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,B))),m(this,L,u(this,L)+(t-u(this,z))),m(this,z,t),m(this,B,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,B=new WeakMap,F=new WeakMap,L=new WeakMap,I=new WeakMap,N=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_CopyToClipboard=vt;exports._Browser_GetFrameRate=bt;exports._Browser_GetPrintableArea=Et;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=Pt;exports._Format_HrefName=G;exports._Format_NumberWithCommas=Ft;exports._Format_NumberWithUnit=Lt;exports._Format_Percentage=Ct;exports._Format_Timestamp=Tt;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=Nt;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=Bt;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;
|
|
2
|
+
"use strict";var pt=Object.defineProperty;var st=n=>{throw TypeError(n)};var gt=(n,e,t)=>e in n?pt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var F=(n,e,t)=>gt(n,typeof e!="symbol"?e+"":e,t),at=(n,e,t)=>e.has(n)||st("Cannot "+t);var u=(n,e,t)=>(at(n,e,"read from private field"),t?t.call(n):e.get(n)),f=(n,e,t)=>e.has(n)?st("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),m=(n,e,t,i)=>(at(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ct={".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"},G={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"]},et=["","万","亿","兆","京","垓","秭","穰","沟","涧","正","载","极"],_t=["_self","_blank","_parent","_top"],rt={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}},wt=Object.keys(rt).map(n=>({value:n,label:n}));function yt(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 xt(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)),I=(x,H,V)=>{const S=[];return x>=H&&S.push("最小值必须小于最大值"),V<=0?S.push("分段数必须为正数"):d()==0&&S.push("数值精度过低,致使动画步长为 0"),S},j=(x,H,V)=>{const S=I(x,H,V);return S.length>0?(console.error(`参数更新失败: ${S.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),I(c,l,h).length)return console.error("配置参数错误",this.getParams());a||(a=!0,X())},pause(){a=!1},getCurrent:()=>_(r),isPlaying:()=>a,updateParams:j,getParams:()=>({min:c,max:l,steps:h,precision:o,stepSize:p})}}function bt(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 vt(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}}function Et(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 Mt(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 lt{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()}}F(lt,"keys",new Map);function Ft(n,e){const t=rt[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 Ct(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Tt(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 It(n){const t=n.toString().split("."),i=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");return t.length>1?i+"."+t[1]:i}function Pt(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}${et[l]}${o}`:[p,et[l]+o]}function Lt(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 St(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 Z(n,e="file"){if(!n||(n=String(n).trim(),n===""))return e;const t=n.split("/");return t[t.length-1].split("?")[0]}function At(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 Ot(n){return!(n===null||typeof n!="object"||Array.isArray(n))}function ut(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 Rt(n,e=1,t=2){if(Array.isArray(n)&&n.length>=e){for(let o=0;o<n.length;o++)if(!ut(n[o],t))return!1}else return!1;return!0}function Dt(n,e,t){return Math.abs(n-e)<=t}function jt(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 kt(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[I,j]=t;return I>=o&&I<=r&&j>=a&&j<=s}const p=1e-10;let y=!1,_=!1;for(const[I,j]of c){const X=l*I+h*j+d;if(Math.abs(X)<p||(X>p?y=!0:_=!0,y&&_))return!0}return y&&_}function K(n){return Object.prototype.toString.call(n).slice(8,-1).toLowerCase()}function Nt(n){return["https:","wss:","ftps:","sftp:","smpts:","smtp+tls:","imap+tls:","pop3+tls:","rdp:","vpn:"].some(t=>n.startsWith(t))}function zt(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=Z(e).toLowerCase();if(t){if(!G.hasOwnProperty(t))return console.error(`Unknown file type: ${t}`),"unknown";const o=G[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=Z(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("/")?ct[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"}};F(P,"cachedEntries",Object.entries(G));let nt=P;function Bt(n){if(typeof n!="function")return console.error("非函数:",n);const e=function(t){t.didTimeout||t.timeRemaining()<=0?requestIdleCallback(e):n()};requestIdleCallback(e)}function qt(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 it(n,e,t=[],i=+new Date){if(i<+new Date-50){console.error("_MergeObjects 合并异常:疑似死循环");return}const o=K(n),r=K(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=it(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=it(l,c,t,i);n[s]=h}),n}else return e}function Wt(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 ht(n,e){let t;return function(...i){clearTimeout(t),t=setTimeout(()=>{n(...i),t=void 0},e)}}function $t(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 Yt(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 Xt(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 Ht(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 Vt(n){return n.map((e,t)=>n.slice(t).concat(n.slice(0,t)))}function Gt(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(K(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 Zt(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 Kt(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 Qt(n){const e=ht(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 Jt(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,U,N,z,C,T,L,B;class te{constructor(){f(this,b);f(this,A,!1);f(this,U,{});f(this,N,0);f(this,z,0);f(this,C,0);f(this,T,0);f(this,L);f(this,B)}init(e,t){m(this,b,e),m(this,L,t==null?void 0:t.limit),m(this,B,t==null?void 0:t.dragDom),m(this,U,{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,U).mousedown),document[t]("mousemove",u(this,U).mousemove),document[t]("mouseup",u(this,U).mouseup)}alterLocation(){if(!u(this,b))return console.error("No DOM");u(this,L)&&(m(this,C,Math.min(u(this,C),u(this,L).max.top)),m(this,C,Math.max(u(this,C),u(this,L).min.top)),m(this,T,Math.min(u(this,T),u(this,L).max.left)),m(this,T,Math.max(u(this,T),u(this,L).min.left))),u(this,b).style.setProperty("--top",u(this,C)+"px"),u(this,b).style.setProperty("--left",u(this,T)+"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,N,i),m(this,z,o),m(this,C,t.y),m(this,T,t.x)}mousemove(e){const{pageX:t,pageY:i}=e;u(this,A)&&(m(this,C,u(this,C)+(i-u(this,z))),m(this,T,u(this,T)+(t-u(this,N))),m(this,N,t),m(this,z,i),this.alterLocation())}mouseup(){u(this,A)&&(m(this,A,!1),document.body.classList.remove("no-select"))}}b=new WeakMap,A=new WeakMap,U=new WeakMap,N=new WeakMap,z=new WeakMap,C=new WeakMap,T=new WeakMap,L=new WeakMap,B=new WeakMap;var v,O,R,q,W,E,M,w,$,Y;class ee{constructor(){f(this,v);f(this,O,!1);f(this,R,{});f(this,q,0);f(this,W,0);f(this,E,0);f(this,M,0);f(this,w);f(this,$);f(this,Y)}init(e,t={}){m(this,v,e),m(this,w,t.limit),m(this,$,t.update_move),m(this,Y,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,$)&&u(this,$).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,O,!0);const t=u(this,v).getBoundingClientRect();m(this,W,t.y),m(this,q,t.x);const{pageX:i,pageY:o}=e;m(this,E,o-u(this,W)),m(this,M,i-u(this,q)),this.alterLocation()}mousemove(e){const{pageX:t,pageY:i}=e;u(this,O)&&(m(this,E,i-u(this,W)),m(this,M,t-u(this,q)),this.alterLocation())}mouseup(){u(this,O)&&(m(this,O,!1),document.body.classList.remove("no-select"),u(this,Y)&&u(this,Y).call(this,this.updateValue()))}}v=new WeakMap,O=new WeakMap,R=new WeakMap,q=new WeakMap,W=new WeakMap,E=new WeakMap,M=new WeakMap,w=new WeakMap,$=new WeakMap,Y=new WeakMap;function tt(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 mt(n){const e=tt(n);return e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():Promise.reject("No Fullscreen API")}function dt(){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 ot(n){const e=tt(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 ne(n){return n=tt(n),function(){ot(n)?dt():mt(n)}}function ie(n,e){const t=tt(e),i=()=>{n(ot(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 re(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 oe(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 se(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 ae(n){return new Promise((e,t)=>{fetch(n).then(i=>e(i.text())).catch(i=>{console.error("Error fetching :",i),t(i)})})}function ft(n,e){return new Promise((t,i)=>{try{e=e||Z(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 ce(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);ft(o,e)}const le=Math.PI/2,Q=Math.PI/180,J=6378137,ue=85.05112878;function he(n,e){const t=Math.max(Math.min(n,180),-180),i=Math.max(Math.min(e,ue),-85.05112878),o=t*Q*J,r=i*Q,a=Math.log(Math.tan(Math.PI/4+r/2))*J;return[o,a]}function me(n,e){const t=n/J/Q,i=(2*Math.atan(Math.exp(e/J))-le)/Q;return[t,i]}function de(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 fe(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 pe(n,e,t,i){return Math.hypot(Math.abs(t-n),Math.abs(i-e))}function ge(n,e,t,i){const o=(n+t)/2,r=(e+i)/2;return{x:o,y:r}}function _e(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){F(this,"resolve");F(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 we extends k{constructor(e){super(),this.resolve=e}warning(...e){const t=()=>{var i,o;return(o=(i=D.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=D.tips).error)==null?void 0:o.call(i,...e)};return new k(this.resolve,t)}}class ye extends k{constructor(e){super(),this.reject=e}info(...e){const t=()=>{var i,o;return(o=(i=D.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=D.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 we(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 ye(i)}}};F(g,"tips",{info:void 0,success:void 0,warning:void 0,error:void 0}),F(g,"info",g.resolveTip("info")),F(g,"success",g.resolveTip("success")),F(g,"warning",g.rejectTip("warning")),F(g,"error",g.rejectTip("error"));let D=g;exports.EXTENSION_TO_MIME=ct;exports.FILE_EXTENSIONS=G;exports.PAPER_SIZE_DEFINITIONS=rt;exports.PAPER_SIZE_OPTIONS=wt;exports.UNIT_LABELS=et;exports.WINDOW_TARGET=_t;exports._Animate_CreateOscillator=xt;exports._Animate_NumericTransition=bt;exports._Animate_Schedule=yt;exports._Blob_ConvertDataToImageUrl=vt;exports._Browser_CalculatePrintableArea=Ft;exports._Browser_CopyToClipboard=Mt;exports._Browser_GetFrameRate=Et;exports._Browser_KeyedWindowManager=lt;exports._Element_CalculateCanvasSize=oe;exports._Element_CloseOnOutsideClick=Jt;exports._Element_Drag=te;exports._Element_EnterFullscreen=mt;exports._Element_ExitFullscreen=dt;exports._Element_Fullscreen=ne;exports._Element_FullscreenObserver=ie;exports._Element_GetOtherSizeInPixels=re;exports._Element_IsFullscreen=ot;exports._Element_LoadImage=se;exports._Element_LocalDrag=ee;exports._Element_ScrollEndListener=Qt;exports._File_CreateAndDownload=ce;exports._File_Download=ft;exports._File_Read=ae;exports._Format_CamelCase=At;exports._Format_CapitalizeFirstLetter=Ct;exports._Format_ExcludeSubstring=Ut;exports._Format_FileSize=Lt;exports._Format_HrefName=Z;exports._Format_NumberWithCommas=It;exports._Format_NumberWithUnit=Pt;exports._Format_Percentage=Tt;exports._Format_Timestamp=St;exports._Math_CalculateDistance2D=pe;exports._Math_GetArcPoints=fe;exports._Math_GetBoundaryIntersection=_e;exports._Math_GetMidpoint=ge;exports._Math_LngLatToPlane=he;exports._Math_PlaneToLngLat=me;exports._Math_PointToLineDistance=de;exports._Tip=D;exports._Utility_Clone=Gt;exports._Utility_Debounce=ht;exports._Utility_ExecuteWhenIdle=Bt;exports._Utility_GenerateUUID=Wt;exports._Utility_GetTargetByPath=Xt;exports._Utility_InitTargetByPath=Yt;exports._Utility_MergeObjects=it;exports._Utility_RotateList=Vt;exports._Utility_SetTargetByPath=Ht;exports._Utility_Sleep=Kt;exports._Utility_Throttle=$t;exports._Utility_TimeConsumption=Zt;exports._Utility_WaitForCondition=qt;exports._Valid_CheckConnectionWithXHR=zt;exports._Valid_DataType=K;exports._Valid_DoesInfiniteLineIntersectRectangle=kt;exports._Valid_FileTypeChecker=nt;exports._Valid_Is2DNumberArray=Rt;exports._Valid_IsInMargin=Dt;exports._Valid_IsNumberArray=ut;exports._Valid_IsObject=Ot;exports._Valid_IsPointInPolygon=jt;exports._Valid_IsSecureContext=Nt;
|
package/dist/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -6,101 +6,6 @@ var et = (n) => {
|
|
|
6
6
|
var lt = (n, e, t) => e in n ? at(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
7
7
|
var C = (n, e, t) => lt(n, typeof e != "symbol" ? e + "" : e, t), nt = (n, e, t) => e.has(n) || et("Cannot " + t);
|
|
8
8
|
var u = (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);
|
|
9
|
-
function _t(n, e = 500) {
|
|
10
|
-
let t, i = !0;
|
|
11
|
-
function o(r) {
|
|
12
|
-
if (!i) return;
|
|
13
|
-
t || (t = r);
|
|
14
|
-
let c = Math.min((r - t) / e, 1);
|
|
15
|
-
n(c), r - t < e && requestAnimationFrame(o);
|
|
16
|
-
}
|
|
17
|
-
return requestAnimationFrame(o), () => i = !1;
|
|
18
|
-
}
|
|
19
|
-
function Et(n, e, t, i, o = 2) {
|
|
20
|
-
let r = n, c = !1, s = 1, a = n, l = e, h = t;
|
|
21
|
-
const d = () => {
|
|
22
|
-
const v = (l - a) / h;
|
|
23
|
-
return Number(v.toFixed(o));
|
|
24
|
-
};
|
|
25
|
-
let p = d();
|
|
26
|
-
const y = (v) => Math.min(Math.max(v, a), l), w = (v) => Number(v.toFixed(o)), P = (v, W, G) => {
|
|
27
|
-
const I = [];
|
|
28
|
-
return v >= W && I.push("最小值必须小于最大值"), G <= 0 ? I.push("分段数必须为正数") : d() == 0 && I.push("数值精度过低,致使动画步长为 0"), I;
|
|
29
|
-
}, k = (v, W, G) => {
|
|
30
|
-
const I = P(v, W, G);
|
|
31
|
-
return I.length > 0 ? (console.error(`参数更新失败: ${I.join("; ")}`), !1) : (a = v, l = W, h = G, p = d(), r = y(r), !0);
|
|
32
|
-
}, H = () => {
|
|
33
|
-
c && (s = r >= l ? -1 : r <= a ? 1 : s, r = y(r + p * s), i(w(r)), requestAnimationFrame(H));
|
|
34
|
-
};
|
|
35
|
-
return {
|
|
36
|
-
/** 启动/继续动画 */
|
|
37
|
-
play(v = r) {
|
|
38
|
-
if (r = y(v), P(a, l, h).length)
|
|
39
|
-
return console.error("配置参数错误", this.getParams());
|
|
40
|
-
c || (c = !0, H());
|
|
41
|
-
},
|
|
42
|
-
/** 暂停动画 */
|
|
43
|
-
pause() {
|
|
44
|
-
c = !1;
|
|
45
|
-
},
|
|
46
|
-
/** 获取当前值 */
|
|
47
|
-
getCurrent: () => w(r),
|
|
48
|
-
/** 是否正在运行 */
|
|
49
|
-
isPlaying: () => c,
|
|
50
|
-
/** 更新参数(不中断动画) */
|
|
51
|
-
updateParams: k,
|
|
52
|
-
/** 获取当前参数 */
|
|
53
|
-
getParams: () => ({ min: a, max: l, steps: h, precision: o, stepSize: p })
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function Mt(n, e, t, i, o = 2) {
|
|
57
|
-
if (t <= 0) return console.error("动画步数 必须为正数");
|
|
58
|
-
const r = (d) => Number(d.toFixed(o)), c = e - n, s = r(Math.abs(c) / t);
|
|
59
|
-
if (s === 0) return console.error("数值精度过低,致使动画步长为 0");
|
|
60
|
-
const a = Math.sign(c);
|
|
61
|
-
let l = n;
|
|
62
|
-
const h = () => {
|
|
63
|
-
l = r(l + s * a), (a > 0 ? l < e : l > e) ? (i(l), requestAnimationFrame(h)) : i(e);
|
|
64
|
-
};
|
|
65
|
-
h();
|
|
66
|
-
}
|
|
67
|
-
function Ct(n, e = "image/png") {
|
|
68
|
-
try {
|
|
69
|
-
let t, i = e;
|
|
70
|
-
if (n instanceof File)
|
|
71
|
-
return URL.createObjectURL(n);
|
|
72
|
-
if (typeof n == "string") {
|
|
73
|
-
let r = n;
|
|
74
|
-
const c = r.match(/^data:([^;]*)(;base64)?,(.*)$/i);
|
|
75
|
-
if (c) {
|
|
76
|
-
if (!c[2])
|
|
77
|
-
return console.error("无效的数据 URL:缺少 base64 编码声明");
|
|
78
|
-
if (i = c[1] || i, r = c[3], !r)
|
|
79
|
-
return console.error("数据 URL 包含空有效负载");
|
|
80
|
-
}
|
|
81
|
-
r = r.replace(/[^A-Za-z0-9+/=]/g, "");
|
|
82
|
-
const s = atob(r);
|
|
83
|
-
t = new Uint8Array(s.length);
|
|
84
|
-
for (let a = 0; a < s.length; a++)
|
|
85
|
-
t[a] = s.charCodeAt(a);
|
|
86
|
-
} else if (n instanceof ArrayBuffer)
|
|
87
|
-
t = new Uint8Array(n);
|
|
88
|
-
else if (n instanceof Uint8Array)
|
|
89
|
-
t = n;
|
|
90
|
-
else
|
|
91
|
-
return console.error(
|
|
92
|
-
"不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array"
|
|
93
|
-
);
|
|
94
|
-
const o = new Blob([t], { type: i });
|
|
95
|
-
return URL.createObjectURL(o);
|
|
96
|
-
} catch (t) {
|
|
97
|
-
return console.error(
|
|
98
|
-
"数据到 ImageURL 的转换失败:",
|
|
99
|
-
t.message,
|
|
100
|
-
t.stack || "没有可用的堆栈跟踪"
|
|
101
|
-
), null;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
9
|
const ut = {
|
|
105
10
|
".mp3": "audio/mpeg",
|
|
106
11
|
".mp4": "video/mp4",
|
|
@@ -357,7 +262,7 @@ const ut = {
|
|
|
357
262
|
"正",
|
|
358
263
|
"载",
|
|
359
264
|
"极"
|
|
360
|
-
], st = {
|
|
265
|
+
], _t = ["_self", "_blank", "_parent", "_top"], st = {
|
|
361
266
|
// 北美标准尺寸 (毫米)
|
|
362
267
|
Letter: { width: 215.9, height: 279.4 },
|
|
363
268
|
// 8.5 × 11 英寸
|
|
@@ -410,12 +315,108 @@ const ut = {
|
|
|
410
315
|
C6: { width: 114, height: 162 },
|
|
411
316
|
C7: { width: 81, height: 114 },
|
|
412
317
|
C8: { width: 57, height: 81 }
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
})
|
|
418
|
-
|
|
318
|
+
}, Et = Object.keys(st).map(
|
|
319
|
+
(n) => ({
|
|
320
|
+
value: n,
|
|
321
|
+
label: n
|
|
322
|
+
})
|
|
323
|
+
);
|
|
324
|
+
function Mt(n, e = 500) {
|
|
325
|
+
let t, i = !0;
|
|
326
|
+
function o(r) {
|
|
327
|
+
if (!i) return;
|
|
328
|
+
t || (t = r);
|
|
329
|
+
let c = Math.min((r - t) / e, 1);
|
|
330
|
+
n(c), r - t < e && requestAnimationFrame(o);
|
|
331
|
+
}
|
|
332
|
+
return requestAnimationFrame(o), () => i = !1;
|
|
333
|
+
}
|
|
334
|
+
function Ct(n, e, t, i, o = 2) {
|
|
335
|
+
let r = n, c = !1, s = 1, a = n, l = e, h = t;
|
|
336
|
+
const d = () => {
|
|
337
|
+
const v = (l - a) / h;
|
|
338
|
+
return Number(v.toFixed(o));
|
|
339
|
+
};
|
|
340
|
+
let p = d();
|
|
341
|
+
const y = (v) => Math.min(Math.max(v, a), l), w = (v) => Number(v.toFixed(o)), P = (v, H, G) => {
|
|
342
|
+
const I = [];
|
|
343
|
+
return v >= H && I.push("最小值必须小于最大值"), G <= 0 ? I.push("分段数必须为正数") : d() == 0 && I.push("数值精度过低,致使动画步长为 0"), I;
|
|
344
|
+
}, k = (v, H, G) => {
|
|
345
|
+
const I = P(v, H, G);
|
|
346
|
+
return I.length > 0 ? (console.error(`参数更新失败: ${I.join("; ")}`), !1) : (a = v, l = H, h = G, p = d(), r = y(r), !0);
|
|
347
|
+
}, W = () => {
|
|
348
|
+
c && (s = r >= l ? -1 : r <= a ? 1 : s, r = y(r + p * s), i(w(r)), requestAnimationFrame(W));
|
|
349
|
+
};
|
|
350
|
+
return {
|
|
351
|
+
/** 启动/继续动画 */
|
|
352
|
+
play(v = r) {
|
|
353
|
+
if (r = y(v), P(a, l, h).length)
|
|
354
|
+
return console.error("配置参数错误", this.getParams());
|
|
355
|
+
c || (c = !0, W());
|
|
356
|
+
},
|
|
357
|
+
/** 暂停动画 */
|
|
358
|
+
pause() {
|
|
359
|
+
c = !1;
|
|
360
|
+
},
|
|
361
|
+
/** 获取当前值 */
|
|
362
|
+
getCurrent: () => w(r),
|
|
363
|
+
/** 是否正在运行 */
|
|
364
|
+
isPlaying: () => c,
|
|
365
|
+
/** 更新参数(不中断动画) */
|
|
366
|
+
updateParams: k,
|
|
367
|
+
/** 获取当前参数 */
|
|
368
|
+
getParams: () => ({ min: a, max: l, steps: h, precision: o, stepSize: p })
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
function Ft(n, e, t, i, o = 2) {
|
|
372
|
+
if (t <= 0) return console.error("动画步数 必须为正数");
|
|
373
|
+
const r = (d) => Number(d.toFixed(o)), c = e - n, s = r(Math.abs(c) / t);
|
|
374
|
+
if (s === 0) return console.error("数值精度过低,致使动画步长为 0");
|
|
375
|
+
const a = Math.sign(c);
|
|
376
|
+
let l = n;
|
|
377
|
+
const h = () => {
|
|
378
|
+
l = r(l + s * a), (a > 0 ? l < e : l > e) ? (i(l), requestAnimationFrame(h)) : i(e);
|
|
379
|
+
};
|
|
380
|
+
h();
|
|
381
|
+
}
|
|
382
|
+
function Lt(n, e = "image/png") {
|
|
383
|
+
try {
|
|
384
|
+
let t, i = e;
|
|
385
|
+
if (n instanceof File)
|
|
386
|
+
return URL.createObjectURL(n);
|
|
387
|
+
if (typeof n == "string") {
|
|
388
|
+
let r = n;
|
|
389
|
+
const c = r.match(/^data:([^;]*)(;base64)?,(.*)$/i);
|
|
390
|
+
if (c) {
|
|
391
|
+
if (!c[2])
|
|
392
|
+
return console.error("无效的数据 URL:缺少 base64 编码声明");
|
|
393
|
+
if (i = c[1] || i, r = c[3], !r)
|
|
394
|
+
return console.error("数据 URL 包含空有效负载");
|
|
395
|
+
}
|
|
396
|
+
r = r.replace(/[^A-Za-z0-9+/=]/g, "");
|
|
397
|
+
const s = atob(r);
|
|
398
|
+
t = new Uint8Array(s.length);
|
|
399
|
+
for (let a = 0; a < s.length; a++)
|
|
400
|
+
t[a] = s.charCodeAt(a);
|
|
401
|
+
} else if (n instanceof ArrayBuffer)
|
|
402
|
+
t = new Uint8Array(n);
|
|
403
|
+
else if (n instanceof Uint8Array)
|
|
404
|
+
t = n;
|
|
405
|
+
else
|
|
406
|
+
return console.error(
|
|
407
|
+
"不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array"
|
|
408
|
+
);
|
|
409
|
+
const o = new Blob([t], { type: i });
|
|
410
|
+
return URL.createObjectURL(o);
|
|
411
|
+
} catch (t) {
|
|
412
|
+
return console.error(
|
|
413
|
+
"数据到 ImageURL 的转换失败:",
|
|
414
|
+
t.message,
|
|
415
|
+
t.stack || "没有可用的堆栈跟踪"
|
|
416
|
+
), null;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
function Pt(n, e = 10) {
|
|
419
420
|
let t = 0, i = e;
|
|
420
421
|
function o() {
|
|
421
422
|
if (i > 0)
|
|
@@ -429,7 +430,7 @@ function Ft(n, e = 10) {
|
|
|
429
430
|
t = +/* @__PURE__ */ new Date(), o();
|
|
430
431
|
});
|
|
431
432
|
}
|
|
432
|
-
function
|
|
433
|
+
function Tt(n) {
|
|
433
434
|
const e = () => Promise.resolve(), t = (s) => (console.error(s), Promise.reject(s));
|
|
434
435
|
function i() {
|
|
435
436
|
return navigator.clipboard.writeText(n).then(e).catch(t);
|
|
@@ -517,7 +518,7 @@ class ht {
|
|
|
517
518
|
}
|
|
518
519
|
// 存储键与对应窗口的Map
|
|
519
520
|
C(ht, "keys", /* @__PURE__ */ new Map());
|
|
520
|
-
function
|
|
521
|
+
function At(n, e) {
|
|
521
522
|
const t = st[n];
|
|
522
523
|
if (!t) throw new Error(`未知纸张类型: ${n}`);
|
|
523
524
|
const { width: i, height: o } = t, r = (w) => w / 25.4, s = typeof window < "u" ? window.devicePixelRatio * 96 : 300, a = (w) => Math.round(r(w) * s), l = a(i), h = a(o), d = a(e), p = Math.max(0, l - 2 * d), y = Math.max(0, h - 2 * d);
|
|
@@ -534,17 +535,17 @@ function Pt(n, e) {
|
|
|
534
535
|
paperHeightPx: h
|
|
535
536
|
};
|
|
536
537
|
}
|
|
537
|
-
function
|
|
538
|
+
function It(n) {
|
|
538
539
|
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
539
540
|
}
|
|
540
|
-
function
|
|
541
|
+
function Rt(n, e, t = 2) {
|
|
541
542
|
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) + "%";
|
|
542
543
|
}
|
|
543
|
-
function
|
|
544
|
+
function St(n) {
|
|
544
545
|
const t = n.toString().split("."), i = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
545
546
|
return t.length > 1 ? i + "." + t[1] : i;
|
|
546
547
|
}
|
|
547
|
-
function
|
|
548
|
+
function jt(n, e) {
|
|
548
549
|
const t = {
|
|
549
550
|
join: !0,
|
|
550
551
|
suffix: "",
|
|
@@ -557,14 +558,14 @@ function Rt(n, e) {
|
|
|
557
558
|
const s = Math.abs(c), a = c >= 0, l = Math.max(0, Math.floor(Math.log10(s) / 4)), h = Math.pow(1e4, l), d = s / h, p = (a ? 1 : -1) * parseFloat(d.toFixed(Math.max(0, r)));
|
|
558
559
|
return i ? `${p}${it[l]}${o}` : [p, it[l] + o];
|
|
559
560
|
}
|
|
560
|
-
function
|
|
561
|
+
function Ut(n) {
|
|
561
562
|
const e = ["B", "KB", "MB", "GB", "TB", "PB"];
|
|
562
563
|
let t = 0;
|
|
563
564
|
for (; n > 1024; )
|
|
564
565
|
n /= 1024, t++;
|
|
565
566
|
return `${Math.round(n * 100) / 100} ${e[t]}`;
|
|
566
567
|
}
|
|
567
|
-
function
|
|
568
|
+
function kt(n, e = "YYYY-MM-DD hh:mm:ss", t = !0) {
|
|
568
569
|
const i = new Date(n);
|
|
569
570
|
if (isNaN(i.getTime()))
|
|
570
571
|
return console.error("Invalid date"), "";
|
|
@@ -588,10 +589,10 @@ function J(n, e = "file") {
|
|
|
588
589
|
const t = n.split("/");
|
|
589
590
|
return t[t.length - 1].split("?")[0];
|
|
590
591
|
}
|
|
591
|
-
function
|
|
592
|
+
function Ot(n, e) {
|
|
592
593
|
return n = n.replace(/([^a-zA-Z][a-z])/g, (t) => t.toUpperCase()), e ? n.replace(/[^a-zA-Z]+/g, "") : n;
|
|
593
594
|
}
|
|
594
|
-
function
|
|
595
|
+
function Dt(n, e, t = ",") {
|
|
595
596
|
const i = new RegExp(
|
|
596
597
|
`(^|${t})${e}(${t}|$)`,
|
|
597
598
|
"g"
|
|
@@ -600,7 +601,7 @@ function kt(n, e, t = ",") {
|
|
|
600
601
|
return r === c ? t : "";
|
|
601
602
|
});
|
|
602
603
|
}
|
|
603
|
-
function
|
|
604
|
+
function zt(n) {
|
|
604
605
|
return !(n === null || typeof n != "object" || Array.isArray(n));
|
|
605
606
|
}
|
|
606
607
|
function mt(n, e = 2) {
|
|
@@ -610,17 +611,17 @@ function mt(n, e = 2) {
|
|
|
610
611
|
} else return !1;
|
|
611
612
|
return !0;
|
|
612
613
|
}
|
|
613
|
-
function
|
|
614
|
+
function Nt(n, e = 1, t = 2) {
|
|
614
615
|
if (Array.isArray(n) && n.length >= e) {
|
|
615
616
|
for (let o = 0; o < n.length; o++)
|
|
616
617
|
if (!mt(n[o], t)) return !1;
|
|
617
618
|
} else return !1;
|
|
618
619
|
return !0;
|
|
619
620
|
}
|
|
620
|
-
function
|
|
621
|
+
function Bt(n, e, t) {
|
|
621
622
|
return Math.abs(n - e) <= t;
|
|
622
623
|
}
|
|
623
|
-
function
|
|
624
|
+
function qt(n, e) {
|
|
624
625
|
let t = !1;
|
|
625
626
|
const { x: i, y: o } = n, r = e.length;
|
|
626
627
|
for (let c = 0, s = r - 1; c < r; s = c++) {
|
|
@@ -629,7 +630,7 @@ function Nt(n, e) {
|
|
|
629
630
|
}
|
|
630
631
|
return t;
|
|
631
632
|
}
|
|
632
|
-
function
|
|
633
|
+
function $t(n, e, t, i) {
|
|
633
634
|
const o = Math.min(n[0], e[0]), r = Math.max(n[0], e[0]), c = Math.min(n[1], e[1]), s = Math.max(n[1], e[1]), a = [
|
|
634
635
|
[o, c],
|
|
635
636
|
// 左上
|
|
@@ -647,8 +648,8 @@ function Bt(n, e, t, i) {
|
|
|
647
648
|
const p = 1e-10;
|
|
648
649
|
let y = !1, w = !1;
|
|
649
650
|
for (const [P, k] of a) {
|
|
650
|
-
const
|
|
651
|
-
if (Math.abs(
|
|
651
|
+
const W = l * P + h * k + d;
|
|
652
|
+
if (Math.abs(W) < p || (W > p ? y = !0 : w = !0, y && w))
|
|
652
653
|
return !0;
|
|
653
654
|
}
|
|
654
655
|
return y && w;
|
|
@@ -656,7 +657,7 @@ function Bt(n, e, t, i) {
|
|
|
656
657
|
function tt(n) {
|
|
657
658
|
return Object.prototype.toString.call(n).slice(8, -1).toLowerCase();
|
|
658
659
|
}
|
|
659
|
-
function
|
|
660
|
+
function Yt(n) {
|
|
660
661
|
return [
|
|
661
662
|
"https:",
|
|
662
663
|
// HTTPS协议,用于安全地浏览网页
|
|
@@ -680,7 +681,7 @@ function qt(n) {
|
|
|
680
681
|
// VPN协议,用于创建安全的网络连接
|
|
681
682
|
].some((t) => n.startsWith(t));
|
|
682
683
|
}
|
|
683
|
-
function
|
|
684
|
+
function Xt(n) {
|
|
684
685
|
return new Promise((e, t) => {
|
|
685
686
|
if (typeof n != "string" || n.trim() === "" || !n.includes("://")) {
|
|
686
687
|
t(new Error("Invalid URL: Must be a non-empty string"));
|
|
@@ -788,7 +789,7 @@ const T = class T {
|
|
|
788
789
|
// 缓存文件扩展名的条目,以提高性能
|
|
789
790
|
C(T, "cachedEntries", Object.entries(Q));
|
|
790
791
|
let rt = T;
|
|
791
|
-
function
|
|
792
|
+
function Wt(n) {
|
|
792
793
|
if (typeof n != "function")
|
|
793
794
|
return console.error("非函数:", n);
|
|
794
795
|
const e = function(t) {
|
|
@@ -796,7 +797,7 @@ function Yt(n) {
|
|
|
796
797
|
};
|
|
797
798
|
requestIdleCallback(e);
|
|
798
799
|
}
|
|
799
|
-
function
|
|
800
|
+
function Ht(n, e) {
|
|
800
801
|
const t = +/* @__PURE__ */ new Date();
|
|
801
802
|
return new Promise((i, o) => {
|
|
802
803
|
const r = () => {
|
|
@@ -840,7 +841,7 @@ function ot(n, e, t = [], i = +/* @__PURE__ */ new Date()) {
|
|
|
840
841
|
}), n;
|
|
841
842
|
} else return e;
|
|
842
843
|
}
|
|
843
|
-
function
|
|
844
|
+
function Gt(n = "") {
|
|
844
845
|
return n + "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
845
846
|
const t = Math.random() * 16 | 0;
|
|
846
847
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
@@ -854,7 +855,7 @@ function dt(n, e) {
|
|
|
854
855
|
}, e);
|
|
855
856
|
};
|
|
856
857
|
}
|
|
857
|
-
function
|
|
858
|
+
function Vt(n, e) {
|
|
858
859
|
let t = -1 / 0;
|
|
859
860
|
return function(...i) {
|
|
860
861
|
const o = performance.now();
|
|
@@ -868,25 +869,25 @@ function Wt(n, e) {
|
|
|
868
869
|
}
|
|
869
870
|
};
|
|
870
871
|
}
|
|
871
|
-
function
|
|
872
|
+
function Zt(n, e, t) {
|
|
872
873
|
if (!n || !e) return n;
|
|
873
874
|
const i = e.split(".");
|
|
874
875
|
return i.reduce((o, r, c) => o.hasOwnProperty(r) ? o[r] : c === i.length - 1 ? o[r] = t : o[r] = {}, n);
|
|
875
876
|
}
|
|
876
|
-
function
|
|
877
|
+
function Kt(n, e) {
|
|
877
878
|
if (!n || !e) return n;
|
|
878
879
|
const t = e.split(".");
|
|
879
880
|
return t.reduce((i, o, r) => i.hasOwnProperty(o) ? i[o] : r == t.length - 1 ? void 0 : {}, n);
|
|
880
881
|
}
|
|
881
|
-
function
|
|
882
|
+
function Qt(n, e, t) {
|
|
882
883
|
if (!n || !e) return n;
|
|
883
884
|
const i = e.split(".");
|
|
884
885
|
return i.reduce((o, r, c) => (c === i.length - 1 && (o[r] = t), o.hasOwnProperty(r) ? o[r] : o[r] = {}), n);
|
|
885
886
|
}
|
|
886
|
-
function
|
|
887
|
+
function Jt(n) {
|
|
887
888
|
return n.map((e, t) => n.slice(t).concat(n.slice(0, t)));
|
|
888
889
|
}
|
|
889
|
-
function
|
|
890
|
+
function te(n) {
|
|
890
891
|
const e = window.structuredClone, t = (i, o = /* @__PURE__ */ new WeakMap()) => {
|
|
891
892
|
const r = i;
|
|
892
893
|
if (r === null || typeof r != "object")
|
|
@@ -976,7 +977,7 @@ function Qt(n) {
|
|
|
976
977
|
return console.error("structuredClone error:", i), e && t(n);
|
|
977
978
|
}
|
|
978
979
|
}
|
|
979
|
-
function
|
|
980
|
+
function ee(n, e, t = 30) {
|
|
980
981
|
if (typeof n != "function")
|
|
981
982
|
return console.error("第一个参数必须是一个函数。");
|
|
982
983
|
if (!Array.isArray(e))
|
|
@@ -1000,7 +1001,7 @@ function Jt(n, e, t = 30) {
|
|
|
1000
1001
|
), a;
|
|
1001
1002
|
};
|
|
1002
1003
|
}
|
|
1003
|
-
function
|
|
1004
|
+
function ne(n) {
|
|
1004
1005
|
const e = Date.now();
|
|
1005
1006
|
let t = performance.now();
|
|
1006
1007
|
for (; Date.now() - e < n; ) {
|
|
@@ -1013,7 +1014,7 @@ function te(n) {
|
|
|
1013
1014
|
}
|
|
1014
1015
|
return Date.now() - e;
|
|
1015
1016
|
}
|
|
1016
|
-
function
|
|
1017
|
+
function ie(n) {
|
|
1017
1018
|
const e = dt(n, 100);
|
|
1018
1019
|
let t = 0, i = 0;
|
|
1019
1020
|
return function(o) {
|
|
@@ -1042,7 +1043,7 @@ function ee(n) {
|
|
|
1042
1043
|
p(), y();
|
|
1043
1044
|
};
|
|
1044
1045
|
}
|
|
1045
|
-
function
|
|
1046
|
+
function re(n, e, t) {
|
|
1046
1047
|
const { isClickAllowed: i, uiLibrary: o = ["naiveUI", "ElementPlus", "Element"] } = t || {}, r = function(a) {
|
|
1047
1048
|
const l = [];
|
|
1048
1049
|
for (const h in a)
|
|
@@ -1074,13 +1075,13 @@ function ne(n, e, t) {
|
|
|
1074
1075
|
() => document.addEventListener("mousedown", s)
|
|
1075
1076
|
);
|
|
1076
1077
|
}
|
|
1077
|
-
var b, R,
|
|
1078
|
-
class
|
|
1078
|
+
var b, R, S, D, z, F, L, A, N;
|
|
1079
|
+
class oe {
|
|
1079
1080
|
constructor() {
|
|
1080
1081
|
f(this, b);
|
|
1081
1082
|
f(this, R, !1);
|
|
1082
|
-
f(this,
|
|
1083
|
-
f(this,
|
|
1083
|
+
f(this, S, {});
|
|
1084
|
+
f(this, D, 0);
|
|
1084
1085
|
f(this, z, 0);
|
|
1085
1086
|
f(this, F, 0);
|
|
1086
1087
|
f(this, L, 0);
|
|
@@ -1088,7 +1089,7 @@ class ie {
|
|
|
1088
1089
|
f(this, N);
|
|
1089
1090
|
}
|
|
1090
1091
|
init(e, t) {
|
|
1091
|
-
m(this, b, e), m(this, A, t == null ? void 0 : t.limit), m(this, N, t == null ? void 0 : t.dragDom), m(this,
|
|
1092
|
+
m(this, b, e), m(this, A, t == null ? void 0 : t.limit), m(this, N, t == null ? void 0 : t.dragDom), m(this, S, {
|
|
1092
1093
|
mousedown: this.mousedown.bind(this),
|
|
1093
1094
|
mousemove: this.mousemove.bind(this),
|
|
1094
1095
|
mouseup: this.mouseup.bind(this)
|
|
@@ -1100,7 +1101,7 @@ class ie {
|
|
|
1100
1101
|
bindOrUnbindEvent(e) {
|
|
1101
1102
|
const t = e === "bind" ? "addEventListener" : "removeEventListener";
|
|
1102
1103
|
if (!u(this, b)) return console.error("No DOM");
|
|
1103
|
-
u(this, b)[t]("mousedown", u(this,
|
|
1104
|
+
u(this, b)[t]("mousedown", u(this, S).mousedown), document[t]("mousemove", u(this, S).mousemove), document[t]("mouseup", u(this, S).mouseup);
|
|
1104
1105
|
}
|
|
1105
1106
|
alterLocation() {
|
|
1106
1107
|
if (!u(this, b)) return console.error("No DOM");
|
|
@@ -1111,22 +1112,22 @@ class ie {
|
|
|
1111
1112
|
if (u(this, N) && e.target != u(this, N)) return;
|
|
1112
1113
|
document.body.classList.add("no-select"), m(this, R, !0);
|
|
1113
1114
|
const t = u(this, b).getBoundingClientRect(), { pageX: i, pageY: o } = e;
|
|
1114
|
-
m(this,
|
|
1115
|
+
m(this, D, i), m(this, z, o), m(this, F, t.y), m(this, L, t.x);
|
|
1115
1116
|
}
|
|
1116
1117
|
mousemove(e) {
|
|
1117
1118
|
const { pageX: t, pageY: i } = e;
|
|
1118
|
-
u(this, R) && (m(this, F, u(this, F) + (i - u(this, z))), m(this, L, u(this, L) + (t - u(this,
|
|
1119
|
+
u(this, R) && (m(this, F, u(this, F) + (i - u(this, z))), m(this, L, u(this, L) + (t - u(this, D))), m(this, D, t), m(this, z, i), this.alterLocation());
|
|
1119
1120
|
}
|
|
1120
1121
|
mouseup() {
|
|
1121
1122
|
u(this, R) && (m(this, R, !1), document.body.classList.remove("no-select"));
|
|
1122
1123
|
}
|
|
1123
1124
|
}
|
|
1124
|
-
b = new WeakMap(), R = new WeakMap(),
|
|
1125
|
-
var _,
|
|
1126
|
-
class
|
|
1125
|
+
b = new WeakMap(), R = new WeakMap(), S = new WeakMap(), D = new WeakMap(), z = new WeakMap(), F = new WeakMap(), L = new WeakMap(), A = new WeakMap(), N = new WeakMap();
|
|
1126
|
+
var _, j, U, B, q, E, M, x, $, Y;
|
|
1127
|
+
class se {
|
|
1127
1128
|
constructor() {
|
|
1128
1129
|
f(this, _);
|
|
1129
|
-
f(this,
|
|
1130
|
+
f(this, j, !1);
|
|
1130
1131
|
f(this, U, {});
|
|
1131
1132
|
f(this, B, 0);
|
|
1132
1133
|
f(this, q, 0);
|
|
@@ -1172,7 +1173,7 @@ class re {
|
|
|
1172
1173
|
}
|
|
1173
1174
|
mousedown(e) {
|
|
1174
1175
|
if (!u(this, _)) return console.error("No DOM");
|
|
1175
|
-
document.body.classList.add("no-select"), m(this,
|
|
1176
|
+
document.body.classList.add("no-select"), m(this, j, !0);
|
|
1176
1177
|
const t = u(this, _).getBoundingClientRect();
|
|
1177
1178
|
m(this, q, t.y), m(this, B, t.x);
|
|
1178
1179
|
const { pageX: i, pageY: o } = e;
|
|
@@ -1180,13 +1181,13 @@ class re {
|
|
|
1180
1181
|
}
|
|
1181
1182
|
mousemove(e) {
|
|
1182
1183
|
const { pageX: t, pageY: i } = e;
|
|
1183
|
-
u(this,
|
|
1184
|
+
u(this, j) && (m(this, E, i - u(this, q)), m(this, M, t - u(this, B)), this.alterLocation());
|
|
1184
1185
|
}
|
|
1185
1186
|
mouseup() {
|
|
1186
|
-
u(this,
|
|
1187
|
+
u(this, j) && (m(this, j, !1), document.body.classList.remove("no-select"), u(this, Y) && u(this, Y).call(this, this.updateValue()));
|
|
1187
1188
|
}
|
|
1188
1189
|
}
|
|
1189
|
-
_ = new WeakMap(),
|
|
1190
|
+
_ = new WeakMap(), j = new WeakMap(), U = new WeakMap(), B = new WeakMap(), q = new WeakMap(), E = new WeakMap(), M = new WeakMap(), x = new WeakMap(), $ = new WeakMap(), Y = new WeakMap();
|
|
1190
1191
|
function K(n) {
|
|
1191
1192
|
if (typeof n == "string") {
|
|
1192
1193
|
const e = document.querySelector(n);
|
|
@@ -1207,12 +1208,12 @@ function ct(n) {
|
|
|
1207
1208
|
const e = K(n), t = document, i = document.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement;
|
|
1208
1209
|
return e == i || !n && window.innerWidth == screen.width && window.innerHeight == screen.height;
|
|
1209
1210
|
}
|
|
1210
|
-
function
|
|
1211
|
+
function ce(n) {
|
|
1211
1212
|
return n = K(n), function() {
|
|
1212
1213
|
ct(n) ? pt() : ft(n);
|
|
1213
1214
|
};
|
|
1214
1215
|
}
|
|
1215
|
-
function
|
|
1216
|
+
function ae(n, e) {
|
|
1216
1217
|
const t = K(e), i = () => {
|
|
1217
1218
|
n(ct(t));
|
|
1218
1219
|
};
|
|
@@ -1220,7 +1221,7 @@ function se(n, e) {
|
|
|
1220
1221
|
document.removeEventListener("fullscreenchange", i), document.removeEventListener("webkitfullscreenchange", i), document.removeEventListener("mozfullscreenchange", i), document.removeEventListener("MSFullscreenChange", i);
|
|
1221
1222
|
};
|
|
1222
1223
|
}
|
|
1223
|
-
function
|
|
1224
|
+
function le(n, e) {
|
|
1224
1225
|
if (typeof n == "number") return n;
|
|
1225
1226
|
if (/px/.test(n)) return Number(n.replace(/px/, "")) || 0;
|
|
1226
1227
|
const t = document.createElement("div");
|
|
@@ -1228,7 +1229,7 @@ function ce(n, e) {
|
|
|
1228
1229
|
const i = t.getBoundingClientRect().width;
|
|
1229
1230
|
return e.removeChild(t), i;
|
|
1230
1231
|
}
|
|
1231
|
-
function
|
|
1232
|
+
function ue(n, e) {
|
|
1232
1233
|
if (!n) return;
|
|
1233
1234
|
let t, i;
|
|
1234
1235
|
if (typeof e == "string") {
|
|
@@ -1245,7 +1246,7 @@ function ae(n, e) {
|
|
|
1245
1246
|
const o = t / i;
|
|
1246
1247
|
return o > n ? [n * i, i] : o < n ? [t, t / n] : [t, i];
|
|
1247
1248
|
}
|
|
1248
|
-
function
|
|
1249
|
+
function he(n, e = 5e3) {
|
|
1249
1250
|
return new Promise((t, i) => {
|
|
1250
1251
|
const o = new Image();
|
|
1251
1252
|
o.src = n;
|
|
@@ -1261,7 +1262,7 @@ function le(n, e = 5e3) {
|
|
|
1261
1262
|
}, o.crossOrigin = "Anonymous";
|
|
1262
1263
|
});
|
|
1263
1264
|
}
|
|
1264
|
-
function
|
|
1265
|
+
function me(n) {
|
|
1265
1266
|
return new Promise((e, t) => {
|
|
1266
1267
|
fetch(n).then((i) => e(i.text())).catch((i) => {
|
|
1267
1268
|
console.error("Error fetching :", i), t(i);
|
|
@@ -1280,7 +1281,7 @@ function gt(n, e) {
|
|
|
1280
1281
|
}
|
|
1281
1282
|
});
|
|
1282
1283
|
}
|
|
1283
|
-
function
|
|
1284
|
+
function de(n, e, t) {
|
|
1284
1285
|
if (!t) {
|
|
1285
1286
|
let r = e.replace(/^[^.]+./, "");
|
|
1286
1287
|
r = r == e ? "text/plain" : "application/" + r, t = { type: r };
|
|
@@ -1289,15 +1290,15 @@ function he(n, e, t) {
|
|
|
1289
1290
|
gt(o, e);
|
|
1290
1291
|
}
|
|
1291
1292
|
const wt = Math.PI / 2, V = Math.PI / 180, Z = 6378137, xt = 85.05112878;
|
|
1292
|
-
function
|
|
1293
|
+
function fe(n, e) {
|
|
1293
1294
|
const t = Math.max(Math.min(n, 180), -180), i = Math.max(Math.min(e, xt), -85.05112878), o = t * V * Z, r = i * V, c = Math.log(Math.tan(Math.PI / 4 + r / 2)) * Z;
|
|
1294
1295
|
return [o, c];
|
|
1295
1296
|
}
|
|
1296
|
-
function
|
|
1297
|
+
function pe(n, e) {
|
|
1297
1298
|
const t = n / Z / V, i = (2 * Math.atan(Math.exp(e / Z)) - wt) / V;
|
|
1298
1299
|
return [t, i];
|
|
1299
1300
|
}
|
|
1300
|
-
function
|
|
1301
|
+
function ge(n, e, t) {
|
|
1301
1302
|
const [i, o] = n, [r, c] = e, [s, a] = t, l = (s - r) ** 2 + (a - c) ** 2;
|
|
1302
1303
|
if (l === 0) return Math.sqrt((i - r) ** 2 + (o - c) ** 2);
|
|
1303
1304
|
let h = ((i - r) * (s - r) + (o - c) * (a - c)) / l;
|
|
@@ -1305,21 +1306,21 @@ function fe(n, e, t) {
|
|
|
1305
1306
|
(i - (r + h * (s - r))) ** 2 + (o - (c + h * (a - c))) ** 2
|
|
1306
1307
|
);
|
|
1307
1308
|
}
|
|
1308
|
-
function
|
|
1309
|
+
function we(n, e, t, i, o, r = 1, c = 1) {
|
|
1309
1310
|
const s = n + t * Math.cos(i) * r, a = e + t * Math.sin(i) * c, l = n + t * Math.cos(o) * r, h = e + t * Math.sin(o) * c;
|
|
1310
1311
|
return [
|
|
1311
1312
|
[s, a],
|
|
1312
1313
|
[l, h]
|
|
1313
1314
|
];
|
|
1314
1315
|
}
|
|
1315
|
-
function
|
|
1316
|
+
function xe(n, e, t, i) {
|
|
1316
1317
|
return Math.hypot(Math.abs(t - n), Math.abs(i - e));
|
|
1317
1318
|
}
|
|
1318
|
-
function
|
|
1319
|
+
function ye(n, e, t, i) {
|
|
1319
1320
|
const o = (n + t) / 2, r = (e + i) / 2;
|
|
1320
1321
|
return { x: o, y: r };
|
|
1321
1322
|
}
|
|
1322
|
-
function
|
|
1323
|
+
function ve(n, e, t, i) {
|
|
1323
1324
|
const [o, r] = n, [c, s] = e;
|
|
1324
1325
|
let a = 1 / 0;
|
|
1325
1326
|
if (c !== 0) {
|
|
@@ -1332,7 +1333,7 @@ function xe(n, e, t, i) {
|
|
|
1332
1333
|
}
|
|
1333
1334
|
return a === 1 / 0 ? n : [o + c * a, r + s * a];
|
|
1334
1335
|
}
|
|
1335
|
-
class
|
|
1336
|
+
class O {
|
|
1336
1337
|
constructor(e, t) {
|
|
1337
1338
|
C(this, "resolve");
|
|
1338
1339
|
C(this, "reject");
|
|
@@ -1349,7 +1350,7 @@ class D {
|
|
|
1349
1350
|
}) : e ? (t = this.resolve) == null || t.call(this) : (i = this.reject) == null || i.call(this), e;
|
|
1350
1351
|
}
|
|
1351
1352
|
}
|
|
1352
|
-
class yt extends
|
|
1353
|
+
class yt extends O {
|
|
1353
1354
|
constructor(e) {
|
|
1354
1355
|
super(), this.resolve = e;
|
|
1355
1356
|
}
|
|
@@ -1358,17 +1359,17 @@ class yt extends D {
|
|
|
1358
1359
|
var i, o;
|
|
1359
1360
|
return (o = (i = X.tips).warning) == null ? void 0 : o.call(i, ...e);
|
|
1360
1361
|
};
|
|
1361
|
-
return new
|
|
1362
|
+
return new O(this.resolve, t);
|
|
1362
1363
|
}
|
|
1363
1364
|
error(...e) {
|
|
1364
1365
|
const t = () => {
|
|
1365
1366
|
var i, o;
|
|
1366
1367
|
return (o = (i = X.tips).error) == null ? void 0 : o.call(i, ...e);
|
|
1367
1368
|
};
|
|
1368
|
-
return new
|
|
1369
|
+
return new O(this.resolve, t);
|
|
1369
1370
|
}
|
|
1370
1371
|
}
|
|
1371
|
-
class vt extends
|
|
1372
|
+
class vt extends O {
|
|
1372
1373
|
constructor(e) {
|
|
1373
1374
|
super(), this.reject = e;
|
|
1374
1375
|
}
|
|
@@ -1377,14 +1378,14 @@ class vt extends D {
|
|
|
1377
1378
|
var i, o;
|
|
1378
1379
|
return (o = (i = X.tips).info) == null ? void 0 : o.call(i, ...e);
|
|
1379
1380
|
};
|
|
1380
|
-
return new
|
|
1381
|
+
return new O(t, this.reject);
|
|
1381
1382
|
}
|
|
1382
1383
|
success(...e) {
|
|
1383
1384
|
const t = () => {
|
|
1384
1385
|
var i, o;
|
|
1385
1386
|
return (o = (i = X.tips).success) == null ? void 0 : o.call(i, ...e);
|
|
1386
1387
|
};
|
|
1387
|
-
return new
|
|
1388
|
+
return new O(t, this.reject);
|
|
1388
1389
|
}
|
|
1389
1390
|
}
|
|
1390
1391
|
const g = class g {
|
|
@@ -1428,67 +1429,73 @@ C(g, "tips", {
|
|
|
1428
1429
|
}), C(g, "info", g.resolveTip("info")), C(g, "success", g.resolveTip("success")), C(g, "warning", g.rejectTip("warning")), C(g, "error", g.rejectTip("error"));
|
|
1429
1430
|
let X = g;
|
|
1430
1431
|
export {
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1432
|
+
ut as EXTENSION_TO_MIME,
|
|
1433
|
+
Q as FILE_EXTENSIONS,
|
|
1434
|
+
st as PAPER_SIZE_DEFINITIONS,
|
|
1435
|
+
Et as PAPER_SIZE_OPTIONS,
|
|
1436
|
+
it as UNIT_LABELS,
|
|
1437
|
+
_t as WINDOW_TARGET,
|
|
1438
|
+
Ct as _Animate_CreateOscillator,
|
|
1439
|
+
Ft as _Animate_NumericTransition,
|
|
1440
|
+
Mt as _Animate_Schedule,
|
|
1441
|
+
Lt as _Blob_ConvertDataToImageUrl,
|
|
1442
|
+
At as _Browser_CalculatePrintableArea,
|
|
1443
|
+
Tt as _Browser_CopyToClipboard,
|
|
1444
|
+
Pt as _Browser_GetFrameRate,
|
|
1438
1445
|
ht as _Browser_KeyedWindowManager,
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1446
|
+
ue as _Element_CalculateCanvasSize,
|
|
1447
|
+
re as _Element_CloseOnOutsideClick,
|
|
1448
|
+
oe as _Element_Drag,
|
|
1442
1449
|
ft as _Element_EnterFullscreen,
|
|
1443
1450
|
pt as _Element_ExitFullscreen,
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1451
|
+
ce as _Element_Fullscreen,
|
|
1452
|
+
ae as _Element_FullscreenObserver,
|
|
1453
|
+
le as _Element_GetOtherSizeInPixels,
|
|
1447
1454
|
ct as _Element_IsFullscreen,
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1455
|
+
he as _Element_LoadImage,
|
|
1456
|
+
se as _Element_LocalDrag,
|
|
1457
|
+
ie as _Element_ScrollEndListener,
|
|
1458
|
+
de as _File_CreateAndDownload,
|
|
1452
1459
|
gt as _File_Download,
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1460
|
+
me as _File_Read,
|
|
1461
|
+
Ot as _Format_CamelCase,
|
|
1462
|
+
It as _Format_CapitalizeFirstLetter,
|
|
1463
|
+
Dt as _Format_ExcludeSubstring,
|
|
1464
|
+
Ut as _Format_FileSize,
|
|
1458
1465
|
J as _Format_HrefName,
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1466
|
+
St as _Format_NumberWithCommas,
|
|
1467
|
+
jt as _Format_NumberWithUnit,
|
|
1468
|
+
Rt as _Format_Percentage,
|
|
1469
|
+
kt as _Format_Timestamp,
|
|
1470
|
+
xe as _Math_CalculateDistance2D,
|
|
1471
|
+
we as _Math_GetArcPoints,
|
|
1472
|
+
ve as _Math_GetBoundaryIntersection,
|
|
1473
|
+
ye as _Math_GetMidpoint,
|
|
1474
|
+
fe as _Math_LngLatToPlane,
|
|
1475
|
+
pe as _Math_PlaneToLngLat,
|
|
1476
|
+
ge as _Math_PointToLineDistance,
|
|
1470
1477
|
X as _Tip,
|
|
1471
|
-
|
|
1478
|
+
te as _Utility_Clone,
|
|
1472
1479
|
dt as _Utility_Debounce,
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1480
|
+
Wt as _Utility_ExecuteWhenIdle,
|
|
1481
|
+
Gt as _Utility_GenerateUUID,
|
|
1482
|
+
Kt as _Utility_GetTargetByPath,
|
|
1483
|
+
Zt as _Utility_InitTargetByPath,
|
|
1477
1484
|
ot as _Utility_MergeObjects,
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
+
Jt as _Utility_RotateList,
|
|
1486
|
+
Qt as _Utility_SetTargetByPath,
|
|
1487
|
+
ne as _Utility_Sleep,
|
|
1488
|
+
Vt as _Utility_Throttle,
|
|
1489
|
+
ee as _Utility_TimeConsumption,
|
|
1490
|
+
Ht as _Utility_WaitForCondition,
|
|
1491
|
+
Xt as _Valid_CheckConnectionWithXHR,
|
|
1485
1492
|
tt as _Valid_DataType,
|
|
1486
|
-
|
|
1493
|
+
$t as _Valid_DoesInfiniteLineIntersectRectangle,
|
|
1487
1494
|
rt as _Valid_FileTypeChecker,
|
|
1488
|
-
|
|
1489
|
-
|
|
1495
|
+
Nt as _Valid_Is2DNumberArray,
|
|
1496
|
+
Bt as _Valid_IsInMargin,
|
|
1490
1497
|
mt as _Valid_IsNumberArray,
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1498
|
+
zt as _Valid_IsObject,
|
|
1499
|
+
qt as _Valid_IsPointInPolygon,
|
|
1500
|
+
Yt as _Valid_IsSecureContext
|
|
1494
1501
|
};
|