util-helpers 4.22.0 → 4.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/util-helpers.js +10 -4
- package/dist/util-helpers.js.map +1 -1
- package/dist/util-helpers.min.js +1 -1
- package/dist/util-helpers.min.js.map +1 -1
- package/esm/AsyncMemo.js +3 -3
- package/esm/VERSION.js +1 -1
- package/esm/index.js +1 -1
- package/lib/AsyncMemo.js +2 -2
- package/lib/VERSION.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/types/AsyncMemo.d.ts +0 -1
package/dist/util-helpers.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).utilHelpers={})}(this,(function(e){"use strict";var t=void 0,r="undefined",n="object",o=Object.prototype,i=o.toString,a=o.propertyIsEnumerable,c=Object.getOwnPropertySymbols,u=Object.keys,s=typeof Symbol!==r?Symbol.prototype:t,f=Math.min,l=Number.isFinite,d=typeof globalThis===n&&globalThis,h=typeof global===n&&global,p=typeof self===n&&self,v=Number.MAX_SAFE_INTEGER||9007199254740991,y=Number.MIN_SAFE_INTEGER||-9007199254740991,g="[object Number]",m="[object String]",b="[object Symbol]",w=["Function","AsyncFunction","GeneratorFunction","Proxy"].map((function(e){return"[object "+e+"]"})),x="[object Blob]";function k(e){return Array.isArray(e)}function C(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function O(e){return i.call(e)}function E(e){return"symbol"==typeof e||O(e)===b}var N=/^0b[01]+$/i,A=/^0o[0-7]+$/i,j=/^[-+]0x[0-9a-f]+$/i;function R(e){if("number"==typeof e)return e;if(E(e))return NaN;if(C(e)&&(e=Number(e)),"string"!=typeof e)return 0===e?e:+e;e=e.trim();var t=N.test(e);return t||A.test(e)?parseInt(e.slice(2),t?2:8):j.test(e)?NaN:+e}function T(e){return e}function S(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=v}(e.length)&&!function(e){if("function"==typeof e)return!0;var t=O(e);return w.some((function(e){return e===t}))}(e)}function F(e){return C(e)?u(e).concat(function(e){return c&&null!==e?c(e).filter((function(t){return a.call(e,t)})):[]}(e)):[]}var P,_=(P=1,function(e,t){void 0===t&&(t=T);for(var r=!S(e)&&F(e),n=(r||e).length,o=0;o>=0&&o<n;){var i=r?r[o]:o;if(!1===t(e[i],i,e))break;o+=P}return e});function I(e){return"number"==typeof e||O(e)===g}var M=s?s.toString:t;function L(e){if("string"==typeof e)return e;if(k(e))return""+e.map(L);if(E(e))return M?M.call(e):"";var t=""+e;return"0"===t&&1/e==-1/0?"-0":t}function B(e){return function(e){return null==e}(e)?"":L(e)}var $=typeof Blob!==r;function D(e){return!!($&&e instanceof Blob)||O(e)===x}var U=d&&globalThis.Object===Object&&globalThis,z=h&&global.Object===Object&&global,V=p&&self.Object===Object&&self,W=U||z||V||Function("return this")();function Z(e){return I(e)&&W.isNaN(e)}function H(e){return C(e)&&"function"==typeof e.then}function X(e){return"string"==typeof e||O(e)===m}function K(e,t,r){void 0===r&&(r=0);var n=Math[e];if(t=R(t),r=f(function(e){var t=R(e);if(!t||t===1/0||t===-1/0)return t==t?t:0;var r=t%1;return r?t-r:t}(r),292),0===r||!function(e){return l?l(e):"number"==typeof e&&W.isFinite(e)}(t))return n(t);var o=B(t).split("e");return+((o=B(t=n(+(o[0]+"e"+(o[1]?+o[1]+r:r)))).split("e"))[0]+"e"+(o[1]?+o[1]-r:-r))}function q(e,t){return K("round",e,t)}var G=/^1[3456789]\d{9}$/;var J=/^(0\d{2,3}-)?([2-9]\d{6,7})(-\d{1,6})?$/;var Q=/^\d{6}$/;var Y=/^[1-9]\d{5}(19|20)?\d{2}((0[1-9])|(1[012]))(([0-2][1-9])|10|20|30|31)\d{3}(\d|X)?$/i;var ee=/^[\da-z]+([-._]?[\da-z]+)*@[\da-z]+([-.]?[\da-z]+)*(\.[a-z]{2,})+$/i;var te=/^[1-9]\d{4,10}$/;var re=/^[a-z]([-_a-z0-9]{5,19})+$/i;var ne=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})|([A-Z0-9]{5}[DF])|([DF][A-Z0-9]{5}))$/;var oe=/^[1-9]\d{9,20}$/,ie=/^\d{8,30}$/;var ae=/^[\dA-HJ-NPQRTUWXY]{2}\d{6}[\dA-HJ-NPQRTUWXY]{10}$/,ce="0123456789ABCDEFGHJKLMNPQRTUWXY".split("");var ue={disableWarning:!0};function se(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ue.disableWarning||console.warn.apply(void 0,e)}var fe=/[\d]/,le=/[a-z]/,de=/[A-Z]/,he=/[\d|a-z]/gi;function pe(e){return e.indexOf("\\x")>-1||e.indexOf("\\u")>-1}function ve(e,t){void 0===t&&(t={});var r=t.level,n=void 0===r?2:r,o=t.ignoreCase,i=void 0!==o&&o,a=t.special,c=void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a,u=e;"string"!=typeof e&&(se("[validatePassword] value must be a string."),u="");var s,f=0,l=(s=u,fe.test(s)),d=function(e){return le.test(e)}(u),h=function(e){return de.test(e)}(u),p=function(e,t){if(!t||!e)return!1;var r=e.replace(he,"");if(!r)return!1;var n=pe(t)?new RegExp("[".concat(t,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(e){return t.indexOf(e)>-1&&(o=!0),o})),o}(u,c),v=function(e,t){if(!e)return!1;var r=e.replace(he,"");if(!r)return!1;if(!t)return!0;var n=pe(t)?new RegExp("[^".concat(t,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(e){return-1===t.indexOf(e)&&(o=!0),o})),o}(u,c);return l&&(f+=1),i?(d||h)&&(f+=1):(d&&(f+=1),h&&(f+=1)),p&&(f+=1),{validated:f>=n&&!v,level:f,containes:{number:l,lowerCaseLetter:d,upperCaseLetter:h,specialCharacter:p,unallowableCharacter:v}}}var ye=/^((e[\da-z])|(de)|(se)|(pe)|([khm][\da-z]))[\da-z]{7}$/i;var ge,me="undefined"!=typeof URL,be=void 0,we=Object.keys,xe=Object.values,ke=me?URL.createObjectURL:(ge="",function(){return ge}),Ce=me?URL.revokeObjectURL:function(){},Oe={chineseBasic:"[一-龥]",chineseExtend:"[麦-鿿]",chineseExtend2:"[豈-龎]",chineseExtendA:"[㐀-䶿]",chineseExtendB:"[𠀀-𪛟]",chineseExtendC:"[𪜀-𫜸]",chineseExtendD:"[𫝀-𫠝]",chineseExtendE:"[𫠠-𬺡]",chineseExtendF:"[𬺰-𮯠]",chineseExtendG:"[𰀀-𱍊]",chineseExtendH:"[𱍐-𲎯]",chineseExtendI:"[-]"},Ee=Oe.chineseBasic+"+",Ne="^"+Oe.chineseBasic+"+$",Ae="(?:"+xe(Oe).join("|")+")",je=Ae+"+",Re="^"+Ae+"+$",Te=RegExp.prototype.hasOwnProperty("unicode");var Se=/^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;var Fe=/^((([0-9A-F]{1,4}:){7}([0-9A-F]{1,4}|:))|(([0-9A-F]{1,4}:){6}(:[0-9A-F]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){5}(((:[0-9A-F]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){4}(((:[0-9A-F]{1,4}){1,3})|((:[0-9A-F]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){3}(((:[0-9A-F]{1,4}){1,4})|((:[0-9A-F]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){2}(((:[0-9A-F]{1,4}){1,5})|((:[0-9A-F]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){1}(((:[0-9A-F]{1,4}){1,6})|((:[0-9A-F]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(:(((:[0-9A-F]{1,4}){1,7})|((:[0-9A-F]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:)))(%.+)?$/i;var Pe="localhost|(([^\\s:\\/]+?\\.)+?[^\\s:\\/]+)",_e=":\\d+",Ie="\\/.*",Me="\\?.*",Le=new RegExp("^".concat("[\\w-.]+:\\/\\/","(?:").concat("[-;:&=\\+\\$,\\w]+@",")?(?:").concat(Pe,")(?:").concat(_e,")?(?:").concat(Ie,")*(?:").concat(Me,")?(?:").concat("#.*",")?$")),Be=new RegExp("^(?:".concat(Pe,")(?:").concat(_e,")?(?:").concat(Ie,")*(?:").concat(Me,")?(?:").concat("#.*",")?$"));function $e(e){var t=B(e);return Le.test(t)||Be.test(t)}var De=/^\d{15}$/;var Ue=/^[hm]{1}([0-9]{10}|[0-9]{8})$/i;var ze=/^\d{8}$/i,Ve=/^[\da-z]{10,12}$/i;var We=/^[A-Z]{6}[A-Z\d]{2}(?:[A-Z\d]{3})?$/;function Ze(e,t){var r;return void 0===t&&(t=!1),"number"==typeof(r=t?"string"==typeof e&&""!==e?Number(e):e:"number"==typeof e?e:E(e)?Number.NaN:Number(e))&&!Z(r)}var He=function(e,t){return He=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},He(e,t)};function Xe(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}He(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var Ke=function(){return Ke=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ke.apply(this,arguments)};function qe(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function c(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,c)}u((n=n.apply(e,t||[])).next())}))}function Ge(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}function Je(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Qe(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function Ye(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var et=/^[-+]?0[b|o|x]\d+/i,tt=/^\.\d+/;function rt(e){var t;return X(e)?""===(t=e.trim())?t=Number(t):et.test(t)||tt.test(t)?t=R(t):Z(Number(t))&&(t=Number.NaN):t=E(e)?Number.NaN:I(e)?e:Number(e),Z(t)?Number.NaN:t}function nt(e,t){return void 0===t&&(t=12),+parseFloat(e.toPrecision(t))}function ot(e){var t=e.toString().split(/e/i),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function it(e){var t=String(e);if(!function(e){return/\d+\.?\d*e[+-]*\d+/i.test(e)}(t))return Number(t.replace(".",""));var r=ot(e);return r>0?nt(+e*Math.pow(10,r)):+e}function at(e){(+e>v||+e<y)&&se("".concat(e," is beyond boundary when transfer to integer, the results may not be accurate"))}var ct,ut,st,ft=["零","一","二","三","四","五","六","七","八","九"],lt=["","十","百","千"],dt=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],ht=["","拾","佰","仟"];function pt(e){for(var t="",r="",n=!1,o=0;e>0;){var i=e%10;0==i?n&&(n=!1,r=ct[i]+r):(n=!0,t=ct[i],r=(t+=ut[o])+r),o++,e=Math.floor(e/10)}return r}function vt(e){for(var t=e+"",r="",n=0,o=t.length;n<o;n++)r+=ct[parseInt(t[n])];return r}function yt(e,t){void 0===t&&(t={});var r=t.spaceMark,n=void 0===r?" ":r,o=t.precision,i=void 0===o?2:o,a="number"!=typeof e?Number(e):e;if(0===a||Z(a))return"0".concat(n,"B");var c=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],u=Math.floor(Math.log(a)/Math.log(1024));return c[u]?"".concat(Number((a/Math.pow(1024,u)).toFixed(i))).concat(n).concat(c[u]):a+""}var gt=/^(?<province>\d{2})(?<city>\d{2})(?<area>\d{2})(?<year>(?:\d{2})?\d{2})(?<month>\d{2})(?<day>\d{2})\d{2}(?<gender>\d)(?:\d|X)?$/i,mt=[["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","台湾省"],["83","台湾省"],["81","香港特别行政区"],["82","澳门特别行政区"]];var bt={arrayBuffer:"readAsArrayBuffer",binaryString:"readAsBinaryString",dataURL:"readAsDataURL",text:"readAsText"},wt=function(e,t){void 0===t&&(t="dataURL");var r=bt[t];return r||(r=bt.dataURL),new Promise((function(t,n){var o=new FileReader;o[r](e),o.onload=function(){return t(o.result)},o.onerror=function(e){return n(e)}}))};function xt(e){for(var t=e.split(","),r=t[0].substring(5).split(";"),n=r[0],o=(-1!==r.indexOf("base64")?atob:decodeURIComponent)(t[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new Blob([a],{type:n})}function kt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return kt.apply(void 0,[kt(r,n)].concat(o));if(r=rt(r),n=rt(n),Z(r)||Z(n))return Number.NaN;var i=it(r),a=it(n),c=ot(r)+ot(n),u=i*a;return at(u),u/Math.pow(10,c)}function Ct(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return Ct.apply(void 0,[Ct(r,n)].concat(o));if(r=rt(r),n=rt(n),Z(r)||Z(n))return Number.NaN;var i=it(r),a=it(n);return at(i),at(a),kt(i/a,nt(Math.pow(10,ot(n)-ot(r))))}function Ot(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?0:e[1],o=e.slice(2);if(o.length>0)return Ot.apply(void 0,[Ot(r,n)].concat(o));if(r=Math.abs(q(r)),n=Math.abs(q(n)),Z(r)||Z(n))return Number.NaN;if(0===r&&0===n)return 0;if(0===r)return n;if(0===n)return r;var i=n;for(r<n&&(i=r,r=n,n=i);i;)i=r%n,r=n,n=i;return R(r)}function Et(e,t){var r=t||{},n=r.method,o=void 0===n?"get":n,i=r.data,a=void 0===i?null:i,c=r.timeout,u=r.headers,s=r.withCredentials,f=void 0!==s&&s,l=r.async,d=void 0===l||l,h=r.user,p=void 0===h?null:h,v=r.password,y=void 0===v?null:v,g=r.responseType,m=r.onReadyStateChange,b=r.onLoadStart,w=r.onProgress,x=r.onAbort,k=r.onTimeout,C=r.onError,O=r.onLoad,E=r.onLoadEnd;return new Promise((function(t,r){var n=new XMLHttpRequest;n.open(o.toLowerCase(),e,d,p,y),m&&(n.onreadystatechange=m),"number"==typeof c&&c>0&&(n.timeout=c),n.withCredentials=f,g&&(n.responseType=g),"object"==typeof u&&we(u).map((function(e){n.setRequestHeader(e,u[e])}));var i,s=function(e){return function(t){r(t),null==e||e.call(n,t)}},l={loadstart:b,progress:w,abort:s(x),timeout:s(k),error:s(C),load:(i=O,function(e){t(e),null==i||i.call(n,e)}),loadend:E};we(l).map((function(e){var t=l[e];t&&n.addEventListener(e,t)})),n.send(a)}))}var Nt=[200,304];function At(e,t){return new Promise((function(r,n){D(e)?r(e):Et(e,Ke({responseType:"blob"},t)).then((function(t){var o=t.target.status;if(-1!==Nt.indexOf(o))r(t.target.response);else{var i=new Error("The file does not support get requests, responseStatus ".concat(o,", '").concat(e,"'."));console.error(i),n(i)}})).catch((function(e){console.error(new Error("Failed to request file. ".concat(e))),n(e)}))}))}var jt=function(){function e(){this.handlers={}}return e.prototype.eventNames=function(){var e,t=(null===(e=Object.getOwnPropertySymbols)||void 0===e?void 0:e.call(Object,this.handlers))||[];return Object.keys(this.handlers).concat(t)},e.prototype.rawListeners=function(e){var t=this.handlers[e];return t?t.map((function(e){return e.raw})):[]},e.prototype.listeners=function(e){var t=this.handlers[e];return t?t.map((function(e){return e.wrap})):[]},e.prototype.hasListener=function(e,t){return this.rawListeners(e).some((function(e){return e===t}))},e.prototype._on=function(e,t,r,n,o){void 0===n&&(n=null),void 0===o&&(o=1);var i={raw:t,wrap:r,context:n};if(this.handlers[e]){var a=1===o?"push":"unshift";this.handlers[e][a](i)}else this.handlers[e]=[i];return this},e.prototype.prependListener=function(e,t,r){return this._on(e,t,t,r,0)},e.prototype.on=function(e,t,r){return this._on(e,t,t,r)},e.prototype._wrapOnce=function(e,t,r){var n=this;void 0===r&&(r=null);var o=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];t.apply(r,i),n.off(e,o)};return o},e.prototype.once=function(e,t,r){var n=this._wrapOnce(e,t,r);return this._on(e,t,n,r)},e.prototype.prependOnceListener=function(e,t,r){var n=this._wrapOnce(e,t,r);return this._on(e,t,n,r,0)},e.prototype.off=function(e,t){var r=this.handlers[e];if(r)if(t){var n=r.findIndex((function(e){return e.wrap===t||e.raw===t}));-1!==n&&r.splice(n,1)}else delete this.handlers[e];return this},e.prototype.offAll=function(){return this.handlers={},this},e.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this.handlers[e];return!!(n&&n.length>0)&&(n.forEach((function(e){e.wrap.apply(e.context,t)})),!0)},e}(),Rt=function(e){function t(t){var r=e.call(this)||this;return r.data=[],r.options=Ke({max:10},t),r}return Xe(t,e),t.prototype.has=function(e){return!!this.data.find((function(t){return t.k===e}))},t.prototype.get=function(e){var t;return null===(t=this.data.find((function(t){return t.k===e})))||void 0===t?void 0:t.v},t.prototype.checkLimit=function(){var e=this;if(0!==this.options.max){var t=this.data.length-this.options.max;if(t>=0){var r=this.data.splice(0,t+1);_(r,(function(t){e.emit("del",t.v,t.k)}))}}},t.prototype.set=function(e,t){var r={k:e,v:t};if(this.has(e)){var n=this.data.findIndex((function(t){return t.k===e}));this.data.splice(n,1,r)}else this.checkLimit(),this.data.push(r)},t}(jt),Tt=new Rt({max:1});function St(e,t,r){void 0===t&&(t=!0);var n={useCache:"object"==typeof t?!1!==t.useCache:!1!==t,autoRevokeOnDel:"object"==typeof t?!1!==t.autoRevokeOnDel:!!t};return new Promise((function(t,o){n.useCache&&Tt.has(e)?t(Tt.get(e).data):At(e,r).then((function(r){var i=ke(r),a=new Image;a.onload=function(){var o={blob:r,image:a};n.useCache&&Tt.set(e,{data:o,r:n.autoRevokeOnDel}),t(o)},a.onerror=function(t){Ce(i),console.error("[loadImageWithBlob] The image load failed, '".concat(e,"'.")),o(t)},a.src=i})).catch(o)}))}Tt.on("del",(function(e){if(e.r)try{Ce(e.data.image.src)}catch(e){}}));function Ft(e,t){void 0===t&&(t="");var r=document.createElement("a");r.href=e,r.style.display="none",r.setAttribute("download",t),r.addEventListener("click",(function e(t){t.stopPropagation(),r.removeEventListener("click",e)})),document.body.appendChild(r),r.click(),document.body.removeChild(r)}var Pt=new Rt({max:1});Pt.on("del",(function(e){if(e.r)try{Ce(e.data.image.src)}catch(e){}}));var _t=new Rt({max:1});_t.on("del",(function(e){if(e.r)try{Ce(e.data.src)}catch(e){}}));var It="abcdefghijklmnopqrstuvwxyz",Mt="0123456789"+It+It.toUpperCase();function Lt(e,t,r){for(void 0===r&&(r="");e-- >0;){return Lt(e,t,r+t[Math.floor(Math.random()*t.length)])}return r}function Bt(e,t){var r=t.childrenField,n=void 0===r?"children":r,o=t.emptyChildrenValue,i=void 0===o?"none":o;e.forEach((function(e){e[n].length<=0?"null"===i?e[n]=null:delete e[n]:Bt(e[n],t)}))}function $t(e,t,r,n){var o,i;if(void 0===n&&(n=[]),!k(e))return[];try{for(var a=Je(e),c=a.next();!c.done;c=a.next()){var u=c.value;if(n.push(u),t(u))return n;if(C(u)){var s=u[r];if(k(s)&&s.length>0){var f=$t(s,t,r,n);if(f.length>0)return f}}n.pop()}}catch(e){o={error:e}}finally{try{c&&!c.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return[]}var Dt=1;function Ut(){return"".concat(Math.random().toString(16).substring(2,8),"_").concat(Dt++)}var zt="undefined"!=typeof window&&"object"==typeof window&&window.window===window,Vt={},Wt=function(){function e(e){void 0===e&&(e="default"),this.scope=e,Vt[this.scope]||(Vt[this.scope]={}),this.data=Vt[this.scope]}return e.prototype.getItem=function(e){return e in this.data?this.data[e]:null},e.prototype.setItem=function(e,t){this.data[e]=t},e.prototype.removeItem=function(e){delete this.data[e]},e.prototype.clear=function(){Vt[this.scope]={},this.data=Vt[this.scope]},e}(),Zt=function(){function e(e,t){void 0===t&&(t={});var r=!!e&&function(e){try{var t="object"==typeof e&&null!==e&&!!e.setItem&&!!e.getItem&&!!e.removeItem;if(t){var r=Ut();if(e.setItem(r,"1"),"1"!==e.getItem(r))return!1;e.removeItem(r)}return t}catch(t){return console.error("[cache2] ".concat(e," is not supported. The default memory cache will be used.")),!1}}(e);this.options=Ke({needParsed:r},t),this.storage=r?e:new Wt(this.options.memoryScope)}return e.prototype.get=function(e){var t=this.storage.getItem(e);return this.options.needParsed?function(e,t){try{return JSON.parse(e,t)}catch(t){return e}}(t,this.options.reviver):t},e.prototype.set=function(e,t){this.storage.setItem(e,this.options.needParsed?function(e,t){return JSON.stringify(e,t)}(t,this.options.replacer):t)},e.prototype.del=function(e){this.storage.removeItem(e)},e.prototype.clear=function(){"function"==typeof this.storage.clear&&this.storage.clear()},e}(),Ht=function(e){function t(t,r){var n,o=e.call(this)||this,i="default";return"string"==typeof t?i=t:"object"==typeof t&&(n=t),n||"object"!=typeof r||(n=r),o.options=Ke({max:-1,stdTTL:0,maxStrategy:"limited",checkperiod:0,prefix:"cache2_"},n),o.storage=new Zt(o.options.storage,Ke({memoryScope:i},n)),o.cacheKey=(o.options.prefix||"")+(i||"")||Ut(),o.startCheckperiod(),o}return Xe(t,e),t.prototype._check=function(e,t){var r=!0;return 0!==t.t&&t.t<Date.now()&&(r=!1,this.del(e),this.emit("expired",e,t.v)),r},t.prototype._wrap=function(e,t){var r=Date.now(),n="number"==typeof t?t:this.options.stdTTL;return{v:e,t:n>0?r+n:0,n:r}},t.prototype._isLimited=function(e){return this.options.max>-1&&e>=this.options.max},t.prototype._getReplaceKey=function(e,t){var r=e[0];return e.forEach((function(e){(t[e].t<t[r].t||t[e].t===t[r].t&&t[e].n<t[r].n)&&(r=e)})),r},Object.defineProperty(t.prototype,"cacheValues",{get:function(){return this.storage.get(this.cacheKey)||{}},enumerable:!1,configurable:!0}),t.prototype.setCacheValues=function(e){this.storage.set(this.cacheKey,e)},t.prototype.get=function(e){var t=this.cacheValues[e];if(t&&this._check(e,t))return t.v},t.prototype.mget=function(e){var t=this,r={};if(!Array.isArray(e))return r;var n=this.cacheValues;return e.forEach((function(e){var o=n[e];o&&t._check(e,o)&&(r[e]=o.v)})),r},t.prototype.getAll=function(){var e=Object.keys(this.cacheValues);return this.mget(e)},t.prototype.set=function(e,t,r){if(0===this.options.max)return!1;var n=this.cacheValues,o=Object.keys(n);if(!n[e]&&this._isLimited(o.length)){var i=this.keys();if(this._isLimited(i.length)){if("replaced"!==this.options.maxStrategy)return!1;var a=this._getReplaceKey(i,n);this.del(a)}}return n[e]=this._wrap(t,r),this.setCacheValues(n),this.emit("set",e,n[e].v),!0},t.prototype.mset=function(e){var t=this,r=!0;return e.forEach((function(e){var n=t.set(e.key,e.value,e.ttl);r&&!n&&(r=!1)})),r},t.prototype.del=function(e){var t=this,r=this.cacheValues,n=0;return(Array.isArray(e)?e:[e]).forEach((function(e){if(r[e]){n++;var o=r[e];delete r[e],t.emit("del",e,o.v)}})),n>0&&this.setCacheValues(r),n},t.prototype.clear=function(){this.storage.del(this.cacheKey)},t.prototype.keys=function(){var e=this,t=this.cacheValues;return Object.keys(t).filter((function(r){return e._check(r,t[r])}))},t.prototype.has=function(e){var t=this.cacheValues[e];return!(!t||!this._check(e,t))},t.prototype.take=function(e){var t,r=this.cacheValues[e];return r&&this._check(e,r)&&(t=r.v,this.del(e)),t},t.prototype.ttl=function(e,t){var r=this.cacheValues,n=r[e];return!(!n||!this._check(e,n))&&(r[e]=this._wrap(n.v,t),!0)},t.prototype.getTtl=function(e){var t=this.cacheValues,r=t[e];if(r&&this._check(e,r))return t[e].t},t.prototype.getLastModified=function(e){var t=this.cacheValues,r=t[e];if(r&&this._check(e,r))return t[e].n},t.prototype.startCheckperiod=function(){var e=this;this.keys(),this.options.checkperiod>0&&(clearTimeout(this._checkTimeout),this._checkTimeout=setTimeout((function(){e.startCheckperiod()}),this.options.checkperiod))},t.prototype.stopCheckperiod=function(){clearTimeout(this._checkTimeout)},t}(jt);new Zt(zt?window.localStorage:void 0),new Zt(zt?window.sessionStorage:void 0);var Xt=function(){function e(e){this.promiseCache={},this.cache=new Ht("uh_async_memo",e)}return e.prototype.run=function(e,t,r){var n=this;if(!X(t))return e();var o=Ke({persisted:!0},r);if(o.persisted){var i=this.cache.get(t);if(i)return Promise.resolve(i)}return this.promiseCache[t]||(this.promiseCache[t]=e().then((function(e){return delete n.promiseCache[t],n.cache.set(t,e,o.ttl),e})).catch((function(e){return delete n.promiseCache[t],Promise.reject(e)}))),this.promiseCache[t]},e}();e.AsyncMemo=Xt,e.VERSION="4.22.0",e.ajax=Et,e.blobToDataURL=function(e){return wt(e)},e.bytesToSize=yt,e.calculateCursorPosition=function(e,t,r,n,o){void 0===o&&(o={});var i=o.placeholderChar,a=void 0===i?" ":i,c=o.maskReg,u=void 0===c?/\D/g:c,s=o.type,f=B(t),l=B(r),d=k(a)?a:[a],h=l.length-f.length,p=e;if(h>0){var v=l.substring(p-h,p).replace(u,"").length;p-=h-v;for(var y=0;v>0;)-1!==d.indexOf(n.charAt(p-v+y))?y++:v--;p+=y}return("mobile"===s&&(4===p||9===p)||"bankCard"===s&&p>0&&p%5==0)&&(p-=1),p},e.compressImage=function(e,t){return void 0===t&&(t={}),new Promise((function(r,n){var o=t.width,i=t.height,a=t.rotate,c=t.offset,u=void 0===c?[0,0]:c,s=t.cacheImage,f=void 0===s||s,l=t.background,d=void 0===l?"#fff":l,h=t.canvasWidth,p=t.canvasHeight,v=t.format,y=void 0===v?"blob":v,g=t.type,m=void 0===g?"image/jpeg":g,b=t.quality,w=void 0===b?.8:b,x=t.beforeCompress,k=t.beforeDraw,C=t.afterDraw,O=t.ajaxOptions;St(e,f,O).then((function(e){var c=e.image,s=e.blob,f=R(o),l=R(i),v=R(w);f&&(c.width=f),l&&(c.height=l),null==x||x({image:c,blob:s},t);var g=document.createElement("canvas"),b=g.getContext("2d"),O={image:c,blob:s,canvas:g,context:b},E=R("function"==typeof h?h(O,t):h),N=R("function"==typeof p?p(O,t):p);g.width=E||c.width,g.height=N||c.height;var A="none"===d||"transparent"===d;A?b.clearRect(0,0,g.width,g.height):(b.fillStyle=d,b.fillRect(0,0,g.width,g.height));var j=[0,0];a!==be&&(b.translate(c.width/2,c.height/2),j=[-c.width/2,-c.height/2],b.rotate(a*Math.PI/180));var T="function"==typeof u?u(O,t):u;null==k||k(O,t);var S=j[0]+R(T[0]),F=j[1]+R(T[1]);b.drawImage(c,S,F,c.width,c.height),"image/png"===m&&A&&(b.globalCompositeOperation="destination-in",b.drawImage(c,S,F,c.width,c.height)),null==C||C(O,t),"blob"===y?function(e,t,r){return new Promise((function(n){e.toBlob((function(e){n(e)}),t,r)}))}(g,m,v).then(r).catch(n):r(g.toDataURL(m,v))})).catch(n)}))},e.dataURLToBlob=xt,e.divide=Ct,e.download=function e(t,r){return qe(this,void 0,void 0,(function(){var n,o,i,a,c,u,s,f,l,d,h,p,v;return Ge(this,(function(y){switch(y.label){case 0:return n="object"==typeof r?r:{},"string"==typeof r&&(n.fileName=r),o=n.fileName,i=n.type,a=n.dataType,c=n.transformRequest,u=n.transformResponse,"string"!=typeof t?[3,8]:a||!/^blob:.*?\/.*/.test(t)?[3,1]:(Ft(t,o),[2,Promise.resolve()]);case 1:return a||!/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(t)?[3,2]:(s=xt(t),[3,7]);case 2:return"url"===a||!a&&$e(t)?(f=function(e){var t="function"==typeof u?u(e):e;return H(t)?t:Promise.resolve(t)},[4,function(e){var t="function"==typeof c?c(e):e;return H(t)?t:Promise.resolve(t)}({responseType:"blob"})]):[3,6];case 3:return l=y.sent(),[4,Et(t,l)];case 4:return d=y.sent(),[4,f(d.target.response)];case 5:return h=y.sent(),p=o||t.split("?")[0].split("#")[0].split("/").pop(),[2,e(h,{fileName:p,type:i||(D(h)?h.type:be)})];case 6:s=new Blob([t],{type:i||"text/plain"}),y.label=7;case 7:return[3,9];case 8:t instanceof Blob&&(s=t),y.label=9;case 9:return s||(s=new Blob([t],{type:i})),navigator.msSaveBlob?navigator.msSaveBlob(s,o||"download"):(Ft(v=ke(s),o),Ce(v)),[2,Promise.resolve()]}}))}))},e.fileReader=wt,e.filterTree=function e(t,r,n,o){void 0===n&&(n="children"),void 0===o&&(o="spread");var i=[];return k(t)?(t.forEach((function(t){var a=t;if(C(t)&&(a="spread"===o?Ke({},t):t),r(a)){if(C(a)){var c=a[n];k(c)&&c.length>0&&(a[n]=e(c,r,n,o))}i.push(a)}})),i):i},e.findTreeNode=function(e,t,r){var n,o;void 0===r&&(r="children");var i,a=[];if(!k(e))return i;try{for(var c=Je(e),u=c.next();!u.done;u=c.next()){var s=u.value;for(a.push(s);a.length;){var f=a.pop();if(t(f)){i=f;break}if(C(f)){var l=f[r];k(l)&&l.length>0&&l.forEach((function(e){a.push(e)}))}}if(i)break}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return i},e.findTreeNodes=function(e,t,r){var n,o;void 0===r&&(r="children");var i=[],a=[];if(!k(e))return a;try{for(var c=Je(e),u=c.next();!u.done;u=c.next()){var s=u.value;for(i.push(s);i.length;){var f=i.pop();if(t(f)&&a.push(f),C(f)){var l=f[r];k(l)&&l.length>0&&l.forEach((function(e){i.push(e)}))}}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return a},e.findTreeSelect=function(e,t,r){return void 0===r&&(r="children"),$t(e,t,r)},e.formatBankCard=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=t.char,n=void 0===r?" ":r,o=t.length,i=void 0===o?4:o,a="spaceMark"in t?t.spaceMark:n,c=new RegExp("(.{".concat(i,"})"),"g"),u=new RegExp("".concat(a),"g"),s=B(e).replace(u,""),f=s.replace(c,"$1".concat(a));return s.length%i==0?f.substring(0,f.length-1):f},e.formatMobile=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=t.char,n=void 0===r?" ":r,o="spaceMark"in t?t.spaceMark:n,i=new RegExp(o,"g"),a=B(e).replace(i,"").substring(0,11);return a.length>7?a.replace(/^(...)(....)/g,"$1".concat(o,"$2").concat(o)):a.length>3?a.replace(/^(...)/g,"$1".concat(o)):a},e.formatMoney=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=t.precision,n=void 0===r?2:r,o=t.symbol,i=t.thousand,a=void 0===i?",":i,c=t.decimal,u=void 0===c?".":c;if(!function(e){return Ze(e)?("number"==typeof e&&at(e),!0):(se("".concat(e," invalid parameter.")),!1)}(e))return"";if("number"==typeof e&&!isFinite(e))return e+"";"number"!=typeof n||Z(n)||n<0?n=2:n>10&&(n=10),o="string"==typeof o?o:"",a="string"==typeof a?a:",",u="string"==typeof u?u:".";var s=Qe((rt(e)+"").split("."),2),f=s[0],l=s[1];return o+function(e,t){var r,n,o="";e="+"===(e=(n=/^([+-])?(0+)([0-9.]+)$/.exec(r=e))?(n[1]||"")+("."===n[3][0]?"0"+n[3]:n[3]):r)[0]?e.substring(1):e;for(var i=Number(e)<0?"-":"",a=i?e.substring(1).split("").reverse():e.split("").reverse(),c=0;c<a.length;c++)o+=a[c]+((c+1)%3==0&&c+1!==a.length?t:"");return i+o.split("").reverse().join("")}(f,a)+function(e,t,r){if(0===t)return"";var n="";return n=e&&Number(e)>0?parseFloat("0."+e).toFixed(t).substring(2):(0).toFixed(t).substring(2),r+n}(l,n,u)},e.gcd=Ot,e.getFileBlob=At,e.getImageInfo=function(e,t,r){void 0===t&&(t=!0);var n={useCache:"object"==typeof t?!1!==t.useCache:!1!==t,autoRevokeOnDel:"object"==typeof t?!1!==t.autoRevokeOnDel:!!t};return new Promise((function(t,o){n.useCache&&Pt.has(e)?t(Pt.get(e).data):St(e,!1,r).then((function(r){var o,i,a,c=r.image,u=r.blob,s=c.width,f=c.height,l={width:s,height:f,contrast:(o=s,i=f,a=Ot(o,i),"".concat(Ct(q(o),a),":").concat(Ct(q(i),a))),measure:"".concat(s," × ").concat(f," px"),size:yt(u.size),bytes:u.size,image:c,blob:u};n.useCache&&Pt.set(e,{data:l,r:n.autoRevokeOnDel}),t(l)})).catch(o)}))},e.isBankCard=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.luhn,i=void 0!==o&&o,a=B(e),c=n?ie.test(a):oe.test(a);if(c&&i){var u=a.substring(0,a.length-1);return a[a.length-1]===String(function(e){for(var t=(e+"").replace(/\D/g,"").split("").reverse(),r=0,n=0;n<t.length;n++){var o=parseInt(t[n]);r+=n%2==0?2*o-(o>4?9:0):o}var i=r%10;return 0!==i?10-i:0}(u))}return c},e.isBusinessLicense=function(e,t){void 0===t&&(t={});var r=B(e),n=t.loose,o=void 0!==n&&n,i=t.checkCode,a=!o&&(void 0===i||i),c=De.test(r);if(!a||!c)return c;var u=r.substring(0,14),s=r.substring(r.length-1),f=function(e){for(var t=10,r=0;r<14;r++){var n=(t+Number(e[r]))%10;t=2*(n=0===n?10:n)%11}return 1===t?0:11-t}(u);return s===String(f)},e.isChinese=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.useExtend,i=void 0!==o&&o,a=B(e),c=i&&Te;return new RegExp(c?n?je:Re:n?Ee:Ne,c?"u":be).test(a)},e.isEmail=function(e){var t=B(e);return ee.test(t)},e.isHMCard=function(e){var t=B(e);return Ue.test(t)},e.isIPv4=function(e){var t=B(e);return Se.test(t)},e.isIPv6=function(e){var t=B(e);return Fe.test(t)},e.isIdCard=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.checkCode,i=void 0===o||o,a=B(e);return 15===a.length&&n?Y.test(a):!(18!==a.length||!Y.test(a))&&(!i||function(e){var t,r;for(r=t=0;t<17;t++)r+=Math.pow(2,17-t)%11*Number(e[t]);var n=(12-r%11)%11;return n<10?n===Number(e[17]):"X"===e[17].toUpperCase()}(a))},e.isMobile=function(e){var t=B(e);return G.test(t)},e.isPassport=function(e){var t=B(e);return ye.test(t)},e.isPassword=function(e,t){void 0===t&&(t={});var r=t.level,n=void 0===r?2:r,o=t.ignoreCase,i=void 0!==o&&o,a=t.special;return ve(e,{level:n,ignoreCase:i,special:void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a}).validated},e.isPostcode=function(e){var t=B(e);return Q.test(t)},e.isPromiseLike=function(e){return H(e)},e.isQQ=function(e){var t=B(e);return te.test(t)},e.isSocialCreditCode=function(e,t){void 0===t&&(t={});var r=B(e),n=t.loose,o=void 0!==n&&n,i=t.checkCode,a=!o&&(void 0===i||i),c=ae.test(r);if(!a||!c)return c;var u=r.substring(0,17),s=r.substring(r.length-1),f=function(e){for(var t=0,r=function(r){var n=ce.findIndex((function(t){return t===e[r]})),o=Math.pow(3,r)%31;t+=n*o},n=0;n<17;n++)r(n);var o=t%31;return ce[0!==o?31-o:0]}(u);return s===f},e.isSwiftCode=function(e){var t=B(e);return We.test(t)},e.isTWCard=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=B(e);return!!ze.test(o)||!!n&&Ve.test(o)},e.isTelephone=function(e){var t=B(e);return J.test(t)},e.isUrl=$e,e.isValidNumber=Ze,e.isVehicle=function(e){var t=B(e);return ne.test(t)},e.isWX=function(e){var t=B(e);return re.test(t)},e.lcm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.map((function(e){return Math.abs(q(e))}));return 1===r.length&&(r=r.concat([1])),Ct(r.indexOf(0)>-1?0:kt.apply(void 0,Ye([],Qe(r),!1)),Ot.apply(void 0,Ye([],Qe(r),!1)))},e.listToTree=function(e,t){void 0===t&&(t={});var r=t.keyField,n=void 0===r?"id":r,o=t.parentField,i=void 0===o?"pid":o,a=t.childrenField,c=void 0===a?"children":a,u=t.emptyChildrenValue,s=void 0===u?"none":u,f=t.nodeAssign,l=void 0===f?"spread":f,d=[],h={};return k(e)?(e.forEach((function(e){if(C(e)){var t="spread"===l?Ke({},e):e,r=t[n],o=t[i];h[r]?t[c]=h[r]:t[c]=h[r]=[],o?h[o]?h[o].push(t):h[o]=[t]:d.push(t)}})),"array"!==s&&Bt(d,t),d):d},e.loadImage=function(e,t){void 0===t&&(t=!0);var r={useCache:"object"==typeof t?!1!==t.useCache:!1!==t,autoRevokeOnDel:"object"==typeof t?!1!==t.autoRevokeOnDel:!!t};return new Promise((function(t,n){if(r.useCache&&_t.has(e))t(_t.get(e).data);else{var o=D(e),i=o?ke(e):e,a=new Image;o||(a.crossOrigin="anonymous"),a.onload=function(){r.useCache&&_t.set(e,{data:a,r:r.autoRevokeOnDel}),t(a)},a.onerror=function(t){o&&Ce(i),console.error("[loadImage] The image load failed, '".concat(e,"'.")),n(t)},a.src=i}}))},e.loadImageWithBlob=St,e.loadScript=function(e,t){return new Promise((function(r,n){var o=document.head,i=document.createElement("script"),a=t||{},c=a.attrs,u=a.destroyOnError,s=void 0===u||u,f=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(a,["attrs","destroyOnError"]),l=Ke(Ke({async:!0,type:"text/javascript"},f),{src:e});for(var d in l)"onload"!==d&&"onerror"!==d&&(i[d]=l[d]);"object"==typeof c&&we(c).forEach((function(e){i.setAttribute(e,c[e])})),i.onload=function(e){var t;this.onerror=this.onload=null,null===(t=l.onload)||void 0===t||t.call(this,e),r(i)},i.onerror=function(e){var t;this.onerror=this.onload=null,null===(t=l.onerror)||void 0===t||t.call(this,e),s&&o.removeChild(i),n(new URIError("Failed to load "+this.src))},o.appendChild(i)}))},e.minus=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=void 0===t[1]?0:t[1],i=t.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=rt(n),o=rt(o),Z(n)||Z(o))return Number.NaN;var a=Math.pow(10,Math.max(ot(n),ot(o)));return(kt(n,a)-kt(o,a))/a},e.normalizeString=function(e){return B(e)},e.numberToChinese=function(e,t){void 0===t&&(t={});var r=t.big5,n=void 0!==r&&r,o=t.unit,i=void 0===o||o,a=t.zero,c=void 0===a?"":a,u=t.negative,s=void 0===u?"负":u,f=t.unitConfig,l=void 0===f?{}:f,d=t.decimal,h=void 0===d?"":d;if("number"!=typeof e||Z(e))return se("参数错误 ".concat(e,",请传入数字")),"";at(e),n?(ct=dt.slice(),ut=ht.slice(),h=h||"點"):(ct=ft.slice(),ut=lt.slice(),h=h||"点");var p=(null==l?void 0:l.w)||"万",v=(null==l?void 0:l.y)||"亿";st=["",p,v,p+v],c&&(ct[0]=c);var y,g=e<0?s:"",m=Math.abs(e);y=i?function(e){var t=Math.floor(e),r=0,n="",o="",i=!1;if(0===t)return ct[0];for(;t>0;){var a=t%1e4;i&&(o=ct[0]+o),n=pt(a),o=(n+=0!==a?st[r]:st[0])+o,i=a<1e3&&a>0,t=Math.floor(t/1e4),r++}return o}(m):vt(Math.floor(m));var b=function(e){var t=e+"",r=t.indexOf("."),n="";return r>-1&&(n=vt(t.slice(r+1))),n}(m);return b?"".concat(g).concat(y).concat(h).concat(b):"".concat(g).concat(y)},e.padZero=function(e,t){void 0===t&&(t=2);var r=B(e),n=r.length;return("number"!=typeof t||t<0)&&(t=0),n<t?"0".repeat(t-n)+r:r},e.parseIdCard=function(e){var t=gt.exec(e);if(!t)return null;var r=t.groups||{province:t[1],city:t[2],area:t[3],year:t[4],month:t[5],day:t[6],gender:t[7]},n=mt.find((function(e){return e[0]===r.province}));if(!n)return null;var o="".concat(r.year,"-").concat(r.month,"-").concat(r.day),i=Number(r.gender)%2==0?"女":"男";return{province:n[1],birthday:o,gender:i,origin:r}},e.plus=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=void 0===t[1]?0:t[1],i=t.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=rt(n),o=rt(o),Z(n)||Z(o))return Number.NaN;var a=Math.pow(10,Math.max(ot(n),ot(o)));return(kt(n,a)+kt(o,a))/a},e.randomString=function(e,t){void 0===e&&(e=0);var r="string"==typeof t&&t?t:Mt;return Lt(R(e),r)},e.replaceChar=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=t.char,n=void 0===r?"*":r,o=t.exclude,i=t.start,a=void 0===i?3:i,c=t.end,u=void 0===c?-4:c,s=t.repeat,f=B(e),l=f.length;if(Math.abs(a)>=l)return f;if((a=a>=0?a:l+a)>=(u=u>=0?u:l+u))return f;var d=f.substring(a,u);if(o){var h=new RegExp("[^".concat(o,"]"),"g");d=d.replace(h,n)}else s="number"==typeof s&&s>=0?s:d.length,d=n.repeat(s);return f.substring(0,a)+d+f.substring(u)},e.round=function(e,t){return void 0===t&&(t=0),q(e,t)},e.safeDate=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n="string"==typeof e?e.replace(/[\\.-]/g,"/"):e;return t&&t.length>0?new(Date.bind.apply(Date,Ye([void 0,n],Qe(t),!1))):void 0===n?new Date:new Date(n)},e.setDataURLPrefix=function(e,t,r){return void 0===t&&(t="image/png"),void 0===r&&(r=!0),"data:".concat(t).concat(r?";base64":"",",").concat(e)},e.setDisableWarning=function(e){ue.disableWarning=!!e},e.strlen=function(e){for(var t=B(e),r=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o>=1&&o<=126||65376<=o&&o<=65439?r++:r+=2}return r},e.times=kt,e.transformFieldNames=function(e,t,r,n){return void 0===n&&(n="spread"),k(e)?e.length<=0?[]:function e(o){return o.map((function(o){if(!C(o))return o;var i="spread"===n?Ke({},o):o,a=[];r&&k(i[r])&&i[r].length>0&&(i[r]=e(i[r].slice()));var c=we(t);return c.forEach((function(e){var r=t[e];r in i&&(i[e]=i[r],-1===c.indexOf(r)&&a.push(r))})),a.length>0&&a.forEach((function(e){delete i[e]})),i}))}(e.slice()):e},e.treeToList=function(e,t){var r=[];return k(e)?(function e(n){n.forEach((function(n){if(C(n)){var o=Ke({},n);r.push(o),o[t]&&(k(o[t])&&o[t].length>0&&e(o[t]),delete o[t])}else r.push(n)}))}(e),r):r},e.validatePassword=ve,e.version="4.22.0",e.waitTime=function(e){return void 0===e&&(e=1e3),void 0===(t=e)&&(t=1e3),new Promise((function(e){setTimeout(e,t)}));var t}}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).utilHelpers={})}(this,(function(e){"use strict";var t=void 0,r="undefined",n="object",o=Object.prototype,i=o.toString,a=o.propertyIsEnumerable,c=Object.getOwnPropertySymbols,u=Object.keys,s=typeof Symbol!==r?Symbol.prototype:t,f=Math.min,l=Number.isFinite,d=typeof globalThis===n&&globalThis,h=typeof global===n&&global,p=typeof self===n&&self,v=Number.MAX_SAFE_INTEGER||9007199254740991,y=Number.MIN_SAFE_INTEGER||-9007199254740991,g="[object Number]",m="[object String]",b="[object Symbol]",w=["Function","AsyncFunction","GeneratorFunction","Proxy"].map((function(e){return"[object "+e+"]"})),x="[object Blob]";function k(e){return Array.isArray(e)}function C(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function O(e){return i.call(e)}function E(e){return"symbol"==typeof e||O(e)===b}var N=/^0b[01]+$/i,A=/^0o[0-7]+$/i,j=/^[-+]0x[0-9a-f]+$/i;function R(e){if("number"==typeof e)return e;if(E(e))return NaN;if(C(e)&&(e=Number(e)),"string"!=typeof e)return 0===e?e:+e;e=e.trim();var t=N.test(e);return t||A.test(e)?parseInt(e.slice(2),t?2:8):j.test(e)?NaN:+e}function T(e){return e}function S(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=v}(e.length)&&!function(e){if("function"==typeof e)return!0;var t=O(e);return w.some((function(e){return e===t}))}(e)}function F(e){return C(e)?u(e).concat(function(e){return c&&null!==e?c(e).filter((function(t){return a.call(e,t)})):[]}(e)):[]}var P,_=(P=1,function(e,t){void 0===t&&(t=T);for(var r=!S(e)&&F(e),n=(r||e).length,o=0;o>=0&&o<n;){var i=r?r[o]:o;if(!1===t(e[i],i,e))break;o+=P}return e});function I(e){return"number"==typeof e||O(e)===g}var M=s?s.toString:t;function L(e){if("string"==typeof e)return e;if(k(e))return""+e.map(L);if(E(e))return M?M.call(e):"";var t=""+e;return"0"===t&&1/e==-1/0?"-0":t}function B(e){return function(e){return null==e}(e)?"":L(e)}var $=typeof Blob!==r;function D(e){return!!($&&e instanceof Blob)||O(e)===x}var U=d&&globalThis.Object===Object&&globalThis,z=h&&global.Object===Object&&global,V=p&&self.Object===Object&&self,W=U||z||V||Function("return this")();function Z(e){return I(e)&&W.isNaN(e)}function H(e){return C(e)&&"function"==typeof e.then}function X(e){return"string"==typeof e||O(e)===m}function K(e,t,r){void 0===r&&(r=0);var n=Math[e];if(t=R(t),r=f(function(e){var t=R(e);if(!t||t===1/0||t===-1/0)return t==t?t:0;var r=t%1;return r?t-r:t}(r),292),0===r||!function(e){return l?l(e):"number"==typeof e&&W.isFinite(e)}(t))return n(t);var o=B(t).split("e");return+((o=B(t=n(+(o[0]+"e"+(o[1]?+o[1]+r:r)))).split("e"))[0]+"e"+(o[1]?+o[1]-r:-r))}function q(e,t){return K("round",e,t)}var G=0;var J=/^1[3456789]\d{9}$/;var Q=/^(0\d{2,3}-)?([2-9]\d{6,7})(-\d{1,6})?$/;var Y=/^\d{6}$/;var ee=/^[1-9]\d{5}(19|20)?\d{2}((0[1-9])|(1[012]))(([0-2][1-9])|10|20|30|31)\d{3}(\d|X)?$/i;var te=/^[\da-z]+([-._]?[\da-z]+)*@[\da-z]+([-.]?[\da-z]+)*(\.[a-z]{2,})+$/i;var re=/^[1-9]\d{4,10}$/;var ne=/^[a-z]([-_a-z0-9]{5,19})+$/i;var oe=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})|([A-Z0-9]{5}[DF])|([DF][A-Z0-9]{5}))$/;var ie=/^[1-9]\d{9,20}$/,ae=/^\d{8,30}$/;var ce=/^[\dA-HJ-NPQRTUWXY]{2}\d{6}[\dA-HJ-NPQRTUWXY]{10}$/,ue="0123456789ABCDEFGHJKLMNPQRTUWXY".split("");var se={disableWarning:!0};function fe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];se.disableWarning||console.warn.apply(void 0,e)}var le=/[\d]/,de=/[a-z]/,he=/[A-Z]/,pe=/[\d|a-z]/gi;function ve(e){return e.indexOf("\\x")>-1||e.indexOf("\\u")>-1}function ye(e,t){void 0===t&&(t={});var r=t.level,n=void 0===r?2:r,o=t.ignoreCase,i=void 0!==o&&o,a=t.special,c=void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a,u=e;"string"!=typeof e&&(fe("[validatePassword] value must be a string."),u="");var s,f=0,l=(s=u,le.test(s)),d=function(e){return de.test(e)}(u),h=function(e){return he.test(e)}(u),p=function(e,t){if(!t||!e)return!1;var r=e.replace(pe,"");if(!r)return!1;var n=ve(t)?new RegExp("[".concat(t,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(e){return t.indexOf(e)>-1&&(o=!0),o})),o}(u,c),v=function(e,t){if(!e)return!1;var r=e.replace(pe,"");if(!r)return!1;if(!t)return!0;var n=ve(t)?new RegExp("[^".concat(t,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(e){return-1===t.indexOf(e)&&(o=!0),o})),o}(u,c);return l&&(f+=1),i?(d||h)&&(f+=1):(d&&(f+=1),h&&(f+=1)),p&&(f+=1),{validated:f>=n&&!v,level:f,containes:{number:l,lowerCaseLetter:d,upperCaseLetter:h,specialCharacter:p,unallowableCharacter:v}}}var ge=/^((e[\da-z])|(de)|(se)|(pe)|([khm][\da-z]))[\da-z]{7}$/i;var me,be="undefined"!=typeof URL,we=void 0,xe=Object.keys,ke=Object.values,Ce=be?URL.createObjectURL:(me="",function(){return me}),Oe=be?URL.revokeObjectURL:function(){},Ee={chineseBasic:"[一-龥]",chineseExtend:"[麦-鿿]",chineseExtend2:"[豈-龎]",chineseExtendA:"[㐀-䶿]",chineseExtendB:"[𠀀-𪛟]",chineseExtendC:"[𪜀-𫜸]",chineseExtendD:"[𫝀-𫠝]",chineseExtendE:"[𫠠-𬺡]",chineseExtendF:"[𬺰-𮯠]",chineseExtendG:"[𰀀-𱍊]",chineseExtendH:"[𱍐-𲎯]",chineseExtendI:"[-]"},Ne=Ee.chineseBasic+"+",Ae="^"+Ee.chineseBasic+"+$",je="(?:"+ke(Ee).join("|")+")",Re=je+"+",Te="^"+je+"+$",Se=RegExp.prototype.hasOwnProperty("unicode");var Fe=/^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;var Pe=/^((([0-9A-F]{1,4}:){7}([0-9A-F]{1,4}|:))|(([0-9A-F]{1,4}:){6}(:[0-9A-F]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){5}(((:[0-9A-F]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){4}(((:[0-9A-F]{1,4}){1,3})|((:[0-9A-F]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){3}(((:[0-9A-F]{1,4}){1,4})|((:[0-9A-F]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){2}(((:[0-9A-F]{1,4}){1,5})|((:[0-9A-F]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){1}(((:[0-9A-F]{1,4}){1,6})|((:[0-9A-F]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(:(((:[0-9A-F]{1,4}){1,7})|((:[0-9A-F]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:)))(%.+)?$/i;var _e="localhost|(([^\\s:\\/]+?\\.)+?[^\\s:\\/]+)",Ie=":\\d+",Me="\\/.*",Le="\\?.*",Be=new RegExp("^".concat("[\\w-.]+:\\/\\/","(?:").concat("[-;:&=\\+\\$,\\w]+@",")?(?:").concat(_e,")(?:").concat(Ie,")?(?:").concat(Me,")*(?:").concat(Le,")?(?:").concat("#.*",")?$")),$e=new RegExp("^(?:".concat(_e,")(?:").concat(Ie,")?(?:").concat(Me,")*(?:").concat(Le,")?(?:").concat("#.*",")?$"));function De(e){var t=B(e);return Be.test(t)||$e.test(t)}var Ue=/^\d{15}$/;var ze=/^[hm]{1}([0-9]{10}|[0-9]{8})$/i;var Ve=/^\d{8}$/i,We=/^[\da-z]{10,12}$/i;var Ze=/^[A-Z]{6}[A-Z\d]{2}(?:[A-Z\d]{3})?$/;function He(e,t){var r;return void 0===t&&(t=!1),"number"==typeof(r=t?"string"==typeof e&&""!==e?Number(e):e:"number"==typeof e?e:E(e)?Number.NaN:Number(e))&&!Z(r)}var Xe=function(e,t){return Xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},Xe(e,t)};function Ke(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Xe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var qe=function(){return qe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qe.apply(this,arguments)};function Ge(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function c(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,c)}u((n=n.apply(e,t||[])).next())}))}function Je(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}function Qe(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ye(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function et(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var tt=/^[-+]?0[b|o|x]\d+/i,rt=/^\.\d+/;function nt(e){var t;return X(e)?""===(t=e.trim())?t=Number(t):tt.test(t)||rt.test(t)?t=R(t):Z(Number(t))&&(t=Number.NaN):t=E(e)?Number.NaN:I(e)?e:Number(e),Z(t)?Number.NaN:t}function ot(e,t){return void 0===t&&(t=12),+parseFloat(e.toPrecision(t))}function it(e){var t=e.toString().split(/e/i),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function at(e){var t=String(e);if(!function(e){return/\d+\.?\d*e[+-]*\d+/i.test(e)}(t))return Number(t.replace(".",""));var r=it(e);return r>0?ot(+e*Math.pow(10,r)):+e}function ct(e){(+e>v||+e<y)&&fe("".concat(e," is beyond boundary when transfer to integer, the results may not be accurate"))}var ut,st,ft,lt=["零","一","二","三","四","五","六","七","八","九"],dt=["","十","百","千"],ht=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],pt=["","拾","佰","仟"];function vt(e){for(var t="",r="",n=!1,o=0;e>0;){var i=e%10;0==i?n&&(n=!1,r=ut[i]+r):(n=!0,t=ut[i],r=(t+=st[o])+r),o++,e=Math.floor(e/10)}return r}function yt(e){for(var t=e+"",r="",n=0,o=t.length;n<o;n++)r+=ut[parseInt(t[n])];return r}function gt(e,t){void 0===t&&(t={});var r=t.spaceMark,n=void 0===r?" ":r,o=t.precision,i=void 0===o?2:o,a="number"!=typeof e?Number(e):e;if(0===a||Z(a))return"0".concat(n,"B");var c=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],u=Math.floor(Math.log(a)/Math.log(1024));return c[u]?"".concat(Number((a/Math.pow(1024,u)).toFixed(i))).concat(n).concat(c[u]):a+""}var mt=/^(?<province>\d{2})(?<city>\d{2})(?<area>\d{2})(?<year>(?:\d{2})?\d{2})(?<month>\d{2})(?<day>\d{2})\d{2}(?<gender>\d)(?:\d|X)?$/i,bt=[["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","台湾省"],["83","台湾省"],["81","香港特别行政区"],["82","澳门特别行政区"]];var wt={arrayBuffer:"readAsArrayBuffer",binaryString:"readAsBinaryString",dataURL:"readAsDataURL",text:"readAsText"},xt=function(e,t){void 0===t&&(t="dataURL");var r=wt[t];return r||(r=wt.dataURL),new Promise((function(t,n){var o=new FileReader;o[r](e),o.onload=function(){return t(o.result)},o.onerror=function(e){return n(e)}}))};function kt(e){for(var t=e.split(","),r=t[0].substring(5).split(";"),n=r[0],o=(-1!==r.indexOf("base64")?atob:decodeURIComponent)(t[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new Blob([a],{type:n})}function Ct(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return Ct.apply(void 0,[Ct(r,n)].concat(o));if(r=nt(r),n=nt(n),Z(r)||Z(n))return Number.NaN;var i=at(r),a=at(n),c=it(r)+it(n),u=i*a;return ct(u),u/Math.pow(10,c)}function Ot(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return Ot.apply(void 0,[Ot(r,n)].concat(o));if(r=nt(r),n=nt(n),Z(r)||Z(n))return Number.NaN;var i=at(r),a=at(n);return ct(i),ct(a),Ct(i/a,ot(Math.pow(10,it(n)-it(r))))}function Et(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?0:e[1],o=e.slice(2);if(o.length>0)return Et.apply(void 0,[Et(r,n)].concat(o));if(r=Math.abs(q(r)),n=Math.abs(q(n)),Z(r)||Z(n))return Number.NaN;if(0===r&&0===n)return 0;if(0===r)return n;if(0===n)return r;var i=n;for(r<n&&(i=r,r=n,n=i);i;)i=r%n,r=n,n=i;return R(r)}function Nt(e,t){var r=t||{},n=r.method,o=void 0===n?"get":n,i=r.data,a=void 0===i?null:i,c=r.timeout,u=r.headers,s=r.withCredentials,f=void 0!==s&&s,l=r.async,d=void 0===l||l,h=r.user,p=void 0===h?null:h,v=r.password,y=void 0===v?null:v,g=r.responseType,m=r.onReadyStateChange,b=r.onLoadStart,w=r.onProgress,x=r.onAbort,k=r.onTimeout,C=r.onError,O=r.onLoad,E=r.onLoadEnd;return new Promise((function(t,r){var n=new XMLHttpRequest;n.open(o.toLowerCase(),e,d,p,y),m&&(n.onreadystatechange=m),"number"==typeof c&&c>0&&(n.timeout=c),n.withCredentials=f,g&&(n.responseType=g),"object"==typeof u&&xe(u).map((function(e){n.setRequestHeader(e,u[e])}));var i,s=function(e){return function(t){r(t),null==e||e.call(n,t)}},l={loadstart:b,progress:w,abort:s(x),timeout:s(k),error:s(C),load:(i=O,function(e){t(e),null==i||i.call(n,e)}),loadend:E};xe(l).map((function(e){var t=l[e];t&&n.addEventListener(e,t)})),n.send(a)}))}var At=[200,304];function jt(e,t){return new Promise((function(r,n){D(e)?r(e):Nt(e,qe({responseType:"blob"},t)).then((function(t){var o=t.target.status;if(-1!==At.indexOf(o))r(t.target.response);else{var i=new Error("The file does not support get requests, responseStatus ".concat(o,", '").concat(e,"'."));console.error(i),n(i)}})).catch((function(e){console.error(new Error("Failed to request file. ".concat(e))),n(e)}))}))}var Rt=function(){function e(){this.handlers={}}return e.prototype.eventNames=function(){var e,t=(null===(e=Object.getOwnPropertySymbols)||void 0===e?void 0:e.call(Object,this.handlers))||[];return Object.keys(this.handlers).concat(t)},e.prototype.rawListeners=function(e){var t=this.handlers[e];return t?t.map((function(e){return e.raw})):[]},e.prototype.listeners=function(e){var t=this.handlers[e];return t?t.map((function(e){return e.wrap})):[]},e.prototype.hasListener=function(e,t){return this.rawListeners(e).some((function(e){return e===t}))},e.prototype._on=function(e,t,r,n,o){void 0===n&&(n=null),void 0===o&&(o=1);var i={raw:t,wrap:r,context:n};if(this.handlers[e]){var a=1===o?"push":"unshift";this.handlers[e][a](i)}else this.handlers[e]=[i];return this},e.prototype.prependListener=function(e,t,r){return this._on(e,t,t,r,0)},e.prototype.on=function(e,t,r){return this._on(e,t,t,r)},e.prototype._wrapOnce=function(e,t,r){var n=this;void 0===r&&(r=null);var o=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];t.apply(r,i),n.off(e,o)};return o},e.prototype.once=function(e,t,r){var n=this._wrapOnce(e,t,r);return this._on(e,t,n,r)},e.prototype.prependOnceListener=function(e,t,r){var n=this._wrapOnce(e,t,r);return this._on(e,t,n,r,0)},e.prototype.off=function(e,t){var r=this.handlers[e];if(r)if(t){var n=r.findIndex((function(e){return e.wrap===t||e.raw===t}));-1!==n&&r.splice(n,1)}else delete this.handlers[e];return this},e.prototype.offAll=function(){return this.handlers={},this},e.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this.handlers[e];return!!(n&&n.length>0)&&(n.forEach((function(e){e.wrap.apply(e.context,t)})),!0)},e}(),Tt=function(e){function t(t){var r=e.call(this)||this;return r.data=[],r.options=qe({max:10},t),r}return Ke(t,e),t.prototype.has=function(e){return!!this.data.find((function(t){return t.k===e}))},t.prototype.get=function(e){var t;return null===(t=this.data.find((function(t){return t.k===e})))||void 0===t?void 0:t.v},t.prototype.checkLimit=function(){var e=this;if(0!==this.options.max){var t=this.data.length-this.options.max;if(t>=0){var r=this.data.splice(0,t+1);_(r,(function(t){e.emit("del",t.v,t.k)}))}}},t.prototype.set=function(e,t){var r={k:e,v:t};if(this.has(e)){var n=this.data.findIndex((function(t){return t.k===e}));this.data.splice(n,1,r)}else this.checkLimit(),this.data.push(r)},t}(Rt),St=new Tt({max:1});function Ft(e,t,r){void 0===t&&(t=!0);var n={useCache:"object"==typeof t?!1!==t.useCache:!1!==t,autoRevokeOnDel:"object"==typeof t?!1!==t.autoRevokeOnDel:!!t};return new Promise((function(t,o){n.useCache&&St.has(e)?t(St.get(e).data):jt(e,r).then((function(r){var i=Ce(r),a=new Image;a.onload=function(){var o={blob:r,image:a};n.useCache&&St.set(e,{data:o,r:n.autoRevokeOnDel}),t(o)},a.onerror=function(t){Oe(i),console.error("[loadImageWithBlob] The image load failed, '".concat(e,"'.")),o(t)},a.src=i})).catch(o)}))}St.on("del",(function(e){if(e.r)try{Oe(e.data.image.src)}catch(e){}}));function Pt(e,t){void 0===t&&(t="");var r=document.createElement("a");r.href=e,r.style.display="none",r.setAttribute("download",t),r.addEventListener("click",(function e(t){t.stopPropagation(),r.removeEventListener("click",e)})),document.body.appendChild(r),r.click(),document.body.removeChild(r)}var _t=new Tt({max:1});_t.on("del",(function(e){if(e.r)try{Oe(e.data.image.src)}catch(e){}}));var It=new Tt({max:1});It.on("del",(function(e){if(e.r)try{Oe(e.data.src)}catch(e){}}));var Mt="abcdefghijklmnopqrstuvwxyz",Lt="0123456789"+Mt+Mt.toUpperCase();function Bt(e,t,r){for(void 0===r&&(r="");e-- >0;){return Bt(e,t,r+t[Math.floor(Math.random()*t.length)])}return r}function $t(e,t){var r=t.childrenField,n=void 0===r?"children":r,o=t.emptyChildrenValue,i=void 0===o?"none":o;e.forEach((function(e){e[n].length<=0?"null"===i?e[n]=null:delete e[n]:$t(e[n],t)}))}function Dt(e,t,r,n){var o,i;if(void 0===n&&(n=[]),!k(e))return[];try{for(var a=Qe(e),c=a.next();!c.done;c=a.next()){var u=c.value;if(n.push(u),t(u))return n;if(C(u)){var s=u[r];if(k(s)&&s.length>0){var f=Dt(s,t,r,n);if(f.length>0)return f}}n.pop()}}catch(e){o={error:e}}finally{try{c&&!c.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return[]}var Ut=1;function zt(){return"".concat(Math.random().toString(16).substring(2,8),"_").concat(Ut++)}var Vt="undefined"!=typeof window&&"object"==typeof window&&window.window===window,Wt={},Zt=function(){function e(e){void 0===e&&(e="default"),this.scope=e,Wt[this.scope]||(Wt[this.scope]={}),this.data=Wt[this.scope]}return e.prototype.getItem=function(e){return e in this.data?this.data[e]:null},e.prototype.setItem=function(e,t){this.data[e]=t},e.prototype.removeItem=function(e){delete this.data[e]},e.prototype.clear=function(){Wt[this.scope]={},this.data=Wt[this.scope]},e}(),Ht=function(){function e(e,t){void 0===t&&(t={});var r=!!e&&function(e){try{var t="object"==typeof e&&null!==e&&!!e.setItem&&!!e.getItem&&!!e.removeItem;if(t){var r=zt();if(e.setItem(r,"1"),"1"!==e.getItem(r))return!1;e.removeItem(r)}return t}catch(t){return console.error("[cache2] ".concat(e," is not supported. The default memory cache will be used.")),!1}}(e);this.options=qe({needParsed:r},t),this.storage=r?e:new Zt(this.options.memoryScope)}return e.prototype.get=function(e){var t=this.storage.getItem(e);return this.options.needParsed?function(e,t){try{return JSON.parse(e,t)}catch(t){return e}}(t,this.options.reviver):t},e.prototype.set=function(e,t){this.storage.setItem(e,this.options.needParsed?function(e,t){return JSON.stringify(e,t)}(t,this.options.replacer):t)},e.prototype.del=function(e){this.storage.removeItem(e)},e.prototype.clear=function(){"function"==typeof this.storage.clear&&this.storage.clear()},e}(),Xt=function(e){function t(t,r){var n,o=e.call(this)||this,i="default";return"string"==typeof t?i=t:"object"==typeof t&&(n=t),n||"object"!=typeof r||(n=r),o.options=qe({max:-1,stdTTL:0,maxStrategy:"limited",checkperiod:0,prefix:"cache2_"},n),o.storage=new Ht(o.options.storage,qe({memoryScope:i},n)),o.cacheKey=(o.options.prefix||"")+(i||"")||zt(),o.startCheckperiod(),o}return Ke(t,e),t.prototype._check=function(e,t){var r=!0;return 0!==t.t&&t.t<Date.now()&&(r=!1,this.del(e),this.emit("expired",e,t.v)),r},t.prototype._wrap=function(e,t){var r=Date.now(),n="number"==typeof t?t:this.options.stdTTL;return{v:e,t:n>0?r+n:0,n:r}},t.prototype._isLimited=function(e){return this.options.max>-1&&e>=this.options.max},t.prototype._getReplaceKey=function(e,t){var r=e[0];return e.forEach((function(e){(t[e].t<t[r].t||t[e].t===t[r].t&&t[e].n<t[r].n)&&(r=e)})),r},Object.defineProperty(t.prototype,"cacheValues",{get:function(){return this.storage.get(this.cacheKey)||{}},enumerable:!1,configurable:!0}),t.prototype.setCacheValues=function(e){this.storage.set(this.cacheKey,e)},t.prototype.get=function(e){var t=this.cacheValues[e];if(t&&this._check(e,t))return t.v},t.prototype.mget=function(e){var t=this,r={};if(!Array.isArray(e))return r;var n=this.cacheValues;return e.forEach((function(e){var o=n[e];o&&t._check(e,o)&&(r[e]=o.v)})),r},t.prototype.getAll=function(){var e=Object.keys(this.cacheValues);return this.mget(e)},t.prototype.set=function(e,t,r){if(0===this.options.max)return!1;var n=this.cacheValues,o=Object.keys(n);if(!n[e]&&this._isLimited(o.length)){var i=this.keys();if(this._isLimited(i.length)){if("replaced"!==this.options.maxStrategy)return!1;var a=this._getReplaceKey(i,n);this.del(a)}}return n[e]=this._wrap(t,r),this.setCacheValues(n),this.emit("set",e,n[e].v),!0},t.prototype.mset=function(e){var t=this,r=!0;return e.forEach((function(e){var n=t.set(e.key,e.value,e.ttl);r&&!n&&(r=!1)})),r},t.prototype.del=function(e){var t=this,r=this.cacheValues,n=0;return(Array.isArray(e)?e:[e]).forEach((function(e){if(r[e]){n++;var o=r[e];delete r[e],t.emit("del",e,o.v)}})),n>0&&this.setCacheValues(r),n},t.prototype.clear=function(){this.storage.del(this.cacheKey)},t.prototype.keys=function(){var e=this,t=this.cacheValues;return Object.keys(t).filter((function(r){return e._check(r,t[r])}))},t.prototype.has=function(e){var t=this.cacheValues[e];return!(!t||!this._check(e,t))},t.prototype.take=function(e){var t,r=this.cacheValues[e];return r&&this._check(e,r)&&(t=r.v,this.del(e)),t},t.prototype.ttl=function(e,t){var r=this.cacheValues,n=r[e];return!(!n||!this._check(e,n))&&(r[e]=this._wrap(n.v,t),!0)},t.prototype.getTtl=function(e){var t=this.cacheValues,r=t[e];if(r&&this._check(e,r))return t[e].t},t.prototype.getLastModified=function(e){var t=this.cacheValues,r=t[e];if(r&&this._check(e,r))return t[e].n},t.prototype.startCheckperiod=function(){var e=this;this.keys(),this.options.checkperiod>0&&(clearTimeout(this._checkTimeout),this._checkTimeout=setTimeout((function(){e.startCheckperiod()}),this.options.checkperiod))},t.prototype.stopCheckperiod=function(){clearTimeout(this._checkTimeout)},t}(Rt);new Ht(Vt?window.localStorage:void 0),new Ht(Vt?window.sessionStorage:void 0);var Kt=function(){function e(e){var t;this.promiseCache={},this.cache=new Xt((t=++G,B("uh_async_memo")+t),e)}return e.prototype.run=function(e,t,r){var n=this;if(!t||!X(t))return e();var o=qe({persisted:!0},r);if(o.persisted){var i=this.cache.get(t);if(i)return Promise.resolve(i)}return this.promiseCache[t]||(this.promiseCache[t]=e().then((function(e){return delete n.promiseCache[t],n.cache.set(t,e,o.ttl),e})).catch((function(e){return delete n.promiseCache[t],Promise.reject(e)}))),this.promiseCache[t]},e}();e.AsyncMemo=Kt,e.VERSION="4.22.2",e.ajax=Nt,e.blobToDataURL=function(e){return xt(e)},e.bytesToSize=gt,e.calculateCursorPosition=function(e,t,r,n,o){void 0===o&&(o={});var i=o.placeholderChar,a=void 0===i?" ":i,c=o.maskReg,u=void 0===c?/\D/g:c,s=o.type,f=B(t),l=B(r),d=k(a)?a:[a],h=l.length-f.length,p=e;if(h>0){var v=l.substring(p-h,p).replace(u,"").length;p-=h-v;for(var y=0;v>0;)-1!==d.indexOf(n.charAt(p-v+y))?y++:v--;p+=y}return("mobile"===s&&(4===p||9===p)||"bankCard"===s&&p>0&&p%5==0)&&(p-=1),p},e.compressImage=function(e,t){return void 0===t&&(t={}),new Promise((function(r,n){var o=t.width,i=t.height,a=t.rotate,c=t.offset,u=void 0===c?[0,0]:c,s=t.cacheImage,f=void 0===s||s,l=t.background,d=void 0===l?"#fff":l,h=t.canvasWidth,p=t.canvasHeight,v=t.format,y=void 0===v?"blob":v,g=t.type,m=void 0===g?"image/jpeg":g,b=t.quality,w=void 0===b?.8:b,x=t.beforeCompress,k=t.beforeDraw,C=t.afterDraw,O=t.ajaxOptions;Ft(e,f,O).then((function(e){var c=e.image,s=e.blob,f=R(o),l=R(i),v=R(w);f&&(c.width=f),l&&(c.height=l),null==x||x({image:c,blob:s},t);var g=document.createElement("canvas"),b=g.getContext("2d"),O={image:c,blob:s,canvas:g,context:b},E=R("function"==typeof h?h(O,t):h),N=R("function"==typeof p?p(O,t):p);g.width=E||c.width,g.height=N||c.height;var A="none"===d||"transparent"===d;A?b.clearRect(0,0,g.width,g.height):(b.fillStyle=d,b.fillRect(0,0,g.width,g.height));var j=[0,0];a!==we&&(b.translate(c.width/2,c.height/2),j=[-c.width/2,-c.height/2],b.rotate(a*Math.PI/180));var T="function"==typeof u?u(O,t):u;null==k||k(O,t);var S=j[0]+R(T[0]),F=j[1]+R(T[1]);b.drawImage(c,S,F,c.width,c.height),"image/png"===m&&A&&(b.globalCompositeOperation="destination-in",b.drawImage(c,S,F,c.width,c.height)),null==C||C(O,t),"blob"===y?function(e,t,r){return new Promise((function(n){e.toBlob((function(e){n(e)}),t,r)}))}(g,m,v).then(r).catch(n):r(g.toDataURL(m,v))})).catch(n)}))},e.dataURLToBlob=kt,e.divide=Ot,e.download=function e(t,r){return Ge(this,void 0,void 0,(function(){var n,o,i,a,c,u,s,f,l,d,h,p,v;return Je(this,(function(y){switch(y.label){case 0:return n="object"==typeof r?r:{},"string"==typeof r&&(n.fileName=r),o=n.fileName,i=n.type,a=n.dataType,c=n.transformRequest,u=n.transformResponse,"string"!=typeof t?[3,8]:a||!/^blob:.*?\/.*/.test(t)?[3,1]:(Pt(t,o),[2,Promise.resolve()]);case 1:return a||!/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(t)?[3,2]:(s=kt(t),[3,7]);case 2:return"url"===a||!a&&De(t)?(f=function(e){var t="function"==typeof u?u(e):e;return H(t)?t:Promise.resolve(t)},[4,function(e){var t="function"==typeof c?c(e):e;return H(t)?t:Promise.resolve(t)}({responseType:"blob"})]):[3,6];case 3:return l=y.sent(),[4,Nt(t,l)];case 4:return d=y.sent(),[4,f(d.target.response)];case 5:return h=y.sent(),p=o||t.split("?")[0].split("#")[0].split("/").pop(),[2,e(h,{fileName:p,type:i||(D(h)?h.type:we)})];case 6:s=new Blob([t],{type:i||"text/plain"}),y.label=7;case 7:return[3,9];case 8:t instanceof Blob&&(s=t),y.label=9;case 9:return s||(s=new Blob([t],{type:i})),navigator.msSaveBlob?navigator.msSaveBlob(s,o||"download"):(Pt(v=Ce(s),o),Oe(v)),[2,Promise.resolve()]}}))}))},e.fileReader=xt,e.filterTree=function e(t,r,n,o){void 0===n&&(n="children"),void 0===o&&(o="spread");var i=[];return k(t)?(t.forEach((function(t){var a=t;if(C(t)&&(a="spread"===o?qe({},t):t),r(a)){if(C(a)){var c=a[n];k(c)&&c.length>0&&(a[n]=e(c,r,n,o))}i.push(a)}})),i):i},e.findTreeNode=function(e,t,r){var n,o;void 0===r&&(r="children");var i,a=[];if(!k(e))return i;try{for(var c=Qe(e),u=c.next();!u.done;u=c.next()){var s=u.value;for(a.push(s);a.length;){var f=a.pop();if(t(f)){i=f;break}if(C(f)){var l=f[r];k(l)&&l.length>0&&l.forEach((function(e){a.push(e)}))}}if(i)break}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return i},e.findTreeNodes=function(e,t,r){var n,o;void 0===r&&(r="children");var i=[],a=[];if(!k(e))return a;try{for(var c=Qe(e),u=c.next();!u.done;u=c.next()){var s=u.value;for(i.push(s);i.length;){var f=i.pop();if(t(f)&&a.push(f),C(f)){var l=f[r];k(l)&&l.length>0&&l.forEach((function(e){i.push(e)}))}}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return a},e.findTreeSelect=function(e,t,r){return void 0===r&&(r="children"),Dt(e,t,r)},e.formatBankCard=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=t.char,n=void 0===r?" ":r,o=t.length,i=void 0===o?4:o,a="spaceMark"in t?t.spaceMark:n,c=new RegExp("(.{".concat(i,"})"),"g"),u=new RegExp("".concat(a),"g"),s=B(e).replace(u,""),f=s.replace(c,"$1".concat(a));return s.length%i==0?f.substring(0,f.length-1):f},e.formatMobile=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=t.char,n=void 0===r?" ":r,o="spaceMark"in t?t.spaceMark:n,i=new RegExp(o,"g"),a=B(e).replace(i,"").substring(0,11);return a.length>7?a.replace(/^(...)(....)/g,"$1".concat(o,"$2").concat(o)):a.length>3?a.replace(/^(...)/g,"$1".concat(o)):a},e.formatMoney=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=t.precision,n=void 0===r?2:r,o=t.symbol,i=t.thousand,a=void 0===i?",":i,c=t.decimal,u=void 0===c?".":c;if(!function(e){return He(e)?("number"==typeof e&&ct(e),!0):(fe("".concat(e," invalid parameter.")),!1)}(e))return"";if("number"==typeof e&&!isFinite(e))return e+"";"number"!=typeof n||Z(n)||n<0?n=2:n>10&&(n=10),o="string"==typeof o?o:"",a="string"==typeof a?a:",",u="string"==typeof u?u:".";var s=Ye((nt(e)+"").split("."),2),f=s[0],l=s[1];return o+function(e,t){var r,n,o="";e="+"===(e=(n=/^([+-])?(0+)([0-9.]+)$/.exec(r=e))?(n[1]||"")+("."===n[3][0]?"0"+n[3]:n[3]):r)[0]?e.substring(1):e;for(var i=Number(e)<0?"-":"",a=i?e.substring(1).split("").reverse():e.split("").reverse(),c=0;c<a.length;c++)o+=a[c]+((c+1)%3==0&&c+1!==a.length?t:"");return i+o.split("").reverse().join("")}(f,a)+function(e,t,r){if(0===t)return"";var n="";return n=e&&Number(e)>0?parseFloat("0."+e).toFixed(t).substring(2):(0).toFixed(t).substring(2),r+n}(l,n,u)},e.gcd=Et,e.getFileBlob=jt,e.getImageInfo=function(e,t,r){void 0===t&&(t=!0);var n={useCache:"object"==typeof t?!1!==t.useCache:!1!==t,autoRevokeOnDel:"object"==typeof t?!1!==t.autoRevokeOnDel:!!t};return new Promise((function(t,o){n.useCache&&_t.has(e)?t(_t.get(e).data):Ft(e,!1,r).then((function(r){var o,i,a,c=r.image,u=r.blob,s=c.width,f=c.height,l={width:s,height:f,contrast:(o=s,i=f,a=Et(o,i),"".concat(Ot(q(o),a),":").concat(Ot(q(i),a))),measure:"".concat(s," × ").concat(f," px"),size:gt(u.size),bytes:u.size,image:c,blob:u};n.useCache&&_t.set(e,{data:l,r:n.autoRevokeOnDel}),t(l)})).catch(o)}))},e.isBankCard=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.luhn,i=void 0!==o&&o,a=B(e),c=n?ae.test(a):ie.test(a);if(c&&i){var u=a.substring(0,a.length-1);return a[a.length-1]===String(function(e){for(var t=(e+"").replace(/\D/g,"").split("").reverse(),r=0,n=0;n<t.length;n++){var o=parseInt(t[n]);r+=n%2==0?2*o-(o>4?9:0):o}var i=r%10;return 0!==i?10-i:0}(u))}return c},e.isBusinessLicense=function(e,t){void 0===t&&(t={});var r=B(e),n=t.loose,o=void 0!==n&&n,i=t.checkCode,a=!o&&(void 0===i||i),c=Ue.test(r);if(!a||!c)return c;var u=r.substring(0,14),s=r.substring(r.length-1),f=function(e){for(var t=10,r=0;r<14;r++){var n=(t+Number(e[r]))%10;t=2*(n=0===n?10:n)%11}return 1===t?0:11-t}(u);return s===String(f)},e.isChinese=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.useExtend,i=void 0!==o&&o,a=B(e),c=i&&Se;return new RegExp(c?n?Re:Te:n?Ne:Ae,c?"u":we).test(a)},e.isEmail=function(e){var t=B(e);return te.test(t)},e.isHMCard=function(e){var t=B(e);return ze.test(t)},e.isIPv4=function(e){var t=B(e);return Fe.test(t)},e.isIPv6=function(e){var t=B(e);return Pe.test(t)},e.isIdCard=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.checkCode,i=void 0===o||o,a=B(e);return 15===a.length&&n?ee.test(a):!(18!==a.length||!ee.test(a))&&(!i||function(e){var t,r;for(r=t=0;t<17;t++)r+=Math.pow(2,17-t)%11*Number(e[t]);var n=(12-r%11)%11;return n<10?n===Number(e[17]):"X"===e[17].toUpperCase()}(a))},e.isMobile=function(e){var t=B(e);return J.test(t)},e.isPassport=function(e){var t=B(e);return ge.test(t)},e.isPassword=function(e,t){void 0===t&&(t={});var r=t.level,n=void 0===r?2:r,o=t.ignoreCase,i=void 0!==o&&o,a=t.special;return ye(e,{level:n,ignoreCase:i,special:void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a}).validated},e.isPostcode=function(e){var t=B(e);return Y.test(t)},e.isPromiseLike=function(e){return H(e)},e.isQQ=function(e){var t=B(e);return re.test(t)},e.isSocialCreditCode=function(e,t){void 0===t&&(t={});var r=B(e),n=t.loose,o=void 0!==n&&n,i=t.checkCode,a=!o&&(void 0===i||i),c=ce.test(r);if(!a||!c)return c;var u=r.substring(0,17),s=r.substring(r.length-1),f=function(e){for(var t=0,r=function(r){var n=ue.findIndex((function(t){return t===e[r]})),o=Math.pow(3,r)%31;t+=n*o},n=0;n<17;n++)r(n);var o=t%31;return ue[0!==o?31-o:0]}(u);return s===f},e.isSwiftCode=function(e){var t=B(e);return Ze.test(t)},e.isTWCard=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=B(e);return!!Ve.test(o)||!!n&&We.test(o)},e.isTelephone=function(e){var t=B(e);return Q.test(t)},e.isUrl=De,e.isValidNumber=He,e.isVehicle=function(e){var t=B(e);return oe.test(t)},e.isWX=function(e){var t=B(e);return ne.test(t)},e.lcm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.map((function(e){return Math.abs(q(e))}));return 1===r.length&&(r=r.concat([1])),Ot(r.indexOf(0)>-1?0:Ct.apply(void 0,et([],Ye(r),!1)),Et.apply(void 0,et([],Ye(r),!1)))},e.listToTree=function(e,t){void 0===t&&(t={});var r=t.keyField,n=void 0===r?"id":r,o=t.parentField,i=void 0===o?"pid":o,a=t.childrenField,c=void 0===a?"children":a,u=t.emptyChildrenValue,s=void 0===u?"none":u,f=t.nodeAssign,l=void 0===f?"spread":f,d=[],h={};return k(e)?(e.forEach((function(e){if(C(e)){var t="spread"===l?qe({},e):e,r=t[n],o=t[i];h[r]?t[c]=h[r]:t[c]=h[r]=[],o?h[o]?h[o].push(t):h[o]=[t]:d.push(t)}})),"array"!==s&&$t(d,t),d):d},e.loadImage=function(e,t){void 0===t&&(t=!0);var r={useCache:"object"==typeof t?!1!==t.useCache:!1!==t,autoRevokeOnDel:"object"==typeof t?!1!==t.autoRevokeOnDel:!!t};return new Promise((function(t,n){if(r.useCache&&It.has(e))t(It.get(e).data);else{var o=D(e),i=o?Ce(e):e,a=new Image;o||(a.crossOrigin="anonymous"),a.onload=function(){r.useCache&&It.set(e,{data:a,r:r.autoRevokeOnDel}),t(a)},a.onerror=function(t){o&&Oe(i),console.error("[loadImage] The image load failed, '".concat(e,"'.")),n(t)},a.src=i}}))},e.loadImageWithBlob=Ft,e.loadScript=function(e,t){return new Promise((function(r,n){var o=document.head,i=document.createElement("script"),a=t||{},c=a.attrs,u=a.destroyOnError,s=void 0===u||u,f=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(a,["attrs","destroyOnError"]),l=qe(qe({async:!0,type:"text/javascript"},f),{src:e});for(var d in l)"onload"!==d&&"onerror"!==d&&(i[d]=l[d]);"object"==typeof c&&xe(c).forEach((function(e){i.setAttribute(e,c[e])})),i.onload=function(e){var t;this.onerror=this.onload=null,null===(t=l.onload)||void 0===t||t.call(this,e),r(i)},i.onerror=function(e){var t;this.onerror=this.onload=null,null===(t=l.onerror)||void 0===t||t.call(this,e),s&&o.removeChild(i),n(new URIError("Failed to load "+this.src))},o.appendChild(i)}))},e.minus=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=void 0===t[1]?0:t[1],i=t.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=nt(n),o=nt(o),Z(n)||Z(o))return Number.NaN;var a=Math.pow(10,Math.max(it(n),it(o)));return(Ct(n,a)-Ct(o,a))/a},e.normalizeString=function(e){return B(e)},e.numberToChinese=function(e,t){void 0===t&&(t={});var r=t.big5,n=void 0!==r&&r,o=t.unit,i=void 0===o||o,a=t.zero,c=void 0===a?"":a,u=t.negative,s=void 0===u?"负":u,f=t.unitConfig,l=void 0===f?{}:f,d=t.decimal,h=void 0===d?"":d;if("number"!=typeof e||Z(e))return fe("参数错误 ".concat(e,",请传入数字")),"";ct(e),n?(ut=ht.slice(),st=pt.slice(),h=h||"點"):(ut=lt.slice(),st=dt.slice(),h=h||"点");var p=(null==l?void 0:l.w)||"万",v=(null==l?void 0:l.y)||"亿";ft=["",p,v,p+v],c&&(ut[0]=c);var y,g=e<0?s:"",m=Math.abs(e);y=i?function(e){var t=Math.floor(e),r=0,n="",o="",i=!1;if(0===t)return ut[0];for(;t>0;){var a=t%1e4;i&&(o=ut[0]+o),n=vt(a),o=(n+=0!==a?ft[r]:ft[0])+o,i=a<1e3&&a>0,t=Math.floor(t/1e4),r++}return o}(m):yt(Math.floor(m));var b=function(e){var t=e+"",r=t.indexOf("."),n="";return r>-1&&(n=yt(t.slice(r+1))),n}(m);return b?"".concat(g).concat(y).concat(h).concat(b):"".concat(g).concat(y)},e.padZero=function(e,t){void 0===t&&(t=2);var r=B(e),n=r.length;return("number"!=typeof t||t<0)&&(t=0),n<t?"0".repeat(t-n)+r:r},e.parseIdCard=function(e){var t=mt.exec(e);if(!t)return null;var r=t.groups||{province:t[1],city:t[2],area:t[3],year:t[4],month:t[5],day:t[6],gender:t[7]},n=bt.find((function(e){return e[0]===r.province}));if(!n)return null;var o="".concat(r.year,"-").concat(r.month,"-").concat(r.day),i=Number(r.gender)%2==0?"女":"男";return{province:n[1],birthday:o,gender:i,origin:r}},e.plus=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=void 0===t[1]?0:t[1],i=t.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=nt(n),o=nt(o),Z(n)||Z(o))return Number.NaN;var a=Math.pow(10,Math.max(it(n),it(o)));return(Ct(n,a)+Ct(o,a))/a},e.randomString=function(e,t){void 0===e&&(e=0);var r="string"==typeof t&&t?t:Lt;return Bt(R(e),r)},e.replaceChar=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=t.char,n=void 0===r?"*":r,o=t.exclude,i=t.start,a=void 0===i?3:i,c=t.end,u=void 0===c?-4:c,s=t.repeat,f=B(e),l=f.length;if(Math.abs(a)>=l)return f;if((a=a>=0?a:l+a)>=(u=u>=0?u:l+u))return f;var d=f.substring(a,u);if(o){var h=new RegExp("[^".concat(o,"]"),"g");d=d.replace(h,n)}else s="number"==typeof s&&s>=0?s:d.length,d=n.repeat(s);return f.substring(0,a)+d+f.substring(u)},e.round=function(e,t){return void 0===t&&(t=0),q(e,t)},e.safeDate=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n="string"==typeof e?e.replace(/[\\.-]/g,"/"):e;return t&&t.length>0?new(Date.bind.apply(Date,et([void 0,n],Ye(t),!1))):void 0===n?new Date:new Date(n)},e.setDataURLPrefix=function(e,t,r){return void 0===t&&(t="image/png"),void 0===r&&(r=!0),"data:".concat(t).concat(r?";base64":"",",").concat(e)},e.setDisableWarning=function(e){se.disableWarning=!!e},e.strlen=function(e){for(var t=B(e),r=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o>=1&&o<=126||65376<=o&&o<=65439?r++:r+=2}return r},e.times=Ct,e.transformFieldNames=function(e,t,r,n){return void 0===n&&(n="spread"),k(e)?e.length<=0?[]:function e(o){return o.map((function(o){if(!C(o))return o;var i="spread"===n?qe({},o):o,a=[];r&&k(i[r])&&i[r].length>0&&(i[r]=e(i[r].slice()));var c=xe(t);return c.forEach((function(e){var r=t[e];r in i&&(i[e]=i[r],-1===c.indexOf(r)&&a.push(r))})),a.length>0&&a.forEach((function(e){delete i[e]})),i}))}(e.slice()):e},e.treeToList=function(e,t){var r=[];return k(e)?(function e(n){n.forEach((function(n){if(C(n)){var o=qe({},n);r.push(o),o[t]&&(k(o[t])&&o[t].length>0&&e(o[t]),delete o[t])}else r.push(n)}))}(e),r):r},e.validatePassword=ye,e.version="4.22.2",e.waitTime=function(e){return void 0===e&&(e=1e3),void 0===(t=e)&&(t=1e3),new Promise((function(e){setTimeout(e,t)}));var t}}));
|
|
2
2
|
//# sourceMappingURL=util-helpers.min.js.map
|