UNPKG

@ivu-plus/i-utils

Version:

前端模块化 JavaScript 工具库

26 lines 170 kB
const t={DESC:0,ASC:1,RANDOM:2},e={ROUND:0,ROUND_FLOOR:1},r={ZH:"zh",EN:"en"},n={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:/^(?:(ftp|https?|ftps):\/\/)?((?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+(?:[a-zA-Z]{2,6})?)?(?::(\d+))?(?:\/([^\?#]*))?(?:\?([^#]*))?(?:#(.*))?$/,IP:/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,IP6:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,EXTERNAL:/^(http?:|https?:|mailto:|tel:)/,FUNCTION_STR:/(function\([\w,\s]*\)\s*{[\s\S]*})|\(\s*([\w,\s]*)\s*\)\s*=>\s*{[\s\S]*}|(async\s*function\s*\([\w,\s]*\)\s*{[\s\S]*}\)\s*{[\s\S]*})|(async\(\s*([\w,\s]*)\s*\)\s*=>\s*{[\s\S]*})$/},i={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"]}},o={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:"'"},s={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:"国外"},SEX:{MAN:"男",WOMAN:"女"}};function h(t,e){return e.includes(t)}function a(t){return t.replace(/(^\s*)|(\s*$)/g,"")}function u(t){return t.replace(/(^\s*)/g,"")}function c(t){return t.replace(/(\s*$)/g,"")}function f(t){return t.replace(/\s+/g,"")}function l(t,e,r){return t.replace(new RegExp(e,"gm"),r)}function p(t){return String(t).toLocaleUpperCase()}function d(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 y(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 w(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 m(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 A(t,e=2){let r=t.toString().length;for(;r<e;)t="0"+t,r++;return t}function b(t,e=2){let r=t.toString().length;for(;r<e;)t+="0",r++;return t}function v(t){return t?t.split(/(?=[A-Z])|[\.\-\s_]/).map((t=>t.trim())).filter((t=>!!t)).map((t=>m(t.toLowerCase()))).join(" "):""}function S(t,e){return t?Array.from(t.matchAll(/\{\{(.+?)\}\}/g)).reduce(((t,r)=>t.replace(r[0],e[r[1]])),t):""}function D(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,r,n,i=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],o=["","拾","佰","仟"],s=["","万","亿","兆"],h=["角","分","毫","厘"],a=Number("999999999999999.9999"),u="";if(""===t)return"";if((t=parseFloat(t))>=a)throw new Error("Calculated number overflow!");if(0===t)return u=i[0]+"元整",u;if(-1===(t=t.toString()).indexOf(".")?(e=t,r=""):(n=t.split("."),e=n[0],r=n[1].substr(0,4)),parseInt(e,10)>0){let t=0,r=e.length;for(let n=0;n<r;n++){let h=e.substr(n,1),a=r-n-1,c=a/4,f=a%4;"0"===h?t++:(t>0&&(u+=i[0]),t=0,u+=i[parseInt(h)]+o[f]),0===f&&t<4&&(u+=s[c])}u+="元"}if(""!==r){let t=r.length;for(let e=0;e<t;e++){let t=r.substr(e,1);"0"!==t&&(u+=i[Number(t)]+h[e])}}return""===u?u+=i[0]+"元整":""===r&&(u+="整"),u}function F(t){return Number.isInteger(t)}function M(t){return/^\d+\.\d+$/.test(t)}function C(t){return"Number"===Object.prototype.toString.call(t).slice(8,-1)}function B(t){return"String"===Object.prototype.toString.call(t).slice(8,-1)}function T(t){return"Array"===Object.prototype.toString.call(t).slice(8,-1)}function O(t){return"Object"===Object.prototype.toString.call(t).slice(8,-1)}function I(t){return"Boolean"===Object.prototype.toString.call(t).slice(8,-1)}function R(t){return"Date"===Object.prototype.toString.call(t).slice(8,-1)}function _(t){return"Function"===Object.prototype.toString.call(t).slice(8,-1)}function x(t){if(!n.FUNCTION_STR.test(t))return!1;try{return new Function(`return ${t}`),!0}catch(t){return!1}}function N(t){return"AsyncFunction"===Object.prototype.toString.call(t).slice(8,-1)}function U(t){return"Symbol"===Object.prototype.toString.call(t).slice(8,-1)}function P(t){return"RegExp"===Object.prototype.toString.call(t).slice(8,-1)}function k(t){return"Error"===Object.prototype.toString.call(t).slice(8,-1)}function z(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 $(t){return"WeakMap"===Object.prototype.toString.call(t).slice(8,-1)}function L(t){return"Set"===Object.prototype.toString.call(t).slice(8,-1)}function q(t){return"WeakSet"===Object.prototype.toString.call(t).slice(8,-1)}function H(t){return"BigInt"===Object.prototype.toString.call(t).slice(8,-1)}function Y(t){try{return JSON.parse(t),!0}catch(t){return!1}}function V(t){return!J(t)}function J(t){return null==t||"undefined"===t||"null"===t||0===t||!1===t||W(t)}function W(t){return window.isNaN(t)||T(t)||null==t||""===t}function K(t){return!W(t)}function Z(t){return null==t||""===t}function Q(t){return!Z(t)}function X(t){return Z(t)||!(Object.keys(t)||t).length}function G(t){return!X(t)}function tt(t){return X(t)||/^\s*$/.test(t)}function et(t){return!tt(t)}function rt(t){return void 0===t}function nt(t){return!rt(t)}function it(t,e){return Object.is(t,e)}function ot(t,e){return Object.is(t.toLowerCase(),e.toLowerCase())}function st(t,e){let r,n,i,o;function s(t,e){let r;if(W(t)&&W(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(i.indexOf(t)>-1||o.indexOf(e)>-1)return!1;for(r in e){if(e.hasOwnProperty(r)!==t.hasOwnProperty(r))return!1;if(typeof e[r]!=typeof t[r])return!1}for(r in t){if(e.hasOwnProperty(r)!==t.hasOwnProperty(r))return!1;if(typeof e[r]!=typeof t[r])return!1;switch(typeof t[r]){case"object":case"function":if(i.push(t),o.push(e),!s(t[r],e[r]))return!1;i.pop(),o.pop();break;default:if(t[r]!==e[r])return!1}}return!0}if(arguments.length<1)return!0;for(r=1,n=arguments.length;r<n;r++)if(i=[],o=[],!s(arguments[0],arguments[r]))return!1;return!0}function ht(t,e=10){return Z(t)?0:Number.parseInt(t,e)}function at(t){return Z(t)?0:Number.parseFloat(t)}function ut(t){return Math.min.apply(null,t)}function ct(t){return Math.max.apply(null,t)}function ft(t){return t.reduce((function(t,e){return t+e}))}function lt(t){return ft(t)/t.length}function pt(t,e){return!Z(t)&&e.includes(t)}function dt(t,e){return t===e||t.length===e.length&&t.every(((t,r)=>t===e[r]))}function gt(t=0){return[...Array(t).keys()]}function yt(t=[],e=0,r=void 0){if(e<0)return t;if(0===t.length)t.push(r);else{if(e>t.length-1)return t;t.splice(e,0,r)}return t}function wt(t=[],e=0,r=void 0){if(e<0)return t;if(0===t.length)t.push(r);else{if(e>t.length-1)return t;t.splice(e,0,r)}return t}function mt(t=[],e=0,r=void 0){if(e<0)return t;if(0===t.length)t.push(r);else{if(e>t.length-1)return t;t.splice(e,0,t.splice(e,1,r)[0])}return t}function At(t=[],e=0){return e<0||e>t.length-1||t.splice(e,1),t}function bt(t=[],e=0){return e<=0||e>t.length-1||t.splice(e-1,1),t}function vt(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.unshift(t.splice(e,1)[0]),t}function Dt(t=[],e=0){return e<0||e>t.length-1||t.push(t.splice(e,1)[0]),t}function Et(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 Ft(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 Mt(t,e,r){return e<0||r<0||e>t.length-1||r>t.length-1||([t[r],t[e]]=[t[e],t[r]]),t}function Ct(e,r=t.ASC){return e.sort(((n,i)=>{switch(r){case t.ASC:return n-i;case t.DESC:return i-n;case t.RANDOM:return Math.random()-.5;default:return e}}))}function Bt(t,e){return t.sort(((t,r)=>{for(let n of e){let e="",i="asc";if(O(n)?(e=n.prop,i=n.order||"asc"):(e=n,i="asc"),t[e]<r[e])return"asc"===i?-1:1;if(t[e]>r[e])return"asc"===i?1:-1}return 0}))}function Tt(t){return X(t)?[]:Array.from(new Set(t))}function Ot(t){for(let e=1;e<t.length;e++){const r=Math.floor(Math.random()*(e+1));[t[r],t[e]]=[t[e],t[r]]}return t}function It(t,e={key:"id",parentKey:"pid",childrenKey:"children"}){let r=e.key,n=e.parentKey,i=e.childrenKey;if(!t||0===t.length||!r||""===r)return[];const o=function(t,e,r){return t?(void 0!==r&&(t[e]=r),t[e]):null};let s=[],h={};for(let e=0;e<t.length;e++)t[e][i]&&delete t[e][i],h[t[e][r]]=t[e];for(let e=0;e<t.length;e++){let a=h[t[e][n]];if(a&&t[e][r]!==t[e][n]){let r=o(a,i);r||(r=o(a,i,[])),r.push(t[e])}else s.push(t[e])}return s}function Rt(t,e={childrenKey:"children"}){let r=e.childrenKey,n=[];for(let i of t)if(i[r]&&!i[r].length&&delete i[r],n.push(i),i[r]&&i[r].length){let t=Rt(i[r],e);t&&n.push(...t)}return n}function _t(t,e){return[...new Set(t.concat(e))]}function xt(t,e){return[...new Set(t)].filter((t=>e.includes(t)))}function Nt(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 Pt(t){let e=Object.create(null);for(let[r,n]of t)e[r]=n;return e}function kt(t){return JSON.stringify(Pt(t))}function zt(t){let e=new Map;for(let r of Object.keys(t))e.set(r,t[r]);return e}function jt(t){return zt(JSON.parse(t))}function $t(t){return JSON.stringify(t)}function Lt(t){if(!X(t))return JSON.parse(t)}function qt(t){return Object.assign(t)}function Ht(t){if(O(t)){let e={};for(let r in t)t.hasOwnProperty(r)&&(e[r]=Ht(t[r]));return e}if(T(t)){let e=[];for(let r=0,n=t.length;r<n;r++)e[r]=Ht(t[r]);return e}if(R(t)){let e=new Date;return e.setTime(t.getTime()),e}return t}function Yt(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 r=Object.keys(t);return r.length===Object.keys(e).length&&r.every((r=>Yt(t[r],e[r])))}function Vt(t,...e){return Object.assign(t,...e)}function Jt(t,e="data"){const r=(e||"data").split(".");let n=t;for(const t in r){let e=r[t],{propName:i,propIndex:o,isArray:s}=Kt(r[t]);if(s){if(o<0||o>=n[i].length)return;n=n[i][o]}else{if(!n||!n.hasOwnProperty(e)||"object"!=typeof n)return;n=n[e]}}return n}function Wt(t,e="data",r){const n=(e||"data").split(".");let i=t;for(let t=0;t<n.length-1;t++){let e=n[t],r=n[t+1],{propName:o,propIndex:s,isArray:h}=Kt(e);if(h){for(i&&i.hasOwnProperty(o)||(i[o]=[]);i[o].length<=s;)i[o].push({});i=i[o][s]}else i&&i.hasOwnProperty(e)&&"object"==typeof i[e]||(i[e]=W(r)?[]:{}),i=i[e]}let o=n[n.length-1],{propName:s,propIndex:h,isArray:a}=Kt(o);if(a){for(i.hasOwnProperty(s)&&Array.isArray(i[s])||(i[s]=[]);i[s].length<=h;)i[s].push({});i[s][h]=r}else i[o]=r;return t}function Kt(t){let e=t.match(/^(\w+)\[(\d+)]$/);return{propName:e&&e[1]||void 0,propIndex:e?parseInt(e[2],10):void 0,isArray:!!e}}function Zt(t,e=1e3,r=!0){let n;return function(){const i=arguments;if(n&&clearTimeout(n),r){const r=!n;n=setTimeout((function(){n=null}),e),r&&t.apply(this,i)}else n=setTimeout((function(){t.apply(this,i)}),e)}}function Qt(t,e=1e3){let r;return function(){const n=arguments;r||(r=setTimeout((()=>{r=null,t.apply(this,n)}),e))}}function Xt(t=1e3){return new Promise((e=>setTimeout(e,t)))}function Gt(){return Ne()}function te(){return Tr(Sr(new Date,-1))}function ee(){return Tr(Sr(new Date,1))}function re(t=new Date){return Tr(Sr(t,-7))}function ne(t=new Date){return Tr(Sr(t,7))}function ie(t=new Date){return Tr(Sr(t,-30))}function oe(t=new Date){return Tr(Sr(t,30))}function se(t=new Date){return Tr(Sr(t,-365))}function he(t=new Date){return Tr(Sr(t,365))}function ae(t=new Date){return t.getHours()<12}function ue(t=new Date){return t.getHours()>=12}function ce(t=new Date){let e=new Date;return["getFullYear","getMonth","getDate"].every((r=>e[r]()===t[r]()))}function fe(t=new Date){let e=t.getTime();return 1===ht((Date.now()-e)/864e5)}function le(t=new Date){let e=t.getTime();return 2===ht((Date.now()-e)/864e5)}function pe(t=new Date){return 1===ht((t.getTime()-Date.now())/864e5)}function de(t=new Date){return 2===ht((t.getTime()-Date.now())/864e5)}function ge(t=new Date){let e=qe(t);return 6!==e&&7!==e}function ye(t=new Date){let e=qe(t);return 6===e||7===e}function we(t=new Date){return 1===qe(t)}function me(t=new Date){return 7===qe(t)}function Ae(t=new Date){return 1===He(t)}function be(t=new Date){return He(t)===Ke(t)}function ve(t=new Date){return 1===Ye(t)}function Se(t=new Date){return Ye(t)===Ze(t)}function De(t=new Date){let e=t.getFullYear();return e%100!=0&&e%4==0||e%400==0}function Ee(t=new Date){return!De(t)}function Fe(t,e=new Date){return t.getTime()-e.getTime()<0}function Me(t,e=new Date){return t.getTime()-e.getTime()>0}function Ce(t,e,r){let n=t.getTime(),i=e.getTime(),o=r.getTime();return n>i&&n<o}function Be(t,e){return["getFullYear","getMonth","getDate"].every((r=>t[r]()===e[r]()))}function Te(t,e){let r=t.getTime()/864e5,n=e.getTime()/864e5;return ht((r+4)/7)===ht((n+4)/7)}function Oe(t,e){return["getFullYear","getMonth"].every((r=>t[r]()===e[r]()))}function Ie(t,e){return["getFullYear"].every((r=>t[r]()===e[r]()))}function Re(t,e){return Be(t,e)||Fe(t,e)}function _e(t,e){return Be(t,e)||Me(t,e)}function xe(){return new Date}function Ne(t=new Date,e="yyyy-MM-dd"){return Tr(t,e)}function Ue(t=new Date,e="yyyy-MM-dd HH:mm:ss"){return Tr(t,e)}function Pe(t=new Date){return t.getTime()}function ke(t=new Date){return Math.round(t/1e3)}function ze(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 je(t=new Date){return Object.entries(ze(t)).map((([t,e])=>e))}function $e(t=new Date,e="E",r="zh"){return"E"===e?i.WEEK[r].MINI[t.getDay()]:"EE"===e?i.WEEK[r].SHORT[t.getDay()]:"EEE"===e?i.WEEK[r].FULL[t.getDay()]:qe(t)}function Le(t=new Date,e="Q",r="zh"){let n=Number(Math.floor((t.getMonth()+3)/3));return"Q"===e?i.QUARTER[r].MINI[n-1]:"QQ"===e?i.QUARTER[r].SHORT[n-1]:"QQQ"===e?i.QUARTER[r].FULL[n-1]:n}function qe(t=new Date){return[7,1,2,3,4,5,6][t.getDay()]}function He(t=new Date){return t.getDate()}function Ye(t=new Date){return Math.ceil((t-new Date(t.getFullYear().toString()))/864e5)+1}function Ve(t=new Date){return Math.ceil((t.getDate()+6-qe(t))/7)}function Je(t=new Date){let e=new Date(t.getFullYear(),0,1),r=qe(e),n=Math.round((t-e)/864e5);return Math.ceil((n+r)/7)}function We(t=new Date){return 7}function Ke(t=new Date){return new Date(t.getFullYear(),t.getMonth()+1,0).getDate()}function Ze(t=new Date){return De(t)?366:365}function Qe(t=new Date){let e=qe(new Date(t.getFullYear(),0,1)),r=De(t)?366:365;return 1===e?Math.ceil(r/7):Math.ceil((r-7+e)/7)}function Xe(t=new Date){let e=qe(new Date(t.getFullYear(),0,1)),r=De(t)?366:365;return 1===e?Math.ceil(r/7):Math.ceil((r-7+e)/7)}function Ge(t=new Date){let e=qe(t);return t.setDate(t.getDate()-e+1),Tr(t)}function tr(t=new Date){let e=qe(t);return t.setDate(t.getDate()+(7-e)),Tr(t)}function er(t=new Date){let e=[],r=t.getDay(),n=new Date;n.setDate(t.getDate()-(0===r?6:r-1));for(let t=0;t<7;t++){let r=new Date(n);r.setDate(r.getDate()+t),e.push(Tr(r))}return e}function rr(t=new Date){return t.setDate(1),Tr(t)}function nr(t=new Date){return Tr(new Date(t.getFullYear(),t.getMonth()+1,0))}function ir(t=new Date){let e=[],r=new Date(t.getFullYear(),t.getMonth(),1),n=new Date(t.getFullYear(),t.getMonth()+1,0);for(let t=0;t<n.getDate();t++){let n=new Date(r);n.setDate(r.getDate()+t),e.push(n)}return e}function or(t=new Date){return new Date(t.getFullYear(),0,1)}function sr(t=new Date){return new Date(t.getFullYear(),11,31)}function hr(t=new Date){let e=[],r=new Date(t.getFullYear(),0,1),n=Ze();for(let t=0;t<n;t++){let n=new Date(r);n.setDate(r.getDate()+t),e.push(n.toLocaleDateString())}return e}function ar(t,e){if(X(t)||X(e))return 0;let r=(e-t)/864e5;return r>=0?Math.abs(r):r}function ur(t,e){if(X(t)||X(e))return 0;let r=(e-t)/6048e5;return r>=0?Math.abs(r):r}function cr(t,e){if(X(t)||X(e))return 0;let r=(t-e)/2592e6;return r>=0?Math.abs(r):r}function fr(t,e){if(X(t)||X(e))return 0;let r=(e-t)/31104e6;return r>=0?Math.abs(r):r}function lr(t,e){if(X(t)||X(e))return[];let r=[];for(;e-t>=0;){let e=t.getFullYear(),n=Ir(t.getMonth()+1),i=Ir(t.getDate());r.push(e+"-"+n+"-"+i),t.setDate(t.getDate()+1)}return r}function pr(t,e){if(X(t)||X(e))return[];let r=[],n=new Date,i=new Date;n.setFullYear(t.getFullYear(),t.getMonth()+1),i.setFullYear(e.getFullYear(),e.getMonth()+1);let o=n,s="";for(;o<=i;){let t=o.getMonth();s=0===t?o.getFullYear()-1+"-12":o.getFullYear()+"-"+Ir(t),r.push(s),o.setMonth(t+1)}return r}function dr(t,e){if(X(t)||X(e))return[];let r=[];for(;e-t>=0;){let e=t.getFullYear();r.push(e),t.setFullYear(t.getFullYear()+1)}return r}function gr(t,e="zh"){if(Z(t))return"--";let r=t.getTime(),n=Date.now()-r,o=ht(n/31104e6),s=ht(n/2592e6),h=ht(n/864e5),a=ht(n/36e5),u=ht(n/6e4);return o?o+i.PASS_TIME[e].YEAR:s?s+i.PASS_TIME[e].MONTH:h?1===h?i.PASS_TIME[e].YESTERDAY:2===h?i.PASS_TIME[e].BEFORE_YESTERDAY:h+i.PASS_TIME[e].DAY:a?a>12?i.PASS_TIME[e].TODAY:a+i.PASS_TIME[e].HOUR:u?u+i.PASS_TIME[e].MINUTE:i.PASS_TIME[e].JUST}function yr(t,e="zh"){if(Z(t))return"--";let r=new Date,n=t.getTime()-r.getTime(),o=0,s=0,h=0,a=0;return n>=0&&(o=Math.floor(n/1e3/3600/24),s=Math.floor(n/1e3/60/60%24),h=Math.floor(n/1e3/60%60),a=Math.floor(n/1e3%60)),`${o}${i.OVER_TIME[e].DAY} ${s}${i.OVER_TIME[e].HOUR} ${h}${i.OVER_TIME[e].MINUTE} ${a}${i.OVER_TIME[e].SECOND}`}function wr(t){let e=0,r=Tr(t).split("-"),n=Number(r[0]),i=Number(r[1]),o=Number(r[2]),s=new Date,h=s.getFullYear(),a=s.getMonth()+1,u=s.getDate(),c=h-n;if(c>0){let t=a-i;e=0===t?u-o<0?c-1:c:t<0?c-1:c}return e}function mr(t,e="zh"){if(Z(t))return"";let r=t.getMonth()+1;return t.getDate()<[20,19,21,20,21,22,23,23,23,24,23,22][r-1]?i.ZODIAC[e][r-1]:i.ZODIAC[e][r]}function Ar(t,e="zh"){if(Z(t))return"";let r=t.getFullYear();return r<1900?"未知":i.CHINESE_ZODIAC[e][(r-1900)%i.CHINESE_ZODIAC[e].length]}function br(t=new Date,e=1){return t.setFullYear(t.getFullYear()+e),t}function vr(t=new Date,e=1){return t.setMonth(t.getMonth()+e),t}function Sr(t=new Date,e=1){return t.setDate(t.getDate()+e),t}function Dr(t=new Date,e=1){return t.setHours(t.getHours()+e),t}function Er(t=new Date,e=1){return t.setMinutes(t.getMinutes()+e),t}function Fr(t=new Date,e=1){return t.setSeconds(t.getSeconds()+e),t}function Mr(t=new Date,e=100){return t.setMilliseconds(t.getMilliseconds()+e),t}function Cr(t=new Date,e=1){return t.setDate(t.getDate()+7*e),t}function Br(t=new Date,e=1){return t.setMonth(t.getMonth()+4*e),t}function Tr(t,e="yyyy-MM-dd",r="zh"){if(Z(t))return"";if(B(t))t=Or(t);else if(R(t));else if(F(t)&&13===String(t).length)t=new Date(t);else{if(!F(t)||10!==String(t).length)return console.error("Not supported date format!"),t;t=new Date(1e3*t)}let n={"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()},o=new RegExp(/(y+)/g);o.test(e)&&(e=e.replace(o,(function(e,r){return(t.getFullYear()+"").substring(4-r.length)})));let s=new RegExp(/((b+)|(A+))/g);s.test(e)&&(e=e.replace(s,(function(e,n){return n.length>1?t.getHours()<12?i.AM_PM[r].AM:i.AM_PM[r].PM:n===n.toLowerCase()?t.getHours()<12?i.AM_PM.en.AM.toLowerCase():i.AM_PM.en.PM.toLowerCase():t.getHours()<12?i.AM_PM.en.AM:i.AM_PM.en.PM})));let h=new RegExp(/(E+)/g);h.test(e)&&(e=e.replace(h,(function(e,n){return 1===n.length?i.WEEK[r].MINI[t.getDay()]:2===n.length?i.WEEK[r].SHORT[t.getDay()]:i.WEEK[r].FULL[t.getDay()]})));let a=new RegExp(/(Q+)/g);a.test(e)&&(e=e.replace(a,(function(e,n){return 1===n.length?i.QUARTER[r].MINI[Math.floor((t.getMonth()+3)/3)-1]:2===n.length?i.QUARTER[r].SHORT[Math.floor((t.getMonth()+3)/3)-1]:i.QUARTER[r].FULL[Math.floor((t.getMonth()+3)/3)-1]})));for(let t in n){let r=new RegExp("("+t+")");r.test(e)&&(e=e.replace(r,(function(e,r){return 1===r.length?n[t]:2===r.length?("00"+n[t]).substring((""+n[t]).length):("000"+n[t]).substring((""+n[t]).length)})))}return e}function Or(t){return Z(t)?null:B(t)?new Date(t.replace(/-/g,"/")):F(t)&&13===String(t).length?new Date(t):F(t)&&10===String(t).length?new Date(1e3*t):(console.error("Not supported date format!"),t)}function Ir(t){return(t=t.toString())[1]?t:"0"+t}function Rr(t,e){let r,n,i;try{r=t.toString().split(".")[1].length}catch(t){r=0}try{n=e.toString().split(".")[1].length}catch(t){n=0}return i=Math.pow(10,Math.max(r,n)),(t*i+e*i)/i}function _r(t,e){let r,n,i,o;try{r=t.toString().split(".")[1].length}catch(t){r=0}try{n=e.toString().split(".")[1].length}catch(t){n=0}return i=Math.pow(10,Math.max(r,n)),o=r>=n?r:n,((t*i-e*i)/i).toFixed(o)}function xr(t,e){let r=0,n=t.toString(),i=e.toString();try{r+=n.split(".")[1].length}catch(t){}try{r+=i.split(".")[1].length}catch(t){}return Number(n.replace(".",""))*Number(i.replace(".",""))/Math.pow(10,r)}function Nr(t,e){let r,n,i=0,o=0;try{i=t.toString().split(".")[1].length}catch(t){}try{o=e.toString().split(".")[1].length}catch(t){}return r=Number(t.toString().replace(".","")),n=Number(e.toString().replace(".","")),r/n*Math.pow(10,o-i)}function Ur(t,e){let r=0,n=0,i=0;try{r=t.toString().split(".")[1].length}catch(t){}try{n=e.toString().split(".")[1].length}catch(t){}return i=Math.pow(10,Math.max(r,n)),Math.round(Number(t)*i)%Math.round(Number(e)*i)/i}function Pr(t,e){return e?Pr(e,t%e):t}function kr(t,e){return t*e/Pr(t,e)}function zr(t,r=2,n=e.ROUND){return n===e.ROUND?function(t,e=2){if(W(t))return"--";let r=String(t);e||(e=0);-1===r.indexOf(".")&&(r+=".");if(r+=new Array(e+1).join("0"),new RegExp("^(-|\\+)?(\\d+(\\.\\d{0,"+(e+1)+"})?)\\d*$").test(r)){let t="0"+RegExp.$2,r=RegExp.$1,n=RegExp.$3.length,i=!0;if(n===e+2){if(n=t.match(/\d/g),parseInt(n[n.length-1])>4)for(let t=n.length-2;t>=0&&(n[t]=parseInt(n[t])+1,10===n[t]);t--)n[t]=0,i=1!==t;t=n.join("").replace(new RegExp("(\\d+)(\\d{"+e+"})\\d$"),"$1.$2")}return i&&(t=t.substr(1)),(r+t).replace(/\.$/,"")}return String(t)}(t,r):n===e.ROUND_FLOOR?function(t,e=2){if(W(t))return"--";let r=e,n=Number(t),i=String(n).indexOf(".")+1,o=i?String(n).length-i:0;if(0===i||o<=r){let t=n;if(0===i){t=`${t}.`;for(let e=0;e<r-o;e++)t=`${t}0`}else for(let e=0;e<r-o;e++)t=`${t}0`;return t}let s="";return s=`${String(n).split(".")[0]}.${String(n).split(".")[1].substring(0,r)}`,String(s)}(t,r):void 0}function jr(t,r=2,n=e.ROUND){return n===e.ROUND?function(t,e=2){if(W(t))return"--";let r=Math.pow(10,e);return Math.round(t*r)/r}(t,r):n===e.ROUND_FLOOR?function(t,e=2){if(W(t))return"--";let r=Math.pow(10,e);return Math.floor(t*r)/r}(t,r):void 0}function $r(t,e){return new RegExp(e).test(t)}function Lr(t){return $r(t,n.CH)}function qr(t){return $r(t,n.EN)}function Hr(t){return $r(t,n.EXTERNAL)}function Yr(t){return $r(t,n.LOWER_CASE)}function Vr(t){return $r(t,n.UPPER_CASE)}function Jr(t){return $r(t,n.MOBILE)}function Wr(t){return $r(t,n.EMAIL)}function Kr(t){return $r(t,n.ID_CARD)}function Zr(t){return $r(t,n.URL)}function Qr(t=0,e=9){return Math.floor(Math.random()*(e-t+1)+t)}function Xr(t=1){return Math.floor((Math.random()+Math.floor(9*Math.random()+1))*Math.pow(10,t-1))}function Gr(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 tn(t){if(!X(t))return t.substring(0,t.lastIndexOf("."))}function en(t){if(!X(t))return t.substring(t.lastIndexOf(".")+1).toLowerCase()}function rn(t){return new Promise(((e,r)=>{let n=new FileReader;n.readAsArrayBuffer(t),n.onload=r=>{const n=new Blob([r.target.result],{type:t.type});e(n)},n.onerror=function(t){console.error(t),r(t)}}))}function nn(t){return new Promise(((e,r)=>{let n=new FileReader;n.readAsDataURL(t),n.onload=function(t){e(t.target.result)},n.onerror=function(t){console.error(t),r(t)}}))}function on(t){return new Promise(((e,r)=>{try{e(URL.createObjectURL(t))}catch(e){console.error(e),URL.revokeObjectURL(t),r(e)}}))}function sn(t){return new Promise((async(e,r)=>{try{let r=await window.fetch(t);if(200===r.status){let t=await r.blob();e(await hn(t))}}catch(t){console.error(t),r(t)}}))}function hn(t,e=Date.now()){return new Promise(((r,n)=>{try{const n=t.type,i=t.size,o=n.split("/")[1];r(new File([t],`${Date.now()}.${o}`,{type:n,size:i,name:`${e}.${o}`,lastModified:Date.now(),lastModifiedDate:new Date}))}catch(t){console.error(t),n(t)}}))}function an(t){return new Promise(((e,r)=>{const n=new FileReader;n.onload=function(t){e(t.target.result)},n.onerror=function(t){r(t)},n.readAsText(t)}))}function un(t){return new Promise(((e,r)=>{let n=new FileReader;n.readAsDataURL(t),n.onload=function(t){e(t.target.result)},n.onerror=function(t){console.error(t),r(t)}}))}function cn(t,e=Date.now()){return new Promise(((r,n)=>{try{const n=t.split(","),i=n[0].match(/:(.*?);/)[1],o=i.split("/")[1],s=window.atob(n[1]);let h=s.length;const a=new Uint8Array(h);for(;h--;)a[h]=s.charCodeAt(h);r(new File([a],`${e}.${o}`,{type:i}))}catch(t){console.error(t),n(t)}}))}function fn(t){return new Promise(((e,r)=>{try{const r=t.split(","),n=r[0].match(/:(.*?);/)[1],i=window.atob(r[1]);let o=i.length;const s=new Uint8Array(o);for(;o--;)s[o]=i.charCodeAt(o);e(new Blob([s],{type:n}))}catch(t){console.error(t),r(t)}}))}function ln(t){return new Promise(((e,r)=>{const n=new Image;n.src=t,n.onload=function(){const t=document.createElement("canvas"),r=t.getContext("2d");t.width=n.width,t.height=n.height,r.drawImage(n,0,0,n.width,n.height);const i=t.toDataURL("image/png");e(i)},n.onerror=function(t){console.error(t),r(t)}}))}function pn(t,e){try{const r=window.URL.createObjectURL(t),n=window.document.createElement("a");n.download=e,n.href=r,n.click(),URL.revokeObjectURL(r)}catch(t){console.error(t)}}function dn(t,e){try{const r=window.document.createElement("a");r.download=e,r.href=t,r.target="_blank",window.document.body.appendChild(r),r.click(),window.document.body.removeChild(r)}catch(t){console.error(t)}}function gn(t){let e=t.split(","),r=parseInt(e[0].split("(")[1]),n=parseInt(e[1]),i=parseInt(e[2].split(")")[0]);return"#"+En(r)+En(n)+En(i)}function yn(t){let e=t.split(","),r=parseInt(e[0].split("(")[1]),n=parseInt(e[1]),i=parseInt(e[2]),o=parseFloat(e[3].split(")")[0]);return`#${En(Math.round(256*o-1))}${En(r)}${En(n)}${En(i)}`}function wn(t){let e,r,n=t.split(","),i=parseInt(n[0].split("(")[1])/255,o=parseInt(n[1])/255,s=parseInt(n[2])/255,h=parseFloat(n[3]&&n[3].split(")")[0]),a=Math.max(i,o,s),u=Math.min(i,o,s),c=(a+u)/2;if(a===u)e=r=0;else{let t=a-u;switch(r=c>.5?t/(2-a-u):t/(a+u),a){case i:e=(o-s)/t+(o<s?6:0);break;case o:e=(s-i)/t+2;break;case s:e=(i-o)/t+4}e/=6}return h?`hsla(${Math.round(360*e)},${Math.round(100*r)}%,${Math.round(100*c)}%,${h})`:`hsl(${Math.round(360*e)},${Math.round(100*r)}%,${Math.round(100*c)}%)`}function mn(t){let e={},r=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,r,n){return e+e+r+r+n+n})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return e.r=parseInt(n[1],16),e.g=parseInt(n[2],16),e.b=parseInt(n[3],16),`rgb(${e.r},${e.g},${e.b})`}function An(t,e=1){let r={},n=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,r,n){return e+e+r+r+n+n})),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return r.r=parseInt(i[1],16),r.g=parseInt(i[2],16),r.b=parseInt(i[3],16),r.o=e,`rgba(${r.r},${r.g},${r.b},${r.o})`}function bn(t){let e,r,n=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,r,n){return e+e+r+r+n+n})),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n),o=parseInt(i[1],16)/255,s=parseInt(i[2],16)/255,h=parseInt(i[3],16)/255,a=Math.max(o,s,h),u=Math.min(o,s,h),c=(a+u)/2;if(a===u)e=r=0;else{let t=a-u;switch(r=c>.5?t/(2-a-u):t/(a+u),a){case o:e=(s-h)/t+(s<h?6:0);break;case s:e=(h-o)/t+2;break;case h:e=(o-s)/t+4}e/=6}return`hsl(${Math.round(360*e)},${Math.round(100*r)}%,${Math.round(100*c)}%)`}function vn(){return"#"+(t=(16777216*Math.random()|0).toString(16),new Array(7-t.length).join("0")+t);var t}function Sn(){return`rgb(${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Math.floor(256*Math.random())})`}function Dn(){return`rgba(${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Number(Math.random()).toFixed(2)})`}function En(t){if(t>255)throw"'"+t+"'' is greater than 255(0xff);";return("0"+Number(t).toString(16)).slice(-2)}function Fn(t){return o[t]?o[t]:(console.log("Unknow Key Code: "+t),"")}function Mn(t){for(let e in o)if(o[e]===t)return e}function Cn(t=32,e=16){const r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");let n,i=[];if(e=e||r.length,t)for(n=0;n<t;n++)i[n]=r[0|Math.random()*e];else{let t;for(i[8]=i[13]=i[18]=i[23]="-",i[14]="4",n=0;n<36;n++)i[n]||(t=0|16*Math.random(),i[n]=r[19===n?3&t|8:t])}return i.join("")}function Bn(){let t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()} /* * [hi-base64]{@link https://github.com/emn178/hi-base64} * * @version 0.3.1 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2014-2023 * @license MIT */var Tn="not a UTF-8 string",On="object"==typeof window,In=On?window:{};In.HI_BASE64_NO_WINDOW&&(On=!1);var Rn=!On&&"object"==typeof self,_n=!In.HI_BASE64_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;_n?In=global:Rn&&(In=self);for(var xn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Nn={},Un=0;Un<64;++Un)Nn[xn[Un]]=Un;Nn["-"]=62,Nn._=63;var Pn,kn,zn=function(t){return t.split("=")[0].replace(/[\r\n]/g,"")},jn=function(t){for(var e,r,n,i,o=[],s=0,h=(t=zn(t)).length,a=0,u=h>>2<<2;a<u;)e=Nn[t.charAt(a++)],r=Nn[t.charAt(a++)],n=Nn[t.charAt(a++)],i=Nn[t.charAt(a++)],o[s++]=255&(e<<2|r>>>4),o[s++]=255&(r<<4|n>>>2),o[s++]=255&(n<<6|i);var c=h-u;return 2===c?(e=Nn[t.charAt(a++)],r=Nn[t.charAt(a++)],o[s++]=255&(e<<2|r>>>4)):3===c&&(e=Nn[t.charAt(a++)],r=Nn[t.charAt(a++)],n=Nn[t.charAt(a++)],o[s++]=255&(e<<2|r>>>4),o[s++]=255&(r<<4|n>>>2)),o},$n=function(t){for(var e,r,n,i=[],o=t.length,s=0,h=3*parseInt(o/3);s<h;)e=t[s++],r=t[s++],n=t[s++],i.push(xn[e>>>2],xn[63&(e<<4|r>>>4)],xn[63&(r<<2|n>>>6)],xn[63&n]);var a=o-h;return 1===a?(e=t[s],i.push(xn[e>>>2],xn[e<<4&63],"==")):2===a&&(e=t[s++],r=t[s],i.push(xn[e>>>2],xn[63&(e<<4|r>>>4)],xn[r<<2&63],"=")),i.join("")},Ln=In.btoa,qn=In.atob;if(_n){var Hn=require("buffer").Buffer;Ln=function(t){return Hn.from(t,"ascii").toString("base64")},$n=Pn=function(t){return Hn.from(t).toString("base64")},qn=function(t){return Hn.from(t,"base64").toString("ascii")},kn=function(t){return Hn.from(t,"base64").toString()}}else Ln?(Pn=function(t){for(var e=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e.push(String.fromCharCode(n)):n<2048?e.push(String.fromCharCode(192|n>>6),String.fromCharCode(128|63&n)):n<55296||n>=57344?e.push(String.fromCharCode(224|n>>12),String.fromCharCode(128|n>>6&63),String.fromCharCode(128|63&n)):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++r)),e.push(String.fromCharCode(240|n>>18),String.fromCharCode(128|n>>12&63),String.fromCharCode(128|n>>6&63),String.fromCharCode(128|63&n)))}return Ln(e.join(""))},kn=function(t){var e=qn(t.replace(/-/g,"+").replace(/_/g,"/"));if(!/[^\x00-\x7F]/.test(e))return e;for(var r,n,i=[],o=0,s=e.length,h=0;o<s;)if((r=e.charCodeAt(o++))<=127)i.push(String.fromCharCode(r));else{if(r>191&&r<=223)n=31&r,h=1;else if(r<=239)n=15&r,h=2;else{if(!(r<=247))throw new Error(Tn);n=7&r,h=3}for(var a=0;a<h;++a){if((r=e.charCodeAt(o++))<128||r>191)throw new Error(Tn);n<<=6,n+=63&r}if(n>=55296&&n<=57343)throw new Error(Tn);if(n>1114111)throw new Error(Tn);n<=65535?i.push(String.fromCharCode(n)):(n-=65536,i.push(String.fromCharCode(55296+(n>>10)),String.fromCharCode(56320+(1023&n))))}return i.join("")}):(Ln=function(t){for(var e,r,n,i=[],o=t.length,s=0,h=3*parseInt(o/3);s<h;)e=t.charCodeAt(s++),r=t.charCodeAt(s++),n=t.charCodeAt(s++),i.push(xn[e>>>2],xn[63&(e<<4|r>>>4)],xn[63&(r<<2|n>>>6)],xn[63&n]);var a=o-h;return 1===a?(e=t.charCodeAt(s),i.push(xn[e>>>2],xn[e<<4&63],"==")):2===a&&(e=t.charCodeAt(s++),r=t.charCodeAt(s),i.push(xn[e>>>2],xn[63&(e<<4|r>>>4)],xn[r<<2&63],"=")),i.join("")},Pn=function(t){for(var e,r,n,i=[],o=function(t){for(var e=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e[e.length]=n:n<2048?(e[e.length]=192|n>>6,e[e.length]=128|63&n):n<55296||n>=57344?(e[e.length]=224|n>>12,e[e.length]=128|n>>6&63,e[e.length]=128|63&n):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++r)),e[e.length]=240|n>>18,e[e.length]=128|n>>12&63,e[e.length]=128|n>>6&63,e[e.length]=128|63&n)}return e}(t),s=o.length,h=0,a=3*parseInt(s/3);h<a;)e=o[h++],r=o[h++],n=o[h++],i.push(xn[e>>>2],xn[63&(e<<4|r>>>4)],xn[63&(r<<2|n>>>6)],xn[63&n]);var u=s-a;return 1===u?(e=o[h],i.push(xn[e>>>2],xn[e<<4&63],"==")):2===u&&(e=o[h++],r=o[h],i.push(xn[e>>>2],xn[63&(e<<4|r>>>4)],xn[r<<2&63],"=")),i.join("")},qn=function(t){for(var e,r,n,i,o=[],s=t.length,h=0,a=s>>2<<2;h<a;)e=Nn[t.charAt(h++)],r=Nn[t.charAt(h++)],n=Nn[t.charAt(h++)],i=Nn[t.charAt(h++)],o.push(String.fromCharCode(255&(e<<2|r>>>4)),String.fromCharCode(255&(r<<4|n>>>2)),String.fromCharCode(255&(n<<6|i)));var u=s-a;return 2===u?(e=Nn[t.charAt(h++)],r=Nn[t.charAt(h++)],o.push(String.fromCharCode(255&(e<<2|r>>>4)))):3===u&&(e=Nn[t.charAt(h++)],r=Nn[t.charAt(h++)],n=Nn[t.charAt(h++)],o.push(String.fromCharCode(255&(e<<2|r>>>4)),String.fromCharCode(255&(r<<4|n>>>2)))),o.join("")},kn=function(t){for(var e,r,n=[],i=jn(t),o=i.length,s=0,h=0;s<o;)if((e=i[s++])<=127)n.push(String.fromCharCode(e));else{if(e>191&&e<=223)r=31&e,h=1;else if(e<=239)r=15&e,h=2;else{if(!(e<=247))throw new Error(Tn);r=7&e,h=3}for(var a=0;a<h;++a){if((e=i[s++])<128||e>191)throw new Error(Tn);r<<=6,r+=63&e}if(r>=55296&&r<=57343)throw new Error(Tn);if(r>1114111)throw new Error(Tn);r<=65535?n.push(String.fromCharCode(r)):(r-=65536,n.push(String.fromCharCode(55296+(r>>10)),String.fromCharCode(56320+(1023&r))))}return n.join("")});var Yn=function(t,e){var r="string"!=typeof t;return r&&t.constructor===In.ArrayBuffer&&(t=new Uint8Array(t)),r?$n(t):/[^\x00-\x7F]/.test(t)?Pn(t):Ln(t)};const Vn=Pn,Jn=kn;var Wn=Object.freeze({__proto__:null,decode:function(t){return e=zn(e=t),r?qn(e):kn(e);var e,r},decodeAsBytes:function(t){return jn(t)},encode:function(t){return Yn(t)},encodeAsBytes:function(t){return Yn(t)},utf8Decode:function(t){return Jn(t)},utf8Encode:function(t){return Vn(t)}}),Kn="object"==typeof window?window:{}; /* * [hi-base32]{@link https://github.com/emn178/hi-base32} * * @version 0.5.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT */!Kn.HI_BASE32_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(Kn=global);var Zn="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),Qn={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},Xn=[0,0,0,0,0,0,0,0],Gn=function(t,e){e.length>10&&(e="..."+e.substr(-10));var r=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+t+" bytes: "+e+" <-");throw r.position=t,r},ti=function(t){if(""===t)return[];if(!/^[A-Z2-7=]+$/.test(t))throw new Error("Invalid base32 characters");for(var e,r,n,i,o,s,h,a,u=[],c=0,f=(t=t.replace(/=/g,"")).length,l=0,p=f>>3<<3;l<p;)e=Qn[t.charAt(l++)],r=Qn[t.charAt(l++)],n=Qn[t.charAt(l++)],i=Qn[t.charAt(l++)],o=Qn[t.charAt(l++)],s=Qn[t.charAt(l++)],h=Qn[t.charAt(l++)],a=Qn[t.charAt(l++)],u[c++]=255&(e<<3|r>>>2),u[c++]=255&(r<<6|n<<1|i>>>4),u[c++]=255&(i<<4|o>>>1),u[c++]=255&(o<<7|s<<2|h>>>3),u[c++]=255&(h<<5|a);var d=f-p;return 2===d?(e=Qn[t.charAt(l++)],r=Qn[t.charAt(l++)],u[c++]=255&(e<<3|r>>>2)):4===d?(e=Qn[t.charAt(l++)],r=Qn[t.charAt(l++)],n=Qn[t.charAt(l++)],i=Qn[t.charAt(l++)],u[c++]=255&(e<<3|r>>>2),u[c++]=255&(r<<6|n<<1|i>>>4)):5===d?(e=Qn[t.charAt(l++)],r=Qn[t.charAt(l++)],n=Qn[t.charAt(l++)],i=Qn[t.charAt(l++)],o=Qn[t.charAt(l++)],u[c++]=255&(e<<3|r>>>2),u[c++]=255&(r<<6|n<<1|i>>>4),u[c++]=255&(i<<4|o>>>1)):7===d&&(e=Qn[t.charAt(l++)],r=Qn[t.charAt(l++)],n=Qn[t.charAt(l++)],i=Qn[t.charAt(l++)],o=Qn[t.charAt(l++)],s=Qn[t.charAt(l++)],h=Qn[t.charAt(l++)],u[c++]=255&(e<<3|r>>>2),u[c++]=255&(r<<6|n<<1|i>>>4),u[c++]=255&(i<<4|o>>>1),u[c++]=255&(o<<7|s<<2|h>>>3)),u},ei=function(t,e){var r="string"!=typeof t;return r&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),r?function(t){for(var e,r,n,i,o,s="",h=t.length,a=0,u=5*parseInt(h/5);a<u;)e=t[a++],r=t[a++],n=t[a++],i=t[a++],o=t[a++],s+=Zn[e>>>3]+Zn[31&(e<<2|r>>>6)]+Zn[r>>>1&31]+Zn[31&(r<<4|n>>>4)]+Zn[31&(n<<1|i>>>7)]+Zn[i>>>2&31]+Zn[31&(i<<3|o>>>5)]+Zn[31&o];var c=h-u;return 1===c?(e=t[a],s+=Zn[e>>>3]+Zn[e<<2&31]+"======"):2===c?(e=t[a++],r=t[a],s+=Zn[e>>>3]+Zn[31&(e<<2|r>>>6)]+Zn[r>>>1&31]+Zn[r<<4&31]+"===="):3===c?(e=t[a++],r=t[a++],n=t[a],s+=Zn[e>>>3]+Zn[31&(e<<2|r>>>6)]+Zn[r>>>1&31]+Zn[31&(r<<4|n>>>4)]+Zn[n<<1&31]+"==="):4===c&&(e=t[a++],r=t[a++],n=t[a++],i=t[a],s+=Zn[e>>>3]+Zn[31&(e<<2|r>>>6)]+Zn[r>>>1&31]+Zn[31&(r<<4|n>>>4)]+Zn[31&(n<<1|i>>>7)]+Zn[i>>>2&31]+Zn[i<<3&31]+"="),s}(t):function(t){var e,r,n,i,o,s,h,a=!1,u="",c=0,f=0,l=t.length;if(""===t)return u;do{for(Xn[0]=Xn[5],Xn[1]=Xn[6],Xn[2]=Xn[7],h=f;c<l&&h<5;++c)(s=t.charCodeAt(c))<128?Xn[h++]=s:s<2048?(Xn[h++]=192|s>>6,Xn[h++]=128|63&s):s<55296||s>=57344?(Xn[h++]=224|s>>12,Xn[h++]=128|s>>6&63,Xn[h++]=128|63&s):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++c)),Xn[h++]=240|s>>18,Xn[h++]=128|s>>12&63,Xn[h++]=128|s>>6&63,Xn[h++]=128|63&s);f=h-5,c===l&&++c,c>l&&h<6&&(a=!0),e=Xn[0],h>4?(r=Xn[1],n=Xn[2],i=Xn[3],o=Xn[4],u+=Zn[e>>>3]+Zn[31&(e<<2|r>>>6)]+Zn[r>>>1&31]+Zn[31&(r<<4|n>>>4)]+Zn[31&(n<<1|i>>>7)]+Zn[i>>>2&31]+Zn[31&(i<<3|o>>>5)]+Zn[31&o]):1===h?u+=Zn[e>>>3]+Zn[e<<2&31]+"======":2===h?(r=Xn[1],u+=Zn[e>>>3]+Zn[31&(e<<2|r>>>6)]+Zn[r>>>1&31]+Zn[r<<4&31]+"===="):3===h?(r=Xn[1],n=Xn[2],u+=Zn[e>>>3]+Zn[31&(e<<2|r>>>6)]+Zn[r>>>1&31]+Zn[31&(r<<4|n>>>4)]+Zn[n<<1&31]+"==="):(r=Xn[1],n=Xn[2],i=Xn[3],u+=Zn[e>>>3]+Zn[31&(e<<2|r>>>6)]+Zn[r>>>1&31]+Zn[31&(r<<4|n>>>4)]+Zn[31&(n<<1|i>>>7)]+Zn[i>>>2&31]+Zn[i<<3&31]+"=")}while(!a);return u}(t)},ri=function(t,e){return function(t){for(var e,r,n="",i=t.length,o=0,s=0;o<i;)if((e=t[o++])<=127)n+=String.fromCharCode(e);else{e>191&&e<=223?(r=31&e,s=1):e<=239?(r=15&e,s=2):e<=247?(r=7&e,s=3):Gn(o,n);for(var h=0;h<s;++h)((e=t[o++])<128||e>191)&&Gn(o,n),r<<=6,r+=63&e;r>=55296&&r<=57343&&Gn(o,n),r>1114111&&Gn(o,n),r<=65535?n+=String.fromCharCode(r):(r-=65536,n+=String.fromCharCode(55296+(r>>10)),n+=String.fromCharCode(56320+(1023&r)))}return n}(ti(t))};var ni=Object.freeze({__proto__:null,decode:function(t){return ri(t)},decodeAsBytes:function(t){return ti(t)},encode:function(t){return ei(t)},encodeAsBytes:function(t){return ei(t)}}),ii="input is invalid type",oi="object"==typeof window,si=oi?window:{}; /** * [js-md5]{@link https://github.com/emn178/js-md5} * * @namespace md5 * @version 0.8.3 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2014-2023 * @license MIT */si.JS_MD5_NO_WINDOW&&(oi=!1);var hi=!oi&&"object"==typeof self,ai=!si.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;ai?si=global:hi&&(si=self);var ui,ci=!si.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,fi="0123456789abcdef".split(""),li=[128,32768,8388608,-2147483648],pi=[0,8,16,24],di=["hex","array","digest","buffer","arrayBuffer","base64"],gi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),yi=[];if(ci){var wi=new ArrayBuffer(68);ui=new Uint8Array(wi),yi=new Uint32Array(wi)}var mi=Array.isArray;!si.JS_MD5_NO_NODE_JS&&mi||(mi=function(t){return"[object Array]"===Object.prototype.toString.call(t)});var Ai=ArrayBuffer.isView;!ci||!si.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&Ai||(Ai=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var bi=function(t){var e=typeof t;if("string"===e)return[t,!0];if("object"!==e||null===t)throw new Error(ii);if(ci&&t.constructor===ArrayBuffer)return[new Uint8Array(t),!1];if(!mi(t)&&!Ai(t))throw new Error(ii);return[t,!1]},vi=function(t){return function(e){return new Ei(!0).update(e)[t]()}},Si=function(t){var e,r=require("crypto"),n=require("buffer").Buffer;e=n.from&&!si.JS_MD5_NO_BUFFER_FROM?n.from:function(t){return new n(t)};return function(i){if("string"==typeof i)return r.createHash("md5").update(i,"utf8").digest("hex");if(null==i)throw new Error(ii);return i.constructor===ArrayBuffer&&(i=new Uint8Array(i)),mi(i)||Ai(i)||i.constructor===n?r.createHash("md5").update(e(i)).digest("hex"):t(i)}},Di=function(t){return function(e,r){return new Fi(e,!0).update(r)[t]()}};function Ei(t){if(t)yi[0]=yi[16]=yi[1]=yi[2]=yi[3]=yi[4]=yi[5]=yi[6]=yi[7]=yi[8]=yi[9]=yi[10]=yi[11]=yi[12]=yi[13]=yi[14]=yi[15]=0,this.blocks=yi,this.buffer8=ui;else if(ci){var e=new ArrayBuffer(68);this.buffer8=new Uint8Array(e),this.blocks=new Uint32Array(e)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function Fi(t,e){var r,n=bi(t);if(t=n[0],n[1]){var i,o=[],s=t.length,h=0;for(r=0;r<s;++r)(i=t.charCodeAt(r))<128?o[h++]=i:i<2048?(o[h++]=192|i>>>6,o[h++]=128|63&i):i<55296||i>=57344?(o[h++]=224|i>>>12,o[h++]=128|i>>>6&63,o[h++]=128|63&i):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++r)),o[h++]=240|i>>>18,o[h++]=128|i>>>12&63,o[h++]=128|i>>>6&63,o[h++]=128|63&i);t=o}t.length>64&&(t=new Ei(!0).update(t).array());var a=[],u=[];for(r=0;r<64;++r){var c=t[r]||0;a[r]=92^c,u[r]=54^c}Ei.call(this,e),this.update(u),this.oKeyPad=a,this.inner=!0,this.sharedMemory=e}Ei.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e=bi(t);t=e[0];for(var r,n,i=e[1],o=0,s=t.length,h=this.blocks,a=this.buffer8;o<s;){if(this.hashed&&(this.hashed=!1,h[0]=h[16],h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),i)if(ci)for(n=this.start;o<s&&n<64;++o)(r=t.charCodeAt(o))<128?a[n++]=r:r<2048?(a[n++]=192|r>>>6,a[n++]=128|63&r):r<55296||r>=57344?(a[n++]=224|r>>>12,a[n++]=128|r>>>6&63,a[n++]=128|63&r):(r=65536+((1023&r)<<10|1023&t.charCodeAt(++o)),a[n++]=240|r>>>18,a[n++]=128|r>>>12&63,a[n++]=128|r>>>6&63,a[n++]=128|63&r);else for(n=this.start;o<s&&n<64;++o)(r=t.charCodeAt(o))<128?h[n>>>2]|=r<<pi[3&n++]:r<2048?(h[n>>>2]|=(192|r>>>6)<<pi[3&n++],h[n>>>2]|=(128|63&r)<<pi[3&n++]):r<55296||r>=57344?(h[n>>>2]|=(224|r>>>12)<<pi[3&n++],h[n>>>2]|=(128|r>>>6&63)<<pi[3&n++],h[n>>>2]|=(128|63&r)<<pi[3&n++]):(r=65536+((1023&r)<<10|1023&t.charCodeAt(++o)),h[n>>>2]|=(240|r>>>18)<<pi[3&n++],h[n>>>2]|=(128|r>>>12&63)<<pi[3&n++],h[n>>>2]|=(128|r>>>6&63)<<pi[3&n++],h[n>>>2]|=(128|63&r)<<pi[3&n++]);else if(ci)for(n=this.start;o<s&&n<64;++o)a[n++]=t[o];else for(n=this.start;o<s&&n<64;++o)h[n>>>2]|=t[o]<<pi[3&n++];this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},Ei.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[e>>>2]|=li[3&e],e>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,t[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Ei.prototype.hash=function(){var t,e,r,n,i,o,s=this.blocks;this.first?e=((e=((t=((t=s[0]-680876937)<<7|t>>>25)-271733879|0)^(r=((r=(-271733879^(n=((n=(-1732584194^2004318071&t)+s[1]-117830708)<<12|n>>>20)+t|0)&(-271733879^t))+s[2]-1126478375)<<17|r>>>15)+n|0)&(n^t))+s[3]-1316259209)<<22|e>>>10)+r|0:(t=this.h0,e=this.h1,r=this.h2,e=((e+=((t=((t+=((n=th