teodor-new-chat-ui 4.3.69 → 4.3.70

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.
package/dist/index.esm.js CHANGED
@@ -2,7 +2,7 @@ var Pm = Object.defineProperty;
2
2
  var Om = (e, t, n) => t in e ? Pm(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var jl = (e, t, n) => Om(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as g from "react";
5
- import U, { createContext as ko, useContext as js, useReducer as Mm, useRef as De, useCallback as Se, useEffect as at, useMemo as lt, useState as xe, startTransition as Lo, createElement as Jo, useLayoutEffect as Dm } from "react";
5
+ import U, { createContext as ko, useContext as js, useReducer as Mm, useRef as De, useCallback as Se, useEffect as st, useMemo as lt, useState as xe, startTransition as Lo, createElement as Jo, useLayoutEffect as Dm } from "react";
6
6
  import { Square as Lm, Send as Fm, X as Or, ExternalLink as $m, Download as zm, Image as Bm, FileText as Pl, Loader as Aa, Bot as Ol, Wrench as Hm, User as Um, Paperclip as Ki, ChevronUp as Na, ChevronDown as Ps, Copy as Ml, Edit as Dl, RotateCcw as qi, ChevronRight as Wm, Check as _a, Circle as Vm, Loader2 as Gi, Edit3 as bu, Plus as Km, FileSpreadsheet as qm, MessageSquarePlus as Gm, MessageSquare as Ym, Calendar as Xm, Trash2 as Jm, Settings as Zm, Server as Qm, EyeOff as eg, Eye as tg, Layout as ng, MessageCircle as rg, Save as og } from "lucide-react";
7
7
  import { Slot as sg, createSlot as $r } from "@radix-ui/react-slot";
8
8
  import { cva as Os } from "class-variance-authority";
@@ -451,7 +451,7 @@ function cg() {
451
451
  value: Ke
452
452
  }), Object.freeze && (Object.freeze(L.props), Object.freeze(L)), L;
453
453
  };
454
- function qn(R, H, ce, ke, Ke) {
454
+ function Gn(R, H, ce, ke, Ke) {
455
455
  {
456
456
  var ze, Fe = {}, L = null, de = null;
457
457
  ce !== void 0 && (we(ce), L = "" + ce), je(H) && (we(H.key), L = "" + H.key), mt(H) && (de = H.ref, Tt(H, Ke));
@@ -591,7 +591,7 @@ Check the top-level render call using <` + ce + ">.");
591
591
  var he;
592
592
  R === null ? he = "null" : Ve(R) ? he = "array" : R !== void 0 && R.$$typeof === t ? (he = "<" + (M(R.type) || "Unknown") + " />", L = " Did you accidentally export a JSX literal instead of a component?") : he = typeof R, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", he, L);
593
593
  }
594
- var Re = qn(R, H, ce, Ke, ze);
594
+ var Re = Gn(R, H, ce, Ke, ze);
595
595
  if (Re == null)
596
596
  return Re;
597
597
  if (Fe) {
@@ -630,8 +630,8 @@ React keys must be passed directly to JSX without using spread:
630
630
  function Ar(R, H, ce) {
631
631
  return Hn(R, H, ce, !1);
632
632
  }
633
- var Nr = Ar, Gn = ur;
634
- to.Fragment = r, to.jsx = Nr, to.jsxs = Gn;
633
+ var Nr = Ar, Yn = ur;
634
+ to.Fragment = r, to.jsx = Nr, to.jsxs = Yn;
635
635
  }()), to;
636
636
  }
637
637
  process.env.NODE_ENV === "production" ? Yi.exports = lg() : Yi.exports = cg();
@@ -2508,9 +2508,9 @@ class Hx {
2508
2508
  return mn(n);
2509
2509
  }
2510
2510
  }
2511
- const Jn = new Hx(), qu = ko(null);
2511
+ const Vn = new Hx(), qu = ko(null);
2512
2512
  function Ux({ children: e, apiConfig: t }) {
2513
- const n = Jn;
2513
+ const n = Vn;
2514
2514
  if (t) {
2515
2515
  const o = n.baseUrl, s = n.getAuthToken();
2516
2516
  t.baseUrl && t.baseUrl !== o && n.updateConfig({
@@ -3024,7 +3024,7 @@ function dy(e = []) {
3024
3024
  }, [i]), l = Se((d) => {
3025
3025
  r.current.push(d), a();
3026
3026
  }, [a]);
3027
- at(() => () => {
3027
+ st(() => () => {
3028
3028
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), r.current = [];
3029
3029
  }, []);
3030
3030
  const c = lt(() => ({
@@ -3305,7 +3305,11 @@ function xy(e) {
3305
3305
  function yy(e = {}) {
3306
3306
  const t = lt(() => Wn(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream";
3307
3307
  n.endsWith("/stream") && n.replace(/\/stream$/, "/cancel");
3308
- const [r, o] = xe(e.token ?? null), s = De(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = xe(!1), [c, d] = xe(null), [f, h] = xe(""), [p, m] = xe(null), [y, v] = xe(0), [x, w] = xe(!1), b = De(null), T = De(!0), C = De(0), S = De(null), k = Se((F) => {
3308
+ const [r, o] = xe(e.token ?? null);
3309
+ st(() => {
3310
+ Vn.updateConfig({ baseUrl: t, authToken: r });
3311
+ }, [t, r]);
3312
+ const s = De(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = xe(!1), [c, d] = xe(null), [f, h] = xe(""), [p, m] = xe(null), [y, v] = xe(0), [x, w] = xe(!1), b = De(null), T = De(!0), C = De(0), S = De(null), k = Se((F) => {
3309
3313
  o(F);
3310
3314
  }, []), N = Se(() => {
3311
3315
  h(""), m(null), d(null);
@@ -3317,7 +3321,7 @@ function yy(e = {}) {
3317
3321
  }
3318
3322
  try {
3319
3323
  console.debug("[use-chat] cancelActiveRun -> sending cancel request for thread", F.threadId);
3320
- const M = await Jn.cancelRun(F.threadId);
3324
+ const M = await Vn.cancelRun(F.threadId);
3321
3325
  console.debug("[use-chat] cancelActiveRun: response", M), console.debug("[use-chat] cancel request succeeded");
3322
3326
  } catch (M) {
3323
3327
  console.warn("[use-chat] cancel request failed:", M);
@@ -3512,7 +3516,7 @@ function yy(e = {}) {
3512
3516
  },
3513
3517
  [t, n, r, e.autoAppendAssistant]
3514
3518
  );
3515
- return at(() => () => {
3519
+ return st(() => () => {
3516
3520
  var F;
3517
3521
  T.current = !1, (F = b.current) == null || F.abort();
3518
3522
  }, []), {
@@ -3921,7 +3925,7 @@ function zy({
3921
3925
  onEvent: ht,
3922
3926
  reset: Ze
3923
3927
  } = dy(), Le = De(S);
3924
- at(() => {
3928
+ st(() => {
3925
3929
  Le.current = S;
3926
3930
  }, [S]);
3927
3931
  const Nt = De(!1), Ve = De([]), ot = De(null), oe = De(null), ve = De(/* @__PURE__ */ new Map()), we = De(S), Ye = De(!1), pt = De(null), bt = De(/* @__PURE__ */ new Map()), Ct = De(/* @__PURE__ */ new Map()), mt = De(/* @__PURE__ */ new Map()), je = De(/* @__PURE__ */ new Map()), Tt = Se(
@@ -3941,7 +3945,7 @@ function zy({
3941
3945
  },
3942
3946
  []
3943
3947
  );
3944
- at(() => {
3948
+ st(() => {
3945
3949
  Tt(S);
3946
3950
  }, [S, Tt]);
3947
3951
  const Bt = Se(() => {
@@ -3992,7 +3996,7 @@ function zy({
3992
3996
  Ct.current.set(E, le);
3993
3997
  },
3994
3998
  []
3995
- ), qn = Se(
3999
+ ), Gn = Se(
3996
4000
  (E, A) => {
3997
4001
  const { threadId: Y, checkpointId: te = null, checkpointNs: le = null } = E, Z = hc(Y, te, le);
3998
4002
  if (A != null && A.force)
@@ -4035,9 +4039,9 @@ function zy({
4035
4039
  te(Z);
4036
4040
  });
4037
4041
  }), []), dn = De(C.length), tn = De(!1);
4038
- at(() => {
4042
+ st(() => {
4039
4043
  dn.current = C.length;
4040
- }, [C.length]), at(() => {
4044
+ }, [C.length]), st(() => {
4041
4045
  const E = re.pendingInterrupt ?? ky(re.messages);
4042
4046
  uc(W, E) || ne(E ?? null);
4043
4047
  }, [W, re.messages, re.pendingInterrupt]);
@@ -4213,7 +4217,7 @@ function zy({
4213
4217
  });
4214
4218
  },
4215
4219
  [re.messages.length]
4216
- ), { startStream: Ar, stop: Nr, isStreaming: Gn, error: R, setAuthToken: H } = by({
4220
+ ), { startStream: Ar, stop: Nr, isStreaming: Yn, error: R, setAuthToken: H } = by({
4217
4221
  baseUrl: d,
4218
4222
  onThreadInfo: ur,
4219
4223
  onMessageEvent: ht,
@@ -4222,9 +4226,9 @@ function zy({
4222
4226
  },
4223
4227
  onSequenceGap: Hn
4224
4228
  });
4225
- at(() => {
4226
- Cn.current = Gn;
4227
- }, [Gn]), at(() => {
4229
+ st(() => {
4230
+ Cn.current = Yn;
4231
+ }, [Yn]), st(() => {
4228
4232
  if (!xr()) return;
4229
4233
  gt.current !== null && (window.clearTimeout(gt.current), gt.current = null);
4230
4234
  const E = C.map((Y) => `${Y.threadId}:${Y.updatedAt ?? ""}:${Y.messageCount ?? ""}`).join("|");
@@ -4252,7 +4256,7 @@ function zy({
4252
4256
  }, ts), () => {
4253
4257
  gt.current !== null && (window.clearTimeout(gt.current), gt.current = null);
4254
4258
  };
4255
- }, [C, Tn]), at(() => {
4259
+ }, [C, Tn]), st(() => {
4256
4260
  var te;
4257
4261
  const E = l.getAuthToken();
4258
4262
  H(E);
@@ -4367,7 +4371,7 @@ function zy({
4367
4371
  const _t = te || !yt || !!A || !!Y, Rn = async (jt) => {
4368
4372
  jt && $(!0), ot.current = E;
4369
4373
  try {
4370
- const Pt = await qn(
4374
+ const Pt = await Gn(
4371
4375
  { threadId: E, checkpointId: A, checkpointNs: Y },
4372
4376
  { force: te }
4373
4377
  ), { latest: Jr, checkpoints: Zr, snapshots: En } = na(Pt);
@@ -4387,7 +4391,7 @@ function zy({
4387
4391
  cr,
4388
4392
  Yt,
4389
4393
  Gt,
4390
- qn,
4394
+ Gn,
4391
4395
  i,
4392
4396
  ct,
4393
4397
  Et
@@ -4428,7 +4432,7 @@ function zy({
4428
4432
  if (E) {
4429
4433
  ie(!0);
4430
4434
  try {
4431
- const A = Le.current, Y = await qn({
4435
+ const A = Le.current, Y = await Gn({
4432
4436
  threadId: A,
4433
4437
  checkpointId: E ?? q ?? null,
4434
4438
  checkpointNs: fe ?? X ?? null
@@ -4453,7 +4457,7 @@ function zy({
4453
4457
  },
4454
4458
  [
4455
4459
  Yt,
4456
- qn,
4460
+ Gn,
4457
4461
  Q,
4458
4462
  q,
4459
4463
  X,
@@ -4569,14 +4573,14 @@ function zy({
4569
4573
  },
4570
4574
  [We, re.lastCheckpointId, re.lastCheckpointNs, nt]
4571
4575
  );
4572
- at(() => {
4576
+ st(() => {
4573
4577
  if (a == null || a(S), S)
4574
4578
  try {
4575
4579
  localStorage.setItem("lastThreadId", S);
4576
4580
  } catch (E) {
4577
4581
  console.warn("[ChatSessionProvider] Failed to persist lastThreadId:", E);
4578
4582
  }
4579
- }, [S, a]), at(() => ((async () => {
4583
+ }, [S, a]), st(() => ((async () => {
4580
4584
  try {
4581
4585
  if (Mt().catch((A) => {
4582
4586
  console.error("[ChatSessionProvider] Failed to refresh threads (background):", A), i == null || i(String(A));
@@ -4592,7 +4596,7 @@ function zy({
4592
4596
  console.error("[ChatSessionProvider] Initialization failed:", A), i == null || i(String(A));
4593
4597
  }
4594
4598
  })(), () => {
4595
- }), []), at(() => {
4599
+ }), []), st(() => {
4596
4600
  const E = Le.current;
4597
4601
  if (!E || we.current !== E) return;
4598
4602
  re.messages.length && re.messages[re.messages.length - 1];
@@ -4714,14 +4718,14 @@ function zy({
4714
4718
  V
4715
4719
  ]), Xr = lt(
4716
4720
  () => ({
4717
- isStreaming: Gn,
4721
+ isStreaming: Yn,
4718
4722
  error: R,
4719
4723
  submit: nt,
4720
4724
  send: nt,
4721
4725
  stop: Nr,
4722
4726
  setAuthToken: H
4723
4727
  }),
4724
- [Gn, R, nt, Nr, H]
4728
+ [Yn, R, nt, Nr, H]
4725
4729
  );
4726
4730
  return /* @__PURE__ */ u.jsx(My.Provider, { value: !0, children: /* @__PURE__ */ u.jsx(od.Provider, { value: Xr, children: /* @__PURE__ */ u.jsx(nd.Provider, { value: nn, children: /* @__PURE__ */ u.jsx(rd.Provider, { value: kt, children: e }) }) }) });
4727
4731
  }
@@ -5365,15 +5369,15 @@ function ud(e, t) {
5365
5369
  }
5366
5370
  return s.push({ end: 1 / 0, start: r, value: o }), s;
5367
5371
  }
5368
- function st(e) {
5372
+ function it(e) {
5369
5373
  return e === mo;
5370
5374
  }
5371
5375
  function go(e, t) {
5372
- if (!st(e))
5376
+ if (!it(e))
5373
5377
  return t === e.k ? e.v : t < e.k ? go(e.l, t) : go(e.r, t);
5374
5378
  }
5375
5379
  function yn(e, t, n = "k") {
5376
- if (st(e))
5380
+ if (it(e))
5377
5381
  return [-1 / 0, void 0];
5378
5382
  if (Number(e[n]) === t)
5379
5383
  return [e.k, e.v];
@@ -5384,24 +5388,24 @@ function yn(e, t, n = "k") {
5384
5388
  return yn(e.l, t, n);
5385
5389
  }
5386
5390
  function Jt(e, t, n) {
5387
- return st(e) ? hd(t, n, 1) : t === e.k ? Rt(e, { k: t, v: n }) : t < e.k ? vc(Rt(e, { l: Jt(e.l, t, n) })) : vc(Rt(e, { r: Jt(e.r, t, n) }));
5391
+ return it(e) ? hd(t, n, 1) : t === e.k ? Rt(e, { k: t, v: n }) : t < e.k ? vc(Rt(e, { l: Jt(e.l, t, n) })) : vc(Rt(e, { r: Jt(e.r, t, n) }));
5388
5392
  }
5389
5393
  function Mr() {
5390
5394
  return mo;
5391
5395
  }
5392
5396
  function Us(e, t, n) {
5393
- if (st(e))
5397
+ if (it(e))
5394
5398
  return [];
5395
5399
  const r = yn(e, t)[0];
5396
5400
  return rv(ca(e, r, n));
5397
5401
  }
5398
5402
  function la(e, t) {
5399
- if (st(e)) return mo;
5403
+ if (it(e)) return mo;
5400
5404
  const { k: n, l: r, r: o } = e;
5401
5405
  if (t === n) {
5402
- if (st(r))
5406
+ if (it(r))
5403
5407
  return o;
5404
- if (st(o))
5408
+ if (it(o))
5405
5409
  return r;
5406
5410
  {
5407
5411
  const [s, i] = fd(r);
@@ -5410,10 +5414,10 @@ function la(e, t) {
5410
5414
  } else return t < n ? rs(Rt(e, { l: la(r, t) })) : rs(Rt(e, { r: la(o, t) }));
5411
5415
  }
5412
5416
  function hr(e) {
5413
- return st(e) ? [] : [...hr(e.l), { k: e.k, v: e.v }, ...hr(e.r)];
5417
+ return it(e) ? [] : [...hr(e.l), { k: e.k, v: e.v }, ...hr(e.r)];
5414
5418
  }
5415
5419
  function ca(e, t, n) {
5416
- if (st(e))
5420
+ if (it(e))
5417
5421
  return [];
5418
5422
  const { k: r, l: o, r: s, v: i } = e;
5419
5423
  let a = [];
@@ -5426,7 +5430,7 @@ function rs(e) {
5426
5430
  if (n > r.lvl + 1) {
5427
5431
  if (Ii(t))
5428
5432
  return pd(Rt(e, { lvl: n - 1 }));
5429
- if (!st(t) && !st(t.r))
5433
+ if (!it(t) && !it(t.r))
5430
5434
  return Rt(t.r, {
5431
5435
  l: Rt(t, { r: t.r.l }),
5432
5436
  lvl: n,
@@ -5439,7 +5443,7 @@ function rs(e) {
5439
5443
  } else {
5440
5444
  if (Ii(e))
5441
5445
  return ua(Rt(e, { lvl: n - 1 }));
5442
- if (!st(r) && !st(r.l)) {
5446
+ if (!it(r) && !it(r.l)) {
5443
5447
  const o = r.l, s = Ii(o) ? r.lvl - 1 : r.lvl;
5444
5448
  return Rt(o, {
5445
5449
  l: Rt(e, {
@@ -5463,13 +5467,13 @@ function Rt(e, t) {
5463
5467
  );
5464
5468
  }
5465
5469
  function dd(e) {
5466
- return st(e.r) ? e.l : rs(Rt(e, { r: dd(e.r) }));
5470
+ return it(e.r) ? e.l : rs(Rt(e, { r: dd(e.r) }));
5467
5471
  }
5468
5472
  function Ii(e) {
5469
- return st(e) || e.lvl > e.r.lvl;
5473
+ return it(e) || e.lvl > e.r.lvl;
5470
5474
  }
5471
5475
  function fd(e) {
5472
- return st(e.r) ? [e.k, e.v] : fd(e.r);
5476
+ return it(e.r) ? [e.k, e.v] : fd(e.r);
5473
5477
  }
5474
5478
  function hd(e, t, n, r = mo, o = mo) {
5475
5479
  return { k: e, l: r, lvl: n, r: o, v: t };
@@ -5479,11 +5483,11 @@ function vc(e) {
5479
5483
  }
5480
5484
  function pd(e) {
5481
5485
  const { l: t } = e;
5482
- return !st(t) && t.lvl === e.lvl ? Rt(t, { r: Rt(e, { l: t.r }) }) : e;
5486
+ return !it(t) && t.lvl === e.lvl ? Rt(t, { r: Rt(e, { l: t.r }) }) : e;
5483
5487
  }
5484
5488
  function ua(e) {
5485
5489
  const { lvl: t, r: n } = e;
5486
- return !st(n) && !st(n.r) && n.lvl === t && n.r.lvl === t ? Rt(n, { l: Rt(e, { r: n.l }), lvl: t + 1 }) : e;
5490
+ return !it(n) && !it(n.r) && n.lvl === t && n.r.lvl === t ? Rt(n, { l: Rt(e, { r: n.l }), lvl: t + 1 }) : e;
5487
5491
  }
5488
5492
  function rv(e) {
5489
5493
  return ud(e, ({ k: t, v: n }) => ({ index: t, value: n }));
@@ -5528,7 +5532,7 @@ function Zn(e, t) {
5528
5532
  return Math.round(e.getBoundingClientRect()[t]);
5529
5533
  }
5530
5534
  function Ws(e) {
5531
- return !st(e.groupOffsetTree);
5535
+ return !it(e.groupOffsetTree);
5532
5536
  }
5533
5537
  function Wa({ index: e }, t) {
5534
5538
  return t === e ? 0 : t < e ? -1 : 1;
@@ -5545,10 +5549,10 @@ function sv() {
5545
5549
  };
5546
5550
  }
5547
5551
  function iv(e, t) {
5548
- let n = st(e) ? 0 : 1 / 0;
5552
+ let n = it(e) ? 0 : 1 / 0;
5549
5553
  for (const r of t) {
5550
5554
  const { endIndex: o, size: s, startIndex: i } = r;
5551
- if (n = Math.min(n, i), st(e)) {
5555
+ if (n = Math.min(n, i), it(e)) {
5552
5556
  e = Jt(e, 0, s);
5553
5557
  continue;
5554
5558
  }
@@ -5598,7 +5602,7 @@ function uv(e, [t, n, r, o]) {
5598
5602
  t.length > 0 && r("received item sizes", t, qt.DEBUG);
5599
5603
  const s = e.sizeTree;
5600
5604
  let i = s, a = 0;
5601
- if (n.length > 0 && st(s) && t.length === 2) {
5605
+ if (n.length > 0 && it(s) && t.length === 2) {
5602
5606
  const h = t[0].size, p = t[1].size;
5603
5607
  i = n.reduce((m, y) => Jt(Jt(m, y, h), y + 1, p), i);
5604
5608
  } else
@@ -5718,7 +5722,7 @@ const pv = {
5718
5722
  ye(
5719
5723
  K(
5720
5724
  d,
5721
- Ie((C) => C !== void 0 && st(vt(y).sizeTree)),
5725
+ Ie((C) => C !== void 0 && it(vt(y).sizeTree)),
5722
5726
  pe((C) => [{ endIndex: 0, size: C, startIndex: 0 }])
5723
5727
  ),
5724
5728
  n
@@ -5840,7 +5844,7 @@ const pv = {
5840
5844
  $e(y, p),
5841
5845
  pe(([C, S, k]) => {
5842
5846
  if (S.groupIndices.length > 0) {
5843
- if (st(S.sizeTree))
5847
+ if (it(S.sizeTree))
5844
5848
  return S;
5845
5849
  let N = Mr();
5846
5850
  const _ = vt(v);
@@ -6058,7 +6062,7 @@ const _o = Xe(
6058
6062
  K(
6059
6063
  St(t, i),
6060
6064
  $e(a, n, e, c),
6061
- Ie(([[, d], f, { sizeTree: h }, p, m]) => d && (!st(h) || za(p)) && !f && !m),
6065
+ Ie(([[, d], f, { sizeTree: h }, p, m]) => d && (!it(h) || za(p)) && !f && !m),
6062
6066
  $e(l)
6063
6067
  ),
6064
6068
  ([, d]) => {
@@ -6420,7 +6424,7 @@ const kr = Xe(
6420
6424
  return { ...Ai, totalCount: N };
6421
6425
  if (S === 0 && k === 0)
6422
6426
  return z === 0 ? { ...Ai, totalCount: N } : Sd(z, O, _, M, I, D || []);
6423
- if (st(V))
6427
+ if (it(V))
6424
6428
  return z > 0 ? null : os(
6425
6429
  bv(Ka(O, N), W, D),
6426
6430
  [],
@@ -8818,15 +8822,15 @@ var Mi = "focusScope.autoFocusOnMount", Di = "focusScope.autoFocusOnUnmount", $c
8818
8822
  let y = function(b) {
8819
8823
  if (p.paused || !a) return;
8820
8824
  const T = b.target;
8821
- a.contains(T) ? f.current = T : Yn(f.current, { select: !0 });
8825
+ a.contains(T) ? f.current = T : Xn(f.current, { select: !0 });
8822
8826
  }, v = function(b) {
8823
8827
  if (p.paused || !a) return;
8824
8828
  const T = b.relatedTarget;
8825
- T !== null && (a.contains(T) || Yn(f.current, { select: !0 }));
8829
+ T !== null && (a.contains(T) || Xn(f.current, { select: !0 }));
8826
8830
  }, x = function(b) {
8827
8831
  if (document.activeElement === document.body)
8828
8832
  for (const C of b)
8829
- C.removedNodes.length > 0 && Yn(a);
8833
+ C.removedNodes.length > 0 && Xn(a);
8830
8834
  };
8831
8835
  document.addEventListener("focusin", y), document.addEventListener("focusout", v);
8832
8836
  const w = new MutationObserver(x);
@@ -8840,12 +8844,12 @@ var Mi = "focusScope.autoFocusOnMount", Di = "focusScope.autoFocusOnUnmount", $c
8840
8844
  const y = document.activeElement;
8841
8845
  if (!a.contains(y)) {
8842
8846
  const x = new CustomEvent(Mi, $c);
8843
- a.addEventListener(Mi, c), a.dispatchEvent(x), x.defaultPrevented || (Jw(nb(Jd(a)), { select: !0 }), document.activeElement === y && Yn(a));
8847
+ a.addEventListener(Mi, c), a.dispatchEvent(x), x.defaultPrevented || (Jw(nb(Jd(a)), { select: !0 }), document.activeElement === y && Xn(a));
8844
8848
  }
8845
8849
  return () => {
8846
8850
  a.removeEventListener(Mi, c), setTimeout(() => {
8847
8851
  const x = new CustomEvent(Di, $c);
8848
- a.addEventListener(Di, d), a.dispatchEvent(x), x.defaultPrevented || Yn(y ?? document.body, { select: !0 }), a.removeEventListener(Di, d), Bc.remove(p);
8852
+ a.addEventListener(Di, d), a.dispatchEvent(x), x.defaultPrevented || Xn(y ?? document.body, { select: !0 }), a.removeEventListener(Di, d), Bc.remove(p);
8849
8853
  }, 0);
8850
8854
  };
8851
8855
  }
@@ -8856,7 +8860,7 @@ var Mi = "focusScope.autoFocusOnMount", Di = "focusScope.autoFocusOnUnmount", $c
8856
8860
  const v = y.key === "Tab" && !y.altKey && !y.ctrlKey && !y.metaKey, x = document.activeElement;
8857
8861
  if (v && x) {
8858
8862
  const w = y.currentTarget, [b, T] = Zw(w);
8859
- b && T ? !y.shiftKey && x === T ? (y.preventDefault(), n && Yn(b, { select: !0 })) : y.shiftKey && x === b && (y.preventDefault(), n && Yn(T, { select: !0 })) : x === w && y.preventDefault();
8863
+ b && T ? !y.shiftKey && x === T ? (y.preventDefault(), n && Xn(b, { select: !0 })) : y.shiftKey && x === b && (y.preventDefault(), n && Xn(T, { select: !0 })) : x === w && y.preventDefault();
8860
8864
  }
8861
8865
  },
8862
8866
  [n, r, p.paused]
@@ -8867,7 +8871,7 @@ Gs.displayName = Xw;
8867
8871
  function Jw(e, { select: t = !1 } = {}) {
8868
8872
  const n = document.activeElement;
8869
8873
  for (const r of e)
8870
- if (Yn(r, { select: t }), document.activeElement !== n) return;
8874
+ if (Xn(r, { select: t }), document.activeElement !== n) return;
8871
8875
  }
8872
8876
  function Zw(e) {
8873
8877
  const t = Jd(e), n = zc(t, e), r = zc(t.reverse(), e);
@@ -8899,7 +8903,7 @@ function Qw(e, { upTo: t }) {
8899
8903
  function eb(e) {
8900
8904
  return e instanceof HTMLInputElement && "select" in e;
8901
8905
  }
8902
- function Yn(e, { select: t = !1 } = {}) {
8906
+ function Xn(e, { select: t = !1 } = {}) {
8903
8907
  if (e && e.focus) {
8904
8908
  const n = document.activeElement;
8905
8909
  e.focus({ preventScroll: !0 }), e !== n && eb(e) && t && e.select();
@@ -9794,7 +9798,7 @@ function n0({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
9794
9798
  }
9795
9799
  }
9796
9800
  }, [n]);
9797
- at(() => {
9801
+ st(() => {
9798
9802
  e && n && h();
9799
9803
  }, [e, n, h]);
9800
9804
  const p = async () => {
@@ -9936,7 +9940,7 @@ function Pf(e) {
9936
9940
  return e.replace(a0, (t, n) => (n = n.toLowerCase(), n === "colon" ? ":" : n.charAt(0) === "#" ? n.charAt(1) === "x" ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)) : ""));
9937
9941
  }
9938
9942
  const l0 = /(^|[^\[])\^/g;
9939
- function it(e, t) {
9943
+ function at(e, t) {
9940
9944
  e = typeof e == "string" ? e : e.source, t = t || "";
9941
9945
  const n = {
9942
9946
  replace: (r, o) => (o = o.source || o, o = o.replace(l0, "$1"), e = e.replace(r, o), n),
@@ -10498,26 +10502,26 @@ const Te = {
10498
10502
  };
10499
10503
  Te._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
10500
10504
  Te._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
10501
- Te.def = it(Te.def).replace("label", Te._label).replace("title", Te._title).getRegex();
10505
+ Te.def = at(Te.def).replace("label", Te._label).replace("title", Te._title).getRegex();
10502
10506
  Te.bullet = /(?:[*+-]|\d{1,9}[.)])/;
10503
- Te.listItemStart = it(/^( *)(bull) */).replace("bull", Te.bullet).getRegex();
10504
- Te.list = it(Te.list).replace(/bull/g, Te.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + Te.def.source + ")").getRegex();
10507
+ Te.listItemStart = at(/^( *)(bull) */).replace("bull", Te.bullet).getRegex();
10508
+ Te.list = at(Te.list).replace(/bull/g, Te.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + Te.def.source + ")").getRegex();
10505
10509
  Te._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
10506
10510
  Te._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
10507
- Te.html = it(Te.html, "i").replace("comment", Te._comment).replace("tag", Te._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
10508
- Te.paragraph = it(Te._paragraph).replace("hr", Te.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Te._tag).getRegex();
10509
- Te.blockquote = it(Te.blockquote).replace("paragraph", Te.paragraph).getRegex();
10511
+ Te.html = at(Te.html, "i").replace("comment", Te._comment).replace("tag", Te._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
10512
+ Te.paragraph = at(Te._paragraph).replace("hr", Te.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Te._tag).getRegex();
10513
+ Te.blockquote = at(Te.blockquote).replace("paragraph", Te.paragraph).getRegex();
10510
10514
  Te.normal = { ...Te };
10511
10515
  Te.gfm = {
10512
10516
  ...Te.normal,
10513
10517
  table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
10514
10518
  // Cells
10515
10519
  };
10516
- Te.gfm.table = it(Te.gfm.table).replace("hr", Te.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Te._tag).getRegex();
10517
- Te.gfm.paragraph = it(Te._paragraph).replace("hr", Te.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", Te.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Te._tag).getRegex();
10520
+ Te.gfm.table = at(Te.gfm.table).replace("hr", Te.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Te._tag).getRegex();
10521
+ Te.gfm.paragraph = at(Te._paragraph).replace("hr", Te.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", Te.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Te._tag).getRegex();
10518
10522
  Te.pedantic = {
10519
10523
  ...Te.normal,
10520
- html: it(
10524
+ html: at(
10521
10525
  `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
10522
10526
  ).replace("comment", Te._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
10523
10527
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
@@ -10525,7 +10529,7 @@ Te.pedantic = {
10525
10529
  fences: ws,
10526
10530
  // fences not supported
10527
10531
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
10528
- paragraph: it(Te.normal._paragraph).replace("hr", Te.hr).replace("heading", ` *#{1,6} *[^
10532
+ paragraph: at(Te.normal._paragraph).replace("hr", Te.hr).replace("heading", ` *#{1,6} *[^
10529
10533
  ]`).replace("lheading", Te.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
10530
10534
  };
10531
10535
  const me = {
@@ -10553,26 +10557,26 @@ const me = {
10553
10557
  punctuation: /^([\spunctuation])/
10554
10558
  };
10555
10559
  me._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
10556
- me.punctuation = it(me.punctuation).replace(/punctuation/g, me._punctuation).getRegex();
10560
+ me.punctuation = at(me.punctuation).replace(/punctuation/g, me._punctuation).getRegex();
10557
10561
  me.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
10558
10562
  me.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
10559
- me._comment = it(Te._comment).replace("(?:-->|$)", "-->").getRegex();
10560
- me.emStrong.lDelim = it(me.emStrong.lDelim).replace(/punct/g, me._punctuation).getRegex();
10561
- me.emStrong.rDelimAst = it(me.emStrong.rDelimAst, "g").replace(/punct/g, me._punctuation).getRegex();
10562
- me.emStrong.rDelimUnd = it(me.emStrong.rDelimUnd, "g").replace(/punct/g, me._punctuation).getRegex();
10563
+ me._comment = at(Te._comment).replace("(?:-->|$)", "-->").getRegex();
10564
+ me.emStrong.lDelim = at(me.emStrong.lDelim).replace(/punct/g, me._punctuation).getRegex();
10565
+ me.emStrong.rDelimAst = at(me.emStrong.rDelimAst, "g").replace(/punct/g, me._punctuation).getRegex();
10566
+ me.emStrong.rDelimUnd = at(me.emStrong.rDelimUnd, "g").replace(/punct/g, me._punctuation).getRegex();
10563
10567
  me._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
10564
10568
  me._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
10565
10569
  me._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
10566
- me.autolink = it(me.autolink).replace("scheme", me._scheme).replace("email", me._email).getRegex();
10570
+ me.autolink = at(me.autolink).replace("scheme", me._scheme).replace("email", me._email).getRegex();
10567
10571
  me._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
10568
- me.tag = it(me.tag).replace("comment", me._comment).replace("attribute", me._attribute).getRegex();
10572
+ me.tag = at(me.tag).replace("comment", me._comment).replace("attribute", me._attribute).getRegex();
10569
10573
  me._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
10570
10574
  me._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
10571
10575
  me._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
10572
- me.link = it(me.link).replace("label", me._label).replace("href", me._href).replace("title", me._title).getRegex();
10573
- me.reflink = it(me.reflink).replace("label", me._label).replace("ref", Te._label).getRegex();
10574
- me.nolink = it(me.nolink).replace("ref", Te._label).getRegex();
10575
- me.reflinkSearch = it(me.reflinkSearch, "g").replace("reflink", me.reflink).replace("nolink", me.nolink).getRegex();
10576
+ me.link = at(me.link).replace("label", me._label).replace("href", me._href).replace("title", me._title).getRegex();
10577
+ me.reflink = at(me.reflink).replace("label", me._label).replace("ref", Te._label).getRegex();
10578
+ me.nolink = at(me.nolink).replace("ref", Te._label).getRegex();
10579
+ me.reflinkSearch = at(me.reflinkSearch, "g").replace("reflink", me.reflink).replace("nolink", me.nolink).getRegex();
10576
10580
  me.normal = { ...me };
10577
10581
  me.pedantic = {
10578
10582
  ...me.normal,
@@ -10588,23 +10592,23 @@ me.pedantic = {
10588
10592
  endAst: /\*(?!\*)/g,
10589
10593
  endUnd: /_(?!_)/g
10590
10594
  },
10591
- link: it(/^!?\[(label)\]\((.*?)\)/).replace("label", me._label).getRegex(),
10592
- reflink: it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", me._label).getRegex()
10595
+ link: at(/^!?\[(label)\]\((.*?)\)/).replace("label", me._label).getRegex(),
10596
+ reflink: at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", me._label).getRegex()
10593
10597
  };
10594
10598
  me.gfm = {
10595
10599
  ...me.normal,
10596
- escape: it(me.escape).replace("])", "~|])").getRegex(),
10600
+ escape: at(me.escape).replace("])", "~|])").getRegex(),
10597
10601
  _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
10598
10602
  url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
10599
10603
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
10600
10604
  del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
10601
10605
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
10602
10606
  };
10603
- me.gfm.url = it(me.gfm.url, "i").replace("email", me.gfm._extended_email).getRegex();
10607
+ me.gfm.url = at(me.gfm.url, "i").replace("email", me.gfm._extended_email).getRegex();
10604
10608
  me.breaks = {
10605
10609
  ...me.gfm,
10606
- br: it(me.br).replace("{2,}", "*").getRegex(),
10607
- text: it(me.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
10610
+ br: at(me.br).replace("{2,}", "*").getRegex(),
10611
+ text: at(me.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
10608
10612
  };
10609
10613
  function y0(e) {
10610
10614
  return e.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
@@ -11552,7 +11556,7 @@ function tu(e) {
11552
11556
  }
11553
11557
  function T0({ className: e }) {
11554
11558
  const [t, n] = xe(0);
11555
- return at(() => {
11559
+ return st(() => {
11556
11560
  const r = setInterval(() => n((o) => (o + 1) % 4), 500);
11557
11561
  return () => clearInterval(r);
11558
11562
  }, []), /* @__PURE__ */ u.jsxs(
@@ -12459,10 +12463,10 @@ const O0 = ["top", "right", "bottom", "left"], tr = Math.min, Xt = Math.max, Ss
12459
12463
  function ma(e, t, n) {
12460
12464
  return Xt(e, tr(t, n));
12461
12465
  }
12462
- function Vn(e, t) {
12466
+ function Kn(e, t) {
12463
12467
  return typeof e == "function" ? e(t) : e;
12464
12468
  }
12465
- function Kn(e) {
12469
+ function qn(e) {
12466
12470
  return e.split("-")[0];
12467
12471
  }
12468
12472
  function qr(e) {
@@ -12476,7 +12480,7 @@ function fl(e) {
12476
12480
  }
12477
12481
  const L0 = /* @__PURE__ */ new Set(["top", "bottom"]);
12478
12482
  function On(e) {
12479
- return L0.has(Kn(e)) ? "y" : "x";
12483
+ return L0.has(qn(e)) ? "y" : "x";
12480
12484
  }
12481
12485
  function hl(e) {
12482
12486
  return dl(On(e));
@@ -12509,7 +12513,7 @@ function H0(e, t, n) {
12509
12513
  }
12510
12514
  function U0(e, t, n, r) {
12511
12515
  const o = qr(e);
12512
- let s = H0(Kn(e), n === "start", r);
12516
+ let s = H0(qn(e), n === "start", r);
12513
12517
  return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(ga)))), s;
12514
12518
  }
12515
12519
  function Cs(e) {
@@ -12555,7 +12559,7 @@ function su(e, t, n) {
12555
12559
  reference: r,
12556
12560
  floating: o
12557
12561
  } = e;
12558
- const s = On(t), i = hl(t), a = fl(i), l = Kn(t), c = s === "y", d = r.x + r.width / 2 - o.width / 2, f = r.y + r.height / 2 - o.height / 2, h = r[a] / 2 - o[a] / 2;
12562
+ const s = On(t), i = hl(t), a = fl(i), l = qn(t), c = s === "y", d = r.x + r.width / 2 - o.width / 2, f = r.y + r.height / 2 - o.height / 2, h = r[a] / 2 - o[a] / 2;
12559
12563
  let p;
12560
12564
  switch (l) {
12561
12565
  case "top":
@@ -12675,7 +12679,7 @@ async function bo(e, t) {
12675
12679
  elementContext: f = "floating",
12676
12680
  altBoundary: h = !1,
12677
12681
  padding: p = 0
12678
- } = Vn(t, e), m = Bf(p), v = a[h ? f === "floating" ? "reference" : "floating" : f], x = Ts(await s.getClippingRect({
12682
+ } = Kn(t, e), m = Bf(p), v = a[h ? f === "floating" ? "reference" : "floating" : f], x = Ts(await s.getClippingRect({
12679
12683
  element: (n = await (s.isElement == null ? void 0 : s.isElement(v))) == null || n ? v : v.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(a.floating)),
12680
12684
  boundary: c,
12681
12685
  rootBoundary: d,
@@ -12719,7 +12723,7 @@ const K0 = (e) => ({
12719
12723
  } = t, {
12720
12724
  element: c,
12721
12725
  padding: d = 0
12722
- } = Vn(e, t) || {};
12726
+ } = Kn(e, t) || {};
12723
12727
  if (c == null)
12724
12728
  return {};
12725
12729
  const f = Bf(d), h = {
@@ -12762,10 +12766,10 @@ const K0 = (e) => ({
12762
12766
  fallbackAxisSideDirection: m = "none",
12763
12767
  flipAlignment: y = !0,
12764
12768
  ...v
12765
- } = Vn(e, t);
12769
+ } = Kn(e, t);
12766
12770
  if ((n = s.arrow) != null && n.alignmentOffset)
12767
12771
  return {};
12768
- const x = Kn(o), w = On(a), b = Kn(a) === a, T = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), C = h || (b || !y ? [Cs(a)] : $0(a)), S = m !== "none";
12772
+ const x = qn(o), w = On(a), b = qn(a) === a, T = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), C = h || (b || !y ? [Cs(a)] : $0(a)), S = m !== "none";
12769
12773
  !h && S && C.push(...U0(a, y, m, T));
12770
12774
  const k = [a, ...C], N = await bo(t, v), _ = [];
12771
12775
  let O = ((r = s.flip) == null ? void 0 : r.overflows) || [];
@@ -12844,7 +12848,7 @@ const G0 = function(e) {
12844
12848
  } = t, {
12845
12849
  strategy: r = "referenceHidden",
12846
12850
  ...o
12847
- } = Vn(e, t);
12851
+ } = Kn(e, t);
12848
12852
  switch (r) {
12849
12853
  case "referenceHidden": {
12850
12854
  const s = await bo(t, {
@@ -12881,7 +12885,7 @@ async function Y0(e, t) {
12881
12885
  placement: n,
12882
12886
  platform: r,
12883
12887
  elements: o
12884
- } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = Kn(n), a = qr(n), l = On(n) === "y", c = Hf.has(i) ? -1 : 1, d = s && l ? -1 : 1, f = Vn(t, e);
12888
+ } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = qn(n), a = qr(n), l = On(n) === "y", c = Hf.has(i) ? -1 : 1, d = s && l ? -1 : 1, f = Kn(t, e);
12885
12889
  let {
12886
12890
  mainAxis: h,
12887
12891
  crossAxis: p,
@@ -12950,10 +12954,10 @@ const X0 = function(e) {
12950
12954
  }
12951
12955
  },
12952
12956
  ...l
12953
- } = Vn(e, t), c = {
12957
+ } = Kn(e, t), c = {
12954
12958
  x: n,
12955
12959
  y: r
12956
- }, d = await bo(t, l), f = On(Kn(o)), h = dl(f);
12960
+ }, d = await bo(t, l), f = On(qn(o)), h = dl(f);
12957
12961
  let p = c[h], m = c[f];
12958
12962
  if (s) {
12959
12963
  const v = h === "y" ? "top" : "left", x = h === "y" ? "bottom" : "right", w = p + d[v], b = p - d[x];
@@ -12995,12 +12999,12 @@ const X0 = function(e) {
12995
12999
  offset: a = 0,
12996
13000
  mainAxis: l = !0,
12997
13001
  crossAxis: c = !0
12998
- } = Vn(e, t), d = {
13002
+ } = Kn(e, t), d = {
12999
13003
  x: n,
13000
13004
  y: r
13001
13005
  }, f = On(o), h = dl(f);
13002
13006
  let p = d[h], m = d[f];
13003
- const y = Vn(a, t), v = typeof y == "number" ? {
13007
+ const y = Kn(a, t), v = typeof y == "number" ? {
13004
13008
  mainAxis: y,
13005
13009
  crossAxis: 0
13006
13010
  } : {
@@ -13014,7 +13018,7 @@ const X0 = function(e) {
13014
13018
  }
13015
13019
  if (c) {
13016
13020
  var x, w;
13017
- const b = h === "y" ? "width" : "height", T = Hf.has(Kn(o)), C = s.reference[f] - s.floating[b] + (T && ((x = i.offset) == null ? void 0 : x[f]) || 0) + (T ? 0 : v.crossAxis), S = s.reference[f] + s.reference[b] + (T ? 0 : ((w = i.offset) == null ? void 0 : w[f]) || 0) - (T ? v.crossAxis : 0);
13021
+ const b = h === "y" ? "width" : "height", T = Hf.has(qn(o)), C = s.reference[f] - s.floating[b] + (T && ((x = i.offset) == null ? void 0 : x[f]) || 0) + (T ? 0 : v.crossAxis), S = s.reference[f] + s.reference[b] + (T ? 0 : ((w = i.offset) == null ? void 0 : w[f]) || 0) - (T ? v.crossAxis : 0);
13018
13022
  m < C ? m = C : m > S && (m = S);
13019
13023
  }
13020
13024
  return {
@@ -13038,7 +13042,7 @@ const X0 = function(e) {
13038
13042
  apply: l = () => {
13039
13043
  },
13040
13044
  ...c
13041
- } = Vn(e, t), d = await bo(t, c), f = Kn(o), h = qr(o), p = On(o) === "y", {
13045
+ } = Kn(e, t), d = await bo(t, c), f = qn(o), h = qr(o), p = On(o) === "y", {
13042
13046
  width: m,
13043
13047
  height: y
13044
13048
  } = s.floating;
@@ -15047,7 +15051,7 @@ function Vi({
15047
15051
  interrupt: $,
15048
15052
  metadata: F
15049
15053
  } = $a(), { isStreaming: M, error: I, submit: D, stop: W } = By(), ne = x ?? v ?? null, V = (_ == null ? void 0 : _.id) ?? null, z = (_ == null ? void 0 : _.namespace) ?? null, G = (F == null ? void 0 : F.assemblingMessageId) ?? null, Q = $, [ae, B] = xe(!1);
15050
- at(() => {
15054
+ st(() => {
15051
15055
  Q || B(!1);
15052
15056
  }, [Q]);
15053
15057
  const ie = Se(() => {
@@ -15056,7 +15060,7 @@ function Vi({
15056
15060
  B(!1);
15057
15061
  }, []), be = !!Q || ae, [q, P] = xe(null), [X, ee] = xe(""), [fe, ue] = xe(null), [re, We] = xe([]), [Ge, Je] = xe(0), [rt, ht] = xe(0), [Ze, Le] = xe(!1), [Nt, Ve] = xe(null), [ot, oe] = xe(null), [ve, we] = xe(!1), [Ye, pt] = xe(null), [bt, Ct] = xe(!1), mt = De(!1), [je, Tt] = xe(() => mu.value), Bt = De(je), ct = De(null), Et = Se((L) => {
15058
15062
  mu.value = L, Tt(L);
15059
- }, []), [qn, Gt] = xe(!1), dn = Se(
15063
+ }, []), [Gn, Gt] = xe(!1), dn = Se(
15060
15064
  (L, de) => {
15061
15065
  if (!L || typeof L != "object") return null;
15062
15066
  const he = L[de];
@@ -15087,21 +15091,21 @@ function Vi({
15087
15091
  },
15088
15092
  [Et]
15089
15093
  ), Tn = De(!1);
15090
- at(() => {
15094
+ st(() => {
15091
15095
  Tn.current && !M && (We([]), gt()), Tn.current = M;
15092
15096
  }, [M, gt]);
15093
15097
  const [lr, Yt] = xe("desktop");
15094
- at(() => {
15098
+ st(() => {
15095
15099
  const L = () => {
15096
15100
  const de = window.innerWidth;
15097
15101
  Yt(de < 640 ? "phone" : de < 1024 ? "tablet" : "desktop");
15098
15102
  };
15099
15103
  return L(), window.addEventListener("resize", L), () => window.removeEventListener("resize", L);
15100
- }, []), at(() => {
15104
+ }, []), st(() => {
15101
15105
  Ct(!1), mt.current = !1;
15102
- }, [ne]), at(() => {
15106
+ }, [ne]), st(() => {
15103
15107
  Bt.current = je;
15104
- }, [je]), at(() => {
15108
+ }, [je]), st(() => {
15105
15109
  if (!q) {
15106
15110
  ct.current = null;
15107
15111
  return;
@@ -15116,7 +15120,7 @@ function Vi({
15116
15120
  console.warn("loadOlder failed", L);
15117
15121
  }
15118
15122
  }, [b, bt, T, S]);
15119
- at(() => {
15123
+ st(() => {
15120
15124
  (async () => {
15121
15125
  if (!y.baseUrl) {
15122
15126
  pt(null);
@@ -15129,7 +15133,7 @@ function Vi({
15129
15133
  console.warn("Failed to fetch default message:", de), pt(null);
15130
15134
  }
15131
15135
  })();
15132
- }, [y.baseUrl]), at(() => {
15136
+ }, [y.baseUrl]), st(() => {
15133
15137
  I && !ve && (m == null || m(I));
15134
15138
  }, [I, ve, m]);
15135
15139
  const kn = (L) => {
@@ -15198,7 +15202,7 @@ function Vi({
15198
15202
  );
15199
15203
  break;
15200
15204
  }
15201
- }, [w, D, V, z]), Gn = (L) => {
15205
+ }, [w, D, V, z]), Yn = (L) => {
15202
15206
  const de = Array.from(L.target.files || []);
15203
15207
  We((he) => [...he, ...de]), L.target.value = "";
15204
15208
  }, R = (L) => {
@@ -15320,7 +15324,7 @@ function Vi({
15320
15324
  onRegenerate: Nr,
15321
15325
  onCancelEdit: ur,
15322
15326
  emptyMessage: Ye ?? void 0,
15323
- isNavigatingCheckpoint: qn,
15327
+ isNavigatingCheckpoint: Gn,
15324
15328
  activeInterrupt: Q,
15325
15329
  disableInterruptActions: ae,
15326
15330
  onInterruptActionStart: ie,
@@ -15360,7 +15364,7 @@ function Vi({
15360
15364
  ref: Cn,
15361
15365
  type: "file",
15362
15366
  multiple: !0,
15363
- onChange: (L) => Gn(L),
15367
+ onChange: (L) => Yn(L),
15364
15368
  className: "hidden"
15365
15369
  },
15366
15370
  Ge
@@ -16040,14 +16044,14 @@ function xu({
16040
16044
  isLoading: p,
16041
16045
  actions: m
16042
16046
  } = Fa(), { loadThread: y } = $a(), { createThread: v, deleteThread: x, renameThread: w } = m, [b, T] = xe(Array.isArray(f) ? f : []), C = De(b.length > 0), S = De(null), k = De(0), [N, _] = xe(null), [O, $] = xe(""), [F, M] = xe(!1);
16043
- at(() => {
16047
+ st(() => {
16044
16048
  const B = Array.isArray(f) ? f : [];
16045
16049
  if (B.length > 0) {
16046
16050
  C.current = !0, T(B);
16047
16051
  return;
16048
16052
  }
16049
16053
  p || (C.current = !1, T(B));
16050
- }, [f, p]), at(() => {
16054
+ }, [f, p]), st(() => {
16051
16055
  if (!S.current) return;
16052
16056
  const B = S.current.querySelector(
16053
16057
  "[data-radix-scroll-area-viewport]"
@@ -16221,11 +16225,11 @@ function BT() {
16221
16225
  return t && (e.baseUrl = t), n && (e.apiKey = n), e;
16222
16226
  }
16223
16227
  function HT() {
16224
- const e = BT(), t = Jn.getAuthToken(), n = Ip();
16228
+ const e = BT(), t = Vn.getAuthToken(), n = Ip();
16225
16229
  return {
16226
16230
  apiBaseUrl: Np(
16227
16231
  e.baseUrl,
16228
- Jn.baseUrl,
16232
+ Vn.baseUrl,
16229
16233
  n
16230
16234
  ),
16231
16235
  apiKey: t || e.apiKey || Ap() || "",
@@ -16255,13 +16259,13 @@ function WT(e) {
16255
16259
  ...e,
16256
16260
  apiBaseUrl: Wn(e.apiBaseUrl)
16257
16261
  };
16258
- localStorage.setItem(_p, JSON.stringify(t)), t.apiKey && Jn.setAuthToken(t.apiKey);
16262
+ localStorage.setItem(_p, JSON.stringify(t)), t.apiKey && Vn.setAuthToken(t.apiKey);
16259
16263
  } catch (t) {
16260
16264
  console.error("Failed to save settings:", t);
16261
16265
  }
16262
16266
  }
16263
16267
  function gR() {
16264
- const e = HT(), t = UT(), n = Jn.getAuthToken(), r = typeof t.apiBaseUrl == "string" ? t.apiBaseUrl : void 0;
16268
+ const e = HT(), t = UT(), n = Vn.getAuthToken(), r = typeof t.apiBaseUrl == "string" ? t.apiBaseUrl : void 0;
16265
16269
  return {
16266
16270
  ...e,
16267
16271
  ...t,
@@ -16269,14 +16273,14 @@ function gR() {
16269
16273
  apiKey: n || t.apiKey || e.apiKey,
16270
16274
  // Always use the current base URL from API client
16271
16275
  apiBaseUrl: Np(
16272
- Jn.baseUrl,
16276
+ Vn.baseUrl,
16273
16277
  r,
16274
16278
  e.apiBaseUrl
16275
16279
  )
16276
16280
  };
16277
16281
  }
16278
16282
  function xR(e) {
16279
- Jn.updateConfig({
16283
+ Vn.updateConfig({
16280
16284
  baseUrl: e.apiBaseUrl,
16281
16285
  authToken: e.apiKey ?? void 0
16282
16286
  }), WT(e);
@@ -16426,7 +16430,7 @@ function $p(e) {
16426
16430
  return e ? "checked" : "unchecked";
16427
16431
  }
16428
16432
  var zp = Mp, JT = Lp;
16429
- const Xn = g.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
16433
+ const Jn = g.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
16430
16434
  zp,
16431
16435
  {
16432
16436
  className: se(
@@ -16445,7 +16449,7 @@ const Xn = g.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
16445
16449
  )
16446
16450
  }
16447
16451
  ));
16448
- Xn.displayName = zp.displayName;
16452
+ Jn.displayName = zp.displayName;
16449
16453
  var Bp = Object.freeze({
16450
16454
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
16451
16455
  position: "absolute",
@@ -17511,10 +17515,10 @@ const Lk = {
17511
17515
  };
17512
17516
  function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17513
17517
  const [r, o] = xe(!1), [s, i] = xe(!1), [a, l] = xe(e), [c, d] = xe(!1), { toast: f } = nl();
17514
- at(() => {
17518
+ st(() => {
17515
17519
  const v = JSON.stringify(a) !== JSON.stringify(e);
17516
17520
  d(v);
17517
- }, [a, e]), at(() => {
17521
+ }, [a, e]), st(() => {
17518
17522
  l(e);
17519
17523
  }, [e]);
17520
17524
  const h = () => {
@@ -17583,7 +17587,7 @@ function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17583
17587
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
17584
17588
  /* @__PURE__ */ u.jsx(rn, { htmlFor: "enable-auth", children: "Enable Authentication" }),
17585
17589
  /* @__PURE__ */ u.jsx(
17586
- Xn,
17590
+ Jn,
17587
17591
  {
17588
17592
  id: "enable-auth",
17589
17593
  checked: a.api.enableAuth,
@@ -17676,7 +17680,7 @@ function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17676
17680
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
17677
17681
  /* @__PURE__ */ u.jsx(rn, { htmlFor: "show-timestamps", children: "Show Timestamps" }),
17678
17682
  /* @__PURE__ */ u.jsx(
17679
- Xn,
17683
+ Jn,
17680
17684
  {
17681
17685
  id: "show-timestamps",
17682
17686
  checked: a.ui.showTimestamps,
@@ -17690,7 +17694,7 @@ function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17690
17694
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
17691
17695
  /* @__PURE__ */ u.jsx(rn, { htmlFor: "show-agent-names", children: "Show Agent Names" }),
17692
17696
  /* @__PURE__ */ u.jsx(
17693
- Xn,
17697
+ Jn,
17694
17698
  {
17695
17699
  id: "show-agent-names",
17696
17700
  checked: a.ui.showAgentNames,
@@ -17704,7 +17708,7 @@ function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17704
17708
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
17705
17709
  /* @__PURE__ */ u.jsx(rn, { htmlFor: "compact-messages", children: "Compact Messages" }),
17706
17710
  /* @__PURE__ */ u.jsx(
17707
- Xn,
17711
+ Jn,
17708
17712
  {
17709
17713
  id: "compact-messages",
17710
17714
  checked: a.ui.compactMessages,
@@ -17730,7 +17734,7 @@ function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17730
17734
  /* @__PURE__ */ u.jsx("p", { className: "text-sm text-muted-foreground", children: "Automatically save messages to threads" })
17731
17735
  ] }),
17732
17736
  /* @__PURE__ */ u.jsx(
17733
- Xn,
17737
+ Jn,
17734
17738
  {
17735
17739
  id: "auto-save",
17736
17740
  checked: a.behavior.autoSave,
@@ -17747,7 +17751,7 @@ function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17747
17751
  /* @__PURE__ */ u.jsx("p", { className: "text-sm text-muted-foreground", children: "Stream responses in real-time" })
17748
17752
  ] }),
17749
17753
  /* @__PURE__ */ u.jsx(
17750
- Xn,
17754
+ Jn,
17751
17755
  {
17752
17756
  id: "enable-streaming",
17753
17757
  checked: a.behavior.enableStreaming,
@@ -17764,7 +17768,7 @@ function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17764
17768
  /* @__PURE__ */ u.jsx("p", { className: "text-sm text-muted-foreground", children: "Show typing indicator during responses" })
17765
17769
  ] }),
17766
17770
  /* @__PURE__ */ u.jsx(
17767
- Xn,
17771
+ Jn,
17768
17772
  {
17769
17773
  id: "typing-indicator",
17770
17774
  checked: a.behavior.showTypingIndicator,
@@ -17878,7 +17882,7 @@ export {
17878
17882
  zf as MessageList,
17879
17883
  xu as ThreadManager,
17880
17884
  xR as applySettings,
17881
- Jn as chatApiClient,
17885
+ Vn as chatApiClient,
17882
17886
  bR as default,
17883
17887
  Bx as del,
17884
17888
  Nn as get,