@lntvow/utils 4.2.15 → 4.3.1
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/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
> TypeScript Utilities Collection
|
|
18
18
|
|
|
19
|
-
[](https://www.npmjs.com/package/@lntvow/utils)
|
|
20
|
-
[](https://www.npmjs.com/package/@lntvow/utils)
|
|
21
|
-
[](https://www.typescriptlang.org/)
|
|
22
19
|
[](https://codecov.io/github/lntvow/utils)
|
|
20
|
+
[](https://www.npmjs.com/package/@lntvow/utils)
|
|
21
|
+
[](https://www.npmjs.com/package/@lntvow/utils)
|
|
22
|
+
[](https://www.typescriptlang.org/)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var xe=Object.create;var U=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Ae=(e,t)=>{for(var r in t)U(e,r,{get:t[r],enumerable:!0})},me=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of we(t))!Re.call(e,o)&&o!==r&&U(e,o,{get:()=>t[o],enumerable:!(n=he(t,o))||n.enumerable});return e};var B=(e,t,r)=>(r=e!=null?xe(Oe(e)):{},me(t||!e||!e.__esModule?U(r,"default",{value:e,enumerable:!0}):r,e)),Se=e=>me(U({},"__esModule",{value:!0}),e);var wt={};Ae(wt,{UtilsError:()=>L,base64Decode:()=>Me,base64Encode:()=>De,castArray:()=>N,compose:()=>Ne,composeRight:()=>Pe,debounce:()=>ke,debugWarn:()=>Ye,decimalToBinary:()=>Ee,deepClone:()=>I,deepMerge:()=>Ie,generateRandomArray:()=>st,generateRandomColor:()=>mt,generateRandomDate:()=>G,generateRandomEmail:()=>ye,generateRandomFloat:()=>bt,generateRandomIdCard:()=>yt,generateRandomMobilePhone:()=>xt,generateRandomStringFromSource:()=>v,getRandomInt:()=>p,getRandomItem:()=>w,getRandomString:()=>R,getRandomUrl:()=>ht,hasChanged:()=>Te,hasCircularReference:()=>re,isArray:()=>d,isBoolean:()=>x,isDate:()=>J,isDateString:()=>ie,isDef:()=>je,isEmail:()=>tt,isEmptyString:()=>rt,isFloat:()=>Ge,isFunction:()=>_,isIdCard:()=>nt,isInteger:()=>Xe,isMap:()=>Q,isMobilePhone:()=>ot,isNegativeFloat:()=>qe,isNegativeInteger:()=>Ze,isNil:()=>te,isNonNegativeFloat:()=>ze,isNonNegativeInteger:()=>oe,isNonPositiveFloat:()=>Qe,isNonPositiveInteger:()=>et,isNull:()=>H,isNumber:()=>y,isObject:()=>j,isObjectLike:()=>K,isPlainObject:()=>h,isPositiveFloat:()=>ve,isPositiveInteger:()=>Je,isPromise:()=>ee,isRegExp:()=>Z,isSet:()=>X,isString:()=>T,isStringNumber:()=>it,isSymbol:()=>q,isURL:()=>at,isUndef:()=>c,objectToString:()=>fe,omit:()=>We,pick:()=>ne,qs:()=>le,qsStringify:()=>Ke,throttle:()=>Le,throwError:()=>a,toTypeString:()=>M,toTypeValue:()=>$e,withRetry:()=>Ue});module.exports=Se(wt);function j(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function K(e){return e!==null&&typeof e=="object"}var fe=Object.prototype.toString,M=e=>fe.call(e),$e=e=>M(e).slice(8,-1),T=e=>typeof e=="string",y=e=>typeof e=="number"&&Number.isFinite(e),x=e=>typeof e=="boolean",H=e=>e===null,c=e=>e===void 0,q=e=>typeof e=="symbol",d=Array.isArray,_=e=>typeof e=="function",Q=e=>M(e)==="[object Map]",X=e=>M(e)==="[object Set]",J=e=>M(e)==="[object Date]",Z=e=>M(e)==="[object RegExp]",ee=e=>K(e)&&_(e?.then)&&_(e?.catch),te=e=>e==null,je=e=>e!=null,Te=(e,t)=>e!==t;function h(e){return M(e)==="[object Object]"}function N(e){return d(e)?e:[e]}function Ee(e){let t=[],r,n="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)n+=t.pop().toString();return n}var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function De(e){let t="",r="";for(let o=0;o<e.length;o++)r+=e[o].charCodeAt(0).toString(2).padStart(8,"0");for(let o=0;o<r.length;o+=6)t+=ce[Number.parseInt(r.slice(o,o+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function Me(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=ce.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let o=Number.parseInt(r.slice(n,n+8),2);o&&(t+=String.fromCharCode(o))}return t}function Ne(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function Pe(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function ke(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function I(e){let t=new WeakMap;function r(n){if(!K(n))return n;if(J(n))return new Date(n);if(Z(n))return new RegExp(n);if(ee(n))return n;if(t.has(n))return t.get(n);if(Q(n)){let s=new Map;return t.set(n,s),n.forEach((u,g)=>s.set(r(g),r(u))),s}if(X(n)){let s=new Set;return t.set(n,s),n.forEach(u=>s.add(r(u))),s}let o=d(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let f=Object.getOwnPropertyDescriptors(n);for(let s of Reflect.ownKeys(f)){let u=f[s];u.get||u.set?Object.defineProperty(o,s,u):Object.defineProperty(o,s,{...u,value:r(u.value)})}return o}return r(e)}function Ie(e,t,r={}){return pe(ue(e,r),ue(t,r),r)}function pe(e,t,r){return d(e)?Fe(e,t,r):Ce(e,t,r)}function Ce(e,t,r){if(!h(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(h(e[o])||d(e[o]))&&(h(t[o])||d(t[o]))?e[o]=pe(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function Fe(e,t,r){let{mergeStrategy:n="replace"}=r;if(d(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function ue(e,t){let{deepClone:r=!0}=t;return r?I(e):e}var L=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function a(e,t){throw new L(`[${e}] ${t}`)}function Ye(e,t){let r=T(e)?new L(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var V=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},W=(e,...t)=>{V("info",e,...t)};W.info=(e,...t)=>{V("info",e,...t)};W.error=(e,...t)=>{V("error",e,...t)};W.warn=(e,...t)=>{V("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=W);function Ke(e,t={}){_e(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:o="indices",encodeDotInKeys:f=!1,skipNulls:s=!1,strictNullHandling:u=!1,commaRoundTrip:g=!1,allowEmptyArrays:P=!1,addQueryPrefix:A=!1,delimiter:k="&"}=t,O=t.allowDots??!1;f&&c(t.allowDots)&&(O=!0);let b=[],$=m=>r&&!n?encodeURIComponent(m):m,F=m=>r?encodeURIComponent(m):m;function Y(m,l){if(!c(l)){if(H(l)){if(s)return;b.push(`${$(m)}${u?"":"="}`);return}if(d(l)){if(l.length===0){P&&b.push(`${$(m)}[]`);return}if(o==="comma"){let E=n?l.map(F).join(","):F(l.join(","));if(l.length===1&&H(l[0])){if(s)return;b.push(`${$(m)}${g?"[]":""}${u?"":"="}`)}else l.length===1?b.push(`${$(m)}${g?"[]":""}=${E}`):b.push(`${$(m)}=${E}`);return}l.forEach((E,C)=>{let D=m;o==="indices"?D=`${m}[${C}]`:o==="brackets"&&(D=`${m}[]`),Y(D,E)});return}if(j(l)){Object.keys(l).forEach(E=>{let C=m;f&&(C=C.replace(/\./g,"%2E"));let D=E;O?(f&&(D=D.replace(/\./g,"%2E")),Y(`${C}.${D}`,l[E])):Y(`${C}[${D}]`,l[E])});return}b.push(`${$(m)}=${F(l)}`)}}if(!j(e))return"";re(e)&&a("stringify","Input object contains circular references, cannot stringify"),d(e)?e.forEach((m,l)=>Y(`${l}`,m)):Object.keys(e).forEach(m=>Y(m,e[m]));let z=b.join(k);return A&&z?`?${z}`:z}function _e(e={}){h(e)||a("stringify",'"options" must be a plain object'),!c(e.encode)&&!x(e.encode)&&a("stringify",'"encode" must be a boolean'),!c(e.encodeValuesOnly)&&!x(e.encodeValuesOnly)&&a("stringify",'"encodeValuesOnly" must be a boolean'),!c(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&a("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!c(e.allowDots)&&!x(e.allowDots)&&a("stringify",'"allowDots" must be a boolean'),!c(e.skipNulls)&&!x(e.skipNulls)&&a("stringify",'"skipNulls" must be a boolean'),!c(e.strictNullHandling)&&!x(e.strictNullHandling)&&a("stringify",'"strictNullHandling" must be a boolean'),!c(e.addQueryPrefix)&&!x(e.addQueryPrefix)&&a("stringify",'"addQueryPrefix" must be a boolean'),!c(e.delimiter)&&!T(e.delimiter)&&a("stringify",'"delimiter" must be a string'),!c(e.encodeDotInKeys)&&!x(e.encodeDotInKeys)&&a("stringify",'"encodeDotInKeys" must be a boolean'),!c(e.commaRoundTrip)&&!x(e.commaRoundTrip)&&a("stringify",'"commaRoundTrip" must be a boolean'),!c(e.allowEmptyArrays)&&!x(e.allowEmptyArrays)&&a("stringify",'"allowEmptyArrays" must be a boolean')}var le={stringify:e=>(j(e)||a("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(T(e)||a("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=le.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Le(e,t=500){let r=null;return function(...n){if(te(r))return r=Date.now(),e.apply(this,n);let o=Date.now();if(o-r>=t)return r=o,e.apply(this,n)}}function Ue(e){Be(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:f}=e,s,u=f?new Promise((P,A)=>{let k=()=>A(ge());f.addEventListener("abort",k),s=()=>f.removeEventListener("abort",k)}):null;return new Promise((P,A)=>{(async()=>{for(let O=1;O<=r;O++){if(f?.aborted)return A(ge());try{let b=await Promise.race(u?[t(),u]:[t()]);return P(b)}catch(b){let $=o?n*2**(O-1):n;if(log("withRetry",`Attempt ${O}/${r} failed. Retrying in ${$}ms...`),b instanceof Error&&b.name==="AbortError"||O===r)return A(b);await new Promise(F=>setTimeout(F,$))}}})()}).finally(()=>s?.())}function Be(e){h(e)||a("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&a("withRetry",'"fn" must be a function that returns a Promise'),!c(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&a("withRetry",'"maxAttempts" must be a positive integer'),!c(e.retryDelay)&&(!y(e.retryDelay)||e.retryDelay<0)&&a("withRetry",'"retryDelay" must be a non-negative number'),!c(e.enableExponentialBackoff)&&!x(e.enableExponentialBackoff)&&a("withRetry",'"enableExponentialBackoff" must be a boolean'),!c(e.signal)&&typeof e.signal!="object"&&a("withRetry",'"signal" must be an AbortSignal')}var He="The operation was aborted";function ge(e=He){let t=new Error(e);return t.name="AbortError",t}function re(e){j(e)||a("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if(j(n)){if(t.has(n))return!0;t.add(n);for(let o of Object.keys(n))if(r(n[o]))return!0;t.delete(n)}return!1}return r(e)}function ne(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:f=!1}=r,s={};return h(e)&&N(t).forEach(g=>{q(g)&&!o||!(n?g in e:Object.hasOwn(e,g))||!f&&(n?Ve(e,g):Object.getOwnPropertyDescriptor(e,g))?.enumerable===!1||(s[g]=I(e[g]))}),s}function Ve(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function We(e,t){if(!h(e))return{};let r=I(e),n=N(t),o=Object.keys(r).filter(f=>!n.includes(f));return ne(r,o)}function Ge(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function ve(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function ze(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function qe(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Qe(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Xe(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Je(e){return/^[1-9]\d*$/.test(e)}function oe(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Ze(e){return/^-[1-9]\d*$/.test(e)}function et(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var de=B(require("dayjs"),1);function ie(e,t="YYYY-MM-DD HH:mm:ss"){return(0,de.default)(e,t,!0).isValid()}function tt(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function rt(e){return e===""}var ae=B(require("dayjs"),1);function nt(e){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(e))return!1;let r=e.slice(6,14);return ie(r,"YYYYMMDD")&&(0,ae.default)(r,"YYYYMMDD").isBefore((0,ae.default)())}function ot(e){return/^1[3-9]\d{9}$/.test(e)}var it=e=>{if(!T(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function at(e){return/^https?:\/\/\S+$/i.test(e)}function st(e,t){return(!y(e)||!oe(e.toString()))&&a("generateRandomArray","num must be greater than 0"),_(t)||a("generateRandomArray","cb must be a function"),Array.from({length:e},()=>t())}function mt(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}var S=B(require("dayjs"),1),be=B(require("dayjs/plugin/customParseFormat.js"),1);function w(e){return e[Math.floor(Math.random()*e.length)]}function p(e={}){y(e)&&(e={max:e});let{min:t=1,max:r=w(ct())}=e;ft(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function ft(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||a("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||a("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&a("getRandomInt",`No integer value found between ${e} and ${t}`),a("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function ct(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}S.default.extend(be.default);function G(e={}){let{start:t="1800-01-01 00:00:00",end:r=(0,S.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!(0,S.default)(t).isValid()||!(0,S.default)(r).isValid())&&a("generateRandomDate","start and end parameters must be valid date format");let o=(0,S.default)(t).year(),f=(0,S.default)(r).year(),s=p({min:o,max:f}),u=p({min:1,max:12}),g=p({min:1,max:31}),P=p(23),A=p(59),k=p(59),O=(0,S.default)(`${s}-${u}-${g} ${P}:${A}:${k}`);return O.isBefore((0,S.default)(t))||O.isAfter((0,S.default)(r))?G(e):O.format(n)}function R(e={}){let t=pt(e),r=lt(t);gt(r);let{length:n}=t;dt(n.min,n.max);let o=p(n),f=t.prefix||"";for(let s=0;s<o;s++)f+=r.charAt(Math.floor(Math.random()*r.length));return f+(t.suffix||"")}var ut=16,se=1;function pt(e){let t=y(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:y(e.length)?{max:e.length,min:e.length}:{max:ut,min:se,...e.length},extra:t?[]:[...new Set(N(e.extra||[]))]}}function lt(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=N(e.extra).join(""),t}function gt(e){e.length===0&&a("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function dt(e,t){Number.isInteger(e)||a("getRandomString","min must be an integer"),Number.isInteger(t)||a("getRandomString","max must be an integer"),e<se&&a("getRandomString",`Minimum length cannot be less than ${se}`),t<e&&a("getRandomString","Maximum length cannot be less than minimum length")}function ye(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${R(1)}${R({length:p({max:30,min:1})})}${R(1)}@${w(e)}`;return/\.{2,}/.test(t)?ye():t}function bt(e={}){y(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if(t===r)return t;if(t>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${t}`);let o=Math.random()*(r-t)+t;return Number(o.toFixed(n))}function v(e,t){(!y(e)||e<=0)&&a("generateRandomStringFromSource","num must be greater than 0"),(!d(t)||t.length===0)&&a("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<e;n++)r+=w(t);return r}function yt(){let e=p({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,G({format:"YYYYMMDD"}),v(3,t),v(1,[...t,"X","x"])].join("")}function xt(){return w(["13","14","15","16","17","18","19"])+p(999999999).toString().padEnd(9,"0")}function ht(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${R({length:{min:4,max:8}})}`,`?id=${p()}`,`?page=${R({length:{min:2,max:4}})}`,`?query=${R({length:{min:5,max:6}})}`,`?search=${R({length:{min:1,max:4}})}`,`?token=${R({length:{min:16,max:16}})}`];return`${w(e)}${R({length:{min:5,max:25}})}${w(t)}${w(r)}`}0&&(module.exports={UtilsError,base64Decode,base64Encode,castArray,compose,composeRight,debounce,debugWarn,decimalToBinary,deepClone,deepMerge,generateRandomArray,generateRandomColor,generateRandomDate,generateRandomEmail,generateRandomFloat,generateRandomIdCard,generateRandomMobilePhone,generateRandomStringFromSource,getRandomInt,getRandomItem,getRandomString,getRandomUrl,hasChanged,hasCircularReference,isArray,isBoolean,isDate,isDateString,isDef,isEmail,isEmptyString,isFloat,isFunction,isIdCard,isInteger,isMap,isMobilePhone,isNegativeFloat,isNegativeInteger,isNil,isNonNegativeFloat,isNonNegativeInteger,isNonPositiveFloat,isNonPositiveInteger,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPositiveFloat,isPositiveInteger,isPromise,isRegExp,isSet,isString,isStringNumber,isSymbol,isURL,isUndef,objectToString,omit,pick,qs,qsStringify,throttle,throwError,toTypeString,toTypeValue,withRetry});
|
|
1
|
+
"use strict";var xe=Object.create;var U=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Ae=(e,t)=>{for(var r in t)U(e,r,{get:t[r],enumerable:!0})},me=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Oe(t))!Re.call(e,o)&&o!==r&&U(e,o,{get:()=>t[o],enumerable:!(n=he(t,o))||n.enumerable});return e};var B=(e,t,r)=>(r=e!=null?xe(we(e)):{},me(t||!e||!e.__esModule?U(r,"default",{value:e,enumerable:!0}):r,e)),Te=e=>me(U({},"__esModule",{value:!0}),e);var wt={};Ae(wt,{UtilsError:()=>L,base64Decode:()=>Ne,base64Encode:()=>De,castArray:()=>N,compose:()=>Me,composeRight:()=>Pe,debounce:()=>Ie,debugWarn:()=>_e,decimalToBinary:()=>$e,deepClone:()=>M,deepMerge:()=>ke,generateRandomArray:()=>st,generateRandomColor:()=>mt,generateRandomDate:()=>ae,generateRandomEmail:()=>bt,generateRandomFloat:()=>yt,generateRandomIdCard:()=>xt,generateRandomMobilePhone:()=>ht,generateRandomStringFromSource:()=>G,getRandomInt:()=>O,getRandomItem:()=>h,getRandomString:()=>w,getRandomUrl:()=>Ot,hasChanged:()=>Ee,hasCircularReference:()=>te,isArray:()=>d,isBoolean:()=>y,isDate:()=>X,isDateString:()=>oe,isDef:()=>je,isEmail:()=>tt,isEmptyString:()=>rt,isFloat:()=>Ge,isFunction:()=>Y,isIdCard:()=>nt,isInteger:()=>Xe,isMap:()=>q,isMobilePhone:()=>ot,isNegativeFloat:()=>qe,isNegativeInteger:()=>Ze,isNil:()=>ee,isNonNegativeFloat:()=>ze,isNonNegativeInteger:()=>ne,isNonPositiveFloat:()=>Qe,isNonPositiveInteger:()=>et,isNull:()=>V,isNumber:()=>l,isObject:()=>A,isObjectLike:()=>K,isPlainObject:()=>x,isPositiveFloat:()=>ve,isPositiveInteger:()=>Je,isPromise:()=>Z,isRegExp:()=>J,isSet:()=>Q,isString:()=>T,isStringNumber:()=>it,isSymbol:()=>z,isURL:()=>at,isUndef:()=>c,objectToString:()=>fe,omit:()=>We,pick:()=>re,qs:()=>le,qsStringify:()=>Ke,throttle:()=>Le,throwError:()=>i,toTypeString:()=>D,toTypeValue:()=>Se,withRetry:()=>Ue});module.exports=Te(wt);function A(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function K(e){return e!==null&&typeof e=="object"}var fe=Object.prototype.toString,D=e=>fe.call(e),Se=e=>D(e).slice(8,-1),T=e=>typeof e=="string",l=e=>typeof e=="number"&&Number.isFinite(e),y=e=>typeof e=="boolean",V=e=>e===null,c=e=>e===void 0,z=e=>typeof e=="symbol",d=Array.isArray,Y=e=>typeof e=="function",q=e=>D(e)==="[object Map]",Q=e=>D(e)==="[object Set]",X=e=>D(e)==="[object Date]",J=e=>D(e)==="[object RegExp]",Z=e=>K(e)&&Y(e?.then)&&Y(e?.catch),ee=e=>e==null,je=e=>e!=null,Ee=(e,t)=>e!==t;function x(e){return D(e)==="[object Object]"}function N(e){return d(e)?e:[e]}function $e(e){let t=[],r,n="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)n+=t.pop().toString();return n}var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function De(e){let t="",r="";for(let o=0;o<e.length;o++)r+=e[o].charCodeAt(0).toString(2).padStart(8,"0");for(let o=0;o<r.length;o+=6)t+=ce[Number.parseInt(r.slice(o,o+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function Ne(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=ce.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let o=Number.parseInt(r.slice(n,n+8),2);o&&(t+=String.fromCharCode(o))}return t}function Me(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function Pe(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function Ie(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function M(e){let t=new WeakMap;function r(n){if(!K(n))return n;if(X(n))return new Date(n);if(J(n))return new RegExp(n);if(Z(n))return n;if(t.has(n))return t.get(n);if(q(n)){let s=new Map;return t.set(n,s),n.forEach((u,g)=>s.set(r(g),r(u))),s}if(Q(n)){let s=new Set;return t.set(n,s),n.forEach(u=>s.add(r(u))),s}let o=d(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let m=Object.getOwnPropertyDescriptors(n);for(let s of Reflect.ownKeys(m)){let u=m[s];u.get||u.set?Object.defineProperty(o,s,u):Object.defineProperty(o,s,{...u,value:r(u.value)})}return o}return r(e)}function ke(e,t,r={}){return pe(ue(e,r),ue(t,r),r)}function pe(e,t,r){return d(e)?Ce(e,t,r):Fe(e,t,r)}function Fe(e,t,r){if(!x(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(x(e[o])||d(e[o]))&&(x(t[o])||d(t[o]))?e[o]=pe(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function Ce(e,t,r){let{mergeStrategy:n="replace"}=r;if(d(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function ue(e,t){let{deepClone:r=!0}=t;return r?M(e):e}var L=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function i(e,t){throw new L(`[${e}] ${t}`)}function _e(e,t){let r=T(e)?new L(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var H=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},W=(e,...t)=>{H("info",e,...t)};W.info=(e,...t)=>{H("info",e,...t)};W.error=(e,...t)=>{H("error",e,...t)};W.warn=(e,...t)=>{H("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=W);function Ke(e,t={}){Ye(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:o="indices",encodeDotInKeys:m=!1,skipNulls:s=!1,strictNullHandling:u=!1,commaRoundTrip:g=!1,allowEmptyArrays:k=!1,addQueryPrefix:S=!1,delimiter:F="&"}=t,j=t.allowDots??!1;m&&c(t.allowDots)&&(j=!0);let b=[],R=f=>r&&!n?encodeURIComponent(f):f,C=f=>r?encodeURIComponent(f):f;function _(f,p){if(!c(p)){if(V(p)){if(s)return;b.push(`${R(f)}${u?"":"="}`);return}if(d(p)){if(p.length===0){k&&b.push(`${R(f)}[]`);return}if(o==="comma"){let E=n?p.map(C).join(","):C(p.join(","));if(p.length===1&&V(p[0])){if(s)return;b.push(`${R(f)}${g?"[]":""}${u?"":"="}`)}else p.length===1?b.push(`${R(f)}${g?"[]":""}=${E}`):b.push(`${R(f)}=${E}`);return}p.forEach((E,P)=>{let $=f;o==="indices"?$=`${f}[${P}]`:o==="brackets"&&($=`${f}[]`),_($,E)});return}if(A(p)){Object.keys(p).forEach(E=>{let P=f;m&&(P=P.replace(/\./g,"%2E"));let $=E;j?(m&&($=$.replace(/\./g,"%2E")),_(`${P}.${$}`,p[E])):_(`${P}[${$}]`,p[E])});return}b.push(`${R(f)}=${C(p)}`)}}if(!A(e))return"";te(e)&&i("stringify","Input object contains circular references, cannot stringify"),d(e)?e.forEach((f,p)=>_(`${p}`,f)):Object.keys(e).forEach(f=>_(f,e[f]));let v=b.join(F);return S&&v?`?${v}`:v}function Ye(e={}){x(e)||i("stringify",'"options" must be a plain object'),!c(e.encode)&&!y(e.encode)&&i("stringify",'"encode" must be a boolean'),!c(e.encodeValuesOnly)&&!y(e.encodeValuesOnly)&&i("stringify",'"encodeValuesOnly" must be a boolean'),!c(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&i("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!c(e.allowDots)&&!y(e.allowDots)&&i("stringify",'"allowDots" must be a boolean'),!c(e.skipNulls)&&!y(e.skipNulls)&&i("stringify",'"skipNulls" must be a boolean'),!c(e.strictNullHandling)&&!y(e.strictNullHandling)&&i("stringify",'"strictNullHandling" must be a boolean'),!c(e.addQueryPrefix)&&!y(e.addQueryPrefix)&&i("stringify",'"addQueryPrefix" must be a boolean'),!c(e.delimiter)&&!T(e.delimiter)&&i("stringify",'"delimiter" must be a string'),!c(e.encodeDotInKeys)&&!y(e.encodeDotInKeys)&&i("stringify",'"encodeDotInKeys" must be a boolean'),!c(e.commaRoundTrip)&&!y(e.commaRoundTrip)&&i("stringify",'"commaRoundTrip" must be a boolean'),!c(e.allowEmptyArrays)&&!y(e.allowEmptyArrays)&&i("stringify",'"allowEmptyArrays" must be a boolean')}var le={stringify:e=>(A(e)||i("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(T(e)||i("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=le.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Le(e,t=500){let r=null;return function(...n){if(ee(r))return r=Date.now(),e.apply(this,n);let o=Date.now();if(o-r>=t)return r=o,e.apply(this,n)}}function Ue(e){Be(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:m}=e,s,u=m?new Promise((k,S)=>{let F=()=>S(ge());m.addEventListener("abort",F),s=()=>m.removeEventListener("abort",F)}):null;return new Promise((k,S)=>{(async()=>{for(let j=1;j<=r;j++){if(m?.aborted)return S(ge());try{let b=await Promise.race(u?[t(),u]:[t()]);return k(b)}catch(b){let R=o?n*2**(j-1):n;if(log("withRetry",`Attempt ${j}/${r} failed. Retrying in ${R}ms...`),b instanceof Error&&b.name==="AbortError"||j===r)return S(b);await new Promise(C=>setTimeout(C,R))}}})()}).finally(()=>s?.())}function Be(e){x(e)||i("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&i("withRetry",'"fn" must be a function that returns a Promise'),!c(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&i("withRetry",'"maxAttempts" must be a positive integer'),!c(e.retryDelay)&&(!l(e.retryDelay)||e.retryDelay<0)&&i("withRetry",'"retryDelay" must be a non-negative number'),!c(e.enableExponentialBackoff)&&!y(e.enableExponentialBackoff)&&i("withRetry",'"enableExponentialBackoff" must be a boolean'),!c(e.signal)&&typeof e.signal!="object"&&i("withRetry",'"signal" must be an AbortSignal')}var Ve="The operation was aborted";function ge(e=Ve){let t=new Error(e);return t.name="AbortError",t}function te(e){A(e)||i("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if(A(n)){if(t.has(n))return!0;t.add(n);for(let o of Object.keys(n))if(r(n[o]))return!0;t.delete(n)}return!1}return r(e)}function re(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:m=!1}=r,s={};return x(e)&&N(t).forEach(g=>{z(g)&&!o||!(n?g in e:Object.hasOwn(e,g))||!m&&(n?He(e,g):Object.getOwnPropertyDescriptor(e,g))?.enumerable===!1||(s[g]=M(e[g]))}),s}function He(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function We(e,t){if(!x(e))return{};let r=M(e),n=N(t),o=Object.keys(r).filter(m=>!n.includes(m));return re(r,o)}function Ge(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function ve(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function ze(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function qe(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Qe(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Xe(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Je(e){return/^[1-9]\d*$/.test(e)}function ne(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Ze(e){return/^-[1-9]\d*$/.test(e)}function et(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var de=B(require("dayjs"),1);function oe(e,t="YYYY-MM-DD HH:mm:ss"){return(0,de.default)(e,t,!0).isValid()}function tt(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function rt(e){return e===""}var ie=B(require("dayjs"),1);function nt(e){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(e))return!1;let r=e.slice(6,14);return oe(r,"YYYYMMDD")&&(0,ie.default)(r,"YYYYMMDD").isBefore((0,ie.default)())}function ot(e){return/^1[3-9]\d{9}$/.test(e)}var it=e=>{if(!T(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function at(e){return/^https?:\/\/\S+$/i.test(e)}function st(e,t){return(!l(e)||!ne(e.toString()))&&i("generateRandomArray","num must be greater than 0"),Y(t)||i("generateRandomArray","cb must be a function"),Array.from({length:e},()=>t())}function mt(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}var I=B(require("dayjs"),1),ye=B(require("dayjs/plugin/customParseFormat.js"),1);function h(e){return e[Math.floor(Math.random()*e.length)]}function O(e={}){l(e)&&(e={max:e});let{min:t=1,max:r=h(ct())}=e;ft(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function ft(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||i("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||i("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&i("getRandomInt",`No integer value found between ${e} and ${t}`),i("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function ct(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}I.default.extend(ye.default);function ae(e={}){let{start:t="1800-01-01 00:00:00",end:r=(0,I.default)().format(be),format:n=be}=e,o=(0,I.default)(t),m=(0,I.default)(r);(!o.isValid()||!m.isValid())&&i("generateRandomDate","start and end parameters must be valid date format"),o.isAfter(m)&&i("generateRandomDate","start date must be before end date");let s=o.valueOf(),u=m.valueOf(),g=O({min:s,max:u});return(0,I.default)(g).format(n)}var be="YYYY-MM-DD HH:mm:ss";function w(e={}){let t=pt(e),r=lt(t);gt(r);let{length:n}=t;dt(n.min,n.max);let o=O(n),m=t.prefix||"";for(let s=0;s<o;s++)m+=r.charAt(Math.floor(Math.random()*r.length));return m+(t.suffix||"")}var ut=16,se=1;function pt(e){let t=l(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:l(e.length)?{max:e.length,min:e.length}:{max:ut,min:se,...e.length},extra:t?[]:[...new Set(N(e.extra||[]))]}}function lt(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=N(e.extra).join(""),t}function gt(e){e.length===0&&i("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function dt(e,t){Number.isInteger(e)||i("getRandomString","min must be an integer"),Number.isInteger(t)||i("getRandomString","max must be an integer"),e<se&&i("getRandomString",`Minimum length cannot be less than ${se}`),t<e&&i("getRandomString","Maximum length cannot be less than minimum length")}function bt(){let e=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],t=O({min:5,max:10}),r=w({length:t,lowerCase:!0,upperCase:!1,number:!0}),n=h(e);return`${r}@${n}`}function yt(e={}){l(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if((!l(t)||!l(r))&&i("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(n)||n<0)&&i("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),t===r)return Number(t.toFixed(n));t>r&&i("generateRandomFloat",`"max" (${r}) must be greater than "min" (${t})`);let o=Math.random()*(r-t)+t;return Number(o.toFixed(n))}function G(e,t){(!l(e)||e<=0)&&i("generateRandomStringFromSource",'"num" must be greater than 0'),(!d(t)||t.length===0)&&i("generateRandomStringFromSource",'"source" must be a non-empty array');let r="";for(let n=0;n<e;n++)r+=h(t);return r}function xt(){let e=O({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,ae({format:"YYYYMMDD"}),G(3,t),G(1,[...t,"X","x"])].join("")}function ht(){return h(["13","14","15","16","17","18","19"])+O(999999999).toString().padEnd(9,"0")}function Ot(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${w({length:{min:4,max:8}})}`,`?id=${O()}`,`?page=${w({length:{min:2,max:4}})}`,`?query=${w({length:{min:5,max:6}})}`,`?search=${w({length:{min:1,max:4}})}`,`?token=${w({length:{min:16,max:16}})}`];return`${h(e)}${w({length:{min:5,max:25}})}${h(t)}${h(r)}`}0&&(module.exports={UtilsError,base64Decode,base64Encode,castArray,compose,composeRight,debounce,debugWarn,decimalToBinary,deepClone,deepMerge,generateRandomArray,generateRandomColor,generateRandomDate,generateRandomEmail,generateRandomFloat,generateRandomIdCard,generateRandomMobilePhone,generateRandomStringFromSource,getRandomInt,getRandomItem,getRandomString,getRandomUrl,hasChanged,hasCircularReference,isArray,isBoolean,isDate,isDateString,isDef,isEmail,isEmptyString,isFloat,isFunction,isIdCard,isInteger,isMap,isMobilePhone,isNegativeFloat,isNegativeInteger,isNil,isNonNegativeFloat,isNonNegativeInteger,isNonPositiveFloat,isNonPositiveInteger,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPositiveFloat,isPositiveInteger,isPromise,isRegExp,isSet,isString,isStringNumber,isSymbol,isURL,isUndef,objectToString,omit,pick,qs,qsStringify,throttle,throwError,toTypeString,toTypeValue,withRetry});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var te=Object.create;var Nt=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var ie=(t,e)=>()=>(t&&(e=t(t=0)),e);var Pt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var se=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of re(e))!oe.call(t,s)&&s!==r&&Nt(t,s,{get:()=>e[s],enumerable:!(o=ee(e,s))||o.enumerable});return t};var dt=(t,e,r)=>(r=t!=null?te(ne(t)):{},se(e||!t||!t.__esModule?Nt(r,"default",{value:t,enumerable:!0}):r,t));import Ae from"path";import{fileURLToPath as Re}from"url";var n=ie(()=>{"use strict"});var $t=Pt((At,Tt)=>{"use strict";n();(function(t,e){typeof At=="object"&&typeof Tt<"u"?Tt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(At,function(){"use strict";var t=1e3,e=6e4,r=36e5,o="millisecond",s="second",M="minute",y="hour",S="day",x="week",v="month",L="quarter",P="year",N="date",I="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,A={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(c){var a=["th","st","nd","rd"],i=c%100;return"["+c+(a[(i-20)%10]||a[i]||a[0])+"]"}},T=function(c,a,i){var u=String(c);return!u||u.length>=a?c:""+Array(a+1-u.length).join(i)+c},O={s:T,z:function(c){var a=-c.utcOffset(),i=Math.abs(a),u=Math.floor(i/60),f=i%60;return(a<=0?"+":"-")+T(u,2,"0")+":"+T(f,2,"0")},m:function c(a,i){if(a.date()<i.date())return-c(i,a);var u=12*(i.year()-a.year())+(i.month()-a.month()),f=a.clone().add(u,v),d=i-f<0,g=a.clone().add(u+(d?-1:1),v);return+(-(u+(i-f)/(d?f-g:g-f))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:v,y:P,w:x,d:S,D:N,h:y,m:M,s,ms:o,Q:L}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return c===void 0}},D="en",k={};k[D]=A;var F="$isDayjsObject",Y=function(c){return c instanceof K||!(!c||!c[F])},W=function c(a,i,u){var f;if(!a)return D;if(typeof a=="string"){var d=a.toLowerCase();k[d]&&(f=d),i&&(k[d]=i,f=d);var g=a.split("-");if(!f&&g.length>1)return c(g[0])}else{var b=a.name;k[b]=a,f=b}return!u&&f&&(D=f),f||!u&&D},R=function(c,a){if(Y(c))return c.clone();var i=typeof a=="object"?a:{};return i.date=c,i.args=arguments,new K(i)},$=O;$.l=W,$.i=Y,$.w=function(c,a){return R(c,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var K=function(){function c(i){this.$L=W(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[F]=!0}var a=c.prototype;return a.parse=function(i){this.$d=function(u){var f=u.date,d=u.utc;if(f===null)return new Date(NaN);if($.u(f))return new Date;if(f instanceof Date)return new Date(f);if(typeof f=="string"&&!/Z$/i.test(f)){var g=f.match(m);if(g){var b=g[2]-1||0,j=(g[7]||"0").substring(0,3);return d?new Date(Date.UTC(g[1],b,g[3]||1,g[4]||0,g[5]||0,g[6]||0,j)):new Date(g[1],b,g[3]||1,g[4]||0,g[5]||0,g[6]||0,j)}}return new Date(f)}(i),this.init()},a.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},a.$utils=function(){return $},a.isValid=function(){return this.$d.toString()!==I},a.isSame=function(i,u){var f=R(i);return this.startOf(u)<=f&&f<=this.endOf(u)},a.isAfter=function(i,u){return R(i)<this.startOf(u)},a.isBefore=function(i,u){return this.endOf(u)<R(i)},a.$g=function(i,u,f){return $.u(i)?this[u]:this.set(f,i)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(i,u){var f=this,d=!!$.u(u)||u,g=$.p(i),b=function(tt,H){var G=$.w(f.$u?Date.UTC(f.$y,H,tt):new Date(f.$y,H,tt),f);return d?G:G.endOf(S)},j=function(tt,H){return $.w(f.toDate()[tt].apply(f.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(H)),f)},E=this.$W,C=this.$M,B=this.$D,ot="set"+(this.$u?"UTC":"");switch(g){case P:return d?b(1,0):b(31,11);case v:return d?b(1,C):b(0,C+1);case x:var rt=this.$locale().weekStart||0,ft=(E<rt?E+7:E)-rt;return b(d?B-ft:B+(6-ft),C);case S:case N:return j(ot+"Hours",0);case y:return j(ot+"Minutes",1);case M:return j(ot+"Seconds",2);case s:return j(ot+"Milliseconds",3);default:return this.clone()}},a.endOf=function(i){return this.startOf(i,!1)},a.$set=function(i,u){var f,d=$.p(i),g="set"+(this.$u?"UTC":""),b=(f={},f[S]=g+"Date",f[N]=g+"Date",f[v]=g+"Month",f[P]=g+"FullYear",f[y]=g+"Hours",f[M]=g+"Minutes",f[s]=g+"Seconds",f[o]=g+"Milliseconds",f)[d],j=d===S?this.$D+(u-this.$W):u;if(d===v||d===P){var E=this.clone().set(N,1);E.$d[b](j),E.init(),this.$d=E.set(N,Math.min(this.$D,E.daysInMonth())).$d}else b&&this.$d[b](j);return this.init(),this},a.set=function(i,u){return this.clone().$set(i,u)},a.get=function(i){return this[$.p(i)]()},a.add=function(i,u){var f,d=this;i=Number(i);var g=$.p(u),b=function(C){var B=R(d);return $.w(B.date(B.date()+Math.round(C*i)),d)};if(g===v)return this.set(v,this.$M+i);if(g===P)return this.set(P,this.$y+i);if(g===S)return b(1);if(g===x)return b(7);var j=(f={},f[M]=e,f[y]=r,f[s]=t,f)[g]||1,E=this.$d.getTime()+i*j;return $.w(E,this)},a.subtract=function(i,u){return this.add(-1*i,u)},a.format=function(i){var u=this,f=this.$locale();if(!this.isValid())return f.invalidDate||I;var d=i||"YYYY-MM-DDTHH:mm:ssZ",g=$.z(this),b=this.$H,j=this.$m,E=this.$M,C=f.weekdays,B=f.months,ot=f.meridiem,rt=function(H,G,nt,it){return H&&(H[G]||H(u,d))||nt[G].slice(0,it)},ft=function(H){return $.s(b%12||12,H,"0")},tt=ot||function(H,G,nt){var it=H<12?"AM":"PM";return nt?it.toLowerCase():it};return d.replace(w,function(H,G){return G||function(nt){switch(nt){case"YY":return String(u.$y).slice(-2);case"YYYY":return $.s(u.$y,4,"0");case"M":return E+1;case"MM":return $.s(E+1,2,"0");case"MMM":return rt(f.monthsShort,E,B,3);case"MMMM":return rt(B,E);case"D":return u.$D;case"DD":return $.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return rt(f.weekdaysMin,u.$W,C,2);case"ddd":return rt(f.weekdaysShort,u.$W,C,3);case"dddd":return C[u.$W];case"H":return String(b);case"HH":return $.s(b,2,"0");case"h":return ft(1);case"hh":return ft(2);case"a":return tt(b,j,!0);case"A":return tt(b,j,!1);case"m":return String(j);case"mm":return $.s(j,2,"0");case"s":return String(u.$s);case"ss":return $.s(u.$s,2,"0");case"SSS":return $.s(u.$ms,3,"0");case"Z":return g}return null}(H)||g.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(i,u,f){var d,g=this,b=$.p(u),j=R(i),E=(j.utcOffset()-this.utcOffset())*e,C=this-j,B=function(){return $.m(g,j)};switch(b){case P:d=B()/12;break;case v:d=B();break;case L:d=B()/3;break;case x:d=(C-E)/6048e5;break;case S:d=(C-E)/864e5;break;case y:d=C/r;break;case M:d=C/e;break;case s:d=C/t;break;default:d=C}return f?d:$.a(d)},a.daysInMonth=function(){return this.endOf(v).$D},a.$locale=function(){return k[this.$L]},a.locale=function(i,u){if(!i)return this.$L;var f=this.clone(),d=W(i,u,!0);return d&&(f.$L=d),f},a.clone=function(){return $.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},c}(),z=K.prototype;return R.prototype=z,[["$ms",o],["$s",s],["$m",M],["$H",y],["$W",S],["$M",v],["$y",P],["$D",N]].forEach(function(c){z[c[1]]=function(a){return this.$g(a,c[0],c[1])}}),R.extend=function(c,a){return c.$i||(c(a,K,R),c.$i=!0),R},R.locale=W,R.isDayjs=Y,R.unix=function(c){return R(1e3*c)},R.en=k[D],R.Ls=k,R.p={},R})});var qt=Pt((jt,Et)=>{"use strict";n();(function(t,e){typeof jt=="object"&&typeof Et<"u"?Et.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(jt,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,o=/\d\d/,s=/\d\d?/,M=/\d*[^-_:/,()\s\d]+/,y={},S=function(m){return(m=+m)+(m>68?1900:2e3)},x=function(m){return function(w){this[m]=+w}},v=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var A=w.match(/([+-]|\d\d)/g),T=60*A[1]+(+A[2]||0);return T===0?0:A[0]==="+"?-T:T}(m)}],L=function(m){var w=y[m];return w&&(w.indexOf?w:w.s.concat(w.f))},P=function(m,w){var A,T=y.meridiem;if(T){for(var O=1;O<=24;O+=1)if(m.indexOf(T(O,0,w))>-1){A=O>12;break}}else A=m===(w?"pm":"PM");return A},N={A:[M,function(m){this.afternoon=P(m,!1)}],a:[M,function(m){this.afternoon=P(m,!0)}],Q:[r,function(m){this.month=3*(m-1)+1}],S:[r,function(m){this.milliseconds=100*+m}],SS:[o,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[s,x("seconds")],ss:[s,x("seconds")],m:[s,x("minutes")],mm:[s,x("minutes")],H:[s,x("hours")],h:[s,x("hours")],HH:[s,x("hours")],hh:[s,x("hours")],D:[s,x("day")],DD:[o,x("day")],Do:[M,function(m){var w=y.ordinal,A=m.match(/\d+/);if(this.day=A[0],w)for(var T=1;T<=31;T+=1)w(T).replace(/\[|\]/g,"")===m&&(this.day=T)}],w:[s,x("week")],ww:[o,x("week")],M:[s,x("month")],MM:[o,x("month")],MMM:[M,function(m){var w=L("months"),A=(L("monthsShort")||w.map(function(T){return T.slice(0,3)})).indexOf(m)+1;if(A<1)throw new Error;this.month=A%12||A}],MMMM:[M,function(m){var w=L("months").indexOf(m)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,x("year")],YY:[o,function(m){this.year=S(m)}],YYYY:[/\d{4}/,x("year")],Z:v,ZZ:v};function I(m){var w,A;w=m,A=y&&y.formats;for(var T=(m=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,$,K){var z=K&&K.toUpperCase();return $||A[K]||t[K]||A[z].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,a,i){return a||i.slice(1)})})).match(e),O=T.length,D=0;D<O;D+=1){var k=T[D],F=N[k],Y=F&&F[0],W=F&&F[1];T[D]=W?{regex:Y,parser:W}:k.replace(/^\[|\]$/g,"")}return function(R){for(var $={},K=0,z=0;K<O;K+=1){var c=T[K];if(typeof c=="string")z+=c.length;else{var a=c.regex,i=c.parser,u=R.slice(z),f=a.exec(u)[0];i.call($,f),R=R.replace(f,"")}}return function(d){var g=d.afternoon;if(g!==void 0){var b=d.hours;g?b<12&&(d.hours+=12):b===12&&(d.hours=0),delete d.afternoon}}($),$}}return function(m,w,A){A.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(S=m.parseTwoDigitYear);var T=w.prototype,O=T.parse;T.parse=function(D){var k=D.date,F=D.utc,Y=D.args;this.$u=F;var W=Y[1];if(typeof W=="string"){var R=Y[2]===!0,$=Y[3]===!0,K=R||$,z=Y[2];$&&(z=Y[2]),y=this.$locale(),!R&&z&&(y=A.Ls[z]),this.$d=function(u,f,d,g){try{if(["x","X"].indexOf(f)>-1)return new Date((f==="X"?1e3:1)*u);var b=I(f)(u),j=b.year,E=b.month,C=b.day,B=b.hours,ot=b.minutes,rt=b.seconds,ft=b.milliseconds,tt=b.zone,H=b.week,G=new Date,nt=C||(j||E?1:G.getDate()),it=j||G.getFullYear(),lt=0;j&&!E||(lt=E>0?E-1:G.getMonth());var pt,wt=B||0,Mt=ot||0,Ot=rt||0,Dt=ft||0;return tt?new Date(Date.UTC(it,lt,nt,wt,Mt,Ot,Dt+60*tt.offset*1e3)):d?new Date(Date.UTC(it,lt,nt,wt,Mt,Ot,Dt)):(pt=new Date(it,lt,nt,wt,Mt,Ot,Dt),H&&(pt=g(pt).week(H).toDate()),pt)}catch{return new Date("")}}(k,W,F,A),this.init(),z&&z!==!0&&(this.$L=this.locale(z).$L),K&&k!=this.format(W)&&(this.$d=new Date("")),y={}}else if(W instanceof Array)for(var c=W.length,a=1;a<=c;a+=1){Y[1]=W[a-1];var i=A.apply(this,Y);if(i.isValid()){this.$d=i.$d,this.$L=i.$L,this.init();break}a===c&&(this.$d=new Date(""))}else O.call(this,D)}}})});n();n();n();n();n();function st(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}n();function gt(t){return t!==null&&typeof t=="object"}n();n();var ae=Object.prototype.toString,ut=t=>ae.call(t),Pe=t=>ut(t).slice(8,-1),at=t=>typeof t=="string",Z=t=>typeof t=="number"&&Number.isFinite(t),Q=t=>typeof t=="boolean",St=t=>t===null,_=t=>t===void 0,It=t=>typeof t=="symbol",V=Array.isArray,ht=t=>typeof t=="function",_t=t=>ut(t)==="[object Map]",Ct=t=>ut(t)==="[object Set]",Lt=t=>ut(t)==="[object Date]",Ft=t=>ut(t)==="[object RegExp]",Ht=t=>gt(t)&&ht(t?.then)&&ht(t?.catch),Ut=t=>t==null,Ie=t=>t!=null,_e=(t,e)=>t!==e;function X(t){return ut(t)==="[object Object]"}function ct(t){return V(t)?t:[t]}n();n();n();n();function er(t){let e=[],r,o="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)o+=e.pop().toString();return o}var Kt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rr(t){let e="",r="";for(let s=0;s<t.length;s++)r+=t[s].charCodeAt(0).toString(2).padStart(8,"0");for(let s=0;s<r.length;s+=6)e+=Kt[Number.parseInt(r.slice(s,s+6).padEnd(6,"0"),2)];let o=e.length%4;return o!==0&&(e+="=".repeat(4-o)),e}function nr(t){let e="",r="";for(let o=0;o<t.length&&t[o]!=="=";o++)r+=Kt.indexOf(t[o]).toString(2).padStart(6,"0");for(let o=0;o<r.length;o+=8){let s=Number.parseInt(r.slice(o,o+8),2);s&&(e+=String.fromCharCode(s))}return e}n();function sr(...t){return t.reduce((e,r)=>function(...o){return r(e(...o))})}function ar(...t){return t.reduce((e,r)=>function(...o){return e(r(...o))})}n();function cr(t,e=500){let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,o)},e)}}n();function mt(t){let e=new WeakMap;function r(o){if(!gt(o))return o;if(Lt(o))return new Date(o);if(Ft(o))return new RegExp(o);if(Ht(o))return o;if(e.has(o))return e.get(o);if(_t(o)){let y=new Map;return e.set(o,y),o.forEach((S,x)=>y.set(r(x),r(S))),y}if(Ct(o)){let y=new Set;return e.set(o,y),o.forEach(S=>y.add(r(S))),y}let s=V(o)?Object.setPrototypeOf([],Object.getPrototypeOf(o)):Object.create(Object.getPrototypeOf(o));e.set(o,s);let M=Object.getOwnPropertyDescriptors(o);for(let y of Reflect.ownKeys(M)){let S=M[y];S.get||S.set?Object.defineProperty(s,y,S):Object.defineProperty(s,y,{...S,value:r(S.value)})}return s}return r(t)}n();function br(t,e,r={}){return zt(Wt(t,r),Wt(e,r),r)}function zt(t,e,r){return V(t)?ue(t,e,r):fe(t,e,r)}function fe(t,e,r){if(!X(e))return e;let o=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(s=>{(X(t[s])||V(t[s]))&&(X(e[s])||V(e[s]))?t[s]=zt(t[s],e[s],r):Object.defineProperty(t,s,o[s])}),t}function ue(t,e,r){let{mergeStrategy:o="replace"}=r;if(V(e))switch(o){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Wt(t,e){let{deepClone:r=!0}=e;return r?mt(t):t}n();var yt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function h(t,e){throw new yt(`[${t}] ${e}`)}function Mr(t,e){let r=at(t)?new yt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}n();var bt=(t,e,...r)=>{if(!e)return;let o=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,o)},xt=(t,...e)=>{bt("info",t,...e)};xt.info=(t,...e)=>{bt("info",t,...e)};xt.error=(t,...e)=>{bt("error",t,...e)};xt.warn=(t,...e)=>{bt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=xt);n();function jr(t,e={}){ce(e);let{encode:r=!0,encodeValuesOnly:o=!1,arrayFormat:s="indices",encodeDotInKeys:M=!1,skipNulls:y=!1,strictNullHandling:S=!1,commaRoundTrip:x=!1,allowEmptyArrays:v=!1,addQueryPrefix:L=!1,delimiter:P="&"}=e,N=e.allowDots??!1;M&&_(e.allowDots)&&(N=!0);let I=[],m=O=>r&&!o?encodeURIComponent(O):O,w=O=>r?encodeURIComponent(O):O;function A(O,D){if(!_(D)){if(St(D)){if(y)return;I.push(`${m(O)}${S?"":"="}`);return}if(V(D)){if(D.length===0){v&&I.push(`${m(O)}[]`);return}if(s==="comma"){let k=o?D.map(w).join(","):w(D.join(","));if(D.length===1&&St(D[0])){if(y)return;I.push(`${m(O)}${x?"[]":""}${S?"":"="}`)}else D.length===1?I.push(`${m(O)}${x?"[]":""}=${k}`):I.push(`${m(O)}=${k}`);return}D.forEach((k,F)=>{let Y=O;s==="indices"?Y=`${O}[${F}]`:s==="brackets"&&(Y=`${O}[]`),A(Y,k)});return}if(st(D)){Object.keys(D).forEach(k=>{let F=O;M&&(F=F.replace(/\./g,"%2E"));let Y=k;N?(M&&(Y=Y.replace(/\./g,"%2E")),A(`${F}.${Y}`,D[k])):A(`${F}[${Y}]`,D[k])});return}I.push(`${m(O)}=${w(D)}`)}}if(!st(t))return"";Bt(t)&&h("stringify","Input object contains circular references, cannot stringify"),V(t)?t.forEach((O,D)=>A(`${D}`,O)):Object.keys(t).forEach(O=>A(O,t[O]));let T=I.join(P);return L&&T?`?${T}`:T}function ce(t={}){X(t)||h("stringify",'"options" must be a plain object'),!_(t.encode)&&!Q(t.encode)&&h("stringify",'"encode" must be a boolean'),!_(t.encodeValuesOnly)&&!Q(t.encodeValuesOnly)&&h("stringify",'"encodeValuesOnly" must be a boolean'),!_(t.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(t.arrayFormat)&&h("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!_(t.allowDots)&&!Q(t.allowDots)&&h("stringify",'"allowDots" must be a boolean'),!_(t.skipNulls)&&!Q(t.skipNulls)&&h("stringify",'"skipNulls" must be a boolean'),!_(t.strictNullHandling)&&!Q(t.strictNullHandling)&&h("stringify",'"strictNullHandling" must be a boolean'),!_(t.addQueryPrefix)&&!Q(t.addQueryPrefix)&&h("stringify",'"addQueryPrefix" must be a boolean'),!_(t.delimiter)&&!at(t.delimiter)&&h("stringify",'"delimiter" must be a string'),!_(t.encodeDotInKeys)&&!Q(t.encodeDotInKeys)&&h("stringify",'"encodeDotInKeys" must be a boolean'),!_(t.commaRoundTrip)&&!Q(t.commaRoundTrip)&&h("stringify",'"commaRoundTrip" must be a boolean'),!_(t.allowEmptyArrays)&&!Q(t.allowEmptyArrays)&&h("stringify",'"allowEmptyArrays" must be a boolean')}n();var me={stringify:t=>(st(t)||h("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(at(t)||h("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let r=me.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${r}`:`${t}&${r}`:`${t}?${r}`}};n();function _r(t,e=500){let r=null;return function(...o){if(Ut(r))return r=Date.now(),t.apply(this,o);let s=Date.now();if(s-r>=e)return r=s,t.apply(this,o)}}n();n();function zr(t){le(t);let{fn:e,maxAttempts:r=3,retryDelay:o=1e3,enableExponentialBackoff:s=!1,signal:M}=t,y,S=M?new Promise((v,L)=>{let P=()=>L(Vt());M.addEventListener("abort",P),y=()=>M.removeEventListener("abort",P)}):null;return new Promise((v,L)=>{(async()=>{for(let N=1;N<=r;N++){if(M?.aborted)return L(Vt());try{let I=await Promise.race(S?[e(),S]:[e()]);return v(I)}catch(I){let m=s?o*2**(N-1):o;if(log("withRetry",`Attempt ${N}/${r} failed. Retrying in ${m}ms...`),I instanceof Error&&I.name==="AbortError"||N===r)return L(I);await new Promise(w=>setTimeout(w,m))}}})()}).finally(()=>y?.())}function le(t){X(t)||h("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&h("withRetry",'"fn" must be a function that returns a Promise'),!_(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&h("withRetry",'"maxAttempts" must be a positive integer'),!_(t.retryDelay)&&(!Z(t.retryDelay)||t.retryDelay<0)&&h("withRetry",'"retryDelay" must be a non-negative number'),!_(t.enableExponentialBackoff)&&!Q(t.enableExponentialBackoff)&&h("withRetry",'"enableExponentialBackoff" must be a boolean'),!_(t.signal)&&typeof t.signal!="object"&&h("withRetry",'"signal" must be an AbortSignal')}var pe="The operation was aborted";function Vt(t=pe){let e=new Error(t);return e.name="AbortError",e}function Bt(t){st(t)||h("hasCircularReference",'"obj" must be a object');let e=new Set;function r(o){if(st(o)){if(e.has(o))return!0;e.add(o);for(let s of Object.keys(o))if(r(o[s]))return!0;e.delete(o)}return!1}return r(t)}n();n();function Zt(t,e,r={}){let{includeProto:o=!1,includeSymbols:s=!0,includeNonEnum:M=!1}=r,y={};return X(t)&&ct(e).forEach(x=>{It(x)&&!s||!(o?x in t:Object.hasOwn(t,x))||!M&&(o?de(t,x):Object.getOwnPropertyDescriptor(t,x))?.enumerable===!1||(y[x]=mt(t[x]))}),y}function de(t,e){let r=t;for(;r!==null;){let o=Object.getOwnPropertyDescriptor(r,e);if(o)return o;r=Object.getPrototypeOf(r)}}function Mn(t,e){if(!X(t))return{};let r=mt(t),o=ct(e),s=Object.keys(r).filter(M=>!o.includes(M));return Zt(r,s)}n();n();n();n();n();function vn(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function kn(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Yn(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function Nn(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Pn(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}n();function Cn(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function Ln(t){return/^[1-9]\d*$/.test(t)}function Gt(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function Fn(t){return/^-[1-9]\d*$/.test(t)}function Hn(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}n();var Qt=dt($t(),1);function Xt(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Qt.default)(t,e,!0).isValid()}n();function Vn(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}n();function Qn(t){return t===""}n();var Rt=dt($t(),1);function to(t){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(t))return!1;let r=t.slice(6,14);return Xt(r,"YYYYMMDD")&&(0,Rt.default)(r,"YYYYMMDD").isBefore((0,Rt.default)())}n();function no(t){return/^1[3-9]\d{9}$/.test(t)}n();var ao=t=>{if(!at(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};n();function co(t){return/^https?:\/\/\S+$/i.test(t)}function jo(t,e){return(!Z(t)||!Gt(t.toString()))&&h("generateRandomArray","num must be greater than 0"),ht(e)||h("generateRandomArray","cb must be a function"),Array.from({length:t},()=>e())}n();function ko(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}n();var et=dt($t(),1),Jt=dt(qt(),1);n();n();function q(t){return t[Math.floor(Math.random()*t.length)]}function U(t={}){Z(t)&&(t={max:t});let{min:e=1,max:r=q(he())}=t;ge(e,r);let o=Math.ceil(e),s=Math.floor(r);return Math.floor(Math.random()*(s-o+1)+o)}function ge(t,e){let r=Math.ceil(t),o=Math.floor(e);Number.isSafeInteger(r)||h("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(o)||h("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),o<r&&(e>=t&&h("getRandomInt",`No integer value found between ${t} and ${e}`),h("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function he(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}et.default.extend(Jt.default);function vt(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,et.default)().format("YYYY-MM-DD HH:mm:ss"),format:o="YYYY-MM-DD HH:mm:ss"}=t;(!(0,et.default)(e).isValid()||!(0,et.default)(r).isValid())&&h("generateRandomDate","start and end parameters must be valid date format");let s=(0,et.default)(e).year(),M=(0,et.default)(r).year(),y=U({min:s,max:M}),S=U({min:1,max:12}),x=U({min:1,max:31}),v=U(23),L=U(59),P=U(59),N=(0,et.default)(`${y}-${S}-${x} ${v}:${L}:${P}`);return N.isBefore((0,et.default)(e))||N.isAfter((0,et.default)(r))?vt(t):N.format(o)}n();n();function J(t={}){let e=be(t),r=xe(e);$e(r);let{length:o}=e;we(o.min,o.max);let s=U(o),M=e.prefix||"";for(let y=0;y<s;y++)M+=r.charAt(Math.floor(Math.random()*r.length));return M+(e.suffix||"")}var ye=16,kt=1;function be(t){let e=Z(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:Z(t.length)?{max:t.length,min:t.length}:{max:ye,min:kt,...t.length},extra:e?[]:[...new Set(ct(t.extra||[]))]}}function xe(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=ct(t.extra).join(""),e}function $e(t){t.length===0&&h("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function we(t,e){Number.isInteger(t)||h("getRandomString","min must be an integer"),Number.isInteger(e)||h("getRandomString","max must be an integer"),t<kt&&h("getRandomString",`Minimum length cannot be less than ${kt}`),e<t&&h("getRandomString","Maximum length cannot be less than minimum length")}function Me(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${J(1)}${J({length:U({max:30,min:1})})}${J(1)}@${q(t)}`;return/\.{2,}/.test(e)?Me():e}n();function ii(t={}){Z(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:o=2}=t;if(e===r)return e;if(e>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${e}`);let s=Math.random()*(r-e)+e;return Number(s.toFixed(o))}n();n();function Yt(t,e){(!Z(t)||t<=0)&&h("generateRandomStringFromSource","num must be greater than 0"),(!V(e)||e.length===0)&&h("generateRandomStringFromSource","source cannot be empty array");let r="";for(let o=0;o<t;o++)r+=q(e);return r}function hi(){let t=U({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,vt({format:"YYYYMMDD"}),Yt(3,e),Yt(1,[...e,"X","x"])].join("")}n();function wi(){return q(["13","14","15","16","17","18","19"])+U(999999999).toString().padEnd(9,"0")}n();function Ti(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${J({length:{min:4,max:8}})}`,`?id=${U()}`,`?page=${J({length:{min:2,max:4}})}`,`?query=${J({length:{min:5,max:6}})}`,`?search=${J({length:{min:1,max:4}})}`,`?token=${J({length:{min:16,max:16}})}`];return`${q(t)}${J({length:{min:5,max:25}})}${q(e)}${q(r)}`}n();n();export{yt as UtilsError,nr as base64Decode,rr as base64Encode,ct as castArray,sr as compose,ar as composeRight,cr as debounce,Mr as debugWarn,er as decimalToBinary,mt as deepClone,br as deepMerge,jo as generateRandomArray,ko as generateRandomColor,vt as generateRandomDate,Me as generateRandomEmail,ii as generateRandomFloat,hi as generateRandomIdCard,wi as generateRandomMobilePhone,Yt as generateRandomStringFromSource,U as getRandomInt,q as getRandomItem,J as getRandomString,Ti as getRandomUrl,_e as hasChanged,Bt as hasCircularReference,V as isArray,Q as isBoolean,Lt as isDate,Xt as isDateString,Ie as isDef,Vn as isEmail,Qn as isEmptyString,vn as isFloat,ht as isFunction,to as isIdCard,Cn as isInteger,_t as isMap,no as isMobilePhone,Nn as isNegativeFloat,Fn as isNegativeInteger,Ut as isNil,Yn as isNonNegativeFloat,Gt as isNonNegativeInteger,Pn as isNonPositiveFloat,Hn as isNonPositiveInteger,St as isNull,Z as isNumber,st as isObject,gt as isObjectLike,X as isPlainObject,kn as isPositiveFloat,Ln as isPositiveInteger,Ht as isPromise,Ft as isRegExp,Ct as isSet,at as isString,ao as isStringNumber,It as isSymbol,co as isURL,_ as isUndef,ae as objectToString,Mn as omit,Zt as pick,me as qs,jr as qsStringify,_r as throttle,h as throwError,ut as toTypeString,Pe as toTypeValue,zr as withRetry};
|
|
1
|
+
var ee=Object.create;var Nt=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var se=(t,e)=>()=>(t&&(e=t(t=0)),e);var Pt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ae=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ne(e))!ie.call(t,s)&&s!==r&&Nt(t,s,{get:()=>e[s],enumerable:!(n=re(e,s))||n.enumerable});return t};var dt=(t,e,r)=>(r=t!=null?ee(oe(t)):{},ae(e||!t||!t.__esModule?Nt(r,"default",{value:t,enumerable:!0}):r,t));import Te from"path";import{fileURLToPath as Re}from"url";var o=se(()=>{"use strict"});var $t=Pt((Tt,At)=>{"use strict";o();(function(t,e){typeof Tt=="object"&&typeof At<"u"?At.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Tt,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",s="second",O="minute",y="hour",S="day",x="week",N="month",H="quarter",_="year",C="date",P="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,T={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(c){var a=["th","st","nd","rd"],i=c%100;return"["+c+(a[(i-20)%10]||a[i]||a[0])+"]"}},A=function(c,a,i){var u=String(c);return!u||u.length>=a?c:""+Array(a+1-u.length).join(i)+c},M={s:A,z:function(c){var a=-c.utcOffset(),i=Math.abs(a),u=Math.floor(i/60),f=i%60;return(a<=0?"+":"-")+A(u,2,"0")+":"+A(f,2,"0")},m:function c(a,i){if(a.date()<i.date())return-c(i,a);var u=12*(i.year()-a.year())+(i.month()-a.month()),f=a.clone().add(u,N),g=i-f<0,h=a.clone().add(u+(g?-1:1),N);return+(-(u+(i-f)/(g?f-h:h-f))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:N,y:_,w:x,d:S,D:C,h:y,m:O,s,ms:n,Q:H}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return c===void 0}},D="en",v={};v[D]=T;var L="$isDayjsObject",k=function(c){return c instanceof U||!(!c||!c[L])},W=function c(a,i,u){var f;if(!a)return D;if(typeof a=="string"){var g=a.toLowerCase();v[g]&&(f=g),i&&(v[g]=i,f=g);var h=a.split("-");if(!f&&h.length>1)return c(h[0])}else{var b=a.name;v[b]=a,f=b}return!u&&f&&(D=f),f||!u&&D},R=function(c,a){if(k(c))return c.clone();var i=typeof a=="object"?a:{};return i.date=c,i.args=arguments,new U(i)},$=M;$.l=W,$.i=k,$.w=function(c,a){return R(c,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var U=function(){function c(i){this.$L=W(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[L]=!0}var a=c.prototype;return a.parse=function(i){this.$d=function(u){var f=u.date,g=u.utc;if(f===null)return new Date(NaN);if($.u(f))return new Date;if(f instanceof Date)return new Date(f);if(typeof f=="string"&&!/Z$/i.test(f)){var h=f.match(m);if(h){var b=h[2]-1||0,j=(h[7]||"0").substring(0,3);return g?new Date(Date.UTC(h[1],b,h[3]||1,h[4]||0,h[5]||0,h[6]||0,j)):new Date(h[1],b,h[3]||1,h[4]||0,h[5]||0,h[6]||0,j)}}return new Date(f)}(i),this.init()},a.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},a.$utils=function(){return $},a.isValid=function(){return this.$d.toString()!==P},a.isSame=function(i,u){var f=R(i);return this.startOf(u)<=f&&f<=this.endOf(u)},a.isAfter=function(i,u){return R(i)<this.startOf(u)},a.isBefore=function(i,u){return this.endOf(u)<R(i)},a.$g=function(i,u,f){return $.u(i)?this[u]:this.set(f,i)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(i,u){var f=this,g=!!$.u(u)||u,h=$.p(i),b=function(J,F){var Z=$.w(f.$u?Date.UTC(f.$y,F,J):new Date(f.$y,F,J),f);return g?Z:Z.endOf(S)},j=function(J,F){return $.w(f.toDate()[J].apply(f.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(F)),f)},E=this.$W,I=this.$M,z=this.$D,nt="set"+(this.$u?"UTC":"");switch(h){case _:return g?b(1,0):b(31,11);case N:return g?b(1,I):b(0,I+1);case x:var tt=this.$locale().weekStart||0,at=(E<tt?E+7:E)-tt;return b(g?z-at:z+(6-at),I);case S:case C:return j(nt+"Hours",0);case y:return j(nt+"Minutes",1);case O:return j(nt+"Seconds",2);case s:return j(nt+"Milliseconds",3);default:return this.clone()}},a.endOf=function(i){return this.startOf(i,!1)},a.$set=function(i,u){var f,g=$.p(i),h="set"+(this.$u?"UTC":""),b=(f={},f[S]=h+"Date",f[C]=h+"Date",f[N]=h+"Month",f[_]=h+"FullYear",f[y]=h+"Hours",f[O]=h+"Minutes",f[s]=h+"Seconds",f[n]=h+"Milliseconds",f)[g],j=g===S?this.$D+(u-this.$W):u;if(g===N||g===_){var E=this.clone().set(C,1);E.$d[b](j),E.init(),this.$d=E.set(C,Math.min(this.$D,E.daysInMonth())).$d}else b&&this.$d[b](j);return this.init(),this},a.set=function(i,u){return this.clone().$set(i,u)},a.get=function(i){return this[$.p(i)]()},a.add=function(i,u){var f,g=this;i=Number(i);var h=$.p(u),b=function(I){var z=R(g);return $.w(z.date(z.date()+Math.round(I*i)),g)};if(h===N)return this.set(N,this.$M+i);if(h===_)return this.set(_,this.$y+i);if(h===S)return b(1);if(h===x)return b(7);var j=(f={},f[O]=e,f[y]=r,f[s]=t,f)[h]||1,E=this.$d.getTime()+i*j;return $.w(E,this)},a.subtract=function(i,u){return this.add(-1*i,u)},a.format=function(i){var u=this,f=this.$locale();if(!this.isValid())return f.invalidDate||P;var g=i||"YYYY-MM-DDTHH:mm:ssZ",h=$.z(this),b=this.$H,j=this.$m,E=this.$M,I=f.weekdays,z=f.months,nt=f.meridiem,tt=function(F,Z,et,ot){return F&&(F[Z]||F(u,g))||et[Z].slice(0,ot)},at=function(F){return $.s(b%12||12,F,"0")},J=nt||function(F,Z,et){var ot=F<12?"AM":"PM";return et?ot.toLowerCase():ot};return g.replace(w,function(F,Z){return Z||function(et){switch(et){case"YY":return String(u.$y).slice(-2);case"YYYY":return $.s(u.$y,4,"0");case"M":return E+1;case"MM":return $.s(E+1,2,"0");case"MMM":return tt(f.monthsShort,E,z,3);case"MMMM":return tt(z,E);case"D":return u.$D;case"DD":return $.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return tt(f.weekdaysMin,u.$W,I,2);case"ddd":return tt(f.weekdaysShort,u.$W,I,3);case"dddd":return I[u.$W];case"H":return String(b);case"HH":return $.s(b,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return J(b,j,!0);case"A":return J(b,j,!1);case"m":return String(j);case"mm":return $.s(j,2,"0");case"s":return String(u.$s);case"ss":return $.s(u.$s,2,"0");case"SSS":return $.s(u.$ms,3,"0");case"Z":return h}return null}(F)||h.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(i,u,f){var g,h=this,b=$.p(u),j=R(i),E=(j.utcOffset()-this.utcOffset())*e,I=this-j,z=function(){return $.m(h,j)};switch(b){case _:g=z()/12;break;case N:g=z();break;case H:g=z()/3;break;case x:g=(I-E)/6048e5;break;case S:g=(I-E)/864e5;break;case y:g=I/r;break;case O:g=I/e;break;case s:g=I/t;break;default:g=I}return f?g:$.a(g)},a.daysInMonth=function(){return this.endOf(N).$D},a.$locale=function(){return v[this.$L]},a.locale=function(i,u){if(!i)return this.$L;var f=this.clone(),g=W(i,u,!0);return g&&(f.$L=g),f},a.clone=function(){return $.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},c}(),V=U.prototype;return R.prototype=V,[["$ms",n],["$s",s],["$m",O],["$H",y],["$W",S],["$M",N],["$y",_],["$D",C]].forEach(function(c){V[c[1]]=function(a){return this.$g(a,c[0],c[1])}}),R.extend=function(c,a){return c.$i||(c(a,U,R),c.$i=!0),R},R.locale=W,R.isDayjs=k,R.unix=function(c){return R(1e3*c)},R.en=v[D],R.Ls=v,R.p={},R})});var Xt=Pt((jt,Et)=>{"use strict";o();(function(t,e){typeof jt=="object"&&typeof Et<"u"?Et.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(jt,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,s=/\d\d?/,O=/\d*[^-_:/,()\s\d]+/,y={},S=function(m){return(m=+m)+(m>68?1900:2e3)},x=function(m){return function(w){this[m]=+w}},N=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var T=w.match(/([+-]|\d\d)/g),A=60*T[1]+(+T[2]||0);return A===0?0:T[0]==="+"?-A:A}(m)}],H=function(m){var w=y[m];return w&&(w.indexOf?w:w.s.concat(w.f))},_=function(m,w){var T,A=y.meridiem;if(A){for(var M=1;M<=24;M+=1)if(m.indexOf(A(M,0,w))>-1){T=M>12;break}}else T=m===(w?"pm":"PM");return T},C={A:[O,function(m){this.afternoon=_(m,!1)}],a:[O,function(m){this.afternoon=_(m,!0)}],Q:[r,function(m){this.month=3*(m-1)+1}],S:[r,function(m){this.milliseconds=100*+m}],SS:[n,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[s,x("seconds")],ss:[s,x("seconds")],m:[s,x("minutes")],mm:[s,x("minutes")],H:[s,x("hours")],h:[s,x("hours")],HH:[s,x("hours")],hh:[s,x("hours")],D:[s,x("day")],DD:[n,x("day")],Do:[O,function(m){var w=y.ordinal,T=m.match(/\d+/);if(this.day=T[0],w)for(var A=1;A<=31;A+=1)w(A).replace(/\[|\]/g,"")===m&&(this.day=A)}],w:[s,x("week")],ww:[n,x("week")],M:[s,x("month")],MM:[n,x("month")],MMM:[O,function(m){var w=H("months"),T=(H("monthsShort")||w.map(function(A){return A.slice(0,3)})).indexOf(m)+1;if(T<1)throw new Error;this.month=T%12||T}],MMMM:[O,function(m){var w=H("months").indexOf(m)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,x("year")],YY:[n,function(m){this.year=S(m)}],YYYY:[/\d{4}/,x("year")],Z:N,ZZ:N};function P(m){var w,T;w=m,T=y&&y.formats;for(var A=(m=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,$,U){var V=U&&U.toUpperCase();return $||T[U]||t[U]||T[V].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,a,i){return a||i.slice(1)})})).match(e),M=A.length,D=0;D<M;D+=1){var v=A[D],L=C[v],k=L&&L[0],W=L&&L[1];A[D]=W?{regex:k,parser:W}:v.replace(/^\[|\]$/g,"")}return function(R){for(var $={},U=0,V=0;U<M;U+=1){var c=A[U];if(typeof c=="string")V+=c.length;else{var a=c.regex,i=c.parser,u=R.slice(V),f=a.exec(u)[0];i.call($,f),R=R.replace(f,"")}}return function(g){var h=g.afternoon;if(h!==void 0){var b=g.hours;h?b<12&&(g.hours+=12):b===12&&(g.hours=0),delete g.afternoon}}($),$}}return function(m,w,T){T.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(S=m.parseTwoDigitYear);var A=w.prototype,M=A.parse;A.parse=function(D){var v=D.date,L=D.utc,k=D.args;this.$u=L;var W=k[1];if(typeof W=="string"){var R=k[2]===!0,$=k[3]===!0,U=R||$,V=k[2];$&&(V=k[2]),y=this.$locale(),!R&&V&&(y=T.Ls[V]),this.$d=function(u,f,g,h){try{if(["x","X"].indexOf(f)>-1)return new Date((f==="X"?1e3:1)*u);var b=P(f)(u),j=b.year,E=b.month,I=b.day,z=b.hours,nt=b.minutes,tt=b.seconds,at=b.milliseconds,J=b.zone,F=b.week,Z=new Date,et=I||(j||E?1:Z.getDate()),ot=j||Z.getFullYear(),lt=0;j&&!E||(lt=E>0?E-1:Z.getMonth());var pt,wt=z||0,Ot=nt||0,Mt=tt||0,Dt=at||0;return J?new Date(Date.UTC(ot,lt,et,wt,Ot,Mt,Dt+60*J.offset*1e3)):g?new Date(Date.UTC(ot,lt,et,wt,Ot,Mt,Dt)):(pt=new Date(ot,lt,et,wt,Ot,Mt,Dt),F&&(pt=h(pt).week(F).toDate()),pt)}catch{return new Date("")}}(v,W,L,T),this.init(),V&&V!==!0&&(this.$L=this.locale(V).$L),U&&v!=this.format(W)&&(this.$d=new Date("")),y={}}else if(W instanceof Array)for(var c=W.length,a=1;a<=c;a+=1){k[1]=W[a-1];var i=T.apply(this,k);if(i.isValid()){this.$d=i.$d,this.$L=i.$L,this.init();break}a===c&&(this.$d=new Date(""))}else M.call(this,D)}}})});o();o();o();o();o();function it(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}o();function gt(t){return t!==null&&typeof t=="object"}o();o();var fe=Object.prototype.toString,ft=t=>fe.call(t),Ye=t=>ft(t).slice(8,-1),st=t=>typeof t=="string",K=t=>typeof t=="number"&&Number.isFinite(t),G=t=>typeof t=="boolean",St=t=>t===null,Y=t=>t===void 0,Yt=t=>typeof t=="symbol",B=Array.isArray,ht=t=>typeof t=="function",It=t=>ft(t)==="[object Map]",_t=t=>ft(t)==="[object Set]",Ct=t=>ft(t)==="[object Date]",Lt=t=>ft(t)==="[object RegExp]",Ft=t=>gt(t)&&ht(t?.then)&&ht(t?.catch),Ht=t=>t==null,Ie=t=>t!=null,_e=(t,e)=>t!==e;function Q(t){return ft(t)==="[object Object]"}function ut(t){return B(t)?t:[t]}o();o();o();o();function er(t){let e=[],r,n="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)n+=e.pop().toString();return n}var Ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rr(t){let e="",r="";for(let s=0;s<t.length;s++)r+=t[s].charCodeAt(0).toString(2).padStart(8,"0");for(let s=0;s<r.length;s+=6)e+=Ut[Number.parseInt(r.slice(s,s+6).padEnd(6,"0"),2)];let n=e.length%4;return n!==0&&(e+="=".repeat(4-n)),e}function nr(t){let e="",r="";for(let n=0;n<t.length&&t[n]!=="=";n++)r+=Ut.indexOf(t[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let s=Number.parseInt(r.slice(n,n+8),2);s&&(e+=String.fromCharCode(s))}return e}o();function sr(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function ar(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}o();function cr(t,e=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}}o();function ct(t){let e=new WeakMap;function r(n){if(!gt(n))return n;if(Ct(n))return new Date(n);if(Lt(n))return new RegExp(n);if(Ft(n))return n;if(e.has(n))return e.get(n);if(It(n)){let y=new Map;return e.set(n,y),n.forEach((S,x)=>y.set(r(x),r(S))),y}if(_t(n)){let y=new Set;return e.set(n,y),n.forEach(S=>y.add(r(S))),y}let s=B(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));e.set(n,s);let O=Object.getOwnPropertyDescriptors(n);for(let y of Reflect.ownKeys(O)){let S=O[y];S.get||S.set?Object.defineProperty(s,y,S):Object.defineProperty(s,y,{...S,value:r(S.value)})}return s}return r(t)}o();function br(t,e,r={}){return Wt(Kt(t,r),Kt(e,r),r)}function Wt(t,e,r){return B(t)?ce(t,e,r):ue(t,e,r)}function ue(t,e,r){if(!Q(e))return e;let n=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(s=>{(Q(t[s])||B(t[s]))&&(Q(e[s])||B(e[s]))?t[s]=Wt(t[s],e[s],r):Object.defineProperty(t,s,n[s])}),t}function ce(t,e,r){let{mergeStrategy:n="replace"}=r;if(B(e))switch(n){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Kt(t,e){let{deepClone:r=!0}=e;return r?ct(t):t}o();var yt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function d(t,e){throw new yt(`[${t}] ${e}`)}function Or(t,e){let r=st(t)?new yt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}o();var bt=(t,e,...r)=>{if(!e)return;let n=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,n)},xt=(t,...e)=>{bt("info",t,...e)};xt.info=(t,...e)=>{bt("info",t,...e)};xt.error=(t,...e)=>{bt("error",t,...e)};xt.warn=(t,...e)=>{bt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=xt);o();function jr(t,e={}){me(e);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:s="indices",encodeDotInKeys:O=!1,skipNulls:y=!1,strictNullHandling:S=!1,commaRoundTrip:x=!1,allowEmptyArrays:N=!1,addQueryPrefix:H=!1,delimiter:_="&"}=e,C=e.allowDots??!1;O&&Y(e.allowDots)&&(C=!0);let P=[],m=M=>r&&!n?encodeURIComponent(M):M,w=M=>r?encodeURIComponent(M):M;function T(M,D){if(!Y(D)){if(St(D)){if(y)return;P.push(`${m(M)}${S?"":"="}`);return}if(B(D)){if(D.length===0){N&&P.push(`${m(M)}[]`);return}if(s==="comma"){let v=n?D.map(w).join(","):w(D.join(","));if(D.length===1&&St(D[0])){if(y)return;P.push(`${m(M)}${x?"[]":""}${S?"":"="}`)}else D.length===1?P.push(`${m(M)}${x?"[]":""}=${v}`):P.push(`${m(M)}=${v}`);return}D.forEach((v,L)=>{let k=M;s==="indices"?k=`${M}[${L}]`:s==="brackets"&&(k=`${M}[]`),T(k,v)});return}if(it(D)){Object.keys(D).forEach(v=>{let L=M;O&&(L=L.replace(/\./g,"%2E"));let k=v;C?(O&&(k=k.replace(/\./g,"%2E")),T(`${L}.${k}`,D[v])):T(`${L}[${k}]`,D[v])});return}P.push(`${m(M)}=${w(D)}`)}}if(!it(t))return"";Vt(t)&&d("stringify","Input object contains circular references, cannot stringify"),B(t)?t.forEach((M,D)=>T(`${D}`,M)):Object.keys(t).forEach(M=>T(M,t[M]));let A=P.join(_);return H&&A?`?${A}`:A}function me(t={}){Q(t)||d("stringify",'"options" must be a plain object'),!Y(t.encode)&&!G(t.encode)&&d("stringify",'"encode" must be a boolean'),!Y(t.encodeValuesOnly)&&!G(t.encodeValuesOnly)&&d("stringify",'"encodeValuesOnly" must be a boolean'),!Y(t.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(t.arrayFormat)&&d("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!Y(t.allowDots)&&!G(t.allowDots)&&d("stringify",'"allowDots" must be a boolean'),!Y(t.skipNulls)&&!G(t.skipNulls)&&d("stringify",'"skipNulls" must be a boolean'),!Y(t.strictNullHandling)&&!G(t.strictNullHandling)&&d("stringify",'"strictNullHandling" must be a boolean'),!Y(t.addQueryPrefix)&&!G(t.addQueryPrefix)&&d("stringify",'"addQueryPrefix" must be a boolean'),!Y(t.delimiter)&&!st(t.delimiter)&&d("stringify",'"delimiter" must be a string'),!Y(t.encodeDotInKeys)&&!G(t.encodeDotInKeys)&&d("stringify",'"encodeDotInKeys" must be a boolean'),!Y(t.commaRoundTrip)&&!G(t.commaRoundTrip)&&d("stringify",'"commaRoundTrip" must be a boolean'),!Y(t.allowEmptyArrays)&&!G(t.allowEmptyArrays)&&d("stringify",'"allowEmptyArrays" must be a boolean')}o();var le={stringify:t=>(it(t)||d("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(st(t)||d("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let r=le.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${r}`:`${t}&${r}`:`${t}?${r}`}};o();function _r(t,e=500){let r=null;return function(...n){if(Ht(r))return r=Date.now(),t.apply(this,n);let s=Date.now();if(s-r>=e)return r=s,t.apply(this,n)}}o();o();function Vr(t){pe(t);let{fn:e,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:s=!1,signal:O}=t,y,S=O?new Promise((N,H)=>{let _=()=>H(zt());O.addEventListener("abort",_),y=()=>O.removeEventListener("abort",_)}):null;return new Promise((N,H)=>{(async()=>{for(let C=1;C<=r;C++){if(O?.aborted)return H(zt());try{let P=await Promise.race(S?[e(),S]:[e()]);return N(P)}catch(P){let m=s?n*2**(C-1):n;if(log("withRetry",`Attempt ${C}/${r} failed. Retrying in ${m}ms...`),P instanceof Error&&P.name==="AbortError"||C===r)return H(P);await new Promise(w=>setTimeout(w,m))}}})()}).finally(()=>y?.())}function pe(t){Q(t)||d("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&d("withRetry",'"fn" must be a function that returns a Promise'),!Y(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&d("withRetry",'"maxAttempts" must be a positive integer'),!Y(t.retryDelay)&&(!K(t.retryDelay)||t.retryDelay<0)&&d("withRetry",'"retryDelay" must be a non-negative number'),!Y(t.enableExponentialBackoff)&&!G(t.enableExponentialBackoff)&&d("withRetry",'"enableExponentialBackoff" must be a boolean'),!Y(t.signal)&&typeof t.signal!="object"&&d("withRetry",'"signal" must be an AbortSignal')}var de="The operation was aborted";function zt(t=de){let e=new Error(t);return e.name="AbortError",e}function Vt(t){it(t)||d("hasCircularReference",'"obj" must be a object');let e=new Set;function r(n){if(it(n)){if(e.has(n))return!0;e.add(n);for(let s of Object.keys(n))if(r(n[s]))return!0;e.delete(n)}return!1}return r(t)}o();o();function Bt(t,e,r={}){let{includeProto:n=!1,includeSymbols:s=!0,includeNonEnum:O=!1}=r,y={};return Q(t)&&ut(e).forEach(x=>{Yt(x)&&!s||!(n?x in t:Object.hasOwn(t,x))||!O&&(n?ge(t,x):Object.getOwnPropertyDescriptor(t,x))?.enumerable===!1||(y[x]=ct(t[x]))}),y}function ge(t,e){let r=t;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function On(t,e){if(!Q(t))return{};let r=ct(t),n=ut(e),s=Object.keys(r).filter(O=>!n.includes(O));return Bt(r,s)}o();o();o();o();o();function vn(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function kn(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Nn(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function Pn(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Yn(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}o();function Cn(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function Ln(t){return/^[1-9]\d*$/.test(t)}function Zt(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function Fn(t){return/^-[1-9]\d*$/.test(t)}function Hn(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}o();var Gt=dt($t(),1);function Qt(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Gt.default)(t,e,!0).isValid()}o();function Bn(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}o();function Qn(t){return t===""}o();var Rt=dt($t(),1);function to(t){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(t))return!1;let r=t.slice(6,14);return Qt(r,"YYYYMMDD")&&(0,Rt.default)(r,"YYYYMMDD").isBefore((0,Rt.default)())}o();function no(t){return/^1[3-9]\d{9}$/.test(t)}o();var ao=t=>{if(!st(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};o();function co(t){return/^https?:\/\/\S+$/i.test(t)}function jo(t,e){return(!K(t)||!Zt(t.toString()))&&d("generateRandomArray","num must be greater than 0"),ht(e)||d("generateRandomArray","cb must be a function"),Array.from({length:t},()=>e())}o();function ko(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}o();var mt=dt($t(),1),Jt=dt(Xt(),1);o();o();function X(t){return t[Math.floor(Math.random()*t.length)]}function q(t={}){K(t)&&(t={max:t});let{min:e=1,max:r=X(ye())}=t;he(e,r);let n=Math.ceil(e),s=Math.floor(r);return Math.floor(Math.random()*(s-n+1)+n)}function he(t,e){let r=Math.ceil(t),n=Math.floor(e);Number.isSafeInteger(r)||d("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(n)||d("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),n<r&&(e>=t&&d("getRandomInt",`No integer value found between ${t} and ${e}`),d("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function ye(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}mt.default.extend(Jt.default);function te(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,mt.default)().format(qt),format:n=qt}=t,s=(0,mt.default)(e),O=(0,mt.default)(r);(!s.isValid()||!O.isValid())&&d("generateRandomDate","start and end parameters must be valid date format"),s.isAfter(O)&&d("generateRandomDate","start date must be before end date");let y=s.valueOf(),S=O.valueOf(),x=q({min:y,max:S});return(0,mt.default)(x).format(n)}var qt="YYYY-MM-DD HH:mm:ss";o();o();function rt(t={}){let e=xe(t),r=$e(e);we(r);let{length:n}=e;Oe(n.min,n.max);let s=q(n),O=e.prefix||"";for(let y=0;y<s;y++)O+=r.charAt(Math.floor(Math.random()*r.length));return O+(e.suffix||"")}var be=16,vt=1;function xe(t){let e=K(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:K(t.length)?{max:t.length,min:t.length}:{max:be,min:vt,...t.length},extra:e?[]:[...new Set(ut(t.extra||[]))]}}function $e(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=ut(t.extra).join(""),e}function we(t){t.length===0&&d("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Oe(t,e){Number.isInteger(t)||d("getRandomString","min must be an integer"),Number.isInteger(e)||d("getRandomString","max must be an integer"),t<vt&&d("getRandomString",`Minimum length cannot be less than ${vt}`),e<t&&d("getRandomString","Maximum length cannot be less than minimum length")}function ri(){let t=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],e=q({min:5,max:10}),r=rt({length:e,lowerCase:!0,upperCase:!1,number:!0}),n=X(t);return`${r}@${n}`}o();function ai(t={}){K(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:n=2}=t;if((!K(e)||!K(r))&&d("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(n)||n<0)&&d("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),e===r)return Number(e.toFixed(n));e>r&&d("generateRandomFloat",`"max" (${r}) must be greater than "min" (${e})`);let s=Math.random()*(r-e)+e;return Number(s.toFixed(n))}o();o();function kt(t,e){(!K(t)||t<=0)&&d("generateRandomStringFromSource",'"num" must be greater than 0'),(!B(e)||e.length===0)&&d("generateRandomStringFromSource",'"source" must be a non-empty array');let r="";for(let n=0;n<t;n++)r+=X(e);return r}function bi(){let t=q({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,te({format:"YYYYMMDD"}),kt(3,e),kt(1,[...e,"X","x"])].join("")}o();function Mi(){return X(["13","14","15","16","17","18","19"])+q(999999999).toString().padEnd(9,"0")}o();function ji(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${rt({length:{min:4,max:8}})}`,`?id=${q()}`,`?page=${rt({length:{min:2,max:4}})}`,`?query=${rt({length:{min:5,max:6}})}`,`?search=${rt({length:{min:1,max:4}})}`,`?token=${rt({length:{min:16,max:16}})}`];return`${X(t)}${rt({length:{min:5,max:25}})}${X(e)}${X(r)}`}o();o();export{yt as UtilsError,nr as base64Decode,rr as base64Encode,ut as castArray,sr as compose,ar as composeRight,cr as debounce,Or as debugWarn,er as decimalToBinary,ct as deepClone,br as deepMerge,jo as generateRandomArray,ko as generateRandomColor,te as generateRandomDate,ri as generateRandomEmail,ai as generateRandomFloat,bi as generateRandomIdCard,Mi as generateRandomMobilePhone,kt as generateRandomStringFromSource,q as getRandomInt,X as getRandomItem,rt as getRandomString,ji as getRandomUrl,_e as hasChanged,Vt as hasCircularReference,B as isArray,G as isBoolean,Ct as isDate,Qt as isDateString,Ie as isDef,Bn as isEmail,Qn as isEmptyString,vn as isFloat,ht as isFunction,to as isIdCard,Cn as isInteger,It as isMap,no as isMobilePhone,Pn as isNegativeFloat,Fn as isNegativeInteger,Ht as isNil,Nn as isNonNegativeFloat,Zt as isNonNegativeInteger,Yn as isNonPositiveFloat,Hn as isNonPositiveInteger,St as isNull,K as isNumber,it as isObject,gt as isObjectLike,Q as isPlainObject,kn as isPositiveFloat,Ln as isPositiveInteger,Ft as isPromise,Lt as isRegExp,_t as isSet,st as isString,ao as isStringNumber,Yt as isSymbol,co as isURL,Y as isUndef,fe as objectToString,On as omit,Bt as pick,le as qs,jr as qsStringify,_r as throttle,d as throwError,ft as toTypeString,Ye as toTypeValue,Vr as withRetry};
|
|
@@ -236,7 +236,7 @@ declare const hasChanged: (oldValue: unknown, newValue: unknown) => boolean;
|
|
|
236
236
|
*
|
|
237
237
|
* @returns True if the object contains circular references, false otherwise
|
|
238
238
|
*
|
|
239
|
-
* @throws
|
|
239
|
+
* @throws When `obj` is not an object
|
|
240
240
|
*/
|
|
241
241
|
declare function hasCircularReference(obj: AnyObject): boolean;
|
|
242
242
|
|
|
@@ -295,14 +295,14 @@ interface PickOptions {
|
|
|
295
295
|
* independently for each element, allowing for dynamic generation of array contents.
|
|
296
296
|
*
|
|
297
297
|
* @example
|
|
298
|
-
* generateRandomArray(4, () => 1)
|
|
298
|
+
* generateRandomArray(4, () => 1) // => [1, 1, 1, 1]
|
|
299
299
|
* generateRandomArray(3, () => Math.random()) // => [0.123, 0.456, 0.789]
|
|
300
|
-
* generateRandomArray(2, () => new Date())
|
|
300
|
+
* generateRandomArray(2, () => new Date()) // => [Date, Date]
|
|
301
301
|
*
|
|
302
302
|
* @returns Returns an array of length `num` with elements created by calling `cb`
|
|
303
303
|
*
|
|
304
|
-
* @throws
|
|
305
|
-
* @throws
|
|
304
|
+
* @throws When `num` is not a non-negative integer
|
|
305
|
+
* @throws When `cb` is not a function
|
|
306
306
|
*/
|
|
307
307
|
declare function generateRandomArray<T>(num: number, cb: () => T): T[];
|
|
308
308
|
|
|
@@ -325,31 +325,53 @@ declare function generateRandomColor(): string;
|
|
|
325
325
|
* Generates a random date within a specified time range.
|
|
326
326
|
*
|
|
327
327
|
* This utility creates random dates between start and end boundaries with customizable
|
|
328
|
-
* date formatting. It
|
|
329
|
-
*
|
|
328
|
+
* date formatting. It uses a more reliable approach by generating a random timestamp
|
|
329
|
+
* within the valid range to avoid invalid date issues.
|
|
330
330
|
*
|
|
331
331
|
* @example
|
|
332
332
|
* generateRandomDate() // => '2021-07-01 08:51:34'
|
|
333
333
|
* generateRandomDate({ start: '2020-01-01' }) // => '2022-03-15 14:23:45'
|
|
334
334
|
* generateRandomDate({ format: 'YYYY-MM-DD' }) // => '2021-11-28'
|
|
335
|
+
* generateRandomDate({ start: '2023-01-01', end: '2023-12-31', format: 'MM/DD/YYYY' }) // => '07/15/2023'
|
|
335
336
|
*
|
|
336
337
|
* @returns Returns a randomly generated date string in the specified format
|
|
338
|
+
*
|
|
339
|
+
* @throws When `start` or `end` dates are invalid
|
|
340
|
+
* @throws When `start` date is after `end` date
|
|
337
341
|
*/
|
|
338
|
-
declare function generateRandomDate(options?:
|
|
339
|
-
interface
|
|
342
|
+
declare function generateRandomDate(options?: GenerateRandomDateOptions): string;
|
|
343
|
+
interface GenerateRandomDateOptions {
|
|
340
344
|
/**
|
|
341
|
-
*
|
|
342
|
-
*
|
|
345
|
+
* The start boundary for the random date generation.
|
|
346
|
+
*
|
|
347
|
+
* Accepts either a date string in a valid format that dayjs can parse,
|
|
348
|
+
* or a JavaScript Date object. The generated date will be equal to or after this date.
|
|
349
|
+
* Must be a valid date and should be before the end date.
|
|
350
|
+
*
|
|
351
|
+
* @default '1800-01-01 00:00:00'
|
|
343
352
|
*/
|
|
344
353
|
start?: string | Date;
|
|
345
354
|
/**
|
|
346
|
-
*
|
|
347
|
-
*
|
|
355
|
+
* The end boundary for the random date generation.
|
|
356
|
+
*
|
|
357
|
+
* Accepts either a date string in a valid format that dayjs can parse,
|
|
358
|
+
* or a JavaScript Date object. The generated date will be equal to or before this date.
|
|
359
|
+
* Must be a valid date and should be after the start date.
|
|
360
|
+
*
|
|
361
|
+
* @default Current date and time in 'YYYY-MM-DD HH:mm:ss' format
|
|
348
362
|
*/
|
|
349
363
|
end?: string | Date;
|
|
350
364
|
/**
|
|
351
|
-
*
|
|
352
|
-
*
|
|
365
|
+
* The output format for the generated date string.
|
|
366
|
+
*
|
|
367
|
+
* Uses dayjs format tokens. Common formats include:
|
|
368
|
+
* - 'YYYY-MM-DD' for date only (e.g., '2023-12-25')
|
|
369
|
+
* - 'YYYY-MM-DD HH:mm:ss' for date and time (e.g., '2023-12-25 14:30:45')
|
|
370
|
+
* - 'MM/DD/YYYY' for US date format (e.g., '12/25/2023')
|
|
371
|
+
* - 'DD-MM-YYYY HH:mm' for European format (e.g., '25-12-2023 14:30')
|
|
372
|
+
*
|
|
373
|
+
* @default 'YYYY-MM-DD HH:mm:ss'
|
|
374
|
+
* @see https://day.js.org/docs/en/display/format for all available format tokens
|
|
353
375
|
*/
|
|
354
376
|
format?: string;
|
|
355
377
|
}
|
|
@@ -358,13 +380,13 @@ interface GenerateRandomDate {
|
|
|
358
380
|
* Generates a random email address with realistic formatting.
|
|
359
381
|
*
|
|
360
382
|
* This utility creates random email addresses using common email providers
|
|
361
|
-
* and ensures proper email format
|
|
362
|
-
*
|
|
383
|
+
* and ensures proper email format. The generated emails have random usernames
|
|
384
|
+
* with reasonable length and are selected from a pool of realistic domains.
|
|
363
385
|
*
|
|
364
386
|
* @example
|
|
365
|
-
* generateRandomEmail()
|
|
366
|
-
* generateRandomEmail()
|
|
367
|
-
* generateRandomEmail()
|
|
387
|
+
* generateRandomEmail() // => 'abc123@gmail.com'
|
|
388
|
+
* generateRandomEmail() // => 'user456@qq.com'
|
|
389
|
+
* generateRandomEmail() // => 'test789@outlook.com'
|
|
368
390
|
*
|
|
369
391
|
* @returns Returns a randomly generated email address string
|
|
370
392
|
*/
|
|
@@ -378,27 +400,44 @@ declare function generateRandomEmail(): string;
|
|
|
378
400
|
* or a configuration object with detailed range and precision settings.
|
|
379
401
|
*
|
|
380
402
|
* @example
|
|
381
|
-
* generateRandomFloat()
|
|
382
|
-
* generateRandomFloat(10)
|
|
383
|
-
* generateRandomFloat({ min: 1, max: 5 })
|
|
403
|
+
* generateRandomFloat() // => 0.35
|
|
404
|
+
* generateRandomFloat(10) // => 7.23 (between 0 and 10)
|
|
405
|
+
* generateRandomFloat({ min: 1, max: 5 }) // => 3.47 (between 1 and 5)
|
|
406
|
+
* generateRandomFloat({ min: 0, max: 1, fractionDigits: 4 }) // => 0.3456
|
|
384
407
|
*
|
|
408
|
+
* @param options - Configuration options or maximum value
|
|
385
409
|
* @returns Returns a random floating-point number within the specified range
|
|
410
|
+
*
|
|
411
|
+
* @throws When min is greater than max
|
|
412
|
+
* @throws When fractionDigits is not a valid integer
|
|
386
413
|
*/
|
|
387
|
-
declare function generateRandomFloat(options?:
|
|
388
|
-
type
|
|
414
|
+
declare function generateRandomFloat(options?: GenerateRandomFloatOptions): number;
|
|
415
|
+
type GenerateRandomFloatOptions = number | {
|
|
389
416
|
/**
|
|
390
|
-
* Maximum value
|
|
391
|
-
*
|
|
417
|
+
* Maximum value (inclusive).
|
|
418
|
+
*
|
|
419
|
+
* The generated number will be less than or equal to this value.
|
|
420
|
+
* Must be greater than the minimum value.
|
|
421
|
+
*
|
|
422
|
+
* @default 1
|
|
392
423
|
*/
|
|
393
424
|
max?: number;
|
|
394
425
|
/**
|
|
395
|
-
* Minimum value
|
|
396
|
-
*
|
|
426
|
+
* Minimum value (inclusive).
|
|
427
|
+
*
|
|
428
|
+
* The generated number will be greater than or equal to this value.
|
|
429
|
+
* Must be less than the maximum value.
|
|
430
|
+
*
|
|
431
|
+
* @default 0
|
|
397
432
|
*/
|
|
398
433
|
min?: number;
|
|
399
434
|
/**
|
|
400
|
-
*
|
|
401
|
-
*
|
|
435
|
+
* Number of digits after the decimal point.
|
|
436
|
+
*
|
|
437
|
+
* Controls the precision of the generated floating-point number.
|
|
438
|
+
* Must be a non-negative integer. A value of 0 will return integers.
|
|
439
|
+
*
|
|
440
|
+
* @default 2
|
|
402
441
|
*/
|
|
403
442
|
fractionDigits?: number;
|
|
404
443
|
};
|
|
@@ -444,12 +483,12 @@ declare function generateRandomMobilePhone(): string;
|
|
|
444
483
|
*
|
|
445
484
|
* @example
|
|
446
485
|
* generateRandomStringFromSource(4, ['1', 'b', 'c', 'd', 'e']) // => 'dea1'
|
|
447
|
-
* generateRandomStringFromSource(6, ['a', 'b', 'c']) // => '
|
|
486
|
+
* generateRandomStringFromSource(6, ['a', 'b', 'c']) // => 'abccaa'
|
|
448
487
|
*
|
|
449
488
|
* @returns Returns a string composed of randomly selected characters from the source
|
|
450
489
|
*
|
|
451
|
-
* @throws
|
|
452
|
-
* @throws
|
|
490
|
+
* @throws When `num` is not greater than 0
|
|
491
|
+
* @throws When `source` is not a non-empty array
|
|
453
492
|
*/
|
|
454
493
|
declare function generateRandomStringFromSource(num: number, source: (number | string)[]): string;
|
|
455
494
|
|
|
@@ -830,18 +869,18 @@ declare global {
|
|
|
830
869
|
*
|
|
831
870
|
* @returns A URL-encoded query string representation of the input object
|
|
832
871
|
*
|
|
833
|
-
* @throws
|
|
834
|
-
* @throws
|
|
835
|
-
* @throws
|
|
836
|
-
* @throws
|
|
837
|
-
* @throws
|
|
838
|
-
* @throws
|
|
839
|
-
* @throws
|
|
840
|
-
* @throws
|
|
841
|
-
* @throws
|
|
842
|
-
* @throws
|
|
843
|
-
* @throws
|
|
844
|
-
* @throws
|
|
872
|
+
* @throws When `options` is not a plain object
|
|
873
|
+
* @throws When `encode` is not a boolean
|
|
874
|
+
* @throws When `encodeValuesOnly` is not a boolean
|
|
875
|
+
* @throws When `arrayFormat` is not one of: "indices", "brackets", "repeat", "comma"
|
|
876
|
+
* @throws When `allowDots` is not a boolean
|
|
877
|
+
* @throws When `skipNulls` is not a boolean
|
|
878
|
+
* @throws When `strictNullHandling` is not a boolean
|
|
879
|
+
* @throws When `addQueryPrefix` is not a boolean
|
|
880
|
+
* @throws When `delimiter` is not a string
|
|
881
|
+
* @throws When `encodeDotInKeys` is not a boolean
|
|
882
|
+
* @throws When `commaRoundTrip` is not a boolean
|
|
883
|
+
* @throws When `allowEmptyArrays` is not a boolean
|
|
845
884
|
*/
|
|
846
885
|
declare function qsStringify(obj: AnyObject, options?: StringifyOptions): string;
|
|
847
886
|
interface StringifyOptions {
|
|
@@ -972,7 +1011,7 @@ declare const qs: {
|
|
|
972
1011
|
*
|
|
973
1012
|
* @returns A URL-encoded query string
|
|
974
1013
|
*
|
|
975
|
-
* @throws
|
|
1014
|
+
* @throws When `obj` is not an object
|
|
976
1015
|
*/
|
|
977
1016
|
stringify: (obj: AnyObject) => string;
|
|
978
1017
|
/**
|
|
@@ -995,7 +1034,7 @@ declare const qs: {
|
|
|
995
1034
|
*
|
|
996
1035
|
* @returns A plain object containing the parsed key-value pairs as strings
|
|
997
1036
|
*
|
|
998
|
-
* @throws
|
|
1037
|
+
* @throws When `str` is not a string
|
|
999
1038
|
*/
|
|
1000
1039
|
parse: (str: string) => {
|
|
1001
1040
|
[k: string]: string;
|
|
@@ -1022,8 +1061,8 @@ declare const qs: {
|
|
|
1022
1061
|
*
|
|
1023
1062
|
* @returns The complete URL with appended query parameters
|
|
1024
1063
|
*
|
|
1025
|
-
* @throws
|
|
1026
|
-
* @throws
|
|
1064
|
+
* @throws When `url` is not a string
|
|
1065
|
+
* @throws When `obj` is not an object
|
|
1027
1066
|
*/
|
|
1028
1067
|
appendQueryString: (url: string, obj: AnyObject) => string;
|
|
1029
1068
|
};
|
|
@@ -1075,14 +1114,14 @@ declare function throttle(target: Function, wait?: number): (...args: any[]) =>
|
|
|
1075
1114
|
*
|
|
1076
1115
|
* @returns Promise that resolves with the result of the successful function execution
|
|
1077
1116
|
*
|
|
1078
|
-
* @throws
|
|
1079
|
-
* @throws
|
|
1080
|
-
* @throws
|
|
1081
|
-
* @throws
|
|
1082
|
-
* @throws
|
|
1083
|
-
* @throws
|
|
1084
|
-
* @throws
|
|
1085
|
-
* @throws
|
|
1117
|
+
* @throws When `options` is not a plain object
|
|
1118
|
+
* @throws When `fn` is not a function that returns a Promise
|
|
1119
|
+
* @throws When `maxAttempts` is not a positive integer
|
|
1120
|
+
* @throws When `retryDelay` is not a non-negative number
|
|
1121
|
+
* @throws When `enableExponentialBackoff` is not a boolean
|
|
1122
|
+
* @throws When `signal` is not an AbortSignal object
|
|
1123
|
+
* @throws "Operation Cancelled" when the operation is aborted via AbortSignal
|
|
1124
|
+
* @throws The original error from `fn` when all retry attempts are exhausted
|
|
1086
1125
|
*/
|
|
1087
1126
|
declare function withRetry<T>(options: WithRetryOptions<T>): Promise<T>;
|
|
1088
1127
|
interface WithRetryOptions<T> {
|
|
@@ -1477,4 +1516,4 @@ declare const isStringNumber: (val: string) => boolean;
|
|
|
1477
1516
|
*/
|
|
1478
1517
|
declare function isURL(val: string): boolean;
|
|
1479
1518
|
|
|
1480
|
-
export { type AnyObject, type ArrayItem, type Arrayable, type DeepMergeOptions, type PlainObject, type StringNumber, type StringifyOptions, UtilsError, type WithRetryOptions, base64Decode, base64Encode, castArray, compose, composeRight, debounce, debugWarn, decimalToBinary, deepClone, deepMerge, generateRandomArray, generateRandomColor, generateRandomDate, generateRandomEmail, generateRandomFloat, generateRandomIdCard, generateRandomMobilePhone, generateRandomStringFromSource, getRandomInt, getRandomItem, getRandomString, getRandomUrl, hasChanged, hasCircularReference, isArray, isBoolean, isDate, isDateString, isDef, isEmail, isEmptyString, isFloat, isFunction, isIdCard, isInteger, isMap, isMobilePhone, isNegativeFloat, isNegativeInteger, isNil, isNonNegativeFloat, isNonNegativeInteger, isNonPositiveFloat, isNonPositiveInteger, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPositiveFloat, isPositiveInteger, isPromise, isRegExp, isSet, isString, isStringNumber, isSymbol, isURL, isUndef, objectToString, omit, pick, qs, qsStringify, throttle, throwError, toTypeString, toTypeValue, withRetry };
|
|
1519
|
+
export { type AnyObject, type ArrayItem, type Arrayable, type DeepMergeOptions, type GenerateRandomDateOptions, type GenerateRandomFloatOptions, type PlainObject, type StringNumber, type StringifyOptions, UtilsError, type WithRetryOptions, base64Decode, base64Encode, castArray, compose, composeRight, debounce, debugWarn, decimalToBinary, deepClone, deepMerge, generateRandomArray, generateRandomColor, generateRandomDate, generateRandomEmail, generateRandomFloat, generateRandomIdCard, generateRandomMobilePhone, generateRandomStringFromSource, getRandomInt, getRandomItem, getRandomString, getRandomUrl, hasChanged, hasCircularReference, isArray, isBoolean, isDate, isDateString, isDef, isEmail, isEmptyString, isFloat, isFunction, isIdCard, isInteger, isMap, isMobilePhone, isNegativeFloat, isNegativeInteger, isNil, isNonNegativeFloat, isNonNegativeInteger, isNonPositiveFloat, isNonPositiveInteger, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPositiveFloat, isPositiveInteger, isPromise, isRegExp, isSet, isString, isStringNumber, isSymbol, isURL, isUndef, objectToString, omit, pick, qs, qsStringify, throttle, throwError, toTypeString, toTypeValue, withRetry };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* @ts-self-types="./esm-bundler.d.ts" */
|
|
2
|
-
function D(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function _(e){return e!==null&&typeof e=="object"}var ue=Object.prototype.toString,k=e=>ue.call(e),Ie=e=>k(e).slice(8,-1),M=e=>typeof e=="string",x=e=>typeof e=="number"&&Number.isFinite(e),w=e=>typeof e=="boolean",W=e=>e===null,u=e=>e===void 0,q=e=>typeof e=="symbol",y=Array.isArray,L=e=>typeof e=="function",Q=e=>k(e)==="[object Map]",X=e=>k(e)==="[object Set]",J=e=>k(e)==="[object Date]",Z=e=>k(e)==="[object RegExp]",ee=e=>_(e)&&L(e?.then)&&L(e?.catch),te=e=>e==null,Ce=e=>e!=null,Fe=(e,t)=>e!==t;function O(e){return k(e)==="[object Object]"}function I(e){return y(e)?e:[e]}function et(e){let t=[],r,n="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)n+=t.pop().toString();return n}var re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function tt(e){let t="",r="";for(let a=0;a<e.length;a++)r+=e[a].charCodeAt(0).toString(2).padStart(8,"0");for(let a=0;a<r.length;a+=6)t+=re[Number.parseInt(r.slice(a,a+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function rt(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=re.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let a=Number.parseInt(r.slice(n,n+8),2);a&&(t+=String.fromCharCode(a))}return t}function it(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function at(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function ft(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function F(e){let t=new WeakMap;function r(n){if(!_(n))return n;if(J(n))return new Date(n);if(Z(n))return new RegExp(n);if(ee(n))return n;if(t.has(n))return t.get(n);if(Q(n)){let m=new Map;return t.set(n,m),n.forEach((p,d)=>m.set(r(d),r(p))),m}if(X(n)){let m=new Set;return t.set(n,m),n.forEach(p=>m.add(r(p))),m}let a=y(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,a);let c=Object.getOwnPropertyDescriptors(n);for(let m of Reflect.ownKeys(c)){let p=c[m];p.get||p.set?Object.defineProperty(a,m,p):Object.defineProperty(a,m,{...p,value:r(p.value)})}return a}return r(e)}function yt(e,t,r={}){return oe(ne(e,r),ne(t,r),r)}function oe(e,t,r){return y(e)?le(e,t,r):pe(e,t,r)}function pe(e,t,r){if(!O(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(a=>{(O(e[a])||y(e[a]))&&(O(t[a])||y(t[a]))?e[a]=oe(e[a],t[a],r):Object.defineProperty(e,a,n[a])}),e}function le(e,t,r){let{mergeStrategy:n="replace"}=r;if(y(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function ne(e,t){let{deepClone:r=!0}=t;return r?F(e):e}var U=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function s(e,t){throw new U(`[${e}] ${t}`)}function Ot(e,t){let r=M(e)?new U(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var B=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},H=(e,...t)=>{B("info",e,...t)};H.info=(e,...t)=>{B("info",e,...t)};H.error=(e,...t)=>{B("error",e,...t)};H.warn=(e,...t)=>{B("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=H);function Et(e,t={}){ge(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:a="indices",encodeDotInKeys:c=!1,skipNulls:m=!1,strictNullHandling:p=!1,commaRoundTrip:d=!1,allowEmptyArrays:N=!1,addQueryPrefix:S=!1,delimiter:P="&"}=t,h=t.allowDots??!1;c&&u(t.allowDots)&&(h=!0);let b=[],$=f=>r&&!n?encodeURIComponent(f):f,Y=f=>r?encodeURIComponent(f):f;function K(f,l){if(!u(l)){if(W(l)){if(m)return;b.push(`${$(f)}${p?"":"="}`);return}if(y(l)){if(l.length===0){N&&b.push(`${$(f)}[]`);return}if(a==="comma"){let T=n?l.map(Y).join(","):Y(l.join(","));if(l.length===1&&W(l[0])){if(m)return;b.push(`${$(f)}${d?"[]":""}${p?"":"="}`)}else l.length===1?b.push(`${$(f)}${d?"[]":""}=${T}`):b.push(`${$(f)}=${T}`);return}l.forEach((T,C)=>{let E=f;a==="indices"?E=`${f}[${C}]`:a==="brackets"&&(E=`${f}[]`),K(E,T)});return}if(D(l)){Object.keys(l).forEach(T=>{let C=f;c&&(C=C.replace(/\./g,"%2E"));let E=T;h?(c&&(E=E.replace(/\./g,"%2E")),K(`${C}.${E}`,l[T])):K(`${C}[${E}]`,l[T])});return}b.push(`${$(f)}=${Y(l)}`)}}if(!D(e))return"";ie(e)&&s("stringify","Input object contains circular references, cannot stringify"),y(e)?e.forEach((f,l)=>K(`${l}`,f)):Object.keys(e).forEach(f=>K(f,e[f]));let V=b.join(P);return S&&V?`?${V}`:V}function ge(e={}){O(e)||s("stringify",'"options" must be a plain object'),!u(e.encode)&&!w(e.encode)&&s("stringify",'"encode" must be a boolean'),!u(e.encodeValuesOnly)&&!w(e.encodeValuesOnly)&&s("stringify",'"encodeValuesOnly" must be a boolean'),!u(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&s("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!u(e.allowDots)&&!w(e.allowDots)&&s("stringify",'"allowDots" must be a boolean'),!u(e.skipNulls)&&!w(e.skipNulls)&&s("stringify",'"skipNulls" must be a boolean'),!u(e.strictNullHandling)&&!w(e.strictNullHandling)&&s("stringify",'"strictNullHandling" must be a boolean'),!u(e.addQueryPrefix)&&!w(e.addQueryPrefix)&&s("stringify",'"addQueryPrefix" must be a boolean'),!u(e.delimiter)&&!M(e.delimiter)&&s("stringify",'"delimiter" must be a string'),!u(e.encodeDotInKeys)&&!w(e.encodeDotInKeys)&&s("stringify",'"encodeDotInKeys" must be a boolean'),!u(e.commaRoundTrip)&&!w(e.commaRoundTrip)&&s("stringify",'"commaRoundTrip" must be a boolean'),!u(e.allowEmptyArrays)&&!w(e.allowEmptyArrays)&&s("stringify",'"allowEmptyArrays" must be a boolean')}var de={stringify:e=>(D(e)||s("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(M(e)||s("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=de.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Ft(e,t=500){let r=null;return function(...n){if(te(r))return r=Date.now(),e.apply(this,n);let a=Date.now();if(a-r>=t)return r=a,e.apply(this,n)}}function Vt(e){be(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:a=!1,signal:c}=e,m,p=c?new Promise((N,S)=>{let P=()=>S(ae());c.addEventListener("abort",P),m=()=>c.removeEventListener("abort",P)}):null;return new Promise((N,S)=>{(async()=>{for(let h=1;h<=r;h++){if(c?.aborted)return S(ae());try{let b=await Promise.race(p?[t(),p]:[t()]);return N(b)}catch(b){let $=a?n*2**(h-1):n;if(log("withRetry",`Attempt ${h}/${r} failed. Retrying in ${$}ms...`),b instanceof Error&&b.name==="AbortError"||h===r)return S(b);await new Promise(Y=>setTimeout(Y,$))}}})()}).finally(()=>m?.())}function be(e){O(e)||s("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&s("withRetry",'"fn" must be a function that returns a Promise'),!u(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&s("withRetry",'"maxAttempts" must be a positive integer'),!u(e.retryDelay)&&(!x(e.retryDelay)||e.retryDelay<0)&&s("withRetry",'"retryDelay" must be a non-negative number'),!u(e.enableExponentialBackoff)&&!w(e.enableExponentialBackoff)&&s("withRetry",'"enableExponentialBackoff" must be a boolean'),!u(e.signal)&&typeof e.signal!="object"&&s("withRetry",'"signal" must be an AbortSignal')}var ye="The operation was aborted";function ae(e=ye){let t=new Error(e);return t.name="AbortError",t}function ie(e){D(e)||s("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if(D(n)){if(t.has(n))return!0;t.add(n);for(let a of Object.keys(n))if(r(n[a]))return!0;t.delete(n)}return!1}return r(e)}function se(e,t,r={}){let{includeProto:n=!1,includeSymbols:a=!0,includeNonEnum:c=!1}=r,m={};return O(e)&&I(t).forEach(d=>{q(d)&&!a||!(n?d in e:Object.hasOwn(e,d))||!c&&(n?xe(e,d):Object.getOwnPropertyDescriptor(e,d))?.enumerable===!1||(m[d]=F(e[d]))}),m}function xe(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function wr(e,t){if(!O(e))return{};let r=F(e),n=I(t),a=Object.keys(r).filter(c=>!n.includes(c));return se(r,a)}function Dr(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function Mr(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Nr(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function Pr(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function kr(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Fr(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Yr(e){return/^[1-9]\d*$/.test(e)}function me(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Kr(e){return/^-[1-9]\d*$/.test(e)}function _r(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}import he from"dayjs";function fe(e,t="YYYY-MM-DD HH:mm:ss"){return he(e,t,!0).isValid()}function Wr(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function zr(e){return e===""}import ce from"dayjs";function Zr(e){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(e))return!1;let r=e.slice(6,14);return fe(r,"YYYYMMDD")&&ce(r,"YYYYMMDD").isBefore(ce())}function rn(e){return/^1[3-9]\d{9}$/.test(e)}var sn=e=>{if(!M(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function cn(e){return/^https?:\/\/\S+$/i.test(e)}function En(e,t){return(!x(e)||!me(e.toString()))&&s("generateRandomArray","num must be greater than 0"),L(t)||s("generateRandomArray","cb must be a function"),Array.from({length:e},()=>t())}function Nn(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}import j from"dayjs";import Re from"dayjs/plugin/customParseFormat.js";function R(e){return e[Math.floor(Math.random()*e.length)]}function g(e={}){x(e)&&(e={max:e});let{min:t=1,max:r=R(Oe())}=e;we(t,r);let n=Math.ceil(t),a=Math.floor(r);return Math.floor(Math.random()*(a-n+1)+n)}function we(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||s("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||s("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&s("getRandomInt",`No integer value found between ${e} and ${t}`),s("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function Oe(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}j.extend(Re);function G(e={}){let{start:t="1800-01-01 00:00:00",end:r=j().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!j(t).isValid()||!j(r).isValid())&&s("generateRandomDate","start and end parameters must be valid date format");let a=j(t).year(),c=j(r).year(),m=g({min:a,max:c}),p=g({min:1,max:12}),d=g({min:1,max:31}),N=g(23),S=g(59),P=g(59),h=j(`${m}-${p}-${d} ${N}:${S}:${P}`);return h.isBefore(j(t))||h.isAfter(j(r))?G(e):h.format(n)}function A(e={}){let t=Se(e),r=$e(t);je(r);let{length:n}=t;Te(n.min,n.max);let a=g(n),c=t.prefix||"";for(let m=0;m<a;m++)c+=r.charAt(Math.floor(Math.random()*r.length));return c+(t.suffix||"")}var Ae=16,v=1;function Se(e){let t=x(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:x(e.length)?{max:e.length,min:e.length}:{max:Ae,min:v,...e.length},extra:t?[]:[...new Set(I(e.extra||[]))]}}function $e(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=I(e.extra).join(""),t}function je(e){e.length===0&&s("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Te(e,t){Number.isInteger(e)||s("getRandomString","min must be an integer"),Number.isInteger(t)||s("getRandomString","max must be an integer"),e<v&&s("getRandomString",`Minimum length cannot be less than ${v}`),t<e&&s("getRandomString","Maximum length cannot be less than minimum length")}function Ee(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${A(1)}${A({length:g({max:30,min:1})})}${A(1)}@${R(e)}`;return/\.{2,}/.test(t)?Ee():t}function io(e={}){x(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if(t===r)return t;if(t>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${t}`);let a=Math.random()*(r-t)+t;return Number(a.toFixed(n))}function z(e,t){(!x(e)||e<=0)&&s("generateRandomStringFromSource","num must be greater than 0"),(!y(t)||t.length===0)&&s("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<e;n++)r+=R(t);return r}function yo(){let e=g({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,G({format:"YYYYMMDD"}),z(3,t),z(1,[...t,"X","x"])].join("")}function Ro(){return R(["13","14","15","16","17","18","19"])+g(999999999).toString().padEnd(9,"0")}function Eo(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${A({length:{min:4,max:8}})}`,`?id=${g()}`,`?page=${A({length:{min:2,max:4}})}`,`?query=${A({length:{min:5,max:6}})}`,`?search=${A({length:{min:1,max:4}})}`,`?token=${A({length:{min:16,max:16}})}`];return`${R(e)}${A({length:{min:5,max:25}})}${R(t)}${R(r)}`}export{U as UtilsError,rt as base64Decode,tt as base64Encode,I as castArray,it as compose,at as composeRight,ft as debounce,Ot as debugWarn,et as decimalToBinary,F as deepClone,yt as deepMerge,En as generateRandomArray,Nn as generateRandomColor,G as generateRandomDate,Ee as generateRandomEmail,io as generateRandomFloat,yo as generateRandomIdCard,Ro as generateRandomMobilePhone,z as generateRandomStringFromSource,g as getRandomInt,R as getRandomItem,A as getRandomString,Eo as getRandomUrl,Fe as hasChanged,ie as hasCircularReference,y as isArray,w as isBoolean,J as isDate,fe as isDateString,Ce as isDef,Wr as isEmail,zr as isEmptyString,Dr as isFloat,L as isFunction,Zr as isIdCard,Fr as isInteger,Q as isMap,rn as isMobilePhone,Pr as isNegativeFloat,Kr as isNegativeInteger,te as isNil,Nr as isNonNegativeFloat,me as isNonNegativeInteger,kr as isNonPositiveFloat,_r as isNonPositiveInteger,W as isNull,x as isNumber,D as isObject,_ as isObjectLike,O as isPlainObject,Mr as isPositiveFloat,Yr as isPositiveInteger,ee as isPromise,Z as isRegExp,X as isSet,M as isString,sn as isStringNumber,q as isSymbol,cn as isURL,u as isUndef,ue as objectToString,wr as omit,se as pick,de as qs,Et as qsStringify,Ft as throttle,s as throwError,k as toTypeString,Ie as toTypeValue,Vt as withRetry};
|
|
2
|
+
function $(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function Y(e){return e!==null&&typeof e=="object"}var pe=Object.prototype.toString,N=e=>pe.call(e),ke=e=>N(e).slice(8,-1),D=e=>typeof e=="string",d=e=>typeof e=="number"&&Number.isFinite(e),x=e=>typeof e=="boolean",W=e=>e===null,u=e=>e===void 0,z=e=>typeof e=="symbol",y=Array.isArray,L=e=>typeof e=="function",q=e=>N(e)==="[object Map]",Q=e=>N(e)==="[object Set]",X=e=>N(e)==="[object Date]",J=e=>N(e)==="[object RegExp]",Z=e=>Y(e)&&L(e?.then)&&L(e?.catch),ee=e=>e==null,Fe=e=>e!=null,Ce=(e,t)=>e!==t;function h(e){return N(e)==="[object Object]"}function M(e){return y(e)?e:[e]}function et(e){let t=[],r,n="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)n+=t.pop().toString();return n}var te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function tt(e){let t="",r="";for(let o=0;o<e.length;o++)r+=e[o].charCodeAt(0).toString(2).padStart(8,"0");for(let o=0;o<r.length;o+=6)t+=te[Number.parseInt(r.slice(o,o+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function rt(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=te.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let o=Number.parseInt(r.slice(n,n+8),2);o&&(t+=String.fromCharCode(o))}return t}function it(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function at(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function ft(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function I(e){let t=new WeakMap;function r(n){if(!Y(n))return n;if(X(n))return new Date(n);if(J(n))return new RegExp(n);if(Z(n))return n;if(t.has(n))return t.get(n);if(q(n)){let m=new Map;return t.set(n,m),n.forEach((p,g)=>m.set(r(g),r(p))),m}if(Q(n)){let m=new Set;return t.set(n,m),n.forEach(p=>m.add(r(p))),m}let o=y(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let f=Object.getOwnPropertyDescriptors(n);for(let m of Reflect.ownKeys(f)){let p=f[m];p.get||p.set?Object.defineProperty(o,m,p):Object.defineProperty(o,m,{...p,value:r(p.value)})}return o}return r(e)}function yt(e,t,r={}){return ne(re(e,r),re(t,r),r)}function ne(e,t,r){return y(e)?ge(e,t,r):le(e,t,r)}function le(e,t,r){if(!h(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(h(e[o])||y(e[o]))&&(h(t[o])||y(t[o]))?e[o]=ne(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function ge(e,t,r){let{mergeStrategy:n="replace"}=r;if(y(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function re(e,t){let{deepClone:r=!0}=t;return r?I(e):e}var U=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function s(e,t){throw new U(`[${e}] ${t}`)}function wt(e,t){let r=D(e)?new U(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var B=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},V=(e,...t)=>{B("info",e,...t)};V.info=(e,...t)=>{B("info",e,...t)};V.error=(e,...t)=>{B("error",e,...t)};V.warn=(e,...t)=>{B("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=V);function $t(e,t={}){de(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:o="indices",encodeDotInKeys:f=!1,skipNulls:m=!1,strictNullHandling:p=!1,commaRoundTrip:g=!1,allowEmptyArrays:k=!1,addQueryPrefix:T=!1,delimiter:F="&"}=t,S=t.allowDots??!1;f&&u(t.allowDots)&&(S=!0);let b=[],R=c=>r&&!n?encodeURIComponent(c):c,C=c=>r?encodeURIComponent(c):c;function _(c,l){if(!u(l)){if(W(l)){if(m)return;b.push(`${R(c)}${p?"":"="}`);return}if(y(l)){if(l.length===0){k&&b.push(`${R(c)}[]`);return}if(o==="comma"){let j=n?l.map(C).join(","):C(l.join(","));if(l.length===1&&W(l[0])){if(m)return;b.push(`${R(c)}${g?"[]":""}${p?"":"="}`)}else l.length===1?b.push(`${R(c)}${g?"[]":""}=${j}`):b.push(`${R(c)}=${j}`);return}l.forEach((j,P)=>{let E=c;o==="indices"?E=`${c}[${P}]`:o==="brackets"&&(E=`${c}[]`),_(E,j)});return}if($(l)){Object.keys(l).forEach(j=>{let P=c;f&&(P=P.replace(/\./g,"%2E"));let E=j;S?(f&&(E=E.replace(/\./g,"%2E")),_(`${P}.${E}`,l[j])):_(`${P}[${E}]`,l[j])});return}b.push(`${R(c)}=${C(l)}`)}}if(!$(e))return"";oe(e)&&s("stringify","Input object contains circular references, cannot stringify"),y(e)?e.forEach((c,l)=>_(`${l}`,c)):Object.keys(e).forEach(c=>_(c,e[c]));let H=b.join(F);return T&&H?`?${H}`:H}function de(e={}){h(e)||s("stringify",'"options" must be a plain object'),!u(e.encode)&&!x(e.encode)&&s("stringify",'"encode" must be a boolean'),!u(e.encodeValuesOnly)&&!x(e.encodeValuesOnly)&&s("stringify",'"encodeValuesOnly" must be a boolean'),!u(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&s("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!u(e.allowDots)&&!x(e.allowDots)&&s("stringify",'"allowDots" must be a boolean'),!u(e.skipNulls)&&!x(e.skipNulls)&&s("stringify",'"skipNulls" must be a boolean'),!u(e.strictNullHandling)&&!x(e.strictNullHandling)&&s("stringify",'"strictNullHandling" must be a boolean'),!u(e.addQueryPrefix)&&!x(e.addQueryPrefix)&&s("stringify",'"addQueryPrefix" must be a boolean'),!u(e.delimiter)&&!D(e.delimiter)&&s("stringify",'"delimiter" must be a string'),!u(e.encodeDotInKeys)&&!x(e.encodeDotInKeys)&&s("stringify",'"encodeDotInKeys" must be a boolean'),!u(e.commaRoundTrip)&&!x(e.commaRoundTrip)&&s("stringify",'"commaRoundTrip" must be a boolean'),!u(e.allowEmptyArrays)&&!x(e.allowEmptyArrays)&&s("stringify",'"allowEmptyArrays" must be a boolean')}var be={stringify:e=>($(e)||s("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(D(e)||s("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=be.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Ct(e,t=500){let r=null;return function(...n){if(ee(r))return r=Date.now(),e.apply(this,n);let o=Date.now();if(o-r>=t)return r=o,e.apply(this,n)}}function Ht(e){ye(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:f}=e,m,p=f?new Promise((k,T)=>{let F=()=>T(ie());f.addEventListener("abort",F),m=()=>f.removeEventListener("abort",F)}):null;return new Promise((k,T)=>{(async()=>{for(let S=1;S<=r;S++){if(f?.aborted)return T(ie());try{let b=await Promise.race(p?[t(),p]:[t()]);return k(b)}catch(b){let R=o?n*2**(S-1):n;if(log("withRetry",`Attempt ${S}/${r} failed. Retrying in ${R}ms...`),b instanceof Error&&b.name==="AbortError"||S===r)return T(b);await new Promise(C=>setTimeout(C,R))}}})()}).finally(()=>m?.())}function ye(e){h(e)||s("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&s("withRetry",'"fn" must be a function that returns a Promise'),!u(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&s("withRetry",'"maxAttempts" must be a positive integer'),!u(e.retryDelay)&&(!d(e.retryDelay)||e.retryDelay<0)&&s("withRetry",'"retryDelay" must be a non-negative number'),!u(e.enableExponentialBackoff)&&!x(e.enableExponentialBackoff)&&s("withRetry",'"enableExponentialBackoff" must be a boolean'),!u(e.signal)&&typeof e.signal!="object"&&s("withRetry",'"signal" must be an AbortSignal')}var xe="The operation was aborted";function ie(e=xe){let t=new Error(e);return t.name="AbortError",t}function oe(e){$(e)||s("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if($(n)){if(t.has(n))return!0;t.add(n);for(let o of Object.keys(n))if(r(n[o]))return!0;t.delete(n)}return!1}return r(e)}function ae(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:f=!1}=r,m={};return h(e)&&M(t).forEach(g=>{z(g)&&!o||!(n?g in e:Object.hasOwn(e,g))||!f&&(n?he(e,g):Object.getOwnPropertyDescriptor(e,g))?.enumerable===!1||(m[g]=I(e[g]))}),m}function he(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Or(e,t){if(!h(e))return{};let r=I(e),n=M(t),o=Object.keys(r).filter(f=>!n.includes(f));return ae(r,o)}function Dr(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function Nr(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Mr(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function Pr(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Ir(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Cr(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function _r(e){return/^[1-9]\d*$/.test(e)}function se(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Kr(e){return/^-[1-9]\d*$/.test(e)}function Yr(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}import Oe from"dayjs";function me(e,t="YYYY-MM-DD HH:mm:ss"){return Oe(e,t,!0).isValid()}function Wr(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function zr(e){return e===""}import fe from"dayjs";function Zr(e){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(e))return!1;let r=e.slice(6,14);return me(r,"YYYYMMDD")&&fe(r,"YYYYMMDD").isBefore(fe())}function rn(e){return/^1[3-9]\d{9}$/.test(e)}var sn=e=>{if(!D(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function cn(e){return/^https?:\/\/\S+$/i.test(e)}function $n(e,t){return(!d(e)||!se(e.toString()))&&s("generateRandomArray","num must be greater than 0"),L(t)||s("generateRandomArray","cb must be a function"),Array.from({length:e},()=>t())}function Mn(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}import K from"dayjs";import Ae from"dayjs/plugin/customParseFormat.js";function O(e){return e[Math.floor(Math.random()*e.length)]}function w(e={}){d(e)&&(e={max:e});let{min:t=1,max:r=O(Re())}=e;we(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function we(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||s("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||s("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&s("getRandomInt",`No integer value found between ${e} and ${t}`),s("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function Re(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}K.extend(Ae);function ue(e={}){let{start:t="1800-01-01 00:00:00",end:r=K().format(ce),format:n=ce}=e,o=K(t),f=K(r);(!o.isValid()||!f.isValid())&&s("generateRandomDate","start and end parameters must be valid date format"),o.isAfter(f)&&s("generateRandomDate","start date must be before end date");let m=o.valueOf(),p=f.valueOf(),g=w({min:m,max:p});return K(g).format(n)}var ce="YYYY-MM-DD HH:mm:ss";function A(e={}){let t=Se(e),r=je(t);Ee(r);let{length:n}=t;$e(n.min,n.max);let o=w(n),f=t.prefix||"";for(let m=0;m<o;m++)f+=r.charAt(Math.floor(Math.random()*r.length));return f+(t.suffix||"")}var Te=16,G=1;function Se(e){let t=d(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:d(e.length)?{max:e.length,min:e.length}:{max:Te,min:G,...e.length},extra:t?[]:[...new Set(M(e.extra||[]))]}}function je(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=M(e.extra).join(""),t}function Ee(e){e.length===0&&s("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function $e(e,t){Number.isInteger(e)||s("getRandomString","min must be an integer"),Number.isInteger(t)||s("getRandomString","max must be an integer"),e<G&&s("getRandomString",`Minimum length cannot be less than ${G}`),t<e&&s("getRandomString","Maximum length cannot be less than minimum length")}function ro(){let e=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],t=w({min:5,max:10}),r=A({length:t,lowerCase:!0,upperCase:!1,number:!0}),n=O(e);return`${r}@${n}`}function so(e={}){d(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if((!d(t)||!d(r))&&s("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(n)||n<0)&&s("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),t===r)return Number(t.toFixed(n));t>r&&s("generateRandomFloat",`"max" (${r}) must be greater than "min" (${t})`);let o=Math.random()*(r-t)+t;return Number(o.toFixed(n))}function v(e,t){(!d(e)||e<=0)&&s("generateRandomStringFromSource",'"num" must be greater than 0'),(!y(t)||t.length===0)&&s("generateRandomStringFromSource",'"source" must be a non-empty array');let r="";for(let n=0;n<e;n++)r+=O(t);return r}function ho(){let e=w({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,ue({format:"YYYYMMDD"}),v(3,t),v(1,[...t,"X","x"])].join("")}function To(){return O(["13","14","15","16","17","18","19"])+w(999999999).toString().padEnd(9,"0")}function No(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${A({length:{min:4,max:8}})}`,`?id=${w()}`,`?page=${A({length:{min:2,max:4}})}`,`?query=${A({length:{min:5,max:6}})}`,`?search=${A({length:{min:1,max:4}})}`,`?token=${A({length:{min:16,max:16}})}`];return`${O(e)}${A({length:{min:5,max:25}})}${O(t)}${O(r)}`}export{U as UtilsError,rt as base64Decode,tt as base64Encode,M as castArray,it as compose,at as composeRight,ft as debounce,wt as debugWarn,et as decimalToBinary,I as deepClone,yt as deepMerge,$n as generateRandomArray,Mn as generateRandomColor,ue as generateRandomDate,ro as generateRandomEmail,so as generateRandomFloat,ho as generateRandomIdCard,To as generateRandomMobilePhone,v as generateRandomStringFromSource,w as getRandomInt,O as getRandomItem,A as getRandomString,No as getRandomUrl,Ce as hasChanged,oe as hasCircularReference,y as isArray,x as isBoolean,X as isDate,me as isDateString,Fe as isDef,Wr as isEmail,zr as isEmptyString,Dr as isFloat,L as isFunction,Zr as isIdCard,Cr as isInteger,q as isMap,rn as isMobilePhone,Pr as isNegativeFloat,Kr as isNegativeInteger,ee as isNil,Mr as isNonNegativeFloat,se as isNonNegativeInteger,Ir as isNonPositiveFloat,Yr as isNonPositiveInteger,W as isNull,d as isNumber,$ as isObject,Y as isObjectLike,h as isPlainObject,Nr as isPositiveFloat,_r as isPositiveInteger,Z as isPromise,J as isRegExp,Q as isSet,D as isString,sn as isStringNumber,z as isSymbol,cn as isURL,u as isUndef,pe as objectToString,Or as omit,ae as pick,be as qs,$t as qsStringify,Ct as throttle,s as throwError,N as toTypeString,ke as toTypeValue,Ht as withRetry};
|
package/dist/utils.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lntvowUtils=(()=>{var ee=Object.create;var pt=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var Ut=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),se=(t,e)=>{for(var r in e)pt(t,r,{get:e[r],enumerable:!0})},Wt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ne(e))!ie.call(t,i)&&i!==r&&pt(t,i,{get:()=>e[i],enumerable:!(n=re(e,i))||n.enumerable});return t};var gt=(t,e,r)=>(r=t!=null?ee(oe(t)):{},Wt(e||!t||!t.__esModule?pt(r,"default",{value:t,enumerable:!0}):r,t)),ae=t=>Wt(pt({},"__esModule",{value:!0}),t);var xt=Ut((It,_t)=>{"use strict";(function(t,e){typeof It=="object"&&typeof _t<"u"?_t.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(It,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",x="minute",p="hour",M="day",h="week",R="month",_="quarter",Y="year",v="date",N="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|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,O={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(u){var s=["th","st","nd","rd"],o=u%100;return"["+u+(s[(o-20)%10]||s[o]||s[0])+"]"}},D=function(u,s,o){var f=String(u);return!f||f.length>=s?u:""+Array(s+1-f.length).join(o)+u},$={s:D,z:function(u){var s=-u.utcOffset(),o=Math.abs(s),f=Math.floor(o/60),a=o%60;return(s<=0?"+":"-")+D(f,2,"0")+":"+D(a,2,"0")},m:function u(s,o){if(s.date()<o.date())return-u(o,s);var f=12*(o.year()-s.year())+(o.month()-s.month()),a=s.clone().add(f,R),m=o-a<0,l=s.clone().add(f+(m?-1:1),R);return+(-(f+(o-a)/(m?a-l:l-a))||0)},a:function(u){return u<0?Math.ceil(u)||0:Math.floor(u)},p:function(u){return{M:R,y:Y,w:h,d:M,D:v,h:p,m:x,s:i,ms:n,Q:_}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(u){return u===void 0}},w="en",j={};j[w]=O;var C="$isDayjsObject",E=function(u){return u instanceof F||!(!u||!u[C])},K=function u(s,o,f){var a;if(!s)return w;if(typeof s=="string"){var m=s.toLowerCase();j[m]&&(a=m),o&&(j[m]=o,a=m);var l=s.split("-");if(!a&&l.length>1)return u(l[0])}else{var g=s.name;j[g]=s,a=g}return!f&&a&&(w=a),a||!f&&w},S=function(u,s){if(E(u))return u.clone();var o=typeof s=="object"?s:{};return o.date=u,o.args=arguments,new F(o)},y=$;y.l=K,y.i=E,y.w=function(u,s){return S(u,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var F=function(){function u(o){this.$L=K(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[C]=!0}var s=u.prototype;return s.parse=function(o){this.$d=function(f){var a=f.date,m=f.utc;if(a===null)return new Date(NaN);if(y.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var l=a.match(c);if(l){var g=l[2]-1||0,A=(l[7]||"0").substring(0,3);return m?new Date(Date.UTC(l[1],g,l[3]||1,l[4]||0,l[5]||0,l[6]||0,A)):new Date(l[1],g,l[3]||1,l[4]||0,l[5]||0,l[6]||0,A)}}return new Date(a)}(o),this.init()},s.init=function(){var o=this.$d;this.$y=o.getFullYear(),this.$M=o.getMonth(),this.$D=o.getDate(),this.$W=o.getDay(),this.$H=o.getHours(),this.$m=o.getMinutes(),this.$s=o.getSeconds(),this.$ms=o.getMilliseconds()},s.$utils=function(){return y},s.isValid=function(){return this.$d.toString()!==N},s.isSame=function(o,f){var a=S(o);return this.startOf(f)<=a&&a<=this.endOf(f)},s.isAfter=function(o,f){return S(o)<this.startOf(f)},s.isBefore=function(o,f){return this.endOf(f)<S(o)},s.$g=function(o,f,a){return y.u(o)?this[f]:this.set(a,o)},s.unix=function(){return Math.floor(this.valueOf()/1e3)},s.valueOf=function(){return this.$d.getTime()},s.startOf=function(o,f){var a=this,m=!!y.u(f)||f,l=y.p(o),g=function(X,L){var G=y.w(a.$u?Date.UTC(a.$y,L,X):new Date(a.$y,L,X),a);return m?G:G.endOf(M)},A=function(X,L){return y.w(a.toDate()[X].apply(a.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(L)),a)},T=this.$W,P=this.$M,W=this.$D,nt="set"+(this.$u?"UTC":"");switch(l){case Y:return m?g(1,0):g(31,11);case R:return m?g(1,P):g(0,P+1);case h:var J=this.$locale().weekStart||0,at=(T<J?T+7:T)-J;return g(m?W-at:W+(6-at),P);case M:case v:return A(nt+"Hours",0);case p:return A(nt+"Minutes",1);case x:return A(nt+"Seconds",2);case i:return A(nt+"Milliseconds",3);default:return this.clone()}},s.endOf=function(o){return this.startOf(o,!1)},s.$set=function(o,f){var a,m=y.p(o),l="set"+(this.$u?"UTC":""),g=(a={},a[M]=l+"Date",a[v]=l+"Date",a[R]=l+"Month",a[Y]=l+"FullYear",a[p]=l+"Hours",a[x]=l+"Minutes",a[i]=l+"Seconds",a[n]=l+"Milliseconds",a)[m],A=m===M?this.$D+(f-this.$W):f;if(m===R||m===Y){var T=this.clone().set(v,1);T.$d[g](A),T.init(),this.$d=T.set(v,Math.min(this.$D,T.daysInMonth())).$d}else g&&this.$d[g](A);return this.init(),this},s.set=function(o,f){return this.clone().$set(o,f)},s.get=function(o){return this[y.p(o)]()},s.add=function(o,f){var a,m=this;o=Number(o);var l=y.p(f),g=function(P){var W=S(m);return y.w(W.date(W.date()+Math.round(P*o)),m)};if(l===R)return this.set(R,this.$M+o);if(l===Y)return this.set(Y,this.$y+o);if(l===M)return g(1);if(l===h)return g(7);var A=(a={},a[x]=e,a[p]=r,a[i]=t,a)[l]||1,T=this.$d.getTime()+o*A;return y.w(T,this)},s.subtract=function(o,f){return this.add(-1*o,f)},s.format=function(o){var f=this,a=this.$locale();if(!this.isValid())return a.invalidDate||N;var m=o||"YYYY-MM-DDTHH:mm:ssZ",l=y.z(this),g=this.$H,A=this.$m,T=this.$M,P=a.weekdays,W=a.months,nt=a.meridiem,J=function(L,G,tt,ot){return L&&(L[G]||L(f,m))||tt[G].slice(0,ot)},at=function(L){return y.s(g%12||12,L,"0")},X=nt||function(L,G,tt){var ot=L<12?"AM":"PM";return tt?ot.toLowerCase():ot};return m.replace(b,function(L,G){return G||function(tt){switch(tt){case"YY":return String(f.$y).slice(-2);case"YYYY":return y.s(f.$y,4,"0");case"M":return T+1;case"MM":return y.s(T+1,2,"0");case"MMM":return J(a.monthsShort,T,W,3);case"MMMM":return J(W,T);case"D":return f.$D;case"DD":return y.s(f.$D,2,"0");case"d":return String(f.$W);case"dd":return J(a.weekdaysMin,f.$W,P,2);case"ddd":return J(a.weekdaysShort,f.$W,P,3);case"dddd":return P[f.$W];case"H":return String(g);case"HH":return y.s(g,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return X(g,A,!0);case"A":return X(g,A,!1);case"m":return String(A);case"mm":return y.s(A,2,"0");case"s":return String(f.$s);case"ss":return y.s(f.$s,2,"0");case"SSS":return y.s(f.$ms,3,"0");case"Z":return l}return null}(L)||l.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(o,f,a){var m,l=this,g=y.p(f),A=S(o),T=(A.utcOffset()-this.utcOffset())*e,P=this-A,W=function(){return y.m(l,A)};switch(g){case Y:m=W()/12;break;case R:m=W();break;case _:m=W()/3;break;case h:m=(P-T)/6048e5;break;case M:m=(P-T)/864e5;break;case p:m=P/r;break;case x:m=P/e;break;case i:m=P/t;break;default:m=P}return a?m:y.a(m)},s.daysInMonth=function(){return this.endOf(R).$D},s.$locale=function(){return j[this.$L]},s.locale=function(o,f){if(!o)return this.$L;var a=this.clone(),m=K(o,f,!0);return m&&(a.$L=m),a},s.clone=function(){return y.w(this.$d,this)},s.toDate=function(){return new Date(this.valueOf())},s.toJSON=function(){return this.isValid()?this.toISOString():null},s.toISOString=function(){return this.$d.toISOString()},s.toString=function(){return this.$d.toUTCString()},u}(),U=F.prototype;return S.prototype=U,[["$ms",n],["$s",i],["$m",x],["$H",p],["$W",M],["$M",R],["$y",Y],["$D",v]].forEach(function(u){U[u[1]]=function(s){return this.$g(s,u[0],u[1])}}),S.extend=function(u,s){return u.$i||(u(s,F,S),u.$i=!0),S},S.locale=K,S.isDayjs=E,S.unix=function(u){return S(1e3*u)},S.en=j[w],S.Ls=j,S.p={},S})});var qt=Ut((Ft,Ht)=>{"use strict";(function(t,e){typeof Ft=="object"&&typeof Ht<"u"?Ht.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(Ft,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,i=/\d\d?/,x=/\d*[^-_:/,()\s\d]+/,p={},M=function(c){return(c=+c)+(c>68?1900:2e3)},h=function(c){return function(b){this[c]=+b}},R=[/[+-]\d\d:?(\d\d)?|Z/,function(c){(this.zone||(this.zone={})).offset=function(b){if(!b||b==="Z")return 0;var O=b.match(/([+-]|\d\d)/g),D=60*O[1]+(+O[2]||0);return D===0?0:O[0]==="+"?-D:D}(c)}],_=function(c){var b=p[c];return b&&(b.indexOf?b:b.s.concat(b.f))},Y=function(c,b){var O,D=p.meridiem;if(D){for(var $=1;$<=24;$+=1)if(c.indexOf(D($,0,b))>-1){O=$>12;break}}else O=c===(b?"pm":"PM");return O},v={A:[x,function(c){this.afternoon=Y(c,!1)}],a:[x,function(c){this.afternoon=Y(c,!0)}],Q:[r,function(c){this.month=3*(c-1)+1}],S:[r,function(c){this.milliseconds=100*+c}],SS:[n,function(c){this.milliseconds=10*+c}],SSS:[/\d{3}/,function(c){this.milliseconds=+c}],s:[i,h("seconds")],ss:[i,h("seconds")],m:[i,h("minutes")],mm:[i,h("minutes")],H:[i,h("hours")],h:[i,h("hours")],HH:[i,h("hours")],hh:[i,h("hours")],D:[i,h("day")],DD:[n,h("day")],Do:[x,function(c){var b=p.ordinal,O=c.match(/\d+/);if(this.day=O[0],b)for(var D=1;D<=31;D+=1)b(D).replace(/\[|\]/g,"")===c&&(this.day=D)}],w:[i,h("week")],ww:[n,h("week")],M:[i,h("month")],MM:[n,h("month")],MMM:[x,function(c){var b=_("months"),O=(_("monthsShort")||b.map(function(D){return D.slice(0,3)})).indexOf(c)+1;if(O<1)throw new Error;this.month=O%12||O}],MMMM:[x,function(c){var b=_("months").indexOf(c)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,h("year")],YY:[n,function(c){this.year=M(c)}],YYYY:[/\d{4}/,h("year")],Z:R,ZZ:R};function N(c){var b,O;b=c,O=p&&p.formats;for(var D=(c=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,y,F){var U=F&&F.toUpperCase();return y||O[F]||t[F]||O[U].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(u,s,o){return s||o.slice(1)})})).match(e),$=D.length,w=0;w<$;w+=1){var j=D[w],C=v[j],E=C&&C[0],K=C&&C[1];D[w]=K?{regex:E,parser:K}:j.replace(/^\[|\]$/g,"")}return function(S){for(var y={},F=0,U=0;F<$;F+=1){var u=D[F];if(typeof u=="string")U+=u.length;else{var s=u.regex,o=u.parser,f=S.slice(U),a=s.exec(f)[0];o.call(y,a),S=S.replace(a,"")}}return function(m){var l=m.afternoon;if(l!==void 0){var g=m.hours;l?g<12&&(m.hours+=12):g===12&&(m.hours=0),delete m.afternoon}}(y),y}}return function(c,b,O){O.p.customParseFormat=!0,c&&c.parseTwoDigitYear&&(M=c.parseTwoDigitYear);var D=b.prototype,$=D.parse;D.parse=function(w){var j=w.date,C=w.utc,E=w.args;this.$u=C;var K=E[1];if(typeof K=="string"){var S=E[2]===!0,y=E[3]===!0,F=S||y,U=E[2];y&&(U=E[2]),p=this.$locale(),!S&&U&&(p=O.Ls[U]),this.$d=function(f,a,m,l){try{if(["x","X"].indexOf(a)>-1)return new Date((a==="X"?1e3:1)*f);var g=N(a)(f),A=g.year,T=g.month,P=g.day,W=g.hours,nt=g.minutes,J=g.seconds,at=g.milliseconds,X=g.zone,L=g.week,G=new Date,tt=P||(A||T?1:G.getDate()),ot=A||G.getFullYear(),lt=0;A&&!T||(lt=T>0?T-1:G.getMonth());var dt,Mt=W||0,Ot=nt||0,Dt=J||0,St=at||0;return X?new Date(Date.UTC(ot,lt,tt,Mt,Ot,Dt,St+60*X.offset*1e3)):m?new Date(Date.UTC(ot,lt,tt,Mt,Ot,Dt,St)):(dt=new Date(ot,lt,tt,Mt,Ot,Dt,St),L&&(dt=l(dt).week(L).toDate()),dt)}catch{return new Date("")}}(j,K,C,O),this.init(),U&&U!==!0&&(this.$L=this.locale(U).$L),F&&j!=this.format(K)&&(this.$d=new Date("")),p={}}else if(K instanceof Array)for(var u=K.length,s=1;s<=u;s+=1){E[1]=K[s-1];var o=O.apply(this,E);if(o.isValid()){this.$d=o.$d,this.$L=o.$L,this.init();break}s===u&&(this.$d=new Date(""))}else $.call(this,w)}}})});var nr={};se(nr,{UtilsError:()=>mt,base64Decode:()=>de,base64Encode:()=>le,castArray:()=>st,compose:()=>pe,composeRight:()=>ge,debounce:()=>he,debugWarn:()=>$e,decimalToBinary:()=>me,deepClone:()=>ft,deepMerge:()=>ye,generateRandomArray:()=>We,generateRandomColor:()=>ze,generateRandomDate:()=>$t,generateRandomEmail:()=>te,generateRandomFloat:()=>Je,generateRandomIdCard:()=>tr,generateRandomMobilePhone:()=>er,generateRandomStringFromSource:()=>wt,getRandomInt:()=>I,getRandomItem:()=>Z,getRandomString:()=>Q,getRandomUrl:()=>rr,hasChanged:()=>ce,hasCircularReference:()=>Yt,isArray:()=>H,isBoolean:()=>B,isDate:()=>jt,isDateString:()=>Ct,isDef:()=>ue,isEmail:()=>Ce,isEmptyString:()=>Le,isFloat:()=>je,isFunction:()=>ct,isIdCard:()=>Fe,isInteger:()=>Ne,isMap:()=>Tt,isMobilePhone:()=>He,isNegativeFloat:()=>ke,isNegativeInteger:()=>Ie,isNil:()=>kt,isNonNegativeFloat:()=>ve,isNonNegativeInteger:()=>Pt,isNonPositiveFloat:()=>Ye,isNonPositiveInteger:()=>_e,isNull:()=>ht,isNumber:()=>z,isObject:()=>et,isObjectLike:()=>ut,isPlainObject:()=>V,isPositiveFloat:()=>Ee,isPositiveInteger:()=>Pe,isPromise:()=>vt,isRegExp:()=>Et,isSet:()=>Rt,isString:()=>rt,isStringNumber:()=>Ke,isSymbol:()=>At,isURL:()=>Ue,isUndef:()=>k,objectToString:()=>zt,omit:()=>Re,pick:()=>Nt,qs:()=>Gt,qsStringify:()=>we,throttle:()=>Oe,throwError:()=>d,toTypeString:()=>it,toTypeValue:()=>fe,withRetry:()=>De});function et(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function ut(t){return t!==null&&typeof t=="object"}var zt=Object.prototype.toString,it=t=>zt.call(t),fe=t=>it(t).slice(8,-1),rt=t=>typeof t=="string",z=t=>typeof t=="number"&&Number.isFinite(t),B=t=>typeof t=="boolean",ht=t=>t===null,k=t=>t===void 0,At=t=>typeof t=="symbol",H=Array.isArray,ct=t=>typeof t=="function",Tt=t=>it(t)==="[object Map]",Rt=t=>it(t)==="[object Set]",jt=t=>it(t)==="[object Date]",Et=t=>it(t)==="[object RegExp]",vt=t=>ut(t)&&ct(t?.then)&&ct(t?.catch),kt=t=>t==null,ue=t=>t!=null,ce=(t,e)=>t!==e;function V(t){return it(t)==="[object Object]"}function st(t){return H(t)?t:[t]}function me(t){let e=[],r,n="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)n+=e.pop().toString();return n}var Bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function le(t){let e="",r="";for(let i=0;i<t.length;i++)r+=t[i].charCodeAt(0).toString(2).padStart(8,"0");for(let i=0;i<r.length;i+=6)e+=Bt[Number.parseInt(r.slice(i,i+6).padEnd(6,"0"),2)];let n=e.length%4;return n!==0&&(e+="=".repeat(4-n)),e}function de(t){let e="",r="";for(let n=0;n<t.length&&t[n]!=="=";n++)r+=Bt.indexOf(t[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let i=Number.parseInt(r.slice(n,n+8),2);i&&(e+=String.fromCharCode(i))}return e}function pe(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function ge(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}function he(t,e=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}}function ft(t){let e=new WeakMap;function r(n){if(!ut(n))return n;if(jt(n))return new Date(n);if(Et(n))return new RegExp(n);if(vt(n))return n;if(e.has(n))return e.get(n);if(Tt(n)){let p=new Map;return e.set(n,p),n.forEach((M,h)=>p.set(r(h),r(M))),p}if(Rt(n)){let p=new Set;return e.set(n,p),n.forEach(M=>p.add(r(M))),p}let i=H(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));e.set(n,i);let x=Object.getOwnPropertyDescriptors(n);for(let p of Reflect.ownKeys(x)){let M=x[p];M.get||M.set?Object.defineProperty(i,p,M):Object.defineProperty(i,p,{...M,value:r(M.value)})}return i}return r(t)}function ye(t,e,r={}){return Zt(Vt(t,r),Vt(e,r),r)}function Zt(t,e,r){return H(t)?xe(t,e,r):be(t,e,r)}function be(t,e,r){if(!V(e))return e;let n=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(i=>{(V(t[i])||H(t[i]))&&(V(e[i])||H(e[i]))?t[i]=Zt(t[i],e[i],r):Object.defineProperty(t,i,n[i])}),t}function xe(t,e,r){let{mergeStrategy:n="replace"}=r;if(H(e))switch(n){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Vt(t,e){let{deepClone:r=!0}=e;return r?ft(t):t}var mt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function d(t,e){throw new mt(`[${t}] ${e}`)}function $e(t,e){let r=rt(t)?new mt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}var yt=(t,e,...r)=>{if(!e)return;let n=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,n)},bt=(t,...e)=>{yt("info",t,...e)};bt.info=(t,...e)=>{yt("info",t,...e)};bt.error=(t,...e)=>{yt("error",t,...e)};bt.warn=(t,...e)=>{yt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=bt);function we(t,e={}){Me(e);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:i="indices",encodeDotInKeys:x=!1,skipNulls:p=!1,strictNullHandling:M=!1,commaRoundTrip:h=!1,allowEmptyArrays:R=!1,addQueryPrefix:_=!1,delimiter:Y="&"}=e,v=e.allowDots??!1;x&&k(e.allowDots)&&(v=!0);let N=[],c=$=>r&&!n?encodeURIComponent($):$,b=$=>r?encodeURIComponent($):$;function O($,w){if(!k(w)){if(ht(w)){if(p)return;N.push(`${c($)}${M?"":"="}`);return}if(H(w)){if(w.length===0){R&&N.push(`${c($)}[]`);return}if(i==="comma"){let j=n?w.map(b).join(","):b(w.join(","));if(w.length===1&&ht(w[0])){if(p)return;N.push(`${c($)}${h?"[]":""}${M?"":"="}`)}else w.length===1?N.push(`${c($)}${h?"[]":""}=${j}`):N.push(`${c($)}=${j}`);return}w.forEach((j,C)=>{let E=$;i==="indices"?E=`${$}[${C}]`:i==="brackets"&&(E=`${$}[]`),O(E,j)});return}if(et(w)){Object.keys(w).forEach(j=>{let C=$;x&&(C=C.replace(/\./g,"%2E"));let E=j;v?(x&&(E=E.replace(/\./g,"%2E")),O(`${C}.${E}`,w[j])):O(`${C}[${E}]`,w[j])});return}N.push(`${c($)}=${b(w)}`)}}if(!et(t))return"";Yt(t)&&d("stringify","Input object contains circular references, cannot stringify"),H(t)?t.forEach(($,w)=>O(`${w}`,$)):Object.keys(t).forEach($=>O($,t[$]));let D=N.join(Y);return _&&D?`?${D}`:D}function Me(t={}){V(t)||d("stringify",'"options" must be a plain object'),!k(t.encode)&&!B(t.encode)&&d("stringify",'"encode" must be a boolean'),!k(t.encodeValuesOnly)&&!B(t.encodeValuesOnly)&&d("stringify",'"encodeValuesOnly" must be a boolean'),!k(t.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(t.arrayFormat)&&d("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!k(t.allowDots)&&!B(t.allowDots)&&d("stringify",'"allowDots" must be a boolean'),!k(t.skipNulls)&&!B(t.skipNulls)&&d("stringify",'"skipNulls" must be a boolean'),!k(t.strictNullHandling)&&!B(t.strictNullHandling)&&d("stringify",'"strictNullHandling" must be a boolean'),!k(t.addQueryPrefix)&&!B(t.addQueryPrefix)&&d("stringify",'"addQueryPrefix" must be a boolean'),!k(t.delimiter)&&!rt(t.delimiter)&&d("stringify",'"delimiter" must be a string'),!k(t.encodeDotInKeys)&&!B(t.encodeDotInKeys)&&d("stringify",'"encodeDotInKeys" must be a boolean'),!k(t.commaRoundTrip)&&!B(t.commaRoundTrip)&&d("stringify",'"commaRoundTrip" must be a boolean'),!k(t.allowEmptyArrays)&&!B(t.allowEmptyArrays)&&d("stringify",'"allowEmptyArrays" must be a boolean')}var Gt={stringify:t=>(et(t)||d("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(rt(t)||d("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let r=Gt.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${r}`:`${t}&${r}`:`${t}?${r}`}};function Oe(t,e=500){let r=null;return function(...n){if(kt(r))return r=Date.now(),t.apply(this,n);let i=Date.now();if(i-r>=e)return r=i,t.apply(this,n)}}function De(t){Se(t);let{fn:e,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:i=!1,signal:x}=t,p,M=x?new Promise((R,_)=>{let Y=()=>_(Qt());x.addEventListener("abort",Y),p=()=>x.removeEventListener("abort",Y)}):null;return new Promise((R,_)=>{(async()=>{for(let v=1;v<=r;v++){if(x?.aborted)return _(Qt());try{let N=await Promise.race(M?[e(),M]:[e()]);return R(N)}catch(N){let c=i?n*2**(v-1):n;if(log("withRetry",`Attempt ${v}/${r} failed. Retrying in ${c}ms...`),N instanceof Error&&N.name==="AbortError"||v===r)return _(N);await new Promise(b=>setTimeout(b,c))}}})()}).finally(()=>p?.())}function Se(t){V(t)||d("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&d("withRetry",'"fn" must be a function that returns a Promise'),!k(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&d("withRetry",'"maxAttempts" must be a positive integer'),!k(t.retryDelay)&&(!z(t.retryDelay)||t.retryDelay<0)&&d("withRetry",'"retryDelay" must be a non-negative number'),!k(t.enableExponentialBackoff)&&!B(t.enableExponentialBackoff)&&d("withRetry",'"enableExponentialBackoff" must be a boolean'),!k(t.signal)&&typeof t.signal!="object"&&d("withRetry",'"signal" must be an AbortSignal')}var Ae="The operation was aborted";function Qt(t=Ae){let e=new Error(t);return e.name="AbortError",e}function Yt(t){et(t)||d("hasCircularReference",'"obj" must be a object');let e=new Set;function r(n){if(et(n)){if(e.has(n))return!0;e.add(n);for(let i of Object.keys(n))if(r(n[i]))return!0;e.delete(n)}return!1}return r(t)}function Nt(t,e,r={}){let{includeProto:n=!1,includeSymbols:i=!0,includeNonEnum:x=!1}=r,p={};return V(t)&&st(e).forEach(h=>{At(h)&&!i||!(n?h in t:Object.hasOwn(t,h))||!x&&(n?Te(t,h):Object.getOwnPropertyDescriptor(t,h))?.enumerable===!1||(p[h]=ft(t[h]))}),p}function Te(t,e){let r=t;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Re(t,e){if(!V(t))return{};let r=ft(t),n=st(e),i=Object.keys(r).filter(x=>!n.includes(x));return Nt(r,i)}function je(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function Ee(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function ve(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function ke(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Ye(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function Ne(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function Pe(t){return/^[1-9]\d*$/.test(t)}function Pt(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function Ie(t){return/^-[1-9]\d*$/.test(t)}function _e(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var Xt=gt(xt(),1);function Ct(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Xt.default)(t,e,!0).isValid()}function Ce(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function Le(t){return t===""}var Lt=gt(xt(),1);function Fe(t){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(t))return!1;let r=t.slice(6,14);return Ct(r,"YYYYMMDD")&&(0,Lt.default)(r,"YYYYMMDD").isBefore((0,Lt.default)())}function He(t){return/^1[3-9]\d{9}$/.test(t)}var Ke=t=>{if(!rt(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function Ue(t){return/^https?:\/\/\S+$/i.test(t)}function We(t,e){return(!z(t)||!Pt(t.toString()))&&d("generateRandomArray","num must be greater than 0"),ct(e)||d("generateRandomArray","cb must be a function"),Array.from({length:t},()=>e())}function ze(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}var q=gt(xt(),1),Jt=gt(qt(),1);function Z(t){return t[Math.floor(Math.random()*t.length)]}function I(t={}){z(t)&&(t={max:t});let{min:e=1,max:r=Z(Ve())}=t;Be(e,r);let n=Math.ceil(e),i=Math.floor(r);return Math.floor(Math.random()*(i-n+1)+n)}function Be(t,e){let r=Math.ceil(t),n=Math.floor(e);Number.isSafeInteger(r)||d("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(n)||d("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),n<r&&(e>=t&&d("getRandomInt",`No integer value found between ${t} and ${e}`),d("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function Ve(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}q.default.extend(Jt.default);function $t(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,q.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=t;(!(0,q.default)(e).isValid()||!(0,q.default)(r).isValid())&&d("generateRandomDate","start and end parameters must be valid date format");let i=(0,q.default)(e).year(),x=(0,q.default)(r).year(),p=I({min:i,max:x}),M=I({min:1,max:12}),h=I({min:1,max:31}),R=I(23),_=I(59),Y=I(59),v=(0,q.default)(`${p}-${M}-${h} ${R}:${_}:${Y}`);return v.isBefore((0,q.default)(e))||v.isAfter((0,q.default)(r))?$t(t):v.format(n)}function Q(t={}){let e=Ge(t),r=Qe(e);Xe(r);let{length:n}=e;qe(n.min,n.max);let i=I(n),x=e.prefix||"";for(let p=0;p<i;p++)x+=r.charAt(Math.floor(Math.random()*r.length));return x+(e.suffix||"")}var Ze=16,Kt=1;function Ge(t){let e=z(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:z(t.length)?{max:t.length,min:t.length}:{max:Ze,min:Kt,...t.length},extra:e?[]:[...new Set(st(t.extra||[]))]}}function Qe(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=st(t.extra).join(""),e}function Xe(t){t.length===0&&d("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function qe(t,e){Number.isInteger(t)||d("getRandomString","min must be an integer"),Number.isInteger(e)||d("getRandomString","max must be an integer"),t<Kt&&d("getRandomString",`Minimum length cannot be less than ${Kt}`),e<t&&d("getRandomString","Maximum length cannot be less than minimum length")}function te(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${Q(1)}${Q({length:I({max:30,min:1})})}${Q(1)}@${Z(t)}`;return/\.{2,}/.test(e)?te():e}function Je(t={}){z(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:n=2}=t;if(e===r)return e;if(e>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${e}`);let i=Math.random()*(r-e)+e;return Number(i.toFixed(n))}function wt(t,e){(!z(t)||t<=0)&&d("generateRandomStringFromSource","num must be greater than 0"),(!H(e)||e.length===0)&&d("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<t;n++)r+=Z(e);return r}function tr(){let t=I({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,$t({format:"YYYYMMDD"}),wt(3,e),wt(1,[...e,"X","x"])].join("")}function er(){return Z(["13","14","15","16","17","18","19"])+I(999999999).toString().padEnd(9,"0")}function rr(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${Q({length:{min:4,max:8}})}`,`?id=${I()}`,`?page=${Q({length:{min:2,max:4}})}`,`?query=${Q({length:{min:5,max:6}})}`,`?search=${Q({length:{min:1,max:4}})}`,`?token=${Q({length:{min:16,max:16}})}`];return`${Z(t)}${Q({length:{min:5,max:25}})}${Z(e)}${Z(r)}`}return ae(nr);})();
|
|
1
|
+
"use strict";var lntvowUtils=(()=>{var ee=Object.create;var pt=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var Kt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),se=(t,e)=>{for(var r in e)pt(t,r,{get:e[r],enumerable:!0})},Wt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ne(e))!ie.call(t,i)&&i!==r&&pt(t,i,{get:()=>e[i],enumerable:!(n=re(e,i))||n.enumerable});return t};var gt=(t,e,r)=>(r=t!=null?ee(oe(t)):{},Wt(e||!t||!t.__esModule?pt(r,"default",{value:t,enumerable:!0}):r,t)),ae=t=>Wt(pt({},"__esModule",{value:!0}),t);var xt=Kt((Pt,It)=>{"use strict";(function(t,e){typeof Pt=="object"&&typeof It<"u"?It.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Pt,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",x="minute",p="hour",O="day",h="week",E="month",L="quarter",Y="year",P="date",k="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,M={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(u){var s=["th","st","nd","rd"],o=u%100;return"["+u+(s[(o-20)%10]||s[o]||s[0])+"]"}},D=function(u,s,o){var f=String(u);return!f||f.length>=s?u:""+Array(s+1-f.length).join(o)+u},$={s:D,z:function(u){var s=-u.utcOffset(),o=Math.abs(s),f=Math.floor(o/60),a=o%60;return(s<=0?"+":"-")+D(f,2,"0")+":"+D(a,2,"0")},m:function u(s,o){if(s.date()<o.date())return-u(o,s);var f=12*(o.year()-s.year())+(o.month()-s.month()),a=s.clone().add(f,E),l=o-a<0,d=s.clone().add(f+(l?-1:1),E);return+(-(f+(o-a)/(l?a-d:d-a))||0)},a:function(u){return u<0?Math.ceil(u)||0:Math.floor(u)},p:function(u){return{M:E,y:Y,w:h,d:O,D:P,h:p,m:x,s:i,ms:n,Q:L}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(u){return u===void 0}},w="en",R={};R[w]=M;var I="$isDayjsObject",j=function(u){return u instanceof F||!(!u||!u[I])},U=function u(s,o,f){var a;if(!s)return w;if(typeof s=="string"){var l=s.toLowerCase();R[l]&&(a=l),o&&(R[l]=o,a=l);var d=s.split("-");if(!a&&d.length>1)return u(d[0])}else{var g=s.name;R[g]=s,a=g}return!f&&a&&(w=a),a||!f&&w},S=function(u,s){if(j(u))return u.clone();var o=typeof s=="object"?s:{};return o.date=u,o.args=arguments,new F(o)},b=$;b.l=U,b.i=j,b.w=function(u,s){return S(u,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var F=function(){function u(o){this.$L=U(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[I]=!0}var s=u.prototype;return s.parse=function(o){this.$d=function(f){var a=f.date,l=f.utc;if(a===null)return new Date(NaN);if(b.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var d=a.match(c);if(d){var g=d[2]-1||0,A=(d[7]||"0").substring(0,3);return l?new Date(Date.UTC(d[1],g,d[3]||1,d[4]||0,d[5]||0,d[6]||0,A)):new Date(d[1],g,d[3]||1,d[4]||0,d[5]||0,d[6]||0,A)}}return new Date(a)}(o),this.init()},s.init=function(){var o=this.$d;this.$y=o.getFullYear(),this.$M=o.getMonth(),this.$D=o.getDate(),this.$W=o.getDay(),this.$H=o.getHours(),this.$m=o.getMinutes(),this.$s=o.getSeconds(),this.$ms=o.getMilliseconds()},s.$utils=function(){return b},s.isValid=function(){return this.$d.toString()!==k},s.isSame=function(o,f){var a=S(o);return this.startOf(f)<=a&&a<=this.endOf(f)},s.isAfter=function(o,f){return S(o)<this.startOf(f)},s.isBefore=function(o,f){return this.endOf(f)<S(o)},s.$g=function(o,f,a){return b.u(o)?this[f]:this.set(a,o)},s.unix=function(){return Math.floor(this.valueOf()/1e3)},s.valueOf=function(){return this.$d.getTime()},s.startOf=function(o,f){var a=this,l=!!b.u(f)||f,d=b.p(o),g=function(Q,_){var G=b.w(a.$u?Date.UTC(a.$y,_,Q):new Date(a.$y,_,Q),a);return l?G:G.endOf(O)},A=function(Q,_){return b.w(a.toDate()[Q].apply(a.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(_)),a)},T=this.$W,N=this.$M,W=this.$D,rt="set"+(this.$u?"UTC":"");switch(d){case Y:return l?g(1,0):g(31,11);case E:return l?g(1,N):g(0,N+1);case h:var q=this.$locale().weekStart||0,st=(T<q?T+7:T)-q;return g(l?W-st:W+(6-st),N);case O:case P:return A(rt+"Hours",0);case p:return A(rt+"Minutes",1);case x:return A(rt+"Seconds",2);case i:return A(rt+"Milliseconds",3);default:return this.clone()}},s.endOf=function(o){return this.startOf(o,!1)},s.$set=function(o,f){var a,l=b.p(o),d="set"+(this.$u?"UTC":""),g=(a={},a[O]=d+"Date",a[P]=d+"Date",a[E]=d+"Month",a[Y]=d+"FullYear",a[p]=d+"Hours",a[x]=d+"Minutes",a[i]=d+"Seconds",a[n]=d+"Milliseconds",a)[l],A=l===O?this.$D+(f-this.$W):f;if(l===E||l===Y){var T=this.clone().set(P,1);T.$d[g](A),T.init(),this.$d=T.set(P,Math.min(this.$D,T.daysInMonth())).$d}else g&&this.$d[g](A);return this.init(),this},s.set=function(o,f){return this.clone().$set(o,f)},s.get=function(o){return this[b.p(o)]()},s.add=function(o,f){var a,l=this;o=Number(o);var d=b.p(f),g=function(N){var W=S(l);return b.w(W.date(W.date()+Math.round(N*o)),l)};if(d===E)return this.set(E,this.$M+o);if(d===Y)return this.set(Y,this.$y+o);if(d===O)return g(1);if(d===h)return g(7);var A=(a={},a[x]=e,a[p]=r,a[i]=t,a)[d]||1,T=this.$d.getTime()+o*A;return b.w(T,this)},s.subtract=function(o,f){return this.add(-1*o,f)},s.format=function(o){var f=this,a=this.$locale();if(!this.isValid())return a.invalidDate||k;var l=o||"YYYY-MM-DDTHH:mm:ssZ",d=b.z(this),g=this.$H,A=this.$m,T=this.$M,N=a.weekdays,W=a.months,rt=a.meridiem,q=function(_,G,J,nt){return _&&(_[G]||_(f,l))||J[G].slice(0,nt)},st=function(_){return b.s(g%12||12,_,"0")},Q=rt||function(_,G,J){var nt=_<12?"AM":"PM";return J?nt.toLowerCase():nt};return l.replace(y,function(_,G){return G||function(J){switch(J){case"YY":return String(f.$y).slice(-2);case"YYYY":return b.s(f.$y,4,"0");case"M":return T+1;case"MM":return b.s(T+1,2,"0");case"MMM":return q(a.monthsShort,T,W,3);case"MMMM":return q(W,T);case"D":return f.$D;case"DD":return b.s(f.$D,2,"0");case"d":return String(f.$W);case"dd":return q(a.weekdaysMin,f.$W,N,2);case"ddd":return q(a.weekdaysShort,f.$W,N,3);case"dddd":return N[f.$W];case"H":return String(g);case"HH":return b.s(g,2,"0");case"h":return st(1);case"hh":return st(2);case"a":return Q(g,A,!0);case"A":return Q(g,A,!1);case"m":return String(A);case"mm":return b.s(A,2,"0");case"s":return String(f.$s);case"ss":return b.s(f.$s,2,"0");case"SSS":return b.s(f.$ms,3,"0");case"Z":return d}return null}(_)||d.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(o,f,a){var l,d=this,g=b.p(f),A=S(o),T=(A.utcOffset()-this.utcOffset())*e,N=this-A,W=function(){return b.m(d,A)};switch(g){case Y:l=W()/12;break;case E:l=W();break;case L:l=W()/3;break;case h:l=(N-T)/6048e5;break;case O:l=(N-T)/864e5;break;case p:l=N/r;break;case x:l=N/e;break;case i:l=N/t;break;default:l=N}return a?l:b.a(l)},s.daysInMonth=function(){return this.endOf(E).$D},s.$locale=function(){return R[this.$L]},s.locale=function(o,f){if(!o)return this.$L;var a=this.clone(),l=U(o,f,!0);return l&&(a.$L=l),a},s.clone=function(){return b.w(this.$d,this)},s.toDate=function(){return new Date(this.valueOf())},s.toJSON=function(){return this.isValid()?this.toISOString():null},s.toISOString=function(){return this.$d.toISOString()},s.toString=function(){return this.$d.toUTCString()},u}(),K=F.prototype;return S.prototype=K,[["$ms",n],["$s",i],["$m",x],["$H",p],["$W",O],["$M",E],["$y",Y],["$D",P]].forEach(function(u){K[u[1]]=function(s){return this.$g(s,u[0],u[1])}}),S.extend=function(u,s){return u.$i||(u(s,F,S),u.$i=!0),S},S.locale=U,S.isDayjs=j,S.unix=function(u){return S(1e3*u)},S.en=R[w],S.Ls=R,S.p={},S})});var qt=Kt((Lt,Ft)=>{"use strict";(function(t,e){typeof Lt=="object"&&typeof Ft<"u"?Ft.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(Lt,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,i=/\d\d?/,x=/\d*[^-_:/,()\s\d]+/,p={},O=function(c){return(c=+c)+(c>68?1900:2e3)},h=function(c){return function(y){this[c]=+y}},E=[/[+-]\d\d:?(\d\d)?|Z/,function(c){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var M=y.match(/([+-]|\d\d)/g),D=60*M[1]+(+M[2]||0);return D===0?0:M[0]==="+"?-D:D}(c)}],L=function(c){var y=p[c];return y&&(y.indexOf?y:y.s.concat(y.f))},Y=function(c,y){var M,D=p.meridiem;if(D){for(var $=1;$<=24;$+=1)if(c.indexOf(D($,0,y))>-1){M=$>12;break}}else M=c===(y?"pm":"PM");return M},P={A:[x,function(c){this.afternoon=Y(c,!1)}],a:[x,function(c){this.afternoon=Y(c,!0)}],Q:[r,function(c){this.month=3*(c-1)+1}],S:[r,function(c){this.milliseconds=100*+c}],SS:[n,function(c){this.milliseconds=10*+c}],SSS:[/\d{3}/,function(c){this.milliseconds=+c}],s:[i,h("seconds")],ss:[i,h("seconds")],m:[i,h("minutes")],mm:[i,h("minutes")],H:[i,h("hours")],h:[i,h("hours")],HH:[i,h("hours")],hh:[i,h("hours")],D:[i,h("day")],DD:[n,h("day")],Do:[x,function(c){var y=p.ordinal,M=c.match(/\d+/);if(this.day=M[0],y)for(var D=1;D<=31;D+=1)y(D).replace(/\[|\]/g,"")===c&&(this.day=D)}],w:[i,h("week")],ww:[n,h("week")],M:[i,h("month")],MM:[n,h("month")],MMM:[x,function(c){var y=L("months"),M=(L("monthsShort")||y.map(function(D){return D.slice(0,3)})).indexOf(c)+1;if(M<1)throw new Error;this.month=M%12||M}],MMMM:[x,function(c){var y=L("months").indexOf(c)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,h("year")],YY:[n,function(c){this.year=O(c)}],YYYY:[/\d{4}/,h("year")],Z:E,ZZ:E};function k(c){var y,M;y=c,M=p&&p.formats;for(var D=(c=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,b,F){var K=F&&F.toUpperCase();return b||M[F]||t[F]||M[K].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(u,s,o){return s||o.slice(1)})})).match(e),$=D.length,w=0;w<$;w+=1){var R=D[w],I=P[R],j=I&&I[0],U=I&&I[1];D[w]=U?{regex:j,parser:U}:R.replace(/^\[|\]$/g,"")}return function(S){for(var b={},F=0,K=0;F<$;F+=1){var u=D[F];if(typeof u=="string")K+=u.length;else{var s=u.regex,o=u.parser,f=S.slice(K),a=s.exec(f)[0];o.call(b,a),S=S.replace(a,"")}}return function(l){var d=l.afternoon;if(d!==void 0){var g=l.hours;d?g<12&&(l.hours+=12):g===12&&(l.hours=0),delete l.afternoon}}(b),b}}return function(c,y,M){M.p.customParseFormat=!0,c&&c.parseTwoDigitYear&&(O=c.parseTwoDigitYear);var D=y.prototype,$=D.parse;D.parse=function(w){var R=w.date,I=w.utc,j=w.args;this.$u=I;var U=j[1];if(typeof U=="string"){var S=j[2]===!0,b=j[3]===!0,F=S||b,K=j[2];b&&(K=j[2]),p=this.$locale(),!S&&K&&(p=M.Ls[K]),this.$d=function(f,a,l,d){try{if(["x","X"].indexOf(a)>-1)return new Date((a==="X"?1e3:1)*f);var g=k(a)(f),A=g.year,T=g.month,N=g.day,W=g.hours,rt=g.minutes,q=g.seconds,st=g.milliseconds,Q=g.zone,_=g.week,G=new Date,J=N||(A||T?1:G.getDate()),nt=A||G.getFullYear(),lt=0;A&&!T||(lt=T>0?T-1:G.getMonth());var dt,wt=W||0,Ot=rt||0,Mt=q||0,Dt=st||0;return Q?new Date(Date.UTC(nt,lt,J,wt,Ot,Mt,Dt+60*Q.offset*1e3)):l?new Date(Date.UTC(nt,lt,J,wt,Ot,Mt,Dt)):(dt=new Date(nt,lt,J,wt,Ot,Mt,Dt),_&&(dt=d(dt).week(_).toDate()),dt)}catch{return new Date("")}}(R,U,I,M),this.init(),K&&K!==!0&&(this.$L=this.locale(K).$L),F&&R!=this.format(U)&&(this.$d=new Date("")),p={}}else if(U instanceof Array)for(var u=U.length,s=1;s<=u;s+=1){j[1]=U[s-1];var o=M.apply(this,j);if(o.isValid()){this.$d=o.$d,this.$L=o.$L,this.init();break}s===u&&(this.$d=new Date(""))}else $.call(this,w)}}})});var or={};se(or,{UtilsError:()=>mt,base64Decode:()=>de,base64Encode:()=>le,castArray:()=>it,compose:()=>pe,composeRight:()=>ge,debounce:()=>he,debugWarn:()=>$e,decimalToBinary:()=>me,deepClone:()=>at,deepMerge:()=>be,generateRandomArray:()=>We,generateRandomColor:()=>Ve,generateRandomDate:()=>Ht,generateRandomEmail:()=>Je,generateRandomFloat:()=>tr,generateRandomIdCard:()=>er,generateRandomMobilePhone:()=>rr,generateRandomStringFromSource:()=>$t,getRandomInt:()=>Z,getRandomItem:()=>B,getRandomString:()=>X,getRandomUrl:()=>nr,hasChanged:()=>ce,hasCircularReference:()=>kt,isArray:()=>H,isBoolean:()=>V,isDate:()=>Rt,isDateString:()=>_t,isDef:()=>ue,isEmail:()=>Ce,isEmptyString:()=>Le,isFloat:()=>je,isFunction:()=>ct,isIdCard:()=>Fe,isInteger:()=>Ye,isMap:()=>At,isMobilePhone:()=>He,isNegativeFloat:()=>ke,isNegativeInteger:()=>Ie,isNil:()=>vt,isNonNegativeFloat:()=>ve,isNonNegativeInteger:()=>Yt,isNonPositiveFloat:()=>Ne,isNonPositiveInteger:()=>_e,isNull:()=>ht,isNumber:()=>C,isObject:()=>tt,isObjectLike:()=>ut,isPlainObject:()=>z,isPositiveFloat:()=>Ee,isPositiveInteger:()=>Pe,isPromise:()=>Et,isRegExp:()=>jt,isSet:()=>Tt,isString:()=>et,isStringNumber:()=>Ue,isSymbol:()=>St,isURL:()=>Ke,isUndef:()=>v,objectToString:()=>Vt,omit:()=>Re,pick:()=>Nt,qs:()=>Gt,qsStringify:()=>we,throttle:()=>Me,throwError:()=>m,toTypeString:()=>ot,toTypeValue:()=>fe,withRetry:()=>De});function tt(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function ut(t){return t!==null&&typeof t=="object"}var Vt=Object.prototype.toString,ot=t=>Vt.call(t),fe=t=>ot(t).slice(8,-1),et=t=>typeof t=="string",C=t=>typeof t=="number"&&Number.isFinite(t),V=t=>typeof t=="boolean",ht=t=>t===null,v=t=>t===void 0,St=t=>typeof t=="symbol",H=Array.isArray,ct=t=>typeof t=="function",At=t=>ot(t)==="[object Map]",Tt=t=>ot(t)==="[object Set]",Rt=t=>ot(t)==="[object Date]",jt=t=>ot(t)==="[object RegExp]",Et=t=>ut(t)&&ct(t?.then)&&ct(t?.catch),vt=t=>t==null,ue=t=>t!=null,ce=(t,e)=>t!==e;function z(t){return ot(t)==="[object Object]"}function it(t){return H(t)?t:[t]}function me(t){let e=[],r,n="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)n+=e.pop().toString();return n}var zt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function le(t){let e="",r="";for(let i=0;i<t.length;i++)r+=t[i].charCodeAt(0).toString(2).padStart(8,"0");for(let i=0;i<r.length;i+=6)e+=zt[Number.parseInt(r.slice(i,i+6).padEnd(6,"0"),2)];let n=e.length%4;return n!==0&&(e+="=".repeat(4-n)),e}function de(t){let e="",r="";for(let n=0;n<t.length&&t[n]!=="=";n++)r+=zt.indexOf(t[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let i=Number.parseInt(r.slice(n,n+8),2);i&&(e+=String.fromCharCode(i))}return e}function pe(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function ge(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}function he(t,e=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}}function at(t){let e=new WeakMap;function r(n){if(!ut(n))return n;if(Rt(n))return new Date(n);if(jt(n))return new RegExp(n);if(Et(n))return n;if(e.has(n))return e.get(n);if(At(n)){let p=new Map;return e.set(n,p),n.forEach((O,h)=>p.set(r(h),r(O))),p}if(Tt(n)){let p=new Set;return e.set(n,p),n.forEach(O=>p.add(r(O))),p}let i=H(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));e.set(n,i);let x=Object.getOwnPropertyDescriptors(n);for(let p of Reflect.ownKeys(x)){let O=x[p];O.get||O.set?Object.defineProperty(i,p,O):Object.defineProperty(i,p,{...O,value:r(O.value)})}return i}return r(t)}function be(t,e,r={}){return Zt(Bt(t,r),Bt(e,r),r)}function Zt(t,e,r){return H(t)?xe(t,e,r):ye(t,e,r)}function ye(t,e,r){if(!z(e))return e;let n=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(i=>{(z(t[i])||H(t[i]))&&(z(e[i])||H(e[i]))?t[i]=Zt(t[i],e[i],r):Object.defineProperty(t,i,n[i])}),t}function xe(t,e,r){let{mergeStrategy:n="replace"}=r;if(H(e))switch(n){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Bt(t,e){let{deepClone:r=!0}=e;return r?at(t):t}var mt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function m(t,e){throw new mt(`[${t}] ${e}`)}function $e(t,e){let r=et(t)?new mt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}var bt=(t,e,...r)=>{if(!e)return;let n=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,n)},yt=(t,...e)=>{bt("info",t,...e)};yt.info=(t,...e)=>{bt("info",t,...e)};yt.error=(t,...e)=>{bt("error",t,...e)};yt.warn=(t,...e)=>{bt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=yt);function we(t,e={}){Oe(e);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:i="indices",encodeDotInKeys:x=!1,skipNulls:p=!1,strictNullHandling:O=!1,commaRoundTrip:h=!1,allowEmptyArrays:E=!1,addQueryPrefix:L=!1,delimiter:Y="&"}=e,P=e.allowDots??!1;x&&v(e.allowDots)&&(P=!0);let k=[],c=$=>r&&!n?encodeURIComponent($):$,y=$=>r?encodeURIComponent($):$;function M($,w){if(!v(w)){if(ht(w)){if(p)return;k.push(`${c($)}${O?"":"="}`);return}if(H(w)){if(w.length===0){E&&k.push(`${c($)}[]`);return}if(i==="comma"){let R=n?w.map(y).join(","):y(w.join(","));if(w.length===1&&ht(w[0])){if(p)return;k.push(`${c($)}${h?"[]":""}${O?"":"="}`)}else w.length===1?k.push(`${c($)}${h?"[]":""}=${R}`):k.push(`${c($)}=${R}`);return}w.forEach((R,I)=>{let j=$;i==="indices"?j=`${$}[${I}]`:i==="brackets"&&(j=`${$}[]`),M(j,R)});return}if(tt(w)){Object.keys(w).forEach(R=>{let I=$;x&&(I=I.replace(/\./g,"%2E"));let j=R;P?(x&&(j=j.replace(/\./g,"%2E")),M(`${I}.${j}`,w[R])):M(`${I}[${j}]`,w[R])});return}k.push(`${c($)}=${y(w)}`)}}if(!tt(t))return"";kt(t)&&m("stringify","Input object contains circular references, cannot stringify"),H(t)?t.forEach(($,w)=>M(`${w}`,$)):Object.keys(t).forEach($=>M($,t[$]));let D=k.join(Y);return L&&D?`?${D}`:D}function Oe(t={}){z(t)||m("stringify",'"options" must be a plain object'),!v(t.encode)&&!V(t.encode)&&m("stringify",'"encode" must be a boolean'),!v(t.encodeValuesOnly)&&!V(t.encodeValuesOnly)&&m("stringify",'"encodeValuesOnly" must be a boolean'),!v(t.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(t.arrayFormat)&&m("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!v(t.allowDots)&&!V(t.allowDots)&&m("stringify",'"allowDots" must be a boolean'),!v(t.skipNulls)&&!V(t.skipNulls)&&m("stringify",'"skipNulls" must be a boolean'),!v(t.strictNullHandling)&&!V(t.strictNullHandling)&&m("stringify",'"strictNullHandling" must be a boolean'),!v(t.addQueryPrefix)&&!V(t.addQueryPrefix)&&m("stringify",'"addQueryPrefix" must be a boolean'),!v(t.delimiter)&&!et(t.delimiter)&&m("stringify",'"delimiter" must be a string'),!v(t.encodeDotInKeys)&&!V(t.encodeDotInKeys)&&m("stringify",'"encodeDotInKeys" must be a boolean'),!v(t.commaRoundTrip)&&!V(t.commaRoundTrip)&&m("stringify",'"commaRoundTrip" must be a boolean'),!v(t.allowEmptyArrays)&&!V(t.allowEmptyArrays)&&m("stringify",'"allowEmptyArrays" must be a boolean')}var Gt={stringify:t=>(tt(t)||m("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(et(t)||m("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let r=Gt.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${r}`:`${t}&${r}`:`${t}?${r}`}};function Me(t,e=500){let r=null;return function(...n){if(vt(r))return r=Date.now(),t.apply(this,n);let i=Date.now();if(i-r>=e)return r=i,t.apply(this,n)}}function De(t){Se(t);let{fn:e,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:i=!1,signal:x}=t,p,O=x?new Promise((E,L)=>{let Y=()=>L(Qt());x.addEventListener("abort",Y),p=()=>x.removeEventListener("abort",Y)}):null;return new Promise((E,L)=>{(async()=>{for(let P=1;P<=r;P++){if(x?.aborted)return L(Qt());try{let k=await Promise.race(O?[e(),O]:[e()]);return E(k)}catch(k){let c=i?n*2**(P-1):n;if(log("withRetry",`Attempt ${P}/${r} failed. Retrying in ${c}ms...`),k instanceof Error&&k.name==="AbortError"||P===r)return L(k);await new Promise(y=>setTimeout(y,c))}}})()}).finally(()=>p?.())}function Se(t){z(t)||m("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&m("withRetry",'"fn" must be a function that returns a Promise'),!v(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&m("withRetry",'"maxAttempts" must be a positive integer'),!v(t.retryDelay)&&(!C(t.retryDelay)||t.retryDelay<0)&&m("withRetry",'"retryDelay" must be a non-negative number'),!v(t.enableExponentialBackoff)&&!V(t.enableExponentialBackoff)&&m("withRetry",'"enableExponentialBackoff" must be a boolean'),!v(t.signal)&&typeof t.signal!="object"&&m("withRetry",'"signal" must be an AbortSignal')}var Ae="The operation was aborted";function Qt(t=Ae){let e=new Error(t);return e.name="AbortError",e}function kt(t){tt(t)||m("hasCircularReference",'"obj" must be a object');let e=new Set;function r(n){if(tt(n)){if(e.has(n))return!0;e.add(n);for(let i of Object.keys(n))if(r(n[i]))return!0;e.delete(n)}return!1}return r(t)}function Nt(t,e,r={}){let{includeProto:n=!1,includeSymbols:i=!0,includeNonEnum:x=!1}=r,p={};return z(t)&&it(e).forEach(h=>{St(h)&&!i||!(n?h in t:Object.hasOwn(t,h))||!x&&(n?Te(t,h):Object.getOwnPropertyDescriptor(t,h))?.enumerable===!1||(p[h]=at(t[h]))}),p}function Te(t,e){let r=t;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Re(t,e){if(!z(t))return{};let r=at(t),n=it(e),i=Object.keys(r).filter(x=>!n.includes(x));return Nt(r,i)}function je(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function Ee(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function ve(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function ke(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Ne(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function Ye(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function Pe(t){return/^[1-9]\d*$/.test(t)}function Yt(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function Ie(t){return/^-[1-9]\d*$/.test(t)}function _e(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var Xt=gt(xt(),1);function _t(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Xt.default)(t,e,!0).isValid()}function Ce(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function Le(t){return t===""}var Ct=gt(xt(),1);function Fe(t){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(t))return!1;let r=t.slice(6,14);return _t(r,"YYYYMMDD")&&(0,Ct.default)(r,"YYYYMMDD").isBefore((0,Ct.default)())}function He(t){return/^1[3-9]\d{9}$/.test(t)}var Ue=t=>{if(!et(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function Ke(t){return/^https?:\/\/\S+$/i.test(t)}function We(t,e){return(!C(t)||!Yt(t.toString()))&&m("generateRandomArray","num must be greater than 0"),ct(e)||m("generateRandomArray","cb must be a function"),Array.from({length:t},()=>e())}function Ve(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}var ft=gt(xt(),1),te=gt(qt(),1);function B(t){return t[Math.floor(Math.random()*t.length)]}function Z(t={}){C(t)&&(t={max:t});let{min:e=1,max:r=B(Be())}=t;ze(e,r);let n=Math.ceil(e),i=Math.floor(r);return Math.floor(Math.random()*(i-n+1)+n)}function ze(t,e){let r=Math.ceil(t),n=Math.floor(e);Number.isSafeInteger(r)||m("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(n)||m("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),n<r&&(e>=t&&m("getRandomInt",`No integer value found between ${t} and ${e}`),m("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function Be(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}ft.default.extend(te.default);function Ht(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,ft.default)().format(Jt),format:n=Jt}=t,i=(0,ft.default)(e),x=(0,ft.default)(r);(!i.isValid()||!x.isValid())&&m("generateRandomDate","start and end parameters must be valid date format"),i.isAfter(x)&&m("generateRandomDate","start date must be before end date");let p=i.valueOf(),O=x.valueOf(),h=Z({min:p,max:O});return(0,ft.default)(h).format(n)}var Jt="YYYY-MM-DD HH:mm:ss";function X(t={}){let e=Ge(t),r=Qe(e);Xe(r);let{length:n}=e;qe(n.min,n.max);let i=Z(n),x=e.prefix||"";for(let p=0;p<i;p++)x+=r.charAt(Math.floor(Math.random()*r.length));return x+(e.suffix||"")}var Ze=16,Ut=1;function Ge(t){let e=C(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:C(t.length)?{max:t.length,min:t.length}:{max:Ze,min:Ut,...t.length},extra:e?[]:[...new Set(it(t.extra||[]))]}}function Qe(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=it(t.extra).join(""),e}function Xe(t){t.length===0&&m("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function qe(t,e){Number.isInteger(t)||m("getRandomString","min must be an integer"),Number.isInteger(e)||m("getRandomString","max must be an integer"),t<Ut&&m("getRandomString",`Minimum length cannot be less than ${Ut}`),e<t&&m("getRandomString","Maximum length cannot be less than minimum length")}function Je(){let t=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],e=Z({min:5,max:10}),r=X({length:e,lowerCase:!0,upperCase:!1,number:!0}),n=B(t);return`${r}@${n}`}function tr(t={}){C(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:n=2}=t;if((!C(e)||!C(r))&&m("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(n)||n<0)&&m("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),e===r)return Number(e.toFixed(n));e>r&&m("generateRandomFloat",`"max" (${r}) must be greater than "min" (${e})`);let i=Math.random()*(r-e)+e;return Number(i.toFixed(n))}function $t(t,e){(!C(t)||t<=0)&&m("generateRandomStringFromSource",'"num" must be greater than 0'),(!H(e)||e.length===0)&&m("generateRandomStringFromSource",'"source" must be a non-empty array');let r="";for(let n=0;n<t;n++)r+=B(e);return r}function er(){let t=Z({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,Ht({format:"YYYYMMDD"}),$t(3,e),$t(1,[...e,"X","x"])].join("")}function rr(){return B(["13","14","15","16","17","18","19"])+Z(999999999).toString().padEnd(9,"0")}function nr(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${X({length:{min:4,max:8}})}`,`?id=${Z()}`,`?page=${X({length:{min:2,max:4}})}`,`?query=${X({length:{min:5,max:6}})}`,`?search=${X({length:{min:1,max:4}})}`,`?token=${X({length:{min:16,max:16}})}`];return`${B(t)}${X({length:{min:5,max:25}})}${B(e)}${B(r)}`}return ae(or);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lntvow/utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript utilities",
|
|
6
6
|
"keywords": [
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@commitlint/cli": "^19.8.1",
|
|
33
33
|
"@commitlint/config-conventional": "^19.8.1",
|
|
34
|
-
"@lntvow/eslint-config": "^9.28.
|
|
34
|
+
"@lntvow/eslint-config": "^9.28.8",
|
|
35
35
|
"@types/node": "^24.0.3",
|
|
36
36
|
"@types/qs": "^6.14.0",
|
|
37
37
|
"@vitest/coverage-v8": "^3.2.4",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"bumpp": "^10.2.0",
|
|
40
40
|
"commitizen": "^4.3.1",
|
|
41
41
|
"cz-conventional-changelog": "^3.3.0",
|
|
42
|
-
"eslint": "^9.
|
|
42
|
+
"eslint": "^9.32.0",
|
|
43
43
|
"lint-staged": "^16.1.2",
|
|
44
44
|
"npm-run-all": "^4.1.5",
|
|
45
45
|
"prettier": "^3.6.2",
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"vitest": "^3.2.4"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
|
-
"postinstall": "simple-git-hooks",
|
|
54
53
|
"rimraf": "rimraf ./node_modules/",
|
|
55
54
|
"ncu": "ncu -u --reject @types/node && pnpm install",
|
|
56
55
|
"commit": "git add . && git-cz && pnpm release -y",
|