teodor-new-chat-ui 4.3.71 → 4.3.73

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