@vtj/utils 0.6.15 → 0.6.16
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/cdn/index.js +2 -2
- package/lib/index.js +1477 -0
- package/package.json +9 -14
- package/types/Request.d.ts +5 -1
- package/types/version.d.ts +1 -1
- package/lib/index.cjs +0 -53
- package/lib/index.mjs +0 -6875
package/lib/index.js
ADDED
|
@@ -0,0 +1,1477 @@
|
|
|
1
|
+
import { upperFirst as yt, camelCase as gt, merge as K, debounce as _t, throttle as vt, template as ct } from "lodash-es";
|
|
2
|
+
import { camelCase as ze, cloneDeep as qe, debounce as Je, get as Ze, isEqual as Ge, isPlainObject as Xe, kebabCase as Ve, lowerFirst as Ke, merge as Qe, set as tn, template as en, throttle as nn, upperFirst as rn } from "lodash-es";
|
|
3
|
+
import st from "axios";
|
|
4
|
+
import wt from "numeral";
|
|
5
|
+
import { default as on } from "numeral";
|
|
6
|
+
import nt from "js-cookie";
|
|
7
|
+
import xt from "jsencrypt";
|
|
8
|
+
const fe = "0.6.16", X = typeof window < "u", de = (e) => typeof e < "u", le = () => Date.now(), he = () => +Date.now(), pe = (e, t) => (e = Math.ceil(e), t = Math.floor(t), Math.floor(Math.random() * (t - e + 1)) + e);
|
|
9
|
+
function $t() {
|
|
10
|
+
return Number(Math.random().toString().substring(2, 5) + Date.now()).toString(
|
|
11
|
+
36
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
function me(e = !0) {
|
|
15
|
+
const t = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
|
|
16
|
+
/[xy]/g,
|
|
17
|
+
function(r) {
|
|
18
|
+
const n = Math.random() * 16 | 0;
|
|
19
|
+
return (r === "x" ? n : n & 3 | 8).toString(16);
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
return e ? t.toLowerCase() : t.replace(/-/gi, "");
|
|
23
|
+
}
|
|
24
|
+
function ye(e) {
|
|
25
|
+
return typeof e == "function";
|
|
26
|
+
}
|
|
27
|
+
function ge(e) {
|
|
28
|
+
return e !== null && typeof e == "object";
|
|
29
|
+
}
|
|
30
|
+
function _e(e) {
|
|
31
|
+
return typeof e == "string";
|
|
32
|
+
}
|
|
33
|
+
function ve(e) {
|
|
34
|
+
return typeof e > "u" || e === null;
|
|
35
|
+
}
|
|
36
|
+
function we(e) {
|
|
37
|
+
return yt(gt(e));
|
|
38
|
+
}
|
|
39
|
+
function Q(e, t) {
|
|
40
|
+
const r = {};
|
|
41
|
+
if (Array.isArray(t))
|
|
42
|
+
Object.keys(e).forEach((n) => {
|
|
43
|
+
t.includes(n) || (r[n] = e[n]);
|
|
44
|
+
});
|
|
45
|
+
else {
|
|
46
|
+
const n = t;
|
|
47
|
+
Object.entries(e).forEach(([d, m]) => {
|
|
48
|
+
n(d, m) || (r[d] = m);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return r;
|
|
52
|
+
}
|
|
53
|
+
function xe(e, t) {
|
|
54
|
+
const r = {};
|
|
55
|
+
if (Array.isArray(t))
|
|
56
|
+
Object.keys(e).forEach((n) => {
|
|
57
|
+
t.includes(n) && (r[n] = e[n]);
|
|
58
|
+
});
|
|
59
|
+
else {
|
|
60
|
+
const n = t;
|
|
61
|
+
Object.entries(e).forEach(([d, m]) => {
|
|
62
|
+
n(d, m) && (r[d] = m);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return r;
|
|
66
|
+
}
|
|
67
|
+
function ot(e) {
|
|
68
|
+
const t = typeof e;
|
|
69
|
+
return t === "string" ? e.trim() : Array.isArray(e) ? e.map((r) => ot(r)) : (e && t === "object" && Object.entries(e).forEach(([r, n]) => {
|
|
70
|
+
e[r] = ot(n);
|
|
71
|
+
}), e);
|
|
72
|
+
}
|
|
73
|
+
function $e(e, t = 2, r) {
|
|
74
|
+
return (r ? Math.round : Math.floor)(Math.pow(10, t) * e) / Math.pow(10, t);
|
|
75
|
+
}
|
|
76
|
+
async function Se(e = 0) {
|
|
77
|
+
return new Promise((t) => {
|
|
78
|
+
setTimeout(t, e);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function St(e, t) {
|
|
82
|
+
return e.reduce((r, n) => {
|
|
83
|
+
const d = n[t];
|
|
84
|
+
return r.set(d, n), r;
|
|
85
|
+
}, /* @__PURE__ */ new Map());
|
|
86
|
+
}
|
|
87
|
+
function be(e) {
|
|
88
|
+
return [...e.entries()].reduce(
|
|
89
|
+
(t, [r, n]) => (t[r] = n, t),
|
|
90
|
+
{}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
function Me(e, t) {
|
|
94
|
+
if (t) {
|
|
95
|
+
const r = St(e, t);
|
|
96
|
+
return Array.from(r.values());
|
|
97
|
+
} else
|
|
98
|
+
return Array.from(new Set(e));
|
|
99
|
+
}
|
|
100
|
+
function De(e) {
|
|
101
|
+
return e ? [].concat(e) : [];
|
|
102
|
+
}
|
|
103
|
+
function Oe(e) {
|
|
104
|
+
return Object.keys(e).reduce(
|
|
105
|
+
(t, r) => {
|
|
106
|
+
const n = e[r];
|
|
107
|
+
return n != null && (t[r] = n), t;
|
|
108
|
+
},
|
|
109
|
+
{}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
const bt = {
|
|
113
|
+
form: "application/x-www-form-urlencoded",
|
|
114
|
+
json: "application/json",
|
|
115
|
+
data: "multipart/form-data"
|
|
116
|
+
}, Mt = ["put", "post", "patch"], it = "Local-Request-Id", Dt = 200, Ot = 500;
|
|
117
|
+
class Et {
|
|
118
|
+
axios;
|
|
119
|
+
settings;
|
|
120
|
+
records = {};
|
|
121
|
+
isLoading = !1;
|
|
122
|
+
stopSkipWarn;
|
|
123
|
+
showLoading;
|
|
124
|
+
showError;
|
|
125
|
+
constructor(t = {}) {
|
|
126
|
+
this.settings = t.settings || {};
|
|
127
|
+
const r = Q(t, [
|
|
128
|
+
"settings"
|
|
129
|
+
]);
|
|
130
|
+
this.axios = st.create(
|
|
131
|
+
K(
|
|
132
|
+
{
|
|
133
|
+
headers: {
|
|
134
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
135
|
+
},
|
|
136
|
+
timeout: 2 * 60 * 1e3
|
|
137
|
+
},
|
|
138
|
+
r
|
|
139
|
+
)
|
|
140
|
+
), this.setupSkipWarn(this.settings), this.showLoading = _t(this.openLoading.bind(this), Dt), this.showError = vt(this._showError.bind(this), Ot, {
|
|
141
|
+
leading: !0,
|
|
142
|
+
trailing: !1
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
setConfig(t = {}) {
|
|
146
|
+
this.settings = K(this.settings, t.settings || {});
|
|
147
|
+
const r = Q(t, [
|
|
148
|
+
"settings"
|
|
149
|
+
]);
|
|
150
|
+
this.axios.defaults = K(this.axios.defaults, r), this.setupSkipWarn(this.settings);
|
|
151
|
+
}
|
|
152
|
+
cancel(t, r = "请求已取消") {
|
|
153
|
+
if (t) {
|
|
154
|
+
const n = this.records[t];
|
|
155
|
+
if (!n)
|
|
156
|
+
return;
|
|
157
|
+
n.source.cancel(r);
|
|
158
|
+
} else
|
|
159
|
+
for (const n of Object.values(this.records))
|
|
160
|
+
n.source.cancel(r);
|
|
161
|
+
}
|
|
162
|
+
createHeaders(t, r, n) {
|
|
163
|
+
const d = typeof r.headers == "function" ? r.headers(n, r) : r.headers || {}, m = {
|
|
164
|
+
"Content-Type": bt[r.type || "form"],
|
|
165
|
+
...n.headers,
|
|
166
|
+
...d
|
|
167
|
+
};
|
|
168
|
+
return r.skipWarn && (m[it] = t), m;
|
|
169
|
+
}
|
|
170
|
+
isJsonType(t) {
|
|
171
|
+
return Object.entries(t).some(([r, n]) => r.toLowerCase() === "content-type" && String(n).includes("application/json"));
|
|
172
|
+
}
|
|
173
|
+
toFormData(t, r = "data") {
|
|
174
|
+
if (t instanceof FormData || t instanceof URLSearchParams)
|
|
175
|
+
return t;
|
|
176
|
+
const n = r === "data" ? new FormData() : new URLSearchParams();
|
|
177
|
+
return Object.entries(t).forEach(([d, m]) => {
|
|
178
|
+
n.append(d, m);
|
|
179
|
+
}), n;
|
|
180
|
+
}
|
|
181
|
+
createSendData(t, r, n, d) {
|
|
182
|
+
const { type: m, skipWarn: _ } = t, { name: L = "skipWarn" } = _ || {};
|
|
183
|
+
let { data: O, params: a, method: j = "get" } = r;
|
|
184
|
+
const w = d ? { [L]: !0 } : {};
|
|
185
|
+
return Mt.includes(j.toLowerCase()) ? (O = Object.assign(O || {}, w), O = m !== "json" || !this.isJsonType(n) ? this.toFormData(O, m) : O) : a = {
|
|
186
|
+
...O,
|
|
187
|
+
...a,
|
|
188
|
+
...w
|
|
189
|
+
}, {
|
|
190
|
+
data: O,
|
|
191
|
+
params: a
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
createUrl(t) {
|
|
195
|
+
const { url: r, query: n } = t;
|
|
196
|
+
return n ? ct(r)(n) : r;
|
|
197
|
+
}
|
|
198
|
+
openLoading(t) {
|
|
199
|
+
const { loading: r, showLoading: n } = t;
|
|
200
|
+
r && n && Object.keys(this.records).length > 0 && (this.isLoading = !0, n());
|
|
201
|
+
}
|
|
202
|
+
closeLoading(t) {
|
|
203
|
+
const { loading: r, hideLoading: n } = t;
|
|
204
|
+
if (!r)
|
|
205
|
+
return;
|
|
206
|
+
this.isLoading = !1;
|
|
207
|
+
const d = Object.keys(this.records);
|
|
208
|
+
n && d.length === 0 && (this.isLoading = !1, n());
|
|
209
|
+
}
|
|
210
|
+
_showError(t, r) {
|
|
211
|
+
const { failMessage: n, showError: d } = t;
|
|
212
|
+
if (n && d) {
|
|
213
|
+
const m = r?.message || r?.msg || "未知错误";
|
|
214
|
+
d(m, r);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
validResponse(t, r) {
|
|
218
|
+
const { validSuccess: n, validate: d } = t;
|
|
219
|
+
return n && d ? !!d(r) : !0;
|
|
220
|
+
}
|
|
221
|
+
isSkipWarnResponse(t) {
|
|
222
|
+
return !!t.promise;
|
|
223
|
+
}
|
|
224
|
+
send(t = {}, r = !1) {
|
|
225
|
+
const n = K({}, this.settings, t.settings || {}), d = Q(t, [
|
|
226
|
+
"settings"
|
|
227
|
+
]), m = $t(), _ = st.CancelToken.source();
|
|
228
|
+
this.records[m] = { settings: n, config: d, source: _ };
|
|
229
|
+
const L = this.createUrl(d), O = this.createHeaders(m, n, d), { data: a, params: j } = this.createSendData(
|
|
230
|
+
n,
|
|
231
|
+
d,
|
|
232
|
+
O,
|
|
233
|
+
r
|
|
234
|
+
);
|
|
235
|
+
return this.showLoading(n), new Promise((w, R) => {
|
|
236
|
+
this.axios({
|
|
237
|
+
cancelToken: _.token,
|
|
238
|
+
...d,
|
|
239
|
+
url: L,
|
|
240
|
+
headers: O,
|
|
241
|
+
data: a,
|
|
242
|
+
params: j
|
|
243
|
+
}).then((b) => this.isSkipWarnResponse(b) ? w(b.promise) : this.validResponse(n, b) ? w(n.originResponse ? b : b.data?.data) : (this.showError(n, b.data), R(b.data))).catch((b) => (this.showError(n, b), R(b))).finally(() => {
|
|
244
|
+
delete this.records[m], this.closeLoading(n);
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
useResponse(t, r) {
|
|
249
|
+
const { response: n } = this.axios.interceptors, d = n.use(t, r);
|
|
250
|
+
return () => n.eject(d);
|
|
251
|
+
}
|
|
252
|
+
useRequest(t, r) {
|
|
253
|
+
const { request: n } = this.axios.interceptors, d = n.use(t, r);
|
|
254
|
+
return () => n.eject(d);
|
|
255
|
+
}
|
|
256
|
+
setupSkipWarn(t) {
|
|
257
|
+
if (this.stopSkipWarn && this.stopSkipWarn(), !t.skipWarn)
|
|
258
|
+
return;
|
|
259
|
+
const { code: r, executor: n, callback: d, complete: m } = t.skipWarn;
|
|
260
|
+
this.stopSkipWarn = this.useResponse((_) => {
|
|
261
|
+
const O = (_.config.headers || {})[it], a = this.records[O];
|
|
262
|
+
if (!a)
|
|
263
|
+
return _;
|
|
264
|
+
const { data: j } = _;
|
|
265
|
+
if (!j || typeof j != "object")
|
|
266
|
+
return _;
|
|
267
|
+
if (j?.code === r) {
|
|
268
|
+
d && d(_);
|
|
269
|
+
const w = new Promise(n).then(() => this.send(
|
|
270
|
+
{
|
|
271
|
+
...a.config,
|
|
272
|
+
settings: a.settings
|
|
273
|
+
},
|
|
274
|
+
!0
|
|
275
|
+
));
|
|
276
|
+
w.catch((R) => R).finally(() => {
|
|
277
|
+
m && m();
|
|
278
|
+
}), _.promise = w;
|
|
279
|
+
}
|
|
280
|
+
return _;
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
function Ct(e = {}) {
|
|
285
|
+
const t = new Et(e), r = t.send.bind(t), n = t.cancel.bind(t), d = t.setConfig.bind(t), m = t.useRequest.bind(t), _ = t.useResponse.bind(t);
|
|
286
|
+
return Object.assign(r, {
|
|
287
|
+
...t,
|
|
288
|
+
instance: t,
|
|
289
|
+
send: r,
|
|
290
|
+
cancel: n,
|
|
291
|
+
setConfig: d,
|
|
292
|
+
useRequest: m,
|
|
293
|
+
useResponse: _
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
const Lt = Ct({
|
|
297
|
+
settings: {
|
|
298
|
+
loading: !0,
|
|
299
|
+
originResponse: !0
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
function Rt(e) {
|
|
303
|
+
const t = typeof e == "string" ? { url: e } : e;
|
|
304
|
+
return (r, n) => Lt.send({
|
|
305
|
+
...t,
|
|
306
|
+
...n,
|
|
307
|
+
data: r
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
function Ee(e) {
|
|
311
|
+
const t = {};
|
|
312
|
+
for (const [r, n] of Object.entries(e))
|
|
313
|
+
t[r] = Rt(n);
|
|
314
|
+
return t;
|
|
315
|
+
}
|
|
316
|
+
const Ce = (e) => X ? window.requestAnimationFrame(e) : setTimeout(e, 16), Le = (e) => X ? window.cancelAnimationFrame(e) : clearTimeout(e);
|
|
317
|
+
var q = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
318
|
+
function ut(e) {
|
|
319
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
320
|
+
}
|
|
321
|
+
function jt(e) {
|
|
322
|
+
if (e.__esModule)
|
|
323
|
+
return e;
|
|
324
|
+
var t = e.default;
|
|
325
|
+
if (typeof t == "function") {
|
|
326
|
+
var r = function n() {
|
|
327
|
+
return this instanceof n ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
|
|
328
|
+
};
|
|
329
|
+
r.prototype = t.prototype;
|
|
330
|
+
} else
|
|
331
|
+
r = {};
|
|
332
|
+
return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(n) {
|
|
333
|
+
var d = Object.getOwnPropertyDescriptor(e, n);
|
|
334
|
+
Object.defineProperty(r, n, d.get ? d : {
|
|
335
|
+
enumerable: !0,
|
|
336
|
+
get: function() {
|
|
337
|
+
return e[n];
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
}), r;
|
|
341
|
+
}
|
|
342
|
+
var ft = { exports: {} };
|
|
343
|
+
(function(e, t) {
|
|
344
|
+
(function(r, n) {
|
|
345
|
+
e.exports = n();
|
|
346
|
+
})(q, function() {
|
|
347
|
+
var r = 1e3, n = 6e4, d = 36e5, m = "millisecond", _ = "second", L = "minute", O = "hour", a = "day", j = "week", w = "month", R = "quarter", b = "year", A = "date", D = "Invalid Date", E = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, k = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, u = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(v) {
|
|
348
|
+
var p = ["th", "st", "nd", "rd"], f = v % 100;
|
|
349
|
+
return "[" + v + (p[(f - 20) % 10] || p[f] || p[0]) + "]";
|
|
350
|
+
} }, h = function(v, p, f) {
|
|
351
|
+
var g = String(v);
|
|
352
|
+
return !g || g.length >= p ? v : "" + Array(p + 1 - g.length).join(f) + v;
|
|
353
|
+
}, y = { s: h, z: function(v) {
|
|
354
|
+
var p = -v.utcOffset(), f = Math.abs(p), g = Math.floor(f / 60), l = f % 60;
|
|
355
|
+
return (p <= 0 ? "+" : "-") + h(g, 2, "0") + ":" + h(l, 2, "0");
|
|
356
|
+
}, m: function v(p, f) {
|
|
357
|
+
if (p.date() < f.date())
|
|
358
|
+
return -v(f, p);
|
|
359
|
+
var g = 12 * (f.year() - p.year()) + (f.month() - p.month()), l = p.clone().add(g, w), $ = f - l < 0, S = p.clone().add(g + ($ ? -1 : 1), w);
|
|
360
|
+
return +(-(g + (f - l) / ($ ? l - S : S - l)) || 0);
|
|
361
|
+
}, a: function(v) {
|
|
362
|
+
return v < 0 ? Math.ceil(v) || 0 : Math.floor(v);
|
|
363
|
+
}, p: function(v) {
|
|
364
|
+
return { M: w, y: b, w: j, d: a, D: A, h: O, m: L, s: _, ms: m, Q: R }[v] || String(v || "").toLowerCase().replace(/s$/, "");
|
|
365
|
+
}, u: function(v) {
|
|
366
|
+
return v === void 0;
|
|
367
|
+
} }, x = "en", M = {};
|
|
368
|
+
M[x] = u;
|
|
369
|
+
var Y = "$isDayjsObject", H = function(v) {
|
|
370
|
+
return v instanceof F || !(!v || !v[Y]);
|
|
371
|
+
}, B = function v(p, f, g) {
|
|
372
|
+
var l;
|
|
373
|
+
if (!p)
|
|
374
|
+
return x;
|
|
375
|
+
if (typeof p == "string") {
|
|
376
|
+
var $ = p.toLowerCase();
|
|
377
|
+
M[$] && (l = $), f && (M[$] = f, l = $);
|
|
378
|
+
var S = p.split("-");
|
|
379
|
+
if (!l && S.length > 1)
|
|
380
|
+
return v(S[0]);
|
|
381
|
+
} else {
|
|
382
|
+
var s = p.name;
|
|
383
|
+
M[s] = p, l = s;
|
|
384
|
+
}
|
|
385
|
+
return !g && l && (x = l), l || !g && x;
|
|
386
|
+
}, T = function(v, p) {
|
|
387
|
+
if (H(v))
|
|
388
|
+
return v.clone();
|
|
389
|
+
var f = typeof p == "object" ? p : {};
|
|
390
|
+
return f.date = v, f.args = arguments, new F(f);
|
|
391
|
+
}, C = y;
|
|
392
|
+
C.l = B, C.i = H, C.w = function(v, p) {
|
|
393
|
+
return T(v, { locale: p.$L, utc: p.$u, x: p.$x, $offset: p.$offset });
|
|
394
|
+
};
|
|
395
|
+
var F = function() {
|
|
396
|
+
function v(f) {
|
|
397
|
+
this.$L = B(f.locale, null, !0), this.parse(f), this.$x = this.$x || f.x || {}, this[Y] = !0;
|
|
398
|
+
}
|
|
399
|
+
var p = v.prototype;
|
|
400
|
+
return p.parse = function(f) {
|
|
401
|
+
this.$d = function(g) {
|
|
402
|
+
var l = g.date, $ = g.utc;
|
|
403
|
+
if (l === null)
|
|
404
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
405
|
+
if (C.u(l))
|
|
406
|
+
return /* @__PURE__ */ new Date();
|
|
407
|
+
if (l instanceof Date)
|
|
408
|
+
return new Date(l);
|
|
409
|
+
if (typeof l == "string" && !/Z$/i.test(l)) {
|
|
410
|
+
var S = l.match(E);
|
|
411
|
+
if (S) {
|
|
412
|
+
var s = S[2] - 1 || 0, o = (S[7] || "0").substring(0, 3);
|
|
413
|
+
return $ ? new Date(Date.UTC(S[1], s, S[3] || 1, S[4] || 0, S[5] || 0, S[6] || 0, o)) : new Date(S[1], s, S[3] || 1, S[4] || 0, S[5] || 0, S[6] || 0, o);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return new Date(l);
|
|
417
|
+
}(f), this.init();
|
|
418
|
+
}, p.init = function() {
|
|
419
|
+
var f = this.$d;
|
|
420
|
+
this.$y = f.getFullYear(), this.$M = f.getMonth(), this.$D = f.getDate(), this.$W = f.getDay(), this.$H = f.getHours(), this.$m = f.getMinutes(), this.$s = f.getSeconds(), this.$ms = f.getMilliseconds();
|
|
421
|
+
}, p.$utils = function() {
|
|
422
|
+
return C;
|
|
423
|
+
}, p.isValid = function() {
|
|
424
|
+
return this.$d.toString() !== D;
|
|
425
|
+
}, p.isSame = function(f, g) {
|
|
426
|
+
var l = T(f);
|
|
427
|
+
return this.startOf(g) <= l && l <= this.endOf(g);
|
|
428
|
+
}, p.isAfter = function(f, g) {
|
|
429
|
+
return T(f) < this.startOf(g);
|
|
430
|
+
}, p.isBefore = function(f, g) {
|
|
431
|
+
return this.endOf(g) < T(f);
|
|
432
|
+
}, p.$g = function(f, g, l) {
|
|
433
|
+
return C.u(f) ? this[g] : this.set(l, f);
|
|
434
|
+
}, p.unix = function() {
|
|
435
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
436
|
+
}, p.valueOf = function() {
|
|
437
|
+
return this.$d.getTime();
|
|
438
|
+
}, p.startOf = function(f, g) {
|
|
439
|
+
var l = this, $ = !!C.u(g) || g, S = C.p(f), s = function(z, W) {
|
|
440
|
+
var I = C.w(l.$u ? Date.UTC(l.$y, W, z) : new Date(l.$y, W, z), l);
|
|
441
|
+
return $ ? I : I.endOf(a);
|
|
442
|
+
}, o = function(z, W) {
|
|
443
|
+
return C.w(l.toDate()[z].apply(l.toDate("s"), ($ ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(W)), l);
|
|
444
|
+
}, i = this.$W, c = this.$M, P = this.$D, J = "set" + (this.$u ? "UTC" : "");
|
|
445
|
+
switch (S) {
|
|
446
|
+
case b:
|
|
447
|
+
return $ ? s(1, 0) : s(31, 11);
|
|
448
|
+
case w:
|
|
449
|
+
return $ ? s(1, c) : s(0, c + 1);
|
|
450
|
+
case j:
|
|
451
|
+
var N = this.$locale().weekStart || 0, Z = (i < N ? i + 7 : i) - N;
|
|
452
|
+
return s($ ? P - Z : P + (6 - Z), c);
|
|
453
|
+
case a:
|
|
454
|
+
case A:
|
|
455
|
+
return o(J + "Hours", 0);
|
|
456
|
+
case O:
|
|
457
|
+
return o(J + "Minutes", 1);
|
|
458
|
+
case L:
|
|
459
|
+
return o(J + "Seconds", 2);
|
|
460
|
+
case _:
|
|
461
|
+
return o(J + "Milliseconds", 3);
|
|
462
|
+
default:
|
|
463
|
+
return this.clone();
|
|
464
|
+
}
|
|
465
|
+
}, p.endOf = function(f) {
|
|
466
|
+
return this.startOf(f, !1);
|
|
467
|
+
}, p.$set = function(f, g) {
|
|
468
|
+
var l, $ = C.p(f), S = "set" + (this.$u ? "UTC" : ""), s = (l = {}, l[a] = S + "Date", l[A] = S + "Date", l[w] = S + "Month", l[b] = S + "FullYear", l[O] = S + "Hours", l[L] = S + "Minutes", l[_] = S + "Seconds", l[m] = S + "Milliseconds", l)[$], o = $ === a ? this.$D + (g - this.$W) : g;
|
|
469
|
+
if ($ === w || $ === b) {
|
|
470
|
+
var i = this.clone().set(A, 1);
|
|
471
|
+
i.$d[s](o), i.init(), this.$d = i.set(A, Math.min(this.$D, i.daysInMonth())).$d;
|
|
472
|
+
} else
|
|
473
|
+
s && this.$d[s](o);
|
|
474
|
+
return this.init(), this;
|
|
475
|
+
}, p.set = function(f, g) {
|
|
476
|
+
return this.clone().$set(f, g);
|
|
477
|
+
}, p.get = function(f) {
|
|
478
|
+
return this[C.p(f)]();
|
|
479
|
+
}, p.add = function(f, g) {
|
|
480
|
+
var l, $ = this;
|
|
481
|
+
f = Number(f);
|
|
482
|
+
var S = C.p(g), s = function(c) {
|
|
483
|
+
var P = T($);
|
|
484
|
+
return C.w(P.date(P.date() + Math.round(c * f)), $);
|
|
485
|
+
};
|
|
486
|
+
if (S === w)
|
|
487
|
+
return this.set(w, this.$M + f);
|
|
488
|
+
if (S === b)
|
|
489
|
+
return this.set(b, this.$y + f);
|
|
490
|
+
if (S === a)
|
|
491
|
+
return s(1);
|
|
492
|
+
if (S === j)
|
|
493
|
+
return s(7);
|
|
494
|
+
var o = (l = {}, l[L] = n, l[O] = d, l[_] = r, l)[S] || 1, i = this.$d.getTime() + f * o;
|
|
495
|
+
return C.w(i, this);
|
|
496
|
+
}, p.subtract = function(f, g) {
|
|
497
|
+
return this.add(-1 * f, g);
|
|
498
|
+
}, p.format = function(f) {
|
|
499
|
+
var g = this, l = this.$locale();
|
|
500
|
+
if (!this.isValid())
|
|
501
|
+
return l.invalidDate || D;
|
|
502
|
+
var $ = f || "YYYY-MM-DDTHH:mm:ssZ", S = C.z(this), s = this.$H, o = this.$m, i = this.$M, c = l.weekdays, P = l.months, J = l.meridiem, N = function(W, I, G, V) {
|
|
503
|
+
return W && (W[I] || W(g, $)) || G[I].slice(0, V);
|
|
504
|
+
}, Z = function(W) {
|
|
505
|
+
return C.s(s % 12 || 12, W, "0");
|
|
506
|
+
}, z = J || function(W, I, G) {
|
|
507
|
+
var V = W < 12 ? "AM" : "PM";
|
|
508
|
+
return G ? V.toLowerCase() : V;
|
|
509
|
+
};
|
|
510
|
+
return $.replace(k, function(W, I) {
|
|
511
|
+
return I || function(G) {
|
|
512
|
+
switch (G) {
|
|
513
|
+
case "YY":
|
|
514
|
+
return String(g.$y).slice(-2);
|
|
515
|
+
case "YYYY":
|
|
516
|
+
return C.s(g.$y, 4, "0");
|
|
517
|
+
case "M":
|
|
518
|
+
return i + 1;
|
|
519
|
+
case "MM":
|
|
520
|
+
return C.s(i + 1, 2, "0");
|
|
521
|
+
case "MMM":
|
|
522
|
+
return N(l.monthsShort, i, P, 3);
|
|
523
|
+
case "MMMM":
|
|
524
|
+
return N(P, i);
|
|
525
|
+
case "D":
|
|
526
|
+
return g.$D;
|
|
527
|
+
case "DD":
|
|
528
|
+
return C.s(g.$D, 2, "0");
|
|
529
|
+
case "d":
|
|
530
|
+
return String(g.$W);
|
|
531
|
+
case "dd":
|
|
532
|
+
return N(l.weekdaysMin, g.$W, c, 2);
|
|
533
|
+
case "ddd":
|
|
534
|
+
return N(l.weekdaysShort, g.$W, c, 3);
|
|
535
|
+
case "dddd":
|
|
536
|
+
return c[g.$W];
|
|
537
|
+
case "H":
|
|
538
|
+
return String(s);
|
|
539
|
+
case "HH":
|
|
540
|
+
return C.s(s, 2, "0");
|
|
541
|
+
case "h":
|
|
542
|
+
return Z(1);
|
|
543
|
+
case "hh":
|
|
544
|
+
return Z(2);
|
|
545
|
+
case "a":
|
|
546
|
+
return z(s, o, !0);
|
|
547
|
+
case "A":
|
|
548
|
+
return z(s, o, !1);
|
|
549
|
+
case "m":
|
|
550
|
+
return String(o);
|
|
551
|
+
case "mm":
|
|
552
|
+
return C.s(o, 2, "0");
|
|
553
|
+
case "s":
|
|
554
|
+
return String(g.$s);
|
|
555
|
+
case "ss":
|
|
556
|
+
return C.s(g.$s, 2, "0");
|
|
557
|
+
case "SSS":
|
|
558
|
+
return C.s(g.$ms, 3, "0");
|
|
559
|
+
case "Z":
|
|
560
|
+
return S;
|
|
561
|
+
}
|
|
562
|
+
return null;
|
|
563
|
+
}(W) || S.replace(":", "");
|
|
564
|
+
});
|
|
565
|
+
}, p.utcOffset = function() {
|
|
566
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
567
|
+
}, p.diff = function(f, g, l) {
|
|
568
|
+
var $, S = this, s = C.p(g), o = T(f), i = (o.utcOffset() - this.utcOffset()) * n, c = this - o, P = function() {
|
|
569
|
+
return C.m(S, o);
|
|
570
|
+
};
|
|
571
|
+
switch (s) {
|
|
572
|
+
case b:
|
|
573
|
+
$ = P() / 12;
|
|
574
|
+
break;
|
|
575
|
+
case w:
|
|
576
|
+
$ = P();
|
|
577
|
+
break;
|
|
578
|
+
case R:
|
|
579
|
+
$ = P() / 3;
|
|
580
|
+
break;
|
|
581
|
+
case j:
|
|
582
|
+
$ = (c - i) / 6048e5;
|
|
583
|
+
break;
|
|
584
|
+
case a:
|
|
585
|
+
$ = (c - i) / 864e5;
|
|
586
|
+
break;
|
|
587
|
+
case O:
|
|
588
|
+
$ = c / d;
|
|
589
|
+
break;
|
|
590
|
+
case L:
|
|
591
|
+
$ = c / n;
|
|
592
|
+
break;
|
|
593
|
+
case _:
|
|
594
|
+
$ = c / r;
|
|
595
|
+
break;
|
|
596
|
+
default:
|
|
597
|
+
$ = c;
|
|
598
|
+
}
|
|
599
|
+
return l ? $ : C.a($);
|
|
600
|
+
}, p.daysInMonth = function() {
|
|
601
|
+
return this.endOf(w).$D;
|
|
602
|
+
}, p.$locale = function() {
|
|
603
|
+
return M[this.$L];
|
|
604
|
+
}, p.locale = function(f, g) {
|
|
605
|
+
if (!f)
|
|
606
|
+
return this.$L;
|
|
607
|
+
var l = this.clone(), $ = B(f, g, !0);
|
|
608
|
+
return $ && (l.$L = $), l;
|
|
609
|
+
}, p.clone = function() {
|
|
610
|
+
return C.w(this.$d, this);
|
|
611
|
+
}, p.toDate = function() {
|
|
612
|
+
return new Date(this.valueOf());
|
|
613
|
+
}, p.toJSON = function() {
|
|
614
|
+
return this.isValid() ? this.toISOString() : null;
|
|
615
|
+
}, p.toISOString = function() {
|
|
616
|
+
return this.$d.toISOString();
|
|
617
|
+
}, p.toString = function() {
|
|
618
|
+
return this.$d.toUTCString();
|
|
619
|
+
}, v;
|
|
620
|
+
}(), U = F.prototype;
|
|
621
|
+
return T.prototype = U, [["$ms", m], ["$s", _], ["$m", L], ["$H", O], ["$W", a], ["$M", w], ["$y", b], ["$D", A]].forEach(function(v) {
|
|
622
|
+
U[v[1]] = function(p) {
|
|
623
|
+
return this.$g(p, v[0], v[1]);
|
|
624
|
+
};
|
|
625
|
+
}), T.extend = function(v, p) {
|
|
626
|
+
return v.$i || (v(p, F, T), v.$i = !0), T;
|
|
627
|
+
}, T.locale = B, T.isDayjs = H, T.unix = function(v) {
|
|
628
|
+
return T(1e3 * v);
|
|
629
|
+
}, T.en = M[x], T.Ls = M, T.p = {}, T;
|
|
630
|
+
});
|
|
631
|
+
})(ft);
|
|
632
|
+
var dt = ft.exports;
|
|
633
|
+
const lt = /* @__PURE__ */ ut(dt);
|
|
634
|
+
var Yt = { exports: {} };
|
|
635
|
+
(function(e, t) {
|
|
636
|
+
(function(r, n) {
|
|
637
|
+
e.exports = n(dt);
|
|
638
|
+
})(q, function(r) {
|
|
639
|
+
function n(_) {
|
|
640
|
+
return _ && typeof _ == "object" && "default" in _ ? _ : { default: _ };
|
|
641
|
+
}
|
|
642
|
+
var d = n(r), m = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(_, L) {
|
|
643
|
+
return L === "W" ? _ + "周" : _ + "日";
|
|
644
|
+
}, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(_, L) {
|
|
645
|
+
var O = 100 * _ + L;
|
|
646
|
+
return O < 600 ? "凌晨" : O < 900 ? "早上" : O < 1100 ? "上午" : O < 1300 ? "中午" : O < 1800 ? "下午" : "晚上";
|
|
647
|
+
} };
|
|
648
|
+
return d.default.locale(m, null, !0), m;
|
|
649
|
+
});
|
|
650
|
+
})(Yt);
|
|
651
|
+
lt.locale("zh-cn");
|
|
652
|
+
function Re(e, t = "YYYY-MM-DD HH:mm:ss") {
|
|
653
|
+
return lt(e).format(t);
|
|
654
|
+
}
|
|
655
|
+
function je(e, t) {
|
|
656
|
+
return wt(e).format(t);
|
|
657
|
+
}
|
|
658
|
+
class Tt {
|
|
659
|
+
options = {
|
|
660
|
+
type: "cache",
|
|
661
|
+
expired: 0,
|
|
662
|
+
prefix: "__VTJ_"
|
|
663
|
+
};
|
|
664
|
+
caches = {};
|
|
665
|
+
types;
|
|
666
|
+
constructor(t = {}) {
|
|
667
|
+
this.types = {
|
|
668
|
+
local: X ? window.localStorage : this.caches,
|
|
669
|
+
session: X ? window.sessionStorage : this.caches,
|
|
670
|
+
cache: this.caches
|
|
671
|
+
}, this.config(t);
|
|
672
|
+
}
|
|
673
|
+
config(t = {}) {
|
|
674
|
+
this.options = Object.assign(this.options, t);
|
|
675
|
+
}
|
|
676
|
+
save(t, r, n = {}) {
|
|
677
|
+
const { type: d, expired: m, prefix: _ } = { ...this.options, ...n }, L = Date.now(), O = _ + t, a = this.types[d] || this.caches, j = {
|
|
678
|
+
value: r,
|
|
679
|
+
timestamp: L,
|
|
680
|
+
expired: m
|
|
681
|
+
};
|
|
682
|
+
a === this.caches ? a[O] = j : a.setItem(O, JSON.stringify(j));
|
|
683
|
+
}
|
|
684
|
+
get(t, r = {}) {
|
|
685
|
+
const { type: n, prefix: d } = { ...this.options, ...r }, m = d + t, _ = this.types[n] || this.caches;
|
|
686
|
+
let L;
|
|
687
|
+
if (_ === this.caches)
|
|
688
|
+
L = _[m];
|
|
689
|
+
else {
|
|
690
|
+
const R = _.getItem(m);
|
|
691
|
+
R && (L = JSON.parse(R));
|
|
692
|
+
}
|
|
693
|
+
if (!L)
|
|
694
|
+
return null;
|
|
695
|
+
const { value: O, timestamp: a, expired: j } = L;
|
|
696
|
+
return j > 0 && a + j < Date.now() ? (this.remove(t, r), null) : O;
|
|
697
|
+
}
|
|
698
|
+
remove(t, r = {}) {
|
|
699
|
+
const { type: n, prefix: d } = { ...this.options, ...r }, m = this.types[n] || this.caches, _ = d + t;
|
|
700
|
+
m === this.caches ? delete m[_] : m.removeItem(_);
|
|
701
|
+
}
|
|
702
|
+
clear(t = {}) {
|
|
703
|
+
const { type: r } = { ...this.options, ...t }, n = this.types[r] || this.caches;
|
|
704
|
+
n === this.caches ? this.caches = {} : n.clear();
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
const Ye = new Tt(), At = /^(http|https):\/\/[\w.:\-@]*/, Bt = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/, kt = /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/, Ht = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, Wt = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/, Ft = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
|
|
708
|
+
function Te(e) {
|
|
709
|
+
return At.test(e);
|
|
710
|
+
}
|
|
711
|
+
function Ae(e) {
|
|
712
|
+
return Bt.test(e);
|
|
713
|
+
}
|
|
714
|
+
function Be(e) {
|
|
715
|
+
return kt.test(e);
|
|
716
|
+
}
|
|
717
|
+
function ke(e) {
|
|
718
|
+
return Ht.test(e);
|
|
719
|
+
}
|
|
720
|
+
function He(e) {
|
|
721
|
+
return Ft.test(e) || Wt.test(e);
|
|
722
|
+
}
|
|
723
|
+
function Pt(e, t, r) {
|
|
724
|
+
nt.set(e, t, r);
|
|
725
|
+
}
|
|
726
|
+
function It(e) {
|
|
727
|
+
return nt.get(e);
|
|
728
|
+
}
|
|
729
|
+
function Ut(e, t) {
|
|
730
|
+
nt.remove(e, t);
|
|
731
|
+
}
|
|
732
|
+
const We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
733
|
+
__proto__: null,
|
|
734
|
+
get: It,
|
|
735
|
+
remove: Ut,
|
|
736
|
+
set: Pt
|
|
737
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
738
|
+
var ht = { exports: {} };
|
|
739
|
+
function Nt(e) {
|
|
740
|
+
throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
741
|
+
}
|
|
742
|
+
var tt = { exports: {} };
|
|
743
|
+
const zt = {}, qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
744
|
+
__proto__: null,
|
|
745
|
+
default: zt
|
|
746
|
+
}, Symbol.toStringTag, { value: "Module" })), Jt = /* @__PURE__ */ jt(qt);
|
|
747
|
+
var at;
|
|
748
|
+
function Zt() {
|
|
749
|
+
return at || (at = 1, function(e, t) {
|
|
750
|
+
(function(r, n) {
|
|
751
|
+
e.exports = n();
|
|
752
|
+
})(q, function() {
|
|
753
|
+
var r = r || function(n, d) {
|
|
754
|
+
var m;
|
|
755
|
+
if (typeof window < "u" && window.crypto && (m = window.crypto), typeof self < "u" && self.crypto && (m = self.crypto), typeof globalThis < "u" && globalThis.crypto && (m = globalThis.crypto), !m && typeof window < "u" && window.msCrypto && (m = window.msCrypto), !m && typeof q < "u" && q.crypto && (m = q.crypto), !m && typeof Nt == "function")
|
|
756
|
+
try {
|
|
757
|
+
m = Jt;
|
|
758
|
+
} catch {
|
|
759
|
+
}
|
|
760
|
+
var _ = function() {
|
|
761
|
+
if (m) {
|
|
762
|
+
if (typeof m.getRandomValues == "function")
|
|
763
|
+
try {
|
|
764
|
+
return m.getRandomValues(new Uint32Array(1))[0];
|
|
765
|
+
} catch {
|
|
766
|
+
}
|
|
767
|
+
if (typeof m.randomBytes == "function")
|
|
768
|
+
try {
|
|
769
|
+
return m.randomBytes(4).readInt32LE();
|
|
770
|
+
} catch {
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
774
|
+
}, L = Object.create || function() {
|
|
775
|
+
function u() {
|
|
776
|
+
}
|
|
777
|
+
return function(h) {
|
|
778
|
+
var y;
|
|
779
|
+
return u.prototype = h, y = new u(), u.prototype = null, y;
|
|
780
|
+
};
|
|
781
|
+
}(), O = {}, a = O.lib = {}, j = a.Base = function() {
|
|
782
|
+
return {
|
|
783
|
+
/**
|
|
784
|
+
* Creates a new object that inherits from this object.
|
|
785
|
+
*
|
|
786
|
+
* @param {Object} overrides Properties to copy into the new object.
|
|
787
|
+
*
|
|
788
|
+
* @return {Object} The new object.
|
|
789
|
+
*
|
|
790
|
+
* @static
|
|
791
|
+
*
|
|
792
|
+
* @example
|
|
793
|
+
*
|
|
794
|
+
* var MyType = CryptoJS.lib.Base.extend({
|
|
795
|
+
* field: 'value',
|
|
796
|
+
*
|
|
797
|
+
* method: function () {
|
|
798
|
+
* }
|
|
799
|
+
* });
|
|
800
|
+
*/
|
|
801
|
+
extend: function(u) {
|
|
802
|
+
var h = L(this);
|
|
803
|
+
return u && h.mixIn(u), (!h.hasOwnProperty("init") || this.init === h.init) && (h.init = function() {
|
|
804
|
+
h.$super.init.apply(this, arguments);
|
|
805
|
+
}), h.init.prototype = h, h.$super = this, h;
|
|
806
|
+
},
|
|
807
|
+
/**
|
|
808
|
+
* Extends this object and runs the init method.
|
|
809
|
+
* Arguments to create() will be passed to init().
|
|
810
|
+
*
|
|
811
|
+
* @return {Object} The new object.
|
|
812
|
+
*
|
|
813
|
+
* @static
|
|
814
|
+
*
|
|
815
|
+
* @example
|
|
816
|
+
*
|
|
817
|
+
* var instance = MyType.create();
|
|
818
|
+
*/
|
|
819
|
+
create: function() {
|
|
820
|
+
var u = this.extend();
|
|
821
|
+
return u.init.apply(u, arguments), u;
|
|
822
|
+
},
|
|
823
|
+
/**
|
|
824
|
+
* Initializes a newly created object.
|
|
825
|
+
* Override this method to add some logic when your objects are created.
|
|
826
|
+
*
|
|
827
|
+
* @example
|
|
828
|
+
*
|
|
829
|
+
* var MyType = CryptoJS.lib.Base.extend({
|
|
830
|
+
* init: function () {
|
|
831
|
+
* // ...
|
|
832
|
+
* }
|
|
833
|
+
* });
|
|
834
|
+
*/
|
|
835
|
+
init: function() {
|
|
836
|
+
},
|
|
837
|
+
/**
|
|
838
|
+
* Copies properties into this object.
|
|
839
|
+
*
|
|
840
|
+
* @param {Object} properties The properties to mix in.
|
|
841
|
+
*
|
|
842
|
+
* @example
|
|
843
|
+
*
|
|
844
|
+
* MyType.mixIn({
|
|
845
|
+
* field: 'value'
|
|
846
|
+
* });
|
|
847
|
+
*/
|
|
848
|
+
mixIn: function(u) {
|
|
849
|
+
for (var h in u)
|
|
850
|
+
u.hasOwnProperty(h) && (this[h] = u[h]);
|
|
851
|
+
u.hasOwnProperty("toString") && (this.toString = u.toString);
|
|
852
|
+
},
|
|
853
|
+
/**
|
|
854
|
+
* Creates a copy of this object.
|
|
855
|
+
*
|
|
856
|
+
* @return {Object} The clone.
|
|
857
|
+
*
|
|
858
|
+
* @example
|
|
859
|
+
*
|
|
860
|
+
* var clone = instance.clone();
|
|
861
|
+
*/
|
|
862
|
+
clone: function() {
|
|
863
|
+
return this.init.prototype.extend(this);
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
}(), w = a.WordArray = j.extend({
|
|
867
|
+
/**
|
|
868
|
+
* Initializes a newly created word array.
|
|
869
|
+
*
|
|
870
|
+
* @param {Array} words (Optional) An array of 32-bit words.
|
|
871
|
+
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
|
|
872
|
+
*
|
|
873
|
+
* @example
|
|
874
|
+
*
|
|
875
|
+
* var wordArray = CryptoJS.lib.WordArray.create();
|
|
876
|
+
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
|
|
877
|
+
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
|
|
878
|
+
*/
|
|
879
|
+
init: function(u, h) {
|
|
880
|
+
u = this.words = u || [], h != d ? this.sigBytes = h : this.sigBytes = u.length * 4;
|
|
881
|
+
},
|
|
882
|
+
/**
|
|
883
|
+
* Converts this word array to a string.
|
|
884
|
+
*
|
|
885
|
+
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
|
|
886
|
+
*
|
|
887
|
+
* @return {string} The stringified word array.
|
|
888
|
+
*
|
|
889
|
+
* @example
|
|
890
|
+
*
|
|
891
|
+
* var string = wordArray + '';
|
|
892
|
+
* var string = wordArray.toString();
|
|
893
|
+
* var string = wordArray.toString(CryptoJS.enc.Utf8);
|
|
894
|
+
*/
|
|
895
|
+
toString: function(u) {
|
|
896
|
+
return (u || b).stringify(this);
|
|
897
|
+
},
|
|
898
|
+
/**
|
|
899
|
+
* Concatenates a word array to this word array.
|
|
900
|
+
*
|
|
901
|
+
* @param {WordArray} wordArray The word array to append.
|
|
902
|
+
*
|
|
903
|
+
* @return {WordArray} This word array.
|
|
904
|
+
*
|
|
905
|
+
* @example
|
|
906
|
+
*
|
|
907
|
+
* wordArray1.concat(wordArray2);
|
|
908
|
+
*/
|
|
909
|
+
concat: function(u) {
|
|
910
|
+
var h = this.words, y = u.words, x = this.sigBytes, M = u.sigBytes;
|
|
911
|
+
if (this.clamp(), x % 4)
|
|
912
|
+
for (var Y = 0; Y < M; Y++) {
|
|
913
|
+
var H = y[Y >>> 2] >>> 24 - Y % 4 * 8 & 255;
|
|
914
|
+
h[x + Y >>> 2] |= H << 24 - (x + Y) % 4 * 8;
|
|
915
|
+
}
|
|
916
|
+
else
|
|
917
|
+
for (var B = 0; B < M; B += 4)
|
|
918
|
+
h[x + B >>> 2] = y[B >>> 2];
|
|
919
|
+
return this.sigBytes += M, this;
|
|
920
|
+
},
|
|
921
|
+
/**
|
|
922
|
+
* Removes insignificant bits.
|
|
923
|
+
*
|
|
924
|
+
* @example
|
|
925
|
+
*
|
|
926
|
+
* wordArray.clamp();
|
|
927
|
+
*/
|
|
928
|
+
clamp: function() {
|
|
929
|
+
var u = this.words, h = this.sigBytes;
|
|
930
|
+
u[h >>> 2] &= 4294967295 << 32 - h % 4 * 8, u.length = n.ceil(h / 4);
|
|
931
|
+
},
|
|
932
|
+
/**
|
|
933
|
+
* Creates a copy of this word array.
|
|
934
|
+
*
|
|
935
|
+
* @return {WordArray} The clone.
|
|
936
|
+
*
|
|
937
|
+
* @example
|
|
938
|
+
*
|
|
939
|
+
* var clone = wordArray.clone();
|
|
940
|
+
*/
|
|
941
|
+
clone: function() {
|
|
942
|
+
var u = j.clone.call(this);
|
|
943
|
+
return u.words = this.words.slice(0), u;
|
|
944
|
+
},
|
|
945
|
+
/**
|
|
946
|
+
* Creates a word array filled with random bytes.
|
|
947
|
+
*
|
|
948
|
+
* @param {number} nBytes The number of random bytes to generate.
|
|
949
|
+
*
|
|
950
|
+
* @return {WordArray} The random word array.
|
|
951
|
+
*
|
|
952
|
+
* @static
|
|
953
|
+
*
|
|
954
|
+
* @example
|
|
955
|
+
*
|
|
956
|
+
* var wordArray = CryptoJS.lib.WordArray.random(16);
|
|
957
|
+
*/
|
|
958
|
+
random: function(u) {
|
|
959
|
+
for (var h = [], y = 0; y < u; y += 4)
|
|
960
|
+
h.push(_());
|
|
961
|
+
return new w.init(h, u);
|
|
962
|
+
}
|
|
963
|
+
}), R = O.enc = {}, b = R.Hex = {
|
|
964
|
+
/**
|
|
965
|
+
* Converts a word array to a hex string.
|
|
966
|
+
*
|
|
967
|
+
* @param {WordArray} wordArray The word array.
|
|
968
|
+
*
|
|
969
|
+
* @return {string} The hex string.
|
|
970
|
+
*
|
|
971
|
+
* @static
|
|
972
|
+
*
|
|
973
|
+
* @example
|
|
974
|
+
*
|
|
975
|
+
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
|
|
976
|
+
*/
|
|
977
|
+
stringify: function(u) {
|
|
978
|
+
for (var h = u.words, y = u.sigBytes, x = [], M = 0; M < y; M++) {
|
|
979
|
+
var Y = h[M >>> 2] >>> 24 - M % 4 * 8 & 255;
|
|
980
|
+
x.push((Y >>> 4).toString(16)), x.push((Y & 15).toString(16));
|
|
981
|
+
}
|
|
982
|
+
return x.join("");
|
|
983
|
+
},
|
|
984
|
+
/**
|
|
985
|
+
* Converts a hex string to a word array.
|
|
986
|
+
*
|
|
987
|
+
* @param {string} hexStr The hex string.
|
|
988
|
+
*
|
|
989
|
+
* @return {WordArray} The word array.
|
|
990
|
+
*
|
|
991
|
+
* @static
|
|
992
|
+
*
|
|
993
|
+
* @example
|
|
994
|
+
*
|
|
995
|
+
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
|
|
996
|
+
*/
|
|
997
|
+
parse: function(u) {
|
|
998
|
+
for (var h = u.length, y = [], x = 0; x < h; x += 2)
|
|
999
|
+
y[x >>> 3] |= parseInt(u.substr(x, 2), 16) << 24 - x % 8 * 4;
|
|
1000
|
+
return new w.init(y, h / 2);
|
|
1001
|
+
}
|
|
1002
|
+
}, A = R.Latin1 = {
|
|
1003
|
+
/**
|
|
1004
|
+
* Converts a word array to a Latin1 string.
|
|
1005
|
+
*
|
|
1006
|
+
* @param {WordArray} wordArray The word array.
|
|
1007
|
+
*
|
|
1008
|
+
* @return {string} The Latin1 string.
|
|
1009
|
+
*
|
|
1010
|
+
* @static
|
|
1011
|
+
*
|
|
1012
|
+
* @example
|
|
1013
|
+
*
|
|
1014
|
+
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
|
|
1015
|
+
*/
|
|
1016
|
+
stringify: function(u) {
|
|
1017
|
+
for (var h = u.words, y = u.sigBytes, x = [], M = 0; M < y; M++) {
|
|
1018
|
+
var Y = h[M >>> 2] >>> 24 - M % 4 * 8 & 255;
|
|
1019
|
+
x.push(String.fromCharCode(Y));
|
|
1020
|
+
}
|
|
1021
|
+
return x.join("");
|
|
1022
|
+
},
|
|
1023
|
+
/**
|
|
1024
|
+
* Converts a Latin1 string to a word array.
|
|
1025
|
+
*
|
|
1026
|
+
* @param {string} latin1Str The Latin1 string.
|
|
1027
|
+
*
|
|
1028
|
+
* @return {WordArray} The word array.
|
|
1029
|
+
*
|
|
1030
|
+
* @static
|
|
1031
|
+
*
|
|
1032
|
+
* @example
|
|
1033
|
+
*
|
|
1034
|
+
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
|
|
1035
|
+
*/
|
|
1036
|
+
parse: function(u) {
|
|
1037
|
+
for (var h = u.length, y = [], x = 0; x < h; x++)
|
|
1038
|
+
y[x >>> 2] |= (u.charCodeAt(x) & 255) << 24 - x % 4 * 8;
|
|
1039
|
+
return new w.init(y, h);
|
|
1040
|
+
}
|
|
1041
|
+
}, D = R.Utf8 = {
|
|
1042
|
+
/**
|
|
1043
|
+
* Converts a word array to a UTF-8 string.
|
|
1044
|
+
*
|
|
1045
|
+
* @param {WordArray} wordArray The word array.
|
|
1046
|
+
*
|
|
1047
|
+
* @return {string} The UTF-8 string.
|
|
1048
|
+
*
|
|
1049
|
+
* @static
|
|
1050
|
+
*
|
|
1051
|
+
* @example
|
|
1052
|
+
*
|
|
1053
|
+
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
|
|
1054
|
+
*/
|
|
1055
|
+
stringify: function(u) {
|
|
1056
|
+
try {
|
|
1057
|
+
return decodeURIComponent(escape(A.stringify(u)));
|
|
1058
|
+
} catch {
|
|
1059
|
+
throw new Error("Malformed UTF-8 data");
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1062
|
+
/**
|
|
1063
|
+
* Converts a UTF-8 string to a word array.
|
|
1064
|
+
*
|
|
1065
|
+
* @param {string} utf8Str The UTF-8 string.
|
|
1066
|
+
*
|
|
1067
|
+
* @return {WordArray} The word array.
|
|
1068
|
+
*
|
|
1069
|
+
* @static
|
|
1070
|
+
*
|
|
1071
|
+
* @example
|
|
1072
|
+
*
|
|
1073
|
+
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
|
|
1074
|
+
*/
|
|
1075
|
+
parse: function(u) {
|
|
1076
|
+
return A.parse(unescape(encodeURIComponent(u)));
|
|
1077
|
+
}
|
|
1078
|
+
}, E = a.BufferedBlockAlgorithm = j.extend({
|
|
1079
|
+
/**
|
|
1080
|
+
* Resets this block algorithm's data buffer to its initial state.
|
|
1081
|
+
*
|
|
1082
|
+
* @example
|
|
1083
|
+
*
|
|
1084
|
+
* bufferedBlockAlgorithm.reset();
|
|
1085
|
+
*/
|
|
1086
|
+
reset: function() {
|
|
1087
|
+
this._data = new w.init(), this._nDataBytes = 0;
|
|
1088
|
+
},
|
|
1089
|
+
/**
|
|
1090
|
+
* Adds new data to this block algorithm's buffer.
|
|
1091
|
+
*
|
|
1092
|
+
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
|
|
1093
|
+
*
|
|
1094
|
+
* @example
|
|
1095
|
+
*
|
|
1096
|
+
* bufferedBlockAlgorithm._append('data');
|
|
1097
|
+
* bufferedBlockAlgorithm._append(wordArray);
|
|
1098
|
+
*/
|
|
1099
|
+
_append: function(u) {
|
|
1100
|
+
typeof u == "string" && (u = D.parse(u)), this._data.concat(u), this._nDataBytes += u.sigBytes;
|
|
1101
|
+
},
|
|
1102
|
+
/**
|
|
1103
|
+
* Processes available data blocks.
|
|
1104
|
+
*
|
|
1105
|
+
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
|
|
1106
|
+
*
|
|
1107
|
+
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
|
|
1108
|
+
*
|
|
1109
|
+
* @return {WordArray} The processed data.
|
|
1110
|
+
*
|
|
1111
|
+
* @example
|
|
1112
|
+
*
|
|
1113
|
+
* var processedData = bufferedBlockAlgorithm._process();
|
|
1114
|
+
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
|
|
1115
|
+
*/
|
|
1116
|
+
_process: function(u) {
|
|
1117
|
+
var h, y = this._data, x = y.words, M = y.sigBytes, Y = this.blockSize, H = Y * 4, B = M / H;
|
|
1118
|
+
u ? B = n.ceil(B) : B = n.max((B | 0) - this._minBufferSize, 0);
|
|
1119
|
+
var T = B * Y, C = n.min(T * 4, M);
|
|
1120
|
+
if (T) {
|
|
1121
|
+
for (var F = 0; F < T; F += Y)
|
|
1122
|
+
this._doProcessBlock(x, F);
|
|
1123
|
+
h = x.splice(0, T), y.sigBytes -= C;
|
|
1124
|
+
}
|
|
1125
|
+
return new w.init(h, C);
|
|
1126
|
+
},
|
|
1127
|
+
/**
|
|
1128
|
+
* Creates a copy of this object.
|
|
1129
|
+
*
|
|
1130
|
+
* @return {Object} The clone.
|
|
1131
|
+
*
|
|
1132
|
+
* @example
|
|
1133
|
+
*
|
|
1134
|
+
* var clone = bufferedBlockAlgorithm.clone();
|
|
1135
|
+
*/
|
|
1136
|
+
clone: function() {
|
|
1137
|
+
var u = j.clone.call(this);
|
|
1138
|
+
return u._data = this._data.clone(), u;
|
|
1139
|
+
},
|
|
1140
|
+
_minBufferSize: 0
|
|
1141
|
+
});
|
|
1142
|
+
a.Hasher = E.extend({
|
|
1143
|
+
/**
|
|
1144
|
+
* Configuration options.
|
|
1145
|
+
*/
|
|
1146
|
+
cfg: j.extend(),
|
|
1147
|
+
/**
|
|
1148
|
+
* Initializes a newly created hasher.
|
|
1149
|
+
*
|
|
1150
|
+
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
|
|
1151
|
+
*
|
|
1152
|
+
* @example
|
|
1153
|
+
*
|
|
1154
|
+
* var hasher = CryptoJS.algo.SHA256.create();
|
|
1155
|
+
*/
|
|
1156
|
+
init: function(u) {
|
|
1157
|
+
this.cfg = this.cfg.extend(u), this.reset();
|
|
1158
|
+
},
|
|
1159
|
+
/**
|
|
1160
|
+
* Resets this hasher to its initial state.
|
|
1161
|
+
*
|
|
1162
|
+
* @example
|
|
1163
|
+
*
|
|
1164
|
+
* hasher.reset();
|
|
1165
|
+
*/
|
|
1166
|
+
reset: function() {
|
|
1167
|
+
E.reset.call(this), this._doReset();
|
|
1168
|
+
},
|
|
1169
|
+
/**
|
|
1170
|
+
* Updates this hasher with a message.
|
|
1171
|
+
*
|
|
1172
|
+
* @param {WordArray|string} messageUpdate The message to append.
|
|
1173
|
+
*
|
|
1174
|
+
* @return {Hasher} This hasher.
|
|
1175
|
+
*
|
|
1176
|
+
* @example
|
|
1177
|
+
*
|
|
1178
|
+
* hasher.update('message');
|
|
1179
|
+
* hasher.update(wordArray);
|
|
1180
|
+
*/
|
|
1181
|
+
update: function(u) {
|
|
1182
|
+
return this._append(u), this._process(), this;
|
|
1183
|
+
},
|
|
1184
|
+
/**
|
|
1185
|
+
* Finalizes the hash computation.
|
|
1186
|
+
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
1187
|
+
*
|
|
1188
|
+
* @param {WordArray|string} messageUpdate (Optional) A final message update.
|
|
1189
|
+
*
|
|
1190
|
+
* @return {WordArray} The hash.
|
|
1191
|
+
*
|
|
1192
|
+
* @example
|
|
1193
|
+
*
|
|
1194
|
+
* var hash = hasher.finalize();
|
|
1195
|
+
* var hash = hasher.finalize('message');
|
|
1196
|
+
* var hash = hasher.finalize(wordArray);
|
|
1197
|
+
*/
|
|
1198
|
+
finalize: function(u) {
|
|
1199
|
+
u && this._append(u);
|
|
1200
|
+
var h = this._doFinalize();
|
|
1201
|
+
return h;
|
|
1202
|
+
},
|
|
1203
|
+
blockSize: 16,
|
|
1204
|
+
/**
|
|
1205
|
+
* Creates a shortcut function to a hasher's object interface.
|
|
1206
|
+
*
|
|
1207
|
+
* @param {Hasher} hasher The hasher to create a helper for.
|
|
1208
|
+
*
|
|
1209
|
+
* @return {Function} The shortcut function.
|
|
1210
|
+
*
|
|
1211
|
+
* @static
|
|
1212
|
+
*
|
|
1213
|
+
* @example
|
|
1214
|
+
*
|
|
1215
|
+
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
|
1216
|
+
*/
|
|
1217
|
+
_createHelper: function(u) {
|
|
1218
|
+
return function(h, y) {
|
|
1219
|
+
return new u.init(y).finalize(h);
|
|
1220
|
+
};
|
|
1221
|
+
},
|
|
1222
|
+
/**
|
|
1223
|
+
* Creates a shortcut function to the HMAC's object interface.
|
|
1224
|
+
*
|
|
1225
|
+
* @param {Hasher} hasher The hasher to use in this HMAC helper.
|
|
1226
|
+
*
|
|
1227
|
+
* @return {Function} The shortcut function.
|
|
1228
|
+
*
|
|
1229
|
+
* @static
|
|
1230
|
+
*
|
|
1231
|
+
* @example
|
|
1232
|
+
*
|
|
1233
|
+
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
|
1234
|
+
*/
|
|
1235
|
+
_createHmacHelper: function(u) {
|
|
1236
|
+
return function(h, y) {
|
|
1237
|
+
return new k.HMAC.init(u, y).finalize(h);
|
|
1238
|
+
};
|
|
1239
|
+
}
|
|
1240
|
+
});
|
|
1241
|
+
var k = O.algo = {};
|
|
1242
|
+
return O;
|
|
1243
|
+
}(Math);
|
|
1244
|
+
return r;
|
|
1245
|
+
});
|
|
1246
|
+
}(tt)), tt.exports;
|
|
1247
|
+
}
|
|
1248
|
+
(function(e, t) {
|
|
1249
|
+
(function(r, n) {
|
|
1250
|
+
e.exports = n(Zt());
|
|
1251
|
+
})(q, function(r) {
|
|
1252
|
+
return function(n) {
|
|
1253
|
+
var d = r, m = d.lib, _ = m.WordArray, L = m.Hasher, O = d.algo, a = [];
|
|
1254
|
+
(function() {
|
|
1255
|
+
for (var D = 0; D < 64; D++)
|
|
1256
|
+
a[D] = n.abs(n.sin(D + 1)) * 4294967296 | 0;
|
|
1257
|
+
})();
|
|
1258
|
+
var j = O.MD5 = L.extend({
|
|
1259
|
+
_doReset: function() {
|
|
1260
|
+
this._hash = new _.init([
|
|
1261
|
+
1732584193,
|
|
1262
|
+
4023233417,
|
|
1263
|
+
2562383102,
|
|
1264
|
+
271733878
|
|
1265
|
+
]);
|
|
1266
|
+
},
|
|
1267
|
+
_doProcessBlock: function(D, E) {
|
|
1268
|
+
for (var k = 0; k < 16; k++) {
|
|
1269
|
+
var u = E + k, h = D[u];
|
|
1270
|
+
D[u] = (h << 8 | h >>> 24) & 16711935 | (h << 24 | h >>> 8) & 4278255360;
|
|
1271
|
+
}
|
|
1272
|
+
var y = this._hash.words, x = D[E + 0], M = D[E + 1], Y = D[E + 2], H = D[E + 3], B = D[E + 4], T = D[E + 5], C = D[E + 6], F = D[E + 7], U = D[E + 8], v = D[E + 9], p = D[E + 10], f = D[E + 11], g = D[E + 12], l = D[E + 13], $ = D[E + 14], S = D[E + 15], s = y[0], o = y[1], i = y[2], c = y[3];
|
|
1273
|
+
s = w(s, o, i, c, x, 7, a[0]), c = w(c, s, o, i, M, 12, a[1]), i = w(i, c, s, o, Y, 17, a[2]), o = w(o, i, c, s, H, 22, a[3]), s = w(s, o, i, c, B, 7, a[4]), c = w(c, s, o, i, T, 12, a[5]), i = w(i, c, s, o, C, 17, a[6]), o = w(o, i, c, s, F, 22, a[7]), s = w(s, o, i, c, U, 7, a[8]), c = w(c, s, o, i, v, 12, a[9]), i = w(i, c, s, o, p, 17, a[10]), o = w(o, i, c, s, f, 22, a[11]), s = w(s, o, i, c, g, 7, a[12]), c = w(c, s, o, i, l, 12, a[13]), i = w(i, c, s, o, $, 17, a[14]), o = w(o, i, c, s, S, 22, a[15]), s = R(s, o, i, c, M, 5, a[16]), c = R(c, s, o, i, C, 9, a[17]), i = R(i, c, s, o, f, 14, a[18]), o = R(o, i, c, s, x, 20, a[19]), s = R(s, o, i, c, T, 5, a[20]), c = R(c, s, o, i, p, 9, a[21]), i = R(i, c, s, o, S, 14, a[22]), o = R(o, i, c, s, B, 20, a[23]), s = R(s, o, i, c, v, 5, a[24]), c = R(c, s, o, i, $, 9, a[25]), i = R(i, c, s, o, H, 14, a[26]), o = R(o, i, c, s, U, 20, a[27]), s = R(s, o, i, c, l, 5, a[28]), c = R(c, s, o, i, Y, 9, a[29]), i = R(i, c, s, o, F, 14, a[30]), o = R(o, i, c, s, g, 20, a[31]), s = b(s, o, i, c, T, 4, a[32]), c = b(c, s, o, i, U, 11, a[33]), i = b(i, c, s, o, f, 16, a[34]), o = b(o, i, c, s, $, 23, a[35]), s = b(s, o, i, c, M, 4, a[36]), c = b(c, s, o, i, B, 11, a[37]), i = b(i, c, s, o, F, 16, a[38]), o = b(o, i, c, s, p, 23, a[39]), s = b(s, o, i, c, l, 4, a[40]), c = b(c, s, o, i, x, 11, a[41]), i = b(i, c, s, o, H, 16, a[42]), o = b(o, i, c, s, C, 23, a[43]), s = b(s, o, i, c, v, 4, a[44]), c = b(c, s, o, i, g, 11, a[45]), i = b(i, c, s, o, S, 16, a[46]), o = b(o, i, c, s, Y, 23, a[47]), s = A(s, o, i, c, x, 6, a[48]), c = A(c, s, o, i, F, 10, a[49]), i = A(i, c, s, o, $, 15, a[50]), o = A(o, i, c, s, T, 21, a[51]), s = A(s, o, i, c, g, 6, a[52]), c = A(c, s, o, i, H, 10, a[53]), i = A(i, c, s, o, p, 15, a[54]), o = A(o, i, c, s, M, 21, a[55]), s = A(s, o, i, c, U, 6, a[56]), c = A(c, s, o, i, S, 10, a[57]), i = A(i, c, s, o, C, 15, a[58]), o = A(o, i, c, s, l, 21, a[59]), s = A(s, o, i, c, B, 6, a[60]), c = A(c, s, o, i, f, 10, a[61]), i = A(i, c, s, o, Y, 15, a[62]), o = A(o, i, c, s, v, 21, a[63]), y[0] = y[0] + s | 0, y[1] = y[1] + o | 0, y[2] = y[2] + i | 0, y[3] = y[3] + c | 0;
|
|
1274
|
+
},
|
|
1275
|
+
_doFinalize: function() {
|
|
1276
|
+
var D = this._data, E = D.words, k = this._nDataBytes * 8, u = D.sigBytes * 8;
|
|
1277
|
+
E[u >>> 5] |= 128 << 24 - u % 32;
|
|
1278
|
+
var h = n.floor(k / 4294967296), y = k;
|
|
1279
|
+
E[(u + 64 >>> 9 << 4) + 15] = (h << 8 | h >>> 24) & 16711935 | (h << 24 | h >>> 8) & 4278255360, E[(u + 64 >>> 9 << 4) + 14] = (y << 8 | y >>> 24) & 16711935 | (y << 24 | y >>> 8) & 4278255360, D.sigBytes = (E.length + 1) * 4, this._process();
|
|
1280
|
+
for (var x = this._hash, M = x.words, Y = 0; Y < 4; Y++) {
|
|
1281
|
+
var H = M[Y];
|
|
1282
|
+
M[Y] = (H << 8 | H >>> 24) & 16711935 | (H << 24 | H >>> 8) & 4278255360;
|
|
1283
|
+
}
|
|
1284
|
+
return x;
|
|
1285
|
+
},
|
|
1286
|
+
clone: function() {
|
|
1287
|
+
var D = L.clone.call(this);
|
|
1288
|
+
return D._hash = this._hash.clone(), D;
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1291
|
+
function w(D, E, k, u, h, y, x) {
|
|
1292
|
+
var M = D + (E & k | ~E & u) + h + x;
|
|
1293
|
+
return (M << y | M >>> 32 - y) + E;
|
|
1294
|
+
}
|
|
1295
|
+
function R(D, E, k, u, h, y, x) {
|
|
1296
|
+
var M = D + (E & u | k & ~u) + h + x;
|
|
1297
|
+
return (M << y | M >>> 32 - y) + E;
|
|
1298
|
+
}
|
|
1299
|
+
function b(D, E, k, u, h, y, x) {
|
|
1300
|
+
var M = D + (E ^ k ^ u) + h + x;
|
|
1301
|
+
return (M << y | M >>> 32 - y) + E;
|
|
1302
|
+
}
|
|
1303
|
+
function A(D, E, k, u, h, y, x) {
|
|
1304
|
+
var M = D + (k ^ (E | ~u)) + h + x;
|
|
1305
|
+
return (M << y | M >>> 32 - y) + E;
|
|
1306
|
+
}
|
|
1307
|
+
d.MD5 = L._createHelper(j), d.HmacMD5 = L._createHmacHelper(j);
|
|
1308
|
+
}(Math), r.MD5;
|
|
1309
|
+
});
|
|
1310
|
+
})(ht);
|
|
1311
|
+
var Gt = ht.exports;
|
|
1312
|
+
const Xt = /* @__PURE__ */ ut(Gt);
|
|
1313
|
+
function Vt(e) {
|
|
1314
|
+
return String(Xt(e));
|
|
1315
|
+
}
|
|
1316
|
+
function Kt(e, t) {
|
|
1317
|
+
const r = new xt();
|
|
1318
|
+
return r.setKey(e), r.encrypt(t);
|
|
1319
|
+
}
|
|
1320
|
+
const Fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1321
|
+
__proto__: null,
|
|
1322
|
+
RSA: Kt,
|
|
1323
|
+
md5: Vt
|
|
1324
|
+
}, Symbol.toStringTag, { value: "Module" })), rt = /^(http|https):\/\/[\w.:\-@]*/;
|
|
1325
|
+
function Qt(e) {
|
|
1326
|
+
return rt.test(e);
|
|
1327
|
+
}
|
|
1328
|
+
function te(e) {
|
|
1329
|
+
if (X) {
|
|
1330
|
+
const { protocol: t, host: r, pathname: n } = location;
|
|
1331
|
+
return `${t}//${r}${e ? n : ""}`;
|
|
1332
|
+
} else
|
|
1333
|
+
return null;
|
|
1334
|
+
}
|
|
1335
|
+
function ee(e = "") {
|
|
1336
|
+
const t = e.match(rt);
|
|
1337
|
+
return t ? t[0] : "";
|
|
1338
|
+
}
|
|
1339
|
+
function pt(e) {
|
|
1340
|
+
const t = [];
|
|
1341
|
+
for (const r in e)
|
|
1342
|
+
Object.prototype.hasOwnProperty.call(e, r) && t.push([r, encodeURIComponent(e[r])].join("="));
|
|
1343
|
+
return t.join("&");
|
|
1344
|
+
}
|
|
1345
|
+
function et(e, t, r) {
|
|
1346
|
+
const n = {};
|
|
1347
|
+
e = (e || location.search).replace(/^[^]*\?/, ""), t = t || "&", r = r || "=";
|
|
1348
|
+
let d;
|
|
1349
|
+
const m = new RegExp(
|
|
1350
|
+
"(?:^|\\" + t + ")([^\\" + r + "\\" + t + "]+)(?:\\" + r + "([^\\" + t + "]*))?",
|
|
1351
|
+
"g"
|
|
1352
|
+
);
|
|
1353
|
+
for (; (d = m.exec(e)) !== null; )
|
|
1354
|
+
d[1] !== e && (n[decodeURIComponent(d[1])] = decodeURIComponent(d[2] || ""));
|
|
1355
|
+
return n;
|
|
1356
|
+
}
|
|
1357
|
+
function mt(e, t) {
|
|
1358
|
+
t = typeof t == "string" ? et(t) : t;
|
|
1359
|
+
const r = e.split("?")[0], n = et(e), d = Object.assign({}, n, t), m = pt(d);
|
|
1360
|
+
return m ? [r, m].join("?") : e;
|
|
1361
|
+
}
|
|
1362
|
+
const Pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1363
|
+
__proto__: null,
|
|
1364
|
+
UrlRegex: rt,
|
|
1365
|
+
append: mt,
|
|
1366
|
+
getCurrentHost: te,
|
|
1367
|
+
getHost: ee,
|
|
1368
|
+
isUrl: Qt,
|
|
1369
|
+
parse: et,
|
|
1370
|
+
stringify: pt
|
|
1371
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1372
|
+
let ne = 0;
|
|
1373
|
+
function re() {
|
|
1374
|
+
}
|
|
1375
|
+
const se = {
|
|
1376
|
+
cache: !1,
|
|
1377
|
+
timeout: 60 * 1e3,
|
|
1378
|
+
param: "callback",
|
|
1379
|
+
prefix: "__jp",
|
|
1380
|
+
name: "",
|
|
1381
|
+
script: !1
|
|
1382
|
+
};
|
|
1383
|
+
function Ie(e, t = {}, r) {
|
|
1384
|
+
const n = Object.assign({}, se, r || {}), d = n.name || `${n.prefix}${++ne}`, m = document.getElementsByTagName("script")[0] || document.head;
|
|
1385
|
+
let _, L;
|
|
1386
|
+
return new Promise((O, a) => {
|
|
1387
|
+
const j = () => {
|
|
1388
|
+
_?.parentNode && (_.onload = null, _.onerror = null, _.parentNode.removeChild(_), n.script || (window[d] = re), L && clearTimeout(L));
|
|
1389
|
+
};
|
|
1390
|
+
n.script || (window[d] = (b) => {
|
|
1391
|
+
j(), O(b);
|
|
1392
|
+
});
|
|
1393
|
+
const w = {
|
|
1394
|
+
...t,
|
|
1395
|
+
[n.param]: d
|
|
1396
|
+
};
|
|
1397
|
+
n.cache || (w.__t__ = typeof n.cache == "string" ? n.cache : Date.now()), e.includes("${") && (e = ct(e)(w || {}));
|
|
1398
|
+
const R = mt(e, w);
|
|
1399
|
+
_ = document.createElement("script"), _.src = R, n.script && (_.onload = () => {
|
|
1400
|
+
if (n.name) {
|
|
1401
|
+
const b = window;
|
|
1402
|
+
j(), O(b[n.name]);
|
|
1403
|
+
}
|
|
1404
|
+
}, _.onerror = (b) => {
|
|
1405
|
+
j(), a(b);
|
|
1406
|
+
}), m.parentNode?.insertBefore(_, m), L = setTimeout(() => {
|
|
1407
|
+
j(), a(new Error("Timeout"));
|
|
1408
|
+
}, n.timeout);
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
export {
|
|
1412
|
+
Wt as CAR_NUMBER_NEW_REGEX,
|
|
1413
|
+
Ft as CAR_NUMBER_REGEX,
|
|
1414
|
+
Bt as EMAIL_REGEX,
|
|
1415
|
+
kt as ID_NUMBER_REGEX,
|
|
1416
|
+
it as LOCAL_REQUEST_ID,
|
|
1417
|
+
Ht as MOBILE_PHONE_REGEX,
|
|
1418
|
+
Et as Request,
|
|
1419
|
+
Tt as Storage,
|
|
1420
|
+
At as URL_REGEX,
|
|
1421
|
+
St as arrayToMap,
|
|
1422
|
+
Le as cAF,
|
|
1423
|
+
ze as camelCase,
|
|
1424
|
+
Oe as cleanObject,
|
|
1425
|
+
qe as cloneDeep,
|
|
1426
|
+
We as cookie,
|
|
1427
|
+
Rt as createApi,
|
|
1428
|
+
Ee as createApis,
|
|
1429
|
+
Ct as createRequest,
|
|
1430
|
+
Fe as crypto,
|
|
1431
|
+
Re as dateFormat,
|
|
1432
|
+
lt as dayjs,
|
|
1433
|
+
Je as debounce,
|
|
1434
|
+
Me as dedupArray,
|
|
1435
|
+
Se as delay,
|
|
1436
|
+
Ze as get,
|
|
1437
|
+
He as isCarNo,
|
|
1438
|
+
X as isClient,
|
|
1439
|
+
de as isDef,
|
|
1440
|
+
Ae as isEmail,
|
|
1441
|
+
Ge as isEqual,
|
|
1442
|
+
ye as isFunction,
|
|
1443
|
+
Be as isIdNumber,
|
|
1444
|
+
ke as isMobilePhone,
|
|
1445
|
+
ge as isObject,
|
|
1446
|
+
Xe as isPlainObject,
|
|
1447
|
+
_e as isString,
|
|
1448
|
+
ve as isUndefined,
|
|
1449
|
+
Te as isUrl,
|
|
1450
|
+
Ie as jsonp,
|
|
1451
|
+
Ve as kebabCase,
|
|
1452
|
+
Ke as lowerFirst,
|
|
1453
|
+
be as mapToObject,
|
|
1454
|
+
Qe as merge,
|
|
1455
|
+
le as now,
|
|
1456
|
+
je as numberFormat,
|
|
1457
|
+
on as numeral,
|
|
1458
|
+
Q as omit,
|
|
1459
|
+
xe as pick,
|
|
1460
|
+
Ce as rAF,
|
|
1461
|
+
pe as rand,
|
|
1462
|
+
Lt as request,
|
|
1463
|
+
tn as set,
|
|
1464
|
+
Ye as storage,
|
|
1465
|
+
en as template,
|
|
1466
|
+
nn as throttle,
|
|
1467
|
+
he as timestamp,
|
|
1468
|
+
De as toArray,
|
|
1469
|
+
$e as toFixed,
|
|
1470
|
+
ot as trim,
|
|
1471
|
+
$t as uid,
|
|
1472
|
+
rn as upperFirst,
|
|
1473
|
+
we as upperFirstCamelCase,
|
|
1474
|
+
Pe as url,
|
|
1475
|
+
me as uuid,
|
|
1476
|
+
fe as version
|
|
1477
|
+
};
|