UNPKG

nova-util

Version:

前端模块化 JavaScript 工具库

2 lines (1 loc) 43.8 kB
const t={DESC:0,ASC:1,RANDOM:2},e={ROUND:0,ROUND_FLOOR:1},n={ZH:"zh",EN:"en"},r={CH:/^[\u4E00-\u9FA5]+$/,EN:/^[a-zA-Z]$/,LOWER_CASE:/^[a-z]+$/,UPPER_CASE:/^[A-Z]+$/,CH_NAME:/^[\u4e00-\u9fa5·]{2,16}$/,EN_NAME:/(^[a-zA-Z][a-zA-Z\s]{0,20}[a-zA-Z]$)/,NUMBER:/^([-+])?\d+(\.\d+)?$/,INTEGER:/^(0|[1-9][0-9]*|-[1-9][0-9]*)$/,DECIMAL:/^\d+\.\d+$/,INT_OR_FLOAT:/(^[1-9][0-9]*$)|(^[1-9][0-9]*\.[0-9]{1,2}$)|(^0\.[0-9]{1,2}$)|(^0$)/,MOBILE:/^(?:(?:\+|00)86)?1[1-9]\d{9}$/,PHONE:/^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,EMAIL:/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/,ID_CARD:/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/,ID_CARD15:/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)/,ID_CARD18:/(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/,BANK_CARD:/^[1-9]\d{9,29}$/,POST_CODE:/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,URL:/^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?$/,IP:/((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))/,EXTERNAL:/^(http?:|https?:|mailto:|tel:)/},o={AM_PM:{zh:{AM:"上午",PM:"下午"},en:{AM:"AM",PM:"PM"}},WEEK:{zh:{FULL:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],SHORT:["周日","周一","周二","周三","周四","周五","周六"],MINI:["日","一","二","三","四","五","六"]},en:{FULL:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],SHORT:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MINI:["Su","Mo","Tu","We","Th","Fr","Sa"]}},MONTH:{zh:{FULL:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],SHORT:["一","二","三","四","五","六","七","八","九","十","十一","十二"]},en:{FULL:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}},QUARTER:{zh:{FULL:["第一季度","第二季度","第三季度","第四季度"],SHORT:["一季度","二季度","三季度","四季度"],MINI:["一","二","三","四"]},en:{FULL:["quarter 1st","quarter 2nd","quarter 3rd","quarter 4th"],SHORT:["Q1th","Q2nd","Q3rd","Q4th"],MINI:["Q1","Q2","Q3","Q4"]}},OVER_TIME:{zh:{YEAR:"年",MONTH:"月",DATE:"日",HOUR:"时",MINUTE:"分",SECOND:"秒",MILLISECOND:"毫秒",DAY:"天",QUARTER:"季度"},en:{YEAR:"year",MONTH:"month",DATE:"date",HOUR:"hour",MINUTE:"minute",SECOND:"second",MILLISECOND:"millisecond",DAY:"day",QUARTER:"quarter"}},PASS_TIME:{zh:{YEAR:"年前",MONTH:"个月前",DAY:"天前",BEFORE_YESTERDAY:"前天",YESTERDAY:"昨天",TODAY:"今天",HOUR:"小时前",MINUTE:"分钟前",JUST:"刚刚"},en:{YEAR:" year ago",MONTH:" month ago",DAY:" day ago",BEFORE_YESTERDAY:"before yesterday",YESTERDAY:" yesterday",TODAY:" today",HOUR:" hour ago",MINUTE:" minute ago",JUST:" just"}},HOLIDAY:{zh:["元旦","春节","清明节","劳动节","端午节","中秋节","国庆节"],en:["New Year‘s Day","Spring Festival","Tomb Sweeping Day","Labor Day","Dragon Boat Festival","Mid-Autumn Day","National Day"]},ZODIAC:{zh:["摩羯座","水瓶座","双鱼座","白羊座","金牛座","双子座","巨蟹座","狮子座","处女座","天秤座","天蝎座","射手座"],en:["Capricorn","Aquarius","Pisces","Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius"]},CHINESE_ZODIAC:{zh:["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"],en:["Rat","Ox","Tiger","Rabbit","Dragon","Snake","Horse","Goat","Monkey","Rooster","Dog","Pig"]},HEAVENLY_STEMS:{zh:["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],en:["Jia","Yi","Bing","Ding","Wu","Ji","Geng","Xin","Ren","Gui"]},EARTHLY_BRANCHES:{zh:["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],en:["Zi","Chou","Yin","Mao","Chen","Si","Wu","Wei","Shen","You","Xu","Hai"]}};function u(t){return t.replace(/(^\s*)|(\s*$)/g,"")}function i(t){return t.replace(/(^\s*)/g,"")}function a(t){return t.replace(/(\s*$)/g,"")}function c(t){return t.replace(/\s+/g,"")}function l(t,e,n){return t.replace(new RegExp(e,"gm"),n)}function f(t){return String(t).toLocaleUpperCase()}function s(t){String(t).toLocaleLowerCase()}function g(t){return/^[a-z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0)?t.replace(/([A-Z])/g,"_$1").toLowerCase():t.indexOf("-")>0?t.replace(/-/g,"_").toLowerCase():/^[A-Z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0)?(t=t.charAt(0).toLowerCase()+t.slice(1)).replace(/([A-Z])/g,"_$1").toLowerCase():void 0}function d(t){if(t.indexOf("_")>0)return t.replace(/_/g,"-").toLowerCase();if(/^[a-z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0))return t.replace(/([A-Z])/g,"-$1").toLowerCase();if(/^[A-Z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0)){return(t.charAt(0).toLowerCase()+t.slice(1)).replace(/([A-Z])/g,"-$1").toLowerCase()}}function h(t){return t.indexOf("_")>0?t.replace(/\_(\w)/g,(function(t,e){return e.toUpperCase()})):t.indexOf("-")>0?t.replace(/\-(\w)/g,(function(t,e){return e.toUpperCase()})):/^[A-Z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0)?t.charAt(0).toLowerCase()+t.slice(1):t}function p(t){if(t.indexOf("_")>0){let e=t.replace(/\_(\w)/g,(function(t,e){return e.toUpperCase()}));return e.charAt(0).toUpperCase()+e.slice(1)}if(t.indexOf("-")>0){let e=t.replace(/\-(\w)/g,(function(t,e){return e.toUpperCase()}));return e.charAt(0).toUpperCase()+e.slice(1)}return/^[a-z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0)?t.charAt(0).toUpperCase()+t.slice(1):t}function w(t){return window.btoa(t)}function D(t){return window.atob(t)}function M(t,e){return e.includes(t)}function m(t,e=2){let n=t.toString().length;for(;n<e;)t="0"+t,n++;return t}function S(t,e=2){let n=t.toString().length;for(;n<e;)t+="0",n++;return t}function y(t){if(!parseFloat(t))return t;let e=(t=String(t)).indexOf(".")>-1?/(\d)(?=(\d{3})+\.)/g:/(\d)(?=(?:\d{3})+$)/g;return t.replace(e,"$1,")}function E(t){let e,n,r,o=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],u=["","拾","佰","仟"],i=["","万","亿","兆"],a=["角","分","毫","厘"],c=Number("999999999999999.9999"),l="";if(""===t)return"";if((t=parseFloat(t))>=c)throw new Error("Calculated number overflow!");if(0===t)return l=o[0]+"元整",l;if(-1===(t=t.toString()).indexOf(".")?(e=t,n=""):(r=t.split("."),e=r[0],n=r[1].substr(0,4)),parseInt(e,10)>0){let t=0,n=e.length;for(let r=0;r<n;r++){let a=e.substr(r,1),c=n-r-1,f=c/4,s=c%4;"0"===a?t++:(t>0&&(l+=o[0]),t=0,l+=o[parseInt(a)]+u[s]),0===s&&t<4&&(l+=i[f])}l+="元"}if(""!==n){let t=n.length;for(let e=0;e<t;e++){let t=n.substr(e,1);"0"!==t&&(l+=o[Number(t)]+a[e])}}return""===l?l+=o[0]+"元整":""===n&&(l+="整"),l}function A(t){return 2===t.length?I(t,1,1):t.length>2?I(t,1,t.length-2):t}function O(t,e=3,n=4){return I(t,e,n)}function b(t,e=4,n=8){return I(t,e,n)}function R(t,e=4,n=11){return I(t,e,n)}function I(t,e,n){if(e>(t=String(t)).length)return t;let r="";return n<0&&(n=0),n>t.length-e&&(n=t.length-e),r=String().padEnd(n,"*"),t.substring(0,e)+r+t.substring(e+n)}function N(t,e=10){return Number.parseInt(t,e)}function T(t){return Number.isInteger(t)}function $(t){return/^\d+\.\d+$/.test(t)}function F(t){return"Number"===Object.prototype.toString.call(t).slice(8,-1)}function x(t){return"String"===Object.prototype.toString.call(t).slice(8,-1)}function C(t){return"Array"===Object.prototype.toString.call(t).slice(8,-1)}function U(t){return"Object"===Object.prototype.toString.call(t).slice(8,-1)}function L(t){return"Boolean"===Object.prototype.toString.call(t).slice(8,-1)}function P(t){return"Date"===Object.prototype.toString.call(t).slice(8,-1)}function Y(t){return"Function"===Object.prototype.toString.call(t).slice(8,-1)}function _(t){return"Symbol"===Object.prototype.toString.call(t).slice(8,-1)}function v(t){return"RegExp"===Object.prototype.toString.call(t).slice(8,-1)}function H(t){return"Error"===Object.prototype.toString.call(t).slice(8,-1)}function k(t){return"Promise"===Object.prototype.toString.call(t).slice(8,-1)}function j(t){return"Map"===Object.prototype.toString.call(t).slice(8,-1)}function z(t){return"WeakMap"===Object.prototype.toString.call(t).slice(8,-1)}function Q(t){return"Set"===Object.prototype.toString.call(t).slice(8,-1)}function B(t){return"WeakSet"===Object.prototype.toString.call(t).slice(8,-1)}function W(t){return"BigInt"===Object.prototype.toString.call(t).slice(8,-1)}function Z(t){return!K(t)}function K(t){return null==t||"undefined"===t||"null"===t||0===t||!1===t||NaN===t}function J(t){return window.isNaN(t)||C(t)||null==t||""===t}function q(t){return!J(t)}function V(t){return null==t||""===t}function G(t){return!V(t)}function X(t){return V(t)||!(Object.keys(t)||t).length}function tt(t){return!X(t)}function et(t){return X(t)||/^\s*$/.test(t)}function nt(t){return!et(t)}function rt(t){return void 0===t}function ot(t){return!rt(t)}function ut(t,e){return Object.is(t,e)}function it(t,e){return Object.is(t.toLowerCase(),e.toLowerCase())}function at(t,e){let n,r,o,u;function i(t,e){let n;if(J(t)&&J(e)&&"number"==typeof t&&"number"==typeof e)return!0;if(t===e)return!0;if("function"==typeof t&&"function"==typeof e||t instanceof Date&&e instanceof Date||t instanceof RegExp&&e instanceof RegExp||t instanceof String&&e instanceof String||t instanceof Number&&e instanceof Number)return t.toString()===e.toString();if(!(t instanceof Object&&e instanceof Object))return!1;if(t.isPrototypeOf(e)||e.isPrototypeOf(t))return!1;if(t.constructor!==e.constructor)return!1;if(t.prototype!==e.prototype)return!1;if(o.indexOf(t)>-1||u.indexOf(e)>-1)return!1;for(n in e){if(e.hasOwnProperty(n)!==t.hasOwnProperty(n))return!1;if(typeof e[n]!=typeof t[n])return!1}for(n in t){if(e.hasOwnProperty(n)!==t.hasOwnProperty(n))return!1;if(typeof e[n]!=typeof t[n])return!1;switch(typeof t[n]){case"object":case"function":if(o.push(t),u.push(e),!i(t[n],e[n]))return!1;o.pop(),u.pop();break;default:if(t[n]!==e[n])return!1}}return!0}if(arguments.length<1)return!0;for(n=1,r=arguments.length;n<r;n++)if(o=[],u=[],!i(arguments[0],arguments[n]))return!1;return!0}function ct(t){return Math.min.apply(null,t)}function lt(t){return Math.max.apply(null,t)}function ft(t){return t.reduce((function(t,e){return t+e}))}function st(t){return ft(t)/t.length}function gt(t,e){return!V(t)&&e.includes(t)}function dt(t,e){return t===e||t.length===e.length&&t.every(((t,n)=>t===e[n]))}function ht(t=0){return[...Array(t).keys()]}function pt(t=[],e=0,n=void 0){return t.splice(e,0,n),t}function wt(t=[],e=0,n=void 0){return e<0||e>t.length-1||t.splice(e,0,n),t}function Dt(t=[],e=0,n=void 0){return e<0||e>t.length-1||t.splice(e,0,t.splice(e,1,n)[0]),t}function Mt(t=[],e=0){return e<0||e>t.length-1||t.splice(e,1),t}function mt(t=[],e=0){return e<0||e>t.length-1||t.splice(e-1,1),t}function St(t=[],e=0){return e<0||e>t.length-1||t.splice(e+1,1),t}function yt(t=[],e=0){return e<0||e>t.length-1||t.unshift(t.splice(e,1)[0]),t}function Et(t=[],e=0){return e<0||e>t.length-1||t.push(t.splice(e,1)[0]),t}function At(t=[],e=0){return e<0||e>t.length-1||(e>0?t.splice(e-1,0,t.splice(e,1)[0]):t.push(t.splice(e,1)[0])),t}function Ot(t=[],e=0){return e<0||e>t.length-1||(e<t.length-1?t.splice(e+1,0,t.splice(e,1)[0]):t.unshift(t.splice(e,1)[0])),t}function bt(t,e,n){return e<0||n<0||e>t.length-1||n>t.length-1||([t[n],t[e]]=[t[e],t[n]]),t}function Rt(e,n=t.ASC){return e.sort(((r,o)=>{switch(n){case t.ASC:return r-o;case t.DESC:return o-r;case t.RANDOM:return Math.random()-.5;default:return e}}))}function It(t){return X(t)?[]:Array.from(new Set(t))}function Nt(t){for(let e=1;e<t.length;e++){const n=Math.floor(Math.random()*(e+1));[t[n],t[e]]=[t[e],t[n]]}return t}function Tt(t,e={key:"id",parentKey:"pid",childrenKey:"children"}){let n=e.key,r=e.parentKey,o=e.childrenKey;if(!t||0===t.length||!n||""===n)return[];const u=function(t,e,n){return t?(void 0!==n&&(t[e]=n),t[e]):null};let i=[],a={};for(let e=0;e<t.length;e++)t[e][o]&&delete t[e][o],a[t[e][n]]=t[e];for(let e=0;e<t.length;e++){let c=a[t[e][r]];if(c&&t[e][n]!==t[e][r]){let n=u(c,o);n||(n=u(c,o,[])),n.push(t[e])}else i.push(t[e])}return i}function $t(t,e={childrenKey:"children"}){let n=e.childrenKey,r=[];for(let o of t)if(o[n]&&!o[n].length&&delete o[n],r.push(o),o[n]&&o[n].length){let t=$t(o[n],e);t&&r.push(...t)}return r}function Ft(t,e){return[...new Set(t.concat(e))]}function xt(t,e){return[...new Set(t)].filter((t=>e.includes(t)))}function Ct(t,e){return[...new Set(t)].filter((t=>!e.includes(t)))}function Ut(t,e){return[...[...new Set(t)].filter((t=>!e.includes(t))),...[...new Set(e)].filter((e=>!t.includes(e)))]}function Lt(t){let e=Object.create(null);for(let[n,r]of t)e[n]=r;return e}function Pt(t){return JSON.stringify(Lt(t))}function Yt(t){let e=new Map;for(let n of Object.keys(t))e.set(n,t[n]);return e}function _t(t){return Yt(JSON.parse(t))}function vt(t){return JSON.stringify(t)}function Ht(t){if(!X(t))return JSON.parse(t)}function kt(t){return Object.assign(t)}function jt(t){if(U(t)){let e={};for(let n in t)t.hasOwnProperty(n)&&(e[n]=jt(t[n]));return e}if(C(t)){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=jt(t[n]);return e}if(P(t)){let e=new Date;return e.setTime(t.getTime()),e}return t}function zt(t,e){if(t===e)return!0;if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(!t||!e||"object"!=typeof t&&"object"!=typeof e)return t===e;if(t.prototype!==e.prototype)return!1;const n=Object.keys(t);return n.length===Object.keys(e).length&&n.every((n=>zt(t[n],e[n])))}function Qt(t,...e){return Object.assign(t,...e)}function Bt(t,e="data"){const n=(e||"data").split(".");let r=t,o=n.length-1;for(const t in n)null!==r[n[t]]&&void 0!==r[n[t]]||(r[n[t]]=Number(t)!==o?{}:void 0),r=r[n[t]];return r}function Wt(t,e="data",n){const r=(e||"data").split(".");let o="";for(const t of r)o+=`['${t}']`;new Function("target",`target${o}=${n}`)(t)}function Zt(t,e=1e3){let n;return function(){const r=arguments;n||(n=setTimeout((()=>{n=null,t.apply(this,r)}),e))}}function Kt(t,e=1e3,n=!0){let r;return function(){const o=arguments;if(r&&clearTimeout(r),n){const n=!r;r=setTimeout((function(){r=null}),e),n&&t.apply(this,o)}else r=setTimeout((function(){t.apply(this,o)}),e)}}function Jt(t=1e3){return new Promise((e=>setTimeout(e,t)))}function qt(){return xe()}function Vt(){return Rn(mn(new Date,-1))}function Gt(){return Rn(mn(new Date,1))}function Xt(t=new Date){return Rn(mn(t,-7))}function te(t=new Date){return Rn(mn(t,7))}function ee(t=new Date){return Rn(mn(t,-30))}function ne(t=new Date){return Rn(mn(t,30))}function re(t=new Date){return Rn(mn(t,-365))}function oe(t=new Date){return Rn(mn(t,365))}function ue(t=new Date){return t.getHours()<12}function ie(t=new Date){return t.getHours()>=12}function ae(t=new Date){let e=new Date;return["getFullYear","getMonth","getDate"].every((n=>e[n]()===t[n]()))}function ce(t=new Date){let e=t.getTime();return 1===N((Date.now()-e)/864e5)}function le(t=new Date){let e=t.getTime();return 2===N((Date.now()-e)/864e5)}function fe(t=new Date){return 1===N((t.getTime()-Date.now())/864e5)}function se(t=new Date){return 2===N((t.getTime()-Date.now())/864e5)}function ge(t=new Date){let e=He(t);return 6!==e&&7!==e}function de(t=new Date){let e=He(t);return 6===e||7===e}function he(t=new Date){return 1===He(t)}function pe(t=new Date){return 7===He(t)}function we(t=new Date){return 1===ke(t)}function De(t=new Date){return ke(t)===We(t)}function Me(t=new Date){return 1===je(t)}function me(t=new Date){return je(t)===Ze(t)}function Se(t=new Date){let e=t.getFullYear();return e%100!=0&&e%4==0||e%400==0}function ye(t=new Date){return!Se(t)}function Ee(t,e=new Date){return t.getTime()-e.getTime()<0}function Ae(t,e=new Date){return t.getTime()-e.getTime()>0}function Oe(t,e,n){let r=t.getTime(),o=e.getTime(),u=n.getTime();return r>o&&r<u}function be(t,e){return["getFullYear","getMonth","getDate"].every((n=>t[n]()===e[n]()))}function Re(t,e){let n=t.getTime()/864e5,r=e.getTime()/864e5;return N((n+4)/7)===N((r+4)/7)}function Ie(t,e){return["getFullYear","getMonth"].every((n=>t[n]()===e[n]()))}function Ne(t,e){return["getFullYear"].every((n=>t[n]()===e[n]()))}function Te(t,e){return be(t,e)||Ee(t,e)}function $e(t,e){return be(t,e)||Ae(t,e)}function Fe(){return new Date}function xe(t=new Date,e="yyyy-MM-dd"){return Rn(t,e)}function Ce(t=new Date,e="yyyy-MM-dd HH:mm:ss"){return Rn(t,e)}function Ue(t=new Date){return t.getTime()}function Le(t=new Date){return Math.round(t/1e3)}function Pe(t=new Date){return{year:t.getFullYear(),month:t.getMonth()+1,date:t.getDate(),hours:t.getHours(),minutes:t.getMinutes(),seconds:t.getSeconds(),milliseconds:t.getMilliseconds()}}function Ye(t=new Date){return Object.entries(Pe(t)).map((([t,e])=>e))}function _e(t=new Date,e="E",n="zh"){return"E"===e?o.WEEK[n].MINI[t.getDay()]:"EE"===e?o.WEEK[n].SHORT[t.getDay()]:"EEE"===e?o.WEEK[n].FULL[t.getDay()]:He(t)}function ve(t=new Date,e="Q",n="zh"){let r=Number(Math.floor((t.getMonth()+3)/3));return"Q"===e?o.QUARTER[n].MINI[r-1]:"QQ"===e?o.QUARTER[n].SHORT[r-1]:"QQQ"===e?o.QUARTER[n].FULL[r-1]:r}function He(t=new Date){return[7,1,2,3,4,5,6][t.getDay()]}function ke(t=new Date){return t.getDate()}function je(t=new Date){return Math.ceil((t-new Date(t.getFullYear().toString()))/864e5)+1}function ze(t=new Date){return Math.ceil((t.getDate()+6-He(t))/7)}function Qe(t=new Date){let e=new Date(t.getFullYear(),0,1),n=He(e),r=Math.round((t-e)/864e5);return Math.ceil((r+n)/7)}function Be(t=new Date){return 7}function We(t=new Date){return new Date(t.getFullYear(),t.getMonth()+1,0).getDate()}function Ze(t=new Date){return Se(t)?366:365}function Ke(t=new Date){let e=He(new Date(t.getFullYear(),0,1)),n=Se(t)?366:365;return 1===e?Math.ceil(n/7):Math.ceil((n-7+e)/7)}function Je(t=new Date){let e=He(new Date(t.getFullYear(),0,1)),n=Se(t)?366:365;return 1===e?Math.ceil(n/7):Math.ceil((n-7+e)/7)}function qe(t=new Date){let e=He(t);return t.setDate(t.getDate()-e+1),Rn(t)}function Ve(t=new Date){let e=He(t);return t.setDate(t.getDate()+(7-e)),Rn(t)}function Ge(t=new Date){let e=[],n=t.getDay(),r=new Date;r.setDate(t.getDate()-(0===n?6:n-1));for(let t=0;t<7;t++){let n=new Date(r);n.setDate(n.getDate()+t),e.push(Rn(n))}return e}function Xe(t=new Date){return t.setDate(1),Rn(t)}function tn(t=new Date){return Rn(new Date(t.getFullYear(),t.getMonth()+1,0))}function en(t=new Date){let e=[],n=new Date(t.getFullYear(),t.getMonth(),1),r=new Date(t.getFullYear(),t.getMonth()+1,0);for(let t=0;t<r.getDate();t++){let r=new Date(n);r.setDate(n.getDate()+t),e.push(r)}return e}function nn(t=new Date){return new Date(t.getFullYear(),0,1)}function rn(t=new Date){return new Date(t.getFullYear(),11,31)}function on(t=new Date){let e=[],n=new Date(t.getFullYear(),0,1),r=Ze();for(let t=0;t<r;t++){let r=new Date(n);r.setDate(n.getDate()+t),e.push(r.toLocaleDateString())}return e}function un(t,e){if(X(t)||X(e))return 0;let n=(e-t)/864e5;return n>=0?Math.abs(n):n}function an(t,e){if(X(t)||X(e))return 0;let n=(e-t)/6048e5;return n>=0?Math.abs(n):n}function cn(t,e){if(X(t)||X(e))return 0;let n=(t-e)/2592e6;return n>=0?Math.abs(n):n}function ln(t,e){if(X(t)||X(e))return 0;let n=(e-t)/31104e6;return n>=0?Math.abs(n):n}function fn(t,e){if(X(t)||X(e))return[];let n=[];for(;e-t>=0;){let e=t.getFullYear(),r=Nn(t.getMonth()+1),o=Nn(t.getDate());n.push(e+"-"+r+"-"+o),t.setDate(t.getDate()+1)}return n}function sn(t,e){if(X(t)||X(e))return[];let n=[],r=new Date,o=new Date;r.setFullYear(t.getFullYear(),t.getMonth()+1),o.setFullYear(e.getFullYear(),e.getMonth()+1);let u=r,i="";for(;u<=o;){let t=u.getMonth();i=0===t?u.getFullYear()-1+"-12":u.getFullYear()+"-"+Nn(t),n.push(i),u.setMonth(t+1)}return n}function gn(t,e){if(X(t)||X(e))return[];let n=[];for(;e-t>=0;){let e=t.getFullYear();n.push(e),t.setFullYear(t.getFullYear()+1)}return n}function dn(t,e="zh"){if(V(t))return"--";let n=t.getTime(),r=Date.now()-n,u=N(r/31104e6),i=N(r/2592e6),a=N(r/864e5),c=N(r/36e5),l=N(r/6e4);return u?u+o.PASS_TIME[e].YEAR:i?i+o.PASS_TIME[e].MONTH:a?1===a?o.PASS_TIME[e].YESTERDAY:2===a?o.PASS_TIME[e].BEFORE_YESTERDAY:a+o.PASS_TIME[e].DAY:c?c>12?o.PASS_TIME[e].TODAY:c+o.PASS_TIME[e].HOUR:l?l+o.PASS_TIME[e].MINUTE:o.PASS_TIME[e].JUST}function hn(t,e="zh"){if(V(t))return"--";let n=new Date,r=t.getTime()-n.getTime(),u=0,i=0,a=0,c=0;return r>=0&&(u=Math.floor(r/1e3/3600/24),i=Math.floor(r/1e3/60/60%24),a=Math.floor(r/1e3/60%60),c=Math.floor(r/1e3%60)),`${u}${o.OVER_TIME[e].DAY} ${i}${o.OVER_TIME[e].HOUR} ${a}${o.OVER_TIME[e].MINUTE} ${c}${o.OVER_TIME[e].SECOND}`}function pn(t,e="zh"){if(V(t))return"";let n=t.getMonth()+1;return t.getDate()<[20,19,21,20,21,22,23,23,23,24,23,22][n-1]?o.ZODIAC[e][n-1]:o.ZODIAC[e][n]}function wn(t,e="zh"){if(V(t))return"";let n=t.getFullYear();return n<1900?"未知":o.CHINESE_ZODIAC[e][(n-1900)%o.CHINESE_ZODIAC[e].length]}function Dn(t=new Date,e=1){return t.setFullYear(t.getFullYear()+e),t}function Mn(t=new Date,e=1){return t.setMonth(t.getMonth()+e),t}function mn(t=new Date,e=1){return t.setDate(t.getDate()+e),t}function Sn(t=new Date,e=1){return t.setHours(t.getHours()+e),t}function yn(t=new Date,e=1){return t.setMinutes(t.getMinutes()+e),t}function En(t=new Date,e=1){return t.setSeconds(t.getSeconds()+e),t}function An(t=new Date,e=100){return t.setMilliseconds(t.getMilliseconds()+e),t}function On(t=new Date,e=1){return t.setDate(t.getDate()+7*e),t}function bn(t=new Date,e=1){return t.setMonth(t.getMonth()+4*e),t}function Rn(t,e="yyyy-MM-dd",n="zh"){if(V(t))return"";if(x(t))t=In(t);else if(P(t));else if(T(t)&&13===String(t).length)t=new Date(t);else{if(!T(t)||10!==String(t).length)return console.error("Not supported date format!"),t;t=new Date(1e3*t)}let r={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours()%12==0?12:t.getHours()%12,"H+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"S+":t.getMilliseconds(),"a+":t.getHours()<12?"am":"pm","A+":t.getHours()<12?"AM":"PM","E+":t.getDay(),"Q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()},u=new RegExp(/(y+)/g);u.test(e)&&(e=e.replace(u,(function(e,n){return(t.getFullYear()+"").substring(4-n.length)})));let i=new RegExp(/((b+)|(A+))/g);i.test(e)&&(e=e.replace(i,(function(e,r){return r.length>1?t.getHours()<12?o.AM_PM[n].AM:o.AM_PM[n].PM:r===r.toLowerCase()?t.getHours()<12?o.AM_PM.en.AM.toLowerCase():o.AM_PM.en.PM.toLowerCase():t.getHours()<12?o.AM_PM.en.AM:o.AM_PM.en.PM})));let a=new RegExp(/(E+)/g);a.test(e)&&(e=e.replace(a,(function(e,r){return 1===r.length?o.WEEK[n].MINI[t.getDay()]:2===r.length?o.WEEK[n].SHORT[t.getDay()]:o.WEEK[n].FULL[t.getDay()]})));let c=new RegExp(/(Q+)/g);c.test(e)&&(e=e.replace(c,(function(e,r){return 1===r.length?o.QUARTER[n].MINI[Math.floor((t.getMonth()+3)/3)-1]:2===r.length?o.QUARTER[n].SHORT[Math.floor((t.getMonth()+3)/3)-1]:o.QUARTER[n].FULL[Math.floor((t.getMonth()+3)/3)-1]})));for(let t in r){let n=new RegExp("("+t+")");n.test(e)&&(e=e.replace(n,(function(e,n){return 1===n.length?r[t]:2===n.length?("00"+r[t]).substring((""+r[t]).length):("000"+r[t]).substring((""+r[t]).length)})))}return e}function In(t){return V(t)?null:x(t)?new Date(t.replace(/-/g,"/")):T(t)&&13===String(t).length?new Date(t):T(t)&&10===String(t).length?new Date(1e3*t):(console.error("Not supported date format!"),t)}function Nn(t){return(t=t.toString())[1]?t:"0"+t}function Tn(t,e){let n,r,o;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{r=e.toString().split(".")[1].length}catch(t){r=0}return o=Math.pow(10,Math.max(n,r)),(t*o+e*o)/o}function $n(t,e){let n,r,o,u;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{r=e.toString().split(".")[1].length}catch(t){r=0}return o=Math.pow(10,Math.max(n,r)),u=n>=r?n:r,((t*o-e*o)/o).toFixed(u)}function Fn(t,e){let n=0,r=t.toString(),o=e.toString();try{n+=r.split(".")[1].length}catch(t){}try{n+=o.split(".")[1].length}catch(t){}return Number(r.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)}function xn(t,e){let n,r,o=0,u=0;try{o=t.toString().split(".")[1].length}catch(t){}try{u=e.toString().split(".")[1].length}catch(t){}return n=Number(t.toString().replace(".","")),r=Number(e.toString().replace(".","")),n/r*Math.pow(10,u-o)}function Cn(t,e){let n=0,r=0,o=0;try{n=t.toString().split(".")[1].length}catch(t){}try{r=e.toString().split(".")[1].length}catch(t){}return o=Math.pow(10,Math.max(n,r)),Math.round(Number(t)*o)%Math.round(Number(e)*o)/o}function Un(t,e){return e?Un(e,t%e):t}function Ln(t,e){return t*e/Un(t,e)}function Pn(t,n=2,r=e.ROUND){return r===e.ROUND?function(t,e=2){if(J(t))return"--";let n=String(t);e||(e=0);-1===n.indexOf(".")&&(n+=".");if(n+=new Array(e+1).join("0"),new RegExp("^(-|\\+)?(\\d+(\\.\\d{0,"+(e+1)+"})?)\\d*$").test(n)){let t="0"+RegExp.$2,n=RegExp.$1,r=RegExp.$3.length,o=!0;if(r===e+2){if(r=t.match(/\d/g),parseInt(r[r.length-1])>4)for(let t=r.length-2;t>=0&&(r[t]=parseInt(r[t])+1,10===r[t]);t--)r[t]=0,o=1!==t;t=r.join("").replace(new RegExp("(\\d+)(\\d{"+e+"})\\d$"),"$1.$2")}return o&&(t=t.substr(1)),(n+t).replace(/\.$/,"")}return String(t)}(t,n):r===e.ROUND_FLOOR?function(t,e=2){if(J(t))return"--";let n=e,r=Number(t),o=String(r).indexOf(".")+1,u=o?String(r).length-o:0;if(0===o||u<=n){let t=r;if(0===o){t=`${t}.`;for(let e=0;e<n-u;e++)t=`${t}0`}else for(let e=0;e<n-u;e++)t=`${t}0`;return t}let i="";return i=`${String(r).split(".")[0]}.${String(r).split(".")[1].substring(0,n)}`,String(i)}(t,n):void 0}function Yn(t,n=2,r=e.ROUND){return r===e.ROUND?function(t,e=2){if(J(t))return"--";let n=Math.pow(10,e);return Math.round(t*n)/n}(t,n):r===e.ROUND_FLOOR?function(t,e=2){if(J(t))return"--";let n=Math.pow(10,e);return Math.floor(t*n)/n}(t,n):void 0}function _n(t,e){return new RegExp(e).test(t)}function vn(t){return _n(t,r.CH)}function Hn(t){return _n(t,r.EN)}function kn(t){return _n(t,r.EXTERNAL)}function jn(t){return _n(t,r.LOWER_CASE)}function zn(t){return _n(t,r.UPPER_CASE)}function Qn(t){return _n(t,r.EMAIL)}function Bn(t){return _n(t,r.ID_CARD)}function Wn(t){return _n(t,r.URL)}function Zn(t=0,e=9){return Math.floor(Math.random()*(e-t+1)+t)}function Kn(t=1){return Math.floor((Math.random()+Math.floor(9*Math.random()+1))*Math.pow(10,t-1))}function Jn(t){return X(t)?"0B":t<1024?t+"B":t<1048576?(t/1024).toFixed(2)+"KB":t<1073741824?(t/1048576).toFixed(2)+"MB":(t/1073741824).toFixed(2)+"GB"}function qn(t){if(!X(t))return t.substring(0,t.lastIndexOf("."))}function Vn(t){if(!X(t))return t.substring(t.lastIndexOf(".")+1).toLowerCase()}function Gn(t){return new Promise(((e,n)=>{let r=new FileReader;r.readAsDataURL(t),r.onload=n=>{const r=new Blob([n.target.result],{type:t.type});e(r)},r.onerror=function(t){console.error(t),n(t)}}))}function Xn(t){return new Promise(((e,n)=>{let r=new FileReader;r.readAsDataURL(t),r.onload=function(t){e(t.target.result)},r.onerror=function(t){console.error(t),n(t)}}))}function tr(t){return new Promise(((e,n)=>{try{e(URL.createObjectURL(t))}catch(e){console.error(e),URL.revokeObjectURL(t),n(e)}}))}function er(t,e=Date.now()){return new Promise(((n,r)=>{try{const r=t.type,o=t.size,u=r.split("/")[1];n(new File([t],`${Date.now()}.${u}`,{type:r,size:o,name:`${e}.${u}`,lastModified:Date.now(),lastModifiedDate:new Date}))}catch(t){console.error(t),r(t)}}))}function nr(t){return new Promise(((e,n)=>{let r=new FileReader;r.readAsDataURL(t),r.onload=function(t){e(t.target.result)},r.onerror=function(t){console.error(t),n(t)}}))}function rr(t,e=Date.now()){return new Promise(((n,r)=>{try{const r=t.split(","),o=r[0].match(/:(.*?);/)[1],u=o.split("/")[1],i=window.atob(r[1]);let a=i.length;const c=new Uint8Array(a);for(;a--;)c[a]=i.charCodeAt(a);n(new File([c],`${e}.${u}`,{type:o}))}catch(t){console.error(t),r(t)}}))}function or(t){return new Promise(((e,n)=>{try{const n=t.split(","),r=n[0].match(/:(.*?);/)[1],o=window.atob(n[1]);let u=o.length;const i=new Uint8Array(u);for(;u--;)i[u]=o.charCodeAt(u);e(new Blob([i],{type:r}))}catch(t){console.error(t),n(t)}}))}function ur(t){return new Promise(((e,n)=>{const r=new Image;r.src=t,r.onload=function(){const t=document.createElement("canvas"),n=t.getContext("2d");t.width=r.width,t.height=r.height,n.drawImage(r,0,0,r.width,r.height);const o=t.toDataURL("image/png");e(o)},r.onerror=function(t){console.error(t),n(t)}}))}function ir(t,e){try{const n=window.URL.createObjectURL(t),r=window.document.createElement("a");r.download=e,r.href=n,r.click(),URL.revokeObjectURL(n)}catch(t){console.error(t)}}function ar(t,e){try{const n=window.document.createElement("a");n.download=e,n.href=t,window.document.body.appendChild(n),n.click(),window.document.body.removeChild(n)}catch(t){console.error(t)}}function cr(t){let e=t.split(","),n=parseInt(e[0].split("(")[1]),r=parseInt(e[1]),o=parseInt(e[2].split(")")[0]);return"#"+Dr(n)+Dr(r)+Dr(o)}function lr(t){let e=t.split(","),n=parseInt(e[0].split("(")[1]),r=parseInt(e[1]),o=parseInt(e[2]),u=parseFloat(e[3].split(")")[0]);return`#${Dr(Math.round(256*u-1))}${Dr(n)}${Dr(r)}${Dr(o)}`}function fr(t){let e,n,r=t.split(","),o=parseInt(r[0].split("(")[1])/255,u=parseInt(r[1])/255,i=parseInt(r[2])/255,a=parseFloat(r[3]&&r[3].split(")")[0]),c=Math.max(o,u,i),l=Math.min(o,u,i),f=(c+l)/2;if(c===l)e=n=0;else{let t=c-l;switch(n=f>.5?t/(2-c-l):t/(c+l),c){case o:e=(u-i)/t+(u<i?6:0);break;case u:e=(i-o)/t+2;break;case i:e=(o-u)/t+4}e/=6}return a?`hsla(${Math.round(360*e)},${Math.round(100*n)}%,${Math.round(100*f)}%,${a})`:`hsl(${Math.round(360*e)},${Math.round(100*n)}%,${Math.round(100*f)}%)`}function sr(t){let e={},n=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return e.r=parseInt(r[1],16),e.g=parseInt(r[2],16),e.b=parseInt(r[3],16),`rgb(${e.r},${e.g},${e.b})`}function gr(t,e=1){let n={},r=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return n.r=parseInt(o[1],16),n.g=parseInt(o[2],16),n.b=parseInt(o[3],16),n.o=e,`rgba(${n.r},${n.g},${n.b},${n.o})`}function dr(t){let e,n,r=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),u=parseInt(o[1],16)/255,i=parseInt(o[2],16)/255,a=parseInt(o[3],16)/255,c=Math.max(u,i,a),l=Math.min(u,i,a),f=(c+l)/2;if(c===l)e=n=0;else{let t=c-l;switch(n=f>.5?t/(2-c-l):t/(c+l),c){case u:e=(i-a)/t+(i<a?6:0);break;case i:e=(a-u)/t+2;break;case a:e=(u-i)/t+4}e/=6}return`hsl(${Math.round(360*e)},${Math.round(100*n)}%,${Math.round(100*f)}%)`}function hr(){return"#"+(t=(16777216*Math.random()|0).toString(16),new Array(7-t.length).join("0")+t);var t}function pr(){return`rgb(${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Math.floor(256*Math.random())})`}function wr(){return`rgba(${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Number(Math.random()).toFixed(2)})`}function Dr(t){if(t>255)throw"'"+t+"'' is greater than 255(0xff);";return("0"+Number(t).toString(16)).slice(-2)}const Mr={8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"Caps Lock",27:"Escape",32:"Space",33:"Page Up",34:"Page Down",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",42:"Print Screen",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Windows",93:"Right Click",96:"Numpad 0",97:"Numpad 1",98:"Numpad 2",99:"Numpad 3",100:"Numpad 4",101:"Numpad 5",102:"Numpad 6",103:"Numpad 7",104:"Numpad 8",105:"Numpad 9",106:"Numpad *",107:"Numpad +",109:"Numpad -",110:"Numpad .",111:"Numpad /",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Num Lock",145:"Scroll Lock",182:"My Computer",183:"My Calculator",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"};function mr(t){return Mr[t]?Mr[t]:(console.log("Unknow Key Code: "+t),"")}function Sr(t){for(let e in Mr)if(Mr[e]===t)return e}function yr(t=32,e=16){const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");let r,o=[];if(e=e||n.length,t)for(r=0;r<t;r++)o[r]=n[0|Math.random()*e];else{let t;for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",r=0;r<36;r++)o[r]||(t=0|16*Math.random(),o[r]=n[19===r?3&t|8:t])}return o.join("")}function Er(){let t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}function Ar(t){if(X(t))return;const e={};return e.province={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"}[t.substring(0,2)],15===t.length&&(e.birthday="19"+t.substring(6,8)+"-"+t.substring(8,10)+"-"+t.substring(10,12),e.age=Or(e.birthday),e.sex=Number(t.substring(14))%2==0?"女":"男"),18===t.length&&(e.birthday=t.substring(6,10)+"-"+t.substring(10,12)+"-"+t.substring(12,14),e.age=Or(e.birthday),e.sex=Number(t.substring(16,17))%2==0?"女":"男"),e}function Or(t){if(X(t))return 0;let e=0,n=t.split("-"),r=Number(n[0]),o=Number(n[1]),u=Number(n[2]),i=new Date,a=i.getFullYear(),c=i.getMonth()+1,l=i.getDate(),f=a-r;return f>0&&(e=c-o<=0&&l-u<0?f-1:f),e}function br(t,e=window.location.href){t=t.replace(/[\[\]]/g,"\\$&"),e=e.split("?")[1];let n=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),r=e.substring(0).match(n);return null!=r?decodeURI(r[2]):""}function Rr(t=window.location.href){if(-1===t.indexOf("?"))return{};let e="?"===t[0]?t.substr(1):t.substring(t.lastIndexOf("?")+1);e=e.split("&");let n={};for(let t=0;t<e.length;t++){let r=e[t].split("=");n[decodeURIComponent(r[0])]=decodeURIComponent(r[1]||"")}return n}function Ir(t){if(!t)return"";let e=[];for(let n in t){let r=t[n];if(r instanceof Array)for(let t=0;t<r.length;++t)e.push(encodeURIComponent(n+"["+t+"]")+"="+encodeURIComponent(r[t]));else e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]))}return e.join("&")}function Nr(){return window.navigator.cookieEnabled}function Tr(t){if("undefined"==typeof document)return"";let e=document.cookie?document.cookie.replace(/\s/g,"").split(";"):[];for(let n in e){let r=e[n].split("=");if(r[0]===t)return decodeURIComponent(r[1])}return""}function $r(t,e,n=864e5){"undefined"!=typeof document&&(document.cookie=t+"="+e+";expires="+new Date(Date.now()+n))}function Fr(t){X(t)||$r(t,"",-1)}function xr(t=document.domain){let e=document.cookie.match(/[^ =;]+(?==)/g);if(e)for(let n=e.length;n--;)document.cookie=e[n]+"=0;path=/;"+t?"domain="+t+";":"expires="+new Date(0).toUTCString()}function Cr(t){return window.localStorage.getItem(t)||void 0}function Ur(t,e){window.localStorage.setItem(t,e)}function Lr(t){window.localStorage.removeItem(t)}function Pr(){window.localStorage.clear()}function Yr(t){return window.sessionStorage.getItem(t)||""}function _r(t,e){window.sessionStorage.setItem(t,e)}function vr(t){window.sessionStorage.removeItem(t)}function Hr(){window.sessionStorage.clear()}function kr(){return!(!window.localStorage||!window.sessionStorage)}function jr(t,e){return t.className.indexOf(e)>0}function zr(t,e){jr(t,e)||(t.className+=" "+e)}function Qr(t,e){jr(t,e)&&(t.className=t.className.replace(new RegExp(e,"gm"),""))}function Br(t,e,n){Qr(t,n),zr(t,e)}function Wr(t,e={}){if(t)for(let n in e)t.style[n]=e[n]}function Zr(t,e){if(t)return t.style[e]}function Kr(t,e){t&&t.style.removeProperty(e)}function Jr(t){const e={"<":"&lt;",">":"&gt;","&":"&amp;","(":"&#40;",")":"&#41;","/":"&#47;"," ":"&nbsp;",'"':"&quot;","'":"&#39;"};return t.replace(/[<>&|()\/ '"]/g,(function(t){return e[t]}))}function qr(t){const e={"&lt;":"<","&gt;":">","&amp;":"&","&#40;":"(","&#41;":")","&#47;":"/","&nbsp;":" ","&quot;":'"',"&#39;":"'"};return t.replace(/(&lt;|&gt;|&amp;|&#40;|&#41;|&#47;|&nbsp;|&quot;|&#39;)/gi,(function(t,n){return e[n]}))}function Vr(t){return new Promise(((e,n)=>{navigator.clipboard.writeText(t).then((()=>{e(t)})).catch((t=>{console.error("copy error!"),n(t)}))}))}function Gr(){return new Promise(((t,e)=>{navigator.clipboard.readText().then((e=>{t(e)})).catch((t=>{e(t)}))}))}function Xr(){let t=window.navigator.userAgent.toLowerCase(),e=t.match(/rv:([\d.]+)\) like gecko/)||t.match(/msie ([\d\.]+)/),n=t.match(/edg\/([\d\.]+)/),r=t.match(/firefox\/([\d\.]+)/),o=t.match(/(?:opera|opr).([\d\.]+)/),u=t.match(/chrome\/([\d\.]+)/),i=t.match(/version\/([\d\.]+).*safari/);return e?{name:"ie",version:e[1]}:n?{name:"edge",version:n[1]}:r?{name:"firefox",version:r[1]}:o?{name:"opera",version:o[1]}:u?{name:"chrome",version:u[1]}:i?{name:"safari",version:i[1]}:"unknown"}function to(){return!function(){let t=window.navigator.userAgent;return/Android|webOS|iPhone|iPod|BlackBerry|Windows Phone|IEMobile/i.test(t)}()}function eo(){let t=window.navigator.userAgent;return/Android|BlackBerry/i.test(t)}function no(){let t=window.navigator.userAgent;return/iPhone|iPad|iPod|iOS/i.test(t)}function ro(){let t=window.navigator.userAgent;return/Windows Phone/i.test(t)}function oo(){let t=window.navigator.userAgent;return/win/i.test(t)}function uo(){let t=window.navigator.userAgent;return/linux/i.test(t)}function io(){let t=window.navigator.userAgent;return/mac/i.test(t)}function ao(){let t=window.navigator.userAgent;return/iPhone/i.test(t)}function co(){let t=window.navigator.userAgent;return/iPod/i.test(t)}function lo(){let t=window.navigator.userAgent;return/MicroMessenger/i.test(t)}function fo(){let t=window.navigator.userAgent;return/QQ/i.test(t)}function so(t,e){wx.setStorageSync(t,e)}function go(t){return wx.getStorageSync(t)}function ho(){return wx.getStorageInfoSync()}function po(t){wx.removeStorageSync(t)}function wo(){wx.clearStorageSync()}function Do({key:t,data:e,encrypt:n=!1}){return new Promise(((r,o)=>{wx.setStorage({key:t,data:e,encrypt:n,success(t){r(t)},fail(t){o(t)}})}))}function Mo({key:t,encrypt:e=!1}){return new Promise(((n,r)=>{wx.getStorage({key:t,encrypt:e,success(t){n(t)},fail(t){r(t)}})}))}function mo(){return new Promise(((t,e)=>{wx.getStorageInfo({success(e){t(e)},fail(t){e(t)}})}))}function So({key:t}){return new Promise(((e,n)=>{wx.removeStorage({key:t,success(t){e(t)},fail(t){n(t)}})}))}function yo(){return new Promise(((t,e)=>{wx.clearStorage({success(e){t(e)},fail(t){e(t)}})}))}const Eo=function(){console.log("Nice, loaded successfully!")};export{o as DATE,n as LANG,e as MATH,r as REGEXP,t as SORT,Tn as add,zr as addClass,mn as addDate,Sn as addHours,An as addMillisecond,yn as addMinutes,Mn as addMonth,bn as addQuarter,En as addSeconds,Wr as addStyle,On as addWeek,Dn as addYear,st as arrayAvg,Et as arrayBottom,Ut as arrayComplement,ht as arrayCreate,Ct as arrayDifference,Ot as arrayDown,dt as arrayEquals,pt as arrayInsert,Dt as arrayInsertAfter,wt as arrayInsertBefore,xt as arrayIntersect,lt as arrayMax,ct as arrayMin,Mt as arrayRemove,St as arrayRemoveAfter,mt as arrayRemoveBefore,Nt as arrayShuffle,Rt as arraySort,ft as arraySum,bt as arraySwap,Tt as arrayToTree,yt as arrayTop,Ft as arrayUnion,It as arrayUnique,At as arrayUp,or as base64ToBlob,rr as base64ToFile,nr as blobToBase64,er as blobToFile,xr as clearCookie,Pr as clearLocalStorage,Hr as clearSessionStorage,yo as clearStorage,wo as clearStorageSync,kt as clone,jt as cloneDeep,Vr as copyText,Kt as debounce,D as decode,at as deepCompare,xn as divide,ir as downloadBlobFile,ar as downloadFileUrl,w as encode,ut as equals,it as equalsIgnoreCase,Xn as fileToBase64,Gn as fileToBlob,tr as fileToUrl,Rn as formatDate,Jn as formatFileSize,E as formatRmbChinese,R as formatStartOfBankCard,b as formatStartOfIdCard,O as formatStartOfMobile,A as formatStartOfName,y as formatThousand,Un as gcd,Or as getAge,fn as getBetweenDates,sn as getBetweenMonths,gn as getBetweenYears,Xr as getBrowserInfo,wn as getChineseZodiac,Tr as getCookie,Gr as getCopyText,xe as getDate,Ye as getDateArray,Pe as getDateObject,Ce as getDateTime,ke as getDayOfMonth,He as getDayOfWeek,je as getDayOfYear,We as getDaysOfMonth,Be as getDaysOfWeek,Ze as getDaysOfYear,un as getDiffDay,cn as getDiffMonth,an as getDiffWeek,ln as getDiffYear,qn as getFileName,Vn as getFileSuffix,Xe as getFirstDateOfMonth,qe as getFirstDateOfWeek,nn as getFirstDateOfYear,en as getFullDateOfMonth,Ge as getFullDateOfWeek,on as getFullDateOfYear,Er as getGUID,Ar as getIdCardInfo,Sr as getKeyCode,mr as getKeyName,tn as getLastDateOfMonth,Ve as getLastDateOfWeek,rn as getLastDateOfYear,Cr as getLocalStorage,Fe as getNow,hn as getOverTime,dn as getPastTime,ve as getQuarter,br as getQueryString,Zn as getRandom,Kn as getRandomDigit,hr as getRandomHex,pr as getRandomRgb,wr as getRandomRgba,Yr as getSessionStorage,Mo as getStorage,mo as getStorageInfo,ho as getStorageInfoSync,go as getStorageSync,Zr as getStyle,Bt as getTargetValueByPath,Ue as getTimestamp,yr as getUUID,Le as getUnixTimestamp,_e as getWeek,ze as getWeekOfMonth,Qe as getWeekOfYear,Ke as getWeeksOfMonth,Je as getWeeksOfYear,pn as getZodiac,jr as hasClass,dr as hexToHsl,sr as hexToRgb,gr as hexToRgba,qr as htmlDecode,Jr as htmlEncode,gt as inArray,M as inString,ue as isAM,Ae as isAfter,se as isAfterTomorrow,eo as isAndroid,C as isArray,Ee as isBefore,le as isBeforeYesterday,Oe as isBetween,W as isBigInt,et as isBlank,L as isBoolean,vn as isChinese,ye as isCommonYear,P as isDate,$ as isDecimal,Qn as isEmail,X as isEmpty,Hn as isEnglish,H as isError,kn as isExternal,K as isFalse,we as isFirstDayOfMonth,he as isFirstDayOfWeek,Me as isFirstDayOfYear,Y as isFunction,Bn as isIdCard,T as isInteger,no as isIos,co as isIpad,ao as isIphone,De as isLastDayOfMonth,pe as isLastDayOfWeek,me as isLastDayOfYear,Se as isLeapYear,uo as isLinux,jn as isLowerCase,io as isMac,j as isMap,J as isNaN,nt as isNotBlank,tt as isNotEmpty,q as isNotNaN,G as isNotNull,ot as isNotUndefined,V as isNull,F as isNumber,U as isObject,ie as isPM,to as isPc,k as isPromise,fo as isQQ,v as isRegExp,be as isSame,Ie as isSameMonth,$e as isSameOrAfter,Te as isSameOrBefore,Re as isSameWeek,Ne as isSameYear,Q as isSet,x as isString,Nr as isSupportCookie,kr as isSupportStorage,_ as isSymbol,ae as isToday,fe as isTomorrow,Z as isTrue,rt as isUndefined,zn as isUpperCase,Wn as isUrl,z as isWeakMap,B as isWeakSet,de as isWeekend,lo as isWeixin,oo as isWindows,ro as isWindowsPhone,ge as isWorkday,ce as isYesterday,_t as jsonToMap,ee as lastMonth,Xt as lastWeek,re as lastYear,Eo as loadedTest,Pt as mapToJson,Lt as mapToObject,Qt as merge,Cn as modulo,Fn as multiply,ne as nextMonth,te as nextWeek,oe as nextYear,Ir as objToQueryString,zt as objectEquals,Yt as objectToMap,In as parseDate,N as parseInt,Ht as parseJson,Rr as queryStringToObj,_n as regexpTest,Qr as removeClass,Fr as removeCookie,Lr as removeLocalStorage,vr as removeSessionStorage,So as removeStorage,po as removeStorageSync,Kr as removeStyle,l as replaceAll,Br as replaceClass,cr as rgbToHex,lr as rgbaToHex,fr as rgbaToHsl,Ln as scm,$r as setCookie,Ur as setLocalStorage,_r as setSessionStorage,Do as setStorage,so as setStorageSync,Wt as setTargetValueByPath,Jt as sleep,vt as stringifyJson,$n as subtract,Zt as throttle,h as toCamelCase,Yn as toDecimal,Pn as toFixed,d as toKebabCase,s as toLower,p as toPascalCase,g as toSnakeCase,f as toUpper,qt as today,Gt as tomorrow,$t as treeToArray,u as trim,c as trimAll,a as trimEnd,i as trimStart,ur as urlToBase64,Vt as yesterday,S as zeroEnd,m as zeroStart};