UNPKG

ljs-tools

Version:

ljs-tools和常用插件

1,450 lines (1,449 loc) 380 kB
var so = Object.defineProperty; var lo = (e, n, r) => n in e ? so(e, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[n] = r; var St = (e, n, r) => (lo(e, typeof n != "symbol" ? n + "" : n, r), r); import { getCurrentInstance as He, inject as Be, ref as ie, computed as H, unref as R, shallowRef as Rt, watchEffect as ya, readonly as co, getCurrentScope as uo, onScopeDispose as _a, onMounted as qe, nextTick as Ee, watch as De, isRef as Ca, warn as fo, provide as yn, defineComponent as se, openBlock as $, createElementBlock as V, mergeProps as $t, renderSlot as me, createElementVNode as Y, toRef as n0, onUnmounted as xo, useAttrs as vo, useSlots as Ea, normalizeClass as U, normalizeStyle as pe, createCommentVNode as Q, Fragment as $e, createBlock as re, withCtx as oe, resolveDynamicComponent as ke, withModifiers as Pt, createVNode as ve, toDisplayString as ce, onBeforeUnmount as Nt, Text as po, reactive as Ba, h as ho, markRaw as r0, toRefs as mo, resolveComponent as Se, Transition as _n, withDirectives as y0, withKeys as Wt, createTextVNode as Jt, vShow as _0, isVNode as Da, render as Aa, Teleport as wa, renderList as x0, pushScopeId as Cn, popScopeId as En } from "vue"; const go = () => { ee.colorLog({ content: ["", "******************************************"] }), ee.colorLog({ content: ["Core Dependencies:", "ljs-tools"] }), ee.colorLog({ content: ["Author:", "LJS"] }), ee.colorLog({ content: ["API", "https://ljs-y.github.io/ljs-vue3"], color: [ "background: #666666; color: #fff; border-radius: 4px 0 0 4px; padding: 3px 6px;", "background: #FFF; border: 1px solid #666666; color: #fff; border-radius: 0 4px 4px 0; padding: 2px 6px;" ] }), ee.colorLog({ content: ["", "******************************************"] }); }; function Bn(e) { if (ee.fieldCheck(e)) return null; const n = {}; let r = e.split("?"); if (r.length === 1) return [r[0], n]; const t = r[1].split("&"), a = t.length; for (let i = 0; i < a; i++) { const o = t[i].split("="); n[o[0]] = o[1]; } return [r[0], n]; } function bo(e, n = location.search) { const r = Bn(n); if (r === null) return null; const t = r[1]; return e in t ? t[e] : null; } function yo(e, n = !0) { if (ee.fieldCheck(e)) return null; let r = e.lastIndexOf("."); return r === -1 ? null : (r = n ? r : r + 1, e.slice(r, e.length)); } function _o(e, n = !1) { if (ee.fieldCheck(e)) return null; const r = e.lastIndexOf("/"), t = e.lastIndexOf("\\"); let a = r > t ? r : t; return a !== -1 ? a++ : a = 0, n ? e.slice(a, e.length) : e.lastIndexOf(".") > -1 ? e.slice(a, e.lastIndexOf(".")) : e.slice(a, e.length); } function Fa(e) { var n = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/; return n.test(e); } function Sa(e) { var n = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/gm; return n.test(e); } function Co(e) { return Sa(e) || Fa(e); } function ka(e, n = ["sign"]) { return Object.entries(e).filter(([a, i]) => /* 排除未定义的值 */ i != null && // 排除 null i !== "" && // 排除空字符串 !n.includes(a)).sort(([a], [i]) => a.localeCompare(i, "en-US")).map(([a, i]) => `${a}=${i}`).join("&"); } const Ta = { getUrlAllParameter: Bn, getUrlParameter: bo, getFileType: yo, getFileName: _o, isIPV4ValidIP: Fa, isIPV6ValidIP: Sa, isIPValid: Co, formatParamsByAscii: ka }; function Eo(e) { return e == null || e === ""; } function Ia({ data: e, value: n, key: r = "id", children: t = "children", parents: a = [] }) { const i = e.length; for (let o = 0; o < i; o++) if (e[o][r] === n || e[o][t] !== void 0 && (a = Ia({ data: e[o][t], value: n, key: r, children: t, parents: a }), a.length > 0 && a[a.length - 1][r] === n)) return a.unshift(e[o]), a; return a; } function fn({ data: e, opts: n = [], disabled: r = !1 }) { if (!e) return; const t = e.length; for (let a = 0; a < t; a++) { e[a].disabled = r; let i = !1; const o = n.length; for (let l = 0; l < o; l++) { const c = n[l]; if (e[a][c.key] === c.value) { i = !0; break; } } i ? (e[a].disabled = !0, e[a].children = fn({ data: e[a].children, opts: n, disabled: !0 })) : e[a].children !== void 0 && (e[a].children = fn({ data: e[a].children, opts: n, disabled: r })); } return e; } function Bo(e) { let n = []; if (!e || !e.length) return []; for (let r = 0; r < e.length; r++) { let t = e[r], a = JSON.parse(JSON.stringify(t)); a.children = void 0, n.push(a); const i = this.handleTreeList(t.children); n = n.concat(i); } return n; } function Do({ data: e, id: n = "id", parentId: r = "parentId", children: t = "children" }) { let a = { id: n, parentId: r, childrenList: t }; var i = {}, o = {}, l = []; for (let s of e) { let u = s[a.parentId]; i[u] == null && (i[u] = []), o[s[a.id]] = s, i[u].push(s); } for (let s of e) { let u = s[a.parentId]; o[u] == null && l.push(s); } for (let s of l) c(s); function c(s) { if (i[s[a.id]] !== null && (s[a.childrenList] = i[s[a.id]]), s[a.childrenList]) for (let u of s[a.childrenList]) c(u); } return l; } function Ao(e = 120) { var n = document.documentElement, r = n.clientWidth / e; n.style.fontSize = r + "px"; } function wo({ data: e, value: n, labelKey: r = "dictLabel", valueKey: t = "dictValue", isTrue: a = !1 }) { if (n === void 0) return ""; let i = []; return Object.keys(e).some((o, l) => { if (e[o][t] == "" + n) return r === "$index" ? (i = l, l) : (i.push(e[o][r]), !0); }), r === "$index" ? i : (i.length === 0 && i.push(n), a ? i[0] : i.join("")); } function Fo({ content: e = ["暂无内容"], type: n = "info", color: r = [ "background: #666666; color: #fff; border-radius: 4px 0 0 4px; padding: 3px 6px;", "background: #1475B2; color: #fff; border-radius: 0 4px 4px 0; padding: 3px 6px;" ] }) { let t = ""; e.forEach((a) => { t += `%c${a}`; }), console[n](t, r[0], r[1]); } function So({ _this: e, url: n, name: r = (/* @__PURE__ */ new Date()).valueOf() }) { let t = new Image(); t.setAttribute("crossOrigin", "anonymous"); const a = Bn(n); n = a[0]; let i = {}; a.length === 2 && (i = { ...a[1] }), i._time = (/* @__PURE__ */ new Date()).valueOf(), t.src = n + "?time=" + ka(i), e.$nextTick(() => { t.onload = () => { const o = document.createElement("canvas"); o.width = t.width, o.height = t.height, o.getContext("2d").drawImage(t, 0, 0, t.width, t.height), o.toBlob((c) => { const s = URL.createObjectURL(c), u = document.createElement("a"); u.download = r, u.href = s, u.click(), u.remove(), URL.revokeObjectURL(s); }); }; }); } function ko(e) { return e instanceof Blob || e instanceof File ? new Promise((n, r) => { const t = new FileReader(); t.onloadend = () => n(t.result); try { t.readAsDataURL(e); } catch (a) { r(a); } }) : ""; } function To() { var e = 0, n = window.screen, r = navigator.userAgent.toLowerCase(); return window.devicePixelRatio !== void 0 ? e = window.devicePixelRatio : ~r.indexOf("msie") ? n.deviceXDPI && n.logicalXDPI && (e = n.deviceXDPI / n.logicalXDPI) : window.outerWidth !== void 0 && window.innerWidth !== void 0 && (e = window.outerWidth / window.innerWidth), e && (e = Math.round(e * 100)), e; } function a0(e) { let n = Array.isArray(e) ? [] : {}; for (let r in e) e.hasOwnProperty(r) && (typeof e[r] == "object" && e[r] !== null ? n[r] = a0(e[r]) : n[r] = e[r]); return n; } function Io(e, n) { if (typeof e != "object" || typeof n != "object") return n; const r = a0(e), t = a0(n); for (let a in r) t[a] = r[a]; return t; } const ee = { fieldCheck: Eo, deepCopy: a0, getTreeParents: Ia, editTreeParentIdCheck: fn, handleTreeList: Bo, handleListTree: Do, setRemUnit: Ao, selectDictLabel: wo, colorLog: Fo, downloadImage: So, imageFileToBase64: ko, getWindowRatio: To, objectCopy: Io }; go(); function Po(e) { const n = e.getters.menuList, r = Ma({ menuList: n }), t = Pa({ data: n, value: r.url }); r.address = t, e.commit("SET_menuNowOpen", r), e.commit("SET_menuOpenList", [r]); } function Pa({ data: e, value: n, key: r = "url" }) { const t = ee.getTreeParents({ data: e, value: n, key: r }), a = []; return t.forEach((i) => { const o = { title: i.title, // 菜单名称 url: i.url // 菜单路由path }; a.push(o); }), a; } function Ma({ menuList: e }) { if (e.length === 0) return {}; let n = {}; return e.forEach((r, t) => { t === 0 && (!ee.fieldCheck(r.children) && r.children.length > 0 ? (r.open = !0, n = Ma({ menuList: r.children })) : n = r); }), n; } function Mo({ store: e, path: n }) { const r = e.getters.menuList, t = ee.handleTreeList(r), a = t.length; for (let i = 0; i < a; i++) { const o = t[i]; if (o.url === n) return o; } } function Ro({ store: e, run: n, path: r, query: t = {} }) { const a = Mo({ store: e, path: r }); Ra({ store: e, run: n, menuObj: a, query: t }); } function Ra({ store: e, run: n, menuObj: r, query: t }) { let a = e.getters.menuList; if (ee.fieldCheck(r.children) && (r.children = []), r.children.length > 0) { if (r.open) r.open = !r.open; else { const i = ee.getTreeParents({ data: a, value: r.menuId, key: "menuId" }); Dn({ menuList: a, parents: i }); } e.commit("SET_menuList", a); } else { const i = e.getters.menuNowOpen; let o = e.getters.menuOpenList; if (i.url === r.url) return; r.address = Pa({ data: e.getters.menuList, value: r.url }); let l = r; r.choose = !r.choose, e.commit("SET_menuNowOpen", l); const c = o.length; let s = !1; for (let u = 0; u < c; u++) if (o[u].url === r.url) { s = !0; break; } s || (o = e.getters.menuOpenList, o.push(l), e.commit("SET_menuOpenList", o)), n.push({ path: r.url, query: t }); } } function Dn({ menuList: e, parents: n, key: r = "menuId" }) { return e.forEach((t) => { t[r] === n[0][r] ? (t.open = !0, n.length > 1 && n.splice(0, 1)) : t.open = !1, t.children && t.children.length > 0 && (t.children = Dn({ menuList: t.children, parents: n, key: r })); }), e; } const za = { fristOpenMenu: Po, handPush: Ro, menuControl: Ra, updateTreeOpen: Dn }, Zt = 1e-14; function zo(e, n = 2, r = "0") { if (Ct(e)) { e = e.toString(); const t = e.length, a = n - t; let i = ""; for (let o = 0; o < a; o++) i += r; return i + e; } return e; } function $o(e, n = 4, r = ",") { if (Ct(e)) { e += ""; var t = e.split("."), a = t[0], i = t.length > 1 ? "." + t[1] : ""; const o = new RegExp("(\\d+)(\\d{" + n + "})"); for (; o.test(a); ) a = a.replace(o, "$1" + r + "$2"); return a + i; } return e; } function Lo(e) { if (Ct(e)) { e = Math.ceil(e); const n = (e + "").length, r = Math.pow(10, n - 1); return Math.ceil(e / r) * r; } return e; } function Oo({ value: e, ws: n = 0, units: r = ["", "万", "亿万", "万亿"], isMerge: t = !0 }) { if (Ct(e)) { let a = ""; const i = Number(e) < 0 ? -1 : 1, o = Math.abs(Number(e)); let l = 0; if (o < 1e4) a = i * o, l = 0; else if (o >= 1e4 && o < 1e4 * 1e4) { let c = o / 1e4 + Zt; c = Number(c.toFixed(n)), c < 1e4 ? (a = i * c, l = 1) : (a = i * c / 1e4, l = 2); } else if (o >= 1e4 * 1e4 && o < 1e4 * 1e4 * 1e4) { let c = o / 1e8 + Zt; c = Number(c.toFixed(n)), c < 1e4 ? (a = i * c, l = 2) : (a = i * c / 1e4, l = 3); } else o >= 1e4 * 1e4 * 1e4 && (a = i * (o / (1e4 * 1e4 * 1e4) + Zt).toFixed(n), l = 3); return t ? a + r[l] : { num: a, unit: r[l] }; } return e; } function $a(e, n = 2) { return Ct(e) && (e = e + "", e.indexOf(".") > -1 && e.split(".")[1].length > n) ? (e = Number(e), (e + Zt).toFixed(n)) : e; } function Ct(e) { const n = typeof e; return n === "number" || n === "string" && !isNaN(Number(e, 10)); } function Ho(e, n = 12, r = 2) { e = Number(e); const t = (e / n).toFixed(r), a = []; for (let i = 0; i < n; i++) i < n - 1 ? a.push(t) : a.push($a(e - t * (n - 1), r)); return a; } const ne = { numberB0: zo, longNumText: Oo, numberCeil: Lo, moneySplit: $o, numberChangeDecimal: $a, averageNum: Ho }; function le(e, n) { if (ee.fieldCheck(e)) return e; const r = new Date(e), t = n || "{y}-{m}-{d} {h}:{i}:{s}", a = { y: r.getFullYear(), m: ne.numberB0(r.getMonth() + 1), d: ne.numberB0(r.getDate()), h: ne.numberB0(r.getHours()), i: ne.numberB0(r.getMinutes()), s: ne.numberB0(r.getSeconds()), MS: r.getMilliseconds() }; return t.replace(/{(y|m|d|h|i|s|MS)+}/g, (i, o) => a[o]); } function No(e, n, r = 0) { if (ee.fieldCheck(e)) return e; if (r === 0) { let t = new Date(e).getTime(); return le(t, n); } if (n === "{y}-{m}-{d}") { let t = new Date(e).getTime(); return t = t + 3600 * 1e3 * 24 * r, le(t, n); } else if (n === "{y}-{m}") { const t = r / Math.abs(r); let a = new Date(e), i = ""; const o = a.getMonth() + 1; let l = 0, c = 0; if (t === -1) l = a.getFullYear() + Math.floor((o + r) / 12), c = 12 * Math.abs(l - a.getFullYear()) + o + r, (o + r) % 12 === 0 && (l += t, c = 12); else if (t === 1) if (o + r <= 12) l = a.getFullYear(), c = o + r; else if ((o + r) % 12 !== 0) l = a.getFullYear() + Math.floor((o + r) / 12), c = o + r - Math.abs(l - a.getFullYear()) * 12; else { const s = (o + r) / 12; l = a.getFullYear() + (s > 1 ? s - 1 : s), c = o + r - Math.abs(l - a.getFullYear()) * 12; } return i = l + "-" + ne.numberB0(c), i; } else if (n === "{y}") return (new Date(e).getFullYear() + r).toString(); } function Vo(e, n = 1) { if (e[0] === "" || e[0] === null) return e; const r = new Date(e[0]), t = new Date(e[1]); switch (n === void 0 && (n = 1), n) { case 1: return [ r.getFullYear() + "-" + ne.numberB0(r.getMonth() + 1) + "-" + ne.numberB0(r.getDate()) + " 00:00:00", t.getFullYear() + "-" + ne.numberB0(t.getMonth() + 1) + "-" + ne.numberB0(t.getDate()) + " 23:59:59" ]; case 2: return [ r.getFullYear() + "-" + ne.numberB0(r.getMonth() + 1) + "-" + ne.numberB0(r.getDate()) + " " + ne.numberB0(r.getHours()) + ":00:00", t.getFullYear() + "-" + ne.numberB0(t.getMonth() + 1) + "-" + ne.numberB0(t.getDate()) + " " + ne.numberB0(t.getHours()) + ":59:59" ]; case 3: return [ r.getFullYear() + "-" + ne.numberB0(r.getMonth() + 1) + "-" + ne.numberB0(r.getDate()) + " " + ne.numberB0(r.getHours()) + ":" + ne.numberB0(r.getMinutes()) + ":00", t.getFullYear() + "-" + ne.numberB0(t.getMonth() + 1) + "-" + ne.numberB0(t.getDate()) + " " + ne.numberB0(t.getHours()) + ":" + ne.numberB0(t.getMinutes()) + ":59" ]; } return e; } function qo({ time: e = 0, showTag: n = ["天", "小时", "分钟", "秒", "毫秒"], showAll: r = !1, onlyTime: t = !1 }) { let a = 1; e < 0 && (a = -1), e = Math.abs(e); const i = 1e3, o = 60 * i, l = 60 * o, c = 24 * l, s = [0, 0, 0, 0, 0]; if (e >= c) { const f = Math.floor(e / c); s[0] = a * f, e -= c * f; } if (e >= l) { const f = Math.floor(e / l); s[1] = a * f, e -= l * f; } if (e >= o) { const f = Math.floor(e / o); s[2] = a * f, e -= o * f; } if (e >= i) { const f = Math.floor(e / i); s[3] = a * f, e -= i * f; } if (s[4] = a * e, t) return s; let u = r, m = ""; return s.forEach((f, h) => { !u && f !== 0 && (u = !0), u && (m += f + n[h]); }), m; } function Wo(e = 10, n = !1) { let r = "", t = "", a = "{y}-{m}-{d}"; return n && (a = "{y}-{m}-{d} {h}:{i}:{s}"), r = le((/* @__PURE__ */ new Date()).getTime() - 3600 * 1e3 * 24 * (e - 1), a), t = le(/* @__PURE__ */ new Date(), a), [r, t]; } function Yo(e = /* @__PURE__ */ new Date(), n = "date", r = 0, t = 5) { e = new Date(e); let a = "", i = ""; const o = 3600 * 1e3 * 24; switch (n) { case "datetime": a = le(e, "{y}-{m}-{d} 00:00:00"), i = le(e, "{y}-{m}-{d} {h}:{i}:{s}"); break; case "date": let l = `${le(e, "{y}")}-${le(e, "{y}")}`; e.getMonth() === 11 ? l = `${Number(le(e, "{y}")) + 1}-01-01` : l = `${Number(le(e, "{y}"))}-${Number(le(e, "{m}")) + 1}-01`; const c = new Date(l).getTime() - o; a = le(e, "{y}-{m}-01"), c < Date.now() ? i = le(c, "{y}-{m}-{d}") : i = le(e, "{y}-{m}-{d}"); break; case "month": let s = `${le(e, "{y}")}-12`; a = le(e, "{y}-01"), new Date(s).getTime() < Date.now() ? i = le(s, "{y}-{m}") : i = le(e, "{y}-{m}"); break; case "year": a = e.getFullYear() - t, i = e.getFullYear(); break; } return [a, i]; } const de = { formatTime: le, customizedDate: No, dateQjChange: Vo, timeRunDistance: qo, initSearchDate: Wo, initSearchDateQj: Yo }; function Uo({ form: e, key: n = "money", zs: r = 10, ws: t = 2, type: a = "Number", fu: i = !1 }) { const o = e; o[n] = o[n] + "", a === "Number" && (o[n].slice(0, 1) === "0" && (o[n] = o[n].slice(1, 2) !== "." ? "0" : o[n]), o[n].slice(0, 1) === "-" && (o[n] = o[n].slice(1, 2) === "." ? "-" : o[n]), o[n].slice(0, 2) === "-0" && (o[n] = o[n].slice(2, 3) !== "." ? "-0" : o[n])), i ? o[n] = o[n].replace(/[^\d.-]/g, "") : o[n] = o[n].replace(/[^\d.]/g, ""), o[n] = o[n].replace(/^\./g, ""), o[n] = o[n].replace(/\.{2,}/g, "."), o[n] = o[n].slice(0, 1) + o[n].slice(1, o[n].length).replace(/\-/g, ""); const l = new RegExp("^(\\-)*(\\d+)\\.(\\d{0," + t + "}).*$"); if (r !== "" && o[n].length > 0) { const c = o[n].split("."); let s = c[0], u = ""; const m = s.slice(0, 1) === "-" ? 1 : 0; s.length > r + m && (s = s.slice(0, r + m)), c.length > 1 ? (u = c[1], o[n] = s + "." + u) : o[n] = s; } o[n] = o[n].replace(l, "$1$2.$3"); } function Ko({ form: e, key: n = "num", type: r = "Number", fu: t = !1 }) { r === "Number" && (t ? e[n] = e[n].slice(0, 1) + e[n].slice(1, e[n].length).replace(/\-/g, "") : e[n].slice(0, 1) === "-" && (e[n] = e[n].slice(1, e[n].length))), e[n] = e[n].replace(/[^\d-]/g, ""), r === "Number" && e[n].length > 0 && e[n] !== "-" && (e[n] = Number(e[n])); } function jo({ form: e, key: n = "num" }) { if (!Ct(e[n])) { e[n] = ""; return; } if (e[n] === "0." || e[n] === "-0.") { e[n] = ""; return; } if (e[n] === "-0") { e[n] = "0"; return; } } function Go(e, n = "username") { e[n] = e[n] + "", e[n] = e[n].replace(/[^\w]/g, ""), e[n] = e[n].replace(/\_/g, ""); } function Xo(e, n) { const r = document.createElement("a"), t = new Blob([e], { type: "application/vnd.ms-excel" }); r.style.display = "none", r.href = URL.createObjectURL(t), r.setAttribute("download", n), document.body.appendChild(r), r.click(), document.body.removeChild(r); } function Jo(e = {}) { const n = { dateType: "3", direction: 1, span: 0, dateTypeKeyValue: ["1", "2", "3", "4"] }; for (let o in e) n[o] = e[o]; const r = 3600 * 1e3 * 24; let t = null, a = null, i = 0; switch (n.dateType) { case n.dateTypeKeyValue[3]: i += 1e3 * n.span; break; case n.dateTypeKeyValue[2]: i += r * n.span; break; case n.dateTypeKeyValue[1]: t = new Date(i).getFullYear(), a = new Date(i).getMonth() + 1 + n.span, a < 0 ? (t += n.span, a = 12) : a += 1, i = (/* @__PURE__ */ new Date(`${t}-${a}`)).getTime(); break; case n.dateTypeKeyValue[0]: t = new Date(i).getFullYear(), t += n.span, i = (/* @__PURE__ */ new Date(`${t}-01`)).getTime(); break; } return (o) => { if (n.direction === 1) return o.getTime() > i + Date.now(); if (n.direction === -1) return o.getTime() < i + Date.now(); }; } let mt = 0; function Zo(e = 30, n) { n ? mt = de.formatTime(n[0], "{y}-{m}-{d}") : mt = 0; const r = 3600 * 1e3 * 24 * e; return (t) => { if (mt === 0) return t.getTime() > Date.now() || t.getTime() < mt; { const a = new Date(mt).getTime() + r - 864e5, i = new Date(mt).getTime() - r; return a >= Date.now() ? t.getTime() > Date.now() || t.getTime() < i : t.getTime() > a || t.getTime() < i; } }; } const v0 = { numCheck: Ko, numBlurCheck: jo, numEnCheck: Go, numDxsCheck: Uo, downloadBlobData: Xo, pickerOptions: Jo, pickerOptionsDynamic: Zo }; function Qo(e, n = { name: "name", key: "val" }) { if (e.length === 0) return e; const r = { name: "name", key: "val" }; for (let i in n) r[i] = n[i]; let t = 0; if (e.forEach((i) => { i.proportion = 0, t += Number(i[r.key]); }), t > 0) { let i = { value: 0, index: -1 }; e.forEach((o, l) => { o[r.key] = o[r.key] == 0 ? null : o[r.key]; const c = ne.numberChangeDecimal(Number(o[r.key]) / t * 100), s = Number(c); Number(i.value) < s && (i = { value: c, index: l }), o.proportion = s === 0 && Number(o[r.key]) > 0 ? 0.01 : s; }), e[i.index].proportion = 100, e.forEach((o, l) => { l !== i.index && (e[i.index].proportion = ne.numberChangeDecimal(e[i.index].proportion - Number(o.proportion))); }); } const a = []; return e.forEach((i) => { a.push({ name: i[r.name], value: i[r.key], proportion: i.proportion + "%" }); }), a; } const La = { pieChange: Qo }; var j = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function es(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } function ts(e) { if (e.__esModule) return e; var n = e.default; if (typeof n == "function") { var r = function t() { return this instanceof t ? Reflect.construct(n, arguments, this.constructor) : n.apply(this, arguments); }; r.prototype = n.prototype; } else r = {}; return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(t) { var a = Object.getOwnPropertyDescriptor(e, t); Object.defineProperty(r, t, a.get ? a : { enumerable: !0, get: function() { return e[t]; } }); }), r; } var Oa = { exports: {} }; function ns(e) { throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } var C0 = { exports: {} }; const rs = {}, as = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: rs }, Symbol.toStringTag, { value: "Module" })), is = /* @__PURE__ */ ts(as); var er; function X() { return er || (er = 1, function(e, n) { (function(r, t) { e.exports = t(); })(j, function() { var r = r || function(t, a) { var i; if (typeof window < "u" && window.crypto && (i = window.crypto), typeof self < "u" && self.crypto && (i = self.crypto), typeof globalThis < "u" && globalThis.crypto && (i = globalThis.crypto), !i && typeof window < "u" && window.msCrypto && (i = window.msCrypto), !i && typeof j < "u" && j.crypto && (i = j.crypto), !i && typeof ns == "function") try { i = is; } catch { } var o = function() { if (i) { if (typeof i.getRandomValues == "function") try { return i.getRandomValues(new Uint32Array(1))[0]; } catch { } if (typeof i.randomBytes == "function") try { return i.randomBytes(4).readInt32LE(); } catch { } } throw new Error("Native crypto module could not be used to get secure random number."); }, l = Object.create || function() { function p() { } return function(g) { var b; return p.prototype = g, b = new p(), p.prototype = null, b; }; }(), c = {}, s = c.lib = {}, u = s.Base = function() { return { /** * Creates a new object that inherits from this object. * * @param {Object} overrides Properties to copy into the new object. * * @return {Object} The new object. * * @static * * @example * * var MyType = CryptoJS.lib.Base.extend({ * field: 'value', * * method: function () { * } * }); */ extend: function(p) { var g = l(this); return p && g.mixIn(p), (!g.hasOwnProperty("init") || this.init === g.init) && (g.init = function() { g.$super.init.apply(this, arguments); }), g.init.prototype = g, g.$super = this, g; }, /** * Extends this object and runs the init method. * Arguments to create() will be passed to init(). * * @return {Object} The new object. * * @static * * @example * * var instance = MyType.create(); */ create: function() { var p = this.extend(); return p.init.apply(p, arguments), p; }, /** * Initializes a newly created object. * Override this method to add some logic when your objects are created. * * @example * * var MyType = CryptoJS.lib.Base.extend({ * init: function () { * // ... * } * }); */ init: function() { }, /** * Copies properties into this object. * * @param {Object} properties The properties to mix in. * * @example * * MyType.mixIn({ * field: 'value' * }); */ mixIn: function(p) { for (var g in p) p.hasOwnProperty(g) && (this[g] = p[g]); p.hasOwnProperty("toString") && (this.toString = p.toString); }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = instance.clone(); */ clone: function() { return this.init.prototype.extend(this); } }; }(), m = s.WordArray = u.extend({ /** * Initializes a newly created word array. * * @param {Array} words (Optional) An array of 32-bit words. * @param {number} sigBytes (Optional) The number of significant bytes in the words. * * @example * * var wordArray = CryptoJS.lib.WordArray.create(); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); */ init: function(p, g) { p = this.words = p || [], g != a ? this.sigBytes = g : this.sigBytes = p.length * 4; }, /** * Converts this word array to a string. * * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex * * @return {string} The stringified word array. * * @example * * var string = wordArray + ''; * var string = wordArray.toString(); * var string = wordArray.toString(CryptoJS.enc.Utf8); */ toString: function(p) { return (p || h).stringify(this); }, /** * Concatenates a word array to this word array. * * @param {WordArray} wordArray The word array to append. * * @return {WordArray} This word array. * * @example * * wordArray1.concat(wordArray2); */ concat: function(p) { var g = this.words, b = p.words, E = this.sigBytes, C = p.sigBytes; if (this.clamp(), E % 4) for (var B = 0; B < C; B++) { var w = b[B >>> 2] >>> 24 - B % 4 * 8 & 255; g[E + B >>> 2] |= w << 24 - (E + B) % 4 * 8; } else for (var P = 0; P < C; P += 4) g[E + P >>> 2] = b[P >>> 2]; return this.sigBytes += C, this; }, /** * Removes insignificant bits. * * @example * * wordArray.clamp(); */ clamp: function() { var p = this.words, g = this.sigBytes; p[g >>> 2] &= 4294967295 << 32 - g % 4 * 8, p.length = t.ceil(g / 4); }, /** * Creates a copy of this word array. * * @return {WordArray} The clone. * * @example * * var clone = wordArray.clone(); */ clone: function() { var p = u.clone.call(this); return p.words = this.words.slice(0), p; }, /** * Creates a word array filled with random bytes. * * @param {number} nBytes The number of random bytes to generate. * * @return {WordArray} The random word array. * * @static * * @example * * var wordArray = CryptoJS.lib.WordArray.random(16); */ random: function(p) { for (var g = [], b = 0; b < p; b += 4) g.push(o()); return new m.init(g, p); } }), f = c.enc = {}, h = f.Hex = { /** * Converts a word array to a hex string. * * @param {WordArray} wordArray The word array. * * @return {string} The hex string. * * @static * * @example * * var hexString = CryptoJS.enc.Hex.stringify(wordArray); */ stringify: function(p) { for (var g = p.words, b = p.sigBytes, E = [], C = 0; C < b; C++) { var B = g[C >>> 2] >>> 24 - C % 4 * 8 & 255; E.push((B >>> 4).toString(16)), E.push((B & 15).toString(16)); } return E.join(""); }, /** * Converts a hex string to a word array. * * @param {string} hexStr The hex string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Hex.parse(hexString); */ parse: function(p) { for (var g = p.length, b = [], E = 0; E < g; E += 2) b[E >>> 3] |= parseInt(p.substr(E, 2), 16) << 24 - E % 8 * 4; return new m.init(b, g / 2); } }, d = f.Latin1 = { /** * Converts a word array to a Latin1 string. * * @param {WordArray} wordArray The word array. * * @return {string} The Latin1 string. * * @static * * @example * * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); */ stringify: function(p) { for (var g = p.words, b = p.sigBytes, E = [], C = 0; C < b; C++) { var B = g[C >>> 2] >>> 24 - C % 4 * 8 & 255; E.push(String.fromCharCode(B)); } return E.join(""); }, /** * Converts a Latin1 string to a word array. * * @param {string} latin1Str The Latin1 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); */ parse: function(p) { for (var g = p.length, b = [], E = 0; E < g; E++) b[E >>> 2] |= (p.charCodeAt(E) & 255) << 24 - E % 4 * 8; return new m.init(b, g); } }, x = f.Utf8 = { /** * Converts a word array to a UTF-8 string. * * @param {WordArray} wordArray The word array. * * @return {string} The UTF-8 string. * * @static * * @example * * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); */ stringify: function(p) { try { return decodeURIComponent(escape(d.stringify(p))); } catch { throw new Error("Malformed UTF-8 data"); } }, /** * Converts a UTF-8 string to a word array. * * @param {string} utf8Str The UTF-8 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); */ parse: function(p) { return d.parse(unescape(encodeURIComponent(p))); } }, v = s.BufferedBlockAlgorithm = u.extend({ /** * Resets this block algorithm's data buffer to its initial state. * * @example * * bufferedBlockAlgorithm.reset(); */ reset: function() { this._data = new m.init(), this._nDataBytes = 0; }, /** * Adds new data to this block algorithm's buffer. * * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. * * @example * * bufferedBlockAlgorithm._append('data'); * bufferedBlockAlgorithm._append(wordArray); */ _append: function(p) { typeof p == "string" && (p = x.parse(p)), this._data.concat(p), this._nDataBytes += p.sigBytes; }, /** * Processes available data blocks. * * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. * * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. * * @return {WordArray} The processed data. * * @example * * var processedData = bufferedBlockAlgorithm._process(); * var processedData = bufferedBlockAlgorithm._process(!!'flush'); */ _process: function(p) { var g, b = this._data, E = b.words, C = b.sigBytes, B = this.blockSize, w = B * 4, P = C / w; p ? P = t.ceil(P) : P = t.max((P | 0) - this._minBufferSize, 0); var _ = P * B, A = t.min(_ * 4, C); if (_) { for (var F = 0; F < _; F += B) this._doProcessBlock(E, F); g = E.splice(0, _), b.sigBytes -= A; } return new m.init(g, A); }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = bufferedBlockAlgorithm.clone(); */ clone: function() { var p = u.clone.call(this); return p._data = this._data.clone(), p; }, _minBufferSize: 0 }); s.Hasher = v.extend({ /** * Configuration options. */ cfg: u.extend(), /** * Initializes a newly created hasher. * * @param {Object} cfg (Optional) The configuration options to use for this hash computation. * * @example * * var hasher = CryptoJS.algo.SHA256.create(); */ init: function(p) { this.cfg = this.cfg.extend(p), this.reset(); }, /** * Resets this hasher to its initial state. * * @example * * hasher.reset(); */ reset: function() { v.reset.call(this), this._doReset(); }, /** * Updates this hasher with a message. * * @param {WordArray|string} messageUpdate The message to append. * * @return {Hasher} This hasher. * * @example * * hasher.update('message'); * hasher.update(wordArray); */ update: function(p) { return this._append(p), this._process(), this; }, /** * Finalizes the hash computation. * Note that the finalize operation is effectively a destructive, read-once operation. * * @param {WordArray|string} messageUpdate (Optional) A final message update. * * @return {WordArray} The hash. * * @example * * var hash = hasher.finalize(); * var hash = hasher.finalize('message'); * var hash = hasher.finalize(wordArray); */ finalize: function(p) { p && this._append(p); var g = this._doFinalize(); return g; }, blockSize: 16, /** * Creates a shortcut function to a hasher's object interface. * * @param {Hasher} hasher The hasher to create a helper for. * * @return {Function} The shortcut function. * * @static * * @example * * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); */ _createHelper: function(p) { return function(g, b) { return new p.init(b).finalize(g); }; }, /** * Creates a shortcut function to the HMAC's object interface. * * @param {Hasher} hasher The hasher to use in this HMAC helper. * * @return {Function} The shortcut function. * * @static * * @example * * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); */ _createHmacHelper: function(p) { return function(g, b) { return new y.HMAC.init(p, b).finalize(g); }; } }); var y = c.algo = {}; return c; }(Math); return r; }); }(C0)), C0.exports; } var E0 = { exports: {} }, tr; function p0() { return tr || (tr = 1, function(e, n) { (function(r, t) { e.exports = t(X()); })(j, function(r) { return function(t) { var a = r, i = a.lib, o = i.Base, l = i.WordArray, c = a.x64 = {}; c.Word = o.extend({ /** * Initializes a newly created 64-bit word. * * @param {number} high The high 32 bits. * @param {number} low The low 32 bits. * * @example * * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); */ init: function(s, u) { this.high = s, this.low = u; } /** * Bitwise NOTs this word. * * @return {X64Word} A new x64-Word object after negating. * * @example * * var negated = x64Word.not(); */ // not: function () { // var high = ~this.high; // var low = ~this.low; // return X64Word.create(high, low); // }, /** * Bitwise ANDs this word with the passed word. * * @param {X64Word} word The x64-Word to AND with this word. * * @return {X64Word} A new x64-Word object after ANDing. * * @example * * var anded = x64Word.and(anotherX64Word); */ // and: function (word) { // var high = this.high & word.high; // var low = this.low & word.low; // return X64Word.create(high, low); // }, /** * Bitwise ORs this word with the passed word. * * @param {X64Word} word The x64-Word to OR with this word. * * @return {X64Word} A new x64-Word object after ORing. * * @example * * var ored = x64Word.or(anotherX64Word); */ // or: function (word) { // var high = this.high | word.high; // var low = this.low | word.low; // return X64Word.create(high, low); // }, /** * Bitwise XORs this word with the passed word. * * @param {X64Word} word The x64-Word to XOR with this word. * * @return {X64Word} A new x64-Word object after XORing. * * @example * * var xored = x64Word.xor(anotherX64Word); */ // xor: function (word) { // var high = this.high ^ word.high; // var low = this.low ^ word.low; // return X64Word.create(high, low); // }, /** * Shifts this word n bits to the left. * * @param {number} n The number of bits to shift. * * @return {X64Word} A new x64-Word object after shifting. * * @example * * var shifted = x64Word.shiftL(25); */ // shiftL: function (n) { // if (n < 32) { // var high = (this.high << n) | (this.low >>> (32 - n)); // var low = this.low << n; // } else { // var high = this.low << (n - 32); // var low = 0; // } // return X64Word.create(high, low); // }, /** * Shifts this word n bits to the right. * * @param {number} n The number of bits to shift. * * @return {X64Word} A new x64-Word object after shifting. * * @example * * var shifted = x64Word.shiftR(7); */ // shiftR: function (n) { // if (n < 32) { // var low = (this.low >>> n) | (this.high << (32 - n)); // var high = this.high >>> n; // } else { // var low = this.high >>> (n - 32); // var high = 0; // } // return X64Word.create(high, low); // }, /** * Rotates this word n bits to the left. * * @param {number} n The number of bits to rotate. * * @return {X64Word} A new x64-Word object after rotating. * * @example * * var rotated = x64Word.rotL(25); */ // rotL: function (n) { // return this.shiftL(n).or(this.shiftR(64 - n)); // }, /** * Rotates this word n bits to the right. * * @param {number} n The number of bits to rotate. * * @return {X64Word} A new x64-Word object after rotating. * * @example * * var rotated = x64Word.rotR(7); */ // rotR: function (n) { // return this.shiftR(n).or(this.shiftL(64 - n)); // }, /** * Adds this word with the passed word. * * @param {X64Word} word The x64-Word to add with this word. * * @return {X64Word} A new x64-Word object after adding. * * @example * * var added = x64Word.add(anotherX64Word); */ // add: function (word) { // var low = (this.low + word.low) | 0; // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; // var high = (this.high + word.high + carry) | 0; // return X64Word.create(high, low); // } }), c.WordArray = o.extend({ /** * Initializes a newly created word array. * * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. * @param {number} sigBytes (Optional) The number of significant bytes in the words. * * @example * * var wordArray = CryptoJS.x64.WordArray.create(); * * var wordArray = CryptoJS.x64.WordArray.create([ * CryptoJS.x64.Word.create(0x00010203, 0x04050607), * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) * ]); * * var wordArray = CryptoJS.x64.WordArray.create([ * CryptoJS.x64.Word.create(0x00010203, 0x04050607), * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) * ], 10); */ init: function(s, u) { s = this.words = s || [], u != t ? this.sigBytes = u : this.sigBytes = s.length * 8; }, /** * Converts this 64-bit word array to a 32-bit word array. * * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. * * @example * * var x32WordArray = x64WordArray.toX32(); */ toX32: function() { for (var s = this.words, u = s.length, m = [], f = 0; f < u; f++) { var h = s[f]; m.push(h.high), m.push(h.low); } return l.create(m, this.sigBytes); }, /** * Creates a copy of this word array. * * @return {X64WordArray} The clone. * * @example * * var clone = x64WordArray.clone(); */ clone: function() { for (var s = o.clone.call(this), u = s.words = this.words.slice(0), m = u.length, f = 0; f < m; f++) u[f] = u[f].clone(); return s; } }); }(), r; }); }(E0)), E0.exports; } var B0 = { exports: {} }, nr; function os() { return nr || (nr = 1, function(e, n) { (function(r, t) { e.exports = t(X()); })(j, function(r) { return function() { if (typeof ArrayBuffer == "function") { var t = r, a = t.lib, i = a.WordArray, o = i.init, l = i.init = function(c) { if (c instanceof ArrayBuffer && (c = new Uint8Array(c)), (c instanceof Int8Array || typeof Uint8ClampedArray < "u" && c instanceof Uint8ClampedArray || c instanceof Int16Array || c instanceof Uint16Array || c instanceof Int32Array || c instanceof Uint32Array || c instanceof Float32Array || c instanceof Float64Array) && (c = new Uint8Array(c.buffer, c.byteOffset, c.byteLength)), c instanceof Uint8Array) { for (var s = c.byteLength, u = [], m = 0; m < s; m++) u[m >>> 2] |= c[m] << 24 - m % 4 * 8; o.call(this, u, s); } else o.apply(this, arguments); }; l.prototype = i; } }(), r.lib.WordArray; }); }(B0)), B0.exports; } var D0 = { exports: {} }, rr; function ss() { return rr || (rr = 1, function(e, n) { (function(r, t) { e.exports = t(X()); })(j, function(r) { return function() { var t = r, a = t.lib, i = a.WordArray, o = t.enc; o.Utf16 = o.Utf16BE = { /** * Converts a word array to a UTF-16 BE string. * * @param {WordArray} wordArray The word array. *