lyb-js 1.1.11 → 1.1.12
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.
|
@@ -13,8 +13,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
13
13
|
* @param logs 信息
|
|
14
14
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsColorConsole-有色打印
|
|
15
15
|
*/
|
|
16
|
-
export var libJsColorConsole = function (title, color, logs) {
|
|
16
|
+
export var libJsColorConsole = function (title, color, logs, disabled) {
|
|
17
17
|
if (logs === void 0) { logs = []; }
|
|
18
|
+
if (disabled === void 0) { disabled = false; }
|
|
19
|
+
if (!disabled)
|
|
20
|
+
return;
|
|
18
21
|
var colors = {
|
|
19
22
|
red: "#c0392b",
|
|
20
23
|
orange: "#d35400",
|
package/dist/libJs.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare const Browser: {
|
|
|
26
26
|
libJsColorConsole: (title: string, color: "red" | "orange" | "yellow" | "green" | "blue" | "purple", logs?: {
|
|
27
27
|
label: string;
|
|
28
28
|
value: any;
|
|
29
|
-
}[] | any) => void;
|
|
29
|
+
}[] | any, disabled?: boolean) => void;
|
|
30
30
|
/** @description 判断是否为移动设备
|
|
31
31
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsIsMobile-判断手机
|
|
32
32
|
*/
|
package/package.json
CHANGED
package/umd/lyb.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(ge){typeof define=="function"&&define.amd?define(ge):ge()})(function(){"use strict";const ge=e=>Object.prototype.toString.call(e).substring(8).replace(/]/g,"").toLowerCase(),Ke=(e=1,t)=>{let n,i=e,r=Date.now(),s=!1;return new Promise(o=>{const u=()=>{document.hidden?(s=!0,clearTimeout(n),i-=Date.now()-r):s&&(s=!1,r=Date.now(),a(o))},a=c=>{n=setTimeout(()=>{t==null||t(),c(),document.removeEventListener("visibilitychange",u)},i)};document.addEventListener("visibilitychange",u),a(o)})},Qe=(e,t,n=[])=>{const
|
|
2
|
-
${o.label}:`,o.value]);console.log(`%c${r()}-${e}`,`color: #fff;background: ${i[t]}; font-size:14px;border-radius:5px;padding:0.25em;margin:0.5em 0`,...s.flat(1/0))}else console.log(`%c${r()}-${e}`,`color: #fff;background: ${i[t]}; font-size:14px;border-radius:5px;padding:0.25em;margin:0.5em 0`,n)},et=()=>{const e=navigator.userAgent.toLowerCase();return/mobile|android|iphone|ipod/.test(e)},tt=()=>{const e=navigator.userAgent.toLowerCase(),t=Math.max(window.screen.width,window.screen.height),n=Math.min(window.screen.width,window.screen.height),i=t/n,r=/ipad|tablet|playbook|silk/.test(e)&&!/mobile/.test(e),s=t>=768&&t<=1366,o=i>=1.3&&i<=1.6;return r||s&&o},nt=()=>{const t=location.href.split("?")[1];return t?t.split("&").reduce((i,r)=>{const[s,o]=r.split(/=(.+)/);return i[s]=o,i},{})||{}:{}},it=(e,t)=>{document.title=e;const n=document.createElement("link");n.setAttribute("rel","icon"),n.setAttribute("href",t),(document.head||document.getElementsByTagName("head")[0]).appendChild(n)},rt=(e,t)=>{let n="",i;window.addEventListener("visibilitychange",()=>{if(clearTimeout(i),document.hidden){document.title!==e&&(n=document.title),document.title=t;return}document.title=e,i=setTimeout(()=>{document.title=n},1e3)})},st=e=>Object.entries(e).map(([t,n])=>`${t}=${n}`).join("&"),ot=(e,t)=>{const n=[];for(let i=0;i<e.length;i+=t)n.push(e.slice(i,i+t));return n},we=e=>{if(typeof e=="string")try{const t=JSON.parse(e);return we(t)}catch{return e}return Array.isArray(e)?e.map(t=>we(t)):e!==null&&typeof e=="object"?Object.keys(e).reduce((t,n)=>(t[n]=we(e[n]),t),{}):e},ut=(e=[],t)=>t?e.reduce((n,i)=>(n[i[t]]||(n[i[t]]=[]),n[i[t]].push(i),n),{}):{},ct=(e,t)=>e.includes("@")?t.filter(n=>n.includes(e.slice(e.indexOf("@")))).map(n=>(e.includes("@")?e.split("@")[0]:e)+n):t.map(n=>e+n),at=e=>{const t=[...e];for(let n=t.length-1;n>0;n--){const i=Math.floor(Math.random()*(n+1));[t[n],t[i]]=[t[i],t[n]]}return t},ft=(e,t)=>{const n=e.length;if(n===0||t%n===0)return e;const i=(t%n+n)%n;return e.slice(-i).concat(e.slice(0,-i))},lt=(e,t)=>{if(t<0||t>=e.length)throw new Error("Index out of bounds");const n=e.slice(t+1).reverse();return[...e.slice(0,t+1),...n]},ht=(e,t)=>{fetch(e).then(n=>n.blob()).then(n=>{const i=document.createElement("a"),r=window.URL.createObjectURL(n);i.href=r,i.download=t,i.click()})},dt=e=>{const t=document.createElement("canvas");t.classList.add("imageOptimizer"),document.body.appendChild(t);const n=e.file;if(!n)return;const i=n.name,r=i.split(".").pop().toLowerCase(),s=e.ratio||1,o=e.maxSize||1024,u=e.width||1e4,a=n.type;function c(h,p){const w=h.split(","),M=w[0].match(/:(.*?);/)[1],P=window.atob(w[1]),A=P.length,H=new Uint8Array(A);for(let O=0;O<A;O++)H[O]=P.charCodeAt(O);return new File([H],p,{type:M})}function f(h){const p=new FormData;return p.append("file",h),p}const l=new FileReader;l.readAsDataURL(n),l.onload=h=>{const p=h.target.result;if(h.total/1024>o){const w=new Image;w.src=p,w.onload=()=>{const M=t.getContext("2d"),P=u/w.width;P<1?(t.width=w.width*P,t.height=w.height*P,M.drawImage(w,0,0,w.width*P,w.height*P)):(t.width=w.width,t.height=w.height,M.drawImage(w,0,0,w.width,w.height));const A=t.toDataURL(a,s),H=`${i.split(".")[0]}.${r}`,O=c(A,H);e.success(f(O),O,A),t.remove()},w.onerror=e.fail}else{const w=`${i.split(".")[0]}.${r}`,M=c(p,w);e.success(f(M),M,p),t.remove()}},l.onerror=e.fail},mt=(e,t)=>{const n=window.URL||window.webkitURL,i=new Blob([t]),r=document.createElement("a");r.href=n.createObjectURL(i),r.download=e,r.click(),n.revokeObjectURL(r.href)};var Le=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fe={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(Le,function(){var n=1e3,i=6e4,r=36e5,s="millisecond",o="second",u="minute",a="hour",c="day",f="week",l="month",h="quarter",p="year",w="date",M="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,H={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(N){var g=["th","st","nd","rd"],m=N%100;return"["+N+(g[(m-20)%10]||g[m]||g[0])+"]"}},O=function(N,g,m){var D=String(N);return!D||D.length>=g?N:""+Array(g+1-D.length).join(m)+N},q={s:O,z:function(N){var g=-N.utcOffset(),m=Math.abs(g),D=Math.floor(m/60),$=m%60;return(g<=0?"+":"-")+O(D,2,"0")+":"+O($,2,"0")},m:function N(g,m){if(g.date()<m.date())return-N(m,g);var D=12*(m.year()-g.year())+(m.month()-g.month()),$=g.clone().add(D,l),C=m-$<0,I=g.clone().add(D+(C?-1:1),l);return+(-(D+(m-$)/(C?$-I:I-$))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:l,y:p,w:f,d:c,D:w,h:a,m:u,s:o,ms:s,Q:h}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},X="en",T={};T[X]=H;var E="$isDayjsObject",v=function(N){return N instanceof R||!(!N||!N[E])},L=function N(g,m,D){var $;if(!g)return X;if(typeof g=="string"){var C=g.toLowerCase();T[C]&&($=C),m&&(T[C]=m,$=C);var I=g.split("-");if(!$&&I.length>1)return N(I[0])}else{var J=g.name;T[J]=g,$=J}return!D&&$&&(X=$),$||!D&&X},y=function(N,g){if(v(N))return N.clone();var m=typeof g=="object"?g:{};return m.date=N,m.args=arguments,new R(m)},b=q;b.l=L,b.i=v,b.w=function(N,g){return y(N,{locale:g.$L,utc:g.$u,x:g.$x,$offset:g.$offset})};var R=function(){function N(m){this.$L=L(m.locale,null,!0),this.parse(m),this.$x=this.$x||m.x||{},this[E]=!0}var g=N.prototype;return g.parse=function(m){this.$d=function(D){var $=D.date,C=D.utc;if($===null)return new Date(NaN);if(b.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var I=$.match(P);if(I){var J=I[2]-1||0,B=(I[7]||"0").substring(0,3);return C?new Date(Date.UTC(I[1],J,I[3]||1,I[4]||0,I[5]||0,I[6]||0,B)):new Date(I[1],J,I[3]||1,I[4]||0,I[5]||0,I[6]||0,B)}}return new Date($)}(m),this.init()},g.init=function(){var m=this.$d;this.$y=m.getFullYear(),this.$M=m.getMonth(),this.$D=m.getDate(),this.$W=m.getDay(),this.$H=m.getHours(),this.$m=m.getMinutes(),this.$s=m.getSeconds(),this.$ms=m.getMilliseconds()},g.$utils=function(){return b},g.isValid=function(){return this.$d.toString()!==M},g.isSame=function(m,D){var $=y(m);return this.startOf(D)<=$&&$<=this.endOf(D)},g.isAfter=function(m,D){return y(m)<this.startOf(D)},g.isBefore=function(m,D){return this.endOf(D)<y(m)},g.$g=function(m,D,$){return b.u(m)?this[D]:this.set($,m)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(m,D){var $=this,C=!!b.u(D)||D,I=b.p(m),J=function(ae,G){var ue=b.w($.$u?Date.UTC($.$y,G,ae):new Date($.$y,G,ae),$);return C?ue:ue.endOf(c)},B=function(ae,G){return b.w($.toDate()[ae].apply($.toDate("s"),(C?[0,0,0,0]:[23,59,59,999]).slice(G)),$)},Z=this.$W,V=this.$M,x=this.$D,he="set"+(this.$u?"UTC":"");switch(I){case p:return C?J(1,0):J(31,11);case l:return C?J(1,V):J(0,V+1);case f:var ce=this.$locale().weekStart||0,me=(Z<ce?Z+7:Z)-ce;return J(C?x-me:x+(6-me),V);case c:case w:return B(he+"Hours",0);case a:return B(he+"Minutes",1);case u:return B(he+"Seconds",2);case o:return B(he+"Milliseconds",3);default:return this.clone()}},g.endOf=function(m){return this.startOf(m,!1)},g.$set=function(m,D){var $,C=b.p(m),I="set"+(this.$u?"UTC":""),J=($={},$[c]=I+"Date",$[w]=I+"Date",$[l]=I+"Month",$[p]=I+"FullYear",$[a]=I+"Hours",$[u]=I+"Minutes",$[o]=I+"Seconds",$[s]=I+"Milliseconds",$)[C],B=C===c?this.$D+(D-this.$W):D;if(C===l||C===p){var Z=this.clone().set(w,1);Z.$d[J](B),Z.init(),this.$d=Z.set(w,Math.min(this.$D,Z.daysInMonth())).$d}else J&&this.$d[J](B);return this.init(),this},g.set=function(m,D){return this.clone().$set(m,D)},g.get=function(m){return this[b.p(m)]()},g.add=function(m,D){var $,C=this;m=Number(m);var I=b.p(D),J=function(V){var x=y(C);return b.w(x.date(x.date()+Math.round(V*m)),C)};if(I===l)return this.set(l,this.$M+m);if(I===p)return this.set(p,this.$y+m);if(I===c)return J(1);if(I===f)return J(7);var B=($={},$[u]=i,$[a]=r,$[o]=n,$)[I]||1,Z=this.$d.getTime()+m*B;return b.w(Z,this)},g.subtract=function(m,D){return this.add(-1*m,D)},g.format=function(m){var D=this,$=this.$locale();if(!this.isValid())return $.invalidDate||M;var C=m||"YYYY-MM-DDTHH:mm:ssZ",I=b.z(this),J=this.$H,B=this.$m,Z=this.$M,V=$.weekdays,x=$.months,he=$.meridiem,ce=function(G,ue,pe,ke){return G&&(G[ue]||G(D,C))||pe[ue].slice(0,ke)},me=function(G){return b.s(J%12||12,G,"0")},ae=he||function(G,ue,pe){var ke=G<12?"AM":"PM";return pe?ke.toLowerCase():ke};return C.replace(A,function(G,ue){return ue||function(pe){switch(pe){case"YY":return String(D.$y).slice(-2);case"YYYY":return b.s(D.$y,4,"0");case"M":return Z+1;case"MM":return b.s(Z+1,2,"0");case"MMM":return ce($.monthsShort,Z,x,3);case"MMMM":return ce(x,Z);case"D":return D.$D;case"DD":return b.s(D.$D,2,"0");case"d":return String(D.$W);case"dd":return ce($.weekdaysMin,D.$W,V,2);case"ddd":return ce($.weekdaysShort,D.$W,V,3);case"dddd":return V[D.$W];case"H":return String(J);case"HH":return b.s(J,2,"0");case"h":return me(1);case"hh":return me(2);case"a":return ae(J,B,!0);case"A":return ae(J,B,!1);case"m":return String(B);case"mm":return b.s(B,2,"0");case"s":return String(D.$s);case"ss":return b.s(D.$s,2,"0");case"SSS":return b.s(D.$ms,3,"0");case"Z":return I}return null}(G)||I.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(m,D,$){var C,I=this,J=b.p(D),B=y(m),Z=(B.utcOffset()-this.utcOffset())*i,V=this-B,x=function(){return b.m(I,B)};switch(J){case p:C=x()/12;break;case l:C=x();break;case h:C=x()/3;break;case f:C=(V-Z)/6048e5;break;case c:C=(V-Z)/864e5;break;case a:C=V/r;break;case u:C=V/i;break;case o:C=V/n;break;default:C=V}return $?C:b.a(C)},g.daysInMonth=function(){return this.endOf(l).$D},g.$locale=function(){return T[this.$L]},g.locale=function(m,D){if(!m)return this.$L;var $=this.clone(),C=L(m,D,!0);return C&&($.$L=C),$},g.clone=function(){return b.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},N}(),U=R.prototype;return y.prototype=U,[["$ms",s],["$s",o],["$m",u],["$H",a],["$W",c],["$M",l],["$y",p],["$D",w]].forEach(function(N){U[N[1]]=function(g){return this.$g(g,N[0],N[1])}}),y.extend=function(N,g){return N.$i||(N(g,R,y),N.$i=!0),y},y.locale=L,y.isDayjs=v,y.unix=function(N){return y(1e3*N)},y.en=T[X],y.Ls=T,y.p={},y})})(Fe);var pt=Fe.exports;const ve=Pe(pt);var Je={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(Le,function(){var n,i,r=1e3,s=6e4,o=36e5,u=864e5,a=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=31536e6,f=2628e6,l=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:c,months:f,days:u,hours:o,minutes:s,seconds:r,milliseconds:1,weeks:6048e5},p=function(T){return T instanceof q},w=function(T,E,v){return new q(T,v,E.$l)},M=function(T){return i.p(T)+"s"},P=function(T){return T<0},A=function(T){return P(T)?Math.ceil(T):Math.floor(T)},H=function(T){return Math.abs(T)},O=function(T,E){return T?P(T)?{negative:!0,format:""+H(T)+E}:{negative:!1,format:""+T+E}:{negative:!1,format:""}},q=function(){function T(v,L,y){var b=this;if(this.$d={},this.$l=y,v===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return w(v*h[M(L)],this);if(typeof v=="number")return this.$ms=v,this.parseFromMilliseconds(),this;if(typeof v=="object")return Object.keys(v).forEach(function(N){b.$d[M(N)]=v[N]}),this.calMilliseconds(),this;if(typeof v=="string"){var R=v.match(l);if(R){var U=R.slice(2).map(function(N){return N!=null?Number(N):0});return this.$d.years=U[0],this.$d.months=U[1],this.$d.weeks=U[2],this.$d.days=U[3],this.$d.hours=U[4],this.$d.minutes=U[5],this.$d.seconds=U[6],this.calMilliseconds(),this}}return this}var E=T.prototype;return E.calMilliseconds=function(){var v=this;this.$ms=Object.keys(this.$d).reduce(function(L,y){return L+(v.$d[y]||0)*h[y]},0)},E.parseFromMilliseconds=function(){var v=this.$ms;this.$d.years=A(v/c),v%=c,this.$d.months=A(v/f),v%=f,this.$d.days=A(v/u),v%=u,this.$d.hours=A(v/o),v%=o,this.$d.minutes=A(v/s),v%=s,this.$d.seconds=A(v/r),v%=r,this.$d.milliseconds=v},E.toISOString=function(){var v=O(this.$d.years,"Y"),L=O(this.$d.months,"M"),y=+this.$d.days||0;this.$d.weeks&&(y+=7*this.$d.weeks);var b=O(y,"D"),R=O(this.$d.hours,"H"),U=O(this.$d.minutes,"M"),N=this.$d.seconds||0;this.$d.milliseconds&&(N+=this.$d.milliseconds/1e3,N=Math.round(1e3*N)/1e3);var g=O(N,"S"),m=v.negative||L.negative||b.negative||R.negative||U.negative||g.negative,D=R.format||U.format||g.format?"T":"",$=(m?"-":"")+"P"+v.format+L.format+b.format+D+R.format+U.format+g.format;return $==="P"||$==="-P"?"P0D":$},E.toJSON=function(){return this.toISOString()},E.format=function(v){var L=v||"YYYY-MM-DDTHH:mm:ss",y={Y:this.$d.years,YY:i.s(this.$d.years,2,"0"),YYYY:i.s(this.$d.years,4,"0"),M:this.$d.months,MM:i.s(this.$d.months,2,"0"),D:this.$d.days,DD:i.s(this.$d.days,2,"0"),H:this.$d.hours,HH:i.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:i.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:i.s(this.$d.seconds,2,"0"),SSS:i.s(this.$d.milliseconds,3,"0")};return L.replace(a,function(b,R){return R||String(y[b])})},E.as=function(v){return this.$ms/h[M(v)]},E.get=function(v){var L=this.$ms,y=M(v);return y==="milliseconds"?L%=1e3:L=y==="weeks"?A(L/h[y]):this.$d[y],L||0},E.add=function(v,L,y){var b;return b=L?v*h[M(L)]:p(v)?v.$ms:w(v,this).$ms,w(this.$ms+b*(y?-1:1),this)},E.subtract=function(v,L){return this.add(v,L,!0)},E.locale=function(v){var L=this.clone();return L.$l=v,L},E.clone=function(){return w(this.$ms,this)},E.humanize=function(v){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!v)},E.valueOf=function(){return this.asMilliseconds()},E.milliseconds=function(){return this.get("milliseconds")},E.asMilliseconds=function(){return this.as("milliseconds")},E.seconds=function(){return this.get("seconds")},E.asSeconds=function(){return this.as("seconds")},E.minutes=function(){return this.get("minutes")},E.asMinutes=function(){return this.as("minutes")},E.hours=function(){return this.get("hours")},E.asHours=function(){return this.as("hours")},E.days=function(){return this.get("days")},E.asDays=function(){return this.as("days")},E.weeks=function(){return this.get("weeks")},E.asWeeks=function(){return this.as("weeks")},E.months=function(){return this.get("months")},E.asMonths=function(){return this.as("months")},E.years=function(){return this.get("years")},E.asYears=function(){return this.as("years")},T}(),X=function(T,E,v){return T.add(E.years()*v,"y").add(E.months()*v,"M").add(E.days()*v,"d").add(E.hours()*v,"h").add(E.minutes()*v,"m").add(E.seconds()*v,"s").add(E.milliseconds()*v,"ms")};return function(T,E,v){n=v,i=v().$utils(),v.duration=function(b,R){var U=v.locale();return w(b,{$l:U},R)},v.isDuration=p;var L=E.prototype.add,y=E.prototype.subtract;E.prototype.add=function(b,R){return p(b)?X(this,b,1):L.bind(this)(b,R)},E.prototype.subtract=function(b,R){return p(b)?X(this,b,-1):y.bind(this)(b,R)}}})})(Je);var gt=Je.exports;const wt=Pe(gt);ve.extend(wt);const vt=e=>{const t=ve.duration(e,"seconds"),n=Math.floor(t.asYears()),i=Math.floor(t.asMonths()%12),r=Math.floor(t.asDays()%30),s=t.hours(),o=t.minutes(),u=t.seconds(),a=[];return n>0&&a.push(`${n}年`),i>0&&a.push(`${i}月`),r>0&&a.push(`${r}天`),s>0&&a.push(`${s}小时`),o>0&&a.push(`${o}分`),(a.length===0||u>0)&&a.push(`${u}秒`),a.join("")},$t=e=>{if(e<=0)return[0,"B","0 B"];const t=1024,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=Math.min(Math.floor(Math.log(e)/Math.log(t)),n.length-1),r=(e/t**i).toFixed(2);return[r,n[i],`${r} ${n[i]}`]},Mt=e=>e.toString().replace(/^(\d{3})\d{4}(\d{4})$/,"$1****$2"),_e=(e,t=2)=>{const n=e.toFixed(t).toString(),i=n.indexOf(".")>-1?/(\d)(?=(\d{3})+\.)/g:/(\d)(?=(?:\d{3})+$)/g;return n.replace(i,"$1,")};/*!
|
|
1
|
+
(function(ge){typeof define=="function"&&define.amd?define(ge):ge()})(function(){"use strict";const ge=e=>Object.prototype.toString.call(e).substring(8).replace(/]/g,"").toLowerCase(),Ke=(e=1,t)=>{let n,i=e,r=Date.now(),s=!1;return new Promise(o=>{const u=()=>{document.hidden?(s=!0,clearTimeout(n),i-=Date.now()-r):s&&(s=!1,r=Date.now(),a(o))},a=c=>{n=setTimeout(()=>{t==null||t(),c(),document.removeEventListener("visibilitychange",u)},i)};document.addEventListener("visibilitychange",u),a(o)})},Qe=(e,t,n=[],i=!1)=>{if(!i)return;const r={red:"#c0392b",orange:"#d35400",yellow:"#f1c40f",green:"#27ae60",blue:"#2980b9",purple:"#be2edd"},s=()=>{const o=new Date,u=String(o.getHours()).padStart(2,"0"),a=String(o.getMinutes()).padStart(2,"0"),c=String(o.getSeconds()).padStart(2,"0");return`[${u}:${a}:${c}]`};if(Array.isArray(n)){const o=n.map(u=>[`
|
|
2
|
+
${u.label}:`,u.value]);console.log(`%c${s()}-${e}`,`color: #fff;background: ${r[t]}; font-size:14px;border-radius:5px;padding:0.25em;margin:0.5em 0`,...o.flat(1/0))}else console.log(`%c${s()}-${e}`,`color: #fff;background: ${r[t]}; font-size:14px;border-radius:5px;padding:0.25em;margin:0.5em 0`,n)},et=()=>{const e=navigator.userAgent.toLowerCase();return/mobile|android|iphone|ipod/.test(e)},tt=()=>{const e=navigator.userAgent.toLowerCase(),t=Math.max(window.screen.width,window.screen.height),n=Math.min(window.screen.width,window.screen.height),i=t/n,r=/ipad|tablet|playbook|silk/.test(e)&&!/mobile/.test(e),s=t>=768&&t<=1366,o=i>=1.3&&i<=1.6;return r||s&&o},nt=()=>{const t=location.href.split("?")[1];return t?t.split("&").reduce((i,r)=>{const[s,o]=r.split(/=(.+)/);return i[s]=o,i},{})||{}:{}},it=(e,t)=>{document.title=e;const n=document.createElement("link");n.setAttribute("rel","icon"),n.setAttribute("href",t),(document.head||document.getElementsByTagName("head")[0]).appendChild(n)},rt=(e,t)=>{let n="",i;window.addEventListener("visibilitychange",()=>{if(clearTimeout(i),document.hidden){document.title!==e&&(n=document.title),document.title=t;return}document.title=e,i=setTimeout(()=>{document.title=n},1e3)})},st=e=>Object.entries(e).map(([t,n])=>`${t}=${n}`).join("&"),ot=(e,t)=>{const n=[];for(let i=0;i<e.length;i+=t)n.push(e.slice(i,i+t));return n},we=e=>{if(typeof e=="string")try{const t=JSON.parse(e);return we(t)}catch{return e}return Array.isArray(e)?e.map(t=>we(t)):e!==null&&typeof e=="object"?Object.keys(e).reduce((t,n)=>(t[n]=we(e[n]),t),{}):e},ut=(e=[],t)=>t?e.reduce((n,i)=>(n[i[t]]||(n[i[t]]=[]),n[i[t]].push(i),n),{}):{},ct=(e,t)=>e.includes("@")?t.filter(n=>n.includes(e.slice(e.indexOf("@")))).map(n=>(e.includes("@")?e.split("@")[0]:e)+n):t.map(n=>e+n),at=e=>{const t=[...e];for(let n=t.length-1;n>0;n--){const i=Math.floor(Math.random()*(n+1));[t[n],t[i]]=[t[i],t[n]]}return t},ft=(e,t)=>{const n=e.length;if(n===0||t%n===0)return e;const i=(t%n+n)%n;return e.slice(-i).concat(e.slice(0,-i))},lt=(e,t)=>{if(t<0||t>=e.length)throw new Error("Index out of bounds");const n=e.slice(t+1).reverse();return[...e.slice(0,t+1),...n]},ht=(e,t)=>{fetch(e).then(n=>n.blob()).then(n=>{const i=document.createElement("a"),r=window.URL.createObjectURL(n);i.href=r,i.download=t,i.click()})},dt=e=>{const t=document.createElement("canvas");t.classList.add("imageOptimizer"),document.body.appendChild(t);const n=e.file;if(!n)return;const i=n.name,r=i.split(".").pop().toLowerCase(),s=e.ratio||1,o=e.maxSize||1024,u=e.width||1e4,a=n.type;function c(h,p){const w=h.split(","),M=w[0].match(/:(.*?);/)[1],P=window.atob(w[1]),A=P.length,H=new Uint8Array(A);for(let O=0;O<A;O++)H[O]=P.charCodeAt(O);return new File([H],p,{type:M})}function f(h){const p=new FormData;return p.append("file",h),p}const l=new FileReader;l.readAsDataURL(n),l.onload=h=>{const p=h.target.result;if(h.total/1024>o){const w=new Image;w.src=p,w.onload=()=>{const M=t.getContext("2d"),P=u/w.width;P<1?(t.width=w.width*P,t.height=w.height*P,M.drawImage(w,0,0,w.width*P,w.height*P)):(t.width=w.width,t.height=w.height,M.drawImage(w,0,0,w.width,w.height));const A=t.toDataURL(a,s),H=`${i.split(".")[0]}.${r}`,O=c(A,H);e.success(f(O),O,A),t.remove()},w.onerror=e.fail}else{const w=`${i.split(".")[0]}.${r}`,M=c(p,w);e.success(f(M),M,p),t.remove()}},l.onerror=e.fail},mt=(e,t)=>{const n=window.URL||window.webkitURL,i=new Blob([t]),r=document.createElement("a");r.href=n.createObjectURL(i),r.download=e,r.click(),n.revokeObjectURL(r.href)};var Le=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fe={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(Le,function(){var n=1e3,i=6e4,r=36e5,s="millisecond",o="second",u="minute",a="hour",c="day",f="week",l="month",h="quarter",p="year",w="date",M="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,H={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(N){var g=["th","st","nd","rd"],m=N%100;return"["+N+(g[(m-20)%10]||g[m]||g[0])+"]"}},O=function(N,g,m){var D=String(N);return!D||D.length>=g?N:""+Array(g+1-D.length).join(m)+N},q={s:O,z:function(N){var g=-N.utcOffset(),m=Math.abs(g),D=Math.floor(m/60),$=m%60;return(g<=0?"+":"-")+O(D,2,"0")+":"+O($,2,"0")},m:function N(g,m){if(g.date()<m.date())return-N(m,g);var D=12*(m.year()-g.year())+(m.month()-g.month()),$=g.clone().add(D,l),C=m-$<0,I=g.clone().add(D+(C?-1:1),l);return+(-(D+(m-$)/(C?$-I:I-$))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:l,y:p,w:f,d:c,D:w,h:a,m:u,s:o,ms:s,Q:h}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},X="en",T={};T[X]=H;var E="$isDayjsObject",v=function(N){return N instanceof R||!(!N||!N[E])},L=function N(g,m,D){var $;if(!g)return X;if(typeof g=="string"){var C=g.toLowerCase();T[C]&&($=C),m&&(T[C]=m,$=C);var I=g.split("-");if(!$&&I.length>1)return N(I[0])}else{var J=g.name;T[J]=g,$=J}return!D&&$&&(X=$),$||!D&&X},y=function(N,g){if(v(N))return N.clone();var m=typeof g=="object"?g:{};return m.date=N,m.args=arguments,new R(m)},b=q;b.l=L,b.i=v,b.w=function(N,g){return y(N,{locale:g.$L,utc:g.$u,x:g.$x,$offset:g.$offset})};var R=function(){function N(m){this.$L=L(m.locale,null,!0),this.parse(m),this.$x=this.$x||m.x||{},this[E]=!0}var g=N.prototype;return g.parse=function(m){this.$d=function(D){var $=D.date,C=D.utc;if($===null)return new Date(NaN);if(b.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var I=$.match(P);if(I){var J=I[2]-1||0,B=(I[7]||"0").substring(0,3);return C?new Date(Date.UTC(I[1],J,I[3]||1,I[4]||0,I[5]||0,I[6]||0,B)):new Date(I[1],J,I[3]||1,I[4]||0,I[5]||0,I[6]||0,B)}}return new Date($)}(m),this.init()},g.init=function(){var m=this.$d;this.$y=m.getFullYear(),this.$M=m.getMonth(),this.$D=m.getDate(),this.$W=m.getDay(),this.$H=m.getHours(),this.$m=m.getMinutes(),this.$s=m.getSeconds(),this.$ms=m.getMilliseconds()},g.$utils=function(){return b},g.isValid=function(){return this.$d.toString()!==M},g.isSame=function(m,D){var $=y(m);return this.startOf(D)<=$&&$<=this.endOf(D)},g.isAfter=function(m,D){return y(m)<this.startOf(D)},g.isBefore=function(m,D){return this.endOf(D)<y(m)},g.$g=function(m,D,$){return b.u(m)?this[D]:this.set($,m)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(m,D){var $=this,C=!!b.u(D)||D,I=b.p(m),J=function(ae,G){var ue=b.w($.$u?Date.UTC($.$y,G,ae):new Date($.$y,G,ae),$);return C?ue:ue.endOf(c)},B=function(ae,G){return b.w($.toDate()[ae].apply($.toDate("s"),(C?[0,0,0,0]:[23,59,59,999]).slice(G)),$)},Z=this.$W,V=this.$M,x=this.$D,he="set"+(this.$u?"UTC":"");switch(I){case p:return C?J(1,0):J(31,11);case l:return C?J(1,V):J(0,V+1);case f:var ce=this.$locale().weekStart||0,me=(Z<ce?Z+7:Z)-ce;return J(C?x-me:x+(6-me),V);case c:case w:return B(he+"Hours",0);case a:return B(he+"Minutes",1);case u:return B(he+"Seconds",2);case o:return B(he+"Milliseconds",3);default:return this.clone()}},g.endOf=function(m){return this.startOf(m,!1)},g.$set=function(m,D){var $,C=b.p(m),I="set"+(this.$u?"UTC":""),J=($={},$[c]=I+"Date",$[w]=I+"Date",$[l]=I+"Month",$[p]=I+"FullYear",$[a]=I+"Hours",$[u]=I+"Minutes",$[o]=I+"Seconds",$[s]=I+"Milliseconds",$)[C],B=C===c?this.$D+(D-this.$W):D;if(C===l||C===p){var Z=this.clone().set(w,1);Z.$d[J](B),Z.init(),this.$d=Z.set(w,Math.min(this.$D,Z.daysInMonth())).$d}else J&&this.$d[J](B);return this.init(),this},g.set=function(m,D){return this.clone().$set(m,D)},g.get=function(m){return this[b.p(m)]()},g.add=function(m,D){var $,C=this;m=Number(m);var I=b.p(D),J=function(V){var x=y(C);return b.w(x.date(x.date()+Math.round(V*m)),C)};if(I===l)return this.set(l,this.$M+m);if(I===p)return this.set(p,this.$y+m);if(I===c)return J(1);if(I===f)return J(7);var B=($={},$[u]=i,$[a]=r,$[o]=n,$)[I]||1,Z=this.$d.getTime()+m*B;return b.w(Z,this)},g.subtract=function(m,D){return this.add(-1*m,D)},g.format=function(m){var D=this,$=this.$locale();if(!this.isValid())return $.invalidDate||M;var C=m||"YYYY-MM-DDTHH:mm:ssZ",I=b.z(this),J=this.$H,B=this.$m,Z=this.$M,V=$.weekdays,x=$.months,he=$.meridiem,ce=function(G,ue,pe,ke){return G&&(G[ue]||G(D,C))||pe[ue].slice(0,ke)},me=function(G){return b.s(J%12||12,G,"0")},ae=he||function(G,ue,pe){var ke=G<12?"AM":"PM";return pe?ke.toLowerCase():ke};return C.replace(A,function(G,ue){return ue||function(pe){switch(pe){case"YY":return String(D.$y).slice(-2);case"YYYY":return b.s(D.$y,4,"0");case"M":return Z+1;case"MM":return b.s(Z+1,2,"0");case"MMM":return ce($.monthsShort,Z,x,3);case"MMMM":return ce(x,Z);case"D":return D.$D;case"DD":return b.s(D.$D,2,"0");case"d":return String(D.$W);case"dd":return ce($.weekdaysMin,D.$W,V,2);case"ddd":return ce($.weekdaysShort,D.$W,V,3);case"dddd":return V[D.$W];case"H":return String(J);case"HH":return b.s(J,2,"0");case"h":return me(1);case"hh":return me(2);case"a":return ae(J,B,!0);case"A":return ae(J,B,!1);case"m":return String(B);case"mm":return b.s(B,2,"0");case"s":return String(D.$s);case"ss":return b.s(D.$s,2,"0");case"SSS":return b.s(D.$ms,3,"0");case"Z":return I}return null}(G)||I.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(m,D,$){var C,I=this,J=b.p(D),B=y(m),Z=(B.utcOffset()-this.utcOffset())*i,V=this-B,x=function(){return b.m(I,B)};switch(J){case p:C=x()/12;break;case l:C=x();break;case h:C=x()/3;break;case f:C=(V-Z)/6048e5;break;case c:C=(V-Z)/864e5;break;case a:C=V/r;break;case u:C=V/i;break;case o:C=V/n;break;default:C=V}return $?C:b.a(C)},g.daysInMonth=function(){return this.endOf(l).$D},g.$locale=function(){return T[this.$L]},g.locale=function(m,D){if(!m)return this.$L;var $=this.clone(),C=L(m,D,!0);return C&&($.$L=C),$},g.clone=function(){return b.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},N}(),U=R.prototype;return y.prototype=U,[["$ms",s],["$s",o],["$m",u],["$H",a],["$W",c],["$M",l],["$y",p],["$D",w]].forEach(function(N){U[N[1]]=function(g){return this.$g(g,N[0],N[1])}}),y.extend=function(N,g){return N.$i||(N(g,R,y),N.$i=!0),y},y.locale=L,y.isDayjs=v,y.unix=function(N){return y(1e3*N)},y.en=T[X],y.Ls=T,y.p={},y})})(Fe);var pt=Fe.exports;const ve=Pe(pt);var Je={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(Le,function(){var n,i,r=1e3,s=6e4,o=36e5,u=864e5,a=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=31536e6,f=2628e6,l=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:c,months:f,days:u,hours:o,minutes:s,seconds:r,milliseconds:1,weeks:6048e5},p=function(T){return T instanceof q},w=function(T,E,v){return new q(T,v,E.$l)},M=function(T){return i.p(T)+"s"},P=function(T){return T<0},A=function(T){return P(T)?Math.ceil(T):Math.floor(T)},H=function(T){return Math.abs(T)},O=function(T,E){return T?P(T)?{negative:!0,format:""+H(T)+E}:{negative:!1,format:""+T+E}:{negative:!1,format:""}},q=function(){function T(v,L,y){var b=this;if(this.$d={},this.$l=y,v===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return w(v*h[M(L)],this);if(typeof v=="number")return this.$ms=v,this.parseFromMilliseconds(),this;if(typeof v=="object")return Object.keys(v).forEach(function(N){b.$d[M(N)]=v[N]}),this.calMilliseconds(),this;if(typeof v=="string"){var R=v.match(l);if(R){var U=R.slice(2).map(function(N){return N!=null?Number(N):0});return this.$d.years=U[0],this.$d.months=U[1],this.$d.weeks=U[2],this.$d.days=U[3],this.$d.hours=U[4],this.$d.minutes=U[5],this.$d.seconds=U[6],this.calMilliseconds(),this}}return this}var E=T.prototype;return E.calMilliseconds=function(){var v=this;this.$ms=Object.keys(this.$d).reduce(function(L,y){return L+(v.$d[y]||0)*h[y]},0)},E.parseFromMilliseconds=function(){var v=this.$ms;this.$d.years=A(v/c),v%=c,this.$d.months=A(v/f),v%=f,this.$d.days=A(v/u),v%=u,this.$d.hours=A(v/o),v%=o,this.$d.minutes=A(v/s),v%=s,this.$d.seconds=A(v/r),v%=r,this.$d.milliseconds=v},E.toISOString=function(){var v=O(this.$d.years,"Y"),L=O(this.$d.months,"M"),y=+this.$d.days||0;this.$d.weeks&&(y+=7*this.$d.weeks);var b=O(y,"D"),R=O(this.$d.hours,"H"),U=O(this.$d.minutes,"M"),N=this.$d.seconds||0;this.$d.milliseconds&&(N+=this.$d.milliseconds/1e3,N=Math.round(1e3*N)/1e3);var g=O(N,"S"),m=v.negative||L.negative||b.negative||R.negative||U.negative||g.negative,D=R.format||U.format||g.format?"T":"",$=(m?"-":"")+"P"+v.format+L.format+b.format+D+R.format+U.format+g.format;return $==="P"||$==="-P"?"P0D":$},E.toJSON=function(){return this.toISOString()},E.format=function(v){var L=v||"YYYY-MM-DDTHH:mm:ss",y={Y:this.$d.years,YY:i.s(this.$d.years,2,"0"),YYYY:i.s(this.$d.years,4,"0"),M:this.$d.months,MM:i.s(this.$d.months,2,"0"),D:this.$d.days,DD:i.s(this.$d.days,2,"0"),H:this.$d.hours,HH:i.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:i.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:i.s(this.$d.seconds,2,"0"),SSS:i.s(this.$d.milliseconds,3,"0")};return L.replace(a,function(b,R){return R||String(y[b])})},E.as=function(v){return this.$ms/h[M(v)]},E.get=function(v){var L=this.$ms,y=M(v);return y==="milliseconds"?L%=1e3:L=y==="weeks"?A(L/h[y]):this.$d[y],L||0},E.add=function(v,L,y){var b;return b=L?v*h[M(L)]:p(v)?v.$ms:w(v,this).$ms,w(this.$ms+b*(y?-1:1),this)},E.subtract=function(v,L){return this.add(v,L,!0)},E.locale=function(v){var L=this.clone();return L.$l=v,L},E.clone=function(){return w(this.$ms,this)},E.humanize=function(v){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!v)},E.valueOf=function(){return this.asMilliseconds()},E.milliseconds=function(){return this.get("milliseconds")},E.asMilliseconds=function(){return this.as("milliseconds")},E.seconds=function(){return this.get("seconds")},E.asSeconds=function(){return this.as("seconds")},E.minutes=function(){return this.get("minutes")},E.asMinutes=function(){return this.as("minutes")},E.hours=function(){return this.get("hours")},E.asHours=function(){return this.as("hours")},E.days=function(){return this.get("days")},E.asDays=function(){return this.as("days")},E.weeks=function(){return this.get("weeks")},E.asWeeks=function(){return this.as("weeks")},E.months=function(){return this.get("months")},E.asMonths=function(){return this.as("months")},E.years=function(){return this.get("years")},E.asYears=function(){return this.as("years")},T}(),X=function(T,E,v){return T.add(E.years()*v,"y").add(E.months()*v,"M").add(E.days()*v,"d").add(E.hours()*v,"h").add(E.minutes()*v,"m").add(E.seconds()*v,"s").add(E.milliseconds()*v,"ms")};return function(T,E,v){n=v,i=v().$utils(),v.duration=function(b,R){var U=v.locale();return w(b,{$l:U},R)},v.isDuration=p;var L=E.prototype.add,y=E.prototype.subtract;E.prototype.add=function(b,R){return p(b)?X(this,b,1):L.bind(this)(b,R)},E.prototype.subtract=function(b,R){return p(b)?X(this,b,-1):y.bind(this)(b,R)}}})})(Je);var gt=Je.exports;const wt=Pe(gt);ve.extend(wt);const vt=e=>{const t=ve.duration(e,"seconds"),n=Math.floor(t.asYears()),i=Math.floor(t.asMonths()%12),r=Math.floor(t.asDays()%30),s=t.hours(),o=t.minutes(),u=t.seconds(),a=[];return n>0&&a.push(`${n}年`),i>0&&a.push(`${i}月`),r>0&&a.push(`${r}天`),s>0&&a.push(`${s}小时`),o>0&&a.push(`${o}分`),(a.length===0||u>0)&&a.push(`${u}秒`),a.join("")},$t=e=>{if(e<=0)return[0,"B","0 B"];const t=1024,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=Math.min(Math.floor(Math.log(e)/Math.log(t)),n.length-1),r=(e/t**i).toFixed(2);return[r,n[i],`${r} ${n[i]}`]},Mt=e=>e.toString().replace(/^(\d{3})\d{4}(\d{4})$/,"$1****$2"),_e=(e,t=2)=>{const n=e.toFixed(t).toString(),i=n.indexOf(".")>-1?/(\d)(?=(\d{3})+\.)/g:/(\d)(?=(?:\d{3})+$)/g;return n.replace(i,"$1,")};/*!
|
|
3
3
|
* decimal.js v10.4.3
|
|
4
4
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
5
5
|
* https://github.com/MikeMcl/decimal.js
|