@versini/sassysaint 1.0.11 → 1.0.13

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,7 +1,7 @@
1
- import { jsxs as S, jsx as n, Fragment as me } from "react/jsx-runtime";
2
- import { O as Be, s as Ve, S as De, f$1 as $e, M as ze, U as Ue, r as Fe, o as Pe, n as ge, l as Ge, a as W, isLastMessageFromRole as ye, x as fe, CANCEL as je, CLEAR as We, ACTION_RESET as he, ROLE_ASSISTANT as L, ROLE_INTERNAL as X, ROLE_USER as Q, Wr as K, ROLE_SYSTEM as Ye, ROLE_HIDDEN as qe, MODEL_GPT4 as xe, STATS_SEPARATOR as ae, ACTION_MODEL as be, ACTION_MESSAGE as H, TYPE_QUESTION as Je, SEND as Qe, ACTION_STREAMING as ke, ERROR_MESSAGE as Xe, getMessageContaintWrapperClass as Ke, MessagesContainerHeader as Ze, ACTION_SEARCH as er, ACTION_SORT as rr, ACTION_RESTORE as tr, ACTION_LOCATION as _, getCurrentGeoLocation as or, c as sr, AppFooter as ar, LOCAL_STORAGE_PREFIX as Y, LOCAL_STORAGE_SEARCH as nr, LOCAL_STORAGE_SORT as lr, LOCAL_STORAGE_LOCATION as cr } from "./index.eFSALEqy.js";
3
- import { g as Ce, AppContext as U, restCall as ir, E as q, serviceCall as ne, SERVICE_TYPES as le, HistoryContext as dr, k as ur } from "./useLocalStorage.CsBq2ZMB.js";
4
- import pr, { useState as R, useEffect as E, useRef as x, useLayoutEffect as D, useContext as Z, lazy as mr, Suspense as ce, useReducer as ie, useCallback as gr } from "react";
1
+ import { jsxs as E, jsx as n, Fragment as ye } from "react/jsx-runtime";
2
+ import { O as Be, s as Ve, S as De, f$1 as $e, M as ze, U as Ue, r as Fe, o as Pe, n as fe, l as Ge, a as q, isLastMessageFromRole as he, x as xe, CANCEL as je, CLEAR as We, ACTION_RESET as be, ROLE_ASSISTANT as M, ROLE_INTERNAL as Z, ROLE_USER as K, Wr as ee, ROLE_SYSTEM as Ye, ROLE_HIDDEN as qe, MODEL_GPT4 as ke, STATS_SEPARATOR as le, ACTION_MODEL as Ce, ACTION_MESSAGE as V, TYPE_QUESTION as Je, SEND as Qe, ACTION_STREAMING as Te, ERROR_MESSAGE as Xe, getMessageContaintWrapperClass as Ke, MessagesContainerHeader as Ze, ACTION_SEARCH as er, ACTION_SORT as rr, ACTION_RESTORE as tr, ACTION_LOCATION as B, getCurrentGeoLocation as or, c as sr, AppFooter as ar, LOCAL_STORAGE_PREFIX as J, LOCAL_STORAGE_SEARCH as nr, LOCAL_STORAGE_SORT as lr, LOCAL_STORAGE_LOCATION as cr } from "./index.CJJY2C9o.js";
3
+ import { g as ve, AppContext as P, restCall as ir, E as Q, serviceCall as ce, SERVICE_TYPES as ie, HistoryContext as dr, k as ur } from "./useLocalStorage.CzVJ5Eng.js";
4
+ import pr, { useState as I, useEffect as S, useRef as x, useLayoutEffect as z, useContext as re, lazy as mr, Suspense as de, useReducer as ue, useCallback as gr } from "react";
5
5
  import g from "clsx";
6
6
  const yr = ({
7
7
  className: e,
@@ -10,8 +10,8 @@ const yr = ({
10
10
  title: t,
11
11
  monotone: s,
12
12
  ...a
13
- }) => /* @__PURE__ */ S(
14
- Ce,
13
+ }) => /* @__PURE__ */ E(
14
+ ve,
15
15
  {
16
16
  defaultViewBox: "0 0 448 512",
17
17
  defaultClassName: "size-5",
@@ -39,7 +39,7 @@ const yr = ({
39
39
  monotone: s,
40
40
  ...a
41
41
  }) => /* @__PURE__ */ n(
42
- Ce,
42
+ ve,
43
43
  {
44
44
  defaultViewBox: "0 0 512 512",
45
45
  defaultClassName: "size-5",
@@ -101,27 +101,27 @@ const yr = ({
101
101
  copyToClipboardMode: h = "system",
102
102
  spacing: c
103
103
  }) => {
104
- const [y, i] = R(!1), p = Cr({ kind: r, className: o, spacing: c }), b = !!a && (typeof a == "function" || typeof a == "string" || typeof e == "string"), T = () => {
104
+ const [y, i] = I(!1), u = Cr({ kind: r, className: o, spacing: c }), b = !!a && (typeof a == "function" || typeof a == "string" || typeof e == "string"), v = () => {
105
105
  i(!0), typeof a == "function" ? a(e) : typeof a == "string" ? navigator.clipboard.writeText(a) : typeof e == "string" && navigator.clipboard.writeText(e);
106
106
  };
107
- return E(() => {
107
+ return S(() => {
108
108
  let d;
109
109
  return y && (d = window.setTimeout(() => {
110
110
  i(!1);
111
111
  }, 3e3)), () => {
112
112
  clearTimeout(d);
113
113
  };
114
- }, [y]), /* @__PURE__ */ S("div", { className: p.wrapper, children: [
115
- /* @__PURE__ */ S("div", { children: [
116
- /* @__PURE__ */ n("div", { className: p.main, children: e }),
117
- t && Object.keys(t).map((d) => t[d] ? /* @__PURE__ */ n("div", { className: "prose-p:m-0", children: /* @__PURE__ */ S("p", { className: p.footer, children: [
114
+ }, [y]), /* @__PURE__ */ E("div", { className: u.wrapper, children: [
115
+ /* @__PURE__ */ E("div", { children: [
116
+ /* @__PURE__ */ n("div", { className: u.main, children: e }),
117
+ t && Object.keys(t).map((d) => t[d] ? /* @__PURE__ */ n("div", { className: "prose-p:m-0", children: /* @__PURE__ */ E("p", { className: u.footer, children: [
118
118
  d,
119
119
  ": ",
120
120
  t[d]
121
121
  ] }) }, `-${d}`) : null),
122
122
  s && s
123
123
  ] }),
124
- b && /* @__PURE__ */ n("div", { className: p.copyButton, children: /* @__PURE__ */ n(
124
+ b && /* @__PURE__ */ n("div", { className: u.copyButton, children: /* @__PURE__ */ n(
125
125
  Be,
126
126
  {
127
127
  noBorder: !0,
@@ -130,7 +130,7 @@ const yr = ({
130
130
  mode: h,
131
131
  focusMode: l,
132
132
  label: y ? "Copied to clipboard" : "Copy to clipboard",
133
- onClick: T,
133
+ onClick: v,
134
134
  disabled: y,
135
135
  children: y ? /* @__PURE__ */ n(yr, { className: "size-3" }) : /* @__PURE__ */ n(fr, { className: "size-3" })
136
136
  }
@@ -144,14 +144,14 @@ function vr({
144
144
  onChange: t = () => {
145
145
  }
146
146
  }) {
147
- const [s, a] = R(
147
+ const [s, a] = I(
148
148
  r !== void 0 ? r : o
149
149
  );
150
150
  return e !== void 0 ? [e, t, !0] : [s, (l) => {
151
151
  a(l), t == null || t(l);
152
152
  }, !1];
153
153
  }
154
- const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", Ar = ({
154
+ const Nr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", Ar = ({
155
155
  mode: e
156
156
  }) => g({
157
157
  "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
@@ -165,7 +165,7 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
165
165
  "focus:outline-focus-light": e === "light",
166
166
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
167
167
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
168
- }), Nr = ({
168
+ }), Or = ({
169
169
  noBorder: e,
170
170
  error: r
171
171
  }) => g("border-2", {
@@ -173,7 +173,7 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
173
173
  "focus:border-border-dark": !e && r,
174
174
  "border-border-error-dark": !e && r,
175
175
  "border-transparent": e
176
- }), Or = ({
176
+ }), Sr = ({
177
177
  disabled: e,
178
178
  raw: r,
179
179
  error: o,
@@ -207,18 +207,18 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
207
207
  return "";
208
208
  if (t)
209
209
  return g(
210
- W,
210
+ q,
211
211
  "absolute px-2 cursor-not-allowed opacity-50 font-medium"
212
212
  );
213
213
  if (!e)
214
- return g(W, "absolute px-2 font-medium", {
214
+ return g(q, "absolute px-2 font-medium", {
215
215
  "text-copy-medium": o === "dark",
216
216
  "text-copy-dark": o === "light",
217
217
  "text-copy-dark dark:text-copy-medium": o === "system",
218
218
  "text-copy-medium dark:text-copy-dark": o === "alt-system"
219
219
  });
220
220
  if (e)
221
- return g(W, "absolute px-2 font-medium", {
221
+ return g(q, "absolute px-2 font-medium", {
222
222
  "text-copy-error-light": o === "dark",
223
223
  "text-copy-error-dark": o === "light",
224
224
  "text-copy-error-dark dark:text-copy-error-light": o === "system",
@@ -241,24 +241,24 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
241
241
  e,
242
242
  Pe(h)
243
243
  ), i = o ? g(r) : g(
244
- ge,
244
+ fe,
245
245
  r,
246
- Sr(),
246
+ Nr(),
247
247
  Ar({ mode: c }),
248
248
  Er({ focusMode: t }),
249
- Nr({
249
+ Or({
250
250
  noBorder: a,
251
251
  error: l
252
252
  }),
253
253
  {
254
254
  "disabled:cursor-not-allowed disabled:opacity-50": s
255
255
  }
256
- ), p = o ? void 0 : "sr-only", b = Or({
256
+ ), u = o ? void 0 : "sr-only", b = Sr({
257
257
  disabled: s,
258
258
  raw: o,
259
259
  error: l,
260
260
  mode: c
261
- }), T = wr({
261
+ }), v = wr({
262
262
  error: l,
263
263
  raw: o,
264
264
  mode: c,
@@ -267,9 +267,9 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
267
267
  return {
268
268
  wrapper: y,
269
269
  textArea: i,
270
- accessibleLabel: p,
270
+ accessibleLabel: u,
271
271
  visibleLabel: b,
272
- helperText: T,
272
+ helperText: v,
273
273
  rightElement: d
274
274
  };
275
275
  }, Rr = ({
@@ -288,7 +288,7 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
288
288
  helperTextOffset: a,
289
289
  scrollHeight: e
290
290
  };
291
- }, Te = pr.forwardRef(
291
+ }, Ne = pr.forwardRef(
292
292
  ({
293
293
  id: e,
294
294
  name: r,
@@ -301,35 +301,35 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
301
301
  focusMode: c = "system",
302
302
  value: y,
303
303
  defaultValue: i,
304
- disabled: p = !1,
304
+ disabled: u = !1,
305
305
  noBorder: b = !1,
306
- labelId: T,
306
+ labelId: v,
307
307
  helperText: d = "",
308
- helperTextOnFocus: N = !1,
309
- rightElement: C,
310
- onChange: m,
311
- onFocus: u,
312
- onBlur: B,
313
- spacing: O,
314
- ...Se
315
- }, Ae) => {
316
- const v = x(null), Ee = $e([Ae, v]), V = x(null), F = x(80), re = x(-25), M = x(null), te = x(30), P = x(null), I = ze({ id: e, prefix: `${ge}-` }), [Ne, Oe] = R(0), [we, oe] = R(
317
- !!(!N && d)
318
- ), Le = `${r} error, ${d}`, w = Lr({
308
+ helperTextOnFocus: w = !1,
309
+ rightElement: T,
310
+ onChange: p,
311
+ onFocus: C,
312
+ onBlur: L,
313
+ spacing: N,
314
+ ...D
315
+ }, m) => {
316
+ const A = x(null), Ee = $e([m, A]), $ = x(null), G = x(80), oe = x(-25), _ = x(null), se = x(30), j = x(null), H = ze({ id: e, prefix: `${fe}-` }), [Oe, Se] = I(0), [we, ae] = I(
317
+ !!(!w && d)
318
+ ), Le = `${r} error, ${d}`, R = Lr({
319
319
  className: a,
320
320
  textAreaClassName: l,
321
321
  error: t,
322
322
  raw: s,
323
323
  focusMode: c,
324
- disabled: p,
324
+ disabled: u,
325
325
  noBorder: b,
326
- spacing: O,
326
+ spacing: N,
327
327
  mode: h
328
- }), [A, Re] = vr({
328
+ }), [O, Re] = vr({
329
329
  value: y,
330
330
  defaultValue: i,
331
331
  onChange: (k) => {
332
- m && m({
332
+ p && p({
333
333
  target: {
334
334
  value: k
335
335
  }
@@ -338,46 +338,46 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
338
338
  }), Me = (k) => {
339
339
  Re(k.target.value);
340
340
  }, Ie = (k) => {
341
- N && d && oe(!0), u && u(k);
341
+ w && d && ae(!0), C && C(k);
342
342
  }, _e = (k) => {
343
- N && d && !A && oe(!1), B && B(k);
343
+ w && d && !O && ae(!1), L && L(k);
344
344
  };
345
- return D(() => {
346
- !s && C && V.current && V.current.offsetWidth > 0 && Oe(V.current.offsetWidth + 18 + 10);
347
- }, [C, s]), D(() => {
348
- s || v && v.current && A !== void 0 && (v.current.style.height = "inherit", v.current.style.height = v.current.scrollHeight + "px");
349
- }, [A, s]), D(() => {
345
+ return z(() => {
346
+ !s && T && $.current && $.current.offsetWidth > 0 && Se($.current.offsetWidth + 18 + 10);
347
+ }, [T, s]), z(() => {
348
+ s || A && A.current && O !== void 0 && (A.current.style.height = "inherit", A.current.style.height = A.current.scrollHeight + "px");
349
+ }, [O, s]), z(() => {
350
350
  s || setTimeout(() => {
351
351
  var k;
352
- (k = M == null ? void 0 : M.current) == null || k.style.setProperty(
352
+ (k = _ == null ? void 0 : _.current) == null || k.style.setProperty(
353
353
  "--av-text-area-wrapper-transition",
354
- A ? "none" : "all 0.2s ease-out"
354
+ O ? "none" : "all 0.2s ease-out"
355
355
  );
356
356
  }, 0);
357
- }, [A, s]), D(() => {
358
- var k, se;
359
- if (!s && v && v.current && A !== void 0) {
360
- const { labelOffset: G, helperTextOffset: j, scrollHeight: He } = Rr({
361
- scrollHeight: v.current.scrollHeight,
362
- currentHeight: F.current,
363
- currentLabelOffset: re.current,
364
- currentHelperTextOffset: te.current
357
+ }, [O, s]), z(() => {
358
+ var k, ne;
359
+ if (!s && A && A.current && O !== void 0) {
360
+ const { labelOffset: W, helperTextOffset: Y, scrollHeight: He } = Rr({
361
+ scrollHeight: A.current.scrollHeight,
362
+ currentHeight: G.current,
363
+ currentLabelOffset: oe.current,
364
+ currentHelperTextOffset: se.current
365
365
  });
366
- G && (re.current = G, (k = M == null ? void 0 : M.current) == null || k.style.setProperty(
366
+ W && (oe.current = W, (k = _ == null ? void 0 : _.current) == null || k.style.setProperty(
367
367
  "--av-text-area-label",
368
- `${G}px`
369
- )), j && (te.current = j, (se = P == null ? void 0 : P.current) == null || se.style.setProperty(
368
+ `${W}px`
369
+ )), Y && (se.current = Y, (ne = j == null ? void 0 : j.current) == null || ne.style.setProperty(
370
370
  "--av-text-area-helper-text",
371
- `${j}px`
372
- )), F.current = He || F.current;
371
+ `${Y}px`
372
+ )), G.current = He || G.current;
373
373
  }
374
- }, [A, s]), /* @__PURE__ */ S("div", { className: w.wrapper, children: [
374
+ }, [O, s]), /* @__PURE__ */ E("div", { className: R.wrapper, children: [
375
375
  /* @__PURE__ */ n(
376
376
  "label",
377
377
  {
378
- htmlFor: I,
379
- id: T,
380
- className: w.accessibleLabel,
378
+ htmlFor: H,
379
+ id: v,
380
+ className: R.accessibleLabel,
381
381
  children: o
382
382
  }
383
383
  ),
@@ -385,87 +385,87 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
385
385
  "textarea",
386
386
  {
387
387
  ref: Ee,
388
- id: I,
388
+ id: H,
389
389
  name: r,
390
- disabled: p,
390
+ disabled: u,
391
391
  placeholder: s ? void 0 : " ",
392
- className: w.textArea,
392
+ className: R.textArea,
393
393
  rows: 1,
394
- ...d && { "aria-describedby": `${I}-helper` },
394
+ ...d && { "aria-describedby": `${H}-helper` },
395
395
  ...t && { "aria-invalid": "true" },
396
- ...C && !s && { style: { paddingRight: Ne } },
397
- value: A,
396
+ ...T && !s && { style: { paddingRight: Oe } },
397
+ value: O,
398
398
  onChange: Me,
399
399
  onFocus: Ie,
400
400
  onBlur: _e,
401
- ...Se
401
+ ...D
402
402
  }
403
403
  ),
404
404
  !s && /* @__PURE__ */ n(
405
405
  "label",
406
406
  {
407
- ref: M,
407
+ ref: _,
408
408
  "aria-hidden": !0,
409
- htmlFor: I,
410
- className: w.visibleLabel,
409
+ htmlFor: H,
410
+ className: R.visibleLabel,
411
411
  children: o
412
412
  }
413
413
  ),
414
414
  we && /* @__PURE__ */ n(
415
415
  "div",
416
416
  {
417
- ref: P,
418
- id: `${I}-helper`,
419
- className: w.helperText,
417
+ ref: j,
418
+ id: `${H}-helper`,
419
+ className: R.helperText,
420
420
  children: d
421
421
  }
422
422
  ),
423
- C && /* @__PURE__ */ n(
423
+ T && /* @__PURE__ */ n(
424
424
  "div",
425
425
  {
426
- ref: V,
427
- className: w.rightElement,
428
- children: C
426
+ ref: $,
427
+ className: R.rightElement,
428
+ children: T
429
429
  }
430
430
  ),
431
431
  t && d && /* @__PURE__ */ n(Ue, { politeness: "polite", clearAnnouncementDelay: 500, children: Le })
432
432
  ] });
433
433
  }
434
434
  );
435
- Te.displayName = "TextArea";
435
+ Ne.displayName = "TextArea";
436
436
  var f = [];
437
- for (var J = 0; J < 256; ++J)
438
- f.push((J + 256).toString(16).slice(1));
437
+ for (var X = 0; X < 256; ++X)
438
+ f.push((X + 256).toString(16).slice(1));
439
439
  function Mr(e, r = 0) {
440
440
  return (f[e[r + 0]] + f[e[r + 1]] + f[e[r + 2]] + f[e[r + 3]] + "-" + f[e[r + 4]] + f[e[r + 5]] + "-" + f[e[r + 6]] + f[e[r + 7]] + "-" + f[e[r + 8]] + f[e[r + 9]] + "-" + f[e[r + 10]] + f[e[r + 11]] + f[e[r + 12]] + f[e[r + 13]] + f[e[r + 14]] + f[e[r + 15]]).toLowerCase();
441
441
  }
442
- var $, Ir = new Uint8Array(16);
442
+ var U, Ir = new Uint8Array(16);
443
443
  function _r() {
444
- if (!$ && ($ = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !$))
444
+ if (!U && (U = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !U))
445
445
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
446
- return $(Ir);
446
+ return U(Ir);
447
447
  }
448
448
  var Hr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
449
- const de = {
449
+ const pe = {
450
450
  randomUUID: Hr
451
451
  };
452
- function ee(e, r, o) {
453
- if (de.randomUUID && !r && !e)
454
- return de.randomUUID();
452
+ function te(e, r, o) {
453
+ if (pe.randomUUID && !r && !e)
454
+ return pe.randomUUID();
455
455
  e = e || {};
456
456
  var t = e.random || (e.rng || _r)();
457
457
  return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, Mr(t);
458
458
  }
459
459
  const Br = () => {
460
- const { dispatch: e, state: r } = Z(U), o = "mt-2 flex justify-center rounded-md", t = x(null), s = x(!1), a = (l) => {
460
+ const { dispatch: e, state: r } = re(P), o = "mt-2 flex justify-center rounded-md", t = x(null), s = x(!1), a = (l) => {
461
461
  l.preventDefault(), e({
462
- type: he
462
+ type: be
463
463
  });
464
464
  };
465
- return E(() => {
465
+ return S(() => {
466
466
  (r == null ? void 0 : r.streaming) === !0 && !s.current && t.current && (s.current = !0, t.current.focus()), (r == null ? void 0 : r.streaming) === !1 && (s.current = !1);
467
- }, [r]), ye(L, r) ? /* @__PURE__ */ n("div", { className: o, children: /* @__PURE__ */ n(
468
- fe,
467
+ }, [r]), he(M, r) ? /* @__PURE__ */ n("div", { className: o, children: /* @__PURE__ */ n(
468
+ xe,
469
469
  {
470
470
  ref: t,
471
471
  noBorder: !0,
@@ -475,19 +475,19 @@ const Br = () => {
475
475
  children: r != null && r.streaming ? je : We
476
476
  }
477
477
  ) }) : null;
478
- }, ue = mr(() => import("./LazyMessageAssistant.IDa3mLgE.js").then((e) => e.LazyMessageAssistant)), Vr = () => {
479
- const { state: e } = Z(U);
480
- return /* @__PURE__ */ S(me, { children: [
478
+ }, me = mr(() => import("./LazyMessageAssistant.Ct8xA2HE.js").then((e) => e.LazyMessageAssistant)), Vr = () => {
479
+ const { state: e } = re(P);
480
+ return /* @__PURE__ */ E(ye, { children: [
481
481
  e && e.messages.length > 0 && e.messages.map((r, o) => {
482
482
  const { role: t, content: s, name: a, processingTime: l } = r.message;
483
- return (t === L || t === X) && s ? /* @__PURE__ */ n(ce, { fallback: /* @__PURE__ */ n("span", {}), children: /* @__PURE__ */ n(
484
- ue,
483
+ return (t === M || t === Z) && s ? /* @__PURE__ */ n(de, { fallback: /* @__PURE__ */ n("span", {}), children: /* @__PURE__ */ n(
484
+ me,
485
485
  {
486
486
  name: a,
487
487
  processingTime: l,
488
488
  children: s
489
489
  }
490
- ) }, `${o}-${t}`) : t === Q && s ? /* @__PURE__ */ n(
490
+ ) }, `${o}-${t}`) : t === K && s ? /* @__PURE__ */ n(
491
491
  Tr,
492
492
  {
493
493
  kind: "right",
@@ -498,45 +498,45 @@ const Br = () => {
498
498
  `${o}-${t}`
499
499
  ) : null;
500
500
  }),
501
- ye(Q, e) && /* @__PURE__ */ n(ce, { fallback: /* @__PURE__ */ n("span", {}), children: /* @__PURE__ */ n(ue, { loading: !0 }) })
501
+ he(K, e) && /* @__PURE__ */ n(de, { fallback: /* @__PURE__ */ n("span", {}), children: /* @__PURE__ */ n(me, { loading: !0 }) })
502
502
  ] });
503
- }, z = (e, r) => {
503
+ }, F = (e, r) => {
504
504
  e({
505
- type: ke,
505
+ type: Te,
506
506
  payload: {
507
507
  streaming: r
508
508
  }
509
509
  });
510
- }, pe = (e) => {
511
- z(e, !1), e({
512
- type: H,
510
+ }, ge = (e) => {
511
+ F(e, !1), e({
512
+ type: V,
513
513
  payload: {
514
514
  message: {
515
- role: X,
515
+ role: Z,
516
516
  content: Xe
517
517
  }
518
518
  }
519
519
  });
520
520
  }, Dr = () => {
521
- const { state: e, dispatch: r } = Z(U), [o, t] = R(""), { getAccessToken: s, user: a } = K(), l = x(!1), h = x(null), c = x(
521
+ const { state: e, dispatch: r } = re(P), [o, t] = I(""), { getAccessToken: s, user: a } = ee(), l = x(!1), h = x(null), c = x(
522
522
  null
523
523
  );
524
- E(() => {
524
+ S(() => {
525
525
  (async () => {
526
- var p;
526
+ var u;
527
527
  if (!e || e.messages.length === 0) {
528
- (p = c == null ? void 0 : c.current) == null || p.cancel();
528
+ (u = c == null ? void 0 : c.current) == null || u.cancel();
529
529
  return;
530
530
  }
531
531
  const i = e.messages[e.messages.length - 1];
532
- if (!(e.messages.length === 0 || i.message.role === L || i.message.role === Ye || i.message.role === X || i.message.role === qe))
532
+ if (!(e.messages.length === 0 || i.message.role === M || i.message.role === Ye || i.message.role === Z || i.message.role === qe))
533
533
  try {
534
534
  const b = await ir({
535
535
  accessToken: await s(),
536
536
  name: "generate",
537
537
  data: {
538
538
  messages: e.messages,
539
- model: xe,
539
+ model: ke,
540
540
  user: (a == null ? void 0 : a.username) || "",
541
541
  id: e.id,
542
542
  location: e.location,
@@ -544,74 +544,74 @@ const Br = () => {
544
544
  }
545
545
  });
546
546
  if (b && b.ok) {
547
- const T = ee();
547
+ const v = te();
548
548
  c.current = b.body.getReader();
549
549
  const d = new TextDecoder();
550
550
  for (; ; ) {
551
- z(r, !0);
552
- const { done: N, value: C } = await c.current.read();
553
- if (N) {
554
- z(r, !1);
551
+ F(r, !0);
552
+ const { done: w, value: T } = await c.current.read();
553
+ if (w) {
554
+ F(r, !1);
555
555
  break;
556
556
  }
557
- const m = d.decode(C, { stream: !0 }), u = m.indexOf(ae);
558
- if (u !== -1) {
559
- const B = m.substring(0, u), O = JSON.parse(
560
- m.substring(u + ae.length)
557
+ const p = d.decode(T, { stream: !0 }), C = p.indexOf(le);
558
+ if (C !== -1) {
559
+ const L = p.substring(0, C), N = JSON.parse(
560
+ p.substring(C + le.length)
561
561
  );
562
562
  r({
563
- type: be,
563
+ type: Ce,
564
564
  payload: {
565
- model: O.model,
566
- usage: O.usage
565
+ model: N.model,
566
+ usage: N.usage
567
567
  }
568
568
  }), r({
569
- type: H,
569
+ type: V,
570
570
  payload: {
571
571
  message: {
572
- content: B,
573
- role: L,
574
- messageId: T,
575
- processingTime: O.processingTime,
576
- name: O.name
572
+ content: L,
573
+ role: M,
574
+ messageId: v,
575
+ processingTime: N.processingTime,
576
+ name: N.name
577
577
  }
578
578
  }
579
- }), z(r, !1);
579
+ }), F(r, !1);
580
580
  break;
581
581
  } else
582
582
  r({
583
- type: H,
583
+ type: V,
584
584
  payload: {
585
585
  message: {
586
- content: m,
587
- role: L,
588
- messageId: T
586
+ content: p,
587
+ role: M,
588
+ messageId: v
589
589
  }
590
590
  }
591
591
  });
592
592
  }
593
593
  } else
594
- pe(r);
594
+ ge(r);
595
595
  } catch (b) {
596
- console.error(b), pe(r);
596
+ console.error(b), ge(r);
597
597
  }
598
598
  })();
599
599
  }, [e == null ? void 0 : e.messages]);
600
600
  const y = async (i) => {
601
601
  i.preventDefault(), r({
602
- type: H,
602
+ type: V,
603
603
  payload: {
604
604
  message: {
605
- role: Q,
605
+ role: K,
606
606
  content: o
607
607
  }
608
608
  }
609
609
  }), t("");
610
610
  };
611
- return E(() => {
611
+ return S(() => {
612
612
  (e == null ? void 0 : e.streaming) === !1 && !l.current && h.current && (l.current = !0, h.current.focus()), (e == null ? void 0 : e.streaming) === !0 && l.current === !0 && (l.current = !1);
613
613
  }, [e]), /* @__PURE__ */ n("form", { className: "mt-2", onSubmit: y, children: /* @__PURE__ */ n(
614
- Te,
614
+ Ne,
615
615
  {
616
616
  mode: "dark",
617
617
  focusMode: "light",
@@ -624,7 +624,7 @@ const Br = () => {
624
624
  value: o,
625
625
  onChange: (i) => t(i.target.value),
626
626
  rightElement: /* @__PURE__ */ n(
627
- fe,
627
+ xe,
628
628
  {
629
629
  disabled: e == null ? void 0 : e.streaming,
630
630
  noBorder: !0,
@@ -637,9 +637,9 @@ const Br = () => {
637
637
  }
638
638
  ) });
639
639
  }, $r = () => {
640
- const { isAuthenticated: e } = K(), r = Ke(e);
641
- return /* @__PURE__ */ S(me, { children: [
642
- /* @__PURE__ */ S("div", { className: r, children: [
640
+ const { isAuthenticated: e } = ee(), r = Ke(e);
641
+ return /* @__PURE__ */ E(ye, { children: [
642
+ /* @__PURE__ */ E("div", { className: r, children: [
643
643
  /* @__PURE__ */ n(Ze, {}),
644
644
  /* @__PURE__ */ n(Vr, {})
645
645
  ] }),
@@ -673,7 +673,7 @@ const Br = () => {
673
673
  messages: o
674
674
  };
675
675
  }
676
- if ((r == null ? void 0 : r.type) === H) {
676
+ if ((r == null ? void 0 : r.type) === V) {
677
677
  const o = r.payload.message.role, t = r.payload.message.content, s = r.payload.message.name, a = r.payload.message.processingTime, l = r.payload.message.messageId;
678
678
  if (o !== "") {
679
679
  const h = {
@@ -683,12 +683,12 @@ const Br = () => {
683
683
  processingTime: a,
684
684
  messageId: l
685
685
  };
686
- if (o === L) {
686
+ if (o === M) {
687
687
  const c = e.messages.findIndex(
688
688
  (y) => y.message.messageId === l
689
689
  );
690
690
  if (c !== -1) {
691
- const y = e.messages.map((i, p) => p === c ? {
691
+ const y = e.messages.map((i, u) => u === c ? {
692
692
  message: {
693
693
  ...i.message,
694
694
  content: `${i.message.content}${t}`,
@@ -721,59 +721,59 @@ const Br = () => {
721
721
  };
722
722
  }
723
723
  }
724
- return (r == null ? void 0 : r.type) === he ? {
725
- id: ee(),
724
+ return (r == null ? void 0 : r.type) === be ? {
725
+ id: te(),
726
726
  model: e.model,
727
727
  usage: 0,
728
728
  messages: [],
729
729
  location: e.location,
730
730
  isComponent: e.isComponent
731
- } : (r == null ? void 0 : r.type) === be ? {
731
+ } : (r == null ? void 0 : r.type) === Ce ? {
732
732
  id: e.id,
733
733
  model: r.payload.model,
734
734
  usage: r.payload.usage,
735
735
  messages: e.messages,
736
736
  location: e.location,
737
737
  isComponent: e.isComponent
738
- } : (r == null ? void 0 : r.type) === _ ? {
738
+ } : (r == null ? void 0 : r.type) === B ? {
739
739
  id: e.id,
740
740
  model: e.model,
741
741
  usage: e.usage,
742
742
  messages: e.messages,
743
743
  location: r.payload.location,
744
744
  isComponent: e.isComponent
745
- } : (r == null ? void 0 : r.type) === ke ? {
745
+ } : (r == null ? void 0 : r.type) === Te ? {
746
746
  ...e,
747
747
  streaming: r.payload.streaming
748
748
  } : e;
749
749
  };
750
- function ve({ isComponent: e = !1 }) {
751
- const r = x(!1), o = x(!1), t = x(!1), { isAuthenticated: s, getAccessToken: a } = K(), [l] = q({
752
- key: Y + nr,
750
+ function Ae({ isComponent: e = !1 }) {
751
+ const r = x(!1), o = x(!1), t = x(!1), { isAuthenticated: s, getAccessToken: a } = ee(), [l] = Q({
752
+ key: J + nr,
753
753
  initialValue: ""
754
- }), [h] = q({
755
- key: Y + lr,
754
+ }), [h] = Q({
755
+ key: J + lr,
756
756
  initialValue: ur.ASC
757
- }), [c, y] = q({
758
- key: Y + cr,
757
+ }), [c, y] = Q({
758
+ key: J + cr,
759
759
  initialValue: { latitude: 0, longitude: 0, accuracy: 0 }
760
- }), [i, p] = ie(Ur, {
761
- id: ee(),
762
- model: xe,
760
+ }), [i, u] = ue(Ur, {
761
+ id: te(),
762
+ model: ke,
763
763
  usage: 0,
764
764
  messages: [],
765
765
  isComponent: e
766
- }), [b, T] = ie(zr, {
766
+ }), [b, v] = ue(zr, {
767
767
  searchString: l,
768
768
  sortedCell: "timestamp",
769
769
  sortDirection: h
770
- }), [d, N] = R({
770
+ }), [d, w] = I({
771
771
  version: "",
772
772
  models: [],
773
773
  plugins: []
774
- }), C = gr(() => {
775
- p({
776
- type: _,
774
+ }), T = gr(() => {
775
+ u({
776
+ type: B,
777
777
  payload: {
778
778
  location: {
779
779
  ...c,
@@ -782,75 +782,74 @@ function ve({ isComponent: e = !1 }) {
782
782
  }
783
783
  });
784
784
  }, [c]);
785
- return E(() => {
785
+ return S(() => {
786
786
  d.version !== "" || t.current || (async () => {
787
787
  try {
788
788
  t.current = !0;
789
- const m = await ne({
789
+ const p = await ce({
790
790
  accessToken: await a(),
791
- type: le.ABOUT
791
+ type: ie.ABOUT
792
792
  });
793
- t.current = !1, m.status === 200 && N(m.data);
793
+ t.current = !1, p.status === 200 && w(p.data);
794
794
  } catch {
795
795
  }
796
796
  })();
797
- }, [d, a]), E(() => {
797
+ }, [d, a]), S(() => {
798
798
  s && (r.current || ((!c || c.accuracy === 0) && (r.current = !0, (async () => {
799
- const m = await or();
800
- y(m), p({
801
- type: _,
799
+ const p = await or();
800
+ y(p), u({
801
+ type: B,
802
802
  payload: {
803
- location: m
803
+ location: p
804
804
  }
805
805
  });
806
- })()), c && c.accuracy !== 0 && !i.location && p({
807
- type: _,
806
+ })()), c && c.accuracy !== 0 && !i.location && u({
807
+ type: B,
808
808
  payload: {
809
809
  location: c
810
810
  }
811
811
  })));
812
- }, [s, c, y, i.location]), E(() => {
813
- !i.location || i.location.accuracy === 0 || i.location.city || o.current || (async () => {
814
- var m;
812
+ }, [s, c, y, i.location]), S(() => {
813
+ !i.location || i.location.accuracy === 0 || i.location.city || i.location.displayName || o.current || (async () => {
814
+ var p, C, L, N, D;
815
815
  o.current = !0;
816
816
  try {
817
- const u = await ne({
817
+ const m = await ce({
818
818
  accessToken: await a(),
819
- type: le.GET_LOCATION,
819
+ type: ie.GET_LOCATION,
820
820
  params: {
821
821
  latitude: c.latitude,
822
822
  longitude: c.longitude
823
823
  }
824
824
  });
825
- o.current = !1, u.status !== 200 || ((m = u == null ? void 0 : u.errors) == null ? void 0 : m.length) > 0 || !u.data || !u.data.city || !u.data.region || !u.data.country ? C() : p({
826
- type: _,
825
+ o.current = !1, m.status !== 200 || ((p = m == null ? void 0 : m.errors) == null ? void 0 : p.length) > 0 ? T() : u({
826
+ type: B,
827
827
  payload: {
828
828
  location: {
829
829
  ...c,
830
- city: u.data.city,
831
- region: u.data.region,
832
- regionShort: u.data.regionShort,
833
- country: u.data.country,
834
- countryShort: u.data.countryShort
830
+ country: (C = m == null ? void 0 : m.data) == null ? void 0 : C.country,
831
+ state: (L = m == null ? void 0 : m.data) == null ? void 0 : L.state,
832
+ city: ((N = m == null ? void 0 : m.data) == null ? void 0 : N.city) || "N/A",
833
+ displayName: (D = m == null ? void 0 : m.data) == null ? void 0 : D.displayName
835
834
  }
836
835
  }
837
836
  });
838
837
  } catch {
839
- C();
838
+ T();
840
839
  }
841
840
  })();
842
- }, [i, c, a, C]), E(() => {
843
- var m;
844
- (m = document.getElementById("logo")) == null || m.classList.add("fadeOut"), setTimeout(() => {
845
- var u;
846
- (u = document.getElementById("root")) == null || u.classList.replace("app-hidden", "fadeIn");
841
+ }, [i, c, a, T]), S(() => {
842
+ var p;
843
+ (p = document.getElementById("logo")) == null || p.classList.add("fadeOut"), setTimeout(() => {
844
+ var C;
845
+ (C = document.getElementById("root")) == null || C.classList.replace("app-hidden", "fadeIn");
847
846
  }, 500);
848
- }), /* @__PURE__ */ n(U.Provider, { value: { state: i, dispatch: p, serverStats: d }, children: /* @__PURE__ */ S(
847
+ }), /* @__PURE__ */ n(P.Provider, { value: { state: i, dispatch: u, serverStats: d }, children: /* @__PURE__ */ E(
849
848
  dr.Provider,
850
849
  {
851
850
  value: {
852
851
  state: b,
853
- dispatch: T
852
+ dispatch: v
854
853
  },
855
854
  children: [
856
855
  /* @__PURE__ */ n(sr, { children: /* @__PURE__ */ n($r, {}) }),
@@ -859,8 +858,8 @@ function ve({ isComponent: e = !1 }) {
859
858
  }
860
859
  ) });
861
860
  }
862
- ve.displayName = "App";
863
- const Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: ve }, Symbol.toStringTag, { value: "Module" }));
861
+ Ae.displayName = "App";
862
+ const Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Ae }, Symbol.toStringTag, { value: "Module" }));
864
863
  export {
865
864
  Yr as App,
866
865
  Tr as T