@versini/sassysaint 1.0.7 → 1.0.9

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.
@@ -1,3949 +0,0 @@
1
- import { jsx as u, jsxs as S, Fragment as me } from "react/jsx-runtime";
2
- import F, { createContext as yr, useReducer as Ct, useRef as q, useCallback as le, useEffect as re, useContext as xt, useSyncExternalStore as br, useId as Ot, useMemo as wr, useState as J, useLayoutEffect as vr, lazy as Pt, Suspense as Dt } from "react";
3
- import b from "clsx";
4
- var Er = Object.defineProperty, Sr = (e, t, r) => t in e ? Er(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Be = (e, t, r) => Sr(e, typeof t != "symbol" ? t + "" : t, r);
5
- /*!
6
- @versini/auth-provider v6.1.1
7
- © 2024 gizmette.com
8
- */
9
- try {
10
- window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
11
- version: "6.1.1",
12
- buildTime: "07/16/2024 05:27 PM EDT",
13
- homepage: "https://github.com/aversini/auth-client",
14
- license: "MIT"
15
- });
16
- } catch {
17
- }
18
- function B(e) {
19
- const t = new Uint8Array(e);
20
- let r = "";
21
- for (const n of t)
22
- r += String.fromCharCode(n);
23
- return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
24
- }
25
- function _e(e) {
26
- const t = e.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - t.length % 4) % 4, n = t.padEnd(t.length + r, "="), a = atob(n), o = new ArrayBuffer(a.length), i = new Uint8Array(o);
27
- for (let s = 0; s < a.length; s++)
28
- i[s] = a.charCodeAt(s);
29
- return o;
30
- }
31
- function tt() {
32
- return (window == null ? void 0 : window.PublicKeyCredential) !== void 0 && typeof window.PublicKeyCredential == "function";
33
- }
34
- function Mt(e) {
35
- const { id: t } = e;
36
- return {
37
- ...e,
38
- id: _e(t),
39
- transports: e.transports
40
- };
41
- }
42
- function $t(e) {
43
- return e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e);
44
- }
45
- let _ = class extends Error {
46
- constructor({ message: t, code: r, cause: n, name: a }) {
47
- super(t, { cause: n }), this.name = a ?? n.name, this.code = r;
48
- }
49
- };
50
- function Tr({ error: e, options: t }) {
51
- var r, n;
52
- const { publicKey: a } = t;
53
- if (!a)
54
- throw Error("options was missing required publicKey property");
55
- if (e.name === "AbortError") {
56
- if (t.signal instanceof AbortSignal)
57
- return new _({
58
- message: "Registration ceremony was sent an abort signal",
59
- code: "ERROR_CEREMONY_ABORTED",
60
- cause: e
61
- });
62
- } else if (e.name === "ConstraintError") {
63
- if (((r = a.authenticatorSelection) == null ? void 0 : r.requireResidentKey) === !0)
64
- return new _({
65
- message: "Discoverable credentials were required but no available authenticator supported it",
66
- code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
67
- cause: e
68
- });
69
- if (((n = a.authenticatorSelection) == null ? void 0 : n.userVerification) === "required")
70
- return new _({
71
- message: "User verification was required but no available authenticator supported it",
72
- code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
73
- cause: e
74
- });
75
- } else {
76
- if (e.name === "InvalidStateError")
77
- return new _({
78
- message: "The authenticator was previously registered",
79
- code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
80
- cause: e
81
- });
82
- if (e.name === "NotAllowedError")
83
- return new _({
84
- message: e.message,
85
- code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
86
- cause: e
87
- });
88
- if (e.name === "NotSupportedError")
89
- return a.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new _({
90
- message: 'No entry in pubKeyCredParams was of type "public-key"',
91
- code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
92
- cause: e
93
- }) : new _({
94
- message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
95
- code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
96
- cause: e
97
- });
98
- if (e.name === "SecurityError") {
99
- const o = window.location.hostname;
100
- if ($t(o)) {
101
- if (a.rp.id !== o)
102
- return new _({
103
- message: `The RP ID "${a.rp.id}" is invalid for this domain`,
104
- code: "ERROR_INVALID_RP_ID",
105
- cause: e
106
- });
107
- } else return new _({
108
- message: `${window.location.hostname} is an invalid domain`,
109
- code: "ERROR_INVALID_DOMAIN",
110
- cause: e
111
- });
112
- } else if (e.name === "TypeError") {
113
- if (a.user.id.byteLength < 1 || a.user.id.byteLength > 64)
114
- return new _({
115
- message: "User ID was not between 1 and 64 characters",
116
- code: "ERROR_INVALID_USER_ID_LENGTH",
117
- cause: e
118
- });
119
- } else if (e.name === "UnknownError")
120
- return new _({
121
- message: "The authenticator was unable to process the specified options, or could not create a new credential",
122
- code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
123
- cause: e
124
- });
125
- }
126
- return e;
127
- }
128
- class Ar {
129
- createNewAbortSignal() {
130
- if (this.controller) {
131
- const r = new Error("Cancelling existing WebAuthn API call for new one");
132
- r.name = "AbortError", this.controller.abort(r);
133
- }
134
- const t = new AbortController();
135
- return this.controller = t, t.signal;
136
- }
137
- cancelCeremony() {
138
- if (this.controller) {
139
- const t = new Error("Manually cancelling existing WebAuthn API call");
140
- t.name = "AbortError", this.controller.abort(t), this.controller = void 0;
141
- }
142
- }
143
- }
144
- const Lt = new Ar(), Ir = ["cross-platform", "platform"];
145
- function Ut(e) {
146
- if (e && !(Ir.indexOf(e) < 0))
147
- return e;
148
- }
149
- async function kr(e) {
150
- var t;
151
- if (!tt())
152
- throw new Error("WebAuthn is not supported in this browser");
153
- const r = { publicKey: {
154
- ...e,
155
- challenge: _e(e.challenge),
156
- user: {
157
- ...e.user,
158
- id: _e(e.user.id)
159
- },
160
- excludeCredentials: (t = e.excludeCredentials) == null ? void 0 : t.map(Mt)
161
- } };
162
- r.signal = Lt.createNewAbortSignal();
163
- let n;
164
- try {
165
- n = await navigator.credentials.create(r);
166
- } catch (m) {
167
- throw Tr({ error: m, options: r });
168
- }
169
- if (!n)
170
- throw new Error("Registration was not completed");
171
- const { id: a, rawId: o, response: i, type: s } = n;
172
- let l;
173
- typeof i.getTransports == "function" && (l = i.getTransports());
174
- let d;
175
- if (typeof i.getPublicKeyAlgorithm == "function")
176
- try {
177
- d = i.getPublicKeyAlgorithm();
178
- } catch (m) {
179
- Ke("getPublicKeyAlgorithm()", m);
180
- }
181
- let c;
182
- if (typeof i.getPublicKey == "function")
183
- try {
184
- const m = i.getPublicKey();
185
- m !== null && (c = B(m));
186
- } catch (m) {
187
- Ke("getPublicKey()", m);
188
- }
189
- let h;
190
- if (typeof i.getAuthenticatorData == "function")
191
- try {
192
- h = B(i.getAuthenticatorData());
193
- } catch (m) {
194
- Ke("getAuthenticatorData()", m);
195
- }
196
- return {
197
- id: a,
198
- rawId: B(o),
199
- response: {
200
- attestationObject: B(i.attestationObject),
201
- clientDataJSON: B(i.clientDataJSON),
202
- transports: l,
203
- publicKeyAlgorithm: d,
204
- publicKey: c,
205
- authenticatorData: h
206
- },
207
- type: s,
208
- clientExtensionResults: n.getClientExtensionResults(),
209
- authenticatorAttachment: Ut(n.authenticatorAttachment)
210
- };
211
- }
212
- function Ke(e, t) {
213
- console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
214
- `, t);
215
- }
216
- function _r() {
217
- if (!tt())
218
- return new Promise((t) => t(!1));
219
- const e = window.PublicKeyCredential;
220
- return e.isConditionalMediationAvailable === void 0 ? new Promise((t) => t(!1)) : e.isConditionalMediationAvailable();
221
- }
222
- function Rr({ error: e, options: t }) {
223
- const { publicKey: r } = t;
224
- if (!r)
225
- throw Error("options was missing required publicKey property");
226
- if (e.name === "AbortError") {
227
- if (t.signal instanceof AbortSignal)
228
- return new _({
229
- message: "Authentication ceremony was sent an abort signal",
230
- code: "ERROR_CEREMONY_ABORTED",
231
- cause: e
232
- });
233
- } else {
234
- if (e.name === "NotAllowedError")
235
- return new _({
236
- message: e.message,
237
- code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
238
- cause: e
239
- });
240
- if (e.name === "SecurityError") {
241
- const n = window.location.hostname;
242
- if ($t(n)) {
243
- if (r.rpId !== n)
244
- return new _({
245
- message: `The RP ID "${r.rpId}" is invalid for this domain`,
246
- code: "ERROR_INVALID_RP_ID",
247
- cause: e
248
- });
249
- } else return new _({
250
- message: `${window.location.hostname} is an invalid domain`,
251
- code: "ERROR_INVALID_DOMAIN",
252
- cause: e
253
- });
254
- } else if (e.name === "UnknownError")
255
- return new _({
256
- message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
257
- code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
258
- cause: e
259
- });
260
- }
261
- return e;
262
- }
263
- async function Nr(e, t = !1) {
264
- var r, n;
265
- if (!tt())
266
- throw new Error("WebAuthn is not supported in this browser");
267
- let a;
268
- ((r = e.allowCredentials) == null ? void 0 : r.length) !== 0 && (a = (n = e.allowCredentials) == null ? void 0 : n.map(Mt));
269
- const o = {
270
- ...e,
271
- challenge: _e(e.challenge),
272
- allowCredentials: a
273
- }, i = {};
274
- if (t) {
275
- if (!await _r())
276
- throw Error("Browser does not support WebAuthn autofill");
277
- if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1)
278
- throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
279
- i.mediation = "conditional", o.allowCredentials = [];
280
- }
281
- i.publicKey = o, i.signal = Lt.createNewAbortSignal();
282
- let s;
283
- try {
284
- s = await navigator.credentials.get(i);
285
- } catch (p) {
286
- throw Rr({ error: p, options: i });
287
- }
288
- if (!s)
289
- throw new Error("Authentication was not completed");
290
- const { id: l, rawId: d, response: c, type: h } = s;
291
- let m;
292
- return c.userHandle && (m = B(c.userHandle)), {
293
- id: l,
294
- rawId: B(d),
295
- response: {
296
- authenticatorData: B(c.authenticatorData),
297
- clientDataJSON: B(c.clientDataJSON),
298
- signature: B(c.signature),
299
- userHandle: m
300
- },
301
- type: h,
302
- clientExtensionResults: s.getClientExtensionResults(),
303
- authenticatorAttachment: Ut(s.authenticatorAttachment)
304
- };
305
- }
306
- /*!
307
- @versini/auth-common v2.12.1
308
- © 2024 gizmette.com
309
- */
310
- try {
311
- window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
312
- version: "2.12.1",
313
- buildTime: "07/16/2024 05:27 PM EDT",
314
- homepage: "https://github.com/aversini/auth-client",
315
- license: "MIT"
316
- });
317
- } catch {
318
- }
319
- const ne = {
320
- ID_TOKEN: "id_token",
321
- ACCESS_TOKEN: "token",
322
- ID_AND_ACCESS_TOKEN: "id_token token",
323
- CODE: "code",
324
- REFRESH_TOKEN: "refresh_token",
325
- PASSKEY: "passkey"
326
- }, Ht = {
327
- CLIENT_ID: "X-Auth-ClientId"
328
- }, C = {
329
- ALG: "RS256",
330
- USER_ID_KEY: "sub",
331
- TOKEN_ID_KEY: "__raw",
332
- NONCE_KEY: "_nonce",
333
- USERNAME_KEY: "username",
334
- AUTH_TYPE_KEY: "auth_type",
335
- ISSUER: "gizmette.com"
336
- }, Cr = `-----BEGIN PUBLIC KEY-----
337
- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
338
- w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
339
- i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
340
- aMwPFOIcJH+rKfFgNcHLcaS5syp7zU1ANwZ+trgR+DifBr8TLVkBynmNeTyhDm2+
341
- l0haqjMk0UoNPPE8iYBWUHQJJE1Dqstj65d6Eh5g64Pao25y4cmYJbKjiblIGEkE
342
- sjqybA9mARAqh9k/eiIopecWSiffNQTwVQVd2I9ZH3BalhEXHlqFgrjz51kFqg81
343
- awIDAQAB
344
- -----END PUBLIC KEY-----`, xe = {
345
- AUTHENTICATE: "authenticate",
346
- CODE: "code",
347
- LOGOUT: "logout"
348
- }, Oe = crypto, Bt = (e) => e instanceof CryptoKey, he = new TextEncoder(), Pe = new TextDecoder();
349
- function xr(...e) {
350
- const t = e.reduce((a, { length: o }) => a + o, 0), r = new Uint8Array(t);
351
- let n = 0;
352
- for (const a of e)
353
- r.set(a, n), n += a.length;
354
- return r;
355
- }
356
- const Or = (e) => {
357
- const t = atob(e), r = new Uint8Array(t.length);
358
- for (let n = 0; n < t.length; n++)
359
- r[n] = t.charCodeAt(n);
360
- return r;
361
- }, Te = (e) => {
362
- let t = e;
363
- t instanceof Uint8Array && (t = Pe.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
364
- try {
365
- return Or(t);
366
- } catch {
367
- throw new TypeError("The input to be decoded is not correctly encoded.");
368
- }
369
- };
370
- let Q = class extends Error {
371
- static get code() {
372
- return "ERR_JOSE_GENERIC";
373
- }
374
- constructor(t) {
375
- var r;
376
- super(t), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
377
- }
378
- }, H = class extends Q {
379
- static get code() {
380
- return "ERR_JWT_CLAIM_VALIDATION_FAILED";
381
- }
382
- constructor(t, r, n = "unspecified", a = "unspecified") {
383
- super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = n, this.reason = a, this.payload = r;
384
- }
385
- };
386
- class lt extends Q {
387
- static get code() {
388
- return "ERR_JWT_EXPIRED";
389
- }
390
- constructor(t, r, n = "unspecified", a = "unspecified") {
391
- super(t), this.code = "ERR_JWT_EXPIRED", this.claim = n, this.reason = a, this.payload = r;
392
- }
393
- }
394
- class Pr extends Q {
395
- constructor() {
396
- super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
397
- }
398
- static get code() {
399
- return "ERR_JOSE_ALG_NOT_ALLOWED";
400
- }
401
- }
402
- let Y = class extends Q {
403
- constructor() {
404
- super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
405
- }
406
- static get code() {
407
- return "ERR_JOSE_NOT_SUPPORTED";
408
- }
409
- }, I = class extends Q {
410
- constructor() {
411
- super(...arguments), this.code = "ERR_JWS_INVALID";
412
- }
413
- static get code() {
414
- return "ERR_JWS_INVALID";
415
- }
416
- }, Kt = class extends Q {
417
- constructor() {
418
- super(...arguments), this.code = "ERR_JWT_INVALID";
419
- }
420
- static get code() {
421
- return "ERR_JWT_INVALID";
422
- }
423
- };
424
- class Dr extends Q {
425
- constructor() {
426
- super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
427
- }
428
- static get code() {
429
- return "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
430
- }
431
- }
432
- function K(e, t = "algorithm.name") {
433
- return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
434
- }
435
- function pe(e, t) {
436
- return e.name === t;
437
- }
438
- function Ge(e) {
439
- return parseInt(e.name.slice(4), 10);
440
- }
441
- function Mr(e) {
442
- switch (e) {
443
- case "ES256":
444
- return "P-256";
445
- case "ES384":
446
- return "P-384";
447
- case "ES512":
448
- return "P-521";
449
- default:
450
- throw new Error("unreachable");
451
- }
452
- }
453
- function $r(e, t) {
454
- if (t.length && !t.some((r) => e.usages.includes(r))) {
455
- let r = "CryptoKey does not support this operation, its usages must include ";
456
- if (t.length > 2) {
457
- const n = t.pop();
458
- r += `one of ${t.join(", ")}, or ${n}.`;
459
- } else t.length === 2 ? r += `one of ${t[0]} or ${t[1]}.` : r += `${t[0]}.`;
460
- throw new TypeError(r);
461
- }
462
- }
463
- function Lr(e, t, ...r) {
464
- switch (t) {
465
- case "HS256":
466
- case "HS384":
467
- case "HS512": {
468
- if (!pe(e.algorithm, "HMAC"))
469
- throw K("HMAC");
470
- const n = parseInt(t.slice(2), 10);
471
- if (Ge(e.algorithm.hash) !== n)
472
- throw K(`SHA-${n}`, "algorithm.hash");
473
- break;
474
- }
475
- case "RS256":
476
- case "RS384":
477
- case "RS512": {
478
- if (!pe(e.algorithm, "RSASSA-PKCS1-v1_5"))
479
- throw K("RSASSA-PKCS1-v1_5");
480
- const n = parseInt(t.slice(2), 10);
481
- if (Ge(e.algorithm.hash) !== n)
482
- throw K(`SHA-${n}`, "algorithm.hash");
483
- break;
484
- }
485
- case "PS256":
486
- case "PS384":
487
- case "PS512": {
488
- if (!pe(e.algorithm, "RSA-PSS"))
489
- throw K("RSA-PSS");
490
- const n = parseInt(t.slice(2), 10);
491
- if (Ge(e.algorithm.hash) !== n)
492
- throw K(`SHA-${n}`, "algorithm.hash");
493
- break;
494
- }
495
- case "EdDSA": {
496
- if (e.algorithm.name !== "Ed25519" && e.algorithm.name !== "Ed448")
497
- throw K("Ed25519 or Ed448");
498
- break;
499
- }
500
- case "ES256":
501
- case "ES384":
502
- case "ES512": {
503
- if (!pe(e.algorithm, "ECDSA"))
504
- throw K("ECDSA");
505
- const n = Mr(t);
506
- if (e.algorithm.namedCurve !== n)
507
- throw K(n, "algorithm.namedCurve");
508
- break;
509
- }
510
- default:
511
- throw new TypeError("CryptoKey does not support this operation");
512
- }
513
- $r(e, r);
514
- }
515
- function Gt(e, t, ...r) {
516
- var n;
517
- if (r.length > 2) {
518
- const a = r.pop();
519
- e += `one of type ${r.join(", ")}, or ${a}.`;
520
- } else r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
521
- return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && (n = t.constructor) != null && n.name && (e += ` Received an instance of ${t.constructor.name}`), e;
522
- }
523
- const dt = (e, ...t) => Gt("Key must be ", e, ...t);
524
- function Wt(e, t, ...r) {
525
- return Gt(`Key for the ${e} algorithm must be `, t, ...r);
526
- }
527
- const Vt = (e) => Bt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Re = ["CryptoKey"], Ur = (...e) => {
528
- const t = e.filter(Boolean);
529
- if (t.length === 0 || t.length === 1)
530
- return !0;
531
- let r;
532
- for (const n of t) {
533
- const a = Object.keys(n);
534
- if (!r || r.size === 0) {
535
- r = new Set(a);
536
- continue;
537
- }
538
- for (const o of a) {
539
- if (r.has(o))
540
- return !1;
541
- r.add(o);
542
- }
543
- }
544
- return !0;
545
- };
546
- function Hr(e) {
547
- return typeof e == "object" && e !== null;
548
- }
549
- function Ze(e) {
550
- if (!Hr(e) || Object.prototype.toString.call(e) !== "[object Object]")
551
- return !1;
552
- if (Object.getPrototypeOf(e) === null)
553
- return !0;
554
- let t = e;
555
- for (; Object.getPrototypeOf(t) !== null; )
556
- t = Object.getPrototypeOf(t);
557
- return Object.getPrototypeOf(e) === t;
558
- }
559
- const Br = (e, t) => {
560
- if (e.startsWith("RS") || e.startsWith("PS")) {
561
- const { modulusLength: r } = t.algorithm;
562
- if (typeof r != "number" || r < 2048)
563
- throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
564
- }
565
- };
566
- function Kr(e) {
567
- let t, r;
568
- switch (e.kty) {
569
- case "RSA": {
570
- switch (e.alg) {
571
- case "PS256":
572
- case "PS384":
573
- case "PS512":
574
- t = { name: "RSA-PSS", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
575
- break;
576
- case "RS256":
577
- case "RS384":
578
- case "RS512":
579
- t = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
580
- break;
581
- case "RSA-OAEP":
582
- case "RSA-OAEP-256":
583
- case "RSA-OAEP-384":
584
- case "RSA-OAEP-512":
585
- t = {
586
- name: "RSA-OAEP",
587
- hash: `SHA-${parseInt(e.alg.slice(-3), 10) || 1}`
588
- }, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
589
- break;
590
- default:
591
- throw new Y('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
592
- }
593
- break;
594
- }
595
- case "EC": {
596
- switch (e.alg) {
597
- case "ES256":
598
- t = { name: "ECDSA", namedCurve: "P-256" }, r = e.d ? ["sign"] : ["verify"];
599
- break;
600
- case "ES384":
601
- t = { name: "ECDSA", namedCurve: "P-384" }, r = e.d ? ["sign"] : ["verify"];
602
- break;
603
- case "ES512":
604
- t = { name: "ECDSA", namedCurve: "P-521" }, r = e.d ? ["sign"] : ["verify"];
605
- break;
606
- case "ECDH-ES":
607
- case "ECDH-ES+A128KW":
608
- case "ECDH-ES+A192KW":
609
- case "ECDH-ES+A256KW":
610
- t = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
611
- break;
612
- default:
613
- throw new Y('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
614
- }
615
- break;
616
- }
617
- case "OKP": {
618
- switch (e.alg) {
619
- case "EdDSA":
620
- t = { name: e.crv }, r = e.d ? ["sign"] : ["verify"];
621
- break;
622
- case "ECDH-ES":
623
- case "ECDH-ES+A128KW":
624
- case "ECDH-ES+A192KW":
625
- case "ECDH-ES+A256KW":
626
- t = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
627
- break;
628
- default:
629
- throw new Y('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
630
- }
631
- break;
632
- }
633
- default:
634
- throw new Y('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
635
- }
636
- return { algorithm: t, keyUsages: r };
637
- }
638
- const Gr = async (e) => {
639
- if (!e.alg)
640
- throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
641
- const { algorithm: t, keyUsages: r } = Kr(e), n = [
642
- t,
643
- e.ext ?? !1,
644
- e.key_ops ?? r
645
- ], a = { ...e };
646
- return delete a.alg, delete a.use, Oe.subtle.importKey("jwk", a, ...n);
647
- }, Ft = (e) => Te(e);
648
- let We, Ve;
649
- const jt = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Yt = async (e, t, r, n) => {
650
- let a = e.get(t);
651
- if (a != null && a[n])
652
- return a[n];
653
- const o = await Gr({ ...r, alg: n });
654
- return a ? a[n] = o : e.set(t, { [n]: o }), o;
655
- }, Wr = (e, t) => {
656
- if (jt(e)) {
657
- let r = e.export({ format: "jwk" });
658
- return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? Ft(r.k) : (Ve || (Ve = /* @__PURE__ */ new WeakMap()), Yt(Ve, e, r, t));
659
- }
660
- return e;
661
- }, Vr = (e, t) => {
662
- if (jt(e)) {
663
- let r = e.export({ format: "jwk" });
664
- return r.k ? Ft(r.k) : (We || (We = /* @__PURE__ */ new WeakMap()), Yt(We, e, r, t));
665
- }
666
- return e;
667
- }, Fr = { normalizePublicKey: Wr, normalizePrivateKey: Vr }, j = (e, t, r = 0) => {
668
- r === 0 && (t.unshift(t.length), t.unshift(6));
669
- const n = e.indexOf(t[0], r);
670
- if (n === -1)
671
- return !1;
672
- const a = e.subarray(n, n + t.length);
673
- return a.length !== t.length ? !1 : a.every((o, i) => o === t[i]) || j(e, t, n + 1);
674
- }, ut = (e) => {
675
- switch (!0) {
676
- case j(e, [42, 134, 72, 206, 61, 3, 1, 7]):
677
- return "P-256";
678
- case j(e, [43, 129, 4, 0, 34]):
679
- return "P-384";
680
- case j(e, [43, 129, 4, 0, 35]):
681
- return "P-521";
682
- case j(e, [43, 101, 110]):
683
- return "X25519";
684
- case j(e, [43, 101, 111]):
685
- return "X448";
686
- case j(e, [43, 101, 112]):
687
- return "Ed25519";
688
- case j(e, [43, 101, 113]):
689
- return "Ed448";
690
- default:
691
- throw new Y("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
692
- }
693
- }, jr = async (e, t, r, n, a) => {
694
- let o, i;
695
- const s = new Uint8Array(atob(r.replace(e, "")).split("").map((l) => l.charCodeAt(0)));
696
- switch (n) {
697
- case "PS256":
698
- case "PS384":
699
- case "PS512":
700
- o = { name: "RSA-PSS", hash: `SHA-${n.slice(-3)}` }, i = ["verify"];
701
- break;
702
- case "RS256":
703
- case "RS384":
704
- case "RS512":
705
- o = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${n.slice(-3)}` }, i = ["verify"];
706
- break;
707
- case "RSA-OAEP":
708
- case "RSA-OAEP-256":
709
- case "RSA-OAEP-384":
710
- case "RSA-OAEP-512":
711
- o = {
712
- name: "RSA-OAEP",
713
- hash: `SHA-${parseInt(n.slice(-3), 10) || 1}`
714
- }, i = ["encrypt", "wrapKey"];
715
- break;
716
- case "ES256":
717
- o = { name: "ECDSA", namedCurve: "P-256" }, i = ["verify"];
718
- break;
719
- case "ES384":
720
- o = { name: "ECDSA", namedCurve: "P-384" }, i = ["verify"];
721
- break;
722
- case "ES512":
723
- o = { name: "ECDSA", namedCurve: "P-521" }, i = ["verify"];
724
- break;
725
- case "ECDH-ES":
726
- case "ECDH-ES+A128KW":
727
- case "ECDH-ES+A192KW":
728
- case "ECDH-ES+A256KW": {
729
- const l = ut(s);
730
- o = l.startsWith("P-") ? { name: "ECDH", namedCurve: l } : { name: l }, i = [];
731
- break;
732
- }
733
- case "EdDSA":
734
- o = { name: ut(s) }, i = ["verify"];
735
- break;
736
- default:
737
- throw new Y('Invalid or unsupported "alg" (Algorithm) value');
738
- }
739
- return Oe.subtle.importKey(t, s, o, !1, i);
740
- }, Yr = (e, t, r) => jr(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
741
- async function zr(e, t, r) {
742
- if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
743
- throw new TypeError('"spki" must be SPKI formatted string');
744
- return Yr(e, t);
745
- }
746
- const Ae = (e) => e == null ? void 0 : e[Symbol.toStringTag], Jr = (e, t) => {
747
- if (!(t instanceof Uint8Array)) {
748
- if (!Vt(t))
749
- throw new TypeError(Wt(e, t, ...Re, "Uint8Array"));
750
- if (t.type !== "secret")
751
- throw new TypeError(`${Ae(t)} instances for symmetric algorithms must be of type "secret"`);
752
- }
753
- }, qr = (e, t, r) => {
754
- if (!Vt(t))
755
- throw new TypeError(Wt(e, t, ...Re));
756
- if (t.type === "secret")
757
- throw new TypeError(`${Ae(t)} instances for asymmetric algorithms must not be of type "secret"`);
758
- if (t.algorithm && r === "verify" && t.type === "private")
759
- throw new TypeError(`${Ae(t)} instances for asymmetric algorithm verifying must be of type "public"`);
760
- if (t.algorithm && r === "encrypt" && t.type === "private")
761
- throw new TypeError(`${Ae(t)} instances for asymmetric algorithm encryption must be of type "public"`);
762
- }, Qr = (e, t, r) => {
763
- e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? Jr(e, t) : qr(e, t, r);
764
- };
765
- function Xr(e, t, r, n, a) {
766
- if (a.crit !== void 0 && (n == null ? void 0 : n.crit) === void 0)
767
- throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
768
- if (!n || n.crit === void 0)
769
- return /* @__PURE__ */ new Set();
770
- if (!Array.isArray(n.crit) || n.crit.length === 0 || n.crit.some((i) => typeof i != "string" || i.length === 0))
771
- throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
772
- let o;
773
- r !== void 0 ? o = new Map([...Object.entries(r), ...t.entries()]) : o = t;
774
- for (const i of n.crit) {
775
- if (!o.has(i))
776
- throw new Y(`Extension Header Parameter "${i}" is not recognized`);
777
- if (a[i] === void 0)
778
- throw new e(`Extension Header Parameter "${i}" is missing`);
779
- if (o.get(i) && n[i] === void 0)
780
- throw new e(`Extension Header Parameter "${i}" MUST be integrity protected`);
781
- }
782
- return new Set(n.crit);
783
- }
784
- const Zr = (e, t) => {
785
- if (t !== void 0 && (!Array.isArray(t) || t.some((r) => typeof r != "string")))
786
- throw new TypeError(`"${e}" option must be an array of strings`);
787
- if (t)
788
- return new Set(t);
789
- };
790
- function en(e, t) {
791
- const r = `SHA-${e.slice(-3)}`;
792
- switch (e) {
793
- case "HS256":
794
- case "HS384":
795
- case "HS512":
796
- return { hash: r, name: "HMAC" };
797
- case "PS256":
798
- case "PS384":
799
- case "PS512":
800
- return { hash: r, name: "RSA-PSS", saltLength: e.slice(-3) >> 3 };
801
- case "RS256":
802
- case "RS384":
803
- case "RS512":
804
- return { hash: r, name: "RSASSA-PKCS1-v1_5" };
805
- case "ES256":
806
- case "ES384":
807
- case "ES512":
808
- return { hash: r, name: "ECDSA", namedCurve: t.namedCurve };
809
- case "EdDSA":
810
- return { name: t.name };
811
- default:
812
- throw new Y(`alg ${e} is not supported either by JOSE or your javascript runtime`);
813
- }
814
- }
815
- async function tn(e, t, r) {
816
- if (t = await Fr.normalizePublicKey(t, e), Bt(t))
817
- return Lr(t, e, r), t;
818
- if (t instanceof Uint8Array) {
819
- if (!e.startsWith("HS"))
820
- throw new TypeError(dt(t, ...Re));
821
- return Oe.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
822
- }
823
- throw new TypeError(dt(t, ...Re, "Uint8Array"));
824
- }
825
- const rn = async (e, t, r, n) => {
826
- const a = await tn(e, t, "verify");
827
- Br(e, a);
828
- const o = en(e, a.algorithm);
829
- try {
830
- return await Oe.subtle.verify(o, a, r, n);
831
- } catch {
832
- return !1;
833
- }
834
- };
835
- async function nn(e, t, r) {
836
- if (!Ze(e))
837
- throw new I("Flattened JWS must be an object");
838
- if (e.protected === void 0 && e.header === void 0)
839
- throw new I('Flattened JWS must have either of the "protected" or "header" members');
840
- if (e.protected !== void 0 && typeof e.protected != "string")
841
- throw new I("JWS Protected Header incorrect type");
842
- if (e.payload === void 0)
843
- throw new I("JWS Payload missing");
844
- if (typeof e.signature != "string")
845
- throw new I("JWS Signature missing or incorrect type");
846
- if (e.header !== void 0 && !Ze(e.header))
847
- throw new I("JWS Unprotected Header incorrect type");
848
- let n = {};
849
- if (e.protected)
850
- try {
851
- const y = Te(e.protected);
852
- n = JSON.parse(Pe.decode(y));
853
- } catch {
854
- throw new I("JWS Protected Header is invalid");
855
- }
856
- if (!Ur(n, e.header))
857
- throw new I("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
858
- const a = {
859
- ...n,
860
- ...e.header
861
- }, o = Xr(I, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, n, a);
862
- let i = !0;
863
- if (o.has("b64") && (i = n.b64, typeof i != "boolean"))
864
- throw new I('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
865
- const { alg: s } = a;
866
- if (typeof s != "string" || !s)
867
- throw new I('JWS "alg" (Algorithm) Header Parameter missing or invalid');
868
- const l = r && Zr("algorithms", r.algorithms);
869
- if (l && !l.has(s))
870
- throw new Pr('"alg" (Algorithm) Header Parameter value not allowed');
871
- if (i) {
872
- if (typeof e.payload != "string")
873
- throw new I("JWS Payload must be a string");
874
- } else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
875
- throw new I("JWS Payload must be a string or an Uint8Array instance");
876
- let d = !1;
877
- typeof t == "function" && (t = await t(n, e), d = !0), Qr(s, t, "verify");
878
- const c = xr(he.encode(e.protected ?? ""), he.encode("."), typeof e.payload == "string" ? he.encode(e.payload) : e.payload);
879
- let h;
880
- try {
881
- h = Te(e.signature);
882
- } catch {
883
- throw new I("Failed to base64url decode the signature");
884
- }
885
- if (!await rn(s, t, h, c))
886
- throw new Dr();
887
- let m;
888
- if (i)
889
- try {
890
- m = Te(e.payload);
891
- } catch {
892
- throw new I("Failed to base64url decode the payload");
893
- }
894
- else typeof e.payload == "string" ? m = he.encode(e.payload) : m = e.payload;
895
- const p = { payload: m };
896
- return e.protected !== void 0 && (p.protectedHeader = n), e.header !== void 0 && (p.unprotectedHeader = e.header), d ? { ...p, key: t } : p;
897
- }
898
- async function an(e, t, r) {
899
- if (e instanceof Uint8Array && (e = Pe.decode(e)), typeof e != "string")
900
- throw new I("Compact JWS must be a string or Uint8Array");
901
- const { 0: n, 1: a, 2: o, length: i } = e.split(".");
902
- if (i !== 3)
903
- throw new I("Invalid Compact JWS");
904
- const s = await nn({ payload: a, protected: n, signature: o }, t, r), l = { payload: s.payload, protectedHeader: s.protectedHeader };
905
- return typeof t == "function" ? { ...l, key: s.key } : l;
906
- }
907
- const on = (e) => Math.floor(e.getTime() / 1e3), zt = 60, Jt = zt * 60, rt = Jt * 24, sn = rt * 7, cn = rt * 365.25, ln = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, mt = (e) => {
908
- const t = ln.exec(e);
909
- if (!t || t[4] && t[1])
910
- throw new TypeError("Invalid time period format");
911
- const r = parseFloat(t[2]), n = t[3].toLowerCase();
912
- let a;
913
- switch (n) {
914
- case "sec":
915
- case "secs":
916
- case "second":
917
- case "seconds":
918
- case "s":
919
- a = Math.round(r);
920
- break;
921
- case "minute":
922
- case "minutes":
923
- case "min":
924
- case "mins":
925
- case "m":
926
- a = Math.round(r * zt);
927
- break;
928
- case "hour":
929
- case "hours":
930
- case "hr":
931
- case "hrs":
932
- case "h":
933
- a = Math.round(r * Jt);
934
- break;
935
- case "day":
936
- case "days":
937
- case "d":
938
- a = Math.round(r * rt);
939
- break;
940
- case "week":
941
- case "weeks":
942
- case "w":
943
- a = Math.round(r * sn);
944
- break;
945
- default:
946
- a = Math.round(r * cn);
947
- break;
948
- }
949
- return t[1] === "-" || t[4] === "ago" ? -a : a;
950
- }, ht = (e) => e.toLowerCase().replace(/^application\//, ""), dn = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, un = (e, t, r = {}) => {
951
- let n;
952
- try {
953
- n = JSON.parse(Pe.decode(t));
954
- } catch {
955
- }
956
- if (!Ze(n))
957
- throw new Kt("JWT Claims Set must be a top-level JSON object");
958
- const { typ: a } = r;
959
- if (a && (typeof e.typ != "string" || ht(e.typ) !== ht(a)))
960
- throw new H('unexpected "typ" JWT header value', n, "typ", "check_failed");
961
- const { requiredClaims: o = [], issuer: i, subject: s, audience: l, maxTokenAge: d } = r, c = [...o];
962
- d !== void 0 && c.push("iat"), l !== void 0 && c.push("aud"), s !== void 0 && c.push("sub"), i !== void 0 && c.push("iss");
963
- for (const y of new Set(c.reverse()))
964
- if (!(y in n))
965
- throw new H(`missing required "${y}" claim`, n, y, "missing");
966
- if (i && !(Array.isArray(i) ? i : [i]).includes(n.iss))
967
- throw new H('unexpected "iss" claim value', n, "iss", "check_failed");
968
- if (s && n.sub !== s)
969
- throw new H('unexpected "sub" claim value', n, "sub", "check_failed");
970
- if (l && !dn(n.aud, typeof l == "string" ? [l] : l))
971
- throw new H('unexpected "aud" claim value', n, "aud", "check_failed");
972
- let h;
973
- switch (typeof r.clockTolerance) {
974
- case "string":
975
- h = mt(r.clockTolerance);
976
- break;
977
- case "number":
978
- h = r.clockTolerance;
979
- break;
980
- case "undefined":
981
- h = 0;
982
- break;
983
- default:
984
- throw new TypeError("Invalid clockTolerance option type");
985
- }
986
- const { currentDate: m } = r, p = on(m || /* @__PURE__ */ new Date());
987
- if ((n.iat !== void 0 || d) && typeof n.iat != "number")
988
- throw new H('"iat" claim must be a number', n, "iat", "invalid");
989
- if (n.nbf !== void 0) {
990
- if (typeof n.nbf != "number")
991
- throw new H('"nbf" claim must be a number', n, "nbf", "invalid");
992
- if (n.nbf > p + h)
993
- throw new H('"nbf" claim timestamp check failed', n, "nbf", "check_failed");
994
- }
995
- if (n.exp !== void 0) {
996
- if (typeof n.exp != "number")
997
- throw new H('"exp" claim must be a number', n, "exp", "invalid");
998
- if (n.exp <= p - h)
999
- throw new lt('"exp" claim timestamp check failed', n, "exp", "check_failed");
1000
- }
1001
- if (d) {
1002
- const y = p - n.iat, E = typeof d == "number" ? d : mt(d);
1003
- if (y - h > E)
1004
- throw new lt('"iat" claim timestamp check failed (too far in the past)', n, "iat", "check_failed");
1005
- if (y < 0 - h)
1006
- throw new H('"iat" claim timestamp check failed (it should be in the past)', n, "iat", "check_failed");
1007
- }
1008
- return n;
1009
- };
1010
- async function mn(e, t, r) {
1011
- var n;
1012
- const a = await an(e, t, r);
1013
- if ((n = a.protectedHeader.crit) != null && n.includes("b64") && a.protectedHeader.b64 === !1)
1014
- throw new Kt("JWTs MUST NOT use unencoded payload");
1015
- const o = { payload: un(a.protectedHeader, a.payload, r), protectedHeader: a.protectedHeader };
1016
- return typeof t == "function" ? { ...o, key: a.key } : o;
1017
- }
1018
- const de = async (e) => {
1019
- try {
1020
- const t = C.ALG, r = await zr(Cr, t);
1021
- return await mn(e, r, {
1022
- issuer: C.ISSUER
1023
- });
1024
- } catch {
1025
- return;
1026
- }
1027
- };
1028
- var T = [];
1029
- for (var Fe = 0; Fe < 256; ++Fe)
1030
- T.push((Fe + 256).toString(16).slice(1));
1031
- function hn(e, t = 0) {
1032
- return (T[e[t + 0]] + T[e[t + 1]] + T[e[t + 2]] + T[e[t + 3]] + "-" + T[e[t + 4]] + T[e[t + 5]] + "-" + T[e[t + 6]] + T[e[t + 7]] + "-" + T[e[t + 8]] + T[e[t + 9]] + "-" + T[e[t + 10]] + T[e[t + 11]] + T[e[t + 12]] + T[e[t + 13]] + T[e[t + 14]] + T[e[t + 15]]).toLowerCase();
1033
- }
1034
- var fe, pn = new Uint8Array(16);
1035
- function fn() {
1036
- if (!fe && (fe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !fe))
1037
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1038
- return fe(pn);
1039
- }
1040
- var gn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1041
- const pt = {
1042
- randomUUID: gn
1043
- };
1044
- function ft(e, t, r) {
1045
- if (pt.randomUUID && !t && !e)
1046
- return pt.randomUUID();
1047
- e = e || {};
1048
- var n = e.random || (e.rng || fn)();
1049
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, hn(n);
1050
- }
1051
- const gt = globalThis.crypto, yn = (e) => `${ft()}${ft()}`.slice(0, e), bn = (e) => btoa(
1052
- [...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
1053
- );
1054
- async function wn(e) {
1055
- if (!gt.subtle)
1056
- throw new Error(
1057
- "crypto.subtle is available only in secure contexts (HTTPS)."
1058
- );
1059
- const t = new TextEncoder().encode(e), r = await gt.subtle.digest("SHA-256", t);
1060
- return bn(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
1061
- }
1062
- async function vn(e) {
1063
- const t = yn(43), r = await wn(t);
1064
- return {
1065
- code_verifier: t,
1066
- code_challenge: r
1067
- };
1068
- }
1069
- function qt(e, t) {
1070
- window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
1071
- }
1072
- const yt = (e, t) => {
1073
- const r = JSON.stringify(
1074
- typeof t == "function" ? t() : t
1075
- );
1076
- window.localStorage.setItem(e, r), qt(e, r);
1077
- }, En = (e) => {
1078
- window.localStorage.removeItem(e), qt(e, null);
1079
- }, bt = (e) => window.localStorage.getItem(e), Sn = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
1080
- function ge({
1081
- key: e,
1082
- initialValue: t
1083
- }) {
1084
- const r = br(Sn, () => bt(e)), n = le(
1085
- (i) => {
1086
- try {
1087
- const s = typeof i == "function" ? i(JSON.parse(r)) : i;
1088
- s == null ? En(e) : yt(e, s);
1089
- } catch (s) {
1090
- console.warn(s);
1091
- }
1092
- },
1093
- [e, r]
1094
- ), a = le(() => {
1095
- n(t);
1096
- }, [t, n]), o = le(() => {
1097
- n(null);
1098
- }, [n]);
1099
- return re(() => {
1100
- try {
1101
- bt(e) === null && typeof t < "u" && yt(e, t);
1102
- } catch (i) {
1103
- console.warn(i);
1104
- }
1105
- }, [e, t]), [r ? JSON.parse(r) : null, n, a, o];
1106
- }
1107
- var A = [];
1108
- for (var je = 0; je < 256; ++je)
1109
- A.push((je + 256).toString(16).slice(1));
1110
- function Tn(e, t = 0) {
1111
- 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();
1112
- }
1113
- var ye, An = new Uint8Array(16);
1114
- function In() {
1115
- if (!ye && (ye = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ye))
1116
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1117
- return ye(An);
1118
- }
1119
- var kn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1120
- const wt = {
1121
- randomUUID: kn
1122
- };
1123
- function Ye(e, t, r) {
1124
- if (wt.randomUUID && !t && !e)
1125
- return wt.randomUUID();
1126
- e = e || {};
1127
- var n = e.random || (e.rng || In)();
1128
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Tn(n);
1129
- }
1130
- function G(e, t, r, n) {
1131
- return new (r || (r = Promise))(function(a, o) {
1132
- function i(d) {
1133
- try {
1134
- l(n.next(d));
1135
- } catch (c) {
1136
- o(c);
1137
- }
1138
- }
1139
- function s(d) {
1140
- try {
1141
- l(n.throw(d));
1142
- } catch (c) {
1143
- o(c);
1144
- }
1145
- }
1146
- function l(d) {
1147
- var c;
1148
- d.done ? a(d.value) : (c = d.value, c instanceof r ? c : new r(function(h) {
1149
- h(c);
1150
- })).then(i, s);
1151
- }
1152
- l((n = n.apply(e, [])).next());
1153
- });
1154
- }
1155
- function W(e, t) {
1156
- var r, n, a, o, i = { label: 0, sent: function() {
1157
- if (1 & a[0]) throw a[1];
1158
- return a[1];
1159
- }, trys: [], ops: [] };
1160
- return o = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (o[Symbol.iterator] = function() {
1161
- return this;
1162
- }), o;
1163
- function s(l) {
1164
- return function(d) {
1165
- return function(c) {
1166
- if (r) throw new TypeError("Generator is already executing.");
1167
- for (; o && (o = 0, c[0] && (i = 0)), i; ) try {
1168
- if (r = 1, n && (a = 2 & c[0] ? n.return : c[0] ? n.throw || ((a = n.return) && a.call(n), 0) : n.next) && !(a = a.call(n, c[1])).done) return a;
1169
- switch (n = 0, a && (c = [2 & c[0], a.value]), c[0]) {
1170
- case 0:
1171
- case 1:
1172
- a = c;
1173
- break;
1174
- case 4:
1175
- return i.label++, { value: c[1], done: !1 };
1176
- case 5:
1177
- i.label++, n = c[1], c = [0];
1178
- continue;
1179
- case 7:
1180
- c = i.ops.pop(), i.trys.pop();
1181
- continue;
1182
- default:
1183
- if (a = i.trys, !((a = a.length > 0 && a[a.length - 1]) || c[0] !== 6 && c[0] !== 2)) {
1184
- i = 0;
1185
- continue;
1186
- }
1187
- if (c[0] === 3 && (!a || c[1] > a[0] && c[1] < a[3])) {
1188
- i.label = c[1];
1189
- break;
1190
- }
1191
- if (c[0] === 6 && i.label < a[1]) {
1192
- i.label = a[1], a = c;
1193
- break;
1194
- }
1195
- if (a && i.label < a[2]) {
1196
- i.label = a[2], i.ops.push(c);
1197
- break;
1198
- }
1199
- a[2] && i.ops.pop(), i.trys.pop();
1200
- continue;
1201
- }
1202
- c = t.call(e, i);
1203
- } catch (h) {
1204
- c = [6, h], n = 0;
1205
- } finally {
1206
- r = a = 0;
1207
- }
1208
- if (5 & c[0]) throw c[1];
1209
- return { value: c[0] ? c[1] : void 0, done: !0 };
1210
- }([l, d]);
1211
- };
1212
- }
1213
- }
1214
- var V = { exclude: [] }, Qt = {}, _n = { timeout: "true" }, $ = function(e, t) {
1215
- typeof window < "u" && (Qt[e] = t);
1216
- }, Rn = function() {
1217
- return Object.fromEntries(Object.entries(Qt).filter(function(e) {
1218
- var t, r = e[0];
1219
- return !(!((t = V == null ? void 0 : V.exclude) === null || t === void 0) && t.includes(r));
1220
- }).map(function(e) {
1221
- return [e[0], (0, e[1])()];
1222
- }));
1223
- }, vt = 3432918353, Et = 461845907, Nn = 3864292196, Cn = 2246822507, xn = 3266489909;
1224
- function ze(e, t) {
1225
- return e << t | e >>> 32 - t;
1226
- }
1227
- function nt(e, t) {
1228
- t === void 0 && (t = 0);
1229
- for (var r = t, n = 0, a = 3 & e.length, o = e.length - a, i = 0; i < o; ) n = 255 & e.charCodeAt(i) | (255 & e.charCodeAt(++i)) << 8 | (255 & e.charCodeAt(++i)) << 16 | (255 & e.charCodeAt(++i)) << 24, ++i, n = ze(n = Math.imul(n, vt), 15), r = ze(r ^= n = Math.imul(n, Et), 13), r = Math.imul(r, 5) + Nn;
1230
- switch (n = 0, a) {
1231
- case 3:
1232
- n ^= (255 & e.charCodeAt(i + 2)) << 16;
1233
- case 2:
1234
- n ^= (255 & e.charCodeAt(i + 1)) << 8;
1235
- case 1:
1236
- n ^= 255 & e.charCodeAt(i), n = ze(n = Math.imul(n, vt), 15), r ^= n = Math.imul(n, Et);
1237
- }
1238
- return ((r = function(s) {
1239
- return s ^= s >>> 16, s = Math.imul(s, Cn), s ^= s >>> 13, s = Math.imul(s, xn), s ^ s >>> 16;
1240
- }(r ^= e.length)) >>> 0).toString(36);
1241
- }
1242
- function On(e, t) {
1243
- return new Promise(function(r) {
1244
- setTimeout(function() {
1245
- return r(t);
1246
- }, e);
1247
- });
1248
- }
1249
- function Pn(e, t, r) {
1250
- return Promise.all(e.map(function(n) {
1251
- return Promise.race([n, On(t, r)]);
1252
- }));
1253
- }
1254
- function Dn() {
1255
- return G(this, void 0, void 0, function() {
1256
- var e, t, r, n, a;
1257
- return W(this, function(o) {
1258
- switch (o.label) {
1259
- case 0:
1260
- return o.trys.push([0, 2, , 3]), e = Rn(), t = Object.keys(e), [4, Pn(Object.values(e), (V == null ? void 0 : V.timeout) || 1e3, _n)];
1261
- case 1:
1262
- return r = o.sent(), n = r.filter(function(i) {
1263
- return i !== void 0;
1264
- }), a = {}, n.forEach(function(i, s) {
1265
- a[t[s]] = i;
1266
- }), [2, Xt(a, V.exclude || [])];
1267
- case 2:
1268
- throw o.sent();
1269
- case 3:
1270
- return [2];
1271
- }
1272
- });
1273
- });
1274
- }
1275
- function Xt(e, t) {
1276
- var r = {}, n = function(o) {
1277
- if (e.hasOwnProperty(o)) {
1278
- var i = e[o];
1279
- if (typeof i != "object" || Array.isArray(i)) t.includes(o) || (r[o] = i);
1280
- else {
1281
- var s = Xt(i, t.map(function(l) {
1282
- return l.startsWith(o + ".") ? l.slice(o.length + 1) : l;
1283
- }));
1284
- Object.keys(s).length > 0 && (r[o] = s);
1285
- }
1286
- }
1287
- };
1288
- for (var a in e) n(a);
1289
- return r;
1290
- }
1291
- function Mn(e) {
1292
- return G(this, void 0, void 0, function() {
1293
- var t, r;
1294
- return W(this, function(n) {
1295
- switch (n.label) {
1296
- case 0:
1297
- return n.trys.push([0, 2, , 3]), [4, Dn()];
1298
- case 1:
1299
- return t = n.sent(), r = nt(JSON.stringify(t)), [2, r.toString()];
1300
- case 2:
1301
- throw n.sent();
1302
- case 3:
1303
- return [2];
1304
- }
1305
- });
1306
- });
1307
- }
1308
- function $n(e) {
1309
- for (var t = 0, r = 0; r < e.length; ++r) t += Math.abs(e[r]);
1310
- return t;
1311
- }
1312
- function Zt(e, t, r) {
1313
- for (var n = [], a = 0; a < e[0].data.length; a++) {
1314
- for (var o = [], i = 0; i < e.length; i++) o.push(e[i].data[a]);
1315
- n.push(Ln(o));
1316
- }
1317
- var s = new Uint8ClampedArray(n);
1318
- return new ImageData(s, t, r);
1319
- }
1320
- function Ln(e) {
1321
- if (e.length === 0) return 0;
1322
- for (var t = {}, r = 0, n = e; r < n.length; r++)
1323
- t[o = n[r]] = (t[o] || 0) + 1;
1324
- var a = e[0];
1325
- for (var o in t) t[o] > t[a] && (a = parseInt(o, 10));
1326
- return a;
1327
- }
1328
- function ue() {
1329
- if (typeof navigator > "u") return { name: "unknown", version: "unknown" };
1330
- for (var e = navigator.userAgent, t = { Edg: "Edge", OPR: "Opera" }, r = 0, n = [/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/, /(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/]; r < n.length; r++) {
1331
- var a = n[r], o = e.match(a);
1332
- if (o && o.groups) return { name: t[o.groups.name] || o.groups.name, version: o.groups.version };
1333
- }
1334
- return { name: "unknown", version: "unknown" };
1335
- }
1336
- $("audio", function() {
1337
- return G(this, void 0, void 0, function() {
1338
- return W(this, function(e) {
1339
- return [2, new Promise(function(t, r) {
1340
- try {
1341
- var n = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 5e3, 44100), a = n.createBufferSource(), o = n.createOscillator();
1342
- o.frequency.value = 1e3;
1343
- var i, s = n.createDynamicsCompressor();
1344
- s.threshold.value = -50, s.knee.value = 40, s.ratio.value = 12, s.attack.value = 0, s.release.value = 0.2, o.connect(s), s.connect(n.destination), o.start(), n.oncomplete = function(l) {
1345
- i = l.renderedBuffer.getChannelData(0), t({ sampleHash: $n(i), oscillator: o.type, maxChannels: n.destination.maxChannelCount, channelCountMode: a.channelCountMode });
1346
- }, n.startRendering();
1347
- } catch (l) {
1348
- console.error("Error creating audio fingerprint:", l), r(l);
1349
- }
1350
- })];
1351
- });
1352
- });
1353
- });
1354
- var Un = ue().name !== "SamsungBrowser" ? 1 : 3, St = 280, Tt = 20;
1355
- ue().name != "Firefox" && $("canvas", function() {
1356
- return document.createElement("canvas").getContext("2d"), new Promise(function(e) {
1357
- var t = Array.from({ length: Un }, function() {
1358
- return function() {
1359
- var r = document.createElement("canvas"), n = r.getContext("2d");
1360
- if (!n) return new ImageData(1, 1);
1361
- r.width = St, r.height = Tt;
1362
- var a = n.createLinearGradient(0, 0, r.width, r.height);
1363
- a.addColorStop(0, "red"), a.addColorStop(0.16666666666666666, "orange"), a.addColorStop(0.3333333333333333, "yellow"), a.addColorStop(0.5, "green"), a.addColorStop(0.6666666666666666, "blue"), a.addColorStop(0.8333333333333334, "indigo"), a.addColorStop(1, "violet"), n.fillStyle = a, n.fillRect(0, 0, r.width, r.height);
1364
- var o = "Random Text WMwmil10Oo";
1365
- n.font = "23.123px Arial", n.fillStyle = "black", n.fillText(o, -5, 15), n.fillStyle = "rgba(0, 0, 255, 0.5)", n.fillText(o, -3.3, 17.7), n.beginPath(), n.moveTo(0, 0), n.lineTo(2 * r.width / 7, r.height), n.strokeStyle = "white", n.lineWidth = 2, n.stroke();
1366
- var i = n.getImageData(0, 0, r.width, r.height);
1367
- return i;
1368
- }();
1369
- });
1370
- e({ commonImageDataHash: nt(Zt(t, St, Tt).data.toString()).toString() });
1371
- });
1372
- });
1373
- var Je, Hn = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"], Bn = ["monospace", "sans-serif", "serif"];
1374
- function At(e, t) {
1375
- if (!e) throw new Error("Canvas context not supported");
1376
- return e.font = "72px ".concat(t), e.measureText("WwMmLli0Oo").width;
1377
- }
1378
- function Kn() {
1379
- var e, t = document.createElement("canvas"), r = (e = t.getContext("webgl")) !== null && e !== void 0 ? e : t.getContext("experimental-webgl");
1380
- if (r && "getParameter" in r) {
1381
- var n = r.getExtension("WEBGL_debug_renderer_info");
1382
- return { vendor: (r.getParameter(r.VENDOR) || "").toString(), vendorUnmasked: n ? (r.getParameter(n.UNMASKED_VENDOR_WEBGL) || "").toString() : "", renderer: (r.getParameter(r.RENDERER) || "").toString(), rendererUnmasked: n ? (r.getParameter(n.UNMASKED_RENDERER_WEBGL) || "").toString() : "", version: (r.getParameter(r.VERSION) || "").toString(), shadingLanguageVersion: (r.getParameter(r.SHADING_LANGUAGE_VERSION) || "").toString() };
1383
- }
1384
- return "undefined";
1385
- }
1386
- function Gn() {
1387
- var e = new Float32Array(1), t = new Uint8Array(e.buffer);
1388
- return e[0] = 1 / 0, e[0] = e[0] - e[0], t[3];
1389
- }
1390
- function Wn(e, t) {
1391
- var r = {};
1392
- return t.forEach(function(n) {
1393
- var a = function(o) {
1394
- if (o.length === 0) return null;
1395
- var i = {};
1396
- o.forEach(function(d) {
1397
- var c = String(d);
1398
- i[c] = (i[c] || 0) + 1;
1399
- });
1400
- var s = o[0], l = 1;
1401
- return Object.keys(i).forEach(function(d) {
1402
- i[d] > l && (s = d, l = i[d]);
1403
- }), s;
1404
- }(e.map(function(o) {
1405
- return n in o ? o[n] : void 0;
1406
- }).filter(function(o) {
1407
- return o !== void 0;
1408
- }));
1409
- a && (r[n] = a);
1410
- }), r;
1411
- }
1412
- function Vn() {
1413
- var e = [], t = { "prefers-contrast": ["high", "more", "low", "less", "forced", "no-preference"], "any-hover": ["hover", "none"], "any-pointer": ["none", "coarse", "fine"], pointer: ["none", "coarse", "fine"], hover: ["hover", "none"], update: ["fast", "slow"], "inverted-colors": ["inverted", "none"], "prefers-reduced-motion": ["reduce", "no-preference"], "prefers-reduced-transparency": ["reduce", "no-preference"], scripting: ["none", "initial-only", "enabled"], "forced-colors": ["active", "none"] };
1414
- return Object.keys(t).forEach(function(r) {
1415
- t[r].forEach(function(n) {
1416
- matchMedia("(".concat(r, ": ").concat(n, ")")).matches && e.push("".concat(r, ": ").concat(n));
1417
- });
1418
- }), e;
1419
- }
1420
- function Fn() {
1421
- if (window.location.protocol === "https:" && typeof window.ApplePaySession == "function") try {
1422
- for (var e = window.ApplePaySession.supportsVersion, t = 15; t > 0; t--) if (e(t)) return t;
1423
- } catch {
1424
- return 0;
1425
- }
1426
- return 0;
1427
- }
1428
- ue().name != "Firefox" && $("fonts", function() {
1429
- var e = this;
1430
- return new Promise(function(t, r) {
1431
- try {
1432
- (function(n) {
1433
- var a;
1434
- G(this, void 0, void 0, function() {
1435
- var o, i, s;
1436
- return W(this, function(l) {
1437
- switch (l.label) {
1438
- case 0:
1439
- return document.body ? [3, 2] : [4, (d = 50, new Promise(function(h) {
1440
- return setTimeout(h, d, c);
1441
- }))];
1442
- case 1:
1443
- return l.sent(), [3, 0];
1444
- case 2:
1445
- if ((o = document.createElement("iframe")).setAttribute("frameBorder", "0"), (i = o.style).setProperty("position", "fixed"), i.setProperty("display", "block", "important"), i.setProperty("visibility", "visible"), i.setProperty("border", "0"), i.setProperty("opacity", "0"), o.src = "about:blank", document.body.appendChild(o), !(s = o.contentDocument || ((a = o.contentWindow) === null || a === void 0 ? void 0 : a.document))) throw new Error("Iframe document is not accessible");
1446
- return n({ iframe: s }), setTimeout(function() {
1447
- document.body.removeChild(o);
1448
- }, 0), [2];
1449
- }
1450
- var d, c;
1451
- });
1452
- });
1453
- })(function(n) {
1454
- var a = n.iframe;
1455
- return G(e, void 0, void 0, function() {
1456
- var o, i, s, l;
1457
- return W(this, function(d) {
1458
- return o = a.createElement("canvas"), i = o.getContext("2d"), s = Bn.map(function(c) {
1459
- return At(i, c);
1460
- }), l = {}, Hn.forEach(function(c) {
1461
- var h = At(i, c);
1462
- s.includes(h) || (l[c] = h);
1463
- }), t(l), [2];
1464
- });
1465
- });
1466
- });
1467
- } catch {
1468
- r({ error: "unsupported" });
1469
- }
1470
- });
1471
- }), $("hardware", function() {
1472
- return new Promise(function(e, t) {
1473
- var r = navigator.deviceMemory !== void 0 ? navigator.deviceMemory : 0, n = window.performance && window.performance.memory ? window.performance.memory : 0;
1474
- e({ videocard: Kn(), architecture: Gn(), deviceMemory: r.toString() || "undefined", jsHeapSizeLimit: n.jsHeapSizeLimit || 0 });
1475
- });
1476
- }), $("locales", function() {
1477
- return new Promise(function(e) {
1478
- e({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
1479
- });
1480
- }), $("permissions", function() {
1481
- return G(this, void 0, void 0, function() {
1482
- var e;
1483
- return W(this, function(t) {
1484
- return Je = (V == null ? void 0 : V.permissions_to_check) || ["accelerometer", "accessibility", "accessibility-events", "ambient-light-sensor", "background-fetch", "background-sync", "bluetooth", "camera", "clipboard-read", "clipboard-write", "device-info", "display-capture", "gyroscope", "geolocation", "local-fonts", "magnetometer", "microphone", "midi", "nfc", "notifications", "payment-handler", "persistent-storage", "push", "speaker", "storage-access", "top-level-storage-access", "window-management", "query"], e = Array.from({ length: (V == null ? void 0 : V.retries) || 3 }, function() {
1485
- return function() {
1486
- return G(this, void 0, void 0, function() {
1487
- var r, n, a, o, i;
1488
- return W(this, function(s) {
1489
- switch (s.label) {
1490
- case 0:
1491
- r = {}, n = 0, a = Je, s.label = 1;
1492
- case 1:
1493
- if (!(n < a.length)) return [3, 6];
1494
- o = a[n], s.label = 2;
1495
- case 2:
1496
- return s.trys.push([2, 4, , 5]), [4, navigator.permissions.query({ name: o })];
1497
- case 3:
1498
- return i = s.sent(), r[o] = i.state.toString(), [3, 5];
1499
- case 4:
1500
- return s.sent(), [3, 5];
1501
- case 5:
1502
- return n++, [3, 1];
1503
- case 6:
1504
- return [2, r];
1505
- }
1506
- });
1507
- });
1508
- }();
1509
- }), [2, Promise.all(e).then(function(r) {
1510
- return Wn(r, Je);
1511
- })];
1512
- });
1513
- });
1514
- }), $("plugins", function() {
1515
- var e = [];
1516
- if (navigator.plugins) for (var t = 0; t < navigator.plugins.length; t++) {
1517
- var r = navigator.plugins[t];
1518
- e.push([r.name, r.filename, r.description].join("|"));
1519
- }
1520
- return new Promise(function(n) {
1521
- n({ plugins: e });
1522
- });
1523
- }), $("screen", function() {
1524
- return new Promise(function(e) {
1525
- e({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: Vn() });
1526
- });
1527
- }), $("system", function() {
1528
- return new Promise(function(e) {
1529
- var t = ue();
1530
- e({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, browser: { name: t.name, version: t.version }, applePayVersion: Fn() });
1531
- });
1532
- });
1533
- var R, jn = ue().name !== "SamsungBrowser" ? 1 : 3, f = null;
1534
- typeof document < "u" && ((R = document.createElement("canvas")).width = 200, R.height = 100, f = R.getContext("webgl")), $("webgl", function() {
1535
- return G(this, void 0, void 0, function() {
1536
- var e;
1537
- return W(this, function(t) {
1538
- try {
1539
- if (!f) throw new Error("WebGL not supported");
1540
- return e = Array.from({ length: jn }, function() {
1541
- return function() {
1542
- try {
1543
- if (!f) throw new Error("WebGL not supported");
1544
- var r = `
1545
- attribute vec2 position;
1546
- void main() {
1547
- gl_Position = vec4(position, 0.0, 1.0);
1548
- }
1549
- `, n = `
1550
- precision mediump float;
1551
- void main() {
1552
- gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
1553
- }
1554
- `, a = f.createShader(f.VERTEX_SHADER), o = f.createShader(f.FRAGMENT_SHADER);
1555
- if (!a || !o) throw new Error("Failed to create shaders");
1556
- if (f.shaderSource(a, r), f.shaderSource(o, n), f.compileShader(a), !f.getShaderParameter(a, f.COMPILE_STATUS)) throw new Error("Vertex shader compilation failed: " + f.getShaderInfoLog(a));
1557
- if (f.compileShader(o), !f.getShaderParameter(o, f.COMPILE_STATUS)) throw new Error("Fragment shader compilation failed: " + f.getShaderInfoLog(o));
1558
- var i = f.createProgram();
1559
- if (!i) throw new Error("Failed to create shader program");
1560
- if (f.attachShader(i, a), f.attachShader(i, o), f.linkProgram(i), !f.getProgramParameter(i, f.LINK_STATUS)) throw new Error("Shader program linking failed: " + f.getProgramInfoLog(i));
1561
- f.useProgram(i);
1562
- for (var s = 137, l = new Float32Array(4 * s), d = 2 * Math.PI / s, c = 0; c < s; c++) {
1563
- var h = c * d;
1564
- l[4 * c] = 0, l[4 * c + 1] = 0, l[4 * c + 2] = Math.cos(h) * (R.width / 2), l[4 * c + 3] = Math.sin(h) * (R.height / 2);
1565
- }
1566
- var m = f.createBuffer();
1567
- f.bindBuffer(f.ARRAY_BUFFER, m), f.bufferData(f.ARRAY_BUFFER, l, f.STATIC_DRAW);
1568
- var p = f.getAttribLocation(i, "position");
1569
- f.enableVertexAttribArray(p), f.vertexAttribPointer(p, 2, f.FLOAT, !1, 0, 0), f.viewport(0, 0, R.width, R.height), f.clearColor(0, 0, 0, 1), f.clear(f.COLOR_BUFFER_BIT), f.drawArrays(f.LINES, 0, 2 * s);
1570
- var y = new Uint8ClampedArray(R.width * R.height * 4);
1571
- return f.readPixels(0, 0, R.width, R.height, f.RGBA, f.UNSIGNED_BYTE, y), new ImageData(y, R.width, R.height);
1572
- } catch {
1573
- return new ImageData(1, 1);
1574
- } finally {
1575
- f && (f.bindBuffer(f.ARRAY_BUFFER, null), f.useProgram(null), f.viewport(0, 0, f.drawingBufferWidth, f.drawingBufferHeight), f.clearColor(0, 0, 0, 0));
1576
- }
1577
- }();
1578
- }), [2, { commonImageHash: nt(Zt(e, R.width, R.height).data.toString()).toString() }];
1579
- } catch {
1580
- return [2, { webgl: "unsupported" }];
1581
- }
1582
- return [2];
1583
- });
1584
- });
1585
- });
1586
- var z = function(e, t, r, n) {
1587
- for (var a = (r - t) / n, o = 0, i = 0; i < n; i++)
1588
- o += e(t + (i + 0.5) * a);
1589
- return o * a;
1590
- };
1591
- $("math", function() {
1592
- return G(void 0, void 0, void 0, function() {
1593
- return W(this, function(e) {
1594
- return [2, { acos: Math.acos(0.5), asin: z(Math.asin, -1, 1, 97), atan: z(Math.atan, -1, 1, 97), cos: z(Math.cos, 0, Math.PI, 97), cosh: Math.cosh(9 / 7), e: Math.E, largeCos: Math.cos(1e20), largeSin: Math.sin(1e20), largeTan: Math.tan(1e20), log: Math.log(1e3), pi: Math.PI, sin: z(Math.sin, -Math.PI, Math.PI, 97), sinh: z(Math.sinh, -9 / 7, 7 / 9, 97), sqrt: Math.sqrt(2), tan: z(Math.tan, 0, 2 * Math.PI, 97), tanh: z(Math.tanh, -9 / 7, 7 / 9, 97) }];
1595
- });
1596
- });
1597
- });
1598
- const be = "Oops! It looks like your session has expired. For your security, please log in again to continue.", Yn = "Your session has been successfully terminated.", we = "Login failed. Please try again.", qe = "Error getting access token, please re-authenticate.", zn = "You forgot to wrap your component in <AuthProvider>.", Ne = {
1599
- dev: "https://auth.gizmette.local.com:3003",
1600
- prod: "https://mylogin.gizmette.com/auth"
1601
- }, ve = "@@auth@@", se = "LOADING", ce = "LOGIN", er = "LOGOUT", Jn = process.env.NODE_ENV === "production", tr = !Jn, De = async ({
1602
- type: e,
1603
- clientId: t,
1604
- params: r = {}
1605
- }) => {
1606
- try {
1607
- const n = await fetch(
1608
- tr ? `${Ne.dev}/${e}` : `${Ne.prod}/${e}`,
1609
- {
1610
- credentials: "include",
1611
- method: "POST",
1612
- headers: {
1613
- "Content-Type": "application/json",
1614
- [Ht.CLIENT_ID]: `${t}`
1615
- },
1616
- body: JSON.stringify(r)
1617
- }
1618
- );
1619
- if (n.status !== 200)
1620
- return { status: n.status, data: [] };
1621
- const { data: a, errors: o } = await n.json();
1622
- return {
1623
- status: n.status,
1624
- data: a,
1625
- errors: o
1626
- };
1627
- } catch (n) {
1628
- return console.error(n), { status: 500, data: [] };
1629
- }
1630
- }, qn = async ({
1631
- userId: e,
1632
- idToken: t,
1633
- accessToken: r,
1634
- refreshToken: n,
1635
- clientId: a,
1636
- domain: o
1637
- }) => {
1638
- try {
1639
- return {
1640
- status: (await De({
1641
- type: xe.LOGOUT,
1642
- clientId: a,
1643
- params: {
1644
- userId: e,
1645
- idToken: t,
1646
- accessToken: r,
1647
- refreshToken: n,
1648
- domain: o
1649
- }
1650
- })).status === 200
1651
- };
1652
- } catch {
1653
- return {
1654
- status: !1
1655
- };
1656
- }
1657
- }, It = async ({
1658
- username: e,
1659
- password: t,
1660
- clientId: r,
1661
- nonce: n,
1662
- type: a,
1663
- sessionExpiration: o,
1664
- code: i,
1665
- code_verifier: s,
1666
- domain: l,
1667
- fingerprint: d
1668
- }) => {
1669
- try {
1670
- const c = await De({
1671
- type: xe.AUTHENTICATE,
1672
- clientId: r,
1673
- params: {
1674
- type: a || ne.ID_AND_ACCESS_TOKEN,
1675
- username: e,
1676
- password: t,
1677
- sessionExpiration: o,
1678
- nonce: n,
1679
- code: i,
1680
- code_verifier: s,
1681
- domain: l,
1682
- fingerprint: d
1683
- }
1684
- }), h = await de(c.data.idToken);
1685
- return h && h.payload[C.USER_ID_KEY] !== "" && h.payload[C.NONCE_KEY] === n ? {
1686
- idToken: c.data.idToken,
1687
- accessToken: c.data.accessToken,
1688
- refreshToken: c.data.refreshToken,
1689
- userId: h.payload[C.USER_ID_KEY],
1690
- status: !0
1691
- } : {
1692
- status: !1
1693
- };
1694
- } catch {
1695
- return {
1696
- status: !1
1697
- };
1698
- }
1699
- }, Qn = async ({
1700
- nonce: e,
1701
- clientId: t,
1702
- code_challenge: r
1703
- }) => {
1704
- try {
1705
- const n = await De({
1706
- type: xe.CODE,
1707
- clientId: t,
1708
- params: {
1709
- type: ne.CODE,
1710
- nonce: e,
1711
- code_challenge: r
1712
- }
1713
- });
1714
- return n.data.code ? {
1715
- status: !0,
1716
- code: n.data.code
1717
- } : {
1718
- status: !1
1719
- };
1720
- } catch {
1721
- return {
1722
- status: !1
1723
- };
1724
- }
1725
- }, Xn = async ({
1726
- clientId: e,
1727
- userId: t,
1728
- nonce: r,
1729
- refreshToken: n,
1730
- accessToken: a,
1731
- domain: o
1732
- }) => {
1733
- try {
1734
- const i = await De({
1735
- type: xe.AUTHENTICATE,
1736
- clientId: e,
1737
- params: {
1738
- type: ne.REFRESH_TOKEN,
1739
- userId: t,
1740
- nonce: r,
1741
- refreshToken: n,
1742
- accessToken: a,
1743
- domain: o,
1744
- fingerprint: await Ie()
1745
- }
1746
- }), s = await de(i.data.accessToken);
1747
- return s && s.payload[C.USER_ID_KEY] !== "" && s.payload[C.NONCE_KEY] === r ? {
1748
- accessToken: i.data.accessToken,
1749
- refreshToken: i.data.refreshToken,
1750
- userId: s.payload[C.USER_ID_KEY],
1751
- status: !0
1752
- } : {
1753
- status: !1
1754
- };
1755
- } catch {
1756
- return {
1757
- status: !1
1758
- };
1759
- }
1760
- }, Ee = {
1761
- GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
1762
- $clientId: String!,
1763
- $username: String!,
1764
- $id: String!) {
1765
- getPasskeyRegistrationOptions(clientId: $clientId, username: $username, id: $id) {
1766
- challenge
1767
- rp {
1768
- id
1769
- name
1770
- }
1771
- user {
1772
- id
1773
- name
1774
- displayName
1775
- }
1776
- pubKeyCredParams {
1777
- type
1778
- alg
1779
- }
1780
- timeout
1781
-
1782
- attestation
1783
- }
1784
- }`,
1785
- VERIFY_REGISTRATION: `mutation VerifyPasskeyRegistration(
1786
- $clientId: String!,
1787
- $username: String!,
1788
- $id: String!,
1789
- $registration: RegistrationOptionsInput!) {
1790
- verifyPasskeyRegistration(
1791
- clientId: $clientId,
1792
- username: $username,
1793
- id: $id,
1794
- registration: $registration) {
1795
- status
1796
- message
1797
- }
1798
- }`,
1799
- GET_AUTHENTICATION_OPTIONS: `mutation GetPasskeyAuthenticationOptions(
1800
- $id: String!,
1801
- $clientId: String!,
1802
- ) {
1803
- getPasskeyAuthenticationOptions(
1804
- id: $id,
1805
- clientId: $clientId) {
1806
- rpId,
1807
- challenge,
1808
- allowCredentials,
1809
- timeout,
1810
- userVerification,
1811
- }
1812
- }`,
1813
- VERIFY_AUTHENTICATION: `mutation VerifyPasskeyAuthentication(
1814
- $clientId: String!,
1815
- $id: String!,
1816
- $authentication: AuthenticationOptionsInput!,
1817
- $nonce: String!,
1818
- $domain: String,
1819
- $fingerprint: String) {
1820
- verifyPasskeyAuthentication(
1821
- clientId: $clientId,
1822
- id: $id,
1823
- authentication: $authentication,
1824
- nonce: $nonce,
1825
- domain: $domain,
1826
- fingerprint: $fingerprint) {
1827
- status,
1828
- idToken,
1829
- accessToken,
1830
- refreshToken,
1831
- userId,
1832
- username,
1833
- }
1834
- }`
1835
- }, X = {
1836
- GET_REGISTRATION_OPTIONS: {
1837
- schema: Ee.GET_REGISTRATION_OPTIONS,
1838
- method: "getPasskeyRegistrationOptions"
1839
- },
1840
- VERIFY_REGISTRATION: {
1841
- schema: Ee.VERIFY_REGISTRATION,
1842
- method: "verifyPasskeyRegistration"
1843
- },
1844
- GET_AUTHENTICATION_OPTIONS: {
1845
- schema: Ee.GET_AUTHENTICATION_OPTIONS,
1846
- method: "getPasskeyAuthenticationOptions"
1847
- },
1848
- VERIFY_AUTHENTICATION: {
1849
- schema: Ee.VERIFY_AUTHENTICATION,
1850
- method: "verifyPasskeyAuthentication"
1851
- }
1852
- }, Z = async ({
1853
- accessToken: e,
1854
- type: t,
1855
- clientId: r,
1856
- params: n = {}
1857
- }) => {
1858
- try {
1859
- const a = t != null && t.data ? t.data(n) : n, o = `Bearer ${e}`, i = await fetch(
1860
- tr ? `${Ne.dev}/graphql` : `${Ne.prod}/graphql`,
1861
- {
1862
- method: "POST",
1863
- credentials: "include",
1864
- headers: {
1865
- authorization: o,
1866
- "Content-Type": "application/json",
1867
- Accept: "application/json",
1868
- [Ht.CLIENT_ID]: `${r}`
1869
- },
1870
- body: JSON.stringify({
1871
- query: t.schema,
1872
- variables: a
1873
- })
1874
- }
1875
- );
1876
- if (i.status !== 200)
1877
- return { status: i.status, data: [] };
1878
- const { data: s, errors: l } = await i.json();
1879
- return {
1880
- status: i.status,
1881
- data: s[t.method],
1882
- errors: l
1883
- };
1884
- } catch (a) {
1885
- return console.error(a), { status: 500, data: [] };
1886
- }
1887
- }, Ie = async () => {
1888
- try {
1889
- const e = await Mn();
1890
- return typeof e == "string" ? e : e.hash && typeof e.hash == "string" ? e.hash : "";
1891
- } catch {
1892
- return "";
1893
- }
1894
- };
1895
- class Zn {
1896
- constructor(t = null, r = null) {
1897
- Be(this, "refreshTokenPromise", null), Be(this, "accessToken"), Be(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
1898
- }
1899
- async refreshtoken({
1900
- clientId: t,
1901
- userId: r,
1902
- nonce: n,
1903
- domain: a
1904
- }) {
1905
- this.refreshTokenPromise || (this.refreshTokenPromise = this._refreshToken({
1906
- clientId: t,
1907
- userId: r,
1908
- nonce: n,
1909
- domain: a
1910
- }));
1911
- try {
1912
- return await this.refreshTokenPromise;
1913
- } finally {
1914
- this.refreshTokenPromise = null;
1915
- }
1916
- }
1917
- async _refreshToken({
1918
- clientId: t,
1919
- userId: r,
1920
- nonce: n,
1921
- domain: a
1922
- }) {
1923
- const o = await de(this.refreshToken);
1924
- if (o && o.payload[C.USER_ID_KEY] !== "") {
1925
- const i = await Xn({
1926
- clientId: t,
1927
- userId: r,
1928
- nonce: n,
1929
- refreshToken: this.refreshToken,
1930
- accessToken: this.accessToken,
1931
- domain: a
1932
- });
1933
- return i.status ? (this.accessToken = i.accessToken, this.refreshToken = i.refreshToken, {
1934
- status: "success",
1935
- newAccessToken: i.accessToken,
1936
- newRefreshToken: i.refreshToken
1937
- }) : {
1938
- status: "failure"
1939
- };
1940
- } else
1941
- return {
1942
- status: "failure"
1943
- };
1944
- }
1945
- }
1946
- const ee = () => {
1947
- throw new Error(zn);
1948
- }, rr = yr({
1949
- isAuthenticated: !1,
1950
- isLoading: !1,
1951
- authenticationType: null,
1952
- login: ee,
1953
- logout: ee,
1954
- getAccessToken: ee,
1955
- getIdToken: ee,
1956
- registeringForPasskey: ee,
1957
- loginWithPasskey: ee,
1958
- logoutReason: ""
1959
- }), ea = F.createContext({
1960
- state: {
1961
- isLoading: !0,
1962
- isAuthenticated: !1,
1963
- authenticationType: null,
1964
- user: void 0,
1965
- logoutReason: ""
1966
- },
1967
- dispatch: () => {
1968
- }
1969
- }), ta = (e, t) => (t == null ? void 0 : t.type) === se ? {
1970
- ...e,
1971
- isLoading: t.payload.isLoading
1972
- } : (t == null ? void 0 : t.type) === ce ? {
1973
- ...e,
1974
- isLoading: !1,
1975
- isAuthenticated: !0,
1976
- user: t.payload.user,
1977
- authenticationType: t.payload.authenticationType,
1978
- logoutReason: ""
1979
- } : (t == null ? void 0 : t.type) === er ? {
1980
- ...e,
1981
- isLoading: !1,
1982
- isAuthenticated: !1,
1983
- user: void 0,
1984
- authenticationType: null,
1985
- logoutReason: t.payload.logoutReason
1986
- } : e, ra = ({
1987
- children: e,
1988
- sessionExpiration: t,
1989
- clientId: r,
1990
- domain: n = ""
1991
- }) => {
1992
- const [a, o] = Ct(ta, {
1993
- isLoading: !0,
1994
- isAuthenticated: !1,
1995
- authenticationType: null,
1996
- user: void 0,
1997
- logoutReason: ""
1998
- }), i = q(!1), [s, l, , d] = ge({
1999
- key: `${ve}::${r}::@@user@@`
2000
- }), [c, h, , m] = ge({
2001
- key: `${ve}::${r}::@@access@@`
2002
- }), [p, y, , E] = ge(
2003
- {
2004
- key: `${ve}::${r}::@@refresh@@`
2005
- }
2006
- ), [N, k, , L] = ge({
2007
- key: `${ve}::${r}::@@nonce@@`
2008
- }), U = new Zn(c, p), x = le(
2009
- (g) => {
2010
- console.warn(g), o({
2011
- type: er,
2012
- payload: {
2013
- logoutReason: g || be
2014
- }
2015
- }), d(), m(), E(), L(), o({ type: se, payload: { isLoading: !1 } });
2016
- },
2017
- [m, d, L, E]
2018
- ), D = le(
2019
- async (g) => {
2020
- const { user: w } = a;
2021
- await qn({
2022
- userId: (w == null ? void 0 : w.userId) || "",
2023
- idToken: s,
2024
- accessToken: c,
2025
- refreshToken: p,
2026
- clientId: r,
2027
- domain: n
2028
- }), x(g || be);
2029
- },
2030
- [
2031
- c,
2032
- a,
2033
- r,
2034
- n,
2035
- s,
2036
- p,
2037
- x
2038
- ]
2039
- );
2040
- re(() => {
2041
- if (!i.current)
2042
- return a.isLoading && s !== null ? (async () => {
2043
- try {
2044
- const g = await de(s);
2045
- g && g.payload[C.USER_ID_KEY] !== "" ? o({
2046
- type: ce,
2047
- payload: {
2048
- authenticationType: g.payload[C.AUTH_TYPE_KEY],
2049
- user: {
2050
- userId: g.payload[C.USER_ID_KEY],
2051
- username: g.payload[C.USERNAME_KEY]
2052
- }
2053
- }
2054
- }) : await D(be);
2055
- } catch {
2056
- await D(be);
2057
- }
2058
- })() : o({ type: se, payload: { isLoading: !1 } }), () => {
2059
- i.current = !0;
2060
- };
2061
- }, [a.isLoading, s, D]);
2062
- const O = async (g, w, v) => {
2063
- const P = Ye();
2064
- if (k(P), o({ type: se, payload: { isLoading: !0 } }), d(), m(), E(), v === ne.CODE) {
2065
- const { code_verifier: fr, code_challenge: gr } = await vn(), ct = await Qn({
2066
- nonce: P,
2067
- clientId: r,
2068
- code_challenge: gr
2069
- });
2070
- if (ct.status) {
2071
- const ie = await It({
2072
- username: g,
2073
- password: w,
2074
- clientId: r,
2075
- sessionExpiration: t,
2076
- nonce: P,
2077
- type: v,
2078
- code: ct.code,
2079
- code_verifier: fr,
2080
- domain: n,
2081
- fingerprint: await Ie()
2082
- });
2083
- return ie.status ? (l(ie.idToken), h(ie.accessToken), y(ie.refreshToken), o({
2084
- type: ce,
2085
- payload: {
2086
- authenticationType: v,
2087
- user: {
2088
- userId: ie.userId,
2089
- username: g
2090
- }
2091
- }
2092
- }), !0) : (x(we), !1);
2093
- }
2094
- return !1;
2095
- }
2096
- const oe = await It({
2097
- username: g,
2098
- password: w,
2099
- clientId: r,
2100
- sessionExpiration: t,
2101
- nonce: P,
2102
- type: v,
2103
- domain: n,
2104
- fingerprint: await Ie()
2105
- });
2106
- return oe.status ? (l(oe.idToken), h(oe.accessToken), y(oe.refreshToken), o({
2107
- type: ce,
2108
- payload: {
2109
- authenticationType: v,
2110
- user: {
2111
- userId: oe.userId,
2112
- username: g
2113
- }
2114
- }
2115
- }), !0) : (x(we), !1);
2116
- }, ae = async (g) => {
2117
- g == null || g.preventDefault(), await D(Yn);
2118
- }, M = async () => {
2119
- const { isAuthenticated: g, user: w } = a;
2120
- try {
2121
- if (g && w && w.userId) {
2122
- if (c) {
2123
- const P = await de(c);
2124
- if (P && P.payload[C.USER_ID_KEY] !== "")
2125
- return c;
2126
- }
2127
- const v = await U.refreshtoken({
2128
- clientId: r,
2129
- userId: w.userId,
2130
- nonce: N,
2131
- domain: n
2132
- });
2133
- return v.status && v.status === "success" ? (h(v.newAccessToken), y(v.newRefreshToken), v.newAccessToken) : (await D(qe), "");
2134
- }
2135
- return await D(qe), "";
2136
- } catch {
2137
- return await D(qe), "";
2138
- }
2139
- }, Le = () => {
2140
- if (a.isAuthenticated && s)
2141
- return s;
2142
- }, Ue = async () => {
2143
- const { user: g } = a;
2144
- let w = await Z({
2145
- accessToken: c,
2146
- clientId: r,
2147
- type: X.GET_REGISTRATION_OPTIONS,
2148
- params: {
2149
- clientId: r,
2150
- id: g == null ? void 0 : g.userId,
2151
- username: g == null ? void 0 : g.username
2152
- }
2153
- });
2154
- if (w.status)
2155
- try {
2156
- const v = await kr(w.data);
2157
- w = await Z({
2158
- accessToken: c,
2159
- clientId: r,
2160
- type: X.VERIFY_REGISTRATION,
2161
- params: {
2162
- clientId: r,
2163
- id: g == null ? void 0 : g.userId,
2164
- username: g == null ? void 0 : g.username,
2165
- registration: v
2166
- }
2167
- });
2168
- } catch {
2169
- return await Z({
2170
- accessToken: c,
2171
- clientId: r,
2172
- type: X.VERIFY_REGISTRATION,
2173
- params: {
2174
- clientId: r,
2175
- id: g == null ? void 0 : g.userId,
2176
- username: g == null ? void 0 : g.username,
2177
- registration: {}
2178
- }
2179
- }), !1;
2180
- }
2181
- }, He = async () => {
2182
- const g = Ye();
2183
- k(g), o({ type: se, payload: { isLoading: !0 } }), d(), m(), E();
2184
- const w = Ye();
2185
- let v = await Z({
2186
- accessToken: c,
2187
- clientId: r,
2188
- type: X.GET_AUTHENTICATION_OPTIONS,
2189
- params: {
2190
- id: w,
2191
- clientId: r
2192
- }
2193
- });
2194
- if (v.status)
2195
- try {
2196
- const P = await Nr(v.data);
2197
- return v = await Z({
2198
- accessToken: c,
2199
- clientId: r,
2200
- type: X.VERIFY_AUTHENTICATION,
2201
- params: {
2202
- clientId: r,
2203
- id: w,
2204
- authentication: P,
2205
- nonce: g,
2206
- domain: n,
2207
- fingerprint: await Ie()
2208
- }
2209
- }), v.data.status === "success" ? (l(v.data.idToken), h(v.data.accessToken), y(v.data.refreshToken), o({
2210
- type: ce,
2211
- payload: {
2212
- authenticationType: ne.PASSKEY,
2213
- user: {
2214
- userId: v.data.userId,
2215
- username: v.data.username
2216
- }
2217
- }
2218
- }), !0) : (x(we), !1);
2219
- } catch {
2220
- return await Z({
2221
- accessToken: c,
2222
- clientId: r,
2223
- type: X.VERIFY_AUTHENTICATION,
2224
- params: {
2225
- clientId: r,
2226
- id: w,
2227
- authentication: {},
2228
- nonce: g,
2229
- domain: n
2230
- }
2231
- }), x(we), !1;
2232
- }
2233
- };
2234
- return /* @__PURE__ */ u(ea.Provider, { value: { state: a, dispatch: o }, children: /* @__PURE__ */ u(
2235
- rr.Provider,
2236
- {
2237
- value: {
2238
- ...a,
2239
- login: O,
2240
- logout: ae,
2241
- getAccessToken: M,
2242
- getIdToken: Le,
2243
- registeringForPasskey: Ue,
2244
- loginWithPasskey: He
2245
- },
2246
- children: e
2247
- }
2248
- ) });
2249
- }, at = (e = rr) => xt(e), Io = "user", ko = "assistant", _o = "system", Ro = "internal", No = "hidden", Co = "I'm having trouble right now. Please try again later.", xo = "gpt-4", Oo = 128e3, Po = "action-message", Do = "action-reset", Mo = "action-model", $o = "action-restore", Lo = "action-location", Uo = "action-streaming", Ho = "action-search", Bo = "action-sort", Ko = "sassy-saint-", Go = "details", Wo = "search", Vo = "sort", Fo = "location", jo = "==stats==", na = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", kt = (e) => Number.isFinite(e) ? e : 0;
2250
- function aa(e) {
2251
- return {
2252
- days: Math.trunc(e / 864e5),
2253
- hours: Math.trunc(e / 36e5 % 24),
2254
- minutes: Math.trunc(e / 6e4 % 60),
2255
- seconds: Math.trunc(e / 1e3 % 60),
2256
- milliseconds: Math.trunc(e % 1e3),
2257
- microseconds: Math.trunc(kt(e * 1e3) % 1e3),
2258
- nanoseconds: Math.trunc(kt(e * 1e6) % 1e3)
2259
- };
2260
- }
2261
- function oa(e) {
2262
- return {
2263
- days: e / 86400000n,
2264
- hours: e / 3600000n % 24n,
2265
- minutes: e / 60000n % 60n,
2266
- seconds: e / 1000n % 60n,
2267
- milliseconds: e % 1000n,
2268
- microseconds: 0n,
2269
- nanoseconds: 0n
2270
- };
2271
- }
2272
- function ia(e) {
2273
- switch (typeof e) {
2274
- case "number": {
2275
- if (Number.isFinite(e))
2276
- return aa(e);
2277
- break;
2278
- }
2279
- case "bigint":
2280
- return oa(e);
2281
- }
2282
- throw new TypeError("Expected a finite number or bigint");
2283
- }
2284
- const sa = (e) => e === 0 || e === 0n, ca = (e, t) => t === 1 || t === 1n ? e : `${e}s`, la = 1e-7, da = 24n * 60n * 60n * 1000n;
2285
- function ua(e, t) {
2286
- const r = typeof e == "bigint";
2287
- if (!r && !Number.isFinite(e))
2288
- throw new TypeError("Expected a finite number or bigint");
2289
- t = { ...t }, 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);
2290
- let n = [];
2291
- const a = (d, c) => {
2292
- const h = Math.floor(d * 10 ** c + la);
2293
- return (Math.round(h) / 10 ** c).toFixed(c);
2294
- }, o = (d, c, h, m) => {
2295
- if (!((n.length === 0 || !t.colonNotation) && sa(d) && !(t.colonNotation && h === "m"))) {
2296
- if (m = m ?? String(d), t.colonNotation) {
2297
- const p = m.includes(".") ? m.split(".")[0].length : m.length, y = n.length > 0 ? 2 : 1;
2298
- m = "0".repeat(Math.max(0, y - p)) + m;
2299
- } else
2300
- m += t.verbose ? " " + ca(c, d) : h;
2301
- n.push(m);
2302
- }
2303
- }, i = ia(e), s = BigInt(i.days);
2304
- if (o(s / 365n, "year", "y"), o(s % 365n, "day", "d"), o(Number(i.hours), "hour", "h"), o(Number(i.minutes), "minute", "m"), t.separateMilliseconds || t.formatSubMilliseconds || !t.colonNotation && e < 1e3) {
2305
- const d = Number(i.seconds), c = Number(i.milliseconds), h = Number(i.microseconds), m = Number(i.nanoseconds);
2306
- if (o(d, "second", "s"), t.formatSubMilliseconds)
2307
- o(c, "millisecond", "ms"), o(h, "microsecond", "µs"), o(m, "nanosecond", "ns");
2308
- else {
2309
- const p = c + h / 1e3 + m / 1e6, y = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, E = p >= 1 ? Math.round(p) : Math.ceil(p), N = y ? p.toFixed(y) : E;
2310
- o(
2311
- Number.parseFloat(N),
2312
- "millisecond",
2313
- "ms",
2314
- N
2315
- );
2316
- }
2317
- } else {
2318
- const d = (r ? Number(e % da) : e) / 1e3 % 60, c = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, h = a(d, c), m = t.keepDecimalsOnWholeSeconds ? h : h.replace(/\.0+$/, "");
2319
- o(Number.parseFloat(m), "second", "s", m);
2320
- }
2321
- if (n.length === 0)
2322
- return "0" + (t.verbose ? " milliseconds" : "ms");
2323
- const l = t.colonNotation ? ":" : " ";
2324
- return typeof t.unitCount == "number" && (n = n.slice(0, Math.max(t.unitCount, 1))), n.join(l);
2325
- }
2326
- const ma = process.env.NODE_ENV === "production", ot = !ma, ha = ot ? "gizmette.local.com" : "gizmette.com", Yo = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, nr = (e, t) => {
2327
- const r = e < 0 ? t ? "W" : "S" : t ? "E" : "N", n = 0 | Math.abs(e), a = 0 | Math.abs(e) * 60 % 60, o = (0 | Math.abs(e) * 60 % 1 * 6e3) / 100;
2328
- return {
2329
- dir: r,
2330
- deg: n,
2331
- min: a,
2332
- sec: o
2333
- };
2334
- }, zo = (e) => {
2335
- if (!e && e !== 0)
2336
- return "N/A";
2337
- const t = nr(e, !1);
2338
- return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
2339
- }, Jo = (e) => {
2340
- if (!e && e !== 0)
2341
- return "N/A";
2342
- const t = nr(e, !0);
2343
- return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
2344
- }, qo = async () => {
2345
- const e = {
2346
- /**
2347
- * A boolean value that indicates the application would
2348
- * like to receive the best possible results. If true
2349
- * and if the device is able to provide a more accurate
2350
- * position, it will do so. Note that this can result in
2351
- * slower response times or increased power consumption
2352
- * (with a GPS chip on a mobile device for example). On
2353
- * the other hand, if false, the device can take the
2354
- * liberty to save resources by responding more quickly
2355
- * and/or using less power. Default: false.
2356
- */
2357
- enableHighAccuracy: !1,
2358
- /**
2359
- * A positive long value representing the maximum length
2360
- * of time (in milliseconds) the device is allowed to
2361
- * take in order to return a position. The default value
2362
- * is Infinity, meaning that getCurrentPosition() won't
2363
- * return until the position is available.
2364
- */
2365
- timeout: 1e4,
2366
- /**
2367
- * A positive long value indicating the maximum age in
2368
- * milliseconds of a possible cached position that is
2369
- * acceptable to return. If set to 0, it means that the
2370
- * device cannot use a cached position and must attempt
2371
- * to retrieve the real current position. If set to
2372
- * Infinity the device must return a cached position
2373
- * regardless of its age. Default: 0.
2374
- */
2375
- maximumAge: 6e4
2376
- };
2377
- return new Promise((t, r) => {
2378
- var n;
2379
- (n = navigator == null ? void 0 : navigator.geolocation) == null || n.getCurrentPosition(
2380
- (a) => {
2381
- t({
2382
- latitude: a.coords.latitude,
2383
- longitude: a.coords.longitude,
2384
- accuracy: a.coords.accuracy
2385
- });
2386
- },
2387
- (a) => {
2388
- r(a);
2389
- },
2390
- e
2391
- );
2392
- });
2393
- }, Qo = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ u("dl", { className: "my-0", children: /* @__PURE__ */ S("div", { className: "flex items-center justify-between", children: [
2394
- /* @__PURE__ */ u("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
2395
- /* @__PURE__ */ u("dd", { className: "inline-block", children: t[r] })
2396
- ] }) }, `${e}-${r}`)) : null;
2397
- function Xo({
2398
- data: e,
2399
- formatter: t = (r) => r
2400
- }) {
2401
- const r = e.filter(
2402
- (a) => typeof a == "number" && a > 0
2403
- ), n = r.reduce(
2404
- (a, o) => (a || 0) + (o || 0),
2405
- 0
2406
- );
2407
- return t(n ? n / r.length : 0);
2408
- }
2409
- const Zo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, ei = new Intl.NumberFormat("en", {
2410
- style: "decimal",
2411
- signDisplay: "never",
2412
- minimumFractionDigits: 0,
2413
- maximumFractionDigits: 0
2414
- }), ti = (e) => ua(e, {
2415
- secondsDecimalDigits: 2,
2416
- unitCount: 2
2417
- }), pa = (e) => b(
2418
- "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",
2419
- e || ot ? "pt-4" : "pt-10"
2420
- ), ri = (e, t) => t === 1 ? e : `${e}s`, Me = (e) => {
2421
- let t = "";
2422
- if (typeof e == "number" || typeof e == "string")
2423
- t = "m-" + e;
2424
- else {
2425
- const r = [];
2426
- (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(" ");
2427
- }
2428
- return t;
2429
- }, ni = "av-bubble", _t = "av-button", ke = "av-card", fa = "av-footer", ga = "av-main", ai = "av-messagebox", oi = "av-panel", ii = "av-spinner", ar = "icon", or = "button", ya = "link", ba = ({
2430
- type: e,
2431
- size: t,
2432
- labelRight: r,
2433
- labelLeft: n,
2434
- align: a
2435
- }) => {
2436
- const o = "text-sm font-medium max-h-8 py-0", i = "text-base font-medium max-h-9 py-1", s = "text-lg font-medium max-h-12 py-2";
2437
- switch (e) {
2438
- case or:
2439
- return b("px-4", {
2440
- [o]: t === "small",
2441
- [i]: t === "medium",
2442
- [s]: t === "large"
2443
- });
2444
- case ya:
2445
- return b("px-4 text-center", {
2446
- [o]: t === "small",
2447
- [i]: t === "medium",
2448
- [s]: t === "large"
2449
- });
2450
- case ar:
2451
- return b("inline-flex items-center", {
2452
- "justify-center": a === "center",
2453
- "justify-start": a === "left",
2454
- "justify-end": a === "right",
2455
- "h-6 w-6 p-0": t === "small" && !(r || n),
2456
- "h-6 px-4 text-sm font-medium": t === "small" && (r || n),
2457
- "h-8 w-8 p-1": t === "medium" && !(r || n),
2458
- "h-8 px-4 text-base font-medium": t === "medium" && (r || n),
2459
- "h-12 w-12 p-2": t === "large" && !(r || n),
2460
- "h-12 px-4 text-lg font-medium": t === "large" && (r || n)
2461
- });
2462
- }
2463
- }, wa = ({
2464
- mode: e,
2465
- noBackground: t,
2466
- noTruncate: r,
2467
- variant: n
2468
- }) => {
2469
- if (t)
2470
- return "not-prose rounded-full";
2471
- if (n === "primary")
2472
- return b("not-prose rounded-full", {
2473
- truncate: !r,
2474
- "bg-action-dark text-copy-light": e === "dark",
2475
- "bg-action-light text-copy-lighter": e === "light",
2476
- "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "system",
2477
- "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
2478
- });
2479
- if (n === "secondary")
2480
- return b("not-prose rounded-full", {
2481
- truncate: !r,
2482
- "bg-action-dark text-copy-light": e === "light",
2483
- "bg-action-light text-copy-lighter": e === "dark",
2484
- "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "alt-system",
2485
- "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
2486
- });
2487
- if (n === "danger")
2488
- return b("not-prose rounded-full", {
2489
- truncate: !r,
2490
- "bg-action-danger-dark text-copy-light": e === "dark",
2491
- "bg-action-danger-light text-copy-lighter": e === "light",
2492
- "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
2493
- "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
2494
- });
2495
- }, va = ({
2496
- mode: e,
2497
- disabled: t,
2498
- variant: r
2499
- }) => {
2500
- if (t)
2501
- return "";
2502
- if (r === "primary")
2503
- return b("hover:text-copy-light-hover", {
2504
- "hover:bg-action-dark-hover": e === "dark",
2505
- "hover:bg-action-light-hover": e === "light",
2506
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
2507
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
2508
- });
2509
- if (r === "secondary")
2510
- return b("hover:text-copy-light-hover", {
2511
- "hover:bg-action-dark-hover": e === "light",
2512
- "hover:bg-action-light-hover": e === "dark",
2513
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
2514
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
2515
- });
2516
- if (r === "danger")
2517
- return b("hover:text-copy-light-hover", {
2518
- "hover:bg-action-danger-dark-hover": e === "dark",
2519
- "hover:bg-action-danger-light-hover": e === "light",
2520
- "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
2521
- "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
2522
- });
2523
- }, Ea = ({
2524
- mode: e,
2525
- disabled: t,
2526
- variant: r
2527
- }) => {
2528
- if (t)
2529
- return "";
2530
- if (r === "primary")
2531
- return b("active:text-copy-light-active", {
2532
- "active:bg-action-dark-active": e === "dark",
2533
- "active:bg-action-light-active": e === "light",
2534
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
2535
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
2536
- });
2537
- if (r === "secondary")
2538
- return b("active:text-copy-light-active", {
2539
- "active:bg-action-dark-active": e === "light",
2540
- "active:bg-action-light-active": e === "dark",
2541
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
2542
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
2543
- });
2544
- if (r === "danger")
2545
- return b("active:text-copy-lighter-active", {
2546
- "active:bg-action-danger-dark-active": e === "dark",
2547
- "active:bg-action-danger-light-active": e === "light",
2548
- "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
2549
- "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
2550
- });
2551
- }, Sa = ({
2552
- mode: e,
2553
- noBorder: t,
2554
- variant: r
2555
- }) => {
2556
- if (t)
2557
- return "border border-transparent";
2558
- if (r === "primary")
2559
- return b("border", {
2560
- "border-border-dark": e === "dark",
2561
- "border-border-accent": e === "light",
2562
- "border-border-dark dark:border-border-accent": e === "system",
2563
- "border-border-accent dark:border-border-dark": e === "alt-system"
2564
- });
2565
- if (r === "secondary")
2566
- return b("border", {
2567
- "border-border-dark": e === "light",
2568
- "border-border-accent": e === "dark",
2569
- "border-border-dark dark:border-border-accent": e === "alt-system",
2570
- "border-border-accent dark:border-border-dark": e === "system"
2571
- });
2572
- if (r === "danger")
2573
- return b("border", {
2574
- "border-border-danger-dark": e === "dark",
2575
- "border-border-danger-medium": e === "light",
2576
- "border-border-danger-dark dark:border-border-danger-medium": e === "system",
2577
- "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
2578
- });
2579
- }, Ta = ({ focusMode: e }) => b("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
2580
- "focus:outline-focus-dark": e === "dark",
2581
- "focus:outline-focus-light": e === "light",
2582
- "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
2583
- "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
2584
- }), ir = ({
2585
- type: e,
2586
- className: t,
2587
- raw: r,
2588
- mode: n,
2589
- focusMode: a,
2590
- disabled: o,
2591
- fullWidth: i,
2592
- size: s,
2593
- noBorder: l,
2594
- labelRight: d,
2595
- labelLeft: c,
2596
- spacing: h,
2597
- noBackground: m,
2598
- variant: p,
2599
- noTruncate: y,
2600
- align: E
2601
- }) => (p || (p = "primary"), r ? b(_t, t) : b(
2602
- _t,
2603
- t,
2604
- Me(h),
2605
- wa({ mode: n, variant: p, noBackground: m, noTruncate: y }),
2606
- ba({ type: e, size: s, labelRight: d, labelLeft: c, align: E }),
2607
- Sa({ mode: n, variant: p, noBorder: l }),
2608
- Ta({ focusMode: a }),
2609
- va({ mode: n, variant: p, disabled: o }),
2610
- Ea({ mode: n, variant: p, disabled: o }),
2611
- {
2612
- "w-full": i,
2613
- "disabled:cursor-not-allowed disabled:opacity-50": o
2614
- }
2615
- )), Aa = (e, t, r) => {
2616
- var n;
2617
- !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((n = e == null ? void 0 : e.currentTarget) == null ? void 0 : n.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
2618
- }, it = F.forwardRef(
2619
- (e, t) => {
2620
- const { onClick: r, noInternalClick: n = !1, ...a } = e;
2621
- return /* @__PURE__ */ u(
2622
- "button",
2623
- {
2624
- ref: t,
2625
- onClick: (o) => {
2626
- Aa(o, n, r);
2627
- },
2628
- ...a
2629
- }
2630
- );
2631
- }
2632
- );
2633
- it.displayName = "BaseButton";
2634
- const et = F.forwardRef(
2635
- ({
2636
- children: e,
2637
- disabled: t = !1,
2638
- mode: r = "system",
2639
- focusMode: n = "system",
2640
- fullWidth: a = !1,
2641
- className: o,
2642
- type: i = "button",
2643
- raw: s = !1,
2644
- noBorder: l = !1,
2645
- "aria-label": d,
2646
- label: c,
2647
- size: h = "medium",
2648
- labelRight: m,
2649
- labelLeft: p,
2650
- spacing: y,
2651
- noBackground: E = !1,
2652
- align: N = "center",
2653
- ...k
2654
- }, L) => {
2655
- const U = ir({
2656
- type: ar,
2657
- mode: r,
2658
- focusMode: n,
2659
- fullWidth: a,
2660
- disabled: t,
2661
- raw: s,
2662
- className: o,
2663
- noBorder: l,
2664
- size: h,
2665
- labelRight: m,
2666
- labelLeft: p,
2667
- spacing: y,
2668
- noBackground: E,
2669
- align: N
2670
- }), x = b({
2671
- "text-copy-accent-dark": r === "light" && !s,
2672
- "text-copy-light": r === "dark" && !s,
2673
- "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !s,
2674
- "text-copy-light dark:text-copy-accent-dark": r === "system" && !s
2675
- });
2676
- return /* @__PURE__ */ S(
2677
- it,
2678
- {
2679
- ref: L,
2680
- className: U,
2681
- disabled: t,
2682
- type: i,
2683
- "aria-label": d || c,
2684
- ...k,
2685
- children: [
2686
- p && /* @__PURE__ */ u("span", { className: "pr-2", children: p }),
2687
- /* @__PURE__ */ u("div", { className: x, children: e }),
2688
- m && /* @__PURE__ */ u("span", { className: "pl-2", children: m })
2689
- ]
2690
- }
2691
- );
2692
- }
2693
- );
2694
- et.displayName = "ButtonIcon";
2695
- const sr = F.forwardRef(
2696
- ({
2697
- children: e,
2698
- disabled: t = !1,
2699
- mode: r = "system",
2700
- focusMode: n = "system",
2701
- fullWidth: a = !1,
2702
- className: o,
2703
- size: i = "medium",
2704
- raw: s = !1,
2705
- noBorder: l = !1,
2706
- spacing: d,
2707
- variant: c = "primary",
2708
- noTruncate: h = !1,
2709
- ...m
2710
- }, p) => {
2711
- const y = ir({
2712
- type: or,
2713
- mode: r,
2714
- focusMode: n,
2715
- fullWidth: a,
2716
- disabled: t,
2717
- raw: s,
2718
- className: o,
2719
- size: i,
2720
- noBorder: l,
2721
- spacing: d,
2722
- variant: c,
2723
- noTruncate: h
2724
- });
2725
- return /* @__PURE__ */ u(
2726
- it,
2727
- {
2728
- ref: p,
2729
- className: y,
2730
- disabled: t,
2731
- ...m,
2732
- children: e
2733
- }
2734
- );
2735
- }
2736
- );
2737
- sr.displayName = "Button";
2738
- function Ia(e) {
2739
- const t = Ot();
2740
- return `${e}${t}`;
2741
- }
2742
- const ka = ({
2743
- className: e,
2744
- headerClassName: t,
2745
- bodyClassName: r,
2746
- footerClassName: n,
2747
- spacing: a,
2748
- mode: o,
2749
- compact: i,
2750
- noBorder: s
2751
- }) => {
2752
- const l = b(
2753
- ke,
2754
- e,
2755
- "rounded-md",
2756
- Me(a),
2757
- {
2758
- "border-none": s,
2759
- "border-2": !s,
2760
- "p-4": !i,
2761
- "p-1 sm:p-2": i,
2762
- "border-border-accent bg-surface-darker text-copy-light": o === "darker",
2763
- "border-border-accent bg-surface-dark text-copy-light": o === "dark",
2764
- "border-border-dark bg-surface-lighter text-copy-dark": o === "light",
2765
- "border-border-dark bg-surface-lighter text-copy-dark dark:border-border-accent dark:bg-surface-dark dark:text-copy-light": o === "system",
2766
- "border-border-accent bg-surface-dark text-copy-light dark:border-border-dark dark:bg-surface-lighter dark:text-copy-dark": o === "alt-system"
2767
- }
2768
- ), d = t || b(`${ke}__header mt-0 border-b-2`, {
2769
- "text-copy-light border-border-accent": o === "darker",
2770
- "border-border-accent": o === "dark",
2771
- "border-border-medium": o === "light",
2772
- "border-border-medium dark:border-border-accent": o === "system",
2773
- "border-border-accent dark:border-border-medium": o === "alt-system",
2774
- "mb-4": !i,
2775
- "mb-2": i
2776
- }), c = b(r), h = n || b(`${ke}__footer pt-2`);
2777
- return {
2778
- wrapper: l,
2779
- header: d,
2780
- body: c,
2781
- footer: h
2782
- };
2783
- };
2784
- function _a({
2785
- id: e,
2786
- content: t,
2787
- userAriaLabelledby: r,
2788
- className: n
2789
- }) {
2790
- return typeof t == "string" ? /* @__PURE__ */ u("h2", { id: e, className: n, children: t }) : r ? /* @__PURE__ */ u("div", { className: n, children: t }) : t ? /* @__PURE__ */ u("div", { className: n, id: e, children: t }) : null;
2791
- }
2792
- const Ra = ({
2793
- header: e,
2794
- headerClassName: t,
2795
- footer: r,
2796
- footerClassName: n,
2797
- children: a,
2798
- className: o,
2799
- bodyClassName: i,
2800
- "aria-labelledby": s,
2801
- spacing: l,
2802
- mode: d = "system",
2803
- compact: c = !1,
2804
- noBorder: h = !1,
2805
- ...m
2806
- }) => {
2807
- let p = null, y = null;
2808
- const E = typeof e == "string", N = Ia(ke), k = ka({
2809
- className: o,
2810
- headerClassName: t,
2811
- bodyClassName: i,
2812
- footerClassName: n,
2813
- spacing: l,
2814
- mode: d,
2815
- compact: c,
2816
- noBorder: h
2817
- });
2818
- return E ? (p = N, y = p) : !E && e && s ? (p = null, y = s) : !E && e && !s ? (p = N, y = p) : (p = null, y = s || null), /* @__PURE__ */ u("div", { className: k.wrapper, children: /* @__PURE__ */ S(
2819
- "section",
2820
- {
2821
- ...y && {
2822
- "aria-labelledby": y
2823
- },
2824
- className: k.body,
2825
- ...m,
2826
- children: [
2827
- /* @__PURE__ */ u(
2828
- _a,
2829
- {
2830
- ...p && { id: p },
2831
- content: e,
2832
- className: k.header,
2833
- userAriaLabelledby: s
2834
- }
2835
- ),
2836
- /* @__PURE__ */ u("div", { children: a }),
2837
- r ? /* @__PURE__ */ u("div", { className: k.footer, children: r }) : null
2838
- ]
2839
- }
2840
- ) });
2841
- }, Na = ({
2842
- className: e,
2843
- mode: t = "system",
2844
- row1: r,
2845
- row2: n,
2846
- noMargins: a = !1,
2847
- spacing: o,
2848
- raw: i = !1
2849
- }) => {
2850
- const s = b(fa, e, Me(o), {
2851
- "text-copy-dark": !i && t === "dark",
2852
- "text-copy-lighter": !i && t === "light",
2853
- "text-copy-dark dark:text-copy-lighter": !i && t === "system",
2854
- "text-copy-lighter dark:text-copy-dark": !i && t === "alt-system",
2855
- "mb-[100px]": !a && !i,
2856
- "mt-0 flex w-full flex-col p-2 text-center text-xs sm:mt-3 md:mx-auto md:max-w-4xl": !i
2857
- });
2858
- return /* @__PURE__ */ S("footer", { className: s, children: [
2859
- r && /* @__PURE__ */ u("div", { children: r }),
2860
- n && /* @__PURE__ */ u("div", { children: n })
2861
- ] });
2862
- }, Ca = ({
2863
- children: e,
2864
- className: t,
2865
- raw: r = !1,
2866
- spacing: n
2867
- }) => {
2868
- const a = b(t, ga, Me(n), {
2869
- "mt-2 flex w-full flex-col p-2 sm:mt-3 md:mx-auto md:max-w-4xl": !r
2870
- });
2871
- return /* @__PURE__ */ u("main", { className: a, children: e });
2872
- };
2873
- /*!
2874
- @versini/ui-components v5.20.0
2875
- © 2024 gizmette.com
2876
- */
2877
- try {
2878
- window.__VERSINI_UI_GLOBAL__ || (window.__VERSINI_UI_GLOBAL__ = {
2879
- version: "5.20.0",
2880
- buildTime: "07/06/2024 10:24 AM EDT",
2881
- homepage: "https://github.com/aversini/ui-components",
2882
- license: "MIT"
2883
- });
2884
- } catch {
2885
- }
2886
- function xa(e) {
2887
- return wr(() => e.every((t) => t == null) ? () => {
2888
- } : (t) => {
2889
- e.forEach((r) => {
2890
- typeof r == "function" ? r(t) : r != null && (r.current = t);
2891
- });
2892
- }, e);
2893
- }
2894
- function Oa(e) {
2895
- const t = Ot();
2896
- if (!e)
2897
- return t;
2898
- if (typeof e == "number" || typeof e == "string")
2899
- return `${e}${t}`;
2900
- if (typeof e == "object") {
2901
- const { id: r, prefix: n = "" } = e;
2902
- return typeof r == "number" || typeof r == "string" ? `${n}${r}` : `${n}${t}`;
2903
- }
2904
- }
2905
- const cr = "SET_ANNOUNCEMENT", lr = "CLEAR_ANNOUNCEMENT", Pa = {
2906
- alert: null,
2907
- alertdialog: null,
2908
- log: "polite",
2909
- marquee: null,
2910
- progressbar: null,
2911
- status: "polite",
2912
- timer: "assertive"
2913
- }, Da = (e, t) => {
2914
- switch (t == null ? void 0 : t.type) {
2915
- case cr:
2916
- return {
2917
- ...e,
2918
- announcement: t.payload
2919
- };
2920
- case lr:
2921
- return {
2922
- ...e,
2923
- announcement: null
2924
- };
2925
- default:
2926
- return e;
2927
- }
2928
- }, Ma = ({
2929
- onAnnouncementClear: e,
2930
- dispatch: t
2931
- }) => {
2932
- t({
2933
- type: lr
2934
- }), typeof e == "function" && e();
2935
- }, Rt = ({
2936
- children: e,
2937
- clearAnnouncementDelay: t,
2938
- clearAnnouncementTimeoutRef: r,
2939
- onAnnouncementClear: n,
2940
- dispatch: a
2941
- }) => {
2942
- (r == null ? void 0 : r.current) !== null && clearTimeout(r.current), e !== null && a({
2943
- type: cr,
2944
- payload: e
2945
- }), t && (r.current = setTimeout(
2946
- () => Ma({
2947
- onAnnouncementClear: n,
2948
- dispatch: a
2949
- }),
2950
- t
2951
- ));
2952
- }, $a = ({
2953
- children: e,
2954
- announcementTimeoutRef: t,
2955
- announcementDelay: r,
2956
- clearAnnouncementDelay: n,
2957
- clearAnnouncementTimeoutRef: a,
2958
- onAnnouncementClear: o,
2959
- dispatch: i
2960
- }) => {
2961
- clearTimeout(t.current), r ? t.current = setTimeout(Rt, r, {
2962
- children: e,
2963
- clearAnnouncementDelay: n,
2964
- clearAnnouncementTimeoutRef: a,
2965
- onAnnouncementClear: o,
2966
- dispatch: i
2967
- }) : Rt({
2968
- children: e,
2969
- clearAnnouncementDelay: n,
2970
- clearAnnouncementTimeoutRef: a,
2971
- onAnnouncementClear: o,
2972
- dispatch: i
2973
- });
2974
- };
2975
- function dr({
2976
- children: e,
2977
- className: t,
2978
- politeness: r,
2979
- role: n = null,
2980
- announcementDelay: a,
2981
- clearAnnouncementDelay: o,
2982
- onAnnouncementClear: i,
2983
- visible: s,
2984
- ...l
2985
- }) {
2986
- const d = q(), c = q(), [h, m] = Ct(Da, {
2987
- announcement: null
2988
- });
2989
- let p = r;
2990
- typeof p > "u" && (p = n ? Pa[n] : "assertive"), re(() => {
2991
- $a({
2992
- announcementTimeoutRef: d,
2993
- announcementDelay: a,
2994
- children: e,
2995
- clearAnnouncementDelay: o,
2996
- clearAnnouncementTimeoutRef: c,
2997
- onAnnouncementClear: i,
2998
- dispatch: m
2999
- });
3000
- }, [
3001
- e,
3002
- a,
3003
- o,
3004
- i
3005
- ]);
3006
- const y = b(t, {
3007
- "sr-only": !s
3008
- });
3009
- return /* @__PURE__ */ u(
3010
- "div",
3011
- {
3012
- "aria-live": p,
3013
- ...n && { role: n },
3014
- className: y,
3015
- ...l,
3016
- children: h.announcement
3017
- }
3018
- );
3019
- }
3020
- /*!
3021
- @versini/ui-private v1.4.6
3022
- © 2024 gizmette.com
3023
- */
3024
- try {
3025
- window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
3026
- version: "1.4.6",
3027
- buildTime: "07/08/2024 04:31 PM EDT",
3028
- homepage: "https://github.com/aversini/ui-components",
3029
- license: "MIT"
3030
- });
3031
- } catch {
3032
- }
3033
- const La = (e) => {
3034
- let t = "";
3035
- if (typeof e == "number" || typeof e == "string")
3036
- t = "m-" + e;
3037
- else {
3038
- const r = [];
3039
- (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(" ");
3040
- }
3041
- return t;
3042
- }, ur = "av-text-input", Ua = "av-text-input-wrapper", Qe = "av-text-input-helper-text", si = "av-text-area", ci = "av-text-area-wrapper", li = "av-text-area-helper-text", di = "av-text-area__control--right", ui = "av-toggle", Ha = ({
3043
- mode: e
3044
- }) => b({
3045
- "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
3046
- "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
3047
- "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
3048
- "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
3049
- }), Ba = ({
3050
- focusMode: e
3051
- }) => b("focus:outline focus:outline-2 focus:outline-offset-2", {
3052
- "focus:outline-focus-dark": e === "dark",
3053
- "focus:outline-focus-light": e === "light",
3054
- "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
3055
- "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
3056
- }), Ka = ({
3057
- noBorder: e,
3058
- error: t
3059
- }) => b("border-2", {
3060
- "border-border-dark": !e && !t,
3061
- "focus:border-border-dark": !e && t,
3062
- "border-border-error-dark": !e && t,
3063
- "border-transparent": e
3064
- }), Ga = ({
3065
- disabled: e,
3066
- raw: t,
3067
- error: r,
3068
- mode: n
3069
- }) => {
3070
- if (t)
3071
- return "";
3072
- if (e)
3073
- return b("absolute px-2 cursor-not-allowed opacity-50 font-medium");
3074
- if (!r)
3075
- return b("absolute px-2 cursor-text font-medium", {
3076
- "text-copy-lighter": n === "dark",
3077
- "text-copy-dark": n === "light",
3078
- "text-copy-dark dark:text-copy-lighter": n === "system",
3079
- "text-copy-lighter dark:text-copy-dark": n === "alt-system"
3080
- });
3081
- if (r)
3082
- return b("absolute px-2 cursor-text font-medium", {
3083
- "text-copy-lighter": n === "dark",
3084
- "text-copy-error-dark": n === "light",
3085
- "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": n === "system",
3086
- "text-copy-lighter dark:text-copy-error-dark": n === "alt-system"
3087
- });
3088
- }, Wa = ({
3089
- error: e,
3090
- raw: t,
3091
- mode: r,
3092
- disabled: n
3093
- }) => {
3094
- if (t)
3095
- return "";
3096
- if (n)
3097
- return b(
3098
- Qe,
3099
- "absolute px-2 cursor-not-allowed opacity-50 font-medium"
3100
- );
3101
- if (!e)
3102
- return b(Qe, "absolute px-2 font-medium", {
3103
- "text-copy-lighter": r === "dark",
3104
- "text-copy-dark": r === "light",
3105
- "text-copy-dark dark:text-copy-lighter": r === "system",
3106
- "text-copy-lighter dark:text-copy-dark": r === "alt-system"
3107
- });
3108
- if (e)
3109
- return b(Qe, "absolute px-2 font-medium", {
3110
- "text-copy-error-light bg-surface-darker": r === "dark",
3111
- "text-copy-error-dark": r === "light",
3112
- "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
3113
- "dark:text-copy-error-dark text-copy-error-light bg-surface-darker": r === "alt-system"
3114
- });
3115
- }, Va = ({
3116
- className: e,
3117
- inputClassName: t,
3118
- raw: r,
3119
- disabled: n,
3120
- noBorder: a,
3121
- error: o,
3122
- spacing: i,
3123
- mode: s,
3124
- focusMode: l
3125
- }) => {
3126
- const d = r ? e : b(
3127
- "relative flex w-full flex-col justify-center",
3128
- Ua,
3129
- e,
3130
- La(i)
3131
- ), c = r ? b(t) : b(
3132
- ur,
3133
- t,
3134
- "h-12 rounded-md px-4 text-base",
3135
- Ha({ mode: s }),
3136
- Ba({ focusMode: l }),
3137
- Ka({ noBorder: a, error: o }),
3138
- {
3139
- "disabled:cursor-not-allowed disabled:opacity-50": n
3140
- }
3141
- ), h = r ? void 0 : "sr-only", m = Ga({
3142
- disabled: n,
3143
- raw: r,
3144
- error: o,
3145
- mode: s
3146
- }), p = Wa({
3147
- error: o,
3148
- raw: r,
3149
- mode: s,
3150
- disabled: n
3151
- });
3152
- return {
3153
- wrapper: d,
3154
- input: c,
3155
- accessibleLabel: h,
3156
- visibleLabel: m,
3157
- helperText: p,
3158
- rightElement: r ? void 0 : "absolute right-3"
3159
- };
3160
- }, st = F.forwardRef(
3161
- ({
3162
- id: e,
3163
- name: t,
3164
- label: r,
3165
- error: n = !1,
3166
- raw: a = !1,
3167
- className: o,
3168
- inputClassName: i,
3169
- mode: s = "system",
3170
- focusMode: l = "system",
3171
- disabled: d = !1,
3172
- noBorder: c = !1,
3173
- labelId: h,
3174
- labelHidden: m = !1,
3175
- type: p = "text",
3176
- helperText: y = "",
3177
- rightElement: E,
3178
- spacing: N,
3179
- ...k
3180
- }, L) => {
3181
- const U = q(null), [x, D] = J(0), O = Oa({ id: e, prefix: `${ur}-` }), ae = `${t} error, ${y}`, M = Va({
3182
- className: o,
3183
- inputClassName: i,
3184
- error: n,
3185
- raw: a,
3186
- focusMode: l,
3187
- disabled: d,
3188
- noBorder: c,
3189
- spacing: N,
3190
- mode: s
3191
- });
3192
- return vr(() => {
3193
- U.current && D(U.current.offsetWidth + 18 + 10);
3194
- }, []), /* @__PURE__ */ S("div", { className: M.wrapper, children: [
3195
- /* @__PURE__ */ u(
3196
- "label",
3197
- {
3198
- htmlFor: O,
3199
- id: h,
3200
- className: M.accessibleLabel,
3201
- children: r
3202
- }
3203
- ),
3204
- /* @__PURE__ */ u(
3205
- "input",
3206
- {
3207
- ref: L,
3208
- id: O,
3209
- name: t,
3210
- type: p,
3211
- disabled: d,
3212
- placeholder: a ? void 0 : " ",
3213
- className: M.input,
3214
- ...y && { "aria-describedby": `${O}-helper` },
3215
- ...n && { "aria-invalid": "true" },
3216
- ...E && !a && { style: { paddingRight: x } },
3217
- ...k
3218
- }
3219
- ),
3220
- !a && !m && /* @__PURE__ */ u(
3221
- "label",
3222
- {
3223
- "aria-hidden": !0,
3224
- htmlFor: O,
3225
- className: M.visibleLabel,
3226
- children: r
3227
- }
3228
- ),
3229
- y && /* @__PURE__ */ u(
3230
- "div",
3231
- {
3232
- id: `${O}-helper`,
3233
- className: M.helperText,
3234
- children: y
3235
- }
3236
- ),
3237
- E && /* @__PURE__ */ u(
3238
- "div",
3239
- {
3240
- ref: U,
3241
- className: M.rightElement,
3242
- children: E
3243
- }
3244
- ),
3245
- n && y && /* @__PURE__ */ u(dr, { politeness: "polite", clearAnnouncementDelay: 500, children: ae })
3246
- ] });
3247
- }
3248
- );
3249
- st.displayName = "TextInput";
3250
- const Fa = 500, ja = 5e3, Ya = 2e4, mr = F.forwardRef(
3251
- ({
3252
- name: e,
3253
- disabled: t,
3254
- label: r,
3255
- labelHidden: n,
3256
- onMaskChange: a,
3257
- onChange: o,
3258
- onBlur: i,
3259
- onFocus: s,
3260
- onTextInputMaskBlur: l,
3261
- rightElement: d,
3262
- spacing: c,
3263
- ...h
3264
- }, m) => {
3265
- const [p, y] = J(!0), [E, N] = J({
3266
- message: null,
3267
- politeness: null
3268
- }), k = q(!0), L = q(), U = q(null), x = xa([m, U]), D = p ? "Show" : "Hide", O = () => {
3269
- clearTimeout(L.current), k.current || (L.current = window.setTimeout(() => {
3270
- k.current = !0, y(!0), N({
3271
- announcementTimeout: ja,
3272
- politeness: "polite",
3273
- message: `${r} hiding characters`
3274
- }), a && a(!0);
3275
- }, Ya));
3276
- }, ae = (g) => {
3277
- g.preventDefault();
3278
- const w = !k.current;
3279
- k.current = w, O(), y(w), N({
3280
- announcementTimeout: Fa,
3281
- politeness: "assertive",
3282
- message: w ? "Characters hidden" : "Characters showing"
3283
- }), a && a(w);
3284
- }, M = (g) => {
3285
- var w;
3286
- const { relatedTarget: v } = g, P = (w = U.current) == null ? void 0 : w.parentElement;
3287
- P != null && P.contains(v) || l && l();
3288
- }, Le = (g) => {
3289
- O(), i && i(g), M(g);
3290
- }, Ue = (g) => {
3291
- O(), s && s(g);
3292
- }, He = (g) => {
3293
- O(), o && o(g);
3294
- };
3295
- return re(() => () => {
3296
- clearTimeout(L.current);
3297
- }, []), /* @__PURE__ */ S(me, { children: [
3298
- /* @__PURE__ */ u(
3299
- st,
3300
- {
3301
- ref: x,
3302
- name: e,
3303
- label: r,
3304
- labelHidden: n,
3305
- type: p ? "password" : "text",
3306
- disabled: t,
3307
- spacing: c,
3308
- onBlur: Le,
3309
- onFocus: Ue,
3310
- onChange: He,
3311
- rightElement: F.cloneElement(d, {
3312
- ref: m,
3313
- label: D,
3314
- onClick: ae,
3315
- onBlur: M,
3316
- disabled: t
3317
- }),
3318
- ...h
3319
- }
3320
- ),
3321
- /* @__PURE__ */ u(
3322
- dr,
3323
- {
3324
- role: "status",
3325
- politeness: E.politeness,
3326
- clearAnnouncementDelay: E.announcementTimeout,
3327
- children: E.message
3328
- }
3329
- )
3330
- ] });
3331
- }
3332
- );
3333
- mr.displayName = "TextInputMask";
3334
- /*!
3335
- @versini/ui-form v1.3.6
3336
- © 2024 gizmette.com
3337
- */
3338
- try {
3339
- window.__VERSINI_UI_FORM__ || (window.__VERSINI_UI_FORM__ = {
3340
- version: "1.3.6",
3341
- buildTime: "07/08/2024 04:31 PM EDT",
3342
- homepage: "https://github.com/aversini/ui-components",
3343
- license: "MIT"
3344
- });
3345
- } catch {
3346
- }
3347
- const za = (e) => {
3348
- let t = "";
3349
- if (typeof e == "number" || typeof e == "string")
3350
- t = "m-" + e;
3351
- else {
3352
- const r = [];
3353
- (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(" ");
3354
- }
3355
- return t;
3356
- }, $e = ({
3357
- children: e,
3358
- fill: t,
3359
- viewBox: r,
3360
- className: n,
3361
- defaultViewBox: a,
3362
- defaultClassName: o,
3363
- spacing: i,
3364
- title: s,
3365
- semantic: l = !1,
3366
- ...d
3367
- }) => {
3368
- const c = za(i), h = b(
3369
- c,
3370
- n || o
3371
- );
3372
- return /* @__PURE__ */ S(me, { children: [
3373
- /* @__PURE__ */ u(
3374
- "svg",
3375
- {
3376
- xmlns: "http://www.w3.org/2000/svg",
3377
- className: h,
3378
- viewBox: r || a,
3379
- fill: t || "currentColor",
3380
- role: "img",
3381
- "aria-hidden": !l,
3382
- focusable: !1,
3383
- ...d,
3384
- children: e
3385
- }
3386
- ),
3387
- s && l && /* @__PURE__ */ u("span", { className: "sr-only", children: s })
3388
- ] });
3389
- };
3390
- /*!
3391
- @versini/ui-private v1.4.6
3392
- © 2024 gizmette.com
3393
- */
3394
- try {
3395
- window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
3396
- version: "1.4.6",
3397
- buildTime: "07/14/2024 07:45 PM EDT",
3398
- homepage: "https://github.com/aversini/ui-components",
3399
- license: "MIT"
3400
- });
3401
- } catch {
3402
- }
3403
- const Ja = ({
3404
- className: e,
3405
- viewBox: t,
3406
- spacing: r,
3407
- ...n
3408
- }) => /* @__PURE__ */ u(
3409
- $e,
3410
- {
3411
- defaultViewBox: "0 0 1200 500",
3412
- defaultClassName: "w-full",
3413
- viewBox: t,
3414
- className: e,
3415
- spacing: r,
3416
- title: "Sassy Dog",
3417
- ...n,
3418
- children: /* @__PURE__ */ u("g", { transform: "matrix(11.9092 0 0 11.9092 470.0017 250.0009)", id: "879221", children: /* @__PURE__ */ u(
3419
- "path",
3420
- {
3421
- vectorEffect: "non-scaling-stroke",
3422
- transform: " translate(-50.7473, -45.4051)",
3423
- d: "M 89.2 27 c 0 -0.2 -0.1 -0.5 -0.3 -0.6 c -0.6 -0.4 -1.6 -0.1 -2.2 0 c -1.5 0.2 -2.9 0.4 -4.5 0.4 c -2.2 0 -4.5 -0.1 -6.7 -0.4 c -2 -0.3 -3.7 -0.9 -5.8 -0.3 c -3 0.8 -4.9 3.2 -4.8 6.3 c 0.1 1.8 -0.2 3.2 -0.8 4.8 c -0.6 1.5 -1.3 1.7 -2.7 1.7 c -9.7 0 -19.3 -0.1 -29 0 c -1.7 0 -3.5 0 -5.3 0 c -2.5 0 -5 0.5 -7.5 0 c -1.8 -0.4 -3.6 -1.3 -4.9 -2.6 c -0.3 -0.3 -0.9 -1.2 -1.2 -1.2 c -0.4 0.1 -0.4 1.3 -0.4 1.6 c 0 1.3 0.5 2.6 0.5 3.9 c 0 1.3 -0.6 2.4 -1 3.6 c -0.4 1.4 -0.4 2.8 -0.2 4.2 c 0.4 2.3 0.8 4.7 1 7.1 c 0.2 2.1 0.2 4.1 0.4 6.2 c 0.2 1.7 0.3 2.5 2.5 2.8 c 2.6 0.4 2.6 -0.5 3.2 -2.2 c 0.8 -2.1 1.5 -4.3 2.3 -6.4 c 0.7 -1.6 1.3 -5.1 5.7 -3.4 c 2.4 0.9 4.9 1.4 7.4 2.1 c 2.7 0.7 5.5 1.4 8.2 1.9 c 5.5 1.1 11.1 1.7 16.8 2 c 0.6 0 1 0 1.4 0.5 c 1.5 1.9 -0.3 5.3 3.5 5.9 c 3.4 0.5 3.4 -1.9 3.8 -4 c 0.2 -1.2 0.4 -2.3 0.7 -3.4 c 0.1 -0.5 0.5 -1 0.9 -1.3 c 4.7 -2.8 7.4 -8.3 6.6 -13.8 c -0.1 -0.9 -0.4 -1.8 -0.3 -2.8 c 0.2 -2 2.7 -2.8 4.2 -3.6 c 1.9 -1.1 4 -2.1 5.6 -3.6 c 1.1 -1 2 -2.3 2.5 -3.7 C 89.1 28.2 89.3 27.5 89.2 27 z M 73.2 40.4 c -0.2 2.1 -1.1 3.1 -3 3.5 c -3.4 0.7 -5.6 -1.6 -4.6 -4.9 c 0.7 -2.2 1.5 -4.3 2.5 -6.3 c 1 -2 1.9 -2 3.1 -0.1 C 72.7 35 73.5 37.6 73.2 40.4 z M 76.4 31.2 c -0.6 0 -1.1 -0.5 -1.1 -1.1 c 0 -0.6 0.5 -1.1 1.1 -1.1 c 0.6 0 1.1 0.5 1.1 1.1 C 77.5 30.7 77 31.2 76.4 31.2 z",
3424
- strokeLinecap: "round"
3425
- }
3426
- ) })
3427
- }
3428
- ), qa = ({
3429
- className: e,
3430
- viewBox: t,
3431
- spacing: r,
3432
- title: n,
3433
- monotone: a,
3434
- ...o
3435
- }) => /* @__PURE__ */ S(
3436
- $e,
3437
- {
3438
- defaultViewBox: "0 0 640 512",
3439
- defaultClassName: "size-5",
3440
- viewBox: t,
3441
- className: e,
3442
- spacing: r,
3443
- title: n || "Hide",
3444
- ...o,
3445
- children: [
3446
- /* @__PURE__ */ u(
3447
- "path",
3448
- {
3449
- opacity: a ? "1" : "0.4",
3450
- d: "M360.8 380.3C339.4 392.8 314.6 400 288 400c-79.5 0-144-64.5-144-144c0-14.5 2.1-28.5 6.1-41.7L63.5 146c-29.4 34.7-49.9 70.8-61.1 97.6c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480c56.1 0 104.4-17.8 144.5-43.2l-71.7-56.5zM198.5 252.4c-3.7 .8-6.7 3.7-6.5 7.7c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9c1.9-.5 3.9-1.1 5.7-1.7l-120-94.6zm89-52.4l94.8 74.3c2.7-13.9 2.4-28.6-1.5-43.2c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 2.7-.2 5.4-.5 8zM432 256c0 17.7-3.2 34.6-9 50.2l84.1 65.9c32.3-36.6 54.6-75.4 66.4-103.9c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32c-60 0-111.1 20.3-152.8 48.7L207 136.9c23.1-15.7 51-24.9 81-24.9c79.5 0 144 64.5 144 144z"
3451
- }
3452
- ),
3453
- /* @__PURE__ */ u("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" })
3454
- ]
3455
- }
3456
- ), Qa = ({
3457
- className: e,
3458
- viewBox: t,
3459
- spacing: r,
3460
- title: n,
3461
- monotone: a,
3462
- ...o
3463
- }) => /* @__PURE__ */ S(
3464
- $e,
3465
- {
3466
- defaultViewBox: "0 0 512 512",
3467
- defaultClassName: "size-5",
3468
- viewBox: t,
3469
- className: e,
3470
- spacing: r,
3471
- title: n || "Key",
3472
- ...o,
3473
- children: [
3474
- /* @__PURE__ */ u(
3475
- "path",
3476
- {
3477
- className: "fa-secondary",
3478
- opacity: a ? "1" : "0.4",
3479
- d: "M168.3 229.7L282.3 343.7l0 0s0 0 0 0L249 377c-4.5 4.5-10.6 7-17 7H192v40c0 13.3-10.7 24-24 24H128v40c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V408c0-6.4 2.5-12.5 7-17L168.3 229.7s0 0 0 0l0 0z"
3480
- }
3481
- ),
3482
- /* @__PURE__ */ u(
3483
- "path",
3484
- {
3485
- className: "fa-primary",
3486
- d: "M168.3 229.7L282.3 343.7l0 0c16.9 5.4 35 8.3 53.7 8.3c97.2 0 176-78.8 176-176S433.2 0 336 0S160 78.8 160 176c0 18.7 2.9 36.8 8.3 53.7l0 0zM336 136a40 40 0 1 1 80 0 40 40 0 1 1 -80 0z"
3487
- }
3488
- )
3489
- ]
3490
- }
3491
- ), Xa = ({
3492
- className: e,
3493
- viewBox: t,
3494
- spacing: r,
3495
- title: n,
3496
- monotone: a,
3497
- ...o
3498
- }) => /* @__PURE__ */ S(
3499
- $e,
3500
- {
3501
- defaultViewBox: "0 0 576 512",
3502
- defaultClassName: "size-5",
3503
- viewBox: t,
3504
- className: e,
3505
- spacing: r,
3506
- title: n || "Show",
3507
- ...o,
3508
- children: [
3509
- /* @__PURE__ */ u(
3510
- "path",
3511
- {
3512
- opacity: a ? "1" : "0.4",
3513
- d: "M95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 400a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"
3514
- }
3515
- ),
3516
- /* @__PURE__ */ u("path", { d: "M224 256c35.3 0 64-28.7 64-64c0-7.1-1.2-13.9-3.3-20.3c-1.8-5.5 1.6-11.9 7.4-11.7c40.8 1.7 77.5 29.6 88.6 71.1c13.7 51.2-16.7 103.9-67.9 117.6s-103.9-16.7-117.6-67.9c-1.9-6.9-2.9-13.9-3.2-20.7c-.3-5.8 6.1-9.2 11.7-7.4c6.4 2.1 13.2 3.3 20.3 3.3z" })
3517
- ]
3518
- }
3519
- );
3520
- /*!
3521
- @versini/ui-icons v1.11.0
3522
- © 2024 gizmette.com
3523
- */
3524
- try {
3525
- window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
3526
- version: "1.11.0",
3527
- buildTime: "07/14/2024 07:45 PM EDT",
3528
- homepage: "https://github.com/aversini/ui-components",
3529
- license: "MIT"
3530
- });
3531
- } catch {
3532
- }
3533
- const Za = (e) => {
3534
- let t = "";
3535
- if (typeof e == "number" || typeof e == "string")
3536
- t = "m-" + e;
3537
- else {
3538
- const r = [];
3539
- (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(" ");
3540
- }
3541
- return t;
3542
- }, eo = "av-flexgrid", Se = "av-flexgrid-item", Ce = 0.25, hr = F.createContext({
3543
- columnGap: 0,
3544
- rowGap: 0
3545
- }), Nt = ({
3546
- children: e,
3547
- className: t,
3548
- columnGap: r = 1,
3549
- rowGap: n = 0,
3550
- height: a = "auto",
3551
- width: o = "auto",
3552
- direction: i = "row",
3553
- alignHorizontal: s = "normal",
3554
- alignVertical: l = "normal",
3555
- spacing: d,
3556
- ...c
3557
- }) => {
3558
- const h = {
3559
- flexDirection: i,
3560
- justifyContent: s,
3561
- alignItems: l,
3562
- height: a,
3563
- width: o,
3564
- /**
3565
- * Trick to account for the extra space taken
3566
- * by the columnGap and rowGap that will be applied
3567
- * to all FlexgridItems (see context and paddings).
3568
- */
3569
- marginLeft: r * -1 * Ce + "rem",
3570
- marginTop: n * -1 * Ce + "rem"
3571
- }, m = b(
3572
- eo,
3573
- t,
3574
- "box-border flex flex-wrap"
3575
- ), p = { columnGap: r, rowGap: n }, y = d ? "div" : F.Fragment;
3576
- return /* @__PURE__ */ u(y, { ...d ? { className: Za(d) } : {}, children: /* @__PURE__ */ u("div", { className: m, style: h, ...c, children: /* @__PURE__ */ u(hr.Provider, { value: p, children: e }) }) });
3577
- }, Xe = (e, t) => b({
3578
- "basis-1/12": e === 1 && !t,
3579
- "sm:basis-1/12": e === 1 && t === "sm",
3580
- "md:basis-1/12": e === 1 && t === "md",
3581
- "lg:basis-1/12": e === 1 && t === "lg",
3582
- "xl:basis-1/12": e === 1 && t === "xl",
3583
- "2xl:basis-1/12": e === 1 && t === "2xl",
3584
- "basis-2/12": e === 2 && !t,
3585
- "sm:basis-2/12": e === 2 && t === "sm",
3586
- "md:basis-2/12": e === 2 && t === "md",
3587
- "lg:basis-2/12": e === 2 && t === "lg",
3588
- "xl:basis-2/12": e === 2 && t === "xl",
3589
- "2xl:basis-2/12": e === 2 && t === "2xl",
3590
- "basis-3/12": e === 3 && !t,
3591
- "sm:basis-3/12": e === 3 && t === "sm",
3592
- "md:basis-3/12": e === 3 && t === "md",
3593
- "lg:basis-3/12": e === 3 && t === "lg",
3594
- "xl:basis-3/12": e === 3 && t === "xl",
3595
- "2xl:basis-3/12": e === 3 && t === "2xl",
3596
- "basis-4/12": e === 4 && !t,
3597
- "sm:basis-4/12": e === 4 && t === "sm",
3598
- "md:basis-4/12": e === 4 && t === "md",
3599
- "lg:basis-4/12": e === 4 && t === "lg",
3600
- "xl:basis-4/12": e === 4 && t === "xl",
3601
- "2xl:basis-4/12": e === 4 && t === "2xl",
3602
- "basis-5/12": e === 5 && !t,
3603
- "sm:basis-5/12": e === 5 && t === "sm",
3604
- "md:basis-5/12": e === 5 && t === "md",
3605
- "lg:basis-5/12": e === 5 && t === "lg",
3606
- "xl:basis-5/12": e === 5 && t === "xl",
3607
- "2xl:basis-5/12": e === 5 && t === "2xl",
3608
- "basis-6/12": e === 6 && !t,
3609
- "sm:basis-6/12": e === 6 && t === "sm",
3610
- "md:basis-6/12": e === 6 && t === "md",
3611
- "lg:basis-6/12": e === 6 && t === "lg",
3612
- "xl:basis-6/12": e === 6 && t === "xl",
3613
- "2xl:basis-6/12": e === 6 && t === "2xl",
3614
- "basis-7/12": e === 7 && !t,
3615
- "sm:basis-7/12": e === 7 && t === "sm",
3616
- "md:basis-7/12": e === 7 && t === "md",
3617
- "lg:basis-7/12": e === 7 && t === "lg",
3618
- "xl:basis-7/12": e === 7 && t === "xl",
3619
- "2xl:basis-7/12": e === 7 && t === "2xl",
3620
- "basis-8/12": e === 8 && !t,
3621
- "sm:basis-8/12": e === 8 && t === "sm",
3622
- "md:basis-8/12": e === 8 && t === "md",
3623
- "lg:basis-8/12": e === 8 && t === "lg",
3624
- "xl:basis-8/12": e === 8 && t === "xl",
3625
- "2xl:basis-8/12": e === 8 && t === "2xl",
3626
- "basis-9/12": e === 9 && !t,
3627
- "sm:basis-9/12": e === 9 && t === "sm",
3628
- "md:basis-9/12": e === 9 && t === "md",
3629
- "lg:basis-9/12": e === 9 && t === "lg",
3630
- "xl:basis-9/12": e === 9 && t === "xl",
3631
- "2xl:basis-9/12": e === 9 && t === "2xl",
3632
- "basis-10/12": e === 10 && !t,
3633
- "sm:basis-10/12": e === 10 && t === "sm",
3634
- "md:basis-10/12": e === 10 && t === "md",
3635
- "lg:basis-10/12": e === 10 && t === "lg",
3636
- "xl:basis-10/12": e === 10 && t === "xl",
3637
- "2xl:basis-10/12": e === 10 && t === "2xl",
3638
- "basis-11/12": e === 11 && !t,
3639
- "sm:basis-11/12": e === 11 && t === "sm",
3640
- "md:basis-11/12": e === 11 && t === "md",
3641
- "lg:basis-11/12": e === 11 && t === "lg",
3642
- "xl:basis-11/12": e === 11 && t === "xl",
3643
- "2xl:basis-11/12": e === 11 && t === "2xl",
3644
- "basis-full": e === 12 && !t,
3645
- "sm:basis-full": e === 12 && t === "sm",
3646
- "md:basis-full": e === 12 && t === "md",
3647
- "lg:basis-full": e === 12 && t === "lg",
3648
- "xl:basis-full": e === 12 && t === "xl",
3649
- "2xl:basis-full": e === 12 && t === "2xl"
3650
- }), to = ({
3651
- className: e,
3652
- span: t
3653
- }) => {
3654
- if (!t)
3655
- return b(e, Se, "box-border basis-auto");
3656
- if (typeof t == "number")
3657
- return b(e, Se, "box-border max-w-full", {
3658
- [`${Xe(t)}`]: !0
3659
- });
3660
- if (typeof t == "string")
3661
- return b(e, Se, "box-border basis-auto", {
3662
- "max-w-full grow": t === "auto"
3663
- });
3664
- if (typeof t == "object") {
3665
- const r = Object.entries(t).map(([n, a]) => n === "fallback" ? Xe(a) : Xe(a, n));
3666
- return b(
3667
- e,
3668
- Se,
3669
- "box-border",
3670
- r
3671
- );
3672
- }
3673
- }, te = ({
3674
- children: e,
3675
- className: t,
3676
- span: r,
3677
- ...n
3678
- }) => {
3679
- const { columnGap: a, rowGap: o } = xt(hr), i = {
3680
- paddingLeft: a * Ce + "rem",
3681
- paddingTop: o * Ce + "rem"
3682
- }, s = to({
3683
- className: t,
3684
- span: r
3685
- });
3686
- return /* @__PURE__ */ u("div", { className: s, style: i, ...n, children: e });
3687
- };
3688
- /*!
3689
- @versini/ui-system v1.4.2
3690
- © 2024 gizmette.com
3691
- */
3692
- try {
3693
- window.__VERSINI_UI_SYSTEM__ || (window.__VERSINI_UI_SYSTEM__ = {
3694
- version: "1.4.2",
3695
- buildTime: "07/05/2024 05:27 PM EDT",
3696
- homepage: "https://github.com/aversini/ui-components",
3697
- license: "MIT"
3698
- });
3699
- } catch {
3700
- }
3701
- const ro = "ASK! ME! ANYTHING!", pr = "Sassy Saint", no = "gizmette.com", ao = "Log in", oo = "Sign in with a Passkey", mi = "Log out", io = "Password", so = "Powered by OpenAI", hi = "Send", pi = "Profile", fi = "Statistics", gi = "Chat history", yi = "About", bi = "Type your question here", wi = "Clear chat", vi = "Cancel chat", Ei = "N/A", Si = {
3702
- PREFERENCES: {
3703
- TITLE: "User preferences",
3704
- NAME: "Name",
3705
- EMAIL: "Email",
3706
- ENGINE_DETAILS: "Show message statistics",
3707
- LOCATION: "Current location",
3708
- MODEL_TYPE: "Use GPT model 4"
3709
- },
3710
- CURRENT_STATISTICS: {
3711
- TITLE: "Current chat statistics",
3712
- MODEL_NAME: "GPT model",
3713
- TOKENS_USED: "Tokens used",
3714
- REMAINING_TOKENS: "Remaining tokens",
3715
- PROCESSING_TIME: "Average response time"
3716
- },
3717
- MAIN_STATISTICS: {
3718
- TITLE: "Lifetime statistics",
3719
- TOTAL: "Total chat session",
3720
- PROCESSING_TIME: "Average response time"
3721
- },
3722
- HISTORY: {
3723
- TITLE: "Chat history"
3724
- },
3725
- ABOUT: {
3726
- TITLE_CLIENT: "Client details",
3727
- TITLE_SERVER: "Server details",
3728
- VERSION: "Version",
3729
- BUILD_TIMESTAMP: "Build date",
3730
- ENGINE: "OpenAI model",
3731
- PLUGIN: "Plugin"
3732
- }
3733
- }, co = ({
3734
- serverStats: e
3735
- }) => /* @__PURE__ */ u(
3736
- Na,
3737
- {
3738
- mode: "light",
3739
- row1: /* @__PURE__ */ S("div", { children: [
3740
- pr,
3741
- " v",
3742
- "3.4.1",
3743
- " - ",
3744
- so,
3745
- ot && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
3746
- ] }),
3747
- row2: /* @__PURE__ */ S("div", { children: [
3748
- "© ",
3749
- (/* @__PURE__ */ new Date()).getFullYear(),
3750
- " ",
3751
- no
3752
- ] })
3753
- }
3754
- ), lo = Pt(() => import("./LazyHeader.C2wdIAfr.js")), uo = () => {
3755
- const { isAuthenticated: e } = at();
3756
- return /* @__PURE__ */ S(me, { children: [
3757
- e && /* @__PURE__ */ u(Dt, { fallback: /* @__PURE__ */ u("div", {}), children: /* @__PURE__ */ u(lo, {}) }),
3758
- /* @__PURE__ */ S("div", { className: "flex items-center justify-center", children: [
3759
- /* @__PURE__ */ u("div", { className: "basis-1/4", children: /* @__PURE__ */ u(Ja, {}) }),
3760
- /* @__PURE__ */ S("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
3761
- /* @__PURE__ */ u("h1", { children: pr }),
3762
- /* @__PURE__ */ u("h2", { children: ro })
3763
- ] })
3764
- ] })
3765
- ] });
3766
- }, mo = () => {
3767
- const { login: e, logoutReason: t, loginWithPasskey: r } = at(), [n, a] = J(""), [o, i] = J(""), [s, l] = J(!0), [d, c] = J({
3768
- username: "",
3769
- password: ""
3770
- }), h = async (m) => {
3771
- m.preventDefault(), await e(
3772
- d.username,
3773
- d.password,
3774
- ne.CODE
3775
- ) || (i(""), a("Invalid username or password"));
3776
- };
3777
- return re(() => {
3778
- var m;
3779
- (m = document.getElementById("logo")) == null || m.classList.add("fadeOut"), setTimeout(() => {
3780
- var p;
3781
- (p = document.getElementById("root")) == null || p.classList.replace("app-hidden", "fadeIn");
3782
- }, 500);
3783
- }), re(() => {
3784
- t && i(t);
3785
- }, [t]), /* @__PURE__ */ S(me, { children: [
3786
- /* @__PURE__ */ S(Ca, { children: [
3787
- /* @__PURE__ */ u("div", { className: pa(), children: /* @__PURE__ */ u(uo, {}) }),
3788
- /* @__PURE__ */ S("form", { className: "mt-5", onSubmit: h, children: [
3789
- /* @__PURE__ */ u(Nt, { alignHorizontal: "center", rowGap: 7, children: /* @__PURE__ */ u(te, { span: 6, children: /* @__PURE__ */ S(Ra, { mode: "dark", children: [
3790
- /* @__PURE__ */ u(te, { span: 12, children: o && /* @__PURE__ */ u("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: o }) }),
3791
- /* @__PURE__ */ u(te, { span: 12, children: /* @__PURE__ */ u(
3792
- st,
3793
- {
3794
- required: !0,
3795
- autoCapitalize: "off",
3796
- autoComplete: "off",
3797
- autoCorrect: "off",
3798
- mode: "dark",
3799
- focusMode: "light",
3800
- name: "username",
3801
- label: "Username",
3802
- onChange: (m) => {
3803
- c({
3804
- ...d,
3805
- username: m.target.value
3806
- }), a("");
3807
- },
3808
- error: n !== ""
3809
- }
3810
- ) }),
3811
- /* @__PURE__ */ u(te, { span: 12, children: /* @__PURE__ */ u(
3812
- mr,
3813
- {
3814
- required: !0,
3815
- autoCapitalize: "off",
3816
- autoComplete: "off",
3817
- autoCorrect: "off",
3818
- mode: "dark",
3819
- focusMode: "light",
3820
- name: "password",
3821
- label: io,
3822
- rightElement: /* @__PURE__ */ u(et, { focusMode: "light", mode: "dark", children: s ? /* @__PURE__ */ u(Xa, {}) : /* @__PURE__ */ u(qa, {}) }),
3823
- onMaskChange: l,
3824
- onChange: (m) => {
3825
- c({
3826
- ...d,
3827
- password: m.target.value
3828
- }), a("");
3829
- },
3830
- error: n !== "",
3831
- helperText: n
3832
- }
3833
- ) }),
3834
- /* @__PURE__ */ u(te, { span: 12, children: /* @__PURE__ */ u(
3835
- sr,
3836
- {
3837
- mode: "light",
3838
- focusMode: "light",
3839
- fullWidth: !0,
3840
- noBorder: !0,
3841
- type: "submit",
3842
- className: "mb-4 mt-6",
3843
- children: ao
3844
- }
3845
- ) })
3846
- ] }) }) }),
3847
- /* @__PURE__ */ u("div", { className: "text-center text-copy-light", children: "or" }),
3848
- /* @__PURE__ */ u(Nt, { alignHorizontal: "center", children: /* @__PURE__ */ u(te, { span: 6, children: /* @__PURE__ */ u(
3849
- et,
3850
- {
3851
- mode: "dark",
3852
- focusMode: "light",
3853
- fullWidth: !0,
3854
- noBorder: !0,
3855
- className: "mb-4 mt-1",
3856
- labelRight: oo,
3857
- onClick: r,
3858
- children: /* @__PURE__ */ u(Qa, { className: "size-4" })
3859
- }
3860
- ) }) })
3861
- ] })
3862
- ] }),
3863
- /* @__PURE__ */ u(co, {})
3864
- ] });
3865
- }, ho = Pt(() => import("./App.CD16NP9z.js").then((e) => e.App)), po = ({ isComponent: e }) => {
3866
- const { isAuthenticated: t } = at();
3867
- return t ? /* @__PURE__ */ u(Dt, { fallback: /* @__PURE__ */ u("div", {}), children: /* @__PURE__ */ u(ho, { isComponent: e }) }) : /* @__PURE__ */ u(mo, {});
3868
- }, fo = ({
3869
- isComponent: e = !1,
3870
- domain: t = ha
3871
- }) => /* @__PURE__ */ u(me, { children: /* @__PURE__ */ u(ra, { clientId: na, domain: t, children: /* @__PURE__ */ u(po, { isComponent: e }) }) }), go = ({ domain: e }) => /* @__PURE__ */ u(fo, { isComponent: !0, domain: e });
3872
- go.displayName = "SassySaint-3.4.1";
3873
- export {
3874
- ir as A,
3875
- yi as ABOUT_TITLE,
3876
- Lo as ACTION_LOCATION,
3877
- Po as ACTION_MESSAGE,
3878
- Mo as ACTION_MODEL,
3879
- Do as ACTION_RESET,
3880
- $o as ACTION_RESTORE,
3881
- Ho as ACTION_SEARCH,
3882
- Bo as ACTION_SORT,
3883
- Uo as ACTION_STREAMING,
3884
- co as AppFooter,
3885
- vi as CANCEL,
3886
- Si as CARDS,
3887
- wi as CLEAR,
3888
- Co as ERROR_MESSAGE,
3889
- st as G,
3890
- Oo as GPT4_MAX_TOKENS,
3891
- gi as HISTORY_TITLE,
3892
- ne as J,
3893
- Go as LOCAL_STORAGE_CHAT_DETAILS,
3894
- Fo as LOCAL_STORAGE_LOCATION,
3895
- Ko as LOCAL_STORAGE_PREFIX,
3896
- Wo as LOCAL_STORAGE_SEARCH,
3897
- Vo as LOCAL_STORAGE_SORT,
3898
- mi as LOG_OUT,
3899
- Oa as M,
3900
- xo as MODEL_GPT4,
3901
- uo as MessagesContainerHeader,
3902
- ai as N,
3903
- Ra as N$1,
3904
- Ei as NA,
3905
- et as O,
3906
- pi as PROFILE_TITLE,
3907
- ko as ROLE_ASSISTANT,
3908
- No as ROLE_HIDDEN,
3909
- Ro as ROLE_INTERNAL,
3910
- _o as ROLE_SYSTEM,
3911
- Io as ROLE_USER,
3912
- Me as S,
3913
- hi as SEND,
3914
- fi as STATS,
3915
- jo as STATS_SEPARATOR,
3916
- go as SassySaint,
3917
- bi as TYPE_QUESTION,
3918
- dr as U,
3919
- at as _n,
3920
- li as a,
3921
- Nt as b,
3922
- Ca as c,
3923
- ii as c$1,
3924
- zo as convertLatitudeToDMS,
3925
- Jo as convertLongitudeToDMS,
3926
- ti as durationFormatter,
3927
- Xo as extractAverage,
3928
- ar as f,
3929
- xa as f$1,
3930
- Qa as f$2,
3931
- $e as g,
3932
- qo as getCurrentGeoLocation,
3933
- pa as getMessageContaintWrapperClass,
3934
- it as i,
3935
- oi as i$1,
3936
- Zo as isLastMessageFromRole,
3937
- te as j,
3938
- di as l,
3939
- si as n,
3940
- ei as numberFormatter,
3941
- La as o,
3942
- ui as p,
3943
- ri as pluralize,
3944
- ci as r,
3945
- Qo as renderDataAsList,
3946
- ni as s,
3947
- Yo as truncate,
3948
- sr as x
3949
- };