@gentiq/ui 1.0.0-alpha.6 → 1.0.0-alpha.8

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,12 +1,12 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as c, Fragment as L } from "react/jsx-runtime";
2
+ import { jsx as n, jsxs as d, Fragment as $ } from "react/jsx-runtime";
3
3
  import { QuoteIcon as Qe, ChevronDownIcon as Ke, BrainIcon as er, ImagePlusIcon as tr, CodeIcon as nr, DownloadIcon as dt, GlobeIcon as sr, WrenchIcon as rr, XCircleIcon as Cn, CopyIcon as zn, BanIcon as ar, CheckCircleIcon as or, ClockIcon as en, ShieldQuestionIcon as ir, CircleIcon as lr, FileIcon as In, ListChecksIcon as cr, ArrowUpIcon as Tn, BookIcon as dr, ArrowDownIcon as ur, XIcon as _e, CheckIcon as vt, RefreshCcwIcon as mr, ThumbsUpIcon as hr, ThumbsDownIcon as pr, PencilIcon as fr, SquareIcon as tn, AlertCircleIcon as gr, RotateCwIcon as br, CameraOffIcon as xr, Loader2Icon as yt, RotateCcwIcon as vr, SwitchCameraIcon as yr, PlusIcon as wr, FileTextIcon as Nr, ImagesIcon as kr, CameraIcon as _r, MicIcon as Sr, Wrench as Mn, RefreshCw as Cr, OctagonXIcon as zr, TriangleAlertIcon as Ir, InfoIcon as Tr, CircleCheckIcon as Mr, User as Pr, Palette as Pn, ShieldCheck as Rr, Settings as Re, Globe as Ar, X as wt, AtSign as Dr, Mail as Or, Smartphone as Er, Lock as Lr, Save as qr, Zap as $r, LogOut as Rn, ChevronRight as jr, Check as An, PanelLeftIcon as Fr, PinOff as Ur, Pin as Dn, Share2 as Br, Link2Off as Hr, Pencil as Vr, Trash as Gr, MoreVertical as Wr, SquarePen as On, Search as En, ArrowLeft as Qr } from "lucide-react";
4
- import * as Z from "react";
5
- import { useRef as j, useState as C, useEffect as D, useContext as Se, useMemo as O, createContext as Oe, useSyncExternalStore as Ln, useLayoutEffect as qn, memo as Ee, useCallback as pe, Component as Kr, Suspense as Ve, lazy as Nt, Children as Xr, forwardRef as $n, createElement as Yr, useId as Jr } from "react";
6
- import { withDefaults as ie, useServerConfig as Le, createOptionsStore as kt, useOptionsStore as jn, useGentiqOptions as W, useGentiqTranslation as _, References as Ae, useMessage as G, useGentiqLanguage as B, useToolApproval as Zr, useFileUrl as ea, useChatReferencesActions as ta, useThreadView as ve, useThreadScope as Fn, Thread as De, localizeError as na, Message as le, ActionBar as be, getLocalizedErrorMessage as fe, Composer as he, useComposer as _t, useGentiqUser as Un, useComposerVoice as Bn, useGentiqStatus as Hn, useGentiqFeature as sa, useComposerRoot as ra, useGentiqEntitlement as St, useTheme as Ce, useThreadSelection as Ct, ThreadSelectionProvider as Vn, useThread as aa, GentiqRuntimeProvider as oa, useLoginCodeExchange as ia, useAuthSession as la, useGentiqApi as Xe, useGentiqQueryClient as Gn, useGentiqKeys as ca, useThreadListItem as Wn, useThreads as da, ThreadList as se, ThreadRename as $e } from "@gentiq/react";
4
+ import * as ee from "react";
5
+ import { useRef as U, useState as C, useEffect as D, useContext as Se, useMemo as O, createContext as Oe, useSyncExternalStore as Ln, useLayoutEffect as qn, memo as Ee, useCallback as de, Component as Kr, Suspense as Ve, lazy as Nt, Children as Xr, forwardRef as $n, createElement as Yr, useId as Jr } from "react";
6
+ import { withDefaults as ie, useServerConfig as Le, createOptionsStore as kt, useOptionsStore as jn, useGentiqOptions as K, useGentiqTranslation as k, References as Ae, useMessage as W, useGentiqLanguage as V, useToolApproval as Zr, useFileUrl as ea, useChatReferencesActions as ta, useThreadView as ve, useThreadScope as Fn, Thread as De, localizeError as na, Message as le, ActionBar as be, getLocalizedErrorMessage as fe, Composer as pe, useComposer as _t, useGentiqUser as Un, useComposerVoice as Bn, useGentiqStatus as Hn, useGentiqFeature as sa, useComposerRoot as ra, useGentiqEntitlement as St, useTheme as Ce, useThreadSelection as Ct, ThreadSelectionProvider as Vn, useThread as aa, GentiqRuntimeProvider as oa, useLoginCodeExchange as ia, useAuthSession as la, useGentiqApi as Xe, useGentiqQueryClient as Gn, useGentiqKeys as ca, useThreadListItem as Wn, useThreads as da, ThreadList as se, ThreadRename as $e } from "@gentiq/react";
7
7
  import { Slot as ua } from "@radix-ui/react-slot";
8
- import { c as x, u as Q, C as zt, a as It, b as Tt, D as qe, d as Qn, B as E, e as Mt, f as Kn, g as Xn, h as ma, L as Ue, T as Ye, i as Je, j as Ze, k as Yn, l as Pt, m as Rt, n as At, o as we, p as ha, q as Jn, r as pa, s as Zn, t as Dt, v as fa, w as Ot, x as ut, y as Et, z as Lt, A as ga, S as ba, E as xa, P as va, F as nn, G as ce, H as es, I as ts, J as ns, K as ss, M as rs, N as Ge, O as ya, Q as wa, R as Na, U as ka, V as _a, W as Sa, X as Ca, Y as za, Z as Ia, _ as Ta, $ as Ma, a0 as Pa } from "./shared-BtZa4J_w.js";
9
- import { toast as F, Toaster as Ra } from "sonner";
8
+ import { c as x, u as X, C as zt, a as It, b as Tt, D as qe, d as Qn, B as E, e as Mt, f as Kn, g as Xn, h as ma, L as Ue, T as Ye, i as Je, j as Ze, k as Yn, l as Pt, m as Rt, n as At, o as we, p as ha, q as Jn, r as pa, s as Zn, t as Dt, v as fa, w as Ot, x as ut, y as Et, z as Lt, A as ga, S as ba, E as xa, P as va, F as nn, G as ce, H as es, I as ts, J as ns, K as ss, M as rs, N as Ge, O as ya, Q as wa, R as Na, U as ka, V as _a, W as Sa, X as Ca, Y as za, Z as Ia, _ as Ta, $ as Ma, a0 as Pa } from "./shared-BtZa4J_w.js";
9
+ import { toast as B, Toaster as Ra } from "sonner";
10
10
  import { getTextDirection as oe, resolveMessageId as Aa, writeStored as Da, readStored as Oa, isGentiqError as qt, HIDDEN_PART_TYPES as Ea, messageText as La, textOrKey as Ne, evaluateCondition as $t, getAvailableLanguages as qa, getLanguageNativeName as $a, withAttachmentUrls as ja, toGentiqMessages as Fa } from "@gentiq/core";
11
11
  import Ua from "rehype-sanitize";
12
12
  import { defaultRemarkPlugins as Ba, Streamdown as Ha, defaultRehypePlugins as jt } from "streamdown";
@@ -18,7 +18,7 @@ import * as ke from "@radix-ui/react-dialog";
18
18
  import * as Me from "@radix-ui/react-scroll-area";
19
19
  import * as We from "@radix-ui/react-hover-card";
20
20
  function Qa() {
21
- const e = j(null), [t, s] = C(0);
21
+ const e = U(null), [t, s] = C(0);
22
22
  return D(() => {
23
23
  const r = e.current;
24
24
  if (!r) return;
@@ -140,7 +140,7 @@ function at(e, t, s) {
140
140
  };
141
141
  }
142
142
  const mt = Oe(null);
143
- function K(e) {
143
+ function Y(e) {
144
144
  const t = Se(mt), s = Le(), r = O(() => kt(Ft({}, s)), [s]);
145
145
  return jn(t ?? r, e);
146
146
  }
@@ -177,8 +177,8 @@ const Ut = ({ className: e, from: t, ...s }) => /* @__PURE__ */ n(
177
177
  if (!e.includes("\\") && !e.includes("$$")) return e;
178
178
  const t = (s, r, a, o, i, l) => {
179
179
  if (r !== void 0) return s;
180
- const u = a ?? o ?? i ?? "";
181
- return !u.trim() || Ya.test(u) || !Ja(e, l) ? s : `$$${no(u)}$$`;
180
+ const c = a ?? o ?? i ?? "";
181
+ return !c.trim() || Ya.test(c) || !Ja(e, l) ? s : `$$${no(c)}$$`;
182
182
  };
183
183
  return e.replace(Xa, t);
184
184
  }, as = (e) => e.type === "element", os = (e) => {
@@ -406,9 +406,9 @@ const Ro = { linkMode: "text-only" }, Ao = { enabled: !1 }, Ht = (e) => {
406
406
  wordFade: o = !1,
407
407
  mode: i = "static",
408
408
  preserveNewlines: l = !1,
409
- ...u
409
+ ...c
410
410
  }) => {
411
- const d = typeof t == "string" ? t : "", p = O(() => so(d), [d]), m = Po(p), g = O(
411
+ const u = typeof t == "string" ? t : "", p = O(() => so(u), [u]), m = Po(p), g = O(
412
412
  () => s?.length ? [...Object.values(Ba), ...s] : void 0,
413
413
  [s]
414
414
  ), f = a?.join(",") ?? "", h = O(() => {
@@ -430,7 +430,7 @@ const Ro = { linkMode: "text-only" }, Ao = { enabled: !1 }, Ht = (e) => {
430
430
  plugins: m,
431
431
  remend: Ro,
432
432
  linkSafety: Ao,
433
- ...u,
433
+ ...c,
434
434
  remarkPlugins: g,
435
435
  rehypePlugins: h,
436
436
  children: typeof t == "string" ? p : t
@@ -451,20 +451,20 @@ function ps(e, t, s = {}) {
451
451
  minCharsPerSecond: r = ms,
452
452
  maxCharsPerSecond: a = hs,
453
453
  enabled: o = !0
454
- } = s, [i] = C(Ho), l = o && !i, [u, d] = C(
454
+ } = s, [i] = C(Ho), l = o && !i, [c, u] = C(
455
455
  () => t && e.length <= Bo ? Math.min(e.length, 1) : e.length
456
- ), p = j(u), m = j(0);
456
+ ), p = U(c), m = U(0);
457
457
  D(() => {
458
458
  if (!l) {
459
459
  p.current = e.length;
460
460
  return;
461
461
  }
462
462
  if (e.length < p.current) {
463
- p.current = e.length, m.current = 0, d(e.length);
463
+ p.current = e.length, m.current = 0, u(e.length);
464
464
  return;
465
465
  }
466
466
  if (p.current >= e.length) {
467
- d((b) => b >= e.length ? b : e.length);
467
+ u((b) => b >= e.length ? b : e.length);
468
468
  return;
469
469
  }
470
470
  let f = 0, h = performance.now();
@@ -475,12 +475,12 @@ function ps(e, t, s = {}) {
475
475
  f = 0;
476
476
  const I = Math.min(b - h, jo);
477
477
  h = b, e.length - p.current > v && (p.current = e.length - v, m.current = 0);
478
- const k = e.length - p.current;
479
- if (k <= 0) return;
480
- const T = (t ? Math.min(Math.max(k / qo * 1e3, r), a) : N) * I / 1e3 + m.current, P = Math.floor(T);
478
+ const _ = e.length - p.current;
479
+ if (_ <= 0) return;
480
+ const T = (t ? Math.min(Math.max(_ / qo * 1e3, r), a) : N) * I / 1e3 + m.current, P = Math.floor(T);
481
481
  if (m.current = T - P, P > 0) {
482
482
  const A = Math.min(e.length, p.current + P);
483
- if (p.current = A, d(A), A >= e.length) return;
483
+ if (p.current = A, u(A), A >= e.length) return;
484
484
  }
485
485
  f = requestAnimationFrame(y);
486
486
  };
@@ -488,11 +488,11 @@ function ps(e, t, s = {}) {
488
488
  f && cancelAnimationFrame(f);
489
489
  };
490
490
  }, [e, t, l, r, a]);
491
- const g = l && u < e.length;
492
- return [g ? e.slice(0, Uo(e, u)) : e, g];
491
+ const g = l && c < e.length;
492
+ return [g ? e.slice(0, Uo(e, c)) : e, g];
493
493
  }
494
494
  function fs() {
495
- const t = W((s) => s.app)?.smoothStreaming;
495
+ const t = K((s) => s.app)?.smoothStreaming;
496
496
  return O(() => {
497
497
  const s = typeof t == "object" ? t : {};
498
498
  return {
@@ -508,8 +508,8 @@ function gs({
508
508
  children: s,
509
509
  ...r
510
510
  }) {
511
- const { t: a } = _(["chat"]);
512
- return /* @__PURE__ */ c(
511
+ const { t: a } = k(["chat"]);
512
+ return /* @__PURE__ */ d(
513
513
  Ae.Source,
514
514
  {
515
515
  className: `group/reference relative rounded-md transition-colors ${t ?? ""}`,
@@ -535,7 +535,7 @@ function bs({
535
535
  streaming: s,
536
536
  reference: r
537
537
  }) {
538
- const { textComponents: a, remarkPlugins: o, rehypePlugins: i, linkProtocols: l } = Q(), u = K((v) => v.composer), d = fs(), p = oe(e), m = s && t === "assistant", [g] = ps(e, m, d), f = j(!1);
538
+ const { textComponents: a, remarkPlugins: o, rehypePlugins: i, linkProtocols: l } = X(), c = Y((v) => v.composer), u = fs(), p = oe(e), m = s && t === "assistant", [g] = ps(e, m, u), f = U(!1);
539
539
  m && (f.current = !0);
540
540
  const h = f.current ? "streaming" : "static", N = t === "user" ? /* @__PURE__ */ n("div", { className: "whitespace-pre-wrap break-words", children: g.split(`
541
541
  `).map((v, y) => /* @__PURE__ */ n("div", { dir: "auto", children: v || /* @__PURE__ */ n("br", {}) }, y)) }) : /* @__PURE__ */ n(
@@ -550,18 +550,18 @@ function bs({
550
550
  children: g
551
551
  }
552
552
  );
553
- return /* @__PURE__ */ n("div", { className: "group py-2 first:pt-4 animate-in-bubble", children: /* @__PURE__ */ n(Ut, { from: t, children: /* @__PURE__ */ n(Bt, { dir: p, children: /* @__PURE__ */ n(Vo, { lines: t === "user" ? u?.collapseLines ?? 0 : 0, children: /* @__PURE__ */ n(gs, { showAction: !1, reference: r, children: N }) }) }) }) });
553
+ return /* @__PURE__ */ n("div", { className: "group py-2 first:pt-4 animate-in-bubble", children: /* @__PURE__ */ n(Ut, { from: t, children: /* @__PURE__ */ n(Bt, { dir: p, children: /* @__PURE__ */ n(Vo, { lines: t === "user" ? c?.collapseLines ?? 0 : 0, children: /* @__PURE__ */ n(gs, { showAction: !1, reference: r, children: N }) }) }) }) });
554
554
  }
555
555
  function Vo({ lines: e, children: t }) {
556
- const { t: s } = _(["chat"]), r = j(null), [a, o] = C(!1), [i, l] = C(!1);
556
+ const { t: s } = k(["chat"]), r = U(null), [a, o] = C(!1), [i, l] = C(!1);
557
557
  return qn(() => {
558
- const d = r.current;
559
- if (!d || !e || i) return;
560
- const p = d.firstElementChild, m = () => o((p?.offsetHeight ?? d.scrollHeight) > d.clientHeight + 1);
558
+ const u = r.current;
559
+ if (!u || !e || i) return;
560
+ const p = u.firstElementChild, m = () => o((p?.offsetHeight ?? u.scrollHeight) > u.clientHeight + 1);
561
561
  m();
562
562
  const g = typeof ResizeObserver > "u" ? null : new ResizeObserver(m);
563
- return g?.observe(d), p && g?.observe(p), () => g?.disconnect();
564
- }, [e, i]), e ? /* @__PURE__ */ c(L, { children: [
563
+ return g?.observe(u), p && g?.observe(p), () => g?.disconnect();
564
+ }, [e, i]), e ? /* @__PURE__ */ d($, { children: [
565
565
  /* @__PURE__ */ n(
566
566
  "div",
567
567
  {
@@ -581,7 +581,7 @@ function Vo({ lines: e, children: t }) {
581
581
  "button",
582
582
  {
583
583
  type: "button",
584
- onClick: () => l((d) => !d),
584
+ onClick: () => l((u) => !u),
585
585
  "aria-expanded": i,
586
586
  "aria-label": s(i ? "show_less" : "show_more"),
587
587
  title: s(i ? "show_less" : "show_more"),
@@ -594,14 +594,14 @@ function Vo({ lines: e, children: t }) {
594
594
  )
595
595
  }
596
596
  )
597
- ] }) : /* @__PURE__ */ n(L, { children: t });
597
+ ] }) : /* @__PURE__ */ n($, { children: t });
598
598
  }
599
599
  function Go({ part: e, index: t }) {
600
600
  const s = e.text;
601
601
  return s.trim() ? /* @__PURE__ */ n(Wo, { text: s, index: t, segment: "text" }) : null;
602
602
  }
603
603
  function Wo({ text: e, index: t, segment: s }) {
604
- const { t: r } = _("chat"), a = G((l) => l.message.id), o = G((l) => l.message.role), i = G((l) => l.isStreaming);
604
+ const { t: r } = k("chat"), a = W((l) => l.message.id), o = W((l) => l.message.role), i = W((l) => l.isStreaming);
605
605
  return /* @__PURE__ */ n(
606
606
  bs,
607
607
  {
@@ -636,46 +636,46 @@ const xs = Oe(null), Qo = () => {
636
636
  children: i,
637
637
  ...l
638
638
  }) => {
639
- const [u, d] = sn({
639
+ const [c, u] = sn({
640
640
  prop: s,
641
641
  defaultProp: r,
642
642
  onChange: a
643
643
  }), [p, m] = sn({
644
644
  prop: o,
645
645
  defaultProp: 0
646
- }), g = j({ startTime: null, autoClosed: !1 });
646
+ }), g = U({ startTime: null, autoClosed: !1 });
647
647
  D(() => {
648
648
  const h = g.current;
649
- if (t ? h.startTime ??= Date.now() : h.startTime !== null && (m(Math.ceil((Date.now() - h.startTime) / 1e3)), h.startTime = null), r && !t && u && !h.autoClosed) {
649
+ if (t ? h.startTime ??= Date.now() : h.startTime !== null && (m(Math.ceil((Date.now() - h.startTime) / 1e3)), h.startTime = null), r && !t && c && !h.autoClosed) {
650
650
  const N = setTimeout(() => {
651
- d(!1), h.autoClosed = !0;
651
+ u(!1), h.autoClosed = !0;
652
652
  }, 1e3);
653
653
  return () => clearTimeout(N);
654
654
  }
655
- }, [t, u, r, d, m]);
655
+ }, [t, c, r, u, m]);
656
656
  const f = O(
657
- () => ({ isStreaming: t, isOpen: u, setIsOpen: d, duration: p }),
658
- [t, u, d, p]
657
+ () => ({ isStreaming: t, isOpen: c, setIsOpen: u, duration: p }),
658
+ [t, c, u, p]
659
659
  );
660
660
  return /* @__PURE__ */ n(xs.Provider, { value: f, children: /* @__PURE__ */ n(
661
661
  zt,
662
662
  {
663
663
  className: x("not-prose mb-4", e),
664
- onOpenChange: d,
665
- open: u,
664
+ onOpenChange: u,
665
+ open: c,
666
666
  ...l,
667
667
  children: i
668
668
  }
669
669
  ) });
670
670
  }
671
671
  ), ys = Ee(({ className: e, children: t, ...s }) => {
672
- const { isStreaming: r, isOpen: a, duration: o } = Qo(), { t: i } = _(["chat"]);
672
+ const { isStreaming: r, isOpen: a, duration: o } = Qo(), { t: i } = k(["chat"]);
673
673
  return /* @__PURE__ */ n(
674
674
  It,
675
675
  {
676
676
  className: x("flex items-center gap-2 text-muted-foreground text-sm", e),
677
677
  ...s,
678
- children: t ?? /* @__PURE__ */ c(L, { children: [
678
+ children: t ?? /* @__PURE__ */ d($, { children: [
679
679
  /* @__PURE__ */ n(er, { className: "size-4" }),
680
680
  /* @__PURE__ */ n("p", { children: r ? i("thinking") : o > 0 ? i("thought_for", { count: o }) : i("thought") }),
681
681
  /* @__PURE__ */ n(
@@ -708,18 +708,18 @@ vs.displayName = "Reasoning";
708
708
  ys.displayName = "ReasoningTrigger";
709
709
  ws.displayName = "ReasoningContent";
710
710
  function Ko({ part: e }) {
711
- const t = G((d) => d.isStreaming), { dir: s } = B(), r = fs(), a = oe(e.text), o = e.state === "streaming" && t, [i] = ps(e.text, o, r), l = j(!1);
711
+ const t = W((u) => u.isStreaming), { dir: s } = V(), r = fs(), a = oe(e.text), o = e.state === "streaming" && t, [i] = ps(e.text, o, r), l = U(!1);
712
712
  o && (l.current = !0);
713
- const u = l.current ? "streaming" : "static";
714
- return e.text.trim() ? /* @__PURE__ */ c(vs, { className: "w-full animate-in-bubble", dir: s, isStreaming: o, children: [
713
+ const c = l.current ? "streaming" : "static";
714
+ return e.text.trim() ? /* @__PURE__ */ d(vs, { className: "w-full animate-in-bubble", dir: s, isStreaming: o, children: [
715
715
  /* @__PURE__ */ n(ys, {}),
716
- /* @__PURE__ */ n(ws, { dir: a, wordFade: l.current, mode: u, children: i })
716
+ /* @__PURE__ */ n(ws, { dir: a, wordFade: l.current, mode: c, children: i })
717
717
  ] }) : null;
718
718
  }
719
719
  function Vt(e) {
720
- const [t, s] = C(!1), r = j(void 0);
720
+ const [t, s] = C(!1), r = U(void 0);
721
721
  D(() => () => clearTimeout(r.current), []);
722
- const a = pe(() => {
722
+ const a = de(() => {
723
723
  clearTimeout(r.current), s(!0), r.current = setTimeout(() => s(!1), e);
724
724
  }, [e]);
725
725
  return [t, a];
@@ -730,7 +730,7 @@ const Ns = Ee(function({
730
730
  children: r,
731
731
  ...a
732
732
  }) {
733
- return /* @__PURE__ */ c(
733
+ return /* @__PURE__ */ d(
734
734
  "div",
735
735
  {
736
736
  className: x(
@@ -764,20 +764,20 @@ const Jo = ({ className: e, ...t }) => /* @__PURE__ */ n(zt, { className: x("not
764
764
  "output-error": ["error", Cn, "text-destructive"],
765
765
  "output-denied": ["denied", ar, "text-destructive"]
766
766
  }, ei = ({ status: e }) => {
767
- const { t } = _(["tools_ui"]), [s, r, a] = Zo[e];
768
- return /* @__PURE__ */ c(ma, { className: "gap-1.5 rounded-full text-xs", variant: "secondary", children: [
767
+ const { t } = k(["tools_ui"]), [s, r, a] = Zo[e];
768
+ return /* @__PURE__ */ d(ma, { className: "gap-1.5 rounded-full text-xs", variant: "secondary", children: [
769
769
  /* @__PURE__ */ n(r, { className: x("size-4", a) }),
770
770
  t(s)
771
771
  ] });
772
772
  }, ti = ({ className: e, type: t, state: s, toolName: r, ...a }) => {
773
773
  const o = r || (t.startsWith("tool-") ? t.slice(5) : t), i = Yo(o, "size-4 text-muted-foreground");
774
- return /* @__PURE__ */ c(
774
+ return /* @__PURE__ */ d(
775
775
  It,
776
776
  {
777
777
  className: x("flex w-full items-center justify-between gap-4 p-3", e),
778
778
  ...a,
779
779
  children: [
780
- /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
780
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
781
781
  i,
782
782
  /* @__PURE__ */ n("span", { className: "font-medium text-sm", children: o }),
783
783
  /* @__PURE__ */ n(ei, { status: s })
@@ -804,13 +804,13 @@ const Jo = ({ className: e, ...t }) => /* @__PURE__ */ n(zt, { className: x("not
804
804
  }
805
805
  return JSON.stringify(e, null, 2);
806
806
  }, si = ({ className: e, input: t, state: s, ...r }) => {
807
- const { t: a } = _(["tools_ui"]), o = O(() => ks(t), [t]), i = s === "input-streaming";
808
- return /* @__PURE__ */ c("div", { className: x("space-y-2 overflow-hidden p-4", e), ...r, children: [
807
+ const { t: a } = k(["tools_ui"]), o = O(() => ks(t), [t]), i = s === "input-streaming";
808
+ return /* @__PURE__ */ d("div", { className: x("space-y-2 overflow-hidden p-4", e), ...r, children: [
809
809
  /* @__PURE__ */ n("h4", { className: "font-medium text-muted-foreground text-xs uppercase tracking-wide", children: a("parameters") }),
810
810
  /* @__PURE__ */ n("div", { className: "rounded-md bg-muted/50", children: i ? /* @__PURE__ */ n("pre", { className: "overflow-x-auto p-4 font-mono text-sm whitespace-pre-wrap", dir: "ltr", children: o }) : /* @__PURE__ */ n(Ns, { code: o }) })
811
811
  ] });
812
812
  }, ri = ({ className: e, output: t, errorText: s, ...r }) => {
813
- const { t: a } = _(["tools_ui"]), [o, i] = Vt(2e3), l = O(() => {
813
+ const { t: a } = k(["tools_ui"]), [o, i] = Vt(2e3), l = O(() => {
814
814
  if (typeof t == "string" || typeof t == "object" && t !== null && !("$$typeof" in t))
815
815
  try {
816
816
  return JSON.stringify(typeof t == "string" ? JSON.parse(t) : t, null, 2);
@@ -819,18 +819,18 @@ const Jo = ({ className: e, ...t }) => /* @__PURE__ */ n(zt, { className: x("not
819
819
  }
820
820
  return null;
821
821
  }, [t]);
822
- return t || s ? /* @__PURE__ */ c("div", { className: x("space-y-2 p-4", e), ...r, children: [
822
+ return t || s ? /* @__PURE__ */ d("div", { className: x("space-y-2 p-4", e), ...r, children: [
823
823
  /* @__PURE__ */ n("h4", { className: "font-medium text-muted-foreground text-xs uppercase tracking-wide", children: a(s ? "error" : "result") }),
824
- s && /* @__PURE__ */ c(qe, { children: [
825
- /* @__PURE__ */ n(Qn, { asChild: !0, children: /* @__PURE__ */ c(E, { variant: "destructive", size: "sm", children: [
824
+ s && /* @__PURE__ */ d(qe, { children: [
825
+ /* @__PURE__ */ n(Qn, { asChild: !0, children: /* @__PURE__ */ d(E, { variant: "destructive", size: "sm", children: [
826
826
  /* @__PURE__ */ n(Cn, { className: "me-1.5 size-4" }),
827
827
  a("view_error")
828
828
  ] }) }),
829
- /* @__PURE__ */ c(Mt, { className: "max-w-2xl", children: [
829
+ /* @__PURE__ */ d(Mt, { className: "max-w-2xl", children: [
830
830
  /* @__PURE__ */ n(Kn, { children: /* @__PURE__ */ n(Xn, { className: "text-destructive", children: a("tool_error") }) }),
831
- /* @__PURE__ */ c("div", { className: "space-y-4", children: [
831
+ /* @__PURE__ */ d("div", { className: "space-y-4", children: [
832
832
  /* @__PURE__ */ n("div", { className: "max-h-96 overflow-auto rounded-md bg-destructive/10 p-4 text-destructive text-sm", children: /* @__PURE__ */ n("pre", { className: "whitespace-pre-wrap break-words", children: ks(s) }) }),
833
- /* @__PURE__ */ c(
833
+ /* @__PURE__ */ d(
834
834
  E,
835
835
  {
836
836
  variant: "outline",
@@ -851,10 +851,10 @@ const Jo = ({ className: e, ...t }) => /* @__PURE__ */ n(zt, { className: x("not
851
851
  ] }) : null;
852
852
  };
853
853
  function ai({ part: e }) {
854
- const { t } = _(["tools_ui"]), s = Zr(e);
854
+ const { t } = k(["tools_ui"]), s = Zr(e);
855
855
  if (!s.isPending) return null;
856
856
  const r = t("approval_prompt", { tool: et(e) });
857
- return /* @__PURE__ */ c(
857
+ return /* @__PURE__ */ d(
858
858
  "div",
859
859
  {
860
860
  role: "group",
@@ -882,10 +882,10 @@ function ai({ part: e }) {
882
882
  );
883
883
  }
884
884
  function oi({ part: e }) {
885
- const t = W((r) => r.app.showToolDetails ?? !0), s = e.state === "approval-requested";
886
- return !t && !s ? null : /* @__PURE__ */ c(Jo, { className: "animate-in-bubble", defaultOpen: s, children: [
885
+ const t = K((r) => r.app.showToolDetails ?? !0), s = e.state === "approval-requested";
886
+ return !t && !s ? null : /* @__PURE__ */ d(Jo, { className: "animate-in-bubble", defaultOpen: s, children: [
887
887
  /* @__PURE__ */ n(ti, { type: e.type, state: e.state, toolName: et(e) }),
888
- /* @__PURE__ */ c(ni, { children: [
888
+ /* @__PURE__ */ d(ni, { children: [
889
889
  /* @__PURE__ */ n(si, { input: e.input, state: e.state }),
890
890
  (e.state === "output-available" || e.state === "output-error") && /* @__PURE__ */ n(ri, { errorText: e.errorText, output: e.output })
891
891
  ] }),
@@ -893,12 +893,12 @@ function oi({ part: e }) {
893
893
  ] });
894
894
  }
895
895
  function ii({ part: e }) {
896
- const t = G((u) => u.message.role), { t: s } = _(["chat", "admin"]), r = ea(e), a = e.mediaType.startsWith("image/"), o = e.filename ?? "file", i = s("download", "Download"), l = (u) => {
897
- if (u.preventDefault(), !r) return;
898
- const d = Object.assign(document.createElement("a"), { href: r, download: o });
899
- document.body.appendChild(d), d.click(), d.remove();
896
+ const t = W((c) => c.message.role), { t: s } = k(["chat", "admin"]), r = ea(e), a = e.mediaType.startsWith("image/"), o = e.filename ?? "file", i = s("download", "Download"), l = (c) => {
897
+ if (c.preventDefault(), !r) return;
898
+ const u = Object.assign(document.createElement("a"), { href: r, download: o });
899
+ document.body.appendChild(u), u.click(), u.remove();
900
900
  };
901
- return /* @__PURE__ */ n("div", { className: "py-2 animate-in-bubble", children: /* @__PURE__ */ n(Ut, { from: t, children: /* @__PURE__ */ n(Bt, { isPlain: !0, children: a ? /* @__PURE__ */ c("div", { className: "group relative max-w-[280px] rounded-xl overflow-hidden border border-border/5 transition-all duration-300 hover:border-primary/30", children: [
901
+ return /* @__PURE__ */ n("div", { className: "py-2 animate-in-bubble", children: /* @__PURE__ */ n(Ut, { from: t, children: /* @__PURE__ */ n(Bt, { isPlain: !0, children: a ? /* @__PURE__ */ d("div", { className: "group relative max-w-[280px] rounded-xl overflow-hidden border border-border/5 transition-all duration-300 hover:border-primary/30", children: [
902
902
  /* @__PURE__ */ n(
903
903
  "img",
904
904
  {
@@ -907,7 +907,7 @@ function ii({ part: e }) {
907
907
  className: "max-h-[280px] w-full rounded-xl object-cover"
908
908
  }
909
909
  ),
910
- /* @__PURE__ */ c("div", { className: "absolute inset-x-0 bottom-0 p-3 bg-black/60 md:opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity flex items-center justify-between", children: [
910
+ /* @__PURE__ */ d("div", { className: "absolute inset-x-0 bottom-0 p-3 bg-black/60 md:opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity flex items-center justify-between", children: [
911
911
  /* @__PURE__ */ n("span", { className: "text-xs text-white truncate max-w-[150px] font-medium", children: o }),
912
912
  /* @__PURE__ */ n(
913
913
  "button",
@@ -919,9 +919,9 @@ function ii({ part: e }) {
919
919
  }
920
920
  )
921
921
  ] })
922
- ] }) : /* @__PURE__ */ c("div", { className: "group inline-flex items-center gap-3 rounded-xl p-3 text-sm transition-all duration-300 bg-secondary/10 border border-border/5 hover:border-primary/30 hover:bg-secondary/20", children: [
922
+ ] }) : /* @__PURE__ */ d("div", { className: "group inline-flex items-center gap-3 rounded-xl p-3 text-sm transition-all duration-300 bg-secondary/10 border border-border/5 hover:border-primary/30 hover:bg-secondary/20", children: [
923
923
  /* @__PURE__ */ n("div", { className: "p-2.5 rounded-lg bg-background/50 border border-border/10 group-hover:border-primary/20 group-hover:text-primary transition-colors", children: /* @__PURE__ */ n(In, { className: "size-4 shrink-0" }) }),
924
- /* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 me-4", children: [
924
+ /* @__PURE__ */ d("div", { className: "flex flex-col min-w-0 me-4", children: [
925
925
  /* @__PURE__ */ n("span", { className: "truncate max-w-[180px] font-semibold text-foreground/90 leading-none mb-1 group-hover:text-foreground transition-colors", children: o }),
926
926
  e.mediaType && /* @__PURE__ */ n("span", { className: "text-xs text-muted-foreground uppercase font-bold tracking-widest opacity-60", children: e.mediaType.split("/").pop() })
927
927
  ] }),
@@ -937,8 +937,8 @@ function ii({ part: e }) {
937
937
  ] }) }) }) });
938
938
  }
939
939
  function li({ part: e }) {
940
- const t = G((d) => d.message.role), { t: s } = _(["chat"]), { focusReference: r } = ta(), [a, o] = Vt(1200), i = e.data, l = i.excerpt || i.label || s("source_unavailable"), u = i.label && i.label !== l ? i.label : s("referenced_context");
941
- return /* @__PURE__ */ n("div", { className: x("my-1.5 flex", t === "user" && "justify-end"), children: /* @__PURE__ */ c(
940
+ const t = W((u) => u.message.role), { t: s } = k(["chat"]), { focusReference: r } = ta(), [a, o] = Vt(1200), i = e.data, l = i.excerpt || i.label || s("source_unavailable"), c = i.label && i.label !== l ? i.label : s("referenced_context");
941
+ return /* @__PURE__ */ n("div", { className: x("my-1.5 flex", t === "user" && "justify-end"), children: /* @__PURE__ */ d(
942
942
  "button",
943
943
  {
944
944
  type: "button",
@@ -949,7 +949,7 @@ function li({ part: e }) {
949
949
  onClick: () => {
950
950
  r(i) || o();
951
951
  },
952
- title: u,
952
+ title: c,
953
953
  children: [
954
954
  /* @__PURE__ */ n(Qe, { className: "mt-0.5 size-3.5 shrink-0 opacity-70" }),
955
955
  /* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n("span", { className: "line-clamp-2 opacity-85", dir: "auto", children: l }) })
@@ -1016,31 +1016,31 @@ function mi({
1016
1016
  onReopen: a,
1017
1017
  onAnswer: o
1018
1018
  }) {
1019
- const { t: i } = _(["chat"]), { dir: l } = B(), { textComponents: u, remarkPlugins: d, rehypePlugins: p, linkProtocols: m } = Q(), g = O(() => Gt(e), [e]), [f, h] = C(""), [N, v] = C(null), [y, b] = C(!1);
1019
+ const { t: i } = k(["chat"]), { dir: l } = V(), { textComponents: c, remarkPlugins: u, rehypePlugins: p, linkProtocols: m } = X(), g = O(() => Gt(e), [e]), [f, h] = C(""), [N, v] = C(null), [y, b] = C(!1);
1020
1020
  if (!g) return null;
1021
- const I = !s && !!o, k = !I || y || N !== null, M = !Cs(t, g), T = oe(g.question, l);
1022
- if (!M && !I && !r) return null;
1023
- const P = async (z) => {
1024
- const $ = z.trim();
1025
- if (!(!$ || k)) {
1026
- b(!0), v($);
1021
+ const I = !s && !!o, _ = !I || y || N !== null, z = !Cs(t, g), T = oe(g.question, l);
1022
+ if (!z && !I && !r) return null;
1023
+ const P = async (M) => {
1024
+ const L = M.trim();
1025
+ if (!(!L || _)) {
1026
+ b(!0), v(L);
1027
1027
  try {
1028
- await o?.($);
1028
+ await o?.(L);
1029
1029
  } catch {
1030
1030
  v(null), b(!1);
1031
1031
  return;
1032
1032
  }
1033
1033
  b(!1);
1034
1034
  }
1035
- }, A = (z) => {
1036
- z.preventDefault(), P(f);
1035
+ }, A = (M) => {
1036
+ M.preventDefault(), P(f);
1037
1037
  };
1038
- return /* @__PURE__ */ c("div", { className: "group py-2 first:pt-4 animate-in-bubble", children: [
1039
- M && /* @__PURE__ */ n(Ut, { from: t.role, children: /* @__PURE__ */ n(Bt, { dir: T, children: /* @__PURE__ */ n(
1038
+ return /* @__PURE__ */ d("div", { className: "group py-2 first:pt-4 animate-in-bubble", children: [
1039
+ z && /* @__PURE__ */ n(Ut, { from: t.role, children: /* @__PURE__ */ n(Bt, { dir: T, children: /* @__PURE__ */ n(
1040
1040
  nt,
1041
1041
  {
1042
- components: u,
1043
- remarkPlugins: d,
1042
+ components: c,
1043
+ remarkPlugins: u,
1044
1044
  rehypePlugins: p,
1045
1045
  linkProtocols: m,
1046
1046
  children: g.question
@@ -1049,9 +1049,9 @@ function mi({
1049
1049
  r && /* @__PURE__ */ n(
1050
1050
  "div",
1051
1051
  {
1052
- className: x("flex w-full justify-start", M && "mt-2.5"),
1052
+ className: x("flex w-full justify-start", z && "mt-2.5"),
1053
1053
  dir: T,
1054
- children: /* @__PURE__ */ c(
1054
+ children: /* @__PURE__ */ d(
1055
1055
  "button",
1056
1056
  {
1057
1057
  type: "button",
@@ -1066,27 +1066,27 @@ function mi({
1066
1066
  )
1067
1067
  }
1068
1068
  ),
1069
- I && !r && /* @__PURE__ */ c("div", { className: x("max-w-xl", M && "mt-2.5"), dir: T, children: [
1069
+ I && !r && /* @__PURE__ */ d("div", { className: x("max-w-xl", z && "mt-2.5"), dir: T, children: [
1070
1070
  /* @__PURE__ */ n(
1071
1071
  zs,
1072
1072
  {
1073
1073
  choices: g.choices,
1074
1074
  selected: N,
1075
- disabled: k,
1075
+ disabled: _,
1076
1076
  dir: T,
1077
- onSelect: (z) => {
1078
- P(z);
1077
+ onSelect: (M) => {
1078
+ P(M);
1079
1079
  }
1080
1080
  }
1081
1081
  ),
1082
- g.allowCustom && /* @__PURE__ */ c("form", { onSubmit: A, className: "mt-1.5 flex items-center gap-1.5", children: [
1082
+ g.allowCustom && /* @__PURE__ */ d("form", { onSubmit: A, className: "mt-1.5 flex items-center gap-1.5", children: [
1083
1083
  /* @__PURE__ */ n(
1084
1084
  "input",
1085
1085
  {
1086
1086
  value: f,
1087
- disabled: k,
1087
+ disabled: _,
1088
1088
  dir: oe(f || i("choice_other_placeholder"), T),
1089
- onChange: (z) => h(z.target.value),
1089
+ onChange: (M) => h(M.target.value),
1090
1090
  placeholder: i("choice_other_placeholder"),
1091
1091
  className: "h-11 min-w-0 flex-1 rounded-full bg-transparent px-3 text-start text-sm outline-none transition-colors placeholder:text-muted-foreground/60 hover:bg-foreground/[0.04] focus-visible:bg-foreground/[0.06] disabled:cursor-not-allowed disabled:opacity-55"
1092
1092
  }
@@ -1095,7 +1095,7 @@ function mi({
1095
1095
  "button",
1096
1096
  {
1097
1097
  type: "submit",
1098
- disabled: k || !f.trim(),
1098
+ disabled: _ || !f.trim(),
1099
1099
  className: "flex size-11 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground transition hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-ring/40 disabled:opacity-35",
1100
1100
  "aria-label": i("choice_send_answer"),
1101
1101
  title: i("choice_send_answer"),
@@ -1138,13 +1138,13 @@ function fi({
1138
1138
  onAnswer: a,
1139
1139
  children: o
1140
1140
  }) {
1141
- const [i, l] = C(0), u = s || e?.role !== "assistant" ? void 0 : _s(e, { streaming: t }), d = O(() => u ? Gt(u) : null, [u]), p = u?.toolCallId, m = pe((I) => {
1142
- l((k) => Math.abs(k - I) < 1 ? k : I);
1143
- }, []), g = d ? e?.id ?? null : null, f = d && e ? Aa(e) : null, [h, N] = C(() => hi(r)), v = f !== null && h.includes(f), y = pe(
1141
+ const [i, l] = C(0), c = s || e?.role !== "assistant" ? void 0 : _s(e, { streaming: t }), u = O(() => c ? Gt(c) : null, [c]), p = c?.toolCallId, m = de((I) => {
1142
+ l((_) => Math.abs(_ - I) < 1 ? _ : I);
1143
+ }, []), g = u ? e?.id ?? null : null, f = u && e ? Aa(e) : null, [h, N] = C(() => hi(r)), v = f !== null && h.includes(f), y = de(
1144
1144
  (I) => {
1145
- f && N((k) => {
1146
- const M = k.filter((T) => T !== f);
1147
- return I ? [...M, f].slice(-50) : M.length === k.length ? k : M;
1145
+ f && N((_) => {
1146
+ const z = _.filter((T) => T !== f);
1147
+ return I ? [...z, f].slice(-50) : z.length === _.length ? _ : z;
1148
1148
  });
1149
1149
  },
1150
1150
  [f]
@@ -1154,7 +1154,7 @@ function fi({
1154
1154
  }, [r, h]);
1155
1155
  const b = O(
1156
1156
  () => ({
1157
- question: d,
1157
+ question: u,
1158
1158
  messageId: g,
1159
1159
  disabled: t || !a,
1160
1160
  dismissed: v,
@@ -1162,11 +1162,11 @@ function fi({
1162
1162
  answer: (I) => {
1163
1163
  p && a?.({ toolCallId: p, output: { answer: I } });
1164
1164
  },
1165
- dockHeight: d ? i : 0,
1165
+ dockHeight: u ? i : 0,
1166
1166
  reportDockHeight: m
1167
1167
  }),
1168
1168
  [
1169
- d,
1169
+ u,
1170
1170
  g,
1171
1171
  t,
1172
1172
  v,
@@ -1183,14 +1183,14 @@ function st() {
1183
1183
  return Se(Ts) ?? pi;
1184
1184
  }
1185
1185
  function Wt(e) {
1186
- const t = G((h) => h.message), s = G((h) => h.isLast), r = G((h) => h.isStreaming), a = ve((h) => h.status), { readonly: o, actions: i } = Fn(), l = pe(
1186
+ const t = W((h) => h.message), s = W((h) => h.isLast), r = W((h) => h.isStreaming), a = ve((h) => h.status), { readonly: o, actions: i } = Fn(), l = de(
1187
1187
  (h) => {
1188
1188
  e && i?.addToolOutput({ toolCallId: e, output: { answer: h } });
1189
1189
  },
1190
1190
  [i, e]
1191
- ), u = pe((h) => {
1191
+ ), c = de((h) => {
1192
1192
  i?.send({ text: h });
1193
- }, [i]), { messageId: d, dismissed: p, setDismissed: m } = st(), g = d === t.id, f = s && !r && t.role === "assistant";
1193
+ }, [i]), { messageId: u, dismissed: p, setDismissed: m } = st(), g = u === t.id, f = s && !r && t.role === "assistant";
1194
1194
  return {
1195
1195
  message: t,
1196
1196
  isLast: s,
@@ -1202,7 +1202,7 @@ function Wt(e) {
1202
1202
  reopen: () => m(!1),
1203
1203
  answerable: ui({ readonly: o, lastMessage: s, isFinished: f, status: a }),
1204
1204
  answer: l,
1205
- sendText: u
1205
+ sendText: c
1206
1206
  };
1207
1207
  }
1208
1208
  function gi({
@@ -1210,7 +1210,7 @@ function gi({
1210
1210
  question: t,
1211
1211
  index: s
1212
1212
  }) {
1213
- const { t: r } = _("chat"), { ChoiceQuestionPart: a } = Q(), { message: o, answerable: i, dismissedHere: l, reopen: u, answer: d } = Wt(
1213
+ const { t: r } = k("chat"), { ChoiceQuestionPart: a } = X(), { message: o, answerable: i, dismissedHere: l, reopen: c, answer: u } = Wt(
1214
1214
  e.toolCallId
1215
1215
  );
1216
1216
  if (i && e.state === "input-available")
@@ -1221,12 +1221,12 @@ function gi({
1221
1221
  message: o,
1222
1222
  disabled: !1,
1223
1223
  dismissed: l,
1224
- onReopen: l ? u : void 0,
1225
- onAnswer: d
1224
+ onReopen: l ? c : void 0,
1225
+ onAnswer: u
1226
1226
  }
1227
1227
  );
1228
1228
  const p = e.state === "output-available" ? e.output?.answer : void 0;
1229
- return /* @__PURE__ */ n(L, { children: [
1229
+ return /* @__PURE__ */ n($, { children: [
1230
1230
  !Cs(o, t) && [
1231
1231
  t.question,
1232
1232
  o.role,
@@ -1297,11 +1297,11 @@ class ge extends Kr {
1297
1297
  }
1298
1298
  }
1299
1299
  function xi() {
1300
- const { t: e } = _("chat");
1300
+ const { t: e } = k("chat");
1301
1301
  return e("render_error");
1302
1302
  }
1303
1303
  const vi = ({ className: e, ...t }) => /* @__PURE__ */ n(zt, { className: x("not-prose mb-4 text-primary text-xs", e), ...t }), yi = ({ className: e, count: t, children: s, ...r }) => {
1304
- const { t: a } = _(["chat"]);
1304
+ const { t: a } = k(["chat"]);
1305
1305
  return /* @__PURE__ */ n(
1306
1306
  It,
1307
1307
  {
@@ -1310,7 +1310,7 @@ const vi = ({ className: e, ...t }) => /* @__PURE__ */ n(zt, { className: x("not
1310
1310
  e
1311
1311
  ),
1312
1312
  ...r,
1313
- children: s ?? /* @__PURE__ */ c(L, { children: [
1313
+ children: s ?? /* @__PURE__ */ d($, { children: [
1314
1314
  /* @__PURE__ */ n("p", { className: "font-medium", children: a("used_sources", { count: t }) }),
1315
1315
  /* @__PURE__ */ n(Ke, { className: "size-3.5" })
1316
1316
  ] })
@@ -1325,7 +1325,7 @@ const vi = ({ className: e, ...t }) => /* @__PURE__ */ n(zt, { className: x("not
1325
1325
  ),
1326
1326
  ...t
1327
1327
  }
1328
- ), Ni = ({ href: e, title: t, children: s, ...r }) => /* @__PURE__ */ n("a", { className: "flex items-center gap-2", href: e, rel: "noreferrer", target: "_blank", ...r, children: s ?? /* @__PURE__ */ c(L, { children: [
1328
+ ), Ni = ({ href: e, title: t, children: s, ...r }) => /* @__PURE__ */ n("a", { className: "flex items-center gap-2", href: e, rel: "noreferrer", target: "_blank", ...r, children: s ?? /* @__PURE__ */ d($, { children: [
1329
1329
  /* @__PURE__ */ n(dr, { className: "h-4 w-4" }),
1330
1330
  /* @__PURE__ */ n("span", { className: "block font-medium", children: t })
1331
1331
  ] }) });
@@ -1348,16 +1348,16 @@ function Be(e) {
1348
1348
  return r.length > 0 ? { suggestions: r } : null;
1349
1349
  }
1350
1350
  function ki() {
1351
- const { FollowUpSuggestions: e } = Q(), { message: t, isLast: s, isFinished: r, status: a, readonly: o, sendText: i } = Wt();
1351
+ const { FollowUpSuggestions: e } = X(), { message: t, isLast: s, isFinished: r, status: a, readonly: o, sendText: i } = Wt();
1352
1352
  if (t.role !== "assistant" || !s || !r || a !== "ready" || o || _s(t) !== void 0)
1353
1353
  return null;
1354
- const l = t.parts.find((d) => d.type === "tool-suggest_follow_ups");
1354
+ const l = t.parts.find((u) => u.type === "tool-suggest_follow_ups");
1355
1355
  if (!l || !("input" in l)) return null;
1356
- const u = Be(l.input);
1357
- return u ? /* @__PURE__ */ n(e, { suggestions: u.suggestions, onSelect: i }) : null;
1356
+ const c = Be(l.input);
1357
+ return c ? /* @__PURE__ */ n(e, { suggestions: c.suggestions, onSelect: i }) : null;
1358
1358
  }
1359
1359
  function _i() {
1360
- const { t: e } = _(["chat"]);
1360
+ const { t: e } = k(["chat"]);
1361
1361
  return /* @__PURE__ */ n(
1362
1362
  De.ScrollToBottom,
1363
1363
  {
@@ -1376,7 +1376,7 @@ const Si = (e) => Ea.includes(e.type) ? !1 : e.type === "text" || e.type === "re
1376
1376
  if (!a) return null;
1377
1377
  const o = r === "running", i = t.slice(t.lastIndexOf(e) + 1);
1378
1378
  if (o && s || i.some(
1379
- (u) => u.type === "text" && u.text.trim().length > 0 || u.type === "tool-ask_user" || !o && tt(u)
1379
+ (c) => c.type === "text" && c.text.trim().length > 0 || c.type === "tool-ask_user" || !o && tt(c)
1380
1380
  ))
1381
1381
  return null;
1382
1382
  const l = oe(a);
@@ -1387,7 +1387,7 @@ const Si = (e) => Ea.includes(e.type) ? !1 : e.type === "text" || e.type === "re
1387
1387
  "flex w-full py-3 mx-auto max-w-3xl px-4 md:px-0 animate-in-bubble",
1388
1388
  l === "rtl" ? "justify-end" : "justify-start"
1389
1389
  ),
1390
- children: /* @__PURE__ */ c(
1390
+ children: /* @__PURE__ */ d(
1391
1391
  "div",
1392
1392
  {
1393
1393
  className: x(
@@ -1407,15 +1407,15 @@ const Si = (e) => Ea.includes(e.type) ? !1 : e.type === "text" || e.type === "re
1407
1407
  () => import("./MessageEditor-thFldVmz.js").then((e) => ({ default: e.MessageEditor }))
1408
1408
  ), Ii = { UserMessage: Ti, AssistantMessage: Pi };
1409
1409
  function Ti() {
1410
- const e = G((a) => a.message.id), t = G((a) => a.isEditing), { MessageActions: s } = Q(), r = K((a) => a.threadActions);
1411
- return /* @__PURE__ */ c(
1410
+ const e = W((a) => a.message.id), t = W((a) => a.isEditing), { MessageActions: s } = X(), r = Y((a) => a.threadActions);
1411
+ return /* @__PURE__ */ d(
1412
1412
  le.Root,
1413
1413
  {
1414
1414
  "data-gentiq-message-id": e,
1415
1415
  "data-gentiq-message-role": "user",
1416
1416
  className: "group/message",
1417
1417
  children: [
1418
- t ? /* @__PURE__ */ c(Ve, { fallback: /* @__PURE__ */ n(le.Parts, {}), children: [
1418
+ t ? /* @__PURE__ */ d(Ve, { fallback: /* @__PURE__ */ n(le.Parts, {}), children: [
1419
1419
  /* @__PURE__ */ n(le.Parts, { components: Mi }),
1420
1420
  /* @__PURE__ */ n(zi, {})
1421
1421
  ] }) : /* @__PURE__ */ n(le.Parts, {}),
@@ -1426,21 +1426,21 @@ function Ti() {
1426
1426
  }
1427
1427
  const Mi = { text: null };
1428
1428
  function Pi() {
1429
- const e = G((i) => i.message.id), t = G((i) => i.message.parts), { MessageActions: s } = Q(), r = K((i) => i.threadActions), { sourceUrls: a, hasText: o } = O(
1429
+ const e = W((i) => i.message.id), t = W((i) => i.message.parts), { MessageActions: s } = X(), r = Y((i) => i.threadActions), { sourceUrls: a, hasText: o } = O(
1430
1430
  () => ({
1431
1431
  sourceUrls: t.flatMap((i) => i.type === "source-url" ? [i.url] : []),
1432
1432
  hasText: La({ parts: t }).length > 0
1433
1433
  }),
1434
1434
  [t]
1435
1435
  );
1436
- return /* @__PURE__ */ c(
1436
+ return /* @__PURE__ */ d(
1437
1437
  le.Root,
1438
1438
  {
1439
1439
  "data-gentiq-message-id": e,
1440
1440
  "data-gentiq-message-role": "assistant",
1441
1441
  className: "group/message",
1442
1442
  children: [
1443
- a.length > 0 && /* @__PURE__ */ c(vi, { children: [
1443
+ a.length > 0 && /* @__PURE__ */ d(vi, { children: [
1444
1444
  /* @__PURE__ */ n(yi, { count: a.length }),
1445
1445
  a.map((i, l) => /* @__PURE__ */ n(wi, { children: /* @__PURE__ */ n(Ni, { href: i, title: i }) }, `${e}-source-${l}`))
1446
1446
  ] }),
@@ -1459,16 +1459,16 @@ function Pi() {
1459
1459
  );
1460
1460
  }
1461
1461
  function Ri({ className: e }) {
1462
- const { t } = _(["chat", "errors"]), { ChatError: s } = Q(), { actions: r } = Fn(), a = ve((b) => b.messages), o = ve((b) => b.status), i = ve((b) => b.isLoadingHistory), l = ve((b) => b.error), u = O(
1462
+ const { t } = k(["chat", "errors"]), { ChatError: s } = X(), { actions: r } = Fn(), a = ve((b) => b.messages), o = ve((b) => b.status), i = ve((b) => b.isLoadingHistory), l = ve((b) => b.error), c = O(
1463
1463
  () => l === void 0 ? null : na(l, t),
1464
1464
  [l, t]
1465
- ), { dockHeight: d } = st(), p = `calc(var(--gentiq-composer-inset, calc(6.5rem + ${d}px)) + 1.5rem)`, m = i, g = ve((b) => b.earlier.status), f = r?.loadEarlier, h = a[a.length - 1], N = h?.role === "assistant" && (o === "ready" || h.parts.some((b) => b.type === "data-chat-finished")), v = !m && (o === "submitted" || o === "streaming" && !(h?.role === "assistant" && h.parts.some(Si)));
1465
+ ), { dockHeight: u } = st(), p = `calc(var(--gentiq-composer-inset, calc(6.5rem + ${u}px)) + 1.5rem)`, m = i, g = ve((b) => b.earlier.status), f = r?.loadEarlier, h = a[a.length - 1], N = h?.role === "assistant" && (o === "ready" || h.parts.some((b) => b.type === "data-chat-finished")), v = !m && (o === "submitted" || o === "streaming" && !(h?.role === "assistant" && h.parts.some(Si)));
1466
1466
  let y;
1467
1467
  if (h?.role === "assistant")
1468
1468
  for (const b of h.parts)
1469
1469
  b.type === "data-progress-update" && (y = b);
1470
- return /* @__PURE__ */ c("div", { className: x("relative min-h-0 flex-1 overflow-hidden", e), children: [
1471
- /* @__PURE__ */ c(
1470
+ return /* @__PURE__ */ d("div", { className: x("relative min-h-0 flex-1 overflow-hidden", e), children: [
1471
+ /* @__PURE__ */ d(
1472
1472
  De.Viewport,
1473
1473
  {
1474
1474
  scrollClassName: "custom-scrollbar",
@@ -1487,7 +1487,7 @@ function Ri({ className: e }) {
1487
1487
  }
1488
1488
  ),
1489
1489
  v && /* @__PURE__ */ n("div", { className: "animate-in-bubble", children: /* @__PURE__ */ n(Ue, {}) }),
1490
- o === "error" && u && /* @__PURE__ */ n("div", { className: "mx-auto max-w-3xl w-full px-4 my-3 animate-in-bubble", children: /* @__PURE__ */ n(s, { error: u, code: qt(u) ? u.code : void 0 }) })
1490
+ o === "error" && c && /* @__PURE__ */ n("div", { className: "mx-auto max-w-3xl w-full px-4 my-3 animate-in-bubble", children: /* @__PURE__ */ n(s, { error: c, code: qt(c) ? c.code : void 0 }) })
1491
1491
  ]
1492
1492
  }
1493
1493
  ),
@@ -1516,8 +1516,8 @@ function Ri({ className: e }) {
1516
1516
  }
1517
1517
  const Ai = "size-8 rounded-full p-1.5 text-muted-foreground hover:bg-accent/60 hover:text-foreground disabled:opacity-40";
1518
1518
  function Di({ retry: e, feedback: t, edit: s }) {
1519
- const { t: r } = _(["chat", "errors"]), a = G((u) => u.message.role === "user"), o = (u) => F.error(fe(u, r)), [i, l] = Vt(2e3);
1520
- return /* @__PURE__ */ c(
1519
+ const { t: r } = k(["chat", "errors"]), a = W((c) => c.message.role === "user"), o = (c) => B.error(fe(c, r)), [i, l] = Vt(2e3);
1520
+ return /* @__PURE__ */ d(
1521
1521
  be.Root,
1522
1522
  {
1523
1523
  "aria-label": r("message_actions"),
@@ -1543,14 +1543,14 @@ function Di({ retry: e, feedback: t, edit: s }) {
1543
1543
  ],
1544
1544
  [s, "edit_message", be.Edit, fr, void 0, void 0]
1545
1545
  ].map(
1546
- ([u, d, p, m, g, f]) => u && /* @__PURE__ */ n(mn, { label: r(d), children: /* @__PURE__ */ n(p, { "aria-label": r(d), onError: g, className: f, children: /* @__PURE__ */ n(m, { className: "size-4" }) }) }, d)
1546
+ ([c, u, p, m, g, f]) => c && /* @__PURE__ */ n(mn, { label: r(u), children: /* @__PURE__ */ n(p, { "aria-label": r(u), onError: g, className: f, children: /* @__PURE__ */ n(m, { className: "size-4" }) }) }, u)
1547
1547
  ),
1548
- /* @__PURE__ */ n(mn, { label: r("copy"), children: /* @__PURE__ */ c(
1548
+ /* @__PURE__ */ n(mn, { label: r("copy"), children: /* @__PURE__ */ d(
1549
1549
  be.Copy,
1550
1550
  {
1551
1551
  "aria-label": r("copy"),
1552
1552
  onCopied: l,
1553
- onError: () => F.error(r("copy_failed")),
1553
+ onError: () => B.error(r("copy_failed")),
1554
1554
  className: "group/copy",
1555
1555
  children: [
1556
1556
  /* @__PURE__ */ n(zn, { className: "size-4 group-data-[copied]/copy:hidden" }),
@@ -1564,13 +1564,13 @@ function Di({ retry: e, feedback: t, edit: s }) {
1564
1564
  );
1565
1565
  }
1566
1566
  function mn({ label: e, children: t }) {
1567
- return /* @__PURE__ */ c(Ye, { children: [
1567
+ return /* @__PURE__ */ d(Ye, { children: [
1568
1568
  /* @__PURE__ */ n(Je, { asChild: !0, children: /* @__PURE__ */ n(E, { variant: "ghost", size: "sm", className: Ai, asChild: !0, children: t }) }),
1569
1569
  /* @__PURE__ */ n(Ze, { children: e })
1570
1570
  ] });
1571
1571
  }
1572
1572
  const Oi = ({ className: e, ...t }) => /* @__PURE__ */ n("div", { className: "bg-transparent w-full", children: /* @__PURE__ */ n(
1573
- he.Root,
1573
+ pe.Root,
1574
1574
  {
1575
1575
  className: x(
1576
1576
  "w-full flex items-end gap-2 overflow-hidden rounded-[32px] bg-card/85 dark:bg-surface/85 backdrop-blur-md px-4 py-2 transition-[border-color,box-shadow] duration-200 ease-out border border-border/60 shadow-[0_2px_12px_rgb(0_0_0/0.05)] dark:shadow-[0_4px_20px_rgb(0_0_0/0.25)] hover:border-border has-focus-visible:border-foreground/20 has-focus-visible:shadow-md",
@@ -1580,19 +1580,19 @@ const Oi = ({ className: e, ...t }) => /* @__PURE__ */ n("div", { className: "bg
1580
1580
  }
1581
1581
  ) }), Ei = $n(
1582
1582
  function({ className: t, placeholder: s, ...r }, a) {
1583
- const { dir: o } = B(), i = _t().draft, l = oe(i, o), u = `${i || s || ""} `;
1584
- return /* @__PURE__ */ c("div", { className: "grid min-w-0 flex-1", children: [
1583
+ const { dir: o } = V(), i = _t().draft, l = oe(i, o), c = `${i || s || ""} `;
1584
+ return /* @__PURE__ */ d("div", { className: "grid min-w-0 flex-1", children: [
1585
1585
  /* @__PURE__ */ n(
1586
1586
  "div",
1587
1587
  {
1588
1588
  "aria-hidden": !0,
1589
1589
  dir: l,
1590
1590
  className: "invisible col-start-1 row-start-1 max-h-[6lh] overflow-hidden whitespace-pre-wrap break-words px-2 py-2.5 text-base",
1591
- children: u
1591
+ children: c
1592
1592
  }
1593
1593
  ),
1594
1594
  /* @__PURE__ */ n(
1595
- he.Input,
1595
+ pe.Input,
1596
1596
  {
1597
1597
  ref: a,
1598
1598
  dir: l,
@@ -1640,11 +1640,11 @@ const Oi = ({ className: e, ...t }) => /* @__PURE__ */ n("div", { className: "bg
1640
1640
  children: a,
1641
1641
  ...o
1642
1642
  }) => {
1643
- const { t: i } = _("chat"), l = r === "submitted" || r === "streaming", u = r && $i[r] || Tn, d = i(l ? "stop_generation" : r === "error" ? "send_failed" : "send_message");
1643
+ const { t: i } = k("chat"), l = r === "submitted" || r === "streaming", c = r && $i[r] || Tn, u = i(l ? "stop_generation" : r === "error" ? "send_failed" : "send_message");
1644
1644
  return /* @__PURE__ */ n(
1645
1645
  E,
1646
1646
  {
1647
- "aria-label": d,
1647
+ "aria-label": u,
1648
1648
  className: x(
1649
1649
  "shrink-0 rounded-full size-9 bg-primary text-primary-foreground hover:bg-primary/90 transition-colors duration-200 disabled:opacity-40",
1650
1650
  r === "submitted" && "bg-muted text-foreground hover:bg-muted",
@@ -1654,13 +1654,13 @@ const Oi = ({ className: e, ...t }) => /* @__PURE__ */ n("div", { className: "bg
1654
1654
  type: l ? "button" : "submit",
1655
1655
  variant: t,
1656
1656
  ...o,
1657
- children: a ?? /* @__PURE__ */ n(u, { className: l ? "size-3.5 fill-current" : "size-4" })
1657
+ children: a ?? /* @__PURE__ */ n(c, { className: l ? "size-3.5 fill-current" : "size-4" })
1658
1658
  }
1659
1659
  );
1660
1660
  }, lt = 768;
1661
1661
  function Qt() {
1662
- const [e, t] = Z.useState(void 0);
1663
- return Z.useEffect(() => {
1662
+ const [e, t] = ee.useState(void 0);
1663
+ return ee.useEffect(() => {
1664
1664
  const s = window.matchMedia(`(max-width: ${lt - 1}px)`), r = () => {
1665
1665
  t(window.innerWidth < lt);
1666
1666
  };
@@ -1675,22 +1675,22 @@ function ji({
1675
1675
  remove: t,
1676
1676
  retry: s
1677
1677
  }) {
1678
- const { t: r } = _(["chat", "errors"]), { file: a, status: o, progress: i, error: l, retryable: u } = e, d = Fi(a.type.startsWith("image/") ? a : null), p = o === "failed", m = p ? qt(l) ? fe(l, r) : r("upload_failed") : "";
1679
- return /* @__PURE__ */ c(
1678
+ const { t: r } = k(["chat", "errors"]), { file: a, status: o, progress: i, error: l, retryable: c } = e, u = Fi(a.type.startsWith("image/") ? a : null), p = o === "failed", m = p ? qt(l) ? fe(l, r) : r("upload_failed") : "";
1679
+ return /* @__PURE__ */ d(
1680
1680
  "div",
1681
1681
  {
1682
1682
  className: `flex max-w-full items-center gap-2 rounded-xl border bg-muted/60 py-1.5 ps-2.5 pe-1.5 text-sm ${p ? "border-destructive/50" : "border-border/60"}`,
1683
1683
  "data-status": o,
1684
1684
  children: [
1685
- d ? /* @__PURE__ */ n(
1685
+ u ? /* @__PURE__ */ n(
1686
1686
  "img",
1687
1687
  {
1688
- src: d,
1688
+ src: u,
1689
1689
  alt: a.name,
1690
1690
  className: "size-7 shrink-0 rounded-lg object-cover ring-1 ring-border/50"
1691
1691
  }
1692
1692
  ) : /* @__PURE__ */ n(In, { className: "size-3.5 shrink-0 text-muted-foreground", "aria-hidden": !0 }),
1693
- /* @__PURE__ */ c("span", { className: "flex min-w-0 flex-col", children: [
1693
+ /* @__PURE__ */ d("span", { className: "flex min-w-0 flex-col", children: [
1694
1694
  /* @__PURE__ */ n("span", { className: "max-w-[120px] truncate text-xs font-medium text-foreground/80", dir: "auto", children: a.name }),
1695
1695
  o === "uploading" && /* @__PURE__ */ n(
1696
1696
  "span",
@@ -1710,12 +1710,12 @@ function ji({
1710
1710
  )
1711
1711
  }
1712
1712
  ),
1713
- p && /* @__PURE__ */ c("span", { className: "flex items-center gap-1 text-xs text-destructive", role: "alert", children: [
1713
+ p && /* @__PURE__ */ d("span", { className: "flex items-center gap-1 text-xs text-destructive", role: "alert", children: [
1714
1714
  /* @__PURE__ */ n(gr, { className: "size-3 shrink-0", "aria-hidden": !0 }),
1715
1715
  /* @__PURE__ */ n("span", { className: "max-w-[180px] truncate", title: m, children: m })
1716
1716
  ] })
1717
1717
  ] }),
1718
- p && u && /* @__PURE__ */ n(
1718
+ p && c && /* @__PURE__ */ n(
1719
1719
  "button",
1720
1720
  {
1721
1721
  type: "button",
@@ -1750,14 +1750,14 @@ function Fi(e) {
1750
1750
  }, [e]), t;
1751
1751
  }
1752
1752
  function Ui({ reference: e, remove: t, focus: s }) {
1753
- const { t: r } = _(["chat"]);
1754
- return /* @__PURE__ */ c(
1753
+ const { t: r } = k(["chat"]);
1754
+ return /* @__PURE__ */ d(
1755
1755
  "div",
1756
1756
  {
1757
1757
  className: "group/reference-chip flex min-w-0 max-w-[min(100%,260px)] items-center gap-2 rounded-lg border border-primary/15 bg-primary/8 px-2.5 py-1.5 text-start text-xs shadow-sm transition hover:bg-primary/12",
1758
1758
  title: e.excerpt,
1759
1759
  children: [
1760
- /* @__PURE__ */ c(
1760
+ /* @__PURE__ */ d(
1761
1761
  "button",
1762
1762
  {
1763
1763
  type: "button",
@@ -1800,7 +1800,7 @@ function Bi(e, t) {
1800
1800
  }
1801
1801
  function Hi(e, { t, language: s, maxSize: r }) {
1802
1802
  for (const { file: a, reason: o } of e)
1803
- o === "unsupported_type" ? F.error(t("chat:file_type_not_supported", { name: a.name })) : o === "too_large" && r !== void 0 && F.error(
1803
+ o === "unsupported_type" ? B.error(t("chat:file_type_not_supported", { name: a.name })) : o === "too_large" && r !== void 0 && B.error(
1804
1804
  t("chat:file_too_large", { name: a.name, size: Bi(r, s) })
1805
1805
  );
1806
1806
  }
@@ -1814,14 +1814,14 @@ const Vi = {
1814
1814
  };
1815
1815
  function Gi(e, t) {
1816
1816
  const s = t(Vi[e.kind]);
1817
- e.kind === "failed" ? F.error(s, { action: { label: t("chat:voice_retry"), onClick: e.retry } }) : e.kind === "no_speech" || e.kind === "time_limit" ? F(s) : F.error(s);
1817
+ e.kind === "failed" ? B.error(s, { action: { label: t("chat:voice_retry"), onClick: e.retry } }) : e.kind === "no_speech" || e.kind === "time_limit" ? B(s) : B.error(s);
1818
1818
  }
1819
1819
  function Rs({
1820
1820
  enabled: e = !0
1821
1821
  } = {}) {
1822
- const { t, i18n: s } = _(["chat"]), { dir: r } = B(), a = K((y) => y.welcome), o = typeof a?.greeting == "function", i = typeof a?.typingPrompts == "function", { user: l, firstName: u, isLoading: d } = Un({
1822
+ const { t, i18n: s } = k(["chat"]), { dir: r } = V(), a = Y((y) => y.welcome), o = typeof a?.greeting == "function", i = typeof a?.typingPrompts == "function", { user: l, firstName: c, isLoading: u } = Un({
1823
1823
  enabled: e && (o || i)
1824
- }), p = a?.typingPrompts, m = typeof p == "function" ? p({ user: l, firstName: u, isLoading: d, t }) : p, g = t("welcome.typing_prompts", { returnObjects: !0, defaultValue: [] }), f = (m ? m.map((y) => t(y)) : Array.isArray(g) ? g : []).filter((y) => typeof y == "string" && y !== ""), h = a?.greeting, N = typeof h == "function" ? h({ user: l, firstName: u, isLoading: d, t }) : h ? Ne(h, t, s, ["chat"]) : t("welcome.title"), v = a?.subtitle ? Ne(a.subtitle, t, s, ["chat"]) : null;
1824
+ }), p = a?.typingPrompts, m = typeof p == "function" ? p({ user: l, firstName: c, isLoading: u, t }) : p, g = t("welcome.typing_prompts", { returnObjects: !0, defaultValue: [] }), f = (m ? m.map((y) => t(y)) : Array.isArray(g) ? g : []).filter((y) => typeof y == "string" && y !== ""), h = a?.greeting, N = typeof h == "function" ? h({ user: l, firstName: c, isLoading: u, t }) : h ? Ne(h, t, s, ["chat"]) : t("welcome.title"), v = a?.subtitle ? Ne(a.subtitle, t, s, ["chat"]) : null;
1825
1825
  return {
1826
1826
  title: N,
1827
1827
  subtitle: v,
@@ -1832,38 +1832,38 @@ function Rs({
1832
1832
  }
1833
1833
  const Wi = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1834
1834
  function Qi(e, t = {}) {
1835
- const { typingSpeed: s = 20, deletingSpeed: r = 15, pauseMs: a = 2e3, startDelayMs: o = 250 } = t, i = e.join("\0"), [l, u] = C(""), d = j(e);
1836
- return d.current = e, D(() => {
1837
- const p = d.current;
1835
+ const { typingSpeed: s = 20, deletingSpeed: r = 15, pauseMs: a = 2e3, startDelayMs: o = 250 } = t, i = e.join("\0"), [l, c] = C(""), u = U(e);
1836
+ return u.current = e, D(() => {
1837
+ const p = u.current;
1838
1838
  if (p.length === 0) {
1839
- u("");
1839
+ c("");
1840
1840
  return;
1841
1841
  }
1842
1842
  let m, g = 0, f = "typing", h = 0;
1843
1843
  if (Wi()) {
1844
- u(p[0]);
1844
+ c(p[0]);
1845
1845
  const y = setInterval(() => {
1846
- g = (g + 1) % p.length, u(p[g]);
1846
+ g = (g + 1) % p.length, c(p[g]);
1847
1847
  }, a);
1848
1848
  return () => clearInterval(y);
1849
1849
  }
1850
1850
  const v = () => {
1851
1851
  const y = p[g];
1852
1852
  if (f === "typing") {
1853
- h++, u(y.slice(0, h)), h >= y.length ? (f = "pausing", m = setTimeout(v, a)) : m = setTimeout(v, s);
1853
+ h++, c(y.slice(0, h)), h >= y.length ? (f = "pausing", m = setTimeout(v, a)) : m = setTimeout(v, s);
1854
1854
  return;
1855
1855
  }
1856
1856
  if (f === "pausing") {
1857
1857
  f = "deleting", m = setTimeout(v, r);
1858
1858
  return;
1859
1859
  }
1860
- h--, u(y.slice(0, Math.max(h, 0))), h <= 0 ? (f = "typing", g = (g + 1) % p.length, m = setTimeout(v, s)) : m = setTimeout(v, r);
1860
+ h--, c(y.slice(0, Math.max(h, 0))), h <= 0 ? (f = "typing", g = (g + 1) % p.length, m = setTimeout(v, s)) : m = setTimeout(v, r);
1861
1861
  };
1862
- return u(""), m = setTimeout(v, o), () => clearTimeout(m);
1862
+ return c(""), m = setTimeout(v, o), () => clearTimeout(m);
1863
1863
  }, [i, s, r, a, o]), l;
1864
1864
  }
1865
1865
  function Ki({ open: e, onOpenChange: t, onCapture: s }) {
1866
- return /* @__PURE__ */ n(qe, { open: e, onOpenChange: t, children: /* @__PURE__ */ c(Yn, { children: [
1866
+ return /* @__PURE__ */ n(qe, { open: e, onOpenChange: t, children: /* @__PURE__ */ d(Yn, { children: [
1867
1867
  /* @__PURE__ */ n(ke.Overlay, { className: "fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0" }),
1868
1868
  /* @__PURE__ */ n(
1869
1869
  ke.Content,
@@ -1887,9 +1887,9 @@ function Ki({ open: e, onOpenChange: t, onCapture: s }) {
1887
1887
  }
1888
1888
  const gn = "grid size-10 place-items-center rounded-full bg-white/12 text-white backdrop-blur-md transition hover:bg-white/20 active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/60", bn = "flex h-10 items-center gap-2 rounded-full px-4 text-sm font-medium transition active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/60";
1889
1889
  function Xi({ onKeep: e }) {
1890
- const { t } = _("chat"), s = j(null), [r, a] = C(), [o, i] = C(null), [l, u] = C([]), [d, p] = C(!1), [m, g] = C(!1), [f, h] = C(null);
1890
+ const { t } = k("chat"), s = U(null), [r, a] = C(), [o, i] = C(null), [l, c] = C([]), [u, p] = C(!1), [m, g] = C(!1), [f, h] = C(null);
1891
1891
  D(() => {
1892
- let k = !1, M = null;
1892
+ let _ = !1, z = null;
1893
1893
  return navigator.mediaDevices.getUserMedia({
1894
1894
  audio: !1,
1895
1895
  video: {
@@ -1898,37 +1898,37 @@ function Xi({ onKeep: e }) {
1898
1898
  height: { ideal: 1080 }
1899
1899
  }
1900
1900
  }).then(async (T) => {
1901
- if (k) return T.getTracks().forEach((A) => A.stop());
1902
- M = T, s.current && (s.current.srcObject = T), i(T);
1901
+ if (_) return T.getTracks().forEach((A) => A.stop());
1902
+ z = T, s.current && (s.current.srcObject = T), i(T);
1903
1903
  const P = await navigator.mediaDevices.enumerateDevices();
1904
- k || u(P.filter((A) => A.kind === "videoinput").map((A) => A.deviceId));
1905
- }).catch(() => !k && g(!0)), () => {
1906
- k = !0, M?.getTracks().forEach((T) => T.stop());
1904
+ _ || c(P.filter((A) => A.kind === "videoinput").map((A) => A.deviceId));
1905
+ }).catch(() => !_ && g(!0)), () => {
1906
+ _ = !0, z?.getTracks().forEach((T) => T.stop());
1907
1907
  };
1908
1908
  }, [r]), D(() => () => {
1909
1909
  f && URL.revokeObjectURL(f.url);
1910
1910
  }, [f]);
1911
1911
  const N = o?.getVideoTracks()[0]?.getSettings(), v = N?.facingMode !== "environment", y = () => {
1912
- const k = l[(l.indexOf(N?.deviceId ?? "") + 1) % l.length];
1913
- !k || k === N?.deviceId || (s.current && (s.current.srcObject = null), i(null), p(!1), a(k));
1912
+ const _ = l[(l.indexOf(N?.deviceId ?? "") + 1) % l.length];
1913
+ !_ || _ === N?.deviceId || (s.current && (s.current.srcObject = null), i(null), p(!1), a(_));
1914
1914
  }, b = () => {
1915
- const k = s.current;
1916
- if (!k?.videoWidth) return;
1917
- const M = Object.assign(document.createElement("canvas"), {
1918
- width: k.videoWidth,
1919
- height: k.videoHeight
1915
+ const _ = s.current;
1916
+ if (!_?.videoWidth) return;
1917
+ const z = Object.assign(document.createElement("canvas"), {
1918
+ width: _.videoWidth,
1919
+ height: _.videoHeight
1920
1920
  });
1921
- M.getContext("2d")?.drawImage(k, 0, 0), M.toBlob(
1921
+ z.getContext("2d")?.drawImage(_, 0, 0), z.toBlob(
1922
1922
  (T) => T && h({ blob: T, url: URL.createObjectURL(T) }),
1923
1923
  "image/jpeg",
1924
1924
  0.92
1925
1925
  );
1926
1926
  }, I = () => {
1927
1927
  if (!f) return;
1928
- const k = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/[-:]/g, "").replace("T", "-");
1929
- e(new File([f.blob], `photo-${k}.jpg`, { type: "image/jpeg" }));
1928
+ const _ = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/[-:]/g, "").replace("T", "-");
1929
+ e(new File([f.blob], `photo-${_}.jpg`, { type: "image/jpeg" }));
1930
1930
  };
1931
- return /* @__PURE__ */ c("div", { className: "relative aspect-[3/4] max-h-[80dvh] w-full sm:aspect-video", children: [
1931
+ return /* @__PURE__ */ d("div", { className: "relative aspect-[3/4] max-h-[80dvh] w-full sm:aspect-video", children: [
1932
1932
  /* @__PURE__ */ n(
1933
1933
  "video",
1934
1934
  {
@@ -1939,7 +1939,7 @@ function Xi({ onKeep: e }) {
1939
1939
  onPlaying: () => p(!0),
1940
1940
  className: x(
1941
1941
  "absolute inset-0 size-full object-cover transition-opacity duration-500",
1942
- d ? "opacity-100" : "opacity-0",
1942
+ u ? "opacity-100" : "opacity-0",
1943
1943
  v && "-scale-x-100"
1944
1944
  )
1945
1945
  }
@@ -1952,16 +1952,16 @@ function Xi({ onKeep: e }) {
1952
1952
  className: "absolute inset-0 size-full object-cover animate-in fade-in-0 zoom-in-[1.02] duration-200"
1953
1953
  }
1954
1954
  ),
1955
- m ? /* @__PURE__ */ c("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-4 px-8 text-center", children: [
1955
+ m ? /* @__PURE__ */ d("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-4 px-8 text-center", children: [
1956
1956
  /* @__PURE__ */ n("span", { className: "grid size-14 place-items-center rounded-full bg-white/10", children: /* @__PURE__ */ n(xr, { className: "size-6 text-white/80" }) }),
1957
1957
  /* @__PURE__ */ n("p", { className: "max-w-xs text-sm leading-relaxed text-white/70", children: t("camera_error") })
1958
- ] }) : !d && /* @__PURE__ */ n("div", { className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ n(yt, { className: "size-6 animate-spin text-white/50" }) }),
1959
- /* @__PURE__ */ c("div", { className: "absolute inset-x-0 top-0 flex items-center justify-between gap-4 bg-gradient-to-b from-black/55 to-transparent px-4 pt-4 pb-10", children: [
1958
+ ] }) : !u && /* @__PURE__ */ n("div", { className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ n(yt, { className: "size-6 animate-spin text-white/50" }) }),
1959
+ /* @__PURE__ */ d("div", { className: "absolute inset-x-0 top-0 flex items-center justify-between gap-4 bg-gradient-to-b from-black/55 to-transparent px-4 pt-4 pb-10", children: [
1960
1960
  /* @__PURE__ */ n(ke.Title, { className: "ps-1 text-sm font-medium text-white/90", children: t("camera_title") }),
1961
1961
  /* @__PURE__ */ n(ke.Close, { className: gn, "aria-label": t("camera_close"), children: /* @__PURE__ */ n(_e, { className: "size-4.5" }) })
1962
1962
  ] }),
1963
- !m && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 grid grid-cols-[1fr_auto_1fr] items-center gap-4 bg-gradient-to-t from-black/65 to-transparent px-5 pt-14 pb-5", children: f ? /* @__PURE__ */ c(L, { children: [
1964
- /* @__PURE__ */ c(
1963
+ !m && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 grid grid-cols-[1fr_auto_1fr] items-center gap-4 bg-gradient-to-t from-black/65 to-transparent px-5 pt-14 pb-5", children: f ? /* @__PURE__ */ d($, { children: [
1964
+ /* @__PURE__ */ d(
1965
1965
  "button",
1966
1966
  {
1967
1967
  type: "button",
@@ -1976,7 +1976,7 @@ function Xi({ onKeep: e }) {
1976
1976
  ]
1977
1977
  }
1978
1978
  ),
1979
- /* @__PURE__ */ c(
1979
+ /* @__PURE__ */ d(
1980
1980
  "button",
1981
1981
  {
1982
1982
  type: "button",
@@ -1991,13 +1991,13 @@ function Xi({ onKeep: e }) {
1991
1991
  ]
1992
1992
  }
1993
1993
  )
1994
- ] }) : /* @__PURE__ */ c(L, { children: [
1994
+ ] }) : /* @__PURE__ */ d($, { children: [
1995
1995
  /* @__PURE__ */ n(
1996
1996
  "button",
1997
1997
  {
1998
1998
  type: "button",
1999
1999
  onClick: b,
2000
- disabled: !d,
2000
+ disabled: !u,
2001
2001
  "aria-label": t("camera_capture"),
2002
2002
  className: "group col-start-2 grid size-[4.25rem] place-items-center rounded-full border-[3px] border-white/90 transition-opacity focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-white/40 disabled:opacity-40",
2003
2003
  children: /* @__PURE__ */ n("span", { className: "size-[3.375rem] rounded-full bg-white transition-transform duration-150 ease-out group-hover:scale-[0.94] group-active:scale-[0.82]" })
@@ -2008,7 +2008,7 @@ function Xi({ onKeep: e }) {
2008
2008
  {
2009
2009
  type: "button",
2010
2010
  onClick: y,
2011
- disabled: !d,
2011
+ disabled: !u,
2012
2012
  "aria-label": t("camera_switch"),
2013
2013
  className: x(
2014
2014
  gn,
@@ -2038,12 +2038,12 @@ function Yi() {
2038
2038
  return window.matchMedia("(pointer: coarse)").matches ? "native" : "mediaDevices" in navigator ? "webcam" : null;
2039
2039
  }
2040
2040
  function Ji({ disabled: e, addFiles: t, isMobile: s }) {
2041
- const { t: r } = _("chat"), { dir: a } = B(), [o, i] = C(!1), [l, u] = C(!1), [d] = C(Yi), p = {
2042
- camera: j(null),
2043
- gallery: j(null),
2044
- files: j(null)
2045
- }, m = Le()?.attachments.types ?? [], g = m.filter((b) => b.startsWith("image/")), f = g.length ? [...d ? ["camera"] : [], "gallery", "files"] : ["files"], h = (b) => {
2046
- b === "camera" && d === "webcam" ? u(!0) : p[b].current?.click();
2041
+ const { t: r } = k("chat"), { dir: a } = V(), [o, i] = C(!1), [l, c] = C(!1), [u] = C(Yi), p = {
2042
+ camera: U(null),
2043
+ gallery: U(null),
2044
+ files: U(null)
2045
+ }, m = Le()?.attachments.types ?? [], g = m.filter((b) => b.startsWith("image/")), f = g.length ? [...u ? ["camera"] : [], "gallery", "files"] : ["files"], h = (b) => {
2046
+ b === "camera" && u === "webcam" ? c(!0) : p[b].current?.click();
2047
2047
  }, N = (b) => {
2048
2048
  b.target.files && t(Array.from(b.target.files)), b.target.value = "";
2049
2049
  }, v = r("attach"), y = /* @__PURE__ */ n(
@@ -2065,7 +2065,7 @@ function Ji({ disabled: e, addFiles: t, isMobile: s }) {
2065
2065
  )
2066
2066
  }
2067
2067
  );
2068
- return /* @__PURE__ */ c(L, { children: [
2068
+ return /* @__PURE__ */ d($, { children: [
2069
2069
  ["camera", "gallery", "files"].map((b) => /* @__PURE__ */ n(
2070
2070
  "input",
2071
2071
  {
@@ -2079,10 +2079,10 @@ function Ji({ disabled: e, addFiles: t, isMobile: s }) {
2079
2079
  },
2080
2080
  b
2081
2081
  )),
2082
- f.length === 1 ? /* @__PURE__ */ c(Ye, { children: [
2082
+ f.length === 1 ? /* @__PURE__ */ d(Ye, { children: [
2083
2083
  /* @__PURE__ */ n(Je, { asChild: !0, children: y }),
2084
2084
  /* @__PURE__ */ n(Ze, { children: v })
2085
- ] }) : s ? /* @__PURE__ */ c(L, { children: [
2085
+ ] }) : s ? /* @__PURE__ */ d($, { children: [
2086
2086
  y,
2087
2087
  /* @__PURE__ */ n(
2088
2088
  Zi,
@@ -2101,7 +2101,7 @@ function Ji({ disabled: e, addFiles: t, isMobile: s }) {
2101
2101
  // page unclickable once both have closed. Given the language's direction
2102
2102
  // because Radix doesn't read the document's: it would lay the menu out
2103
2103
  // left-to-right, and `align="start"` would hug the left edge in RTL too.
2104
- /* @__PURE__ */ c(Pt, { dir: a, modal: !1, open: o, onOpenChange: i, children: [
2104
+ /* @__PURE__ */ d(Pt, { dir: a, modal: !1, open: o, onOpenChange: i, children: [
2105
2105
  /* @__PURE__ */ n(Rt, { asChild: !0, children: y }),
2106
2106
  /* @__PURE__ */ n(
2107
2107
  At,
@@ -2112,15 +2112,15 @@ function Ji({ disabled: e, addFiles: t, isMobile: s }) {
2112
2112
  className: "min-w-0 rounded-2xl border-border/60 bg-popover p-1.5 shadow-xl",
2113
2113
  onCloseAutoFocus: (b) => l && b.preventDefault(),
2114
2114
  children: f.map((b) => {
2115
- const { icon: I, label: k } = As[b];
2116
- return /* @__PURE__ */ c(
2115
+ const { icon: I, label: _ } = As[b];
2116
+ return /* @__PURE__ */ d(
2117
2117
  we,
2118
2118
  {
2119
2119
  onSelect: () => h(b),
2120
2120
  className: "cursor-pointer gap-3 rounded-xl py-1.5 ps-1.5 pe-4 font-medium",
2121
2121
  children: [
2122
2122
  /* @__PURE__ */ n("span", { className: "grid size-8 place-items-center rounded-lg bg-foreground/[0.06] text-foreground/75", children: /* @__PURE__ */ n(I, { className: "size-4 text-current" }) }),
2123
- r(k)
2123
+ r(_)
2124
2124
  ]
2125
2125
  },
2126
2126
  b
@@ -2130,18 +2130,18 @@ function Ji({ disabled: e, addFiles: t, isMobile: s }) {
2130
2130
  )
2131
2131
  ] })
2132
2132
  ),
2133
- d === "webcam" && /* @__PURE__ */ n(
2133
+ u === "webcam" && /* @__PURE__ */ n(
2134
2134
  Ki,
2135
2135
  {
2136
2136
  open: l,
2137
- onOpenChange: u,
2137
+ onOpenChange: c,
2138
2138
  onCapture: (b) => t([b])
2139
2139
  }
2140
2140
  )
2141
2141
  ] });
2142
2142
  }
2143
2143
  function Zi({ open: e, onOpenChange: t, title: s, sources: r, onPick: a }) {
2144
- return /* @__PURE__ */ n(qe, { open: e, onOpenChange: t, children: /* @__PURE__ */ c(Yn, { children: [
2144
+ return /* @__PURE__ */ n(qe, { open: e, onOpenChange: t, children: /* @__PURE__ */ d(Yn, { children: [
2145
2145
  /* @__PURE__ */ n(ha, {}),
2146
2146
  /* @__PURE__ */ n(
2147
2147
  ke.Content,
@@ -2168,10 +2168,10 @@ function el({
2168
2168
  onPick: s,
2169
2169
  onDismiss: r
2170
2170
  }) {
2171
- const { t: a } = _("chat"), [o, i] = C(0), [l, u] = C(!1), d = j(0), p = () => {
2172
- u(!1), o > 72 ? r() : i(0);
2171
+ const { t: a } = k("chat"), [o, i] = C(0), [l, c] = C(!1), u = U(0), p = () => {
2172
+ c(!1), o > 72 ? r() : i(0);
2173
2173
  };
2174
- return /* @__PURE__ */ c(
2174
+ return /* @__PURE__ */ d(
2175
2175
  "div",
2176
2176
  {
2177
2177
  className: "mx-auto w-full max-w-lg rounded-t-[1.75rem] border border-b-0 border-border/60 bg-popover px-4 pb-[max(1.25rem,env(safe-area-inset-bottom))] shadow-[0_-12px_48px_-16px_rgb(0_0_0/0.3)]",
@@ -2180,16 +2180,16 @@ function el({
2180
2180
  transition: l ? "none" : "transform 250ms cubic-bezier(0.32,0.72,0,1)"
2181
2181
  },
2182
2182
  children: [
2183
- /* @__PURE__ */ c(
2183
+ /* @__PURE__ */ d(
2184
2184
  "div",
2185
2185
  {
2186
2186
  className: "cursor-grab touch-none pt-2.5 pb-5 select-none active:cursor-grabbing",
2187
2187
  onPointerDown: (m) => {
2188
- d.current = m.clientY, u(!0), m.currentTarget.setPointerCapture(m.pointerId);
2188
+ u.current = m.clientY, c(!0), m.currentTarget.setPointerCapture(m.pointerId);
2189
2189
  },
2190
2190
  onPointerMove: (m) => {
2191
2191
  if (!l) return;
2192
- const g = m.clientY - d.current;
2192
+ const g = m.clientY - u.current;
2193
2193
  i(g > 0 ? g : -Math.sqrt(-g) * 2);
2194
2194
  },
2195
2195
  onPointerUp: p,
@@ -2202,7 +2202,7 @@ function el({
2202
2202
  ),
2203
2203
  /* @__PURE__ */ n("div", { className: x("grid gap-3", t.length === 3 ? "grid-cols-3" : "grid-cols-2"), children: t.map((m, g) => {
2204
2204
  const { icon: f, label: h } = As[m];
2205
- return /* @__PURE__ */ c(
2205
+ return /* @__PURE__ */ d(
2206
2206
  "button",
2207
2207
  {
2208
2208
  type: "button",
@@ -2226,16 +2226,16 @@ function el({
2226
2226
  );
2227
2227
  }
2228
2228
  function tl() {
2229
- const { t: e } = _("chat"), t = Bn().status === "starting", s = e("voice_dictate");
2230
- return /* @__PURE__ */ c(Ye, { children: [
2231
- /* @__PURE__ */ n(Je, { asChild: !0, children: /* @__PURE__ */ n(he.Voice, { asChild: !0, children: /* @__PURE__ */ n(Ps, { "aria-label": s, children: t ? /* @__PURE__ */ n(yt, { className: "size-5 animate-spin" }) : /* @__PURE__ */ n(Sr, { className: "size-5" }) }) }) }),
2229
+ const { t: e } = k("chat"), t = Bn().status === "starting", s = e("voice_dictate");
2230
+ return /* @__PURE__ */ d(Ye, { children: [
2231
+ /* @__PURE__ */ n(Je, { asChild: !0, children: /* @__PURE__ */ n(pe.Voice, { asChild: !0, children: /* @__PURE__ */ n(Ps, { "aria-label": s, children: t ? /* @__PURE__ */ n(yt, { className: "size-5 animate-spin" }) : /* @__PURE__ */ n(Sr, { className: "size-5" }) }) }) }),
2232
2232
  /* @__PURE__ */ n(Ze, { children: s })
2233
2233
  ] });
2234
2234
  }
2235
2235
  const nl = Nt(
2236
- () => import("./VoiceInput-BVH0PUC6.js").then((e) => ({ default: e.VoiceRecordingBar }))
2236
+ () => import("./VoiceInput-XbeKOMjo.js").then((e) => ({ default: e.VoiceRecordingBar }))
2237
2237
  ), sl = Nt(
2238
- () => import("./VoiceInput-BVH0PUC6.js").then((e) => ({ default: e.VoiceRecordingControls }))
2238
+ () => import("./VoiceInput-XbeKOMjo.js").then((e) => ({ default: e.VoiceRecordingControls }))
2239
2239
  );
2240
2240
  function rl({
2241
2241
  onSend: e,
@@ -2245,36 +2245,36 @@ function rl({
2245
2245
  newChat: a,
2246
2246
  className: o
2247
2247
  }) {
2248
- const { t: i, i18n: l } = _(["chat", "maintenance"]), u = K((w) => w.composer), d = Le(), { ChoiceQuestionDock: p, ComposerFooter: m, composerTools: g } = Q(), { blocksChat: f } = Hn(), {
2248
+ const { t: i, i18n: l } = k(["chat", "maintenance"]), c = Y((w) => w.composer), u = Le(), { ChoiceQuestionDock: p, ComposerFooter: m, composerTools: g } = X(), { blocksChat: f } = Hn(), {
2249
2249
  question: h,
2250
2250
  disabled: N,
2251
2251
  dismissed: v,
2252
2252
  setDismissed: y,
2253
2253
  answer: b
2254
- } = st(), I = v ? null : h, { typingMessages: k } = Rs({ enabled: !!a }), M = Qi(a ? k : []), T = !!a && k.length > 0, P = u?.placeholder ? i(u.placeholder) : i("input_placeholder"), A = f ? i("maintenance:composer_placeholder") : I?.allowCustom !== !1 && I ? i("choice_custom_placeholder") : T ? M : P, z = Qt(), $ = t === "streaming" || t === "submitted", U = sa("voice_input", { enabled: !!u?.voice?.enabled }), H = !!u?.voice?.enabled && U === !0, J = d?.attachments, te = (u?.attachments?.enabled ?? !1) && !!J, Y = O(
2254
+ } = st(), I = v ? null : h, { typingMessages: _ } = Rs({ enabled: !!a }), z = Qi(a ? _ : []), T = !!a && _.length > 0, P = c?.placeholder ? i(c.placeholder) : i("input_placeholder"), A = f ? i("maintenance:composer_placeholder") : I?.allowCustom !== !1 && I ? i("choice_custom_placeholder") : T ? z : P, M = Qt(), L = t === "streaming" || t === "submitted", j = sa("voice_input", { enabled: !!c?.voice?.enabled }), H = !!c?.voice?.enabled && j === !0, q = u?.attachments, Q = (c?.attachments?.enabled ?? !1) && !!q, Z = O(
2255
2255
  () => [...g ?? []].sort((w, R) => (w.order ?? 0) - (R.order ?? 0)),
2256
2256
  [g]
2257
- ), { draft: X, setDraft: ue, isClosed: re } = _t(), me = j(null), q = {
2257
+ ), { draft: J, setDraft: me, isClosed: re } = _t(), he = U(null), F = {
2258
2258
  newChat: !!a,
2259
2259
  threadId: r,
2260
2260
  status: t,
2261
- disabled: $ || re,
2262
- draft: X,
2261
+ disabled: L || re,
2262
+ draft: J,
2263
2263
  send: (w) => {
2264
- $ || re || !w.trim() || e({ text: w });
2264
+ L || re || !w.trim() || e({ text: w });
2265
2265
  },
2266
2266
  setDraft: (w) => {
2267
- Ga(() => ue(w));
2268
- const R = me.current;
2267
+ Ga(() => me(w));
2268
+ const R = he.current;
2269
2269
  R && (R.focus(), R.setSelectionRange(w.length, w.length));
2270
2270
  }
2271
2271
  };
2272
- return /* @__PURE__ */ n("div", { className: x("shrink-0 px-4 pb-5 pt-2 md:px-6 md:pb-6 w-full", o), children: /* @__PURE__ */ c("div", { className: "max-w-3xl mx-auto w-full", children: [
2272
+ return /* @__PURE__ */ n("div", { className: x("shrink-0 px-4 pb-5 pt-2 md:px-6 md:pb-6 w-full", o), children: /* @__PURE__ */ d("div", { className: "max-w-3xl mx-auto w-full", children: [
2273
2273
  I && /* @__PURE__ */ n(
2274
2274
  p,
2275
2275
  {
2276
2276
  question: I,
2277
- disabled: N || $ || f,
2277
+ disabled: N || L || f,
2278
2278
  onDismiss: () => y(!0),
2279
2279
  onAnswer: b
2280
2280
  }
@@ -2284,30 +2284,30 @@ function rl({
2284
2284
  {
2285
2285
  className: "relative",
2286
2286
  onSend: e,
2287
- allowFiles: te,
2288
- maxVoiceDuration: u?.voice?.maxDuration,
2287
+ allowFiles: Q,
2288
+ maxVoiceDuration: c?.voice?.maxDuration,
2289
2289
  onFilesRejected: (w) => Hi(w, {
2290
2290
  t: i,
2291
2291
  language: l.language,
2292
- maxSize: J?.max_size
2292
+ maxSize: q?.max_size
2293
2293
  }),
2294
2294
  onVoiceNotice: (w) => Gi(w, i),
2295
2295
  children: /* @__PURE__ */ n(
2296
2296
  al,
2297
2297
  {
2298
- textareaRef: me,
2299
- slotProps: q,
2298
+ textareaRef: he,
2299
+ slotProps: F,
2300
2300
  isErrorVisible: s,
2301
2301
  placeholder: A,
2302
- isMobile: z,
2303
- attachEnabled: te,
2302
+ isMobile: M,
2303
+ attachEnabled: Q,
2304
2304
  voiceEnabled: H,
2305
- tools: Y
2305
+ tools: Z
2306
2306
  }
2307
2307
  )
2308
2308
  }
2309
2309
  ) }),
2310
- m && /* @__PURE__ */ n(ge, { fallback: null, resetKeys: [r], children: /* @__PURE__ */ n(m, { ...q }) })
2310
+ m && /* @__PURE__ */ n(ge, { fallback: null, resetKeys: [r], children: /* @__PURE__ */ n(m, { ...F }) })
2311
2311
  ] }) });
2312
2312
  }
2313
2313
  function al({
@@ -2320,29 +2320,29 @@ function al({
2320
2320
  voiceEnabled: i,
2321
2321
  tools: l
2322
2322
  }) {
2323
- const { t: u, i18n: d } = _(["chat"]), p = K((A) => A.composer?.maxLength), { draft: m, files: g, references: f, isBusy: h } = _t(), { addFiles: N, dragging: v } = ra(), y = Bn(), { threadId: b, status: I } = t, k = !!p && m.length >= p * 0.9;
2323
+ const { t: c, i18n: u } = k(["chat"]), p = Y((A) => A.composer?.maxLength), { draft: m, files: g, references: f, isBusy: h } = _t(), { addFiles: N, dragging: v } = ra(), y = Bn(), { threadId: b, status: I } = t, _ = !!p && m.length >= p * 0.9;
2324
2324
  D(() => {
2325
2325
  a || e.current?.focus();
2326
2326
  }, [b, a, e]);
2327
- const M = f.length, T = j(M);
2327
+ const z = f.length, T = U(z);
2328
2328
  D(() => {
2329
- M > T.current && !a && e.current?.focus(), T.current = M;
2330
- }, [M, a, e]);
2329
+ z > T.current && !a && e.current?.focus(), T.current = z;
2330
+ }, [z, a, e]);
2331
2331
  const P = { ...t, isMobile: a, addFiles: N };
2332
- return /* @__PURE__ */ c(L, { children: [
2332
+ return /* @__PURE__ */ d($, { children: [
2333
2333
  v && /* @__PURE__ */ n(
2334
2334
  "div",
2335
2335
  {
2336
2336
  className: "pointer-events-none absolute inset-0 z-20 flex items-center justify-center rounded-lg border-2 border-dashed border-primary bg-background/90 text-sm font-medium text-foreground",
2337
2337
  "aria-hidden": !0,
2338
- children: u("drop_files")
2338
+ children: c("drop_files")
2339
2339
  }
2340
2340
  ),
2341
2341
  o && !y.active && // Matches the toolbar's bottom padding, so the + lines up with the send button.
2342
2342
  /* @__PURE__ */ n("div", { className: "-ms-1 -me-1 flex shrink-0 items-center pb-1", children: /* @__PURE__ */ n(ge, { fallback: null, resetKeys: [b], children: /* @__PURE__ */ n(Ji, { ...P }) }) }),
2343
- /* @__PURE__ */ c("div", { className: "flex flex-col flex-1 gap-2", children: [
2344
- f.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2 px-2 pt-2", children: /* @__PURE__ */ n(he.References, { component: Ui }) }),
2345
- g.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2 px-2 pt-2", children: /* @__PURE__ */ n(he.Attachments, { component: ji }) }),
2343
+ /* @__PURE__ */ d("div", { className: "flex flex-col flex-1 gap-2", children: [
2344
+ f.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2 px-2 pt-2", children: /* @__PURE__ */ n(pe.References, { component: Ui }) }),
2345
+ g.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2 px-2 pt-2", children: /* @__PURE__ */ n(pe.Attachments, { component: ji }) }),
2346
2346
  y.active ? /* @__PURE__ */ n(Ve, { fallback: null, children: /* @__PURE__ */ n(nl, {}) }) : /* @__PURE__ */ n(
2347
2347
  Ei,
2348
2348
  {
@@ -2350,12 +2350,12 @@ function al({
2350
2350
  autoFocus: !a,
2351
2351
  placeholder: r,
2352
2352
  maxLength: p,
2353
- "aria-label": u("input_placeholder")
2353
+ "aria-label": c("input_placeholder")
2354
2354
  }
2355
2355
  )
2356
2356
  ] }),
2357
- /* @__PURE__ */ n(Li, { children: y.active ? /* @__PURE__ */ n(Ve, { fallback: null, children: /* @__PURE__ */ n(sl, {}) }) : /* @__PURE__ */ c(L, { children: [
2358
- k && /* @__PURE__ */ c(
2357
+ /* @__PURE__ */ n(Li, { children: y.active ? /* @__PURE__ */ n(Ve, { fallback: null, children: /* @__PURE__ */ n(sl, {}) }) : /* @__PURE__ */ d($, { children: [
2358
+ _ && /* @__PURE__ */ d(
2359
2359
  "span",
2360
2360
  {
2361
2361
  className: x(
@@ -2364,33 +2364,33 @@ function al({
2364
2364
  ),
2365
2365
  "aria-live": "polite",
2366
2366
  children: [
2367
- m.length.toLocaleString(d.language),
2367
+ m.length.toLocaleString(u.language),
2368
2368
  "/",
2369
- p.toLocaleString(d.language)
2369
+ p.toLocaleString(u.language)
2370
2370
  ]
2371
2371
  }
2372
2372
  ),
2373
- /* @__PURE__ */ c(qi, { children: [
2374
- l.map(({ id: A, component: z }) => (
2373
+ /* @__PURE__ */ d(qi, { children: [
2374
+ l.map(({ id: A, component: M }) => (
2375
2375
  // Contained so a throwing tool can't take the composer or the other tools with it.
2376
- /* @__PURE__ */ n(ge, { fallback: null, resetKeys: [b], children: /* @__PURE__ */ n(z, { ...P }) }, A)
2376
+ /* @__PURE__ */ n(ge, { fallback: null, resetKeys: [b], children: /* @__PURE__ */ n(M, { ...P }) }, A)
2377
2377
  )),
2378
2378
  i && /* @__PURE__ */ n(tl, {})
2379
2379
  ] }),
2380
- h ? /* @__PURE__ */ n(he.Stop, { asChild: !0, children: /* @__PURE__ */ n(hn, { status: I === "submitted" ? "submitted" : "streaming" }) }) : /* @__PURE__ */ n(he.Send, { asChild: !0, children: /* @__PURE__ */ n(hn, { status: s ? "error" : "ready" }) })
2380
+ h ? /* @__PURE__ */ n(pe.Stop, { asChild: !0, children: /* @__PURE__ */ n(hn, { status: I === "submitted" ? "submitted" : "streaming" }) }) : /* @__PURE__ */ n(pe.Send, { asChild: !0, children: /* @__PURE__ */ n(hn, { status: s ? "error" : "ready" }) })
2381
2381
  ] }) })
2382
2382
  ] });
2383
2383
  }
2384
2384
  const ol = (e) => {
2385
2385
  const { title: t, subtitle: s, isRtl: r, icon: a } = Rs();
2386
- return /* @__PURE__ */ c(
2386
+ return /* @__PURE__ */ d(
2387
2387
  "div",
2388
2388
  {
2389
2389
  dir: r ? "rtl" : "ltr",
2390
2390
  className: "flex flex-col items-center text-center px-6 animate-in fade-in duration-700 ease-out",
2391
2391
  children: [
2392
2392
  a && /* @__PURE__ */ n("div", { className: "mb-8 flex items-center justify-center", children: /* @__PURE__ */ n("div", { className: "size-12 md:size-16 rounded-2xl bg-secondary flex items-center justify-center border border-border/60", children: typeof a == "function" ? /* @__PURE__ */ n(a, { className: "size-6 md:size-8 text-primary opacity-80" }) : a }) }),
2393
- (t || s) && /* @__PURE__ */ c("div", { className: "space-y-3 max-w-xl mx-auto", children: [
2393
+ (t || s) && /* @__PURE__ */ d("div", { className: "space-y-3 max-w-xl mx-auto", children: [
2394
2394
  t && /* @__PURE__ */ n("h1", { className: "text-3xl md:text-4xl font-normal tracking-tight leading-tight text-foreground", children: t }),
2395
2395
  s && /* @__PURE__ */ n("p", { className: "text-muted-foreground text-base md:text-lg font-normal max-w-md mx-auto leading-relaxed opacity-85 dark:opacity-70", children: s })
2396
2396
  ] })
@@ -2405,9 +2405,9 @@ function il({
2405
2405
  onAnswer: r,
2406
2406
  className: a
2407
2407
  }) {
2408
- const { t: o } = _(["chat"]), { dir: i } = B(), { reportDockHeight: l } = st(), u = j(null), [d, p] = C(null);
2408
+ const { t: o } = k(["chat"]), { dir: i } = V(), { reportDockHeight: l } = st(), c = U(null), [u, p] = C(null);
2409
2409
  D(() => {
2410
- const h = u.current;
2410
+ const h = c.current;
2411
2411
  if (!h) return;
2412
2412
  const N = () => l(h.offsetHeight);
2413
2413
  N();
@@ -2416,7 +2416,7 @@ function il({
2416
2416
  v?.disconnect(), l(0);
2417
2417
  };
2418
2418
  }, [l]);
2419
- const m = oe(e.question, i), g = t || !r || d !== null, f = async (h) => {
2419
+ const m = oe(e.question, i), g = t || !r || u !== null, f = async (h) => {
2420
2420
  if (!g) {
2421
2421
  p(h);
2422
2422
  try {
@@ -2426,10 +2426,10 @@ function il({
2426
2426
  }
2427
2427
  }
2428
2428
  };
2429
- return /* @__PURE__ */ c(
2429
+ return /* @__PURE__ */ d(
2430
2430
  "div",
2431
2431
  {
2432
- ref: u,
2432
+ ref: c,
2433
2433
  dir: m,
2434
2434
  className: x(
2435
2435
  // `-mb-3` slides the bottom edge under the composer, which paints over
@@ -2438,7 +2438,7 @@ function il({
2438
2438
  a
2439
2439
  ),
2440
2440
  children: [
2441
- /* @__PURE__ */ c("div", { className: "flex items-start gap-2 px-3", children: [
2441
+ /* @__PURE__ */ d("div", { className: "flex items-start gap-2 px-3", children: [
2442
2442
  /* @__PURE__ */ n("p", { className: "min-w-0 flex-1 text-base leading-snug text-foreground", children: e.question }),
2443
2443
  s && /* @__PURE__ */ n(
2444
2444
  "button",
@@ -2456,7 +2456,7 @@ function il({
2456
2456
  zs,
2457
2457
  {
2458
2458
  choices: e.choices,
2459
- selected: d,
2459
+ selected: u,
2460
2460
  disabled: g,
2461
2461
  dir: m,
2462
2462
  onSelect: (h) => {
@@ -2470,7 +2470,7 @@ function il({
2470
2470
  );
2471
2471
  }
2472
2472
  function ll({ className: e, children: t, ...s }) {
2473
- return /* @__PURE__ */ c(Me.Root, { "data-slot": "scroll-area", className: x("relative", e), ...s, children: [
2473
+ return /* @__PURE__ */ d(Me.Root, { "data-slot": "scroll-area", className: x("relative", e), ...s, children: [
2474
2474
  /* @__PURE__ */ n(
2475
2475
  Me.Viewport,
2476
2476
  {
@@ -2511,8 +2511,8 @@ function Ds({
2511
2511
  );
2512
2512
  }
2513
2513
  const cl = ({ className: e, children: t, ...s }) => {
2514
- const { dir: r } = B();
2515
- return /* @__PURE__ */ c(ll, { className: "w-full overflow-x-auto whitespace-nowrap", dir: r, ...s, children: [
2514
+ const { dir: r } = V();
2515
+ return /* @__PURE__ */ d(ll, { className: "w-full overflow-x-auto whitespace-nowrap", dir: r, ...s, children: [
2516
2516
  /* @__PURE__ */ n("div", { className: x("flex w-max flex-nowrap items-center gap-2", e), children: t }),
2517
2517
  /* @__PURE__ */ n(Ds, { className: "hidden", orientation: "horizontal" })
2518
2518
  ] });
@@ -2547,47 +2547,47 @@ function ul({
2547
2547
  onSelect: s,
2548
2548
  className: r
2549
2549
  }) {
2550
- const { t: a } = _("chat"), [o, i] = C(!1), l = async (u) => {
2550
+ const { t: a } = k("chat"), [o, i] = C(!1), l = async (c) => {
2551
2551
  if (!(t || o || !s)) {
2552
2552
  i(!0);
2553
2553
  try {
2554
- await s(u);
2554
+ await s(c);
2555
2555
  } catch {
2556
2556
  i(!1);
2557
2557
  }
2558
2558
  }
2559
2559
  };
2560
- return /* @__PURE__ */ n("div", { className: x("mx-auto w-full max-w-4xl py-2", r), children: /* @__PURE__ */ n(cl, { className: "pb-1", "aria-label": a("follow_up_suggestions"), children: e.map((u) => /* @__PURE__ */ n(
2560
+ return /* @__PURE__ */ n("div", { className: x("mx-auto w-full max-w-4xl py-2", r), children: /* @__PURE__ */ n(cl, { className: "pb-1", "aria-label": a("follow_up_suggestions"), children: e.map((c) => /* @__PURE__ */ n(
2561
2561
  dl,
2562
2562
  {
2563
- suggestion: u,
2564
- onClick: (d) => {
2565
- l(d);
2563
+ suggestion: c,
2564
+ onClick: (u) => {
2565
+ l(u);
2566
2566
  },
2567
2567
  disabled: t || o || !s,
2568
- dir: oe(u),
2568
+ dir: oe(c),
2569
2569
  className: "max-w-[min(32rem,80vw)] shrink-0"
2570
2570
  },
2571
- u
2571
+ c
2572
2572
  )) }) });
2573
2573
  }
2574
2574
  function ml({ error: e, code: t }) {
2575
- const { t: s, i18n: r } = _(["chat", "quota"]), a = W((u) => u.app.showToolDetails ?? !0), o = B().dir === "rtl", i = e.details, l = a && i && (t === "quota_exceeded" || i.limit !== void 0 || i.resets_at !== void 0);
2576
- return /* @__PURE__ */ c(
2575
+ const { t: s, i18n: r } = k(["chat", "quota"]), a = K((c) => c.app.showToolDetails ?? !0), o = V().dir === "rtl", i = e.details, l = a && i && (t === "quota_exceeded" || i.limit !== void 0 || i.resets_at !== void 0);
2576
+ return /* @__PURE__ */ d(
2577
2577
  "div",
2578
2578
  {
2579
2579
  className: "flex flex-col w-full gap-2 px-4 py-3.5 rounded-xl bg-destructive/8 border border-destructive/15 border-s-2 border-s-destructive/60",
2580
2580
  dir: o ? "rtl" : "ltr",
2581
2581
  children: [
2582
- /* @__PURE__ */ c("div", { className: "flex w-full items-start gap-3", children: [
2582
+ /* @__PURE__ */ d("div", { className: "flex w-full items-start gap-3", children: [
2583
2583
  /* @__PURE__ */ n("div", { className: "size-1.5 rounded-full bg-destructive mt-2 shrink-0" }),
2584
- /* @__PURE__ */ c("div", { className: "text-sm text-destructive/90 leading-relaxed flex-1 text-start", children: [
2584
+ /* @__PURE__ */ d("div", { className: "text-sm text-destructive/90 leading-relaxed flex-1 text-start", children: [
2585
2585
  /* @__PURE__ */ n("span", { className: "font-semibold", children: s("error") }),
2586
2586
  " ",
2587
2587
  e.message
2588
2588
  ] })
2589
2589
  ] }),
2590
- l && /* @__PURE__ */ c("div", { className: "mt-1 ps-4.5 pt-2 border-t border-destructive/10 text-xs text-muted-foreground flex flex-wrap gap-x-4 gap-y-1", children: [
2590
+ l && /* @__PURE__ */ d("div", { className: "mt-1 ps-4.5 pt-2 border-t border-destructive/10 text-xs text-muted-foreground flex flex-wrap gap-x-4 gap-y-1", children: [
2591
2591
  typeof i.limit == "number" && /* @__PURE__ */ n("span", { children: s("quota:left", {
2592
2592
  amount: Math.max(0, i.limit - (i.used ?? i.limit)),
2593
2593
  total: i.limit
@@ -2631,9 +2631,9 @@ function fl({
2631
2631
  ) });
2632
2632
  }
2633
2633
  function xn({ label: e, remaining: t, amount: s }) {
2634
- const { t: r, i18n: a } = _(["quota"]), o = Lt(t, s);
2635
- return /* @__PURE__ */ c("div", { className: "space-y-1", children: [
2636
- /* @__PURE__ */ c("div", { className: "flex items-baseline justify-between gap-3", children: [
2634
+ const { t: r, i18n: a } = k(["quota"]), o = Lt(t, s);
2635
+ return /* @__PURE__ */ d("div", { className: "space-y-1", children: [
2636
+ /* @__PURE__ */ d("div", { className: "flex items-baseline justify-between gap-3", children: [
2637
2637
  /* @__PURE__ */ n("span", { className: "truncate text-foreground/80", children: e }),
2638
2638
  /* @__PURE__ */ n("span", { className: "shrink-0 tabular-nums font-medium text-foreground", children: r("quota:percent_left", { percent: Zn(o, a.language) }) })
2639
2639
  ] }),
@@ -2647,7 +2647,7 @@ function xn({ label: e, remaining: t, amount: s }) {
2647
2647
  ] });
2648
2648
  }
2649
2649
  function gl({ className: e, details: t = !0 }) {
2650
- const { t: s, i18n: r } = _(["quota"]), { data: a } = St(), [o, i] = C(!1), l = a?.kind === "plan" ? pa(a.windows) : null, u = l ? {
2650
+ const { t: s, i18n: r } = k(["quota"]), { data: a } = St(), [o, i] = C(!1), l = a?.kind === "plan" ? pa(a.windows) : null, c = l ? {
2651
2651
  remaining: l.remaining,
2652
2652
  amount: l.amount,
2653
2653
  label: `${Et(s, l.meter)} ${ut(s, l)}`
@@ -2656,12 +2656,12 @@ function gl({ className: e, details: t = !0 }) {
2656
2656
  amount: a.credits.granted,
2657
2657
  label: s("quota:credits")
2658
2658
  } : null;
2659
- if (!a || !u) return null;
2660
- const { remaining: d, amount: p, label: m } = u, g = Lt(d, p), f = a.kind === "credits" ? s("quota:credits") : a.plan?.name ?? s("quota:plan"), h = Zn(g, r.language), N = d <= 0, v = x(
2659
+ if (!a || !c) return null;
2660
+ const { remaining: u, amount: p, label: m } = c, g = Lt(u, p), f = a.kind === "credits" ? s("quota:credits") : a.plan?.name ?? s("quota:plan"), h = Zn(g, r.language), N = u <= 0, v = x(
2661
2661
  "flex items-center gap-2 h-8 ps-2.5 pe-3 rounded-full border text-xs font-medium tabular-nums transition-colors",
2662
2662
  N ? "border-destructive/40 bg-destructive/10 text-destructive" : "border-border/60 bg-background/40 text-muted-foreground",
2663
2663
  e
2664
- ), y = /* @__PURE__ */ c(L, { children: [
2664
+ ), y = /* @__PURE__ */ d($, { children: [
2665
2665
  /* @__PURE__ */ n(
2666
2666
  "span",
2667
2667
  {
@@ -2673,7 +2673,7 @@ function gl({ className: e, details: t = !0 }) {
2673
2673
  "aria-label": s("quota:usage_label", { label: m, percent: h }),
2674
2674
  "aria-valuemin": 0,
2675
2675
  "aria-valuemax": p,
2676
- "aria-valuenow": d,
2676
+ "aria-valuenow": u,
2677
2677
  children: /* @__PURE__ */ n(
2678
2678
  "span",
2679
2679
  {
@@ -2685,7 +2685,7 @@ function gl({ className: e, details: t = !0 }) {
2685
2685
  ),
2686
2686
  /* @__PURE__ */ n("span", { "aria-hidden": !0, children: h })
2687
2687
  ] });
2688
- return t ? /* @__PURE__ */ c(hl, { open: o, onOpenChange: i, openDelay: 150, closeDelay: 100, children: [
2688
+ return t ? /* @__PURE__ */ d(hl, { open: o, onOpenChange: i, openDelay: 150, closeDelay: 100, children: [
2689
2689
  /* @__PURE__ */ n(pl, { asChild: !0, children: /* @__PURE__ */ n(
2690
2690
  "button",
2691
2691
  {
@@ -2698,8 +2698,8 @@ function gl({ className: e, details: t = !0 }) {
2698
2698
  children: y
2699
2699
  }
2700
2700
  ) }),
2701
- /* @__PURE__ */ c(fl, { align: "end", sideOffset: 6, className: "w-64 p-3 text-xs space-y-3", children: [
2702
- /* @__PURE__ */ c("div", { className: "flex items-baseline justify-between gap-2", children: [
2701
+ /* @__PURE__ */ d(fl, { align: "end", sideOffset: 6, className: "w-64 p-3 text-xs space-y-3", children: [
2702
+ /* @__PURE__ */ d("div", { className: "flex items-baseline justify-between gap-2", children: [
2703
2703
  /* @__PURE__ */ n("span", { className: "font-semibold text-foreground truncate", children: f }),
2704
2704
  a.ends_at && /* @__PURE__ */ n("span", { className: "shrink-0 text-xs text-muted-foreground", children: s("quota:ends_at", { datetime: Ot(a.ends_at, r.language) }) })
2705
2705
  ] }),
@@ -2716,21 +2716,21 @@ function gl({ className: e, details: t = !0 }) {
2716
2716
  ] }) : /* @__PURE__ */ n("div", { className: v, children: y });
2717
2717
  }
2718
2718
  function bl({ title: e, message: t, endsAt: s }) {
2719
- const { t: r } = _(["maintenance"]);
2719
+ const { t: r } = k(["maintenance"]);
2720
2720
  return /* @__PURE__ */ n(
2721
2721
  "div",
2722
2722
  {
2723
2723
  role: "status",
2724
2724
  "aria-live": "polite",
2725
- dir: B().dir,
2725
+ dir: V().dir,
2726
2726
  className: "shrink-0 border-b border-warning/30 bg-warning/10 px-4 py-2.5",
2727
- children: /* @__PURE__ */ c("div", { className: "mx-auto flex max-w-[50rem] items-start gap-2.5", children: [
2727
+ children: /* @__PURE__ */ d("div", { className: "mx-auto flex max-w-[50rem] items-start gap-2.5", children: [
2728
2728
  /* @__PURE__ */ n(Mn, { className: "mt-0.5 size-4 shrink-0 text-warning" }),
2729
- /* @__PURE__ */ c("p", { className: "min-w-0 flex-1 text-sm leading-relaxed text-warning", children: [
2729
+ /* @__PURE__ */ d("p", { className: "min-w-0 flex-1 text-sm leading-relaxed text-warning", children: [
2730
2730
  /* @__PURE__ */ n("span", { className: "font-semibold", children: e }),
2731
2731
  /* @__PURE__ */ n("span", { "aria-hidden": !0, className: "mx-1.5 opacity-50", children: "·" }),
2732
2732
  /* @__PURE__ */ n("span", { children: t }),
2733
- s && /* @__PURE__ */ c("span", { className: "text-warning/80", children: [
2733
+ s && /* @__PURE__ */ d("span", { className: "text-warning/80", children: [
2734
2734
  " ",
2735
2735
  r("maintenance:until", { datetime: s })
2736
2736
  ] })
@@ -2740,20 +2740,20 @@ function bl({ title: e, message: t, endsAt: s }) {
2740
2740
  );
2741
2741
  }
2742
2742
  function xl({ title: e, message: t, endsAt: s, refresh: r }) {
2743
- const { t: a } = _(["maintenance"]);
2743
+ const { t: a } = k(["maintenance"]);
2744
2744
  return /* @__PURE__ */ n(
2745
2745
  "div",
2746
2746
  {
2747
2747
  role: "status",
2748
2748
  "aria-live": "polite",
2749
- dir: B().dir,
2749
+ dir: V().dir,
2750
2750
  className: "flex min-h-dvh w-full flex-1 items-center justify-center bg-background px-6",
2751
- children: /* @__PURE__ */ c("div", { className: "flex max-w-md flex-col items-center gap-4 text-center", children: [
2751
+ children: /* @__PURE__ */ d("div", { className: "flex max-w-md flex-col items-center gap-4 text-center", children: [
2752
2752
  /* @__PURE__ */ n("div", { className: "flex size-14 items-center justify-center rounded-2xl border border-warning/30 bg-warning/10", children: /* @__PURE__ */ n(Mn, { className: "size-6 text-warning" }) }),
2753
2753
  /* @__PURE__ */ n("h1", { className: "text-xl font-semibold text-foreground", children: e }),
2754
2754
  /* @__PURE__ */ n("p", { className: "text-sm leading-relaxed text-muted-foreground", children: t }),
2755
2755
  s && /* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground/80", children: a("maintenance:until", { datetime: s }) }),
2756
- /* @__PURE__ */ c(E, { variant: "outline", size: "sm", onClick: r, className: "mt-2 gap-2", children: [
2756
+ /* @__PURE__ */ d(E, { variant: "outline", size: "sm", onClick: r, className: "mt-2 gap-2", children: [
2757
2757
  /* @__PURE__ */ n(Cr, { className: "size-3.5" }),
2758
2758
  a("maintenance:retry")
2759
2759
  ] })
@@ -2786,24 +2786,24 @@ function wl({
2786
2786
  index: t,
2787
2787
  children: s
2788
2788
  }) {
2789
- const r = G((l) => l.message), { referenceAdapters: a } = Q(), o = { messageId: r.id, partIndex: t, role: r.role, data: e };
2789
+ const r = W((l) => l.message), { referenceAdapters: a } = X(), o = { messageId: r.id, partIndex: t, role: r.role, data: e };
2790
2790
  let i;
2791
2791
  if (tt(e)) {
2792
- const l = et(e), u = {
2792
+ const l = et(e), c = {
2793
2793
  ...o,
2794
2794
  kind: "tool",
2795
2795
  sourceId: `${r.id}-${t}-tool`,
2796
2796
  label: l,
2797
2797
  excerpt: vl(e)
2798
- }, d = a?.[l]?.({ part: e, message: r, toolName: l }) || {};
2798
+ }, u = a?.[l]?.({ part: e, message: r, toolName: l }) || {};
2799
2799
  i = {
2800
+ ...c,
2800
2801
  ...u,
2801
- ...d,
2802
- sourceId: d.sourceId || u.sourceId,
2803
- messageId: d.messageId || u.messageId,
2804
- partIndex: d.partIndex ?? u.partIndex,
2805
- role: d.role || u.role,
2806
- kind: d.kind || u.kind
2802
+ sourceId: u.sourceId || c.sourceId,
2803
+ messageId: u.messageId || c.messageId,
2804
+ partIndex: u.partIndex ?? c.partIndex,
2805
+ role: u.role || c.role,
2806
+ kind: u.kind || c.kind
2807
2807
  };
2808
2808
  } else if (e.type === "file")
2809
2809
  i = {
@@ -2857,9 +2857,9 @@ function Kt({
2857
2857
  disclaimer: i,
2858
2858
  settings: l
2859
2859
  }) {
2860
- const u = Se(mt) ?? kl, d = jn(u, (v) => v.configured), p = Q(), m = Le(), g = O(
2860
+ const c = Se(mt) ?? kl, u = jn(c, (v) => v.configured), p = X(), m = Le(), g = O(
2861
2861
  () => Ft(
2862
- Ka(d, {
2862
+ Ka(u, {
2863
2863
  history: s,
2864
2864
  welcome: r,
2865
2865
  threadActions: a,
@@ -2869,7 +2869,7 @@ function Kt({
2869
2869
  }),
2870
2870
  m
2871
2871
  ),
2872
- [d, m, s, r, a, o, i, l]
2872
+ [u, m, s, r, a, o, i, l]
2873
2873
  ), [f] = C(() => kt(g));
2874
2874
  qn(() => f.setState(g), [f, g]);
2875
2875
  const h = O(() => ga(p, e), [p, e]), N = O(() => Os(h.parts), [h.parts]);
@@ -2880,7 +2880,7 @@ const _l = {
2880
2880
  left: "calc(var(--gentiq-selection-left) + var(--gentiq-selection-width) / 2)"
2881
2881
  };
2882
2882
  function Sl() {
2883
- const { t: e } = _(["chat"]), t = Jn();
2883
+ const { t: e } = k(["chat"]), t = Jn();
2884
2884
  return t ? Wa(
2885
2885
  /* @__PURE__ */ n(
2886
2886
  Ae.SelectionQuote,
@@ -2913,21 +2913,21 @@ function zl({
2913
2913
  }
2914
2914
  return a;
2915
2915
  }
2916
- const de = $n(function({ className: t, style: s, children: r, ...a }, o) {
2917
- const { resolvedTheme: i, accent: l, radius: u } = Ce(), { language: d, dir: p } = B(), m = W((N) => N.theme.typography?.fontFamily), g = W((N) => N.theme.userBubbleAccent), [f, h] = C(null);
2918
- return /* @__PURE__ */ c(
2916
+ const ue = $n(function({ className: t, style: s, children: r, ...a }, o) {
2917
+ const { resolvedTheme: i, accent: l, radius: c } = Ce(), { language: u, dir: p } = V(), m = K((N) => N.theme.typography?.fontFamily), g = K((N) => N.theme.userBubbleAccent), [f, h] = C(null);
2918
+ return /* @__PURE__ */ d(
2919
2919
  "div",
2920
2920
  {
2921
2921
  ref: o,
2922
2922
  ...a,
2923
2923
  className: x("gentiq", i, t),
2924
- lang: d,
2924
+ lang: u,
2925
2925
  dir: p,
2926
2926
  style: {
2927
2927
  ...zl({
2928
2928
  accent: l,
2929
- radius: u,
2930
- fontFamily: Cl(m, d),
2929
+ radius: c,
2930
+ fontFamily: Cl(m, u),
2931
2931
  userBubbleAccent: g
2932
2932
  }),
2933
2933
  ...s
@@ -2940,34 +2940,49 @@ const de = $n(function({ className: t, style: s, children: r, ...a }, o) {
2940
2940
  );
2941
2941
  });
2942
2942
  function Il({ classNames: e = {} }) {
2943
- const { t, i18n: s } = _(["chat"]), { threadId: r, messages: a, status: o, send: i, addToolOutput: l } = aa(), u = pe((z) => {
2944
- i({ text: z });
2945
- }, [i]), { MessageList: d, PromptInput: p, WelcomeScreen: m } = Q(), { composer: g, disclaimer: f } = K((z) => z), h = W((z) => z.app), N = s.exists("chat:disclaimer") ? t("chat:disclaimer") : null, v = typeof f == "string" ? Ne(f, t, s, ["chat"]) : f ?? N, y = a[a.length - 1], b = y?.role === "assistant" && (o === "ready" || y.parts.some((z) => z.type === "data-chat-finished")), I = o === "error", k = r === null && a.length === 0 && o !== "submitted", M = O(() => Ee(p), [p]), [T, P] = Qa(), A = O(
2946
- () => P ? { "--gentiq-composer-inset": `${P}px` } : void 0,
2947
- [P]
2943
+ const { t, i18n: s } = k(["chat"]), { threadId: r, messages: a, status: o, send: i, addToolOutput: l } = aa(), c = r === null && a.length === 0 && o !== "submitted", [u, p] = C({
2944
+ wasNew: c,
2945
+ threadId: r,
2946
+ reveal: !1,
2947
+ sent: !1
2948
+ }), m = de(
2949
+ (q) => (c && p((Q) => Q.sent ? Q : { ...Q, sent: !0 }), i(q)),
2950
+ [c, i]
2951
+ ), g = de((q) => {
2952
+ m({ text: q });
2953
+ }, [m]), { MessageList: f, PromptInput: h, WelcomeScreen: N } = X(), { composer: v, disclaimer: y } = Y((q) => q), b = K((q) => q.app), I = s.exists("chat:disclaimer") ? t("chat:disclaimer") : null, _ = typeof y == "string" ? Ne(y, t, s, ["chat"]) : y ?? I, z = a[a.length - 1], T = z?.role === "assistant" && (o === "ready" || z.parts.some((q) => q.type === "data-chat-finished")), P = o === "error";
2954
+ u.wasNew !== c || u.threadId !== r ? p({
2955
+ wasNew: c,
2956
+ threadId: r,
2957
+ reveal: u.wasNew && !c && !u.sent && o !== "submitted",
2958
+ sent: !1
2959
+ }) : u.reveal && o === "submitted" && p((q) => ({ ...q, reveal: !1 }));
2960
+ const A = u.reveal, M = O(() => Ee(h), [h]), [L, j] = Qa(), H = O(
2961
+ () => j ? { "--gentiq-composer-inset": `${j}px` } : void 0,
2962
+ [j]
2948
2963
  );
2949
- return /* @__PURE__ */ c(
2964
+ return /* @__PURE__ */ d(
2950
2965
  Ae.Root,
2951
2966
  {
2952
- enabled: g?.references?.enabled ?? !0,
2953
- maxItems: g?.references?.maxItems,
2954
- maxExcerptLength: g?.references?.maxExcerptLength,
2967
+ enabled: v?.references?.enabled ?? !0,
2968
+ maxItems: v?.references?.maxItems,
2969
+ maxExcerptLength: v?.references?.maxExcerptLength,
2955
2970
  children: [
2956
2971
  /* @__PURE__ */ n(
2957
2972
  fi,
2958
2973
  {
2959
- message: y,
2960
- disabled: !b || o !== "ready",
2961
- cacheNamespace: h.cacheNamespace,
2974
+ message: z,
2975
+ disabled: !T || o !== "ready",
2976
+ cacheNamespace: b.cacheNamespace,
2962
2977
  onAnswer: l,
2963
- children: /* @__PURE__ */ c(
2978
+ children: /* @__PURE__ */ d(
2964
2979
  De.Root,
2965
2980
  {
2966
2981
  className: x(
2967
2982
  "relative flex flex-col h-full overflow-hidden bg-background",
2968
2983
  e.container
2969
2984
  ),
2970
- style: A,
2985
+ style: H,
2971
2986
  children: [
2972
2987
  /* @__PURE__ */ n(
2973
2988
  "div",
@@ -2975,47 +2990,56 @@ function Il({ classNames: e = {} }) {
2975
2990
  "aria-hidden": !0,
2976
2991
  className: x(
2977
2992
  "gentiq-welcome-glow pointer-events-none absolute inset-0 transition-opacity duration-500",
2978
- h.showWelcomeGlow !== !1 && k ? "opacity-100" : "opacity-0"
2993
+ b.showWelcomeGlow !== !1 && c ? "opacity-100" : "opacity-0"
2979
2994
  )
2980
2995
  }
2981
2996
  ),
2982
- !k && /* @__PURE__ */ n(ge, { children: /* @__PURE__ */ n(d, { className: x("flex-1", e.messageList) }) }),
2983
- /* @__PURE__ */ c("div", { className: "absolute inset-0 z-10 pointer-events-none flex flex-col", children: [
2984
- /* @__PURE__ */ n("div", { className: "grow basis-0 shrink-0 min-h-0 flex flex-col items-center justify-end px-4 pb-6 md:pb-8", children: k && /* @__PURE__ */ n(m, { onSuggestionClick: u }) }),
2985
- /* @__PURE__ */ c("div", { ref: T, className: "relative shrink-0 flex flex-col items-stretch", children: [
2997
+ !c && /* @__PURE__ */ n(
2998
+ "div",
2999
+ {
3000
+ className: x(
3001
+ "flex-1 min-h-0 flex flex-col",
3002
+ A && "animate-thread-reveal"
3003
+ ),
3004
+ children: /* @__PURE__ */ n(ge, { children: /* @__PURE__ */ n(f, { className: x("flex-1", e.messageList) }) })
3005
+ }
3006
+ ),
3007
+ /* @__PURE__ */ d("div", { className: "absolute inset-0 z-10 pointer-events-none flex flex-col", children: [
3008
+ /* @__PURE__ */ n("div", { className: "grow basis-0 shrink-0 min-h-0 flex flex-col items-center justify-end px-4 pb-6 md:pb-8", children: c && /* @__PURE__ */ n(N, { onSuggestionClick: g }) }),
3009
+ /* @__PURE__ */ d("div", { ref: L, className: "relative shrink-0 flex flex-col items-stretch", children: [
2986
3010
  /* @__PURE__ */ n(
2987
3011
  "div",
2988
3012
  {
2989
3013
  "aria-hidden": !0,
2990
3014
  className: x(
2991
3015
  "pointer-events-none absolute inset-0 bg-gradient-to-t from-background/95 via-background/75 to-transparent backdrop-blur-sm [mask-image:linear-gradient(to_top,black_55%,transparent)] transition-opacity",
2992
- k ? "opacity-0 duration-200" : "opacity-100 duration-300 delay-200"
3016
+ c ? "opacity-0 duration-200" : "opacity-100 duration-300 delay-200"
2993
3017
  )
2994
3018
  }
2995
3019
  ),
2996
3020
  /* @__PURE__ */ n(
2997
3021
  M,
2998
3022
  {
2999
- onSend: i,
3023
+ onSend: m,
3000
3024
  status: o,
3001
- isErrorVisible: I,
3025
+ isErrorVisible: P,
3002
3026
  threadId: r,
3003
- newChat: k,
3027
+ newChat: c,
3004
3028
  className: x(
3005
3029
  "relative z-10 pointer-events-auto",
3006
3030
  e.inputArea,
3007
- v && "pb-0 md:pb-0"
3031
+ _ && "pb-0 md:pb-0"
3008
3032
  )
3009
3033
  }
3010
3034
  ),
3011
- v && /* @__PURE__ */ n("div", { className: "relative z-10 py-1.5 px-4 flex justify-center items-center pointer-events-auto", children: /* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground select-none text-center leading-tight", children: v }) })
3035
+ _ && /* @__PURE__ */ n("div", { className: "relative z-10 py-1.5 px-4 flex justify-center items-center pointer-events-auto", children: /* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground select-none text-center leading-tight", children: _ }) })
3012
3036
  ] }),
3013
3037
  /* @__PURE__ */ n(
3014
3038
  "div",
3015
3039
  {
3016
3040
  className: x(
3017
- "basis-0 shrink-0 transition-[flex-grow] duration-500 ease-in-out",
3018
- k ? "grow" : "grow-0"
3041
+ "basis-0 shrink-0 transition-[flex-grow] duration-500 ease-in-out motion-reduce:transition-none",
3042
+ c ? "grow" : "grow-0"
3019
3043
  )
3020
3044
  }
3021
3045
  )
@@ -3040,7 +3064,7 @@ const Tl = ({
3040
3064
  disclaimer: i,
3041
3065
  ...l
3042
3066
  }) => {
3043
- const u = Ct(), d = /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
3067
+ const c = Ct(), u = /* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(
3044
3068
  Kt,
3045
3069
  {
3046
3070
  components: s,
@@ -3051,18 +3075,18 @@ const Tl = ({
3051
3075
  children: /* @__PURE__ */ n(Il, { ...l })
3052
3076
  }
3053
3077
  ) });
3054
- return u && e === void 0 && t === void 0 ? d : /* @__PURE__ */ n(
3078
+ return c && e === void 0 && t === void 0 ? u : /* @__PURE__ */ n(
3055
3079
  Vn,
3056
3080
  {
3057
3081
  threadId: e,
3058
3082
  onThreadChange: t,
3059
- getThreadHref: u?.getThreadHref,
3060
- children: d
3083
+ getThreadHref: c?.getThreadHref,
3084
+ children: u
3061
3085
  }
3062
3086
  );
3063
3087
  };
3064
3088
  function Ml() {
3065
- return /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n("div", { className: "min-h-dvh bg-background" }) });
3089
+ return /* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n("div", { className: "min-h-dvh bg-background" }) });
3066
3090
  }
3067
3091
  const Pl = ({ theme: e = "system", ...t }) => /* @__PURE__ */ n(
3068
3092
  Ra,
@@ -3091,7 +3115,7 @@ function Rl() {
3091
3115
  return /* @__PURE__ */ n(Pl, { richColors: !0, theme: e });
3092
3116
  }
3093
3117
  const Al = Os(Ms), Dl = ({ message: e }) => {
3094
- F.error(e);
3118
+ B.error(e);
3095
3119
  };
3096
3120
  function Ol({
3097
3121
  toaster: e = !0,
@@ -3106,13 +3130,13 @@ function Ol({
3106
3130
  ...a,
3107
3131
  fallback: t ?? /* @__PURE__ */ n(Ml, {}),
3108
3132
  onConfigUnavailable: s,
3109
- overlay: e && /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(Rl, {}) }),
3133
+ overlay: e && /* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(Rl, {}) }),
3110
3134
  children: /* @__PURE__ */ n(le.PartsProvider, { components: Al, children: r })
3111
3135
  }
3112
3136
  );
3113
3137
  }
3114
3138
  function El() {
3115
- const { language: e, dir: t } = B(), { resolvedTheme: s } = Ce(), r = W((o) => o.app.name), a = W((o) => o.app.favicon);
3139
+ const { language: e, dir: t } = V(), { resolvedTheme: s } = Ce(), r = K((o) => o.app.name), a = K((o) => o.app.favicon);
3116
3140
  return D(() => {
3117
3141
  const o = document.documentElement, i = { lang: o.lang, dir: o.dir };
3118
3142
  return o.lang = e, o.dir = t, () => {
@@ -3143,22 +3167,22 @@ function Ll({ children: e, fallback: t, loginCode: s, onLoginCodeUsed: r }) {
3143
3167
  );
3144
3168
  D(() => {
3145
3169
  if (!s) return;
3146
- let d = !1;
3170
+ let u = !1;
3147
3171
  return i("pending"), (async () => {
3148
3172
  try {
3149
3173
  await a(s);
3150
3174
  } catch (p) {
3151
- if (d) return;
3175
+ if (u) return;
3152
3176
  console.error("Could not sign in with the login code:", p), i("failed");
3153
3177
  return;
3154
3178
  }
3155
- d || (r?.(), i("idle"));
3179
+ u || (r?.(), i("idle"));
3156
3180
  })(), () => {
3157
- d = !0;
3181
+ u = !0;
3158
3182
  };
3159
3183
  }, [s]);
3160
- const l = la({ enabled: o === "idle" }), u = o === "failed" ? "handoff_failed" : o === "idle" && (l === "signed_out" || l === "session_expired") ? l : null;
3161
- return u ? /* @__PURE__ */ n(L, { children: typeof t == "function" ? t(u) : t }) : o === "pending" || l === "checking" ? /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n("div", { className: "flex h-screen w-full items-center justify-center bg-background", children: /* @__PURE__ */ n("div", { className: "size-8 rounded-full border-4 border-primary border-t-transparent animate-spin" }) }) }) : /* @__PURE__ */ n(L, { children: e });
3184
+ const l = la({ enabled: o === "idle" }), c = o === "failed" ? "handoff_failed" : o === "idle" && (l === "signed_out" || l === "session_expired") ? l : null;
3185
+ return c ? /* @__PURE__ */ n($, { children: typeof t == "function" ? t(c) : t }) : o === "pending" || l === "checking" ? /* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n("div", { className: "flex h-screen w-full items-center justify-center bg-background", children: /* @__PURE__ */ n("div", { className: "size-8 rounded-full border-4 border-primary border-t-transparent animate-spin" }) }) }) : /* @__PURE__ */ n($, { children: e });
3162
3186
  }
3163
3187
  function Es({
3164
3188
  label: e,
@@ -3169,20 +3193,20 @@ function Es({
3169
3193
  resetsAt: o,
3170
3194
  action: i
3171
3195
  }) {
3172
- const { t: l, i18n: u } = _(["quota"]), d = Lt(r, a);
3173
- return /* @__PURE__ */ c("div", { className: "space-y-1.5", children: [
3174
- /* @__PURE__ */ c("div", { className: "flex items-baseline justify-between gap-3 text-sm", children: [
3175
- /* @__PURE__ */ c("span", { className: "font-medium text-foreground/80", children: [
3196
+ const { t: l, i18n: c } = k(["quota"]), u = Lt(r, a);
3197
+ return /* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
3198
+ /* @__PURE__ */ d("div", { className: "flex items-baseline justify-between gap-3 text-sm", children: [
3199
+ /* @__PURE__ */ d("span", { className: "font-medium text-foreground/80", children: [
3176
3200
  e,
3177
3201
  " ",
3178
3202
  t && /* @__PURE__ */ n("span", { className: "text-xs font-normal text-muted-foreground", children: t })
3179
3203
  ] }),
3180
- /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
3181
- /* @__PURE__ */ c("span", { className: "font-semibold tabular-nums text-foreground", children: [
3182
- nn(s, r, u.language),
3183
- /* @__PURE__ */ c("span", { className: "text-muted-foreground font-normal", children: [
3204
+ /* @__PURE__ */ d("span", { className: "flex items-center gap-2", children: [
3205
+ /* @__PURE__ */ d("span", { className: "font-semibold tabular-nums text-foreground", children: [
3206
+ nn(s, r, c.language),
3207
+ /* @__PURE__ */ d("span", { className: "text-muted-foreground font-normal", children: [
3184
3208
  " / ",
3185
- nn(s, a, u.language)
3209
+ nn(s, a, c.language)
3186
3210
  ] })
3187
3211
  ] }),
3188
3212
  i
@@ -3200,17 +3224,17 @@ function Es({
3200
3224
  children: /* @__PURE__ */ n(
3201
3225
  "div",
3202
3226
  {
3203
- className: x("h-full rounded-full transition-all duration-700", Dt(d)),
3204
- style: { width: `${d}%` }
3227
+ className: x("h-full rounded-full transition-all duration-700", Dt(u)),
3228
+ style: { width: `${u}%` }
3205
3229
  }
3206
3230
  )
3207
3231
  }
3208
3232
  ),
3209
- o && /* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground", children: l("quota:resets_at", { datetime: Ot(o, u.language) }) })
3233
+ o && /* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground", children: l("quota:resets_at", { datetime: Ot(o, c.language) }) })
3210
3234
  ] });
3211
3235
  }
3212
3236
  function ql({ windows: e, className: t, renderAction: s }) {
3213
- const { t: r } = _(["quota"]);
3237
+ const { t: r } = k(["quota"]);
3214
3238
  return /* @__PURE__ */ n("div", { className: x("space-y-4", t), children: e.map((a) => /* @__PURE__ */ n(
3215
3239
  Es,
3216
3240
  {
@@ -3226,7 +3250,7 @@ function ql({ windows: e, className: t, renderAction: s }) {
3226
3250
  )) });
3227
3251
  }
3228
3252
  function $l({ credits: e, action: t }) {
3229
- const { t: s } = _(["quota"]);
3253
+ const { t: s } = k(["quota"]);
3230
3254
  return /* @__PURE__ */ n(
3231
3255
  Es,
3232
3256
  {
@@ -3247,23 +3271,23 @@ function Pe(e, t) {
3247
3271
  const s = e?.sections?.[t];
3248
3272
  return s?.mode ?? (s?.enabled === !1 ? "hidden" : "editable");
3249
3273
  }
3250
- function ee(e, t, s, r = "editable") {
3274
+ function te(e, t, s, r = "editable") {
3251
3275
  return e?.sections?.[t]?.fields?.[s] || r;
3252
3276
  }
3253
3277
  function qs() {
3254
- const { t: e } = _("settings"), { data: t } = Un(), s = Le(), { data: r } = St({
3278
+ const { t: e } = k("settings"), { data: t } = Un(), s = Le(), { data: r } = St({
3255
3279
  enabled: !!s?.plugins?.includes("billing")
3256
3280
  }), a = [t?.name, t?.surname].filter(Boolean).join(" ").trim() || t?.username || t?.email || t?.phone || "", o = (a[0] ?? "U").toUpperCase(), i = r?.kind === "plan" ? r.plan?.name ?? e("account.custom_plan") : r?.kind === "credits" ? e("account.on_credits") : null, l = i ?? (t?.username ? `@${t.username}` : t?.email || "");
3257
3281
  return { displayName: a, initial: o, planLabel: i, handleOrPlan: l };
3258
3282
  }
3259
3283
  function Xt() {
3260
- const { t: e, i18n: t } = _("settings"), s = K((o) => o.settings), { locked: r } = Ce(), { locked: a } = B();
3284
+ const { t: e, i18n: t } = k("settings"), s = Y((o) => o.settings), { locked: r } = Ce(), { locked: a } = V();
3261
3285
  return O(() => {
3262
3286
  const o = e("sections.account"), i = e("sections.general"), l = [
3263
3287
  ["profile", o, Pr],
3264
3288
  ["general", i, Pn],
3265
3289
  ["account", o, Rr]
3266
- ].filter(([m]) => Pe(s, m) === "hidden" ? !1 : m !== "general" || !r && ee(s, "general", "theme") !== "hidden" || !a && ee(s, "general", "language") !== "hidden").map(([m, g, f]) => ({
3290
+ ].filter(([m]) => Pe(s, m) === "hidden" ? !1 : m !== "general" || !r && te(s, "general", "theme") !== "hidden" || !a && te(s, "general", "language") !== "hidden").map(([m, g, f]) => ({
3267
3291
  id: m,
3268
3292
  label: e(`sections.${m}`),
3269
3293
  title: e(`${m}.title`),
@@ -3271,7 +3295,7 @@ function Xt() {
3271
3295
  group: g,
3272
3296
  icon: f,
3273
3297
  faded: m !== "general" && Pe(s, m) === "faded"
3274
- })), u = (s?.customSections ?? []).map((m) => {
3298
+ })), c = (s?.customSections ?? []).map((m) => {
3275
3299
  const g = Ne(m.label, e, t, ["settings"]), f = m.group === "account" ? o : !m.group || m.group === "general" ? i : Ne(m.group, e, t, ["settings"]);
3276
3300
  return {
3277
3301
  id: m.id,
@@ -3283,10 +3307,10 @@ function Xt() {
3283
3307
  showInMenu: m.showInMenu,
3284
3308
  component: m.component
3285
3309
  };
3286
- }), d = [...l, ...u], p = /* @__PURE__ */ new Map();
3287
- for (const m of d)
3310
+ }), u = [...l, ...c], p = /* @__PURE__ */ new Map();
3311
+ for (const m of u)
3288
3312
  p.set(m.group, [...p.get(m.group) ?? [], m]);
3289
- return { sections: d, groups: Array.from(p, ([m, g]) => ({ title: m, items: g })) };
3313
+ return { sections: u, groups: Array.from(p, ([m, g]) => ({ title: m, items: g })) };
3290
3314
  }, [e, t, s, r, a]);
3291
3315
  }
3292
3316
  function $s(e, t) {
@@ -3297,9 +3321,9 @@ function $s(e, t) {
3297
3321
  return r ? s : null;
3298
3322
  }
3299
3323
  function js(e = "editable", t = "editable", s = "editable") {
3300
- const { t: r, i18n: a } = _("settings"), o = W((v) => v.app), { theme: i, setTheme: l, locked: u } = Ce(), { language: d, setLanguage: p, locked: m, dir: g } = B(), f = qa(a, o?.languages), h = f.find((v) => v === d) ?? d.split("-")[0];
3324
+ const { t: r, i18n: a } = k("settings"), o = K((v) => v.app), { theme: i, setTheme: l, locked: c } = Ce(), { language: u, setLanguage: p, locked: m, dir: g } = V(), f = qa(a, o?.languages), h = f.find((v) => v === u) ?? u.split("-")[0];
3301
3325
  return { rows: [
3302
- !u && t !== "hidden" && {
3326
+ !c && t !== "hidden" && {
3303
3327
  key: "theme",
3304
3328
  icon: Pn,
3305
3329
  label: r("general.theme"),
@@ -3333,25 +3357,25 @@ function Fl({
3333
3357
  languageMode: s = "editable"
3334
3358
  } = {}) {
3335
3359
  const r = Jr(), { rows: a, dir: o } = js(e, t, s);
3336
- return /* @__PURE__ */ n("div", { className: "divide-y divide-border/50", children: a.map(({ key: i, icon: l, label: u, value: d, disabled: p, onChange: m, options: g }) => {
3360
+ return /* @__PURE__ */ n("div", { className: "divide-y divide-border/50", children: a.map(({ key: i, icon: l, label: c, value: u, disabled: p, onChange: m, options: g }) => {
3337
3361
  const f = `${r}-${i}`;
3338
- return /* @__PURE__ */ c(
3362
+ return /* @__PURE__ */ d(
3339
3363
  "div",
3340
3364
  {
3341
3365
  className: `flex items-center justify-between gap-4 py-4 first:pt-1 ${p ? "opacity-60 pointer-events-none" : ""}`,
3342
3366
  children: [
3343
- /* @__PURE__ */ c(
3367
+ /* @__PURE__ */ d(
3344
3368
  ce,
3345
3369
  {
3346
3370
  htmlFor: f,
3347
3371
  className: "flex items-center gap-2.5 text-sm font-medium text-foreground cursor-pointer",
3348
3372
  children: [
3349
3373
  /* @__PURE__ */ n(l, { className: "size-4 text-muted-foreground shrink-0" }),
3350
- /* @__PURE__ */ n("span", { children: u })
3374
+ /* @__PURE__ */ n("span", { children: c })
3351
3375
  ]
3352
3376
  }
3353
3377
  ),
3354
- /* @__PURE__ */ c(es, { value: d, onValueChange: m, dir: o, disabled: p, children: [
3378
+ /* @__PURE__ */ d(es, { value: u, onValueChange: m, dir: o, disabled: p, children: [
3355
3379
  /* @__PURE__ */ n(
3356
3380
  ts,
3357
3381
  {
@@ -3395,19 +3419,19 @@ function Fs({
3395
3419
  required: o,
3396
3420
  dir: i,
3397
3421
  t: l,
3398
- selectPlaceholderKey: u
3422
+ selectPlaceholderKey: c
3399
3423
  }) {
3400
- const d = typeof s == "string" || typeof s == "number" ? String(s) : "";
3401
- return t.type === "select" ? /* @__PURE__ */ c(
3424
+ const u = typeof s == "string" || typeof s == "number" ? String(s) : "";
3425
+ return t.type === "select" ? /* @__PURE__ */ d(
3402
3426
  es,
3403
3427
  {
3404
- value: d,
3428
+ value: u,
3405
3429
  onValueChange: r,
3406
3430
  disabled: a,
3407
3431
  required: o,
3408
3432
  dir: i,
3409
3433
  children: [
3410
- /* @__PURE__ */ n(ts, { className: ft, children: /* @__PURE__ */ n(ns, { placeholder: l(t.placeholder || u) }) }),
3434
+ /* @__PURE__ */ n(ts, { className: ft, children: /* @__PURE__ */ n(ns, { placeholder: l(t.placeholder || c) }) }),
3411
3435
  /* @__PURE__ */ n(ss, { className: "rounded-xl border-border/40 shadow-xl bg-background", children: t.options?.map((p) => /* @__PURE__ */ n(
3412
3436
  rs,
3413
3437
  {
@@ -3419,7 +3443,7 @@ function Fs({
3419
3443
  )) })
3420
3444
  ]
3421
3445
  }
3422
- ) : t.type === "checkbox" ? /* @__PURE__ */ c("div", { className: "flex items-center gap-3 px-1 py-1", children: [
3446
+ ) : t.type === "checkbox" ? /* @__PURE__ */ d("div", { className: "flex items-center gap-3 px-1 py-1", children: [
3423
3447
  /* @__PURE__ */ n(
3424
3448
  "input",
3425
3449
  {
@@ -3438,7 +3462,7 @@ function Fs({
3438
3462
  {
3439
3463
  id: e,
3440
3464
  type: t.type,
3441
- value: d,
3465
+ value: u,
3442
3466
  disabled: a,
3443
3467
  required: o,
3444
3468
  onChange: (p) => r(p.target.value),
@@ -3452,7 +3476,7 @@ async function Us(e, t) {
3452
3476
  try {
3453
3477
  await e.logout(), window.location.reload();
3454
3478
  } catch (s) {
3455
- F.error(fe(s, t));
3479
+ B.error(fe(s, t));
3456
3480
  }
3457
3481
  }
3458
3482
  function Bs({
@@ -3460,7 +3484,7 @@ function Bs({
3460
3484
  name: t,
3461
3485
  subtitle: s
3462
3486
  }) {
3463
- return /* @__PURE__ */ c("div", { className: "flex items-center gap-2.5 min-w-0 flex-1", children: [
3487
+ return /* @__PURE__ */ d("div", { className: "flex items-center gap-2.5 min-w-0 flex-1", children: [
3464
3488
  /* @__PURE__ */ n(
3465
3489
  "div",
3466
3490
  {
@@ -3469,7 +3493,7 @@ function Bs({
3469
3493
  children: e
3470
3494
  }
3471
3495
  ),
3472
- /* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 leading-tight", children: [
3496
+ /* @__PURE__ */ d("div", { className: "flex flex-col min-w-0 leading-tight", children: [
3473
3497
  /* @__PURE__ */ n("span", { className: "truncate text-sm font-medium", children: t }),
3474
3498
  s && /* @__PURE__ */ n("span", { className: "truncate text-xs text-muted-foreground", children: s })
3475
3499
  ] })
@@ -3480,26 +3504,26 @@ function Hs({
3480
3504
  side: t = "top",
3481
3505
  align: s = "start"
3482
3506
  }) {
3483
- const { t: r } = _(["settings", "errors"]), a = K((z) => z.settings), o = a?.menu, i = Xe(), l = ze(), { sections: u } = Xt(), { displayName: d, initial: p, handleOrPlan: m } = qs(), g = Pe(a, "profile"), f = Pe(a, "account"), h = ee(a, "account", "logout"), { rows: N, dir: v } = js(
3507
+ const { t: r } = k(["settings", "errors"]), a = Y((M) => M.settings), o = a?.menu, i = Xe(), l = ze(), { sections: c } = Xt(), { displayName: u, initial: p, handleOrPlan: m } = qs(), g = Pe(a, "profile"), f = Pe(a, "account"), h = te(a, "account", "logout"), { rows: N, dir: v } = js(
3484
3508
  Pe(a, "general"),
3485
- ee(a, "general", "theme"),
3486
- ee(a, "general", "language")
3509
+ te(a, "general", "theme"),
3510
+ te(a, "general", "language")
3487
3511
  ), y = N.filter(
3488
- (z) => z.key === "theme" && o?.showTheme === !0 || z.key === "lang" && o?.showLanguage === !0
3489
- ), b = o?.showUserHeader !== !1 && !!d, I = u.find((z) => z.id === "general")?.id ?? u[0]?.id ?? "profile", k = (z) => u.find(($) => $.id === z), M = [
3490
- o?.showAccount !== !1 && k("account"),
3491
- o?.showProfile === !0 && k("profile"),
3492
- o?.showSettings !== !1 && u.length > 0 && {
3512
+ (M) => M.key === "theme" && o?.showTheme === !0 || M.key === "lang" && o?.showLanguage === !0
3513
+ ), b = o?.showUserHeader !== !1 && !!u, I = c.find((M) => M.id === "general")?.id ?? c[0]?.id ?? "profile", _ = (M) => c.find((L) => L.id === M), z = [
3514
+ o?.showAccount !== !1 && _("account"),
3515
+ o?.showProfile === !0 && _("profile"),
3516
+ o?.showSettings !== !1 && c.length > 0 && {
3493
3517
  id: I,
3494
3518
  icon: Re,
3495
3519
  label: r("title"),
3496
3520
  faded: !1
3497
3521
  },
3498
- ...u.filter((z) => z.showInMenu)
3499
- ].filter((z) => !!z), T = o?.showLogout !== !1 && f !== "hidden" && h !== "hidden", P = M.length > 0 || y.length > 0;
3522
+ ...c.filter((M) => M.showInMenu)
3523
+ ].filter((M) => !!M), T = o?.showLogout !== !1 && f !== "hidden" && h !== "hidden", P = z.length > 0 || y.length > 0;
3500
3524
  if (!b && !P && !T) return null;
3501
3525
  const A = /* @__PURE__ */ n("div", { role: "separator", className: "my-1 h-px bg-border/50" });
3502
- return /* @__PURE__ */ c(Pt, { dir: v, children: [
3526
+ return /* @__PURE__ */ d(Pt, { dir: v, children: [
3503
3527
  /* @__PURE__ */ n(Rt, { asChild: !0, children: /* @__PURE__ */ n(
3504
3528
  E,
3505
3529
  {
@@ -3515,7 +3539,7 @@ function Hs({
3515
3539
  children: /* @__PURE__ */ n(Re, { className: "size-4" })
3516
3540
  }
3517
3541
  ) }),
3518
- /* @__PURE__ */ c(
3542
+ /* @__PURE__ */ d(
3519
3543
  At,
3520
3544
  {
3521
3545
  side: t,
@@ -3523,66 +3547,66 @@ function Hs({
3523
3547
  sideOffset: 8,
3524
3548
  className: x("w-64", wn),
3525
3549
  children: [
3526
- b && /* @__PURE__ */ c(L, { children: [
3527
- /* @__PURE__ */ c(
3550
+ b && /* @__PURE__ */ d($, { children: [
3551
+ /* @__PURE__ */ d(
3528
3552
  we,
3529
3553
  {
3530
3554
  disabled: g === "hidden" || g === "faded",
3531
3555
  onSelect: () => l?.openSection("profile"),
3532
3556
  className: "cursor-pointer flex items-center justify-between gap-2.5 rounded-xl px-2.5 py-2",
3533
3557
  children: [
3534
- /* @__PURE__ */ n(Bs, { initial: p, name: d, subtitle: m }),
3558
+ /* @__PURE__ */ n(Bs, { initial: p, name: u, subtitle: m }),
3535
3559
  g !== "hidden" && /* @__PURE__ */ n(jr, { className: "size-4 shrink-0 text-muted-foreground rtl:rotate-180" })
3536
3560
  ]
3537
3561
  }
3538
3562
  ),
3539
3563
  (P || T) && A
3540
3564
  ] }),
3541
- M.map(({ id: z, icon: $, label: U, faded: H }) => /* @__PURE__ */ c(
3565
+ z.map(({ id: M, icon: L, label: j, faded: H }) => /* @__PURE__ */ d(
3542
3566
  we,
3543
3567
  {
3544
3568
  disabled: !!H,
3545
- onSelect: () => l?.openSection(z),
3569
+ onSelect: () => l?.openSection(M),
3546
3570
  className: je,
3547
3571
  children: [
3548
- /* @__PURE__ */ n($, { className: "size-4 text-muted-foreground" }),
3549
- /* @__PURE__ */ n("span", { children: U })
3572
+ /* @__PURE__ */ n(L, { className: "size-4 text-muted-foreground" }),
3573
+ /* @__PURE__ */ n("span", { children: j })
3550
3574
  ]
3551
3575
  },
3552
- `${z}-${U}`
3576
+ `${M}-${j}`
3553
3577
  )),
3554
- M.length > 0 && y.length > 0 && A,
3555
- y.map(({ key: z, icon: $, label: U, disabled: H, value: J, options: te, onChange: Y }) => /* @__PURE__ */ c(ya, { children: [
3556
- /* @__PURE__ */ c(wa, { disabled: H, className: je, children: [
3557
- /* @__PURE__ */ n($, { className: "size-4 text-muted-foreground" }),
3558
- /* @__PURE__ */ n("span", { children: U })
3578
+ z.length > 0 && y.length > 0 && A,
3579
+ y.map(({ key: M, icon: L, label: j, disabled: H, value: q, options: Q, onChange: Z }) => /* @__PURE__ */ d(ya, { children: [
3580
+ /* @__PURE__ */ d(wa, { disabled: H, className: je, children: [
3581
+ /* @__PURE__ */ n(L, { className: "size-4 text-muted-foreground" }),
3582
+ /* @__PURE__ */ n("span", { children: j })
3559
3583
  ] }),
3560
3584
  /* @__PURE__ */ n(
3561
3585
  Na,
3562
3586
  {
3563
3587
  sideOffset: 6,
3564
3588
  className: x("min-w-44 max-h-72 overflow-y-auto custom-scrollbar", wn),
3565
- children: te.map((X) => /* @__PURE__ */ c(
3589
+ children: Q.map((J) => /* @__PURE__ */ d(
3566
3590
  we,
3567
3591
  {
3568
3592
  role: "menuitemradio",
3569
- "aria-checked": J === X.value,
3570
- lang: X.lang,
3571
- onSelect: () => Y(X.value),
3593
+ "aria-checked": q === J.value,
3594
+ lang: J.lang,
3595
+ onSelect: () => Z(J.value),
3572
3596
  className: x(je, "justify-between"),
3573
3597
  children: [
3574
- /* @__PURE__ */ n("span", { children: X.label }),
3575
- J === X.value && /* @__PURE__ */ n(An, { className: "size-4 text-foreground" })
3598
+ /* @__PURE__ */ n("span", { children: J.label }),
3599
+ q === J.value && /* @__PURE__ */ n(An, { className: "size-4 text-foreground" })
3576
3600
  ]
3577
3601
  },
3578
- X.value
3602
+ J.value
3579
3603
  ))
3580
3604
  }
3581
3605
  )
3582
- ] }, z)),
3583
- T && /* @__PURE__ */ c(L, { children: [
3606
+ ] }, M)),
3607
+ T && /* @__PURE__ */ d($, { children: [
3584
3608
  P && A,
3585
- /* @__PURE__ */ c(
3609
+ /* @__PURE__ */ d(
3586
3610
  we,
3587
3611
  {
3588
3612
  variant: "destructive",
@@ -3612,19 +3636,19 @@ const Ul = [
3612
3636
  ["pass", "password", Lr, "password"]
3613
3637
  ];
3614
3638
  function Bl({ trigger: e }) {
3615
- const { t, i18n: s } = _(["settings", "common"]), r = W((S) => S.app), a = K((S) => S.settings), o = Xe(), i = Gn(), l = ca(), u = ze(), d = !e && u !== null && u.activeSection !== null, [p, m] = C(!1), g = d || p, { data: f, refetch: h } = St({
3639
+ const { t, i18n: s } = k(["settings", "common"]), r = K((S) => S.app), a = Y((S) => S.settings), o = Xe(), i = Gn(), l = ca(), c = ze(), u = !e && c !== null && c.activeSection !== null, [p, m] = C(!1), g = u || p, { data: f, refetch: h } = St({
3616
3640
  enabled: g
3617
- }), N = j(null), { dir: v } = B(), { sections: y } = Xt(), [b, I] = C(y[0]?.id || "profile"), k = (d ? u.activeSection : b) || y[0]?.id || "profile", M = y.find((S) => S.id === k) ?? y[0], T = M?.component, [P, A] = C({
3641
+ }), N = U(null), { dir: v } = V(), { sections: y } = Xt(), [b, I] = C(y[0]?.id || "profile"), _ = (u ? c.activeSection : b) || y[0]?.id || "profile", z = y.find((S) => S.id === _) ?? y[0], T = z?.component, [P, A] = C({
3618
3642
  name: "",
3619
3643
  surname: "",
3620
3644
  username: "",
3621
3645
  email: "",
3622
3646
  phone: "",
3623
3647
  password: ""
3624
- }), z = (S, q) => A((w) => ({ ...w, [S]: q })), $ = O(
3648
+ }), M = (S, F) => A((w) => ({ ...w, [S]: F })), L = O(
3625
3649
  () => r?.userMetadataFields?.filter((S) => S.showInProfile) || [],
3626
3650
  [r?.userMetadataFields]
3627
- ), [U, H] = C({}), [J, te] = C(!1), Y = pe(async () => {
3651
+ ), [j, H] = C({}), [q, Q] = C(!1), Z = de(async () => {
3628
3652
  try {
3629
3653
  h();
3630
3654
  const S = await o.getMe();
@@ -3637,25 +3661,25 @@ function Bl({ trigger: e }) {
3637
3661
  password: ""
3638
3662
  }), H(
3639
3663
  Object.fromEntries(
3640
- $.map((q) => [q.key, S.metadata?.[q.key] ?? q.defaultValue ?? ""])
3664
+ L.map((F) => [F.key, S.metadata?.[F.key] ?? F.defaultValue ?? ""])
3641
3665
  )
3642
3666
  );
3643
3667
  } catch (S) {
3644
- F.error(fe(S, t));
3668
+ B.error(fe(S, t));
3645
3669
  }
3646
- }, [t, $, o, h]);
3670
+ }, [t, L, o, h]);
3647
3671
  D(() => {
3648
3672
  if (!g) {
3649
3673
  N.current = null;
3650
3674
  return;
3651
3675
  }
3652
- (N.current === null || k === "account") && Y(), N.current = k;
3653
- }, [g, k, Y]), D(() => {
3654
- const S = $s($, U);
3676
+ (N.current === null || _ === "account") && Z(), N.current = _;
3677
+ }, [g, _, Z]), D(() => {
3678
+ const S = $s(L, j);
3655
3679
  S && H(S);
3656
- }, [U, $]);
3657
- const X = async () => {
3658
- te(!0);
3680
+ }, [j, L]);
3681
+ const J = async () => {
3682
+ Q(!0);
3659
3683
  try {
3660
3684
  const S = await o.updateMe({
3661
3685
  name: P.name,
@@ -3663,39 +3687,39 @@ function Bl({ trigger: e }) {
3663
3687
  username: P.username || void 0,
3664
3688
  email: P.email || void 0,
3665
3689
  phone: P.phone || void 0,
3666
- metadata: U,
3690
+ metadata: j,
3667
3691
  ...P.password && { password: P.password }
3668
3692
  });
3669
- i.setQueryData(l.currentUser(), S), F.success(t("profile.success")), z("password", ""), Y();
3693
+ i.setQueryData(l.currentUser(), S), B.success(t("profile.success")), M("password", ""), Z();
3670
3694
  } catch (S) {
3671
- F.error(fe(S, t));
3695
+ B.error(fe(S, t));
3672
3696
  } finally {
3673
- te(!1);
3697
+ Q(!1);
3674
3698
  }
3675
- }, ue = ee(a, "account", "usage"), re = ee(a, "account", "logout"), me = () => {
3676
- u?.close(), requestAnimationFrame(() => u?.triggerRef.current?.focus());
3677
- }, Ie = /* @__PURE__ */ c(
3699
+ }, me = te(a, "account", "usage"), re = te(a, "account", "logout"), he = () => {
3700
+ c?.close(), requestAnimationFrame(() => c?.triggerRef.current?.focus());
3701
+ }, Ie = /* @__PURE__ */ d(
3678
3702
  "div",
3679
3703
  {
3680
3704
  dir: v,
3681
- onKeyDown: d ? (S) => {
3682
- S.key === "Escape" && (S.stopPropagation(), me());
3705
+ onKeyDown: u ? (S) => {
3706
+ S.key === "Escape" && (S.stopPropagation(), he());
3683
3707
  } : void 0,
3684
3708
  className: "flex flex-col h-full w-full min-h-0 overflow-hidden",
3685
3709
  children: [
3686
- !d && /* @__PURE__ */ c("div", { className: "w-full border-b border-border/40 flex flex-col shrink-0 bg-muted/30 pt-10 sm:pt-6", children: [
3687
- /* @__PURE__ */ c("div", { className: "flex items-center gap-2.5 px-4 sm:px-6 mb-2 sm:mb-4 font-bold text-lg", children: [
3710
+ !u && /* @__PURE__ */ d("div", { className: "w-full border-b border-border/40 flex flex-col shrink-0 bg-muted/30 pt-10 sm:pt-6", children: [
3711
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2.5 px-4 sm:px-6 mb-2 sm:mb-4 font-bold text-lg", children: [
3688
3712
  /* @__PURE__ */ n(Re, { className: "size-5 text-primary" }),
3689
3713
  /* @__PURE__ */ n("span", { children: t("title") })
3690
3714
  ] }),
3691
- /* @__PURE__ */ n("div", { className: "w-full overflow-x-auto no-scrollbar pt-2 px-2 sm:px-4", children: /* @__PURE__ */ n("nav", { className: "flex items-center gap-2 sm:gap-6 w-max", children: y.map((S) => /* @__PURE__ */ c(
3715
+ /* @__PURE__ */ n("div", { className: "w-full overflow-x-auto no-scrollbar pt-2 px-2 sm:px-4", children: /* @__PURE__ */ n("nav", { className: "flex items-center gap-2 sm:gap-6 w-max", children: y.map((S) => /* @__PURE__ */ d(
3692
3716
  "button",
3693
3717
  {
3694
3718
  type: "button",
3695
3719
  onClick: () => I(S.id),
3696
3720
  className: x(
3697
3721
  "flex items-center gap-1.5 sm:gap-2 pb-2 sm:pb-3 pt-1 px-2 sm:px-1 text-sm sm:text-base font-medium transition-all border-b-2 whitespace-nowrap shrink-0",
3698
- k === S.id ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border",
3722
+ _ === S.id ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border",
3699
3723
  S.faded && Fe
3700
3724
  ),
3701
3725
  children: [
@@ -3706,60 +3730,60 @@ function Bl({ trigger: e }) {
3706
3730
  S.id
3707
3731
  )) }) })
3708
3732
  ] }),
3709
- /* @__PURE__ */ n("div", { className: "flex-1 relative min-h-0 h-full bg-background", children: /* @__PURE__ */ n("div", { className: "absolute inset-0 overflow-y-auto p-5 sm:p-8 pt-6 sm:pt-10 custom-scrollbar", children: /* @__PURE__ */ c(
3733
+ /* @__PURE__ */ n("div", { className: "flex-1 relative min-h-0 h-full bg-background", children: /* @__PURE__ */ n("div", { className: "absolute inset-0 overflow-y-auto p-5 sm:p-8 pt-6 sm:pt-10 custom-scrollbar", children: /* @__PURE__ */ d(
3710
3734
  "div",
3711
3735
  {
3712
3736
  className: x(
3713
3737
  "space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-200",
3714
- d && "max-w-2xl mx-auto w-full"
3738
+ u && "max-w-2xl mx-auto w-full"
3715
3739
  ),
3716
3740
  children: [
3717
- /* @__PURE__ */ c("div", { className: "flex items-start justify-between gap-4 border-b border-border/50 pb-4", children: [
3718
- /* @__PURE__ */ c("div", { children: [
3719
- /* @__PURE__ */ n("h2", { className: "text-xl sm:text-2xl font-semibold tracking-tight", children: M?.title ?? t("title") }),
3720
- M?.subtitle && /* @__PURE__ */ n("p", { className: "text-sm text-muted-foreground mt-1", children: M.subtitle })
3741
+ /* @__PURE__ */ d("div", { className: "flex items-start justify-between gap-4 border-b border-border/50 pb-4", children: [
3742
+ /* @__PURE__ */ d("div", { children: [
3743
+ /* @__PURE__ */ n("h2", { className: "text-xl sm:text-2xl font-semibold tracking-tight", children: z?.title ?? t("title") }),
3744
+ z?.subtitle && /* @__PURE__ */ n("p", { className: "text-sm text-muted-foreground mt-1", children: z.subtitle })
3721
3745
  ] }),
3722
- d && /* @__PURE__ */ n(
3746
+ u && /* @__PURE__ */ n(
3723
3747
  E,
3724
3748
  {
3725
3749
  type: "button",
3726
3750
  variant: "ghost",
3727
3751
  size: "icon",
3728
3752
  autoFocus: !0,
3729
- onClick: me,
3753
+ onClick: he,
3730
3754
  "aria-label": t("common:close"),
3731
3755
  className: "size-9 shrink-0 rounded-full text-muted-foreground hover:text-foreground",
3732
3756
  children: /* @__PURE__ */ n(wt, { className: "size-4" })
3733
3757
  }
3734
3758
  )
3735
3759
  ] }),
3736
- k === "profile" && /* @__PURE__ */ c("div", { className: "grid gap-6", children: [
3737
- /* @__PURE__ */ n("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: Ul.map(([S, q, w, R]) => {
3738
- const V = ee(a, "profile", q);
3739
- return V === "hidden" ? null : /* @__PURE__ */ c(
3760
+ _ === "profile" && /* @__PURE__ */ d("div", { className: "grid gap-6", children: [
3761
+ /* @__PURE__ */ n("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: Ul.map(([S, F, w, R]) => {
3762
+ const G = te(a, "profile", F);
3763
+ return G === "hidden" ? null : /* @__PURE__ */ d(
3740
3764
  "div",
3741
3765
  {
3742
3766
  className: x(
3743
3767
  "flex flex-col gap-2.5",
3744
3768
  w && "sm:col-span-2",
3745
- V === "faded" && Fe
3769
+ G === "faded" && Fe
3746
3770
  ),
3747
3771
  children: [
3748
- /* @__PURE__ */ n(ce, { htmlFor: S, className: "px-1 text-start", children: t(`profile.${q}`) }),
3749
- /* @__PURE__ */ c("div", { className: "relative", children: [
3772
+ /* @__PURE__ */ n(ce, { htmlFor: S, className: "px-1 text-start", children: t(`profile.${F}`) }),
3773
+ /* @__PURE__ */ d("div", { className: "relative", children: [
3750
3774
  w && /* @__PURE__ */ n(w, { className: "absolute top-1/2 -translate-y-1/2 size-4 text-muted-foreground start-3" }),
3751
3775
  /* @__PURE__ */ n(
3752
3776
  Ge,
3753
3777
  {
3754
3778
  id: S,
3755
3779
  type: R,
3756
- value: P[q],
3757
- onChange: (ae) => z(
3758
- q,
3759
- q === "phone" ? ae.target.value.replace(/[^0-9]/g, "") : ae.target.value
3780
+ value: P[F],
3781
+ onChange: (ae) => M(
3782
+ F,
3783
+ F === "phone" ? ae.target.value.replace(/[^0-9]/g, "") : ae.target.value
3760
3784
  ),
3761
- disabled: V === "faded",
3762
- placeholder: q === "password" ? t("profile.password_placeholder") : void 0,
3785
+ disabled: G === "faded",
3786
+ placeholder: F === "password" ? t("profile.password_placeholder") : void 0,
3763
3787
  className: x(ft, w && "ps-10 pe-3"),
3764
3788
  dir: w ? "ltr" : void 0
3765
3789
  }
@@ -3767,18 +3791,18 @@ function Bl({ trigger: e }) {
3767
3791
  ] })
3768
3792
  ]
3769
3793
  },
3770
- q
3794
+ F
3771
3795
  );
3772
3796
  }) }),
3773
- $.map((S) => {
3774
- const q = ee(a, "profile", S.key, S.mode || "editable");
3775
- if (q === "hidden" || !$t(S.condition, U))
3797
+ L.map((S) => {
3798
+ const F = te(a, "profile", S.key, S.mode || "editable");
3799
+ if (F === "hidden" || !$t(S.condition, j))
3776
3800
  return null;
3777
3801
  const w = `profile-${S.key}`;
3778
- return /* @__PURE__ */ c(
3802
+ return /* @__PURE__ */ d(
3779
3803
  "div",
3780
3804
  {
3781
- className: x("flex flex-col gap-2.5", q === "faded" && Fe),
3805
+ className: x("flex flex-col gap-2.5", F === "faded" && Fe),
3782
3806
  children: [
3783
3807
  /* @__PURE__ */ n(ce, { htmlFor: w, className: "px-1", children: t(S.label) }),
3784
3808
  /* @__PURE__ */ n(
@@ -3786,9 +3810,9 @@ function Bl({ trigger: e }) {
3786
3810
  {
3787
3811
  id: w,
3788
3812
  field: S,
3789
- value: U[S.key],
3790
- onChange: (R) => H({ ...U, [S.key]: R }),
3791
- disabled: q === "faded",
3813
+ value: j[S.key],
3814
+ onChange: (R) => H({ ...j, [S.key]: R }),
3815
+ disabled: F === "faded",
3792
3816
  dir: v,
3793
3817
  t,
3794
3818
  selectPlaceholderKey: "profile.select_placeholder"
@@ -3799,44 +3823,44 @@ function Bl({ trigger: e }) {
3799
3823
  S.key
3800
3824
  );
3801
3825
  }),
3802
- /* @__PURE__ */ n("div", { className: "pt-2 flex justify-end", children: /* @__PURE__ */ c(
3826
+ /* @__PURE__ */ n("div", { className: "pt-2 flex justify-end", children: /* @__PURE__ */ d(
3803
3827
  E,
3804
3828
  {
3805
3829
  onClick: () => {
3806
- X();
3830
+ J();
3807
3831
  },
3808
- disabled: J,
3832
+ disabled: q,
3809
3833
  className: "w-full sm:w-auto px-6 rounded-full gap-2 font-medium h-10",
3810
3834
  children: [
3811
3835
  /* @__PURE__ */ n(qr, { className: "size-4" }),
3812
- t(J ? "profile.saving" : "profile.save")
3836
+ t(q ? "profile.saving" : "profile.save")
3813
3837
  ]
3814
3838
  }
3815
3839
  ) })
3816
3840
  ] }),
3817
- k === "general" && /* @__PURE__ */ n(
3841
+ _ === "general" && /* @__PURE__ */ n(
3818
3842
  Fl,
3819
3843
  {
3820
3844
  sectionMode: a?.sections?.general?.mode ?? "editable",
3821
- themeMode: ee(a, "general", "theme"),
3822
- languageMode: ee(a, "general", "language")
3845
+ themeMode: te(a, "general", "theme"),
3846
+ languageMode: te(a, "general", "language")
3823
3847
  }
3824
3848
  ),
3825
- k === "account" && /* @__PURE__ */ c("div", { className: "space-y-6", children: [
3826
- ue !== "hidden" && f && /* @__PURE__ */ c(
3849
+ _ === "account" && /* @__PURE__ */ d("div", { className: "space-y-6", children: [
3850
+ me !== "hidden" && f && /* @__PURE__ */ d(
3827
3851
  "div",
3828
3852
  {
3829
3853
  className: x(
3830
3854
  "p-6 bg-muted/30 rounded-3xl border border-border/40 space-y-5",
3831
- ue === "faded" && "opacity-50"
3855
+ me === "faded" && "opacity-50"
3832
3856
  ),
3833
3857
  children: [
3834
- /* @__PURE__ */ c("div", { className: "flex items-start justify-between gap-3", children: [
3835
- /* @__PURE__ */ c(ce, { className: "text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2", children: [
3858
+ /* @__PURE__ */ d("div", { className: "flex items-start justify-between gap-3", children: [
3859
+ /* @__PURE__ */ d(ce, { className: "text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2", children: [
3836
3860
  /* @__PURE__ */ n($r, { className: "size-4" }),
3837
3861
  t("account.usage")
3838
3862
  ] }),
3839
- /* @__PURE__ */ c("div", { className: "text-end", children: [
3863
+ /* @__PURE__ */ d("div", { className: "text-end", children: [
3840
3864
  /* @__PURE__ */ n("p", { className: "text-sm font-semibold text-foreground", children: f.kind === "credits" ? t("account.on_credits") : f.kind === "unlimited" ? t("account.unlimited") : f.plan?.name ?? t("account.custom_plan") }),
3841
3865
  f.ends_at && /* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground", children: t("account.plan_until", {
3842
3866
  datetime: Ot(f.ends_at, s.language)
@@ -3849,9 +3873,9 @@ function Bl({ trigger: e }) {
3849
3873
  ]
3850
3874
  }
3851
3875
  ),
3852
- re !== "hidden" && /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-4 py-3 border-t border-border/40", children: [
3876
+ re !== "hidden" && /* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-4 py-3 border-t border-border/40", children: [
3853
3877
  /* @__PURE__ */ n("span", { className: "text-sm font-medium text-foreground", children: t("account.logout") }),
3854
- /* @__PURE__ */ c(
3878
+ /* @__PURE__ */ d(
3855
3879
  E,
3856
3880
  {
3857
3881
  variant: "destructive",
@@ -3875,7 +3899,7 @@ function Bl({ trigger: e }) {
3875
3899
  ]
3876
3900
  }
3877
3901
  ) }) }),
3878
- r?.showVersionInSettings !== !1 && r?.version && /* @__PURE__ */ c(
3902
+ r?.showVersionInSettings !== !1 && r?.version && /* @__PURE__ */ d(
3879
3903
  "div",
3880
3904
  {
3881
3905
  dir: "ltr",
@@ -3889,7 +3913,7 @@ function Bl({ trigger: e }) {
3889
3913
  ]
3890
3914
  }
3891
3915
  );
3892
- return d ? /* @__PURE__ */ n("section", { "aria-label": t("title"), className: "flex flex-1 min-h-0 h-full w-full bg-background", children: Ie }) : /* @__PURE__ */ c(qe, { open: p, onOpenChange: m, children: [
3916
+ return u ? /* @__PURE__ */ n("section", { "aria-label": t("title"), className: "flex flex-1 min-h-0 h-full w-full bg-background", children: Ie }) : /* @__PURE__ */ d(qe, { open: p, onOpenChange: m, children: [
3893
3917
  /* @__PURE__ */ n(Qn, { asChild: !0, children: e || /* @__PURE__ */ n(E, { variant: "ghost", size: "icon", className: "rounded-full", children: /* @__PURE__ */ n(Re, { className: "h-5 w-5" }) }) }),
3894
3918
  /* @__PURE__ */ n(
3895
3919
  Mt,
@@ -3907,53 +3931,53 @@ const Nn = (e) => e.replace(/[^0-9]/g, ""), kn = {
3907
3931
  phone: "tel"
3908
3932
  };
3909
3933
  function Hl(e) {
3910
- return /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(Vl, { ...e }) });
3934
+ return /* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(Vl, { ...e }) });
3911
3935
  }
3912
3936
  function Vl({ onSignedIn: e, reason: t }) {
3913
- const { t: s } = _(["login"]), r = W((w) => w.app), a = Xe(), o = B().dir, i = Gn(), [l, u] = C("login"), d = !!r?.disableSignup, p = !!r?.disableAuthPage, m = O(
3937
+ const { t: s } = k(["login"]), r = K((w) => w.app), a = Xe(), o = V().dir, i = Gn(), [l, c] = C("login"), u = !!r?.disableSignup, p = !!r?.disableAuthPage, m = O(
3914
3938
  () => r?.loginFields ?? ["username"],
3915
3939
  [r?.loginFields]
3916
- ), g = m.map((w) => s(w)).join(" / "), f = m.length === 1 ? kn[m[0]] : "text", h = m.length === 1 && m[0] === "phone", [N, v] = C(""), [y, b] = C(""), [I, k] = C({}), [M, T] = C(""), [P, A] = C(""), [z, $] = C(""), U = O(
3940
+ ), g = m.map((w) => s(w)).join(" / "), f = m.length === 1 ? kn[m[0]] : "text", h = m.length === 1 && m[0] === "phone", [N, v] = C(""), [y, b] = C(""), [I, _] = C({}), [z, T] = C(""), [P, A] = C(""), [M, L] = C(""), j = O(
3917
3941
  () => r?.userMetadataFields?.filter((w) => w.showInSignup) || [],
3918
3942
  [r?.userMetadataFields]
3919
- ), [H, J] = C(() => {
3943
+ ), [H, q] = C(() => {
3920
3944
  const w = {};
3921
- return U.forEach((R) => {
3945
+ return j.forEach((R) => {
3922
3946
  R.defaultValue !== void 0 && (w[R.key] = R.defaultValue);
3923
3947
  }), w;
3924
3948
  });
3925
3949
  D(() => {
3926
- const w = $s(U, H);
3927
- w && J(w);
3928
- }, [H, U]);
3929
- const [te, Y] = C(""), [X, ue] = C(!1);
3950
+ const w = $s(j, H);
3951
+ w && q(w);
3952
+ }, [H, j]);
3953
+ const [Q, Z] = C(""), [J, me] = C(!1);
3930
3954
  D(() => {
3931
- d && l === "register" && u("login");
3932
- }, [d, l]);
3955
+ u && l === "register" && c("login");
3956
+ }, [u, l]);
3933
3957
  const re = async (w, R) => {
3934
- w.preventDefault(), Y(""), ue(!0);
3958
+ w.preventDefault(), Z(""), me(!0);
3935
3959
  try {
3936
3960
  await R(), i.clear(), e();
3937
- } catch (V) {
3938
- Y(fe(V, s));
3961
+ } catch (G) {
3962
+ Z(fe(G, s));
3939
3963
  } finally {
3940
- ue(!1);
3964
+ me(!1);
3941
3965
  }
3942
- }, me = (w) => {
3966
+ }, he = (w) => {
3943
3967
  const R = {};
3944
- for (const V of m) {
3945
- const ae = I[V]?.trim();
3946
- ae && (R[V] = ae);
3968
+ for (const G of m) {
3969
+ const ae = I[G]?.trim();
3970
+ ae && (R[G] = ae);
3947
3971
  }
3948
3972
  if (Object.keys(R).length === 0) {
3949
- w.preventDefault(), Y(s("at_least_one_login_field"));
3973
+ w.preventDefault(), Z(s("at_least_one_login_field"));
3950
3974
  return;
3951
3975
  }
3952
- re(w, () => a.register(R, M, P, z, H));
3976
+ re(w, () => a.register(R, z, P, M, H));
3953
3977
  };
3954
3978
  if (p) {
3955
3979
  const w = t === "handoff_failed" ? "handoff_failed" : "auth_page_disabled";
3956
- return /* @__PURE__ */ n("div", { className: "min-h-screen bg-background flex items-center justify-center p-4", dir: o, children: /* @__PURE__ */ c("div", { className: "w-full max-w-lg bg-card border border-border rounded-xl shadow-lg p-8 text-center space-y-4", children: [
3980
+ return /* @__PURE__ */ n("div", { className: "min-h-screen bg-background flex items-center justify-center p-4", dir: o, children: /* @__PURE__ */ d("div", { className: "w-full max-w-lg bg-card border border-border rounded-xl shadow-lg p-8 text-center space-y-4", children: [
3957
3981
  /* @__PURE__ */ n("h1", { className: "text-2xl font-bold", children: r?.name }),
3958
3982
  /* @__PURE__ */ n("p", { className: "text-muted-foreground", children: s(`${w}_title`) }),
3959
3983
  /* @__PURE__ */ n("p", { className: "text-sm text-muted-foreground/80", children: s(`${w}_description`) })
@@ -3961,8 +3985,8 @@ function Vl({ onSignedIn: e, reason: t }) {
3961
3985
  }
3962
3986
  const Ie = [
3963
3987
  ["login", "login_tab"],
3964
- ...d ? [] : [["register", "signup_tab"]]
3965
- ], S = l === "login" || d, q = S ? [
3988
+ ...u ? [] : [["register", "signup_tab"]]
3989
+ ], S = l === "login" || u, F = S ? [
3966
3990
  [
3967
3991
  "login-identity",
3968
3992
  g,
@@ -3988,8 +4012,8 @@ function Vl({ onSignedIn: e, reason: t }) {
3988
4012
  s(w),
3989
4013
  kn[w],
3990
4014
  I[w] ?? "",
3991
- (R) => k((V) => ({
3992
- ...V,
4015
+ (R) => _((G) => ({
4016
+ ...G,
3993
4017
  [w]: w === "phone" ? Nn(R) : R
3994
4018
  })),
3995
4019
  s(`${w}_placeholder`),
@@ -4000,7 +4024,7 @@ function Vl({ onSignedIn: e, reason: t }) {
4000
4024
  "reg-pass",
4001
4025
  s("password"),
4002
4026
  "password",
4003
- M,
4027
+ z,
4004
4028
  T,
4005
4029
  "••••••••",
4006
4030
  !0
@@ -4011,35 +4035,35 @@ function Vl({ onSignedIn: e, reason: t }) {
4011
4035
  {
4012
4036
  className: "min-h-screen bg-background flex flex-col items-center justify-center p-4",
4013
4037
  dir: o,
4014
- children: /* @__PURE__ */ c("div", { className: "w-full max-w-md bg-card border border-border rounded-xl shadow-lg p-6", children: [
4038
+ children: /* @__PURE__ */ d("div", { className: "w-full max-w-md bg-card border border-border rounded-xl shadow-lg p-6", children: [
4015
4039
  /* @__PURE__ */ n("div", { className: "text-center mb-6", children: /* @__PURE__ */ n("h1", { className: "text-2xl font-bold text-foreground", children: r?.name }) }),
4016
4040
  /* @__PURE__ */ n("div", { className: "flex bg-muted p-1 rounded-lg mb-6", children: Ie.map(([w, R]) => /* @__PURE__ */ n(
4017
4041
  "button",
4018
4042
  {
4019
4043
  type: "button",
4020
4044
  onClick: () => {
4021
- u(w), Y("");
4045
+ c(w), Z("");
4022
4046
  },
4023
4047
  className: `flex-1 py-2 text-sm font-medium rounded-md transition-all ${l === w ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
4024
4048
  children: s(R)
4025
4049
  },
4026
4050
  w
4027
4051
  )) }),
4028
- /* @__PURE__ */ c(
4052
+ /* @__PURE__ */ d(
4029
4053
  "form",
4030
4054
  {
4031
4055
  onSubmit: S ? (w) => {
4032
4056
  re(w, () => a.login(N, y));
4033
- } : me,
4057
+ } : he,
4034
4058
  className: "space-y-4",
4035
4059
  children: [
4036
- q.map(([w, R, V, ae, Xs, Ys, Js]) => /* @__PURE__ */ c("div", { className: "space-y-3", children: [
4060
+ F.map(([w, R, G, ae, Xs, Ys, Js]) => /* @__PURE__ */ d("div", { className: "space-y-3", children: [
4037
4061
  /* @__PURE__ */ n(ce, { htmlFor: w, children: R }),
4038
4062
  /* @__PURE__ */ n(
4039
4063
  Ge,
4040
4064
  {
4041
4065
  id: w,
4042
- type: V,
4066
+ type: G,
4043
4067
  value: ae,
4044
4068
  onChange: (Zs) => Xs(Zs.target.value),
4045
4069
  required: Js,
@@ -4049,11 +4073,11 @@ function Vl({ onSignedIn: e, reason: t }) {
4049
4073
  }
4050
4074
  )
4051
4075
  ] }, w)),
4052
- !S && /* @__PURE__ */ c(L, { children: [
4076
+ !S && /* @__PURE__ */ d($, { children: [
4053
4077
  /* @__PURE__ */ n("div", { className: "grid grid-cols-2 gap-4", children: [
4054
4078
  ["name", P, A],
4055
- ["surname", z, $]
4056
- ].map(([w, R, V]) => /* @__PURE__ */ c("div", { className: "space-y-3", children: [
4079
+ ["surname", M, L]
4080
+ ].map(([w, R, G]) => /* @__PURE__ */ d("div", { className: "space-y-3", children: [
4057
4081
  /* @__PURE__ */ n(ce, { htmlFor: `reg-${w}`, children: s(w) }),
4058
4082
  /* @__PURE__ */ n(
4059
4083
  Ge,
@@ -4061,17 +4085,17 @@ function Vl({ onSignedIn: e, reason: t }) {
4061
4085
  id: `reg-${w}`,
4062
4086
  type: "text",
4063
4087
  value: R,
4064
- onChange: (ae) => V(ae.target.value),
4088
+ onChange: (ae) => G(ae.target.value),
4065
4089
  required: !0,
4066
4090
  className: "text-start",
4067
4091
  placeholder: s(`${w}_placeholder`)
4068
4092
  }
4069
4093
  )
4070
4094
  ] }, w)) }),
4071
- U.map((w) => {
4095
+ j.map((w) => {
4072
4096
  if (!$t(w.condition, H)) return null;
4073
4097
  const R = `signup-${w.key}`;
4074
- return /* @__PURE__ */ c(
4098
+ return /* @__PURE__ */ d(
4075
4099
  "div",
4076
4100
  {
4077
4101
  className: "space-y-3 animate-in fade-in slide-in-from-top-1 duration-200",
@@ -4083,7 +4107,7 @@ function Vl({ onSignedIn: e, reason: t }) {
4083
4107
  id: R,
4084
4108
  field: w,
4085
4109
  value: H[w.key],
4086
- onChange: (V) => J({ ...H, [w.key]: V }),
4110
+ onChange: (G) => q({ ...H, [w.key]: G }),
4087
4111
  required: w.required,
4088
4112
  dir: o,
4089
4113
  t: s,
@@ -4096,9 +4120,9 @@ function Vl({ onSignedIn: e, reason: t }) {
4096
4120
  );
4097
4121
  })
4098
4122
  ] }),
4099
- te && /* @__PURE__ */ n("div", { role: "alert", className: "text-sm text-destructive", children: te }),
4100
- /* @__PURE__ */ n(E, { type: "submit", disabled: X, className: "w-full font-semibold", children: s(
4101
- X ? S ? "logging_in" : "signing_up" : S ? "login_button" : "signup_button"
4123
+ Q && /* @__PURE__ */ n("div", { role: "alert", className: "text-sm text-destructive", children: Q }),
4124
+ /* @__PURE__ */ n(E, { type: "submit", disabled: J, className: "w-full font-semibold", children: s(
4125
+ J ? S ? "logging_in" : "signing_up" : S ? "login_button" : "signup_button"
4102
4126
  ) })
4103
4127
  ]
4104
4128
  }
@@ -4107,12 +4131,12 @@ function Vl({ onSignedIn: e, reason: t }) {
4107
4131
  }
4108
4132
  );
4109
4133
  }
4110
- const Yt = Z.createContext(null);
4134
+ const Yt = ee.createContext(null);
4111
4135
  function Vs() {
4112
- return Z.useContext(Yt);
4136
+ return ee.useContext(Yt);
4113
4137
  }
4114
4138
  function rt() {
4115
- const e = Z.useContext(Yt);
4139
+ const e = ee.useContext(Yt);
4116
4140
  if (!e) throw new Error("useSidebar must be used within a SidebarProvider.");
4117
4141
  return e;
4118
4142
  }
@@ -4125,24 +4149,24 @@ function Gl({
4125
4149
  children: o,
4126
4150
  ...i
4127
4151
  }) {
4128
- const l = Qt(), [u, d] = Z.useState(!1), [p, m] = Z.useState(e), g = t ?? p, f = Z.useCallback(
4152
+ const l = Qt(), [c, u] = ee.useState(!1), [p, m] = ee.useState(e), g = t ?? p, f = ee.useCallback(
4129
4153
  (y) => {
4130
4154
  const b = typeof y == "function" ? y(g) : y;
4131
4155
  s ? s(b) : m(b), document.cookie = `sidebar_state=${b}; path=/; max-age=604800`;
4132
4156
  },
4133
4157
  [s, g]
4134
- ), h = Z.useCallback(() => {
4135
- l ? d((y) => !y) : f((y) => !y);
4158
+ ), h = ee.useCallback(() => {
4159
+ l ? u((y) => !y) : f((y) => !y);
4136
4160
  }, [l, f]);
4137
- Z.useEffect(() => {
4161
+ ee.useEffect(() => {
4138
4162
  const y = (b) => {
4139
4163
  b.key === "b" && (b.metaKey || b.ctrlKey) && (b.preventDefault(), h());
4140
4164
  };
4141
4165
  return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
4142
4166
  }, [h]);
4143
- const N = g ? "expanded" : "collapsed", v = Z.useMemo(
4144
- () => ({ state: N, open: g, setOpen: f, isMobile: l, openMobile: u, setOpenMobile: d, toggleSidebar: h }),
4145
- [N, g, f, l, u, h]
4167
+ const N = g ? "expanded" : "collapsed", v = ee.useMemo(
4168
+ () => ({ state: N, open: g, setOpen: f, isMobile: l, openMobile: c, setOpenMobile: u, toggleSidebar: h }),
4169
+ [N, g, f, l, c, h]
4146
4170
  );
4147
4171
  return /* @__PURE__ */ n(Yt.Provider, { value: v, children: /* @__PURE__ */ n(ka, { delayDuration: 0, children: /* @__PURE__ */ n(
4148
4172
  "div",
@@ -4163,8 +4187,8 @@ function Wl({
4163
4187
  children: a,
4164
4188
  ...o
4165
4189
  }) {
4166
- const { isMobile: i, state: l, openMobile: u, setOpenMobile: d } = rt(), { t: p } = _("sidebar");
4167
- return i ? /* @__PURE__ */ n(_a, { open: u, onOpenChange: d, ...o, children: /* @__PURE__ */ c(
4190
+ const { isMobile: i, state: l, openMobile: c, setOpenMobile: u } = rt(), { t: p } = k("sidebar");
4191
+ return i ? /* @__PURE__ */ n(_a, { open: c, onOpenChange: u, ...o, children: /* @__PURE__ */ d(
4168
4192
  Sa,
4169
4193
  {
4170
4194
  onOpenAutoFocus: (m) => m.preventDefault(),
@@ -4175,14 +4199,14 @@ function Wl({
4175
4199
  style: { "--gentiq-sidebar-width": "18rem" },
4176
4200
  side: e,
4177
4201
  children: [
4178
- /* @__PURE__ */ c(Ca, { className: "sr-only", children: [
4202
+ /* @__PURE__ */ d(Ca, { className: "sr-only", children: [
4179
4203
  /* @__PURE__ */ n(za, { children: p("title") }),
4180
4204
  /* @__PURE__ */ n(Ia, { children: p("mobile_description") })
4181
4205
  ] }),
4182
4206
  /* @__PURE__ */ n("div", { className: "flex h-full w-full flex-col", children: a })
4183
4207
  ]
4184
4208
  }
4185
- ) }) : /* @__PURE__ */ c(
4209
+ ) }) : /* @__PURE__ */ d(
4186
4210
  "div",
4187
4211
  {
4188
4212
  className: "group peer text-sidebar-foreground hidden md:block",
@@ -4225,8 +4249,8 @@ function Wl({
4225
4249
  );
4226
4250
  }
4227
4251
  function Gs({ className: e, onClick: t, ...s }) {
4228
- const { toggleSidebar: r } = rt(), { t: a } = _("sidebar");
4229
- return /* @__PURE__ */ c(
4252
+ const { toggleSidebar: r } = rt(), { t: a } = k("sidebar");
4253
+ return /* @__PURE__ */ d(
4230
4254
  E,
4231
4255
  {
4232
4256
  "data-sidebar": "trigger",
@@ -4287,22 +4311,22 @@ function Zt({
4287
4311
  );
4288
4312
  }
4289
4313
  function Yl({ open: e, onOpenChange: t, onRemove: s }) {
4290
- const { t: r } = _(["sidebar", "errors"]), a = async () => {
4314
+ const { t: r } = k(["sidebar", "errors"]), a = async () => {
4291
4315
  t(!1);
4292
4316
  try {
4293
4317
  await s();
4294
4318
  } catch {
4295
- F.error(r("errors:thread_delete_failed"));
4319
+ B.error(r("errors:thread_delete_failed"));
4296
4320
  return;
4297
4321
  }
4298
- F.success(r("chat_deleted_success"));
4322
+ B.success(r("chat_deleted_success"));
4299
4323
  };
4300
- return /* @__PURE__ */ n(qe, { open: e, onOpenChange: t, children: /* @__PURE__ */ c(Mt, { children: [
4301
- /* @__PURE__ */ c(Kn, { children: [
4324
+ return /* @__PURE__ */ n(qe, { open: e, onOpenChange: t, children: /* @__PURE__ */ d(Mt, { children: [
4325
+ /* @__PURE__ */ d(Kn, { children: [
4302
4326
  /* @__PURE__ */ n(Xn, { children: r("delete_confirm_title") }),
4303
4327
  /* @__PURE__ */ n(Ta, { children: r("delete_confirm_description") })
4304
4328
  ] }),
4305
- /* @__PURE__ */ c(Ma, { children: [
4329
+ /* @__PURE__ */ d(Ma, { children: [
4306
4330
  /* @__PURE__ */ n(E, { variant: "outline", onClick: () => t(!1), children: r("cancel") }),
4307
4331
  /* @__PURE__ */ n(E, { variant: "destructive", onClick: () => {
4308
4332
  a();
@@ -4325,14 +4349,14 @@ function Qs({
4325
4349
  onShare: o,
4326
4350
  onUnshare: i,
4327
4351
  onRename: l,
4328
- onRemove: u,
4329
- triggerClassName: d
4352
+ onRemove: c,
4353
+ triggerClassName: u
4330
4354
  }) {
4331
- const { t: p } = _("sidebar"), { dir: m } = B(), [g, f] = C(!1), h = async (v, y, b, I) => {
4355
+ const { t: p } = k("sidebar"), { dir: m } = V(), [g, f] = C(!1), h = async (v, y, b, I) => {
4332
4356
  try {
4333
- await v(), F.success(y, I ? { description: I } : void 0);
4357
+ await v(), B.success(y, I ? { description: I } : void 0);
4334
4358
  } catch {
4335
- F.error(b);
4359
+ B.error(b);
4336
4360
  }
4337
4361
  }, N = [
4338
4362
  r.pin && {
@@ -4382,15 +4406,15 @@ function Qs({
4382
4406
  destructive: !0
4383
4407
  }
4384
4408
  ].filter((v) => !!v);
4385
- return N.length ? /* @__PURE__ */ c(L, { children: [
4386
- /* @__PURE__ */ c(Pt, { dir: m, children: [
4409
+ return N.length ? /* @__PURE__ */ d($, { children: [
4410
+ /* @__PURE__ */ d(Pt, { dir: m, children: [
4387
4411
  /* @__PURE__ */ n(Rt, { asChild: !0, children: /* @__PURE__ */ n(
4388
4412
  E,
4389
4413
  {
4390
4414
  variant: "ghost",
4391
4415
  size: "icon",
4392
4416
  "aria-label": p("thread_actions", { title: e ?? p("new_conversation") }),
4393
- className: d,
4417
+ className: u,
4394
4418
  children: /* @__PURE__ */ n(Wr, { "aria-hidden": !0, className: "size-4" })
4395
4419
  }
4396
4420
  ) }),
@@ -4399,10 +4423,10 @@ function Qs({
4399
4423
  {
4400
4424
  align: "end",
4401
4425
  className: "min-w-44 rounded-2xl border-border/60 bg-popover p-1.5 shadow-xl",
4402
- children: N.map(({ key: v, icon: y, label: b, onSelect: I, destructive: k }) => /* @__PURE__ */ c(
4426
+ children: N.map(({ key: v, icon: y, label: b, onSelect: I, destructive: _ }) => /* @__PURE__ */ d(
4403
4427
  we,
4404
4428
  {
4405
- variant: k ? "destructive" : "default",
4429
+ variant: _ ? "destructive" : "default",
4406
4430
  onSelect: I,
4407
4431
  className: Jl,
4408
4432
  children: [
@@ -4415,7 +4439,7 @@ function Qs({
4415
4439
  }
4416
4440
  )
4417
4441
  ] }),
4418
- r.delete && /* @__PURE__ */ n(Yl, { open: g, onOpenChange: f, onRemove: u })
4442
+ r.delete && /* @__PURE__ */ n(Yl, { open: g, onOpenChange: f, onRemove: c })
4419
4443
  ] }) : null;
4420
4444
  }
4421
4445
  function Zl() {
@@ -4437,12 +4461,12 @@ function Zl() {
4437
4461
  );
4438
4462
  }
4439
4463
  function ec() {
4440
- const { t: e } = _("sidebar"), t = Ct(), s = K((h) => h.history), r = t?.threadId ?? null, a = {
4464
+ const { t: e } = k("sidebar"), t = Ct(), s = Y((h) => h.history), r = t?.threadId ?? null, a = {
4441
4465
  pin: !!(s.enabled && s.showPin),
4442
4466
  share: !!(s.enabled && s.showShare),
4443
4467
  rename: !!(s.enabled && s.showRename),
4444
4468
  delete: !!(s.enabled && s.showDelete)
4445
- }, o = Object.values(a).some(Boolean), { threads: i, setPinned: l, share: u, unshare: d, rename: p, remove: m } = da({
4469
+ }, o = Object.values(a).some(Boolean), { threads: i, setPinned: l, share: c, unshare: u, rename: p, remove: m } = da({
4446
4470
  enabled: o
4447
4471
  });
4448
4472
  if (!r || !o) return null;
@@ -4450,9 +4474,9 @@ function ec() {
4450
4474
  const h = window.prompt(e("rename_label"), g?.title ?? "")?.trim();
4451
4475
  if (!(!h || h === g?.title))
4452
4476
  try {
4453
- await p(r, h), F.success(e("rename_success"));
4477
+ await p(r, h), B.success(e("rename_success"));
4454
4478
  } catch {
4455
- F.error(e("rename_failed"));
4479
+ B.error(e("rename_failed"));
4456
4480
  }
4457
4481
  };
4458
4482
  return /* @__PURE__ */ n(
@@ -4463,8 +4487,8 @@ function ec() {
4463
4487
  shared: !!g?.shared,
4464
4488
  offered: a,
4465
4489
  onPin: (h) => l(r, h),
4466
- onShare: () => u(r),
4467
- onUnshare: () => d(r),
4490
+ onShare: () => c(r),
4491
+ onUnshare: () => u(r),
4468
4492
  onRename: () => {
4469
4493
  f();
4470
4494
  },
@@ -4474,23 +4498,23 @@ function ec() {
4474
4498
  );
4475
4499
  }
4476
4500
  function bt({ iconOnly: e = !1 }) {
4477
- const t = W((o) => o.app), { resolvedTheme: s } = Ce(), r = t?.logo ? typeof t.logo == "string" ? t.logo : s === "dark" ? t.logo.dark : t.logo.light : Pa, a = t?.name || "Gentiq";
4478
- return /* @__PURE__ */ c("div", { className: x("flex items-center gap-2 select-none min-w-0", !e && "ps-1"), children: [
4501
+ const t = K((o) => o.app), { resolvedTheme: s } = Ce(), r = t?.logo ? typeof t.logo == "string" ? t.logo : s === "dark" ? t.logo.dark : t.logo.light : Pa, a = t?.name || "Gentiq";
4502
+ return /* @__PURE__ */ d("div", { className: x("flex items-center gap-2 select-none min-w-0", !e && "ps-1"), children: [
4479
4503
  /* @__PURE__ */ n("img", { src: r, alt: a, className: "size-6 shrink-0 object-contain" }),
4480
4504
  !e && /* @__PURE__ */ n("span", { className: "truncate text-base font-medium tracking-tight text-foreground", children: a })
4481
4505
  ] });
4482
4506
  }
4483
4507
  function Ks({ hideActions: e = !1 }) {
4484
- const t = Ct(), s = ze(), r = Vs(), { t: a } = _(["sidebar"]), o = W((v) => v.app), { history: i, headerActionsEnabled: l } = K((v) => v), { HeaderActions: u, headerActions: d, UsageMeter: p } = Q(), m = O(
4485
- () => (d ?? []).filter(
4508
+ const t = Ct(), s = ze(), r = Vs(), { t: a } = k(["sidebar"]), o = K((v) => v.app), { history: i, headerActionsEnabled: l } = Y((v) => v), { HeaderActions: c, headerActions: u, UsageMeter: p } = X(), m = O(
4509
+ () => (u ?? []).filter(
4486
4510
  (v) => l?.[v.id] ?? v.defaultEnabled ?? !0
4487
4511
  ),
4488
- [d, l]
4512
+ [u, l]
4489
4513
  ), g = Qt(), f = !e && (i?.enabled ?? !0), h = f && r !== null;
4490
- return /* @__PURE__ */ c("header", { className: "flex items-center justify-between px-3 md:px-5 h-14 sticky top-0 z-40 w-full bg-transparent", children: [
4491
- /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 min-w-9", children: (e || g || !h) && /* @__PURE__ */ c(L, { children: [
4514
+ return /* @__PURE__ */ d("header", { className: "flex items-center justify-between px-3 md:px-5 h-14 sticky top-0 z-40 w-full bg-transparent", children: [
4515
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 min-w-9", children: (e || g || !h) && /* @__PURE__ */ d($, { children: [
4492
4516
  h && /* @__PURE__ */ n(Gs, { className: "hover:bg-accent/60 transition-colors rounded-full size-9 text-muted-foreground hover:text-foreground" }),
4493
- !e && /* @__PURE__ */ c(Ye, { children: [
4517
+ !e && /* @__PURE__ */ d(Ye, { children: [
4494
4518
  /* @__PURE__ */ n(Je, { asChild: !0, children: /* @__PURE__ */ n(
4495
4519
  "button",
4496
4520
  {
@@ -4507,8 +4531,8 @@ function Ks({ hideActions: e = !1 }) {
4507
4531
  ] }),
4508
4532
  !h && /* @__PURE__ */ n(bt, {})
4509
4533
  ] }) }),
4510
- /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 min-w-9 justify-end", children: !e && /* @__PURE__ */ c(L, { children: [
4511
- u && /* @__PURE__ */ n(u, { isMobile: g }),
4534
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 min-w-9 justify-end", children: !e && /* @__PURE__ */ d($, { children: [
4535
+ c && /* @__PURE__ */ n(c, { isMobile: g }),
4512
4536
  m.map(({ id: v, component: y }) => /* @__PURE__ */ n(y, { isMobile: g }, v)),
4513
4537
  o?.showUsageBar && /* @__PURE__ */ n(p, { details: o.showUsageDetails ?? !0, isMobile: g }),
4514
4538
  f && /* @__PURE__ */ n(ec, {}),
@@ -4517,12 +4541,12 @@ function Ks({ hideActions: e = !1 }) {
4517
4541
  ] });
4518
4542
  }
4519
4543
  function tc(e) {
4520
- return /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(nc, { ...e }) });
4544
+ return /* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(nc, { ...e }) });
4521
4545
  }
4522
4546
  function nc({ shareId: e }) {
4523
4547
  const [t, s] = C(
4524
4548
  null
4525
- ), [r, a] = C(!0), [o, i] = C(null), { t: l } = _(["chat", "errors"]), { MessageList: u } = Q(), d = Xe(), p = j(/* @__PURE__ */ new Set());
4549
+ ), [r, a] = C(!0), [o, i] = C(null), { t: l } = k(["chat", "errors"]), { MessageList: c } = X(), u = Xe(), p = U(/* @__PURE__ */ new Set());
4526
4550
  return D(() => {
4527
4551
  if (!e) return;
4528
4552
  let m = !1;
@@ -4530,11 +4554,11 @@ function nc({ shareId: e }) {
4530
4554
  return (async () => {
4531
4555
  try {
4532
4556
  a(!0);
4533
- const f = await d.getSharedThread(e), h = await ja(
4557
+ const f = await u.getSharedThread(e), h = await ja(
4534
4558
  Fa(f.items),
4535
4559
  async (N) => {
4536
4560
  try {
4537
- const v = await d.getPublicAttachmentBlobUrl(e, N);
4561
+ const v = await u.getPublicAttachmentBlobUrl(e, N);
4538
4562
  return g.add(v), v;
4539
4563
  } catch {
4540
4564
  return "";
@@ -4550,16 +4574,16 @@ function nc({ shareId: e }) {
4550
4574
  })(), () => {
4551
4575
  m = !0, g.forEach((f) => URL.revokeObjectURL(f)), g.clear();
4552
4576
  };
4553
- }, [e, d]), r ? /* @__PURE__ */ n("div", { className: "flex h-dvh items-center justify-center bg-background", children: /* @__PURE__ */ n(Ue, {}) }) : t ? /* @__PURE__ */ c("div", { className: "relative flex flex-col h-dvh overflow-hidden bg-background", children: [
4577
+ }, [e, u]), r ? /* @__PURE__ */ n("div", { className: "flex h-dvh items-center justify-center bg-background", children: /* @__PURE__ */ n(Ue, {}) }) : t ? /* @__PURE__ */ d("div", { className: "relative flex flex-col h-dvh overflow-hidden bg-background", children: [
4554
4578
  /* @__PURE__ */ n(Ks, { hideActions: !0 }),
4555
- /* @__PURE__ */ n("div", { className: "flex-1 min-h-0 overflow-hidden relative flex flex-col", children: /* @__PURE__ */ n(Ae.Root, { readonly: !0, children: /* @__PURE__ */ n(De.Root, { messages: t.messages, className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ n(u, { className: "pb-8" }) }) }) })
4556
- ] }) : /* @__PURE__ */ c("div", { className: "flex h-dvh flex-col items-center justify-center p-4 text-center bg-background", children: [
4579
+ /* @__PURE__ */ n("div", { className: "flex-1 min-h-0 overflow-hidden relative flex flex-col", children: /* @__PURE__ */ n(Ae.Root, { readonly: !0, children: /* @__PURE__ */ n(De.Root, { messages: t.messages, className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ n(c, { className: "pb-8" }) }) }) })
4580
+ ] }) : /* @__PURE__ */ d("div", { className: "flex h-dvh flex-col items-center justify-center p-4 text-center bg-background", children: [
4557
4581
  /* @__PURE__ */ n("h1", { className: "text-2xl font-bold text-destructive mb-2 font-display", children: l("shared_not_found_title") }),
4558
4582
  /* @__PURE__ */ n("p", { className: "text-muted-foreground max-w-md", children: qt(o) ? fe(o, l) : l("shared_not_found_description") })
4559
4583
  ] });
4560
4584
  }
4561
4585
  function sc() {
4562
- const { t: e } = _("sidebar"), { state: t, isMobile: s, setOpenMobile: r } = rt(), a = ze(), o = !s && t === "collapsed";
4586
+ const { t: e } = k("sidebar"), { state: t, isMobile: s, setOpenMobile: r } = rt(), a = ze(), o = !s && t === "collapsed";
4563
4587
  return /* @__PURE__ */ n(gt, { className: o ? "mt-1 flex items-center" : "mt-1 mb-4 px-2", children: /* @__PURE__ */ n(Jt, { children: /* @__PURE__ */ n(
4564
4588
  Zt,
4565
4589
  {
@@ -4568,7 +4592,7 @@ function sc() {
4568
4592
  "rounded-full transition-colors duration-200 group/new-chat",
4569
4593
  o ? "size-9 justify-center p-0 bg-sidebar-accent/60 text-sidebar-foreground hover:bg-sidebar-accent" : "h-10 bg-transparent text-sidebar-foreground/85 hover:bg-sidebar-accent/70 hover:text-sidebar-foreground active:bg-sidebar-accent aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-semibold aria-[current=page]:text-sidebar-accent-foreground"
4570
4594
  ),
4571
- children: /* @__PURE__ */ c(
4595
+ children: /* @__PURE__ */ d(
4572
4596
  se.New,
4573
4597
  {
4574
4598
  "aria-label": o ? e("new_conversation") : void 0,
@@ -4592,8 +4616,8 @@ function sc() {
4592
4616
  ) }) });
4593
4617
  }
4594
4618
  function rc() {
4595
- const { t: e } = _("sidebar");
4596
- return /* @__PURE__ */ n(se.LoadMore, { className: "group/more min-h-4 w-full", children: /* @__PURE__ */ c(
4619
+ const { t: e } = k("sidebar");
4620
+ return /* @__PURE__ */ n(se.LoadMore, { className: "group/more min-h-4 w-full", children: /* @__PURE__ */ d(
4597
4621
  "div",
4598
4622
  {
4599
4623
  role: "status",
@@ -4612,12 +4636,12 @@ function rc() {
4612
4636
  ) });
4613
4637
  }
4614
4638
  function ac() {
4615
- const { t: e } = _("sidebar");
4616
- return /* @__PURE__ */ c(
4639
+ const { t: e } = k("sidebar");
4640
+ return /* @__PURE__ */ d(
4617
4641
  $e.Root,
4618
4642
  {
4619
- onRenamed: () => F.success(e("rename_success")),
4620
- onRenameFailed: () => F.error(e("rename_failed")),
4643
+ onRenamed: () => B.success(e("rename_success")),
4644
+ onRenameFailed: () => B.error(e("rename_failed")),
4621
4645
  className: "flex items-center gap-1 px-2 py-1.5 w-full",
4622
4646
  children: [
4623
4647
  /* @__PURE__ */ n(
@@ -4654,14 +4678,14 @@ function ac() {
4654
4678
  );
4655
4679
  }
4656
4680
  function oc() {
4657
- const { t: e } = _("sidebar"), { isMobile: t, setOpenMobile: s } = rt(), { thread: r, isRenaming: a } = Wn(), o = ze();
4658
- return /* @__PURE__ */ n(se.Item, { asChild: !0, children: /* @__PURE__ */ n(Jt, { className: "group/sidebar-menu-item relative", children: a ? /* @__PURE__ */ n(ac, {}) : /* @__PURE__ */ c(L, { children: [
4681
+ const { t: e } = k("sidebar"), { isMobile: t, setOpenMobile: s } = rt(), { thread: r, isRenaming: a } = Wn(), o = ze();
4682
+ return /* @__PURE__ */ n(se.Item, { asChild: !0, children: /* @__PURE__ */ n(Jt, { className: "group/sidebar-menu-item relative", children: a ? /* @__PURE__ */ n(ac, {}) : /* @__PURE__ */ d($, { children: [
4659
4683
  /* @__PURE__ */ n(
4660
4684
  Zt,
4661
4685
  {
4662
4686
  asChild: !0,
4663
4687
  className: "h-auto rounded-full py-2 px-3.5 text-sidebar-foreground/80 hover:bg-sidebar-accent/60 hover:text-sidebar-foreground aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-semibold aria-[current=page]:text-sidebar-accent-foreground aria-busy:thread-streaming transition-colors",
4664
- children: /* @__PURE__ */ c(
4688
+ children: /* @__PURE__ */ d(
4665
4689
  se.ItemTrigger,
4666
4690
  {
4667
4691
  onOpen: () => {
@@ -4682,8 +4706,8 @@ function oc() {
4682
4706
  )
4683
4707
  }
4684
4708
  ),
4685
- /* @__PURE__ */ c("div", { className: "absolute top-1/2 -translate-y-1/2 end-1.5 flex items-center gap-1 z-10", children: [
4686
- r.pinned && /* @__PURE__ */ c("span", { className: "md:absolute md:inset-0 md:m-auto md:size-3.5 md:group-hover/sidebar-menu-item:opacity-0 md:group-focus-within/sidebar-menu-item:opacity-0 transition-opacity pointer-events-none", children: [
4709
+ /* @__PURE__ */ d("div", { className: "absolute top-1/2 -translate-y-1/2 end-1.5 flex items-center gap-1 z-10", children: [
4710
+ r.pinned && /* @__PURE__ */ d("span", { className: "md:absolute md:inset-0 md:m-auto md:size-3.5 md:group-hover/sidebar-menu-item:opacity-0 md:group-focus-within/sidebar-menu-item:opacity-0 transition-opacity pointer-events-none", children: [
4687
4711
  /* @__PURE__ */ n(Dn, { "aria-hidden": !0, className: "size-3.5 text-primary opacity-70" }),
4688
4712
  /* @__PURE__ */ n("span", { className: "sr-only", children: e("pinned") })
4689
4713
  ] }),
@@ -4692,8 +4716,8 @@ function oc() {
4692
4716
  ] }) }) });
4693
4717
  }
4694
4718
  function ic({ autoFocus: e, onClose: t } = {}) {
4695
- const { t: s } = _(["sidebar", "common"]);
4696
- return /* @__PURE__ */ c("div", { className: "relative group/search", children: [
4719
+ const { t: s } = k(["sidebar", "common"]);
4720
+ return /* @__PURE__ */ d("div", { className: "relative group/search", children: [
4697
4721
  /* @__PURE__ */ n(
4698
4722
  En,
4699
4723
  {
@@ -4727,9 +4751,9 @@ function ic({ autoFocus: e, onClose: t } = {}) {
4727
4751
  }
4728
4752
  const _n = "rounded-full text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors";
4729
4753
  function lc({ side: e = "start" }) {
4730
- const { t } = _(["sidebar", "settings"]), s = K((y) => y.history), r = ze(), a = Vs(), { groups: o } = Xt(), [i, l] = C(!1), { showPin: u, showShare: d, showRename: p, showDelete: m } = s, g = O(
4731
- () => ({ pin: u, share: d, rename: p, delete: m }),
4732
- [u, d, p, m]
4754
+ const { t } = k(["sidebar", "settings"]), s = Y((y) => y.history), r = ze(), a = Vs(), { groups: o } = Xt(), [i, l] = C(!1), { showPin: c, showShare: u, showRename: p, showDelete: m } = s, g = O(
4755
+ () => ({ pin: c, share: u, rename: p, delete: m }),
4756
+ [c, u, p, m]
4733
4757
  ), f = r?.activeSection != null, h = !a?.isMobile && a?.state === "collapsed", N = () => a?.isMobile && a.setOpenMobile(!1), v = !f && s.enabled && /* @__PURE__ */ n(
4734
4758
  E,
4735
4759
  {
@@ -4755,8 +4779,8 @@ function lc({ side: e = "start" }) {
4755
4779
  collapsible: "icon",
4756
4780
  side: e,
4757
4781
  className: "bg-sidebar text-sidebar-foreground border-none select-none",
4758
- children: /* @__PURE__ */ c(se.Root, { enabled: s.enabled, className: "flex flex-1 min-h-0 flex-col", children: [
4759
- /* @__PURE__ */ c(
4782
+ children: /* @__PURE__ */ d(se.Root, { enabled: s.enabled, className: "flex flex-1 min-h-0 flex-col", children: [
4783
+ /* @__PURE__ */ d(
4760
4784
  Ql,
4761
4785
  {
4762
4786
  className: x("pt-3 pb-1 gap-2.5", h ? "px-2 items-center" : "px-3"),
@@ -4772,14 +4796,14 @@ function lc({ side: e = "start" }) {
4772
4796
  className: "size-9 rounded-full hover:bg-sidebar-accent",
4773
4797
  children: /* @__PURE__ */ n(bt, { iconOnly: !0 })
4774
4798
  }
4775
- ) : /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2 px-1", children: [
4799
+ ) : /* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-2 px-1", children: [
4776
4800
  /* @__PURE__ */ n(bt, {}),
4777
- /* @__PURE__ */ c("div", { className: "flex items-center gap-0.5 shrink-0", children: [
4801
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-0.5 shrink-0", children: [
4778
4802
  v,
4779
4803
  /* @__PURE__ */ n(Gs, { className: x("size-8", _n) })
4780
4804
  ] })
4781
4805
  ] }),
4782
- f ? /* @__PURE__ */ c(
4806
+ f ? /* @__PURE__ */ d(
4783
4807
  E,
4784
4808
  {
4785
4809
  type: "button",
@@ -4798,7 +4822,7 @@ function lc({ side: e = "start" }) {
4798
4822
  !h && /* @__PURE__ */ n("span", { className: "truncate", children: t("settings:back_to_chat") })
4799
4823
  ]
4800
4824
  }
4801
- ) : /* @__PURE__ */ c(L, { children: [
4825
+ ) : /* @__PURE__ */ d($, { children: [
4802
4826
  /* @__PURE__ */ n(sc, {}),
4803
4827
  h && v,
4804
4828
  !h && s.enabled && i && /* @__PURE__ */ n(ic, { autoFocus: !0, onClose: () => l(!1) })
@@ -4810,9 +4834,9 @@ function lc({ side: e = "start" }) {
4810
4834
  Xl,
4811
4835
  {
4812
4836
  className: x("py-2 custom-scrollbar", h ? "px-2 items-center" : "px-3"),
4813
- children: f ? o.map((y) => /* @__PURE__ */ c("div", { className: "mb-3 last:mb-0", children: [
4837
+ children: f ? o.map((y) => /* @__PURE__ */ d("div", { className: "mb-3 last:mb-0", children: [
4814
4838
  !h && /* @__PURE__ */ n("div", { className: "px-3 pb-1 pt-2 text-xs font-medium text-muted-foreground", children: y.title }),
4815
- /* @__PURE__ */ n(gt, { className: x("gap-0.5", h && "items-center"), children: y.items.map((b) => /* @__PURE__ */ n(Jt, { children: /* @__PURE__ */ c(
4839
+ /* @__PURE__ */ n(gt, { className: x("gap-0.5", h && "items-center"), children: y.items.map((b) => /* @__PURE__ */ n(Jt, { children: /* @__PURE__ */ d(
4816
4840
  Zt,
4817
4841
  {
4818
4842
  type: "button",
@@ -4832,7 +4856,7 @@ function lc({ side: e = "start" }) {
4832
4856
  ]
4833
4857
  }
4834
4858
  ) }, b.id)) })
4835
- ] }, y.title)) : !h && s.enabled && /* @__PURE__ */ c(Ws.Provider, { value: g, children: [
4859
+ ] }, y.title)) : !h && s.enabled && /* @__PURE__ */ d(Ws.Provider, { value: g, children: [
4836
4860
  /* @__PURE__ */ n(gt, { className: "gap-0.5", children: /* @__PURE__ */ n(se.Items, { component: oc }) }),
4837
4861
  /* @__PURE__ */ n(se.Empty, { className: "px-4 py-8 text-center text-sm text-muted-foreground", children: t("no_conversations") }),
4838
4862
  /* @__PURE__ */ n(rc, {})
@@ -4845,8 +4869,8 @@ function lc({ side: e = "start" }) {
4845
4869
  );
4846
4870
  }
4847
4871
  function cc({ collapsed: e }) {
4848
- const t = W((i) => i.app), { displayName: s, initial: r, planLabel: a } = qs(), o = t?.showSettings !== !1;
4849
- return (!s || e) && !o ? null : /* @__PURE__ */ c(
4872
+ const t = K((i) => i.app), { displayName: s, initial: r, planLabel: a } = qs(), o = t?.showSettings !== !1;
4873
+ return (!s || e) && !o ? null : /* @__PURE__ */ d(
4850
4874
  "div",
4851
4875
  {
4852
4876
  className: x(
@@ -4872,7 +4896,7 @@ function uc({
4872
4896
  header: o,
4873
4897
  classNames: i
4874
4898
  }) {
4875
- const l = K((v) => v.history.enabled), { MaintenanceBanner: u, MaintenanceScreen: d } = Q(), [p, m] = C(null), g = j(null), f = O(
4899
+ const l = Y((v) => v.history.enabled), { MaintenanceBanner: c, MaintenanceScreen: u } = X(), [p, m] = C(null), g = U(null), f = O(
4876
4900
  () => ({
4877
4901
  activeSection: p,
4878
4902
  openSection: m,
@@ -4888,18 +4912,18 @@ function uc({
4888
4912
  blocksChat: h.blocksChat,
4889
4913
  refresh: h.refresh
4890
4914
  } : null;
4891
- return N && h.display === "fullscreen" && d ? /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(d, { ...N }) }) : /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
4915
+ return N && h.display === "fullscreen" && u ? /* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(u, { ...N }) }) : /* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(
4892
4916
  Vn,
4893
4917
  {
4894
4918
  threadId: e,
4895
4919
  onThreadChange: t,
4896
4920
  getThreadHref: s,
4897
4921
  getShareHref: r,
4898
- children: /* @__PURE__ */ n(Ls.Provider, { value: f, children: /* @__PURE__ */ c(Gl, { defaultOpen: l, className: "bg-background", children: [
4922
+ children: /* @__PURE__ */ n(Ls.Provider, { value: f, children: /* @__PURE__ */ d(Gl, { defaultOpen: l, className: "bg-background", children: [
4899
4923
  a !== void 0 ? a : l || p !== null ? /* @__PURE__ */ n(lc, {}) : null,
4900
- /* @__PURE__ */ c("div", { className: "flex flex-col flex-1 h-dvh overflow-hidden relative bg-background", children: [
4924
+ /* @__PURE__ */ d("div", { className: "flex flex-col flex-1 h-dvh overflow-hidden relative bg-background", children: [
4901
4925
  o !== void 0 ? o : /* @__PURE__ */ n(Ks, {}),
4902
- N && u && /* @__PURE__ */ n(u, { ...N }),
4926
+ N && c && /* @__PURE__ */ n(c, { ...N }),
4903
4927
  /* @__PURE__ */ n("div", { className: "flex flex-col relative w-full flex-1 min-h-0 overflow-hidden", children: p !== null ? /* @__PURE__ */ n(Bl, {}) : /* @__PURE__ */ n(Tl, { classNames: i }) })
4904
4928
  ] })
4905
4929
  ] }) })
@@ -4976,14 +5000,14 @@ function qc({
4976
5000
  components: o,
4977
5001
  history: i,
4978
5002
  welcome: l,
4979
- threadActions: u,
4980
- composer: d,
5003
+ threadActions: c,
5004
+ composer: u,
4981
5005
  disclaimer: p,
4982
5006
  settings: m,
4983
5007
  ...g
4984
5008
  }) {
4985
5009
  const f = fc();
4986
- return f ? /* @__PURE__ */ c(Ol, { ...g, api: { ...t, basePath: e }, children: [
5010
+ return f ? /* @__PURE__ */ d(Ol, { ...g, api: { ...t, basePath: e }, children: [
4987
5011
  /* @__PURE__ */ n(El, {}),
4988
5012
  /* @__PURE__ */ n(
4989
5013
  Kt,
@@ -4991,8 +5015,8 @@ function qc({
4991
5015
  components: o,
4992
5016
  history: i,
4993
5017
  welcome: l,
4994
- threadActions: u,
4995
- composer: d,
5018
+ threadActions: c,
5019
+ composer: u,
4996
5020
  disclaimer: p,
4997
5021
  settings: m,
4998
5022
  children: /* @__PURE__ */ n(vc, { location: f, paths: bc(s, r), admin: a })
@@ -5004,8 +5028,8 @@ function vc({ location: e, paths: t, admin: s }) {
5004
5028
  const r = xc(e.pathname, t), a = ct(null, t);
5005
5029
  if (r.name === "admin" && s) return /* @__PURE__ */ n(Ve, { fallback: null, children: s });
5006
5030
  if (r.name === "login") {
5007
- const { reason: d, from: p } = Nc(e.state);
5008
- return /* @__PURE__ */ n(Hl, { reason: d, onSignedIn: () => He(p ?? a, { replace: !0 }) });
5031
+ const { reason: u, from: p } = Nc(e.state);
5032
+ return /* @__PURE__ */ n(Hl, { reason: u, onSignedIn: () => He(p ?? a, { replace: !0 }) });
5009
5033
  }
5010
5034
  if (r.name === "shared") return /* @__PURE__ */ n(tc, { shareId: r.shareId });
5011
5035
  const o = r.name === "chat" ? r.threadId : null, i = new URLSearchParams(e.search), l = i.get("code");
@@ -5015,17 +5039,17 @@ function vc({ location: e, paths: t, admin: s }) {
5015
5039
  loginCode: l,
5016
5040
  onLoginCodeUsed: () => {
5017
5041
  i.delete("code");
5018
- const d = i.toString();
5019
- He(e.pathname + (d ? `?${d}` : "") + e.hash, { replace: !0 });
5042
+ const u = i.toString();
5043
+ He(e.pathname + (u ? `?${u}` : "") + e.hash, { replace: !0 });
5020
5044
  },
5021
- fallback: (d) => /* @__PURE__ */ n(kc, { to: t.login, reason: d, from: e.pathname + e.search }),
5045
+ fallback: (u) => /* @__PURE__ */ n(kc, { to: t.login, reason: u, from: e.pathname + e.search }),
5022
5046
  children: /* @__PURE__ */ n(
5023
5047
  dc,
5024
5048
  {
5025
5049
  threadId: o,
5026
- onThreadChange: (d) => He(ct(d, t)),
5027
- getThreadHref: (d) => ct(d, t),
5028
- getShareHref: (d) => `${t.shared}/${encodeURIComponent(d)}`
5050
+ onThreadChange: (u) => He(ct(u, t)),
5051
+ getThreadHref: (u) => ct(u, t),
5052
+ getShareHref: (u) => `${t.shared}/${encodeURIComponent(u)}`
5029
5053
  }
5030
5054
  )
5031
5055
  }
@@ -5055,7 +5079,7 @@ function kc({ to: e, reason: t, from: s }) {
5055
5079
  }
5056
5080
  export {
5057
5081
  lc as A,
5058
- K as B,
5082
+ Y as B,
5059
5083
  Tl as C,
5060
5084
  El as D,
5061
5085
  fs as E,
@@ -5079,7 +5103,7 @@ export {
5079
5103
  $l as g,
5080
5104
  ul as h,
5081
5105
  Ol as i,
5082
- de as j,
5106
+ ue as j,
5083
5107
  Kt as k,
5084
5108
  xl as l,
5085
5109
  Di as m,