@versini/sassysaint 4.0.4 → 4.1.0
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/chunks/{App.Bv1AXGNM.js → App.8LsHfy0z.js} +27 -27
- package/dist/chunks/{LazyHeader.B-Inpb_l.js → LazyHeader.D_ViNWrh.js} +467 -468
- package/dist/chunks/{LazyMarkdownWithExtra.AVk47oNE.js → LazyMarkdownWithExtra.B_VU-4Vs.js} +1 -1
- package/dist/chunks/{LazyMessageAssistant.kSKFTYLO.js → LazyMessageAssistant.C7EB2M7r.js} +4 -4
- package/dist/chunks/{index.7JJYsiGN.BMjQHxRo.js → index.7JJYsiGN.BMY0Ig6p.js} +1 -1
- package/dist/chunks/{index.B5_Pppr9.js → index.iWfWxGn2.js} +737 -721
- package/dist/chunks/{useLocalStorage.Bz8cVadw.js → useLocalStorage.ChFZVshd.js} +1 -1
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +4 -4
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as c, jsxs as I, Fragment as
|
|
2
|
-
import V, { createContext as
|
|
3
|
-
import
|
|
4
|
-
var
|
|
1
|
+
import { jsx as c, jsxs as I, Fragment as le } from "react/jsx-runtime";
|
|
2
|
+
import V, { createContext as ar, useReducer as ft, useRef as G, useCallback as z, useEffect as j, useContext as yt, useSyncExternalStore as nr, useId as bt, useMemo as Et, useState as J, useLayoutEffect as or, lazy as wt, Suspense as Tt } from "react";
|
|
3
|
+
import f from "clsx";
|
|
4
|
+
var sr = Object.defineProperty, ir = (e, t, r) => t in e ? sr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Le = (e, t, r) => ir(e, typeof t != "symbol" ? t + "" : t, r);
|
|
5
5
|
/*!
|
|
6
|
-
@versini/auth-provider v7.
|
|
6
|
+
@versini/auth-provider v7.3.0
|
|
7
7
|
© 2024 gizmette.com
|
|
8
8
|
*/
|
|
9
9
|
try {
|
|
10
10
|
window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
|
|
11
|
-
version: "7.
|
|
12
|
-
buildTime: "
|
|
11
|
+
version: "7.3.0",
|
|
12
|
+
buildTime: "09/01/2024 05:46 PM EDT",
|
|
13
13
|
homepage: "https://github.com/aversini/auth-client",
|
|
14
14
|
license: "MIT"
|
|
15
15
|
});
|
|
@@ -22,7 +22,7 @@ function L(e) {
|
|
|
22
22
|
r += String.fromCharCode(a);
|
|
23
23
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Se(e) {
|
|
26
26
|
const t = e.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - t.length % 4) % 4, a = t.padEnd(t.length + r, "="), n = atob(a), o = new ArrayBuffer(n.length), s = new Uint8Array(o);
|
|
27
27
|
for (let i = 0; i < n.length; i++)
|
|
28
28
|
s[i] = n.charCodeAt(i);
|
|
@@ -35,89 +35,89 @@ function It(e) {
|
|
|
35
35
|
const { id: t } = e;
|
|
36
36
|
return {
|
|
37
37
|
...e,
|
|
38
|
-
id:
|
|
38
|
+
id: Se(t),
|
|
39
39
|
transports: e.transports
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function St(e) {
|
|
43
43
|
return e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e);
|
|
44
44
|
}
|
|
45
|
-
let
|
|
45
|
+
let _ = class extends Error {
|
|
46
46
|
constructor({ message: t, code: r, cause: a, name: n }) {
|
|
47
47
|
super(t, { cause: a }), this.name = n ?? a.name, this.code = r;
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
function
|
|
50
|
+
function cr({ error: e, options: t }) {
|
|
51
51
|
var a, n;
|
|
52
52
|
const { publicKey: r } = t;
|
|
53
53
|
if (!r)
|
|
54
54
|
throw Error("options was missing required publicKey property");
|
|
55
55
|
if (e.name === "AbortError") {
|
|
56
56
|
if (t.signal instanceof AbortSignal)
|
|
57
|
-
return new
|
|
57
|
+
return new _({
|
|
58
58
|
message: "Registration ceremony was sent an abort signal",
|
|
59
59
|
code: "ERROR_CEREMONY_ABORTED",
|
|
60
60
|
cause: e
|
|
61
61
|
});
|
|
62
62
|
} else if (e.name === "ConstraintError") {
|
|
63
63
|
if (((a = r.authenticatorSelection) == null ? void 0 : a.requireResidentKey) === !0)
|
|
64
|
-
return new
|
|
64
|
+
return new _({
|
|
65
65
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
66
66
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
67
67
|
cause: e
|
|
68
68
|
});
|
|
69
69
|
if (((n = r.authenticatorSelection) == null ? void 0 : n.userVerification) === "required")
|
|
70
|
-
return new
|
|
70
|
+
return new _({
|
|
71
71
|
message: "User verification was required but no available authenticator supported it",
|
|
72
72
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
73
73
|
cause: e
|
|
74
74
|
});
|
|
75
75
|
} else {
|
|
76
76
|
if (e.name === "InvalidStateError")
|
|
77
|
-
return new
|
|
77
|
+
return new _({
|
|
78
78
|
message: "The authenticator was previously registered",
|
|
79
79
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
80
80
|
cause: e
|
|
81
81
|
});
|
|
82
82
|
if (e.name === "NotAllowedError")
|
|
83
|
-
return new
|
|
83
|
+
return new _({
|
|
84
84
|
message: e.message,
|
|
85
85
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
86
86
|
cause: e
|
|
87
87
|
});
|
|
88
88
|
if (e.name === "NotSupportedError")
|
|
89
|
-
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new
|
|
89
|
+
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new _({
|
|
90
90
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
91
91
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
92
92
|
cause: e
|
|
93
|
-
}) : new
|
|
93
|
+
}) : new _({
|
|
94
94
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
95
95
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
96
96
|
cause: e
|
|
97
97
|
});
|
|
98
98
|
if (e.name === "SecurityError") {
|
|
99
99
|
const o = window.location.hostname;
|
|
100
|
-
if (
|
|
100
|
+
if (St(o)) {
|
|
101
101
|
if (r.rp.id !== o)
|
|
102
|
-
return new
|
|
102
|
+
return new _({
|
|
103
103
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
104
104
|
code: "ERROR_INVALID_RP_ID",
|
|
105
105
|
cause: e
|
|
106
106
|
});
|
|
107
|
-
} else return new
|
|
107
|
+
} else return new _({
|
|
108
108
|
message: `${window.location.hostname} is an invalid domain`,
|
|
109
109
|
code: "ERROR_INVALID_DOMAIN",
|
|
110
110
|
cause: e
|
|
111
111
|
});
|
|
112
112
|
} else if (e.name === "TypeError") {
|
|
113
113
|
if (r.user.id.byteLength < 1 || r.user.id.byteLength > 64)
|
|
114
|
-
return new
|
|
114
|
+
return new _({
|
|
115
115
|
message: "User ID was not between 1 and 64 characters",
|
|
116
116
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
117
117
|
cause: e
|
|
118
118
|
});
|
|
119
119
|
} else if (e.name === "UnknownError")
|
|
120
|
-
return new
|
|
120
|
+
return new _({
|
|
121
121
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
122
122
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
123
123
|
cause: e
|
|
@@ -141,21 +141,21 @@ class lr {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
const At = new lr(),
|
|
145
|
-
function
|
|
146
|
-
if (e && !(
|
|
144
|
+
const At = new lr(), dr = ["cross-platform", "platform"];
|
|
145
|
+
function vt(e) {
|
|
146
|
+
if (e && !(dr.indexOf(e) < 0))
|
|
147
147
|
return e;
|
|
148
148
|
}
|
|
149
|
-
async function
|
|
149
|
+
async function ur(e) {
|
|
150
150
|
var m;
|
|
151
151
|
if (!ze())
|
|
152
152
|
throw new Error("WebAuthn is not supported in this browser");
|
|
153
153
|
const t = { publicKey: {
|
|
154
154
|
...e,
|
|
155
|
-
challenge:
|
|
155
|
+
challenge: Se(e.challenge),
|
|
156
156
|
user: {
|
|
157
157
|
...e.user,
|
|
158
|
-
id:
|
|
158
|
+
id: Se(e.user.id)
|
|
159
159
|
},
|
|
160
160
|
excludeCredentials: (m = e.excludeCredentials) == null ? void 0 : m.map(It)
|
|
161
161
|
} };
|
|
@@ -163,8 +163,8 @@ async function mr(e) {
|
|
|
163
163
|
let r;
|
|
164
164
|
try {
|
|
165
165
|
r = await navigator.credentials.create(t);
|
|
166
|
-
} catch (
|
|
167
|
-
throw
|
|
166
|
+
} catch (l) {
|
|
167
|
+
throw cr({ error: l, options: t });
|
|
168
168
|
}
|
|
169
169
|
if (!r)
|
|
170
170
|
throw new Error("Registration was not completed");
|
|
@@ -175,23 +175,23 @@ async function mr(e) {
|
|
|
175
175
|
if (typeof o.getPublicKeyAlgorithm == "function")
|
|
176
176
|
try {
|
|
177
177
|
u = o.getPublicKeyAlgorithm();
|
|
178
|
-
} catch (
|
|
179
|
-
Me("getPublicKeyAlgorithm()",
|
|
178
|
+
} catch (l) {
|
|
179
|
+
Me("getPublicKeyAlgorithm()", l);
|
|
180
180
|
}
|
|
181
181
|
let h;
|
|
182
182
|
if (typeof o.getPublicKey == "function")
|
|
183
183
|
try {
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
} catch (
|
|
187
|
-
Me("getPublicKey()",
|
|
184
|
+
const l = o.getPublicKey();
|
|
185
|
+
l !== null && (h = L(l));
|
|
186
|
+
} catch (l) {
|
|
187
|
+
Me("getPublicKey()", l);
|
|
188
188
|
}
|
|
189
189
|
let p;
|
|
190
190
|
if (typeof o.getAuthenticatorData == "function")
|
|
191
191
|
try {
|
|
192
192
|
p = L(o.getAuthenticatorData());
|
|
193
|
-
} catch (
|
|
194
|
-
Me("getAuthenticatorData()",
|
|
193
|
+
} catch (l) {
|
|
194
|
+
Me("getAuthenticatorData()", l);
|
|
195
195
|
}
|
|
196
196
|
return {
|
|
197
197
|
id: a,
|
|
@@ -206,53 +206,53 @@ async function mr(e) {
|
|
|
206
206
|
},
|
|
207
207
|
type: s,
|
|
208
208
|
clientExtensionResults: r.getClientExtensionResults(),
|
|
209
|
-
authenticatorAttachment:
|
|
209
|
+
authenticatorAttachment: vt(r.authenticatorAttachment)
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
212
|
function Me(e, t) {
|
|
213
213
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
|
|
214
214
|
`, t);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function mr() {
|
|
217
217
|
if (!ze())
|
|
218
218
|
return new Promise((t) => t(!1));
|
|
219
219
|
const e = window.PublicKeyCredential;
|
|
220
220
|
return e.isConditionalMediationAvailable === void 0 ? new Promise((t) => t(!1)) : e.isConditionalMediationAvailable();
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function hr({ error: e, options: t }) {
|
|
223
223
|
const { publicKey: r } = t;
|
|
224
224
|
if (!r)
|
|
225
225
|
throw Error("options was missing required publicKey property");
|
|
226
226
|
if (e.name === "AbortError") {
|
|
227
227
|
if (t.signal instanceof AbortSignal)
|
|
228
|
-
return new
|
|
228
|
+
return new _({
|
|
229
229
|
message: "Authentication ceremony was sent an abort signal",
|
|
230
230
|
code: "ERROR_CEREMONY_ABORTED",
|
|
231
231
|
cause: e
|
|
232
232
|
});
|
|
233
233
|
} else {
|
|
234
234
|
if (e.name === "NotAllowedError")
|
|
235
|
-
return new
|
|
235
|
+
return new _({
|
|
236
236
|
message: e.message,
|
|
237
237
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
238
238
|
cause: e
|
|
239
239
|
});
|
|
240
240
|
if (e.name === "SecurityError") {
|
|
241
241
|
const a = window.location.hostname;
|
|
242
|
-
if (
|
|
242
|
+
if (St(a)) {
|
|
243
243
|
if (r.rpId !== a)
|
|
244
|
-
return new
|
|
244
|
+
return new _({
|
|
245
245
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
246
246
|
code: "ERROR_INVALID_RP_ID",
|
|
247
247
|
cause: e
|
|
248
248
|
});
|
|
249
|
-
} else return new
|
|
249
|
+
} else return new _({
|
|
250
250
|
message: `${window.location.hostname} is an invalid domain`,
|
|
251
251
|
code: "ERROR_INVALID_DOMAIN",
|
|
252
252
|
cause: e
|
|
253
253
|
});
|
|
254
254
|
} else if (e.name === "UnknownError")
|
|
255
|
-
return new
|
|
255
|
+
return new _({
|
|
256
256
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
257
257
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
258
258
|
cause: e
|
|
@@ -260,19 +260,19 @@ function pr({ error: e, options: t }) {
|
|
|
260
260
|
}
|
|
261
261
|
return e;
|
|
262
262
|
}
|
|
263
|
-
async function
|
|
264
|
-
var m,
|
|
263
|
+
async function pr(e, t = !1) {
|
|
264
|
+
var m, l;
|
|
265
265
|
if (!ze())
|
|
266
266
|
throw new Error("WebAuthn is not supported in this browser");
|
|
267
267
|
let r;
|
|
268
|
-
((m = e.allowCredentials) == null ? void 0 : m.length) !== 0 && (r = (
|
|
268
|
+
((m = e.allowCredentials) == null ? void 0 : m.length) !== 0 && (r = (l = e.allowCredentials) == null ? void 0 : l.map(It));
|
|
269
269
|
const a = {
|
|
270
270
|
...e,
|
|
271
|
-
challenge:
|
|
271
|
+
challenge: Se(e.challenge),
|
|
272
272
|
allowCredentials: r
|
|
273
273
|
}, n = {};
|
|
274
274
|
if (t) {
|
|
275
|
-
if (!await
|
|
275
|
+
if (!await mr())
|
|
276
276
|
throw Error("Browser does not support WebAuthn autofill");
|
|
277
277
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1)
|
|
278
278
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
@@ -282,8 +282,8 @@ async function gr(e, t = !1) {
|
|
|
282
282
|
let o;
|
|
283
283
|
try {
|
|
284
284
|
o = await navigator.credentials.get(n);
|
|
285
|
-
} catch (
|
|
286
|
-
throw
|
|
285
|
+
} catch (d) {
|
|
286
|
+
throw hr({ error: d, options: n });
|
|
287
287
|
}
|
|
288
288
|
if (!o)
|
|
289
289
|
throw new Error("Authentication was not completed");
|
|
@@ -300,23 +300,23 @@ async function gr(e, t = !1) {
|
|
|
300
300
|
},
|
|
301
301
|
type: h,
|
|
302
302
|
clientExtensionResults: o.getClientExtensionResults(),
|
|
303
|
-
authenticatorAttachment:
|
|
303
|
+
authenticatorAttachment: vt(o.authenticatorAttachment)
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
/*!
|
|
307
|
-
@versini/auth-common v4.
|
|
307
|
+
@versini/auth-common v4.1.0
|
|
308
308
|
© 2024 gizmette.com
|
|
309
309
|
*/
|
|
310
310
|
try {
|
|
311
311
|
window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
|
|
312
|
-
version: "4.
|
|
313
|
-
buildTime: "
|
|
312
|
+
version: "4.1.0",
|
|
313
|
+
buildTime: "09/01/2024 05:46 PM EDT",
|
|
314
314
|
homepage: "https://github.com/aversini/auth-client",
|
|
315
315
|
license: "MIT"
|
|
316
316
|
});
|
|
317
317
|
} catch {
|
|
318
318
|
}
|
|
319
|
-
const
|
|
319
|
+
const ne = {
|
|
320
320
|
ID_TOKEN: "id_token",
|
|
321
321
|
ACCESS_TOKEN: "token",
|
|
322
322
|
ID_AND_ACCESS_TOKEN: "id_token token",
|
|
@@ -325,19 +325,20 @@ const _e = {
|
|
|
325
325
|
PASSKEY: "passkey"
|
|
326
326
|
}, kt = {
|
|
327
327
|
CLIENT_ID: "X-Auth-ClientId"
|
|
328
|
-
},
|
|
328
|
+
}, k = {
|
|
329
329
|
ALG: "RS256",
|
|
330
330
|
USER_ID_KEY: "sub",
|
|
331
|
+
USERNAME_KEY: "username",
|
|
332
|
+
EMAIL_KEY: "email",
|
|
331
333
|
TOKEN_ID_KEY: "__raw",
|
|
332
334
|
NONCE_KEY: "_nonce",
|
|
333
|
-
USERNAME_KEY: "username",
|
|
334
335
|
AUTH_TYPE_KEY: "auth_type",
|
|
335
336
|
EXPIRES_AT_KEY: "exp",
|
|
336
337
|
CREATED_AT_KEY: "iat",
|
|
337
338
|
SCOPES_KEY: "scopes",
|
|
338
339
|
CLIENT_ID_KEY: "aud",
|
|
339
340
|
ISSUER: "gizmette.com"
|
|
340
|
-
},
|
|
341
|
+
}, gr = `-----BEGIN PUBLIC KEY-----
|
|
341
342
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
|
|
342
343
|
w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
|
|
343
344
|
i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
|
|
@@ -350,24 +351,24 @@ awIDAQAB
|
|
|
350
351
|
LOGOUT: "logout",
|
|
351
352
|
LOGIN: "login",
|
|
352
353
|
REFRESH: "refresh"
|
|
353
|
-
}, Ne = crypto, _t = (e) => e instanceof CryptoKey,
|
|
354
|
-
function
|
|
354
|
+
}, Ne = crypto, _t = (e) => e instanceof CryptoKey, me = new TextEncoder(), de = new TextDecoder();
|
|
355
|
+
function fr(...e) {
|
|
355
356
|
const t = e.reduce((n, { length: o }) => n + o, 0), r = new Uint8Array(t);
|
|
356
357
|
let a = 0;
|
|
357
358
|
for (const n of e)
|
|
358
359
|
r.set(n, a), a += n.length;
|
|
359
360
|
return r;
|
|
360
361
|
}
|
|
361
|
-
const
|
|
362
|
+
const yr = (e) => {
|
|
362
363
|
const t = atob(e), r = new Uint8Array(t.length);
|
|
363
364
|
for (let a = 0; a < t.length; a++)
|
|
364
365
|
r[a] = t.charCodeAt(a);
|
|
365
366
|
return r;
|
|
366
|
-
},
|
|
367
|
+
}, ie = (e) => {
|
|
367
368
|
let t = e;
|
|
368
369
|
t instanceof Uint8Array && (t = de.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
369
370
|
try {
|
|
370
|
-
return
|
|
371
|
+
return yr(t);
|
|
371
372
|
} catch {
|
|
372
373
|
throw new TypeError("The input to be decoded is not correctly encoded.");
|
|
373
374
|
}
|
|
@@ -397,7 +398,7 @@ class tt extends q {
|
|
|
397
398
|
super(t), this.code = "ERR_JWT_EXPIRED", this.claim = a, this.reason = n, this.payload = r;
|
|
398
399
|
}
|
|
399
400
|
}
|
|
400
|
-
class
|
|
401
|
+
class br extends q {
|
|
401
402
|
constructor() {
|
|
402
403
|
super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
403
404
|
}
|
|
@@ -405,7 +406,7 @@ class Er extends q {
|
|
|
405
406
|
return "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
406
407
|
}
|
|
407
408
|
}
|
|
408
|
-
class
|
|
409
|
+
class F extends q {
|
|
409
410
|
constructor() {
|
|
410
411
|
super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
|
|
411
412
|
}
|
|
@@ -413,14 +414,14 @@ class Y extends q {
|
|
|
413
414
|
return "ERR_JOSE_NOT_SUPPORTED";
|
|
414
415
|
}
|
|
415
416
|
}
|
|
416
|
-
let
|
|
417
|
+
let v = class extends q {
|
|
417
418
|
constructor() {
|
|
418
419
|
super(...arguments), this.code = "ERR_JWS_INVALID";
|
|
419
420
|
}
|
|
420
421
|
static get code() {
|
|
421
422
|
return "ERR_JWS_INVALID";
|
|
422
423
|
}
|
|
423
|
-
},
|
|
424
|
+
}, W = class extends q {
|
|
424
425
|
constructor() {
|
|
425
426
|
super(...arguments), this.code = "ERR_JWT_INVALID";
|
|
426
427
|
}
|
|
@@ -428,7 +429,7 @@ let S = class extends q {
|
|
|
428
429
|
return "ERR_JWT_INVALID";
|
|
429
430
|
}
|
|
430
431
|
};
|
|
431
|
-
class
|
|
432
|
+
class Er extends q {
|
|
432
433
|
constructor() {
|
|
433
434
|
super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
|
|
434
435
|
}
|
|
@@ -439,13 +440,13 @@ class wr extends q {
|
|
|
439
440
|
function B(e, t = "algorithm.name") {
|
|
440
441
|
return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
|
|
441
442
|
}
|
|
442
|
-
function
|
|
443
|
+
function he(e, t) {
|
|
443
444
|
return e.name === t;
|
|
444
445
|
}
|
|
445
446
|
function Ue(e) {
|
|
446
447
|
return parseInt(e.name.slice(4), 10);
|
|
447
448
|
}
|
|
448
|
-
function
|
|
449
|
+
function wr(e) {
|
|
449
450
|
switch (e) {
|
|
450
451
|
case "ES256":
|
|
451
452
|
return "P-256";
|
|
@@ -457,7 +458,7 @@ function Tr(e) {
|
|
|
457
458
|
throw new Error("unreachable");
|
|
458
459
|
}
|
|
459
460
|
}
|
|
460
|
-
function
|
|
461
|
+
function Tr(e, t) {
|
|
461
462
|
if (t.length && !t.some((r) => e.usages.includes(r))) {
|
|
462
463
|
let r = "CryptoKey does not support this operation, its usages must include ";
|
|
463
464
|
if (t.length > 2) {
|
|
@@ -467,12 +468,12 @@ function Ir(e, t) {
|
|
|
467
468
|
throw new TypeError(r);
|
|
468
469
|
}
|
|
469
470
|
}
|
|
470
|
-
function
|
|
471
|
+
function Ir(e, t, ...r) {
|
|
471
472
|
switch (t) {
|
|
472
473
|
case "HS256":
|
|
473
474
|
case "HS384":
|
|
474
475
|
case "HS512": {
|
|
475
|
-
if (!
|
|
476
|
+
if (!he(e.algorithm, "HMAC"))
|
|
476
477
|
throw B("HMAC");
|
|
477
478
|
const a = parseInt(t.slice(2), 10);
|
|
478
479
|
if (Ue(e.algorithm.hash) !== a)
|
|
@@ -482,7 +483,7 @@ function vr(e, t, ...r) {
|
|
|
482
483
|
case "RS256":
|
|
483
484
|
case "RS384":
|
|
484
485
|
case "RS512": {
|
|
485
|
-
if (!
|
|
486
|
+
if (!he(e.algorithm, "RSASSA-PKCS1-v1_5"))
|
|
486
487
|
throw B("RSASSA-PKCS1-v1_5");
|
|
487
488
|
const a = parseInt(t.slice(2), 10);
|
|
488
489
|
if (Ue(e.algorithm.hash) !== a)
|
|
@@ -492,7 +493,7 @@ function vr(e, t, ...r) {
|
|
|
492
493
|
case "PS256":
|
|
493
494
|
case "PS384":
|
|
494
495
|
case "PS512": {
|
|
495
|
-
if (!
|
|
496
|
+
if (!he(e.algorithm, "RSA-PSS"))
|
|
496
497
|
throw B("RSA-PSS");
|
|
497
498
|
const a = parseInt(t.slice(2), 10);
|
|
498
499
|
if (Ue(e.algorithm.hash) !== a)
|
|
@@ -507,9 +508,9 @@ function vr(e, t, ...r) {
|
|
|
507
508
|
case "ES256":
|
|
508
509
|
case "ES384":
|
|
509
510
|
case "ES512": {
|
|
510
|
-
if (!
|
|
511
|
+
if (!he(e.algorithm, "ECDSA"))
|
|
511
512
|
throw B("ECDSA");
|
|
512
|
-
const a =
|
|
513
|
+
const a = wr(t);
|
|
513
514
|
if (e.algorithm.namedCurve !== a)
|
|
514
515
|
throw B(a, "algorithm.namedCurve");
|
|
515
516
|
break;
|
|
@@ -517,7 +518,7 @@ function vr(e, t, ...r) {
|
|
|
517
518
|
default:
|
|
518
519
|
throw new TypeError("CryptoKey does not support this operation");
|
|
519
520
|
}
|
|
520
|
-
|
|
521
|
+
Tr(e, r);
|
|
521
522
|
}
|
|
522
523
|
function Rt(e, t, ...r) {
|
|
523
524
|
var a;
|
|
@@ -531,7 +532,7 @@ const rt = (e, ...t) => Rt("Key must be ", e, ...t);
|
|
|
531
532
|
function Nt(e, t, ...r) {
|
|
532
533
|
return Rt(`Key for the ${e} algorithm must be `, t, ...r);
|
|
533
534
|
}
|
|
534
|
-
const xt = (e) => _t(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
|
|
535
|
+
const xt = (e) => _t(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Ae = ["CryptoKey"], Sr = (...e) => {
|
|
535
536
|
const t = e.filter(Boolean);
|
|
536
537
|
if (t.length === 0 || t.length === 1)
|
|
537
538
|
return !0;
|
|
@@ -550,11 +551,11 @@ const xt = (e) => _t(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) ===
|
|
|
550
551
|
}
|
|
551
552
|
return !0;
|
|
552
553
|
};
|
|
553
|
-
function
|
|
554
|
+
function Ar(e) {
|
|
554
555
|
return typeof e == "object" && e !== null;
|
|
555
556
|
}
|
|
556
|
-
function
|
|
557
|
-
if (!
|
|
557
|
+
function ve(e) {
|
|
558
|
+
if (!Ar(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
558
559
|
return !1;
|
|
559
560
|
if (Object.getPrototypeOf(e) === null)
|
|
560
561
|
return !0;
|
|
@@ -563,14 +564,14 @@ function Ae(e) {
|
|
|
563
564
|
t = Object.getPrototypeOf(t);
|
|
564
565
|
return Object.getPrototypeOf(e) === t;
|
|
565
566
|
}
|
|
566
|
-
const
|
|
567
|
+
const vr = (e, t) => {
|
|
567
568
|
if (e.startsWith("RS") || e.startsWith("PS")) {
|
|
568
569
|
const { modulusLength: r } = t.algorithm;
|
|
569
570
|
if (typeof r != "number" || r < 2048)
|
|
570
571
|
throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
|
|
571
572
|
}
|
|
572
573
|
};
|
|
573
|
-
function
|
|
574
|
+
function kr(e) {
|
|
574
575
|
let t, r;
|
|
575
576
|
switch (e.kty) {
|
|
576
577
|
case "RSA": {
|
|
@@ -595,7 +596,7 @@ function _r(e) {
|
|
|
595
596
|
}, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
|
|
596
597
|
break;
|
|
597
598
|
default:
|
|
598
|
-
throw new
|
|
599
|
+
throw new F('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
599
600
|
}
|
|
600
601
|
break;
|
|
601
602
|
}
|
|
@@ -617,7 +618,7 @@ function _r(e) {
|
|
|
617
618
|
t = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
618
619
|
break;
|
|
619
620
|
default:
|
|
620
|
-
throw new
|
|
621
|
+
throw new F('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
621
622
|
}
|
|
622
623
|
break;
|
|
623
624
|
}
|
|
@@ -633,71 +634,71 @@ function _r(e) {
|
|
|
633
634
|
t = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
634
635
|
break;
|
|
635
636
|
default:
|
|
636
|
-
throw new
|
|
637
|
+
throw new F('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
637
638
|
}
|
|
638
639
|
break;
|
|
639
640
|
}
|
|
640
641
|
default:
|
|
641
|
-
throw new
|
|
642
|
+
throw new F('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
|
|
642
643
|
}
|
|
643
644
|
return { algorithm: t, keyUsages: r };
|
|
644
645
|
}
|
|
645
|
-
const
|
|
646
|
+
const _r = async (e) => {
|
|
646
647
|
if (!e.alg)
|
|
647
648
|
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
648
|
-
const { algorithm: t, keyUsages: r } =
|
|
649
|
+
const { algorithm: t, keyUsages: r } = kr(e), a = [
|
|
649
650
|
t,
|
|
650
651
|
e.ext ?? !1,
|
|
651
652
|
e.key_ops ?? r
|
|
652
653
|
], n = { ...e };
|
|
653
654
|
return delete n.alg, delete n.use, Ne.subtle.importKey("jwk", n, ...a);
|
|
654
|
-
}, Ct = (e) =>
|
|
655
|
+
}, Ct = (e) => ie(e);
|
|
655
656
|
let He, Ke;
|
|
656
657
|
const Ot = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Pt = async (e, t, r, a) => {
|
|
657
658
|
let n = e.get(t);
|
|
658
659
|
if (n != null && n[a])
|
|
659
660
|
return n[a];
|
|
660
|
-
const o = await
|
|
661
|
+
const o = await _r({ ...r, alg: a });
|
|
661
662
|
return n ? n[a] = o : e.set(t, { [a]: o }), o;
|
|
662
|
-
},
|
|
663
|
+
}, Rr = (e, t) => {
|
|
663
664
|
if (Ot(e)) {
|
|
664
665
|
let r = e.export({ format: "jwk" });
|
|
665
666
|
return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? Ct(r.k) : (Ke || (Ke = /* @__PURE__ */ new WeakMap()), Pt(Ke, e, r, t));
|
|
666
667
|
}
|
|
667
668
|
return e;
|
|
668
|
-
},
|
|
669
|
+
}, Nr = (e, t) => {
|
|
669
670
|
if (Ot(e)) {
|
|
670
671
|
let r = e.export({ format: "jwk" });
|
|
671
672
|
return r.k ? Ct(r.k) : (He || (He = /* @__PURE__ */ new WeakMap()), Pt(He, e, r, t));
|
|
672
673
|
}
|
|
673
674
|
return e;
|
|
674
|
-
},
|
|
675
|
+
}, xr = { normalizePublicKey: Rr, normalizePrivateKey: Nr }, Y = (e, t, r = 0) => {
|
|
675
676
|
r === 0 && (t.unshift(t.length), t.unshift(6));
|
|
676
677
|
const a = e.indexOf(t[0], r);
|
|
677
678
|
if (a === -1)
|
|
678
679
|
return !1;
|
|
679
680
|
const n = e.subarray(a, a + t.length);
|
|
680
|
-
return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) ||
|
|
681
|
+
return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) || Y(e, t, a + 1);
|
|
681
682
|
}, at = (e) => {
|
|
682
683
|
switch (!0) {
|
|
683
|
-
case
|
|
684
|
+
case Y(e, [42, 134, 72, 206, 61, 3, 1, 7]):
|
|
684
685
|
return "P-256";
|
|
685
|
-
case
|
|
686
|
+
case Y(e, [43, 129, 4, 0, 34]):
|
|
686
687
|
return "P-384";
|
|
687
|
-
case
|
|
688
|
+
case Y(e, [43, 129, 4, 0, 35]):
|
|
688
689
|
return "P-521";
|
|
689
|
-
case
|
|
690
|
+
case Y(e, [43, 101, 110]):
|
|
690
691
|
return "X25519";
|
|
691
|
-
case
|
|
692
|
+
case Y(e, [43, 101, 111]):
|
|
692
693
|
return "X448";
|
|
693
|
-
case
|
|
694
|
+
case Y(e, [43, 101, 112]):
|
|
694
695
|
return "Ed25519";
|
|
695
|
-
case
|
|
696
|
+
case Y(e, [43, 101, 113]):
|
|
696
697
|
return "Ed448";
|
|
697
698
|
default:
|
|
698
|
-
throw new
|
|
699
|
+
throw new F("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
|
|
699
700
|
}
|
|
700
|
-
},
|
|
701
|
+
}, Cr = async (e, t, r, a, n) => {
|
|
701
702
|
let o, s;
|
|
702
703
|
const i = new Uint8Array(atob(r.replace(e, "")).split("").map((u) => u.charCodeAt(0)));
|
|
703
704
|
switch (a) {
|
|
@@ -741,35 +742,35 @@ const Ot = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
|
|
|
741
742
|
o = { name: at(i) }, s = ["verify"];
|
|
742
743
|
break;
|
|
743
744
|
default:
|
|
744
|
-
throw new
|
|
745
|
+
throw new F('Invalid or unsupported "alg" (Algorithm) value');
|
|
745
746
|
}
|
|
746
747
|
return Ne.subtle.importKey(t, i, o, !1, s);
|
|
747
|
-
},
|
|
748
|
-
async function
|
|
748
|
+
}, Or = (e, t, r) => Cr(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
|
|
749
|
+
async function Pr(e, t, r) {
|
|
749
750
|
if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
|
|
750
751
|
throw new TypeError('"spki" must be SPKI formatted string');
|
|
751
|
-
return
|
|
752
|
+
return Or(e, t);
|
|
752
753
|
}
|
|
753
|
-
const
|
|
754
|
+
const we = (e) => e == null ? void 0 : e[Symbol.toStringTag], Dr = (e, t) => {
|
|
754
755
|
if (!(t instanceof Uint8Array)) {
|
|
755
756
|
if (!xt(t))
|
|
756
|
-
throw new TypeError(Nt(e, t, ...
|
|
757
|
+
throw new TypeError(Nt(e, t, ...Ae, "Uint8Array"));
|
|
757
758
|
if (t.type !== "secret")
|
|
758
|
-
throw new TypeError(`${
|
|
759
|
+
throw new TypeError(`${we(t)} instances for symmetric algorithms must be of type "secret"`);
|
|
759
760
|
}
|
|
760
|
-
},
|
|
761
|
+
}, $r = (e, t, r) => {
|
|
761
762
|
if (!xt(t))
|
|
762
|
-
throw new TypeError(Nt(e, t, ...
|
|
763
|
+
throw new TypeError(Nt(e, t, ...Ae));
|
|
763
764
|
if (t.type === "secret")
|
|
764
|
-
throw new TypeError(`${
|
|
765
|
+
throw new TypeError(`${we(t)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
765
766
|
if (t.algorithm && r === "verify" && t.type === "private")
|
|
766
|
-
throw new TypeError(`${
|
|
767
|
+
throw new TypeError(`${we(t)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
767
768
|
if (t.algorithm && r === "encrypt" && t.type === "private")
|
|
768
|
-
throw new TypeError(`${
|
|
769
|
-
},
|
|
770
|
-
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ?
|
|
769
|
+
throw new TypeError(`${we(t)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
770
|
+
}, Lr = (e, t, r) => {
|
|
771
|
+
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? Dr(e, t) : $r(e, t, r);
|
|
771
772
|
};
|
|
772
|
-
function
|
|
773
|
+
function Mr(e, t, r, a, n) {
|
|
773
774
|
if (n.crit !== void 0 && (a == null ? void 0 : a.crit) === void 0)
|
|
774
775
|
throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
775
776
|
if (!a || a.crit === void 0)
|
|
@@ -780,7 +781,7 @@ function Ur(e, t, r, a, n) {
|
|
|
780
781
|
r !== void 0 ? o = new Map([...Object.entries(r), ...t.entries()]) : o = t;
|
|
781
782
|
for (const s of a.crit) {
|
|
782
783
|
if (!o.has(s))
|
|
783
|
-
throw new
|
|
784
|
+
throw new F(`Extension Header Parameter "${s}" is not recognized`);
|
|
784
785
|
if (n[s] === void 0)
|
|
785
786
|
throw new e(`Extension Header Parameter "${s}" is missing`);
|
|
786
787
|
if (o.get(s) && a[s] === void 0)
|
|
@@ -788,13 +789,13 @@ function Ur(e, t, r, a, n) {
|
|
|
788
789
|
}
|
|
789
790
|
return new Set(a.crit);
|
|
790
791
|
}
|
|
791
|
-
const
|
|
792
|
+
const Ur = (e, t) => {
|
|
792
793
|
if (t !== void 0 && (!Array.isArray(t) || t.some((r) => typeof r != "string")))
|
|
793
794
|
throw new TypeError(`"${e}" option must be an array of strings`);
|
|
794
795
|
if (t)
|
|
795
796
|
return new Set(t);
|
|
796
797
|
};
|
|
797
|
-
function
|
|
798
|
+
function Hr(e, t) {
|
|
798
799
|
const r = `SHA-${e.slice(-3)}`;
|
|
799
800
|
switch (e) {
|
|
800
801
|
case "HS256":
|
|
@@ -816,23 +817,23 @@ function Kr(e, t) {
|
|
|
816
817
|
case "EdDSA":
|
|
817
818
|
return { name: t.name };
|
|
818
819
|
default:
|
|
819
|
-
throw new
|
|
820
|
+
throw new F(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
|
820
821
|
}
|
|
821
822
|
}
|
|
822
|
-
async function
|
|
823
|
-
if (t = await
|
|
824
|
-
return
|
|
823
|
+
async function Kr(e, t, r) {
|
|
824
|
+
if (t = await xr.normalizePublicKey(t, e), _t(t))
|
|
825
|
+
return Ir(t, e, r), t;
|
|
825
826
|
if (t instanceof Uint8Array) {
|
|
826
827
|
if (!e.startsWith("HS"))
|
|
827
|
-
throw new TypeError(rt(t, ...
|
|
828
|
+
throw new TypeError(rt(t, ...Ae));
|
|
828
829
|
return Ne.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
|
|
829
830
|
}
|
|
830
|
-
throw new TypeError(rt(t, ...
|
|
831
|
+
throw new TypeError(rt(t, ...Ae, "Uint8Array"));
|
|
831
832
|
}
|
|
832
|
-
const
|
|
833
|
-
const n = await
|
|
834
|
-
|
|
835
|
-
const o =
|
|
833
|
+
const Br = async (e, t, r, a) => {
|
|
834
|
+
const n = await Kr(e, t, "verify");
|
|
835
|
+
vr(e, n);
|
|
836
|
+
const o = Hr(e, n.algorithm);
|
|
836
837
|
try {
|
|
837
838
|
return await Ne.subtle.verify(o, n, r, a);
|
|
838
839
|
} catch {
|
|
@@ -840,79 +841,79 @@ const Gr = async (e, t, r, a) => {
|
|
|
840
841
|
}
|
|
841
842
|
};
|
|
842
843
|
async function Wr(e, t, r) {
|
|
843
|
-
if (!
|
|
844
|
-
throw new
|
|
844
|
+
if (!ve(e))
|
|
845
|
+
throw new v("Flattened JWS must be an object");
|
|
845
846
|
if (e.protected === void 0 && e.header === void 0)
|
|
846
|
-
throw new
|
|
847
|
+
throw new v('Flattened JWS must have either of the "protected" or "header" members');
|
|
847
848
|
if (e.protected !== void 0 && typeof e.protected != "string")
|
|
848
|
-
throw new
|
|
849
|
+
throw new v("JWS Protected Header incorrect type");
|
|
849
850
|
if (e.payload === void 0)
|
|
850
|
-
throw new
|
|
851
|
+
throw new v("JWS Payload missing");
|
|
851
852
|
if (typeof e.signature != "string")
|
|
852
|
-
throw new
|
|
853
|
-
if (e.header !== void 0 && !
|
|
854
|
-
throw new
|
|
853
|
+
throw new v("JWS Signature missing or incorrect type");
|
|
854
|
+
if (e.header !== void 0 && !ve(e.header))
|
|
855
|
+
throw new v("JWS Unprotected Header incorrect type");
|
|
855
856
|
let a = {};
|
|
856
857
|
if (e.protected)
|
|
857
858
|
try {
|
|
858
|
-
const
|
|
859
|
-
a = JSON.parse(de.decode(
|
|
859
|
+
const y = ie(e.protected);
|
|
860
|
+
a = JSON.parse(de.decode(y));
|
|
860
861
|
} catch {
|
|
861
|
-
throw new
|
|
862
|
+
throw new v("JWS Protected Header is invalid");
|
|
862
863
|
}
|
|
863
|
-
if (!
|
|
864
|
-
throw new
|
|
864
|
+
if (!Sr(a, e.header))
|
|
865
|
+
throw new v("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
865
866
|
const n = {
|
|
866
867
|
...a,
|
|
867
868
|
...e.header
|
|
868
|
-
}, o =
|
|
869
|
+
}, o = Mr(v, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
|
|
869
870
|
let s = !0;
|
|
870
871
|
if (o.has("b64") && (s = a.b64, typeof s != "boolean"))
|
|
871
|
-
throw new
|
|
872
|
+
throw new v('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
872
873
|
const { alg: i } = n;
|
|
873
874
|
if (typeof i != "string" || !i)
|
|
874
|
-
throw new
|
|
875
|
-
const u = r &&
|
|
875
|
+
throw new v('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
876
|
+
const u = r && Ur("algorithms", r.algorithms);
|
|
876
877
|
if (u && !u.has(i))
|
|
877
|
-
throw new
|
|
878
|
+
throw new br('"alg" (Algorithm) Header Parameter value not allowed');
|
|
878
879
|
if (s) {
|
|
879
880
|
if (typeof e.payload != "string")
|
|
880
|
-
throw new
|
|
881
|
+
throw new v("JWS Payload must be a string");
|
|
881
882
|
} else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
|
|
882
|
-
throw new
|
|
883
|
+
throw new v("JWS Payload must be a string or an Uint8Array instance");
|
|
883
884
|
let h = !1;
|
|
884
|
-
typeof t == "function" && (t = await t(a, e), h = !0),
|
|
885
|
-
const p =
|
|
885
|
+
typeof t == "function" && (t = await t(a, e), h = !0), Lr(i, t, "verify");
|
|
886
|
+
const p = fr(me.encode(e.protected ?? ""), me.encode("."), typeof e.payload == "string" ? me.encode(e.payload) : e.payload);
|
|
886
887
|
let m;
|
|
887
888
|
try {
|
|
888
|
-
m =
|
|
889
|
+
m = ie(e.signature);
|
|
889
890
|
} catch {
|
|
890
|
-
throw new
|
|
891
|
+
throw new v("Failed to base64url decode the signature");
|
|
891
892
|
}
|
|
892
|
-
if (!await
|
|
893
|
-
throw new
|
|
894
|
-
let
|
|
893
|
+
if (!await Br(i, t, m, p))
|
|
894
|
+
throw new Er();
|
|
895
|
+
let l;
|
|
895
896
|
if (s)
|
|
896
897
|
try {
|
|
897
|
-
|
|
898
|
+
l = ie(e.payload);
|
|
898
899
|
} catch {
|
|
899
|
-
throw new
|
|
900
|
+
throw new v("Failed to base64url decode the payload");
|
|
900
901
|
}
|
|
901
|
-
else typeof e.payload == "string" ?
|
|
902
|
-
const
|
|
903
|
-
return e.protected !== void 0 && (
|
|
902
|
+
else typeof e.payload == "string" ? l = me.encode(e.payload) : l = e.payload;
|
|
903
|
+
const d = { payload: l };
|
|
904
|
+
return e.protected !== void 0 && (d.protectedHeader = a), e.header !== void 0 && (d.unprotectedHeader = e.header), h ? { ...d, key: t } : d;
|
|
904
905
|
}
|
|
905
|
-
async function
|
|
906
|
+
async function Gr(e, t, r) {
|
|
906
907
|
if (e instanceof Uint8Array && (e = de.decode(e)), typeof e != "string")
|
|
907
|
-
throw new
|
|
908
|
+
throw new v("Compact JWS must be a string or Uint8Array");
|
|
908
909
|
const { 0: a, 1: n, 2: o, length: s } = e.split(".");
|
|
909
910
|
if (s !== 3)
|
|
910
|
-
throw new
|
|
911
|
+
throw new v("Invalid Compact JWS");
|
|
911
912
|
const i = await Wr({ payload: n, protected: a, signature: o }, t, r), u = { payload: i.payload, protectedHeader: i.protectedHeader };
|
|
912
913
|
return typeof t == "function" ? { ...u, key: i.key } : u;
|
|
913
914
|
}
|
|
914
|
-
const
|
|
915
|
-
const t =
|
|
915
|
+
const Vr = (e) => Math.floor(e.getTime() / 1e3), Dt = 60, $t = Dt * 60, je = $t * 24, Yr = je * 7, Jr = je * 365.25, Fr = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, nt = (e) => {
|
|
916
|
+
const t = Fr.exec(e);
|
|
916
917
|
if (!t || t[4] && t[1])
|
|
917
918
|
throw new TypeError("Invalid time period format");
|
|
918
919
|
const r = parseFloat(t[2]), a = t[3].toLowerCase();
|
|
@@ -947,34 +948,34 @@ const Jr = (e) => Math.floor(e.getTime() / 1e3), Dt = 60, $t = Dt * 60, je = $t
|
|
|
947
948
|
case "week":
|
|
948
949
|
case "weeks":
|
|
949
950
|
case "w":
|
|
950
|
-
n = Math.round(r *
|
|
951
|
+
n = Math.round(r * Yr);
|
|
951
952
|
break;
|
|
952
953
|
default:
|
|
953
|
-
n = Math.round(r *
|
|
954
|
+
n = Math.round(r * Jr);
|
|
954
955
|
break;
|
|
955
956
|
}
|
|
956
957
|
return t[1] === "-" || t[4] === "ago" ? -n : n;
|
|
957
|
-
}, ot = (e) => e.toLowerCase().replace(/^application\//, ""),
|
|
958
|
+
}, ot = (e) => e.toLowerCase().replace(/^application\//, ""), zr = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, jr = (e, t, r = {}) => {
|
|
958
959
|
let a;
|
|
959
960
|
try {
|
|
960
961
|
a = JSON.parse(de.decode(t));
|
|
961
962
|
} catch {
|
|
962
963
|
}
|
|
963
|
-
if (!
|
|
964
|
-
throw new
|
|
964
|
+
if (!ve(a))
|
|
965
|
+
throw new W("JWT Claims Set must be a top-level JSON object");
|
|
965
966
|
const { typ: n } = r;
|
|
966
967
|
if (n && (typeof e.typ != "string" || ot(e.typ) !== ot(n)))
|
|
967
968
|
throw new $('unexpected "typ" JWT header value', a, "typ", "check_failed");
|
|
968
969
|
const { requiredClaims: o = [], issuer: s, subject: i, audience: u, maxTokenAge: h } = r, p = [...o];
|
|
969
970
|
h !== void 0 && p.push("iat"), u !== void 0 && p.push("aud"), i !== void 0 && p.push("sub"), s !== void 0 && p.push("iss");
|
|
970
|
-
for (const
|
|
971
|
-
if (!(
|
|
972
|
-
throw new $(`missing required "${
|
|
971
|
+
for (const y of new Set(p.reverse()))
|
|
972
|
+
if (!(y in a))
|
|
973
|
+
throw new $(`missing required "${y}" claim`, a, y, "missing");
|
|
973
974
|
if (s && !(Array.isArray(s) ? s : [s]).includes(a.iss))
|
|
974
975
|
throw new $('unexpected "iss" claim value', a, "iss", "check_failed");
|
|
975
976
|
if (i && a.sub !== i)
|
|
976
977
|
throw new $('unexpected "sub" claim value', a, "sub", "check_failed");
|
|
977
|
-
if (u && !
|
|
978
|
+
if (u && !zr(a.aud, typeof u == "string" ? [u] : u))
|
|
978
979
|
throw new $('unexpected "aud" claim value', a, "aud", "check_failed");
|
|
979
980
|
let m;
|
|
980
981
|
switch (typeof r.clockTolerance) {
|
|
@@ -990,117 +991,117 @@ const Jr = (e) => Math.floor(e.getTime() / 1e3), Dt = 60, $t = Dt * 60, je = $t
|
|
|
990
991
|
default:
|
|
991
992
|
throw new TypeError("Invalid clockTolerance option type");
|
|
992
993
|
}
|
|
993
|
-
const { currentDate:
|
|
994
|
+
const { currentDate: l } = r, d = Vr(l || /* @__PURE__ */ new Date());
|
|
994
995
|
if ((a.iat !== void 0 || h) && typeof a.iat != "number")
|
|
995
996
|
throw new $('"iat" claim must be a number', a, "iat", "invalid");
|
|
996
997
|
if (a.nbf !== void 0) {
|
|
997
998
|
if (typeof a.nbf != "number")
|
|
998
999
|
throw new $('"nbf" claim must be a number', a, "nbf", "invalid");
|
|
999
|
-
if (a.nbf >
|
|
1000
|
+
if (a.nbf > d + m)
|
|
1000
1001
|
throw new $('"nbf" claim timestamp check failed', a, "nbf", "check_failed");
|
|
1001
1002
|
}
|
|
1002
1003
|
if (a.exp !== void 0) {
|
|
1003
1004
|
if (typeof a.exp != "number")
|
|
1004
1005
|
throw new $('"exp" claim must be a number', a, "exp", "invalid");
|
|
1005
|
-
if (a.exp <=
|
|
1006
|
+
if (a.exp <= d - m)
|
|
1006
1007
|
throw new tt('"exp" claim timestamp check failed', a, "exp", "check_failed");
|
|
1007
1008
|
}
|
|
1008
1009
|
if (h) {
|
|
1009
|
-
const
|
|
1010
|
-
if (
|
|
1010
|
+
const y = d - a.iat, E = typeof h == "number" ? h : nt(h);
|
|
1011
|
+
if (y - m > E)
|
|
1011
1012
|
throw new tt('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
|
|
1012
|
-
if (
|
|
1013
|
+
if (y < 0 - m)
|
|
1013
1014
|
throw new $('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
|
|
1014
1015
|
}
|
|
1015
1016
|
return a;
|
|
1016
1017
|
};
|
|
1017
|
-
async function
|
|
1018
|
+
async function qr(e, t, r) {
|
|
1018
1019
|
var a;
|
|
1019
|
-
const n = await
|
|
1020
|
+
const n = await Gr(e, t, r);
|
|
1020
1021
|
if ((a = n.protectedHeader.crit) != null && a.includes("b64") && n.protectedHeader.b64 === !1)
|
|
1021
|
-
throw new
|
|
1022
|
-
const o = { payload:
|
|
1022
|
+
throw new W("JWTs MUST NOT use unencoded payload");
|
|
1023
|
+
const o = { payload: jr(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
|
|
1023
1024
|
return typeof t == "function" ? { ...o, key: n.key } : o;
|
|
1024
1025
|
}
|
|
1025
|
-
const
|
|
1026
|
-
function
|
|
1026
|
+
const Qr = ie;
|
|
1027
|
+
function Xr(e) {
|
|
1027
1028
|
if (typeof e != "string")
|
|
1028
|
-
throw new
|
|
1029
|
+
throw new W("JWTs must use Compact JWS serialization, JWT must be a string");
|
|
1029
1030
|
const { 1: t, length: r } = e.split(".");
|
|
1030
1031
|
if (r === 5)
|
|
1031
|
-
throw new
|
|
1032
|
+
throw new W("Only JWTs using Compact JWS serialization can be decoded");
|
|
1032
1033
|
if (r !== 3)
|
|
1033
|
-
throw new
|
|
1034
|
+
throw new W("Invalid JWT");
|
|
1034
1035
|
if (!t)
|
|
1035
|
-
throw new
|
|
1036
|
+
throw new W("JWTs must contain a payload");
|
|
1036
1037
|
let a;
|
|
1037
1038
|
try {
|
|
1038
|
-
a =
|
|
1039
|
+
a = Qr(t);
|
|
1039
1040
|
} catch {
|
|
1040
|
-
throw new
|
|
1041
|
+
throw new W("Failed to base64url decode the payload");
|
|
1041
1042
|
}
|
|
1042
1043
|
let n;
|
|
1043
1044
|
try {
|
|
1044
1045
|
n = JSON.parse(de.decode(a));
|
|
1045
1046
|
} catch {
|
|
1046
|
-
throw new
|
|
1047
|
+
throw new W("Failed to parse the decoded payload as JSON");
|
|
1047
1048
|
}
|
|
1048
|
-
if (!
|
|
1049
|
-
throw new
|
|
1049
|
+
if (!ve(n))
|
|
1050
|
+
throw new W("Invalid JWT Claims Set");
|
|
1050
1051
|
return n;
|
|
1051
1052
|
}
|
|
1052
|
-
const
|
|
1053
|
+
const ce = async (e) => {
|
|
1053
1054
|
try {
|
|
1054
|
-
const t =
|
|
1055
|
-
return await
|
|
1056
|
-
issuer:
|
|
1055
|
+
const t = k.ALG, r = await Pr(gr, t);
|
|
1056
|
+
return await qr(e, r, {
|
|
1057
|
+
issuer: k.ISSUER
|
|
1057
1058
|
});
|
|
1058
1059
|
} catch {
|
|
1059
1060
|
return;
|
|
1060
1061
|
}
|
|
1061
|
-
},
|
|
1062
|
+
}, Zr = (e) => {
|
|
1062
1063
|
try {
|
|
1063
|
-
return
|
|
1064
|
+
return Xr(e);
|
|
1064
1065
|
} catch {
|
|
1065
1066
|
return;
|
|
1066
1067
|
}
|
|
1067
1068
|
};
|
|
1068
|
-
var
|
|
1069
|
+
var S = [];
|
|
1069
1070
|
for (var Be = 0; Be < 256; ++Be)
|
|
1070
|
-
|
|
1071
|
-
function
|
|
1072
|
-
return (
|
|
1071
|
+
S.push((Be + 256).toString(16).slice(1));
|
|
1072
|
+
function ea(e, t = 0) {
|
|
1073
|
+
return (S[e[t + 0]] + S[e[t + 1]] + S[e[t + 2]] + S[e[t + 3]] + "-" + S[e[t + 4]] + S[e[t + 5]] + "-" + S[e[t + 6]] + S[e[t + 7]] + "-" + S[e[t + 8]] + S[e[t + 9]] + "-" + S[e[t + 10]] + S[e[t + 11]] + S[e[t + 12]] + S[e[t + 13]] + S[e[t + 14]] + S[e[t + 15]]).toLowerCase();
|
|
1073
1074
|
}
|
|
1074
|
-
var
|
|
1075
|
-
function
|
|
1076
|
-
if (!
|
|
1075
|
+
var pe, ta = new Uint8Array(16);
|
|
1076
|
+
function ra() {
|
|
1077
|
+
if (!pe && (pe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !pe))
|
|
1077
1078
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1078
|
-
return
|
|
1079
|
+
return pe(ta);
|
|
1079
1080
|
}
|
|
1080
|
-
var
|
|
1081
|
+
var aa = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1081
1082
|
const st = {
|
|
1082
|
-
randomUUID:
|
|
1083
|
+
randomUUID: aa
|
|
1083
1084
|
};
|
|
1084
1085
|
function it(e, t, r) {
|
|
1085
1086
|
if (st.randomUUID && !t && !e)
|
|
1086
1087
|
return st.randomUUID();
|
|
1087
1088
|
e = e || {};
|
|
1088
|
-
var a = e.random || (e.rng ||
|
|
1089
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
1089
|
+
var a = e.random || (e.rng || ra)();
|
|
1090
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, ea(a);
|
|
1090
1091
|
}
|
|
1091
|
-
const ct = globalThis.crypto,
|
|
1092
|
+
const ct = globalThis.crypto, na = (e) => `${it()}${it()}`.slice(0, e), oa = (e) => btoa(
|
|
1092
1093
|
[...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
|
|
1093
1094
|
);
|
|
1094
|
-
async function
|
|
1095
|
+
async function sa(e) {
|
|
1095
1096
|
if (!ct.subtle)
|
|
1096
1097
|
throw new Error(
|
|
1097
1098
|
"crypto.subtle is available only in secure contexts (HTTPS)."
|
|
1098
1099
|
);
|
|
1099
1100
|
const t = new TextEncoder().encode(e), r = await ct.subtle.digest("SHA-256", t);
|
|
1100
|
-
return
|
|
1101
|
+
return oa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
1101
1102
|
}
|
|
1102
|
-
async function
|
|
1103
|
-
const t =
|
|
1103
|
+
async function ia(e) {
|
|
1104
|
+
const t = na(43), r = await sa(t);
|
|
1104
1105
|
return {
|
|
1105
1106
|
code_verifier: t,
|
|
1106
1107
|
code_challenge: r
|
|
@@ -1109,23 +1110,23 @@ async function ca(e) {
|
|
|
1109
1110
|
function Lt(e, t) {
|
|
1110
1111
|
window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
|
|
1111
1112
|
}
|
|
1112
|
-
const
|
|
1113
|
+
const lt = (e, t) => {
|
|
1113
1114
|
const r = JSON.stringify(
|
|
1114
1115
|
typeof t == "function" ? t() : t
|
|
1115
1116
|
);
|
|
1116
1117
|
window.localStorage.setItem(e, r), Lt(e, r);
|
|
1117
|
-
},
|
|
1118
|
+
}, ca = (e) => {
|
|
1118
1119
|
window.localStorage.removeItem(e), Lt(e, null);
|
|
1119
|
-
},
|
|
1120
|
-
function
|
|
1120
|
+
}, dt = (e) => window.localStorage.getItem(e), la = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
|
|
1121
|
+
function ge({
|
|
1121
1122
|
key: e,
|
|
1122
1123
|
initialValue: t
|
|
1123
1124
|
}) {
|
|
1124
|
-
const r =
|
|
1125
|
+
const r = nr(la, () => dt(e)), a = z(
|
|
1125
1126
|
(s) => {
|
|
1126
1127
|
try {
|
|
1127
1128
|
const i = typeof s == "function" ? s(JSON.parse(r)) : s;
|
|
1128
|
-
i == null ?
|
|
1129
|
+
i == null ? ca(e) : lt(e, i);
|
|
1129
1130
|
} catch (i) {
|
|
1130
1131
|
console.warn(i);
|
|
1131
1132
|
}
|
|
@@ -1138,39 +1139,39 @@ function pe({
|
|
|
1138
1139
|
}, [a]);
|
|
1139
1140
|
return j(() => {
|
|
1140
1141
|
try {
|
|
1141
|
-
|
|
1142
|
+
dt(e) === null && typeof t < "u" && lt(e, t);
|
|
1142
1143
|
} catch (s) {
|
|
1143
1144
|
console.warn(s);
|
|
1144
1145
|
}
|
|
1145
1146
|
}, [e, t]), [r ? JSON.parse(r) : null, a, n, o];
|
|
1146
1147
|
}
|
|
1147
1148
|
var A = [];
|
|
1148
|
-
for (var
|
|
1149
|
-
A.push((
|
|
1150
|
-
function
|
|
1149
|
+
for (var We = 0; We < 256; ++We)
|
|
1150
|
+
A.push((We + 256).toString(16).slice(1));
|
|
1151
|
+
function da(e, t = 0) {
|
|
1151
1152
|
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();
|
|
1152
1153
|
}
|
|
1153
|
-
var
|
|
1154
|
-
function
|
|
1155
|
-
if (!
|
|
1154
|
+
var fe, ua = new Uint8Array(16);
|
|
1155
|
+
function ma() {
|
|
1156
|
+
if (!fe && (fe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !fe))
|
|
1156
1157
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1157
|
-
return
|
|
1158
|
+
return fe(ua);
|
|
1158
1159
|
}
|
|
1159
|
-
var
|
|
1160
|
+
var ha = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1160
1161
|
const ut = {
|
|
1161
|
-
randomUUID:
|
|
1162
|
+
randomUUID: ha
|
|
1162
1163
|
};
|
|
1163
|
-
function
|
|
1164
|
+
function Ge(e, t, r) {
|
|
1164
1165
|
if (ut.randomUUID && !t && !e)
|
|
1165
1166
|
return ut.randomUUID();
|
|
1166
1167
|
e = e || {};
|
|
1167
|
-
var a = e.random || (e.rng ||
|
|
1168
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
1168
|
+
var a = e.random || (e.rng || ma)();
|
|
1169
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, da(a);
|
|
1169
1170
|
}
|
|
1170
|
-
const
|
|
1171
|
+
const Z = "Your session has expired. For your security, please log in again to continue.", pa = "Your session has been successfully terminated.", Ve = "Login failed. Please try again.", ga = "Error getting access token, please re-authenticate.", fa = "You forgot to wrap your component in <AuthProvider>.", ke = {
|
|
1171
1172
|
dev: "https://auth.gizmette.local.com:3003",
|
|
1172
1173
|
prod: "https://mylogin.gizmette.com/auth"
|
|
1173
|
-
},
|
|
1174
|
+
}, ye = "@@auth@@", se = "LOADING", Te = "LOGIN", Mt = "LOGOUT", ue = "success", M = "failure", Ut = "include", Ht = "POST", Kt = "application/json", be = {
|
|
1174
1175
|
GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
|
|
1175
1176
|
$clientId: String!,
|
|
1176
1177
|
$username: String!,
|
|
@@ -1248,26 +1249,27 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1248
1249
|
refreshToken,
|
|
1249
1250
|
userId,
|
|
1250
1251
|
username,
|
|
1252
|
+
email
|
|
1251
1253
|
}
|
|
1252
1254
|
}`
|
|
1253
|
-
},
|
|
1255
|
+
}, ee = {
|
|
1254
1256
|
GET_REGISTRATION_OPTIONS: {
|
|
1255
|
-
schema:
|
|
1257
|
+
schema: be.GET_REGISTRATION_OPTIONS,
|
|
1256
1258
|
method: "getPasskeyRegistrationOptions"
|
|
1257
1259
|
},
|
|
1258
1260
|
VERIFY_REGISTRATION: {
|
|
1259
|
-
schema:
|
|
1261
|
+
schema: be.VERIFY_REGISTRATION,
|
|
1260
1262
|
method: "verifyPasskeyRegistration"
|
|
1261
1263
|
},
|
|
1262
1264
|
GET_AUTHENTICATION_OPTIONS: {
|
|
1263
|
-
schema:
|
|
1265
|
+
schema: be.GET_AUTHENTICATION_OPTIONS,
|
|
1264
1266
|
method: "getPasskeyAuthenticationOptions"
|
|
1265
1267
|
},
|
|
1266
1268
|
VERIFY_AUTHENTICATION: {
|
|
1267
|
-
schema:
|
|
1269
|
+
schema: be.VERIFY_AUTHENTICATION,
|
|
1268
1270
|
method: "verifyPasskeyAuthentication"
|
|
1269
1271
|
}
|
|
1270
|
-
},
|
|
1272
|
+
}, te = async ({
|
|
1271
1273
|
accessToken: e,
|
|
1272
1274
|
type: t,
|
|
1273
1275
|
clientId: r,
|
|
@@ -1275,7 +1277,7 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1275
1277
|
}) => {
|
|
1276
1278
|
try {
|
|
1277
1279
|
const n = `Bearer ${e}`, o = await fetch(
|
|
1278
|
-
Bt ? `${
|
|
1280
|
+
Bt ? `${ke.dev}/graphql` : `${ke.prod}/graphql`,
|
|
1279
1281
|
{
|
|
1280
1282
|
credentials: Ut,
|
|
1281
1283
|
method: Ht,
|
|
@@ -1294,7 +1296,7 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1294
1296
|
return { status: M, data: [] };
|
|
1295
1297
|
const { data: s } = await o.json();
|
|
1296
1298
|
return {
|
|
1297
|
-
status:
|
|
1299
|
+
status: ue,
|
|
1298
1300
|
data: s[t.method]
|
|
1299
1301
|
};
|
|
1300
1302
|
} catch (n) {
|
|
@@ -1307,7 +1309,7 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1307
1309
|
}) => {
|
|
1308
1310
|
try {
|
|
1309
1311
|
const a = await fetch(
|
|
1310
|
-
Bt ? `${
|
|
1312
|
+
Bt ? `${ke.dev}/${e}` : `${ke.prod}/${e}`,
|
|
1311
1313
|
{
|
|
1312
1314
|
credentials: Ut,
|
|
1313
1315
|
method: Ht,
|
|
@@ -1322,26 +1324,27 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1322
1324
|
return { status: M, data: [] };
|
|
1323
1325
|
const { data: n } = await a.json();
|
|
1324
1326
|
return {
|
|
1325
|
-
status:
|
|
1327
|
+
status: ue,
|
|
1326
1328
|
data: n || []
|
|
1327
1329
|
};
|
|
1328
1330
|
} catch (a) {
|
|
1329
1331
|
return console.error(a), { status: M, data: [] };
|
|
1330
1332
|
}
|
|
1331
|
-
},
|
|
1333
|
+
}, ya = process.env.NODE_ENV === "production", Bt = !ya, Wt = {
|
|
1332
1334
|
isLoading: !0,
|
|
1333
1335
|
isAuthenticated: !1,
|
|
1334
1336
|
user: void 0,
|
|
1335
1337
|
logoutReason: "",
|
|
1336
|
-
debug: !1
|
|
1337
|
-
|
|
1338
|
+
debug: !1,
|
|
1339
|
+
authenticationType: ""
|
|
1340
|
+
}, ba = (e) => {
|
|
1338
1341
|
try {
|
|
1339
|
-
const t =
|
|
1340
|
-
return t ? t[
|
|
1342
|
+
const t = Zr(e);
|
|
1343
|
+
return t ? t[k.USER_ID_KEY] : "";
|
|
1341
1344
|
} catch {
|
|
1342
1345
|
return "";
|
|
1343
1346
|
}
|
|
1344
|
-
},
|
|
1347
|
+
}, Ea = async ({
|
|
1345
1348
|
userId: e,
|
|
1346
1349
|
clientId: t,
|
|
1347
1350
|
domain: r,
|
|
@@ -1365,7 +1368,7 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1365
1368
|
status: M
|
|
1366
1369
|
};
|
|
1367
1370
|
}
|
|
1368
|
-
},
|
|
1371
|
+
}, wa = async ({
|
|
1369
1372
|
username: e,
|
|
1370
1373
|
password: t,
|
|
1371
1374
|
clientId: r,
|
|
@@ -1383,7 +1386,7 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1383
1386
|
type: Re.LOGIN,
|
|
1384
1387
|
clientId: r,
|
|
1385
1388
|
params: {
|
|
1386
|
-
type: n ||
|
|
1389
|
+
type: n || ne.ID_AND_ACCESS_TOKEN,
|
|
1387
1390
|
username: e,
|
|
1388
1391
|
password: t,
|
|
1389
1392
|
sessionExpiration: o,
|
|
@@ -1393,12 +1396,13 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1393
1396
|
domain: u,
|
|
1394
1397
|
ua: h
|
|
1395
1398
|
}
|
|
1396
|
-
}),
|
|
1397
|
-
return
|
|
1399
|
+
}), l = await ce((p = m == null ? void 0 : m.data) == null ? void 0 : p.idToken);
|
|
1400
|
+
return l && l.payload[k.USER_ID_KEY] !== "" && l.payload[k.NONCE_KEY] === a ? {
|
|
1398
1401
|
idToken: m.data.idToken,
|
|
1399
1402
|
accessToken: m.data.accessToken,
|
|
1400
1403
|
refreshToken: m.data.refreshToken,
|
|
1401
|
-
userId:
|
|
1404
|
+
userId: l.payload[k.USER_ID_KEY],
|
|
1405
|
+
email: l.payload[k.EMAIL_KEY],
|
|
1402
1406
|
status: !0
|
|
1403
1407
|
} : {
|
|
1404
1408
|
status: !1
|
|
@@ -1408,7 +1412,7 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1408
1412
|
status: !1
|
|
1409
1413
|
};
|
|
1410
1414
|
}
|
|
1411
|
-
},
|
|
1415
|
+
}, Ta = async ({
|
|
1412
1416
|
nonce: e,
|
|
1413
1417
|
clientId: t,
|
|
1414
1418
|
code_challenge: r
|
|
@@ -1419,13 +1423,13 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1419
1423
|
type: Re.CODE,
|
|
1420
1424
|
clientId: t,
|
|
1421
1425
|
params: {
|
|
1422
|
-
type:
|
|
1426
|
+
type: ne.CODE,
|
|
1423
1427
|
nonce: e,
|
|
1424
1428
|
code_challenge: r
|
|
1425
1429
|
}
|
|
1426
1430
|
});
|
|
1427
1431
|
return (a = n == null ? void 0 : n.data) != null && a.code ? {
|
|
1428
|
-
status:
|
|
1432
|
+
status: ue,
|
|
1429
1433
|
data: n.data.code
|
|
1430
1434
|
} : {
|
|
1431
1435
|
status: M,
|
|
@@ -1437,7 +1441,7 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1437
1441
|
data: ""
|
|
1438
1442
|
};
|
|
1439
1443
|
}
|
|
1440
|
-
},
|
|
1444
|
+
}, Ia = async ({
|
|
1441
1445
|
clientId: e,
|
|
1442
1446
|
userId: t,
|
|
1443
1447
|
nonce: r,
|
|
@@ -1451,18 +1455,18 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1451
1455
|
type: Re.REFRESH,
|
|
1452
1456
|
clientId: e,
|
|
1453
1457
|
params: {
|
|
1454
|
-
type:
|
|
1458
|
+
type: ne.REFRESH_TOKEN,
|
|
1455
1459
|
userId: t,
|
|
1456
1460
|
nonce: r,
|
|
1457
1461
|
refreshToken: a,
|
|
1458
1462
|
accessToken: n,
|
|
1459
1463
|
domain: o
|
|
1460
1464
|
}
|
|
1461
|
-
}), u = await
|
|
1462
|
-
return u && u.payload[
|
|
1465
|
+
}), u = await ce((s = i == null ? void 0 : i.data) == null ? void 0 : s.accessToken);
|
|
1466
|
+
return u && u.payload[k.USER_ID_KEY] !== "" && u.payload[k.NONCE_KEY] === r ? {
|
|
1463
1467
|
accessToken: i.data.accessToken,
|
|
1464
1468
|
refreshToken: i.data.refreshToken,
|
|
1465
|
-
userId: u.payload[
|
|
1469
|
+
userId: u.payload[k.USER_ID_KEY],
|
|
1466
1470
|
status: !0
|
|
1467
1471
|
} : {
|
|
1468
1472
|
status: !1
|
|
@@ -1473,7 +1477,7 @@ const X = "Your session has expired. For your security, please log in again to c
|
|
|
1473
1477
|
};
|
|
1474
1478
|
}
|
|
1475
1479
|
};
|
|
1476
|
-
class
|
|
1480
|
+
class Sa {
|
|
1477
1481
|
constructor(t = null, r = null) {
|
|
1478
1482
|
Le(this, "refreshTokenPromise", null), Le(this, "accessToken"), Le(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
|
|
1479
1483
|
}
|
|
@@ -1501,9 +1505,9 @@ class Aa {
|
|
|
1501
1505
|
nonce: a,
|
|
1502
1506
|
domain: n
|
|
1503
1507
|
}) {
|
|
1504
|
-
const o = await
|
|
1505
|
-
if (o && o.payload[
|
|
1506
|
-
const s = await
|
|
1508
|
+
const o = await ce(this.refreshToken);
|
|
1509
|
+
if (o && o.payload[k.USER_ID_KEY] !== "") {
|
|
1510
|
+
const s = await Ia({
|
|
1507
1511
|
clientId: t,
|
|
1508
1512
|
userId: r,
|
|
1509
1513
|
nonce: a,
|
|
@@ -1512,7 +1516,7 @@ class Aa {
|
|
|
1512
1516
|
domain: n
|
|
1513
1517
|
});
|
|
1514
1518
|
return s.status ? (this.accessToken = s.accessToken, this.refreshToken = s.refreshToken, {
|
|
1515
|
-
status:
|
|
1519
|
+
status: ue,
|
|
1516
1520
|
newAccessToken: s.accessToken,
|
|
1517
1521
|
newRefreshToken: s.refreshToken
|
|
1518
1522
|
}) : {
|
|
@@ -1524,95 +1528,98 @@ class Aa {
|
|
|
1524
1528
|
};
|
|
1525
1529
|
}
|
|
1526
1530
|
}
|
|
1527
|
-
const
|
|
1531
|
+
const Aa = (e) => z(
|
|
1528
1532
|
(...t) => {
|
|
1529
1533
|
e && console.info(`==> [Auth ${Date.now()}]: `, ...t);
|
|
1530
1534
|
},
|
|
1531
1535
|
[e]
|
|
1532
|
-
),
|
|
1533
|
-
throw new Error(
|
|
1534
|
-
},
|
|
1536
|
+
), re = () => {
|
|
1537
|
+
throw new Error(fa);
|
|
1538
|
+
}, Gt = ar({
|
|
1535
1539
|
isAuthenticated: !1,
|
|
1536
1540
|
isLoading: !1,
|
|
1537
|
-
login:
|
|
1538
|
-
logout:
|
|
1539
|
-
getAccessToken:
|
|
1540
|
-
getIdToken:
|
|
1541
|
-
registeringForPasskey:
|
|
1542
|
-
loginWithPasskey:
|
|
1543
|
-
logoutReason: ""
|
|
1544
|
-
|
|
1545
|
-
|
|
1541
|
+
login: re,
|
|
1542
|
+
logout: re,
|
|
1543
|
+
getAccessToken: re,
|
|
1544
|
+
getIdToken: re,
|
|
1545
|
+
registeringForPasskey: re,
|
|
1546
|
+
loginWithPasskey: re,
|
|
1547
|
+
logoutReason: "",
|
|
1548
|
+
authenticationType: ""
|
|
1549
|
+
}), va = V.createContext({
|
|
1550
|
+
state: Wt,
|
|
1546
1551
|
dispatch: () => {
|
|
1547
1552
|
}
|
|
1548
|
-
}),
|
|
1553
|
+
}), ka = (e, t) => (t == null ? void 0 : t.type) === se ? {
|
|
1549
1554
|
...e,
|
|
1550
1555
|
isLoading: t.payload.isLoading
|
|
1551
|
-
} : (t == null ? void 0 : t.type) ===
|
|
1556
|
+
} : (t == null ? void 0 : t.type) === Te ? {
|
|
1552
1557
|
...e,
|
|
1553
1558
|
isLoading: !1,
|
|
1554
1559
|
isAuthenticated: !0,
|
|
1555
1560
|
user: t.payload.user,
|
|
1561
|
+
authenticationType: t.payload.authenticationType,
|
|
1556
1562
|
logoutReason: ""
|
|
1557
1563
|
} : (t == null ? void 0 : t.type) === Mt ? {
|
|
1558
1564
|
...e,
|
|
1559
1565
|
isLoading: !1,
|
|
1560
1566
|
isAuthenticated: !1,
|
|
1561
1567
|
user: void 0,
|
|
1568
|
+
authenticationType: "",
|
|
1562
1569
|
logoutReason: t.payload.logoutReason
|
|
1563
|
-
} : e,
|
|
1570
|
+
} : e, _a = ({
|
|
1564
1571
|
children: e,
|
|
1565
1572
|
sessionExpiration: t,
|
|
1566
1573
|
clientId: r,
|
|
1567
1574
|
domain: a = "",
|
|
1568
1575
|
debug: n = !1
|
|
1569
1576
|
}) => {
|
|
1570
|
-
const [o, s] = ft(
|
|
1571
|
-
...
|
|
1577
|
+
const [o, s] = ft(ka, {
|
|
1578
|
+
...Wt,
|
|
1572
1579
|
debug: n
|
|
1573
|
-
}), i =
|
|
1574
|
-
key: `${
|
|
1575
|
-
}), [
|
|
1576
|
-
key: `${
|
|
1577
|
-
}), [E,
|
|
1580
|
+
}), i = Aa(n), u = G(!1), [h, p, , m] = ge({
|
|
1581
|
+
key: `${ye}::${r}::@@user@@`
|
|
1582
|
+
}), [l, d, , y] = ge({
|
|
1583
|
+
key: `${ye}::${r}::@@access@@`
|
|
1584
|
+
}), [E, R, , w] = ge(
|
|
1578
1585
|
{
|
|
1579
|
-
key: `${
|
|
1586
|
+
key: `${ye}::${r}::@@refresh@@`
|
|
1580
1587
|
}
|
|
1581
|
-
), [U, H, , O] =
|
|
1582
|
-
key: `${
|
|
1583
|
-
}),
|
|
1584
|
-
i("removeLocalStorage: removing local storage"), m(),
|
|
1588
|
+
), [U, H, , O] = ge({
|
|
1589
|
+
key: `${ye}::${r}::@@nonce@@`
|
|
1590
|
+
}), oe = new Sa(l, E), P = z(() => {
|
|
1591
|
+
i("removeLocalStorage: removing local storage"), m(), y(), w(), O();
|
|
1585
1592
|
}, [
|
|
1586
|
-
|
|
1593
|
+
y,
|
|
1587
1594
|
m,
|
|
1588
1595
|
O,
|
|
1589
1596
|
w,
|
|
1590
1597
|
i
|
|
1591
1598
|
]), N = z(
|
|
1592
|
-
(
|
|
1599
|
+
(g) => {
|
|
1593
1600
|
i(
|
|
1594
1601
|
"removeStateAndLocalStorage: removing state and local storage with reason: ",
|
|
1595
|
-
|
|
1602
|
+
g
|
|
1596
1603
|
), s({
|
|
1597
1604
|
type: Mt,
|
|
1598
1605
|
payload: {
|
|
1599
|
-
logoutReason:
|
|
1606
|
+
logoutReason: g || Z
|
|
1600
1607
|
}
|
|
1601
|
-
}), P(), s({ type:
|
|
1608
|
+
}), P(), s({ type: se, payload: { isLoading: !1 } });
|
|
1602
1609
|
},
|
|
1603
1610
|
[P, i]
|
|
1604
1611
|
), x = z(
|
|
1605
|
-
async (
|
|
1612
|
+
async (g) => {
|
|
1606
1613
|
i("invalidateAndLogout: invalidating and logging out");
|
|
1607
|
-
const { user: T } = o, b = (T == null ? void 0 : T.userId) ||
|
|
1614
|
+
const { user: T } = o, b = (T == null ? void 0 : T.userId) || ba(h);
|
|
1608
1615
|
b || i(
|
|
1609
1616
|
"invalidateAndLogout: user cannot be identified, logging out without userId"
|
|
1610
|
-
), await
|
|
1617
|
+
), await Ea({
|
|
1611
1618
|
userId: b,
|
|
1612
1619
|
clientId: r,
|
|
1613
1620
|
domain: a,
|
|
1614
1621
|
idToken: h
|
|
1615
|
-
}), N(
|
|
1622
|
+
}), N(g || Z);
|
|
1616
1623
|
},
|
|
1617
1624
|
[h, o, r, a, N, i]
|
|
1618
1625
|
);
|
|
@@ -1620,138 +1627,142 @@ const Sa = (e) => z(
|
|
|
1620
1627
|
if (!u.current)
|
|
1621
1628
|
return o.isLoading && h !== null ? (async () => {
|
|
1622
1629
|
try {
|
|
1623
|
-
const
|
|
1624
|
-
|
|
1625
|
-
type:
|
|
1630
|
+
const g = await ce(h);
|
|
1631
|
+
g && g.payload[k.USER_ID_KEY] !== "" ? (i("useEffect: setting the authentication state"), s({
|
|
1632
|
+
type: Te,
|
|
1626
1633
|
payload: {
|
|
1634
|
+
authenticationType: g.payload[k.AUTH_TYPE_KEY],
|
|
1627
1635
|
user: {
|
|
1628
|
-
userId:
|
|
1629
|
-
username:
|
|
1636
|
+
userId: g.payload[k.USER_ID_KEY],
|
|
1637
|
+
username: g.payload[k.USERNAME_KEY],
|
|
1638
|
+
email: g.payload[k.EMAIL_KEY]
|
|
1630
1639
|
}
|
|
1631
1640
|
}
|
|
1632
|
-
})) : (i("useEffect: invalid JWT, invalidating and logging out"), await x(
|
|
1641
|
+
})) : (i("useEffect: invalid JWT, invalidating and logging out"), await x(Z));
|
|
1633
1642
|
} catch {
|
|
1634
1643
|
i(
|
|
1635
1644
|
"useEffect: exception validating JWT, invalidating and logging out"
|
|
1636
|
-
), await x(
|
|
1645
|
+
), await x(Z);
|
|
1637
1646
|
}
|
|
1638
|
-
})() : (i("useEffect: setting the loading state to false"), s({ type:
|
|
1647
|
+
})() : (i("useEffect: setting the loading state to false"), s({ type: se, payload: { isLoading: !1 } })), () => {
|
|
1639
1648
|
u.current = !0;
|
|
1640
1649
|
};
|
|
1641
1650
|
}, [o.isLoading, h, x, i]);
|
|
1642
|
-
const D = async (
|
|
1643
|
-
s({ type:
|
|
1644
|
-
const b =
|
|
1651
|
+
const D = async (g, T) => {
|
|
1652
|
+
s({ type: se, payload: { isLoading: !0 } }), P();
|
|
1653
|
+
const b = Ge();
|
|
1645
1654
|
H(b), i("login: Logging in with password");
|
|
1646
|
-
const
|
|
1655
|
+
const { code_verifier: Q, code_challenge: rr } = await ia(), et = await Ta({
|
|
1647
1656
|
nonce: b,
|
|
1648
1657
|
clientId: r,
|
|
1649
|
-
code_challenge:
|
|
1658
|
+
code_challenge: rr
|
|
1650
1659
|
});
|
|
1651
1660
|
if (et.status) {
|
|
1652
|
-
const
|
|
1653
|
-
username:
|
|
1661
|
+
const X = await wa({
|
|
1662
|
+
username: g,
|
|
1654
1663
|
password: T,
|
|
1655
1664
|
clientId: r,
|
|
1656
1665
|
sessionExpiration: t,
|
|
1657
1666
|
nonce: b,
|
|
1658
|
-
type:
|
|
1667
|
+
type: ne.CODE,
|
|
1659
1668
|
code: et.data,
|
|
1660
|
-
code_verifier:
|
|
1669
|
+
code_verifier: Q,
|
|
1661
1670
|
domain: a,
|
|
1662
1671
|
ua: navigator.userAgent
|
|
1663
1672
|
});
|
|
1664
|
-
return
|
|
1665
|
-
type:
|
|
1673
|
+
return X.status ? (p(X.idToken), d(X.accessToken), R(X.refreshToken), s({
|
|
1674
|
+
type: Te,
|
|
1666
1675
|
payload: {
|
|
1676
|
+
authenticationType: ne.CODE,
|
|
1667
1677
|
user: {
|
|
1668
|
-
userId:
|
|
1669
|
-
username:
|
|
1678
|
+
userId: X.userId,
|
|
1679
|
+
username: g,
|
|
1680
|
+
email: X.email
|
|
1670
1681
|
}
|
|
1671
1682
|
}
|
|
1672
1683
|
}), !0) : (N(Ve), !1);
|
|
1673
1684
|
}
|
|
1674
1685
|
return !1;
|
|
1675
|
-
}, Pe = async (
|
|
1676
|
-
|
|
1686
|
+
}, Pe = async (g) => {
|
|
1687
|
+
g == null || g.preventDefault(), await x(pa);
|
|
1677
1688
|
}, De = async () => {
|
|
1678
|
-
const { isAuthenticated:
|
|
1689
|
+
const { isAuthenticated: g, user: T } = o;
|
|
1679
1690
|
try {
|
|
1680
|
-
if (
|
|
1681
|
-
if (
|
|
1691
|
+
if (g && T && T.userId) {
|
|
1692
|
+
if (l) {
|
|
1682
1693
|
i("getAccessToken");
|
|
1683
|
-
const Q = await
|
|
1684
|
-
if (Q && Q.payload[
|
|
1685
|
-
return
|
|
1694
|
+
const Q = await ce(l);
|
|
1695
|
+
if (Q && Q.payload[k.USER_ID_KEY] !== "")
|
|
1696
|
+
return l;
|
|
1686
1697
|
}
|
|
1687
1698
|
i("getAccessToken: invalid access token, trying to refresh it");
|
|
1688
|
-
const b = await
|
|
1699
|
+
const b = await oe.refreshtoken({
|
|
1689
1700
|
clientId: r,
|
|
1690
1701
|
userId: T.userId,
|
|
1691
1702
|
nonce: U,
|
|
1692
1703
|
domain: a
|
|
1693
1704
|
});
|
|
1694
|
-
return b.status && b.status === "success" && b.newAccessToken ? (
|
|
1705
|
+
return b.status && b.status === "success" && b.newAccessToken ? (d(b.newAccessToken), R(b.newRefreshToken), b.newAccessToken) : (i(
|
|
1695
1706
|
"getAccessToken: invalid refresh token, need to re-authenticate"
|
|
1696
|
-
), await x(
|
|
1707
|
+
), await x(Z), "");
|
|
1697
1708
|
}
|
|
1698
1709
|
return i(
|
|
1699
1710
|
"getAccessToken: user is not authenticated, cannot get access token"
|
|
1700
|
-
), await x(
|
|
1711
|
+
), await x(Z), "";
|
|
1701
1712
|
} catch {
|
|
1702
1713
|
return i(
|
|
1703
1714
|
"getAccessToken: exception occurred, invalidating and logging out"
|
|
1704
|
-
), await x(
|
|
1715
|
+
), await x(ga), "";
|
|
1705
1716
|
}
|
|
1706
1717
|
}, C = () => o.isAuthenticated && h ? h : "", K = async () => {
|
|
1707
|
-
const { user:
|
|
1708
|
-
let T = await
|
|
1709
|
-
accessToken:
|
|
1718
|
+
const { user: g } = o;
|
|
1719
|
+
let T = await te({
|
|
1720
|
+
accessToken: l,
|
|
1710
1721
|
clientId: r,
|
|
1711
|
-
type:
|
|
1722
|
+
type: ee.GET_REGISTRATION_OPTIONS,
|
|
1712
1723
|
params: {
|
|
1713
1724
|
clientId: r,
|
|
1714
|
-
id:
|
|
1715
|
-
username:
|
|
1725
|
+
id: g == null ? void 0 : g.userId,
|
|
1726
|
+
username: g == null ? void 0 : g.username
|
|
1716
1727
|
}
|
|
1717
1728
|
});
|
|
1718
1729
|
if (T.status)
|
|
1719
1730
|
try {
|
|
1720
|
-
const b = await
|
|
1721
|
-
return T = await
|
|
1722
|
-
accessToken:
|
|
1731
|
+
const b = await ur(T.data);
|
|
1732
|
+
return T = await te({
|
|
1733
|
+
accessToken: l,
|
|
1723
1734
|
clientId: r,
|
|
1724
|
-
type:
|
|
1735
|
+
type: ee.VERIFY_REGISTRATION,
|
|
1725
1736
|
params: {
|
|
1726
1737
|
clientId: r,
|
|
1727
|
-
id:
|
|
1728
|
-
username:
|
|
1738
|
+
id: g == null ? void 0 : g.userId,
|
|
1739
|
+
username: g == null ? void 0 : g.username,
|
|
1729
1740
|
registration: b
|
|
1730
1741
|
}
|
|
1731
1742
|
}), !!(T.status && T.data.length > 0);
|
|
1732
1743
|
} catch {
|
|
1733
|
-
return await
|
|
1734
|
-
accessToken:
|
|
1744
|
+
return await te({
|
|
1745
|
+
accessToken: l,
|
|
1735
1746
|
clientId: r,
|
|
1736
|
-
type:
|
|
1747
|
+
type: ee.VERIFY_REGISTRATION,
|
|
1737
1748
|
params: {
|
|
1738
1749
|
clientId: r,
|
|
1739
|
-
id:
|
|
1740
|
-
username:
|
|
1750
|
+
id: g == null ? void 0 : g.userId,
|
|
1751
|
+
username: g == null ? void 0 : g.username,
|
|
1741
1752
|
registration: {}
|
|
1742
1753
|
}
|
|
1743
1754
|
}), !1;
|
|
1744
1755
|
}
|
|
1745
1756
|
return !1;
|
|
1746
1757
|
}, $e = async () => {
|
|
1747
|
-
s({ type:
|
|
1748
|
-
const
|
|
1749
|
-
H(
|
|
1750
|
-
const T =
|
|
1751
|
-
let b = await
|
|
1752
|
-
accessToken:
|
|
1758
|
+
s({ type: se, payload: { isLoading: !0 } }), P();
|
|
1759
|
+
const g = Ge();
|
|
1760
|
+
H(g), i("loginWithPasskey");
|
|
1761
|
+
const T = Ge();
|
|
1762
|
+
let b = await te({
|
|
1763
|
+
accessToken: l,
|
|
1753
1764
|
clientId: r,
|
|
1754
|
-
type:
|
|
1765
|
+
type: ee.GET_AUTHENTICATION_OPTIONS,
|
|
1755
1766
|
params: {
|
|
1756
1767
|
id: T,
|
|
1757
1768
|
clientId: r
|
|
@@ -1759,39 +1770,41 @@ const Sa = (e) => z(
|
|
|
1759
1770
|
});
|
|
1760
1771
|
if (b.status)
|
|
1761
1772
|
try {
|
|
1762
|
-
const Q = await
|
|
1763
|
-
return b = await
|
|
1764
|
-
accessToken:
|
|
1773
|
+
const Q = await pr(b.data);
|
|
1774
|
+
return b = await te({
|
|
1775
|
+
accessToken: l,
|
|
1765
1776
|
clientId: r,
|
|
1766
|
-
type:
|
|
1777
|
+
type: ee.VERIFY_AUTHENTICATION,
|
|
1767
1778
|
params: {
|
|
1768
1779
|
clientId: r,
|
|
1769
1780
|
id: T,
|
|
1770
1781
|
authentication: Q,
|
|
1771
|
-
nonce:
|
|
1782
|
+
nonce: g,
|
|
1772
1783
|
domain: a,
|
|
1773
1784
|
sessionExpiration: t,
|
|
1774
1785
|
ua: navigator.userAgent
|
|
1775
1786
|
}
|
|
1776
|
-
}), b.data.status ===
|
|
1777
|
-
type:
|
|
1787
|
+
}), b.data.status === ue ? (p(b.data.idToken), d(b.data.accessToken), R(b.data.refreshToken), s({
|
|
1788
|
+
type: Te,
|
|
1778
1789
|
payload: {
|
|
1790
|
+
authenticationType: ne.PASSKEY,
|
|
1779
1791
|
user: {
|
|
1780
1792
|
userId: b.data.userId,
|
|
1781
|
-
username: b.data.username
|
|
1793
|
+
username: b.data.username,
|
|
1794
|
+
email: b.data.email
|
|
1782
1795
|
}
|
|
1783
1796
|
}
|
|
1784
1797
|
}), !0) : (N(Ve), !1);
|
|
1785
1798
|
} catch {
|
|
1786
|
-
return await
|
|
1787
|
-
accessToken:
|
|
1799
|
+
return await te({
|
|
1800
|
+
accessToken: l,
|
|
1788
1801
|
clientId: r,
|
|
1789
|
-
type:
|
|
1802
|
+
type: ee.VERIFY_AUTHENTICATION,
|
|
1790
1803
|
params: {
|
|
1791
1804
|
clientId: r,
|
|
1792
1805
|
id: T,
|
|
1793
1806
|
authentication: {},
|
|
1794
|
-
nonce:
|
|
1807
|
+
nonce: g,
|
|
1795
1808
|
domain: a,
|
|
1796
1809
|
sessionExpiration: t
|
|
1797
1810
|
}
|
|
@@ -1799,8 +1812,8 @@ const Sa = (e) => z(
|
|
|
1799
1812
|
}
|
|
1800
1813
|
return !1;
|
|
1801
1814
|
};
|
|
1802
|
-
return /* @__PURE__ */ c(
|
|
1803
|
-
|
|
1815
|
+
return /* @__PURE__ */ c(va.Provider, { value: { state: o, dispatch: s }, children: /* @__PURE__ */ c(
|
|
1816
|
+
Gt.Provider,
|
|
1804
1817
|
{
|
|
1805
1818
|
value: {
|
|
1806
1819
|
...o,
|
|
@@ -1814,8 +1827,8 @@ const Sa = (e) => z(
|
|
|
1814
1827
|
children: e
|
|
1815
1828
|
}
|
|
1816
1829
|
) });
|
|
1817
|
-
}, qe = (e =
|
|
1818
|
-
function
|
|
1830
|
+
}, qe = (e = Gt) => yt(e), Zn = "user", eo = "assistant", to = "system", ro = "internal", ao = "hidden", no = "I'm having trouble right now. Please try again later.", oo = "gpt-4", so = 128e3, io = "action-message", co = "action-reset", lo = "action-model", uo = "action-restore", mo = "action-location", ho = "action-streaming", po = "action-search", go = "action-sort", fo = "sassy-saint-", yo = "details", bo = "search", Eo = "sort", wo = "location", To = "==stats==", Ra = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", mt = (e) => Number.isFinite(e) ? e : 0;
|
|
1831
|
+
function Na(e) {
|
|
1819
1832
|
return {
|
|
1820
1833
|
days: Math.trunc(e / 864e5),
|
|
1821
1834
|
hours: Math.trunc(e / 36e5 % 24),
|
|
@@ -1826,7 +1839,7 @@ function xa(e) {
|
|
|
1826
1839
|
nanoseconds: Math.trunc(mt(e * 1e6) % 1e3)
|
|
1827
1840
|
};
|
|
1828
1841
|
}
|
|
1829
|
-
function
|
|
1842
|
+
function xa(e) {
|
|
1830
1843
|
return {
|
|
1831
1844
|
days: e / 86400000n,
|
|
1832
1845
|
hours: e / 3600000n % 24n,
|
|
@@ -1837,20 +1850,20 @@ function Ca(e) {
|
|
|
1837
1850
|
nanoseconds: 0n
|
|
1838
1851
|
};
|
|
1839
1852
|
}
|
|
1840
|
-
function
|
|
1853
|
+
function Ca(e) {
|
|
1841
1854
|
switch (typeof e) {
|
|
1842
1855
|
case "number": {
|
|
1843
1856
|
if (Number.isFinite(e))
|
|
1844
|
-
return
|
|
1857
|
+
return Na(e);
|
|
1845
1858
|
break;
|
|
1846
1859
|
}
|
|
1847
1860
|
case "bigint":
|
|
1848
|
-
return
|
|
1861
|
+
return xa(e);
|
|
1849
1862
|
}
|
|
1850
1863
|
throw new TypeError("Expected a finite number or bigint");
|
|
1851
1864
|
}
|
|
1852
|
-
const
|
|
1853
|
-
function
|
|
1865
|
+
const Oa = (e) => e === 0 || e === 0n, Pa = (e, t) => t === 1 || t === 1n ? e : `${e}s`, Da = 1e-7, $a = 24n * 60n * 60n * 1000n;
|
|
1866
|
+
function La(e, t) {
|
|
1854
1867
|
const r = typeof e == "bigint";
|
|
1855
1868
|
if (!r && !Number.isFinite(e))
|
|
1856
1869
|
throw new TypeError("Expected a finite number or bigint");
|
|
@@ -1859,24 +1872,24 @@ function Ma(e, t) {
|
|
|
1859
1872
|
e = e < 0 ? -e : e, t.colonNotation && (t.compact = !1, t.formatSubMilliseconds = !1, t.separateMilliseconds = !1, t.verbose = !1), t.compact && (t.unitCount = 1, t.secondsDecimalDigits = 0, t.millisecondsDecimalDigits = 0);
|
|
1860
1873
|
let n = [];
|
|
1861
1874
|
const o = (p, m) => {
|
|
1862
|
-
const
|
|
1863
|
-
return (Math.round(
|
|
1864
|
-
}, s = (p, m,
|
|
1865
|
-
if (!((n.length === 0 || !t.colonNotation) &&
|
|
1866
|
-
if (
|
|
1867
|
-
const
|
|
1868
|
-
|
|
1875
|
+
const l = Math.floor(p * 10 ** m + Da);
|
|
1876
|
+
return (Math.round(l) / 10 ** m).toFixed(m);
|
|
1877
|
+
}, s = (p, m, l, d) => {
|
|
1878
|
+
if (!((n.length === 0 || !t.colonNotation) && Oa(p) && !(t.colonNotation && l === "m"))) {
|
|
1879
|
+
if (d ?? (d = String(p)), t.colonNotation) {
|
|
1880
|
+
const y = d.includes(".") ? d.split(".")[0].length : d.length, E = n.length > 0 ? 2 : 1;
|
|
1881
|
+
d = "0".repeat(Math.max(0, E - y)) + d;
|
|
1869
1882
|
} else
|
|
1870
|
-
|
|
1871
|
-
n.push(
|
|
1883
|
+
d += t.verbose ? " " + Pa(m, p) : l;
|
|
1884
|
+
n.push(d);
|
|
1872
1885
|
}
|
|
1873
|
-
}, i =
|
|
1886
|
+
}, i = Ca(e), u = BigInt(i.days);
|
|
1874
1887
|
if (s(u / 365n, "year", "y"), s(u % 365n, "day", "d"), s(Number(i.hours), "hour", "h"), s(Number(i.minutes), "minute", "m"), t.separateMilliseconds || t.formatSubMilliseconds || !t.colonNotation && e < 1e3) {
|
|
1875
|
-
const p = Number(i.seconds), m = Number(i.milliseconds),
|
|
1888
|
+
const p = Number(i.seconds), m = Number(i.milliseconds), l = Number(i.microseconds), d = Number(i.nanoseconds);
|
|
1876
1889
|
if (s(p, "second", "s"), t.formatSubMilliseconds)
|
|
1877
|
-
s(m, "millisecond", "ms"), s(
|
|
1890
|
+
s(m, "millisecond", "ms"), s(l, "microsecond", "µs"), s(d, "nanosecond", "ns");
|
|
1878
1891
|
else {
|
|
1879
|
-
const
|
|
1892
|
+
const y = m + l / 1e3 + d / 1e6, E = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, R = y >= 1 ? Math.round(y) : Math.ceil(y), w = E ? y.toFixed(E) : R;
|
|
1880
1893
|
s(
|
|
1881
1894
|
Number.parseFloat(w),
|
|
1882
1895
|
"millisecond",
|
|
@@ -1885,15 +1898,15 @@ function Ma(e, t) {
|
|
|
1885
1898
|
);
|
|
1886
1899
|
}
|
|
1887
1900
|
} else {
|
|
1888
|
-
const p = (r ? Number(e %
|
|
1889
|
-
s(Number.parseFloat(
|
|
1901
|
+
const p = (r ? Number(e % $a) : e) / 1e3 % 60, m = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, l = o(p, m), d = t.keepDecimalsOnWholeSeconds ? l : l.replace(/\.0+$/, "");
|
|
1902
|
+
s(Number.parseFloat(d), "second", "s", d);
|
|
1890
1903
|
}
|
|
1891
1904
|
if (n.length === 0)
|
|
1892
1905
|
return a + "0" + (t.verbose ? " milliseconds" : "ms");
|
|
1893
1906
|
const h = t.colonNotation ? ":" : " ";
|
|
1894
1907
|
return typeof t.unitCount == "number" && (n = n.slice(0, Math.max(t.unitCount, 1))), a + n.join(h);
|
|
1895
1908
|
}
|
|
1896
|
-
const
|
|
1909
|
+
const Ma = process.env.NODE_ENV === "production", Qe = !Ma, Ua = Qe ? "gizmette.local.com" : "gizmette.com", Io = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, Vt = (e, t) => {
|
|
1897
1910
|
const r = e < 0 ? t ? "W" : "S" : t ? "E" : "N", a = 0 | Math.abs(e), n = 0 | Math.abs(e) * 60 % 60, o = (0 | Math.abs(e) * 60 % 1 * 6e3) / 100;
|
|
1898
1911
|
return {
|
|
1899
1912
|
dir: r,
|
|
@@ -1901,17 +1914,17 @@ const Ua = process.env.NODE_ENV === "production", Qe = !Ua, Ha = Qe ? "gizmette.
|
|
|
1901
1914
|
min: n,
|
|
1902
1915
|
sec: o
|
|
1903
1916
|
};
|
|
1904
|
-
},
|
|
1917
|
+
}, So = (e) => {
|
|
1905
1918
|
if (!e && e !== 0)
|
|
1906
1919
|
return "N/A";
|
|
1907
1920
|
const t = Vt(e, !1);
|
|
1908
1921
|
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
1909
|
-
},
|
|
1922
|
+
}, Ao = (e) => {
|
|
1910
1923
|
if (!e && e !== 0)
|
|
1911
1924
|
return "N/A";
|
|
1912
1925
|
const t = Vt(e, !0);
|
|
1913
1926
|
return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
|
|
1914
|
-
},
|
|
1927
|
+
}, vo = async () => {
|
|
1915
1928
|
const e = {
|
|
1916
1929
|
/**
|
|
1917
1930
|
* A boolean value that indicates the application would
|
|
@@ -1960,11 +1973,11 @@ const Ua = process.env.NODE_ENV === "production", Qe = !Ua, Ha = Qe ? "gizmette.
|
|
|
1960
1973
|
e
|
|
1961
1974
|
);
|
|
1962
1975
|
});
|
|
1963
|
-
},
|
|
1976
|
+
}, ko = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ c("dl", { className: "my-0", children: /* @__PURE__ */ I("div", { className: "flex items-center justify-between", children: [
|
|
1964
1977
|
/* @__PURE__ */ c("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
|
|
1965
1978
|
/* @__PURE__ */ c("dd", { className: "inline-block", children: t[r] })
|
|
1966
1979
|
] }) }, `${e}-${r}`)) : null;
|
|
1967
|
-
function
|
|
1980
|
+
function _o({
|
|
1968
1981
|
data: e,
|
|
1969
1982
|
formatter: t = (r) => r
|
|
1970
1983
|
}) {
|
|
@@ -1976,18 +1989,18 @@ function Ro({
|
|
|
1976
1989
|
);
|
|
1977
1990
|
return t(a ? a / r.length : 0);
|
|
1978
1991
|
}
|
|
1979
|
-
const
|
|
1992
|
+
const Ro = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, No = new Intl.NumberFormat("en", {
|
|
1980
1993
|
style: "decimal",
|
|
1981
1994
|
signDisplay: "never",
|
|
1982
1995
|
minimumFractionDigits: 0,
|
|
1983
1996
|
maximumFractionDigits: 0
|
|
1984
|
-
}),
|
|
1997
|
+
}), xo = (e) => e > 0 ? La(e, {
|
|
1985
1998
|
secondsDecimalDigits: 2,
|
|
1986
1999
|
unitCount: 2
|
|
1987
|
-
}) : "N/A",
|
|
2000
|
+
}) : "N/A", Ha = (e) => f(
|
|
1988
2001
|
"flex-1 space-y-6 overflow-y-auto rounded-md bg-slate-900 px-4 pb-10 text-base leading-6 text-slate-300 shadow-sm sm:text-base sm:leading-7",
|
|
1989
2002
|
e || Qe ? "pt-4" : "pt-10"
|
|
1990
|
-
),
|
|
2003
|
+
), Co = (e, t) => t === 1 ? e : `${e}s`, Ce = (e) => {
|
|
1991
2004
|
let t = "";
|
|
1992
2005
|
if (typeof e == "number" || typeof e == "string")
|
|
1993
2006
|
t = "m-" + e;
|
|
@@ -1996,7 +2009,7 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
1996
2009
|
(e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
|
|
1997
2010
|
}
|
|
1998
2011
|
return t;
|
|
1999
|
-
},
|
|
2012
|
+
}, Oo = "av-bubble", ht = "av-button", Ie = "av-card", Ka = "av-footer", Ba = "av-main", Po = "av-messagebox", Do = "av-panel", $o = "av-spinner", Yt = "icon", Jt = "button", Wa = "link", Ga = ({
|
|
2000
2013
|
type: e,
|
|
2001
2014
|
size: t,
|
|
2002
2015
|
labelRight: r,
|
|
@@ -2005,20 +2018,20 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2005
2018
|
}) => {
|
|
2006
2019
|
const o = "text-sm font-medium max-h-8 py-0", s = "text-base font-medium max-h-9 py-1", i = "text-lg font-medium max-h-12 py-2";
|
|
2007
2020
|
switch (e) {
|
|
2008
|
-
case
|
|
2009
|
-
return
|
|
2021
|
+
case Jt:
|
|
2022
|
+
return f("px-4", {
|
|
2010
2023
|
[o]: t === "small",
|
|
2011
2024
|
[s]: t === "medium",
|
|
2012
2025
|
[i]: t === "large"
|
|
2013
2026
|
});
|
|
2014
2027
|
case Wa:
|
|
2015
|
-
return
|
|
2028
|
+
return f("px-4 text-center", {
|
|
2016
2029
|
[o]: t === "small",
|
|
2017
2030
|
[s]: t === "medium",
|
|
2018
2031
|
[i]: t === "large"
|
|
2019
2032
|
});
|
|
2020
|
-
case
|
|
2021
|
-
return
|
|
2033
|
+
case Yt:
|
|
2034
|
+
return f("inline-flex items-center", {
|
|
2022
2035
|
"justify-center": n === "center",
|
|
2023
2036
|
"justify-start": n === "left",
|
|
2024
2037
|
"justify-end": n === "right",
|
|
@@ -2030,7 +2043,7 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2030
2043
|
"h-12 px-4 text-lg font-medium": t === "large" && (r || a)
|
|
2031
2044
|
});
|
|
2032
2045
|
}
|
|
2033
|
-
},
|
|
2046
|
+
}, Va = ({
|
|
2034
2047
|
mode: e,
|
|
2035
2048
|
noBackground: t,
|
|
2036
2049
|
noTruncate: r,
|
|
@@ -2039,7 +2052,7 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2039
2052
|
if (t)
|
|
2040
2053
|
return "not-prose rounded-full";
|
|
2041
2054
|
if (a === "primary")
|
|
2042
|
-
return
|
|
2055
|
+
return f("not-prose rounded-full", {
|
|
2043
2056
|
truncate: !r,
|
|
2044
2057
|
"bg-action-dark text-copy-light": e === "dark",
|
|
2045
2058
|
"bg-action-light text-copy-lighter": e === "light",
|
|
@@ -2047,7 +2060,7 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2047
2060
|
"bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
|
|
2048
2061
|
});
|
|
2049
2062
|
if (a === "secondary")
|
|
2050
|
-
return
|
|
2063
|
+
return f("not-prose rounded-full", {
|
|
2051
2064
|
truncate: !r,
|
|
2052
2065
|
"bg-action-dark text-copy-light": e === "light",
|
|
2053
2066
|
"bg-action-light text-copy-lighter": e === "dark",
|
|
@@ -2055,14 +2068,14 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2055
2068
|
"bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
|
|
2056
2069
|
});
|
|
2057
2070
|
if (a === "danger")
|
|
2058
|
-
return
|
|
2071
|
+
return f("not-prose rounded-full", {
|
|
2059
2072
|
truncate: !r,
|
|
2060
2073
|
"bg-action-danger-dark text-copy-light": e === "dark",
|
|
2061
2074
|
"bg-action-danger-light text-copy-lighter": e === "light",
|
|
2062
2075
|
"bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
|
|
2063
2076
|
"bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
|
|
2064
2077
|
});
|
|
2065
|
-
},
|
|
2078
|
+
}, Ya = ({
|
|
2066
2079
|
mode: e,
|
|
2067
2080
|
disabled: t,
|
|
2068
2081
|
variant: r
|
|
@@ -2070,27 +2083,27 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2070
2083
|
if (t)
|
|
2071
2084
|
return "";
|
|
2072
2085
|
if (r === "primary")
|
|
2073
|
-
return
|
|
2086
|
+
return f("hover:text-copy-light-hover", {
|
|
2074
2087
|
"hover:bg-action-dark-hover": e === "dark",
|
|
2075
2088
|
"hover:bg-action-light-hover": e === "light",
|
|
2076
2089
|
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
|
|
2077
2090
|
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
|
|
2078
2091
|
});
|
|
2079
2092
|
if (r === "secondary")
|
|
2080
|
-
return
|
|
2093
|
+
return f("hover:text-copy-light-hover", {
|
|
2081
2094
|
"hover:bg-action-dark-hover": e === "light",
|
|
2082
2095
|
"hover:bg-action-light-hover": e === "dark",
|
|
2083
2096
|
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
|
|
2084
2097
|
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
|
|
2085
2098
|
});
|
|
2086
2099
|
if (r === "danger")
|
|
2087
|
-
return
|
|
2100
|
+
return f("hover:text-copy-light-hover", {
|
|
2088
2101
|
"hover:bg-action-danger-dark-hover": e === "dark",
|
|
2089
2102
|
"hover:bg-action-danger-light-hover": e === "light",
|
|
2090
2103
|
"hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
|
|
2091
2104
|
"hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
|
|
2092
2105
|
});
|
|
2093
|
-
},
|
|
2106
|
+
}, Ja = ({
|
|
2094
2107
|
mode: e,
|
|
2095
2108
|
disabled: t,
|
|
2096
2109
|
variant: r
|
|
@@ -2098,27 +2111,27 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2098
2111
|
if (t)
|
|
2099
2112
|
return "";
|
|
2100
2113
|
if (r === "primary")
|
|
2101
|
-
return
|
|
2114
|
+
return f("active:text-copy-light-active", {
|
|
2102
2115
|
"active:bg-action-dark-active": e === "dark",
|
|
2103
2116
|
"active:bg-action-light-active": e === "light",
|
|
2104
2117
|
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
|
|
2105
2118
|
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
|
|
2106
2119
|
});
|
|
2107
2120
|
if (r === "secondary")
|
|
2108
|
-
return
|
|
2121
|
+
return f("active:text-copy-light-active", {
|
|
2109
2122
|
"active:bg-action-dark-active": e === "light",
|
|
2110
2123
|
"active:bg-action-light-active": e === "dark",
|
|
2111
2124
|
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
|
|
2112
2125
|
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
|
|
2113
2126
|
});
|
|
2114
2127
|
if (r === "danger")
|
|
2115
|
-
return
|
|
2128
|
+
return f("active:text-copy-lighter-active", {
|
|
2116
2129
|
"active:bg-action-danger-dark-active": e === "dark",
|
|
2117
2130
|
"active:bg-action-danger-light-active": e === "light",
|
|
2118
2131
|
"active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
|
|
2119
2132
|
"active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
|
|
2120
2133
|
});
|
|
2121
|
-
},
|
|
2134
|
+
}, Fa = ({
|
|
2122
2135
|
mode: e,
|
|
2123
2136
|
noBorder: t,
|
|
2124
2137
|
variant: r
|
|
@@ -2126,32 +2139,32 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2126
2139
|
if (t)
|
|
2127
2140
|
return "border border-transparent";
|
|
2128
2141
|
if (r === "primary")
|
|
2129
|
-
return
|
|
2142
|
+
return f("border", {
|
|
2130
2143
|
"border-border-dark": e === "dark",
|
|
2131
2144
|
"border-border-accent": e === "light",
|
|
2132
2145
|
"border-border-dark dark:border-border-accent": e === "system",
|
|
2133
2146
|
"border-border-accent dark:border-border-dark": e === "alt-system"
|
|
2134
2147
|
});
|
|
2135
2148
|
if (r === "secondary")
|
|
2136
|
-
return
|
|
2149
|
+
return f("border", {
|
|
2137
2150
|
"border-border-dark": e === "light",
|
|
2138
2151
|
"border-border-accent": e === "dark",
|
|
2139
2152
|
"border-border-dark dark:border-border-accent": e === "alt-system",
|
|
2140
2153
|
"border-border-accent dark:border-border-dark": e === "system"
|
|
2141
2154
|
});
|
|
2142
2155
|
if (r === "danger")
|
|
2143
|
-
return
|
|
2156
|
+
return f("border", {
|
|
2144
2157
|
"border-border-danger-dark": e === "dark",
|
|
2145
2158
|
"border-border-danger-medium": e === "light",
|
|
2146
2159
|
"border-border-danger-dark dark:border-border-danger-medium": e === "system",
|
|
2147
2160
|
"border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
|
|
2148
2161
|
});
|
|
2149
|
-
},
|
|
2162
|
+
}, za = ({ focusMode: e }) => f("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
2150
2163
|
"focus:outline-focus-dark": e === "dark",
|
|
2151
2164
|
"focus:outline-focus-light": e === "light",
|
|
2152
2165
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
2153
2166
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
2154
|
-
}),
|
|
2167
|
+
}), Ft = ({
|
|
2155
2168
|
type: e,
|
|
2156
2169
|
className: t,
|
|
2157
2170
|
raw: r,
|
|
@@ -2164,25 +2177,25 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2164
2177
|
labelRight: h,
|
|
2165
2178
|
labelLeft: p,
|
|
2166
2179
|
spacing: m,
|
|
2167
|
-
noBackground:
|
|
2168
|
-
variant:
|
|
2169
|
-
noTruncate:
|
|
2180
|
+
noBackground: l,
|
|
2181
|
+
variant: d,
|
|
2182
|
+
noTruncate: y,
|
|
2170
2183
|
align: E
|
|
2171
|
-
}) => (
|
|
2184
|
+
}) => (d || (d = "primary"), r ? f(ht, t) : f(
|
|
2172
2185
|
ht,
|
|
2173
2186
|
t,
|
|
2174
2187
|
Ce(m),
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2188
|
+
Va({ mode: a, variant: d, noBackground: l, noTruncate: y }),
|
|
2189
|
+
Ga({ type: e, size: i, labelRight: h, labelLeft: p, align: E }),
|
|
2190
|
+
Fa({ mode: a, variant: d, noBorder: u }),
|
|
2191
|
+
za({ focusMode: n }),
|
|
2192
|
+
Ya({ mode: a, variant: d, disabled: o }),
|
|
2193
|
+
Ja({ mode: a, variant: d, disabled: o }),
|
|
2181
2194
|
{
|
|
2182
2195
|
"w-full": s,
|
|
2183
2196
|
"disabled:cursor-not-allowed disabled:opacity-50": o
|
|
2184
2197
|
}
|
|
2185
|
-
)),
|
|
2198
|
+
)), ja = (e, t, r) => {
|
|
2186
2199
|
var a;
|
|
2187
2200
|
!t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
|
|
2188
2201
|
}, Xe = V.forwardRef(
|
|
@@ -2193,7 +2206,7 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2193
2206
|
{
|
|
2194
2207
|
ref: t,
|
|
2195
2208
|
onClick: (o) => {
|
|
2196
|
-
|
|
2209
|
+
ja(o, a, r);
|
|
2197
2210
|
},
|
|
2198
2211
|
...n
|
|
2199
2212
|
}
|
|
@@ -2201,7 +2214,7 @@ const No = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2201
2214
|
}
|
|
2202
2215
|
);
|
|
2203
2216
|
Xe.displayName = "BaseButton";
|
|
2204
|
-
const
|
|
2217
|
+
const Fe = V.forwardRef(
|
|
2205
2218
|
({
|
|
2206
2219
|
children: e,
|
|
2207
2220
|
disabled: t = !1,
|
|
@@ -2215,15 +2228,15 @@ const Ye = V.forwardRef(
|
|
|
2215
2228
|
"aria-label": h,
|
|
2216
2229
|
label: p,
|
|
2217
2230
|
size: m = "medium",
|
|
2218
|
-
labelRight:
|
|
2219
|
-
labelLeft:
|
|
2220
|
-
spacing:
|
|
2231
|
+
labelRight: l,
|
|
2232
|
+
labelLeft: d,
|
|
2233
|
+
spacing: y,
|
|
2221
2234
|
noBackground: E = !1,
|
|
2222
|
-
align:
|
|
2235
|
+
align: R = "center",
|
|
2223
2236
|
...w
|
|
2224
2237
|
}, U) => {
|
|
2225
|
-
const H =
|
|
2226
|
-
type:
|
|
2238
|
+
const H = Ft({
|
|
2239
|
+
type: Yt,
|
|
2227
2240
|
mode: r,
|
|
2228
2241
|
focusMode: a,
|
|
2229
2242
|
fullWidth: n,
|
|
@@ -2232,12 +2245,12 @@ const Ye = V.forwardRef(
|
|
|
2232
2245
|
className: o,
|
|
2233
2246
|
noBorder: u,
|
|
2234
2247
|
size: m,
|
|
2235
|
-
labelRight:
|
|
2236
|
-
labelLeft:
|
|
2237
|
-
spacing:
|
|
2248
|
+
labelRight: l,
|
|
2249
|
+
labelLeft: d,
|
|
2250
|
+
spacing: y,
|
|
2238
2251
|
noBackground: E,
|
|
2239
|
-
align:
|
|
2240
|
-
}), O =
|
|
2252
|
+
align: R
|
|
2253
|
+
}), O = f({
|
|
2241
2254
|
"text-copy-accent-dark": r === "light" && !i,
|
|
2242
2255
|
"text-copy-light": r === "dark" && !i,
|
|
2243
2256
|
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
|
|
@@ -2253,15 +2266,15 @@ const Ye = V.forwardRef(
|
|
|
2253
2266
|
"aria-label": h || p,
|
|
2254
2267
|
...w,
|
|
2255
2268
|
children: [
|
|
2256
|
-
|
|
2269
|
+
d && /* @__PURE__ */ c("span", { className: "pr-2", children: d }),
|
|
2257
2270
|
/* @__PURE__ */ c("div", { className: O, children: e }),
|
|
2258
|
-
|
|
2271
|
+
l && /* @__PURE__ */ c("span", { className: "pl-2", children: l })
|
|
2259
2272
|
]
|
|
2260
2273
|
}
|
|
2261
2274
|
);
|
|
2262
2275
|
}
|
|
2263
2276
|
);
|
|
2264
|
-
|
|
2277
|
+
Fe.displayName = "ButtonIcon";
|
|
2265
2278
|
const zt = V.forwardRef(
|
|
2266
2279
|
({
|
|
2267
2280
|
children: e,
|
|
@@ -2276,10 +2289,10 @@ const zt = V.forwardRef(
|
|
|
2276
2289
|
spacing: h,
|
|
2277
2290
|
variant: p = "primary",
|
|
2278
2291
|
noTruncate: m = !1,
|
|
2279
|
-
...
|
|
2280
|
-
},
|
|
2281
|
-
const
|
|
2282
|
-
type:
|
|
2292
|
+
...l
|
|
2293
|
+
}, d) => {
|
|
2294
|
+
const y = Ft({
|
|
2295
|
+
type: Jt,
|
|
2283
2296
|
mode: r,
|
|
2284
2297
|
focusMode: a,
|
|
2285
2298
|
fullWidth: n,
|
|
@@ -2295,21 +2308,21 @@ const zt = V.forwardRef(
|
|
|
2295
2308
|
return /* @__PURE__ */ c(
|
|
2296
2309
|
Xe,
|
|
2297
2310
|
{
|
|
2298
|
-
ref:
|
|
2299
|
-
className:
|
|
2311
|
+
ref: d,
|
|
2312
|
+
className: y,
|
|
2300
2313
|
disabled: t,
|
|
2301
|
-
...
|
|
2314
|
+
...l,
|
|
2302
2315
|
children: e
|
|
2303
2316
|
}
|
|
2304
2317
|
);
|
|
2305
2318
|
}
|
|
2306
2319
|
);
|
|
2307
2320
|
zt.displayName = "Button";
|
|
2308
|
-
function
|
|
2321
|
+
function qa(e) {
|
|
2309
2322
|
const t = bt();
|
|
2310
2323
|
return `${e}${t}`;
|
|
2311
2324
|
}
|
|
2312
|
-
const
|
|
2325
|
+
const Qa = ({
|
|
2313
2326
|
className: e,
|
|
2314
2327
|
headerClassName: t,
|
|
2315
2328
|
bodyClassName: r,
|
|
@@ -2319,8 +2332,8 @@ const Xa = ({
|
|
|
2319
2332
|
compact: s,
|
|
2320
2333
|
noBorder: i
|
|
2321
2334
|
}) => {
|
|
2322
|
-
const u =
|
|
2323
|
-
|
|
2335
|
+
const u = f(
|
|
2336
|
+
Ie,
|
|
2324
2337
|
e,
|
|
2325
2338
|
"rounded-md",
|
|
2326
2339
|
Ce(n),
|
|
@@ -2335,7 +2348,7 @@ const Xa = ({
|
|
|
2335
2348
|
"border-border-dark bg-surface-lighter text-copy-dark dark:border-border-accent dark:bg-surface-dark dark:text-copy-light": o === "system",
|
|
2336
2349
|
"border-border-accent bg-surface-dark text-copy-light dark:border-border-dark dark:bg-surface-lighter dark:text-copy-dark": o === "alt-system"
|
|
2337
2350
|
}
|
|
2338
|
-
), h = t ||
|
|
2351
|
+
), h = t || f(`${Ie}__header mt-0 border-b-2`, {
|
|
2339
2352
|
"text-copy-light border-border-accent": o === "darker",
|
|
2340
2353
|
"border-border-accent": o === "dark",
|
|
2341
2354
|
"border-border-medium": o === "light",
|
|
@@ -2343,7 +2356,7 @@ const Xa = ({
|
|
|
2343
2356
|
"border-border-accent dark:border-border-medium": o === "alt-system",
|
|
2344
2357
|
"mb-4": !s,
|
|
2345
2358
|
"mb-2": s
|
|
2346
|
-
}), p =
|
|
2359
|
+
}), p = f(r), m = a || f(`${Ie}__footer pt-2`);
|
|
2347
2360
|
return {
|
|
2348
2361
|
wrapper: u,
|
|
2349
2362
|
header: h,
|
|
@@ -2351,7 +2364,7 @@ const Xa = ({
|
|
|
2351
2364
|
footer: m
|
|
2352
2365
|
};
|
|
2353
2366
|
};
|
|
2354
|
-
function
|
|
2367
|
+
function Xa({
|
|
2355
2368
|
id: e,
|
|
2356
2369
|
content: t,
|
|
2357
2370
|
userAriaLabelledby: r,
|
|
@@ -2359,7 +2372,7 @@ function Za({
|
|
|
2359
2372
|
}) {
|
|
2360
2373
|
return typeof t == "string" ? /* @__PURE__ */ c("h2", { id: e, className: a, children: t }) : r ? /* @__PURE__ */ c("div", { className: a, children: t }) : t ? /* @__PURE__ */ c("div", { className: a, id: e, children: t }) : null;
|
|
2361
2374
|
}
|
|
2362
|
-
const
|
|
2375
|
+
const Za = ({
|
|
2363
2376
|
header: e,
|
|
2364
2377
|
headerClassName: t,
|
|
2365
2378
|
footer: r,
|
|
@@ -2372,10 +2385,10 @@ const en = ({
|
|
|
2372
2385
|
mode: h = "system",
|
|
2373
2386
|
compact: p = !1,
|
|
2374
2387
|
noBorder: m = !1,
|
|
2375
|
-
...
|
|
2388
|
+
...l
|
|
2376
2389
|
}) => {
|
|
2377
|
-
let
|
|
2378
|
-
const E = typeof e == "string",
|
|
2390
|
+
let d = null, y = null;
|
|
2391
|
+
const E = typeof e == "string", R = qa(Ie), w = Qa({
|
|
2379
2392
|
className: o,
|
|
2380
2393
|
headerClassName: t,
|
|
2381
2394
|
bodyClassName: s,
|
|
@@ -2385,19 +2398,19 @@ const en = ({
|
|
|
2385
2398
|
compact: p,
|
|
2386
2399
|
noBorder: m
|
|
2387
2400
|
});
|
|
2388
|
-
return E ? (
|
|
2401
|
+
return E ? (d = R, y = d) : !E && e && i ? (d = null, y = i) : !E && e && !i ? (d = R, y = d) : (d = null, y = i || null), /* @__PURE__ */ c("div", { className: w.wrapper, children: /* @__PURE__ */ I(
|
|
2389
2402
|
"section",
|
|
2390
2403
|
{
|
|
2391
|
-
...
|
|
2392
|
-
"aria-labelledby":
|
|
2404
|
+
...y && {
|
|
2405
|
+
"aria-labelledby": y
|
|
2393
2406
|
},
|
|
2394
2407
|
className: w.body,
|
|
2395
|
-
...
|
|
2408
|
+
...l,
|
|
2396
2409
|
children: [
|
|
2397
2410
|
/* @__PURE__ */ c(
|
|
2398
|
-
|
|
2411
|
+
Xa,
|
|
2399
2412
|
{
|
|
2400
|
-
...
|
|
2413
|
+
...d && { id: d },
|
|
2401
2414
|
content: e,
|
|
2402
2415
|
className: w.header,
|
|
2403
2416
|
userAriaLabelledby: i
|
|
@@ -2408,7 +2421,7 @@ const en = ({
|
|
|
2408
2421
|
]
|
|
2409
2422
|
}
|
|
2410
2423
|
) });
|
|
2411
|
-
},
|
|
2424
|
+
}, en = ({
|
|
2412
2425
|
className: e,
|
|
2413
2426
|
mode: t = "system",
|
|
2414
2427
|
row1: r,
|
|
@@ -2417,7 +2430,7 @@ const en = ({
|
|
|
2417
2430
|
spacing: o,
|
|
2418
2431
|
raw: s = !1
|
|
2419
2432
|
}) => {
|
|
2420
|
-
const i =
|
|
2433
|
+
const i = f(Ka, e, Ce(o), {
|
|
2421
2434
|
"text-copy-dark": !s && t === "dark",
|
|
2422
2435
|
"text-copy-lighter": !s && t === "light",
|
|
2423
2436
|
"text-copy-dark dark:text-copy-lighter": !s && t === "system",
|
|
@@ -2429,13 +2442,13 @@ const en = ({
|
|
|
2429
2442
|
r && /* @__PURE__ */ c("div", { children: r }),
|
|
2430
2443
|
a && /* @__PURE__ */ c("div", { children: a })
|
|
2431
2444
|
] });
|
|
2432
|
-
},
|
|
2445
|
+
}, tn = ({
|
|
2433
2446
|
children: e,
|
|
2434
2447
|
className: t,
|
|
2435
2448
|
raw: r = !1,
|
|
2436
2449
|
spacing: a
|
|
2437
2450
|
}) => {
|
|
2438
|
-
const n =
|
|
2451
|
+
const n = f(t, Ba, Ce(a), {
|
|
2439
2452
|
"mt-2 flex w-full flex-col p-2 sm:mt-3 md:mx-auto md:max-w-4xl": !r
|
|
2440
2453
|
});
|
|
2441
2454
|
return /* @__PURE__ */ c("main", { className: n, children: e });
|
|
@@ -2453,7 +2466,7 @@ try {
|
|
|
2453
2466
|
});
|
|
2454
2467
|
} catch {
|
|
2455
2468
|
}
|
|
2456
|
-
function
|
|
2469
|
+
function rn(e) {
|
|
2457
2470
|
return Et(() => e.every((t) => t == null) ? () => {
|
|
2458
2471
|
} : (t) => {
|
|
2459
2472
|
e.forEach((r) => {
|
|
@@ -2461,7 +2474,7 @@ function an(e) {
|
|
|
2461
2474
|
});
|
|
2462
2475
|
}, e);
|
|
2463
2476
|
}
|
|
2464
|
-
function
|
|
2477
|
+
function an(e) {
|
|
2465
2478
|
const t = bt();
|
|
2466
2479
|
if (!e)
|
|
2467
2480
|
return t;
|
|
@@ -2472,7 +2485,7 @@ function nn(e) {
|
|
|
2472
2485
|
return typeof r == "number" || typeof r == "string" ? `${a}${r}` : `${a}${t}`;
|
|
2473
2486
|
}
|
|
2474
2487
|
}
|
|
2475
|
-
const jt = "SET_ANNOUNCEMENT", qt = "CLEAR_ANNOUNCEMENT",
|
|
2488
|
+
const jt = "SET_ANNOUNCEMENT", qt = "CLEAR_ANNOUNCEMENT", nn = {
|
|
2476
2489
|
alert: null,
|
|
2477
2490
|
alertdialog: null,
|
|
2478
2491
|
log: "polite",
|
|
@@ -2480,7 +2493,7 @@ const jt = "SET_ANNOUNCEMENT", qt = "CLEAR_ANNOUNCEMENT", on = {
|
|
|
2480
2493
|
progressbar: null,
|
|
2481
2494
|
status: "polite",
|
|
2482
2495
|
timer: "assertive"
|
|
2483
|
-
},
|
|
2496
|
+
}, on = (e, t) => {
|
|
2484
2497
|
switch (t == null ? void 0 : t.type) {
|
|
2485
2498
|
case jt:
|
|
2486
2499
|
return {
|
|
@@ -2495,7 +2508,7 @@ const jt = "SET_ANNOUNCEMENT", qt = "CLEAR_ANNOUNCEMENT", on = {
|
|
|
2495
2508
|
default:
|
|
2496
2509
|
return e;
|
|
2497
2510
|
}
|
|
2498
|
-
},
|
|
2511
|
+
}, sn = ({
|
|
2499
2512
|
onAnnouncementClear: e,
|
|
2500
2513
|
dispatch: t
|
|
2501
2514
|
}) => {
|
|
@@ -2513,13 +2526,13 @@ const jt = "SET_ANNOUNCEMENT", qt = "CLEAR_ANNOUNCEMENT", on = {
|
|
|
2513
2526
|
type: jt,
|
|
2514
2527
|
payload: e
|
|
2515
2528
|
}), t && (r.current = setTimeout(
|
|
2516
|
-
() =>
|
|
2529
|
+
() => sn({
|
|
2517
2530
|
onAnnouncementClear: a,
|
|
2518
2531
|
dispatch: n
|
|
2519
2532
|
}),
|
|
2520
2533
|
t
|
|
2521
2534
|
));
|
|
2522
|
-
},
|
|
2535
|
+
}, cn = ({
|
|
2523
2536
|
children: e,
|
|
2524
2537
|
announcementTimeoutRef: t,
|
|
2525
2538
|
announcementDelay: r,
|
|
@@ -2553,19 +2566,19 @@ function Qt({
|
|
|
2553
2566
|
visible: i,
|
|
2554
2567
|
...u
|
|
2555
2568
|
}) {
|
|
2556
|
-
const h =
|
|
2569
|
+
const h = G(), p = G(), [m, l] = ft(on, {
|
|
2557
2570
|
announcement: null
|
|
2558
2571
|
});
|
|
2559
|
-
let
|
|
2560
|
-
typeof
|
|
2561
|
-
|
|
2572
|
+
let d = r;
|
|
2573
|
+
typeof d > "u" && (d = a ? nn[a] : "assertive"), j(() => {
|
|
2574
|
+
cn({
|
|
2562
2575
|
announcementTimeoutRef: h,
|
|
2563
2576
|
announcementDelay: n,
|
|
2564
2577
|
children: e,
|
|
2565
2578
|
clearAnnouncementDelay: o,
|
|
2566
2579
|
clearAnnouncementTimeoutRef: p,
|
|
2567
2580
|
onAnnouncementClear: s,
|
|
2568
|
-
dispatch:
|
|
2581
|
+
dispatch: l
|
|
2569
2582
|
});
|
|
2570
2583
|
}, [
|
|
2571
2584
|
e,
|
|
@@ -2573,15 +2586,15 @@ function Qt({
|
|
|
2573
2586
|
o,
|
|
2574
2587
|
s
|
|
2575
2588
|
]);
|
|
2576
|
-
const
|
|
2589
|
+
const y = f(t, {
|
|
2577
2590
|
"sr-only": !i
|
|
2578
2591
|
});
|
|
2579
2592
|
return /* @__PURE__ */ c(
|
|
2580
2593
|
"div",
|
|
2581
2594
|
{
|
|
2582
|
-
"aria-live":
|
|
2595
|
+
"aria-live": d,
|
|
2583
2596
|
...a && { role: a },
|
|
2584
|
-
className:
|
|
2597
|
+
className: y,
|
|
2585
2598
|
...u,
|
|
2586
2599
|
children: m.announcement
|
|
2587
2600
|
}
|
|
@@ -2609,14 +2622,14 @@ const ln = (e) => {
|
|
|
2609
2622
|
(e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
|
|
2610
2623
|
}
|
|
2611
2624
|
return t;
|
|
2612
|
-
}, Xt = "av-text-input",
|
|
2613
|
-
function
|
|
2614
|
-
const e =
|
|
2625
|
+
}, Xt = "av-text-input", dn = "av-text-input-wrapper", Ye = "av-text-input-helper-text", Lo = "av-text-area", Mo = "av-text-area-wrapper", Uo = "av-text-area-helper-text", Ho = "av-text-area__control--right", Ko = "av-toggle";
|
|
2626
|
+
function un() {
|
|
2627
|
+
const e = G(!1);
|
|
2615
2628
|
return j(() => (e.current = !0, () => {
|
|
2616
2629
|
e.current = !1;
|
|
2617
2630
|
}), []), z(() => e.current, []);
|
|
2618
2631
|
}
|
|
2619
|
-
const
|
|
2632
|
+
const mn = {
|
|
2620
2633
|
x: 0,
|
|
2621
2634
|
y: 0,
|
|
2622
2635
|
width: 0,
|
|
@@ -2626,8 +2639,8 @@ const hn = {
|
|
|
2626
2639
|
bottom: 0,
|
|
2627
2640
|
right: 0
|
|
2628
2641
|
};
|
|
2629
|
-
function
|
|
2630
|
-
const t =
|
|
2642
|
+
function hn(e) {
|
|
2643
|
+
const t = un(), r = G(0), a = G(null), [n, o] = J(mn), s = Et(
|
|
2631
2644
|
() => typeof window < "u" ? new ResizeObserver((i) => {
|
|
2632
2645
|
const u = i[0];
|
|
2633
2646
|
u && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
|
@@ -2640,29 +2653,29 @@ function pn(e) {
|
|
|
2640
2653
|
s == null || s.disconnect(), r.current && cancelAnimationFrame(r.current);
|
|
2641
2654
|
}), [s, e]), [a, n];
|
|
2642
2655
|
}
|
|
2643
|
-
const
|
|
2656
|
+
const pn = ({
|
|
2644
2657
|
mode: e
|
|
2645
|
-
}) =>
|
|
2658
|
+
}) => f({
|
|
2646
2659
|
"bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
|
|
2647
2660
|
"bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
|
|
2648
2661
|
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
|
|
2649
2662
|
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
|
|
2650
|
-
}),
|
|
2663
|
+
}), gn = ({
|
|
2651
2664
|
focusMode: e
|
|
2652
|
-
}) =>
|
|
2665
|
+
}) => f("focus:outline focus:outline-2 focus:outline-offset-2", {
|
|
2653
2666
|
"focus:outline-focus-dark": e === "dark",
|
|
2654
2667
|
"focus:outline-focus-light": e === "light",
|
|
2655
2668
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
2656
2669
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
2657
|
-
}),
|
|
2670
|
+
}), fn = ({
|
|
2658
2671
|
noBorder: e,
|
|
2659
2672
|
error: t
|
|
2660
|
-
}) =>
|
|
2673
|
+
}) => f("border-2", {
|
|
2661
2674
|
"border-border-dark": !e && !t,
|
|
2662
2675
|
"focus:border-border-dark": !e && t,
|
|
2663
2676
|
"border-border-error-dark": !e && t,
|
|
2664
2677
|
"border-transparent": e
|
|
2665
|
-
}),
|
|
2678
|
+
}), yn = ({
|
|
2666
2679
|
disabled: e,
|
|
2667
2680
|
raw: t,
|
|
2668
2681
|
error: r,
|
|
@@ -2671,22 +2684,22 @@ const gn = ({
|
|
|
2671
2684
|
if (t)
|
|
2672
2685
|
return "";
|
|
2673
2686
|
if (e)
|
|
2674
|
-
return
|
|
2687
|
+
return f("absolute px-2 cursor-not-allowed opacity-50 font-medium");
|
|
2675
2688
|
if (!r)
|
|
2676
|
-
return
|
|
2689
|
+
return f("absolute px-2 cursor-text font-medium", {
|
|
2677
2690
|
"text-copy-lighter": a === "dark",
|
|
2678
2691
|
"text-copy-dark": a === "light",
|
|
2679
2692
|
"text-copy-dark dark:text-copy-lighter": a === "system",
|
|
2680
2693
|
"text-copy-lighter dark:text-copy-dark": a === "alt-system"
|
|
2681
2694
|
});
|
|
2682
2695
|
if (r)
|
|
2683
|
-
return
|
|
2696
|
+
return f("absolute px-2 cursor-text font-medium", {
|
|
2684
2697
|
"text-copy-lighter": a === "dark",
|
|
2685
2698
|
"text-copy-error-dark": a === "light",
|
|
2686
2699
|
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": a === "system",
|
|
2687
2700
|
"text-copy-lighter dark:text-copy-error-dark": a === "alt-system"
|
|
2688
2701
|
});
|
|
2689
|
-
},
|
|
2702
|
+
}, bn = ({
|
|
2690
2703
|
error: e,
|
|
2691
2704
|
raw: t,
|
|
2692
2705
|
mode: r,
|
|
@@ -2695,25 +2708,25 @@ const gn = ({
|
|
|
2695
2708
|
if (t)
|
|
2696
2709
|
return "";
|
|
2697
2710
|
if (a)
|
|
2698
|
-
return
|
|
2699
|
-
|
|
2711
|
+
return f(
|
|
2712
|
+
Ye,
|
|
2700
2713
|
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
|
2701
2714
|
);
|
|
2702
2715
|
if (!e)
|
|
2703
|
-
return
|
|
2716
|
+
return f(Ye, "absolute px-2 font-medium", {
|
|
2704
2717
|
"text-copy-lighter": r === "dark",
|
|
2705
2718
|
"text-copy-dark": r === "light",
|
|
2706
2719
|
"text-copy-dark dark:text-copy-lighter": r === "system",
|
|
2707
2720
|
"text-copy-lighter dark:text-copy-dark": r === "alt-system"
|
|
2708
2721
|
});
|
|
2709
2722
|
if (e)
|
|
2710
|
-
return
|
|
2723
|
+
return f(Ye, "absolute px-2 font-medium", {
|
|
2711
2724
|
"text-copy-error-light bg-surface-darker": r === "dark",
|
|
2712
2725
|
"text-copy-error-dark": r === "light",
|
|
2713
2726
|
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
|
|
2714
2727
|
"dark:text-copy-error-dark text-copy-error-light bg-surface-darker": r === "alt-system"
|
|
2715
2728
|
});
|
|
2716
|
-
},
|
|
2729
|
+
}, En = ({
|
|
2717
2730
|
className: e,
|
|
2718
2731
|
inputClassName: t,
|
|
2719
2732
|
raw: r,
|
|
@@ -2724,27 +2737,27 @@ const gn = ({
|
|
|
2724
2737
|
mode: i,
|
|
2725
2738
|
focusMode: u
|
|
2726
2739
|
}) => {
|
|
2727
|
-
const h = r ? e :
|
|
2740
|
+
const h = r ? e : f(
|
|
2728
2741
|
"relative flex w-full flex-col justify-center",
|
|
2729
|
-
|
|
2742
|
+
dn,
|
|
2730
2743
|
e,
|
|
2731
2744
|
ln(s)
|
|
2732
|
-
), p = r ?
|
|
2745
|
+
), p = r ? f(t) : f(
|
|
2733
2746
|
Xt,
|
|
2734
2747
|
t,
|
|
2735
2748
|
"h-12 rounded-md px-4 text-base",
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2749
|
+
pn({ mode: i }),
|
|
2750
|
+
gn({ focusMode: u }),
|
|
2751
|
+
fn({ noBorder: n, error: o }),
|
|
2739
2752
|
{
|
|
2740
2753
|
"disabled:cursor-not-allowed disabled:opacity-50": a
|
|
2741
2754
|
}
|
|
2742
|
-
), m = r ? void 0 : "sr-only",
|
|
2755
|
+
), m = r ? void 0 : "sr-only", l = yn({
|
|
2743
2756
|
disabled: a,
|
|
2744
2757
|
raw: r,
|
|
2745
2758
|
error: o,
|
|
2746
2759
|
mode: i
|
|
2747
|
-
}),
|
|
2760
|
+
}), d = bn({
|
|
2748
2761
|
error: o,
|
|
2749
2762
|
raw: r,
|
|
2750
2763
|
mode: i,
|
|
@@ -2754,8 +2767,8 @@ const gn = ({
|
|
|
2754
2767
|
wrapper: h,
|
|
2755
2768
|
input: p,
|
|
2756
2769
|
accessibleLabel: m,
|
|
2757
|
-
visibleLabel:
|
|
2758
|
-
helperText:
|
|
2770
|
+
visibleLabel: l,
|
|
2771
|
+
helperText: d,
|
|
2759
2772
|
rightElement: r ? void 0 : "absolute right-3"
|
|
2760
2773
|
};
|
|
2761
2774
|
}, Ze = V.forwardRef(
|
|
@@ -2772,14 +2785,14 @@ const gn = ({
|
|
|
2772
2785
|
disabled: h = !1,
|
|
2773
2786
|
noBorder: p = !1,
|
|
2774
2787
|
labelId: m,
|
|
2775
|
-
labelHidden:
|
|
2776
|
-
type:
|
|
2777
|
-
helperText:
|
|
2788
|
+
labelHidden: l = !1,
|
|
2789
|
+
type: d = "text",
|
|
2790
|
+
helperText: y = "",
|
|
2778
2791
|
rightElement: E,
|
|
2779
|
-
spacing:
|
|
2792
|
+
spacing: R,
|
|
2780
2793
|
...w
|
|
2781
2794
|
}, U) => {
|
|
2782
|
-
const [H, O] =
|
|
2795
|
+
const [H, O] = hn(), [oe, P] = J(0), N = an({ id: e, prefix: `${Xt}-` }), x = `${t} error, ${y}`, D = En({
|
|
2783
2796
|
className: o,
|
|
2784
2797
|
inputClassName: s,
|
|
2785
2798
|
error: a,
|
|
@@ -2787,10 +2800,10 @@ const gn = ({
|
|
|
2787
2800
|
focusMode: u,
|
|
2788
2801
|
disabled: h,
|
|
2789
2802
|
noBorder: p,
|
|
2790
|
-
spacing:
|
|
2803
|
+
spacing: R,
|
|
2791
2804
|
mode: i
|
|
2792
2805
|
});
|
|
2793
|
-
return
|
|
2806
|
+
return or(() => {
|
|
2794
2807
|
O && O.width && P(O.width + 18 + 10);
|
|
2795
2808
|
}, [O]), /* @__PURE__ */ I("div", { className: D.wrapper, children: [
|
|
2796
2809
|
/* @__PURE__ */ c(
|
|
@@ -2808,17 +2821,17 @@ const gn = ({
|
|
|
2808
2821
|
ref: U,
|
|
2809
2822
|
id: N,
|
|
2810
2823
|
name: t,
|
|
2811
|
-
type:
|
|
2824
|
+
type: d,
|
|
2812
2825
|
disabled: h,
|
|
2813
2826
|
placeholder: n ? void 0 : " ",
|
|
2814
2827
|
className: D.input,
|
|
2815
|
-
...
|
|
2828
|
+
...y && { "aria-describedby": `${N}-helper` },
|
|
2816
2829
|
...a && { "aria-invalid": "true" },
|
|
2817
|
-
...E && !n && { style: { paddingRight:
|
|
2830
|
+
...E && !n && { style: { paddingRight: oe } },
|
|
2818
2831
|
...w
|
|
2819
2832
|
}
|
|
2820
2833
|
),
|
|
2821
|
-
!n && !
|
|
2834
|
+
!n && !l && /* @__PURE__ */ c(
|
|
2822
2835
|
"label",
|
|
2823
2836
|
{
|
|
2824
2837
|
"aria-hidden": !0,
|
|
@@ -2827,12 +2840,12 @@ const gn = ({
|
|
|
2827
2840
|
children: r
|
|
2828
2841
|
}
|
|
2829
2842
|
),
|
|
2830
|
-
|
|
2843
|
+
y && /* @__PURE__ */ c(
|
|
2831
2844
|
"div",
|
|
2832
2845
|
{
|
|
2833
2846
|
id: `${N}-helper`,
|
|
2834
2847
|
className: D.helperText,
|
|
2835
|
-
children:
|
|
2848
|
+
children: y
|
|
2836
2849
|
}
|
|
2837
2850
|
),
|
|
2838
2851
|
E && /* @__PURE__ */ c(
|
|
@@ -2843,12 +2856,12 @@ const gn = ({
|
|
|
2843
2856
|
children: E
|
|
2844
2857
|
}
|
|
2845
2858
|
),
|
|
2846
|
-
a &&
|
|
2859
|
+
a && y && /* @__PURE__ */ c(Qt, { politeness: "polite", clearAnnouncementDelay: 500, children: x })
|
|
2847
2860
|
] });
|
|
2848
2861
|
}
|
|
2849
2862
|
);
|
|
2850
2863
|
Ze.displayName = "TextInput";
|
|
2851
|
-
const
|
|
2864
|
+
const wn = 500, Tn = 5e3, In = 2e4, Zt = V.forwardRef(
|
|
2852
2865
|
({
|
|
2853
2866
|
name: e,
|
|
2854
2867
|
disabled: t,
|
|
@@ -2862,30 +2875,30 @@ const Tn = 500, In = 5e3, vn = 2e4, Zt = V.forwardRef(
|
|
|
2862
2875
|
rightElement: h,
|
|
2863
2876
|
spacing: p,
|
|
2864
2877
|
...m
|
|
2865
|
-
},
|
|
2866
|
-
const [
|
|
2878
|
+
}, l) => {
|
|
2879
|
+
const [d, y] = J(!0), [E, R] = J({
|
|
2867
2880
|
message: null,
|
|
2868
2881
|
politeness: null
|
|
2869
|
-
}), w =
|
|
2882
|
+
}), w = G(!0), U = G(), H = G(null), O = rn([l, H]), oe = d ? "Show" : "Hide", P = () => {
|
|
2870
2883
|
clearTimeout(U.current), w.current || (U.current = window.setTimeout(() => {
|
|
2871
|
-
w.current = !0,
|
|
2872
|
-
announcementTimeout:
|
|
2884
|
+
w.current = !0, y(!0), R({
|
|
2885
|
+
announcementTimeout: Tn,
|
|
2873
2886
|
politeness: "polite",
|
|
2874
2887
|
message: `${r} hiding characters`
|
|
2875
2888
|
}), n && n(!0);
|
|
2876
|
-
},
|
|
2889
|
+
}, In));
|
|
2877
2890
|
}, N = (C) => {
|
|
2878
2891
|
C.preventDefault();
|
|
2879
2892
|
const K = !w.current;
|
|
2880
|
-
w.current = K, P(),
|
|
2881
|
-
announcementTimeout:
|
|
2893
|
+
w.current = K, P(), y(K), R({
|
|
2894
|
+
announcementTimeout: wn,
|
|
2882
2895
|
politeness: "assertive",
|
|
2883
2896
|
message: K ? "Characters hidden" : "Characters showing"
|
|
2884
2897
|
}), n && n(K);
|
|
2885
2898
|
}, x = (C) => {
|
|
2886
2899
|
var K;
|
|
2887
|
-
const { relatedTarget: $e } = C,
|
|
2888
|
-
|
|
2900
|
+
const { relatedTarget: $e } = C, g = (K = H.current) == null ? void 0 : K.parentElement;
|
|
2901
|
+
g != null && g.contains($e) || u && u();
|
|
2889
2902
|
}, D = (C) => {
|
|
2890
2903
|
P(), s && s(C), x(C);
|
|
2891
2904
|
}, Pe = (C) => {
|
|
@@ -2895,7 +2908,7 @@ const Tn = 500, In = 5e3, vn = 2e4, Zt = V.forwardRef(
|
|
|
2895
2908
|
};
|
|
2896
2909
|
return j(() => () => {
|
|
2897
2910
|
clearTimeout(U.current);
|
|
2898
|
-
}, []), /* @__PURE__ */ I(
|
|
2911
|
+
}, []), /* @__PURE__ */ I(le, { children: [
|
|
2899
2912
|
/* @__PURE__ */ c(
|
|
2900
2913
|
Ze,
|
|
2901
2914
|
{
|
|
@@ -2903,15 +2916,15 @@ const Tn = 500, In = 5e3, vn = 2e4, Zt = V.forwardRef(
|
|
|
2903
2916
|
name: e,
|
|
2904
2917
|
label: r,
|
|
2905
2918
|
labelHidden: a,
|
|
2906
|
-
type:
|
|
2919
|
+
type: d ? "password" : "text",
|
|
2907
2920
|
disabled: t,
|
|
2908
2921
|
spacing: p,
|
|
2909
2922
|
onBlur: D,
|
|
2910
2923
|
onFocus: Pe,
|
|
2911
2924
|
onChange: De,
|
|
2912
2925
|
rightElement: V.cloneElement(h, {
|
|
2913
|
-
ref:
|
|
2914
|
-
label:
|
|
2926
|
+
ref: l,
|
|
2927
|
+
label: oe,
|
|
2915
2928
|
onClick: N,
|
|
2916
2929
|
onBlur: x,
|
|
2917
2930
|
disabled: t
|
|
@@ -2945,7 +2958,7 @@ try {
|
|
|
2945
2958
|
});
|
|
2946
2959
|
} catch {
|
|
2947
2960
|
}
|
|
2948
|
-
const
|
|
2961
|
+
const Sn = (e) => {
|
|
2949
2962
|
let t = "";
|
|
2950
2963
|
if (typeof e == "number" || typeof e == "string")
|
|
2951
2964
|
t = "m-" + e;
|
|
@@ -2966,11 +2979,11 @@ const An = (e) => {
|
|
|
2966
2979
|
semantic: u = !1,
|
|
2967
2980
|
...h
|
|
2968
2981
|
}) => {
|
|
2969
|
-
const p =
|
|
2982
|
+
const p = Sn(s), m = f(
|
|
2970
2983
|
p,
|
|
2971
2984
|
a || o
|
|
2972
2985
|
);
|
|
2973
|
-
return /* @__PURE__ */ I(
|
|
2986
|
+
return /* @__PURE__ */ I(le, { children: [
|
|
2974
2987
|
/* @__PURE__ */ c(
|
|
2975
2988
|
"svg",
|
|
2976
2989
|
{
|
|
@@ -3001,7 +3014,7 @@ try {
|
|
|
3001
3014
|
});
|
|
3002
3015
|
} catch {
|
|
3003
3016
|
}
|
|
3004
|
-
const
|
|
3017
|
+
const An = ({
|
|
3005
3018
|
className: e,
|
|
3006
3019
|
viewBox: t,
|
|
3007
3020
|
spacing: r,
|
|
@@ -3026,7 +3039,7 @@ const Sn = ({
|
|
|
3026
3039
|
}
|
|
3027
3040
|
) })
|
|
3028
3041
|
}
|
|
3029
|
-
),
|
|
3042
|
+
), vn = ({
|
|
3030
3043
|
className: e,
|
|
3031
3044
|
viewBox: t,
|
|
3032
3045
|
spacing: r,
|
|
@@ -3054,7 +3067,7 @@ const Sn = ({
|
|
|
3054
3067
|
/* @__PURE__ */ c("path", { d: "M5.1 9.2C13.3-1.2 28.4-3.1 38.8 5.1l592 464c10.4 8.2 12.3 23.3 4.1 33.7s-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2z" })
|
|
3055
3068
|
]
|
|
3056
3069
|
}
|
|
3057
|
-
),
|
|
3070
|
+
), kn = ({
|
|
3058
3071
|
className: e,
|
|
3059
3072
|
viewBox: t,
|
|
3060
3073
|
spacing: r,
|
|
@@ -3093,7 +3106,7 @@ const Sn = ({
|
|
|
3093
3106
|
]
|
|
3094
3107
|
}
|
|
3095
3108
|
);
|
|
3096
|
-
},
|
|
3109
|
+
}, _n = ({
|
|
3097
3110
|
className: e,
|
|
3098
3111
|
viewBox: t,
|
|
3099
3112
|
spacing: r,
|
|
@@ -3135,7 +3148,7 @@ try {
|
|
|
3135
3148
|
});
|
|
3136
3149
|
} catch {
|
|
3137
3150
|
}
|
|
3138
|
-
const
|
|
3151
|
+
const Rn = (e) => {
|
|
3139
3152
|
let t = "";
|
|
3140
3153
|
if (typeof e == "number" || typeof e == "string")
|
|
3141
3154
|
t = "m-" + e;
|
|
@@ -3144,7 +3157,7 @@ const Nn = (e) => {
|
|
|
3144
3157
|
(e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
|
|
3145
3158
|
}
|
|
3146
3159
|
return t;
|
|
3147
|
-
},
|
|
3160
|
+
}, Nn = "av-flexgrid", Ee = "av-flexgrid-item", _e = 0.25, er = V.createContext({
|
|
3148
3161
|
columnGap: 0,
|
|
3149
3162
|
rowGap: 0
|
|
3150
3163
|
}), gt = ({
|
|
@@ -3171,15 +3184,15 @@ const Nn = (e) => {
|
|
|
3171
3184
|
* by the columnGap and rowGap that will be applied
|
|
3172
3185
|
* to all FlexgridItems (see context and paddings).
|
|
3173
3186
|
*/
|
|
3174
|
-
marginLeft: r * -1 *
|
|
3175
|
-
marginTop: a * -1 *
|
|
3176
|
-
},
|
|
3177
|
-
|
|
3187
|
+
marginLeft: r * -1 * _e + "rem",
|
|
3188
|
+
marginTop: a * -1 * _e + "rem"
|
|
3189
|
+
}, l = f(
|
|
3190
|
+
Nn,
|
|
3178
3191
|
t,
|
|
3179
3192
|
"box-border flex flex-wrap"
|
|
3180
|
-
),
|
|
3181
|
-
return /* @__PURE__ */ c(
|
|
3182
|
-
},
|
|
3193
|
+
), d = { columnGap: r, rowGap: a }, y = h ? "div" : V.Fragment;
|
|
3194
|
+
return /* @__PURE__ */ c(y, { ...h ? { className: Rn(h) } : {}, children: /* @__PURE__ */ c("div", { className: l, style: m, ...p, children: /* @__PURE__ */ c(er.Provider, { value: d, children: e }) }) });
|
|
3195
|
+
}, Je = (e, t) => f({
|
|
3183
3196
|
"basis-1/12": e === 1 && !t,
|
|
3184
3197
|
"sm:basis-1/12": e === 1 && t === "sm",
|
|
3185
3198
|
"md:basis-1/12": e === 1 && t === "md",
|
|
@@ -3252,39 +3265,39 @@ const Nn = (e) => {
|
|
|
3252
3265
|
"lg:basis-full": e === 12 && t === "lg",
|
|
3253
3266
|
"xl:basis-full": e === 12 && t === "xl",
|
|
3254
3267
|
"2xl:basis-full": e === 12 && t === "2xl"
|
|
3255
|
-
}),
|
|
3268
|
+
}), xn = ({
|
|
3256
3269
|
className: e,
|
|
3257
3270
|
span: t
|
|
3258
3271
|
}) => {
|
|
3259
3272
|
if (!t)
|
|
3260
|
-
return
|
|
3273
|
+
return f(e, Ee, "box-border basis-auto");
|
|
3261
3274
|
if (typeof t == "number")
|
|
3262
|
-
return
|
|
3263
|
-
[`${
|
|
3275
|
+
return f(e, Ee, "box-border max-w-full", {
|
|
3276
|
+
[`${Je(t)}`]: !0
|
|
3264
3277
|
});
|
|
3265
3278
|
if (typeof t == "string")
|
|
3266
|
-
return
|
|
3279
|
+
return f(e, Ee, "box-border basis-auto", {
|
|
3267
3280
|
"max-w-full grow": t === "auto"
|
|
3268
3281
|
});
|
|
3269
3282
|
if (typeof t == "object") {
|
|
3270
|
-
const r = Object.entries(t).map(([a, n]) => a === "fallback" ?
|
|
3271
|
-
return
|
|
3283
|
+
const r = Object.entries(t).map(([a, n]) => a === "fallback" ? Je(n) : Je(n, a));
|
|
3284
|
+
return f(
|
|
3272
3285
|
e,
|
|
3273
|
-
|
|
3286
|
+
Ee,
|
|
3274
3287
|
"box-border",
|
|
3275
3288
|
r
|
|
3276
3289
|
);
|
|
3277
3290
|
}
|
|
3278
|
-
},
|
|
3291
|
+
}, ae = ({
|
|
3279
3292
|
children: e,
|
|
3280
3293
|
className: t,
|
|
3281
3294
|
span: r,
|
|
3282
3295
|
...a
|
|
3283
3296
|
}) => {
|
|
3284
3297
|
const { columnGap: n, rowGap: o } = yt(er), s = {
|
|
3285
|
-
paddingLeft: n *
|
|
3286
|
-
paddingTop: o *
|
|
3287
|
-
}, i =
|
|
3298
|
+
paddingLeft: n * _e + "rem",
|
|
3299
|
+
paddingTop: o * _e + "rem"
|
|
3300
|
+
}, i = xn({
|
|
3288
3301
|
className: t,
|
|
3289
3302
|
span: r
|
|
3290
3303
|
});
|
|
@@ -3303,14 +3316,16 @@ try {
|
|
|
3303
3316
|
});
|
|
3304
3317
|
} catch {
|
|
3305
3318
|
}
|
|
3306
|
-
const
|
|
3319
|
+
const Cn = "ASK! ME! ANYTHING!", tr = "Sassy Saint", On = "gizmette.com", Pn = "Log in", Dn = "Sign in with a Passkey", Bo = "Log out", $n = "Password", Ln = "Powered by OpenAI", Wo = "Send", Go = "Profile", Vo = "Statistics", Yo = "Chat history", Jo = "About", Fo = "Type your question here", zo = "Clear chat", jo = "Cancel chat", qo = "N/A", Qo = {
|
|
3307
3320
|
PREFERENCES: {
|
|
3308
|
-
TITLE: "User
|
|
3321
|
+
TITLE: "User settings",
|
|
3309
3322
|
NAME: "Name",
|
|
3310
3323
|
EMAIL: "Email",
|
|
3311
3324
|
ENGINE_DETAILS: "Show message statistics",
|
|
3312
3325
|
LOCATION: "Location",
|
|
3313
|
-
|
|
3326
|
+
PASSKEY_TITLE: "Passkey",
|
|
3327
|
+
PASSKEY_INSTRUCTIONS: "Log in password-free with a passkey (facial recognition or fingerprint authentication).",
|
|
3328
|
+
PASSKEY_BUTTON: "Create a Passkey"
|
|
3314
3329
|
},
|
|
3315
3330
|
CURRENT_STATISTICS: {
|
|
3316
3331
|
TITLE: "Current chat statistics",
|
|
@@ -3335,61 +3350,61 @@ const On = "ASK! ME! ANYTHING!", tr = "Sassy Saint", Pn = "gizmette.com", Dn = "
|
|
|
3335
3350
|
ENGINE: "OpenAI model",
|
|
3336
3351
|
PLUGIN: "Plugin"
|
|
3337
3352
|
}
|
|
3338
|
-
},
|
|
3353
|
+
}, Mn = ({
|
|
3339
3354
|
serverStats: e
|
|
3340
3355
|
}) => /* @__PURE__ */ c(
|
|
3341
|
-
|
|
3356
|
+
en,
|
|
3342
3357
|
{
|
|
3343
3358
|
mode: "light",
|
|
3344
3359
|
row1: /* @__PURE__ */ I("div", { children: [
|
|
3345
3360
|
tr,
|
|
3346
3361
|
" v",
|
|
3347
|
-
"4.0
|
|
3362
|
+
"4.1.0",
|
|
3348
3363
|
" - ",
|
|
3349
|
-
|
|
3364
|
+
Ln,
|
|
3350
3365
|
Qe && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
|
|
3351
3366
|
] }),
|
|
3352
3367
|
row2: /* @__PURE__ */ I("div", { children: [
|
|
3353
3368
|
"© ",
|
|
3354
3369
|
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
3355
3370
|
" ",
|
|
3356
|
-
|
|
3371
|
+
On
|
|
3357
3372
|
] })
|
|
3358
3373
|
}
|
|
3359
|
-
),
|
|
3374
|
+
), Un = wt(() => import("./LazyHeader.D_ViNWrh.js")), Hn = () => {
|
|
3360
3375
|
const { isAuthenticated: e } = qe();
|
|
3361
|
-
return /* @__PURE__ */ I(
|
|
3362
|
-
e && /* @__PURE__ */ c(Tt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(
|
|
3376
|
+
return /* @__PURE__ */ I(le, { children: [
|
|
3377
|
+
e && /* @__PURE__ */ c(Tt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Un, {}) }),
|
|
3363
3378
|
/* @__PURE__ */ I("div", { className: "flex items-center justify-center", children: [
|
|
3364
|
-
/* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(
|
|
3379
|
+
/* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(An, {}) }),
|
|
3365
3380
|
/* @__PURE__ */ I("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
|
|
3366
3381
|
/* @__PURE__ */ c("h1", { children: tr }),
|
|
3367
|
-
/* @__PURE__ */ c("h2", { children:
|
|
3382
|
+
/* @__PURE__ */ c("h2", { children: Cn })
|
|
3368
3383
|
] })
|
|
3369
3384
|
] })
|
|
3370
3385
|
] });
|
|
3371
|
-
},
|
|
3372
|
-
const { login: e, logoutReason: t, loginWithPasskey: r } = qe(), [a, n] =
|
|
3386
|
+
}, Kn = () => {
|
|
3387
|
+
const { login: e, logoutReason: t, loginWithPasskey: r } = qe(), [a, n] = J(""), [o, s] = J(""), [i, u] = J(!0), [h, p] = J({
|
|
3373
3388
|
username: "",
|
|
3374
3389
|
password: ""
|
|
3375
|
-
}), m = async (
|
|
3376
|
-
|
|
3390
|
+
}), m = async (l) => {
|
|
3391
|
+
l.preventDefault(), await e(h.username, h.password) || (s(""), n("Invalid username or password"));
|
|
3377
3392
|
};
|
|
3378
3393
|
return j(() => {
|
|
3379
|
-
var
|
|
3380
|
-
(
|
|
3381
|
-
var
|
|
3382
|
-
(
|
|
3394
|
+
var l;
|
|
3395
|
+
(l = document.getElementById("logo")) == null || l.classList.add("fadeOut"), setTimeout(() => {
|
|
3396
|
+
var d;
|
|
3397
|
+
(d = document.getElementById("root")) == null || d.classList.replace("app-hidden", "fadeIn");
|
|
3383
3398
|
}, 500);
|
|
3384
3399
|
}), j(() => {
|
|
3385
3400
|
t && s(t);
|
|
3386
|
-
}, [t]), /* @__PURE__ */ I(
|
|
3387
|
-
/* @__PURE__ */ I(
|
|
3388
|
-
/* @__PURE__ */ c("div", { className:
|
|
3401
|
+
}, [t]), /* @__PURE__ */ I(le, { children: [
|
|
3402
|
+
/* @__PURE__ */ I(tn, { children: [
|
|
3403
|
+
/* @__PURE__ */ c("div", { className: Ha(), children: /* @__PURE__ */ c(Hn, {}) }),
|
|
3389
3404
|
/* @__PURE__ */ I("form", { className: "mt-5", onSubmit: m, children: [
|
|
3390
|
-
/* @__PURE__ */ c(gt, { alignHorizontal: "center", rowGap: 7, children: /* @__PURE__ */ c(
|
|
3391
|
-
/* @__PURE__ */ c(
|
|
3392
|
-
/* @__PURE__ */ c(
|
|
3405
|
+
/* @__PURE__ */ c(gt, { alignHorizontal: "center", rowGap: 7, children: /* @__PURE__ */ c(ae, { span: 6, children: /* @__PURE__ */ I(Za, { mode: "dark", children: [
|
|
3406
|
+
/* @__PURE__ */ c(ae, { span: 12, children: o && /* @__PURE__ */ c("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: o }) }),
|
|
3407
|
+
/* @__PURE__ */ c(ae, { span: 12, children: /* @__PURE__ */ c(
|
|
3393
3408
|
Ze,
|
|
3394
3409
|
{
|
|
3395
3410
|
required: !0,
|
|
@@ -3400,16 +3415,16 @@ const On = "ASK! ME! ANYTHING!", tr = "Sassy Saint", Pn = "gizmette.com", Dn = "
|
|
|
3400
3415
|
focusMode: "light",
|
|
3401
3416
|
name: "username",
|
|
3402
3417
|
label: "Username",
|
|
3403
|
-
onChange: (
|
|
3418
|
+
onChange: (l) => {
|
|
3404
3419
|
p({
|
|
3405
3420
|
...h,
|
|
3406
|
-
username:
|
|
3421
|
+
username: l.target.value
|
|
3407
3422
|
}), n("");
|
|
3408
3423
|
},
|
|
3409
3424
|
error: a !== ""
|
|
3410
3425
|
}
|
|
3411
3426
|
) }),
|
|
3412
|
-
/* @__PURE__ */ c(
|
|
3427
|
+
/* @__PURE__ */ c(ae, { span: 12, children: /* @__PURE__ */ c(
|
|
3413
3428
|
Zt,
|
|
3414
3429
|
{
|
|
3415
3430
|
required: !0,
|
|
@@ -3419,20 +3434,20 @@ const On = "ASK! ME! ANYTHING!", tr = "Sassy Saint", Pn = "gizmette.com", Dn = "
|
|
|
3419
3434
|
mode: "dark",
|
|
3420
3435
|
focusMode: "light",
|
|
3421
3436
|
name: "password",
|
|
3422
|
-
label:
|
|
3423
|
-
rightElement: /* @__PURE__ */ c(
|
|
3437
|
+
label: $n,
|
|
3438
|
+
rightElement: /* @__PURE__ */ c(Fe, { focusMode: "light", mode: "dark", children: i ? /* @__PURE__ */ c(_n, {}) : /* @__PURE__ */ c(vn, {}) }),
|
|
3424
3439
|
onMaskChange: u,
|
|
3425
|
-
onChange: (
|
|
3440
|
+
onChange: (l) => {
|
|
3426
3441
|
p({
|
|
3427
3442
|
...h,
|
|
3428
|
-
password:
|
|
3443
|
+
password: l.target.value
|
|
3429
3444
|
}), n("");
|
|
3430
3445
|
},
|
|
3431
3446
|
error: a !== "",
|
|
3432
3447
|
helperText: a
|
|
3433
3448
|
}
|
|
3434
3449
|
) }),
|
|
3435
|
-
/* @__PURE__ */ c(
|
|
3450
|
+
/* @__PURE__ */ c(ae, { span: 12, children: /* @__PURE__ */ c(
|
|
3436
3451
|
zt,
|
|
3437
3452
|
{
|
|
3438
3453
|
mode: "light",
|
|
@@ -3441,108 +3456,109 @@ const On = "ASK! ME! ANYTHING!", tr = "Sassy Saint", Pn = "gizmette.com", Dn = "
|
|
|
3441
3456
|
noBorder: !0,
|
|
3442
3457
|
type: "submit",
|
|
3443
3458
|
className: "mb-4 mt-6",
|
|
3444
|
-
children:
|
|
3459
|
+
children: Pn
|
|
3445
3460
|
}
|
|
3446
3461
|
) })
|
|
3447
3462
|
] }) }) }),
|
|
3448
3463
|
/* @__PURE__ */ c("div", { className: "text-center text-copy-light", children: "or" }),
|
|
3449
|
-
/* @__PURE__ */ c(gt, { alignHorizontal: "center", children: /* @__PURE__ */ c(
|
|
3450
|
-
|
|
3464
|
+
/* @__PURE__ */ c(gt, { alignHorizontal: "center", children: /* @__PURE__ */ c(ae, { span: 6, children: /* @__PURE__ */ c(
|
|
3465
|
+
Fe,
|
|
3451
3466
|
{
|
|
3452
3467
|
mode: "dark",
|
|
3453
3468
|
focusMode: "light",
|
|
3454
3469
|
fullWidth: !0,
|
|
3455
3470
|
noBorder: !0,
|
|
3456
3471
|
className: "mb-4 mt-1",
|
|
3457
|
-
labelRight:
|
|
3472
|
+
labelRight: Dn,
|
|
3458
3473
|
onClick: r,
|
|
3459
|
-
children: /* @__PURE__ */ c(
|
|
3474
|
+
children: /* @__PURE__ */ c(kn, { className: "size-7" })
|
|
3460
3475
|
}
|
|
3461
3476
|
) }) })
|
|
3462
3477
|
] })
|
|
3463
3478
|
] }),
|
|
3464
|
-
/* @__PURE__ */ c(
|
|
3479
|
+
/* @__PURE__ */ c(Mn, {})
|
|
3465
3480
|
] });
|
|
3466
|
-
},
|
|
3481
|
+
}, Bn = new URL(document.location.href).searchParams, Wn = !!Bn.get("debug") || !1, Gn = wt(() => import("./App.8LsHfy0z.js").then((e) => e.App)), Vn = ({ isComponent: e }) => {
|
|
3467
3482
|
const { isAuthenticated: t } = qe();
|
|
3468
|
-
return t ? /* @__PURE__ */ c(Tt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(
|
|
3469
|
-
},
|
|
3483
|
+
return t ? /* @__PURE__ */ c(Tt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Gn, { isComponent: e }) }) : /* @__PURE__ */ c(Kn, {});
|
|
3484
|
+
}, Yn = ({
|
|
3470
3485
|
isComponent: e = !1,
|
|
3471
|
-
domain: t =
|
|
3472
|
-
}) => /* @__PURE__ */ c(
|
|
3486
|
+
domain: t = Ua
|
|
3487
|
+
}) => /* @__PURE__ */ c(le, { children: /* @__PURE__ */ c(_a, { clientId: Ra, domain: t, debug: Wn, children: /* @__PURE__ */ c(Vn, { isComponent: e }) }) }), Xo = ({ domain: e }) => /* @__PURE__ */ c(Yn, { isComponent: !0, domain: e });
|
|
3473
3488
|
export {
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3489
|
+
Ft as A,
|
|
3490
|
+
Jo as ABOUT_TITLE,
|
|
3491
|
+
mo as ACTION_LOCATION,
|
|
3492
|
+
io as ACTION_MESSAGE,
|
|
3493
|
+
lo as ACTION_MODEL,
|
|
3494
|
+
co as ACTION_RESET,
|
|
3495
|
+
uo as ACTION_RESTORE,
|
|
3496
|
+
po as ACTION_SEARCH,
|
|
3497
|
+
go as ACTION_SORT,
|
|
3498
|
+
ho as ACTION_STREAMING,
|
|
3499
|
+
Mn as AppFooter,
|
|
3500
|
+
jo as CANCEL,
|
|
3501
|
+
Qo as CARDS,
|
|
3502
|
+
zo as CLEAR,
|
|
3503
|
+
no as ERROR_MESSAGE,
|
|
3504
|
+
so as GPT4_MAX_TOKENS,
|
|
3505
|
+
Yo as HISTORY_TITLE,
|
|
3506
|
+
yo as LOCAL_STORAGE_CHAT_DETAILS,
|
|
3507
|
+
wo as LOCAL_STORAGE_LOCATION,
|
|
3508
|
+
fo as LOCAL_STORAGE_PREFIX,
|
|
3509
|
+
bo as LOCAL_STORAGE_SEARCH,
|
|
3510
|
+
Eo as LOCAL_STORAGE_SORT,
|
|
3511
|
+
Bo as LOG_OUT,
|
|
3512
|
+
an as M,
|
|
3513
|
+
oo as MODEL_GPT4,
|
|
3514
|
+
Hn as MessagesContainerHeader,
|
|
3515
|
+
Po as N,
|
|
3516
|
+
Za as N$1,
|
|
3517
|
+
qo as NA,
|
|
3518
|
+
Fe as O,
|
|
3519
|
+
Go as PROFILE_TITLE,
|
|
3520
|
+
eo as ROLE_ASSISTANT,
|
|
3521
|
+
ao as ROLE_HIDDEN,
|
|
3522
|
+
ro as ROLE_INTERNAL,
|
|
3523
|
+
to as ROLE_SYSTEM,
|
|
3524
|
+
Zn as ROLE_USER,
|
|
3510
3525
|
Ce as S,
|
|
3511
3526
|
Wo as SEND,
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3527
|
+
Vo as STATS,
|
|
3528
|
+
To as STATS_SEPARATOR,
|
|
3529
|
+
Xo as SassySaint,
|
|
3530
|
+
Fo as TYPE_QUESTION,
|
|
3516
3531
|
Qt as U,
|
|
3532
|
+
ne as W,
|
|
3517
3533
|
Ze as Y,
|
|
3518
|
-
|
|
3534
|
+
Uo as a,
|
|
3519
3535
|
gt as b,
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3536
|
+
tn as c,
|
|
3537
|
+
$o as c$1,
|
|
3538
|
+
So as convertLatitudeToDMS,
|
|
3539
|
+
Ao as convertLongitudeToDMS,
|
|
3540
|
+
xo as durationFormatter,
|
|
3541
|
+
_o as extractAverage,
|
|
3542
|
+
Yt as f,
|
|
3543
|
+
rn as f$1,
|
|
3528
3544
|
Oe as g,
|
|
3529
|
-
|
|
3530
|
-
|
|
3545
|
+
vo as getCurrentGeoLocation,
|
|
3546
|
+
Ha as getMessageContaintWrapperClass,
|
|
3531
3547
|
Xe as i,
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3548
|
+
Do as i$1,
|
|
3549
|
+
Ro as isLastMessageFromRole,
|
|
3550
|
+
ae as j,
|
|
3551
|
+
Ho as l,
|
|
3552
|
+
Lo as n,
|
|
3553
|
+
No as numberFormatter,
|
|
3538
3554
|
ln as o,
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3555
|
+
Ko as p,
|
|
3556
|
+
Co as pluralize,
|
|
3557
|
+
qe as qr,
|
|
3558
|
+
Mo as r,
|
|
3559
|
+
ko as renderDataAsList,
|
|
3560
|
+
Oo as s,
|
|
3561
|
+
Io as truncate,
|
|
3562
|
+
kn as v,
|
|
3563
|
+
zt as x
|
|
3548
3564
|
};
|