mazey 4.10.0 → 4.10.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/.dockerignore +35 -0
- package/.gitattributes +5 -0
- package/AGENTS.md +111 -0
- package/Dockerfile +30 -0
- package/README.md +139 -60
- package/lib/index.cjs.js +2 -2
- package/lib/index.esm.js +2 -2
- package/lib/mazey.min.js +2 -2
- package/package.json +3 -2
- package/scripts/change-package-name.js +6 -4
- package/scripts/git-helper.js +13 -12
- package/scripts/release.js +1 -1
- package/scripts/rollup.config.mjs +5 -1
- package/lib/browser.d.ts +0 -124
- package/lib/browser.d.ts.map +0 -1
- package/lib/calc.d.ts +0 -117
- package/lib/calc.d.ts.map +0 -1
- package/lib/debug.d.ts +0 -74
- package/lib/debug.d.ts.map +0 -1
- package/lib/dom.d.ts +0 -232
- package/lib/dom.d.ts.map +0 -1
- package/lib/event.d.ts +0 -101
- package/lib/event.d.ts.map +0 -1
- package/lib/index.d.ts +0 -14
- package/lib/index.d.ts.map +0 -1
- package/lib/load.d.ts +0 -186
- package/lib/load.d.ts.map +0 -1
- package/lib/perf.d.ts +0 -213
- package/lib/perf.d.ts.map +0 -1
- package/lib/store.d.ts +0 -230
- package/lib/store.d.ts.map +0 -1
- package/lib/url.d.ts +0 -394
- package/lib/url.d.ts.map +0 -1
- package/lib/util.d.ts +0 -1174
- package/lib/util.d.ts.map +0 -1
package/lib/mazey.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Mazey v4.10.
|
|
2
|
+
* Mazey v4.10.2 https://github.com/chengchuu/mazey
|
|
3
3
|
* (c) 2018-2026 Cheng
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
var mazey=function(e){"use strict";var n=function(){return n=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},n.apply(this,arguments)};function t(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,c)}u((r=r.apply(e,n||[])).next())})}function r(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(e,i)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}function o(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}function i(e){if("object"!=typeof e)return e;var t=["string","number","boolean","undefined"];return Object.values(e).every(function(e){return t.includes(typeof e)})?n({},e):JSON.parse(JSON.stringify(e))}function a(e){var n=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===n[0]?n.substring(1):n}function c(e){var n=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===n[0]?n.substring(1):n}function u(e){return c(e)}function s(e){try{if("object"==typeof JSON.parse(e))return!0}catch(e){}return!1}function f(e){void 0===e&&(e=5);for(var n="";e--;)n+=Math.floor(10*Math.random());return n}function l(e){return void 0===e&&(e=5),f(e)}function d(e){void 0===e&&(e=3);var n=[p(),l(e||3)];return n[0]+n[1]}function p(){return Date.now?Date.now():(new Date).getTime()}"function"==typeof SuppressedError&&SuppressedError;var g={type:"d"};function v(e,n){void 0===n&&(n={});var t=n.isNaNAsNumber,r=void 0!==t&&t,o=n.isInfinityAsNumber,i=void 0!==o&&o,a=n.isUnFiniteAsNumber;return"number"==typeof e&&(!(!0!==i&&!0!==(void 0!==a&&a)&&!isFinite(e))&&!(!r&&isNaN(e)))}function m(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var r=null;return e&&"function"==typeof e&&(r=e.apply(void 0,n)),r}function h(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];return m.apply(void 0,o([e],n,!1))}function w(e){var n=!1;return Array.isArray(e)&&e.length&&(n=!0),n}function y(e){var n=Boolean(e),t="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return n&&t&&r}function b(e){return"boolean"==typeof e}function S(e){if(!e)return"";var n=new RegExp("\\n","g");return e.replace(n,"<br />")}function E(e,n){void 0===n&&(n={});var t=n.removeNewLine,r=void 0!==t&&t,o="";return e&&(o=e.replace(/<\/?.+?>/g,""),r&&(o=o.replace(/[\r\n]/g,""))),o}function T(e){var n={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,function(e){return n[e]})}function A(e,n,t){if(void 0===t&&(t={hasDot:!1,dotText:"..."}),t=Object.assign({hasDot:!1,dotText:"..."},t),""!=e&&e){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",c=e.replace(i,"**").length,u=0;u<c&&(null!=(a=e.charAt(u).toString()).match(i)?r+=2:r++,!(r>n));u++)o+=a;return t.hasDot&&c>n&&(o+=t.dotText),o}return""}function O(e,n,t){return void 0===t&&(t=!1),A(e,n,{hasDot:t})}function x(e){return t(this,void 0,void 0,function(){return r(this,function(n){return[2,new Promise(function(n){setTimeout(function(){n(e)},e)})]})})}var C="";function M(e,n){for(var t=e.length,r=n.length,o=i(new Array(t).fill(new Array(r).fill(0))),a=0;a<t;++a)for(var c=0;c<r;++c)if(e[a]===n[c]){var u=0;a>0&&c>0&&(u=o[a-1][c-1]),o[a][c]=u+1}var s=Array.prototype.concat.apply([],o);return Math.max.apply(Math,s)}function P(e,n){for(var t=e.length,r=n.length,o=i(new Array(t).fill(new Array(r).fill(0))),a=0;a<t;++a)for(var c=0;c<r;++c)if(e[a]===n[c]){var u=0;a>0&&c>0&&(u=o[a-1][c-1]),o[a][c]=u+1}else{var s=[0,0],f=s[0],l=s[1];c>0&&(f=o[a][c-1]),a>0&&(l=o[a-1][c]),o[a][c]=Math.max(f,l)}var d=Array.prototype.concat.apply([],o);return Math.max.apply(Math,d)}function k(e){return Math.random()<e}function N(e,n){void 0===n&&(n={strict:!0});var t=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/;return n.strict||(t=/^(https?:)?\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/),t.test(e)}function j(e){return e.replace(/^http:/,"https:")}function _(e){void 0===e&&(e="");var n=window.URL;if(!n)return!1;if(!n.canParse)return!1;if("function"!=typeof n.canParse)return!1;try{var t=new n("b","http://a");return t.pathname="c d","http://a/c%20d"===t.href&&Boolean(t.searchParams)&&n.canParse(e)}catch(e){return!1}}var R={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:function(){},errorFn:function(){}};function B(e,t){void 0===e&&(e=""),void 0===t&&(t=n({},R));var r=Object.assign(n({},R),t),i=r.enabled,a=r.isClosed,c=r.showWrap,u=r.showDate,s=r.locales,f=r.isStringifyObject,l=r.logFn,d=r.errorFn;!0===a&&(L.warn("The options.isClosed is deprecated. Please use options.enabled instead."),i=!1);var p=Object.create(null),g=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(n){p[n]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(i){var a=e,s=e;if("string"==typeof e&&e.length>=2){var p=e.length;a=":"===e[p-1]?e.substring(0,p-1):e}c&&console.log("--- ".concat(a," - begin ---")),u&&(s=e?"".concat(g()," ").concat(e):"".concat(g())),f&&(t=t.map(function(e){return y(e)?JSON.stringify(e):e})),e||u?console[n].apply(console,o([s],t,!1)):console[n].apply(console,t),"log"===n&&l(),"error"===n&&d(),c&&console.log("--- ".concat(a," - end ---"))}}}),p}var L=B("[Mazey]"),U=B("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function F(e,n){if(e)if(Array.isArray(n))n.forEach(function(n){e.classList.add(n)});else{for(var t=e.className,r=t.split(/\s+/),o=0;o<r.length;o++)if(r[o]===n)return;var i,a="";""!==t&&(a=" "),i=t+a+n,e.className=i}else L.error("The element is not exist.")}function I(){var e,n=window.jQuery||window.$;return n?!(!(e=n("img"))||!e.length)&&(e.each(function(){var e=n(this);if(e){var t=e.attr("src");if(t&&"string"==typeof t&&t.length){var r=t.match(/width=([0-9]+[a-z%]*)/),o=t.match(/height=([0-9]+[a-z%]*)/);r&&w(r)&&r[1]&&e.width(r[1]),o&&w(o)&&o[1]&&e.height(o[1])}}}),!0):(e=document.getElementsByTagName("img")).length>0&&(Array.from(e).forEach(function(e){var n=e;if(n){var t=n.getAttribute("src");if(t&&"string"==typeof t&&t.length){var r=t.match(/width=([0-9]+[a-z%]*)/),o=t.match(/height=([0-9]+[a-z%]*)/);r&&w(r)&&r[1]&&(n.style.width=r[1]),o&&w(o)&&o[1]&&(n.style.height=o[1])}}}),!0)}function D(){var e=window.MAZEY_DEFINE_LISTENERS;return"object"!=typeof e&&(e={},window.MAZEY_DEFINE_LISTENERS=e),e}function z(e,n){var t=D()[e];if(t instanceof Array)for(var r=0,o=t.length;r<o;r++)"function"==typeof t[r]&&(void 0===n?t[r]():t[r](n))}function q(e){for(var n=e+"=",t=document.cookie.split(";"),r=0;r<t.length;r++){for(var o=t[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(n))return o.substring(n.length,o.length)}return""}function H(e){for(var n=document.cookie.split(";"),t=0;t<n.length;t++){var r=n[t].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 Z(e,n){void 0===n&&(n={id:""});var t,r=n.id,o=function(){},i=new Promise(function(e,n){var r;t=(r=[e,n])[0],o=r[1]}),a=function(){t("loaded")},c=document.createElement("link");c||o(new Error("Not support create link element"));var u="onload"in c,s=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(c.rel="stylesheet",c.type="text/css",c.href=e,void 0!==r&&(c.id=r),document.getElementsByTagName("head")[0].appendChild(c),s||!u)return setTimeout(function(){l(c,a,0)},1),i;function f(){c&&(c.onload=c.onerror=c.onreadystatechange=null),c=null,a()}function l(e,n,t){if(e){var r,o=e.sheet;if((t+=1)>3e5)return r=!0,e&&(e=null),void n();if(s)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?n():l(e,n,t)},20)}}return u?(c.onload=f,c.onerror=function(){f()}):c.onreadystatechange=function(){c&&/loaded|complete/.test(c.readyState)&&f()},i}var V={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function W(e,t){void 0===t&&(t=n({},V));var r,o,i=Object.assign(n({},V),t),a=i.id,c=i.callback,u=i.timeout,s=i.isDefer,f=i.isAsync,l=i.isCrossOrigin,d=i.attributes,p=i.cssUrl,g=document.createElement("script");if(g||Promise.reject("Not support create script element"),p){var v=function(e,n){if(!n)return"";if(N(n))return n;var t=e.split("/");t.pop();var r=t.join("/");return"".concat(r,"/").concat(n)}(e,p);v&&Z(v).catch(function(e){console.error("Failed to load CSS from ".concat(v,": ").concat(null==e?void 0:e.message))})}var m=document.getElementsByTagName("script")[0];return g.type="text/javascript",s&&(g.defer=!0),f&&(g.async=!0),l&&(g.crossOrigin="anonymous"),a&&(g.id=a),d&&Object.keys(d).forEach(function(e){g.setAttribute(e,d[e])}),g.readyState?g.onreadystatechange=function(){"loaded"!==g.readyState&&"complete"!==g.readyState||(g.onreadystatechange=null,h(c),h(r,"loaded"))}:g.onload=function(){h(c),h(r,"loaded")},g.src=e,m&&m.parentNode.insertBefore(g,m),new Promise(function(e,n){var t;r=(t=[e,n])[0],o=t[1],u&&setTimeout(o.bind(null,"timeout"),u)})}function $(e){var n=[],t=window.PerformanceObserver;return!!t&&(w(t.supportedEntryTypes)&&(n=t.supportedEntryTypes),n.includes(e))}function J(){return t(this,void 0,void 0,function(){return r(this,function(e){return $("paint")?[2,new Promise(function(e){var n=new PerformanceObserver(function(t){var r=t.getEntries().find(function(e){return"first-contentful-paint"===e.name});r&&(n.disconnect(),e(Math.round(r.startTime)))});n.observe({type:"paint",buffered:!0})})]:[2,0]})})}function Q(){return t(this,void 0,void 0,function(){return r(this,function(e){return $("paint")?[2,new Promise(function(e){var n=new PerformanceObserver(function(t){var r=t.getEntries().find(function(e){return"first-paint"===e.name});r&&(n.disconnect(),e(Math.round(r.startTime)))});n.observe({type:"paint",buffered:!0})})]:[2,0]})})}var Y="";function K(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;var e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{var t=navigator.userAgent.toLowerCase();if(!t)return e;var r=function(e){return e.test(t)},o=function(e){var n="",r=t.match(e);return r&&w(r)&&(n=(n=(n=r.toString()).replace(/[^0-9|_.]/g,"")).replace(/_/g,".")),n},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")),e=n(n({},e),{system:i,appleType:a});var c="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?c="2000":r(/windows nt 5.1|windows xp/g)?c="xp":r(/windows nt 5.2|windows 2003/g)?c="2003":r(/windows nt 6.0|windows vista/g)?c="vista":r(/windows nt 6.1|windows 7/g)?c="7":r(/windows nt 6.2|windows 8/g)?c="8":r(/windows nt 6.3|windows 8.1/g)?c="8.1":r(/windows nt 10.0|windows 10/g)&&(c="10"):"macos"===i?c=o(/os x [\d._]+/g):"android"===i?c=o(/android [\d._]+/g):"ios"===i&&(c=o(/os [\d._]+/g)),e=n(n({},e),{systemVs:c});var u="";"windows"===i||"macos"===i||"linux"===i?u="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(u="mobile"),e=n(n({},e),{platform:u});var s="",f="";r(/applewebkit/g)?(s="webkit",r(/edge/g)?f="edge":r(/opr/g)?f="opera":r(/chrome/g)?f="chrome":r(/safari/g)&&(f="safari")):r(/gecko/g)&&r(/firefox/g)?(s="gecko",f="firefox"):r(/presto/g)?(s="presto",f="opera"):r(/trident|compatible|msie/g)&&(s="trident",f="iexplore"),e=n(n({},e),{engine:s,supporter:f});var l="";"webkit"===s?l=o(/applewebkit\/[\d._]+/g):"gecko"===s?l=o(/gecko\/[\d._]+/g):"presto"===s?l=o(/presto\/[\d._]+/g):"trident"===s&&(l=o(/trident\/[\d._]+/g)),e=n(n({},e),{engineVs:l});var d="";"chrome"===f?d=o(/chrome\/[\d._]+/g):"safari"===f?d=o(/version\/[\d._]+/g):"firefox"===f?d=o(/firefox\/[\d._]+/g):"opera"===f?d=o(/opr\/[\d._]+/g):"iexplore"===f?d=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===f&&(d=o(/edge\/[\d._]+/g)),e=n(n({},e),{supporterVs:d});var p="",g="";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"),e=n(n({},e),{shell:p,shellVs:g});var v="";if(window.matchMedia){var m=window.matchMedia("(prefers-color-scheme: dark)"),h=window.matchMedia("(prefers-color-scheme: light)");m.matches?v="dark":h.matches&&(v="light")}return e=n(n({},e),{colorScheme:v}),window.MAZEY_BROWSER_INFO=e,e}catch(n){return L.warn(n),e}}var G="";return e.addClass=F,e.addEvent=function(e,n){var t=D();void 0===t[e]&&(t[e]=[]),"function"==typeof n&&t[e].push(n)},e.addStyle=function(e,n){if(void 0===n&&(n={id:""}),!e)return!1;var t=document.createDocumentFragment(),r=null,o="",i=document.createElement("style");return n.id?(o="".concat(n.id),(r=document.getElementById(o))?r.innerHTML=e:(i.setAttribute("id",n.id),i.innerHTML=e,t.appendChild(i),document.head.appendChild(t))):(i.innerHTML=e,t.appendChild(i),document.head.appendChild(t)),!0},e.calLongestCommonSubsequence=function(e,n){return P(e,n)},e.calLongestCommonSubstring=function(e,n){return M(e,n)},e.camelCase2Underscore=u,e.camelCaseToKebabCase=function(e){return a(e)},e.cancelBubble=function(e){var n=e||window.event;n.stopPropagation?n.stopPropagation():n.cancelBubble=!0},e.clearHTML=function(e,n){return void 0===n&&(n={}),E(e,n)},e.clearHtml=function(e,n){return void 0===n&&(n={}),E(e,n)},e.convert10To26=function(e){for(var n="";e>0;){var t=e%26;0===t&&(t=26),n=String.fromCharCode(t+96)+n,e=(e-t)/26}return n},e.convertCamelToKebab=a,e.convertCamelToUnder=c,e.convertHttpToHttps=j,e.convertKebabToCamel=function(e){var n=e.replace(/-([a-z])/g,function(e,n){return n.toUpperCase()});return n.endsWith("-")?n.slice(0,-1):n},e.convertObjectToQuery=function(e){if(e&&0===Object.keys(e).length)return"";var n="?";for(var t in e)n+="".concat(t,"=").concat(e[t],"&");return n.slice(0,-1)},e.convertToHtmlBreaks=S,e.convertUnderToCamel=function(e){return e.replace(/_([a-z])/g,function(e,n){return n.toUpperCase()})},e.cutCHSString=function(e,n,t){return void 0===t&&(t=!1),O(e,n,t)},e.cutZHString=A,e.debounce=function(e,n,t){var r=null,o=null,i=null,a=null,c=null,u=function(){var s=p()-i;s<n&&s>=0?o=setTimeout(u,n-s):(o=null,t||(c=e.apply(r,a),o||(r=a=null)))};return function(){for(var s=[],f=0;f<arguments.length;f++)s[f]=arguments[f];r=this,a=s,i=p();var l=t&&!o;return o||(o=setTimeout(u,n)),l&&(c=e.apply(r,a),r=a=null),c}},e.deepCopy=i,e.deepCopyObject=function(e){return i(e)},e.delCookie=function(e){H(e)},e.doFn=h,e.fireEvent=z,e.floatFixed=function(e,n){return void 0===n&&(n=0),parseFloat(e).toFixed(n)},e.floatToPercent=function(e,n){void 0===n&&(n=0);var t="";return t=n?(100*e).toFixed(n):String(Math.floor(100*e)),"".concat(t,"%")},e.formatDate=function(e,n){void 0===n&&(n="yyyy-MM-dd"),e||(e=new Date);var t=new Date(e),r=t.getHours(),o={yyyy:t.getFullYear(),MM:t.getMonth()+1,dd:t.getDate()<10?"0"+t.getDate():t.getDate(),HH:r<10?"0"+r:r,hh:(r%12||12)<10?"0"+(r%12||12):r%12||12,mm:t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),ss:t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds(),a:r<12?"AM":"PM"},i=n||"yyyy-MM-dd";return Object.keys(o).forEach(function(e){var n=o[e];"MM"===e&&Number(n)<=9&&(n="0".concat(n)),i=i.replace(e,String(n))}),i},e.genBrowserAttrs=function(e,n){void 0===e&&(e=""),void 0===n&&(n="-");var t=K(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(function(o){var i=t[o];if(i){var a="";e&&e.length>0&&(a="".concat(e).concat(n)),r.push("".concat(a).concat(i))}}),r},e.genCustomConsole=B,e.genHashCode=function(e){var n,t=0;for(n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t},e.genRndNumString=f,e.genStyleString=function(e,n){var t="";return n&&n.length>0&&(t=n.join(";")+";"),"".concat(e,"{").concat(t,"}")},e.genUniqueNumString=d,e.generateRndNum=l,e.generateUniqueNum=function(e){return void 0===e&&(e=3),d(e)},e.getAllQueryParams=function(e){void 0===e&&(e=""),""===e&&(e=location.search);var n={};return e.replace(/\??(\w+)=([^&]*)&?/g,function(e,t,r){return void 0===n[t]&&(n[t]=decodeURIComponent(r)),""}),n},e.getBrowserInfo=K,e.getCLS=function(){return t(this,void 0,void 0,function(){return r(this,function(e){return $("layout-shift")?[2,new Promise(function(e){var n=new PerformanceObserver(function(t){var r=t.getEntries().reduce(function(e,n){var t=0;return v(n.value)&&(t=n.value),e+t},0);n.disconnect(),e(r)});n.observe({type:"layout-shift",buffered:!0})})]:[2,0]})})},e.getCookie=q,e.getCurrentVersion=function(){return"v4"},e.getDefineListeners=D,e.getDomain=function(e,n){if(void 0===n&&(n=["hostname"]),_(e)){var t=new window.URL(e);return n.reduce(function(e,n){return e+=t[n]},"")}var r=document.createElement("a");return r.href=e,n.reduce(function(e,n){return e+=r[n]},"")},e.getFCP=J,e.getFID=function(){return t(this,void 0,void 0,function(){return r(this,function(e){return $("first-input")?[2,new Promise(function(e){var n=new PerformanceObserver(function(t){var r=t.getEntries().find(function(e){return"first-input"===e.entryType});if(r){n.disconnect();var o=r.processingStart;e(o?Math.round(r.processingStart-r.startTime):0)}});n.observe({type:"first-input",buffered:!0})})]:[2,0]})})},e.getFP=Q,e.getFileSize=function(e){var n=function(e){return String(Math.ceil(e))};if(!e||e<0)return"";var t=1024;return e<t?e+" B":e<Math.pow(t,2)?n(e/t)+" KB":e<Math.pow(t,3)?n(e/Math.pow(t,2))+" MB":e<Math.pow(t,4)?n(e/Math.pow(t,3))+" G":n(e/Math.pow(t,4))+" T"},e.getFriendlyInterval=function(e,n,t){void 0===e&&(e=0),void 0===n&&(n=0),void 0===t&&(t=g);var r=(t=Object.assign(g,t)).type,o=decodeURIComponent;v(e)||(e=new Date(e).getTime()),v(n)||(n=new Date(n).getTime());var i=Number(n)-Number(e),a="",c=new Array(4).fill(0),u=c[0],s=(c[1],c[2],c[3]),f=o("%20%E5%A4%A9%20"),l=o("%20%E6%97%B6%20"),d=o("%20%E5%88%86%20"),p=o("%20%E7%A7%92");if(i>=0)switch(u=Math.floor(i/1e3/60/60/24),Math.floor(i/1e3/60/60),Math.floor(i/1e3/60),s=Math.floor(i/1e3),r){case"d":a=u;break;case"text":a=(u=Math.floor(i/1e3/60/60/24))+f+Math.floor(i/1e3/60/60%24)+l+Math.floor(i/1e3/60%60)+d+(s=Math.floor(i/1e3%60))+p;break;default:a=s}return a},e.getHashQueryParam=function(e){var n=location.hash.split("?");if(1===n.length)return"";var t=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),r=n[1].match(t);return r?r[2]:""},e.getLCP=function(){return t(this,void 0,void 0,function(){return r(this,function(e){return $("largest-contentful-paint")?[2,new Promise(function(e){var n=new PerformanceObserver(function(t){var r=t.getEntries().find(function(e){return"largest-contentful-paint"===e.entryType});r&&(n.disconnect(),e(Math.round(r.startTime)))});n.observe({type:"largest-contentful-paint",buffered:!0})})]:[2,0]})})},e.getLocalStorage=function(e){var n=null;if(e){var t=localStorage.getItem(e);t&&(n=JSON.parse(t))}return n},e.getPageMeta=function(e){var n;return document.querySelector&&(null===(n=document.querySelector('meta[name="'.concat(e,'"]')))||void 0===n?void 0:n.getAttribute("content"))||""},e.getPerformance=function(e){return void 0===e&&(e=!1),t(this,void 0,void 0,function(){function n(){var n={source:F,os:t(),osVersion:o(),deviceType:i(),network:a(),screenDirection:c(),unloadTime:h-y,redirectTime:b-S,dnsTime:E-T,tcpTime:A-O,sslTime:s(A,x),responseTime:C-M,downloadTime:P-C,firstPaintTime:z,firstContentfulPaintTime:q,domReadyTime:k-I,onloadTime:N-I,whiteTime:C-I,renderTime:j-I,decodedBodySize:B,encodedBodySize:L};Object.keys(n).forEach(function(e){v(n[e])&&(n[e]<0?n[e]=0:n[e]=Math.round(n[e]))}),v(n.whiteTime)&&n.whiteTime>n.onloadTime&&(n.whiteTime=0);var r={};e||Object.keys(n).forEach(function(e){r[u(e)]=n[e]}),Object.keys(r).length?l(r):l(n)}function t(){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="",n=navigator.userAgent,t=n.indexOf("Android")>-1||n.indexOf("Linux")>-1,r=!!n.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;var i=o[1];return i?(t&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function i(){var e,n=navigator.userAgent.toLowerCase(),t=n.match(/(ipad)/i)&&"ipad",r=n.match(/iphone os/i)&&"iphone os",o=n.match(/midp/i)&&"midp",i=n.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",a=n.match(/ucweb/i)&&"ucweb",c=n.match(/android/i)&&"android",u=n.match(/windows ce/i)&&"windows ce",s=n.match(/windows mobile/i)&&"windows mobile";return(e=t||r||o||i||a||c||u||s?r||o||i||a||c||u||s?"phone":t?"ipad":void 0:"pc")||(e=""),e}function a(){var e="",n=window.navigator;if(n.connection&&n.connection.effectiveType)switch(n.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 c(){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 s(e,n){var t=0;return n&&(t=e-n),t}var f,l,d,p,g,m,h,y,b,S,E,T,A,O,x,C,M,P,k,N,j,_,R,B,L,U,F,I,D,z,q;return r(this,function(e){switch(e.label){case 0:if(!$("navigation"))return[2,Promise.reject(new Error("navigation is not supported"))];if(!(f=window.performance)||"function"!=typeof f.getEntries||"function"!=typeof f.getEntriesByType)return[2,Promise.reject(new Error("performance is not supported"))];if(d=new Promise(function(e){l=[e][0]}),p=null,w(g=f.getEntriesByType("navigation"))&&(p=g[0]),m=new Array(19).fill(0),h=m[0],y=m[1],b=m[2],S=m[3],E=m[4],T=m[5],A=m[6],O=m[7],x=m[8],C=m[9],M=m[10],P=m[11],k=m[12],N=m[13],j=m[14],_=m[15],R=m[16],B=m[17],L=m[18],U=f.timing,F="",p)F="PerformanceNavigationTiming",B=p.decodedBodySize,L=p.encodedBodySize,h=p.unloadEventEnd,y=p.unloadEventStart,b=p.redirectEnd,S=p.redirectStart,E=p.domainLookupEnd,T=p.domainLookupStart,A=p.connectEnd,O=p.connectStart,x=p.secureConnectionStart,C=p.responseStart,M=p.requestStart,P=p.responseEnd,k=p.domContentLoadedEventStart,N=p.loadEventStart,j=p.loadEventEnd,_=p.startTime,R=p.fetchStart;else{if(!U)return[2,Promise.reject(new Error("NavigationTiming and Timing are not supported"))];F="PerformanceTiming",h=U.unloadEventEnd,y=U.unloadEventStart,b=U.redirectEnd,S=U.redirectStart,E=U.domainLookupEnd,T=U.domainLookupStart,A=U.connectEnd,O=U.connectStart,x=U.secureConnectionStart,C=U.responseStart,M=U.requestStart,P=U.responseEnd,k=U.domContentLoadedEventStart,N=U.loadEventStart,j=U.loadEventEnd,_=U.navigationStart,R=U.fetchStart}if(I=0,v(_))I=_;else{if(!v(R))return[2,Promise.reject(new Error("startTime, navigationStart or fetchStart are required"))];I=R}return[4,Promise.all([Q(),J()])];case 1:return D=e.sent(),z=D[0],q=D[1],v(j)&&j>0?n():window.addEventListener("load",function(){window.setTimeout(function(){n()},0)}),[2,d]}})})},e.getQueryParam=function(e){var n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),t=location.search.substring(1).match(n);return null!==t?decodeURIComponent(t[2]):""},e.getScriptQueryParam=function(e,n){void 0===n&&(n=""),n||(n=".js");for(var t=new RegExp("[?&]".concat(e,"=([^&]*)")),r=document.querySelectorAll('script[src*="'.concat(n,'"]')),o=0;o<r.length;o++){var i=r[o].getAttribute("src");if(i&&-1!==i.indexOf(n)){var a=i.match(t);if(a)return decodeURIComponent(a[1])}}return""},e.getSessionStorage=function(e){var n=null;if(e){var t=sessionStorage.getItem(e);t&&(n=JSON.parse(t))}return n},e.getTTFB=function(){return t(this,void 0,void 0,function(){var e,n;return r(this,function(t){return $("navigation")&&window.performance&&window.performance.getEntriesByType?(e=performance.getEntriesByType("navigation")[0],0,e?(n=e.responseStart-e.requestStart,[2,Math.round(n)]):[2,0]):[2,0]})})},e.getUrlFileType=function(e){var n="";if("string"!=typeof e||""==e)return n;var t=/\.[^/?#]+$/.exec(e);return t?(t[0].length>1&&(n=t[0].substring(1)),n):n},e.getUrlHost=function(e){var n="";return!N(e)&&N(e,{strict:!1})&&0===e.indexOf("//")&&(e="https:"+e),_(e)&&(n=new URL(e).host),n},e.getUrlParam=function(e,n,t){void 0===t&&(t={});var r=null;if(e.includes("#")){r=new URL(e).searchParams.getAll(n)}else{var o={};e.replace(/\??(\w+)=([^&]*)&?/g,function(e,n,t){return void 0!==o[n]?o[n].push(t):o[n]=[t],""}),r=o[n]||[]}return t.returnArray?r:r.length?r[0]:null},e.getUrlPath=function(e){var n="";return!N(e)&&N(e,{strict:!1})&&0===e.indexOf("//")&&(e="https:"+e),_(e)&&(n=new URL(e).pathname),n},e.hasClass=function(e,n){if(!e)return L.error("The element is not exist."),!1;for(var t=e.className.split(/\s+/),r=0;r<t.length;r++)if(t[r]===n)return!0;return!1},e.inRate=function(e){return k(e)},e.invokeEvent=function(e){z(e)},e.invokeFn=m,e.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},e.isBool=b,e.isBoolean=function(e){return b(e)},e.isBrowser=function(){if(C)return"browser"===C;var e="undefined"!=typeof window;return e&&(C="browser"),e},e.isFunction=function(e){return"function"==typeof e},e.isHit=k,e.isJSONString=s,e.isJsonString=function(e){return s(e)},e.isNonEmptyArray=w,e.isNonEmptyObject=function(e){return!!y(e)&&0!==Object.keys(e).length},e.isNumber=v,e.isPureObject=y,e.isSafePWAEnv=function(){if(Y)return"pwa"===Y;var e=K();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&&"https:"===window.location.protocol?(Y="pwa",!0):(Y="no-pwa",!1)},e.isString=function(e){return"string"==typeof e},e.isSupportWebp=function(){return G?Promise.resolve("webp"===G):new Promise(function(e){var n=new Image;n.onload=function(){var t=n.width>0&&n.height>0;G=t?"webp":"no-webp",e(t)},n.onerror=function(){G="no-webp",e(!1)},n.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})},e.isSupportedEntryType=$,e.isUdfOrNul=function(e){return null==e},e.isValidData=function(e,n,t){var r=!1;return"object"!=typeof e||n.reduce(function(e,n){return void 0===e[n]?Object.create(null):e=e[n]},e)===t&&(r=!0),r},e.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)},e.isValidHttpUrl=N,e.isValidPhoneNumber=function(e){return/^1\d{10}$/.test(e)},e.isValidUrl=function(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b()!@:%_+.~#?&//=]*)$/.test(e)},e.loadCSS=Z,e.loadImage=function(e){return new Promise(function(n,t){var r=new Image;r.onload=function(){n(r)},r.onerror=function(e){t(e)},r.src=e})},e.loadScript=W,e.loadScriptIfUndefined=function(e,n){return window[e]?Promise.resolve("defined"):W(n)},e.longestComSubsequence=P,e.longestComSubstring=M,e.mNow=p,e.mTrim=function(e){for(var n=(e=e.replace(/^\s+/,"")).length-1,t=/\s/;t.test(e.charAt(n));)n--;return e.slice(0,n+1)},e.mazeyCon=L,e.newLine=function(e){return S(e)},e.removeClass=function(e,n){var t;e?(t=(t=(t=(t=" "+e.className+" ").replace(/(\s+)/gi," ")).replace(" "+n+" "," ")).replace(/(^\s+)|(\s+$)/g,""),e.className=t):L.error("The element is not exist.")},e.removeCookie=H,e.removeEvent=function(e,n){var t=D(),r=t[e];if("string"==typeof e&&r instanceof Array)if("function"==typeof n){for(var o=0,i=r.length;o<i;o++)if(r[o]===n){t[e].splice(o,1);break}}else delete t[e]},e.removeHTML=E,e.removeHtml=function(e,n){return void 0===n&&(n={}),E(e,n)},e.repeatUntilConditionMet=function(e,n,o){var i=this;void 0===n&&(n={}),void 0===o&&(o=function(e){return!0===e});var a=n.interval,c=void 0===a?1e3:a,u=n.times,s=void 0===u?10:u,f=n.context,l=n.args,d=0,p=function(){setTimeout(function(){return t(i,void 0,void 0,function(){var n;return r(this,function(t){switch(t.label){case 0:return[4,e.apply(f,l)];case 1:return n=t.sent(),o(n)||++d>=s?[2]:(p(),[2])}})})},c)};"function"!=typeof e&&console.error("Expected a function."),("number"!=typeof c||c<0)&&console.error("Expected a non-negative number for interval."),("number"!=typeof s||s<0)&&console.error("Expected a non-negative number for times."),p()},e.replaceHttp=function(e){return j(e)},e.sanitizeInput=function(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,function(e){return n[e]})},e.setClass=function(e,n){F(e,n)},e.setCookie=function(e,n,t,r){var o,i;if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),i="; expires="+a.toUTCString()}else i="";var c=location.host;1===c.split(".").length?document.cookie=e+"="+n+i+"; path=/":((o=c.split(".")).shift(),r=r||"."+o.join("."),document.cookie=e+"="+n+i+"; path=/; domain="+r,null!==q(e)&&q(e)===n||(r=r||"."+c,document.cookie=e+"="+n+i+"; path=/; domain="+r))},e.setImgSizeBySrc=I,e.setImgWidHeiBySrc=function(){return I()},e.setLocalStorage=function(e,n){void 0===n&&(n=null),e&&localStorage.setItem(e,JSON.stringify(n))},e.setSessionStorage=function(e,n){void 0===n&&(n=null),e&&sessionStorage.setItem(e,JSON.stringify(n))},e.sleep=function(e){return t(this,void 0,void 0,function(){return r(this,function(n){return[2,x(e)]})})},e.throttle=function(e,n,t){void 0===t&&(t={}),t=Object.assign({},t);var r=null,o=null,i=null,a=[null,0],c=a[0],u=a[1],s=function(){u=!1===t.leading?0:p(),i=null,c=e.apply(this,o),i||(r=o=null)};return function(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];var l=p();u||!1!==t.leading||(u=l);var d=n-(l-u);return r=this,o=a,d<=0||d>n?(i&&(clearTimeout(i),i=null),u=l,c=e.apply(r,o),i||(r=o=null)):i||!1===t.trailing||(i=setTimeout(s.bind(r),d)),c}},e.timeCon=U,e.truncateZHString=O,e.unsanitize=function(e){return T(e)},e.unsanitizeInput=T,e.updateQueryParam=function(e,n,t){if(e.includes("#")){var r=new URL(e);return r.searchParams.set(n,t),r.toString()}var o=new RegExp("([?&])"+n+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+n+"="+t+"$2"):e+i+n+"="+t},e.waitTime=x,e.windowLoaded=function(e){void 0===e&&(e=3e4);var n,t=function(){},r=new Promise(function(e,r){t=e,n=r});return"complete"===document.readyState?t("complete"):window.addEventListener("load",function(){return t("load")}),setTimeout(function(){return n(Error("timeout"))},e),r},e.zAxiosIsValidRes=function(e,n){void 0===n&&(n={validStatusRange:[200,300],validCode:[0]});var t=Object.assign({validStatusRange:[200,300],validCode:[0]},n),r=t.validStatusRange,o=t.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},e}({});
|
|
6
|
+
var mazey=function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function r(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function u(e){o(a,r,i,u,c,"next",e)}function c(e){o(a,r,i,u,c,"throw",e)}u(void 0)})}}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}function s(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l,p={exports:{}},d={exports:{}};(l=d).exports=function(e,t){this.v=e,this.k=t},l.exports.__esModule=!0,l.exports.default=l.exports;var g=d.exports,v={exports:{}},m={exports:{}};!function(e){function t(n,r,o,i){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}e.exports=t=function(e,n,r,o){function i(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?a?a(e,n,{value:r,enumerable:!o,configurable:!o,writable:!o}):e[n]=r:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(m);var h=m.exports;!function(e){var t=h;function n(){var r,o,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.toStringTag||"@@toStringTag";function c(e,n,i,a){var u=n&&n.prototype instanceof f?n:f,c=Object.create(u.prototype);return t(c,"_invoke",function(e,t,n){var i,a,u,c=0,f=n||[],l=!1,p={p:0,n:0,v:r,a:d,f:d.bind(r,4),d:function(e,t){return i=e,a=0,u=r,p.n=t,s}};function d(e,t){for(a=e,u=t,o=0;!l&&c&&!n&&o<f.length;o++){var n,i=f[o],d=p.p,g=i[2];e>3?(n=g===t)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=r):i[0]<=d&&((n=e<2&&d<i[1])?(a=0,p.v=t,p.n=i[1]):d<g&&(n=e<3||i[0]>t||t>g)&&(i[4]=e,i[5]=t,p.n=g,a=0))}if(n||e>1)return s;throw l=!0,t}return function(n,f,g){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,g),a=f,u=g;(o=a<2?r:u)||!l;){i||(a?a<3?(a>1&&(p.n=-1),d(a,u)):p.n=u:p.v=u);try{if(c=2,i){if(a||(n="next"),o=i[n]){if(!(o=o.call(i,u)))throw TypeError("iterator result is not an object");if(!o.done)return o;u=o.value,a<2&&(a=0)}else 1===a&&(o=i.return)&&o.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+n+"' method"),a=1);i=r}else if((o=(l=p.n<0)?u:e.call(t,p))!==s)break}catch(e){i=r,a=1,u=e}finally{c=1}}return{value:o,done:l}}}(e,i,a),!0),c}var s={};function f(){}function l(){}function p(){}o=Object.getPrototypeOf;var d=[][a]?o(o([][a]())):(t(o={},a,function(){return this}),o),g=p.prototype=f.prototype=Object.create(d);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,t(e,u,"GeneratorFunction")),e.prototype=Object.create(g),e}return l.prototype=p,t(g,"constructor",p),t(p,"constructor",l),l.displayName="GeneratorFunction",t(p,u,"GeneratorFunction"),t(g),t(g,u,"Generator"),t(g,a,function(){return this}),t(g,"toString",function(){return"[object Generator]"}),(e.exports=n=function(){return{w:c,m:v}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(v);var y=v.exports,w={exports:{}},b={exports:{}},x={exports:{}};!function(e){var t=g,n=h;e.exports=function e(r,o){function i(e,n,a,u){try{var c=r[e](n),s=c.value;return s instanceof t?o.resolve(s.v).then(function(e){i("next",e,a,u)},function(e){i("throw",e,a,u)}):o.resolve(s).then(function(e){c.value=e,a(c)},function(e){return i("throw",e,a,u)})}catch(e){u(e)}}var a;this.next||(n(e.prototype),n(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(e,t,n){function r(){return new o(function(t,r){i(e,n,t,r)})}return a=a?a.then(r,r):r()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports}(x);var S=x.exports;!function(e){var t=y,n=S;e.exports=function(e,r,o,i,a){return new n(t().w(e,r,o,i),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports}(b);var O=b.exports;!function(e){var t=O;e.exports=function(e,n,r,o,i){var a=t(e,n,r,o,i);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports}(w);var E=w.exports,j={exports:{}};!function(e){e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports}(j);var A=j.exports,T={exports:{}},P={exports:{}};!function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(P);var k=P.exports;!function(e){var t=k.default;e.exports=function(e){if(null!=e){var n=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(t(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports}(T);var _=T.exports;!function(e){var t=g,n=y,r=E,o=O,i=S,a=A,u=_;function c(){var s=n(),f=s.m(c),l=(Object.getPrototypeOf?Object.getPrototypeOf(f):f.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function g(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,d[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,u(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=c=function(){return{wrap:function(e,t,n,r){return s.w(g(e),t,n,r&&r.reverse())},isGeneratorFunction:p,mark:s.m,awrap:function(e,n){return new t(e,n)},AsyncIterator:i,async:function(e,t,n,i,a){return(p(t)?o:r)(g(e),t,n,i,a)},keys:a,values:u}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=c,e.exports.__esModule=!0,e.exports.default=e.exports}(p);var M=(0,p.exports)(),C=M;try{regeneratorRuntime=M}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=M:Function("r","regeneratorRuntime = r")(M)}var N=f(C);function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){if("object"!=typeof e)return e;var t=["string","number","boolean","undefined"];return Object.values(e).every(function(e){return t.includes(typeof e)})?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e):JSON.parse(JSON.stringify(e))}function F(e){var t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function B(e){var t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function I(e){return B(e)}function L(e){try{if("object"==typeof JSON.parse(e))return!0}catch(e){}return!1}function U(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t="";e--;)t+=Math.floor(10*Math.random());return t}function z(){return U(arguments.length>0&&void 0!==arguments[0]?arguments[0]:5)}function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=[H(),z(e||3)];return t[0]+t[1]}function H(){return Date.now?Date.now():(new Date).getTime()}var Z={type:"d"};function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},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 W(e){var t=null;if(e&&"function"==typeof e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t=e.apply(void 0,r)}return t}function $(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return W.apply(void 0,[e].concat(n))}function J(e){var t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function G(e){var t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function Q(e){return"boolean"==typeof e}function Y(e){if(!e)return"";var t=new RegExp("\\n","g");return e.replace(t,"<br />")}function K(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).removeNewLine,n=void 0!==t&&t,r="";return e&&(r=e.replace(/<\/?.+?>/g,""),n&&(r=r.replace(/[\r\n]/g,""))),r}function X(e){var t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,function(e){return t[e]})}function ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{hasDot:!1,dotText:"..."};if(n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",u=e.replace(i,"**").length,c=0;c<u&&(null!=(a=e.charAt(c).toString()).match(i)?r+=2:r++,!(r>t));c++)o+=a;return n.hasDot&&u>t&&(o+=n.dotText),o}return""}function te(e,t){return ee(e,t,{hasDot:arguments.length>2&&void 0!==arguments[2]&&arguments[2]})}function ne(e){return re.apply(this,arguments)}function re(){return(re=i(N.mark(function e(t){return N.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){setTimeout(function(){e(t)},t)}));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function oe(){return(oe=i(N.mark(function e(t){return N.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ne(t));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}var ie="";function ae(e,t){for(var n=e.length,o=t.length,i=R(new Array(n).fill(new Array(o).fill(0))),a=0;a<n;++a)for(var u=0;u<o;++u)if(e[a]===t[u]){var c=0;a>0&&u>0&&(c=i[a-1][u-1]),i[a][u]=c+1}var s=Array.prototype.concat.apply([],i);return Math.max.apply(Math,r(s))}function ue(e,t){for(var n=e.length,o=t.length,i=R(new Array(n).fill(new Array(o).fill(0))),a=0;a<n;++a)for(var u=0;u<o;++u)if(e[a]===t[u]){var c=0;a>0&&u>0&&(c=i[a-1][u-1]),i[a][u]=c+1}else{var s=0,f=0;u>0&&(s=i[a][u-1]),a>0&&(f=i[a-1][u]),i[a][u]=Math.max(s,f)}var l=Array.prototype.concat.apply([],i);return Math.max.apply(Math,r(l))}function ce(e){return Math.random()<e}function se(e){var t=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/;return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{strict:!0}).strict||(t=/^(https?:)?\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/),t.test(e)}function fe(e){return e.replace(/^http:/,"https:")}function le(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=window.URL;if(!t)return!1;if(!t.canParse)return!1;if("function"!=typeof t.canParse)return!1;try{var n=new t("b","http://a");return n.pathname="c d","http://a/c%20d"===n.href&&Boolean(n.searchParams)&&t.canParse(e)}catch(e){return!1}}function pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ge={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:function(){},errorFn:function(){}};function ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:de({},ge),n=Object.assign(de({},ge),t),o=n.enabled,i=n.isClosed,a=n.showWrap,u=n.showDate,c=n.locales,s=n.isStringifyObject,f=n.logFn,l=n.errorFn,p=o;!0===i&&(me.warn("The options.isClosed is deprecated. Please use options.enabled instead."),p=!1);var d=Object.create(null),g=function(){return(new Date).toLocaleDateString(c,{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=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];if(p){var c,d,v=e,m=e;if("string"==typeof e&&e.length>=2){var h=e.length;v=":"===e[h-1]?e.substring(0,h-1):e}if(a&&console.log("--- ".concat(v," - begin ---")),u&&(m=e?"".concat(g()," ").concat(e):"".concat(g())),s&&(o=o.map(function(e){return G(e)?JSON.stringify(e):e})),e||u)(c=console)[t].apply(c,[m].concat(r(o)));else(d=console)[t].apply(d,r(o));"log"===t&&f(),"error"===t&&l(),a&&console.log("--- ".concat(v," - end ---"))}}}),d}var me=ve("[Mazey]"),he=ve("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function ye(e,t){if(e)if(Array.isArray(t))t.forEach(function(t){e.classList.add(t)});else{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}else me.error("The element is not exist.")}function we(){var e=window.jQuery||window.$;if(e){var t=e("img");return!(!t||!t.length)&&(t.each(function(){var t=e(this);if(t){var n=t.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&&J(r)&&r[1]&&t.width(r[1]),o&&J(o)&&o[1]&&t.height(o[1])}}}),!0)}var n=document.getElementsByTagName("img");return n.length>0&&(Array.from(n).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&&J(r)&&r[1]&&(t.style.width=r[1]),o&&J(o)&&o[1]&&(t.style.height=o[1])}}}),!0)}function be(){var e=window.MAZEY_DEFINE_LISTENERS;return"object"!=typeof e&&(e={},window.MAZEY_DEFINE_LISTENERS=e),e}function xe(e,t){var n=be()[e];if(n instanceof Array)for(var r=0,o=n.length;r<o;r++)"function"==typeof n[r]&&(void 0===t?n[r]():n[r](t))}function Se(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 Oe(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 Ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ee(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ae(e){var t,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:""}).id,r=function(){},o=new Promise(function(e,n){t=e,r=n}),i=function(){t("loaded")},a=document.createElement("link");a||r(new Error("Not support create link element"));var u="onload"in a,c=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(a.rel="stylesheet",a.type="text/css",a.href=e,void 0!==n&&(a.id=n),document.getElementsByTagName("head")[0].appendChild(a),c||!u)return setTimeout(function(){f(a,i,0)},1),o;function s(){a&&(a.onload=a.onerror=a.onreadystatechange=null),a=null,i()}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?(a.onload=s,a.onerror=function(){s()}):a.onreadystatechange=function(){a&&/loaded|complete/.test(a.readyState)&&s()},o}var Te={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function Pe(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:je({},Te),o=Object.assign(je({},Te),r),i=o.id,a=o.callback,u=o.timeout,c=o.isDefer,s=o.isAsync,f=o.isCrossOrigin,l=o.attributes,p=o.cssUrl,d=document.createElement("script");if(d||Promise.reject("Not support create script element"),p){var g=function(e,t){if(!t)return"";if(se(t))return t;var n=e.split("/");n.pop();var r=n.join("/");return"".concat(r,"/").concat(t)}(e,p);g&&Ae(g).catch(function(e){console.error("Failed to load CSS from ".concat(g,": ").concat(null==e?void 0:e.message))})}var v=document.getElementsByTagName("script")[0];return d.type="text/javascript",c&&(d.defer=!0),s&&(d.async=!0),f&&(d.crossOrigin="anonymous"),i&&(d.id=i),l&&Object.keys(l).forEach(function(e){d.setAttribute(e,l[e])}),d.readyState?d.onreadystatechange=function(){"loaded"!==d.readyState&&"complete"!==d.readyState||(d.onreadystatechange=null,$(a),$(t,"loaded"))}:d.onload=function(){$(a),$(t,"loaded")},d.src=e,v&&v.parentNode.insertBefore(d,v),new Promise(function(e,r){t=e,n=r,u&&setTimeout(n.bind(null,"timeout"),u)})}function ke(e){var t=[],n=window.PerformanceObserver;return!!n&&(J(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}function _e(){return Me.apply(this,arguments)}function Me(){return(Me=i(N.mark(function e(){return N.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(ke("paint")){e.next=1;break}return e.abrupt("return",0);case 1:return e.abrupt("return",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})}));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ce(){return Ne.apply(this,arguments)}function Ne(){return(Ne=i(N.mark(function e(){return N.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(ke("paint")){e.next=1;break}return e.abrupt("return",0);case 1:return e.abrupt("return",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})}));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function De(){return(De=i(N.mark(function e(){return N.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(ke("largest-contentful-paint")){e.next=1;break}return e.abrupt("return",0);case 1:return e.abrupt("return",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})}));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Re(){return(Re=i(N.mark(function e(){return N.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(ke("first-input")){e.next=1;break}return e.abrupt("return",0);case 1:return e.abrupt("return",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})}));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Fe(){return(Fe=i(N.mark(function e(){return N.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(ke("layout-shift")){e.next=1;break}return e.abrupt("return",0);case 1:return e.abrupt("return",new Promise(function(e){var t=new PerformanceObserver(function(n){var r=n.getEntries().reduce(function(e,t){var n=0;return V(t.value)&&(n=t.value),e+n},0);t.disconnect(),e(r)});t.observe({type:"layout-shift",buffered:!0})}));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Be(){return(Be=i(N.mark(function e(){var t,n;return N.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(ke("navigation")){e.next=1;break}return e.abrupt("return",0);case 1:if(window.performance&&window.performance.getEntriesByType){e.next=2;break}return e.abrupt("return",0);case 2:if(t=performance.getEntriesByType("navigation")[0],n=0,t){e.next=3;break}return e.abrupt("return",0);case 3:return n=t.responseStart-t.requestStart,e.abrupt("return",Math.round(n));case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ie(){return Ie=i(N.mark(function e(){var t,n,r,o,i,u,c,s,f,l,p,d,g,v,m,h,y,w,b,x,S,O,E,j,A,T,P,k,_,M,C,D,R,F,B,L,U,z,q,H,Z,W,$,G=arguments;return N.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if($=function(e,t){var n=0;return t&&(n=e-t),n},W=function(){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},Z=function(){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},H=function(){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",u=t.match(/android/i)&&"android",c=t.match(/windows ce/i)&&"windows ce",s=t.match(/windows mobile/i)&&"windows mobile";return(e=n||r||o||i||a||u||c||s?r||o||i||a||u||c||s?"phone":n?"ipad":void 0:"pc")||(e=""),e},q=function(){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},z=function(){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"},U=function(){var e={source:_,os:z(),osVersion:q(),deviceType:H(),network:Z(),screenDirection:W(),unloadTime:f-l,redirectTime:p-d,dnsTime:g-v,tcpTime:m-h,sslTime:$(m,y),responseTime:w-b,downloadTime:x-w,firstPaintTime:B,firstContentfulPaintTime:L,domReadyTime:S-D,onloadTime:O-D,whiteTime:w-D,renderTime:E-D,decodedBodySize:T,encodedBodySize:P};Object.keys(e).forEach(function(t){V(e[t])&&(e[t]<0?e[t]=0:e[t]=Math.round(e[t]))}),V(e.whiteTime)&&e.whiteTime>e.onloadTime&&(e.whiteTime=0);var n={};t||Object.keys(e).forEach(function(t){n[I(t)]=e[t]}),Object.keys(n).length?r(n):r(e)},t=G.length>0&&void 0!==G[0]&&G[0],ke("navigation")){e.next=1;break}return e.abrupt("return",Promise.reject(new Error("navigation is not supported")));case 1:if((n=window.performance)&&"function"==typeof n.getEntries&&"function"==typeof n.getEntriesByType){e.next=2;break}return e.abrupt("return",Promise.reject(new Error("performance is not supported")));case 2:if(o=new Promise(function(e){r=e}),i=null,J(u=n.getEntriesByType("navigation"))&&(i=u[0]),c=new Array(19).fill(0),s=a(c,19),f=s[0],l=s[1],p=s[2],d=s[3],g=s[4],v=s[5],m=s[6],h=s[7],y=s[8],w=s[9],b=s[10],x=s[11],S=s[12],O=s[13],E=s[14],j=s[15],A=s[16],T=s[17],P=s[18],k=n.timing,_="",!i){e.next=3;break}_="PerformanceNavigationTiming",T=(M=i).decodedBodySize,P=M.encodedBodySize,f=(C=i).unloadEventEnd,l=C.unloadEventStart,p=C.redirectEnd,d=C.redirectStart,g=C.domainLookupEnd,v=C.domainLookupStart,m=C.connectEnd,h=C.connectStart,y=C.secureConnectionStart,w=C.responseStart,b=C.requestStart,x=C.responseEnd,S=C.domContentLoadedEventStart,O=C.loadEventStart,E=C.loadEventEnd,j=C.startTime,A=C.fetchStart,e.next=5;break;case 3:if(!k){e.next=4;break}_="PerformanceTiming",f=k.unloadEventEnd,l=k.unloadEventStart,p=k.redirectEnd,d=k.redirectStart,g=k.domainLookupEnd,v=k.domainLookupStart,m=k.connectEnd,h=k.connectStart,y=k.secureConnectionStart,w=k.responseStart,b=k.requestStart,x=k.responseEnd,S=k.domContentLoadedEventStart,O=k.loadEventStart,E=k.loadEventEnd,j=k.navigationStart,A=k.fetchStart,e.next=5;break;case 4:return e.abrupt("return",Promise.reject(new Error("NavigationTiming and Timing are not supported")));case 5:if(D=0,!V(j)){e.next=6;break}D=j,e.next=8;break;case 6:if(!V(A)){e.next=7;break}D=A,e.next=8;break;case 7:return e.abrupt("return",Promise.reject(new Error("startTime, navigationStart or fetchStart are required")));case 8:return e.next=9,Promise.all([Ce(),_e()]);case 9:return R=e.sent,F=a(R,2),B=F[0],L=F[1],V(E)&&E>0?U():window.addEventListener("load",function(){window.setTimeout(function(){U()},0)}),e.abrupt("return",o);case 10:case"end":return e.stop()}},e)})),Ie.apply(this,arguments)}function Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ze="";function qe(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;var e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{var t=navigator.userAgent.toLowerCase();if(!t)return e;var n=function(e){return e.test(t)},r=function(e){var n="",r=t.match(e);return r&&J(r)&&(n=(n=(n=r.toString()).replace(/[^0-9|_.]/g,"")).replace(/_/g,".")),n},o="",i="";n(/windows|win32|win64|wow32|wow64/g)?o="windows":n(/macintosh|macintel/g)?o="macos":n(/x11/g)?o="linux":n(/android|adr/g)?o="android":n(/ios|iphone|ipad|ipod|iwatch/g)&&(o="ios",n(/ipad/g)?i="ipad":n(/iphone/g)?i="iphone":n(/iwatch/g)?i="iwatch":n(/ipod/g)&&(i="ipod")),e=Ue(Ue({},e),{},{system:o,appleType:i});var a="";"windows"===o?n(/windows nt 5.0|windows 2000/g)?a="2000":n(/windows nt 5.1|windows xp/g)?a="xp":n(/windows nt 5.2|windows 2003/g)?a="2003":n(/windows nt 6.0|windows vista/g)?a="vista":n(/windows nt 6.1|windows 7/g)?a="7":n(/windows nt 6.2|windows 8/g)?a="8":n(/windows nt 6.3|windows 8.1/g)?a="8.1":n(/windows nt 10.0|windows 10/g)&&(a="10"):"macos"===o?a=r(/os x [\d._]+/g):"android"===o?a=r(/android [\d._]+/g):"ios"===o&&(a=r(/os [\d._]+/g)),e=Ue(Ue({},e),{},{systemVs:a});var u="";"windows"===o||"macos"===o||"linux"===o?u="desktop":("android"===o||"ios"===o||n(/mobile/g))&&(u="mobile"),e=Ue(Ue({},e),{},{platform:u});var c="",s="";n(/applewebkit/g)?(c="webkit",n(/edge/g)?s="edge":n(/opr/g)?s="opera":n(/chrome/g)?s="chrome":n(/safari/g)&&(s="safari")):n(/gecko/g)&&n(/firefox/g)?(c="gecko",s="firefox"):n(/presto/g)?(c="presto",s="opera"):n(/trident|compatible|msie/g)&&(c="trident",s="iexplore"),e=Ue(Ue({},e),{},{engine:c,supporter:s});var f="";"webkit"===c?f=r(/applewebkit\/[\d._]+/g):"gecko"===c?f=r(/gecko\/[\d._]+/g):"presto"===c?f=r(/presto\/[\d._]+/g):"trident"===c&&(f=r(/trident\/[\d._]+/g)),e=Ue(Ue({},e),{},{engineVs:f});var l="";"chrome"===s?l=r(/chrome\/[\d._]+/g):"safari"===s?l=r(/version\/[\d._]+/g):"firefox"===s?l=r(/firefox\/[\d._]+/g):"opera"===s?l=r(/opr\/[\d._]+/g):"iexplore"===s?l=r(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===s&&(l=r(/edge\/[\d._]+/g)),e=Ue(Ue({},e),{},{supporterVs:l});var p="",d="";n(/micromessenger/g)?(p="wechat",d=r(/micromessenger\/[\d._]+/g)):n(/qqbrowser/g)?(p="qq_browser",d=r(/qqbrowser\/[\d._]+/g)):n(/\sqq/g)?p="qq_app":n(/ucbrowser/g)?(p="uc",d=r(/ucbrowser\/[\d._]+/g)):n(/qihu 360se/g)?p="360":n(/2345explorer/g)?(p="2345",d=r(/2345explorer\/[\d._]+/g)):n(/metasr/g)?p="sougou":n(/lbbrowser/g)?p="liebao":n(/maxthon/g)?(p="maxthon",d=r(/maxthon\/[\d._]+/g)):n(/biliapp/g)&&(p="bilibili"),e=Ue(Ue({},e),{},{shell:p,shellVs:d});var g="";if(window.matchMedia){var v=window.matchMedia("(prefers-color-scheme: dark)"),m=window.matchMedia("(prefers-color-scheme: light)");v.matches?g="dark":m.matches&&(g="light")}return e=Ue(Ue({},e),{},{colorScheme:g}),window.MAZEY_BROWSER_INFO=e,e}catch(t){return me.warn(t),e}}var He="";return e.addClass=ye,e.addEvent=function(e,t){var n=be();void 0===n[e]&&(n[e]=[]),"function"==typeof t&&n[e].push(t)},e.addStyle=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:""};if(!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},e.calLongestCommonSubsequence=function(e,t){return ue(e,t)},e.calLongestCommonSubstring=function(e,t){return ae(e,t)},e.camelCase2Underscore=I,e.camelCaseToKebabCase=function(e){return F(e)},e.cancelBubble=function(e){var t=e||window.event;t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},e.clearHTML=function(e){return K(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},e.clearHtml=function(e){return K(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},e.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},e.convertCamelToKebab=F,e.convertCamelToUnder=B,e.convertHttpToHttps=fe,e.convertKebabToCamel=function(e){var t=e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()});return t.endsWith("-")?t.slice(0,-1):t},e.convertObjectToQuery=function(e){if(e&&0===Object.keys(e).length)return"";var t="?";for(var n in e)t+="".concat(n,"=").concat(e[n],"&");return t.slice(0,-1)},e.convertToHtmlBreaks=Y,e.convertUnderToCamel=function(e){return e.replace(/_([a-z])/g,function(e,t){return t.toUpperCase()})},e.cutCHSString=function(e,t){return te(e,t,arguments.length>2&&void 0!==arguments[2]&&arguments[2])},e.cutZHString=ee,e.debounce=function(e,t,n){var r=null,o=null,i=null,a=null,u=null,c=function(){var s=H()-i;s<t&&s>=0?o=setTimeout(c,t-s):(o=null,n||(u=e.apply(r,a),o||(r=a=null)))};return function(){r=this;for(var s=arguments.length,f=new Array(s),l=0;l<s;l++)f[l]=arguments[l];a=f,i=H();var p=n&&!o;return o||(o=setTimeout(c,t)),p&&(u=e.apply(r,a),r=a=null),u}},e.deepCopy=R,e.deepCopyObject=function(e){return R(e)},e.delCookie=function(e){Oe(e)},e.doFn=$,e.fireEvent=xe,e.floatFixed=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return parseFloat(e).toFixed(t)},e.floatToPercent=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),"".concat(n,"%")},e.formatDate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yyyy-MM-dd";e||(e=new Date);var n=new Date(e),r=n.getHours(),o={yyyy:n.getFullYear(),MM:n.getMonth()+1,dd:n.getDate()<10?"0"+n.getDate():n.getDate(),HH:r<10?"0"+r:r,hh:(r%12||12)<10?"0"+(r%12||12):r%12||12,mm:n.getMinutes()<10?"0"+n.getMinutes():n.getMinutes(),ss:n.getSeconds()<10?"0"+n.getSeconds():n.getSeconds(),a:r<12?"AM":"PM"},i=t||"yyyy-MM-dd";return Object.keys(o).forEach(function(e){var t=o[e];"MM"===e&&Number(t)<=9&&(t="0".concat(t)),i=i.replace(e,String(t))}),i},e.genBrowserAttrs=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",n=qe(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(function(o){var i=n[o];if(i){var a="";e&&e.length>0&&(a="".concat(e).concat(t)),r.push("".concat(a).concat(i))}}),r},e.genCustomConsole=ve,e.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},e.genRndNumString=U,e.genStyleString=function(e,t){var n="";return t&&t.length>0&&(n=t.join(";")+";"),"".concat(e,"{").concat(n,"}")},e.genUniqueNumString=q,e.generateRndNum=z,e.generateUniqueNum=function(){return q(arguments.length>0&&void 0!==arguments[0]?arguments[0]:3)},e.getAllQueryParams=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";""===e&&(e=location.search);var t={};return e.replace(/\??(\w+)=([^&]*)&?/g,function(e,n,r){return void 0===t[n]&&(t[n]=decodeURIComponent(r)),""}),t},e.getBrowserInfo=qe,e.getCLS=function(){return Fe.apply(this,arguments)},e.getCookie=Se,e.getCurrentVersion=function(){return"v4"},e.getDefineListeners=be,e.getDomain=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["hostname"];if(le(e)){var n=new window.URL(e);return t.reduce(function(e,t){return e+=n[t]},"")}var r=document.createElement("a");return r.href=e,t.reduce(function(e,t){return e+=r[t]},"")},e.getFCP=_e,e.getFID=function(){return Re.apply(this,arguments)},e.getFP=Ce,e.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"},e.getFriendlyInterval=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Z,r=(n=Object.assign(Z,n)).type,o=decodeURIComponent;V(e)||(e=new Date(e).getTime()),V(t)||(t=new Date(t).getTime());var i=Number(t)-Number(e),u="",c=a(new Array(4).fill(0),4),s=c[0],f=(c[1],c[2],c[3]),l=o("%20%E5%A4%A9%20"),p=o("%20%E6%97%B6%20"),d=o("%20%E5%88%86%20"),g=o("%20%E7%A7%92");if(i>=0)switch(s=Math.floor(i/1e3/60/60/24),Math.floor(i/1e3/60/60),Math.floor(i/1e3/60),f=Math.floor(i/1e3),r){case"d":u=s;break;case"text":u=(s=Math.floor(i/1e3/60/60/24))+l+Math.floor(i/1e3/60/60%24)+p+Math.floor(i/1e3/60%60)+d+(f=Math.floor(i/1e3%60))+g;break;default:u=f}return u},e.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]:""},e.getLCP=function(){return De.apply(this,arguments)},e.getLocalStorage=function(e){var t=null;if(e){var n=localStorage.getItem(e);n&&(t=JSON.parse(n))}return t},e.getPageMeta=function(e){var t;return document.querySelector&&(null===(t=document.querySelector('meta[name="'.concat(e,'"]')))||void 0===t?void 0:t.getAttribute("content"))||""},e.getPerformance=function(){return Ie.apply(this,arguments)},e.getQueryParam=function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=location.search.substring(1).match(t);return null!==n?decodeURIComponent(n[2]):""},e.getScriptQueryParam=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";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""},e.getSessionStorage=function(e){var t=null;if(e){var n=sessionStorage.getItem(e);n&&(t=JSON.parse(n))}return t},e.getTTFB=function(){return Be.apply(this,arguments)},e.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},e.getUrlHost=function(e){var t="";return!se(e)&&se(e,{strict:!1})&&0===e.indexOf("//")&&(e="https:"+e),le(e)&&(t=new URL(e).host),t},e.getUrlParam=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},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},e.getUrlPath=function(e){var t="";return!se(e)&&se(e,{strict:!1})&&0===e.indexOf("//")&&(e="https:"+e),le(e)&&(t=new URL(e).pathname),t},e.hasClass=function(e,t){if(!e)return me.error("The element is not exist."),!1;for(var n=e.className.split(/\s+/),r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},e.inRate=function(e){return ce(e)},e.invokeEvent=function(e){xe(e)},e.invokeFn=W,e.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},e.isBool=Q,e.isBoolean=function(e){return Q(e)},e.isBrowser=function(){if(ie)return"browser"===ie;var e="undefined"!=typeof window;return e&&(ie="browser"),e},e.isFunction=function(e){return"function"==typeof e},e.isHit=ce,e.isJSONString=L,e.isJsonString=function(e){return L(e)},e.isNonEmptyArray=J,e.isNonEmptyObject=function(e){return!!G(e)&&0!==Object.keys(e).length},e.isNumber=V,e.isPureObject=G,e.isSafePWAEnv=function(){if(ze)return"pwa"===ze;var e=qe();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&&"https:"===window.location.protocol?(ze="pwa",!0):(ze="no-pwa",!1)},e.isString=function(e){return"string"==typeof e},e.isSupportWebp=function(){return He?Promise.resolve("webp"===He):new Promise(function(e){var t=new Image;t.onload=function(){var n=t.width>0&&t.height>0;He=n?"webp":"no-webp",e(n)},t.onerror=function(){He="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})},e.isSupportedEntryType=ke,e.isUdfOrNul=function(e){return null==e},e.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},e.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)},e.isValidHttpUrl=se,e.isValidPhoneNumber=function(e){return/^1\d{10}$/.test(e)},e.isValidUrl=function(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b()!@:%_+.~#?&//=]*)$/.test(e)},e.loadCSS=Ae,e.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})},e.loadScript=Pe,e.loadScriptIfUndefined=function(e,t){return window[e]?Promise.resolve("defined"):Pe(t)},e.longestComSubsequence=ue,e.longestComSubstring=ae,e.mNow=H,e.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)},e.mazeyCon=me,e.newLine=function(e){return Y(e)},e.removeClass=function(e,t){var n;e?(n=(n=(n=(n=" "+e.className+" ").replace(/(\s+)/gi," ")).replace(" "+t+" "," ")).replace(/(^\s+)|(\s+$)/g,""),e.className=n):me.error("The element is not exist.")},e.removeCookie=Oe,e.removeEvent=function(e,t){var n=be(),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]},e.removeHTML=K,e.removeHtml=function(e){return K(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},e.repeatUntilConditionMet=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return!0===e},r=t.interval,o=void 0===r?1e3:r,a=t.times,u=void 0===a?10:a,c=t.context,s=t.args,f=0,l=function(){setTimeout(i(N.mark(function t(){var r;return N.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.apply(c,s);case 1:if(r=t.sent,!(n(r)||++f>=u)){t.next=2;break}return t.abrupt("return");case 2:l();case 3:case"end":return t.stop()}},t)})),o)};"function"!=typeof e&&console.error("Expected a function."),("number"!=typeof o||o<0)&&console.error("Expected a non-negative number for interval."),("number"!=typeof u||u<0)&&console.error("Expected a non-negative number for times."),l()},e.replaceHttp=function(e){return fe(e)},e.sanitizeInput=function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,function(e){return t[e]})},e.setClass=function(e,t){ye(e,t)},e.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 u=location.host;1===u.split(".").length?document.cookie=e+"="+t+i+"; path=/":((o=u.split(".")).shift(),r=r||"."+o.join("."),document.cookie=e+"="+t+i+"; path=/; domain="+r,null!==Se(e)&&Se(e)===t||(r=r||"."+u,document.cookie=e+"="+t+i+"; path=/; domain="+r))},e.setImgSizeBySrc=we,e.setImgWidHeiBySrc=function(){return we()},e.setLocalStorage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e&&localStorage.setItem(e,JSON.stringify(t))},e.setSessionStorage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e&&sessionStorage.setItem(e,JSON.stringify(t))},e.sleep=function(e){return oe.apply(this,arguments)},e.throttle=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=Object.assign({},n);var r=null,o=null,i=null,a=null,u=0,c=function(){u=!1===n.leading?0:H(),i=null,a=e.apply(this,o),i||(r=o=null)};return function(){var s=H();u||!1!==n.leading||(u=s);var f=t-(s-u);r=this;for(var l=arguments.length,p=new Array(l),d=0;d<l;d++)p[d]=arguments[d];return o=p,f<=0||f>t?(i&&(clearTimeout(i),i=null),u=s,a=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(c.bind(r),f)),a}},e.timeCon=he,e.truncateZHString=te,e.unsanitize=function(e){return X(e)},e.unsanitizeInput=X,e.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},e.waitTime=ne,e.windowLoaded=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4,n=function(){},r=new Promise(function(t,r){n=t,e=r});return"complete"===document.readyState?n("complete"):window.addEventListener("load",function(){return n("load")}),setTimeout(function(){return e(Error("timeout"))},t),r},e.zAxiosIsValidRes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{validStatusRange:[200,300],validCode:[0]},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},e}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mazey",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.2",
|
|
4
4
|
"description": "A functional library for daily frontend work.",
|
|
5
5
|
"main": "lib/index.cjs.js",
|
|
6
6
|
"module": "lib/index.esm.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test": "jest",
|
|
20
20
|
"test:debug": "npm run build:debug && npm run test",
|
|
21
21
|
"test:coverage": "npm run build:debug && npx jest --coverage",
|
|
22
|
-
"lint:fix": "eslint --ext 'js,ts,tsx' --fix ./src ./test ./scripts",
|
|
22
|
+
"lint:fix": "eslint --ext 'js,ts,tsx,mjs' --fix ./src/*.ts ./test/*.js ./scripts/*.js ./scripts/*.mjs",
|
|
23
23
|
"docs": "typedoc --readme ./README.md --excludeProtected --excludePrivate --excludeInternal --hideGenerator",
|
|
24
24
|
"preview": "npm run build && npm run test",
|
|
25
25
|
"release": "npm run preview && cross-env SCRIPTS_NPM_PACKAGE_VERSION=$npm_package_version node ./scripts/release.js",
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"@commitlint/config-conventional": "^17.8.1",
|
|
79
79
|
"@rollup/plugin-babel": "^6.0.3",
|
|
80
80
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
81
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
81
82
|
"@rollup/plugin-terser": "^0.4.4",
|
|
82
83
|
"@types/jquery": "^3.5.29",
|
|
83
84
|
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
3
|
+
const fs = require("fs");
|
|
2
4
|
|
|
3
5
|
const newName = process.argv[2];
|
|
4
6
|
if (!newName) {
|
|
5
|
-
console.error(
|
|
7
|
+
console.error("Error: New name argument is required.");
|
|
6
8
|
process.exit(1);
|
|
7
9
|
}
|
|
8
10
|
|
|
9
|
-
const pkgPath =
|
|
10
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath,
|
|
11
|
+
const pkgPath = "package.json";
|
|
12
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
11
13
|
pkg.name = newName;
|
|
12
14
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
|
|
13
15
|
console.log(`package.json name changed to "${newName}"`);
|
package/scripts/git-helper.js
CHANGED
|
@@ -5,33 +5,33 @@ const execa = require("execa");
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Release this project with version by `process.env.VERSION` or `package.json`.
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* Usage:
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
11
|
* ```javascript
|
|
12
12
|
* const pkgVersion = process.env.VERSION || require("../package.json").version;
|
|
13
13
|
* release(pkgVersion);
|
|
14
14
|
* ```
|
|
15
|
-
*
|
|
15
|
+
*
|
|
16
16
|
* It will be more straightforward if you use the development dependence CrossEnv.
|
|
17
|
-
*
|
|
17
|
+
*
|
|
18
18
|
* ```shell
|
|
19
19
|
* # Install
|
|
20
20
|
* npm i cross-env -D
|
|
21
|
-
*
|
|
21
|
+
*
|
|
22
22
|
* # scripts
|
|
23
23
|
* cross-env SCRIPTS_NPM_PACKAGE_VERSION=$npm_package_version node ./scripts/release.js
|
|
24
24
|
* ```
|
|
25
|
-
*
|
|
25
|
+
*
|
|
26
26
|
* ```javascript
|
|
27
27
|
* // release.js
|
|
28
28
|
* release();
|
|
29
29
|
* ```
|
|
30
|
-
*
|
|
30
|
+
*
|
|
31
31
|
* @param {string} ver Version
|
|
32
32
|
* @returns {void}
|
|
33
33
|
*/
|
|
34
|
-
async function release (ver, { canGenerateToc = false, defaultBranch = "main" } = {}) {
|
|
34
|
+
async function release (ver, { canGenerateToc = false, generateTocOnly = false, defaultBranch = "main" } = {}) {
|
|
35
35
|
if (!ver) {
|
|
36
36
|
ver = process.env.SCRIPTS_NPM_PACKAGE_VERSION;
|
|
37
37
|
}
|
|
@@ -47,6 +47,9 @@ async function release (ver, { canGenerateToc = false, defaultBranch = "main" }
|
|
|
47
47
|
if (canGenerateToc) {
|
|
48
48
|
generateToc();
|
|
49
49
|
}
|
|
50
|
+
if (generateTocOnly) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
50
53
|
// Commit
|
|
51
54
|
await gitCommit(`${releaseVersion} stage`);
|
|
52
55
|
// Marge
|
|
@@ -58,8 +61,6 @@ async function release (ver, { canGenerateToc = false, defaultBranch = "main" }
|
|
|
58
61
|
await gitCommit(releaseVersion);
|
|
59
62
|
// Push
|
|
60
63
|
console.log("Pushing to the remote Git...");
|
|
61
|
-
// await execa("git", ["tag", "-a", `${releaseVersion}`, "-m", `Release ${releaseVersion}`]);
|
|
62
|
-
// await execa("git", ["push", "origin", `refs/tags/${releaseVersion}`]);
|
|
63
64
|
await gitTagPush(releaseVersion);
|
|
64
65
|
await gitPush();
|
|
65
66
|
console.log("All done.");
|
|
@@ -67,12 +68,12 @@ async function release (ver, { canGenerateToc = false, defaultBranch = "main" }
|
|
|
67
68
|
|
|
68
69
|
/**
|
|
69
70
|
* Push git tag.
|
|
70
|
-
*
|
|
71
|
+
*
|
|
71
72
|
* @example
|
|
72
73
|
* ```
|
|
73
74
|
* await gitTagPush("v1.0.0");
|
|
74
75
|
* ```
|
|
75
|
-
*
|
|
76
|
+
*
|
|
76
77
|
* @param {string} ver Release version
|
|
77
78
|
* @returns {boolean} Is success
|
|
78
79
|
*/
|
package/scripts/release.js
CHANGED
|
@@ -6,4 +6,4 @@ const pkgVersion = process.env.SCRIPTS_NPM_PACKAGE_VERSION || process.env.VERSIO
|
|
|
6
6
|
|
|
7
7
|
console.log("release: SCRIPTS_NPM_PACKAGE_VERSION", process.env.SCRIPTS_NPM_PACKAGE_VERSION);
|
|
8
8
|
|
|
9
|
-
release(pkgVersion, { canGenerateToc: true });
|
|
9
|
+
release(pkgVersion, { canGenerateToc: true, generateTocOnly: true });
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* eslint-disable no-undef */
|
|
3
3
|
import { babel } from "@rollup/plugin-babel";
|
|
4
4
|
import commonjs from "@rollup/plugin-commonjs";
|
|
5
|
+
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
|
5
6
|
import rollupTypescript from "rollup-plugin-typescript2";
|
|
6
7
|
import { DEFAULT_EXTENSIONS } from "@babel/core";
|
|
7
8
|
import cleaner from "rollup-plugin-cleaner";
|
|
@@ -23,6 +24,9 @@ const banner =
|
|
|
23
24
|
" * Released under the MIT License.\n" +
|
|
24
25
|
" */";
|
|
25
26
|
const plugins = [
|
|
27
|
+
nodeResolve({
|
|
28
|
+
extensions: [ ".mjs", ".js", ".json", ".node", ".ts" ],
|
|
29
|
+
}),
|
|
26
30
|
rollupTypescript(),
|
|
27
31
|
commonjs({
|
|
28
32
|
include: /node_modules/,
|
|
@@ -69,7 +73,7 @@ const gTsConf = {
|
|
|
69
73
|
|
|
70
74
|
if (debugMode !== "open") {
|
|
71
75
|
iifePlugins.push(
|
|
72
|
-
// Add
|
|
76
|
+
// Add Minification
|
|
73
77
|
// https://github.com/TrySound/rollup-plugin-terser
|
|
74
78
|
terser({ // https://github.com/terser/terser
|
|
75
79
|
format: {
|
package/lib/browser.d.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import type { BrowserInfo } from "./typing";
|
|
2
|
-
/**
|
|
3
|
-
* EN: Detect the margin of Safety. Determine if it is a secure PWA environment that it can run.
|
|
4
|
-
*
|
|
5
|
-
* ZH: 判断是否是安全的 PWA 环境。
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
*
|
|
9
|
-
* ```javascript
|
|
10
|
-
* import { isSafePWAEnv } from "mazey";
|
|
11
|
-
*
|
|
12
|
-
* const ret = isSafePWAEnv();
|
|
13
|
-
* console.log(ret);
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* Output:
|
|
17
|
-
*
|
|
18
|
-
* ```text
|
|
19
|
-
* true
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @environment Browser
|
|
23
|
-
* @returns {boolean} true 是
|
|
24
|
-
* @category Browser Information
|
|
25
|
-
*/
|
|
26
|
-
export declare function isSafePWAEnv(): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* EN: Provides detailed information about the browser.
|
|
29
|
-
*
|
|
30
|
-
* ZH: 返回有关浏览器的详细信息。
|
|
31
|
-
*
|
|
32
|
-
* Usage:
|
|
33
|
-
*
|
|
34
|
-
* ```javascript
|
|
35
|
-
* import { getBrowserInfo } from "mazey";
|
|
36
|
-
*
|
|
37
|
-
* const ret = getBrowserInfo();
|
|
38
|
-
* console.log(ret);
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* Output:
|
|
42
|
-
*
|
|
43
|
-
* ```text
|
|
44
|
-
* {"engine":"webkit","engineVs":"537.36","platform":"desktop","supporter":"chrome","supporterVs":"85.0.4183.121","system":"windows","systemVs":"10"}
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* Results:
|
|
48
|
-
*
|
|
49
|
-
* | Attribute | Description | Type | Values |
|
|
50
|
-
* | :------------ | :------------ | :------------ | :------------ |
|
|
51
|
-
* | **system** | System | string | android, ios, windows, macos, linux |
|
|
52
|
-
* | systemVs | System version | string | Windows: 2000, xp, 2003, vista, 7, 8, 8.1, 10 macOS: ... |
|
|
53
|
-
* | platform | Platform | string | desktop, mobile |
|
|
54
|
-
* | engine | Engine | string | webkit, gecko, presto, trident |
|
|
55
|
-
* | engineVs | Engine version | string | - |
|
|
56
|
-
* | supporter | Supporter | string | edge, opera, chrome, safari, firefox, iexplore |
|
|
57
|
-
* | supporterVs | Supporter version | string | - |
|
|
58
|
-
* | shell | Shell | string | (Optional) wechat, qq_browser, qq_app, uc, 360, 2345, sougou, liebao, maxthon, bilibili |
|
|
59
|
-
* | shellVs | Shell version | string | (Optional) 20/... |
|
|
60
|
-
* | appleType | Apple device type | string | (Optional) ipad, iphone, ipod, iwatch |
|
|
61
|
-
*
|
|
62
|
-
* Example: Determine the environment of the mobile QQ.
|
|
63
|
-
*
|
|
64
|
-
* ```javascript
|
|
65
|
-
* const { system, shell } = getBrowserInfo();
|
|
66
|
-
* const isMobileQQ = ["android", "ios"].includes(system) && ["qq_browser", "qq_app"].includes(shell);
|
|
67
|
-
* ```
|
|
68
|
-
*
|
|
69
|
-
* @environment Browser
|
|
70
|
-
* @returns Browser information
|
|
71
|
-
* @category Browser Information
|
|
72
|
-
*/
|
|
73
|
-
export declare function getBrowserInfo(): BrowserInfo;
|
|
74
|
-
/**
|
|
75
|
-
* EN: Generate browser attributes.
|
|
76
|
-
*
|
|
77
|
-
* ZH: 生成浏览器属性。
|
|
78
|
-
*
|
|
79
|
-
* Usage:
|
|
80
|
-
*
|
|
81
|
-
* ```javascript
|
|
82
|
-
* import { genBrowserAttrs } from "mazey";
|
|
83
|
-
*
|
|
84
|
-
* const attrs = genBrowserAttrs();
|
|
85
|
-
* console.log(attrs);
|
|
86
|
-
* ```
|
|
87
|
-
*
|
|
88
|
-
* Output:
|
|
89
|
-
*
|
|
90
|
-
* ```text
|
|
91
|
-
* ["windows", "desktop", "webkit", "chrome"]
|
|
92
|
-
* ```
|
|
93
|
-
*
|
|
94
|
-
* @environment Browser
|
|
95
|
-
* @param {string} prefix
|
|
96
|
-
* @returns {array} Browser attributes
|
|
97
|
-
* @category Browser Information
|
|
98
|
-
*/
|
|
99
|
-
export declare function genBrowserAttrs(prefix?: string, separator?: string): string[];
|
|
100
|
-
/**
|
|
101
|
-
* Detect webp support.
|
|
102
|
-
*
|
|
103
|
-
* Usage:
|
|
104
|
-
*
|
|
105
|
-
* ```javascript
|
|
106
|
-
* import { isSupportWebp } from "mazey";
|
|
107
|
-
*
|
|
108
|
-
* isSupportWebp().then(res => {
|
|
109
|
-
* console.log("isSupportWebp:", res);
|
|
110
|
-
* });
|
|
111
|
-
* ```
|
|
112
|
-
*
|
|
113
|
-
* Output:
|
|
114
|
-
*
|
|
115
|
-
* ```text
|
|
116
|
-
* isSupportWebp: true
|
|
117
|
-
* ```
|
|
118
|
-
*
|
|
119
|
-
* Reference: [Detect WEBP Support with JavaScript](https://davidwalsh.name/detect-webp)
|
|
120
|
-
*
|
|
121
|
-
* @category Browser Information
|
|
122
|
-
*/
|
|
123
|
-
export declare function isSupportWebp(): Promise<boolean>;
|
|
124
|
-
//# sourceMappingURL=browser.d.ts.map
|
package/lib/browser.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,UAAU,CAAC;AAKlB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,IAAI,OAAO,CA4CtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAiO5C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAAC,MAAM,SAAK,EAAE,SAAS,SAAM,GAAG,MAAM,EAAE,CAetE;AAID;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAkBhD"}
|
package/lib/calc.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EN: Computes the longest common substring of two strings.
|
|
3
|
-
*
|
|
4
|
-
* ZH: 计算两个字符串的最长公共子串。
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
*
|
|
8
|
-
* ```javascript
|
|
9
|
-
* import { longestComSubstring } from "mazey";
|
|
10
|
-
*
|
|
11
|
-
* const ret = longestComSubstring("fish", "finish");
|
|
12
|
-
* console.log(ret);
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* Output:
|
|
16
|
-
*
|
|
17
|
-
* ```text
|
|
18
|
-
* 3
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @param {string} aStr String
|
|
22
|
-
* @param {string} bStr String
|
|
23
|
-
* @returns {number} Length
|
|
24
|
-
* @category Calculate and Formula
|
|
25
|
-
*/
|
|
26
|
-
export declare function longestComSubstring(aStr: string, bStr: string): number;
|
|
27
|
-
/**
|
|
28
|
-
* Alias of `longestComSubstring`.
|
|
29
|
-
*
|
|
30
|
-
* @hidden
|
|
31
|
-
*/
|
|
32
|
-
export declare function calLongestCommonSubstring(aStr: string, bStr: string): number;
|
|
33
|
-
/**
|
|
34
|
-
* EN: Computes the longest common subsequence of two strings.
|
|
35
|
-
*
|
|
36
|
-
* ZH: 计算两个字符串的最长公共子序列。
|
|
37
|
-
*
|
|
38
|
-
* Usage:
|
|
39
|
-
*
|
|
40
|
-
* ```javascript
|
|
41
|
-
* import { longestComSubsequence } from "mazey";
|
|
42
|
-
*
|
|
43
|
-
* const ret = longestComSubsequence("fish", "finish");
|
|
44
|
-
* console.log(ret);
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* Output:
|
|
48
|
-
*
|
|
49
|
-
* ```text
|
|
50
|
-
* 4
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* @param {string} aStr 字符串
|
|
54
|
-
* @param {string} bStr 字符串
|
|
55
|
-
* @returns {number} 长度
|
|
56
|
-
* @category Calculate and Formula
|
|
57
|
-
*/
|
|
58
|
-
export declare function longestComSubsequence(aStr: string, bStr: string): number;
|
|
59
|
-
/**
|
|
60
|
-
* Alias of `longestComSubsequence`.
|
|
61
|
-
*
|
|
62
|
-
* @hidden
|
|
63
|
-
*/
|
|
64
|
-
export declare function calLongestCommonSubsequence(aStr: string, bStr: string): number;
|
|
65
|
-
/**
|
|
66
|
-
* EN: Hit probability (1% ~ 100%).
|
|
67
|
-
*
|
|
68
|
-
* ZH: 百分位概率。
|
|
69
|
-
*
|
|
70
|
-
* Usage:
|
|
71
|
-
*
|
|
72
|
-
* ```javascript
|
|
73
|
-
* import { isHit } from "mazey";
|
|
74
|
-
*
|
|
75
|
-
* const ret = isHit(0.5); // 0.01 ~ 1 true/false
|
|
76
|
-
* console.log(ret);
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* Output:
|
|
80
|
-
*
|
|
81
|
-
* ```text
|
|
82
|
-
* true
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
|
-
* Example: Test the precision.
|
|
86
|
-
*
|
|
87
|
-
* ```javascript
|
|
88
|
-
* let trueCount = 0;
|
|
89
|
-
* let falseCount = 0;
|
|
90
|
-
* new Array(1000000).fill(0).forEach(() => {
|
|
91
|
-
* if (isHit(0.5)) {
|
|
92
|
-
* trueCount++;
|
|
93
|
-
* } else {
|
|
94
|
-
* falseCount++;
|
|
95
|
-
* }
|
|
96
|
-
* });
|
|
97
|
-
* console.log(trueCount, falseCount);
|
|
98
|
-
* ```
|
|
99
|
-
*
|
|
100
|
-
* Output:
|
|
101
|
-
*
|
|
102
|
-
* ```text
|
|
103
|
-
* 499994 500006
|
|
104
|
-
* ```
|
|
105
|
-
*
|
|
106
|
-
* @param {number} rate 0.1 ~ 1 => 1% ~ 100%
|
|
107
|
-
* @returns {boolean} true 命中
|
|
108
|
-
* @category Calculate and Formula
|
|
109
|
-
*/
|
|
110
|
-
export declare function isHit(rate: number): boolean;
|
|
111
|
-
/**
|
|
112
|
-
* Alias of `isHit`.
|
|
113
|
-
*
|
|
114
|
-
* @hidden
|
|
115
|
-
*/
|
|
116
|
-
export declare function inRate(rate: number): boolean;
|
|
117
|
-
//# sourceMappingURL=calc.d.ts.map
|
package/lib/calc.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calc.d.ts","sourceRoot":"","sources":["../src/calc.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAqBtE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CA8BxE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAK3C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5C"}
|