@dazhicheng/ui 1.5.150 → 1.5.153
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/components/tt-form/src/formApi.d.ts +13 -14
- package/dist/components/tt-form/src/group-form/groupFormApi.d.ts +4 -13
- package/dist/components/tt-form/src/group-form/types.d.ts +9 -4
- package/dist/components/tt-form/src/types.d.ts +27 -1
- package/dist/components/tt-form/src/utils/array-path.d.ts +14 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5614 -5632
- package/dist/plugins.js +1 -1
- package/package.json +1 -1
- package/dist/index-CMjNBMj5.js +0 -3431
- package/dist/index.modern-Cbpe_IBr.js +0 -3069
|
@@ -1,3069 +0,0 @@
|
|
|
1
|
-
var V = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
-
function mt(e) {
|
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
-
}
|
|
5
|
-
function wt(e) {
|
|
6
|
-
if (e.__esModule) return e;
|
|
7
|
-
var t = e.default;
|
|
8
|
-
if (typeof t == "function") {
|
|
9
|
-
var r = function n() {
|
|
10
|
-
return this instanceof n ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
r.prototype = t.prototype;
|
|
13
|
-
} else r = {};
|
|
14
|
-
return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(n) {
|
|
15
|
-
var s = Object.getOwnPropertyDescriptor(e, n);
|
|
16
|
-
Object.defineProperty(r, n, s.get ? s : {
|
|
17
|
-
enumerable: !0,
|
|
18
|
-
get: function() {
|
|
19
|
-
return e[n];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}), r;
|
|
23
|
-
}
|
|
24
|
-
var Xe = { exports: {} };
|
|
25
|
-
(function(e, t) {
|
|
26
|
-
(function(r, n) {
|
|
27
|
-
e.exports = n();
|
|
28
|
-
})(V, function() {
|
|
29
|
-
var r = 1e3, n = 6e4, s = 36e5, i = "millisecond", a = "second", u = "minute", f = "hour", o = "day", c = "week", h = "month", l = "quarter", m = "year", b = "date", p = "Invalid Date", C = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, T = /\[([^\]]+)]|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, g = { 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(B) {
|
|
30
|
-
var x = ["th", "st", "nd", "rd"], y = B % 100;
|
|
31
|
-
return "[" + B + (x[(y - 20) % 10] || x[y] || x[0]) + "]";
|
|
32
|
-
} }, d = function(B, x, y) {
|
|
33
|
-
var z = String(B);
|
|
34
|
-
return !z || z.length >= x ? B : "" + Array(x + 1 - z.length).join(y) + B;
|
|
35
|
-
}, _ = { s: d, z: function(B) {
|
|
36
|
-
var x = -B.utcOffset(), y = Math.abs(x), z = Math.floor(y / 60), P = y % 60;
|
|
37
|
-
return (x <= 0 ? "+" : "-") + d(z, 2, "0") + ":" + d(P, 2, "0");
|
|
38
|
-
}, m: function B(x, y) {
|
|
39
|
-
if (x.date() < y.date()) return -B(y, x);
|
|
40
|
-
var z = 12 * (y.year() - x.year()) + (y.month() - x.month()), P = x.clone().add(z, h), R = y - P < 0, j = x.clone().add(z + (R ? -1 : 1), h);
|
|
41
|
-
return +(-(z + (y - P) / (R ? P - j : j - P)) || 0);
|
|
42
|
-
}, a: function(B) {
|
|
43
|
-
return B < 0 ? Math.ceil(B) || 0 : Math.floor(B);
|
|
44
|
-
}, p: function(B) {
|
|
45
|
-
return { M: h, y: m, w: c, d: o, D: b, h: f, m: u, s: a, ms: i, Q: l }[B] || String(B || "").toLowerCase().replace(/s$/, "");
|
|
46
|
-
}, u: function(B) {
|
|
47
|
-
return B === void 0;
|
|
48
|
-
} }, O = "en", M = {};
|
|
49
|
-
M[O] = g;
|
|
50
|
-
var H = "$isDayjsObject", I = function(B) {
|
|
51
|
-
return B instanceof A || !(!B || !B[H]);
|
|
52
|
-
}, F = function B(x, y, z) {
|
|
53
|
-
var P;
|
|
54
|
-
if (!x) return O;
|
|
55
|
-
if (typeof x == "string") {
|
|
56
|
-
var R = x.toLowerCase();
|
|
57
|
-
M[R] && (P = R), y && (M[R] = y, P = R);
|
|
58
|
-
var j = x.split("-");
|
|
59
|
-
if (!P && j.length > 1) return B(j[0]);
|
|
60
|
-
} else {
|
|
61
|
-
var $ = x.name;
|
|
62
|
-
M[$] = x, P = $;
|
|
63
|
-
}
|
|
64
|
-
return !z && P && (O = P), P || !z && O;
|
|
65
|
-
}, v = function(B, x) {
|
|
66
|
-
if (I(B)) return B.clone();
|
|
67
|
-
var y = typeof x == "object" ? x : {};
|
|
68
|
-
return y.date = B, y.args = arguments, new A(y);
|
|
69
|
-
}, w = _;
|
|
70
|
-
w.l = F, w.i = I, w.w = function(B, x) {
|
|
71
|
-
return v(B, { locale: x.$L, utc: x.$u, x: x.$x, $offset: x.$offset });
|
|
72
|
-
};
|
|
73
|
-
var A = function() {
|
|
74
|
-
function B(y) {
|
|
75
|
-
this.$L = F(y.locale, null, !0), this.parse(y), this.$x = this.$x || y.x || {}, this[H] = !0;
|
|
76
|
-
}
|
|
77
|
-
var x = B.prototype;
|
|
78
|
-
return x.parse = function(y) {
|
|
79
|
-
this.$d = function(z) {
|
|
80
|
-
var P = z.date, R = z.utc;
|
|
81
|
-
if (P === null) return /* @__PURE__ */ new Date(NaN);
|
|
82
|
-
if (w.u(P)) return /* @__PURE__ */ new Date();
|
|
83
|
-
if (P instanceof Date) return new Date(P);
|
|
84
|
-
if (typeof P == "string" && !/Z$/i.test(P)) {
|
|
85
|
-
var j = P.match(C);
|
|
86
|
-
if (j) {
|
|
87
|
-
var $ = j[2] - 1 || 0, D = (j[7] || "0").substring(0, 3);
|
|
88
|
-
return R ? new Date(Date.UTC(j[1], $, j[3] || 1, j[4] || 0, j[5] || 0, j[6] || 0, D)) : new Date(j[1], $, j[3] || 1, j[4] || 0, j[5] || 0, j[6] || 0, D);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return new Date(P);
|
|
92
|
-
}(y), this.init();
|
|
93
|
-
}, x.init = function() {
|
|
94
|
-
var y = this.$d;
|
|
95
|
-
this.$y = y.getFullYear(), this.$M = y.getMonth(), this.$D = y.getDate(), this.$W = y.getDay(), this.$H = y.getHours(), this.$m = y.getMinutes(), this.$s = y.getSeconds(), this.$ms = y.getMilliseconds();
|
|
96
|
-
}, x.$utils = function() {
|
|
97
|
-
return w;
|
|
98
|
-
}, x.isValid = function() {
|
|
99
|
-
return this.$d.toString() !== p;
|
|
100
|
-
}, x.isSame = function(y, z) {
|
|
101
|
-
var P = v(y);
|
|
102
|
-
return this.startOf(z) <= P && P <= this.endOf(z);
|
|
103
|
-
}, x.isAfter = function(y, z) {
|
|
104
|
-
return v(y) < this.startOf(z);
|
|
105
|
-
}, x.isBefore = function(y, z) {
|
|
106
|
-
return this.endOf(z) < v(y);
|
|
107
|
-
}, x.$g = function(y, z, P) {
|
|
108
|
-
return w.u(y) ? this[z] : this.set(P, y);
|
|
109
|
-
}, x.unix = function() {
|
|
110
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
111
|
-
}, x.valueOf = function() {
|
|
112
|
-
return this.$d.getTime();
|
|
113
|
-
}, x.startOf = function(y, z) {
|
|
114
|
-
var P = this, R = !!w.u(z) || z, j = w.p(y), $ = function(le, Q) {
|
|
115
|
-
var se = w.w(P.$u ? Date.UTC(P.$y, Q, le) : new Date(P.$y, Q, le), P);
|
|
116
|
-
return R ? se : se.endOf(o);
|
|
117
|
-
}, D = function(le, Q) {
|
|
118
|
-
return w.w(P.toDate()[le].apply(P.toDate("s"), (R ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(Q)), P);
|
|
119
|
-
}, S = this.$W, E = this.$M, X = this.$D, he = "set" + (this.$u ? "UTC" : "");
|
|
120
|
-
switch (j) {
|
|
121
|
-
case m:
|
|
122
|
-
return R ? $(1, 0) : $(31, 11);
|
|
123
|
-
case h:
|
|
124
|
-
return R ? $(1, E) : $(0, E + 1);
|
|
125
|
-
case c:
|
|
126
|
-
var ce = this.$locale().weekStart || 0, ve = (S < ce ? S + 7 : S) - ce;
|
|
127
|
-
return $(R ? X - ve : X + (6 - ve), E);
|
|
128
|
-
case o:
|
|
129
|
-
case b:
|
|
130
|
-
return D(he + "Hours", 0);
|
|
131
|
-
case f:
|
|
132
|
-
return D(he + "Minutes", 1);
|
|
133
|
-
case u:
|
|
134
|
-
return D(he + "Seconds", 2);
|
|
135
|
-
case a:
|
|
136
|
-
return D(he + "Milliseconds", 3);
|
|
137
|
-
default:
|
|
138
|
-
return this.clone();
|
|
139
|
-
}
|
|
140
|
-
}, x.endOf = function(y) {
|
|
141
|
-
return this.startOf(y, !1);
|
|
142
|
-
}, x.$set = function(y, z) {
|
|
143
|
-
var P, R = w.p(y), j = "set" + (this.$u ? "UTC" : ""), $ = (P = {}, P[o] = j + "Date", P[b] = j + "Date", P[h] = j + "Month", P[m] = j + "FullYear", P[f] = j + "Hours", P[u] = j + "Minutes", P[a] = j + "Seconds", P[i] = j + "Milliseconds", P)[R], D = R === o ? this.$D + (z - this.$W) : z;
|
|
144
|
-
if (R === h || R === m) {
|
|
145
|
-
var S = this.clone().set(b, 1);
|
|
146
|
-
S.$d[$](D), S.init(), this.$d = S.set(b, Math.min(this.$D, S.daysInMonth())).$d;
|
|
147
|
-
} else $ && this.$d[$](D);
|
|
148
|
-
return this.init(), this;
|
|
149
|
-
}, x.set = function(y, z) {
|
|
150
|
-
return this.clone().$set(y, z);
|
|
151
|
-
}, x.get = function(y) {
|
|
152
|
-
return this[w.p(y)]();
|
|
153
|
-
}, x.add = function(y, z) {
|
|
154
|
-
var P, R = this;
|
|
155
|
-
y = Number(y);
|
|
156
|
-
var j = w.p(z), $ = function(E) {
|
|
157
|
-
var X = v(R);
|
|
158
|
-
return w.w(X.date(X.date() + Math.round(E * y)), R);
|
|
159
|
-
};
|
|
160
|
-
if (j === h) return this.set(h, this.$M + y);
|
|
161
|
-
if (j === m) return this.set(m, this.$y + y);
|
|
162
|
-
if (j === o) return $(1);
|
|
163
|
-
if (j === c) return $(7);
|
|
164
|
-
var D = (P = {}, P[u] = n, P[f] = s, P[a] = r, P)[j] || 1, S = this.$d.getTime() + y * D;
|
|
165
|
-
return w.w(S, this);
|
|
166
|
-
}, x.subtract = function(y, z) {
|
|
167
|
-
return this.add(-1 * y, z);
|
|
168
|
-
}, x.format = function(y) {
|
|
169
|
-
var z = this, P = this.$locale();
|
|
170
|
-
if (!this.isValid()) return P.invalidDate || p;
|
|
171
|
-
var R = y || "YYYY-MM-DDTHH:mm:ssZ", j = w.z(this), $ = this.$H, D = this.$m, S = this.$M, E = P.weekdays, X = P.months, he = P.meridiem, ce = function(Q, se, ge, _e) {
|
|
172
|
-
return Q && (Q[se] || Q(z, R)) || ge[se].slice(0, _e);
|
|
173
|
-
}, ve = function(Q) {
|
|
174
|
-
return w.s($ % 12 || 12, Q, "0");
|
|
175
|
-
}, le = he || function(Q, se, ge) {
|
|
176
|
-
var _e = Q < 12 ? "AM" : "PM";
|
|
177
|
-
return ge ? _e.toLowerCase() : _e;
|
|
178
|
-
};
|
|
179
|
-
return R.replace(T, function(Q, se) {
|
|
180
|
-
return se || function(ge) {
|
|
181
|
-
switch (ge) {
|
|
182
|
-
case "YY":
|
|
183
|
-
return String(z.$y).slice(-2);
|
|
184
|
-
case "YYYY":
|
|
185
|
-
return w.s(z.$y, 4, "0");
|
|
186
|
-
case "M":
|
|
187
|
-
return S + 1;
|
|
188
|
-
case "MM":
|
|
189
|
-
return w.s(S + 1, 2, "0");
|
|
190
|
-
case "MMM":
|
|
191
|
-
return ce(P.monthsShort, S, X, 3);
|
|
192
|
-
case "MMMM":
|
|
193
|
-
return ce(X, S);
|
|
194
|
-
case "D":
|
|
195
|
-
return z.$D;
|
|
196
|
-
case "DD":
|
|
197
|
-
return w.s(z.$D, 2, "0");
|
|
198
|
-
case "d":
|
|
199
|
-
return String(z.$W);
|
|
200
|
-
case "dd":
|
|
201
|
-
return ce(P.weekdaysMin, z.$W, E, 2);
|
|
202
|
-
case "ddd":
|
|
203
|
-
return ce(P.weekdaysShort, z.$W, E, 3);
|
|
204
|
-
case "dddd":
|
|
205
|
-
return E[z.$W];
|
|
206
|
-
case "H":
|
|
207
|
-
return String($);
|
|
208
|
-
case "HH":
|
|
209
|
-
return w.s($, 2, "0");
|
|
210
|
-
case "h":
|
|
211
|
-
return ve(1);
|
|
212
|
-
case "hh":
|
|
213
|
-
return ve(2);
|
|
214
|
-
case "a":
|
|
215
|
-
return le($, D, !0);
|
|
216
|
-
case "A":
|
|
217
|
-
return le($, D, !1);
|
|
218
|
-
case "m":
|
|
219
|
-
return String(D);
|
|
220
|
-
case "mm":
|
|
221
|
-
return w.s(D, 2, "0");
|
|
222
|
-
case "s":
|
|
223
|
-
return String(z.$s);
|
|
224
|
-
case "ss":
|
|
225
|
-
return w.s(z.$s, 2, "0");
|
|
226
|
-
case "SSS":
|
|
227
|
-
return w.s(z.$ms, 3, "0");
|
|
228
|
-
case "Z":
|
|
229
|
-
return j;
|
|
230
|
-
}
|
|
231
|
-
return null;
|
|
232
|
-
}(Q) || j.replace(":", "");
|
|
233
|
-
});
|
|
234
|
-
}, x.utcOffset = function() {
|
|
235
|
-
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
236
|
-
}, x.diff = function(y, z, P) {
|
|
237
|
-
var R, j = this, $ = w.p(z), D = v(y), S = (D.utcOffset() - this.utcOffset()) * n, E = this - D, X = function() {
|
|
238
|
-
return w.m(j, D);
|
|
239
|
-
};
|
|
240
|
-
switch ($) {
|
|
241
|
-
case m:
|
|
242
|
-
R = X() / 12;
|
|
243
|
-
break;
|
|
244
|
-
case h:
|
|
245
|
-
R = X();
|
|
246
|
-
break;
|
|
247
|
-
case l:
|
|
248
|
-
R = X() / 3;
|
|
249
|
-
break;
|
|
250
|
-
case c:
|
|
251
|
-
R = (E - S) / 6048e5;
|
|
252
|
-
break;
|
|
253
|
-
case o:
|
|
254
|
-
R = (E - S) / 864e5;
|
|
255
|
-
break;
|
|
256
|
-
case f:
|
|
257
|
-
R = E / s;
|
|
258
|
-
break;
|
|
259
|
-
case u:
|
|
260
|
-
R = E / n;
|
|
261
|
-
break;
|
|
262
|
-
case a:
|
|
263
|
-
R = E / r;
|
|
264
|
-
break;
|
|
265
|
-
default:
|
|
266
|
-
R = E;
|
|
267
|
-
}
|
|
268
|
-
return P ? R : w.a(R);
|
|
269
|
-
}, x.daysInMonth = function() {
|
|
270
|
-
return this.endOf(h).$D;
|
|
271
|
-
}, x.$locale = function() {
|
|
272
|
-
return M[this.$L];
|
|
273
|
-
}, x.locale = function(y, z) {
|
|
274
|
-
if (!y) return this.$L;
|
|
275
|
-
var P = this.clone(), R = F(y, z, !0);
|
|
276
|
-
return R && (P.$L = R), P;
|
|
277
|
-
}, x.clone = function() {
|
|
278
|
-
return w.w(this.$d, this);
|
|
279
|
-
}, x.toDate = function() {
|
|
280
|
-
return new Date(this.valueOf());
|
|
281
|
-
}, x.toJSON = function() {
|
|
282
|
-
return this.isValid() ? this.toISOString() : null;
|
|
283
|
-
}, x.toISOString = function() {
|
|
284
|
-
return this.$d.toISOString();
|
|
285
|
-
}, x.toString = function() {
|
|
286
|
-
return this.$d.toUTCString();
|
|
287
|
-
}, B;
|
|
288
|
-
}(), k = A.prototype;
|
|
289
|
-
return v.prototype = k, [["$ms", i], ["$s", a], ["$m", u], ["$H", f], ["$W", o], ["$M", h], ["$y", m], ["$D", b]].forEach(function(B) {
|
|
290
|
-
k[B[1]] = function(x) {
|
|
291
|
-
return this.$g(x, B[0], B[1]);
|
|
292
|
-
};
|
|
293
|
-
}), v.extend = function(B, x) {
|
|
294
|
-
return B.$i || (B(x, A, v), B.$i = !0), v;
|
|
295
|
-
}, v.locale = F, v.isDayjs = I, v.unix = function(B) {
|
|
296
|
-
return v(1e3 * B);
|
|
297
|
-
}, v.en = M[O], v.Ls = M, v.p = {}, v;
|
|
298
|
-
});
|
|
299
|
-
})(Xe);
|
|
300
|
-
var _t = Xe.exports;
|
|
301
|
-
const yt = /* @__PURE__ */ mt(_t), xt = Object.prototype.toString;
|
|
302
|
-
function we(e, t) {
|
|
303
|
-
return xt.call(e) === `[object ${t}]`;
|
|
304
|
-
}
|
|
305
|
-
function bt(e) {
|
|
306
|
-
return typeof e < "u";
|
|
307
|
-
}
|
|
308
|
-
function $t(e) {
|
|
309
|
-
return !bt(e);
|
|
310
|
-
}
|
|
311
|
-
function Ct(e) {
|
|
312
|
-
return e === null;
|
|
313
|
-
}
|
|
314
|
-
function et(e) {
|
|
315
|
-
return $t(e) || Ct(e);
|
|
316
|
-
}
|
|
317
|
-
function Nt(e) {
|
|
318
|
-
return et(e) ? !1 : e instanceof Promise ? !0 : we(e, "Object");
|
|
319
|
-
}
|
|
320
|
-
function en(e) {
|
|
321
|
-
return et(e) ? !0 : Ot(e) || Dt(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : Nt(e) ? Object.keys(e).length === 0 : !1;
|
|
322
|
-
}
|
|
323
|
-
function tn(e) {
|
|
324
|
-
return we(e, "Date");
|
|
325
|
-
}
|
|
326
|
-
function rn(e) {
|
|
327
|
-
return we(e, "Number") && e === e;
|
|
328
|
-
}
|
|
329
|
-
function Dt(e) {
|
|
330
|
-
return we(e, "String");
|
|
331
|
-
}
|
|
332
|
-
function nn(e) {
|
|
333
|
-
return typeof e == "function";
|
|
334
|
-
}
|
|
335
|
-
function sn(e) {
|
|
336
|
-
return we(e, "Boolean");
|
|
337
|
-
}
|
|
338
|
-
function Ot(e) {
|
|
339
|
-
return e && Array.isArray(e);
|
|
340
|
-
}
|
|
341
|
-
function on(e) {
|
|
342
|
-
return typeof Element > "u" ? !1 : e instanceof Element;
|
|
343
|
-
}
|
|
344
|
-
function an(e) {
|
|
345
|
-
return yt.isDayjs(e);
|
|
346
|
-
}
|
|
347
|
-
var St = { exports: {} };
|
|
348
|
-
(function(e, t) {
|
|
349
|
-
(function(r, n) {
|
|
350
|
-
e.exports = n();
|
|
351
|
-
})(V, function() {
|
|
352
|
-
var r = "minute", n = /[+-]\d\d(?::?\d\d)?/g, s = /([+-]|\d\d)/g;
|
|
353
|
-
return function(i, a, u) {
|
|
354
|
-
var f = a.prototype;
|
|
355
|
-
u.utc = function(p) {
|
|
356
|
-
var C = { date: p, utc: !0, args: arguments };
|
|
357
|
-
return new a(C);
|
|
358
|
-
}, f.utc = function(p) {
|
|
359
|
-
var C = u(this.toDate(), { locale: this.$L, utc: !0 });
|
|
360
|
-
return p ? C.add(this.utcOffset(), r) : C;
|
|
361
|
-
}, f.local = function() {
|
|
362
|
-
return u(this.toDate(), { locale: this.$L, utc: !1 });
|
|
363
|
-
};
|
|
364
|
-
var o = f.parse;
|
|
365
|
-
f.parse = function(p) {
|
|
366
|
-
p.utc && (this.$u = !0), this.$utils().u(p.$offset) || (this.$offset = p.$offset), o.call(this, p);
|
|
367
|
-
};
|
|
368
|
-
var c = f.init;
|
|
369
|
-
f.init = function() {
|
|
370
|
-
if (this.$u) {
|
|
371
|
-
var p = this.$d;
|
|
372
|
-
this.$y = p.getUTCFullYear(), this.$M = p.getUTCMonth(), this.$D = p.getUTCDate(), this.$W = p.getUTCDay(), this.$H = p.getUTCHours(), this.$m = p.getUTCMinutes(), this.$s = p.getUTCSeconds(), this.$ms = p.getUTCMilliseconds();
|
|
373
|
-
} else c.call(this);
|
|
374
|
-
};
|
|
375
|
-
var h = f.utcOffset;
|
|
376
|
-
f.utcOffset = function(p, C) {
|
|
377
|
-
var T = this.$utils().u;
|
|
378
|
-
if (T(p)) return this.$u ? 0 : T(this.$offset) ? h.call(this) : this.$offset;
|
|
379
|
-
if (typeof p == "string" && (p = function(O) {
|
|
380
|
-
O === void 0 && (O = "");
|
|
381
|
-
var M = O.match(n);
|
|
382
|
-
if (!M) return null;
|
|
383
|
-
var H = ("" + M[0]).match(s) || ["-", 0, 0], I = H[0], F = 60 * +H[1] + +H[2];
|
|
384
|
-
return F === 0 ? 0 : I === "+" ? F : -F;
|
|
385
|
-
}(p), p === null)) return this;
|
|
386
|
-
var g = Math.abs(p) <= 16 ? 60 * p : p;
|
|
387
|
-
if (g === 0) return this.utc(C);
|
|
388
|
-
var d = this.clone();
|
|
389
|
-
if (C) return d.$offset = g, d.$u = !1, d;
|
|
390
|
-
var _ = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
391
|
-
return (d = this.local().add(g + _, r)).$offset = g, d.$x.$localOffset = _, d;
|
|
392
|
-
};
|
|
393
|
-
var l = f.format;
|
|
394
|
-
f.format = function(p) {
|
|
395
|
-
var C = p || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
396
|
-
return l.call(this, C);
|
|
397
|
-
}, f.valueOf = function() {
|
|
398
|
-
var p = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
399
|
-
return this.$d.valueOf() - 6e4 * p;
|
|
400
|
-
}, f.isUTC = function() {
|
|
401
|
-
return !!this.$u;
|
|
402
|
-
}, f.toISOString = function() {
|
|
403
|
-
return this.toDate().toISOString();
|
|
404
|
-
}, f.toString = function() {
|
|
405
|
-
return this.toDate().toUTCString();
|
|
406
|
-
};
|
|
407
|
-
var m = f.toDate;
|
|
408
|
-
f.toDate = function(p) {
|
|
409
|
-
return p === "s" && this.$offset ? u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : m.call(this);
|
|
410
|
-
};
|
|
411
|
-
var b = f.diff;
|
|
412
|
-
f.diff = function(p, C, T) {
|
|
413
|
-
if (p && this.$u === p.$u) return b.call(this, p, C, T);
|
|
414
|
-
var g = this.local(), d = u(p).local();
|
|
415
|
-
return b.call(g, d, C, T);
|
|
416
|
-
};
|
|
417
|
-
};
|
|
418
|
-
});
|
|
419
|
-
})(St);
|
|
420
|
-
var Et = { exports: {} };
|
|
421
|
-
(function(e, t) {
|
|
422
|
-
(function(r, n) {
|
|
423
|
-
e.exports = n();
|
|
424
|
-
})(V, function() {
|
|
425
|
-
var r = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, n = {};
|
|
426
|
-
return function(s, i, a) {
|
|
427
|
-
var u, f = function(l, m, b) {
|
|
428
|
-
b === void 0 && (b = {});
|
|
429
|
-
var p = new Date(l), C = function(T, g) {
|
|
430
|
-
g === void 0 && (g = {});
|
|
431
|
-
var d = g.timeZoneName || "short", _ = T + "|" + d, O = n[_];
|
|
432
|
-
return O || (O = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: T, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: d }), n[_] = O), O;
|
|
433
|
-
}(m, b);
|
|
434
|
-
return C.formatToParts(p);
|
|
435
|
-
}, o = function(l, m) {
|
|
436
|
-
for (var b = f(l, m), p = [], C = 0; C < b.length; C += 1) {
|
|
437
|
-
var T = b[C], g = T.type, d = T.value, _ = r[g];
|
|
438
|
-
_ >= 0 && (p[_] = parseInt(d, 10));
|
|
439
|
-
}
|
|
440
|
-
var O = p[3], M = O === 24 ? 0 : O, H = p[0] + "-" + p[1] + "-" + p[2] + " " + M + ":" + p[4] + ":" + p[5] + ":000", I = +l;
|
|
441
|
-
return (a.utc(H).valueOf() - (I -= I % 1e3)) / 6e4;
|
|
442
|
-
}, c = i.prototype;
|
|
443
|
-
c.tz = function(l, m) {
|
|
444
|
-
l === void 0 && (l = u);
|
|
445
|
-
var b, p = this.utcOffset(), C = this.toDate(), T = C.toLocaleString("en-US", { timeZone: l }), g = Math.round((C - new Date(T)) / 1e3 / 60), d = 15 * -Math.round(C.getTimezoneOffset() / 15) - g;
|
|
446
|
-
if (!Number(d)) b = this.utcOffset(0, m);
|
|
447
|
-
else if (b = a(T, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(d, !0), m) {
|
|
448
|
-
var _ = b.utcOffset();
|
|
449
|
-
b = b.add(p - _, "minute");
|
|
450
|
-
}
|
|
451
|
-
return b.$x.$timezone = l, b;
|
|
452
|
-
}, c.offsetName = function(l) {
|
|
453
|
-
var m = this.$x.$timezone || a.tz.guess(), b = f(this.valueOf(), m, { timeZoneName: l }).find(function(p) {
|
|
454
|
-
return p.type.toLowerCase() === "timezonename";
|
|
455
|
-
});
|
|
456
|
-
return b && b.value;
|
|
457
|
-
};
|
|
458
|
-
var h = c.startOf;
|
|
459
|
-
c.startOf = function(l, m) {
|
|
460
|
-
if (!this.$x || !this.$x.$timezone) return h.call(this, l, m);
|
|
461
|
-
var b = a(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
462
|
-
return h.call(b, l, m).tz(this.$x.$timezone, !0);
|
|
463
|
-
}, a.tz = function(l, m, b) {
|
|
464
|
-
var p = b && m, C = b || m || u, T = o(+a(), C);
|
|
465
|
-
if (typeof l != "string") return a(l).tz(C);
|
|
466
|
-
var g = function(M, H, I) {
|
|
467
|
-
var F = M - 60 * H * 1e3, v = o(F, I);
|
|
468
|
-
if (H === v) return [F, H];
|
|
469
|
-
var w = o(F -= 60 * (v - H) * 1e3, I);
|
|
470
|
-
return v === w ? [F, v] : [M - 60 * Math.min(v, w) * 1e3, Math.max(v, w)];
|
|
471
|
-
}(a.utc(l, p).valueOf(), T, C), d = g[0], _ = g[1], O = a(d).utcOffset(_);
|
|
472
|
-
return O.$x.$timezone = C, O;
|
|
473
|
-
}, a.tz.guess = function() {
|
|
474
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
475
|
-
}, a.tz.setDefault = function(l) {
|
|
476
|
-
u = l;
|
|
477
|
-
};
|
|
478
|
-
};
|
|
479
|
-
});
|
|
480
|
-
})(Et);
|
|
481
|
-
/*!
|
|
482
|
-
* decimal.js v10.6.0
|
|
483
|
-
* An arbitrary-precision Decimal type for JavaScript.
|
|
484
|
-
* https://github.com/MikeMcl/decimal.js
|
|
485
|
-
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
486
|
-
* MIT Licence
|
|
487
|
-
*/
|
|
488
|
-
var de = 9e15, fe = 1e9, ze = "0123456789abcdef", be = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", $e = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", He = {
|
|
489
|
-
// These values must be integers within the stated ranges (inclusive).
|
|
490
|
-
// Most of these values can be changed at run-time using the `Decimal.config` method.
|
|
491
|
-
// The maximum number of significant digits of the result of a calculation or base conversion.
|
|
492
|
-
// E.g. `Decimal.config({ precision: 20 });`
|
|
493
|
-
precision: 20,
|
|
494
|
-
// 1 to MAX_DIGITS
|
|
495
|
-
// The rounding mode used when rounding to `precision`.
|
|
496
|
-
//
|
|
497
|
-
// ROUND_UP 0 Away from zero.
|
|
498
|
-
// ROUND_DOWN 1 Towards zero.
|
|
499
|
-
// ROUND_CEIL 2 Towards +Infinity.
|
|
500
|
-
// ROUND_FLOOR 3 Towards -Infinity.
|
|
501
|
-
// ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.
|
|
502
|
-
// ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.
|
|
503
|
-
// ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.
|
|
504
|
-
// ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.
|
|
505
|
-
// ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
|
|
506
|
-
//
|
|
507
|
-
// E.g.
|
|
508
|
-
// `Decimal.rounding = 4;`
|
|
509
|
-
// `Decimal.rounding = Decimal.ROUND_HALF_UP;`
|
|
510
|
-
rounding: 4,
|
|
511
|
-
// 0 to 8
|
|
512
|
-
// The modulo mode used when calculating the modulus: a mod n.
|
|
513
|
-
// The quotient (q = a / n) is calculated according to the corresponding rounding mode.
|
|
514
|
-
// The remainder (r) is calculated as: r = a - n * q.
|
|
515
|
-
//
|
|
516
|
-
// UP 0 The remainder is positive if the dividend is negative, else is negative.
|
|
517
|
-
// DOWN 1 The remainder has the same sign as the dividend (JavaScript %).
|
|
518
|
-
// FLOOR 3 The remainder has the same sign as the divisor (Python %).
|
|
519
|
-
// HALF_EVEN 6 The IEEE 754 remainder function.
|
|
520
|
-
// EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.
|
|
521
|
-
//
|
|
522
|
-
// Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian
|
|
523
|
-
// division (9) are commonly used for the modulus operation. The other rounding modes can also
|
|
524
|
-
// be used, but they may not give useful results.
|
|
525
|
-
modulo: 1,
|
|
526
|
-
// 0 to 9
|
|
527
|
-
// The exponent value at and beneath which `toString` returns exponential notation.
|
|
528
|
-
// JavaScript numbers: -7
|
|
529
|
-
toExpNeg: -7,
|
|
530
|
-
// 0 to -EXP_LIMIT
|
|
531
|
-
// The exponent value at and above which `toString` returns exponential notation.
|
|
532
|
-
// JavaScript numbers: 21
|
|
533
|
-
toExpPos: 21,
|
|
534
|
-
// 0 to EXP_LIMIT
|
|
535
|
-
// The minimum exponent value, beneath which underflow to zero occurs.
|
|
536
|
-
// JavaScript numbers: -324 (5e-324)
|
|
537
|
-
minE: -de,
|
|
538
|
-
// -1 to -EXP_LIMIT
|
|
539
|
-
// The maximum exponent value, above which overflow to Infinity occurs.
|
|
540
|
-
// JavaScript numbers: 308 (1.7976931348623157e+308)
|
|
541
|
-
maxE: de,
|
|
542
|
-
// 1 to EXP_LIMIT
|
|
543
|
-
// Whether to use cryptographically-secure random number generation, if available.
|
|
544
|
-
crypto: !1
|
|
545
|
-
// true/false
|
|
546
|
-
}, tt, ie, U = !0, Ne = "[DecimalError] ", ue = Ne + "Invalid argument: ", rt = Ne + "Precision limit exceeded", nt = Ne + "crypto unavailable", it = "[object Decimal]", G = Math.floor, Z = Math.pow, Bt = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, kt = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Mt = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, st = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, ee = 1e7, L = 7, At = 9007199254740991, Tt = be.length - 1, qe = $e.length - 1, N = { toStringTag: it };
|
|
547
|
-
N.absoluteValue = N.abs = function() {
|
|
548
|
-
var e = new this.constructor(this);
|
|
549
|
-
return e.s < 0 && (e.s = 1), q(e);
|
|
550
|
-
};
|
|
551
|
-
N.ceil = function() {
|
|
552
|
-
return q(new this.constructor(this), this.e + 1, 2);
|
|
553
|
-
};
|
|
554
|
-
N.clampedTo = N.clamp = function(e, t) {
|
|
555
|
-
var r, n = this, s = n.constructor;
|
|
556
|
-
if (e = new s(e), t = new s(t), !e.s || !t.s) return new s(NaN);
|
|
557
|
-
if (e.gt(t)) throw Error(ue + t);
|
|
558
|
-
return r = n.cmp(e), r < 0 ? e : n.cmp(t) > 0 ? t : new s(n);
|
|
559
|
-
};
|
|
560
|
-
N.comparedTo = N.cmp = function(e) {
|
|
561
|
-
var t, r, n, s, i = this, a = i.d, u = (e = new i.constructor(e)).d, f = i.s, o = e.s;
|
|
562
|
-
if (!a || !u)
|
|
563
|
-
return !f || !o ? NaN : f !== o ? f : a === u ? 0 : !a ^ f < 0 ? 1 : -1;
|
|
564
|
-
if (!a[0] || !u[0]) return a[0] ? f : u[0] ? -o : 0;
|
|
565
|
-
if (f !== o) return f;
|
|
566
|
-
if (i.e !== e.e) return i.e > e.e ^ f < 0 ? 1 : -1;
|
|
567
|
-
for (n = a.length, s = u.length, t = 0, r = n < s ? n : s; t < r; ++t)
|
|
568
|
-
if (a[t] !== u[t]) return a[t] > u[t] ^ f < 0 ? 1 : -1;
|
|
569
|
-
return n === s ? 0 : n > s ^ f < 0 ? 1 : -1;
|
|
570
|
-
};
|
|
571
|
-
N.cosine = N.cos = function() {
|
|
572
|
-
var e, t, r = this, n = r.constructor;
|
|
573
|
-
return r.d ? r.d[0] ? (e = n.precision, t = n.rounding, n.precision = e + Math.max(r.e, r.sd()) + L, n.rounding = 1, r = Pt(n, ct(n, r)), n.precision = e, n.rounding = t, q(ie == 2 || ie == 3 ? r.neg() : r, e, t, !0)) : new n(1) : new n(NaN);
|
|
574
|
-
};
|
|
575
|
-
N.cubeRoot = N.cbrt = function() {
|
|
576
|
-
var e, t, r, n, s, i, a, u, f, o, c = this, h = c.constructor;
|
|
577
|
-
if (!c.isFinite() || c.isZero()) return new h(c);
|
|
578
|
-
for (U = !1, i = c.s * Z(c.s * c, 1 / 3), !i || Math.abs(i) == 1 / 0 ? (r = K(c.d), e = c.e, (i = (e - r.length + 1) % 3) && (r += i == 1 || i == -2 ? "0" : "00"), i = Z(r, 1 / 3), e = G((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)), i == 1 / 0 ? r = "5e" + e : (r = i.toExponential(), r = r.slice(0, r.indexOf("e") + 1) + e), n = new h(r), n.s = c.s) : n = new h(i.toString()), a = (e = h.precision) + 3; ; )
|
|
579
|
-
if (u = n, f = u.times(u).times(u), o = f.plus(c), n = W(o.plus(c).times(u), o.plus(f), a + 2, 1), K(u.d).slice(0, a) === (r = K(n.d)).slice(0, a))
|
|
580
|
-
if (r = r.slice(a - 3, a + 1), r == "9999" || !s && r == "4999") {
|
|
581
|
-
if (!s && (q(u, e + 1, 0), u.times(u).times(u).eq(c))) {
|
|
582
|
-
n = u;
|
|
583
|
-
break;
|
|
584
|
-
}
|
|
585
|
-
a += 4, s = 1;
|
|
586
|
-
} else {
|
|
587
|
-
(!+r || !+r.slice(1) && r.charAt(0) == "5") && (q(n, e + 1, 1), t = !n.times(n).times(n).eq(c));
|
|
588
|
-
break;
|
|
589
|
-
}
|
|
590
|
-
return U = !0, q(n, e, h.rounding, t);
|
|
591
|
-
};
|
|
592
|
-
N.decimalPlaces = N.dp = function() {
|
|
593
|
-
var e, t = this.d, r = NaN;
|
|
594
|
-
if (t) {
|
|
595
|
-
if (e = t.length - 1, r = (e - G(this.e / L)) * L, e = t[e], e) for (; e % 10 == 0; e /= 10) r--;
|
|
596
|
-
r < 0 && (r = 0);
|
|
597
|
-
}
|
|
598
|
-
return r;
|
|
599
|
-
};
|
|
600
|
-
N.dividedBy = N.div = function(e) {
|
|
601
|
-
return W(this, new this.constructor(e));
|
|
602
|
-
};
|
|
603
|
-
N.dividedToIntegerBy = N.divToInt = function(e) {
|
|
604
|
-
var t = this, r = t.constructor;
|
|
605
|
-
return q(W(t, new r(e), 0, 1, 1), r.precision, r.rounding);
|
|
606
|
-
};
|
|
607
|
-
N.equals = N.eq = function(e) {
|
|
608
|
-
return this.cmp(e) === 0;
|
|
609
|
-
};
|
|
610
|
-
N.floor = function() {
|
|
611
|
-
return q(new this.constructor(this), this.e + 1, 3);
|
|
612
|
-
};
|
|
613
|
-
N.greaterThan = N.gt = function(e) {
|
|
614
|
-
return this.cmp(e) > 0;
|
|
615
|
-
};
|
|
616
|
-
N.greaterThanOrEqualTo = N.gte = function(e) {
|
|
617
|
-
var t = this.cmp(e);
|
|
618
|
-
return t == 1 || t === 0;
|
|
619
|
-
};
|
|
620
|
-
N.hyperbolicCosine = N.cosh = function() {
|
|
621
|
-
var e, t, r, n, s, i = this, a = i.constructor, u = new a(1);
|
|
622
|
-
if (!i.isFinite()) return new a(i.s ? 1 / 0 : NaN);
|
|
623
|
-
if (i.isZero()) return u;
|
|
624
|
-
r = a.precision, n = a.rounding, a.precision = r + Math.max(i.e, i.sd()) + 4, a.rounding = 1, s = i.d.length, s < 32 ? (e = Math.ceil(s / 3), t = (1 / Oe(4, e)).toString()) : (e = 16, t = "2.3283064365386962890625e-10"), i = pe(a, 1, i.times(t), new a(1), !0);
|
|
625
|
-
for (var f, o = e, c = new a(8); o--; )
|
|
626
|
-
f = i.times(i), i = u.minus(f.times(c.minus(f.times(c))));
|
|
627
|
-
return q(i, a.precision = r, a.rounding = n, !0);
|
|
628
|
-
};
|
|
629
|
-
N.hyperbolicSine = N.sinh = function() {
|
|
630
|
-
var e, t, r, n, s = this, i = s.constructor;
|
|
631
|
-
if (!s.isFinite() || s.isZero()) return new i(s);
|
|
632
|
-
if (t = i.precision, r = i.rounding, i.precision = t + Math.max(s.e, s.sd()) + 4, i.rounding = 1, n = s.d.length, n < 3)
|
|
633
|
-
s = pe(i, 2, s, s, !0);
|
|
634
|
-
else {
|
|
635
|
-
e = 1.4 * Math.sqrt(n), e = e > 16 ? 16 : e | 0, s = s.times(1 / Oe(5, e)), s = pe(i, 2, s, s, !0);
|
|
636
|
-
for (var a, u = new i(5), f = new i(16), o = new i(20); e--; )
|
|
637
|
-
a = s.times(s), s = s.times(u.plus(a.times(f.times(a).plus(o))));
|
|
638
|
-
}
|
|
639
|
-
return i.precision = t, i.rounding = r, q(s, t, r, !0);
|
|
640
|
-
};
|
|
641
|
-
N.hyperbolicTangent = N.tanh = function() {
|
|
642
|
-
var e, t, r = this, n = r.constructor;
|
|
643
|
-
return r.isFinite() ? r.isZero() ? new n(r) : (e = n.precision, t = n.rounding, n.precision = e + 7, n.rounding = 1, W(r.sinh(), r.cosh(), n.precision = e, n.rounding = t)) : new n(r.s);
|
|
644
|
-
};
|
|
645
|
-
N.inverseCosine = N.acos = function() {
|
|
646
|
-
var e = this, t = e.constructor, r = e.abs().cmp(1), n = t.precision, s = t.rounding;
|
|
647
|
-
return r !== -1 ? r === 0 ? e.isNeg() ? te(t, n, s) : new t(0) : new t(NaN) : e.isZero() ? te(t, n + 4, s).times(0.5) : (t.precision = n + 6, t.rounding = 1, e = new t(1).minus(e).div(e.plus(1)).sqrt().atan(), t.precision = n, t.rounding = s, e.times(2));
|
|
648
|
-
};
|
|
649
|
-
N.inverseHyperbolicCosine = N.acosh = function() {
|
|
650
|
-
var e, t, r = this, n = r.constructor;
|
|
651
|
-
return r.lte(1) ? new n(r.eq(1) ? 0 : NaN) : r.isFinite() ? (e = n.precision, t = n.rounding, n.precision = e + Math.max(Math.abs(r.e), r.sd()) + 4, n.rounding = 1, U = !1, r = r.times(r).minus(1).sqrt().plus(r), U = !0, n.precision = e, n.rounding = t, r.ln()) : new n(r);
|
|
652
|
-
};
|
|
653
|
-
N.inverseHyperbolicSine = N.asinh = function() {
|
|
654
|
-
var e, t, r = this, n = r.constructor;
|
|
655
|
-
return !r.isFinite() || r.isZero() ? new n(r) : (e = n.precision, t = n.rounding, n.precision = e + 2 * Math.max(Math.abs(r.e), r.sd()) + 6, n.rounding = 1, U = !1, r = r.times(r).plus(1).sqrt().plus(r), U = !0, n.precision = e, n.rounding = t, r.ln());
|
|
656
|
-
};
|
|
657
|
-
N.inverseHyperbolicTangent = N.atanh = function() {
|
|
658
|
-
var e, t, r, n, s = this, i = s.constructor;
|
|
659
|
-
return s.isFinite() ? s.e >= 0 ? new i(s.abs().eq(1) ? s.s / 0 : s.isZero() ? s : NaN) : (e = i.precision, t = i.rounding, n = s.sd(), Math.max(n, e) < 2 * -s.e - 1 ? q(new i(s), e, t, !0) : (i.precision = r = n - s.e, s = W(s.plus(1), new i(1).minus(s), r + e, 1), i.precision = e + 4, i.rounding = 1, s = s.ln(), i.precision = e, i.rounding = t, s.times(0.5))) : new i(NaN);
|
|
660
|
-
};
|
|
661
|
-
N.inverseSine = N.asin = function() {
|
|
662
|
-
var e, t, r, n, s = this, i = s.constructor;
|
|
663
|
-
return s.isZero() ? new i(s) : (t = s.abs().cmp(1), r = i.precision, n = i.rounding, t !== -1 ? t === 0 ? (e = te(i, r + 4, n).times(0.5), e.s = s.s, e) : new i(NaN) : (i.precision = r + 6, i.rounding = 1, s = s.div(new i(1).minus(s.times(s)).sqrt().plus(1)).atan(), i.precision = r, i.rounding = n, s.times(2)));
|
|
664
|
-
};
|
|
665
|
-
N.inverseTangent = N.atan = function() {
|
|
666
|
-
var e, t, r, n, s, i, a, u, f, o = this, c = o.constructor, h = c.precision, l = c.rounding;
|
|
667
|
-
if (o.isFinite()) {
|
|
668
|
-
if (o.isZero())
|
|
669
|
-
return new c(o);
|
|
670
|
-
if (o.abs().eq(1) && h + 4 <= qe)
|
|
671
|
-
return a = te(c, h + 4, l).times(0.25), a.s = o.s, a;
|
|
672
|
-
} else {
|
|
673
|
-
if (!o.s) return new c(NaN);
|
|
674
|
-
if (h + 4 <= qe)
|
|
675
|
-
return a = te(c, h + 4, l).times(0.5), a.s = o.s, a;
|
|
676
|
-
}
|
|
677
|
-
for (c.precision = u = h + 10, c.rounding = 1, r = Math.min(28, u / L + 2 | 0), e = r; e; --e) o = o.div(o.times(o).plus(1).sqrt().plus(1));
|
|
678
|
-
for (U = !1, t = Math.ceil(u / L), n = 1, f = o.times(o), a = new c(o), s = o; e !== -1; )
|
|
679
|
-
if (s = s.times(f), i = a.minus(s.div(n += 2)), s = s.times(f), a = i.plus(s.div(n += 2)), a.d[t] !== void 0) for (e = t; a.d[e] === i.d[e] && e--; ) ;
|
|
680
|
-
return r && (a = a.times(2 << r - 1)), U = !0, q(a, c.precision = h, c.rounding = l, !0);
|
|
681
|
-
};
|
|
682
|
-
N.isFinite = function() {
|
|
683
|
-
return !!this.d;
|
|
684
|
-
};
|
|
685
|
-
N.isInteger = N.isInt = function() {
|
|
686
|
-
return !!this.d && G(this.e / L) > this.d.length - 2;
|
|
687
|
-
};
|
|
688
|
-
N.isNaN = function() {
|
|
689
|
-
return !this.s;
|
|
690
|
-
};
|
|
691
|
-
N.isNegative = N.isNeg = function() {
|
|
692
|
-
return this.s < 0;
|
|
693
|
-
};
|
|
694
|
-
N.isPositive = N.isPos = function() {
|
|
695
|
-
return this.s > 0;
|
|
696
|
-
};
|
|
697
|
-
N.isZero = function() {
|
|
698
|
-
return !!this.d && this.d[0] === 0;
|
|
699
|
-
};
|
|
700
|
-
N.lessThan = N.lt = function(e) {
|
|
701
|
-
return this.cmp(e) < 0;
|
|
702
|
-
};
|
|
703
|
-
N.lessThanOrEqualTo = N.lte = function(e) {
|
|
704
|
-
return this.cmp(e) < 1;
|
|
705
|
-
};
|
|
706
|
-
N.logarithm = N.log = function(e) {
|
|
707
|
-
var t, r, n, s, i, a, u, f, o = this, c = o.constructor, h = c.precision, l = c.rounding, m = 5;
|
|
708
|
-
if (e == null)
|
|
709
|
-
e = new c(10), t = !0;
|
|
710
|
-
else {
|
|
711
|
-
if (e = new c(e), r = e.d, e.s < 0 || !r || !r[0] || e.eq(1)) return new c(NaN);
|
|
712
|
-
t = e.eq(10);
|
|
713
|
-
}
|
|
714
|
-
if (r = o.d, o.s < 0 || !r || !r[0] || o.eq(1))
|
|
715
|
-
return new c(r && !r[0] ? -1 / 0 : o.s != 1 ? NaN : r ? 0 : 1 / 0);
|
|
716
|
-
if (t)
|
|
717
|
-
if (r.length > 1)
|
|
718
|
-
i = !0;
|
|
719
|
-
else {
|
|
720
|
-
for (s = r[0]; s % 10 === 0; ) s /= 10;
|
|
721
|
-
i = s !== 1;
|
|
722
|
-
}
|
|
723
|
-
if (U = !1, u = h + m, a = ae(o, u), n = t ? Ce(c, u + 10) : ae(e, u), f = W(a, n, u, 1), me(f.d, s = h, l))
|
|
724
|
-
do
|
|
725
|
-
if (u += 10, a = ae(o, u), n = t ? Ce(c, u + 10) : ae(e, u), f = W(a, n, u, 1), !i) {
|
|
726
|
-
+K(f.d).slice(s + 1, s + 15) + 1 == 1e14 && (f = q(f, h + 1, 0));
|
|
727
|
-
break;
|
|
728
|
-
}
|
|
729
|
-
while (me(f.d, s += 10, l));
|
|
730
|
-
return U = !0, q(f, h, l);
|
|
731
|
-
};
|
|
732
|
-
N.minus = N.sub = function(e) {
|
|
733
|
-
var t, r, n, s, i, a, u, f, o, c, h, l, m = this, b = m.constructor;
|
|
734
|
-
if (e = new b(e), !m.d || !e.d)
|
|
735
|
-
return !m.s || !e.s ? e = new b(NaN) : m.d ? e.s = -e.s : e = new b(e.d || m.s !== e.s ? m : NaN), e;
|
|
736
|
-
if (m.s != e.s)
|
|
737
|
-
return e.s = -e.s, m.plus(e);
|
|
738
|
-
if (o = m.d, l = e.d, u = b.precision, f = b.rounding, !o[0] || !l[0]) {
|
|
739
|
-
if (l[0]) e.s = -e.s;
|
|
740
|
-
else if (o[0]) e = new b(m);
|
|
741
|
-
else return new b(f === 3 ? -0 : 0);
|
|
742
|
-
return U ? q(e, u, f) : e;
|
|
743
|
-
}
|
|
744
|
-
if (r = G(e.e / L), c = G(m.e / L), o = o.slice(), i = c - r, i) {
|
|
745
|
-
for (h = i < 0, h ? (t = o, i = -i, a = l.length) : (t = l, r = c, a = o.length), n = Math.max(Math.ceil(u / L), a) + 2, i > n && (i = n, t.length = 1), t.reverse(), n = i; n--; ) t.push(0);
|
|
746
|
-
t.reverse();
|
|
747
|
-
} else {
|
|
748
|
-
for (n = o.length, a = l.length, h = n < a, h && (a = n), n = 0; n < a; n++)
|
|
749
|
-
if (o[n] != l[n]) {
|
|
750
|
-
h = o[n] < l[n];
|
|
751
|
-
break;
|
|
752
|
-
}
|
|
753
|
-
i = 0;
|
|
754
|
-
}
|
|
755
|
-
for (h && (t = o, o = l, l = t, e.s = -e.s), a = o.length, n = l.length - a; n > 0; --n) o[a++] = 0;
|
|
756
|
-
for (n = l.length; n > i; ) {
|
|
757
|
-
if (o[--n] < l[n]) {
|
|
758
|
-
for (s = n; s && o[--s] === 0; ) o[s] = ee - 1;
|
|
759
|
-
--o[s], o[n] += ee;
|
|
760
|
-
}
|
|
761
|
-
o[n] -= l[n];
|
|
762
|
-
}
|
|
763
|
-
for (; o[--a] === 0; ) o.pop();
|
|
764
|
-
for (; o[0] === 0; o.shift()) --r;
|
|
765
|
-
return o[0] ? (e.d = o, e.e = De(o, r), U ? q(e, u, f) : e) : new b(f === 3 ? -0 : 0);
|
|
766
|
-
};
|
|
767
|
-
N.modulo = N.mod = function(e) {
|
|
768
|
-
var t, r = this, n = r.constructor;
|
|
769
|
-
return e = new n(e), !r.d || !e.s || e.d && !e.d[0] ? new n(NaN) : !e.d || r.d && !r.d[0] ? q(new n(r), n.precision, n.rounding) : (U = !1, n.modulo == 9 ? (t = W(r, e.abs(), 0, 3, 1), t.s *= e.s) : t = W(r, e, 0, n.modulo, 1), t = t.times(e), U = !0, r.minus(t));
|
|
770
|
-
};
|
|
771
|
-
N.naturalExponential = N.exp = function() {
|
|
772
|
-
return Fe(this);
|
|
773
|
-
};
|
|
774
|
-
N.naturalLogarithm = N.ln = function() {
|
|
775
|
-
return ae(this);
|
|
776
|
-
};
|
|
777
|
-
N.negated = N.neg = function() {
|
|
778
|
-
var e = new this.constructor(this);
|
|
779
|
-
return e.s = -e.s, q(e);
|
|
780
|
-
};
|
|
781
|
-
N.plus = N.add = function(e) {
|
|
782
|
-
var t, r, n, s, i, a, u, f, o, c, h = this, l = h.constructor;
|
|
783
|
-
if (e = new l(e), !h.d || !e.d)
|
|
784
|
-
return !h.s || !e.s ? e = new l(NaN) : h.d || (e = new l(e.d || h.s === e.s ? h : NaN)), e;
|
|
785
|
-
if (h.s != e.s)
|
|
786
|
-
return e.s = -e.s, h.minus(e);
|
|
787
|
-
if (o = h.d, c = e.d, u = l.precision, f = l.rounding, !o[0] || !c[0])
|
|
788
|
-
return c[0] || (e = new l(h)), U ? q(e, u, f) : e;
|
|
789
|
-
if (i = G(h.e / L), n = G(e.e / L), o = o.slice(), s = i - n, s) {
|
|
790
|
-
for (s < 0 ? (r = o, s = -s, a = c.length) : (r = c, n = i, a = o.length), i = Math.ceil(u / L), a = i > a ? i + 1 : a + 1, s > a && (s = a, r.length = 1), r.reverse(); s--; ) r.push(0);
|
|
791
|
-
r.reverse();
|
|
792
|
-
}
|
|
793
|
-
for (a = o.length, s = c.length, a - s < 0 && (s = a, r = c, c = o, o = r), t = 0; s; )
|
|
794
|
-
t = (o[--s] = o[s] + c[s] + t) / ee | 0, o[s] %= ee;
|
|
795
|
-
for (t && (o.unshift(t), ++n), a = o.length; o[--a] == 0; ) o.pop();
|
|
796
|
-
return e.d = o, e.e = De(o, n), U ? q(e, u, f) : e;
|
|
797
|
-
};
|
|
798
|
-
N.precision = N.sd = function(e) {
|
|
799
|
-
var t, r = this;
|
|
800
|
-
if (e !== void 0 && e !== !!e && e !== 1 && e !== 0) throw Error(ue + e);
|
|
801
|
-
return r.d ? (t = ot(r.d), e && r.e + 1 > t && (t = r.e + 1)) : t = NaN, t;
|
|
802
|
-
};
|
|
803
|
-
N.round = function() {
|
|
804
|
-
var e = this, t = e.constructor;
|
|
805
|
-
return q(new t(e), e.e + 1, t.rounding);
|
|
806
|
-
};
|
|
807
|
-
N.sine = N.sin = function() {
|
|
808
|
-
var e, t, r = this, n = r.constructor;
|
|
809
|
-
return r.isFinite() ? r.isZero() ? new n(r) : (e = n.precision, t = n.rounding, n.precision = e + Math.max(r.e, r.sd()) + L, n.rounding = 1, r = Ht(n, ct(n, r)), n.precision = e, n.rounding = t, q(ie > 2 ? r.neg() : r, e, t, !0)) : new n(NaN);
|
|
810
|
-
};
|
|
811
|
-
N.squareRoot = N.sqrt = function() {
|
|
812
|
-
var e, t, r, n, s, i, a = this, u = a.d, f = a.e, o = a.s, c = a.constructor;
|
|
813
|
-
if (o !== 1 || !u || !u[0])
|
|
814
|
-
return new c(!o || o < 0 && (!u || u[0]) ? NaN : u ? a : 1 / 0);
|
|
815
|
-
for (U = !1, o = Math.sqrt(+a), o == 0 || o == 1 / 0 ? (t = K(u), (t.length + f) % 2 == 0 && (t += "0"), o = Math.sqrt(t), f = G((f + 1) / 2) - (f < 0 || f % 2), o == 1 / 0 ? t = "5e" + f : (t = o.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + f), n = new c(t)) : n = new c(o.toString()), r = (f = c.precision) + 3; ; )
|
|
816
|
-
if (i = n, n = i.plus(W(a, i, r + 2, 1)).times(0.5), K(i.d).slice(0, r) === (t = K(n.d)).slice(0, r))
|
|
817
|
-
if (t = t.slice(r - 3, r + 1), t == "9999" || !s && t == "4999") {
|
|
818
|
-
if (!s && (q(i, f + 1, 0), i.times(i).eq(a))) {
|
|
819
|
-
n = i;
|
|
820
|
-
break;
|
|
821
|
-
}
|
|
822
|
-
r += 4, s = 1;
|
|
823
|
-
} else {
|
|
824
|
-
(!+t || !+t.slice(1) && t.charAt(0) == "5") && (q(n, f + 1, 1), e = !n.times(n).eq(a));
|
|
825
|
-
break;
|
|
826
|
-
}
|
|
827
|
-
return U = !0, q(n, f, c.rounding, e);
|
|
828
|
-
};
|
|
829
|
-
N.tangent = N.tan = function() {
|
|
830
|
-
var e, t, r = this, n = r.constructor;
|
|
831
|
-
return r.isFinite() ? r.isZero() ? new n(r) : (e = n.precision, t = n.rounding, n.precision = e + 10, n.rounding = 1, r = r.sin(), r.s = 1, r = W(r, new n(1).minus(r.times(r)).sqrt(), e + 10, 0), n.precision = e, n.rounding = t, q(ie == 2 || ie == 4 ? r.neg() : r, e, t, !0)) : new n(NaN);
|
|
832
|
-
};
|
|
833
|
-
N.times = N.mul = function(e) {
|
|
834
|
-
var t, r, n, s, i, a, u, f, o, c = this, h = c.constructor, l = c.d, m = (e = new h(e)).d;
|
|
835
|
-
if (e.s *= c.s, !l || !l[0] || !m || !m[0])
|
|
836
|
-
return new h(!e.s || l && !l[0] && !m || m && !m[0] && !l ? NaN : !l || !m ? e.s / 0 : e.s * 0);
|
|
837
|
-
for (r = G(c.e / L) + G(e.e / L), f = l.length, o = m.length, f < o && (i = l, l = m, m = i, a = f, f = o, o = a), i = [], a = f + o, n = a; n--; ) i.push(0);
|
|
838
|
-
for (n = o; --n >= 0; ) {
|
|
839
|
-
for (t = 0, s = f + n; s > n; )
|
|
840
|
-
u = i[s] + m[n] * l[s - n - 1] + t, i[s--] = u % ee | 0, t = u / ee | 0;
|
|
841
|
-
i[s] = (i[s] + t) % ee | 0;
|
|
842
|
-
}
|
|
843
|
-
for (; !i[--a]; ) i.pop();
|
|
844
|
-
return t ? ++r : i.shift(), e.d = i, e.e = De(i, r), U ? q(e, h.precision, h.rounding) : e;
|
|
845
|
-
};
|
|
846
|
-
N.toBinary = function(e, t) {
|
|
847
|
-
return Le(this, 2, e, t);
|
|
848
|
-
};
|
|
849
|
-
N.toDecimalPlaces = N.toDP = function(e, t) {
|
|
850
|
-
var r = this, n = r.constructor;
|
|
851
|
-
return r = new n(r), e === void 0 ? r : (J(e, 0, fe), t === void 0 ? t = n.rounding : J(t, 0, 8), q(r, e + r.e + 1, t));
|
|
852
|
-
};
|
|
853
|
-
N.toExponential = function(e, t) {
|
|
854
|
-
var r, n = this, s = n.constructor;
|
|
855
|
-
return e === void 0 ? r = re(n, !0) : (J(e, 0, fe), t === void 0 ? t = s.rounding : J(t, 0, 8), n = q(new s(n), e + 1, t), r = re(n, !0, e + 1)), n.isNeg() && !n.isZero() ? "-" + r : r;
|
|
856
|
-
};
|
|
857
|
-
N.toFixed = function(e, t) {
|
|
858
|
-
var r, n, s = this, i = s.constructor;
|
|
859
|
-
return e === void 0 ? r = re(s) : (J(e, 0, fe), t === void 0 ? t = i.rounding : J(t, 0, 8), n = q(new i(s), e + s.e + 1, t), r = re(n, !1, e + n.e + 1)), s.isNeg() && !s.isZero() ? "-" + r : r;
|
|
860
|
-
};
|
|
861
|
-
N.toFraction = function(e) {
|
|
862
|
-
var t, r, n, s, i, a, u, f, o, c, h, l, m = this, b = m.d, p = m.constructor;
|
|
863
|
-
if (!b) return new p(m);
|
|
864
|
-
if (o = r = new p(1), n = f = new p(0), t = new p(n), i = t.e = ot(b) - m.e - 1, a = i % L, t.d[0] = Z(10, a < 0 ? L + a : a), e == null)
|
|
865
|
-
e = i > 0 ? t : o;
|
|
866
|
-
else {
|
|
867
|
-
if (u = new p(e), !u.isInt() || u.lt(o)) throw Error(ue + u);
|
|
868
|
-
e = u.gt(t) ? i > 0 ? t : o : u;
|
|
869
|
-
}
|
|
870
|
-
for (U = !1, u = new p(K(b)), c = p.precision, p.precision = i = b.length * L * 2; h = W(u, t, 0, 1, 1), s = r.plus(h.times(n)), s.cmp(e) != 1; )
|
|
871
|
-
r = n, n = s, s = o, o = f.plus(h.times(s)), f = s, s = t, t = u.minus(h.times(s)), u = s;
|
|
872
|
-
return s = W(e.minus(r), n, 0, 1, 1), f = f.plus(s.times(o)), r = r.plus(s.times(n)), f.s = o.s = m.s, l = W(o, n, i, 1).minus(m).abs().cmp(W(f, r, i, 1).minus(m).abs()) < 1 ? [o, n] : [f, r], p.precision = c, U = !0, l;
|
|
873
|
-
};
|
|
874
|
-
N.toHexadecimal = N.toHex = function(e, t) {
|
|
875
|
-
return Le(this, 16, e, t);
|
|
876
|
-
};
|
|
877
|
-
N.toNearest = function(e, t) {
|
|
878
|
-
var r = this, n = r.constructor;
|
|
879
|
-
if (r = new n(r), e == null) {
|
|
880
|
-
if (!r.d) return r;
|
|
881
|
-
e = new n(1), t = n.rounding;
|
|
882
|
-
} else {
|
|
883
|
-
if (e = new n(e), t === void 0 ? t = n.rounding : J(t, 0, 8), !r.d) return e.s ? r : e;
|
|
884
|
-
if (!e.d)
|
|
885
|
-
return e.s && (e.s = r.s), e;
|
|
886
|
-
}
|
|
887
|
-
return e.d[0] ? (U = !1, r = W(r, e, 0, t, 1).times(e), U = !0, q(r)) : (e.s = r.s, r = e), r;
|
|
888
|
-
};
|
|
889
|
-
N.toNumber = function() {
|
|
890
|
-
return +this;
|
|
891
|
-
};
|
|
892
|
-
N.toOctal = function(e, t) {
|
|
893
|
-
return Le(this, 8, e, t);
|
|
894
|
-
};
|
|
895
|
-
N.toPower = N.pow = function(e) {
|
|
896
|
-
var t, r, n, s, i, a, u = this, f = u.constructor, o = +(e = new f(e));
|
|
897
|
-
if (!u.d || !e.d || !u.d[0] || !e.d[0]) return new f(Z(+u, o));
|
|
898
|
-
if (u = new f(u), u.eq(1)) return u;
|
|
899
|
-
if (n = f.precision, i = f.rounding, e.eq(1)) return q(u, n, i);
|
|
900
|
-
if (t = G(e.e / L), t >= e.d.length - 1 && (r = o < 0 ? -o : o) <= At)
|
|
901
|
-
return s = at(f, u, r, n), e.s < 0 ? new f(1).div(s) : q(s, n, i);
|
|
902
|
-
if (a = u.s, a < 0) {
|
|
903
|
-
if (t < e.d.length - 1) return new f(NaN);
|
|
904
|
-
if (e.d[t] & 1 || (a = 1), u.e == 0 && u.d[0] == 1 && u.d.length == 1)
|
|
905
|
-
return u.s = a, u;
|
|
906
|
-
}
|
|
907
|
-
return r = Z(+u, o), t = r == 0 || !isFinite(r) ? G(o * (Math.log("0." + K(u.d)) / Math.LN10 + u.e + 1)) : new f(r + "").e, t > f.maxE + 1 || t < f.minE - 1 ? new f(t > 0 ? a / 0 : 0) : (U = !1, f.rounding = u.s = 1, r = Math.min(12, (t + "").length), s = Fe(e.times(ae(u, n + r)), n), s.d && (s = q(s, n + 5, 1), me(s.d, n, i) && (t = n + 10, s = q(Fe(e.times(ae(u, t + r)), t), t + 5, 1), +K(s.d).slice(n + 1, n + 15) + 1 == 1e14 && (s = q(s, n + 1, 0)))), s.s = a, U = !0, f.rounding = i, q(s, n, i));
|
|
908
|
-
};
|
|
909
|
-
N.toPrecision = function(e, t) {
|
|
910
|
-
var r, n = this, s = n.constructor;
|
|
911
|
-
return e === void 0 ? r = re(n, n.e <= s.toExpNeg || n.e >= s.toExpPos) : (J(e, 1, fe), t === void 0 ? t = s.rounding : J(t, 0, 8), n = q(new s(n), e, t), r = re(n, e <= n.e || n.e <= s.toExpNeg, e)), n.isNeg() && !n.isZero() ? "-" + r : r;
|
|
912
|
-
};
|
|
913
|
-
N.toSignificantDigits = N.toSD = function(e, t) {
|
|
914
|
-
var r = this, n = r.constructor;
|
|
915
|
-
return e === void 0 ? (e = n.precision, t = n.rounding) : (J(e, 1, fe), t === void 0 ? t = n.rounding : J(t, 0, 8)), q(new n(r), e, t);
|
|
916
|
-
};
|
|
917
|
-
N.toString = function() {
|
|
918
|
-
var e = this, t = e.constructor, r = re(e, e.e <= t.toExpNeg || e.e >= t.toExpPos);
|
|
919
|
-
return e.isNeg() && !e.isZero() ? "-" + r : r;
|
|
920
|
-
};
|
|
921
|
-
N.truncated = N.trunc = function() {
|
|
922
|
-
return q(new this.constructor(this), this.e + 1, 1);
|
|
923
|
-
};
|
|
924
|
-
N.valueOf = N.toJSON = function() {
|
|
925
|
-
var e = this, t = e.constructor, r = re(e, e.e <= t.toExpNeg || e.e >= t.toExpPos);
|
|
926
|
-
return e.isNeg() ? "-" + r : r;
|
|
927
|
-
};
|
|
928
|
-
function K(e) {
|
|
929
|
-
var t, r, n, s = e.length - 1, i = "", a = e[0];
|
|
930
|
-
if (s > 0) {
|
|
931
|
-
for (i += a, t = 1; t < s; t++)
|
|
932
|
-
n = e[t] + "", r = L - n.length, r && (i += oe(r)), i += n;
|
|
933
|
-
a = e[t], n = a + "", r = L - n.length, r && (i += oe(r));
|
|
934
|
-
} else if (a === 0)
|
|
935
|
-
return "0";
|
|
936
|
-
for (; a % 10 === 0; ) a /= 10;
|
|
937
|
-
return i + a;
|
|
938
|
-
}
|
|
939
|
-
function J(e, t, r) {
|
|
940
|
-
if (e !== ~~e || e < t || e > r)
|
|
941
|
-
throw Error(ue + e);
|
|
942
|
-
}
|
|
943
|
-
function me(e, t, r, n) {
|
|
944
|
-
var s, i, a, u;
|
|
945
|
-
for (i = e[0]; i >= 10; i /= 10) --t;
|
|
946
|
-
return --t < 0 ? (t += L, s = 0) : (s = Math.ceil((t + 1) / L), t %= L), i = Z(10, L - t), u = e[s] % i | 0, n == null ? t < 3 ? (t == 0 ? u = u / 100 | 0 : t == 1 && (u = u / 10 | 0), a = r < 4 && u == 99999 || r > 3 && u == 49999 || u == 5e4 || u == 0) : a = (r < 4 && u + 1 == i || r > 3 && u + 1 == i / 2) && (e[s + 1] / i / 100 | 0) == Z(10, t - 2) - 1 || (u == i / 2 || u == 0) && (e[s + 1] / i / 100 | 0) == 0 : t < 4 ? (t == 0 ? u = u / 1e3 | 0 : t == 1 ? u = u / 100 | 0 : t == 2 && (u = u / 10 | 0), a = (n || r < 4) && u == 9999 || !n && r > 3 && u == 4999) : a = ((n || r < 4) && u + 1 == i || !n && r > 3 && u + 1 == i / 2) && (e[s + 1] / i / 1e3 | 0) == Z(10, t - 3) - 1, a;
|
|
947
|
-
}
|
|
948
|
-
function ye(e, t, r) {
|
|
949
|
-
for (var n, s = [0], i, a = 0, u = e.length; a < u; ) {
|
|
950
|
-
for (i = s.length; i--; ) s[i] *= t;
|
|
951
|
-
for (s[0] += ze.indexOf(e.charAt(a++)), n = 0; n < s.length; n++)
|
|
952
|
-
s[n] > r - 1 && (s[n + 1] === void 0 && (s[n + 1] = 0), s[n + 1] += s[n] / r | 0, s[n] %= r);
|
|
953
|
-
}
|
|
954
|
-
return s.reverse();
|
|
955
|
-
}
|
|
956
|
-
function Pt(e, t) {
|
|
957
|
-
var r, n, s;
|
|
958
|
-
if (t.isZero()) return t;
|
|
959
|
-
n = t.d.length, n < 32 ? (r = Math.ceil(n / 3), s = (1 / Oe(4, r)).toString()) : (r = 16, s = "2.3283064365386962890625e-10"), e.precision += r, t = pe(e, 1, t.times(s), new e(1));
|
|
960
|
-
for (var i = r; i--; ) {
|
|
961
|
-
var a = t.times(t);
|
|
962
|
-
t = a.times(a).minus(a).times(8).plus(1);
|
|
963
|
-
}
|
|
964
|
-
return e.precision -= r, t;
|
|
965
|
-
}
|
|
966
|
-
var W = /* @__PURE__ */ function() {
|
|
967
|
-
function e(n, s, i) {
|
|
968
|
-
var a, u = 0, f = n.length;
|
|
969
|
-
for (n = n.slice(); f--; )
|
|
970
|
-
a = n[f] * s + u, n[f] = a % i | 0, u = a / i | 0;
|
|
971
|
-
return u && n.unshift(u), n;
|
|
972
|
-
}
|
|
973
|
-
function t(n, s, i, a) {
|
|
974
|
-
var u, f;
|
|
975
|
-
if (i != a)
|
|
976
|
-
f = i > a ? 1 : -1;
|
|
977
|
-
else
|
|
978
|
-
for (u = f = 0; u < i; u++)
|
|
979
|
-
if (n[u] != s[u]) {
|
|
980
|
-
f = n[u] > s[u] ? 1 : -1;
|
|
981
|
-
break;
|
|
982
|
-
}
|
|
983
|
-
return f;
|
|
984
|
-
}
|
|
985
|
-
function r(n, s, i, a) {
|
|
986
|
-
for (var u = 0; i--; )
|
|
987
|
-
n[i] -= u, u = n[i] < s[i] ? 1 : 0, n[i] = u * a + n[i] - s[i];
|
|
988
|
-
for (; !n[0] && n.length > 1; ) n.shift();
|
|
989
|
-
}
|
|
990
|
-
return function(n, s, i, a, u, f) {
|
|
991
|
-
var o, c, h, l, m, b, p, C, T, g, d, _, O, M, H, I, F, v, w, A, k = n.constructor, B = n.s == s.s ? 1 : -1, x = n.d, y = s.d;
|
|
992
|
-
if (!x || !x[0] || !y || !y[0])
|
|
993
|
-
return new k(
|
|
994
|
-
// Return NaN if either NaN, or both Infinity or 0.
|
|
995
|
-
!n.s || !s.s || (x ? y && x[0] == y[0] : !y) ? NaN : (
|
|
996
|
-
// Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
|
|
997
|
-
x && x[0] == 0 || !y ? B * 0 : B / 0
|
|
998
|
-
)
|
|
999
|
-
);
|
|
1000
|
-
for (f ? (m = 1, c = n.e - s.e) : (f = ee, m = L, c = G(n.e / m) - G(s.e / m)), w = y.length, F = x.length, T = new k(B), g = T.d = [], h = 0; y[h] == (x[h] || 0); h++) ;
|
|
1001
|
-
if (y[h] > (x[h] || 0) && c--, i == null ? (M = i = k.precision, a = k.rounding) : u ? M = i + (n.e - s.e) + 1 : M = i, M < 0)
|
|
1002
|
-
g.push(1), b = !0;
|
|
1003
|
-
else {
|
|
1004
|
-
if (M = M / m + 2 | 0, h = 0, w == 1) {
|
|
1005
|
-
for (l = 0, y = y[0], M++; (h < F || l) && M--; h++)
|
|
1006
|
-
H = l * f + (x[h] || 0), g[h] = H / y | 0, l = H % y | 0;
|
|
1007
|
-
b = l || h < F;
|
|
1008
|
-
} else {
|
|
1009
|
-
for (l = f / (y[0] + 1) | 0, l > 1 && (y = e(y, l, f), x = e(x, l, f), w = y.length, F = x.length), I = w, d = x.slice(0, w), _ = d.length; _ < w; ) d[_++] = 0;
|
|
1010
|
-
A = y.slice(), A.unshift(0), v = y[0], y[1] >= f / 2 && ++v;
|
|
1011
|
-
do
|
|
1012
|
-
l = 0, o = t(y, d, w, _), o < 0 ? (O = d[0], w != _ && (O = O * f + (d[1] || 0)), l = O / v | 0, l > 1 ? (l >= f && (l = f - 1), p = e(y, l, f), C = p.length, _ = d.length, o = t(p, d, C, _), o == 1 && (l--, r(p, w < C ? A : y, C, f))) : (l == 0 && (o = l = 1), p = y.slice()), C = p.length, C < _ && p.unshift(0), r(d, p, _, f), o == -1 && (_ = d.length, o = t(y, d, w, _), o < 1 && (l++, r(d, w < _ ? A : y, _, f))), _ = d.length) : o === 0 && (l++, d = [0]), g[h++] = l, o && d[0] ? d[_++] = x[I] || 0 : (d = [x[I]], _ = 1);
|
|
1013
|
-
while ((I++ < F || d[0] !== void 0) && M--);
|
|
1014
|
-
b = d[0] !== void 0;
|
|
1015
|
-
}
|
|
1016
|
-
g[0] || g.shift();
|
|
1017
|
-
}
|
|
1018
|
-
if (m == 1)
|
|
1019
|
-
T.e = c, tt = b;
|
|
1020
|
-
else {
|
|
1021
|
-
for (h = 1, l = g[0]; l >= 10; l /= 10) h++;
|
|
1022
|
-
T.e = h + c * m - 1, q(T, u ? i + T.e + 1 : i, a, b);
|
|
1023
|
-
}
|
|
1024
|
-
return T;
|
|
1025
|
-
};
|
|
1026
|
-
}();
|
|
1027
|
-
function q(e, t, r, n) {
|
|
1028
|
-
var s, i, a, u, f, o, c, h, l, m = e.constructor;
|
|
1029
|
-
e: if (t != null) {
|
|
1030
|
-
if (h = e.d, !h) return e;
|
|
1031
|
-
for (s = 1, u = h[0]; u >= 10; u /= 10) s++;
|
|
1032
|
-
if (i = t - s, i < 0)
|
|
1033
|
-
i += L, a = t, c = h[l = 0], f = c / Z(10, s - a - 1) % 10 | 0;
|
|
1034
|
-
else if (l = Math.ceil((i + 1) / L), u = h.length, l >= u)
|
|
1035
|
-
if (n) {
|
|
1036
|
-
for (; u++ <= l; ) h.push(0);
|
|
1037
|
-
c = f = 0, s = 1, i %= L, a = i - L + 1;
|
|
1038
|
-
} else
|
|
1039
|
-
break e;
|
|
1040
|
-
else {
|
|
1041
|
-
for (c = u = h[l], s = 1; u >= 10; u /= 10) s++;
|
|
1042
|
-
i %= L, a = i - L + s, f = a < 0 ? 0 : c / Z(10, s - a - 1) % 10 | 0;
|
|
1043
|
-
}
|
|
1044
|
-
if (n = n || t < 0 || h[l + 1] !== void 0 || (a < 0 ? c : c % Z(10, s - a - 1)), o = r < 4 ? (f || n) && (r == 0 || r == (e.s < 0 ? 3 : 2)) : f > 5 || f == 5 && (r == 4 || n || r == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
1045
|
-
(i > 0 ? a > 0 ? c / Z(10, s - a) : 0 : h[l - 1]) % 10 & 1 || r == (e.s < 0 ? 8 : 7)), t < 1 || !h[0])
|
|
1046
|
-
return h.length = 0, o ? (t -= e.e + 1, h[0] = Z(10, (L - t % L) % L), e.e = -t || 0) : h[0] = e.e = 0, e;
|
|
1047
|
-
if (i == 0 ? (h.length = l, u = 1, l--) : (h.length = l + 1, u = Z(10, L - i), h[l] = a > 0 ? (c / Z(10, s - a) % Z(10, a) | 0) * u : 0), o)
|
|
1048
|
-
for (; ; )
|
|
1049
|
-
if (l == 0) {
|
|
1050
|
-
for (i = 1, a = h[0]; a >= 10; a /= 10) i++;
|
|
1051
|
-
for (a = h[0] += u, u = 1; a >= 10; a /= 10) u++;
|
|
1052
|
-
i != u && (e.e++, h[0] == ee && (h[0] = 1));
|
|
1053
|
-
break;
|
|
1054
|
-
} else {
|
|
1055
|
-
if (h[l] += u, h[l] != ee) break;
|
|
1056
|
-
h[l--] = 0, u = 1;
|
|
1057
|
-
}
|
|
1058
|
-
for (i = h.length; h[--i] === 0; ) h.pop();
|
|
1059
|
-
}
|
|
1060
|
-
return U && (e.e > m.maxE ? (e.d = null, e.e = NaN) : e.e < m.minE && (e.e = 0, e.d = [0])), e;
|
|
1061
|
-
}
|
|
1062
|
-
function re(e, t, r) {
|
|
1063
|
-
if (!e.isFinite()) return ft(e);
|
|
1064
|
-
var n, s = e.e, i = K(e.d), a = i.length;
|
|
1065
|
-
return t ? (r && (n = r - a) > 0 ? i = i.charAt(0) + "." + i.slice(1) + oe(n) : a > 1 && (i = i.charAt(0) + "." + i.slice(1)), i = i + (e.e < 0 ? "e" : "e+") + e.e) : s < 0 ? (i = "0." + oe(-s - 1) + i, r && (n = r - a) > 0 && (i += oe(n))) : s >= a ? (i += oe(s + 1 - a), r && (n = r - s - 1) > 0 && (i = i + "." + oe(n))) : ((n = s + 1) < a && (i = i.slice(0, n) + "." + i.slice(n)), r && (n = r - a) > 0 && (s + 1 === a && (i += "."), i += oe(n))), i;
|
|
1066
|
-
}
|
|
1067
|
-
function De(e, t) {
|
|
1068
|
-
var r = e[0];
|
|
1069
|
-
for (t *= L; r >= 10; r /= 10) t++;
|
|
1070
|
-
return t;
|
|
1071
|
-
}
|
|
1072
|
-
function Ce(e, t, r) {
|
|
1073
|
-
if (t > Tt)
|
|
1074
|
-
throw U = !0, r && (e.precision = r), Error(rt);
|
|
1075
|
-
return q(new e(be), t, 1, !0);
|
|
1076
|
-
}
|
|
1077
|
-
function te(e, t, r) {
|
|
1078
|
-
if (t > qe) throw Error(rt);
|
|
1079
|
-
return q(new e($e), t, r, !0);
|
|
1080
|
-
}
|
|
1081
|
-
function ot(e) {
|
|
1082
|
-
var t = e.length - 1, r = t * L + 1;
|
|
1083
|
-
if (t = e[t], t) {
|
|
1084
|
-
for (; t % 10 == 0; t /= 10) r--;
|
|
1085
|
-
for (t = e[0]; t >= 10; t /= 10) r++;
|
|
1086
|
-
}
|
|
1087
|
-
return r;
|
|
1088
|
-
}
|
|
1089
|
-
function oe(e) {
|
|
1090
|
-
for (var t = ""; e--; ) t += "0";
|
|
1091
|
-
return t;
|
|
1092
|
-
}
|
|
1093
|
-
function at(e, t, r, n) {
|
|
1094
|
-
var s, i = new e(1), a = Math.ceil(n / L + 4);
|
|
1095
|
-
for (U = !1; ; ) {
|
|
1096
|
-
if (r % 2 && (i = i.times(t), Ie(i.d, a) && (s = !0)), r = G(r / 2), r === 0) {
|
|
1097
|
-
r = i.d.length - 1, s && i.d[r] === 0 && ++i.d[r];
|
|
1098
|
-
break;
|
|
1099
|
-
}
|
|
1100
|
-
t = t.times(t), Ie(t.d, a);
|
|
1101
|
-
}
|
|
1102
|
-
return U = !0, i;
|
|
1103
|
-
}
|
|
1104
|
-
function je(e) {
|
|
1105
|
-
return e.d[e.d.length - 1] & 1;
|
|
1106
|
-
}
|
|
1107
|
-
function ut(e, t, r) {
|
|
1108
|
-
for (var n, s, i = new e(t[0]), a = 0; ++a < t.length; ) {
|
|
1109
|
-
if (s = new e(t[a]), !s.s) {
|
|
1110
|
-
i = s;
|
|
1111
|
-
break;
|
|
1112
|
-
}
|
|
1113
|
-
n = i.cmp(s), (n === r || n === 0 && i.s === r) && (i = s);
|
|
1114
|
-
}
|
|
1115
|
-
return i;
|
|
1116
|
-
}
|
|
1117
|
-
function Fe(e, t) {
|
|
1118
|
-
var r, n, s, i, a, u, f, o = 0, c = 0, h = 0, l = e.constructor, m = l.rounding, b = l.precision;
|
|
1119
|
-
if (!e.d || !e.d[0] || e.e > 17)
|
|
1120
|
-
return new l(e.d ? e.d[0] ? e.s < 0 ? 0 : 1 / 0 : 1 : e.s ? e.s < 0 ? 0 : e : NaN);
|
|
1121
|
-
for (t == null ? (U = !1, f = b) : f = t, u = new l(0.03125); e.e > -2; )
|
|
1122
|
-
e = e.times(u), h += 5;
|
|
1123
|
-
for (n = Math.log(Z(2, h)) / Math.LN10 * 2 + 5 | 0, f += n, r = i = a = new l(1), l.precision = f; ; ) {
|
|
1124
|
-
if (i = q(i.times(e), f, 1), r = r.times(++c), u = a.plus(W(i, r, f, 1)), K(u.d).slice(0, f) === K(a.d).slice(0, f)) {
|
|
1125
|
-
for (s = h; s--; ) a = q(a.times(a), f, 1);
|
|
1126
|
-
if (t == null)
|
|
1127
|
-
if (o < 3 && me(a.d, f - n, m, o))
|
|
1128
|
-
l.precision = f += 10, r = i = u = new l(1), c = 0, o++;
|
|
1129
|
-
else
|
|
1130
|
-
return q(a, l.precision = b, m, U = !0);
|
|
1131
|
-
else
|
|
1132
|
-
return l.precision = b, a;
|
|
1133
|
-
}
|
|
1134
|
-
a = u;
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
function ae(e, t) {
|
|
1138
|
-
var r, n, s, i, a, u, f, o, c, h, l, m = 1, b = 10, p = e, C = p.d, T = p.constructor, g = T.rounding, d = T.precision;
|
|
1139
|
-
if (p.s < 0 || !C || !C[0] || !p.e && C[0] == 1 && C.length == 1)
|
|
1140
|
-
return new T(C && !C[0] ? -1 / 0 : p.s != 1 ? NaN : C ? 0 : p);
|
|
1141
|
-
if (t == null ? (U = !1, c = d) : c = t, T.precision = c += b, r = K(C), n = r.charAt(0), Math.abs(i = p.e) < 15e14) {
|
|
1142
|
-
for (; n < 7 && n != 1 || n == 1 && r.charAt(1) > 3; )
|
|
1143
|
-
p = p.times(e), r = K(p.d), n = r.charAt(0), m++;
|
|
1144
|
-
i = p.e, n > 1 ? (p = new T("0." + r), i++) : p = new T(n + "." + r.slice(1));
|
|
1145
|
-
} else
|
|
1146
|
-
return o = Ce(T, c + 2, d).times(i + ""), p = ae(new T(n + "." + r.slice(1)), c - b).plus(o), T.precision = d, t == null ? q(p, d, g, U = !0) : p;
|
|
1147
|
-
for (h = p, f = a = p = W(p.minus(1), p.plus(1), c, 1), l = q(p.times(p), c, 1), s = 3; ; ) {
|
|
1148
|
-
if (a = q(a.times(l), c, 1), o = f.plus(W(a, new T(s), c, 1)), K(o.d).slice(0, c) === K(f.d).slice(0, c))
|
|
1149
|
-
if (f = f.times(2), i !== 0 && (f = f.plus(Ce(T, c + 2, d).times(i + ""))), f = W(f, new T(m), c, 1), t == null)
|
|
1150
|
-
if (me(f.d, c - b, g, u))
|
|
1151
|
-
T.precision = c += b, o = a = p = W(h.minus(1), h.plus(1), c, 1), l = q(p.times(p), c, 1), s = u = 1;
|
|
1152
|
-
else
|
|
1153
|
-
return q(f, T.precision = d, g, U = !0);
|
|
1154
|
-
else
|
|
1155
|
-
return T.precision = d, f;
|
|
1156
|
-
f = o, s += 2;
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
function ft(e) {
|
|
1160
|
-
return String(e.s * e.s / 0);
|
|
1161
|
-
}
|
|
1162
|
-
function xe(e, t) {
|
|
1163
|
-
var r, n, s;
|
|
1164
|
-
for ((r = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (n = t.search(/e/i)) > 0 ? (r < 0 && (r = n), r += +t.slice(n + 1), t = t.substring(0, n)) : r < 0 && (r = t.length), n = 0; t.charCodeAt(n) === 48; n++) ;
|
|
1165
|
-
for (s = t.length; t.charCodeAt(s - 1) === 48; --s) ;
|
|
1166
|
-
if (t = t.slice(n, s), t) {
|
|
1167
|
-
if (s -= n, e.e = r = r - n - 1, e.d = [], n = (r + 1) % L, r < 0 && (n += L), n < s) {
|
|
1168
|
-
for (n && e.d.push(+t.slice(0, n)), s -= L; n < s; ) e.d.push(+t.slice(n, n += L));
|
|
1169
|
-
t = t.slice(n), n = L - t.length;
|
|
1170
|
-
} else
|
|
1171
|
-
n -= s;
|
|
1172
|
-
for (; n--; ) t += "0";
|
|
1173
|
-
e.d.push(+t), U && (e.e > e.constructor.maxE ? (e.d = null, e.e = NaN) : e.e < e.constructor.minE && (e.e = 0, e.d = [0]));
|
|
1174
|
-
} else
|
|
1175
|
-
e.e = 0, e.d = [0];
|
|
1176
|
-
return e;
|
|
1177
|
-
}
|
|
1178
|
-
function zt(e, t) {
|
|
1179
|
-
var r, n, s, i, a, u, f, o, c;
|
|
1180
|
-
if (t.indexOf("_") > -1) {
|
|
1181
|
-
if (t = t.replace(/(\d)_(?=\d)/g, "$1"), st.test(t)) return xe(e, t);
|
|
1182
|
-
} else if (t === "Infinity" || t === "NaN")
|
|
1183
|
-
return +t || (e.s = NaN), e.e = NaN, e.d = null, e;
|
|
1184
|
-
if (kt.test(t))
|
|
1185
|
-
r = 16, t = t.toLowerCase();
|
|
1186
|
-
else if (Bt.test(t))
|
|
1187
|
-
r = 2;
|
|
1188
|
-
else if (Mt.test(t))
|
|
1189
|
-
r = 8;
|
|
1190
|
-
else
|
|
1191
|
-
throw Error(ue + t);
|
|
1192
|
-
for (i = t.search(/p/i), i > 0 ? (f = +t.slice(i + 1), t = t.substring(2, i)) : t = t.slice(2), i = t.indexOf("."), a = i >= 0, n = e.constructor, a && (t = t.replace(".", ""), u = t.length, i = u - i, s = at(n, new n(r), i, i * 2)), o = ye(t, r, ee), c = o.length - 1, i = c; o[i] === 0; --i) o.pop();
|
|
1193
|
-
return i < 0 ? new n(e.s * 0) : (e.e = De(o, c), e.d = o, U = !1, a && (e = W(e, s, u * 4)), f && (e = e.times(Math.abs(f) < 54 ? Z(2, f) : Se.pow(2, f))), U = !0, e);
|
|
1194
|
-
}
|
|
1195
|
-
function Ht(e, t) {
|
|
1196
|
-
var r, n = t.d.length;
|
|
1197
|
-
if (n < 3)
|
|
1198
|
-
return t.isZero() ? t : pe(e, 2, t, t);
|
|
1199
|
-
r = 1.4 * Math.sqrt(n), r = r > 16 ? 16 : r | 0, t = t.times(1 / Oe(5, r)), t = pe(e, 2, t, t);
|
|
1200
|
-
for (var s, i = new e(5), a = new e(16), u = new e(20); r--; )
|
|
1201
|
-
s = t.times(t), t = t.times(i.plus(s.times(a.times(s).minus(u))));
|
|
1202
|
-
return t;
|
|
1203
|
-
}
|
|
1204
|
-
function pe(e, t, r, n, s) {
|
|
1205
|
-
var i, a, u, f, o = e.precision, c = Math.ceil(o / L);
|
|
1206
|
-
for (U = !1, f = r.times(r), u = new e(n); ; ) {
|
|
1207
|
-
if (a = W(u.times(f), new e(t++ * t++), o, 1), u = s ? n.plus(a) : n.minus(a), n = W(a.times(f), new e(t++ * t++), o, 1), a = u.plus(n), a.d[c] !== void 0) {
|
|
1208
|
-
for (i = c; a.d[i] === u.d[i] && i--; ) ;
|
|
1209
|
-
if (i == -1) break;
|
|
1210
|
-
}
|
|
1211
|
-
i = u, u = n, n = a, a = i;
|
|
1212
|
-
}
|
|
1213
|
-
return U = !0, a.d.length = c + 1, a;
|
|
1214
|
-
}
|
|
1215
|
-
function Oe(e, t) {
|
|
1216
|
-
for (var r = e; --t; ) r *= e;
|
|
1217
|
-
return r;
|
|
1218
|
-
}
|
|
1219
|
-
function ct(e, t) {
|
|
1220
|
-
var r, n = t.s < 0, s = te(e, e.precision, 1), i = s.times(0.5);
|
|
1221
|
-
if (t = t.abs(), t.lte(i))
|
|
1222
|
-
return ie = n ? 4 : 1, t;
|
|
1223
|
-
if (r = t.divToInt(s), r.isZero())
|
|
1224
|
-
ie = n ? 3 : 2;
|
|
1225
|
-
else {
|
|
1226
|
-
if (t = t.minus(r.times(s)), t.lte(i))
|
|
1227
|
-
return ie = je(r) ? n ? 2 : 3 : n ? 4 : 1, t;
|
|
1228
|
-
ie = je(r) ? n ? 1 : 4 : n ? 3 : 2;
|
|
1229
|
-
}
|
|
1230
|
-
return t.minus(s).abs();
|
|
1231
|
-
}
|
|
1232
|
-
function Le(e, t, r, n) {
|
|
1233
|
-
var s, i, a, u, f, o, c, h, l, m = e.constructor, b = r !== void 0;
|
|
1234
|
-
if (b ? (J(r, 1, fe), n === void 0 ? n = m.rounding : J(n, 0, 8)) : (r = m.precision, n = m.rounding), !e.isFinite())
|
|
1235
|
-
c = ft(e);
|
|
1236
|
-
else {
|
|
1237
|
-
for (c = re(e), a = c.indexOf("."), b ? (s = 2, t == 16 ? r = r * 4 - 3 : t == 8 && (r = r * 3 - 2)) : s = t, a >= 0 && (c = c.replace(".", ""), l = new m(1), l.e = c.length - a, l.d = ye(re(l), 10, s), l.e = l.d.length), h = ye(c, 10, s), i = f = h.length; h[--f] == 0; ) h.pop();
|
|
1238
|
-
if (!h[0])
|
|
1239
|
-
c = b ? "0p+0" : "0";
|
|
1240
|
-
else {
|
|
1241
|
-
if (a < 0 ? i-- : (e = new m(e), e.d = h, e.e = i, e = W(e, l, r, n, 0, s), h = e.d, i = e.e, o = tt), a = h[r], u = s / 2, o = o || h[r + 1] !== void 0, o = n < 4 ? (a !== void 0 || o) && (n === 0 || n === (e.s < 0 ? 3 : 2)) : a > u || a === u && (n === 4 || o || n === 6 && h[r - 1] & 1 || n === (e.s < 0 ? 8 : 7)), h.length = r, o)
|
|
1242
|
-
for (; ++h[--r] > s - 1; )
|
|
1243
|
-
h[r] = 0, r || (++i, h.unshift(1));
|
|
1244
|
-
for (f = h.length; !h[f - 1]; --f) ;
|
|
1245
|
-
for (a = 0, c = ""; a < f; a++) c += ze.charAt(h[a]);
|
|
1246
|
-
if (b) {
|
|
1247
|
-
if (f > 1)
|
|
1248
|
-
if (t == 16 || t == 8) {
|
|
1249
|
-
for (a = t == 16 ? 4 : 3, --f; f % a; f++) c += "0";
|
|
1250
|
-
for (h = ye(c, s, t), f = h.length; !h[f - 1]; --f) ;
|
|
1251
|
-
for (a = 1, c = "1."; a < f; a++) c += ze.charAt(h[a]);
|
|
1252
|
-
} else
|
|
1253
|
-
c = c.charAt(0) + "." + c.slice(1);
|
|
1254
|
-
c = c + (i < 0 ? "p" : "p+") + i;
|
|
1255
|
-
} else if (i < 0) {
|
|
1256
|
-
for (; ++i; ) c = "0" + c;
|
|
1257
|
-
c = "0." + c;
|
|
1258
|
-
} else if (++i > f) for (i -= f; i--; ) c += "0";
|
|
1259
|
-
else i < f && (c = c.slice(0, i) + "." + c.slice(i));
|
|
1260
|
-
}
|
|
1261
|
-
c = (t == 16 ? "0x" : t == 2 ? "0b" : t == 8 ? "0o" : "") + c;
|
|
1262
|
-
}
|
|
1263
|
-
return e.s < 0 ? "-" + c : c;
|
|
1264
|
-
}
|
|
1265
|
-
function Ie(e, t) {
|
|
1266
|
-
if (e.length > t)
|
|
1267
|
-
return e.length = t, !0;
|
|
1268
|
-
}
|
|
1269
|
-
function qt(e) {
|
|
1270
|
-
return new this(e).abs();
|
|
1271
|
-
}
|
|
1272
|
-
function Ft(e) {
|
|
1273
|
-
return new this(e).acos();
|
|
1274
|
-
}
|
|
1275
|
-
function Lt(e) {
|
|
1276
|
-
return new this(e).acosh();
|
|
1277
|
-
}
|
|
1278
|
-
function Rt(e, t) {
|
|
1279
|
-
return new this(e).plus(t);
|
|
1280
|
-
}
|
|
1281
|
-
function jt(e) {
|
|
1282
|
-
return new this(e).asin();
|
|
1283
|
-
}
|
|
1284
|
-
function It(e) {
|
|
1285
|
-
return new this(e).asinh();
|
|
1286
|
-
}
|
|
1287
|
-
function Ut(e) {
|
|
1288
|
-
return new this(e).atan();
|
|
1289
|
-
}
|
|
1290
|
-
function Wt(e) {
|
|
1291
|
-
return new this(e).atanh();
|
|
1292
|
-
}
|
|
1293
|
-
function Zt(e, t) {
|
|
1294
|
-
e = new this(e), t = new this(t);
|
|
1295
|
-
var r, n = this.precision, s = this.rounding, i = n + 4;
|
|
1296
|
-
return !e.s || !t.s ? r = new this(NaN) : !e.d && !t.d ? (r = te(this, i, 1).times(t.s > 0 ? 0.25 : 0.75), r.s = e.s) : !t.d || e.isZero() ? (r = t.s < 0 ? te(this, n, s) : new this(0), r.s = e.s) : !e.d || t.isZero() ? (r = te(this, i, 1).times(0.5), r.s = e.s) : t.s < 0 ? (this.precision = i, this.rounding = 1, r = this.atan(W(e, t, i, 1)), t = te(this, i, 1), this.precision = n, this.rounding = s, r = e.s < 0 ? r.minus(t) : r.plus(t)) : r = this.atan(W(e, t, i, 1)), r;
|
|
1297
|
-
}
|
|
1298
|
-
function Yt(e) {
|
|
1299
|
-
return new this(e).cbrt();
|
|
1300
|
-
}
|
|
1301
|
-
function Vt(e) {
|
|
1302
|
-
return q(e = new this(e), e.e + 1, 2);
|
|
1303
|
-
}
|
|
1304
|
-
function Kt(e, t, r) {
|
|
1305
|
-
return new this(e).clamp(t, r);
|
|
1306
|
-
}
|
|
1307
|
-
function Gt(e) {
|
|
1308
|
-
if (!e || typeof e != "object") throw Error(Ne + "Object expected");
|
|
1309
|
-
var t, r, n, s = e.defaults === !0, i = [
|
|
1310
|
-
"precision",
|
|
1311
|
-
1,
|
|
1312
|
-
fe,
|
|
1313
|
-
"rounding",
|
|
1314
|
-
0,
|
|
1315
|
-
8,
|
|
1316
|
-
"toExpNeg",
|
|
1317
|
-
-de,
|
|
1318
|
-
0,
|
|
1319
|
-
"toExpPos",
|
|
1320
|
-
0,
|
|
1321
|
-
de,
|
|
1322
|
-
"maxE",
|
|
1323
|
-
0,
|
|
1324
|
-
de,
|
|
1325
|
-
"minE",
|
|
1326
|
-
-de,
|
|
1327
|
-
0,
|
|
1328
|
-
"modulo",
|
|
1329
|
-
0,
|
|
1330
|
-
9
|
|
1331
|
-
];
|
|
1332
|
-
for (t = 0; t < i.length; t += 3)
|
|
1333
|
-
if (r = i[t], s && (this[r] = He[r]), (n = e[r]) !== void 0)
|
|
1334
|
-
if (G(n) === n && n >= i[t + 1] && n <= i[t + 2]) this[r] = n;
|
|
1335
|
-
else throw Error(ue + r + ": " + n);
|
|
1336
|
-
if (r = "crypto", s && (this[r] = He[r]), (n = e[r]) !== void 0)
|
|
1337
|
-
if (n === !0 || n === !1 || n === 0 || n === 1)
|
|
1338
|
-
if (n)
|
|
1339
|
-
if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
|
|
1340
|
-
this[r] = !0;
|
|
1341
|
-
else
|
|
1342
|
-
throw Error(nt);
|
|
1343
|
-
else
|
|
1344
|
-
this[r] = !1;
|
|
1345
|
-
else
|
|
1346
|
-
throw Error(ue + r + ": " + n);
|
|
1347
|
-
return this;
|
|
1348
|
-
}
|
|
1349
|
-
function Qt(e) {
|
|
1350
|
-
return new this(e).cos();
|
|
1351
|
-
}
|
|
1352
|
-
function Jt(e) {
|
|
1353
|
-
return new this(e).cosh();
|
|
1354
|
-
}
|
|
1355
|
-
function lt(e) {
|
|
1356
|
-
var t, r, n;
|
|
1357
|
-
function s(i) {
|
|
1358
|
-
var a, u, f, o = this;
|
|
1359
|
-
if (!(o instanceof s)) return new s(i);
|
|
1360
|
-
if (o.constructor = s, Ue(i)) {
|
|
1361
|
-
o.s = i.s, U ? !i.d || i.e > s.maxE ? (o.e = NaN, o.d = null) : i.e < s.minE ? (o.e = 0, o.d = [0]) : (o.e = i.e, o.d = i.d.slice()) : (o.e = i.e, o.d = i.d ? i.d.slice() : i.d);
|
|
1362
|
-
return;
|
|
1363
|
-
}
|
|
1364
|
-
if (f = typeof i, f === "number") {
|
|
1365
|
-
if (i === 0) {
|
|
1366
|
-
o.s = 1 / i < 0 ? -1 : 1, o.e = 0, o.d = [0];
|
|
1367
|
-
return;
|
|
1368
|
-
}
|
|
1369
|
-
if (i < 0 ? (i = -i, o.s = -1) : o.s = 1, i === ~~i && i < 1e7) {
|
|
1370
|
-
for (a = 0, u = i; u >= 10; u /= 10) a++;
|
|
1371
|
-
U ? a > s.maxE ? (o.e = NaN, o.d = null) : a < s.minE ? (o.e = 0, o.d = [0]) : (o.e = a, o.d = [i]) : (o.e = a, o.d = [i]);
|
|
1372
|
-
return;
|
|
1373
|
-
}
|
|
1374
|
-
if (i * 0 !== 0) {
|
|
1375
|
-
i || (o.s = NaN), o.e = NaN, o.d = null;
|
|
1376
|
-
return;
|
|
1377
|
-
}
|
|
1378
|
-
return xe(o, i.toString());
|
|
1379
|
-
}
|
|
1380
|
-
if (f === "string")
|
|
1381
|
-
return (u = i.charCodeAt(0)) === 45 ? (i = i.slice(1), o.s = -1) : (u === 43 && (i = i.slice(1)), o.s = 1), st.test(i) ? xe(o, i) : zt(o, i);
|
|
1382
|
-
if (f === "bigint")
|
|
1383
|
-
return i < 0 ? (i = -i, o.s = -1) : o.s = 1, xe(o, i.toString());
|
|
1384
|
-
throw Error(ue + i);
|
|
1385
|
-
}
|
|
1386
|
-
if (s.prototype = N, s.ROUND_UP = 0, s.ROUND_DOWN = 1, s.ROUND_CEIL = 2, s.ROUND_FLOOR = 3, s.ROUND_HALF_UP = 4, s.ROUND_HALF_DOWN = 5, s.ROUND_HALF_EVEN = 6, s.ROUND_HALF_CEIL = 7, s.ROUND_HALF_FLOOR = 8, s.EUCLID = 9, s.config = s.set = Gt, s.clone = lt, s.isDecimal = Ue, s.abs = qt, s.acos = Ft, s.acosh = Lt, s.add = Rt, s.asin = jt, s.asinh = It, s.atan = Ut, s.atanh = Wt, s.atan2 = Zt, s.cbrt = Yt, s.ceil = Vt, s.clamp = Kt, s.cos = Qt, s.cosh = Jt, s.div = Xt, s.exp = er, s.floor = tr, s.hypot = rr, s.ln = nr, s.log = ir, s.log10 = or, s.log2 = sr, s.max = ar, s.min = ur, s.mod = fr, s.mul = cr, s.pow = lr, s.random = hr, s.round = dr, s.sign = pr, s.sin = vr, s.sinh = gr, s.sqrt = mr, s.sub = wr, s.sum = _r, s.tan = yr, s.tanh = xr, s.trunc = br, e === void 0 && (e = {}), e && e.defaults !== !0)
|
|
1387
|
-
for (n = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], t = 0; t < n.length; ) e.hasOwnProperty(r = n[t++]) || (e[r] = this[r]);
|
|
1388
|
-
return s.config(e), s;
|
|
1389
|
-
}
|
|
1390
|
-
function Xt(e, t) {
|
|
1391
|
-
return new this(e).div(t);
|
|
1392
|
-
}
|
|
1393
|
-
function er(e) {
|
|
1394
|
-
return new this(e).exp();
|
|
1395
|
-
}
|
|
1396
|
-
function tr(e) {
|
|
1397
|
-
return q(e = new this(e), e.e + 1, 3);
|
|
1398
|
-
}
|
|
1399
|
-
function rr() {
|
|
1400
|
-
var e, t, r = new this(0);
|
|
1401
|
-
for (U = !1, e = 0; e < arguments.length; )
|
|
1402
|
-
if (t = new this(arguments[e++]), t.d)
|
|
1403
|
-
r.d && (r = r.plus(t.times(t)));
|
|
1404
|
-
else {
|
|
1405
|
-
if (t.s)
|
|
1406
|
-
return U = !0, new this(1 / 0);
|
|
1407
|
-
r = t;
|
|
1408
|
-
}
|
|
1409
|
-
return U = !0, r.sqrt();
|
|
1410
|
-
}
|
|
1411
|
-
function Ue(e) {
|
|
1412
|
-
return e instanceof Se || e && e.toStringTag === it || !1;
|
|
1413
|
-
}
|
|
1414
|
-
function nr(e) {
|
|
1415
|
-
return new this(e).ln();
|
|
1416
|
-
}
|
|
1417
|
-
function ir(e, t) {
|
|
1418
|
-
return new this(e).log(t);
|
|
1419
|
-
}
|
|
1420
|
-
function sr(e) {
|
|
1421
|
-
return new this(e).log(2);
|
|
1422
|
-
}
|
|
1423
|
-
function or(e) {
|
|
1424
|
-
return new this(e).log(10);
|
|
1425
|
-
}
|
|
1426
|
-
function ar() {
|
|
1427
|
-
return ut(this, arguments, -1);
|
|
1428
|
-
}
|
|
1429
|
-
function ur() {
|
|
1430
|
-
return ut(this, arguments, 1);
|
|
1431
|
-
}
|
|
1432
|
-
function fr(e, t) {
|
|
1433
|
-
return new this(e).mod(t);
|
|
1434
|
-
}
|
|
1435
|
-
function cr(e, t) {
|
|
1436
|
-
return new this(e).mul(t);
|
|
1437
|
-
}
|
|
1438
|
-
function lr(e, t) {
|
|
1439
|
-
return new this(e).pow(t);
|
|
1440
|
-
}
|
|
1441
|
-
function hr(e) {
|
|
1442
|
-
var t, r, n, s, i = 0, a = new this(1), u = [];
|
|
1443
|
-
if (e === void 0 ? e = this.precision : J(e, 1, fe), n = Math.ceil(e / L), this.crypto)
|
|
1444
|
-
if (crypto.getRandomValues)
|
|
1445
|
-
for (t = crypto.getRandomValues(new Uint32Array(n)); i < n; )
|
|
1446
|
-
s = t[i], s >= 429e7 ? t[i] = crypto.getRandomValues(new Uint32Array(1))[0] : u[i++] = s % 1e7;
|
|
1447
|
-
else if (crypto.randomBytes) {
|
|
1448
|
-
for (t = crypto.randomBytes(n *= 4); i < n; )
|
|
1449
|
-
s = t[i] + (t[i + 1] << 8) + (t[i + 2] << 16) + ((t[i + 3] & 127) << 24), s >= 214e7 ? crypto.randomBytes(4).copy(t, i) : (u.push(s % 1e7), i += 4);
|
|
1450
|
-
i = n / 4;
|
|
1451
|
-
} else
|
|
1452
|
-
throw Error(nt);
|
|
1453
|
-
else for (; i < n; ) u[i++] = Math.random() * 1e7 | 0;
|
|
1454
|
-
for (n = u[--i], e %= L, n && e && (s = Z(10, L - e), u[i] = (n / s | 0) * s); u[i] === 0; i--) u.pop();
|
|
1455
|
-
if (i < 0)
|
|
1456
|
-
r = 0, u = [0];
|
|
1457
|
-
else {
|
|
1458
|
-
for (r = -1; u[0] === 0; r -= L) u.shift();
|
|
1459
|
-
for (n = 1, s = u[0]; s >= 10; s /= 10) n++;
|
|
1460
|
-
n < L && (r -= L - n);
|
|
1461
|
-
}
|
|
1462
|
-
return a.e = r, a.d = u, a;
|
|
1463
|
-
}
|
|
1464
|
-
function dr(e) {
|
|
1465
|
-
return q(e = new this(e), e.e + 1, this.rounding);
|
|
1466
|
-
}
|
|
1467
|
-
function pr(e) {
|
|
1468
|
-
return e = new this(e), e.d ? e.d[0] ? e.s : 0 * e.s : e.s || NaN;
|
|
1469
|
-
}
|
|
1470
|
-
function vr(e) {
|
|
1471
|
-
return new this(e).sin();
|
|
1472
|
-
}
|
|
1473
|
-
function gr(e) {
|
|
1474
|
-
return new this(e).sinh();
|
|
1475
|
-
}
|
|
1476
|
-
function mr(e) {
|
|
1477
|
-
return new this(e).sqrt();
|
|
1478
|
-
}
|
|
1479
|
-
function wr(e, t) {
|
|
1480
|
-
return new this(e).sub(t);
|
|
1481
|
-
}
|
|
1482
|
-
function _r() {
|
|
1483
|
-
var e = 0, t = arguments, r = new this(t[e]);
|
|
1484
|
-
for (U = !1; r.s && ++e < t.length; ) r = r.plus(t[e]);
|
|
1485
|
-
return U = !0, q(r, this.precision, this.rounding);
|
|
1486
|
-
}
|
|
1487
|
-
function yr(e) {
|
|
1488
|
-
return new this(e).tan();
|
|
1489
|
-
}
|
|
1490
|
-
function xr(e) {
|
|
1491
|
-
return new this(e).tanh();
|
|
1492
|
-
}
|
|
1493
|
-
function br(e) {
|
|
1494
|
-
return q(e = new this(e), e.e + 1, 1);
|
|
1495
|
-
}
|
|
1496
|
-
N[Symbol.for("nodejs.util.inspect.custom")] = N.toString;
|
|
1497
|
-
N[Symbol.toStringTag] = "Decimal";
|
|
1498
|
-
var Se = N.constructor = lt(He);
|
|
1499
|
-
be = new Se(be);
|
|
1500
|
-
$e = new Se($e);
|
|
1501
|
-
var $r = { exports: {} };
|
|
1502
|
-
function Cr(e) {
|
|
1503
|
-
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.');
|
|
1504
|
-
}
|
|
1505
|
-
var Ee = { exports: {} };
|
|
1506
|
-
const Nr = {}, Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1507
|
-
__proto__: null,
|
|
1508
|
-
default: Nr
|
|
1509
|
-
}, Symbol.toStringTag, { value: "Module" })), Or = /* @__PURE__ */ wt(Dr);
|
|
1510
|
-
var We;
|
|
1511
|
-
function ne() {
|
|
1512
|
-
return We || (We = 1, function(e, t) {
|
|
1513
|
-
(function(r, n) {
|
|
1514
|
-
e.exports = n();
|
|
1515
|
-
})(V, function() {
|
|
1516
|
-
var r = r || function(n, s) {
|
|
1517
|
-
var i;
|
|
1518
|
-
if (typeof window < "u" && window.crypto && (i = window.crypto), typeof self < "u" && self.crypto && (i = self.crypto), typeof globalThis < "u" && globalThis.crypto && (i = globalThis.crypto), !i && typeof window < "u" && window.msCrypto && (i = window.msCrypto), !i && typeof V < "u" && V.crypto && (i = V.crypto), !i && typeof Cr == "function")
|
|
1519
|
-
try {
|
|
1520
|
-
i = Or;
|
|
1521
|
-
} catch {
|
|
1522
|
-
}
|
|
1523
|
-
var a = function() {
|
|
1524
|
-
if (i) {
|
|
1525
|
-
if (typeof i.getRandomValues == "function")
|
|
1526
|
-
try {
|
|
1527
|
-
return i.getRandomValues(new Uint32Array(1))[0];
|
|
1528
|
-
} catch {
|
|
1529
|
-
}
|
|
1530
|
-
if (typeof i.randomBytes == "function")
|
|
1531
|
-
try {
|
|
1532
|
-
return i.randomBytes(4).readInt32LE();
|
|
1533
|
-
} catch {
|
|
1534
|
-
}
|
|
1535
|
-
}
|
|
1536
|
-
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
1537
|
-
}, u = Object.create || /* @__PURE__ */ function() {
|
|
1538
|
-
function g() {
|
|
1539
|
-
}
|
|
1540
|
-
return function(d) {
|
|
1541
|
-
var _;
|
|
1542
|
-
return g.prototype = d, _ = new g(), g.prototype = null, _;
|
|
1543
|
-
};
|
|
1544
|
-
}(), f = {}, o = f.lib = {}, c = o.Base = /* @__PURE__ */ function() {
|
|
1545
|
-
return {
|
|
1546
|
-
/**
|
|
1547
|
-
* Creates a new object that inherits from this object.
|
|
1548
|
-
*
|
|
1549
|
-
* @param {Object} overrides Properties to copy into the new object.
|
|
1550
|
-
*
|
|
1551
|
-
* @return {Object} The new object.
|
|
1552
|
-
*
|
|
1553
|
-
* @static
|
|
1554
|
-
*
|
|
1555
|
-
* @example
|
|
1556
|
-
*
|
|
1557
|
-
* var MyType = CryptoJS.lib.Base.extend({
|
|
1558
|
-
* field: 'value',
|
|
1559
|
-
*
|
|
1560
|
-
* method: function () {
|
|
1561
|
-
* }
|
|
1562
|
-
* });
|
|
1563
|
-
*/
|
|
1564
|
-
extend: function(g) {
|
|
1565
|
-
var d = u(this);
|
|
1566
|
-
return g && d.mixIn(g), (!d.hasOwnProperty("init") || this.init === d.init) && (d.init = function() {
|
|
1567
|
-
d.$super.init.apply(this, arguments);
|
|
1568
|
-
}), d.init.prototype = d, d.$super = this, d;
|
|
1569
|
-
},
|
|
1570
|
-
/**
|
|
1571
|
-
* Extends this object and runs the init method.
|
|
1572
|
-
* Arguments to create() will be passed to init().
|
|
1573
|
-
*
|
|
1574
|
-
* @return {Object} The new object.
|
|
1575
|
-
*
|
|
1576
|
-
* @static
|
|
1577
|
-
*
|
|
1578
|
-
* @example
|
|
1579
|
-
*
|
|
1580
|
-
* var instance = MyType.create();
|
|
1581
|
-
*/
|
|
1582
|
-
create: function() {
|
|
1583
|
-
var g = this.extend();
|
|
1584
|
-
return g.init.apply(g, arguments), g;
|
|
1585
|
-
},
|
|
1586
|
-
/**
|
|
1587
|
-
* Initializes a newly created object.
|
|
1588
|
-
* Override this method to add some logic when your objects are created.
|
|
1589
|
-
*
|
|
1590
|
-
* @example
|
|
1591
|
-
*
|
|
1592
|
-
* var MyType = CryptoJS.lib.Base.extend({
|
|
1593
|
-
* init: function () {
|
|
1594
|
-
* // ...
|
|
1595
|
-
* }
|
|
1596
|
-
* });
|
|
1597
|
-
*/
|
|
1598
|
-
init: function() {
|
|
1599
|
-
},
|
|
1600
|
-
/**
|
|
1601
|
-
* Copies properties into this object.
|
|
1602
|
-
*
|
|
1603
|
-
* @param {Object} properties The properties to mix in.
|
|
1604
|
-
*
|
|
1605
|
-
* @example
|
|
1606
|
-
*
|
|
1607
|
-
* MyType.mixIn({
|
|
1608
|
-
* field: 'value'
|
|
1609
|
-
* });
|
|
1610
|
-
*/
|
|
1611
|
-
mixIn: function(g) {
|
|
1612
|
-
for (var d in g)
|
|
1613
|
-
g.hasOwnProperty(d) && (this[d] = g[d]);
|
|
1614
|
-
g.hasOwnProperty("toString") && (this.toString = g.toString);
|
|
1615
|
-
},
|
|
1616
|
-
/**
|
|
1617
|
-
* Creates a copy of this object.
|
|
1618
|
-
*
|
|
1619
|
-
* @return {Object} The clone.
|
|
1620
|
-
*
|
|
1621
|
-
* @example
|
|
1622
|
-
*
|
|
1623
|
-
* var clone = instance.clone();
|
|
1624
|
-
*/
|
|
1625
|
-
clone: function() {
|
|
1626
|
-
return this.init.prototype.extend(this);
|
|
1627
|
-
}
|
|
1628
|
-
};
|
|
1629
|
-
}(), h = o.WordArray = c.extend({
|
|
1630
|
-
/**
|
|
1631
|
-
* Initializes a newly created word array.
|
|
1632
|
-
*
|
|
1633
|
-
* @param {Array} words (Optional) An array of 32-bit words.
|
|
1634
|
-
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
|
|
1635
|
-
*
|
|
1636
|
-
* @example
|
|
1637
|
-
*
|
|
1638
|
-
* var wordArray = CryptoJS.lib.WordArray.create();
|
|
1639
|
-
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
|
|
1640
|
-
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
|
|
1641
|
-
*/
|
|
1642
|
-
init: function(g, d) {
|
|
1643
|
-
g = this.words = g || [], d != s ? this.sigBytes = d : this.sigBytes = g.length * 4;
|
|
1644
|
-
},
|
|
1645
|
-
/**
|
|
1646
|
-
* Converts this word array to a string.
|
|
1647
|
-
*
|
|
1648
|
-
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
|
|
1649
|
-
*
|
|
1650
|
-
* @return {string} The stringified word array.
|
|
1651
|
-
*
|
|
1652
|
-
* @example
|
|
1653
|
-
*
|
|
1654
|
-
* var string = wordArray + '';
|
|
1655
|
-
* var string = wordArray.toString();
|
|
1656
|
-
* var string = wordArray.toString(CryptoJS.enc.Utf8);
|
|
1657
|
-
*/
|
|
1658
|
-
toString: function(g) {
|
|
1659
|
-
return (g || m).stringify(this);
|
|
1660
|
-
},
|
|
1661
|
-
/**
|
|
1662
|
-
* Concatenates a word array to this word array.
|
|
1663
|
-
*
|
|
1664
|
-
* @param {WordArray} wordArray The word array to append.
|
|
1665
|
-
*
|
|
1666
|
-
* @return {WordArray} This word array.
|
|
1667
|
-
*
|
|
1668
|
-
* @example
|
|
1669
|
-
*
|
|
1670
|
-
* wordArray1.concat(wordArray2);
|
|
1671
|
-
*/
|
|
1672
|
-
concat: function(g) {
|
|
1673
|
-
var d = this.words, _ = g.words, O = this.sigBytes, M = g.sigBytes;
|
|
1674
|
-
if (this.clamp(), O % 4)
|
|
1675
|
-
for (var H = 0; H < M; H++) {
|
|
1676
|
-
var I = _[H >>> 2] >>> 24 - H % 4 * 8 & 255;
|
|
1677
|
-
d[O + H >>> 2] |= I << 24 - (O + H) % 4 * 8;
|
|
1678
|
-
}
|
|
1679
|
-
else
|
|
1680
|
-
for (var F = 0; F < M; F += 4)
|
|
1681
|
-
d[O + F >>> 2] = _[F >>> 2];
|
|
1682
|
-
return this.sigBytes += M, this;
|
|
1683
|
-
},
|
|
1684
|
-
/**
|
|
1685
|
-
* Removes insignificant bits.
|
|
1686
|
-
*
|
|
1687
|
-
* @example
|
|
1688
|
-
*
|
|
1689
|
-
* wordArray.clamp();
|
|
1690
|
-
*/
|
|
1691
|
-
clamp: function() {
|
|
1692
|
-
var g = this.words, d = this.sigBytes;
|
|
1693
|
-
g[d >>> 2] &= 4294967295 << 32 - d % 4 * 8, g.length = n.ceil(d / 4);
|
|
1694
|
-
},
|
|
1695
|
-
/**
|
|
1696
|
-
* Creates a copy of this word array.
|
|
1697
|
-
*
|
|
1698
|
-
* @return {WordArray} The clone.
|
|
1699
|
-
*
|
|
1700
|
-
* @example
|
|
1701
|
-
*
|
|
1702
|
-
* var clone = wordArray.clone();
|
|
1703
|
-
*/
|
|
1704
|
-
clone: function() {
|
|
1705
|
-
var g = c.clone.call(this);
|
|
1706
|
-
return g.words = this.words.slice(0), g;
|
|
1707
|
-
},
|
|
1708
|
-
/**
|
|
1709
|
-
* Creates a word array filled with random bytes.
|
|
1710
|
-
*
|
|
1711
|
-
* @param {number} nBytes The number of random bytes to generate.
|
|
1712
|
-
*
|
|
1713
|
-
* @return {WordArray} The random word array.
|
|
1714
|
-
*
|
|
1715
|
-
* @static
|
|
1716
|
-
*
|
|
1717
|
-
* @example
|
|
1718
|
-
*
|
|
1719
|
-
* var wordArray = CryptoJS.lib.WordArray.random(16);
|
|
1720
|
-
*/
|
|
1721
|
-
random: function(g) {
|
|
1722
|
-
for (var d = [], _ = 0; _ < g; _ += 4)
|
|
1723
|
-
d.push(a());
|
|
1724
|
-
return new h.init(d, g);
|
|
1725
|
-
}
|
|
1726
|
-
}), l = f.enc = {}, m = l.Hex = {
|
|
1727
|
-
/**
|
|
1728
|
-
* Converts a word array to a hex string.
|
|
1729
|
-
*
|
|
1730
|
-
* @param {WordArray} wordArray The word array.
|
|
1731
|
-
*
|
|
1732
|
-
* @return {string} The hex string.
|
|
1733
|
-
*
|
|
1734
|
-
* @static
|
|
1735
|
-
*
|
|
1736
|
-
* @example
|
|
1737
|
-
*
|
|
1738
|
-
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
|
|
1739
|
-
*/
|
|
1740
|
-
stringify: function(g) {
|
|
1741
|
-
for (var d = g.words, _ = g.sigBytes, O = [], M = 0; M < _; M++) {
|
|
1742
|
-
var H = d[M >>> 2] >>> 24 - M % 4 * 8 & 255;
|
|
1743
|
-
O.push((H >>> 4).toString(16)), O.push((H & 15).toString(16));
|
|
1744
|
-
}
|
|
1745
|
-
return O.join("");
|
|
1746
|
-
},
|
|
1747
|
-
/**
|
|
1748
|
-
* Converts a hex string to a word array.
|
|
1749
|
-
*
|
|
1750
|
-
* @param {string} hexStr The hex string.
|
|
1751
|
-
*
|
|
1752
|
-
* @return {WordArray} The word array.
|
|
1753
|
-
*
|
|
1754
|
-
* @static
|
|
1755
|
-
*
|
|
1756
|
-
* @example
|
|
1757
|
-
*
|
|
1758
|
-
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
|
|
1759
|
-
*/
|
|
1760
|
-
parse: function(g) {
|
|
1761
|
-
for (var d = g.length, _ = [], O = 0; O < d; O += 2)
|
|
1762
|
-
_[O >>> 3] |= parseInt(g.substr(O, 2), 16) << 24 - O % 8 * 4;
|
|
1763
|
-
return new h.init(_, d / 2);
|
|
1764
|
-
}
|
|
1765
|
-
}, b = l.Latin1 = {
|
|
1766
|
-
/**
|
|
1767
|
-
* Converts a word array to a Latin1 string.
|
|
1768
|
-
*
|
|
1769
|
-
* @param {WordArray} wordArray The word array.
|
|
1770
|
-
*
|
|
1771
|
-
* @return {string} The Latin1 string.
|
|
1772
|
-
*
|
|
1773
|
-
* @static
|
|
1774
|
-
*
|
|
1775
|
-
* @example
|
|
1776
|
-
*
|
|
1777
|
-
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
|
|
1778
|
-
*/
|
|
1779
|
-
stringify: function(g) {
|
|
1780
|
-
for (var d = g.words, _ = g.sigBytes, O = [], M = 0; M < _; M++) {
|
|
1781
|
-
var H = d[M >>> 2] >>> 24 - M % 4 * 8 & 255;
|
|
1782
|
-
O.push(String.fromCharCode(H));
|
|
1783
|
-
}
|
|
1784
|
-
return O.join("");
|
|
1785
|
-
},
|
|
1786
|
-
/**
|
|
1787
|
-
* Converts a Latin1 string to a word array.
|
|
1788
|
-
*
|
|
1789
|
-
* @param {string} latin1Str The Latin1 string.
|
|
1790
|
-
*
|
|
1791
|
-
* @return {WordArray} The word array.
|
|
1792
|
-
*
|
|
1793
|
-
* @static
|
|
1794
|
-
*
|
|
1795
|
-
* @example
|
|
1796
|
-
*
|
|
1797
|
-
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
|
|
1798
|
-
*/
|
|
1799
|
-
parse: function(g) {
|
|
1800
|
-
for (var d = g.length, _ = [], O = 0; O < d; O++)
|
|
1801
|
-
_[O >>> 2] |= (g.charCodeAt(O) & 255) << 24 - O % 4 * 8;
|
|
1802
|
-
return new h.init(_, d);
|
|
1803
|
-
}
|
|
1804
|
-
}, p = l.Utf8 = {
|
|
1805
|
-
/**
|
|
1806
|
-
* Converts a word array to a UTF-8 string.
|
|
1807
|
-
*
|
|
1808
|
-
* @param {WordArray} wordArray The word array.
|
|
1809
|
-
*
|
|
1810
|
-
* @return {string} The UTF-8 string.
|
|
1811
|
-
*
|
|
1812
|
-
* @static
|
|
1813
|
-
*
|
|
1814
|
-
* @example
|
|
1815
|
-
*
|
|
1816
|
-
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
|
|
1817
|
-
*/
|
|
1818
|
-
stringify: function(g) {
|
|
1819
|
-
try {
|
|
1820
|
-
return decodeURIComponent(escape(b.stringify(g)));
|
|
1821
|
-
} catch {
|
|
1822
|
-
throw new Error("Malformed UTF-8 data");
|
|
1823
|
-
}
|
|
1824
|
-
},
|
|
1825
|
-
/**
|
|
1826
|
-
* Converts a UTF-8 string to a word array.
|
|
1827
|
-
*
|
|
1828
|
-
* @param {string} utf8Str The UTF-8 string.
|
|
1829
|
-
*
|
|
1830
|
-
* @return {WordArray} The word array.
|
|
1831
|
-
*
|
|
1832
|
-
* @static
|
|
1833
|
-
*
|
|
1834
|
-
* @example
|
|
1835
|
-
*
|
|
1836
|
-
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
|
|
1837
|
-
*/
|
|
1838
|
-
parse: function(g) {
|
|
1839
|
-
return b.parse(unescape(encodeURIComponent(g)));
|
|
1840
|
-
}
|
|
1841
|
-
}, C = o.BufferedBlockAlgorithm = c.extend({
|
|
1842
|
-
/**
|
|
1843
|
-
* Resets this block algorithm's data buffer to its initial state.
|
|
1844
|
-
*
|
|
1845
|
-
* @example
|
|
1846
|
-
*
|
|
1847
|
-
* bufferedBlockAlgorithm.reset();
|
|
1848
|
-
*/
|
|
1849
|
-
reset: function() {
|
|
1850
|
-
this._data = new h.init(), this._nDataBytes = 0;
|
|
1851
|
-
},
|
|
1852
|
-
/**
|
|
1853
|
-
* Adds new data to this block algorithm's buffer.
|
|
1854
|
-
*
|
|
1855
|
-
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
|
|
1856
|
-
*
|
|
1857
|
-
* @example
|
|
1858
|
-
*
|
|
1859
|
-
* bufferedBlockAlgorithm._append('data');
|
|
1860
|
-
* bufferedBlockAlgorithm._append(wordArray);
|
|
1861
|
-
*/
|
|
1862
|
-
_append: function(g) {
|
|
1863
|
-
typeof g == "string" && (g = p.parse(g)), this._data.concat(g), this._nDataBytes += g.sigBytes;
|
|
1864
|
-
},
|
|
1865
|
-
/**
|
|
1866
|
-
* Processes available data blocks.
|
|
1867
|
-
*
|
|
1868
|
-
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
|
|
1869
|
-
*
|
|
1870
|
-
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
|
|
1871
|
-
*
|
|
1872
|
-
* @return {WordArray} The processed data.
|
|
1873
|
-
*
|
|
1874
|
-
* @example
|
|
1875
|
-
*
|
|
1876
|
-
* var processedData = bufferedBlockAlgorithm._process();
|
|
1877
|
-
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
|
|
1878
|
-
*/
|
|
1879
|
-
_process: function(g) {
|
|
1880
|
-
var d, _ = this._data, O = _.words, M = _.sigBytes, H = this.blockSize, I = H * 4, F = M / I;
|
|
1881
|
-
g ? F = n.ceil(F) : F = n.max((F | 0) - this._minBufferSize, 0);
|
|
1882
|
-
var v = F * H, w = n.min(v * 4, M);
|
|
1883
|
-
if (v) {
|
|
1884
|
-
for (var A = 0; A < v; A += H)
|
|
1885
|
-
this._doProcessBlock(O, A);
|
|
1886
|
-
d = O.splice(0, v), _.sigBytes -= w;
|
|
1887
|
-
}
|
|
1888
|
-
return new h.init(d, w);
|
|
1889
|
-
},
|
|
1890
|
-
/**
|
|
1891
|
-
* Creates a copy of this object.
|
|
1892
|
-
*
|
|
1893
|
-
* @return {Object} The clone.
|
|
1894
|
-
*
|
|
1895
|
-
* @example
|
|
1896
|
-
*
|
|
1897
|
-
* var clone = bufferedBlockAlgorithm.clone();
|
|
1898
|
-
*/
|
|
1899
|
-
clone: function() {
|
|
1900
|
-
var g = c.clone.call(this);
|
|
1901
|
-
return g._data = this._data.clone(), g;
|
|
1902
|
-
},
|
|
1903
|
-
_minBufferSize: 0
|
|
1904
|
-
});
|
|
1905
|
-
o.Hasher = C.extend({
|
|
1906
|
-
/**
|
|
1907
|
-
* Configuration options.
|
|
1908
|
-
*/
|
|
1909
|
-
cfg: c.extend(),
|
|
1910
|
-
/**
|
|
1911
|
-
* Initializes a newly created hasher.
|
|
1912
|
-
*
|
|
1913
|
-
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
|
|
1914
|
-
*
|
|
1915
|
-
* @example
|
|
1916
|
-
*
|
|
1917
|
-
* var hasher = CryptoJS.algo.SHA256.create();
|
|
1918
|
-
*/
|
|
1919
|
-
init: function(g) {
|
|
1920
|
-
this.cfg = this.cfg.extend(g), this.reset();
|
|
1921
|
-
},
|
|
1922
|
-
/**
|
|
1923
|
-
* Resets this hasher to its initial state.
|
|
1924
|
-
*
|
|
1925
|
-
* @example
|
|
1926
|
-
*
|
|
1927
|
-
* hasher.reset();
|
|
1928
|
-
*/
|
|
1929
|
-
reset: function() {
|
|
1930
|
-
C.reset.call(this), this._doReset();
|
|
1931
|
-
},
|
|
1932
|
-
/**
|
|
1933
|
-
* Updates this hasher with a message.
|
|
1934
|
-
*
|
|
1935
|
-
* @param {WordArray|string} messageUpdate The message to append.
|
|
1936
|
-
*
|
|
1937
|
-
* @return {Hasher} This hasher.
|
|
1938
|
-
*
|
|
1939
|
-
* @example
|
|
1940
|
-
*
|
|
1941
|
-
* hasher.update('message');
|
|
1942
|
-
* hasher.update(wordArray);
|
|
1943
|
-
*/
|
|
1944
|
-
update: function(g) {
|
|
1945
|
-
return this._append(g), this._process(), this;
|
|
1946
|
-
},
|
|
1947
|
-
/**
|
|
1948
|
-
* Finalizes the hash computation.
|
|
1949
|
-
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
1950
|
-
*
|
|
1951
|
-
* @param {WordArray|string} messageUpdate (Optional) A final message update.
|
|
1952
|
-
*
|
|
1953
|
-
* @return {WordArray} The hash.
|
|
1954
|
-
*
|
|
1955
|
-
* @example
|
|
1956
|
-
*
|
|
1957
|
-
* var hash = hasher.finalize();
|
|
1958
|
-
* var hash = hasher.finalize('message');
|
|
1959
|
-
* var hash = hasher.finalize(wordArray);
|
|
1960
|
-
*/
|
|
1961
|
-
finalize: function(g) {
|
|
1962
|
-
g && this._append(g);
|
|
1963
|
-
var d = this._doFinalize();
|
|
1964
|
-
return d;
|
|
1965
|
-
},
|
|
1966
|
-
blockSize: 16,
|
|
1967
|
-
/**
|
|
1968
|
-
* Creates a shortcut function to a hasher's object interface.
|
|
1969
|
-
*
|
|
1970
|
-
* @param {Hasher} hasher The hasher to create a helper for.
|
|
1971
|
-
*
|
|
1972
|
-
* @return {Function} The shortcut function.
|
|
1973
|
-
*
|
|
1974
|
-
* @static
|
|
1975
|
-
*
|
|
1976
|
-
* @example
|
|
1977
|
-
*
|
|
1978
|
-
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
|
1979
|
-
*/
|
|
1980
|
-
_createHelper: function(g) {
|
|
1981
|
-
return function(d, _) {
|
|
1982
|
-
return new g.init(_).finalize(d);
|
|
1983
|
-
};
|
|
1984
|
-
},
|
|
1985
|
-
/**
|
|
1986
|
-
* Creates a shortcut function to the HMAC's object interface.
|
|
1987
|
-
*
|
|
1988
|
-
* @param {Hasher} hasher The hasher to use in this HMAC helper.
|
|
1989
|
-
*
|
|
1990
|
-
* @return {Function} The shortcut function.
|
|
1991
|
-
*
|
|
1992
|
-
* @static
|
|
1993
|
-
*
|
|
1994
|
-
* @example
|
|
1995
|
-
*
|
|
1996
|
-
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
|
1997
|
-
*/
|
|
1998
|
-
_createHmacHelper: function(g) {
|
|
1999
|
-
return function(d, _) {
|
|
2000
|
-
return new T.HMAC.init(g, _).finalize(d);
|
|
2001
|
-
};
|
|
2002
|
-
}
|
|
2003
|
-
});
|
|
2004
|
-
var T = f.algo = {};
|
|
2005
|
-
return f;
|
|
2006
|
-
}(Math);
|
|
2007
|
-
return r;
|
|
2008
|
-
});
|
|
2009
|
-
}(Ee)), Ee.exports;
|
|
2010
|
-
}
|
|
2011
|
-
var Be = { exports: {} }, Ze;
|
|
2012
|
-
function Sr() {
|
|
2013
|
-
return Ze || (Ze = 1, function(e, t) {
|
|
2014
|
-
(function(r, n) {
|
|
2015
|
-
e.exports = n(ne());
|
|
2016
|
-
})(V, function(r) {
|
|
2017
|
-
return function() {
|
|
2018
|
-
var n = r, s = n.lib, i = s.WordArray, a = n.enc;
|
|
2019
|
-
a.Base64 = {
|
|
2020
|
-
/**
|
|
2021
|
-
* Converts a word array to a Base64 string.
|
|
2022
|
-
*
|
|
2023
|
-
* @param {WordArray} wordArray The word array.
|
|
2024
|
-
*
|
|
2025
|
-
* @return {string} The Base64 string.
|
|
2026
|
-
*
|
|
2027
|
-
* @static
|
|
2028
|
-
*
|
|
2029
|
-
* @example
|
|
2030
|
-
*
|
|
2031
|
-
* var base64String = CryptoJS.enc.Base64.stringify(wordArray);
|
|
2032
|
-
*/
|
|
2033
|
-
stringify: function(f) {
|
|
2034
|
-
var o = f.words, c = f.sigBytes, h = this._map;
|
|
2035
|
-
f.clamp();
|
|
2036
|
-
for (var l = [], m = 0; m < c; m += 3)
|
|
2037
|
-
for (var b = o[m >>> 2] >>> 24 - m % 4 * 8 & 255, p = o[m + 1 >>> 2] >>> 24 - (m + 1) % 4 * 8 & 255, C = o[m + 2 >>> 2] >>> 24 - (m + 2) % 4 * 8 & 255, T = b << 16 | p << 8 | C, g = 0; g < 4 && m + g * 0.75 < c; g++)
|
|
2038
|
-
l.push(h.charAt(T >>> 6 * (3 - g) & 63));
|
|
2039
|
-
var d = h.charAt(64);
|
|
2040
|
-
if (d)
|
|
2041
|
-
for (; l.length % 4; )
|
|
2042
|
-
l.push(d);
|
|
2043
|
-
return l.join("");
|
|
2044
|
-
},
|
|
2045
|
-
/**
|
|
2046
|
-
* Converts a Base64 string to a word array.
|
|
2047
|
-
*
|
|
2048
|
-
* @param {string} base64Str The Base64 string.
|
|
2049
|
-
*
|
|
2050
|
-
* @return {WordArray} The word array.
|
|
2051
|
-
*
|
|
2052
|
-
* @static
|
|
2053
|
-
*
|
|
2054
|
-
* @example
|
|
2055
|
-
*
|
|
2056
|
-
* var wordArray = CryptoJS.enc.Base64.parse(base64String);
|
|
2057
|
-
*/
|
|
2058
|
-
parse: function(f) {
|
|
2059
|
-
var o = f.length, c = this._map, h = this._reverseMap;
|
|
2060
|
-
if (!h) {
|
|
2061
|
-
h = this._reverseMap = [];
|
|
2062
|
-
for (var l = 0; l < c.length; l++)
|
|
2063
|
-
h[c.charCodeAt(l)] = l;
|
|
2064
|
-
}
|
|
2065
|
-
var m = c.charAt(64);
|
|
2066
|
-
if (m) {
|
|
2067
|
-
var b = f.indexOf(m);
|
|
2068
|
-
b !== -1 && (o = b);
|
|
2069
|
-
}
|
|
2070
|
-
return u(f, o, h);
|
|
2071
|
-
},
|
|
2072
|
-
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
|
|
2073
|
-
};
|
|
2074
|
-
function u(f, o, c) {
|
|
2075
|
-
for (var h = [], l = 0, m = 0; m < o; m++)
|
|
2076
|
-
if (m % 4) {
|
|
2077
|
-
var b = c[f.charCodeAt(m - 1)] << m % 4 * 2, p = c[f.charCodeAt(m)] >>> 6 - m % 4 * 2, C = b | p;
|
|
2078
|
-
h[l >>> 2] |= C << 24 - l % 4 * 8, l++;
|
|
2079
|
-
}
|
|
2080
|
-
return i.create(h, l);
|
|
2081
|
-
}
|
|
2082
|
-
}(), r.enc.Base64;
|
|
2083
|
-
});
|
|
2084
|
-
}(Be)), Be.exports;
|
|
2085
|
-
}
|
|
2086
|
-
var ke = { exports: {} }, Ye;
|
|
2087
|
-
function Er() {
|
|
2088
|
-
return Ye || (Ye = 1, function(e, t) {
|
|
2089
|
-
(function(r, n) {
|
|
2090
|
-
e.exports = n(ne());
|
|
2091
|
-
})(V, function(r) {
|
|
2092
|
-
return function(n) {
|
|
2093
|
-
var s = r, i = s.lib, a = i.WordArray, u = i.Hasher, f = s.algo, o = [];
|
|
2094
|
-
(function() {
|
|
2095
|
-
for (var p = 0; p < 64; p++)
|
|
2096
|
-
o[p] = n.abs(n.sin(p + 1)) * 4294967296 | 0;
|
|
2097
|
-
})();
|
|
2098
|
-
var c = f.MD5 = u.extend({
|
|
2099
|
-
_doReset: function() {
|
|
2100
|
-
this._hash = new a.init([
|
|
2101
|
-
1732584193,
|
|
2102
|
-
4023233417,
|
|
2103
|
-
2562383102,
|
|
2104
|
-
271733878
|
|
2105
|
-
]);
|
|
2106
|
-
},
|
|
2107
|
-
_doProcessBlock: function(p, C) {
|
|
2108
|
-
for (var T = 0; T < 16; T++) {
|
|
2109
|
-
var g = C + T, d = p[g];
|
|
2110
|
-
p[g] = (d << 8 | d >>> 24) & 16711935 | (d << 24 | d >>> 8) & 4278255360;
|
|
2111
|
-
}
|
|
2112
|
-
var _ = this._hash.words, O = p[C + 0], M = p[C + 1], H = p[C + 2], I = p[C + 3], F = p[C + 4], v = p[C + 5], w = p[C + 6], A = p[C + 7], k = p[C + 8], B = p[C + 9], x = p[C + 10], y = p[C + 11], z = p[C + 12], P = p[C + 13], R = p[C + 14], j = p[C + 15], $ = _[0], D = _[1], S = _[2], E = _[3];
|
|
2113
|
-
$ = h($, D, S, E, O, 7, o[0]), E = h(E, $, D, S, M, 12, o[1]), S = h(S, E, $, D, H, 17, o[2]), D = h(D, S, E, $, I, 22, o[3]), $ = h($, D, S, E, F, 7, o[4]), E = h(E, $, D, S, v, 12, o[5]), S = h(S, E, $, D, w, 17, o[6]), D = h(D, S, E, $, A, 22, o[7]), $ = h($, D, S, E, k, 7, o[8]), E = h(E, $, D, S, B, 12, o[9]), S = h(S, E, $, D, x, 17, o[10]), D = h(D, S, E, $, y, 22, o[11]), $ = h($, D, S, E, z, 7, o[12]), E = h(E, $, D, S, P, 12, o[13]), S = h(S, E, $, D, R, 17, o[14]), D = h(D, S, E, $, j, 22, o[15]), $ = l($, D, S, E, M, 5, o[16]), E = l(E, $, D, S, w, 9, o[17]), S = l(S, E, $, D, y, 14, o[18]), D = l(D, S, E, $, O, 20, o[19]), $ = l($, D, S, E, v, 5, o[20]), E = l(E, $, D, S, x, 9, o[21]), S = l(S, E, $, D, j, 14, o[22]), D = l(D, S, E, $, F, 20, o[23]), $ = l($, D, S, E, B, 5, o[24]), E = l(E, $, D, S, R, 9, o[25]), S = l(S, E, $, D, I, 14, o[26]), D = l(D, S, E, $, k, 20, o[27]), $ = l($, D, S, E, P, 5, o[28]), E = l(E, $, D, S, H, 9, o[29]), S = l(S, E, $, D, A, 14, o[30]), D = l(D, S, E, $, z, 20, o[31]), $ = m($, D, S, E, v, 4, o[32]), E = m(E, $, D, S, k, 11, o[33]), S = m(S, E, $, D, y, 16, o[34]), D = m(D, S, E, $, R, 23, o[35]), $ = m($, D, S, E, M, 4, o[36]), E = m(E, $, D, S, F, 11, o[37]), S = m(S, E, $, D, A, 16, o[38]), D = m(D, S, E, $, x, 23, o[39]), $ = m($, D, S, E, P, 4, o[40]), E = m(E, $, D, S, O, 11, o[41]), S = m(S, E, $, D, I, 16, o[42]), D = m(D, S, E, $, w, 23, o[43]), $ = m($, D, S, E, B, 4, o[44]), E = m(E, $, D, S, z, 11, o[45]), S = m(S, E, $, D, j, 16, o[46]), D = m(D, S, E, $, H, 23, o[47]), $ = b($, D, S, E, O, 6, o[48]), E = b(E, $, D, S, A, 10, o[49]), S = b(S, E, $, D, R, 15, o[50]), D = b(D, S, E, $, v, 21, o[51]), $ = b($, D, S, E, z, 6, o[52]), E = b(E, $, D, S, I, 10, o[53]), S = b(S, E, $, D, x, 15, o[54]), D = b(D, S, E, $, M, 21, o[55]), $ = b($, D, S, E, k, 6, o[56]), E = b(E, $, D, S, j, 10, o[57]), S = b(S, E, $, D, w, 15, o[58]), D = b(D, S, E, $, P, 21, o[59]), $ = b($, D, S, E, F, 6, o[60]), E = b(E, $, D, S, y, 10, o[61]), S = b(S, E, $, D, H, 15, o[62]), D = b(D, S, E, $, B, 21, o[63]), _[0] = _[0] + $ | 0, _[1] = _[1] + D | 0, _[2] = _[2] + S | 0, _[3] = _[3] + E | 0;
|
|
2114
|
-
},
|
|
2115
|
-
_doFinalize: function() {
|
|
2116
|
-
var p = this._data, C = p.words, T = this._nDataBytes * 8, g = p.sigBytes * 8;
|
|
2117
|
-
C[g >>> 5] |= 128 << 24 - g % 32;
|
|
2118
|
-
var d = n.floor(T / 4294967296), _ = T;
|
|
2119
|
-
C[(g + 64 >>> 9 << 4) + 15] = (d << 8 | d >>> 24) & 16711935 | (d << 24 | d >>> 8) & 4278255360, C[(g + 64 >>> 9 << 4) + 14] = (_ << 8 | _ >>> 24) & 16711935 | (_ << 24 | _ >>> 8) & 4278255360, p.sigBytes = (C.length + 1) * 4, this._process();
|
|
2120
|
-
for (var O = this._hash, M = O.words, H = 0; H < 4; H++) {
|
|
2121
|
-
var I = M[H];
|
|
2122
|
-
M[H] = (I << 8 | I >>> 24) & 16711935 | (I << 24 | I >>> 8) & 4278255360;
|
|
2123
|
-
}
|
|
2124
|
-
return O;
|
|
2125
|
-
},
|
|
2126
|
-
clone: function() {
|
|
2127
|
-
var p = u.clone.call(this);
|
|
2128
|
-
return p._hash = this._hash.clone(), p;
|
|
2129
|
-
}
|
|
2130
|
-
});
|
|
2131
|
-
function h(p, C, T, g, d, _, O) {
|
|
2132
|
-
var M = p + (C & T | ~C & g) + d + O;
|
|
2133
|
-
return (M << _ | M >>> 32 - _) + C;
|
|
2134
|
-
}
|
|
2135
|
-
function l(p, C, T, g, d, _, O) {
|
|
2136
|
-
var M = p + (C & g | T & ~g) + d + O;
|
|
2137
|
-
return (M << _ | M >>> 32 - _) + C;
|
|
2138
|
-
}
|
|
2139
|
-
function m(p, C, T, g, d, _, O) {
|
|
2140
|
-
var M = p + (C ^ T ^ g) + d + O;
|
|
2141
|
-
return (M << _ | M >>> 32 - _) + C;
|
|
2142
|
-
}
|
|
2143
|
-
function b(p, C, T, g, d, _, O) {
|
|
2144
|
-
var M = p + (T ^ (C | ~g)) + d + O;
|
|
2145
|
-
return (M << _ | M >>> 32 - _) + C;
|
|
2146
|
-
}
|
|
2147
|
-
s.MD5 = u._createHelper(c), s.HmacMD5 = u._createHmacHelper(c);
|
|
2148
|
-
}(Math), r.MD5;
|
|
2149
|
-
});
|
|
2150
|
-
}(ke)), ke.exports;
|
|
2151
|
-
}
|
|
2152
|
-
var Me = { exports: {} }, Ae = { exports: {} }, Ve;
|
|
2153
|
-
function Br() {
|
|
2154
|
-
return Ve || (Ve = 1, function(e, t) {
|
|
2155
|
-
(function(r, n) {
|
|
2156
|
-
e.exports = n(ne());
|
|
2157
|
-
})(V, function(r) {
|
|
2158
|
-
return function() {
|
|
2159
|
-
var n = r, s = n.lib, i = s.WordArray, a = s.Hasher, u = n.algo, f = [], o = u.SHA1 = a.extend({
|
|
2160
|
-
_doReset: function() {
|
|
2161
|
-
this._hash = new i.init([
|
|
2162
|
-
1732584193,
|
|
2163
|
-
4023233417,
|
|
2164
|
-
2562383102,
|
|
2165
|
-
271733878,
|
|
2166
|
-
3285377520
|
|
2167
|
-
]);
|
|
2168
|
-
},
|
|
2169
|
-
_doProcessBlock: function(c, h) {
|
|
2170
|
-
for (var l = this._hash.words, m = l[0], b = l[1], p = l[2], C = l[3], T = l[4], g = 0; g < 80; g++) {
|
|
2171
|
-
if (g < 16)
|
|
2172
|
-
f[g] = c[h + g] | 0;
|
|
2173
|
-
else {
|
|
2174
|
-
var d = f[g - 3] ^ f[g - 8] ^ f[g - 14] ^ f[g - 16];
|
|
2175
|
-
f[g] = d << 1 | d >>> 31;
|
|
2176
|
-
}
|
|
2177
|
-
var _ = (m << 5 | m >>> 27) + T + f[g];
|
|
2178
|
-
g < 20 ? _ += (b & p | ~b & C) + 1518500249 : g < 40 ? _ += (b ^ p ^ C) + 1859775393 : g < 60 ? _ += (b & p | b & C | p & C) - 1894007588 : _ += (b ^ p ^ C) - 899497514, T = C, C = p, p = b << 30 | b >>> 2, b = m, m = _;
|
|
2179
|
-
}
|
|
2180
|
-
l[0] = l[0] + m | 0, l[1] = l[1] + b | 0, l[2] = l[2] + p | 0, l[3] = l[3] + C | 0, l[4] = l[4] + T | 0;
|
|
2181
|
-
},
|
|
2182
|
-
_doFinalize: function() {
|
|
2183
|
-
var c = this._data, h = c.words, l = this._nDataBytes * 8, m = c.sigBytes * 8;
|
|
2184
|
-
return h[m >>> 5] |= 128 << 24 - m % 32, h[(m + 64 >>> 9 << 4) + 14] = Math.floor(l / 4294967296), h[(m + 64 >>> 9 << 4) + 15] = l, c.sigBytes = h.length * 4, this._process(), this._hash;
|
|
2185
|
-
},
|
|
2186
|
-
clone: function() {
|
|
2187
|
-
var c = a.clone.call(this);
|
|
2188
|
-
return c._hash = this._hash.clone(), c;
|
|
2189
|
-
}
|
|
2190
|
-
});
|
|
2191
|
-
n.SHA1 = a._createHelper(o), n.HmacSHA1 = a._createHmacHelper(o);
|
|
2192
|
-
}(), r.SHA1;
|
|
2193
|
-
});
|
|
2194
|
-
}(Ae)), Ae.exports;
|
|
2195
|
-
}
|
|
2196
|
-
var Te = { exports: {} }, Ke;
|
|
2197
|
-
function kr() {
|
|
2198
|
-
return Ke || (Ke = 1, function(e, t) {
|
|
2199
|
-
(function(r, n) {
|
|
2200
|
-
e.exports = n(ne());
|
|
2201
|
-
})(V, function(r) {
|
|
2202
|
-
(function() {
|
|
2203
|
-
var n = r, s = n.lib, i = s.Base, a = n.enc, u = a.Utf8, f = n.algo;
|
|
2204
|
-
f.HMAC = i.extend({
|
|
2205
|
-
/**
|
|
2206
|
-
* Initializes a newly created HMAC.
|
|
2207
|
-
*
|
|
2208
|
-
* @param {Hasher} hasher The hash algorithm to use.
|
|
2209
|
-
* @param {WordArray|string} key The secret key.
|
|
2210
|
-
*
|
|
2211
|
-
* @example
|
|
2212
|
-
*
|
|
2213
|
-
* var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
|
|
2214
|
-
*/
|
|
2215
|
-
init: function(o, c) {
|
|
2216
|
-
o = this._hasher = new o.init(), typeof c == "string" && (c = u.parse(c));
|
|
2217
|
-
var h = o.blockSize, l = h * 4;
|
|
2218
|
-
c.sigBytes > l && (c = o.finalize(c)), c.clamp();
|
|
2219
|
-
for (var m = this._oKey = c.clone(), b = this._iKey = c.clone(), p = m.words, C = b.words, T = 0; T < h; T++)
|
|
2220
|
-
p[T] ^= 1549556828, C[T] ^= 909522486;
|
|
2221
|
-
m.sigBytes = b.sigBytes = l, this.reset();
|
|
2222
|
-
},
|
|
2223
|
-
/**
|
|
2224
|
-
* Resets this HMAC to its initial state.
|
|
2225
|
-
*
|
|
2226
|
-
* @example
|
|
2227
|
-
*
|
|
2228
|
-
* hmacHasher.reset();
|
|
2229
|
-
*/
|
|
2230
|
-
reset: function() {
|
|
2231
|
-
var o = this._hasher;
|
|
2232
|
-
o.reset(), o.update(this._iKey);
|
|
2233
|
-
},
|
|
2234
|
-
/**
|
|
2235
|
-
* Updates this HMAC with a message.
|
|
2236
|
-
*
|
|
2237
|
-
* @param {WordArray|string} messageUpdate The message to append.
|
|
2238
|
-
*
|
|
2239
|
-
* @return {HMAC} This HMAC instance.
|
|
2240
|
-
*
|
|
2241
|
-
* @example
|
|
2242
|
-
*
|
|
2243
|
-
* hmacHasher.update('message');
|
|
2244
|
-
* hmacHasher.update(wordArray);
|
|
2245
|
-
*/
|
|
2246
|
-
update: function(o) {
|
|
2247
|
-
return this._hasher.update(o), this;
|
|
2248
|
-
},
|
|
2249
|
-
/**
|
|
2250
|
-
* Finalizes the HMAC computation.
|
|
2251
|
-
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
2252
|
-
*
|
|
2253
|
-
* @param {WordArray|string} messageUpdate (Optional) A final message update.
|
|
2254
|
-
*
|
|
2255
|
-
* @return {WordArray} The HMAC.
|
|
2256
|
-
*
|
|
2257
|
-
* @example
|
|
2258
|
-
*
|
|
2259
|
-
* var hmac = hmacHasher.finalize();
|
|
2260
|
-
* var hmac = hmacHasher.finalize('message');
|
|
2261
|
-
* var hmac = hmacHasher.finalize(wordArray);
|
|
2262
|
-
*/
|
|
2263
|
-
finalize: function(o) {
|
|
2264
|
-
var c = this._hasher, h = c.finalize(o);
|
|
2265
|
-
c.reset();
|
|
2266
|
-
var l = c.finalize(this._oKey.clone().concat(h));
|
|
2267
|
-
return l;
|
|
2268
|
-
}
|
|
2269
|
-
});
|
|
2270
|
-
})();
|
|
2271
|
-
});
|
|
2272
|
-
}(Te)), Te.exports;
|
|
2273
|
-
}
|
|
2274
|
-
var Ge;
|
|
2275
|
-
function ht() {
|
|
2276
|
-
return Ge || (Ge = 1, function(e, t) {
|
|
2277
|
-
(function(r, n, s) {
|
|
2278
|
-
e.exports = n(ne(), Br(), kr());
|
|
2279
|
-
})(V, function(r) {
|
|
2280
|
-
return function() {
|
|
2281
|
-
var n = r, s = n.lib, i = s.Base, a = s.WordArray, u = n.algo, f = u.MD5, o = u.EvpKDF = i.extend({
|
|
2282
|
-
/**
|
|
2283
|
-
* Configuration options.
|
|
2284
|
-
*
|
|
2285
|
-
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
|
|
2286
|
-
* @property {Hasher} hasher The hash algorithm to use. Default: MD5
|
|
2287
|
-
* @property {number} iterations The number of iterations to perform. Default: 1
|
|
2288
|
-
*/
|
|
2289
|
-
cfg: i.extend({
|
|
2290
|
-
keySize: 128 / 32,
|
|
2291
|
-
hasher: f,
|
|
2292
|
-
iterations: 1
|
|
2293
|
-
}),
|
|
2294
|
-
/**
|
|
2295
|
-
* Initializes a newly created key derivation function.
|
|
2296
|
-
*
|
|
2297
|
-
* @param {Object} cfg (Optional) The configuration options to use for the derivation.
|
|
2298
|
-
*
|
|
2299
|
-
* @example
|
|
2300
|
-
*
|
|
2301
|
-
* var kdf = CryptoJS.algo.EvpKDF.create();
|
|
2302
|
-
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
|
|
2303
|
-
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
|
|
2304
|
-
*/
|
|
2305
|
-
init: function(c) {
|
|
2306
|
-
this.cfg = this.cfg.extend(c);
|
|
2307
|
-
},
|
|
2308
|
-
/**
|
|
2309
|
-
* Derives a key from a password.
|
|
2310
|
-
*
|
|
2311
|
-
* @param {WordArray|string} password The password.
|
|
2312
|
-
* @param {WordArray|string} salt A salt.
|
|
2313
|
-
*
|
|
2314
|
-
* @return {WordArray} The derived key.
|
|
2315
|
-
*
|
|
2316
|
-
* @example
|
|
2317
|
-
*
|
|
2318
|
-
* var key = kdf.compute(password, salt);
|
|
2319
|
-
*/
|
|
2320
|
-
compute: function(c, h) {
|
|
2321
|
-
for (var l, m = this.cfg, b = m.hasher.create(), p = a.create(), C = p.words, T = m.keySize, g = m.iterations; C.length < T; ) {
|
|
2322
|
-
l && b.update(l), l = b.update(c).finalize(h), b.reset();
|
|
2323
|
-
for (var d = 1; d < g; d++)
|
|
2324
|
-
l = b.finalize(l), b.reset();
|
|
2325
|
-
p.concat(l);
|
|
2326
|
-
}
|
|
2327
|
-
return p.sigBytes = T * 4, p;
|
|
2328
|
-
}
|
|
2329
|
-
});
|
|
2330
|
-
n.EvpKDF = function(c, h, l) {
|
|
2331
|
-
return o.create(l).compute(c, h);
|
|
2332
|
-
};
|
|
2333
|
-
}(), r.EvpKDF;
|
|
2334
|
-
});
|
|
2335
|
-
}(Me)), Me.exports;
|
|
2336
|
-
}
|
|
2337
|
-
var Pe = { exports: {} }, Qe;
|
|
2338
|
-
function Re() {
|
|
2339
|
-
return Qe || (Qe = 1, function(e, t) {
|
|
2340
|
-
(function(r, n, s) {
|
|
2341
|
-
e.exports = n(ne(), ht());
|
|
2342
|
-
})(V, function(r) {
|
|
2343
|
-
r.lib.Cipher || function(n) {
|
|
2344
|
-
var s = r, i = s.lib, a = i.Base, u = i.WordArray, f = i.BufferedBlockAlgorithm, o = s.enc;
|
|
2345
|
-
o.Utf8;
|
|
2346
|
-
var c = o.Base64, h = s.algo, l = h.EvpKDF, m = i.Cipher = f.extend({
|
|
2347
|
-
/**
|
|
2348
|
-
* Configuration options.
|
|
2349
|
-
*
|
|
2350
|
-
* @property {WordArray} iv The IV to use for this operation.
|
|
2351
|
-
*/
|
|
2352
|
-
cfg: a.extend(),
|
|
2353
|
-
/**
|
|
2354
|
-
* Creates this cipher in encryption mode.
|
|
2355
|
-
*
|
|
2356
|
-
* @param {WordArray} key The key.
|
|
2357
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
2358
|
-
*
|
|
2359
|
-
* @return {Cipher} A cipher instance.
|
|
2360
|
-
*
|
|
2361
|
-
* @static
|
|
2362
|
-
*
|
|
2363
|
-
* @example
|
|
2364
|
-
*
|
|
2365
|
-
* var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
|
|
2366
|
-
*/
|
|
2367
|
-
createEncryptor: function(v, w) {
|
|
2368
|
-
return this.create(this._ENC_XFORM_MODE, v, w);
|
|
2369
|
-
},
|
|
2370
|
-
/**
|
|
2371
|
-
* Creates this cipher in decryption mode.
|
|
2372
|
-
*
|
|
2373
|
-
* @param {WordArray} key The key.
|
|
2374
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
2375
|
-
*
|
|
2376
|
-
* @return {Cipher} A cipher instance.
|
|
2377
|
-
*
|
|
2378
|
-
* @static
|
|
2379
|
-
*
|
|
2380
|
-
* @example
|
|
2381
|
-
*
|
|
2382
|
-
* var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
|
|
2383
|
-
*/
|
|
2384
|
-
createDecryptor: function(v, w) {
|
|
2385
|
-
return this.create(this._DEC_XFORM_MODE, v, w);
|
|
2386
|
-
},
|
|
2387
|
-
/**
|
|
2388
|
-
* Initializes a newly created cipher.
|
|
2389
|
-
*
|
|
2390
|
-
* @param {number} xformMode Either the encryption or decryption transormation mode constant.
|
|
2391
|
-
* @param {WordArray} key The key.
|
|
2392
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
2393
|
-
*
|
|
2394
|
-
* @example
|
|
2395
|
-
*
|
|
2396
|
-
* var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
|
|
2397
|
-
*/
|
|
2398
|
-
init: function(v, w, A) {
|
|
2399
|
-
this.cfg = this.cfg.extend(A), this._xformMode = v, this._key = w, this.reset();
|
|
2400
|
-
},
|
|
2401
|
-
/**
|
|
2402
|
-
* Resets this cipher to its initial state.
|
|
2403
|
-
*
|
|
2404
|
-
* @example
|
|
2405
|
-
*
|
|
2406
|
-
* cipher.reset();
|
|
2407
|
-
*/
|
|
2408
|
-
reset: function() {
|
|
2409
|
-
f.reset.call(this), this._doReset();
|
|
2410
|
-
},
|
|
2411
|
-
/**
|
|
2412
|
-
* Adds data to be encrypted or decrypted.
|
|
2413
|
-
*
|
|
2414
|
-
* @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
|
|
2415
|
-
*
|
|
2416
|
-
* @return {WordArray} The data after processing.
|
|
2417
|
-
*
|
|
2418
|
-
* @example
|
|
2419
|
-
*
|
|
2420
|
-
* var encrypted = cipher.process('data');
|
|
2421
|
-
* var encrypted = cipher.process(wordArray);
|
|
2422
|
-
*/
|
|
2423
|
-
process: function(v) {
|
|
2424
|
-
return this._append(v), this._process();
|
|
2425
|
-
},
|
|
2426
|
-
/**
|
|
2427
|
-
* Finalizes the encryption or decryption process.
|
|
2428
|
-
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
2429
|
-
*
|
|
2430
|
-
* @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
|
|
2431
|
-
*
|
|
2432
|
-
* @return {WordArray} The data after final processing.
|
|
2433
|
-
*
|
|
2434
|
-
* @example
|
|
2435
|
-
*
|
|
2436
|
-
* var encrypted = cipher.finalize();
|
|
2437
|
-
* var encrypted = cipher.finalize('data');
|
|
2438
|
-
* var encrypted = cipher.finalize(wordArray);
|
|
2439
|
-
*/
|
|
2440
|
-
finalize: function(v) {
|
|
2441
|
-
v && this._append(v);
|
|
2442
|
-
var w = this._doFinalize();
|
|
2443
|
-
return w;
|
|
2444
|
-
},
|
|
2445
|
-
keySize: 128 / 32,
|
|
2446
|
-
ivSize: 128 / 32,
|
|
2447
|
-
_ENC_XFORM_MODE: 1,
|
|
2448
|
-
_DEC_XFORM_MODE: 2,
|
|
2449
|
-
/**
|
|
2450
|
-
* Creates shortcut functions to a cipher's object interface.
|
|
2451
|
-
*
|
|
2452
|
-
* @param {Cipher} cipher The cipher to create a helper for.
|
|
2453
|
-
*
|
|
2454
|
-
* @return {Object} An object with encrypt and decrypt shortcut functions.
|
|
2455
|
-
*
|
|
2456
|
-
* @static
|
|
2457
|
-
*
|
|
2458
|
-
* @example
|
|
2459
|
-
*
|
|
2460
|
-
* var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
|
|
2461
|
-
*/
|
|
2462
|
-
_createHelper: /* @__PURE__ */ function() {
|
|
2463
|
-
function v(w) {
|
|
2464
|
-
return typeof w == "string" ? F : M;
|
|
2465
|
-
}
|
|
2466
|
-
return function(w) {
|
|
2467
|
-
return {
|
|
2468
|
-
encrypt: function(A, k, B) {
|
|
2469
|
-
return v(k).encrypt(w, A, k, B);
|
|
2470
|
-
},
|
|
2471
|
-
decrypt: function(A, k, B) {
|
|
2472
|
-
return v(k).decrypt(w, A, k, B);
|
|
2473
|
-
}
|
|
2474
|
-
};
|
|
2475
|
-
};
|
|
2476
|
-
}()
|
|
2477
|
-
});
|
|
2478
|
-
i.StreamCipher = m.extend({
|
|
2479
|
-
_doFinalize: function() {
|
|
2480
|
-
var v = this._process(!0);
|
|
2481
|
-
return v;
|
|
2482
|
-
},
|
|
2483
|
-
blockSize: 1
|
|
2484
|
-
});
|
|
2485
|
-
var b = s.mode = {}, p = i.BlockCipherMode = a.extend({
|
|
2486
|
-
/**
|
|
2487
|
-
* Creates this mode for encryption.
|
|
2488
|
-
*
|
|
2489
|
-
* @param {Cipher} cipher A block cipher instance.
|
|
2490
|
-
* @param {Array} iv The IV words.
|
|
2491
|
-
*
|
|
2492
|
-
* @static
|
|
2493
|
-
*
|
|
2494
|
-
* @example
|
|
2495
|
-
*
|
|
2496
|
-
* var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
|
|
2497
|
-
*/
|
|
2498
|
-
createEncryptor: function(v, w) {
|
|
2499
|
-
return this.Encryptor.create(v, w);
|
|
2500
|
-
},
|
|
2501
|
-
/**
|
|
2502
|
-
* Creates this mode for decryption.
|
|
2503
|
-
*
|
|
2504
|
-
* @param {Cipher} cipher A block cipher instance.
|
|
2505
|
-
* @param {Array} iv The IV words.
|
|
2506
|
-
*
|
|
2507
|
-
* @static
|
|
2508
|
-
*
|
|
2509
|
-
* @example
|
|
2510
|
-
*
|
|
2511
|
-
* var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
|
|
2512
|
-
*/
|
|
2513
|
-
createDecryptor: function(v, w) {
|
|
2514
|
-
return this.Decryptor.create(v, w);
|
|
2515
|
-
},
|
|
2516
|
-
/**
|
|
2517
|
-
* Initializes a newly created mode.
|
|
2518
|
-
*
|
|
2519
|
-
* @param {Cipher} cipher A block cipher instance.
|
|
2520
|
-
* @param {Array} iv The IV words.
|
|
2521
|
-
*
|
|
2522
|
-
* @example
|
|
2523
|
-
*
|
|
2524
|
-
* var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
|
|
2525
|
-
*/
|
|
2526
|
-
init: function(v, w) {
|
|
2527
|
-
this._cipher = v, this._iv = w;
|
|
2528
|
-
}
|
|
2529
|
-
}), C = b.CBC = function() {
|
|
2530
|
-
var v = p.extend();
|
|
2531
|
-
v.Encryptor = v.extend({
|
|
2532
|
-
/**
|
|
2533
|
-
* Processes the data block at offset.
|
|
2534
|
-
*
|
|
2535
|
-
* @param {Array} words The data words to operate on.
|
|
2536
|
-
* @param {number} offset The offset where the block starts.
|
|
2537
|
-
*
|
|
2538
|
-
* @example
|
|
2539
|
-
*
|
|
2540
|
-
* mode.processBlock(data.words, offset);
|
|
2541
|
-
*/
|
|
2542
|
-
processBlock: function(A, k) {
|
|
2543
|
-
var B = this._cipher, x = B.blockSize;
|
|
2544
|
-
w.call(this, A, k, x), B.encryptBlock(A, k), this._prevBlock = A.slice(k, k + x);
|
|
2545
|
-
}
|
|
2546
|
-
}), v.Decryptor = v.extend({
|
|
2547
|
-
/**
|
|
2548
|
-
* Processes the data block at offset.
|
|
2549
|
-
*
|
|
2550
|
-
* @param {Array} words The data words to operate on.
|
|
2551
|
-
* @param {number} offset The offset where the block starts.
|
|
2552
|
-
*
|
|
2553
|
-
* @example
|
|
2554
|
-
*
|
|
2555
|
-
* mode.processBlock(data.words, offset);
|
|
2556
|
-
*/
|
|
2557
|
-
processBlock: function(A, k) {
|
|
2558
|
-
var B = this._cipher, x = B.blockSize, y = A.slice(k, k + x);
|
|
2559
|
-
B.decryptBlock(A, k), w.call(this, A, k, x), this._prevBlock = y;
|
|
2560
|
-
}
|
|
2561
|
-
});
|
|
2562
|
-
function w(A, k, B) {
|
|
2563
|
-
var x, y = this._iv;
|
|
2564
|
-
y ? (x = y, this._iv = n) : x = this._prevBlock;
|
|
2565
|
-
for (var z = 0; z < B; z++)
|
|
2566
|
-
A[k + z] ^= x[z];
|
|
2567
|
-
}
|
|
2568
|
-
return v;
|
|
2569
|
-
}(), T = s.pad = {}, g = T.Pkcs7 = {
|
|
2570
|
-
/**
|
|
2571
|
-
* Pads data using the algorithm defined in PKCS #5/7.
|
|
2572
|
-
*
|
|
2573
|
-
* @param {WordArray} data The data to pad.
|
|
2574
|
-
* @param {number} blockSize The multiple that the data should be padded to.
|
|
2575
|
-
*
|
|
2576
|
-
* @static
|
|
2577
|
-
*
|
|
2578
|
-
* @example
|
|
2579
|
-
*
|
|
2580
|
-
* CryptoJS.pad.Pkcs7.pad(wordArray, 4);
|
|
2581
|
-
*/
|
|
2582
|
-
pad: function(v, w) {
|
|
2583
|
-
for (var A = w * 4, k = A - v.sigBytes % A, B = k << 24 | k << 16 | k << 8 | k, x = [], y = 0; y < k; y += 4)
|
|
2584
|
-
x.push(B);
|
|
2585
|
-
var z = u.create(x, k);
|
|
2586
|
-
v.concat(z);
|
|
2587
|
-
},
|
|
2588
|
-
/**
|
|
2589
|
-
* Unpads data that had been padded using the algorithm defined in PKCS #5/7.
|
|
2590
|
-
*
|
|
2591
|
-
* @param {WordArray} data The data to unpad.
|
|
2592
|
-
*
|
|
2593
|
-
* @static
|
|
2594
|
-
*
|
|
2595
|
-
* @example
|
|
2596
|
-
*
|
|
2597
|
-
* CryptoJS.pad.Pkcs7.unpad(wordArray);
|
|
2598
|
-
*/
|
|
2599
|
-
unpad: function(v) {
|
|
2600
|
-
var w = v.words[v.sigBytes - 1 >>> 2] & 255;
|
|
2601
|
-
v.sigBytes -= w;
|
|
2602
|
-
}
|
|
2603
|
-
};
|
|
2604
|
-
i.BlockCipher = m.extend({
|
|
2605
|
-
/**
|
|
2606
|
-
* Configuration options.
|
|
2607
|
-
*
|
|
2608
|
-
* @property {Mode} mode The block mode to use. Default: CBC
|
|
2609
|
-
* @property {Padding} padding The padding strategy to use. Default: Pkcs7
|
|
2610
|
-
*/
|
|
2611
|
-
cfg: m.cfg.extend({
|
|
2612
|
-
mode: C,
|
|
2613
|
-
padding: g
|
|
2614
|
-
}),
|
|
2615
|
-
reset: function() {
|
|
2616
|
-
var v;
|
|
2617
|
-
m.reset.call(this);
|
|
2618
|
-
var w = this.cfg, A = w.iv, k = w.mode;
|
|
2619
|
-
this._xformMode == this._ENC_XFORM_MODE ? v = k.createEncryptor : (v = k.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == v ? this._mode.init(this, A && A.words) : (this._mode = v.call(k, this, A && A.words), this._mode.__creator = v);
|
|
2620
|
-
},
|
|
2621
|
-
_doProcessBlock: function(v, w) {
|
|
2622
|
-
this._mode.processBlock(v, w);
|
|
2623
|
-
},
|
|
2624
|
-
_doFinalize: function() {
|
|
2625
|
-
var v, w = this.cfg.padding;
|
|
2626
|
-
return this._xformMode == this._ENC_XFORM_MODE ? (w.pad(this._data, this.blockSize), v = this._process(!0)) : (v = this._process(!0), w.unpad(v)), v;
|
|
2627
|
-
},
|
|
2628
|
-
blockSize: 128 / 32
|
|
2629
|
-
});
|
|
2630
|
-
var d = i.CipherParams = a.extend({
|
|
2631
|
-
/**
|
|
2632
|
-
* Initializes a newly created cipher params object.
|
|
2633
|
-
*
|
|
2634
|
-
* @param {Object} cipherParams An object with any of the possible cipher parameters.
|
|
2635
|
-
*
|
|
2636
|
-
* @example
|
|
2637
|
-
*
|
|
2638
|
-
* var cipherParams = CryptoJS.lib.CipherParams.create({
|
|
2639
|
-
* ciphertext: ciphertextWordArray,
|
|
2640
|
-
* key: keyWordArray,
|
|
2641
|
-
* iv: ivWordArray,
|
|
2642
|
-
* salt: saltWordArray,
|
|
2643
|
-
* algorithm: CryptoJS.algo.AES,
|
|
2644
|
-
* mode: CryptoJS.mode.CBC,
|
|
2645
|
-
* padding: CryptoJS.pad.PKCS7,
|
|
2646
|
-
* blockSize: 4,
|
|
2647
|
-
* formatter: CryptoJS.format.OpenSSL
|
|
2648
|
-
* });
|
|
2649
|
-
*/
|
|
2650
|
-
init: function(v) {
|
|
2651
|
-
this.mixIn(v);
|
|
2652
|
-
},
|
|
2653
|
-
/**
|
|
2654
|
-
* Converts this cipher params object to a string.
|
|
2655
|
-
*
|
|
2656
|
-
* @param {Format} formatter (Optional) The formatting strategy to use.
|
|
2657
|
-
*
|
|
2658
|
-
* @return {string} The stringified cipher params.
|
|
2659
|
-
*
|
|
2660
|
-
* @throws Error If neither the formatter nor the default formatter is set.
|
|
2661
|
-
*
|
|
2662
|
-
* @example
|
|
2663
|
-
*
|
|
2664
|
-
* var string = cipherParams + '';
|
|
2665
|
-
* var string = cipherParams.toString();
|
|
2666
|
-
* var string = cipherParams.toString(CryptoJS.format.OpenSSL);
|
|
2667
|
-
*/
|
|
2668
|
-
toString: function(v) {
|
|
2669
|
-
return (v || this.formatter).stringify(this);
|
|
2670
|
-
}
|
|
2671
|
-
}), _ = s.format = {}, O = _.OpenSSL = {
|
|
2672
|
-
/**
|
|
2673
|
-
* Converts a cipher params object to an OpenSSL-compatible string.
|
|
2674
|
-
*
|
|
2675
|
-
* @param {CipherParams} cipherParams The cipher params object.
|
|
2676
|
-
*
|
|
2677
|
-
* @return {string} The OpenSSL-compatible string.
|
|
2678
|
-
*
|
|
2679
|
-
* @static
|
|
2680
|
-
*
|
|
2681
|
-
* @example
|
|
2682
|
-
*
|
|
2683
|
-
* var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
|
|
2684
|
-
*/
|
|
2685
|
-
stringify: function(v) {
|
|
2686
|
-
var w, A = v.ciphertext, k = v.salt;
|
|
2687
|
-
return k ? w = u.create([1398893684, 1701076831]).concat(k).concat(A) : w = A, w.toString(c);
|
|
2688
|
-
},
|
|
2689
|
-
/**
|
|
2690
|
-
* Converts an OpenSSL-compatible string to a cipher params object.
|
|
2691
|
-
*
|
|
2692
|
-
* @param {string} openSSLStr The OpenSSL-compatible string.
|
|
2693
|
-
*
|
|
2694
|
-
* @return {CipherParams} The cipher params object.
|
|
2695
|
-
*
|
|
2696
|
-
* @static
|
|
2697
|
-
*
|
|
2698
|
-
* @example
|
|
2699
|
-
*
|
|
2700
|
-
* var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
|
|
2701
|
-
*/
|
|
2702
|
-
parse: function(v) {
|
|
2703
|
-
var w, A = c.parse(v), k = A.words;
|
|
2704
|
-
return k[0] == 1398893684 && k[1] == 1701076831 && (w = u.create(k.slice(2, 4)), k.splice(0, 4), A.sigBytes -= 16), d.create({ ciphertext: A, salt: w });
|
|
2705
|
-
}
|
|
2706
|
-
}, M = i.SerializableCipher = a.extend({
|
|
2707
|
-
/**
|
|
2708
|
-
* Configuration options.
|
|
2709
|
-
*
|
|
2710
|
-
* @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
|
|
2711
|
-
*/
|
|
2712
|
-
cfg: a.extend({
|
|
2713
|
-
format: O
|
|
2714
|
-
}),
|
|
2715
|
-
/**
|
|
2716
|
-
* Encrypts a message.
|
|
2717
|
-
*
|
|
2718
|
-
* @param {Cipher} cipher The cipher algorithm to use.
|
|
2719
|
-
* @param {WordArray|string} message The message to encrypt.
|
|
2720
|
-
* @param {WordArray} key The key.
|
|
2721
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
2722
|
-
*
|
|
2723
|
-
* @return {CipherParams} A cipher params object.
|
|
2724
|
-
*
|
|
2725
|
-
* @static
|
|
2726
|
-
*
|
|
2727
|
-
* @example
|
|
2728
|
-
*
|
|
2729
|
-
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
|
|
2730
|
-
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
|
|
2731
|
-
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
|
2732
|
-
*/
|
|
2733
|
-
encrypt: function(v, w, A, k) {
|
|
2734
|
-
k = this.cfg.extend(k);
|
|
2735
|
-
var B = v.createEncryptor(A, k), x = B.finalize(w), y = B.cfg;
|
|
2736
|
-
return d.create({
|
|
2737
|
-
ciphertext: x,
|
|
2738
|
-
key: A,
|
|
2739
|
-
iv: y.iv,
|
|
2740
|
-
algorithm: v,
|
|
2741
|
-
mode: y.mode,
|
|
2742
|
-
padding: y.padding,
|
|
2743
|
-
blockSize: v.blockSize,
|
|
2744
|
-
formatter: k.format
|
|
2745
|
-
});
|
|
2746
|
-
},
|
|
2747
|
-
/**
|
|
2748
|
-
* Decrypts serialized ciphertext.
|
|
2749
|
-
*
|
|
2750
|
-
* @param {Cipher} cipher The cipher algorithm to use.
|
|
2751
|
-
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
|
|
2752
|
-
* @param {WordArray} key The key.
|
|
2753
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
2754
|
-
*
|
|
2755
|
-
* @return {WordArray} The plaintext.
|
|
2756
|
-
*
|
|
2757
|
-
* @static
|
|
2758
|
-
*
|
|
2759
|
-
* @example
|
|
2760
|
-
*
|
|
2761
|
-
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
|
2762
|
-
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
|
2763
|
-
*/
|
|
2764
|
-
decrypt: function(v, w, A, k) {
|
|
2765
|
-
k = this.cfg.extend(k), w = this._parse(w, k.format);
|
|
2766
|
-
var B = v.createDecryptor(A, k).finalize(w.ciphertext);
|
|
2767
|
-
return B;
|
|
2768
|
-
},
|
|
2769
|
-
/**
|
|
2770
|
-
* Converts serialized ciphertext to CipherParams,
|
|
2771
|
-
* else assumed CipherParams already and returns ciphertext unchanged.
|
|
2772
|
-
*
|
|
2773
|
-
* @param {CipherParams|string} ciphertext The ciphertext.
|
|
2774
|
-
* @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
|
|
2775
|
-
*
|
|
2776
|
-
* @return {CipherParams} The unserialized ciphertext.
|
|
2777
|
-
*
|
|
2778
|
-
* @static
|
|
2779
|
-
*
|
|
2780
|
-
* @example
|
|
2781
|
-
*
|
|
2782
|
-
* var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
|
|
2783
|
-
*/
|
|
2784
|
-
_parse: function(v, w) {
|
|
2785
|
-
return typeof v == "string" ? w.parse(v, this) : v;
|
|
2786
|
-
}
|
|
2787
|
-
}), H = s.kdf = {}, I = H.OpenSSL = {
|
|
2788
|
-
/**
|
|
2789
|
-
* Derives a key and IV from a password.
|
|
2790
|
-
*
|
|
2791
|
-
* @param {string} password The password to derive from.
|
|
2792
|
-
* @param {number} keySize The size in words of the key to generate.
|
|
2793
|
-
* @param {number} ivSize The size in words of the IV to generate.
|
|
2794
|
-
* @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
|
|
2795
|
-
*
|
|
2796
|
-
* @return {CipherParams} A cipher params object with the key, IV, and salt.
|
|
2797
|
-
*
|
|
2798
|
-
* @static
|
|
2799
|
-
*
|
|
2800
|
-
* @example
|
|
2801
|
-
*
|
|
2802
|
-
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
|
|
2803
|
-
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
|
|
2804
|
-
*/
|
|
2805
|
-
execute: function(v, w, A, k, B) {
|
|
2806
|
-
if (k || (k = u.random(64 / 8)), B)
|
|
2807
|
-
var x = l.create({ keySize: w + A, hasher: B }).compute(v, k);
|
|
2808
|
-
else
|
|
2809
|
-
var x = l.create({ keySize: w + A }).compute(v, k);
|
|
2810
|
-
var y = u.create(x.words.slice(w), A * 4);
|
|
2811
|
-
return x.sigBytes = w * 4, d.create({ key: x, iv: y, salt: k });
|
|
2812
|
-
}
|
|
2813
|
-
}, F = i.PasswordBasedCipher = M.extend({
|
|
2814
|
-
/**
|
|
2815
|
-
* Configuration options.
|
|
2816
|
-
*
|
|
2817
|
-
* @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
|
|
2818
|
-
*/
|
|
2819
|
-
cfg: M.cfg.extend({
|
|
2820
|
-
kdf: I
|
|
2821
|
-
}),
|
|
2822
|
-
/**
|
|
2823
|
-
* Encrypts a message using a password.
|
|
2824
|
-
*
|
|
2825
|
-
* @param {Cipher} cipher The cipher algorithm to use.
|
|
2826
|
-
* @param {WordArray|string} message The message to encrypt.
|
|
2827
|
-
* @param {string} password The password.
|
|
2828
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
2829
|
-
*
|
|
2830
|
-
* @return {CipherParams} A cipher params object.
|
|
2831
|
-
*
|
|
2832
|
-
* @static
|
|
2833
|
-
*
|
|
2834
|
-
* @example
|
|
2835
|
-
*
|
|
2836
|
-
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
|
|
2837
|
-
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
|
|
2838
|
-
*/
|
|
2839
|
-
encrypt: function(v, w, A, k) {
|
|
2840
|
-
k = this.cfg.extend(k);
|
|
2841
|
-
var B = k.kdf.execute(A, v.keySize, v.ivSize, k.salt, k.hasher);
|
|
2842
|
-
k.iv = B.iv;
|
|
2843
|
-
var x = M.encrypt.call(this, v, w, B.key, k);
|
|
2844
|
-
return x.mixIn(B), x;
|
|
2845
|
-
},
|
|
2846
|
-
/**
|
|
2847
|
-
* Decrypts serialized ciphertext using a password.
|
|
2848
|
-
*
|
|
2849
|
-
* @param {Cipher} cipher The cipher algorithm to use.
|
|
2850
|
-
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
|
|
2851
|
-
* @param {string} password The password.
|
|
2852
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
2853
|
-
*
|
|
2854
|
-
* @return {WordArray} The plaintext.
|
|
2855
|
-
*
|
|
2856
|
-
* @static
|
|
2857
|
-
*
|
|
2858
|
-
* @example
|
|
2859
|
-
*
|
|
2860
|
-
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
|
|
2861
|
-
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
|
|
2862
|
-
*/
|
|
2863
|
-
decrypt: function(v, w, A, k) {
|
|
2864
|
-
k = this.cfg.extend(k), w = this._parse(w, k.format);
|
|
2865
|
-
var B = k.kdf.execute(A, v.keySize, v.ivSize, w.salt, k.hasher);
|
|
2866
|
-
k.iv = B.iv;
|
|
2867
|
-
var x = M.decrypt.call(this, v, w, B.key, k);
|
|
2868
|
-
return x;
|
|
2869
|
-
}
|
|
2870
|
-
});
|
|
2871
|
-
}();
|
|
2872
|
-
});
|
|
2873
|
-
}(Pe)), Pe.exports;
|
|
2874
|
-
}
|
|
2875
|
-
(function(e, t) {
|
|
2876
|
-
(function(r, n, s) {
|
|
2877
|
-
e.exports = n(ne(), Sr(), Er(), ht(), Re());
|
|
2878
|
-
})(V, function(r) {
|
|
2879
|
-
return function() {
|
|
2880
|
-
var n = r, s = n.lib, i = s.BlockCipher, a = n.algo, u = [], f = [], o = [], c = [], h = [], l = [], m = [], b = [], p = [], C = [];
|
|
2881
|
-
(function() {
|
|
2882
|
-
for (var d = [], _ = 0; _ < 256; _++)
|
|
2883
|
-
_ < 128 ? d[_] = _ << 1 : d[_] = _ << 1 ^ 283;
|
|
2884
|
-
for (var O = 0, M = 0, _ = 0; _ < 256; _++) {
|
|
2885
|
-
var H = M ^ M << 1 ^ M << 2 ^ M << 3 ^ M << 4;
|
|
2886
|
-
H = H >>> 8 ^ H & 255 ^ 99, u[O] = H, f[H] = O;
|
|
2887
|
-
var I = d[O], F = d[I], v = d[F], w = d[H] * 257 ^ H * 16843008;
|
|
2888
|
-
o[O] = w << 24 | w >>> 8, c[O] = w << 16 | w >>> 16, h[O] = w << 8 | w >>> 24, l[O] = w;
|
|
2889
|
-
var w = v * 16843009 ^ F * 65537 ^ I * 257 ^ O * 16843008;
|
|
2890
|
-
m[H] = w << 24 | w >>> 8, b[H] = w << 16 | w >>> 16, p[H] = w << 8 | w >>> 24, C[H] = w, O ? (O = I ^ d[d[d[v ^ I]]], M ^= d[d[M]]) : O = M = 1;
|
|
2891
|
-
}
|
|
2892
|
-
})();
|
|
2893
|
-
var T = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], g = a.AES = i.extend({
|
|
2894
|
-
_doReset: function() {
|
|
2895
|
-
var d;
|
|
2896
|
-
if (!(this._nRounds && this._keyPriorReset === this._key)) {
|
|
2897
|
-
for (var _ = this._keyPriorReset = this._key, O = _.words, M = _.sigBytes / 4, H = this._nRounds = M + 6, I = (H + 1) * 4, F = this._keySchedule = [], v = 0; v < I; v++)
|
|
2898
|
-
v < M ? F[v] = O[v] : (d = F[v - 1], v % M ? M > 6 && v % M == 4 && (d = u[d >>> 24] << 24 | u[d >>> 16 & 255] << 16 | u[d >>> 8 & 255] << 8 | u[d & 255]) : (d = d << 8 | d >>> 24, d = u[d >>> 24] << 24 | u[d >>> 16 & 255] << 16 | u[d >>> 8 & 255] << 8 | u[d & 255], d ^= T[v / M | 0] << 24), F[v] = F[v - M] ^ d);
|
|
2899
|
-
for (var w = this._invKeySchedule = [], A = 0; A < I; A++) {
|
|
2900
|
-
var v = I - A;
|
|
2901
|
-
if (A % 4)
|
|
2902
|
-
var d = F[v];
|
|
2903
|
-
else
|
|
2904
|
-
var d = F[v - 4];
|
|
2905
|
-
A < 4 || v <= 4 ? w[A] = d : w[A] = m[u[d >>> 24]] ^ b[u[d >>> 16 & 255]] ^ p[u[d >>> 8 & 255]] ^ C[u[d & 255]];
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
},
|
|
2909
|
-
encryptBlock: function(d, _) {
|
|
2910
|
-
this._doCryptBlock(d, _, this._keySchedule, o, c, h, l, u);
|
|
2911
|
-
},
|
|
2912
|
-
decryptBlock: function(d, _) {
|
|
2913
|
-
var O = d[_ + 1];
|
|
2914
|
-
d[_ + 1] = d[_ + 3], d[_ + 3] = O, this._doCryptBlock(d, _, this._invKeySchedule, m, b, p, C, f);
|
|
2915
|
-
var O = d[_ + 1];
|
|
2916
|
-
d[_ + 1] = d[_ + 3], d[_ + 3] = O;
|
|
2917
|
-
},
|
|
2918
|
-
_doCryptBlock: function(d, _, O, M, H, I, F, v) {
|
|
2919
|
-
for (var w = this._nRounds, A = d[_] ^ O[0], k = d[_ + 1] ^ O[1], B = d[_ + 2] ^ O[2], x = d[_ + 3] ^ O[3], y = 4, z = 1; z < w; z++) {
|
|
2920
|
-
var P = M[A >>> 24] ^ H[k >>> 16 & 255] ^ I[B >>> 8 & 255] ^ F[x & 255] ^ O[y++], R = M[k >>> 24] ^ H[B >>> 16 & 255] ^ I[x >>> 8 & 255] ^ F[A & 255] ^ O[y++], j = M[B >>> 24] ^ H[x >>> 16 & 255] ^ I[A >>> 8 & 255] ^ F[k & 255] ^ O[y++], $ = M[x >>> 24] ^ H[A >>> 16 & 255] ^ I[k >>> 8 & 255] ^ F[B & 255] ^ O[y++];
|
|
2921
|
-
A = P, k = R, B = j, x = $;
|
|
2922
|
-
}
|
|
2923
|
-
var P = (v[A >>> 24] << 24 | v[k >>> 16 & 255] << 16 | v[B >>> 8 & 255] << 8 | v[x & 255]) ^ O[y++], R = (v[k >>> 24] << 24 | v[B >>> 16 & 255] << 16 | v[x >>> 8 & 255] << 8 | v[A & 255]) ^ O[y++], j = (v[B >>> 24] << 24 | v[x >>> 16 & 255] << 16 | v[A >>> 8 & 255] << 8 | v[k & 255]) ^ O[y++], $ = (v[x >>> 24] << 24 | v[A >>> 16 & 255] << 16 | v[k >>> 8 & 255] << 8 | v[B & 255]) ^ O[y++];
|
|
2924
|
-
d[_] = P, d[_ + 1] = R, d[_ + 2] = j, d[_ + 3] = $;
|
|
2925
|
-
},
|
|
2926
|
-
keySize: 256 / 32
|
|
2927
|
-
});
|
|
2928
|
-
n.AES = i._createHelper(g);
|
|
2929
|
-
}(), r.AES;
|
|
2930
|
-
});
|
|
2931
|
-
})($r);
|
|
2932
|
-
var Mr = { exports: {} };
|
|
2933
|
-
(function(e, t) {
|
|
2934
|
-
(function(r, n) {
|
|
2935
|
-
e.exports = n(ne());
|
|
2936
|
-
})(V, function(r) {
|
|
2937
|
-
return r.enc.Utf8;
|
|
2938
|
-
});
|
|
2939
|
-
})(Mr);
|
|
2940
|
-
var Ar = { exports: {} };
|
|
2941
|
-
(function(e, t) {
|
|
2942
|
-
(function(r, n, s) {
|
|
2943
|
-
e.exports = n(ne(), Re());
|
|
2944
|
-
})(V, function(r) {
|
|
2945
|
-
return r.mode.ECB = function() {
|
|
2946
|
-
var n = r.lib.BlockCipherMode.extend();
|
|
2947
|
-
return n.Encryptor = n.extend({
|
|
2948
|
-
processBlock: function(s, i) {
|
|
2949
|
-
this._cipher.encryptBlock(s, i);
|
|
2950
|
-
}
|
|
2951
|
-
}), n.Decryptor = n.extend({
|
|
2952
|
-
processBlock: function(s, i) {
|
|
2953
|
-
this._cipher.decryptBlock(s, i);
|
|
2954
|
-
}
|
|
2955
|
-
}), n;
|
|
2956
|
-
}(), r.mode.ECB;
|
|
2957
|
-
});
|
|
2958
|
-
})(Ar);
|
|
2959
|
-
var Tr = { exports: {} };
|
|
2960
|
-
(function(e, t) {
|
|
2961
|
-
(function(r, n, s) {
|
|
2962
|
-
e.exports = n(ne(), Re());
|
|
2963
|
-
})(V, function(r) {
|
|
2964
|
-
return r.pad.Pkcs7;
|
|
2965
|
-
});
|
|
2966
|
-
})(Tr);
|
|
2967
|
-
/*!
|
|
2968
|
-
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
2969
|
-
*
|
|
2970
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2971
|
-
* Released under the MIT License.
|
|
2972
|
-
*/
|
|
2973
|
-
function Je(e) {
|
|
2974
|
-
return Object.prototype.toString.call(e) === "[object Object]";
|
|
2975
|
-
}
|
|
2976
|
-
function dt(e) {
|
|
2977
|
-
var t, r;
|
|
2978
|
-
return Je(e) === !1 ? !1 : (t = e.constructor, t === void 0 ? !0 : (r = t.prototype, !(Je(r) === !1 || r.hasOwnProperty("isPrototypeOf") === !1)));
|
|
2979
|
-
}
|
|
2980
|
-
const pt = { silent: !1, logLevel: "warn" }, vt = Object.defineProperty, gt = Array.isArray || function(e) {
|
|
2981
|
-
return Object.prototype.toString.call(e) === "[object Array]";
|
|
2982
|
-
};
|
|
2983
|
-
function Y(e, t = {}, r = !1) {
|
|
2984
|
-
const n = { _vueTypes_name: { value: e, writable: !0 }, def: { value(s) {
|
|
2985
|
-
return s === void 0 ? ("default" in this && delete this.default, this) : (this.default = gt(s) ? () => [].concat(s) : dt(s) ? () => Object.assign({}, s) : s, this);
|
|
2986
|
-
} }, isRequired: { get() {
|
|
2987
|
-
return this.required = !0, this;
|
|
2988
|
-
} } };
|
|
2989
|
-
return r && (n.validate = { value() {
|
|
2990
|
-
} }), t.validator || (t.validator = () => !0), Object.defineProperties(t, n);
|
|
2991
|
-
}
|
|
2992
|
-
const Pr = () => Y("any", {}, !0), zr = () => Y("func", { type: Function }, !0), Hr = () => Y("bool", { type: Boolean }, !0), qr = () => Y("string", { type: String }, !0), Fr = () => Y("number", { type: Number }, !0), Lr = () => Y("array", { type: Array }, !0), Rr = () => Y("object", { type: Object }, !0), jr = () => Y("symbol"), Ir = () => Y("integer", { type: Number }), Ur = (e) => Y("oneOf"), Wr = (e) => Y("custom"), Zr = (e) => Y("instanceOf", { type: e }), Yr = (e) => Y("oneOfType"), Vr = (e) => Y("arrayOf", { type: Array }), Kr = (e) => Y("objectOf", { type: Object }), Gr = (e) => vt(Y("shape", { type: Object }), "loose", { get() {
|
|
2993
|
-
return this;
|
|
2994
|
-
} });
|
|
2995
|
-
function Qr(e, t, r, n = !1, s = !1) {
|
|
2996
|
-
return vt(e, t, { [n ? "get" : "value"]: () => Y(t, Object.assign({}, r), s).def(n ? e.defaults[t] : void 0) });
|
|
2997
|
-
}
|
|
2998
|
-
const un = (e, t) => Y(e, t), Jr = /* @__PURE__ */ ((e) => (e = class {
|
|
2999
|
-
static get any() {
|
|
3000
|
-
return Pr();
|
|
3001
|
-
}
|
|
3002
|
-
static get func() {
|
|
3003
|
-
return zr().def(this.defaults.func);
|
|
3004
|
-
}
|
|
3005
|
-
static get bool() {
|
|
3006
|
-
return Hr().def(this.defaults.bool);
|
|
3007
|
-
}
|
|
3008
|
-
static get string() {
|
|
3009
|
-
return qr().def(this.defaults.string);
|
|
3010
|
-
}
|
|
3011
|
-
static get number() {
|
|
3012
|
-
return Fr().def(this.defaults.number);
|
|
3013
|
-
}
|
|
3014
|
-
static get array() {
|
|
3015
|
-
return Lr().def(this.defaults.array);
|
|
3016
|
-
}
|
|
3017
|
-
static get object() {
|
|
3018
|
-
return Rr().def(this.defaults.object);
|
|
3019
|
-
}
|
|
3020
|
-
static get symbol() {
|
|
3021
|
-
return jr();
|
|
3022
|
-
}
|
|
3023
|
-
static get integer() {
|
|
3024
|
-
return Ir().def(this.defaults.integer);
|
|
3025
|
-
}
|
|
3026
|
-
static get nullable() {
|
|
3027
|
-
return { type: null };
|
|
3028
|
-
}
|
|
3029
|
-
static extend(t) {
|
|
3030
|
-
if (gt(t)) return t.forEach((a) => this.extend(a)), this;
|
|
3031
|
-
const { name: r, validate: n, getter: s = !1, type: i = null } = t;
|
|
3032
|
-
return Qr(this, r, { type: dt(i) && i.type ? null : i }, s, !!n);
|
|
3033
|
-
}
|
|
3034
|
-
}, e.defaults = {}, e.sensibleDefaults = void 0, e.config = pt, e.oneOf = Ur, e.custom = Wr, e.instanceOf = Zr, e.oneOfType = Yr, e.arrayOf = Vr, e.objectOf = Kr, e.shape = Gr, e.utils = { toType: Y, validate: (...t) => !!t }, e))();
|
|
3035
|
-
function Xr(e = { func: () => {
|
|
3036
|
-
}, bool: !0, string: "", number: 0, array: () => [], object: () => ({}), integer: 0 }) {
|
|
3037
|
-
var t;
|
|
3038
|
-
return (t = class extends Jr {
|
|
3039
|
-
static get sensibleDefaults() {
|
|
3040
|
-
return Object.assign({}, this.defaults);
|
|
3041
|
-
}
|
|
3042
|
-
static set sensibleDefaults(r) {
|
|
3043
|
-
this.defaults = r !== !1 ? Object.assign({}, r !== !0 ? r : e) : {};
|
|
3044
|
-
}
|
|
3045
|
-
}).defaults = Object.assign({}, e), t;
|
|
3046
|
-
}
|
|
3047
|
-
process.env.NODE_ENV !== "production" && pt.silent === !1 && console.warn("You are using the production shimmed version of VueTypes in a development build. Refer to https://dwightjack.github.io/vue-types/guide/installation.html#production-build to learn how to configure VueTypes for usage in multiple environments.");
|
|
3048
|
-
class fn extends Xr() {
|
|
3049
|
-
}
|
|
3050
|
-
export {
|
|
3051
|
-
un as A,
|
|
3052
|
-
Se as D,
|
|
3053
|
-
fn as V,
|
|
3054
|
-
Ot as a,
|
|
3055
|
-
rn as b,
|
|
3056
|
-
nn as c,
|
|
3057
|
-
et as d,
|
|
3058
|
-
en as e,
|
|
3059
|
-
Dt as f,
|
|
3060
|
-
on as g,
|
|
3061
|
-
an as h,
|
|
3062
|
-
Nt as i,
|
|
3063
|
-
tn as j,
|
|
3064
|
-
yt as k,
|
|
3065
|
-
sn as l,
|
|
3066
|
-
Ct as m,
|
|
3067
|
-
V as n,
|
|
3068
|
-
mt as o
|
|
3069
|
-
};
|