@versini/sassysaint 8.25.1 → 8.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,24 @@
1
- import { jsxs as C, jsx as l } from "react/jsx-runtime";
2
- import { n as Te, LOCAL_STORAGE_PREFIX as Ne, LOCAL_STORAGE_CHAT_DETAILS as ve, SETTINGS_TITLE as we, S as G, CARDS as U, APP_NAME as _e, C as Z, PROMPTS_DESCRIPTION as Ce, L as Ae, j as ne, getCurrentGeoLocation as Ie } from "./index.Ryu4fNCl.js";
3
- import { useUserPreferences as Se, E as Le, rr as Re, mutateCall as le, SERVICE_TYPES as se } from "./App.BeMVpu5U.js";
4
- import Me, { useRef as w, useState as x, useLayoutEffect as $, useMemo as de, useEffect as V, useId as Oe, useReducer as De, useCallback as Pe } from "react";
1
+ import { jsxs as N, jsx as l } from "react/jsx-runtime";
2
+ import { n as ve, LOCAL_STORAGE_PREFIX as se, LOCAL_STORAGE_CHAT_DETAILS as _e, LOCAL_STORAGE_SERVICE_WORKER as we, isServiceWorkerEnabled as Ce, isStandaloneMode as Se, SETTINGS_TITLE as Ie, S as U, CARDS as P, APP_NAME as Ae, C as ae, PROMPTS_DESCRIPTION as Re, L as Le, j as ce, getCurrentGeoLocation as Oe, handleServiceWorkerToggle as Me } from "./index.CJ4xsAr8.js";
3
+ import { useUserPreferences as De, E as ie, rr as Pe, mutateCall as de, SERVICE_TYPES as ue } from "./App.DDDRpI9p.js";
4
+ import Ge, { useRef as v, useState as y, useLayoutEffect as z, useMemo as pe, useEffect as j, useId as Be, useReducer as He, useCallback as Ve } from "react";
5
5
  import i from "clsx";
6
- const ue = "av-text-area", Be = "av-text-area-wrapper", ee = "av-text-area-helper-text", He = "av-text-area__control--right", Ge = "av-text-area__control--left";
7
- function Ue() {
8
- const e = w(!1);
9
- return V(() => (e.current = !0, () => {
6
+ const he = "av-text-area", Ue = "av-text-area-wrapper", oe = "av-text-area-helper-text", $e = "av-text-area__control--right", Fe = "av-text-area__control--left";
7
+ function We() {
8
+ const e = v(!1);
9
+ return j(() => (e.current = !0, () => {
10
10
  e.current = !1;
11
- }), []), Pe(() => e.current, []);
11
+ }), []), Ve(() => e.current, []);
12
12
  }
13
- function $e(e) {
14
- return de(() => e.every((r) => r == null) ? () => {
13
+ function ze(e) {
14
+ return pe(() => e.every((r) => r == null) ? () => {
15
15
  } : (r) => {
16
16
  e.forEach((a) => {
17
17
  typeof a == "function" ? a(r) : a != null && (a.current = r);
18
18
  });
19
19
  }, [...e]);
20
20
  }
21
- const Ve = {
21
+ const je = {
22
22
  x: 0,
23
23
  y: 0,
24
24
  width: 0,
@@ -28,18 +28,18 @@ const Ve = {
28
28
  bottom: 0,
29
29
  right: 0
30
30
  };
31
- function ce(e) {
32
- const r = Ue(), a = w(0), o = w(null), [t, s] = x(Ve), c = de(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((d) => {
33
- const m = d[0];
34
- m && (cancelAnimationFrame(a.current), a.current = requestAnimationFrame(() => {
35
- o.current && r() && s(m.contentRect);
31
+ function me(e) {
32
+ const r = We(), a = v(0), o = v(null), [t, s] = y(je), c = pe(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((d) => {
33
+ const u = d[0];
34
+ u && (cancelAnimationFrame(a.current), a.current = requestAnimationFrame(() => {
35
+ o.current && r() && s(u.contentRect);
36
36
  }));
37
37
  }), [r]);
38
- return V(() => (o.current && c?.observe(o.current, e), () => {
38
+ return j(() => (o.current && c?.observe(o.current, e), () => {
39
39
  c?.disconnect(), a.current && cancelAnimationFrame(a.current);
40
40
  }), [c, e]), [o, t];
41
41
  }
42
- function Fe({
42
+ function Xe({
43
43
  value: e,
44
44
  defaultValue: r,
45
45
  finalValue: a,
@@ -47,19 +47,19 @@ function Fe({
47
47
  },
48
48
  initialControlledDelay: t = 0
49
49
  }) {
50
- const [s, c] = x(!1), [d, m] = x(
50
+ const [s, c] = y(!1), [d, u] = y(
51
51
  r !== void 0 ? r : a
52
- ), f = (h) => {
53
- m(h), o?.(h);
52
+ ), m = (p) => {
53
+ u(p), o?.(p);
54
54
  };
55
- return V(() => {
55
+ return j(() => {
56
56
  (async () => e !== void 0 && !s && t > 0 && (await new Promise(
57
- (h) => setTimeout(h, t)
57
+ (p) => setTimeout(p, t)
58
58
  ), c(!0)))();
59
- }, [e, t, s]), e !== void 0 ? !s && t > 0 ? ["", o, !0] : [e, o, !0] : [d, f, !1];
59
+ }, [e, t, s]), e !== void 0 ? !s && t > 0 ? ["", o, !0] : [e, o, !0] : [d, m, !1];
60
60
  }
61
- function ze(e) {
62
- const r = Oe();
61
+ function Ye(e) {
62
+ const r = Be();
63
63
  if (!e)
64
64
  return r;
65
65
  if (typeof e == "number" || typeof e == "string")
@@ -69,7 +69,7 @@ function ze(e) {
69
69
  return typeof a == "number" || typeof a == "string" ? `${o}${a}` : `${o}${r}`;
70
70
  }
71
71
  }
72
- const me = "SET_ANNOUNCEMENT", fe = "CLEAR_ANNOUNCEMENT", je = {
72
+ const ge = "SET_ANNOUNCEMENT", ye = "CLEAR_ANNOUNCEMENT", qe = {
73
73
  alert: null,
74
74
  alertdialog: null,
75
75
  log: "polite",
@@ -77,14 +77,14 @@ const me = "SET_ANNOUNCEMENT", fe = "CLEAR_ANNOUNCEMENT", je = {
77
77
  progressbar: null,
78
78
  status: "polite",
79
79
  timer: "assertive"
80
- }, Xe = (e, r) => {
80
+ }, Ke = (e, r) => {
81
81
  switch (r?.type) {
82
- case me:
82
+ case ge:
83
83
  return {
84
84
  ...e,
85
85
  announcement: r.payload
86
86
  };
87
- case fe:
87
+ case ye:
88
88
  return {
89
89
  ...e,
90
90
  announcement: null
@@ -92,14 +92,14 @@ const me = "SET_ANNOUNCEMENT", fe = "CLEAR_ANNOUNCEMENT", je = {
92
92
  default:
93
93
  return e;
94
94
  }
95
- }, Ye = ({
95
+ }, Qe = ({
96
96
  onAnnouncementClear: e,
97
97
  dispatch: r
98
98
  }) => {
99
99
  r({
100
- type: fe
100
+ type: ye
101
101
  }), typeof e == "function" && e();
102
- }, ie = ({
102
+ }, fe = ({
103
103
  children: e,
104
104
  clearAnnouncementDelay: r,
105
105
  clearAnnouncementTimeoutRef: a,
@@ -107,16 +107,16 @@ const me = "SET_ANNOUNCEMENT", fe = "CLEAR_ANNOUNCEMENT", je = {
107
107
  dispatch: t
108
108
  }) => {
109
109
  clearTimeout(a.current), e !== null && t({
110
- type: me,
110
+ type: ge,
111
111
  payload: e
112
112
  }), r && (a.current = setTimeout(
113
- () => Ye({
113
+ () => Qe({
114
114
  onAnnouncementClear: o,
115
115
  dispatch: t
116
116
  }),
117
117
  r
118
118
  ));
119
- }, qe = ({
119
+ }, Je = ({
120
120
  children: e,
121
121
  announcementTimeoutRef: r,
122
122
  announcementDelay: a,
@@ -125,13 +125,13 @@ const me = "SET_ANNOUNCEMENT", fe = "CLEAR_ANNOUNCEMENT", je = {
125
125
  onAnnouncementClear: s,
126
126
  dispatch: c
127
127
  }) => {
128
- clearTimeout(r.current), a ? r.current = setTimeout(ie, a, {
128
+ clearTimeout(r.current), a ? r.current = setTimeout(fe, a, {
129
129
  children: e,
130
130
  clearAnnouncementDelay: o,
131
131
  clearAnnouncementTimeoutRef: t,
132
132
  onAnnouncementClear: s,
133
133
  dispatch: c
134
- }) : ie({
134
+ }) : fe({
135
135
  children: e,
136
136
  clearAnnouncementDelay: o,
137
137
  clearAnnouncementTimeoutRef: t,
@@ -139,7 +139,7 @@ const me = "SET_ANNOUNCEMENT", fe = "CLEAR_ANNOUNCEMENT", je = {
139
139
  dispatch: c
140
140
  });
141
141
  };
142
- function Ke({
142
+ function Ze({
143
143
  children: e,
144
144
  className: r,
145
145
  politeness: a,
@@ -148,21 +148,21 @@ function Ke({
148
148
  clearAnnouncementDelay: s,
149
149
  onAnnouncementClear: c,
150
150
  visible: d,
151
- ...m
151
+ ...u
152
152
  }) {
153
- const f = w(null), h = w(null), [E, S] = De(Xe, {
153
+ const m = v(null), p = v(null), [k, A] = He(Ke, {
154
154
  announcement: null
155
155
  });
156
156
  let _ = a;
157
- typeof _ > "u" && (_ = o ? je[o] : "assertive"), V(() => {
158
- qe({
159
- announcementTimeoutRef: f,
157
+ typeof _ > "u" && (_ = o ? qe[o] : "assertive"), j(() => {
158
+ Je({
159
+ announcementTimeoutRef: m,
160
160
  announcementDelay: t,
161
161
  children: e,
162
162
  clearAnnouncementDelay: s,
163
- clearAnnouncementTimeoutRef: h,
163
+ clearAnnouncementTimeoutRef: p,
164
164
  onAnnouncementClear: c,
165
- dispatch: S
165
+ dispatch: A
166
166
  });
167
167
  }, [
168
168
  e,
@@ -170,7 +170,7 @@ function Ke({
170
170
  s,
171
171
  c
172
172
  ]);
173
- const p = i(r, {
173
+ const f = i(r, {
174
174
  "sr-only": !d
175
175
  });
176
176
  return /* @__PURE__ */ l(
@@ -178,9 +178,9 @@ function Ke({
178
178
  {
179
179
  "aria-live": _,
180
180
  ...o && { role: o },
181
- className: p,
182
- ...m,
183
- children: E.announcement
181
+ className: f,
182
+ ...u,
183
+ children: k.announcement
184
184
  }
185
185
  );
186
186
  }
@@ -197,19 +197,19 @@ try {
197
197
  });
198
198
  } catch {
199
199
  }
200
- const We = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", Qe = ({ mode: e }) => i({
200
+ const et = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", tt = ({ mode: e }) => i({
201
201
  "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
202
202
  "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
203
203
  "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
204
204
  "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
205
- }), Je = ({
205
+ }), rt = ({
206
206
  focusMode: e
207
207
  }) => i("focus:outline focus:outline-2 focus:outline-offset-2", {
208
208
  "focus:outline-focus-dark": e === "dark",
209
209
  "focus:outline-focus-light": e === "light",
210
210
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
211
211
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
212
- }), Ze = ({
212
+ }), at = ({
213
213
  noBorder: e,
214
214
  error: r
215
215
  }) => i("border-2", {
@@ -217,7 +217,7 @@ const We = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
217
217
  "focus:border-border-dark": !e && r,
218
218
  "border-border-error-dark": !e && r,
219
219
  "border-transparent": e
220
- }), et = ({
220
+ }), ot = ({
221
221
  disabled: e,
222
222
  raw: r,
223
223
  error: a,
@@ -256,7 +256,7 @@ const We = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
256
256
  "text-copy-medium dark:text-copy-error-dark": o === "alt-system"
257
257
  }
258
258
  );
259
- }, tt = ({
259
+ }, nt = ({
260
260
  error: e,
261
261
  raw: r,
262
262
  mode: a,
@@ -266,24 +266,24 @@ const We = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
266
266
  return "";
267
267
  if (o)
268
268
  return i(
269
- ee,
269
+ oe,
270
270
  "absolute px-2 cursor-not-allowed opacity-50 font-medium"
271
271
  );
272
272
  if (!e)
273
- return i(ee, "absolute px-2 font-medium", {
273
+ return i(oe, "absolute px-2 font-medium", {
274
274
  "text-copy-medium": a === "dark",
275
275
  "text-copy-dark": a === "light",
276
276
  "text-copy-dark dark:text-copy-medium": a === "system",
277
277
  "text-copy-medium dark:text-copy-dark": a === "alt-system"
278
278
  });
279
279
  if (e)
280
- return i(ee, "absolute px-2 font-medium", {
280
+ return i(oe, "absolute px-2 font-medium", {
281
281
  "text-copy-error-light": a === "dark",
282
282
  "text-copy-error-dark": a === "light",
283
283
  "text-copy-error-dark dark:text-copy-error-light": a === "system",
284
284
  "dark:text-copy-error-dark text-copy-error-light": a === "alt-system"
285
285
  });
286
- }, rt = ({
286
+ }, lt = ({
287
287
  className: e,
288
288
  textAreaClassName: r,
289
289
  raw: a,
@@ -292,49 +292,49 @@ const We = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
292
292
  noBorder: s,
293
293
  error: c,
294
294
  mode: d,
295
- leftElement: m,
296
- rightElement: f
295
+ leftElement: u,
296
+ rightElement: m
297
297
  }) => {
298
- const h = a ? e : i(
298
+ const p = a ? e : i(
299
299
  "relative flex w-full flex-col justify-center",
300
- Be,
300
+ Ue,
301
301
  e
302
- ), E = a ? i(r) : i(
303
- ue,
302
+ ), k = a ? i(r) : i(
303
+ he,
304
304
  r,
305
- We(),
306
- Qe({ mode: d }),
307
- Je({ focusMode: o }),
308
- Ze({
305
+ et(),
306
+ tt({ mode: d }),
307
+ rt({ focusMode: o }),
308
+ at({
309
309
  noBorder: s,
310
310
  error: c
311
311
  }),
312
312
  {
313
313
  "disabled:cursor-not-allowed disabled:opacity-50": t
314
314
  }
315
- ), S = a ? void 0 : "sr-only", _ = et({
315
+ ), A = a ? void 0 : "sr-only", _ = ot({
316
316
  disabled: t,
317
317
  raw: a,
318
318
  error: c,
319
319
  mode: d,
320
- rightElement: f,
321
- leftElement: m
322
- }), p = tt({
320
+ rightElement: m,
321
+ leftElement: u
322
+ }), f = nt({
323
323
  error: c,
324
324
  raw: a,
325
325
  mode: d,
326
326
  disabled: t
327
- }), L = a ? void 0 : i(He, "absolute"), T = a ? void 0 : i(Ge, "absolute");
327
+ }), R = a ? void 0 : i($e, "absolute"), x = a ? void 0 : i(Fe, "absolute");
328
328
  return {
329
- wrapper: h,
330
- textArea: E,
331
- accessibleLabel: S,
329
+ wrapper: p,
330
+ textArea: k,
331
+ accessibleLabel: A,
332
332
  visibleLabel: _,
333
- helperText: p,
334
- rightElement: L,
335
- leftElement: T
333
+ helperText: f,
334
+ rightElement: R,
335
+ leftElement: x
336
336
  };
337
- }, at = ({
337
+ }, st = ({
338
338
  scrollHeight: e,
339
339
  currentHeight: r,
340
340
  currentLabelOffset: a = 0,
@@ -350,7 +350,7 @@ const We = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
350
350
  helperTextOffset: s,
351
351
  scrollHeight: e
352
352
  };
353
- }, te = Me.forwardRef(
353
+ }, ne = Ge.forwardRef(
354
354
  ({
355
355
  id: e,
356
356
  name: r,
@@ -360,164 +360,164 @@ const We = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
360
360
  className: s,
361
361
  textAreaClassName: c,
362
362
  mode: d = "system",
363
- focusMode: m = "system",
364
- value: f,
365
- defaultValue: h,
366
- disabled: E = !1,
367
- noBorder: S = !1,
363
+ focusMode: u = "system",
364
+ value: m,
365
+ defaultValue: p,
366
+ disabled: k = !1,
367
+ noBorder: A = !1,
368
368
  labelId: _,
369
- helperText: p = "",
370
- helperTextOnFocus: L = !1,
371
- rightElement: T,
372
- leftElement: A,
373
- onChange: H,
374
- onFocus: F,
375
- onBlur: z,
376
- ...Y
377
- }, q) => {
378
- var j;
379
- const N = w(null), K = $e([q, N]), [X, R] = ce(), [n, u] = ce(), I = w(80), D = w(-25), g = w(null), k = w(30), y = w(null), v = ze({ id: e, prefix: `${ue}-` }), [P, W] = x(0), [re, pe] = x(0), [he, ae] = x(
380
- !!(!L && p)
381
- ), ge = `${r} error, ${p}`, O = rt({
369
+ helperText: f = "",
370
+ helperTextOnFocus: R = !1,
371
+ rightElement: x,
372
+ leftElement: w,
373
+ onChange: $,
374
+ onFocus: X,
375
+ onBlur: F,
376
+ ...K
377
+ }, Q) => {
378
+ var Y;
379
+ const E = v(null), J = ze([Q, E]), [Z, B] = me(), [ee, L] = me(), H = v(80), V = v(-25), n = v(null), h = v(30), C = v(null), S = Ye({ id: e, prefix: `${he}-` }), [I, T] = y(0), [b, M] = y(0), [W, q] = y(
380
+ !!(!R && f)
381
+ ), be = `${r} error, ${f}`, D = lt({
382
382
  className: s,
383
383
  textAreaClassName: c,
384
384
  error: o,
385
385
  raw: t,
386
- focusMode: m,
387
- disabled: E,
388
- noBorder: S,
386
+ focusMode: u,
387
+ disabled: k,
388
+ noBorder: A,
389
389
  mode: d,
390
- rightElement: !!T,
391
- leftElement: !!A
392
- }), [M, ye] = Fe({
393
- value: f,
390
+ rightElement: !!x,
391
+ leftElement: !!w
392
+ }), [O, ke] = Xe({
393
+ value: m,
394
394
  initialControlledDelay: 20,
395
- defaultValue: h,
396
- onChange: (b) => {
397
- H && H({
395
+ defaultValue: p,
396
+ onChange: (g) => {
397
+ $ && $({
398
398
  target: {
399
- value: b
399
+ value: g
400
400
  }
401
401
  });
402
402
  }
403
- }), be = (b) => {
404
- ye(b.target.value);
405
- }, ke = (b) => {
406
- L && p && ae(!0), F && F(b);
407
- }, xe = (b) => {
408
- L && p && !M && ae(!1), z && z(b);
403
+ }), xe = (g) => {
404
+ ke(g.target.value);
405
+ }, Ee = (g) => {
406
+ R && f && q(!0), X && X(g);
407
+ }, Te = (g) => {
408
+ R && f && !O && q(!1), F && F(g);
409
409
  };
410
- return $(() => {
411
- R && R.width && W(R.width + 18 + 10);
412
- }, [R]), $(() => {
413
- u && u.width && pe(u.width + 18 + 10);
414
- }, [u]), $(() => {
415
- t || N && N.current && M !== void 0 && (N.current.style.height = "inherit", N.current.style.height = N.current.scrollHeight + "px");
416
- }, [M, t]), $(() => {
410
+ return z(() => {
411
+ B && B.width && T(B.width + 18 + 10);
412
+ }, [B]), z(() => {
413
+ L && L.width && M(L.width + 18 + 10);
414
+ }, [L]), z(() => {
415
+ t || E && E.current && O !== void 0 && (E.current.style.height = "inherit", E.current.style.height = E.current.scrollHeight + "px");
416
+ }, [O, t]), z(() => {
417
417
  t || setTimeout(() => {
418
- var b;
419
- (b = g?.current) == null || b.style.setProperty(
418
+ var g;
419
+ (g = n?.current) == null || g.style.setProperty(
420
420
  "--av-text-area-wrapper-transition",
421
- M ? "none" : "all 0.2s ease-out"
421
+ O ? "none" : "all 0.2s ease-out"
422
422
  );
423
423
  }, 0);
424
- }, [M, t]), $(() => {
425
- var b, oe;
426
- if (!t && N && N.current && M !== void 0) {
427
- const { labelOffset: Q, helperTextOffset: J, scrollHeight: Ee } = at({
428
- scrollHeight: N.current.scrollHeight,
429
- currentHeight: I.current,
430
- currentLabelOffset: D.current,
431
- currentHelperTextOffset: k.current
424
+ }, [O, t]), z(() => {
425
+ var g, le;
426
+ if (!t && E && E.current && O !== void 0) {
427
+ const { labelOffset: te, helperTextOffset: re, scrollHeight: Ne } = st({
428
+ scrollHeight: E.current.scrollHeight,
429
+ currentHeight: H.current,
430
+ currentLabelOffset: V.current,
431
+ currentHelperTextOffset: h.current
432
432
  });
433
- Q && (D.current = Q, (b = g?.current) == null || b.style.setProperty(
433
+ te && (V.current = te, (g = n?.current) == null || g.style.setProperty(
434
434
  "--av-text-area-label",
435
- `${Q}px`
436
- )), J && (k.current = J, (oe = y?.current) == null || oe.style.setProperty(
435
+ `${te}px`
436
+ )), re && (h.current = re, (le = C?.current) == null || le.style.setProperty(
437
437
  "--av-text-area-helper-text",
438
- `${J}px`
439
- )), I.current = Ee || I.current;
438
+ `${re}px`
439
+ )), H.current = Ne || H.current;
440
440
  }
441
- }, [M, t]), u.width > 0 && ((j = g?.current) == null || j.style.setProperty(
441
+ }, [O, t]), L.width > 0 && ((Y = n?.current) == null || Y.style.setProperty(
442
442
  "--tw-translate-x",
443
- `${12 + u.width + 5}px`
444
- )), /* @__PURE__ */ C("div", { className: O.wrapper, children: [
443
+ `${12 + L.width + 5}px`
444
+ )), /* @__PURE__ */ N("div", { className: D.wrapper, children: [
445
445
  /* @__PURE__ */ l(
446
446
  "label",
447
447
  {
448
- htmlFor: v,
448
+ htmlFor: S,
449
449
  id: _,
450
- className: O.accessibleLabel,
450
+ className: D.accessibleLabel,
451
451
  children: a
452
452
  }
453
453
  ),
454
- A && /* @__PURE__ */ l(
454
+ w && /* @__PURE__ */ l(
455
455
  "div",
456
456
  {
457
- ref: n,
458
- className: O.leftElement,
459
- children: A
457
+ ref: ee,
458
+ className: D.leftElement,
459
+ children: w
460
460
  }
461
461
  ),
462
462
  /* @__PURE__ */ l(
463
463
  "textarea",
464
464
  {
465
- ref: K,
466
- id: v,
465
+ ref: J,
466
+ id: S,
467
467
  name: r,
468
- disabled: E,
468
+ disabled: k,
469
469
  placeholder: t ? void 0 : " ",
470
- className: O.textArea,
470
+ className: D.textArea,
471
471
  rows: 1,
472
- ...p && { "aria-describedby": `${v}-helper` },
472
+ ...f && { "aria-describedby": `${S}-helper` },
473
473
  ...o && { "aria-invalid": "true" },
474
- ...T && !A && !t && { style: { paddingRight: P } },
475
- ...A && !T && !t && { style: { paddingLeft: re } },
476
- ...T && A && !t && {
474
+ ...x && !w && !t && { style: { paddingRight: I } },
475
+ ...w && !x && !t && { style: { paddingLeft: b } },
476
+ ...x && w && !t && {
477
477
  style: {
478
- paddingRight: P,
479
- paddingLeft: re
478
+ paddingRight: I,
479
+ paddingLeft: b
480
480
  }
481
481
  },
482
- value: M,
483
- onChange: be,
484
- onFocus: ke,
485
- onBlur: xe,
486
- ...Y
482
+ value: O,
483
+ onChange: xe,
484
+ onFocus: Ee,
485
+ onBlur: Te,
486
+ ...K
487
487
  }
488
488
  ),
489
489
  !t && /* @__PURE__ */ l(
490
490
  "label",
491
491
  {
492
- ref: g,
492
+ ref: n,
493
493
  "aria-hidden": !0,
494
- htmlFor: v,
495
- className: `${O.visibleLabel}`,
494
+ htmlFor: S,
495
+ className: `${D.visibleLabel}`,
496
496
  children: a
497
497
  }
498
498
  ),
499
- he && /* @__PURE__ */ l(
499
+ W && /* @__PURE__ */ l(
500
500
  "div",
501
501
  {
502
- ref: y,
503
- id: `${v}-helper`,
504
- className: O.helperText,
505
- children: p
502
+ ref: C,
503
+ id: `${S}-helper`,
504
+ className: D.helperText,
505
+ children: f
506
506
  }
507
507
  ),
508
- T && /* @__PURE__ */ l(
508
+ x && /* @__PURE__ */ l(
509
509
  "div",
510
510
  {
511
- ref: X,
512
- className: O.rightElement,
513
- children: T
511
+ ref: Z,
512
+ className: D.rightElement,
513
+ children: x
514
514
  }
515
515
  ),
516
- o && p && /* @__PURE__ */ l(Ke, { politeness: "polite", clearAnnouncementDelay: 500, children: ge })
516
+ o && f && /* @__PURE__ */ l(Ze, { politeness: "polite", clearAnnouncementDelay: 500, children: be })
517
517
  ] });
518
518
  }
519
519
  );
520
- te.displayName = "TextArea";
520
+ ne.displayName = "TextArea";
521
521
  /*!
522
522
  @versini/ui-textarea v4.0.5
523
523
  © 2025 gizmette.com
@@ -531,7 +531,7 @@ try {
531
531
  });
532
532
  } catch {
533
533
  }
534
- const ot = "av-toggle", nt = () => i("peer", "h-6", "w-11", "rounded-full"), lt = ({
534
+ const ct = "av-toggle", it = () => i("peer", "h-6", "w-11", "rounded-full"), dt = ({
535
535
  focusMode: e
536
536
  }) => i(
537
537
  "peer-focus:outline",
@@ -543,14 +543,14 @@ const ot = "av-toggle", nt = () => i("peer", "h-6", "w-11", "rounded-full"), lt
543
543
  "peer-focus:outline-focus-light dark:peer-focus:outline-focus-dark": e === "alt-system",
544
544
  "peer-focus:outline-focus-dark dark:peer-focus:outline-focus-light": e === "system"
545
545
  }
546
- ), st = () => i(
546
+ ), ut = () => i(
547
547
  "peer-checked:after:translate-x-full",
548
548
  // background color when checked
549
549
  "peer-checked:bg-violet-500",
550
550
  // knob circle and border color when checked
551
551
  "peer-checked:after:bg-white",
552
552
  "peer-checked:after:border-white"
553
- ), ct = () => i(
553
+ ), mt = () => i(
554
554
  "after:left-[2px]",
555
555
  "after:top-[2px]",
556
556
  "after:border",
@@ -562,7 +562,7 @@ const ot = "av-toggle", nt = () => i("peer", "h-6", "w-11", "rounded-full"), lt
562
562
  "after:rounded-full",
563
563
  "after:transition-all",
564
564
  "after:content-['']"
565
- ), it = ({
565
+ ), ft = ({
566
566
  mode: e,
567
567
  noBorder: r
568
568
  }) => i({
@@ -571,7 +571,7 @@ const ot = "av-toggle", nt = () => i("peer", "h-6", "w-11", "rounded-full"), lt
571
571
  "border-border-light bg-surface-darker": e === "dark",
572
572
  "border-border-light bg-surface-darker dark:border-border-dark dark:bg-surface-medium": e === "alt-system",
573
573
  "border-border-dark bg-surface-medium dark:border-border-light dark:bg-surface-darker": e === "system"
574
- }), dt = ({
574
+ }), pt = ({
575
575
  mode: e,
576
576
  labelHidden: r
577
577
  }) => r ? "sr-only" : i("ml-2 text-sm", {
@@ -579,11 +579,11 @@ const ot = "av-toggle", nt = () => i("peer", "h-6", "w-11", "rounded-full"), lt
579
579
  "text-copy-lighter": e === "dark",
580
580
  "text-copy-lighter dark:text-copy-dark": e === "alt-system",
581
581
  "text-copy-dark dark:text-copy-lighter": e === "system"
582
- }), ut = ({ className: e }) => i(
583
- ot,
582
+ }), ht = ({ className: e }) => i(
583
+ ct,
584
584
  "relative flex cursor-pointer items-center",
585
585
  e
586
- ), mt = ({
586
+ ), gt = ({
587
587
  mode: e,
588
588
  focusMode: r,
589
589
  labelHidden: a,
@@ -591,16 +591,16 @@ const ot = "av-toggle", nt = () => i("peer", "h-6", "w-11", "rounded-full"), lt
591
591
  noBorder: t
592
592
  }) => ({
593
593
  toggle: i(
594
- nt(),
595
- it({ mode: e, noBorder: t }),
596
- lt({ focusMode: r }),
597
- ct(),
598
- st()
594
+ it(),
595
+ ft({ mode: e, noBorder: t }),
596
+ dt({ focusMode: r }),
597
+ mt(),
598
+ ut()
599
599
  ),
600
- label: dt({ mode: e, labelHidden: a }),
600
+ label: pt({ mode: e, labelHidden: a }),
601
601
  input: "peer sr-only",
602
- wrapper: ut({ className: o })
603
- }), B = ({
602
+ wrapper: ht({ className: o })
603
+ }), G = ({
604
604
  checked: e = !1,
605
605
  onChange: r,
606
606
  label: a,
@@ -609,30 +609,30 @@ const ot = "av-toggle", nt = () => i("peer", "h-6", "w-11", "rounded-full"), lt
609
609
  mode: s = "system",
610
610
  focusMode: c = "system",
611
611
  className: d,
612
- noBorder: m = !1
612
+ noBorder: u = !1
613
613
  }) => {
614
- const f = mt({
614
+ const m = gt({
615
615
  mode: s,
616
616
  focusMode: c,
617
617
  labelHidden: o,
618
618
  className: d,
619
- noBorder: m
620
- }), h = (E) => {
621
- r?.(E.target.checked);
619
+ noBorder: u
620
+ }), p = (k) => {
621
+ r?.(k.target.checked);
622
622
  };
623
- return /* @__PURE__ */ C("label", { className: f.wrapper, children: [
623
+ return /* @__PURE__ */ N("label", { className: m.wrapper, children: [
624
624
  /* @__PURE__ */ l(
625
625
  "input",
626
626
  {
627
627
  name: t,
628
628
  checked: e,
629
629
  type: "checkbox",
630
- className: f.input,
631
- onChange: h
630
+ className: m.input,
631
+ onChange: p
632
632
  }
633
633
  ),
634
- /* @__PURE__ */ l("div", { className: f.toggle }),
635
- /* @__PURE__ */ l("span", { className: f.label, children: a })
634
+ /* @__PURE__ */ l("div", { className: m.toggle }),
635
+ /* @__PURE__ */ l("span", { className: m.label, children: a })
636
636
  ] });
637
637
  };
638
638
  /*!
@@ -648,133 +648,138 @@ try {
648
648
  });
649
649
  } catch {
650
650
  }
651
- const bt = ({
651
+ const Tt = ({
652
652
  open: e,
653
653
  onOpenChange: r
654
654
  }) => {
655
- const { getAccessToken: a, user: o } = Te(), {
655
+ const { getAccessToken: a, user: o } = ve(), {
656
656
  data: t,
657
657
  isSuccess: s,
658
658
  refetch: c
659
- } = Se({
659
+ } = De({
660
660
  user: o?.username,
661
661
  getAccessToken: a
662
- }), [d, m] = x({
662
+ }), [d, u] = y({
663
663
  loadingLocation: !1
664
- }), [f, h] = x({
664
+ }), [m, p] = y({
665
665
  prompts: []
666
- }), [E, S] = x(""), [_, p] = x(""), [L, T] = x(!1), [A, H] = x(!1), [F, z] = Le({
667
- key: Ne + ve,
666
+ }), [k, A] = y(""), [_, f] = y(""), [R, x] = y(!1), [w, $] = y(!1), [X, F] = y(!1), [K, Q] = ie({
667
+ key: se + _e,
668
+ initialValue: !1
669
+ }), [, Y] = ie({
670
+ key: se + we,
668
671
  initialValue: !1
669
- }), Y = (n) => {
670
- z(n);
671
- }, q = (n) => {
672
- T(n);
673
- }, j = (n) => {
674
- H(n);
675
- }, N = async (n) => {
672
+ }), E = (n) => {
673
+ Q(n);
674
+ }, J = (n) => {
675
+ x(n);
676
+ }, Z = (n) => {
677
+ $(n);
678
+ }, B = async (n) => {
679
+ Y(n), F(n), await Me(n);
680
+ }, ee = async (n) => {
676
681
  n.preventDefault();
677
682
  try {
678
- await le({
683
+ await de({
679
684
  accessToken: await a(),
680
- type: se.SET_USER_PREFERENCES,
685
+ type: ue.SET_USER_PREFERENCES,
681
686
  params: {
682
687
  user: o?.username,
683
- instructions: E,
688
+ instructions: k,
684
689
  location: _,
685
690
  provider: t?.provider,
686
- tags: f.prompts,
687
- sendOnEnter: L,
688
- useMemory: A
691
+ tags: m.prompts,
692
+ sendOnEnter: R,
693
+ useMemory: w
689
694
  }
690
- }), c(), m({
695
+ }), c(), u({
691
696
  loadingLocation: !1
692
697
  });
693
698
  } catch {
694
699
  }
695
- }, K = async () => {
696
- m({
700
+ }, L = async () => {
701
+ u({
697
702
  loadingLocation: !0
698
- }), p("...");
703
+ }), f("...");
699
704
  try {
700
- const n = Date.now(), u = await Ie(), I = await le({
705
+ const n = Date.now(), h = await Oe(), C = await de({
701
706
  accessToken: await a(),
702
- type: se.GET_LOCATION,
707
+ type: ue.GET_LOCATION,
703
708
  params: {
704
- latitude: u.latitude,
705
- longitude: u.longitude
709
+ latitude: h.latitude,
710
+ longitude: h.longitude
706
711
  }
707
- }), g = Date.now() - n;
708
- if (g < 2e3 && await new Promise((k) => setTimeout(k, 2e3 - g)), I.status === 200) {
709
- const { city: k, state: y, country: v, displayName: P } = I.data, W = k && y && v ? `${k}, ${y}, ${v}` : P;
710
- m({
712
+ }), I = Date.now() - n;
713
+ if (I < 2e3 && await new Promise((T) => setTimeout(T, 2e3 - I)), C.status === 200) {
714
+ const { city: T, state: b, country: M, displayName: W } = C.data, q = T && b && M ? `${T}, ${b}, ${M}` : W;
715
+ u({
711
716
  loadingLocation: !1
712
- }), p(W);
717
+ }), f(q);
713
718
  } else
714
- m({
719
+ u({
715
720
  loadingLocation: !1
716
721
  });
717
722
  } catch {
718
723
  }
719
- }, X = () => {
724
+ }, H = () => {
720
725
  c(), r(!1);
721
- }, R = ({
726
+ }, V = ({
722
727
  enabled: n = !1,
723
- privateChat: u = !1,
724
- clipboardAccess: I = !1,
725
- ...D
728
+ privateChat: h = !1,
729
+ clipboardAccess: C = !1,
730
+ ...S
726
731
  }) => {
727
- h((g) => {
728
- const k = g.prompts, y = {
729
- ...D,
732
+ p((I) => {
733
+ const T = I.prompts, b = {
734
+ ...S,
730
735
  enabled: n,
731
- privateChat: u,
732
- clipboardAccess: I
736
+ privateChat: h,
737
+ clipboardAccess: C
733
738
  };
734
- I ? y.content = y.content.replace(/{{clipboard}}/g, "") + " {{clipboard}}" : y.content = y.content.replace(/{{clipboard}}/g, "");
735
- const v = k.findIndex((P) => P.slot === D.slot);
736
- return v === -1 ? {
737
- ...g,
738
- prompts: [...k, { ...y }]
739
- } : (k[v] = y, {
740
- ...g,
741
- prompts: [...k]
739
+ C ? b.content = b.content.replace(/{{clipboard}}/g, "") + " {{clipboard}}" : b.content = b.content.replace(/{{clipboard}}/g, "");
740
+ const M = T.findIndex((W) => W.slot === S.slot);
741
+ return M === -1 ? {
742
+ ...I,
743
+ prompts: [...T, { ...b }]
744
+ } : (T[M] = b, {
745
+ ...I,
746
+ prompts: [...T]
742
747
  });
743
748
  });
744
749
  };
745
- return V(() => {
746
- t?.instructions && S(t.instructions), t?.location && p(t.location), t?.tags && h({ prompts: t.tags }), t?.sendOnEnter !== void 0 && T(t.sendOnEnter), t?.useMemory !== void 0 && H(t.useMemory);
747
- }, [t]), s ? /* @__PURE__ */ C(
748
- Re,
750
+ return j(() => {
751
+ t?.instructions && A(t.instructions), t?.location && f(t.location), t?.tags && p({ prompts: t.tags }), t?.sendOnEnter !== void 0 && x(t.sendOnEnter), t?.useMemory !== void 0 && $(t.useMemory), F(Ce());
752
+ }, [t]), s ? /* @__PURE__ */ N(
753
+ Pe,
749
754
  {
750
755
  open: e,
751
- onOpenChange: X,
752
- title: we,
753
- footer: /* @__PURE__ */ C(
754
- Ae,
756
+ onOpenChange: H,
757
+ title: Ie,
758
+ footer: /* @__PURE__ */ N(
759
+ Le,
755
760
  {
756
761
  columnGap: 2,
757
762
  alignHorizontal: "flex-end",
758
763
  className: "pb-8 sm:pb-0",
759
764
  children: [
760
- /* @__PURE__ */ l(ne, { children: /* @__PURE__ */ l(
761
- Z,
765
+ /* @__PURE__ */ l(ce, { children: /* @__PURE__ */ l(
766
+ ae,
762
767
  {
763
768
  mode: "dark",
764
769
  variant: "secondary",
765
770
  focusMode: "light",
766
- onClick: X,
771
+ onClick: H,
767
772
  children: "Cancel"
768
773
  }
769
774
  ) }),
770
- /* @__PURE__ */ l(ne, { children: /* @__PURE__ */ l(
771
- Z,
775
+ /* @__PURE__ */ l(ce, { children: /* @__PURE__ */ l(
776
+ ae,
772
777
  {
773
778
  mode: "dark",
774
779
  variant: "danger",
775
780
  focusMode: "light",
776
781
  onClick: async (n) => {
777
- r(!1), await N(n);
782
+ r(!1), await ee(n);
778
783
  },
779
784
  children: "Save"
780
785
  }
@@ -783,64 +788,64 @@ const bt = ({
783
788
  }
784
789
  ),
785
790
  children: [
786
- /* @__PURE__ */ C(
787
- G,
791
+ /* @__PURE__ */ N(
792
+ U,
788
793
  {
789
- header: U.SETTINGS_DETAILS.TITLE,
794
+ header: P.SETTINGS_DETAILS.TITLE,
790
795
  className: "prose-dark dark:prose-lighter",
791
796
  children: [
792
- /* @__PURE__ */ l("p", { className: "text-sm", children: U.SETTINGS_DETAILS.DETAILS }),
797
+ /* @__PURE__ */ l("p", { className: "text-sm", children: P.SETTINGS_DETAILS.DETAILS }),
793
798
  /* @__PURE__ */ l(
794
- B,
799
+ G,
795
800
  {
796
801
  className: "mt-2",
797
802
  noBorder: !0,
798
803
  label: "Show Message Statistics",
799
804
  name: "show-message-statistics",
800
- onChange: Y,
801
- checked: F
805
+ onChange: E,
806
+ checked: K
802
807
  }
803
808
  ),
804
- /* @__PURE__ */ l("p", { className: "text-sm mt-5", children: U.SETTINGS_DETAILS.SEND_ON_ENTER }),
809
+ /* @__PURE__ */ l("p", { className: "text-sm mt-5", children: P.SETTINGS_DETAILS.SEND_ON_ENTER }),
805
810
  /* @__PURE__ */ l(
806
- B,
811
+ G,
807
812
  {
808
813
  className: "mt-2",
809
814
  noBorder: !0,
810
815
  label: "Send Message on Enter",
811
816
  name: "send-message-on-enter",
812
- onChange: q,
813
- checked: L
817
+ onChange: J,
818
+ checked: R
814
819
  }
815
820
  ),
816
- /* @__PURE__ */ l("p", { className: "text-sm mt-5", children: U.SETTINGS_DETAILS.USE_MEMORY }),
821
+ /* @__PURE__ */ l("p", { className: "text-sm mt-5", children: P.SETTINGS_DETAILS.USE_MEMORY }),
817
822
  /* @__PURE__ */ l(
818
- B,
823
+ G,
819
824
  {
820
825
  className: "mt-2",
821
826
  noBorder: !0,
822
827
  label: "Use Memory",
823
828
  name: "use-memory",
824
- onChange: j,
825
- checked: A
829
+ onChange: Z,
830
+ checked: w
826
831
  }
827
832
  )
828
833
  ]
829
834
  }
830
835
  ),
831
- /* @__PURE__ */ C(
832
- G,
836
+ /* @__PURE__ */ N(
837
+ U,
833
838
  {
834
839
  header: "Custom Instructions",
835
840
  className: "prose-dark dark:prose-lighter mt-4",
836
841
  children: [
837
- /* @__PURE__ */ C("p", { className: "text-sm", children: [
842
+ /* @__PURE__ */ N("p", { className: "text-sm", children: [
838
843
  "What would you like ",
839
- /* @__PURE__ */ l("em", { children: _e }),
844
+ /* @__PURE__ */ l("em", { children: Ae }),
840
845
  " to know about you to provide better responses?"
841
846
  ] }),
842
847
  /* @__PURE__ */ l(
843
- te,
848
+ ne,
844
849
  {
845
850
  mode: "alt-system",
846
851
  autoCapitalize: "off",
@@ -848,9 +853,9 @@ const bt = ({
848
853
  autoCorrect: "off",
849
854
  name: "customInstructions",
850
855
  label: "Custom Instructions",
851
- value: E,
856
+ value: k,
852
857
  onChange: (n) => {
853
- S(n.target.value);
858
+ A(n.target.value);
854
859
  },
855
860
  helperText: "Press ENTER to add a new line."
856
861
  }
@@ -858,42 +863,63 @@ const bt = ({
858
863
  ]
859
864
  }
860
865
  ),
861
- /* @__PURE__ */ C(G, { header: "Location", className: "prose-dark dark:prose-lighter mt-4", children: [
866
+ /* @__PURE__ */ N(U, { header: "Location", className: "prose-dark dark:prose-lighter mt-4", children: [
862
867
  /* @__PURE__ */ l("p", { className: "text-sm", children: "You can share your location to receive customized responses based on your area." }),
863
868
  /* @__PURE__ */ l(
864
- te,
869
+ ne,
865
870
  {
866
871
  mode: "alt-system",
867
872
  name: "location",
868
873
  label: "Location",
869
874
  value: _,
870
875
  onChange: (n) => {
871
- p(n.target.value);
876
+ f(n.target.value);
872
877
  },
873
878
  helperText: "Enter your location or press auto-detect."
874
879
  }
875
880
  ),
876
881
  /* @__PURE__ */ l(
877
- Z,
882
+ ae,
878
883
  {
879
884
  className: "mt-2",
880
885
  size: "small",
881
886
  noBorder: !0,
882
887
  disabled: d.loadingLocation,
883
- onClick: K,
888
+ onClick: L,
884
889
  children: d.loadingLocation ? "Detecting..." : "Auto-detect"
885
890
  }
886
891
  )
887
892
  ] }),
888
- /* @__PURE__ */ C(
889
- G,
893
+ Se() && /* @__PURE__ */ N(
894
+ U,
890
895
  {
891
- header: U.SETTINGS_PROMPTS.TITLE,
896
+ header: P.SETTINGS_CACHING.TITLE,
892
897
  className: "prose-dark dark:prose-lighter mt-4",
893
898
  children: [
894
- /* @__PURE__ */ l("p", { className: "text-sm", children: Ce }),
895
- f.prompts && f.prompts.slice(0, 3).map((n) => /* @__PURE__ */ C(
899
+ /* @__PURE__ */ l("p", { className: "text-sm", children: P.SETTINGS_CACHING.DESCRIPTION }),
900
+ /* @__PURE__ */ l(
896
901
  G,
902
+ {
903
+ className: "mt-2",
904
+ noBorder: !0,
905
+ label: "Enable App Caching",
906
+ name: "enable-service-worker",
907
+ onChange: B,
908
+ checked: X
909
+ }
910
+ )
911
+ ]
912
+ }
913
+ ),
914
+ /* @__PURE__ */ N(
915
+ U,
916
+ {
917
+ header: P.SETTINGS_PROMPTS.TITLE,
918
+ className: "prose-dark dark:prose-lighter mt-4",
919
+ children: [
920
+ /* @__PURE__ */ l("p", { className: "text-sm", children: Re }),
921
+ m.prompts && m.prompts.slice(0, 3).map((n) => /* @__PURE__ */ N(
922
+ U,
897
923
  {
898
924
  mode: "dark",
899
925
  noBorder: !0,
@@ -902,51 +928,51 @@ const bt = ({
902
928
  children: [
903
929
  /* @__PURE__ */ l("p", { className: "text-sm", children: n.description }),
904
930
  /* @__PURE__ */ l(
905
- B,
931
+ G,
906
932
  {
907
933
  mode: "dark",
908
934
  className: "mt-2",
909
935
  noBorder: !0,
910
936
  label: "Enabled",
911
937
  name: n.slot.toString(),
912
- onChange: (u) => {
913
- R({
938
+ onChange: (h) => {
939
+ V({
914
940
  ...n,
915
- enabled: u
941
+ enabled: h
916
942
  });
917
943
  },
918
944
  checked: n.enabled
919
945
  }
920
946
  ),
921
947
  /* @__PURE__ */ l(
922
- B,
948
+ G,
923
949
  {
924
950
  mode: "dark",
925
951
  className: "mt-2",
926
952
  noBorder: !0,
927
953
  label: "Private Chat",
928
954
  name: `private-${n.slot.toString()}`,
929
- onChange: (u) => {
930
- R({
955
+ onChange: (h) => {
956
+ V({
931
957
  ...n,
932
- privateChat: u
958
+ privateChat: h
933
959
  });
934
960
  },
935
961
  checked: n.privateChat
936
962
  }
937
963
  ),
938
964
  /* @__PURE__ */ l(
939
- B,
965
+ G,
940
966
  {
941
967
  mode: "dark",
942
968
  className: "mt-2",
943
969
  noBorder: !0,
944
970
  label: "Use Clipboard",
945
971
  name: `clipboard-${n.slot.toString()}`,
946
- onChange: (u) => {
947
- R({
972
+ onChange: (h) => {
973
+ V({
948
974
  ...n,
949
- clipboardAccess: u
975
+ clipboardAccess: h
950
976
  });
951
977
  },
952
978
  checked: n.clipboardAccess
@@ -964,5 +990,5 @@ const bt = ({
964
990
  ) : null;
965
991
  };
966
992
  export {
967
- bt as SettingsPanel
993
+ Tt as SettingsPanel
968
994
  };