nhanh-pure-function 3.0.1 → 3.0.2

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.
@@ -48,17 +48,25 @@ export declare class _Element_LocalDrag {
48
48
  mouseup(): void;
49
49
  }
50
50
  /** 进入全屏模式 */
51
- export declare function _Element_EnterFullscreen(content?: HTMLElement): Promise<void>;
51
+ export declare function _Element_EnterFullscreen(content?: HTMLElement | string): Promise<void>;
52
52
  /** 退出全屏模式 */
53
53
  export declare function _Element_ExitFullscreen(): Promise<void>;
54
54
  /** 判断是否处于全屏模式 */
55
- export declare function _Element_IsFullscreen(content?: HTMLElement): boolean;
55
+ export declare function _Element_IsFullscreen(content?: HTMLElement | string): boolean;
56
56
  /**
57
57
  * 返回一个用于切换全屏模式的函数
58
58
  * @param {HTMLElement} content - 需要进入全屏的元素
59
59
  * 该函数通过检查不同浏览器的特定方法来实现全屏切换
60
60
  */
61
- export declare function _Element_Fullscreen(content?: HTMLElement): () => void;
61
+ export declare function _Element_Fullscreen(content?: HTMLElement | string): () => void;
62
+ /**
63
+ * 元素全屏状态观察器
64
+ * 监听元素的全屏状态变化,并通过回调函数通知状态改变
65
+ * @param notify - 全屏状态变化回调函数,接收一个布尔值参数表示当前是否为全屏状态
66
+ * @param selectors - 要观察的元素或元素选择器,默认为document.documentElement
67
+ * @returns 返回一个清理函数,调用后可移除所有事件监听器
68
+ */
69
+ export declare function _Element_FullscreenObserver(notify: (isFull: boolean) => void, selectors?: HTMLElement | string): () => void;
62
70
  /**
63
71
  * 单位转换 12** -> **px
64
72
  * @param {string} width
package/dist/index.cjs.js CHANGED
@@ -1,3 +1,3 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".nhanh-pure-function{--nhanh: 2233}.no-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}")),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
2
- "use strict";var ft=Object.defineProperty;var nt=n=>{throw TypeError(n)};var dt=(n,t,e)=>t in n?ft(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var F=(n,t,e)=>dt(n,typeof t!="symbol"?t+"":t,e),it=(n,t,e)=>t.has(n)||nt("Cannot "+e);var a=(n,t,e)=>(it(n,t,"read from private field"),e?e.call(n):t.get(n)),h=(n,t,e)=>t.has(n)?nt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),f=(n,t,e,i)=>(it(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ht(n,t=500){let e,i=!0;function r(o){if(!i)return;e||(e=o);let s=Math.min((o-e)/t,1);n(s),o-e<t&&requestAnimationFrame(r)}return requestAnimationFrame(r),()=>i=!1}function pt(n,t,e,i,r=2){let o=n,s=!1,c=1,u=n,l=t,m=e;const d=()=>{const y=(l-u)/m;return Number(y.toFixed(r))};let _=d();const x=y=>Math.min(Math.max(y,u),l),E=y=>Number(y.toFixed(r)),U=(y,W,H)=>{const I=[];return y>=W&&I.push("最小值必须小于最大值"),H<=0?I.push("分段数必须为正数"):d()==0&&I.push("数值精度过低,致使动画步长为 0"),I},k=(y,W,H)=>{const I=U(y,W,H);return I.length>0?(console.error(`参数更新失败: ${I.join("; ")}`),!1):(u=y,l=W,m=H,_=d(),o=x(o),!0)},V=()=>{s&&(c=o>=l?-1:o<=u?1:c,o=x(o+_*c),i(E(o)),requestAnimationFrame(V))};return{play(y=o){if(o=x(y),U(u,l,m).length)return console.error("配置参数错误",this.getParams());s||(s=!0,V())},pause(){s=!1},getCurrent:()=>E(o),isPlaying:()=>s,updateParams:k,getParams:()=>({min:u,max:l,steps:m,precision:r,stepSize:_})}}function _t(n,t,e,i,r=2){if(e<=0)return console.error("动画步数 必须为正数");const o=d=>Number(d.toFixed(r)),s=t-n,c=o(Math.abs(s)/e);if(c===0)return console.error("数值精度过低,致使动画步长为 0");const u=Math.sign(s);let l=n;const m=()=>{l=o(l+c*u),(u>0?l<t:l>t)?(i(l),requestAnimationFrame(m)):i(t)};m()}function gt(n,t="image/png"){try{let e,i=t;if(n instanceof File)return URL.createObjectURL(n);if(typeof n=="string"){let o=n;const s=o.match(/^data:([^;]*)(;base64)?,(.*)$/i);if(s){if(!s[2])return console.error("无效的数据 URL:缺少 base64 编码声明");if(i=s[1]||i,o=s[3],!o)return console.error("数据 URL 包含空有效负载")}o=o.replace(/[^A-Za-z0-9+/=]/g,"");const c=atob(o);e=new Uint8Array(c.length);for(let u=0;u<c.length;u++)e[u]=c.charCodeAt(u)}else if(n instanceof ArrayBuffer)e=new Uint8Array(n);else if(n instanceof Uint8Array)e=n;else return console.error("不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array");const r=new Blob([e],{type:i});return URL.createObjectURL(r)}catch(e){return console.error("数据到 ImageURL 的转换失败:",e.message,e.stack||"没有可用的堆栈跟踪"),null}}function yt(n,t=10){let e=0,i=t;function r(){if(i>0)i--,requestAnimationFrame(r);else{const s=(+new Date-e)/t,c=1e3/s;n(Number(c.toFixed(2)),Number(s.toFixed(2)))}}requestAnimationFrame(()=>{e=+new Date,r()})}function xt(n){const t=()=>Promise.resolve(),e=c=>(console.error(c),Promise.reject(c));function i(){return navigator.clipboard.writeText(n).then(t).catch(e)}function r(){const c=document.createElement("div");c.innerText=n,document.body.appendChild(c);const u=document.createRange();u.selectNodeContents(c);const l=window.getSelection();let m=!1;return l&&(l.removeAllRanges(),l.addRange(u),m=document.execCommand("copy")),document.body.removeChild(c),m?Promise.resolve():Promise.reject()}function o(){const c=document.createElement("textarea");c.value=n,document.body.appendChild(c),c.select(),c.setSelectionRange(0,n.length);let u=!1;return document.activeElement===c&&(u=document.execCommand("Copy",!0)),document.body.removeChild(c),u?Promise.resolve():Promise.reject()}function s(){return r().then(t).catch(()=>{o().then(t).catch(()=>e("复制方式尽皆失效"))})}return navigator.clipboard?i().catch(s):s()}class ot{constructor(){}static add(t,e){this.keys.set(t,e)}static open(t,e,i,r){const o=this.keys.get(t);if(o&&!o.closed)return o.focus(),o;{const s=window.open(e,i,r);if(s)return this.keys.set(t,s),s;console.error("window.open failed: 可能是浏览器阻止了弹出窗口"),this.keys.delete(t)}}static isOpen(t){const e=this.keys.get(t);return e!=null&&e.closed&&this.keys.delete(t),this.keys.has(t)}static getWindow(t){if(this.isOpen(t))return this.keys.get(t)}static close(t){const e=this.keys.get(t);e&&(e.close(),this.keys.delete(t))}static closeAll(){this.keys.forEach((t,e)=>t.close()),this.keys.clear()}}F(ot,"keys",new Map);const wt={".mp3":"audio/mpeg",".mp4":"video/mp4",".m4a":"audio/mp4",".aac":"audio/aac",".ogg":"audio/ogg",".wav":"audio/wav",".flac":"audio/flac",".opus":"audio/opus",".webm":"video/webm",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".bmp":"image/bmp",".tiff":"image/tiff",".ico":"image/vnd.microsoft.icon",".svg":"image/svg+xml",".webp":"image/webp",".heif":"image/heif",".heic":"image/heic",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript",".ts":"application/typescript",".csv":"text/csv",".tsv":"text/tab-separated-values",".txt":"text/plain",".md":"text/markdown",".rtf":"application/rtf",".pdf":"application/pdf",".zip":"application/zip",".rar":"application/x-rar-compressed",".tar":"application/x-tar",".gz":"application/gzip",".7z":"application/x-7z-compressed",".exe":"application/x-msdownload",".apk":"application/vnd.android.package-archive",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".odt":"application/vnd.oasis.opendocument.text",".ods":"application/vnd.oasis.opendocument.spreadsheet",".odp":"application/vnd.oasis.opendocument.presentation",".jsonld":"application/ld+json",".yaml":"application/x-yaml",".yml":"application/x-yaml",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject",".map":"application/json"},Q={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"]},rt=["","万","亿","兆","京","垓","秭","穰","沟","涧","正","载","极"];function bt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function vt(n,t,e=2){return!Number.isFinite(n)||!Number.isFinite(t)||!Number.isFinite(e)?(console.error("所有参数必须是有限的数字"),""):t===0?(console.error("分母不能为零"),""):e<0?(console.error("小数位数不能为负数"),""):(n/t*100).toFixed(e)+"%"}function Mt(n){const e=n.toString().split("."),i=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");return e.length>1?i+"."+e[1]:i}function Et(n,t){const e={join:!0,suffix:"",decimalPlaces:2},{join:i,suffix:r,decimalPlaces:o}={...e,...t||{}},s=Number(n);if(isNaN(s))return i?`0${r}`:[0,r];const c=Math.abs(s),u=s>=0,l=Math.max(0,Math.floor(Math.log10(c)/4)),m=Math.pow(1e4,l),d=c/m,_=(u?1:-1)*parseFloat(d.toFixed(Math.max(0,o)));return i?`${_}${rt[l]}${r}`:[_,rt[l]+r]}function Ft(n){const t=["B","KB","MB","GB","TB","PB"];let e=0;for(;n>1024;)n/=1024,e++;return`${Math.round(n*100)/100} ${t[e]}`}function Ct(n,t="YYYY-MM-DD hh:mm:ss",e=!0){const i=new Date(n);if(isNaN(i.getTime()))return console.error("Invalid date"),"";const r={YYYY:o=>o.getFullYear(),MM:o=>o.getMonth()+1,DD:o=>o.getDate(),hh:o=>o.getHours(),mm:o=>o.getMinutes(),ss:o=>o.getSeconds(),ms:o=>o.getMilliseconds()};return t.replace(/YYYY|MM|DD|hh|mm|ss|ms/g,o=>{const s=r[o](i);return e?String(s).padStart(2,"0"):String(s)})}function G(n,t="file"){if(!n||(n=String(n).trim(),n===""))return t;const e=n.split("/");return e[e.length-1].split("?")[0]}function Tt(n,t){return n=n.replace(/([^a-zA-Z][a-z])/g,e=>e.toUpperCase()),t?n.replace(/[^a-zA-Z]+/g,""):n}function Ut(n,t,e=","){const i=new RegExp(`(^|${e})${t}(${e}|$)`,"g");return n.replace(i,function(r,o,s){return o===s?e:""})}function Lt(n){return!(n===null||typeof n!="object"||Array.isArray(n))}function st(n,t=2){if(Array.isArray(n)&&n.length>=t){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 Pt(n,t=1,e=2){if(Array.isArray(n)&&n.length>=t){for(let r=0;r<n.length;r++)if(!st(n[r],e))return!1}else return!1;return!0}function It(n,t,e){return Math.abs(n-t)<=e}function St(n,t){let e=!1;const{x:i,y:r}=n,o=t.length;for(let s=0,c=o-1;s<o;c=s++){const u=t[s].x,l=t[s].y,m=t[c].x,d=t[c].y;l>r!=d>r&&i<(m-u)*(r-l)/(d-l)+u&&(e=!e)}return e}function At(n,t,e,i){const r=Math.min(n[0],t[0]),o=Math.max(n[0],t[0]),s=Math.min(n[1],t[1]),c=Math.max(n[1],t[1]),u=[[r,s],[o,s],[o,c],[r,c]],l=i[1]-e[1],m=e[0]-i[0],d=i[0]*e[1]-e[0]*i[1];if(l===0&&m===0){const[U,k]=e;return U>=r&&U<=o&&k>=s&&k<=c}const _=1e-10;let x=!1,E=!1;for(const[U,k]of u){const V=l*U+m*k+d;if(Math.abs(V)<_||(V>_?x=!0:E=!0,x&&E))return!0}return x&&E}function tt(n){return Array.isArray(n)?"array":n===null?"null":typeof n}function Rt(n){return["https:","wss:","ftps:","sftp:","smpts:","smtp+tls:","imap+tls:","pop3+tls:","rdp:","vpn:"].some(e=>n.startsWith(e))}function Dt(n){return new Promise((t,e)=>{if(typeof n!="string"||n.trim()===""||!n.includes("://")){e(new Error("Invalid URL: Must be a non-empty string"));return}try{new XMLHttpRequest().open("HEAD",n,!0)}catch(o){e(new Error(`Invalid URL format: ${o.message}`));return}const i=new XMLHttpRequest;i.open("HEAD",n,!0);const r=o=>{e(new Error(`Request failed: ${o.type}`))};i.onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&(i.status===0?e(new Error("Network error or CORS blocked")):i.status>=200&&i.status<300?t(!0):e(new Error(`HTTP Error: ${i.status}`)))},i.onerror=r,i.onabort=r,i.ontimeout=r;try{i.send()}catch(o){e(new Error(`Request send failed: ${o.message}`))}})}const L=class L{constructor(){if(new.target===L)throw new Error("请直接使用静态方法,而不是实例化此类")}static check(t,e){if(!t||typeof t!="string")return console.error("Invalid URL provided"),e?!1:"unknown";const i=G(t).toLowerCase();if(e){if(!Q.hasOwnProperty(e))return console.error(`Unknown file type: ${e}`),"unknown";const r=Q[e];return L._checkExtension(i,r)}return L._detectFileType(i)}static parseAddresses(t){return!t||typeof t!="string"?(console.error("Invalid URL provided"),[]):t.split(",").map(e=>{const i=G(e),r=this.check(e);return{url:e,name:i,type:r}})}static matchesMimeType(t,e){if(!e)return!0;if(typeof t!="string"||typeof e!="string")return!1;const i=L._normalizeType(t),r=e.split(",").map(c=>L._normalizeType(c.trim())),[o,s="*"]=i.split("/");return r.some(c=>{const[u,l="*"]=c.split("/");return(u==="*"||o==="*"||u===o)&&(l==="*"||s==="*"||l===s)})}static _normalizeType(t){return t.startsWith(".")&&!t.includes("/")?wt[t.toLowerCase()]||t:t.includes("/")?t:`${t}/*`}static _checkExtension(t,e){return e.some(i=>t.endsWith(i))}static _detectFileType(t){for(const[e,i]of L.cachedEntries)if(i.some(r=>t.endsWith(r)))return e;return"unknown"}};F(L,"cachedEntries",Object.entries(Q));let et=L;function jt(n){if(typeof n!="function")return console.error("非函数:",n);const t=function(e){e.didTimeout||e.timeRemaining()<=0?requestIdleCallback(t):n()};requestIdleCallback(t)}function kt(n,t){const e=+new Date;return new Promise((i,r)=>{const o=()=>{if(+new Date-e>=t)return r("超时");if(n())return i("完成");requestIdleCallback(o)};o()})}function Z(n,t,e=[],i=+new Date){if(i<+new Date-50){console.error("_MergeObjects 合并异常:疑似死循环");return}const r=tt(n),o=tt(t);if(r!=o)return t;if(r=="object"||r=="array"){if(e.some(([s,c])=>s==n&&c==t))return n;if(e.push([n,t]),r=="object"){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const c=t[s],u=n[s],l=Z(u,c,e,i);n[s]=l}return n}else if(r=="array")return t.forEach((s,c)=>{const u=s,l=n[c],m=Z(l,u,e,i);n[c]=m}),n}else return t}function Ot(n=""){return n+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function ct(n,t){let e;return function(...i){clearTimeout(e),e=setTimeout(()=>{n(...i),e=void 0},t)}}function zt(n,t){let e=-1/0;return function(...i){const r=performance.now();if(r-e>t){e=r;try{n(...i)}catch(o){console.error("Throttled function execution failed:",o)}}}}function Nt(n,t,e){if(!n||!t)return n;const i=t.split(".");return i.reduce((r,o,s)=>r.hasOwnProperty(o)?r[o]:s===i.length-1?r[o]=e:r[o]={},n)}function qt(n,t){if(!n||!t)return n;const e=t.split(".");return e.reduce((i,r,o)=>i.hasOwnProperty(r)?i[r]:o==e.length-1?void 0:{},n)}function Bt(n,t,e){if(!n||!t)return n;const i=t.split(".");return i.reduce((r,o,s)=>(s===i.length-1&&(r[o]=e),r.hasOwnProperty(o)?r[o]:r[o]={}),n)}function Yt(n){return n.map((t,e)=>n.slice(e).concat(n.slice(0,e)))}function $t(n){const t=window.structuredClone,e=i=>i===null||typeof i!="object"?i:Z(Array.isArray(i)?[]:{},i);try{return t?t(n):e(n)}catch(i){return console.error("structuredClone error:",i),t&&e(n)}}function Xt(n,t,e=30){if(typeof n!="function")return console.error("第一个参数必须是一个函数。");if(!Array.isArray(t))return console.error("第二个参数必须是一个数组。");let i=[],r=0;const o=(s,c)=>{for(const[u,l]of c)if(s>=u)return l;return"black"};return function(...s){const c=performance.now(),u=n(...s),l=performance.now()-c;i.push(l),i.length>e&&i.shift(),r=i.reduce((_,x)=>_+x,0)/i.length||0;const m=o(l,t),d=o(r,t);return console.log(`%c单次耗时:${l.toFixed(2)}ms
3
- %c平均耗时(${i.length}次):${r.toFixed(2)}ms`,`color: ${m}; padding: 2px 0;`,`color: ${d}; padding: 2px 0;`),u}}function Vt(n){const t=Date.now();let e=performance.now();for(;Date.now()-t<n;){e=Math.sin(e)*1e6,(e>1e6||e<-1e6)&&(e=0);try{const i=e.toString().substring(0,8);history.replaceState(null,"",`#${i}`)}catch{}}return Date.now()-t}function Wt(n){const t=ct(n,100);let e=0,i=0;return function(r){const o=r.target;if(!o||!(o instanceof Element))return;const{scrollTop:s,scrollHeight:c,clientHeight:u,scrollLeft:l,scrollWidth:m,clientWidth:d}=o;function _(){if(e==s)return;const E=e>s;if(e=s,E)return;c-s-u<=1&&t("vertical")}function x(){if(i==l)return;const E=i>l;if(i=l,E)return;m-l-d<=1&&t("horizontal")}_(),x()}}function Ht(n,t,e){const{isClickAllowed:i,uiLibrary:r=["naiveUI","ElementPlus","Element"]}=e||{},o=function(u){const l=[];for(const m in u)Object.hasOwnProperty.call(u,m)&&r.includes(m)&&l.push(...u[m]);return l}({naiveUI:[".v-binder-follower-container",".n-image-preview-container",".n-modal-container"],ElementPlus:[".el-popper"],Element:[".el-popper"]});function s(){t(),document.removeEventListener("mousedown",c)}function c(u){if(i){const d=i(u);if(d)return;if(d===!1)return s()}const l=u.target;if(!(l instanceof Element)||!l.isConnected)return;n.concat(o).some(d=>!!(l!=null&&l.closest(d)))||s()}requestAnimationFrame(()=>document.addEventListener("mousedown",c))}var w,S,A,z,N,C,T,P,q;class Gt{constructor(){h(this,w);h(this,S,!1);h(this,A,{});h(this,z,0);h(this,N,0);h(this,C,0);h(this,T,0);h(this,P);h(this,q)}init(t,e){f(this,w,t),f(this,P,e==null?void 0:e.limit),f(this,q,e==null?void 0:e.dragDom),f(this,A,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(t){const e=t==="bind"?"addEventListener":"removeEventListener";if(!a(this,w))return console.error("No DOM");a(this,w)[e]("mousedown",a(this,A).mousedown),document[e]("mousemove",a(this,A).mousemove),document[e]("mouseup",a(this,A).mouseup)}alterLocation(){if(!a(this,w))return console.error("No DOM");a(this,P)&&(f(this,C,Math.min(a(this,C),a(this,P).max.top)),f(this,C,Math.max(a(this,C),a(this,P).min.top)),f(this,T,Math.min(a(this,T),a(this,P).max.left)),f(this,T,Math.max(a(this,T),a(this,P).min.left))),a(this,w).style.setProperty("--top",a(this,C)+"px"),a(this,w).style.setProperty("--left",a(this,T)+"px")}mousedown(t){if(!a(this,w))return console.error("No DOM");if(a(this,q)&&t.target!=a(this,q))return;document.body.classList.add("no-select"),f(this,S,!0);const e=a(this,w).getBoundingClientRect(),{pageX:i,pageY:r}=t;f(this,z,i),f(this,N,r),f(this,C,e.y),f(this,T,e.x)}mousemove(t){const{pageX:e,pageY:i}=t;a(this,S)&&(f(this,C,a(this,C)+(i-a(this,N))),f(this,T,a(this,T)+(e-a(this,z))),f(this,z,e),f(this,N,i),this.alterLocation())}mouseup(){a(this,S)&&(f(this,S,!1),document.body.classList.remove("no-select"))}}w=new WeakMap,S=new WeakMap,A=new WeakMap,z=new WeakMap,N=new WeakMap,C=new WeakMap,T=new WeakMap,P=new WeakMap,q=new WeakMap;var b,R,D,B,Y,v,M,g,$,X;class Zt{constructor(){h(this,b);h(this,R,!1);h(this,D,{});h(this,B,0);h(this,Y,0);h(this,v,0);h(this,M,0);h(this,g);h(this,$);h(this,X)}init(t,e={}){f(this,b,t),f(this,g,e.limit),f(this,$,e.update_move),f(this,X,e.update_up),f(this,D,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(t){const e=t==="bind"?"addEventListener":"removeEventListener";if(!a(this,b))return console.error("No DOM");a(this,b)[e]("mousedown",a(this,D).mousedown),document[e]("mousemove",a(this,D).mousemove),document[e]("mouseup",a(this,D).mouseup)}updateValue(){const t={top:a(this,v),left:a(this,M),percentage:{top:0,left:0}};if(a(this,g)){const e=i=>a(this,g)?(t[i]-a(this,g).min[i])/(a(this,g).max[i]-a(this,g).min[i]):0;t.percentage={top:e("top")||0,left:e("left")||0}}return t}alterLocation(){if(!a(this,b))return console.error("No DOM");a(this,g)&&(f(this,v,Math.min(a(this,v),a(this,g).max.top)),f(this,v,Math.max(a(this,v),a(this,g).min.top)),f(this,M,Math.min(a(this,M),a(this,g).max.left)),f(this,M,Math.max(a(this,M),a(this,g).min.left))),a(this,$)&&a(this,$).call(this,this.updateValue()),a(this,b).style.setProperty("--top",a(this,v)+"px"),a(this,b).style.setProperty("--left",a(this,M)+"px")}mousedown(t){if(!a(this,b))return console.error("No DOM");document.body.classList.add("no-select"),f(this,R,!0);const e=a(this,b).getBoundingClientRect();f(this,Y,e.y),f(this,B,e.x);const{pageX:i,pageY:r}=t;f(this,v,r-a(this,Y)),f(this,M,i-a(this,B)),this.alterLocation()}mousemove(t){const{pageX:e,pageY:i}=t;a(this,R)&&(f(this,v,i-a(this,Y)),f(this,M,e-a(this,B)),this.alterLocation())}mouseup(){a(this,R)&&(f(this,R,!1),document.body.classList.remove("no-select"),a(this,X)&&a(this,X).call(this,this.updateValue()))}}b=new WeakMap,R=new WeakMap,D=new WeakMap,B=new WeakMap,Y=new WeakMap,v=new WeakMap,M=new WeakMap,g=new WeakMap,$=new WeakMap,X=new WeakMap;function at(n){const t=n||document.documentElement;return t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():Promise.reject("No Fullscreen API")}function lt(){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 ut(n){const t=document,e=document.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement;return n?n==e:document.documentElement==e||screen.width==window.innerWidth&&screen.height==window.innerHeight}function Kt(n){return function(){ut(n)?lt():at(n)}}function Jt(n,t){if(typeof n=="number")return n;if(/px/.test(n))return Number(n.replace(/px/,""))||0;const e=document.createElement("div");e.style.width=n,t=t||document.body,t.appendChild(e);const i=e.getBoundingClientRect().width;return t.removeChild(e),i}function Qt(n,t){if(!n)return;let e,i;if(typeof t=="string"){const o=document.querySelector(t);if(!o)return;const s=o.getBoundingClientRect();e=s.width,i=s.height}else if(Array.isArray(t))e=t[0],i=t[1];else{const o=t.getBoundingClientRect();e=o.width,i=o.height}const r=e/i;return r>n?[n*i,i]:r<n?[e,e/n]:[e,i]}function te(n,t=5e3){return new Promise((e,i)=>{const r=new Image;r.src=n;const o=setTimeout(()=>{i(new Error("图片加载超时")),r.onload=null,r.onerror=null},t);r.onload=()=>{clearTimeout(o);const s=r.naturalWidth,c=r.naturalHeight,u=s/c;e([r,u])},r.onerror=()=>{clearTimeout(o),i(new Error("图片加载失败"))},r.crossOrigin="Anonymous"})}function ee(n){return new Promise((t,e)=>{fetch(n).then(i=>t(i.text())).catch(i=>{console.error("Error fetching :",i),e(i)})})}function mt(n,t){return new Promise((e,i)=>{try{t=t||G(n,"downloaded_file"),fetch(n).then(r=>(r.ok||i(`文件下载失败,状态码: ${r.status}`),r.blob())).then(r=>{const o=URL.createObjectURL(r),s=document.createElement("a");s.href=o,s.download=decodeURIComponent(t),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o),e(r)}).catch(i)}catch(r){i(r)}})}function ne(n,t,e){if(!e){let o=t.replace(/^[^.]+./,"");o=o==t?"text/plain":"application/"+o,e={type:o}}const i=new Blob(n,e),r=URL.createObjectURL(i);mt(r,t)}const ie=Math.PI/2,K=Math.PI/180,J=6378137,re=85.05112878;function oe(n,t){const e=Math.max(Math.min(n,180),-180),i=Math.max(Math.min(t,re),-85.05112878),r=e*K*J,o=i*K,s=Math.log(Math.tan(Math.PI/4+o/2))*J;return[r,s]}function se(n,t){const e=n/J/K,i=(2*Math.atan(Math.exp(t/J))-ie)/K;return[e,i]}function ce(n,t,e){const[i,r]=n,[o,s]=t,[c,u]=e,l=(c-o)**2+(u-s)**2;if(l===0)return Math.sqrt((i-o)**2+(r-s)**2);let m=((i-o)*(c-o)+(r-s)*(u-s))/l;return m=Math.max(0,Math.min(1,m)),Math.sqrt((i-(o+m*(c-o)))**2+(r-(s+m*(u-s)))**2)}function ae(n,t,e,i,r,o=1,s=1){const c=n+e*Math.cos(i)*o,u=t+e*Math.sin(i)*s,l=n+e*Math.cos(r)*o,m=t+e*Math.sin(r)*s;return[[c,u],[l,m]]}function le(n,t,e,i){return Math.sqrt(Math.pow(e-n,2)+Math.pow(i-t,2))}function ue(n,t,e,i){const r=(n+e)/2,o=(t+i)/2;return{x:r,y:o}}function me(n,t,e,i){const[r,o]=n,[s,c]=t;let u=1/0;if(s!==0){const l=s>0?(e-r)/s:-r/s;l>0&&(u=Math.min(u,l))}if(c!==0){const l=c>0?(i-o)/c:-o/c;l>0&&(u=Math.min(u,l))}return u===1/0?n:[r+s*u,o+c*u]}class O{constructor(t,e){F(this,"resolve");F(this,"reject");this.resolve=t,this.reject=e}run(t){var e,i;return t instanceof Promise?t.then(r=>{var o;return(o=this.resolve)==null||o.call(this),r}).catch(r=>{var o;return(o=this.reject)==null||o.call(this),Promise.reject(r)}):t?(e=this.resolve)==null||e.call(this):(i=this.reject)==null||i.call(this),t}}class fe extends O{constructor(t){super(),this.resolve=t}warning(...t){const e=()=>{var i,r;return(r=(i=j.tips).warning)==null?void 0:r.call(i,...t)};return new O(this.resolve,e)}error(...t){const e=()=>{var i,r;return(r=(i=j.tips).error)==null?void 0:r.call(i,...t)};return new O(this.resolve,e)}}class de extends O{constructor(t){super(),this.reject=t}info(...t){const e=()=>{var i,r;return(r=(i=j.tips).info)==null?void 0:r.call(i,...t)};return new O(e,this.reject)}success(...t){const e=()=>{var i,r;return(r=(i=j.tips).success)==null?void 0:r.call(i,...t)};return new O(e,this.reject)}}const p=class p{constructor(){if(new.target===p)throw new Error("请直接使用静态方法,而不是实例化此类")}static register(t,e){if(typeof e!="function")return console.error("TipHandler must be a function");p.tips[t]=e}static resolveTip(t){return function(...e){const i=()=>{var r,o;return(o=(r=p.tips)[t])==null?void 0:o.call(r,...e)};return new fe(i)}}static rejectTip(t){return function(...e){const i=()=>{var r,o;return(o=(r=p.tips)[t])==null?void 0:o.call(r,...e)};return new de(i)}}};F(p,"tips",{info:void 0,success:void 0,warning:void 0,error:void 0}),F(p,"info",p.resolveTip("info")),F(p,"success",p.resolveTip("success")),F(p,"warning",p.rejectTip("warning")),F(p,"error",p.rejectTip("error"));let j=p;exports._Animate_CreateOscillator=pt;exports._Animate_NumericTransition=_t;exports._Animate_Schedule=ht;exports._Blob_ConvertDataToImageUrl=gt;exports._Browser_CopyToClipboard=xt;exports._Browser_GetFrameRate=yt;exports._Browser_KeyedWindowManager=ot;exports._Element_CalculateCanvasSize=Qt;exports._Element_CloseOnOutsideClick=Ht;exports._Element_Drag=Gt;exports._Element_EnterFullscreen=at;exports._Element_ExitFullscreen=lt;exports._Element_Fullscreen=Kt;exports._Element_GetOtherSizeInPixels=Jt;exports._Element_IsFullscreen=ut;exports._Element_LoadImage=te;exports._Element_LocalDrag=Zt;exports._Element_ScrollEndListener=Wt;exports._File_CreateAndDownload=ne;exports._File_Download=mt;exports._File_Read=ee;exports._Format_CamelCase=Tt;exports._Format_CapitalizeFirstLetter=bt;exports._Format_ExcludeSubstring=Ut;exports._Format_FileSize=Ft;exports._Format_HrefName=G;exports._Format_NumberWithCommas=Mt;exports._Format_NumberWithUnit=Et;exports._Format_Percentage=vt;exports._Format_Timestamp=Ct;exports._Math_CalculateDistance2D=le;exports._Math_GetArcPoints=ae;exports._Math_GetBoundaryIntersection=me;exports._Math_GetMidpoint=ue;exports._Math_LngLatToPlane=oe;exports._Math_PlaneToLngLat=se;exports._Math_PointToLineDistance=ce;exports._Tip=j;exports._Utility_Clone=$t;exports._Utility_Debounce=ct;exports._Utility_ExecuteWhenIdle=jt;exports._Utility_GenerateUUID=Ot;exports._Utility_GetTargetByPath=qt;exports._Utility_InitTargetByPath=Nt;exports._Utility_MergeObjects=Z;exports._Utility_RotateList=Yt;exports._Utility_SetTargetByPath=Bt;exports._Utility_Sleep=Vt;exports._Utility_Throttle=zt;exports._Utility_TimeConsumption=Xt;exports._Utility_WaitForCondition=kt;exports._Valid_CheckConnectionWithXHR=Dt;exports._Valid_DataType=tt;exports._Valid_DoesInfiniteLineIntersectRectangle=At;exports._Valid_FileTypeChecker=et;exports._Valid_Is2DNumberArray=Pt;exports._Valid_IsInMargin=It;exports._Valid_IsNumberArray=st;exports._Valid_IsObject=Lt;exports._Valid_IsPointInPolygon=St;exports._Valid_IsSecureContext=Rt;
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".no-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}")),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
2
+ "use strict";var dt=Object.defineProperty;var it=n=>{throw TypeError(n)};var ht=(n,t,e)=>t in n?dt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var F=(n,t,e)=>ht(n,typeof t!="symbol"?t+"":t,e),ot=(n,t,e)=>t.has(n)||it("Cannot "+e);var a=(n,t,e)=>(ot(n,t,"read from private field"),e?e.call(n):t.get(n)),h=(n,t,e)=>t.has(n)?it("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),f=(n,t,e,r)=>(ot(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function pt(n,t=500){let e,r=!0;function i(o){if(!r)return;e||(e=o);let s=Math.min((o-e)/t,1);n(s),o-e<t&&requestAnimationFrame(i)}return requestAnimationFrame(i),()=>r=!1}function _t(n,t,e,r,i=2){let o=n,s=!1,c=1,u=n,l=t,m=e;const d=()=>{const y=(l-u)/m;return Number(y.toFixed(i))};let _=d();const x=y=>Math.min(Math.max(y,u),l),M=y=>Number(y.toFixed(i)),T=(y,W,H)=>{const I=[];return y>=W&&I.push("最小值必须小于最大值"),H<=0?I.push("分段数必须为正数"):d()==0&&I.push("数值精度过低,致使动画步长为 0"),I},k=(y,W,H)=>{const I=T(y,W,H);return I.length>0?(console.error(`参数更新失败: ${I.join("; ")}`),!1):(u=y,l=W,m=H,_=d(),o=x(o),!0)},V=()=>{s&&(c=o>=l?-1:o<=u?1:c,o=x(o+_*c),r(M(o)),requestAnimationFrame(V))};return{play(y=o){if(o=x(y),T(u,l,m).length)return console.error("配置参数错误",this.getParams());s||(s=!0,V())},pause(){s=!1},getCurrent:()=>M(o),isPlaying:()=>s,updateParams:k,getParams:()=>({min:u,max:l,steps:m,precision:i,stepSize:_})}}function gt(n,t,e,r,i=2){if(e<=0)return console.error("动画步数 必须为正数");const o=d=>Number(d.toFixed(i)),s=t-n,c=o(Math.abs(s)/e);if(c===0)return console.error("数值精度过低,致使动画步长为 0");const u=Math.sign(s);let l=n;const m=()=>{l=o(l+c*u),(u>0?l<t:l>t)?(r(l),requestAnimationFrame(m)):r(t)};m()}function yt(n,t="image/png"){try{let e,r=t;if(n instanceof File)return URL.createObjectURL(n);if(typeof n=="string"){let o=n;const s=o.match(/^data:([^;]*)(;base64)?,(.*)$/i);if(s){if(!s[2])return console.error("无效的数据 URL:缺少 base64 编码声明");if(r=s[1]||r,o=s[3],!o)return console.error("数据 URL 包含空有效负载")}o=o.replace(/[^A-Za-z0-9+/=]/g,"");const c=atob(o);e=new Uint8Array(c.length);for(let u=0;u<c.length;u++)e[u]=c.charCodeAt(u)}else if(n instanceof ArrayBuffer)e=new Uint8Array(n);else if(n instanceof Uint8Array)e=n;else return console.error("不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array");const i=new Blob([e],{type:r});return URL.createObjectURL(i)}catch(e){return console.error("数据到 ImageURL 的转换失败:",e.message,e.stack||"没有可用的堆栈跟踪"),null}}function xt(n,t=10){let e=0,r=t;function i(){if(r>0)r--,requestAnimationFrame(i);else{const s=(+new Date-e)/t,c=1e3/s;n(Number(c.toFixed(2)),Number(s.toFixed(2)))}}requestAnimationFrame(()=>{e=+new Date,i()})}function wt(n){const t=()=>Promise.resolve(),e=c=>(console.error(c),Promise.reject(c));function r(){return navigator.clipboard.writeText(n).then(t).catch(e)}function i(){const c=document.createElement("div");c.innerText=n,document.body.appendChild(c);const u=document.createRange();u.selectNodeContents(c);const l=window.getSelection();let m=!1;return l&&(l.removeAllRanges(),l.addRange(u),m=document.execCommand("copy")),document.body.removeChild(c),m?Promise.resolve():Promise.reject()}function o(){const c=document.createElement("textarea");c.value=n,document.body.appendChild(c),c.select(),c.setSelectionRange(0,n.length);let u=!1;return document.activeElement===c&&(u=document.execCommand("Copy",!0)),document.body.removeChild(c),u?Promise.resolve():Promise.reject()}function s(){return i().then(t).catch(()=>{o().then(t).catch(()=>e("复制方式尽皆失效"))})}return navigator.clipboard?r().catch(s):s()}class ct{constructor(){}static add(t,e){this.keys.set(t,e)}static open(t,e,r,i){const o=this.keys.get(t);if(o&&!o.closed)return o.focus(),o;{const s=window.open(e,r,i);if(s)return this.keys.set(t,s),s;console.error("window.open failed: 可能是浏览器阻止了弹出窗口"),this.keys.delete(t)}}static isOpen(t){const e=this.keys.get(t);return e!=null&&e.closed&&this.keys.delete(t),this.keys.has(t)}static getWindow(t){if(this.isOpen(t))return this.keys.get(t)}static close(t){const e=this.keys.get(t);e&&(e.close(),this.keys.delete(t))}static closeAll(){this.keys.forEach((t,e)=>t.close()),this.keys.clear()}}F(ct,"keys",new Map);const bt={".mp3":"audio/mpeg",".mp4":"video/mp4",".m4a":"audio/mp4",".aac":"audio/aac",".ogg":"audio/ogg",".wav":"audio/wav",".flac":"audio/flac",".opus":"audio/opus",".webm":"video/webm",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".bmp":"image/bmp",".tiff":"image/tiff",".ico":"image/vnd.microsoft.icon",".svg":"image/svg+xml",".webp":"image/webp",".heif":"image/heif",".heic":"image/heic",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript",".ts":"application/typescript",".csv":"text/csv",".tsv":"text/tab-separated-values",".txt":"text/plain",".md":"text/markdown",".rtf":"application/rtf",".pdf":"application/pdf",".zip":"application/zip",".rar":"application/x-rar-compressed",".tar":"application/x-tar",".gz":"application/gzip",".7z":"application/x-7z-compressed",".exe":"application/x-msdownload",".apk":"application/vnd.android.package-archive",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".odt":"application/vnd.oasis.opendocument.text",".ods":"application/vnd.oasis.opendocument.spreadsheet",".odp":"application/vnd.oasis.opendocument.presentation",".jsonld":"application/ld+json",".yaml":"application/x-yaml",".yml":"application/x-yaml",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject",".map":"application/json"},tt={image:[".jpg",".jpeg",".png",".gif",".bmp",".webp",".tiff",".svg",".heif",".heic",".ico",".raw",".jfif",".avif",".png8",".indd",".eps",".ai"],ppt:[".ppt",".pptx",".odp"],word:[".doc",".docx",".odt",".rtf"],excel:[".xls",".xlsx",".ods",".csv",".tsv"],pdf:[".pdf"],text:[".txt",".csv",".md",".json",".yaml",".yml",".log",".ini",".rtf"],audio:[".mp3",".wav",".ogg",".flac",".aac",".wma",".m4a",".alac",".ape",".opus",".amr",".ra",".mid",".midi",".aiff",".pcm",".au",".wavpack",".spx"],video:[".mp4",".avi",".mkv",".mov",".wmv",".flv",".webm",".mpg",".mpeg",".3gp",".vob",".ogv",".m4v",".ts",".rm",".rmvb",".m2ts",".divx",".xvid",".swf",".f4v"],archive:[".zip",".rar",".tar",".gz",".bz2",".xz",".7z",".tar.gz",".tar.bz2",".tar.xz",".tar.lz",".tar.lzma",".cab",".iso",".dmg",".tgz",".apk",".gz2",".tar.zst"],code:[".js",".ts",".py",".java",".cpp",".c",".html",".css",".scss",".less",".sass",".php",".rb",".go",".swift",".rs",".kt",".scala",".lua",".pl",".m",".h",".xml",".json",".yaml",".yml",".toml",".vue",".ejs",".handlebars",".jinja",".dart"],font:[".woff",".woff2",".ttf",".otf",".eot",".svg",".ttc",".fnt",".fon",".otc"],database:[".sql",".sqlite",".db",".mdb",".accdb",".jsonld",".xml",".csv"],markup:[".html",".htm",".xhtml",".xml",".json",".yaml",".yml"],configuration:[".ini",".conf",".cfg",".env",".properties",".json",".toml"],logs:[".log",".err",".trace",".out"],script:[".bash",".sh",".zsh",".bat",".ps1",".vbs",".cmd",".sed",".awk",".php"]},st=["","万","亿","兆","京","垓","秭","穰","沟","涧","正","载","极"];function vt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Et(n,t,e=2){return!Number.isFinite(n)||!Number.isFinite(t)||!Number.isFinite(e)?(console.error("所有参数必须是有限的数字"),""):t===0?(console.error("分母不能为零"),""):e<0?(console.error("小数位数不能为负数"),""):(n/t*100).toFixed(e)+"%"}function Mt(n){const e=n.toString().split("."),r=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");return e.length>1?r+"."+e[1]:r}function Ft(n,t){const e={join:!0,suffix:"",decimalPlaces:2},{join:r,suffix:i,decimalPlaces:o}={...e,...t||{}},s=Number(n);if(isNaN(s))return r?`0${i}`:[0,i];const c=Math.abs(s),u=s>=0,l=Math.max(0,Math.floor(Math.log10(c)/4)),m=Math.pow(1e4,l),d=c/m,_=(u?1:-1)*parseFloat(d.toFixed(Math.max(0,o)));return r?`${_}${st[l]}${i}`:[_,st[l]+i]}function Ct(n){const t=["B","KB","MB","GB","TB","PB"];let e=0;for(;n>1024;)n/=1024,e++;return`${Math.round(n*100)/100} ${t[e]}`}function Lt(n,t="YYYY-MM-DD hh:mm:ss",e=!0){const r=new Date(n);if(isNaN(r.getTime()))return console.error("Invalid date"),"";const i={YYYY:o=>o.getFullYear(),MM:o=>o.getMonth()+1,DD:o=>o.getDate(),hh:o=>o.getHours(),mm:o=>o.getMinutes(),ss:o=>o.getSeconds(),ms:o=>o.getMilliseconds()};return t.replace(/YYYY|MM|DD|hh|mm|ss|ms/g,o=>{const s=i[o](r);return e?String(s).padStart(2,"0"):String(s)})}function G(n,t="file"){if(!n||(n=String(n).trim(),n===""))return t;const e=n.split("/");return e[e.length-1].split("?")[0]}function Tt(n,t){return n=n.replace(/([^a-zA-Z][a-z])/g,e=>e.toUpperCase()),t?n.replace(/[^a-zA-Z]+/g,""):n}function Ut(n,t,e=","){const r=new RegExp(`(^|${e})${t}(${e}|$)`,"g");return n.replace(r,function(i,o,s){return o===s?e:""})}function Pt(n){return!(n===null||typeof n!="object"||Array.isArray(n))}function at(n,t=2){if(Array.isArray(n)&&n.length>=t){for(let r=0;r<n.length;r++)if(typeof n[r]!="number"||!Number.isFinite(n[r]))return!1}else return!1;return!0}function It(n,t=1,e=2){if(Array.isArray(n)&&n.length>=t){for(let i=0;i<n.length;i++)if(!at(n[i],e))return!1}else return!1;return!0}function St(n,t,e){return Math.abs(n-t)<=e}function At(n,t){let e=!1;const{x:r,y:i}=n,o=t.length;for(let s=0,c=o-1;s<o;c=s++){const u=t[s].x,l=t[s].y,m=t[c].x,d=t[c].y;l>i!=d>i&&r<(m-u)*(i-l)/(d-l)+u&&(e=!e)}return e}function Rt(n,t,e,r){const i=Math.min(n[0],t[0]),o=Math.max(n[0],t[0]),s=Math.min(n[1],t[1]),c=Math.max(n[1],t[1]),u=[[i,s],[o,s],[o,c],[i,c]],l=r[1]-e[1],m=e[0]-r[0],d=r[0]*e[1]-e[0]*r[1];if(l===0&&m===0){const[T,k]=e;return T>=i&&T<=o&&k>=s&&k<=c}const _=1e-10;let x=!1,M=!1;for(const[T,k]of u){const V=l*T+m*k+d;if(Math.abs(V)<_||(V>_?x=!0:M=!0,x&&M))return!0}return x&&M}function et(n){return Array.isArray(n)?"array":n===null?"null":typeof n}function Dt(n){return["https:","wss:","ftps:","sftp:","smpts:","smtp+tls:","imap+tls:","pop3+tls:","rdp:","vpn:"].some(e=>n.startsWith(e))}function jt(n){return new Promise((t,e)=>{if(typeof n!="string"||n.trim()===""||!n.includes("://")){e(new Error("Invalid URL: Must be a non-empty string"));return}try{new XMLHttpRequest().open("HEAD",n,!0)}catch(o){e(new Error(`Invalid URL format: ${o.message}`));return}const r=new XMLHttpRequest;r.open("HEAD",n,!0);const i=o=>{e(new Error(`Request failed: ${o.type}`))};r.onreadystatechange=function(){r.readyState===XMLHttpRequest.DONE&&(r.status===0?e(new Error("Network error or CORS blocked")):r.status>=200&&r.status<300?t(!0):e(new Error(`HTTP Error: ${r.status}`)))},r.onerror=i,r.onabort=i,r.ontimeout=i;try{r.send()}catch(o){e(new Error(`Request send failed: ${o.message}`))}})}const U=class U{constructor(){if(new.target===U)throw new Error("请直接使用静态方法,而不是实例化此类")}static check(t,e){if(!t||typeof t!="string")return console.error("Invalid URL provided"),e?!1:"unknown";const r=G(t).toLowerCase();if(e){if(!tt.hasOwnProperty(e))return console.error(`Unknown file type: ${e}`),"unknown";const i=tt[e];return U._checkExtension(r,i)}return U._detectFileType(r)}static parseAddresses(t){return!t||typeof t!="string"?(console.error("Invalid URL provided"),[]):t.split(",").map(e=>{const r=G(e),i=this.check(e);return{url:e,name:r,type:i}})}static matchesMimeType(t,e){if(!e)return!0;if(typeof t!="string"||typeof e!="string")return!1;const r=U._normalizeType(t),i=e.split(",").map(c=>U._normalizeType(c.trim())),[o,s="*"]=r.split("/");return i.some(c=>{const[u,l="*"]=c.split("/");return(u==="*"||o==="*"||u===o)&&(l==="*"||s==="*"||l===s)})}static _normalizeType(t){return t.startsWith(".")&&!t.includes("/")?bt[t.toLowerCase()]||t:t.includes("/")?t:`${t}/*`}static _checkExtension(t,e){return e.some(r=>t.endsWith(r))}static _detectFileType(t){for(const[e,r]of U.cachedEntries)if(r.some(i=>t.endsWith(i)))return e;return"unknown"}};F(U,"cachedEntries",Object.entries(tt));let nt=U;function kt(n){if(typeof n!="function")return console.error("非函数:",n);const t=function(e){e.didTimeout||e.timeRemaining()<=0?requestIdleCallback(t):n()};requestIdleCallback(t)}function Ot(n,t){const e=+new Date;return new Promise((r,i)=>{const o=()=>{if(+new Date-e>=t)return i("超时");if(n())return r("完成");requestIdleCallback(o)};o()})}function Z(n,t,e=[],r=+new Date){if(r<+new Date-50){console.error("_MergeObjects 合并异常:疑似死循环");return}const i=et(n),o=et(t);if(i!=o)return t;if(i=="object"||i=="array"){if(e.some(([s,c])=>s==n&&c==t))return n;if(e.push([n,t]),i=="object"){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const c=t[s],u=n[s],l=Z(u,c,e,r);n[s]=l}return n}else if(i=="array")return t.forEach((s,c)=>{const u=s,l=n[c],m=Z(l,u,e,r);n[c]=m}),n}else return t}function zt(n=""){return n+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function lt(n,t){let e;return function(...r){clearTimeout(e),e=setTimeout(()=>{n(...r),e=void 0},t)}}function Nt(n,t){let e=-1/0;return function(...r){const i=performance.now();if(i-e>t){e=i;try{n(...r)}catch(o){console.error("Throttled function execution failed:",o)}}}}function qt(n,t,e){if(!n||!t)return n;const r=t.split(".");return r.reduce((i,o,s)=>i.hasOwnProperty(o)?i[o]:s===r.length-1?i[o]=e:i[o]={},n)}function Bt(n,t){if(!n||!t)return n;const e=t.split(".");return e.reduce((r,i,o)=>r.hasOwnProperty(i)?r[i]:o==e.length-1?void 0:{},n)}function $t(n,t,e){if(!n||!t)return n;const r=t.split(".");return r.reduce((i,o,s)=>(s===r.length-1&&(i[o]=e),i.hasOwnProperty(o)?i[o]:i[o]={}),n)}function Yt(n){return n.map((t,e)=>n.slice(e).concat(n.slice(0,e)))}function Xt(n){const t=window.structuredClone,e=r=>r===null||typeof r!="object"?r:Z(Array.isArray(r)?[]:{},r);try{return t?t(n):e(n)}catch(r){return console.error("structuredClone error:",r),t&&e(n)}}function Vt(n,t,e=30){if(typeof n!="function")return console.error("第一个参数必须是一个函数。");if(!Array.isArray(t))return console.error("第二个参数必须是一个数组。");let r=[],i=0;const o=(s,c)=>{for(const[u,l]of c)if(s>=u)return l;return"black"};return function(...s){const c=performance.now(),u=n(...s),l=performance.now()-c;r.push(l),r.length>e&&r.shift(),i=r.reduce((_,x)=>_+x,0)/r.length||0;const m=o(l,t),d=o(i,t);return console.log(`%c单次耗时:${l.toFixed(2)}ms
3
+ %c平均耗时(${r.length}次):${i.toFixed(2)}ms`,`color: ${m}; padding: 2px 0;`,`color: ${d}; padding: 2px 0;`),u}}function Wt(n){const t=Date.now();let e=performance.now();for(;Date.now()-t<n;){e=Math.sin(e)*1e6,(e>1e6||e<-1e6)&&(e=0);try{const r=e.toString().substring(0,8);history.replaceState(null,"",`#${r}`)}catch{}}return Date.now()-t}function Ht(n){const t=lt(n,100);let e=0,r=0;return function(i){const o=i.target;if(!o||!(o instanceof Element))return;const{scrollTop:s,scrollHeight:c,clientHeight:u,scrollLeft:l,scrollWidth:m,clientWidth:d}=o;function _(){if(e==s)return;const M=e>s;if(e=s,M)return;c-s-u<=1&&t("vertical")}function x(){if(r==l)return;const M=r>l;if(r=l,M)return;m-l-d<=1&&t("horizontal")}_(),x()}}function Gt(n,t,e){const{isClickAllowed:r,uiLibrary:i=["naiveUI","ElementPlus","Element"]}=e||{},o=function(u){const l=[];for(const m in u)Object.hasOwnProperty.call(u,m)&&i.includes(m)&&l.push(...u[m]);return l}({naiveUI:[".v-binder-follower-container",".n-image-preview-container",".n-modal-container"],ElementPlus:[".el-popper"],Element:[".el-popper"]});function s(){t(),document.removeEventListener("mousedown",c)}function c(u){if(r){const d=r(u);if(d)return;if(d===!1)return s()}const l=u.target;if(!(l instanceof Element)||!l.isConnected)return;n.concat(o).some(d=>!!(l!=null&&l.closest(d)))||s()}requestAnimationFrame(()=>document.addEventListener("mousedown",c))}var w,S,A,z,N,C,L,P,q;class Zt{constructor(){h(this,w);h(this,S,!1);h(this,A,{});h(this,z,0);h(this,N,0);h(this,C,0);h(this,L,0);h(this,P);h(this,q)}init(t,e){f(this,w,t),f(this,P,e==null?void 0:e.limit),f(this,q,e==null?void 0:e.dragDom),f(this,A,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(t){const e=t==="bind"?"addEventListener":"removeEventListener";if(!a(this,w))return console.error("No DOM");a(this,w)[e]("mousedown",a(this,A).mousedown),document[e]("mousemove",a(this,A).mousemove),document[e]("mouseup",a(this,A).mouseup)}alterLocation(){if(!a(this,w))return console.error("No DOM");a(this,P)&&(f(this,C,Math.min(a(this,C),a(this,P).max.top)),f(this,C,Math.max(a(this,C),a(this,P).min.top)),f(this,L,Math.min(a(this,L),a(this,P).max.left)),f(this,L,Math.max(a(this,L),a(this,P).min.left))),a(this,w).style.setProperty("--top",a(this,C)+"px"),a(this,w).style.setProperty("--left",a(this,L)+"px")}mousedown(t){if(!a(this,w))return console.error("No DOM");if(a(this,q)&&t.target!=a(this,q))return;document.body.classList.add("no-select"),f(this,S,!0);const e=a(this,w).getBoundingClientRect(),{pageX:r,pageY:i}=t;f(this,z,r),f(this,N,i),f(this,C,e.y),f(this,L,e.x)}mousemove(t){const{pageX:e,pageY:r}=t;a(this,S)&&(f(this,C,a(this,C)+(r-a(this,N))),f(this,L,a(this,L)+(e-a(this,z))),f(this,z,e),f(this,N,r),this.alterLocation())}mouseup(){a(this,S)&&(f(this,S,!1),document.body.classList.remove("no-select"))}}w=new WeakMap,S=new WeakMap,A=new WeakMap,z=new WeakMap,N=new WeakMap,C=new WeakMap,L=new WeakMap,P=new WeakMap,q=new WeakMap;var b,R,D,B,$,v,E,g,Y,X;class Kt{constructor(){h(this,b);h(this,R,!1);h(this,D,{});h(this,B,0);h(this,$,0);h(this,v,0);h(this,E,0);h(this,g);h(this,Y);h(this,X)}init(t,e={}){f(this,b,t),f(this,g,e.limit),f(this,Y,e.update_move),f(this,X,e.update_up),f(this,D,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(t){const e=t==="bind"?"addEventListener":"removeEventListener";if(!a(this,b))return console.error("No DOM");a(this,b)[e]("mousedown",a(this,D).mousedown),document[e]("mousemove",a(this,D).mousemove),document[e]("mouseup",a(this,D).mouseup)}updateValue(){const t={top:a(this,v),left:a(this,E),percentage:{top:0,left:0}};if(a(this,g)){const e=r=>a(this,g)?(t[r]-a(this,g).min[r])/(a(this,g).max[r]-a(this,g).min[r]):0;t.percentage={top:e("top")||0,left:e("left")||0}}return t}alterLocation(){if(!a(this,b))return console.error("No DOM");a(this,g)&&(f(this,v,Math.min(a(this,v),a(this,g).max.top)),f(this,v,Math.max(a(this,v),a(this,g).min.top)),f(this,E,Math.min(a(this,E),a(this,g).max.left)),f(this,E,Math.max(a(this,E),a(this,g).min.left))),a(this,Y)&&a(this,Y).call(this,this.updateValue()),a(this,b).style.setProperty("--top",a(this,v)+"px"),a(this,b).style.setProperty("--left",a(this,E)+"px")}mousedown(t){if(!a(this,b))return console.error("No DOM");document.body.classList.add("no-select"),f(this,R,!0);const e=a(this,b).getBoundingClientRect();f(this,$,e.y),f(this,B,e.x);const{pageX:r,pageY:i}=t;f(this,v,i-a(this,$)),f(this,E,r-a(this,B)),this.alterLocation()}mousemove(t){const{pageX:e,pageY:r}=t;a(this,R)&&(f(this,v,r-a(this,$)),f(this,E,e-a(this,B)),this.alterLocation())}mouseup(){a(this,R)&&(f(this,R,!1),document.body.classList.remove("no-select"),a(this,X)&&a(this,X).call(this,this.updateValue()))}}b=new WeakMap,R=new WeakMap,D=new WeakMap,B=new WeakMap,$=new WeakMap,v=new WeakMap,E=new WeakMap,g=new WeakMap,Y=new WeakMap,X=new WeakMap;function Q(n){if(typeof n=="string"){const t=document.querySelector(n);if(!t)throw new Error(`Element "${n}" not found`);return t}else return n||document.documentElement}function ut(n){const t=Q(n);return t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():Promise.reject("No Fullscreen API")}function mt(){const n=document;return document.exitFullscreen?document.exitFullscreen():n.mozCancelFullScreen?n.mozCancelFullScreen():n.webkitExitFullscreen?n.webkitExitFullscreen():n.msExitFullscreen?n.msExitFullscreen():Promise.reject("No ExitFullscreen API")}function rt(n){const t=Q(n),e=document,r=document.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement;return t==r}function Jt(n){return n=Q(n),function(){rt(n)?mt():ut(n)}}function Qt(n,t){const e=Q(t),r=()=>{n(rt(e))};return document.addEventListener("fullscreenchange",r),document.addEventListener("webkitfullscreenchange",r),document.addEventListener("mozfullscreenchange",r),document.addEventListener("MSFullscreenChange",r),r(),()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("webkitfullscreenchange",r),document.removeEventListener("mozfullscreenchange",r),document.removeEventListener("MSFullscreenChange",r)}}function te(n,t){if(typeof n=="number")return n;if(/px/.test(n))return Number(n.replace(/px/,""))||0;const e=document.createElement("div");e.style.width=n,t=t||document.body,t.appendChild(e);const r=e.getBoundingClientRect().width;return t.removeChild(e),r}function ee(n,t){if(!n)return;let e,r;if(typeof t=="string"){const o=document.querySelector(t);if(!o)return;const s=o.getBoundingClientRect();e=s.width,r=s.height}else if(Array.isArray(t))e=t[0],r=t[1];else{const o=t.getBoundingClientRect();e=o.width,r=o.height}const i=e/r;return i>n?[n*r,r]:i<n?[e,e/n]:[e,r]}function ne(n,t=5e3){return new Promise((e,r)=>{const i=new Image;i.src=n;const o=setTimeout(()=>{r(new Error("图片加载超时")),i.onload=null,i.onerror=null},t);i.onload=()=>{clearTimeout(o);const s=i.naturalWidth,c=i.naturalHeight,u=s/c;e([i,u])},i.onerror=()=>{clearTimeout(o),r(new Error("图片加载失败"))},i.crossOrigin="Anonymous"})}function re(n){return new Promise((t,e)=>{fetch(n).then(r=>t(r.text())).catch(r=>{console.error("Error fetching :",r),e(r)})})}function ft(n,t){return new Promise((e,r)=>{try{t=t||G(n,"downloaded_file"),fetch(n).then(i=>(i.ok||r(`文件下载失败,状态码: ${i.status}`),i.blob())).then(i=>{const o=URL.createObjectURL(i),s=document.createElement("a");s.href=o,s.download=decodeURIComponent(t),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o),e(i)}).catch(r)}catch(i){r(i)}})}function ie(n,t,e){if(!e){let o=t.replace(/^[^.]+./,"");o=o==t?"text/plain":"application/"+o,e={type:o}}const r=new Blob(n,e),i=URL.createObjectURL(r);ft(i,t)}const oe=Math.PI/2,K=Math.PI/180,J=6378137,se=85.05112878;function ce(n,t){const e=Math.max(Math.min(n,180),-180),r=Math.max(Math.min(t,se),-85.05112878),i=e*K*J,o=r*K,s=Math.log(Math.tan(Math.PI/4+o/2))*J;return[i,s]}function ae(n,t){const e=n/J/K,r=(2*Math.atan(Math.exp(t/J))-oe)/K;return[e,r]}function le(n,t,e){const[r,i]=n,[o,s]=t,[c,u]=e,l=(c-o)**2+(u-s)**2;if(l===0)return Math.sqrt((r-o)**2+(i-s)**2);let m=((r-o)*(c-o)+(i-s)*(u-s))/l;return m=Math.max(0,Math.min(1,m)),Math.sqrt((r-(o+m*(c-o)))**2+(i-(s+m*(u-s)))**2)}function ue(n,t,e,r,i,o=1,s=1){const c=n+e*Math.cos(r)*o,u=t+e*Math.sin(r)*s,l=n+e*Math.cos(i)*o,m=t+e*Math.sin(i)*s;return[[c,u],[l,m]]}function me(n,t,e,r){return Math.hypot(Math.abs(e-n),Math.abs(r-t))}function fe(n,t,e,r){const i=(n+e)/2,o=(t+r)/2;return{x:i,y:o}}function de(n,t,e,r){const[i,o]=n,[s,c]=t;let u=1/0;if(s!==0){const l=s>0?(e-i)/s:-i/s;l>0&&(u=Math.min(u,l))}if(c!==0){const l=c>0?(r-o)/c:-o/c;l>0&&(u=Math.min(u,l))}return u===1/0?n:[i+s*u,o+c*u]}class O{constructor(t,e){F(this,"resolve");F(this,"reject");this.resolve=t,this.reject=e}run(t){var e,r;return t instanceof Promise?t.then(i=>{var o;return(o=this.resolve)==null||o.call(this),i}).catch(i=>{var o;return(o=this.reject)==null||o.call(this),Promise.reject(i)}):t?(e=this.resolve)==null||e.call(this):(r=this.reject)==null||r.call(this),t}}class he extends O{constructor(t){super(),this.resolve=t}warning(...t){const e=()=>{var r,i;return(i=(r=j.tips).warning)==null?void 0:i.call(r,...t)};return new O(this.resolve,e)}error(...t){const e=()=>{var r,i;return(i=(r=j.tips).error)==null?void 0:i.call(r,...t)};return new O(this.resolve,e)}}class pe extends O{constructor(t){super(),this.reject=t}info(...t){const e=()=>{var r,i;return(i=(r=j.tips).info)==null?void 0:i.call(r,...t)};return new O(e,this.reject)}success(...t){const e=()=>{var r,i;return(i=(r=j.tips).success)==null?void 0:i.call(r,...t)};return new O(e,this.reject)}}const p=class p{constructor(){if(new.target===p)throw new Error("请直接使用静态方法,而不是实例化此类")}static register(t,e){if(typeof e!="function")return console.error("TipHandler must be a function");p.tips[t]=e}static resolveTip(t){return function(...e){const r=()=>{var i,o;return(o=(i=p.tips)[t])==null?void 0:o.call(i,...e)};return new he(r)}}static rejectTip(t){return function(...e){const r=()=>{var i,o;return(o=(i=p.tips)[t])==null?void 0:o.call(i,...e)};return new pe(r)}}};F(p,"tips",{info:void 0,success:void 0,warning:void 0,error:void 0}),F(p,"info",p.resolveTip("info")),F(p,"success",p.resolveTip("success")),F(p,"warning",p.rejectTip("warning")),F(p,"error",p.rejectTip("error"));let j=p;exports._Animate_CreateOscillator=_t;exports._Animate_NumericTransition=gt;exports._Animate_Schedule=pt;exports._Blob_ConvertDataToImageUrl=yt;exports._Browser_CopyToClipboard=wt;exports._Browser_GetFrameRate=xt;exports._Browser_KeyedWindowManager=ct;exports._Element_CalculateCanvasSize=ee;exports._Element_CloseOnOutsideClick=Gt;exports._Element_Drag=Zt;exports._Element_EnterFullscreen=ut;exports._Element_ExitFullscreen=mt;exports._Element_Fullscreen=Jt;exports._Element_FullscreenObserver=Qt;exports._Element_GetOtherSizeInPixels=te;exports._Element_IsFullscreen=rt;exports._Element_LoadImage=ne;exports._Element_LocalDrag=Kt;exports._Element_ScrollEndListener=Ht;exports._File_CreateAndDownload=ie;exports._File_Download=ft;exports._File_Read=re;exports._Format_CamelCase=Tt;exports._Format_CapitalizeFirstLetter=vt;exports._Format_ExcludeSubstring=Ut;exports._Format_FileSize=Ct;exports._Format_HrefName=G;exports._Format_NumberWithCommas=Mt;exports._Format_NumberWithUnit=Ft;exports._Format_Percentage=Et;exports._Format_Timestamp=Lt;exports._Math_CalculateDistance2D=me;exports._Math_GetArcPoints=ue;exports._Math_GetBoundaryIntersection=de;exports._Math_GetMidpoint=fe;exports._Math_LngLatToPlane=ce;exports._Math_PlaneToLngLat=ae;exports._Math_PointToLineDistance=le;exports._Tip=j;exports._Utility_Clone=Xt;exports._Utility_Debounce=lt;exports._Utility_ExecuteWhenIdle=kt;exports._Utility_GenerateUUID=zt;exports._Utility_GetTargetByPath=Bt;exports._Utility_InitTargetByPath=qt;exports._Utility_MergeObjects=Z;exports._Utility_RotateList=Yt;exports._Utility_SetTargetByPath=$t;exports._Utility_Sleep=Wt;exports._Utility_Throttle=Nt;exports._Utility_TimeConsumption=Vt;exports._Utility_WaitForCondition=Ot;exports._Valid_CheckConnectionWithXHR=jt;exports._Valid_DataType=et;exports._Valid_DoesInfiniteLineIntersectRectangle=Rt;exports._Valid_FileTypeChecker=nt;exports._Valid_Is2DNumberArray=It;exports._Valid_IsInMargin=St;exports._Valid_IsNumberArray=at;exports._Valid_IsObject=Pt;exports._Valid_IsPointInPolygon=At;exports._Valid_IsSecureContext=Dt;
package/dist/index.es.js CHANGED
@@ -1,12 +1,12 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".nhanh-pure-function{--nhanh: 2233}.no-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}")),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
2
- var it = Object.defineProperty;
3
- var tt = (n) => {
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
+ var ct = Object.defineProperty;
3
+ var et = (n) => {
4
4
  throw TypeError(n);
5
5
  };
6
- var st = (n, t, e) => t in n ? it(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
7
- var F = (n, t, e) => st(n, typeof t != "symbol" ? t + "" : t, e), et = (n, t, e) => t.has(n) || tt("Cannot " + e);
8
- var a = (n, t, e) => (et(n, t, "read from private field"), e ? e.call(n) : t.get(n)), h = (n, t, e) => t.has(n) ? tt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), f = (n, t, e, r) => (et(n, t, "write to private field"), r ? r.call(n, e) : t.set(n, e), e);
9
- function vt(n, t = 500) {
6
+ var at = (n, t, e) => t in n ? ct(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
7
+ var F = (n, t, e) => at(n, typeof t != "symbol" ? t + "" : t, e), nt = (n, t, e) => t.has(n) || et("Cannot " + e);
8
+ var a = (n, t, e) => (nt(n, t, "read from private field"), e ? e.call(n) : t.get(n)), h = (n, t, e) => t.has(n) ? et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), f = (n, t, e, r) => (nt(n, t, "write to private field"), r ? r.call(n, e) : t.set(n, e), e);
9
+ function bt(n, t = 500) {
10
10
  let e, r = !0;
11
11
  function o(i) {
12
12
  if (!r) return;
@@ -16,26 +16,26 @@ function vt(n, t = 500) {
16
16
  }
17
17
  return requestAnimationFrame(o), () => r = !1;
18
18
  }
19
- function bt(n, t, e, r, o = 2) {
19
+ function _t(n, t, e, r, o = 2) {
20
20
  let i = n, s = !1, c = 1, u = n, l = t, m = e;
21
21
  const d = () => {
22
22
  const w = (l - u) / m;
23
23
  return Number(w.toFixed(o));
24
24
  };
25
25
  let g = d();
26
- const y = (w) => Math.min(Math.max(w, u), l), E = (w) => Number(w.toFixed(o)), T = (w, W, V) => {
26
+ const v = (w) => Math.min(Math.max(w, u), l), E = (w) => Number(w.toFixed(o)), T = (w, W, V) => {
27
27
  const R = [];
28
28
  return w >= W && R.push("最小值必须小于最大值"), V <= 0 ? R.push("分段数必须为正数") : d() == 0 && R.push("数值精度过低,致使动画步长为 0"), R;
29
29
  }, k = (w, W, V) => {
30
30
  const R = T(w, W, V);
31
- return R.length > 0 ? (console.error(`参数更新失败: ${R.join("; ")}`), !1) : (u = w, l = W, m = V, g = d(), i = y(i), !0);
31
+ return R.length > 0 ? (console.error(`参数更新失败: ${R.join("; ")}`), !1) : (u = w, l = W, m = V, g = d(), i = v(i), !0);
32
32
  }, H = () => {
33
- s && (c = i >= l ? -1 : i <= u ? 1 : c, i = y(i + g * c), r(E(i)), requestAnimationFrame(H));
33
+ s && (c = i >= l ? -1 : i <= u ? 1 : c, i = v(i + g * c), r(E(i)), requestAnimationFrame(H));
34
34
  };
35
35
  return {
36
36
  /** 启动/继续动画 */
37
37
  play(w = i) {
38
- if (i = y(w), T(u, l, m).length)
38
+ if (i = v(w), T(u, l, m).length)
39
39
  return console.error("配置参数错误", this.getParams());
40
40
  s || (s = !0, H());
41
41
  },
@@ -53,7 +53,7 @@ function bt(n, t, e, r, o = 2) {
53
53
  getParams: () => ({ min: u, max: l, steps: m, precision: o, stepSize: g })
54
54
  };
55
55
  }
56
- function _t(n, t, e, r, o = 2) {
56
+ function Mt(n, t, e, r, o = 2) {
57
57
  if (e <= 0) return console.error("动画步数 必须为正数");
58
58
  const i = (d) => Number(d.toFixed(o)), s = t - n, c = i(Math.abs(s) / e);
59
59
  if (c === 0) return console.error("数值精度过低,致使动画步长为 0");
@@ -64,7 +64,7 @@ function _t(n, t, e, r, o = 2) {
64
64
  };
65
65
  m();
66
66
  }
67
- function Mt(n, t = "image/png") {
67
+ function Et(n, t = "image/png") {
68
68
  try {
69
69
  let e, r = t;
70
70
  if (n instanceof File)
@@ -101,7 +101,7 @@ function Mt(n, t = "image/png") {
101
101
  ), null;
102
102
  }
103
103
  }
104
- function Et(n, t = 10) {
104
+ function Ft(n, t = 10) {
105
105
  let e = 0, r = t;
106
106
  function o() {
107
107
  if (r > 0)
@@ -115,7 +115,7 @@ function Et(n, t = 10) {
115
115
  e = +/* @__PURE__ */ new Date(), o();
116
116
  });
117
117
  }
118
- function Ft(n) {
118
+ function Ct(n) {
119
119
  const t = () => Promise.resolve(), e = (c) => (console.error(c), Promise.reject(c));
120
120
  function r() {
121
121
  return navigator.clipboard.writeText(n).then(t).catch(e);
@@ -142,7 +142,7 @@ function Ft(n) {
142
142
  }
143
143
  return navigator.clipboard ? r().catch(s) : s();
144
144
  }
145
- class ct {
145
+ class lt {
146
146
  /** 请使用静态方法 */
147
147
  constructor() {
148
148
  }
@@ -202,9 +202,8 @@ class ct {
202
202
  }
203
203
  }
204
204
  // 存储键与对应窗口的Map
205
- F(ct, "keys", /* @__PURE__ */ new Map());
206
- const at = {
207
- /* 常见扩展名映射 */
205
+ F(lt, "keys", /* @__PURE__ */ new Map());
206
+ const ut = {
208
207
  ".mp3": "audio/mpeg",
209
208
  ".mp4": "video/mp4",
210
209
  ".m4a": "audio/mp4",
@@ -266,8 +265,7 @@ const at = {
266
265
  ".otf": "font/otf",
267
266
  ".eot": "application/vnd.ms-fontobject",
268
267
  ".map": "application/json"
269
- // 可根据需要继续扩展
270
- }, K = {
268
+ }, J = {
271
269
  image: [
272
270
  ".jpg",
273
271
  ".jpeg",
@@ -447,7 +445,7 @@ const at = {
447
445
  ".awk",
448
446
  ".php"
449
447
  ]
450
- }, nt = [
448
+ }, rt = [
451
449
  "",
452
450
  "万",
453
451
  "亿",
@@ -462,17 +460,17 @@ const at = {
462
460
  "载",
463
461
  "极"
464
462
  ];
465
- function Ct(n) {
463
+ function Lt(n) {
466
464
  return n.charAt(0).toUpperCase() + n.slice(1);
467
465
  }
468
- function Lt(n, t, e = 2) {
466
+ function Tt(n, t, e = 2) {
469
467
  return !Number.isFinite(n) || !Number.isFinite(t) || !Number.isFinite(e) ? (console.error("所有参数必须是有限的数字"), "") : t === 0 ? (console.error("分母不能为零"), "") : e < 0 ? (console.error("小数位数不能为负数"), "") : (n / t * 100).toFixed(e) + "%";
470
468
  }
471
- function Tt(n) {
469
+ function Pt(n) {
472
470
  const e = n.toString().split("."), r = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
473
471
  return e.length > 1 ? r + "." + e[1] : r;
474
472
  }
475
- function Pt(n, t) {
473
+ function Ut(n, t) {
476
474
  const e = {
477
475
  join: !0,
478
476
  suffix: "",
@@ -483,16 +481,16 @@ function Pt(n, t) {
483
481
  }, s = Number(n);
484
482
  if (isNaN(s)) return r ? `0${o}` : [0, o];
485
483
  const c = Math.abs(s), u = s >= 0, l = Math.max(0, Math.floor(Math.log10(c) / 4)), m = Math.pow(1e4, l), d = c / m, g = (u ? 1 : -1) * parseFloat(d.toFixed(Math.max(0, i)));
486
- return r ? `${g}${nt[l]}${o}` : [g, nt[l] + o];
484
+ return r ? `${g}${rt[l]}${o}` : [g, rt[l] + o];
487
485
  }
488
- function Ut(n) {
486
+ function Rt(n) {
489
487
  const t = ["B", "KB", "MB", "GB", "TB", "PB"];
490
488
  let e = 0;
491
489
  for (; n > 1024; )
492
490
  n /= 1024, e++;
493
491
  return `${Math.round(n * 100) / 100} ${t[e]}`;
494
492
  }
495
- function Rt(n, t = "YYYY-MM-DD hh:mm:ss", e = !0) {
493
+ function jt(n, t = "YYYY-MM-DD hh:mm:ss", e = !0) {
496
494
  const r = new Date(n);
497
495
  if (isNaN(r.getTime()))
498
496
  return console.error("Invalid date"), "";
@@ -511,15 +509,15 @@ function Rt(n, t = "YYYY-MM-DD hh:mm:ss", e = !0) {
511
509
  return e ? String(s).padStart(2, "0") : String(s);
512
510
  });
513
511
  }
514
- function J(n, t = "file") {
512
+ function Q(n, t = "file") {
515
513
  if (!n || (n = String(n).trim(), n === "")) return t;
516
514
  const e = n.split("/");
517
515
  return e[e.length - 1].split("?")[0];
518
516
  }
519
- function jt(n, t) {
517
+ function It(n, t) {
520
518
  return n = n.replace(/([^a-zA-Z][a-z])/g, (e) => e.toUpperCase()), t ? n.replace(/[^a-zA-Z]+/g, "") : n;
521
519
  }
522
- function It(n, t, e = ",") {
520
+ function At(n, t, e = ",") {
523
521
  const r = new RegExp(
524
522
  `(^|${e})${t}(${e}|$)`,
525
523
  "g"
@@ -528,27 +526,27 @@ function It(n, t, e = ",") {
528
526
  return i === s ? e : "";
529
527
  });
530
528
  }
531
- function At(n) {
529
+ function St(n) {
532
530
  return !(n === null || typeof n != "object" || Array.isArray(n));
533
531
  }
534
- function lt(n, t = 2) {
532
+ function mt(n, t = 2) {
535
533
  if (Array.isArray(n) && n.length >= t) {
536
534
  for (let r = 0; r < n.length; r++)
537
535
  if (typeof n[r] != "number" || !Number.isFinite(n[r])) return !1;
538
536
  } else return !1;
539
537
  return !0;
540
538
  }
541
- function St(n, t = 1, e = 2) {
539
+ function kt(n, t = 1, e = 2) {
542
540
  if (Array.isArray(n) && n.length >= t) {
543
541
  for (let o = 0; o < n.length; o++)
544
- if (!lt(n[o], e)) return !1;
542
+ if (!mt(n[o], e)) return !1;
545
543
  } else return !1;
546
544
  return !0;
547
545
  }
548
- function kt(n, t, e) {
546
+ function Dt(n, t, e) {
549
547
  return Math.abs(n - t) <= e;
550
548
  }
551
- function Dt(n, t) {
549
+ function zt(n, t) {
552
550
  let e = !1;
553
551
  const { x: r, y: o } = n, i = t.length;
554
552
  for (let s = 0, c = i - 1; s < i; c = s++) {
@@ -557,7 +555,7 @@ function Dt(n, t) {
557
555
  }
558
556
  return e;
559
557
  }
560
- function zt(n, t, e, r) {
558
+ function Ot(n, t, e, r) {
561
559
  const o = Math.min(n[0], t[0]), i = Math.max(n[0], t[0]), s = Math.min(n[1], t[1]), c = Math.max(n[1], t[1]), u = [
562
560
  [o, s],
563
561
  // 左上
@@ -573,18 +571,18 @@ function zt(n, t, e, r) {
573
571
  return T >= o && T <= i && k >= s && k <= c;
574
572
  }
575
573
  const g = 1e-10;
576
- let y = !1, E = !1;
574
+ let v = !1, E = !1;
577
575
  for (const [T, k] of u) {
578
576
  const H = l * T + m * k + d;
579
- if (Math.abs(H) < g || (H > g ? y = !0 : E = !0, y && E))
577
+ if (Math.abs(H) < g || (H > g ? v = !0 : E = !0, v && E))
580
578
  return !0;
581
579
  }
582
- return y && E;
580
+ return v && E;
583
581
  }
584
- function rt(n) {
582
+ function ot(n) {
585
583
  return Array.isArray(n) ? "array" : n === null ? "null" : typeof n;
586
584
  }
587
- function Ot(n) {
585
+ function Nt(n) {
588
586
  return [
589
587
  "https:",
590
588
  // HTTPS协议,用于安全地浏览网页
@@ -608,7 +606,7 @@ function Ot(n) {
608
606
  // VPN协议,用于创建安全的网络连接
609
607
  ].some((e) => n.startsWith(e));
610
608
  }
611
- function Nt(n) {
609
+ function qt(n) {
612
610
  return new Promise((t, e) => {
613
611
  if (typeof n != "string" || n.trim() === "" || !n.includes("://")) {
614
612
  e(new Error("Invalid URL: Must be a non-empty string"));
@@ -643,11 +641,11 @@ const P = class P {
643
641
  static check(t, e) {
644
642
  if (!t || typeof t != "string")
645
643
  return console.error("Invalid URL provided"), e ? !1 : "unknown";
646
- const r = J(t).toLowerCase();
644
+ const r = Q(t).toLowerCase();
647
645
  if (e) {
648
- if (!K.hasOwnProperty(e))
646
+ if (!J.hasOwnProperty(e))
649
647
  return console.error(`Unknown file type: ${e}`), "unknown";
650
- const o = K[e];
648
+ const o = J[e];
651
649
  return P._checkExtension(r, o);
652
650
  }
653
651
  return P._detectFileType(r);
@@ -662,7 +660,7 @@ const P = class P {
662
660
  */
663
661
  static parseAddresses(t) {
664
662
  return !t || typeof t != "string" ? (console.error("Invalid URL provided"), []) : t.split(",").map((e) => {
665
- const r = J(e), o = this.check(e);
663
+ const r = Q(e), o = this.check(e);
666
664
  return { url: e, name: r, type: o };
667
665
  });
668
666
  }
@@ -690,7 +688,7 @@ const P = class P {
690
688
  * @returns {string} 标准化的MIME类型字符串,如果无法识别则返回原始输入
691
689
  */
692
690
  static _normalizeType(t) {
693
- return t.startsWith(".") && !t.includes("/") ? at[t.toLowerCase()] || t : t.includes("/") ? t : `${t}/*`;
691
+ return t.startsWith(".") && !t.includes("/") ? ut[t.toLowerCase()] || t : t.includes("/") ? t : `${t}/*`;
694
692
  }
695
693
  /**
696
694
  * 检查URL是否具有任何指定的文件扩展名
@@ -714,9 +712,9 @@ const P = class P {
714
712
  }
715
713
  };
716
714
  // 缓存文件扩展名的条目,以提高性能
717
- F(P, "cachedEntries", Object.entries(K));
718
- let ot = P;
719
- function qt(n) {
715
+ F(P, "cachedEntries", Object.entries(J));
716
+ let it = P;
717
+ function $t(n) {
720
718
  if (typeof n != "function")
721
719
  return console.error("非函数:", n);
722
720
  const t = function(e) {
@@ -735,19 +733,19 @@ function Yt(n, t) {
735
733
  i();
736
734
  });
737
735
  }
738
- function Q(n, t, e = [], r = +/* @__PURE__ */ new Date()) {
736
+ function tt(n, t, e = [], r = +/* @__PURE__ */ new Date()) {
739
737
  if (r < +/* @__PURE__ */ new Date() - 50) {
740
738
  console.error("_MergeObjects 合并异常:疑似死循环");
741
739
  return;
742
740
  }
743
- const o = rt(n), i = rt(t);
741
+ const o = ot(n), i = ot(t);
744
742
  if (o != i) return t;
745
743
  if (o == "object" || o == "array") {
746
744
  if (e.some(([s, c]) => s == n && c == t)) return n;
747
745
  if (e.push([n, t]), o == "object") {
748
746
  for (const s in t)
749
747
  if (Object.prototype.hasOwnProperty.call(t, s)) {
750
- const c = t[s], u = n[s], l = Q(
748
+ const c = t[s], u = n[s], l = tt(
751
749
  u,
752
750
  c,
753
751
  e,
@@ -758,7 +756,7 @@ function Q(n, t, e = [], r = +/* @__PURE__ */ new Date()) {
758
756
  return n;
759
757
  } else if (o == "array")
760
758
  return t.forEach((s, c) => {
761
- const u = s, l = n[c], m = Q(
759
+ const u = s, l = n[c], m = tt(
762
760
  l,
763
761
  u,
764
762
  e,
@@ -768,13 +766,13 @@ function Q(n, t, e = [], r = +/* @__PURE__ */ new Date()) {
768
766
  }), n;
769
767
  } else return t;
770
768
  }
771
- function $t(n = "") {
769
+ function Xt(n = "") {
772
770
  return n + "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
773
771
  const e = Math.random() * 16 | 0;
774
772
  return (t === "x" ? e : e & 3 | 8).toString(16);
775
773
  });
776
774
  }
777
- function ut(n, t) {
775
+ function ft(n, t) {
778
776
  let e;
779
777
  return function(...r) {
780
778
  clearTimeout(e), e = setTimeout(() => {
@@ -782,7 +780,7 @@ function ut(n, t) {
782
780
  }, t);
783
781
  };
784
782
  }
785
- function Xt(n, t) {
783
+ function Bt(n, t) {
786
784
  let e = -1 / 0;
787
785
  return function(...r) {
788
786
  const o = performance.now();
@@ -796,33 +794,33 @@ function Xt(n, t) {
796
794
  }
797
795
  };
798
796
  }
799
- function Bt(n, t, e) {
797
+ function Ht(n, t, e) {
800
798
  if (!n || !t) return n;
801
799
  const r = t.split(".");
802
800
  return r.reduce((o, i, s) => o.hasOwnProperty(i) ? o[i] : s === r.length - 1 ? o[i] = e : o[i] = {}, n);
803
801
  }
804
- function Ht(n, t) {
802
+ function Wt(n, t) {
805
803
  if (!n || !t) return n;
806
804
  const e = t.split(".");
807
805
  return e.reduce((r, o, i) => r.hasOwnProperty(o) ? r[o] : i == e.length - 1 ? void 0 : {}, n);
808
806
  }
809
- function Wt(n, t, e) {
807
+ function Vt(n, t, e) {
810
808
  if (!n || !t) return n;
811
809
  const r = t.split(".");
812
810
  return r.reduce((o, i, s) => (s === r.length - 1 && (o[i] = e), o.hasOwnProperty(i) ? o[i] : o[i] = {}), n);
813
811
  }
814
- function Vt(n) {
812
+ function Gt(n) {
815
813
  return n.map((t, e) => n.slice(e).concat(n.slice(0, e)));
816
814
  }
817
- function Gt(n) {
818
- const t = window.structuredClone, e = (r) => r === null || typeof r != "object" ? r : Q(Array.isArray(r) ? [] : {}, r);
815
+ function Zt(n) {
816
+ const t = window.structuredClone, e = (r) => r === null || typeof r != "object" ? r : tt(Array.isArray(r) ? [] : {}, r);
819
817
  try {
820
818
  return t ? t(n) : e(n);
821
819
  } catch (r) {
822
820
  return console.error("structuredClone error:", r), t && e(n);
823
821
  }
824
822
  }
825
- function Zt(n, t, e = 30) {
823
+ function Kt(n, t, e = 30) {
826
824
  if (typeof n != "function")
827
825
  return console.error("第一个参数必须是一个函数。");
828
826
  if (!Array.isArray(t))
@@ -836,7 +834,7 @@ function Zt(n, t, e = 30) {
836
834
  };
837
835
  return function(...s) {
838
836
  const c = performance.now(), u = n(...s), l = performance.now() - c;
839
- r.push(l), r.length > e && r.shift(), o = r.reduce((g, y) => g + y, 0) / r.length || 0;
837
+ r.push(l), r.length > e && r.shift(), o = r.reduce((g, v) => g + v, 0) / r.length || 0;
840
838
  const m = i(l, t), d = i(o, t);
841
839
  return console.log(
842
840
  `%c单次耗时:${l.toFixed(2)}ms
@@ -846,7 +844,7 @@ function Zt(n, t, e = 30) {
846
844
  ), u;
847
845
  };
848
846
  }
849
- function Kt(n) {
847
+ function Jt(n) {
850
848
  const t = Date.now();
851
849
  let e = performance.now();
852
850
  for (; Date.now() - t < n; ) {
@@ -859,8 +857,8 @@ function Kt(n) {
859
857
  }
860
858
  return Date.now() - t;
861
859
  }
862
- function Jt(n) {
863
- const t = ut(n, 100);
860
+ function Qt(n) {
861
+ const t = ft(n, 100);
864
862
  let e = 0, r = 0;
865
863
  return function(o) {
866
864
  const i = o.target;
@@ -879,16 +877,16 @@ function Jt(n) {
879
877
  if (e = s, E) return;
880
878
  c - s - u <= 1 && t("vertical");
881
879
  }
882
- function y() {
880
+ function v() {
883
881
  if (r == l) return;
884
882
  const E = r > l;
885
883
  if (r = l, E) return;
886
884
  m - l - d <= 1 && t("horizontal");
887
885
  }
888
- g(), y();
886
+ g(), v();
889
887
  };
890
888
  }
891
- function Qt(n, t, e) {
889
+ function te(n, t, e) {
892
890
  const { isClickAllowed: r, uiLibrary: o = ["naiveUI", "ElementPlus", "Element"] } = e || {}, i = function(u) {
893
891
  const l = [];
894
892
  for (const m in u)
@@ -920,10 +918,10 @@ function Qt(n, t, e) {
920
918
  () => document.addEventListener("mousedown", c)
921
919
  );
922
920
  }
923
- var v, j, I, z, O, C, L, U, N;
924
- class te {
921
+ var y, j, I, z, O, C, L, U, N;
922
+ class ee {
925
923
  constructor() {
926
- h(this, v);
924
+ h(this, y);
927
925
  h(this, j, !1);
928
926
  h(this, I, {});
929
927
  h(this, z, 0);
@@ -934,7 +932,7 @@ class te {
934
932
  h(this, N);
935
933
  }
936
934
  init(t, e) {
937
- f(this, v, t), f(this, U, e == null ? void 0 : e.limit), f(this, N, e == null ? void 0 : e.dragDom), f(this, I, {
935
+ f(this, y, t), f(this, U, e == null ? void 0 : e.limit), f(this, N, e == null ? void 0 : e.dragDom), f(this, I, {
938
936
  mousedown: this.mousedown.bind(this),
939
937
  mousemove: this.mousemove.bind(this),
940
938
  mouseup: this.mouseup.bind(this)
@@ -945,18 +943,18 @@ class te {
945
943
  }
946
944
  bindOrUnbindEvent(t) {
947
945
  const e = t === "bind" ? "addEventListener" : "removeEventListener";
948
- if (!a(this, v)) return console.error("No DOM");
949
- a(this, v)[e]("mousedown", a(this, I).mousedown), document[e]("mousemove", a(this, I).mousemove), document[e]("mouseup", a(this, I).mouseup);
946
+ if (!a(this, y)) return console.error("No DOM");
947
+ a(this, y)[e]("mousedown", a(this, I).mousedown), document[e]("mousemove", a(this, I).mousemove), document[e]("mouseup", a(this, I).mouseup);
950
948
  }
951
949
  alterLocation() {
952
- if (!a(this, v)) return console.error("No DOM");
953
- a(this, U) && (f(this, C, Math.min(a(this, C), a(this, U).max.top)), f(this, C, Math.max(a(this, C), a(this, U).min.top)), f(this, L, Math.min(a(this, L), a(this, U).max.left)), f(this, L, Math.max(a(this, L), a(this, U).min.left))), a(this, v).style.setProperty("--top", a(this, C) + "px"), a(this, v).style.setProperty("--left", a(this, L) + "px");
950
+ if (!a(this, y)) return console.error("No DOM");
951
+ a(this, U) && (f(this, C, Math.min(a(this, C), a(this, U).max.top)), f(this, C, Math.max(a(this, C), a(this, U).min.top)), f(this, L, Math.min(a(this, L), a(this, U).max.left)), f(this, L, Math.max(a(this, L), a(this, U).min.left))), a(this, y).style.setProperty("--top", a(this, C) + "px"), a(this, y).style.setProperty("--left", a(this, L) + "px");
954
952
  }
955
953
  mousedown(t) {
956
- if (!a(this, v)) return console.error("No DOM");
954
+ if (!a(this, y)) return console.error("No DOM");
957
955
  if (a(this, N) && t.target != a(this, N)) return;
958
956
  document.body.classList.add("no-select"), f(this, j, !0);
959
- const e = a(this, v).getBoundingClientRect(), { pageX: r, pageY: o } = t;
957
+ const e = a(this, y).getBoundingClientRect(), { pageX: r, pageY: o } = t;
960
958
  f(this, z, r), f(this, O, o), f(this, C, e.y), f(this, L, e.x);
961
959
  }
962
960
  mousemove(t) {
@@ -967,23 +965,23 @@ class te {
967
965
  a(this, j) && (f(this, j, !1), document.body.classList.remove("no-select"));
968
966
  }
969
967
  }
970
- v = new WeakMap(), j = new WeakMap(), I = new WeakMap(), z = new WeakMap(), O = new WeakMap(), C = new WeakMap(), L = new WeakMap(), U = new WeakMap(), N = new WeakMap();
971
- var b, A, S, q, Y, _, M, x, $, X;
972
- class ee {
968
+ y = new WeakMap(), j = new WeakMap(), I = new WeakMap(), z = new WeakMap(), O = new WeakMap(), C = new WeakMap(), L = new WeakMap(), U = new WeakMap(), N = new WeakMap();
969
+ var b, A, S, q, $, _, M, x, Y, X;
970
+ class ne {
973
971
  constructor() {
974
972
  h(this, b);
975
973
  h(this, A, !1);
976
974
  h(this, S, {});
977
975
  h(this, q, 0);
978
- h(this, Y, 0);
976
+ h(this, $, 0);
979
977
  h(this, _, 0);
980
978
  h(this, M, 0);
981
979
  h(this, x);
982
- h(this, $);
980
+ h(this, Y);
983
981
  h(this, X);
984
982
  }
985
983
  init(t, e = {}) {
986
- f(this, b, t), f(this, x, e.limit), f(this, $, e.update_move), f(this, X, e.update_up), f(this, S, {
984
+ f(this, b, t), f(this, x, e.limit), f(this, Y, e.update_move), f(this, X, e.update_up), f(this, S, {
987
985
  mousedown: this.mousedown.bind(this),
988
986
  mousemove: this.mousemove.bind(this),
989
987
  mouseup: this.mouseup.bind(this)
@@ -1014,43 +1012,59 @@ class ee {
1014
1012
  }
1015
1013
  alterLocation() {
1016
1014
  if (!a(this, b)) return console.error("No DOM");
1017
- a(this, x) && (f(this, _, Math.min(a(this, _), a(this, x).max.top)), f(this, _, Math.max(a(this, _), a(this, x).min.top)), f(this, M, Math.min(a(this, M), a(this, x).max.left)), f(this, M, Math.max(a(this, M), a(this, x).min.left))), a(this, $) && a(this, $).call(this, this.updateValue()), a(this, b).style.setProperty("--top", a(this, _) + "px"), a(this, b).style.setProperty("--left", a(this, M) + "px");
1015
+ a(this, x) && (f(this, _, Math.min(a(this, _), a(this, x).max.top)), f(this, _, Math.max(a(this, _), a(this, x).min.top)), f(this, M, Math.min(a(this, M), a(this, x).max.left)), f(this, M, Math.max(a(this, M), a(this, x).min.left))), a(this, Y) && a(this, Y).call(this, this.updateValue()), a(this, b).style.setProperty("--top", a(this, _) + "px"), a(this, b).style.setProperty("--left", a(this, M) + "px");
1018
1016
  }
1019
1017
  mousedown(t) {
1020
1018
  if (!a(this, b)) return console.error("No DOM");
1021
1019
  document.body.classList.add("no-select"), f(this, A, !0);
1022
1020
  const e = a(this, b).getBoundingClientRect();
1023
- f(this, Y, e.y), f(this, q, e.x);
1021
+ f(this, $, e.y), f(this, q, e.x);
1024
1022
  const { pageX: r, pageY: o } = t;
1025
- f(this, _, o - a(this, Y)), f(this, M, r - a(this, q)), this.alterLocation();
1023
+ f(this, _, o - a(this, $)), f(this, M, r - a(this, q)), this.alterLocation();
1026
1024
  }
1027
1025
  mousemove(t) {
1028
1026
  const { pageX: e, pageY: r } = t;
1029
- a(this, A) && (f(this, _, r - a(this, Y)), f(this, M, e - a(this, q)), this.alterLocation());
1027
+ a(this, A) && (f(this, _, r - a(this, $)), f(this, M, e - a(this, q)), this.alterLocation());
1030
1028
  }
1031
1029
  mouseup() {
1032
1030
  a(this, A) && (f(this, A, !1), document.body.classList.remove("no-select"), a(this, X) && a(this, X).call(this, this.updateValue()));
1033
1031
  }
1034
1032
  }
1035
- b = new WeakMap(), A = new WeakMap(), S = new WeakMap(), q = new WeakMap(), Y = new WeakMap(), _ = new WeakMap(), M = new WeakMap(), x = new WeakMap(), $ = new WeakMap(), X = new WeakMap();
1036
- function mt(n) {
1037
- const t = n || document.documentElement;
1033
+ b = new WeakMap(), A = new WeakMap(), S = new WeakMap(), q = new WeakMap(), $ = new WeakMap(), _ = new WeakMap(), M = new WeakMap(), x = new WeakMap(), Y = new WeakMap(), X = new WeakMap();
1034
+ function K(n) {
1035
+ if (typeof n == "string") {
1036
+ const t = document.querySelector(n);
1037
+ if (!t) throw new Error(`Element "${n}" not found`);
1038
+ return t;
1039
+ } else
1040
+ return n || document.documentElement;
1041
+ }
1042
+ function dt(n) {
1043
+ const t = K(n);
1038
1044
  return t.requestFullscreen ? t.requestFullscreen() : t.mozRequestFullScreen ? t.mozRequestFullScreen() : t.webkitRequestFullscreen ? t.webkitRequestFullscreen() : t.msRequestFullscreen ? t.msRequestFullscreen() : Promise.reject("No Fullscreen API");
1039
1045
  }
1040
- function ft() {
1046
+ function ht() {
1041
1047
  const n = document;
1042
1048
  return document.exitFullscreen ? document.exitFullscreen() : n.mozCancelFullScreen ? n.mozCancelFullScreen() : n.webkitExitFullscreen ? n.webkitExitFullscreen() : n.msExitFullscreen ? n.msExitFullscreen() : Promise.reject("No ExitFullscreen API");
1043
1049
  }
1044
- function dt(n) {
1045
- const t = document, e = document.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement;
1046
- return n ? n == e : document.documentElement == e || screen.width == window.innerWidth && screen.height == window.innerHeight;
1050
+ function st(n) {
1051
+ const t = K(n), e = document, r = document.fullscreenElement || e.webkitFullscreenElement || e.mozFullScreenElement || e.msFullscreenElement;
1052
+ return t == r;
1047
1053
  }
1048
- function ne(n) {
1049
- return function() {
1050
- dt(n) ? ft() : mt(n);
1054
+ function re(n) {
1055
+ return n = K(n), function() {
1056
+ st(n) ? ht() : dt(n);
1057
+ };
1058
+ }
1059
+ function oe(n, t) {
1060
+ const e = K(t), r = () => {
1061
+ n(st(e));
1062
+ };
1063
+ return document.addEventListener("fullscreenchange", r), document.addEventListener("webkitfullscreenchange", r), document.addEventListener("mozfullscreenchange", r), document.addEventListener("MSFullscreenChange", r), r(), () => {
1064
+ document.removeEventListener("fullscreenchange", r), document.removeEventListener("webkitfullscreenchange", r), document.removeEventListener("mozfullscreenchange", r), document.removeEventListener("MSFullscreenChange", r);
1051
1065
  };
1052
1066
  }
1053
- function re(n, t) {
1067
+ function ie(n, t) {
1054
1068
  if (typeof n == "number") return n;
1055
1069
  if (/px/.test(n)) return Number(n.replace(/px/, "")) || 0;
1056
1070
  const e = document.createElement("div");
@@ -1058,7 +1072,7 @@ function re(n, t) {
1058
1072
  const r = e.getBoundingClientRect().width;
1059
1073
  return t.removeChild(e), r;
1060
1074
  }
1061
- function oe(n, t) {
1075
+ function se(n, t) {
1062
1076
  if (!n) return;
1063
1077
  let e, r;
1064
1078
  if (typeof t == "string") {
@@ -1075,7 +1089,7 @@ function oe(n, t) {
1075
1089
  const o = e / r;
1076
1090
  return o > n ? [n * r, r] : o < n ? [e, e / n] : [e, r];
1077
1091
  }
1078
- function ie(n, t = 5e3) {
1092
+ function ce(n, t = 5e3) {
1079
1093
  return new Promise((e, r) => {
1080
1094
  const o = new Image();
1081
1095
  o.src = n;
@@ -1091,17 +1105,17 @@ function ie(n, t = 5e3) {
1091
1105
  }, o.crossOrigin = "Anonymous";
1092
1106
  });
1093
1107
  }
1094
- function se(n) {
1108
+ function ae(n) {
1095
1109
  return new Promise((t, e) => {
1096
1110
  fetch(n).then((r) => t(r.text())).catch((r) => {
1097
1111
  console.error("Error fetching :", r), e(r);
1098
1112
  });
1099
1113
  });
1100
1114
  }
1101
- function ht(n, t) {
1115
+ function pt(n, t) {
1102
1116
  return new Promise((e, r) => {
1103
1117
  try {
1104
- t = t || J(n, "downloaded_file"), fetch(n).then((o) => (o.ok || r(`文件下载失败,状态码: ${o.status}`), o.blob())).then((o) => {
1118
+ t = t || Q(n, "downloaded_file"), fetch(n).then((o) => (o.ok || r(`文件下载失败,状态码: ${o.status}`), o.blob())).then((o) => {
1105
1119
  const i = URL.createObjectURL(o), s = document.createElement("a");
1106
1120
  s.href = i, s.download = decodeURIComponent(t), document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(i), e(o);
1107
1121
  }).catch(r);
@@ -1110,24 +1124,24 @@ function ht(n, t) {
1110
1124
  }
1111
1125
  });
1112
1126
  }
1113
- function ce(n, t, e) {
1127
+ function le(n, t, e) {
1114
1128
  if (!e) {
1115
1129
  let i = t.replace(/^[^.]+./, "");
1116
1130
  i = i == t ? "text/plain" : "application/" + i, e = { type: i };
1117
1131
  }
1118
1132
  const r = new Blob(n, e), o = URL.createObjectURL(r);
1119
- ht(o, t);
1133
+ pt(o, t);
1120
1134
  }
1121
- const pt = Math.PI / 2, G = Math.PI / 180, Z = 6378137, gt = 85.05112878;
1122
- function ae(n, t) {
1123
- const e = Math.max(Math.min(n, 180), -180), r = Math.max(Math.min(t, gt), -85.05112878), o = e * G * Z, i = r * G, s = Math.log(Math.tan(Math.PI / 4 + i / 2)) * Z;
1135
+ const gt = Math.PI / 2, G = Math.PI / 180, Z = 6378137, xt = 85.05112878;
1136
+ function ue(n, t) {
1137
+ const e = Math.max(Math.min(n, 180), -180), r = Math.max(Math.min(t, xt), -85.05112878), o = e * G * Z, i = r * G, s = Math.log(Math.tan(Math.PI / 4 + i / 2)) * Z;
1124
1138
  return [o, s];
1125
1139
  }
1126
- function le(n, t) {
1127
- const e = n / Z / G, r = (2 * Math.atan(Math.exp(t / Z)) - pt) / G;
1140
+ function me(n, t) {
1141
+ const e = n / Z / G, r = (2 * Math.atan(Math.exp(t / Z)) - gt) / G;
1128
1142
  return [e, r];
1129
1143
  }
1130
- function ue(n, t, e) {
1144
+ function fe(n, t, e) {
1131
1145
  const [r, o] = n, [i, s] = t, [c, u] = e, l = (c - i) ** 2 + (u - s) ** 2;
1132
1146
  if (l === 0) return Math.sqrt((r - i) ** 2 + (o - s) ** 2);
1133
1147
  let m = ((r - i) * (c - i) + (o - s) * (u - s)) / l;
@@ -1135,21 +1149,21 @@ function ue(n, t, e) {
1135
1149
  (r - (i + m * (c - i))) ** 2 + (o - (s + m * (u - s))) ** 2
1136
1150
  );
1137
1151
  }
1138
- function me(n, t, e, r, o, i = 1, s = 1) {
1152
+ function de(n, t, e, r, o, i = 1, s = 1) {
1139
1153
  const c = n + e * Math.cos(r) * i, u = t + e * Math.sin(r) * s, l = n + e * Math.cos(o) * i, m = t + e * Math.sin(o) * s;
1140
1154
  return [
1141
1155
  [c, u],
1142
1156
  [l, m]
1143
1157
  ];
1144
1158
  }
1145
- function fe(n, t, e, r) {
1146
- return Math.sqrt(Math.pow(e - n, 2) + Math.pow(r - t, 2));
1159
+ function he(n, t, e, r) {
1160
+ return Math.hypot(Math.abs(e - n), Math.abs(r - t));
1147
1161
  }
1148
- function de(n, t, e, r) {
1162
+ function pe(n, t, e, r) {
1149
1163
  const o = (n + e) / 2, i = (t + r) / 2;
1150
1164
  return { x: o, y: i };
1151
1165
  }
1152
- function he(n, t, e, r) {
1166
+ function ge(n, t, e, r) {
1153
1167
  const [o, i] = n, [s, c] = t;
1154
1168
  let u = 1 / 0;
1155
1169
  if (s !== 0) {
@@ -1179,7 +1193,7 @@ class D {
1179
1193
  }) : t ? (e = this.resolve) == null || e.call(this) : (r = this.reject) == null || r.call(this), t;
1180
1194
  }
1181
1195
  }
1182
- class xt extends D {
1196
+ class wt extends D {
1183
1197
  constructor(t) {
1184
1198
  super(), this.resolve = t;
1185
1199
  }
@@ -1198,7 +1212,7 @@ class xt extends D {
1198
1212
  return new D(this.resolve, e);
1199
1213
  }
1200
1214
  }
1201
- class wt extends D {
1215
+ class vt extends D {
1202
1216
  constructor(t) {
1203
1217
  super(), this.reject = t;
1204
1218
  }
@@ -1237,7 +1251,7 @@ const p = class p {
1237
1251
  var o, i;
1238
1252
  return (i = (o = p.tips)[t]) == null ? void 0 : i.call(o, ...e);
1239
1253
  };
1240
- return new xt(r);
1254
+ return new wt(r);
1241
1255
  };
1242
1256
  }
1243
1257
  static rejectTip(t) {
@@ -1246,7 +1260,7 @@ const p = class p {
1246
1260
  var o, i;
1247
1261
  return (i = (o = p.tips)[t]) == null ? void 0 : i.call(o, ...e);
1248
1262
  };
1249
- return new wt(r);
1263
+ return new vt(r);
1250
1264
  };
1251
1265
  }
1252
1266
  };
@@ -1258,65 +1272,66 @@ F(p, "tips", {
1258
1272
  }), F(p, "info", p.resolveTip("info")), F(p, "success", p.resolveTip("success")), F(p, "warning", p.rejectTip("warning")), F(p, "error", p.rejectTip("error"));
1259
1273
  let B = p;
1260
1274
  export {
1261
- bt as _Animate_CreateOscillator,
1262
- _t as _Animate_NumericTransition,
1263
- vt as _Animate_Schedule,
1264
- Mt as _Blob_ConvertDataToImageUrl,
1265
- Ft as _Browser_CopyToClipboard,
1266
- Et as _Browser_GetFrameRate,
1267
- ct as _Browser_KeyedWindowManager,
1268
- oe as _Element_CalculateCanvasSize,
1269
- Qt as _Element_CloseOnOutsideClick,
1270
- te as _Element_Drag,
1271
- mt as _Element_EnterFullscreen,
1272
- ft as _Element_ExitFullscreen,
1273
- ne as _Element_Fullscreen,
1274
- re as _Element_GetOtherSizeInPixels,
1275
- dt as _Element_IsFullscreen,
1276
- ie as _Element_LoadImage,
1277
- ee as _Element_LocalDrag,
1278
- Jt as _Element_ScrollEndListener,
1279
- ce as _File_CreateAndDownload,
1280
- ht as _File_Download,
1281
- se as _File_Read,
1282
- jt as _Format_CamelCase,
1283
- Ct as _Format_CapitalizeFirstLetter,
1284
- It as _Format_ExcludeSubstring,
1285
- Ut as _Format_FileSize,
1286
- J as _Format_HrefName,
1287
- Tt as _Format_NumberWithCommas,
1288
- Pt as _Format_NumberWithUnit,
1289
- Lt as _Format_Percentage,
1290
- Rt as _Format_Timestamp,
1291
- fe as _Math_CalculateDistance2D,
1292
- me as _Math_GetArcPoints,
1293
- he as _Math_GetBoundaryIntersection,
1294
- de as _Math_GetMidpoint,
1295
- ae as _Math_LngLatToPlane,
1296
- le as _Math_PlaneToLngLat,
1297
- ue as _Math_PointToLineDistance,
1275
+ _t as _Animate_CreateOscillator,
1276
+ Mt as _Animate_NumericTransition,
1277
+ bt as _Animate_Schedule,
1278
+ Et as _Blob_ConvertDataToImageUrl,
1279
+ Ct as _Browser_CopyToClipboard,
1280
+ Ft as _Browser_GetFrameRate,
1281
+ lt as _Browser_KeyedWindowManager,
1282
+ se as _Element_CalculateCanvasSize,
1283
+ te as _Element_CloseOnOutsideClick,
1284
+ ee as _Element_Drag,
1285
+ dt as _Element_EnterFullscreen,
1286
+ ht as _Element_ExitFullscreen,
1287
+ re as _Element_Fullscreen,
1288
+ oe as _Element_FullscreenObserver,
1289
+ ie as _Element_GetOtherSizeInPixels,
1290
+ st as _Element_IsFullscreen,
1291
+ ce as _Element_LoadImage,
1292
+ ne as _Element_LocalDrag,
1293
+ Qt as _Element_ScrollEndListener,
1294
+ le as _File_CreateAndDownload,
1295
+ pt as _File_Download,
1296
+ ae as _File_Read,
1297
+ It as _Format_CamelCase,
1298
+ Lt as _Format_CapitalizeFirstLetter,
1299
+ At as _Format_ExcludeSubstring,
1300
+ Rt as _Format_FileSize,
1301
+ Q as _Format_HrefName,
1302
+ Pt as _Format_NumberWithCommas,
1303
+ Ut as _Format_NumberWithUnit,
1304
+ Tt as _Format_Percentage,
1305
+ jt as _Format_Timestamp,
1306
+ he as _Math_CalculateDistance2D,
1307
+ de as _Math_GetArcPoints,
1308
+ ge as _Math_GetBoundaryIntersection,
1309
+ pe as _Math_GetMidpoint,
1310
+ ue as _Math_LngLatToPlane,
1311
+ me as _Math_PlaneToLngLat,
1312
+ fe as _Math_PointToLineDistance,
1298
1313
  B as _Tip,
1299
- Gt as _Utility_Clone,
1300
- ut as _Utility_Debounce,
1301
- qt as _Utility_ExecuteWhenIdle,
1302
- $t as _Utility_GenerateUUID,
1303
- Ht as _Utility_GetTargetByPath,
1304
- Bt as _Utility_InitTargetByPath,
1305
- Q as _Utility_MergeObjects,
1306
- Vt as _Utility_RotateList,
1307
- Wt as _Utility_SetTargetByPath,
1308
- Kt as _Utility_Sleep,
1309
- Xt as _Utility_Throttle,
1310
- Zt as _Utility_TimeConsumption,
1314
+ Zt as _Utility_Clone,
1315
+ ft as _Utility_Debounce,
1316
+ $t as _Utility_ExecuteWhenIdle,
1317
+ Xt as _Utility_GenerateUUID,
1318
+ Wt as _Utility_GetTargetByPath,
1319
+ Ht as _Utility_InitTargetByPath,
1320
+ tt as _Utility_MergeObjects,
1321
+ Gt as _Utility_RotateList,
1322
+ Vt as _Utility_SetTargetByPath,
1323
+ Jt as _Utility_Sleep,
1324
+ Bt as _Utility_Throttle,
1325
+ Kt as _Utility_TimeConsumption,
1311
1326
  Yt as _Utility_WaitForCondition,
1312
- Nt as _Valid_CheckConnectionWithXHR,
1313
- rt as _Valid_DataType,
1314
- zt as _Valid_DoesInfiniteLineIntersectRectangle,
1315
- ot as _Valid_FileTypeChecker,
1316
- St as _Valid_Is2DNumberArray,
1317
- kt as _Valid_IsInMargin,
1318
- lt as _Valid_IsNumberArray,
1319
- At as _Valid_IsObject,
1320
- Dt as _Valid_IsPointInPolygon,
1321
- Ot as _Valid_IsSecureContext
1327
+ qt as _Valid_CheckConnectionWithXHR,
1328
+ ot as _Valid_DataType,
1329
+ Ot as _Valid_DoesInfiniteLineIntersectRectangle,
1330
+ it as _Valid_FileTypeChecker,
1331
+ kt as _Valid_Is2DNumberArray,
1332
+ Dt as _Valid_IsInMargin,
1333
+ mt as _Valid_IsNumberArray,
1334
+ St as _Valid_IsObject,
1335
+ zt as _Valid_IsPointInPolygon,
1336
+ Nt as _Valid_IsSecureContext
1322
1337
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhanh-pure-function",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "纯函数工具",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",