mp-front-cli 0.0.30 → 0.0.32
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/core/errors/error-catalog.d.ts +4 -3
- package/dist/core/errors/error-catalog.d.ts.map +1 -1
- package/dist/core/errors/message-error.d.ts +11 -6
- package/dist/core/errors/message-error.d.ts.map +1 -1
- package/dist/core/interfaces/message.d.ts +2 -3
- package/dist/core/interfaces/message.d.ts.map +1 -1
- package/dist/core/middleware/index.d.ts +3 -3
- package/dist/core/middleware/index.d.ts.map +1 -1
- package/dist/core/utils/api-request/fetch-service-be.d.ts +1 -4
- package/dist/core/utils/api-request/fetch-service-be.d.ts.map +1 -1
- package/dist/core/utils/api-request/fetch-service-fe.d.ts +3 -5
- package/dist/core/utils/api-request/fetch-service-fe.d.ts.map +1 -1
- package/dist/core/utils/custom-catch-error.d.ts +5 -0
- package/dist/core/utils/custom-catch-error.d.ts.map +1 -0
- package/dist/core/utils/custom-header.d.ts +3 -115
- package/dist/core/utils/custom-header.d.ts.map +1 -1
- package/dist/{custom-header-9a9c64e2.js → custom-header-f5d2d6e4.js} +93 -86
- package/dist/{custom-validator-16ec563a.js → custom-validator-185d0ac8.js} +391 -387
- package/dist/message-handler-d90f2bb6.js +35 -0
- package/dist/mp-front-cli-all.es.js +11 -10
- package/dist/mp-front-cli-core.es.js +73 -78
- package/dist/mp-front-cli-header.es.js +4 -3
- package/dist/mp-front-cli-utils-rxjs.es.js +11 -36
- package/dist/mp-front-cli-validator.es.js +2 -2
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var Xr = Object.defineProperty;
|
|
2
2
|
var Yr = (t, e, r) => e in t ? Xr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
-
var
|
|
4
|
-
import { g as
|
|
5
|
-
import { CustomLogger as jt } from "./mp-front-cli-logger.es.js";
|
|
3
|
+
var ee = (t, e, r) => (Yr(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
import { g as ht, C as Zr } from "./custom-encoder-b2078b5c.js";
|
|
6
5
|
import { t as Qr } from "./index-6f6eb615.js";
|
|
7
|
-
|
|
6
|
+
import { CustomLogger as jr } from "./mp-front-cli-logger.es.js";
|
|
7
|
+
const en = {
|
|
8
8
|
type: "logger",
|
|
9
9
|
log(t) {
|
|
10
10
|
this.output("log", t);
|
|
@@ -19,14 +19,14 @@ const jr = {
|
|
|
19
19
|
console && console[t] && console[t].apply(console, e);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
class
|
|
22
|
+
class Ce {
|
|
23
23
|
constructor(e) {
|
|
24
24
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
25
25
|
this.init(e, r);
|
|
26
26
|
}
|
|
27
27
|
init(e) {
|
|
28
28
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
29
|
-
this.prefix = r.prefix || "i18next:", this.logger = e ||
|
|
29
|
+
this.prefix = r.prefix || "i18next:", this.logger = e || en, this.options = r, this.debug = r.debug;
|
|
30
30
|
}
|
|
31
31
|
log() {
|
|
32
32
|
for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++)
|
|
@@ -52,17 +52,17 @@ class xe {
|
|
|
52
52
|
return a && !this.debug ? null : (typeof e[0] == "string" && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[r](e));
|
|
53
53
|
}
|
|
54
54
|
create(e) {
|
|
55
|
-
return new
|
|
55
|
+
return new Ce(this.logger, {
|
|
56
56
|
prefix: `${this.prefix}:${e}:`,
|
|
57
57
|
...this.options
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
clone(e) {
|
|
61
|
-
return e = e || this.options, e.prefix = e.prefix || this.prefix, new
|
|
61
|
+
return e = e || this.options, e.prefix = e.prefix || this.prefix, new Ce(this.logger, e);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var Z = new
|
|
65
|
-
class
|
|
64
|
+
var Z = new Ce();
|
|
65
|
+
class Le {
|
|
66
66
|
constructor() {
|
|
67
67
|
this.observers = {};
|
|
68
68
|
}
|
|
@@ -90,7 +90,7 @@ class Ue {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function pe() {
|
|
94
94
|
let t, e;
|
|
95
95
|
const r = new Promise((n, a) => {
|
|
96
96
|
t = n, e = a;
|
|
@@ -100,12 +100,12 @@ function he() {
|
|
|
100
100
|
function Rt(t) {
|
|
101
101
|
return t == null ? "" : "" + t;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function tn(t, e, r) {
|
|
104
104
|
t.forEach((n) => {
|
|
105
105
|
e[n] && (r[n] = e[n]);
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function pt(t, e, r) {
|
|
109
109
|
function n(i) {
|
|
110
110
|
return i && i.indexOf("###") > -1 ? i.replace(/###/g, ".") : i;
|
|
111
111
|
}
|
|
@@ -128,37 +128,37 @@ function Ot(t, e, r) {
|
|
|
128
128
|
const {
|
|
129
129
|
obj: n,
|
|
130
130
|
k: a
|
|
131
|
-
} =
|
|
131
|
+
} = pt(t, e, Object);
|
|
132
132
|
n[a] = r;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function rn(t, e, r, n) {
|
|
135
135
|
const {
|
|
136
136
|
obj: a,
|
|
137
137
|
k: s
|
|
138
|
-
} =
|
|
138
|
+
} = pt(t, e, Object);
|
|
139
139
|
a[s] = a[s] || [], n && (a[s] = a[s].concat(r)), n || a[s].push(r);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function _e(t, e) {
|
|
142
142
|
const {
|
|
143
143
|
obj: r,
|
|
144
144
|
k: n
|
|
145
|
-
} =
|
|
145
|
+
} = pt(t, e);
|
|
146
146
|
if (r)
|
|
147
147
|
return r[n];
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
const n =
|
|
151
|
-
return n !== void 0 ? n :
|
|
149
|
+
function nn(t, e, r) {
|
|
150
|
+
const n = _e(t, r);
|
|
151
|
+
return n !== void 0 ? n : _e(e, r);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function jt(t, e, r) {
|
|
154
154
|
for (const n in e)
|
|
155
|
-
n !== "__proto__" && n !== "constructor" && (n in t ? typeof t[n] == "string" || t[n] instanceof String || typeof e[n] == "string" || e[n] instanceof String ? r && (t[n] = e[n]) :
|
|
155
|
+
n !== "__proto__" && n !== "constructor" && (n in t ? typeof t[n] == "string" || t[n] instanceof String || typeof e[n] == "string" || e[n] instanceof String ? r && (t[n] = e[n]) : jt(t[n], e[n], r) : t[n] = e[n]);
|
|
156
156
|
return t;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function ce(t) {
|
|
159
159
|
return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
160
160
|
}
|
|
161
|
-
var
|
|
161
|
+
var an = {
|
|
162
162
|
"&": "&",
|
|
163
163
|
"<": "<",
|
|
164
164
|
">": ">",
|
|
@@ -166,13 +166,13 @@ var nn = {
|
|
|
166
166
|
"'": "'",
|
|
167
167
|
"/": "/"
|
|
168
168
|
};
|
|
169
|
-
function
|
|
170
|
-
return typeof t == "string" ? t.replace(/[&<>"'\/]/g, (e) =>
|
|
169
|
+
function sn(t) {
|
|
170
|
+
return typeof t == "string" ? t.replace(/[&<>"'\/]/g, (e) => an[e]) : t;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
function
|
|
172
|
+
const on = [" ", ",", "?", "!", ";"];
|
|
173
|
+
function cn(t, e, r) {
|
|
174
174
|
e = e || "", r = r || "";
|
|
175
|
-
const n =
|
|
175
|
+
const n = on.filter((i) => e.indexOf(i) < 0 && r.indexOf(i) < 0);
|
|
176
176
|
if (n.length === 0)
|
|
177
177
|
return !0;
|
|
178
178
|
const a = new RegExp(`(${n.map((i) => i === "?" ? "\\?" : i).join("|")})`);
|
|
@@ -183,7 +183,7 @@ function on(t, e, r) {
|
|
|
183
183
|
}
|
|
184
184
|
return s;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Pe(t, e) {
|
|
187
187
|
let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
|
|
188
188
|
if (!t)
|
|
189
189
|
return;
|
|
@@ -209,16 +209,16 @@ function _e(t, e) {
|
|
|
209
209
|
return c[o];
|
|
210
210
|
}
|
|
211
211
|
const u = n.slice(s + i).join(r);
|
|
212
|
-
return u ?
|
|
212
|
+
return u ? Pe(c, u, r) : void 0;
|
|
213
213
|
}
|
|
214
214
|
a = a[n[s]];
|
|
215
215
|
}
|
|
216
216
|
return a;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function He(t) {
|
|
219
219
|
return t && t.indexOf("_") > 0 ? t.replace("_", "-") : t;
|
|
220
220
|
}
|
|
221
|
-
class Tt extends
|
|
221
|
+
class Tt extends Le {
|
|
222
222
|
constructor(e) {
|
|
223
223
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
224
224
|
ns: ["translation"],
|
|
@@ -238,8 +238,8 @@ class Tt extends Ue {
|
|
|
238
238
|
const s = a.keySeparator !== void 0 ? a.keySeparator : this.options.keySeparator, i = a.ignoreJSONStructure !== void 0 ? a.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
239
239
|
let o = [e, r];
|
|
240
240
|
n && typeof n != "string" && (o = o.concat(n)), n && typeof n == "string" && (o = o.concat(s ? n.split(s) : n)), e.indexOf(".") > -1 && (o = e.split("."));
|
|
241
|
-
const c =
|
|
242
|
-
return c || !i || typeof n != "string" ? c :
|
|
241
|
+
const c = _e(this.data, o);
|
|
242
|
+
return c || !i || typeof n != "string" ? c : Pe(this.data && this.data[e] && this.data[e][r], n, s);
|
|
243
243
|
}
|
|
244
244
|
addResource(e, r, n, a) {
|
|
245
245
|
let s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
@@ -264,8 +264,8 @@ class Tt extends Ue {
|
|
|
264
264
|
silent: !1
|
|
265
265
|
}, o = [e, r];
|
|
266
266
|
e.indexOf(".") > -1 && (o = e.split("."), a = n, n = r, r = o[1]), this.addNamespaces(r);
|
|
267
|
-
let c =
|
|
268
|
-
a ?
|
|
267
|
+
let c = _e(this.data, o) || {};
|
|
268
|
+
a ? jt(c, n, s) : c = {
|
|
269
269
|
...c,
|
|
270
270
|
...n
|
|
271
271
|
}, Ot(this.data, o, c), i.silent || this.emit("added", e, r, n);
|
|
@@ -292,7 +292,7 @@ class Tt extends Ue {
|
|
|
292
292
|
return this.data;
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
var
|
|
295
|
+
var er = {
|
|
296
296
|
processors: {},
|
|
297
297
|
addPostProcessor(t) {
|
|
298
298
|
this.processors[t.name] = t;
|
|
@@ -304,10 +304,10 @@ var tr = {
|
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
306
|
const It = {};
|
|
307
|
-
class
|
|
307
|
+
class Ke extends Le {
|
|
308
308
|
constructor(e) {
|
|
309
309
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
310
|
-
super(),
|
|
310
|
+
super(), tn(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = r, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = Z.create("translator");
|
|
311
311
|
}
|
|
312
312
|
changeLanguage(e) {
|
|
313
313
|
e && (this.language = e);
|
|
@@ -326,7 +326,7 @@ class He extends Ue {
|
|
|
326
326
|
n === void 0 && (n = ":");
|
|
327
327
|
const a = r.keySeparator !== void 0 ? r.keySeparator : this.options.keySeparator;
|
|
328
328
|
let s = r.ns || this.options.defaultNS || [];
|
|
329
|
-
const i = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !r.keySeparator && !this.options.userDefinedNsSeparator && !r.nsSeparator && !
|
|
329
|
+
const i = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !r.keySeparator && !this.options.userDefinedNsSeparator && !r.nsSeparator && !cn(e, n, a);
|
|
330
330
|
if (i && !o) {
|
|
331
331
|
const c = e.match(this.interpolator.nestingRegexp);
|
|
332
332
|
if (c && c.length > 0)
|
|
@@ -402,36 +402,36 @@ class He extends Ue {
|
|
|
402
402
|
d = d.join(C), d && (d = this.extendTranslation(d, e, r, n));
|
|
403
403
|
else {
|
|
404
404
|
let m = !1, E = !1;
|
|
405
|
-
const _ = r.count !== void 0 && typeof r.count != "string", A =
|
|
405
|
+
const _ = r.count !== void 0 && typeof r.count != "string", A = Ke.hasDefaultValue(r), R = _ ? this.pluralResolver.getSuffix(u, r.count, r) : "", F = r.ordinal && _ ? this.pluralResolver.getSuffix(u, r.count, {
|
|
406
406
|
ordinal: !1
|
|
407
407
|
}) : "", q = _ && !r.ordinal && r.count === 0 && this.pluralResolver.shouldUseIntlApi(), Y = q && r[`defaultValue${this.options.pluralSeparator}zero`] || r[`defaultValue${R}`] || r[`defaultValue${F}`] || r.defaultValue;
|
|
408
408
|
!this.isValidLookup(d) && A && (m = !0, d = Y), this.isValidLookup(d) || (E = !0, d = i);
|
|
409
|
-
const qr = (r.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && E ? void 0 : d,
|
|
410
|
-
if (E || m ||
|
|
411
|
-
if (this.logger.log(
|
|
409
|
+
const qr = (r.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && E ? void 0 : d, de = A && Y !== d && this.options.updateMissing;
|
|
410
|
+
if (E || m || de) {
|
|
411
|
+
if (this.logger.log(de ? "updateKey" : "missingKey", u, c, i, de ? Y : d), s) {
|
|
412
412
|
const z = this.resolve(i, {
|
|
413
413
|
...r,
|
|
414
414
|
keySeparator: !1
|
|
415
415
|
});
|
|
416
416
|
z && z.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
|
|
417
417
|
}
|
|
418
|
-
let
|
|
419
|
-
const
|
|
420
|
-
if (this.options.saveMissingTo === "fallback" &&
|
|
421
|
-
for (let z = 0; z <
|
|
422
|
-
|
|
418
|
+
let fe = [];
|
|
419
|
+
const Se = this.languageUtils.getFallbackCodes(this.options.fallbackLng, r.lng || this.language);
|
|
420
|
+
if (this.options.saveMissingTo === "fallback" && Se && Se[0])
|
|
421
|
+
for (let z = 0; z < Se.length; z++)
|
|
422
|
+
fe.push(Se[z]);
|
|
423
423
|
else
|
|
424
|
-
this.options.saveMissingTo === "all" ?
|
|
425
|
-
const
|
|
426
|
-
const
|
|
427
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(z, c,
|
|
424
|
+
this.options.saveMissingTo === "all" ? fe = this.languageUtils.toResolveHierarchy(r.lng || this.language) : fe.push(r.lng || this.language);
|
|
425
|
+
const Ht = (z, ie, he) => {
|
|
426
|
+
const Kt = A && he !== d ? he : qr;
|
|
427
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(z, c, ie, Kt, de, r) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(z, c, ie, Kt, de, r), this.emit("missingKey", z, c, ie, d);
|
|
428
428
|
};
|
|
429
|
-
this.options.saveMissing && (this.options.saveMissingPlurals && _ ?
|
|
430
|
-
const
|
|
431
|
-
q && r[`defaultValue${this.options.pluralSeparator}zero`] &&
|
|
432
|
-
|
|
429
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && _ ? fe.forEach((z) => {
|
|
430
|
+
const ie = this.pluralResolver.getSuffixes(z, r);
|
|
431
|
+
q && r[`defaultValue${this.options.pluralSeparator}zero`] && ie.indexOf(`${this.options.pluralSeparator}zero`) < 0 && ie.push(`${this.options.pluralSeparator}zero`), ie.forEach((he) => {
|
|
432
|
+
Ht([z], i + he, r[`defaultValue${he}`] || Y);
|
|
433
433
|
});
|
|
434
|
-
}) :
|
|
434
|
+
}) : Ht(fe, i, Y));
|
|
435
435
|
}
|
|
436
436
|
d = this.extendTranslation(d, e, r, f, n), E && d === i && this.options.appendNamespaceToMissingKey && (d = `${c}:${i}`), (E || m) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? d = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${c}:${i}` : i, m ? d : void 0) : d = this.options.parseMissingKeyHandler(d));
|
|
437
437
|
}
|
|
@@ -475,7 +475,7 @@ class He extends Ue {
|
|
|
475
475
|
}, n)), n.interpolation && this.interpolator.reset();
|
|
476
476
|
}
|
|
477
477
|
const o = n.postProcess || this.options.postProcess, c = typeof o == "string" ? [o] : o;
|
|
478
|
-
return e != null && c && c.length && n.applyPostProcessor !== !1 && (e =
|
|
478
|
+
return e != null && c && c.length && n.applyPostProcessor !== !1 && (e = er.handle(c, e, r, this.options && this.options.postProcessPassResolved ? {
|
|
479
479
|
i18nResolved: {
|
|
480
480
|
...a,
|
|
481
481
|
usedParams: this.getUsedParamsDetails(n)
|
|
@@ -554,7 +554,7 @@ class He extends Ue {
|
|
|
554
554
|
return !1;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function ze(t) {
|
|
558
558
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
559
559
|
}
|
|
560
560
|
class Wt {
|
|
@@ -562,13 +562,13 @@ class Wt {
|
|
|
562
562
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = Z.create("languageUtils");
|
|
563
563
|
}
|
|
564
564
|
getScriptPartFromCode(e) {
|
|
565
|
-
if (e =
|
|
565
|
+
if (e = He(e), !e || e.indexOf("-") < 0)
|
|
566
566
|
return null;
|
|
567
567
|
const r = e.split("-");
|
|
568
568
|
return r.length === 2 || (r.pop(), r[r.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(r.join("-"));
|
|
569
569
|
}
|
|
570
570
|
getLanguagePartFromCode(e) {
|
|
571
|
-
if (e =
|
|
571
|
+
if (e = He(e), !e || e.indexOf("-") < 0)
|
|
572
572
|
return e;
|
|
573
573
|
const r = e.split("-");
|
|
574
574
|
return this.formatLanguageCode(r[0]);
|
|
@@ -577,7 +577,7 @@ class Wt {
|
|
|
577
577
|
if (typeof e == "string" && e.indexOf("-") > -1) {
|
|
578
578
|
const r = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
|
|
579
579
|
let n = e.split("-");
|
|
580
|
-
return this.options.lowerCaseLng ? n = n.map((a) => a.toLowerCase()) : n.length === 2 ? (n[0] = n[0].toLowerCase(), n[1] = n[1].toUpperCase(), r.indexOf(n[1].toLowerCase()) > -1 && (n[1] =
|
|
580
|
+
return this.options.lowerCaseLng ? n = n.map((a) => a.toLowerCase()) : n.length === 2 ? (n[0] = n[0].toLowerCase(), n[1] = n[1].toUpperCase(), r.indexOf(n[1].toLowerCase()) > -1 && (n[1] = ze(n[1].toLowerCase()))) : n.length === 3 && (n[0] = n[0].toLowerCase(), n[1].length === 2 && (n[1] = n[1].toUpperCase()), n[0] !== "sgn" && n[2].length === 2 && (n[2] = n[2].toUpperCase()), r.indexOf(n[1].toLowerCase()) > -1 && (n[1] = ze(n[1].toLowerCase())), r.indexOf(n[2].toLowerCase()) > -1 && (n[2] = ze(n[2].toLowerCase()))), n.join("-");
|
|
581
581
|
}
|
|
582
582
|
return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
|
|
583
583
|
}
|
|
@@ -626,7 +626,7 @@ class Wt {
|
|
|
626
626
|
}), a;
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
|
-
let
|
|
629
|
+
let un = [{
|
|
630
630
|
lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
|
|
631
631
|
nr: [1, 2],
|
|
632
632
|
fc: 1
|
|
@@ -718,7 +718,7 @@ let cn = [{
|
|
|
718
718
|
lngs: ["he", "iw"],
|
|
719
719
|
nr: [1, 2, 20, 21],
|
|
720
720
|
fc: 22
|
|
721
|
-
}],
|
|
721
|
+
}], ln = {
|
|
722
722
|
1: function(t) {
|
|
723
723
|
return +(t > 1);
|
|
724
724
|
},
|
|
@@ -786,7 +786,7 @@ let cn = [{
|
|
|
786
786
|
return t == 1 ? 0 : t == 2 ? 1 : (t < 0 || t > 10) && t % 10 == 0 ? 2 : 3;
|
|
787
787
|
}
|
|
788
788
|
};
|
|
789
|
-
const
|
|
789
|
+
const dn = ["v1", "v2", "v3"], fn = ["v4"], Ut = {
|
|
790
790
|
zero: 0,
|
|
791
791
|
one: 1,
|
|
792
792
|
two: 2,
|
|
@@ -794,21 +794,21 @@ const ln = ["v1", "v2", "v3"], dn = ["v4"], Ut = {
|
|
|
794
794
|
many: 4,
|
|
795
795
|
other: 5
|
|
796
796
|
};
|
|
797
|
-
function
|
|
797
|
+
function hn() {
|
|
798
798
|
const t = {};
|
|
799
|
-
return
|
|
799
|
+
return un.forEach((e) => {
|
|
800
800
|
e.lngs.forEach((r) => {
|
|
801
801
|
t[r] = {
|
|
802
802
|
numbers: e.nr,
|
|
803
|
-
plurals:
|
|
803
|
+
plurals: ln[e.fc]
|
|
804
804
|
};
|
|
805
805
|
});
|
|
806
806
|
}), t;
|
|
807
807
|
}
|
|
808
|
-
class
|
|
808
|
+
class pn {
|
|
809
809
|
constructor(e) {
|
|
810
810
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
811
|
-
this.languageUtils = e, this.options = r, this.logger = Z.create("pluralResolver"), (!this.options.compatibilityJSON ||
|
|
811
|
+
this.languageUtils = e, this.options = r, this.logger = Z.create("pluralResolver"), (!this.options.compatibilityJSON || fn.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = hn();
|
|
812
812
|
}
|
|
813
813
|
addRule(e, r) {
|
|
814
814
|
this.rules[e] = r;
|
|
@@ -817,7 +817,7 @@ class hn {
|
|
|
817
817
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
818
818
|
if (this.shouldUseIntlApi())
|
|
819
819
|
try {
|
|
820
|
-
return new Intl.PluralRules(
|
|
820
|
+
return new Intl.PluralRules(He(e === "dev" ? "en" : e), {
|
|
821
821
|
type: r.ordinal ? "ordinal" : "cardinal"
|
|
822
822
|
});
|
|
823
823
|
} catch {
|
|
@@ -852,14 +852,14 @@ class hn {
|
|
|
852
852
|
return this.options.compatibilityJSON === "v1" ? a === 1 ? "" : typeof a == "number" ? `_plural_${a.toString()}` : s() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? s() : this.options.prepend && n.toString() ? this.options.prepend + n.toString() : n.toString();
|
|
853
853
|
}
|
|
854
854
|
shouldUseIntlApi() {
|
|
855
|
-
return !
|
|
855
|
+
return !dn.includes(this.options.compatibilityJSON);
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
858
|
function Lt(t, e, r) {
|
|
859
|
-
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, s =
|
|
860
|
-
return !s && a && typeof r == "string" && (s =
|
|
859
|
+
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, s = nn(t, e, r);
|
|
860
|
+
return !s && a && typeof r == "string" && (s = Pe(t, r, n), s === void 0 && (s = Pe(e, r, n))), s;
|
|
861
861
|
}
|
|
862
|
-
class
|
|
862
|
+
class gn {
|
|
863
863
|
constructor() {
|
|
864
864
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
865
865
|
this.logger = Z.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((r) => r), this.init(e);
|
|
@@ -870,7 +870,7 @@ class pn {
|
|
|
870
870
|
escapeValue: !0
|
|
871
871
|
});
|
|
872
872
|
const r = e.interpolation;
|
|
873
|
-
this.escape = r.escape !== void 0 ? r.escape :
|
|
873
|
+
this.escape = r.escape !== void 0 ? r.escape : sn, this.escapeValue = r.escapeValue !== void 0 ? r.escapeValue : !0, this.useRawValueToEscape = r.useRawValueToEscape !== void 0 ? r.useRawValueToEscape : !1, this.prefix = r.prefix ? ce(r.prefix) : r.prefixEscaped || "{{", this.suffix = r.suffix ? ce(r.suffix) : r.suffixEscaped || "}}", this.formatSeparator = r.formatSeparator ? r.formatSeparator : r.formatSeparator || ",", this.unescapePrefix = r.unescapeSuffix ? "" : r.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : r.unescapeSuffix || "", this.nestingPrefix = r.nestingPrefix ? ce(r.nestingPrefix) : r.nestingPrefixEscaped || ce("$t("), this.nestingSuffix = r.nestingSuffix ? ce(r.nestingSuffix) : r.nestingSuffixEscaped || ce(")"), this.nestingOptionsSeparator = r.nestingOptionsSeparator ? r.nestingOptionsSeparator : r.nestingOptionsSeparator || ",", this.maxReplaces = r.maxReplaces ? r.maxReplaces : 1e3, this.alwaysFormat = r.alwaysFormat !== void 0 ? r.alwaysFormat : !1, this.resetRegExp();
|
|
874
874
|
}
|
|
875
875
|
reset() {
|
|
876
876
|
this.options && this.init(this.options);
|
|
@@ -976,7 +976,7 @@ class pn {
|
|
|
976
976
|
return e;
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function mn(t) {
|
|
980
980
|
let e = t.toLowerCase().trim();
|
|
981
981
|
const r = {};
|
|
982
982
|
if (t.indexOf("(") > -1) {
|
|
@@ -995,44 +995,44 @@ function gn(t) {
|
|
|
995
995
|
formatOptions: r
|
|
996
996
|
};
|
|
997
997
|
}
|
|
998
|
-
function
|
|
998
|
+
function ue(t) {
|
|
999
999
|
const e = {};
|
|
1000
1000
|
return function(n, a, s) {
|
|
1001
1001
|
const i = a + JSON.stringify(s);
|
|
1002
1002
|
let o = e[i];
|
|
1003
|
-
return o || (o = t(
|
|
1003
|
+
return o || (o = t(He(a), s), e[i] = o), o(n);
|
|
1004
1004
|
};
|
|
1005
1005
|
}
|
|
1006
|
-
class
|
|
1006
|
+
class yn {
|
|
1007
1007
|
constructor() {
|
|
1008
1008
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1009
1009
|
this.logger = Z.create("formatter"), this.options = e, this.formats = {
|
|
1010
|
-
number:
|
|
1010
|
+
number: ue((r, n) => {
|
|
1011
1011
|
const a = new Intl.NumberFormat(r, {
|
|
1012
1012
|
...n
|
|
1013
1013
|
});
|
|
1014
1014
|
return (s) => a.format(s);
|
|
1015
1015
|
}),
|
|
1016
|
-
currency:
|
|
1016
|
+
currency: ue((r, n) => {
|
|
1017
1017
|
const a = new Intl.NumberFormat(r, {
|
|
1018
1018
|
...n,
|
|
1019
1019
|
style: "currency"
|
|
1020
1020
|
});
|
|
1021
1021
|
return (s) => a.format(s);
|
|
1022
1022
|
}),
|
|
1023
|
-
datetime:
|
|
1023
|
+
datetime: ue((r, n) => {
|
|
1024
1024
|
const a = new Intl.DateTimeFormat(r, {
|
|
1025
1025
|
...n
|
|
1026
1026
|
});
|
|
1027
1027
|
return (s) => a.format(s);
|
|
1028
1028
|
}),
|
|
1029
|
-
relativetime:
|
|
1029
|
+
relativetime: ue((r, n) => {
|
|
1030
1030
|
const a = new Intl.RelativeTimeFormat(r, {
|
|
1031
1031
|
...n
|
|
1032
1032
|
});
|
|
1033
1033
|
return (s) => a.format(s, n.range || "day");
|
|
1034
1034
|
}),
|
|
1035
|
-
list:
|
|
1035
|
+
list: ue((r, n) => {
|
|
1036
1036
|
const a = new Intl.ListFormat(r, {
|
|
1037
1037
|
...n
|
|
1038
1038
|
});
|
|
@@ -1050,7 +1050,7 @@ class mn {
|
|
|
1050
1050
|
this.formats[e.toLowerCase().trim()] = r;
|
|
1051
1051
|
}
|
|
1052
1052
|
addCached(e, r) {
|
|
1053
|
-
this.formats[e.toLowerCase().trim()] =
|
|
1053
|
+
this.formats[e.toLowerCase().trim()] = ue(r);
|
|
1054
1054
|
}
|
|
1055
1055
|
format(e, r, n) {
|
|
1056
1056
|
let a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
@@ -1058,7 +1058,7 @@ class mn {
|
|
|
1058
1058
|
const {
|
|
1059
1059
|
formatName: u,
|
|
1060
1060
|
formatOptions: l
|
|
1061
|
-
} =
|
|
1061
|
+
} = mn(c);
|
|
1062
1062
|
if (this.formats[u]) {
|
|
1063
1063
|
let f = o;
|
|
1064
1064
|
try {
|
|
@@ -1078,10 +1078,10 @@ class mn {
|
|
|
1078
1078
|
}, e);
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function wn(t, e) {
|
|
1082
1082
|
t.pending[e] !== void 0 && (delete t.pending[e], t.pendingCount--);
|
|
1083
1083
|
}
|
|
1084
|
-
class
|
|
1084
|
+
class Sn extends Le {
|
|
1085
1085
|
constructor(e, r, n) {
|
|
1086
1086
|
let a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
1087
1087
|
super(), this.backend = e, this.store = r, this.services = n, this.languageUtils = n.languageUtils, this.options = a, this.logger = Z.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = a.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = a.maxRetries >= 0 ? a.maxRetries : 5, this.retryTimeout = a.retryTimeout >= 1 ? a.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(n, a.backend, a);
|
|
@@ -1112,7 +1112,7 @@ class wn extends Ue {
|
|
|
1112
1112
|
r && this.emit("failedLoading", s, i, r), n && this.store.addResourceBundle(s, i, n), this.state[e] = r ? -1 : 2;
|
|
1113
1113
|
const o = {};
|
|
1114
1114
|
this.queue.forEach((c) => {
|
|
1115
|
-
|
|
1115
|
+
rn(c.loaded, [s], i), wn(c, e), r && c.errors.push(r), c.pendingCount === 0 && !c.done && (Object.keys(c.loaded).forEach((u) => {
|
|
1116
1116
|
o[u] || (o[u] = {});
|
|
1117
1117
|
const l = c.loaded[u];
|
|
1118
1118
|
l.length && l.forEach((f) => {
|
|
@@ -1277,19 +1277,19 @@ function Dt() {
|
|
|
1277
1277
|
function Jt(t) {
|
|
1278
1278
|
return typeof t.ns == "string" && (t.ns = [t.ns]), typeof t.fallbackLng == "string" && (t.fallbackLng = [t.fallbackLng]), typeof t.fallbackNS == "string" && (t.fallbackNS = [t.fallbackNS]), t.supportedLngs && t.supportedLngs.indexOf("cimode") < 0 && (t.supportedLngs = t.supportedLngs.concat(["cimode"])), t;
|
|
1279
1279
|
}
|
|
1280
|
-
function
|
|
1280
|
+
function be() {
|
|
1281
1281
|
}
|
|
1282
|
-
function
|
|
1282
|
+
function bn(t) {
|
|
1283
1283
|
Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((r) => {
|
|
1284
1284
|
typeof t[r] == "function" && (t[r] = t[r].bind(t));
|
|
1285
1285
|
});
|
|
1286
1286
|
}
|
|
1287
|
-
class
|
|
1287
|
+
class ge extends Le {
|
|
1288
1288
|
constructor() {
|
|
1289
1289
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 ? arguments[1] : void 0;
|
|
1290
1290
|
if (super(), this.options = Jt(e), this.services = {}, this.logger = Z, this.modules = {
|
|
1291
1291
|
external: []
|
|
1292
|
-
},
|
|
1292
|
+
}, bn(this), r && !this.isInitialized && !e.isClone) {
|
|
1293
1293
|
if (!this.options.initImmediate)
|
|
1294
1294
|
return this.init(e, r), this;
|
|
1295
1295
|
setTimeout(() => {
|
|
@@ -1316,21 +1316,21 @@ class pe extends Ue {
|
|
|
1316
1316
|
if (!this.options.isClone) {
|
|
1317
1317
|
this.modules.logger ? Z.init(s(this.modules.logger), this.options) : Z.init(null, this.options);
|
|
1318
1318
|
let l;
|
|
1319
|
-
this.modules.formatter ? l = this.modules.formatter : typeof Intl < "u" && (l =
|
|
1319
|
+
this.modules.formatter ? l = this.modules.formatter : typeof Intl < "u" && (l = yn);
|
|
1320
1320
|
const f = new Wt(this.options);
|
|
1321
1321
|
this.store = new Tt(this.options.resources, this.options);
|
|
1322
1322
|
const d = this.services;
|
|
1323
|
-
d.logger = Z, d.resourceStore = this.store, d.languageUtils = f, d.pluralResolver = new
|
|
1323
|
+
d.logger = Z, d.resourceStore = this.store, d.languageUtils = f, d.pluralResolver = new pn(f, {
|
|
1324
1324
|
prepend: this.options.pluralSeparator,
|
|
1325
1325
|
compatibilityJSON: this.options.compatibilityJSON,
|
|
1326
1326
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1327
|
-
}), l && (!this.options.interpolation.format || this.options.interpolation.format === a.interpolation.format) && (d.formatter = s(l), d.formatter.init(d, this.options), this.options.interpolation.format = d.formatter.format.bind(d.formatter)), d.interpolator = new
|
|
1327
|
+
}), l && (!this.options.interpolation.format || this.options.interpolation.format === a.interpolation.format) && (d.formatter = s(l), d.formatter.init(d, this.options), this.options.interpolation.format = d.formatter.format.bind(d.formatter)), d.interpolator = new gn(this.options), d.utils = {
|
|
1328
1328
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1329
|
-
}, d.backendConnector = new
|
|
1329
|
+
}, d.backendConnector = new Sn(s(this.modules.backend), d.resourceStore, d, this.options), d.backendConnector.on("*", function(p) {
|
|
1330
1330
|
for (var h = arguments.length, g = new Array(h > 1 ? h - 1 : 0), S = 1; S < h; S++)
|
|
1331
1331
|
g[S - 1] = arguments[S];
|
|
1332
1332
|
e.emit(p, ...g);
|
|
1333
|
-
}), this.modules.languageDetector && (d.languageDetector = s(this.modules.languageDetector), d.languageDetector.init && d.languageDetector.init(d, this.options.detection, this.options)), this.modules.i18nFormat && (d.i18nFormat = s(this.modules.i18nFormat), d.i18nFormat.init && d.i18nFormat.init(this)), this.translator = new
|
|
1333
|
+
}), this.modules.languageDetector && (d.languageDetector = s(this.modules.languageDetector), d.languageDetector.init && d.languageDetector.init(d, this.options.detection, this.options)), this.modules.i18nFormat && (d.i18nFormat = s(this.modules.i18nFormat), d.i18nFormat.init && d.i18nFormat.init(this)), this.translator = new Ke(this.services, this.options), this.translator.on("*", function(p) {
|
|
1334
1334
|
for (var h = arguments.length, g = new Array(h > 1 ? h - 1 : 0), S = 1; S < h; S++)
|
|
1335
1335
|
g[S - 1] = arguments[S];
|
|
1336
1336
|
e.emit(p, ...g);
|
|
@@ -1338,7 +1338,7 @@ class pe extends Ue {
|
|
|
1338
1338
|
p.init && p.init(this);
|
|
1339
1339
|
});
|
|
1340
1340
|
}
|
|
1341
|
-
if (this.format = this.options.interpolation.format, n || (n =
|
|
1341
|
+
if (this.format = this.options.interpolation.format, n || (n = be), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1342
1342
|
const l = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1343
1343
|
l.length > 0 && l[0] !== "dev" && (this.options.lng = l[0]);
|
|
1344
1344
|
}
|
|
@@ -1351,7 +1351,7 @@ class pe extends Ue {
|
|
|
1351
1351
|
return e.store[l](...arguments), e;
|
|
1352
1352
|
};
|
|
1353
1353
|
});
|
|
1354
|
-
const c =
|
|
1354
|
+
const c = pe(), u = () => {
|
|
1355
1355
|
const l = (f, d) => {
|
|
1356
1356
|
this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), c.resolve(d), n(f, d);
|
|
1357
1357
|
};
|
|
@@ -1362,7 +1362,7 @@ class pe extends Ue {
|
|
|
1362
1362
|
return this.options.resources || !this.options.initImmediate ? u() : setTimeout(u, 0), c;
|
|
1363
1363
|
}
|
|
1364
1364
|
loadResources(e) {
|
|
1365
|
-
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1365
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : be;
|
|
1366
1366
|
const a = typeof e == "string" ? e : this.language;
|
|
1367
1367
|
if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1368
1368
|
if (a && a.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0))
|
|
@@ -1381,8 +1381,8 @@ class pe extends Ue {
|
|
|
1381
1381
|
n(null);
|
|
1382
1382
|
}
|
|
1383
1383
|
reloadResources(e, r, n) {
|
|
1384
|
-
const a =
|
|
1385
|
-
return e || (e = this.languages), r || (r = this.options.ns), n || (n =
|
|
1384
|
+
const a = pe();
|
|
1385
|
+
return e || (e = this.languages), r || (r = this.options.ns), n || (n = be), this.services.backendConnector.reload(e, r, (s) => {
|
|
1386
1386
|
a.resolve(), n(s);
|
|
1387
1387
|
}), a;
|
|
1388
1388
|
}
|
|
@@ -1391,7 +1391,7 @@ class pe extends Ue {
|
|
|
1391
1391
|
throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
1392
1392
|
if (!e.type)
|
|
1393
1393
|
throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
1394
|
-
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" &&
|
|
1394
|
+
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && er.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
1395
1395
|
}
|
|
1396
1396
|
setResolvedLanguage(e) {
|
|
1397
1397
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
|
|
@@ -1406,7 +1406,7 @@ class pe extends Ue {
|
|
|
1406
1406
|
changeLanguage(e, r) {
|
|
1407
1407
|
var n = this;
|
|
1408
1408
|
this.isLanguageChangingTo = e;
|
|
1409
|
-
const a =
|
|
1409
|
+
const a = pe();
|
|
1410
1410
|
this.emit("languageChanging", e);
|
|
1411
1411
|
const s = (c) => {
|
|
1412
1412
|
this.language = c, this.languages = this.services.languageUtils.toResolveHierarchy(c), this.resolvedLanguage = void 0, this.setResolvedLanguage(c);
|
|
@@ -1474,7 +1474,7 @@ class pe extends Ue {
|
|
|
1474
1474
|
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || i(n, e) && (!a || i(s, e)));
|
|
1475
1475
|
}
|
|
1476
1476
|
loadNamespaces(e, r) {
|
|
1477
|
-
const n =
|
|
1477
|
+
const n = pe();
|
|
1478
1478
|
return this.options.ns ? (typeof e == "string" && (e = [e]), e.forEach((a) => {
|
|
1479
1479
|
this.options.ns.indexOf(a) < 0 && this.options.ns.push(a);
|
|
1480
1480
|
}), this.loadResources((a) => {
|
|
@@ -1482,7 +1482,7 @@ class pe extends Ue {
|
|
|
1482
1482
|
}), n) : (r && r(), Promise.resolve());
|
|
1483
1483
|
}
|
|
1484
1484
|
loadLanguages(e, r) {
|
|
1485
|
-
const n =
|
|
1485
|
+
const n = pe();
|
|
1486
1486
|
typeof e == "string" && (e = [e]);
|
|
1487
1487
|
const a = this.options.preload || [], s = e.filter((i) => a.indexOf(i) < 0);
|
|
1488
1488
|
return s.length ? (this.options.preload = a.concat(s), this.loadResources((i) => {
|
|
@@ -1497,24 +1497,24 @@ class pe extends Ue {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
static createInstance() {
|
|
1499
1499
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 ? arguments[1] : void 0;
|
|
1500
|
-
return new
|
|
1500
|
+
return new ge(e, r);
|
|
1501
1501
|
}
|
|
1502
1502
|
cloneInstance() {
|
|
1503
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1503
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : be;
|
|
1504
1504
|
const n = e.forkResourceStore;
|
|
1505
1505
|
n && delete e.forkResourceStore;
|
|
1506
1506
|
const a = {
|
|
1507
1507
|
...this.options,
|
|
1508
1508
|
...e,
|
|
1509
1509
|
isClone: !0
|
|
1510
|
-
}, s = new
|
|
1510
|
+
}, s = new ge(a);
|
|
1511
1511
|
return (e.debug !== void 0 || e.prefix !== void 0) && (s.logger = s.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
|
|
1512
1512
|
s[o] = this[o];
|
|
1513
1513
|
}), s.services = {
|
|
1514
1514
|
...this.services
|
|
1515
1515
|
}, s.services.utils = {
|
|
1516
1516
|
hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
|
|
1517
|
-
}, n && (s.store = new Tt(this.store.data, a), s.services.resourceStore = s.store), s.translator = new
|
|
1517
|
+
}, n && (s.store = new Tt(this.store.data, a), s.services.resourceStore = s.store), s.translator = new Ke(s.services, a), s.translator.on("*", function(o) {
|
|
1518
1518
|
for (var c = arguments.length, u = new Array(c > 1 ? c - 1 : 0), l = 1; l < c; l++)
|
|
1519
1519
|
u[l - 1] = arguments[l];
|
|
1520
1520
|
s.emit(o, ...u);
|
|
@@ -1532,8 +1532,8 @@ class pe extends Ue {
|
|
|
1532
1532
|
};
|
|
1533
1533
|
}
|
|
1534
1534
|
}
|
|
1535
|
-
const k =
|
|
1536
|
-
k.createInstance =
|
|
1535
|
+
const k = ge.createInstance();
|
|
1536
|
+
k.createInstance = ge.createInstance;
|
|
1537
1537
|
k.createInstance;
|
|
1538
1538
|
k.dir;
|
|
1539
1539
|
k.init;
|
|
@@ -1542,13 +1542,13 @@ k.reloadResources;
|
|
|
1542
1542
|
k.use;
|
|
1543
1543
|
k.changeLanguage;
|
|
1544
1544
|
k.getFixedT;
|
|
1545
|
-
const
|
|
1545
|
+
const ve = k.t;
|
|
1546
1546
|
k.exists;
|
|
1547
1547
|
k.setDefaultNamespace;
|
|
1548
1548
|
k.hasLoadedNamespace;
|
|
1549
1549
|
k.loadNamespaces;
|
|
1550
1550
|
k.loadLanguages;
|
|
1551
|
-
const
|
|
1551
|
+
const vn = {
|
|
1552
1552
|
es: {
|
|
1553
1553
|
translation: {
|
|
1554
1554
|
...Qr
|
|
@@ -1556,7 +1556,7 @@ const bn = {
|
|
|
1556
1556
|
}
|
|
1557
1557
|
};
|
|
1558
1558
|
k.init({
|
|
1559
|
-
resources:
|
|
1559
|
+
resources: vn,
|
|
1560
1560
|
lng: "es",
|
|
1561
1561
|
// language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources
|
|
1562
1562
|
// you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage
|
|
@@ -1568,6 +1568,19 @@ k.init({
|
|
|
1568
1568
|
},
|
|
1569
1569
|
debug: !1
|
|
1570
1570
|
});
|
|
1571
|
+
class tr extends En {
|
|
1572
|
+
constructor(r) {
|
|
1573
|
+
super();
|
|
1574
|
+
ee(this, "message", "Internal Error");
|
|
1575
|
+
ee(this, "type", "modal");
|
|
1576
|
+
ee(this, "level", "error");
|
|
1577
|
+
ee(this, "title", "Error");
|
|
1578
|
+
ee(this, "code");
|
|
1579
|
+
ee(this, "payload");
|
|
1580
|
+
ee(this, "clearCookieSession");
|
|
1581
|
+
Object.assign(this, this.get(r)), this.logError("MessageErrorBFF", JSON.stringify(this));
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1571
1584
|
const j = {
|
|
1572
1585
|
// EXAMPLE ERROR
|
|
1573
1586
|
"MP-001": {
|
|
@@ -1606,40 +1619,31 @@ const j = {
|
|
|
1606
1619
|
level: "warning"
|
|
1607
1620
|
}
|
|
1608
1621
|
};
|
|
1609
|
-
class
|
|
1622
|
+
class En extends jr {
|
|
1610
1623
|
get(e = "default") {
|
|
1611
1624
|
var a, s;
|
|
1625
|
+
if (e instanceof tr)
|
|
1626
|
+
return e;
|
|
1612
1627
|
if (e instanceof Error)
|
|
1613
1628
|
return this.logError(e.message), {
|
|
1614
1629
|
...j.internalError,
|
|
1615
|
-
title:
|
|
1616
|
-
message:
|
|
1630
|
+
title: ve(j.internalError.title),
|
|
1631
|
+
message: ve(j.internalError.message)
|
|
1617
1632
|
};
|
|
1618
1633
|
const r = typeof e == "string" ? e : e.code ?? e.errorType, n = typeof e == "string" ? {} : { ...e };
|
|
1619
1634
|
return {
|
|
1620
1635
|
...j[r] ?? j.default,
|
|
1621
|
-
title:
|
|
1636
|
+
title: ve(
|
|
1622
1637
|
((a = j[r]) == null ? void 0 : a.title) ?? j.default.title,
|
|
1623
1638
|
n
|
|
1624
1639
|
),
|
|
1625
|
-
message:
|
|
1640
|
+
message: ve(
|
|
1626
1641
|
((s = j[r]) == null ? void 0 : s.message) ?? j.default.message,
|
|
1627
1642
|
n
|
|
1628
1643
|
)
|
|
1629
1644
|
};
|
|
1630
1645
|
}
|
|
1631
1646
|
}
|
|
1632
|
-
class En extends jt {
|
|
1633
|
-
constructor(r) {
|
|
1634
|
-
super();
|
|
1635
|
-
Kt(this, "messageError");
|
|
1636
|
-
const n = new vn();
|
|
1637
|
-
this.messageError = n.get(r), this.logError("MessageErrorBFF", JSON.stringify(this.messageError));
|
|
1638
|
-
}
|
|
1639
|
-
get() {
|
|
1640
|
-
return this.messageError;
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
1647
|
var rr = {}, nr = { exports: {} };
|
|
1644
1648
|
(function(t) {
|
|
1645
1649
|
function e(r) {
|
|
@@ -1653,7 +1657,7 @@ var ar = nr.exports;
|
|
|
1653
1657
|
const b = crypto, G = (t) => t instanceof CryptoKey, sr = async (t, e) => {
|
|
1654
1658
|
const r = `SHA-${t.slice(-3)}`;
|
|
1655
1659
|
return new Uint8Array(await b.subtle.digest(r, e));
|
|
1656
|
-
}, K = new TextEncoder(), X = new TextDecoder(),
|
|
1660
|
+
}, K = new TextEncoder(), X = new TextDecoder(), Re = 2 ** 32;
|
|
1657
1661
|
function Q(...t) {
|
|
1658
1662
|
const e = t.reduce((a, { length: s }) => a + s, 0), r = new Uint8Array(e);
|
|
1659
1663
|
let n = 0;
|
|
@@ -1664,38 +1668,38 @@ function Q(...t) {
|
|
|
1664
1668
|
function An(t, e) {
|
|
1665
1669
|
return Q(K.encode(t), new Uint8Array([0]), e);
|
|
1666
1670
|
}
|
|
1667
|
-
function
|
|
1668
|
-
if (e < 0 || e >=
|
|
1669
|
-
throw new RangeError(`value must be >= 0 and <= ${
|
|
1671
|
+
function ot(t, e, r) {
|
|
1672
|
+
if (e < 0 || e >= Re)
|
|
1673
|
+
throw new RangeError(`value must be >= 0 and <= ${Re - 1}. Received ${e}`);
|
|
1670
1674
|
t.set([e >>> 24, e >>> 16, e >>> 8, e & 255], r);
|
|
1671
1675
|
}
|
|
1672
1676
|
function ir(t) {
|
|
1673
|
-
const e = Math.floor(t /
|
|
1674
|
-
return
|
|
1677
|
+
const e = Math.floor(t / Re), r = t % Re, n = new Uint8Array(8);
|
|
1678
|
+
return ot(n, e, 0), ot(n, r, 4), n;
|
|
1675
1679
|
}
|
|
1676
|
-
function
|
|
1680
|
+
function gt(t) {
|
|
1677
1681
|
const e = new Uint8Array(4);
|
|
1678
|
-
return
|
|
1682
|
+
return ot(e, t), e;
|
|
1679
1683
|
}
|
|
1680
|
-
function
|
|
1681
|
-
return Q(
|
|
1684
|
+
function qe(t) {
|
|
1685
|
+
return Q(gt(t.length), t);
|
|
1682
1686
|
}
|
|
1683
1687
|
async function xn(t, e, r) {
|
|
1684
1688
|
const n = Math.ceil((e >> 3) / 32), a = new Uint8Array(n * 32);
|
|
1685
1689
|
for (let s = 0; s < n; s++) {
|
|
1686
1690
|
const i = new Uint8Array(4 + t.length + r.length);
|
|
1687
|
-
i.set(
|
|
1691
|
+
i.set(gt(s + 1)), i.set(t, 4), i.set(r, 4 + t.length), a.set(await sr("sha256", i), s * 32);
|
|
1688
1692
|
}
|
|
1689
1693
|
return a.slice(0, e >> 3);
|
|
1690
1694
|
}
|
|
1691
|
-
const
|
|
1695
|
+
const mt = (t) => {
|
|
1692
1696
|
let e = t;
|
|
1693
1697
|
typeof e == "string" && (e = K.encode(e));
|
|
1694
1698
|
const r = 32768, n = [];
|
|
1695
1699
|
for (let a = 0; a < e.length; a += r)
|
|
1696
1700
|
n.push(String.fromCharCode.apply(null, e.subarray(a, a + r)));
|
|
1697
1701
|
return btoa(n.join(""));
|
|
1698
|
-
}, O = (t) =>
|
|
1702
|
+
}, O = (t) => mt(t).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"), or = (t) => {
|
|
1699
1703
|
const e = atob(t), r = new Uint8Array(e.length);
|
|
1700
1704
|
for (let n = 0; n < e.length; n++)
|
|
1701
1705
|
r[n] = e.charCodeAt(n);
|
|
@@ -1726,7 +1730,7 @@ class V extends L {
|
|
|
1726
1730
|
super(e), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = r, this.reason = n;
|
|
1727
1731
|
}
|
|
1728
1732
|
}
|
|
1729
|
-
class
|
|
1733
|
+
class ct extends L {
|
|
1730
1734
|
static get code() {
|
|
1731
1735
|
return "ERR_JWT_EXPIRED";
|
|
1732
1736
|
}
|
|
@@ -1734,7 +1738,7 @@ class ot extends L {
|
|
|
1734
1738
|
super(e), this.code = "ERR_JWT_EXPIRED", this.claim = r, this.reason = n;
|
|
1735
1739
|
}
|
|
1736
1740
|
}
|
|
1737
|
-
class
|
|
1741
|
+
class Oe extends L {
|
|
1738
1742
|
constructor() {
|
|
1739
1743
|
super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
1740
1744
|
}
|
|
@@ -1750,7 +1754,7 @@ class x extends L {
|
|
|
1750
1754
|
return "ERR_JOSE_NOT_SUPPORTED";
|
|
1751
1755
|
}
|
|
1752
1756
|
}
|
|
1753
|
-
class
|
|
1757
|
+
class me extends L {
|
|
1754
1758
|
constructor() {
|
|
1755
1759
|
super(...arguments), this.code = "ERR_JWE_DECRYPTION_FAILED", this.message = "decryption operation failed";
|
|
1756
1760
|
}
|
|
@@ -1790,7 +1794,7 @@ class cr extends L {
|
|
|
1790
1794
|
return "ERR_JWK_INVALID";
|
|
1791
1795
|
}
|
|
1792
1796
|
}
|
|
1793
|
-
class
|
|
1797
|
+
class De extends L {
|
|
1794
1798
|
constructor() {
|
|
1795
1799
|
super(...arguments), this.code = "ERR_JWKS_INVALID";
|
|
1796
1800
|
}
|
|
@@ -1798,7 +1802,7 @@ class Le extends L {
|
|
|
1798
1802
|
return "ERR_JWKS_INVALID";
|
|
1799
1803
|
}
|
|
1800
1804
|
}
|
|
1801
|
-
class
|
|
1805
|
+
class yt extends L {
|
|
1802
1806
|
constructor() {
|
|
1803
1807
|
super(...arguments), this.code = "ERR_JWKS_NO_MATCHING_KEY", this.message = "no applicable key found in the JSON Web Key Set";
|
|
1804
1808
|
}
|
|
@@ -1822,7 +1826,7 @@ class lr extends L {
|
|
|
1822
1826
|
return "ERR_JWKS_TIMEOUT";
|
|
1823
1827
|
}
|
|
1824
1828
|
}
|
|
1825
|
-
class
|
|
1829
|
+
class wt extends L {
|
|
1826
1830
|
constructor() {
|
|
1827
1831
|
super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
|
|
1828
1832
|
}
|
|
@@ -1832,22 +1836,22 @@ class yt extends L {
|
|
|
1832
1836
|
}
|
|
1833
1837
|
const Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1834
1838
|
__proto__: null,
|
|
1835
|
-
JOSEAlgNotAllowed:
|
|
1839
|
+
JOSEAlgNotAllowed: Oe,
|
|
1836
1840
|
JOSEError: L,
|
|
1837
1841
|
JOSENotSupported: x,
|
|
1838
|
-
JWEDecryptionFailed:
|
|
1842
|
+
JWEDecryptionFailed: me,
|
|
1839
1843
|
JWEInvalid: y,
|
|
1840
1844
|
JWKInvalid: cr,
|
|
1841
|
-
JWKSInvalid:
|
|
1845
|
+
JWKSInvalid: De,
|
|
1842
1846
|
JWKSMultipleMatchingKeys: ur,
|
|
1843
|
-
JWKSNoMatchingKey:
|
|
1847
|
+
JWKSNoMatchingKey: yt,
|
|
1844
1848
|
JWKSTimeout: lr,
|
|
1845
1849
|
JWSInvalid: P,
|
|
1846
|
-
JWSSignatureVerificationFailed:
|
|
1850
|
+
JWSSignatureVerificationFailed: wt,
|
|
1847
1851
|
JWTClaimValidationFailed: V,
|
|
1848
|
-
JWTExpired:
|
|
1852
|
+
JWTExpired: ct,
|
|
1849
1853
|
JWTInvalid: B
|
|
1850
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1854
|
+
}, Symbol.toStringTag, { value: "Module" })), Je = b.getRandomValues.bind(b);
|
|
1851
1855
|
function dr(t) {
|
|
1852
1856
|
switch (t) {
|
|
1853
1857
|
case "A128GCM":
|
|
@@ -1865,10 +1869,10 @@ function dr(t) {
|
|
|
1865
1869
|
throw new x(`Unsupported JWE Algorithm: ${t}`);
|
|
1866
1870
|
}
|
|
1867
1871
|
}
|
|
1868
|
-
const fr = (t) =>
|
|
1872
|
+
const fr = (t) => Je(new Uint8Array(dr(t) >> 3)), hr = (t, e) => {
|
|
1869
1873
|
if (e.length << 3 !== dr(t))
|
|
1870
1874
|
throw new y("Invalid Initialization Vector length");
|
|
1871
|
-
},
|
|
1875
|
+
}, Te = (t, e) => {
|
|
1872
1876
|
const r = t.byteLength << 3;
|
|
1873
1877
|
if (r !== e)
|
|
1874
1878
|
throw new y(`Invalid Content Encryption Key length. Expected ${e} bits, got ${r} bits`);
|
|
@@ -1888,10 +1892,10 @@ const fr = (t) => De(new Uint8Array(dr(t) >> 3)), hr = (t, e) => {
|
|
|
1888
1892
|
function U(t, e = "algorithm.name") {
|
|
1889
1893
|
return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`);
|
|
1890
1894
|
}
|
|
1891
|
-
function
|
|
1895
|
+
function ne(t, e) {
|
|
1892
1896
|
return t.name === e;
|
|
1893
1897
|
}
|
|
1894
|
-
function
|
|
1898
|
+
function Ae(t) {
|
|
1895
1899
|
return parseInt(t.name.slice(4), 10);
|
|
1896
1900
|
}
|
|
1897
1901
|
function Pn(t) {
|
|
@@ -1922,30 +1926,30 @@ function Hn(t, e, ...r) {
|
|
|
1922
1926
|
case "HS256":
|
|
1923
1927
|
case "HS384":
|
|
1924
1928
|
case "HS512": {
|
|
1925
|
-
if (!
|
|
1929
|
+
if (!ne(t.algorithm, "HMAC"))
|
|
1926
1930
|
throw U("HMAC");
|
|
1927
1931
|
const n = parseInt(e.slice(2), 10);
|
|
1928
|
-
if (
|
|
1932
|
+
if (Ae(t.algorithm.hash) !== n)
|
|
1929
1933
|
throw U(`SHA-${n}`, "algorithm.hash");
|
|
1930
1934
|
break;
|
|
1931
1935
|
}
|
|
1932
1936
|
case "RS256":
|
|
1933
1937
|
case "RS384":
|
|
1934
1938
|
case "RS512": {
|
|
1935
|
-
if (!
|
|
1939
|
+
if (!ne(t.algorithm, "RSASSA-PKCS1-v1_5"))
|
|
1936
1940
|
throw U("RSASSA-PKCS1-v1_5");
|
|
1937
1941
|
const n = parseInt(e.slice(2), 10);
|
|
1938
|
-
if (
|
|
1942
|
+
if (Ae(t.algorithm.hash) !== n)
|
|
1939
1943
|
throw U(`SHA-${n}`, "algorithm.hash");
|
|
1940
1944
|
break;
|
|
1941
1945
|
}
|
|
1942
1946
|
case "PS256":
|
|
1943
1947
|
case "PS384":
|
|
1944
1948
|
case "PS512": {
|
|
1945
|
-
if (!
|
|
1949
|
+
if (!ne(t.algorithm, "RSA-PSS"))
|
|
1946
1950
|
throw U("RSA-PSS");
|
|
1947
1951
|
const n = parseInt(e.slice(2), 10);
|
|
1948
|
-
if (
|
|
1952
|
+
if (Ae(t.algorithm.hash) !== n)
|
|
1949
1953
|
throw U(`SHA-${n}`, "algorithm.hash");
|
|
1950
1954
|
break;
|
|
1951
1955
|
}
|
|
@@ -1957,7 +1961,7 @@ function Hn(t, e, ...r) {
|
|
|
1957
1961
|
case "ES256":
|
|
1958
1962
|
case "ES384":
|
|
1959
1963
|
case "ES512": {
|
|
1960
|
-
if (!
|
|
1964
|
+
if (!ne(t.algorithm, "ECDSA"))
|
|
1961
1965
|
throw U("ECDSA");
|
|
1962
1966
|
const n = Pn(e);
|
|
1963
1967
|
if (t.algorithm.namedCurve !== n)
|
|
@@ -1969,12 +1973,12 @@ function Hn(t, e, ...r) {
|
|
|
1969
1973
|
}
|
|
1970
1974
|
pr(t, r);
|
|
1971
1975
|
}
|
|
1972
|
-
function
|
|
1976
|
+
function se(t, e, ...r) {
|
|
1973
1977
|
switch (e) {
|
|
1974
1978
|
case "A128GCM":
|
|
1975
1979
|
case "A192GCM":
|
|
1976
1980
|
case "A256GCM": {
|
|
1977
|
-
if (!
|
|
1981
|
+
if (!ne(t.algorithm, "AES-GCM"))
|
|
1978
1982
|
throw U("AES-GCM");
|
|
1979
1983
|
const n = parseInt(e.slice(1, 4), 10);
|
|
1980
1984
|
if (t.algorithm.length !== n)
|
|
@@ -1984,7 +1988,7 @@ function ae(t, e, ...r) {
|
|
|
1984
1988
|
case "A128KW":
|
|
1985
1989
|
case "A192KW":
|
|
1986
1990
|
case "A256KW": {
|
|
1987
|
-
if (!
|
|
1991
|
+
if (!ne(t.algorithm, "AES-KW"))
|
|
1988
1992
|
throw U("AES-KW");
|
|
1989
1993
|
const n = parseInt(e.slice(1, 4), 10);
|
|
1990
1994
|
if (t.algorithm.length !== n)
|
|
@@ -2005,17 +2009,17 @@ function ae(t, e, ...r) {
|
|
|
2005
2009
|
case "PBES2-HS256+A128KW":
|
|
2006
2010
|
case "PBES2-HS384+A192KW":
|
|
2007
2011
|
case "PBES2-HS512+A256KW":
|
|
2008
|
-
if (!
|
|
2012
|
+
if (!ne(t.algorithm, "PBKDF2"))
|
|
2009
2013
|
throw U("PBKDF2");
|
|
2010
2014
|
break;
|
|
2011
2015
|
case "RSA-OAEP":
|
|
2012
2016
|
case "RSA-OAEP-256":
|
|
2013
2017
|
case "RSA-OAEP-384":
|
|
2014
2018
|
case "RSA-OAEP-512": {
|
|
2015
|
-
if (!
|
|
2019
|
+
if (!ne(t.algorithm, "RSA-OAEP"))
|
|
2016
2020
|
throw U("RSA-OAEP");
|
|
2017
2021
|
const n = parseInt(e.slice(9), 10) || 1;
|
|
2018
|
-
if (
|
|
2022
|
+
if (Ae(t.algorithm.hash) !== n)
|
|
2019
2023
|
throw U(`SHA-${n}`, "algorithm.hash");
|
|
2020
2024
|
break;
|
|
2021
2025
|
}
|
|
@@ -2050,19 +2054,19 @@ async function Kn(t, e, r, n, a, s) {
|
|
|
2050
2054
|
} catch {
|
|
2051
2055
|
}
|
|
2052
2056
|
if (!f)
|
|
2053
|
-
throw new
|
|
2057
|
+
throw new me();
|
|
2054
2058
|
let d;
|
|
2055
2059
|
try {
|
|
2056
2060
|
d = new Uint8Array(await b.subtle.decrypt({ iv: n, name: "AES-CBC" }, o, r));
|
|
2057
2061
|
} catch {
|
|
2058
2062
|
}
|
|
2059
2063
|
if (!d)
|
|
2060
|
-
throw new
|
|
2064
|
+
throw new me();
|
|
2061
2065
|
return d;
|
|
2062
2066
|
}
|
|
2063
2067
|
async function Rn(t, e, r, n, a, s) {
|
|
2064
2068
|
let i;
|
|
2065
|
-
e instanceof Uint8Array ? i = await b.subtle.importKey("raw", e, "AES-GCM", !1, ["decrypt"]) : (
|
|
2069
|
+
e instanceof Uint8Array ? i = await b.subtle.importKey("raw", e, "AES-GCM", !1, ["decrypt"]) : (se(e, t, "decrypt"), i = e);
|
|
2066
2070
|
try {
|
|
2067
2071
|
return new Uint8Array(await b.subtle.decrypt({
|
|
2068
2072
|
additionalData: s,
|
|
@@ -2071,7 +2075,7 @@ async function Rn(t, e, r, n, a, s) {
|
|
|
2071
2075
|
tagLength: 128
|
|
2072
2076
|
}, i, Q(r, a)));
|
|
2073
2077
|
} catch {
|
|
2074
|
-
throw new
|
|
2078
|
+
throw new me();
|
|
2075
2079
|
}
|
|
2076
2080
|
}
|
|
2077
2081
|
const wr = async (t, e, r, n, a, s) => {
|
|
@@ -2081,11 +2085,11 @@ const wr = async (t, e, r, n, a, s) => {
|
|
|
2081
2085
|
case "A128CBC-HS256":
|
|
2082
2086
|
case "A192CBC-HS384":
|
|
2083
2087
|
case "A256CBC-HS512":
|
|
2084
|
-
return e instanceof Uint8Array &&
|
|
2088
|
+
return e instanceof Uint8Array && Te(e, parseInt(t.slice(-3), 10)), Kn(t, e, r, n, a, s);
|
|
2085
2089
|
case "A128GCM":
|
|
2086
2090
|
case "A192GCM":
|
|
2087
2091
|
case "A256GCM":
|
|
2088
|
-
return e instanceof Uint8Array &&
|
|
2092
|
+
return e instanceof Uint8Array && Te(e, parseInt(t.slice(1, 4), 10)), Rn(t, e, r, n, a, s);
|
|
2089
2093
|
default:
|
|
2090
2094
|
throw new x("Unsupported JWE Content Encryption Algorithm");
|
|
2091
2095
|
}
|
|
@@ -2093,7 +2097,7 @@ const wr = async (t, e, r, n, a, s) => {
|
|
|
2093
2097
|
throw new x('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.');
|
|
2094
2098
|
}, Tn = async () => {
|
|
2095
2099
|
throw new x('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.');
|
|
2096
|
-
},
|
|
2100
|
+
}, ye = (...t) => {
|
|
2097
2101
|
const e = t.filter(Boolean);
|
|
2098
2102
|
if (e.length === 0 || e.length === 1)
|
|
2099
2103
|
return !0;
|
|
@@ -2125,7 +2129,7 @@ function I(t) {
|
|
|
2125
2129
|
e = Object.getPrototypeOf(e);
|
|
2126
2130
|
return Object.getPrototypeOf(t) === e;
|
|
2127
2131
|
}
|
|
2128
|
-
const
|
|
2132
|
+
const Ne = [
|
|
2129
2133
|
{ hash: "SHA-256", name: "HMAC" },
|
|
2130
2134
|
!0,
|
|
2131
2135
|
["sign"]
|
|
@@ -2136,29 +2140,29 @@ function Sr(t, e) {
|
|
|
2136
2140
|
}
|
|
2137
2141
|
function br(t, e, r) {
|
|
2138
2142
|
if (G(t))
|
|
2139
|
-
return
|
|
2143
|
+
return se(t, e, r), t;
|
|
2140
2144
|
if (t instanceof Uint8Array)
|
|
2141
2145
|
return b.subtle.importKey("raw", t, "AES-KW", !0, [r]);
|
|
2142
2146
|
throw new TypeError(M(t, ...H, "Uint8Array"));
|
|
2143
2147
|
}
|
|
2144
|
-
const
|
|
2148
|
+
const ut = async (t, e, r) => {
|
|
2145
2149
|
const n = await br(e, t, "wrapKey");
|
|
2146
2150
|
Sr(n, t);
|
|
2147
|
-
const a = await b.subtle.importKey("raw", r, ...
|
|
2151
|
+
const a = await b.subtle.importKey("raw", r, ...Ne);
|
|
2148
2152
|
return new Uint8Array(await b.subtle.wrapKey("raw", a, n, "AES-KW"));
|
|
2149
|
-
},
|
|
2153
|
+
}, lt = async (t, e, r) => {
|
|
2150
2154
|
const n = await br(e, t, "unwrapKey");
|
|
2151
2155
|
Sr(n, t);
|
|
2152
|
-
const a = await b.subtle.unwrapKey("raw", r, n, "AES-KW", ...
|
|
2156
|
+
const a = await b.subtle.unwrapKey("raw", r, n, "AES-KW", ...Ne);
|
|
2153
2157
|
return new Uint8Array(await b.subtle.exportKey("raw", a));
|
|
2154
2158
|
};
|
|
2155
2159
|
async function vr(t, e, r, n, a = new Uint8Array(0), s = new Uint8Array(0)) {
|
|
2156
2160
|
if (!G(t))
|
|
2157
2161
|
throw new TypeError(M(t, ...H));
|
|
2158
|
-
if (
|
|
2162
|
+
if (se(t, "ECDH"), !G(e))
|
|
2159
2163
|
throw new TypeError(M(e, ...H));
|
|
2160
|
-
|
|
2161
|
-
const i = Q(
|
|
2164
|
+
se(e, "ECDH", "deriveBits");
|
|
2165
|
+
const i = Q(qe(K.encode(r)), qe(a), qe(s), gt(n));
|
|
2162
2166
|
let o;
|
|
2163
2167
|
t.algorithm.name === "X25519" ? o = 256 : t.algorithm.name === "X448" ? o = 448 : o = Math.ceil(parseInt(t.algorithm.namedCurve.substr(-3), 10) / 8) << 3;
|
|
2164
2168
|
const c = new Uint8Array(await b.subtle.deriveBits({
|
|
@@ -2185,7 +2189,7 @@ function Ln(t, e) {
|
|
|
2185
2189
|
if (t instanceof Uint8Array)
|
|
2186
2190
|
return b.subtle.importKey("raw", t, "PBKDF2", !1, ["deriveBits"]);
|
|
2187
2191
|
if (G(t))
|
|
2188
|
-
return
|
|
2192
|
+
return se(t, e, "deriveBits", "deriveKey"), t;
|
|
2189
2193
|
throw new TypeError(M(t, ...H, "Uint8Array"));
|
|
2190
2194
|
}
|
|
2191
2195
|
async function Ar(t, e, r, n) {
|
|
@@ -2205,14 +2209,14 @@ async function Ar(t, e, r, n) {
|
|
|
2205
2209
|
return b.subtle.deriveKey(i, c, o, !1, ["wrapKey", "unwrapKey"]);
|
|
2206
2210
|
throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"');
|
|
2207
2211
|
}
|
|
2208
|
-
const Dn = async (t, e, r, n = 2048, a =
|
|
2212
|
+
const Dn = async (t, e, r, n = 2048, a = Je(new Uint8Array(16))) => {
|
|
2209
2213
|
const s = await Ar(a, t, n, e);
|
|
2210
|
-
return { encryptedKey: await
|
|
2214
|
+
return { encryptedKey: await ut(t.slice(-6), s, r), p2c: n, p2s: O(a) };
|
|
2211
2215
|
}, Jn = async (t, e, r, n, a) => {
|
|
2212
2216
|
const s = await Ar(a, t, n, e);
|
|
2213
|
-
return
|
|
2217
|
+
return lt(t.slice(-6), s, r);
|
|
2214
2218
|
};
|
|
2215
|
-
function
|
|
2219
|
+
function Ie(t) {
|
|
2216
2220
|
switch (t) {
|
|
2217
2221
|
case "RSA-OAEP":
|
|
2218
2222
|
case "RSA-OAEP-256":
|
|
@@ -2223,7 +2227,7 @@ function Te(t) {
|
|
|
2223
2227
|
throw new x(`alg ${t} is not supported either by JOSE or your javascript runtime`);
|
|
2224
2228
|
}
|
|
2225
2229
|
}
|
|
2226
|
-
const
|
|
2230
|
+
const $e = (t, e) => {
|
|
2227
2231
|
if (t.startsWith("RS") || t.startsWith("PS")) {
|
|
2228
2232
|
const { modulusLength: r } = e.algorithm;
|
|
2229
2233
|
if (typeof r != "number" || r < 2048)
|
|
@@ -2232,25 +2236,25 @@ const Ne = (t, e) => {
|
|
|
2232
2236
|
}, Nn = async (t, e, r) => {
|
|
2233
2237
|
if (!G(e))
|
|
2234
2238
|
throw new TypeError(M(e, ...H));
|
|
2235
|
-
if (
|
|
2236
|
-
return new Uint8Array(await b.subtle.encrypt(
|
|
2239
|
+
if (se(e, t, "encrypt", "wrapKey"), $e(t, e), e.usages.includes("encrypt"))
|
|
2240
|
+
return new Uint8Array(await b.subtle.encrypt(Ie(t), e, r));
|
|
2237
2241
|
if (e.usages.includes("wrapKey")) {
|
|
2238
|
-
const n = await b.subtle.importKey("raw", r, ...
|
|
2239
|
-
return new Uint8Array(await b.subtle.wrapKey("raw", n, e,
|
|
2242
|
+
const n = await b.subtle.importKey("raw", r, ...Ne);
|
|
2243
|
+
return new Uint8Array(await b.subtle.wrapKey("raw", n, e, Ie(t)));
|
|
2240
2244
|
}
|
|
2241
2245
|
throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation');
|
|
2242
2246
|
}, $n = async (t, e, r) => {
|
|
2243
2247
|
if (!G(e))
|
|
2244
2248
|
throw new TypeError(M(e, ...H));
|
|
2245
|
-
if (
|
|
2246
|
-
return new Uint8Array(await b.subtle.decrypt(
|
|
2249
|
+
if (se(e, t, "decrypt", "unwrapKey"), $e(t, e), e.usages.includes("decrypt"))
|
|
2250
|
+
return new Uint8Array(await b.subtle.decrypt(Ie(t), e, r));
|
|
2247
2251
|
if (e.usages.includes("unwrapKey")) {
|
|
2248
|
-
const n = await b.subtle.unwrapKey("raw", r, e,
|
|
2252
|
+
const n = await b.subtle.unwrapKey("raw", r, e, Ie(t), ...Ne);
|
|
2249
2253
|
return new Uint8Array(await b.subtle.exportKey("raw", n));
|
|
2250
2254
|
}
|
|
2251
2255
|
throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation');
|
|
2252
2256
|
};
|
|
2253
|
-
function
|
|
2257
|
+
function St(t) {
|
|
2254
2258
|
switch (t) {
|
|
2255
2259
|
case "A128GCM":
|
|
2256
2260
|
return 128;
|
|
@@ -2267,7 +2271,7 @@ function wt(t) {
|
|
|
2267
2271
|
throw new x(`Unsupported JWE Algorithm: ${t}`);
|
|
2268
2272
|
}
|
|
2269
2273
|
}
|
|
2270
|
-
const
|
|
2274
|
+
const oe = (t) => Je(new Uint8Array(St(t) >> 3)), xr = (t, e) => {
|
|
2271
2275
|
const r = (t.match(/.{1,64}/g) || []).join(`
|
|
2272
2276
|
`);
|
|
2273
2277
|
return `-----BEGIN ${e}-----
|
|
@@ -2280,29 +2284,29 @@ ${r}
|
|
|
2280
2284
|
throw new TypeError("CryptoKey is not extractable");
|
|
2281
2285
|
if (r.type !== t)
|
|
2282
2286
|
throw new TypeError(`key is not a ${t} key`);
|
|
2283
|
-
return xr(
|
|
2284
|
-
}, Mn = (t) => Cr("public", "spki", t), kn = (t) => Cr("private", "pkcs8", t),
|
|
2287
|
+
return xr(mt(new Uint8Array(await b.subtle.exportKey(e, r))), `${t.toUpperCase()} KEY`);
|
|
2288
|
+
}, Mn = (t) => Cr("public", "spki", t), kn = (t) => Cr("private", "pkcs8", t), re = (t, e, r = 0) => {
|
|
2285
2289
|
r === 0 && (e.unshift(e.length), e.unshift(6));
|
|
2286
2290
|
let n = t.indexOf(e[0], r);
|
|
2287
2291
|
if (n === -1)
|
|
2288
2292
|
return !1;
|
|
2289
2293
|
const a = t.subarray(n, n + e.length);
|
|
2290
|
-
return a.length !== e.length ? !1 : a.every((s, i) => s === e[i]) ||
|
|
2294
|
+
return a.length !== e.length ? !1 : a.every((s, i) => s === e[i]) || re(t, e, n + 1);
|
|
2291
2295
|
}, Nt = (t) => {
|
|
2292
2296
|
switch (!0) {
|
|
2293
|
-
case
|
|
2297
|
+
case re(t, [42, 134, 72, 206, 61, 3, 1, 7]):
|
|
2294
2298
|
return "P-256";
|
|
2295
|
-
case
|
|
2299
|
+
case re(t, [43, 129, 4, 0, 34]):
|
|
2296
2300
|
return "P-384";
|
|
2297
|
-
case
|
|
2301
|
+
case re(t, [43, 129, 4, 0, 35]):
|
|
2298
2302
|
return "P-521";
|
|
2299
|
-
case
|
|
2303
|
+
case re(t, [43, 101, 110]):
|
|
2300
2304
|
return "X25519";
|
|
2301
|
-
case
|
|
2305
|
+
case re(t, [43, 101, 111]):
|
|
2302
2306
|
return "X448";
|
|
2303
|
-
case
|
|
2307
|
+
case re(t, [43, 101, 112]):
|
|
2304
2308
|
return "Ed25519";
|
|
2305
|
-
case
|
|
2309
|
+
case re(t, [43, 101, 113]):
|
|
2306
2310
|
return "Ed448";
|
|
2307
2311
|
default:
|
|
2308
2312
|
throw new x("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
|
|
@@ -2401,7 +2405,7 @@ function Hr(t) {
|
|
|
2401
2405
|
}
|
|
2402
2406
|
function Vn(t) {
|
|
2403
2407
|
const e = $t($t(Hr(t).contents)[0].contents);
|
|
2404
|
-
return
|
|
2408
|
+
return mt(e[e[0].raw[0] === 160 ? 6 : 5].raw);
|
|
2405
2409
|
}
|
|
2406
2410
|
function Bn(t) {
|
|
2407
2411
|
const e = t.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, ""), r = or(e);
|
|
@@ -2551,7 +2555,7 @@ async function Zn(t, e, r) {
|
|
|
2551
2555
|
throw new TypeError('"pkcs8" must be PKCS#8 formatted string');
|
|
2552
2556
|
return Fn(t, e, r);
|
|
2553
2557
|
}
|
|
2554
|
-
async function
|
|
2558
|
+
async function Me(t, e, r) {
|
|
2555
2559
|
var n;
|
|
2556
2560
|
if (!I(t))
|
|
2557
2561
|
throw new TypeError("JWK must be an object");
|
|
@@ -2590,7 +2594,7 @@ const Qn = (t, e) => {
|
|
|
2590
2594
|
throw new TypeError(`${H.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
2591
2595
|
if (e.algorithm && r === "encrypt" && e.type === "private")
|
|
2592
2596
|
throw new TypeError(`${H.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
2593
|
-
},
|
|
2597
|
+
}, ke = (t, e, r) => {
|
|
2594
2598
|
t.startsWith("HS") || t === "dir" || t.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(t) ? Qn(t, e) : jn(t, e, r);
|
|
2595
2599
|
};
|
|
2596
2600
|
async function ea(t, e, r, n, a) {
|
|
@@ -2607,7 +2611,7 @@ async function ea(t, e, r, n, a) {
|
|
|
2607
2611
|
}
|
|
2608
2612
|
async function ta(t, e, r, n, a) {
|
|
2609
2613
|
let s;
|
|
2610
|
-
r instanceof Uint8Array ? s = await b.subtle.importKey("raw", r, "AES-GCM", !1, ["encrypt"]) : (
|
|
2614
|
+
r instanceof Uint8Array ? s = await b.subtle.importKey("raw", r, "AES-GCM", !1, ["encrypt"]) : (se(r, t, "encrypt"), s = r);
|
|
2611
2615
|
const i = new Uint8Array(await b.subtle.encrypt({
|
|
2612
2616
|
additionalData: a,
|
|
2613
2617
|
iv: n,
|
|
@@ -2616,18 +2620,18 @@ async function ta(t, e, r, n, a) {
|
|
|
2616
2620
|
}, s, e)), o = i.slice(-16);
|
|
2617
2621
|
return { ciphertext: i.slice(0, -16), tag: o };
|
|
2618
2622
|
}
|
|
2619
|
-
const
|
|
2623
|
+
const dt = async (t, e, r, n, a) => {
|
|
2620
2624
|
if (!G(r) && !(r instanceof Uint8Array))
|
|
2621
2625
|
throw new TypeError(M(r, ...H, "Uint8Array"));
|
|
2622
2626
|
switch (hr(t, n), t) {
|
|
2623
2627
|
case "A128CBC-HS256":
|
|
2624
2628
|
case "A192CBC-HS384":
|
|
2625
2629
|
case "A256CBC-HS512":
|
|
2626
|
-
return r instanceof Uint8Array &&
|
|
2630
|
+
return r instanceof Uint8Array && Te(r, parseInt(t.slice(-3), 10)), ea(t, e, r, n, a);
|
|
2627
2631
|
case "A128GCM":
|
|
2628
2632
|
case "A192GCM":
|
|
2629
2633
|
case "A256GCM":
|
|
2630
|
-
return r instanceof Uint8Array &&
|
|
2634
|
+
return r instanceof Uint8Array && Te(r, parseInt(t.slice(1, 4), 10)), ta(t, e, r, n, a);
|
|
2631
2635
|
default:
|
|
2632
2636
|
throw new x("Unsupported JWE Content Encryption Algorithm");
|
|
2633
2637
|
}
|
|
@@ -2635,7 +2639,7 @@ const lt = async (t, e, r, n, a) => {
|
|
|
2635
2639
|
async function ra(t, e, r, n) {
|
|
2636
2640
|
const a = t.slice(0, 7);
|
|
2637
2641
|
n || (n = fr(a));
|
|
2638
|
-
const { ciphertext: s, tag: i } = await
|
|
2642
|
+
const { ciphertext: s, tag: i } = await dt(a, r, e, n, new Uint8Array(0));
|
|
2639
2643
|
return { encryptedKey: s, iv: O(n), tag: O(i) };
|
|
2640
2644
|
}
|
|
2641
2645
|
async function na(t, e, r, n, a) {
|
|
@@ -2643,7 +2647,7 @@ async function na(t, e, r, n, a) {
|
|
|
2643
2647
|
return wr(s, e, r, n, a, new Uint8Array(0));
|
|
2644
2648
|
}
|
|
2645
2649
|
async function aa(t, e, r, n, a) {
|
|
2646
|
-
switch (
|
|
2650
|
+
switch (ke(t, e, "decrypt"), t) {
|
|
2647
2651
|
case "dir": {
|
|
2648
2652
|
if (r !== void 0)
|
|
2649
2653
|
throw new y("Encountered unexpected JWE Encrypted Key");
|
|
@@ -2659,7 +2663,7 @@ async function aa(t, e, r, n, a) {
|
|
|
2659
2663
|
throw new y('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');
|
|
2660
2664
|
if (!Er(e))
|
|
2661
2665
|
throw new x("ECDH with the provided key is not allowed or not supported by your javascript runtime");
|
|
2662
|
-
const s = await
|
|
2666
|
+
const s = await Me(n.epk, t);
|
|
2663
2667
|
let i, o;
|
|
2664
2668
|
if (n.apu !== void 0) {
|
|
2665
2669
|
if (typeof n.apu != "string")
|
|
@@ -2679,12 +2683,12 @@ async function aa(t, e, r, n, a) {
|
|
|
2679
2683
|
throw new y("Failed to base64url decode the apv");
|
|
2680
2684
|
}
|
|
2681
2685
|
}
|
|
2682
|
-
const c = await vr(s, e, t === "ECDH-ES" ? n.enc : t, t === "ECDH-ES" ?
|
|
2686
|
+
const c = await vr(s, e, t === "ECDH-ES" ? n.enc : t, t === "ECDH-ES" ? St(n.enc) : parseInt(t.slice(-5, -2), 10), i, o);
|
|
2683
2687
|
if (t === "ECDH-ES")
|
|
2684
2688
|
return c;
|
|
2685
2689
|
if (r === void 0)
|
|
2686
2690
|
throw new y("JWE Encrypted Key missing");
|
|
2687
|
-
return
|
|
2691
|
+
return lt(t.slice(-6), c, r);
|
|
2688
2692
|
}
|
|
2689
2693
|
case "RSA1_5":
|
|
2690
2694
|
case "RSA-OAEP":
|
|
@@ -2720,7 +2724,7 @@ async function aa(t, e, r, n, a) {
|
|
|
2720
2724
|
case "A256KW": {
|
|
2721
2725
|
if (r === void 0)
|
|
2722
2726
|
throw new y("JWE Encrypted Key missing");
|
|
2723
|
-
return
|
|
2727
|
+
return lt(t, e, r);
|
|
2724
2728
|
}
|
|
2725
2729
|
case "A128GCMKW":
|
|
2726
2730
|
case "A192GCMKW":
|
|
@@ -2749,7 +2753,7 @@ async function aa(t, e, r, n, a) {
|
|
|
2749
2753
|
throw new x('Invalid or unsupported "alg" (JWE Algorithm) header value');
|
|
2750
2754
|
}
|
|
2751
2755
|
}
|
|
2752
|
-
function
|
|
2756
|
+
function we(t, e, r, n, a) {
|
|
2753
2757
|
if (a.crit !== void 0 && n.crit === void 0)
|
|
2754
2758
|
throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
2755
2759
|
if (!n || n.crit === void 0)
|
|
@@ -2768,13 +2772,13 @@ function ye(t, e, r, n, a) {
|
|
|
2768
2772
|
}
|
|
2769
2773
|
return new Set(n.crit);
|
|
2770
2774
|
}
|
|
2771
|
-
const
|
|
2775
|
+
const ft = (t, e) => {
|
|
2772
2776
|
if (e !== void 0 && (!Array.isArray(e) || e.some((r) => typeof r != "string")))
|
|
2773
2777
|
throw new TypeError(`"${t}" option must be an array of strings`);
|
|
2774
2778
|
if (e)
|
|
2775
2779
|
return new Set(e);
|
|
2776
2780
|
};
|
|
2777
|
-
async function
|
|
2781
|
+
async function bt(t, e, r) {
|
|
2778
2782
|
var n;
|
|
2779
2783
|
if (!I(t))
|
|
2780
2784
|
throw new y("Flattened JWE must be an object");
|
|
@@ -2804,14 +2808,14 @@ async function St(t, e, r) {
|
|
|
2804
2808
|
} catch {
|
|
2805
2809
|
throw new y("JWE Protected Header is invalid");
|
|
2806
2810
|
}
|
|
2807
|
-
if (!
|
|
2811
|
+
if (!ye(a, t.header, t.unprotected))
|
|
2808
2812
|
throw new y("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");
|
|
2809
2813
|
const s = {
|
|
2810
2814
|
...a,
|
|
2811
2815
|
...t.header,
|
|
2812
2816
|
...t.unprotected
|
|
2813
2817
|
};
|
|
2814
|
-
if (
|
|
2818
|
+
if (we(y, /* @__PURE__ */ new Map(), r == null ? void 0 : r.crit, a, s), s.zip !== void 0) {
|
|
2815
2819
|
if (!a || !a.zip)
|
|
2816
2820
|
throw new y('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');
|
|
2817
2821
|
if (s.zip !== "DEF")
|
|
@@ -2822,11 +2826,11 @@ async function St(t, e, r) {
|
|
|
2822
2826
|
throw new y("missing JWE Algorithm (alg) in JWE Header");
|
|
2823
2827
|
if (typeof o != "string" || !o)
|
|
2824
2828
|
throw new y("missing JWE Encryption Algorithm (enc) in JWE Header");
|
|
2825
|
-
const c = r &&
|
|
2829
|
+
const c = r && ft("keyManagementAlgorithms", r.keyManagementAlgorithms), u = r && ft("contentEncryptionAlgorithms", r.contentEncryptionAlgorithms);
|
|
2826
2830
|
if (c && !c.has(i))
|
|
2827
|
-
throw new
|
|
2831
|
+
throw new Oe('"alg" (Algorithm) Header Parameter not allowed');
|
|
2828
2832
|
if (u && !u.has(o))
|
|
2829
|
-
throw new
|
|
2833
|
+
throw new Oe('"enc" (Encryption Algorithm) Header Parameter not allowed');
|
|
2830
2834
|
let l;
|
|
2831
2835
|
if (t.encrypted_key !== void 0)
|
|
2832
2836
|
try {
|
|
@@ -2842,7 +2846,7 @@ async function St(t, e, r) {
|
|
|
2842
2846
|
} catch (m) {
|
|
2843
2847
|
if (m instanceof TypeError || m instanceof y || m instanceof x)
|
|
2844
2848
|
throw m;
|
|
2845
|
-
d =
|
|
2849
|
+
d = oe(o);
|
|
2846
2850
|
}
|
|
2847
2851
|
let p, h;
|
|
2848
2852
|
try {
|
|
@@ -2881,7 +2885,7 @@ async function Kr(t, e, r) {
|
|
|
2881
2885
|
const { 0: n, 1: a, 2: s, 3: i, 4: o, length: c } = t.split(".");
|
|
2882
2886
|
if (c !== 5)
|
|
2883
2887
|
throw new y("Invalid Compact JWE");
|
|
2884
|
-
const u = await
|
|
2888
|
+
const u = await bt({
|
|
2885
2889
|
ciphertext: i,
|
|
2886
2890
|
iv: s || void 0,
|
|
2887
2891
|
protected: n || void 0,
|
|
@@ -2899,7 +2903,7 @@ async function sa(t, e, r) {
|
|
|
2899
2903
|
throw new y("JWE Recipients has no members");
|
|
2900
2904
|
for (const n of t.recipients)
|
|
2901
2905
|
try {
|
|
2902
|
-
return await
|
|
2906
|
+
return await bt({
|
|
2903
2907
|
aad: t.aad,
|
|
2904
2908
|
ciphertext: t.ciphertext,
|
|
2905
2909
|
encrypted_key: n.encrypted_key,
|
|
@@ -2911,7 +2915,7 @@ async function sa(t, e, r) {
|
|
|
2911
2915
|
}, e, r);
|
|
2912
2916
|
} catch {
|
|
2913
2917
|
}
|
|
2914
|
-
throw new
|
|
2918
|
+
throw new me();
|
|
2915
2919
|
}
|
|
2916
2920
|
const ia = async (t) => {
|
|
2917
2921
|
if (t instanceof Uint8Array)
|
|
@@ -2937,7 +2941,7 @@ async function Rr(t) {
|
|
|
2937
2941
|
}
|
|
2938
2942
|
async function Or(t, e, r, n, a = {}) {
|
|
2939
2943
|
let s, i, o;
|
|
2940
|
-
switch (
|
|
2944
|
+
switch (ke(t, r, "encrypt"), t) {
|
|
2941
2945
|
case "dir": {
|
|
2942
2946
|
o = r;
|
|
2943
2947
|
break;
|
|
@@ -2951,14 +2955,14 @@ async function Or(t, e, r, n, a = {}) {
|
|
|
2951
2955
|
const { apu: c, apv: u } = a;
|
|
2952
2956
|
let { epk: l } = a;
|
|
2953
2957
|
l || (l = (await Wn(r)).privateKey);
|
|
2954
|
-
const { x: f, y: d, crv: p, kty: h } = await Rr(l), g = await vr(r, l, t === "ECDH-ES" ? e : t, t === "ECDH-ES" ?
|
|
2958
|
+
const { x: f, y: d, crv: p, kty: h } = await Rr(l), g = await vr(r, l, t === "ECDH-ES" ? e : t, t === "ECDH-ES" ? St(e) : parseInt(t.slice(-5, -2), 10), c, u);
|
|
2955
2959
|
if (i = { epk: { x: f, crv: p, kty: h } }, h === "EC" && (i.epk.y = d), c && (i.apu = O(c)), u && (i.apv = O(u)), t === "ECDH-ES") {
|
|
2956
2960
|
o = g;
|
|
2957
2961
|
break;
|
|
2958
2962
|
}
|
|
2959
|
-
o = n ||
|
|
2963
|
+
o = n || oe(e);
|
|
2960
2964
|
const S = t.slice(-6);
|
|
2961
|
-
s = await
|
|
2965
|
+
s = await ut(S, g, o);
|
|
2962
2966
|
break;
|
|
2963
2967
|
}
|
|
2964
2968
|
case "RSA1_5":
|
|
@@ -2966,13 +2970,13 @@ async function Or(t, e, r, n, a = {}) {
|
|
|
2966
2970
|
case "RSA-OAEP-256":
|
|
2967
2971
|
case "RSA-OAEP-384":
|
|
2968
2972
|
case "RSA-OAEP-512": {
|
|
2969
|
-
o = n ||
|
|
2973
|
+
o = n || oe(e), s = await Nn(t, r, o);
|
|
2970
2974
|
break;
|
|
2971
2975
|
}
|
|
2972
2976
|
case "PBES2-HS256+A128KW":
|
|
2973
2977
|
case "PBES2-HS384+A192KW":
|
|
2974
2978
|
case "PBES2-HS512+A256KW": {
|
|
2975
|
-
o = n ||
|
|
2979
|
+
o = n || oe(e);
|
|
2976
2980
|
const { p2c: c, p2s: u } = a;
|
|
2977
2981
|
({ encryptedKey: s, ...i } = await Dn(t, r, o, c, u));
|
|
2978
2982
|
break;
|
|
@@ -2980,13 +2984,13 @@ async function Or(t, e, r, n, a = {}) {
|
|
|
2980
2984
|
case "A128KW":
|
|
2981
2985
|
case "A192KW":
|
|
2982
2986
|
case "A256KW": {
|
|
2983
|
-
o = n ||
|
|
2987
|
+
o = n || oe(e), s = await ut(t, r, o);
|
|
2984
2988
|
break;
|
|
2985
2989
|
}
|
|
2986
2990
|
case "A128GCMKW":
|
|
2987
2991
|
case "A192GCMKW":
|
|
2988
2992
|
case "A256GCMKW": {
|
|
2989
|
-
o = n ||
|
|
2993
|
+
o = n || oe(e);
|
|
2990
2994
|
const { iv: c } = a;
|
|
2991
2995
|
({ encryptedKey: s, ...i } = await ra(t, r, o, c));
|
|
2992
2996
|
break;
|
|
@@ -2997,7 +3001,7 @@ async function Or(t, e, r, n, a = {}) {
|
|
|
2997
3001
|
return { cek: o, encryptedKey: s, parameters: i };
|
|
2998
3002
|
}
|
|
2999
3003
|
const Tr = Symbol();
|
|
3000
|
-
class
|
|
3004
|
+
class We {
|
|
3001
3005
|
constructor(e) {
|
|
3002
3006
|
if (!(e instanceof Uint8Array))
|
|
3003
3007
|
throw new TypeError("plaintext must be an instance of Uint8Array");
|
|
@@ -3039,14 +3043,14 @@ class Ie {
|
|
|
3039
3043
|
async encrypt(e, r) {
|
|
3040
3044
|
if (!this._protectedHeader && !this._unprotectedHeader && !this._sharedUnprotectedHeader)
|
|
3041
3045
|
throw new y("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");
|
|
3042
|
-
if (!
|
|
3046
|
+
if (!ye(this._protectedHeader, this._unprotectedHeader, this._sharedUnprotectedHeader))
|
|
3043
3047
|
throw new y("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");
|
|
3044
3048
|
const n = {
|
|
3045
3049
|
...this._protectedHeader,
|
|
3046
3050
|
...this._unprotectedHeader,
|
|
3047
3051
|
...this._sharedUnprotectedHeader
|
|
3048
3052
|
};
|
|
3049
|
-
if (
|
|
3053
|
+
if (we(y, /* @__PURE__ */ new Map(), r == null ? void 0 : r.crit, this._protectedHeader, n), n.zip !== void 0) {
|
|
3050
3054
|
if (!this._protectedHeader || !this._protectedHeader.zip)
|
|
3051
3055
|
throw new y('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');
|
|
3052
3056
|
if (n.zip !== "DEF")
|
|
@@ -3074,9 +3078,9 @@ class Ie {
|
|
|
3074
3078
|
let f, d;
|
|
3075
3079
|
if (n.zip === "DEF") {
|
|
3076
3080
|
const h = await ((r == null ? void 0 : r.deflateRaw) || Tn)(this._plaintext);
|
|
3077
|
-
({ ciphertext: f, tag: d } = await
|
|
3081
|
+
({ ciphertext: f, tag: d } = await dt(s, h, o, this._iv, c));
|
|
3078
3082
|
} else
|
|
3079
|
-
({ ciphertext: f, tag: d } = await
|
|
3083
|
+
({ ciphertext: f, tag: d } = await dt(s, this._plaintext, o, this._iv, c));
|
|
3080
3084
|
const p = {
|
|
3081
3085
|
ciphertext: O(f),
|
|
3082
3086
|
iv: O(this._iv),
|
|
@@ -3130,7 +3134,7 @@ class da {
|
|
|
3130
3134
|
if (!this._recipients.length)
|
|
3131
3135
|
throw new y("at least one recipient must be added");
|
|
3132
3136
|
if (e = { deflateRaw: e == null ? void 0 : e.deflateRaw }, this._recipients.length === 1) {
|
|
3133
|
-
const [c] = this._recipients, u = await new
|
|
3137
|
+
const [c] = this._recipients, u = await new We(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(c.unprotectedHeader).encrypt(c.key, { ...c.options, ...e });
|
|
3134
3138
|
let l = {
|
|
3135
3139
|
ciphertext: u.ciphertext,
|
|
3136
3140
|
iv: u.iv,
|
|
@@ -3142,7 +3146,7 @@ class da {
|
|
|
3142
3146
|
let s;
|
|
3143
3147
|
for (let c = 0; c < this._recipients.length; c++) {
|
|
3144
3148
|
const u = this._recipients[c];
|
|
3145
|
-
if (!
|
|
3149
|
+
if (!ye(this._protectedHeader, this._unprotectedHeader, u.unprotectedHeader))
|
|
3146
3150
|
throw new y("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");
|
|
3147
3151
|
const l = {
|
|
3148
3152
|
...this._protectedHeader,
|
|
@@ -3159,10 +3163,10 @@ class da {
|
|
|
3159
3163
|
s = l.enc;
|
|
3160
3164
|
else if (s !== l.enc)
|
|
3161
3165
|
throw new y('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients');
|
|
3162
|
-
if (
|
|
3166
|
+
if (we(y, /* @__PURE__ */ new Map(), u.options.crit, this._protectedHeader, l), l.zip !== void 0 && (!this._protectedHeader || !this._protectedHeader.zip))
|
|
3163
3167
|
throw new y('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');
|
|
3164
3168
|
}
|
|
3165
|
-
const i =
|
|
3169
|
+
const i = oe(s);
|
|
3166
3170
|
let o = {
|
|
3167
3171
|
ciphertext: "",
|
|
3168
3172
|
iv: "",
|
|
@@ -3178,7 +3182,7 @@ class da {
|
|
|
3178
3182
|
...u.unprotectedHeader
|
|
3179
3183
|
}.alg.startsWith("PBES2") ? 2048 + c : void 0;
|
|
3180
3184
|
if (c === 0) {
|
|
3181
|
-
const g = await new
|
|
3185
|
+
const g = await new We(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(i).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(u.unprotectedHeader).setKeyManagementParameters({ p2c: d }).encrypt(u.key, {
|
|
3182
3186
|
...u.options,
|
|
3183
3187
|
...e,
|
|
3184
3188
|
[Tr]: !0
|
|
@@ -3229,7 +3233,7 @@ function Wr(t, e, r) {
|
|
|
3229
3233
|
}
|
|
3230
3234
|
const fa = async (t, e, r, n) => {
|
|
3231
3235
|
const a = await Wr(t, e, "verify");
|
|
3232
|
-
|
|
3236
|
+
$e(t, a);
|
|
3233
3237
|
const s = Ir(t, a.algorithm);
|
|
3234
3238
|
try {
|
|
3235
3239
|
return await b.subtle.verify(s, a, r, n);
|
|
@@ -3237,7 +3241,7 @@ const fa = async (t, e, r, n) => {
|
|
|
3237
3241
|
return !1;
|
|
3238
3242
|
}
|
|
3239
3243
|
};
|
|
3240
|
-
async function
|
|
3244
|
+
async function vt(t, e, r) {
|
|
3241
3245
|
var n;
|
|
3242
3246
|
if (!I(t))
|
|
3243
3247
|
throw new P("Flattened JWS must be an object");
|
|
@@ -3259,28 +3263,28 @@ async function bt(t, e, r) {
|
|
|
3259
3263
|
} catch {
|
|
3260
3264
|
throw new P("JWS Protected Header is invalid");
|
|
3261
3265
|
}
|
|
3262
|
-
if (!
|
|
3266
|
+
if (!ye(a, t.header))
|
|
3263
3267
|
throw new P("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
3264
3268
|
const s = {
|
|
3265
3269
|
...a,
|
|
3266
3270
|
...t.header
|
|
3267
|
-
}, i =
|
|
3271
|
+
}, i = we(P, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, s);
|
|
3268
3272
|
let o = !0;
|
|
3269
3273
|
if (i.has("b64") && (o = a.b64, typeof o != "boolean"))
|
|
3270
3274
|
throw new P('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
3271
3275
|
const { alg: c } = s;
|
|
3272
3276
|
if (typeof c != "string" || !c)
|
|
3273
3277
|
throw new P('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
3274
|
-
const u = r &&
|
|
3278
|
+
const u = r && ft("algorithms", r.algorithms);
|
|
3275
3279
|
if (u && !u.has(c))
|
|
3276
|
-
throw new
|
|
3280
|
+
throw new Oe('"alg" (Algorithm) Header Parameter not allowed');
|
|
3277
3281
|
if (o) {
|
|
3278
3282
|
if (typeof t.payload != "string")
|
|
3279
3283
|
throw new P("JWS Payload must be a string");
|
|
3280
3284
|
} else if (typeof t.payload != "string" && !(t.payload instanceof Uint8Array))
|
|
3281
3285
|
throw new P("JWS Payload must be a string or an Uint8Array instance");
|
|
3282
3286
|
let l = !1;
|
|
3283
|
-
typeof e == "function" && (e = await e(a, t), l = !0),
|
|
3287
|
+
typeof e == "function" && (e = await e(a, t), l = !0), ke(c, e, "verify");
|
|
3284
3288
|
const f = Q(K.encode((n = t.protected) !== null && n !== void 0 ? n : ""), K.encode("."), typeof t.payload == "string" ? K.encode(t.payload) : t.payload);
|
|
3285
3289
|
let d;
|
|
3286
3290
|
try {
|
|
@@ -3289,7 +3293,7 @@ async function bt(t, e, r) {
|
|
|
3289
3293
|
throw new P("Failed to base64url decode the signature");
|
|
3290
3294
|
}
|
|
3291
3295
|
if (!await fa(c, e, d, f))
|
|
3292
|
-
throw new
|
|
3296
|
+
throw new wt();
|
|
3293
3297
|
let h;
|
|
3294
3298
|
if (o)
|
|
3295
3299
|
try {
|
|
@@ -3308,7 +3312,7 @@ async function Ur(t, e, r) {
|
|
|
3308
3312
|
const { 0: n, 1: a, 2: s, length: i } = t.split(".");
|
|
3309
3313
|
if (i !== 3)
|
|
3310
3314
|
throw new P("Invalid Compact JWS");
|
|
3311
|
-
const o = await
|
|
3315
|
+
const o = await vt({ payload: a, protected: n, signature: s }, e, r), c = { payload: o.payload, protectedHeader: o.protectedHeader };
|
|
3312
3316
|
return typeof e == "function" ? { ...c, key: o.key } : c;
|
|
3313
3317
|
}
|
|
3314
3318
|
async function ha(t, e, r) {
|
|
@@ -3318,7 +3322,7 @@ async function ha(t, e, r) {
|
|
|
3318
3322
|
throw new P("JWS Signatures missing or incorrect type");
|
|
3319
3323
|
for (const n of t.signatures)
|
|
3320
3324
|
try {
|
|
3321
|
-
return await
|
|
3325
|
+
return await vt({
|
|
3322
3326
|
header: n.header,
|
|
3323
3327
|
payload: t.payload,
|
|
3324
3328
|
protected: n.protected,
|
|
@@ -3326,9 +3330,9 @@ async function ha(t, e, r) {
|
|
|
3326
3330
|
}, e, r);
|
|
3327
3331
|
} catch {
|
|
3328
3332
|
}
|
|
3329
|
-
throw new
|
|
3333
|
+
throw new wt();
|
|
3330
3334
|
}
|
|
3331
|
-
const
|
|
3335
|
+
const xe = (t) => Math.floor(t.getTime() / 1e3), Lr = 60, Dr = Lr * 60, Et = Dr * 24, pa = Et * 7, ga = Et * 365.25, ma = /^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i, Ue = (t) => {
|
|
3332
3336
|
const e = ma.exec(t);
|
|
3333
3337
|
if (!e)
|
|
3334
3338
|
throw new TypeError("Invalid time period format");
|
|
@@ -3355,7 +3359,7 @@ const Ae = (t) => Math.floor(t.getTime() / 1e3), Lr = 60, Dr = Lr * 60, vt = Dr
|
|
|
3355
3359
|
case "day":
|
|
3356
3360
|
case "days":
|
|
3357
3361
|
case "d":
|
|
3358
|
-
return Math.round(r *
|
|
3362
|
+
return Math.round(r * Et);
|
|
3359
3363
|
case "week":
|
|
3360
3364
|
case "weeks":
|
|
3361
3365
|
case "w":
|
|
@@ -3363,7 +3367,7 @@ const Ae = (t) => Math.floor(t.getTime() / 1e3), Lr = 60, Dr = Lr * 60, vt = Dr
|
|
|
3363
3367
|
default:
|
|
3364
3368
|
return Math.round(r * ga);
|
|
3365
3369
|
}
|
|
3366
|
-
}, kt = (t) => t.toLowerCase().replace(/^application\//, ""), ya = (t, e) => typeof t == "string" ? e.includes(t) : Array.isArray(t) ? e.some(Set.prototype.has.bind(new Set(t))) : !1,
|
|
3370
|
+
}, kt = (t) => t.toLowerCase().replace(/^application\//, ""), ya = (t, e) => typeof t == "string" ? e.includes(t) : Array.isArray(t) ? e.some(Set.prototype.has.bind(new Set(t))) : !1, At = (t, e, r = {}) => {
|
|
3367
3371
|
const { typ: n } = r;
|
|
3368
3372
|
if (n && (typeof t.typ != "string" || kt(t.typ) !== kt(n)))
|
|
3369
3373
|
throw new V('unexpected "typ" JWT header value', "typ", "check_failed");
|
|
@@ -3388,7 +3392,7 @@ const Ae = (t) => Math.floor(t.getTime() / 1e3), Lr = 60, Dr = Lr * 60, vt = Dr
|
|
|
3388
3392
|
let l;
|
|
3389
3393
|
switch (typeof r.clockTolerance) {
|
|
3390
3394
|
case "string":
|
|
3391
|
-
l =
|
|
3395
|
+
l = Ue(r.clockTolerance);
|
|
3392
3396
|
break;
|
|
3393
3397
|
case "number":
|
|
3394
3398
|
l = r.clockTolerance;
|
|
@@ -3399,7 +3403,7 @@ const Ae = (t) => Math.floor(t.getTime() / 1e3), Lr = 60, Dr = Lr * 60, vt = Dr
|
|
|
3399
3403
|
default:
|
|
3400
3404
|
throw new TypeError("Invalid clockTolerance option type");
|
|
3401
3405
|
}
|
|
3402
|
-
const { currentDate: f } = r, d =
|
|
3406
|
+
const { currentDate: f } = r, d = xe(f || /* @__PURE__ */ new Date());
|
|
3403
3407
|
if ((a.iat !== void 0 || u) && typeof a.iat != "number")
|
|
3404
3408
|
throw new V('"iat" claim must be a number', "iat", "invalid");
|
|
3405
3409
|
if (a.nbf !== void 0) {
|
|
@@ -3412,12 +3416,12 @@ const Ae = (t) => Math.floor(t.getTime() / 1e3), Lr = 60, Dr = Lr * 60, vt = Dr
|
|
|
3412
3416
|
if (typeof a.exp != "number")
|
|
3413
3417
|
throw new V('"exp" claim must be a number', "exp", "invalid");
|
|
3414
3418
|
if (a.exp <= d - l)
|
|
3415
|
-
throw new
|
|
3419
|
+
throw new ct('"exp" claim timestamp check failed', "exp", "check_failed");
|
|
3416
3420
|
}
|
|
3417
3421
|
if (u) {
|
|
3418
|
-
const p = d - a.iat, h = typeof u == "number" ? u :
|
|
3422
|
+
const p = d - a.iat, h = typeof u == "number" ? u : Ue(u);
|
|
3419
3423
|
if (p - l > h)
|
|
3420
|
-
throw new
|
|
3424
|
+
throw new ct('"iat" claim timestamp check failed (too far in the past)', "iat", "check_failed");
|
|
3421
3425
|
if (p < 0 - l)
|
|
3422
3426
|
throw new V('"iat" claim timestamp check failed (it should be in the past)', "iat", "check_failed");
|
|
3423
3427
|
}
|
|
@@ -3428,11 +3432,11 @@ async function wa(t, e, r) {
|
|
|
3428
3432
|
const a = await Ur(t, e, r);
|
|
3429
3433
|
if (!((n = a.protectedHeader.crit) === null || n === void 0) && n.includes("b64") && a.protectedHeader.b64 === !1)
|
|
3430
3434
|
throw new B("JWTs MUST NOT use unencoded payload");
|
|
3431
|
-
const i = { payload:
|
|
3435
|
+
const i = { payload: At(a.protectedHeader, a.payload, r), protectedHeader: a.protectedHeader };
|
|
3432
3436
|
return typeof e == "function" ? { ...i, key: a.key } : i;
|
|
3433
3437
|
}
|
|
3434
3438
|
async function Sa(t, e, r) {
|
|
3435
|
-
const n = await Kr(t, e, r), a =
|
|
3439
|
+
const n = await Kr(t, e, r), a = At(n.protectedHeader, n.plaintext, r), { protectedHeader: s } = n;
|
|
3436
3440
|
if (s.iss !== void 0 && s.iss !== a.iss)
|
|
3437
3441
|
throw new V('replicated "iss" claim header parameter mismatch', "iss", "mismatch");
|
|
3438
3442
|
if (s.sub !== void 0 && s.sub !== a.sub)
|
|
@@ -3444,7 +3448,7 @@ async function Sa(t, e, r) {
|
|
|
3444
3448
|
}
|
|
3445
3449
|
class Jr {
|
|
3446
3450
|
constructor(e) {
|
|
3447
|
-
this._flattened = new
|
|
3451
|
+
this._flattened = new We(e);
|
|
3448
3452
|
}
|
|
3449
3453
|
setContentEncryptionKey(e) {
|
|
3450
3454
|
return this._flattened.setContentEncryptionKey(e), this;
|
|
@@ -3465,11 +3469,11 @@ class Jr {
|
|
|
3465
3469
|
}
|
|
3466
3470
|
const ba = async (t, e, r) => {
|
|
3467
3471
|
const n = await Wr(t, e, "sign");
|
|
3468
|
-
|
|
3472
|
+
$e(t, n);
|
|
3469
3473
|
const a = await b.subtle.sign(Ir(t, n.algorithm), n, r);
|
|
3470
3474
|
return new Uint8Array(a);
|
|
3471
3475
|
};
|
|
3472
|
-
class
|
|
3476
|
+
class xt {
|
|
3473
3477
|
constructor(e) {
|
|
3474
3478
|
if (!(e instanceof Uint8Array))
|
|
3475
3479
|
throw new TypeError("payload must be an instance of Uint8Array");
|
|
@@ -3488,19 +3492,19 @@ class At {
|
|
|
3488
3492
|
async sign(e, r) {
|
|
3489
3493
|
if (!this._protectedHeader && !this._unprotectedHeader)
|
|
3490
3494
|
throw new P("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");
|
|
3491
|
-
if (!
|
|
3495
|
+
if (!ye(this._protectedHeader, this._unprotectedHeader))
|
|
3492
3496
|
throw new P("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
3493
3497
|
const n = {
|
|
3494
3498
|
...this._protectedHeader,
|
|
3495
3499
|
...this._unprotectedHeader
|
|
3496
|
-
}, a =
|
|
3500
|
+
}, a = we(P, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, this._protectedHeader, n);
|
|
3497
3501
|
let s = !0;
|
|
3498
3502
|
if (a.has("b64") && (s = this._protectedHeader.b64, typeof s != "boolean"))
|
|
3499
3503
|
throw new P('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
3500
3504
|
const { alg: i } = n;
|
|
3501
3505
|
if (typeof i != "string" || !i)
|
|
3502
3506
|
throw new P('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
3503
|
-
|
|
3507
|
+
ke(i, e, "sign");
|
|
3504
3508
|
let o = this._payload;
|
|
3505
3509
|
s && (o = K.encode(O(o)));
|
|
3506
3510
|
let c;
|
|
@@ -3514,7 +3518,7 @@ class At {
|
|
|
3514
3518
|
}
|
|
3515
3519
|
class Nr {
|
|
3516
3520
|
constructor(e) {
|
|
3517
|
-
this._flattened = new
|
|
3521
|
+
this._flattened = new xt(e);
|
|
3518
3522
|
}
|
|
3519
3523
|
setProtectedHeader(e) {
|
|
3520
3524
|
return this._flattened.setProtectedHeader(e), this;
|
|
@@ -3566,7 +3570,7 @@ class Ea {
|
|
|
3566
3570
|
payload: ""
|
|
3567
3571
|
};
|
|
3568
3572
|
for (let r = 0; r < this._signatures.length; r++) {
|
|
3569
|
-
const n = this._signatures[r], a = new
|
|
3573
|
+
const n = this._signatures[r], a = new xt(this._payload);
|
|
3570
3574
|
a.setProtectedHeader(n.protectedHeader), a.setUnprotectedHeader(n.unprotectedHeader);
|
|
3571
3575
|
const { payload: s, ...i } = await a.sign(n.key, n.options);
|
|
3572
3576
|
if (r === 0)
|
|
@@ -3578,7 +3582,7 @@ class Ea {
|
|
|
3578
3582
|
return e;
|
|
3579
3583
|
}
|
|
3580
3584
|
}
|
|
3581
|
-
class
|
|
3585
|
+
class Ct {
|
|
3582
3586
|
constructor(e) {
|
|
3583
3587
|
if (!I(e))
|
|
3584
3588
|
throw new TypeError("JWT Claims Set MUST be an object");
|
|
@@ -3597,16 +3601,16 @@ class xt {
|
|
|
3597
3601
|
return this._payload = { ...this._payload, jti: e }, this;
|
|
3598
3602
|
}
|
|
3599
3603
|
setNotBefore(e) {
|
|
3600
|
-
return typeof e == "number" ? this._payload = { ...this._payload, nbf: e } : this._payload = { ...this._payload, nbf:
|
|
3604
|
+
return typeof e == "number" ? this._payload = { ...this._payload, nbf: e } : this._payload = { ...this._payload, nbf: xe(/* @__PURE__ */ new Date()) + Ue(e) }, this;
|
|
3601
3605
|
}
|
|
3602
3606
|
setExpirationTime(e) {
|
|
3603
|
-
return typeof e == "number" ? this._payload = { ...this._payload, exp: e } : this._payload = { ...this._payload, exp:
|
|
3607
|
+
return typeof e == "number" ? this._payload = { ...this._payload, exp: e } : this._payload = { ...this._payload, exp: xe(/* @__PURE__ */ new Date()) + Ue(e) }, this;
|
|
3604
3608
|
}
|
|
3605
3609
|
setIssuedAt(e) {
|
|
3606
|
-
return typeof e > "u" ? this._payload = { ...this._payload, iat:
|
|
3610
|
+
return typeof e > "u" ? this._payload = { ...this._payload, iat: xe(/* @__PURE__ */ new Date()) } : this._payload = { ...this._payload, iat: e }, this;
|
|
3607
3611
|
}
|
|
3608
3612
|
}
|
|
3609
|
-
class Aa extends
|
|
3613
|
+
class Aa extends Ct {
|
|
3610
3614
|
setProtectedHeader(e) {
|
|
3611
3615
|
return this._protectedHeader = e, this;
|
|
3612
3616
|
}
|
|
@@ -3618,7 +3622,7 @@ class Aa extends xt {
|
|
|
3618
3622
|
return a.sign(e, r);
|
|
3619
3623
|
}
|
|
3620
3624
|
}
|
|
3621
|
-
class xa extends
|
|
3625
|
+
class xa extends Ct {
|
|
3622
3626
|
setProtectedHeader(e) {
|
|
3623
3627
|
if (this._protectedHeader)
|
|
3624
3628
|
throw new TypeError("setProtectedHeader can only be called once");
|
|
@@ -3653,7 +3657,7 @@ class xa extends xt {
|
|
|
3653
3657
|
return this._replicateIssuerAsHeader && (this._protectedHeader = { ...this._protectedHeader, iss: this._payload.iss }), this._replicateSubjectAsHeader && (this._protectedHeader = { ...this._protectedHeader, sub: this._payload.sub }), this._replicateAudienceAsHeader && (this._protectedHeader = { ...this._protectedHeader, aud: this._payload.aud }), n.setProtectedHeader(this._protectedHeader), this._iv && n.setInitializationVector(this._iv), this._cek && n.setContentEncryptionKey(this._cek), this._keyManagementParameters && n.setKeyManagementParameters(this._keyManagementParameters), n.encrypt(e, r);
|
|
3654
3658
|
}
|
|
3655
3659
|
}
|
|
3656
|
-
const
|
|
3660
|
+
const te = (t, e) => {
|
|
3657
3661
|
if (typeof t != "string" || !t)
|
|
3658
3662
|
throw new cr(`${e} missing or invalid`);
|
|
3659
3663
|
};
|
|
@@ -3665,16 +3669,16 @@ async function $r(t, e) {
|
|
|
3665
3669
|
let r;
|
|
3666
3670
|
switch (t.kty) {
|
|
3667
3671
|
case "EC":
|
|
3668
|
-
|
|
3672
|
+
te(t.crv, '"crv" (Curve) Parameter'), te(t.x, '"x" (X Coordinate) Parameter'), te(t.y, '"y" (Y Coordinate) Parameter'), r = { crv: t.crv, kty: t.kty, x: t.x, y: t.y };
|
|
3669
3673
|
break;
|
|
3670
3674
|
case "OKP":
|
|
3671
|
-
|
|
3675
|
+
te(t.crv, '"crv" (Subtype of Key Pair) Parameter'), te(t.x, '"x" (Public Key) Parameter'), r = { crv: t.crv, kty: t.kty, x: t.x };
|
|
3672
3676
|
break;
|
|
3673
3677
|
case "RSA":
|
|
3674
|
-
|
|
3678
|
+
te(t.e, '"e" (Exponent) Parameter'), te(t.n, '"n" (Modulus) Parameter'), r = { e: t.e, kty: t.kty, n: t.n };
|
|
3675
3679
|
break;
|
|
3676
3680
|
case "oct":
|
|
3677
|
-
|
|
3681
|
+
te(t.k, '"k" (Key Value) Parameter'), r = { k: t.k, kty: t.kty };
|
|
3678
3682
|
break;
|
|
3679
3683
|
default:
|
|
3680
3684
|
throw new x('"kty" (Key Type) Parameter missing or unsupported');
|
|
@@ -3694,7 +3698,7 @@ async function _a(t, e) {
|
|
|
3694
3698
|
};
|
|
3695
3699
|
if (!I(r.jwk))
|
|
3696
3700
|
throw new P('"jwk" (JSON Web Key) Header Parameter must be a JSON object');
|
|
3697
|
-
const n = await
|
|
3701
|
+
const n = await Me({ ...r.jwk, ext: !0 }, r.alg, !0);
|
|
3698
3702
|
if (n instanceof Uint8Array || n.type !== "public")
|
|
3699
3703
|
throw new P('"jwk" (JSON Web Key) Header Parameter must be a public key');
|
|
3700
3704
|
return n;
|
|
@@ -3724,7 +3728,7 @@ function Ka(t) {
|
|
|
3724
3728
|
class kr {
|
|
3725
3729
|
constructor(e) {
|
|
3726
3730
|
if (this._cached = /* @__PURE__ */ new WeakMap(), !Mr(e))
|
|
3727
|
-
throw new
|
|
3731
|
+
throw new De("JSON Web Key Set malformed");
|
|
3728
3732
|
this._jwks = Ka(e);
|
|
3729
3733
|
}
|
|
3730
3734
|
async getKey(e, r) {
|
|
@@ -3748,7 +3752,7 @@ class kr {
|
|
|
3748
3752
|
return l;
|
|
3749
3753
|
}), { 0: o, length: c } = i;
|
|
3750
3754
|
if (c === 0)
|
|
3751
|
-
throw new
|
|
3755
|
+
throw new yt();
|
|
3752
3756
|
if (c !== 1) {
|
|
3753
3757
|
const u = new ur(), { _cached: l } = this;
|
|
3754
3758
|
throw u[Symbol.asyncIterator] = async function* () {
|
|
@@ -3766,9 +3770,9 @@ class kr {
|
|
|
3766
3770
|
async function Ft(t, e, r) {
|
|
3767
3771
|
const n = t.get(e) || t.set(e, {}).get(e);
|
|
3768
3772
|
if (n[r] === void 0) {
|
|
3769
|
-
const a = await
|
|
3773
|
+
const a = await Me({ ...e, ext: !0 }, r);
|
|
3770
3774
|
if (a instanceof Uint8Array || a.type !== "public")
|
|
3771
|
-
throw new
|
|
3775
|
+
throw new De("JSON Web Key Set members must be public keys");
|
|
3772
3776
|
n[r] = a;
|
|
3773
3777
|
}
|
|
3774
3778
|
return n[r];
|
|
@@ -3819,7 +3823,7 @@ class Ia extends kr {
|
|
|
3819
3823
|
try {
|
|
3820
3824
|
return await super.getKey(e, r);
|
|
3821
3825
|
} catch (n) {
|
|
3822
|
-
if (n instanceof
|
|
3826
|
+
if (n instanceof yt && this.coolingDown() === !1)
|
|
3823
3827
|
return await this.reload(), super.getKey(e, r);
|
|
3824
3828
|
throw n;
|
|
3825
3829
|
}
|
|
@@ -3827,7 +3831,7 @@ class Ia extends kr {
|
|
|
3827
3831
|
async reload() {
|
|
3828
3832
|
this._pendingFetch && Ta() && (this._pendingFetch = void 0), this._pendingFetch || (this._pendingFetch = Oa(this._url, this._timeoutDuration, this._options).then((e) => {
|
|
3829
3833
|
if (!Mr(e))
|
|
3830
|
-
throw new
|
|
3834
|
+
throw new De("JSON Web Key Set malformed");
|
|
3831
3835
|
this._jwks = { keys: e.keys }, this._jwksTimestamp = Date.now(), this._pendingFetch = void 0;
|
|
3832
3836
|
}).catch((e) => {
|
|
3833
3837
|
throw this._pendingFetch = void 0, e;
|
|
@@ -3840,7 +3844,7 @@ function Wa(t, e) {
|
|
|
3840
3844
|
return r.getKey(n, a);
|
|
3841
3845
|
};
|
|
3842
3846
|
}
|
|
3843
|
-
class Ua extends
|
|
3847
|
+
class Ua extends Ct {
|
|
3844
3848
|
encode() {
|
|
3845
3849
|
const e = O(JSON.stringify({ alg: "none" })), r = O(JSON.stringify(this._payload));
|
|
3846
3850
|
return `${e}.${r}.`;
|
|
@@ -3858,12 +3862,12 @@ class Ua extends xt {
|
|
|
3858
3862
|
} catch {
|
|
3859
3863
|
throw new B("Invalid Unsecured JWT");
|
|
3860
3864
|
}
|
|
3861
|
-
return { payload:
|
|
3865
|
+
return { payload: At(o, T(a), r), header: o };
|
|
3862
3866
|
}
|
|
3863
3867
|
}
|
|
3864
|
-
const La = O,
|
|
3868
|
+
const La = O, _t = T, Da = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3865
3869
|
__proto__: null,
|
|
3866
|
-
decode:
|
|
3870
|
+
decode: _t,
|
|
3867
3871
|
encode: La
|
|
3868
3872
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3869
3873
|
function Ja(t) {
|
|
@@ -3879,7 +3883,7 @@ function Ja(t) {
|
|
|
3879
3883
|
try {
|
|
3880
3884
|
if (typeof e != "string" || !e)
|
|
3881
3885
|
throw new Error();
|
|
3882
|
-
const r = JSON.parse(X.decode(
|
|
3886
|
+
const r = JSON.parse(X.decode(_t(e)));
|
|
3883
3887
|
if (!I(r))
|
|
3884
3888
|
throw new Error();
|
|
3885
3889
|
return r;
|
|
@@ -3899,7 +3903,7 @@ function Na(t) {
|
|
|
3899
3903
|
throw new B("JWTs must contain a payload");
|
|
3900
3904
|
let n;
|
|
3901
3905
|
try {
|
|
3902
|
-
n =
|
|
3906
|
+
n = _t(e);
|
|
3903
3907
|
} catch {
|
|
3904
3908
|
throw new B("Failed to base64url decode the payload");
|
|
3905
3909
|
}
|
|
@@ -3925,7 +3929,7 @@ async function $a(t, e) {
|
|
|
3925
3929
|
case "A128CBC-HS256":
|
|
3926
3930
|
case "A192CBC-HS384":
|
|
3927
3931
|
case "A256CBC-HS512":
|
|
3928
|
-
return n = parseInt(t.slice(-3), 10),
|
|
3932
|
+
return n = parseInt(t.slice(-3), 10), Je(new Uint8Array(n >> 3));
|
|
3929
3933
|
case "A128KW":
|
|
3930
3934
|
case "A192KW":
|
|
3931
3935
|
case "A256KW":
|
|
@@ -3944,7 +3948,7 @@ async function $a(t, e) {
|
|
|
3944
3948
|
}
|
|
3945
3949
|
return b.subtle.generateKey(a, (r = e == null ? void 0 : e.extractable) !== null && r !== void 0 ? r : !1, s);
|
|
3946
3950
|
}
|
|
3947
|
-
function
|
|
3951
|
+
function Xe(t) {
|
|
3948
3952
|
var e;
|
|
3949
3953
|
const r = (e = t == null ? void 0 : t.modulusLength) !== null && e !== void 0 ? e : 2048;
|
|
3950
3954
|
if (typeof r != "number" || r < 2048)
|
|
@@ -3962,7 +3966,7 @@ async function Ma(t, e) {
|
|
|
3962
3966
|
name: "RSA-PSS",
|
|
3963
3967
|
hash: `SHA-${t.slice(-3)}`,
|
|
3964
3968
|
publicExponent: new Uint8Array([1, 0, 1]),
|
|
3965
|
-
modulusLength:
|
|
3969
|
+
modulusLength: Xe(e)
|
|
3966
3970
|
}, i = ["sign", "verify"];
|
|
3967
3971
|
break;
|
|
3968
3972
|
case "RS256":
|
|
@@ -3972,7 +3976,7 @@ async function Ma(t, e) {
|
|
|
3972
3976
|
name: "RSASSA-PKCS1-v1_5",
|
|
3973
3977
|
hash: `SHA-${t.slice(-3)}`,
|
|
3974
3978
|
publicExponent: new Uint8Array([1, 0, 1]),
|
|
3975
|
-
modulusLength:
|
|
3979
|
+
modulusLength: Xe(e)
|
|
3976
3980
|
}, i = ["sign", "verify"];
|
|
3977
3981
|
break;
|
|
3978
3982
|
case "RSA-OAEP":
|
|
@@ -3983,7 +3987,7 @@ async function Ma(t, e) {
|
|
|
3983
3987
|
name: "RSA-OAEP",
|
|
3984
3988
|
hash: `SHA-${parseInt(t.slice(-3), 10) || 1}`,
|
|
3985
3989
|
publicExponent: new Uint8Array([1, 0, 1]),
|
|
3986
|
-
modulusLength:
|
|
3990
|
+
modulusLength: Xe(e)
|
|
3987
3991
|
}, i = ["decrypt", "unwrapKey", "encrypt", "wrapKey"];
|
|
3988
3992
|
break;
|
|
3989
3993
|
case "ES256":
|
|
@@ -4046,8 +4050,8 @@ const Va = "WebCryptoAPI", Ba = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Ob
|
|
|
4046
4050
|
CompactSign: Nr,
|
|
4047
4051
|
EmbeddedJWK: _a,
|
|
4048
4052
|
EncryptJWT: xa,
|
|
4049
|
-
FlattenedEncrypt:
|
|
4050
|
-
FlattenedSign:
|
|
4053
|
+
FlattenedEncrypt: We,
|
|
4054
|
+
FlattenedSign: xt,
|
|
4051
4055
|
GeneralEncrypt: da,
|
|
4052
4056
|
GeneralSign: Ea,
|
|
4053
4057
|
SignJWT: Aa,
|
|
@@ -4066,19 +4070,19 @@ const Va = "WebCryptoAPI", Ba = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Ob
|
|
|
4066
4070
|
exportJWK: Rr,
|
|
4067
4071
|
exportPKCS8: ua,
|
|
4068
4072
|
exportSPKI: ca,
|
|
4069
|
-
flattenedDecrypt:
|
|
4070
|
-
flattenedVerify:
|
|
4073
|
+
flattenedDecrypt: bt,
|
|
4074
|
+
flattenedVerify: vt,
|
|
4071
4075
|
generalDecrypt: sa,
|
|
4072
4076
|
generalVerify: ha,
|
|
4073
4077
|
generateKeyPair: ka,
|
|
4074
4078
|
generateSecret: Fa,
|
|
4075
|
-
importJWK:
|
|
4079
|
+
importJWK: Me,
|
|
4076
4080
|
importPKCS8: Zn,
|
|
4077
4081
|
importSPKI: Xn,
|
|
4078
4082
|
importX509: Yn,
|
|
4079
4083
|
jwtDecrypt: Sa,
|
|
4080
4084
|
jwtVerify: wa
|
|
4081
|
-
}, Symbol.toStringTag, { value: "Module" })), Ga = /* @__PURE__ */
|
|
4085
|
+
}, Symbol.toStringTag, { value: "Module" })), Ga = /* @__PURE__ */ ht(Ba), za = () => {
|
|
4082
4086
|
if (typeof globalThis < "u")
|
|
4083
4087
|
return globalThis;
|
|
4084
4088
|
if (typeof self < "u")
|
|
@@ -4106,7 +4110,7 @@ function Xa(t) {
|
|
|
4106
4110
|
throw new TypeError('unsupported "digest" value');
|
|
4107
4111
|
}
|
|
4108
4112
|
}
|
|
4109
|
-
function
|
|
4113
|
+
function Pt(t, e) {
|
|
4110
4114
|
if (typeof t == "string")
|
|
4111
4115
|
return new TextEncoder().encode(t);
|
|
4112
4116
|
if (!(t instanceof Uint8Array))
|
|
@@ -4114,13 +4118,13 @@ function _t(t, e) {
|
|
|
4114
4118
|
return t;
|
|
4115
4119
|
}
|
|
4116
4120
|
function Ya(t) {
|
|
4117
|
-
const e =
|
|
4121
|
+
const e = Pt(t, "ikm");
|
|
4118
4122
|
if (!e.byteLength)
|
|
4119
4123
|
throw new TypeError('"ikm" must be at least one byte in length');
|
|
4120
4124
|
return e;
|
|
4121
4125
|
}
|
|
4122
4126
|
function Za(t) {
|
|
4123
|
-
const e =
|
|
4127
|
+
const e = Pt(t, "info");
|
|
4124
4128
|
if (e.byteLength > 1024)
|
|
4125
4129
|
throw TypeError('"info" must not contain more than 1024 bytes');
|
|
4126
4130
|
return e;
|
|
@@ -4134,55 +4138,55 @@ function Qa(t, e) {
|
|
|
4134
4138
|
return t;
|
|
4135
4139
|
}
|
|
4136
4140
|
async function Vt(t, e, r, n, a) {
|
|
4137
|
-
return qa(Xa(t), Ya(e),
|
|
4141
|
+
return qa(Xa(t), Ya(e), Pt(r, "salt"), Za(n), Qa(a, t));
|
|
4138
4142
|
}
|
|
4139
4143
|
const ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4140
4144
|
__proto__: null,
|
|
4141
4145
|
default: Vt,
|
|
4142
4146
|
hkdf: Vt
|
|
4143
|
-
}, Symbol.toStringTag, { value: "Module" })), es = /* @__PURE__ */
|
|
4144
|
-
var
|
|
4147
|
+
}, Symbol.toStringTag, { value: "Module" })), es = /* @__PURE__ */ ht(ja);
|
|
4148
|
+
var Ee, ts = new Uint8Array(16);
|
|
4145
4149
|
function Fr() {
|
|
4146
|
-
if (!
|
|
4150
|
+
if (!Ee && (Ee = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto), !Ee))
|
|
4147
4151
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
4148
|
-
return
|
|
4152
|
+
return Ee(ts);
|
|
4149
4153
|
}
|
|
4150
4154
|
const rs = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
4151
|
-
function
|
|
4155
|
+
function Fe(t) {
|
|
4152
4156
|
return typeof t == "string" && rs.test(t);
|
|
4153
4157
|
}
|
|
4154
4158
|
var W = [];
|
|
4155
|
-
for (var
|
|
4156
|
-
W.push((
|
|
4157
|
-
function
|
|
4159
|
+
for (var Ye = 0; Ye < 256; ++Ye)
|
|
4160
|
+
W.push((Ye + 256).toString(16).substr(1));
|
|
4161
|
+
function Ve(t) {
|
|
4158
4162
|
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = (W[t[e + 0]] + W[t[e + 1]] + W[t[e + 2]] + W[t[e + 3]] + "-" + W[t[e + 4]] + W[t[e + 5]] + "-" + W[t[e + 6]] + W[t[e + 7]] + "-" + W[t[e + 8]] + W[t[e + 9]] + "-" + W[t[e + 10]] + W[t[e + 11]] + W[t[e + 12]] + W[t[e + 13]] + W[t[e + 14]] + W[t[e + 15]]).toLowerCase();
|
|
4159
|
-
if (!
|
|
4163
|
+
if (!Fe(r))
|
|
4160
4164
|
throw TypeError("Stringified UUID is invalid");
|
|
4161
4165
|
return r;
|
|
4162
4166
|
}
|
|
4163
|
-
var Bt,
|
|
4167
|
+
var Bt, Ze, Qe = 0, je = 0;
|
|
4164
4168
|
function ns(t, e, r) {
|
|
4165
4169
|
var n = e && r || 0, a = e || new Array(16);
|
|
4166
4170
|
t = t || {};
|
|
4167
|
-
var s = t.node || Bt, i = t.clockseq !== void 0 ? t.clockseq :
|
|
4171
|
+
var s = t.node || Bt, i = t.clockseq !== void 0 ? t.clockseq : Ze;
|
|
4168
4172
|
if (s == null || i == null) {
|
|
4169
4173
|
var o = t.random || (t.rng || Fr)();
|
|
4170
|
-
s == null && (s = Bt = [o[0] | 1, o[1], o[2], o[3], o[4], o[5]]), i == null && (i =
|
|
4174
|
+
s == null && (s = Bt = [o[0] | 1, o[1], o[2], o[3], o[4], o[5]]), i == null && (i = Ze = (o[6] << 8 | o[7]) & 16383);
|
|
4171
4175
|
}
|
|
4172
|
-
var c = t.msecs !== void 0 ? t.msecs : Date.now(), u = t.nsecs !== void 0 ? t.nsecs :
|
|
4173
|
-
if (l < 0 && t.clockseq === void 0 && (i = i + 1 & 16383), (l < 0 || c >
|
|
4176
|
+
var c = t.msecs !== void 0 ? t.msecs : Date.now(), u = t.nsecs !== void 0 ? t.nsecs : je + 1, l = c - Qe + (u - je) / 1e4;
|
|
4177
|
+
if (l < 0 && t.clockseq === void 0 && (i = i + 1 & 16383), (l < 0 || c > Qe) && t.nsecs === void 0 && (u = 0), u >= 1e4)
|
|
4174
4178
|
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
4175
|
-
|
|
4179
|
+
Qe = c, je = u, Ze = i, c += 122192928e5;
|
|
4176
4180
|
var f = ((c & 268435455) * 1e4 + u) % 4294967296;
|
|
4177
4181
|
a[n++] = f >>> 24 & 255, a[n++] = f >>> 16 & 255, a[n++] = f >>> 8 & 255, a[n++] = f & 255;
|
|
4178
4182
|
var d = c / 4294967296 * 1e4 & 268435455;
|
|
4179
4183
|
a[n++] = d >>> 8 & 255, a[n++] = d & 255, a[n++] = d >>> 24 & 15 | 16, a[n++] = d >>> 16 & 255, a[n++] = i >>> 8 | 128, a[n++] = i & 255;
|
|
4180
4184
|
for (var p = 0; p < 6; ++p)
|
|
4181
4185
|
a[n + p] = s[p];
|
|
4182
|
-
return e ||
|
|
4186
|
+
return e || Ve(a);
|
|
4183
4187
|
}
|
|
4184
4188
|
function Vr(t) {
|
|
4185
|
-
if (!
|
|
4189
|
+
if (!Fe(t))
|
|
4186
4190
|
throw TypeError("Invalid UUID");
|
|
4187
4191
|
var e, r = new Uint8Array(16);
|
|
4188
4192
|
return r[0] = (e = parseInt(t.slice(0, 8), 16)) >>> 24, r[1] = e >>> 16 & 255, r[2] = e >>> 8 & 255, r[3] = e & 255, r[4] = (e = parseInt(t.slice(9, 13), 16)) >>> 8, r[5] = e & 255, r[6] = (e = parseInt(t.slice(14, 18), 16)) >>> 8, r[7] = e & 255, r[8] = (e = parseInt(t.slice(19, 23), 16)) >>> 8, r[9] = e & 255, r[10] = (e = parseInt(t.slice(24, 36), 16)) / 1099511627776 & 255, r[11] = e / 4294967296 & 255, r[12] = e >>> 24 & 255, r[13] = e >>> 16 & 255, r[14] = e >>> 8 & 255, r[15] = e & 255, r;
|
|
@@ -4205,7 +4209,7 @@ function Br(t, e, r) {
|
|
|
4205
4209
|
i[o + u] = c[u];
|
|
4206
4210
|
return i;
|
|
4207
4211
|
}
|
|
4208
|
-
return
|
|
4212
|
+
return Ve(c);
|
|
4209
4213
|
}
|
|
4210
4214
|
try {
|
|
4211
4215
|
n.name = t;
|
|
@@ -4236,7 +4240,7 @@ function us(t, e) {
|
|
|
4236
4240
|
t[e >> 5] |= 128 << e % 32, t[Gr(e) - 1] = e;
|
|
4237
4241
|
for (var r = 1732584193, n = -271733879, a = -1732584194, s = 271733878, i = 0; i < t.length; i += 16) {
|
|
4238
4242
|
var o = r, c = n, u = a, l = s;
|
|
4239
|
-
r = D(r, n, a, s, t[i], 7, -680876936), s = D(s, r, n, a, t[i + 1], 12, -389564586), a = D(a, s, r, n, t[i + 2], 17, 606105819), n = D(n, a, s, r, t[i + 3], 22, -1044525330), r = D(r, n, a, s, t[i + 4], 7, -176418897), s = D(s, r, n, a, t[i + 5], 12, 1200080426), a = D(a, s, r, n, t[i + 6], 17, -1473231341), n = D(n, a, s, r, t[i + 7], 22, -45705983), r = D(r, n, a, s, t[i + 8], 7, 1770035416), s = D(s, r, n, a, t[i + 9], 12, -1958414417), a = D(a, s, r, n, t[i + 10], 17, -42063), n = D(n, a, s, r, t[i + 11], 22, -1990404162), r = D(r, n, a, s, t[i + 12], 7, 1804603682), s = D(s, r, n, a, t[i + 13], 12, -40341101), a = D(a, s, r, n, t[i + 14], 17, -1502002290), n = D(n, a, s, r, t[i + 15], 22, 1236535329), r = J(r, n, a, s, t[i + 1], 5, -165796510), s = J(s, r, n, a, t[i + 6], 9, -1069501632), a = J(a, s, r, n, t[i + 11], 14, 643717713), n = J(n, a, s, r, t[i], 20, -373897302), r = J(r, n, a, s, t[i + 5], 5, -701558691), s = J(s, r, n, a, t[i + 10], 9, 38016083), a = J(a, s, r, n, t[i + 15], 14, -660478335), n = J(n, a, s, r, t[i + 4], 20, -405537848), r = J(r, n, a, s, t[i + 9], 5, 568446438), s = J(s, r, n, a, t[i + 14], 9, -1019803690), a = J(a, s, r, n, t[i + 3], 14, -187363961), n = J(n, a, s, r, t[i + 8], 20, 1163531501), r = J(r, n, a, s, t[i + 13], 5, -1444681467), s = J(s, r, n, a, t[i + 2], 9, -51403784), a = J(a, s, r, n, t[i + 7], 14, 1735328473), n = J(n, a, s, r, t[i + 12], 20, -1926607734), r = N(r, n, a, s, t[i + 5], 4, -378558), s = N(s, r, n, a, t[i + 8], 11, -2022574463), a = N(a, s, r, n, t[i + 11], 16, 1839030562), n = N(n, a, s, r, t[i + 14], 23, -35309556), r = N(r, n, a, s, t[i + 1], 4, -1530992060), s = N(s, r, n, a, t[i + 4], 11, 1272893353), a = N(a, s, r, n, t[i + 7], 16, -155497632), n = N(n, a, s, r, t[i + 10], 23, -1094730640), r = N(r, n, a, s, t[i + 13], 4, 681279174), s = N(s, r, n, a, t[i], 11, -358537222), a = N(a, s, r, n, t[i + 3], 16, -722521979), n = N(n, a, s, r, t[i + 6], 23, 76029189), r = N(r, n, a, s, t[i + 9], 4, -640364487), s = N(s, r, n, a, t[i + 12], 11, -421815835), a = N(a, s, r, n, t[i + 15], 16, 530742520), n = N(n, a, s, r, t[i + 2], 23, -995338651), r = $(r, n, a, s, t[i], 6, -198630844), s = $(s, r, n, a, t[i + 7], 10, 1126891415), a = $(a, s, r, n, t[i + 14], 15, -1416354905), n = $(n, a, s, r, t[i + 5], 21, -57434055), r = $(r, n, a, s, t[i + 12], 6, 1700485571), s = $(s, r, n, a, t[i + 3], 10, -1894986606), a = $(a, s, r, n, t[i + 10], 15, -1051523), n = $(n, a, s, r, t[i + 1], 21, -2054922799), r = $(r, n, a, s, t[i + 8], 6, 1873313359), s = $(s, r, n, a, t[i + 15], 10, -30611744), a = $(a, s, r, n, t[i + 6], 15, -1560198380), n = $(n, a, s, r, t[i + 13], 21, 1309151649), r = $(r, n, a, s, t[i + 4], 6, -145523070), s = $(s, r, n, a, t[i + 11], 10, -1120210379), a = $(a, s, r, n, t[i + 2], 15, 718787259), n = $(n, a, s, r, t[i + 9], 21, -343485551), r =
|
|
4243
|
+
r = D(r, n, a, s, t[i], 7, -680876936), s = D(s, r, n, a, t[i + 1], 12, -389564586), a = D(a, s, r, n, t[i + 2], 17, 606105819), n = D(n, a, s, r, t[i + 3], 22, -1044525330), r = D(r, n, a, s, t[i + 4], 7, -176418897), s = D(s, r, n, a, t[i + 5], 12, 1200080426), a = D(a, s, r, n, t[i + 6], 17, -1473231341), n = D(n, a, s, r, t[i + 7], 22, -45705983), r = D(r, n, a, s, t[i + 8], 7, 1770035416), s = D(s, r, n, a, t[i + 9], 12, -1958414417), a = D(a, s, r, n, t[i + 10], 17, -42063), n = D(n, a, s, r, t[i + 11], 22, -1990404162), r = D(r, n, a, s, t[i + 12], 7, 1804603682), s = D(s, r, n, a, t[i + 13], 12, -40341101), a = D(a, s, r, n, t[i + 14], 17, -1502002290), n = D(n, a, s, r, t[i + 15], 22, 1236535329), r = J(r, n, a, s, t[i + 1], 5, -165796510), s = J(s, r, n, a, t[i + 6], 9, -1069501632), a = J(a, s, r, n, t[i + 11], 14, 643717713), n = J(n, a, s, r, t[i], 20, -373897302), r = J(r, n, a, s, t[i + 5], 5, -701558691), s = J(s, r, n, a, t[i + 10], 9, 38016083), a = J(a, s, r, n, t[i + 15], 14, -660478335), n = J(n, a, s, r, t[i + 4], 20, -405537848), r = J(r, n, a, s, t[i + 9], 5, 568446438), s = J(s, r, n, a, t[i + 14], 9, -1019803690), a = J(a, s, r, n, t[i + 3], 14, -187363961), n = J(n, a, s, r, t[i + 8], 20, 1163531501), r = J(r, n, a, s, t[i + 13], 5, -1444681467), s = J(s, r, n, a, t[i + 2], 9, -51403784), a = J(a, s, r, n, t[i + 7], 14, 1735328473), n = J(n, a, s, r, t[i + 12], 20, -1926607734), r = N(r, n, a, s, t[i + 5], 4, -378558), s = N(s, r, n, a, t[i + 8], 11, -2022574463), a = N(a, s, r, n, t[i + 11], 16, 1839030562), n = N(n, a, s, r, t[i + 14], 23, -35309556), r = N(r, n, a, s, t[i + 1], 4, -1530992060), s = N(s, r, n, a, t[i + 4], 11, 1272893353), a = N(a, s, r, n, t[i + 7], 16, -155497632), n = N(n, a, s, r, t[i + 10], 23, -1094730640), r = N(r, n, a, s, t[i + 13], 4, 681279174), s = N(s, r, n, a, t[i], 11, -358537222), a = N(a, s, r, n, t[i + 3], 16, -722521979), n = N(n, a, s, r, t[i + 6], 23, 76029189), r = N(r, n, a, s, t[i + 9], 4, -640364487), s = N(s, r, n, a, t[i + 12], 11, -421815835), a = N(a, s, r, n, t[i + 15], 16, 530742520), n = N(n, a, s, r, t[i + 2], 23, -995338651), r = $(r, n, a, s, t[i], 6, -198630844), s = $(s, r, n, a, t[i + 7], 10, 1126891415), a = $(a, s, r, n, t[i + 14], 15, -1416354905), n = $(n, a, s, r, t[i + 5], 21, -57434055), r = $(r, n, a, s, t[i + 12], 6, 1700485571), s = $(s, r, n, a, t[i + 3], 10, -1894986606), a = $(a, s, r, n, t[i + 10], 15, -1051523), n = $(n, a, s, r, t[i + 1], 21, -2054922799), r = $(r, n, a, s, t[i + 8], 6, 1873313359), s = $(s, r, n, a, t[i + 15], 10, -30611744), a = $(a, s, r, n, t[i + 6], 15, -1560198380), n = $(n, a, s, r, t[i + 13], 21, 1309151649), r = $(r, n, a, s, t[i + 4], 6, -145523070), s = $(s, r, n, a, t[i + 11], 10, -1120210379), a = $(a, s, r, n, t[i + 2], 15, 718787259), n = $(n, a, s, r, t[i + 9], 21, -343485551), r = ae(r, o), n = ae(n, c), a = ae(a, u), s = ae(s, l);
|
|
4240
4244
|
}
|
|
4241
4245
|
return [r, n, a, s];
|
|
4242
4246
|
}
|
|
@@ -4247,27 +4251,27 @@ function ls(t) {
|
|
|
4247
4251
|
r[n >> 5] |= (t[n / 8] & 255) << n % 32;
|
|
4248
4252
|
return r;
|
|
4249
4253
|
}
|
|
4250
|
-
function
|
|
4254
|
+
function ae(t, e) {
|
|
4251
4255
|
var r = (t & 65535) + (e & 65535), n = (t >> 16) + (e >> 16) + (r >> 16);
|
|
4252
4256
|
return n << 16 | r & 65535;
|
|
4253
4257
|
}
|
|
4254
4258
|
function ds(t, e) {
|
|
4255
4259
|
return t << e | t >>> 32 - e;
|
|
4256
4260
|
}
|
|
4257
|
-
function
|
|
4258
|
-
return
|
|
4261
|
+
function Be(t, e, r, n, a, s) {
|
|
4262
|
+
return ae(ds(ae(ae(e, t), ae(n, s)), a), r);
|
|
4259
4263
|
}
|
|
4260
4264
|
function D(t, e, r, n, a, s, i) {
|
|
4261
|
-
return
|
|
4265
|
+
return Be(e & r | ~e & n, t, e, a, s, i);
|
|
4262
4266
|
}
|
|
4263
4267
|
function J(t, e, r, n, a, s, i) {
|
|
4264
|
-
return
|
|
4268
|
+
return Be(e & n | r & ~n, t, e, a, s, i);
|
|
4265
4269
|
}
|
|
4266
4270
|
function N(t, e, r, n, a, s, i) {
|
|
4267
|
-
return
|
|
4271
|
+
return Be(e ^ r ^ n, t, e, a, s, i);
|
|
4268
4272
|
}
|
|
4269
4273
|
function $(t, e, r, n, a, s, i) {
|
|
4270
|
-
return
|
|
4274
|
+
return Be(r ^ (e | ~n), t, e, a, s, i);
|
|
4271
4275
|
}
|
|
4272
4276
|
var fs = Br("v3", 48, os);
|
|
4273
4277
|
const hs = fs;
|
|
@@ -4280,7 +4284,7 @@ function ps(t, e, r) {
|
|
|
4280
4284
|
e[r + a] = n[a];
|
|
4281
4285
|
return e;
|
|
4282
4286
|
}
|
|
4283
|
-
return
|
|
4287
|
+
return Ve(n);
|
|
4284
4288
|
}
|
|
4285
4289
|
function gs(t, e, r, n) {
|
|
4286
4290
|
switch (t) {
|
|
@@ -4294,7 +4298,7 @@ function gs(t, e, r, n) {
|
|
|
4294
4298
|
return e ^ r ^ n;
|
|
4295
4299
|
}
|
|
4296
4300
|
}
|
|
4297
|
-
function
|
|
4301
|
+
function et(t, e) {
|
|
4298
4302
|
return t << e | t >>> 32 - e;
|
|
4299
4303
|
}
|
|
4300
4304
|
function ms(t) {
|
|
@@ -4317,10 +4321,10 @@ function ms(t) {
|
|
|
4317
4321
|
for (var d = new Uint32Array(80), p = 0; p < 16; ++p)
|
|
4318
4322
|
d[p] = o[f][p];
|
|
4319
4323
|
for (var h = 16; h < 80; ++h)
|
|
4320
|
-
d[h] =
|
|
4324
|
+
d[h] = et(d[h - 3] ^ d[h - 8] ^ d[h - 14] ^ d[h - 16], 1);
|
|
4321
4325
|
for (var g = r[0], S = r[1], C = r[2], v = r[3], w = r[4], m = 0; m < 80; ++m) {
|
|
4322
|
-
var E = Math.floor(m / 20), _ =
|
|
4323
|
-
w = v, v = C, C =
|
|
4326
|
+
var E = Math.floor(m / 20), _ = et(g, 5) + gs(E, S, C, v) + w + e[E] + d[m] >>> 0;
|
|
4327
|
+
w = v, v = C, C = et(S, 30) >>> 0, S = g, g = _;
|
|
4324
4328
|
}
|
|
4325
4329
|
r[0] = r[0] + g >>> 0, r[1] = r[1] + S >>> 0, r[2] = r[2] + C >>> 0, r[3] = r[3] + v >>> 0, r[4] = r[4] + w >>> 0;
|
|
4326
4330
|
}
|
|
@@ -4329,7 +4333,7 @@ function ms(t) {
|
|
|
4329
4333
|
var ys = Br("v5", 80, ms);
|
|
4330
4334
|
const ws = ys, Ss = "00000000-0000-0000-0000-000000000000";
|
|
4331
4335
|
function bs(t) {
|
|
4332
|
-
if (!
|
|
4336
|
+
if (!Fe(t))
|
|
4333
4337
|
throw TypeError("Invalid UUID");
|
|
4334
4338
|
return parseInt(t.substr(14, 1), 16);
|
|
4335
4339
|
}
|
|
@@ -4337,24 +4341,24 @@ const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4337
4341
|
__proto__: null,
|
|
4338
4342
|
NIL: Ss,
|
|
4339
4343
|
parse: Vr,
|
|
4340
|
-
stringify:
|
|
4344
|
+
stringify: Ve,
|
|
4341
4345
|
v1: ns,
|
|
4342
4346
|
v3: hs,
|
|
4343
4347
|
v4: ps,
|
|
4344
4348
|
v5: ws,
|
|
4345
|
-
validate:
|
|
4349
|
+
validate: Fe,
|
|
4346
4350
|
version: bs
|
|
4347
|
-
}, Symbol.toStringTag, { value: "Module" })), Es = /* @__PURE__ */
|
|
4348
|
-
var
|
|
4351
|
+
}, Symbol.toStringTag, { value: "Module" })), Es = /* @__PURE__ */ ht(vs);
|
|
4352
|
+
var le = {}, tt = { exports: {} }, rt = { exports: {} }, Gt;
|
|
4349
4353
|
function As() {
|
|
4350
4354
|
return Gt || (Gt = 1, function(t) {
|
|
4351
4355
|
function e(r, n) {
|
|
4352
4356
|
return n.get ? n.get.call(r) : n.value;
|
|
4353
4357
|
}
|
|
4354
4358
|
t.exports = e, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
4355
|
-
}(
|
|
4359
|
+
}(rt)), rt.exports;
|
|
4356
4360
|
}
|
|
4357
|
-
var
|
|
4361
|
+
var nt = { exports: {} }, zt;
|
|
4358
4362
|
function zr() {
|
|
4359
4363
|
return zt || (zt = 1, function(t) {
|
|
4360
4364
|
function e(r, n, a) {
|
|
@@ -4363,7 +4367,7 @@ function zr() {
|
|
|
4363
4367
|
return n.get(r);
|
|
4364
4368
|
}
|
|
4365
4369
|
t.exports = e, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
4366
|
-
}(
|
|
4370
|
+
}(nt)), nt.exports;
|
|
4367
4371
|
}
|
|
4368
4372
|
var qt;
|
|
4369
4373
|
function xs() {
|
|
@@ -4374,9 +4378,9 @@ function xs() {
|
|
|
4374
4378
|
return e(a, i);
|
|
4375
4379
|
}
|
|
4376
4380
|
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
4377
|
-
}(
|
|
4381
|
+
}(tt)), tt.exports;
|
|
4378
4382
|
}
|
|
4379
|
-
var
|
|
4383
|
+
var at = { exports: {} }, st = { exports: {} }, Xt;
|
|
4380
4384
|
function Cs() {
|
|
4381
4385
|
return Xt || (Xt = 1, function(t) {
|
|
4382
4386
|
function e(r, n, a) {
|
|
@@ -4389,7 +4393,7 @@ function Cs() {
|
|
|
4389
4393
|
}
|
|
4390
4394
|
}
|
|
4391
4395
|
t.exports = e, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
4392
|
-
}(
|
|
4396
|
+
}(st)), st.exports;
|
|
4393
4397
|
}
|
|
4394
4398
|
var Yt;
|
|
4395
4399
|
function _s() {
|
|
@@ -4400,17 +4404,17 @@ function _s() {
|
|
|
4400
4404
|
return e(a, o, i), i;
|
|
4401
4405
|
}
|
|
4402
4406
|
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
|
|
4403
|
-
}(
|
|
4407
|
+
}(at)), at.exports;
|
|
4404
4408
|
}
|
|
4405
4409
|
var Zt;
|
|
4406
4410
|
function Ps() {
|
|
4407
4411
|
if (Zt)
|
|
4408
|
-
return
|
|
4412
|
+
return le;
|
|
4409
4413
|
Zt = 1;
|
|
4410
4414
|
var t = ar;
|
|
4411
|
-
Object.defineProperty(
|
|
4415
|
+
Object.defineProperty(le, "__esModule", {
|
|
4412
4416
|
value: !0
|
|
4413
|
-
}),
|
|
4417
|
+
}), le.SessionStore = void 0, le.defaultCookies = l;
|
|
4414
4418
|
var e = t(xs()), r = t(_s());
|
|
4415
4419
|
function n(w, m) {
|
|
4416
4420
|
s(w, m), m.add(w);
|
|
@@ -4544,7 +4548,7 @@ function Ps() {
|
|
|
4544
4548
|
return Object.values(i(this, g, v).call(this));
|
|
4545
4549
|
}
|
|
4546
4550
|
}
|
|
4547
|
-
|
|
4551
|
+
le.SessionStore = S;
|
|
4548
4552
|
function C(w) {
|
|
4549
4553
|
const m = Math.ceil(w.value.length / u);
|
|
4550
4554
|
if (m === 1)
|
|
@@ -4580,13 +4584,13 @@ function Ps() {
|
|
|
4580
4584
|
}
|
|
4581
4585
|
return w;
|
|
4582
4586
|
}
|
|
4583
|
-
return
|
|
4587
|
+
return le;
|
|
4584
4588
|
}
|
|
4585
|
-
var
|
|
4589
|
+
var it = {}, Qt;
|
|
4586
4590
|
function Hs() {
|
|
4587
|
-
return Qt || (Qt = 1, Object.defineProperty(
|
|
4591
|
+
return Qt || (Qt = 1, Object.defineProperty(it, "__esModule", {
|
|
4588
4592
|
value: !0
|
|
4589
|
-
})),
|
|
4593
|
+
})), it;
|
|
4590
4594
|
}
|
|
4591
4595
|
(function(t) {
|
|
4592
4596
|
var e = ar;
|
|
@@ -4660,8 +4664,8 @@ function Hs() {
|
|
|
4660
4664
|
}, A).value;
|
|
4661
4665
|
const Y = v.headers instanceof Headers ? v.headers.get("authorization") : (C = v.headers) === null || C === void 0 ? void 0 : C.authorization;
|
|
4662
4666
|
if (!q && (Y == null ? void 0 : Y.split(" ")[0]) === "Bearer") {
|
|
4663
|
-
const
|
|
4664
|
-
q = decodeURIComponent(
|
|
4667
|
+
const Ge = Y.split(" ")[1];
|
|
4668
|
+
q = decodeURIComponent(Ge);
|
|
4665
4669
|
}
|
|
4666
4670
|
if (!q)
|
|
4667
4671
|
return null;
|
|
@@ -4685,12 +4689,12 @@ class Is extends Zr {
|
|
|
4685
4689
|
this.logDebug("entra validate Token Front");
|
|
4686
4690
|
const r = await rr.getToken({ req: e });
|
|
4687
4691
|
if (this.logDebug("Token Front", JSON.stringify(r)), !r)
|
|
4688
|
-
throw new
|
|
4692
|
+
throw new tr("UNAUTHORIZED").get();
|
|
4689
4693
|
return e;
|
|
4690
4694
|
}
|
|
4691
4695
|
}
|
|
4692
4696
|
export {
|
|
4693
4697
|
Is as C,
|
|
4694
|
-
|
|
4695
|
-
|
|
4698
|
+
En as E,
|
|
4699
|
+
tr as M
|
|
4696
4700
|
};
|