@versini/sassysaint 1.0.1 → 1.0.3

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,29 +1,29 @@
1
- import { jsx as c, jsxs as S, Fragment as q } from "react/jsx-runtime";
1
+ import { jsx as c, jsxs as T, Fragment as q } from "react/jsx-runtime";
2
2
  import * as F from "react";
3
- import K, { createContext as It, useRef as B, useState as U, useCallback as Me, useEffect as z, useContext as Xe, useMemo as xt, useId as Nt, useReducer as Ct, useLayoutEffect as Rt, lazy as Ze, Suspense as et } from "react";
3
+ import K, { createContext as xt, useRef as W, useState as U, useCallback as Me, useEffect as z, useContext as Ze, useMemo as Nt, useId as Ct, useReducer as Rt, useLayoutEffect as Ot, lazy as et, Suspense as tt } from "react";
4
4
  import g from "clsx";
5
- var Ot = Object.defineProperty, Dt = (e, t, r) => t in e ? Ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ye = (e, t, r) => (Dt(e, typeof t != "symbol" ? t + "" : t, r), r);
5
+ var Dt = Object.defineProperty, $t = (e, t, r) => t in e ? Dt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ye = (e, t, r) => ($t(e, typeof t != "symbol" ? t + "" : t, r), r);
6
6
  /*!
7
- @versini/auth-provider v5.0.6
7
+ @versini/auth-provider v5.1.1
8
8
  © 2024 gizmette.com
9
9
  */
10
10
  try {
11
11
  window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
12
- version: "5.0.6",
13
- buildTime: "07/06/2024 03:39 PM EDT",
12
+ version: "5.1.1",
13
+ buildTime: "07/07/2024 10:59 AM EDT",
14
14
  homepage: "https://github.com/aversini/auth-client",
15
15
  license: "MIT"
16
16
  });
17
17
  } catch {
18
18
  }
19
19
  /*!
20
- @versini/auth-common v2.10.1
20
+ @versini/auth-common v2.11.0
21
21
  © 2024 gizmette.com
22
22
  */
23
23
  try {
24
24
  window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
25
- version: "2.10.1",
26
- buildTime: "07/06/2024 03:39 PM EDT",
25
+ version: "2.11.0",
26
+ buildTime: "07/07/2024 10:59 AM EDT",
27
27
  homepage: "https://github.com/aversini/auth-client",
28
28
  license: "MIT"
29
29
  });
@@ -37,14 +37,14 @@ const Q = {
37
37
  REFRESH_TOKEN: "refresh_token"
38
38
  }, Mt = {
39
39
  CLIENT_ID: "X-Auth-ClientId"
40
- }, N = {
40
+ }, I = {
41
41
  ALG: "RS256",
42
42
  USER_ID_KEY: "sub",
43
43
  TOKEN_ID_KEY: "__raw",
44
44
  NONCE_KEY: "_nonce",
45
45
  USERNAME_KEY: "username",
46
46
  ISSUER: "gizmette.com"
47
- }, $t = `-----BEGIN PUBLIC KEY-----
47
+ }, Lt = `-----BEGIN PUBLIC KEY-----
48
48
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
49
49
  w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
50
50
  i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
@@ -52,33 +52,33 @@ aMwPFOIcJH+rKfFgNcHLcaS5syp7zU1ANwZ+trgR+DifBr8TLVkBynmNeTyhDm2+
52
52
  l0haqjMk0UoNPPE8iYBWUHQJJE1Dqstj65d6Eh5g64Pao25y4cmYJbKjiblIGEkE
53
53
  sjqybA9mARAqh9k/eiIopecWSiffNQTwVQVd2I9ZH3BalhEXHlqFgrjz51kFqg81
54
54
  awIDAQAB
55
- -----END PUBLIC KEY-----`, he = {
55
+ -----END PUBLIC KEY-----`, me = {
56
56
  AUTHENTICATE: "authenticate",
57
57
  CODE: "code",
58
58
  LOGOUT: "logout"
59
- }, pe = crypto, tt = (e) => e instanceof CryptoKey, Z = new TextEncoder(), ge = new TextDecoder();
60
- function Lt(...e) {
59
+ }, he = crypto, rt = (e) => e instanceof CryptoKey, X = new TextEncoder(), pe = new TextDecoder();
60
+ function Pt(...e) {
61
61
  const t = e.reduce((n, { length: o }) => n + o, 0), r = new Uint8Array(t);
62
62
  let a = 0;
63
63
  for (const n of e)
64
64
  r.set(n, a), a += n.length;
65
65
  return r;
66
66
  }
67
- const Pt = (e) => {
67
+ const Ut = (e) => {
68
68
  const t = atob(e), r = new Uint8Array(t.length);
69
69
  for (let a = 0; a < t.length; a++)
70
70
  r[a] = t.charCodeAt(a);
71
71
  return r;
72
- }, le = (e) => {
72
+ }, ce = (e) => {
73
73
  let t = e;
74
- t instanceof Uint8Array && (t = ge.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
74
+ t instanceof Uint8Array && (t = pe.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
75
75
  try {
76
- return Pt(t);
76
+ return Ut(t);
77
77
  } catch {
78
78
  throw new TypeError("The input to be decoded is not correctly encoded.");
79
79
  }
80
80
  };
81
- let W = class extends Error {
81
+ let j = class extends Error {
82
82
  static get code() {
83
83
  return "ERR_JOSE_GENERIC";
84
84
  }
@@ -86,7 +86,7 @@ let W = class extends Error {
86
86
  var r;
87
87
  super(t), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
88
88
  }
89
- }, $ = class extends W {
89
+ }, M = class extends j {
90
90
  static get code() {
91
91
  return "ERR_JWT_CLAIM_VALIDATION_FAILED";
92
92
  }
@@ -94,7 +94,7 @@ let W = class extends Error {
94
94
  super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = a, this.reason = n, this.payload = r;
95
95
  }
96
96
  };
97
- class $e extends W {
97
+ class Le extends j {
98
98
  static get code() {
99
99
  return "ERR_JWT_EXPIRED";
100
100
  }
@@ -102,7 +102,7 @@ class $e extends W {
102
102
  super(t), this.code = "ERR_JWT_EXPIRED", this.claim = a, this.reason = n, this.payload = r;
103
103
  }
104
104
  }
105
- class Ut extends W {
105
+ class Ht extends j {
106
106
  constructor() {
107
107
  super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
108
108
  }
@@ -110,14 +110,14 @@ class Ut extends W {
110
110
  return "ERR_JOSE_ALG_NOT_ALLOWED";
111
111
  }
112
112
  }
113
- let H = class extends W {
113
+ let H = class extends j {
114
114
  constructor() {
115
115
  super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
116
116
  }
117
117
  static get code() {
118
118
  return "ERR_JOSE_NOT_SUPPORTED";
119
119
  }
120
- }, k = class extends W {
120
+ }, k = class extends j {
121
121
  constructor() {
122
122
  super(...arguments), this.code = "ERR_JWS_INVALID";
123
123
  }
@@ -125,7 +125,7 @@ let H = class extends W {
125
125
  return "ERR_JWS_INVALID";
126
126
  }
127
127
  };
128
- class rt extends W {
128
+ class at extends j {
129
129
  constructor() {
130
130
  super(...arguments), this.code = "ERR_JWT_INVALID";
131
131
  }
@@ -133,7 +133,7 @@ class rt extends W {
133
133
  return "ERR_JWT_INVALID";
134
134
  }
135
135
  }
136
- class Ht extends W {
136
+ class Kt extends j {
137
137
  constructor() {
138
138
  super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
139
139
  }
@@ -144,13 +144,13 @@ class Ht extends W {
144
144
  function L(e, t = "algorithm.name") {
145
145
  return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
146
146
  }
147
- function ee(e, t) {
147
+ function Z(e, t) {
148
148
  return e.name === t;
149
149
  }
150
150
  function be(e) {
151
151
  return parseInt(e.name.slice(4), 10);
152
152
  }
153
- function Kt(e) {
153
+ function Bt(e) {
154
154
  switch (e) {
155
155
  case "ES256":
156
156
  return "P-256";
@@ -162,7 +162,7 @@ function Kt(e) {
162
162
  throw new Error("unreachable");
163
163
  }
164
164
  }
165
- function Bt(e, t) {
165
+ function Wt(e, t) {
166
166
  if (t.length && !t.some((r) => e.usages.includes(r))) {
167
167
  let r = "CryptoKey does not support this operation, its usages must include ";
168
168
  if (t.length > 2) {
@@ -173,12 +173,12 @@ function Bt(e, t) {
173
173
  throw new TypeError(r);
174
174
  }
175
175
  }
176
- function Wt(e, t, ...r) {
176
+ function jt(e, t, ...r) {
177
177
  switch (t) {
178
178
  case "HS256":
179
179
  case "HS384":
180
180
  case "HS512": {
181
- if (!ee(e.algorithm, "HMAC"))
181
+ if (!Z(e.algorithm, "HMAC"))
182
182
  throw L("HMAC");
183
183
  const a = parseInt(t.slice(2), 10);
184
184
  if (be(e.algorithm.hash) !== a)
@@ -188,7 +188,7 @@ function Wt(e, t, ...r) {
188
188
  case "RS256":
189
189
  case "RS384":
190
190
  case "RS512": {
191
- if (!ee(e.algorithm, "RSASSA-PKCS1-v1_5"))
191
+ if (!Z(e.algorithm, "RSASSA-PKCS1-v1_5"))
192
192
  throw L("RSASSA-PKCS1-v1_5");
193
193
  const a = parseInt(t.slice(2), 10);
194
194
  if (be(e.algorithm.hash) !== a)
@@ -198,7 +198,7 @@ function Wt(e, t, ...r) {
198
198
  case "PS256":
199
199
  case "PS384":
200
200
  case "PS512": {
201
- if (!ee(e.algorithm, "RSA-PSS"))
201
+ if (!Z(e.algorithm, "RSA-PSS"))
202
202
  throw L("RSA-PSS");
203
203
  const a = parseInt(t.slice(2), 10);
204
204
  if (be(e.algorithm.hash) !== a)
@@ -213,9 +213,9 @@ function Wt(e, t, ...r) {
213
213
  case "ES256":
214
214
  case "ES384":
215
215
  case "ES512": {
216
- if (!ee(e.algorithm, "ECDSA"))
216
+ if (!Z(e.algorithm, "ECDSA"))
217
217
  throw L("ECDSA");
218
- const a = Kt(t);
218
+ const a = Bt(t);
219
219
  if (e.algorithm.namedCurve !== a)
220
220
  throw L(a, "algorithm.namedCurve");
221
221
  break;
@@ -223,9 +223,9 @@ function Wt(e, t, ...r) {
223
223
  default:
224
224
  throw new TypeError("CryptoKey does not support this operation");
225
225
  }
226
- Bt(e, r);
226
+ Wt(e, r);
227
227
  }
228
- function at(e, t, ...r) {
228
+ function nt(e, t, ...r) {
229
229
  var a;
230
230
  if (r.length > 2) {
231
231
  const n = r.pop();
@@ -234,11 +234,11 @@ function at(e, t, ...r) {
234
234
  r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
235
235
  return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && (a = t.constructor) != null && a.name && (e += ` Received an instance of ${t.constructor.name}`), e;
236
236
  }
237
- const Le = (e, ...t) => at("Key must be ", e, ...t);
238
- function nt(e, t, ...r) {
239
- return at(`Key for the ${e} algorithm must be `, t, ...r);
237
+ const Pe = (e, ...t) => nt("Key must be ", e, ...t);
238
+ function ot(e, t, ...r) {
239
+ return nt(`Key for the ${e} algorithm must be `, t, ...r);
240
240
  }
241
- const ot = (e) => tt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", ue = ["CryptoKey"], jt = (...e) => {
241
+ const st = (e) => rt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", de = ["CryptoKey"], Gt = (...e) => {
242
242
  const t = e.filter(Boolean);
243
243
  if (t.length === 0 || t.length === 1)
244
244
  return !0;
@@ -257,11 +257,11 @@ const ot = (e) => tt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) ===
257
257
  }
258
258
  return !0;
259
259
  };
260
- function Gt(e) {
260
+ function Vt(e) {
261
261
  return typeof e == "object" && e !== null;
262
262
  }
263
263
  function _e(e) {
264
- if (!Gt(e) || Object.prototype.toString.call(e) !== "[object Object]")
264
+ if (!Vt(e) || Object.prototype.toString.call(e) !== "[object Object]")
265
265
  return !1;
266
266
  if (Object.getPrototypeOf(e) === null)
267
267
  return !0;
@@ -270,14 +270,14 @@ function _e(e) {
270
270
  t = Object.getPrototypeOf(t);
271
271
  return Object.getPrototypeOf(e) === t;
272
272
  }
273
- const Vt = (e, t) => {
273
+ const Jt = (e, t) => {
274
274
  if (e.startsWith("RS") || e.startsWith("PS")) {
275
275
  const { modulusLength: r } = t.algorithm;
276
276
  if (typeof r != "number" || r < 2048)
277
277
  throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
278
278
  }
279
279
  };
280
- function Jt(e) {
280
+ function Ft(e) {
281
281
  let t, r;
282
282
  switch (e.kty) {
283
283
  case "RSA": {
@@ -349,43 +349,43 @@ function Jt(e) {
349
349
  }
350
350
  return { algorithm: t, keyUsages: r };
351
351
  }
352
- const Ft = async (e) => {
352
+ const zt = async (e) => {
353
353
  if (!e.alg)
354
354
  throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
355
- const { algorithm: t, keyUsages: r } = Jt(e), a = [
355
+ const { algorithm: t, keyUsages: r } = Ft(e), a = [
356
356
  t,
357
357
  e.ext ?? !1,
358
358
  e.key_ops ?? r
359
359
  ], n = { ...e };
360
- return delete n.alg, delete n.use, pe.subtle.importKey("jwk", n, ...a);
361
- }, st = (e) => le(e);
360
+ return delete n.alg, delete n.use, he.subtle.importKey("jwk", n, ...a);
361
+ }, it = (e) => ce(e);
362
362
  let we, Ee;
363
- const it = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", ct = async (e, t, r, a) => {
363
+ const ct = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", lt = async (e, t, r, a) => {
364
364
  let n = e.get(t);
365
365
  if (n != null && n[a])
366
366
  return n[a];
367
- const o = await Ft({ ...r, alg: a });
367
+ const o = await zt({ ...r, alg: a });
368
368
  return n ? n[a] = o : e.set(t, { [a]: o }), o;
369
- }, zt = (e, t) => {
370
- if (it(e)) {
369
+ }, Yt = (e, t) => {
370
+ if (ct(e)) {
371
371
  let r = e.export({ format: "jwk" });
372
- return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? st(r.k) : (Ee || (Ee = /* @__PURE__ */ new WeakMap()), ct(Ee, e, r, t));
372
+ return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? it(r.k) : (Ee || (Ee = /* @__PURE__ */ new WeakMap()), lt(Ee, e, r, t));
373
373
  }
374
374
  return e;
375
- }, Yt = (e, t) => {
376
- if (it(e)) {
375
+ }, qt = (e, t) => {
376
+ if (ct(e)) {
377
377
  let r = e.export({ format: "jwk" });
378
- return r.k ? st(r.k) : (we || (we = /* @__PURE__ */ new WeakMap()), ct(we, e, r, t));
378
+ return r.k ? it(r.k) : (we || (we = /* @__PURE__ */ new WeakMap()), lt(we, e, r, t));
379
379
  }
380
380
  return e;
381
- }, qt = { normalizePublicKey: zt, normalizePrivateKey: Yt }, P = (e, t, r = 0) => {
381
+ }, Qt = { normalizePublicKey: Yt, normalizePrivateKey: qt }, P = (e, t, r = 0) => {
382
382
  r === 0 && (t.unshift(t.length), t.unshift(6));
383
383
  const a = e.indexOf(t[0], r);
384
384
  if (a === -1)
385
385
  return !1;
386
386
  const n = e.subarray(a, a + t.length);
387
387
  return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) || P(e, t, a + 1);
388
- }, Pe = (e) => {
388
+ }, Ue = (e) => {
389
389
  switch (!0) {
390
390
  case P(e, [42, 134, 72, 206, 61, 3, 1, 7]):
391
391
  return "P-256";
@@ -404,7 +404,7 @@ const it = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
404
404
  default:
405
405
  throw new H("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
406
406
  }
407
- }, Qt = async (e, t, r, a, n) => {
407
+ }, Xt = async (e, t, r, a, n) => {
408
408
  let o, s;
409
409
  const i = new Uint8Array(atob(r.replace(e, "")).split("").map((l) => l.charCodeAt(0)));
410
410
  switch (a) {
@@ -440,43 +440,43 @@ const it = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
440
440
  case "ECDH-ES+A128KW":
441
441
  case "ECDH-ES+A192KW":
442
442
  case "ECDH-ES+A256KW": {
443
- const l = Pe(i);
443
+ const l = Ue(i);
444
444
  o = l.startsWith("P-") ? { name: "ECDH", namedCurve: l } : { name: l }, s = [];
445
445
  break;
446
446
  }
447
447
  case "EdDSA":
448
- o = { name: Pe(i) }, s = ["verify"];
448
+ o = { name: Ue(i) }, s = ["verify"];
449
449
  break;
450
450
  default:
451
451
  throw new H('Invalid or unsupported "alg" (Algorithm) value');
452
452
  }
453
- return pe.subtle.importKey(t, i, o, !1, s);
454
- }, Xt = (e, t, r) => Qt(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
455
- async function Zt(e, t, r) {
453
+ return he.subtle.importKey(t, i, o, !1, s);
454
+ }, Zt = (e, t, r) => Xt(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
455
+ async function er(e, t, r) {
456
456
  if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
457
457
  throw new TypeError('"spki" must be SPKI formatted string');
458
- return Xt(e, t);
458
+ return Zt(e, t);
459
459
  }
460
- const de = (e) => e == null ? void 0 : e[Symbol.toStringTag], er = (e, t) => {
460
+ const le = (e) => e == null ? void 0 : e[Symbol.toStringTag], tr = (e, t) => {
461
461
  if (!(t instanceof Uint8Array)) {
462
- if (!ot(t))
463
- throw new TypeError(nt(e, t, ...ue, "Uint8Array"));
462
+ if (!st(t))
463
+ throw new TypeError(ot(e, t, ...de, "Uint8Array"));
464
464
  if (t.type !== "secret")
465
- throw new TypeError(`${de(t)} instances for symmetric algorithms must be of type "secret"`);
465
+ throw new TypeError(`${le(t)} instances for symmetric algorithms must be of type "secret"`);
466
466
  }
467
- }, tr = (e, t, r) => {
468
- if (!ot(t))
469
- throw new TypeError(nt(e, t, ...ue));
467
+ }, rr = (e, t, r) => {
468
+ if (!st(t))
469
+ throw new TypeError(ot(e, t, ...de));
470
470
  if (t.type === "secret")
471
- throw new TypeError(`${de(t)} instances for asymmetric algorithms must not be of type "secret"`);
471
+ throw new TypeError(`${le(t)} instances for asymmetric algorithms must not be of type "secret"`);
472
472
  if (t.algorithm && r === "verify" && t.type === "private")
473
- throw new TypeError(`${de(t)} instances for asymmetric algorithm verifying must be of type "public"`);
473
+ throw new TypeError(`${le(t)} instances for asymmetric algorithm verifying must be of type "public"`);
474
474
  if (t.algorithm && r === "encrypt" && t.type === "private")
475
- throw new TypeError(`${de(t)} instances for asymmetric algorithm encryption must be of type "public"`);
476
- }, rr = (e, t, r) => {
477
- e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? er(e, t) : tr(e, t, r);
475
+ throw new TypeError(`${le(t)} instances for asymmetric algorithm encryption must be of type "public"`);
476
+ }, ar = (e, t, r) => {
477
+ e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? tr(e, t) : rr(e, t, r);
478
478
  };
479
- function ar(e, t, r, a, n) {
479
+ function nr(e, t, r, a, n) {
480
480
  if (n.crit !== void 0 && (a == null ? void 0 : a.crit) === void 0)
481
481
  throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
482
482
  if (!a || a.crit === void 0)
@@ -495,13 +495,13 @@ function ar(e, t, r, a, n) {
495
495
  }
496
496
  return new Set(a.crit);
497
497
  }
498
- const nr = (e, t) => {
498
+ const or = (e, t) => {
499
499
  if (t !== void 0 && (!Array.isArray(t) || t.some((r) => typeof r != "string")))
500
500
  throw new TypeError(`"${e}" option must be an array of strings`);
501
501
  if (t)
502
502
  return new Set(t);
503
503
  };
504
- function or(e, t) {
504
+ function sr(e, t) {
505
505
  const r = `SHA-${e.slice(-3)}`;
506
506
  switch (e) {
507
507
  case "HS256":
@@ -526,27 +526,27 @@ function or(e, t) {
526
526
  throw new H(`alg ${e} is not supported either by JOSE or your javascript runtime`);
527
527
  }
528
528
  }
529
- async function sr(e, t, r) {
530
- if (t = await qt.normalizePublicKey(t, e), tt(t))
531
- return Wt(t, e, r), t;
529
+ async function ir(e, t, r) {
530
+ if (t = await Qt.normalizePublicKey(t, e), rt(t))
531
+ return jt(t, e, r), t;
532
532
  if (t instanceof Uint8Array) {
533
533
  if (!e.startsWith("HS"))
534
- throw new TypeError(Le(t, ...ue));
535
- return pe.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
534
+ throw new TypeError(Pe(t, ...de));
535
+ return he.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
536
536
  }
537
- throw new TypeError(Le(t, ...ue, "Uint8Array"));
537
+ throw new TypeError(Pe(t, ...de, "Uint8Array"));
538
538
  }
539
- const ir = async (e, t, r, a) => {
540
- const n = await sr(e, t, "verify");
541
- Vt(e, n);
542
- const o = or(e, n.algorithm);
539
+ const cr = async (e, t, r, a) => {
540
+ const n = await ir(e, t, "verify");
541
+ Jt(e, n);
542
+ const o = sr(e, n.algorithm);
543
543
  try {
544
- return await pe.subtle.verify(o, n, r, a);
544
+ return await he.subtle.verify(o, n, r, a);
545
545
  } catch {
546
546
  return !1;
547
547
  }
548
548
  };
549
- async function cr(e, t, r) {
549
+ async function lr(e, t, r) {
550
550
  if (!_e(e))
551
551
  throw new k("Flattened JWS must be an object");
552
552
  if (e.protected === void 0 && e.header === void 0)
@@ -562,65 +562,65 @@ async function cr(e, t, r) {
562
562
  let a = {};
563
563
  if (e.protected)
564
564
  try {
565
- const f = le(e.protected);
566
- a = JSON.parse(ge.decode(f));
565
+ const f = ce(e.protected);
566
+ a = JSON.parse(pe.decode(f));
567
567
  } catch {
568
568
  throw new k("JWS Protected Header is invalid");
569
569
  }
570
- if (!jt(a, e.header))
570
+ if (!Gt(a, e.header))
571
571
  throw new k("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
572
572
  const n = {
573
573
  ...a,
574
574
  ...e.header
575
- }, o = ar(k, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
575
+ }, o = nr(k, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
576
576
  let s = !0;
577
577
  if (o.has("b64") && (s = a.b64, typeof s != "boolean"))
578
578
  throw new k('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
579
579
  const { alg: i } = n;
580
580
  if (typeof i != "string" || !i)
581
581
  throw new k('JWS "alg" (Algorithm) Header Parameter missing or invalid');
582
- const l = r && nr("algorithms", r.algorithms);
582
+ const l = r && or("algorithms", r.algorithms);
583
583
  if (l && !l.has(i))
584
- throw new Ut('"alg" (Algorithm) Header Parameter value not allowed');
584
+ throw new Ht('"alg" (Algorithm) Header Parameter value not allowed');
585
585
  if (s) {
586
586
  if (typeof e.payload != "string")
587
587
  throw new k("JWS Payload must be a string");
588
588
  } else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
589
589
  throw new k("JWS Payload must be a string or an Uint8Array instance");
590
590
  let d = !1;
591
- typeof t == "function" && (t = await t(a, e), d = !0), rr(i, t, "verify");
592
- const p = Lt(Z.encode(e.protected ?? ""), Z.encode("."), typeof e.payload == "string" ? Z.encode(e.payload) : e.payload);
591
+ typeof t == "function" && (t = await t(a, e), d = !0), ar(i, t, "verify");
592
+ const h = Pt(X.encode(e.protected ?? ""), X.encode("."), typeof e.payload == "string" ? X.encode(e.payload) : e.payload);
593
593
  let u;
594
594
  try {
595
- u = le(e.signature);
595
+ u = ce(e.signature);
596
596
  } catch {
597
597
  throw new k("Failed to base64url decode the signature");
598
598
  }
599
- if (!await ir(i, t, u, p))
600
- throw new Ht();
599
+ if (!await cr(i, t, u, h))
600
+ throw new Kt();
601
601
  let m;
602
602
  if (s)
603
603
  try {
604
- m = le(e.payload);
604
+ m = ce(e.payload);
605
605
  } catch {
606
606
  throw new k("Failed to base64url decode the payload");
607
607
  }
608
608
  else
609
- typeof e.payload == "string" ? m = Z.encode(e.payload) : m = e.payload;
610
- const h = { payload: m };
611
- return e.protected !== void 0 && (h.protectedHeader = a), e.header !== void 0 && (h.unprotectedHeader = e.header), d ? { ...h, key: t } : h;
609
+ typeof e.payload == "string" ? m = X.encode(e.payload) : m = e.payload;
610
+ const p = { payload: m };
611
+ return e.protected !== void 0 && (p.protectedHeader = a), e.header !== void 0 && (p.unprotectedHeader = e.header), d ? { ...p, key: t } : p;
612
612
  }
613
- async function lr(e, t, r) {
614
- if (e instanceof Uint8Array && (e = ge.decode(e)), typeof e != "string")
613
+ async function dr(e, t, r) {
614
+ if (e instanceof Uint8Array && (e = pe.decode(e)), typeof e != "string")
615
615
  throw new k("Compact JWS must be a string or Uint8Array");
616
616
  const { 0: a, 1: n, 2: o, length: s } = e.split(".");
617
617
  if (s !== 3)
618
618
  throw new k("Invalid Compact JWS");
619
- const i = await cr({ payload: n, protected: a, signature: o }, t, r), l = { payload: i.payload, protectedHeader: i.protectedHeader };
619
+ const i = await lr({ payload: n, protected: a, signature: o }, t, r), l = { payload: i.payload, protectedHeader: i.protectedHeader };
620
620
  return typeof t == "function" ? { ...l, key: i.key } : l;
621
621
  }
622
- const dr = (e) => Math.floor(e.getTime() / 1e3), lt = 60, dt = lt * 60, Ie = dt * 24, ur = Ie * 7, mr = Ie * 365.25, hr = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, Ue = (e) => {
623
- const t = hr.exec(e);
622
+ const ur = (e) => Math.floor(e.getTime() / 1e3), dt = 60, ut = dt * 60, Ie = ut * 24, mr = Ie * 7, hr = Ie * 365.25, pr = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, He = (e) => {
623
+ const t = pr.exec(e);
624
624
  if (!t || t[4] && t[1])
625
625
  throw new TypeError("Invalid time period format");
626
626
  const r = parseFloat(t[2]), a = t[3].toLowerCase();
@@ -638,14 +638,14 @@ const dr = (e) => Math.floor(e.getTime() / 1e3), lt = 60, dt = lt * 60, Ie = dt
638
638
  case "min":
639
639
  case "mins":
640
640
  case "m":
641
- n = Math.round(r * lt);
641
+ n = Math.round(r * dt);
642
642
  break;
643
643
  case "hour":
644
644
  case "hours":
645
645
  case "hr":
646
646
  case "hrs":
647
647
  case "h":
648
- n = Math.round(r * dt);
648
+ n = Math.round(r * ut);
649
649
  break;
650
650
  case "day":
651
651
  case "days":
@@ -655,39 +655,39 @@ const dr = (e) => Math.floor(e.getTime() / 1e3), lt = 60, dt = lt * 60, Ie = dt
655
655
  case "week":
656
656
  case "weeks":
657
657
  case "w":
658
- n = Math.round(r * ur);
658
+ n = Math.round(r * mr);
659
659
  break;
660
660
  default:
661
- n = Math.round(r * mr);
661
+ n = Math.round(r * hr);
662
662
  break;
663
663
  }
664
664
  return t[1] === "-" || t[4] === "ago" ? -n : n;
665
- }, He = (e) => e.toLowerCase().replace(/^application\//, ""), pr = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, gr = (e, t, r = {}) => {
665
+ }, Ke = (e) => e.toLowerCase().replace(/^application\//, ""), gr = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, fr = (e, t, r = {}) => {
666
666
  let a;
667
667
  try {
668
- a = JSON.parse(ge.decode(t));
668
+ a = JSON.parse(pe.decode(t));
669
669
  } catch {
670
670
  }
671
671
  if (!_e(a))
672
- throw new rt("JWT Claims Set must be a top-level JSON object");
672
+ throw new at("JWT Claims Set must be a top-level JSON object");
673
673
  const { typ: n } = r;
674
- if (n && (typeof e.typ != "string" || He(e.typ) !== He(n)))
675
- throw new $('unexpected "typ" JWT header value', a, "typ", "check_failed");
676
- const { requiredClaims: o = [], issuer: s, subject: i, audience: l, maxTokenAge: d } = r, p = [...o];
677
- d !== void 0 && p.push("iat"), l !== void 0 && p.push("aud"), i !== void 0 && p.push("sub"), s !== void 0 && p.push("iss");
678
- for (const f of new Set(p.reverse()))
674
+ if (n && (typeof e.typ != "string" || Ke(e.typ) !== Ke(n)))
675
+ throw new M('unexpected "typ" JWT header value', a, "typ", "check_failed");
676
+ const { requiredClaims: o = [], issuer: s, subject: i, audience: l, maxTokenAge: d } = r, h = [...o];
677
+ d !== void 0 && h.push("iat"), l !== void 0 && h.push("aud"), i !== void 0 && h.push("sub"), s !== void 0 && h.push("iss");
678
+ for (const f of new Set(h.reverse()))
679
679
  if (!(f in a))
680
- throw new $(`missing required "${f}" claim`, a, f, "missing");
680
+ throw new M(`missing required "${f}" claim`, a, f, "missing");
681
681
  if (s && !(Array.isArray(s) ? s : [s]).includes(a.iss))
682
- throw new $('unexpected "iss" claim value', a, "iss", "check_failed");
682
+ throw new M('unexpected "iss" claim value', a, "iss", "check_failed");
683
683
  if (i && a.sub !== i)
684
- throw new $('unexpected "sub" claim value', a, "sub", "check_failed");
685
- if (l && !pr(a.aud, typeof l == "string" ? [l] : l))
686
- throw new $('unexpected "aud" claim value', a, "aud", "check_failed");
684
+ throw new M('unexpected "sub" claim value', a, "sub", "check_failed");
685
+ if (l && !gr(a.aud, typeof l == "string" ? [l] : l))
686
+ throw new M('unexpected "aud" claim value', a, "aud", "check_failed");
687
687
  let u;
688
688
  switch (typeof r.clockTolerance) {
689
689
  case "string":
690
- u = Ue(r.clockTolerance);
690
+ u = He(r.clockTolerance);
691
691
  break;
692
692
  case "number":
693
693
  u = r.clockTolerance;
@@ -698,43 +698,43 @@ const dr = (e) => Math.floor(e.getTime() / 1e3), lt = 60, dt = lt * 60, Ie = dt
698
698
  default:
699
699
  throw new TypeError("Invalid clockTolerance option type");
700
700
  }
701
- const { currentDate: m } = r, h = dr(m || /* @__PURE__ */ new Date());
701
+ const { currentDate: m } = r, p = ur(m || /* @__PURE__ */ new Date());
702
702
  if ((a.iat !== void 0 || d) && typeof a.iat != "number")
703
- throw new $('"iat" claim must be a number', a, "iat", "invalid");
703
+ throw new M('"iat" claim must be a number', a, "iat", "invalid");
704
704
  if (a.nbf !== void 0) {
705
705
  if (typeof a.nbf != "number")
706
- throw new $('"nbf" claim must be a number', a, "nbf", "invalid");
707
- if (a.nbf > h + u)
708
- throw new $('"nbf" claim timestamp check failed', a, "nbf", "check_failed");
706
+ throw new M('"nbf" claim must be a number', a, "nbf", "invalid");
707
+ if (a.nbf > p + u)
708
+ throw new M('"nbf" claim timestamp check failed', a, "nbf", "check_failed");
709
709
  }
710
710
  if (a.exp !== void 0) {
711
711
  if (typeof a.exp != "number")
712
- throw new $('"exp" claim must be a number', a, "exp", "invalid");
713
- if (a.exp <= h - u)
714
- throw new $e('"exp" claim timestamp check failed', a, "exp", "check_failed");
712
+ throw new M('"exp" claim must be a number', a, "exp", "invalid");
713
+ if (a.exp <= p - u)
714
+ throw new Le('"exp" claim timestamp check failed', a, "exp", "check_failed");
715
715
  }
716
716
  if (d) {
717
- const f = h - a.iat, b = typeof d == "number" ? d : Ue(d);
718
- if (f - u > b)
719
- throw new $e('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
717
+ const f = p - a.iat, w = typeof d == "number" ? d : He(d);
718
+ if (f - u > w)
719
+ throw new Le('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
720
720
  if (f < 0 - u)
721
- throw new $('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
721
+ throw new M('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
722
722
  }
723
723
  return a;
724
724
  };
725
- async function fr(e, t, r) {
725
+ async function yr(e, t, r) {
726
726
  var a;
727
- const n = await lr(e, t, r);
727
+ const n = await dr(e, t, r);
728
728
  if ((a = n.protectedHeader.crit) != null && a.includes("b64") && n.protectedHeader.b64 === !1)
729
- throw new rt("JWTs MUST NOT use unencoded payload");
730
- const o = { payload: gr(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
729
+ throw new at("JWTs MUST NOT use unencoded payload");
730
+ const o = { payload: fr(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
731
731
  return typeof t == "function" ? { ...o, key: n.key } : o;
732
732
  }
733
733
  const Y = async (e) => {
734
734
  try {
735
- const t = N.ALG, r = await Zt($t, t);
736
- return await fr(e, r, {
737
- issuer: N.ISSUER
735
+ const t = I.ALG, r = await er(Lt, t);
736
+ return await yr(e, r, {
737
+ issuer: I.ISSUER
738
738
  });
739
739
  } catch {
740
740
  return;
@@ -743,67 +743,67 @@ const Y = async (e) => {
743
743
  var E = [];
744
744
  for (var ve = 0; ve < 256; ++ve)
745
745
  E.push((ve + 256).toString(16).slice(1));
746
- function yr(e, t = 0) {
746
+ function br(e, t = 0) {
747
747
  return (E[e[t + 0]] + E[e[t + 1]] + E[e[t + 2]] + E[e[t + 3]] + "-" + E[e[t + 4]] + E[e[t + 5]] + "-" + E[e[t + 6]] + E[e[t + 7]] + "-" + E[e[t + 8]] + E[e[t + 9]] + "-" + E[e[t + 10]] + E[e[t + 11]] + E[e[t + 12]] + E[e[t + 13]] + E[e[t + 14]] + E[e[t + 15]]).toLowerCase();
748
748
  }
749
- var te, br = new Uint8Array(16);
750
- function wr() {
751
- if (!te && (te = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !te))
749
+ var ee, wr = new Uint8Array(16);
750
+ function Er() {
751
+ if (!ee && (ee = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ee))
752
752
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
753
- return te(br);
753
+ return ee(wr);
754
754
  }
755
- var Er = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
756
- const Ke = {
757
- randomUUID: Er
755
+ var vr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
756
+ const Be = {
757
+ randomUUID: vr
758
758
  };
759
- function Be(e, t, r) {
760
- if (Ke.randomUUID && !t && !e)
761
- return Ke.randomUUID();
759
+ function We(e, t, r) {
760
+ if (Be.randomUUID && !t && !e)
761
+ return Be.randomUUID();
762
762
  e = e || {};
763
- var a = e.random || (e.rng || wr)();
764
- return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, yr(a);
763
+ var a = e.random || (e.rng || Er)();
764
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, br(a);
765
765
  }
766
- const We = globalThis.crypto, vr = (e) => `${Be()}${Be()}`.slice(0, e), kr = (e) => btoa(
766
+ const je = globalThis.crypto, kr = (e) => `${We()}${We()}`.slice(0, e), Sr = (e) => btoa(
767
767
  [...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
768
768
  );
769
- async function Sr(e) {
770
- if (!We.subtle)
769
+ async function Tr(e) {
770
+ if (!je.subtle)
771
771
  throw new Error(
772
772
  "crypto.subtle is available only in secure contexts (HTTPS)."
773
773
  );
774
- const t = new TextEncoder().encode(e), r = await We.subtle.digest("SHA-256", t);
775
- return kr(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
774
+ const t = new TextEncoder().encode(e), r = await je.subtle.digest("SHA-256", t);
775
+ return Sr(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
776
776
  }
777
- async function Tr(e) {
778
- const t = vr(43), r = await Sr(t);
777
+ async function Ar(e) {
778
+ const t = kr(43), r = await Tr(t);
779
779
  return {
780
780
  code_verifier: t,
781
781
  code_challenge: r
782
782
  };
783
783
  }
784
- function ut(e, t) {
784
+ function mt(e, t) {
785
785
  window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
786
786
  }
787
- const je = (e, t) => {
787
+ const Ge = (e, t) => {
788
788
  const r = JSON.stringify(
789
789
  typeof t == "function" ? t() : t
790
790
  );
791
- window.localStorage.setItem(e, r), ut(e, r);
792
- }, Ar = (e) => {
793
- window.localStorage.removeItem(e), ut(e, null);
794
- }, Ge = (e) => window.localStorage.getItem(e), _r = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
795
- function re({
791
+ window.localStorage.setItem(e, r), mt(e, r);
792
+ }, _r = (e) => {
793
+ window.localStorage.removeItem(e), mt(e, null);
794
+ }, Ve = (e) => window.localStorage.getItem(e), Ir = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
795
+ function te({
796
796
  key: e,
797
797
  initialValue: t
798
798
  }) {
799
- const r = () => Ge(e), a = F.useSyncExternalStore(
800
- _r,
799
+ const r = () => Ve(e), a = F.useSyncExternalStore(
800
+ Ir,
801
801
  r
802
802
  ), n = F.useCallback(
803
803
  (i) => {
804
804
  try {
805
805
  const l = typeof i == "function" ? i(JSON.parse(a)) : i;
806
- l == null ? Ar(e) : je(e, l);
806
+ l == null ? _r(e) : Ge(e, l);
807
807
  } catch (l) {
808
808
  console.warn(l);
809
809
  }
@@ -816,7 +816,7 @@ function re({
816
816
  }, [n]);
817
817
  return F.useEffect(() => {
818
818
  try {
819
- Ge(e) === null && typeof t < "u" && je(e, t);
819
+ Ve(e) === null && typeof t < "u" && Ge(e, t);
820
820
  } catch (i) {
821
821
  console.warn(i);
822
822
  }
@@ -825,37 +825,37 @@ function re({
825
825
  var v = [];
826
826
  for (var ke = 0; ke < 256; ++ke)
827
827
  v.push((ke + 256).toString(16).slice(1));
828
- function Ir(e, t = 0) {
828
+ function xr(e, t = 0) {
829
829
  return (v[e[t + 0]] + v[e[t + 1]] + v[e[t + 2]] + v[e[t + 3]] + "-" + v[e[t + 4]] + v[e[t + 5]] + "-" + v[e[t + 6]] + v[e[t + 7]] + "-" + v[e[t + 8]] + v[e[t + 9]] + "-" + v[e[t + 10]] + v[e[t + 11]] + v[e[t + 12]] + v[e[t + 13]] + v[e[t + 14]] + v[e[t + 15]]).toLowerCase();
830
830
  }
831
- var ae, xr = new Uint8Array(16);
832
- function Nr() {
833
- if (!ae && (ae = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ae))
831
+ var re, Nr = new Uint8Array(16);
832
+ function Cr() {
833
+ if (!re && (re = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !re))
834
834
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
835
- return ae(xr);
835
+ return re(Nr);
836
836
  }
837
- var Cr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
838
- const Ve = {
839
- randomUUID: Cr
837
+ var Rr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
838
+ const Je = {
839
+ randomUUID: Rr
840
840
  };
841
- function Rr(e, t, r) {
842
- if (Ve.randomUUID && !t && !e)
843
- return Ve.randomUUID();
841
+ function Or(e, t, r) {
842
+ if (Je.randomUUID && !t && !e)
843
+ return Je.randomUUID();
844
844
  e = e || {};
845
- var a = e.random || (e.rng || Nr)();
846
- return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Ir(a);
845
+ var a = e.random || (e.rng || Cr)();
846
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, xr(a);
847
847
  }
848
- const ne = "Oops! It looks like your session has expired. For your security, please log in again to continue.", Or = "Your session has been successfully terminated.", Je = "Login failed. Please try again.", Se = "Error getting access token, please re-authenticate.", Dr = "You forgot to wrap your component in <AuthProvider>.", Fe = {
848
+ const ae = "Oops! It looks like your session has expired. For your security, please log in again to continue.", Dr = "Your session has been successfully terminated.", Fe = "Login failed. Please try again.", Se = "Error getting access token, please re-authenticate.", $r = "You forgot to wrap your component in <AuthProvider>.", ze = {
849
849
  dev: "https://auth.gizmette.local.com:3003",
850
850
  prod: "https://mylogin.gizmette.com"
851
- }, oe = "@@auth@@", Mr = process.env.NODE_ENV === "production", $r = !Mr, fe = async ({
851
+ }, ne = "@@auth@@", Mr = process.env.NODE_ENV === "production", Lr = !Mr, ge = async ({
852
852
  type: e,
853
853
  clientId: t,
854
854
  params: r = {}
855
855
  }) => {
856
856
  try {
857
857
  const a = await fetch(
858
- $r ? `${Fe.dev}/${e}` : `${Fe.prod}/${e}`,
858
+ Lr ? `${ze.dev}/${e}` : `${ze.prod}/${e}`,
859
859
  {
860
860
  credentials: "include",
861
861
  method: "POST",
@@ -877,21 +877,23 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
877
877
  } catch (a) {
878
878
  return console.error(a), { status: 500, data: [] };
879
879
  }
880
- }, Lr = async ({
880
+ }, Pr = async ({
881
881
  idToken: e,
882
882
  accessToken: t,
883
883
  refreshToken: r,
884
- clientId: a
884
+ clientId: a,
885
+ domain: n
885
886
  }) => {
886
887
  try {
887
888
  return {
888
- status: (await fe({
889
- type: he.LOGOUT,
889
+ status: (await ge({
890
+ type: me.LOGOUT,
890
891
  clientId: a,
891
892
  params: {
892
893
  idToken: e,
893
894
  accessToken: t,
894
- refreshToken: r
895
+ refreshToken: r,
896
+ domain: n
895
897
  }
896
898
  })).status === 200
897
899
  };
@@ -900,7 +902,7 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
900
902
  status: !1
901
903
  };
902
904
  }
903
- }, ze = async ({
905
+ }, Ye = async ({
904
906
  username: e,
905
907
  password: t,
906
908
  clientId: r,
@@ -908,11 +910,12 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
908
910
  type: n,
909
911
  sessionExpiration: o,
910
912
  code: s,
911
- code_verifier: i
913
+ code_verifier: i,
914
+ domain: l
912
915
  }) => {
913
916
  try {
914
- const l = await fe({
915
- type: he.AUTHENTICATE,
917
+ const d = await ge({
918
+ type: me.AUTHENTICATE,
916
919
  clientId: r,
917
920
  params: {
918
921
  type: n || Q.ID_AND_ACCESS_TOKEN,
@@ -921,14 +924,15 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
921
924
  sessionExpiration: o,
922
925
  nonce: a,
923
926
  code: s,
924
- code_verifier: i
927
+ code_verifier: i,
928
+ domain: l
925
929
  }
926
- }), d = await Y(l.data.idToken);
927
- return d && d.payload[N.USER_ID_KEY] !== "" && d.payload[N.NONCE_KEY] === a ? {
928
- idToken: l.data.idToken,
929
- accessToken: l.data.accessToken,
930
- refreshToken: l.data.refreshToken,
931
- userId: d.payload[N.USER_ID_KEY],
930
+ }), h = await Y(d.data.idToken);
931
+ return h && h.payload[I.USER_ID_KEY] !== "" && h.payload[I.NONCE_KEY] === a ? {
932
+ idToken: d.data.idToken,
933
+ accessToken: d.data.accessToken,
934
+ refreshToken: d.data.refreshToken,
935
+ userId: h.payload[I.USER_ID_KEY],
932
936
  status: !0
933
937
  } : {
934
938
  status: !1
@@ -938,14 +942,14 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
938
942
  status: !1
939
943
  };
940
944
  }
941
- }, Pr = async ({
945
+ }, Ur = async ({
942
946
  nonce: e,
943
947
  clientId: t,
944
948
  code_challenge: r
945
949
  }) => {
946
950
  try {
947
- const a = await fe({
948
- type: he.CODE,
951
+ const a = await ge({
952
+ type: me.CODE,
949
953
  clientId: t,
950
954
  params: {
951
955
  type: Q.CODE,
@@ -964,29 +968,31 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
964
968
  status: !1
965
969
  };
966
970
  }
967
- }, Ur = async ({
971
+ }, Hr = async ({
968
972
  clientId: e,
969
973
  userId: t,
970
974
  nonce: r,
971
975
  refreshToken: a,
972
- accessToken: n
976
+ accessToken: n,
977
+ domain: o
973
978
  }) => {
974
979
  try {
975
- const o = await fe({
976
- type: he.AUTHENTICATE,
980
+ const s = await ge({
981
+ type: me.AUTHENTICATE,
977
982
  clientId: e,
978
983
  params: {
979
984
  type: Q.REFRESH_TOKEN,
980
985
  userId: t,
981
986
  nonce: r,
982
987
  refreshToken: a,
983
- accessToken: n
988
+ accessToken: n,
989
+ domain: o
984
990
  }
985
- }), s = await Y(o.data.accessToken);
986
- return s && s.payload[N.USER_ID_KEY] !== "" && s.payload[N.NONCE_KEY] === r ? {
987
- accessToken: o.data.accessToken,
988
- refreshToken: o.data.refreshToken,
989
- userId: s.payload[N.USER_ID_KEY],
991
+ }), i = await Y(s.data.accessToken);
992
+ return i && i.payload[I.USER_ID_KEY] !== "" && i.payload[I.NONCE_KEY] === r ? {
993
+ accessToken: s.data.accessToken,
994
+ refreshToken: s.data.refreshToken,
995
+ userId: i.payload[I.USER_ID_KEY],
990
996
  status: !0
991
997
  } : {
992
998
  status: !1
@@ -997,19 +1003,21 @@ const ne = "Oops! It looks like your session has expired. For your security, ple
997
1003
  };
998
1004
  }
999
1005
  };
1000
- class Hr {
1006
+ class Kr {
1001
1007
  constructor(t = null, r = null) {
1002
1008
  ye(this, "refreshTokenPromise", null), ye(this, "accessToken"), ye(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
1003
1009
  }
1004
1010
  async refreshtoken({
1005
1011
  clientId: t,
1006
1012
  userId: r,
1007
- nonce: a
1013
+ nonce: a,
1014
+ domain: n
1008
1015
  }) {
1009
1016
  this.refreshTokenPromise || (this.refreshTokenPromise = this._refreshToken({
1010
1017
  clientId: t,
1011
1018
  userId: r,
1012
- nonce: a
1019
+ nonce: a,
1020
+ domain: n
1013
1021
  }));
1014
1022
  try {
1015
1023
  return await this.refreshTokenPromise;
@@ -1020,21 +1028,23 @@ class Hr {
1020
1028
  async _refreshToken({
1021
1029
  clientId: t,
1022
1030
  userId: r,
1023
- nonce: a
1031
+ nonce: a,
1032
+ domain: n
1024
1033
  }) {
1025
- const n = await Y(this.refreshToken);
1026
- if (n && n.payload[N.USER_ID_KEY] !== "") {
1027
- const o = await Ur({
1034
+ const o = await Y(this.refreshToken);
1035
+ if (o && o.payload[I.USER_ID_KEY] !== "") {
1036
+ const s = await Hr({
1028
1037
  clientId: t,
1029
1038
  userId: r,
1030
1039
  nonce: a,
1031
1040
  refreshToken: this.refreshToken,
1032
- accessToken: this.accessToken
1041
+ accessToken: this.accessToken,
1042
+ domain: n
1033
1043
  });
1034
- return o.status ? (this.accessToken = o.accessToken, this.refreshToken = o.refreshToken, {
1044
+ return s.status ? (this.accessToken = s.accessToken, this.refreshToken = s.refreshToken, {
1035
1045
  status: "success",
1036
- newAccessToken: o.accessToken,
1037
- newRefreshToken: o.refreshToken
1046
+ newAccessToken: s.accessToken,
1047
+ newRefreshToken: s.refreshToken
1038
1048
  }) : {
1039
1049
  status: "failure"
1040
1050
  };
@@ -1044,107 +1054,117 @@ class Hr {
1044
1054
  };
1045
1055
  }
1046
1056
  }
1047
- const se = () => {
1048
- throw new Error(Dr);
1049
- }, mt = It({
1057
+ const oe = () => {
1058
+ throw new Error($r);
1059
+ }, ht = xt({
1050
1060
  isAuthenticated: !1,
1051
1061
  isLoading: !1,
1052
- login: se,
1053
- logout: se,
1054
- getAccessToken: se,
1055
- getIdToken: se,
1062
+ login: oe,
1063
+ logout: oe,
1064
+ getAccessToken: oe,
1065
+ getIdToken: oe,
1056
1066
  logoutReason: ""
1057
- }), Kr = ({
1067
+ }), Br = ({
1058
1068
  children: e,
1059
1069
  sessionExpiration: t,
1060
- clientId: r
1070
+ clientId: r,
1071
+ domain: a = ""
1061
1072
  }) => {
1062
- const a = B(!1), [n, o, , s] = re({
1063
- key: `${oe}::${r}::@@user@@`
1064
- }), [i, l, , d] = re({
1065
- key: `${oe}::${r}::@@access@@`
1066
- }), [p, u, , m] = re(
1073
+ const n = W(!1), [o, s, , i] = te({
1074
+ key: `${ne}::${r}::@@user@@`
1075
+ }), [l, d, , h] = te({
1076
+ key: `${ne}::${r}::@@access@@`
1077
+ }), [u, m, , p] = te(
1067
1078
  {
1068
- key: `${oe}::${r}::@@refresh@@`
1079
+ key: `${ne}::${r}::@@refresh@@`
1069
1080
  }
1070
- ), [h, f, , b] = re({
1071
- key: `${oe}::${r}::@@nonce@@`
1072
- }), R = new Hr(i, p), [A, T] = U({
1081
+ ), [f, w, , x] = te({
1082
+ key: `${ne}::${r}::@@nonce@@`
1083
+ }), O = new Kr(l, u), [_, S] = U({
1073
1084
  isLoading: !0,
1074
1085
  isAuthenticated: !1,
1075
1086
  user: void 0,
1076
1087
  logoutReason: ""
1077
- }), _ = Me(
1088
+ }), D = Me(
1078
1089
  (y) => {
1079
- console.warn(y), T({
1090
+ console.warn(y), S({
1080
1091
  isLoading: !0,
1081
1092
  isAuthenticated: !1,
1082
1093
  user: void 0,
1083
- logoutReason: y || ne
1084
- }), s(), d(), m(), b();
1094
+ logoutReason: y || ae
1095
+ }), i(), h(), p(), x();
1085
1096
  },
1086
- [s, d, b, m]
1087
- ), I = Me(
1097
+ [h, i, x, p]
1098
+ ), C = Me(
1088
1099
  async (y) => {
1089
- _(y || ne), await Lr({
1090
- idToken: n,
1091
- accessToken: i,
1092
- refreshToken: p,
1093
- clientId: r
1094
- }), T((M) => ({
1095
- ...M,
1100
+ D(y || ae), await Pr({
1101
+ idToken: o,
1102
+ accessToken: l,
1103
+ refreshToken: u,
1104
+ clientId: r,
1105
+ domain: a
1106
+ }), S(($) => ({
1107
+ ...$,
1096
1108
  isLoading: !1
1097
1109
  }));
1098
1110
  },
1099
- [i, r, n, _, p]
1111
+ [
1112
+ l,
1113
+ r,
1114
+ a,
1115
+ o,
1116
+ u,
1117
+ D
1118
+ ]
1100
1119
  );
1101
1120
  z(() => {
1102
- if (!a.current)
1103
- return A.isLoading && n !== null ? (async () => {
1121
+ if (!n.current)
1122
+ return _.isLoading && o !== null ? (async () => {
1104
1123
  try {
1105
- const y = await Y(n);
1106
- y && y.payload[N.USER_ID_KEY] !== "" ? T({
1124
+ const y = await Y(o);
1125
+ y && y.payload[I.USER_ID_KEY] !== "" ? S({
1107
1126
  isLoading: !1,
1108
1127
  isAuthenticated: !0,
1109
1128
  user: {
1110
- userId: y.payload[N.USER_ID_KEY],
1111
- username: y.payload[N.USERNAME_KEY]
1129
+ userId: y.payload[I.USER_ID_KEY],
1130
+ username: y.payload[I.USERNAME_KEY]
1112
1131
  },
1113
1132
  logoutReason: ""
1114
- }) : await I(ne);
1133
+ }) : await C(ae);
1115
1134
  } catch {
1116
- await I(ne);
1135
+ await C(ae);
1117
1136
  }
1118
- })() : T((y) => ({
1137
+ })() : S((y) => ({
1119
1138
  ...y,
1120
1139
  isLoading: !1
1121
1140
  })), () => {
1122
- a.current = !0;
1141
+ n.current = !0;
1123
1142
  };
1124
- }, [A.isLoading, n, I]);
1125
- const j = async (y, M, D) => {
1126
- const w = Rr();
1127
- if (f(w), T((V) => ({
1128
- ...V,
1143
+ }, [_.isLoading, o, C]);
1144
+ const N = async (y, $, b) => {
1145
+ const A = Or();
1146
+ if (w(A), S((G) => ({
1147
+ ...G,
1129
1148
  isLoading: !0
1130
- })), s(), d(), m(), D === Q.CODE) {
1131
- const { code_verifier: V, code_challenge: X } = await Tr(), De = await Pr({
1132
- nonce: w,
1149
+ })), i(), h(), p(), b === Q.CODE) {
1150
+ const { code_verifier: G, code_challenge: It } = await Ar(), $e = await Ur({
1151
+ nonce: A,
1133
1152
  clientId: r,
1134
- code_challenge: X
1153
+ code_challenge: It
1135
1154
  });
1136
- if (De.status) {
1137
- const J = await ze({
1155
+ if ($e.status) {
1156
+ const J = await Ye({
1138
1157
  username: y,
1139
- password: M,
1158
+ password: $,
1140
1159
  clientId: r,
1141
1160
  sessionExpiration: t,
1142
- nonce: w,
1143
- type: D,
1144
- code: De.code,
1145
- code_verifier: V
1161
+ nonce: A,
1162
+ type: b,
1163
+ code: $e.code,
1164
+ code_verifier: G,
1165
+ domain: a
1146
1166
  });
1147
- return J.status ? (o(J.idToken), l(J.accessToken), u(J.refreshToken), T({
1167
+ return J.status ? (s(J.idToken), d(J.accessToken), m(J.refreshToken), S({
1148
1168
  isLoading: !1,
1149
1169
  isAuthenticated: !0,
1150
1170
  user: {
@@ -1152,60 +1172,233 @@ const se = () => {
1152
1172
  username: y
1153
1173
  },
1154
1174
  logoutReason: ""
1155
- }), !0) : (_(Je), !1);
1175
+ }), !0) : (D(Fe), !1);
1156
1176
  }
1157
1177
  return !1;
1158
1178
  }
1159
- const x = await ze({
1179
+ const B = await Ye({
1160
1180
  username: y,
1161
- password: M,
1181
+ password: $,
1162
1182
  clientId: r,
1163
1183
  sessionExpiration: t,
1164
- nonce: w,
1165
- type: D
1184
+ nonce: A,
1185
+ type: b,
1186
+ domain: a
1166
1187
  });
1167
- return x.status ? (o(x.idToken), l(x.accessToken), u(x.refreshToken), T({
1188
+ return B.status ? (s(B.idToken), d(B.accessToken), m(B.refreshToken), S({
1168
1189
  isLoading: !1,
1169
1190
  isAuthenticated: !0,
1170
1191
  user: {
1171
- userId: x.userId,
1192
+ userId: B.userId,
1172
1193
  username: y
1173
1194
  }
1174
- }), !0) : (_(Je), !1);
1175
- }, C = async (y) => {
1176
- y == null || y.preventDefault(), await I(Or);
1177
- }, G = async () => {
1178
- const { isAuthenticated: y, user: M } = A;
1195
+ }), !0) : (D(Fe), !1);
1196
+ }, V = async (y) => {
1197
+ y == null || y.preventDefault(), await C(Dr);
1198
+ }, R = async () => {
1199
+ const { isAuthenticated: y, user: $ } = _;
1179
1200
  try {
1180
- if (y && M && M.userId) {
1181
- if (i) {
1182
- const w = await Y(i);
1183
- if (w && w.payload[N.USER_ID_KEY] !== "")
1184
- return i;
1201
+ if (y && $ && $.userId) {
1202
+ if (l) {
1203
+ const A = await Y(l);
1204
+ if (A && A.payload[I.USER_ID_KEY] !== "")
1205
+ return l;
1185
1206
  }
1186
- const D = await R.refreshtoken({
1207
+ const b = await O.refreshtoken({
1187
1208
  clientId: r,
1188
- userId: M.userId,
1189
- nonce: h
1209
+ userId: $.userId,
1210
+ nonce: f,
1211
+ domain: a
1190
1212
  });
1191
- return D.status && D.status === "success" ? (l(D.newAccessToken), u(D.newRefreshToken), D.newAccessToken) : (await I(Se), "");
1213
+ return b.status && b.status === "success" ? (d(b.newAccessToken), m(b.newRefreshToken), b.newAccessToken) : (await C(Se), "");
1192
1214
  }
1193
- return await I(Se), "";
1215
+ return await C(Se), "";
1194
1216
  } catch {
1195
- return await I(Se), "";
1217
+ return await C(Se), "";
1196
1218
  }
1197
- }, O = () => {
1198
- if (A.isAuthenticated && n)
1199
- return n;
1219
+ }, fe = () => {
1220
+ if (_.isAuthenticated && o)
1221
+ return o;
1200
1222
  };
1201
1223
  return /* @__PURE__ */ c(
1202
- mt.Provider,
1224
+ ht.Provider,
1203
1225
  {
1204
- value: { ...A, login: j, logout: C, getAccessToken: G, getIdToken: O },
1226
+ value: { ..._, login: N, logout: V, getAccessToken: R, getIdToken: fe },
1205
1227
  children: e
1206
1228
  }
1207
1229
  );
1208
- }, xe = (e = mt) => Xe(e), en = "user", tn = "assistant", rn = "system", an = "internal", nn = "hidden", on = "I'm having trouble right now. Please try again later.", sn = "gpt-4", cn = 128e3, ln = "action-message", dn = "action-reset", un = "action-model", mn = "action-restore", hn = "action-location", pn = "action-streaming", gn = "action-search", fn = "action-sort", yn = "sassy-saint-", bn = "details", wn = "search", En = "sort", vn = "location", kn = "==stats==", Br = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", Ne = (e) => {
1230
+ }, xe = (e = ht) => Ze(e), rn = "user", an = "assistant", nn = "system", on = "internal", sn = "hidden", cn = "I'm having trouble right now. Please try again later.", ln = "gpt-4", dn = 128e3, un = "action-message", mn = "action-reset", hn = "action-model", pn = "action-restore", gn = "action-location", fn = "action-streaming", yn = "action-search", bn = "action-sort", wn = "sassy-saint-", En = "details", vn = "search", kn = "sort", Sn = "location", Tn = "==stats==", Wr = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", qe = (e) => Number.isFinite(e) ? e : 0;
1231
+ function jr(e) {
1232
+ return {
1233
+ days: Math.trunc(e / 864e5),
1234
+ hours: Math.trunc(e / 36e5 % 24),
1235
+ minutes: Math.trunc(e / 6e4 % 60),
1236
+ seconds: Math.trunc(e / 1e3 % 60),
1237
+ milliseconds: Math.trunc(e % 1e3),
1238
+ microseconds: Math.trunc(qe(e * 1e3) % 1e3),
1239
+ nanoseconds: Math.trunc(qe(e * 1e6) % 1e3)
1240
+ };
1241
+ }
1242
+ function Gr(e) {
1243
+ return {
1244
+ days: e / 86400000n,
1245
+ hours: e / 3600000n % 24n,
1246
+ minutes: e / 60000n % 60n,
1247
+ seconds: e / 1000n % 60n,
1248
+ milliseconds: e % 1000n,
1249
+ microseconds: 0n,
1250
+ nanoseconds: 0n
1251
+ };
1252
+ }
1253
+ function Vr(e) {
1254
+ switch (typeof e) {
1255
+ case "number": {
1256
+ if (Number.isFinite(e))
1257
+ return jr(e);
1258
+ break;
1259
+ }
1260
+ case "bigint":
1261
+ return Gr(e);
1262
+ }
1263
+ throw new TypeError("Expected a finite number or bigint");
1264
+ }
1265
+ const Jr = (e) => e === 0 || e === 0n, Fr = (e, t) => t === 1 || t === 1n ? e : `${e}s`, zr = 1e-7, Yr = 24n * 60n * 60n * 1000n;
1266
+ function qr(e, t) {
1267
+ const r = typeof e == "bigint";
1268
+ if (!r && !Number.isFinite(e))
1269
+ throw new TypeError("Expected a finite number or bigint");
1270
+ 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);
1271
+ let a = [];
1272
+ const n = (d, h) => {
1273
+ const u = Math.floor(d * 10 ** h + zr);
1274
+ return (Math.round(u) / 10 ** h).toFixed(h);
1275
+ }, o = (d, h, u, m) => {
1276
+ if (!((a.length === 0 || !t.colonNotation) && Jr(d) && !(t.colonNotation && u === "m"))) {
1277
+ if (m = m ?? String(d), t.colonNotation) {
1278
+ const p = m.includes(".") ? m.split(".")[0].length : m.length, f = a.length > 0 ? 2 : 1;
1279
+ m = "0".repeat(Math.max(0, f - p)) + m;
1280
+ } else
1281
+ m += t.verbose ? " " + Fr(h, d) : u;
1282
+ a.push(m);
1283
+ }
1284
+ }, s = Vr(e), i = BigInt(s.days);
1285
+ if (o(i / 365n, "year", "y"), o(i % 365n, "day", "d"), o(Number(s.hours), "hour", "h"), o(Number(s.minutes), "minute", "m"), t.separateMilliseconds || t.formatSubMilliseconds || !t.colonNotation && e < 1e3) {
1286
+ const d = Number(s.seconds), h = Number(s.milliseconds), u = Number(s.microseconds), m = Number(s.nanoseconds);
1287
+ if (o(d, "second", "s"), t.formatSubMilliseconds)
1288
+ o(h, "millisecond", "ms"), o(u, "microsecond", "µs"), o(m, "nanosecond", "ns");
1289
+ else {
1290
+ const p = h + u / 1e3 + m / 1e6, f = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, w = p >= 1 ? Math.round(p) : Math.ceil(p), x = f ? p.toFixed(f) : w;
1291
+ o(
1292
+ Number.parseFloat(x),
1293
+ "millisecond",
1294
+ "ms",
1295
+ x
1296
+ );
1297
+ }
1298
+ } else {
1299
+ const d = (r ? Number(e % Yr) : e) / 1e3 % 60, h = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, u = n(d, h), m = t.keepDecimalsOnWholeSeconds ? u : u.replace(/\.0+$/, "");
1300
+ o(Number.parseFloat(m), "second", "s", m);
1301
+ }
1302
+ if (a.length === 0)
1303
+ return "0" + (t.verbose ? " milliseconds" : "ms");
1304
+ const l = t.colonNotation ? ":" : " ";
1305
+ return typeof t.unitCount == "number" && (a = a.slice(0, Math.max(t.unitCount, 1))), a.join(l);
1306
+ }
1307
+ const Qr = process.env.NODE_ENV === "production", Ne = !Qr, Xr = Ne ? "gizmette.local.com" : "gizmette.com", An = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, pt = (e, t) => {
1308
+ const r = e < 0 ? t ? "W" : "S" : t ? "E" : "N", a = 0 | Math.abs(e), n = 0 | Math.abs(e) * 60 % 60, o = (0 | Math.abs(e) * 60 % 1 * 6e3) / 100;
1309
+ return {
1310
+ dir: r,
1311
+ deg: a,
1312
+ min: n,
1313
+ sec: o
1314
+ };
1315
+ }, _n = (e) => {
1316
+ if (!e && e !== 0)
1317
+ return "N/A";
1318
+ const t = pt(e, !1);
1319
+ return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
1320
+ }, In = (e) => {
1321
+ if (!e && e !== 0)
1322
+ return "N/A";
1323
+ const t = pt(e, !0);
1324
+ return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
1325
+ }, xn = async () => {
1326
+ const e = {
1327
+ /**
1328
+ * A boolean value that indicates the application would
1329
+ * like to receive the best possible results. If true
1330
+ * and if the device is able to provide a more accurate
1331
+ * position, it will do so. Note that this can result in
1332
+ * slower response times or increased power consumption
1333
+ * (with a GPS chip on a mobile device for example). On
1334
+ * the other hand, if false, the device can take the
1335
+ * liberty to save resources by responding more quickly
1336
+ * and/or using less power. Default: false.
1337
+ */
1338
+ enableHighAccuracy: !1,
1339
+ /**
1340
+ * A positive long value representing the maximum length
1341
+ * of time (in milliseconds) the device is allowed to
1342
+ * take in order to return a position. The default value
1343
+ * is Infinity, meaning that getCurrentPosition() won't
1344
+ * return until the position is available.
1345
+ */
1346
+ timeout: 1e4,
1347
+ /**
1348
+ * A positive long value indicating the maximum age in
1349
+ * milliseconds of a possible cached position that is
1350
+ * acceptable to return. If set to 0, it means that the
1351
+ * device cannot use a cached position and must attempt
1352
+ * to retrieve the real current position. If set to
1353
+ * Infinity the device must return a cached position
1354
+ * regardless of its age. Default: 0.
1355
+ */
1356
+ maximumAge: 6e4
1357
+ };
1358
+ return new Promise((t, r) => {
1359
+ var a;
1360
+ (a = navigator == null ? void 0 : navigator.geolocation) == null || a.getCurrentPosition(
1361
+ (n) => {
1362
+ t({
1363
+ latitude: n.coords.latitude,
1364
+ longitude: n.coords.longitude,
1365
+ accuracy: n.coords.accuracy
1366
+ });
1367
+ },
1368
+ (n) => {
1369
+ r(n);
1370
+ },
1371
+ e
1372
+ );
1373
+ });
1374
+ }, Nn = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ c("dl", { className: "my-0", children: /* @__PURE__ */ T("div", { className: "flex items-center justify-between", children: [
1375
+ /* @__PURE__ */ c("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
1376
+ /* @__PURE__ */ c("dd", { className: "inline-block", children: t[r] })
1377
+ ] }) }, `${e}-${r}`)) : null;
1378
+ function Cn({
1379
+ data: e,
1380
+ formatter: t = (r) => r
1381
+ }) {
1382
+ const r = e.filter(
1383
+ (n) => typeof n == "number" && n > 0
1384
+ ), a = r.reduce(
1385
+ (n, o) => (n || 0) + (o || 0),
1386
+ 0
1387
+ );
1388
+ return t(a ? a / r.length : 0);
1389
+ }
1390
+ const Rn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, On = new Intl.NumberFormat("en", {
1391
+ style: "decimal",
1392
+ signDisplay: "never",
1393
+ minimumFractionDigits: 0,
1394
+ maximumFractionDigits: 0
1395
+ }), Dn = (e) => qr(e, {
1396
+ secondsDecimalDigits: 2,
1397
+ unitCount: 2
1398
+ }), Zr = (e) => g(
1399
+ "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",
1400
+ e || Ne ? "pt-4" : "pt-10"
1401
+ ), $n = (e, t) => t === 1 ? e : `${e}s`, Ce = (e) => {
1209
1402
  let t = "";
1210
1403
  if (typeof e == "number" || typeof e == "string")
1211
1404
  t = "m-" + e;
@@ -1214,7 +1407,7 @@ const se = () => {
1214
1407
  (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(" ");
1215
1408
  }
1216
1409
  return t;
1217
- }, Sn = "av-bubble", Ye = "av-button", Tn = "av-card", Wr = "av-footer", jr = "av-main", An = "av-messagebox", _n = "av-panel", In = "av-spinner", ht = "icon", pt = "button", Gr = "link", Vr = ({
1410
+ }, Mn = "av-bubble", Qe = "av-button", Ln = "av-card", ea = "av-footer", ta = "av-main", Pn = "av-messagebox", Un = "av-panel", Hn = "av-spinner", gt = "icon", ft = "button", ra = "link", aa = ({
1218
1411
  type: e,
1219
1412
  size: t,
1220
1413
  labelRight: r,
@@ -1223,19 +1416,19 @@ const se = () => {
1223
1416
  }) => {
1224
1417
  const o = "text-sm font-medium max-h-8 py-0", s = "text-base font-medium max-h-9 py-1", i = "text-lg font-medium max-h-12 py-2";
1225
1418
  switch (e) {
1226
- case pt:
1419
+ case ft:
1227
1420
  return g("px-4", {
1228
1421
  [o]: t === "small",
1229
1422
  [s]: t === "medium",
1230
1423
  [i]: t === "large"
1231
1424
  });
1232
- case Gr:
1425
+ case ra:
1233
1426
  return g("px-4 text-center", {
1234
1427
  [o]: t === "small",
1235
1428
  [s]: t === "medium",
1236
1429
  [i]: t === "large"
1237
1430
  });
1238
- case ht:
1431
+ case gt:
1239
1432
  return g("inline-flex items-center", {
1240
1433
  "justify-center": n === "center",
1241
1434
  "justify-start": n === "left",
@@ -1248,7 +1441,7 @@ const se = () => {
1248
1441
  "h-12 px-4 text-lg font-medium": t === "large" && (r || a)
1249
1442
  });
1250
1443
  }
1251
- }, Jr = ({
1444
+ }, na = ({
1252
1445
  mode: e,
1253
1446
  noBackground: t,
1254
1447
  noTruncate: r,
@@ -1280,7 +1473,7 @@ const se = () => {
1280
1473
  "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
1281
1474
  "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
1282
1475
  });
1283
- }, Fr = ({
1476
+ }, oa = ({
1284
1477
  mode: e,
1285
1478
  disabled: t,
1286
1479
  variant: r
@@ -1308,7 +1501,7 @@ const se = () => {
1308
1501
  "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
1309
1502
  "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
1310
1503
  });
1311
- }, zr = ({
1504
+ }, sa = ({
1312
1505
  mode: e,
1313
1506
  disabled: t,
1314
1507
  variant: r
@@ -1336,7 +1529,7 @@ const se = () => {
1336
1529
  "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
1337
1530
  "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
1338
1531
  });
1339
- }, Yr = ({
1532
+ }, ia = ({
1340
1533
  mode: e,
1341
1534
  noBorder: t,
1342
1535
  variant: r
@@ -1364,12 +1557,12 @@ const se = () => {
1364
1557
  "border-border-danger-dark dark:border-border-danger-medium": e === "system",
1365
1558
  "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
1366
1559
  });
1367
- }, qr = ({ focusMode: e }) => g("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
1560
+ }, ca = ({ focusMode: e }) => g("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
1368
1561
  "focus:outline-focus-dark": e === "dark",
1369
1562
  "focus:outline-focus-light": e === "light",
1370
1563
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
1371
1564
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
1372
- }), gt = ({
1565
+ }), yt = ({
1373
1566
  type: e,
1374
1567
  className: t,
1375
1568
  raw: r,
@@ -1380,30 +1573,30 @@ const se = () => {
1380
1573
  size: i,
1381
1574
  noBorder: l,
1382
1575
  labelRight: d,
1383
- labelLeft: p,
1576
+ labelLeft: h,
1384
1577
  spacing: u,
1385
1578
  noBackground: m,
1386
- variant: h,
1579
+ variant: p,
1387
1580
  noTruncate: f,
1388
- align: b
1389
- }) => (h || (h = "primary"), r ? g(Ye, t) : g(
1390
- Ye,
1581
+ align: w
1582
+ }) => (p || (p = "primary"), r ? g(Qe, t) : g(
1583
+ Qe,
1391
1584
  t,
1392
- Ne(u),
1393
- Jr({ mode: a, variant: h, noBackground: m, noTruncate: f }),
1394
- Vr({ type: e, size: i, labelRight: d, labelLeft: p, align: b }),
1395
- Yr({ mode: a, variant: h, noBorder: l }),
1396
- qr({ focusMode: n }),
1397
- Fr({ mode: a, variant: h, disabled: o }),
1398
- zr({ mode: a, variant: h, disabled: o }),
1585
+ Ce(u),
1586
+ na({ mode: a, variant: p, noBackground: m, noTruncate: f }),
1587
+ aa({ type: e, size: i, labelRight: d, labelLeft: h, align: w }),
1588
+ ia({ mode: a, variant: p, noBorder: l }),
1589
+ ca({ focusMode: n }),
1590
+ oa({ mode: a, variant: p, disabled: o }),
1591
+ sa({ mode: a, variant: p, disabled: o }),
1399
1592
  {
1400
1593
  "w-full": s,
1401
1594
  "disabled:cursor-not-allowed disabled:opacity-50": o
1402
1595
  }
1403
- )), Qr = (e, t, r) => {
1596
+ )), la = (e, t, r) => {
1404
1597
  var a;
1405
1598
  !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
1406
- }, Ce = K.forwardRef(
1599
+ }, Re = K.forwardRef(
1407
1600
  (e, t) => {
1408
1601
  const { onClick: r, noInternalClick: a = !1, ...n } = e;
1409
1602
  return /* @__PURE__ */ c(
@@ -1411,15 +1604,15 @@ const se = () => {
1411
1604
  {
1412
1605
  ref: t,
1413
1606
  onClick: (o) => {
1414
- Qr(o, a, r);
1607
+ la(o, a, r);
1415
1608
  },
1416
1609
  ...n
1417
1610
  }
1418
1611
  );
1419
1612
  }
1420
1613
  );
1421
- Ce.displayName = "BaseButton";
1422
- const ft = K.forwardRef(
1614
+ Re.displayName = "BaseButton";
1615
+ const bt = K.forwardRef(
1423
1616
  ({
1424
1617
  children: e,
1425
1618
  disabled: t = !1,
@@ -1431,17 +1624,17 @@ const ft = K.forwardRef(
1431
1624
  raw: i = !1,
1432
1625
  noBorder: l = !1,
1433
1626
  "aria-label": d,
1434
- label: p,
1627
+ label: h,
1435
1628
  size: u = "medium",
1436
1629
  labelRight: m,
1437
- labelLeft: h,
1630
+ labelLeft: p,
1438
1631
  spacing: f,
1439
- noBackground: b = !1,
1440
- align: R = "center",
1441
- ...A
1442
- }, T) => {
1443
- const _ = gt({
1444
- type: ht,
1632
+ noBackground: w = !1,
1633
+ align: x = "center",
1634
+ ...O
1635
+ }, _) => {
1636
+ const S = yt({
1637
+ type: gt,
1445
1638
  mode: r,
1446
1639
  focusMode: a,
1447
1640
  fullWidth: n,
@@ -1451,36 +1644,36 @@ const ft = K.forwardRef(
1451
1644
  noBorder: l,
1452
1645
  size: u,
1453
1646
  labelRight: m,
1454
- labelLeft: h,
1647
+ labelLeft: p,
1455
1648
  spacing: f,
1456
- noBackground: b,
1457
- align: R
1458
- }), I = g({
1649
+ noBackground: w,
1650
+ align: x
1651
+ }), D = g({
1459
1652
  "text-copy-accent-dark": r === "light" && !i,
1460
1653
  "text-copy-light": r === "dark" && !i,
1461
1654
  "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
1462
1655
  "text-copy-light dark:text-copy-accent-dark": r === "system" && !i
1463
1656
  });
1464
- return /* @__PURE__ */ S(
1465
- Ce,
1657
+ return /* @__PURE__ */ T(
1658
+ Re,
1466
1659
  {
1467
- ref: T,
1468
- className: _,
1660
+ ref: _,
1661
+ className: S,
1469
1662
  disabled: t,
1470
1663
  type: s,
1471
- "aria-label": d || p,
1472
- ...A,
1664
+ "aria-label": d || h,
1665
+ ...O,
1473
1666
  children: [
1474
- h && /* @__PURE__ */ c("span", { className: "pr-2", children: h }),
1475
- /* @__PURE__ */ c("div", { className: I, children: e }),
1667
+ p && /* @__PURE__ */ c("span", { className: "pr-2", children: p }),
1668
+ /* @__PURE__ */ c("div", { className: D, children: e }),
1476
1669
  m && /* @__PURE__ */ c("span", { className: "pl-2", children: m })
1477
1670
  ]
1478
1671
  }
1479
1672
  );
1480
1673
  }
1481
1674
  );
1482
- ft.displayName = "ButtonIcon";
1483
- const yt = K.forwardRef(
1675
+ bt.displayName = "ButtonIcon";
1676
+ const wt = K.forwardRef(
1484
1677
  ({
1485
1678
  children: e,
1486
1679
  disabled: t = !1,
@@ -1492,12 +1685,12 @@ const yt = K.forwardRef(
1492
1685
  raw: i = !1,
1493
1686
  noBorder: l = !1,
1494
1687
  spacing: d,
1495
- variant: p = "primary",
1688
+ variant: h = "primary",
1496
1689
  noTruncate: u = !1,
1497
1690
  ...m
1498
- }, h) => {
1499
- const f = gt({
1500
- type: pt,
1691
+ }, p) => {
1692
+ const f = yt({
1693
+ type: ft,
1501
1694
  mode: r,
1502
1695
  focusMode: a,
1503
1696
  fullWidth: n,
@@ -1507,13 +1700,13 @@ const yt = K.forwardRef(
1507
1700
  size: s,
1508
1701
  noBorder: l,
1509
1702
  spacing: d,
1510
- variant: p,
1703
+ variant: h,
1511
1704
  noTruncate: u
1512
1705
  });
1513
1706
  return /* @__PURE__ */ c(
1514
- Ce,
1707
+ Re,
1515
1708
  {
1516
- ref: h,
1709
+ ref: p,
1517
1710
  className: f,
1518
1711
  disabled: t,
1519
1712
  ...m,
@@ -1522,8 +1715,8 @@ const yt = K.forwardRef(
1522
1715
  );
1523
1716
  }
1524
1717
  );
1525
- yt.displayName = "Button";
1526
- const Xr = ({
1718
+ wt.displayName = "Button";
1719
+ const da = ({
1527
1720
  className: e,
1528
1721
  mode: t = "system",
1529
1722
  row1: r,
@@ -1532,7 +1725,7 @@ const Xr = ({
1532
1725
  spacing: o,
1533
1726
  raw: s = !1
1534
1727
  }) => {
1535
- const i = g(Wr, e, Ne(o), {
1728
+ const i = g(ea, e, Ce(o), {
1536
1729
  "text-copy-dark": !s && t === "dark",
1537
1730
  "text-copy-lighter": !s && t === "light",
1538
1731
  "text-copy-dark dark:text-copy-lighter": !s && t === "system",
@@ -1540,17 +1733,17 @@ const Xr = ({
1540
1733
  "mb-[100px]": !n && !s,
1541
1734
  "mt-0 flex w-full flex-col p-2 text-center text-xs sm:mt-3 md:mx-auto md:max-w-4xl": !s
1542
1735
  });
1543
- return /* @__PURE__ */ S("footer", { className: i, children: [
1736
+ return /* @__PURE__ */ T("footer", { className: i, children: [
1544
1737
  r && /* @__PURE__ */ c("div", { children: r }),
1545
1738
  a && /* @__PURE__ */ c("div", { children: a })
1546
1739
  ] });
1547
- }, Zr = ({
1740
+ }, ua = ({
1548
1741
  children: e,
1549
1742
  className: t,
1550
1743
  raw: r = !1,
1551
1744
  spacing: a
1552
1745
  }) => {
1553
- const n = g(t, jr, Ne(a), {
1746
+ const n = g(t, ta, Ce(a), {
1554
1747
  "mt-2 flex w-full flex-col p-2 sm:mt-3 md:mx-auto md:max-w-4xl": !r
1555
1748
  });
1556
1749
  return /* @__PURE__ */ c("main", { className: n, children: e });
@@ -1568,16 +1761,16 @@ try {
1568
1761
  });
1569
1762
  } catch {
1570
1763
  }
1571
- function ea(e) {
1572
- return xt(() => e.every((t) => t == null) ? () => {
1764
+ function ma(e) {
1765
+ return Nt(() => e.every((t) => t == null) ? () => {
1573
1766
  } : (t) => {
1574
1767
  e.forEach((r) => {
1575
1768
  typeof r == "function" ? r(t) : r != null && (r.current = t);
1576
1769
  });
1577
1770
  }, e);
1578
1771
  }
1579
- function ta(e) {
1580
- const t = Nt();
1772
+ function ha(e) {
1773
+ const t = Ct();
1581
1774
  if (!e)
1582
1775
  return t;
1583
1776
  if (typeof e == "number" || typeof e == "string")
@@ -1587,7 +1780,7 @@ function ta(e) {
1587
1780
  return typeof r == "number" || typeof r == "string" ? `${a}${r}` : `${a}${t}`;
1588
1781
  }
1589
1782
  }
1590
- const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
1783
+ const Et = "SET_ANNOUNCEMENT", vt = "CLEAR_ANNOUNCEMENT", pa = {
1591
1784
  alert: null,
1592
1785
  alertdialog: null,
1593
1786
  log: "polite",
@@ -1595,14 +1788,14 @@ const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
1595
1788
  progressbar: null,
1596
1789
  status: "polite",
1597
1790
  timer: "assertive"
1598
- }, aa = (e, t) => {
1791
+ }, ga = (e, t) => {
1599
1792
  switch (t == null ? void 0 : t.type) {
1600
- case bt:
1793
+ case Et:
1601
1794
  return {
1602
1795
  ...e,
1603
1796
  announcement: t.payload
1604
1797
  };
1605
- case wt:
1798
+ case vt:
1606
1799
  return {
1607
1800
  ...e,
1608
1801
  announcement: null
@@ -1610,14 +1803,14 @@ const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
1610
1803
  default:
1611
1804
  return e;
1612
1805
  }
1613
- }, na = ({
1806
+ }, fa = ({
1614
1807
  onAnnouncementClear: e,
1615
1808
  dispatch: t
1616
1809
  }) => {
1617
1810
  t({
1618
- type: wt
1811
+ type: vt
1619
1812
  }), typeof e == "function" && e();
1620
- }, qe = ({
1813
+ }, Xe = ({
1621
1814
  children: e,
1622
1815
  clearAnnouncementDelay: t,
1623
1816
  clearAnnouncementTimeoutRef: r,
@@ -1625,16 +1818,16 @@ const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
1625
1818
  dispatch: n
1626
1819
  }) => {
1627
1820
  (r == null ? void 0 : r.current) !== null && clearTimeout(r.current), e !== null && n({
1628
- type: bt,
1821
+ type: Et,
1629
1822
  payload: e
1630
1823
  }), t && (r.current = setTimeout(
1631
- () => na({
1824
+ () => fa({
1632
1825
  onAnnouncementClear: a,
1633
1826
  dispatch: n
1634
1827
  }),
1635
1828
  t
1636
1829
  ));
1637
- }, oa = ({
1830
+ }, ya = ({
1638
1831
  children: e,
1639
1832
  announcementTimeoutRef: t,
1640
1833
  announcementDelay: r,
@@ -1643,13 +1836,13 @@ const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
1643
1836
  onAnnouncementClear: o,
1644
1837
  dispatch: s
1645
1838
  }) => {
1646
- clearTimeout(t.current), r ? t.current = setTimeout(qe, r, {
1839
+ clearTimeout(t.current), r ? t.current = setTimeout(Xe, r, {
1647
1840
  children: e,
1648
1841
  clearAnnouncementDelay: a,
1649
1842
  clearAnnouncementTimeoutRef: n,
1650
1843
  onAnnouncementClear: o,
1651
1844
  dispatch: s
1652
- }) : qe({
1845
+ }) : Xe({
1653
1846
  children: e,
1654
1847
  clearAnnouncementDelay: a,
1655
1848
  clearAnnouncementTimeoutRef: n,
@@ -1657,7 +1850,7 @@ const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
1657
1850
  dispatch: s
1658
1851
  });
1659
1852
  };
1660
- function Et({
1853
+ function kt({
1661
1854
  children: e,
1662
1855
  className: t,
1663
1856
  politeness: r,
@@ -1668,17 +1861,17 @@ function Et({
1668
1861
  visible: i,
1669
1862
  ...l
1670
1863
  }) {
1671
- const d = B(), p = B(), [u, m] = Ct(aa, {
1864
+ const d = W(), h = W(), [u, m] = Rt(ga, {
1672
1865
  announcement: null
1673
1866
  });
1674
- let h = r;
1675
- typeof h > "u" && (h = a ? ra[a] : "assertive"), z(() => {
1676
- oa({
1867
+ let p = r;
1868
+ typeof p > "u" && (p = a ? pa[a] : "assertive"), z(() => {
1869
+ ya({
1677
1870
  announcementTimeoutRef: d,
1678
1871
  announcementDelay: n,
1679
1872
  children: e,
1680
1873
  clearAnnouncementDelay: o,
1681
- clearAnnouncementTimeoutRef: p,
1874
+ clearAnnouncementTimeoutRef: h,
1682
1875
  onAnnouncementClear: s,
1683
1876
  dispatch: m
1684
1877
  });
@@ -1694,7 +1887,7 @@ function Et({
1694
1887
  return /* @__PURE__ */ c(
1695
1888
  "div",
1696
1889
  {
1697
- "aria-live": h,
1890
+ "aria-live": p,
1698
1891
  ...a && { role: a },
1699
1892
  className: f,
1700
1893
  ...l,
@@ -1715,7 +1908,7 @@ try {
1715
1908
  });
1716
1909
  } catch {
1717
1910
  }
1718
- const sa = (e) => {
1911
+ const ba = (e) => {
1719
1912
  let t = "";
1720
1913
  if (typeof e == "number" || typeof e == "string")
1721
1914
  t = "m-" + e;
@@ -1724,21 +1917,21 @@ const sa = (e) => {
1724
1917
  (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(" ");
1725
1918
  }
1726
1919
  return t;
1727
- }, vt = "av-text-input", ia = "av-text-input-wrapper", Te = "av-text-input-helper-text", xn = "av-text-area", Nn = "av-text-area-wrapper", Cn = "av-text-area-helper-text", Rn = "av-text-area__control--right", On = "av-toggle", ca = ({
1920
+ }, St = "av-text-input", wa = "av-text-input-wrapper", Te = "av-text-input-helper-text", Kn = "av-text-area", Bn = "av-text-area-wrapper", Wn = "av-text-area-helper-text", jn = "av-text-area__control--right", Gn = "av-toggle", Ea = ({
1728
1921
  mode: e
1729
1922
  }) => g({
1730
1923
  "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
1731
1924
  "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
1732
1925
  "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
1733
1926
  "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
1734
- }), la = ({
1927
+ }), va = ({
1735
1928
  focusMode: e
1736
1929
  }) => g("focus:outline focus:outline-2 focus:outline-offset-2", {
1737
1930
  "focus:outline-focus-dark": e === "dark",
1738
1931
  "focus:outline-focus-light": e === "light",
1739
1932
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
1740
1933
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
1741
- }), da = ({
1934
+ }), ka = ({
1742
1935
  noBorder: e,
1743
1936
  error: t
1744
1937
  }) => g("border-2", {
@@ -1746,7 +1939,7 @@ const sa = (e) => {
1746
1939
  "focus:border-border-dark": !e && t,
1747
1940
  "border-border-error-dark": !e && t,
1748
1941
  "border-transparent": e
1749
- }), ua = ({
1942
+ }), Sa = ({
1750
1943
  disabled: e,
1751
1944
  raw: t,
1752
1945
  error: r,
@@ -1770,7 +1963,7 @@ const sa = (e) => {
1770
1963
  "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": a === "system",
1771
1964
  "text-copy-lighter dark:text-copy-error-dark": a === "alt-system"
1772
1965
  });
1773
- }, ma = ({
1966
+ }, Ta = ({
1774
1967
  error: e,
1775
1968
  raw: t,
1776
1969
  mode: r,
@@ -1797,7 +1990,7 @@ const sa = (e) => {
1797
1990
  "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
1798
1991
  "dark:text-copy-error-dark text-copy-error-light bg-surface-darker": r === "alt-system"
1799
1992
  });
1800
- }, ha = ({
1993
+ }, Aa = ({
1801
1994
  className: e,
1802
1995
  inputClassName: t,
1803
1996
  raw: r,
@@ -1810,25 +2003,25 @@ const sa = (e) => {
1810
2003
  }) => {
1811
2004
  const d = r ? e : g(
1812
2005
  "relative flex w-full flex-col justify-center",
1813
- ia,
2006
+ wa,
1814
2007
  e,
1815
- sa(s)
1816
- ), p = r ? g(t) : g(
1817
- vt,
2008
+ ba(s)
2009
+ ), h = r ? g(t) : g(
2010
+ St,
1818
2011
  t,
1819
2012
  "h-12 rounded-md px-4 text-base",
1820
- ca({ mode: i }),
1821
- la({ focusMode: l }),
1822
- da({ noBorder: n, error: o }),
2013
+ Ea({ mode: i }),
2014
+ va({ focusMode: l }),
2015
+ ka({ noBorder: n, error: o }),
1823
2016
  {
1824
2017
  "disabled:cursor-not-allowed disabled:opacity-50": a
1825
2018
  }
1826
- ), u = r ? void 0 : "sr-only", m = ua({
2019
+ ), u = r ? void 0 : "sr-only", m = Sa({
1827
2020
  disabled: a,
1828
2021
  raw: r,
1829
2022
  error: o,
1830
2023
  mode: i
1831
- }), h = ma({
2024
+ }), p = Ta({
1832
2025
  error: o,
1833
2026
  raw: r,
1834
2027
  mode: i,
@@ -1836,13 +2029,13 @@ const sa = (e) => {
1836
2029
  });
1837
2030
  return {
1838
2031
  wrapper: d,
1839
- input: p,
2032
+ input: h,
1840
2033
  accessibleLabel: u,
1841
2034
  visibleLabel: m,
1842
- helperText: h,
2035
+ helperText: p,
1843
2036
  rightElement: r ? void 0 : "absolute right-3"
1844
2037
  };
1845
- }, Re = K.forwardRef(
2038
+ }, Oe = K.forwardRef(
1846
2039
  ({
1847
2040
  id: e,
1848
2041
  name: t,
@@ -1854,85 +2047,85 @@ const sa = (e) => {
1854
2047
  mode: i = "system",
1855
2048
  focusMode: l = "system",
1856
2049
  disabled: d = !1,
1857
- noBorder: p = !1,
2050
+ noBorder: h = !1,
1858
2051
  labelId: u,
1859
2052
  labelHidden: m = !1,
1860
- type: h = "text",
2053
+ type: p = "text",
1861
2054
  helperText: f = "",
1862
- rightElement: b,
1863
- spacing: R,
1864
- ...A
1865
- }, T) => {
1866
- const _ = B(null), [I, j] = U(0), C = ta({ id: e, prefix: `${vt}-` }), G = `${t} error, ${f}`, O = ha({
2055
+ rightElement: w,
2056
+ spacing: x,
2057
+ ...O
2058
+ }, _) => {
2059
+ const S = W(null), [D, C] = U(0), N = ha({ id: e, prefix: `${St}-` }), V = `${t} error, ${f}`, R = Aa({
1867
2060
  className: o,
1868
2061
  inputClassName: s,
1869
2062
  error: a,
1870
2063
  raw: n,
1871
2064
  focusMode: l,
1872
2065
  disabled: d,
1873
- noBorder: p,
1874
- spacing: R,
2066
+ noBorder: h,
2067
+ spacing: x,
1875
2068
  mode: i
1876
2069
  });
1877
- return Rt(() => {
1878
- _.current && j(_.current.offsetWidth + 18 + 10);
1879
- }, []), /* @__PURE__ */ S("div", { className: O.wrapper, children: [
2070
+ return Ot(() => {
2071
+ S.current && C(S.current.offsetWidth + 18 + 10);
2072
+ }, []), /* @__PURE__ */ T("div", { className: R.wrapper, children: [
1880
2073
  /* @__PURE__ */ c(
1881
2074
  "label",
1882
2075
  {
1883
- htmlFor: C,
2076
+ htmlFor: N,
1884
2077
  id: u,
1885
- className: O.accessibleLabel,
2078
+ className: R.accessibleLabel,
1886
2079
  children: r
1887
2080
  }
1888
2081
  ),
1889
2082
  /* @__PURE__ */ c(
1890
2083
  "input",
1891
2084
  {
1892
- ref: T,
1893
- id: C,
2085
+ ref: _,
2086
+ id: N,
1894
2087
  name: t,
1895
- type: h,
2088
+ type: p,
1896
2089
  disabled: d,
1897
2090
  placeholder: n ? void 0 : " ",
1898
- className: O.input,
1899
- ...f && { "aria-describedby": `${C}-helper` },
2091
+ className: R.input,
2092
+ ...f && { "aria-describedby": `${N}-helper` },
1900
2093
  ...a && { "aria-invalid": "true" },
1901
- ...b && !n && { style: { paddingRight: I } },
1902
- ...A
2094
+ ...w && !n && { style: { paddingRight: D } },
2095
+ ...O
1903
2096
  }
1904
2097
  ),
1905
2098
  !n && !m && /* @__PURE__ */ c(
1906
2099
  "label",
1907
2100
  {
1908
2101
  "aria-hidden": !0,
1909
- htmlFor: C,
1910
- className: O.visibleLabel,
2102
+ htmlFor: N,
2103
+ className: R.visibleLabel,
1911
2104
  children: r
1912
2105
  }
1913
2106
  ),
1914
2107
  f && /* @__PURE__ */ c(
1915
2108
  "div",
1916
2109
  {
1917
- id: `${C}-helper`,
1918
- className: O.helperText,
2110
+ id: `${N}-helper`,
2111
+ className: R.helperText,
1919
2112
  children: f
1920
2113
  }
1921
2114
  ),
1922
- b && /* @__PURE__ */ c(
2115
+ w && /* @__PURE__ */ c(
1923
2116
  "div",
1924
2117
  {
1925
- ref: _,
1926
- className: O.rightElement,
1927
- children: b
2118
+ ref: S,
2119
+ className: R.rightElement,
2120
+ children: w
1928
2121
  }
1929
2122
  ),
1930
- a && f && /* @__PURE__ */ c(Et, { politeness: "polite", clearAnnouncementDelay: 500, children: G })
2123
+ a && f && /* @__PURE__ */ c(kt, { politeness: "polite", clearAnnouncementDelay: 500, children: V })
1931
2124
  ] });
1932
2125
  }
1933
2126
  );
1934
- Re.displayName = "TextInput";
1935
- const pa = 500, ga = 5e3, fa = 2e4, kt = K.forwardRef(
2127
+ Oe.displayName = "TextInput";
2128
+ const _a = 500, Ia = 5e3, xa = 2e4, Tt = K.forwardRef(
1936
2129
  ({
1937
2130
  name: e,
1938
2131
  disabled: t,
@@ -1944,78 +2137,78 @@ const pa = 500, ga = 5e3, fa = 2e4, kt = K.forwardRef(
1944
2137
  onFocus: i,
1945
2138
  onTextInputMaskBlur: l,
1946
2139
  rightElement: d,
1947
- spacing: p,
2140
+ spacing: h,
1948
2141
  ...u
1949
2142
  }, m) => {
1950
- const [h, f] = U(!0), [b, R] = U({
2143
+ const [p, f] = U(!0), [w, x] = U({
1951
2144
  message: null,
1952
2145
  politeness: null
1953
- }), A = B(!0), T = B(), _ = B(null), I = ea([m, _]), j = h ? "Show" : "Hide", C = () => {
1954
- clearTimeout(T.current), A.current || (T.current = window.setTimeout(() => {
1955
- A.current = !0, f(!0), R({
1956
- announcementTimeout: ga,
2146
+ }), O = W(!0), _ = W(), S = W(null), D = ma([m, S]), C = p ? "Show" : "Hide", N = () => {
2147
+ clearTimeout(_.current), O.current || (_.current = window.setTimeout(() => {
2148
+ O.current = !0, f(!0), x({
2149
+ announcementTimeout: Ia,
1957
2150
  politeness: "polite",
1958
2151
  message: `${r} hiding characters`
1959
2152
  }), n && n(!0);
1960
- }, fa));
1961
- }, G = (w) => {
1962
- w.preventDefault();
1963
- const x = !A.current;
1964
- A.current = x, C(), f(x), R({
1965
- announcementTimeout: pa,
2153
+ }, xa));
2154
+ }, V = (b) => {
2155
+ b.preventDefault();
2156
+ const A = !O.current;
2157
+ O.current = A, N(), f(A), x({
2158
+ announcementTimeout: _a,
1966
2159
  politeness: "assertive",
1967
- message: x ? "Characters hidden" : "Characters showing"
1968
- }), n && n(x);
1969
- }, O = (w) => {
1970
- var x;
1971
- const { relatedTarget: V } = w, X = (x = _.current) == null ? void 0 : x.parentElement;
1972
- X != null && X.contains(V) || l && l();
1973
- }, y = (w) => {
1974
- C(), s && s(w), O(w);
1975
- }, M = (w) => {
1976
- C(), i && i(w);
1977
- }, D = (w) => {
1978
- C(), o && o(w);
2160
+ message: A ? "Characters hidden" : "Characters showing"
2161
+ }), n && n(A);
2162
+ }, R = (b) => {
2163
+ var A;
2164
+ const { relatedTarget: B } = b, G = (A = S.current) == null ? void 0 : A.parentElement;
2165
+ G != null && G.contains(B) || l && l();
2166
+ }, fe = (b) => {
2167
+ N(), s && s(b), R(b);
2168
+ }, y = (b) => {
2169
+ N(), i && i(b);
2170
+ }, $ = (b) => {
2171
+ N(), o && o(b);
1979
2172
  };
1980
2173
  return z(() => () => {
1981
- clearTimeout(T.current);
1982
- }, []), /* @__PURE__ */ S(q, { children: [
2174
+ clearTimeout(_.current);
2175
+ }, []), /* @__PURE__ */ T(q, { children: [
1983
2176
  /* @__PURE__ */ c(
1984
- Re,
2177
+ Oe,
1985
2178
  {
1986
- ref: I,
2179
+ ref: D,
1987
2180
  name: e,
1988
2181
  label: r,
1989
2182
  labelHidden: a,
1990
- type: h ? "password" : "text",
2183
+ type: p ? "password" : "text",
1991
2184
  disabled: t,
1992
- spacing: p,
1993
- onBlur: y,
1994
- onFocus: M,
1995
- onChange: D,
2185
+ spacing: h,
2186
+ onBlur: fe,
2187
+ onFocus: y,
2188
+ onChange: $,
1996
2189
  rightElement: K.cloneElement(d, {
1997
2190
  ref: m,
1998
- label: j,
1999
- onClick: G,
2000
- onBlur: O,
2191
+ label: C,
2192
+ onClick: V,
2193
+ onBlur: R,
2001
2194
  disabled: t
2002
2195
  }),
2003
2196
  ...u
2004
2197
  }
2005
2198
  ),
2006
2199
  /* @__PURE__ */ c(
2007
- Et,
2200
+ kt,
2008
2201
  {
2009
2202
  role: "status",
2010
- politeness: b.politeness,
2011
- clearAnnouncementDelay: b.announcementTimeout,
2012
- children: b.message
2203
+ politeness: w.politeness,
2204
+ clearAnnouncementDelay: w.announcementTimeout,
2205
+ children: w.message
2013
2206
  }
2014
2207
  )
2015
2208
  ] });
2016
2209
  }
2017
2210
  );
2018
- kt.displayName = "TextInputMask";
2211
+ Tt.displayName = "TextInputMask";
2019
2212
  /*!
2020
2213
  @versini/ui-form v1.3.5
2021
2214
  © 2024 gizmette.com
@@ -2029,7 +2222,7 @@ try {
2029
2222
  });
2030
2223
  } catch {
2031
2224
  }
2032
- const ya = (e) => {
2225
+ const Na = (e) => {
2033
2226
  let t = "";
2034
2227
  if (typeof e == "number" || typeof e == "string")
2035
2228
  t = "m-" + e;
@@ -2038,7 +2231,7 @@ const ya = (e) => {
2038
2231
  (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(" ");
2039
2232
  }
2040
2233
  return t;
2041
- }, Oe = ({
2234
+ }, De = ({
2042
2235
  children: e,
2043
2236
  fill: t,
2044
2237
  viewBox: r,
@@ -2050,11 +2243,11 @@ const ya = (e) => {
2050
2243
  semantic: l = !1,
2051
2244
  ...d
2052
2245
  }) => {
2053
- const p = ya(s), u = g(
2054
- p,
2246
+ const h = Na(s), u = g(
2247
+ h,
2055
2248
  a || o
2056
2249
  );
2057
- return /* @__PURE__ */ S(q, { children: [
2250
+ return /* @__PURE__ */ T(q, { children: [
2058
2251
  /* @__PURE__ */ c(
2059
2252
  "svg",
2060
2253
  {
@@ -2085,13 +2278,13 @@ try {
2085
2278
  });
2086
2279
  } catch {
2087
2280
  }
2088
- const ba = ({
2281
+ const Ca = ({
2089
2282
  className: e,
2090
2283
  viewBox: t,
2091
2284
  spacing: r,
2092
2285
  ...a
2093
2286
  }) => /* @__PURE__ */ c(
2094
- Oe,
2287
+ De,
2095
2288
  {
2096
2289
  defaultViewBox: "0 0 1200 500",
2097
2290
  defaultClassName: "w-full",
@@ -2110,15 +2303,15 @@ const ba = ({
2110
2303
  }
2111
2304
  ) })
2112
2305
  }
2113
- ), wa = ({
2306
+ ), Ra = ({
2114
2307
  className: e,
2115
2308
  viewBox: t,
2116
2309
  spacing: r,
2117
2310
  title: a,
2118
2311
  monotone: n,
2119
2312
  ...o
2120
- }) => /* @__PURE__ */ S(
2121
- Oe,
2313
+ }) => /* @__PURE__ */ T(
2314
+ De,
2122
2315
  {
2123
2316
  defaultViewBox: "0 0 640 512",
2124
2317
  defaultClassName: "size-5",
@@ -2138,15 +2331,15 @@ const ba = ({
2138
2331
  /* @__PURE__ */ c("path", { d: "M5.1 9.2C13.3-1.2 28.4-3.1 38.8 5.1l592 464c10.4 8.2 12.3 23.3 4.1 33.7s-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2z" })
2139
2332
  ]
2140
2333
  }
2141
- ), Ea = ({
2334
+ ), Oa = ({
2142
2335
  className: e,
2143
2336
  viewBox: t,
2144
2337
  spacing: r,
2145
2338
  title: a,
2146
2339
  monotone: n,
2147
2340
  ...o
2148
- }) => /* @__PURE__ */ S(
2149
- Oe,
2341
+ }) => /* @__PURE__ */ T(
2342
+ De,
2150
2343
  {
2151
2344
  defaultViewBox: "0 0 576 512",
2152
2345
  defaultClassName: "size-5",
@@ -2180,7 +2373,7 @@ try {
2180
2373
  });
2181
2374
  } catch {
2182
2375
  }
2183
- const va = (e) => {
2376
+ const Da = (e) => {
2184
2377
  let t = "";
2185
2378
  if (typeof e == "number" || typeof e == "string")
2186
2379
  t = "m-" + e;
@@ -2189,10 +2382,10 @@ const va = (e) => {
2189
2382
  (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(" ");
2190
2383
  }
2191
2384
  return t;
2192
- }, ka = "av-flexgrid", ie = "av-flexgrid-item", me = 0.25, St = K.createContext({
2385
+ }, $a = "av-flexgrid", se = "av-flexgrid-item", ue = 0.25, At = K.createContext({
2193
2386
  columnGap: 0,
2194
2387
  rowGap: 0
2195
- }), Sa = ({
2388
+ }), Ma = ({
2196
2389
  children: e,
2197
2390
  className: t,
2198
2391
  columnGap: r = 1,
@@ -2203,7 +2396,7 @@ const va = (e) => {
2203
2396
  alignHorizontal: i = "normal",
2204
2397
  alignVertical: l = "normal",
2205
2398
  spacing: d,
2206
- ...p
2399
+ ...h
2207
2400
  }) => {
2208
2401
  const u = {
2209
2402
  flexDirection: s,
@@ -2216,14 +2409,14 @@ const va = (e) => {
2216
2409
  * by the columnGap and rowGap that will be applied
2217
2410
  * to all FlexgridItems (see context and paddings).
2218
2411
  */
2219
- marginLeft: r * -1 * me + "rem",
2220
- marginTop: a * -1 * me + "rem"
2412
+ marginLeft: r * -1 * ue + "rem",
2413
+ marginTop: a * -1 * ue + "rem"
2221
2414
  }, m = g(
2222
- ka,
2415
+ $a,
2223
2416
  t,
2224
2417
  "box-border flex flex-wrap"
2225
- ), h = { columnGap: r, rowGap: a }, f = d ? "div" : K.Fragment;
2226
- return /* @__PURE__ */ c(f, { ...d ? { className: va(d) } : {}, children: /* @__PURE__ */ c("div", { className: m, style: u, ...p, children: /* @__PURE__ */ c(St.Provider, { value: h, children: e }) }) });
2418
+ ), p = { columnGap: r, rowGap: a }, f = d ? "div" : K.Fragment;
2419
+ return /* @__PURE__ */ c(f, { ...d ? { className: Da(d) } : {}, children: /* @__PURE__ */ c("div", { className: m, style: u, ...h, children: /* @__PURE__ */ c(At.Provider, { value: p, children: e }) }) });
2227
2420
  }, Ae = (e, t) => g({
2228
2421
  "basis-1/12": e === 1 && !t,
2229
2422
  "sm:basis-1/12": e === 1 && t === "sm",
@@ -2297,39 +2490,39 @@ const va = (e) => {
2297
2490
  "lg:basis-full": e === 12 && t === "lg",
2298
2491
  "xl:basis-full": e === 12 && t === "xl",
2299
2492
  "2xl:basis-full": e === 12 && t === "2xl"
2300
- }), Ta = ({
2493
+ }), La = ({
2301
2494
  className: e,
2302
2495
  span: t
2303
2496
  }) => {
2304
2497
  if (!t)
2305
- return g(e, ie, "box-border basis-auto");
2498
+ return g(e, se, "box-border basis-auto");
2306
2499
  if (typeof t == "number")
2307
- return g(e, ie, "box-border max-w-full", {
2500
+ return g(e, se, "box-border max-w-full", {
2308
2501
  [`${Ae(t)}`]: !0
2309
2502
  });
2310
2503
  if (typeof t == "string")
2311
- return g(e, ie, "box-border basis-auto", {
2504
+ return g(e, se, "box-border basis-auto", {
2312
2505
  "max-w-full grow": t === "auto"
2313
2506
  });
2314
2507
  if (typeof t == "object") {
2315
2508
  const r = Object.entries(t).map(([a, n]) => a === "fallback" ? Ae(n) : Ae(n, a));
2316
2509
  return g(
2317
2510
  e,
2318
- ie,
2511
+ se,
2319
2512
  "box-border",
2320
2513
  r
2321
2514
  );
2322
2515
  }
2323
- }, ce = ({
2516
+ }, ie = ({
2324
2517
  children: e,
2325
2518
  className: t,
2326
2519
  span: r,
2327
2520
  ...a
2328
2521
  }) => {
2329
- const { columnGap: n, rowGap: o } = Xe(St), s = {
2330
- paddingLeft: n * me + "rem",
2331
- paddingTop: o * me + "rem"
2332
- }, i = Ta({
2522
+ const { columnGap: n, rowGap: o } = Ze(At), s = {
2523
+ paddingLeft: n * ue + "rem",
2524
+ paddingTop: o * ue + "rem"
2525
+ }, i = La({
2333
2526
  className: t,
2334
2527
  span: r
2335
2528
  });
@@ -2348,7 +2541,7 @@ try {
2348
2541
  });
2349
2542
  } catch {
2350
2543
  }
2351
- const Aa = "ASK! ME! ANYTHING!", Tt = "Sassy Saint", _a = "gizmette.com", Ia = "Log in", Dn = "Log out", xa = "Password", Na = "Powered by OpenAI", Mn = "Send", $n = "Profile", Ln = "Statistics", Pn = "Chat history", Un = "About", Hn = "Type your question here", Kn = "Clear chat", Bn = "Cancel chat", Wn = "N/A", jn = {
2544
+ const Pa = "ASK! ME! ANYTHING!", _t = "Sassy Saint", Ua = "gizmette.com", Ha = "Log in", Vn = "Log out", Ka = "Password", Ba = "Powered by OpenAI", Jn = "Send", Fn = "Profile", zn = "Statistics", Yn = "Chat history", qn = "About", Qn = "Type your question here", Xn = "Clear chat", Zn = "Cancel chat", eo = "N/A", to = {
2352
2545
  PREFERENCES: {
2353
2546
  TITLE: "User preferences",
2354
2547
  NAME: "Name",
@@ -2380,215 +2573,44 @@ const Aa = "ASK! ME! ANYTHING!", Tt = "Sassy Saint", _a = "gizmette.com", Ia = "
2380
2573
  ENGINE: "OpenAI model",
2381
2574
  PLUGIN: "Plugin"
2382
2575
  }
2383
- }, Qe = (e) => Number.isFinite(e) ? e : 0;
2384
- function Ca(e) {
2385
- return {
2386
- days: Math.trunc(e / 864e5),
2387
- hours: Math.trunc(e / 36e5 % 24),
2388
- minutes: Math.trunc(e / 6e4 % 60),
2389
- seconds: Math.trunc(e / 1e3 % 60),
2390
- milliseconds: Math.trunc(e % 1e3),
2391
- microseconds: Math.trunc(Qe(e * 1e3) % 1e3),
2392
- nanoseconds: Math.trunc(Qe(e * 1e6) % 1e3)
2393
- };
2394
- }
2395
- function Ra(e) {
2396
- return {
2397
- days: e / 86400000n,
2398
- hours: e / 3600000n % 24n,
2399
- minutes: e / 60000n % 60n,
2400
- seconds: e / 1000n % 60n,
2401
- milliseconds: e % 1000n,
2402
- microseconds: 0n,
2403
- nanoseconds: 0n
2404
- };
2405
- }
2406
- function Oa(e) {
2407
- switch (typeof e) {
2408
- case "number": {
2409
- if (Number.isFinite(e))
2410
- return Ca(e);
2411
- break;
2412
- }
2413
- case "bigint":
2414
- return Ra(e);
2415
- }
2416
- throw new TypeError("Expected a finite number or bigint");
2417
- }
2418
- const Da = (e) => e === 0 || e === 0n, Ma = (e, t) => t === 1 || t === 1n ? e : `${e}s`, $a = 1e-7, La = 24n * 60n * 60n * 1000n;
2419
- function Pa(e, t) {
2420
- const r = typeof e == "bigint";
2421
- if (!r && !Number.isFinite(e))
2422
- throw new TypeError("Expected a finite number or bigint");
2423
- 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);
2424
- let a = [];
2425
- const n = (d, p) => {
2426
- const u = Math.floor(d * 10 ** p + $a);
2427
- return (Math.round(u) / 10 ** p).toFixed(p);
2428
- }, o = (d, p, u, m) => {
2429
- if (!((a.length === 0 || !t.colonNotation) && Da(d) && !(t.colonNotation && u === "m"))) {
2430
- if (m = m ?? String(d), t.colonNotation) {
2431
- const h = m.includes(".") ? m.split(".")[0].length : m.length, f = a.length > 0 ? 2 : 1;
2432
- m = "0".repeat(Math.max(0, f - h)) + m;
2433
- } else
2434
- m += t.verbose ? " " + Ma(p, d) : u;
2435
- a.push(m);
2436
- }
2437
- }, s = Oa(e), i = BigInt(s.days);
2438
- if (o(i / 365n, "year", "y"), o(i % 365n, "day", "d"), o(Number(s.hours), "hour", "h"), o(Number(s.minutes), "minute", "m"), t.separateMilliseconds || t.formatSubMilliseconds || !t.colonNotation && e < 1e3) {
2439
- const d = Number(s.seconds), p = Number(s.milliseconds), u = Number(s.microseconds), m = Number(s.nanoseconds);
2440
- if (o(d, "second", "s"), t.formatSubMilliseconds)
2441
- o(p, "millisecond", "ms"), o(u, "microsecond", "µs"), o(m, "nanosecond", "ns");
2442
- else {
2443
- const h = p + u / 1e3 + m / 1e6, f = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, b = h >= 1 ? Math.round(h) : Math.ceil(h), R = f ? h.toFixed(f) : b;
2444
- o(
2445
- Number.parseFloat(R),
2446
- "millisecond",
2447
- "ms",
2448
- R
2449
- );
2450
- }
2451
- } else {
2452
- const d = (r ? Number(e % La) : e) / 1e3 % 60, p = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, u = n(d, p), m = t.keepDecimalsOnWholeSeconds ? u : u.replace(/\.0+$/, "");
2453
- o(Number.parseFloat(m), "second", "s", m);
2454
- }
2455
- if (a.length === 0)
2456
- return "0" + (t.verbose ? " milliseconds" : "ms");
2457
- const l = t.colonNotation ? ":" : " ";
2458
- return typeof t.unitCount == "number" && (a = a.slice(0, Math.max(t.unitCount, 1))), a.join(l);
2459
- }
2460
- const Ua = process.env.NODE_ENV === "production", At = !Ua, Gn = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, _t = (e, t) => {
2461
- const r = e < 0 ? t ? "W" : "S" : t ? "E" : "N", a = 0 | Math.abs(e), n = 0 | Math.abs(e) * 60 % 60, o = (0 | Math.abs(e) * 60 % 1 * 6e3) / 100;
2462
- return {
2463
- dir: r,
2464
- deg: a,
2465
- min: n,
2466
- sec: o
2467
- };
2468
- }, Vn = (e) => {
2469
- if (!e && e !== 0)
2470
- return "N/A";
2471
- const t = _t(e, !1);
2472
- return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
2473
- }, Jn = (e) => {
2474
- if (!e && e !== 0)
2475
- return "N/A";
2476
- const t = _t(e, !0);
2477
- return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
2478
- }, Fn = async () => {
2479
- const e = {
2480
- /**
2481
- * A boolean value that indicates the application would
2482
- * like to receive the best possible results. If true
2483
- * and if the device is able to provide a more accurate
2484
- * position, it will do so. Note that this can result in
2485
- * slower response times or increased power consumption
2486
- * (with a GPS chip on a mobile device for example). On
2487
- * the other hand, if false, the device can take the
2488
- * liberty to save resources by responding more quickly
2489
- * and/or using less power. Default: false.
2490
- */
2491
- enableHighAccuracy: !1,
2492
- /**
2493
- * A positive long value representing the maximum length
2494
- * of time (in milliseconds) the device is allowed to
2495
- * take in order to return a position. The default value
2496
- * is Infinity, meaning that getCurrentPosition() won't
2497
- * return until the position is available.
2498
- */
2499
- timeout: 1e4,
2500
- /**
2501
- * A positive long value indicating the maximum age in
2502
- * milliseconds of a possible cached position that is
2503
- * acceptable to return. If set to 0, it means that the
2504
- * device cannot use a cached position and must attempt
2505
- * to retrieve the real current position. If set to
2506
- * Infinity the device must return a cached position
2507
- * regardless of its age. Default: 0.
2508
- */
2509
- maximumAge: 6e4
2510
- };
2511
- return new Promise((t, r) => {
2512
- var a;
2513
- (a = navigator == null ? void 0 : navigator.geolocation) == null || a.getCurrentPosition(
2514
- (n) => {
2515
- t({
2516
- latitude: n.coords.latitude,
2517
- longitude: n.coords.longitude,
2518
- accuracy: n.coords.accuracy
2519
- });
2520
- },
2521
- (n) => {
2522
- r(n);
2523
- },
2524
- e
2525
- );
2526
- });
2527
- }, zn = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ c("dl", { className: "my-0", children: /* @__PURE__ */ S("div", { className: "flex items-center justify-between", children: [
2528
- /* @__PURE__ */ c("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
2529
- /* @__PURE__ */ c("dd", { className: "inline-block", children: t[r] })
2530
- ] }) }, `${e}-${r}`)) : null;
2531
- function Yn({
2532
- data: e,
2533
- formatter: t = (r) => r
2534
- }) {
2535
- const r = e.filter(
2536
- (n) => typeof n == "number" && n > 0
2537
- ), a = r.reduce(
2538
- (n, o) => (n || 0) + (o || 0),
2539
- 0
2540
- );
2541
- return t(a ? a / r.length : 0);
2542
- }
2543
- const qn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, Qn = new Intl.NumberFormat("en", {
2544
- style: "decimal",
2545
- signDisplay: "never",
2546
- minimumFractionDigits: 0,
2547
- maximumFractionDigits: 0
2548
- }), Xn = (e) => Pa(e, {
2549
- secondsDecimalDigits: 2,
2550
- unitCount: 2
2551
- }), Ha = (e) => g(
2552
- "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",
2553
- e || At ? "pt-4" : "pt-10"
2554
- ), Zn = (e, t) => t === 1 ? e : `${e}s`, Ka = ({
2576
+ }, Wa = ({
2555
2577
  serverStats: e
2556
2578
  }) => /* @__PURE__ */ c(
2557
- Xr,
2579
+ da,
2558
2580
  {
2559
2581
  mode: "light",
2560
- row1: /* @__PURE__ */ S("div", { children: [
2561
- Tt,
2582
+ row1: /* @__PURE__ */ T("div", { children: [
2583
+ _t,
2562
2584
  " v",
2563
- "3.1.1",
2585
+ "3.2.1",
2564
2586
  " - ",
2565
- Na,
2566
- At && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
2587
+ Ba,
2588
+ Ne && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
2567
2589
  ] }),
2568
- row2: /* @__PURE__ */ S("div", { children: [
2590
+ row2: /* @__PURE__ */ T("div", { children: [
2569
2591
  "© ",
2570
2592
  (/* @__PURE__ */ new Date()).getFullYear(),
2571
2593
  " ",
2572
- _a
2594
+ Ua
2573
2595
  ] })
2574
2596
  }
2575
- ), Ba = Ze(() => import("./LazyHeader.IkHWXL63.js")), Wa = () => {
2597
+ ), ja = et(() => import("./LazyHeader.D3qbUck7.js")), Ga = () => {
2576
2598
  const { isAuthenticated: e } = xe();
2577
- return /* @__PURE__ */ S(q, { children: [
2578
- e && /* @__PURE__ */ c(et, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Ba, {}) }),
2579
- /* @__PURE__ */ S("div", { className: "flex items-center justify-center", children: [
2580
- /* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(ba, {}) }),
2581
- /* @__PURE__ */ S("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
2582
- /* @__PURE__ */ c("h1", { children: Tt }),
2583
- /* @__PURE__ */ c("h2", { children: Aa })
2599
+ return /* @__PURE__ */ T(q, { children: [
2600
+ e && /* @__PURE__ */ c(tt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(ja, {}) }),
2601
+ /* @__PURE__ */ T("div", { className: "flex items-center justify-center", children: [
2602
+ /* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(Ca, {}) }),
2603
+ /* @__PURE__ */ T("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
2604
+ /* @__PURE__ */ c("h1", { children: _t }),
2605
+ /* @__PURE__ */ c("h2", { children: Pa })
2584
2606
  ] })
2585
2607
  ] })
2586
2608
  ] });
2587
- }, ja = () => {
2609
+ }, Va = () => {
2588
2610
  const { login: e, logoutReason: t } = xe(), [r, a] = U(""), [n, o] = U(""), [s, i] = U(!0), [l, d] = U({
2589
2611
  username: "",
2590
2612
  password: ""
2591
- }), p = async (u) => {
2613
+ }), h = async (u) => {
2592
2614
  u.preventDefault(), await e(
2593
2615
  l.username,
2594
2616
  l.password,
@@ -2603,13 +2625,13 @@ const qn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2603
2625
  }, 500);
2604
2626
  }), z(() => {
2605
2627
  t && o(t);
2606
- }, [t]), /* @__PURE__ */ S(q, { children: [
2607
- /* @__PURE__ */ S(Zr, { children: [
2608
- /* @__PURE__ */ c("div", { className: Ha(), children: /* @__PURE__ */ c(Wa, {}) }),
2609
- /* @__PURE__ */ c("form", { className: "mx-auto mt-5", onSubmit: p, children: /* @__PURE__ */ S(Sa, { rowGap: 7, width: "350px", children: [
2610
- /* @__PURE__ */ c(ce, { span: 12, children: n && /* @__PURE__ */ c("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: n }) }),
2611
- /* @__PURE__ */ c(ce, { span: 12, children: /* @__PURE__ */ c(
2612
- Re,
2628
+ }, [t]), /* @__PURE__ */ T(q, { children: [
2629
+ /* @__PURE__ */ T(ua, { children: [
2630
+ /* @__PURE__ */ c("div", { className: Zr(), children: /* @__PURE__ */ c(Ga, {}) }),
2631
+ /* @__PURE__ */ c("form", { className: "mx-auto mt-5", onSubmit: h, children: /* @__PURE__ */ T(Ma, { rowGap: 7, width: "350px", children: [
2632
+ /* @__PURE__ */ c(ie, { span: 12, children: n && /* @__PURE__ */ c("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: n }) }),
2633
+ /* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
2634
+ Oe,
2613
2635
  {
2614
2636
  required: !0,
2615
2637
  autoCapitalize: "off",
@@ -2628,8 +2650,8 @@ const qn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2628
2650
  error: r !== ""
2629
2651
  }
2630
2652
  ) }),
2631
- /* @__PURE__ */ c(ce, { span: 12, children: /* @__PURE__ */ c(
2632
- kt,
2653
+ /* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
2654
+ Tt,
2633
2655
  {
2634
2656
  required: !0,
2635
2657
  autoCapitalize: "off",
@@ -2638,8 +2660,8 @@ const qn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2638
2660
  mode: "dark",
2639
2661
  focusMode: "light",
2640
2662
  name: "password",
2641
- label: xa,
2642
- rightElement: /* @__PURE__ */ c(ft, { focusMode: "light", children: s ? /* @__PURE__ */ c(Ea, {}) : /* @__PURE__ */ c(wa, {}) }),
2663
+ label: Ka,
2664
+ rightElement: /* @__PURE__ */ c(bt, { focusMode: "light", children: s ? /* @__PURE__ */ c(Oa, {}) : /* @__PURE__ */ c(Ra, {}) }),
2643
2665
  onMaskChange: i,
2644
2666
  onChange: (u) => {
2645
2667
  d({
@@ -2651,99 +2673,100 @@ const qn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
2651
2673
  helperText: r
2652
2674
  }
2653
2675
  ) }),
2654
- /* @__PURE__ */ c(ce, { span: 12, children: /* @__PURE__ */ c(
2655
- yt,
2676
+ /* @__PURE__ */ c(ie, { span: 12, children: /* @__PURE__ */ c(
2677
+ wt,
2656
2678
  {
2657
2679
  focusMode: "light",
2658
2680
  fullWidth: !0,
2659
2681
  noBorder: !0,
2660
2682
  type: "submit",
2661
2683
  className: "mb-4 mt-6",
2662
- children: Ia
2684
+ children: Ha
2663
2685
  }
2664
2686
  ) })
2665
2687
  ] }) })
2666
2688
  ] }),
2667
- /* @__PURE__ */ c(Ka, {})
2689
+ /* @__PURE__ */ c(Wa, {})
2668
2690
  ] });
2669
- }, Ga = Ze(() => import("./App.cLV1bpwK.js").then((e) => e.App)), Va = ({ isComponent: e }) => {
2691
+ }, Ja = et(() => import("./App.pFoMWtnP.js").then((e) => e.App)), Fa = ({ isComponent: e }) => {
2670
2692
  const { isAuthenticated: t } = xe();
2671
- return t ? /* @__PURE__ */ c(et, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Ga, { isComponent: e }) }) : /* @__PURE__ */ c(ja, {});
2672
- }, Ja = ({
2673
- isComponent: e = !1
2674
- }) => /* @__PURE__ */ c(q, { children: /* @__PURE__ */ c(Kr, { clientId: Br, children: /* @__PURE__ */ c(Va, { isComponent: e }) }) }), eo = () => /* @__PURE__ */ c(Ja, { isComponent: !0 });
2693
+ return t ? /* @__PURE__ */ c(tt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Ja, { isComponent: e }) }) : /* @__PURE__ */ c(Va, {});
2694
+ }, za = ({
2695
+ isComponent: e = !1,
2696
+ domain: t = Xr
2697
+ }) => /* @__PURE__ */ c(q, { children: /* @__PURE__ */ c(Br, { clientId: Wr, domain: t, children: /* @__PURE__ */ c(Fa, { isComponent: e }) }) }), ro = ({ domain: e }) => /* @__PURE__ */ c(za, { isComponent: !0, domain: e });
2675
2698
  export {
2676
- gt as A,
2677
- Un as ABOUT_TITLE,
2678
- hn as ACTION_LOCATION,
2679
- ln as ACTION_MESSAGE,
2680
- un as ACTION_MODEL,
2681
- dn as ACTION_RESET,
2682
- mn as ACTION_RESTORE,
2683
- gn as ACTION_SEARCH,
2684
- fn as ACTION_SORT,
2685
- pn as ACTION_STREAMING,
2686
- Ka as AppFooter,
2687
- Bn as CANCEL,
2688
- jn as CARDS,
2689
- Kn as CLEAR,
2690
- Tn as E,
2691
- on as ERROR_MESSAGE,
2692
- Re as G,
2693
- cn as GPT4_MAX_TOKENS,
2694
- Pn as HISTORY_TITLE,
2695
- bn as LOCAL_STORAGE_CHAT_DETAILS,
2696
- vn as LOCAL_STORAGE_LOCATION,
2697
- yn as LOCAL_STORAGE_PREFIX,
2698
- wn as LOCAL_STORAGE_SEARCH,
2699
- En as LOCAL_STORAGE_SORT,
2700
- Dn as LOG_OUT,
2701
- ta as M,
2702
- sn as MODEL_GPT4,
2703
- Wa as MessagesContainerHeader,
2704
- An as N,
2705
- Wn as NA,
2706
- ft as O,
2707
- $n as PROFILE_TITLE,
2708
- tn as ROLE_ASSISTANT,
2709
- nn as ROLE_HIDDEN,
2710
- an as ROLE_INTERNAL,
2711
- rn as ROLE_SYSTEM,
2712
- en as ROLE_USER,
2713
- Ne as S,
2714
- Mn as SEND,
2715
- Ln as STATS,
2716
- kn as STATS_SEPARATOR,
2717
- eo as SassySaint,
2718
- Hn as TYPE_QUESTION,
2719
- Et as U,
2720
- Cn as a,
2721
- Sa as b,
2722
- Zr as c,
2723
- In as c$1,
2724
- Vn as convertLatitudeToDMS,
2725
- Jn as convertLongitudeToDMS,
2726
- Xn as durationFormatter,
2727
- Yn as extractAverage,
2728
- ht as f,
2729
- ea as f$1,
2730
- Oe as g,
2731
- Fn as getCurrentGeoLocation,
2732
- Ha as getMessageContaintWrapperClass,
2733
- Ce as i,
2734
- _n as i$1,
2735
- qn as isLastMessageFromRole,
2736
- ce as j,
2737
- Rn as l,
2738
- xn as n,
2739
- Qn as numberFormatter,
2740
- sa as o,
2741
- On as p,
2742
- Zn as pluralize,
2743
- Nn as r,
2744
- zn as renderDataAsList,
2745
- Sn as s,
2746
- Gn as truncate,
2747
- xe as ur,
2748
- yt as x
2699
+ yt as A,
2700
+ qn as ABOUT_TITLE,
2701
+ gn as ACTION_LOCATION,
2702
+ un as ACTION_MESSAGE,
2703
+ hn as ACTION_MODEL,
2704
+ mn as ACTION_RESET,
2705
+ pn as ACTION_RESTORE,
2706
+ yn as ACTION_SEARCH,
2707
+ bn as ACTION_SORT,
2708
+ fn as ACTION_STREAMING,
2709
+ Wa as AppFooter,
2710
+ Zn as CANCEL,
2711
+ to as CARDS,
2712
+ Xn as CLEAR,
2713
+ Ln as E,
2714
+ cn as ERROR_MESSAGE,
2715
+ Oe as G,
2716
+ dn as GPT4_MAX_TOKENS,
2717
+ Yn as HISTORY_TITLE,
2718
+ En as LOCAL_STORAGE_CHAT_DETAILS,
2719
+ Sn as LOCAL_STORAGE_LOCATION,
2720
+ wn as LOCAL_STORAGE_PREFIX,
2721
+ vn as LOCAL_STORAGE_SEARCH,
2722
+ kn as LOCAL_STORAGE_SORT,
2723
+ Vn as LOG_OUT,
2724
+ ha as M,
2725
+ ln as MODEL_GPT4,
2726
+ Ga as MessagesContainerHeader,
2727
+ Pn as N,
2728
+ eo as NA,
2729
+ bt as O,
2730
+ Fn as PROFILE_TITLE,
2731
+ an as ROLE_ASSISTANT,
2732
+ sn as ROLE_HIDDEN,
2733
+ on as ROLE_INTERNAL,
2734
+ nn as ROLE_SYSTEM,
2735
+ rn as ROLE_USER,
2736
+ Ce as S,
2737
+ Jn as SEND,
2738
+ zn as STATS,
2739
+ Tn as STATS_SEPARATOR,
2740
+ ro as SassySaint,
2741
+ Qn as TYPE_QUESTION,
2742
+ kt as U,
2743
+ Wn as a,
2744
+ Ma as b,
2745
+ ua as c,
2746
+ Hn as c$1,
2747
+ _n as convertLatitudeToDMS,
2748
+ In as convertLongitudeToDMS,
2749
+ xe as dr,
2750
+ Dn as durationFormatter,
2751
+ Cn as extractAverage,
2752
+ gt as f,
2753
+ ma as f$1,
2754
+ De as g,
2755
+ xn as getCurrentGeoLocation,
2756
+ Zr as getMessageContaintWrapperClass,
2757
+ Re as i,
2758
+ Un as i$1,
2759
+ Rn as isLastMessageFromRole,
2760
+ ie as j,
2761
+ jn as l,
2762
+ Kn as n,
2763
+ On as numberFormatter,
2764
+ ba as o,
2765
+ Gn as p,
2766
+ $n as pluralize,
2767
+ Bn as r,
2768
+ Nn as renderDataAsList,
2769
+ Mn as s,
2770
+ An as truncate,
2771
+ wt as x
2749
2772
  };