minutool 1.0.18 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +128 -55
- package/dist/minutool.js +986 -886
- package/dist/minutool.js.map +1 -1
- package/dist/minutool.umd.cjs +5 -5
- package/dist/minutool.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/minutool.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(o,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(o=typeof globalThis<"u"?globalThis:o||self,S(o.Minutool={}))})(this,function(o){"use strict";const S=(e,t)=>{let n=[];for(let i in e)n.push(e[i][t]);return n},We=(e,t)=>{for(let n in e)if(e[n]===t)return n;return null},Ke=(e,t)=>{let n=new Map;return e.filter((i,a)=>{let l=t?t(i,a):i;if(!n.has(l))return n.set(l,!0),!0})},Je=(e,t,n)=>{if(!e||!e.length)return e;let i={};if(e.forEach(l=>{let u=l[t];i[u]||(i[u]=[]),i[u].push(l)}),!n)return i;let a={};for(let l in i)a[l]=i[l][0];return a},Ve=e=>Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{}),Qe=(e,t)=>{let n=e.length;if(t<1||!n)return[];if(t>n)return[e];let i=[],a=Math.floor(n/t),l=n%t;for(let u=1;u<=a;u++)i.push(e.splice(0,t));return l&&i.push(e.splice(0,l)),i},Xe=e=>{let t=-1;for(let n=e.length-1;n>=0;n--)if(e[n]){t=n;break}return e.slice(0,t+1)},Ze=(1+Math.sqrt(5))/2-1,I=96,et=(e,t=I)=>e/25.4*t,tt=e=>Math.round(e*56.6929),nt=e=>e*2.83464566929,it=e=>e/2.83464566929,at=(e,t=I)=>25.4*e/t,ot=(e,t,n)=>Math.min(Math.max(e,t),n),T=(e,t,n,i=!0)=>i?e>=t&&e<=n:e>t&&e<n,rt=(e,t)=>Math.floor(Math.random()*(t+1-e))+e,lt=(e,t=2)=>{let n=Math.pow(10,t);return Math.round(e*n)/n},_=e=>typeof e=="number"?!!isFinite(e):typeof e!="string"?!1:!isNaN(parseFloat(e)),ct=(...e)=>{let t=0;return e.forEach(n=>{if(typeof n=="number"&&_(n)){const i=n.toString().split(".")[1];i&&(t=Math.max(t,i.length))}}),t},st=e=>(e=Math.abs(Number(e)),e===0?1:Math.floor(Math.log10(e))+1);function ne(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}const pt=(e,t="")=>{if(typeof e=="number")return{val:e,unit:t};if(_(e))return{val:parseFloat(e),unit:t};const n=/^(-?[\d.]+)([a-z%]+)$/i,i=e.trim().match(n);if(!i)throw new Error("unit parse fail:"+e);return{val:parseFloat(i[1]),unit:i[2].toLowerCase()}},ie=(e,t=0)=>_(e)?parseFloat(e):t,ut=e=>(e+"").replace(/\\(.?)/g,function(t,n){switch(n){case"\\":return"\\";case"0":return"\0";case"":return"";default:return n}}),mt=(e,t,n="...")=>{let i=/[^\x00-\xff]/g;if(e.replace(i,"mm").length<=t)return e;let a=Math.floor(t/2);for(let l=a;l<e.length;l++)if(e.substr(0,l).replace(i,"mm").length>=t)return e.substr(0,l)+n;return e},dt=(e,t)=>{const n=Object.keys(t),i=Object.values(t);return new Function(...n,`return \`${e}\`;`)(...i)};function ft(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase())}function gt(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function ht(e,t,n="..."){return e.length<=t?e:e.slice(0,t)+n}const O=e=>(e+"").replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g,"\\$1"),ae=e=>{let t="",n=0,i=0,a=0,l=0;for(;n<e.length;)i=e.charCodeAt(n),i<128?(t+=String.fromCharCode(i),n++):i>191&&i<224?(a=e.charCodeAt(n+1),t+=String.fromCharCode((i&31)<<6|a&63),n+=2):(a=e.charCodeAt(n+1),l=e.charCodeAt(n+2),t+=String.fromCharCode((i&15)<<12|(a&63)<<6|l&63),n+=3);return t},L=e=>{e=e.replace(/\r\n/g,"n");let t="";for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):i>127&&i<2048?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(i&63|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(i&63|128))}return t},Tt=e=>{let t=0,n=e.length,i=-1;for(let a=0;a<n;a++)i=e.charCodeAt(a),i>=0&&i<=128?t+=1:t+=3;return t},wt="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890",oe=(e=6,t=wt)=>{let n="";for(let i=0;i<e;i++){let a=Math.round(Math.random()*(t.length-1));n+=t.substring(a,a+1)}return n},Et=(e=1,t=8)=>{let n=[];const i="bcdfghjklmnpqrstvwxyz",a="aeiou";for(;e-- >0;){let l="";for(let u=0;u<t;u=u+3)l+=i[Math.floor(Math.random()*i.length)],l+=a[Math.floor(Math.random()*a.length)],l+=i[Math.floor(Math.random()*i.length)];n.push(l)}return n},bt=(e,t=!1)=>{let n=[];return e.replace(/[-_\s+]/g," ").split(" ").forEach((i,a)=>{n.push(a===0&&!t?i:ne(i))}),n.join("")},H=0,k=1,re=2,yt=(e,t="",n=H)=>{if(t.length){let i=new RegExp("^["+O(t)+"]+"),a=new RegExp("["+O(t)+"]+$");return n===k?e.replace(i,""):n===re?e.replace(a,""):e.replace(i,"").replace(a,"")}else return n===H?e.trim():n===k?e.trimStart():e.trimEnd()},Mt=(e,t)=>{let n=[];for(let i=0;i<e.length;i+=t)n.push(e.slice(i,i+t));return n},vt=e=>/[\u4e00-\u9fa5]/.test(e),E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",At=e=>{let t="",n,i,a,l,u,r,s,c=0;for(e=e.replace(/\+\+[++^A-Za-z0-9+/=]/g,"");c<e.length;)l=E.indexOf(e.charAt(c++)),u=E.indexOf(e.charAt(c++)),r=E.indexOf(e.charAt(c++)),s=E.indexOf(e.charAt(c++)),n=l<<2|u>>4,i=(u&15)<<4|r>>2,a=(r&3)<<6|s,t=t+String.fromCharCode(n),r!==64&&(t=t+String.fromCharCode(i)),s!==64&&(t=t+String.fromCharCode(a));return t=ae(t),t},St=e=>L(e).replace("+","-").replace("/","_"),_t=e=>{let t="",n,i,a,l,u,r,s,c=0;for(e=L(e);c<e.length;)n=e.charCodeAt(c++),i=e.charCodeAt(c++),a=e.charCodeAt(c++),l=n>>2,u=(n&3)<<4|i>>4,r=(i&15)<<2|a>>6,s=a&63,isNaN(i)?r=s=64:isNaN(a)&&(s=64),t=t+E.charAt(l)+E.charAt(u)+E.charAt(r)+E.charAt(s);return t},le=async e=>await Nt(e),Nt=e=>new Promise((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=a=>n(a)}),ce=96,Ot=window.devicePixelRatio*ce,Ct=()=>window.innerWidth>window.innerHeight,Dt=()=>window.innerHeight>window.innerWidth,se=e=>{if(e.requestFullscreen)return e.requestFullscreen();if(e.webkitRequestFullScreen)return e.webkitRequestFullScreen();throw e.mozRequestFullScreen&&e.mozRequestFullScreen(),e.msRequestFullScreen&&e.msRequestFullScreen(),"Browser no allow full screen"},pe=()=>document.exitFullscreen(),xt=e=>new Promise((t,n)=>{ue()?pe().then(t).catch(n):se(e).then(t).catch(n)}),ue=()=>!!document.fullscreenElement,Rt=e=>{const t=navigator.language||navigator.userLanguage;if(e.includes(t))return t;const n=t.split("-")[0],i=e.find(a=>a.startsWith(n));return i||e[0]},me=()=>navigator.userAgent.toLowerCase().indexOf("firefox")>-1,It=(e,t,n,i="/",a)=>{let l="";if(n){let r=new Date;r.setTime(Date.now()+n*24*60*60*1e3),l="; expires="+r.toUTCString()}let u=e+"="+(t||"")+l+"; path="+i;a&&(u+="; domain="+a),document.cookie=u},Lt=e=>{let t=e+"=",n=document.cookie.split(";");for(let i=0;i<n.length;i++){let a=n[i];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null},C=(e,t="/",n)=>{let i=e+"=; Path="+t+"; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";n&&(i+=" Domain="+n+";"),document.cookie=i},Ht=(e,t)=>{const n=(t||(location==null?void 0:location.hostname)).split(".");for(;n.length>1;)C(e,"/",n.join(".")),C(e,"/","."+n.join(".")),n.shift();C(e)};let kt=0;const de=(e="")=>"guid_"+(e||oe(6))+ ++kt,Ft=(e,t)=>{let n,i,a=0;return function(){let l=+new Date;n=this,i=arguments,l-a>t&&(e.apply(n,i),a=l)}},Pt=(e,t)=>{let n,i,a=0,l=!1;return function(){if(l)return;let u=+new Date;n=this,i=arguments;let r=t-(u-a);r<=0?(e.apply(n,i),a=u):(l=!0,setTimeout(()=>{e.apply(n,i),l=!1,a=u},r))}},Ut=(e,t)=>{let n;return function(){let i=this,a=arguments;clearTimeout(n),n=setTimeout(function(){e.apply(i,a)},t)}},Bt=e=>e&&typeof e=="object"&&e.then&&typeof e.then=="function",Yt=e=>{let t=!1;try{JSON.parse(e),t=!0}catch{}return t},$t=e=>e&&typeof e=="object"&&!Array.isArray(e),qt=e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!1,fe=e=>typeof e!="string"||e.trim()===""?!1:/^(https?:\/\/|\/\/|\/|\.\.?\/*)/i.test(e),jt=e=>{let t=!1;try{JSON.parse(e),t=!0}catch{}return t},zt=()=>{let e=new Error().stack;console.log(e)},Gt=e=>{const t=M(e);t&&(t.style.display="none")},Wt=e=>{const t=M(e);t&&(t.style.display="")},Kt=e=>{let t=M(e);return t&&t.parentNode&&t.parentNode.removeChild(t)},F="disabled",ge=(e,t="")=>P(e,t,!1),he=(e,t="")=>P(e,t,!0),P=(e,t="",n=null)=>{let i=M(e),a=n===null?!i.classList.contains(F):!n;a&&we(`.${F} {pointer-event:none !important;}`,"__element_lock_style__"),i.classList.toggle(F,a),i[a?"setAttribute":"removeAttribute"]("disabled","disabled"),i[a?"setAttribute":"removeAttribute"]("data-disabled","disabled"),t&&i.classList.toggle(t,a)},Jt=(e,t,n)=>{e=M(e);let i=!1;e.addEventListener("mouseenter",()=>{i||(i=!0,t&&t())}),e.addEventListener("mouseleave",()=>{i&&(i=!1,n&&n())})},Vt=(e,t)=>{ge(e),t(()=>{he(e)})},Qt=e=>e.parentNode?Array.prototype.indexOf.call(e.parentNode.children,e):-1,U=(e,t=document)=>{if(typeof e=="string")return e=e.trim(),e.indexOf(":scope")!==0&&(e=":scope "+e),Array.from(t.querySelectorAll(e));if(Array.isArray(e)){let n=[];return e.forEach(i=>{n.push(...U(i))}),n}else return NodeList.prototype.isPrototypeOf(e)||HTMLCollection.prototype.isPrototypeOf(e)?Array.from(e):e instanceof HTMLElement?[e]:e},M=(e,t=document)=>typeof e=="string"?t.querySelector(e):e,Xt=e=>{let t=document.getElementsByTagName("*"),n=[];for(n=[];e&&e.nodeType===1;e=e.parentNode)if(e.hasAttribute("id")){let i=0;for(let a=0;a<t.length&&(t[a].hasAttribute("id")&&t[a].id===e.id&&i++,!(i>1));a++);if(i===1)return n.unshift('id("'+e.getAttribute("id")+'")'),n.join("/");n.unshift(e.localName.toLowerCase()+'[@id="'+e.getAttribute("id")+'"]')}else if(e.hasAttribute("class"))n.unshift(e.localName.toLowerCase()+'[@class="'+e.getAttribute("class")+'"]');else{let i,a;for(i=1,a=e.previousSibling;a;a=a.previousSibling)a.localName===e.localName&&i++;n.unshift(e.localName.toLowerCase()+"["+i+"]")}return n.length?"/"+n.join("/"):null},Zt=(e,t,n=!0)=>{const i="ON_DOM_TREE_CHANGE_BIND_"+de();let a=()=>{U(`input:not([${i}]), textarea:not([${i}]), select:not([${i}])`,e).forEach(l=>{l.setAttribute(i,"1"),l.addEventListener("change",t)})};Te(e,{attributes:!0,subtree:!0,childList:!0},()=>{n&&a(),t()},10),n&&a()},Te=(e,t,n,i=10)=>{let a=0,l=!1,u=new MutationObserver(()=>{if(l)return;let r=i-(Date.now()-a);r>0?(l=!0,setTimeout(()=>{l=!1,a=Date.now(),n(u)},r)):(a=Date.now(),n(u))});u.observe(e,t)},en=(e,t={left:0,top:0,width:window.innerWidth,height:window.innerHeight})=>{let n={left:e.left,top:e.top};return e.width>t.width||e.height>t.height||(e.width+e.left>t.width+t.left&&(n.left=e.left-(e.width+e.left-(t.width+t.left))),e.height+e.top>t.height+t.top&&(n.top=e.top-(e.height+e.top-(t.height+t.top))),e.left<t.left&&(n.left=t.left),e.top<t.top&&(n.top=t.top)),n},tn=(e,t)=>e.left<=t.left?e.left+e.width>=t.left&&(T(t.top,e.top,e.top+e.height)||T(t.top+t.height,e.top,e.top+e.height)||t.top>=e.top&&t.height>=e.height):t.left+t.width>=e.left&&(T(e.top,t.top,t.top+t.height)||T(e.top+e.height,t.top,t.top+t.height)||e.top>=t.top&&e.height>=t.height),nn=e=>e?!!(e.tabIndex>=0||e instanceof HTMLAnchorElement&&e.href||e instanceof HTMLButtonElement&&!e.disabled||e instanceof HTMLInputElement&&!e.disabled||e instanceof HTMLTextAreaElement&&!e.disabled):!1;let b={};const an=(e,t=!1)=>(!t&&e in b||(b[e]=new Promise((n,i)=>{let a=document.createElement("link");a.rel="stylesheet",a.href=e,a.onload=()=>{n()},a.onerror=()=>{i()},document.head.append(a)})),b[e]),on=(e,t=!1)=>(!t&&e in b||(b[e]=new Promise((n,i)=>{let a=document.createElement("script");a.src=e,a.onload=()=>{n()},a.onerror=()=>{i()},document.head.append(a)})),b[e]),rn=e=>{let t=e.style.visibility,n=e.style.display,i,a;return e.style.visibility="hidden",e.style.display="block",i=e.clientWidth,a=e.clientHeight,e.style.visibility=t,e.style.display=n,{width:i,height:a}},we=(e,t="",n=document)=>{if(t&&n.querySelector(`#${t}`))return n.querySelector(`#${t}`);let i=n.createElement("style");return n.head.appendChild(i),i.innerHTML=e,t&&(i.id=t),i},ln=(e,t)=>T(e.top,t.top,t.top+t.height)&&T(e.left,t.left,t.left+t.width)&&T(e.top+e.height,t.top,t.top+t.height)&&T(e.left+e.width,t.left,t.left+t.width),cn=e=>Math.pow(10,-e),sn=(e,t)=>{try{return new URL(e,t).href}catch{return e}},pn=(e,t=null)=>{let n=document.createElement("template");e=e.trim(),n.innerHTML=e;let i=[];return t?n.content.childNodes.forEach(a=>{i.push(t.appendChild(a))}):i=Array.from(n.content.childNodes),i.length===1?i[0]:i},Ee=(e,t=!1)=>{if(!e)throw new Error("el is null");const n=e.getBoundingClientRect();if(t&&!n.height){const i=e.style.visibility,a=e.style.display;e.style.visibility="hidden",e.style.display="block";const l=Ee(e);return e.style.visibility=i,e.style.display=a,l}return{top:n.top,left:n.left,right:n.right,bottom:n.bottom,width:n.width,height:n.height}},un=e=>{let t={};for(let n in e){const i=e[n];i!=null&&(t[`--${n}`]=`${i}`)}return t},B=new EventTarget,mn=new Map,Y=new Map;let dn=0;const fn="__MINUTOOL_SYM_EVENT__";function $(e){if(!Y.has(e)){const t=`${fn}${++dn}`;Y.set(e,t),mn.set(t,e)}return Y.get(e)}const gn=(e,t)=>{const n=e.map(i=>be(i,t));return()=>n.forEach(i=>i())},be=(e,t)=>(B.addEventListener(typeof e=="symbol"?$(e):e,t),()=>ye(e,t)),ye=(e,t)=>{B.removeEventListener(typeof e=="symbol"?$(e):e,t)},hn=(e,t=null)=>{B.dispatchEvent(new CustomEvent(typeof e=="symbol"?$(e):e,{detail:t}))},Tn=e=>e.replace(/[\\/:*?"<>|]/g,"_").replace(/[\0-\x1F]/g,"_").replace(/\s+/g," ").replace(/^\.+/,"").replace(/\.+$/,"").trim(),q=e=>new Promise((t,n)=>{const i=new FileReader;i.onload=()=>t(i.result),i.onerror=a=>n(a),i.readAsDataURL(e)}),Me={},j=(e,t=null)=>t!==null?(Me[e]=t,null):Me[e]||null,wn=async e=>{if(!e)return null;if(typeof e=="string"&&e.startsWith("data:"))return e;try{if(typeof e=="string"&&fe(e)){const t=await fetch(e);if(!t.ok)throw new Error(`Fetch failed: ${t.status}`);const n=await t.blob();return await q(n)}return e instanceof Blob?await q(e):null}catch(t){return console.warn("file2Base64DataURL failed:",t),null}},En=(e,t)=>{const n=document.createElement("a");n.rel="noopener noreferrer",n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)},z=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","CANVAS","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","NOSCRIPT","OL","P","PRE","SECTION","TABLE","TFOOT","UL","VIDEO"],bn=["A","ABBR","ACRONYM","B","BDO","BIG","BUTTON","CITE","CODE","DFN","EM","I","KBD","LABEL","MAP","OBJECT","OUTPUT","Q","S","SAMP","SCRIPT","SELECT","SMALL","SPAN","STRONG","SUB","SUP","TEXTAREA","TIME","TT","U","VAR"].concat(...z),yn=["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"],ve=["STYLE","COMMENT","SELECT","OPTION","SCRIPT","TITLE","HEAD","BUTTON","META","LINK","PARAM","SOURCE"],Mn=e=>(ve.forEach(n=>{e=e.replace(new RegExp(n,"ig"),"")}),e=e.replace(/[\r|\n]/g,""),e=e.replace(/<(\w+)([^>]*)>/g,function(n,i,a){return z.includes(i.toUpperCase())?`
|
|
2
|
-
`:""}),e=e.replace(/<\/(\w+)([^>]*)>/g,function(
|
|
3
|
-
`),
|
|
4
|
-
`);if(i.length<2)return n;let
|
|
5
|
-
`,(""+e).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">").replace(/\r\n/g,t).replace(/[\r\n]/g,t)),Dn=(e,t)=>{let n=e.split("");return t=t||0,n.map(i=>`&#${t?"x"+i.charCodeAt(0).toString(16):i.charCodeAt(0)};`).join("")},xn=(e,t,n='<span class="matched">%s</span>')=>t?e.replace(new RegExp(O(t),"ig"),i=>n.replace("%s",i)):e,Rn=e=>{if(!e.src)return null;if(e.src.indexOf("data:")===0)return e.src;let t=document.createElement("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");return n?(n.drawImage(e,0,0,e.width,e.height),t.toDataURL("image/png")):null},Se=e=>{const t=new XMLSerializer().serializeToString(e),n=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(n)},_e=e=>new Promise((t,n)=>{const i=Se(e),a=new Image;a.onload=()=>{t(a)},a.onerror=l=>{n(new Error("Failed to load SVG into Image:"+l))},a.src=i}),In=(e,t=null,n=null)=>(t=t||"image/png",new Promise((i,a)=>{const l=_(n)?ie(n):1;_e(e).then(u=>{const{width:r,height:s}=Ne(e),c=document.createElement("canvas");c.width=r*l,c.height=s*l,c.getContext("2d").drawImage(u,0,0,r*l,s*l),URL.revokeObjectURL(u.src),i(c.toDataURL(t))},a)})),Ne=e=>{if(!me())return e.getBBox();const t=e.cloneNode(!0),n=document.createElement("div");n.style.cssText="position:fixed;left:-9999px;top:-9999px;visibility:hidden;",n.appendChild(t),document.body.appendChild(n);const i=t.getBBox();return document.body.removeChild(n),i},Ln=(e,t=!1)=>new Promise((n,i)=>{if(t){const l=j(e);if(l)return n(l)}let a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="blob",a.onload=function(){if(this.status===200){let l=this.response;le(l).then(u=>{t&&j(e,u),n(u)}).catch(u=>{i(u)})}},a.onerror=function(){i("Error:"+this.statusText)},a.onabort=function(){i("Request abort")},a.send()}),y=(e,t)=>{let n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535},Hn=(e,t)=>e<<t|e>>>32-t,D=(e,t,n,i,a,l)=>y(Hn(y(y(t,e),y(i,l)),a),n),m=(e,t,n,i,a,l,u)=>D(t&n|~t&i,e,t,a,l,u),d=(e,t,n,i,a,l,u)=>D(t&i|n&~i,e,t,a,l,u),f=(e,t,n,i,a,l,u)=>D(t^n^i,e,t,a,l,u),g=(e,t,n,i,a,l,u)=>D(n^(t|~i),e,t,a,l,u),x=(e,t)=>{e[t>>5]|=128<<t%32,e[(t+64>>>9<<4)+14]=t;let n,i,a,l,u,r=1732584193,s=-271733879,c=-1732584194,p=271733878;for(n=0;n<e.length;n+=16)i=r,a=s,l=c,u=p,r=m(r,s,c,p,e[n],7,-680876936),p=m(p,r,s,c,e[n+1],12,-389564586),c=m(c,p,r,s,e[n+2],17,606105819),s=m(s,c,p,r,e[n+3],22,-1044525330),r=m(r,s,c,p,e[n+4],7,-176418897),p=m(p,r,s,c,e[n+5],12,1200080426),c=m(c,p,r,s,e[n+6],17,-1473231341),s=m(s,c,p,r,e[n+7],22,-45705983),r=m(r,s,c,p,e[n+8],7,1770035416),p=m(p,r,s,c,e[n+9],12,-1958414417),c=m(c,p,r,s,e[n+10],17,-42063),s=m(s,c,p,r,e[n+11],22,-1990404162),r=m(r,s,c,p,e[n+12],7,1804603682),p=m(p,r,s,c,e[n+13],12,-40341101),c=m(c,p,r,s,e[n+14],17,-1502002290),s=m(s,c,p,r,e[n+15],22,1236535329),r=d(r,s,c,p,e[n+1],5,-165796510),p=d(p,r,s,c,e[n+6],9,-1069501632),c=d(c,p,r,s,e[n+11],14,643717713),s=d(s,c,p,r,e[n],20,-373897302),r=d(r,s,c,p,e[n+5],5,-701558691),p=d(p,r,s,c,e[n+10],9,38016083),c=d(c,p,r,s,e[n+15],14,-660478335),s=d(s,c,p,r,e[n+4],20,-405537848),r=d(r,s,c,p,e[n+9],5,568446438),p=d(p,r,s,c,e[n+14],9,-1019803690),c=d(c,p,r,s,e[n+3],14,-187363961),s=d(s,c,p,r,e[n+8],20,1163531501),r=d(r,s,c,p,e[n+13],5,-1444681467),p=d(p,r,s,c,e[n+2],9,-51403784),c=d(c,p,r,s,e[n+7],14,1735328473),s=d(s,c,p,r,e[n+12],20,-1926607734),r=f(r,s,c,p,e[n+5],4,-378558),p=f(p,r,s,c,e[n+8],11,-2022574463),c=f(c,p,r,s,e[n+11],16,1839030562),s=f(s,c,p,r,e[n+14],23,-35309556),r=f(r,s,c,p,e[n+1],4,-1530992060),p=f(p,r,s,c,e[n+4],11,1272893353),c=f(c,p,r,s,e[n+7],16,-155497632),s=f(s,c,p,r,e[n+10],23,-1094730640),r=f(r,s,c,p,e[n+13],4,681279174),p=f(p,r,s,c,e[n],11,-358537222),c=f(c,p,r,s,e[n+3],16,-722521979),s=f(s,c,p,r,e[n+6],23,76029189),r=f(r,s,c,p,e[n+9],4,-640364487),p=f(p,r,s,c,e[n+12],11,-421815835),c=f(c,p,r,s,e[n+15],16,530742520),s=f(s,c,p,r,e[n+2],23,-995338651),r=g(r,s,c,p,e[n],6,-198630844),p=g(p,r,s,c,e[n+7],10,1126891415),c=g(c,p,r,s,e[n+14],15,-1416354905),s=g(s,c,p,r,e[n+5],21,-57434055),r=g(r,s,c,p,e[n+12],6,1700485571),p=g(p,r,s,c,e[n+3],10,-1894986606),c=g(c,p,r,s,e[n+10],15,-1051523),s=g(s,c,p,r,e[n+1],21,-2054922799),r=g(r,s,c,p,e[n+8],6,1873313359),p=g(p,r,s,c,e[n+15],10,-30611744),c=g(c,p,r,s,e[n+6],15,-1560198380),s=g(s,c,p,r,e[n+13],21,1309151649),r=g(r,s,c,p,e[n+4],6,-145523070),p=g(p,r,s,c,e[n+11],10,-1120210379),c=g(c,p,r,s,e[n+2],15,718787259),s=g(s,c,p,r,e[n+9],21,-343485551),r=y(r,i),s=y(s,a),c=y(c,l),p=y(p,u);return[r,s,c,p]},Oe=e=>{let t,n="",i=e.length*32;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n},W=e=>{let t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;let i=e.length*8;for(t=0;t<i;t+=8)n[t>>5]|=(e.charCodeAt(t/8)&255)<<t%32;return n},kn=e=>Oe(x(W(e),e.length*8)),Fn=(e,t)=>{let n,i=W(e),a=[],l=[],u;for(a[15]=l[15]=void 0,i.length>16&&(i=x(i,e.length*8)),n=0;n<16;n+=1)a[n]=i[n]^909522486,l[n]=i[n]^1549556828;return u=x(a.concat(W(t)),512+t.length*8),Oe(x(l.concat(u),640))},Ce=e=>{let t="0123456789abcdef",n="",i,a;for(a=0;a<e.length;a+=1)i=e.charCodeAt(a),n+=t.charAt(i>>>4&15)+t.charAt(i&15);return n},K=e=>unescape(encodeURIComponent(e)),De=e=>kn(K(e)),Pn=e=>Ce(De(e)),xe=(e,t)=>Fn(K(e),K(t)),Un=(e,t)=>Ce(xe(e,t)),Bn=(e,t,n)=>t?n?xe(t,e):Un(t,e):n?De(e):Pn(e),Yn="application/octet-stream",v="application/json",Re="application/x-www-form-urlencoded",Ie="multipart/form-data",$n="text/plain",qn="text/html",jn={323:"text/h323",accdb:"application/msaccess",accde:"application/msaccess",accdt:"application/msaccess",acx:"application/internet-property-stream",ai:"application/postscript",aif:"audio/x-aiff",aifc:"audio/aiff",aiff:"audio/aiff",application:"application/x-ms-application",art:"image/x-jg",asf:"video/x-ms-asf",asm:"text/plain",asr:"video/x-ms-asf",asx:"video/x-ms-asf",atom:"application/atom+xml",au:"audio/basic",avi:"video/x-msvideo",axs:"application/olescript",bas:"text/plain",bcpio:"application/x-bcpio",bmp:"image/bmp",c:"text/plain",calx:"application/vnd.ms-office.calx",cat:"application/vnd.ms-pki.seccat",cdf:"application/x-cdf",class:"application/x-java-applet",clp:"application/x-msclip",cmx:"image/x-cmx",cnf:"text/plain",cod:"image/cis-cod",cpio:"application/x-cpio",cpp:"text/plain",crd:"application/x-mscardfile",crl:"application/pkix-crl",crt:"application/x-x509-ca-cert",csh:"application/x-csh",css:"text/css",dcr:"application/x-director",der:"application/x-x509-ca-cert",dib:"image/bmp",dir:"application/x-director",disco:"text/xml",dll:"application/x-msdownload","dll.config":"text/xml",dlm:"text/dlm",doc:"application/msword",docm:"application/vnd.ms-word.document.macroEnabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroEnabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",dtd:"text/xml",dvi:"application/x-dvi",dwf:"drawing/x-dwf",dxr:"application/x-director",eml:"message/rfc822",eps:"application/postscript",etx:"text/x-setext",evy:"application/envoy","exe.config":"text/xml",fdf:"application/vnd.fdf",fif:"application/fractals",flr:"x-world/x-vrml",flv:"video/x-flv",gif:"image/gif",gtar:"application/x-gtar",gz:"application/x-gzip",h:"text/plain",hdf:"application/x-hdf",hdml:"text/x-hdml",hhc:"application/x-oleobject",hlp:"application/winhlp",hqx:"application/mac-binhex40",hta:"application/hta",htc:"text/x-component",htm:"text/html",html:"text/html",htt:"text/webviewhtml",hxt:"text/html",ico:"image/x-icon",ief:"image/ief",iii:"application/x-iphone",ins:"application/x-internet-signup",isp:"application/x-internet-signup",IVF:"video/x-ivf",jar:"application/java-archive",jck:"application/liquidmotion",jcz:"application/liquidmotion",jfif:"image/pjpeg",jpe:"image/jpeg",jpeg:"image/jpeg",jpg:"image/jpeg",js:"application/x-javascript",jsx:"text/jscript",latex:"application/x-latex",lit:"application/x-ms-reader",lsf:"video/x-la-asf",lsx:"video/x-la-asf",m13:"application/x-msmediaview",m14:"application/x-msmediaview",m1v:"video/mpeg",m3u:"audio/x-mpegurl",man:"application/x-troff-man",manifest:"application/x-ms-manifest",map:"text/plain",mdb:"application/x-msaccess",me:"application/x-troff-me",mht:"message/rfc822",mhtml:"message/rfc822",mid:"audio/mid",midi:"audio/mid",mmf:"application/x-smaf",mno:"text/xml",mny:"application/x-msmoney",mov:"video/quicktime",movie:"video/x-sgi-movie",mp2:"video/mpeg",mp3:"audio/mpeg",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"video/mpeg",mpp:"application/vnd.ms-project",mpv2:"video/mpeg",ms:"application/x-troff-ms",mvb:"application/x-msmediaview",mvc:"application/x-miva-compiled",nc:"application/x-netcdf",nsc:"video/x-ms-asf",nws:"message/rfc822",oda:"application/oda",odc:"text/x-ms-odc",ods:"application/oleobject",one:"application/onenote",onea:"application/onenote",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",osdx:"application/opensearchdescription+xml",p10:"application/pkcs10",p12:"application/x-pkcs12",p7b:"application/x-pkcs7-certificates",p7c:"application/pkcs7-mime",p7m:"application/pkcs7-mime",p7r:"application/x-pkcs7-certreqresp",p7s:"application/pkcs7-signature",pbm:"image/x-portable-bitmap",pdf:"application/pdf",pfx:"application/x-pkcs12",pgm:"image/x-portable-graymap",pko:"application/vnd.ms-pki.pko",pma:"application/x-perfmon",pmc:"application/x-perfmon",pml:"application/x-perfmon",pmr:"application/x-perfmon",pmw:"application/x-perfmon",png:"image/png",pnm:"image/x-portable-anymap",pnz:"image/png",pot:"application/vnd.ms-powerpoint",potm:"application/vnd.ms-powerpoint.template.macroEnabled.12",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",ppam:"application/vnd.ms-powerpoint.addin.macroEnabled.12",ppm:"image/x-portable-pixmap",pps:"application/vnd.ms-powerpoint",ppsm:"application/vnd.ms-powerpoint.slideshow.macroEnabled.12",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",ppt:"application/vnd.ms-powerpoint",pptm:"application/vnd.ms-powerpoint.presentation.macroEnabled.12",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",prf:"application/pics-rules",ps:"application/postscript",pub:"application/x-mspublisher",qt:"video/quicktime",qtl:"application/x-quicktimeplayer",ra:"audio/x-pn-realaudio",ram:"audio/x-pn-realaudio",ras:"image/x-cmu-raster",rf:"image/vnd.rn-realflash",rgb:"image/x-rgb",rm:"application/vnd.rn-realmedia",rmi:"audio/mid",roff:"application/x-troff",rpm:"audio/x-pn-realaudio-plugin",rtf:"application/rtf",rtx:"text/richtext",scd:"application/x-msschedule",sct:"text/scriptlet",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sgml:"text/sgml",sh:"application/x-sh",shar:"application/x-shar",sit:"application/x-stuffit",sldm:"application/vnd.ms-powerpoint.slide.macroEnabled.12",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",smd:"audio/x-smd",smx:"audio/x-smd",smz:"audio/x-smd",snd:"audio/basic",spc:"application/x-pkcs7-certificates",spl:"application/futuresplash",src:"application/x-wais-source",ssm:"application/streamingmedia",sst:"application/vnd.ms-pki.certstore",stl:"application/vnd.ms-pki.stl",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",svg:"image/svg+xml",swf:"application/x-shockwave-flash",t:"application/x-troff",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",texi:"application/x-texinfo",texinfo:"application/x-texinfo",tgz:"application/x-compressed",thmx:"application/vnd.ms-officetheme",tif:"image/tiff",tiff:"image/tiff",tr:"application/x-troff",trm:"application/x-msterminal",tsv:"text/tab-separated-values",txt:"text/plain",uls:"text/iuls",ustar:"application/x-ustar",vbs:"text/vbscript",vcf:"text/x-vcard",vcs:"text/plain",vdx:"application/vnd.ms-visio.viewer",vml:"text/xml",vsd:"application/vnd.visio",vss:"application/vnd.visio",vst:"application/vnd.visio",vsto:"application/x-ms-vsto",vsw:"application/vnd.visio",vsx:"application/vnd.visio",vtx:"application/vnd.visio",wav:"audio/wav",wax:"audio/x-ms-wax",wbmp:"image/vnd.wap.wbmp",wcm:"application/vnd.ms-works",wdb:"application/vnd.ms-works",wks:"application/vnd.ms-works",wm:"video/x-ms-wm",wma:"audio/x-ms-wma",wmd:"application/x-ms-wmd",wmf:"application/x-msmetafile",wml:"text/vnd.wap.wml",wmlc:"application/vnd.wap.wmlc",wmls:"text/vnd.wap.wmlscript",wmlsc:"application/vnd.wap.wmlscriptc",wmp:"video/x-ms-wmp",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wmz:"application/x-ms-wmz",wps:"application/vnd.ms-works",wri:"application/x-mswrite",wrl:"x-world/x-vrml",wrz:"x-world/x-vrml",wsdl:"text/xml",wvx:"video/x-ms-wvx",x:"application/directx",xaf:"x-world/x-vrml",xaml:"application/xaml+xml",xap:"application/x-silverlight-app",xbap:"application/x-ms-xbap",xbm:"image/x-xbitmap",xdr:"text/plain",xht:"application/xhtml+xml",xhtml:"application/xhtml+xml",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroEnabled.12",xlc:"application/vnd.ms-excel",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.12",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroEnabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",xml:"text/xml",xof:"x-world/x-vrml",xpm:"image/x-xpixmap",xps:"application/vnd.ms-xpsdocument",xsd:"text/xml",xsf:"text/xml",xsl:"text/xml",xslt:"text/xml",xwd:"image/x-xwindowdump",z:"application/x-compress",zip:"application/x-zip-compressed"},J=e=>{const t={};return e.replace(/^\?/,"").split("&").forEach(n=>{const[i,a]=n.split("=");i&&(t[decodeURIComponent(i)]=decodeURIComponent(a||""))}),t},Le=(e,t)=>{const[n,i]=e.split("?"),l={...i?J(i):{},...t},u=V(l);return`${n}?${u}`},V=e=>{if(typeof e>"u"||typeof e!="object")return e;let t=[];for(let n in e)if(e.hasOwnProperty(n)){if(e[n]===null)continue;typeof e[n]=="object"&&e[n].length?e[n].forEach(i=>{t.push(encodeURI(n+"="+i))}):typeof e[n]=="object"||t.push(encodeURI(n+"="+e[n]))}return t.join("&")};class He extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}const ke=(e,t={},n=0)=>{const i=new AbortController;let a=null;n&&(a=setTimeout(()=>i.abort(),n));const l=()=>{a!==null&&(clearTimeout(a),a=null)},u=s=>{const c=s,p=c.then.bind(c),Z=c.catch.bind(c),ee=c.finally.bind(c);return c.then=function(w,te){return u(p(w,te))},c.catch=function(w){return u(Z(w))},c.finally=function(w){return u(ee(w))},c.abort=w=>{l(),i.abort(new He(w||"request aborted."))},c},r=fetch(e,{...t,signal:i.signal}).then(s=>(l(),s)).catch(s=>{throw l(),s});return u(r)},zn=(e,t,n)=>{if(t==null)return;const i=e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase();n.set(i,String(t))},Gn=e=>["method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal","window"].includes(e),R=(e,t=null,n)=>{let{timeout:i,...a}=n;a=a||{},a.method=a.method||"GET";const l=a.method.toUpperCase()==="GET",u=new Headers(a.headers||{});for(let r in a)Gn(r)||zn(r,a[r],u);return l&&t&&(e=Le(e,typeof t=="string"?J(t):t),t=null),ke(e,{headers:u,body:l?void 0:Wn(t,u.get("content-type")||void 0),...a},i).then(r=>{if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return r})},Fe=e=>typeof e=="string"||e instanceof FormData||e instanceof URLSearchParams||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e),Wn=(e,t)=>{if(Fe(e)||typeof e!="object")return e;switch(t==null?void 0:t.toLowerCase()){case v:return JSON.stringify(e);case Re:case Ie:default:return V(e)}},Kn=(e,t=null,n={})=>R(e,t,{...n,ContentType:v,Accept:v}).then(i=>i.json()),Jn=(e,t=null,n={})=>R(e,t,{...n,method:"POST",ContentType:v,Accept:v}).then(i=>i.json()),Vn=(e,t,n=null,i={})=>{const a=new FormData;if(Object.keys(t).forEach(l=>{a.append(l,t[l],t[l].name)}),n)for(let l in n)n.hasOwnProperty(l)&&a.append(l,n[l]);return R(e,a,{...i,method:"POST"}).then(l=>l.json())};function Q(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array)return e.map(t=>Q(t));if(e instanceof Object){const t={};for(const n in e)e.hasOwnProperty(n)&&(t[n]=Q(e[n]));return t}return e}function Qn(e){return Object.keys(e).length===0}const Xn=(e,t)=>{let n={};for(let i in e)t[i]!==void 0?n[t[i]]=e[i]:n[i]=e[i];return n},Zn=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[n,t]));function ei(e,t,n){const i=t.split(".");let a=e;for(const l of i){if(a==null)return n;a=a[l]}return a!==void 0?a:n}function ti(e,t,n){const i=t.split("."),a=i.pop();let l=e;for(const u of i)(!(u in l)||typeof l[u]!="object")&&(l[u]={}),l=l[u];l[a]=n}function Pe(e,...t){for(const n of t)for(const i in n)if(n.hasOwnProperty(i)){const a=n[i],l=e[i];a&&typeof a=="object"&&!Array.isArray(a)&&l&&typeof l=="object"&&!Array.isArray(l)?e[i]=Pe(l,a):e[i]=a}return e}const Ue=(e,t=!1)=>{for(const n in e)e[n]===null?delete e[n]:t&&typeof e[n]=="object"&&Ue(e[n],!0);return e},ni=new Date().getFullYear(),ii=new Date().getMonth()+1,ai=new Date().getDate(),oi=60*1e3,ri=60*60*1e3,A=24*60*60*1e3,li=7*A,ci=30*A,si=31*A,pi=365*A,ui=366*A,mi=0,di=1,fi=2,gi=3,hi=4,Ti=5,wi=6,Be=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ye=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],$e=["January","February","March","April","May","June","July","August","September","October","November","December"],qe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ei=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],bi=["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],yi=["日","一","二","三","四","五","六"],Mi=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],vi=(e,t,n)=>{let i=()=>{if(t&&t(e),e-- >0){setTimeout(i,1e3);return}n&&n()};i()},Ai=e=>{if(!e||e<10)return"刚刚";e=Math.floor(e/1e3);const t=Math.floor(e/3600),n=Math.floor(e%3600/60),i=e%60;let a="";return t>0&&(a+=t+"小时"),(n>0||t>0)&&(a+=n+"分钟"),a+=i+"秒前",a},Si=(e,t=!1)=>{const n=new Date(e);return new Date(n.getTime()-n.getTimezoneOffset()*6e4).toISOString().slice(0,t?19:16)},_i=(e,t,n)=>e<=0?1/0:(Date.now()-n)/e*(t-e),je={d:e=>{let t=e.getDate();return(t<10?"0":"")+t},D:e=>Ye[e.getDay()],j:e=>e.getDate(),l:e=>Be[e.getDay()],N:e=>{let t=e.getDay();return t===0?7:t},S:e=>{let t=e.getDate();return t%10===1&&t!==11?"st":t%10===2&&t!==12?"nd":t%10===3&&t!==13?"rd":"th"},w:e=>e.getDay(),z:e=>{let t=new Date(e.getFullYear(),0,1);return Math.ceil((e.getTime()-t.getTime())/864e5)},W:e=>{let t=new Date(e.valueOf()),n=(e.getDay()+6)%7;t.setDate(t.getDate()-n+3);let i=t.valueOf();t.setMonth(0,1),t.getDay()!==4&&t.setMonth(0,1+(4-t.getDay()+7)%7);let a=1+Math.ceil((i-t.getTime())/6048e5);return a<10?"0"+a:a},F:e=>$e[e.getMonth()],m:e=>{let t=e.getMonth();return(t<9?"0":"")+(t+1)},M:e=>qe[e.getMonth()],n:e=>e.getMonth()+1,t:e=>{let t=e.getFullYear(),n=e.getMonth()+1;return n===12&&(t=t++,n=0),new Date(t,n,0).getDate()},L:e=>{let t=e.getFullYear();return t%400===0||t%100!==0&&t%4===0},o:e=>{let t=new Date(e.valueOf());return t.setDate(t.getDate()-(e.getDay()+6)%7+3),t.getFullYear()},Y:e=>e.getFullYear(),y:e=>(""+e.getFullYear()).substr(2),a:e=>e.getHours()<12?"am":"pm",A:e=>e.getHours()<12?"AM":"PM",B:e=>Math.floor(((e.getUTCHours()+1)%24+e.getUTCMinutes()/60+e.getUTCSeconds()/3600)*1e3/24),g:e=>e.getHours()%12||12,G:e=>e.getHours(),h:e=>{let t=e.getHours();return((t%12||12)<10?"0":"")+(t%12||12)},H:e=>{let t=e.getHours();return(t<10?"0":"")+t},i:e=>{let t=e.getMinutes();return(t<10?"0":"")+t},s:e=>{let t=e.getSeconds();return(t<10?"0":"")+t},v:e=>{let t=e.getMilliseconds();return(t<10?"00":t<100?"0":"")+t},e:e=>Intl.DateTimeFormat().resolvedOptions().timeZone,I:e=>{let t=null;for(let n=0;n<12;++n){let a=new Date(e.getFullYear(),n,1).getTimezoneOffset();if(t===null)t=a;else if(a<t){t=a;break}else if(a>t)break}return e.getTimezoneOffset()===t?1:0},O:e=>{let t=e.getTimezoneOffset();return(-t<0?"-":"+")+(Math.abs(t/60)<10?"0":"")+Math.floor(Math.abs(t/60))+(Math.abs(t%60)===0?"00":(Math.abs(t%60)<10?"0":"")+Math.abs(t%60))},P:e=>{let t=e.getTimezoneOffset();return(-t<0?"-":"+")+(Math.abs(t/60)<10?"0":"")+Math.floor(Math.abs(t/60))+":"+(Math.abs(t%60)===0?"00":(Math.abs(t%60)<10?"0":"")+Math.abs(t%60))},T:e=>{let t=e.toLocaleTimeString(navigator.language,{timeZoneName:"short"}).split(" ");return t[t.length-1]},Z:e=>-e.getTimezoneOffset()*60,c:e=>X("Y-m-d\\TH:i:sP",e),r:e=>e.toString(),U:e=>Math.floor(e.getTime()/1e3)},X=function(e,t=null){let n=null;return typeof t=="object"&&t!==null?n=t:n=new Date(t||Date.now()),e.replace(/(\\?)(.)/g,function(i,a,l){return a===""&&je[l]?String(je[l](n)):l})},ze=e=>{const t=new Date,n=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),i=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=n.formatToParts(t),l=i.formatToParts(t),u=p=>{const Z=p.find(h=>h.type==="year").value,ee=p.find(h=>h.type==="month").value,w=p.find(h=>h.type==="day").value,te=p.find(h=>h.type==="hour").value,Ci=p.find(h=>h.type==="minute").value,Di=p.find(h=>h.type==="second").value;return Date.UTC(Number(Z),Number(ee)-1,Number(w),Number(te),Number(Ci),Number(Di))},r=u(a),s=u(l);return(r-s)/1e3/60},Ge=e=>{const t=Math.floor(e/60),n=Math.abs(e%60);return`${t>=0?"+":"-"}${String(Math.abs(t)).padStart(2,"0")}:${String(n).padStart(2,"0")}`},Ni=e=>{const t=ze(e);return Ge(t)},Oi=e=>X("W",e);o.AbortError=He,o.BLOCK_TAGS=z,o.Base64Encode=_t,o.COMMON_DPI=ce,o.DATE_NOW=ai,o.DAY_FRIDAY=Ti,o.DAY_MONDAY=di,o.DAY_SATURDAY=wi,o.DAY_SUNDAY=mi,o.DAY_THURSDAY=hi,o.DAY_TUESDAY=fi,o.DAY_WEDNESDAY=gi,o.GOLDEN_RATIO=Ze,o.MIME_BINARY_DEFAULT=Yn,o.MIME_EXTENSION_MAP=jn,o.MIME_FORM=Re,o.MIME_HTML=qn,o.MIME_JSON=v,o.MIME_MULTIPART=Ie,o.MIME_TEXT=$n,o.MONTH_NAMES_CN=Ei,o.MONTH_NAMES_EN=$e,o.MONTH_NAMES_SHORT_CN=bi,o.MONTH_NAMES_SHORT_EN=qe,o.MONTH_NOW=ii,o.ONE_DAY=A,o.ONE_HOUR=ri,o.ONE_MINUTE=oi,o.ONE_MONTH30=ci,o.ONE_MONTH31=si,o.ONE_WEEK=li,o.ONE_YEAR365=pi,o.ONE_YEAR366=ui,o.PAIR_TAGS=bn,o.REMOVABLE_TAGS=ve,o.SCREEN_DPI=Ot,o.SELF_CLOSING_TAGS=yn,o.STAND_DPI=I,o.TRIM_BOTH=H,o.TRIM_LEFT=k,o.TRIM_RIGHT=re,o.WEEK_DAY_NAMES_CN=Mi,o.WEEK_DAY_NAMES_EN=Be,o.WEEK_DAY_NAMES_SHORT_CN=yi,o.WEEK_DAY_NAMES_SHORT_EN=Ye,o.YEAR_NOW=ni,o.abortableFetch=ke,o.arrayChunk=Qe,o.arrayColumn=S,o.arrayDistinct=Ke,o.arrayGroup=Je,o.arrayIndex=We,o.arraySortByKey=Ve,o.arrayTrimTail=Xe,o.base64Decode=At,o.base64UrlSafeEncode=St,o.between=T,o.blobToBase64=le,o.blobToDataUri=q,o.buildHtmlHidden=Nn,o.buildStyleVars=un,o.calcRemainingMSecs=_i,o.camelCase=ft,o.capitalize=ne,o.cleanNull=Ue,o.convertMinutesToTimezoneOffsetStr=Ge,o.countDown=vi,o.createDomByHtml=pn,o.cssSelectorEscape=An,o.cutString=mt,o.debounce=Ut,o.decodeHTMLEntities=_n,o.deepClone=Q,o.deleteCookie=C,o.deleteCookieAllPaths=Ht,o.detectLanguage=Rt,o.detectedPrecision=ct,o.digitCount=st,o.disabled=ge,o.dispatchEvent=hn,o.downloadFile=En,o.enabled=he,o.enterFullScreen=se,o.entityToString=Sn,o.escapeAttr=G,o.escapeHtml=Ae,o.exitFullScreen=pe,o.extract=dt,o.fileToBase64DataUri=wn,o.findAll=U,o.findOne=M,o.fixBaseUrl=sn,o.floatVal=ie,o.formatDate=X,o.getBoundingClientRect=Ee,o.getCookie=Lt,o.getDomDimension=rn,o.getJson=Kn,o.getNodeXPath=Xt,o.getTimezoneOffsetMinutes=ze,o.getTimezoneOffsetStr=Ni,o.getUTF8StrLen=Tt,o.getWeekNumber=Oi,o.guid=de,o.hide=Gt,o.highlightText=xn,o.html2Text=Mn,o.imgToBase64=Rn,o.insertStyleSheet=we,o.isBodyInit=Fe,o.isChinese=vt,o.isEmptyObject=Qn,o.isFirefox=me,o.isFocusable=nn,o.isFunction=qt,o.isInFullScreen=ue,o.isJSON=jt,o.isJson=Yt,o.isLandscape=Ct,o.isNumberic=_,o.isObject=$t,o.isPortrait=Dt,o.isPromise=Bt,o.isUrl=fe,o.kebabCase=gt,o.keepRectInContainer=en,o.limit=ot,o.loadCss=an,o.loadScript=on,o.lockElementInteraction=Vt,o.markdown2Html=Cn,o.md5=Bn,o.mmToPt=nt,o.mmToPx=et,o.mmToTwip=tt,o.msToHMS=Ai,o.mutationEffective=Te,o.nodeIndex=Qt,o.objToQuery=V,o.objectGet=ei,o.objectKeyReplace=Xn,o.objectKeyValSwap=Zn,o.objectMerge=Pe,o.objectSet=ti,o.offEvent=ye,o.onDomTreeChange=Zt,o.onEvent=be,o.onEvents=gn,o.onHover=Jt,o.parseUnit=pt,o.postFiles=Vn,o.postJson=Jn,o.precisionToStep=cn,o.printStack=zt,o.ptToMm=it,o.pxToMm=at,o.queryReplace=Le,o.queryToObj=J,o.randomInt=rt,o.randomString=oe,o.randomWords=Et,o.rectAssoc=tn,o.rectInLayout=ln,o.regQuote=O,o.remove=Kt,o.request=R,o.round=lt,o.sanitizeFileName=Tn,o.setCookie=It,o.show=Wt,o.srcToBase64=Ln,o.strChunk=Mt,o.strToPascalCase=bt,o.stringToEntity=Dn,o.stripSlashes=ut,o.svgGetBBox=Ne,o.svgToImg=_e,o.svgToImgData=In,o.svgToSrc=Se,o.text2Html=vn,o.throttle=Ft,o.throttleEffect=Pt,o.timestampToDateTimeLocal=Si,o.toggleDisabled=P,o.toggleFullScreen=xt,o.trim=yt,o.truncate=ht,o.unescapeHtml=On,o.urlB64DataCache=j,o.utf8Decode=ae,o.utf8Encode=L,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(a,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(a=typeof globalThis<"u"?globalThis:a||self,_(a.Minutool={}))})(this,function(a){"use strict";const _=(e,t)=>{let n=[];for(let i in e)n.push(e[i][t]);return n},Ke=(e,t)=>{for(let n in e)if(e[n]===t)return n;return null},Ve=(e,t)=>{let n=new Map;return e.filter((i,o)=>{let r=t?t(i,o):i;if(!n.has(r))return n.set(r,!0),!0})},Je=(e,t,n)=>{if(!e||!e.length)return e;let i={};if(e.forEach(r=>{let u=r[t];i[u]||(i[u]=[]),i[u].push(r)}),!n)return i;let o={};for(let r in i)o[r]=i[r][0];return o},Qe=e=>Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{}),Xe=(e,t)=>{let n=e.length;if(t<1||!n)return[];if(t>n)return[e];let i=[],o=Math.floor(n/t),r=n%t;for(let u=1;u<=o;u++)i.push(e.splice(0,t));return r&&i.push(e.splice(0,r)),i},Ze=e=>{let t=-1;for(let n=e.length-1;n>=0;n--)if(e[n]){t=n;break}return e.slice(0,t+1)},ie=window.devicePixelRatio*96,et=()=>window.innerWidth>window.innerHeight,tt=()=>window.innerHeight>window.innerWidth,oe=e=>{if(e.requestFullscreen)return e.requestFullscreen();if(e.webkitRequestFullScreen)return e.webkitRequestFullScreen();throw e.mozRequestFullScreen&&e.mozRequestFullScreen(),e.msRequestFullScreen&&e.msRequestFullScreen(),"Browser no allow full screen"},ae=()=>document.exitFullscreen(),nt=e=>new Promise((t,n)=>{re()?ae().then(t).catch(n):oe(e).then(t).catch(n)}),re=()=>!!document.fullscreenElement,it=e=>{const t=navigator.language||navigator.userLanguage;if(e.includes(t))return t;const n=t.split("-")[0],i=e.find(o=>o.startsWith(n));return i||e[0]},ot=()=>navigator.userAgent.toLowerCase().indexOf("firefox")>-1,at=(1+Math.sqrt(5))/2-1,L=96,rt=(e,t=L)=>e/25.4*t,ct=e=>Math.round(e*56.6929),lt=e=>e*2.83464566929,st=e=>e/2.83464566929,pt=(e,t=L)=>25.4*e/t,ut=(e,t,n)=>Math.min(Math.max(e,t),n),w=(e,t,n,i=!0)=>i?e>=t&&e<=n:e>t&&e<n,mt=(e,t)=>Math.floor(Math.random()*(t+1-e))+e,ce=(e,t=2)=>{let n=Math.pow(10,t);return Math.round(e*n)/n},y=e=>typeof e=="number"?isFinite(e):typeof e!="string"?!1:/^[+-]?(\d+\.?\d*|\.\d+)$/.test(e),dt=(...e)=>{let t=0;return e.forEach(n=>{if(typeof n=="number"&&y(n)){const i=n.toString().split(".")[1];i&&(t=Math.max(t,i.length))}}),t},ft=e=>(e=Math.abs(Number(e)),e===0?1:Math.floor(Math.log10(e))+1);function le(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}const C=(e,t="")=>{if(typeof e=="number")return{val:e,unit:t};if(y(e))return{val:parseFloat(e),unit:t};const n=/^(-?[\d.]+)([a-z%]+)$/i,i=e.trim().match(n);if(!i)throw new Error("unit parse fail:"+e);return{val:parseFloat(i[1]),unit:i[2].toLowerCase()}},H=(e,t,n={})=>{const i=C(e);if(!i)throw new Error(`Invalid value: ${e}`);const o=i.val,r=i.unit;if(!y(o))throw new Error(`Invalid number in value: ${e}`);const u=n.dpi||ie;if(r===t)return o;const c={mm:1,cm:10,in:25.4,px:25.4/u,pt:25.4/72,pc:25.4/6},l={mm:1,cm:1/10,in:1/25.4,px:u/25.4,pt:72/25.4,pc:6/25.4};if(!c[r])throw new Error(`Unsupported source unit: ${r}`);if(!l[t])throw new Error(`Unsupported target unit: ${t}`);return o*c[r]*l[t]},se=(e,t=0)=>y(e)?parseFloat(e):t,gt=e=>(e+"").replace(/\\(.?)/g,function(t,n){switch(n){case"\\":return"\\";case"0":return"\0";case"":return"";default:return n}}),ht=(e,t,n="...")=>{let i=/[^\x00-\xff]/g;if(e.replace(i,"mm").length<=t)return e;let o=Math.floor(t/2);for(let r=o;r<e.length;r++)if(e.substr(0,r).replace(i,"mm").length>=t)return e.substr(0,r)+n;return e},wt=(e,t)=>{const n=Object.keys(t),i=Object.values(t);return new Function(...n,`return \`${e}\`;`)(...i)};function Et(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase())}function Tt(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function vt(e,t,n="..."){return e.length<=t?e:e.slice(0,t)+n}const O=e=>(e+"").replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g,"\\$1"),pe=e=>{let t="",n=0,i=0,o=0,r=0;for(;n<e.length;)i=e.charCodeAt(n),i<128?(t+=String.fromCharCode(i),n++):i>191&&i<224?(o=e.charCodeAt(n+1),t+=String.fromCharCode((i&31)<<6|o&63),n+=2):(o=e.charCodeAt(n+1),r=e.charCodeAt(n+2),t+=String.fromCharCode((i&15)<<12|(o&63)<<6|r&63),n+=3);return t},k=e=>{e=e.replace(/\r\n/g,"n");let t="";for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):i>127&&i<2048?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(i&63|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(i&63|128))}return t},bt=e=>{let t=0,n=e.length,i=-1;for(let o=0;o<n;o++)i=e.charCodeAt(o),i>=0&&i<=128?t+=1:t+=3;return t},yt="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890",ue=(e=6,t=yt)=>{let n="";for(let i=0;i<e;i++){let o=Math.round(Math.random()*(t.length-1));n+=t.substring(o,o+1)}return n},Mt=(e=1,t=8)=>{let n=[];const i="bcdfghjklmnpqrstvwxyz",o="aeiou";for(;e-- >0;){let r="";for(let u=0;u<t;u=u+3)r+=i[Math.floor(Math.random()*i.length)],r+=o[Math.floor(Math.random()*o.length)],r+=i[Math.floor(Math.random()*i.length)];n.push(r)}return n},At=(e,t=!1)=>{let n=[];return e.replace(/[-_\s+]/g," ").split(" ").forEach((i,o)=>{n.push(o===0&&!t?i:le(i))}),n.join("")},P=0,F=1,me=2,St=(e,t="",n=P)=>{if(t.length){let i=new RegExp("^["+O(t)+"]+"),o=new RegExp("["+O(t)+"]+$");return n===F?e.replace(i,""):n===me?e.replace(o,""):e.replace(i,"").replace(o,"")}else return n===P?e.trim():n===F?e.trimStart():e.trimEnd()},_t=(e,t)=>{let n=[];for(let i=0;i<e.length;i+=t)n.push(e.slice(i,i+t));return n},Nt=e=>/[\u4e00-\u9fa5]/.test(e),Ct=(e,t="B",n=2)=>{const i=["B","KB","MB","GB","TB","PB"];let o=i.indexOf(t.toUpperCase());if(o===-1)throw new Error(`Unsupported unit: ${t}`);for(;e>=1024&&o<i.length-1;)e/=1024,o++;return ce(e,n)},T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ot=e=>{let t="",n,i,o,r,u,c,l,s=0;for(e=e.replace(/\+\+[++^A-Za-z0-9+/=]/g,"");s<e.length;)r=T.indexOf(e.charAt(s++)),u=T.indexOf(e.charAt(s++)),c=T.indexOf(e.charAt(s++)),l=T.indexOf(e.charAt(s++)),n=r<<2|u>>4,i=(u&15)<<4|c>>2,o=(c&3)<<6|l,t=t+String.fromCharCode(n),c!==64&&(t=t+String.fromCharCode(i)),l!==64&&(t=t+String.fromCharCode(o));return t=pe(t),t},Dt=e=>k(e).replace("+","-").replace("/","_"),Rt=e=>{let t="",n,i,o,r,u,c,l,s=0;for(e=k(e);s<e.length;)n=e.charCodeAt(s++),i=e.charCodeAt(s++),o=e.charCodeAt(s++),r=n>>2,u=(n&3)<<4|i>>4,c=(i&15)<<2|o>>6,l=o&63,isNaN(i)?c=l=64:isNaN(o)&&(l=64),t=t+T.charAt(r)+T.charAt(u)+T.charAt(c)+T.charAt(l);return t},de=async e=>await It(e),It=e=>new Promise((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=o=>n(o)}),xt=(e,t,n,i="/",o)=>{let r="";if(n){let c=new Date;c.setTime(Date.now()+n*24*60*60*1e3),r="; expires="+c.toUTCString()}let u=e+"="+(t||"")+r+"; path="+i;o&&(u+="; domain="+o),document.cookie=u},Lt=e=>{let t=e+"=",n=document.cookie.split(";");for(let i=0;i<n.length;i++){let o=n[i];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return o.substring(t.length,o.length)}return null},D=(e,t="/",n)=>{let i=e+"=; Path="+t+"; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";n&&(i+=" Domain="+n+";"),document.cookie=i},Ht=(e,t)=>{const n=(t||(location==null?void 0:location.hostname)).split(".");for(;n.length>1;)D(e,"/",n.join(".")),D(e,"/","."+n.join(".")),n.shift();D(e)};let kt=0;const fe=(e="")=>"guid_"+(e||ue(6))+ ++kt,Pt=(e,t)=>{let n,i,o=0;return function(){let r=+new Date;n=this,i=arguments,r-o>t&&(e.apply(n,i),o=r)}},Ft=(e,t)=>{let n,i,o=0,r=!1;return function(){if(r)return;let u=+new Date;n=this,i=arguments;let c=t-(u-o);c<=0?(e.apply(n,i),o=u):(r=!0,setTimeout(()=>{e.apply(n,i),r=!1,o=u},c))}},Ut=(e,t)=>{let n;return function(){let i=this,o=arguments;clearTimeout(n),n=setTimeout(function(){e.apply(i,o)},t)}},Bt=e=>e&&typeof e=="object"&&e.then&&typeof e.then=="function",$t=e=>{let t=!1;try{JSON.parse(e),t=!0}catch{}return t},Yt=e=>e&&typeof e=="object"&&!Array.isArray(e),jt=e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!1,ge=e=>typeof e!="string"||e.trim()===""?!1:/^(https?:\/\/|\/\/|\/|\.\.?\/*)/i.test(e),zt=e=>{let t=!1;try{JSON.parse(e),t=!0}catch{}return t},qt=()=>{let e=new Error().stack;console.log(e)},Gt=e=>{const t=M(e);t&&(t.style.display="none")},Wt=e=>{const t=M(e);t&&(t.style.display="")},Kt=e=>{let t=M(e);return t&&t.parentNode&&t.parentNode.removeChild(t)},U="disabled",he=(e,t="")=>B(e,t,!1),we=(e,t="")=>B(e,t,!0),B=(e,t="",n=null)=>{let i=M(e),o=n===null?!i.classList.contains(U):!n;o&&Te(`.${U} {pointer-event:none !important;}`,"__element_lock_style__"),i.classList.toggle(U,o),i[o?"setAttribute":"removeAttribute"]("disabled","disabled"),i[o?"setAttribute":"removeAttribute"]("data-disabled","disabled"),t&&i.classList.toggle(t,o)},Vt=(e,t,n)=>{e=M(e);let i=!1;e.addEventListener("mouseenter",()=>{i||(i=!0,t&&t())}),e.addEventListener("mouseleave",()=>{i&&(i=!1,n&&n())})},Jt=(e,t)=>{he(e),t(()=>{we(e)})},Qt=e=>e.parentNode?Array.prototype.indexOf.call(e.parentNode.children,e):-1,$=(e,t=document)=>{if(typeof e=="string")return e=e.trim(),e.indexOf(":scope")!==0&&(e=":scope "+e),Array.from(t.querySelectorAll(e));if(Array.isArray(e)){let n=[];return e.forEach(i=>{n.push(...$(i))}),n}else return NodeList.prototype.isPrototypeOf(e)||HTMLCollection.prototype.isPrototypeOf(e)?Array.from(e):e instanceof HTMLElement?[e]:e},M=(e,t=document)=>typeof e=="string"?t.querySelector(e):e,Xt=e=>{let t=document.getElementsByTagName("*"),n=[];for(n=[];e&&e.nodeType===1;e=e.parentNode)if(e.hasAttribute("id")){let i=0;for(let o=0;o<t.length&&(t[o].hasAttribute("id")&&t[o].id===e.id&&i++,!(i>1));o++);if(i===1)return n.unshift('id("'+e.getAttribute("id")+'")'),n.join("/");n.unshift(e.localName.toLowerCase()+'[@id="'+e.getAttribute("id")+'"]')}else if(e.hasAttribute("class"))n.unshift(e.localName.toLowerCase()+'[@class="'+e.getAttribute("class")+'"]');else{let i,o;for(i=1,o=e.previousSibling;o;o=o.previousSibling)o.localName===e.localName&&i++;n.unshift(e.localName.toLowerCase()+"["+i+"]")}return n.length?"/"+n.join("/"):null},Zt=(e,t,n=!0)=>{const i="ON_DOM_TREE_CHANGE_BIND_"+fe();let o=()=>{$(`input:not([${i}]), textarea:not([${i}]), select:not([${i}])`,e).forEach(r=>{r.setAttribute(i,"1"),r.addEventListener("change",t)})};Ee(e,{attributes:!0,subtree:!0,childList:!0},()=>{n&&o(),t()},10),n&&o()},Ee=(e,t,n,i=10)=>{let o=0,r=!1,u=new MutationObserver(()=>{if(r)return;let c=i-(Date.now()-o);c>0?(r=!0,setTimeout(()=>{r=!1,o=Date.now(),n(u)},c)):(o=Date.now(),n(u))});u.observe(e,t)},en=(e,t={left:0,top:0,width:window.innerWidth,height:window.innerHeight})=>{let n={left:e.left,top:e.top};return e.width>t.width||e.height>t.height||(e.width+e.left>t.width+t.left&&(n.left=e.left-(e.width+e.left-(t.width+t.left))),e.height+e.top>t.height+t.top&&(n.top=e.top-(e.height+e.top-(t.height+t.top))),e.left<t.left&&(n.left=t.left),e.top<t.top&&(n.top=t.top)),n},tn=(e,t)=>e.left<=t.left?e.left+e.width>=t.left&&(w(t.top,e.top,e.top+e.height)||w(t.top+t.height,e.top,e.top+e.height)||t.top>=e.top&&t.height>=e.height):t.left+t.width>=e.left&&(w(e.top,t.top,t.top+t.height)||w(e.top+e.height,t.top,t.top+t.height)||e.top>=t.top&&e.height>=t.height),nn=e=>e?!!(e.tabIndex>=0||e instanceof HTMLAnchorElement&&e.href||e instanceof HTMLButtonElement&&!e.disabled||e instanceof HTMLInputElement&&!e.disabled||e instanceof HTMLTextAreaElement&&!e.disabled):!1;let v={};const on=(e,t=!1)=>(!t&&e in v||(v[e]=new Promise((n,i)=>{let o=document.createElement("link");o.rel="stylesheet",o.href=e,o.onload=()=>{n()},o.onerror=()=>{i()},document.head.append(o)})),v[e]),an=(e,t=!1)=>(!t&&e in v||(v[e]=new Promise((n,i)=>{let o=document.createElement("script");o.src=e,o.onload=()=>{n()},o.onerror=()=>{i()},document.head.append(o)})),v[e]),rn=e=>{let t=e.style.visibility,n=e.style.display,i,o;return e.style.visibility="hidden",e.style.display="block",i=e.clientWidth,o=e.clientHeight,e.style.visibility=t,e.style.display=n,{width:i,height:o}},Te=(e,t="",n=document)=>{if(t&&n.querySelector(`#${t}`))return n.querySelector(`#${t}`);let i=n.createElement("style");return n.head.appendChild(i),i.innerHTML=e,t&&(i.id=t),i},cn=(e,t)=>w(e.top,t.top,t.top+t.height)&&w(e.left,t.left,t.left+t.width)&&w(e.top+e.height,t.top,t.top+t.height)&&w(e.left+e.width,t.left,t.left+t.width),ln=e=>Math.pow(10,-e),sn=(e,t)=>{try{return new URL(e,t).href}catch{return e}},pn=(e,t=null)=>{let n=document.createElement("template");e=e.trim(),n.innerHTML=e;let i=[];return t?n.content.childNodes.forEach(o=>{i.push(t.appendChild(o))}):i=Array.from(n.content.childNodes),i.length===1?i[0]:i},ve=(e,t=!1)=>{if(!e)throw new Error("el is null");const n=e.getBoundingClientRect();if(t&&!n.height){const i=e.style.visibility,o=e.style.display;e.style.visibility="hidden",e.style.display="block";const r=ve(e);return e.style.visibility=i,e.style.display=o,r}return{top:n.top,left:n.left,right:n.right,bottom:n.bottom,width:n.width,height:n.height}},un=e=>{let t={};for(let n in e){const i=e[n];i!=null&&(t[`--${n}`]=`${i}`)}return t},Y=new EventTarget,mn=new Map,j=new Map;let dn=0;const fn="__MINUTOOL_SYM_EVENT__";function z(e){if(!j.has(e)){const t=`${fn}${++dn}`;j.set(e,t),mn.set(t,e)}return j.get(e)}const gn=(e,t)=>{const n=e.map(i=>be(i,t));return()=>n.forEach(i=>i())},be=(e,t)=>(Y.addEventListener(typeof e=="symbol"?z(e):e,t),()=>ye(e,t)),ye=(e,t)=>{Y.removeEventListener(typeof e=="symbol"?z(e):e,t)},hn=(e,t=null)=>{Y.dispatchEvent(new CustomEvent(typeof e=="symbol"?z(e):e,{detail:t}))},wn=e=>{if(document.readyState==="complete"||document.readyState==="interactive")e();else{const t=()=>{e(),document.removeEventListener("DOMContentLoaded",t)};document.addEventListener("DOMContentLoaded",t)}},En=(e,t,n,i)=>{const o=r=>{const u=r.target;u.matches(t)&&i(r,u)};return e.addEventListener(n,o),()=>e.removeEventListener(n,o)},Tn=(e,t)=>{if("createEvent"in document){let n=document.createEvent("HTMLEvents");n.initEvent(t.toLowerCase(),!1,!0),e.dispatchEvent(n)}else e.fireEvent("on"+t.toLowerCase())},vn=e=>e.replace(/[\\/:*?"<>|]/g,"_").replace(/[\0-\x1F]/g,"_").replace(/\s+/g," ").replace(/^\.+/,"").replace(/\.+$/,"").trim(),q=e=>new Promise((t,n)=>{const i=new FileReader;i.onload=()=>t(i.result),i.onerror=o=>n(o),i.readAsDataURL(e)}),Me={},G=(e,t=null)=>t!==null?(Me[e]=t,null):Me[e]||null,bn=async e=>{if(!e)return null;if(typeof e=="string"&&e.startsWith("data:"))return e;try{if(typeof e=="string"&&ge(e)){const t=await fetch(e);if(!t.ok)throw new Error(`Fetch failed: ${t.status}`);const n=await t.blob();return await q(n)}return e instanceof Blob?await q(e):null}catch(t){return console.warn("file2Base64DataURL failed:",t),null}},yn=(e,t)=>{const n=document.createElement("a");n.rel="noopener noreferrer",n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)},W=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","CANVAS","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","NOSCRIPT","OL","P","PRE","SECTION","TABLE","TFOOT","UL","VIDEO"],Mn=["A","ABBR","ACRONYM","B","BDO","BIG","BUTTON","CITE","CODE","DFN","EM","I","KBD","LABEL","MAP","OBJECT","OUTPUT","Q","S","SAMP","SCRIPT","SELECT","SMALL","SPAN","STRONG","SUB","SUP","TEXTAREA","TIME","TT","U","VAR"].concat(...W),An=["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"],Ae=["STYLE","COMMENT","SELECT","OPTION","SCRIPT","TITLE","HEAD","BUTTON","META","LINK","PARAM","SOURCE"],Sn=(e,t={})=>{t.keepLineBreak=t.keepLineBreak!==!1;const n=t.imgReplacer!==void 0?t.imgReplacer:"[Image]";e=e.replace(/<img[^>]*src=["']([^"']*)["'][^>]*alt=["']([^"']*)["'][^>]*>/gi,function(r,u,c){return typeof n=="function"?n(u,c):n}),e=e.replace(/<img[^>]*alt=["']([^"']*)["'][^>]*src=["']([^"']*)["'][^>]*>/gi,function(r,u,c){return typeof n=="function"?n(c,u):n}),e=e.replace(/<img[^>]*src=["']([^"']*)["'][^>]*>/gi,function(r,u){return typeof n=="function"?n(u,""):n});const i=t.videoReplacer!==void 0?t.videoReplacer:"[Video]";return e=e.replace(/<video[^>]*src=["']([^"']*)["'][^>]*>/gi,function(r,u){return typeof i=="function"?i(u,""):i}),e=e.replace(/<video[^>]*>[\s\S]*?<source[^>]*src=["']([^"']*)["'][^>]*>[\s\S]*?<\/video>/gi,function(r,u){return typeof i=="function"?i(u,""):i}),Ae.forEach(r=>{e=e.replace(new RegExp(`<${r}[^>]*>([\\s\\S]*?)<\\/${r}>`,"gi"),""),e=e.replace(new RegExp(`<${r}[^>]*>`,"gi"),"")}),e=e.replace(/[\r|\n]/g,""),e=e.replace(/<(\w+)([^>]*)>/g,function(r,u,c){return W.includes(u.toUpperCase())?`
|
|
2
|
+
`:""}),e=e.replace(/<\/(\w+)([^>]*)>/g,function(r,u,c){return""}),e=e.replace(/<[^>]+>/g,""),[[/ /gi," "],[/</gi,"<"],[/>/gi,">"],[/"/gi,'"'],[/'/gi,"'"]].forEach(([r,u])=>{e=e.replace(r,u)}),e=e.replace(/&#(\d+);/g,function(r,u){return String.fromCharCode(parseInt(u))}),e=e.replace(/&/gi,"&"),t.keepLineBreak||(e=e.replace(/\n+/g," ")),e=e.trim(),e},_n=e=>Se(e,0,!1).replace(/\n/g,"<br/>"),Nn=e=>window.CSS&&CSS.escape?CSS.escape(e):e.replace(/[!"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~]/g,"\\$&"),Cn=e=>{let t=e.split(";");return t.pop(),t.map(n=>String.fromCharCode(n[2]==="x"?parseInt(n.slice(3),16):parseInt(n.slice(2)))).join("")};let N;const On=e=>(N||(N=document.createElement("div")),e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),N.innerHTML=e,e=N.textContent||"",N.textContent="",e),Dn=e=>{let t="";for(let n in e){let i=e[n]===null?"":e[n];t+=`<input type="hidden" name="${K(n)}" value="${K(i)}"/>`}return t},Se=(e,t=2,n=!0)=>{let i=String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return n&&(i=i.replace(/[\r\n]/g,"<br/>")),t&&(i=i.replace(/\t/g," ".repeat(t))),i=i.replace(/\s/g," "),i},Rn=e=>String(e).replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/ /g," ").replace(/&/g,"&").replace(/<br.*>/,`
|
|
3
|
+
`),In=e=>{if(!e)return"";let t=e;return t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),t=t.replace(/^###### (.*$)/gim,"<h6>$1</h6>"),t=t.replace(/^##### (.*$)/gim,"<h5>$1</h5>"),t=t.replace(/^#### (.*$)/gim,"<h4>$1</h4>"),t=t.replace(/^### (.*$)/gim,"<h3>$1</h3>"),t=t.replace(/^## (.*$)/gim,"<h2>$1</h2>"),t=t.replace(/^# (.*$)/gim,"<h1>$1</h1>"),t=t.replace(/\*\*(.*?)\*\*/gim,"<strong>$1</strong>"),t=t.replace(/\*(.*?)\*/gim,"<em>$1</em>"),t=t.replace(/`(.*?)`/gim,"<code>$1</code>"),t=t.replace(/!\[(.*?)\]\((.*?)\)/gim,'<img src="$2" alt="$1" />'),t=t.replace(/\[(.*?)\]\((.*?)\)/gim,'<a href="$2" target="_blank">$1</a>'),t=t.replace(/((\|.*\|\n)+)/g,n=>{const i=n.trim().split(`
|
|
4
|
+
`);if(i.length<2)return n;let o="<table>";return i.forEach((r,u)=>{const c=r.split("|").slice(1,-1);if(/^\s*-+\s*$/.test(c[0]))return;const l=u===0?"th":"td";o+="<tr>",c.forEach(s=>{o+=`<${l}>${s.trim()}</${l}>`}),o+="</tr>"}),o+="</table>",o}),t=t.replace(/^\s*-\s+(.*)/gim,"<li>$1</li>"),t=t.replace(/(<li>.*<\/li>)/gims,"<ul>$1</ul>"),t=t.replace(/\n/g,"<br />"),t.trim()},K=(e,t="")=>(t=t?" ":`
|
|
5
|
+
`,(""+e).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">").replace(/\r\n/g,t).replace(/[\r\n]/g,t)),xn=(e,t)=>{let n=e.split("");return t=t||0,n.map(i=>`&#${t?"x"+i.charCodeAt(0).toString(16):i.charCodeAt(0)};`).join("")},Ln=(e,t,n='<span class="matched">%s</span>')=>t?e.replace(new RegExp(O(t),"ig"),i=>n.replace("%s",i)):e,Hn=e=>{if(!e.src)return null;if(e.src.indexOf("data:")===0)return e.src;let t=document.createElement("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");return n?(n.drawImage(e,0,0,e.width,e.height),t.toDataURL("image/png")):null},_e=e=>{const t=new XMLSerializer().serializeToString(e),n=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(n)},Ne=e=>new Promise((t,n)=>{const i=_e(e),o=new Image;o.onload=()=>{t(o)},o.onerror=r=>{n(new Error("Failed to load SVG into Image:"+r))},o.src=i}),kn=(e,t=null,n=null)=>(t=t||"image/png",new Promise((i,o)=>{const r=y(n)?se(n):1;Ne(e).then(u=>{const[c,l]=Ce(e),s=document.createElement("canvas");s.width=c*r,s.height=l*r,s.getContext("2d").drawImage(u,0,0,c*r,l*r),URL.revokeObjectURL(u.src),i(s.toDataURL(t))},o)})),Ce=e=>{let t=null,n=null;const i=e.getAttribute("width"),o=e.getAttribute("height");if(i&&o)try{const r=C(i,"px"),u=C(o,"px");r&&u&&(t=H(r.val+r.unit,"px"),n=H(u.val+u.unit,"px"))}catch{}if(t===null||n===null){const r=e.viewBox.baseVal;r&&r.width&&r.height&&(t=r.width,n=r.height)}if(t===null||n===null){const r=e.getBoundingClientRect();t=r.width,n=r.height}return[t,n]},Pn=(e,t=!1)=>new Promise((n,i)=>{if(t){const r=G(e);if(r)return n(r)}let o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="blob",o.onload=function(){if(this.status===200){let r=this.response;de(r).then(u=>{t&&G(e,u),n(u)}).catch(u=>{i(u)})}},o.onerror=function(){i("Error:"+this.statusText)},o.onabort=function(){i("Request abort")},o.send()}),b=(e,t)=>{let n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535},Fn=(e,t)=>e<<t|e>>>32-t,R=(e,t,n,i,o,r)=>b(Fn(b(b(t,e),b(i,r)),o),n),m=(e,t,n,i,o,r,u)=>R(t&n|~t&i,e,t,o,r,u),d=(e,t,n,i,o,r,u)=>R(t&i|n&~i,e,t,o,r,u),f=(e,t,n,i,o,r,u)=>R(t^n^i,e,t,o,r,u),g=(e,t,n,i,o,r,u)=>R(n^(t|~i),e,t,o,r,u),I=(e,t)=>{e[t>>5]|=128<<t%32,e[(t+64>>>9<<4)+14]=t;let n,i,o,r,u,c=1732584193,l=-271733879,s=-1732584194,p=271733878;for(n=0;n<e.length;n+=16)i=c,o=l,r=s,u=p,c=m(c,l,s,p,e[n],7,-680876936),p=m(p,c,l,s,e[n+1],12,-389564586),s=m(s,p,c,l,e[n+2],17,606105819),l=m(l,s,p,c,e[n+3],22,-1044525330),c=m(c,l,s,p,e[n+4],7,-176418897),p=m(p,c,l,s,e[n+5],12,1200080426),s=m(s,p,c,l,e[n+6],17,-1473231341),l=m(l,s,p,c,e[n+7],22,-45705983),c=m(c,l,s,p,e[n+8],7,1770035416),p=m(p,c,l,s,e[n+9],12,-1958414417),s=m(s,p,c,l,e[n+10],17,-42063),l=m(l,s,p,c,e[n+11],22,-1990404162),c=m(c,l,s,p,e[n+12],7,1804603682),p=m(p,c,l,s,e[n+13],12,-40341101),s=m(s,p,c,l,e[n+14],17,-1502002290),l=m(l,s,p,c,e[n+15],22,1236535329),c=d(c,l,s,p,e[n+1],5,-165796510),p=d(p,c,l,s,e[n+6],9,-1069501632),s=d(s,p,c,l,e[n+11],14,643717713),l=d(l,s,p,c,e[n],20,-373897302),c=d(c,l,s,p,e[n+5],5,-701558691),p=d(p,c,l,s,e[n+10],9,38016083),s=d(s,p,c,l,e[n+15],14,-660478335),l=d(l,s,p,c,e[n+4],20,-405537848),c=d(c,l,s,p,e[n+9],5,568446438),p=d(p,c,l,s,e[n+14],9,-1019803690),s=d(s,p,c,l,e[n+3],14,-187363961),l=d(l,s,p,c,e[n+8],20,1163531501),c=d(c,l,s,p,e[n+13],5,-1444681467),p=d(p,c,l,s,e[n+2],9,-51403784),s=d(s,p,c,l,e[n+7],14,1735328473),l=d(l,s,p,c,e[n+12],20,-1926607734),c=f(c,l,s,p,e[n+5],4,-378558),p=f(p,c,l,s,e[n+8],11,-2022574463),s=f(s,p,c,l,e[n+11],16,1839030562),l=f(l,s,p,c,e[n+14],23,-35309556),c=f(c,l,s,p,e[n+1],4,-1530992060),p=f(p,c,l,s,e[n+4],11,1272893353),s=f(s,p,c,l,e[n+7],16,-155497632),l=f(l,s,p,c,e[n+10],23,-1094730640),c=f(c,l,s,p,e[n+13],4,681279174),p=f(p,c,l,s,e[n],11,-358537222),s=f(s,p,c,l,e[n+3],16,-722521979),l=f(l,s,p,c,e[n+6],23,76029189),c=f(c,l,s,p,e[n+9],4,-640364487),p=f(p,c,l,s,e[n+12],11,-421815835),s=f(s,p,c,l,e[n+15],16,530742520),l=f(l,s,p,c,e[n+2],23,-995338651),c=g(c,l,s,p,e[n],6,-198630844),p=g(p,c,l,s,e[n+7],10,1126891415),s=g(s,p,c,l,e[n+14],15,-1416354905),l=g(l,s,p,c,e[n+5],21,-57434055),c=g(c,l,s,p,e[n+12],6,1700485571),p=g(p,c,l,s,e[n+3],10,-1894986606),s=g(s,p,c,l,e[n+10],15,-1051523),l=g(l,s,p,c,e[n+1],21,-2054922799),c=g(c,l,s,p,e[n+8],6,1873313359),p=g(p,c,l,s,e[n+15],10,-30611744),s=g(s,p,c,l,e[n+6],15,-1560198380),l=g(l,s,p,c,e[n+13],21,1309151649),c=g(c,l,s,p,e[n+4],6,-145523070),p=g(p,c,l,s,e[n+11],10,-1120210379),s=g(s,p,c,l,e[n+2],15,718787259),l=g(l,s,p,c,e[n+9],21,-343485551),c=b(c,i),l=b(l,o),s=b(s,r),p=b(p,u);return[c,l,s,p]},Oe=e=>{let t,n="",i=e.length*32;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n},V=e=>{let t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;let i=e.length*8;for(t=0;t<i;t+=8)n[t>>5]|=(e.charCodeAt(t/8)&255)<<t%32;return n},Un=e=>Oe(I(V(e),e.length*8)),Bn=(e,t)=>{let n,i=V(e),o=[],r=[],u;for(o[15]=r[15]=void 0,i.length>16&&(i=I(i,e.length*8)),n=0;n<16;n+=1)o[n]=i[n]^909522486,r[n]=i[n]^1549556828;return u=I(o.concat(V(t)),512+t.length*8),Oe(I(r.concat(u),640))},De=e=>{let t="0123456789abcdef",n="",i,o;for(o=0;o<e.length;o+=1)i=e.charCodeAt(o),n+=t.charAt(i>>>4&15)+t.charAt(i&15);return n},J=e=>unescape(encodeURIComponent(e)),Re=e=>Un(J(e)),$n=e=>De(Re(e)),Ie=(e,t)=>Bn(J(e),J(t)),Yn=(e,t)=>De(Ie(e,t)),jn=(e,t,n)=>t?n?Ie(t,e):Yn(t,e):n?Re(e):$n(e),zn="application/octet-stream",A="application/json",xe="application/x-www-form-urlencoded",Le="multipart/form-data",qn="text/plain",Gn="text/html",Wn={323:"text/h323",accdb:"application/msaccess",accde:"application/msaccess",accdt:"application/msaccess",acx:"application/internet-property-stream",ai:"application/postscript",aif:"audio/x-aiff",aifc:"audio/aiff",aiff:"audio/aiff",application:"application/x-ms-application",art:"image/x-jg",asf:"video/x-ms-asf",asm:"text/plain",asr:"video/x-ms-asf",asx:"video/x-ms-asf",atom:"application/atom+xml",au:"audio/basic",avi:"video/x-msvideo",axs:"application/olescript",bas:"text/plain",bcpio:"application/x-bcpio",bmp:"image/bmp",c:"text/plain",calx:"application/vnd.ms-office.calx",cat:"application/vnd.ms-pki.seccat",cdf:"application/x-cdf",class:"application/x-java-applet",clp:"application/x-msclip",cmx:"image/x-cmx",cnf:"text/plain",cod:"image/cis-cod",cpio:"application/x-cpio",cpp:"text/plain",crd:"application/x-mscardfile",crl:"application/pkix-crl",crt:"application/x-x509-ca-cert",csh:"application/x-csh",css:"text/css",dcr:"application/x-director",der:"application/x-x509-ca-cert",dib:"image/bmp",dir:"application/x-director",disco:"text/xml",dll:"application/x-msdownload","dll.config":"text/xml",dlm:"text/dlm",doc:"application/msword",docm:"application/vnd.ms-word.document.macroEnabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroEnabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",dtd:"text/xml",dvi:"application/x-dvi",dwf:"drawing/x-dwf",dxr:"application/x-director",eml:"message/rfc822",eps:"application/postscript",etx:"text/x-setext",evy:"application/envoy","exe.config":"text/xml",fdf:"application/vnd.fdf",fif:"application/fractals",flr:"x-world/x-vrml",flv:"video/x-flv",gif:"image/gif",gtar:"application/x-gtar",gz:"application/x-gzip",h:"text/plain",hdf:"application/x-hdf",hdml:"text/x-hdml",hhc:"application/x-oleobject",hlp:"application/winhlp",hqx:"application/mac-binhex40",hta:"application/hta",htc:"text/x-component",htm:"text/html",html:"text/html",htt:"text/webviewhtml",hxt:"text/html",ico:"image/x-icon",ief:"image/ief",iii:"application/x-iphone",ins:"application/x-internet-signup",isp:"application/x-internet-signup",IVF:"video/x-ivf",jar:"application/java-archive",jck:"application/liquidmotion",jcz:"application/liquidmotion",jfif:"image/pjpeg",jpe:"image/jpeg",jpeg:"image/jpeg",jpg:"image/jpeg",js:"application/x-javascript",jsx:"text/jscript",latex:"application/x-latex",lit:"application/x-ms-reader",lsf:"video/x-la-asf",lsx:"video/x-la-asf",m13:"application/x-msmediaview",m14:"application/x-msmediaview",m1v:"video/mpeg",m3u:"audio/x-mpegurl",man:"application/x-troff-man",manifest:"application/x-ms-manifest",map:"text/plain",mdb:"application/x-msaccess",me:"application/x-troff-me",mht:"message/rfc822",mhtml:"message/rfc822",mid:"audio/mid",midi:"audio/mid",mmf:"application/x-smaf",mno:"text/xml",mny:"application/x-msmoney",mov:"video/quicktime",movie:"video/x-sgi-movie",mp2:"video/mpeg",mp3:"audio/mpeg",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"video/mpeg",mpp:"application/vnd.ms-project",mpv2:"video/mpeg",ms:"application/x-troff-ms",mvb:"application/x-msmediaview",mvc:"application/x-miva-compiled",nc:"application/x-netcdf",nsc:"video/x-ms-asf",nws:"message/rfc822",oda:"application/oda",odc:"text/x-ms-odc",ods:"application/oleobject",one:"application/onenote",onea:"application/onenote",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",osdx:"application/opensearchdescription+xml",p10:"application/pkcs10",p12:"application/x-pkcs12",p7b:"application/x-pkcs7-certificates",p7c:"application/pkcs7-mime",p7m:"application/pkcs7-mime",p7r:"application/x-pkcs7-certreqresp",p7s:"application/pkcs7-signature",pbm:"image/x-portable-bitmap",pdf:"application/pdf",pfx:"application/x-pkcs12",pgm:"image/x-portable-graymap",pko:"application/vnd.ms-pki.pko",pma:"application/x-perfmon",pmc:"application/x-perfmon",pml:"application/x-perfmon",pmr:"application/x-perfmon",pmw:"application/x-perfmon",png:"image/png",pnm:"image/x-portable-anymap",pnz:"image/png",pot:"application/vnd.ms-powerpoint",potm:"application/vnd.ms-powerpoint.template.macroEnabled.12",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",ppam:"application/vnd.ms-powerpoint.addin.macroEnabled.12",ppm:"image/x-portable-pixmap",pps:"application/vnd.ms-powerpoint",ppsm:"application/vnd.ms-powerpoint.slideshow.macroEnabled.12",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",ppt:"application/vnd.ms-powerpoint",pptm:"application/vnd.ms-powerpoint.presentation.macroEnabled.12",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",prf:"application/pics-rules",ps:"application/postscript",pub:"application/x-mspublisher",qt:"video/quicktime",qtl:"application/x-quicktimeplayer",ra:"audio/x-pn-realaudio",ram:"audio/x-pn-realaudio",ras:"image/x-cmu-raster",rf:"image/vnd.rn-realflash",rgb:"image/x-rgb",rm:"application/vnd.rn-realmedia",rmi:"audio/mid",roff:"application/x-troff",rpm:"audio/x-pn-realaudio-plugin",rtf:"application/rtf",rtx:"text/richtext",scd:"application/x-msschedule",sct:"text/scriptlet",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sgml:"text/sgml",sh:"application/x-sh",shar:"application/x-shar",sit:"application/x-stuffit",sldm:"application/vnd.ms-powerpoint.slide.macroEnabled.12",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",smd:"audio/x-smd",smx:"audio/x-smd",smz:"audio/x-smd",snd:"audio/basic",spc:"application/x-pkcs7-certificates",spl:"application/futuresplash",src:"application/x-wais-source",ssm:"application/streamingmedia",sst:"application/vnd.ms-pki.certstore",stl:"application/vnd.ms-pki.stl",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",svg:"image/svg+xml",swf:"application/x-shockwave-flash",t:"application/x-troff",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",texi:"application/x-texinfo",texinfo:"application/x-texinfo",tgz:"application/x-compressed",thmx:"application/vnd.ms-officetheme",tif:"image/tiff",tiff:"image/tiff",tr:"application/x-troff",trm:"application/x-msterminal",tsv:"text/tab-separated-values",txt:"text/plain",uls:"text/iuls",ustar:"application/x-ustar",vbs:"text/vbscript",vcf:"text/x-vcard",vcs:"text/plain",vdx:"application/vnd.ms-visio.viewer",vml:"text/xml",vsd:"application/vnd.visio",vss:"application/vnd.visio",vst:"application/vnd.visio",vsto:"application/x-ms-vsto",vsw:"application/vnd.visio",vsx:"application/vnd.visio",vtx:"application/vnd.visio",wav:"audio/wav",wax:"audio/x-ms-wax",wbmp:"image/vnd.wap.wbmp",wcm:"application/vnd.ms-works",wdb:"application/vnd.ms-works",wks:"application/vnd.ms-works",wm:"video/x-ms-wm",wma:"audio/x-ms-wma",wmd:"application/x-ms-wmd",wmf:"application/x-msmetafile",wml:"text/vnd.wap.wml",wmlc:"application/vnd.wap.wmlc",wmls:"text/vnd.wap.wmlscript",wmlsc:"application/vnd.wap.wmlscriptc",wmp:"video/x-ms-wmp",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wmz:"application/x-ms-wmz",wps:"application/vnd.ms-works",wri:"application/x-mswrite",wrl:"x-world/x-vrml",wrz:"x-world/x-vrml",wsdl:"text/xml",wvx:"video/x-ms-wvx",x:"application/directx",xaf:"x-world/x-vrml",xaml:"application/xaml+xml",xap:"application/x-silverlight-app",xbap:"application/x-ms-xbap",xbm:"image/x-xbitmap",xdr:"text/plain",xht:"application/xhtml+xml",xhtml:"application/xhtml+xml",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroEnabled.12",xlc:"application/vnd.ms-excel",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.12",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroEnabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",xml:"text/xml",xof:"x-world/x-vrml",xpm:"image/x-xpixmap",xps:"application/vnd.ms-xpsdocument",xsd:"text/xml",xsf:"text/xml",xsl:"text/xml",xslt:"text/xml",xwd:"image/x-xwindowdump",z:"application/x-compress",zip:"application/x-zip-compressed"},Q=e=>{const t={};return e.replace(/^\?/,"").split("&").forEach(n=>{const[i,o]=n.split("=");i&&(t[decodeURIComponent(i)]=decodeURIComponent(o||""))}),t},He=(e,t)=>{const[n,i]=e.split("?"),r={...i?Q(i):{},...t},u=X(r);return`${n}?${u}`},X=e=>{if(typeof e>"u"||typeof e!="object")return e;let t=[];for(let n in e)if(e.hasOwnProperty(n)){if(e[n]===null)continue;typeof e[n]=="object"&&e[n].length?e[n].forEach(i=>{t.push(encodeURI(n+"="+i))}):typeof e[n]=="object"||t.push(encodeURI(n+"="+e[n]))}return t.join("&")};class ke extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}const Pe=(e,t={})=>{const n=new AbortController;let i=null;t.timeout&&(i=setTimeout(()=>n.abort(),t.timeout));const o=()=>{i!==null&&(clearTimeout(i),i=null)},r=c=>{const l=c,s=l.then.bind(l),p=l.catch.bind(l),te=l.finally.bind(l);return l.then=function(E,ne){return r(s(E,ne))},l.catch=function(E){return r(p(E))},l.finally=function(E){return r(te(E))},l.abort=E=>{o(),n.abort(new ke(E||"request aborted."))},l},u=fetch(e,{...t,signal:n.signal}).then(c=>(o(),c)).catch(c=>{throw o(),c});return r(u)},Kn=(e,t,n)=>{if(t==null)return;const i=e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase();n.set(i,String(t))},Vn=e=>["method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal","window"].includes(e),x=(e,t=null,n)=>{n=n||{},n.method=n.method||"GET";const i=n.method.toUpperCase()==="GET",o=new Headers(n.headers||{});for(let r in n)Vn(r)||Kn(r,n[r],o);return i&&t&&(e=He(e,typeof t=="string"?Q(t):t),t=null),Pe(e,{headers:o,body:i?void 0:Jn(t,o.get("content-type")||void 0),...n}).then(r=>{if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return r})},Fe=e=>typeof e=="string"||e instanceof FormData||e instanceof URLSearchParams||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e),Jn=(e,t)=>{if(Fe(e)||typeof e!="object")return e;switch(t==null?void 0:t.toLowerCase()){case A:return JSON.stringify(e);case xe:case Le:default:return X(e)}},Qn=(e,t=null,n={})=>x(e,t,{...n,ContentType:A,Accept:A}).then(i=>i.json()),Xn=(e,t=null,n={})=>x(e,t,{...n,method:"POST",ContentType:A,Accept:A}).then(i=>i.json()),Zn=(e,t,n=null,i={})=>{const o=new FormData;if(Object.keys(t).forEach(r=>{o.append(r,t[r],t[r].name)}),n)for(let r in n)n.hasOwnProperty(r)&&o.append(r,n[r]);return x(e,o,{...i,method:"POST"}).then(r=>r.json())};function Z(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array)return e.map(t=>Z(t));if(e instanceof Object){const t={};for(const n in e)e.hasOwnProperty(n)&&(t[n]=Z(e[n]));return t}return e}function ei(e){return Object.keys(e).length===0}const ti=(e,t)=>{let n={};for(let i in e)t[i]!==void 0?n[t[i]]=e[i]:n[i]=e[i];return n},ni=e=>Object.entries(e).map(([t,n])=>[/^\d+$/.test(t)?Number(t):t,n]),ii=e=>{const t={};for(const[n,i]of e){const o=typeof n=="string"&&/^\d+$/.test(n)?Number(n):n;t[o]=i}return t},oi=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[n,t]));function ai(e,t,n){const i=t.split(".");let o=e;for(const r of i){if(o==null)return n;o=o[r]}return o!==void 0?o:n}function ri(e,t,n){const i=t.split("."),o=i.pop();let r=e;for(const u of i)(!(u in r)||typeof r[u]!="object")&&(r[u]={}),r=r[u];r[o]=n}function Ue(e,...t){for(const n of t)for(const i in n)if(n.hasOwnProperty(i)){const o=n[i],r=e[i];o&&typeof o=="object"&&!Array.isArray(o)&&r&&typeof r=="object"&&!Array.isArray(r)?e[i]=Ue(r,o):e[i]=o}return e}const Be=(e,t=!1)=>{for(const n in e)e[n]===null?delete e[n]:t&&typeof e[n]=="object"&&Be(e[n],!0);return e},ci=new Date().getFullYear(),li=new Date().getMonth()+1,si=new Date().getDate(),pi=60*1e3,ui=60*60*1e3,S=24*60*60*1e3,mi=7*S,di=30*S,fi=31*S,gi=365*S,hi=366*S,wi=0,Ei=1,Ti=2,vi=3,bi=4,yi=5,Mi=6,$e=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ye=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],je=["January","February","March","April","May","June","July","August","September","October","November","December"],ze=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ai=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],Si=["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],_i=["日","一","二","三","四","五","六"],Ni=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],Ci=(e,t,n)=>{let i=()=>{if(t&&t(e),e-- >0){setTimeout(i,1e3);return}n&&n()};i()},Oi=e=>{if(!e||e<10)return"刚刚";e=Math.floor(e/1e3);const t=Math.floor(e/3600),n=Math.floor(e%3600/60),i=e%60;let o="";return t>0&&(o+=t+"小时"),(n>0||t>0)&&(o+=n+"分钟"),o+=i+"秒前",o},Di=(e,t=!1)=>{const n=new Date(e);return new Date(n.getTime()-n.getTimezoneOffset()*6e4).toISOString().slice(0,t?19:16)},Ri=(e,t,n)=>e<=0?1/0:(Date.now()-n)/e*(t-e),qe={d:e=>{let t=e.getDate();return(t<10?"0":"")+t},D:e=>Ye[e.getDay()],j:e=>e.getDate(),l:e=>$e[e.getDay()],N:e=>{let t=e.getDay();return t===0?7:t},S:e=>{let t=e.getDate();return t%10===1&&t!==11?"st":t%10===2&&t!==12?"nd":t%10===3&&t!==13?"rd":"th"},w:e=>e.getDay(),z:e=>{let t=new Date(e.getFullYear(),0,1);return Math.ceil((e.getTime()-t.getTime())/864e5)},W:e=>{let t=new Date(e.valueOf()),n=(e.getDay()+6)%7;t.setDate(t.getDate()-n+3);let i=t.valueOf();t.setMonth(0,1),t.getDay()!==4&&t.setMonth(0,1+(4-t.getDay()+7)%7);let o=1+Math.ceil((i-t.getTime())/6048e5);return o<10?"0"+o:o},F:e=>je[e.getMonth()],m:e=>{let t=e.getMonth();return(t<9?"0":"")+(t+1)},M:e=>ze[e.getMonth()],n:e=>e.getMonth()+1,t:e=>{let t=e.getFullYear(),n=e.getMonth()+1;return n===12&&(t=t++,n=0),new Date(t,n,0).getDate()},L:e=>{let t=e.getFullYear();return t%400===0||t%100!==0&&t%4===0},o:e=>{let t=new Date(e.valueOf());return t.setDate(t.getDate()-(e.getDay()+6)%7+3),t.getFullYear()},Y:e=>e.getFullYear(),y:e=>(""+e.getFullYear()).substr(2),a:e=>e.getHours()<12?"am":"pm",A:e=>e.getHours()<12?"AM":"PM",B:e=>Math.floor(((e.getUTCHours()+1)%24+e.getUTCMinutes()/60+e.getUTCSeconds()/3600)*1e3/24),g:e=>e.getHours()%12||12,G:e=>e.getHours(),h:e=>{let t=e.getHours();return((t%12||12)<10?"0":"")+(t%12||12)},H:e=>{let t=e.getHours();return(t<10?"0":"")+t},i:e=>{let t=e.getMinutes();return(t<10?"0":"")+t},s:e=>{let t=e.getSeconds();return(t<10?"0":"")+t},v:e=>{let t=e.getMilliseconds();return(t<10?"00":t<100?"0":"")+t},e:e=>Intl.DateTimeFormat().resolvedOptions().timeZone,I:e=>{let t=null;for(let n=0;n<12;++n){let o=new Date(e.getFullYear(),n,1).getTimezoneOffset();if(t===null)t=o;else if(o<t){t=o;break}else if(o>t)break}return e.getTimezoneOffset()===t?1:0},O:e=>{let t=e.getTimezoneOffset();return(-t<0?"-":"+")+(Math.abs(t/60)<10?"0":"")+Math.floor(Math.abs(t/60))+(Math.abs(t%60)===0?"00":(Math.abs(t%60)<10?"0":"")+Math.abs(t%60))},P:e=>{let t=e.getTimezoneOffset();return(-t<0?"-":"+")+(Math.abs(t/60)<10?"0":"")+Math.floor(Math.abs(t/60))+":"+(Math.abs(t%60)===0?"00":(Math.abs(t%60)<10?"0":"")+Math.abs(t%60))},T:e=>{let t=e.toLocaleTimeString(navigator.language,{timeZoneName:"short"}).split(" ");return t[t.length-1]},Z:e=>-e.getTimezoneOffset()*60,c:e=>ee("Y-m-d\\TH:i:sP",e),r:e=>e.toString(),U:e=>Math.floor(e.getTime()/1e3)},ee=function(e,t=null){let n=null;return typeof t=="object"&&t!==null?n=t:n=new Date(t||Date.now()),e.replace(/(\\?)(.)/g,function(i,o,r){return o===""&&qe[r]?String(qe[r](n)):r})},Ge=e=>{const t=new Date,n=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),i=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),o=n.formatToParts(t),r=i.formatToParts(t),u=p=>{const te=p.find(h=>h.type==="year").value,E=p.find(h=>h.type==="month").value,ne=p.find(h=>h.type==="day").value,Li=p.find(h=>h.type==="hour").value,Hi=p.find(h=>h.type==="minute").value,ki=p.find(h=>h.type==="second").value;return Date.UTC(Number(te),Number(E)-1,Number(ne),Number(Li),Number(Hi),Number(ki))},c=u(o),l=u(r);return(c-l)/1e3/60},We=e=>{const t=Math.floor(e/60),n=Math.abs(e%60);return`${t>=0?"+":"-"}${String(Math.abs(t)).padStart(2,"0")}:${String(n).padStart(2,"0")}`},Ii=e=>{const t=Ge(e);return We(t)},xi=e=>ee("W",e);a.AbortError=ke,a.BLOCK_TAGS=W,a.Base64Encode=Rt,a.COMMON_DPI=96,a.DATE_NOW=si,a.DAY_FRIDAY=yi,a.DAY_MONDAY=Ei,a.DAY_SATURDAY=Mi,a.DAY_SUNDAY=wi,a.DAY_THURSDAY=bi,a.DAY_TUESDAY=Ti,a.DAY_WEDNESDAY=vi,a.GOLDEN_RATIO=at,a.MIME_BINARY_DEFAULT=zn,a.MIME_EXTENSION_MAP=Wn,a.MIME_FORM=xe,a.MIME_HTML=Gn,a.MIME_JSON=A,a.MIME_MULTIPART=Le,a.MIME_TEXT=qn,a.MONTH_NAMES_CN=Ai,a.MONTH_NAMES_EN=je,a.MONTH_NAMES_SHORT_CN=Si,a.MONTH_NAMES_SHORT_EN=ze,a.MONTH_NOW=li,a.ONE_DAY=S,a.ONE_HOUR=ui,a.ONE_MINUTE=pi,a.ONE_MONTH30=di,a.ONE_MONTH31=fi,a.ONE_WEEK=mi,a.ONE_YEAR365=gi,a.ONE_YEAR366=hi,a.PAIR_TAGS=Mn,a.REMOVABLE_TAGS=Ae,a.SCREEN_DPI=ie,a.SELF_CLOSING_TAGS=An,a.STAND_DPI=L,a.TRIM_BOTH=P,a.TRIM_LEFT=F,a.TRIM_RIGHT=me,a.WEEK_DAY_NAMES_CN=Ni,a.WEEK_DAY_NAMES_EN=$e,a.WEEK_DAY_NAMES_SHORT_CN=_i,a.WEEK_DAY_NAMES_SHORT_EN=Ye,a.YEAR_NOW=ci,a.abortableFetch=Pe,a.arrayChunk=Xe,a.arrayColumn=_,a.arrayDistinct=Ve,a.arrayGroup=Je,a.arrayIndex=Ke,a.arraySortByKey=Qe,a.arrayTrimTail=Ze,a.base64Decode=Ot,a.base64UrlSafeEncode=Dt,a.between=w,a.blobToBase64=de,a.blobToDataUri=q,a.buildHtmlHidden=Dn,a.buildStyleVars=un,a.calcRemainingMSecs=Ri,a.camelCase=Et,a.capitalize=le,a.cleanNull=Be,a.convertMinutesToTimezoneOffsetStr=We,a.countDown=Ci,a.createDomByHtml=pn,a.cssSelectorEscape=Nn,a.cutString=ht,a.debounce=Ut,a.decodeHTMLEntities=On,a.deepClone=Z,a.deleteCookie=D,a.deleteCookieAllPaths=Ht,a.detectLanguage=it,a.detectedPrecision=dt,a.digitCount=ft,a.disabled=he,a.dispatchEvent=hn,a.downloadFile=yn,a.enabled=we,a.enterFullScreen=oe,a.entityToString=Cn,a.escapeAttr=K,a.escapeHtml=Se,a.eventDelegate=En,a.exitFullScreen=ae,a.extract=wt,a.fileToBase64DataUri=bn,a.findAll=$,a.findOne=M,a.fixBaseUrl=sn,a.floatVal=se,a.formatDate=ee,a.formatSize=Ct,a.getBoundingClientRect=ve,a.getCookie=Lt,a.getDomDimension=rn,a.getJson=Qn,a.getNodeXPath=Xt,a.getTimezoneOffsetMinutes=Ge,a.getTimezoneOffsetStr=Ii,a.getUTF8StrLen=bt,a.getWeekNumber=xi,a.guid=fe,a.hide=Gt,a.highlightText=Ln,a.html2Text=Sn,a.imgToBase64=Hn,a.insertStyleSheet=Te,a.isBodyInit=Fe,a.isChinese=Nt,a.isEmptyObject=ei,a.isFirefox=ot,a.isFocusable=nn,a.isFunction=jt,a.isInFullScreen=re,a.isJSON=zt,a.isJson=$t,a.isLandscape=et,a.isNumberic=y,a.isObject=Yt,a.isPortrait=tt,a.isPromise=Bt,a.isUrl=ge,a.kebabCase=Tt,a.keepRectInContainer=en,a.limit=ut,a.loadCss=on,a.loadScript=an,a.lockElementInteraction=Jt,a.markdown2Html=In,a.md5=jn,a.mmToPt=lt,a.mmToPx=rt,a.mmToTwip=ct,a.msToHMS=Oi,a.mutationEffective=Ee,a.nodeIndex=Qt,a.objToQuery=X,a.objectEntries=ni,a.objectFromEntries=ii,a.objectGet=ai,a.objectKeyReplace=ti,a.objectMerge=Ue,a.objectSet=ri,a.objectSwitchKV=oi,a.offEvent=ye,a.onDocReady=wn,a.onDomTreeChange=Zt,a.onEvent=be,a.onEvents=gn,a.onHover=Vt,a.parseUnit=C,a.postFiles=Zn,a.postJson=Xn,a.precisionToStep=ln,a.printStack=qt,a.ptToMm=st,a.pxToMm=pt,a.queryReplace=He,a.queryToObj=Q,a.randomInt=mt,a.randomString=ue,a.randomWords=Mt,a.rectAssoc=tn,a.rectInLayout=cn,a.regQuote=O,a.remove=Kt,a.request=x,a.round=ce,a.sanitizeFileName=vn,a.setCookie=xt,a.show=Wt,a.srcToBase64=Pn,a.strChunk=_t,a.strToPascalCase=At,a.stringToEntity=xn,a.stripSlashes=gt,a.svgGetDimension=Ce,a.svgToImg=Ne,a.svgToImgData=kn,a.svgToSrc=_e,a.text2Html=_n,a.throttle=Pt,a.throttleEffect=Ft,a.timestampToDateTimeLocal=Di,a.toggleDisabled=B,a.toggleFullScreen=nt,a.triggerDomEvent=Tn,a.trim=St,a.truncate=vt,a.unescapeHtml=Rn,a.unitConvert=H,a.urlB64DataCache=G,a.utf8Decode=pe,a.utf8Encode=k,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
6
6
|
//# sourceMappingURL=minutool.umd.cjs.map
|