@versini/auth-provider 6.1.1 → 6.2.1
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/index.d.ts +3 -1
- package/dist/index.js +1221 -1268
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,124 +1,124 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsx as
|
|
5
|
-
import
|
|
1
|
+
var _t = Object.defineProperty;
|
|
2
|
+
var vt = (e, t, n) => t in e ? _t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var z = (e, t, n) => vt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { jsx as ke } from "react/jsx-runtime";
|
|
5
|
+
import kt, { useSyncExternalStore as Pt, useCallback as x, useEffect as Te, createContext as Ct, useReducer as Ot, useRef as Pe, useContext as Nt } from "react";
|
|
6
6
|
/*!
|
|
7
|
-
@versini/auth-provider v6.
|
|
7
|
+
@versini/auth-provider v6.2.1
|
|
8
8
|
© 2024 gizmette.com
|
|
9
9
|
*/
|
|
10
10
|
try {
|
|
11
11
|
window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
|
|
12
|
-
version: "6.
|
|
13
|
-
buildTime: "07/
|
|
12
|
+
version: "6.2.1",
|
|
13
|
+
buildTime: "07/18/2024 12:26 PM EDT",
|
|
14
14
|
homepage: "https://github.com/aversini/auth-client",
|
|
15
15
|
license: "MIT"
|
|
16
16
|
});
|
|
17
17
|
} catch {
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function k(e) {
|
|
20
20
|
const t = new Uint8Array(e);
|
|
21
|
-
let
|
|
21
|
+
let n = "";
|
|
22
22
|
for (const a of t)
|
|
23
|
-
|
|
24
|
-
return btoa(
|
|
23
|
+
n += String.fromCharCode(a);
|
|
24
|
+
return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
const t = e.replace(/-/g, "+").replace(/_/g, "/"),
|
|
28
|
-
for (let
|
|
29
|
-
o[
|
|
30
|
-
return
|
|
26
|
+
function ie(e) {
|
|
27
|
+
const t = e.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - t.length % 4) % 4, r = t.padEnd(t.length + n, "="), a = atob(r), s = new ArrayBuffer(a.length), o = new Uint8Array(s);
|
|
28
|
+
for (let i = 0; i < a.length; i++)
|
|
29
|
+
o[i] = a.charCodeAt(i);
|
|
30
|
+
return s;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Re() {
|
|
33
33
|
return (window == null ? void 0 : window.PublicKeyCredential) !== void 0 && typeof window.PublicKeyCredential == "function";
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Ve(e) {
|
|
36
36
|
const { id: t } = e;
|
|
37
37
|
return {
|
|
38
38
|
...e,
|
|
39
|
-
id:
|
|
39
|
+
id: ie(t),
|
|
40
40
|
transports: e.transports
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Ye(e) {
|
|
44
44
|
return e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e);
|
|
45
45
|
}
|
|
46
|
-
class
|
|
47
|
-
constructor({ message: t, code:
|
|
48
|
-
super(t, { cause:
|
|
46
|
+
class b extends Error {
|
|
47
|
+
constructor({ message: t, code: n, cause: r, name: a }) {
|
|
48
|
+
super(t, { cause: r }), this.name = a ?? r.name, this.code = n;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
var
|
|
53
|
-
const { publicKey:
|
|
54
|
-
if (!
|
|
51
|
+
function Dt({ error: e, options: t }) {
|
|
52
|
+
var r, a;
|
|
53
|
+
const { publicKey: n } = t;
|
|
54
|
+
if (!n)
|
|
55
55
|
throw Error("options was missing required publicKey property");
|
|
56
56
|
if (e.name === "AbortError") {
|
|
57
57
|
if (t.signal instanceof AbortSignal)
|
|
58
|
-
return new
|
|
58
|
+
return new b({
|
|
59
59
|
message: "Registration ceremony was sent an abort signal",
|
|
60
60
|
code: "ERROR_CEREMONY_ABORTED",
|
|
61
61
|
cause: e
|
|
62
62
|
});
|
|
63
63
|
} else if (e.name === "ConstraintError") {
|
|
64
|
-
if (((
|
|
65
|
-
return new
|
|
64
|
+
if (((r = n.authenticatorSelection) == null ? void 0 : r.requireResidentKey) === !0)
|
|
65
|
+
return new b({
|
|
66
66
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
67
67
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
68
68
|
cause: e
|
|
69
69
|
});
|
|
70
|
-
if (((a =
|
|
71
|
-
return new
|
|
70
|
+
if (((a = n.authenticatorSelection) == null ? void 0 : a.userVerification) === "required")
|
|
71
|
+
return new b({
|
|
72
72
|
message: "User verification was required but no available authenticator supported it",
|
|
73
73
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
74
74
|
cause: e
|
|
75
75
|
});
|
|
76
76
|
} else {
|
|
77
77
|
if (e.name === "InvalidStateError")
|
|
78
|
-
return new
|
|
78
|
+
return new b({
|
|
79
79
|
message: "The authenticator was previously registered",
|
|
80
80
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
81
81
|
cause: e
|
|
82
82
|
});
|
|
83
83
|
if (e.name === "NotAllowedError")
|
|
84
|
-
return new
|
|
84
|
+
return new b({
|
|
85
85
|
message: e.message,
|
|
86
86
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
87
87
|
cause: e
|
|
88
88
|
});
|
|
89
89
|
if (e.name === "NotSupportedError")
|
|
90
|
-
return
|
|
90
|
+
return n.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new b({
|
|
91
91
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
92
92
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
93
93
|
cause: e
|
|
94
|
-
}) : new
|
|
94
|
+
}) : new b({
|
|
95
95
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
96
96
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
97
97
|
cause: e
|
|
98
98
|
});
|
|
99
99
|
if (e.name === "SecurityError") {
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
102
|
-
if (
|
|
103
|
-
return new
|
|
104
|
-
message: `The RP ID "${
|
|
100
|
+
const s = window.location.hostname;
|
|
101
|
+
if (Ye(s)) {
|
|
102
|
+
if (n.rp.id !== s)
|
|
103
|
+
return new b({
|
|
104
|
+
message: `The RP ID "${n.rp.id}" is invalid for this domain`,
|
|
105
105
|
code: "ERROR_INVALID_RP_ID",
|
|
106
106
|
cause: e
|
|
107
107
|
});
|
|
108
|
-
} else return new
|
|
108
|
+
} else return new b({
|
|
109
109
|
message: `${window.location.hostname} is an invalid domain`,
|
|
110
110
|
code: "ERROR_INVALID_DOMAIN",
|
|
111
111
|
cause: e
|
|
112
112
|
});
|
|
113
113
|
} else if (e.name === "TypeError") {
|
|
114
|
-
if (
|
|
115
|
-
return new
|
|
114
|
+
if (n.user.id.byteLength < 1 || n.user.id.byteLength > 64)
|
|
115
|
+
return new b({
|
|
116
116
|
message: "User ID was not between 1 and 64 characters",
|
|
117
117
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
118
118
|
cause: e
|
|
119
119
|
});
|
|
120
120
|
} else if (e.name === "UnknownError")
|
|
121
|
-
return new
|
|
121
|
+
return new b({
|
|
122
122
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
123
123
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
124
124
|
cause: e
|
|
@@ -126,11 +126,11 @@ function Ht({ error: e, options: t }) {
|
|
|
126
126
|
}
|
|
127
127
|
return e;
|
|
128
128
|
}
|
|
129
|
-
class
|
|
129
|
+
class Ut {
|
|
130
130
|
createNewAbortSignal() {
|
|
131
131
|
if (this.controller) {
|
|
132
|
-
const
|
|
133
|
-
|
|
132
|
+
const n = new Error("Cancelling existing WebAuthn API call for new one");
|
|
133
|
+
n.name = "AbortError", this.controller.abort(n);
|
|
134
134
|
}
|
|
135
135
|
const t = new AbortController();
|
|
136
136
|
return this.controller = t, t.signal;
|
|
@@ -142,118 +142,118 @@ class xt {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
const
|
|
146
|
-
function
|
|
147
|
-
if (e && !(
|
|
145
|
+
const je = new Ut(), $t = ["cross-platform", "platform"];
|
|
146
|
+
function Fe(e) {
|
|
147
|
+
if (e && !($t.indexOf(e) < 0))
|
|
148
148
|
return e;
|
|
149
149
|
}
|
|
150
|
-
async function
|
|
151
|
-
var
|
|
152
|
-
if (!
|
|
150
|
+
async function Kt(e) {
|
|
151
|
+
var p;
|
|
152
|
+
if (!Re())
|
|
153
153
|
throw new Error("WebAuthn is not supported in this browser");
|
|
154
|
-
const
|
|
154
|
+
const n = { publicKey: {
|
|
155
155
|
...e,
|
|
156
|
-
challenge:
|
|
156
|
+
challenge: ie(e.challenge),
|
|
157
157
|
user: {
|
|
158
158
|
...e.user,
|
|
159
|
-
id:
|
|
159
|
+
id: ie(e.user.id)
|
|
160
160
|
},
|
|
161
|
-
excludeCredentials: (
|
|
161
|
+
excludeCredentials: (p = e.excludeCredentials) == null ? void 0 : p.map(Ve)
|
|
162
162
|
} };
|
|
163
|
-
|
|
164
|
-
let
|
|
163
|
+
n.signal = je.createNewAbortSignal();
|
|
164
|
+
let r;
|
|
165
165
|
try {
|
|
166
|
-
|
|
167
|
-
} catch (
|
|
168
|
-
throw
|
|
166
|
+
r = await navigator.credentials.create(n);
|
|
167
|
+
} catch (l) {
|
|
168
|
+
throw Dt({ error: l, options: n });
|
|
169
169
|
}
|
|
170
|
-
if (!
|
|
170
|
+
if (!r)
|
|
171
171
|
throw new Error("Registration was not completed");
|
|
172
|
-
const { id: a, rawId:
|
|
172
|
+
const { id: a, rawId: s, response: o, type: i } = r;
|
|
173
173
|
let u;
|
|
174
174
|
typeof o.getTransports == "function" && (u = o.getTransports());
|
|
175
|
-
let
|
|
175
|
+
let f;
|
|
176
176
|
if (typeof o.getPublicKeyAlgorithm == "function")
|
|
177
177
|
try {
|
|
178
|
-
|
|
179
|
-
} catch (
|
|
180
|
-
|
|
178
|
+
f = o.getPublicKeyAlgorithm();
|
|
179
|
+
} catch (l) {
|
|
180
|
+
fe("getPublicKeyAlgorithm()", l);
|
|
181
181
|
}
|
|
182
|
-
let
|
|
182
|
+
let y;
|
|
183
183
|
if (typeof o.getPublicKey == "function")
|
|
184
184
|
try {
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
} catch (
|
|
188
|
-
|
|
185
|
+
const l = o.getPublicKey();
|
|
186
|
+
l !== null && (y = k(l));
|
|
187
|
+
} catch (l) {
|
|
188
|
+
fe("getPublicKey()", l);
|
|
189
189
|
}
|
|
190
|
-
let
|
|
190
|
+
let h;
|
|
191
191
|
if (typeof o.getAuthenticatorData == "function")
|
|
192
192
|
try {
|
|
193
|
-
|
|
194
|
-
} catch (
|
|
195
|
-
|
|
193
|
+
h = k(o.getAuthenticatorData());
|
|
194
|
+
} catch (l) {
|
|
195
|
+
fe("getAuthenticatorData()", l);
|
|
196
196
|
}
|
|
197
197
|
return {
|
|
198
198
|
id: a,
|
|
199
|
-
rawId:
|
|
199
|
+
rawId: k(s),
|
|
200
200
|
response: {
|
|
201
|
-
attestationObject:
|
|
202
|
-
clientDataJSON:
|
|
201
|
+
attestationObject: k(o.attestationObject),
|
|
202
|
+
clientDataJSON: k(o.clientDataJSON),
|
|
203
203
|
transports: u,
|
|
204
|
-
publicKeyAlgorithm:
|
|
205
|
-
publicKey:
|
|
206
|
-
authenticatorData:
|
|
204
|
+
publicKeyAlgorithm: f,
|
|
205
|
+
publicKey: y,
|
|
206
|
+
authenticatorData: h
|
|
207
207
|
},
|
|
208
|
-
type:
|
|
209
|
-
clientExtensionResults:
|
|
210
|
-
authenticatorAttachment:
|
|
208
|
+
type: i,
|
|
209
|
+
clientExtensionResults: r.getClientExtensionResults(),
|
|
210
|
+
authenticatorAttachment: Fe(r.authenticatorAttachment)
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function fe(e, t) {
|
|
214
214
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
|
|
215
215
|
`, t);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
if (!
|
|
217
|
+
function Ht() {
|
|
218
|
+
if (!Re())
|
|
219
219
|
return new Promise((t) => t(!1));
|
|
220
220
|
const e = window.PublicKeyCredential;
|
|
221
221
|
return e.isConditionalMediationAvailable === void 0 ? new Promise((t) => t(!1)) : e.isConditionalMediationAvailable();
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
const { publicKey:
|
|
225
|
-
if (!
|
|
223
|
+
function Lt({ error: e, options: t }) {
|
|
224
|
+
const { publicKey: n } = t;
|
|
225
|
+
if (!n)
|
|
226
226
|
throw Error("options was missing required publicKey property");
|
|
227
227
|
if (e.name === "AbortError") {
|
|
228
228
|
if (t.signal instanceof AbortSignal)
|
|
229
|
-
return new
|
|
229
|
+
return new b({
|
|
230
230
|
message: "Authentication ceremony was sent an abort signal",
|
|
231
231
|
code: "ERROR_CEREMONY_ABORTED",
|
|
232
232
|
cause: e
|
|
233
233
|
});
|
|
234
234
|
} else {
|
|
235
235
|
if (e.name === "NotAllowedError")
|
|
236
|
-
return new
|
|
236
|
+
return new b({
|
|
237
237
|
message: e.message,
|
|
238
238
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
239
239
|
cause: e
|
|
240
240
|
});
|
|
241
241
|
if (e.name === "SecurityError") {
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
244
|
-
if (
|
|
245
|
-
return new
|
|
246
|
-
message: `The RP ID "${
|
|
242
|
+
const r = window.location.hostname;
|
|
243
|
+
if (Ye(r)) {
|
|
244
|
+
if (n.rpId !== r)
|
|
245
|
+
return new b({
|
|
246
|
+
message: `The RP ID "${n.rpId}" is invalid for this domain`,
|
|
247
247
|
code: "ERROR_INVALID_RP_ID",
|
|
248
248
|
cause: e
|
|
249
249
|
});
|
|
250
|
-
} else return new
|
|
250
|
+
} else return new b({
|
|
251
251
|
message: `${window.location.hostname} is an invalid domain`,
|
|
252
252
|
code: "ERROR_INVALID_DOMAIN",
|
|
253
253
|
cause: e
|
|
254
254
|
});
|
|
255
255
|
} else if (e.name === "UnknownError")
|
|
256
|
-
return new
|
|
256
|
+
return new b({
|
|
257
257
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
258
258
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
259
259
|
cause: e
|
|
@@ -261,47 +261,47 @@ function jt({ error: e, options: t }) {
|
|
|
261
261
|
}
|
|
262
262
|
return e;
|
|
263
263
|
}
|
|
264
|
-
async function
|
|
265
|
-
var
|
|
266
|
-
if (!
|
|
264
|
+
async function Wt(e, t = !1) {
|
|
265
|
+
var h, p;
|
|
266
|
+
if (!Re())
|
|
267
267
|
throw new Error("WebAuthn is not supported in this browser");
|
|
268
|
-
let
|
|
269
|
-
((
|
|
270
|
-
const
|
|
268
|
+
let n;
|
|
269
|
+
((h = e.allowCredentials) == null ? void 0 : h.length) !== 0 && (n = (p = e.allowCredentials) == null ? void 0 : p.map(Ve));
|
|
270
|
+
const r = {
|
|
271
271
|
...e,
|
|
272
|
-
challenge:
|
|
273
|
-
allowCredentials:
|
|
272
|
+
challenge: ie(e.challenge),
|
|
273
|
+
allowCredentials: n
|
|
274
274
|
}, a = {};
|
|
275
275
|
if (t) {
|
|
276
|
-
if (!await
|
|
276
|
+
if (!await Ht())
|
|
277
277
|
throw Error("Browser does not support WebAuthn autofill");
|
|
278
278
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1)
|
|
279
279
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
280
|
-
a.mediation = "conditional",
|
|
280
|
+
a.mediation = "conditional", r.allowCredentials = [];
|
|
281
281
|
}
|
|
282
|
-
a.publicKey =
|
|
283
|
-
let
|
|
282
|
+
a.publicKey = r, a.signal = je.createNewAbortSignal();
|
|
283
|
+
let s;
|
|
284
284
|
try {
|
|
285
|
-
|
|
286
|
-
} catch (
|
|
287
|
-
throw
|
|
285
|
+
s = await navigator.credentials.get(a);
|
|
286
|
+
} catch (l) {
|
|
287
|
+
throw Lt({ error: l, options: a });
|
|
288
288
|
}
|
|
289
|
-
if (!
|
|
289
|
+
if (!s)
|
|
290
290
|
throw new Error("Authentication was not completed");
|
|
291
|
-
const { id: o, rawId:
|
|
292
|
-
let
|
|
293
|
-
return u.userHandle && (
|
|
291
|
+
const { id: o, rawId: i, response: u, type: f } = s;
|
|
292
|
+
let y;
|
|
293
|
+
return u.userHandle && (y = k(u.userHandle)), {
|
|
294
294
|
id: o,
|
|
295
|
-
rawId:
|
|
295
|
+
rawId: k(i),
|
|
296
296
|
response: {
|
|
297
|
-
authenticatorData:
|
|
298
|
-
clientDataJSON:
|
|
299
|
-
signature:
|
|
300
|
-
userHandle:
|
|
297
|
+
authenticatorData: k(u.authenticatorData),
|
|
298
|
+
clientDataJSON: k(u.clientDataJSON),
|
|
299
|
+
signature: k(u.signature),
|
|
300
|
+
userHandle: y
|
|
301
301
|
},
|
|
302
|
-
type:
|
|
303
|
-
clientExtensionResults:
|
|
304
|
-
authenticatorAttachment:
|
|
302
|
+
type: f,
|
|
303
|
+
clientExtensionResults: s.getClientExtensionResults(),
|
|
304
|
+
authenticatorAttachment: Fe(s.authenticatorAttachment)
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
307
|
/*!
|
|
@@ -311,22 +311,22 @@ async function Bt(e, t = !1) {
|
|
|
311
311
|
try {
|
|
312
312
|
window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
|
|
313
313
|
version: "2.12.1",
|
|
314
|
-
buildTime: "07/
|
|
314
|
+
buildTime: "07/18/2024 12:26 PM EDT",
|
|
315
315
|
homepage: "https://github.com/aversini/auth-client",
|
|
316
316
|
license: "MIT"
|
|
317
317
|
});
|
|
318
318
|
} catch {
|
|
319
319
|
}
|
|
320
|
-
const
|
|
320
|
+
const j = {
|
|
321
321
|
ID_TOKEN: "id_token",
|
|
322
322
|
ACCESS_TOKEN: "token",
|
|
323
323
|
ID_AND_ACCESS_TOKEN: "id_token token",
|
|
324
324
|
CODE: "code",
|
|
325
325
|
REFRESH_TOKEN: "refresh_token",
|
|
326
326
|
PASSKEY: "passkey"
|
|
327
|
-
},
|
|
327
|
+
}, Be = {
|
|
328
328
|
CLIENT_ID: "X-Auth-ClientId"
|
|
329
|
-
},
|
|
329
|
+
}, I = {
|
|
330
330
|
ALG: "RS256",
|
|
331
331
|
USER_ID_KEY: "sub",
|
|
332
332
|
TOKEN_ID_KEY: "__raw",
|
|
@@ -334,7 +334,7 @@ const J = {
|
|
|
334
334
|
USERNAME_KEY: "username",
|
|
335
335
|
AUTH_TYPE_KEY: "auth_type",
|
|
336
336
|
ISSUER: "gizmette.com"
|
|
337
|
-
},
|
|
337
|
+
}, xt = `-----BEGIN PUBLIC KEY-----
|
|
338
338
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
|
|
339
339
|
w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
|
|
340
340
|
i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
|
|
@@ -342,57 +342,56 @@ aMwPFOIcJH+rKfFgNcHLcaS5syp7zU1ANwZ+trgR+DifBr8TLVkBynmNeTyhDm2+
|
|
|
342
342
|
l0haqjMk0UoNPPE8iYBWUHQJJE1Dqstj65d6Eh5g64Pao25y4cmYJbKjiblIGEkE
|
|
343
343
|
sjqybA9mARAqh9k/eiIopecWSiffNQTwVQVd2I9ZH3BalhEXHlqFgrjz51kFqg81
|
|
344
344
|
awIDAQAB
|
|
345
|
-
-----END PUBLIC KEY-----`,
|
|
345
|
+
-----END PUBLIC KEY-----`, de = {
|
|
346
346
|
AUTHENTICATE: "authenticate",
|
|
347
347
|
CODE: "code",
|
|
348
348
|
LOGOUT: "logout"
|
|
349
|
-
},
|
|
350
|
-
function
|
|
351
|
-
const t = e.reduce((a, { length:
|
|
352
|
-
let
|
|
349
|
+
}, he = crypto, qe = (e) => e instanceof CryptoKey, Q = new TextEncoder(), B = new TextDecoder();
|
|
350
|
+
function Mt(...e) {
|
|
351
|
+
const t = e.reduce((a, { length: s }) => a + s, 0), n = new Uint8Array(t);
|
|
352
|
+
let r = 0;
|
|
353
353
|
for (const a of e)
|
|
354
|
-
|
|
355
|
-
return
|
|
354
|
+
n.set(a, r), r += a.length;
|
|
355
|
+
return n;
|
|
356
356
|
}
|
|
357
|
-
const
|
|
358
|
-
const t = atob(e),
|
|
359
|
-
for (let
|
|
360
|
-
r
|
|
361
|
-
return
|
|
362
|
-
},
|
|
357
|
+
const Gt = (e) => {
|
|
358
|
+
const t = atob(e), n = new Uint8Array(t.length);
|
|
359
|
+
for (let r = 0; r < t.length; r++)
|
|
360
|
+
n[r] = t.charCodeAt(r);
|
|
361
|
+
return n;
|
|
362
|
+
}, Y = (e) => {
|
|
363
363
|
let t = e;
|
|
364
|
-
t instanceof Uint8Array && (t =
|
|
364
|
+
t instanceof Uint8Array && (t = B.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
365
365
|
try {
|
|
366
|
-
return
|
|
366
|
+
return Gt(t);
|
|
367
367
|
} catch {
|
|
368
368
|
throw new TypeError("The input to be decoded is not correctly encoded.");
|
|
369
369
|
}
|
|
370
370
|
};
|
|
371
|
-
let
|
|
371
|
+
let U = class extends Error {
|
|
372
372
|
static get code() {
|
|
373
373
|
return "ERR_JOSE_GENERIC";
|
|
374
374
|
}
|
|
375
375
|
constructor(t) {
|
|
376
|
-
var
|
|
377
|
-
super(t), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (
|
|
376
|
+
var n;
|
|
377
|
+
super(t), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
|
|
378
378
|
}
|
|
379
|
-
},
|
|
379
|
+
}, v = class extends U {
|
|
380
380
|
static get code() {
|
|
381
381
|
return "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
382
382
|
}
|
|
383
|
-
constructor(t,
|
|
384
|
-
super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim =
|
|
383
|
+
constructor(t, n, r = "unspecified", a = "unspecified") {
|
|
384
|
+
super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = r, this.reason = a, this.payload = n;
|
|
385
385
|
}
|
|
386
|
-
}
|
|
387
|
-
class $e extends M {
|
|
386
|
+
}, Ce = class extends U {
|
|
388
387
|
static get code() {
|
|
389
388
|
return "ERR_JWT_EXPIRED";
|
|
390
389
|
}
|
|
391
|
-
constructor(t,
|
|
392
|
-
super(t), this.code = "ERR_JWT_EXPIRED", this.claim =
|
|
390
|
+
constructor(t, n, r = "unspecified", a = "unspecified") {
|
|
391
|
+
super(t), this.code = "ERR_JWT_EXPIRED", this.claim = r, this.reason = a, this.payload = n;
|
|
393
392
|
}
|
|
394
|
-
}
|
|
395
|
-
class
|
|
393
|
+
};
|
|
394
|
+
class Jt extends U {
|
|
396
395
|
constructor() {
|
|
397
396
|
super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
398
397
|
}
|
|
@@ -400,21 +399,23 @@ class qt extends M {
|
|
|
400
399
|
return "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
401
400
|
}
|
|
402
401
|
}
|
|
403
|
-
let
|
|
402
|
+
let N = class extends U {
|
|
404
403
|
constructor() {
|
|
405
404
|
super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
|
|
406
405
|
}
|
|
407
406
|
static get code() {
|
|
408
407
|
return "ERR_JOSE_NOT_SUPPORTED";
|
|
409
408
|
}
|
|
410
|
-
}
|
|
409
|
+
};
|
|
410
|
+
class R extends U {
|
|
411
411
|
constructor() {
|
|
412
412
|
super(...arguments), this.code = "ERR_JWS_INVALID";
|
|
413
413
|
}
|
|
414
414
|
static get code() {
|
|
415
415
|
return "ERR_JWS_INVALID";
|
|
416
416
|
}
|
|
417
|
-
}
|
|
417
|
+
}
|
|
418
|
+
let C = class extends U {
|
|
418
419
|
constructor() {
|
|
419
420
|
super(...arguments), this.code = "ERR_JWT_INVALID";
|
|
420
421
|
}
|
|
@@ -422,7 +423,7 @@ let U = class extends M {
|
|
|
422
423
|
return "ERR_JWT_INVALID";
|
|
423
424
|
}
|
|
424
425
|
};
|
|
425
|
-
class
|
|
426
|
+
class Vt extends U {
|
|
426
427
|
constructor() {
|
|
427
428
|
super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
|
|
428
429
|
}
|
|
@@ -430,16 +431,16 @@ class zt extends M {
|
|
|
430
431
|
return "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
431
432
|
}
|
|
432
433
|
}
|
|
433
|
-
function
|
|
434
|
+
function P(e, t = "algorithm.name") {
|
|
434
435
|
return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
|
|
435
436
|
}
|
|
436
|
-
function
|
|
437
|
+
function X(e, t) {
|
|
437
438
|
return e.name === t;
|
|
438
439
|
}
|
|
439
|
-
function
|
|
440
|
+
function ye(e) {
|
|
440
441
|
return parseInt(e.name.slice(4), 10);
|
|
441
442
|
}
|
|
442
|
-
function
|
|
443
|
+
function Yt(e) {
|
|
443
444
|
switch (e) {
|
|
444
445
|
case "ES256":
|
|
445
446
|
return "P-256";
|
|
@@ -451,104 +452,104 @@ function Qt(e) {
|
|
|
451
452
|
throw new Error("unreachable");
|
|
452
453
|
}
|
|
453
454
|
}
|
|
454
|
-
function
|
|
455
|
-
if (t.length && !t.some((
|
|
456
|
-
let
|
|
455
|
+
function jt(e, t) {
|
|
456
|
+
if (t.length && !t.some((n) => e.usages.includes(n))) {
|
|
457
|
+
let n = "CryptoKey does not support this operation, its usages must include ";
|
|
457
458
|
if (t.length > 2) {
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
} else t.length === 2 ?
|
|
461
|
-
throw new TypeError(
|
|
459
|
+
const r = t.pop();
|
|
460
|
+
n += `one of ${t.join(", ")}, or ${r}.`;
|
|
461
|
+
} else t.length === 2 ? n += `one of ${t[0]} or ${t[1]}.` : n += `${t[0]}.`;
|
|
462
|
+
throw new TypeError(n);
|
|
462
463
|
}
|
|
463
464
|
}
|
|
464
|
-
function
|
|
465
|
+
function Ft(e, t, ...n) {
|
|
465
466
|
switch (t) {
|
|
466
467
|
case "HS256":
|
|
467
468
|
case "HS384":
|
|
468
469
|
case "HS512": {
|
|
469
|
-
if (!
|
|
470
|
-
throw
|
|
471
|
-
const
|
|
472
|
-
if (
|
|
473
|
-
throw
|
|
470
|
+
if (!X(e.algorithm, "HMAC"))
|
|
471
|
+
throw P("HMAC");
|
|
472
|
+
const r = parseInt(t.slice(2), 10);
|
|
473
|
+
if (ye(e.algorithm.hash) !== r)
|
|
474
|
+
throw P(`SHA-${r}`, "algorithm.hash");
|
|
474
475
|
break;
|
|
475
476
|
}
|
|
476
477
|
case "RS256":
|
|
477
478
|
case "RS384":
|
|
478
479
|
case "RS512": {
|
|
479
|
-
if (!
|
|
480
|
-
throw
|
|
481
|
-
const
|
|
482
|
-
if (
|
|
483
|
-
throw
|
|
480
|
+
if (!X(e.algorithm, "RSASSA-PKCS1-v1_5"))
|
|
481
|
+
throw P("RSASSA-PKCS1-v1_5");
|
|
482
|
+
const r = parseInt(t.slice(2), 10);
|
|
483
|
+
if (ye(e.algorithm.hash) !== r)
|
|
484
|
+
throw P(`SHA-${r}`, "algorithm.hash");
|
|
484
485
|
break;
|
|
485
486
|
}
|
|
486
487
|
case "PS256":
|
|
487
488
|
case "PS384":
|
|
488
489
|
case "PS512": {
|
|
489
|
-
if (!
|
|
490
|
-
throw
|
|
491
|
-
const
|
|
492
|
-
if (
|
|
493
|
-
throw
|
|
490
|
+
if (!X(e.algorithm, "RSA-PSS"))
|
|
491
|
+
throw P("RSA-PSS");
|
|
492
|
+
const r = parseInt(t.slice(2), 10);
|
|
493
|
+
if (ye(e.algorithm.hash) !== r)
|
|
494
|
+
throw P(`SHA-${r}`, "algorithm.hash");
|
|
494
495
|
break;
|
|
495
496
|
}
|
|
496
497
|
case "EdDSA": {
|
|
497
498
|
if (e.algorithm.name !== "Ed25519" && e.algorithm.name !== "Ed448")
|
|
498
|
-
throw
|
|
499
|
+
throw P("Ed25519 or Ed448");
|
|
499
500
|
break;
|
|
500
501
|
}
|
|
501
502
|
case "ES256":
|
|
502
503
|
case "ES384":
|
|
503
504
|
case "ES512": {
|
|
504
|
-
if (!
|
|
505
|
-
throw
|
|
506
|
-
const
|
|
507
|
-
if (e.algorithm.namedCurve !==
|
|
508
|
-
throw
|
|
505
|
+
if (!X(e.algorithm, "ECDSA"))
|
|
506
|
+
throw P("ECDSA");
|
|
507
|
+
const r = Yt(t);
|
|
508
|
+
if (e.algorithm.namedCurve !== r)
|
|
509
|
+
throw P(r, "algorithm.namedCurve");
|
|
509
510
|
break;
|
|
510
511
|
}
|
|
511
512
|
default:
|
|
512
513
|
throw new TypeError("CryptoKey does not support this operation");
|
|
513
514
|
}
|
|
514
|
-
|
|
515
|
+
jt(e, n);
|
|
515
516
|
}
|
|
516
|
-
function
|
|
517
|
-
var
|
|
518
|
-
if (
|
|
519
|
-
const a =
|
|
520
|
-
e += `one of type ${
|
|
521
|
-
} else
|
|
522
|
-
return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && (
|
|
517
|
+
function ze(e, t, ...n) {
|
|
518
|
+
var r;
|
|
519
|
+
if (n.length > 2) {
|
|
520
|
+
const a = n.pop();
|
|
521
|
+
e += `one of type ${n.join(", ")}, or ${a}.`;
|
|
522
|
+
} else n.length === 2 ? e += `one of type ${n[0]} or ${n[1]}.` : e += `of type ${n[0]}.`;
|
|
523
|
+
return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && (r = t.constructor) != null && r.name && (e += ` Received an instance of ${t.constructor.name}`), e;
|
|
523
524
|
}
|
|
524
|
-
const
|
|
525
|
-
function
|
|
526
|
-
return
|
|
525
|
+
const Oe = (e, ...t) => ze("Key must be ", e, ...t);
|
|
526
|
+
function Qe(e, t, ...n) {
|
|
527
|
+
return ze(`Key for the ${e} algorithm must be `, t, ...n);
|
|
527
528
|
}
|
|
528
|
-
const
|
|
529
|
+
const Xe = (e) => qe(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", ce = ["CryptoKey"], Bt = (...e) => {
|
|
529
530
|
const t = e.filter(Boolean);
|
|
530
531
|
if (t.length === 0 || t.length === 1)
|
|
531
532
|
return !0;
|
|
532
|
-
let
|
|
533
|
-
for (const
|
|
534
|
-
const a = Object.keys(
|
|
535
|
-
if (!
|
|
536
|
-
|
|
533
|
+
let n;
|
|
534
|
+
for (const r of t) {
|
|
535
|
+
const a = Object.keys(r);
|
|
536
|
+
if (!n || n.size === 0) {
|
|
537
|
+
n = new Set(a);
|
|
537
538
|
continue;
|
|
538
539
|
}
|
|
539
|
-
for (const
|
|
540
|
-
if (
|
|
540
|
+
for (const s of a) {
|
|
541
|
+
if (n.has(s))
|
|
541
542
|
return !1;
|
|
542
|
-
|
|
543
|
+
n.add(s);
|
|
543
544
|
}
|
|
544
545
|
}
|
|
545
546
|
return !0;
|
|
546
547
|
};
|
|
547
|
-
function
|
|
548
|
+
function qt(e) {
|
|
548
549
|
return typeof e == "object" && e !== null;
|
|
549
550
|
}
|
|
550
|
-
function
|
|
551
|
-
if (!
|
|
551
|
+
function ue(e) {
|
|
552
|
+
if (!qt(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
552
553
|
return !1;
|
|
553
554
|
if (Object.getPrototypeOf(e) === null)
|
|
554
555
|
return !0;
|
|
@@ -557,27 +558,27 @@ function _e(e) {
|
|
|
557
558
|
t = Object.getPrototypeOf(t);
|
|
558
559
|
return Object.getPrototypeOf(e) === t;
|
|
559
560
|
}
|
|
560
|
-
const
|
|
561
|
+
const zt = (e, t) => {
|
|
561
562
|
if (e.startsWith("RS") || e.startsWith("PS")) {
|
|
562
|
-
const { modulusLength:
|
|
563
|
-
if (typeof
|
|
563
|
+
const { modulusLength: n } = t.algorithm;
|
|
564
|
+
if (typeof n != "number" || n < 2048)
|
|
564
565
|
throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
|
|
565
566
|
}
|
|
566
567
|
};
|
|
567
|
-
function
|
|
568
|
-
let t,
|
|
568
|
+
function Qt(e) {
|
|
569
|
+
let t, n;
|
|
569
570
|
switch (e.kty) {
|
|
570
571
|
case "RSA": {
|
|
571
572
|
switch (e.alg) {
|
|
572
573
|
case "PS256":
|
|
573
574
|
case "PS384":
|
|
574
575
|
case "PS512":
|
|
575
|
-
t = { name: "RSA-PSS", hash: `SHA-${e.alg.slice(-3)}` },
|
|
576
|
+
t = { name: "RSA-PSS", hash: `SHA-${e.alg.slice(-3)}` }, n = e.d ? ["sign"] : ["verify"];
|
|
576
577
|
break;
|
|
577
578
|
case "RS256":
|
|
578
579
|
case "RS384":
|
|
579
580
|
case "RS512":
|
|
580
|
-
t = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${e.alg.slice(-3)}` },
|
|
581
|
+
t = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${e.alg.slice(-3)}` }, n = e.d ? ["sign"] : ["verify"];
|
|
581
582
|
break;
|
|
582
583
|
case "RSA-OAEP":
|
|
583
584
|
case "RSA-OAEP-256":
|
|
@@ -586,1067 +587,995 @@ function nr(e) {
|
|
|
586
587
|
t = {
|
|
587
588
|
name: "RSA-OAEP",
|
|
588
589
|
hash: `SHA-${parseInt(e.alg.slice(-3), 10) || 1}`
|
|
589
|
-
},
|
|
590
|
+
}, n = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
|
|
590
591
|
break;
|
|
591
592
|
default:
|
|
592
|
-
throw new
|
|
593
|
+
throw new N('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
593
594
|
}
|
|
594
595
|
break;
|
|
595
596
|
}
|
|
596
597
|
case "EC": {
|
|
597
598
|
switch (e.alg) {
|
|
598
599
|
case "ES256":
|
|
599
|
-
t = { name: "ECDSA", namedCurve: "P-256" },
|
|
600
|
+
t = { name: "ECDSA", namedCurve: "P-256" }, n = e.d ? ["sign"] : ["verify"];
|
|
600
601
|
break;
|
|
601
602
|
case "ES384":
|
|
602
|
-
t = { name: "ECDSA", namedCurve: "P-384" },
|
|
603
|
+
t = { name: "ECDSA", namedCurve: "P-384" }, n = e.d ? ["sign"] : ["verify"];
|
|
603
604
|
break;
|
|
604
605
|
case "ES512":
|
|
605
|
-
t = { name: "ECDSA", namedCurve: "P-521" },
|
|
606
|
+
t = { name: "ECDSA", namedCurve: "P-521" }, n = e.d ? ["sign"] : ["verify"];
|
|
606
607
|
break;
|
|
607
608
|
case "ECDH-ES":
|
|
608
609
|
case "ECDH-ES+A128KW":
|
|
609
610
|
case "ECDH-ES+A192KW":
|
|
610
611
|
case "ECDH-ES+A256KW":
|
|
611
|
-
t = { name: "ECDH", namedCurve: e.crv },
|
|
612
|
+
t = { name: "ECDH", namedCurve: e.crv }, n = e.d ? ["deriveBits"] : [];
|
|
612
613
|
break;
|
|
613
614
|
default:
|
|
614
|
-
throw new
|
|
615
|
+
throw new N('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
615
616
|
}
|
|
616
617
|
break;
|
|
617
618
|
}
|
|
618
619
|
case "OKP": {
|
|
619
620
|
switch (e.alg) {
|
|
620
621
|
case "EdDSA":
|
|
621
|
-
t = { name: e.crv },
|
|
622
|
+
t = { name: e.crv }, n = e.d ? ["sign"] : ["verify"];
|
|
622
623
|
break;
|
|
623
624
|
case "ECDH-ES":
|
|
624
625
|
case "ECDH-ES+A128KW":
|
|
625
626
|
case "ECDH-ES+A192KW":
|
|
626
627
|
case "ECDH-ES+A256KW":
|
|
627
|
-
t = { name: e.crv },
|
|
628
|
+
t = { name: e.crv }, n = e.d ? ["deriveBits"] : [];
|
|
628
629
|
break;
|
|
629
630
|
default:
|
|
630
|
-
throw new
|
|
631
|
+
throw new N('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
631
632
|
}
|
|
632
633
|
break;
|
|
633
634
|
}
|
|
634
635
|
default:
|
|
635
|
-
throw new
|
|
636
|
+
throw new N('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
|
|
636
637
|
}
|
|
637
|
-
return { algorithm: t, keyUsages:
|
|
638
|
+
return { algorithm: t, keyUsages: n };
|
|
638
639
|
}
|
|
639
|
-
const
|
|
640
|
+
const Xt = async (e) => {
|
|
640
641
|
if (!e.alg)
|
|
641
642
|
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
642
|
-
const { algorithm: t, keyUsages:
|
|
643
|
+
const { algorithm: t, keyUsages: n } = Qt(e), r = [
|
|
643
644
|
t,
|
|
644
645
|
e.ext ?? !1,
|
|
645
|
-
e.key_ops ??
|
|
646
|
+
e.key_ops ?? n
|
|
646
647
|
], a = { ...e };
|
|
647
|
-
return delete a.alg, delete a.use,
|
|
648
|
-
},
|
|
649
|
-
let
|
|
650
|
-
const
|
|
648
|
+
return delete a.alg, delete a.use, he.subtle.importKey("jwk", a, ...r);
|
|
649
|
+
}, Ze = (e) => Y(e);
|
|
650
|
+
let ge, me;
|
|
651
|
+
const et = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", tt = async (e, t, n, r) => {
|
|
651
652
|
let a = e.get(t);
|
|
652
|
-
if (a != null && a[
|
|
653
|
-
return a[
|
|
654
|
-
const
|
|
655
|
-
return a ? a[
|
|
656
|
-
},
|
|
657
|
-
if (
|
|
658
|
-
let
|
|
659
|
-
return delete
|
|
653
|
+
if (a != null && a[r])
|
|
654
|
+
return a[r];
|
|
655
|
+
const s = await Xt({ ...n, alg: r });
|
|
656
|
+
return a ? a[r] = s : e.set(t, { [r]: s }), s;
|
|
657
|
+
}, Zt = (e, t) => {
|
|
658
|
+
if (et(e)) {
|
|
659
|
+
let n = e.export({ format: "jwk" });
|
|
660
|
+
return delete n.d, delete n.dp, delete n.dq, delete n.p, delete n.q, delete n.qi, n.k ? Ze(n.k) : (me || (me = /* @__PURE__ */ new WeakMap()), tt(me, e, n, t));
|
|
660
661
|
}
|
|
661
662
|
return e;
|
|
662
|
-
},
|
|
663
|
-
if (
|
|
664
|
-
let
|
|
665
|
-
return
|
|
663
|
+
}, en = (e, t) => {
|
|
664
|
+
if (et(e)) {
|
|
665
|
+
let n = e.export({ format: "jwk" });
|
|
666
|
+
return n.k ? Ze(n.k) : (ge || (ge = /* @__PURE__ */ new WeakMap()), tt(ge, e, n, t));
|
|
666
667
|
}
|
|
667
668
|
return e;
|
|
668
|
-
},
|
|
669
|
-
|
|
670
|
-
const
|
|
671
|
-
if (
|
|
669
|
+
}, tn = { normalizePublicKey: Zt, normalizePrivateKey: en }, O = (e, t, n = 0) => {
|
|
670
|
+
n === 0 && (t.unshift(t.length), t.unshift(6));
|
|
671
|
+
const r = e.indexOf(t[0], n);
|
|
672
|
+
if (r === -1)
|
|
672
673
|
return !1;
|
|
673
|
-
const a = e.subarray(
|
|
674
|
-
return a.length !== t.length ? !1 : a.every((
|
|
675
|
-
},
|
|
674
|
+
const a = e.subarray(r, r + t.length);
|
|
675
|
+
return a.length !== t.length ? !1 : a.every((s, o) => s === t[o]) || O(e, t, r + 1);
|
|
676
|
+
}, Ne = (e) => {
|
|
676
677
|
switch (!0) {
|
|
677
|
-
case
|
|
678
|
+
case O(e, [42, 134, 72, 206, 61, 3, 1, 7]):
|
|
678
679
|
return "P-256";
|
|
679
|
-
case
|
|
680
|
+
case O(e, [43, 129, 4, 0, 34]):
|
|
680
681
|
return "P-384";
|
|
681
|
-
case
|
|
682
|
+
case O(e, [43, 129, 4, 0, 35]):
|
|
682
683
|
return "P-521";
|
|
683
|
-
case
|
|
684
|
+
case O(e, [43, 101, 110]):
|
|
684
685
|
return "X25519";
|
|
685
|
-
case
|
|
686
|
+
case O(e, [43, 101, 111]):
|
|
686
687
|
return "X448";
|
|
687
|
-
case
|
|
688
|
+
case O(e, [43, 101, 112]):
|
|
688
689
|
return "Ed25519";
|
|
689
|
-
case
|
|
690
|
+
case O(e, [43, 101, 113]):
|
|
690
691
|
return "Ed448";
|
|
691
692
|
default:
|
|
692
|
-
throw new
|
|
693
|
+
throw new N("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
|
|
693
694
|
}
|
|
694
|
-
},
|
|
695
|
-
let
|
|
696
|
-
const
|
|
697
|
-
switch (
|
|
695
|
+
}, nn = async (e, t, n, r, a) => {
|
|
696
|
+
let s, o;
|
|
697
|
+
const i = new Uint8Array(atob(n.replace(e, "")).split("").map((u) => u.charCodeAt(0)));
|
|
698
|
+
switch (r) {
|
|
698
699
|
case "PS256":
|
|
699
700
|
case "PS384":
|
|
700
701
|
case "PS512":
|
|
701
|
-
|
|
702
|
+
s = { name: "RSA-PSS", hash: `SHA-${r.slice(-3)}` }, o = ["verify"];
|
|
702
703
|
break;
|
|
703
704
|
case "RS256":
|
|
704
705
|
case "RS384":
|
|
705
706
|
case "RS512":
|
|
706
|
-
|
|
707
|
+
s = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${r.slice(-3)}` }, o = ["verify"];
|
|
707
708
|
break;
|
|
708
709
|
case "RSA-OAEP":
|
|
709
710
|
case "RSA-OAEP-256":
|
|
710
711
|
case "RSA-OAEP-384":
|
|
711
712
|
case "RSA-OAEP-512":
|
|
712
|
-
|
|
713
|
+
s = {
|
|
713
714
|
name: "RSA-OAEP",
|
|
714
|
-
hash: `SHA-${parseInt(
|
|
715
|
+
hash: `SHA-${parseInt(r.slice(-3), 10) || 1}`
|
|
715
716
|
}, o = ["encrypt", "wrapKey"];
|
|
716
717
|
break;
|
|
717
718
|
case "ES256":
|
|
718
|
-
|
|
719
|
+
s = { name: "ECDSA", namedCurve: "P-256" }, o = ["verify"];
|
|
719
720
|
break;
|
|
720
721
|
case "ES384":
|
|
721
|
-
|
|
722
|
+
s = { name: "ECDSA", namedCurve: "P-384" }, o = ["verify"];
|
|
722
723
|
break;
|
|
723
724
|
case "ES512":
|
|
724
|
-
|
|
725
|
+
s = { name: "ECDSA", namedCurve: "P-521" }, o = ["verify"];
|
|
725
726
|
break;
|
|
726
727
|
case "ECDH-ES":
|
|
727
728
|
case "ECDH-ES+A128KW":
|
|
728
729
|
case "ECDH-ES+A192KW":
|
|
729
730
|
case "ECDH-ES+A256KW": {
|
|
730
|
-
const u =
|
|
731
|
-
|
|
731
|
+
const u = Ne(i);
|
|
732
|
+
s = u.startsWith("P-") ? { name: "ECDH", namedCurve: u } : { name: u }, o = [];
|
|
732
733
|
break;
|
|
733
734
|
}
|
|
734
735
|
case "EdDSA":
|
|
735
|
-
|
|
736
|
+
s = { name: Ne(i) }, o = ["verify"];
|
|
736
737
|
break;
|
|
737
738
|
default:
|
|
738
|
-
throw new
|
|
739
|
+
throw new N('Invalid or unsupported "alg" (Algorithm) value');
|
|
739
740
|
}
|
|
740
|
-
return
|
|
741
|
-
},
|
|
742
|
-
async function
|
|
741
|
+
return he.subtle.importKey(t, i, s, !1, o);
|
|
742
|
+
}, rn = (e, t, n) => nn(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
|
|
743
|
+
async function an(e, t, n) {
|
|
743
744
|
if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
|
|
744
745
|
throw new TypeError('"spki" must be SPKI formatted string');
|
|
745
|
-
return
|
|
746
|
+
return rn(e, t);
|
|
746
747
|
}
|
|
747
|
-
const
|
|
748
|
+
const se = (e) => e == null ? void 0 : e[Symbol.toStringTag], on = (e, t) => {
|
|
748
749
|
if (!(t instanceof Uint8Array)) {
|
|
749
|
-
if (!
|
|
750
|
-
throw new TypeError(
|
|
750
|
+
if (!Xe(t))
|
|
751
|
+
throw new TypeError(Qe(e, t, ...ce, "Uint8Array"));
|
|
751
752
|
if (t.type !== "secret")
|
|
752
|
-
throw new TypeError(`${
|
|
753
|
+
throw new TypeError(`${se(t)} instances for symmetric algorithms must be of type "secret"`);
|
|
753
754
|
}
|
|
754
|
-
},
|
|
755
|
-
if (!
|
|
756
|
-
throw new TypeError(
|
|
755
|
+
}, sn = (e, t, n) => {
|
|
756
|
+
if (!Xe(t))
|
|
757
|
+
throw new TypeError(Qe(e, t, ...ce));
|
|
757
758
|
if (t.type === "secret")
|
|
758
|
-
throw new TypeError(`${
|
|
759
|
-
if (t.algorithm &&
|
|
760
|
-
throw new TypeError(`${
|
|
761
|
-
if (t.algorithm &&
|
|
762
|
-
throw new TypeError(`${
|
|
763
|
-
},
|
|
764
|
-
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ?
|
|
759
|
+
throw new TypeError(`${se(t)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
760
|
+
if (t.algorithm && n === "verify" && t.type === "private")
|
|
761
|
+
throw new TypeError(`${se(t)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
762
|
+
if (t.algorithm && n === "encrypt" && t.type === "private")
|
|
763
|
+
throw new TypeError(`${se(t)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
764
|
+
}, cn = (e, t, n) => {
|
|
765
|
+
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? on(e, t) : sn(e, t, n);
|
|
765
766
|
};
|
|
766
|
-
function
|
|
767
|
-
if (a.crit !== void 0 && (
|
|
767
|
+
function un(e, t, n, r, a) {
|
|
768
|
+
if (a.crit !== void 0 && (r == null ? void 0 : r.crit) === void 0)
|
|
768
769
|
throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
769
|
-
if (!
|
|
770
|
+
if (!r || r.crit === void 0)
|
|
770
771
|
return /* @__PURE__ */ new Set();
|
|
771
|
-
if (!Array.isArray(
|
|
772
|
+
if (!Array.isArray(r.crit) || r.crit.length === 0 || r.crit.some((o) => typeof o != "string" || o.length === 0))
|
|
772
773
|
throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
|
|
773
|
-
let
|
|
774
|
-
|
|
775
|
-
for (const o of
|
|
776
|
-
if (!
|
|
777
|
-
throw new
|
|
774
|
+
let s;
|
|
775
|
+
n !== void 0 ? s = new Map([...Object.entries(n), ...t.entries()]) : s = t;
|
|
776
|
+
for (const o of r.crit) {
|
|
777
|
+
if (!s.has(o))
|
|
778
|
+
throw new N(`Extension Header Parameter "${o}" is not recognized`);
|
|
778
779
|
if (a[o] === void 0)
|
|
779
780
|
throw new e(`Extension Header Parameter "${o}" is missing`);
|
|
780
|
-
if (
|
|
781
|
+
if (s.get(o) && r[o] === void 0)
|
|
781
782
|
throw new e(`Extension Header Parameter "${o}" MUST be integrity protected`);
|
|
782
783
|
}
|
|
783
|
-
return new Set(
|
|
784
|
+
return new Set(r.crit);
|
|
784
785
|
}
|
|
785
|
-
const
|
|
786
|
-
if (t !== void 0 && (!Array.isArray(t) || t.some((
|
|
786
|
+
const ln = (e, t) => {
|
|
787
|
+
if (t !== void 0 && (!Array.isArray(t) || t.some((n) => typeof n != "string")))
|
|
787
788
|
throw new TypeError(`"${e}" option must be an array of strings`);
|
|
788
789
|
if (t)
|
|
789
790
|
return new Set(t);
|
|
790
791
|
};
|
|
791
|
-
function
|
|
792
|
-
const
|
|
792
|
+
function dn(e, t) {
|
|
793
|
+
const n = `SHA-${e.slice(-3)}`;
|
|
793
794
|
switch (e) {
|
|
794
795
|
case "HS256":
|
|
795
796
|
case "HS384":
|
|
796
797
|
case "HS512":
|
|
797
|
-
return { hash:
|
|
798
|
+
return { hash: n, name: "HMAC" };
|
|
798
799
|
case "PS256":
|
|
799
800
|
case "PS384":
|
|
800
801
|
case "PS512":
|
|
801
|
-
return { hash:
|
|
802
|
+
return { hash: n, name: "RSA-PSS", saltLength: e.slice(-3) >> 3 };
|
|
802
803
|
case "RS256":
|
|
803
804
|
case "RS384":
|
|
804
805
|
case "RS512":
|
|
805
|
-
return { hash:
|
|
806
|
+
return { hash: n, name: "RSASSA-PKCS1-v1_5" };
|
|
806
807
|
case "ES256":
|
|
807
808
|
case "ES384":
|
|
808
809
|
case "ES512":
|
|
809
|
-
return { hash:
|
|
810
|
+
return { hash: n, name: "ECDSA", namedCurve: t.namedCurve };
|
|
810
811
|
case "EdDSA":
|
|
811
812
|
return { name: t.name };
|
|
812
813
|
default:
|
|
813
|
-
throw new
|
|
814
|
+
throw new N(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
|
814
815
|
}
|
|
815
816
|
}
|
|
816
|
-
async function
|
|
817
|
-
if (t = await
|
|
818
|
-
return
|
|
817
|
+
async function hn(e, t, n) {
|
|
818
|
+
if (t = await tn.normalizePublicKey(t, e), qe(t))
|
|
819
|
+
return Ft(t, e, n), t;
|
|
819
820
|
if (t instanceof Uint8Array) {
|
|
820
821
|
if (!e.startsWith("HS"))
|
|
821
|
-
throw new TypeError(
|
|
822
|
-
return
|
|
822
|
+
throw new TypeError(Oe(t, ...ce));
|
|
823
|
+
return he.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [n]);
|
|
823
824
|
}
|
|
824
|
-
throw new TypeError(
|
|
825
|
+
throw new TypeError(Oe(t, ...ce, "Uint8Array"));
|
|
825
826
|
}
|
|
826
|
-
const
|
|
827
|
-
const a = await
|
|
828
|
-
|
|
829
|
-
const
|
|
827
|
+
const pn = async (e, t, n, r) => {
|
|
828
|
+
const a = await hn(e, t, "verify");
|
|
829
|
+
zt(e, a);
|
|
830
|
+
const s = dn(e, a.algorithm);
|
|
830
831
|
try {
|
|
831
|
-
return await
|
|
832
|
+
return await he.subtle.verify(s, a, n, r);
|
|
832
833
|
} catch {
|
|
833
834
|
return !1;
|
|
834
835
|
}
|
|
835
836
|
};
|
|
836
|
-
async function
|
|
837
|
-
if (!
|
|
838
|
-
throw new
|
|
837
|
+
async function fn(e, t, n) {
|
|
838
|
+
if (!ue(e))
|
|
839
|
+
throw new R("Flattened JWS must be an object");
|
|
839
840
|
if (e.protected === void 0 && e.header === void 0)
|
|
840
|
-
throw new
|
|
841
|
+
throw new R('Flattened JWS must have either of the "protected" or "header" members');
|
|
841
842
|
if (e.protected !== void 0 && typeof e.protected != "string")
|
|
842
|
-
throw new
|
|
843
|
+
throw new R("JWS Protected Header incorrect type");
|
|
843
844
|
if (e.payload === void 0)
|
|
844
|
-
throw new
|
|
845
|
+
throw new R("JWS Payload missing");
|
|
845
846
|
if (typeof e.signature != "string")
|
|
846
|
-
throw new
|
|
847
|
-
if (e.header !== void 0 && !
|
|
848
|
-
throw new
|
|
849
|
-
let
|
|
847
|
+
throw new R("JWS Signature missing or incorrect type");
|
|
848
|
+
if (e.header !== void 0 && !ue(e.header))
|
|
849
|
+
throw new R("JWS Unprotected Header incorrect type");
|
|
850
|
+
let r = {};
|
|
850
851
|
if (e.protected)
|
|
851
852
|
try {
|
|
852
|
-
const
|
|
853
|
-
|
|
853
|
+
const d = Y(e.protected);
|
|
854
|
+
r = JSON.parse(B.decode(d));
|
|
854
855
|
} catch {
|
|
855
|
-
throw new
|
|
856
|
+
throw new R("JWS Protected Header is invalid");
|
|
856
857
|
}
|
|
857
|
-
if (!
|
|
858
|
-
throw new
|
|
858
|
+
if (!Bt(r, e.header))
|
|
859
|
+
throw new R("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
859
860
|
const a = {
|
|
860
|
-
...
|
|
861
|
+
...r,
|
|
861
862
|
...e.header
|
|
862
|
-
},
|
|
863
|
+
}, s = un(R, /* @__PURE__ */ new Map([["b64", !0]]), n == null ? void 0 : n.crit, r, a);
|
|
863
864
|
let o = !0;
|
|
864
|
-
if (
|
|
865
|
-
throw new
|
|
866
|
-
const { alg:
|
|
867
|
-
if (typeof
|
|
868
|
-
throw new
|
|
869
|
-
const u =
|
|
870
|
-
if (u && !u.has(
|
|
871
|
-
throw new
|
|
865
|
+
if (s.has("b64") && (o = r.b64, typeof o != "boolean"))
|
|
866
|
+
throw new R('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
867
|
+
const { alg: i } = a;
|
|
868
|
+
if (typeof i != "string" || !i)
|
|
869
|
+
throw new R('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
870
|
+
const u = n && ln("algorithms", n.algorithms);
|
|
871
|
+
if (u && !u.has(i))
|
|
872
|
+
throw new Jt('"alg" (Algorithm) Header Parameter value not allowed');
|
|
872
873
|
if (o) {
|
|
873
874
|
if (typeof e.payload != "string")
|
|
874
|
-
throw new
|
|
875
|
+
throw new R("JWS Payload must be a string");
|
|
875
876
|
} else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
|
|
876
|
-
throw new
|
|
877
|
-
let
|
|
878
|
-
typeof t == "function" && (t = await t(
|
|
879
|
-
const
|
|
880
|
-
let
|
|
877
|
+
throw new R("JWS Payload must be a string or an Uint8Array instance");
|
|
878
|
+
let f = !1;
|
|
879
|
+
typeof t == "function" && (t = await t(r, e), f = !0), cn(i, t, "verify");
|
|
880
|
+
const y = Mt(Q.encode(e.protected ?? ""), Q.encode("."), typeof e.payload == "string" ? Q.encode(e.payload) : e.payload);
|
|
881
|
+
let h;
|
|
881
882
|
try {
|
|
882
|
-
|
|
883
|
+
h = Y(e.signature);
|
|
883
884
|
} catch {
|
|
884
|
-
throw new
|
|
885
|
+
throw new R("Failed to base64url decode the signature");
|
|
885
886
|
}
|
|
886
|
-
if (!await
|
|
887
|
-
throw new
|
|
888
|
-
let
|
|
887
|
+
if (!await pn(i, t, h, y))
|
|
888
|
+
throw new Vt();
|
|
889
|
+
let p;
|
|
889
890
|
if (o)
|
|
890
891
|
try {
|
|
891
|
-
|
|
892
|
+
p = Y(e.payload);
|
|
892
893
|
} catch {
|
|
893
|
-
throw new
|
|
894
|
+
throw new R("Failed to base64url decode the payload");
|
|
894
895
|
}
|
|
895
|
-
else typeof e.payload == "string" ?
|
|
896
|
-
const
|
|
897
|
-
return e.protected !== void 0 && (
|
|
898
|
-
}
|
|
899
|
-
async function
|
|
900
|
-
if (e instanceof Uint8Array && (e =
|
|
901
|
-
throw new
|
|
902
|
-
const { 0:
|
|
896
|
+
else typeof e.payload == "string" ? p = Q.encode(e.payload) : p = e.payload;
|
|
897
|
+
const l = { payload: p };
|
|
898
|
+
return e.protected !== void 0 && (l.protectedHeader = r), e.header !== void 0 && (l.unprotectedHeader = e.header), f ? { ...l, key: t } : l;
|
|
899
|
+
}
|
|
900
|
+
async function yn(e, t, n) {
|
|
901
|
+
if (e instanceof Uint8Array && (e = B.decode(e)), typeof e != "string")
|
|
902
|
+
throw new R("Compact JWS must be a string or Uint8Array");
|
|
903
|
+
const { 0: r, 1: a, 2: s, length: o } = e.split(".");
|
|
903
904
|
if (o !== 3)
|
|
904
|
-
throw new
|
|
905
|
-
const
|
|
906
|
-
return typeof t == "function" ? { ...u, key:
|
|
905
|
+
throw new R("Invalid Compact JWS");
|
|
906
|
+
const i = await fn({ payload: a, protected: r, signature: s }, t, n), u = { payload: i.payload, protectedHeader: i.protectedHeader };
|
|
907
|
+
return typeof t == "function" ? { ...u, key: i.key } : u;
|
|
907
908
|
}
|
|
908
|
-
const
|
|
909
|
-
const t =
|
|
909
|
+
const gn = (e) => Math.floor(e.getTime() / 1e3), nt = 60, rt = nt * 60, be = rt * 24, mn = be * 7, wn = be * 365.25, En = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, De = (e) => {
|
|
910
|
+
const t = En.exec(e);
|
|
910
911
|
if (!t || t[4] && t[1])
|
|
911
912
|
throw new TypeError("Invalid time period format");
|
|
912
|
-
const
|
|
913
|
+
const n = parseFloat(t[2]), r = t[3].toLowerCase();
|
|
913
914
|
let a;
|
|
914
|
-
switch (
|
|
915
|
+
switch (r) {
|
|
915
916
|
case "sec":
|
|
916
917
|
case "secs":
|
|
917
918
|
case "second":
|
|
918
919
|
case "seconds":
|
|
919
920
|
case "s":
|
|
920
|
-
a = Math.round(
|
|
921
|
+
a = Math.round(n);
|
|
921
922
|
break;
|
|
922
923
|
case "minute":
|
|
923
924
|
case "minutes":
|
|
924
925
|
case "min":
|
|
925
926
|
case "mins":
|
|
926
927
|
case "m":
|
|
927
|
-
a = Math.round(
|
|
928
|
+
a = Math.round(n * nt);
|
|
928
929
|
break;
|
|
929
930
|
case "hour":
|
|
930
931
|
case "hours":
|
|
931
932
|
case "hr":
|
|
932
933
|
case "hrs":
|
|
933
934
|
case "h":
|
|
934
|
-
a = Math.round(
|
|
935
|
+
a = Math.round(n * rt);
|
|
935
936
|
break;
|
|
936
937
|
case "day":
|
|
937
938
|
case "days":
|
|
938
939
|
case "d":
|
|
939
|
-
a = Math.round(
|
|
940
|
+
a = Math.round(n * be);
|
|
940
941
|
break;
|
|
941
942
|
case "week":
|
|
942
943
|
case "weeks":
|
|
943
944
|
case "w":
|
|
944
|
-
a = Math.round(
|
|
945
|
+
a = Math.round(n * mn);
|
|
945
946
|
break;
|
|
946
947
|
default:
|
|
947
|
-
a = Math.round(
|
|
948
|
+
a = Math.round(n * wn);
|
|
948
949
|
break;
|
|
949
950
|
}
|
|
950
951
|
return t[1] === "-" || t[4] === "ago" ? -a : a;
|
|
951
|
-
},
|
|
952
|
-
let
|
|
952
|
+
}, Ue = (e) => e.toLowerCase().replace(/^application\//, ""), Sn = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, An = (e, t, n = {}) => {
|
|
953
|
+
let r;
|
|
953
954
|
try {
|
|
954
|
-
|
|
955
|
+
r = JSON.parse(B.decode(t));
|
|
955
956
|
} catch {
|
|
956
957
|
}
|
|
957
|
-
if (!
|
|
958
|
-
throw new
|
|
959
|
-
const { typ: a } =
|
|
960
|
-
if (a && (typeof e.typ != "string" ||
|
|
961
|
-
throw new
|
|
962
|
-
const { requiredClaims:
|
|
963
|
-
|
|
964
|
-
for (const
|
|
965
|
-
if (!(
|
|
966
|
-
throw new
|
|
967
|
-
if (o && !(Array.isArray(o) ? o : [o]).includes(
|
|
968
|
-
throw new
|
|
969
|
-
if (
|
|
970
|
-
throw new
|
|
971
|
-
if (u && !
|
|
972
|
-
throw new
|
|
973
|
-
let
|
|
974
|
-
switch (typeof
|
|
958
|
+
if (!ue(r))
|
|
959
|
+
throw new C("JWT Claims Set must be a top-level JSON object");
|
|
960
|
+
const { typ: a } = n;
|
|
961
|
+
if (a && (typeof e.typ != "string" || Ue(e.typ) !== Ue(a)))
|
|
962
|
+
throw new v('unexpected "typ" JWT header value', r, "typ", "check_failed");
|
|
963
|
+
const { requiredClaims: s = [], issuer: o, subject: i, audience: u, maxTokenAge: f } = n, y = [...s];
|
|
964
|
+
f !== void 0 && y.push("iat"), u !== void 0 && y.push("aud"), i !== void 0 && y.push("sub"), o !== void 0 && y.push("iss");
|
|
965
|
+
for (const d of new Set(y.reverse()))
|
|
966
|
+
if (!(d in r))
|
|
967
|
+
throw new v(`missing required "${d}" claim`, r, d, "missing");
|
|
968
|
+
if (o && !(Array.isArray(o) ? o : [o]).includes(r.iss))
|
|
969
|
+
throw new v('unexpected "iss" claim value', r, "iss", "check_failed");
|
|
970
|
+
if (i && r.sub !== i)
|
|
971
|
+
throw new v('unexpected "sub" claim value', r, "sub", "check_failed");
|
|
972
|
+
if (u && !Sn(r.aud, typeof u == "string" ? [u] : u))
|
|
973
|
+
throw new v('unexpected "aud" claim value', r, "aud", "check_failed");
|
|
974
|
+
let h;
|
|
975
|
+
switch (typeof n.clockTolerance) {
|
|
975
976
|
case "string":
|
|
976
|
-
|
|
977
|
+
h = De(n.clockTolerance);
|
|
977
978
|
break;
|
|
978
979
|
case "number":
|
|
979
|
-
|
|
980
|
+
h = n.clockTolerance;
|
|
980
981
|
break;
|
|
981
982
|
case "undefined":
|
|
982
|
-
|
|
983
|
+
h = 0;
|
|
983
984
|
break;
|
|
984
985
|
default:
|
|
985
986
|
throw new TypeError("Invalid clockTolerance option type");
|
|
986
987
|
}
|
|
987
|
-
const { currentDate:
|
|
988
|
-
if ((
|
|
989
|
-
throw new
|
|
990
|
-
if (
|
|
991
|
-
if (typeof
|
|
992
|
-
throw new
|
|
993
|
-
if (
|
|
994
|
-
throw new
|
|
995
|
-
}
|
|
996
|
-
if (
|
|
997
|
-
if (typeof
|
|
998
|
-
throw new
|
|
999
|
-
if (
|
|
1000
|
-
throw new
|
|
1001
|
-
}
|
|
1002
|
-
if (
|
|
1003
|
-
const
|
|
1004
|
-
if (
|
|
1005
|
-
throw new
|
|
1006
|
-
if (
|
|
1007
|
-
throw new
|
|
988
|
+
const { currentDate: p } = n, l = gn(p || /* @__PURE__ */ new Date());
|
|
989
|
+
if ((r.iat !== void 0 || f) && typeof r.iat != "number")
|
|
990
|
+
throw new v('"iat" claim must be a number', r, "iat", "invalid");
|
|
991
|
+
if (r.nbf !== void 0) {
|
|
992
|
+
if (typeof r.nbf != "number")
|
|
993
|
+
throw new v('"nbf" claim must be a number', r, "nbf", "invalid");
|
|
994
|
+
if (r.nbf > l + h)
|
|
995
|
+
throw new v('"nbf" claim timestamp check failed', r, "nbf", "check_failed");
|
|
996
|
+
}
|
|
997
|
+
if (r.exp !== void 0) {
|
|
998
|
+
if (typeof r.exp != "number")
|
|
999
|
+
throw new v('"exp" claim must be a number', r, "exp", "invalid");
|
|
1000
|
+
if (r.exp <= l - h)
|
|
1001
|
+
throw new Ce('"exp" claim timestamp check failed', r, "exp", "check_failed");
|
|
1002
|
+
}
|
|
1003
|
+
if (f) {
|
|
1004
|
+
const d = l - r.iat, m = typeof f == "number" ? f : De(f);
|
|
1005
|
+
if (d - h > m)
|
|
1006
|
+
throw new Ce('"iat" claim timestamp check failed (too far in the past)', r, "iat", "check_failed");
|
|
1007
|
+
if (d < 0 - h)
|
|
1008
|
+
throw new v('"iat" claim timestamp check failed (it should be in the past)', r, "iat", "check_failed");
|
|
1008
1009
|
}
|
|
1009
|
-
return
|
|
1010
|
+
return r;
|
|
1010
1011
|
};
|
|
1011
|
-
async function
|
|
1012
|
-
var
|
|
1013
|
-
const a = await
|
|
1014
|
-
if ((
|
|
1015
|
-
throw new
|
|
1016
|
-
const
|
|
1017
|
-
return typeof t == "function" ? { ...
|
|
1012
|
+
async function Tn(e, t, n) {
|
|
1013
|
+
var r;
|
|
1014
|
+
const a = await yn(e, t, n);
|
|
1015
|
+
if ((r = a.protectedHeader.crit) != null && r.includes("b64") && a.protectedHeader.b64 === !1)
|
|
1016
|
+
throw new C("JWTs MUST NOT use unencoded payload");
|
|
1017
|
+
const s = { payload: An(a.protectedHeader, a.payload, n), protectedHeader: a.protectedHeader };
|
|
1018
|
+
return typeof t == "function" ? { ...s, key: a.key } : s;
|
|
1019
|
+
}
|
|
1020
|
+
const Rn = Y;
|
|
1021
|
+
function bn(e) {
|
|
1022
|
+
if (typeof e != "string")
|
|
1023
|
+
throw new C("JWTs must use Compact JWS serialization, JWT must be a string");
|
|
1024
|
+
const { 1: t, length: n } = e.split(".");
|
|
1025
|
+
if (n === 5)
|
|
1026
|
+
throw new C("Only JWTs using Compact JWS serialization can be decoded");
|
|
1027
|
+
if (n !== 3)
|
|
1028
|
+
throw new C("Invalid JWT");
|
|
1029
|
+
if (!t)
|
|
1030
|
+
throw new C("JWTs must contain a payload");
|
|
1031
|
+
let r;
|
|
1032
|
+
try {
|
|
1033
|
+
r = Rn(t);
|
|
1034
|
+
} catch {
|
|
1035
|
+
throw new C("Failed to base64url decode the payload");
|
|
1036
|
+
}
|
|
1037
|
+
let a;
|
|
1038
|
+
try {
|
|
1039
|
+
a = JSON.parse(B.decode(r));
|
|
1040
|
+
} catch {
|
|
1041
|
+
throw new C("Failed to parse the decoded payload as JSON");
|
|
1042
|
+
}
|
|
1043
|
+
if (!ue(a))
|
|
1044
|
+
throw new C("Invalid JWT Claims Set");
|
|
1045
|
+
return a;
|
|
1018
1046
|
}
|
|
1019
|
-
const
|
|
1047
|
+
const F = async (e) => {
|
|
1020
1048
|
try {
|
|
1021
|
-
const t =
|
|
1022
|
-
return await
|
|
1023
|
-
issuer:
|
|
1049
|
+
const t = I.ALG, n = await an(xt, t);
|
|
1050
|
+
return await Tn(e, n, {
|
|
1051
|
+
issuer: I.ISSUER
|
|
1024
1052
|
});
|
|
1025
1053
|
} catch {
|
|
1026
1054
|
return;
|
|
1027
1055
|
}
|
|
1056
|
+
}, In = (e) => {
|
|
1057
|
+
try {
|
|
1058
|
+
return bn(e);
|
|
1059
|
+
} catch {
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1028
1062
|
};
|
|
1029
|
-
var
|
|
1030
|
-
for (var
|
|
1031
|
-
|
|
1032
|
-
function
|
|
1033
|
-
return (
|
|
1034
|
-
}
|
|
1035
|
-
var
|
|
1036
|
-
function
|
|
1037
|
-
if (!
|
|
1063
|
+
var A = [];
|
|
1064
|
+
for (var we = 0; we < 256; ++we)
|
|
1065
|
+
A.push((we + 256).toString(16).slice(1));
|
|
1066
|
+
function _n(e, t = 0) {
|
|
1067
|
+
return (A[e[t + 0]] + A[e[t + 1]] + A[e[t + 2]] + A[e[t + 3]] + "-" + A[e[t + 4]] + A[e[t + 5]] + "-" + A[e[t + 6]] + A[e[t + 7]] + "-" + A[e[t + 8]] + A[e[t + 9]] + "-" + A[e[t + 10]] + A[e[t + 11]] + A[e[t + 12]] + A[e[t + 13]] + A[e[t + 14]] + A[e[t + 15]]).toLowerCase();
|
|
1068
|
+
}
|
|
1069
|
+
var Z, vn = new Uint8Array(16);
|
|
1070
|
+
function kn() {
|
|
1071
|
+
if (!Z && (Z = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Z))
|
|
1038
1072
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1039
|
-
return
|
|
1073
|
+
return Z(vn);
|
|
1040
1074
|
}
|
|
1041
|
-
var
|
|
1042
|
-
const
|
|
1043
|
-
randomUUID:
|
|
1075
|
+
var Pn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1076
|
+
const $e = {
|
|
1077
|
+
randomUUID: Pn
|
|
1044
1078
|
};
|
|
1045
|
-
function
|
|
1046
|
-
if (
|
|
1047
|
-
return
|
|
1079
|
+
function Ke(e, t, n) {
|
|
1080
|
+
if ($e.randomUUID && !t && !e)
|
|
1081
|
+
return $e.randomUUID();
|
|
1048
1082
|
e = e || {};
|
|
1049
|
-
var
|
|
1050
|
-
return
|
|
1083
|
+
var r = e.random || (e.rng || kn)();
|
|
1084
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, _n(r);
|
|
1051
1085
|
}
|
|
1052
|
-
const
|
|
1086
|
+
const He = globalThis.crypto, Cn = (e) => `${Ke()}${Ke()}`.slice(0, e), On = (e) => btoa(
|
|
1053
1087
|
[...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
|
|
1054
1088
|
);
|
|
1055
|
-
async function
|
|
1056
|
-
if (!
|
|
1089
|
+
async function Nn(e) {
|
|
1090
|
+
if (!He.subtle)
|
|
1057
1091
|
throw new Error(
|
|
1058
1092
|
"crypto.subtle is available only in secure contexts (HTTPS)."
|
|
1059
1093
|
);
|
|
1060
|
-
const t = new TextEncoder().encode(e),
|
|
1061
|
-
return
|
|
1094
|
+
const t = new TextEncoder().encode(e), n = await He.subtle.digest("SHA-256", t);
|
|
1095
|
+
return On(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
1062
1096
|
}
|
|
1063
|
-
async function
|
|
1064
|
-
const
|
|
1097
|
+
async function Dn(e) {
|
|
1098
|
+
const n = Cn(43), r = await Nn(n);
|
|
1065
1099
|
return {
|
|
1066
|
-
code_verifier:
|
|
1067
|
-
code_challenge:
|
|
1100
|
+
code_verifier: n,
|
|
1101
|
+
code_challenge: r
|
|
1068
1102
|
};
|
|
1069
1103
|
}
|
|
1070
|
-
function
|
|
1104
|
+
function at(e, t) {
|
|
1071
1105
|
window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
|
|
1072
1106
|
}
|
|
1073
|
-
const
|
|
1074
|
-
const
|
|
1107
|
+
const Le = (e, t) => {
|
|
1108
|
+
const n = JSON.stringify(
|
|
1075
1109
|
typeof t == "function" ? t() : t
|
|
1076
1110
|
);
|
|
1077
|
-
window.localStorage.setItem(e,
|
|
1078
|
-
},
|
|
1079
|
-
window.localStorage.removeItem(e),
|
|
1080
|
-
},
|
|
1081
|
-
function
|
|
1111
|
+
window.localStorage.setItem(e, n), at(e, n);
|
|
1112
|
+
}, Un = (e) => {
|
|
1113
|
+
window.localStorage.removeItem(e), at(e, null);
|
|
1114
|
+
}, We = (e) => window.localStorage.getItem(e), $n = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
|
|
1115
|
+
function ee({
|
|
1082
1116
|
key: e,
|
|
1083
1117
|
initialValue: t
|
|
1084
1118
|
}) {
|
|
1085
|
-
const
|
|
1119
|
+
const n = Pt($n, () => We(e)), r = x(
|
|
1086
1120
|
(o) => {
|
|
1087
1121
|
try {
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1090
|
-
} catch (
|
|
1091
|
-
console.warn(
|
|
1122
|
+
const i = typeof o == "function" ? o(JSON.parse(n)) : o;
|
|
1123
|
+
i == null ? Un(e) : Le(e, i);
|
|
1124
|
+
} catch (i) {
|
|
1125
|
+
console.warn(i);
|
|
1092
1126
|
}
|
|
1093
1127
|
},
|
|
1094
|
-
[e,
|
|
1095
|
-
), a =
|
|
1096
|
-
|
|
1097
|
-
}, [t,
|
|
1098
|
-
|
|
1099
|
-
}, [
|
|
1100
|
-
return
|
|
1128
|
+
[e, n]
|
|
1129
|
+
), a = x(() => {
|
|
1130
|
+
r(t);
|
|
1131
|
+
}, [t, r]), s = x(() => {
|
|
1132
|
+
r(null);
|
|
1133
|
+
}, [r]);
|
|
1134
|
+
return Te(() => {
|
|
1101
1135
|
try {
|
|
1102
|
-
|
|
1136
|
+
We(e) === null && typeof t < "u" && Le(e, t);
|
|
1103
1137
|
} catch (o) {
|
|
1104
1138
|
console.warn(o);
|
|
1105
1139
|
}
|
|
1106
|
-
}, [e, t]), [
|
|
1140
|
+
}, [e, t]), [n ? JSON.parse(n) : null, r, a, s];
|
|
1107
1141
|
}
|
|
1108
|
-
var
|
|
1109
|
-
for (var
|
|
1110
|
-
|
|
1111
|
-
function
|
|
1112
|
-
return (
|
|
1142
|
+
var T = [];
|
|
1143
|
+
for (var Ee = 0; Ee < 256; ++Ee)
|
|
1144
|
+
T.push((Ee + 256).toString(16).slice(1));
|
|
1145
|
+
function Kn(e, t = 0) {
|
|
1146
|
+
return (T[e[t + 0]] + T[e[t + 1]] + T[e[t + 2]] + T[e[t + 3]] + "-" + T[e[t + 4]] + T[e[t + 5]] + "-" + T[e[t + 6]] + T[e[t + 7]] + "-" + T[e[t + 8]] + T[e[t + 9]] + "-" + T[e[t + 10]] + T[e[t + 11]] + T[e[t + 12]] + T[e[t + 13]] + T[e[t + 14]] + T[e[t + 15]]).toLowerCase();
|
|
1113
1147
|
}
|
|
1114
|
-
var
|
|
1115
|
-
function
|
|
1116
|
-
if (!
|
|
1148
|
+
var te, Hn = new Uint8Array(16);
|
|
1149
|
+
function Ln() {
|
|
1150
|
+
if (!te && (te = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !te))
|
|
1117
1151
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1118
|
-
return
|
|
1152
|
+
return te(Hn);
|
|
1119
1153
|
}
|
|
1120
|
-
var
|
|
1121
|
-
const
|
|
1122
|
-
randomUUID:
|
|
1154
|
+
var Wn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1155
|
+
const xe = {
|
|
1156
|
+
randomUUID: Wn
|
|
1123
1157
|
};
|
|
1124
|
-
function
|
|
1125
|
-
if (
|
|
1126
|
-
return
|
|
1158
|
+
function Se(e, t, n) {
|
|
1159
|
+
if (xe.randomUUID && !t && !e)
|
|
1160
|
+
return xe.randomUUID();
|
|
1127
1161
|
e = e || {};
|
|
1128
|
-
var
|
|
1129
|
-
return
|
|
1162
|
+
var r = e.random || (e.rng || Ln)();
|
|
1163
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Kn(r);
|
|
1130
1164
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
try {
|
|
1142
|
-
u(n.throw(h));
|
|
1143
|
-
} catch (c) {
|
|
1144
|
-
i(c);
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
function u(h) {
|
|
1148
|
-
var c;
|
|
1149
|
-
h.done ? a(h.value) : (c = h.value, c instanceof r ? c : new r(function(f) {
|
|
1150
|
-
f(c);
|
|
1151
|
-
})).then(o, s);
|
|
1152
|
-
}
|
|
1153
|
-
u((n = n.apply(e, [])).next());
|
|
1165
|
+
/*!
|
|
1166
|
+
@versini/ui-fingerprint v1.0.1
|
|
1167
|
+
© 2024 gizmette.com
|
|
1168
|
+
*/
|
|
1169
|
+
try {
|
|
1170
|
+
window.__VERSINI_UI_FINGERPRINT__ || (window.__VERSINI_UI_FINGERPRINT__ = {
|
|
1171
|
+
version: "1.0.1",
|
|
1172
|
+
buildTime: "07/18/2024 09:17 AM EDT",
|
|
1173
|
+
homepage: "https://github.com/aversini/ui-components",
|
|
1174
|
+
license: "MIT"
|
|
1154
1175
|
});
|
|
1176
|
+
} catch {
|
|
1155
1177
|
}
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1178
|
+
const xn = (e) => Array.from(e).map((t) => t.toString(16).padStart(2, "0")).join(""), ot = async (e) => {
|
|
1179
|
+
if (e === "")
|
|
1180
|
+
return "";
|
|
1181
|
+
const t = new TextEncoder().encode(e), n = await crypto.subtle.digest("SHA-256", t);
|
|
1182
|
+
return Array.from(new Uint8Array(n)).map((r) => r.toString(16).padStart(2, "0")).join("");
|
|
1183
|
+
};
|
|
1184
|
+
function Me(e, t) {
|
|
1185
|
+
return new Promise((n) => setTimeout(n, e, t));
|
|
1186
|
+
}
|
|
1187
|
+
async function Mn(e, t, n = 50) {
|
|
1188
|
+
var r, a, s;
|
|
1189
|
+
const o = document;
|
|
1190
|
+
for (; !o.body; )
|
|
1191
|
+
await Me(n);
|
|
1192
|
+
const i = o.createElement("iframe");
|
|
1193
|
+
try {
|
|
1194
|
+
for (await new Promise((u, f) => {
|
|
1195
|
+
let y = !1;
|
|
1196
|
+
const h = () => {
|
|
1197
|
+
y = !0, u();
|
|
1198
|
+
}, p = (m) => {
|
|
1199
|
+
y = !0, f(m);
|
|
1200
|
+
};
|
|
1201
|
+
i.onload = h, i.onerror = p;
|
|
1202
|
+
const { style: l } = i;
|
|
1203
|
+
l.setProperty("display", "block", "important"), l.position = "absolute", l.top = "0", l.left = "0", l.visibility = "hidden", i.src = "about:blank", o.body.appendChild(i);
|
|
1204
|
+
const d = () => {
|
|
1205
|
+
var m, S;
|
|
1206
|
+
y || (((S = (m = i.contentWindow) == null ? void 0 : m.document) == null ? void 0 : S.readyState) === "complete" ? h() : setTimeout(d, 10));
|
|
1207
|
+
};
|
|
1208
|
+
d();
|
|
1209
|
+
}); !((a = (r = i.contentWindow) == null ? void 0 : r.document) != null && a.body); )
|
|
1210
|
+
await Me(n);
|
|
1211
|
+
return await e(i, i.contentWindow);
|
|
1212
|
+
} finally {
|
|
1213
|
+
(s = i.parentNode) == null || s.removeChild(i);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
const Gn = {
|
|
1217
|
+
audio: {
|
|
1218
|
+
sampleHash: "",
|
|
1219
|
+
oscillator: "",
|
|
1220
|
+
maxChannels: 0,
|
|
1221
|
+
channelCountMode: ""
|
|
1222
|
+
}
|
|
1223
|
+
}, Jn = async (e) => new Promise((t) => {
|
|
1224
|
+
try {
|
|
1225
|
+
const n = new window.OfflineAudioContext(1, 5e3, 44100), r = n.createBufferSource(), a = n.createOscillator();
|
|
1226
|
+
a.frequency.value = 1e3;
|
|
1227
|
+
const s = n.createDynamicsCompressor();
|
|
1228
|
+
s.threshold.value = -50, s.knee.value = 40, s.ratio.value = 12, s.attack.value = 0, s.release.value = 0.2, a.connect(s), s.connect(n.destination), a.start(), n.startRendering(), n.oncomplete = (o) => {
|
|
1229
|
+
const i = o.renderedBuffer.getChannelData(0);
|
|
1230
|
+
a.disconnect(), s.disconnect(), t({
|
|
1231
|
+
audio: {
|
|
1232
|
+
sampleHash: xn(i),
|
|
1233
|
+
oscillator: a.type,
|
|
1234
|
+
maxChannels: n.destination.maxChannelCount,
|
|
1235
|
+
channelCountMode: r.channelCountMode
|
|
1208
1236
|
}
|
|
1209
|
-
|
|
1210
|
-
return { value: c[0] ? c[1] : void 0, done: !0 };
|
|
1211
|
-
}([u, h]);
|
|
1237
|
+
});
|
|
1212
1238
|
};
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
return !(!((t = N == null ? void 0 : N.exclude) === null || t === void 0) && t.includes(r));
|
|
1221
|
-
}).map(function(e) {
|
|
1222
|
-
return [e[0], (0, e[1])()];
|
|
1223
|
-
}));
|
|
1224
|
-
}, Fe = 3432918353, Ye = 461845907, jr = 3864292196, Br = 2246822507, Fr = 3266489909;
|
|
1225
|
-
function be(e, t) {
|
|
1226
|
-
return e << t | e >>> 32 - t;
|
|
1227
|
-
}
|
|
1228
|
-
function ke(e, t) {
|
|
1229
|
-
t === void 0 && (t = 0);
|
|
1230
|
-
for (var r = t, n = 0, a = 3 & e.length, i = e.length - a, o = 0; o < i; ) n = 255 & e.charCodeAt(o) | (255 & e.charCodeAt(++o)) << 8 | (255 & e.charCodeAt(++o)) << 16 | (255 & e.charCodeAt(++o)) << 24, ++o, n = be(n = Math.imul(n, Fe), 15), r = be(r ^= n = Math.imul(n, Ye), 13), r = Math.imul(r, 5) + jr;
|
|
1231
|
-
switch (n = 0, a) {
|
|
1232
|
-
case 3:
|
|
1233
|
-
n ^= (255 & e.charCodeAt(o + 2)) << 16;
|
|
1234
|
-
case 2:
|
|
1235
|
-
n ^= (255 & e.charCodeAt(o + 1)) << 8;
|
|
1236
|
-
case 1:
|
|
1237
|
-
n ^= 255 & e.charCodeAt(o), n = be(n = Math.imul(n, Fe), 15), r ^= n = Math.imul(n, Ye);
|
|
1238
|
-
}
|
|
1239
|
-
return ((r = function(s) {
|
|
1240
|
-
return s ^= s >>> 16, s = Math.imul(s, Br), s ^= s >>> 13, s = Math.imul(s, Fr), s ^ s >>> 16;
|
|
1241
|
-
}(r ^= e.length)) >>> 0).toString(36);
|
|
1242
|
-
}
|
|
1243
|
-
function Yr(e, t) {
|
|
1244
|
-
return new Promise(function(r) {
|
|
1245
|
-
setTimeout(function() {
|
|
1246
|
-
return r(t);
|
|
1247
|
-
}, e);
|
|
1248
|
-
});
|
|
1249
|
-
}
|
|
1250
|
-
function Jr(e, t, r) {
|
|
1251
|
-
return Promise.all(e.map(function(n) {
|
|
1252
|
-
return Promise.race([n, Yr(t, r)]);
|
|
1253
|
-
}));
|
|
1254
|
-
}
|
|
1255
|
-
function qr() {
|
|
1256
|
-
return k(this, void 0, void 0, function() {
|
|
1257
|
-
var e, t, r, n, a;
|
|
1258
|
-
return O(this, function(i) {
|
|
1259
|
-
switch (i.label) {
|
|
1260
|
-
case 0:
|
|
1261
|
-
return i.trys.push([0, 2, , 3]), e = Vr(), t = Object.keys(e), [4, Jr(Object.values(e), (N == null ? void 0 : N.timeout) || 1e3, Gr)];
|
|
1262
|
-
case 1:
|
|
1263
|
-
return r = i.sent(), n = r.filter(function(o) {
|
|
1264
|
-
return o !== void 0;
|
|
1265
|
-
}), a = {}, n.forEach(function(o, s) {
|
|
1266
|
-
a[t[s]] = o;
|
|
1267
|
-
}), [2, gt(a, N.exclude || [])];
|
|
1268
|
-
case 2:
|
|
1269
|
-
throw i.sent();
|
|
1270
|
-
case 3:
|
|
1271
|
-
return [2];
|
|
1239
|
+
} catch {
|
|
1240
|
+
t({
|
|
1241
|
+
audio: {
|
|
1242
|
+
sampleHash: "",
|
|
1243
|
+
oscillator: "",
|
|
1244
|
+
maxChannels: 0,
|
|
1245
|
+
channelCountMode: ""
|
|
1272
1246
|
}
|
|
1273
1247
|
});
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
};
|
|
1289
|
-
for (var a in e) n(a);
|
|
1290
|
-
return r;
|
|
1291
|
-
}
|
|
1292
|
-
function zr(e) {
|
|
1293
|
-
return k(this, void 0, void 0, function() {
|
|
1294
|
-
var t, r;
|
|
1295
|
-
return O(this, function(n) {
|
|
1296
|
-
switch (n.label) {
|
|
1297
|
-
case 0:
|
|
1298
|
-
return n.trys.push([0, 2, , 3]), [4, qr()];
|
|
1299
|
-
case 1:
|
|
1300
|
-
return t = n.sent(), r = ke(JSON.stringify(t)), [2, r.toString()];
|
|
1301
|
-
case 2:
|
|
1302
|
-
throw n.sent();
|
|
1303
|
-
case 3:
|
|
1304
|
-
return [2];
|
|
1248
|
+
}
|
|
1249
|
+
}), st = { browser: "" }, Vn = async (e) => typeof navigator > "u" ? st : { browser: navigator.userAgent }, it = {
|
|
1250
|
+
canvas: {
|
|
1251
|
+
data: ""
|
|
1252
|
+
}
|
|
1253
|
+
}, Yn = async (e) => {
|
|
1254
|
+
try {
|
|
1255
|
+
const t = Array.from(
|
|
1256
|
+
{ length: 3 },
|
|
1257
|
+
() => jn(300, 30)
|
|
1258
|
+
), n = Bn(t, 300, 30);
|
|
1259
|
+
return {
|
|
1260
|
+
canvas: {
|
|
1261
|
+
data: (await ot(n.data.toString())).toString()
|
|
1305
1262
|
}
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
function Qr(e) {
|
|
1310
|
-
for (var t = 0, r = 0; r < e.length; ++r) t += Math.abs(e[r]);
|
|
1311
|
-
return t;
|
|
1312
|
-
}
|
|
1313
|
-
function yt(e, t, r) {
|
|
1314
|
-
for (var n = [], a = 0; a < e[0].data.length; a++) {
|
|
1315
|
-
for (var i = [], o = 0; o < e.length; o++) i.push(e[o].data[a]);
|
|
1316
|
-
n.push(Xr(i));
|
|
1263
|
+
};
|
|
1264
|
+
} catch {
|
|
1265
|
+
return it;
|
|
1317
1266
|
}
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
for (
|
|
1332
|
-
|
|
1333
|
-
|
|
1267
|
+
}, jn = (e, t) => {
|
|
1268
|
+
const n = document.createElement("canvas"), r = n.getContext("2d");
|
|
1269
|
+
if (!r)
|
|
1270
|
+
return new ImageData(1, 1);
|
|
1271
|
+
n.width = e, n.height = t;
|
|
1272
|
+
const a = r.createLinearGradient(0, 0, n.width, n.height);
|
|
1273
|
+
a.addColorStop(0, "red"), a.addColorStop(1 / 6, "orange"), a.addColorStop(2 / 6, "yellow"), a.addColorStop(3 / 6, "green"), a.addColorStop(4 / 6, "blue"), a.addColorStop(5 / 6, "indigo"), a.addColorStop(1, "violet"), r.fillStyle = a, r.fillRect(0, 0, n.width, n.height);
|
|
1274
|
+
const s = "mmMwWLliI0O&1 - Les sanglots longs des violons de l'automne blessent mon coeur d'une langueur monotone";
|
|
1275
|
+
return r.font = "26.321px Arial", r.fillStyle = "black", r.fillText(s, -5, 15), r.fillStyle = "rgba(0, 0, 255, 0.5)", r.fillText(s, -3.3, 17.7), r.beginPath(), r.moveTo(0, 0), r.lineTo(n.width * 2 / 7, n.height), r.strokeStyle = "white", r.lineWidth = 2, r.stroke(), r.getImageData(0, 0, n.width, n.height);
|
|
1276
|
+
}, Fn = (e) => {
|
|
1277
|
+
if (e.length === 0)
|
|
1278
|
+
return 0;
|
|
1279
|
+
const t = {};
|
|
1280
|
+
for (const r of e)
|
|
1281
|
+
t[r] = (t[r] || 0) + 1;
|
|
1282
|
+
let n = e[0];
|
|
1283
|
+
for (const r in t)
|
|
1284
|
+
t[r] > t[n] && (n = parseInt(r, 10));
|
|
1285
|
+
return n;
|
|
1286
|
+
}, Bn = (e, t, n) => {
|
|
1287
|
+
const r = [];
|
|
1288
|
+
for (let o = 0; o < e[0].data.length; o++) {
|
|
1289
|
+
const i = [];
|
|
1290
|
+
for (let u = 0; u < e.length; u++)
|
|
1291
|
+
i.push(e[u].data[o]);
|
|
1292
|
+
r.push(Fn(i));
|
|
1293
|
+
}
|
|
1294
|
+
const a = r, s = new Uint8ClampedArray(a);
|
|
1295
|
+
return new ImageData(s, t, n);
|
|
1296
|
+
}, qn = [], zn = "mmMwWLliI0O&1", Qn = "48px", K = ["monospace", "sans-serif", "serif"], Ge = [
|
|
1297
|
+
"sans-serif-thin",
|
|
1298
|
+
"ARNO PRO",
|
|
1299
|
+
"Agency FB",
|
|
1300
|
+
"Arabic Typesetting",
|
|
1301
|
+
"Arial Unicode MS",
|
|
1302
|
+
"AvantGarde Bk BT",
|
|
1303
|
+
"BankGothic Md BT",
|
|
1304
|
+
"Bitstream Vera Sans Mono",
|
|
1305
|
+
"Calibri",
|
|
1306
|
+
"Century",
|
|
1307
|
+
"Century Gothic",
|
|
1308
|
+
"Clarendon",
|
|
1309
|
+
"EUROSTILE",
|
|
1310
|
+
"Franklin Gothic",
|
|
1311
|
+
"GOTHAM",
|
|
1312
|
+
"Gill Sans",
|
|
1313
|
+
"Helvetica Neue",
|
|
1314
|
+
"Letter Gothic",
|
|
1315
|
+
"Menlo",
|
|
1316
|
+
"MS Outlook",
|
|
1317
|
+
"MS Reference Specialty",
|
|
1318
|
+
"MS UI Gothic",
|
|
1319
|
+
"MT Extra",
|
|
1320
|
+
"MYRIAD PRO",
|
|
1321
|
+
"Marlett",
|
|
1322
|
+
"Microsoft Uighur",
|
|
1323
|
+
"Minion Pro",
|
|
1324
|
+
"Monotype Corsiva",
|
|
1325
|
+
"PMingLiU",
|
|
1326
|
+
"Pristina",
|
|
1327
|
+
"SCRIPTINA",
|
|
1328
|
+
"SimHei",
|
|
1329
|
+
"Small Fonts",
|
|
1330
|
+
"Staccato222 BT",
|
|
1331
|
+
"TRAJAN PRO",
|
|
1332
|
+
"Univers CE 55 Medium",
|
|
1333
|
+
"ZWAdobeF"
|
|
1334
|
+
], Xn = async (e) => Mn(async (t, { document: n }) => {
|
|
1335
|
+
const r = n.body;
|
|
1336
|
+
r.style.fontSize = Qn;
|
|
1337
|
+
const a = n.createElement("div");
|
|
1338
|
+
a.style.setProperty("visibility", "hidden", "important");
|
|
1339
|
+
const s = {}, o = {}, i = (d) => {
|
|
1340
|
+
const m = n.createElement("span"), { style: S } = m;
|
|
1341
|
+
return S.position = "absolute", S.top = "0", S.left = "0", S.fontFamily = d, m.textContent = zn, a.appendChild(m), m;
|
|
1342
|
+
}, u = (d, m) => i(`'${d}',${m}`), f = () => K.map(i), y = () => {
|
|
1343
|
+
const d = {};
|
|
1344
|
+
for (const m of Ge)
|
|
1345
|
+
d[m] = K.map(
|
|
1346
|
+
(S) => u(m, S)
|
|
1347
|
+
);
|
|
1348
|
+
return d;
|
|
1349
|
+
}, h = (d) => K.some(
|
|
1350
|
+
(m, S) => d[S].offsetWidth !== s[m] || d[S].offsetHeight !== o[m]
|
|
1351
|
+
), p = f(), l = y();
|
|
1352
|
+
r.appendChild(a);
|
|
1353
|
+
for (let d = 0; d < K.length; d++)
|
|
1354
|
+
s[K[d]] = p[d].offsetWidth, o[K[d]] = p[d].offsetHeight;
|
|
1355
|
+
return Ge.filter((d) => h(l[d]));
|
|
1356
|
+
}), ct = {
|
|
1357
|
+
vendor: "",
|
|
1358
|
+
vendorUnmasked: "",
|
|
1359
|
+
renderer: "",
|
|
1360
|
+
rendererUnmasked: "",
|
|
1361
|
+
version: "",
|
|
1362
|
+
shadingLanguageVersion: ""
|
|
1363
|
+
}, ut = {
|
|
1364
|
+
hardware: {
|
|
1365
|
+
videocard: ct,
|
|
1366
|
+
architecture: 0,
|
|
1367
|
+
deviceMemory: "undefined",
|
|
1368
|
+
jsHeapSizeLimit: 0
|
|
1334
1369
|
}
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
} catch (u) {
|
|
1349
|
-
console.error("Error creating audio fingerprint:", u), r(u);
|
|
1350
|
-
}
|
|
1351
|
-
})];
|
|
1352
|
-
});
|
|
1353
|
-
});
|
|
1354
|
-
});
|
|
1355
|
-
var Zr = z().name !== "SamsungBrowser" ? 1 : 3, Je = 280, qe = 20;
|
|
1356
|
-
z().name != "Firefox" && R("canvas", function() {
|
|
1357
|
-
return document.createElement("canvas").getContext("2d"), new Promise(function(e) {
|
|
1358
|
-
var t = Array.from({ length: Zr }, function() {
|
|
1359
|
-
return function() {
|
|
1360
|
-
var r = document.createElement("canvas"), n = r.getContext("2d");
|
|
1361
|
-
if (!n) return new ImageData(1, 1);
|
|
1362
|
-
r.width = Je, r.height = qe;
|
|
1363
|
-
var a = n.createLinearGradient(0, 0, r.width, r.height);
|
|
1364
|
-
a.addColorStop(0, "red"), a.addColorStop(0.16666666666666666, "orange"), a.addColorStop(0.3333333333333333, "yellow"), a.addColorStop(0.5, "green"), a.addColorStop(0.6666666666666666, "blue"), a.addColorStop(0.8333333333333334, "indigo"), a.addColorStop(1, "violet"), n.fillStyle = a, n.fillRect(0, 0, r.width, r.height);
|
|
1365
|
-
var i = "Random Text WMwmil10Oo";
|
|
1366
|
-
n.font = "23.123px Arial", n.fillStyle = "black", n.fillText(i, -5, 15), n.fillStyle = "rgba(0, 0, 255, 0.5)", n.fillText(i, -3.3, 17.7), n.beginPath(), n.moveTo(0, 0), n.lineTo(2 * r.width / 7, r.height), n.strokeStyle = "white", n.lineWidth = 2, n.stroke();
|
|
1367
|
-
var o = n.getImageData(0, 0, r.width, r.height);
|
|
1368
|
-
return o;
|
|
1369
|
-
}();
|
|
1370
|
-
});
|
|
1371
|
-
e({ commonImageDataHash: ke(yt(t, Je, qe).data.toString()).toString() });
|
|
1372
|
-
});
|
|
1373
|
-
});
|
|
1374
|
-
var Re, en = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"], tn = ["monospace", "sans-serif", "serif"];
|
|
1375
|
-
function ze(e, t) {
|
|
1376
|
-
if (!e) throw new Error("Canvas context not supported");
|
|
1377
|
-
return e.font = "72px ".concat(t), e.measureText("WwMmLli0Oo").width;
|
|
1378
|
-
}
|
|
1379
|
-
function rn() {
|
|
1380
|
-
var e, t = document.createElement("canvas"), r = (e = t.getContext("webgl")) !== null && e !== void 0 ? e : t.getContext("experimental-webgl");
|
|
1381
|
-
if (r && "getParameter" in r) {
|
|
1382
|
-
var n = r.getExtension("WEBGL_debug_renderer_info");
|
|
1383
|
-
return { vendor: (r.getParameter(r.VENDOR) || "").toString(), vendorUnmasked: n ? (r.getParameter(n.UNMASKED_VENDOR_WEBGL) || "").toString() : "", renderer: (r.getParameter(r.RENDERER) || "").toString(), rendererUnmasked: n ? (r.getParameter(n.UNMASKED_RENDERER_WEBGL) || "").toString() : "", version: (r.getParameter(r.VERSION) || "").toString(), shadingLanguageVersion: (r.getParameter(r.SHADING_LANGUAGE_VERSION) || "").toString() };
|
|
1370
|
+
};
|
|
1371
|
+
function Zn() {
|
|
1372
|
+
const e = document.createElement("canvas"), t = e.getContext("webgl") ?? e.getContext("experimental-webgl");
|
|
1373
|
+
if (t && "getParameter" in t) {
|
|
1374
|
+
const n = t.getExtension("WEBGL_debug_renderer_info");
|
|
1375
|
+
return {
|
|
1376
|
+
vendor: (t.getParameter(t.VENDOR) || "").toString(),
|
|
1377
|
+
vendorUnmasked: n ? (t.getParameter(n.UNMASKED_VENDOR_WEBGL) || "").toString() : "",
|
|
1378
|
+
renderer: (t.getParameter(t.RENDERER) || "").toString(),
|
|
1379
|
+
rendererUnmasked: n ? (t.getParameter(n.UNMASKED_RENDERER_WEBGL) || "").toString() : "",
|
|
1380
|
+
version: (t.getParameter(t.VERSION) || "").toString(),
|
|
1381
|
+
shadingLanguageVersion: (t.getParameter(t.SHADING_LANGUAGE_VERSION) || "").toString()
|
|
1382
|
+
};
|
|
1384
1383
|
}
|
|
1385
|
-
return
|
|
1384
|
+
return ct;
|
|
1386
1385
|
}
|
|
1387
|
-
function
|
|
1388
|
-
|
|
1386
|
+
function er() {
|
|
1387
|
+
const e = new Float32Array(1), t = new Uint8Array(e.buffer);
|
|
1389
1388
|
return e[0] = 1 / 0, e[0] = e[0] - e[0], t[3];
|
|
1390
1389
|
}
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
o[h] > u && (s = h, u = o[h]);
|
|
1404
|
-
}), s;
|
|
1405
|
-
}(e.map(function(i) {
|
|
1406
|
-
return n in i ? i[n] : void 0;
|
|
1407
|
-
}).filter(function(i) {
|
|
1408
|
-
return i !== void 0;
|
|
1409
|
-
}));
|
|
1410
|
-
a && (r[n] = a);
|
|
1411
|
-
}), r;
|
|
1412
|
-
}
|
|
1413
|
-
function on() {
|
|
1414
|
-
var e = [], t = { "prefers-contrast": ["high", "more", "low", "less", "forced", "no-preference"], "any-hover": ["hover", "none"], "any-pointer": ["none", "coarse", "fine"], pointer: ["none", "coarse", "fine"], hover: ["hover", "none"], update: ["fast", "slow"], "inverted-colors": ["inverted", "none"], "prefers-reduced-motion": ["reduce", "no-preference"], "prefers-reduced-transparency": ["reduce", "no-preference"], scripting: ["none", "initial-only", "enabled"], "forced-colors": ["active", "none"] };
|
|
1415
|
-
return Object.keys(t).forEach(function(r) {
|
|
1416
|
-
t[r].forEach(function(n) {
|
|
1417
|
-
matchMedia("(".concat(r, ": ").concat(n, ")")).matches && e.push("".concat(r, ": ").concat(n));
|
|
1390
|
+
const tr = () => navigator.deviceMemory || 0, nr = () => window.performance && window.performance.memory || {
|
|
1391
|
+
jsHeapSizeLimit: 0
|
|
1392
|
+
}, rr = async (e) => new Promise((t) => {
|
|
1393
|
+
try {
|
|
1394
|
+
const n = tr(), r = nr();
|
|
1395
|
+
t({
|
|
1396
|
+
hardware: {
|
|
1397
|
+
videocard: Zn(),
|
|
1398
|
+
architecture: er(),
|
|
1399
|
+
deviceMemory: n.toString() || "undefined",
|
|
1400
|
+
jsHeapSizeLimit: r.jsHeapSizeLimit || 0
|
|
1401
|
+
}
|
|
1418
1402
|
});
|
|
1419
|
-
}), e;
|
|
1420
|
-
}
|
|
1421
|
-
function sn() {
|
|
1422
|
-
if (window.location.protocol === "https:" && typeof window.ApplePaySession == "function") try {
|
|
1423
|
-
for (var e = window.ApplePaySession.supportsVersion, t = 15; t > 0; t--) if (e(t)) return t;
|
|
1424
1403
|
} catch {
|
|
1425
|
-
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
return O(this, function(u) {
|
|
1438
|
-
switch (u.label) {
|
|
1439
|
-
case 0:
|
|
1440
|
-
return document.body ? [3, 2] : [4, (h = 50, new Promise(function(f) {
|
|
1441
|
-
return setTimeout(f, h, c);
|
|
1442
|
-
}))];
|
|
1443
|
-
case 1:
|
|
1444
|
-
return u.sent(), [3, 0];
|
|
1445
|
-
case 2:
|
|
1446
|
-
if ((i = document.createElement("iframe")).setAttribute("frameBorder", "0"), (o = i.style).setProperty("position", "fixed"), o.setProperty("display", "block", "important"), o.setProperty("visibility", "visible"), o.setProperty("border", "0"), o.setProperty("opacity", "0"), i.src = "about:blank", document.body.appendChild(i), !(s = i.contentDocument || ((a = i.contentWindow) === null || a === void 0 ? void 0 : a.document))) throw new Error("Iframe document is not accessible");
|
|
1447
|
-
return n({ iframe: s }), setTimeout(function() {
|
|
1448
|
-
document.body.removeChild(i);
|
|
1449
|
-
}, 0), [2];
|
|
1450
|
-
}
|
|
1451
|
-
var h, c;
|
|
1452
|
-
});
|
|
1453
|
-
});
|
|
1454
|
-
})(function(n) {
|
|
1455
|
-
var a = n.iframe;
|
|
1456
|
-
return k(e, void 0, void 0, function() {
|
|
1457
|
-
var i, o, s, u;
|
|
1458
|
-
return O(this, function(h) {
|
|
1459
|
-
return i = a.createElement("canvas"), o = i.getContext("2d"), s = tn.map(function(c) {
|
|
1460
|
-
return ze(o, c);
|
|
1461
|
-
}), u = {}, en.forEach(function(c) {
|
|
1462
|
-
var f = ze(o, c);
|
|
1463
|
-
s.includes(f) || (u[c] = f);
|
|
1464
|
-
}), t(u), [2];
|
|
1465
|
-
});
|
|
1466
|
-
});
|
|
1467
|
-
});
|
|
1468
|
-
} catch {
|
|
1469
|
-
r({ error: "unsupported" });
|
|
1404
|
+
t(ut);
|
|
1405
|
+
}
|
|
1406
|
+
}), ar = {
|
|
1407
|
+
locales: {
|
|
1408
|
+
languages: "",
|
|
1409
|
+
timezone: ""
|
|
1410
|
+
}
|
|
1411
|
+
}, or = async (e) => new Promise((t) => {
|
|
1412
|
+
t({
|
|
1413
|
+
locales: {
|
|
1414
|
+
languages: navigator.language,
|
|
1415
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
1470
1416
|
}
|
|
1471
1417
|
});
|
|
1472
|
-
}),
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
return O(this, function(s) {
|
|
1490
|
-
switch (s.label) {
|
|
1491
|
-
case 0:
|
|
1492
|
-
r = {}, n = 0, a = Re, s.label = 1;
|
|
1493
|
-
case 1:
|
|
1494
|
-
if (!(n < a.length)) return [3, 6];
|
|
1495
|
-
i = a[n], s.label = 2;
|
|
1496
|
-
case 2:
|
|
1497
|
-
return s.trys.push([2, 4, , 5]), [4, navigator.permissions.query({ name: i })];
|
|
1498
|
-
case 3:
|
|
1499
|
-
return o = s.sent(), r[i] = o.state.toString(), [3, 5];
|
|
1500
|
-
case 4:
|
|
1501
|
-
return s.sent(), [3, 5];
|
|
1502
|
-
case 5:
|
|
1503
|
-
return n++, [3, 1];
|
|
1504
|
-
case 6:
|
|
1505
|
-
return [2, r];
|
|
1506
|
-
}
|
|
1507
|
-
});
|
|
1508
|
-
});
|
|
1509
|
-
}();
|
|
1510
|
-
}), [2, Promise.all(e).then(function(r) {
|
|
1511
|
-
return an(r, Re);
|
|
1512
|
-
})];
|
|
1513
|
-
});
|
|
1514
|
-
});
|
|
1515
|
-
}), R("plugins", function() {
|
|
1516
|
-
var e = [];
|
|
1517
|
-
if (navigator.plugins) for (var t = 0; t < navigator.plugins.length; t++) {
|
|
1518
|
-
var r = navigator.plugins[t];
|
|
1519
|
-
e.push([r.name, r.filename, r.description].join("|"));
|
|
1520
|
-
}
|
|
1521
|
-
return new Promise(function(n) {
|
|
1522
|
-
n({ plugins: e });
|
|
1523
|
-
});
|
|
1524
|
-
}), R("screen", function() {
|
|
1525
|
-
return new Promise(function(e) {
|
|
1526
|
-
e({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: on() });
|
|
1527
|
-
});
|
|
1528
|
-
}), R("system", function() {
|
|
1529
|
-
return new Promise(function(e) {
|
|
1530
|
-
var t = z();
|
|
1531
|
-
e({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, browser: { name: t.name, version: t.version }, applePayVersion: sn() });
|
|
1532
|
-
});
|
|
1533
|
-
});
|
|
1534
|
-
var T, cn = z().name !== "SamsungBrowser" ? 1 : 3, l = null;
|
|
1535
|
-
typeof document < "u" && ((T = document.createElement("canvas")).width = 200, T.height = 100, l = T.getContext("webgl")), R("webgl", function() {
|
|
1536
|
-
return k(this, void 0, void 0, function() {
|
|
1537
|
-
var e;
|
|
1538
|
-
return O(this, function(t) {
|
|
1539
|
-
try {
|
|
1540
|
-
if (!l) throw new Error("WebGL not supported");
|
|
1541
|
-
return e = Array.from({ length: cn }, function() {
|
|
1542
|
-
return function() {
|
|
1543
|
-
try {
|
|
1544
|
-
if (!l) throw new Error("WebGL not supported");
|
|
1545
|
-
var r = `
|
|
1546
|
-
attribute vec2 position;
|
|
1547
|
-
void main() {
|
|
1548
|
-
gl_Position = vec4(position, 0.0, 1.0);
|
|
1549
|
-
}
|
|
1550
|
-
`, n = `
|
|
1551
|
-
precision mediump float;
|
|
1552
|
-
void main() {
|
|
1553
|
-
gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
|
|
1554
|
-
}
|
|
1555
|
-
`, a = l.createShader(l.VERTEX_SHADER), i = l.createShader(l.FRAGMENT_SHADER);
|
|
1556
|
-
if (!a || !i) throw new Error("Failed to create shaders");
|
|
1557
|
-
if (l.shaderSource(a, r), l.shaderSource(i, n), l.compileShader(a), !l.getShaderParameter(a, l.COMPILE_STATUS)) throw new Error("Vertex shader compilation failed: " + l.getShaderInfoLog(a));
|
|
1558
|
-
if (l.compileShader(i), !l.getShaderParameter(i, l.COMPILE_STATUS)) throw new Error("Fragment shader compilation failed: " + l.getShaderInfoLog(i));
|
|
1559
|
-
var o = l.createProgram();
|
|
1560
|
-
if (!o) throw new Error("Failed to create shader program");
|
|
1561
|
-
if (l.attachShader(o, a), l.attachShader(o, i), l.linkProgram(o), !l.getProgramParameter(o, l.LINK_STATUS)) throw new Error("Shader program linking failed: " + l.getProgramInfoLog(o));
|
|
1562
|
-
l.useProgram(o);
|
|
1563
|
-
for (var s = 137, u = new Float32Array(4 * s), h = 2 * Math.PI / s, c = 0; c < s; c++) {
|
|
1564
|
-
var f = c * h;
|
|
1565
|
-
u[4 * c] = 0, u[4 * c + 1] = 0, u[4 * c + 2] = Math.cos(f) * (T.width / 2), u[4 * c + 3] = Math.sin(f) * (T.height / 2);
|
|
1566
|
-
}
|
|
1567
|
-
var g = l.createBuffer();
|
|
1568
|
-
l.bindBuffer(l.ARRAY_BUFFER, g), l.bufferData(l.ARRAY_BUFFER, u, l.STATIC_DRAW);
|
|
1569
|
-
var p = l.getAttribLocation(o, "position");
|
|
1570
|
-
l.enableVertexAttribArray(p), l.vertexAttribPointer(p, 2, l.FLOAT, !1, 0, 0), l.viewport(0, 0, T.width, T.height), l.clearColor(0, 0, 0, 1), l.clear(l.COLOR_BUFFER_BIT), l.drawArrays(l.LINES, 0, 2 * s);
|
|
1571
|
-
var A = new Uint8ClampedArray(T.width * T.height * 4);
|
|
1572
|
-
return l.readPixels(0, 0, T.width, T.height, l.RGBA, l.UNSIGNED_BYTE, A), new ImageData(A, T.width, T.height);
|
|
1573
|
-
} catch {
|
|
1574
|
-
return new ImageData(1, 1);
|
|
1575
|
-
} finally {
|
|
1576
|
-
l && (l.bindBuffer(l.ARRAY_BUFFER, null), l.useProgram(null), l.viewport(0, 0, l.drawingBufferWidth, l.drawingBufferHeight), l.clearColor(0, 0, 0, 0));
|
|
1577
|
-
}
|
|
1578
|
-
}();
|
|
1579
|
-
}), [2, { commonImageHash: ke(yt(e, T.width, T.height).data.toString()).toString() }];
|
|
1580
|
-
} catch {
|
|
1581
|
-
return [2, { webgl: "unsupported" }];
|
|
1418
|
+
}), lt = {
|
|
1419
|
+
screen: {
|
|
1420
|
+
colorDepth: 0,
|
|
1421
|
+
pixelDepth: 0,
|
|
1422
|
+
isTouchScreen: !1,
|
|
1423
|
+
maxTouchPoints: 0,
|
|
1424
|
+
mediaMatches: []
|
|
1425
|
+
}
|
|
1426
|
+
}, sr = async (e) => new Promise((t) => {
|
|
1427
|
+
try {
|
|
1428
|
+
const n = window.screen, r = {
|
|
1429
|
+
screen: {
|
|
1430
|
+
colorDepth: n.colorDepth,
|
|
1431
|
+
pixelDepth: n.pixelDepth,
|
|
1432
|
+
isTouchScreen: navigator.maxTouchPoints > 0,
|
|
1433
|
+
maxTouchPoints: navigator.maxTouchPoints,
|
|
1434
|
+
mediaMatches: ir()
|
|
1582
1435
|
}
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
}
|
|
1436
|
+
};
|
|
1437
|
+
t(r);
|
|
1438
|
+
} catch {
|
|
1439
|
+
t(lt);
|
|
1440
|
+
}
|
|
1586
1441
|
});
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1442
|
+
function ir() {
|
|
1443
|
+
const e = [], t = {
|
|
1444
|
+
"prefers-contrast": [
|
|
1445
|
+
"high",
|
|
1446
|
+
"more",
|
|
1447
|
+
"low",
|
|
1448
|
+
"less",
|
|
1449
|
+
"forced",
|
|
1450
|
+
"no-preference"
|
|
1451
|
+
],
|
|
1452
|
+
"any-hover": ["hover", "none"],
|
|
1453
|
+
"any-pointer": ["none", "coarse", "fine"],
|
|
1454
|
+
pointer: ["none", "coarse", "fine"],
|
|
1455
|
+
hover: ["hover", "none"],
|
|
1456
|
+
update: ["fast", "slow"],
|
|
1457
|
+
"inverted-colors": ["inverted", "none"],
|
|
1458
|
+
"prefers-reduced-motion": ["reduce", "no-preference"],
|
|
1459
|
+
"prefers-reduced-transparency": ["reduce", "no-preference"],
|
|
1460
|
+
scripting: ["none", "initial-only", "enabled"],
|
|
1461
|
+
"forced-colors": ["active", "none"],
|
|
1462
|
+
"color-gamut": ["srgb", "p3", "rec2020"]
|
|
1463
|
+
};
|
|
1464
|
+
return Object.keys(t).forEach((n) => {
|
|
1465
|
+
t[n].forEach((r) => {
|
|
1466
|
+
matchMedia(`(${n}: ${r})`).matches && e.push(`${n}: ${r}`);
|
|
1596
1467
|
});
|
|
1597
|
-
});
|
|
1598
|
-
}
|
|
1599
|
-
const
|
|
1468
|
+
}), e;
|
|
1469
|
+
}
|
|
1470
|
+
const cr = async (e) => {
|
|
1471
|
+
try {
|
|
1472
|
+
return {
|
|
1473
|
+
system: {
|
|
1474
|
+
platform: navigator.platform,
|
|
1475
|
+
cookieEnabled: navigator.cookieEnabled,
|
|
1476
|
+
productSub: navigator.productSub,
|
|
1477
|
+
product: navigator.product
|
|
1478
|
+
}
|
|
1479
|
+
};
|
|
1480
|
+
} catch {
|
|
1481
|
+
return dt;
|
|
1482
|
+
}
|
|
1483
|
+
}, dt = {
|
|
1484
|
+
system: {
|
|
1485
|
+
platform: "",
|
|
1486
|
+
cookieEnabled: !1,
|
|
1487
|
+
productSub: "",
|
|
1488
|
+
product: ""
|
|
1489
|
+
}
|
|
1490
|
+
}, ur = async (e) => {
|
|
1491
|
+
try {
|
|
1492
|
+
return Promise.all([
|
|
1493
|
+
Jn(),
|
|
1494
|
+
Vn(),
|
|
1495
|
+
Yn(),
|
|
1496
|
+
Xn(),
|
|
1497
|
+
rr(),
|
|
1498
|
+
or(),
|
|
1499
|
+
sr(),
|
|
1500
|
+
cr()
|
|
1501
|
+
]);
|
|
1502
|
+
} catch {
|
|
1503
|
+
return [
|
|
1504
|
+
Gn,
|
|
1505
|
+
st,
|
|
1506
|
+
it,
|
|
1507
|
+
qn,
|
|
1508
|
+
ut,
|
|
1509
|
+
ar,
|
|
1510
|
+
lt,
|
|
1511
|
+
dt
|
|
1512
|
+
];
|
|
1513
|
+
}
|
|
1514
|
+
}, lr = async (e) => {
|
|
1515
|
+
try {
|
|
1516
|
+
const t = await ur();
|
|
1517
|
+
return await ot(JSON.stringify(t));
|
|
1518
|
+
} catch {
|
|
1519
|
+
return "";
|
|
1520
|
+
}
|
|
1521
|
+
}, ne = "Oops! It looks like your session has expired. For your security, please log in again to continue.", dr = "Your session has been successfully terminated.", re = "Login failed. Please try again.", Ae = "Error getting access token, please re-authenticate.", hr = "You forgot to wrap your component in <AuthProvider>.", le = {
|
|
1600
1522
|
dev: "https://auth.gizmette.local.com:3003",
|
|
1601
1523
|
prod: "https://mylogin.gizmette.com/auth"
|
|
1602
|
-
},
|
|
1524
|
+
}, ae = "@@auth@@", J = "LOADING", V = "LOGIN", ht = "LOGOUT", pr = process.env.NODE_ENV === "production", pt = !pr, fr = (e) => {
|
|
1525
|
+
try {
|
|
1526
|
+
const t = In(e);
|
|
1527
|
+
return t ? t[I.USER_ID_KEY] : "";
|
|
1528
|
+
} catch {
|
|
1529
|
+
return "";
|
|
1530
|
+
}
|
|
1531
|
+
}, pe = async ({
|
|
1603
1532
|
type: e,
|
|
1604
1533
|
clientId: t,
|
|
1605
|
-
params:
|
|
1534
|
+
params: n = {}
|
|
1606
1535
|
}) => {
|
|
1607
1536
|
try {
|
|
1608
|
-
const
|
|
1609
|
-
|
|
1537
|
+
const r = await fetch(
|
|
1538
|
+
pt ? `${le.dev}/${e}` : `${le.prod}/${e}`,
|
|
1610
1539
|
{
|
|
1611
1540
|
credentials: "include",
|
|
1612
1541
|
method: "POST",
|
|
1613
1542
|
headers: {
|
|
1614
1543
|
"Content-Type": "application/json",
|
|
1615
|
-
[
|
|
1544
|
+
[Be.CLIENT_ID]: `${t}`
|
|
1616
1545
|
},
|
|
1617
|
-
body: JSON.stringify(
|
|
1546
|
+
body: JSON.stringify(n)
|
|
1618
1547
|
}
|
|
1619
1548
|
);
|
|
1620
|
-
if (
|
|
1621
|
-
return { status:
|
|
1622
|
-
const { data: a, errors:
|
|
1549
|
+
if (r.status !== 200)
|
|
1550
|
+
return { status: r.status, data: [] };
|
|
1551
|
+
const { data: a, errors: s } = await r.json();
|
|
1623
1552
|
return {
|
|
1624
|
-
status:
|
|
1553
|
+
status: r.status,
|
|
1625
1554
|
data: a,
|
|
1626
|
-
errors:
|
|
1555
|
+
errors: s
|
|
1627
1556
|
};
|
|
1628
|
-
} catch (
|
|
1629
|
-
return console.error(
|
|
1557
|
+
} catch (r) {
|
|
1558
|
+
return console.error(r), { status: 500, data: [] };
|
|
1630
1559
|
}
|
|
1631
|
-
},
|
|
1560
|
+
}, yr = async ({
|
|
1632
1561
|
userId: e,
|
|
1633
1562
|
idToken: t,
|
|
1634
|
-
accessToken:
|
|
1635
|
-
refreshToken:
|
|
1563
|
+
accessToken: n,
|
|
1564
|
+
refreshToken: r,
|
|
1636
1565
|
clientId: a,
|
|
1637
|
-
domain:
|
|
1566
|
+
domain: s
|
|
1638
1567
|
}) => {
|
|
1639
1568
|
try {
|
|
1640
1569
|
return {
|
|
1641
|
-
status: (await
|
|
1642
|
-
type:
|
|
1570
|
+
status: (await pe({
|
|
1571
|
+
type: de.LOGOUT,
|
|
1643
1572
|
clientId: a,
|
|
1644
1573
|
params: {
|
|
1645
1574
|
userId: e,
|
|
1646
1575
|
idToken: t,
|
|
1647
|
-
accessToken:
|
|
1648
|
-
refreshToken:
|
|
1649
|
-
domain:
|
|
1576
|
+
accessToken: n,
|
|
1577
|
+
refreshToken: r,
|
|
1578
|
+
domain: s
|
|
1650
1579
|
}
|
|
1651
1580
|
})).status === 200
|
|
1652
1581
|
};
|
|
@@ -1655,39 +1584,39 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
1655
1584
|
status: !1
|
|
1656
1585
|
};
|
|
1657
1586
|
}
|
|
1658
|
-
},
|
|
1587
|
+
}, Je = async ({
|
|
1659
1588
|
username: e,
|
|
1660
1589
|
password: t,
|
|
1661
|
-
clientId:
|
|
1662
|
-
nonce:
|
|
1590
|
+
clientId: n,
|
|
1591
|
+
nonce: r,
|
|
1663
1592
|
type: a,
|
|
1664
|
-
sessionExpiration:
|
|
1593
|
+
sessionExpiration: s,
|
|
1665
1594
|
code: o,
|
|
1666
|
-
code_verifier:
|
|
1595
|
+
code_verifier: i,
|
|
1667
1596
|
domain: u,
|
|
1668
|
-
fingerprint:
|
|
1597
|
+
fingerprint: f
|
|
1669
1598
|
}) => {
|
|
1670
1599
|
try {
|
|
1671
|
-
const
|
|
1672
|
-
type:
|
|
1673
|
-
clientId:
|
|
1600
|
+
const y = await pe({
|
|
1601
|
+
type: de.AUTHENTICATE,
|
|
1602
|
+
clientId: n,
|
|
1674
1603
|
params: {
|
|
1675
|
-
type: a ||
|
|
1604
|
+
type: a || j.ID_AND_ACCESS_TOKEN,
|
|
1676
1605
|
username: e,
|
|
1677
1606
|
password: t,
|
|
1678
|
-
sessionExpiration:
|
|
1679
|
-
nonce:
|
|
1607
|
+
sessionExpiration: s,
|
|
1608
|
+
nonce: r,
|
|
1680
1609
|
code: o,
|
|
1681
|
-
code_verifier:
|
|
1610
|
+
code_verifier: i,
|
|
1682
1611
|
domain: u,
|
|
1683
|
-
fingerprint:
|
|
1612
|
+
fingerprint: f
|
|
1684
1613
|
}
|
|
1685
|
-
}),
|
|
1686
|
-
return
|
|
1687
|
-
idToken:
|
|
1688
|
-
accessToken:
|
|
1689
|
-
refreshToken:
|
|
1690
|
-
userId:
|
|
1614
|
+
}), h = await F(y.data.idToken);
|
|
1615
|
+
return h && h.payload[I.USER_ID_KEY] !== "" && h.payload[I.NONCE_KEY] === r ? {
|
|
1616
|
+
idToken: y.data.idToken,
|
|
1617
|
+
accessToken: y.data.accessToken,
|
|
1618
|
+
refreshToken: y.data.refreshToken,
|
|
1619
|
+
userId: h.payload[I.USER_ID_KEY],
|
|
1691
1620
|
status: !0
|
|
1692
1621
|
} : {
|
|
1693
1622
|
status: !1
|
|
@@ -1697,24 +1626,24 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
1697
1626
|
status: !1
|
|
1698
1627
|
};
|
|
1699
1628
|
}
|
|
1700
|
-
},
|
|
1629
|
+
}, gr = async ({
|
|
1701
1630
|
nonce: e,
|
|
1702
1631
|
clientId: t,
|
|
1703
|
-
code_challenge:
|
|
1632
|
+
code_challenge: n
|
|
1704
1633
|
}) => {
|
|
1705
1634
|
try {
|
|
1706
|
-
const
|
|
1707
|
-
type:
|
|
1635
|
+
const r = await pe({
|
|
1636
|
+
type: de.CODE,
|
|
1708
1637
|
clientId: t,
|
|
1709
1638
|
params: {
|
|
1710
|
-
type:
|
|
1639
|
+
type: j.CODE,
|
|
1711
1640
|
nonce: e,
|
|
1712
|
-
code_challenge:
|
|
1641
|
+
code_challenge: n
|
|
1713
1642
|
}
|
|
1714
1643
|
});
|
|
1715
|
-
return
|
|
1644
|
+
return r.data.code ? {
|
|
1716
1645
|
status: !0,
|
|
1717
|
-
code:
|
|
1646
|
+
code: r.data.code
|
|
1718
1647
|
} : {
|
|
1719
1648
|
status: !1
|
|
1720
1649
|
};
|
|
@@ -1723,32 +1652,32 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
1723
1652
|
status: !1
|
|
1724
1653
|
};
|
|
1725
1654
|
}
|
|
1726
|
-
},
|
|
1655
|
+
}, mr = async ({
|
|
1727
1656
|
clientId: e,
|
|
1728
1657
|
userId: t,
|
|
1729
|
-
nonce:
|
|
1730
|
-
refreshToken:
|
|
1658
|
+
nonce: n,
|
|
1659
|
+
refreshToken: r,
|
|
1731
1660
|
accessToken: a,
|
|
1732
|
-
domain:
|
|
1661
|
+
domain: s
|
|
1733
1662
|
}) => {
|
|
1734
1663
|
try {
|
|
1735
|
-
const o = await
|
|
1736
|
-
type:
|
|
1664
|
+
const o = await pe({
|
|
1665
|
+
type: de.AUTHENTICATE,
|
|
1737
1666
|
clientId: e,
|
|
1738
1667
|
params: {
|
|
1739
|
-
type:
|
|
1668
|
+
type: j.REFRESH_TOKEN,
|
|
1740
1669
|
userId: t,
|
|
1741
|
-
nonce:
|
|
1742
|
-
refreshToken:
|
|
1670
|
+
nonce: n,
|
|
1671
|
+
refreshToken: r,
|
|
1743
1672
|
accessToken: a,
|
|
1744
|
-
domain:
|
|
1745
|
-
fingerprint: await
|
|
1673
|
+
domain: s,
|
|
1674
|
+
fingerprint: await ft()
|
|
1746
1675
|
}
|
|
1747
|
-
}),
|
|
1748
|
-
return
|
|
1676
|
+
}), i = await F(o.data.accessToken);
|
|
1677
|
+
return i && i.payload[I.USER_ID_KEY] !== "" && i.payload[I.NONCE_KEY] === n ? {
|
|
1749
1678
|
accessToken: o.data.accessToken,
|
|
1750
1679
|
refreshToken: o.data.refreshToken,
|
|
1751
|
-
userId:
|
|
1680
|
+
userId: i.payload[I.USER_ID_KEY],
|
|
1752
1681
|
status: !0
|
|
1753
1682
|
} : {
|
|
1754
1683
|
status: !1
|
|
@@ -1758,7 +1687,7 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
1758
1687
|
status: !1
|
|
1759
1688
|
};
|
|
1760
1689
|
}
|
|
1761
|
-
},
|
|
1690
|
+
}, oe = {
|
|
1762
1691
|
GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
|
|
1763
1692
|
$clientId: String!,
|
|
1764
1693
|
$username: String!,
|
|
@@ -1833,40 +1762,40 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
1833
1762
|
username,
|
|
1834
1763
|
}
|
|
1835
1764
|
}`
|
|
1836
|
-
},
|
|
1765
|
+
}, H = {
|
|
1837
1766
|
GET_REGISTRATION_OPTIONS: {
|
|
1838
|
-
schema:
|
|
1767
|
+
schema: oe.GET_REGISTRATION_OPTIONS,
|
|
1839
1768
|
method: "getPasskeyRegistrationOptions"
|
|
1840
1769
|
},
|
|
1841
1770
|
VERIFY_REGISTRATION: {
|
|
1842
|
-
schema:
|
|
1771
|
+
schema: oe.VERIFY_REGISTRATION,
|
|
1843
1772
|
method: "verifyPasskeyRegistration"
|
|
1844
1773
|
},
|
|
1845
1774
|
GET_AUTHENTICATION_OPTIONS: {
|
|
1846
|
-
schema:
|
|
1775
|
+
schema: oe.GET_AUTHENTICATION_OPTIONS,
|
|
1847
1776
|
method: "getPasskeyAuthenticationOptions"
|
|
1848
1777
|
},
|
|
1849
1778
|
VERIFY_AUTHENTICATION: {
|
|
1850
|
-
schema:
|
|
1779
|
+
schema: oe.VERIFY_AUTHENTICATION,
|
|
1851
1780
|
method: "verifyPasskeyAuthentication"
|
|
1852
1781
|
}
|
|
1853
|
-
},
|
|
1782
|
+
}, L = async ({
|
|
1854
1783
|
accessToken: e,
|
|
1855
1784
|
type: t,
|
|
1856
|
-
clientId:
|
|
1857
|
-
params:
|
|
1785
|
+
clientId: n,
|
|
1786
|
+
params: r = {}
|
|
1858
1787
|
}) => {
|
|
1859
1788
|
try {
|
|
1860
|
-
const a = t != null && t.data ? t.data(
|
|
1861
|
-
|
|
1789
|
+
const a = t != null && t.data ? t.data(r) : r, s = `Bearer ${e}`, o = await fetch(
|
|
1790
|
+
pt ? `${le.dev}/graphql` : `${le.prod}/graphql`,
|
|
1862
1791
|
{
|
|
1863
1792
|
method: "POST",
|
|
1864
1793
|
credentials: "include",
|
|
1865
1794
|
headers: {
|
|
1866
|
-
authorization:
|
|
1795
|
+
authorization: s,
|
|
1867
1796
|
"Content-Type": "application/json",
|
|
1868
1797
|
Accept: "application/json",
|
|
1869
|
-
[
|
|
1798
|
+
[Be.CLIENT_ID]: `${n}`
|
|
1870
1799
|
},
|
|
1871
1800
|
body: JSON.stringify({
|
|
1872
1801
|
query: t.schema,
|
|
@@ -1876,40 +1805,39 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
|
|
|
1876
1805
|
);
|
|
1877
1806
|
if (o.status !== 200)
|
|
1878
1807
|
return { status: o.status, data: [] };
|
|
1879
|
-
const { data:
|
|
1808
|
+
const { data: i, errors: u } = await o.json();
|
|
1880
1809
|
return {
|
|
1881
1810
|
status: o.status,
|
|
1882
|
-
data:
|
|
1811
|
+
data: i[t.method],
|
|
1883
1812
|
errors: u
|
|
1884
1813
|
};
|
|
1885
1814
|
} catch (a) {
|
|
1886
1815
|
return console.error(a), { status: 500, data: [] };
|
|
1887
1816
|
}
|
|
1888
|
-
},
|
|
1817
|
+
}, ft = async () => {
|
|
1889
1818
|
try {
|
|
1890
|
-
|
|
1891
|
-
return typeof e == "string" ? e : e.hash && typeof e.hash == "string" ? e.hash : "";
|
|
1819
|
+
return await lr();
|
|
1892
1820
|
} catch {
|
|
1893
1821
|
return "";
|
|
1894
1822
|
}
|
|
1895
1823
|
};
|
|
1896
|
-
class
|
|
1897
|
-
constructor(t = null,
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
this.accessToken = t || "", this.refreshToken =
|
|
1824
|
+
class wr {
|
|
1825
|
+
constructor(t = null, n = null) {
|
|
1826
|
+
z(this, "refreshTokenPromise", null);
|
|
1827
|
+
z(this, "accessToken");
|
|
1828
|
+
z(this, "refreshToken");
|
|
1829
|
+
this.accessToken = t || "", this.refreshToken = n || "";
|
|
1902
1830
|
}
|
|
1903
1831
|
async refreshtoken({
|
|
1904
1832
|
clientId: t,
|
|
1905
|
-
userId:
|
|
1906
|
-
nonce:
|
|
1833
|
+
userId: n,
|
|
1834
|
+
nonce: r,
|
|
1907
1835
|
domain: a
|
|
1908
1836
|
}) {
|
|
1909
1837
|
this.refreshTokenPromise || (this.refreshTokenPromise = this._refreshToken({
|
|
1910
1838
|
clientId: t,
|
|
1911
|
-
userId:
|
|
1912
|
-
nonce:
|
|
1839
|
+
userId: n,
|
|
1840
|
+
nonce: r,
|
|
1913
1841
|
domain: a
|
|
1914
1842
|
}));
|
|
1915
1843
|
try {
|
|
@@ -1920,16 +1848,16 @@ class mn {
|
|
|
1920
1848
|
}
|
|
1921
1849
|
async _refreshToken({
|
|
1922
1850
|
clientId: t,
|
|
1923
|
-
userId:
|
|
1924
|
-
nonce:
|
|
1851
|
+
userId: n,
|
|
1852
|
+
nonce: r,
|
|
1925
1853
|
domain: a
|
|
1926
1854
|
}) {
|
|
1927
|
-
const
|
|
1928
|
-
if (
|
|
1929
|
-
const o = await
|
|
1855
|
+
const s = await F(this.refreshToken);
|
|
1856
|
+
if (s && s.payload[I.USER_ID_KEY] !== "") {
|
|
1857
|
+
const o = await mr({
|
|
1930
1858
|
clientId: t,
|
|
1931
|
-
userId:
|
|
1932
|
-
nonce:
|
|
1859
|
+
userId: n,
|
|
1860
|
+
nonce: r,
|
|
1933
1861
|
refreshToken: this.refreshToken,
|
|
1934
1862
|
accessToken: this.accessToken,
|
|
1935
1863
|
domain: a
|
|
@@ -1947,312 +1875,337 @@ class mn {
|
|
|
1947
1875
|
};
|
|
1948
1876
|
}
|
|
1949
1877
|
}
|
|
1950
|
-
const
|
|
1951
|
-
throw new Error(
|
|
1952
|
-
},
|
|
1878
|
+
const W = () => {
|
|
1879
|
+
throw new Error(hr);
|
|
1880
|
+
}, yt = Ct({
|
|
1953
1881
|
isAuthenticated: !1,
|
|
1954
1882
|
isLoading: !1,
|
|
1955
1883
|
authenticationType: null,
|
|
1956
|
-
login:
|
|
1957
|
-
logout:
|
|
1958
|
-
getAccessToken:
|
|
1959
|
-
getIdToken:
|
|
1960
|
-
registeringForPasskey:
|
|
1961
|
-
loginWithPasskey:
|
|
1884
|
+
login: W,
|
|
1885
|
+
logout: W,
|
|
1886
|
+
getAccessToken: W,
|
|
1887
|
+
getIdToken: W,
|
|
1888
|
+
registeringForPasskey: W,
|
|
1889
|
+
loginWithPasskey: W,
|
|
1962
1890
|
logoutReason: ""
|
|
1963
|
-
}),
|
|
1891
|
+
}), Er = kt.createContext({
|
|
1964
1892
|
state: {
|
|
1965
1893
|
isLoading: !0,
|
|
1966
1894
|
isAuthenticated: !1,
|
|
1967
1895
|
authenticationType: null,
|
|
1968
1896
|
user: void 0,
|
|
1969
|
-
logoutReason: ""
|
|
1897
|
+
logoutReason: "",
|
|
1898
|
+
debug: !1
|
|
1970
1899
|
},
|
|
1971
1900
|
dispatch: () => {
|
|
1972
1901
|
}
|
|
1973
|
-
}),
|
|
1902
|
+
}), Sr = (e, t) => (t == null ? void 0 : t.type) === J ? {
|
|
1974
1903
|
...e,
|
|
1975
1904
|
isLoading: t.payload.isLoading
|
|
1976
|
-
} : (t == null ? void 0 : t.type) ===
|
|
1905
|
+
} : (t == null ? void 0 : t.type) === V ? {
|
|
1977
1906
|
...e,
|
|
1978
1907
|
isLoading: !1,
|
|
1979
1908
|
isAuthenticated: !0,
|
|
1980
1909
|
user: t.payload.user,
|
|
1981
1910
|
authenticationType: t.payload.authenticationType,
|
|
1982
1911
|
logoutReason: ""
|
|
1983
|
-
} : (t == null ? void 0 : t.type) ===
|
|
1912
|
+
} : (t == null ? void 0 : t.type) === ht ? {
|
|
1984
1913
|
...e,
|
|
1985
1914
|
isLoading: !1,
|
|
1986
1915
|
isAuthenticated: !1,
|
|
1987
1916
|
user: void 0,
|
|
1988
1917
|
authenticationType: null,
|
|
1989
1918
|
logoutReason: t.payload.logoutReason
|
|
1990
|
-
} : e,
|
|
1919
|
+
} : e, Pr = ({
|
|
1991
1920
|
children: e,
|
|
1992
1921
|
sessionExpiration: t,
|
|
1993
|
-
clientId:
|
|
1994
|
-
domain:
|
|
1922
|
+
clientId: n,
|
|
1923
|
+
domain: r = "",
|
|
1924
|
+
debug: a = !1
|
|
1995
1925
|
}) => {
|
|
1996
|
-
const [
|
|
1926
|
+
const [s, o] = Ot(Sr, {
|
|
1997
1927
|
isLoading: !0,
|
|
1998
1928
|
isAuthenticated: !1,
|
|
1999
1929
|
authenticationType: null,
|
|
2000
1930
|
user: void 0,
|
|
2001
|
-
logoutReason: ""
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
1931
|
+
logoutReason: "",
|
|
1932
|
+
debug: a
|
|
1933
|
+
}), i = Pe(!1), u = Pe(""), [f, y, , h] = ee({
|
|
1934
|
+
key: `${ae}::${n}::@@user@@`
|
|
1935
|
+
}), [p, l, , d] = ee({
|
|
1936
|
+
key: `${ae}::${n}::@@access@@`
|
|
1937
|
+
}), [m, S, , q] = ee(
|
|
2007
1938
|
{
|
|
2008
|
-
key: `${
|
|
1939
|
+
key: `${ae}::${n}::@@refresh@@`
|
|
2009
1940
|
}
|
|
2010
|
-
), [
|
|
2011
|
-
key: `${
|
|
2012
|
-
}),
|
|
2013
|
-
(
|
|
2014
|
-
console.
|
|
2015
|
-
|
|
1941
|
+
), [gt, Ie, , _e] = ee({
|
|
1942
|
+
key: `${ae}::${n}::@@nonce@@`
|
|
1943
|
+
}), w = x(
|
|
1944
|
+
(...c) => {
|
|
1945
|
+
a && console.info(`==> [Auth ${Date.now()}]: `, ...c);
|
|
1946
|
+
},
|
|
1947
|
+
[a]
|
|
1948
|
+
), mt = new wr(p, m), $ = x(
|
|
1949
|
+
(c) => {
|
|
1950
|
+
w(
|
|
1951
|
+
"removeStateAndLocalStorage: removing state and local storage with reason: ",
|
|
1952
|
+
c
|
|
1953
|
+
), o({
|
|
1954
|
+
type: ht,
|
|
2016
1955
|
payload: {
|
|
2017
|
-
logoutReason:
|
|
1956
|
+
logoutReason: c || ne
|
|
2018
1957
|
}
|
|
2019
|
-
}), h(),
|
|
1958
|
+
}), h(), d(), q(), _e(), o({ type: J, payload: { isLoading: !1 } });
|
|
2020
1959
|
},
|
|
2021
|
-
[
|
|
2022
|
-
),
|
|
2023
|
-
async (
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
1960
|
+
[d, h, _e, q, w]
|
|
1961
|
+
), D = x(
|
|
1962
|
+
async (c) => {
|
|
1963
|
+
w("invalidateAndLogout: invalidating and logging out");
|
|
1964
|
+
const { user: E } = s, g = (E == null ? void 0 : E.userId) || fr(f);
|
|
1965
|
+
g || w(
|
|
1966
|
+
"invalidateAndLogout: user cannot be identified, logging out without userId"
|
|
1967
|
+
), await yr({
|
|
1968
|
+
userId: g,
|
|
1969
|
+
idToken: f,
|
|
1970
|
+
accessToken: p,
|
|
1971
|
+
refreshToken: m,
|
|
1972
|
+
clientId: n,
|
|
1973
|
+
domain: r
|
|
1974
|
+
}), $(c || ne);
|
|
2033
1975
|
},
|
|
2034
1976
|
[
|
|
2035
|
-
c,
|
|
2036
|
-
a,
|
|
2037
|
-
r,
|
|
2038
|
-
n,
|
|
2039
|
-
s,
|
|
2040
1977
|
p,
|
|
2041
|
-
|
|
1978
|
+
s,
|
|
1979
|
+
n,
|
|
1980
|
+
r,
|
|
1981
|
+
f,
|
|
1982
|
+
m,
|
|
1983
|
+
$,
|
|
1984
|
+
w
|
|
2042
1985
|
]
|
|
2043
1986
|
);
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
1987
|
+
Te(() => ((async () => (w("useEffect: setting the fingerprint"), u.current = await ft()))(), () => {
|
|
1988
|
+
w("useEffect: cleaning up the fingerprint"), u.current = "";
|
|
1989
|
+
}), []), Te(() => {
|
|
1990
|
+
if (!i.current)
|
|
1991
|
+
return s.isLoading && f !== null ? (async () => {
|
|
2047
1992
|
try {
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2050
|
-
type:
|
|
1993
|
+
const c = await F(f);
|
|
1994
|
+
c && c.payload[I.USER_ID_KEY] !== "" ? (w("useEffect: setting the authentication state"), o({
|
|
1995
|
+
type: V,
|
|
2051
1996
|
payload: {
|
|
2052
|
-
authenticationType:
|
|
1997
|
+
authenticationType: c.payload[I.AUTH_TYPE_KEY],
|
|
2053
1998
|
user: {
|
|
2054
|
-
userId:
|
|
2055
|
-
username:
|
|
1999
|
+
userId: c.payload[I.USER_ID_KEY],
|
|
2000
|
+
username: c.payload[I.USERNAME_KEY]
|
|
2056
2001
|
}
|
|
2057
2002
|
}
|
|
2058
|
-
}) : await
|
|
2003
|
+
})) : (w("useEffect: invalid JWT, invalidating and logging out"), await D(ne));
|
|
2059
2004
|
} catch {
|
|
2060
|
-
|
|
2005
|
+
w(
|
|
2006
|
+
"useEffect: exception validating JWT, invalidating and logging out"
|
|
2007
|
+
), await D(ne);
|
|
2061
2008
|
}
|
|
2062
|
-
})() :
|
|
2063
|
-
|
|
2009
|
+
})() : (w("useEffect: setting the loading state to false"), o({ type: J, payload: { isLoading: !1 } })), () => {
|
|
2010
|
+
i.current = !0;
|
|
2064
2011
|
};
|
|
2065
|
-
}, [
|
|
2066
|
-
const
|
|
2067
|
-
const
|
|
2068
|
-
if (
|
|
2069
|
-
const { code_verifier:
|
|
2070
|
-
nonce:
|
|
2071
|
-
clientId:
|
|
2072
|
-
code_challenge:
|
|
2012
|
+
}, [s.isLoading, f, D, w]);
|
|
2013
|
+
const wt = async (c, E, g) => {
|
|
2014
|
+
const _ = Se();
|
|
2015
|
+
if (Ie(_), o({ type: J, payload: { isLoading: !0 } }), h(), d(), q(), w("login: Logging in with type: ", g), g === j.CODE) {
|
|
2016
|
+
const { code_verifier: bt, code_challenge: It } = await Dn(), ve = await gr({
|
|
2017
|
+
nonce: _,
|
|
2018
|
+
clientId: n,
|
|
2019
|
+
code_challenge: It
|
|
2073
2020
|
});
|
|
2074
|
-
if (
|
|
2075
|
-
const
|
|
2076
|
-
username:
|
|
2077
|
-
password:
|
|
2078
|
-
clientId:
|
|
2021
|
+
if (ve.status) {
|
|
2022
|
+
const G = await Je({
|
|
2023
|
+
username: c,
|
|
2024
|
+
password: E,
|
|
2025
|
+
clientId: n,
|
|
2079
2026
|
sessionExpiration: t,
|
|
2080
|
-
nonce:
|
|
2081
|
-
type:
|
|
2082
|
-
code:
|
|
2083
|
-
code_verifier:
|
|
2084
|
-
domain:
|
|
2085
|
-
fingerprint:
|
|
2027
|
+
nonce: _,
|
|
2028
|
+
type: g,
|
|
2029
|
+
code: ve.code,
|
|
2030
|
+
code_verifier: bt,
|
|
2031
|
+
domain: r,
|
|
2032
|
+
fingerprint: u.current
|
|
2086
2033
|
});
|
|
2087
|
-
return
|
|
2088
|
-
type:
|
|
2034
|
+
return G.status ? (y(G.idToken), l(G.accessToken), S(G.refreshToken), o({
|
|
2035
|
+
type: V,
|
|
2089
2036
|
payload: {
|
|
2090
|
-
authenticationType:
|
|
2037
|
+
authenticationType: g,
|
|
2091
2038
|
user: {
|
|
2092
|
-
userId:
|
|
2093
|
-
username:
|
|
2039
|
+
userId: G.userId,
|
|
2040
|
+
username: c
|
|
2094
2041
|
}
|
|
2095
2042
|
}
|
|
2096
|
-
}), !0) : (
|
|
2043
|
+
}), !0) : ($(re), !1);
|
|
2097
2044
|
}
|
|
2098
2045
|
return !1;
|
|
2099
2046
|
}
|
|
2100
|
-
const
|
|
2101
|
-
username:
|
|
2102
|
-
password:
|
|
2103
|
-
clientId:
|
|
2047
|
+
const M = await Je({
|
|
2048
|
+
username: c,
|
|
2049
|
+
password: E,
|
|
2050
|
+
clientId: n,
|
|
2104
2051
|
sessionExpiration: t,
|
|
2105
|
-
nonce:
|
|
2106
|
-
type:
|
|
2107
|
-
domain:
|
|
2108
|
-
fingerprint:
|
|
2052
|
+
nonce: _,
|
|
2053
|
+
type: g,
|
|
2054
|
+
domain: r,
|
|
2055
|
+
fingerprint: u.current
|
|
2109
2056
|
});
|
|
2110
|
-
return
|
|
2111
|
-
type:
|
|
2057
|
+
return M.status ? (y(M.idToken), l(M.accessToken), S(M.refreshToken), o({
|
|
2058
|
+
type: V,
|
|
2112
2059
|
payload: {
|
|
2113
|
-
authenticationType:
|
|
2060
|
+
authenticationType: g,
|
|
2114
2061
|
user: {
|
|
2115
|
-
userId:
|
|
2116
|
-
username:
|
|
2062
|
+
userId: M.userId,
|
|
2063
|
+
username: c
|
|
2117
2064
|
}
|
|
2118
2065
|
}
|
|
2119
|
-
}), !0) : (
|
|
2120
|
-
},
|
|
2121
|
-
|
|
2122
|
-
},
|
|
2123
|
-
const { isAuthenticated:
|
|
2066
|
+
}), !0) : ($(re), !1);
|
|
2067
|
+
}, Et = async (c) => {
|
|
2068
|
+
c == null || c.preventDefault(), await D(dr);
|
|
2069
|
+
}, St = async () => {
|
|
2070
|
+
const { isAuthenticated: c, user: E } = s;
|
|
2124
2071
|
try {
|
|
2125
|
-
if (
|
|
2126
|
-
if (
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2072
|
+
if (c && E && E.userId) {
|
|
2073
|
+
if (p) {
|
|
2074
|
+
w("getAccessToken");
|
|
2075
|
+
const _ = await F(p);
|
|
2076
|
+
if (_ && _.payload[I.USER_ID_KEY] !== "")
|
|
2077
|
+
return p;
|
|
2130
2078
|
}
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2079
|
+
w("getAccessToken: invalid access token, refreshing it");
|
|
2080
|
+
const g = await mt.refreshtoken({
|
|
2081
|
+
clientId: n,
|
|
2082
|
+
userId: E.userId,
|
|
2083
|
+
nonce: gt,
|
|
2084
|
+
domain: r
|
|
2136
2085
|
});
|
|
2137
|
-
return
|
|
2086
|
+
return g.status && g.status === "success" ? (l(g.newAccessToken), S(g.newRefreshToken), g.newAccessToken) : (w("getAccessToken: invalid refresh token, re-authenticating user"), await D(Ae), "");
|
|
2138
2087
|
}
|
|
2139
|
-
return
|
|
2088
|
+
return w(
|
|
2089
|
+
"getAccessToken: user is not authenticated, cannot get access token"
|
|
2090
|
+
), await D(Ae), "";
|
|
2140
2091
|
} catch {
|
|
2141
|
-
return
|
|
2092
|
+
return w(
|
|
2093
|
+
"getAccessToken: exception occurred, invalidating and logging out"
|
|
2094
|
+
), await D(Ae), "";
|
|
2142
2095
|
}
|
|
2143
|
-
},
|
|
2144
|
-
if (
|
|
2145
|
-
return
|
|
2146
|
-
},
|
|
2147
|
-
const { user:
|
|
2148
|
-
let
|
|
2149
|
-
accessToken:
|
|
2150
|
-
clientId:
|
|
2151
|
-
type:
|
|
2096
|
+
}, At = () => {
|
|
2097
|
+
if (s.isAuthenticated && f)
|
|
2098
|
+
return f;
|
|
2099
|
+
}, Tt = async () => {
|
|
2100
|
+
const { user: c } = s;
|
|
2101
|
+
let E = await L({
|
|
2102
|
+
accessToken: p,
|
|
2103
|
+
clientId: n,
|
|
2104
|
+
type: H.GET_REGISTRATION_OPTIONS,
|
|
2152
2105
|
params: {
|
|
2153
|
-
clientId:
|
|
2154
|
-
id:
|
|
2155
|
-
username:
|
|
2106
|
+
clientId: n,
|
|
2107
|
+
id: c == null ? void 0 : c.userId,
|
|
2108
|
+
username: c == null ? void 0 : c.username
|
|
2156
2109
|
}
|
|
2157
2110
|
});
|
|
2158
|
-
if (
|
|
2111
|
+
if (E.status)
|
|
2159
2112
|
try {
|
|
2160
|
-
const
|
|
2161
|
-
|
|
2162
|
-
accessToken:
|
|
2163
|
-
clientId:
|
|
2164
|
-
type:
|
|
2113
|
+
const g = await Kt(E.data);
|
|
2114
|
+
E = await L({
|
|
2115
|
+
accessToken: p,
|
|
2116
|
+
clientId: n,
|
|
2117
|
+
type: H.VERIFY_REGISTRATION,
|
|
2165
2118
|
params: {
|
|
2166
|
-
clientId:
|
|
2167
|
-
id:
|
|
2168
|
-
username:
|
|
2169
|
-
registration:
|
|
2119
|
+
clientId: n,
|
|
2120
|
+
id: c == null ? void 0 : c.userId,
|
|
2121
|
+
username: c == null ? void 0 : c.username,
|
|
2122
|
+
registration: g
|
|
2170
2123
|
}
|
|
2171
2124
|
});
|
|
2172
2125
|
} catch {
|
|
2173
|
-
return await
|
|
2174
|
-
accessToken:
|
|
2175
|
-
clientId:
|
|
2176
|
-
type:
|
|
2126
|
+
return await L({
|
|
2127
|
+
accessToken: p,
|
|
2128
|
+
clientId: n,
|
|
2129
|
+
type: H.VERIFY_REGISTRATION,
|
|
2177
2130
|
params: {
|
|
2178
|
-
clientId:
|
|
2179
|
-
id:
|
|
2180
|
-
username:
|
|
2131
|
+
clientId: n,
|
|
2132
|
+
id: c == null ? void 0 : c.userId,
|
|
2133
|
+
username: c == null ? void 0 : c.username,
|
|
2181
2134
|
registration: {}
|
|
2182
2135
|
}
|
|
2183
2136
|
}), !1;
|
|
2184
2137
|
}
|
|
2185
|
-
},
|
|
2186
|
-
const
|
|
2187
|
-
|
|
2188
|
-
const
|
|
2189
|
-
let
|
|
2190
|
-
accessToken:
|
|
2191
|
-
clientId:
|
|
2192
|
-
type:
|
|
2138
|
+
}, Rt = async () => {
|
|
2139
|
+
const c = Se();
|
|
2140
|
+
Ie(c), o({ type: J, payload: { isLoading: !0 } }), h(), d(), q(), w("loginWithPasskey");
|
|
2141
|
+
const E = Se();
|
|
2142
|
+
let g = await L({
|
|
2143
|
+
accessToken: p,
|
|
2144
|
+
clientId: n,
|
|
2145
|
+
type: H.GET_AUTHENTICATION_OPTIONS,
|
|
2193
2146
|
params: {
|
|
2194
|
-
id:
|
|
2195
|
-
clientId:
|
|
2147
|
+
id: E,
|
|
2148
|
+
clientId: n
|
|
2196
2149
|
}
|
|
2197
2150
|
});
|
|
2198
|
-
if (
|
|
2151
|
+
if (g.status)
|
|
2199
2152
|
try {
|
|
2200
|
-
const
|
|
2201
|
-
return
|
|
2202
|
-
accessToken:
|
|
2203
|
-
clientId:
|
|
2204
|
-
type:
|
|
2153
|
+
const _ = await Wt(g.data);
|
|
2154
|
+
return g = await L({
|
|
2155
|
+
accessToken: p,
|
|
2156
|
+
clientId: n,
|
|
2157
|
+
type: H.VERIFY_AUTHENTICATION,
|
|
2205
2158
|
params: {
|
|
2206
|
-
clientId:
|
|
2207
|
-
id:
|
|
2208
|
-
authentication:
|
|
2209
|
-
nonce:
|
|
2210
|
-
domain:
|
|
2211
|
-
fingerprint:
|
|
2159
|
+
clientId: n,
|
|
2160
|
+
id: E,
|
|
2161
|
+
authentication: _,
|
|
2162
|
+
nonce: c,
|
|
2163
|
+
domain: r,
|
|
2164
|
+
fingerprint: u.current
|
|
2212
2165
|
}
|
|
2213
|
-
}),
|
|
2214
|
-
type:
|
|
2166
|
+
}), g.data.status === "success" ? (y(g.data.idToken), l(g.data.accessToken), S(g.data.refreshToken), o({
|
|
2167
|
+
type: V,
|
|
2215
2168
|
payload: {
|
|
2216
|
-
authenticationType:
|
|
2169
|
+
authenticationType: j.PASSKEY,
|
|
2217
2170
|
user: {
|
|
2218
|
-
userId:
|
|
2219
|
-
username:
|
|
2171
|
+
userId: g.data.userId,
|
|
2172
|
+
username: g.data.username
|
|
2220
2173
|
}
|
|
2221
2174
|
}
|
|
2222
|
-
}), !0) : (
|
|
2175
|
+
}), !0) : ($(re), !1);
|
|
2223
2176
|
} catch {
|
|
2224
|
-
return await
|
|
2225
|
-
accessToken:
|
|
2226
|
-
clientId:
|
|
2227
|
-
type:
|
|
2177
|
+
return await L({
|
|
2178
|
+
accessToken: p,
|
|
2179
|
+
clientId: n,
|
|
2180
|
+
type: H.VERIFY_AUTHENTICATION,
|
|
2228
2181
|
params: {
|
|
2229
|
-
clientId:
|
|
2230
|
-
id:
|
|
2182
|
+
clientId: n,
|
|
2183
|
+
id: E,
|
|
2231
2184
|
authentication: {},
|
|
2232
|
-
nonce:
|
|
2233
|
-
domain:
|
|
2185
|
+
nonce: c,
|
|
2186
|
+
domain: r
|
|
2234
2187
|
}
|
|
2235
|
-
}),
|
|
2188
|
+
}), $(re), !1;
|
|
2236
2189
|
}
|
|
2237
2190
|
};
|
|
2238
|
-
return /* @__PURE__ */
|
|
2239
|
-
|
|
2191
|
+
return /* @__PURE__ */ ke(Er.Provider, { value: { state: s, dispatch: o }, children: /* @__PURE__ */ ke(
|
|
2192
|
+
yt.Provider,
|
|
2240
2193
|
{
|
|
2241
2194
|
value: {
|
|
2242
|
-
...
|
|
2243
|
-
login:
|
|
2244
|
-
logout:
|
|
2245
|
-
getAccessToken:
|
|
2246
|
-
getIdToken:
|
|
2247
|
-
registeringForPasskey:
|
|
2248
|
-
loginWithPasskey:
|
|
2195
|
+
...s,
|
|
2196
|
+
login: wt,
|
|
2197
|
+
logout: Et,
|
|
2198
|
+
getAccessToken: St,
|
|
2199
|
+
getIdToken: At,
|
|
2200
|
+
registeringForPasskey: Tt,
|
|
2201
|
+
loginWithPasskey: Rt
|
|
2249
2202
|
},
|
|
2250
2203
|
children: e
|
|
2251
2204
|
}
|
|
2252
2205
|
) });
|
|
2253
|
-
},
|
|
2206
|
+
}, Cr = (e = yt) => Nt(e);
|
|
2254
2207
|
export {
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2208
|
+
j as AUTH_TYPES,
|
|
2209
|
+
Pr as AuthProvider,
|
|
2210
|
+
Cr as useAuth
|
|
2258
2211
|
};
|