@pubinfo/core 2.1.10-beta.2 → 2.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AppSetting-Dl8pVkN4.js → AppSetting-7jlhUzze.js} +42 -42
- package/dist/{HButton-CzYSwI6a.js → HButton-Dt6qGhhR.js} +7 -7
- package/dist/{HCheckList-CHR-lWIq.js → HCheckList-cPBgATmv.js} +15 -15
- package/dist/{HDivider-CXS9rl4C.js → HDivider-BwvBr5OE.js} +3 -3
- package/dist/{HInput-CSVwTg1Q.js → HInput-KJ5nFBpF.js} +10 -10
- package/dist/HSlideover-DVQDc9q6.js +3151 -0
- package/dist/{HToggle-C_iVIpxv.js → HToggle-Ce_2-yhZ.js} +8 -8
- package/dist/{HTooltip-BHBHfrCD.js → HTooltip-DjAU-Evn.js} +6 -6
- package/dist/PreferencesContent-BAIH81yS.js +701 -0
- package/dist/SettingBreadcrumb-O9-PhAFT.js +45 -0
- package/dist/SettingCopyright-DIKsWTuf.js +45 -0
- package/dist/{SettingEnableTransition-BBH52KKl.js → SettingEnableTransition-61O7W00b.js} +19 -19
- package/dist/SettingHome-Sv65TPH8.js +31 -0
- package/dist/SettingMenu-BvwJOUZV.js +111 -0
- package/dist/{SettingMode-BwhhUYlz.js → SettingMode-B8H_eQc8.js} +14 -14
- package/dist/SettingNavSearch-BHsmYBA7.js +31 -0
- package/dist/SettingOther-CyyNnaDX.js +48 -0
- package/dist/SettingPage-B82lW41P.js +22 -0
- package/dist/{SettingTabbar-DuqQVRnz.js → SettingTabbar-Bky2xvH-.js} +58 -58
- package/dist/{SettingThemes-Doo6Ax3u.js → SettingThemes-CkdzS1xt.js} +44 -44
- package/dist/SettingToolbar-CD4qns1J.js +50 -0
- package/dist/SettingTopbar-1shjoe3s.js +49 -0
- package/dist/{SettingWidthMode-VaN0CrBa.js → SettingWidthMode-DlG6lXjA.js} +14 -14
- package/dist/auth-BLGKOyc5.js +4432 -0
- package/dist/built-in/layout-component/composables/useContext.d.ts +1 -0
- package/dist/{change-organization-OjxZhWST.js → change-organization-hsqeSzDu.js} +38 -38
- package/dist/{change-password-B6kO54-d.js → change-password-EtccCDRX.js} +73 -73
- package/dist/{chunk-EsrJ1IKw.js → chunk-CD4vhpVs.js} +3 -3
- package/dist/{components-DVIyiEVI.js → components-DFNyaAb9.js} +1584 -1584
- package/dist/core/request.d.ts +1 -1
- package/dist/core-DJIGzMMM.js +4885 -0
- package/dist/dist-7OjQvlya.js +468 -0
- package/dist/engine-oniguruma-CaNXwGSv.js +243 -0
- package/dist/features/settings/index.d.ts +90 -1
- package/dist/{form-EQ9eL9hv.js → form-C3VHofnN.js} +923 -443
- package/dist/index.js +4418 -3895
- package/dist/{modal-CSWipFvB.js → modal-Bl5xHbxa.js} +15510 -15790
- package/dist/{not-found-DBe-djEg.js → not-found-BCjngLzt.js} +19 -19
- package/dist/{not-permission-DQzWCpOK.js → not-permission-C26vTMvf.js} +19 -19
- package/dist/{profile-DJ3gpjsS.js → profile-BVXIFuBG.js} +3340 -3277
- package/dist/{question-line-BKVlJGUb.js → question-line-BG__Ycfv.js} +2 -2
- package/dist/{reload-DAR8dVYw.js → reload-DHx5Vwus.js} +4 -4
- package/dist/{right-VKgVtqD5.js → right-BxBlFUwj.js} +6 -6
- package/dist/style.css +1 -1
- package/dist/{tree-select-CTjWj5WT.js → tree-select-B8cTcGLa.js} +2575 -2256
- package/dist/watchDiff-CPZFtaOC.js +655 -0
- package/package.json +41 -41
- package/src/built-in/layout-component/components/Header/HeaderMenu.vue +2 -3
- package/src/built-in/layout-component/components/Menu/item.vue +2 -2
- package/src/built-in/layout-component/components/Menu/sub.vue +20 -1
- package/src/built-in/layout-component/composables/useContext.ts +1 -0
- package/src/built-in/layout-component/composables/useLayoutVisible.ts +1 -1
- package/src/built-in/layout-component/provider.ts +5 -0
- package/src/built-in/system-info/components/SystemInfo.vue +68 -66
- package/src/built-in/system-info/index.ts +4 -4
- package/src/core/ctx.ts +2 -2
- package/src/core/request.ts +1 -1
- package/src/features/components/PubinfoApp/index.vue +1 -0
- package/types/auto-imports.d.ts +63 -63
- package/types/components.d.ts +45 -1
- package/dist/HSlideover-Bc6OHPHe.js +0 -1695
- package/dist/HeaderFullMenu-BRhGliRJ.js +0 -6
- package/dist/HeaderFullMenu-DCF-gTCZ.js +0 -249
- package/dist/HeaderThinMenu-B_7vLcQX.js +0 -6
- package/dist/HeaderThinMenu-PA12XAvb.js +0 -437
- package/dist/PreferencesContent-cll4nwwl.js +0 -695
- package/dist/SettingBreadcrumb-BvSc7VUo.js +0 -45
- package/dist/SettingCopyright-DcWLKM5d.js +0 -45
- package/dist/SettingHome-Cd43oJmB.js +0 -31
- package/dist/SettingMenu-CJsN4F1l.js +0 -111
- package/dist/SettingNavSearch-BhHUWem3.js +0 -31
- package/dist/SettingOther-CDY0jSVT.js +0 -48
- package/dist/SettingPage-B0WNvUlj.js +0 -22
- package/dist/SettingToolbar-CHV_dVJ9.js +0 -50
- package/dist/SettingTopbar-CF1K_XIt.js +0 -49
- package/dist/auth-CPSkJwBz.js +0 -3968
- package/dist/core-Bg2PEcZK.js +0 -4884
- package/dist/dist-DAb-7mqe.js +0 -468
- package/dist/engine-oniguruma-CUfGsBrF.js +0 -243
- package/dist/overlayscrollbars-vue-BOGU2FK-.js +0 -1436
- package/dist/pick-C42gkI1h.js +0 -10
- package/dist/watchDiff-C4eGkl9e.js +0 -397
- /package/dist/{_plugin-vue_export-helper-DaPiLSxE.js → _plugin-vue_export-helper-sUTDUeGO.js} +0 -0
- /package/dist/{json-S7wVLDnW.js → json-Bu_Zprin.js} +0 -0
- /package/dist/{useContext-D6pJCZez.js → useContext-DLtu9F7E.js} +0 -0
- /package/dist/{vitesse-dark-BsnBIHGG.js → vitesse-dark-CTe40QT_.js} +0 -0
- /package/dist/{vitesse-light-Cs_6DF7j.js → vitesse-light-BWXC_WeB.js} +0 -0
- /package/dist/{wasm-EvDQvzqp.js → wasm-2zDVqo-C.js} +0 -0
package/dist/auth-CPSkJwBz.js
DELETED
|
@@ -1,3968 +0,0 @@
|
|
|
1
|
-
import { r as __toESM, t as __commonJSMin } from "./chunk-EsrJ1IKw.js";
|
|
2
|
-
import { $r as eq_default, Dr as _baseIsEqual_default, Er as isEmpty_default, Gr as isTypedArray_default, Jr as isBuffer_default, Rr as _Stack_default, Ur as keys_default, Yr as isArguments_default, Zr as isArrayLike_default, _r as setupDefaultLayout, ai as isObjectLike_default, di as getPersistedState, ei as _isIndex_default, gr as setupPage, ii as isArray_default, ni as isFunction_default, oi as _baseGetTag_default, ri as isObject_default, t as modal_default, ui as createContext, wn as FrownOutlined_default, wr as callHookAsync, zr as isPlainObject_default } from "./modal-CSWipFvB.js";
|
|
3
|
-
import { C as _copyArray_default, D as isSymbol_default, E as _arrayMap_default, S as _setToString_default, T as identity_default, _ as _isKey_default, a as _hasPath_default, b as _copyObject_default, c as _initCloneObject_default, d as _cloneBuffer_default, f as _flatRest_default, g as toString_default, h as _castPath_default, i as hasIn_default, l as _cloneTypedArray_default, m as _toKey_default, n as _basePickBy_default, o as cloneDeep_default, p as _baseGet_default, r as _baseSet_default, s as _baseClone_default, t as watchDiffObject, u as _getAllKeysIn_default, v as keysIn_default, w as _apply_default, x as _baseAssignValue_default, y as _overRest_default } from "./watchDiff-C4eGkl9e.js";
|
|
4
|
-
import { f as useToggle, s as usePreferredDark, t as computedAsync } from "./dist-DAb-7mqe.js";
|
|
5
|
-
import { defineStore } from "pinia";
|
|
6
|
-
import { computed, createVNode, reactive, ref, toRaw, watch } from "vue";
|
|
7
|
-
import { useRoute } from "vue-router";
|
|
8
|
-
import Message from "vue-m-message";
|
|
9
|
-
var ctx = createContext("ctx", { stateKey: "state" });
|
|
10
|
-
function createPubinfoContext(e) {
|
|
11
|
-
ctx.set(e), ctx.use();
|
|
12
|
-
}
|
|
13
|
-
function usePubinfoContext() {
|
|
14
|
-
return ctx.use();
|
|
15
|
-
}
|
|
16
|
-
let STORE_NAME = /* @__PURE__ */ function(e) {
|
|
17
|
-
return e.FAVORITES = "favorites", e.IFRAME = "iframe", e.KEEP_ALIVE = "keepAlive", e.MENU = "menu", e.NOTIFICATION = "notification", e.ROUTE = "route", e.SETTINGS = "settings", e.TABBAR = "tabbar", e.USER = "user", e;
|
|
18
|
-
}({});
|
|
19
|
-
var favorites_default = defineStore(STORE_NAME.FAVORITES, () => {
|
|
20
|
-
let e = ref([]);
|
|
21
|
-
function b(e) {
|
|
22
|
-
let b = !0;
|
|
23
|
-
return e.children?.every((e) => e.meta?.sidebar === !1) && (b = !1), b;
|
|
24
|
-
}
|
|
25
|
-
function x(e, S) {
|
|
26
|
-
let C = [];
|
|
27
|
-
for (let w of e) w.meta?.sidebar !== !1 && (w.children && b(w) ? C.push(...x(w.children, resolveRoutePath(S, w.path))) : C.push(w.redirect ?? resolveRoutePath(S, w.path)));
|
|
28
|
-
return C;
|
|
29
|
-
}
|
|
30
|
-
function S(e = []) {
|
|
31
|
-
let b = [];
|
|
32
|
-
return e.forEach((e) => {
|
|
33
|
-
if (e.children) {
|
|
34
|
-
let S = x(e.children);
|
|
35
|
-
b.push(...S);
|
|
36
|
-
}
|
|
37
|
-
}), b;
|
|
38
|
-
}
|
|
39
|
-
function C(e, b = []) {
|
|
40
|
-
return S(b).includes(e);
|
|
41
|
-
}
|
|
42
|
-
function w(b) {
|
|
43
|
-
return e.value.some((e) => e.fullPath === b);
|
|
44
|
-
}
|
|
45
|
-
function T(b) {
|
|
46
|
-
let x = b.matched.at(-1)?.meta;
|
|
47
|
-
e.value.find((e) => e.fullPath === b.fullPath) || e.value.push({
|
|
48
|
-
fullPath: b.fullPath,
|
|
49
|
-
title: x?.title,
|
|
50
|
-
icon: x?.icon ?? x?.breadcrumbNeste?.findLast((e) => e.icon)?.icon
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
function E(b) {
|
|
54
|
-
e.value = e.value.filter((e) => e.fullPath !== b);
|
|
55
|
-
}
|
|
56
|
-
function D(b, x) {
|
|
57
|
-
e.value.splice(b, 0, e.value.splice(x, 1)[0]);
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
list: e,
|
|
61
|
-
canAdd: C,
|
|
62
|
-
isAdd: w,
|
|
63
|
-
add: T,
|
|
64
|
-
remove: E,
|
|
65
|
-
sort: D
|
|
66
|
-
};
|
|
67
|
-
}), reWhitespace = /\s/;
|
|
68
|
-
function trimmedEndIndex(e) {
|
|
69
|
-
for (var b = e.length; b-- && reWhitespace.test(e.charAt(b)););
|
|
70
|
-
return b;
|
|
71
|
-
}
|
|
72
|
-
var _trimmedEndIndex_default = trimmedEndIndex, reTrimStart = /^\s+/;
|
|
73
|
-
function baseTrim(e) {
|
|
74
|
-
return e && e.slice(0, _trimmedEndIndex_default(e) + 1).replace(reTrimStart, "");
|
|
75
|
-
}
|
|
76
|
-
var _baseTrim_default = baseTrim, NAN = NaN, reIsBadHex = /^[-+]0x[0-9a-f]+$/i, reIsBinary = /^0b[01]+$/i, reIsOctal = /^0o[0-7]+$/i, freeParseInt = parseInt;
|
|
77
|
-
function toNumber(e) {
|
|
78
|
-
if (typeof e == "number") return e;
|
|
79
|
-
if (isSymbol_default(e)) return NAN;
|
|
80
|
-
if (isObject_default(e)) {
|
|
81
|
-
var b = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
82
|
-
e = isObject_default(b) ? b + "" : b;
|
|
83
|
-
}
|
|
84
|
-
if (typeof e != "string") return e === 0 ? e : +e;
|
|
85
|
-
e = _baseTrim_default(e);
|
|
86
|
-
var x = reIsBinary.test(e);
|
|
87
|
-
return x || reIsOctal.test(e) ? freeParseInt(e.slice(2), x ? 2 : 8) : reIsBadHex.test(e) ? NAN : +e;
|
|
88
|
-
}
|
|
89
|
-
var toNumber_default = toNumber, INFINITY = Infinity, MAX_INTEGER = 17976931348623157e292;
|
|
90
|
-
function toFinite(e) {
|
|
91
|
-
return e ? (e = toNumber_default(e), e === INFINITY || e === -INFINITY ? (e < 0 ? -1 : 1) * MAX_INTEGER : e === e ? e : 0) : e === 0 ? e : 0;
|
|
92
|
-
}
|
|
93
|
-
var toFinite_default = toFinite;
|
|
94
|
-
function toInteger(e) {
|
|
95
|
-
var b = toFinite_default(e), x = b % 1;
|
|
96
|
-
return b === b ? x ? b - x : b : 0;
|
|
97
|
-
}
|
|
98
|
-
var toInteger_default = toInteger;
|
|
99
|
-
function baseFindIndex(e, b, x, S) {
|
|
100
|
-
for (var C = e.length, w = x + (S ? 1 : -1); S ? w-- : ++w < C;) if (b(e[w], w, e)) return w;
|
|
101
|
-
return -1;
|
|
102
|
-
}
|
|
103
|
-
var _baseFindIndex_default = baseFindIndex;
|
|
104
|
-
function baseRest(e, b) {
|
|
105
|
-
return _setToString_default(_overRest_default(e, b, identity_default), e + "");
|
|
106
|
-
}
|
|
107
|
-
var _baseRest_default = baseRest;
|
|
108
|
-
function isIterateeCall(e, b, S) {
|
|
109
|
-
if (!isObject_default(S)) return !1;
|
|
110
|
-
var C = typeof b;
|
|
111
|
-
return (C == "number" ? isArrayLike_default(S) && _isIndex_default(b, S.length) : C == "string" && b in S) ? eq_default(S[b], e) : !1;
|
|
112
|
-
}
|
|
113
|
-
var _isIterateeCall_default = isIterateeCall;
|
|
114
|
-
function createAssigner(e) {
|
|
115
|
-
return _baseRest_default(function(b, x) {
|
|
116
|
-
var S = -1, C = x.length, w = C > 1 ? x[C - 1] : void 0, T = C > 2 ? x[2] : void 0;
|
|
117
|
-
for (w = e.length > 3 && typeof w == "function" ? (C--, w) : void 0, T && _isIterateeCall_default(x[0], x[1], T) && (w = C < 3 ? void 0 : w, C = 1), b = Object(b); ++S < C;) {
|
|
118
|
-
var E = x[S];
|
|
119
|
-
E && e(b, E, S, w);
|
|
120
|
-
}
|
|
121
|
-
return b;
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
var _createAssigner_default = createAssigner, assignInWith_default = _createAssigner_default(function(e, b, x, S) {
|
|
125
|
-
_copyObject_default(b, keysIn_default(b), e, S);
|
|
126
|
-
});
|
|
127
|
-
function get(e, b, x) {
|
|
128
|
-
var S = e == null ? void 0 : _baseGet_default(e, b);
|
|
129
|
-
return S === void 0 ? x : S;
|
|
130
|
-
}
|
|
131
|
-
var get_default = get, domExcTag = "[object DOMException]", errorTag = "[object Error]";
|
|
132
|
-
function isError(e) {
|
|
133
|
-
if (!isObjectLike_default(e)) return !1;
|
|
134
|
-
var b = _baseGetTag_default(e);
|
|
135
|
-
return b == errorTag || b == domExcTag || typeof e.message == "string" && typeof e.name == "string" && !isPlainObject_default(e);
|
|
136
|
-
}
|
|
137
|
-
var isError_default = isError, attempt_default = _baseRest_default(function(e, b) {
|
|
138
|
-
try {
|
|
139
|
-
return _apply_default(e, void 0, b);
|
|
140
|
-
} catch (e) {
|
|
141
|
-
return isError_default(e) ? e : Error(e);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
function baseSlice(e, b, x) {
|
|
145
|
-
var S = -1, C = e.length;
|
|
146
|
-
b < 0 && (b = -b > C ? 0 : C + b), x = x > C ? C : x, x < 0 && (x += C), C = b > x ? 0 : x - b >>> 0, b >>>= 0;
|
|
147
|
-
for (var w = Array(C); ++S < C;) w[S] = e[S + b];
|
|
148
|
-
return w;
|
|
149
|
-
}
|
|
150
|
-
var _baseSlice_default = baseSlice;
|
|
151
|
-
function arrayReduce(e, b, x, S) {
|
|
152
|
-
var C = -1, w = e == null ? 0 : e.length;
|
|
153
|
-
for (S && w && (x = e[++C]); ++C < w;) x = b(x, e[C], C, e);
|
|
154
|
-
return x;
|
|
155
|
-
}
|
|
156
|
-
var _arrayReduce_default = arrayReduce;
|
|
157
|
-
function basePropertyOf(e) {
|
|
158
|
-
return function(b) {
|
|
159
|
-
return e?.[b];
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
var _basePropertyOf_default = basePropertyOf, COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
|
|
163
|
-
function baseIsMatch(e, b, x, C) {
|
|
164
|
-
var w = x.length, T = w, D = !C;
|
|
165
|
-
if (e == null) return !T;
|
|
166
|
-
for (e = Object(e); w--;) {
|
|
167
|
-
var O = x[w];
|
|
168
|
-
if (D && O[2] ? O[1] !== e[O[0]] : !(O[0] in e)) return !1;
|
|
169
|
-
}
|
|
170
|
-
for (; ++w < T;) {
|
|
171
|
-
O = x[w];
|
|
172
|
-
var k = O[0], A = e[k], j = O[1];
|
|
173
|
-
if (D && O[2]) {
|
|
174
|
-
if (A === void 0 && !(k in e)) return !1;
|
|
175
|
-
} else {
|
|
176
|
-
var M = new _Stack_default();
|
|
177
|
-
if (C) var N = C(A, j, k, e, b, M);
|
|
178
|
-
if (!(N === void 0 ? _baseIsEqual_default(j, A, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, C, M) : N)) return !1;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return !0;
|
|
182
|
-
}
|
|
183
|
-
var _baseIsMatch_default = baseIsMatch;
|
|
184
|
-
function isStrictComparable(e) {
|
|
185
|
-
return e === e && !isObject_default(e);
|
|
186
|
-
}
|
|
187
|
-
var _isStrictComparable_default = isStrictComparable;
|
|
188
|
-
function getMatchData(e) {
|
|
189
|
-
for (var b = keys_default(e), x = b.length; x--;) {
|
|
190
|
-
var S = b[x], C = e[S];
|
|
191
|
-
b[x] = [
|
|
192
|
-
S,
|
|
193
|
-
C,
|
|
194
|
-
_isStrictComparable_default(C)
|
|
195
|
-
];
|
|
196
|
-
}
|
|
197
|
-
return b;
|
|
198
|
-
}
|
|
199
|
-
var _getMatchData_default = getMatchData;
|
|
200
|
-
function matchesStrictComparable(e, b) {
|
|
201
|
-
return function(x) {
|
|
202
|
-
return x == null ? !1 : x[e] === b && (b !== void 0 || e in Object(x));
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
var _matchesStrictComparable_default = matchesStrictComparable;
|
|
206
|
-
function baseMatches(e) {
|
|
207
|
-
var b = _getMatchData_default(e);
|
|
208
|
-
return b.length == 1 && b[0][2] ? _matchesStrictComparable_default(b[0][0], b[0][1]) : function(x) {
|
|
209
|
-
return x === e || _baseIsMatch_default(x, e, b);
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
var _baseMatches_default = baseMatches, COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
213
|
-
function baseMatchesProperty(e, b) {
|
|
214
|
-
return _isKey_default(e) && _isStrictComparable_default(b) ? _matchesStrictComparable_default(_toKey_default(e), b) : function(x) {
|
|
215
|
-
var C = get_default(x, e);
|
|
216
|
-
return C === void 0 && C === b ? hasIn_default(x, e) : _baseIsEqual_default(b, C, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
var _baseMatchesProperty_default = baseMatchesProperty;
|
|
220
|
-
function baseProperty(e) {
|
|
221
|
-
return function(b) {
|
|
222
|
-
return b?.[e];
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
var _baseProperty_default = baseProperty;
|
|
226
|
-
function basePropertyDeep(e) {
|
|
227
|
-
return function(b) {
|
|
228
|
-
return _baseGet_default(b, e);
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
var _basePropertyDeep_default = basePropertyDeep;
|
|
232
|
-
function property(e) {
|
|
233
|
-
return _isKey_default(e) ? _baseProperty_default(_toKey_default(e)) : _basePropertyDeep_default(e);
|
|
234
|
-
}
|
|
235
|
-
var property_default = property;
|
|
236
|
-
function baseIteratee(e) {
|
|
237
|
-
return typeof e == "function" ? e : e == null ? identity_default : typeof e == "object" ? isArray_default(e) ? _baseMatchesProperty_default(e[0], e[1]) : _baseMatches_default(e) : property_default(e);
|
|
238
|
-
}
|
|
239
|
-
var _baseIteratee_default = baseIteratee;
|
|
240
|
-
function createBaseFor(e) {
|
|
241
|
-
return function(b, x, S) {
|
|
242
|
-
for (var C = -1, w = Object(b), T = S(b), E = T.length; E--;) {
|
|
243
|
-
var D = T[e ? E : ++C];
|
|
244
|
-
if (x(w[D], D, w) === !1) break;
|
|
245
|
-
}
|
|
246
|
-
return b;
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
var _baseFor_default = createBaseFor();
|
|
250
|
-
function baseForOwn(e, b) {
|
|
251
|
-
return e && _baseFor_default(e, b, keys_default);
|
|
252
|
-
}
|
|
253
|
-
var _baseForOwn_default = baseForOwn;
|
|
254
|
-
function createBaseEach(e, b) {
|
|
255
|
-
return function(x, S) {
|
|
256
|
-
if (x == null) return x;
|
|
257
|
-
if (!isArrayLike_default(x)) return e(x, S);
|
|
258
|
-
for (var C = x.length, w = b ? C : -1, T = Object(x); (b ? w-- : ++w < C) && S(T[w], w, T) !== !1;);
|
|
259
|
-
return x;
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
var _baseEach_default = createBaseEach(_baseForOwn_default);
|
|
263
|
-
function defaultTo(e, b) {
|
|
264
|
-
return e == null || e !== e ? b : e;
|
|
265
|
-
}
|
|
266
|
-
var defaultTo_default = defaultTo;
|
|
267
|
-
function assignMergeValue(e, b, S) {
|
|
268
|
-
(S !== void 0 && !eq_default(e[b], S) || S === void 0 && !(b in e)) && _baseAssignValue_default(e, b, S);
|
|
269
|
-
}
|
|
270
|
-
var _assignMergeValue_default = assignMergeValue;
|
|
271
|
-
function isArrayLikeObject(e) {
|
|
272
|
-
return isObjectLike_default(e) && isArrayLike_default(e);
|
|
273
|
-
}
|
|
274
|
-
var isArrayLikeObject_default = isArrayLikeObject;
|
|
275
|
-
function safeGet(e, b) {
|
|
276
|
-
if (!(b === "constructor" && typeof e[b] == "function") && b != "__proto__") return e[b];
|
|
277
|
-
}
|
|
278
|
-
var _safeGet_default = safeGet;
|
|
279
|
-
function toPlainObject(e) {
|
|
280
|
-
return _copyObject_default(e, keysIn_default(e));
|
|
281
|
-
}
|
|
282
|
-
var toPlainObject_default = toPlainObject;
|
|
283
|
-
function baseMergeDeep(e, b, x, S, C, E, D) {
|
|
284
|
-
var k = _safeGet_default(e, x), A = _safeGet_default(b, x), j = D.get(A);
|
|
285
|
-
if (j) {
|
|
286
|
-
_assignMergeValue_default(e, x, j);
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
var M = E ? E(k, A, x + "", e, b, D) : void 0, N = M === void 0;
|
|
290
|
-
if (N) {
|
|
291
|
-
var P = isArray_default(A), L = !P && isBuffer_default(A), B = !P && !L && isTypedArray_default(A);
|
|
292
|
-
M = A, P || L || B ? isArray_default(k) ? M = k : isArrayLikeObject_default(k) ? M = _copyArray_default(k) : L ? (N = !1, M = _cloneBuffer_default(A, !0)) : B ? (N = !1, M = _cloneTypedArray_default(A, !0)) : M = [] : isPlainObject_default(A) || isArguments_default(A) ? (M = k, isArguments_default(k) ? M = toPlainObject_default(k) : (!isObject_default(k) || isFunction_default(k)) && (M = _initCloneObject_default(A))) : N = !1;
|
|
293
|
-
}
|
|
294
|
-
N && (D.set(A, M), C(M, A, S, E, D), D.delete(A)), _assignMergeValue_default(e, x, M);
|
|
295
|
-
}
|
|
296
|
-
var _baseMergeDeep_default = baseMergeDeep;
|
|
297
|
-
function baseMerge(e, b, x, S, C) {
|
|
298
|
-
e !== b && _baseFor_default(b, function(w, T) {
|
|
299
|
-
if (C ||= new _Stack_default(), isObject_default(w)) _baseMergeDeep_default(e, b, T, x, baseMerge, S, C);
|
|
300
|
-
else {
|
|
301
|
-
var D = S ? S(_safeGet_default(e, T), w, T + "", e, b, C) : void 0;
|
|
302
|
-
D === void 0 && (D = w), _assignMergeValue_default(e, T, D);
|
|
303
|
-
}
|
|
304
|
-
}, keysIn_default);
|
|
305
|
-
}
|
|
306
|
-
var _baseMerge_default = baseMerge;
|
|
307
|
-
function customDefaultsMerge(e, b, x, S, C, w) {
|
|
308
|
-
return isObject_default(e) && isObject_default(b) && (w.set(b, e), _baseMerge_default(e, b, void 0, customDefaultsMerge, w), w.delete(b)), e;
|
|
309
|
-
}
|
|
310
|
-
var _customDefaultsMerge_default = customDefaultsMerge, mergeWith_default = _createAssigner_default(function(e, b, x, S) {
|
|
311
|
-
_baseMerge_default(e, b, x, S);
|
|
312
|
-
}), defaultsDeep_default = _baseRest_default(function(e) {
|
|
313
|
-
return e.push(void 0, _customDefaultsMerge_default), _apply_default(mergeWith_default, void 0, e);
|
|
314
|
-
});
|
|
315
|
-
function last(e) {
|
|
316
|
-
var b = e == null ? 0 : e.length;
|
|
317
|
-
return b ? e[b - 1] : void 0;
|
|
318
|
-
}
|
|
319
|
-
var last_default = last, _escapeHtmlChar_default = _basePropertyOf_default({
|
|
320
|
-
"&": "&",
|
|
321
|
-
"<": "<",
|
|
322
|
-
">": ">",
|
|
323
|
-
"\"": """,
|
|
324
|
-
"'": "'"
|
|
325
|
-
}), reUnescapedHtml = /[&<>"']/g, reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
|
326
|
-
function escape(e) {
|
|
327
|
-
return e = toString_default(e), e && reHasUnescapedHtml.test(e) ? e.replace(reUnescapedHtml, _escapeHtmlChar_default) : e;
|
|
328
|
-
}
|
|
329
|
-
var escape_default = escape;
|
|
330
|
-
function createFind(e) {
|
|
331
|
-
return function(b, x, S) {
|
|
332
|
-
var C = Object(b);
|
|
333
|
-
if (!isArrayLike_default(b)) {
|
|
334
|
-
var w = _baseIteratee_default(x, 3);
|
|
335
|
-
b = keys_default(b), x = function(e) {
|
|
336
|
-
return w(C[e], e, C);
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
var T = e(b, x, S);
|
|
340
|
-
return T > -1 ? C[w ? b[T] : T] : void 0;
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
var _createFind_default = createFind, nativeMax = Math.max;
|
|
344
|
-
function findIndex(e, b, x) {
|
|
345
|
-
var S = e == null ? 0 : e.length;
|
|
346
|
-
if (!S) return -1;
|
|
347
|
-
var C = x == null ? 0 : toInteger_default(x);
|
|
348
|
-
return C < 0 && (C = nativeMax(S + C, 0)), _baseFindIndex_default(e, _baseIteratee_default(b, 3), C);
|
|
349
|
-
}
|
|
350
|
-
var findIndex_default = findIndex, find_default = _createFind_default(findIndex_default), hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
351
|
-
function baseHas(e, b) {
|
|
352
|
-
return e != null && hasOwnProperty$2.call(e, b);
|
|
353
|
-
}
|
|
354
|
-
var _baseHas_default = baseHas;
|
|
355
|
-
function has(e, b) {
|
|
356
|
-
return e != null && _hasPath_default(e, b, _baseHas_default);
|
|
357
|
-
}
|
|
358
|
-
var has_default = has, stringTag = "[object String]";
|
|
359
|
-
function isString(e) {
|
|
360
|
-
return typeof e == "string" || !isArray_default(e) && isObjectLike_default(e) && _baseGetTag_default(e) == stringTag;
|
|
361
|
-
}
|
|
362
|
-
var isString_default = isString;
|
|
363
|
-
function baseValues(e, b) {
|
|
364
|
-
return _arrayMap_default(b, function(b) {
|
|
365
|
-
return e[b];
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
var _baseValues_default = baseValues;
|
|
369
|
-
function parent(e, b) {
|
|
370
|
-
return b.length < 2 ? e : _baseGet_default(e, _baseSlice_default(b, 0, -1));
|
|
371
|
-
}
|
|
372
|
-
var _parent_default = parent, numberTag = "[object Number]";
|
|
373
|
-
function isNumber(e) {
|
|
374
|
-
return typeof e == "number" || isObjectLike_default(e) && _baseGetTag_default(e) == numberTag;
|
|
375
|
-
}
|
|
376
|
-
var isNumber_default = isNumber;
|
|
377
|
-
function isUndefined(e) {
|
|
378
|
-
return e === void 0;
|
|
379
|
-
}
|
|
380
|
-
var isUndefined_default = isUndefined, merge_default = _createAssigner_default(function(e, b, x) {
|
|
381
|
-
_baseMerge_default(e, b, x);
|
|
382
|
-
}), FUNC_ERROR_TEXT = "Expected a function";
|
|
383
|
-
function negate(e) {
|
|
384
|
-
if (typeof e != "function") throw TypeError(FUNC_ERROR_TEXT);
|
|
385
|
-
return function() {
|
|
386
|
-
var b = arguments;
|
|
387
|
-
switch (b.length) {
|
|
388
|
-
case 0: return !e.call(this);
|
|
389
|
-
case 1: return !e.call(this, b[0]);
|
|
390
|
-
case 2: return !e.call(this, b[0], b[1]);
|
|
391
|
-
case 3: return !e.call(this, b[0], b[1], b[2]);
|
|
392
|
-
}
|
|
393
|
-
return !e.apply(this, b);
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
var negate_default = negate;
|
|
397
|
-
function baseUnset(e, b) {
|
|
398
|
-
return b = _castPath_default(b, e), e = _parent_default(e, b), e == null || delete e[_toKey_default(last_default(b))];
|
|
399
|
-
}
|
|
400
|
-
var _baseUnset_default = baseUnset;
|
|
401
|
-
function customOmitClone(e) {
|
|
402
|
-
return isPlainObject_default(e) ? void 0 : e;
|
|
403
|
-
}
|
|
404
|
-
var _customOmitClone_default = customOmitClone, CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4, omit_default = _flatRest_default(function(e, b) {
|
|
405
|
-
var x = {};
|
|
406
|
-
if (e == null) return x;
|
|
407
|
-
var S = !1;
|
|
408
|
-
b = _arrayMap_default(b, function(b) {
|
|
409
|
-
return b = _castPath_default(b, e), S ||= b.length > 1, b;
|
|
410
|
-
}), _copyObject_default(e, _getAllKeysIn_default(e), x), S && (x = _baseClone_default(x, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, _customOmitClone_default));
|
|
411
|
-
for (var C = b.length; C--;) _baseUnset_default(x, b[C]);
|
|
412
|
-
return x;
|
|
413
|
-
});
|
|
414
|
-
function pickBy(e, b) {
|
|
415
|
-
if (e == null) return {};
|
|
416
|
-
var x = _arrayMap_default(_getAllKeysIn_default(e), function(e) {
|
|
417
|
-
return [e];
|
|
418
|
-
});
|
|
419
|
-
return b = _baseIteratee_default(b), _basePickBy_default(e, x, function(e, x) {
|
|
420
|
-
return b(e, x[0]);
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
var pickBy_default = pickBy;
|
|
424
|
-
function omitBy(e, b) {
|
|
425
|
-
return pickBy_default(e, negate_default(_baseIteratee_default(b)));
|
|
426
|
-
}
|
|
427
|
-
var omitBy_default = omitBy;
|
|
428
|
-
function baseReduce(e, b, x, S, C) {
|
|
429
|
-
return C(e, function(e, C, w) {
|
|
430
|
-
x = S ? (S = !1, e) : b(x, e, C, w);
|
|
431
|
-
}), x;
|
|
432
|
-
}
|
|
433
|
-
var _baseReduce_default = baseReduce;
|
|
434
|
-
function reduce(e, b, x) {
|
|
435
|
-
var S = isArray_default(e) ? _arrayReduce_default : _baseReduce_default, C = arguments.length < 3;
|
|
436
|
-
return S(e, _baseIteratee_default(b, 4), x, C, _baseEach_default);
|
|
437
|
-
}
|
|
438
|
-
var reduce_default = reduce;
|
|
439
|
-
function set(e, b, x) {
|
|
440
|
-
return e == null ? e : _baseSet_default(e, b, x);
|
|
441
|
-
}
|
|
442
|
-
var set_default = set, objectProto = Object.prototype, hasOwnProperty$1 = objectProto.hasOwnProperty;
|
|
443
|
-
function customDefaultsAssignIn(e, b, S, C) {
|
|
444
|
-
return e === void 0 || eq_default(e, objectProto[S]) && !hasOwnProperty$1.call(C, S) ? b : e;
|
|
445
|
-
}
|
|
446
|
-
var _customDefaultsAssignIn_default = customDefaultsAssignIn, stringEscapes = {
|
|
447
|
-
"\\": "\\",
|
|
448
|
-
"'": "'",
|
|
449
|
-
"\n": "n",
|
|
450
|
-
"\r": "r",
|
|
451
|
-
"\u2028": "u2028",
|
|
452
|
-
"\u2029": "u2029"
|
|
453
|
-
};
|
|
454
|
-
function escapeStringChar(e) {
|
|
455
|
-
return "\\" + stringEscapes[e];
|
|
456
|
-
}
|
|
457
|
-
var _escapeStringChar_default = escapeStringChar, _reInterpolate_default = /<%=([\s\S]+?)%>/g, templateSettings_default = {
|
|
458
|
-
escape: /<%-([\s\S]+?)%>/g,
|
|
459
|
-
evaluate: /<%([\s\S]+?)%>/g,
|
|
460
|
-
interpolate: _reInterpolate_default,
|
|
461
|
-
variable: "",
|
|
462
|
-
imports: { _: { escape: escape_default } }
|
|
463
|
-
}, INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`", reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g, reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/, reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, reNoMatch = /($^)/, reUnescapedString = /['\n\r\u2028\u2029\\]/g, hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
464
|
-
function template(e, b, x) {
|
|
465
|
-
var S = templateSettings_default.imports._.templateSettings || templateSettings_default;
|
|
466
|
-
x && _isIterateeCall_default(e, b, x) && (b = void 0), e = toString_default(e), b = assignInWith_default({}, b, S, _customDefaultsAssignIn_default);
|
|
467
|
-
var C = assignInWith_default({}, b.imports, S.imports, _customDefaultsAssignIn_default), w = keys_default(C), T = _baseValues_default(C, w), E, O, k = 0, A = b.interpolate || reNoMatch, j = "__p += '", M = RegExp((b.escape || reNoMatch).source + "|" + A.source + "|" + (A === _reInterpolate_default ? reEsTemplate : reNoMatch).source + "|" + (b.evaluate || reNoMatch).source + "|$", "g"), N = hasOwnProperty.call(b, "sourceURL") ? "//# sourceURL=" + (b.sourceURL + "").replace(/\s/g, " ") + "\n" : "";
|
|
468
|
-
e.replace(M, function(b, x, S, C, w, T) {
|
|
469
|
-
return S ||= C, j += e.slice(k, T).replace(reUnescapedString, _escapeStringChar_default), x && (E = !0, j += "' +\n__e(" + x + ") +\n'"), w && (O = !0, j += "';\n" + w + ";\n__p += '"), S && (j += "' +\n((__t = (" + S + ")) == null ? '' : __t) +\n'"), k = T + b.length, b;
|
|
470
|
-
}), j += "';\n";
|
|
471
|
-
var P = hasOwnProperty.call(b, "variable") && b.variable;
|
|
472
|
-
if (!P) j = "with (obj) {\n" + j + "\n}\n";
|
|
473
|
-
else if (reForbiddenIdentifierChars.test(P)) throw Error(INVALID_TEMPL_VAR_ERROR_TEXT);
|
|
474
|
-
j = (O ? j.replace(reEmptyStringLeading, "") : j).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;"), j = "function(" + (P || "obj") + ") {\n" + (P ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (E ? ", __e = _.escape" : "") + (O ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + j + "return __p\n}";
|
|
475
|
-
var F = attempt_default(function() {
|
|
476
|
-
return Function(w, N + "return " + j).apply(void 0, T);
|
|
477
|
-
});
|
|
478
|
-
if (F.source = j, isError_default(F)) throw F;
|
|
479
|
-
return F;
|
|
480
|
-
}
|
|
481
|
-
var template_default = template, iframe_default = defineStore(STORE_NAME.IFRAME, () => {
|
|
482
|
-
let e = ref(!1), b = ref([]), x = ref([]), S = computed(() => b.value.filter((e) => e.isOpen));
|
|
483
|
-
async function C(x, S) {
|
|
484
|
-
for (let e of x) e.meta.iframe && !e.meta.link && (isFunction_default(e.meta.iframe) && (e.meta.iframe = await e.meta.iframe(toRaw(S))), b.value.push({
|
|
485
|
-
path: e.path,
|
|
486
|
-
src: e.meta.iframe,
|
|
487
|
-
isOpen: !1,
|
|
488
|
-
isLoading: !0
|
|
489
|
-
}));
|
|
490
|
-
e.value = !0;
|
|
491
|
-
}
|
|
492
|
-
function w(e) {
|
|
493
|
-
let x = b.value.findIndex((b) => b.path === e);
|
|
494
|
-
b.value[x].isLoading = !~x;
|
|
495
|
-
}
|
|
496
|
-
function T(e) {
|
|
497
|
-
let S = b.value.find((b) => b.path === e);
|
|
498
|
-
if (S) {
|
|
499
|
-
S.isOpen = !0;
|
|
500
|
-
let b = x.value.findIndex((b) => b === e);
|
|
501
|
-
~b ? (x.value.splice(0, 0, x.value[b]), x.value.splice(b)) : x.value.unshift(e);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
function E(e, S = !1) {
|
|
505
|
-
function C(e) {
|
|
506
|
-
let C = b.value.findIndex((b) => b.path === e);
|
|
507
|
-
~C && S && (b.value[C].isOpen = !1, b.value[C].isLoading = !0), x.value = x.value.filter((b) => b !== e);
|
|
508
|
-
}
|
|
509
|
-
isString_default(e) ? C(e) : e.forEach(C);
|
|
510
|
-
}
|
|
511
|
-
function D() {
|
|
512
|
-
b.value = [], e.value = !1;
|
|
513
|
-
}
|
|
514
|
-
return {
|
|
515
|
-
isGenerate: e,
|
|
516
|
-
openedList: S,
|
|
517
|
-
generateList: C,
|
|
518
|
-
closeLoading: w,
|
|
519
|
-
open: T,
|
|
520
|
-
close: E,
|
|
521
|
-
clean: D,
|
|
522
|
-
recentPathList: x,
|
|
523
|
-
list: b
|
|
524
|
-
};
|
|
525
|
-
});
|
|
526
|
-
function useAuth() {
|
|
527
|
-
function e(e) {
|
|
528
|
-
let b = settings_default(), x = user_default();
|
|
529
|
-
return b.settings.app.enablePermission ? x.user.permissions.includes(e) : !0;
|
|
530
|
-
}
|
|
531
|
-
function b(b) {
|
|
532
|
-
let x;
|
|
533
|
-
return x = typeof b == "string" ? b === "" ? !0 : e(b) : b.length > 0 ? b.some((b) => e(b)) : !0, x;
|
|
534
|
-
}
|
|
535
|
-
function x(b) {
|
|
536
|
-
return b.length > 0 ? b.every((b) => e(b)) : !0;
|
|
537
|
-
}
|
|
538
|
-
return {
|
|
539
|
-
auth: b,
|
|
540
|
-
authAll: x
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
var LogLevels = {
|
|
544
|
-
silent: -Infinity,
|
|
545
|
-
fatal: 0,
|
|
546
|
-
error: 0,
|
|
547
|
-
warn: 1,
|
|
548
|
-
log: 2,
|
|
549
|
-
info: 3,
|
|
550
|
-
success: 3,
|
|
551
|
-
fail: 3,
|
|
552
|
-
ready: 3,
|
|
553
|
-
start: 3,
|
|
554
|
-
box: 3,
|
|
555
|
-
debug: 4,
|
|
556
|
-
trace: 5,
|
|
557
|
-
verbose: Infinity
|
|
558
|
-
}, LogTypes = {
|
|
559
|
-
silent: { level: -1 },
|
|
560
|
-
fatal: { level: LogLevels.fatal },
|
|
561
|
-
error: { level: LogLevels.error },
|
|
562
|
-
warn: { level: LogLevels.warn },
|
|
563
|
-
log: { level: LogLevels.log },
|
|
564
|
-
info: { level: LogLevels.info },
|
|
565
|
-
success: { level: LogLevels.success },
|
|
566
|
-
fail: { level: LogLevels.fail },
|
|
567
|
-
ready: { level: LogLevels.info },
|
|
568
|
-
start: { level: LogLevels.info },
|
|
569
|
-
box: { level: LogLevels.info },
|
|
570
|
-
debug: { level: LogLevels.debug },
|
|
571
|
-
trace: { level: LogLevels.trace },
|
|
572
|
-
verbose: { level: LogLevels.verbose }
|
|
573
|
-
};
|
|
574
|
-
function isPlainObject$1(e) {
|
|
575
|
-
if (typeof e != "object" || !e) return !1;
|
|
576
|
-
let b = Object.getPrototypeOf(e);
|
|
577
|
-
return b !== null && b !== Object.prototype && Object.getPrototypeOf(b) !== null || Symbol.iterator in e ? !1 : Symbol.toStringTag in e ? Object.prototype.toString.call(e) === "[object Module]" : !0;
|
|
578
|
-
}
|
|
579
|
-
function _defu(e, b, x = ".", S) {
|
|
580
|
-
if (!isPlainObject$1(b)) return _defu(e, {}, x, S);
|
|
581
|
-
let C = Object.assign({}, b);
|
|
582
|
-
for (let b in e) {
|
|
583
|
-
if (b === "__proto__" || b === "constructor") continue;
|
|
584
|
-
let w = e[b];
|
|
585
|
-
w != null && (S && S(C, b, w, x) || (Array.isArray(w) && Array.isArray(C[b]) ? C[b] = [...w, ...C[b]] : isPlainObject$1(w) && isPlainObject$1(C[b]) ? C[b] = _defu(w, C[b], (x ? `${x}.` : "") + b.toString(), S) : C[b] = w));
|
|
586
|
-
}
|
|
587
|
-
return C;
|
|
588
|
-
}
|
|
589
|
-
function createDefu(e) {
|
|
590
|
-
return (...b) => b.reduce((b, x) => _defu(b, x, "", e), {});
|
|
591
|
-
}
|
|
592
|
-
var defu = createDefu();
|
|
593
|
-
function isPlainObject(e) {
|
|
594
|
-
return Object.prototype.toString.call(e) === "[object Object]";
|
|
595
|
-
}
|
|
596
|
-
function isLogObj(e) {
|
|
597
|
-
return !(!isPlainObject(e) || !e.message && !e.args || e.stack);
|
|
598
|
-
}
|
|
599
|
-
var paused = !1, queue = [], Consola = class e {
|
|
600
|
-
options;
|
|
601
|
-
_lastLog;
|
|
602
|
-
_mockFn;
|
|
603
|
-
constructor(e = {}) {
|
|
604
|
-
let b = e.types || LogTypes;
|
|
605
|
-
for (let x in this.options = defu({
|
|
606
|
-
...e,
|
|
607
|
-
defaults: { ...e.defaults },
|
|
608
|
-
level: _normalizeLogLevel(e.level, b),
|
|
609
|
-
reporters: [...e.reporters || []]
|
|
610
|
-
}, {
|
|
611
|
-
types: LogTypes,
|
|
612
|
-
throttle: 1e3,
|
|
613
|
-
throttleMin: 5,
|
|
614
|
-
formatOptions: {
|
|
615
|
-
date: !0,
|
|
616
|
-
colors: !1,
|
|
617
|
-
compact: !0
|
|
618
|
-
}
|
|
619
|
-
}), b) {
|
|
620
|
-
let e = {
|
|
621
|
-
type: x,
|
|
622
|
-
...this.options.defaults,
|
|
623
|
-
...b[x]
|
|
624
|
-
};
|
|
625
|
-
this[x] = this._wrapLogFn(e), this[x].raw = this._wrapLogFn(e, !0);
|
|
626
|
-
}
|
|
627
|
-
this.options.mockFn && this.mockTypes(), this._lastLog = {};
|
|
628
|
-
}
|
|
629
|
-
get level() {
|
|
630
|
-
return this.options.level;
|
|
631
|
-
}
|
|
632
|
-
set level(e) {
|
|
633
|
-
this.options.level = _normalizeLogLevel(e, this.options.types, this.options.level);
|
|
634
|
-
}
|
|
635
|
-
prompt(e, b) {
|
|
636
|
-
if (!this.options.prompt) throw Error("prompt is not supported!");
|
|
637
|
-
return this.options.prompt(e, b);
|
|
638
|
-
}
|
|
639
|
-
create(b) {
|
|
640
|
-
let x = new e({
|
|
641
|
-
...this.options,
|
|
642
|
-
...b
|
|
643
|
-
});
|
|
644
|
-
return this._mockFn && x.mockTypes(this._mockFn), x;
|
|
645
|
-
}
|
|
646
|
-
withDefaults(e) {
|
|
647
|
-
return this.create({
|
|
648
|
-
...this.options,
|
|
649
|
-
defaults: {
|
|
650
|
-
...this.options.defaults,
|
|
651
|
-
...e
|
|
652
|
-
}
|
|
653
|
-
});
|
|
654
|
-
}
|
|
655
|
-
withTag(e) {
|
|
656
|
-
return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + e : e });
|
|
657
|
-
}
|
|
658
|
-
addReporter(e) {
|
|
659
|
-
return this.options.reporters.push(e), this;
|
|
660
|
-
}
|
|
661
|
-
removeReporter(e) {
|
|
662
|
-
if (e) {
|
|
663
|
-
let b = this.options.reporters.indexOf(e);
|
|
664
|
-
if (b !== -1) return this.options.reporters.splice(b, 1);
|
|
665
|
-
} else this.options.reporters.splice(0);
|
|
666
|
-
return this;
|
|
667
|
-
}
|
|
668
|
-
setReporters(e) {
|
|
669
|
-
return this.options.reporters = Array.isArray(e) ? e : [e], this;
|
|
670
|
-
}
|
|
671
|
-
wrapAll() {
|
|
672
|
-
this.wrapConsole(), this.wrapStd();
|
|
673
|
-
}
|
|
674
|
-
restoreAll() {
|
|
675
|
-
this.restoreConsole(), this.restoreStd();
|
|
676
|
-
}
|
|
677
|
-
wrapConsole() {
|
|
678
|
-
for (let e in this.options.types) console["__" + e] || (console["__" + e] = console[e]), console[e] = this[e].raw;
|
|
679
|
-
}
|
|
680
|
-
restoreConsole() {
|
|
681
|
-
for (let e in this.options.types) console["__" + e] && (console[e] = console["__" + e], delete console["__" + e]);
|
|
682
|
-
}
|
|
683
|
-
wrapStd() {
|
|
684
|
-
this._wrapStream(this.options.stdout, "log"), this._wrapStream(this.options.stderr, "log");
|
|
685
|
-
}
|
|
686
|
-
_wrapStream(e, b) {
|
|
687
|
-
e && (e.__write ||= e.write, e.write = (e) => {
|
|
688
|
-
this[b].raw(String(e).trim());
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
|
-
restoreStd() {
|
|
692
|
-
this._restoreStream(this.options.stdout), this._restoreStream(this.options.stderr);
|
|
693
|
-
}
|
|
694
|
-
_restoreStream(e) {
|
|
695
|
-
e && e.__write && (e.write = e.__write, delete e.__write);
|
|
696
|
-
}
|
|
697
|
-
pauseLogs() {
|
|
698
|
-
paused = !0;
|
|
699
|
-
}
|
|
700
|
-
resumeLogs() {
|
|
701
|
-
paused = !1;
|
|
702
|
-
let e = queue.splice(0);
|
|
703
|
-
for (let b of e) b[0]._logFn(b[1], b[2]);
|
|
704
|
-
}
|
|
705
|
-
mockTypes(e) {
|
|
706
|
-
let b = e || this.options.mockFn;
|
|
707
|
-
if (this._mockFn = b, typeof b == "function") for (let e in this.options.types) this[e] = b(e, this.options.types[e]) || this[e], this[e].raw = this[e];
|
|
708
|
-
}
|
|
709
|
-
_wrapLogFn(e, b) {
|
|
710
|
-
return (...x) => {
|
|
711
|
-
if (paused) {
|
|
712
|
-
queue.push([
|
|
713
|
-
this,
|
|
714
|
-
e,
|
|
715
|
-
x,
|
|
716
|
-
b
|
|
717
|
-
]);
|
|
718
|
-
return;
|
|
719
|
-
}
|
|
720
|
-
return this._logFn(e, x, b);
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
_logFn(e, b, x) {
|
|
724
|
-
if ((e.level || 0) > this.level) return !1;
|
|
725
|
-
let S = {
|
|
726
|
-
date: /* @__PURE__ */ new Date(),
|
|
727
|
-
args: [],
|
|
728
|
-
...e,
|
|
729
|
-
level: _normalizeLogLevel(e.level, this.options.types)
|
|
730
|
-
};
|
|
731
|
-
!x && b.length === 1 && isLogObj(b[0]) ? Object.assign(S, b[0]) : S.args = [...b], S.message && (S.args.unshift(S.message), delete S.message), S.additional && (Array.isArray(S.additional) || (S.additional = S.additional.split("\n")), S.args.push("\n" + S.additional.join("\n")), delete S.additional), S.type = typeof S.type == "string" ? S.type.toLowerCase() : "log", S.tag = typeof S.tag == "string" ? S.tag : "";
|
|
732
|
-
let C = (e = !1) => {
|
|
733
|
-
let b = (this._lastLog.count || 0) - this.options.throttleMin;
|
|
734
|
-
if (this._lastLog.object && b > 0) {
|
|
735
|
-
let e = [...this._lastLog.object.args];
|
|
736
|
-
b > 1 && e.push(`(repeated ${b} times)`), this._log({
|
|
737
|
-
...this._lastLog.object,
|
|
738
|
-
args: e
|
|
739
|
-
}), this._lastLog.count = 1;
|
|
740
|
-
}
|
|
741
|
-
e && (this._lastLog.object = S, this._log(S));
|
|
742
|
-
};
|
|
743
|
-
clearTimeout(this._lastLog.timeout);
|
|
744
|
-
let w = this._lastLog.time && S.date ? S.date.getTime() - this._lastLog.time.getTime() : 0;
|
|
745
|
-
if (this._lastLog.time = S.date, w < this.options.throttle) try {
|
|
746
|
-
let e = JSON.stringify([
|
|
747
|
-
S.type,
|
|
748
|
-
S.tag,
|
|
749
|
-
S.args
|
|
750
|
-
]), b = this._lastLog.serialized === e;
|
|
751
|
-
if (this._lastLog.serialized = e, b && (this._lastLog.count = (this._lastLog.count || 0) + 1, this._lastLog.count > this.options.throttleMin)) {
|
|
752
|
-
this._lastLog.timeout = setTimeout(C, this.options.throttle);
|
|
753
|
-
return;
|
|
754
|
-
}
|
|
755
|
-
} catch {}
|
|
756
|
-
C(!0);
|
|
757
|
-
}
|
|
758
|
-
_log(e) {
|
|
759
|
-
for (let b of this.options.reporters) b.log(e, { options: this.options });
|
|
760
|
-
}
|
|
761
|
-
};
|
|
762
|
-
function _normalizeLogLevel(e, b = {}, x = 3) {
|
|
763
|
-
return e === void 0 ? x : typeof e == "number" ? e : b[e] && b[e].level !== void 0 ? b[e].level : x;
|
|
764
|
-
}
|
|
765
|
-
Consola.prototype.add = Consola.prototype.addReporter, Consola.prototype.remove = Consola.prototype.removeReporter, Consola.prototype.clear = Consola.prototype.removeReporter, Consola.prototype.withScope = Consola.prototype.withTag, Consola.prototype.mock = Consola.prototype.mockTypes, Consola.prototype.pause = Consola.prototype.pauseLogs, Consola.prototype.resume = Consola.prototype.resumeLogs;
|
|
766
|
-
function createConsola$1(e = {}) {
|
|
767
|
-
return new Consola(e);
|
|
768
|
-
}
|
|
769
|
-
var BrowserReporter = class {
|
|
770
|
-
options;
|
|
771
|
-
defaultColor;
|
|
772
|
-
levelColorMap;
|
|
773
|
-
typeColorMap;
|
|
774
|
-
constructor(e) {
|
|
775
|
-
this.options = { ...e }, this.defaultColor = "#7f8c8d", this.levelColorMap = {
|
|
776
|
-
0: "#c0392b",
|
|
777
|
-
1: "#f39c12",
|
|
778
|
-
3: "#00BCD4"
|
|
779
|
-
}, this.typeColorMap = { success: "#2ecc71" };
|
|
780
|
-
}
|
|
781
|
-
_getLogFn(e) {
|
|
782
|
-
return e < 1 ? console.__error || console.error : e === 1 ? console.__warn || console.warn : console.__log || console.log;
|
|
783
|
-
}
|
|
784
|
-
log(e) {
|
|
785
|
-
let b = this._getLogFn(e.level), x = e.type === "log" ? "" : e.type, S = e.tag || "", C = `
|
|
786
|
-
background: ${this.typeColorMap[e.type] || this.levelColorMap[e.level] || this.defaultColor};
|
|
787
|
-
border-radius: 0.5em;
|
|
788
|
-
color: white;
|
|
789
|
-
font-weight: bold;
|
|
790
|
-
padding: 2px 0.5em;
|
|
791
|
-
`, w = `%c${[S, x].filter(Boolean).join(":")}`;
|
|
792
|
-
typeof e.args[0] == "string" ? b(`${w}%c ${e.args[0]}`, C, "", ...e.args.slice(1)) : b(w, C, ...e.args);
|
|
793
|
-
}
|
|
794
|
-
};
|
|
795
|
-
function createConsola(e = {}) {
|
|
796
|
-
return createConsola$1({
|
|
797
|
-
reporters: e.reporters || [new BrowserReporter({})],
|
|
798
|
-
prompt(e, b = {}) {
|
|
799
|
-
return b.type === "confirm" ? Promise.resolve(confirm(e)) : Promise.resolve(prompt(e));
|
|
800
|
-
},
|
|
801
|
-
...e
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
createConsola().withTag("[PUBINFO]");
|
|
805
|
-
var LOG_TYPE = /* @__PURE__ */ function(e) {
|
|
806
|
-
return e.ERROR = "error", e.SUCCESS = "success", e.WARN = "warn", e.INFO = "info", e.START = "start", e.BOX = "box", e;
|
|
807
|
-
}(LOG_TYPE || {}), EMOJI = /* @__PURE__ */ function(e) {
|
|
808
|
-
return e.ERROR = "🔴", e.SUCCESS = "🟢", e.WARN = "🟡", e.INFO = "🔵", e.START = "🟩", e.BOX = "🟧", e;
|
|
809
|
-
}(EMOJI || {});
|
|
810
|
-
function createLog(e, b) {
|
|
811
|
-
return (e) => {};
|
|
812
|
-
}
|
|
813
|
-
const useError = createLog(LOG_TYPE.ERROR, EMOJI.ERROR), useSuccess = createLog(LOG_TYPE.SUCCESS, EMOJI.SUCCESS), useWarn = createLog(LOG_TYPE.WARN, EMOJI.WARN), useInfo = createLog(LOG_TYPE.INFO, EMOJI.INFO), useStart = createLog(LOG_TYPE.START, EMOJI.START), useBox = createLog(LOG_TYPE.BOX, EMOJI.BOX);
|
|
814
|
-
function useTheme() {
|
|
815
|
-
let e = settings_default();
|
|
816
|
-
return { isDark: computed({
|
|
817
|
-
get() {
|
|
818
|
-
return e.settings.app.colorScheme === "dark";
|
|
819
|
-
},
|
|
820
|
-
set(b) {
|
|
821
|
-
e.settings.app.colorScheme = b ? "dark" : "light";
|
|
822
|
-
}
|
|
823
|
-
}) };
|
|
824
|
-
}
|
|
825
|
-
var keepAlive_default = defineStore(STORE_NAME.KEEP_ALIVE, () => {
|
|
826
|
-
let e = ref([]);
|
|
827
|
-
function b(x) {
|
|
828
|
-
if (isString_default(x)) return !e.value.includes(x) && e.value.push(x);
|
|
829
|
-
if (isArray_default(x)) {
|
|
830
|
-
x.forEach((e) => b(e));
|
|
831
|
-
return;
|
|
832
|
-
}
|
|
833
|
-
useWarn(`KeepAlive 需要接受一个字符串或者字符串数组作为参数, 但是接受到了 ${typeof x} 类型`);
|
|
834
|
-
}
|
|
835
|
-
function x(b) {
|
|
836
|
-
isString_default(b) && (e.value = e.value.filter((e) => e !== b)), isArray_default(b) && (e.value = e.value.filter((e) => !b.includes(e)));
|
|
837
|
-
}
|
|
838
|
-
function S() {
|
|
839
|
-
e.value = [];
|
|
840
|
-
}
|
|
841
|
-
return {
|
|
842
|
-
list: e,
|
|
843
|
-
add: b,
|
|
844
|
-
remove: x,
|
|
845
|
-
clean: S
|
|
846
|
-
};
|
|
847
|
-
}), require_dist = /* @__PURE__ */ __commonJSMin(((e) => {
|
|
848
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), e.TokenData = void 0, e.compile = j, e.match = P;
|
|
849
|
-
var b = "/", x = (e) => e, S = /^[$_\p{ID_Start}]$/u, C = /^[$\u200c\u200d\p{ID_Continue}]$/u, w = "https://git.new/pathToRegexpError", T = {
|
|
850
|
-
"{": "{",
|
|
851
|
-
"}": "}",
|
|
852
|
-
"(": "(",
|
|
853
|
-
")": ")",
|
|
854
|
-
"[": "[",
|
|
855
|
-
"]": "]",
|
|
856
|
-
"+": "+",
|
|
857
|
-
"?": "?",
|
|
858
|
-
"!": "!"
|
|
859
|
-
};
|
|
860
|
-
function E(e) {
|
|
861
|
-
return e.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
|
|
862
|
-
}
|
|
863
|
-
function* D(e) {
|
|
864
|
-
let b = [...e], x = 0;
|
|
865
|
-
function E() {
|
|
866
|
-
let e = "";
|
|
867
|
-
if (S.test(b[++x])) for (e += b[x]; C.test(b[++x]);) e += b[x];
|
|
868
|
-
else if (b[x] === "\"") {
|
|
869
|
-
let S = x;
|
|
870
|
-
for (; x < b.length;) {
|
|
871
|
-
if (b[++x] === "\"") {
|
|
872
|
-
x++, S = 0;
|
|
873
|
-
break;
|
|
874
|
-
}
|
|
875
|
-
b[x] === "\\" ? e += b[++x] : e += b[x];
|
|
876
|
-
}
|
|
877
|
-
if (S) throw TypeError(`Unterminated quote at ${S}: ${w}`);
|
|
878
|
-
}
|
|
879
|
-
if (!e) throw TypeError(`Missing parameter name at ${x}: ${w}`);
|
|
880
|
-
return e;
|
|
881
|
-
}
|
|
882
|
-
for (; x < b.length;) {
|
|
883
|
-
let e = b[x], S = T[e];
|
|
884
|
-
if (S) yield {
|
|
885
|
-
type: S,
|
|
886
|
-
index: x++,
|
|
887
|
-
value: e
|
|
888
|
-
};
|
|
889
|
-
else if (e === "\\") yield {
|
|
890
|
-
type: "ESCAPED",
|
|
891
|
-
index: x++,
|
|
892
|
-
value: b[x++]
|
|
893
|
-
};
|
|
894
|
-
else if (e === ":") {
|
|
895
|
-
let e = E();
|
|
896
|
-
yield {
|
|
897
|
-
type: "PARAM",
|
|
898
|
-
index: x,
|
|
899
|
-
value: e
|
|
900
|
-
};
|
|
901
|
-
} else if (e === "*") {
|
|
902
|
-
let e = E();
|
|
903
|
-
yield {
|
|
904
|
-
type: "WILDCARD",
|
|
905
|
-
index: x,
|
|
906
|
-
value: e
|
|
907
|
-
};
|
|
908
|
-
} else yield {
|
|
909
|
-
type: "CHAR",
|
|
910
|
-
index: x,
|
|
911
|
-
value: b[x++]
|
|
912
|
-
};
|
|
913
|
-
}
|
|
914
|
-
return {
|
|
915
|
-
type: "END",
|
|
916
|
-
index: x,
|
|
917
|
-
value: ""
|
|
918
|
-
};
|
|
919
|
-
}
|
|
920
|
-
var O = class {
|
|
921
|
-
constructor(e) {
|
|
922
|
-
this.tokens = e;
|
|
923
|
-
}
|
|
924
|
-
peek() {
|
|
925
|
-
return this._peek ||= this.tokens.next().value, this._peek;
|
|
926
|
-
}
|
|
927
|
-
tryConsume(e) {
|
|
928
|
-
let b = this.peek();
|
|
929
|
-
if (b.type === e) return this._peek = void 0, b.value;
|
|
930
|
-
}
|
|
931
|
-
consume(e) {
|
|
932
|
-
let b = this.tryConsume(e);
|
|
933
|
-
if (b !== void 0) return b;
|
|
934
|
-
let { type: x, index: S } = this.peek();
|
|
935
|
-
throw TypeError(`Unexpected ${x} at ${S}, expected ${e}: ${w}`);
|
|
936
|
-
}
|
|
937
|
-
text() {
|
|
938
|
-
let e = "", b;
|
|
939
|
-
for (; b = this.tryConsume("CHAR") || this.tryConsume("ESCAPED");) e += b;
|
|
940
|
-
return e;
|
|
941
|
-
}
|
|
942
|
-
}, k = class {
|
|
943
|
-
constructor(e) {
|
|
944
|
-
this.tokens = e;
|
|
945
|
-
}
|
|
946
|
-
};
|
|
947
|
-
e.TokenData = k;
|
|
948
|
-
function A(e, b = {}) {
|
|
949
|
-
let { encodePath: S = x } = b, C = new O(D(e));
|
|
950
|
-
function w(e) {
|
|
951
|
-
let b = [];
|
|
952
|
-
for (;;) {
|
|
953
|
-
let x = C.text();
|
|
954
|
-
x && b.push({
|
|
955
|
-
type: "text",
|
|
956
|
-
value: S(x)
|
|
957
|
-
});
|
|
958
|
-
let T = C.tryConsume("PARAM");
|
|
959
|
-
if (T) {
|
|
960
|
-
b.push({
|
|
961
|
-
type: "param",
|
|
962
|
-
name: T
|
|
963
|
-
});
|
|
964
|
-
continue;
|
|
965
|
-
}
|
|
966
|
-
let E = C.tryConsume("WILDCARD");
|
|
967
|
-
if (E) {
|
|
968
|
-
b.push({
|
|
969
|
-
type: "wildcard",
|
|
970
|
-
name: E
|
|
971
|
-
});
|
|
972
|
-
continue;
|
|
973
|
-
}
|
|
974
|
-
if (C.tryConsume("{")) {
|
|
975
|
-
b.push({
|
|
976
|
-
type: "group",
|
|
977
|
-
tokens: w("}")
|
|
978
|
-
});
|
|
979
|
-
continue;
|
|
980
|
-
}
|
|
981
|
-
return C.consume(e), b;
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
return new k(w("END"));
|
|
985
|
-
}
|
|
986
|
-
function j(e, x = {}) {
|
|
987
|
-
let { encode: S = encodeURIComponent, delimiter: C = b } = x, w = M((e instanceof k ? e : A(e, x)).tokens, C, S);
|
|
988
|
-
return function(e = {}) {
|
|
989
|
-
let [b, ...x] = w(e);
|
|
990
|
-
if (x.length) throw TypeError(`Missing parameters: ${x.join(", ")}`);
|
|
991
|
-
return b;
|
|
992
|
-
};
|
|
993
|
-
}
|
|
994
|
-
function M(e, b, x) {
|
|
995
|
-
let S = e.map((e) => N(e, b, x));
|
|
996
|
-
return (e) => {
|
|
997
|
-
let b = [""];
|
|
998
|
-
for (let x of S) {
|
|
999
|
-
let [S, ...C] = x(e);
|
|
1000
|
-
b[0] += S, b.push(...C);
|
|
1001
|
-
}
|
|
1002
|
-
return b;
|
|
1003
|
-
};
|
|
1004
|
-
}
|
|
1005
|
-
function N(e, b, S) {
|
|
1006
|
-
if (e.type === "text") return () => [e.value];
|
|
1007
|
-
if (e.type === "group") {
|
|
1008
|
-
let x = M(e.tokens, b, S);
|
|
1009
|
-
return (e) => {
|
|
1010
|
-
let [b, ...S] = x(e);
|
|
1011
|
-
return S.length ? [""] : [b];
|
|
1012
|
-
};
|
|
1013
|
-
}
|
|
1014
|
-
let C = S || x;
|
|
1015
|
-
return e.type === "wildcard" && S !== !1 ? (x) => {
|
|
1016
|
-
let S = x[e.name];
|
|
1017
|
-
if (S == null) return ["", e.name];
|
|
1018
|
-
if (!Array.isArray(S) || S.length === 0) throw TypeError(`Expected "${e.name}" to be a non-empty array`);
|
|
1019
|
-
return [S.map((b, x) => {
|
|
1020
|
-
if (typeof b != "string") throw TypeError(`Expected "${e.name}/${x}" to be a string`);
|
|
1021
|
-
return C(b);
|
|
1022
|
-
}).join(b)];
|
|
1023
|
-
} : (b) => {
|
|
1024
|
-
let x = b[e.name];
|
|
1025
|
-
if (x == null) return ["", e.name];
|
|
1026
|
-
if (typeof x != "string") throw TypeError(`Expected "${e.name}" to be a string`);
|
|
1027
|
-
return [C(x)];
|
|
1028
|
-
};
|
|
1029
|
-
}
|
|
1030
|
-
function P(e, S = {}) {
|
|
1031
|
-
let { decode: C = decodeURIComponent, delimiter: w = b } = S, { regexp: T, keys: E } = F(e, S), D = E.map((e) => C === !1 ? x : e.type === "param" ? C : (e) => e.split(w).map(C));
|
|
1032
|
-
return function(e) {
|
|
1033
|
-
let b = T.exec(e);
|
|
1034
|
-
if (!b) return !1;
|
|
1035
|
-
let x = b[0], S = Object.create(null);
|
|
1036
|
-
for (let e = 1; e < b.length; e++) {
|
|
1037
|
-
if (b[e] === void 0) continue;
|
|
1038
|
-
let x = E[e - 1], C = D[e - 1];
|
|
1039
|
-
S[x.name] = C(b[e]);
|
|
1040
|
-
}
|
|
1041
|
-
return {
|
|
1042
|
-
path: x,
|
|
1043
|
-
params: S
|
|
1044
|
-
};
|
|
1045
|
-
};
|
|
1046
|
-
}
|
|
1047
|
-
function F(e, x = {}) {
|
|
1048
|
-
let { delimiter: S = b, end: C = !0, sensitive: w = !1, trailing: T = !0 } = x, D = [], O = [], j = w ? "" : "i", M = (Array.isArray(e) ? e : [e]).map((e) => e instanceof k ? e : A(e, x));
|
|
1049
|
-
for (let { tokens: e } of M) for (let b of I(e, 0, [])) {
|
|
1050
|
-
let e = L(b, S, D);
|
|
1051
|
-
O.push(e);
|
|
1052
|
-
}
|
|
1053
|
-
let N = `^(?:${O.join("|")})`;
|
|
1054
|
-
return T && (N += `(?:${E(S)}$)?`), N += C ? "$" : `(?=${E(S)}|$)`, {
|
|
1055
|
-
regexp: new RegExp(N, j),
|
|
1056
|
-
keys: D
|
|
1057
|
-
};
|
|
1058
|
-
}
|
|
1059
|
-
function* I(e, b, x) {
|
|
1060
|
-
if (b === e.length) return yield x;
|
|
1061
|
-
let S = e[b];
|
|
1062
|
-
if (S.type === "group") {
|
|
1063
|
-
let C = x.slice();
|
|
1064
|
-
for (let x of I(S.tokens, 0, C)) yield* I(e, b + 1, x);
|
|
1065
|
-
} else x.push(S);
|
|
1066
|
-
yield* I(e, b + 1, x);
|
|
1067
|
-
}
|
|
1068
|
-
function L(e, b, x) {
|
|
1069
|
-
let S = "", C = "", T = !0;
|
|
1070
|
-
for (let D = 0; D < e.length; D++) {
|
|
1071
|
-
let O = e[D];
|
|
1072
|
-
if (O.type === "text") {
|
|
1073
|
-
S += E(O.value), C += O.value, T ||= O.value.includes(b);
|
|
1074
|
-
continue;
|
|
1075
|
-
}
|
|
1076
|
-
if (O.type === "param" || O.type === "wildcard") {
|
|
1077
|
-
if (!T && !C) throw TypeError(`Missing text after "${O.name}": ${w}`);
|
|
1078
|
-
O.type === "param" ? S += `(${R(b, T ? "" : C)}+)` : S += "([\\s\\S]+)", x.push(O), C = "", T = !1;
|
|
1079
|
-
continue;
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
return S;
|
|
1083
|
-
}
|
|
1084
|
-
function R(e, b) {
|
|
1085
|
-
return b.length < 2 ? e.length < 2 ? `[^${E(e + b)}]` : `(?:(?!${E(e)})[^${E(b)}])` : e.length < 2 ? `(?:(?!${E(b)})[^${E(e)}])` : `(?:(?!${E(b)}|${E(e)})[\\s\\S])`;
|
|
1086
|
-
}
|
|
1087
|
-
}));
|
|
1088
|
-
function putRbacUserChangePassword(e, b) {
|
|
1089
|
-
return basic.Put("/rbac/user/changePassword", {}, {
|
|
1090
|
-
params: { ...e },
|
|
1091
|
-
...b || {}
|
|
1092
|
-
});
|
|
1093
|
-
}
|
|
1094
|
-
function getRbacUserUserEntireInfo(e) {
|
|
1095
|
-
return basic.Get("/rbac/user/userEntireInfo", { ...e || {} });
|
|
1096
|
-
}
|
|
1097
|
-
function getRbacResourceGrantedResources(e) {
|
|
1098
|
-
return basic.Get("/rbac/resource/grantedResources", { ...e || {} });
|
|
1099
|
-
}
|
|
1100
|
-
function postRbacResourceMineOrAllResourceTree(e, b) {
|
|
1101
|
-
return basic.Post("/rbac/resource/mineOrAllResourceTree", {}, {
|
|
1102
|
-
params: {
|
|
1103
|
-
enable: "true",
|
|
1104
|
-
...e
|
|
1105
|
-
},
|
|
1106
|
-
...b || {}
|
|
1107
|
-
});
|
|
1108
|
-
}
|
|
1109
|
-
let RESOURCE_TYPE = /* @__PURE__ */ function(e) {
|
|
1110
|
-
return e.APP = "1", e.INDEX = "2", e.MENU = "3", e.BUTTON = "4", e.NON_MENU = "5", e.DYNAMIC_APP = "7", e.IFRAME = "8", e.LINK = "9", e;
|
|
1111
|
-
}({});
|
|
1112
|
-
var rawAsyncRoutes = [];
|
|
1113
|
-
function defineAsyncRoutes(e, b) {
|
|
1114
|
-
return rawAsyncRoutes.push({
|
|
1115
|
-
routes: e,
|
|
1116
|
-
sort: b?.sort ?? 0
|
|
1117
|
-
}), e;
|
|
1118
|
-
}
|
|
1119
|
-
function getAsyncRoutes() {
|
|
1120
|
-
return rawAsyncRoutes.sort((e, b) => e?.sort - b?.sort).map((e) => e.routes).flat();
|
|
1121
|
-
}
|
|
1122
|
-
var systemRoutes = [{
|
|
1123
|
-
path: "/",
|
|
1124
|
-
meta: {
|
|
1125
|
-
title: () => settings_default().settings.home.title,
|
|
1126
|
-
breadcrumb: !1
|
|
1127
|
-
},
|
|
1128
|
-
children: [{
|
|
1129
|
-
path: "profile",
|
|
1130
|
-
name: "Profile",
|
|
1131
|
-
component: () => import("./profile-DJ3gpjsS.js"),
|
|
1132
|
-
meta: {
|
|
1133
|
-
title: "个人中心",
|
|
1134
|
-
icon: "i-iconamoon-profile-duotone"
|
|
1135
|
-
}
|
|
1136
|
-
}]
|
|
1137
|
-
}];
|
|
1138
|
-
function defineSystemRoutes(e) {
|
|
1139
|
-
systemRoutes[0].children?.push(...e);
|
|
1140
|
-
}
|
|
1141
|
-
function getSystemRoutes() {
|
|
1142
|
-
return systemRoutes[0].component || (systemRoutes[0].component = setupDefaultLayout()), systemRoutes;
|
|
1143
|
-
}
|
|
1144
|
-
function formatBackRoutes(e = [], b = {}) {
|
|
1145
|
-
let x = filterRoutes(e, [RESOURCE_TYPE.BUTTON]).map((e) => {
|
|
1146
|
-
let x = e?.children && e.children.length > 0 ? formatBackRoutes(e.children, e) : [], S = omitBy_default({
|
|
1147
|
-
id: e?.id,
|
|
1148
|
-
title: e?.name ?? "",
|
|
1149
|
-
auth: e?.code,
|
|
1150
|
-
icon: e?.icon,
|
|
1151
|
-
...e?.meta,
|
|
1152
|
-
...e.type === RESOURCE_TYPE.APP || e.type === RESOURCE_TYPE.DYNAMIC_APP ? {
|
|
1153
|
-
sidebar: !0,
|
|
1154
|
-
tabbar: !0,
|
|
1155
|
-
devText: e?.meta?.devText || "该功能暂未上线,敬请期待!"
|
|
1156
|
-
} : {},
|
|
1157
|
-
...e.type === RESOURCE_TYPE.INDEX ? { tabbar: !0 } : {}
|
|
1158
|
-
}, isUndefined_default), C = cloneDeep_default(omitBy_default({
|
|
1159
|
-
name: e?.meta?.routeName ?? void 0,
|
|
1160
|
-
path: e?.meta?.url ?? void 0,
|
|
1161
|
-
component: e?.meta?.component ?? void 0,
|
|
1162
|
-
children: x,
|
|
1163
|
-
meta: S
|
|
1164
|
-
}, isUndefined_default));
|
|
1165
|
-
switch (e.type) {
|
|
1166
|
-
case RESOURCE_TYPE.DYNAMIC_APP: return C;
|
|
1167
|
-
case RESOURCE_TYPE.INDEX: return transformIndex(C, b);
|
|
1168
|
-
case RESOURCE_TYPE.MENU:
|
|
1169
|
-
case RESOURCE_TYPE.IFRAME:
|
|
1170
|
-
case RESOURCE_TYPE.LINK: return transformMenuAndIframe(C, b);
|
|
1171
|
-
case RESOURCE_TYPE.NON_MENU: return transformNonMenu(C, b);
|
|
1172
|
-
default: return C;
|
|
1173
|
-
}
|
|
1174
|
-
});
|
|
1175
|
-
return isEmpty_default(b) ? filterEmptyComponentRoutes(x) : x;
|
|
1176
|
-
}
|
|
1177
|
-
function filterRoutes(e = [], b) {
|
|
1178
|
-
return e.filter((e) => e.type ? !b.includes(e.type) : !1);
|
|
1179
|
-
}
|
|
1180
|
-
function filterEmptyComponentRoutes(e, b = 3) {
|
|
1181
|
-
function x(e) {
|
|
1182
|
-
let b = e.children?.map(x).filter(Boolean);
|
|
1183
|
-
if (b && b.length > 0) return {
|
|
1184
|
-
...e,
|
|
1185
|
-
children: b
|
|
1186
|
-
};
|
|
1187
|
-
if (b?.length === 0 && e.component) {
|
|
1188
|
-
let { children: b, ...x } = e;
|
|
1189
|
-
return {
|
|
1190
|
-
...x,
|
|
1191
|
-
children: []
|
|
1192
|
-
};
|
|
1193
|
-
}
|
|
1194
|
-
return null;
|
|
1195
|
-
}
|
|
1196
|
-
function S(e) {
|
|
1197
|
-
return !e.children || e.children.length === 0 ? 1 : 1 + Math.max(...e.children.map(S));
|
|
1198
|
-
}
|
|
1199
|
-
return e.map(x).filter((e) => !!e).filter((e) => S(e) >= b);
|
|
1200
|
-
}
|
|
1201
|
-
function transformIndex(e, b = {}) {
|
|
1202
|
-
switch (b.type) {
|
|
1203
|
-
case RESOURCE_TYPE.DYNAMIC_APP: return {
|
|
1204
|
-
...e,
|
|
1205
|
-
path: startsWithSlash(e.path),
|
|
1206
|
-
component: setupDefaultLayout()
|
|
1207
|
-
};
|
|
1208
|
-
case RESOURCE_TYPE.INDEX: return {
|
|
1209
|
-
...e,
|
|
1210
|
-
path: e.path,
|
|
1211
|
-
component: void 0
|
|
1212
|
-
};
|
|
1213
|
-
default: return e;
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
function transformMenuAndIframe(e, b = {}) {
|
|
1217
|
-
!e?.component && !e?.meta?.iframe && !e?.meta?.link && console.warn(`[PUBINFO] 资源"${e.meta.title}"的component字段不存在, 将会导致未知错误!`);
|
|
1218
|
-
let x = cloneDeep_default(e), S = [{
|
|
1219
|
-
path: "",
|
|
1220
|
-
name: e.name,
|
|
1221
|
-
component: replaceComponent(e.component, e.meta?.scope),
|
|
1222
|
-
meta: {
|
|
1223
|
-
...e.meta,
|
|
1224
|
-
title: e.meta.title,
|
|
1225
|
-
sidebar: !1,
|
|
1226
|
-
breadcrumb: !1
|
|
1227
|
-
},
|
|
1228
|
-
children: []
|
|
1229
|
-
}, ...e.children];
|
|
1230
|
-
switch (b.type) {
|
|
1231
|
-
case RESOURCE_TYPE.DYNAMIC_APP:
|
|
1232
|
-
x = {
|
|
1233
|
-
...e,
|
|
1234
|
-
path: startsWithSlash(e.path),
|
|
1235
|
-
name: void 0,
|
|
1236
|
-
component: setupDefaultLayout(),
|
|
1237
|
-
children: S
|
|
1238
|
-
};
|
|
1239
|
-
break;
|
|
1240
|
-
case RESOURCE_TYPE.INDEX:
|
|
1241
|
-
x = {
|
|
1242
|
-
...e,
|
|
1243
|
-
path: e.path,
|
|
1244
|
-
name: void 0,
|
|
1245
|
-
component: void 0,
|
|
1246
|
-
children: S
|
|
1247
|
-
};
|
|
1248
|
-
break;
|
|
1249
|
-
}
|
|
1250
|
-
return x;
|
|
1251
|
-
}
|
|
1252
|
-
function transformNonMenu(e, b = {}) {
|
|
1253
|
-
switch (b.type) {
|
|
1254
|
-
case RESOURCE_TYPE.INDEX:
|
|
1255
|
-
case RESOURCE_TYPE.MENU:
|
|
1256
|
-
case RESOURCE_TYPE.NON_MENU: return {
|
|
1257
|
-
...e,
|
|
1258
|
-
path: e.path,
|
|
1259
|
-
component: replaceComponent(e.component, e.meta?.scope),
|
|
1260
|
-
meta: {
|
|
1261
|
-
...e.meta,
|
|
1262
|
-
sidebar: !1
|
|
1263
|
-
}
|
|
1264
|
-
};
|
|
1265
|
-
default: return e;
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
function startsWithSlash(e) {
|
|
1269
|
-
return e ? e.startsWith("/") ? e : `/${e}` : "/";
|
|
1270
|
-
}
|
|
1271
|
-
function replaceComponent(e, b) {
|
|
1272
|
-
return setupPage(e, b);
|
|
1273
|
-
}
|
|
1274
|
-
function postSysconfigAddOrEditUserThemeStyleConfig(e, b) {
|
|
1275
|
-
return basic.Post("/sysconfig/addOrEditUserThemeStyleConfig", e, {
|
|
1276
|
-
headers: { "Content-Type": "application/json" },
|
|
1277
|
-
...b || {}
|
|
1278
|
-
});
|
|
1279
|
-
}
|
|
1280
|
-
function getSysconfigGetSysThemeStyleConfig(e) {
|
|
1281
|
-
return basic.Get("/sysconfig/getSysThemeStyleConfig", { ...e || {} });
|
|
1282
|
-
}
|
|
1283
|
-
function getSysconfigGetThemeStyleConfig(e) {
|
|
1284
|
-
return basic.Get("/sysconfig/getThemeStyleConfig", { ...e || {} });
|
|
1285
|
-
}
|
|
1286
|
-
function getSysconfigGetUserThemeStyleConfig(e) {
|
|
1287
|
-
return basic.Get("/sysconfig/getUserThemeStyleConfig", { ...e || {} });
|
|
1288
|
-
}
|
|
1289
|
-
function postSysconfigResetUserThemeStyleConfig(e) {
|
|
1290
|
-
return basic.Post("/sysconfig/resetUserThemeStyleConfig", {}, { ...e || {} });
|
|
1291
|
-
}
|
|
1292
|
-
var globalSettings = {
|
|
1293
|
-
app: {
|
|
1294
|
-
lightTheme: "classic",
|
|
1295
|
-
darkTheme: "dark",
|
|
1296
|
-
colorScheme: "light",
|
|
1297
|
-
defaultLang: "zh-cn",
|
|
1298
|
-
enablePermission: !0,
|
|
1299
|
-
enableProgress: !0,
|
|
1300
|
-
enableDynamicTitle: !0,
|
|
1301
|
-
storagePrefix: "wsy_rbac",
|
|
1302
|
-
enableUserPreferences: !0,
|
|
1303
|
-
enableSettingPreferences: !0,
|
|
1304
|
-
enableAppSetting: !0
|
|
1305
|
-
},
|
|
1306
|
-
home: {
|
|
1307
|
-
enable: !1,
|
|
1308
|
-
title: "主页"
|
|
1309
|
-
},
|
|
1310
|
-
layout: {
|
|
1311
|
-
widthMode: "adaption",
|
|
1312
|
-
enableMobileAdaptation: !1
|
|
1313
|
-
},
|
|
1314
|
-
menu: {
|
|
1315
|
-
menuMode: "head",
|
|
1316
|
-
isRounded: !0,
|
|
1317
|
-
menuActiveStyle: "",
|
|
1318
|
-
switchMainMenuAndPageJump: !0,
|
|
1319
|
-
subMenuUniqueOpened: !0,
|
|
1320
|
-
subMenuOnlyOneHide: !0,
|
|
1321
|
-
subMenuCollapse: !1,
|
|
1322
|
-
enableSubMenuCollapseButton: !0,
|
|
1323
|
-
enableHotkeys: !1,
|
|
1324
|
-
showWithoutPermission: !1
|
|
1325
|
-
},
|
|
1326
|
-
topbar: {
|
|
1327
|
-
mode: "fixed",
|
|
1328
|
-
switchTabbarAndToolbar: !1
|
|
1329
|
-
},
|
|
1330
|
-
tabbar: {
|
|
1331
|
-
enable: !0,
|
|
1332
|
-
style: "fashion",
|
|
1333
|
-
enableIcon: !0,
|
|
1334
|
-
mergeTabsBy: "activeMenu",
|
|
1335
|
-
enableMemory: !0,
|
|
1336
|
-
enableHotkeys: !0,
|
|
1337
|
-
storageTo: "local"
|
|
1338
|
-
},
|
|
1339
|
-
toolbar: {
|
|
1340
|
-
enableNotification: !0,
|
|
1341
|
-
enableFullscreen: !0,
|
|
1342
|
-
enablePageReload: !0,
|
|
1343
|
-
enableColorScheme: !0
|
|
1344
|
-
},
|
|
1345
|
-
favorites: {
|
|
1346
|
-
enable: !0,
|
|
1347
|
-
storageTo: "local"
|
|
1348
|
-
},
|
|
1349
|
-
breadcrumb: {
|
|
1350
|
-
enable: !0,
|
|
1351
|
-
style: "",
|
|
1352
|
-
enableMainMenu: !0
|
|
1353
|
-
},
|
|
1354
|
-
mainPage: {
|
|
1355
|
-
enableHotkeys: !0,
|
|
1356
|
-
iframeCacheMax: 3,
|
|
1357
|
-
enableTransition: !0,
|
|
1358
|
-
transitionMode: "fade"
|
|
1359
|
-
},
|
|
1360
|
-
navSearch: {
|
|
1361
|
-
enable: !0,
|
|
1362
|
-
enableHotkeys: !0
|
|
1363
|
-
},
|
|
1364
|
-
copyright: {
|
|
1365
|
-
enable: !1,
|
|
1366
|
-
dates: "2024-2025",
|
|
1367
|
-
company: "浙江省公众信息产业有限公司",
|
|
1368
|
-
website: "",
|
|
1369
|
-
beian: ""
|
|
1370
|
-
},
|
|
1371
|
-
watermark: {
|
|
1372
|
-
enable: !1,
|
|
1373
|
-
text: "PUBINFO",
|
|
1374
|
-
width: 150,
|
|
1375
|
-
x: 0,
|
|
1376
|
-
y: 0,
|
|
1377
|
-
x_space: 50,
|
|
1378
|
-
y_space: 50,
|
|
1379
|
-
alpha: .1
|
|
1380
|
-
}
|
|
1381
|
-
};
|
|
1382
|
-
function defineSettings(e) {
|
|
1383
|
-
return globalSettings = defaultsDeep_default(e, globalSettings), e;
|
|
1384
|
-
}
|
|
1385
|
-
function getSettings() {
|
|
1386
|
-
return globalSettings;
|
|
1387
|
-
}
|
|
1388
|
-
function objectToPaths(e, b = "") {
|
|
1389
|
-
return reduce_default(e, (e, x, S) => {
|
|
1390
|
-
let w = b.length ? `${b}.${S}` : S;
|
|
1391
|
-
return isObject_default(x) && !isArray_default(x) && !isEmpty_default(x) ? e = e.concat(objectToPaths(x, w)) : e.push(w), e;
|
|
1392
|
-
}, []);
|
|
1393
|
-
}
|
|
1394
|
-
var settings_default = defineStore(STORE_NAME.SETTINGS, () => {
|
|
1395
|
-
let e = getSettings(), b = ref(e), x = ref({}), S = ref(e), C = ref(!1);
|
|
1396
|
-
watchDiffObject(S, (e) => {
|
|
1397
|
-
if (!C.value) return;
|
|
1398
|
-
let S = objectToPaths(e);
|
|
1399
|
-
if (objectToPaths(x.value).includes(S.at(0))) {
|
|
1400
|
-
if (storage.session.has("userSettingIsGod")) return;
|
|
1401
|
-
modal_default.confirm({
|
|
1402
|
-
title: "系统设置提示",
|
|
1403
|
-
icon: createVNode(FrownOutlined_default),
|
|
1404
|
-
content: "当前设置被个人设置覆盖无法预览当前全局系统配置,是否需要恢复个人设置为系统默认设置",
|
|
1405
|
-
okText: "重置个人配置",
|
|
1406
|
-
cancelText: "不在提示",
|
|
1407
|
-
onOk() {
|
|
1408
|
-
$();
|
|
1409
|
-
},
|
|
1410
|
-
onCancel() {
|
|
1411
|
-
storage.session.set("userSettingIsGod", "");
|
|
1412
|
-
}
|
|
1413
|
-
});
|
|
1414
|
-
} else {
|
|
1415
|
-
let x = get_default(e, S.at(0));
|
|
1416
|
-
set_default(b.value, S.at(0), x);
|
|
1417
|
-
}
|
|
1418
|
-
}, { flush: "post" }), watch([
|
|
1419
|
-
() => b.value.app.colorScheme,
|
|
1420
|
-
() => b.value.app.lightTheme,
|
|
1421
|
-
() => b.value.app.darkTheme
|
|
1422
|
-
], ([e, b, x]) => {
|
|
1423
|
-
switch (e === "" && (e = usePreferredDark() ? "dark" : "light"), e) {
|
|
1424
|
-
case "light":
|
|
1425
|
-
document.documentElement.classList.remove("dark"), document.body.setAttribute("data-theme", b);
|
|
1426
|
-
break;
|
|
1427
|
-
case "dark":
|
|
1428
|
-
document.documentElement.classList.add("dark"), document.body.setAttribute("data-theme", x);
|
|
1429
|
-
break;
|
|
1430
|
-
}
|
|
1431
|
-
}, { immediate: !0 }), watch(() => b.value.layout.widthMode, (e) => {
|
|
1432
|
-
document.body.setAttribute("data-app-width-mode", e);
|
|
1433
|
-
}, { immediate: !0 }), watch(() => b.value.menu.menuMode, (e) => {
|
|
1434
|
-
document.body.setAttribute("data-menu-mode", e);
|
|
1435
|
-
}, { immediate: !0 });
|
|
1436
|
-
let w = ref("other"), T = navigator.userAgent.toLowerCase();
|
|
1437
|
-
switch (!0) {
|
|
1438
|
-
case T.includes("mac os"):
|
|
1439
|
-
w.value = "mac";
|
|
1440
|
-
break;
|
|
1441
|
-
case T.includes("windows"):
|
|
1442
|
-
w.value = "windows";
|
|
1443
|
-
break;
|
|
1444
|
-
case T.includes("linux"):
|
|
1445
|
-
w.value = "linux";
|
|
1446
|
-
break;
|
|
1447
|
-
}
|
|
1448
|
-
let E = ref();
|
|
1449
|
-
function D(e) {
|
|
1450
|
-
Array.isArray(e) ? (useWarn("在使用数据范围的时候,router auth字段不能为数组"), E.value = e[0] || "") : E.value = e;
|
|
1451
|
-
}
|
|
1452
|
-
let O = ref();
|
|
1453
|
-
function k(e) {
|
|
1454
|
-
O.value = e;
|
|
1455
|
-
}
|
|
1456
|
-
let A = ref([]);
|
|
1457
|
-
function j(e, b) {
|
|
1458
|
-
let x = A.value.findIndex((b) => b.fullPath === e);
|
|
1459
|
-
x > -1 ? A.value[x].title = b : A.value.push({
|
|
1460
|
-
fullPath: e,
|
|
1461
|
-
title: b
|
|
1462
|
-
});
|
|
1463
|
-
}
|
|
1464
|
-
function M(e) {
|
|
1465
|
-
let b = A.value.findIndex((b) => b.fullPath === e);
|
|
1466
|
-
b > -1 && A.value.splice(b, 1);
|
|
1467
|
-
}
|
|
1468
|
-
let N = ref("pc");
|
|
1469
|
-
function P(e) {
|
|
1470
|
-
b.value.layout.enableMobileAdaptation ? /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? N.value = "mobile" : N.value = e < 992 ? "mobile" : "pc" : N.value = "pc";
|
|
1471
|
-
}
|
|
1472
|
-
let F = ref(e.menu.subMenuCollapse);
|
|
1473
|
-
function I() {
|
|
1474
|
-
b.value.menu.subMenuCollapse = !b.value.menu.subMenuCollapse, N.value === "pc" && (F.value = !F.value);
|
|
1475
|
-
}
|
|
1476
|
-
watch(N, (e) => {
|
|
1477
|
-
switch (e) {
|
|
1478
|
-
case "pc":
|
|
1479
|
-
b.value.menu.subMenuCollapse = F.value;
|
|
1480
|
-
break;
|
|
1481
|
-
case "mobile":
|
|
1482
|
-
b.value.menu.subMenuCollapse = !0;
|
|
1483
|
-
break;
|
|
1484
|
-
}
|
|
1485
|
-
document.body.setAttribute("data-mode", e);
|
|
1486
|
-
}, { immediate: !0 });
|
|
1487
|
-
function L(e) {
|
|
1488
|
-
b.value.app.defaultLang = e;
|
|
1489
|
-
}
|
|
1490
|
-
function R(e) {
|
|
1491
|
-
b.value.app.colorScheme = e;
|
|
1492
|
-
}
|
|
1493
|
-
let [V, U] = useToggle(!1);
|
|
1494
|
-
function W(x, S = !1) {
|
|
1495
|
-
b.value = defaultsDeep_default(x, S ? e : b.value);
|
|
1496
|
-
}
|
|
1497
|
-
function G(b) {
|
|
1498
|
-
S.value = defaultsDeep_default(b, e);
|
|
1499
|
-
}
|
|
1500
|
-
function K(e) {
|
|
1501
|
-
Object.keys(e).length > 0 ? x.value = defaultsDeep_default(e, cloneDeep_default(x.value)) : x.value = {};
|
|
1502
|
-
}
|
|
1503
|
-
function q(e = !0) {
|
|
1504
|
-
C.value = e;
|
|
1505
|
-
}
|
|
1506
|
-
async function J() {
|
|
1507
|
-
let e = (await getSysconfigGetThemeStyleConfig())?.data?.content;
|
|
1508
|
-
e && W(JSON.parse(e || "{}"), !0);
|
|
1509
|
-
}
|
|
1510
|
-
async function Y() {
|
|
1511
|
-
let e = (await getSysconfigGetUserThemeStyleConfig())?.data?.content;
|
|
1512
|
-
e && K(JSON.parse(e || "{}"));
|
|
1513
|
-
}
|
|
1514
|
-
async function X() {
|
|
1515
|
-
let e = (await getSysconfigGetSysThemeStyleConfig())?.data?.content;
|
|
1516
|
-
e && G(JSON.parse(e || "{}"));
|
|
1517
|
-
}
|
|
1518
|
-
async function Z() {
|
|
1519
|
-
await Promise.all([
|
|
1520
|
-
J(),
|
|
1521
|
-
X(),
|
|
1522
|
-
Y()
|
|
1523
|
-
]), q(!0);
|
|
1524
|
-
}
|
|
1525
|
-
async function Q(e) {
|
|
1526
|
-
await postSysconfigAddOrEditUserThemeStyleConfig({ content: JSON.stringify(e) }), K(e);
|
|
1527
|
-
}
|
|
1528
|
-
async function $() {
|
|
1529
|
-
await postSysconfigResetUserThemeStyleConfig(), await J(), await Y(), Message.success("已还原系统设置");
|
|
1530
|
-
}
|
|
1531
|
-
return {
|
|
1532
|
-
settings: b,
|
|
1533
|
-
os: w,
|
|
1534
|
-
auth: E,
|
|
1535
|
-
setAuth: D,
|
|
1536
|
-
title: O,
|
|
1537
|
-
setTitle: k,
|
|
1538
|
-
customTitleList: A,
|
|
1539
|
-
setCustomTitle: j,
|
|
1540
|
-
resetCustomTitle: M,
|
|
1541
|
-
mode: N,
|
|
1542
|
-
setMode: P,
|
|
1543
|
-
subMenuCollapseLastStatus: F,
|
|
1544
|
-
toggleSidebarCollapse: I,
|
|
1545
|
-
setDefaultLang: L,
|
|
1546
|
-
setColorScheme: R,
|
|
1547
|
-
mainPageMaximizeStatus: V,
|
|
1548
|
-
setMainPageMaximize: U,
|
|
1549
|
-
updateSettings: W,
|
|
1550
|
-
globalSettings: S,
|
|
1551
|
-
updateGlobalSettings: G,
|
|
1552
|
-
userSettings: x,
|
|
1553
|
-
updateUserSettings: K,
|
|
1554
|
-
setGlobaleSettingsFlag: q,
|
|
1555
|
-
getPreferencesAll: Z,
|
|
1556
|
-
setPreferencesSetting: Q,
|
|
1557
|
-
resetSettings: $
|
|
1558
|
-
};
|
|
1559
|
-
}), tabbar_default = defineStore(STORE_NAME.TABBAR, () => {
|
|
1560
|
-
let e = settings_default(), b = route_default(), x = keepAlive_default(), S = iframe_default(), C = ref([]), w = ref(-1);
|
|
1561
|
-
function T() {
|
|
1562
|
-
let x = [];
|
|
1563
|
-
function S(b) {
|
|
1564
|
-
b.children && b.children.forEach((b) => {
|
|
1565
|
-
if (b.meta?.permanent && b.meta?.breadcrumbNeste && b.meta?.tabbar !== !1) {
|
|
1566
|
-
let S = b.meta.breadcrumbNeste.at(-1)?.path, C = e.settings.tabbar.mergeTabsBy === "activeMenu" && b.meta.activeMenu || S;
|
|
1567
|
-
x.push({
|
|
1568
|
-
tabId: C,
|
|
1569
|
-
fullPath: S,
|
|
1570
|
-
routeName: b.name,
|
|
1571
|
-
activeMenu: b.meta.activeMenu,
|
|
1572
|
-
title: typeof b.meta.title == "function" ? b.meta.title() : b.meta.title,
|
|
1573
|
-
iframe: b.meta.iframe,
|
|
1574
|
-
icon: b.meta?.icon ?? b.meta?.breadcrumbNeste?.findLast((e) => e.icon)?.icon,
|
|
1575
|
-
activeIcon: b.meta?.activeIcon ?? b.meta?.breadcrumbNeste?.findLast((e) => e.activeIcon)?.activeIcon,
|
|
1576
|
-
name: b.name ? [b.name] : [],
|
|
1577
|
-
customTitleList: [],
|
|
1578
|
-
isPin: b.meta?.pin === void 0 ? !1 : b.meta?.pin,
|
|
1579
|
-
isTabbar: b.meta?.tabbar !== !1,
|
|
1580
|
-
isPermanent: !0
|
|
1581
|
-
});
|
|
1582
|
-
}
|
|
1583
|
-
});
|
|
1584
|
-
}
|
|
1585
|
-
b.flatSystemRoutes.forEach(S), b.flatRoutes.forEach(S), x.length && C.value.unshift(...x);
|
|
1586
|
-
}
|
|
1587
|
-
async function E(b) {
|
|
1588
|
-
let x = [];
|
|
1589
|
-
b.matched.forEach((e, b) => {
|
|
1590
|
-
b > 0 && e.components?.default.name && x.push(e.components.default.name);
|
|
1591
|
-
});
|
|
1592
|
-
let S = b.matched.at(-1)?.meta, T = e.settings.tabbar.mergeTabsBy === "activeMenu" ? S?.activeMenu ?? b.fullPath : b.fullPath;
|
|
1593
|
-
if (b.name !== "Reload" && S?.tabbar !== !1) {
|
|
1594
|
-
let E = C.value.find((x) => e.settings.tabbar.mergeTabsBy === "routeName" && x.routeName ? x.routeName === b.name : x.tabId === T);
|
|
1595
|
-
if (E) e.settings.tabbar.mergeTabsBy !== "" && (E.tabId = T, E.fullPath = b.fullPath, E.routeName = b.name, E.activeMenu = S?.activeMenu, E.title = typeof S?.title == "function" ? S.title() : S?.title, E.iframe = S?.iframe, E.icon = S?.icon ?? S?.breadcrumbNeste?.findLast((e) => e.icon)?.icon, E.activeIcon = S?.activeIcon ?? S?.breadcrumbNeste?.findLast((e) => e.activeIcon)?.activeIcon, E.isTabbar = S?.tabbar !== !1);
|
|
1596
|
-
else {
|
|
1597
|
-
let e = {
|
|
1598
|
-
tabId: T,
|
|
1599
|
-
fullPath: b.fullPath,
|
|
1600
|
-
routeName: b.name,
|
|
1601
|
-
activeMenu: S?.activeMenu,
|
|
1602
|
-
title: typeof S?.title == "function" ? S.title() : S?.title,
|
|
1603
|
-
iframe: S?.iframe,
|
|
1604
|
-
icon: S?.icon ?? S?.breadcrumbNeste?.findLast((e) => e.icon)?.icon,
|
|
1605
|
-
activeIcon: S?.activeIcon ?? S?.breadcrumbNeste?.findLast((e) => e.activeIcon)?.activeIcon,
|
|
1606
|
-
name: x,
|
|
1607
|
-
customTitleList: [],
|
|
1608
|
-
isPin: S?.pin === void 0 ? !1 : S?.pin,
|
|
1609
|
-
isTabbar: S?.tabbar !== !1,
|
|
1610
|
-
isPermanent: !1
|
|
1611
|
-
};
|
|
1612
|
-
w.value >= 0 ? (C.value.splice(w.value + 1, 0, e), w.value = -1) : C.value.push(e);
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
}
|
|
1616
|
-
function D(e) {
|
|
1617
|
-
let b = [], w = [], T = [];
|
|
1618
|
-
C.value.forEach((x, S) => {
|
|
1619
|
-
e(x, S) ? x.iframe ? T.push(x.tabId) : w.push(...x.name) : b.push(...x.name);
|
|
1620
|
-
}), x.remove(w.filter((e) => !b.includes(e))), S.close(T);
|
|
1621
|
-
}
|
|
1622
|
-
function O(e) {
|
|
1623
|
-
D((b) => b.tabId === e), C.value = C.value.filter((b) => b.tabId !== e);
|
|
1624
|
-
}
|
|
1625
|
-
function k(e) {
|
|
1626
|
-
D((b) => b.tabId !== e && !b.isPermanent && !b.isPin), C.value = C.value.filter((b) => b.tabId === e || b.isPermanent || b.isPin);
|
|
1627
|
-
}
|
|
1628
|
-
function A(e) {
|
|
1629
|
-
let b = C.value.findIndex((b) => b.tabId === e);
|
|
1630
|
-
D((e, x) => x < b && !e.isPermanent && !e.isPin), C.value = C.value.filter((e, x) => x >= b || e.isPermanent || e.isPin);
|
|
1631
|
-
}
|
|
1632
|
-
function j(e) {
|
|
1633
|
-
let b = C.value.findIndex((b) => b.tabId === e);
|
|
1634
|
-
D((e, x) => x > b && !e.isPermanent && !e.isPin), C.value = C.value.filter((e, x) => x <= b || e.isPermanent || e.isPin);
|
|
1635
|
-
}
|
|
1636
|
-
function M(e) {
|
|
1637
|
-
let b = C.value.findIndex((b) => b.tabId === e), x = -1;
|
|
1638
|
-
C.value.forEach((e, b) => {
|
|
1639
|
-
(e.isPermanent || e.isPin) && (x = b);
|
|
1640
|
-
}), b > x && (C.value.splice(x + 1, 0, C.value[b]), C.value.splice(b + 1, 1)), C.value.forEach((b) => {
|
|
1641
|
-
b.tabId === e && (b.isPin = !0);
|
|
1642
|
-
});
|
|
1643
|
-
}
|
|
1644
|
-
function N(e) {
|
|
1645
|
-
let b = C.value.findIndex((b) => b.tabId === e), x = -1;
|
|
1646
|
-
C.value.forEach((e, b) => {
|
|
1647
|
-
(e.isPermanent || e.isPin) && (x = b);
|
|
1648
|
-
}), C.value.splice(x + 1, 0, C.value[b]), C.value.splice(b, 1), C.value.forEach((b) => {
|
|
1649
|
-
b.tabId === e && (b.isPin = !1);
|
|
1650
|
-
});
|
|
1651
|
-
}
|
|
1652
|
-
function P() {
|
|
1653
|
-
C.value = [];
|
|
1654
|
-
}
|
|
1655
|
-
function F(e, b) {
|
|
1656
|
-
C.value.splice(e, 0, C.value.splice(b, 1)[0]);
|
|
1657
|
-
}
|
|
1658
|
-
function I({ tabId: e, title: b }) {
|
|
1659
|
-
C.value.forEach((x) => {
|
|
1660
|
-
if (x.tabId === e) {
|
|
1661
|
-
let e = x.customTitleList.find((e) => e.fullPath === x.fullPath);
|
|
1662
|
-
e ? e.title = b : x.customTitleList.push({
|
|
1663
|
-
fullPath: x.fullPath,
|
|
1664
|
-
title: b
|
|
1665
|
-
});
|
|
1666
|
-
}
|
|
1667
|
-
});
|
|
1668
|
-
}
|
|
1669
|
-
function L(e) {
|
|
1670
|
-
C.value.forEach((b) => {
|
|
1671
|
-
if (b.tabId === e) {
|
|
1672
|
-
let e = b.customTitleList.findIndex((e) => e.fullPath === b.fullPath);
|
|
1673
|
-
e > -1 && b.customTitleList.splice(e, 1);
|
|
1674
|
-
}
|
|
1675
|
-
});
|
|
1676
|
-
}
|
|
1677
|
-
return {
|
|
1678
|
-
list: C,
|
|
1679
|
-
leaveIndex: w,
|
|
1680
|
-
initPermanentTab: T,
|
|
1681
|
-
add: E,
|
|
1682
|
-
remove: O,
|
|
1683
|
-
removeOtherSide: k,
|
|
1684
|
-
removeLeftSide: A,
|
|
1685
|
-
removeRightSide: j,
|
|
1686
|
-
pin: M,
|
|
1687
|
-
unPin: N,
|
|
1688
|
-
clean: P,
|
|
1689
|
-
sort: F,
|
|
1690
|
-
setCustomTitle: I,
|
|
1691
|
-
resetCustomTitle: L
|
|
1692
|
-
};
|
|
1693
|
-
}), user_default = defineStore(STORE_NAME.USER, () => {
|
|
1694
|
-
let { router: e } = usePubinfoContext(), b = reactive({
|
|
1695
|
-
account: "",
|
|
1696
|
-
userId: "",
|
|
1697
|
-
token: "",
|
|
1698
|
-
avatar: "",
|
|
1699
|
-
refreshToken: "",
|
|
1700
|
-
orgList: [],
|
|
1701
|
-
orgId: "",
|
|
1702
|
-
permissions: [],
|
|
1703
|
-
department: ""
|
|
1704
|
-
}), x = computed(() => !!b.token), S = computed(() => {
|
|
1705
|
-
let e;
|
|
1706
|
-
return e = b.orgId ? find_default(b.orgList, ["orgId", b.orgId])?.orgName : find_default(b.orgList, ["main", !0])?.orgName, e || "";
|
|
1707
|
-
});
|
|
1708
|
-
async function C(e) {
|
|
1709
|
-
let { account: b, password: x, captchaHash: S, captchas: C, loginType: w = "password" } = e, T = await postAuthLogin({
|
|
1710
|
-
loginType: w,
|
|
1711
|
-
loginName: b,
|
|
1712
|
-
loginPwd: await publicKeyEncryption(x),
|
|
1713
|
-
codeHash: S,
|
|
1714
|
-
code: C
|
|
1715
|
-
}), { accessToken: E, refreshToken: D } = T.data;
|
|
1716
|
-
return k(E, D), T;
|
|
1717
|
-
}
|
|
1718
|
-
async function w(e) {
|
|
1719
|
-
let { account: b, password: x, captchaHash: S, captchas: C, loginType: w = "password", captchaType: T } = e, E = await postAuthLoginNew({
|
|
1720
|
-
loginType: w,
|
|
1721
|
-
loginName: b,
|
|
1722
|
-
loginPwd: await publicKeyEncryption(x),
|
|
1723
|
-
codeHash: S,
|
|
1724
|
-
code: C,
|
|
1725
|
-
captchaType: T
|
|
1726
|
-
}), { accessToken: D, refreshToken: O } = E.data;
|
|
1727
|
-
return k(D, O), E;
|
|
1728
|
-
}
|
|
1729
|
-
function T() {
|
|
1730
|
-
e?.push({ name: "Login" });
|
|
1731
|
-
}
|
|
1732
|
-
function E() {
|
|
1733
|
-
b.account = "", b.userId = "", b.token = "", b.refreshToken = "", b.avatar = "", b.permissions = [], b.orgId = "", b.orgList = [];
|
|
1734
|
-
}
|
|
1735
|
-
async function D() {
|
|
1736
|
-
let e = await getRbacUserUserEntireInfo(), x = e.data;
|
|
1737
|
-
return b.account = x.realName || x.loginName, b.avatar = x.userPic, b.userId = x.id, b.orgList = x.userOrgList, x.userOrgList?.length && !b.orgId && (b.orgId = find_default(x.userOrgList, ["main", !0]).orgId), e;
|
|
1738
|
-
}
|
|
1739
|
-
async function O(e) {
|
|
1740
|
-
let b = {};
|
|
1741
|
-
return e.token && (b.authorization = e.token), await putRbacUserChangePassword({
|
|
1742
|
-
oldPassword: await publicKeyEncryption(e.oldPassword),
|
|
1743
|
-
newPassword: await publicKeyEncryption(e.newPassword)
|
|
1744
|
-
}, { headers: b });
|
|
1745
|
-
}
|
|
1746
|
-
function k(e, x) {
|
|
1747
|
-
b.token = e, b.refreshToken = x;
|
|
1748
|
-
}
|
|
1749
|
-
async function A() {
|
|
1750
|
-
return b.permissions = (await getRbacResourceGrantedResources()).data, b.permissions;
|
|
1751
|
-
}
|
|
1752
|
-
async function j(x) {
|
|
1753
|
-
let { accessToken: S, refreshToken: C } = (await postAuthChangeLoginOrg({ orgId: x })).data;
|
|
1754
|
-
k(S, C), b.orgId = x, e?.push({ path: "/" });
|
|
1755
|
-
}
|
|
1756
|
-
return {
|
|
1757
|
-
user: b,
|
|
1758
|
-
userOrgName: S,
|
|
1759
|
-
isLogin: x,
|
|
1760
|
-
getUserInfo: D,
|
|
1761
|
-
getPermissions: A,
|
|
1762
|
-
login: C,
|
|
1763
|
-
signIn: w,
|
|
1764
|
-
logout: T,
|
|
1765
|
-
changePassword: O,
|
|
1766
|
-
changeOrg: j,
|
|
1767
|
-
setToken: k,
|
|
1768
|
-
clean: E
|
|
1769
|
-
};
|
|
1770
|
-
}, { persist: !0 }), route_default = defineStore(STORE_NAME.ROUTE, () => {
|
|
1771
|
-
let e = getAsyncRoutes(), b = settings_default(), x = user_default(), S = tabbar_default(), C = ref(!1), w = ref([]), T = ref([]), E = ref([]), D = ref([]), O = computed(() => {
|
|
1772
|
-
let { app: e, menu: x } = b.settings;
|
|
1773
|
-
return e.enablePermission && !x.showWithoutPermission;
|
|
1774
|
-
});
|
|
1775
|
-
function k(e, b) {
|
|
1776
|
-
let { title: x, icon: S, activeIcon: C, breadcrumb: w = !0 } = defaultTo_default(e.meta, {});
|
|
1777
|
-
return {
|
|
1778
|
-
path: defaultTo_default(b, e.path),
|
|
1779
|
-
title: x,
|
|
1780
|
-
icon: S,
|
|
1781
|
-
activeIcon: C,
|
|
1782
|
-
hide: !w
|
|
1783
|
-
};
|
|
1784
|
-
}
|
|
1785
|
-
function j(e, b, x, S) {
|
|
1786
|
-
let C = cloneDeep_default(S), w = k(e, b);
|
|
1787
|
-
C.push(w);
|
|
1788
|
-
function T(e) {
|
|
1789
|
-
return has_default(e, "children") ? omit_default(e, "children") : e;
|
|
1790
|
-
}
|
|
1791
|
-
let E = {
|
|
1792
|
-
path: b,
|
|
1793
|
-
meta: {
|
|
1794
|
-
auth: x,
|
|
1795
|
-
breadcrumbNeste: C
|
|
1796
|
-
}
|
|
1797
|
-
};
|
|
1798
|
-
return merge_default(T(cloneDeep_default(toRaw(e))), E);
|
|
1799
|
-
}
|
|
1800
|
-
function M(e) {
|
|
1801
|
-
return e.children &&= N(e.children, [k(e)], e.path, e.meta?.auth), e;
|
|
1802
|
-
}
|
|
1803
|
-
function N(e, b = [], x = "", S) {
|
|
1804
|
-
return toRaw(e).reduce((e, C) => {
|
|
1805
|
-
let w = resolveRoutePath(x, C.path), T = defaultTo_default(C.meta?.auth, S), E = j(C, w, T, b);
|
|
1806
|
-
return e.push(E), C.children && N(C.children, E?.meta?.breadcrumbNeste, w, T).forEach((b) => {
|
|
1807
|
-
e.some((e) => e.path === b.path) ? e.forEach((x, S) => {
|
|
1808
|
-
x.path === b.path && (e[S] = b);
|
|
1809
|
-
}) : e.push(b);
|
|
1810
|
-
}), e;
|
|
1811
|
-
}, []);
|
|
1812
|
-
}
|
|
1813
|
-
let P = computed(() => {
|
|
1814
|
-
let e = [];
|
|
1815
|
-
return w.value.length && (w.value.forEach((b) => {
|
|
1816
|
-
if (get_default(b, "meta.isDev", !1)) {
|
|
1817
|
-
useWarn(`开发模式应用"${b.meta?.title}"的子路由将不会被注册到vue-router中`);
|
|
1818
|
-
return;
|
|
1819
|
-
}
|
|
1820
|
-
if (b.children?.length) {
|
|
1821
|
-
let x = cloneDeep_default(b.children);
|
|
1822
|
-
x = x.map((e) => merge_default(e, { meta: { auth: defaultTo_default(e.meta?.auth, b.meta?.auth) } })), e.push(...x);
|
|
1823
|
-
}
|
|
1824
|
-
}), e.forEach((e) => M(e))), e;
|
|
1825
|
-
}), I = computed(() => {
|
|
1826
|
-
let e = [...getSystemRoutes()];
|
|
1827
|
-
return e.forEach((e) => M(e)), e;
|
|
1828
|
-
});
|
|
1829
|
-
function L(e, b) {
|
|
1830
|
-
if (isUndefined_default(b.meta?.auth)) return !0;
|
|
1831
|
-
let x = b.meta.auth;
|
|
1832
|
-
return toRaw(e).some((e) => isString_default(x) ? x === "" ? !0 : x === e : isArray_default(x) ? x.length === 0 ? !0 : x.includes(e) : (useWarn("路由权限类型配置错误, 请检查路由 meta.auth"), !1));
|
|
1833
|
-
}
|
|
1834
|
-
function R(e, b) {
|
|
1835
|
-
let x = [];
|
|
1836
|
-
return e.forEach((e) => {
|
|
1837
|
-
if (L(b, e)) {
|
|
1838
|
-
let S = cloneDeep_default(e);
|
|
1839
|
-
S.children && S.children.length > 0 ? (S.children = R(S.children, b), (S.children.length || get_default(S, "meta.isDev", !1)) && x.push(S)) : (get_default(S, "meta.isDev", !1) && (S.children = []), x.push(S));
|
|
1840
|
-
}
|
|
1841
|
-
}), x;
|
|
1842
|
-
}
|
|
1843
|
-
let B = computed(() => O.value ? R(w.value, x?.user?.permissions ?? []) : cloneDeep_default(w.value));
|
|
1844
|
-
function V(e) {
|
|
1845
|
-
return e.map((e) => {
|
|
1846
|
-
let b = setupDefaultLayout(e?.meta?.layoutComponent);
|
|
1847
|
-
return e.children && e.children.length > 0 && e.children.forEach((x, S, C) => {
|
|
1848
|
-
if (x.meta?.singleMenu) {
|
|
1849
|
-
let { name: e, ...w } = x;
|
|
1850
|
-
C[S] = {
|
|
1851
|
-
...w,
|
|
1852
|
-
component: b,
|
|
1853
|
-
children: [{
|
|
1854
|
-
path: "",
|
|
1855
|
-
name: e,
|
|
1856
|
-
component: x.component,
|
|
1857
|
-
meta: {
|
|
1858
|
-
title: x.meta.title,
|
|
1859
|
-
sidebar: !1,
|
|
1860
|
-
breadcrumb: !1
|
|
1861
|
-
}
|
|
1862
|
-
}]
|
|
1863
|
-
}, delete C[S].meta.singleMenu;
|
|
1864
|
-
}
|
|
1865
|
-
x.component ||= b, e.meta?.provider && (x.meta = {
|
|
1866
|
-
...x.meta,
|
|
1867
|
-
provider: e.meta.provider
|
|
1868
|
-
});
|
|
1869
|
-
}), e;
|
|
1870
|
-
}), e;
|
|
1871
|
-
}
|
|
1872
|
-
function H(e) {
|
|
1873
|
-
return e.length ? e.filter((e) => (e.children && e.children.length > 0 && (e.children = H(e.children)), e?.meta?.enabled !== !1)) : [];
|
|
1874
|
-
}
|
|
1875
|
-
async function W() {
|
|
1876
|
-
b.settings.app.enablePermission && await x.getPermissions();
|
|
1877
|
-
let E = await postRbacResourceMineOrAllResourceTree({ needAll: !O.value });
|
|
1878
|
-
if (E.success) {
|
|
1879
|
-
T.value = E?.data ?? [];
|
|
1880
|
-
let b = V(H(cloneDeep_default(e))), x = E.data?.map((e) => {
|
|
1881
|
-
if (e.type === RESOURCE_TYPE.APP) {
|
|
1882
|
-
let x = b.find((b) => b.meta?.auth === e.code);
|
|
1883
|
-
return x && get_default(x, "meta.isDev", !1) && useWarn(`静态应用"${x.meta?.title}"处于开发模式,将在TopMode中显示开发状态`), x;
|
|
1884
|
-
}
|
|
1885
|
-
return e.type === RESOURCE_TYPE.DYNAMIC_APP ? (e.meta?.isDev && useWarn(`动态应用"${e.name}"处于开发模式,将在TopMode中显示开发状态`), formatBackRoutes([e])[0]) : !1;
|
|
1886
|
-
}).filter((e) => !!e) ?? [], S = b.filter((e) => {
|
|
1887
|
-
let { auth: b } = e.meta ?? {};
|
|
1888
|
-
return isString_default(b) ? !E.data?.map((e) => e.code).includes(b) : !0;
|
|
1889
|
-
});
|
|
1890
|
-
w.value = await callHookAsync("route:transform", G([...x, ...S], E.data ?? []));
|
|
1891
|
-
}
|
|
1892
|
-
C.value = !0, b.settings.tabbar.enable && S.initPermanentTab();
|
|
1893
|
-
}
|
|
1894
|
-
function G(e, b) {
|
|
1895
|
-
let x = new Map(b.map((e, b) => [e.code, b])), S = e.filter((e) => x.has(e.meta?.auth)), C = e.filter((e) => !x.has(e.meta?.auth));
|
|
1896
|
-
return S.sort((e, b) => (x.get(e.meta.auth) ?? Infinity) - (x.get(b.meta.auth) ?? Infinity)), [...S, ...C];
|
|
1897
|
-
}
|
|
1898
|
-
function K(e) {
|
|
1899
|
-
D.value = e;
|
|
1900
|
-
}
|
|
1901
|
-
function q(e = !1) {
|
|
1902
|
-
C.value = !1, w.value = [], E.value = [], e ? D.value = D.value.filter((e) => e.system) : (D.value.forEach((e) => e()), D.value = []);
|
|
1903
|
-
}
|
|
1904
|
-
function J(e) {
|
|
1905
|
-
let b = e ?? (typeof useRoute == "function" ? useRoute() : void 0);
|
|
1906
|
-
if (!b) {
|
|
1907
|
-
useWarn("getRemoteRouteById: 无法获取路由对象");
|
|
1908
|
-
return;
|
|
1909
|
-
}
|
|
1910
|
-
let x = b.meta?.id;
|
|
1911
|
-
if (!x) {
|
|
1912
|
-
useWarn("getRemoteRouteById: 路由 meta 中未找到 id");
|
|
1913
|
-
return;
|
|
1914
|
-
}
|
|
1915
|
-
function S(e) {
|
|
1916
|
-
for (let b of e) {
|
|
1917
|
-
if (b.id === x) return b;
|
|
1918
|
-
if (b.children && b.children.length > 0) {
|
|
1919
|
-
let e = S(b.children);
|
|
1920
|
-
if (e) return e;
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
}
|
|
1924
|
-
return S(T.value);
|
|
1925
|
-
}
|
|
1926
|
-
function Y(e) {
|
|
1927
|
-
let b = e ?? (typeof useRoute == "function" ? useRoute() : void 0);
|
|
1928
|
-
if (!b) {
|
|
1929
|
-
useWarn("getRemoteAppRouteById: 无法获取路由对象");
|
|
1930
|
-
return;
|
|
1931
|
-
}
|
|
1932
|
-
let x = b.meta?.id;
|
|
1933
|
-
if (!x) {
|
|
1934
|
-
useWarn("getRemoteAppRouteById: 路由 meta 中未找到 id");
|
|
1935
|
-
return;
|
|
1936
|
-
}
|
|
1937
|
-
function S(e, b) {
|
|
1938
|
-
for (let C of e) {
|
|
1939
|
-
let e = C.type === RESOURCE_TYPE.APP || C.type === RESOURCE_TYPE.DYNAMIC_APP ? C : b;
|
|
1940
|
-
if (C.id === x) return e;
|
|
1941
|
-
if (C.children && C.children.length > 0) {
|
|
1942
|
-
let b = S(C.children, e);
|
|
1943
|
-
if (b) return b;
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
return S(T.value);
|
|
1948
|
-
}
|
|
1949
|
-
return {
|
|
1950
|
-
isGenerate: C,
|
|
1951
|
-
routes: B,
|
|
1952
|
-
currentRemoveRoutes: D,
|
|
1953
|
-
flatRoutes: P,
|
|
1954
|
-
flatSystemRoutes: I,
|
|
1955
|
-
remoteRoutesRaw: T,
|
|
1956
|
-
generateRoutes: W,
|
|
1957
|
-
setCurrentRemoveRoutes: K,
|
|
1958
|
-
removeRoutes: q,
|
|
1959
|
-
getRemoteRouteById: J,
|
|
1960
|
-
getRemoteAppRouteById: Y
|
|
1961
|
-
};
|
|
1962
|
-
}), import_dist = require_dist(), menu_default = defineStore(STORE_NAME.MENU, () => {
|
|
1963
|
-
let e = settings_default(), b = route_default(), x = ref([{
|
|
1964
|
-
meta: {},
|
|
1965
|
-
children: []
|
|
1966
|
-
}]), S = ref(0);
|
|
1967
|
-
function C(e = [], b = "") {
|
|
1968
|
-
return e.map((e) => (e.path = resolveRoutePath(b, e.path), e.children &&= C(e.children, e.path), e));
|
|
1969
|
-
}
|
|
1970
|
-
let w = computedAsync(async () => {
|
|
1971
|
-
let x = [{
|
|
1972
|
-
meta: {},
|
|
1973
|
-
children: []
|
|
1974
|
-
}];
|
|
1975
|
-
return e.settings.menu.menuMode === "single" ? (x[0].children = [], b.routes.forEach((e) => {
|
|
1976
|
-
get_default(e, "meta.isDev", !1) ? useWarn(`侧边栏模式(不含主导航)下省略${e.meta.title}的子集菜单,因为该菜单开启了isDev属性。`) : x[0].children?.push(...e.children);
|
|
1977
|
-
})) : x = b.routes, x.forEach((e) => C(e.children)), await callHookAsync("menu:transform", x);
|
|
1978
|
-
}, []), T = computed(() => {
|
|
1979
|
-
if (w.value.filter((e) => !get_default(e, "meta.isDev", !1)).length === 0) return [];
|
|
1980
|
-
for (;;) {
|
|
1981
|
-
let e = w.value[S.value];
|
|
1982
|
-
if (S.value >= w.value.length - 1 || e.children.length > 0 && !get_default(e, "meta.isDev", !1)) break;
|
|
1983
|
-
S.value++;
|
|
1984
|
-
}
|
|
1985
|
-
return w.value[S.value].children ?? [];
|
|
1986
|
-
}), E = computed(() => T.value.length > 0 ? D(T.value[0]) : "/");
|
|
1987
|
-
function D(e, b = "") {
|
|
1988
|
-
let x = "";
|
|
1989
|
-
if (e.children && e.children.length > 0) {
|
|
1990
|
-
let S = e.children.find((e) => e.meta?.sidebar !== !1);
|
|
1991
|
-
S ? x = D(S, resolveRoutePath(b, e.path)) : e.children.some((e) => e.meta?.sidebar !== !1 || e.children && e.children.length > 0) ? x = D(e.children[0], resolveRoutePath(b, e.path)) : (useWarn(`目录"${e.meta?.title || e.path}"下没有可显示的菜单项`), x = resolveRoutePath(b, e.path));
|
|
1992
|
-
} else x = resolveRoutePath(b, e.path);
|
|
1993
|
-
return x;
|
|
1994
|
-
}
|
|
1995
|
-
let O = computed(() => {
|
|
1996
|
-
let e = [];
|
|
1997
|
-
return w.value.forEach((b) => {
|
|
1998
|
-
e.push(...k(b.children));
|
|
1999
|
-
}), e;
|
|
2000
|
-
});
|
|
2001
|
-
function k(e = [], b = "") {
|
|
2002
|
-
let x = [];
|
|
2003
|
-
return e.forEach((e) => {
|
|
2004
|
-
if (e.meta?.defaultOpened && e.children) {
|
|
2005
|
-
x.push(resolveRoutePath(b, e.path));
|
|
2006
|
-
let S = k(e.children, resolveRoutePath(b, e.path));
|
|
2007
|
-
S.length > 0 && x.push(...S);
|
|
2008
|
-
}
|
|
2009
|
-
}), x;
|
|
2010
|
-
}
|
|
2011
|
-
function A(e) {
|
|
2012
|
-
if (isNumber_default(e)) S.value = e;
|
|
2013
|
-
else {
|
|
2014
|
-
let b = j(w.value, e);
|
|
2015
|
-
b >= 0 && (S.value = b);
|
|
2016
|
-
}
|
|
2017
|
-
}
|
|
2018
|
-
function j(e, b) {
|
|
2019
|
-
function x(e) {
|
|
2020
|
-
return (0, import_dist.match)(e.path ?? "", { decode: decodeURIComponent })(b) ? !0 : e.children ? e.children.some((e) => x(e)) : !1;
|
|
2021
|
-
}
|
|
2022
|
-
for (let b = 0; b < e.length; b++) if (x(e[b])) return b;
|
|
2023
|
-
return 0;
|
|
2024
|
-
}
|
|
2025
|
-
return {
|
|
2026
|
-
menus: x,
|
|
2027
|
-
actived: S,
|
|
2028
|
-
allMenus: w,
|
|
2029
|
-
sidebarMenus: T,
|
|
2030
|
-
sidebarMenusFirstDeepestPath: E,
|
|
2031
|
-
defaultOpenedPaths: O,
|
|
2032
|
-
setActived: A
|
|
2033
|
-
};
|
|
2034
|
-
});
|
|
2035
|
-
function cleanup() {
|
|
2036
|
-
user_default().clean(), cleanupWithoutUser();
|
|
2037
|
-
}
|
|
2038
|
-
function cleanupWithoutUser() {
|
|
2039
|
-
tabbar_default().clean(), iframe_default().clean(), route_default().removeRoutes(), menu_default().setActived(0);
|
|
2040
|
-
}
|
|
2041
|
-
var import_path_browserify = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((e, b) => {
|
|
2042
|
-
function x(e) {
|
|
2043
|
-
if (typeof e != "string") throw TypeError("Path must be a string. Received " + JSON.stringify(e));
|
|
2044
|
-
}
|
|
2045
|
-
function S(e, b) {
|
|
2046
|
-
for (var x = "", S = 0, C = -1, w = 0, T, E = 0; E <= e.length; ++E) {
|
|
2047
|
-
if (E < e.length) T = e.charCodeAt(E);
|
|
2048
|
-
else if (T === 47) break;
|
|
2049
|
-
else T = 47;
|
|
2050
|
-
if (T === 47) {
|
|
2051
|
-
if (!(C === E - 1 || w === 1)) if (C !== E - 1 && w === 2) {
|
|
2052
|
-
if (x.length < 2 || S !== 2 || x.charCodeAt(x.length - 1) !== 46 || x.charCodeAt(x.length - 2) !== 46) {
|
|
2053
|
-
if (x.length > 2) {
|
|
2054
|
-
var D = x.lastIndexOf("/");
|
|
2055
|
-
if (D !== x.length - 1) {
|
|
2056
|
-
D === -1 ? (x = "", S = 0) : (x = x.slice(0, D), S = x.length - 1 - x.lastIndexOf("/")), C = E, w = 0;
|
|
2057
|
-
continue;
|
|
2058
|
-
}
|
|
2059
|
-
} else if (x.length === 2 || x.length === 1) {
|
|
2060
|
-
x = "", S = 0, C = E, w = 0;
|
|
2061
|
-
continue;
|
|
2062
|
-
}
|
|
2063
|
-
}
|
|
2064
|
-
b && (x.length > 0 ? x += "/.." : x = "..", S = 2);
|
|
2065
|
-
} else x.length > 0 ? x += "/" + e.slice(C + 1, E) : x = e.slice(C + 1, E), S = E - C - 1;
|
|
2066
|
-
C = E, w = 0;
|
|
2067
|
-
} else T === 46 && w !== -1 ? ++w : w = -1;
|
|
2068
|
-
}
|
|
2069
|
-
return x;
|
|
2070
|
-
}
|
|
2071
|
-
function C(e, b) {
|
|
2072
|
-
var x = b.dir || b.root, S = b.base || (b.name || "") + (b.ext || "");
|
|
2073
|
-
return x ? x === b.root ? x + S : x + e + S : S;
|
|
2074
|
-
}
|
|
2075
|
-
var w = {
|
|
2076
|
-
resolve: function() {
|
|
2077
|
-
for (var e = "", b = !1, C, w = arguments.length - 1; w >= -1 && !b; w--) {
|
|
2078
|
-
var T;
|
|
2079
|
-
w >= 0 ? T = arguments[w] : (C === void 0 && (C = process.cwd()), T = C), x(T), T.length !== 0 && (e = T + "/" + e, b = T.charCodeAt(0) === 47);
|
|
2080
|
-
}
|
|
2081
|
-
return e = S(e, !b), b ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
|
|
2082
|
-
},
|
|
2083
|
-
normalize: function(e) {
|
|
2084
|
-
if (x(e), e.length === 0) return ".";
|
|
2085
|
-
var b = e.charCodeAt(0) === 47, C = e.charCodeAt(e.length - 1) === 47;
|
|
2086
|
-
return e = S(e, !b), e.length === 0 && !b && (e = "."), e.length > 0 && C && (e += "/"), b ? "/" + e : e;
|
|
2087
|
-
},
|
|
2088
|
-
isAbsolute: function(e) {
|
|
2089
|
-
return x(e), e.length > 0 && e.charCodeAt(0) === 47;
|
|
2090
|
-
},
|
|
2091
|
-
join: function() {
|
|
2092
|
-
if (arguments.length === 0) return ".";
|
|
2093
|
-
for (var e, b = 0; b < arguments.length; ++b) {
|
|
2094
|
-
var S = arguments[b];
|
|
2095
|
-
x(S), S.length > 0 && (e === void 0 ? e = S : e += "/" + S);
|
|
2096
|
-
}
|
|
2097
|
-
return e === void 0 ? "." : w.normalize(e);
|
|
2098
|
-
},
|
|
2099
|
-
relative: function(e, b) {
|
|
2100
|
-
if (x(e), x(b), e === b || (e = w.resolve(e), b = w.resolve(b), e === b)) return "";
|
|
2101
|
-
for (var S = 1; S < e.length && e.charCodeAt(S) === 47; ++S);
|
|
2102
|
-
for (var C = e.length, T = C - S, E = 1; E < b.length && b.charCodeAt(E) === 47; ++E);
|
|
2103
|
-
for (var D = b.length - E, O = T < D ? T : D, k = -1, A = 0; A <= O; ++A) {
|
|
2104
|
-
if (A === O) {
|
|
2105
|
-
if (D > O) {
|
|
2106
|
-
if (b.charCodeAt(E + A) === 47) return b.slice(E + A + 1);
|
|
2107
|
-
if (A === 0) return b.slice(E + A);
|
|
2108
|
-
} else T > O && (e.charCodeAt(S + A) === 47 ? k = A : A === 0 && (k = 0));
|
|
2109
|
-
break;
|
|
2110
|
-
}
|
|
2111
|
-
var j = e.charCodeAt(S + A);
|
|
2112
|
-
if (j !== b.charCodeAt(E + A)) break;
|
|
2113
|
-
j === 47 && (k = A);
|
|
2114
|
-
}
|
|
2115
|
-
var M = "";
|
|
2116
|
-
for (A = S + k + 1; A <= C; ++A) (A === C || e.charCodeAt(A) === 47) && (M.length === 0 ? M += ".." : M += "/..");
|
|
2117
|
-
return M.length > 0 ? M + b.slice(E + k) : (E += k, b.charCodeAt(E) === 47 && ++E, b.slice(E));
|
|
2118
|
-
},
|
|
2119
|
-
_makeLong: function(e) {
|
|
2120
|
-
return e;
|
|
2121
|
-
},
|
|
2122
|
-
dirname: function(e) {
|
|
2123
|
-
if (x(e), e.length === 0) return ".";
|
|
2124
|
-
for (var b = e.charCodeAt(0), S = b === 47, C = -1, w = !0, T = e.length - 1; T >= 1; --T) if (b = e.charCodeAt(T), b === 47) {
|
|
2125
|
-
if (!w) {
|
|
2126
|
-
C = T;
|
|
2127
|
-
break;
|
|
2128
|
-
}
|
|
2129
|
-
} else w = !1;
|
|
2130
|
-
return C === -1 ? S ? "/" : "." : S && C === 1 ? "//" : e.slice(0, C);
|
|
2131
|
-
},
|
|
2132
|
-
basename: function(e, b) {
|
|
2133
|
-
if (b !== void 0 && typeof b != "string") throw TypeError("\"ext\" argument must be a string");
|
|
2134
|
-
x(e);
|
|
2135
|
-
var S = 0, C = -1, w = !0, T;
|
|
2136
|
-
if (b !== void 0 && b.length > 0 && b.length <= e.length) {
|
|
2137
|
-
if (b.length === e.length && b === e) return "";
|
|
2138
|
-
var E = b.length - 1, D = -1;
|
|
2139
|
-
for (T = e.length - 1; T >= 0; --T) {
|
|
2140
|
-
var O = e.charCodeAt(T);
|
|
2141
|
-
if (O === 47) {
|
|
2142
|
-
if (!w) {
|
|
2143
|
-
S = T + 1;
|
|
2144
|
-
break;
|
|
2145
|
-
}
|
|
2146
|
-
} else D === -1 && (w = !1, D = T + 1), E >= 0 && (O === b.charCodeAt(E) ? --E === -1 && (C = T) : (E = -1, C = D));
|
|
2147
|
-
}
|
|
2148
|
-
return S === C ? C = D : C === -1 && (C = e.length), e.slice(S, C);
|
|
2149
|
-
} else {
|
|
2150
|
-
for (T = e.length - 1; T >= 0; --T) if (e.charCodeAt(T) === 47) {
|
|
2151
|
-
if (!w) {
|
|
2152
|
-
S = T + 1;
|
|
2153
|
-
break;
|
|
2154
|
-
}
|
|
2155
|
-
} else C === -1 && (w = !1, C = T + 1);
|
|
2156
|
-
return C === -1 ? "" : e.slice(S, C);
|
|
2157
|
-
}
|
|
2158
|
-
},
|
|
2159
|
-
extname: function(e) {
|
|
2160
|
-
x(e);
|
|
2161
|
-
for (var b = -1, S = 0, C = -1, w = !0, T = 0, E = e.length - 1; E >= 0; --E) {
|
|
2162
|
-
var D = e.charCodeAt(E);
|
|
2163
|
-
if (D === 47) {
|
|
2164
|
-
if (!w) {
|
|
2165
|
-
S = E + 1;
|
|
2166
|
-
break;
|
|
2167
|
-
}
|
|
2168
|
-
continue;
|
|
2169
|
-
}
|
|
2170
|
-
C === -1 && (w = !1, C = E + 1), D === 46 ? b === -1 ? b = E : T !== 1 && (T = 1) : b !== -1 && (T = -1);
|
|
2171
|
-
}
|
|
2172
|
-
return b === -1 || C === -1 || T === 0 || T === 1 && b === C - 1 && b === S + 1 ? "" : e.slice(b, C);
|
|
2173
|
-
},
|
|
2174
|
-
format: function(e) {
|
|
2175
|
-
if (typeof e != "object" || !e) throw TypeError("The \"pathObject\" argument must be of type Object. Received type " + typeof e);
|
|
2176
|
-
return C("/", e);
|
|
2177
|
-
},
|
|
2178
|
-
parse: function(e) {
|
|
2179
|
-
x(e);
|
|
2180
|
-
var b = {
|
|
2181
|
-
root: "",
|
|
2182
|
-
dir: "",
|
|
2183
|
-
base: "",
|
|
2184
|
-
ext: "",
|
|
2185
|
-
name: ""
|
|
2186
|
-
};
|
|
2187
|
-
if (e.length === 0) return b;
|
|
2188
|
-
var S = e.charCodeAt(0), C = S === 47, w;
|
|
2189
|
-
C ? (b.root = "/", w = 1) : w = 0;
|
|
2190
|
-
for (var T = -1, E = 0, D = -1, O = !0, k = e.length - 1, A = 0; k >= w; --k) {
|
|
2191
|
-
if (S = e.charCodeAt(k), S === 47) {
|
|
2192
|
-
if (!O) {
|
|
2193
|
-
E = k + 1;
|
|
2194
|
-
break;
|
|
2195
|
-
}
|
|
2196
|
-
continue;
|
|
2197
|
-
}
|
|
2198
|
-
D === -1 && (O = !1, D = k + 1), S === 46 ? T === -1 ? T = k : A !== 1 && (A = 1) : T !== -1 && (A = -1);
|
|
2199
|
-
}
|
|
2200
|
-
return T === -1 || D === -1 || A === 0 || A === 1 && T === D - 1 && T === E + 1 ? D !== -1 && (E === 0 && C ? b.base = b.name = e.slice(1, D) : b.base = b.name = e.slice(E, D)) : (E === 0 && C ? (b.name = e.slice(1, T), b.base = e.slice(1, D)) : (b.name = e.slice(E, T), b.base = e.slice(E, D)), b.ext = e.slice(T, D)), E > 0 ? b.dir = e.slice(0, E - 1) : C && (b.dir = "/"), b;
|
|
2201
|
-
},
|
|
2202
|
-
sep: "/",
|
|
2203
|
-
delimiter: ":",
|
|
2204
|
-
win32: null,
|
|
2205
|
-
posix: null
|
|
2206
|
-
};
|
|
2207
|
-
w.posix = w, b.exports = w;
|
|
2208
|
-
})))(), 1);
|
|
2209
|
-
function resolveRoutePath(e, b) {
|
|
2210
|
-
return e ? import_path_browserify.default.resolve(e, b ?? "") : b ?? "";
|
|
2211
|
-
}
|
|
2212
|
-
function wrapProxy(e, b) {
|
|
2213
|
-
return new Proxy({}, { get(x, S) {
|
|
2214
|
-
let C;
|
|
2215
|
-
try {
|
|
2216
|
-
C = e();
|
|
2217
|
-
} catch (e) {
|
|
2218
|
-
let x = getPersistedState("state");
|
|
2219
|
-
if (x && x[b]) {
|
|
2220
|
-
let e = x[b], C = e[S];
|
|
2221
|
-
return typeof C == "function" ? C.bind(e) : C;
|
|
2222
|
-
}
|
|
2223
|
-
throw e;
|
|
2224
|
-
}
|
|
2225
|
-
let w = C[b];
|
|
2226
|
-
if (!w) throw Error(`Instance "${String(b)}" has not been set. Please call createContext() before using "${String(S)}".`);
|
|
2227
|
-
let T = w[S];
|
|
2228
|
-
return typeof T == "function" ? T.bind(w) : T;
|
|
2229
|
-
} });
|
|
2230
|
-
}
|
|
2231
|
-
var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
2232
|
-
function int2char(e) {
|
|
2233
|
-
return BI_RM.charAt(e);
|
|
2234
|
-
}
|
|
2235
|
-
function op_and(e, b) {
|
|
2236
|
-
return e & b;
|
|
2237
|
-
}
|
|
2238
|
-
function op_or(e, b) {
|
|
2239
|
-
return e | b;
|
|
2240
|
-
}
|
|
2241
|
-
function op_xor(e, b) {
|
|
2242
|
-
return e ^ b;
|
|
2243
|
-
}
|
|
2244
|
-
function op_andnot(e, b) {
|
|
2245
|
-
return e & ~b;
|
|
2246
|
-
}
|
|
2247
|
-
function lbit(e) {
|
|
2248
|
-
if (e == 0) return -1;
|
|
2249
|
-
var b = 0;
|
|
2250
|
-
return e & 65535 || (e >>= 16, b += 16), e & 255 || (e >>= 8, b += 8), e & 15 || (e >>= 4, b += 4), e & 3 || (e >>= 2, b += 2), e & 1 || ++b, b;
|
|
2251
|
-
}
|
|
2252
|
-
function cbit(e) {
|
|
2253
|
-
for (var b = 0; e != 0;) e &= e - 1, ++b;
|
|
2254
|
-
return b;
|
|
2255
|
-
}
|
|
2256
|
-
var b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", b64pad = "=";
|
|
2257
|
-
function hex2b64(e) {
|
|
2258
|
-
var b, x, S = "";
|
|
2259
|
-
for (b = 0; b + 3 <= e.length; b += 3) x = parseInt(e.substring(b, b + 3), 16), S += b64map.charAt(x >> 6) + b64map.charAt(x & 63);
|
|
2260
|
-
for (b + 1 == e.length ? (x = parseInt(e.substring(b, b + 1), 16), S += b64map.charAt(x << 2)) : b + 2 == e.length && (x = parseInt(e.substring(b, b + 2), 16), S += b64map.charAt(x >> 2) + b64map.charAt((x & 3) << 4)); (S.length & 3) > 0;) S += b64pad;
|
|
2261
|
-
return S;
|
|
2262
|
-
}
|
|
2263
|
-
function b64tohex(e) {
|
|
2264
|
-
var b = "", x, S = 0, C = 0;
|
|
2265
|
-
for (x = 0; x < e.length && e.charAt(x) != b64pad; ++x) {
|
|
2266
|
-
var w = b64map.indexOf(e.charAt(x));
|
|
2267
|
-
w < 0 || (S == 0 ? (b += int2char(w >> 2), C = w & 3, S = 1) : S == 1 ? (b += int2char(C << 2 | w >> 4), C = w & 15, S = 2) : S == 2 ? (b += int2char(C), b += int2char(w >> 2), C = w & 3, S = 3) : (b += int2char(C << 2 | w >> 4), b += int2char(w & 15), S = 0));
|
|
2268
|
-
}
|
|
2269
|
-
return S == 1 && (b += int2char(C << 2)), b;
|
|
2270
|
-
}
|
|
2271
|
-
var decoder$1, Hex = { decode: function(e) {
|
|
2272
|
-
var b;
|
|
2273
|
-
if (decoder$1 === void 0) {
|
|
2274
|
-
var x = "0123456789ABCDEF", S = " \f\n\r \xA0\u2028\u2029";
|
|
2275
|
-
for (decoder$1 = {}, b = 0; b < 16; ++b) decoder$1[x.charAt(b)] = b;
|
|
2276
|
-
for (x = x.toLowerCase(), b = 10; b < 16; ++b) decoder$1[x.charAt(b)] = b;
|
|
2277
|
-
for (b = 0; b < S.length; ++b) decoder$1[S.charAt(b)] = -1;
|
|
2278
|
-
}
|
|
2279
|
-
var C = [], w = 0, T = 0;
|
|
2280
|
-
for (b = 0; b < e.length; ++b) {
|
|
2281
|
-
var E = e.charAt(b);
|
|
2282
|
-
if (E == "=") break;
|
|
2283
|
-
if (E = decoder$1[E], E != -1) {
|
|
2284
|
-
if (E === void 0) throw Error("Illegal character at offset " + b);
|
|
2285
|
-
w |= E, ++T >= 2 ? (C[C.length] = w, w = 0, T = 0) : w <<= 4;
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2288
|
-
if (T) throw Error("Hex encoding incomplete: 4 bits missing");
|
|
2289
|
-
return C;
|
|
2290
|
-
} }, decoder, Base64 = {
|
|
2291
|
-
decode: function(e) {
|
|
2292
|
-
var b;
|
|
2293
|
-
if (decoder === void 0) {
|
|
2294
|
-
var x = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", S = "= \f\n\r \xA0\u2028\u2029";
|
|
2295
|
-
for (decoder = Object.create(null), b = 0; b < 64; ++b) decoder[x.charAt(b)] = b;
|
|
2296
|
-
for (decoder["-"] = 62, decoder._ = 63, b = 0; b < S.length; ++b) decoder[S.charAt(b)] = -1;
|
|
2297
|
-
}
|
|
2298
|
-
var C = [], w = 0, T = 0;
|
|
2299
|
-
for (b = 0; b < e.length; ++b) {
|
|
2300
|
-
var E = e.charAt(b);
|
|
2301
|
-
if (E == "=") break;
|
|
2302
|
-
if (E = decoder[E], E != -1) {
|
|
2303
|
-
if (E === void 0) throw Error("Illegal character at offset " + b);
|
|
2304
|
-
w |= E, ++T >= 4 ? (C[C.length] = w >> 16, C[C.length] = w >> 8 & 255, C[C.length] = w & 255, w = 0, T = 0) : w <<= 6;
|
|
2305
|
-
}
|
|
2306
|
-
}
|
|
2307
|
-
switch (T) {
|
|
2308
|
-
case 1: throw Error("Base64 encoding incomplete: at least 2 bits missing");
|
|
2309
|
-
case 2:
|
|
2310
|
-
C[C.length] = w >> 10;
|
|
2311
|
-
break;
|
|
2312
|
-
case 3:
|
|
2313
|
-
C[C.length] = w >> 16, C[C.length] = w >> 8 & 255;
|
|
2314
|
-
break;
|
|
2315
|
-
}
|
|
2316
|
-
return C;
|
|
2317
|
-
},
|
|
2318
|
-
re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
|
|
2319
|
-
unarmor: function(e) {
|
|
2320
|
-
var b = Base64.re.exec(e);
|
|
2321
|
-
if (b) if (b[1]) e = b[1];
|
|
2322
|
-
else if (b[2]) e = b[2];
|
|
2323
|
-
else throw Error("RegExp out of sync");
|
|
2324
|
-
return Base64.decode(e);
|
|
2325
|
-
}
|
|
2326
|
-
}, max = 0x9184e72a000, Int10 = function() {
|
|
2327
|
-
function e(e) {
|
|
2328
|
-
this.buf = [+e || 0];
|
|
2329
|
-
}
|
|
2330
|
-
return e.prototype.mulAdd = function(e, b) {
|
|
2331
|
-
var x = this.buf, S = x.length, C, w;
|
|
2332
|
-
for (C = 0; C < S; ++C) w = x[C] * e + b, w < max ? b = 0 : (b = 0 | w / max, w -= b * max), x[C] = w;
|
|
2333
|
-
b > 0 && (x[C] = b);
|
|
2334
|
-
}, e.prototype.sub = function(e) {
|
|
2335
|
-
var b = this.buf, x = b.length, S, C;
|
|
2336
|
-
for (S = 0; S < x; ++S) C = b[S] - e, C < 0 ? (C += max, e = 1) : e = 0, b[S] = C;
|
|
2337
|
-
for (; b[b.length - 1] === 0;) b.pop();
|
|
2338
|
-
}, e.prototype.toString = function(e) {
|
|
2339
|
-
if ((e || 10) != 10) throw Error("only base 10 is supported");
|
|
2340
|
-
for (var b = this.buf, x = b[b.length - 1].toString(), S = b.length - 2; S >= 0; --S) x += (max + b[S]).toString().substring(1);
|
|
2341
|
-
return x;
|
|
2342
|
-
}, e.prototype.valueOf = function() {
|
|
2343
|
-
for (var e = this.buf, b = 0, x = e.length - 1; x >= 0; --x) b = b * max + e[x];
|
|
2344
|
-
return b;
|
|
2345
|
-
}, e.prototype.simplify = function() {
|
|
2346
|
-
var e = this.buf;
|
|
2347
|
-
return e.length == 1 ? e[0] : this;
|
|
2348
|
-
}, e;
|
|
2349
|
-
}(), ellipsis = "…", reTimeS = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/, reTimeL = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
|
|
2350
|
-
function stringCut(e, b) {
|
|
2351
|
-
return e.length > b && (e = e.substring(0, b) + ellipsis), e;
|
|
2352
|
-
}
|
|
2353
|
-
var Stream = function() {
|
|
2354
|
-
function e(b, x) {
|
|
2355
|
-
this.hexDigits = "0123456789ABCDEF", b instanceof e ? (this.enc = b.enc, this.pos = b.pos) : (this.enc = b, this.pos = x);
|
|
2356
|
-
}
|
|
2357
|
-
return e.prototype.get = function(e) {
|
|
2358
|
-
if (e === void 0 && (e = this.pos++), e >= this.enc.length) throw Error(`Requesting byte offset ${e} on a stream of length ${this.enc.length}`);
|
|
2359
|
-
return typeof this.enc == "string" ? this.enc.charCodeAt(e) : this.enc[e];
|
|
2360
|
-
}, e.prototype.hexByte = function(e) {
|
|
2361
|
-
return this.hexDigits.charAt(e >> 4 & 15) + this.hexDigits.charAt(e & 15);
|
|
2362
|
-
}, e.prototype.hexDump = function(e, b, x) {
|
|
2363
|
-
for (var S = "", C = e; C < b; ++C) if (S += this.hexByte(this.get(C)), x !== !0) switch (C & 15) {
|
|
2364
|
-
case 7:
|
|
2365
|
-
S += " ";
|
|
2366
|
-
break;
|
|
2367
|
-
case 15:
|
|
2368
|
-
S += "\n";
|
|
2369
|
-
break;
|
|
2370
|
-
default: S += " ";
|
|
2371
|
-
}
|
|
2372
|
-
return S;
|
|
2373
|
-
}, e.prototype.isASCII = function(e, b) {
|
|
2374
|
-
for (var x = e; x < b; ++x) {
|
|
2375
|
-
var S = this.get(x);
|
|
2376
|
-
if (S < 32 || S > 176) return !1;
|
|
2377
|
-
}
|
|
2378
|
-
return !0;
|
|
2379
|
-
}, e.prototype.parseStringISO = function(e, b) {
|
|
2380
|
-
for (var x = "", S = e; S < b; ++S) x += String.fromCharCode(this.get(S));
|
|
2381
|
-
return x;
|
|
2382
|
-
}, e.prototype.parseStringUTF = function(e, b) {
|
|
2383
|
-
for (var x = "", S = e; S < b;) {
|
|
2384
|
-
var C = this.get(S++);
|
|
2385
|
-
C < 128 ? x += String.fromCharCode(C) : C > 191 && C < 224 ? x += String.fromCharCode((C & 31) << 6 | this.get(S++) & 63) : x += String.fromCharCode((C & 15) << 12 | (this.get(S++) & 63) << 6 | this.get(S++) & 63);
|
|
2386
|
-
}
|
|
2387
|
-
return x;
|
|
2388
|
-
}, e.prototype.parseStringBMP = function(e, b) {
|
|
2389
|
-
for (var x = "", S, C, w = e; w < b;) S = this.get(w++), C = this.get(w++), x += String.fromCharCode(S << 8 | C);
|
|
2390
|
-
return x;
|
|
2391
|
-
}, e.prototype.parseTime = function(e, b, x) {
|
|
2392
|
-
var S = this.parseStringISO(e, b), C = (x ? reTimeS : reTimeL).exec(S);
|
|
2393
|
-
return C ? (x && (C[1] = +C[1], C[1] += +C[1] < 70 ? 2e3 : 1900), S = C[1] + "-" + C[2] + "-" + C[3] + " " + C[4], C[5] && (S += ":" + C[5], C[6] && (S += ":" + C[6], C[7] && (S += "." + C[7]))), C[8] && (S += " UTC", C[8] != "Z" && (S += C[8], C[9] && (S += ":" + C[9]))), S) : "Unrecognized time: " + S;
|
|
2394
|
-
}, e.prototype.parseInteger = function(e, b) {
|
|
2395
|
-
for (var x = this.get(e), S = x > 127, C = S ? 255 : 0, w, T = ""; x == C && ++e < b;) x = this.get(e);
|
|
2396
|
-
if (w = b - e, w === 0) return S ? -1 : 0;
|
|
2397
|
-
if (w > 4) {
|
|
2398
|
-
for (T = x, w <<= 3; !((+T ^ C) & 128);) T <<= 1, --w;
|
|
2399
|
-
T = "(" + w + " bit)\n";
|
|
2400
|
-
}
|
|
2401
|
-
S && (x -= 256);
|
|
2402
|
-
for (var E = new Int10(x), D = e + 1; D < b; ++D) E.mulAdd(256, this.get(D));
|
|
2403
|
-
return T + E.toString();
|
|
2404
|
-
}, e.prototype.parseBitString = function(e, b, x) {
|
|
2405
|
-
for (var S = this.get(e), C = "(" + ((b - e - 1 << 3) - S) + " bit)\n", w = "", T = e + 1; T < b; ++T) {
|
|
2406
|
-
for (var E = this.get(T), D = T == b - 1 ? S : 0, O = 7; O >= D; --O) w += E >> O & 1 ? "1" : "0";
|
|
2407
|
-
if (w.length > x) return C + stringCut(w, x);
|
|
2408
|
-
}
|
|
2409
|
-
return C + w;
|
|
2410
|
-
}, e.prototype.parseOctetString = function(e, b, x) {
|
|
2411
|
-
if (this.isASCII(e, b)) return stringCut(this.parseStringISO(e, b), x);
|
|
2412
|
-
var S = b - e, C = "(" + S + " byte)\n";
|
|
2413
|
-
x /= 2, S > x && (b = e + x);
|
|
2414
|
-
for (var w = e; w < b; ++w) C += this.hexByte(this.get(w));
|
|
2415
|
-
return S > x && (C += ellipsis), C;
|
|
2416
|
-
}, e.prototype.parseOID = function(e, b, x) {
|
|
2417
|
-
for (var S = "", C = new Int10(), w = 0, T = e; T < b; ++T) {
|
|
2418
|
-
var E = this.get(T);
|
|
2419
|
-
if (C.mulAdd(128, E & 127), w += 7, !(E & 128)) {
|
|
2420
|
-
if (S === "") if (C = C.simplify(), C instanceof Int10) C.sub(80), S = "2." + C.toString();
|
|
2421
|
-
else {
|
|
2422
|
-
var D = C < 80 ? C < 40 ? 0 : 1 : 2;
|
|
2423
|
-
S = D + "." + (C - D * 40);
|
|
2424
|
-
}
|
|
2425
|
-
else S += "." + C.toString();
|
|
2426
|
-
if (S.length > x) return stringCut(S, x);
|
|
2427
|
-
C = new Int10(), w = 0;
|
|
2428
|
-
}
|
|
2429
|
-
}
|
|
2430
|
-
return w > 0 && (S += ".incomplete"), S;
|
|
2431
|
-
}, e;
|
|
2432
|
-
}(), ASN1 = function() {
|
|
2433
|
-
function e(e, b, x, S, C) {
|
|
2434
|
-
if (!(S instanceof ASN1Tag)) throw Error("Invalid tag value.");
|
|
2435
|
-
this.stream = e, this.header = b, this.length = x, this.tag = S, this.sub = C;
|
|
2436
|
-
}
|
|
2437
|
-
return e.prototype.typeName = function() {
|
|
2438
|
-
switch (this.tag.tagClass) {
|
|
2439
|
-
case 0:
|
|
2440
|
-
switch (this.tag.tagNumber) {
|
|
2441
|
-
case 0: return "EOC";
|
|
2442
|
-
case 1: return "BOOLEAN";
|
|
2443
|
-
case 2: return "INTEGER";
|
|
2444
|
-
case 3: return "BIT_STRING";
|
|
2445
|
-
case 4: return "OCTET_STRING";
|
|
2446
|
-
case 5: return "NULL";
|
|
2447
|
-
case 6: return "OBJECT_IDENTIFIER";
|
|
2448
|
-
case 7: return "ObjectDescriptor";
|
|
2449
|
-
case 8: return "EXTERNAL";
|
|
2450
|
-
case 9: return "REAL";
|
|
2451
|
-
case 10: return "ENUMERATED";
|
|
2452
|
-
case 11: return "EMBEDDED_PDV";
|
|
2453
|
-
case 12: return "UTF8String";
|
|
2454
|
-
case 16: return "SEQUENCE";
|
|
2455
|
-
case 17: return "SET";
|
|
2456
|
-
case 18: return "NumericString";
|
|
2457
|
-
case 19: return "PrintableString";
|
|
2458
|
-
case 20: return "TeletexString";
|
|
2459
|
-
case 21: return "VideotexString";
|
|
2460
|
-
case 22: return "IA5String";
|
|
2461
|
-
case 23: return "UTCTime";
|
|
2462
|
-
case 24: return "GeneralizedTime";
|
|
2463
|
-
case 25: return "GraphicString";
|
|
2464
|
-
case 26: return "VisibleString";
|
|
2465
|
-
case 27: return "GeneralString";
|
|
2466
|
-
case 28: return "UniversalString";
|
|
2467
|
-
case 30: return "BMPString";
|
|
2468
|
-
}
|
|
2469
|
-
return "Universal_" + this.tag.tagNumber.toString();
|
|
2470
|
-
case 1: return "Application_" + this.tag.tagNumber.toString();
|
|
2471
|
-
case 2: return "[" + this.tag.tagNumber.toString() + "]";
|
|
2472
|
-
case 3: return "Private_" + this.tag.tagNumber.toString();
|
|
2473
|
-
}
|
|
2474
|
-
}, e.prototype.content = function(e) {
|
|
2475
|
-
if (this.tag === void 0) return null;
|
|
2476
|
-
e === void 0 && (e = Infinity);
|
|
2477
|
-
var b = this.posContent(), x = Math.abs(this.length);
|
|
2478
|
-
if (!this.tag.isUniversal()) return this.sub === null ? this.stream.parseOctetString(b, b + x, e) : "(" + this.sub.length + " elem)";
|
|
2479
|
-
switch (this.tag.tagNumber) {
|
|
2480
|
-
case 1: return this.stream.get(b) === 0 ? "false" : "true";
|
|
2481
|
-
case 2: return this.stream.parseInteger(b, b + x);
|
|
2482
|
-
case 3: return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(b, b + x, e);
|
|
2483
|
-
case 4: return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(b, b + x, e);
|
|
2484
|
-
case 6: return this.stream.parseOID(b, b + x, e);
|
|
2485
|
-
case 16:
|
|
2486
|
-
case 17: return this.sub === null ? "(no elem)" : "(" + this.sub.length + " elem)";
|
|
2487
|
-
case 12: return stringCut(this.stream.parseStringUTF(b, b + x), e);
|
|
2488
|
-
case 18:
|
|
2489
|
-
case 19:
|
|
2490
|
-
case 20:
|
|
2491
|
-
case 21:
|
|
2492
|
-
case 22:
|
|
2493
|
-
case 26: return stringCut(this.stream.parseStringISO(b, b + x), e);
|
|
2494
|
-
case 30: return stringCut(this.stream.parseStringBMP(b, b + x), e);
|
|
2495
|
-
case 23:
|
|
2496
|
-
case 24: return this.stream.parseTime(b, b + x, this.tag.tagNumber == 23);
|
|
2497
|
-
}
|
|
2498
|
-
return null;
|
|
2499
|
-
}, e.prototype.toString = function() {
|
|
2500
|
-
return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (this.sub === null ? "null" : this.sub.length) + "]";
|
|
2501
|
-
}, e.prototype.toPrettyString = function(e) {
|
|
2502
|
-
e === void 0 && (e = "");
|
|
2503
|
-
var b = e + this.typeName() + " @" + this.stream.pos;
|
|
2504
|
-
if (this.length >= 0 && (b += "+"), b += this.length, this.tag.tagConstructed ? b += " (constructed)" : this.tag.isUniversal() && (this.tag.tagNumber == 3 || this.tag.tagNumber == 4) && this.sub !== null && (b += " (encapsulates)"), b += "\n", this.sub !== null) {
|
|
2505
|
-
e += " ";
|
|
2506
|
-
for (var x = 0, S = this.sub.length; x < S; ++x) b += this.sub[x].toPrettyString(e);
|
|
2507
|
-
}
|
|
2508
|
-
return b;
|
|
2509
|
-
}, e.prototype.posStart = function() {
|
|
2510
|
-
return this.stream.pos;
|
|
2511
|
-
}, e.prototype.posContent = function() {
|
|
2512
|
-
return this.stream.pos + this.header;
|
|
2513
|
-
}, e.prototype.posEnd = function() {
|
|
2514
|
-
return this.stream.pos + this.header + Math.abs(this.length);
|
|
2515
|
-
}, e.prototype.toHexString = function() {
|
|
2516
|
-
return this.stream.hexDump(this.posStart(), this.posEnd(), !0);
|
|
2517
|
-
}, e.decodeLength = function(e) {
|
|
2518
|
-
var b = e.get(), x = b & 127;
|
|
2519
|
-
if (x == b) return x;
|
|
2520
|
-
if (x > 6) throw Error("Length over 48 bits not supported at position " + (e.pos - 1));
|
|
2521
|
-
if (x === 0) return null;
|
|
2522
|
-
b = 0;
|
|
2523
|
-
for (var S = 0; S < x; ++S) b = b * 256 + e.get();
|
|
2524
|
-
return b;
|
|
2525
|
-
}, e.prototype.getHexStringValue = function() {
|
|
2526
|
-
var e = this.toHexString(), b = this.header * 2, x = this.length * 2;
|
|
2527
|
-
return e.substr(b, x);
|
|
2528
|
-
}, e.decode = function(b) {
|
|
2529
|
-
var x = b instanceof Stream ? b : new Stream(b, 0), S = new Stream(x), C = new ASN1Tag(x), w = e.decodeLength(x), T = x.pos, E = T - S.pos, D = null, O = function() {
|
|
2530
|
-
var b = [];
|
|
2531
|
-
if (w !== null) {
|
|
2532
|
-
for (var S = T + w; x.pos < S;) b[b.length] = e.decode(x);
|
|
2533
|
-
if (x.pos != S) throw Error("Content size is not correct for container starting at offset " + T);
|
|
2534
|
-
} else try {
|
|
2535
|
-
for (;;) {
|
|
2536
|
-
var C = e.decode(x);
|
|
2537
|
-
if (C.tag.isEOC()) break;
|
|
2538
|
-
b[b.length] = C;
|
|
2539
|
-
}
|
|
2540
|
-
w = T - x.pos;
|
|
2541
|
-
} catch (e) {
|
|
2542
|
-
throw Error("Exception while decoding undefined length content: " + e);
|
|
2543
|
-
}
|
|
2544
|
-
return b;
|
|
2545
|
-
};
|
|
2546
|
-
if (C.tagConstructed) D = O();
|
|
2547
|
-
else if (C.isUniversal() && (C.tagNumber == 3 || C.tagNumber == 4)) try {
|
|
2548
|
-
if (C.tagNumber == 3 && x.get() != 0) throw Error("BIT STRINGs with unused bits cannot encapsulate.");
|
|
2549
|
-
D = O();
|
|
2550
|
-
for (var k = 0; k < D.length; ++k) if (D[k].tag.isEOC()) throw Error("EOC is not supposed to be actual content.");
|
|
2551
|
-
} catch {
|
|
2552
|
-
D = null;
|
|
2553
|
-
}
|
|
2554
|
-
if (D === null) {
|
|
2555
|
-
if (w === null) throw Error("We can't skip over an invalid tag with undefined length at offset " + T);
|
|
2556
|
-
x.pos = T + Math.abs(w);
|
|
2557
|
-
}
|
|
2558
|
-
return new e(S, E, w, C, D);
|
|
2559
|
-
}, e;
|
|
2560
|
-
}(), ASN1Tag = function() {
|
|
2561
|
-
function e(e) {
|
|
2562
|
-
var b = e.get();
|
|
2563
|
-
if (this.tagClass = b >> 6, this.tagConstructed = (b & 32) != 0, this.tagNumber = b & 31, this.tagNumber == 31) {
|
|
2564
|
-
var x = new Int10();
|
|
2565
|
-
do
|
|
2566
|
-
b = e.get(), x.mulAdd(128, b & 127);
|
|
2567
|
-
while (b & 128);
|
|
2568
|
-
this.tagNumber = x.simplify();
|
|
2569
|
-
}
|
|
2570
|
-
}
|
|
2571
|
-
return e.prototype.isUniversal = function() {
|
|
2572
|
-
return this.tagClass === 0;
|
|
2573
|
-
}, e.prototype.isEOC = function() {
|
|
2574
|
-
return this.tagClass === 0 && this.tagNumber === 0;
|
|
2575
|
-
}, e;
|
|
2576
|
-
}(), dbits, j_lm = !0, lowprimes = [
|
|
2577
|
-
2,
|
|
2578
|
-
3,
|
|
2579
|
-
5,
|
|
2580
|
-
7,
|
|
2581
|
-
11,
|
|
2582
|
-
13,
|
|
2583
|
-
17,
|
|
2584
|
-
19,
|
|
2585
|
-
23,
|
|
2586
|
-
29,
|
|
2587
|
-
31,
|
|
2588
|
-
37,
|
|
2589
|
-
41,
|
|
2590
|
-
43,
|
|
2591
|
-
47,
|
|
2592
|
-
53,
|
|
2593
|
-
59,
|
|
2594
|
-
61,
|
|
2595
|
-
67,
|
|
2596
|
-
71,
|
|
2597
|
-
73,
|
|
2598
|
-
79,
|
|
2599
|
-
83,
|
|
2600
|
-
89,
|
|
2601
|
-
97,
|
|
2602
|
-
101,
|
|
2603
|
-
103,
|
|
2604
|
-
107,
|
|
2605
|
-
109,
|
|
2606
|
-
113,
|
|
2607
|
-
127,
|
|
2608
|
-
131,
|
|
2609
|
-
137,
|
|
2610
|
-
139,
|
|
2611
|
-
149,
|
|
2612
|
-
151,
|
|
2613
|
-
157,
|
|
2614
|
-
163,
|
|
2615
|
-
167,
|
|
2616
|
-
173,
|
|
2617
|
-
179,
|
|
2618
|
-
181,
|
|
2619
|
-
191,
|
|
2620
|
-
193,
|
|
2621
|
-
197,
|
|
2622
|
-
199,
|
|
2623
|
-
211,
|
|
2624
|
-
223,
|
|
2625
|
-
227,
|
|
2626
|
-
229,
|
|
2627
|
-
233,
|
|
2628
|
-
239,
|
|
2629
|
-
241,
|
|
2630
|
-
251,
|
|
2631
|
-
257,
|
|
2632
|
-
263,
|
|
2633
|
-
269,
|
|
2634
|
-
271,
|
|
2635
|
-
277,
|
|
2636
|
-
281,
|
|
2637
|
-
283,
|
|
2638
|
-
293,
|
|
2639
|
-
307,
|
|
2640
|
-
311,
|
|
2641
|
-
313,
|
|
2642
|
-
317,
|
|
2643
|
-
331,
|
|
2644
|
-
337,
|
|
2645
|
-
347,
|
|
2646
|
-
349,
|
|
2647
|
-
353,
|
|
2648
|
-
359,
|
|
2649
|
-
367,
|
|
2650
|
-
373,
|
|
2651
|
-
379,
|
|
2652
|
-
383,
|
|
2653
|
-
389,
|
|
2654
|
-
397,
|
|
2655
|
-
401,
|
|
2656
|
-
409,
|
|
2657
|
-
419,
|
|
2658
|
-
421,
|
|
2659
|
-
431,
|
|
2660
|
-
433,
|
|
2661
|
-
439,
|
|
2662
|
-
443,
|
|
2663
|
-
449,
|
|
2664
|
-
457,
|
|
2665
|
-
461,
|
|
2666
|
-
463,
|
|
2667
|
-
467,
|
|
2668
|
-
479,
|
|
2669
|
-
487,
|
|
2670
|
-
491,
|
|
2671
|
-
499,
|
|
2672
|
-
503,
|
|
2673
|
-
509,
|
|
2674
|
-
521,
|
|
2675
|
-
523,
|
|
2676
|
-
541,
|
|
2677
|
-
547,
|
|
2678
|
-
557,
|
|
2679
|
-
563,
|
|
2680
|
-
569,
|
|
2681
|
-
571,
|
|
2682
|
-
577,
|
|
2683
|
-
587,
|
|
2684
|
-
593,
|
|
2685
|
-
599,
|
|
2686
|
-
601,
|
|
2687
|
-
607,
|
|
2688
|
-
613,
|
|
2689
|
-
617,
|
|
2690
|
-
619,
|
|
2691
|
-
631,
|
|
2692
|
-
641,
|
|
2693
|
-
643,
|
|
2694
|
-
647,
|
|
2695
|
-
653,
|
|
2696
|
-
659,
|
|
2697
|
-
661,
|
|
2698
|
-
673,
|
|
2699
|
-
677,
|
|
2700
|
-
683,
|
|
2701
|
-
691,
|
|
2702
|
-
701,
|
|
2703
|
-
709,
|
|
2704
|
-
719,
|
|
2705
|
-
727,
|
|
2706
|
-
733,
|
|
2707
|
-
739,
|
|
2708
|
-
743,
|
|
2709
|
-
751,
|
|
2710
|
-
757,
|
|
2711
|
-
761,
|
|
2712
|
-
769,
|
|
2713
|
-
773,
|
|
2714
|
-
787,
|
|
2715
|
-
797,
|
|
2716
|
-
809,
|
|
2717
|
-
811,
|
|
2718
|
-
821,
|
|
2719
|
-
823,
|
|
2720
|
-
827,
|
|
2721
|
-
829,
|
|
2722
|
-
839,
|
|
2723
|
-
853,
|
|
2724
|
-
857,
|
|
2725
|
-
859,
|
|
2726
|
-
863,
|
|
2727
|
-
877,
|
|
2728
|
-
881,
|
|
2729
|
-
883,
|
|
2730
|
-
887,
|
|
2731
|
-
907,
|
|
2732
|
-
911,
|
|
2733
|
-
919,
|
|
2734
|
-
929,
|
|
2735
|
-
937,
|
|
2736
|
-
941,
|
|
2737
|
-
947,
|
|
2738
|
-
953,
|
|
2739
|
-
967,
|
|
2740
|
-
971,
|
|
2741
|
-
977,
|
|
2742
|
-
983,
|
|
2743
|
-
991,
|
|
2744
|
-
997
|
|
2745
|
-
], lplim = (1 << 26) / lowprimes[lowprimes.length - 1], BigInteger = function() {
|
|
2746
|
-
function e(e, b, x) {
|
|
2747
|
-
e != null && (typeof e == "number" ? this.fromNumber(e, b, x) : b == null && typeof e != "string" ? this.fromString(e, 256) : this.fromString(e, b));
|
|
2748
|
-
}
|
|
2749
|
-
return e.prototype.toString = function(e) {
|
|
2750
|
-
if (this.s < 0) return "-" + this.negate().toString(e);
|
|
2751
|
-
var b;
|
|
2752
|
-
if (e == 16) b = 4;
|
|
2753
|
-
else if (e == 8) b = 3;
|
|
2754
|
-
else if (e == 2) b = 1;
|
|
2755
|
-
else if (e == 32) b = 5;
|
|
2756
|
-
else if (e == 4) b = 2;
|
|
2757
|
-
else return this.toRadix(e);
|
|
2758
|
-
var x = (1 << b) - 1, S, C = !1, w = "", T = this.t, E = this.DB - T * this.DB % b;
|
|
2759
|
-
if (T-- > 0) for (E < this.DB && (S = this[T] >> E) > 0 && (C = !0, w = int2char(S)); T >= 0;) E < b ? (S = (this[T] & (1 << E) - 1) << b - E, S |= this[--T] >> (E += this.DB - b)) : (S = this[T] >> (E -= b) & x, E <= 0 && (E += this.DB, --T)), S > 0 && (C = !0), C && (w += int2char(S));
|
|
2760
|
-
return C ? w : "0";
|
|
2761
|
-
}, e.prototype.negate = function() {
|
|
2762
|
-
var b = nbi();
|
|
2763
|
-
return e.ZERO.subTo(this, b), b;
|
|
2764
|
-
}, e.prototype.abs = function() {
|
|
2765
|
-
return this.s < 0 ? this.negate() : this;
|
|
2766
|
-
}, e.prototype.compareTo = function(e) {
|
|
2767
|
-
var b = this.s - e.s;
|
|
2768
|
-
if (b != 0) return b;
|
|
2769
|
-
var x = this.t;
|
|
2770
|
-
if (b = x - e.t, b != 0) return this.s < 0 ? -b : b;
|
|
2771
|
-
for (; --x >= 0;) if ((b = this[x] - e[x]) != 0) return b;
|
|
2772
|
-
return 0;
|
|
2773
|
-
}, e.prototype.bitLength = function() {
|
|
2774
|
-
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);
|
|
2775
|
-
}, e.prototype.mod = function(b) {
|
|
2776
|
-
var x = nbi();
|
|
2777
|
-
return this.abs().divRemTo(b, null, x), this.s < 0 && x.compareTo(e.ZERO) > 0 && b.subTo(x, x), x;
|
|
2778
|
-
}, e.prototype.modPowInt = function(e, b) {
|
|
2779
|
-
var x = e < 256 || b.isEven() ? new Classic(b) : new Montgomery(b);
|
|
2780
|
-
return this.exp(e, x);
|
|
2781
|
-
}, e.prototype.clone = function() {
|
|
2782
|
-
var e = nbi();
|
|
2783
|
-
return this.copyTo(e), e;
|
|
2784
|
-
}, e.prototype.intValue = function() {
|
|
2785
|
-
if (this.s < 0) {
|
|
2786
|
-
if (this.t == 1) return this[0] - this.DV;
|
|
2787
|
-
if (this.t == 0) return -1;
|
|
2788
|
-
} else if (this.t == 1) return this[0];
|
|
2789
|
-
else if (this.t == 0) return 0;
|
|
2790
|
-
return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
|
|
2791
|
-
}, e.prototype.byteValue = function() {
|
|
2792
|
-
return this.t == 0 ? this.s : this[0] << 24 >> 24;
|
|
2793
|
-
}, e.prototype.shortValue = function() {
|
|
2794
|
-
return this.t == 0 ? this.s : this[0] << 16 >> 16;
|
|
2795
|
-
}, e.prototype.signum = function() {
|
|
2796
|
-
return this.s < 0 ? -1 : this.t <= 0 || this.t == 1 && this[0] <= 0 ? 0 : 1;
|
|
2797
|
-
}, e.prototype.toByteArray = function() {
|
|
2798
|
-
var e = this.t, b = [];
|
|
2799
|
-
b[0] = this.s;
|
|
2800
|
-
var x = this.DB - e * this.DB % 8, S, C = 0;
|
|
2801
|
-
if (e-- > 0) for (x < this.DB && (S = this[e] >> x) != (this.s & this.DM) >> x && (b[C++] = S | this.s << this.DB - x); e >= 0;) x < 8 ? (S = (this[e] & (1 << x) - 1) << 8 - x, S |= this[--e] >> (x += this.DB - 8)) : (S = this[e] >> (x -= 8) & 255, x <= 0 && (x += this.DB, --e)), S & 128 && (S |= -256), C == 0 && (this.s & 128) != (S & 128) && ++C, (C > 0 || S != this.s) && (b[C++] = S);
|
|
2802
|
-
return b;
|
|
2803
|
-
}, e.prototype.equals = function(e) {
|
|
2804
|
-
return this.compareTo(e) == 0;
|
|
2805
|
-
}, e.prototype.min = function(e) {
|
|
2806
|
-
return this.compareTo(e) < 0 ? this : e;
|
|
2807
|
-
}, e.prototype.max = function(e) {
|
|
2808
|
-
return this.compareTo(e) > 0 ? this : e;
|
|
2809
|
-
}, e.prototype.and = function(e) {
|
|
2810
|
-
var b = nbi();
|
|
2811
|
-
return this.bitwiseTo(e, op_and, b), b;
|
|
2812
|
-
}, e.prototype.or = function(e) {
|
|
2813
|
-
var b = nbi();
|
|
2814
|
-
return this.bitwiseTo(e, op_or, b), b;
|
|
2815
|
-
}, e.prototype.xor = function(e) {
|
|
2816
|
-
var b = nbi();
|
|
2817
|
-
return this.bitwiseTo(e, op_xor, b), b;
|
|
2818
|
-
}, e.prototype.andNot = function(e) {
|
|
2819
|
-
var b = nbi();
|
|
2820
|
-
return this.bitwiseTo(e, op_andnot, b), b;
|
|
2821
|
-
}, e.prototype.not = function() {
|
|
2822
|
-
for (var e = nbi(), b = 0; b < this.t; ++b) e[b] = this.DM & ~this[b];
|
|
2823
|
-
return e.t = this.t, e.s = ~this.s, e;
|
|
2824
|
-
}, e.prototype.shiftLeft = function(e) {
|
|
2825
|
-
var b = nbi();
|
|
2826
|
-
return e < 0 ? this.rShiftTo(-e, b) : this.lShiftTo(e, b), b;
|
|
2827
|
-
}, e.prototype.shiftRight = function(e) {
|
|
2828
|
-
var b = nbi();
|
|
2829
|
-
return e < 0 ? this.lShiftTo(-e, b) : this.rShiftTo(e, b), b;
|
|
2830
|
-
}, e.prototype.getLowestSetBit = function() {
|
|
2831
|
-
for (var e = 0; e < this.t; ++e) if (this[e] != 0) return e * this.DB + lbit(this[e]);
|
|
2832
|
-
return this.s < 0 ? this.t * this.DB : -1;
|
|
2833
|
-
}, e.prototype.bitCount = function() {
|
|
2834
|
-
for (var e = 0, b = this.s & this.DM, x = 0; x < this.t; ++x) e += cbit(this[x] ^ b);
|
|
2835
|
-
return e;
|
|
2836
|
-
}, e.prototype.testBit = function(e) {
|
|
2837
|
-
var b = Math.floor(e / this.DB);
|
|
2838
|
-
return b >= this.t ? this.s != 0 : (this[b] & 1 << e % this.DB) != 0;
|
|
2839
|
-
}, e.prototype.setBit = function(e) {
|
|
2840
|
-
return this.changeBit(e, op_or);
|
|
2841
|
-
}, e.prototype.clearBit = function(e) {
|
|
2842
|
-
return this.changeBit(e, op_andnot);
|
|
2843
|
-
}, e.prototype.flipBit = function(e) {
|
|
2844
|
-
return this.changeBit(e, op_xor);
|
|
2845
|
-
}, e.prototype.add = function(e) {
|
|
2846
|
-
var b = nbi();
|
|
2847
|
-
return this.addTo(e, b), b;
|
|
2848
|
-
}, e.prototype.subtract = function(e) {
|
|
2849
|
-
var b = nbi();
|
|
2850
|
-
return this.subTo(e, b), b;
|
|
2851
|
-
}, e.prototype.multiply = function(e) {
|
|
2852
|
-
var b = nbi();
|
|
2853
|
-
return this.multiplyTo(e, b), b;
|
|
2854
|
-
}, e.prototype.divide = function(e) {
|
|
2855
|
-
var b = nbi();
|
|
2856
|
-
return this.divRemTo(e, b, null), b;
|
|
2857
|
-
}, e.prototype.remainder = function(e) {
|
|
2858
|
-
var b = nbi();
|
|
2859
|
-
return this.divRemTo(e, null, b), b;
|
|
2860
|
-
}, e.prototype.divideAndRemainder = function(e) {
|
|
2861
|
-
var b = nbi(), x = nbi();
|
|
2862
|
-
return this.divRemTo(e, b, x), [b, x];
|
|
2863
|
-
}, e.prototype.modPow = function(e, b) {
|
|
2864
|
-
var x = e.bitLength(), S, C = nbv(1), w;
|
|
2865
|
-
if (x <= 0) return C;
|
|
2866
|
-
S = x < 18 ? 1 : x < 48 ? 3 : x < 144 ? 4 : x < 768 ? 5 : 6, w = x < 8 ? new Classic(b) : b.isEven() ? new Barrett(b) : new Montgomery(b);
|
|
2867
|
-
var T = [], E = 3, D = S - 1, O = (1 << S) - 1;
|
|
2868
|
-
if (T[1] = w.convert(this), S > 1) {
|
|
2869
|
-
var k = nbi();
|
|
2870
|
-
for (w.sqrTo(T[1], k); E <= O;) T[E] = nbi(), w.mulTo(k, T[E - 2], T[E]), E += 2;
|
|
2871
|
-
}
|
|
2872
|
-
var A = e.t - 1, j, M = !0, N = nbi(), P;
|
|
2873
|
-
for (x = nbits(e[A]) - 1; A >= 0;) {
|
|
2874
|
-
for (x >= D ? j = e[A] >> x - D & O : (j = (e[A] & (1 << x + 1) - 1) << D - x, A > 0 && (j |= e[A - 1] >> this.DB + x - D)), E = S; !(j & 1);) j >>= 1, --E;
|
|
2875
|
-
if ((x -= E) < 0 && (x += this.DB, --A), M) T[j].copyTo(C), M = !1;
|
|
2876
|
-
else {
|
|
2877
|
-
for (; E > 1;) w.sqrTo(C, N), w.sqrTo(N, C), E -= 2;
|
|
2878
|
-
E > 0 ? w.sqrTo(C, N) : (P = C, C = N, N = P), w.mulTo(N, T[j], C);
|
|
2879
|
-
}
|
|
2880
|
-
for (; A >= 0 && !(e[A] & 1 << x);) w.sqrTo(C, N), P = C, C = N, N = P, --x < 0 && (x = this.DB - 1, --A);
|
|
2881
|
-
}
|
|
2882
|
-
return w.revert(C);
|
|
2883
|
-
}, e.prototype.modInverse = function(b) {
|
|
2884
|
-
var x = b.isEven();
|
|
2885
|
-
if (this.isEven() && x || b.signum() == 0) return e.ZERO;
|
|
2886
|
-
for (var S = b.clone(), C = this.clone(), w = nbv(1), T = nbv(0), E = nbv(0), D = nbv(1); S.signum() != 0;) {
|
|
2887
|
-
for (; S.isEven();) S.rShiftTo(1, S), x ? ((!w.isEven() || !T.isEven()) && (w.addTo(this, w), T.subTo(b, T)), w.rShiftTo(1, w)) : T.isEven() || T.subTo(b, T), T.rShiftTo(1, T);
|
|
2888
|
-
for (; C.isEven();) C.rShiftTo(1, C), x ? ((!E.isEven() || !D.isEven()) && (E.addTo(this, E), D.subTo(b, D)), E.rShiftTo(1, E)) : D.isEven() || D.subTo(b, D), D.rShiftTo(1, D);
|
|
2889
|
-
S.compareTo(C) >= 0 ? (S.subTo(C, S), x && w.subTo(E, w), T.subTo(D, T)) : (C.subTo(S, C), x && E.subTo(w, E), D.subTo(T, D));
|
|
2890
|
-
}
|
|
2891
|
-
if (C.compareTo(e.ONE) != 0) return e.ZERO;
|
|
2892
|
-
if (D.compareTo(b) >= 0) return D.subtract(b);
|
|
2893
|
-
if (D.signum() < 0) D.addTo(b, D);
|
|
2894
|
-
else return D;
|
|
2895
|
-
return D.signum() < 0 ? D.add(b) : D;
|
|
2896
|
-
}, e.prototype.pow = function(e) {
|
|
2897
|
-
return this.exp(e, new NullExp());
|
|
2898
|
-
}, e.prototype.gcd = function(e) {
|
|
2899
|
-
var b = this.s < 0 ? this.negate() : this.clone(), x = e.s < 0 ? e.negate() : e.clone();
|
|
2900
|
-
if (b.compareTo(x) < 0) {
|
|
2901
|
-
var S = b;
|
|
2902
|
-
b = x, x = S;
|
|
2903
|
-
}
|
|
2904
|
-
var C = b.getLowestSetBit(), w = x.getLowestSetBit();
|
|
2905
|
-
if (w < 0) return b;
|
|
2906
|
-
for (C < w && (w = C), w > 0 && (b.rShiftTo(w, b), x.rShiftTo(w, x)); b.signum() > 0;) (C = b.getLowestSetBit()) > 0 && b.rShiftTo(C, b), (C = x.getLowestSetBit()) > 0 && x.rShiftTo(C, x), b.compareTo(x) >= 0 ? (b.subTo(x, b), b.rShiftTo(1, b)) : (x.subTo(b, x), x.rShiftTo(1, x));
|
|
2907
|
-
return w > 0 && x.lShiftTo(w, x), x;
|
|
2908
|
-
}, e.prototype.isProbablePrime = function(e) {
|
|
2909
|
-
var b, x = this.abs();
|
|
2910
|
-
if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) {
|
|
2911
|
-
for (b = 0; b < lowprimes.length; ++b) if (x[0] == lowprimes[b]) return !0;
|
|
2912
|
-
return !1;
|
|
2913
|
-
}
|
|
2914
|
-
if (x.isEven()) return !1;
|
|
2915
|
-
for (b = 1; b < lowprimes.length;) {
|
|
2916
|
-
for (var S = lowprimes[b], C = b + 1; C < lowprimes.length && S < lplim;) S *= lowprimes[C++];
|
|
2917
|
-
for (S = x.modInt(S); b < C;) if (S % lowprimes[b++] == 0) return !1;
|
|
2918
|
-
}
|
|
2919
|
-
return x.millerRabin(e);
|
|
2920
|
-
}, e.prototype.copyTo = function(e) {
|
|
2921
|
-
for (var b = this.t - 1; b >= 0; --b) e[b] = this[b];
|
|
2922
|
-
e.t = this.t, e.s = this.s;
|
|
2923
|
-
}, e.prototype.fromInt = function(e) {
|
|
2924
|
-
this.t = 1, this.s = e < 0 ? -1 : 0, e > 0 ? this[0] = e : e < -1 ? this[0] = e + this.DV : this.t = 0;
|
|
2925
|
-
}, e.prototype.fromString = function(b, x) {
|
|
2926
|
-
var S;
|
|
2927
|
-
if (x == 16) S = 4;
|
|
2928
|
-
else if (x == 8) S = 3;
|
|
2929
|
-
else if (x == 256) S = 8;
|
|
2930
|
-
else if (x == 2) S = 1;
|
|
2931
|
-
else if (x == 32) S = 5;
|
|
2932
|
-
else if (x == 4) S = 2;
|
|
2933
|
-
else {
|
|
2934
|
-
this.fromRadix(b, x);
|
|
2935
|
-
return;
|
|
2936
|
-
}
|
|
2937
|
-
this.t = 0, this.s = 0;
|
|
2938
|
-
for (var C = b.length, w = !1, T = 0; --C >= 0;) {
|
|
2939
|
-
var E = S == 8 ? b[C] & 255 : intAt(b, C);
|
|
2940
|
-
if (E < 0) {
|
|
2941
|
-
b.charAt(C) == "-" && (w = !0);
|
|
2942
|
-
continue;
|
|
2943
|
-
}
|
|
2944
|
-
w = !1, T == 0 ? this[this.t++] = E : T + S > this.DB ? (this[this.t - 1] |= (E & (1 << this.DB - T) - 1) << T, this[this.t++] = E >> this.DB - T) : this[this.t - 1] |= E << T, T += S, T >= this.DB && (T -= this.DB);
|
|
2945
|
-
}
|
|
2946
|
-
S == 8 && b[0] & 128 && (this.s = -1, T > 0 && (this[this.t - 1] |= (1 << this.DB - T) - 1 << T)), this.clamp(), w && e.ZERO.subTo(this, this);
|
|
2947
|
-
}, e.prototype.clamp = function() {
|
|
2948
|
-
for (var e = this.s & this.DM; this.t > 0 && this[this.t - 1] == e;) --this.t;
|
|
2949
|
-
}, e.prototype.dlShiftTo = function(e, b) {
|
|
2950
|
-
var x;
|
|
2951
|
-
for (x = this.t - 1; x >= 0; --x) b[x + e] = this[x];
|
|
2952
|
-
for (x = e - 1; x >= 0; --x) b[x] = 0;
|
|
2953
|
-
b.t = this.t + e, b.s = this.s;
|
|
2954
|
-
}, e.prototype.drShiftTo = function(e, b) {
|
|
2955
|
-
for (var x = e; x < this.t; ++x) b[x - e] = this[x];
|
|
2956
|
-
b.t = Math.max(this.t - e, 0), b.s = this.s;
|
|
2957
|
-
}, e.prototype.lShiftTo = function(e, b) {
|
|
2958
|
-
for (var x = e % this.DB, S = this.DB - x, C = (1 << S) - 1, w = Math.floor(e / this.DB), T = this.s << x & this.DM, E = this.t - 1; E >= 0; --E) b[E + w + 1] = this[E] >> S | T, T = (this[E] & C) << x;
|
|
2959
|
-
for (var E = w - 1; E >= 0; --E) b[E] = 0;
|
|
2960
|
-
b[w] = T, b.t = this.t + w + 1, b.s = this.s, b.clamp();
|
|
2961
|
-
}, e.prototype.rShiftTo = function(e, b) {
|
|
2962
|
-
b.s = this.s;
|
|
2963
|
-
var x = Math.floor(e / this.DB);
|
|
2964
|
-
if (x >= this.t) {
|
|
2965
|
-
b.t = 0;
|
|
2966
|
-
return;
|
|
2967
|
-
}
|
|
2968
|
-
var S = e % this.DB, C = this.DB - S, w = (1 << S) - 1;
|
|
2969
|
-
b[0] = this[x] >> S;
|
|
2970
|
-
for (var T = x + 1; T < this.t; ++T) b[T - x - 1] |= (this[T] & w) << C, b[T - x] = this[T] >> S;
|
|
2971
|
-
S > 0 && (b[this.t - x - 1] |= (this.s & w) << C), b.t = this.t - x, b.clamp();
|
|
2972
|
-
}, e.prototype.subTo = function(e, b) {
|
|
2973
|
-
for (var x = 0, S = 0, C = Math.min(e.t, this.t); x < C;) S += this[x] - e[x], b[x++] = S & this.DM, S >>= this.DB;
|
|
2974
|
-
if (e.t < this.t) {
|
|
2975
|
-
for (S -= e.s; x < this.t;) S += this[x], b[x++] = S & this.DM, S >>= this.DB;
|
|
2976
|
-
S += this.s;
|
|
2977
|
-
} else {
|
|
2978
|
-
for (S += this.s; x < e.t;) S -= e[x], b[x++] = S & this.DM, S >>= this.DB;
|
|
2979
|
-
S -= e.s;
|
|
2980
|
-
}
|
|
2981
|
-
b.s = S < 0 ? -1 : 0, S < -1 ? b[x++] = this.DV + S : S > 0 && (b[x++] = S), b.t = x, b.clamp();
|
|
2982
|
-
}, e.prototype.multiplyTo = function(b, x) {
|
|
2983
|
-
var S = this.abs(), C = b.abs(), w = S.t;
|
|
2984
|
-
for (x.t = w + C.t; --w >= 0;) x[w] = 0;
|
|
2985
|
-
for (w = 0; w < C.t; ++w) x[w + S.t] = S.am(0, C[w], x, w, 0, S.t);
|
|
2986
|
-
x.s = 0, x.clamp(), this.s != b.s && e.ZERO.subTo(x, x);
|
|
2987
|
-
}, e.prototype.squareTo = function(e) {
|
|
2988
|
-
for (var b = this.abs(), x = e.t = 2 * b.t; --x >= 0;) e[x] = 0;
|
|
2989
|
-
for (x = 0; x < b.t - 1; ++x) {
|
|
2990
|
-
var S = b.am(x, b[x], e, 2 * x, 0, 1);
|
|
2991
|
-
(e[x + b.t] += b.am(x + 1, 2 * b[x], e, 2 * x + 1, S, b.t - x - 1)) >= b.DV && (e[x + b.t] -= b.DV, e[x + b.t + 1] = 1);
|
|
2992
|
-
}
|
|
2993
|
-
e.t > 0 && (e[e.t - 1] += b.am(x, b[x], e, 2 * x, 0, 1)), e.s = 0, e.clamp();
|
|
2994
|
-
}, e.prototype.divRemTo = function(b, x, S) {
|
|
2995
|
-
var C = b.abs();
|
|
2996
|
-
if (!(C.t <= 0)) {
|
|
2997
|
-
var w = this.abs();
|
|
2998
|
-
if (w.t < C.t) {
|
|
2999
|
-
x?.fromInt(0), S != null && this.copyTo(S);
|
|
3000
|
-
return;
|
|
3001
|
-
}
|
|
3002
|
-
S ??= nbi();
|
|
3003
|
-
var T = nbi(), E = this.s, D = b.s, O = this.DB - nbits(C[C.t - 1]);
|
|
3004
|
-
O > 0 ? (C.lShiftTo(O, T), w.lShiftTo(O, S)) : (C.copyTo(T), w.copyTo(S));
|
|
3005
|
-
var k = T.t, A = T[k - 1];
|
|
3006
|
-
if (A != 0) {
|
|
3007
|
-
var j = A * (1 << this.F1) + (k > 1 ? T[k - 2] >> this.F2 : 0), M = this.FV / j, N = (1 << this.F1) / j, P = 1 << this.F2, F = S.t, I = F - k, L = x ?? nbi();
|
|
3008
|
-
for (T.dlShiftTo(I, L), S.compareTo(L) >= 0 && (S[S.t++] = 1, S.subTo(L, S)), e.ONE.dlShiftTo(k, L), L.subTo(T, T); T.t < k;) T[T.t++] = 0;
|
|
3009
|
-
for (; --I >= 0;) {
|
|
3010
|
-
var R = S[--F] == A ? this.DM : Math.floor(S[F] * M + (S[F - 1] + P) * N);
|
|
3011
|
-
if ((S[F] += T.am(0, R, S, I, 0, k)) < R) for (T.dlShiftTo(I, L), S.subTo(L, S); S[F] < --R;) S.subTo(L, S);
|
|
3012
|
-
}
|
|
3013
|
-
x != null && (S.drShiftTo(k, x), E != D && e.ZERO.subTo(x, x)), S.t = k, S.clamp(), O > 0 && S.rShiftTo(O, S), E < 0 && e.ZERO.subTo(S, S);
|
|
3014
|
-
}
|
|
3015
|
-
}
|
|
3016
|
-
}, e.prototype.invDigit = function() {
|
|
3017
|
-
if (this.t < 1) return 0;
|
|
3018
|
-
var e = this[0];
|
|
3019
|
-
if (!(e & 1)) return 0;
|
|
3020
|
-
var b = e & 3;
|
|
3021
|
-
return b = b * (2 - (e & 15) * b) & 15, b = b * (2 - (e & 255) * b) & 255, b = b * (2 - ((e & 65535) * b & 65535)) & 65535, b = b * (2 - e * b % this.DV) % this.DV, b > 0 ? this.DV - b : -b;
|
|
3022
|
-
}, e.prototype.isEven = function() {
|
|
3023
|
-
return (this.t > 0 ? this[0] & 1 : this.s) == 0;
|
|
3024
|
-
}, e.prototype.exp = function(b, x) {
|
|
3025
|
-
if (b > 4294967295 || b < 1) return e.ONE;
|
|
3026
|
-
var S = nbi(), C = nbi(), w = x.convert(this), T = nbits(b) - 1;
|
|
3027
|
-
for (w.copyTo(S); --T >= 0;) if (x.sqrTo(S, C), (b & 1 << T) > 0) x.mulTo(C, w, S);
|
|
3028
|
-
else {
|
|
3029
|
-
var E = S;
|
|
3030
|
-
S = C, C = E;
|
|
3031
|
-
}
|
|
3032
|
-
return x.revert(S);
|
|
3033
|
-
}, e.prototype.chunkSize = function(e) {
|
|
3034
|
-
return Math.floor(Math.LN2 * this.DB / Math.log(e));
|
|
3035
|
-
}, e.prototype.toRadix = function(e) {
|
|
3036
|
-
if (e ??= 10, this.signum() == 0 || e < 2 || e > 36) return "0";
|
|
3037
|
-
var b = this.chunkSize(e), x = e ** +b, S = nbv(x), C = nbi(), w = nbi(), T = "";
|
|
3038
|
-
for (this.divRemTo(S, C, w); C.signum() > 0;) T = (x + w.intValue()).toString(e).substr(1) + T, C.divRemTo(S, C, w);
|
|
3039
|
-
return w.intValue().toString(e) + T;
|
|
3040
|
-
}, e.prototype.fromRadix = function(b, x) {
|
|
3041
|
-
this.fromInt(0), x ??= 10;
|
|
3042
|
-
for (var S = this.chunkSize(x), C = x ** +S, w = !1, T = 0, E = 0, D = 0; D < b.length; ++D) {
|
|
3043
|
-
var O = intAt(b, D);
|
|
3044
|
-
if (O < 0) {
|
|
3045
|
-
b.charAt(D) == "-" && this.signum() == 0 && (w = !0);
|
|
3046
|
-
continue;
|
|
3047
|
-
}
|
|
3048
|
-
E = x * E + O, ++T >= S && (this.dMultiply(C), this.dAddOffset(E, 0), T = 0, E = 0);
|
|
3049
|
-
}
|
|
3050
|
-
T > 0 && (this.dMultiply(x ** +T), this.dAddOffset(E, 0)), w && e.ZERO.subTo(this, this);
|
|
3051
|
-
}, e.prototype.fromNumber = function(b, x, S) {
|
|
3052
|
-
if (typeof x == "number") if (b < 2) this.fromInt(1);
|
|
3053
|
-
else for (this.fromNumber(b, S), this.testBit(b - 1) || this.bitwiseTo(e.ONE.shiftLeft(b - 1), op_or, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(x);) this.dAddOffset(2, 0), this.bitLength() > b && this.subTo(e.ONE.shiftLeft(b - 1), this);
|
|
3054
|
-
else {
|
|
3055
|
-
var C = [], w = b & 7;
|
|
3056
|
-
C.length = (b >> 3) + 1, x.nextBytes(C), w > 0 ? C[0] &= (1 << w) - 1 : C[0] = 0, this.fromString(C, 256);
|
|
3057
|
-
}
|
|
3058
|
-
}, e.prototype.bitwiseTo = function(e, b, x) {
|
|
3059
|
-
var S, C, w = Math.min(e.t, this.t);
|
|
3060
|
-
for (S = 0; S < w; ++S) x[S] = b(this[S], e[S]);
|
|
3061
|
-
if (e.t < this.t) {
|
|
3062
|
-
for (C = e.s & this.DM, S = w; S < this.t; ++S) x[S] = b(this[S], C);
|
|
3063
|
-
x.t = this.t;
|
|
3064
|
-
} else {
|
|
3065
|
-
for (C = this.s & this.DM, S = w; S < e.t; ++S) x[S] = b(C, e[S]);
|
|
3066
|
-
x.t = e.t;
|
|
3067
|
-
}
|
|
3068
|
-
x.s = b(this.s, e.s), x.clamp();
|
|
3069
|
-
}, e.prototype.changeBit = function(b, x) {
|
|
3070
|
-
var S = e.ONE.shiftLeft(b);
|
|
3071
|
-
return this.bitwiseTo(S, x, S), S;
|
|
3072
|
-
}, e.prototype.addTo = function(e, b) {
|
|
3073
|
-
for (var x = 0, S = 0, C = Math.min(e.t, this.t); x < C;) S += this[x] + e[x], b[x++] = S & this.DM, S >>= this.DB;
|
|
3074
|
-
if (e.t < this.t) {
|
|
3075
|
-
for (S += e.s; x < this.t;) S += this[x], b[x++] = S & this.DM, S >>= this.DB;
|
|
3076
|
-
S += this.s;
|
|
3077
|
-
} else {
|
|
3078
|
-
for (S += this.s; x < e.t;) S += e[x], b[x++] = S & this.DM, S >>= this.DB;
|
|
3079
|
-
S += e.s;
|
|
3080
|
-
}
|
|
3081
|
-
b.s = S < 0 ? -1 : 0, S > 0 ? b[x++] = S : S < -1 && (b[x++] = this.DV + S), b.t = x, b.clamp();
|
|
3082
|
-
}, e.prototype.dMultiply = function(e) {
|
|
3083
|
-
this[this.t] = this.am(0, e - 1, this, 0, 0, this.t), ++this.t, this.clamp();
|
|
3084
|
-
}, e.prototype.dAddOffset = function(e, b) {
|
|
3085
|
-
if (e != 0) {
|
|
3086
|
-
for (; this.t <= b;) this[this.t++] = 0;
|
|
3087
|
-
for (this[b] += e; this[b] >= this.DV;) this[b] -= this.DV, ++b >= this.t && (this[this.t++] = 0), ++this[b];
|
|
3088
|
-
}
|
|
3089
|
-
}, e.prototype.multiplyLowerTo = function(e, b, x) {
|
|
3090
|
-
var S = Math.min(this.t + e.t, b);
|
|
3091
|
-
for (x.s = 0, x.t = S; S > 0;) x[--S] = 0;
|
|
3092
|
-
for (var C = x.t - this.t; S < C; ++S) x[S + this.t] = this.am(0, e[S], x, S, 0, this.t);
|
|
3093
|
-
for (var C = Math.min(e.t, b); S < C; ++S) this.am(0, e[S], x, S, 0, b - S);
|
|
3094
|
-
x.clamp();
|
|
3095
|
-
}, e.prototype.multiplyUpperTo = function(e, b, x) {
|
|
3096
|
-
--b;
|
|
3097
|
-
var S = x.t = this.t + e.t - b;
|
|
3098
|
-
for (x.s = 0; --S >= 0;) x[S] = 0;
|
|
3099
|
-
for (S = Math.max(b - this.t, 0); S < e.t; ++S) x[this.t + S - b] = this.am(b - S, e[S], x, 0, 0, this.t + S - b);
|
|
3100
|
-
x.clamp(), x.drShiftTo(1, x);
|
|
3101
|
-
}, e.prototype.modInt = function(e) {
|
|
3102
|
-
if (e <= 0) return 0;
|
|
3103
|
-
var b = this.DV % e, x = this.s < 0 ? e - 1 : 0;
|
|
3104
|
-
if (this.t > 0) if (b == 0) x = this[0] % e;
|
|
3105
|
-
else for (var S = this.t - 1; S >= 0; --S) x = (b * x + this[S]) % e;
|
|
3106
|
-
return x;
|
|
3107
|
-
}, e.prototype.millerRabin = function(b) {
|
|
3108
|
-
var x = this.subtract(e.ONE), S = x.getLowestSetBit();
|
|
3109
|
-
if (S <= 0) return !1;
|
|
3110
|
-
var C = x.shiftRight(S);
|
|
3111
|
-
b = b + 1 >> 1, b > lowprimes.length && (b = lowprimes.length);
|
|
3112
|
-
for (var w = nbi(), T = 0; T < b; ++T) {
|
|
3113
|
-
w.fromInt(lowprimes[Math.floor(Math.random() * lowprimes.length)]);
|
|
3114
|
-
var E = w.modPow(C, this);
|
|
3115
|
-
if (E.compareTo(e.ONE) != 0 && E.compareTo(x) != 0) {
|
|
3116
|
-
for (var D = 1; D++ < S && E.compareTo(x) != 0;) if (E = E.modPowInt(2, this), E.compareTo(e.ONE) == 0) return !1;
|
|
3117
|
-
if (E.compareTo(x) != 0) return !1;
|
|
3118
|
-
}
|
|
3119
|
-
}
|
|
3120
|
-
return !0;
|
|
3121
|
-
}, e.prototype.square = function() {
|
|
3122
|
-
var e = nbi();
|
|
3123
|
-
return this.squareTo(e), e;
|
|
3124
|
-
}, e.prototype.gcda = function(e, b) {
|
|
3125
|
-
var x = this.s < 0 ? this.negate() : this.clone(), S = e.s < 0 ? e.negate() : e.clone();
|
|
3126
|
-
if (x.compareTo(S) < 0) {
|
|
3127
|
-
var C = x;
|
|
3128
|
-
x = S, S = C;
|
|
3129
|
-
}
|
|
3130
|
-
var w = x.getLowestSetBit(), T = S.getLowestSetBit();
|
|
3131
|
-
if (T < 0) {
|
|
3132
|
-
b(x);
|
|
3133
|
-
return;
|
|
3134
|
-
}
|
|
3135
|
-
w < T && (T = w), T > 0 && (x.rShiftTo(T, x), S.rShiftTo(T, S));
|
|
3136
|
-
var E = function() {
|
|
3137
|
-
(w = x.getLowestSetBit()) > 0 && x.rShiftTo(w, x), (w = S.getLowestSetBit()) > 0 && S.rShiftTo(w, S), x.compareTo(S) >= 0 ? (x.subTo(S, x), x.rShiftTo(1, x)) : (S.subTo(x, S), S.rShiftTo(1, S)), x.signum() > 0 ? setTimeout(E, 0) : (T > 0 && S.lShiftTo(T, S), setTimeout(function() {
|
|
3138
|
-
b(S);
|
|
3139
|
-
}, 0));
|
|
3140
|
-
};
|
|
3141
|
-
setTimeout(E, 10);
|
|
3142
|
-
}, e.prototype.fromNumberAsync = function(b, x, S, C) {
|
|
3143
|
-
if (typeof x == "number") if (b < 2) this.fromInt(1);
|
|
3144
|
-
else {
|
|
3145
|
-
this.fromNumber(b, S), this.testBit(b - 1) || this.bitwiseTo(e.ONE.shiftLeft(b - 1), op_or, this), this.isEven() && this.dAddOffset(1, 0);
|
|
3146
|
-
var w = this, T = function() {
|
|
3147
|
-
w.dAddOffset(2, 0), w.bitLength() > b && w.subTo(e.ONE.shiftLeft(b - 1), w), w.isProbablePrime(x) ? setTimeout(function() {
|
|
3148
|
-
C();
|
|
3149
|
-
}, 0) : setTimeout(T, 0);
|
|
3150
|
-
};
|
|
3151
|
-
setTimeout(T, 0);
|
|
3152
|
-
}
|
|
3153
|
-
else {
|
|
3154
|
-
var E = [], D = b & 7;
|
|
3155
|
-
E.length = (b >> 3) + 1, x.nextBytes(E), D > 0 ? E[0] &= (1 << D) - 1 : E[0] = 0, this.fromString(E, 256);
|
|
3156
|
-
}
|
|
3157
|
-
}, e;
|
|
3158
|
-
}(), NullExp = function() {
|
|
3159
|
-
function e() {}
|
|
3160
|
-
return e.prototype.convert = function(e) {
|
|
3161
|
-
return e;
|
|
3162
|
-
}, e.prototype.revert = function(e) {
|
|
3163
|
-
return e;
|
|
3164
|
-
}, e.prototype.mulTo = function(e, b, x) {
|
|
3165
|
-
e.multiplyTo(b, x);
|
|
3166
|
-
}, e.prototype.sqrTo = function(e, b) {
|
|
3167
|
-
e.squareTo(b);
|
|
3168
|
-
}, e;
|
|
3169
|
-
}(), Classic = function() {
|
|
3170
|
-
function e(e) {
|
|
3171
|
-
this.m = e;
|
|
3172
|
-
}
|
|
3173
|
-
return e.prototype.convert = function(e) {
|
|
3174
|
-
return e.s < 0 || e.compareTo(this.m) >= 0 ? e.mod(this.m) : e;
|
|
3175
|
-
}, e.prototype.revert = function(e) {
|
|
3176
|
-
return e;
|
|
3177
|
-
}, e.prototype.reduce = function(e) {
|
|
3178
|
-
e.divRemTo(this.m, null, e);
|
|
3179
|
-
}, e.prototype.mulTo = function(e, b, x) {
|
|
3180
|
-
e.multiplyTo(b, x), this.reduce(x);
|
|
3181
|
-
}, e.prototype.sqrTo = function(e, b) {
|
|
3182
|
-
e.squareTo(b), this.reduce(b);
|
|
3183
|
-
}, e;
|
|
3184
|
-
}(), Montgomery = function() {
|
|
3185
|
-
function e(e) {
|
|
3186
|
-
this.m = e, this.mp = e.invDigit(), this.mpl = this.mp & 32767, this.mph = this.mp >> 15, this.um = (1 << e.DB - 15) - 1, this.mt2 = 2 * e.t;
|
|
3187
|
-
}
|
|
3188
|
-
return e.prototype.convert = function(e) {
|
|
3189
|
-
var b = nbi();
|
|
3190
|
-
return e.abs().dlShiftTo(this.m.t, b), b.divRemTo(this.m, null, b), e.s < 0 && b.compareTo(BigInteger.ZERO) > 0 && this.m.subTo(b, b), b;
|
|
3191
|
-
}, e.prototype.revert = function(e) {
|
|
3192
|
-
var b = nbi();
|
|
3193
|
-
return e.copyTo(b), this.reduce(b), b;
|
|
3194
|
-
}, e.prototype.reduce = function(e) {
|
|
3195
|
-
for (; e.t <= this.mt2;) e[e.t++] = 0;
|
|
3196
|
-
for (var b = 0; b < this.m.t; ++b) {
|
|
3197
|
-
var x = e[b] & 32767, S = x * this.mpl + ((x * this.mph + (e[b] >> 15) * this.mpl & this.um) << 15) & e.DM;
|
|
3198
|
-
for (x = b + this.m.t, e[x] += this.m.am(0, S, e, b, 0, this.m.t); e[x] >= e.DV;) e[x] -= e.DV, e[++x]++;
|
|
3199
|
-
}
|
|
3200
|
-
e.clamp(), e.drShiftTo(this.m.t, e), e.compareTo(this.m) >= 0 && e.subTo(this.m, e);
|
|
3201
|
-
}, e.prototype.mulTo = function(e, b, x) {
|
|
3202
|
-
e.multiplyTo(b, x), this.reduce(x);
|
|
3203
|
-
}, e.prototype.sqrTo = function(e, b) {
|
|
3204
|
-
e.squareTo(b), this.reduce(b);
|
|
3205
|
-
}, e;
|
|
3206
|
-
}(), Barrett = function() {
|
|
3207
|
-
function e(e) {
|
|
3208
|
-
this.m = e, this.r2 = nbi(), this.q3 = nbi(), BigInteger.ONE.dlShiftTo(2 * e.t, this.r2), this.mu = this.r2.divide(e);
|
|
3209
|
-
}
|
|
3210
|
-
return e.prototype.convert = function(e) {
|
|
3211
|
-
if (e.s < 0 || e.t > 2 * this.m.t) return e.mod(this.m);
|
|
3212
|
-
if (e.compareTo(this.m) < 0) return e;
|
|
3213
|
-
var b = nbi();
|
|
3214
|
-
return e.copyTo(b), this.reduce(b), b;
|
|
3215
|
-
}, e.prototype.revert = function(e) {
|
|
3216
|
-
return e;
|
|
3217
|
-
}, e.prototype.reduce = function(e) {
|
|
3218
|
-
for (e.drShiftTo(this.m.t - 1, this.r2), e.t > this.m.t + 1 && (e.t = this.m.t + 1, e.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); e.compareTo(this.r2) < 0;) e.dAddOffset(1, this.m.t + 1);
|
|
3219
|
-
for (e.subTo(this.r2, e); e.compareTo(this.m) >= 0;) e.subTo(this.m, e);
|
|
3220
|
-
}, e.prototype.mulTo = function(e, b, x) {
|
|
3221
|
-
e.multiplyTo(b, x), this.reduce(x);
|
|
3222
|
-
}, e.prototype.sqrTo = function(e, b) {
|
|
3223
|
-
e.squareTo(b), this.reduce(b);
|
|
3224
|
-
}, e;
|
|
3225
|
-
}();
|
|
3226
|
-
function nbi() {
|
|
3227
|
-
return new BigInteger(null);
|
|
3228
|
-
}
|
|
3229
|
-
function parseBigInt(e, b) {
|
|
3230
|
-
return new BigInteger(e, b);
|
|
3231
|
-
}
|
|
3232
|
-
var inBrowser = typeof navigator < "u";
|
|
3233
|
-
inBrowser && j_lm && navigator.appName == "Microsoft Internet Explorer" ? (BigInteger.prototype.am = function(e, b, x, S, C, w) {
|
|
3234
|
-
for (var T = b & 32767, E = b >> 15; --w >= 0;) {
|
|
3235
|
-
var D = this[e] & 32767, O = this[e++] >> 15, k = E * D + O * T;
|
|
3236
|
-
D = T * D + ((k & 32767) << 15) + x[S] + (C & 1073741823), C = (D >>> 30) + (k >>> 15) + E * O + (C >>> 30), x[S++] = D & 1073741823;
|
|
3237
|
-
}
|
|
3238
|
-
return C;
|
|
3239
|
-
}, dbits = 30) : inBrowser && j_lm && navigator.appName != "Netscape" ? (BigInteger.prototype.am = function(e, b, x, S, C, w) {
|
|
3240
|
-
for (; --w >= 0;) {
|
|
3241
|
-
var T = b * this[e++] + x[S] + C;
|
|
3242
|
-
C = Math.floor(T / 67108864), x[S++] = T & 67108863;
|
|
3243
|
-
}
|
|
3244
|
-
return C;
|
|
3245
|
-
}, dbits = 26) : (BigInteger.prototype.am = function(e, b, x, S, C, w) {
|
|
3246
|
-
for (var T = b & 16383, E = b >> 14; --w >= 0;) {
|
|
3247
|
-
var D = this[e] & 16383, O = this[e++] >> 14, k = E * D + O * T;
|
|
3248
|
-
D = T * D + ((k & 16383) << 14) + x[S] + C, C = (D >> 28) + (k >> 14) + E * O, x[S++] = D & 268435455;
|
|
3249
|
-
}
|
|
3250
|
-
return C;
|
|
3251
|
-
}, dbits = 28), BigInteger.prototype.DB = dbits, BigInteger.prototype.DM = (1 << dbits) - 1, BigInteger.prototype.DV = 1 << dbits;
|
|
3252
|
-
var BI_FP = 52;
|
|
3253
|
-
BigInteger.prototype.FV = 2 ** BI_FP, BigInteger.prototype.F1 = BI_FP - dbits, BigInteger.prototype.F2 = 2 * dbits - BI_FP;
|
|
3254
|
-
var BI_RC = [], rr = 48, vv;
|
|
3255
|
-
for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
|
|
3256
|
-
for (rr = 97, vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
|
|
3257
|
-
for (rr = 65, vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
|
|
3258
|
-
function intAt(e, b) {
|
|
3259
|
-
return BI_RC[e.charCodeAt(b)] ?? -1;
|
|
3260
|
-
}
|
|
3261
|
-
function nbv(e) {
|
|
3262
|
-
var b = nbi();
|
|
3263
|
-
return b.fromInt(e), b;
|
|
3264
|
-
}
|
|
3265
|
-
function nbits(e) {
|
|
3266
|
-
var b = 1, x;
|
|
3267
|
-
return (x = e >>> 16) != 0 && (e = x, b += 16), (x = e >> 8) != 0 && (e = x, b += 8), (x = e >> 4) != 0 && (e = x, b += 4), (x = e >> 2) != 0 && (e = x, b += 2), (x = e >> 1) != 0 && (e = x, b += 1), b;
|
|
3268
|
-
}
|
|
3269
|
-
BigInteger.ZERO = nbv(0), BigInteger.ONE = nbv(1);
|
|
3270
|
-
var Arcfour = function() {
|
|
3271
|
-
function e() {
|
|
3272
|
-
this.i = 0, this.j = 0, this.S = [];
|
|
3273
|
-
}
|
|
3274
|
-
return e.prototype.init = function(e) {
|
|
3275
|
-
var b, x, S;
|
|
3276
|
-
for (b = 0; b < 256; ++b) this.S[b] = b;
|
|
3277
|
-
for (x = 0, b = 0; b < 256; ++b) x = x + this.S[b] + e[b % e.length] & 255, S = this.S[b], this.S[b] = this.S[x], this.S[x] = S;
|
|
3278
|
-
this.i = 0, this.j = 0;
|
|
3279
|
-
}, e.prototype.next = function() {
|
|
3280
|
-
var e;
|
|
3281
|
-
return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, e = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = e, this.S[e + this.S[this.i] & 255];
|
|
3282
|
-
}, e;
|
|
3283
|
-
}();
|
|
3284
|
-
function prng_newstate() {
|
|
3285
|
-
return new Arcfour();
|
|
3286
|
-
}
|
|
3287
|
-
var rng_state, rng_pool = null, rng_pptr;
|
|
3288
|
-
if (rng_pool == null) {
|
|
3289
|
-
rng_pool = [], rng_pptr = 0;
|
|
3290
|
-
var t = void 0;
|
|
3291
|
-
if (typeof window < "u" && window.crypto && window.crypto.getRandomValues) {
|
|
3292
|
-
var z = new Uint32Array(256);
|
|
3293
|
-
for (window.crypto.getRandomValues(z), t = 0; t < z.length; ++t) rng_pool[rng_pptr++] = z[t] & 255;
|
|
3294
|
-
}
|
|
3295
|
-
var count = 0, onMouseMoveListener_1 = function(e) {
|
|
3296
|
-
if (count ||= 0, count >= 256 || rng_pptr >= 256) {
|
|
3297
|
-
window.removeEventListener ? window.removeEventListener("mousemove", onMouseMoveListener_1, !1) : window.detachEvent && window.detachEvent("onmousemove", onMouseMoveListener_1);
|
|
3298
|
-
return;
|
|
3299
|
-
}
|
|
3300
|
-
try {
|
|
3301
|
-
var b = e.x + e.y;
|
|
3302
|
-
rng_pool[rng_pptr++] = b & 255, count += 1;
|
|
3303
|
-
} catch {}
|
|
3304
|
-
};
|
|
3305
|
-
typeof window < "u" && (window.addEventListener ? window.addEventListener("mousemove", onMouseMoveListener_1, !1) : window.attachEvent && window.attachEvent("onmousemove", onMouseMoveListener_1));
|
|
3306
|
-
}
|
|
3307
|
-
function rng_get_byte() {
|
|
3308
|
-
if (rng_state == null) {
|
|
3309
|
-
for (rng_state = prng_newstate(); rng_pptr < 256;) {
|
|
3310
|
-
var e = Math.floor(65536 * Math.random());
|
|
3311
|
-
rng_pool[rng_pptr++] = e & 255;
|
|
3312
|
-
}
|
|
3313
|
-
for (rng_state.init(rng_pool), rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) rng_pool[rng_pptr] = 0;
|
|
3314
|
-
rng_pptr = 0;
|
|
3315
|
-
}
|
|
3316
|
-
return rng_state.next();
|
|
3317
|
-
}
|
|
3318
|
-
var SecureRandom = function() {
|
|
3319
|
-
function e() {}
|
|
3320
|
-
return e.prototype.nextBytes = function(e) {
|
|
3321
|
-
for (var b = 0; b < e.length; ++b) e[b] = rng_get_byte();
|
|
3322
|
-
}, e;
|
|
3323
|
-
}();
|
|
3324
|
-
function pkcs1pad1(e, b) {
|
|
3325
|
-
if (b < e.length + 22) return console.error("Message too long for RSA"), null;
|
|
3326
|
-
for (var x = b - e.length - 6, S = "", C = 0; C < x; C += 2) S += "ff";
|
|
3327
|
-
return parseBigInt("0001" + S + "00" + e, 16);
|
|
3328
|
-
}
|
|
3329
|
-
function pkcs1pad2(e, b) {
|
|
3330
|
-
if (b < e.length + 11) return console.error("Message too long for RSA"), null;
|
|
3331
|
-
for (var x = [], S = e.length - 1; S >= 0 && b > 0;) {
|
|
3332
|
-
var C = e.charCodeAt(S--);
|
|
3333
|
-
C < 128 ? x[--b] = C : C > 127 && C < 2048 ? (x[--b] = C & 63 | 128, x[--b] = C >> 6 | 192) : (x[--b] = C & 63 | 128, x[--b] = C >> 6 & 63 | 128, x[--b] = C >> 12 | 224);
|
|
3334
|
-
}
|
|
3335
|
-
x[--b] = 0;
|
|
3336
|
-
for (var w = new SecureRandom(), T = []; b > 2;) {
|
|
3337
|
-
for (T[0] = 0; T[0] == 0;) w.nextBytes(T);
|
|
3338
|
-
x[--b] = T[0];
|
|
3339
|
-
}
|
|
3340
|
-
return x[--b] = 2, x[--b] = 0, new BigInteger(x);
|
|
3341
|
-
}
|
|
3342
|
-
var RSAKey = function() {
|
|
3343
|
-
function e() {
|
|
3344
|
-
this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null;
|
|
3345
|
-
}
|
|
3346
|
-
return e.prototype.doPublic = function(e) {
|
|
3347
|
-
return e.modPowInt(this.e, this.n);
|
|
3348
|
-
}, e.prototype.doPrivate = function(e) {
|
|
3349
|
-
if (this.p == null || this.q == null) return e.modPow(this.d, this.n);
|
|
3350
|
-
for (var b = e.mod(this.p).modPow(this.dmp1, this.p), x = e.mod(this.q).modPow(this.dmq1, this.q); b.compareTo(x) < 0;) b = b.add(this.p);
|
|
3351
|
-
return b.subtract(x).multiply(this.coeff).mod(this.p).multiply(this.q).add(x);
|
|
3352
|
-
}, e.prototype.setPublic = function(e, b) {
|
|
3353
|
-
e != null && b != null && e.length > 0 && b.length > 0 ? (this.n = parseBigInt(e, 16), this.e = parseInt(b, 16)) : console.error("Invalid RSA public key");
|
|
3354
|
-
}, e.prototype.encrypt = function(e) {
|
|
3355
|
-
var b = this.n.bitLength() + 7 >> 3, x = pkcs1pad2(e, b);
|
|
3356
|
-
if (x == null) return null;
|
|
3357
|
-
var S = this.doPublic(x);
|
|
3358
|
-
if (S == null) return null;
|
|
3359
|
-
for (var C = S.toString(16), w = C.length, T = 0; T < b * 2 - w; T++) C = "0" + C;
|
|
3360
|
-
return C;
|
|
3361
|
-
}, e.prototype.setPrivate = function(e, b, x) {
|
|
3362
|
-
e != null && b != null && e.length > 0 && b.length > 0 ? (this.n = parseBigInt(e, 16), this.e = parseInt(b, 16), this.d = parseBigInt(x, 16)) : console.error("Invalid RSA private key");
|
|
3363
|
-
}, e.prototype.setPrivateEx = function(e, b, x, S, C, w, T, E) {
|
|
3364
|
-
e != null && b != null && e.length > 0 && b.length > 0 ? (this.n = parseBigInt(e, 16), this.e = parseInt(b, 16), this.d = parseBigInt(x, 16), this.p = parseBigInt(S, 16), this.q = parseBigInt(C, 16), this.dmp1 = parseBigInt(w, 16), this.dmq1 = parseBigInt(T, 16), this.coeff = parseBigInt(E, 16)) : console.error("Invalid RSA private key");
|
|
3365
|
-
}, e.prototype.generate = function(e, b) {
|
|
3366
|
-
var x = new SecureRandom(), S = e >> 1;
|
|
3367
|
-
this.e = parseInt(b, 16);
|
|
3368
|
-
for (var C = new BigInteger(b, 16);;) {
|
|
3369
|
-
for (; this.p = new BigInteger(e - S, 1, x), !(this.p.subtract(BigInteger.ONE).gcd(C).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)););
|
|
3370
|
-
for (; this.q = new BigInteger(S, 1, x), !(this.q.subtract(BigInteger.ONE).gcd(C).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)););
|
|
3371
|
-
if (this.p.compareTo(this.q) <= 0) {
|
|
3372
|
-
var w = this.p;
|
|
3373
|
-
this.p = this.q, this.q = w;
|
|
3374
|
-
}
|
|
3375
|
-
var T = this.p.subtract(BigInteger.ONE), E = this.q.subtract(BigInteger.ONE), D = T.multiply(E);
|
|
3376
|
-
if (D.gcd(C).compareTo(BigInteger.ONE) == 0) {
|
|
3377
|
-
this.n = this.p.multiply(this.q), this.d = C.modInverse(D), this.dmp1 = this.d.mod(T), this.dmq1 = this.d.mod(E), this.coeff = this.q.modInverse(this.p);
|
|
3378
|
-
break;
|
|
3379
|
-
}
|
|
3380
|
-
}
|
|
3381
|
-
}, e.prototype.decrypt = function(e) {
|
|
3382
|
-
var b = parseBigInt(e, 16), x = this.doPrivate(b);
|
|
3383
|
-
return x == null ? null : pkcs1unpad2(x, this.n.bitLength() + 7 >> 3);
|
|
3384
|
-
}, e.prototype.generateAsync = function(e, b, x) {
|
|
3385
|
-
var S = new SecureRandom(), C = e >> 1;
|
|
3386
|
-
this.e = parseInt(b, 16);
|
|
3387
|
-
var w = new BigInteger(b, 16), T = this, E = function() {
|
|
3388
|
-
var b = function() {
|
|
3389
|
-
if (T.p.compareTo(T.q) <= 0) {
|
|
3390
|
-
var e = T.p;
|
|
3391
|
-
T.p = T.q, T.q = e;
|
|
3392
|
-
}
|
|
3393
|
-
var b = T.p.subtract(BigInteger.ONE), S = T.q.subtract(BigInteger.ONE), C = b.multiply(S);
|
|
3394
|
-
C.gcd(w).compareTo(BigInteger.ONE) == 0 ? (T.n = T.p.multiply(T.q), T.d = w.modInverse(C), T.dmp1 = T.d.mod(b), T.dmq1 = T.d.mod(S), T.coeff = T.q.modInverse(T.p), setTimeout(function() {
|
|
3395
|
-
x();
|
|
3396
|
-
}, 0)) : setTimeout(E, 0);
|
|
3397
|
-
}, D = function() {
|
|
3398
|
-
T.q = nbi(), T.q.fromNumberAsync(C, 1, S, function() {
|
|
3399
|
-
T.q.subtract(BigInteger.ONE).gcda(w, function(e) {
|
|
3400
|
-
e.compareTo(BigInteger.ONE) == 0 && T.q.isProbablePrime(10) ? setTimeout(b, 0) : setTimeout(D, 0);
|
|
3401
|
-
});
|
|
3402
|
-
});
|
|
3403
|
-
}, O = function() {
|
|
3404
|
-
T.p = nbi(), T.p.fromNumberAsync(e - C, 1, S, function() {
|
|
3405
|
-
T.p.subtract(BigInteger.ONE).gcda(w, function(e) {
|
|
3406
|
-
e.compareTo(BigInteger.ONE) == 0 && T.p.isProbablePrime(10) ? setTimeout(D, 0) : setTimeout(O, 0);
|
|
3407
|
-
});
|
|
3408
|
-
});
|
|
3409
|
-
};
|
|
3410
|
-
setTimeout(O, 0);
|
|
3411
|
-
};
|
|
3412
|
-
setTimeout(E, 0);
|
|
3413
|
-
}, e.prototype.sign = function(e, b, x) {
|
|
3414
|
-
var S = pkcs1pad1(getDigestHeader(x) + b(e).toString(), this.n.bitLength() / 4);
|
|
3415
|
-
if (S == null) return null;
|
|
3416
|
-
var C = this.doPrivate(S);
|
|
3417
|
-
if (C == null) return null;
|
|
3418
|
-
var w = C.toString(16);
|
|
3419
|
-
return w.length & 1 ? "0" + w : w;
|
|
3420
|
-
}, e.prototype.verify = function(e, b, x) {
|
|
3421
|
-
var S = parseBigInt(b, 16), C = this.doPublic(S);
|
|
3422
|
-
return C == null ? null : removeDigestHeader(C.toString(16).replace(/^1f+00/, "")) == x(e).toString();
|
|
3423
|
-
}, e;
|
|
3424
|
-
}();
|
|
3425
|
-
function pkcs1unpad2(e, b) {
|
|
3426
|
-
for (var x = e.toByteArray(), S = 0; S < x.length && x[S] == 0;) ++S;
|
|
3427
|
-
if (x.length - S != b - 1 || x[S] != 2) return null;
|
|
3428
|
-
for (++S; x[S] != 0;) if (++S >= x.length) return null;
|
|
3429
|
-
for (var C = ""; ++S < x.length;) {
|
|
3430
|
-
var w = x[S] & 255;
|
|
3431
|
-
w < 128 ? C += String.fromCharCode(w) : w > 191 && w < 224 ? (C += String.fromCharCode((w & 31) << 6 | x[S + 1] & 63), ++S) : (C += String.fromCharCode((w & 15) << 12 | (x[S + 1] & 63) << 6 | x[S + 2] & 63), S += 2);
|
|
3432
|
-
}
|
|
3433
|
-
return C;
|
|
3434
|
-
}
|
|
3435
|
-
var DIGEST_HEADERS = {
|
|
3436
|
-
md2: "3020300c06082a864886f70d020205000410",
|
|
3437
|
-
md5: "3020300c06082a864886f70d020505000410",
|
|
3438
|
-
sha1: "3021300906052b0e03021a05000414",
|
|
3439
|
-
sha224: "302d300d06096086480165030402040500041c",
|
|
3440
|
-
sha256: "3031300d060960864801650304020105000420",
|
|
3441
|
-
sha384: "3041300d060960864801650304020205000430",
|
|
3442
|
-
sha512: "3051300d060960864801650304020305000440",
|
|
3443
|
-
ripemd160: "3021300906052b2403020105000414"
|
|
3444
|
-
};
|
|
3445
|
-
function getDigestHeader(e) {
|
|
3446
|
-
return DIGEST_HEADERS[e] || "";
|
|
3447
|
-
}
|
|
3448
|
-
function removeDigestHeader(e) {
|
|
3449
|
-
for (var b in DIGEST_HEADERS) if (DIGEST_HEADERS.hasOwnProperty(b)) {
|
|
3450
|
-
var x = DIGEST_HEADERS[b], S = x.length;
|
|
3451
|
-
if (e.substr(0, S) == x) return e.substr(S);
|
|
3452
|
-
}
|
|
3453
|
-
return e;
|
|
3454
|
-
}
|
|
3455
|
-
var YAHOO = {};
|
|
3456
|
-
YAHOO.lang = { extend: function(e, b, x) {
|
|
3457
|
-
if (!b || !e) throw Error("YAHOO.lang.extend failed, please check that all dependencies are included.");
|
|
3458
|
-
var S = function() {};
|
|
3459
|
-
if (S.prototype = b.prototype, e.prototype = new S(), e.prototype.constructor = e, e.superclass = b.prototype, b.prototype.constructor == Object.prototype.constructor && (b.prototype.constructor = b), x) {
|
|
3460
|
-
for (var C in x) e.prototype[C] = x[C];
|
|
3461
|
-
var w = function() {}, T = ["toString", "valueOf"];
|
|
3462
|
-
try {
|
|
3463
|
-
/MSIE/.test(navigator.userAgent) && (w = function(e, b) {
|
|
3464
|
-
for (C = 0; C < T.length; C += 1) {
|
|
3465
|
-
var x = T[C], S = b[x];
|
|
3466
|
-
typeof S == "function" && S != Object.prototype[x] && (e[x] = S);
|
|
3467
|
-
}
|
|
3468
|
-
});
|
|
3469
|
-
} catch {}
|
|
3470
|
-
w(e.prototype, x);
|
|
3471
|
-
}
|
|
3472
|
-
} };
|
|
3473
|
-
/**
|
|
3474
|
-
* @fileOverview
|
|
3475
|
-
* @name asn1-1.0.js
|
|
3476
|
-
* @author Kenji Urushima kenji.urushima@gmail.com
|
|
3477
|
-
* @version asn1 1.0.13 (2017-Jun-02)
|
|
3478
|
-
* @since jsrsasign 2.1
|
|
3479
|
-
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
3480
|
-
*/
|
|
3481
|
-
var KJUR = {};
|
|
3482
|
-
(KJUR.asn1 === void 0 || !KJUR.asn1) && (KJUR.asn1 = {}), KJUR.asn1.ASN1Util = new function() {
|
|
3483
|
-
this.integerToByteHex = function(e) {
|
|
3484
|
-
var b = e.toString(16);
|
|
3485
|
-
return b.length % 2 == 1 && (b = "0" + b), b;
|
|
3486
|
-
}, this.bigIntToMinTwosComplementsHex = function(e) {
|
|
3487
|
-
var b = e.toString(16);
|
|
3488
|
-
if (b.substr(0, 1) != "-") b.length % 2 == 1 ? b = "0" + b : b.match(/^[0-7]/) || (b = "00" + b);
|
|
3489
|
-
else {
|
|
3490
|
-
var x = b.substr(1).length;
|
|
3491
|
-
x % 2 == 1 ? x += 1 : b.match(/^[0-7]/) || (x += 2);
|
|
3492
|
-
for (var S = "", C = 0; C < x; C++) S += "f";
|
|
3493
|
-
b = new BigInteger(S, 16).xor(e).add(BigInteger.ONE).toString(16).replace(/^-/, "");
|
|
3494
|
-
}
|
|
3495
|
-
return b;
|
|
3496
|
-
}, this.getPEMStringFromHex = function(e, b) {
|
|
3497
|
-
return hextopem(e, b);
|
|
3498
|
-
}, this.newObject = function(e) {
|
|
3499
|
-
var b = KJUR.asn1, x = b.DERBoolean, S = b.DERInteger, C = b.DERBitString, w = b.DEROctetString, T = b.DERNull, E = b.DERObjectIdentifier, D = b.DEREnumerated, O = b.DERUTF8String, k = b.DERNumericString, A = b.DERPrintableString, j = b.DERTeletexString, M = b.DERIA5String, N = b.DERUTCTime, P = b.DERGeneralizedTime, F = b.DERSequence, I = b.DERSet, L = b.DERTaggedObject, R = b.ASN1Util.newObject, B = Object.keys(e);
|
|
3500
|
-
if (B.length != 1) throw "key of param shall be only one.";
|
|
3501
|
-
var V = B[0];
|
|
3502
|
-
if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + V + ":") == -1) throw "undefined key: " + V;
|
|
3503
|
-
if (V == "bool") return new x(e[V]);
|
|
3504
|
-
if (V == "int") return new S(e[V]);
|
|
3505
|
-
if (V == "bitstr") return new C(e[V]);
|
|
3506
|
-
if (V == "octstr") return new w(e[V]);
|
|
3507
|
-
if (V == "null") return new T(e[V]);
|
|
3508
|
-
if (V == "oid") return new E(e[V]);
|
|
3509
|
-
if (V == "enum") return new D(e[V]);
|
|
3510
|
-
if (V == "utf8str") return new O(e[V]);
|
|
3511
|
-
if (V == "numstr") return new k(e[V]);
|
|
3512
|
-
if (V == "prnstr") return new A(e[V]);
|
|
3513
|
-
if (V == "telstr") return new j(e[V]);
|
|
3514
|
-
if (V == "ia5str") return new M(e[V]);
|
|
3515
|
-
if (V == "utctime") return new N(e[V]);
|
|
3516
|
-
if (V == "gentime") return new P(e[V]);
|
|
3517
|
-
if (V == "seq") {
|
|
3518
|
-
for (var H = e[V], U = [], W = 0; W < H.length; W++) {
|
|
3519
|
-
var G = R(H[W]);
|
|
3520
|
-
U.push(G);
|
|
3521
|
-
}
|
|
3522
|
-
return new F({ array: U });
|
|
3523
|
-
}
|
|
3524
|
-
if (V == "set") {
|
|
3525
|
-
for (var H = e[V], U = [], W = 0; W < H.length; W++) {
|
|
3526
|
-
var G = R(H[W]);
|
|
3527
|
-
U.push(G);
|
|
3528
|
-
}
|
|
3529
|
-
return new I({ array: U });
|
|
3530
|
-
}
|
|
3531
|
-
if (V == "tag") {
|
|
3532
|
-
var K = e[V];
|
|
3533
|
-
if (Object.prototype.toString.call(K) === "[object Array]" && K.length == 3) {
|
|
3534
|
-
var q = R(K[2]);
|
|
3535
|
-
return new L({
|
|
3536
|
-
tag: K[0],
|
|
3537
|
-
explicit: K[1],
|
|
3538
|
-
obj: q
|
|
3539
|
-
});
|
|
3540
|
-
} else {
|
|
3541
|
-
var J = {};
|
|
3542
|
-
if (K.explicit !== void 0 && (J.explicit = K.explicit), K.tag !== void 0 && (J.tag = K.tag), K.obj === void 0) throw "obj shall be specified for 'tag'.";
|
|
3543
|
-
return J.obj = R(K.obj), new L(J);
|
|
3544
|
-
}
|
|
3545
|
-
}
|
|
3546
|
-
}, this.jsonToASN1HEX = function(e) {
|
|
3547
|
-
return this.newObject(e).getEncodedHex();
|
|
3548
|
-
};
|
|
3549
|
-
}(), KJUR.asn1.ASN1Util.oidHexToInt = function(e) {
|
|
3550
|
-
for (var b = "", x = parseInt(e.substr(0, 2), 16), S = Math.floor(x / 40), C = x % 40, b = S + "." + C, w = "", T = 2; T < e.length; T += 2) {
|
|
3551
|
-
var E = ("00000000" + parseInt(e.substr(T, 2), 16).toString(2)).slice(-8);
|
|
3552
|
-
if (w += E.substr(1, 7), E.substr(0, 1) == "0") {
|
|
3553
|
-
var D = new BigInteger(w, 2);
|
|
3554
|
-
b = b + "." + D.toString(10), w = "";
|
|
3555
|
-
}
|
|
3556
|
-
}
|
|
3557
|
-
return b;
|
|
3558
|
-
}, KJUR.asn1.ASN1Util.oidIntToHex = function(e) {
|
|
3559
|
-
var b = function(e) {
|
|
3560
|
-
var b = e.toString(16);
|
|
3561
|
-
return b.length == 1 && (b = "0" + b), b;
|
|
3562
|
-
}, x = function(e) {
|
|
3563
|
-
var x = "", S = new BigInteger(e, 10).toString(2), C = 7 - S.length % 7;
|
|
3564
|
-
C == 7 && (C = 0);
|
|
3565
|
-
for (var w = "", T = 0; T < C; T++) w += "0";
|
|
3566
|
-
S = w + S;
|
|
3567
|
-
for (var T = 0; T < S.length - 1; T += 7) {
|
|
3568
|
-
var E = S.substr(T, 7);
|
|
3569
|
-
T != S.length - 7 && (E = "1" + E), x += b(parseInt(E, 2));
|
|
3570
|
-
}
|
|
3571
|
-
return x;
|
|
3572
|
-
};
|
|
3573
|
-
if (!e.match(/^[0-9.]+$/)) throw "malformed oid string: " + e;
|
|
3574
|
-
var S = "", C = e.split("."), w = parseInt(C[0]) * 40 + parseInt(C[1]);
|
|
3575
|
-
S += b(w), C.splice(0, 2);
|
|
3576
|
-
for (var T = 0; T < C.length; T++) S += x(C[T]);
|
|
3577
|
-
return S;
|
|
3578
|
-
}, KJUR.asn1.ASN1Object = function() {
|
|
3579
|
-
var e = "";
|
|
3580
|
-
this.getLengthHexFromValue = function() {
|
|
3581
|
-
if (this.hV === void 0 || this.hV == null) throw "this.hV is null or undefined.";
|
|
3582
|
-
if (this.hV.length % 2 == 1) throw "value hex must be even length: n=" + e.length + ",v=" + this.hV;
|
|
3583
|
-
var b = this.hV.length / 2, x = b.toString(16);
|
|
3584
|
-
if (x.length % 2 == 1 && (x = "0" + x), b < 128) return x;
|
|
3585
|
-
var S = x.length / 2;
|
|
3586
|
-
if (S > 15) throw "ASN.1 length too long to represent by 8x: n = " + b.toString(16);
|
|
3587
|
-
return (128 + S).toString(16) + x;
|
|
3588
|
-
}, this.getEncodedHex = function() {
|
|
3589
|
-
return (this.hTLV == null || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV;
|
|
3590
|
-
}, this.getValueHex = function() {
|
|
3591
|
-
return this.getEncodedHex(), this.hV;
|
|
3592
|
-
}, this.getFreshValueHex = function() {
|
|
3593
|
-
return "";
|
|
3594
|
-
};
|
|
3595
|
-
}, KJUR.asn1.DERAbstractString = function(e) {
|
|
3596
|
-
KJUR.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function() {
|
|
3597
|
-
return this.s;
|
|
3598
|
-
}, this.setString = function(e) {
|
|
3599
|
-
this.hTLV = null, this.isModified = !0, this.s = e, this.hV = stohex(this.s);
|
|
3600
|
-
}, this.setStringHex = function(e) {
|
|
3601
|
-
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = e;
|
|
3602
|
-
}, this.getFreshValueHex = function() {
|
|
3603
|
-
return this.hV;
|
|
3604
|
-
}, e !== void 0 && (typeof e == "string" ? this.setString(e) : e.str === void 0 ? e.hex !== void 0 && this.setStringHex(e.hex) : this.setString(e.str));
|
|
3605
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object), KJUR.asn1.DERAbstractTime = function(e) {
|
|
3606
|
-
KJUR.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function(e) {
|
|
3607
|
-
return utc = e.getTime() + e.getTimezoneOffset() * 6e4, new Date(utc);
|
|
3608
|
-
}, this.formatDate = function(e, b, x) {
|
|
3609
|
-
var S = this.zeroPadding, C = this.localDateToUTC(e), w = String(C.getFullYear());
|
|
3610
|
-
b == "utc" && (w = w.substr(2, 2));
|
|
3611
|
-
var T = S(String(C.getMonth() + 1), 2), E = S(String(C.getDate()), 2), D = S(String(C.getHours()), 2), O = S(String(C.getMinutes()), 2), k = S(String(C.getSeconds()), 2), A = w + T + E + D + O + k;
|
|
3612
|
-
if (x === !0) {
|
|
3613
|
-
var j = C.getMilliseconds();
|
|
3614
|
-
if (j != 0) {
|
|
3615
|
-
var M = S(String(j), 3);
|
|
3616
|
-
M = M.replace(/[0]+$/, ""), A = A + "." + M;
|
|
3617
|
-
}
|
|
3618
|
-
}
|
|
3619
|
-
return A + "Z";
|
|
3620
|
-
}, this.zeroPadding = function(e, b) {
|
|
3621
|
-
return e.length >= b ? e : Array(b - e.length + 1).join("0") + e;
|
|
3622
|
-
}, this.getString = function() {
|
|
3623
|
-
return this.s;
|
|
3624
|
-
}, this.setString = function(e) {
|
|
3625
|
-
this.hTLV = null, this.isModified = !0, this.s = e, this.hV = stohex(e);
|
|
3626
|
-
}, this.setByDateValue = function(e, b, x, S, C, w) {
|
|
3627
|
-
var T = new Date(Date.UTC(e, b - 1, x, S, C, w, 0));
|
|
3628
|
-
this.setByDate(T);
|
|
3629
|
-
}, this.getFreshValueHex = function() {
|
|
3630
|
-
return this.hV;
|
|
3631
|
-
};
|
|
3632
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object), KJUR.asn1.DERAbstractStructured = function(e) {
|
|
3633
|
-
KJUR.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function(e) {
|
|
3634
|
-
this.hTLV = null, this.isModified = !0, this.asn1Array = e;
|
|
3635
|
-
}, this.appendASN1Object = function(e) {
|
|
3636
|
-
this.hTLV = null, this.isModified = !0, this.asn1Array.push(e);
|
|
3637
|
-
}, this.asn1Array = [], e !== void 0 && e.array !== void 0 && (this.asn1Array = e.array);
|
|
3638
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object), KJUR.asn1.DERBoolean = function() {
|
|
3639
|
-
KJUR.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff";
|
|
3640
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object), KJUR.asn1.DERInteger = function(e) {
|
|
3641
|
-
KJUR.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function(e) {
|
|
3642
|
-
this.hTLV = null, this.isModified = !0, this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e);
|
|
3643
|
-
}, this.setByInteger = function(e) {
|
|
3644
|
-
var b = new BigInteger(String(e), 10);
|
|
3645
|
-
this.setByBigInteger(b);
|
|
3646
|
-
}, this.setValueHex = function(e) {
|
|
3647
|
-
this.hV = e;
|
|
3648
|
-
}, this.getFreshValueHex = function() {
|
|
3649
|
-
return this.hV;
|
|
3650
|
-
}, e !== void 0 && (e.bigint === void 0 ? e.int === void 0 ? typeof e == "number" ? this.setByInteger(e) : e.hex !== void 0 && this.setValueHex(e.hex) : this.setByInteger(e.int) : this.setByBigInteger(e.bigint));
|
|
3651
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object), KJUR.asn1.DERBitString = function(e) {
|
|
3652
|
-
e !== void 0 && e.obj !== void 0 && (e.hex = "00" + KJUR.asn1.ASN1Util.newObject(e.obj).getEncodedHex()), KJUR.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function(e) {
|
|
3653
|
-
this.hTLV = null, this.isModified = !0, this.hV = e;
|
|
3654
|
-
}, this.setUnusedBitsAndHexValue = function(e, b) {
|
|
3655
|
-
if (e < 0 || 7 < e) throw "unused bits shall be from 0 to 7: u = " + e;
|
|
3656
|
-
var x = "0" + e;
|
|
3657
|
-
this.hTLV = null, this.isModified = !0, this.hV = x + b;
|
|
3658
|
-
}, this.setByBinaryString = function(e) {
|
|
3659
|
-
e = e.replace(/0+$/, "");
|
|
3660
|
-
var b = 8 - e.length % 8;
|
|
3661
|
-
b == 8 && (b = 0);
|
|
3662
|
-
for (var x = 0; x <= b; x++) e += "0";
|
|
3663
|
-
for (var S = "", x = 0; x < e.length - 1; x += 8) {
|
|
3664
|
-
var C = e.substr(x, 8), w = parseInt(C, 2).toString(16);
|
|
3665
|
-
w.length == 1 && (w = "0" + w), S += w;
|
|
3666
|
-
}
|
|
3667
|
-
this.hTLV = null, this.isModified = !0, this.hV = "0" + b + S;
|
|
3668
|
-
}, this.setByBooleanArray = function(e) {
|
|
3669
|
-
for (var b = "", x = 0; x < e.length; x++) e[x] == 1 ? b += "1" : b += "0";
|
|
3670
|
-
this.setByBinaryString(b);
|
|
3671
|
-
}, this.newFalseArray = function(e) {
|
|
3672
|
-
for (var b = Array(e), x = 0; x < e; x++) b[x] = !1;
|
|
3673
|
-
return b;
|
|
3674
|
-
}, this.getFreshValueHex = function() {
|
|
3675
|
-
return this.hV;
|
|
3676
|
-
}, e !== void 0 && (typeof e == "string" && e.toLowerCase().match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(e) : e.hex === void 0 ? e.bin === void 0 ? e.array !== void 0 && this.setByBooleanArray(e.array) : this.setByBinaryString(e.bin) : this.setHexValueIncludingUnusedBits(e.hex));
|
|
3677
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object), KJUR.asn1.DEROctetString = function(e) {
|
|
3678
|
-
e !== void 0 && e.obj !== void 0 && (e.hex = KJUR.asn1.ASN1Util.newObject(e.obj).getEncodedHex()), KJUR.asn1.DEROctetString.superclass.constructor.call(this, e), this.hT = "04";
|
|
3679
|
-
}, YAHOO.lang.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERNull = function() {
|
|
3680
|
-
KJUR.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500";
|
|
3681
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object), KJUR.asn1.DERObjectIdentifier = function(e) {
|
|
3682
|
-
var b = function(e) {
|
|
3683
|
-
var b = e.toString(16);
|
|
3684
|
-
return b.length == 1 && (b = "0" + b), b;
|
|
3685
|
-
}, x = function(e) {
|
|
3686
|
-
var x = "", S = new BigInteger(e, 10).toString(2), C = 7 - S.length % 7;
|
|
3687
|
-
C == 7 && (C = 0);
|
|
3688
|
-
for (var w = "", T = 0; T < C; T++) w += "0";
|
|
3689
|
-
S = w + S;
|
|
3690
|
-
for (var T = 0; T < S.length - 1; T += 7) {
|
|
3691
|
-
var E = S.substr(T, 7);
|
|
3692
|
-
T != S.length - 7 && (E = "1" + E), x += b(parseInt(E, 2));
|
|
3693
|
-
}
|
|
3694
|
-
return x;
|
|
3695
|
-
};
|
|
3696
|
-
KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function(e) {
|
|
3697
|
-
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = e;
|
|
3698
|
-
}, this.setValueOidString = function(e) {
|
|
3699
|
-
if (!e.match(/^[0-9.]+$/)) throw "malformed oid string: " + e;
|
|
3700
|
-
var S = "", C = e.split("."), w = parseInt(C[0]) * 40 + parseInt(C[1]);
|
|
3701
|
-
S += b(w), C.splice(0, 2);
|
|
3702
|
-
for (var T = 0; T < C.length; T++) S += x(C[T]);
|
|
3703
|
-
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = S;
|
|
3704
|
-
}, this.setValueName = function(e) {
|
|
3705
|
-
var b = KJUR.asn1.x509.OID.name2oid(e);
|
|
3706
|
-
if (b !== "") this.setValueOidString(b);
|
|
3707
|
-
else throw "DERObjectIdentifier oidName undefined: " + e;
|
|
3708
|
-
}, this.getFreshValueHex = function() {
|
|
3709
|
-
return this.hV;
|
|
3710
|
-
}, e !== void 0 && (typeof e == "string" ? e.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(e) : this.setValueName(e) : e.oid === void 0 ? e.hex === void 0 ? e.name !== void 0 && this.setValueName(e.name) : this.setValueHex(e.hex) : this.setValueOidString(e.oid));
|
|
3711
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object), KJUR.asn1.DEREnumerated = function(e) {
|
|
3712
|
-
KJUR.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function(e) {
|
|
3713
|
-
this.hTLV = null, this.isModified = !0, this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e);
|
|
3714
|
-
}, this.setByInteger = function(e) {
|
|
3715
|
-
var b = new BigInteger(String(e), 10);
|
|
3716
|
-
this.setByBigInteger(b);
|
|
3717
|
-
}, this.setValueHex = function(e) {
|
|
3718
|
-
this.hV = e;
|
|
3719
|
-
}, this.getFreshValueHex = function() {
|
|
3720
|
-
return this.hV;
|
|
3721
|
-
}, e !== void 0 && (e.int === void 0 ? typeof e == "number" ? this.setByInteger(e) : e.hex !== void 0 && this.setValueHex(e.hex) : this.setByInteger(e.int));
|
|
3722
|
-
}, YAHOO.lang.extend(KJUR.asn1.DEREnumerated, KJUR.asn1.ASN1Object), KJUR.asn1.DERUTF8String = function(e) {
|
|
3723
|
-
KJUR.asn1.DERUTF8String.superclass.constructor.call(this, e), this.hT = "0c";
|
|
3724
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString), KJUR.asn1.DERNumericString = function(e) {
|
|
3725
|
-
KJUR.asn1.DERNumericString.superclass.constructor.call(this, e), this.hT = "12";
|
|
3726
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERPrintableString = function(e) {
|
|
3727
|
-
KJUR.asn1.DERPrintableString.superclass.constructor.call(this, e), this.hT = "13";
|
|
3728
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERTeletexString = function(e) {
|
|
3729
|
-
KJUR.asn1.DERTeletexString.superclass.constructor.call(this, e), this.hT = "14";
|
|
3730
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERIA5String = function(e) {
|
|
3731
|
-
KJUR.asn1.DERIA5String.superclass.constructor.call(this, e), this.hT = "16";
|
|
3732
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString), KJUR.asn1.DERUTCTime = function(e) {
|
|
3733
|
-
KJUR.asn1.DERUTCTime.superclass.constructor.call(this, e), this.hT = "17", this.setByDate = function(e) {
|
|
3734
|
-
this.hTLV = null, this.isModified = !0, this.date = e, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s);
|
|
3735
|
-
}, this.getFreshValueHex = function() {
|
|
3736
|
-
return this.date === void 0 && this.s === void 0 && (this.date = /* @__PURE__ */ new Date(), this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)), this.hV;
|
|
3737
|
-
}, e !== void 0 && (e.str === void 0 ? typeof e == "string" && e.match(/^[0-9]{12}Z$/) ? this.setString(e) : e.hex === void 0 ? e.date !== void 0 && this.setByDate(e.date) : this.setStringHex(e.hex) : this.setString(e.str));
|
|
3738
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime), KJUR.asn1.DERGeneralizedTime = function(e) {
|
|
3739
|
-
KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, e), this.hT = "18", this.withMillis = !1, this.setByDate = function(e) {
|
|
3740
|
-
this.hTLV = null, this.isModified = !0, this.date = e, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s);
|
|
3741
|
-
}, this.getFreshValueHex = function() {
|
|
3742
|
-
return this.date === void 0 && this.s === void 0 && (this.date = /* @__PURE__ */ new Date(), this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)), this.hV;
|
|
3743
|
-
}, e !== void 0 && (e.str === void 0 ? typeof e == "string" && e.match(/^[0-9]{14}Z$/) ? this.setString(e) : e.hex === void 0 ? e.date !== void 0 && this.setByDate(e.date) : this.setStringHex(e.hex) : this.setString(e.str), e.millis === !0 && (this.withMillis = !0));
|
|
3744
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime), KJUR.asn1.DERSequence = function(e) {
|
|
3745
|
-
KJUR.asn1.DERSequence.superclass.constructor.call(this, e), this.hT = "30", this.getFreshValueHex = function() {
|
|
3746
|
-
for (var e = "", b = 0; b < this.asn1Array.length; b++) {
|
|
3747
|
-
var x = this.asn1Array[b];
|
|
3748
|
-
e += x.getEncodedHex();
|
|
3749
|
-
}
|
|
3750
|
-
return this.hV = e, this.hV;
|
|
3751
|
-
};
|
|
3752
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured), KJUR.asn1.DERSet = function(e) {
|
|
3753
|
-
KJUR.asn1.DERSet.superclass.constructor.call(this, e), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function() {
|
|
3754
|
-
for (var e = [], b = 0; b < this.asn1Array.length; b++) {
|
|
3755
|
-
var x = this.asn1Array[b];
|
|
3756
|
-
e.push(x.getEncodedHex());
|
|
3757
|
-
}
|
|
3758
|
-
return this.sortFlag == 1 && e.sort(), this.hV = e.join(""), this.hV;
|
|
3759
|
-
}, e !== void 0 && e.sortflag !== void 0 && e.sortflag == 0 && (this.sortFlag = !1);
|
|
3760
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured), KJUR.asn1.DERTaggedObject = function(e) {
|
|
3761
|
-
KJUR.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function(e, b, x) {
|
|
3762
|
-
this.hT = b, this.isExplicit = e, this.asn1Object = x, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = x.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, b), this.isModified = !1);
|
|
3763
|
-
}, this.getFreshValueHex = function() {
|
|
3764
|
-
return this.hV;
|
|
3765
|
-
}, e !== void 0 && (e.tag !== void 0 && (this.hT = e.tag), e.explicit !== void 0 && (this.isExplicit = e.explicit), e.obj !== void 0 && (this.asn1Object = e.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)));
|
|
3766
|
-
}, YAHOO.lang.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object);
|
|
3767
|
-
var __extends = (function() {
|
|
3768
|
-
var e = function(b, x) {
|
|
3769
|
-
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, b) {
|
|
3770
|
-
e.__proto__ = b;
|
|
3771
|
-
} || function(e, b) {
|
|
3772
|
-
for (var x in b) Object.prototype.hasOwnProperty.call(b, x) && (e[x] = b[x]);
|
|
3773
|
-
}, e(b, x);
|
|
3774
|
-
};
|
|
3775
|
-
return function(b, x) {
|
|
3776
|
-
if (typeof x != "function" && x !== null) throw TypeError("Class extends value " + String(x) + " is not a constructor or null");
|
|
3777
|
-
e(b, x);
|
|
3778
|
-
function S() {
|
|
3779
|
-
this.constructor = b;
|
|
3780
|
-
}
|
|
3781
|
-
b.prototype = x === null ? Object.create(x) : (S.prototype = x.prototype, new S());
|
|
3782
|
-
};
|
|
3783
|
-
})(), JSEncryptRSAKey = function(e) {
|
|
3784
|
-
__extends(b, e);
|
|
3785
|
-
function b(x) {
|
|
3786
|
-
var S = e.call(this) || this;
|
|
3787
|
-
return x && (typeof x == "string" ? S.parseKey(x) : (b.hasPrivateKeyProperty(x) || b.hasPublicKeyProperty(x)) && S.parsePropertiesFrom(x)), S;
|
|
3788
|
-
}
|
|
3789
|
-
return b.prototype.parseKey = function(e) {
|
|
3790
|
-
try {
|
|
3791
|
-
var b = 0, x = 0, S = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e) ? Hex.decode(e) : Base64.unarmor(e), C = ASN1.decode(S);
|
|
3792
|
-
if (C.sub.length === 3 && (C = C.sub[2].sub[0]), C.sub.length === 9) b = C.sub[1].getHexStringValue(), this.n = parseBigInt(b, 16), x = C.sub[2].getHexStringValue(), this.e = parseInt(x, 16), this.d = parseBigInt(C.sub[3].getHexStringValue(), 16), this.p = parseBigInt(C.sub[4].getHexStringValue(), 16), this.q = parseBigInt(C.sub[5].getHexStringValue(), 16), this.dmp1 = parseBigInt(C.sub[6].getHexStringValue(), 16), this.dmq1 = parseBigInt(C.sub[7].getHexStringValue(), 16), this.coeff = parseBigInt(C.sub[8].getHexStringValue(), 16);
|
|
3793
|
-
else if (C.sub.length === 2) if (C.sub[0].sub) {
|
|
3794
|
-
var w = C.sub[1].sub[0];
|
|
3795
|
-
b = w.sub[0].getHexStringValue(), this.n = parseBigInt(b, 16), x = w.sub[1].getHexStringValue(), this.e = parseInt(x, 16);
|
|
3796
|
-
} else b = C.sub[0].getHexStringValue(), this.n = parseBigInt(b, 16), x = C.sub[1].getHexStringValue(), this.e = parseInt(x, 16);
|
|
3797
|
-
else return !1;
|
|
3798
|
-
return !0;
|
|
3799
|
-
} catch {
|
|
3800
|
-
return !1;
|
|
3801
|
-
}
|
|
3802
|
-
}, b.prototype.getPrivateBaseKey = function() {
|
|
3803
|
-
var e = { array: [
|
|
3804
|
-
new KJUR.asn1.DERInteger({ int: 0 }),
|
|
3805
|
-
new KJUR.asn1.DERInteger({ bigint: this.n }),
|
|
3806
|
-
new KJUR.asn1.DERInteger({ int: this.e }),
|
|
3807
|
-
new KJUR.asn1.DERInteger({ bigint: this.d }),
|
|
3808
|
-
new KJUR.asn1.DERInteger({ bigint: this.p }),
|
|
3809
|
-
new KJUR.asn1.DERInteger({ bigint: this.q }),
|
|
3810
|
-
new KJUR.asn1.DERInteger({ bigint: this.dmp1 }),
|
|
3811
|
-
new KJUR.asn1.DERInteger({ bigint: this.dmq1 }),
|
|
3812
|
-
new KJUR.asn1.DERInteger({ bigint: this.coeff })
|
|
3813
|
-
] };
|
|
3814
|
-
return new KJUR.asn1.DERSequence(e).getEncodedHex();
|
|
3815
|
-
}, b.prototype.getPrivateBaseKeyB64 = function() {
|
|
3816
|
-
return hex2b64(this.getPrivateBaseKey());
|
|
3817
|
-
}, b.prototype.getPublicBaseKey = function() {
|
|
3818
|
-
var e = new KJUR.asn1.DERSequence({ array: [new KJUR.asn1.DERObjectIdentifier({ oid: "1.2.840.113549.1.1.1" }), new KJUR.asn1.DERNull()] }), b = new KJUR.asn1.DERSequence({ array: [new KJUR.asn1.DERInteger({ bigint: this.n }), new KJUR.asn1.DERInteger({ int: this.e })] }), x = new KJUR.asn1.DERBitString({ hex: "00" + b.getEncodedHex() });
|
|
3819
|
-
return new KJUR.asn1.DERSequence({ array: [e, x] }).getEncodedHex();
|
|
3820
|
-
}, b.prototype.getPublicBaseKeyB64 = function() {
|
|
3821
|
-
return hex2b64(this.getPublicBaseKey());
|
|
3822
|
-
}, b.wordwrap = function(e, b) {
|
|
3823
|
-
if (b ||= 64, !e) return e;
|
|
3824
|
-
var x = "(.{1," + b + "})( +|$\n?)|(.{1," + b + "})";
|
|
3825
|
-
return e.match(RegExp(x, "g")).join("\n");
|
|
3826
|
-
}, b.prototype.getPrivateKey = function() {
|
|
3827
|
-
var e = "-----BEGIN RSA PRIVATE KEY-----\n";
|
|
3828
|
-
return e += b.wordwrap(this.getPrivateBaseKeyB64()) + "\n", e += "-----END RSA PRIVATE KEY-----", e;
|
|
3829
|
-
}, b.prototype.getPublicKey = function() {
|
|
3830
|
-
var e = "-----BEGIN PUBLIC KEY-----\n";
|
|
3831
|
-
return e += b.wordwrap(this.getPublicBaseKeyB64()) + "\n", e += "-----END PUBLIC KEY-----", e;
|
|
3832
|
-
}, b.hasPublicKeyProperty = function(e) {
|
|
3833
|
-
return e ||= {}, e.hasOwnProperty("n") && e.hasOwnProperty("e");
|
|
3834
|
-
}, b.hasPrivateKeyProperty = function(e) {
|
|
3835
|
-
return e ||= {}, e.hasOwnProperty("n") && e.hasOwnProperty("e") && e.hasOwnProperty("d") && e.hasOwnProperty("p") && e.hasOwnProperty("q") && e.hasOwnProperty("dmp1") && e.hasOwnProperty("dmq1") && e.hasOwnProperty("coeff");
|
|
3836
|
-
}, b.prototype.parsePropertiesFrom = function(e) {
|
|
3837
|
-
this.n = e.n, this.e = e.e, e.hasOwnProperty("d") && (this.d = e.d, this.p = e.p, this.q = e.q, this.dmp1 = e.dmp1, this.dmq1 = e.dmq1, this.coeff = e.coeff);
|
|
3838
|
-
}, b;
|
|
3839
|
-
}(RSAKey), version = typeof process < "u" ? process.env?.npm_package_version : void 0, lib_default = function() {
|
|
3840
|
-
function e(e) {
|
|
3841
|
-
e === void 0 && (e = {}), e ||= {}, this.default_key_size = e.default_key_size ? parseInt(e.default_key_size, 10) : 1024, this.default_public_exponent = e.default_public_exponent || "010001", this.log = e.log || !1, this.key = null;
|
|
3842
|
-
}
|
|
3843
|
-
return e.prototype.setKey = function(e) {
|
|
3844
|
-
this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new JSEncryptRSAKey(e);
|
|
3845
|
-
}, e.prototype.setPrivateKey = function(e) {
|
|
3846
|
-
this.setKey(e);
|
|
3847
|
-
}, e.prototype.setPublicKey = function(e) {
|
|
3848
|
-
this.setKey(e);
|
|
3849
|
-
}, e.prototype.decrypt = function(e) {
|
|
3850
|
-
try {
|
|
3851
|
-
return this.getKey().decrypt(b64tohex(e));
|
|
3852
|
-
} catch {
|
|
3853
|
-
return !1;
|
|
3854
|
-
}
|
|
3855
|
-
}, e.prototype.encrypt = function(e) {
|
|
3856
|
-
try {
|
|
3857
|
-
return hex2b64(this.getKey().encrypt(e));
|
|
3858
|
-
} catch {
|
|
3859
|
-
return !1;
|
|
3860
|
-
}
|
|
3861
|
-
}, e.prototype.sign = function(e, b, x) {
|
|
3862
|
-
try {
|
|
3863
|
-
return hex2b64(this.getKey().sign(e, b, x));
|
|
3864
|
-
} catch {
|
|
3865
|
-
return !1;
|
|
3866
|
-
}
|
|
3867
|
-
}, e.prototype.verify = function(e, b, x) {
|
|
3868
|
-
try {
|
|
3869
|
-
return this.getKey().verify(e, b64tohex(b), x);
|
|
3870
|
-
} catch {
|
|
3871
|
-
return !1;
|
|
3872
|
-
}
|
|
3873
|
-
}, e.prototype.getKey = function(e) {
|
|
3874
|
-
if (!this.key) {
|
|
3875
|
-
if (this.key = new JSEncryptRSAKey(), e && {}.toString.call(e) === "[object Function]") {
|
|
3876
|
-
this.key.generateAsync(this.default_key_size, this.default_public_exponent, e);
|
|
3877
|
-
return;
|
|
3878
|
-
}
|
|
3879
|
-
this.key.generate(this.default_key_size, this.default_public_exponent);
|
|
3880
|
-
}
|
|
3881
|
-
return this.key;
|
|
3882
|
-
}, e.prototype.getPrivateKey = function() {
|
|
3883
|
-
return this.getKey().getPrivateKey();
|
|
3884
|
-
}, e.prototype.getPrivateKeyB64 = function() {
|
|
3885
|
-
return this.getKey().getPrivateBaseKeyB64();
|
|
3886
|
-
}, e.prototype.getPublicKey = function() {
|
|
3887
|
-
return this.getKey().getPublicKey();
|
|
3888
|
-
}, e.prototype.getPublicKeyB64 = function() {
|
|
3889
|
-
return this.getKey().getPublicBaseKeyB64();
|
|
3890
|
-
}, e.version = version, e;
|
|
3891
|
-
}();
|
|
3892
|
-
function compilePublicKey(e) {
|
|
3893
|
-
return template_default("-----BEGIN PUBLIC KEY-----\n<%= publickKey %>\n-----END PUBLIC KEY-----")({ publickKey: e });
|
|
3894
|
-
}
|
|
3895
|
-
async function getPublicKey() {
|
|
3896
|
-
return compilePublicKey((await getAuthLoginKey()).data ?? "");
|
|
3897
|
-
}
|
|
3898
|
-
async function publicKeyEncryption(e) {
|
|
3899
|
-
let b = await getPublicKey(), x = new lib_default();
|
|
3900
|
-
return x.setPublicKey(b), x.encrypt(e);
|
|
3901
|
-
}
|
|
3902
|
-
function getStoragePrefix() {
|
|
3903
|
-
return getSettings()?.app?.storagePrefix;
|
|
3904
|
-
}
|
|
3905
|
-
const storage = {
|
|
3906
|
-
local: {
|
|
3907
|
-
has: (e) => Object.prototype.hasOwnProperty.call(localStorage, `${getStoragePrefix()}${e}`),
|
|
3908
|
-
get: (e) => localStorage.getItem(`${getStoragePrefix()}${e}`),
|
|
3909
|
-
set: (e, b) => {
|
|
3910
|
-
localStorage.setItem(`${getStoragePrefix()}${e}`, b);
|
|
3911
|
-
},
|
|
3912
|
-
remove: (e) => {
|
|
3913
|
-
localStorage.removeItem(`${getStoragePrefix()}${e}`);
|
|
3914
|
-
},
|
|
3915
|
-
clear: () => {
|
|
3916
|
-
localStorage.clear();
|
|
3917
|
-
},
|
|
3918
|
-
getItem: (e) => localStorage.getItem(`${getStoragePrefix()}${e}`),
|
|
3919
|
-
setItem: (e, b) => {
|
|
3920
|
-
localStorage.setItem(`${getStoragePrefix()}${e}`, b);
|
|
3921
|
-
}
|
|
3922
|
-
},
|
|
3923
|
-
session: {
|
|
3924
|
-
has: (e) => Object.prototype.hasOwnProperty.call(sessionStorage, `${getStoragePrefix()}${e}`),
|
|
3925
|
-
get: (e) => sessionStorage.getItem(`${getStoragePrefix()}${e}`),
|
|
3926
|
-
set: (e, b) => {
|
|
3927
|
-
sessionStorage.setItem(`${getStoragePrefix()}${e}`, b);
|
|
3928
|
-
},
|
|
3929
|
-
remove: (e) => {
|
|
3930
|
-
sessionStorage.removeItem(`${getStoragePrefix()}${e}`);
|
|
3931
|
-
},
|
|
3932
|
-
clear: () => {
|
|
3933
|
-
sessionStorage.clear();
|
|
3934
|
-
},
|
|
3935
|
-
getItem: (e) => sessionStorage.getItem(`${getStoragePrefix()}${e}`),
|
|
3936
|
-
setItem: (e, b) => {
|
|
3937
|
-
sessionStorage.setItem(`${getStoragePrefix()}${e}`, b);
|
|
3938
|
-
}
|
|
3939
|
-
}
|
|
3940
|
-
}, basic = wrapProxy(usePubinfoContext, "requestBasic"), auth = wrapProxy(usePubinfoContext, "requestAuth");
|
|
3941
|
-
function postAuthChangeLoginOrg(e, b) {
|
|
3942
|
-
return auth.Post("/auth/changeLoginOrg", {}, {
|
|
3943
|
-
params: { ...e },
|
|
3944
|
-
...b || {}
|
|
3945
|
-
});
|
|
3946
|
-
}
|
|
3947
|
-
function postAuthLogin(e, b) {
|
|
3948
|
-
return auth.Post("/auth/login", e, {
|
|
3949
|
-
headers: { "Content-Type": "application/json" },
|
|
3950
|
-
...b || {}
|
|
3951
|
-
});
|
|
3952
|
-
}
|
|
3953
|
-
function getAuthLoginKey(e) {
|
|
3954
|
-
return auth.Get("/auth/login/key", { ...e || {} });
|
|
3955
|
-
}
|
|
3956
|
-
function postAuthLoginNew(e, b) {
|
|
3957
|
-
return auth.Post("/auth/loginNew", e, {
|
|
3958
|
-
headers: { "Content-Type": "application/json" },
|
|
3959
|
-
...b || {}
|
|
3960
|
-
});
|
|
3961
|
-
}
|
|
3962
|
-
function postAuthTokenRefresh(e, b) {
|
|
3963
|
-
return auth.Post("/auth/token/refresh", {}, {
|
|
3964
|
-
params: { ...e },
|
|
3965
|
-
...b || {}
|
|
3966
|
-
});
|
|
3967
|
-
}
|
|
3968
|
-
export { useWarn as A, _baseFindIndex_default as B, keepAlive_default as C, useInfo as D, useError as E, isUndefined_default as F, createPubinfoContext as G, toNumber_default as H, find_default as I, findIndex_default as L, iframe_default as M, omit_default as N, useStart as O, merge_default as P, isArrayLikeObject_default as R, require_dist as S, useBox as T, favorites_default as U, toFinite_default as V, STORE_NAME as W, getSystemRoutes as _, wrapProxy as a, RESOURCE_TYPE as b, cleanupWithoutUser as c, user_default as d, tabbar_default as f, defineSystemRoutes as g, getSettings as h, publicKeyEncryption as i, useAuth as j, useSuccess as k, menu_default as l, defineSettings as m, basic as n, resolveRoutePath as o, settings_default as p, storage as r, cleanup as s, postAuthTokenRefresh as t, route_default as u, defineAsyncRoutes as v, useTheme as w, getRbacUserUserEntireInfo as x, getAsyncRoutes as y, _baseRest_default as z };
|