mazey 4.0.6 → 4.1.0

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.
Files changed (50) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +990 -990
  3. package/coverage/clover.xml +1238 -0
  4. package/coverage/coverage-final.json +2 -0
  5. package/coverage/lcov-report/base.css +224 -0
  6. package/coverage/lcov-report/block-navigation.js +87 -0
  7. package/coverage/lcov-report/favicon.png +0 -0
  8. package/coverage/lcov-report/index.esm.js.html +12646 -0
  9. package/coverage/lcov-report/index.html +116 -0
  10. package/coverage/lcov-report/prettify.css +1 -0
  11. package/coverage/lcov-report/prettify.js +2 -0
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/sorter.js +196 -0
  14. package/coverage/lcov.info +2548 -0
  15. package/lib/browser.d.ts +90 -0
  16. package/lib/browser.d.ts.map +1 -0
  17. package/lib/calc.d.ts +106 -0
  18. package/lib/calc.d.ts.map +1 -0
  19. package/lib/debug.d.ts +40 -0
  20. package/lib/debug.d.ts.map +1 -0
  21. package/lib/dom.d.ts +164 -0
  22. package/lib/dom.d.ts.map +1 -0
  23. package/lib/event.d.ts +76 -0
  24. package/lib/event.d.ts.map +1 -0
  25. package/lib/global.d.ts +87 -0
  26. package/lib/index.cjs.js +2 -2
  27. package/lib/index.d.ts +10 -2040
  28. package/lib/index.d.ts.map +1 -1
  29. package/lib/index.esm.js +2 -2
  30. package/lib/load.d.ts +169 -0
  31. package/lib/load.d.ts.map +1 -0
  32. package/lib/mazey.min.js +2 -2
  33. package/lib/perf.d.ts +199 -0
  34. package/lib/perf.d.ts.map +1 -0
  35. package/lib/store.d.ts +216 -0
  36. package/lib/store.d.ts.map +1 -0
  37. package/lib/typing.d.ts +88 -74
  38. package/lib/url.d.ts +246 -0
  39. package/lib/url.d.ts.map +1 -0
  40. package/lib/util.d.ts +841 -0
  41. package/lib/util.d.ts.map +1 -0
  42. package/package.json +124 -122
  43. package/scripts/README.md +0 -38
  44. package/scripts/build-helper.js +0 -76
  45. package/scripts/dev.js +0 -23
  46. package/scripts/env-win.sh +0 -2
  47. package/scripts/git-helper.js +0 -155
  48. package/scripts/mac-build.sh +0 -8
  49. package/scripts/release.js +0 -9
  50. package/scripts/rollup.config.mjs +0 -152
package/lib/index.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Mazey v4.0.6 https://github.com/mazeyqian/mazey
2
+ * Mazey v4.1.0 https://github.com/mazeyqian/mazey
3
3
  * (c) 2018-2024 Cheng
4
4
  * Released under the MIT License.
5
5
  */
6
- "use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)};function t(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function n(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function r(e,t){for(var n=e.length,r=t.length,o=u(new Array(n).fill(new Array(r).fill(0))),i=0;i<n;++i)for(var a=0;a<r;++a)if(e[i]===t[a]){var s=0;i>0&&a>0&&(s=o[i-1][a-1]),o[i][a]=s+1}var c=Array.prototype.concat.apply([],o);return Math.max.apply(Math,c)}function o(e,t){for(var n=e.length,r=t.length,o=u(new Array(n).fill(new Array(r).fill(0))),i=0;i<n;++i)for(var a=0;a<r;++a)if(e[i]===t[a]){var s=0;i>0&&a>0&&(s=o[i-1][a-1]),o[i][a]=s+1}else{var c=[0,0],d=c[0],l=c[1];a>0&&(d=o[i][a-1]),i>0&&(l=o[i-1][a]),o[i][a]=Math.max(d,l)}var f=Array.prototype.concat.apply([],o);return Math.max.apply(Math,f)}function i(e){var t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function a(e){var t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function s(e){return a(e)}function u(t){if("object"!=typeof t)return t;var n=["string","number","boolean","undefined"];return Object.values(t).every((function(e){return n.includes(typeof e)}))?e({},t):JSON.parse(JSON.stringify(t))}function c(e){try{if("object"==typeof JSON.parse(e))return!0}catch(e){}return!1}function d(e){void 0===e&&(e=5);for(var t="";e--;)t+=Math.floor(10*Math.random());return t}function l(e){return void 0===e&&(e=5),d(e)}function f(e){void 0===e&&(e=3);var t=[h(),l(e||3)];return t[0]+t[1]}"function"==typeof SuppressedError&&SuppressedError;var p={type:"d"};function g(e,t){void 0===t&&(t={});var n=t.isNaNAsNumber,r=void 0!==n&&n,o=t.isInfinityAsNumber,i=void 0!==o&&o,a=t.isUnFiniteAsNumber;return"number"==typeof e&&(!(!0!==i&&!0!==(void 0!==a&&a)&&!isFinite(e))&&!(!r&&isNaN(e)))}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=null;return e&&"function"==typeof e&&(r=e.apply(void 0,t)),r}function m(e,t){void 0===t&&(t={id:"",callback:function(){},timeout:5e3,isDefer:!1});var n,r,o=Object.assign({id:"",callback:function(){},timeout:5e3,isDefer:!1},t),i=o.id,a=o.callback,s=o.timeout,u=o.isDefer,c=document.createElement("script");c||Promise.reject("Not support create script element");var d=document.getElementsByTagName("script")[0];return c.type="text/javascript",u&&(c.defer=!0),i&&(c.id=i),c.readyState?c.onreadystatechange=function(){"loaded"!==c.readyState&&"complete"!==c.readyState||(c.onreadystatechange=null,v(a),v(n,"loaded"))}:c.onload=function(){v(a),v(n,"loaded")},c.src=e,d&&d.parentNode.insertBefore(c,d),new Promise((function(e,t){var o;n=(o=[e,t])[0],r=o[1],s&&setTimeout(r.bind(null,"timeout"),s)}))}function h(){return Date.now?Date.now():(new Date).getTime()}function w(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}function y(e){var t=[],n=window.PerformanceObserver;return!!n&&(A(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}function x(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return y("paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-contentful-paint"===e.name}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function b(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return y("paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-paint"===e.name}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function S(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;var t={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:""};try{var n=navigator.userAgent.toLowerCase();if(!n)return t;var r=function(e){return e.test(n)},o=function(e){var t="",r=n.match(e);return r&&A(r)&&(t=(t=(t=r.toString()).replace(/[^0-9|_.]/g,"")).replace(/_/g,".")),t},i="",a="";r(/windows|win32|win64|wow32|wow64/g)?i="windows":r(/macintosh|macintel/g)?i="macos":r(/x11/g)?i="linux":r(/android|adr/g)?i="android":r(/ios|iphone|ipad|ipod|iwatch/g)&&(i="ios",r(/ipad/g)?a="ipad":r(/iphone/g)?a="iphone":r(/iwatch/g)?a="iwatch":r(/ipod/g)&&(a="ipod")),t=e(e({},t),{system:i,appleType:a});var s="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?s="2000":r(/windows nt 5.1|windows xp/g)?s="xp":r(/windows nt 5.2|windows 2003/g)?s="2003":r(/windows nt 6.0|windows vista/g)?s="vista":r(/windows nt 6.1|windows 7/g)?s="7":r(/windows nt 6.2|windows 8/g)?s="8":r(/windows nt 6.3|windows 8.1/g)?s="8.1":r(/windows nt 10.0|windows 10/g)&&(s="10"):"macos"===i?s=o(/os x [\d._]+/g):"android"===i?s=o(/android [\d._]+/g):"ios"===i&&(s=o(/os [\d._]+/g)),t=e(e({},t),{systemVs:s});var u="";"windows"===i||"macos"===i||"linux"===i?u="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(u="mobile"),t=e(e({},t),{platform:u});var c="",d="";r(/applewebkit/g)?(c="webkit",r(/edge/g)?d="edge":r(/opr/g)?d="opera":r(/chrome/g)?d="chrome":r(/safari/g)&&(d="safari")):r(/gecko/g)&&r(/firefox/g)?(c="gecko",d="firefox"):r(/presto/g)?(c="presto",d="opera"):r(/trident|compatible|msie/g)&&(c="trident",d="iexplore"),t=e(e({},t),{engine:c,supporter:d});var l="";"webkit"===c?l=o(/applewebkit\/[\d._]+/g):"gecko"===c?l=o(/gecko\/[\d._]+/g):"presto"===c?l=o(/presto\/[\d._]+/g):"trident"===c&&(l=o(/trident\/[\d._]+/g)),t=e(e({},t),{engineVs:l});var f="";"chrome"===d?f=o(/chrome\/[\d._]+/g):"safari"===d?f=o(/version\/[\d._]+/g):"firefox"===d?f=o(/firefox\/[\d._]+/g):"opera"===d?f=o(/opr\/[\d._]+/g):"iexplore"===d?f=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===d&&(f=o(/edge\/[\d._]+/g)),t=e(e({},t),{supporterVs:f});var p="",g="";return r(/micromessenger/g)?(p="wechat",g=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",g=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",g=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",g=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",g=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),t=e(e({},t),{shell:p,shellVs:g}),window.MAZEY_BROWSER_INFO=t,t}catch(e){return console.warn("MazeyCon:",e),t}}function E(e,t,n){if(void 0===n&&(n=!1),""!=e&&e){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",s=e.replace(i,"**").length,u=0;u<s&&(null!=(a=e.charAt(u).toString()).match(i)?r+=2:r++,!(r>t));u++)o+=a;return n&&s>t&&(o+="..."),o}return""}function A(e){var t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function T(){var e=window.MAZEY_DEFINE_LISTENERS;return"object"!=typeof e&&(e={},window.MAZEY_DEFINE_LISTENERS=e),e}function C(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,new Promise((function(t){setTimeout((function(){t(e)}),e)}))]}))}))}exports.addClass=function(e,t){var n,r=e.className,o="";""!==r&&(o=" "),n=r+o+t,e.className=n},exports.addEvent=function(e,t){var n=T();void 0===n[e]&&(n[e]=[]),"function"==typeof t&&n[e].push(t)},exports.addStyle=function(e,t){if(void 0===t&&(t={id:""}),!e)return!1;var n=document.createDocumentFragment(),r=null,o="",i=document.createElement("style");return t.id?(o="".concat(t.id),(r=document.getElementById(o))?r.innerHTML=e:(i.setAttribute("id",t.id),i.innerHTML=e,n.appendChild(i),document.head.appendChild(n))):(i.innerHTML=e,n.appendChild(i),document.head.appendChild(n)),!0},exports.calLongestCommonSubsequence=function(e,t){return o(e,t)},exports.calLongestCommonSubstring=function(e,t){return r(e,t)},exports.camelCase2Underscore=s,exports.camelCaseToKebabCase=function(e){return i(e)},exports.cancelBubble=function(e){var t=e||window.event;t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},exports.clearHtml=function(e,t){void 0===t&&(t={});var n=t.removeNewLine,r=void 0!==n&&n,o="";return e&&(o=e.replace(/<\/?.+?>/g,""),r&&(o=o.replace(/[\r\n]/g,""))),o},exports.convert10To26=function(e){for(var t="";e>0;){var n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t},exports.convertCamelToKebab=i,exports.convertCamelToUnder=a,exports.cutCHSString=function(e,t,n){return void 0===n&&(n=!1),E(e,t,n)},exports.debounce=function(e,t,n){var r=null,o=null,i=null,a=null,s=null,u=function u(){var c=h()-i;c<t&&c>=0?o=setTimeout(u,t-c):(o=null,n||(s=e.apply(r,a),o||(r=a=null)))};return function(){for(var c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];r=this,a=c,i=h();var l=n&&!o;return o||(o=setTimeout(u,t)),l&&(s=e.apply(r,a),r=a=null),s}},exports.deepCopy=u,exports.deepCopyObject=function(e){return u(e)},exports.delCookie=function(e){for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].trim();if(r.startsWith("".concat(e,"="))){var o=r.split("=")[0],i=new Date;return i.setTime(i.getTime()-1),document.cookie="".concat(o,"=;expires=").concat(i.toUTCString()),!0}}return!1},exports.doFn=v,exports.floatFixed=function(e,t){return void 0===t&&(t=0),parseFloat(e).toFixed(t)},exports.floatToPercent=function(e,t){void 0===t&&(t=0);var n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),"".concat(n,"%")},exports.formatDate=function(e,t){void 0===t&&(t="yyyy-MM-dd"),e||(e=new Date);var n=new Date(e),r={yyyy:n.getFullYear(),MM:n.getMonth()+1,dd:n.getDate()<10?"0"+n.getDate():n.getDate(),hh:n.getHours()<10?"0"+n.getHours():n.getHours(),mm:n.getMinutes()<10?"0"+n.getMinutes():n.getMinutes(),ss:n.getSeconds()<10?"0"+n.getSeconds():n.getSeconds()},o=t||"yyyy-MM-dd";return Object.keys(r).forEach((function(e){var t=r[e];"MM"===e&&Number(t)<=9&&(t="0".concat(t)),o=o.replace(e,String(t))})),o},exports.genCustomConsole=function(e,t){void 0===e&&(e=""),void 0===t&&(t={isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}});var n=Object.assign({isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}},t),r=n.isClosed,o=n.showWrap,i=n.showDate,a=n.locales,s=n.logFn,u=n.errorFn,c=Object.create(null),d=function(){return(new Date).toLocaleDateString(a,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})};return["log","info","warn","error"].forEach((function(t){c[t]=function(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(r)return!1;var c=e,l=e;if("string"==typeof e&&e.length>=2){var f=e.length;c=":"===e[f-1]?e.substring(0,f-1):e}o&&console.log("--- ".concat(c," - begin ---")),i&&(l=e?"".concat(d()," ").concat(e):"".concat(d())),e||i?console[t].apply(console,function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([l],n,!1)):console[t].apply(console,n),"log"===t&&s(),"error"===t&&u(),o&&console.log("--- ".concat(c," - end ---"))}})),c},exports.genHashCode=function(e){var t,n=0;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n},exports.genRndNumString=d,exports.genStyleString=function(e,t){var n="";return t&&t.length>0&&(n=t.join(";")+";"),"".concat(e,"{").concat(n,"}")},exports.genUniqueNumString=f,exports.generateRndNum=l,exports.generateUniqueNum=function(e){return void 0===e&&(e=3),f(e)},exports.getBrowserInfo=S,exports.getCLS=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return y("layout-shift")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().reduce((function(e,t){var n=0;return g(t.value)&&(n=t.value),e+n}),0);t.disconnect(),e(r)}));t.observe({type:"layout-shift",buffered:!0})}))]:[2,0]}))}))},exports.getCookie=w,exports.getCurrentVersion=function(){return"v3"},exports.getDefineListeners=T,exports.getDomain=function(e,t){void 0===t&&(t=["hostname"]);var n=document.createElement("a");return n.href=e,t.reduce((function(e,t){return e+=n[t]}),"")},exports.getFCP=x,exports.getFID=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return y("first-input")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-input"===e.entryType}));if(r){t.disconnect();var o=r.processingStart;e(o?Math.round(r.processingStart-r.startTime):0)}}));t.observe({type:"first-input",buffered:!0})}))]:[2,0]}))}))},exports.getFP=b,exports.getFileSize=function(e){var t=function(e){return String(Math.ceil(e))};if(!e)return"";var n=1024;return e<n?e+" B":e<Math.pow(n,2)?t(e/n)+" KB":e<Math.pow(n,3)?t(e/Math.pow(n,2))+" MB":e<Math.pow(n,4)?t(e/Math.pow(n,3))+" G":t(e/Math.pow(n,4))+" T"},exports.getFriendlyInterval=function(e,t,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=p);var r=(n=Object.assign(p,n)).type;g(e)||(e=new Date(e).getTime()),g(t)||(t=new Date(t).getTime());var o=Number(t)-Number(e),i="",a=new Array(4).fill(0),s=a[0],u=(a[1],a[2],a[3]),c=decodeURIComponent("%20%E5%A4%A9%20"),d=decodeURIComponent("%20%E6%97%B6%20"),l=decodeURIComponent("%20%E5%88%86%20"),f=decodeURIComponent("%20%E7%A7%92");if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),Math.floor(o/1e3/60/60),Math.floor(o/1e3/60),u=Math.floor(o/1e3),r){case"d":i=s;break;case"text":i=(s=Math.floor(o/1e3/60/60/24))+c+Math.floor(o/1e3/60/60%24)+d+Math.floor(o/1e3/60%60)+l+(u=Math.floor(o/1e3%60))+f;break;default:i=u}return i},exports.getHashQueryParam=function(e){var t=location.hash.split("?");if(1===t.length)return"";var n=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),r=t[1].match(n);return r?r[2]:""},exports.getLCP=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return y("largest-contentful-paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"largest-contentful-paint"===e.entryType}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"largest-contentful-paint",buffered:!0})}))]:[2,0]}))}))},exports.getLocalStorage=function(e){var t=null;if(e){var n=localStorage.getItem(e);n&&(t=JSON.parse(n))}return t},exports.getPerformance=function(e){return void 0===e&&(e=!1),t(this,void 0,void 0,(function(){function t(){var t={source:q,os:r(),osVersion:o(),deviceType:i(),network:a(),screenDirection:u(),unloadTime:h-w,redirectTime:S-E,dnsTime:T-C,tcpTime:M-O,sslTime:c(M,P),responseTime:N-_,downloadTime:k-N,firstPaintTime:V,firstContentfulPaintTime:W,domReadyTime:R-z,onloadTime:F-z,whiteTime:N-z,renderTime:B-z,decodedBodySize:j,encodedBodySize:D};Object.keys(t).forEach((function(e){g(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))})),g(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);var n={};e||Object.keys(t).forEach((function(e){n[s(e)]=t[e]})),Object.keys(n).length?l(n):l(t)}function r(){return navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Linux")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others"}function o(){var e="",t=navigator.userAgent,n=t.indexOf("Android")>-1||t.indexOf("Linux")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;var i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function i(){var e,t=navigator.userAgent.toLowerCase(),n=t.match(/(ipad)/i)&&"ipad",r=t.match(/iphone os/i)&&"iphone os",o=t.match(/midp/i)&&"midp",i=t.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",a=t.match(/ucweb/i)&&"ucweb",s=t.match(/android/i)&&"android",u=t.match(/windows ce/i)&&"windows ce",c=t.match(/windows mobile/i)&&"windows mobile";return(e=n||r||o||i||a||s||u||c?r||o||i||a||s||u||c?"phone":n?"ipad":void 0:"pc")||(e=""),e}function a(){var e="",t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function u(){var e="";return window.screen&&window.screen.orientation&&window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(e="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(e="-")),e}function c(e,t){var n=0;return t&&(n=e-t),n}var d,l,f,p,v,m,h,w,S,E,T,C,M,O,P,N,_,k,R,F,B,I,L,j,D,U,q,z,Z,V,W;return n(this,(function(e){switch(e.label){case 0:if(!y("navigation"))return[2,Promise.reject(new Error("navigation is not supported"))];if(!(d=window.performance)||"function"!=typeof d.getEntries||"function"!=typeof d.getEntriesByType)return[2,Promise.reject(new Error("performance is not supported"))];if(f=new Promise((function(e){l=[e][0]})),p=null,A(v=d.getEntriesByType("navigation"))&&(p=v[0]),m=new Array(19).fill(0),h=m[0],w=m[1],S=m[2],E=m[3],T=m[4],C=m[5],M=m[6],O=m[7],P=m[8],N=m[9],_=m[10],k=m[11],R=m[12],F=m[13],B=m[14],I=m[15],L=m[16],j=m[17],D=m[18],U=d.timing,q="",p)q="PerformanceNavigationTiming",j=p.decodedBodySize,D=p.encodedBodySize,h=p.unloadEventEnd,w=p.unloadEventStart,S=p.redirectEnd,E=p.redirectStart,T=p.domainLookupEnd,C=p.domainLookupStart,M=p.connectEnd,O=p.connectStart,P=p.secureConnectionStart,N=p.responseStart,_=p.requestStart,k=p.responseEnd,R=p.domContentLoadedEventStart,F=p.loadEventStart,B=p.loadEventEnd,I=p.startTime,L=p.fetchStart;else{if(!U)return[2,Promise.reject(new Error("NavigationTiming and Timing are not supported"))];q="PerformanceTiming",h=U.unloadEventEnd,w=U.unloadEventStart,S=U.redirectEnd,E=U.redirectStart,T=U.domainLookupEnd,C=U.domainLookupStart,M=U.connectEnd,O=U.connectStart,P=U.secureConnectionStart,N=U.responseStart,_=U.requestStart,k=U.responseEnd,R=U.domContentLoadedEventStart,F=U.loadEventStart,B=U.loadEventEnd,I=U.navigationStart,L=U.fetchStart}if(z=0,g(I))z=I;else{if(!g(L))return[2,Promise.reject(new Error("startTime, navigationStart or fetchStart are required"))];z=L}return[4,Promise.all([b(),x()])];case 1:return Z=e.sent(),V=Z[0],W=Z[1],g(B)&&B>0?t():window.addEventListener("load",(function(){window.setTimeout((function(){t()}),0)})),[2,f]}}))}))},exports.getQueryParam=function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=location.search.substring(1).match(t);return null!==n?decodeURIComponent(n[2]):""},exports.getScriptQueryParam=function(e,t){void 0===t&&(t=""),t||(t=".js");for(var n=new RegExp("[?&]".concat(e,"=([^&]*)")),r=document.querySelectorAll('script[src*="'.concat(t,'"]')),o=0;o<r.length;o++){var i=r[o].getAttribute("src");if(i&&-1!==i.indexOf(t)){var a=i.match(n);if(a)return decodeURIComponent(a[1])}}return""},exports.getSessionStorage=function(e){var t=null;if(e){var n=sessionStorage.getItem(e);n&&(t=JSON.parse(n))}return t},exports.getTTFB=function(){return t(this,void 0,void 0,(function(){var e,t;return n(this,(function(n){return y("navigation")&&window.performance&&window.performance.getEntriesByType?(e=performance.getEntriesByType("navigation")[0],0,e?(t=e.responseStart-e.requestStart,[2,Math.round(t)]):[2,0]):[2,0]}))}))},exports.getUrlFileType=function(e){var t="";if("string"!=typeof e||""==e)return t;var n=/\.[^/?#]+$/.exec(e);return n?(n[0].length>1&&(t=n[0].substring(1)),t):t},exports.getUrlParam=function(e,t,n){void 0===n&&(n={});var r=null;if(e.includes("#")){r=new URL(e).searchParams.getAll(t)}else{var o={};e.replace(/\??(\w+)=([^&]*)&?/g,(function(e,t,n){return void 0!==o[t]?o[t].push(n):o[t]=[n],""})),r=o[t]||[]}return n.returnArray?r:r.length?r[0]:null},exports.hasClass=function(e,t){for(var n=e.className.split(/\s+/),r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},exports.inRate=function(e){return Math.random()<e},exports.invokeEvent=function(e){var t=T()[e];if(t instanceof Array)for(var n=0,r=t.length;n<r;n++)"function"==typeof t[n]&&t[n]({type:e})},exports.isJSONString=c,exports.isJsonString=function(e){return c(e)},exports.isNonEmptyArray=A,exports.isNumber=g,exports.isSafePWAEnv=function(){var e=S();return!(!("serviceWorker"in navigator&&function(){var e;try{return e=new Function("return async function(){};")(),null!=Object.getPrototypeOf(e).constructor}catch(e){return!1}}()&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")&&Boolean(window.fetch)&&Boolean(window.indexedDB)&&Boolean(window.caches))||e.shell)},exports.isSupportWebp=function(){return new Promise((function(e){var t=new Image;t.onload=function(){e(t.width>0&&t.height>0)},t.onerror=function(){e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="}))},exports.isValidData=function(e,t,n){var r=!1;return"object"!=typeof e||t.reduce((function(e,t){return void 0===e[t]?Object.create(null):e=e[t]}),e)===n&&(r=!0),r},exports.isValidEmail=function(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},exports.isValidHttpUrl=function(e,t){void 0===t&&(t={strict:!0});var n=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/;return t.strict||(n=/^(https?:)?\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/),n.test(e)},exports.isValidPhoneNumber=function(e){return/^1\d{10}$/.test(e)},exports.isValidUrl=function(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)$/.test(e)},exports.loadCSS=function(e,t){void 0===t&&(t={id:""});var n,r=t.id,o=function(){},i=new Promise((function(e,t){var r;n=(r=[e,t])[0],o=r[1]})),a=function(){n("loaded")},s=document.createElement("link");s||o(new Error("Not support create link element"));var u="onload"in s,c=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(s.rel="stylesheet",s.type="text/css",s.href=e,void 0!==r&&(s.id=r),document.getElementsByTagName("head")[0].appendChild(s),c||!u)return setTimeout((function(){l(s,a,0)}),1),i;function d(){s&&(s.onload=s.onerror=s.onreadystatechange=null),s=null,a()}function l(e,t,n){if(e){var r,o=e.sheet;if((n+=1)>3e5)return r=!0,e&&(e=null),void t();if(c)o&&(r=!0);else if(o)try{o.cssRules&&(r=!0)}catch(e){var i=e;if(!i.name)return;"NS_ERROR_DOM_SECURITY_ERR"===i.name&&(r=!0)}setTimeout((function(){r?t():l(e,t,n)}),20)}}return u?(s.onload=d,s.onerror=function(){d()}):s.onreadystatechange=function(){s&&/loaded|complete/.test(s.readyState)&&d()},i},exports.loadImage=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))},exports.loadScript=m,exports.loadScriptIfUndefined=function(e,t){return window[e]?Promise.resolve("defined"):m(t)},exports.longestComSubsequence=o,exports.longestComSubstring=r,exports.mNow=h,exports.mTrim=function(e){for(var t=(e=e.replace(/^\s+/,"")).length-1,n=/\s/;n.test(e.charAt(t));)t--;return e.slice(0,t+1)},exports.newLine=function(e){if(!e)return"";var t=new RegExp("\\n","g");return e.replace(t,"<br />")},exports.removeClass=function(e,t){var n;n=(n=(n=(n=" "+e.className+" ").replace(/(\s+)/gi," ")).replace(" "+t+" "," ")).replace(/(^\s+)|(\s+$)/g,""),e.className=n},exports.removeEvent=function(e,t){var n=T(),r=n[e];if("string"==typeof e&&r instanceof Array)if("function"==typeof t){for(var o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]},exports.repeatUntilConditionMet=function(e,r,o){var i=this;void 0===r&&(r={}),void 0===o&&(o=function(e){return!0===e});var a=r.interval,s=void 0===a?1e3:a,u=r.times,c=void 0===u?10:u,d=r.context,l=r.args,f=0;"function"!=typeof e&&console.error("Expected a function."),("number"!=typeof s||s<0)&&console.error("Expected a non-negative number for interval."),("number"!=typeof c||c<0)&&console.error("Expected a non-negative number for times."),function r(){setTimeout((function(){return t(i,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,e.apply(d,l)];case 1:return t=n.sent(),o(t)||++f>=c?[2]:(r(),[2])}}))}))}),s)}()},exports.sanitizeInput=function(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,(function(e){return t[e]}))},exports.setCookie=function(e,t,n,r){var o,i;if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),i="; expires="+a.toUTCString()}else i="";var s=location.host;1===s.split(".").length?document.cookie=e+"="+t+i+"; path=/":((o=s.split(".")).shift(),r=r||"."+o.join("."),document.cookie=e+"="+t+i+"; path=/; domain="+r,null!==w(e)&&w(e)===t||(r=r||"."+s,document.cookie=e+"="+t+i+"; path=/; domain="+r))},exports.setImgWidHeiBySrc=function(){var e,t=window.jQuery||window.$;return t?!(!(e=t("img"))||!e.length)&&(e.each((function(){var e=t(this);if(e){var n=e.attr("src");if(n&&"string"==typeof n&&n.length){var r=n.match(/width=([0-9]+[a-z%]*)/),o=n.match(/height=([0-9]+[a-z%]*)/);r&&A(r)&&r[1]&&e.width(r[1]),o&&A(o)&&o[1]&&e.height(o[1])}}})),!0):(e=document.getElementsByTagName("img")).length>0&&(Array.from(e).forEach((function(e){var t=e;if(t){var n=t.getAttribute("src");if(n&&"string"==typeof n&&n.length){var r=n.match(/width=([0-9]+[a-z%]*)/),o=n.match(/height=([0-9]+[a-z%]*)/);r&&A(r)&&r[1]&&(t.style.width=r[1]),o&&A(o)&&o[1]&&(t.style.height=o[1])}}})),!0)},exports.setLocalStorage=function(e,t){void 0===t&&(t=null),e&&localStorage.setItem(e,JSON.stringify(t))},exports.setSessionStorage=function(e,t){void 0===t&&(t=null),e&&sessionStorage.setItem(e,JSON.stringify(t))},exports.sleep=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,C(e)]}))}))},exports.throttle=function(e,t,n){void 0===n&&(n={}),n=Object.assign({},n);var r=null,o=null,i=null,a=[null,0],s=a[0],u=a[1],c=function(){u=!1===n.leading?0:h(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(){for(var a=[],d=0;d<arguments.length;d++)a[d]=arguments[d];var l=h();u||!1!==n.leading||(u=l);var f=t-(l-u);return r=this,o=a,f<=0||f>t?(i&&(clearTimeout(i),i=null),u=l,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(c.bind(r),f)),s}},exports.truncateZHString=E,exports.unsanitize=function(e){var t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x2F;":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&amp;|&lt;|&gt;|&quot;|&#x27;|&#x2F;)/g,(function(e){return t[e]}))},exports.updateQueryParam=function(e,t,n){if(e.includes("#")){var r=new URL(e);return r.searchParams.set(t,n),r.toString()}var o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+n+"$2"):e+i+t+"="+n},exports.waitTime=C,exports.windowLoaded=function(e){void 0===e&&(e=90);var t,n=function(){},r=new Promise((function(e,r){n=e,t=r}));return"complete"===document.readyState?n("complete"):window.addEventListener("load",(function(){return n("load")})),setTimeout((function(){return t(Error("timeout"))}),1e3*e),r},exports.zAxiosIsValidRes=function(e,t){void 0===t&&(t={validStatusRange:[200,300],validCode:[0]});var n=Object.assign({validStatusRange:[200,300],validCode:[0]},t),r=n.validStatusRange,o=n.validCode;2!==r.length&&console.error("valid validStatusRange is required");var i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){var a=e.data;a&&o.includes(a.code)&&(i=!0)}return i};
6
+ "use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)};function t(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function n(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function r(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function o(t){if("object"!=typeof t)return t;var n=["string","number","boolean","undefined"];return Object.values(t).every((function(e){return n.includes(typeof e)}))?e({},t):JSON.parse(JSON.stringify(t))}function i(e){var t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function a(e){var t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function s(e){return a(e)}function u(e){try{if("object"==typeof JSON.parse(e))return!0}catch(e){}return!1}function c(e){void 0===e&&(e=5);for(var t="";e--;)t+=Math.floor(10*Math.random());return t}function d(e){return void 0===e&&(e=5),c(e)}function f(e){void 0===e&&(e=3);var t=[l(),d(e||3)];return t[0]+t[1]}function l(){return Date.now?Date.now():(new Date).getTime()}"function"==typeof SuppressedError&&SuppressedError;var p={type:"d"};function g(e,t){void 0===t&&(t={});var n=t.isNaNAsNumber,r=void 0!==n&&n,o=t.isInfinityAsNumber,i=void 0!==o&&o,a=t.isUnFiniteAsNumber;return"number"==typeof e&&(!(!0!==i&&!0!==(void 0!==a&&a)&&!isFinite(e))&&!(!r&&isNaN(e)))}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=null;return e&&"function"==typeof e&&(r=e.apply(void 0,t)),r}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return v.apply(void 0,r([e],t,!1))}function h(e){var t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function w(e){if(!e)return"";var t=new RegExp("\\n","g");return e.replace(t,"<br />")}function y(e,t){void 0===t&&(t={});var n=t.removeNewLine,r=void 0!==n&&n,o="";return e&&(o=e.replace(/<\/?.+?>/g,""),r&&(o=o.replace(/[\r\n]/g,""))),o}function x(e){var t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x2F;":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&amp;|&lt;|&gt;|&quot;|&#x27;|&#x2F;)/g,(function(e){return t[e]}))}function b(e,t,n){if(void 0===n&&(n={hasDot:!1,dotText:"..."}),n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",s=e.replace(i,"**").length,u=0;u<s&&(null!=(a=e.charAt(u).toString()).match(i)?r+=2:r++,!(r>t));u++)o+=a;return n.hasDot&&s>t&&(o+=n.dotText),o}return""}function S(e,t,n){return void 0===n&&(n=!1),b(e,t,{hasDot:n})}function E(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,new Promise((function(t){setTimeout((function(){t(e)}),e)}))]}))}))}function T(e,t){for(var n=e.length,r=t.length,i=o(new Array(n).fill(new Array(r).fill(0))),a=0;a<n;++a)for(var s=0;s<r;++s)if(e[a]===t[s]){var u=0;a>0&&s>0&&(u=i[a-1][s-1]),i[a][s]=u+1}var c=Array.prototype.concat.apply([],i);return Math.max.apply(Math,c)}function A(e,t){for(var n=e.length,r=t.length,i=o(new Array(n).fill(new Array(r).fill(0))),a=0;a<n;++a)for(var s=0;s<r;++s)if(e[a]===t[s]){var u=0;a>0&&s>0&&(u=i[a-1][s-1]),i[a][s]=u+1}else{var c=[0,0],d=c[0],f=c[1];s>0&&(d=i[a][s-1]),a>0&&(f=i[a-1][s]),i[a][s]=Math.max(d,f)}var l=Array.prototype.concat.apply([],i);return Math.max.apply(Math,l)}function C(e){return Math.random()<e}function M(e,t){for(var n=e.className,r=n.split(/\s+/),o=0;o<r.length;o++)if(r[o]===t)return;var i,a="";""!==n&&(a=" "),i=n+a+t,e.className=i}function O(){var e,t=window.jQuery||window.$;return t?!(!(e=t("img"))||!e.length)&&(e.each((function(){var e=t(this);if(e){var n=e.attr("src");if(n&&"string"==typeof n&&n.length){var r=n.match(/width=([0-9]+[a-z%]*)/),o=n.match(/height=([0-9]+[a-z%]*)/);r&&h(r)&&r[1]&&e.width(r[1]),o&&h(o)&&o[1]&&e.height(o[1])}}})),!0):(e=document.getElementsByTagName("img")).length>0&&(Array.from(e).forEach((function(e){var t=e;if(t){var n=t.getAttribute("src");if(n&&"string"==typeof n&&n.length){var r=n.match(/width=([0-9]+[a-z%]*)/),o=n.match(/height=([0-9]+[a-z%]*)/);r&&h(r)&&r[1]&&(t.style.width=r[1]),o&&h(o)&&o[1]&&(t.style.height=o[1])}}})),!0)}function P(){var e=window.MAZEY_DEFINE_LISTENERS;return"object"!=typeof e&&(e={},window.MAZEY_DEFINE_LISTENERS=e),e}function k(e){var t=P()[e];if(t instanceof Array)for(var n=0,r=t.length;n<r;n++)"function"==typeof t[n]&&t[n]({type:e})}function N(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}function _(e){for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].trim();if(r.startsWith("".concat(e,"="))){var o=r.split("=")[0],i=new Date;return i.setTime(i.getTime()-1),document.cookie="".concat(o,"=;expires=").concat(i.toUTCString()),!0}}return!1}function R(e,t){void 0===t&&(t={id:"",callback:function(){},timeout:5e3,isDefer:!1});var n,r,o=Object.assign({id:"",callback:function(){},timeout:5e3,isDefer:!1},t),i=o.id,a=o.callback,s=o.timeout,u=o.isDefer,c=document.createElement("script");c||Promise.reject("Not support create script element");var d=document.getElementsByTagName("script")[0];return c.type="text/javascript",u&&(c.defer=!0),i&&(c.id=i),c.readyState?c.onreadystatechange=function(){"loaded"!==c.readyState&&"complete"!==c.readyState||(c.onreadystatechange=null,m(a),m(n,"loaded"))}:c.onload=function(){m(a),m(n,"loaded")},c.src=e,d&&d.parentNode.insertBefore(c,d),new Promise((function(e,t){var o;n=(o=[e,t])[0],r=o[1],s&&setTimeout(r.bind(null,"timeout"),s)}))}function F(e){var t=[],n=window.PerformanceObserver;return!!n&&(h(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}function B(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return F("paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-contentful-paint"===e.name}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function D(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return F("paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-paint"===e.name}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function I(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;var t={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:""};try{var n=navigator.userAgent.toLowerCase();if(!n)return t;var r=function(e){return e.test(n)},o=function(e){var t="",r=n.match(e);return r&&h(r)&&(t=(t=(t=r.toString()).replace(/[^0-9|_.]/g,"")).replace(/_/g,".")),t},i="",a="";r(/windows|win32|win64|wow32|wow64/g)?i="windows":r(/macintosh|macintel/g)?i="macos":r(/x11/g)?i="linux":r(/android|adr/g)?i="android":r(/ios|iphone|ipad|ipod|iwatch/g)&&(i="ios",r(/ipad/g)?a="ipad":r(/iphone/g)?a="iphone":r(/iwatch/g)?a="iwatch":r(/ipod/g)&&(a="ipod")),t=e(e({},t),{system:i,appleType:a});var s="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?s="2000":r(/windows nt 5.1|windows xp/g)?s="xp":r(/windows nt 5.2|windows 2003/g)?s="2003":r(/windows nt 6.0|windows vista/g)?s="vista":r(/windows nt 6.1|windows 7/g)?s="7":r(/windows nt 6.2|windows 8/g)?s="8":r(/windows nt 6.3|windows 8.1/g)?s="8.1":r(/windows nt 10.0|windows 10/g)&&(s="10"):"macos"===i?s=o(/os x [\d._]+/g):"android"===i?s=o(/android [\d._]+/g):"ios"===i&&(s=o(/os [\d._]+/g)),t=e(e({},t),{systemVs:s});var u="";"windows"===i||"macos"===i||"linux"===i?u="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(u="mobile"),t=e(e({},t),{platform:u});var c="",d="";r(/applewebkit/g)?(c="webkit",r(/edge/g)?d="edge":r(/opr/g)?d="opera":r(/chrome/g)?d="chrome":r(/safari/g)&&(d="safari")):r(/gecko/g)&&r(/firefox/g)?(c="gecko",d="firefox"):r(/presto/g)?(c="presto",d="opera"):r(/trident|compatible|msie/g)&&(c="trident",d="iexplore"),t=e(e({},t),{engine:c,supporter:d});var f="";"webkit"===c?f=o(/applewebkit\/[\d._]+/g):"gecko"===c?f=o(/gecko\/[\d._]+/g):"presto"===c?f=o(/presto\/[\d._]+/g):"trident"===c&&(f=o(/trident\/[\d._]+/g)),t=e(e({},t),{engineVs:f});var l="";"chrome"===d?l=o(/chrome\/[\d._]+/g):"safari"===d?l=o(/version\/[\d._]+/g):"firefox"===d?l=o(/firefox\/[\d._]+/g):"opera"===d?l=o(/opr\/[\d._]+/g):"iexplore"===d?l=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===d&&(l=o(/edge\/[\d._]+/g)),t=e(e({},t),{supporterVs:l});var p="",g="";return r(/micromessenger/g)?(p="wechat",g=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",g=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",g=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",g=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",g=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),t=e(e({},t),{shell:p,shellVs:g}),window.MAZEY_BROWSER_INFO=t,t}catch(e){return console.warn("MazeyCon:",e),t}}exports.addClass=M,exports.addEvent=function(e,t){var n=P();void 0===n[e]&&(n[e]=[]),"function"==typeof t&&n[e].push(t)},exports.addStyle=function(e,t){if(void 0===t&&(t={id:""}),!e)return!1;var n=document.createDocumentFragment(),r=null,o="",i=document.createElement("style");return t.id?(o="".concat(t.id),(r=document.getElementById(o))?r.innerHTML=e:(i.setAttribute("id",t.id),i.innerHTML=e,n.appendChild(i),document.head.appendChild(n))):(i.innerHTML=e,n.appendChild(i),document.head.appendChild(n)),!0},exports.calLongestCommonSubsequence=function(e,t){return A(e,t)},exports.calLongestCommonSubstring=function(e,t){return T(e,t)},exports.camelCase2Underscore=s,exports.camelCaseToKebabCase=function(e){return i(e)},exports.cancelBubble=function(e){var t=e||window.event;t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},exports.clearHtml=function(e,t){return void 0===t&&(t={}),y(e,t)},exports.convert10To26=function(e){for(var t="";e>0;){var n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t},exports.convertCamelToKebab=i,exports.convertCamelToUnder=a,exports.convertKebabToCamel=function(e){var t=e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}));return t.endsWith("-")?t.slice(0,-1):t},exports.convertToHtmlBreaks=w,exports.cutCHSString=function(e,t,n){return void 0===n&&(n=!1),S(e,t,n)},exports.cutZHString=b,exports.debounce=function(e,t,n){var r=null,o=null,i=null,a=null,s=null,u=function u(){var c=l()-i;c<t&&c>=0?o=setTimeout(u,t-c):(o=null,n||(s=e.apply(r,a),o||(r=a=null)))};return function(){for(var c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];r=this,a=c,i=l();var f=n&&!o;return o||(o=setTimeout(u,t)),f&&(s=e.apply(r,a),r=a=null),s}},exports.deepCopy=o,exports.deepCopyObject=function(e){return o(e)},exports.delCookie=function(e){_(e)},exports.doFn=m,exports.fireEvent=k,exports.floatFixed=function(e,t){return void 0===t&&(t=0),parseFloat(e).toFixed(t)},exports.floatToPercent=function(e,t){void 0===t&&(t=0);var n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),"".concat(n,"%")},exports.formatDate=function(e,t){void 0===t&&(t="yyyy-MM-dd"),e||(e=new Date);var n=new Date(e),r={yyyy:n.getFullYear(),MM:n.getMonth()+1,dd:n.getDate()<10?"0"+n.getDate():n.getDate(),hh:n.getHours()<10?"0"+n.getHours():n.getHours(),mm:n.getMinutes()<10?"0"+n.getMinutes():n.getMinutes(),ss:n.getSeconds()<10?"0"+n.getSeconds():n.getSeconds()},o=t||"yyyy-MM-dd";return Object.keys(r).forEach((function(e){var t=r[e];"MM"===e&&Number(t)<=9&&(t="0".concat(t)),o=o.replace(e,String(t))})),o},exports.genCustomConsole=function(e,t){void 0===e&&(e=""),void 0===t&&(t={isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}});var n=Object.assign({isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}},t),o=n.isClosed,i=n.showWrap,a=n.showDate,s=n.locales,u=n.logFn,c=n.errorFn,d=Object.create(null),f=function(){return(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})};return["log","info","warn","error"].forEach((function(t){d[t]=function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];if(o)return!1;var d=e,l=e;if("string"==typeof e&&e.length>=2){var p=e.length;d=":"===e[p-1]?e.substring(0,p-1):e}i&&console.log("--- ".concat(d," - begin ---")),a&&(l=e?"".concat(f()," ").concat(e):"".concat(f())),e||a?console[t].apply(console,r([l],n,!1)):console[t].apply(console,n),"log"===t&&u(),"error"===t&&c(),i&&console.log("--- ".concat(d," - end ---"))}})),d},exports.genHashCode=function(e){var t,n=0;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n},exports.genRndNumString=c,exports.genStyleString=function(e,t){var n="";return t&&t.length>0&&(n=t.join(";")+";"),"".concat(e,"{").concat(n,"}")},exports.genUniqueNumString=f,exports.generateRndNum=d,exports.generateUniqueNum=function(e){return void 0===e&&(e=3),f(e)},exports.getBrowserInfo=I,exports.getCLS=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return F("layout-shift")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().reduce((function(e,t){var n=0;return g(t.value)&&(n=t.value),e+n}),0);t.disconnect(),e(r)}));t.observe({type:"layout-shift",buffered:!0})}))]:[2,0]}))}))},exports.getCookie=N,exports.getCurrentVersion=function(){return"v4"},exports.getDefineListeners=P,exports.getDomain=function(e,t){void 0===t&&(t=["hostname"]);var n=document.createElement("a");return n.href=e,t.reduce((function(e,t){return e+=n[t]}),"")},exports.getFCP=B,exports.getFID=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return F("first-input")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-input"===e.entryType}));if(r){t.disconnect();var o=r.processingStart;e(o?Math.round(r.processingStart-r.startTime):0)}}));t.observe({type:"first-input",buffered:!0})}))]:[2,0]}))}))},exports.getFP=D,exports.getFileSize=function(e){var t=function(e){return String(Math.ceil(e))};if(!e||e<0)return"";var n=1024;return e<n?e+" B":e<Math.pow(n,2)?t(e/n)+" KB":e<Math.pow(n,3)?t(e/Math.pow(n,2))+" MB":e<Math.pow(n,4)?t(e/Math.pow(n,3))+" G":t(e/Math.pow(n,4))+" T"},exports.getFriendlyInterval=function(e,t,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=p);var r=(n=Object.assign(p,n)).type;g(e)||(e=new Date(e).getTime()),g(t)||(t=new Date(t).getTime());var o=Number(t)-Number(e),i="",a=new Array(4).fill(0),s=a[0],u=(a[1],a[2],a[3]),c=decodeURIComponent("%20%E5%A4%A9%20"),d=decodeURIComponent("%20%E6%97%B6%20"),f=decodeURIComponent("%20%E5%88%86%20"),l=decodeURIComponent("%20%E7%A7%92");if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),Math.floor(o/1e3/60/60),Math.floor(o/1e3/60),u=Math.floor(o/1e3),r){case"d":i=s;break;case"text":i=(s=Math.floor(o/1e3/60/60/24))+c+Math.floor(o/1e3/60/60%24)+d+Math.floor(o/1e3/60%60)+f+(u=Math.floor(o/1e3%60))+l;break;default:i=u}return i},exports.getHashQueryParam=function(e){var t=location.hash.split("?");if(1===t.length)return"";var n=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),r=t[1].match(n);return r?r[2]:""},exports.getLCP=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return F("largest-contentful-paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"largest-contentful-paint"===e.entryType}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"largest-contentful-paint",buffered:!0})}))]:[2,0]}))}))},exports.getLocalStorage=function(e){var t=null;if(e){var n=localStorage.getItem(e);n&&(t=JSON.parse(n))}return t},exports.getPerformance=function(e){return void 0===e&&(e=!1),t(this,void 0,void 0,(function(){function t(){var t={source:z,os:r(),osVersion:o(),deviceType:i(),network:a(),screenDirection:u(),unloadTime:w-y,redirectTime:x-b,dnsTime:S-E,tcpTime:T-A,sslTime:c(T,C),responseTime:M-O,downloadTime:P-M,firstPaintTime:H,firstContentfulPaintTime:V,domReadyTime:k-q,onloadTime:N-q,whiteTime:M-q,renderTime:_-q,decodedBodySize:j,encodedBodySize:L};Object.keys(t).forEach((function(e){g(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))})),g(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);var n={};e||Object.keys(t).forEach((function(e){n[s(e)]=t[e]})),Object.keys(n).length?f(n):f(t)}function r(){return navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Linux")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others"}function o(){var e="",t=navigator.userAgent,n=t.indexOf("Android")>-1||t.indexOf("Linux")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;var i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function i(){var e,t=navigator.userAgent.toLowerCase(),n=t.match(/(ipad)/i)&&"ipad",r=t.match(/iphone os/i)&&"iphone os",o=t.match(/midp/i)&&"midp",i=t.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",a=t.match(/ucweb/i)&&"ucweb",s=t.match(/android/i)&&"android",u=t.match(/windows ce/i)&&"windows ce",c=t.match(/windows mobile/i)&&"windows mobile";return(e=n||r||o||i||a||s||u||c?r||o||i||a||s||u||c?"phone":n?"ipad":void 0:"pc")||(e=""),e}function a(){var e="",t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function u(){var e="";return window.screen&&window.screen.orientation&&window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(e="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(e="-")),e}function c(e,t){var n=0;return t&&(n=e-t),n}var d,f,l,p,v,m,w,y,x,b,S,E,T,A,C,M,O,P,k,N,_,R,I,j,L,U,z,q,Z,H,V;return n(this,(function(e){switch(e.label){case 0:if(!F("navigation"))return[2,Promise.reject(new Error("navigation is not supported"))];if(!(d=window.performance)||"function"!=typeof d.getEntries||"function"!=typeof d.getEntriesByType)return[2,Promise.reject(new Error("performance is not supported"))];if(l=new Promise((function(e){f=[e][0]})),p=null,h(v=d.getEntriesByType("navigation"))&&(p=v[0]),m=new Array(19).fill(0),w=m[0],y=m[1],x=m[2],b=m[3],S=m[4],E=m[5],T=m[6],A=m[7],C=m[8],M=m[9],O=m[10],P=m[11],k=m[12],N=m[13],_=m[14],R=m[15],I=m[16],j=m[17],L=m[18],U=d.timing,z="",p)z="PerformanceNavigationTiming",j=p.decodedBodySize,L=p.encodedBodySize,w=p.unloadEventEnd,y=p.unloadEventStart,x=p.redirectEnd,b=p.redirectStart,S=p.domainLookupEnd,E=p.domainLookupStart,T=p.connectEnd,A=p.connectStart,C=p.secureConnectionStart,M=p.responseStart,O=p.requestStart,P=p.responseEnd,k=p.domContentLoadedEventStart,N=p.loadEventStart,_=p.loadEventEnd,R=p.startTime,I=p.fetchStart;else{if(!U)return[2,Promise.reject(new Error("NavigationTiming and Timing are not supported"))];z="PerformanceTiming",w=U.unloadEventEnd,y=U.unloadEventStart,x=U.redirectEnd,b=U.redirectStart,S=U.domainLookupEnd,E=U.domainLookupStart,T=U.connectEnd,A=U.connectStart,C=U.secureConnectionStart,M=U.responseStart,O=U.requestStart,P=U.responseEnd,k=U.domContentLoadedEventStart,N=U.loadEventStart,_=U.loadEventEnd,R=U.navigationStart,I=U.fetchStart}if(q=0,g(R))q=R;else{if(!g(I))return[2,Promise.reject(new Error("startTime, navigationStart or fetchStart are required"))];q=I}return[4,Promise.all([D(),B()])];case 1:return Z=e.sent(),H=Z[0],V=Z[1],g(_)&&_>0?t():window.addEventListener("load",(function(){window.setTimeout((function(){t()}),0)})),[2,l]}}))}))},exports.getQueryParam=function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=location.search.substring(1).match(t);return null!==n?decodeURIComponent(n[2]):""},exports.getScriptQueryParam=function(e,t){void 0===t&&(t=""),t||(t=".js");for(var n=new RegExp("[?&]".concat(e,"=([^&]*)")),r=document.querySelectorAll('script[src*="'.concat(t,'"]')),o=0;o<r.length;o++){var i=r[o].getAttribute("src");if(i&&-1!==i.indexOf(t)){var a=i.match(n);if(a)return decodeURIComponent(a[1])}}return""},exports.getSessionStorage=function(e){var t=null;if(e){var n=sessionStorage.getItem(e);n&&(t=JSON.parse(n))}return t},exports.getTTFB=function(){return t(this,void 0,void 0,(function(){var e,t;return n(this,(function(n){return F("navigation")&&window.performance&&window.performance.getEntriesByType?(e=performance.getEntriesByType("navigation")[0],0,e?(t=e.responseStart-e.requestStart,[2,Math.round(t)]):[2,0]):[2,0]}))}))},exports.getUrlFileType=function(e){var t="";if("string"!=typeof e||""==e)return t;var n=/\.[^/?#]+$/.exec(e);return n?(n[0].length>1&&(t=n[0].substring(1)),t):t},exports.getUrlParam=function(e,t,n){void 0===n&&(n={});var r=null;if(e.includes("#")){r=new URL(e).searchParams.getAll(t)}else{var o={};e.replace(/\??(\w+)=([^&]*)&?/g,(function(e,t,n){return void 0!==o[t]?o[t].push(n):o[t]=[n],""})),r=o[t]||[]}return n.returnArray?r:r.length?r[0]:null},exports.hasClass=function(e,t){for(var n=e.className.split(/\s+/),r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},exports.inRate=function(e){return C(e)},exports.invokeEvent=function(e){k(e)},exports.invokeFn=v,exports.isHit=C,exports.isJSONString=u,exports.isJsonString=function(e){return u(e)},exports.isNonEmptyArray=h,exports.isNumber=g,exports.isSafePWAEnv=function(){var e=I();return!(!("serviceWorker"in navigator&&function(){var e;try{return e=new Function("return async function(){};")(),null!=Object.getPrototypeOf(e).constructor}catch(e){return!1}}()&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")&&Boolean(window.fetch)&&Boolean(window.indexedDB)&&Boolean(window.caches))||e.shell)},exports.isSupportWebp=function(){return new Promise((function(e){var t=new Image;t.onload=function(){e(t.width>0&&t.height>0)},t.onerror=function(){e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="}))},exports.isSupportedEntryType=F,exports.isValidData=function(e,t,n){var r=!1;return"object"!=typeof e||t.reduce((function(e,t){return void 0===e[t]?Object.create(null):e=e[t]}),e)===n&&(r=!0),r},exports.isValidEmail=function(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},exports.isValidHttpUrl=function(e,t){void 0===t&&(t={strict:!0});var n=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/;return t.strict||(n=/^(https?:)?\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/),n.test(e)},exports.isValidPhoneNumber=function(e){return/^1\d{10}$/.test(e)},exports.isValidUrl=function(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)$/.test(e)},exports.loadCSS=function(e,t){void 0===t&&(t={id:""});var n,r=t.id,o=function(){},i=new Promise((function(e,t){var r;n=(r=[e,t])[0],o=r[1]})),a=function(){n("loaded")},s=document.createElement("link");s||o(new Error("Not support create link element"));var u="onload"in s,c=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(s.rel="stylesheet",s.type="text/css",s.href=e,void 0!==r&&(s.id=r),document.getElementsByTagName("head")[0].appendChild(s),c||!u)return setTimeout((function(){f(s,a,0)}),1),i;function d(){s&&(s.onload=s.onerror=s.onreadystatechange=null),s=null,a()}function f(e,t,n){if(e){var r,o=e.sheet;if((n+=1)>3e5)return r=!0,e&&(e=null),void t();if(c)o&&(r=!0);else if(o)try{o.cssRules&&(r=!0)}catch(e){var i=e;if(!i.name)return;"NS_ERROR_DOM_SECURITY_ERR"===i.name&&(r=!0)}setTimeout((function(){r?t():f(e,t,n)}),20)}}return u?(s.onload=d,s.onerror=function(){d()}):s.onreadystatechange=function(){s&&/loaded|complete/.test(s.readyState)&&d()},i},exports.loadImage=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))},exports.loadScript=R,exports.loadScriptIfUndefined=function(e,t){return window[e]?Promise.resolve("defined"):R(t)},exports.longestComSubsequence=A,exports.longestComSubstring=T,exports.mNow=l,exports.mTrim=function(e){for(var t=(e=e.replace(/^\s+/,"")).length-1,n=/\s/;n.test(e.charAt(t));)t--;return e.slice(0,t+1)},exports.newLine=function(e){return w(e)},exports.removeClass=function(e,t){var n;n=(n=(n=(n=" "+e.className+" ").replace(/(\s+)/gi," ")).replace(" "+t+" "," ")).replace(/(^\s+)|(\s+$)/g,""),e.className=n},exports.removeCookie=_,exports.removeEvent=function(e,t){var n=P(),r=n[e];if("string"==typeof e&&r instanceof Array)if("function"==typeof t){for(var o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]},exports.removeHtml=y,exports.repeatUntilConditionMet=function(e,r,o){var i=this;void 0===r&&(r={}),void 0===o&&(o=function(e){return!0===e});var a=r.interval,s=void 0===a?1e3:a,u=r.times,c=void 0===u?10:u,d=r.context,f=r.args,l=0;"function"!=typeof e&&console.error("Expected a function."),("number"!=typeof s||s<0)&&console.error("Expected a non-negative number for interval."),("number"!=typeof c||c<0)&&console.error("Expected a non-negative number for times."),function r(){setTimeout((function(){return t(i,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,e.apply(d,f)];case 1:return t=n.sent(),o(t)||++l>=c?[2]:(r(),[2])}}))}))}),s)}()},exports.sanitizeInput=function(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,(function(e){return t[e]}))},exports.setClass=function(e,t){M(e,t)},exports.setCookie=function(e,t,n,r){var o,i;if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),i="; expires="+a.toUTCString()}else i="";var s=location.host;1===s.split(".").length?document.cookie=e+"="+t+i+"; path=/":((o=s.split(".")).shift(),r=r||"."+o.join("."),document.cookie=e+"="+t+i+"; path=/; domain="+r,null!==N(e)&&N(e)===t||(r=r||"."+s,document.cookie=e+"="+t+i+"; path=/; domain="+r))},exports.setImgSizeBySrc=O,exports.setImgWidHeiBySrc=function(){return O()},exports.setLocalStorage=function(e,t){void 0===t&&(t=null),e&&localStorage.setItem(e,JSON.stringify(t))},exports.setSessionStorage=function(e,t){void 0===t&&(t=null),e&&sessionStorage.setItem(e,JSON.stringify(t))},exports.sleep=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,E(e)]}))}))},exports.throttle=function(e,t,n){void 0===n&&(n={}),n=Object.assign({},n);var r=null,o=null,i=null,a=[null,0],s=a[0],u=a[1],c=function(){u=!1===n.leading?0:l(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(){for(var a=[],d=0;d<arguments.length;d++)a[d]=arguments[d];var f=l();u||!1!==n.leading||(u=f);var p=t-(f-u);return r=this,o=a,p<=0||p>t?(i&&(clearTimeout(i),i=null),u=f,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(c.bind(r),p)),s}},exports.truncateZHString=S,exports.unsanitize=function(e){return x(e)},exports.unsanitizeInput=x,exports.updateQueryParam=function(e,t,n){if(e.includes("#")){var r=new URL(e);return r.searchParams.set(t,n),r.toString()}var o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+n+"$2"):e+i+t+"="+n},exports.waitTime=E,exports.windowLoaded=function(e){void 0===e&&(e=90);var t,n=function(){},r=new Promise((function(e,r){n=e,t=r}));return"complete"===document.readyState?n("complete"):window.addEventListener("load",(function(){return n("load")})),setTimeout((function(){return t(Error("timeout"))}),1e3*e),r},exports.zAxiosIsValidRes=function(e,t){void 0===t&&(t={validStatusRange:[200,300],validCode:[0]});var n=Object.assign({validStatusRange:[200,300],validCode:[0]},t),r=n.validStatusRange,o=n.validCode;2!==r.length&&console.error("valid validStatusRange is required");var i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){var a=e.data;a&&o.includes(a.code)&&(i=!0)}return i};