mazey 5.7.1 → 5.7.3
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/README.md +24 -0
- package/README.zh-CN.md +24 -0
- package/lib/index.cjs.js +2 -2
- package/lib/index.d.ts +35 -1
- package/lib/index.esm.js +2 -2
- package/lib/mazey.min.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -140,6 +140,7 @@ There are some examples maintained by hand below. For more information, please c
|
|
|
140
140
|
- [genStyleString](#genstylestring)
|
|
141
141
|
- [newLine](#newline)
|
|
142
142
|
- [Calculate and Formula](#calculate-and-formula)
|
|
143
|
+
- [calculateAspectRatio](#calculateaspectratio)
|
|
143
144
|
- [calculateCAGR](#calculatecagr)
|
|
144
145
|
- [inRate](#inrate)
|
|
145
146
|
- [longestComSubstring](#longestcomsubstring)
|
|
@@ -1346,6 +1347,29 @@ a<br /><br />bc
|
|
|
1346
1347
|
|
|
1347
1348
|
### Calculate and Formula
|
|
1348
1349
|
|
|
1350
|
+
#### calculateAspectRatio
|
|
1351
|
+
|
|
1352
|
+
Calculate the exact simplified aspect ratio of positive safe-integer dimensions. The function reduces the width and height using their greatest common divisor and returns the result with a lowercase `x` separator. It does not approximate the result to a commonly named image or video ratio.
|
|
1353
|
+
|
|
1354
|
+
```javascript
|
|
1355
|
+
import { calculateAspectRatio } from "mazey";
|
|
1356
|
+
|
|
1357
|
+
const portraitRatio = calculateAspectRatio(900, 1200);
|
|
1358
|
+
const landscapeRatio = calculateAspectRatio(1920, 1080);
|
|
1359
|
+
|
|
1360
|
+
console.log(portraitRatio);
|
|
1361
|
+
console.log(landscapeRatio);
|
|
1362
|
+
```
|
|
1363
|
+
|
|
1364
|
+
Output:
|
|
1365
|
+
|
|
1366
|
+
```text
|
|
1367
|
+
3x4
|
|
1368
|
+
16x9
|
|
1369
|
+
```
|
|
1370
|
+
|
|
1371
|
+
For example, `calculateAspectRatio(3440, 1440)` returns the mathematically exact ratio `"43x18"`, not the approximate label `"21x9"`. Invalid or unsafe-integer dimensions throw `TypeError`; zero and negative dimensions throw `RangeError`.
|
|
1372
|
+
|
|
1349
1373
|
#### calculateCAGR
|
|
1350
1374
|
|
|
1351
1375
|
Calculate an investment's Compound Annual Growth Rate (CAGR) from its start date, end date, and total return over the complete period.
|
package/README.zh-CN.md
CHANGED
|
@@ -111,6 +111,7 @@ isNumber(z, { isInfinityAsNumber: true }); // 输出: true
|
|
|
111
111
|
- [genStyleString](#genstylestring)
|
|
112
112
|
- [newLine](#newline)
|
|
113
113
|
- [计算与公式](#计算与公式)
|
|
114
|
+
- [calculateAspectRatio](#calculateaspectratio)
|
|
114
115
|
- [calculateCAGR](#calculatecagr)
|
|
115
116
|
- [inRate](#inrate)
|
|
116
117
|
- [longestComSubstring](#longestcomsubstring)
|
|
@@ -999,6 +1000,29 @@ a<br /><br />bc
|
|
|
999
1000
|
|
|
1000
1001
|
### 计算与公式
|
|
1001
1002
|
|
|
1003
|
+
#### calculateAspectRatio
|
|
1004
|
+
|
|
1005
|
+
根据正安全整数形式的宽度和高度,计算精确的最简宽高比。函数使用最大公约数约分,并使用小写 `x` 连接结果。函数不会将结果近似为常见的图片或视频宽高比。
|
|
1006
|
+
|
|
1007
|
+
```javascript
|
|
1008
|
+
import { calculateAspectRatio } from "mazey";
|
|
1009
|
+
|
|
1010
|
+
const portraitRatio = calculateAspectRatio(900, 1200);
|
|
1011
|
+
const landscapeRatio = calculateAspectRatio(1920, 1080);
|
|
1012
|
+
|
|
1013
|
+
console.log(portraitRatio);
|
|
1014
|
+
console.log(landscapeRatio);
|
|
1015
|
+
```
|
|
1016
|
+
|
|
1017
|
+
输出:
|
|
1018
|
+
|
|
1019
|
+
```text
|
|
1020
|
+
3x4
|
|
1021
|
+
16x9
|
|
1022
|
+
```
|
|
1023
|
+
|
|
1024
|
+
例如,`calculateAspectRatio(3440, 1440)` 返回数学意义上精确的 `"43x18"`,而不是近似标签 `"21x9"`。无效或不安全的整数尺寸会抛出 `TypeError`。零或负数尺寸会抛出 `RangeError`。
|
|
1025
|
+
|
|
1002
1026
|
#### calculateCAGR
|
|
1003
1027
|
|
|
1004
1028
|
根据投资的开始日期、结束日期和整个周期的总回报率,计算复合年增长率(Compound Annual Growth Rate,CAGR)。
|
package/lib/index.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Mazey v5.7.
|
|
2
|
+
* Mazey v5.7.3 https://github.com/chengchuu/mazey
|
|
3
3
|
* (c) 2018-2026 Cheng
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
"use strict";function e(e){try{return Date.prototype.getTime.call(e)}catch(e){return null}}const t=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/,n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;function r(e,t,n,r,o,i,s=0,a=!1){const c=new Date(0);return a?(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getUTCFullYear()===e&&c.getUTCMonth()===t-1&&c.getUTCDate()===n&&c.getUTCHours()===r&&c.getUTCMinutes()===o&&c.getUTCSeconds()===i&&c.getUTCMilliseconds()===s):(c.setFullYear(e,t-1,n),c.setHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getFullYear()===e&&c.getMonth()===t-1&&c.getDate()===n&&c.getHours()===r&&c.getMinutes()===o&&c.getSeconds()===i&&c.getMilliseconds()===s)}function o(e,t,n,r,o,i,s=0){const a=new Date(0);return a.setFullYear(e,t-1,n),a.setHours(r,o,i,s),a}function i(i){if("number"==typeof i){const e=new Date(i);return Number.isFinite(i)&&Number.isFinite(e.getTime())?e:null}if("object"==typeof i&&null!==i){const t=e(i);return null!==t&&Number.isFinite(t)?new Date(t):null}if("string"!=typeof i)return null;const s=i.trim();if(!s)return null;const a=t.exec(s);if(a){const[e,t,n,i="0",s="0",c="0"]=a.slice(1),[u,l,f,p,d,m]=[e,t,n,i,s,c].map(Number);return r(u,l,f,p,d,m)?o(u,l,f,p,d,m):null}const c=n.exec(s);if(!c)return null;const[u,l,f,p,d,m="0",g="",h]=c.slice(1),y=Number(`${g}00`.slice(0,3));if(!r(Number(u),Number(l),Number(f),Number(p),Number(d),Number(m),y,!0))return null;if("Z"!==h){const e=Number(h.slice(1,3)),t=Number(h.slice(4,6));if(e>23||t>59)return null}return function(e,t,n,r,o,i,s,a){const c=new Date(0);if(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),"Z"===a)return c;const u="+"===a[0]?1:-1,l=60*Number(a.slice(1,3))+Number(a.slice(4,6));return new Date(c.getTime()-u*l*60*1e3)}(Number(u),Number(l),Number(f),Number(p),Number(d),Number(m),y,h)}const s=/^(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function a(e,t){const n=String(e);return n.length>=t?n:`${"0".repeat(t-n.length)}${n}`}function c(){return Date.now()}const u={type:"d"};function l(e){return"string"==typeof e&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T"):e}function f(e=0,t=0,n=u){n=Object.assign({},u,n);const{type:r}=n;"number"==typeof e&&Number.isFinite(e)||(e=new Date(l(e)).getTime()),"number"==typeof t&&Number.isFinite(t)||(t=new Date(l(t)).getTime());const o=Number(t)-Number(e);let i="",[s,a,c,f]=new Array(4).fill(0);if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60),c=Math.floor(o/1e3/60),f=Math.floor(o/1e3),r){case"d":i=s;break;case"text":s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60%24),c=Math.floor(o/1e3/60%60),f=Math.floor(o/1e3%60),i=[{value:s,unit:"day"},{value:a,unit:"hour"},{value:c,unit:"minute"},{value:f,unit:"second"}].filter(({value:e})=>e>0).map(({value:e,unit:t})=>p(e,t)).join(" ")||p(0,"second");break;default:i=f}return i}function p(e,t){const n=Math.round(10*e)/10;return`${n} ${1===n?t:`${t}s`}`}function d(e,t){const n=Math.max(1,Math.round(e));return`about ${n} ${t}${1===n?"":"s"}`}function m(e,t="yyyy-MM-dd"){void 0===e&&(e=new Date);const n=new Date(e);if(!Number.isFinite(n.getTime()))throw new RangeError("Invalid date");const 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"};let i=t||"yyyy-MM-dd";return Object.keys(o).forEach(e=>{let t=o[e];"MM"===e&&Number(t)<=9&&(t=`0${t}`),i=i.split(e).join(String(t))}),i}function g(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));let i=0;for(let s=0;s<n;++s)for(let n=0;n<r;++n)if(e[s]===t[n]){let e=0;s>0&&n>0&&(e=o[s-1][n-1]),o[s][n]=e+1,i=Math.max(i,o[s][n])}return i}function h(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));for(let i=0;i<n;++i)for(let n=0;n<r;++n)if(e[i]===t[n]){let e=0;i>0&&n>0&&(e=o[i-1][n-1]),o[i][n]=e+1}else{let[e,t]=[0,0];n>0&&(e=o[i][n-1]),i>0&&(t=o[i-1][n]),o[i][n]=Math.max(e,t)}return o[n-1][r-1]}function y(e){return Math.random()<e}const w=Function.prototype.toString.call(Object);function b(e,t,n){const r=Object.getOwnPropertyDescriptor(t,n)?.get;if(!r)return!1;try{return r.call(e),!0}catch(e){return!1}}function x(e){return null===e||"object"!=typeof e?e:v(e,new WeakMap)}function v(t,n){if(null===t||"object"!=typeof t)return t;const r=t,o=n.get(r);if(void 0!==o)return o;const i=e(r);if(null!==i){const e=new Date(i);return n.set(r,e),e}const s=function(e){const t=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get;if(!t)return null;try{return t.call(e)}catch(e){return null}}(r);if(null!==s){const e=t,o=new RegExp(s,function(e){return e.flags}(e));return o.lastIndex=e.lastIndex,n.set(r,o),o}if("undefined"!=typeof ArrayBuffer&&b(r,ArrayBuffer.prototype,"byteLength")){const e=ArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof SharedArrayBuffer&&b(r,SharedArrayBuffer.prototype,"byteLength")){const e=SharedArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)){const e=v(t.buffer,n),o="undefined"!=typeof DataView&&b(r,DataView.prototype,"byteLength")?new DataView(e,t.byteOffset,t.byteLength):new t.constructor(e,t.byteOffset,t.length);return n.set(r,o),o}if("undefined"!=typeof Map&&b(r,Map.prototype,"size")){const e=new Map;return n.set(r,e),Map.prototype.forEach.call(t,(t,r)=>{e.set(v(r,n),v(t,n))}),e}if("undefined"!=typeof Set&&b(r,Set.prototype,"size")){const e=new Set;return n.set(r,e),Set.prototype.forEach.call(t,t=>{e.add(v(t,n))}),e}const a=Array.isArray(t),c=Object.getPrototypeOf(t),u=function(e){const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.hasOwn(t,"constructor")?t.constructor:null;return"function"==typeof n&&Function.prototype.toString.call(n)===w}(r),l=!a&&!u&&function(e){const t=Object.getPrototypeOf(e),n=t?.constructor;return"function"==typeof n&&-1===Function.prototype.toString.call(n).indexOf("[native code]")}(r);if(!a&&!u&&!l)return n.set(r,t),t;const f=a?new Array(t.length):Object.create(l?Object.prototype:c);return n.set(r,f),function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}(r).forEach(e=>{if(a&&"length"===e)return;const t=Object.getOwnPropertyDescriptor(r,e);t&&("value"in t&&(t.value=v(t.value,n)),Object.defineProperty(f,e,t))}),f}function E(e){const t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function T(e){const t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function S(e){return T(e)}function A(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.replace(/[^A-Za-z0-9_$]/g,"_").toUpperCase();return/^[A-Za-z_$]/.test(t)?t:`_${t}`}function C(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){}return!1}function N(e=5){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e--;)t+=Math.floor(10*Math.random());return t}function $(e=5){return N(e)}function O(e=3){const[t,n]=[c(),$(e||3)];return t+n}function _(e,t={}){const{isNaNAsNumber:n=!1,isInfinityAsNumber:r=!1,isUnFiniteAsNumber:o=!1}=t;return"number"==typeof e&&(!(!0!==r&&!0!==o&&!isFinite(e))&&!(!n&&isNaN(e)))}function M(e,...t){let n=null;return e&&"function"==typeof e&&(n=e(...t)),n}function j(e,...t){return M(e,...t)}function D(e){let t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function L(e){const t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function k(e){return"boolean"==typeof e}function P(e){if(!e)return"";const t=new RegExp("\\n","g");return e.replace(t,"<br />")}function F(e,t={}){const{removeNewLine:n=!1}=t;let r="";return e&&(r=e.replace(/<\/?.+?>/g,""),n&&(r=r.replace(/[\r\n]/g,""))),r}function U(e){const t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,e=>t[e])}function R(e,t,n={hasDot:!1,dotText:"..."}){if(n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){let r=0,o="";const i=/[^\x00-\xff]/g;let s="";const a=e.replace(i,"**").length;for(let n=0;n<a&&(s=e.charAt(n).toString(),null!=s.match(i)?r+=2:r++,!(r>t));n++)o+=s;return n.hasDot&&a>t&&(o+=n.dotText),o}return""}function z(e,t,n=!1){return R(e,t,{hasDot:n})}const I=["B","KB","MB","GB","TB"];function B(e,t={}){const{base:n=1024,fractionDigits:r=1,invalidValue:o=""}=t;if(!Number.isFinite(e)||e<0||1e3!==n&&1024!==n||!Number.isInteger(r)||r<0||r>20)return o;let i=e,s=0;for(;i>=n&&s<I.length-1;)i/=n,s+=1;return 0===s?`${Number(i.toFixed(r))} ${I[s]}`:`${i.toFixed(r)} ${I[s]}`}function H(e){return/^1\d{10}$/.test(e)}const q=H;async function W(e){return new Promise(t=>{setTimeout(()=>{t(e)},e)})}let V="";function Y(e,t){const n=e[t];if(void 0!==n&&"string"!=typeof n)throw new TypeError(`manifest.${t} must be a string when provided`);return n}function Z(e){if(void 0===e)return{name:""};if("string"==typeof e)return{name:e.trim()};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest.author must be a string or object");const t=e,n={name:""};for(const e of["name","email","url"]){const r=t[e];if(void 0!==r&&"string"!=typeof r)throw new TypeError(`manifest.author.${e} must be a string when provided`);if("string"==typeof r){const t=r.trim();("name"===e||t)&&(n[e]=t)}}return n}function J(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}}function Q(e){const t=e.indexOf("#"),n=-1===t?e:e.slice(0,t),r=n.indexOf("?"),o=/^(?:[a-z][a-z\d+.-]*:)?\/\//i.test(n)||"/"===n.charAt(0),i=-1===r?o?"":n:n.slice(r+1);return i?i.split("&").reduce((e,t)=>{if(!t||-1===t.indexOf("="))return e;const n=t.indexOf("=");return e.push([J(t.slice(0,n)),J(t.slice(n+1))]),e},[]):[]}function G(e,t){return Q(e).filter(([e])=>e===t).map(([,e])=>e)}const K=/^(?=.{1,39}$)(?!.*--)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/,X=/^(?=.{1,100}$)(?!\.{1,2}$)[A-Za-z0-9_.-]+$/;function ee(){return new Error("The value does not identify one supported GitHub repository")}function te(e,t){const n=t.replace(/\.git$/i,"");if(!K.test(e)||!X.test(n))throw ee();const r=`${e}/${n}`;return{owner:e,name:n,slug:r,url:`https://github.com/${r}`}}function ne(e){return void 0===e||Number(e)<=65535}function re(e){const t=e.split(".");return 4===t.length&&t.every(e=>/^\d{1,3}$/.test(e)&&(1===e.length||"0"!==e.charAt(0))&&Number(e)<=255)}function oe(e){const t=e.split("::");if(t.length>2)return!1;const n=2===t.length;let r=[];t.forEach(e=>{e&&(r=r.concat(e.split(":")))});let o=0;for(let e=0;e<r.length;e++){const t=r[e];if(-1!==t.indexOf(".")){if(e!==r.length-1||!re(t))return!1;o+=2}else{if(!/^[0-9a-f]{1,4}$/i.test(t))return!1;o+=1}}return n?o<8:8===o}function ie(e){const t=e.match(/^\[([0-9a-f:.]+)\]$/i);if(t)return oe(t[1]);if("."===e.charAt(e.length-1)&&(e=e.slice(0,-1)),re(e))return!0;const n=e.split(".");return!(n.length<2||n.some(e=>!e||!/^[a-z\d-]+$/i.test(e)||"-"===e.charAt(0)||"-"===e.charAt(e.length-1)))&&!/^\d+$/.test(n[n.length-1])}function se(e,t={strict:!0}){if("string"!=typeof e||!e||e.trim()!==e)return!1;const n=/^https?:\/\/[^/\\]/i.test(e),r=/^\/\/[^/\\]/.test(e);if(!n&&(t.strict||!r))return!1;const o=r?`http:${e}`:e;if(!function(e){const t=e.match(/^https?:\/\/([^/?#]+)(?:[/?#][^\s<>"`]*)?$/i);if(!t||-1!==t[1].indexOf("@"))return!1;const n=t[1],r=n.match(/^\[([0-9a-f:.]+)\](?::(\d*))?$/i);if(r)return oe(r[1])&&ne(r[2]);const o=n.match(/^([^:]+)(?::(\d*))?$/);return!(!o||!ne(o[2]))&&ie(o[1])}(o))return!1;try{const e=new URL(o);return("http:"===e.protocol||"https:"===e.protocol)&&ie(e.hostname)&&!e.username&&!e.password}catch(e){return!1}}function ae(e){return e.replace(/^http:/,"https:")}const ce={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:()=>{},errorFn:()=>{}};function ue(e="",t={...ce}){const{enabled:n,isClosed:r,showWrap:o,showDate:i,locales:s,isStringifyObject:a,logFn:c,errorFn:u}=Object.assign({...ce},t);let l=n;!0===r&&(le.warn("The options.isClosed is deprecated. Please use options.enabled instead."),l=!1);const f=Object.create(null),p=()=>(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return["log","info","warn","error"].forEach(t=>{f[t]=function(...n){if(!l)return;let r=e,s=e;if("string"==typeof e&&e.length>=2){const t=e.length;r=":"===e[t-1]?e.substring(0,t-1):e}o&&console.log(`--- ${r} - begin ---`),i&&(s=e?`${p()} ${e}`:`${p()}`),a&&(n=n.map(e=>L(e)?JSON.stringify(e):e)),e||i?console[t](s,...n):console[t](...n),"log"===t&&c(),"error"===t&&u(),o&&console.log(`--- ${r} - end ---`)}}),f}const le=ue("[Mazey]"),fe=ue("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function pe(e,t){if(!e)return void le.error("The element is not exist.");if(Array.isArray(t))return void t.forEach(t=>{t&&e.classList.add(t)});if(!t)return;const n=e.className,r=n.split(/\s+/);for(let e=0;e<r.length;e++)if(r[e]===t)return;let o="",i="";""!==n&&(o=" "),i=n+o+t,e.className=i}function de(){const e=window.jQuery||window.$;if(e){const t=e("img");return!(!t||!t.length)&&(t.each(function(){const t=e(this);if(!t)return;const n=t.attr("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&D(r)&&r[1]&&t.width(r[1]),o&&D(o)&&o[1]&&t.height(o[1])}),!0)}{const e=document.getElementsByTagName("img");if(e.length>0)return Array.from(e).forEach(function(e){const t=e;if(!t)return;const n=t.getAttribute("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&D(r)&&r[1]&&(t.style.width=r[1]),o&&D(o)&&o[1]&&(t.style.height=o[1])}),!0}return!1}function me(e,t={}){if("string"!=typeof e)return!1;const n=e.trim();if(!n)return!0===t.allowEmpty;const r=t.root||("undefined"==typeof document?null:document);if(!r)return!1;try{return r.querySelector(n),!0}catch(e){return!1}}function ge(e){return Boolean(e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}const he=new WeakMap,ye=new WeakMap,we={button:"inline-block",input:"inline-block",select:"inline-block",textarea:"inline-block",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",li:"list-item",summary:"list-item"},be=new Set(["address","article","aside","blockquote","body","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","main","nav","ol","p","pre","section","ul"]);function xe(e){if(!ge(e))return null;const t=e.style;return t&&"string"==typeof t.display?e:null}function ve(e){const t=new Set,n=e=>{const n=xe(e);n&&t.add(n)};if("string"==typeof e){if("undefined"==typeof document)return[];try{document.querySelectorAll(e).forEach(n)}catch(e){return[]}return Array.from(t)}const r=xe(e);if(r)return[r];if(!e||"object"!=typeof e)return[];if("function"==typeof e[Symbol.iterator]){for(const t of e)n(t);return Array.from(t)}const o=e.length;if(!Number.isSafeInteger(o)||o<0)return[];for(let t=0;t<o;t+=1)n(e[t]);return Array.from(t)}function Ee(e){const t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).display:null}function Te(e){const t=e.ownerDocument,n=e.localName.toLowerCase();let r=ye.get(t);r||(r=new Map,ye.set(t,r));const o=e.namespaceURI||"",i=`${o}:${n}`,s=r.get(i);if(s)return s;let a="";const c="http://www.w3.org/1999/xhtml"===o&&n.includes("-"),u=t.body||t.documentElement;if(u&&!c){const e=o&&"http://www.w3.org/1999/xhtml"!==o?t.createElementNS(o,n):t.createElement(n);u.appendChild(e);try{a=Ee(e)||""}finally{u.removeChild(e)}}return a&&"none"!==a||(a=function(e){return we[e]?we[e]:be.has(e)?"block":"inline"}(n)),r.set(i,a),a}function Se(){const e=window.MAZEY_DEFINE_LISTENERS;if(e&&"object"==typeof e)return e;const t=Object.create(null);return window.MAZEY_DEFINE_LISTENERS=t,t}function Ae(e,t){const n=Se()[e];if(Array.isArray(n)){const e=n.slice();for(let n=0,r=e.length;n<r;n++)"function"==typeof e[n]&&(void 0===t?e[n]():e[n](t))}}function Ce(e,t=null){if(e){const n=JSON.stringify(t);sessionStorage.setItem(e,void 0===n?"null":n)}}function Ne(e){let t=null;if(e){const n=sessionStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}function $e(e,t=null){if(e){const n=JSON.stringify(t);localStorage.setItem(e,void 0===n?"null":n)}}function Oe(e){let t=null;if(e){const n=localStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}const _e=Ce,Me=Ne,je=$e,De=Oe,Le="__mazey_cookie_name_encoded__-",ke="__mazey_cookie_value_encoded__-";function Pe(e){return`${ke}${encodeURIComponent(e)}`}function Fe(e){const t=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(e),n=0===e.indexOf(Le)||0===e.indexOf(ke);return t&&!n?e:function(e){return`${Le}${encodeURIComponent(e)}`}(e)}function Ue(e){const t=Fe(e);return t!==e?[t,e]:[e]}function Re(e){const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){const r=n[e].trim();if(0===r.indexOf(t))return r.substring(t.length)}}function ze(e){const t=Ue(e),n="1"===Re(Pe(e));for(let e=0;e<t.length;e++){const r=Re(t[e]);if(void 0!==r){if(n)try{return decodeURIComponent(r)}catch(e){return r}return r}}return""}function Ie(e){const t=Ue(e),n=t.concat(Pe(e)),r=new Date;r.setTime(r.getTime()-1);const o=t.some(e=>void 0!==Re(e));return n.forEach((e,t)=>{if(n.indexOf(e)===t&&void 0!==Re(e)){[`${e}=; expires=${r.toUTCString()}`,`${e}=; expires=${r.toUTCString()}; path=/`].forEach(e=>{document.cookie=e;const t=location.hostname;if(-1!==t.indexOf(".")){const n=t.split(".");for(let t=0;t<n.length;t++)document.cookie=`${e}; domain=.${n.slice(t).join(".")}`}})}}),o&&n.every(e=>void 0===Re(e))}function Be(e,t={id:""}){const{id:n}=t;return new Promise((t,r)=>{const o=document.createElement("link");let i=!1;const s=()=>{o.onload=null,o.onerror=null};o.rel="stylesheet",o.type="text/css",o.href=e,void 0!==n&&(o.id=n),o.onload=()=>{i||(i=!0,s(),t("loaded"))},o.onerror=()=>{i||(i=!0,s(),r(new Error(`Failed to load CSS: ${e}`)))},document.head.appendChild(o)})}const He={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function qe(e,t={...He}){const{id:n,callback:r,timeout:o,isDefer:i,isAsync:s,isCrossOrigin:a,attributes:c,cssUrl:u}=Object.assign({...He},t);if(u){const t=function(e,t){if(!t)return"";if(se(t))return t;try{const n=new URL(e,location.href);return new URL(t,n).href}catch(n){const r=e.split("/");return r.pop(),`${r.join("/")}/${t}`}}(e,u);t&&Be(t).catch(e=>{console.error(`Failed to load CSS from ${t}: ${e?.message}`)})}return new Promise((t,u)=>{const l=document.createElement("script");let f=!1,p=null;const d=()=>{l.onload=null,l.onerror=null,null!==p&&(clearTimeout(p),p=null)},m=e=>{f||(f=!0,d(),u(e))};l.type="text/javascript",l.defer=Boolean(i),l.async=Boolean(s),a&&(l.crossOrigin="anonymous"),n&&(l.id=n),c&&Object.keys(c).forEach(e=>{l.setAttribute(e,c[e])}),l.onload=()=>{if(!f){f=!0,d();try{j(r),t("loaded")}catch(e){u(e)}}},l.onerror=()=>m(new Error(`Failed to load script: ${e}`)),l.src=e,o&&(p=setTimeout(()=>m(new Error("timeout")),o));const g=document.getElementsByTagName("script")[0];if(g?.parentNode)g.parentNode.insertBefore(l,g);else{(document.head||document.body||document.documentElement).appendChild(l)}})}const We=new Map;function Ve(e){if("undefined"==typeof window)return!1;let t=[];const n=window.PerformanceObserver;return!!n&&(D(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}async function Ye(){return Ve("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-contentful-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function Ze(){return Ve("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}function Je(e,t=e.userAgent.trim().toLowerCase()){return/\bmacintosh\b/.test(t)&&"macintel"===e.platform.toLowerCase()&&e.maxTouchPoints>1}const Qe=Object.freeze(["adsbot-google","ahrefsbot","amazonbot","applebot","baiduspider","bingbot","bingpreview","bytespider","ccbot","chatgpt-user","claudebot","discordbot","dotbot","duckduckbot","facebookexternalhit","facebot","google-inspectiontool","googlebot","googleother","gptbot","linkedinbot","mediapartners-google","mj12bot","perplexitybot","petalbot","semrushbot","slackbot","slurp","storebot-google","telegrambot","twitterbot","whatsapp","yandexbot"]),Ge=Object.freeze(["headlesschrome","phantomjs","slimerjs","selenium","puppeteer","playwright"]);function Ke(){try{return"undefined"==typeof navigator?null:navigator}catch(e){return null}}function Xe(){const e=Ke();if(!e)return{userAgent:"",platform:"",maxTouchPoints:0};let t="",n="",r=0;try{const n=e.userAgent;t="string"==typeof n?n:""}catch(e){return{userAgent:"",platform:"",maxTouchPoints:0}}try{const t=e.platform;n="string"==typeof t?t:""}catch(e){n=""}try{const t=e.maxTouchPoints;r=Number.isFinite(t)?t:0}catch(e){r=0}return{userAgent:t,platform:n,maxTouchPoints:r}}function et(e){const t=e.userAgent.trim().toLowerCase();return t?/\bandroid\b|\badr\b/.test(t)?"android":/\bios\b|\biphone\b|\bipad\b|\bipod\b|\biwatch\b/.test(t)||Je(e,t)?"ios":/\bwindows\b|\bwin32\b|\bwin64\b|\bwow32\b|\bwow64\b/.test(t)?"windows":/\bmacintosh\b|\bmacintel\b|\bmac os x\b/.test(t)?"macos":/\blinux\b/.test(t)?"linux":"":""}function tt(e){const t=e.userAgent.trim().toLowerCase();if(!t)return"";if(/\biwatch\b|\bapple watch\b/.test(t))return"";if(/\bipad\b|\btablet\b/.test(t)||Je(e,t))return"tablet";const n=et(e);return"android"===n?/\bmobile\b/.test(t)?"mobile":"tablet":"ios"===n&&/\biphone\b|\bipod\b/.test(t)?"mobile":"windows"===n||"macos"===n||"linux"===n||/\bcros\b/.test(t)?"desktop":/\bmobile\b/.test(t)?"mobile":""}function nt(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return tt(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:Xe())}function rt(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return et(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:Xe())}function ot(e,t){const n=e.trim().toLowerCase();return t.some(e=>n.includes(e))}function it(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;let e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{const t=Xe(),n=t.userAgent.toLowerCase();if(!n)return e;const r=e=>e.test(n),o=e=>{let t="";const r=n.match(e);return r&&D(r)&&(t=r.toString(),t=t.replace(/[^0-9|_.]/g,""),t=t.replace(/_/g,".")),t},i=et(t);let s="";"ios"===i&&(r(/ipad/g)?s="ipad":r(/iphone/g)?s="iphone":r(/iwatch/g)?s="iwatch":r(/ipod/g)?s="ipod":"macintel"===t.platform.toLowerCase()&&t.maxTouchPoints>1&&(s="ipad")),e={...e,system:i,appleType:s};let a="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?a="2000":r(/windows nt 5.1|windows xp/g)?a="xp":r(/windows nt 5.2|windows 2003/g)?a="2003":r(/windows nt 6.0|windows vista/g)?a="vista":r(/windows nt 6.1|windows 7/g)?a="7":r(/windows nt 6.2|windows 8/g)?a="8":r(/windows nt 6.3|windows 8.1/g)?a="8.1":r(/windows nt 10.0|windows 10/g)&&(a="10"):"macos"===i?a=o(/os x [\d._]+/g):"android"===i?a=o(/android [\d._]+/g):"ios"===i&&(a=o(/os [\d._]+/g)),e={...e,systemVs:a};let c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),e={...e,platform:c};let u="",l="";r(/applewebkit/g)?(u="webkit",r(/edg(?:a|ios)?\//g)||r(/edge\//g)?l="edge":r(/opr/g)?l="opera":r(/chrome/g)?l="chrome":r(/safari/g)&&(l="safari")):r(/gecko/g)&&r(/firefox/g)?(u="gecko",l="firefox"):r(/presto/g)?(u="presto",l="opera"):r(/trident|compatible|msie/g)&&(u="trident",l="iexplore"),e={...e,engine:u,supporter:l};let f="";"webkit"===u?f=o(/applewebkit\/[\d._]+/g):"gecko"===u?f=o(/gecko\/[\d._]+/g):"presto"===u?f=o(/presto\/[\d._]+/g):"trident"===u&&(f=o(/trident\/[\d._]+/g)),e={...e,engineVs:f};let p="";"chrome"===l?p=o(/chrome\/[\d._]+/g):"safari"===l?p=o(/version\/[\d._]+/g):"firefox"===l?p=o(/firefox\/[\d._]+/g):"opera"===l?p=o(/opr\/[\d._]+/g):"iexplore"===l?p=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(p=o(/(?:edge|edg|edga|edgios)\/[\d._]+/g)),e={...e,supporterVs:p};let d="",m="";r(/micromessenger/g)?(d="wechat",m=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(d="qq_browser",m=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?d="qq_app":r(/ucbrowser/g)?(d="uc",m=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?d="360":r(/2345explorer/g)?(d="2345",m=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?d="sougou":r(/lbbrowser/g)?d="liebao":r(/maxthon/g)?(d="maxthon",m=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(d="bilibili"),e={...e,shell:d,shellVs:m};let g="";if(window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");e.matches?g="dark":t.matches&&(g="light")}return e={...e,colorScheme:g},window.MAZEY_BROWSER_INFO=e,e}catch(t){return le.warn(t),e}}let st="";function at(e){if("string"!=typeof e||""===e.trim())throw new TypeError("storageKey must be a non-empty string.")}function ct(e){if("undefined"==typeof window)return null;try{return new URL(window.location.href).searchParams.get(e)}catch(e){return null}}function ut(e){if("undefined"==typeof window)return null;try{const t=window.localStorage;return t&&"function"==typeof t.getItem?t.getItem(e):null}catch(e){return null}}function lt(e,t){if("undefined"==typeof window)return!1;try{const n=window.localStorage;return!(!n||"function"!=typeof n.setItem)&&(n.setItem(e,t),!0)}catch(e){return!1}}const ft=Object.freeze({system:"System",light:"Light",dark:"Dark"});function pt(e){return"light"===e||"dark"===e}function dt(){if("undefined"==typeof window)return null;try{const e=window.matchMedia;return"function"!=typeof e?null:e.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return null}}function mt(e,t){return{value:e,label:ft[t]}}function gt(e){const t=e.split("-");if(!/^[a-z]{2,8}$/i.test(t[0]))return null;const n=[t[0].toLowerCase()];let r=1;if(r<t.length&&/^[a-z]{4}$/i.test(t[r])){const e=t[r].toLowerCase();n.push(`${e[0].toUpperCase()}${e.slice(1)}`),r++}for(r<t.length&&(/^[a-z]{2}$/i.test(t[r])||/^\d{3}$/.test(t[r]))&&(n.push(/^[a-z]{2}$/i.test(t[r])?t[r].toUpperCase():t[r]),r++);r<t.length;r++){const e=t[r];if(!/^(?:[a-z0-9]{5,8}|\d[a-z0-9]{3})$/i.test(e))return null;n.push(e.toLowerCase())}return n.join("-")}function ht(e){if("string"!=typeof e)return null;const t=e.trim().replace(/_/g,"-");if(!t)return null;if("undefined"!=typeof Intl)try{const e=Intl,n=e.getCanonicalLocales;if("function"==typeof n){const r=n.call(e,t)[0];return"string"==typeof r&&r?r:null}}catch(e){return e instanceof RangeError||"object"==typeof e&&null!==e&&"name"in e&&"RangeError"===e.name?null:gt(t)}return gt(t)}function yt(e){if("undefined"==typeof Intl)return e;try{const t=Intl.DisplayNames;if("function"!=typeof t)return e;const n=new t([e],{type:"language"}).of(e);return"string"==typeof n&&n.trim()?n:e}catch(t){return e}}function wt(e){return{value:e,label:yt(e)}}exports.addClass=pe,exports.addEvent=function(e,t){const n=Se();Array.isArray(n[e])||Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:[],writable:!0}),"function"==typeof t&&n[e].push(t)},exports.addStyle=function(e,t={id:""}){if(!e)return!1;const n=document.createDocumentFragment();let r=null,o="";const i=document.createElement("style");return t.id?(o=`${t.id}`,r=document.getElementById(o),r?r.innerHTML=e:(i.setAttribute("id",t.id),i.innerHTML=e,n.appendChild(i),document.head.appendChild(n))):(i.innerHTML=e,n.appendChild(i),document.head.appendChild(n)),!0},exports.assignDefined=function(e,...t){return t.forEach(t=>{void 0!==t&&Object.keys(t).forEach(n=>{const r=t[n];if(void 0!==r){const t=e;"__proto__"!==n||Object.hasOwn(e,n)?t[n]=r:Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0})}})}),e},exports.calLongestCommonSubsequence=function(e,t){return h(e,t)},exports.calLongestCommonSubstring=function(e,t){return g(e,t)},exports.calculateCAGR=function(e,t,n){const r=i(e);if(!r)throw new TypeError("startDate must be a valid date.");const o=i(t);if(!o)throw new TypeError("endDate must be a valid date.");const s=o.getTime()-r.getTime();if(s<=0)throw new RangeError("endDate must be later than startDate.");const a=function(e){if("number"==typeof e){if(!Number.isFinite(e))throw new TypeError("totalReturnRate must be a finite number or percentage string.");return e}if("string"!=typeof e)throw new TypeError("totalReturnRate must be a finite number or percentage string.");const t=e.trim();if(!t)throw new TypeError("totalReturnRate must not be empty.");const n=t.endsWith("%")?t.slice(0,-1).trim():t;if(!n)throw new TypeError("totalReturnRate must be a valid percentage string.");const r=Number(n);if(!Number.isFinite(r))throw new TypeError("totalReturnRate must be a valid percentage string.");return r/100}(n);if(a<=-1)throw new RangeError("totalReturnRate must be greater than -1.");const c=s/864e5,u=Math.pow(1+a,365/c)-1;if(!Number.isFinite(u))throw new RangeError("calculated CAGR must be finite.");return u},exports.camelCase2Underscore=S,exports.camelCaseToKebabCase=function(e){return E(e)},exports.cancelBubble=function(e){e.stopPropagation()},exports.clearHTML=function(e,t={}){return F(e,t)},exports.clearHtml=function(e,t={}){return F(e,t)},exports.convert10To26=function(e){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e>0;){let n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t},exports.convertCamelToKebab=E,exports.convertCamelToUnder=T,exports.convertHttpToHttps=ae,exports.convertKebabToCamel=function(e){const t=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return t.endsWith("-")?t.slice(0,-1):t},exports.convertObjectToQuery=function(e){return e&&0===Object.keys(e).length?"":`?${Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}`},exports.convertToHtmlBreaks=P,exports.convertUnderToCamel=function(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())},exports.cutCHSString=function(e,t,n=!1){return z(e,t,n)},exports.cutZHString=R,exports.debounce=function(e,t,n){let r=null,o=null,i=null,s=null,a=null;const u=function(){const l=c()-i;l<t&&l>=0?o=setTimeout(u,t-l):(o=null,n||(a=e.apply(r,s),o||(r=s=null)))};return function(...l){r=this,s=l,i=c();const f=n&&!o;return o||(o=setTimeout(u,t)),f&&(a=e.apply(r,s),r=s=null),a}},exports.deepCopy=x,exports.deepCopyObject=function(e){return x(e)},exports.deepFreeze=function e(t){return!t||"object"!=typeof t||Object.isFrozen(t)||(Object.freeze(t),Object.values(t).forEach(e)),t},exports.delCookie=function(e){Ie(e)},exports.derivePackageMetadata=function(e,t={}){if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest must be an object");if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("options must be an object when provided");const n=e;if("string"!=typeof n.name||!n.name.trim())throw new TypeError("manifest.name must be a non-empty string");const r=n.name.trim(),o=function(e){if(/\s/.test(e))throw new TypeError("manifest.name must not contain whitespace");if(e.startsWith("@")){const t=e.split("/");if(2!==t.length||t[0].length<2||!t[1])throw new TypeError("manifest.name must be a valid scoped package name");return t[1]}if(e.includes("/"))throw new TypeError("manifest.name must be an unscoped or scoped package name");return e}(r),i=t.packageManager??"npm";if("npm"!==i&&"pnpm"!==i&&"yarn"!==i)throw new TypeError('packageManager must be "npm", "pnpm", or "yarn"');const s="npm"===i?"npm install":`${i} add`;return{name:r,version:Y(n,"version"),description:Y(n,"description"),license:Y(n,"license"),author:Z(n.author),unscopedName:o,iifeGlobal:A(o),installCommand:`${s} ${r}`}},exports.detectVisitorType=function(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");const t=void 0===e?function(){const e=Ke();if(!e)return"";try{const t=e.userAgent;return"string"==typeof t?t:""}catch(e){return""}}():e;return ot(t,Qe)?"crawler":ot(t,Ge)||function(){const e=Ke();if(!e)return!1;try{return!0===e.webdriver}catch(e){return!1}}()?"automation":"unknown"},exports.doFn=j,exports.escapeHtmlAttribute=function(e,t={}){if("string"!=typeof e)throw new TypeError("value must be a string.");const n=t.preserveEntities?/&(?!(?:#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]+);)/gi:/&/g,r={"<":"<",">":">",'"':""","'":"'"};return e.replace(n,"&").replace(/[<>"']/g,e=>r[e])},exports.extractElementText=function(e,t={}){const{excludeSelector:n="",replaceImagesWithAlt:r=!0,normalizeWhitespace:o=!0}=t,i=e.cloneNode(!0);r&&Array.from(i.querySelectorAll("img[alt]")).forEach(e=>{const t=e.getAttribute("alt")||"";e.parentNode?.replaceChild(i.ownerDocument.createTextNode(t),e)});const s=n.trim();s&&me(s,{root:i})&&Array.from(i.querySelectorAll(s)).forEach(e=>e.parentNode?.removeChild(e));const a=i.innerText||i.textContent||"";return o?a.replace(/\u00a0/g," ").replace(/\s+/g," ").trim():a},exports.fireEvent=Ae,exports.floatFixed=function(e,t=0){return parseFloat(String(e)).toFixed(t)},exports.floatToPercent=function(e,t=0){let n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),`${n}%`},exports.formatByteSize=B,exports.formatDate=m,exports.formatDistanceToNow=function(e){const t=i(e);if(!t)return"";const n=6e4,r=36e5,o=864e5,s=Math.abs(t.getTime()-Date.now());return s<3e4?"less than a minute":s<9e4?"about 1 minute":s<27e5?d(s/n,"minute"):s<54e5?"about 1 hour":s<864e5?d(s/r,"hour"):s<1512e5?"about 1 day":s<30*o?d(s/o,"day"):s<45*o?"about 1 month":s<365*o?d(s/(30*o),"month"):s<545*o?"about 1 year":d(s/(365*o),"year")},exports.formatDurationFromMs=function(e){const t=(Number.isFinite(e)?Math.max(e,0):0)/1e3;return t>=86400?p(t/24/60/60,"day"):t>=3600?p(t/60/60,"hour"):t>=60?p(t/60,"minute"):p(t,"second")},exports.formatLocalDateTime=function(t,n={}){const r="object"==typeof t&&null!==t?e(t):null;if(null===r)throw new TypeError("date must be a Date");if(!Number.isFinite(r))throw new RangeError("Invalid date");const o=n.precision??"minute";if("minute"!==o&&"second"!==o&&"millisecond"!==o)throw new TypeError("precision must be minute, second, or millisecond");const i=new Date(r),s=i.getFullYear();if(s<1)throw new RangeError("Date year must be greater than zero");const c=[a(s,4),a(i.getMonth()+1,2),a(i.getDate(),2)].join("-"),u=[a(i.getHours(),2),a(i.getMinutes(),2)];"minute"!==o&&u.push(a(i.getSeconds(),2));let l=`${c}T${u.join(":")}`;return"millisecond"===o&&(l+=`.${a(i.getMilliseconds(),3)}`),l},exports.genBrowserAttrs=function(e="",t="-"){const n=it(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(o=>{const i=n[o];if(i){let n="";e&&e.length>0&&(n=`${e}${t}`),r.push(`${n}${i}`)}}),r},exports.genCustomConsole=ue,exports.genHashCode=function(e){let t,n,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r},exports.genRndNumString=N,exports.genStyleString=function(e,t){let n="";return t&&t.length>0&&(n=t.join(";")+";"),`${e}{${n}}`},exports.genUniqueNumString=O,exports.generateCalendarVersion=function(e){return m(void 0===e?new Date:new Date(e instanceof Date?e.getTime():e),"yyyy.MMdd.HHmmss").split(".").map(e=>String(Number(e))).join(".")},exports.generateRndNum=$,exports.generateUniqueNum=function(e=3){return O(e)},exports.getAllQueryParams=function(e=""){""===e&&(e=location.search);const t={};return Q(e).forEach(([e,n])=>{Object.hasOwn(t,e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}),t},exports.getBrowserInfo=it,exports.getCLS=async function(){return Ve("layout-shift")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().reduce((e,t)=>{let n=0;return _(t.value)&&(n=t.value),e+n},0);t.disconnect(),e(r)});t.observe({type:"layout-shift",buffered:!0})}):0},exports.getCookie=ze,exports.getCurrentVersion=function(){return"v4"},exports.getDateDifference=f,exports.getDefineListeners=Se,exports.getDomain=function(e,t=["hostname"]){try{const n=new URL(e,document.baseURI);return t.reduce((e,t)=>e+=n[t],"")}catch(n){const r=document.createElement("a");return r.href=e,t.reduce((e,t)=>e+=r[t],"")}},exports.getFCP=Ye,exports.getFID=async function(){return Ve("first-input")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-input"===e.entryType);if(r){t.disconnect();const n=r.processingStart;e(n?Math.round(r.processingStart-r.startTime):0)}});t.observe({type:"first-input",buffered:!0})}):0},exports.getFP=Ze,exports.getFileSize=function(e,t={}){return B(e,t)},exports.getFriendlyInterval=function(e=0,t=0,n=u){return f(e,t,n)},exports.getHashQueryParam=function(e){const t=location.hash.split("?");return 1===t.length?"":G(`?${t.slice(1).join("?")}`,e)[0]||""},exports.getLCP=async function(){return Ve("largest-contentful-paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"largest-contentful-paint"===e.entryType);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"largest-contentful-paint",buffered:!0})}):0},exports.getLocalJSON=Oe,exports.getLocalStorage=De,exports.getPageMeta=function(e){const t=document.getElementsByTagName("meta");for(let n=0;n<t.length;n++)if(t[n].getAttribute("name")===e)return t[n].getAttribute("content")||"";return""},exports.getPerformance=async function(e=!1){if(!Ve("navigation"))return Promise.reject(new Error("navigation is not supported"));const t=window.performance;if(!t||"function"!=typeof t.getEntriesByType)return Promise.reject(new Error("performance is not supported"));let n;const r=new Promise(e=>{[n]=[e]}),o=t.getEntriesByType("navigation");if(!D(o))return Promise.reject(new Error("NavigationTiming is not supported"));const i=o[0];let[s,a,c,u,l,f,p,d,m,g,h,y,w,b,x,v,E,T,A]=new Array(19).fill(0);({decodedBodySize:T,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:p,connectStart:d,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:x,startTime:v,fetchStart:E}=i);let C=0;if(_(v))C=v;else{if(!_(E))return Promise.reject(new Error("startTime, navigationStart or fetchStart are required"));C=E}const[N,$]=await Promise.all([Ze(),Ye()]);function O(){({decodedBodySize:T,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:p,connectStart:d,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:x,startTime:v,fetchStart:E}=i),_(v)?C=v:_(E)&&(C=E);const t={source:"PerformanceNavigationTiming",os:M(),osVersion:j(),deviceType:L(),network:k(),screenDirection:P(),unloadTime:s-a,redirectTime:c-u,dnsTime:l-f,tcpTime:p-d,sslTime:F(p,m),responseTime:g-h,downloadTime:y-g,firstPaintTime:N,firstContentfulPaintTime:$,domReadyTime:w-C,onloadTime:b-C,whiteTime:g-C,renderTime:x-C,decodedBodySize:T,encodedBodySize:A};Object.keys(t).forEach(e=>{_(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))}),_(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);const r={};e||Object.keys(t).forEach(e=>{r[S(e)]=t[e]}),Object.keys(r).length?n(r):n(t)}function M(){let e;return e=navigator.userAgent.indexOf("Android")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others",e}function j(){let e="";const t=navigator.userAgent,n=t.indexOf("Android")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;const i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function L(){let e;const 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",s=t.match(/ucweb/i)&&"ucweb",a=t.match(/android/i)&&"android",c=t.match(/windows ce/i)&&"windows ce",u=t.match(/windows mobile/i)&&"windows mobile";return e=n||r||o||i||s||a||c||u?r||o||i||s||a||c||u?"phone":n?"ipad":void 0:"pc",e||(e=""),e}function k(){let e="";const t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function P(){let e="";return window.screen&&window.screen.orientation&&"number"==typeof 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 F(e,t){let n=0;return t&&(n=e-t),n}return _(x)&&x>0?O():"complete"===document.readyState?window.setTimeout(O,0):window.addEventListener("load",function e(){window.removeEventListener("load",e),window.setTimeout(function(){O()},0)}),r},exports.getQueryParam=function(e){return G(location.search,e)[0]||""},exports.getScriptQueryParam=function(e,t=""){t||(t=".js");const n=document.querySelectorAll("script[src]");for(let r=0;r<n.length;r++){const o=n[r].getAttribute("src");if(o&&-1!==o.indexOf(t)){const t=G(o,e)[0];if(void 0!==t)return t}}return""},exports.getSessionJSON=Ne,exports.getSessionStorage=Me,exports.getSystemTheme=dt,exports.getTTFB=async function(){if(!Ve("navigation"))return 0;if(!window.performance||!window.performance.getEntriesByType)return 0;const e=window.performance.getEntriesByType("navigation")[0];let t=0;return e?(t=e.responseStart-e.requestStart,Math.round(t)):0},exports.getUrlFileType=function(e){let t="";if("string"!=typeof e||""==e)return t;const n=e.split(/[?#]/,1)[0],r=/\.[^/]+$/.exec(n);return r?(r[0].length>1&&(t=r[0].substring(1)),t):t},exports.getUrlHost=function(e){!se(e)&&se(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).host}catch(e){return""}},exports.getUrlParam=function(e,t,n={}){const r=G(e,t);return n.returnArray?r:r.length?r[0]:null},exports.getUrlPath=function(e){!se(e)&&se(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).pathname}catch(e){return""}},exports.hasClass=function(e,t){if(!e)return le.error("The element is not exist."),!1;const n=e.className.split(/\s+/);for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1},exports.hide=function(e){return ve(e).forEach(e=>{"none"!==Ee(e)&&"none"!==e.style.display&&he.set(e,e.style.display),e.style.display="none"}),e},exports.inRate=function(e){return y(e)},exports.invokeEvent=function(e,t){Ae(e,t)},exports.invokeFn=M,exports.isAndroid=function(e){return"android"===rt(e)},exports.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},exports.isBool=k,exports.isBoolean=function(e){return k(e)},exports.isBrowser=function(){if(V)return"browser"===V;const e="undefined"!=typeof window;return e&&(V="browser"),e},exports.isDesktop=function(e){return"desktop"===nt(e)},exports.isFunction=function(e){return"function"==typeof e},exports.isHit=y,exports.isIOS=function(e){return"ios"===rt(e)},exports.isJSONString=C,exports.isJsonString=function(e){return C(e)},exports.isLinux=function(e){return"linux"===rt(e)},exports.isMacOS=function(e){return"macos"===rt(e)},exports.isMobile=q,exports.isNonEmptyArray=D,exports.isNonEmptyObject=function(e){return!!L(e)&&0!==Object.keys(e).length},exports.isNumber=_,exports.isPhone=function(e){return"mobile"===nt(e)},exports.isPureObject=L,exports.isSafePWAEnv=function(e={}){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;const t=e.requireManifest,n=e.scope;if(void 0!==t&&"boolean"!=typeof t||void 0!==n&&"string"!=typeof n)return!1;if(!0!==window.isSecureContext||!("serviceWorker"in navigator))return!1;if(void 0!==n&&!function(e){const t=e.trim();if(!t||/[?#]/.test(t))return!1;try{const e=new URL(window.location.href),n=new URL(t,e);if(n.origin!==e.origin||""!==n.search||""!==n.hash)return!1;if(e.pathname===n.pathname)return!0;const r=n.pathname.endsWith("/")?n.pathname:`${n.pathname}/`;return e.pathname.startsWith(r)}catch(e){return!1}}(n))return!1;if(!1===t)return!0;if("undefined"==typeof document)return!1;const r=document.querySelector('link[rel~="manifest"][href]');return Boolean(r?.getAttribute("href")?.trim())}catch(e){return!1}},exports.isStandalonePWA=function(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator;try{const e=window.matchMedia;if("function"==typeof e&&e.call(window,"(display-mode: standalone)").matches)return!0}catch(e){}try{return!0===e.standalone}catch(e){return!1}},exports.isString=function(e){return"string"==typeof e},exports.isSupportWebp=function(){return st?Promise.resolve("webp"===st):new Promise(e=>{const t=new Image;t.onload=()=>{const n=t.width>0&&t.height>0;st=n?"webp":"no-webp",e(n)},t.onerror=()=>{st="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})},exports.isSupportedEntryType=Ve,exports.isTablet=function(e){return"tablet"===nt(e)},exports.isThisHour=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()&&t.getHours()===n.getHours()},exports.isThisMonth=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()},exports.isThisWeek=function(e){const t=i(e);if(!t)return!1;const n=new Date,r=(n.getDay()+6)%7;n.setHours(0,0,0,0),n.setDate(n.getDate()-r);const o=new Date(n.getTime());o.setDate(o.getDate()+7);const s=t.getTime();return s>=n.getTime()&&s<o.getTime()},exports.isThisYear=function(e){const t=i(e);return null!==t&&t.getFullYear()===(new Date).getFullYear()},exports.isToday=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},exports.isUdfOrNul=function(e){return null==e},exports.isValidCssSelector=me,exports.isValidData=function(e,t,n){if(null===e||"object"!=typeof e)return!1;let r=e;for(const e of t){if(null===r||"object"!=typeof r&&"function"!=typeof r||!Object.hasOwn(r,e))return!1;r=r[e]}return r===n},exports.isValidDate=function(e){return null!==i(e)},exports.isValidEmail=function(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},exports.isValidHttpUrl=se,exports.isValidPhoneNumber=H,exports.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)},exports.isWindows=function(e){return"windows"===rt(e)},exports.listenMediaQueryChanges=function(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");if(null===e)return()=>{};if("object"!=typeof e)throw new TypeError("media must be a MediaQueryList or null");const n=e.addEventListener,r=e.removeEventListener;let o=null;if("function"==typeof n&&"function"==typeof r){const i=t;n.call(e,"change",i),o=()=>r.call(e,"change",i)}let i=!1;return()=>{i||(i=!0,o?.())}},exports.loadCSS=Be,exports.loadImage=function(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})},exports.loadScript=qe,exports.loadScriptIfUndefined=function(e,t){if(window[e])return Promise.resolve("defined");let n=We.get(e);const r=n?.get(t);if(r)return r;n||(n=new Map,We.set(e,n));const o=()=>{n?.delete(t),0===n?.size&&We.delete(e)},i=qe(t).then(e=>(o(),e),e=>{throw o(),e});return n.set(t,i),i},exports.longestComSubsequence=h,exports.longestComSubstring=g,exports.mNow=c,exports.mTrim=function(e){return e.trim()},exports.mazeyCon=le,exports.newLine=function(e){return P(e)},exports.onURLChange=function(e,t={}){const{fireOnInit:n=!0}=t,r=history;let o=location.href;const i=[],s=t=>{const n=location.href;if(n===o&&"load"!==t)return;const r=o;o=n,e({url:n,oldUrl:r,trigger:t})},a=()=>s("popstate"),c=()=>s("hashchange");window.addEventListener("popstate",a),window.addEventListener("hashchange",c),i.push(()=>window.removeEventListener("popstate",a)),i.push(()=>window.removeEventListener("hashchange",c)),r.__mazeyUrlChangePatched__||(r.__mazeyUrlChangePatched__=!0,r.__mazeyUrlChangeSubscribers__=new Set,r.__mazeyRawPushState__=history.pushState.bind(history),r.__mazeyRawReplaceState__=history.replaceState.bind(history),history.pushState=function(...e){r.__mazeyRawPushState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("pushState"))},history.replaceState=function(...e){r.__mazeyRawReplaceState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("replaceState"))});const u=e=>s(e);return r.__mazeyUrlChangeSubscribers__.add(u),i.push(()=>r.__mazeyUrlChangeSubscribers__.delete(u)),n&&s("load"),()=>{i.forEach(e=>e())}},exports.parseGitHubRepository=function(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.trim();if(!t||/[%\\?#]/.test(t)||function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<=31||127===n)return!0}return!1}(t))throw ee();const n=t.match(/^(?:github:)?([^/:\s]+)\/([^/\s]+)$/i);if(n)return te(n[1],n[2]);const r=t.match(/^git@([^:\s]+):([^/\s]+)\/([^/\s]+)$/);if(r&&"github.com"===r[1].toLowerCase())return te(r[2],r[3]);const o=t.replace(/^git\+(?=(?:git|ssh|https?):\/\/)/i,""),i=o.match(/^[a-z][a-z\d+.-]*:\/\/([^/?#]+)/i);if(!i||/(^|\/)\.{1,2}(?:\/|$)/.test(o.slice(i[0].length)))throw ee();if(-1!==i[1].slice(i[1].lastIndexOf("@")+1).indexOf(":"))throw ee();let s;try{s=new URL(o)}catch(e){throw ee()}const a=s.protocol.toLowerCase(),c=s.hostname.toLowerCase().replace(/^www\./,"");if(!["git:","ssh:","http:","https:"].includes(a)||"github.com"!==c||""!==s.username&&"git"!==s.username||""!==s.password||""!==s.search||""!==s.hash)throw ee();const u=s.pathname.match(/^\/([^/]+)\/([^/]+)\/?$/);if(!u)throw ee();return te(u[1],u[2])},exports.parseJsonSafe=function(e,t=null){try{return JSON.parse(e)}catch(e){return t}},exports.parseLocalDateTime=function(e){if("string"!=typeof e)return null;const t=s.exec(e);if(!t)return null;const[n,i,a,c,u,l="0",f=""]=t.slice(1),p=Number(n),d=Number(i),m=Number(a),g=Number(c),h=Number(u),y=Number(l),w=Number(`${f}00`.slice(0,3));return p<1||!r(p,d,m,g,h,y,w)?null:o(p,d,m,g,h,y,w)},exports.removeClass=function(e,t){if(!e)return void le.error("The element is not exist.");let n;n=" "+e.className+" ",n=n.replace(/(\s+)/gi," "),n=n.replace(" "+t+" "," "),n=n.replace(/(^\s+)|(\s+$)/g,""),e.className=n},exports.removeCookie=Ie,exports.removeEvent=function(e,t){const n=Se(),r=n[e];if("string"==typeof e&&Array.isArray(r))if("function"==typeof t){for(let o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]},exports.removeHTML=F,exports.removeHtml=function(e,t={}){return F(e,t)},exports.repeatUntilConditionMet=function(e,t={},n=e=>!0===e){const{interval:r=1e3,times:o=10,context:i,args:s}=t;if("function"!=typeof e)return void console.error("Expected a function.");if(!Number.isFinite(r)||r<0)return void console.error("Expected a non-negative number for interval.");if(!Number.isFinite(o)||o<0)return void console.error("Expected a non-negative number for times.");if(0===o)return;let a=0;const c=()=>{setTimeout(async()=>{const t=await e.apply(i,s);n(t)||++a>=o||c()},r)};c()},exports.replaceHttp=function(e){return ae(e)},exports.resolveElementTarget=function(e,t){if(void 0===e)return ge(t.defaultElement)?t.defaultElement:null;let n=t.unwrap?t.unwrap(e):e;if(null==n)return null;if("string"==typeof n)try{return t.root.querySelector(n)}catch(e){return null}return"object"==typeof n&&"$el"in n&&(n=n.$el),ge(n)?n:null},exports.resolveLanguagePreference=function(e){at(e);const t=ht(ct("lang"));if(t)return wt(t);const n=ht(ut(e));return wt(n||(ht(function(){if("undefined"==typeof window||"undefined"==typeof navigator)return null;try{return"string"==typeof navigator.language?navigator.language:null}catch(e){return null}}())??"en"))},exports.resolveThemePreference=function(e){at(e);const t=ct("theme");if(pt(t))return lt(e,t),mt(t,t);const n=ut(e);if(pt(n))return mt(n,n);const r=dt();return"system"===n&&r||r?mt(r,"system"):mt("light","light")},exports.sanitizeInput=function(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,e=>t[e])},exports.setClass=function(e,t){pe(e,t)},exports.setCookie=function(e,t,n,r){let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";const i=function(e){let t=!0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(!(33===r||r>=35&&r<=43||r>=45&&r<=58||r>=60&&r<=91||r>=93&&r<=126)){t=!1;break}}return{isEncoded:!t,value:t?e:encodeURIComponent(e)}}(t),s=Fe(e),a=i.isEncoded?"1":"",c=i.isEncoded?o:"; expires=Thu, 01 Jan 1970 00:00:00 GMT",u=[`${s}=${i.value}${o}; path=/`,`${Pe(e)}=${a}${c}; path=/`],l=e=>{const t=e?`; domain=${e}`:"";u.forEach(e=>{document.cookie=`${e}${t}`})},f=location.hostname;if(r)l(r);else if(-1===f.indexOf("."))l();else{const n=f.split(".");n.shift();l("."+n.join(".")),ze(e)!==t&&l(`.${f}`)}},exports.setImgSizeBySrc=de,exports.setImgWidHeiBySrc=function(){return de()},exports.setLanguagePreference=function(e,t){at(e);const n=ht(t);if(!n)throw new TypeError("language must be a valid language tag.");return lt(e,n)},exports.setLocalJSON=$e,exports.setLocalStorage=je,exports.setSessionJSON=Ce,exports.setSessionStorage=_e,exports.setThemePreference=function(e,t){if(at(e),!function(e){return"system"===e||pt(e)}(t))throw new TypeError('value must be "system", "light", or "dark".');return lt(e,t)},exports.sha256Hex=async function(e){const t="undefined"==typeof crypto?null:crypto;if(!t?.subtle||"function"!=typeof t.subtle.digest)throw new Error("Web Crypto API is not available.");let n=e;if("string"==typeof e){if("undefined"==typeof TextEncoder)throw new Error("TextEncoder is not available.");n=(new TextEncoder).encode(e)}const r=await t.subtle.digest("SHA-256",n);let o="";const i=new Uint8Array(r);for(let e=0;e<i.length;e++){const t=i[e].toString(16);o+=1===t.length?`0${t}`:t}return o},exports.show=function(e){return ve(e).forEach(e=>{he.has(e)?(e.style.display=he.get(e),he.delete(e)):"none"===e.style.display&&(e.style.display=""),""===e.style.display&&"none"===Ee(e)&&(e.style.display=Te(e))}),e},exports.sleep=async function(e){return W(e)},exports.subYears=function(t,n){const r="number"==typeof t?t:"object"==typeof t&&null!==t?e(t):null,o=new Date(r??NaN),i="number"==typeof n?n<0?Math.ceil(n):Math.floor(n):NaN;if(!Number.isFinite(o.getTime())||!Number.isFinite(i))return new Date(NaN);if(0===i)return o;const s=o.getMonth(),a=o.getDate(),c=o.getFullYear()-i,u=new Date(o.getTime());return u.setFullYear(c,s+1,0),a>=u.getDate()?u:(o.setFullYear(c,s,a),o)},exports.throttle=function(e,t,n={}){n=Object.assign({},n);let r=null,o=null,i=null,[s,a]=[null,0];const u=function(){a=!1===n.leading?0:c(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(...l){const f=c();a||!1!==n.leading||(a=f);const p=t-(f-a);return r=this,o=l,p<=0||p>t?(i&&(clearTimeout(i),i=null),a=f,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(u.bind(r),p)),s}},exports.timeCon=fe,exports.toJavaScriptGlobalName=A,exports.truncateZHString=z,exports.unsanitize=function(e){return U(e)},exports.unsanitizeInput=U,exports.updateQueryParam=function(e,t,n){const r=e.indexOf("#"),o=-1===r?"":e.slice(r),i=-1===r?e:e.slice(0,r),s=i.indexOf("?"),a=-1===s?i:i.slice(0,s),c=-1===s?"":i.slice(s+1),u=encodeURIComponent(t),l=encodeURIComponent(n);let f=!1;const p=(c?c.split("&").filter(Boolean):[]).reduce((e,n)=>{const r=n.indexOf("=");return J(-1===r?n:n.slice(0,r))===t?f||(e.push(`${u}=${l}`),f=!0):e.push(n),e},[]);return f||p.push(`${u}=${l}`),`${a}?${p.join("&")}${o}`},exports.waitTime=W,exports.watchServiceWorkerUpdates=function(e,t,n){if(null===e||"object"!=typeof e||"function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)throw new TypeError("registration must support event listeners");if(null===t||"object"!=typeof t||"function"!=typeof t.addEventListener||"function"!=typeof t.removeEventListener)throw new TypeError("container must support event listeners");if(null===n||"object"!=typeof n||"function"!=typeof n.onUpdateAvailable||void 0!==n.onControllerChange&&"function"!=typeof n.onControllerChange)throw new TypeError("callbacks must provide onUpdateAvailable");let r=!1,o=null,i=null,s=!1,a=!1;const c=e=>{r||i===e||(i=e,n.onUpdateAvailable(e))},u=()=>{!r&&"installed"===o?.state&&t.controller&&c(o)},l=()=>{r||(o?.removeEventListener("statechange",u),o=e.installing,o?.addEventListener("statechange",u),u())},f=()=>{r||n.onControllerChange?.()},p=()=>{if(s){try{e.removeEventListener("updatefound",l)}catch(e){}s=!1}try{o?.removeEventListener("statechange",u)}catch(e){}if(a){try{t.removeEventListener("controllerchange",f)}catch(e){}a=!1}};try{e.addEventListener("updatefound",l),s=!0,t.addEventListener("controllerchange",f),a=!0,e.waiting&&t.controller&&c(e.waiting),e.installing&&l()}catch(e){throw r=!0,p(),o=null,i=null,e}return{activateWaiting(e={type:"SKIP_WAITING"}){if(r||!i)return!1;try{return i.postMessage(e),!0}catch(e){return!1}},dispose(){r||(r=!0,p(),o=null,i=null)}}},exports.windowLoaded=function(e=3e4){return new Promise((t,n)=>{let r=null;const o=()=>{window.removeEventListener("load",i),null!==r&&(clearTimeout(r),r=null)},i=()=>{o(),t("load")};"complete"!==document.readyState?(window.addEventListener("load",i),r=setTimeout(()=>{o(),n(new Error("timeout"))},e)):t("complete")})},exports.zAxiosIsValidRes=function(e,t={validStatusRange:[200,300],validCode:[0]}){const n=t||{},{validStatusRange:r=[200,300],validCode:o=[0]}=n;2!==r.length&&console.error("valid validStatusRange is required");let i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){const t=e.data;t&&o.includes(t.code)&&(i=!0)}return i};
|
|
6
|
+
"use strict";function e(e){try{return Date.prototype.getTime.call(e)}catch(e){return null}}const t=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/,n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;function r(e,t,n,r,o,i,s=0,a=!1){const c=new Date(0);return a?(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getUTCFullYear()===e&&c.getUTCMonth()===t-1&&c.getUTCDate()===n&&c.getUTCHours()===r&&c.getUTCMinutes()===o&&c.getUTCSeconds()===i&&c.getUTCMilliseconds()===s):(c.setFullYear(e,t-1,n),c.setHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getFullYear()===e&&c.getMonth()===t-1&&c.getDate()===n&&c.getHours()===r&&c.getMinutes()===o&&c.getSeconds()===i&&c.getMilliseconds()===s)}function o(e,t,n,r,o,i,s=0){const a=new Date(0);return a.setFullYear(e,t-1,n),a.setHours(r,o,i,s),a}function i(i){if("number"==typeof i){const e=new Date(i);return Number.isFinite(i)&&Number.isFinite(e.getTime())?e:null}if("object"==typeof i&&null!==i){const t=e(i);return null!==t&&Number.isFinite(t)?new Date(t):null}if("string"!=typeof i)return null;const s=i.trim();if(!s)return null;const a=t.exec(s);if(a){const[e,t,n,i="0",s="0",c="0"]=a.slice(1),[u,l,f,p,d,m]=[e,t,n,i,s,c].map(Number);return r(u,l,f,p,d,m)?o(u,l,f,p,d,m):null}const c=n.exec(s);if(!c)return null;const[u,l,f,p,d,m="0",g="",h]=c.slice(1),y=Number(`${g}00`.slice(0,3));if(!r(Number(u),Number(l),Number(f),Number(p),Number(d),Number(m),y,!0))return null;if("Z"!==h){const e=Number(h.slice(1,3)),t=Number(h.slice(4,6));if(e>23||t>59)return null}return function(e,t,n,r,o,i,s,a){const c=new Date(0);if(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),"Z"===a)return c;const u="+"===a[0]?1:-1,l=60*Number(a.slice(1,3))+Number(a.slice(4,6));return new Date(c.getTime()-u*l*60*1e3)}(Number(u),Number(l),Number(f),Number(p),Number(d),Number(m),y,h)}const s=/^(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function a(e,t){const n=String(e);return n.length>=t?n:`${"0".repeat(t-n.length)}${n}`}function c(){return Date.now()}const u={type:"d"};function l(e){return"string"==typeof e&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T"):e}function f(e=0,t=0,n=u){n=Object.assign({},u,n);const{type:r}=n;"number"==typeof e&&Number.isFinite(e)||(e=new Date(l(e)).getTime()),"number"==typeof t&&Number.isFinite(t)||(t=new Date(l(t)).getTime());const o=Number(t)-Number(e);let i="",[s,a,c,f]=new Array(4).fill(0);if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60),c=Math.floor(o/1e3/60),f=Math.floor(o/1e3),r){case"d":i=s;break;case"text":s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60%24),c=Math.floor(o/1e3/60%60),f=Math.floor(o/1e3%60),i=[{value:s,unit:"day"},{value:a,unit:"hour"},{value:c,unit:"minute"},{value:f,unit:"second"}].filter(({value:e})=>e>0).map(({value:e,unit:t})=>p(e,t)).join(" ")||p(0,"second");break;default:i=f}return i}function p(e,t){const n=Math.round(10*e)/10;return`${n} ${1===n?t:`${t}s`}`}function d(e,t){const n=Math.max(1,Math.round(e));return`about ${n} ${t}${1===n?"":"s"}`}function m(e,t="yyyy-MM-dd"){void 0===e&&(e=new Date);const n=new Date(e);if(!Number.isFinite(n.getTime()))throw new RangeError("Invalid date");const 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"};let i=t||"yyyy-MM-dd";return Object.keys(o).forEach(e=>{let t=o[e];"MM"===e&&Number(t)<=9&&(t=`0${t}`),i=i.split(e).join(String(t))}),i}function g(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));let i=0;for(let s=0;s<n;++s)for(let n=0;n<r;++n)if(e[s]===t[n]){let e=0;s>0&&n>0&&(e=o[s-1][n-1]),o[s][n]=e+1,i=Math.max(i,o[s][n])}return i}function h(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));for(let i=0;i<n;++i)for(let n=0;n<r;++n)if(e[i]===t[n]){let e=0;i>0&&n>0&&(e=o[i-1][n-1]),o[i][n]=e+1}else{let[e,t]=[0,0];n>0&&(e=o[i][n-1]),i>0&&(t=o[i-1][n]),o[i][n]=Math.max(e,t)}return o[n-1][r-1]}function y(e){return Math.random()<e}const w=Function.prototype.toString.call(Object);function b(e,t,n){const r=Object.getOwnPropertyDescriptor(t,n)?.get;if(!r)return!1;try{return r.call(e),!0}catch(e){return!1}}function x(e){return null===e||"object"!=typeof e?e:v(e,new WeakMap)}function v(t,n){if(null===t||"object"!=typeof t)return t;const r=t,o=n.get(r);if(void 0!==o)return o;const i=e(r);if(null!==i){const e=new Date(i);return n.set(r,e),e}const s=function(e){const t=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get;if(!t)return null;try{return t.call(e)}catch(e){return null}}(r);if(null!==s){const e=t,o=new RegExp(s,function(e){return e.flags}(e));return o.lastIndex=e.lastIndex,n.set(r,o),o}if("undefined"!=typeof ArrayBuffer&&b(r,ArrayBuffer.prototype,"byteLength")){const e=ArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof SharedArrayBuffer&&b(r,SharedArrayBuffer.prototype,"byteLength")){const e=SharedArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)){const e=v(t.buffer,n),o="undefined"!=typeof DataView&&b(r,DataView.prototype,"byteLength")?new DataView(e,t.byteOffset,t.byteLength):new t.constructor(e,t.byteOffset,t.length);return n.set(r,o),o}if("undefined"!=typeof Map&&b(r,Map.prototype,"size")){const e=new Map;return n.set(r,e),Map.prototype.forEach.call(t,(t,r)=>{e.set(v(r,n),v(t,n))}),e}if("undefined"!=typeof Set&&b(r,Set.prototype,"size")){const e=new Set;return n.set(r,e),Set.prototype.forEach.call(t,t=>{e.add(v(t,n))}),e}const a=Array.isArray(t),c=Object.getPrototypeOf(t),u=function(e){const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.hasOwn(t,"constructor")?t.constructor:null;return"function"==typeof n&&Function.prototype.toString.call(n)===w}(r),l=!a&&!u&&function(e){const t=Object.getPrototypeOf(e),n=t?.constructor;return"function"==typeof n&&-1===Function.prototype.toString.call(n).indexOf("[native code]")}(r);if(!a&&!u&&!l)return n.set(r,t),t;const f=a?new Array(t.length):Object.create(l?Object.prototype:c);return n.set(r,f),function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}(r).forEach(e=>{if(a&&"length"===e)return;const t=Object.getOwnPropertyDescriptor(r,e);t&&("value"in t&&(t.value=v(t.value,n)),Object.defineProperty(f,e,t))}),f}function E(e){const t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function T(e){const t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function S(e){return T(e)}function A(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.replace(/[^A-Za-z0-9_$]/g,"_").toUpperCase();return/^[A-Za-z_$]/.test(t)?t:`_${t}`}function C(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){}return!1}function N(e=5){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e--;)t+=Math.floor(10*Math.random());return t}function $(e=5){return N(e)}function O(e=3){const[t,n]=[c(),$(e||3)];return t+n}function _(e,t={}){const{isNaNAsNumber:n=!1,isInfinityAsNumber:r=!1,isUnFiniteAsNumber:o=!1}=t;return"number"==typeof e&&(!(!0!==r&&!0!==o&&!isFinite(e))&&!(!n&&isNaN(e)))}function M(e,...t){let n=null;return e&&"function"==typeof e&&(n=e(...t)),n}function j(e,...t){return M(e,...t)}function D(e){let t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function L(e){const t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function k(e){return"boolean"==typeof e}function P(e){if(!e)return"";const t=new RegExp("\\n","g");return e.replace(t,"<br />")}function F(e,t={}){const{removeNewLine:n=!1}=t;let r="";return e&&(r=e.replace(/<\/?.+?>/g,""),n&&(r=r.replace(/[\r\n]/g,""))),r}function R(e){const t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,e=>t[e])}function U(e,t,n={hasDot:!1,dotText:"..."}){if(n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){let r=0,o="";const i=/[^\x00-\xff]/g;let s="";const a=e.replace(i,"**").length;for(let n=0;n<a&&(s=e.charAt(n).toString(),null!=s.match(i)?r+=2:r++,!(r>t));n++)o+=s;return n.hasDot&&a>t&&(o+=n.dotText),o}return""}function z(e,t,n=!1){return U(e,t,{hasDot:n})}const I=["B","KB","MB","GB","TB"];function B(e,t={}){const{base:n=1024,fractionDigits:r=1,invalidValue:o=""}=t;if(!Number.isFinite(e)||e<0||1e3!==n&&1024!==n||!Number.isInteger(r)||r<0||r>20)return o;let i=e,s=0;for(;i>=n&&s<I.length-1;)i/=n,s+=1;return 0===s?`${Number(i.toFixed(r))} ${I[s]}`:`${i.toFixed(r)} ${I[s]}`}function H(e){return/^1\d{10}$/.test(e)}const q=H;async function W(e){return new Promise(t=>{setTimeout(()=>{t(e)},e)})}let V="";function Y(e,t){const n=e[t];if(void 0!==n&&"string"!=typeof n)throw new TypeError(`manifest.${t} must be a string when provided`);return n}function Z(e){if(void 0===e)return{name:""};if("string"==typeof e)return{name:e.trim()};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest.author must be a string or object");const t=e,n={name:""};for(const e of["name","email","url"]){const r=t[e];if(void 0!==r&&"string"!=typeof r)throw new TypeError(`manifest.author.${e} must be a string when provided`);if("string"==typeof r){const t=r.trim();("name"===e||t)&&(n[e]=t)}}return n}function J(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}}function Q(e){const t=e.indexOf("#"),n=-1===t?e:e.slice(0,t),r=n.indexOf("?"),o=/^(?:[a-z][a-z\d+.-]*:)?\/\//i.test(n)||"/"===n.charAt(0),i=-1===r?o?"":n:n.slice(r+1);return i?i.split("&").reduce((e,t)=>{if(!t||-1===t.indexOf("="))return e;const n=t.indexOf("=");return e.push([J(t.slice(0,n)),J(t.slice(n+1))]),e},[]):[]}function G(e,t){return Q(e).filter(([e])=>e===t).map(([,e])=>e)}const K=/^(?=.{1,39}$)(?!.*--)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/,X=/^(?=.{1,100}$)(?!\.{1,2}$)[A-Za-z0-9_.-]+$/;function ee(){return new Error("The value does not identify one supported GitHub repository")}function te(e,t){const n=t.replace(/\.git$/i,"");if(!K.test(e)||!X.test(n))throw ee();const r=`${e}/${n}`;return{owner:e,name:n,slug:r,url:`https://github.com/${r}`}}function ne(e){return void 0===e||Number(e)<=65535}function re(e){const t=e.split(".");return 4===t.length&&t.every(e=>/^\d{1,3}$/.test(e)&&(1===e.length||"0"!==e.charAt(0))&&Number(e)<=255)}function oe(e){const t=e.split("::");if(t.length>2)return!1;const n=2===t.length;let r=[];t.forEach(e=>{e&&(r=r.concat(e.split(":")))});let o=0;for(let e=0;e<r.length;e++){const t=r[e];if(-1!==t.indexOf(".")){if(e!==r.length-1||!re(t))return!1;o+=2}else{if(!/^[0-9a-f]{1,4}$/i.test(t))return!1;o+=1}}return n?o<8:8===o}function ie(e){const t=e.match(/^\[([0-9a-f:.]+)\]$/i);if(t)return oe(t[1]);if("."===e.charAt(e.length-1)&&(e=e.slice(0,-1)),re(e))return!0;const n=e.split(".");return!(n.length<2||n.some(e=>!e||!/^[a-z\d-]+$/i.test(e)||"-"===e.charAt(0)||"-"===e.charAt(e.length-1)))&&!/^\d+$/.test(n[n.length-1])}function se(e,t={strict:!0}){if("string"!=typeof e||!e||e.trim()!==e)return!1;const n=/^https?:\/\/[^/\\]/i.test(e),r=/^\/\/[^/\\]/.test(e);if(!n&&(t.strict||!r))return!1;const o=r?`http:${e}`:e;if(!function(e){const t=e.match(/^https?:\/\/([^/?#]+)(?:[/?#][^\s<>"`]*)?$/i);if(!t||-1!==t[1].indexOf("@"))return!1;const n=t[1],r=n.match(/^\[([0-9a-f:.]+)\](?::(\d*))?$/i);if(r)return oe(r[1])&&ne(r[2]);const o=n.match(/^([^:]+)(?::(\d*))?$/);return!(!o||!ne(o[2]))&&ie(o[1])}(o))return!1;try{const e=new URL(o);return("http:"===e.protocol||"https:"===e.protocol)&&ie(e.hostname)&&!e.username&&!e.password}catch(e){return!1}}function ae(e){return e.replace(/^http:/,"https:")}const ce={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:()=>{},errorFn:()=>{}};function ue(e="",t={...ce}){const{enabled:n,isClosed:r,showWrap:o,showDate:i,locales:s,isStringifyObject:a,logFn:c,errorFn:u}=Object.assign({...ce},t);let l=n;!0===r&&(le.warn("The options.isClosed is deprecated. Please use options.enabled instead."),l=!1);const f=Object.create(null),p=()=>(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return["log","info","warn","error"].forEach(t=>{f[t]=function(...n){if(!l)return;let r=e,s=e;if("string"==typeof e&&e.length>=2){const t=e.length;r=":"===e[t-1]?e.substring(0,t-1):e}o&&console.log(`--- ${r} - begin ---`),i&&(s=e?`${p()} ${e}`:`${p()}`),a&&(n=n.map(e=>L(e)?JSON.stringify(e):e)),e||i?console[t](s,...n):console[t](...n),"log"===t&&c(),"error"===t&&u(),o&&console.log(`--- ${r} - end ---`)}}),f}const le=ue("[Mazey]"),fe=ue("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function pe(e,t){if(!e)return void le.error("The element is not exist.");if(Array.isArray(t))return void t.forEach(t=>{t&&e.classList.add(t)});if(!t)return;const n=e.className,r=n.split(/\s+/);for(let e=0;e<r.length;e++)if(r[e]===t)return;let o="",i="";""!==n&&(o=" "),i=n+o+t,e.className=i}function de(){const e=window.jQuery||window.$;if(e){const t=e("img");return!(!t||!t.length)&&(t.each(function(){const t=e(this);if(!t)return;const n=t.attr("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&D(r)&&r[1]&&t.width(r[1]),o&&D(o)&&o[1]&&t.height(o[1])}),!0)}{const e=document.getElementsByTagName("img");if(e.length>0)return Array.from(e).forEach(function(e){const t=e;if(!t)return;const n=t.getAttribute("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&D(r)&&r[1]&&(t.style.width=r[1]),o&&D(o)&&o[1]&&(t.style.height=o[1])}),!0}return!1}function me(e,t={}){if("string"!=typeof e)return!1;const n=e.trim();if(!n)return!0===t.allowEmpty;const r=t.root||("undefined"==typeof document?null:document);if(!r)return!1;try{return r.querySelector(n),!0}catch(e){return!1}}function ge(e){return Boolean(e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}const he=new WeakMap,ye=new WeakMap,we={button:"inline-block",input:"inline-block",select:"inline-block",textarea:"inline-block",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",li:"list-item",summary:"list-item"},be=new Set(["address","article","aside","blockquote","body","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","main","nav","ol","p","pre","section","ul"]);function xe(e){if(!ge(e))return null;const t=e.style;return t&&"string"==typeof t.display?e:null}function ve(e){const t=new Set,n=e=>{const n=xe(e);n&&t.add(n)};if("string"==typeof e){if("undefined"==typeof document)return[];try{document.querySelectorAll(e).forEach(n)}catch(e){return[]}return Array.from(t)}const r=xe(e);if(r)return[r];if(!e||"object"!=typeof e)return[];if("function"==typeof e[Symbol.iterator]){for(const t of e)n(t);return Array.from(t)}const o=e.length;if(!Number.isSafeInteger(o)||o<0)return[];for(let t=0;t<o;t+=1)n(e[t]);return Array.from(t)}function Ee(e){const t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).display:null}function Te(e){const t=e.ownerDocument,n=e.localName.toLowerCase();let r=ye.get(t);r||(r=new Map,ye.set(t,r));const o=e.namespaceURI||"",i=`${o}:${n}`,s=r.get(i);if(s)return s;let a="";const c="http://www.w3.org/1999/xhtml"===o&&n.includes("-"),u=t.body||t.documentElement;if(u&&!c){const e=o&&"http://www.w3.org/1999/xhtml"!==o?t.createElementNS(o,n):t.createElement(n);u.appendChild(e);try{a=Ee(e)||""}finally{u.removeChild(e)}}return a&&"none"!==a||(a=function(e){return we[e]?we[e]:be.has(e)?"block":"inline"}(n)),r.set(i,a),a}function Se(){const e=window.MAZEY_DEFINE_LISTENERS;if(e&&"object"==typeof e)return e;const t=Object.create(null);return window.MAZEY_DEFINE_LISTENERS=t,t}function Ae(e,t){const n=Se()[e];if(Array.isArray(n)){const e=n.slice();for(let n=0,r=e.length;n<r;n++)"function"==typeof e[n]&&(void 0===t?e[n]():e[n](t))}}function Ce(e,t=null){if(e){const n=JSON.stringify(t);sessionStorage.setItem(e,void 0===n?"null":n)}}function Ne(e){let t=null;if(e){const n=sessionStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}function $e(e,t=null){if(e){const n=JSON.stringify(t);localStorage.setItem(e,void 0===n?"null":n)}}function Oe(e){let t=null;if(e){const n=localStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}const _e=Ce,Me=Ne,je=$e,De=Oe,Le="__mazey_cookie_name_encoded__-",ke="__mazey_cookie_value_encoded__-";function Pe(e){return`${ke}${encodeURIComponent(e)}`}function Fe(e){const t=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(e),n=0===e.indexOf(Le)||0===e.indexOf(ke);return t&&!n?e:function(e){return`${Le}${encodeURIComponent(e)}`}(e)}function Re(e){const t=Fe(e);return t!==e?[t,e]:[e]}function Ue(e){const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){const r=n[e].trim();if(0===r.indexOf(t))return r.substring(t.length)}}function ze(e){const t=Re(e),n="1"===Ue(Pe(e));for(let e=0;e<t.length;e++){const r=Ue(t[e]);if(void 0!==r){if(n)try{return decodeURIComponent(r)}catch(e){return r}return r}}return""}function Ie(e){const t=Re(e),n=t.concat(Pe(e)),r=new Date;r.setTime(r.getTime()-1);const o=t.some(e=>void 0!==Ue(e));return n.forEach((e,t)=>{if(n.indexOf(e)===t&&void 0!==Ue(e)){[`${e}=; expires=${r.toUTCString()}`,`${e}=; expires=${r.toUTCString()}; path=/`].forEach(e=>{document.cookie=e;const t=location.hostname;if(-1!==t.indexOf(".")){const n=t.split(".");for(let t=0;t<n.length;t++)document.cookie=`${e}; domain=.${n.slice(t).join(".")}`}})}}),o&&n.every(e=>void 0===Ue(e))}function Be(e,t={id:""}){const{id:n}=t;return new Promise((t,r)=>{const o=document.createElement("link");let i=!1;const s=()=>{o.onload=null,o.onerror=null};o.rel="stylesheet",o.type="text/css",o.href=e,void 0!==n&&(o.id=n),o.onload=()=>{i||(i=!0,s(),t("loaded"))},o.onerror=()=>{i||(i=!0,s(),r(new Error(`Failed to load CSS: ${e}`)))},document.head.appendChild(o)})}const He={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function qe(e,t={...He}){const{id:n,callback:r,timeout:o,isDefer:i,isAsync:s,isCrossOrigin:a,attributes:c,cssUrl:u}=Object.assign({...He},t);if(u){const t=function(e,t){if(!t)return"";if(se(t))return t;try{const n=new URL(e,location.href);return new URL(t,n).href}catch(n){const r=e.split("/");return r.pop(),`${r.join("/")}/${t}`}}(e,u);t&&Be(t).catch(e=>{console.error(`Failed to load CSS from ${t}: ${e?.message}`)})}return new Promise((t,u)=>{const l=document.createElement("script");let f=!1,p=null;const d=()=>{l.onload=null,l.onerror=null,null!==p&&(clearTimeout(p),p=null)},m=e=>{f||(f=!0,d(),u(e))};l.type="text/javascript",l.defer=Boolean(i),l.async=Boolean(s),a&&(l.crossOrigin="anonymous"),n&&(l.id=n),c&&Object.keys(c).forEach(e=>{l.setAttribute(e,c[e])}),l.onload=()=>{if(!f){f=!0,d();try{j(r),t("loaded")}catch(e){u(e)}}},l.onerror=()=>m(new Error(`Failed to load script: ${e}`)),l.src=e,o&&(p=setTimeout(()=>m(new Error("timeout")),o));const g=document.getElementsByTagName("script")[0];if(g?.parentNode)g.parentNode.insertBefore(l,g);else{(document.head||document.body||document.documentElement).appendChild(l)}})}const We=new Map;function Ve(e){if("undefined"==typeof window)return!1;let t=[];const n=window.PerformanceObserver;return!!n&&(D(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}async function Ye(){return Ve("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-contentful-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function Ze(){return Ve("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}function Je(e,t=e.userAgent.trim().toLowerCase()){return/\bmacintosh\b/.test(t)&&"macintel"===e.platform.toLowerCase()&&e.maxTouchPoints>1}const Qe=Object.freeze(["adsbot-google","ahrefsbot","amazonbot","applebot","baiduspider","bingbot","bingpreview","bytespider","ccbot","chatgpt-user","claudebot","discordbot","dotbot","duckduckbot","facebookexternalhit","facebot","google-inspectiontool","googlebot","googleother","gptbot","linkedinbot","mediapartners-google","mj12bot","perplexitybot","petalbot","semrushbot","slackbot","slurp","storebot-google","telegrambot","twitterbot","whatsapp","yandexbot"]),Ge=Object.freeze(["headlesschrome","phantomjs","slimerjs","selenium","puppeteer","playwright"]);function Ke(){try{return"undefined"==typeof navigator?null:navigator}catch(e){return null}}function Xe(){const e=Ke();if(!e)return{userAgent:"",platform:"",maxTouchPoints:0};let t="",n="",r=0;try{const n=e.userAgent;t="string"==typeof n?n:""}catch(e){return{userAgent:"",platform:"",maxTouchPoints:0}}try{const t=e.platform;n="string"==typeof t?t:""}catch(e){n=""}try{const t=e.maxTouchPoints;r=Number.isFinite(t)?t:0}catch(e){r=0}return{userAgent:t,platform:n,maxTouchPoints:r}}function et(e){const t=e.userAgent.trim().toLowerCase();return t?/\bandroid\b|\badr\b/.test(t)?"android":/\bios\b|\biphone\b|\bipad\b|\bipod\b|\biwatch\b/.test(t)||Je(e,t)?"ios":/\bwindows\b|\bwin32\b|\bwin64\b|\bwow32\b|\bwow64\b/.test(t)?"windows":/\bmacintosh\b|\bmacintel\b|\bmac os x\b/.test(t)?"macos":/\blinux\b/.test(t)?"linux":"":""}function tt(e){const t=e.userAgent.trim().toLowerCase();if(!t)return"";if(/\biwatch\b|\bapple watch\b/.test(t))return"";if(/\bipad\b|\btablet\b/.test(t)||Je(e,t))return"tablet";const n=et(e);return"android"===n?/\bmobile\b/.test(t)?"mobile":"tablet":"ios"===n&&/\biphone\b|\bipod\b/.test(t)?"mobile":"windows"===n||"macos"===n||"linux"===n||/\bcros\b/.test(t)?"desktop":/\bmobile\b/.test(t)?"mobile":""}function nt(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return tt(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:Xe())}function rt(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return et(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:Xe())}function ot(e,t){const n=e.trim().toLowerCase();return t.some(e=>n.includes(e))}function it(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;let e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{const t=Xe(),n=t.userAgent.toLowerCase();if(!n)return e;const r=e=>e.test(n),o=e=>{let t="";const r=n.match(e);return r&&D(r)&&(t=r.toString(),t=t.replace(/[^0-9|_.]/g,""),t=t.replace(/_/g,".")),t},i=et(t);let s="";"ios"===i&&(r(/ipad/g)?s="ipad":r(/iphone/g)?s="iphone":r(/iwatch/g)?s="iwatch":r(/ipod/g)?s="ipod":"macintel"===t.platform.toLowerCase()&&t.maxTouchPoints>1&&(s="ipad")),e={...e,system:i,appleType:s};let a="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?a="2000":r(/windows nt 5.1|windows xp/g)?a="xp":r(/windows nt 5.2|windows 2003/g)?a="2003":r(/windows nt 6.0|windows vista/g)?a="vista":r(/windows nt 6.1|windows 7/g)?a="7":r(/windows nt 6.2|windows 8/g)?a="8":r(/windows nt 6.3|windows 8.1/g)?a="8.1":r(/windows nt 10.0|windows 10/g)&&(a="10"):"macos"===i?a=o(/os x [\d._]+/g):"android"===i?a=o(/android [\d._]+/g):"ios"===i&&(a=o(/os [\d._]+/g)),e={...e,systemVs:a};let c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),e={...e,platform:c};let u="",l="";r(/applewebkit/g)?(u="webkit",r(/edg(?:a|ios)?\//g)||r(/edge\//g)?l="edge":r(/opr/g)?l="opera":r(/chrome/g)?l="chrome":r(/safari/g)&&(l="safari")):r(/gecko/g)&&r(/firefox/g)?(u="gecko",l="firefox"):r(/presto/g)?(u="presto",l="opera"):r(/trident|compatible|msie/g)&&(u="trident",l="iexplore"),e={...e,engine:u,supporter:l};let f="";"webkit"===u?f=o(/applewebkit\/[\d._]+/g):"gecko"===u?f=o(/gecko\/[\d._]+/g):"presto"===u?f=o(/presto\/[\d._]+/g):"trident"===u&&(f=o(/trident\/[\d._]+/g)),e={...e,engineVs:f};let p="";"chrome"===l?p=o(/chrome\/[\d._]+/g):"safari"===l?p=o(/version\/[\d._]+/g):"firefox"===l?p=o(/firefox\/[\d._]+/g):"opera"===l?p=o(/opr\/[\d._]+/g):"iexplore"===l?p=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(p=o(/(?:edge|edg|edga|edgios)\/[\d._]+/g)),e={...e,supporterVs:p};let d="",m="";r(/micromessenger/g)?(d="wechat",m=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(d="qq_browser",m=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?d="qq_app":r(/ucbrowser/g)?(d="uc",m=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?d="360":r(/2345explorer/g)?(d="2345",m=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?d="sougou":r(/lbbrowser/g)?d="liebao":r(/maxthon/g)?(d="maxthon",m=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(d="bilibili"),e={...e,shell:d,shellVs:m};let g="";if(window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");e.matches?g="dark":t.matches&&(g="light")}return e={...e,colorScheme:g},window.MAZEY_BROWSER_INFO=e,e}catch(t){return le.warn(t),e}}let st="";function at(e){if("string"!=typeof e||""===e.trim())throw new TypeError("storageKey must be a non-empty string.")}function ct(e){if("undefined"==typeof window)return null;try{return new URL(window.location.href).searchParams.get(e)}catch(e){return null}}function ut(e){if("undefined"==typeof window)return null;try{const t=window.localStorage;return t&&"function"==typeof t.getItem?t.getItem(e):null}catch(e){return null}}function lt(e,t){if("undefined"==typeof window)return!1;try{const n=window.localStorage;return!(!n||"function"!=typeof n.setItem)&&(n.setItem(e,t),!0)}catch(e){return!1}}const ft=Object.freeze({system:"System",light:"Light",dark:"Dark"});function pt(e){return"light"===e||"dark"===e}function dt(){if("undefined"==typeof window)return null;try{const e=window.matchMedia;return"function"!=typeof e?null:e.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return null}}function mt(e,t){return{value:e,label:ft[t]}}function gt(e){const t=e.split("-");if(!/^[a-z]{2,8}$/i.test(t[0]))return null;const n=[t[0].toLowerCase()];let r=1;if(r<t.length&&/^[a-z]{4}$/i.test(t[r])){const e=t[r].toLowerCase();n.push(`${e[0].toUpperCase()}${e.slice(1)}`),r++}for(r<t.length&&(/^[a-z]{2}$/i.test(t[r])||/^\d{3}$/.test(t[r]))&&(n.push(/^[a-z]{2}$/i.test(t[r])?t[r].toUpperCase():t[r]),r++);r<t.length;r++){const e=t[r];if(!/^(?:[a-z0-9]{5,8}|\d[a-z0-9]{3})$/i.test(e))return null;n.push(e.toLowerCase())}return n.join("-")}function ht(e){if("string"!=typeof e)return null;const t=e.trim().replace(/_/g,"-");if(!t)return null;if("undefined"!=typeof Intl)try{const e=Intl,n=e.getCanonicalLocales;if("function"==typeof n){const r=n.call(e,t)[0];return"string"==typeof r&&r?r:null}}catch(e){return e instanceof RangeError||"object"==typeof e&&null!==e&&"name"in e&&"RangeError"===e.name?null:gt(t)}return gt(t)}function yt(e){if("undefined"==typeof Intl)return e;try{const t=Intl.DisplayNames;if("function"!=typeof t)return e;const n=new t([e],{type:"language"}).of(e);return"string"==typeof n&&n.trim()?n:e}catch(t){return e}}function wt(e){return{value:e,label:yt(e)}}exports.addClass=pe,exports.addEvent=function(e,t){const n=Se();Array.isArray(n[e])||Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:[],writable:!0}),"function"==typeof t&&n[e].push(t)},exports.addStyle=function(e,t={id:""}){if(!e)return!1;const n=document.createDocumentFragment();let r=null,o="";const i=document.createElement("style");return t.id?(o=`${t.id}`,r=document.getElementById(o),r?r.innerHTML=e:(i.setAttribute("id",t.id),i.innerHTML=e,n.appendChild(i),document.head.appendChild(n))):(i.innerHTML=e,n.appendChild(i),document.head.appendChild(n)),!0},exports.assignDefined=function(e,...t){return t.forEach(t=>{void 0!==t&&Object.keys(t).forEach(n=>{const r=t[n];if(void 0!==r){const t=e;"__proto__"!==n||Object.hasOwn(e,n)?t[n]=r:Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0})}})}),e},exports.calLongestCommonSubsequence=function(e,t){return h(e,t)},exports.calLongestCommonSubstring=function(e,t){return g(e,t)},exports.calculateAspectRatio=function(e,t){if(!Number.isSafeInteger(e))throw new TypeError("width must be a safe integer.");if(!Number.isSafeInteger(t))throw new TypeError("height must be a safe integer.");if(e<=0||t<=0)throw new RangeError("width and height must be greater than zero.");const n=function(e,t){for(;0!==t;){const n=e%t;e=t,t=n}return e}(e,t);return`${e/n}x${t/n}`},exports.calculateCAGR=function(e,t,n){const r=i(e);if(!r)throw new TypeError("startDate must be a valid date.");const o=i(t);if(!o)throw new TypeError("endDate must be a valid date.");const s=o.getTime()-r.getTime();if(s<=0)throw new RangeError("endDate must be later than startDate.");const a=function(e){if("number"==typeof e){if(!Number.isFinite(e))throw new TypeError("totalReturnRate must be a finite number or percentage string.");return e}if("string"!=typeof e)throw new TypeError("totalReturnRate must be a finite number or percentage string.");const t=e.trim();if(!t)throw new TypeError("totalReturnRate must not be empty.");const n=t.endsWith("%")?t.slice(0,-1).trim():t;if(!n)throw new TypeError("totalReturnRate must be a valid percentage string.");const r=Number(n);if(!Number.isFinite(r))throw new TypeError("totalReturnRate must be a valid percentage string.");return r/100}(n);if(a<=-1)throw new RangeError("totalReturnRate must be greater than -1.");const c=s/864e5,u=Math.pow(1+a,365/c)-1;if(!Number.isFinite(u))throw new RangeError("calculated CAGR must be finite.");return u},exports.camelCase2Underscore=S,exports.camelCaseToKebabCase=function(e){return E(e)},exports.cancelBubble=function(e){e.stopPropagation()},exports.clearHTML=function(e,t={}){return F(e,t)},exports.clearHtml=function(e,t={}){return F(e,t)},exports.convert10To26=function(e){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e>0;){let n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t},exports.convertCamelToKebab=E,exports.convertCamelToUnder=T,exports.convertHttpToHttps=ae,exports.convertKebabToCamel=function(e){const t=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return t.endsWith("-")?t.slice(0,-1):t},exports.convertObjectToQuery=function(e){return e&&0===Object.keys(e).length?"":`?${Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}`},exports.convertToHtmlBreaks=P,exports.convertUnderToCamel=function(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())},exports.cutCHSString=function(e,t,n=!1){return z(e,t,n)},exports.cutZHString=U,exports.debounce=function(e,t,n){let r=null,o=null,i=null,s=null,a=null;const u=function(){const l=c()-i;l<t&&l>=0?o=setTimeout(u,t-l):(o=null,n||(a=e.apply(r,s),o||(r=s=null)))};return function(...l){r=this,s=l,i=c();const f=n&&!o;return o||(o=setTimeout(u,t)),f&&(a=e.apply(r,s),r=s=null),a}},exports.deepCopy=x,exports.deepCopyObject=function(e){return x(e)},exports.deepFreeze=function e(t){return!t||"object"!=typeof t||Object.isFrozen(t)||(Object.freeze(t),Object.values(t).forEach(e)),t},exports.delCookie=function(e){Ie(e)},exports.derivePackageMetadata=function(e,t={}){if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest must be an object");if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("options must be an object when provided");const n=e;if("string"!=typeof n.name||!n.name.trim())throw new TypeError("manifest.name must be a non-empty string");const r=n.name.trim(),o=function(e){if(/\s/.test(e))throw new TypeError("manifest.name must not contain whitespace");if(e.startsWith("@")){const t=e.split("/");if(2!==t.length||t[0].length<2||!t[1])throw new TypeError("manifest.name must be a valid scoped package name");return t[1]}if(e.includes("/"))throw new TypeError("manifest.name must be an unscoped or scoped package name");return e}(r),i=t.packageManager??"npm";if("npm"!==i&&"pnpm"!==i&&"yarn"!==i)throw new TypeError('packageManager must be "npm", "pnpm", or "yarn"');const s="npm"===i?"npm install":`${i} add`;return{name:r,version:Y(n,"version"),description:Y(n,"description"),license:Y(n,"license"),author:Z(n.author),unscopedName:o,iifeGlobal:A(o),installCommand:`${s} ${r}`}},exports.detectVisitorType=function(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");const t=void 0===e?function(){const e=Ke();if(!e)return"";try{const t=e.userAgent;return"string"==typeof t?t:""}catch(e){return""}}():e;return ot(t,Qe)?"crawler":ot(t,Ge)||function(){const e=Ke();if(!e)return!1;try{return!0===e.webdriver}catch(e){return!1}}()?"automation":"unknown"},exports.doFn=j,exports.escapeHtmlAttribute=function(e,t={}){if("string"!=typeof e)throw new TypeError("value must be a string.");const n=t.preserveEntities?/&(?!(?:#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]+);)/gi:/&/g,r={"<":"<",">":">",'"':""","'":"'"};return e.replace(n,"&").replace(/[<>"']/g,e=>r[e])},exports.extractElementText=function(e,t={}){const{excludeSelector:n="",replaceImagesWithAlt:r=!0,normalizeWhitespace:o=!0}=t,i=e.cloneNode(!0);r&&Array.from(i.querySelectorAll("img[alt]")).forEach(e=>{const t=e.getAttribute("alt")||"";e.parentNode?.replaceChild(i.ownerDocument.createTextNode(t),e)});const s=n.trim();s&&me(s,{root:i})&&Array.from(i.querySelectorAll(s)).forEach(e=>e.parentNode?.removeChild(e));const a=i.innerText||i.textContent||"";return o?a.replace(/\u00a0/g," ").replace(/\s+/g," ").trim():a},exports.fireEvent=Ae,exports.floatFixed=function(e,t=0){return parseFloat(String(e)).toFixed(t)},exports.floatToPercent=function(e,t=0){let n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),`${n}%`},exports.formatByteSize=B,exports.formatDate=m,exports.formatDistanceToNow=function(e){const t=i(e);if(!t)return"";const n=6e4,r=36e5,o=864e5,s=Math.abs(t.getTime()-Date.now());return s<3e4?"less than a minute":s<9e4?"about 1 minute":s<27e5?d(s/n,"minute"):s<54e5?"about 1 hour":s<864e5?d(s/r,"hour"):s<1512e5?"about 1 day":s<30*o?d(s/o,"day"):s<45*o?"about 1 month":s<365*o?d(s/(30*o),"month"):s<545*o?"about 1 year":d(s/(365*o),"year")},exports.formatDurationFromMs=function(e){const t=(Number.isFinite(e)?Math.max(e,0):0)/1e3;return t>=86400?p(t/24/60/60,"day"):t>=3600?p(t/60/60,"hour"):t>=60?p(t/60,"minute"):p(t,"second")},exports.formatLocalDateTime=function(t,n={}){const r="object"==typeof t&&null!==t?e(t):null;if(null===r)throw new TypeError("date must be a Date");if(!Number.isFinite(r))throw new RangeError("Invalid date");const o=n.precision??"minute";if("minute"!==o&&"second"!==o&&"millisecond"!==o)throw new TypeError("precision must be minute, second, or millisecond");const i=new Date(r),s=i.getFullYear();if(s<1)throw new RangeError("Date year must be greater than zero");const c=[a(s,4),a(i.getMonth()+1,2),a(i.getDate(),2)].join("-"),u=[a(i.getHours(),2),a(i.getMinutes(),2)];"minute"!==o&&u.push(a(i.getSeconds(),2));let l=`${c}T${u.join(":")}`;return"millisecond"===o&&(l+=`.${a(i.getMilliseconds(),3)}`),l},exports.genBrowserAttrs=function(e="",t="-"){const n=it(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(o=>{const i=n[o];if(i){let n="";e&&e.length>0&&(n=`${e}${t}`),r.push(`${n}${i}`)}}),r},exports.genCustomConsole=ue,exports.genHashCode=function(e){let t,n,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r},exports.genRndNumString=N,exports.genStyleString=function(e,t){let n="";return t&&t.length>0&&(n=t.join(";")+";"),`${e}{${n}}`},exports.genUniqueNumString=O,exports.generateCalendarVersion=function(e){return m(void 0===e?new Date:new Date(e instanceof Date?e.getTime():e),"yyyy.MMdd.HHmmss").split(".").map(e=>String(Number(e))).join(".")},exports.generateRndNum=$,exports.generateUniqueNum=function(e=3){return O(e)},exports.getAllQueryParams=function(e=""){""===e&&(e=location.search);const t={};return Q(e).forEach(([e,n])=>{Object.hasOwn(t,e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}),t},exports.getBrowserInfo=it,exports.getCLS=async function(){return Ve("layout-shift")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().reduce((e,t)=>{let n=0;return _(t.value)&&(n=t.value),e+n},0);t.disconnect(),e(r)});t.observe({type:"layout-shift",buffered:!0})}):0},exports.getCookie=ze,exports.getCurrentVersion=function(){return"v4"},exports.getDateDifference=f,exports.getDefineListeners=Se,exports.getDomain=function(e,t=["hostname"]){try{const n=new URL(e,document.baseURI);return t.reduce((e,t)=>e+=n[t],"")}catch(n){const r=document.createElement("a");return r.href=e,t.reduce((e,t)=>e+=r[t],"")}},exports.getFCP=Ye,exports.getFID=async function(){return Ve("first-input")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-input"===e.entryType);if(r){t.disconnect();const n=r.processingStart;e(n?Math.round(r.processingStart-r.startTime):0)}});t.observe({type:"first-input",buffered:!0})}):0},exports.getFP=Ze,exports.getFileSize=function(e,t={}){return B(e,t)},exports.getFriendlyInterval=function(e=0,t=0,n=u){return f(e,t,n)},exports.getHashQueryParam=function(e){const t=location.hash.split("?");return 1===t.length?"":G(`?${t.slice(1).join("?")}`,e)[0]||""},exports.getLCP=async function(){return Ve("largest-contentful-paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"largest-contentful-paint"===e.entryType);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"largest-contentful-paint",buffered:!0})}):0},exports.getLocalJSON=Oe,exports.getLocalStorage=De,exports.getPageMeta=function(e){const t=document.getElementsByTagName("meta");for(let n=0;n<t.length;n++)if(t[n].getAttribute("name")===e)return t[n].getAttribute("content")||"";return""},exports.getPerformance=async function(e=!1){if(!Ve("navigation"))return Promise.reject(new Error("navigation is not supported"));const t=window.performance;if(!t||"function"!=typeof t.getEntriesByType)return Promise.reject(new Error("performance is not supported"));let n;const r=new Promise(e=>{[n]=[e]}),o=t.getEntriesByType("navigation");if(!D(o))return Promise.reject(new Error("NavigationTiming is not supported"));const i=o[0];let[s,a,c,u,l,f,p,d,m,g,h,y,w,b,x,v,E,T,A]=new Array(19).fill(0);({decodedBodySize:T,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:p,connectStart:d,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:x,startTime:v,fetchStart:E}=i);let C=0;if(_(v))C=v;else{if(!_(E))return Promise.reject(new Error("startTime, navigationStart or fetchStart are required"));C=E}const[N,$]=await Promise.all([Ze(),Ye()]);function O(){({decodedBodySize:T,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:p,connectStart:d,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:x,startTime:v,fetchStart:E}=i),_(v)?C=v:_(E)&&(C=E);const t={source:"PerformanceNavigationTiming",os:M(),osVersion:j(),deviceType:L(),network:k(),screenDirection:P(),unloadTime:s-a,redirectTime:c-u,dnsTime:l-f,tcpTime:p-d,sslTime:F(p,m),responseTime:g-h,downloadTime:y-g,firstPaintTime:N,firstContentfulPaintTime:$,domReadyTime:w-C,onloadTime:b-C,whiteTime:g-C,renderTime:x-C,decodedBodySize:T,encodedBodySize:A};Object.keys(t).forEach(e=>{_(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))}),_(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);const r={};e||Object.keys(t).forEach(e=>{r[S(e)]=t[e]}),Object.keys(r).length?n(r):n(t)}function M(){let e;return e=navigator.userAgent.indexOf("Android")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others",e}function j(){let e="";const t=navigator.userAgent,n=t.indexOf("Android")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;const i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function L(){let e;const 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",s=t.match(/ucweb/i)&&"ucweb",a=t.match(/android/i)&&"android",c=t.match(/windows ce/i)&&"windows ce",u=t.match(/windows mobile/i)&&"windows mobile";return e=n||r||o||i||s||a||c||u?r||o||i||s||a||c||u?"phone":n?"ipad":void 0:"pc",e||(e=""),e}function k(){let e="";const t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function P(){let e="";return window.screen&&window.screen.orientation&&"number"==typeof 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 F(e,t){let n=0;return t&&(n=e-t),n}return _(x)&&x>0?O():"complete"===document.readyState?window.setTimeout(O,0):window.addEventListener("load",function e(){window.removeEventListener("load",e),window.setTimeout(function(){O()},0)}),r},exports.getQueryParam=function(e){return G(location.search,e)[0]||""},exports.getScriptQueryParam=function(e,t=""){t||(t=".js");const n=document.querySelectorAll("script[src]");for(let r=0;r<n.length;r++){const o=n[r].getAttribute("src");if(o&&-1!==o.indexOf(t)){const t=G(o,e)[0];if(void 0!==t)return t}}return""},exports.getSessionJSON=Ne,exports.getSessionStorage=Me,exports.getSystemTheme=dt,exports.getTTFB=async function(){if(!Ve("navigation"))return 0;if(!window.performance||!window.performance.getEntriesByType)return 0;const e=window.performance.getEntriesByType("navigation")[0];let t=0;return e?(t=e.responseStart-e.requestStart,Math.round(t)):0},exports.getUrlFileType=function(e){let t="";if("string"!=typeof e||""==e)return t;const n=e.split(/[?#]/,1)[0],r=/\.[^/]+$/.exec(n);return r?(r[0].length>1&&(t=r[0].substring(1)),t):t},exports.getUrlHost=function(e){!se(e)&&se(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).host}catch(e){return""}},exports.getUrlParam=function(e,t,n={}){const r=G(e,t);return n.returnArray?r:r.length?r[0]:null},exports.getUrlPath=function(e){!se(e)&&se(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).pathname}catch(e){return""}},exports.hasClass=function(e,t){if(!e)return le.error("The element is not exist."),!1;const n=e.className.split(/\s+/);for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1},exports.hide=function(e){return ve(e).forEach(e=>{"none"!==Ee(e)&&"none"!==e.style.display&&he.set(e,e.style.display),e.style.display="none"}),e},exports.inRate=function(e){return y(e)},exports.invokeEvent=function(e,t){Ae(e,t)},exports.invokeFn=M,exports.isAndroid=function(e){return"android"===rt(e)},exports.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},exports.isBool=k,exports.isBoolean=function(e){return k(e)},exports.isBrowser=function(){if(V)return"browser"===V;const e="undefined"!=typeof window;return e&&(V="browser"),e},exports.isDesktop=function(e){return"desktop"===nt(e)},exports.isFunction=function(e){return"function"==typeof e},exports.isHit=y,exports.isIOS=function(e){return"ios"===rt(e)},exports.isJSONString=C,exports.isJsonString=function(e){return C(e)},exports.isLinux=function(e){return"linux"===rt(e)},exports.isMacOS=function(e){return"macos"===rt(e)},exports.isMobile=q,exports.isNonEmptyArray=D,exports.isNonEmptyObject=function(e){return!!L(e)&&0!==Object.keys(e).length},exports.isNumber=_,exports.isPhone=function(e){return"mobile"===nt(e)},exports.isPureObject=L,exports.isSafePWAEnv=function(e={}){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;const t=e.requireManifest,n=e.scope;if(void 0!==t&&"boolean"!=typeof t||void 0!==n&&"string"!=typeof n)return!1;if(!0!==window.isSecureContext||!("serviceWorker"in navigator))return!1;if(void 0!==n&&!function(e){const t=e.trim();if(!t||/[?#]/.test(t))return!1;try{const e=new URL(window.location.href),n=new URL(t,e);if(n.origin!==e.origin||""!==n.search||""!==n.hash)return!1;if(e.pathname===n.pathname)return!0;const r=n.pathname.endsWith("/")?n.pathname:`${n.pathname}/`;return e.pathname.startsWith(r)}catch(e){return!1}}(n))return!1;if(!1===t)return!0;if("undefined"==typeof document)return!1;const r=document.querySelector('link[rel~="manifest"][href]');return Boolean(r?.getAttribute("href")?.trim())}catch(e){return!1}},exports.isStandalonePWA=function(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator;try{const e=window.matchMedia;if("function"==typeof e&&e.call(window,"(display-mode: standalone)").matches)return!0}catch(e){}try{return!0===e.standalone}catch(e){return!1}},exports.isString=function(e){return"string"==typeof e},exports.isSupportWebp=function(){return st?Promise.resolve("webp"===st):new Promise(e=>{const t=new Image;t.onload=()=>{const n=t.width>0&&t.height>0;st=n?"webp":"no-webp",e(n)},t.onerror=()=>{st="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})},exports.isSupportedEntryType=Ve,exports.isTablet=function(e){return"tablet"===nt(e)},exports.isThisHour=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()&&t.getHours()===n.getHours()},exports.isThisMonth=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()},exports.isThisWeek=function(e){const t=i(e);if(!t)return!1;const n=new Date,r=(n.getDay()+6)%7;n.setHours(0,0,0,0),n.setDate(n.getDate()-r);const o=new Date(n.getTime());o.setDate(o.getDate()+7);const s=t.getTime();return s>=n.getTime()&&s<o.getTime()},exports.isThisYear=function(e){const t=i(e);return null!==t&&t.getFullYear()===(new Date).getFullYear()},exports.isToday=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},exports.isUdfOrNul=function(e){return null==e},exports.isValidCssSelector=me,exports.isValidData=function(e,t,n){if(null===e||"object"!=typeof e)return!1;let r=e;for(const e of t){if(null===r||"object"!=typeof r&&"function"!=typeof r||!Object.hasOwn(r,e))return!1;r=r[e]}return r===n},exports.isValidDate=function(e){return null!==i(e)},exports.isValidEmail=function(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},exports.isValidHttpUrl=se,exports.isValidPhoneNumber=H,exports.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)},exports.isWindows=function(e){return"windows"===rt(e)},exports.listenMediaQueryChanges=function(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");if(null===e)return()=>{};if("object"!=typeof e)throw new TypeError("media must be a MediaQueryList or null");const n=e.addEventListener,r=e.removeEventListener;let o=null;if("function"==typeof n&&"function"==typeof r){const i=t;n.call(e,"change",i),o=()=>r.call(e,"change",i)}let i=!1;return()=>{i||(i=!0,o?.())}},exports.loadCSS=Be,exports.loadImage=function(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})},exports.loadScript=qe,exports.loadScriptIfUndefined=function(e,t){if(window[e])return Promise.resolve("defined");let n=We.get(e);const r=n?.get(t);if(r)return r;n||(n=new Map,We.set(e,n));const o=()=>{n?.delete(t),0===n?.size&&We.delete(e)},i=qe(t).then(e=>(o(),e),e=>{throw o(),e});return n.set(t,i),i},exports.longestComSubsequence=h,exports.longestComSubstring=g,exports.mNow=c,exports.mTrim=function(e){return e.trim()},exports.mazeyCon=le,exports.newLine=function(e){return P(e)},exports.onURLChange=function(e,t={}){const{fireOnInit:n=!0}=t,r=history;let o=location.href;const i=[],s=t=>{const n=location.href;if(n===o&&"load"!==t)return;const r=o;o=n,e({url:n,oldUrl:r,trigger:t})},a=()=>s("popstate"),c=()=>s("hashchange");window.addEventListener("popstate",a),window.addEventListener("hashchange",c),i.push(()=>window.removeEventListener("popstate",a)),i.push(()=>window.removeEventListener("hashchange",c)),r.__mazeyUrlChangePatched__||(r.__mazeyUrlChangePatched__=!0,r.__mazeyUrlChangeSubscribers__=new Set,r.__mazeyRawPushState__=history.pushState.bind(history),r.__mazeyRawReplaceState__=history.replaceState.bind(history),history.pushState=function(...e){r.__mazeyRawPushState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("pushState"))},history.replaceState=function(...e){r.__mazeyRawReplaceState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("replaceState"))});const u=e=>s(e);return r.__mazeyUrlChangeSubscribers__.add(u),i.push(()=>r.__mazeyUrlChangeSubscribers__.delete(u)),n&&s("load"),()=>{i.forEach(e=>e())}},exports.parseGitHubRepository=function(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.trim();if(!t||/[%\\?#]/.test(t)||function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<=31||127===n)return!0}return!1}(t))throw ee();const n=t.match(/^(?:github:)?([^/:\s]+)\/([^/\s]+)$/i);if(n)return te(n[1],n[2]);const r=t.match(/^git@([^:\s]+):([^/\s]+)\/([^/\s]+)$/);if(r&&"github.com"===r[1].toLowerCase())return te(r[2],r[3]);const o=t.replace(/^git\+(?=(?:git|ssh|https?):\/\/)/i,""),i=o.match(/^[a-z][a-z\d+.-]*:\/\/([^/?#]+)/i);if(!i||/(^|\/)\.{1,2}(?:\/|$)/.test(o.slice(i[0].length)))throw ee();if(-1!==i[1].slice(i[1].lastIndexOf("@")+1).indexOf(":"))throw ee();let s;try{s=new URL(o)}catch(e){throw ee()}const a=s.protocol.toLowerCase(),c=s.hostname.toLowerCase().replace(/^www\./,"");if(!["git:","ssh:","http:","https:"].includes(a)||"github.com"!==c||""!==s.username&&"git"!==s.username||""!==s.password||""!==s.search||""!==s.hash)throw ee();const u=s.pathname.match(/^\/([^/]+)\/([^/]+)\/?$/);if(!u)throw ee();return te(u[1],u[2])},exports.parseJsonSafe=function(e,t=null){try{return JSON.parse(e)}catch(e){return t}},exports.parseLocalDateTime=function(e){if("string"!=typeof e)return null;const t=s.exec(e);if(!t)return null;const[n,i,a,c,u,l="0",f=""]=t.slice(1),p=Number(n),d=Number(i),m=Number(a),g=Number(c),h=Number(u),y=Number(l),w=Number(`${f}00`.slice(0,3));return p<1||!r(p,d,m,g,h,y,w)?null:o(p,d,m,g,h,y,w)},exports.removeClass=function(e,t){if(!e)return void le.error("The element is not exist.");let n;n=" "+e.className+" ",n=n.replace(/(\s+)/gi," "),n=n.replace(" "+t+" "," "),n=n.replace(/(^\s+)|(\s+$)/g,""),e.className=n},exports.removeCookie=Ie,exports.removeEvent=function(e,t){const n=Se(),r=n[e];if("string"==typeof e&&Array.isArray(r))if("function"==typeof t){for(let o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]},exports.removeHTML=F,exports.removeHtml=function(e,t={}){return F(e,t)},exports.repeatUntilConditionMet=function(e,t={},n=e=>!0===e){const{interval:r=1e3,times:o=10,context:i,args:s}=t;if("function"!=typeof e)return void console.error("Expected a function.");if(!Number.isFinite(r)||r<0)return void console.error("Expected a non-negative number for interval.");if(!Number.isFinite(o)||o<0)return void console.error("Expected a non-negative number for times.");if(0===o)return;let a=0;const c=()=>{setTimeout(async()=>{const t=await e.apply(i,s);n(t)||++a>=o||c()},r)};c()},exports.replaceHttp=function(e){return ae(e)},exports.resolveElementTarget=function(e,t){if(void 0===e)return ge(t.defaultElement)?t.defaultElement:null;let n=t.unwrap?t.unwrap(e):e;if(null==n)return null;if("string"==typeof n)try{return t.root.querySelector(n)}catch(e){return null}return"object"==typeof n&&"$el"in n&&(n=n.$el),ge(n)?n:null},exports.resolveLanguagePreference=function(e){at(e);const t=ht(ct("lang"));if(t)return wt(t);const n=ht(ut(e));return wt(n||(ht(function(){if("undefined"==typeof window||"undefined"==typeof navigator)return null;try{return"string"==typeof navigator.language?navigator.language:null}catch(e){return null}}())??"en"))},exports.resolveThemePreference=function(e){at(e);const t=ct("theme");if(pt(t))return lt(e,t),mt(t,t);const n=ut(e);if(pt(n))return mt(n,n);const r=dt();return"system"===n&&r||r?mt(r,"system"):mt("light","light")},exports.sanitizeInput=function(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,e=>t[e])},exports.setClass=function(e,t){pe(e,t)},exports.setCookie=function(e,t,n,r){let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";const i=function(e){let t=!0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(!(33===r||r>=35&&r<=43||r>=45&&r<=58||r>=60&&r<=91||r>=93&&r<=126)){t=!1;break}}return{isEncoded:!t,value:t?e:encodeURIComponent(e)}}(t),s=Fe(e),a=i.isEncoded?"1":"",c=i.isEncoded?o:"; expires=Thu, 01 Jan 1970 00:00:00 GMT",u=[`${s}=${i.value}${o}; path=/`,`${Pe(e)}=${a}${c}; path=/`],l=e=>{const t=e?`; domain=${e}`:"";u.forEach(e=>{document.cookie=`${e}${t}`})},f=location.hostname;if(r)l(r);else if(-1===f.indexOf("."))l();else{const n=f.split(".");n.shift();l("."+n.join(".")),ze(e)!==t&&l(`.${f}`)}},exports.setImgSizeBySrc=de,exports.setImgWidHeiBySrc=function(){return de()},exports.setLanguagePreference=function(e,t){at(e);const n=ht(t);if(!n)throw new TypeError("language must be a valid language tag.");return lt(e,n)},exports.setLocalJSON=$e,exports.setLocalStorage=je,exports.setSessionJSON=Ce,exports.setSessionStorage=_e,exports.setThemePreference=function(e,t){if(at(e),!function(e){return"system"===e||pt(e)}(t))throw new TypeError('value must be "system", "light", or "dark".');return lt(e,t)},exports.sha256Hex=async function(e){const t="undefined"==typeof crypto?null:crypto;if(!t?.subtle||"function"!=typeof t.subtle.digest)throw new Error("Web Crypto API is not available.");let n=e;if("string"==typeof e){if("undefined"==typeof TextEncoder)throw new Error("TextEncoder is not available.");n=(new TextEncoder).encode(e)}const r=await t.subtle.digest("SHA-256",n);let o="";const i=new Uint8Array(r);for(let e=0;e<i.length;e++){const t=i[e].toString(16);o+=1===t.length?`0${t}`:t}return o},exports.show=function(e){return ve(e).forEach(e=>{he.has(e)?(e.style.display=he.get(e),he.delete(e)):"none"===e.style.display&&(e.style.display=""),""===e.style.display&&"none"===Ee(e)&&(e.style.display=Te(e))}),e},exports.sleep=async function(e){return W(e)},exports.subYears=function(t,n){const r="number"==typeof t?t:"object"==typeof t&&null!==t?e(t):null,o=new Date(r??NaN),i="number"==typeof n?n<0?Math.ceil(n):Math.floor(n):NaN;if(!Number.isFinite(o.getTime())||!Number.isFinite(i))return new Date(NaN);if(0===i)return o;const s=o.getMonth(),a=o.getDate(),c=o.getFullYear()-i,u=new Date(o.getTime());return u.setFullYear(c,s+1,0),a>=u.getDate()?u:(o.setFullYear(c,s,a),o)},exports.throttle=function(e,t,n={}){n=Object.assign({},n);let r=null,o=null,i=null,[s,a]=[null,0];const u=function(){a=!1===n.leading?0:c(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(...l){const f=c();a||!1!==n.leading||(a=f);const p=t-(f-a);return r=this,o=l,p<=0||p>t?(i&&(clearTimeout(i),i=null),a=f,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(u.bind(r),p)),s}},exports.timeCon=fe,exports.toJavaScriptGlobalName=A,exports.truncateZHString=z,exports.unsanitize=function(e){return R(e)},exports.unsanitizeInput=R,exports.updateQueryParam=function(e,t,n){const r=e.indexOf("#"),o=-1===r?"":e.slice(r),i=-1===r?e:e.slice(0,r),s=i.indexOf("?"),a=-1===s?i:i.slice(0,s),c=-1===s?"":i.slice(s+1),u=encodeURIComponent(t),l=encodeURIComponent(n);let f=!1;const p=(c?c.split("&").filter(Boolean):[]).reduce((e,n)=>{const r=n.indexOf("=");return J(-1===r?n:n.slice(0,r))===t?f||(e.push(`${u}=${l}`),f=!0):e.push(n),e},[]);return f||p.push(`${u}=${l}`),`${a}?${p.join("&")}${o}`},exports.waitTime=W,exports.watchServiceWorkerUpdates=function(e,t,n){if(null===e||"object"!=typeof e||"function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)throw new TypeError("registration must support event listeners");if(null===t||"object"!=typeof t||"function"!=typeof t.addEventListener||"function"!=typeof t.removeEventListener)throw new TypeError("container must support event listeners");if(null===n||"object"!=typeof n||"function"!=typeof n.onUpdateAvailable||void 0!==n.onControllerChange&&"function"!=typeof n.onControllerChange)throw new TypeError("callbacks must provide onUpdateAvailable");let r=!1,o=null,i=null,s=!1,a=!1;const c=e=>{r||i===e||(i=e,n.onUpdateAvailable(e))},u=()=>{!r&&"installed"===o?.state&&t.controller&&c(o)},l=()=>{r||(o?.removeEventListener("statechange",u),o=e.installing,o?.addEventListener("statechange",u),u())},f=()=>{r||n.onControllerChange?.()},p=()=>{if(s){try{e.removeEventListener("updatefound",l)}catch(e){}s=!1}try{o?.removeEventListener("statechange",u)}catch(e){}if(a){try{t.removeEventListener("controllerchange",f)}catch(e){}a=!1}};try{e.addEventListener("updatefound",l),s=!0,t.addEventListener("controllerchange",f),a=!0,e.waiting&&t.controller&&c(e.waiting),e.installing&&l()}catch(e){throw r=!0,p(),o=null,i=null,e}return{activateWaiting(e={type:"SKIP_WAITING"}){if(r||!i)return!1;try{return i.postMessage(e),!0}catch(e){return!1}},dispose(){r||(r=!0,p(),o=null,i=null)}}},exports.windowLoaded=function(e=3e4){return new Promise((t,n)=>{let r=null;const o=()=>{window.removeEventListener("load",i),null!==r&&(clearTimeout(r),r=null)},i=()=>{o(),t("load")};"complete"!==document.readyState?(window.addEventListener("load",i),r=setTimeout(()=>{o(),n(new Error("timeout"))},e)):t("complete")})},exports.zAxiosIsValidRes=function(e,t={validStatusRange:[200,300],validCode:[0]}){const n=t||{},{validStatusRange:r=[200,300],validCode:o=[0]}=n;2!==r.length&&console.error("valid validStatusRange is required");let i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){const t=e.data;t&&o.includes(t.code)&&(i=!0)}return i};
|
package/lib/index.d.ts
CHANGED
|
@@ -96,6 +96,40 @@ interface OnURLChangeOptions {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
type InvestmentReturnRate = number | string;
|
|
99
|
+
/**
|
|
100
|
+
* Calculate the exact simplified aspect ratio of a width and height.
|
|
101
|
+
*
|
|
102
|
+
* The ratio is reduced using the greatest common divisor and returned with a
|
|
103
|
+
* lowercase `x` separator. The function does not approximate the result to a
|
|
104
|
+
* commonly named image or video ratio.
|
|
105
|
+
*
|
|
106
|
+
* Usage:
|
|
107
|
+
*
|
|
108
|
+
* ```typescript
|
|
109
|
+
* import { calculateAspectRatio } from "mazey";
|
|
110
|
+
*
|
|
111
|
+
* const portraitRatio = calculateAspectRatio(900, 1200);
|
|
112
|
+
* const landscapeRatio = calculateAspectRatio(1920, 1080);
|
|
113
|
+
*
|
|
114
|
+
* console.log(portraitRatio);
|
|
115
|
+
* console.log(landscapeRatio);
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* Output:
|
|
119
|
+
*
|
|
120
|
+
* ```text
|
|
121
|
+
* 3x4
|
|
122
|
+
* 16x9
|
|
123
|
+
* ```
|
|
124
|
+
*
|
|
125
|
+
* @param width Positive safe-integer width.
|
|
126
|
+
* @param height Positive safe-integer height.
|
|
127
|
+
* @returns The exact simplified aspect ratio in `WxH` form.
|
|
128
|
+
* @throws {TypeError} If width or height is not a safe integer.
|
|
129
|
+
* @throws {RangeError} If width or height is not greater than zero.
|
|
130
|
+
* @category Calculate and Formula
|
|
131
|
+
*/
|
|
132
|
+
declare function calculateAspectRatio(width: number, height: number): string;
|
|
99
133
|
/**
|
|
100
134
|
* Calculate an investment's Compound Annual Growth Rate (CAGR).
|
|
101
135
|
*
|
|
@@ -4495,5 +4529,5 @@ declare const mazeyCon: Console;
|
|
|
4495
4529
|
*/
|
|
4496
4530
|
declare const timeCon: Console;
|
|
4497
4531
|
|
|
4498
|
-
export { addClass, addEvent, addStyle, assignDefined, calLongestCommonSubsequence, calLongestCommonSubstring, calculateCAGR, camelCase2Underscore, camelCaseToKebabCase, cancelBubble, clearHTML, clearHtml, convert10To26, convertCamelToKebab, convertCamelToUnder, convertHttpToHttps, convertKebabToCamel, convertObjectToQuery, convertToHtmlBreaks, convertUnderToCamel, cutCHSString, cutZHString, debounce, deepCopy, deepCopyObject, deepFreeze, delCookie, derivePackageMetadata, detectVisitorType, doFn, escapeHtmlAttribute, extractElementText, fireEvent, floatFixed, floatToPercent, formatByteSize, formatDate, formatDistanceToNow, formatDurationFromMs, formatLocalDateTime, genBrowserAttrs, genCustomConsole, genHashCode, genRndNumString, genStyleString, genUniqueNumString, generateCalendarVersion, generateRndNum, generateUniqueNum, getAllQueryParams, getBrowserInfo, getCLS, getCookie, getCurrentVersion, getDateDifference, getDefineListeners, getDomain, getFCP, getFID, getFP, getFileSize, getFriendlyInterval, getHashQueryParam, getLCP, getLocalJSON, getLocalStorage, getPageMeta, getPerformance, getQueryParam, getScriptQueryParam, getSessionJSON, getSessionStorage, getSystemTheme, getTTFB, getUrlFileType, getUrlHost, getUrlParam, getUrlPath, hasClass, hide, inRate, invokeEvent, invokeFn, isAndroid, isArray, isBool, isBoolean, isBrowser, isDesktop, isFunction, isHit, isIOS, isJSONString, isJsonString, isLinux, isMacOS, isMobile, isNonEmptyArray, isNonEmptyObject, isNumber, isPhone, isPureObject, isSafePWAEnv, isStandalonePWA, isString, isSupportWebp, isSupportedEntryType, isTablet, isThisHour, isThisMonth, isThisWeek, isThisYear, isToday, isUdfOrNul, isValidCssSelector, isValidData, isValidDate, isValidEmail, isValidHttpUrl, isValidPhoneNumber, isValidUrl, isWindows, listenMediaQueryChanges, loadCSS, loadImage, loadScript, loadScriptIfUndefined, longestComSubsequence, longestComSubstring, mNow, mTrim, mazeyCon, newLine, onURLChange, parseGitHubRepository, parseJsonSafe, parseLocalDateTime, removeClass, removeCookie, removeEvent, removeHTML, removeHtml, repeatUntilConditionMet, replaceHttp, resolveElementTarget, resolveLanguagePreference, resolveThemePreference, sanitizeInput, setClass, setCookie, setImgSizeBySrc, setImgWidHeiBySrc, setLanguagePreference, setLocalJSON, setLocalStorage, setSessionJSON, setSessionStorage, setThemePreference, sha256Hex, show, sleep, subYears, throttle, timeCon, toJavaScriptGlobalName, truncateZHString, unsanitize, unsanitizeInput, updateQueryParam, waitTime, watchServiceWorkerUpdates, windowLoaded, zAxiosIsValidRes };
|
|
4532
|
+
export { addClass, addEvent, addStyle, assignDefined, calLongestCommonSubsequence, calLongestCommonSubstring, calculateAspectRatio, calculateCAGR, camelCase2Underscore, camelCaseToKebabCase, cancelBubble, clearHTML, clearHtml, convert10To26, convertCamelToKebab, convertCamelToUnder, convertHttpToHttps, convertKebabToCamel, convertObjectToQuery, convertToHtmlBreaks, convertUnderToCamel, cutCHSString, cutZHString, debounce, deepCopy, deepCopyObject, deepFreeze, delCookie, derivePackageMetadata, detectVisitorType, doFn, escapeHtmlAttribute, extractElementText, fireEvent, floatFixed, floatToPercent, formatByteSize, formatDate, formatDistanceToNow, formatDurationFromMs, formatLocalDateTime, genBrowserAttrs, genCustomConsole, genHashCode, genRndNumString, genStyleString, genUniqueNumString, generateCalendarVersion, generateRndNum, generateUniqueNum, getAllQueryParams, getBrowserInfo, getCLS, getCookie, getCurrentVersion, getDateDifference, getDefineListeners, getDomain, getFCP, getFID, getFP, getFileSize, getFriendlyInterval, getHashQueryParam, getLCP, getLocalJSON, getLocalStorage, getPageMeta, getPerformance, getQueryParam, getScriptQueryParam, getSessionJSON, getSessionStorage, getSystemTheme, getTTFB, getUrlFileType, getUrlHost, getUrlParam, getUrlPath, hasClass, hide, inRate, invokeEvent, invokeFn, isAndroid, isArray, isBool, isBoolean, isBrowser, isDesktop, isFunction, isHit, isIOS, isJSONString, isJsonString, isLinux, isMacOS, isMobile, isNonEmptyArray, isNonEmptyObject, isNumber, isPhone, isPureObject, isSafePWAEnv, isStandalonePWA, isString, isSupportWebp, isSupportedEntryType, isTablet, isThisHour, isThisMonth, isThisWeek, isThisYear, isToday, isUdfOrNul, isValidCssSelector, isValidData, isValidDate, isValidEmail, isValidHttpUrl, isValidPhoneNumber, isValidUrl, isWindows, listenMediaQueryChanges, loadCSS, loadImage, loadScript, loadScriptIfUndefined, longestComSubsequence, longestComSubstring, mNow, mTrim, mazeyCon, newLine, onURLChange, parseGitHubRepository, parseJsonSafe, parseLocalDateTime, removeClass, removeCookie, removeEvent, removeHTML, removeHtml, repeatUntilConditionMet, replaceHttp, resolveElementTarget, resolveLanguagePreference, resolveThemePreference, sanitizeInput, setClass, setCookie, setImgSizeBySrc, setImgWidHeiBySrc, setLanguagePreference, setLocalJSON, setLocalStorage, setSessionJSON, setSessionStorage, setThemePreference, sha256Hex, show, sleep, subYears, throttle, timeCon, toJavaScriptGlobalName, truncateZHString, unsanitize, unsanitizeInput, updateQueryParam, waitTime, watchServiceWorkerUpdates, windowLoaded, zAxiosIsValidRes };
|
|
4499
4533
|
export type { DerivePackageMetadataOptions, DerivedPackageMetadata, DomVisibilityTarget, FormatByteSizeOptions, GitHubRepositoryDetails, InvestmentReturnRate, IsSafePWAEnvOptions, LocalDateTimePrecision, PackageManager, PackageManifest, PackageManifestAuthor, PreferenceResult, ResolveElementTargetOptions, ResolvedTheme, ServiceWorkerUpdateCallbacks, ServiceWorkerUpdateWatcher, ThemePreference, VisitorType };
|
package/lib/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Mazey v5.7.
|
|
2
|
+
* Mazey v5.7.3 https://github.com/chengchuu/mazey
|
|
3
3
|
* (c) 2018-2026 Cheng
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
function e(e){try{return Date.prototype.getTime.call(e)}catch(e){return null}}const t=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/,n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;function r(e,t,n,r,o,i,s=0,c=!1){const u=new Date(0);return c?(u.setUTCFullYear(e,t-1,n),u.setUTCHours(r,o,i,s),Number.isFinite(u.getTime())&&u.getUTCFullYear()===e&&u.getUTCMonth()===t-1&&u.getUTCDate()===n&&u.getUTCHours()===r&&u.getUTCMinutes()===o&&u.getUTCSeconds()===i&&u.getUTCMilliseconds()===s):(u.setFullYear(e,t-1,n),u.setHours(r,o,i,s),Number.isFinite(u.getTime())&&u.getFullYear()===e&&u.getMonth()===t-1&&u.getDate()===n&&u.getHours()===r&&u.getMinutes()===o&&u.getSeconds()===i&&u.getMilliseconds()===s)}function o(e,t,n,r,o,i,s=0){const c=new Date(0);return c.setFullYear(e,t-1,n),c.setHours(r,o,i,s),c}function i(i){if("number"==typeof i){const e=new Date(i);return Number.isFinite(i)&&Number.isFinite(e.getTime())?e:null}if("object"==typeof i&&null!==i){const t=e(i);return null!==t&&Number.isFinite(t)?new Date(t):null}if("string"!=typeof i)return null;const s=i.trim();if(!s)return null;const c=t.exec(s);if(c){const[e,t,n,i="0",s="0",u="0"]=c.slice(1),[a,l,f,d,p,m]=[e,t,n,i,s,u].map(Number);return r(a,l,f,d,p,m)?o(a,l,f,d,p,m):null}const u=n.exec(s);if(!u)return null;const[a,l,f,d,p,m="0",g="",h]=u.slice(1),w=Number(`${g}00`.slice(0,3));if(!r(Number(a),Number(l),Number(f),Number(d),Number(p),Number(m),w,!0))return null;if("Z"!==h){const e=Number(h.slice(1,3)),t=Number(h.slice(4,6));if(e>23||t>59)return null}return function(e,t,n,r,o,i,s,c){const u=new Date(0);if(u.setUTCFullYear(e,t-1,n),u.setUTCHours(r,o,i,s),"Z"===c)return u;const a="+"===c[0]?1:-1,l=60*Number(c.slice(1,3))+Number(c.slice(4,6));return new Date(u.getTime()-a*l*60*1e3)}(Number(a),Number(l),Number(f),Number(d),Number(p),Number(m),w,h)}const s=/^(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function c(e,t){const n=String(e);return n.length>=t?n:`${"0".repeat(t-n.length)}${n}`}function u(e){if("string"!=typeof e)return null;const t=s.exec(e);if(!t)return null;const[n,i,c,u,a,l="0",f=""]=t.slice(1),d=Number(n),p=Number(i),m=Number(c),g=Number(u),h=Number(a),w=Number(l),y=Number(`${f}00`.slice(0,3));return d<1||!r(d,p,m,g,h,w,y)?null:o(d,p,m,g,h,w,y)}function a(t,n={}){const r="object"==typeof t&&null!==t?e(t):null;if(null===r)throw new TypeError("date must be a Date");if(!Number.isFinite(r))throw new RangeError("Invalid date");const o=n.precision??"minute";if("minute"!==o&&"second"!==o&&"millisecond"!==o)throw new TypeError("precision must be minute, second, or millisecond");const i=new Date(r),s=i.getFullYear();if(s<1)throw new RangeError("Date year must be greater than zero");const u=[c(s,4),c(i.getMonth()+1,2),c(i.getDate(),2)].join("-"),a=[c(i.getHours(),2),c(i.getMinutes(),2)];"minute"!==o&&a.push(c(i.getSeconds(),2));let l=`${u}T${a.join(":")}`;return"millisecond"===o&&(l+=`.${c(i.getMilliseconds(),3)}`),l}function l(t,n){const r="number"==typeof t?t:"object"==typeof t&&null!==t?e(t):null,o=new Date(r??NaN),i="number"==typeof n?n<0?Math.ceil(n):Math.floor(n):NaN;if(!Number.isFinite(o.getTime())||!Number.isFinite(i))return new Date(NaN);if(0===i)return o;const s=o.getMonth(),c=o.getDate(),u=o.getFullYear()-i,a=new Date(o.getTime());a.setFullYear(u,s+1,0);return c>=a.getDate()?a:(o.setFullYear(u,s,c),o)}function f(){return Date.now()}const d={type:"d"};function p(e){return"string"==typeof e&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T"):e}function m(e=0,t=0,n=d){n=Object.assign({},d,n);const{type:r}=n;"number"==typeof e&&Number.isFinite(e)||(e=new Date(p(e)).getTime()),"number"==typeof t&&Number.isFinite(t)||(t=new Date(p(t)).getTime());const o=Number(t)-Number(e);let i="",[s,c,u,a]=new Array(4).fill(0);if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),c=Math.floor(o/1e3/60/60),u=Math.floor(o/1e3/60),a=Math.floor(o/1e3),r){case"d":i=s;break;case"text":s=Math.floor(o/1e3/60/60/24),c=Math.floor(o/1e3/60/60%24),u=Math.floor(o/1e3/60%60),a=Math.floor(o/1e3%60),i=[{value:s,unit:"day"},{value:c,unit:"hour"},{value:u,unit:"minute"},{value:a,unit:"second"}].filter(({value:e})=>e>0).map(({value:e,unit:t})=>h(e,t)).join(" ")||h(0,"second");break;default:i=a}return i}function g(e=0,t=0,n=d){return m(e,t,n)}function h(e,t){const n=Math.round(10*e)/10;return`${n} ${1===n?t:`${t}s`}`}function w(e){const t=(Number.isFinite(e)?Math.max(e,0):0)/1e3;return t>=86400?h(t/24/60/60,"day"):t>=3600?h(t/60/60,"hour"):t>=60?h(t/60,"minute"):h(t,"second")}function y(e){return null!==i(e)}function b(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function v(e){const t=i(e);return null!==t&&t.getFullYear()===(new Date).getFullYear()}function E(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()}function T(e){const t=i(e);if(!t)return!1;const n=new Date,r=(n.getDay()+6)%7;n.setHours(0,0,0,0),n.setDate(n.getDate()-r);const o=new Date(n.getTime());o.setDate(o.getDate()+7);const s=t.getTime();return s>=n.getTime()&&s<o.getTime()}function A(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()&&t.getHours()===n.getHours()}function S(e,t){const n=Math.max(1,Math.round(e));return`about ${n} ${t}${1===n?"":"s"}`}function $(e){const t=i(e);if(!t)return"";const n=6e4,r=36e5,o=864e5,s=Math.abs(t.getTime()-Date.now());return s<3e4?"less than a minute":s<9e4?"about 1 minute":s<27e5?S(s/n,"minute"):s<54e5?"about 1 hour":s<864e5?S(s/r,"hour"):s<1512e5?"about 1 day":s<30*o?S(s/o,"day"):s<45*o?"about 1 month":s<365*o?S(s/(30*o),"month"):s<545*o?"about 1 year":S(s/(365*o),"year")}function _(e,t="yyyy-MM-dd"){void 0===e&&(e=new Date);const n=new Date(e);if(!Number.isFinite(n.getTime()))throw new RangeError("Invalid date");const 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"};let i=t||"yyyy-MM-dd";return Object.keys(o).forEach(e=>{let t=o[e];"MM"===e&&Number(t)<=9&&(t=`0${t}`),i=i.split(e).join(String(t))}),i}function O(e){return _(void 0===e?new Date:new Date(e instanceof Date?e.getTime():e),"yyyy.MMdd.HHmmss").split(".").map(e=>String(Number(e))).join(".")}function x(e,t,n){const r=i(e);if(!r)throw new TypeError("startDate must be a valid date.");const o=i(t);if(!o)throw new TypeError("endDate must be a valid date.");const s=o.getTime()-r.getTime();if(s<=0)throw new RangeError("endDate must be later than startDate.");const c=function(e){if("number"==typeof e){if(!Number.isFinite(e))throw new TypeError("totalReturnRate must be a finite number or percentage string.");return e}if("string"!=typeof e)throw new TypeError("totalReturnRate must be a finite number or percentage string.");const t=e.trim();if(!t)throw new TypeError("totalReturnRate must not be empty.");const n=t.endsWith("%")?t.slice(0,-1).trim():t;if(!n)throw new TypeError("totalReturnRate must be a valid percentage string.");const r=Number(n);if(!Number.isFinite(r))throw new TypeError("totalReturnRate must be a valid percentage string.");return r/100}(n);if(c<=-1)throw new RangeError("totalReturnRate must be greater than -1.");const u=s/864e5,a=Math.pow(1+c,365/u)-1;if(!Number.isFinite(a))throw new RangeError("calculated CAGR must be finite.");return a}function N(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));let i=0;for(let s=0;s<n;++s)for(let n=0;n<r;++n)if(e[s]===t[n]){let e=0;s>0&&n>0&&(e=o[s-1][n-1]),o[s][n]=e+1,i=Math.max(i,o[s][n])}return i}function j(e,t){return N(e,t)}function C(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));for(let i=0;i<n;++i)for(let n=0;n<r;++n)if(e[i]===t[n]){let e=0;i>0&&n>0&&(e=o[i-1][n-1]),o[i][n]=e+1}else{let[e,t]=[0,0];n>0&&(e=o[i][n-1]),i>0&&(t=o[i-1][n]),o[i][n]=Math.max(e,t)}return o[n-1][r-1]}function M(e,t){return C(e,t)}function D(e){return Math.random()<e}function k(e){return D(e)}const F=Function.prototype.toString.call(Object);function L(e,t,n){const r=Object.getOwnPropertyDescriptor(t,n)?.get;if(!r)return!1;try{return r.call(e),!0}catch(e){return!1}}function R(e){return null===e||"object"!=typeof e?e:z(e,new WeakMap)}function z(t,n){if(null===t||"object"!=typeof t)return t;const r=t,o=n.get(r);if(void 0!==o)return o;const i=e(r);if(null!==i){const e=new Date(i);return n.set(r,e),e}const s=function(e){const t=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get;if(!t)return null;try{return t.call(e)}catch(e){return null}}(r);if(null!==s){const e=t,o=new RegExp(s,function(e){return e.flags}(e));return o.lastIndex=e.lastIndex,n.set(r,o),o}if("undefined"!=typeof ArrayBuffer&&L(r,ArrayBuffer.prototype,"byteLength")){const e=ArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof SharedArrayBuffer&&L(r,SharedArrayBuffer.prototype,"byteLength")){const e=SharedArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)){const e=z(t.buffer,n),o="undefined"!=typeof DataView&&L(r,DataView.prototype,"byteLength")?new DataView(e,t.byteOffset,t.byteLength):new t.constructor(e,t.byteOffset,t.length);return n.set(r,o),o}if("undefined"!=typeof Map&&L(r,Map.prototype,"size")){const e=new Map;return n.set(r,e),Map.prototype.forEach.call(t,(t,r)=>{e.set(z(r,n),z(t,n))}),e}if("undefined"!=typeof Set&&L(r,Set.prototype,"size")){const e=new Set;return n.set(r,e),Set.prototype.forEach.call(t,t=>{e.add(z(t,n))}),e}const c=Array.isArray(t),u=Object.getPrototypeOf(t),a=function(e){const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.hasOwn(t,"constructor")?t.constructor:null;return"function"==typeof n&&Function.prototype.toString.call(n)===F}(r),l=!c&&!a&&function(e){const t=Object.getPrototypeOf(e),n=t?.constructor;return"function"==typeof n&&-1===Function.prototype.toString.call(n).indexOf("[native code]")}(r);if(!c&&!a&&!l)return n.set(r,t),t;const f=c?new Array(t.length):Object.create(l?Object.prototype:u);return n.set(r,f),function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}(r).forEach(e=>{if(c&&"length"===e)return;const t=Object.getOwnPropertyDescriptor(r,e);t&&("value"in t&&(t.value=z(t.value,n)),Object.defineProperty(f,e,t))}),f}function P(e){return!e||"object"!=typeof e||Object.isFrozen(e)||(Object.freeze(e),Object.values(e).forEach(P)),e}function U(e,...t){return t.forEach(t=>{void 0!==t&&Object.keys(t).forEach(n=>{const r=t[n];if(void 0!==r){const t=e;"__proto__"!==n||Object.hasOwn(e,n)?t[n]=r:Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0})}})}),e}function I(e){return R(e)}function B(e){const t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function q(e){const t=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return t.endsWith("-")?t.slice(0,-1):t}function Y(e){return B(e)}function W(e){const t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function Z(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())}function H(e){return W(e)}function V(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.replace(/[^A-Za-z0-9_$]/g,"_").toUpperCase();return/^[A-Za-z_$]/.test(t)?t:`_${t}`}function J(e){return e.trim()}function G(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){}return!1}function Q(e){return G(e)}function K(e,t=null){try{return JSON.parse(e)}catch(e){return t}}function X(e=5){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e--;)t+=Math.floor(10*Math.random());return t}function ee(e=5){return X(e)}function te(e=3){const[t,n]=[f(),ee(e||3)];return t+n}function ne(e=3){return te(e)}function re(e,t=0){let n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),`${n}%`}function oe(e,t=0){return parseFloat(String(e)).toFixed(t)}function ie(e,t,n={}){n=Object.assign({},n);let r=null,o=null,i=null,[s,c]=[null,0];const u=function(){c=!1===n.leading?0:f(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(...a){const l=f();c||!1!==n.leading||(c=l);const d=t-(l-c);return r=this,o=a,d<=0||d>t?(i&&(clearTimeout(i),i=null),c=l,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(u.bind(r),d)),s}}function se(e,t,n){let r=null,o=null,i=null,s=null,c=null;const u=function(){const a=f()-i;a<t&&a>=0?o=setTimeout(u,t-a):(o=null,n||(c=e.apply(r,s),o||(r=s=null)))};return function(...a){r=this,s=a,i=f();const l=n&&!o;return o||(o=setTimeout(u,t)),l&&(c=e.apply(r,s),r=s=null),c}}function ce(e,t={}){const{isNaNAsNumber:n=!1,isInfinityAsNumber:r=!1,isUnFiniteAsNumber:o=!1}=t;return"number"==typeof e&&(!(!0!==r&&!0!==o&&!isFinite(e))&&!(!n&&isNaN(e)))}function ue(e,...t){let n=null;return e&&"function"==typeof e&&(n=e(...t)),n}function ae(e,...t){return ue(e,...t)}function le(e){let t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function fe(e){const t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function de(e){return"function"==typeof e}function pe(e){return"string"==typeof e}function me(e){return"boolean"==typeof e}function ge(e){return me(e)}function he(e){return null==e}function we(e){return"[object Array]"===Object.prototype.toString.call(e)}function ye(e){return!!fe(e)&&0!==Object.keys(e).length}function be(e){if(!e)return"";const t=new RegExp("\\n","g");return e.replace(t,"<br />")}function ve(e){return be(e)}function Ee(e,t={}){const{removeNewLine:n=!1}=t;let r="";return e&&(r=e.replace(/<\/?.+?>/g,""),n&&(r=r.replace(/[\r\n]/g,""))),r}function Te(e,t={}){return Ee(e,t)}function Ae(e,t={}){return Ee(e,t)}function Se(e,t={}){return Ee(e,t)}function $e(e,t={}){if("string"!=typeof e)throw new TypeError("value must be a string.");const n=t.preserveEntities?/&(?!(?:#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]+);)/gi:/&/g,r={"<":"<",">":">",'"':""","'":"'"};return e.replace(n,"&").replace(/[<>"']/g,e=>r[e])}function _e(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,e=>t[e])}function Oe(e){const t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,e=>t[e])}function xe(e){return Oe(e)}function Ne(e,t,n={hasDot:!1,dotText:"..."}){if(n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){let r=0,o="";const i=/[^\x00-\xff]/g;let s="";const c=e.replace(i,"**").length;for(let n=0;n<c&&(s=e.charAt(n).toString(),null!=s.match(i)?r+=2:r++,!(r>t));n++)o+=s;return n.hasDot&&c>t&&(o+=n.dotText),o}return""}function je(e,t,n=!1){return Ne(e,t,{hasDot:n})}function Ce(e,t,n=!1){return je(e,t,n)}function Me(e,t={validStatusRange:[200,300],validCode:[0]}){const n=t||{},{validStatusRange:r=[200,300],validCode:o=[0]}=n;2!==r.length&&console.error("valid validStatusRange is required");let i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){const t=e.data;t&&o.includes(t.code)&&(i=!0)}return i}function De(e,t,n){if(null===e||"object"!=typeof e)return!1;let r=e;for(const e of t){if(null===r||"object"!=typeof r&&"function"!=typeof r||!Object.hasOwn(r,e))return!1;r=r[e]}return r===n}const ke=["B","KB","MB","GB","TB"];function Fe(e,t={}){const{base:n=1024,fractionDigits:r=1,invalidValue:o=""}=t;if(!Number.isFinite(e)||e<0||1e3!==n&&1024!==n||!Number.isInteger(r)||r<0||r>20)return o;let i=e,s=0;for(;i>=n&&s<ke.length-1;)i/=n,s+=1;return 0===s?`${Number(i.toFixed(r))} ${ke[s]}`:`${i.toFixed(r)} ${ke[s]}`}function Le(e,t={}){return Fe(e,t)}function Re(e){let t,n,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r}async function ze(e){const t="undefined"==typeof crypto?null:crypto;if(!t?.subtle||"function"!=typeof t.subtle.digest)throw new Error("Web Crypto API is not available.");let n=e;if("string"==typeof e){if("undefined"==typeof TextEncoder)throw new Error("TextEncoder is not available.");n=(new TextEncoder).encode(e)}const r=await t.subtle.digest("SHA-256",n);let o="";const i=new Uint8Array(r);for(let e=0;e<i.length;e++){const t=i[e].toString(16);o+=1===t.length?`0${t}`:t}return o}function Pe(e){return/^1\d{10}$/.test(e)}const Ue=Pe;function Ie(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)}function Be(e){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e>0;){let n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t}function qe(){return"v4"}function Ye(e,t={},n=e=>!0===e){const{interval:r=1e3,times:o=10,context:i,args:s}=t;if("function"!=typeof e)return void console.error("Expected a function.");if(!Number.isFinite(r)||r<0)return void console.error("Expected a non-negative number for interval.");if(!Number.isFinite(o)||o<0)return void console.error("Expected a non-negative number for times.");if(0===o)return;let c=0;const u=()=>{setTimeout(async()=>{const t=await e.apply(i,s);n(t)||++c>=o||u()},r)};u()}async function We(e){return new Promise(t=>{setTimeout(()=>{t(e)},e)})}async function Ze(e){return We(e)}let He="";function Ve(){if(He)return"browser"===He;const e="undefined"!=typeof window;return e&&(He="browser"),e}function Je(e,t){const n=e[t];if(void 0!==n&&"string"!=typeof n)throw new TypeError(`manifest.${t} must be a string when provided`);return n}function Ge(e){if(void 0===e)return{name:""};if("string"==typeof e)return{name:e.trim()};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest.author must be a string or object");const t=e,n={name:""};for(const e of["name","email","url"]){const r=t[e];if(void 0!==r&&"string"!=typeof r)throw new TypeError(`manifest.author.${e} must be a string when provided`);if("string"==typeof r){const t=r.trim();("name"===e||t)&&(n[e]=t)}}return n}function Qe(e,t={}){if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest must be an object");if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("options must be an object when provided");const n=e;if("string"!=typeof n.name||!n.name.trim())throw new TypeError("manifest.name must be a non-empty string");const r=n.name.trim(),o=function(e){if(/\s/.test(e))throw new TypeError("manifest.name must not contain whitespace");if(e.startsWith("@")){const t=e.split("/");if(2!==t.length||t[0].length<2||!t[1])throw new TypeError("manifest.name must be a valid scoped package name");return t[1]}if(e.includes("/"))throw new TypeError("manifest.name must be an unscoped or scoped package name");return e}(r),i=t.packageManager??"npm";if("npm"!==i&&"pnpm"!==i&&"yarn"!==i)throw new TypeError('packageManager must be "npm", "pnpm", or "yarn"');const s="npm"===i?"npm install":`${i} add`;return{name:r,version:Je(n,"version"),description:Je(n,"description"),license:Je(n,"license"),author:Ge(n.author),unscopedName:o,iifeGlobal:V(o),installCommand:`${s} ${r}`}}function Ke(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}}function Xe(e){const t=e.indexOf("#"),n=-1===t?e:e.slice(0,t),r=n.indexOf("?"),o=/^(?:[a-z][a-z\d+.-]*:)?\/\//i.test(n)||"/"===n.charAt(0),i=-1===r?o?"":n:n.slice(r+1);return i?i.split("&").reduce((e,t)=>{if(!t||-1===t.indexOf("="))return e;const n=t.indexOf("=");return e.push([Ke(t.slice(0,n)),Ke(t.slice(n+1))]),e},[]):[]}function et(e,t){return Xe(e).filter(([e])=>e===t).map(([,e])=>e)}const tt=/^(?=.{1,39}$)(?!.*--)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/,nt=/^(?=.{1,100}$)(?!\.{1,2}$)[A-Za-z0-9_.-]+$/;function rt(){return new Error("The value does not identify one supported GitHub repository")}function ot(e,t){const n=t.replace(/\.git$/i,"");if(!tt.test(e)||!nt.test(n))throw rt();const r=`${e}/${n}`;return{owner:e,name:n,slug:r,url:`https://github.com/${r}`}}function it(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.trim();if(!t||/[%\\?#]/.test(t)||function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<=31||127===n)return!0}return!1}(t))throw rt();const n=t.match(/^(?:github:)?([^/:\s]+)\/([^/\s]+)$/i);if(n)return ot(n[1],n[2]);const r=t.match(/^git@([^:\s]+):([^/\s]+)\/([^/\s]+)$/);if(r&&"github.com"===r[1].toLowerCase())return ot(r[2],r[3]);const o=t.replace(/^git\+(?=(?:git|ssh|https?):\/\/)/i,""),i=o.match(/^[a-z][a-z\d+.-]*:\/\/([^/?#]+)/i);if(!i||/(^|\/)\.{1,2}(?:\/|$)/.test(o.slice(i[0].length)))throw rt();if(-1!==i[1].slice(i[1].lastIndexOf("@")+1).indexOf(":"))throw rt();let s;try{s=new URL(o)}catch(e){throw rt()}const c=s.protocol.toLowerCase(),u=s.hostname.toLowerCase().replace(/^www\./,"");if(!["git:","ssh:","http:","https:"].includes(c)||"github.com"!==u||""!==s.username&&"git"!==s.username||""!==s.password||""!==s.search||""!==s.hash)throw rt();const a=s.pathname.match(/^\/([^/]+)\/([^/]+)\/?$/);if(!a)throw rt();return ot(a[1],a[2])}function st(e){return et(location.search,e)[0]||""}function ct(e=""){""===e&&(e=location.search);const t={};return Xe(e).forEach(([e,n])=>{Object.hasOwn(t,e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}),t}function ut(e,t,n={}){const r=et(e,t);return n.returnArray?r:r.length?r[0]:null}function at(e,t,n){const r=e.indexOf("#"),o=-1===r?"":e.slice(r),i=-1===r?e:e.slice(0,r),s=i.indexOf("?"),c=-1===s?i:i.slice(0,s),u=-1===s?"":i.slice(s+1),a=encodeURIComponent(t),l=encodeURIComponent(n);let f=!1;const d=(u?u.split("&").filter(Boolean):[]).reduce((e,n)=>{const r=n.indexOf("=");return Ke(-1===r?n:n.slice(0,r))===t?f||(e.push(`${a}=${l}`),f=!0):e.push(n),e},[]);return f||d.push(`${a}=${l}`),`${c}?${d.join("&")}${o}`}function lt(e){const t=location.hash.split("?");return 1===t.length?"":et(`?${t.slice(1).join("?")}`,e)[0]||""}function ft(e,t=["hostname"]){try{const n=new URL(e,document.baseURI);return t.reduce((e,t)=>e+=n[t],"")}catch(n){const r=document.createElement("a");return r.href=e,t.reduce((e,t)=>e+=r[t],"")}}function dt(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)}function pt(e){return void 0===e||Number(e)<=65535}function mt(e){const t=e.split(".");return 4===t.length&&t.every(e=>/^\d{1,3}$/.test(e)&&(1===e.length||"0"!==e.charAt(0))&&Number(e)<=255)}function gt(e){const t=e.split("::");if(t.length>2)return!1;const n=2===t.length;let r=[];t.forEach(e=>{e&&(r=r.concat(e.split(":")))});let o=0;for(let e=0;e<r.length;e++){const t=r[e];if(-1!==t.indexOf(".")){if(e!==r.length-1||!mt(t))return!1;o+=2}else{if(!/^[0-9a-f]{1,4}$/i.test(t))return!1;o+=1}}return n?o<8:8===o}function ht(e){const t=e.match(/^\[([0-9a-f:.]+)\]$/i);if(t)return gt(t[1]);if("."===e.charAt(e.length-1)&&(e=e.slice(0,-1)),mt(e))return!0;const n=e.split(".");return!(n.length<2||n.some(e=>!e||!/^[a-z\d-]+$/i.test(e)||"-"===e.charAt(0)||"-"===e.charAt(e.length-1)))&&!/^\d+$/.test(n[n.length-1])}function wt(e,t={strict:!0}){if("string"!=typeof e||!e||e.trim()!==e)return!1;const n=/^https?:\/\/[^/\\]/i.test(e),r=/^\/\/[^/\\]/.test(e);if(!n&&(t.strict||!r))return!1;const o=r?`http:${e}`:e;if(!function(e){const t=e.match(/^https?:\/\/([^/?#]+)(?:[/?#][^\s<>"`]*)?$/i);if(!t||-1!==t[1].indexOf("@"))return!1;const n=t[1],r=n.match(/^\[([0-9a-f:.]+)\](?::(\d*))?$/i);if(r)return gt(r[1])&&pt(r[2]);const o=n.match(/^([^:]+)(?::(\d*))?$/);return!(!o||!pt(o[2]))&&ht(o[1])}(o))return!1;try{const e=new URL(o);return("http:"===e.protocol||"https:"===e.protocol)&&ht(e.hostname)&&!e.username&&!e.password}catch(e){return!1}}function yt(e){let t="";if("string"!=typeof e||""==e)return t;const n=e.split(/[?#]/,1)[0],r=/\.[^/]+$/.exec(n);return r?(r[0].length>1&&(t=r[0].substring(1)),t):t}function bt(e,t=""){t||(t=".js");const n=document.querySelectorAll("script[src]");for(let r=0;r<n.length;r++){const o=n[r].getAttribute("src");if(o&&-1!==o.indexOf(t)){const t=et(o,e)[0];if(void 0!==t)return t}}return""}function vt(e){return e&&0===Object.keys(e).length?"":`?${Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}`}function Et(e){return e.replace(/^http:/,"https:")}function Tt(e){return Et(e)}function At(e){!wt(e)&&wt(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).host}catch(e){return""}}function St(e){!wt(e)&&wt(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).pathname}catch(e){return""}}function $t(e,t={}){const{fireOnInit:n=!0}=t,r=history;let o=location.href;const i=[],s=t=>{const n=location.href;if(n===o&&"load"!==t)return;const r=o;o=n,e({url:n,oldUrl:r,trigger:t})},c=()=>s("popstate"),u=()=>s("hashchange");window.addEventListener("popstate",c),window.addEventListener("hashchange",u),i.push(()=>window.removeEventListener("popstate",c)),i.push(()=>window.removeEventListener("hashchange",u)),r.__mazeyUrlChangePatched__||(r.__mazeyUrlChangePatched__=!0,r.__mazeyUrlChangeSubscribers__=new Set,r.__mazeyRawPushState__=history.pushState.bind(history),r.__mazeyRawReplaceState__=history.replaceState.bind(history),history.pushState=function(...e){r.__mazeyRawPushState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("pushState"))},history.replaceState=function(...e){r.__mazeyRawReplaceState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("replaceState"))});const a=e=>s(e);return r.__mazeyUrlChangeSubscribers__.add(a),i.push(()=>r.__mazeyUrlChangeSubscribers__.delete(a)),n&&s("load"),()=>{i.forEach(e=>e())}}const _t={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:()=>{},errorFn:()=>{}};function Ot(e="",t={..._t}){const{enabled:n,isClosed:r,showWrap:o,showDate:i,locales:s,isStringifyObject:c,logFn:u,errorFn:a}=Object.assign({..._t},t);let l=n;!0===r&&(xt.warn("The options.isClosed is deprecated. Please use options.enabled instead."),l=!1);const f=Object.create(null),d=()=>(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return["log","info","warn","error"].forEach(t=>{f[t]=function(...n){if(!l)return;let r=e,s=e;if("string"==typeof e&&e.length>=2){const t=e.length;r=":"===e[t-1]?e.substring(0,t-1):e}o&&console.log(`--- ${r} - begin ---`),i&&(s=e?`${d()} ${e}`:`${d()}`),c&&(n=n.map(e=>fe(e)?JSON.stringify(e):e)),e||i?console[t](s,...n):console[t](...n),"log"===t&&u(),"error"===t&&a(),o&&console.log(`--- ${r} - end ---`)}}),f}const xt=Ot("[Mazey]"),Nt=Ot("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function jt(e,t){if(!e)return xt.error("The element is not exist."),!1;const n=e.className.split(/\s+/);for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1}function Ct(e,t){if(!e)return void xt.error("The element is not exist.");if(Array.isArray(t))return void t.forEach(t=>{t&&e.classList.add(t)});if(!t)return;const n=e.className,r=n.split(/\s+/);for(let e=0;e<r.length;e++)if(r[e]===t)return;let o="",i="";""!==n&&(o=" "),i=n+o+t,e.className=i}function Mt(e,t){Ct(e,t)}function Dt(e,t){if(!e)return void xt.error("The element is not exist.");let n;n=" "+e.className+" ",n=n.replace(/(\s+)/gi," "),n=n.replace(" "+t+" "," "),n=n.replace(/(^\s+)|(\s+$)/g,""),e.className=n}function kt(e,t={id:""}){if(!e)return!1;const n=document.createDocumentFragment();let r=null,o="";const i=document.createElement("style");return t.id?(o=`${t.id}`,r=document.getElementById(o),r?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}function Ft(){const e=window.jQuery||window.$;if(e){const t=e("img");return!(!t||!t.length)&&(t.each(function(){const t=e(this);if(!t)return;const n=t.attr("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&le(r)&&r[1]&&t.width(r[1]),o&&le(o)&&o[1]&&t.height(o[1])}),!0)}{const e=document.getElementsByTagName("img");if(e.length>0)return Array.from(e).forEach(function(e){const t=e;if(!t)return;const n=t.getAttribute("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&le(r)&&r[1]&&(t.style.width=r[1]),o&&le(o)&&o[1]&&(t.style.height=o[1])}),!0}return!1}function Lt(){return Ft()}function Rt(e,t){let n="";return t&&t.length>0&&(n=t.join(";")+";"),`${e}{${n}}`}function zt(e){const t=document.getElementsByTagName("meta");for(let n=0;n<t.length;n++)if(t[n].getAttribute("name")===e)return t[n].getAttribute("content")||"";return""}function Pt(e,t={}){if("string"!=typeof e)return!1;const n=e.trim();if(!n)return!0===t.allowEmpty;const r=t.root||("undefined"==typeof document?null:document);if(!r)return!1;try{return r.querySelector(n),!0}catch(e){return!1}}function Ut(e){return Boolean(e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}const It=new WeakMap,Bt=new WeakMap,qt={button:"inline-block",input:"inline-block",select:"inline-block",textarea:"inline-block",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",li:"list-item",summary:"list-item"},Yt=new Set(["address","article","aside","blockquote","body","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","main","nav","ol","p","pre","section","ul"]);function Wt(e){if(!Ut(e))return null;const t=e.style;return t&&"string"==typeof t.display?e:null}function Zt(e){const t=new Set,n=e=>{const n=Wt(e);n&&t.add(n)};if("string"==typeof e){if("undefined"==typeof document)return[];try{document.querySelectorAll(e).forEach(n)}catch(e){return[]}return Array.from(t)}const r=Wt(e);if(r)return[r];if(!e||"object"!=typeof e)return[];if("function"==typeof e[Symbol.iterator]){for(const t of e)n(t);return Array.from(t)}const o=e.length;if(!Number.isSafeInteger(o)||o<0)return[];for(let t=0;t<o;t+=1)n(e[t]);return Array.from(t)}function Ht(e){const t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).display:null}function Vt(e){const t=e.ownerDocument,n=e.localName.toLowerCase();let r=Bt.get(t);r||(r=new Map,Bt.set(t,r));const o=e.namespaceURI||"",i=`${o}:${n}`,s=r.get(i);if(s)return s;let c="";const u="http://www.w3.org/1999/xhtml"===o&&n.includes("-"),a=t.body||t.documentElement;if(a&&!u){const e=o&&"http://www.w3.org/1999/xhtml"!==o?t.createElementNS(o,n):t.createElement(n);a.appendChild(e);try{c=Ht(e)||""}finally{a.removeChild(e)}}return c&&"none"!==c||(c=function(e){return qt[e]?qt[e]:Yt.has(e)?"block":"inline"}(n)),r.set(i,c),c}function Jt(e){return Zt(e).forEach(e=>{"none"!==Ht(e)&&"none"!==e.style.display&&It.set(e,e.style.display),e.style.display="none"}),e}function Gt(e){return Zt(e).forEach(e=>{It.has(e)?(e.style.display=It.get(e),It.delete(e)):"none"===e.style.display&&(e.style.display=""),""===e.style.display&&"none"===Ht(e)&&(e.style.display=Vt(e))}),e}function Qt(e,t){if(void 0===e)return Ut(t.defaultElement)?t.defaultElement:null;let n=t.unwrap?t.unwrap(e):e;if(null==n)return null;if("string"==typeof n)try{return t.root.querySelector(n)}catch(e){return null}return"object"==typeof n&&"$el"in n&&(n=n.$el),Ut(n)?n:null}function Kt(e,t={}){const{excludeSelector:n="",replaceImagesWithAlt:r=!0,normalizeWhitespace:o=!0}=t,i=e.cloneNode(!0);r&&Array.from(i.querySelectorAll("img[alt]")).forEach(e=>{const t=e.getAttribute("alt")||"";e.parentNode?.replaceChild(i.ownerDocument.createTextNode(t),e)});const s=n.trim();s&&Pt(s,{root:i})&&Array.from(i.querySelectorAll(s)).forEach(e=>e.parentNode?.removeChild(e));const c=i.innerText||i.textContent||"";return o?c.replace(/\u00a0/g," ").replace(/\s+/g," ").trim():c}function Xt(e){e.stopPropagation()}function en(){const e=window.MAZEY_DEFINE_LISTENERS;if(e&&"object"==typeof e)return e;const t=Object.create(null);return window.MAZEY_DEFINE_LISTENERS=t,t}function tn(e,t){const n=en();Array.isArray(n[e])||Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:[],writable:!0}),"function"==typeof t&&n[e].push(t)}function nn(e,t){const n=en()[e];if(Array.isArray(n)){const e=n.slice();for(let n=0,r=e.length;n<r;n++)"function"==typeof e[n]&&(void 0===t?e[n]():e[n](t))}}function rn(e,t){nn(e,t)}function on(e,t){const n=en(),r=n[e];if("string"==typeof e&&Array.isArray(r))if("function"==typeof t){for(let o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]}function sn(e,t=null){if(e){const n=JSON.stringify(t);sessionStorage.setItem(e,void 0===n?"null":n)}}function cn(e){let t=null;if(e){const n=sessionStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}function un(e,t=null){if(e){const n=JSON.stringify(t);localStorage.setItem(e,void 0===n?"null":n)}}function an(e){let t=null;if(e){const n=localStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}const ln=sn,fn=cn,dn=un,pn=an,mn="__mazey_cookie_name_encoded__-",gn="__mazey_cookie_value_encoded__-";function hn(e){return`${gn}${encodeURIComponent(e)}`}function wn(e){const t=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(e),n=0===e.indexOf(mn)||0===e.indexOf(gn);return t&&!n?e:function(e){return`${mn}${encodeURIComponent(e)}`}(e)}function yn(e){const t=wn(e);return t!==e?[t,e]:[e]}function bn(e){const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){const r=n[e].trim();if(0===r.indexOf(t))return r.substring(t.length)}}function vn(e){const t=yn(e),n="1"===bn(hn(e));for(let e=0;e<t.length;e++){const r=bn(t[e]);if(void 0!==r){if(n)try{return decodeURIComponent(r)}catch(e){return r}return r}}return""}function En(e,t,n,r){let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";const i=function(e){let t=!0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(!(33===r||r>=35&&r<=43||r>=45&&r<=58||r>=60&&r<=91||r>=93&&r<=126)){t=!1;break}}return{isEncoded:!t,value:t?e:encodeURIComponent(e)}}(t),s=wn(e),c=i.isEncoded?"1":"",u=i.isEncoded?o:"; expires=Thu, 01 Jan 1970 00:00:00 GMT",a=[`${s}=${i.value}${o}; path=/`,`${hn(e)}=${c}${u}; path=/`],l=e=>{const t=e?`; domain=${e}`:"";a.forEach(e=>{document.cookie=`${e}${t}`})},f=location.hostname;if(r)l(r);else if(-1===f.indexOf("."))l();else{const n=f.split(".");n.shift();l("."+n.join(".")),vn(e)!==t&&l(`.${f}`)}}function Tn(e){const t=yn(e),n=t.concat(hn(e)),r=new Date;r.setTime(r.getTime()-1);const o=t.some(e=>void 0!==bn(e));return n.forEach((e,t)=>{if(n.indexOf(e)===t&&void 0!==bn(e)){[`${e}=; expires=${r.toUTCString()}`,`${e}=; expires=${r.toUTCString()}; path=/`].forEach(e=>{document.cookie=e;const t=location.hostname;if(-1!==t.indexOf(".")){const n=t.split(".");for(let t=0;t<n.length;t++)document.cookie=`${e}; domain=.${n.slice(t).join(".")}`}})}}),o&&n.every(e=>void 0===bn(e))}function An(e){Tn(e)}function Sn(e,t={id:""}){const{id:n}=t;return new Promise((t,r)=>{const o=document.createElement("link");let i=!1;const s=()=>{o.onload=null,o.onerror=null};o.rel="stylesheet",o.type="text/css",o.href=e,void 0!==n&&(o.id=n),o.onload=()=>{i||(i=!0,s(),t("loaded"))},o.onerror=()=>{i||(i=!0,s(),r(new Error(`Failed to load CSS: ${e}`)))},document.head.appendChild(o)})}const $n={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function _n(e,t={...$n}){const{id:n,callback:r,timeout:o,isDefer:i,isAsync:s,isCrossOrigin:c,attributes:u,cssUrl:a}=Object.assign({...$n},t);if(a){const t=function(e,t){if(!t)return"";if(wt(t))return t;try{const n=new URL(e,location.href);return new URL(t,n).href}catch(n){const r=e.split("/");return r.pop(),`${r.join("/")}/${t}`}}(e,a);t&&Sn(t).catch(e=>{console.error(`Failed to load CSS from ${t}: ${e?.message}`)})}return new Promise((t,a)=>{const l=document.createElement("script");let f=!1,d=null;const p=()=>{l.onload=null,l.onerror=null,null!==d&&(clearTimeout(d),d=null)},m=e=>{f||(f=!0,p(),a(e))};l.type="text/javascript",l.defer=Boolean(i),l.async=Boolean(s),c&&(l.crossOrigin="anonymous"),n&&(l.id=n),u&&Object.keys(u).forEach(e=>{l.setAttribute(e,u[e])}),l.onload=()=>{if(!f){f=!0,p();try{ae(r),t("loaded")}catch(e){a(e)}}},l.onerror=()=>m(new Error(`Failed to load script: ${e}`)),l.src=e,o&&(d=setTimeout(()=>m(new Error("timeout")),o));const g=document.getElementsByTagName("script")[0];if(g?.parentNode)g.parentNode.insertBefore(l,g);else{(document.head||document.body||document.documentElement).appendChild(l)}})}function On(e=3e4){return new Promise((t,n)=>{let r=null;const o=()=>{window.removeEventListener("load",i),null!==r&&(clearTimeout(r),r=null)},i=()=>{o(),t("load")};"complete"!==document.readyState?(window.addEventListener("load",i),r=setTimeout(()=>{o(),n(new Error("timeout"))},e)):t("complete")})}function xn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})}function Nn(e,t){if(window[e])return Promise.resolve("defined");let n=jn.get(e);const r=n?.get(t);if(r)return r;n||(n=new Map,jn.set(e,n));const o=()=>{n?.delete(t),0===n?.size&&jn.delete(e)},i=_n(t).then(e=>(o(),e),e=>{throw o(),e});return n.set(t,i),i}const jn=new Map;function Cn(e){if("undefined"==typeof window)return!1;let t=[];const n=window.PerformanceObserver;return!!n&&(le(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}async function Mn(){return Cn("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-contentful-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function Dn(){return Cn("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function kn(){return Cn("largest-contentful-paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"largest-contentful-paint"===e.entryType);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"largest-contentful-paint",buffered:!0})}):0}async function Fn(){return Cn("first-input")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-input"===e.entryType);if(r){t.disconnect();const n=r.processingStart;e(n?Math.round(r.processingStart-r.startTime):0)}});t.observe({type:"first-input",buffered:!0})}):0}async function Ln(){return Cn("layout-shift")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().reduce((e,t)=>{let n=0;return ce(t.value)&&(n=t.value),e+n},0);t.disconnect(),e(r)});t.observe({type:"layout-shift",buffered:!0})}):0}async function Rn(){if(!Cn("navigation"))return 0;if(!window.performance||!window.performance.getEntriesByType)return 0;const e=window.performance.getEntriesByType("navigation")[0];let t=0;return e?(t=e.responseStart-e.requestStart,Math.round(t)):0}async function zn(e=!1){if(!Cn("navigation"))return Promise.reject(new Error("navigation is not supported"));const t=window.performance;if(!t||"function"!=typeof t.getEntriesByType)return Promise.reject(new Error("performance is not supported"));let n;const r=new Promise(e=>{[n]=[e]}),o=t.getEntriesByType("navigation");if(!le(o))return Promise.reject(new Error("NavigationTiming is not supported"));const i=o[0];let[s,c,u,a,l,f,d,p,m,g,h,w,y,b,v,E,T,A,S]=new Array(19).fill(0);({decodedBodySize:A,encodedBodySize:S}=i),({unloadEventEnd:s,unloadEventStart:c,redirectEnd:u,redirectStart:a,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:w,domContentLoadedEventStart:y,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i);let $=0;if(ce(E))$=E;else{if(!ce(T))return Promise.reject(new Error("startTime, navigationStart or fetchStart are required"));$=T}const[_,O]=await Promise.all([Dn(),Mn()]);function x(){({decodedBodySize:A,encodedBodySize:S}=i),({unloadEventEnd:s,unloadEventStart:c,redirectEnd:u,redirectStart:a,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:w,domContentLoadedEventStart:y,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i),ce(E)?$=E:ce(T)&&($=T);const t={source:"PerformanceNavigationTiming",os:N(),osVersion:j(),deviceType:C(),network:M(),screenDirection:D(),unloadTime:s-c,redirectTime:u-a,dnsTime:l-f,tcpTime:d-p,sslTime:k(d,m),responseTime:g-h,downloadTime:w-g,firstPaintTime:_,firstContentfulPaintTime:O,domReadyTime:y-$,onloadTime:b-$,whiteTime:g-$,renderTime:v-$,decodedBodySize:A,encodedBodySize:S};Object.keys(t).forEach(e=>{ce(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))}),ce(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);const r={};e||Object.keys(t).forEach(e=>{r[H(e)]=t[e]}),Object.keys(r).length?n(r):n(t)}function N(){let e;return e=navigator.userAgent.indexOf("Android")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others",e}function j(){let e="";const t=navigator.userAgent,n=t.indexOf("Android")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;const i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function C(){let e;const 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",s=t.match(/ucweb/i)&&"ucweb",c=t.match(/android/i)&&"android",u=t.match(/windows ce/i)&&"windows ce",a=t.match(/windows mobile/i)&&"windows mobile";return e=n||r||o||i||s||c||u||a?r||o||i||s||c||u||a?"phone":n?"ipad":void 0:"pc",e||(e=""),e}function M(){let e="";const t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function D(){let e="";return window.screen&&window.screen.orientation&&"number"==typeof 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 k(e,t){let n=0;return t&&(n=e-t),n}return ce(v)&&v>0?x():"complete"===document.readyState?window.setTimeout(x,0):window.addEventListener("load",function e(){window.removeEventListener("load",e),window.setTimeout(function(){x()},0)}),r}function Pn(e,t=e.userAgent.trim().toLowerCase()){return/\bmacintosh\b/.test(t)&&"macintel"===e.platform.toLowerCase()&&e.maxTouchPoints>1}const Un=Object.freeze(["adsbot-google","ahrefsbot","amazonbot","applebot","baiduspider","bingbot","bingpreview","bytespider","ccbot","chatgpt-user","claudebot","discordbot","dotbot","duckduckbot","facebookexternalhit","facebot","google-inspectiontool","googlebot","googleother","gptbot","linkedinbot","mediapartners-google","mj12bot","perplexitybot","petalbot","semrushbot","slackbot","slurp","storebot-google","telegrambot","twitterbot","whatsapp","yandexbot"]),In=Object.freeze(["headlesschrome","phantomjs","slimerjs","selenium","puppeteer","playwright"]);function Bn(){try{return"undefined"==typeof navigator?null:navigator}catch(e){return null}}function qn(){const e=Bn();if(!e)return{userAgent:"",platform:"",maxTouchPoints:0};let t="",n="",r=0;try{const n=e.userAgent;t="string"==typeof n?n:""}catch(e){return{userAgent:"",platform:"",maxTouchPoints:0}}try{const t=e.platform;n="string"==typeof t?t:""}catch(e){n=""}try{const t=e.maxTouchPoints;r=Number.isFinite(t)?t:0}catch(e){r=0}return{userAgent:t,platform:n,maxTouchPoints:r}}function Yn(e){const t=e.userAgent.trim().toLowerCase();return t?/\bandroid\b|\badr\b/.test(t)?"android":/\bios\b|\biphone\b|\bipad\b|\bipod\b|\biwatch\b/.test(t)||Pn(e,t)?"ios":/\bwindows\b|\bwin32\b|\bwin64\b|\bwow32\b|\bwow64\b/.test(t)?"windows":/\bmacintosh\b|\bmacintel\b|\bmac os x\b/.test(t)?"macos":/\blinux\b/.test(t)?"linux":"":""}function Wn(e){const t=e.userAgent.trim().toLowerCase();if(!t)return"";if(/\biwatch\b|\bapple watch\b/.test(t))return"";if(/\bipad\b|\btablet\b/.test(t)||Pn(e,t))return"tablet";const n=Yn(e);return"android"===n?/\bmobile\b/.test(t)?"mobile":"tablet":"ios"===n&&/\biphone\b|\bipod\b/.test(t)?"mobile":"windows"===n||"macos"===n||"linux"===n||/\bcros\b/.test(t)?"desktop":/\bmobile\b/.test(t)?"mobile":""}function Zn(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return Wn(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:qn())}function Hn(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return Yn(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:qn())}function Vn(e){return"mobile"===Zn(e)}function Jn(e){return"desktop"===Zn(e)}function Gn(e){return"tablet"===Zn(e)}function Qn(e){return"ios"===Hn(e)}function Kn(e){return"android"===Hn(e)}function Xn(e){return"macos"===Hn(e)}function er(e){return"windows"===Hn(e)}function tr(e){return"linux"===Hn(e)}function nr(e,t){const n=e.trim().toLowerCase();return t.some(e=>n.includes(e))}function rr(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");const t=void 0===e?function(){const e=Bn();if(!e)return"";try{const t=e.userAgent;return"string"==typeof t?t:""}catch(e){return""}}():e;return nr(t,Un)?"crawler":nr(t,In)||function(){const e=Bn();if(!e)return!1;try{return!0===e.webdriver}catch(e){return!1}}()?"automation":"unknown"}function or(e={}){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;const t=e.requireManifest,n=e.scope;if(void 0!==t&&"boolean"!=typeof t||void 0!==n&&"string"!=typeof n)return!1;if(!0!==window.isSecureContext||!("serviceWorker"in navigator))return!1;if(void 0!==n&&!function(e){const t=e.trim();if(!t||/[?#]/.test(t))return!1;try{const e=new URL(window.location.href),n=new URL(t,e);if(n.origin!==e.origin||""!==n.search||""!==n.hash)return!1;if(e.pathname===n.pathname)return!0;const r=n.pathname.endsWith("/")?n.pathname:`${n.pathname}/`;return e.pathname.startsWith(r)}catch(e){return!1}}(n))return!1;if(!1===t)return!0;if("undefined"==typeof document)return!1;const r=document.querySelector('link[rel~="manifest"][href]');return Boolean(r?.getAttribute("href")?.trim())}catch(e){return!1}}function ir(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator;try{const e=window.matchMedia;if("function"==typeof e&&e.call(window,"(display-mode: standalone)").matches)return!0}catch(e){}try{return!0===e.standalone}catch(e){return!1}}function sr(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;let e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{const t=qn(),n=t.userAgent.toLowerCase();if(!n)return e;const r=e=>e.test(n),o=e=>{let t="";const r=n.match(e);return r&&le(r)&&(t=r.toString(),t=t.replace(/[^0-9|_.]/g,""),t=t.replace(/_/g,".")),t},i=Yn(t);let s="";"ios"===i&&(r(/ipad/g)?s="ipad":r(/iphone/g)?s="iphone":r(/iwatch/g)?s="iwatch":r(/ipod/g)?s="ipod":"macintel"===t.platform.toLowerCase()&&t.maxTouchPoints>1&&(s="ipad")),e={...e,system:i,appleType:s};let 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={...e,systemVs:c};let u="";"windows"===i||"macos"===i||"linux"===i?u="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(u="mobile"),e={...e,platform:u};let a="",l="";r(/applewebkit/g)?(a="webkit",r(/edg(?:a|ios)?\//g)||r(/edge\//g)?l="edge":r(/opr/g)?l="opera":r(/chrome/g)?l="chrome":r(/safari/g)&&(l="safari")):r(/gecko/g)&&r(/firefox/g)?(a="gecko",l="firefox"):r(/presto/g)?(a="presto",l="opera"):r(/trident|compatible|msie/g)&&(a="trident",l="iexplore"),e={...e,engine:a,supporter:l};let f="";"webkit"===a?f=o(/applewebkit\/[\d._]+/g):"gecko"===a?f=o(/gecko\/[\d._]+/g):"presto"===a?f=o(/presto\/[\d._]+/g):"trident"===a&&(f=o(/trident\/[\d._]+/g)),e={...e,engineVs:f};let d="";"chrome"===l?d=o(/chrome\/[\d._]+/g):"safari"===l?d=o(/version\/[\d._]+/g):"firefox"===l?d=o(/firefox\/[\d._]+/g):"opera"===l?d=o(/opr\/[\d._]+/g):"iexplore"===l?d=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(d=o(/(?:edge|edg|edga|edgios)\/[\d._]+/g)),e={...e,supporterVs:d};let p="",m="";r(/micromessenger/g)?(p="wechat",m=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",m=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",m=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",m=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",m=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),e={...e,shell:p,shellVs:m};let g="";if(window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");e.matches?g="dark":t.matches&&(g="light")}return e={...e,colorScheme:g},window.MAZEY_BROWSER_INFO=e,e}catch(t){return xt.warn(t),e}}function cr(e="",t="-"){const n=sr(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(o=>{const i=n[o];if(i){let n="";e&&e.length>0&&(n=`${e}${t}`),r.push(`${n}${i}`)}}),r}let ur="";function ar(){if(ur)return Promise.resolve("webp"===ur);return new Promise(e=>{const t=new Image;t.onload=()=>{const n=t.width>0&&t.height>0;ur=n?"webp":"no-webp",e(n)},t.onerror=()=>{ur="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})}function lr(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");if(null===e)return()=>{};if("object"!=typeof e)throw new TypeError("media must be a MediaQueryList or null");const n=e.addEventListener,r=e.removeEventListener;let o=null;if("function"==typeof n&&"function"==typeof r){const i=t;n.call(e,"change",i),o=()=>r.call(e,"change",i)}let i=!1;return()=>{i||(i=!0,o?.())}}function fr(e,t,n){if(null===e||"object"!=typeof e||"function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)throw new TypeError("registration must support event listeners");if(null===t||"object"!=typeof t||"function"!=typeof t.addEventListener||"function"!=typeof t.removeEventListener)throw new TypeError("container must support event listeners");if(null===n||"object"!=typeof n||"function"!=typeof n.onUpdateAvailable||void 0!==n.onControllerChange&&"function"!=typeof n.onControllerChange)throw new TypeError("callbacks must provide onUpdateAvailable");let r=!1,o=null,i=null,s=!1,c=!1;const u=e=>{r||i===e||(i=e,n.onUpdateAvailable(e))},a=()=>{!r&&"installed"===o?.state&&t.controller&&u(o)},l=()=>{r||(o?.removeEventListener("statechange",a),o=e.installing,o?.addEventListener("statechange",a),a())},f=()=>{r||n.onControllerChange?.()},d=()=>{if(s){try{e.removeEventListener("updatefound",l)}catch(e){}s=!1}try{o?.removeEventListener("statechange",a)}catch(e){}if(c){try{t.removeEventListener("controllerchange",f)}catch(e){}c=!1}};try{e.addEventListener("updatefound",l),s=!0,t.addEventListener("controllerchange",f),c=!0,e.waiting&&t.controller&&u(e.waiting),e.installing&&l()}catch(e){throw r=!0,d(),o=null,i=null,e}return{activateWaiting(e={type:"SKIP_WAITING"}){if(r||!i)return!1;try{return i.postMessage(e),!0}catch(e){return!1}},dispose(){r||(r=!0,d(),o=null,i=null)}}}function dr(e){if("string"!=typeof e||""===e.trim())throw new TypeError("storageKey must be a non-empty string.")}function pr(e){if("undefined"==typeof window)return null;try{return new URL(window.location.href).searchParams.get(e)}catch(e){return null}}function mr(e){if("undefined"==typeof window)return null;try{const t=window.localStorage;return t&&"function"==typeof t.getItem?t.getItem(e):null}catch(e){return null}}function gr(e,t){if("undefined"==typeof window)return!1;try{const n=window.localStorage;return!(!n||"function"!=typeof n.setItem)&&(n.setItem(e,t),!0)}catch(e){return!1}}const hr=Object.freeze({system:"System",light:"Light",dark:"Dark"});function wr(e){return"light"===e||"dark"===e}function yr(){if("undefined"==typeof window)return null;try{const e=window.matchMedia;return"function"!=typeof e?null:e.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return null}}function br(e,t){return{value:e,label:hr[t]}}function vr(e){dr(e);const t=pr("theme");if(wr(t))return gr(e,t),br(t,t);const n=mr(e);if(wr(n))return br(n,n);const r=yr();return"system"===n&&r||r?br(r,"system"):br("light","light")}function Er(e,t){if(dr(e),!function(e){return"system"===e||wr(e)}(t))throw new TypeError('value must be "system", "light", or "dark".');return gr(e,t)}function Tr(e){const t=e.split("-");if(!/^[a-z]{2,8}$/i.test(t[0]))return null;const n=[t[0].toLowerCase()];let r=1;if(r<t.length&&/^[a-z]{4}$/i.test(t[r])){const e=t[r].toLowerCase();n.push(`${e[0].toUpperCase()}${e.slice(1)}`),r++}for(r<t.length&&(/^[a-z]{2}$/i.test(t[r])||/^\d{3}$/.test(t[r]))&&(n.push(/^[a-z]{2}$/i.test(t[r])?t[r].toUpperCase():t[r]),r++);r<t.length;r++){const e=t[r];if(!/^(?:[a-z0-9]{5,8}|\d[a-z0-9]{3})$/i.test(e))return null;n.push(e.toLowerCase())}return n.join("-")}function Ar(e){if("string"!=typeof e)return null;const t=e.trim().replace(/_/g,"-");if(!t)return null;if("undefined"!=typeof Intl)try{const e=Intl,n=e.getCanonicalLocales;if("function"==typeof n){const r=n.call(e,t)[0];return"string"==typeof r&&r?r:null}}catch(e){return e instanceof RangeError||"object"==typeof e&&null!==e&&"name"in e&&"RangeError"===e.name?null:Tr(t)}return Tr(t)}function Sr(e){if("undefined"==typeof Intl)return e;try{const t=Intl.DisplayNames;if("function"!=typeof t)return e;const n=new t([e],{type:"language"}).of(e);return"string"==typeof n&&n.trim()?n:e}catch(t){return e}}function $r(e){return{value:e,label:Sr(e)}}function _r(e){dr(e);const t=Ar(pr("lang"));if(t)return $r(t);const n=Ar(mr(e));if(n)return $r(n);return $r(Ar(function(){if("undefined"==typeof window||"undefined"==typeof navigator)return null;try{return"string"==typeof navigator.language?navigator.language:null}catch(e){return null}}())??"en")}function Or(e,t){dr(e);const n=Ar(t);if(!n)throw new TypeError("language must be a valid language tag.");return gr(e,n)}export{Ct as addClass,tn as addEvent,kt as addStyle,U as assignDefined,M as calLongestCommonSubsequence,j as calLongestCommonSubstring,x as calculateCAGR,H as camelCase2Underscore,Y as camelCaseToKebabCase,Xt as cancelBubble,Ae as clearHTML,Se as clearHtml,Be as convert10To26,B as convertCamelToKebab,W as convertCamelToUnder,Et as convertHttpToHttps,q as convertKebabToCamel,vt as convertObjectToQuery,be as convertToHtmlBreaks,Z as convertUnderToCamel,Ce as cutCHSString,Ne as cutZHString,se as debounce,R as deepCopy,I as deepCopyObject,P as deepFreeze,An as delCookie,Qe as derivePackageMetadata,rr as detectVisitorType,ae as doFn,$e as escapeHtmlAttribute,Kt as extractElementText,nn as fireEvent,oe as floatFixed,re as floatToPercent,Fe as formatByteSize,_ as formatDate,$ as formatDistanceToNow,w as formatDurationFromMs,a as formatLocalDateTime,cr as genBrowserAttrs,Ot as genCustomConsole,Re as genHashCode,X as genRndNumString,Rt as genStyleString,te as genUniqueNumString,O as generateCalendarVersion,ee as generateRndNum,ne as generateUniqueNum,ct as getAllQueryParams,sr as getBrowserInfo,Ln as getCLS,vn as getCookie,qe as getCurrentVersion,m as getDateDifference,en as getDefineListeners,ft as getDomain,Mn as getFCP,Fn as getFID,Dn as getFP,Le as getFileSize,g as getFriendlyInterval,lt as getHashQueryParam,kn as getLCP,an as getLocalJSON,pn as getLocalStorage,zt as getPageMeta,zn as getPerformance,st as getQueryParam,bt as getScriptQueryParam,cn as getSessionJSON,fn as getSessionStorage,yr as getSystemTheme,Rn as getTTFB,yt as getUrlFileType,At as getUrlHost,ut as getUrlParam,St as getUrlPath,jt as hasClass,Jt as hide,k as inRate,rn as invokeEvent,ue as invokeFn,Kn as isAndroid,we as isArray,me as isBool,ge as isBoolean,Ve as isBrowser,Jn as isDesktop,de as isFunction,D as isHit,Qn as isIOS,G as isJSONString,Q as isJsonString,tr as isLinux,Xn as isMacOS,Ue as isMobile,le as isNonEmptyArray,ye as isNonEmptyObject,ce as isNumber,Vn as isPhone,fe as isPureObject,or as isSafePWAEnv,ir as isStandalonePWA,pe as isString,ar as isSupportWebp,Cn as isSupportedEntryType,Gn as isTablet,A as isThisHour,E as isThisMonth,T as isThisWeek,v as isThisYear,b as isToday,he as isUdfOrNul,Pt as isValidCssSelector,De as isValidData,y as isValidDate,Ie as isValidEmail,wt as isValidHttpUrl,Pe as isValidPhoneNumber,dt as isValidUrl,er as isWindows,lr as listenMediaQueryChanges,Sn as loadCSS,xn as loadImage,_n as loadScript,Nn as loadScriptIfUndefined,C as longestComSubsequence,N as longestComSubstring,f as mNow,J as mTrim,xt as mazeyCon,ve as newLine,$t as onURLChange,it as parseGitHubRepository,K as parseJsonSafe,u as parseLocalDateTime,Dt as removeClass,Tn as removeCookie,on as removeEvent,Ee as removeHTML,Te as removeHtml,Ye as repeatUntilConditionMet,Tt as replaceHttp,Qt as resolveElementTarget,_r as resolveLanguagePreference,vr as resolveThemePreference,_e as sanitizeInput,Mt as setClass,En as setCookie,Ft as setImgSizeBySrc,Lt as setImgWidHeiBySrc,Or as setLanguagePreference,un as setLocalJSON,dn as setLocalStorage,sn as setSessionJSON,ln as setSessionStorage,Er as setThemePreference,ze as sha256Hex,Gt as show,Ze as sleep,l as subYears,ie as throttle,Nt as timeCon,V as toJavaScriptGlobalName,je as truncateZHString,xe as unsanitize,Oe as unsanitizeInput,at as updateQueryParam,We as waitTime,fr as watchServiceWorkerUpdates,On as windowLoaded,Me as zAxiosIsValidRes};
|
|
6
|
+
function e(e){try{return Date.prototype.getTime.call(e)}catch(e){return null}}const t=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/,n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;function r(e,t,n,r,o,i,s=0,c=!1){const u=new Date(0);return c?(u.setUTCFullYear(e,t-1,n),u.setUTCHours(r,o,i,s),Number.isFinite(u.getTime())&&u.getUTCFullYear()===e&&u.getUTCMonth()===t-1&&u.getUTCDate()===n&&u.getUTCHours()===r&&u.getUTCMinutes()===o&&u.getUTCSeconds()===i&&u.getUTCMilliseconds()===s):(u.setFullYear(e,t-1,n),u.setHours(r,o,i,s),Number.isFinite(u.getTime())&&u.getFullYear()===e&&u.getMonth()===t-1&&u.getDate()===n&&u.getHours()===r&&u.getMinutes()===o&&u.getSeconds()===i&&u.getMilliseconds()===s)}function o(e,t,n,r,o,i,s=0){const c=new Date(0);return c.setFullYear(e,t-1,n),c.setHours(r,o,i,s),c}function i(i){if("number"==typeof i){const e=new Date(i);return Number.isFinite(i)&&Number.isFinite(e.getTime())?e:null}if("object"==typeof i&&null!==i){const t=e(i);return null!==t&&Number.isFinite(t)?new Date(t):null}if("string"!=typeof i)return null;const s=i.trim();if(!s)return null;const c=t.exec(s);if(c){const[e,t,n,i="0",s="0",u="0"]=c.slice(1),[a,l,f,d,p,m]=[e,t,n,i,s,u].map(Number);return r(a,l,f,d,p,m)?o(a,l,f,d,p,m):null}const u=n.exec(s);if(!u)return null;const[a,l,f,d,p,m="0",g="",h]=u.slice(1),w=Number(`${g}00`.slice(0,3));if(!r(Number(a),Number(l),Number(f),Number(d),Number(p),Number(m),w,!0))return null;if("Z"!==h){const e=Number(h.slice(1,3)),t=Number(h.slice(4,6));if(e>23||t>59)return null}return function(e,t,n,r,o,i,s,c){const u=new Date(0);if(u.setUTCFullYear(e,t-1,n),u.setUTCHours(r,o,i,s),"Z"===c)return u;const a="+"===c[0]?1:-1,l=60*Number(c.slice(1,3))+Number(c.slice(4,6));return new Date(u.getTime()-a*l*60*1e3)}(Number(a),Number(l),Number(f),Number(d),Number(p),Number(m),w,h)}const s=/^(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function c(e,t){const n=String(e);return n.length>=t?n:`${"0".repeat(t-n.length)}${n}`}function u(e){if("string"!=typeof e)return null;const t=s.exec(e);if(!t)return null;const[n,i,c,u,a,l="0",f=""]=t.slice(1),d=Number(n),p=Number(i),m=Number(c),g=Number(u),h=Number(a),w=Number(l),y=Number(`${f}00`.slice(0,3));return d<1||!r(d,p,m,g,h,w,y)?null:o(d,p,m,g,h,w,y)}function a(t,n={}){const r="object"==typeof t&&null!==t?e(t):null;if(null===r)throw new TypeError("date must be a Date");if(!Number.isFinite(r))throw new RangeError("Invalid date");const o=n.precision??"minute";if("minute"!==o&&"second"!==o&&"millisecond"!==o)throw new TypeError("precision must be minute, second, or millisecond");const i=new Date(r),s=i.getFullYear();if(s<1)throw new RangeError("Date year must be greater than zero");const u=[c(s,4),c(i.getMonth()+1,2),c(i.getDate(),2)].join("-"),a=[c(i.getHours(),2),c(i.getMinutes(),2)];"minute"!==o&&a.push(c(i.getSeconds(),2));let l=`${u}T${a.join(":")}`;return"millisecond"===o&&(l+=`.${c(i.getMilliseconds(),3)}`),l}function l(t,n){const r="number"==typeof t?t:"object"==typeof t&&null!==t?e(t):null,o=new Date(r??NaN),i="number"==typeof n?n<0?Math.ceil(n):Math.floor(n):NaN;if(!Number.isFinite(o.getTime())||!Number.isFinite(i))return new Date(NaN);if(0===i)return o;const s=o.getMonth(),c=o.getDate(),u=o.getFullYear()-i,a=new Date(o.getTime());a.setFullYear(u,s+1,0);return c>=a.getDate()?a:(o.setFullYear(u,s,c),o)}function f(){return Date.now()}const d={type:"d"};function p(e){return"string"==typeof e&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T"):e}function m(e=0,t=0,n=d){n=Object.assign({},d,n);const{type:r}=n;"number"==typeof e&&Number.isFinite(e)||(e=new Date(p(e)).getTime()),"number"==typeof t&&Number.isFinite(t)||(t=new Date(p(t)).getTime());const o=Number(t)-Number(e);let i="",[s,c,u,a]=new Array(4).fill(0);if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),c=Math.floor(o/1e3/60/60),u=Math.floor(o/1e3/60),a=Math.floor(o/1e3),r){case"d":i=s;break;case"text":s=Math.floor(o/1e3/60/60/24),c=Math.floor(o/1e3/60/60%24),u=Math.floor(o/1e3/60%60),a=Math.floor(o/1e3%60),i=[{value:s,unit:"day"},{value:c,unit:"hour"},{value:u,unit:"minute"},{value:a,unit:"second"}].filter(({value:e})=>e>0).map(({value:e,unit:t})=>h(e,t)).join(" ")||h(0,"second");break;default:i=a}return i}function g(e=0,t=0,n=d){return m(e,t,n)}function h(e,t){const n=Math.round(10*e)/10;return`${n} ${1===n?t:`${t}s`}`}function w(e){const t=(Number.isFinite(e)?Math.max(e,0):0)/1e3;return t>=86400?h(t/24/60/60,"day"):t>=3600?h(t/60/60,"hour"):t>=60?h(t/60,"minute"):h(t,"second")}function y(e){return null!==i(e)}function b(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function v(e){const t=i(e);return null!==t&&t.getFullYear()===(new Date).getFullYear()}function E(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()}function T(e){const t=i(e);if(!t)return!1;const n=new Date,r=(n.getDay()+6)%7;n.setHours(0,0,0,0),n.setDate(n.getDate()-r);const o=new Date(n.getTime());o.setDate(o.getDate()+7);const s=t.getTime();return s>=n.getTime()&&s<o.getTime()}function A(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()&&t.getHours()===n.getHours()}function S(e,t){const n=Math.max(1,Math.round(e));return`about ${n} ${t}${1===n?"":"s"}`}function $(e){const t=i(e);if(!t)return"";const n=6e4,r=36e5,o=864e5,s=Math.abs(t.getTime()-Date.now());return s<3e4?"less than a minute":s<9e4?"about 1 minute":s<27e5?S(s/n,"minute"):s<54e5?"about 1 hour":s<864e5?S(s/r,"hour"):s<1512e5?"about 1 day":s<30*o?S(s/o,"day"):s<45*o?"about 1 month":s<365*o?S(s/(30*o),"month"):s<545*o?"about 1 year":S(s/(365*o),"year")}function _(e,t="yyyy-MM-dd"){void 0===e&&(e=new Date);const n=new Date(e);if(!Number.isFinite(n.getTime()))throw new RangeError("Invalid date");const 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"};let i=t||"yyyy-MM-dd";return Object.keys(o).forEach(e=>{let t=o[e];"MM"===e&&Number(t)<=9&&(t=`0${t}`),i=i.split(e).join(String(t))}),i}function N(e){return _(void 0===e?new Date:new Date(e instanceof Date?e.getTime():e),"yyyy.MMdd.HHmmss").split(".").map(e=>String(Number(e))).join(".")}function O(e,t){if(!Number.isSafeInteger(e))throw new TypeError("width must be a safe integer.");if(!Number.isSafeInteger(t))throw new TypeError("height must be a safe integer.");if(e<=0||t<=0)throw new RangeError("width and height must be greater than zero.");const n=function(e,t){for(;0!==t;){const n=e%t;e=t,t=n}return e}(e,t);return`${e/n}x${t/n}`}function x(e,t,n){const r=i(e);if(!r)throw new TypeError("startDate must be a valid date.");const o=i(t);if(!o)throw new TypeError("endDate must be a valid date.");const s=o.getTime()-r.getTime();if(s<=0)throw new RangeError("endDate must be later than startDate.");const c=function(e){if("number"==typeof e){if(!Number.isFinite(e))throw new TypeError("totalReturnRate must be a finite number or percentage string.");return e}if("string"!=typeof e)throw new TypeError("totalReturnRate must be a finite number or percentage string.");const t=e.trim();if(!t)throw new TypeError("totalReturnRate must not be empty.");const n=t.endsWith("%")?t.slice(0,-1).trim():t;if(!n)throw new TypeError("totalReturnRate must be a valid percentage string.");const r=Number(n);if(!Number.isFinite(r))throw new TypeError("totalReturnRate must be a valid percentage string.");return r/100}(n);if(c<=-1)throw new RangeError("totalReturnRate must be greater than -1.");const u=s/864e5,a=Math.pow(1+c,365/u)-1;if(!Number.isFinite(a))throw new RangeError("calculated CAGR must be finite.");return a}function j(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));let i=0;for(let s=0;s<n;++s)for(let n=0;n<r;++n)if(e[s]===t[n]){let e=0;s>0&&n>0&&(e=o[s-1][n-1]),o[s][n]=e+1,i=Math.max(i,o[s][n])}return i}function C(e,t){return j(e,t)}function M(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));for(let i=0;i<n;++i)for(let n=0;n<r;++n)if(e[i]===t[n]){let e=0;i>0&&n>0&&(e=o[i-1][n-1]),o[i][n]=e+1}else{let[e,t]=[0,0];n>0&&(e=o[i][n-1]),i>0&&(t=o[i-1][n]),o[i][n]=Math.max(e,t)}return o[n-1][r-1]}function D(e,t){return M(e,t)}function k(e){return Math.random()<e}function F(e){return k(e)}const L=Function.prototype.toString.call(Object);function R(e,t,n){const r=Object.getOwnPropertyDescriptor(t,n)?.get;if(!r)return!1;try{return r.call(e),!0}catch(e){return!1}}function z(e){return null===e||"object"!=typeof e?e:P(e,new WeakMap)}function P(t,n){if(null===t||"object"!=typeof t)return t;const r=t,o=n.get(r);if(void 0!==o)return o;const i=e(r);if(null!==i){const e=new Date(i);return n.set(r,e),e}const s=function(e){const t=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get;if(!t)return null;try{return t.call(e)}catch(e){return null}}(r);if(null!==s){const e=t,o=new RegExp(s,function(e){return e.flags}(e));return o.lastIndex=e.lastIndex,n.set(r,o),o}if("undefined"!=typeof ArrayBuffer&&R(r,ArrayBuffer.prototype,"byteLength")){const e=ArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof SharedArrayBuffer&&R(r,SharedArrayBuffer.prototype,"byteLength")){const e=SharedArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)){const e=P(t.buffer,n),o="undefined"!=typeof DataView&&R(r,DataView.prototype,"byteLength")?new DataView(e,t.byteOffset,t.byteLength):new t.constructor(e,t.byteOffset,t.length);return n.set(r,o),o}if("undefined"!=typeof Map&&R(r,Map.prototype,"size")){const e=new Map;return n.set(r,e),Map.prototype.forEach.call(t,(t,r)=>{e.set(P(r,n),P(t,n))}),e}if("undefined"!=typeof Set&&R(r,Set.prototype,"size")){const e=new Set;return n.set(r,e),Set.prototype.forEach.call(t,t=>{e.add(P(t,n))}),e}const c=Array.isArray(t),u=Object.getPrototypeOf(t),a=function(e){const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.hasOwn(t,"constructor")?t.constructor:null;return"function"==typeof n&&Function.prototype.toString.call(n)===L}(r),l=!c&&!a&&function(e){const t=Object.getPrototypeOf(e),n=t?.constructor;return"function"==typeof n&&-1===Function.prototype.toString.call(n).indexOf("[native code]")}(r);if(!c&&!a&&!l)return n.set(r,t),t;const f=c?new Array(t.length):Object.create(l?Object.prototype:u);return n.set(r,f),function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}(r).forEach(e=>{if(c&&"length"===e)return;const t=Object.getOwnPropertyDescriptor(r,e);t&&("value"in t&&(t.value=P(t.value,n)),Object.defineProperty(f,e,t))}),f}function U(e){return!e||"object"!=typeof e||Object.isFrozen(e)||(Object.freeze(e),Object.values(e).forEach(U)),e}function I(e,...t){return t.forEach(t=>{void 0!==t&&Object.keys(t).forEach(n=>{const r=t[n];if(void 0!==r){const t=e;"__proto__"!==n||Object.hasOwn(e,n)?t[n]=r:Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0})}})}),e}function B(e){return z(e)}function q(e){const t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function Y(e){const t=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return t.endsWith("-")?t.slice(0,-1):t}function W(e){return q(e)}function Z(e){const t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function H(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())}function V(e){return Z(e)}function J(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.replace(/[^A-Za-z0-9_$]/g,"_").toUpperCase();return/^[A-Za-z_$]/.test(t)?t:`_${t}`}function G(e){return e.trim()}function Q(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){}return!1}function K(e){return Q(e)}function X(e,t=null){try{return JSON.parse(e)}catch(e){return t}}function ee(e=5){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e--;)t+=Math.floor(10*Math.random());return t}function te(e=5){return ee(e)}function ne(e=3){const[t,n]=[f(),te(e||3)];return t+n}function re(e=3){return ne(e)}function oe(e,t=0){let n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),`${n}%`}function ie(e,t=0){return parseFloat(String(e)).toFixed(t)}function se(e,t,n={}){n=Object.assign({},n);let r=null,o=null,i=null,[s,c]=[null,0];const u=function(){c=!1===n.leading?0:f(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(...a){const l=f();c||!1!==n.leading||(c=l);const d=t-(l-c);return r=this,o=a,d<=0||d>t?(i&&(clearTimeout(i),i=null),c=l,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(u.bind(r),d)),s}}function ce(e,t,n){let r=null,o=null,i=null,s=null,c=null;const u=function(){const a=f()-i;a<t&&a>=0?o=setTimeout(u,t-a):(o=null,n||(c=e.apply(r,s),o||(r=s=null)))};return function(...a){r=this,s=a,i=f();const l=n&&!o;return o||(o=setTimeout(u,t)),l&&(c=e.apply(r,s),r=s=null),c}}function ue(e,t={}){const{isNaNAsNumber:n=!1,isInfinityAsNumber:r=!1,isUnFiniteAsNumber:o=!1}=t;return"number"==typeof e&&(!(!0!==r&&!0!==o&&!isFinite(e))&&!(!n&&isNaN(e)))}function ae(e,...t){let n=null;return e&&"function"==typeof e&&(n=e(...t)),n}function le(e,...t){return ae(e,...t)}function fe(e){let t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function de(e){const t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function pe(e){return"function"==typeof e}function me(e){return"string"==typeof e}function ge(e){return"boolean"==typeof e}function he(e){return ge(e)}function we(e){return null==e}function ye(e){return"[object Array]"===Object.prototype.toString.call(e)}function be(e){return!!de(e)&&0!==Object.keys(e).length}function ve(e){if(!e)return"";const t=new RegExp("\\n","g");return e.replace(t,"<br />")}function Ee(e){return ve(e)}function Te(e,t={}){const{removeNewLine:n=!1}=t;let r="";return e&&(r=e.replace(/<\/?.+?>/g,""),n&&(r=r.replace(/[\r\n]/g,""))),r}function Ae(e,t={}){return Te(e,t)}function Se(e,t={}){return Te(e,t)}function $e(e,t={}){return Te(e,t)}function _e(e,t={}){if("string"!=typeof e)throw new TypeError("value must be a string.");const n=t.preserveEntities?/&(?!(?:#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]+);)/gi:/&/g,r={"<":"<",">":">",'"':""","'":"'"};return e.replace(n,"&").replace(/[<>"']/g,e=>r[e])}function Ne(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,e=>t[e])}function Oe(e){const t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,e=>t[e])}function xe(e){return Oe(e)}function je(e,t,n={hasDot:!1,dotText:"..."}){if(n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){let r=0,o="";const i=/[^\x00-\xff]/g;let s="";const c=e.replace(i,"**").length;for(let n=0;n<c&&(s=e.charAt(n).toString(),null!=s.match(i)?r+=2:r++,!(r>t));n++)o+=s;return n.hasDot&&c>t&&(o+=n.dotText),o}return""}function Ce(e,t,n=!1){return je(e,t,{hasDot:n})}function Me(e,t,n=!1){return Ce(e,t,n)}function De(e,t={validStatusRange:[200,300],validCode:[0]}){const n=t||{},{validStatusRange:r=[200,300],validCode:o=[0]}=n;2!==r.length&&console.error("valid validStatusRange is required");let i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){const t=e.data;t&&o.includes(t.code)&&(i=!0)}return i}function ke(e,t,n){if(null===e||"object"!=typeof e)return!1;let r=e;for(const e of t){if(null===r||"object"!=typeof r&&"function"!=typeof r||!Object.hasOwn(r,e))return!1;r=r[e]}return r===n}const Fe=["B","KB","MB","GB","TB"];function Le(e,t={}){const{base:n=1024,fractionDigits:r=1,invalidValue:o=""}=t;if(!Number.isFinite(e)||e<0||1e3!==n&&1024!==n||!Number.isInteger(r)||r<0||r>20)return o;let i=e,s=0;for(;i>=n&&s<Fe.length-1;)i/=n,s+=1;return 0===s?`${Number(i.toFixed(r))} ${Fe[s]}`:`${i.toFixed(r)} ${Fe[s]}`}function Re(e,t={}){return Le(e,t)}function ze(e){let t,n,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r}async function Pe(e){const t="undefined"==typeof crypto?null:crypto;if(!t?.subtle||"function"!=typeof t.subtle.digest)throw new Error("Web Crypto API is not available.");let n=e;if("string"==typeof e){if("undefined"==typeof TextEncoder)throw new Error("TextEncoder is not available.");n=(new TextEncoder).encode(e)}const r=await t.subtle.digest("SHA-256",n);let o="";const i=new Uint8Array(r);for(let e=0;e<i.length;e++){const t=i[e].toString(16);o+=1===t.length?`0${t}`:t}return o}function Ue(e){return/^1\d{10}$/.test(e)}const Ie=Ue;function Be(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)}function qe(e){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e>0;){let n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t}function Ye(){return"v4"}function We(e,t={},n=e=>!0===e){const{interval:r=1e3,times:o=10,context:i,args:s}=t;if("function"!=typeof e)return void console.error("Expected a function.");if(!Number.isFinite(r)||r<0)return void console.error("Expected a non-negative number for interval.");if(!Number.isFinite(o)||o<0)return void console.error("Expected a non-negative number for times.");if(0===o)return;let c=0;const u=()=>{setTimeout(async()=>{const t=await e.apply(i,s);n(t)||++c>=o||u()},r)};u()}async function Ze(e){return new Promise(t=>{setTimeout(()=>{t(e)},e)})}async function He(e){return Ze(e)}let Ve="";function Je(){if(Ve)return"browser"===Ve;const e="undefined"!=typeof window;return e&&(Ve="browser"),e}function Ge(e,t){const n=e[t];if(void 0!==n&&"string"!=typeof n)throw new TypeError(`manifest.${t} must be a string when provided`);return n}function Qe(e){if(void 0===e)return{name:""};if("string"==typeof e)return{name:e.trim()};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest.author must be a string or object");const t=e,n={name:""};for(const e of["name","email","url"]){const r=t[e];if(void 0!==r&&"string"!=typeof r)throw new TypeError(`manifest.author.${e} must be a string when provided`);if("string"==typeof r){const t=r.trim();("name"===e||t)&&(n[e]=t)}}return n}function Ke(e,t={}){if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest must be an object");if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("options must be an object when provided");const n=e;if("string"!=typeof n.name||!n.name.trim())throw new TypeError("manifest.name must be a non-empty string");const r=n.name.trim(),o=function(e){if(/\s/.test(e))throw new TypeError("manifest.name must not contain whitespace");if(e.startsWith("@")){const t=e.split("/");if(2!==t.length||t[0].length<2||!t[1])throw new TypeError("manifest.name must be a valid scoped package name");return t[1]}if(e.includes("/"))throw new TypeError("manifest.name must be an unscoped or scoped package name");return e}(r),i=t.packageManager??"npm";if("npm"!==i&&"pnpm"!==i&&"yarn"!==i)throw new TypeError('packageManager must be "npm", "pnpm", or "yarn"');const s="npm"===i?"npm install":`${i} add`;return{name:r,version:Ge(n,"version"),description:Ge(n,"description"),license:Ge(n,"license"),author:Qe(n.author),unscopedName:o,iifeGlobal:J(o),installCommand:`${s} ${r}`}}function Xe(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}}function et(e){const t=e.indexOf("#"),n=-1===t?e:e.slice(0,t),r=n.indexOf("?"),o=/^(?:[a-z][a-z\d+.-]*:)?\/\//i.test(n)||"/"===n.charAt(0),i=-1===r?o?"":n:n.slice(r+1);return i?i.split("&").reduce((e,t)=>{if(!t||-1===t.indexOf("="))return e;const n=t.indexOf("=");return e.push([Xe(t.slice(0,n)),Xe(t.slice(n+1))]),e},[]):[]}function tt(e,t){return et(e).filter(([e])=>e===t).map(([,e])=>e)}const nt=/^(?=.{1,39}$)(?!.*--)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/,rt=/^(?=.{1,100}$)(?!\.{1,2}$)[A-Za-z0-9_.-]+$/;function ot(){return new Error("The value does not identify one supported GitHub repository")}function it(e,t){const n=t.replace(/\.git$/i,"");if(!nt.test(e)||!rt.test(n))throw ot();const r=`${e}/${n}`;return{owner:e,name:n,slug:r,url:`https://github.com/${r}`}}function st(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.trim();if(!t||/[%\\?#]/.test(t)||function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<=31||127===n)return!0}return!1}(t))throw ot();const n=t.match(/^(?:github:)?([^/:\s]+)\/([^/\s]+)$/i);if(n)return it(n[1],n[2]);const r=t.match(/^git@([^:\s]+):([^/\s]+)\/([^/\s]+)$/);if(r&&"github.com"===r[1].toLowerCase())return it(r[2],r[3]);const o=t.replace(/^git\+(?=(?:git|ssh|https?):\/\/)/i,""),i=o.match(/^[a-z][a-z\d+.-]*:\/\/([^/?#]+)/i);if(!i||/(^|\/)\.{1,2}(?:\/|$)/.test(o.slice(i[0].length)))throw ot();if(-1!==i[1].slice(i[1].lastIndexOf("@")+1).indexOf(":"))throw ot();let s;try{s=new URL(o)}catch(e){throw ot()}const c=s.protocol.toLowerCase(),u=s.hostname.toLowerCase().replace(/^www\./,"");if(!["git:","ssh:","http:","https:"].includes(c)||"github.com"!==u||""!==s.username&&"git"!==s.username||""!==s.password||""!==s.search||""!==s.hash)throw ot();const a=s.pathname.match(/^\/([^/]+)\/([^/]+)\/?$/);if(!a)throw ot();return it(a[1],a[2])}function ct(e){return tt(location.search,e)[0]||""}function ut(e=""){""===e&&(e=location.search);const t={};return et(e).forEach(([e,n])=>{Object.hasOwn(t,e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}),t}function at(e,t,n={}){const r=tt(e,t);return n.returnArray?r:r.length?r[0]:null}function lt(e,t,n){const r=e.indexOf("#"),o=-1===r?"":e.slice(r),i=-1===r?e:e.slice(0,r),s=i.indexOf("?"),c=-1===s?i:i.slice(0,s),u=-1===s?"":i.slice(s+1),a=encodeURIComponent(t),l=encodeURIComponent(n);let f=!1;const d=(u?u.split("&").filter(Boolean):[]).reduce((e,n)=>{const r=n.indexOf("=");return Xe(-1===r?n:n.slice(0,r))===t?f||(e.push(`${a}=${l}`),f=!0):e.push(n),e},[]);return f||d.push(`${a}=${l}`),`${c}?${d.join("&")}${o}`}function ft(e){const t=location.hash.split("?");return 1===t.length?"":tt(`?${t.slice(1).join("?")}`,e)[0]||""}function dt(e,t=["hostname"]){try{const n=new URL(e,document.baseURI);return t.reduce((e,t)=>e+=n[t],"")}catch(n){const r=document.createElement("a");return r.href=e,t.reduce((e,t)=>e+=r[t],"")}}function pt(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)}function mt(e){return void 0===e||Number(e)<=65535}function gt(e){const t=e.split(".");return 4===t.length&&t.every(e=>/^\d{1,3}$/.test(e)&&(1===e.length||"0"!==e.charAt(0))&&Number(e)<=255)}function ht(e){const t=e.split("::");if(t.length>2)return!1;const n=2===t.length;let r=[];t.forEach(e=>{e&&(r=r.concat(e.split(":")))});let o=0;for(let e=0;e<r.length;e++){const t=r[e];if(-1!==t.indexOf(".")){if(e!==r.length-1||!gt(t))return!1;o+=2}else{if(!/^[0-9a-f]{1,4}$/i.test(t))return!1;o+=1}}return n?o<8:8===o}function wt(e){const t=e.match(/^\[([0-9a-f:.]+)\]$/i);if(t)return ht(t[1]);if("."===e.charAt(e.length-1)&&(e=e.slice(0,-1)),gt(e))return!0;const n=e.split(".");return!(n.length<2||n.some(e=>!e||!/^[a-z\d-]+$/i.test(e)||"-"===e.charAt(0)||"-"===e.charAt(e.length-1)))&&!/^\d+$/.test(n[n.length-1])}function yt(e,t={strict:!0}){if("string"!=typeof e||!e||e.trim()!==e)return!1;const n=/^https?:\/\/[^/\\]/i.test(e),r=/^\/\/[^/\\]/.test(e);if(!n&&(t.strict||!r))return!1;const o=r?`http:${e}`:e;if(!function(e){const t=e.match(/^https?:\/\/([^/?#]+)(?:[/?#][^\s<>"`]*)?$/i);if(!t||-1!==t[1].indexOf("@"))return!1;const n=t[1],r=n.match(/^\[([0-9a-f:.]+)\](?::(\d*))?$/i);if(r)return ht(r[1])&&mt(r[2]);const o=n.match(/^([^:]+)(?::(\d*))?$/);return!(!o||!mt(o[2]))&&wt(o[1])}(o))return!1;try{const e=new URL(o);return("http:"===e.protocol||"https:"===e.protocol)&&wt(e.hostname)&&!e.username&&!e.password}catch(e){return!1}}function bt(e){let t="";if("string"!=typeof e||""==e)return t;const n=e.split(/[?#]/,1)[0],r=/\.[^/]+$/.exec(n);return r?(r[0].length>1&&(t=r[0].substring(1)),t):t}function vt(e,t=""){t||(t=".js");const n=document.querySelectorAll("script[src]");for(let r=0;r<n.length;r++){const o=n[r].getAttribute("src");if(o&&-1!==o.indexOf(t)){const t=tt(o,e)[0];if(void 0!==t)return t}}return""}function Et(e){return e&&0===Object.keys(e).length?"":`?${Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}`}function Tt(e){return e.replace(/^http:/,"https:")}function At(e){return Tt(e)}function St(e){!yt(e)&&yt(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).host}catch(e){return""}}function $t(e){!yt(e)&&yt(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).pathname}catch(e){return""}}function _t(e,t={}){const{fireOnInit:n=!0}=t,r=history;let o=location.href;const i=[],s=t=>{const n=location.href;if(n===o&&"load"!==t)return;const r=o;o=n,e({url:n,oldUrl:r,trigger:t})},c=()=>s("popstate"),u=()=>s("hashchange");window.addEventListener("popstate",c),window.addEventListener("hashchange",u),i.push(()=>window.removeEventListener("popstate",c)),i.push(()=>window.removeEventListener("hashchange",u)),r.__mazeyUrlChangePatched__||(r.__mazeyUrlChangePatched__=!0,r.__mazeyUrlChangeSubscribers__=new Set,r.__mazeyRawPushState__=history.pushState.bind(history),r.__mazeyRawReplaceState__=history.replaceState.bind(history),history.pushState=function(...e){r.__mazeyRawPushState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("pushState"))},history.replaceState=function(...e){r.__mazeyRawReplaceState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("replaceState"))});const a=e=>s(e);return r.__mazeyUrlChangeSubscribers__.add(a),i.push(()=>r.__mazeyUrlChangeSubscribers__.delete(a)),n&&s("load"),()=>{i.forEach(e=>e())}}const Nt={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:()=>{},errorFn:()=>{}};function Ot(e="",t={...Nt}){const{enabled:n,isClosed:r,showWrap:o,showDate:i,locales:s,isStringifyObject:c,logFn:u,errorFn:a}=Object.assign({...Nt},t);let l=n;!0===r&&(xt.warn("The options.isClosed is deprecated. Please use options.enabled instead."),l=!1);const f=Object.create(null),d=()=>(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return["log","info","warn","error"].forEach(t=>{f[t]=function(...n){if(!l)return;let r=e,s=e;if("string"==typeof e&&e.length>=2){const t=e.length;r=":"===e[t-1]?e.substring(0,t-1):e}o&&console.log(`--- ${r} - begin ---`),i&&(s=e?`${d()} ${e}`:`${d()}`),c&&(n=n.map(e=>de(e)?JSON.stringify(e):e)),e||i?console[t](s,...n):console[t](...n),"log"===t&&u(),"error"===t&&a(),o&&console.log(`--- ${r} - end ---`)}}),f}const xt=Ot("[Mazey]"),jt=Ot("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function Ct(e,t){if(!e)return xt.error("The element is not exist."),!1;const n=e.className.split(/\s+/);for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1}function Mt(e,t){if(!e)return void xt.error("The element is not exist.");if(Array.isArray(t))return void t.forEach(t=>{t&&e.classList.add(t)});if(!t)return;const n=e.className,r=n.split(/\s+/);for(let e=0;e<r.length;e++)if(r[e]===t)return;let o="",i="";""!==n&&(o=" "),i=n+o+t,e.className=i}function Dt(e,t){Mt(e,t)}function kt(e,t){if(!e)return void xt.error("The element is not exist.");let n;n=" "+e.className+" ",n=n.replace(/(\s+)/gi," "),n=n.replace(" "+t+" "," "),n=n.replace(/(^\s+)|(\s+$)/g,""),e.className=n}function Ft(e,t={id:""}){if(!e)return!1;const n=document.createDocumentFragment();let r=null,o="";const i=document.createElement("style");return t.id?(o=`${t.id}`,r=document.getElementById(o),r?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}function Lt(){const e=window.jQuery||window.$;if(e){const t=e("img");return!(!t||!t.length)&&(t.each(function(){const t=e(this);if(!t)return;const n=t.attr("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&fe(r)&&r[1]&&t.width(r[1]),o&&fe(o)&&o[1]&&t.height(o[1])}),!0)}{const e=document.getElementsByTagName("img");if(e.length>0)return Array.from(e).forEach(function(e){const t=e;if(!t)return;const n=t.getAttribute("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&fe(r)&&r[1]&&(t.style.width=r[1]),o&&fe(o)&&o[1]&&(t.style.height=o[1])}),!0}return!1}function Rt(){return Lt()}function zt(e,t){let n="";return t&&t.length>0&&(n=t.join(";")+";"),`${e}{${n}}`}function Pt(e){const t=document.getElementsByTagName("meta");for(let n=0;n<t.length;n++)if(t[n].getAttribute("name")===e)return t[n].getAttribute("content")||"";return""}function Ut(e,t={}){if("string"!=typeof e)return!1;const n=e.trim();if(!n)return!0===t.allowEmpty;const r=t.root||("undefined"==typeof document?null:document);if(!r)return!1;try{return r.querySelector(n),!0}catch(e){return!1}}function It(e){return Boolean(e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}const Bt=new WeakMap,qt=new WeakMap,Yt={button:"inline-block",input:"inline-block",select:"inline-block",textarea:"inline-block",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",li:"list-item",summary:"list-item"},Wt=new Set(["address","article","aside","blockquote","body","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","main","nav","ol","p","pre","section","ul"]);function Zt(e){if(!It(e))return null;const t=e.style;return t&&"string"==typeof t.display?e:null}function Ht(e){const t=new Set,n=e=>{const n=Zt(e);n&&t.add(n)};if("string"==typeof e){if("undefined"==typeof document)return[];try{document.querySelectorAll(e).forEach(n)}catch(e){return[]}return Array.from(t)}const r=Zt(e);if(r)return[r];if(!e||"object"!=typeof e)return[];if("function"==typeof e[Symbol.iterator]){for(const t of e)n(t);return Array.from(t)}const o=e.length;if(!Number.isSafeInteger(o)||o<0)return[];for(let t=0;t<o;t+=1)n(e[t]);return Array.from(t)}function Vt(e){const t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).display:null}function Jt(e){const t=e.ownerDocument,n=e.localName.toLowerCase();let r=qt.get(t);r||(r=new Map,qt.set(t,r));const o=e.namespaceURI||"",i=`${o}:${n}`,s=r.get(i);if(s)return s;let c="";const u="http://www.w3.org/1999/xhtml"===o&&n.includes("-"),a=t.body||t.documentElement;if(a&&!u){const e=o&&"http://www.w3.org/1999/xhtml"!==o?t.createElementNS(o,n):t.createElement(n);a.appendChild(e);try{c=Vt(e)||""}finally{a.removeChild(e)}}return c&&"none"!==c||(c=function(e){return Yt[e]?Yt[e]:Wt.has(e)?"block":"inline"}(n)),r.set(i,c),c}function Gt(e){return Ht(e).forEach(e=>{"none"!==Vt(e)&&"none"!==e.style.display&&Bt.set(e,e.style.display),e.style.display="none"}),e}function Qt(e){return Ht(e).forEach(e=>{Bt.has(e)?(e.style.display=Bt.get(e),Bt.delete(e)):"none"===e.style.display&&(e.style.display=""),""===e.style.display&&"none"===Vt(e)&&(e.style.display=Jt(e))}),e}function Kt(e,t){if(void 0===e)return It(t.defaultElement)?t.defaultElement:null;let n=t.unwrap?t.unwrap(e):e;if(null==n)return null;if("string"==typeof n)try{return t.root.querySelector(n)}catch(e){return null}return"object"==typeof n&&"$el"in n&&(n=n.$el),It(n)?n:null}function Xt(e,t={}){const{excludeSelector:n="",replaceImagesWithAlt:r=!0,normalizeWhitespace:o=!0}=t,i=e.cloneNode(!0);r&&Array.from(i.querySelectorAll("img[alt]")).forEach(e=>{const t=e.getAttribute("alt")||"";e.parentNode?.replaceChild(i.ownerDocument.createTextNode(t),e)});const s=n.trim();s&&Ut(s,{root:i})&&Array.from(i.querySelectorAll(s)).forEach(e=>e.parentNode?.removeChild(e));const c=i.innerText||i.textContent||"";return o?c.replace(/\u00a0/g," ").replace(/\s+/g," ").trim():c}function en(e){e.stopPropagation()}function tn(){const e=window.MAZEY_DEFINE_LISTENERS;if(e&&"object"==typeof e)return e;const t=Object.create(null);return window.MAZEY_DEFINE_LISTENERS=t,t}function nn(e,t){const n=tn();Array.isArray(n[e])||Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:[],writable:!0}),"function"==typeof t&&n[e].push(t)}function rn(e,t){const n=tn()[e];if(Array.isArray(n)){const e=n.slice();for(let n=0,r=e.length;n<r;n++)"function"==typeof e[n]&&(void 0===t?e[n]():e[n](t))}}function on(e,t){rn(e,t)}function sn(e,t){const n=tn(),r=n[e];if("string"==typeof e&&Array.isArray(r))if("function"==typeof t){for(let o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]}function cn(e,t=null){if(e){const n=JSON.stringify(t);sessionStorage.setItem(e,void 0===n?"null":n)}}function un(e){let t=null;if(e){const n=sessionStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}function an(e,t=null){if(e){const n=JSON.stringify(t);localStorage.setItem(e,void 0===n?"null":n)}}function ln(e){let t=null;if(e){const n=localStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}const fn=cn,dn=un,pn=an,mn=ln,gn="__mazey_cookie_name_encoded__-",hn="__mazey_cookie_value_encoded__-";function wn(e){return`${hn}${encodeURIComponent(e)}`}function yn(e){const t=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(e),n=0===e.indexOf(gn)||0===e.indexOf(hn);return t&&!n?e:function(e){return`${gn}${encodeURIComponent(e)}`}(e)}function bn(e){const t=yn(e);return t!==e?[t,e]:[e]}function vn(e){const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){const r=n[e].trim();if(0===r.indexOf(t))return r.substring(t.length)}}function En(e){const t=bn(e),n="1"===vn(wn(e));for(let e=0;e<t.length;e++){const r=vn(t[e]);if(void 0!==r){if(n)try{return decodeURIComponent(r)}catch(e){return r}return r}}return""}function Tn(e,t,n,r){let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";const i=function(e){let t=!0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(!(33===r||r>=35&&r<=43||r>=45&&r<=58||r>=60&&r<=91||r>=93&&r<=126)){t=!1;break}}return{isEncoded:!t,value:t?e:encodeURIComponent(e)}}(t),s=yn(e),c=i.isEncoded?"1":"",u=i.isEncoded?o:"; expires=Thu, 01 Jan 1970 00:00:00 GMT",a=[`${s}=${i.value}${o}; path=/`,`${wn(e)}=${c}${u}; path=/`],l=e=>{const t=e?`; domain=${e}`:"";a.forEach(e=>{document.cookie=`${e}${t}`})},f=location.hostname;if(r)l(r);else if(-1===f.indexOf("."))l();else{const n=f.split(".");n.shift();l("."+n.join(".")),En(e)!==t&&l(`.${f}`)}}function An(e){const t=bn(e),n=t.concat(wn(e)),r=new Date;r.setTime(r.getTime()-1);const o=t.some(e=>void 0!==vn(e));return n.forEach((e,t)=>{if(n.indexOf(e)===t&&void 0!==vn(e)){[`${e}=; expires=${r.toUTCString()}`,`${e}=; expires=${r.toUTCString()}; path=/`].forEach(e=>{document.cookie=e;const t=location.hostname;if(-1!==t.indexOf(".")){const n=t.split(".");for(let t=0;t<n.length;t++)document.cookie=`${e}; domain=.${n.slice(t).join(".")}`}})}}),o&&n.every(e=>void 0===vn(e))}function Sn(e){An(e)}function $n(e,t={id:""}){const{id:n}=t;return new Promise((t,r)=>{const o=document.createElement("link");let i=!1;const s=()=>{o.onload=null,o.onerror=null};o.rel="stylesheet",o.type="text/css",o.href=e,void 0!==n&&(o.id=n),o.onload=()=>{i||(i=!0,s(),t("loaded"))},o.onerror=()=>{i||(i=!0,s(),r(new Error(`Failed to load CSS: ${e}`)))},document.head.appendChild(o)})}const _n={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function Nn(e,t={..._n}){const{id:n,callback:r,timeout:o,isDefer:i,isAsync:s,isCrossOrigin:c,attributes:u,cssUrl:a}=Object.assign({..._n},t);if(a){const t=function(e,t){if(!t)return"";if(yt(t))return t;try{const n=new URL(e,location.href);return new URL(t,n).href}catch(n){const r=e.split("/");return r.pop(),`${r.join("/")}/${t}`}}(e,a);t&&$n(t).catch(e=>{console.error(`Failed to load CSS from ${t}: ${e?.message}`)})}return new Promise((t,a)=>{const l=document.createElement("script");let f=!1,d=null;const p=()=>{l.onload=null,l.onerror=null,null!==d&&(clearTimeout(d),d=null)},m=e=>{f||(f=!0,p(),a(e))};l.type="text/javascript",l.defer=Boolean(i),l.async=Boolean(s),c&&(l.crossOrigin="anonymous"),n&&(l.id=n),u&&Object.keys(u).forEach(e=>{l.setAttribute(e,u[e])}),l.onload=()=>{if(!f){f=!0,p();try{le(r),t("loaded")}catch(e){a(e)}}},l.onerror=()=>m(new Error(`Failed to load script: ${e}`)),l.src=e,o&&(d=setTimeout(()=>m(new Error("timeout")),o));const g=document.getElementsByTagName("script")[0];if(g?.parentNode)g.parentNode.insertBefore(l,g);else{(document.head||document.body||document.documentElement).appendChild(l)}})}function On(e=3e4){return new Promise((t,n)=>{let r=null;const o=()=>{window.removeEventListener("load",i),null!==r&&(clearTimeout(r),r=null)},i=()=>{o(),t("load")};"complete"!==document.readyState?(window.addEventListener("load",i),r=setTimeout(()=>{o(),n(new Error("timeout"))},e)):t("complete")})}function xn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})}function jn(e,t){if(window[e])return Promise.resolve("defined");let n=Cn.get(e);const r=n?.get(t);if(r)return r;n||(n=new Map,Cn.set(e,n));const o=()=>{n?.delete(t),0===n?.size&&Cn.delete(e)},i=Nn(t).then(e=>(o(),e),e=>{throw o(),e});return n.set(t,i),i}const Cn=new Map;function Mn(e){if("undefined"==typeof window)return!1;let t=[];const n=window.PerformanceObserver;return!!n&&(fe(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}async function Dn(){return Mn("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-contentful-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function kn(){return Mn("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function Fn(){return Mn("largest-contentful-paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"largest-contentful-paint"===e.entryType);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"largest-contentful-paint",buffered:!0})}):0}async function Ln(){return Mn("first-input")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-input"===e.entryType);if(r){t.disconnect();const n=r.processingStart;e(n?Math.round(r.processingStart-r.startTime):0)}});t.observe({type:"first-input",buffered:!0})}):0}async function Rn(){return Mn("layout-shift")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().reduce((e,t)=>{let n=0;return ue(t.value)&&(n=t.value),e+n},0);t.disconnect(),e(r)});t.observe({type:"layout-shift",buffered:!0})}):0}async function zn(){if(!Mn("navigation"))return 0;if(!window.performance||!window.performance.getEntriesByType)return 0;const e=window.performance.getEntriesByType("navigation")[0];let t=0;return e?(t=e.responseStart-e.requestStart,Math.round(t)):0}async function Pn(e=!1){if(!Mn("navigation"))return Promise.reject(new Error("navigation is not supported"));const t=window.performance;if(!t||"function"!=typeof t.getEntriesByType)return Promise.reject(new Error("performance is not supported"));let n;const r=new Promise(e=>{[n]=[e]}),o=t.getEntriesByType("navigation");if(!fe(o))return Promise.reject(new Error("NavigationTiming is not supported"));const i=o[0];let[s,c,u,a,l,f,d,p,m,g,h,w,y,b,v,E,T,A,S]=new Array(19).fill(0);({decodedBodySize:A,encodedBodySize:S}=i),({unloadEventEnd:s,unloadEventStart:c,redirectEnd:u,redirectStart:a,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:w,domContentLoadedEventStart:y,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i);let $=0;if(ue(E))$=E;else{if(!ue(T))return Promise.reject(new Error("startTime, navigationStart or fetchStart are required"));$=T}const[_,N]=await Promise.all([kn(),Dn()]);function O(){({decodedBodySize:A,encodedBodySize:S}=i),({unloadEventEnd:s,unloadEventStart:c,redirectEnd:u,redirectStart:a,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:w,domContentLoadedEventStart:y,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i),ue(E)?$=E:ue(T)&&($=T);const t={source:"PerformanceNavigationTiming",os:x(),osVersion:j(),deviceType:C(),network:M(),screenDirection:D(),unloadTime:s-c,redirectTime:u-a,dnsTime:l-f,tcpTime:d-p,sslTime:k(d,m),responseTime:g-h,downloadTime:w-g,firstPaintTime:_,firstContentfulPaintTime:N,domReadyTime:y-$,onloadTime:b-$,whiteTime:g-$,renderTime:v-$,decodedBodySize:A,encodedBodySize:S};Object.keys(t).forEach(e=>{ue(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))}),ue(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);const r={};e||Object.keys(t).forEach(e=>{r[V(e)]=t[e]}),Object.keys(r).length?n(r):n(t)}function x(){let e;return e=navigator.userAgent.indexOf("Android")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others",e}function j(){let e="";const t=navigator.userAgent,n=t.indexOf("Android")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;const i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function C(){let e;const 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",s=t.match(/ucweb/i)&&"ucweb",c=t.match(/android/i)&&"android",u=t.match(/windows ce/i)&&"windows ce",a=t.match(/windows mobile/i)&&"windows mobile";return e=n||r||o||i||s||c||u||a?r||o||i||s||c||u||a?"phone":n?"ipad":void 0:"pc",e||(e=""),e}function M(){let e="";const t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function D(){let e="";return window.screen&&window.screen.orientation&&"number"==typeof 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 k(e,t){let n=0;return t&&(n=e-t),n}return ue(v)&&v>0?O():"complete"===document.readyState?window.setTimeout(O,0):window.addEventListener("load",function e(){window.removeEventListener("load",e),window.setTimeout(function(){O()},0)}),r}function Un(e,t=e.userAgent.trim().toLowerCase()){return/\bmacintosh\b/.test(t)&&"macintel"===e.platform.toLowerCase()&&e.maxTouchPoints>1}const In=Object.freeze(["adsbot-google","ahrefsbot","amazonbot","applebot","baiduspider","bingbot","bingpreview","bytespider","ccbot","chatgpt-user","claudebot","discordbot","dotbot","duckduckbot","facebookexternalhit","facebot","google-inspectiontool","googlebot","googleother","gptbot","linkedinbot","mediapartners-google","mj12bot","perplexitybot","petalbot","semrushbot","slackbot","slurp","storebot-google","telegrambot","twitterbot","whatsapp","yandexbot"]),Bn=Object.freeze(["headlesschrome","phantomjs","slimerjs","selenium","puppeteer","playwright"]);function qn(){try{return"undefined"==typeof navigator?null:navigator}catch(e){return null}}function Yn(){const e=qn();if(!e)return{userAgent:"",platform:"",maxTouchPoints:0};let t="",n="",r=0;try{const n=e.userAgent;t="string"==typeof n?n:""}catch(e){return{userAgent:"",platform:"",maxTouchPoints:0}}try{const t=e.platform;n="string"==typeof t?t:""}catch(e){n=""}try{const t=e.maxTouchPoints;r=Number.isFinite(t)?t:0}catch(e){r=0}return{userAgent:t,platform:n,maxTouchPoints:r}}function Wn(e){const t=e.userAgent.trim().toLowerCase();return t?/\bandroid\b|\badr\b/.test(t)?"android":/\bios\b|\biphone\b|\bipad\b|\bipod\b|\biwatch\b/.test(t)||Un(e,t)?"ios":/\bwindows\b|\bwin32\b|\bwin64\b|\bwow32\b|\bwow64\b/.test(t)?"windows":/\bmacintosh\b|\bmacintel\b|\bmac os x\b/.test(t)?"macos":/\blinux\b/.test(t)?"linux":"":""}function Zn(e){const t=e.userAgent.trim().toLowerCase();if(!t)return"";if(/\biwatch\b|\bapple watch\b/.test(t))return"";if(/\bipad\b|\btablet\b/.test(t)||Un(e,t))return"tablet";const n=Wn(e);return"android"===n?/\bmobile\b/.test(t)?"mobile":"tablet":"ios"===n&&/\biphone\b|\bipod\b/.test(t)?"mobile":"windows"===n||"macos"===n||"linux"===n||/\bcros\b/.test(t)?"desktop":/\bmobile\b/.test(t)?"mobile":""}function Hn(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return Zn(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:Yn())}function Vn(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return Wn(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:Yn())}function Jn(e){return"mobile"===Hn(e)}function Gn(e){return"desktop"===Hn(e)}function Qn(e){return"tablet"===Hn(e)}function Kn(e){return"ios"===Vn(e)}function Xn(e){return"android"===Vn(e)}function er(e){return"macos"===Vn(e)}function tr(e){return"windows"===Vn(e)}function nr(e){return"linux"===Vn(e)}function rr(e,t){const n=e.trim().toLowerCase();return t.some(e=>n.includes(e))}function or(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");const t=void 0===e?function(){const e=qn();if(!e)return"";try{const t=e.userAgent;return"string"==typeof t?t:""}catch(e){return""}}():e;return rr(t,In)?"crawler":rr(t,Bn)||function(){const e=qn();if(!e)return!1;try{return!0===e.webdriver}catch(e){return!1}}()?"automation":"unknown"}function ir(e={}){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;const t=e.requireManifest,n=e.scope;if(void 0!==t&&"boolean"!=typeof t||void 0!==n&&"string"!=typeof n)return!1;if(!0!==window.isSecureContext||!("serviceWorker"in navigator))return!1;if(void 0!==n&&!function(e){const t=e.trim();if(!t||/[?#]/.test(t))return!1;try{const e=new URL(window.location.href),n=new URL(t,e);if(n.origin!==e.origin||""!==n.search||""!==n.hash)return!1;if(e.pathname===n.pathname)return!0;const r=n.pathname.endsWith("/")?n.pathname:`${n.pathname}/`;return e.pathname.startsWith(r)}catch(e){return!1}}(n))return!1;if(!1===t)return!0;if("undefined"==typeof document)return!1;const r=document.querySelector('link[rel~="manifest"][href]');return Boolean(r?.getAttribute("href")?.trim())}catch(e){return!1}}function sr(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator;try{const e=window.matchMedia;if("function"==typeof e&&e.call(window,"(display-mode: standalone)").matches)return!0}catch(e){}try{return!0===e.standalone}catch(e){return!1}}function cr(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;let e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{const t=Yn(),n=t.userAgent.toLowerCase();if(!n)return e;const r=e=>e.test(n),o=e=>{let t="";const r=n.match(e);return r&&fe(r)&&(t=r.toString(),t=t.replace(/[^0-9|_.]/g,""),t=t.replace(/_/g,".")),t},i=Wn(t);let s="";"ios"===i&&(r(/ipad/g)?s="ipad":r(/iphone/g)?s="iphone":r(/iwatch/g)?s="iwatch":r(/ipod/g)?s="ipod":"macintel"===t.platform.toLowerCase()&&t.maxTouchPoints>1&&(s="ipad")),e={...e,system:i,appleType:s};let 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={...e,systemVs:c};let u="";"windows"===i||"macos"===i||"linux"===i?u="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(u="mobile"),e={...e,platform:u};let a="",l="";r(/applewebkit/g)?(a="webkit",r(/edg(?:a|ios)?\//g)||r(/edge\//g)?l="edge":r(/opr/g)?l="opera":r(/chrome/g)?l="chrome":r(/safari/g)&&(l="safari")):r(/gecko/g)&&r(/firefox/g)?(a="gecko",l="firefox"):r(/presto/g)?(a="presto",l="opera"):r(/trident|compatible|msie/g)&&(a="trident",l="iexplore"),e={...e,engine:a,supporter:l};let f="";"webkit"===a?f=o(/applewebkit\/[\d._]+/g):"gecko"===a?f=o(/gecko\/[\d._]+/g):"presto"===a?f=o(/presto\/[\d._]+/g):"trident"===a&&(f=o(/trident\/[\d._]+/g)),e={...e,engineVs:f};let d="";"chrome"===l?d=o(/chrome\/[\d._]+/g):"safari"===l?d=o(/version\/[\d._]+/g):"firefox"===l?d=o(/firefox\/[\d._]+/g):"opera"===l?d=o(/opr\/[\d._]+/g):"iexplore"===l?d=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(d=o(/(?:edge|edg|edga|edgios)\/[\d._]+/g)),e={...e,supporterVs:d};let p="",m="";r(/micromessenger/g)?(p="wechat",m=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",m=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",m=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",m=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",m=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),e={...e,shell:p,shellVs:m};let g="";if(window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");e.matches?g="dark":t.matches&&(g="light")}return e={...e,colorScheme:g},window.MAZEY_BROWSER_INFO=e,e}catch(t){return xt.warn(t),e}}function ur(e="",t="-"){const n=cr(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(o=>{const i=n[o];if(i){let n="";e&&e.length>0&&(n=`${e}${t}`),r.push(`${n}${i}`)}}),r}let ar="";function lr(){if(ar)return Promise.resolve("webp"===ar);return new Promise(e=>{const t=new Image;t.onload=()=>{const n=t.width>0&&t.height>0;ar=n?"webp":"no-webp",e(n)},t.onerror=()=>{ar="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})}function fr(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");if(null===e)return()=>{};if("object"!=typeof e)throw new TypeError("media must be a MediaQueryList or null");const n=e.addEventListener,r=e.removeEventListener;let o=null;if("function"==typeof n&&"function"==typeof r){const i=t;n.call(e,"change",i),o=()=>r.call(e,"change",i)}let i=!1;return()=>{i||(i=!0,o?.())}}function dr(e,t,n){if(null===e||"object"!=typeof e||"function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)throw new TypeError("registration must support event listeners");if(null===t||"object"!=typeof t||"function"!=typeof t.addEventListener||"function"!=typeof t.removeEventListener)throw new TypeError("container must support event listeners");if(null===n||"object"!=typeof n||"function"!=typeof n.onUpdateAvailable||void 0!==n.onControllerChange&&"function"!=typeof n.onControllerChange)throw new TypeError("callbacks must provide onUpdateAvailable");let r=!1,o=null,i=null,s=!1,c=!1;const u=e=>{r||i===e||(i=e,n.onUpdateAvailable(e))},a=()=>{!r&&"installed"===o?.state&&t.controller&&u(o)},l=()=>{r||(o?.removeEventListener("statechange",a),o=e.installing,o?.addEventListener("statechange",a),a())},f=()=>{r||n.onControllerChange?.()},d=()=>{if(s){try{e.removeEventListener("updatefound",l)}catch(e){}s=!1}try{o?.removeEventListener("statechange",a)}catch(e){}if(c){try{t.removeEventListener("controllerchange",f)}catch(e){}c=!1}};try{e.addEventListener("updatefound",l),s=!0,t.addEventListener("controllerchange",f),c=!0,e.waiting&&t.controller&&u(e.waiting),e.installing&&l()}catch(e){throw r=!0,d(),o=null,i=null,e}return{activateWaiting(e={type:"SKIP_WAITING"}){if(r||!i)return!1;try{return i.postMessage(e),!0}catch(e){return!1}},dispose(){r||(r=!0,d(),o=null,i=null)}}}function pr(e){if("string"!=typeof e||""===e.trim())throw new TypeError("storageKey must be a non-empty string.")}function mr(e){if("undefined"==typeof window)return null;try{return new URL(window.location.href).searchParams.get(e)}catch(e){return null}}function gr(e){if("undefined"==typeof window)return null;try{const t=window.localStorage;return t&&"function"==typeof t.getItem?t.getItem(e):null}catch(e){return null}}function hr(e,t){if("undefined"==typeof window)return!1;try{const n=window.localStorage;return!(!n||"function"!=typeof n.setItem)&&(n.setItem(e,t),!0)}catch(e){return!1}}const wr=Object.freeze({system:"System",light:"Light",dark:"Dark"});function yr(e){return"light"===e||"dark"===e}function br(){if("undefined"==typeof window)return null;try{const e=window.matchMedia;return"function"!=typeof e?null:e.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return null}}function vr(e,t){return{value:e,label:wr[t]}}function Er(e){pr(e);const t=mr("theme");if(yr(t))return hr(e,t),vr(t,t);const n=gr(e);if(yr(n))return vr(n,n);const r=br();return"system"===n&&r||r?vr(r,"system"):vr("light","light")}function Tr(e,t){if(pr(e),!function(e){return"system"===e||yr(e)}(t))throw new TypeError('value must be "system", "light", or "dark".');return hr(e,t)}function Ar(e){const t=e.split("-");if(!/^[a-z]{2,8}$/i.test(t[0]))return null;const n=[t[0].toLowerCase()];let r=1;if(r<t.length&&/^[a-z]{4}$/i.test(t[r])){const e=t[r].toLowerCase();n.push(`${e[0].toUpperCase()}${e.slice(1)}`),r++}for(r<t.length&&(/^[a-z]{2}$/i.test(t[r])||/^\d{3}$/.test(t[r]))&&(n.push(/^[a-z]{2}$/i.test(t[r])?t[r].toUpperCase():t[r]),r++);r<t.length;r++){const e=t[r];if(!/^(?:[a-z0-9]{5,8}|\d[a-z0-9]{3})$/i.test(e))return null;n.push(e.toLowerCase())}return n.join("-")}function Sr(e){if("string"!=typeof e)return null;const t=e.trim().replace(/_/g,"-");if(!t)return null;if("undefined"!=typeof Intl)try{const e=Intl,n=e.getCanonicalLocales;if("function"==typeof n){const r=n.call(e,t)[0];return"string"==typeof r&&r?r:null}}catch(e){return e instanceof RangeError||"object"==typeof e&&null!==e&&"name"in e&&"RangeError"===e.name?null:Ar(t)}return Ar(t)}function $r(e){if("undefined"==typeof Intl)return e;try{const t=Intl.DisplayNames;if("function"!=typeof t)return e;const n=new t([e],{type:"language"}).of(e);return"string"==typeof n&&n.trim()?n:e}catch(t){return e}}function _r(e){return{value:e,label:$r(e)}}function Nr(e){pr(e);const t=Sr(mr("lang"));if(t)return _r(t);const n=Sr(gr(e));if(n)return _r(n);return _r(Sr(function(){if("undefined"==typeof window||"undefined"==typeof navigator)return null;try{return"string"==typeof navigator.language?navigator.language:null}catch(e){return null}}())??"en")}function Or(e,t){pr(e);const n=Sr(t);if(!n)throw new TypeError("language must be a valid language tag.");return hr(e,n)}export{Mt as addClass,nn as addEvent,Ft as addStyle,I as assignDefined,D as calLongestCommonSubsequence,C as calLongestCommonSubstring,O as calculateAspectRatio,x as calculateCAGR,V as camelCase2Underscore,W as camelCaseToKebabCase,en as cancelBubble,Se as clearHTML,$e as clearHtml,qe as convert10To26,q as convertCamelToKebab,Z as convertCamelToUnder,Tt as convertHttpToHttps,Y as convertKebabToCamel,Et as convertObjectToQuery,ve as convertToHtmlBreaks,H as convertUnderToCamel,Me as cutCHSString,je as cutZHString,ce as debounce,z as deepCopy,B as deepCopyObject,U as deepFreeze,Sn as delCookie,Ke as derivePackageMetadata,or as detectVisitorType,le as doFn,_e as escapeHtmlAttribute,Xt as extractElementText,rn as fireEvent,ie as floatFixed,oe as floatToPercent,Le as formatByteSize,_ as formatDate,$ as formatDistanceToNow,w as formatDurationFromMs,a as formatLocalDateTime,ur as genBrowserAttrs,Ot as genCustomConsole,ze as genHashCode,ee as genRndNumString,zt as genStyleString,ne as genUniqueNumString,N as generateCalendarVersion,te as generateRndNum,re as generateUniqueNum,ut as getAllQueryParams,cr as getBrowserInfo,Rn as getCLS,En as getCookie,Ye as getCurrentVersion,m as getDateDifference,tn as getDefineListeners,dt as getDomain,Dn as getFCP,Ln as getFID,kn as getFP,Re as getFileSize,g as getFriendlyInterval,ft as getHashQueryParam,Fn as getLCP,ln as getLocalJSON,mn as getLocalStorage,Pt as getPageMeta,Pn as getPerformance,ct as getQueryParam,vt as getScriptQueryParam,un as getSessionJSON,dn as getSessionStorage,br as getSystemTheme,zn as getTTFB,bt as getUrlFileType,St as getUrlHost,at as getUrlParam,$t as getUrlPath,Ct as hasClass,Gt as hide,F as inRate,on as invokeEvent,ae as invokeFn,Xn as isAndroid,ye as isArray,ge as isBool,he as isBoolean,Je as isBrowser,Gn as isDesktop,pe as isFunction,k as isHit,Kn as isIOS,Q as isJSONString,K as isJsonString,nr as isLinux,er as isMacOS,Ie as isMobile,fe as isNonEmptyArray,be as isNonEmptyObject,ue as isNumber,Jn as isPhone,de as isPureObject,ir as isSafePWAEnv,sr as isStandalonePWA,me as isString,lr as isSupportWebp,Mn as isSupportedEntryType,Qn as isTablet,A as isThisHour,E as isThisMonth,T as isThisWeek,v as isThisYear,b as isToday,we as isUdfOrNul,Ut as isValidCssSelector,ke as isValidData,y as isValidDate,Be as isValidEmail,yt as isValidHttpUrl,Ue as isValidPhoneNumber,pt as isValidUrl,tr as isWindows,fr as listenMediaQueryChanges,$n as loadCSS,xn as loadImage,Nn as loadScript,jn as loadScriptIfUndefined,M as longestComSubsequence,j as longestComSubstring,f as mNow,G as mTrim,xt as mazeyCon,Ee as newLine,_t as onURLChange,st as parseGitHubRepository,X as parseJsonSafe,u as parseLocalDateTime,kt as removeClass,An as removeCookie,sn as removeEvent,Te as removeHTML,Ae as removeHtml,We as repeatUntilConditionMet,At as replaceHttp,Kt as resolveElementTarget,Nr as resolveLanguagePreference,Er as resolveThemePreference,Ne as sanitizeInput,Dt as setClass,Tn as setCookie,Lt as setImgSizeBySrc,Rt as setImgWidHeiBySrc,Or as setLanguagePreference,an as setLocalJSON,pn as setLocalStorage,cn as setSessionJSON,fn as setSessionStorage,Tr as setThemePreference,Pe as sha256Hex,Qt as show,He as sleep,l as subYears,se as throttle,jt as timeCon,J as toJavaScriptGlobalName,Ce as truncateZHString,xe as unsanitize,Oe as unsanitizeInput,lt as updateQueryParam,Ze as waitTime,dr as watchServiceWorkerUpdates,On as windowLoaded,De as zAxiosIsValidRes};
|
package/lib/mazey.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Mazey v5.7.
|
|
2
|
+
* Mazey v5.7.3 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";function t(e){try{return Date.prototype.getTime.call(e)}catch(e){return null}}const n=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/,r=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;function o(e,t,n,r,o,i,s=0,a=!1){const c=new Date(0);return a?(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getUTCFullYear()===e&&c.getUTCMonth()===t-1&&c.getUTCDate()===n&&c.getUTCHours()===r&&c.getUTCMinutes()===o&&c.getUTCSeconds()===i&&c.getUTCMilliseconds()===s):(c.setFullYear(e,t-1,n),c.setHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getFullYear()===e&&c.getMonth()===t-1&&c.getDate()===n&&c.getHours()===r&&c.getMinutes()===o&&c.getSeconds()===i&&c.getMilliseconds()===s)}function i(e,t,n,r,o,i,s=0){const a=new Date(0);return a.setFullYear(e,t-1,n),a.setHours(r,o,i,s),a}function s(e){if("number"==typeof e){const t=new Date(e);return Number.isFinite(e)&&Number.isFinite(t.getTime())?t:null}if("object"==typeof e&&null!==e){const n=t(e);return null!==n&&Number.isFinite(n)?new Date(n):null}if("string"!=typeof e)return null;const s=e.trim();if(!s)return null;const a=n.exec(s);if(a){const[e,t,n,r="0",s="0",c="0"]=a.slice(1),[u,l,f,d,p,m]=[e,t,n,r,s,c].map(Number);return o(u,l,f,d,p,m)?i(u,l,f,d,p,m):null}const c=r.exec(s);if(!c)return null;const[u,l,f,d,p,m="0",g="",h]=c.slice(1),y=Number(`${g}00`.slice(0,3));if(!o(Number(u),Number(l),Number(f),Number(d),Number(p),Number(m),y,!0))return null;if("Z"!==h){const e=Number(h.slice(1,3)),t=Number(h.slice(4,6));if(e>23||t>59)return null}return function(e,t,n,r,o,i,s,a){const c=new Date(0);if(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),"Z"===a)return c;const u="+"===a[0]?1:-1,l=60*Number(a.slice(1,3))+Number(a.slice(4,6));return new Date(c.getTime()-u*l*60*1e3)}(Number(u),Number(l),Number(f),Number(d),Number(p),Number(m),y,h)}const a=/^(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function c(e,t){const n=String(e);return n.length>=t?n:`${"0".repeat(t-n.length)}${n}`}function u(){return Date.now()}const l={type:"d"};function f(e){return"string"==typeof e&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T"):e}function d(e=0,t=0,n=l){n=Object.assign({},l,n);const{type:r}=n;"number"==typeof e&&Number.isFinite(e)||(e=new Date(f(e)).getTime()),"number"==typeof t&&Number.isFinite(t)||(t=new Date(f(t)).getTime());const o=Number(t)-Number(e);let i="",[s,a,c,u]=new Array(4).fill(0);if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60),c=Math.floor(o/1e3/60),u=Math.floor(o/1e3),r){case"d":i=s;break;case"text":s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60%24),c=Math.floor(o/1e3/60%60),u=Math.floor(o/1e3%60),i=[{value:s,unit:"day"},{value:a,unit:"hour"},{value:c,unit:"minute"},{value:u,unit:"second"}].filter(({value:e})=>e>0).map(({value:e,unit:t})=>p(e,t)).join(" ")||p(0,"second");break;default:i=u}return i}function p(e,t){const n=Math.round(10*e)/10;return`${n} ${1===n?t:`${t}s`}`}function m(e,t){const n=Math.max(1,Math.round(e));return`about ${n} ${t}${1===n?"":"s"}`}function g(e,t="yyyy-MM-dd"){void 0===e&&(e=new Date);const n=new Date(e);if(!Number.isFinite(n.getTime()))throw new RangeError("Invalid date");const 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"};let i=t||"yyyy-MM-dd";return Object.keys(o).forEach(e=>{let t=o[e];"MM"===e&&Number(t)<=9&&(t=`0${t}`),i=i.split(e).join(String(t))}),i}function h(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));let i=0;for(let s=0;s<n;++s)for(let n=0;n<r;++n)if(e[s]===t[n]){let e=0;s>0&&n>0&&(e=o[s-1][n-1]),o[s][n]=e+1,i=Math.max(i,o[s][n])}return i}function y(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));for(let i=0;i<n;++i)for(let n=0;n<r;++n)if(e[i]===t[n]){let e=0;i>0&&n>0&&(e=o[i-1][n-1]),o[i][n]=e+1}else{let[e,t]=[0,0];n>0&&(e=o[i][n-1]),i>0&&(t=o[i-1][n]),o[i][n]=Math.max(e,t)}return o[n-1][r-1]}function w(e){return Math.random()<e}const b=Function.prototype.toString.call(Object);function v(e,t,n){const r=Object.getOwnPropertyDescriptor(t,n)?.get;if(!r)return!1;try{return r.call(e),!0}catch(e){return!1}}function E(e){return null===e||"object"!=typeof e?e:T(e,new WeakMap)}function T(e,n){if(null===e||"object"!=typeof e)return e;const r=e,o=n.get(r);if(void 0!==o)return o;const i=t(r);if(null!==i){const e=new Date(i);return n.set(r,e),e}const s=function(e){const t=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get;if(!t)return null;try{return t.call(e)}catch(e){return null}}(r);if(null!==s){const t=e,o=new RegExp(s,function(e){return e.flags}(t));return o.lastIndex=t.lastIndex,n.set(r,o),o}if("undefined"!=typeof ArrayBuffer&&v(r,ArrayBuffer.prototype,"byteLength")){const t=ArrayBuffer.prototype.slice.call(e,0);return n.set(r,t),t}if("undefined"!=typeof SharedArrayBuffer&&v(r,SharedArrayBuffer.prototype,"byteLength")){const t=SharedArrayBuffer.prototype.slice.call(e,0);return n.set(r,t),t}if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)){const t=T(e.buffer,n),o="undefined"!=typeof DataView&&v(r,DataView.prototype,"byteLength")?new DataView(t,e.byteOffset,e.byteLength):new e.constructor(t,e.byteOffset,e.length);return n.set(r,o),o}if("undefined"!=typeof Map&&v(r,Map.prototype,"size")){const t=new Map;return n.set(r,t),Map.prototype.forEach.call(e,(e,r)=>{t.set(T(r,n),T(e,n))}),t}if("undefined"!=typeof Set&&v(r,Set.prototype,"size")){const t=new Set;return n.set(r,t),Set.prototype.forEach.call(e,e=>{t.add(T(e,n))}),t}const a=Array.isArray(e),c=Object.getPrototypeOf(e),u=function(e){const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.hasOwn(t,"constructor")?t.constructor:null;return"function"==typeof n&&Function.prototype.toString.call(n)===b}(r),l=!a&&!u&&function(e){const t=Object.getPrototypeOf(e),n=t?.constructor;return"function"==typeof n&&-1===Function.prototype.toString.call(n).indexOf("[native code]")}(r);if(!a&&!u&&!l)return n.set(r,e),e;const f=a?new Array(e.length):Object.create(l?Object.prototype:c);return n.set(r,f),function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}(r).forEach(e=>{if(a&&"length"===e)return;const t=Object.getOwnPropertyDescriptor(r,e);t&&("value"in t&&(t.value=T(t.value,n)),Object.defineProperty(f,e,t))}),f}function S(e){const t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function A(e){const t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function C(e){return A(e)}function N(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.replace(/[^A-Za-z0-9_$]/g,"_").toUpperCase();return/^[A-Za-z_$]/.test(t)?t:`_${t}`}function $(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){}return!1}function O(e=5){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e--;)t+=Math.floor(10*Math.random());return t}function x(e=5){return O(e)}function _(e=3){const[t,n]=[u(),x(e||3)];return t+n}function M(e,t={}){const{isNaNAsNumber:n=!1,isInfinityAsNumber:r=!1,isUnFiniteAsNumber:o=!1}=t;return"number"==typeof e&&(!(!0!==r&&!0!==o&&!isFinite(e))&&!(!n&&isNaN(e)))}function j(e,...t){let n=null;return e&&"function"==typeof e&&(n=e(...t)),n}function D(e,...t){return j(e,...t)}function L(e){let t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function k(e){const t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function P(e){return"boolean"==typeof e}function F(e){if(!e)return"";const t=new RegExp("\\n","g");return e.replace(t,"<br />")}function U(e,t={}){const{removeNewLine:n=!1}=t;let r="";return e&&(r=e.replace(/<\/?.+?>/g,""),n&&(r=r.replace(/[\r\n]/g,""))),r}function R(e){const t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,e=>t[e])}function z(e,t,n={hasDot:!1,dotText:"..."}){if(n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){let r=0,o="";const i=/[^\x00-\xff]/g;let s="";const a=e.replace(i,"**").length;for(let n=0;n<a&&(s=e.charAt(n).toString(),null!=s.match(i)?r+=2:r++,!(r>t));n++)o+=s;return n.hasDot&&a>t&&(o+=n.dotText),o}return""}function I(e,t,n=!1){return z(e,t,{hasDot:n})}const B=["B","KB","MB","GB","TB"];function H(e,t={}){const{base:n=1024,fractionDigits:r=1,invalidValue:o=""}=t;if(!Number.isFinite(e)||e<0||1e3!==n&&1024!==n||!Number.isInteger(r)||r<0||r>20)return o;let i=e,s=0;for(;i>=n&&s<B.length-1;)i/=n,s+=1;return 0===s?`${Number(i.toFixed(r))} ${B[s]}`:`${i.toFixed(r)} ${B[s]}`}function q(e){return/^1\d{10}$/.test(e)}const W=q;async function V(e){return new Promise(t=>{setTimeout(()=>{t(e)},e)})}let Y="";function Z(e,t){const n=e[t];if(void 0!==n&&"string"!=typeof n)throw new TypeError(`manifest.${t} must be a string when provided`);return n}function J(e){if(void 0===e)return{name:""};if("string"==typeof e)return{name:e.trim()};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest.author must be a string or object");const t=e,n={name:""};for(const e of["name","email","url"]){const r=t[e];if(void 0!==r&&"string"!=typeof r)throw new TypeError(`manifest.author.${e} must be a string when provided`);if("string"==typeof r){const t=r.trim();("name"===e||t)&&(n[e]=t)}}return n}function Q(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}}function G(e){const t=e.indexOf("#"),n=-1===t?e:e.slice(0,t),r=n.indexOf("?"),o=/^(?:[a-z][a-z\d+.-]*:)?\/\//i.test(n)||"/"===n.charAt(0),i=-1===r?o?"":n:n.slice(r+1);return i?i.split("&").reduce((e,t)=>{if(!t||-1===t.indexOf("="))return e;const n=t.indexOf("=");return e.push([Q(t.slice(0,n)),Q(t.slice(n+1))]),e},[]):[]}function K(e,t){return G(e).filter(([e])=>e===t).map(([,e])=>e)}const X=/^(?=.{1,39}$)(?!.*--)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/,ee=/^(?=.{1,100}$)(?!\.{1,2}$)[A-Za-z0-9_.-]+$/;function te(){return new Error("The value does not identify one supported GitHub repository")}function ne(e,t){const n=t.replace(/\.git$/i,"");if(!X.test(e)||!ee.test(n))throw te();const r=`${e}/${n}`;return{owner:e,name:n,slug:r,url:`https://github.com/${r}`}}function re(e){return void 0===e||Number(e)<=65535}function oe(e){const t=e.split(".");return 4===t.length&&t.every(e=>/^\d{1,3}$/.test(e)&&(1===e.length||"0"!==e.charAt(0))&&Number(e)<=255)}function ie(e){const t=e.split("::");if(t.length>2)return!1;const n=2===t.length;let r=[];t.forEach(e=>{e&&(r=r.concat(e.split(":")))});let o=0;for(let e=0;e<r.length;e++){const t=r[e];if(-1!==t.indexOf(".")){if(e!==r.length-1||!oe(t))return!1;o+=2}else{if(!/^[0-9a-f]{1,4}$/i.test(t))return!1;o+=1}}return n?o<8:8===o}function se(e){const t=e.match(/^\[([0-9a-f:.]+)\]$/i);if(t)return ie(t[1]);if("."===e.charAt(e.length-1)&&(e=e.slice(0,-1)),oe(e))return!0;const n=e.split(".");return!(n.length<2||n.some(e=>!e||!/^[a-z\d-]+$/i.test(e)||"-"===e.charAt(0)||"-"===e.charAt(e.length-1)))&&!/^\d+$/.test(n[n.length-1])}function ae(e,t={strict:!0}){if("string"!=typeof e||!e||e.trim()!==e)return!1;const n=/^https?:\/\/[^/\\]/i.test(e),r=/^\/\/[^/\\]/.test(e);if(!n&&(t.strict||!r))return!1;const o=r?`http:${e}`:e;if(!function(e){const t=e.match(/^https?:\/\/([^/?#]+)(?:[/?#][^\s<>"`]*)?$/i);if(!t||-1!==t[1].indexOf("@"))return!1;const n=t[1],r=n.match(/^\[([0-9a-f:.]+)\](?::(\d*))?$/i);if(r)return ie(r[1])&&re(r[2]);const o=n.match(/^([^:]+)(?::(\d*))?$/);return!(!o||!re(o[2]))&&se(o[1])}(o))return!1;try{const e=new URL(o);return("http:"===e.protocol||"https:"===e.protocol)&&se(e.hostname)&&!e.username&&!e.password}catch(e){return!1}}function ce(e){return e.replace(/^http:/,"https:")}const ue={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:()=>{},errorFn:()=>{}};function le(e="",t={...ue}){const{enabled:n,isClosed:r,showWrap:o,showDate:i,locales:s,isStringifyObject:a,logFn:c,errorFn:u}=Object.assign({...ue},t);let l=n;!0===r&&(fe.warn("The options.isClosed is deprecated. Please use options.enabled instead."),l=!1);const f=Object.create(null),d=()=>(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return["log","info","warn","error"].forEach(t=>{f[t]=function(...n){if(!l)return;let r=e,s=e;if("string"==typeof e&&e.length>=2){const t=e.length;r=":"===e[t-1]?e.substring(0,t-1):e}o&&console.log(`--- ${r} - begin ---`),i&&(s=e?`${d()} ${e}`:`${d()}`),a&&(n=n.map(e=>k(e)?JSON.stringify(e):e)),e||i?console[t](s,...n):console[t](...n),"log"===t&&c(),"error"===t&&u(),o&&console.log(`--- ${r} - end ---`)}}),f}const fe=le("[Mazey]"),de=le("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function pe(e,t){if(!e)return void fe.error("The element is not exist.");if(Array.isArray(t))return void t.forEach(t=>{t&&e.classList.add(t)});if(!t)return;const n=e.className,r=n.split(/\s+/);for(let e=0;e<r.length;e++)if(r[e]===t)return;let o="",i="";""!==n&&(o=" "),i=n+o+t,e.className=i}function me(){const e=window.jQuery||window.$;if(e){const t=e("img");return!(!t||!t.length)&&(t.each(function(){const t=e(this);if(!t)return;const n=t.attr("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&L(r)&&r[1]&&t.width(r[1]),o&&L(o)&&o[1]&&t.height(o[1])}),!0)}{const e=document.getElementsByTagName("img");if(e.length>0)return Array.from(e).forEach(function(e){const t=e;if(!t)return;const n=t.getAttribute("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&L(r)&&r[1]&&(t.style.width=r[1]),o&&L(o)&&o[1]&&(t.style.height=o[1])}),!0}return!1}function ge(e,t={}){if("string"!=typeof e)return!1;const n=e.trim();if(!n)return!0===t.allowEmpty;const r=t.root||("undefined"==typeof document?null:document);if(!r)return!1;try{return r.querySelector(n),!0}catch(e){return!1}}function he(e){return Boolean(e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}const ye=new WeakMap,we=new WeakMap,be={button:"inline-block",input:"inline-block",select:"inline-block",textarea:"inline-block",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",li:"list-item",summary:"list-item"},ve=new Set(["address","article","aside","blockquote","body","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","main","nav","ol","p","pre","section","ul"]);function Ee(e){if(!he(e))return null;const t=e.style;return t&&"string"==typeof t.display?e:null}function Te(e){const t=new Set,n=e=>{const n=Ee(e);n&&t.add(n)};if("string"==typeof e){if("undefined"==typeof document)return[];try{document.querySelectorAll(e).forEach(n)}catch(e){return[]}return Array.from(t)}const r=Ee(e);if(r)return[r];if(!e||"object"!=typeof e)return[];if("function"==typeof e[Symbol.iterator]){for(const t of e)n(t);return Array.from(t)}const o=e.length;if(!Number.isSafeInteger(o)||o<0)return[];for(let t=0;t<o;t+=1)n(e[t]);return Array.from(t)}function Se(e){const t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).display:null}function Ae(e){const t=e.ownerDocument,n=e.localName.toLowerCase();let r=we.get(t);r||(r=new Map,we.set(t,r));const o=e.namespaceURI||"",i=`${o}:${n}`,s=r.get(i);if(s)return s;let a="";const c="http://www.w3.org/1999/xhtml"===o&&n.includes("-"),u=t.body||t.documentElement;if(u&&!c){const e=o&&"http://www.w3.org/1999/xhtml"!==o?t.createElementNS(o,n):t.createElement(n);u.appendChild(e);try{a=Se(e)||""}finally{u.removeChild(e)}}return a&&"none"!==a||(a=function(e){return be[e]?be[e]:ve.has(e)?"block":"inline"}(n)),r.set(i,a),a}function Ce(){const e=window.MAZEY_DEFINE_LISTENERS;if(e&&"object"==typeof e)return e;const t=Object.create(null);return window.MAZEY_DEFINE_LISTENERS=t,t}function Ne(e,t){const n=Ce()[e];if(Array.isArray(n)){const e=n.slice();for(let n=0,r=e.length;n<r;n++)"function"==typeof e[n]&&(void 0===t?e[n]():e[n](t))}}function $e(e,t=null){if(e){const n=JSON.stringify(t);sessionStorage.setItem(e,void 0===n?"null":n)}}function Oe(e){let t=null;if(e){const n=sessionStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}function xe(e,t=null){if(e){const n=JSON.stringify(t);localStorage.setItem(e,void 0===n?"null":n)}}function _e(e){let t=null;if(e){const n=localStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}const Me=$e,je=Oe,De=xe,Le=_e,ke="__mazey_cookie_name_encoded__-",Pe="__mazey_cookie_value_encoded__-";function Fe(e){return`${Pe}${encodeURIComponent(e)}`}function Ue(e){const t=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(e),n=0===e.indexOf(ke)||0===e.indexOf(Pe);return t&&!n?e:function(e){return`${ke}${encodeURIComponent(e)}`}(e)}function Re(e){const t=Ue(e);return t!==e?[t,e]:[e]}function ze(e){const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){const r=n[e].trim();if(0===r.indexOf(t))return r.substring(t.length)}}function Ie(e){const t=Re(e),n="1"===ze(Fe(e));for(let e=0;e<t.length;e++){const r=ze(t[e]);if(void 0!==r){if(n)try{return decodeURIComponent(r)}catch(e){return r}return r}}return""}function Be(e){const t=Re(e),n=t.concat(Fe(e)),r=new Date;r.setTime(r.getTime()-1);const o=t.some(e=>void 0!==ze(e));return n.forEach((e,t)=>{if(n.indexOf(e)===t&&void 0!==ze(e)){[`${e}=; expires=${r.toUTCString()}`,`${e}=; expires=${r.toUTCString()}; path=/`].forEach(e=>{document.cookie=e;const t=location.hostname;if(-1!==t.indexOf(".")){const n=t.split(".");for(let t=0;t<n.length;t++)document.cookie=`${e}; domain=.${n.slice(t).join(".")}`}})}}),o&&n.every(e=>void 0===ze(e))}function He(e,t={id:""}){const{id:n}=t;return new Promise((t,r)=>{const o=document.createElement("link");let i=!1;const s=()=>{o.onload=null,o.onerror=null};o.rel="stylesheet",o.type="text/css",o.href=e,void 0!==n&&(o.id=n),o.onload=()=>{i||(i=!0,s(),t("loaded"))},o.onerror=()=>{i||(i=!0,s(),r(new Error(`Failed to load CSS: ${e}`)))},document.head.appendChild(o)})}const qe={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function We(e,t={...qe}){const{id:n,callback:r,timeout:o,isDefer:i,isAsync:s,isCrossOrigin:a,attributes:c,cssUrl:u}=Object.assign({...qe},t);if(u){const t=function(e,t){if(!t)return"";if(ae(t))return t;try{const n=new URL(e,location.href);return new URL(t,n).href}catch(n){const r=e.split("/");return r.pop(),`${r.join("/")}/${t}`}}(e,u);t&&He(t).catch(e=>{console.error(`Failed to load CSS from ${t}: ${e?.message}`)})}return new Promise((t,u)=>{const l=document.createElement("script");let f=!1,d=null;const p=()=>{l.onload=null,l.onerror=null,null!==d&&(clearTimeout(d),d=null)},m=e=>{f||(f=!0,p(),u(e))};l.type="text/javascript",l.defer=Boolean(i),l.async=Boolean(s),a&&(l.crossOrigin="anonymous"),n&&(l.id=n),c&&Object.keys(c).forEach(e=>{l.setAttribute(e,c[e])}),l.onload=()=>{if(!f){f=!0,p();try{D(r),t("loaded")}catch(e){u(e)}}},l.onerror=()=>m(new Error(`Failed to load script: ${e}`)),l.src=e,o&&(d=setTimeout(()=>m(new Error("timeout")),o));const g=document.getElementsByTagName("script")[0];if(g?.parentNode)g.parentNode.insertBefore(l,g);else{(document.head||document.body||document.documentElement).appendChild(l)}})}const Ve=new Map;function Ye(e){if("undefined"==typeof window)return!1;let t=[];const n=window.PerformanceObserver;return!!n&&(L(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}async function Ze(){return Ye("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-contentful-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function Je(){return Ye("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}function Qe(e,t=e.userAgent.trim().toLowerCase()){return/\bmacintosh\b/.test(t)&&"macintel"===e.platform.toLowerCase()&&e.maxTouchPoints>1}const Ge=Object.freeze(["adsbot-google","ahrefsbot","amazonbot","applebot","baiduspider","bingbot","bingpreview","bytespider","ccbot","chatgpt-user","claudebot","discordbot","dotbot","duckduckbot","facebookexternalhit","facebot","google-inspectiontool","googlebot","googleother","gptbot","linkedinbot","mediapartners-google","mj12bot","perplexitybot","petalbot","semrushbot","slackbot","slurp","storebot-google","telegrambot","twitterbot","whatsapp","yandexbot"]),Ke=Object.freeze(["headlesschrome","phantomjs","slimerjs","selenium","puppeteer","playwright"]);function Xe(){try{return"undefined"==typeof navigator?null:navigator}catch(e){return null}}function et(){const e=Xe();if(!e)return{userAgent:"",platform:"",maxTouchPoints:0};let t="",n="",r=0;try{const n=e.userAgent;t="string"==typeof n?n:""}catch(e){return{userAgent:"",platform:"",maxTouchPoints:0}}try{const t=e.platform;n="string"==typeof t?t:""}catch(e){n=""}try{const t=e.maxTouchPoints;r=Number.isFinite(t)?t:0}catch(e){r=0}return{userAgent:t,platform:n,maxTouchPoints:r}}function tt(e){const t=e.userAgent.trim().toLowerCase();return t?/\bandroid\b|\badr\b/.test(t)?"android":/\bios\b|\biphone\b|\bipad\b|\bipod\b|\biwatch\b/.test(t)||Qe(e,t)?"ios":/\bwindows\b|\bwin32\b|\bwin64\b|\bwow32\b|\bwow64\b/.test(t)?"windows":/\bmacintosh\b|\bmacintel\b|\bmac os x\b/.test(t)?"macos":/\blinux\b/.test(t)?"linux":"":""}function nt(e){const t=e.userAgent.trim().toLowerCase();if(!t)return"";if(/\biwatch\b|\bapple watch\b/.test(t))return"";if(/\bipad\b|\btablet\b/.test(t)||Qe(e,t))return"tablet";const n=tt(e);return"android"===n?/\bmobile\b/.test(t)?"mobile":"tablet":"ios"===n&&/\biphone\b|\bipod\b/.test(t)?"mobile":"windows"===n||"macos"===n||"linux"===n||/\bcros\b/.test(t)?"desktop":/\bmobile\b/.test(t)?"mobile":""}function rt(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return nt(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:et())}function ot(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return tt(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:et())}function it(e,t){const n=e.trim().toLowerCase();return t.some(e=>n.includes(e))}function st(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;let e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{const t=et(),n=t.userAgent.toLowerCase();if(!n)return e;const r=e=>e.test(n),o=e=>{let t="";const r=n.match(e);return r&&L(r)&&(t=r.toString(),t=t.replace(/[^0-9|_.]/g,""),t=t.replace(/_/g,".")),t},i=tt(t);let s="";"ios"===i&&(r(/ipad/g)?s="ipad":r(/iphone/g)?s="iphone":r(/iwatch/g)?s="iwatch":r(/ipod/g)?s="ipod":"macintel"===t.platform.toLowerCase()&&t.maxTouchPoints>1&&(s="ipad")),e={...e,system:i,appleType:s};let a="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?a="2000":r(/windows nt 5.1|windows xp/g)?a="xp":r(/windows nt 5.2|windows 2003/g)?a="2003":r(/windows nt 6.0|windows vista/g)?a="vista":r(/windows nt 6.1|windows 7/g)?a="7":r(/windows nt 6.2|windows 8/g)?a="8":r(/windows nt 6.3|windows 8.1/g)?a="8.1":r(/windows nt 10.0|windows 10/g)&&(a="10"):"macos"===i?a=o(/os x [\d._]+/g):"android"===i?a=o(/android [\d._]+/g):"ios"===i&&(a=o(/os [\d._]+/g)),e={...e,systemVs:a};let c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),e={...e,platform:c};let u="",l="";r(/applewebkit/g)?(u="webkit",r(/edg(?:a|ios)?\//g)||r(/edge\//g)?l="edge":r(/opr/g)?l="opera":r(/chrome/g)?l="chrome":r(/safari/g)&&(l="safari")):r(/gecko/g)&&r(/firefox/g)?(u="gecko",l="firefox"):r(/presto/g)?(u="presto",l="opera"):r(/trident|compatible|msie/g)&&(u="trident",l="iexplore"),e={...e,engine:u,supporter:l};let f="";"webkit"===u?f=o(/applewebkit\/[\d._]+/g):"gecko"===u?f=o(/gecko\/[\d._]+/g):"presto"===u?f=o(/presto\/[\d._]+/g):"trident"===u&&(f=o(/trident\/[\d._]+/g)),e={...e,engineVs:f};let d="";"chrome"===l?d=o(/chrome\/[\d._]+/g):"safari"===l?d=o(/version\/[\d._]+/g):"firefox"===l?d=o(/firefox\/[\d._]+/g):"opera"===l?d=o(/opr\/[\d._]+/g):"iexplore"===l?d=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(d=o(/(?:edge|edg|edga|edgios)\/[\d._]+/g)),e={...e,supporterVs:d};let p="",m="";r(/micromessenger/g)?(p="wechat",m=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",m=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",m=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",m=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",m=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),e={...e,shell:p,shellVs:m};let g="";if(window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");e.matches?g="dark":t.matches&&(g="light")}return e={...e,colorScheme:g},window.MAZEY_BROWSER_INFO=e,e}catch(t){return fe.warn(t),e}}let at="";function ct(e){if("string"!=typeof e||""===e.trim())throw new TypeError("storageKey must be a non-empty string.")}function ut(e){if("undefined"==typeof window)return null;try{return new URL(window.location.href).searchParams.get(e)}catch(e){return null}}function lt(e){if("undefined"==typeof window)return null;try{const t=window.localStorage;return t&&"function"==typeof t.getItem?t.getItem(e):null}catch(e){return null}}function ft(e,t){if("undefined"==typeof window)return!1;try{const n=window.localStorage;return!(!n||"function"!=typeof n.setItem)&&(n.setItem(e,t),!0)}catch(e){return!1}}const dt=Object.freeze({system:"System",light:"Light",dark:"Dark"});function pt(e){return"light"===e||"dark"===e}function mt(){if("undefined"==typeof window)return null;try{const e=window.matchMedia;return"function"!=typeof e?null:e.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return null}}function gt(e,t){return{value:e,label:dt[t]}}function ht(e){const t=e.split("-");if(!/^[a-z]{2,8}$/i.test(t[0]))return null;const n=[t[0].toLowerCase()];let r=1;if(r<t.length&&/^[a-z]{4}$/i.test(t[r])){const e=t[r].toLowerCase();n.push(`${e[0].toUpperCase()}${e.slice(1)}`),r++}for(r<t.length&&(/^[a-z]{2}$/i.test(t[r])||/^\d{3}$/.test(t[r]))&&(n.push(/^[a-z]{2}$/i.test(t[r])?t[r].toUpperCase():t[r]),r++);r<t.length;r++){const e=t[r];if(!/^(?:[a-z0-9]{5,8}|\d[a-z0-9]{3})$/i.test(e))return null;n.push(e.toLowerCase())}return n.join("-")}function yt(e){if("string"!=typeof e)return null;const t=e.trim().replace(/_/g,"-");if(!t)return null;if("undefined"!=typeof Intl)try{const e=Intl,n=e.getCanonicalLocales;if("function"==typeof n){const r=n.call(e,t)[0];return"string"==typeof r&&r?r:null}}catch(e){return e instanceof RangeError||"object"==typeof e&&null!==e&&"name"in e&&"RangeError"===e.name?null:ht(t)}return ht(t)}function wt(e){if("undefined"==typeof Intl)return e;try{const t=Intl.DisplayNames;if("function"!=typeof t)return e;const n=new t([e],{type:"language"}).of(e);return"string"==typeof n&&n.trim()?n:e}catch(t){return e}}function bt(e){return{value:e,label:wt(e)}}return e.addClass=pe,e.addEvent=function(e,t){const n=Ce();Array.isArray(n[e])||Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:[],writable:!0}),"function"==typeof t&&n[e].push(t)},e.addStyle=function(e,t={id:""}){if(!e)return!1;const n=document.createDocumentFragment();let r=null,o="";const i=document.createElement("style");return t.id?(o=`${t.id}`,r=document.getElementById(o),r?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.assignDefined=function(e,...t){return t.forEach(t=>{void 0!==t&&Object.keys(t).forEach(n=>{const r=t[n];if(void 0!==r){const t=e;"__proto__"!==n||Object.hasOwn(e,n)?t[n]=r:Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0})}})}),e},e.calLongestCommonSubsequence=function(e,t){return y(e,t)},e.calLongestCommonSubstring=function(e,t){return h(e,t)},e.calculateCAGR=function(e,t,n){const r=s(e);if(!r)throw new TypeError("startDate must be a valid date.");const o=s(t);if(!o)throw new TypeError("endDate must be a valid date.");const i=o.getTime()-r.getTime();if(i<=0)throw new RangeError("endDate must be later than startDate.");const a=function(e){if("number"==typeof e){if(!Number.isFinite(e))throw new TypeError("totalReturnRate must be a finite number or percentage string.");return e}if("string"!=typeof e)throw new TypeError("totalReturnRate must be a finite number or percentage string.");const t=e.trim();if(!t)throw new TypeError("totalReturnRate must not be empty.");const n=t.endsWith("%")?t.slice(0,-1).trim():t;if(!n)throw new TypeError("totalReturnRate must be a valid percentage string.");const r=Number(n);if(!Number.isFinite(r))throw new TypeError("totalReturnRate must be a valid percentage string.");return r/100}(n);if(a<=-1)throw new RangeError("totalReturnRate must be greater than -1.");const c=i/864e5,u=Math.pow(1+a,365/c)-1;if(!Number.isFinite(u))throw new RangeError("calculated CAGR must be finite.");return u},e.camelCase2Underscore=C,e.camelCaseToKebabCase=function(e){return S(e)},e.cancelBubble=function(e){e.stopPropagation()},e.clearHTML=function(e,t={}){return U(e,t)},e.clearHtml=function(e,t={}){return U(e,t)},e.convert10To26=function(e){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e>0;){let n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t},e.convertCamelToKebab=S,e.convertCamelToUnder=A,e.convertHttpToHttps=ce,e.convertKebabToCamel=function(e){const t=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return t.endsWith("-")?t.slice(0,-1):t},e.convertObjectToQuery=function(e){return e&&0===Object.keys(e).length?"":`?${Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}`},e.convertToHtmlBreaks=F,e.convertUnderToCamel=function(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())},e.cutCHSString=function(e,t,n=!1){return I(e,t,n)},e.cutZHString=z,e.debounce=function(e,t,n){let r=null,o=null,i=null,s=null,a=null;const c=function(){const l=u()-i;l<t&&l>=0?o=setTimeout(c,t-l):(o=null,n||(a=e.apply(r,s),o||(r=s=null)))};return function(...l){r=this,s=l,i=u();const f=n&&!o;return o||(o=setTimeout(c,t)),f&&(a=e.apply(r,s),r=s=null),a}},e.deepCopy=E,e.deepCopyObject=function(e){return E(e)},e.deepFreeze=function e(t){return!t||"object"!=typeof t||Object.isFrozen(t)||(Object.freeze(t),Object.values(t).forEach(e)),t},e.delCookie=function(e){Be(e)},e.derivePackageMetadata=function(e,t={}){if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest must be an object");if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("options must be an object when provided");const n=e;if("string"!=typeof n.name||!n.name.trim())throw new TypeError("manifest.name must be a non-empty string");const r=n.name.trim(),o=function(e){if(/\s/.test(e))throw new TypeError("manifest.name must not contain whitespace");if(e.startsWith("@")){const t=e.split("/");if(2!==t.length||t[0].length<2||!t[1])throw new TypeError("manifest.name must be a valid scoped package name");return t[1]}if(e.includes("/"))throw new TypeError("manifest.name must be an unscoped or scoped package name");return e}(r),i=t.packageManager??"npm";if("npm"!==i&&"pnpm"!==i&&"yarn"!==i)throw new TypeError('packageManager must be "npm", "pnpm", or "yarn"');const s="npm"===i?"npm install":`${i} add`;return{name:r,version:Z(n,"version"),description:Z(n,"description"),license:Z(n,"license"),author:J(n.author),unscopedName:o,iifeGlobal:N(o),installCommand:`${s} ${r}`}},e.detectVisitorType=function(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");const t=void 0===e?function(){const e=Xe();if(!e)return"";try{const t=e.userAgent;return"string"==typeof t?t:""}catch(e){return""}}():e;return it(t,Ge)?"crawler":it(t,Ke)||function(){const e=Xe();if(!e)return!1;try{return!0===e.webdriver}catch(e){return!1}}()?"automation":"unknown"},e.doFn=D,e.escapeHtmlAttribute=function(e,t={}){if("string"!=typeof e)throw new TypeError("value must be a string.");const n=t.preserveEntities?/&(?!(?:#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]+);)/gi:/&/g,r={"<":"<",">":">",'"':""","'":"'"};return e.replace(n,"&").replace(/[<>"']/g,e=>r[e])},e.extractElementText=function(e,t={}){const{excludeSelector:n="",replaceImagesWithAlt:r=!0,normalizeWhitespace:o=!0}=t,i=e.cloneNode(!0);r&&Array.from(i.querySelectorAll("img[alt]")).forEach(e=>{const t=e.getAttribute("alt")||"";e.parentNode?.replaceChild(i.ownerDocument.createTextNode(t),e)});const s=n.trim();s&&ge(s,{root:i})&&Array.from(i.querySelectorAll(s)).forEach(e=>e.parentNode?.removeChild(e));const a=i.innerText||i.textContent||"";return o?a.replace(/\u00a0/g," ").replace(/\s+/g," ").trim():a},e.fireEvent=Ne,e.floatFixed=function(e,t=0){return parseFloat(String(e)).toFixed(t)},e.floatToPercent=function(e,t=0){let n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),`${n}%`},e.formatByteSize=H,e.formatDate=g,e.formatDistanceToNow=function(e){const t=s(e);if(!t)return"";const n=6e4,r=36e5,o=864e5,i=Math.abs(t.getTime()-Date.now());return i<3e4?"less than a minute":i<9e4?"about 1 minute":i<27e5?m(i/n,"minute"):i<54e5?"about 1 hour":i<864e5?m(i/r,"hour"):i<1512e5?"about 1 day":i<30*o?m(i/o,"day"):i<45*o?"about 1 month":i<365*o?m(i/(30*o),"month"):i<545*o?"about 1 year":m(i/(365*o),"year")},e.formatDurationFromMs=function(e){const t=(Number.isFinite(e)?Math.max(e,0):0)/1e3;return t>=86400?p(t/24/60/60,"day"):t>=3600?p(t/60/60,"hour"):t>=60?p(t/60,"minute"):p(t,"second")},e.formatLocalDateTime=function(e,n={}){const r="object"==typeof e&&null!==e?t(e):null;if(null===r)throw new TypeError("date must be a Date");if(!Number.isFinite(r))throw new RangeError("Invalid date");const o=n.precision??"minute";if("minute"!==o&&"second"!==o&&"millisecond"!==o)throw new TypeError("precision must be minute, second, or millisecond");const i=new Date(r),s=i.getFullYear();if(s<1)throw new RangeError("Date year must be greater than zero");const a=[c(s,4),c(i.getMonth()+1,2),c(i.getDate(),2)].join("-"),u=[c(i.getHours(),2),c(i.getMinutes(),2)];"minute"!==o&&u.push(c(i.getSeconds(),2));let l=`${a}T${u.join(":")}`;return"millisecond"===o&&(l+=`.${c(i.getMilliseconds(),3)}`),l},e.genBrowserAttrs=function(e="",t="-"){const n=st(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(o=>{const i=n[o];if(i){let n="";e&&e.length>0&&(n=`${e}${t}`),r.push(`${n}${i}`)}}),r},e.genCustomConsole=le,e.genHashCode=function(e){let t,n,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r},e.genRndNumString=O,e.genStyleString=function(e,t){let n="";return t&&t.length>0&&(n=t.join(";")+";"),`${e}{${n}}`},e.genUniqueNumString=_,e.generateCalendarVersion=function(e){return g(void 0===e?new Date:new Date(e instanceof Date?e.getTime():e),"yyyy.MMdd.HHmmss").split(".").map(e=>String(Number(e))).join(".")},e.generateRndNum=x,e.generateUniqueNum=function(e=3){return _(e)},e.getAllQueryParams=function(e=""){""===e&&(e=location.search);const t={};return G(e).forEach(([e,n])=>{Object.hasOwn(t,e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}),t},e.getBrowserInfo=st,e.getCLS=async function(){return Ye("layout-shift")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().reduce((e,t)=>{let n=0;return M(t.value)&&(n=t.value),e+n},0);t.disconnect(),e(r)});t.observe({type:"layout-shift",buffered:!0})}):0},e.getCookie=Ie,e.getCurrentVersion=function(){return"v4"},e.getDateDifference=d,e.getDefineListeners=Ce,e.getDomain=function(e,t=["hostname"]){try{const n=new URL(e,document.baseURI);return t.reduce((e,t)=>e+=n[t],"")}catch(n){const r=document.createElement("a");return r.href=e,t.reduce((e,t)=>e+=r[t],"")}},e.getFCP=Ze,e.getFID=async function(){return Ye("first-input")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-input"===e.entryType);if(r){t.disconnect();const n=r.processingStart;e(n?Math.round(r.processingStart-r.startTime):0)}});t.observe({type:"first-input",buffered:!0})}):0},e.getFP=Je,e.getFileSize=function(e,t={}){return H(e,t)},e.getFriendlyInterval=function(e=0,t=0,n=l){return d(e,t,n)},e.getHashQueryParam=function(e){const t=location.hash.split("?");return 1===t.length?"":K(`?${t.slice(1).join("?")}`,e)[0]||""},e.getLCP=async function(){return Ye("largest-contentful-paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"largest-contentful-paint"===e.entryType);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"largest-contentful-paint",buffered:!0})}):0},e.getLocalJSON=_e,e.getLocalStorage=Le,e.getPageMeta=function(e){const t=document.getElementsByTagName("meta");for(let n=0;n<t.length;n++)if(t[n].getAttribute("name")===e)return t[n].getAttribute("content")||"";return""},e.getPerformance=async function(e=!1){if(!Ye("navigation"))return Promise.reject(new Error("navigation is not supported"));const t=window.performance;if(!t||"function"!=typeof t.getEntriesByType)return Promise.reject(new Error("performance is not supported"));let n;const r=new Promise(e=>{[n]=[e]}),o=t.getEntriesByType("navigation");if(!L(o))return Promise.reject(new Error("NavigationTiming is not supported"));const i=o[0];let[s,a,c,u,l,f,d,p,m,g,h,y,w,b,v,E,T,S,A]=new Array(19).fill(0);({decodedBodySize:S,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i);let N=0;if(M(E))N=E;else{if(!M(T))return Promise.reject(new Error("startTime, navigationStart or fetchStart are required"));N=T}const[$,O]=await Promise.all([Je(),Ze()]);function x(){({decodedBodySize:S,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i),M(E)?N=E:M(T)&&(N=T);const t={source:"PerformanceNavigationTiming",os:_(),osVersion:j(),deviceType:D(),network:k(),screenDirection:P(),unloadTime:s-a,redirectTime:c-u,dnsTime:l-f,tcpTime:d-p,sslTime:F(d,m),responseTime:g-h,downloadTime:y-g,firstPaintTime:$,firstContentfulPaintTime:O,domReadyTime:w-N,onloadTime:b-N,whiteTime:g-N,renderTime:v-N,decodedBodySize:S,encodedBodySize:A};Object.keys(t).forEach(e=>{M(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))}),M(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);const r={};e||Object.keys(t).forEach(e=>{r[C(e)]=t[e]}),Object.keys(r).length?n(r):n(t)}function _(){let e;return e=navigator.userAgent.indexOf("Android")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others",e}function j(){let e="";const t=navigator.userAgent,n=t.indexOf("Android")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;const i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function D(){let e;const 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",s=t.match(/ucweb/i)&&"ucweb",a=t.match(/android/i)&&"android",c=t.match(/windows ce/i)&&"windows ce",u=t.match(/windows mobile/i)&&"windows mobile";return e=n||r||o||i||s||a||c||u?r||o||i||s||a||c||u?"phone":n?"ipad":void 0:"pc",e||(e=""),e}function k(){let e="";const t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function P(){let e="";return window.screen&&window.screen.orientation&&"number"==typeof 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 F(e,t){let n=0;return t&&(n=e-t),n}return M(v)&&v>0?x():"complete"===document.readyState?window.setTimeout(x,0):window.addEventListener("load",function e(){window.removeEventListener("load",e),window.setTimeout(function(){x()},0)}),r},e.getQueryParam=function(e){return K(location.search,e)[0]||""},e.getScriptQueryParam=function(e,t=""){t||(t=".js");const n=document.querySelectorAll("script[src]");for(let r=0;r<n.length;r++){const o=n[r].getAttribute("src");if(o&&-1!==o.indexOf(t)){const t=K(o,e)[0];if(void 0!==t)return t}}return""},e.getSessionJSON=Oe,e.getSessionStorage=je,e.getSystemTheme=mt,e.getTTFB=async function(){if(!Ye("navigation"))return 0;if(!window.performance||!window.performance.getEntriesByType)return 0;const e=window.performance.getEntriesByType("navigation")[0];let t=0;return e?(t=e.responseStart-e.requestStart,Math.round(t)):0},e.getUrlFileType=function(e){let t="";if("string"!=typeof e||""==e)return t;const n=e.split(/[?#]/,1)[0],r=/\.[^/]+$/.exec(n);return r?(r[0].length>1&&(t=r[0].substring(1)),t):t},e.getUrlHost=function(e){!ae(e)&&ae(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).host}catch(e){return""}},e.getUrlParam=function(e,t,n={}){const r=K(e,t);return n.returnArray?r:r.length?r[0]:null},e.getUrlPath=function(e){!ae(e)&&ae(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).pathname}catch(e){return""}},e.hasClass=function(e,t){if(!e)return fe.error("The element is not exist."),!1;const n=e.className.split(/\s+/);for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1},e.hide=function(e){return Te(e).forEach(e=>{"none"!==Se(e)&&"none"!==e.style.display&&ye.set(e,e.style.display),e.style.display="none"}),e},e.inRate=function(e){return w(e)},e.invokeEvent=function(e,t){Ne(e,t)},e.invokeFn=j,e.isAndroid=function(e){return"android"===ot(e)},e.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},e.isBool=P,e.isBoolean=function(e){return P(e)},e.isBrowser=function(){if(Y)return"browser"===Y;const e="undefined"!=typeof window;return e&&(Y="browser"),e},e.isDesktop=function(e){return"desktop"===rt(e)},e.isFunction=function(e){return"function"==typeof e},e.isHit=w,e.isIOS=function(e){return"ios"===ot(e)},e.isJSONString=$,e.isJsonString=function(e){return $(e)},e.isLinux=function(e){return"linux"===ot(e)},e.isMacOS=function(e){return"macos"===ot(e)},e.isMobile=W,e.isNonEmptyArray=L,e.isNonEmptyObject=function(e){return!!k(e)&&0!==Object.keys(e).length},e.isNumber=M,e.isPhone=function(e){return"mobile"===rt(e)},e.isPureObject=k,e.isSafePWAEnv=function(e={}){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;const t=e.requireManifest,n=e.scope;if(void 0!==t&&"boolean"!=typeof t||void 0!==n&&"string"!=typeof n)return!1;if(!0!==window.isSecureContext||!("serviceWorker"in navigator))return!1;if(void 0!==n&&!function(e){const t=e.trim();if(!t||/[?#]/.test(t))return!1;try{const e=new URL(window.location.href),n=new URL(t,e);if(n.origin!==e.origin||""!==n.search||""!==n.hash)return!1;if(e.pathname===n.pathname)return!0;const r=n.pathname.endsWith("/")?n.pathname:`${n.pathname}/`;return e.pathname.startsWith(r)}catch(e){return!1}}(n))return!1;if(!1===t)return!0;if("undefined"==typeof document)return!1;const r=document.querySelector('link[rel~="manifest"][href]');return Boolean(r?.getAttribute("href")?.trim())}catch(e){return!1}},e.isStandalonePWA=function(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator;try{const e=window.matchMedia;if("function"==typeof e&&e.call(window,"(display-mode: standalone)").matches)return!0}catch(e){}try{return!0===e.standalone}catch(e){return!1}},e.isString=function(e){return"string"==typeof e},e.isSupportWebp=function(){return at?Promise.resolve("webp"===at):new Promise(e=>{const t=new Image;t.onload=()=>{const n=t.width>0&&t.height>0;at=n?"webp":"no-webp",e(n)},t.onerror=()=>{at="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})},e.isSupportedEntryType=Ye,e.isTablet=function(e){return"tablet"===rt(e)},e.isThisHour=function(e){const t=s(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()&&t.getHours()===n.getHours()},e.isThisMonth=function(e){const t=s(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()},e.isThisWeek=function(e){const t=s(e);if(!t)return!1;const n=new Date,r=(n.getDay()+6)%7;n.setHours(0,0,0,0),n.setDate(n.getDate()-r);const o=new Date(n.getTime());o.setDate(o.getDate()+7);const i=t.getTime();return i>=n.getTime()&&i<o.getTime()},e.isThisYear=function(e){const t=s(e);return null!==t&&t.getFullYear()===(new Date).getFullYear()},e.isToday=function(e){const t=s(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},e.isUdfOrNul=function(e){return null==e},e.isValidCssSelector=ge,e.isValidData=function(e,t,n){if(null===e||"object"!=typeof e)return!1;let r=e;for(const e of t){if(null===r||"object"!=typeof r&&"function"!=typeof r||!Object.hasOwn(r,e))return!1;r=r[e]}return r===n},e.isValidDate=function(e){return null!==s(e)},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=ae,e.isValidPhoneNumber=q,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.isWindows=function(e){return"windows"===ot(e)},e.listenMediaQueryChanges=function(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");if(null===e)return()=>{};if("object"!=typeof e)throw new TypeError("media must be a MediaQueryList or null");const n=e.addEventListener,r=e.removeEventListener;let o=null;if("function"==typeof n&&"function"==typeof r){const i=t;n.call(e,"change",i),o=()=>r.call(e,"change",i)}let i=!1;return()=>{i||(i=!0,o?.())}},e.loadCSS=He,e.loadImage=function(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})},e.loadScript=We,e.loadScriptIfUndefined=function(e,t){if(window[e])return Promise.resolve("defined");let n=Ve.get(e);const r=n?.get(t);if(r)return r;n||(n=new Map,Ve.set(e,n));const o=()=>{n?.delete(t),0===n?.size&&Ve.delete(e)},i=We(t).then(e=>(o(),e),e=>{throw o(),e});return n.set(t,i),i},e.longestComSubsequence=y,e.longestComSubstring=h,e.mNow=u,e.mTrim=function(e){return e.trim()},e.mazeyCon=fe,e.newLine=function(e){return F(e)},e.onURLChange=function(e,t={}){const{fireOnInit:n=!0}=t,r=history;let o=location.href;const i=[],s=t=>{const n=location.href;if(n===o&&"load"!==t)return;const r=o;o=n,e({url:n,oldUrl:r,trigger:t})},a=()=>s("popstate"),c=()=>s("hashchange");window.addEventListener("popstate",a),window.addEventListener("hashchange",c),i.push(()=>window.removeEventListener("popstate",a)),i.push(()=>window.removeEventListener("hashchange",c)),r.__mazeyUrlChangePatched__||(r.__mazeyUrlChangePatched__=!0,r.__mazeyUrlChangeSubscribers__=new Set,r.__mazeyRawPushState__=history.pushState.bind(history),r.__mazeyRawReplaceState__=history.replaceState.bind(history),history.pushState=function(...e){r.__mazeyRawPushState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("pushState"))},history.replaceState=function(...e){r.__mazeyRawReplaceState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("replaceState"))});const u=e=>s(e);return r.__mazeyUrlChangeSubscribers__.add(u),i.push(()=>r.__mazeyUrlChangeSubscribers__.delete(u)),n&&s("load"),()=>{i.forEach(e=>e())}},e.parseGitHubRepository=function(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.trim();if(!t||/[%\\?#]/.test(t)||function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<=31||127===n)return!0}return!1}(t))throw te();const n=t.match(/^(?:github:)?([^/:\s]+)\/([^/\s]+)$/i);if(n)return ne(n[1],n[2]);const r=t.match(/^git@([^:\s]+):([^/\s]+)\/([^/\s]+)$/);if(r&&"github.com"===r[1].toLowerCase())return ne(r[2],r[3]);const o=t.replace(/^git\+(?=(?:git|ssh|https?):\/\/)/i,""),i=o.match(/^[a-z][a-z\d+.-]*:\/\/([^/?#]+)/i);if(!i||/(^|\/)\.{1,2}(?:\/|$)/.test(o.slice(i[0].length)))throw te();if(-1!==i[1].slice(i[1].lastIndexOf("@")+1).indexOf(":"))throw te();let s;try{s=new URL(o)}catch(e){throw te()}const a=s.protocol.toLowerCase(),c=s.hostname.toLowerCase().replace(/^www\./,"");if(!["git:","ssh:","http:","https:"].includes(a)||"github.com"!==c||""!==s.username&&"git"!==s.username||""!==s.password||""!==s.search||""!==s.hash)throw te();const u=s.pathname.match(/^\/([^/]+)\/([^/]+)\/?$/);if(!u)throw te();return ne(u[1],u[2])},e.parseJsonSafe=function(e,t=null){try{return JSON.parse(e)}catch(e){return t}},e.parseLocalDateTime=function(e){if("string"!=typeof e)return null;const t=a.exec(e);if(!t)return null;const[n,r,s,c,u,l="0",f=""]=t.slice(1),d=Number(n),p=Number(r),m=Number(s),g=Number(c),h=Number(u),y=Number(l),w=Number(`${f}00`.slice(0,3));return d<1||!o(d,p,m,g,h,y,w)?null:i(d,p,m,g,h,y,w)},e.removeClass=function(e,t){if(!e)return void fe.error("The element is not exist.");let n;n=" "+e.className+" ",n=n.replace(/(\s+)/gi," "),n=n.replace(" "+t+" "," "),n=n.replace(/(^\s+)|(\s+$)/g,""),e.className=n},e.removeCookie=Be,e.removeEvent=function(e,t){const n=Ce(),r=n[e];if("string"==typeof e&&Array.isArray(r))if("function"==typeof t){for(let o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]},e.removeHTML=U,e.removeHtml=function(e,t={}){return U(e,t)},e.repeatUntilConditionMet=function(e,t={},n=e=>!0===e){const{interval:r=1e3,times:o=10,context:i,args:s}=t;if("function"!=typeof e)return void console.error("Expected a function.");if(!Number.isFinite(r)||r<0)return void console.error("Expected a non-negative number for interval.");if(!Number.isFinite(o)||o<0)return void console.error("Expected a non-negative number for times.");if(0===o)return;let a=0;const c=()=>{setTimeout(async()=>{const t=await e.apply(i,s);n(t)||++a>=o||c()},r)};c()},e.replaceHttp=function(e){return ce(e)},e.resolveElementTarget=function(e,t){if(void 0===e)return he(t.defaultElement)?t.defaultElement:null;let n=t.unwrap?t.unwrap(e):e;if(null==n)return null;if("string"==typeof n)try{return t.root.querySelector(n)}catch(e){return null}return"object"==typeof n&&"$el"in n&&(n=n.$el),he(n)?n:null},e.resolveLanguagePreference=function(e){ct(e);const t=yt(ut("lang"));if(t)return bt(t);const n=yt(lt(e));return bt(n||(yt(function(){if("undefined"==typeof window||"undefined"==typeof navigator)return null;try{return"string"==typeof navigator.language?navigator.language:null}catch(e){return null}}())??"en"))},e.resolveThemePreference=function(e){ct(e);const t=ut("theme");if(pt(t))return ft(e,t),gt(t,t);const n=lt(e);if(pt(n))return gt(n,n);const r=mt();return"system"===n&&r||r?gt(r,"system"):gt("light","light")},e.sanitizeInput=function(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,e=>t[e])},e.setClass=function(e,t){pe(e,t)},e.setCookie=function(e,t,n,r){let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";const i=function(e){let t=!0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(!(33===r||r>=35&&r<=43||r>=45&&r<=58||r>=60&&r<=91||r>=93&&r<=126)){t=!1;break}}return{isEncoded:!t,value:t?e:encodeURIComponent(e)}}(t),s=Ue(e),a=i.isEncoded?"1":"",c=i.isEncoded?o:"; expires=Thu, 01 Jan 1970 00:00:00 GMT",u=[`${s}=${i.value}${o}; path=/`,`${Fe(e)}=${a}${c}; path=/`],l=e=>{const t=e?`; domain=${e}`:"";u.forEach(e=>{document.cookie=`${e}${t}`})},f=location.hostname;if(r)l(r);else if(-1===f.indexOf("."))l();else{const n=f.split(".");n.shift();l("."+n.join(".")),Ie(e)!==t&&l(`.${f}`)}},e.setImgSizeBySrc=me,e.setImgWidHeiBySrc=function(){return me()},e.setLanguagePreference=function(e,t){ct(e);const n=yt(t);if(!n)throw new TypeError("language must be a valid language tag.");return ft(e,n)},e.setLocalJSON=xe,e.setLocalStorage=De,e.setSessionJSON=$e,e.setSessionStorage=Me,e.setThemePreference=function(e,t){if(ct(e),!function(e){return"system"===e||pt(e)}(t))throw new TypeError('value must be "system", "light", or "dark".');return ft(e,t)},e.sha256Hex=async function(e){const t="undefined"==typeof crypto?null:crypto;if(!t?.subtle||"function"!=typeof t.subtle.digest)throw new Error("Web Crypto API is not available.");let n=e;if("string"==typeof e){if("undefined"==typeof TextEncoder)throw new Error("TextEncoder is not available.");n=(new TextEncoder).encode(e)}const r=await t.subtle.digest("SHA-256",n);let o="";const i=new Uint8Array(r);for(let e=0;e<i.length;e++){const t=i[e].toString(16);o+=1===t.length?`0${t}`:t}return o},e.show=function(e){return Te(e).forEach(e=>{ye.has(e)?(e.style.display=ye.get(e),ye.delete(e)):"none"===e.style.display&&(e.style.display=""),""===e.style.display&&"none"===Se(e)&&(e.style.display=Ae(e))}),e},e.sleep=async function(e){return V(e)},e.subYears=function(e,n){const r="number"==typeof e?e:"object"==typeof e&&null!==e?t(e):null,o=new Date(r??NaN),i="number"==typeof n?n<0?Math.ceil(n):Math.floor(n):NaN;if(!Number.isFinite(o.getTime())||!Number.isFinite(i))return new Date(NaN);if(0===i)return o;const s=o.getMonth(),a=o.getDate(),c=o.getFullYear()-i,u=new Date(o.getTime());return u.setFullYear(c,s+1,0),a>=u.getDate()?u:(o.setFullYear(c,s,a),o)},e.throttle=function(e,t,n={}){n=Object.assign({},n);let r=null,o=null,i=null,[s,a]=[null,0];const c=function(){a=!1===n.leading?0:u(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(...l){const f=u();a||!1!==n.leading||(a=f);const d=t-(f-a);return r=this,o=l,d<=0||d>t?(i&&(clearTimeout(i),i=null),a=f,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(c.bind(r),d)),s}},e.timeCon=de,e.toJavaScriptGlobalName=N,e.truncateZHString=I,e.unsanitize=function(e){return R(e)},e.unsanitizeInput=R,e.updateQueryParam=function(e,t,n){const r=e.indexOf("#"),o=-1===r?"":e.slice(r),i=-1===r?e:e.slice(0,r),s=i.indexOf("?"),a=-1===s?i:i.slice(0,s),c=-1===s?"":i.slice(s+1),u=encodeURIComponent(t),l=encodeURIComponent(n);let f=!1;const d=(c?c.split("&").filter(Boolean):[]).reduce((e,n)=>{const r=n.indexOf("=");return Q(-1===r?n:n.slice(0,r))===t?f||(e.push(`${u}=${l}`),f=!0):e.push(n),e},[]);return f||d.push(`${u}=${l}`),`${a}?${d.join("&")}${o}`},e.waitTime=V,e.watchServiceWorkerUpdates=function(e,t,n){if(null===e||"object"!=typeof e||"function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)throw new TypeError("registration must support event listeners");if(null===t||"object"!=typeof t||"function"!=typeof t.addEventListener||"function"!=typeof t.removeEventListener)throw new TypeError("container must support event listeners");if(null===n||"object"!=typeof n||"function"!=typeof n.onUpdateAvailable||void 0!==n.onControllerChange&&"function"!=typeof n.onControllerChange)throw new TypeError("callbacks must provide onUpdateAvailable");let r=!1,o=null,i=null,s=!1,a=!1;const c=e=>{r||i===e||(i=e,n.onUpdateAvailable(e))},u=()=>{!r&&"installed"===o?.state&&t.controller&&c(o)},l=()=>{r||(o?.removeEventListener("statechange",u),o=e.installing,o?.addEventListener("statechange",u),u())},f=()=>{r||n.onControllerChange?.()},d=()=>{if(s){try{e.removeEventListener("updatefound",l)}catch(e){}s=!1}try{o?.removeEventListener("statechange",u)}catch(e){}if(a){try{t.removeEventListener("controllerchange",f)}catch(e){}a=!1}};try{e.addEventListener("updatefound",l),s=!0,t.addEventListener("controllerchange",f),a=!0,e.waiting&&t.controller&&c(e.waiting),e.installing&&l()}catch(e){throw r=!0,d(),o=null,i=null,e}return{activateWaiting(e={type:"SKIP_WAITING"}){if(r||!i)return!1;try{return i.postMessage(e),!0}catch(e){return!1}},dispose(){r||(r=!0,d(),o=null,i=null)}}},e.windowLoaded=function(e=3e4){return new Promise((t,n)=>{let r=null;const o=()=>{window.removeEventListener("load",i),null!==r&&(clearTimeout(r),r=null)},i=()=>{o(),t("load")};"complete"!==document.readyState?(window.addEventListener("load",i),r=setTimeout(()=>{o(),n(new Error("timeout"))},e)):t("complete")})},e.zAxiosIsValidRes=function(e,t={validStatusRange:[200,300],validCode:[0]}){const n=t||{},{validStatusRange:r=[200,300],validCode:o=[0]}=n;2!==r.length&&console.error("valid validStatusRange is required");let i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){const t=e.data;t&&o.includes(t.code)&&(i=!0)}return i},e}({});
|
|
6
|
+
var mazey=function(e){"use strict";function t(e){try{return Date.prototype.getTime.call(e)}catch(e){return null}}const n=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/,r=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;function o(e,t,n,r,o,i,s=0,a=!1){const c=new Date(0);return a?(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getUTCFullYear()===e&&c.getUTCMonth()===t-1&&c.getUTCDate()===n&&c.getUTCHours()===r&&c.getUTCMinutes()===o&&c.getUTCSeconds()===i&&c.getUTCMilliseconds()===s):(c.setFullYear(e,t-1,n),c.setHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getFullYear()===e&&c.getMonth()===t-1&&c.getDate()===n&&c.getHours()===r&&c.getMinutes()===o&&c.getSeconds()===i&&c.getMilliseconds()===s)}function i(e,t,n,r,o,i,s=0){const a=new Date(0);return a.setFullYear(e,t-1,n),a.setHours(r,o,i,s),a}function s(e){if("number"==typeof e){const t=new Date(e);return Number.isFinite(e)&&Number.isFinite(t.getTime())?t:null}if("object"==typeof e&&null!==e){const n=t(e);return null!==n&&Number.isFinite(n)?new Date(n):null}if("string"!=typeof e)return null;const s=e.trim();if(!s)return null;const a=n.exec(s);if(a){const[e,t,n,r="0",s="0",c="0"]=a.slice(1),[u,l,f,d,p,m]=[e,t,n,r,s,c].map(Number);return o(u,l,f,d,p,m)?i(u,l,f,d,p,m):null}const c=r.exec(s);if(!c)return null;const[u,l,f,d,p,m="0",g="",h]=c.slice(1),y=Number(`${g}00`.slice(0,3));if(!o(Number(u),Number(l),Number(f),Number(d),Number(p),Number(m),y,!0))return null;if("Z"!==h){const e=Number(h.slice(1,3)),t=Number(h.slice(4,6));if(e>23||t>59)return null}return function(e,t,n,r,o,i,s,a){const c=new Date(0);if(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),"Z"===a)return c;const u="+"===a[0]?1:-1,l=60*Number(a.slice(1,3))+Number(a.slice(4,6));return new Date(c.getTime()-u*l*60*1e3)}(Number(u),Number(l),Number(f),Number(d),Number(p),Number(m),y,h)}const a=/^(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function c(e,t){const n=String(e);return n.length>=t?n:`${"0".repeat(t-n.length)}${n}`}function u(){return Date.now()}const l={type:"d"};function f(e){return"string"==typeof e&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T"):e}function d(e=0,t=0,n=l){n=Object.assign({},l,n);const{type:r}=n;"number"==typeof e&&Number.isFinite(e)||(e=new Date(f(e)).getTime()),"number"==typeof t&&Number.isFinite(t)||(t=new Date(f(t)).getTime());const o=Number(t)-Number(e);let i="",[s,a,c,u]=new Array(4).fill(0);if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60),c=Math.floor(o/1e3/60),u=Math.floor(o/1e3),r){case"d":i=s;break;case"text":s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60%24),c=Math.floor(o/1e3/60%60),u=Math.floor(o/1e3%60),i=[{value:s,unit:"day"},{value:a,unit:"hour"},{value:c,unit:"minute"},{value:u,unit:"second"}].filter(({value:e})=>e>0).map(({value:e,unit:t})=>p(e,t)).join(" ")||p(0,"second");break;default:i=u}return i}function p(e,t){const n=Math.round(10*e)/10;return`${n} ${1===n?t:`${t}s`}`}function m(e,t){const n=Math.max(1,Math.round(e));return`about ${n} ${t}${1===n?"":"s"}`}function g(e,t="yyyy-MM-dd"){void 0===e&&(e=new Date);const n=new Date(e);if(!Number.isFinite(n.getTime()))throw new RangeError("Invalid date");const 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"};let i=t||"yyyy-MM-dd";return Object.keys(o).forEach(e=>{let t=o[e];"MM"===e&&Number(t)<=9&&(t=`0${t}`),i=i.split(e).join(String(t))}),i}function h(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));let i=0;for(let s=0;s<n;++s)for(let n=0;n<r;++n)if(e[s]===t[n]){let e=0;s>0&&n>0&&(e=o[s-1][n-1]),o[s][n]=e+1,i=Math.max(i,o[s][n])}return i}function y(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));for(let i=0;i<n;++i)for(let n=0;n<r;++n)if(e[i]===t[n]){let e=0;i>0&&n>0&&(e=o[i-1][n-1]),o[i][n]=e+1}else{let[e,t]=[0,0];n>0&&(e=o[i][n-1]),i>0&&(t=o[i-1][n]),o[i][n]=Math.max(e,t)}return o[n-1][r-1]}function w(e){return Math.random()<e}const b=Function.prototype.toString.call(Object);function v(e,t,n){const r=Object.getOwnPropertyDescriptor(t,n)?.get;if(!r)return!1;try{return r.call(e),!0}catch(e){return!1}}function E(e){return null===e||"object"!=typeof e?e:T(e,new WeakMap)}function T(e,n){if(null===e||"object"!=typeof e)return e;const r=e,o=n.get(r);if(void 0!==o)return o;const i=t(r);if(null!==i){const e=new Date(i);return n.set(r,e),e}const s=function(e){const t=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get;if(!t)return null;try{return t.call(e)}catch(e){return null}}(r);if(null!==s){const t=e,o=new RegExp(s,function(e){return e.flags}(t));return o.lastIndex=t.lastIndex,n.set(r,o),o}if("undefined"!=typeof ArrayBuffer&&v(r,ArrayBuffer.prototype,"byteLength")){const t=ArrayBuffer.prototype.slice.call(e,0);return n.set(r,t),t}if("undefined"!=typeof SharedArrayBuffer&&v(r,SharedArrayBuffer.prototype,"byteLength")){const t=SharedArrayBuffer.prototype.slice.call(e,0);return n.set(r,t),t}if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)){const t=T(e.buffer,n),o="undefined"!=typeof DataView&&v(r,DataView.prototype,"byteLength")?new DataView(t,e.byteOffset,e.byteLength):new e.constructor(t,e.byteOffset,e.length);return n.set(r,o),o}if("undefined"!=typeof Map&&v(r,Map.prototype,"size")){const t=new Map;return n.set(r,t),Map.prototype.forEach.call(e,(e,r)=>{t.set(T(r,n),T(e,n))}),t}if("undefined"!=typeof Set&&v(r,Set.prototype,"size")){const t=new Set;return n.set(r,t),Set.prototype.forEach.call(e,e=>{t.add(T(e,n))}),t}const a=Array.isArray(e),c=Object.getPrototypeOf(e),u=function(e){const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.hasOwn(t,"constructor")?t.constructor:null;return"function"==typeof n&&Function.prototype.toString.call(n)===b}(r),l=!a&&!u&&function(e){const t=Object.getPrototypeOf(e),n=t?.constructor;return"function"==typeof n&&-1===Function.prototype.toString.call(n).indexOf("[native code]")}(r);if(!a&&!u&&!l)return n.set(r,e),e;const f=a?new Array(e.length):Object.create(l?Object.prototype:c);return n.set(r,f),function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}(r).forEach(e=>{if(a&&"length"===e)return;const t=Object.getOwnPropertyDescriptor(r,e);t&&("value"in t&&(t.value=T(t.value,n)),Object.defineProperty(f,e,t))}),f}function S(e){const t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function A(e){const t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function C(e){return A(e)}function N(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.replace(/[^A-Za-z0-9_$]/g,"_").toUpperCase();return/^[A-Za-z_$]/.test(t)?t:`_${t}`}function $(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){}return!1}function O(e=5){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e--;)t+=Math.floor(10*Math.random());return t}function x(e=5){return O(e)}function _(e=3){const[t,n]=[u(),x(e||3)];return t+n}function M(e,t={}){const{isNaNAsNumber:n=!1,isInfinityAsNumber:r=!1,isUnFiniteAsNumber:o=!1}=t;return"number"==typeof e&&(!(!0!==r&&!0!==o&&!isFinite(e))&&!(!n&&isNaN(e)))}function j(e,...t){let n=null;return e&&"function"==typeof e&&(n=e(...t)),n}function D(e,...t){return j(e,...t)}function L(e){let t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function k(e){const t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function P(e){return"boolean"==typeof e}function F(e){if(!e)return"";const t=new RegExp("\\n","g");return e.replace(t,"<br />")}function R(e,t={}){const{removeNewLine:n=!1}=t;let r="";return e&&(r=e.replace(/<\/?.+?>/g,""),n&&(r=r.replace(/[\r\n]/g,""))),r}function U(e){const t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,e=>t[e])}function z(e,t,n={hasDot:!1,dotText:"..."}){if(n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){let r=0,o="";const i=/[^\x00-\xff]/g;let s="";const a=e.replace(i,"**").length;for(let n=0;n<a&&(s=e.charAt(n).toString(),null!=s.match(i)?r+=2:r++,!(r>t));n++)o+=s;return n.hasDot&&a>t&&(o+=n.dotText),o}return""}function I(e,t,n=!1){return z(e,t,{hasDot:n})}const B=["B","KB","MB","GB","TB"];function H(e,t={}){const{base:n=1024,fractionDigits:r=1,invalidValue:o=""}=t;if(!Number.isFinite(e)||e<0||1e3!==n&&1024!==n||!Number.isInteger(r)||r<0||r>20)return o;let i=e,s=0;for(;i>=n&&s<B.length-1;)i/=n,s+=1;return 0===s?`${Number(i.toFixed(r))} ${B[s]}`:`${i.toFixed(r)} ${B[s]}`}function q(e){return/^1\d{10}$/.test(e)}const W=q;async function V(e){return new Promise(t=>{setTimeout(()=>{t(e)},e)})}let Y="";function Z(e,t){const n=e[t];if(void 0!==n&&"string"!=typeof n)throw new TypeError(`manifest.${t} must be a string when provided`);return n}function J(e){if(void 0===e)return{name:""};if("string"==typeof e)return{name:e.trim()};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest.author must be a string or object");const t=e,n={name:""};for(const e of["name","email","url"]){const r=t[e];if(void 0!==r&&"string"!=typeof r)throw new TypeError(`manifest.author.${e} must be a string when provided`);if("string"==typeof r){const t=r.trim();("name"===e||t)&&(n[e]=t)}}return n}function Q(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}}function G(e){const t=e.indexOf("#"),n=-1===t?e:e.slice(0,t),r=n.indexOf("?"),o=/^(?:[a-z][a-z\d+.-]*:)?\/\//i.test(n)||"/"===n.charAt(0),i=-1===r?o?"":n:n.slice(r+1);return i?i.split("&").reduce((e,t)=>{if(!t||-1===t.indexOf("="))return e;const n=t.indexOf("=");return e.push([Q(t.slice(0,n)),Q(t.slice(n+1))]),e},[]):[]}function K(e,t){return G(e).filter(([e])=>e===t).map(([,e])=>e)}const X=/^(?=.{1,39}$)(?!.*--)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/,ee=/^(?=.{1,100}$)(?!\.{1,2}$)[A-Za-z0-9_.-]+$/;function te(){return new Error("The value does not identify one supported GitHub repository")}function ne(e,t){const n=t.replace(/\.git$/i,"");if(!X.test(e)||!ee.test(n))throw te();const r=`${e}/${n}`;return{owner:e,name:n,slug:r,url:`https://github.com/${r}`}}function re(e){return void 0===e||Number(e)<=65535}function oe(e){const t=e.split(".");return 4===t.length&&t.every(e=>/^\d{1,3}$/.test(e)&&(1===e.length||"0"!==e.charAt(0))&&Number(e)<=255)}function ie(e){const t=e.split("::");if(t.length>2)return!1;const n=2===t.length;let r=[];t.forEach(e=>{e&&(r=r.concat(e.split(":")))});let o=0;for(let e=0;e<r.length;e++){const t=r[e];if(-1!==t.indexOf(".")){if(e!==r.length-1||!oe(t))return!1;o+=2}else{if(!/^[0-9a-f]{1,4}$/i.test(t))return!1;o+=1}}return n?o<8:8===o}function se(e){const t=e.match(/^\[([0-9a-f:.]+)\]$/i);if(t)return ie(t[1]);if("."===e.charAt(e.length-1)&&(e=e.slice(0,-1)),oe(e))return!0;const n=e.split(".");return!(n.length<2||n.some(e=>!e||!/^[a-z\d-]+$/i.test(e)||"-"===e.charAt(0)||"-"===e.charAt(e.length-1)))&&!/^\d+$/.test(n[n.length-1])}function ae(e,t={strict:!0}){if("string"!=typeof e||!e||e.trim()!==e)return!1;const n=/^https?:\/\/[^/\\]/i.test(e),r=/^\/\/[^/\\]/.test(e);if(!n&&(t.strict||!r))return!1;const o=r?`http:${e}`:e;if(!function(e){const t=e.match(/^https?:\/\/([^/?#]+)(?:[/?#][^\s<>"`]*)?$/i);if(!t||-1!==t[1].indexOf("@"))return!1;const n=t[1],r=n.match(/^\[([0-9a-f:.]+)\](?::(\d*))?$/i);if(r)return ie(r[1])&&re(r[2]);const o=n.match(/^([^:]+)(?::(\d*))?$/);return!(!o||!re(o[2]))&&se(o[1])}(o))return!1;try{const e=new URL(o);return("http:"===e.protocol||"https:"===e.protocol)&&se(e.hostname)&&!e.username&&!e.password}catch(e){return!1}}function ce(e){return e.replace(/^http:/,"https:")}const ue={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:()=>{},errorFn:()=>{}};function le(e="",t={...ue}){const{enabled:n,isClosed:r,showWrap:o,showDate:i,locales:s,isStringifyObject:a,logFn:c,errorFn:u}=Object.assign({...ue},t);let l=n;!0===r&&(fe.warn("The options.isClosed is deprecated. Please use options.enabled instead."),l=!1);const f=Object.create(null),d=()=>(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return["log","info","warn","error"].forEach(t=>{f[t]=function(...n){if(!l)return;let r=e,s=e;if("string"==typeof e&&e.length>=2){const t=e.length;r=":"===e[t-1]?e.substring(0,t-1):e}o&&console.log(`--- ${r} - begin ---`),i&&(s=e?`${d()} ${e}`:`${d()}`),a&&(n=n.map(e=>k(e)?JSON.stringify(e):e)),e||i?console[t](s,...n):console[t](...n),"log"===t&&c(),"error"===t&&u(),o&&console.log(`--- ${r} - end ---`)}}),f}const fe=le("[Mazey]"),de=le("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function pe(e,t){if(!e)return void fe.error("The element is not exist.");if(Array.isArray(t))return void t.forEach(t=>{t&&e.classList.add(t)});if(!t)return;const n=e.className,r=n.split(/\s+/);for(let e=0;e<r.length;e++)if(r[e]===t)return;let o="",i="";""!==n&&(o=" "),i=n+o+t,e.className=i}function me(){const e=window.jQuery||window.$;if(e){const t=e("img");return!(!t||!t.length)&&(t.each(function(){const t=e(this);if(!t)return;const n=t.attr("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&L(r)&&r[1]&&t.width(r[1]),o&&L(o)&&o[1]&&t.height(o[1])}),!0)}{const e=document.getElementsByTagName("img");if(e.length>0)return Array.from(e).forEach(function(e){const t=e;if(!t)return;const n=t.getAttribute("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&L(r)&&r[1]&&(t.style.width=r[1]),o&&L(o)&&o[1]&&(t.style.height=o[1])}),!0}return!1}function ge(e,t={}){if("string"!=typeof e)return!1;const n=e.trim();if(!n)return!0===t.allowEmpty;const r=t.root||("undefined"==typeof document?null:document);if(!r)return!1;try{return r.querySelector(n),!0}catch(e){return!1}}function he(e){return Boolean(e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}const ye=new WeakMap,we=new WeakMap,be={button:"inline-block",input:"inline-block",select:"inline-block",textarea:"inline-block",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",li:"list-item",summary:"list-item"},ve=new Set(["address","article","aside","blockquote","body","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","main","nav","ol","p","pre","section","ul"]);function Ee(e){if(!he(e))return null;const t=e.style;return t&&"string"==typeof t.display?e:null}function Te(e){const t=new Set,n=e=>{const n=Ee(e);n&&t.add(n)};if("string"==typeof e){if("undefined"==typeof document)return[];try{document.querySelectorAll(e).forEach(n)}catch(e){return[]}return Array.from(t)}const r=Ee(e);if(r)return[r];if(!e||"object"!=typeof e)return[];if("function"==typeof e[Symbol.iterator]){for(const t of e)n(t);return Array.from(t)}const o=e.length;if(!Number.isSafeInteger(o)||o<0)return[];for(let t=0;t<o;t+=1)n(e[t]);return Array.from(t)}function Se(e){const t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).display:null}function Ae(e){const t=e.ownerDocument,n=e.localName.toLowerCase();let r=we.get(t);r||(r=new Map,we.set(t,r));const o=e.namespaceURI||"",i=`${o}:${n}`,s=r.get(i);if(s)return s;let a="";const c="http://www.w3.org/1999/xhtml"===o&&n.includes("-"),u=t.body||t.documentElement;if(u&&!c){const e=o&&"http://www.w3.org/1999/xhtml"!==o?t.createElementNS(o,n):t.createElement(n);u.appendChild(e);try{a=Se(e)||""}finally{u.removeChild(e)}}return a&&"none"!==a||(a=function(e){return be[e]?be[e]:ve.has(e)?"block":"inline"}(n)),r.set(i,a),a}function Ce(){const e=window.MAZEY_DEFINE_LISTENERS;if(e&&"object"==typeof e)return e;const t=Object.create(null);return window.MAZEY_DEFINE_LISTENERS=t,t}function Ne(e,t){const n=Ce()[e];if(Array.isArray(n)){const e=n.slice();for(let n=0,r=e.length;n<r;n++)"function"==typeof e[n]&&(void 0===t?e[n]():e[n](t))}}function $e(e,t=null){if(e){const n=JSON.stringify(t);sessionStorage.setItem(e,void 0===n?"null":n)}}function Oe(e){let t=null;if(e){const n=sessionStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}function xe(e,t=null){if(e){const n=JSON.stringify(t);localStorage.setItem(e,void 0===n?"null":n)}}function _e(e){let t=null;if(e){const n=localStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}const Me=$e,je=Oe,De=xe,Le=_e,ke="__mazey_cookie_name_encoded__-",Pe="__mazey_cookie_value_encoded__-";function Fe(e){return`${Pe}${encodeURIComponent(e)}`}function Re(e){const t=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(e),n=0===e.indexOf(ke)||0===e.indexOf(Pe);return t&&!n?e:function(e){return`${ke}${encodeURIComponent(e)}`}(e)}function Ue(e){const t=Re(e);return t!==e?[t,e]:[e]}function ze(e){const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){const r=n[e].trim();if(0===r.indexOf(t))return r.substring(t.length)}}function Ie(e){const t=Ue(e),n="1"===ze(Fe(e));for(let e=0;e<t.length;e++){const r=ze(t[e]);if(void 0!==r){if(n)try{return decodeURIComponent(r)}catch(e){return r}return r}}return""}function Be(e){const t=Ue(e),n=t.concat(Fe(e)),r=new Date;r.setTime(r.getTime()-1);const o=t.some(e=>void 0!==ze(e));return n.forEach((e,t)=>{if(n.indexOf(e)===t&&void 0!==ze(e)){[`${e}=; expires=${r.toUTCString()}`,`${e}=; expires=${r.toUTCString()}; path=/`].forEach(e=>{document.cookie=e;const t=location.hostname;if(-1!==t.indexOf(".")){const n=t.split(".");for(let t=0;t<n.length;t++)document.cookie=`${e}; domain=.${n.slice(t).join(".")}`}})}}),o&&n.every(e=>void 0===ze(e))}function He(e,t={id:""}){const{id:n}=t;return new Promise((t,r)=>{const o=document.createElement("link");let i=!1;const s=()=>{o.onload=null,o.onerror=null};o.rel="stylesheet",o.type="text/css",o.href=e,void 0!==n&&(o.id=n),o.onload=()=>{i||(i=!0,s(),t("loaded"))},o.onerror=()=>{i||(i=!0,s(),r(new Error(`Failed to load CSS: ${e}`)))},document.head.appendChild(o)})}const qe={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function We(e,t={...qe}){const{id:n,callback:r,timeout:o,isDefer:i,isAsync:s,isCrossOrigin:a,attributes:c,cssUrl:u}=Object.assign({...qe},t);if(u){const t=function(e,t){if(!t)return"";if(ae(t))return t;try{const n=new URL(e,location.href);return new URL(t,n).href}catch(n){const r=e.split("/");return r.pop(),`${r.join("/")}/${t}`}}(e,u);t&&He(t).catch(e=>{console.error(`Failed to load CSS from ${t}: ${e?.message}`)})}return new Promise((t,u)=>{const l=document.createElement("script");let f=!1,d=null;const p=()=>{l.onload=null,l.onerror=null,null!==d&&(clearTimeout(d),d=null)},m=e=>{f||(f=!0,p(),u(e))};l.type="text/javascript",l.defer=Boolean(i),l.async=Boolean(s),a&&(l.crossOrigin="anonymous"),n&&(l.id=n),c&&Object.keys(c).forEach(e=>{l.setAttribute(e,c[e])}),l.onload=()=>{if(!f){f=!0,p();try{D(r),t("loaded")}catch(e){u(e)}}},l.onerror=()=>m(new Error(`Failed to load script: ${e}`)),l.src=e,o&&(d=setTimeout(()=>m(new Error("timeout")),o));const g=document.getElementsByTagName("script")[0];if(g?.parentNode)g.parentNode.insertBefore(l,g);else{(document.head||document.body||document.documentElement).appendChild(l)}})}const Ve=new Map;function Ye(e){if("undefined"==typeof window)return!1;let t=[];const n=window.PerformanceObserver;return!!n&&(L(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}async function Ze(){return Ye("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-contentful-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function Je(){return Ye("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}function Qe(e,t=e.userAgent.trim().toLowerCase()){return/\bmacintosh\b/.test(t)&&"macintel"===e.platform.toLowerCase()&&e.maxTouchPoints>1}const Ge=Object.freeze(["adsbot-google","ahrefsbot","amazonbot","applebot","baiduspider","bingbot","bingpreview","bytespider","ccbot","chatgpt-user","claudebot","discordbot","dotbot","duckduckbot","facebookexternalhit","facebot","google-inspectiontool","googlebot","googleother","gptbot","linkedinbot","mediapartners-google","mj12bot","perplexitybot","petalbot","semrushbot","slackbot","slurp","storebot-google","telegrambot","twitterbot","whatsapp","yandexbot"]),Ke=Object.freeze(["headlesschrome","phantomjs","slimerjs","selenium","puppeteer","playwright"]);function Xe(){try{return"undefined"==typeof navigator?null:navigator}catch(e){return null}}function et(){const e=Xe();if(!e)return{userAgent:"",platform:"",maxTouchPoints:0};let t="",n="",r=0;try{const n=e.userAgent;t="string"==typeof n?n:""}catch(e){return{userAgent:"",platform:"",maxTouchPoints:0}}try{const t=e.platform;n="string"==typeof t?t:""}catch(e){n=""}try{const t=e.maxTouchPoints;r=Number.isFinite(t)?t:0}catch(e){r=0}return{userAgent:t,platform:n,maxTouchPoints:r}}function tt(e){const t=e.userAgent.trim().toLowerCase();return t?/\bandroid\b|\badr\b/.test(t)?"android":/\bios\b|\biphone\b|\bipad\b|\bipod\b|\biwatch\b/.test(t)||Qe(e,t)?"ios":/\bwindows\b|\bwin32\b|\bwin64\b|\bwow32\b|\bwow64\b/.test(t)?"windows":/\bmacintosh\b|\bmacintel\b|\bmac os x\b/.test(t)?"macos":/\blinux\b/.test(t)?"linux":"":""}function nt(e){const t=e.userAgent.trim().toLowerCase();if(!t)return"";if(/\biwatch\b|\bapple watch\b/.test(t))return"";if(/\bipad\b|\btablet\b/.test(t)||Qe(e,t))return"tablet";const n=tt(e);return"android"===n?/\bmobile\b/.test(t)?"mobile":"tablet":"ios"===n&&/\biphone\b|\bipod\b/.test(t)?"mobile":"windows"===n||"macos"===n||"linux"===n||/\bcros\b/.test(t)?"desktop":/\bmobile\b/.test(t)?"mobile":""}function rt(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return nt(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:et())}function ot(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return tt(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:et())}function it(e,t){const n=e.trim().toLowerCase();return t.some(e=>n.includes(e))}function st(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;let e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{const t=et(),n=t.userAgent.toLowerCase();if(!n)return e;const r=e=>e.test(n),o=e=>{let t="";const r=n.match(e);return r&&L(r)&&(t=r.toString(),t=t.replace(/[^0-9|_.]/g,""),t=t.replace(/_/g,".")),t},i=tt(t);let s="";"ios"===i&&(r(/ipad/g)?s="ipad":r(/iphone/g)?s="iphone":r(/iwatch/g)?s="iwatch":r(/ipod/g)?s="ipod":"macintel"===t.platform.toLowerCase()&&t.maxTouchPoints>1&&(s="ipad")),e={...e,system:i,appleType:s};let a="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?a="2000":r(/windows nt 5.1|windows xp/g)?a="xp":r(/windows nt 5.2|windows 2003/g)?a="2003":r(/windows nt 6.0|windows vista/g)?a="vista":r(/windows nt 6.1|windows 7/g)?a="7":r(/windows nt 6.2|windows 8/g)?a="8":r(/windows nt 6.3|windows 8.1/g)?a="8.1":r(/windows nt 10.0|windows 10/g)&&(a="10"):"macos"===i?a=o(/os x [\d._]+/g):"android"===i?a=o(/android [\d._]+/g):"ios"===i&&(a=o(/os [\d._]+/g)),e={...e,systemVs:a};let c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),e={...e,platform:c};let u="",l="";r(/applewebkit/g)?(u="webkit",r(/edg(?:a|ios)?\//g)||r(/edge\//g)?l="edge":r(/opr/g)?l="opera":r(/chrome/g)?l="chrome":r(/safari/g)&&(l="safari")):r(/gecko/g)&&r(/firefox/g)?(u="gecko",l="firefox"):r(/presto/g)?(u="presto",l="opera"):r(/trident|compatible|msie/g)&&(u="trident",l="iexplore"),e={...e,engine:u,supporter:l};let f="";"webkit"===u?f=o(/applewebkit\/[\d._]+/g):"gecko"===u?f=o(/gecko\/[\d._]+/g):"presto"===u?f=o(/presto\/[\d._]+/g):"trident"===u&&(f=o(/trident\/[\d._]+/g)),e={...e,engineVs:f};let d="";"chrome"===l?d=o(/chrome\/[\d._]+/g):"safari"===l?d=o(/version\/[\d._]+/g):"firefox"===l?d=o(/firefox\/[\d._]+/g):"opera"===l?d=o(/opr\/[\d._]+/g):"iexplore"===l?d=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(d=o(/(?:edge|edg|edga|edgios)\/[\d._]+/g)),e={...e,supporterVs:d};let p="",m="";r(/micromessenger/g)?(p="wechat",m=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",m=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",m=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",m=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",m=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),e={...e,shell:p,shellVs:m};let g="";if(window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");e.matches?g="dark":t.matches&&(g="light")}return e={...e,colorScheme:g},window.MAZEY_BROWSER_INFO=e,e}catch(t){return fe.warn(t),e}}let at="";function ct(e){if("string"!=typeof e||""===e.trim())throw new TypeError("storageKey must be a non-empty string.")}function ut(e){if("undefined"==typeof window)return null;try{return new URL(window.location.href).searchParams.get(e)}catch(e){return null}}function lt(e){if("undefined"==typeof window)return null;try{const t=window.localStorage;return t&&"function"==typeof t.getItem?t.getItem(e):null}catch(e){return null}}function ft(e,t){if("undefined"==typeof window)return!1;try{const n=window.localStorage;return!(!n||"function"!=typeof n.setItem)&&(n.setItem(e,t),!0)}catch(e){return!1}}const dt=Object.freeze({system:"System",light:"Light",dark:"Dark"});function pt(e){return"light"===e||"dark"===e}function mt(){if("undefined"==typeof window)return null;try{const e=window.matchMedia;return"function"!=typeof e?null:e.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return null}}function gt(e,t){return{value:e,label:dt[t]}}function ht(e){const t=e.split("-");if(!/^[a-z]{2,8}$/i.test(t[0]))return null;const n=[t[0].toLowerCase()];let r=1;if(r<t.length&&/^[a-z]{4}$/i.test(t[r])){const e=t[r].toLowerCase();n.push(`${e[0].toUpperCase()}${e.slice(1)}`),r++}for(r<t.length&&(/^[a-z]{2}$/i.test(t[r])||/^\d{3}$/.test(t[r]))&&(n.push(/^[a-z]{2}$/i.test(t[r])?t[r].toUpperCase():t[r]),r++);r<t.length;r++){const e=t[r];if(!/^(?:[a-z0-9]{5,8}|\d[a-z0-9]{3})$/i.test(e))return null;n.push(e.toLowerCase())}return n.join("-")}function yt(e){if("string"!=typeof e)return null;const t=e.trim().replace(/_/g,"-");if(!t)return null;if("undefined"!=typeof Intl)try{const e=Intl,n=e.getCanonicalLocales;if("function"==typeof n){const r=n.call(e,t)[0];return"string"==typeof r&&r?r:null}}catch(e){return e instanceof RangeError||"object"==typeof e&&null!==e&&"name"in e&&"RangeError"===e.name?null:ht(t)}return ht(t)}function wt(e){if("undefined"==typeof Intl)return e;try{const t=Intl.DisplayNames;if("function"!=typeof t)return e;const n=new t([e],{type:"language"}).of(e);return"string"==typeof n&&n.trim()?n:e}catch(t){return e}}function bt(e){return{value:e,label:wt(e)}}return e.addClass=pe,e.addEvent=function(e,t){const n=Ce();Array.isArray(n[e])||Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:[],writable:!0}),"function"==typeof t&&n[e].push(t)},e.addStyle=function(e,t={id:""}){if(!e)return!1;const n=document.createDocumentFragment();let r=null,o="";const i=document.createElement("style");return t.id?(o=`${t.id}`,r=document.getElementById(o),r?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.assignDefined=function(e,...t){return t.forEach(t=>{void 0!==t&&Object.keys(t).forEach(n=>{const r=t[n];if(void 0!==r){const t=e;"__proto__"!==n||Object.hasOwn(e,n)?t[n]=r:Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0})}})}),e},e.calLongestCommonSubsequence=function(e,t){return y(e,t)},e.calLongestCommonSubstring=function(e,t){return h(e,t)},e.calculateAspectRatio=function(e,t){if(!Number.isSafeInteger(e))throw new TypeError("width must be a safe integer.");if(!Number.isSafeInteger(t))throw new TypeError("height must be a safe integer.");if(e<=0||t<=0)throw new RangeError("width and height must be greater than zero.");const n=function(e,t){for(;0!==t;){const n=e%t;e=t,t=n}return e}(e,t);return`${e/n}x${t/n}`},e.calculateCAGR=function(e,t,n){const r=s(e);if(!r)throw new TypeError("startDate must be a valid date.");const o=s(t);if(!o)throw new TypeError("endDate must be a valid date.");const i=o.getTime()-r.getTime();if(i<=0)throw new RangeError("endDate must be later than startDate.");const a=function(e){if("number"==typeof e){if(!Number.isFinite(e))throw new TypeError("totalReturnRate must be a finite number or percentage string.");return e}if("string"!=typeof e)throw new TypeError("totalReturnRate must be a finite number or percentage string.");const t=e.trim();if(!t)throw new TypeError("totalReturnRate must not be empty.");const n=t.endsWith("%")?t.slice(0,-1).trim():t;if(!n)throw new TypeError("totalReturnRate must be a valid percentage string.");const r=Number(n);if(!Number.isFinite(r))throw new TypeError("totalReturnRate must be a valid percentage string.");return r/100}(n);if(a<=-1)throw new RangeError("totalReturnRate must be greater than -1.");const c=i/864e5,u=Math.pow(1+a,365/c)-1;if(!Number.isFinite(u))throw new RangeError("calculated CAGR must be finite.");return u},e.camelCase2Underscore=C,e.camelCaseToKebabCase=function(e){return S(e)},e.cancelBubble=function(e){e.stopPropagation()},e.clearHTML=function(e,t={}){return R(e,t)},e.clearHtml=function(e,t={}){return R(e,t)},e.convert10To26=function(e){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e>0;){let n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t},e.convertCamelToKebab=S,e.convertCamelToUnder=A,e.convertHttpToHttps=ce,e.convertKebabToCamel=function(e){const t=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return t.endsWith("-")?t.slice(0,-1):t},e.convertObjectToQuery=function(e){return e&&0===Object.keys(e).length?"":`?${Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}`},e.convertToHtmlBreaks=F,e.convertUnderToCamel=function(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())},e.cutCHSString=function(e,t,n=!1){return I(e,t,n)},e.cutZHString=z,e.debounce=function(e,t,n){let r=null,o=null,i=null,s=null,a=null;const c=function(){const l=u()-i;l<t&&l>=0?o=setTimeout(c,t-l):(o=null,n||(a=e.apply(r,s),o||(r=s=null)))};return function(...l){r=this,s=l,i=u();const f=n&&!o;return o||(o=setTimeout(c,t)),f&&(a=e.apply(r,s),r=s=null),a}},e.deepCopy=E,e.deepCopyObject=function(e){return E(e)},e.deepFreeze=function e(t){return!t||"object"!=typeof t||Object.isFrozen(t)||(Object.freeze(t),Object.values(t).forEach(e)),t},e.delCookie=function(e){Be(e)},e.derivePackageMetadata=function(e,t={}){if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest must be an object");if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("options must be an object when provided");const n=e;if("string"!=typeof n.name||!n.name.trim())throw new TypeError("manifest.name must be a non-empty string");const r=n.name.trim(),o=function(e){if(/\s/.test(e))throw new TypeError("manifest.name must not contain whitespace");if(e.startsWith("@")){const t=e.split("/");if(2!==t.length||t[0].length<2||!t[1])throw new TypeError("manifest.name must be a valid scoped package name");return t[1]}if(e.includes("/"))throw new TypeError("manifest.name must be an unscoped or scoped package name");return e}(r),i=t.packageManager??"npm";if("npm"!==i&&"pnpm"!==i&&"yarn"!==i)throw new TypeError('packageManager must be "npm", "pnpm", or "yarn"');const s="npm"===i?"npm install":`${i} add`;return{name:r,version:Z(n,"version"),description:Z(n,"description"),license:Z(n,"license"),author:J(n.author),unscopedName:o,iifeGlobal:N(o),installCommand:`${s} ${r}`}},e.detectVisitorType=function(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");const t=void 0===e?function(){const e=Xe();if(!e)return"";try{const t=e.userAgent;return"string"==typeof t?t:""}catch(e){return""}}():e;return it(t,Ge)?"crawler":it(t,Ke)||function(){const e=Xe();if(!e)return!1;try{return!0===e.webdriver}catch(e){return!1}}()?"automation":"unknown"},e.doFn=D,e.escapeHtmlAttribute=function(e,t={}){if("string"!=typeof e)throw new TypeError("value must be a string.");const n=t.preserveEntities?/&(?!(?:#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]+);)/gi:/&/g,r={"<":"<",">":">",'"':""","'":"'"};return e.replace(n,"&").replace(/[<>"']/g,e=>r[e])},e.extractElementText=function(e,t={}){const{excludeSelector:n="",replaceImagesWithAlt:r=!0,normalizeWhitespace:o=!0}=t,i=e.cloneNode(!0);r&&Array.from(i.querySelectorAll("img[alt]")).forEach(e=>{const t=e.getAttribute("alt")||"";e.parentNode?.replaceChild(i.ownerDocument.createTextNode(t),e)});const s=n.trim();s&&ge(s,{root:i})&&Array.from(i.querySelectorAll(s)).forEach(e=>e.parentNode?.removeChild(e));const a=i.innerText||i.textContent||"";return o?a.replace(/\u00a0/g," ").replace(/\s+/g," ").trim():a},e.fireEvent=Ne,e.floatFixed=function(e,t=0){return parseFloat(String(e)).toFixed(t)},e.floatToPercent=function(e,t=0){let n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),`${n}%`},e.formatByteSize=H,e.formatDate=g,e.formatDistanceToNow=function(e){const t=s(e);if(!t)return"";const n=6e4,r=36e5,o=864e5,i=Math.abs(t.getTime()-Date.now());return i<3e4?"less than a minute":i<9e4?"about 1 minute":i<27e5?m(i/n,"minute"):i<54e5?"about 1 hour":i<864e5?m(i/r,"hour"):i<1512e5?"about 1 day":i<30*o?m(i/o,"day"):i<45*o?"about 1 month":i<365*o?m(i/(30*o),"month"):i<545*o?"about 1 year":m(i/(365*o),"year")},e.formatDurationFromMs=function(e){const t=(Number.isFinite(e)?Math.max(e,0):0)/1e3;return t>=86400?p(t/24/60/60,"day"):t>=3600?p(t/60/60,"hour"):t>=60?p(t/60,"minute"):p(t,"second")},e.formatLocalDateTime=function(e,n={}){const r="object"==typeof e&&null!==e?t(e):null;if(null===r)throw new TypeError("date must be a Date");if(!Number.isFinite(r))throw new RangeError("Invalid date");const o=n.precision??"minute";if("minute"!==o&&"second"!==o&&"millisecond"!==o)throw new TypeError("precision must be minute, second, or millisecond");const i=new Date(r),s=i.getFullYear();if(s<1)throw new RangeError("Date year must be greater than zero");const a=[c(s,4),c(i.getMonth()+1,2),c(i.getDate(),2)].join("-"),u=[c(i.getHours(),2),c(i.getMinutes(),2)];"minute"!==o&&u.push(c(i.getSeconds(),2));let l=`${a}T${u.join(":")}`;return"millisecond"===o&&(l+=`.${c(i.getMilliseconds(),3)}`),l},e.genBrowserAttrs=function(e="",t="-"){const n=st(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(o=>{const i=n[o];if(i){let n="";e&&e.length>0&&(n=`${e}${t}`),r.push(`${n}${i}`)}}),r},e.genCustomConsole=le,e.genHashCode=function(e){let t,n,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r},e.genRndNumString=O,e.genStyleString=function(e,t){let n="";return t&&t.length>0&&(n=t.join(";")+";"),`${e}{${n}}`},e.genUniqueNumString=_,e.generateCalendarVersion=function(e){return g(void 0===e?new Date:new Date(e instanceof Date?e.getTime():e),"yyyy.MMdd.HHmmss").split(".").map(e=>String(Number(e))).join(".")},e.generateRndNum=x,e.generateUniqueNum=function(e=3){return _(e)},e.getAllQueryParams=function(e=""){""===e&&(e=location.search);const t={};return G(e).forEach(([e,n])=>{Object.hasOwn(t,e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}),t},e.getBrowserInfo=st,e.getCLS=async function(){return Ye("layout-shift")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().reduce((e,t)=>{let n=0;return M(t.value)&&(n=t.value),e+n},0);t.disconnect(),e(r)});t.observe({type:"layout-shift",buffered:!0})}):0},e.getCookie=Ie,e.getCurrentVersion=function(){return"v4"},e.getDateDifference=d,e.getDefineListeners=Ce,e.getDomain=function(e,t=["hostname"]){try{const n=new URL(e,document.baseURI);return t.reduce((e,t)=>e+=n[t],"")}catch(n){const r=document.createElement("a");return r.href=e,t.reduce((e,t)=>e+=r[t],"")}},e.getFCP=Ze,e.getFID=async function(){return Ye("first-input")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-input"===e.entryType);if(r){t.disconnect();const n=r.processingStart;e(n?Math.round(r.processingStart-r.startTime):0)}});t.observe({type:"first-input",buffered:!0})}):0},e.getFP=Je,e.getFileSize=function(e,t={}){return H(e,t)},e.getFriendlyInterval=function(e=0,t=0,n=l){return d(e,t,n)},e.getHashQueryParam=function(e){const t=location.hash.split("?");return 1===t.length?"":K(`?${t.slice(1).join("?")}`,e)[0]||""},e.getLCP=async function(){return Ye("largest-contentful-paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"largest-contentful-paint"===e.entryType);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"largest-contentful-paint",buffered:!0})}):0},e.getLocalJSON=_e,e.getLocalStorage=Le,e.getPageMeta=function(e){const t=document.getElementsByTagName("meta");for(let n=0;n<t.length;n++)if(t[n].getAttribute("name")===e)return t[n].getAttribute("content")||"";return""},e.getPerformance=async function(e=!1){if(!Ye("navigation"))return Promise.reject(new Error("navigation is not supported"));const t=window.performance;if(!t||"function"!=typeof t.getEntriesByType)return Promise.reject(new Error("performance is not supported"));let n;const r=new Promise(e=>{[n]=[e]}),o=t.getEntriesByType("navigation");if(!L(o))return Promise.reject(new Error("NavigationTiming is not supported"));const i=o[0];let[s,a,c,u,l,f,d,p,m,g,h,y,w,b,v,E,T,S,A]=new Array(19).fill(0);({decodedBodySize:S,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i);let N=0;if(M(E))N=E;else{if(!M(T))return Promise.reject(new Error("startTime, navigationStart or fetchStart are required"));N=T}const[$,O]=await Promise.all([Je(),Ze()]);function x(){({decodedBodySize:S,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i),M(E)?N=E:M(T)&&(N=T);const t={source:"PerformanceNavigationTiming",os:_(),osVersion:j(),deviceType:D(),network:k(),screenDirection:P(),unloadTime:s-a,redirectTime:c-u,dnsTime:l-f,tcpTime:d-p,sslTime:F(d,m),responseTime:g-h,downloadTime:y-g,firstPaintTime:$,firstContentfulPaintTime:O,domReadyTime:w-N,onloadTime:b-N,whiteTime:g-N,renderTime:v-N,decodedBodySize:S,encodedBodySize:A};Object.keys(t).forEach(e=>{M(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))}),M(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);const r={};e||Object.keys(t).forEach(e=>{r[C(e)]=t[e]}),Object.keys(r).length?n(r):n(t)}function _(){let e;return e=navigator.userAgent.indexOf("Android")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others",e}function j(){let e="";const t=navigator.userAgent,n=t.indexOf("Android")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;const i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function D(){let e;const 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",s=t.match(/ucweb/i)&&"ucweb",a=t.match(/android/i)&&"android",c=t.match(/windows ce/i)&&"windows ce",u=t.match(/windows mobile/i)&&"windows mobile";return e=n||r||o||i||s||a||c||u?r||o||i||s||a||c||u?"phone":n?"ipad":void 0:"pc",e||(e=""),e}function k(){let e="";const t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function P(){let e="";return window.screen&&window.screen.orientation&&"number"==typeof 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 F(e,t){let n=0;return t&&(n=e-t),n}return M(v)&&v>0?x():"complete"===document.readyState?window.setTimeout(x,0):window.addEventListener("load",function e(){window.removeEventListener("load",e),window.setTimeout(function(){x()},0)}),r},e.getQueryParam=function(e){return K(location.search,e)[0]||""},e.getScriptQueryParam=function(e,t=""){t||(t=".js");const n=document.querySelectorAll("script[src]");for(let r=0;r<n.length;r++){const o=n[r].getAttribute("src");if(o&&-1!==o.indexOf(t)){const t=K(o,e)[0];if(void 0!==t)return t}}return""},e.getSessionJSON=Oe,e.getSessionStorage=je,e.getSystemTheme=mt,e.getTTFB=async function(){if(!Ye("navigation"))return 0;if(!window.performance||!window.performance.getEntriesByType)return 0;const e=window.performance.getEntriesByType("navigation")[0];let t=0;return e?(t=e.responseStart-e.requestStart,Math.round(t)):0},e.getUrlFileType=function(e){let t="";if("string"!=typeof e||""==e)return t;const n=e.split(/[?#]/,1)[0],r=/\.[^/]+$/.exec(n);return r?(r[0].length>1&&(t=r[0].substring(1)),t):t},e.getUrlHost=function(e){!ae(e)&&ae(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).host}catch(e){return""}},e.getUrlParam=function(e,t,n={}){const r=K(e,t);return n.returnArray?r:r.length?r[0]:null},e.getUrlPath=function(e){!ae(e)&&ae(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).pathname}catch(e){return""}},e.hasClass=function(e,t){if(!e)return fe.error("The element is not exist."),!1;const n=e.className.split(/\s+/);for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1},e.hide=function(e){return Te(e).forEach(e=>{"none"!==Se(e)&&"none"!==e.style.display&&ye.set(e,e.style.display),e.style.display="none"}),e},e.inRate=function(e){return w(e)},e.invokeEvent=function(e,t){Ne(e,t)},e.invokeFn=j,e.isAndroid=function(e){return"android"===ot(e)},e.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},e.isBool=P,e.isBoolean=function(e){return P(e)},e.isBrowser=function(){if(Y)return"browser"===Y;const e="undefined"!=typeof window;return e&&(Y="browser"),e},e.isDesktop=function(e){return"desktop"===rt(e)},e.isFunction=function(e){return"function"==typeof e},e.isHit=w,e.isIOS=function(e){return"ios"===ot(e)},e.isJSONString=$,e.isJsonString=function(e){return $(e)},e.isLinux=function(e){return"linux"===ot(e)},e.isMacOS=function(e){return"macos"===ot(e)},e.isMobile=W,e.isNonEmptyArray=L,e.isNonEmptyObject=function(e){return!!k(e)&&0!==Object.keys(e).length},e.isNumber=M,e.isPhone=function(e){return"mobile"===rt(e)},e.isPureObject=k,e.isSafePWAEnv=function(e={}){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;const t=e.requireManifest,n=e.scope;if(void 0!==t&&"boolean"!=typeof t||void 0!==n&&"string"!=typeof n)return!1;if(!0!==window.isSecureContext||!("serviceWorker"in navigator))return!1;if(void 0!==n&&!function(e){const t=e.trim();if(!t||/[?#]/.test(t))return!1;try{const e=new URL(window.location.href),n=new URL(t,e);if(n.origin!==e.origin||""!==n.search||""!==n.hash)return!1;if(e.pathname===n.pathname)return!0;const r=n.pathname.endsWith("/")?n.pathname:`${n.pathname}/`;return e.pathname.startsWith(r)}catch(e){return!1}}(n))return!1;if(!1===t)return!0;if("undefined"==typeof document)return!1;const r=document.querySelector('link[rel~="manifest"][href]');return Boolean(r?.getAttribute("href")?.trim())}catch(e){return!1}},e.isStandalonePWA=function(){if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator;try{const e=window.matchMedia;if("function"==typeof e&&e.call(window,"(display-mode: standalone)").matches)return!0}catch(e){}try{return!0===e.standalone}catch(e){return!1}},e.isString=function(e){return"string"==typeof e},e.isSupportWebp=function(){return at?Promise.resolve("webp"===at):new Promise(e=>{const t=new Image;t.onload=()=>{const n=t.width>0&&t.height>0;at=n?"webp":"no-webp",e(n)},t.onerror=()=>{at="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})},e.isSupportedEntryType=Ye,e.isTablet=function(e){return"tablet"===rt(e)},e.isThisHour=function(e){const t=s(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()&&t.getHours()===n.getHours()},e.isThisMonth=function(e){const t=s(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()},e.isThisWeek=function(e){const t=s(e);if(!t)return!1;const n=new Date,r=(n.getDay()+6)%7;n.setHours(0,0,0,0),n.setDate(n.getDate()-r);const o=new Date(n.getTime());o.setDate(o.getDate()+7);const i=t.getTime();return i>=n.getTime()&&i<o.getTime()},e.isThisYear=function(e){const t=s(e);return null!==t&&t.getFullYear()===(new Date).getFullYear()},e.isToday=function(e){const t=s(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},e.isUdfOrNul=function(e){return null==e},e.isValidCssSelector=ge,e.isValidData=function(e,t,n){if(null===e||"object"!=typeof e)return!1;let r=e;for(const e of t){if(null===r||"object"!=typeof r&&"function"!=typeof r||!Object.hasOwn(r,e))return!1;r=r[e]}return r===n},e.isValidDate=function(e){return null!==s(e)},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=ae,e.isValidPhoneNumber=q,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.isWindows=function(e){return"windows"===ot(e)},e.listenMediaQueryChanges=function(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");if(null===e)return()=>{};if("object"!=typeof e)throw new TypeError("media must be a MediaQueryList or null");const n=e.addEventListener,r=e.removeEventListener;let o=null;if("function"==typeof n&&"function"==typeof r){const i=t;n.call(e,"change",i),o=()=>r.call(e,"change",i)}let i=!1;return()=>{i||(i=!0,o?.())}},e.loadCSS=He,e.loadImage=function(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})},e.loadScript=We,e.loadScriptIfUndefined=function(e,t){if(window[e])return Promise.resolve("defined");let n=Ve.get(e);const r=n?.get(t);if(r)return r;n||(n=new Map,Ve.set(e,n));const o=()=>{n?.delete(t),0===n?.size&&Ve.delete(e)},i=We(t).then(e=>(o(),e),e=>{throw o(),e});return n.set(t,i),i},e.longestComSubsequence=y,e.longestComSubstring=h,e.mNow=u,e.mTrim=function(e){return e.trim()},e.mazeyCon=fe,e.newLine=function(e){return F(e)},e.onURLChange=function(e,t={}){const{fireOnInit:n=!0}=t,r=history;let o=location.href;const i=[],s=t=>{const n=location.href;if(n===o&&"load"!==t)return;const r=o;o=n,e({url:n,oldUrl:r,trigger:t})},a=()=>s("popstate"),c=()=>s("hashchange");window.addEventListener("popstate",a),window.addEventListener("hashchange",c),i.push(()=>window.removeEventListener("popstate",a)),i.push(()=>window.removeEventListener("hashchange",c)),r.__mazeyUrlChangePatched__||(r.__mazeyUrlChangePatched__=!0,r.__mazeyUrlChangeSubscribers__=new Set,r.__mazeyRawPushState__=history.pushState.bind(history),r.__mazeyRawReplaceState__=history.replaceState.bind(history),history.pushState=function(...e){r.__mazeyRawPushState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("pushState"))},history.replaceState=function(...e){r.__mazeyRawReplaceState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("replaceState"))});const u=e=>s(e);return r.__mazeyUrlChangeSubscribers__.add(u),i.push(()=>r.__mazeyUrlChangeSubscribers__.delete(u)),n&&s("load"),()=>{i.forEach(e=>e())}},e.parseGitHubRepository=function(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.trim();if(!t||/[%\\?#]/.test(t)||function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<=31||127===n)return!0}return!1}(t))throw te();const n=t.match(/^(?:github:)?([^/:\s]+)\/([^/\s]+)$/i);if(n)return ne(n[1],n[2]);const r=t.match(/^git@([^:\s]+):([^/\s]+)\/([^/\s]+)$/);if(r&&"github.com"===r[1].toLowerCase())return ne(r[2],r[3]);const o=t.replace(/^git\+(?=(?:git|ssh|https?):\/\/)/i,""),i=o.match(/^[a-z][a-z\d+.-]*:\/\/([^/?#]+)/i);if(!i||/(^|\/)\.{1,2}(?:\/|$)/.test(o.slice(i[0].length)))throw te();if(-1!==i[1].slice(i[1].lastIndexOf("@")+1).indexOf(":"))throw te();let s;try{s=new URL(o)}catch(e){throw te()}const a=s.protocol.toLowerCase(),c=s.hostname.toLowerCase().replace(/^www\./,"");if(!["git:","ssh:","http:","https:"].includes(a)||"github.com"!==c||""!==s.username&&"git"!==s.username||""!==s.password||""!==s.search||""!==s.hash)throw te();const u=s.pathname.match(/^\/([^/]+)\/([^/]+)\/?$/);if(!u)throw te();return ne(u[1],u[2])},e.parseJsonSafe=function(e,t=null){try{return JSON.parse(e)}catch(e){return t}},e.parseLocalDateTime=function(e){if("string"!=typeof e)return null;const t=a.exec(e);if(!t)return null;const[n,r,s,c,u,l="0",f=""]=t.slice(1),d=Number(n),p=Number(r),m=Number(s),g=Number(c),h=Number(u),y=Number(l),w=Number(`${f}00`.slice(0,3));return d<1||!o(d,p,m,g,h,y,w)?null:i(d,p,m,g,h,y,w)},e.removeClass=function(e,t){if(!e)return void fe.error("The element is not exist.");let n;n=" "+e.className+" ",n=n.replace(/(\s+)/gi," "),n=n.replace(" "+t+" "," "),n=n.replace(/(^\s+)|(\s+$)/g,""),e.className=n},e.removeCookie=Be,e.removeEvent=function(e,t){const n=Ce(),r=n[e];if("string"==typeof e&&Array.isArray(r))if("function"==typeof t){for(let o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]},e.removeHTML=R,e.removeHtml=function(e,t={}){return R(e,t)},e.repeatUntilConditionMet=function(e,t={},n=e=>!0===e){const{interval:r=1e3,times:o=10,context:i,args:s}=t;if("function"!=typeof e)return void console.error("Expected a function.");if(!Number.isFinite(r)||r<0)return void console.error("Expected a non-negative number for interval.");if(!Number.isFinite(o)||o<0)return void console.error("Expected a non-negative number for times.");if(0===o)return;let a=0;const c=()=>{setTimeout(async()=>{const t=await e.apply(i,s);n(t)||++a>=o||c()},r)};c()},e.replaceHttp=function(e){return ce(e)},e.resolveElementTarget=function(e,t){if(void 0===e)return he(t.defaultElement)?t.defaultElement:null;let n=t.unwrap?t.unwrap(e):e;if(null==n)return null;if("string"==typeof n)try{return t.root.querySelector(n)}catch(e){return null}return"object"==typeof n&&"$el"in n&&(n=n.$el),he(n)?n:null},e.resolveLanguagePreference=function(e){ct(e);const t=yt(ut("lang"));if(t)return bt(t);const n=yt(lt(e));return bt(n||(yt(function(){if("undefined"==typeof window||"undefined"==typeof navigator)return null;try{return"string"==typeof navigator.language?navigator.language:null}catch(e){return null}}())??"en"))},e.resolveThemePreference=function(e){ct(e);const t=ut("theme");if(pt(t))return ft(e,t),gt(t,t);const n=lt(e);if(pt(n))return gt(n,n);const r=mt();return"system"===n&&r||r?gt(r,"system"):gt("light","light")},e.sanitizeInput=function(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,e=>t[e])},e.setClass=function(e,t){pe(e,t)},e.setCookie=function(e,t,n,r){let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";const i=function(e){let t=!0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(!(33===r||r>=35&&r<=43||r>=45&&r<=58||r>=60&&r<=91||r>=93&&r<=126)){t=!1;break}}return{isEncoded:!t,value:t?e:encodeURIComponent(e)}}(t),s=Re(e),a=i.isEncoded?"1":"",c=i.isEncoded?o:"; expires=Thu, 01 Jan 1970 00:00:00 GMT",u=[`${s}=${i.value}${o}; path=/`,`${Fe(e)}=${a}${c}; path=/`],l=e=>{const t=e?`; domain=${e}`:"";u.forEach(e=>{document.cookie=`${e}${t}`})},f=location.hostname;if(r)l(r);else if(-1===f.indexOf("."))l();else{const n=f.split(".");n.shift();l("."+n.join(".")),Ie(e)!==t&&l(`.${f}`)}},e.setImgSizeBySrc=me,e.setImgWidHeiBySrc=function(){return me()},e.setLanguagePreference=function(e,t){ct(e);const n=yt(t);if(!n)throw new TypeError("language must be a valid language tag.");return ft(e,n)},e.setLocalJSON=xe,e.setLocalStorage=De,e.setSessionJSON=$e,e.setSessionStorage=Me,e.setThemePreference=function(e,t){if(ct(e),!function(e){return"system"===e||pt(e)}(t))throw new TypeError('value must be "system", "light", or "dark".');return ft(e,t)},e.sha256Hex=async function(e){const t="undefined"==typeof crypto?null:crypto;if(!t?.subtle||"function"!=typeof t.subtle.digest)throw new Error("Web Crypto API is not available.");let n=e;if("string"==typeof e){if("undefined"==typeof TextEncoder)throw new Error("TextEncoder is not available.");n=(new TextEncoder).encode(e)}const r=await t.subtle.digest("SHA-256",n);let o="";const i=new Uint8Array(r);for(let e=0;e<i.length;e++){const t=i[e].toString(16);o+=1===t.length?`0${t}`:t}return o},e.show=function(e){return Te(e).forEach(e=>{ye.has(e)?(e.style.display=ye.get(e),ye.delete(e)):"none"===e.style.display&&(e.style.display=""),""===e.style.display&&"none"===Se(e)&&(e.style.display=Ae(e))}),e},e.sleep=async function(e){return V(e)},e.subYears=function(e,n){const r="number"==typeof e?e:"object"==typeof e&&null!==e?t(e):null,o=new Date(r??NaN),i="number"==typeof n?n<0?Math.ceil(n):Math.floor(n):NaN;if(!Number.isFinite(o.getTime())||!Number.isFinite(i))return new Date(NaN);if(0===i)return o;const s=o.getMonth(),a=o.getDate(),c=o.getFullYear()-i,u=new Date(o.getTime());return u.setFullYear(c,s+1,0),a>=u.getDate()?u:(o.setFullYear(c,s,a),o)},e.throttle=function(e,t,n={}){n=Object.assign({},n);let r=null,o=null,i=null,[s,a]=[null,0];const c=function(){a=!1===n.leading?0:u(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(...l){const f=u();a||!1!==n.leading||(a=f);const d=t-(f-a);return r=this,o=l,d<=0||d>t?(i&&(clearTimeout(i),i=null),a=f,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(c.bind(r),d)),s}},e.timeCon=de,e.toJavaScriptGlobalName=N,e.truncateZHString=I,e.unsanitize=function(e){return U(e)},e.unsanitizeInput=U,e.updateQueryParam=function(e,t,n){const r=e.indexOf("#"),o=-1===r?"":e.slice(r),i=-1===r?e:e.slice(0,r),s=i.indexOf("?"),a=-1===s?i:i.slice(0,s),c=-1===s?"":i.slice(s+1),u=encodeURIComponent(t),l=encodeURIComponent(n);let f=!1;const d=(c?c.split("&").filter(Boolean):[]).reduce((e,n)=>{const r=n.indexOf("=");return Q(-1===r?n:n.slice(0,r))===t?f||(e.push(`${u}=${l}`),f=!0):e.push(n),e},[]);return f||d.push(`${u}=${l}`),`${a}?${d.join("&")}${o}`},e.waitTime=V,e.watchServiceWorkerUpdates=function(e,t,n){if(null===e||"object"!=typeof e||"function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)throw new TypeError("registration must support event listeners");if(null===t||"object"!=typeof t||"function"!=typeof t.addEventListener||"function"!=typeof t.removeEventListener)throw new TypeError("container must support event listeners");if(null===n||"object"!=typeof n||"function"!=typeof n.onUpdateAvailable||void 0!==n.onControllerChange&&"function"!=typeof n.onControllerChange)throw new TypeError("callbacks must provide onUpdateAvailable");let r=!1,o=null,i=null,s=!1,a=!1;const c=e=>{r||i===e||(i=e,n.onUpdateAvailable(e))},u=()=>{!r&&"installed"===o?.state&&t.controller&&c(o)},l=()=>{r||(o?.removeEventListener("statechange",u),o=e.installing,o?.addEventListener("statechange",u),u())},f=()=>{r||n.onControllerChange?.()},d=()=>{if(s){try{e.removeEventListener("updatefound",l)}catch(e){}s=!1}try{o?.removeEventListener("statechange",u)}catch(e){}if(a){try{t.removeEventListener("controllerchange",f)}catch(e){}a=!1}};try{e.addEventListener("updatefound",l),s=!0,t.addEventListener("controllerchange",f),a=!0,e.waiting&&t.controller&&c(e.waiting),e.installing&&l()}catch(e){throw r=!0,d(),o=null,i=null,e}return{activateWaiting(e={type:"SKIP_WAITING"}){if(r||!i)return!1;try{return i.postMessage(e),!0}catch(e){return!1}},dispose(){r||(r=!0,d(),o=null,i=null)}}},e.windowLoaded=function(e=3e4){return new Promise((t,n)=>{let r=null;const o=()=>{window.removeEventListener("load",i),null!==r&&(clearTimeout(r),r=null)},i=()=>{o(),t("load")};"complete"!==document.readyState?(window.addEventListener("load",i),r=setTimeout(()=>{o(),n(new Error("timeout"))},e)):t("complete")})},e.zAxiosIsValidRes=function(e,t={validStatusRange:[200,300],validCode:[0]}){const n=t||{},{validStatusRange:r=[200,300],validCode:o=[0]}=n;2!==r.length&&console.error("valid validStatusRange is required");let i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){const t=e.data;t&&o.includes(t.code)&&(i=!0)}return i},e}({});
|