teodor-new-chat-ui 4.1.30 → 4.1.32

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
@@ -72,10 +72,10 @@ function pm() {
72
72
  Se.unshift("Warning: " + N), Function.prototype.apply.call(console[b], console, Se);
73
73
  }
74
74
  }
75
- var R = !1, C = !1, T = !1, E = !1, I = !1, A;
75
+ var R = !1, C = !1, T = !1, k = !1, I = !1, A;
76
76
  A = Symbol.for("react.module.reference");
77
77
  function _(b) {
78
- return !!(typeof b == "string" || typeof b == "function" || b === r || b === s || I || b === o || b === u || b === d || E || b === p || R || C || T || typeof b == "object" && b !== null && (b.$$typeof === h || b.$$typeof === f || b.$$typeof === i || b.$$typeof === a || b.$$typeof === l || // This needs to include all possible module reference object
78
+ return !!(typeof b == "string" || typeof b == "function" || b === r || b === s || I || b === o || b === u || b === d || k || b === p || R || C || T || typeof b == "object" && b !== null && (b.$$typeof === h || b.$$typeof === f || b.$$typeof === i || b.$$typeof === a || b.$$typeof === l || // This needs to include all possible module reference object
79
79
  // types supported by any Flight configuration anywhere since
80
80
  // we don't know which Flight build this will end up being used
81
81
  // with.
@@ -615,8 +615,8 @@ Check the top-level render call using <` + M + ">.");
615
615
  function $n(b, N, M) {
616
616
  return xt(b, N, M, !1);
617
617
  }
618
- var ar = $n, k = Vt;
619
- Ar.Fragment = r, Ar.jsx = ar, Ar.jsxs = k;
618
+ var ar = $n, E = Vt;
619
+ Ar.Fragment = r, Ar.jsx = ar, Ar.jsxs = E;
620
620
  }()), Ar;
621
621
  }
622
622
  process.env.NODE_ENV === "production" ? wi.exports = hm() : wi.exports = pm();
@@ -655,7 +655,7 @@ const xm = is("string"), Rt = is("function"), zc = is("number"), Qr = (e) => e !
655
655
  let t;
656
656
  return e && (typeof FormData == "function" && e instanceof FormData || Rt(e.append) && ((t = ss(e)) === "formdata" || // detect form-data instance
657
657
  t === "object" && Rt(e.toString) && e.toString() === "[object FormData]"));
658
- }, Em = Jt("URLSearchParams"), [km, Im, Nm, Am] = ["ReadableStream", "Request", "Response", "Headers"].map(Jt), _m = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
658
+ }, km = Jt("URLSearchParams"), [Em, Im, Nm, Am] = ["ReadableStream", "Request", "Response", "Headers"].map(Jt), _m = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
659
659
  function eo(e, t, { allOwnKeys: n = !1 } = {}) {
660
660
  if (e === null || typeof e > "u")
661
661
  return;
@@ -811,7 +811,7 @@ const Ym = (e) => {
811
811
  isObject: Qr,
812
812
  isPlainObject: yo,
813
813
  isEmptyObject: wm,
814
- isReadableStream: km,
814
+ isReadableStream: Em,
815
815
  isRequest: Im,
816
816
  isResponse: Nm,
817
817
  isHeaders: Am,
@@ -822,7 +822,7 @@ const Ym = (e) => {
822
822
  isRegExp: Um,
823
823
  isFunction: Rt,
824
824
  isStream: Tm,
825
- isURLSearchParams: Em,
825
+ isURLSearchParams: km,
826
826
  isTypedArray: $m,
827
827
  isFileList: Cm,
828
828
  forEach: eo,
@@ -1295,7 +1295,7 @@ function yg(e, t) {
1295
1295
  });
1296
1296
  });
1297
1297
  }
1298
- let Et = class {
1298
+ let kt = class {
1299
1299
  constructor(t) {
1300
1300
  t && this.set(t);
1301
1301
  }
@@ -1421,8 +1421,8 @@ let Et = class {
1421
1421
  return j.isArray(t) ? t.forEach(s) : s(t), this;
1422
1422
  }
1423
1423
  };
1424
- Et.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1425
- j.reduceDescriptors(Et.prototype, ({ value: e }, t) => {
1424
+ kt.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1425
+ j.reduceDescriptors(kt.prototype, ({ value: e }, t) => {
1426
1426
  let n = t[0].toUpperCase() + t.slice(1);
1427
1427
  return {
1428
1428
  get: () => e,
@@ -1431,9 +1431,9 @@ j.reduceDescriptors(Et.prototype, ({ value: e }, t) => {
1431
1431
  }
1432
1432
  };
1433
1433
  });
1434
- j.freezeMethods(Et);
1434
+ j.freezeMethods(kt);
1435
1435
  function Hs(e, t) {
1436
- const n = this || to, r = t || n, o = Et.from(r.headers);
1436
+ const n = this || to, r = t || n, o = kt.from(r.headers);
1437
1437
  let s = r.data;
1438
1438
  return j.forEach(e, function(a) {
1439
1439
  s = a.call(n, s, o.normalize(), t ? t.status : void 0);
@@ -1519,7 +1519,7 @@ const Do = (e, t, n = 3) => {
1519
1519
  }, ll = (e) => (...t) => j.asap(() => e(...t)), Rg = wt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, wt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1520
1520
  new URL(wt.origin),
1521
1521
  wt.navigator && /(msie|trident)/i.test(wt.navigator.userAgent)
1522
- ) : () => !0, Eg = wt.hasStandardBrowserEnv ? (
1522
+ ) : () => !0, kg = wt.hasStandardBrowserEnv ? (
1523
1523
  // Standard browser envs support document.cookie
1524
1524
  {
1525
1525
  write(e, t, n, r, o, s) {
@@ -1546,17 +1546,17 @@ const Do = (e, t, n = 3) => {
1546
1546
  }
1547
1547
  }
1548
1548
  );
1549
- function kg(e) {
1549
+ function Eg(e) {
1550
1550
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1551
1551
  }
1552
1552
  function Ig(e, t) {
1553
1553
  return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1554
1554
  }
1555
1555
  function eu(e, t, n) {
1556
- let r = !kg(t);
1556
+ let r = !Eg(t);
1557
1557
  return e && (r || n == !1) ? Ig(e, t) : t;
1558
1558
  }
1559
- const cl = (e) => e instanceof Et ? { ...e } : e;
1559
+ const cl = (e) => e instanceof kt ? { ...e } : e;
1560
1560
  function Vn(e, t) {
1561
1561
  t = t || {};
1562
1562
  const n = {};
@@ -1624,7 +1624,7 @@ function Vn(e, t) {
1624
1624
  const tu = (e) => {
1625
1625
  const t = Vn({}, e);
1626
1626
  let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: a } = t;
1627
- if (t.headers = i = Et.from(i), t.url = Yc(eu(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1627
+ if (t.headers = i = kt.from(i), t.url = Yc(eu(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1628
1628
  "Authorization",
1629
1629
  "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1630
1630
  ), j.isFormData(n)) {
@@ -1638,7 +1638,7 @@ const tu = (e) => {
1638
1638
  }
1639
1639
  }
1640
1640
  if (wt.hasStandardBrowserEnv && (r && j.isFunction(r) && (r = r(t)), r || r !== !1 && Rg(t.url))) {
1641
- const l = o && s && Eg.read(s);
1641
+ const l = o && s && kg.read(s);
1642
1642
  l && i.set(o, l);
1643
1643
  }
1644
1644
  return t;
@@ -1646,7 +1646,7 @@ const tu = (e) => {
1646
1646
  return new Promise(function(n, r) {
1647
1647
  const o = tu(e);
1648
1648
  let s = o.data;
1649
- const i = Et.from(o.headers).normalize();
1649
+ const i = kt.from(o.headers).normalize();
1650
1650
  let { responseType: a, onUploadProgress: l, onDownloadProgress: u } = o, d, f, h, p, w;
1651
1651
  function v() {
1652
1652
  p && p(), w && w(), o.cancelToken && o.cancelToken.unsubscribe(d), o.signal && o.signal.removeEventListener("abort", d);
@@ -1656,7 +1656,7 @@ const tu = (e) => {
1656
1656
  function x() {
1657
1657
  if (!g)
1658
1658
  return;
1659
- const S = Et.from(
1659
+ const S = kt.from(
1660
1660
  "getAllResponseHeaders" in g && g.getAllResponseHeaders()
1661
1661
  ), C = {
1662
1662
  data: !a || a === "text" || a === "json" ? g.responseText : g.response,
@@ -1666,10 +1666,10 @@ const tu = (e) => {
1666
1666
  config: e,
1667
1667
  request: g
1668
1668
  };
1669
- Qc(function(E) {
1670
- n(E), v();
1671
- }, function(E) {
1672
- r(E), v();
1669
+ Qc(function(k) {
1670
+ n(k), v();
1671
+ }, function(k) {
1672
+ r(k), v();
1673
1673
  }, C), g = null;
1674
1674
  }
1675
1675
  "onloadend" in g ? g.onloadend = x : g.onreadystatechange = function() {
@@ -1848,12 +1848,12 @@ const tu = (e) => {
1848
1848
  timeout: R,
1849
1849
  onDownloadProgress: C,
1850
1850
  onUploadProgress: T,
1851
- responseType: E,
1851
+ responseType: k,
1852
1852
  headers: I,
1853
1853
  withCredentials: A = "same-origin",
1854
1854
  fetchOptions: _
1855
1855
  } = tu(w), D = t || fetch;
1856
- E = E ? (E + "").toLowerCase() : "text";
1856
+ k = k ? (k + "").toLowerCase() : "text";
1857
1857
  let L = _g([y, S && S.toAbortSignal()], R), W = null;
1858
1858
  const P = L && L.unsubscribe && (() => {
1859
1859
  L.unsubscribe();
@@ -1886,7 +1886,7 @@ const tu = (e) => {
1886
1886
  };
1887
1887
  W = s && new n(v, J);
1888
1888
  let z = await (s ? D(W, _) : D(v, J));
1889
- const $ = d && (E === "stream" || E === "response");
1889
+ const $ = d && (k === "stream" || k === "response");
1890
1890
  if (d && (C || $ && P)) {
1891
1891
  const B = {};
1892
1892
  ["status", "statusText", "headers"].forEach((Ie) => {
@@ -1903,12 +1903,12 @@ const tu = (e) => {
1903
1903
  B
1904
1904
  );
1905
1905
  }
1906
- E = E || "text";
1907
- let F = await f[j.findKey(f, E) || "text"](z, w);
1906
+ k = k || "text";
1907
+ let F = await f[j.findKey(f, k) || "text"](z, w);
1908
1908
  return !$ && P && P(), await new Promise((B, pe) => {
1909
1909
  Qc(B, pe, {
1910
1910
  data: F,
1911
- headers: Et.from(z.headers),
1911
+ headers: kt.from(z.headers),
1912
1912
  status: z.status,
1913
1913
  statusText: z.statusText,
1914
1914
  config: w,
@@ -1989,7 +1989,7 @@ function Us(e) {
1989
1989
  throw new Cr(null, e);
1990
1990
  }
1991
1991
  function gl(e) {
1992
- return Us(e), e.headers = Et.from(e.headers), e.data = Hs.call(
1992
+ return Us(e), e.headers = kt.from(e.headers), e.data = Hs.call(
1993
1993
  e,
1994
1994
  e.transformRequest
1995
1995
  ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), ru.getAdapter(e.adapter || to.adapter, e)(e).then(function(r) {
@@ -1997,13 +1997,13 @@ function gl(e) {
1997
1997
  e,
1998
1998
  e.transformResponse,
1999
1999
  r
2000
- ), r.headers = Et.from(r.headers), r;
2000
+ ), r.headers = kt.from(r.headers), r;
2001
2001
  }, function(r) {
2002
2002
  return Zc(r) || (Us(e), r && r.response && (r.response.data = Hs.call(
2003
2003
  e,
2004
2004
  e.transformResponse,
2005
2005
  r.response
2006
- ), r.response.headers = Et.from(r.response.headers))), Promise.reject(r);
2006
+ ), r.response.headers = kt.from(r.response.headers))), Promise.reject(r);
2007
2007
  });
2008
2008
  }
2009
2009
  const ou = "1.12.2", ls = {};
@@ -2112,7 +2112,7 @@ let Un = class {
2112
2112
  (w) => {
2113
2113
  delete s[w];
2114
2114
  }
2115
- ), n.headers = Et.concat(i, s);
2115
+ ), n.headers = kt.concat(i, s);
2116
2116
  const a = [];
2117
2117
  let l = !0;
2118
2118
  this.interceptors.request.forEach(function(v) {
@@ -2349,7 +2349,7 @@ ut.all = function(t) {
2349
2349
  ut.spread = Bg;
2350
2350
  ut.isAxiosError = Hg;
2351
2351
  ut.mergeConfig = Vn;
2352
- ut.AxiosHeaders = Et;
2352
+ ut.AxiosHeaders = kt;
2353
2353
  ut.formToJSON = (e) => Jc(j.isHTMLForm(e) ? new FormData(e) : e);
2354
2354
  ut.getAdapter = ru.getAdapter;
2355
2355
  ut.HttpStatusCode = Ti;
@@ -2853,12 +2853,15 @@ function ox(e, t) {
2853
2853
  i.text = s;
2854
2854
  continue;
2855
2855
  }
2856
- if (a.includes(s) && s.length <= 3) {
2857
- console.debug("[MessageReducer] previous includes incoming - skipping trivial incoming", { incomingLength: s.length, previousLength: a.length });
2856
+ const l = 3, u = /^[^\w\s]+$/.test(s);
2857
+ if (a.includes(s) && s.length <= l && !u)
2858
2858
  continue;
2859
- }
2860
- const u = sx(a, s);
2861
- u ? i.text = a + u : i.text = a + s;
2859
+ const d = sx(a, s);
2860
+ if (d) {
2861
+ const f = d.length / Math.max(1, s.length);
2862
+ d.length > 0 && f <= 0.6 ? i.text = a + d : i.text = s;
2863
+ } else
2864
+ i.text = a + s;
2862
2865
  } else
2863
2866
  n.push({ type: "text", text: s });
2864
2867
  } else
@@ -2891,7 +2894,7 @@ function ax(e) {
2891
2894
  function lx(e = {}) {
2892
2895
  const t = at(() => gn(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = xe(e.token ?? null), s = Ge(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = xe(!1), [u, d] = xe(null), [f, h] = xe(""), [p, w] = xe(null), [v, g] = xe(0), [x, y] = xe(!1), S = Ge(null), R = Ge(!0), C = Ge(0), T = Me((_) => {
2893
2896
  o(_);
2894
- }, []), E = Me(() => {
2897
+ }, []), k = Me(() => {
2895
2898
  var _;
2896
2899
  (_ = S.current) == null || _.abort(), S.current = null, l(!1), y(!1), C.current = 0, g(0);
2897
2900
  }, []), I = Me(() => {
@@ -3065,7 +3068,7 @@ function lx(e = {}) {
3065
3068
  lastSeq: v,
3066
3069
  connected: x,
3067
3070
  stream: A,
3068
- stop: E,
3071
+ stop: k,
3069
3072
  clear: I,
3070
3073
  setToken: T
3071
3074
  };
@@ -3144,7 +3147,7 @@ function dx({
3144
3147
  [h, l, u, d, f]
3145
3148
  );
3146
3149
  }
3147
- const cu = Jr(null), uu = Jr(null), du = Jr(null), fx = Jr(!1), hx = 20, px = "cachedThreads", mx = "v1", To = 300, Ei = 200;
3150
+ const cu = Jr(null), uu = Jr(null), du = Jr(null), fx = Jr(!1), hx = 20, px = "cachedThreads", mx = "v1", To = 300, ki = 200;
3148
3151
  function Cl(e) {
3149
3152
  if (typeof window < "u" && "requestIdleCallback" in window)
3150
3153
  try {
@@ -3216,7 +3219,7 @@ function vx(e) {
3216
3219
  return [];
3217
3220
  }
3218
3221
  }
3219
- function ki(e, t) {
3222
+ function Ei(e, t) {
3220
3223
  try {
3221
3224
  fu(e, JSON.stringify(t));
3222
3225
  } catch {
@@ -3228,7 +3231,7 @@ function Tl(e) {
3228
3231
  const n = gx();
3229
3232
  if (n.length > 0)
3230
3233
  try {
3231
- ki(e, n.slice(0, Ei));
3234
+ Ei(e, n.slice(0, ki));
3232
3235
  } catch {
3233
3236
  }
3234
3237
  return n;
@@ -3258,9 +3261,9 @@ function wx({
3258
3261
  } catch {
3259
3262
  return "unknown";
3260
3263
  }
3261
- }, [u]), h = at(() => `threadPayload:${mx}:${f}:`, [f]), p = Me((k) => `${h}${k}`, [h]), w = Me((k) => {
3262
- if (!k || typeof k != "object") return null;
3263
- const b = k;
3264
+ }, [u]), h = at(() => `threadPayload:${mx}:${f}:`, [f]), p = Me((E) => `${h}${E}`, [h]), w = Me((E) => {
3265
+ if (!E || typeof E != "object") return null;
3266
+ const b = E;
3264
3267
  return typeof b.threadId != "string" || !Array.isArray(b.messages) ? null : {
3265
3268
  threadId: b.threadId,
3266
3269
  messages: b.messages,
@@ -3269,8 +3272,8 @@ function wx({
3269
3272
  checkpointId: b.checkpointId ?? null,
3270
3273
  checkpointNs: b.checkpointNs ?? null
3271
3274
  };
3272
- }, []), v = Me((k) => {
3273
- const b = na(p(k));
3275
+ }, []), v = Me((E) => {
3276
+ const b = na(p(E));
3274
3277
  if (!b) return null;
3275
3278
  try {
3276
3279
  const N = JSON.parse(b);
@@ -3278,39 +3281,39 @@ function wx({
3278
3281
  } catch {
3279
3282
  return null;
3280
3283
  }
3281
- }, [p, w]), g = Me((k, b = 100) => {
3284
+ }, [p, w]), g = Me((E, b = 100) => {
3282
3285
  const N = {
3283
- ...k,
3284
- messages: Array.isArray(k.messages) ? k.messages.slice(-b) : []
3286
+ ...E,
3287
+ messages: Array.isArray(E.messages) ? E.messages.slice(-b) : []
3285
3288
  };
3286
3289
  try {
3287
- fu(p(k.threadId), JSON.stringify(N));
3290
+ fu(p(E.threadId), JSON.stringify(N));
3288
3291
  } catch {
3289
3292
  }
3290
- }, [p]), x = Me((k) => {
3291
- qs(p(k));
3293
+ }, [p]), x = Me((E) => {
3294
+ qs(p(E));
3292
3295
  }, [p]), y = Me(() => {
3293
3296
  if (hr())
3294
3297
  try {
3295
- const k = h;
3298
+ const E = h;
3296
3299
  for (let b = 0; b < window.localStorage.length; b++) {
3297
3300
  const N = window.localStorage.key(b);
3298
- N && N.startsWith(k) && window.localStorage.removeItem(N);
3301
+ N && N.startsWith(E) && window.localStorage.removeItem(N);
3299
3302
  }
3300
3303
  } catch {
3301
3304
  }
3302
3305
  }, [h]), [S, R] = xe(
3303
3306
  () => {
3304
- var k;
3305
- return Gs(f, (k = l.getAuthToken) == null ? void 0 : k.call(l));
3307
+ var E;
3308
+ return Gs(f, (E = l.getAuthToken) == null ? void 0 : E.call(l));
3306
3309
  }
3307
3310
  ), [C, T] = xe(() => {
3308
3311
  var b;
3309
- const k = Tl(
3312
+ const E = Tl(
3310
3313
  Gs(f, (b = l.getAuthToken) == null ? void 0 : b.call(l))
3311
3314
  );
3312
- return Ys(k);
3313
- }), E = at(() => Xs(C), [C]), [I, A] = xe(t), [_, D] = xe(!1), [L, W] = xe(!1), [P, Y] = xe(!1), [K, J] = xe(!1), [z, $] = xe(null), [F, B] = xe(void 0), [pe, ue] = xe(void 0), {
3315
+ return Ys(E);
3316
+ }), k = at(() => Xs(C), [C]), [I, A] = xe(t), [_, D] = xe(!1), [L, W] = xe(!1), [P, Y] = xe(!1), [K, J] = xe(!1), [z, $] = xe(null), [F, B] = xe(void 0), [pe, ue] = xe(void 0), {
3314
3317
  state: ee,
3315
3318
  seed: Ie,
3316
3319
  prepend: Ce,
@@ -3321,11 +3324,11 @@ function wx({
3321
3324
  ct(() => {
3322
3325
  q.current = I;
3323
3326
  }, [I]);
3324
- const ce = Ge(!1), ie = Ge([]), $e = Ge(null), Ke = Ge(null), We = Ge(/* @__PURE__ */ new Map()), Te = Ge(I), Pe = Ge(!1), et = Ge(null), Fe = Me((k, b) => new Promise((N, M) => {
3327
+ const ce = Ge(!1), ie = Ge([]), $e = Ge(null), Ke = Ge(null), We = Ge(/* @__PURE__ */ new Map()), Te = Ge(I), Pe = Ge(!1), et = Ge(null), Fe = Me((E, b) => new Promise((N, M) => {
3325
3328
  const H = async () => {
3326
3329
  ce.current = !0;
3327
3330
  try {
3328
- await k(), N();
3331
+ await E(), N();
3329
3332
  } catch (X) {
3330
3333
  M(X);
3331
3334
  } finally {
@@ -3338,13 +3341,13 @@ function wx({
3338
3341
  ce.current ? ie.current.push(H) : H().catch((X) => {
3339
3342
  M(X);
3340
3343
  });
3341
- }), []), it = Ge(E.length), [ft, ne] = xe(!1), ae = Ge(!1);
3344
+ }), []), it = Ge(k.length), [ft, ne] = xe(!1), ae = Ge(!1);
3342
3345
  ct(() => {
3343
- it.current = E.length;
3344
- }, [E.length]);
3346
+ it.current = k.length;
3347
+ }, [k.length]);
3345
3348
  const de = Me(async () => {
3346
- const k = it.current > 0;
3347
- k || D(!0);
3349
+ const E = it.current > 0;
3350
+ E || D(!0);
3348
3351
  try {
3349
3352
  const b = await l.listThreads();
3350
3353
  zs(() => {
@@ -3356,14 +3359,14 @@ function wx({
3356
3359
  } catch (b) {
3357
3360
  i == null || i(String(b)), console.error("[ChatSessionProvider] Failed to refresh threads:", b);
3358
3361
  } finally {
3359
- k || D(!1);
3362
+ E || D(!1);
3360
3363
  }
3361
3364
  }, [l, i]), Ne = Ge(!1), he = Ge(null), me = Ge(null), He = Ge(""), Oe = Me(
3362
- (k, b) => {
3365
+ (E, b) => {
3363
3366
  if (!hr()) return;
3364
3367
  me.current !== null && (window.clearTimeout(me.current), me.current = null);
3365
- const N = k.map((H) => `${H.threadId}:${H.updatedAt ?? ""}:${H.messageCount ?? ""}`).join("|");
3366
- if (k.length === 0) {
3368
+ const N = E.map((H) => `${H.threadId}:${H.updatedAt ?? ""}:${H.messageCount ?? ""}`).join("|");
3369
+ if (E.length === 0) {
3367
3370
  try {
3368
3371
  qs(S);
3369
3372
  } catch {
@@ -3375,8 +3378,8 @@ function wx({
3375
3378
  return;
3376
3379
  const M = () => {
3377
3380
  try {
3378
- const H = k.slice(0, Ei);
3379
- ki(S, H), He.current = N;
3381
+ const H = E.slice(0, ki);
3382
+ Ei(S, H), He.current = N;
3380
3383
  } catch {
3381
3384
  } finally {
3382
3385
  me.current = null;
@@ -3392,23 +3395,23 @@ function wx({
3392
3395
  },
3393
3396
  [S]
3394
3397
  ), ot = Me(
3395
- (k, b, N) => {
3396
- const M = Array.isArray(k == null ? void 0 : k.messages) ? k.messages : [], H = N ?? (k == null ? void 0 : k.threadId) ?? q.current;
3398
+ (E, b, N) => {
3399
+ const M = Array.isArray(E == null ? void 0 : E.messages) ? E.messages : [], H = N ?? (E == null ? void 0 : E.threadId) ?? q.current;
3397
3400
  if (b === "replace") {
3398
3401
  if (H) {
3399
3402
  const X = {
3400
3403
  threadId: H,
3401
3404
  messages: M.slice(),
3402
- hasMore: !!(k != null && k.hasMore),
3403
- nextCursor: (k == null ? void 0 : k.nextCursor) ?? null,
3404
- checkpointId: (k == null ? void 0 : k.checkpointId) ?? null,
3405
- checkpointNs: (k == null ? void 0 : k.checkpointNs) ?? null
3405
+ hasMore: !!(E != null && E.hasMore),
3406
+ nextCursor: (E == null ? void 0 : E.nextCursor) ?? null,
3407
+ checkpointId: (E == null ? void 0 : E.checkpointId) ?? null,
3408
+ checkpointNs: (E == null ? void 0 : E.checkpointNs) ?? null
3406
3409
  };
3407
3410
  We.current.set(H, X), Te.current = H;
3408
3411
  }
3409
3412
  Ie(M, {
3410
- checkpointId: (k == null ? void 0 : k.checkpointId) ?? null,
3411
- checkpointNs: (k == null ? void 0 : k.checkpointNs) ?? null
3413
+ checkpointId: (E == null ? void 0 : E.checkpointId) ?? null,
3414
+ checkpointNs: (E == null ? void 0 : E.checkpointNs) ?? null
3412
3415
  });
3413
3416
  } else if (b === "prepend" && M.length && H) {
3414
3417
  const X = We.current.get(H), Se = (X == null ? void 0 : X.messages) ?? [], we = /* @__PURE__ */ new Set(), ge = [...M, ...Se].filter((Je) => {
@@ -3417,49 +3420,49 @@ function wx({
3417
3420
  }), qe = {
3418
3421
  threadId: H,
3419
3422
  messages: ge,
3420
- hasMore: (k == null ? void 0 : k.hasMore) ?? (X == null ? void 0 : X.hasMore) ?? !1,
3421
- nextCursor: (k == null ? void 0 : k.nextCursor) ?? (X == null ? void 0 : X.nextCursor) ?? null,
3422
- checkpointId: (X == null ? void 0 : X.checkpointId) ?? (k == null ? void 0 : k.checkpointId) ?? null,
3423
- checkpointNs: (X == null ? void 0 : X.checkpointNs) ?? (k == null ? void 0 : k.checkpointNs) ?? null
3423
+ hasMore: (E == null ? void 0 : E.hasMore) ?? (X == null ? void 0 : X.hasMore) ?? !1,
3424
+ nextCursor: (E == null ? void 0 : E.nextCursor) ?? (X == null ? void 0 : X.nextCursor) ?? null,
3425
+ checkpointId: (X == null ? void 0 : X.checkpointId) ?? (E == null ? void 0 : E.checkpointId) ?? null,
3426
+ checkpointNs: (X == null ? void 0 : X.checkpointNs) ?? (E == null ? void 0 : E.checkpointNs) ?? null
3424
3427
  };
3425
3428
  We.current.set(H, qe), Ce(M);
3426
3429
  } else b === "prepend" && M.length && Ce(M);
3427
- b === "replace" ? ($((k == null ? void 0 : k.nextCursor) ?? null), Y(!!(k != null && k.hasMore)), B((k == null ? void 0 : k.checkpointId) ?? void 0), ue((k == null ? void 0 : k.checkpointNs) ?? void 0)) : ($((X) => (k == null ? void 0 : k.nextCursor) ?? X ?? null), Y((X) => (k == null ? void 0 : k.hasMore) !== void 0 ? !!(k != null && k.hasMore) : X), B((X) => (k == null ? void 0 : k.checkpointId) ?? X ?? void 0), ue((X) => (k == null ? void 0 : k.checkpointNs) ?? X ?? void 0));
3430
+ b === "replace" ? ($((E == null ? void 0 : E.nextCursor) ?? null), Y(!!(E != null && E.hasMore)), B((E == null ? void 0 : E.checkpointId) ?? void 0), ue((E == null ? void 0 : E.checkpointNs) ?? void 0)) : ($((X) => (E == null ? void 0 : E.nextCursor) ?? X ?? null), Y((X) => (E == null ? void 0 : E.hasMore) !== void 0 ? !!(E != null && E.hasMore) : X), B((X) => (E == null ? void 0 : E.checkpointId) ?? X ?? void 0), ue((X) => (E == null ? void 0 : E.checkpointNs) ?? X ?? void 0));
3428
3431
  },
3429
3432
  [Ce, Ie]
3430
3433
  ), gt = Me(
3431
- (k) => {
3432
- Ie(k.messages, {
3433
- checkpointId: k.checkpointId,
3434
- checkpointNs: k.checkpointNs
3435
- }), $(k.nextCursor), Y(k.hasMore), B(k.checkpointId ?? void 0), ue(k.checkpointNs ?? void 0), Te.current = k.threadId;
3434
+ (E) => {
3435
+ Ie(E.messages, {
3436
+ checkpointId: E.checkpointId,
3437
+ checkpointNs: E.checkpointNs
3438
+ }), $(E.nextCursor), Y(E.hasMore), B(E.checkpointId ?? void 0), ue(E.checkpointNs ?? void 0), Te.current = E.threadId;
3436
3439
  },
3437
3440
  [Ie]
3438
- ), It = Me((k) => {
3439
- k && (We.current.delete(k), x(k), Te.current === k && (Te.current = null));
3441
+ ), It = Me((E) => {
3442
+ E && (We.current.delete(E), x(E), Te.current === E && (Te.current = null));
3440
3443
  }, [x]), Qt = Me(() => {
3441
- const k = q.current;
3442
- k && It(k), Q([]), Y(!1), J(!1), $(null), B(void 0), ue(void 0);
3443
- }, [It, Q]), On = Me(({ from: k, to: b }) => {
3444
+ const E = q.current;
3445
+ E && It(E), Q([]), Y(!1), J(!1), $(null), B(void 0), ue(void 0);
3446
+ }, [It, Q]), On = Me(({ from: E, to: b }) => {
3444
3447
  const N = q.current;
3445
3448
  N && console.warn(
3446
- `[ChatSessionProvider] Stream sequence gap detected (${k} -> ${b}) for thread ${N}`
3449
+ `[ChatSessionProvider] Stream sequence gap detected (${E} -> ${b}) for thread ${N}`
3447
3450
  );
3448
3451
  }, []), or = Me(
3449
- (k) => {
3450
- const b = k.threadId;
3452
+ (E) => {
3453
+ const b = E.threadId;
3451
3454
  console.log("[ChatSessionProvider] 📥 Handling thread_info event:", {
3452
3455
  threadId: b,
3453
- title: k.title,
3454
- created: k.created,
3455
- currentThreads: E.length
3456
+ title: E.title,
3457
+ created: E.created,
3458
+ currentThreads: k.length
3456
3459
  });
3457
3460
  const N = {
3458
3461
  threadId: b,
3459
- title: k.title || `Thread ${b.slice(0, 8)}`,
3460
- createdAt: k.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
3461
- updatedAt: k.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3462
- messageCount: k.messageCount || 0
3462
+ title: E.title || `Thread ${b.slice(0, 8)}`,
3463
+ createdAt: E.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
3464
+ updatedAt: E.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3465
+ messageCount: E.messageCount || 0
3463
3466
  };
3464
3467
  q.current !== b && (!q.current && ee.messages.length <= 1 && (Ke.current = b), A(b)), zs(() => {
3465
3468
  T((M) => {
@@ -3479,8 +3482,8 @@ function wx({
3479
3482
  baseUrl: d,
3480
3483
  onThreadInfo: or,
3481
3484
  onMessageEvent: O,
3482
- onUnhandledEvent: (k) => {
3483
- console.warn(`[ChatSessionProvider] Unhandled stream event: ${k.type}`, k);
3485
+ onUnhandledEvent: (E) => {
3486
+ console.warn(`[ChatSessionProvider] Unhandled stream event: ${E.type}`, E);
3484
3487
  },
3485
3488
  onSequenceGap: On
3486
3489
  });
@@ -3489,8 +3492,8 @@ function wx({
3489
3492
  }, [en]), ct(() => {
3490
3493
  if (!hr()) return;
3491
3494
  me.current !== null && (window.clearTimeout(me.current), me.current = null);
3492
- const k = E.map((N) => `${N.threadId}:${N.updatedAt ?? ""}:${N.messageCount ?? ""}`).join("|");
3493
- if (E.length === 0) {
3495
+ const E = k.map((N) => `${N.threadId}:${N.updatedAt ?? ""}:${N.messageCount ?? ""}`).join("|");
3496
+ if (k.length === 0) {
3494
3497
  try {
3495
3498
  qs(S);
3496
3499
  } catch {
@@ -3498,12 +3501,12 @@ function wx({
3498
3501
  He.current = "";
3499
3502
  return;
3500
3503
  }
3501
- if (k === He.current)
3504
+ if (E === He.current)
3502
3505
  return;
3503
3506
  const b = () => {
3504
3507
  try {
3505
- const N = E.slice(0, Ei);
3506
- ki(S, N), He.current = k;
3508
+ const N = k.slice(0, ki);
3509
+ Ei(S, N), He.current = E;
3507
3510
  } catch {
3508
3511
  } finally {
3509
3512
  me.current = null;
@@ -3514,10 +3517,10 @@ function wx({
3514
3517
  }, To), () => {
3515
3518
  me.current !== null && (window.clearTimeout(me.current), me.current = null);
3516
3519
  };
3517
- }, [E, Oe]), ct(() => {
3520
+ }, [k, Oe]), ct(() => {
3518
3521
  var M;
3519
- const k = l.getAuthToken();
3520
- Mt(k);
3522
+ const E = l.getAuthToken();
3523
+ Mt(E);
3521
3524
  const b = (H) => {
3522
3525
  const X = Gs(f, H);
3523
3526
  et.current !== X && (et.current = X, Pe.current = !1), R(X);
@@ -3527,7 +3530,7 @@ function wx({
3527
3530
  }), Pe.current || (Pe.current = !0, de().catch(() => {
3528
3531
  }));
3529
3532
  };
3530
- b(k);
3533
+ b(E);
3531
3534
  const N = (M = l.onTokenChange) == null ? void 0 : M.call(l, (H) => {
3532
3535
  Mt(H), y(), b(H);
3533
3536
  });
@@ -3536,10 +3539,10 @@ function wx({
3536
3539
  };
3537
3540
  }, [l, f, Mt, y, de]);
3538
3541
  const bn = Me(
3539
- async (k) => {
3542
+ async (E) => {
3540
3543
  const b = `temp-${Date.now()}`, N = {
3541
3544
  threadId: b,
3542
- title: k || "New Chat",
3545
+ title: E || "New Chat",
3543
3546
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
3544
3547
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
3545
3548
  messageCount: 0
@@ -3549,7 +3552,7 @@ function wx({
3549
3552
  order: [b, ...M.order]
3550
3553
  })), A(b);
3551
3554
  try {
3552
- const M = await l.createThread(k), H = typeof M == "string" ? M : M.threadId;
3555
+ const M = await l.createThread(E), H = typeof M == "string" ? M : M.threadId;
3553
3556
  return T((X) => {
3554
3557
  const Se = X.byId[b];
3555
3558
  if (!Se) return X;
@@ -3570,25 +3573,25 @@ function wx({
3570
3573
  },
3571
3574
  [l, de]
3572
3575
  ), yn = Me(
3573
- async (k) => {
3574
- await l.deleteThread(k);
3576
+ async (E) => {
3577
+ await l.deleteThread(E);
3575
3578
  let b = null;
3576
3579
  T((N) => {
3577
- if (!N.byId[k]) return N;
3580
+ if (!N.byId[E]) return N;
3578
3581
  const M = { ...N.byId };
3579
- delete M[k];
3580
- const H = N.order.filter((Se) => Se !== k), X = { byId: M, order: H };
3582
+ delete M[E];
3583
+ const H = N.order.filter((Se) => Se !== E), X = { byId: M, order: H };
3581
3584
  return b = Xs(X), X;
3582
- }), b && Oe(b, { immediate: !0 }), It(k), q.current === k && (Ke.current = k, A(null), q.current = null, Te.current = null, Qt()), await de();
3585
+ }), b && Oe(b, { immediate: !0 }), It(E), q.current === E && (Ke.current = E, A(null), q.current = null, Te.current = null, Qt()), await de();
3583
3586
  },
3584
3587
  [l, Qt, It, de, Oe]
3585
3588
  ), Dn = Me(
3586
- async (k, b) => {
3589
+ async (E, b) => {
3587
3590
  try {
3588
- await l.updateThread(k, b), T((N) => {
3589
- const M = N.byId[k];
3591
+ await l.updateThread(E, b), T((N) => {
3592
+ const M = N.byId[E];
3590
3593
  return M ? {
3591
- byId: { ...N.byId, [k]: { ...M, title: b } },
3594
+ byId: { ...N.byId, [E]: { ...M, title: b } },
3592
3595
  order: N.order
3593
3596
  } : N;
3594
3597
  });
@@ -3598,35 +3601,35 @@ function wx({
3598
3601
  },
3599
3602
  [l, de]
3600
3603
  ), Dt = Me(
3601
- async (k, b, N, M = !1) => {
3604
+ async (E, b, N, M = !1) => {
3602
3605
  await Fe(async () => {
3603
- if (Ke.current === k && !M) {
3606
+ if (Ke.current === E && !M) {
3604
3607
  Ke.current = null;
3605
3608
  return;
3606
3609
  }
3607
- if ($e.current === k && !M)
3610
+ if ($e.current === E && !M)
3608
3611
  return;
3609
- A((ge) => ge === k ? ge : k), q.current = k;
3612
+ A((ge) => ge === E ? ge : E), q.current = E;
3610
3613
  const H = !M && !b && !N;
3611
3614
  let X = !1;
3612
3615
  if (H) {
3613
- const ge = We.current.get(k);
3616
+ const ge = We.current.get(E);
3614
3617
  if (ge)
3615
3618
  gt(ge), X = !0;
3616
3619
  else {
3617
- const qe = v(k);
3618
- qe && (We.current.set(k, qe), gt(qe), X = !0);
3620
+ const qe = v(E);
3621
+ qe && (We.current.set(E, qe), gt(qe), X = !0);
3619
3622
  }
3620
3623
  }
3621
3624
  const Se = M || !X || !!b || !!N, we = async (ge) => {
3622
- ge && W(!0), $e.current = k;
3625
+ ge && W(!0), $e.current = E;
3623
3626
  try {
3624
3627
  const qe = await l.getMessages({
3625
- threadId: k,
3628
+ threadId: E,
3626
3629
  checkpointId: b,
3627
3630
  checkpointNs: N
3628
3631
  });
3629
- ot(qe, "replace", k);
3632
+ ot(qe, "replace", E);
3630
3633
  } catch (qe) {
3631
3634
  throw (!X || M || ge) && (i == null || i(String(qe))), qe;
3632
3635
  } finally {
@@ -3636,13 +3639,13 @@ function wx({
3636
3639
  Se ? await we(!0) : H && X && we(!1).catch((ge) => {
3637
3640
  console.warn("[ChatSessionProvider] Background refresh failed:", ge);
3638
3641
  });
3639
- }, `loadThread-${k}`);
3642
+ }, `loadThread-${E}`);
3640
3643
  },
3641
3644
  [l, gt, ot, Fe, i]
3642
3645
  ), Ln = Me(async () => {
3643
3646
  await Fe(async () => {
3644
- const k = q.current;
3645
- k && It(k), Ke.current = null, A(null), q.current = null, Te.current = null, Qt(), B(void 0), ue(void 0);
3647
+ const E = q.current;
3648
+ E && It(E), Ke.current = null, A(null), q.current = null, Te.current = null, Qt(), B(void 0), ue(void 0);
3646
3649
  try {
3647
3650
  localStorage.removeItem("lastThreadId");
3648
3651
  } catch (b) {
@@ -3650,22 +3653,22 @@ function wx({
3650
3653
  }
3651
3654
  }, "clearCurrentThread");
3652
3655
  }, [Qt, It, Fe]), ir = Me(
3653
- async (k) => {
3654
- const b = await l.listCheckpoints(k);
3655
- return Yg(b, k);
3656
+ async (E) => {
3657
+ const b = await l.listCheckpoints(E);
3658
+ return Yg(b, E);
3656
3659
  },
3657
3660
  [l]
3658
3661
  ), re = Me(
3659
- async (k, b) => {
3662
+ async (E, b) => {
3660
3663
  if (!q.current) throw new Error("No active thread");
3661
- await Dt(q.current, k, b ?? void 0, !0);
3664
+ await Dt(q.current, E, b ?? void 0, !0);
3662
3665
  },
3663
3666
  [Dt]
3664
3667
  ), ve = Me(async () => {
3665
3668
  if (!q.current) throw new Error("No active thread");
3666
3669
  await Dt(q.current, void 0, void 0, !0);
3667
3670
  }, [Dt]), Le = Me(
3668
- async (k) => {
3671
+ async (E) => {
3669
3672
  if (!q.current) throw new Error("No active thread");
3670
3673
  if (K || !P) return;
3671
3674
  const b = z;
@@ -3676,7 +3679,7 @@ function wx({
3676
3679
  threadId: N,
3677
3680
  checkpointId: F,
3678
3681
  checkpointNs: pe,
3679
- limit: (k == null ? void 0 : k.limit) ?? hx,
3682
+ limit: (E == null ? void 0 : E.limit) ?? hx,
3680
3683
  beforeId: b
3681
3684
  });
3682
3685
  ot(M, "prepend", N ?? void 0);
@@ -3695,7 +3698,7 @@ function wx({
3695
3698
  K
3696
3699
  ]
3697
3700
  ), Xe = Me(
3698
- async (k, b) => {
3701
+ async (E, b) => {
3699
3702
  var St;
3700
3703
  const N = q.current;
3701
3704
  !N && !(b != null && b.payloadExtras) && console.warn("[ChatSessionProvider] No thread ID - message will create new thread");
@@ -3703,7 +3706,7 @@ function wx({
3703
3706
  l,
3704
3707
  M
3705
3708
  ), Se = [...H];
3706
- k && k.trim() && Se.push({ type: "text", text: k.trim() });
3709
+ E && E.trim() && Se.push({ type: "text", text: E.trim() });
3707
3710
  const we = {
3708
3711
  id: ((St = crypto.randomUUID) == null ? void 0 : St.call(crypto)) || `user-${Date.now()}`,
3709
3712
  role: "user",
@@ -3748,7 +3751,7 @@ function wx({
3748
3751
  wn
3749
3752
  ]
3750
3753
  ), xt = Me(
3751
- async (k, b, N) => {
3754
+ async (E, b, N) => {
3752
3755
  const M = q.current;
3753
3756
  if (!M)
3754
3757
  throw new Error("No active thread to handle interrupt");
@@ -3756,7 +3759,7 @@ function wx({
3756
3759
  const H = b ? N ?? !0 : !1;
3757
3760
  await l.resume({ threadId: M, value: H });
3758
3761
  } catch (H) {
3759
- throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${k}:`, H), H;
3762
+ throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${E}:`, H), H;
3760
3763
  }
3761
3764
  },
3762
3765
  [l]
@@ -3765,8 +3768,8 @@ function wx({
3765
3768
  if (a == null || a(I), I)
3766
3769
  try {
3767
3770
  localStorage.setItem("lastThreadId", I);
3768
- } catch (k) {
3769
- console.warn("[ChatSessionProvider] Failed to persist lastThreadId:", k);
3771
+ } catch (E) {
3772
+ console.warn("[ChatSessionProvider] Failed to persist lastThreadId:", E);
3770
3773
  }
3771
3774
  }, [I, a]), ct(() => ((async () => {
3772
3775
  try {
@@ -3785,20 +3788,20 @@ function wx({
3785
3788
  }
3786
3789
  })(), () => {
3787
3790
  }), []), ct(() => {
3788
- const k = q.current;
3789
- if (!k || Te.current !== k) return;
3791
+ const E = q.current;
3792
+ if (!E || Te.current !== E) return;
3790
3793
  const b = {
3791
- threadId: k,
3794
+ threadId: E,
3792
3795
  messages: ee.messages.slice(),
3793
3796
  hasMore: P,
3794
3797
  nextCursor: z,
3795
3798
  checkpointId: ee.lastCheckpointId ?? null,
3796
3799
  checkpointNs: ee.lastCheckpointNs ?? null
3797
- }, N = We.current.get(k);
3800
+ }, N = We.current.get(E);
3798
3801
  (!N || N.messages.length !== b.messages.length || N.messages.some((H, X) => {
3799
3802
  var Se;
3800
3803
  return (H == null ? void 0 : H.id) !== ((Se = b.messages[X]) == null ? void 0 : Se.id);
3801
- }) || (N == null ? void 0 : N.hasMore) !== b.hasMore || (N == null ? void 0 : N.nextCursor) !== b.nextCursor || (N == null ? void 0 : N.checkpointId) !== b.checkpointId || (N == null ? void 0 : N.checkpointNs) !== b.checkpointNs) && (We.current.set(k, b), he.current && window.clearTimeout(he.current), he.current = window.setTimeout(() => {
3804
+ }) || (N == null ? void 0 : N.hasMore) !== b.hasMore || (N == null ? void 0 : N.nextCursor) !== b.nextCursor || (N == null ? void 0 : N.checkpointId) !== b.checkpointId || (N == null ? void 0 : N.checkpointNs) !== b.checkpointNs) && (We.current.set(E, b), he.current && window.clearTimeout(he.current), he.current = window.setTimeout(() => {
3802
3805
  try {
3803
3806
  g(b, 100);
3804
3807
  } catch (H) {
@@ -3814,7 +3817,7 @@ function wx({
3814
3817
  ]);
3815
3818
  const Vt = at(
3816
3819
  () => ({
3817
- threads: E,
3820
+ threads: k,
3818
3821
  currentThreadId: I,
3819
3822
  isLoadingThreads: _,
3820
3823
  isLoadingThread: L,
@@ -3842,7 +3845,7 @@ function wx({
3842
3845
  de,
3843
3846
  Dn,
3844
3847
  ve,
3845
- E
3848
+ k
3846
3849
  ]
3847
3850
  ), $n = at(
3848
3851
  () => ({
@@ -4032,7 +4035,7 @@ function Sx({
4032
4035
  I.key === "Enter" && !I.shiftKey ? (I.preventDefault(), y()) : I.key === "Escape" && t && (I.preventDefault(), a == null || a());
4033
4036
  },
4034
4037
  [y, t, a]
4035
- ), E = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${d}`;
4038
+ ), k = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${d}`;
4036
4039
  return /* @__PURE__ */ c.jsx("form", { onSubmit: (I) => void y(I), className: `w-full ${u}`, children: /* @__PURE__ */ c.jsxs("div", { className: "flex items-end gap-2", children: [
4037
4040
  /* @__PURE__ */ c.jsx("div", { className: "flex-1", children: /* @__PURE__ */ c.jsx(
4038
4041
  pu,
@@ -4042,7 +4045,7 @@ function Sx({
4042
4045
  onChange: S,
4043
4046
  onKeyDown: R,
4044
4047
  placeholder: t ? "Edit your message..." : n,
4045
- className: E,
4048
+ className: k,
4046
4049
  disabled: o,
4047
4050
  maxLength: s,
4048
4051
  rows: 1,
@@ -4087,7 +4090,7 @@ function Tx(e) {
4087
4090
  function gu(e, t) {
4088
4091
  return (n) => e(t(n));
4089
4092
  }
4090
- function El(e, t) {
4093
+ function kl(e, t) {
4091
4094
  return () => e(t);
4092
4095
  }
4093
4096
  function Rx(e, t) {
@@ -4096,7 +4099,7 @@ function Rx(e, t) {
4096
4099
  function oa(e) {
4097
4100
  return e !== void 0;
4098
4101
  }
4099
- function Ex(...e) {
4102
+ function kx(...e) {
4100
4103
  return () => {
4101
4104
  e.map(Tx);
4102
4105
  };
@@ -4106,7 +4109,7 @@ function Rr() {
4106
4109
  function us(e, t) {
4107
4110
  return t(e), e;
4108
4111
  }
4109
- function kx(e, t) {
4112
+ function Ex(e, t) {
4110
4113
  return t(e);
4111
4114
  }
4112
4115
  function rt(...e) {
@@ -4133,7 +4136,7 @@ function qt(e, t) {
4133
4136
  });
4134
4137
  return n;
4135
4138
  }
4136
- function kl(e) {
4139
+ function El(e) {
4137
4140
  let t, n;
4138
4141
  return (r) => (o) => {
4139
4142
  t = o, n && clearTimeout(n), n = setTimeout(() => {
@@ -4150,7 +4153,7 @@ function nt(e = xu) {
4150
4153
  e(t, r) || (t = r, n(r));
4151
4154
  };
4152
4155
  }
4153
- function Ee(e) {
4156
+ function ke(e) {
4154
4157
  return (t) => (n) => {
4155
4158
  e(n) && t(n);
4156
4159
  };
@@ -4211,7 +4214,7 @@ function De(...e) {
4211
4214
  };
4212
4215
  }
4213
4216
  function Ix(...e) {
4214
- return (t) => e.reduceRight(kx, t);
4217
+ return (t) => e.reduceRight(Ex, t);
4215
4218
  }
4216
4219
  function Nx(e) {
4217
4220
  let t, n;
@@ -4317,11 +4320,11 @@ function Ii(...e) {
4317
4320
  case Tr:
4318
4321
  return;
4319
4322
  case Nn:
4320
- return Ex(...e.map((r) => Ye(r, n)));
4323
+ return kx(...e.map((r) => Ye(r, n)));
4321
4324
  }
4322
4325
  };
4323
4326
  }
4324
- var kt = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e))(kt || {});
4327
+ var Et = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e))(Et || {});
4325
4328
  const jx = {
4326
4329
  0: "debug",
4327
4330
  3: "error",
@@ -4402,7 +4405,7 @@ function Mx(e, t, n, r) {
4402
4405
  if (a.dataset.index === void 0)
4403
4406
  continue;
4404
4407
  const l = parseInt(a.dataset.index), u = parseFloat(a.dataset.knownSize), d = t(a, n);
4405
- if (d === 0 && r("Zero-sized element, this should not happen", { child: a }, kt.ERROR), d === u)
4408
+ if (d === 0 && r("Zero-sized element, this should not happen", { child: a }, Et.ERROR), d === u)
4406
4409
  continue;
4407
4410
  const f = s[s.length - 1];
4408
4411
  s.length === 0 || f.size !== d || f.endIndex !== l - 1 ? s.push({ endIndex: l, size: d, startIndex: l }) : s[s.length - 1].endIndex++;
@@ -4410,7 +4413,7 @@ function Mx(e, t, n, r) {
4410
4413
  return s;
4411
4414
  }
4412
4415
  function Il(e, t, n) {
4413
- return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
4416
+ return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Et.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
4414
4417
  }
4415
4418
  function vu(e, t, n) {
4416
4419
  const r = V.useRef(null), o = V.useCallback(
@@ -4716,7 +4719,7 @@ function Wr(e, t, n) {
4716
4719
  const { index: r, offset: o, size: s } = Ru(t, e, la), i = e - r, a = s * i + (i - 1) * n + o;
4717
4720
  return a > 0 ? a + n : a;
4718
4721
  }
4719
- function Eu(e, t) {
4722
+ function ku(e, t) {
4720
4723
  if (!fs(t))
4721
4724
  return e;
4722
4725
  let n = 0;
@@ -4724,12 +4727,12 @@ function Eu(e, t) {
4724
4727
  n++;
4725
4728
  return e + n;
4726
4729
  }
4727
- function ku(e, t, n) {
4730
+ function Eu(e, t, n) {
4728
4731
  if (zx(e))
4729
4732
  return t.groupIndices[e.groupIndex] + 1;
4730
4733
  {
4731
4734
  const r = e.index === "LAST" ? n : e.index;
4732
- let o = Eu(r, t);
4735
+ let o = ku(r, t);
4733
4736
  return o = Math.max(0, o, Math.min(n, o)), o;
4734
4737
  }
4735
4738
  }
@@ -4737,7 +4740,7 @@ function Hx(e, t, n, r = 0) {
4737
4740
  return r > 0 && (t = Math.max(t, Ru(e, r, la).offset)), wu(Lx(e, t, n, Bx), Vx);
4738
4741
  }
4739
4742
  function Ux(e, [t, n, r, o]) {
4740
- t.length > 0 && r("received item sizes", t, kt.DEBUG);
4743
+ t.length > 0 && r("received item sizes", t, Et.DEBUG);
4741
4744
  const s = e.sizeTree;
4742
4745
  let i = s, a = 0;
4743
4746
  if (n.length > 0 && Ze(s) && t.length === 2) {
@@ -4823,10 +4826,10 @@ const qx = {
4823
4826
  fe(
4824
4827
  U(
4825
4828
  l,
4826
- Ee((C) => C.length > 0),
4829
+ ke((C) => C.length > 0),
4827
4830
  De(v, p),
4828
- oe(([C, T, E]) => {
4829
- const I = C.reduce((A, _, D) => _t(A, _, Wr(_, T.offsetTree, E) || D), pr());
4831
+ oe(([C, T, k]) => {
4832
+ const I = C.reduce((A, _, D) => _t(A, _, Wr(_, T.offsetTree, k) || D), pr());
4830
4833
  return {
4831
4834
  ...T,
4832
4835
  groupIndices: C,
@@ -4839,11 +4842,11 @@ const qx = {
4839
4842
  U(
4840
4843
  r,
4841
4844
  De(v),
4842
- Ee(([C, { lastIndex: T }]) => C < T),
4843
- oe(([C, { lastIndex: T, lastSize: E }]) => [
4845
+ ke(([C, { lastIndex: T }]) => C < T),
4846
+ oe(([C, { lastIndex: T, lastSize: k }]) => [
4844
4847
  {
4845
4848
  endIndex: T,
4846
- size: E,
4849
+ size: k,
4847
4850
  startIndex: C
4848
4851
  }
4849
4852
  ])
@@ -4860,7 +4863,7 @@ const qx = {
4860
4863
  fe(
4861
4864
  U(
4862
4865
  d,
4863
- Ee((C) => C !== void 0 && Ze(lt(v).sizeTree)),
4866
+ ke((C) => C !== void 0 && Ze(lt(v).sizeTree)),
4864
4867
  oe((C) => [{ endIndex: 0, size: C, startIndex: 0 }])
4865
4868
  ),
4866
4869
  n
@@ -4870,9 +4873,9 @@ const qx = {
4870
4873
  n,
4871
4874
  De(v),
4872
4875
  sn(
4873
- ({ sizes: C }, [T, E]) => ({
4874
- changed: E !== C,
4875
- sizes: E
4876
+ ({ sizes: C }, [T, k]) => ({
4877
+ changed: k !== C,
4878
+ sizes: k
4876
4879
  }),
4877
4880
  { changed: !1, sizes: w }
4878
4881
  ),
@@ -4893,15 +4896,15 @@ const qx = {
4893
4896
  if (C > 0)
4894
4897
  je(t, !0), je(s, C + Al(C, T));
4895
4898
  else if (C < 0) {
4896
- const E = lt(g);
4897
- E.length > 0 && (C -= Al(-C, E)), je(i, C);
4899
+ const k = lt(g);
4900
+ k.length > 0 && (C -= Al(-C, k)), je(i, C);
4898
4901
  }
4899
4902
  }
4900
4903
  ), Ye(U(a, De(e)), ([C, T]) => {
4901
4904
  C < 0 && T(
4902
4905
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
4903
4906
  { firstItemIndex: a },
4904
- kt.ERROR
4907
+ Et.ERROR
4905
4908
  );
4906
4909
  });
4907
4910
  const S = jt(s);
@@ -4910,8 +4913,8 @@ const qx = {
4910
4913
  s,
4911
4914
  De(v),
4912
4915
  oe(([C, T]) => {
4913
- const E = T.groupIndices.length > 0, I = [], A = T.lastSize;
4914
- if (E) {
4916
+ const k = T.groupIndices.length > 0, I = [], A = T.lastSize;
4917
+ if (k) {
4915
4918
  const _ = Hr(T.sizeTree, 0);
4916
4919
  let D = 0, L = 0;
4917
4920
  for (; D < C; ) {
@@ -4970,9 +4973,9 @@ const qx = {
4970
4973
  U(
4971
4974
  i,
4972
4975
  De(v, p),
4973
- oe(([C, { offsetTree: T }, E]) => {
4976
+ oe(([C, { offsetTree: T }, k]) => {
4974
4977
  const I = -C;
4975
- return Wr(I, T, E);
4978
+ return Wr(I, T, k);
4976
4979
  })
4977
4980
  )
4978
4981
  );
@@ -4980,7 +4983,7 @@ const qx = {
4980
4983
  U(
4981
4984
  i,
4982
4985
  De(v, p),
4983
- oe(([C, T, E]) => {
4986
+ oe(([C, T, k]) => {
4984
4987
  if (T.groupIndices.length > 0) {
4985
4988
  if (Ze(T.sizeTree))
4986
4989
  return T;
@@ -5001,14 +5004,14 @@ const qx = {
5001
5004
  return {
5002
5005
  ...T,
5003
5006
  sizeTree: I,
5004
- ...ji(T.offsetTree, 0, I, E)
5007
+ ...ji(T.offsetTree, 0, I, k)
5005
5008
  };
5006
5009
  } else {
5007
5010
  const I = Hn(T.sizeTree).reduce((A, { k: _, v: D }) => _t(A, Math.max(0, _ + C), D), pr());
5008
5011
  return {
5009
5012
  ...T,
5010
5013
  sizeTree: I,
5011
- ...ji(T.offsetTree, 0, I, E)
5014
+ ...ji(T.offsetTree, 0, I, k)
5012
5015
  };
5013
5016
  }
5014
5017
  })
@@ -5066,7 +5069,7 @@ const Iu = Ve(
5066
5069
  ), fe(
5067
5070
  U(
5068
5071
  dt(o, t, r),
5069
- Ee(([l, u]) => fs(u)),
5072
+ ke(([l, u]) => fs(u)),
5070
5073
  oe(([l, u, d]) => Gt(u.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
5071
5074
  nt(),
5072
5075
  oe((l) => [l])
@@ -5080,12 +5083,12 @@ const Iu = Ve(
5080
5083
  const t = Z(!1), n = jt(
5081
5084
  U(
5082
5085
  t,
5083
- Ee((r) => r),
5086
+ ke((r) => r),
5084
5087
  nt()
5085
5088
  )
5086
5089
  );
5087
5090
  return Ye(t, (r) => {
5088
- r && lt(e)("props updated", {}, kt.DEBUG);
5091
+ r && lt(e)("props updated", {}, Et.DEBUG);
5089
5092
  }), { didMount: n, propsReady: t };
5090
5093
  },
5091
5094
  rt(An),
@@ -5122,16 +5125,16 @@ const no = Ve(
5122
5125
  De(e, s, o),
5123
5126
  oe(
5124
5127
  ([
5125
- [R, C, T, E, I, A, _, D],
5128
+ [R, C, T, k, I, A, _, D],
5126
5129
  L,
5127
5130
  W,
5128
5131
  P
5129
5132
  ]) => {
5130
- const Y = Nu(R), { align: K, behavior: J, offset: z } = Y, $ = E - 1, F = ku(Y, C, $);
5133
+ const Y = Nu(R), { align: K, behavior: J, offset: z } = Y, $ = k - 1, F = Eu(Y, C, $);
5131
5134
  let B = Wr(F, C.offsetTree, L) + A;
5132
5135
  K === "end" ? (B += W + Gt(C.sizeTree, F)[1] - T + P, F === $ && (B += _)) : K === "center" ? B += (W + Gt(C.sizeTree, F)[1] - T + P) / 2 : B -= I, z && (B += z);
5133
5136
  const pe = (ue) => {
5134
- S(), ue ? (D("retrying to scroll to", { location: R }, kt.DEBUG), je(p, R)) : (je(w, !0), D("list did not change, scroll successful", {}, kt.DEBUG));
5137
+ S(), ue ? (D("retrying to scroll to", { location: R }, Et.DEBUG), je(p, R)) : (je(w, !0), D("list did not change, scroll successful", {}, Et.DEBUG));
5135
5138
  };
5136
5139
  if (S(), J === "smooth") {
5137
5140
  let ue = !1;
@@ -5144,7 +5147,7 @@ const no = Ve(
5144
5147
  g = qt(U(t, Xx(150)), pe);
5145
5148
  return x = setTimeout(() => {
5146
5149
  S();
5147
- }, 1200), je(l, !0), D("scrolling from index to", { behavior: J, index: F, top: B }, kt.DEBUG), { behavior: J, top: B };
5150
+ }, 1200), je(l, !0), D("scrolling from index to", { behavior: J, index: F, top: B }, Et.DEBUG), { behavior: J, top: B };
5148
5151
  }
5149
5152
  )
5150
5153
  ),
@@ -5184,7 +5187,7 @@ const ro = Ve(
5184
5187
  U(
5185
5188
  i,
5186
5189
  De(l),
5187
- Ee(([d, f]) => !!f),
5190
+ ke(([d, f]) => !!f),
5188
5191
  rn(!1)
5189
5192
  ),
5190
5193
  a
@@ -5192,7 +5195,7 @@ const ro = Ve(
5192
5195
  U(
5193
5196
  i,
5194
5197
  De(l),
5195
- Ee(([d, f]) => !!f),
5198
+ ke(([d, f]) => !!f),
5196
5199
  rn(!1)
5197
5200
  ),
5198
5201
  u
@@ -5200,7 +5203,7 @@ const ro = Ve(
5200
5203
  U(
5201
5204
  dt(t, i),
5202
5205
  De(a, n, e, u),
5203
- Ee(([[, d], f, { sizeTree: h }, p, w]) => d && (!Ze(h) || oa(p)) && !f && !w),
5206
+ ke(([[, d], f, { sizeTree: h }, p, w]) => d && (!Ze(h) || oa(p)) && !f && !w),
5204
5207
  De(l)
5205
5208
  ),
5206
5209
  ([, d]) => {
@@ -5236,12 +5239,12 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5236
5239
  }, Qx = 0, oo = Ve(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
5237
5240
  const i = Z(!1), a = Z(!0), l = Be(), u = Be(), d = Z(4), f = Z(Qx), h = yt(
5238
5241
  U(
5239
- Ii(U(Re(o), qn(1), rn(!0)), U(Re(o), qn(1), rn(!1), kl(100))),
5242
+ Ii(U(Re(o), qn(1), rn(!0)), U(Re(o), qn(1), rn(!1), El(100))),
5240
5243
  nt()
5241
5244
  ),
5242
5245
  !1
5243
5246
  ), p = yt(
5244
- U(Ii(U(n, rn(!0)), U(n, rn(!1), kl(200))), nt()),
5247
+ U(Ii(U(n, rn(!0)), U(n, rn(!1), El(200))), nt()),
5245
5248
  !1
5246
5249
  );
5247
5250
  fe(
@@ -5255,7 +5258,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5255
5258
  const w = jt(
5256
5259
  U(
5257
5260
  dt(r, Re(s), Re(t), Re(e), Re(d)),
5258
- sn((y, [{ scrollHeight: S, scrollTop: R }, C, T, E, I]) => {
5261
+ sn((y, [{ scrollHeight: S, scrollTop: R }, C, T, k, I]) => {
5259
5262
  const A = R + C - S > -I, _ = {
5260
5263
  scrollHeight: S,
5261
5264
  scrollTop: R,
@@ -5308,7 +5311,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5308
5311
  },
5309
5312
  { changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
5310
5313
  ),
5311
- Ee((y) => y.changed),
5314
+ ke((y) => y.changed),
5312
5315
  oe((y) => y.jump)
5313
5316
  ),
5314
5317
  0
@@ -5338,7 +5341,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5338
5341
  return fe(
5339
5342
  U(
5340
5343
  h,
5341
- Ee((y) => !y),
5344
+ ke((y) => !y),
5342
5345
  rn(0)
5343
5346
  ),
5344
5347
  x
@@ -5347,7 +5350,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5347
5350
  o,
5348
5351
  mn(100),
5349
5352
  De(h),
5350
- Ee(([y, S]) => !!S),
5353
+ ke(([y, S]) => !!S),
5351
5354
  sn(([y, S], [R]) => [S, R], [0, 0]),
5352
5355
  oe(([y, S]) => S - y)
5353
5356
  ),
@@ -5401,15 +5404,15 @@ const da = Ve(
5401
5404
  S
5402
5405
  ]) => {
5403
5406
  const R = d - y, C = g + x, T = Math.max(h - R, 0);
5404
- let E = _l;
5407
+ let k = _l;
5405
5408
  const I = Pl(S, Fo), A = Pl(S, zo);
5406
- return p -= y, p += h + x, w += h + x, w -= y, p > d + C - I && (E = Vr), w < d - T + f + A && (E = Mr), E !== _l ? [
5407
- Math.max(R - h - jl(v, Fo, E) - I, 0),
5408
- R - T - x + f + jl(v, zo, E) + A
5409
+ return p -= y, p += h + x, w += h + x, w -= y, p > d + C - I && (k = Vr), w < d - T + f + A && (k = Mr), k !== _l ? [
5410
+ Math.max(R - h - jl(v, Fo, k) - I, 0),
5411
+ R - T - x + f + jl(v, zo, k) + A
5409
5412
  ] : null;
5410
5413
  }
5411
5414
  ),
5412
- Ee((d) => d != null),
5415
+ ke((d) => d != null),
5413
5416
  nt(Ur)
5414
5417
  ),
5415
5418
  [0, 0]
@@ -5429,7 +5432,7 @@ const da = Ve(
5429
5432
  );
5430
5433
  function ev(e, t, n) {
5431
5434
  if (fs(t)) {
5432
- const r = Eu(e, t);
5435
+ const r = ku(e, t);
5433
5436
  return [
5434
5437
  { index: Gt(t.groupOffsetTree, r)[0], offset: 0, size: 0 },
5435
5438
  { data: n == null ? void 0 : n[0], index: r, offset: 0, size: 0 }
@@ -5448,7 +5451,7 @@ const Qs = {
5448
5451
  topListHeight: 0,
5449
5452
  totalCount: 0
5450
5453
  };
5451
- function Eo(e, t, n, r, o, s) {
5454
+ function ko(e, t, n, r, o, s) {
5452
5455
  const { lastIndex: i, lastOffset: a, lastSize: l } = o;
5453
5456
  let u = 0, d = 0;
5454
5457
  if (e.length > 0) {
@@ -5483,7 +5486,7 @@ function _u(e, t, n, r, o, s) {
5483
5486
  offset: 0,
5484
5487
  size: 0
5485
5488
  }));
5486
- return Eo(u, [], a, o, n, r);
5489
+ return ko(u, [], a, o, n, r);
5487
5490
  }
5488
5491
  function Ol(e, t, n) {
5489
5492
  if (e.length === 0)
@@ -5539,15 +5542,15 @@ const er = Ve(
5539
5542
  Re(n),
5540
5543
  e
5541
5544
  ),
5542
- Ee(([T, E, , I, , , , , , , A]) => {
5545
+ ke(([T, k, , I, , , , , , , A]) => {
5543
5546
  const _ = A && A.length !== I;
5544
- return T && !E && !_;
5547
+ return T && !k && !_;
5545
5548
  }),
5546
5549
  oe(
5547
5550
  ([
5548
5551
  ,
5549
5552
  ,
5550
- [T, E],
5553
+ [T, k],
5551
5554
  I,
5552
5555
  A,
5553
5556
  _,
@@ -5560,10 +5563,10 @@ const er = Ve(
5560
5563
  const K = A, { offsetTree: J, sizeTree: z } = K, $ = lt(g);
5561
5564
  if (I === 0)
5562
5565
  return { ...Qs, totalCount: I };
5563
- if (T === 0 && E === 0)
5566
+ if (T === 0 && k === 0)
5564
5567
  return $ === 0 ? { ...Qs, totalCount: I } : _u($, _, A, W, P, Y || []);
5565
5568
  if (Ze(z))
5566
- return $ > 0 ? null : Eo(
5569
+ return $ > 0 ? null : ko(
5567
5570
  ev(ua(_, I), K, Y),
5568
5571
  [],
5569
5572
  I,
@@ -5582,8 +5585,8 @@ const er = Ve(
5582
5585
  }
5583
5586
  }
5584
5587
  if (!D)
5585
- return Eo([], F, I, P, K, W);
5586
- const B = L.length > 0 ? L[L.length - 1] + 1 : 0, pe = Hx(J, T, E, B);
5588
+ return ko([], F, I, P, K, W);
5589
+ const B = L.length > 0 ? L[L.length - 1] + 1 : 0, pe = Hx(J, T, k, B);
5587
5590
  if (pe.length === 0)
5588
5591
  return null;
5589
5592
  const ue = I - 1, ee = us([], (Ie) => {
@@ -5598,15 +5601,15 @@ const er = Ve(
5598
5601
  }
5599
5602
  Q < B && (O += (B - Q) * q, Q = B);
5600
5603
  const ce = Math.min(Ce.end, ue);
5601
- for (let ie = Q; ie <= ce && !(O >= E); ie++)
5604
+ for (let ie = Q; ie <= ce && !(O >= k); ie++)
5602
5605
  Ie.push({ data: Y == null ? void 0 : Y[ie], index: ie, offset: O, size: q }), O += q + P;
5603
5606
  }
5604
5607
  });
5605
- return Eo(ee, F, I, P, K, W);
5608
+ return ko(ee, F, I, P, K, W);
5606
5609
  }
5607
5610
  ),
5608
5611
  //@ts-expect-error filter needs to be fixed
5609
- Ee((T) => T !== null),
5612
+ ke((T) => T !== null),
5610
5613
  nt()
5611
5614
  ),
5612
5615
  Qs
@@ -5614,7 +5617,7 @@ const er = Ve(
5614
5617
  fe(
5615
5618
  U(
5616
5619
  e,
5617
- Ee(oa),
5620
+ ke(oa),
5618
5621
  oe((T) => T == null ? void 0 : T.length)
5619
5622
  ),
5620
5623
  o
@@ -5640,10 +5643,10 @@ const er = Ve(
5640
5643
  const S = jt(
5641
5644
  U(
5642
5645
  y,
5643
- Ee(({ items: T }) => T.length > 0),
5646
+ ke(({ items: T }) => T.length > 0),
5644
5647
  De(o, e),
5645
- Ee(([{ items: T }, E]) => T[T.length - 1].originalIndex === E - 1),
5646
- oe(([, T, E]) => [T - 1, E]),
5648
+ ke(([{ items: T }, k]) => T[T.length - 1].originalIndex === k - 1),
5649
+ oe(([, T, k]) => [T - 1, k]),
5647
5650
  nt(Ur),
5648
5651
  oe(([T]) => T)
5649
5652
  )
@@ -5651,23 +5654,23 @@ const er = Ve(
5651
5654
  U(
5652
5655
  y,
5653
5656
  mn(200),
5654
- Ee(({ items: T, topItems: E }) => T.length > 0 && T[0].originalIndex === E.length),
5657
+ ke(({ items: T, topItems: k }) => T.length > 0 && T[0].originalIndex === k.length),
5655
5658
  oe(({ items: T }) => T[0].index),
5656
5659
  nt()
5657
5660
  )
5658
5661
  ), C = jt(
5659
5662
  U(
5660
5663
  y,
5661
- Ee(({ items: T }) => T.length > 0),
5664
+ ke(({ items: T }) => T.length > 0),
5662
5665
  oe(({ items: T }) => {
5663
- let E = 0, I = T.length - 1;
5664
- for (; T[E].type === "group" && E < I; )
5665
- E++;
5666
- for (; T[I].type === "group" && I > E; )
5666
+ let k = 0, I = T.length - 1;
5667
+ for (; T[k].type === "group" && k < I; )
5668
+ k++;
5669
+ for (; T[I].type === "group" && I > k; )
5667
5670
  I--;
5668
5671
  return {
5669
5672
  endIndex: T[I].index,
5670
- startIndex: T[E].index
5673
+ startIndex: T[k].index
5671
5674
  };
5672
5675
  }),
5673
5676
  nt(Tu)
@@ -5704,7 +5707,7 @@ const er = Ve(
5704
5707
  const n = Z(!1), r = yt(
5705
5708
  U(
5706
5709
  dt(n, e, t),
5707
- Ee(([o]) => o),
5710
+ ke(([o]) => o),
5708
5711
  oe(([, o, s]) => Math.max(0, o - s)),
5709
5712
  mn(0),
5710
5713
  nt()
@@ -5736,25 +5739,25 @@ const er = Ve(
5736
5739
  De(t, l, n, s, o, r, a),
5737
5740
  De(e),
5738
5741
  oe(([[f, h, p, w, v, g, x, y], S]) => {
5739
- const { align: R, behavior: C, calculateViewLocation: T = nv, done: E, ...I } = f, A = ku(f, h, w - 1), _ = Wr(A, h.offsetTree, S) + v + g, D = _ + Gt(h.sizeTree, A)[1], L = y + g, W = y + p - x, P = T({
5742
+ const { align: R, behavior: C, calculateViewLocation: T = nv, done: k, ...I } = f, A = Eu(f, h, w - 1), _ = Wr(A, h.offsetTree, S) + v + g, D = _ + Gt(h.sizeTree, A)[1], L = y + g, W = y + p - x, P = T({
5740
5743
  itemBottom: D,
5741
5744
  itemTop: _,
5742
5745
  locationParams: { align: R, behavior: C, ...I },
5743
5746
  viewportBottom: W,
5744
5747
  viewportTop: L
5745
5748
  });
5746
- return P ? E && qt(
5749
+ return P ? k && qt(
5747
5750
  U(
5748
5751
  i,
5749
- Ee((Y) => !Y),
5752
+ ke((Y) => !Y),
5750
5753
  // skips the initial publish of false, and the cleanup call.
5751
5754
  // but if scrollingInProgress is true, we skip the initial publish.
5752
5755
  qn(lt(i) ? 1 : 2)
5753
5756
  ),
5754
- E
5755
- ) : E && E(), P;
5757
+ k
5758
+ ) : k && k(), P;
5756
5759
  }),
5757
- Ee((f) => f !== null)
5760
+ ke((f) => f !== null)
5758
5761
  ),
5759
5762
  u
5760
5763
  ), {
@@ -5792,35 +5795,35 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5792
5795
  U(
5793
5796
  dt(U(Re(t), qn(1)), l),
5794
5797
  De(Re(w), s, a, f),
5795
- oe(([[C, T], E, I, A, _]) => {
5798
+ oe(([[C, T], k, I, A, _]) => {
5796
5799
  let D = T && A, L = "auto";
5797
- return D && (L = rv(E, I || _), D = D && !!L), { followOutputBehavior: L, shouldFollow: D, totalCount: C };
5800
+ return D && (L = rv(k, I || _), D = D && !!L), { followOutputBehavior: L, shouldFollow: D, totalCount: C };
5798
5801
  }),
5799
- Ee(({ shouldFollow: C }) => C)
5802
+ ke(({ shouldFollow: C }) => C)
5800
5803
  ),
5801
5804
  ({ followOutputBehavior: C, totalCount: T }) => {
5802
5805
  g && (g(), g = null), lt(n) ? requestAnimationFrame(() => {
5803
- lt(d)("following output to ", { totalCount: T }, kt.DEBUG), x(C);
5806
+ lt(d)("following output to ", { totalCount: T }, Et.DEBUG), x(C);
5804
5807
  }) : g = qt(e, () => {
5805
- lt(d)("following output to ", { totalCount: T }, kt.DEBUG), x(C), g = null;
5808
+ lt(d)("following output to ", { totalCount: T }, Et.DEBUG), x(C), g = null;
5806
5809
  });
5807
5810
  }
5808
5811
  );
5809
5812
  function y(C) {
5810
- const T = qt(o, (E) => {
5811
- C && !E.atBottom && E.notAtBottomBecause === "SIZE_INCREASED" && !g && (lt(d)("scrolling to bottom due to increased size", {}, kt.DEBUG), x("auto"));
5813
+ const T = qt(o, (k) => {
5814
+ C && !k.atBottom && k.notAtBottomBecause === "SIZE_INCREASED" && !g && (lt(d)("scrolling to bottom due to increased size", {}, Et.DEBUG), x("auto"));
5812
5815
  });
5813
5816
  setTimeout(T, 100);
5814
5817
  }
5815
5818
  Ye(
5816
5819
  U(
5817
5820
  dt(Re(w), t, u),
5818
- Ee(([C, , T]) => C && T),
5821
+ ke(([C, , T]) => C && T),
5819
5822
  sn(
5820
5823
  ({ value: C }, [, T]) => ({ refreshed: C === T, value: T }),
5821
5824
  { refreshed: !1, value: 0 }
5822
5825
  ),
5823
- Ee(({ refreshed: C }) => C),
5826
+ ke(({ refreshed: C }) => C),
5824
5827
  De(w, t)
5825
5828
  ),
5826
5829
  ([, C]) => {
@@ -5848,8 +5851,8 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5848
5851
  U(
5849
5852
  dt(U(R, qn(1)), l),
5850
5853
  De(Re(S), a, f, h),
5851
- oe(([[C, T], E, I, A, _]) => T && I && (E == null ? void 0 : E({ context: _, totalCount: C, scrollingInProgress: A }))),
5852
- Ee((C) => !!C),
5854
+ oe(([[C, T], k, I, A, _]) => T && I && (k == null ? void 0 : k({ context: _, totalCount: C, scrollingInProgress: A }))),
5855
+ ke((C) => !!C),
5853
5856
  mn(0)
5854
5857
  ),
5855
5858
  (C) => {
@@ -5877,7 +5880,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5877
5880
  U(
5878
5881
  a,
5879
5882
  De(s),
5880
- Ee(([, l]) => l !== 0),
5883
+ ke(([, l]) => l !== 0),
5881
5884
  De(o, r, t, n, e),
5882
5885
  oe(([[, l], u, d, f, h, p = []]) => _u(l, u, d, f, h, p))
5883
5886
  ),
@@ -5892,7 +5895,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5892
5895
  U(
5893
5896
  e,
5894
5897
  De(r),
5895
- Ee(([, o]) => o !== 0),
5898
+ ke(([, o]) => o !== 0),
5896
5899
  oe(([, o]) => ({ top: o }))
5897
5900
  ),
5898
5901
  (o) => {
@@ -5900,7 +5903,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5900
5903
  U(
5901
5904
  n,
5902
5905
  qn(1),
5903
- Ee((s) => s.items.length > 1)
5906
+ ke((s) => s.items.length > 1)
5904
5907
  ),
5905
5908
  () => {
5906
5909
  requestAnimationFrame(() => {
@@ -5922,7 +5925,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5922
5925
  U(
5923
5926
  e,
5924
5927
  De(r, t, n),
5925
- Ee(([o, s]) => !!s),
5928
+ ke(([o, s]) => !!s),
5926
5929
  oe(([o, s, i, a]) => {
5927
5930
  const { enter: l, exit: u } = s;
5928
5931
  if (i) {
@@ -5994,11 +5997,11 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5994
5997
  const R = Wx(w.sizeTree);
5995
5998
  g && x !== null && y !== null && (v = x.scrollTop - y.offsetTop), v -= S, p({ ranges: R, scrollTop: v });
5996
5999
  }
5997
- ), fe(U(d, Ee(oa), oe(lv)), o), fe(
6000
+ ), fe(U(d, ke(oa), oe(lv)), o), fe(
5998
6001
  U(
5999
6002
  s,
6000
6003
  De(d),
6001
- Ee(([, p]) => p !== void 0),
6004
+ ke(([, p]) => p !== void 0),
6002
6005
  nt(),
6003
6006
  oe(([, p]) => p.ranges)
6004
6007
  ),
@@ -6018,7 +6021,7 @@ const cv = Ve(([{ topItemsIndexes: e }]) => {
6018
6021
  return fe(
6019
6022
  U(
6020
6023
  t,
6021
- Ee((n) => n >= 0),
6024
+ ke((n) => n >= 0),
6022
6025
  oe((n) => Array.from({ length: n }).map((r, o) => o))
6023
6026
  ),
6024
6027
  e
@@ -6042,17 +6045,17 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6042
6045
  l,
6043
6046
  De(i),
6044
6047
  sn(
6045
- ([, x, y, S], [{ bottom: R, items: C, offsetBottom: T, totalCount: E }, I]) => {
6048
+ ([, x, y, S], [{ bottom: R, items: C, offsetBottom: T, totalCount: k }, I]) => {
6046
6049
  const A = R + T;
6047
6050
  let _ = 0;
6048
- return y === E && x.length > 0 && C.length > 0 && (C[0].originalIndex === 0 && x[0].originalIndex === 0 || (_ = A - S, _ !== 0 && (_ += I))), [_, C, E, A];
6051
+ return y === k && x.length > 0 && C.length > 0 && (C[0].originalIndex === 0 && x[0].originalIndex === 0 || (_ = A - S, _ !== 0 && (_ += I))), [_, C, k, A];
6049
6052
  },
6050
6053
  [0, [], 0, 0]
6051
6054
  ),
6052
- Ee(([x]) => x !== 0),
6055
+ ke(([x]) => x !== 0),
6053
6056
  De(r, a, n, o, p, w),
6054
- Ee(([, x, y, S, , , R]) => !R && !S && x !== 0 && y === Vr),
6055
- oe(([[x], , , , , y]) => (y("Upward scrolling compensation", { amount: x }, kt.DEBUG), x))
6057
+ ke(([, x, y, S, , , R]) => !R && !S && x !== 0 && y === Vr),
6058
+ oe(([[x], , , , , y]) => (y("Upward scrolling compensation", { amount: x }, Et.DEBUG), x))
6056
6059
  )
6057
6060
  );
6058
6061
  function g(x) {
@@ -6063,7 +6066,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6063
6066
  }), Ye(
6064
6067
  U(
6065
6068
  dt(yt(s, !1), e, w),
6066
- Ee(([x, y, S]) => !x && !S && y !== 0),
6069
+ ke(([x, y, S]) => !x && !S && y !== 0),
6067
6070
  oe(([x, y]) => y),
6068
6071
  mn(1)
6069
6072
  ),
@@ -6079,21 +6082,21 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6079
6082
  u,
6080
6083
  De(h, d),
6081
6084
  oe(([x, { groupIndices: y, lastSize: S, sizeTree: R }, C]) => {
6082
- function T(E) {
6083
- return E * (S + C);
6085
+ function T(k) {
6086
+ return k * (S + C);
6084
6087
  }
6085
6088
  if (y.length === 0)
6086
6089
  return T(x);
6087
6090
  {
6088
- let E = 0;
6091
+ let k = 0;
6089
6092
  const I = Hr(R, 0);
6090
6093
  let A = 0, _ = 0;
6091
6094
  for (; A < x; ) {
6092
- A++, E += I;
6095
+ A++, k += I;
6093
6096
  let D = y.length === _ + 1 ? 1 / 0 : y[_ + 1] - y[_] - 1;
6094
- A + D > x && (E -= I, D = x - A + 1), A += D, E += T(D), _++;
6097
+ A + D > x && (k -= I, D = x - A + 1), A += D, k += T(D), _++;
6095
6098
  }
6096
- return E;
6099
+ return k;
6097
6100
  }
6098
6101
  })
6099
6102
  ),
@@ -6169,7 +6172,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6169
6172
  { listState: y, topItemsIndexes: S, ...R },
6170
6173
  { scrollToIndex: C },
6171
6174
  T,
6172
- { topItemCount: E },
6175
+ { topItemCount: k },
6173
6176
  { groupCounts: I },
6174
6177
  A
6175
6178
  ]) => (fe(R.rangeChanged, A.scrollSeekRangeChanged), fe(
@@ -6189,7 +6192,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6189
6192
  initialTopMostItemIndex: p,
6190
6193
  scrolledToInitialItem: w,
6191
6194
  sizeRanges: a,
6192
- topItemCount: E,
6195
+ topItemCount: k,
6193
6196
  topItemsIndexes: S,
6194
6197
  // input
6195
6198
  totalCount: d,
@@ -6259,12 +6262,12 @@ function $u(e, t, n) {
6259
6262
  return i.reduce((x, y) => (x[y] = Nx(g[t.events[y]]), x), {});
6260
6263
  }
6261
6264
  const f = V.forwardRef((g, x) => {
6262
- const { children: y, ...S } = g, [R] = V.useState(() => us(_x(e), (E) => {
6263
- l(E, S);
6264
- })), [C] = V.useState(El(d, R));
6265
+ const { children: y, ...S } = g, [R] = V.useState(() => us(_x(e), (k) => {
6266
+ l(k, S);
6267
+ })), [C] = V.useState(kl(d, R));
6265
6268
  uo(() => {
6266
- for (const E of i)
6267
- E in S && Ye(C[E], S[E]);
6269
+ for (const k of i)
6270
+ k in S && Ye(C[k], S[k]);
6268
6271
  return () => {
6269
6272
  Object.values(C).map(sa);
6270
6273
  };
@@ -6292,7 +6295,7 @@ function $u(e, t, n) {
6292
6295
  () => lt(x)
6293
6296
  );
6294
6297
  }, w = (g) => {
6295
- const x = V.useContext(a)[g], [y, S] = V.useState(El(lt, x));
6298
+ const x = V.useContext(a)[g], [y, S] = V.useState(kl(lt, x));
6296
6299
  return uo(
6297
6300
  () => Ye(x, (R) => {
6298
6301
  R !== y && S(Rl(R));
@@ -6421,7 +6424,7 @@ const mv = /* @__PURE__ */ Ve(() => {
6421
6424
  ma("deviation", (P) => {
6422
6425
  x !== P && y(P);
6423
6426
  });
6424
- const S = Ae("EmptyPlaceholder"), R = Ae("ScrollSeekPlaceholder") || xv, C = Ae("ListComponent"), T = Ae("ItemComponent"), E = Ae("GroupComponent"), I = Ae("computeItemKey"), A = Ae("isSeeking"), _ = Ae("groupIndices").length > 0, D = Ae("alignToBottom"), L = Ae("initialItemFinalLocationReached"), W = e ? {} : {
6427
+ const S = Ae("EmptyPlaceholder"), R = Ae("ScrollSeekPlaceholder") || xv, C = Ae("ListComponent"), T = Ae("ItemComponent"), k = Ae("GroupComponent"), I = Ae("computeItemKey"), A = Ae("isSeeking"), _ = Ae("groupIndices").length > 0, D = Ae("alignToBottom"), L = Ae("initialItemFinalLocationReached"), W = e ? {} : {
6425
6428
  boxSizing: "border-box",
6426
6429
  ...v ? {
6427
6430
  display: "inline-block",
@@ -6457,9 +6460,9 @@ const mv = /* @__PURE__ */ Ve(() => {
6457
6460
  ...P.type === "group" ? {} : { groupIndex: P.groupIndex }
6458
6461
  }
6459
6462
  ) : P.type === "group" ? /* @__PURE__ */ bo(
6460
- E,
6463
+ k,
6461
6464
  {
6462
- ...bt(E, u),
6465
+ ...bt(k, u),
6463
6466
  "data-index": Y,
6464
6467
  "data-item-index": P.index,
6465
6468
  "data-known-size": P.size,
@@ -6590,7 +6593,7 @@ function Vu({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
6590
6593
  );
6591
6594
  });
6592
6595
  }
6593
- const Ev = ({ children: e }) => {
6596
+ const kv = ({ children: e }) => {
6594
6597
  const t = V.useContext(Fu), n = zt("viewportHeight"), r = zt("fixedItemHeight"), o = Ae("alignToBottom"), s = Ae("horizontalDirection"), i = V.useMemo(
6595
6598
  () => gu(n, (l) => Tn(l, s ? "width" : "height")),
6596
6599
  [n, s]
@@ -6598,7 +6601,7 @@ const Ev = ({ children: e }) => {
6598
6601
  return V.useEffect(() => {
6599
6602
  t && (n(t.viewportHeight), r(t.itemHeight));
6600
6603
  }, [t, n, r]), /* @__PURE__ */ c.jsx("div", { "data-viewport-type": "element", ref: a, style: hs(o), children: e });
6601
- }, kv = ({ children: e }) => {
6604
+ }, Ev = ({ children: e }) => {
6602
6605
  const t = V.useContext(Fu), n = zt("windowViewportRect"), r = zt("fixedItemHeight"), o = Ae("customScrollParent"), s = vu(
6603
6606
  n,
6604
6607
  o,
@@ -6614,7 +6617,7 @@ const Ev = ({ children: e }) => {
6614
6617
  const t = Ae("useWindowScroll"), n = Ae("topItemsIndexes").length > 0, r = Ae("customScrollParent"), o = Ae("context");
6615
6618
  return /* @__PURE__ */ c.jsxs(r || t ? jv : _v, { ...e, context: o, children: [
6616
6619
  n && /* @__PURE__ */ c.jsx(Iv, { children: /* @__PURE__ */ c.jsx(Ll, { showTopList: !0 }) }),
6617
- /* @__PURE__ */ c.jsxs(r || t ? kv : Ev, { children: [
6620
+ /* @__PURE__ */ c.jsxs(r || t ? Ev : kv, { children: [
6618
6621
  /* @__PURE__ */ c.jsx(Tv, {}),
6619
6622
  /* @__PURE__ */ c.jsx(Ll, {}),
6620
6623
  /* @__PURE__ */ c.jsx(Rv, {})
@@ -6764,12 +6767,12 @@ const $v = /* @__PURE__ */ Ve(
6764
6767
  { customScrollParent: g, useWindowScroll: x, windowScrollContainerState: y, windowScrollTo: S, windowViewportRect: R },
6765
6768
  C
6766
6769
  ]) => {
6767
- const T = Z(0), E = Z(0), I = Z($l), A = Z({ height: 0, width: 0 }), _ = Z({ height: 0, width: 0 }), D = Be(), L = Be(), W = Z(0), P = Z(null), Y = Z({ column: 0, row: 0 }), K = Be(), J = Be(), z = Z(!1), $ = Z(0), F = Z(!0), B = Z(!1), pe = Z(!1);
6770
+ const T = Z(0), k = Z(0), I = Z($l), A = Z({ height: 0, width: 0 }), _ = Z({ height: 0, width: 0 }), D = Be(), L = Be(), W = Z(0), P = Z(null), Y = Z({ column: 0, row: 0 }), K = Be(), J = Be(), z = Z(!1), $ = Z(0), F = Z(!0), B = Z(!1), pe = Z(!1);
6768
6771
  Ye(
6769
6772
  U(
6770
6773
  w,
6771
6774
  De($),
6772
- Ee(([O, Q]) => !!Q)
6775
+ ke(([O, Q]) => !!Q)
6773
6776
  ),
6774
6777
  () => {
6775
6778
  je(F, !1);
@@ -6777,7 +6780,7 @@ const $v = /* @__PURE__ */ Ve(
6777
6780
  ), Ye(
6778
6781
  U(
6779
6782
  dt(w, F, _, A, $, B),
6780
- Ee(([O, Q, q, ce, , ie]) => O && !Q && q.height !== 0 && ce.height !== 0 && !ie)
6783
+ ke(([O, Q, q, ce, , ie]) => O && !Q && q.height !== 0 && ce.height !== 0 && !ie)
6781
6784
  ),
6782
6785
  ([, , , , O]) => {
6783
6786
  je(B, !0), ca(1, () => {
@@ -6789,15 +6792,15 @@ const $v = /* @__PURE__ */ Ve(
6789
6792
  ), fe(
6790
6793
  U(
6791
6794
  J,
6792
- Ee((O) => O != null && O.scrollTop > 0),
6795
+ ke((O) => O != null && O.scrollTop > 0),
6793
6796
  rn(0)
6794
6797
  ),
6795
- E
6798
+ k
6796
6799
  ), Ye(
6797
6800
  U(
6798
6801
  w,
6799
6802
  De(J),
6800
- Ee(([, O]) => O != null)
6803
+ ke(([, O]) => O != null)
6801
6804
  ),
6802
6805
  ([, O]) => {
6803
6806
  O && (je(A, O.viewport), je(_, O.item), je(Y, O.gap), O.scrollTop > 0 && (je(z, !0), qt(U(u, qn(1)), (Q) => {
@@ -6835,12 +6838,12 @@ const $v = /* @__PURE__ */ Ve(
6835
6838
  Re(_, fo),
6836
6839
  Re(A, fo),
6837
6840
  Re(P),
6838
- Re(E),
6841
+ Re(k),
6839
6842
  Re(z),
6840
6843
  Re(F),
6841
6844
  Re($)
6842
6845
  ),
6843
- Ee(([, , , , , , , O]) => !O),
6846
+ ke(([, , , , , , , O]) => !O),
6844
6847
  oe(
6845
6848
  ([
6846
6849
  O,
@@ -6873,14 +6876,14 @@ const $v = /* @__PURE__ */ Ve(
6873
6876
  ), fe(
6874
6877
  U(
6875
6878
  P,
6876
- Ee((O) => O !== null),
6879
+ ke((O) => O !== null),
6877
6880
  oe((O) => O.length)
6878
6881
  ),
6879
6882
  T
6880
6883
  ), fe(
6881
6884
  U(
6882
6885
  dt(A, _, I, Y),
6883
- Ee(([O, Q, { items: q }]) => q.length > 0 && Q.height !== 0 && O.height !== 0),
6886
+ ke(([O, Q, { items: q }]) => q.length > 0 && Q.height !== 0 && O.height !== 0),
6884
6887
  oe(([O, Q, { items: q }, ce]) => {
6885
6888
  const { bottom: ie, top: $e } = Hl(O, ce, Q, q);
6886
6889
  return [$e, ie];
@@ -6901,9 +6904,9 @@ const $v = /* @__PURE__ */ Ve(
6901
6904
  const ee = jt(
6902
6905
  U(
6903
6906
  dt(I, T),
6904
- Ee(([{ items: O }]) => O.length > 0),
6907
+ ke(([{ items: O }]) => O.length > 0),
6905
6908
  De(ue),
6906
- Ee(([[O, Q], q]) => {
6909
+ ke(([[O, Q], q]) => {
6907
6910
  const ce = O.items[O.items.length - 1].index === Q - 1;
6908
6911
  return (q || O.bottom > 0 && O.itemHeight > 0 && O.offsetBottom === 0 && O.items.length === Q) && ce;
6909
6912
  }),
@@ -6913,7 +6916,7 @@ const $v = /* @__PURE__ */ Ve(
6913
6916
  ), Ie = jt(
6914
6917
  U(
6915
6918
  Re(I),
6916
- Ee(({ items: O }) => O.length > 0 && O[0].index === 0),
6919
+ ke(({ items: O }) => O.length > 0 && O[0].index === 0),
6917
6920
  rn(0),
6918
6921
  nt()
6919
6922
  )
@@ -6921,7 +6924,7 @@ const $v = /* @__PURE__ */ Ve(
6921
6924
  U(
6922
6925
  Re(I),
6923
6926
  De(z),
6924
- Ee(([{ items: O }, Q]) => O.length > 0 && !Q),
6927
+ ke(([{ items: O }, Q]) => O.length > 0 && !Q),
6925
6928
  oe(([{ items: O }]) => ({
6926
6929
  endIndex: O[O.length - 1].index,
6927
6930
  startIndex: O[0].index
@@ -6966,7 +6969,7 @@ const $v = /* @__PURE__ */ Ve(
6966
6969
  gap: Y,
6967
6970
  headerHeight: s,
6968
6971
  increaseViewportBy: e,
6969
- initialItemCount: E,
6972
+ initialItemCount: k,
6970
6973
  itemDimensions: _,
6971
6974
  overscan: n,
6972
6975
  restoreStateFrom: J,
@@ -7197,7 +7200,7 @@ const Fv = /* @__PURE__ */ Ve(() => {
7197
7200
  Kv
7198
7201
  ), qv = /* @__PURE__ */ Wu({ useEmitter: qu, useEmitterValue: st, usePublisher: Bt }), Gv = /* @__PURE__ */ Vu({ useEmitter: qu, useEmitterValue: st, usePublisher: Bt });
7199
7202
  function Ul(e, t, n) {
7200
- return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
7203
+ return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Et.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
7201
7204
  }
7202
7205
  const Yv = ns(
7203
7206
  "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
@@ -7380,7 +7383,7 @@ var tw = [
7380
7383
  "span",
7381
7384
  "svg",
7382
7385
  "ul"
7383
- ], ke = tw.reduce((e, t) => {
7386
+ ], Ee = tw.reduce((e, t) => {
7384
7387
  const n = vr(`Primitive.${t}`), r = m.forwardRef((o, s) => {
7385
7388
  const { asChild: i, ...a } = o, l = i ? n : t;
7386
7389
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ c.jsx(l, { ...a, ref: s });
@@ -7487,7 +7490,7 @@ var ps = "Collapsible", [aw, WT] = fn(ps), [lw, xa] = aw(ps), Yu = m.forwardRef(
7487
7490
  open: l,
7488
7491
  onOpenToggle: m.useCallback(() => u((d) => !d), [u]),
7489
7492
  children: /* @__PURE__ */ c.jsx(
7490
- ke.div,
7493
+ Ee.div,
7491
7494
  {
7492
7495
  "data-state": wa(l),
7493
7496
  "data-disabled": s ? "" : void 0,
@@ -7504,7 +7507,7 @@ var Xu = "CollapsibleTrigger", Ju = m.forwardRef(
7504
7507
  (e, t) => {
7505
7508
  const { __scopeCollapsible: n, ...r } = e, o = xa(Xu, n);
7506
7509
  return /* @__PURE__ */ c.jsx(
7507
- ke.button,
7510
+ Ee.button,
7508
7511
  {
7509
7512
  type: "button",
7510
7513
  "aria-controls": o.contentId,
@@ -7543,7 +7546,7 @@ var uw = m.forwardRef((e, t) => {
7543
7546
  f.current = S.height, p.current = S.width, g.current || (y.style.transitionDuration = x.current.transitionDuration, y.style.animationName = x.current.animationName), l(r);
7544
7547
  }
7545
7548
  }, [i.open, r]), /* @__PURE__ */ c.jsx(
7546
- ke.div,
7549
+ Ee.div,
7547
7550
  {
7548
7551
  "data-state": wa(i.open),
7549
7552
  "data-disabled": i.disabled ? "" : void 0,
@@ -7606,8 +7609,8 @@ const Zu = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
7606
7609
  }
7607
7610
  ));
7608
7611
  Zu.displayName = "CardDescription";
7609
- const ko = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx("div", { ref: n, className: te("p-6 pt-0", e), ...t }));
7610
- ko.displayName = "CardContent";
7612
+ const Eo = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx("div", { ref: n, className: te("p-6 pt-0", e), ...t }));
7613
+ Eo.displayName = "CardContent";
7611
7614
  const Qu = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
7612
7615
  "div",
7613
7616
  {
@@ -7779,7 +7782,7 @@ function Jl(e, t, n, r) {
7779
7782
  text: vt(i)
7780
7783
  };
7781
7784
  }
7782
- function Ew(e, t) {
7785
+ function kw(e, t) {
7783
7786
  const n = e.match(/^(\s+)(?:```)/);
7784
7787
  if (n === null)
7785
7788
  return t;
@@ -7822,7 +7825,7 @@ class ba {
7822
7825
  fences(t) {
7823
7826
  const n = this.rules.block.fences.exec(t);
7824
7827
  if (n) {
7825
- const r = n[0], o = Ew(r, n[3] || "");
7828
+ const r = n[0], o = kw(r, n[3] || "");
7826
7829
  return {
7827
7830
  type: "code",
7828
7831
  raw: r,
@@ -7889,14 +7892,14 @@ class ba {
7889
7892
  `, 1)[0].replace(/^\t+/, (R) => " ".repeat(3 * R.length)), f = t.split(`
7890
7893
  `, 1)[0], this.options.pedantic ? (i = 2, p = d.trimLeft()) : (i = n[2].search(/[^ ]/), i = i > 4 ? 1 : i, p = d.slice(i), i += n[1].length), l = !1, !d && /^ *$/.test(f) && (r += f + `
7891
7894
  `, t = t.substring(f.length + 1), w = !0), !w) {
7892
- const R = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), C = new RegExp(`^ {0,${Math.min(3, i - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), T = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:\`\`\`|~~~)`), E = new RegExp(`^ {0,${Math.min(3, i - 1)}}#`);
7895
+ const R = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), C = new RegExp(`^ {0,${Math.min(3, i - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), T = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:\`\`\`|~~~)`), k = new RegExp(`^ {0,${Math.min(3, i - 1)}}#`);
7893
7896
  for (; t && (h = t.split(`
7894
- `, 1)[0], f = h, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(T.test(f) || E.test(f) || R.test(f) || C.test(t))); ) {
7897
+ `, 1)[0], f = h, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(T.test(f) || k.test(f) || R.test(f) || C.test(t))); ) {
7895
7898
  if (f.search(/[^ ]/) >= i || !f.trim())
7896
7899
  p += `
7897
7900
  ` + f.slice(i);
7898
7901
  else {
7899
- if (l || d.search(/[^ ]/) >= 4 || T.test(d) || E.test(d) || C.test(d))
7902
+ if (l || d.search(/[^ ]/) >= 4 || T.test(d) || k.test(d) || C.test(d))
7900
7903
  break;
7901
7904
  p += `
7902
7905
  ` + f;
@@ -8335,7 +8338,7 @@ se.breaks = {
8335
8338
  br: Qe(se.br).replace("{2,}", "*").getRegex(),
8336
8339
  text: Qe(se.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
8337
8340
  };
8338
- function kw(e) {
8341
+ function Ew(e) {
8339
8342
  return e.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
8340
8343
  }
8341
8344
  function Zl(e) {
@@ -8549,7 +8552,7 @@ class Rn {
8549
8552
  h = p.call({ lexer: this }, f), typeof h == "number" && h >= 0 && (d = Math.min(d, h));
8550
8553
  }), d < 1 / 0 && d >= 0 && (s = t.substring(0, d + 1));
8551
8554
  }
8552
- if (r = this.tokenizer.inlineText(s, kw)) {
8555
+ if (r = this.tokenizer.inlineText(s, Ew)) {
8553
8556
  t = t.substring(r.raw.length), r.raw.slice(-1) !== "_" && (u = r.raw.slice(-1)), l = !0, o = n[n.length - 1], o && o.type === "text" ? (o.raw += r.raw, o.text += r.text) : n.push(r);
8554
8557
  continue;
8555
8558
  }
@@ -8778,7 +8781,7 @@ class sd {
8778
8781
  return this.getNextSafeSlug(r, n.dryrun);
8779
8782
  }
8780
8783
  }
8781
- class En {
8784
+ class kn {
8782
8785
  constructor(t) {
8783
8786
  this.options = t || tr, this.options.renderer = this.options.renderer || new ya(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new od(), this.slugger = new sd();
8784
8787
  }
@@ -8786,21 +8789,21 @@ class En {
8786
8789
  * Static Parse Method
8787
8790
  */
8788
8791
  static parse(t, n) {
8789
- return new En(n).parse(t);
8792
+ return new kn(n).parse(t);
8790
8793
  }
8791
8794
  /**
8792
8795
  * Static Parse Inline Method
8793
8796
  */
8794
8797
  static parseInline(t, n) {
8795
- return new En(n).parseInline(t);
8798
+ return new kn(n).parseInline(t);
8796
8799
  }
8797
8800
  /**
8798
8801
  * Parse Loop
8799
8802
  */
8800
8803
  parse(t, n = !0) {
8801
8804
  let r = "", o, s, i, a, l, u, d, f, h, p, w, v, g, x, y, S, R, C, T;
8802
- const E = t.length;
8803
- for (o = 0; o < E; o++) {
8805
+ const k = t.length;
8806
+ for (o = 0; o < k; o++) {
8804
8807
  if (p = t[o], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[p.type] && (T = this.options.extensions.renderers[p.type].call({ parser: this }, p), T !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(p.type))) {
8805
8808
  r += T || "";
8806
8809
  continue;
@@ -8868,7 +8871,7 @@ class En {
8868
8871
  continue;
8869
8872
  }
8870
8873
  case "text": {
8871
- for (h = p.tokens ? this.parseInline(p.tokens) : p.text; o + 1 < E && t[o + 1].type === "text"; )
8874
+ for (h = p.tokens ? this.parseInline(p.tokens) : p.text; o + 1 < k && t[o + 1].type === "text"; )
8872
8875
  p = t[++o], h += `
8873
8876
  ` + (p.tokens ? this.parseInline(p.tokens) : p.text);
8874
8877
  r += n ? this.renderer.paragraph(h) : h;
@@ -9050,7 +9053,7 @@ function id(e, t) {
9050
9053
  };
9051
9054
  }
9052
9055
  function be(e, t, n) {
9053
- return id(Rn.lex, En.parse)(e, t, n);
9056
+ return id(Rn.lex, kn.parse)(e, t, n);
9054
9057
  }
9055
9058
  be.options = be.setOptions = function(e) {
9056
9059
  return be.defaults = { ...be.defaults, ...e }, fw(be.defaults), be;
@@ -9148,9 +9151,9 @@ be.walkTokens = function(e, t) {
9148
9151
  }
9149
9152
  return n;
9150
9153
  };
9151
- be.parseInline = id(Rn.lexInline, En.parseInline);
9152
- be.Parser = En;
9153
- be.parser = En.parse;
9154
+ be.parseInline = id(Rn.lexInline, kn.parseInline);
9155
+ be.Parser = kn;
9156
+ be.parser = kn.parse;
9154
9157
  be.Renderer = ya;
9155
9158
  be.TextRenderer = od;
9156
9159
  be.Lexer = Rn;
@@ -9164,7 +9167,7 @@ be.setOptions;
9164
9167
  be.use;
9165
9168
  be.walkTokens;
9166
9169
  be.parseInline;
9167
- En.parse;
9170
+ kn.parse;
9168
9171
  Rn.lex;
9169
9172
  function Ql({
9170
9173
  content: e,
@@ -9344,15 +9347,15 @@ var Lw = "DismissableLayer", Mi = "dismissableLayer.update", $w = "dismissableLa
9344
9347
  onInteractOutside: i,
9345
9348
  onDismiss: a,
9346
9349
  ...l
9347
- } = e, u = m.useContext(ld), [d, f] = m.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = m.useState({}), w = ze(t, (E) => f(E)), v = Array.from(u.layers), [g] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), x = v.indexOf(g), y = d ? v.indexOf(d) : -1, S = u.layersWithOutsidePointerEventsDisabled.size > 0, R = y >= x, C = Hw((E) => {
9348
- const I = E.target, A = [...u.branches].some((_) => _.contains(I));
9349
- !R || A || (o == null || o(E), i == null || i(E), E.defaultPrevented || a == null || a());
9350
- }, h), T = Uw((E) => {
9351
- const I = E.target;
9352
- [...u.branches].some((_) => _.contains(I)) || (s == null || s(E), i == null || i(E), E.defaultPrevented || a == null || a());
9350
+ } = e, u = m.useContext(ld), [d, f] = m.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = m.useState({}), w = ze(t, (k) => f(k)), v = Array.from(u.layers), [g] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), x = v.indexOf(g), y = d ? v.indexOf(d) : -1, S = u.layersWithOutsidePointerEventsDisabled.size > 0, R = y >= x, C = Hw((k) => {
9351
+ const I = k.target, A = [...u.branches].some((_) => _.contains(I));
9352
+ !R || A || (o == null || o(k), i == null || i(k), k.defaultPrevented || a == null || a());
9353
+ }, h), T = Uw((k) => {
9354
+ const I = k.target;
9355
+ [...u.branches].some((_) => _.contains(I)) || (s == null || s(k), i == null || i(k), k.defaultPrevented || a == null || a());
9353
9356
  }, h);
9354
- return Dw((E) => {
9355
- y === u.layers.size - 1 && (r == null || r(E), !E.defaultPrevented && a && (E.preventDefault(), a()));
9357
+ return Dw((k) => {
9358
+ y === u.layers.size - 1 && (r == null || r(k), !k.defaultPrevented && a && (k.preventDefault(), a()));
9356
9359
  }, h), m.useEffect(() => {
9357
9360
  if (d)
9358
9361
  return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (nc = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), rc(), () => {
@@ -9361,10 +9364,10 @@ var Lw = "DismissableLayer", Mi = "dismissableLayer.update", $w = "dismissableLa
9361
9364
  }, [d, h, n, u]), m.useEffect(() => () => {
9362
9365
  d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), rc());
9363
9366
  }, [d, u]), m.useEffect(() => {
9364
- const E = () => p({});
9365
- return document.addEventListener(Mi, E), () => document.removeEventListener(Mi, E);
9367
+ const k = () => p({});
9368
+ return document.addEventListener(Mi, k), () => document.removeEventListener(Mi, k);
9366
9369
  }, []), /* @__PURE__ */ c.jsx(
9367
- ke.div,
9370
+ Ee.div,
9368
9371
  {
9369
9372
  ...l,
9370
9373
  ref: w,
@@ -9391,7 +9394,7 @@ var zw = "DismissableLayerBranch", Bw = m.forwardRef((e, t) => {
9391
9394
  return n.branches.add(s), () => {
9392
9395
  n.branches.delete(s);
9393
9396
  };
9394
- }, [n.branches]), /* @__PURE__ */ c.jsx(ke.div, { ...e, ref: o });
9397
+ }, [n.branches]), /* @__PURE__ */ c.jsx(Ee.div, { ...e, ref: o });
9395
9398
  });
9396
9399
  Bw.displayName = zw;
9397
9400
  function Hw(e, t = globalThis == null ? void 0 : globalThis.document) {
@@ -9510,7 +9513,7 @@ var si = "focusScope.autoFocusOnMount", ii = "focusScope.autoFocusOnUnmount", oc
9510
9513
  },
9511
9514
  [n, r, p.paused]
9512
9515
  );
9513
- return /* @__PURE__ */ c.jsx(ke.div, { tabIndex: -1, ...i, ref: h, onKeyDown: w });
9516
+ return /* @__PURE__ */ c.jsx(Ee.div, { tabIndex: -1, ...i, ref: h, onKeyDown: w });
9514
9517
  });
9515
9518
  gs.displayName = Ww;
9516
9519
  function Vw(e, { select: t = !1 } = {}) {
@@ -9580,7 +9583,7 @@ var Jw = "Portal", xs = m.forwardRef((e, t) => {
9580
9583
  const { container: n, ...r } = e, [o, s] = m.useState(!1);
9581
9584
  pt(() => s(!0), []);
9582
9585
  const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
9583
- return i ? Dc.createPortal(/* @__PURE__ */ c.jsx(ke.div, { ...r, ref: t }), i) : null;
9586
+ return i ? Dc.createPortal(/* @__PURE__ */ c.jsx(Ee.div, { ...r, ref: t }), i) : null;
9584
9587
  });
9585
9588
  xs.displayName = Jw;
9586
9589
  var ai = 0;
@@ -9745,12 +9748,12 @@ var hd = ib(), ci = function() {
9745
9748
  onScrollCapture: ci,
9746
9749
  onWheelCapture: ci,
9747
9750
  onTouchMoveCapture: ci
9748
- }), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, u = e.removeScrollBar, d = e.enabled, f = e.shards, h = e.sideCar, p = e.noRelative, w = e.noIsolation, v = e.inert, g = e.allowPinchZoom, x = e.as, y = x === void 0 ? "div" : x, S = e.gapMode, R = dd(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, T = rb([n, t]), E = on(on({}, R), o);
9751
+ }), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, u = e.removeScrollBar, d = e.enabled, f = e.shards, h = e.sideCar, p = e.noRelative, w = e.noIsolation, v = e.inert, g = e.allowPinchZoom, x = e.as, y = x === void 0 ? "div" : x, S = e.gapMode, R = dd(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, T = rb([n, t]), k = on(on({}, R), o);
9749
9752
  return m.createElement(
9750
9753
  m.Fragment,
9751
9754
  null,
9752
9755
  d && m.createElement(C, { sideCar: hd, removeScrollBar: u, shards: f, noRelative: p, noIsolation: w, inert: v, setCallbacks: s, allowPinchZoom: !!g, lockRef: n, gapMode: S }),
9753
- i ? m.cloneElement(m.Children.only(a), on(on({}, E), { ref: T })) : m.createElement(y, on({}, E, { className: l, ref: T }), a)
9756
+ i ? m.cloneElement(m.Children.only(a), on(on({}, k), { ref: T })) : m.createElement(y, on({}, k, { className: l, ref: T }), a)
9754
9757
  );
9755
9758
  });
9756
9759
  vs.defaultProps = {
@@ -9945,10 +9948,10 @@ var lr = Di ? { passive: !1 } : !1, yb = function(e) {
9945
9948
  return e === "v" ? Sb(t) : Cb(t);
9946
9949
  }, xd = function(e, t) {
9947
9950
  return e === "v" ? Tb(t) : Rb(t);
9948
- }, Eb = function(e, t) {
9951
+ }, kb = function(e, t) {
9949
9952
  return e === "h" && t === "rtl" ? -1 : 1;
9950
- }, kb = function(e, t, n, r, o) {
9951
- var s = Eb(e, window.getComputedStyle(t).direction), i = s * r, a = n.target, l = t.contains(a), u = !1, d = i > 0, f = 0, h = 0;
9953
+ }, Eb = function(e, t, n, r, o) {
9954
+ var s = kb(e, window.getComputedStyle(t).direction), i = s * r, a = n.target, l = t.contains(a), u = !1, d = i > 0, f = 0, h = 0;
9952
9955
  do {
9953
9956
  if (!a)
9954
9957
  break;
@@ -9996,18 +9999,18 @@ function _b(e) {
9996
9999
  var a = m.useCallback(function(v, g) {
9997
10000
  if ("touches" in v && v.touches.length === 2 || v.type === "wheel" && v.ctrlKey)
9998
10001
  return !i.current.allowPinchZoom;
9999
- var x = go(v), y = n.current, S = "deltaX" in v ? v.deltaX : y[0] - x[0], R = "deltaY" in v ? v.deltaY : y[1] - x[1], C, T = v.target, E = Math.abs(S) > Math.abs(R) ? "h" : "v";
10000
- if ("touches" in v && E === "h" && T.type === "range")
10002
+ var x = go(v), y = n.current, S = "deltaX" in v ? v.deltaX : y[0] - x[0], R = "deltaY" in v ? v.deltaY : y[1] - x[1], C, T = v.target, k = Math.abs(S) > Math.abs(R) ? "h" : "v";
10003
+ if ("touches" in v && k === "h" && T.type === "range")
10001
10004
  return !1;
10002
- var I = dc(E, T);
10005
+ var I = dc(k, T);
10003
10006
  if (!I)
10004
10007
  return !0;
10005
- if (I ? C = E : (C = E === "v" ? "h" : "v", I = dc(E, T)), !I)
10008
+ if (I ? C = k : (C = k === "v" ? "h" : "v", I = dc(k, T)), !I)
10006
10009
  return !1;
10007
10010
  if (!r.current && "changedTouches" in v && (S || R) && (r.current = C), !C)
10008
10011
  return !0;
10009
10012
  var A = r.current || C;
10010
- return kb(A, g, v, A === "h" ? S : R);
10013
+ return Eb(A, g, v, A === "h" ? S : R);
10011
10014
  }, []), l = m.useCallback(function(v) {
10012
10015
  var g = v;
10013
10016
  if (!(!cr.length || cr[cr.length - 1] !== s)) {
@@ -10152,13 +10155,13 @@ var yd = "DialogTrigger", Sd = m.forwardRef(
10152
10155
  (e, t) => {
10153
10156
  const { __scopeDialog: n, ...r } = e, o = Zt(yd, n), s = ze(t, o.triggerRef);
10154
10157
  return /* @__PURE__ */ c.jsx(
10155
- ke.button,
10158
+ Ee.button,
10156
10159
  {
10157
10160
  type: "button",
10158
10161
  "aria-haspopup": "dialog",
10159
10162
  "aria-expanded": o.open,
10160
10163
  "aria-controls": o.contentId,
10161
- "data-state": ka(o.open),
10164
+ "data-state": Ea(o.open),
10162
10165
  ...r,
10163
10166
  ref: s,
10164
10167
  onClick: le(e.onClick, o.onOpenToggle)
@@ -10188,9 +10191,9 @@ var Fb = vr("DialogOverlay.RemoveScroll"), zb = m.forwardRef(
10188
10191
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
10189
10192
  // ie. when `Overlay` and `Content` are siblings
10190
10193
  /* @__PURE__ */ c.jsx(ws, { as: Fb, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ c.jsx(
10191
- ke.div,
10194
+ Ee.div,
10192
10195
  {
10193
- "data-state": ka(o.open),
10196
+ "data-state": Ea(o.open),
10194
10197
  ...r,
10195
10198
  ref: t,
10196
10199
  style: { pointerEvents: "auto", ...r.style }
@@ -10198,13 +10201,13 @@ var Fb = vr("DialogOverlay.RemoveScroll"), zb = m.forwardRef(
10198
10201
  ) })
10199
10202
  );
10200
10203
  }
10201
- ), Yn = "DialogContent", Ed = m.forwardRef(
10204
+ ), Yn = "DialogContent", kd = m.forwardRef(
10202
10205
  (e, t) => {
10203
10206
  const n = Cd(Yn, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = Zt(Yn, e.__scopeDialog);
10204
10207
  return /* @__PURE__ */ c.jsx(Ot, { present: r || s.open, children: s.modal ? /* @__PURE__ */ c.jsx(Bb, { ...o, ref: t }) : /* @__PURE__ */ c.jsx(Hb, { ...o, ref: t }) });
10205
10208
  }
10206
10209
  );
10207
- Ed.displayName = Yn;
10210
+ kd.displayName = Yn;
10208
10211
  var Bb = m.forwardRef(
10209
10212
  (e, t) => {
10210
10213
  const n = Zt(Yn, e.__scopeDialog), r = m.useRef(null), o = ze(t, n.contentRef, r);
@@ -10212,7 +10215,7 @@ var Bb = m.forwardRef(
10212
10215
  const s = r.current;
10213
10216
  if (s) return Ta(s);
10214
10217
  }, []), /* @__PURE__ */ c.jsx(
10215
- kd,
10218
+ Ed,
10216
10219
  {
10217
10220
  ...e,
10218
10221
  ref: o,
@@ -10237,7 +10240,7 @@ var Bb = m.forwardRef(
10237
10240
  (e, t) => {
10238
10241
  const n = Zt(Yn, e.__scopeDialog), r = m.useRef(!1), o = m.useRef(!1);
10239
10242
  return /* @__PURE__ */ c.jsx(
10240
- kd,
10243
+ Ed,
10241
10244
  {
10242
10245
  ...e,
10243
10246
  ref: t,
@@ -10256,7 +10259,7 @@ var Bb = m.forwardRef(
10256
10259
  }
10257
10260
  );
10258
10261
  }
10259
- ), kd = m.forwardRef(
10262
+ ), Ed = m.forwardRef(
10260
10263
  (e, t) => {
10261
10264
  const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = Zt(Yn, n), l = m.useRef(null), u = ze(t, l);
10262
10265
  return Ca(), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
@@ -10275,7 +10278,7 @@ var Bb = m.forwardRef(
10275
10278
  id: a.contentId,
10276
10279
  "aria-describedby": a.descriptionId,
10277
10280
  "aria-labelledby": a.titleId,
10278
- "data-state": ka(a.open),
10281
+ "data-state": Ea(a.open),
10279
10282
  ...i,
10280
10283
  ref: u,
10281
10284
  onDismiss: () => a.onOpenChange(!1)
@@ -10289,17 +10292,17 @@ var Bb = m.forwardRef(
10289
10292
  ] })
10290
10293
  ] });
10291
10294
  }
10292
- ), Ea = "DialogTitle", Id = m.forwardRef(
10295
+ ), ka = "DialogTitle", Id = m.forwardRef(
10293
10296
  (e, t) => {
10294
- const { __scopeDialog: n, ...r } = e, o = Zt(Ea, n);
10295
- return /* @__PURE__ */ c.jsx(ke.h2, { id: o.titleId, ...r, ref: t });
10297
+ const { __scopeDialog: n, ...r } = e, o = Zt(ka, n);
10298
+ return /* @__PURE__ */ c.jsx(Ee.h2, { id: o.titleId, ...r, ref: t });
10296
10299
  }
10297
10300
  );
10298
- Id.displayName = Ea;
10301
+ Id.displayName = ka;
10299
10302
  var Nd = "DialogDescription", Ad = m.forwardRef(
10300
10303
  (e, t) => {
10301
10304
  const { __scopeDialog: n, ...r } = e, o = Zt(Nd, n);
10302
- return /* @__PURE__ */ c.jsx(ke.p, { id: o.descriptionId, ...r, ref: t });
10305
+ return /* @__PURE__ */ c.jsx(Ee.p, { id: o.descriptionId, ...r, ref: t });
10303
10306
  }
10304
10307
  );
10305
10308
  Ad.displayName = Nd;
@@ -10307,7 +10310,7 @@ var _d = "DialogClose", jd = m.forwardRef(
10307
10310
  (e, t) => {
10308
10311
  const { __scopeDialog: n, ...r } = e, o = Zt(_d, n);
10309
10312
  return /* @__PURE__ */ c.jsx(
10310
- ke.button,
10313
+ Ee.button,
10311
10314
  {
10312
10315
  type: "button",
10313
10316
  ...r,
@@ -10318,12 +10321,12 @@ var _d = "DialogClose", jd = m.forwardRef(
10318
10321
  }
10319
10322
  );
10320
10323
  jd.displayName = _d;
10321
- function ka(e) {
10324
+ function Ea(e) {
10322
10325
  return e ? "open" : "closed";
10323
10326
  }
10324
10327
  var Pd = "DialogTitleWarning", [KT, Od] = Xv(Pd, {
10325
10328
  contentName: Yn,
10326
- titleName: Ea,
10329
+ titleName: ka,
10327
10330
  docsSlug: "dialog"
10328
10331
  }), Ub = ({ titleId: e }) => {
10329
10332
  const t = Od(Pd), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
@@ -10341,7 +10344,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
10341
10344
  const o = (s = e.current) == null ? void 0 : s.getAttribute("aria-describedby");
10342
10345
  t && o && (document.getElementById(t) || console.warn(r));
10343
10346
  }, [r, e, t]), null;
10344
- }, Md = bd, Kb = Sd, Dd = Td, ys = Rd, Ss = Ed, Wn = Id, Cs = Ad, Ld = jd;
10347
+ }, Md = bd, Kb = Sd, Dd = Td, ys = Rd, Ss = kd, Wn = Id, Cs = Ad, Ld = jd;
10345
10348
  const qb = Md, Gb = Dd, $d = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
10346
10349
  ys,
10347
10350
  {
@@ -10747,7 +10750,7 @@ const oy = V.memo(function({
10747
10750
  onCancelEdit: g,
10748
10751
  onCopy: x
10749
10752
  }) {
10750
- const [y, S] = xe(!1), [R, C] = xe("collapsed"), [T, E] = xe(!1), { currentThreadId: I } = ra(), { handleInterrupt: A } = hu(), { toast: _ } = Sa(), [D, L] = xe({}), [W, P] = xe(!1), [Y, K] = xe(null), J = l === "phone" || l === "half-screen", z = t.role, $ = z === "tool", F = !(r && z !== "user"), B = V.useMemo(() => {
10753
+ const [y, S] = xe(!1), [R, C] = xe("collapsed"), [T, k] = xe(!1), { currentThreadId: I } = ra(), { handleInterrupt: A } = hu(), { toast: _ } = Sa(), [D, L] = xe({}), [W, P] = xe(!1), [Y, K] = xe(null), J = l === "phone" || l === "half-screen", z = t.role, $ = z === "tool", F = !(r && z !== "user"), B = V.useMemo(() => {
10751
10754
  switch (z) {
10752
10755
  case "user":
10753
10756
  return "text-[hsl(var(--chat-bubble-user-text))]";
@@ -10919,7 +10922,7 @@ const oy = V.memo(function({
10919
10922
  }, [A]), et = V.useCallback(({ part: ne, i: ae }) => {
10920
10923
  if (ne.type === "text") {
10921
10924
  const de = ne.text ?? "", Ne = de.trim(), he = pc(Ne);
10922
- return he && z !== "tool" ? /* @__PURE__ */ c.jsx(sy, { data: he }, ae) : z === "user" && f && Ne.length > h ? /* @__PURE__ */ c.jsxs(Vl, { open: T, onOpenChange: E, children: [
10925
+ return he && z !== "tool" ? /* @__PURE__ */ c.jsx(sy, { data: he }, ae) : z === "user" && f && Ne.length > h ? /* @__PURE__ */ c.jsxs(Vl, { open: T, onOpenChange: k, children: [
10923
10926
  /* @__PURE__ */ c.jsx("div", { className: te("text-sm text-[hsl(var(--chat-bubble-user-text))]", J && "text-xs"), children: T ? /* @__PURE__ */ c.jsx(Ql, { content: Ne, allowHtml: !1 }) : /* @__PURE__ */ c.jsxs("pre", { className: te("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", J && "text-xs"), children: [
10924
10927
  Ne.substring(0, h),
10925
10928
  "..."
@@ -11394,8 +11397,8 @@ const gc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Wd = V.forwa
11394
11397
  onScrollAway: g,
11395
11398
  onAtBottom: x
11396
11399
  }, y) => {
11397
- const S = Ge(null), R = Ge(null), C = Ge(!1), [T, E] = xe(!0), I = Me((D) => {
11398
- E(D), g && g(!D), x && x(D);
11400
+ const S = Ge(null), R = Ge(null), C = Ge(!1), [T, k] = xe(!0), I = Me((D) => {
11401
+ k(D), g && g(!D), x && x(D);
11399
11402
  }, [g, x]), A = at(() => {
11400
11403
  if (a)
11401
11404
  return async () => {
@@ -11537,7 +11540,7 @@ function Ia(e) {
11537
11540
  if (!y) return [];
11538
11541
  const S = Array.from(y.querySelectorAll(`[${f}]`));
11539
11542
  return Array.from(g.itemMap.values()).sort(
11540
- (T, E) => S.indexOf(T.ref.current) - S.indexOf(E.ref.current)
11543
+ (T, k) => S.indexOf(T.ref.current) - S.indexOf(k.ref.current)
11541
11544
  );
11542
11545
  }, [g.collectionRef, g.itemMap]);
11543
11546
  }
@@ -11552,7 +11555,7 @@ function Ts(e) {
11552
11555
  const t = m.useContext(hy);
11553
11556
  return e || t || "ltr";
11554
11557
  }
11555
- const py = ["top", "right", "bottom", "left"], kn = Math.min, At = Math.max, Vo = Math.round, wo = Math.floor, cn = (e) => ({
11558
+ const py = ["top", "right", "bottom", "left"], En = Math.min, At = Math.max, Vo = Math.round, wo = Math.floor, cn = (e) => ({
11556
11559
  x: e,
11557
11560
  y: e
11558
11561
  }), my = {
@@ -11565,7 +11568,7 @@ const py = ["top", "right", "bottom", "left"], kn = Math.min, At = Math.max, Vo
11565
11568
  end: "start"
11566
11569
  };
11567
11570
  function $i(e, t, n) {
11568
- return At(e, kn(t, n));
11571
+ return At(e, En(t, n));
11569
11572
  }
11570
11573
  function xn(e, t) {
11571
11574
  return typeof e == "function" ? e(t) : e;
@@ -11573,7 +11576,7 @@ function xn(e, t) {
11573
11576
  function vn(e) {
11574
11577
  return e.split("-")[0];
11575
11578
  }
11576
- function Er(e) {
11579
+ function kr(e) {
11577
11580
  return e.split("-")[1];
11578
11581
  }
11579
11582
  function Na(e) {
@@ -11591,7 +11594,7 @@ function _a(e) {
11591
11594
  }
11592
11595
  function vy(e, t, n) {
11593
11596
  n === void 0 && (n = !1);
11594
- const r = Er(e), o = _a(e), s = Aa(o);
11597
+ const r = kr(e), o = _a(e), s = Aa(o);
11595
11598
  let i = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
11596
11599
  return t.reference[s] > t.floating[s] && (i = Ko(i)), [i, Ko(i)];
11597
11600
  }
@@ -11616,7 +11619,7 @@ function Sy(e, t, n) {
11616
11619
  }
11617
11620
  }
11618
11621
  function Cy(e, t, n, r) {
11619
- const o = Er(e);
11622
+ const o = kr(e);
11620
11623
  let s = Sy(vn(e), n === "start", r);
11621
11624
  return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(Fi)))), s;
11622
11625
  }
@@ -11696,7 +11699,7 @@ function wc(e, t, n) {
11696
11699
  y: r.y
11697
11700
  };
11698
11701
  }
11699
- switch (Er(t)) {
11702
+ switch (kr(t)) {
11700
11703
  case "start":
11701
11704
  p[i] -= h * (n && u ? -1 : 1);
11702
11705
  break;
@@ -11812,7 +11815,7 @@ async function qr(e, t) {
11812
11815
  right: (C.right - x.right + w.right) / R.x
11813
11816
  };
11814
11817
  }
11815
- const Ey = (e) => ({
11818
+ const ky = (e) => ({
11816
11819
  name: "arrow",
11817
11820
  options: e,
11818
11821
  async fn(t) {
@@ -11834,9 +11837,9 @@ const Ey = (e) => ({
11834
11837
  x: n,
11835
11838
  y: r
11836
11839
  }, p = _a(o), w = Aa(p), v = await i.getDimensions(u), g = p === "y", x = g ? "top" : "left", y = g ? "bottom" : "right", S = g ? "clientHeight" : "clientWidth", R = s.reference[w] + s.reference[p] - h[p] - s.floating[w], C = h[p] - s.reference[p], T = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
11837
- let E = T ? T[S] : 0;
11838
- (!E || !await (i.isElement == null ? void 0 : i.isElement(T))) && (E = a.floating[S] || s.floating[w]);
11839
- const I = R / 2 - C / 2, A = E / 2 - v[w] / 2 - 1, _ = kn(f[x], A), D = kn(f[y], A), L = _, W = E - v[w] - D, P = E / 2 - v[w] / 2 + I, Y = $i(L, P, W), K = !l.arrow && Er(o) != null && P !== Y && s.reference[w] / 2 - (P < L ? _ : D) - v[w] / 2 < 0, J = K ? P < L ? P - L : P - W : 0;
11840
+ let k = T ? T[S] : 0;
11841
+ (!k || !await (i.isElement == null ? void 0 : i.isElement(T))) && (k = a.floating[S] || s.floating[w]);
11842
+ const I = R / 2 - C / 2, A = k / 2 - v[w] / 2 - 1, _ = En(f[x], A), D = En(f[y], A), L = _, W = k - v[w] - D, P = k / 2 - v[w] / 2 + I, Y = $i(L, P, W), K = !l.arrow && kr(o) != null && P !== Y && s.reference[w] / 2 - (P < L ? _ : D) - v[w] / 2 < 0, J = K ? P < L ? P - L : P - W : 0;
11840
11843
  return {
11841
11844
  [p]: h[p] + J,
11842
11845
  data: {
@@ -11849,7 +11852,7 @@ const Ey = (e) => ({
11849
11852
  reset: K
11850
11853
  };
11851
11854
  }
11852
- }), ky = function(e) {
11855
+ }), Ey = function(e) {
11853
11856
  return e === void 0 && (e = {}), {
11854
11857
  name: "flip",
11855
11858
  options: e,
@@ -11875,7 +11878,7 @@ const Ey = (e) => ({
11875
11878
  return {};
11876
11879
  const x = vn(o), y = an(a), S = vn(a) === a, R = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), C = h || (S || !v ? [Ko(a)] : wy(a)), T = w !== "none";
11877
11880
  !h && T && C.push(...Cy(a, v, w, R));
11878
- const E = [a, ...C], I = await qr(t, g), A = [];
11881
+ const k = [a, ...C], I = await qr(t, g), A = [];
11879
11882
  let _ = ((r = s.flip) == null ? void 0 : r.overflows) || [];
11880
11883
  if (d && A.push(I[x]), f) {
11881
11884
  const P = vy(o, i, R);
@@ -11886,7 +11889,7 @@ const Ey = (e) => ({
11886
11889
  overflows: A
11887
11890
  }], !A.every((P) => P <= 0)) {
11888
11891
  var D, L;
11889
- const P = (((D = s.flip) == null ? void 0 : D.index) || 0) + 1, Y = E[P];
11892
+ const P = (((D = s.flip) == null ? void 0 : D.index) || 0) + 1, Y = k[P];
11890
11893
  if (Y && (!(f === "alignment" ? y !== an(Y) : !1) || // We leave the current main axis only if every placement on that axis
11891
11894
  // overflows the main axis.
11892
11895
  _.every((z) => an(z.placement) === y ? z.overflows[0] > 0 : !0)))
@@ -11989,7 +11992,7 @@ async function Ny(e, t) {
11989
11992
  placement: n,
11990
11993
  platform: r,
11991
11994
  elements: o
11992
- } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = vn(n), a = Er(n), l = an(n) === "y", u = Kd.has(i) ? -1 : 1, d = s && l ? -1 : 1, f = xn(t, e);
11995
+ } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = vn(n), a = kr(n), l = an(n) === "y", u = Kd.has(i) ? -1 : 1, d = s && l ? -1 : 1, f = xn(t, e);
11993
11996
  let {
11994
11997
  mainAxis: h,
11995
11998
  crossAxis: p,
@@ -12146,22 +12149,22 @@ const Ay = function(e) {
12146
12149
  apply: l = () => {
12147
12150
  },
12148
12151
  ...u
12149
- } = xn(e, t), d = await qr(t, u), f = vn(o), h = Er(o), p = an(o) === "y", {
12152
+ } = xn(e, t), d = await qr(t, u), f = vn(o), h = kr(o), p = an(o) === "y", {
12150
12153
  width: w,
12151
12154
  height: v
12152
12155
  } = s.floating;
12153
12156
  let g, x;
12154
12157
  f === "top" || f === "bottom" ? (g = f, x = h === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (x = f, g = h === "end" ? "top" : "bottom");
12155
- const y = v - d.top - d.bottom, S = w - d.left - d.right, R = kn(v - d[g], y), C = kn(w - d[x], S), T = !t.middlewareData.shift;
12156
- let E = R, I = C;
12157
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = S), (r = t.middlewareData.shift) != null && r.enabled.y && (E = y), T && !h) {
12158
+ const y = v - d.top - d.bottom, S = w - d.left - d.right, R = En(v - d[g], y), C = En(w - d[x], S), T = !t.middlewareData.shift;
12159
+ let k = R, I = C;
12160
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = S), (r = t.middlewareData.shift) != null && r.enabled.y && (k = y), T && !h) {
12158
12161
  const _ = At(d.left, 0), D = At(d.right, 0), L = At(d.top, 0), W = At(d.bottom, 0);
12159
- p ? I = w - 2 * (_ !== 0 || D !== 0 ? _ + D : At(d.left, d.right)) : E = v - 2 * (L !== 0 || W !== 0 ? L + W : At(d.top, d.bottom));
12162
+ p ? I = w - 2 * (_ !== 0 || D !== 0 ? _ + D : At(d.left, d.right)) : k = v - 2 * (L !== 0 || W !== 0 ? L + W : At(d.top, d.bottom));
12160
12163
  }
12161
12164
  await l({
12162
12165
  ...t,
12163
12166
  availableWidth: I,
12164
- availableHeight: E
12167
+ availableHeight: k
12165
12168
  });
12166
12169
  const A = await i.getDimensions(a.floating);
12167
12170
  return w !== A.width || v !== A.height ? {
@@ -12175,7 +12178,7 @@ const Ay = function(e) {
12175
12178
  function Rs() {
12176
12179
  return typeof window < "u";
12177
12180
  }
12178
- function kr(e) {
12181
+ function Er(e) {
12179
12182
  return qd(e) ? (e.nodeName || "").toLowerCase() : "#document";
12180
12183
  }
12181
12184
  function Pt(e) {
@@ -12210,10 +12213,10 @@ function so(e) {
12210
12213
  }
12211
12214
  const My = /* @__PURE__ */ new Set(["table", "td", "th"]);
12212
12215
  function Dy(e) {
12213
- return My.has(kr(e));
12216
+ return My.has(Er(e));
12214
12217
  }
12215
12218
  const Ly = [":popover-open", ":modal"];
12216
- function Es(e) {
12219
+ function ks(e) {
12217
12220
  return Ly.some((t) => {
12218
12221
  try {
12219
12222
  return e.matches(t);
@@ -12232,7 +12235,7 @@ function By(e) {
12232
12235
  for (; un(t) && !br(t); ) {
12233
12236
  if (ja(t))
12234
12237
  return t;
12235
- if (Es(t))
12238
+ if (ks(t))
12236
12239
  return null;
12237
12240
  t = In(t);
12238
12241
  }
@@ -12243,12 +12246,12 @@ function Pa() {
12243
12246
  }
12244
12247
  const Hy = /* @__PURE__ */ new Set(["html", "body", "#document"]);
12245
12248
  function br(e) {
12246
- return Hy.has(kr(e));
12249
+ return Hy.has(Er(e));
12247
12250
  }
12248
12251
  function Xt(e) {
12249
12252
  return Pt(e).getComputedStyle(e);
12250
12253
  }
12251
- function ks(e) {
12254
+ function Es(e) {
12252
12255
  return Yt(e) ? {
12253
12256
  scrollLeft: e.scrollLeft,
12254
12257
  scrollTop: e.scrollTop
@@ -12258,7 +12261,7 @@ function ks(e) {
12258
12261
  };
12259
12262
  }
12260
12263
  function In(e) {
12261
- if (kr(e) === "html")
12264
+ if (Er(e) === "html")
12262
12265
  return e;
12263
12266
  const t = (
12264
12267
  // Step into the shadow DOM of the parent of a slotted node.
@@ -12348,7 +12351,7 @@ function Xn(e, t, n, r) {
12348
12351
  });
12349
12352
  }
12350
12353
  function Is(e, t) {
12351
- const n = ks(e).scrollLeft;
12354
+ const n = Es(e).scrollLeft;
12352
12355
  return t ? t.left + n : Xn(hn(e)).left + n;
12353
12356
  }
12354
12357
  function Jd(e, t) {
@@ -12365,7 +12368,7 @@ function Vy(e) {
12365
12368
  offsetParent: r,
12366
12369
  strategy: o
12367
12370
  } = e;
12368
- const s = o === "fixed", i = hn(r), a = t ? Es(t.floating) : !1;
12371
+ const s = o === "fixed", i = hn(r), a = t ? ks(t.floating) : !1;
12369
12372
  if (r === i || a && s)
12370
12373
  return n;
12371
12374
  let l = {
@@ -12373,7 +12376,7 @@ function Vy(e) {
12373
12376
  scrollTop: 0
12374
12377
  }, u = cn(1);
12375
12378
  const d = cn(0), f = un(r);
12376
- if ((f || !f && !s) && ((kr(r) !== "body" || so(i)) && (l = ks(r)), un(r))) {
12379
+ if ((f || !f && !s) && ((Er(r) !== "body" || so(i)) && (l = Es(r)), un(r))) {
12377
12380
  const p = Xn(r);
12378
12381
  u = gr(r), d.x = p.x + r.clientLeft, d.y = p.y + r.clientTop;
12379
12382
  }
@@ -12389,7 +12392,7 @@ function Ky(e) {
12389
12392
  return Array.from(e.getClientRects());
12390
12393
  }
12391
12394
  function qy(e) {
12392
- const t = hn(e), n = ks(e), r = e.ownerDocument.body, o = At(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = At(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
12395
+ const t = hn(e), n = Es(e), r = e.ownerDocument.body, o = At(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = At(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
12393
12396
  let i = -n.scrollLeft + Is(e);
12394
12397
  const a = -n.scrollTop;
12395
12398
  return Xt(r).direction === "rtl" && (i += At(t.clientWidth, r.clientWidth) - o), {
@@ -12457,7 +12460,7 @@ function Jy(e, t) {
12457
12460
  const n = t.get(e);
12458
12461
  if (n)
12459
12462
  return n;
12460
- let r = Gr(e, [], !1).filter((a) => Yt(a) && kr(a) !== "body"), o = null;
12463
+ let r = Gr(e, [], !1).filter((a) => Yt(a) && Er(a) !== "body"), o = null;
12461
12464
  const s = Xt(e).position === "fixed";
12462
12465
  let i = s ? In(e) : e;
12463
12466
  for (; Yt(i) && !br(i); ) {
@@ -12473,9 +12476,9 @@ function Zy(e) {
12473
12476
  rootBoundary: r,
12474
12477
  strategy: o
12475
12478
  } = e;
12476
- const i = [...n === "clippingAncestors" ? Es(t) ? [] : Jy(t, this._c) : [].concat(n), r], a = i[0], l = i.reduce((u, d) => {
12479
+ const i = [...n === "clippingAncestors" ? ks(t) ? [] : Jy(t, this._c) : [].concat(n), r], a = i[0], l = i.reduce((u, d) => {
12477
12480
  const f = Tc(t, d, o);
12478
- return u.top = At(f.top, u.top), u.right = kn(f.right, u.right), u.bottom = kn(f.bottom, u.bottom), u.left = At(f.left, u.left), u;
12481
+ return u.top = At(f.top, u.top), u.right = En(f.right, u.right), u.bottom = En(f.bottom, u.bottom), u.left = At(f.left, u.left), u;
12479
12482
  }, Tc(t, a, o));
12480
12483
  return {
12481
12484
  width: l.right - l.left,
@@ -12505,7 +12508,7 @@ function e0(e, t, n) {
12505
12508
  l.x = Is(o);
12506
12509
  }
12507
12510
  if (r || !r && !s)
12508
- if ((kr(t) !== "body" || so(o)) && (a = ks(t)), r) {
12511
+ if ((Er(t) !== "body" || so(o)) && (a = Es(t)), r) {
12509
12512
  const p = Xn(t, !0, s, t);
12510
12513
  l.x = p.x + t.clientLeft, l.y = p.y + t.clientTop;
12511
12514
  } else o && u();
@@ -12531,7 +12534,7 @@ function Rc(e, t) {
12531
12534
  }
12532
12535
  function Qd(e, t) {
12533
12536
  const n = Pt(e);
12534
- if (Es(e))
12537
+ if (ks(e))
12535
12538
  return n;
12536
12539
  if (!un(e)) {
12537
12540
  let o = In(e);
@@ -12596,19 +12599,19 @@ function o0(e, t) {
12596
12599
  return;
12597
12600
  const w = wo(f), v = wo(o.clientWidth - (d + h)), g = wo(o.clientHeight - (f + p)), x = wo(d), S = {
12598
12601
  rootMargin: -w + "px " + -v + "px " + -g + "px " + -x + "px",
12599
- threshold: At(0, kn(1, l)) || 1
12602
+ threshold: At(0, En(1, l)) || 1
12600
12603
  };
12601
12604
  let R = !0;
12602
12605
  function C(T) {
12603
- const E = T[0].intersectionRatio;
12604
- if (E !== l) {
12606
+ const k = T[0].intersectionRatio;
12607
+ if (k !== l) {
12605
12608
  if (!R)
12606
12609
  return i();
12607
- E ? i(!1, E) : r = setTimeout(() => {
12610
+ k ? i(!1, k) : r = setTimeout(() => {
12608
12611
  i(!1, 1e-7);
12609
12612
  }, 1e3);
12610
12613
  }
12611
- E === 1 && !ef(u, e.getBoundingClientRect()) && i(), R = !1;
12614
+ k === 1 && !ef(u, e.getBoundingClientRect()) && i(), R = !1;
12612
12615
  }
12613
12616
  try {
12614
12617
  n = new IntersectionObserver(C, {
@@ -12659,7 +12662,7 @@ function s0(e, t, n, r) {
12659
12662
  }), f == null || f(), (x = p) == null || x.disconnect(), p = null, l && cancelAnimationFrame(w);
12660
12663
  };
12661
12664
  }
12662
- const i0 = Ay, a0 = _y, l0 = ky, c0 = Py, u0 = Iy, Ec = Ey, d0 = jy, f0 = (e, t, n) => {
12665
+ const i0 = Ay, a0 = _y, l0 = Ey, c0 = Py, u0 = Iy, kc = ky, d0 = jy, f0 = (e, t, n) => {
12663
12666
  const r = /* @__PURE__ */ new Map(), o = {
12664
12667
  platform: r0,
12665
12668
  ...n
@@ -12707,7 +12710,7 @@ function Go(e, t) {
12707
12710
  function tf(e) {
12708
12711
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
12709
12712
  }
12710
- function kc(e, t) {
12713
+ function Ec(e, t) {
12711
12714
  const n = tf(e);
12712
12715
  return Math.round(t * n) / n;
12713
12716
  }
@@ -12743,16 +12746,16 @@ function m0(e) {
12743
12746
  const [w, v] = m.useState(null), [g, x] = m.useState(null), y = m.useCallback((z) => {
12744
12747
  z !== T.current && (T.current = z, v(z));
12745
12748
  }, []), S = m.useCallback((z) => {
12746
- z !== E.current && (E.current = z, x(z));
12747
- }, []), R = s || w, C = i || g, T = m.useRef(null), E = m.useRef(null), I = m.useRef(d), A = l != null, _ = hi(l), D = hi(o), L = hi(u), W = m.useCallback(() => {
12748
- if (!T.current || !E.current)
12749
+ z !== k.current && (k.current = z, x(z));
12750
+ }, []), R = s || w, C = i || g, T = m.useRef(null), k = m.useRef(null), I = m.useRef(d), A = l != null, _ = hi(l), D = hi(o), L = hi(u), W = m.useCallback(() => {
12751
+ if (!T.current || !k.current)
12749
12752
  return;
12750
12753
  const z = {
12751
12754
  placement: t,
12752
12755
  strategy: n,
12753
12756
  middleware: h
12754
12757
  };
12755
- D.current && (z.platform = D.current), f0(T.current, E.current, z).then(($) => {
12758
+ D.current && (z.platform = D.current), f0(T.current, k.current, z).then(($) => {
12756
12759
  const F = {
12757
12760
  ...$,
12758
12761
  // The floating element's position may be recomputed while it's closed
@@ -12776,7 +12779,7 @@ function m0(e) {
12776
12779
  Mo(() => (P.current = !0, () => {
12777
12780
  P.current = !1;
12778
12781
  }), []), Mo(() => {
12779
- if (R && (T.current = R), C && (E.current = C), R && C) {
12782
+ if (R && (T.current = R), C && (k.current = C), R && C) {
12780
12783
  if (_.current)
12781
12784
  return _.current(R, C, W);
12782
12785
  W();
@@ -12784,7 +12787,7 @@ function m0(e) {
12784
12787
  }, [R, C, W, _, A]);
12785
12788
  const Y = m.useMemo(() => ({
12786
12789
  reference: T,
12787
- floating: E,
12790
+ floating: k,
12788
12791
  setReference: y,
12789
12792
  setFloating: S
12790
12793
  }), [y, S]), K = m.useMemo(() => ({
@@ -12798,7 +12801,7 @@ function m0(e) {
12798
12801
  };
12799
12802
  if (!K.floating)
12800
12803
  return z;
12801
- const $ = kc(K.floating, d.x), F = kc(K.floating, d.y);
12804
+ const $ = Ec(K.floating, d.x), F = Ec(K.floating, d.y);
12802
12805
  return a ? {
12803
12806
  ...z,
12804
12807
  transform: "translate(" + $ + "px, " + F + "px)",
@@ -12831,10 +12834,10 @@ const g0 = (e) => {
12831
12834
  element: r,
12832
12835
  padding: o
12833
12836
  } = typeof e == "function" ? e(n) : e;
12834
- return r && t(r) ? r.current != null ? Ec({
12837
+ return r && t(r) ? r.current != null ? kc({
12835
12838
  element: r.current,
12836
12839
  padding: o
12837
- }).fn(n) : {} : r ? Ec({
12840
+ }).fn(n) : {} : r ? kc({
12838
12841
  element: r,
12839
12842
  padding: o
12840
12843
  }).fn(n) : {};
@@ -12865,7 +12868,7 @@ const g0 = (e) => {
12865
12868
  var T0 = "Arrow", nf = m.forwardRef((e, t) => {
12866
12869
  const { children: n, width: r = 10, height: o = 5, ...s } = e;
12867
12870
  return /* @__PURE__ */ c.jsx(
12868
- ke.svg,
12871
+ Ee.svg,
12869
12872
  {
12870
12873
  ...s,
12871
12874
  ref: t,
@@ -12901,9 +12904,9 @@ function rf(e) {
12901
12904
  n(void 0);
12902
12905
  }, [e]), t;
12903
12906
  }
12904
- var Ma = "Popper", [of, Ns] = fn(Ma), [E0, sf] = of(Ma), af = (e) => {
12907
+ var Ma = "Popper", [of, Ns] = fn(Ma), [k0, sf] = of(Ma), af = (e) => {
12905
12908
  const { __scopePopper: t, children: n } = e, [r, o] = m.useState(null);
12906
- return /* @__PURE__ */ c.jsx(E0, { scope: t, anchor: r, onAnchorChange: o, children: n });
12909
+ return /* @__PURE__ */ c.jsx(k0, { scope: t, anchor: r, onAnchorChange: o, children: n });
12907
12910
  };
12908
12911
  af.displayName = Ma;
12909
12912
  var lf = "PopperAnchor", cf = m.forwardRef(
@@ -12912,11 +12915,11 @@ var lf = "PopperAnchor", cf = m.forwardRef(
12912
12915
  return m.useEffect(() => {
12913
12916
  const u = l.current;
12914
12917
  l.current = (r == null ? void 0 : r.current) || i.current, u !== l.current && s.onAnchorChange(l.current);
12915
- }), r ? null : /* @__PURE__ */ c.jsx(ke.div, { ...o, ref: a });
12918
+ }), r ? null : /* @__PURE__ */ c.jsx(Ee.div, { ...o, ref: a });
12916
12919
  }
12917
12920
  );
12918
12921
  cf.displayName = lf;
12919
- var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
12922
+ var Da = "PopperContent", [E0, I0] = of(Da), uf = m.forwardRef(
12920
12923
  (e, t) => {
12921
12924
  var G, O, Q, q, ce, ie;
12922
12925
  const {
@@ -12934,7 +12937,7 @@ var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
12934
12937
  updatePositionStrategy: p = "optimized",
12935
12938
  onPlaced: w,
12936
12939
  ...v
12937
- } = e, g = sf(Da, n), [x, y] = m.useState(null), S = ze(t, ($e) => y($e)), [R, C] = m.useState(null), T = rf(R), E = (T == null ? void 0 : T.width) ?? 0, I = (T == null ? void 0 : T.height) ?? 0, A = r + (s !== "center" ? "-" + s : ""), _ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, D = Array.isArray(u) ? u : [u], L = D.length > 0, W = {
12940
+ } = e, g = sf(Da, n), [x, y] = m.useState(null), S = ze(t, ($e) => y($e)), [R, C] = m.useState(null), T = rf(R), k = (T == null ? void 0 : T.width) ?? 0, I = (T == null ? void 0 : T.height) ?? 0, A = r + (s !== "center" ? "-" + s : ""), _ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, D = Array.isArray(u) ? u : [u], L = D.length > 0, W = {
12938
12941
  padding: _,
12939
12942
  boundary: D.filter(A0),
12940
12943
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
@@ -12966,7 +12969,7 @@ var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
12966
12969
  }
12967
12970
  }),
12968
12971
  R && C0({ element: R, padding: a }),
12969
- _0({ arrowWidth: E, arrowHeight: I }),
12972
+ _0({ arrowWidth: k, arrowHeight: I }),
12970
12973
  h && S0({ strategy: "referenceHidden", ...W })
12971
12974
  ]
12972
12975
  }), [$, F] = hf(K), B = mt(w);
@@ -13001,7 +13004,7 @@ var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
13001
13004
  },
13002
13005
  dir: e.dir,
13003
13006
  children: /* @__PURE__ */ c.jsx(
13004
- k0,
13007
+ E0,
13005
13008
  {
13006
13009
  scope: n,
13007
13010
  placedSide: $,
@@ -13010,7 +13013,7 @@ var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
13010
13013
  arrowY: ue,
13011
13014
  shouldHideArrow: ee,
13012
13015
  children: /* @__PURE__ */ c.jsx(
13013
- ke.div,
13016
+ Ee.div,
13014
13017
  {
13015
13018
  "data-side": $,
13016
13019
  "data-align": F,
@@ -13123,7 +13126,7 @@ var L0 = m.forwardRef((e, t) => {
13123
13126
  defaultProp: a ?? null,
13124
13127
  onChange: l,
13125
13128
  caller: io
13126
- }), [x, y] = m.useState(!1), S = mt(u), R = vf(n), C = m.useRef(!1), [T, E] = m.useState(0);
13129
+ }), [x, y] = m.useState(!1), S = mt(u), R = vf(n), C = m.useRef(!1), [T, k] = m.useState(0);
13127
13130
  return m.useEffect(() => {
13128
13131
  const I = h.current;
13129
13132
  if (I)
@@ -13142,15 +13145,15 @@ var L0 = m.forwardRef((e, t) => {
13142
13145
  ),
13143
13146
  onItemShiftTab: m.useCallback(() => y(!0), []),
13144
13147
  onFocusableItemAdd: m.useCallback(
13145
- () => E((I) => I + 1),
13148
+ () => k((I) => I + 1),
13146
13149
  []
13147
13150
  ),
13148
13151
  onFocusableItemRemove: m.useCallback(
13149
- () => E((I) => I - 1),
13152
+ () => k((I) => I - 1),
13150
13153
  []
13151
13154
  ),
13152
13155
  children: /* @__PURE__ */ c.jsx(
13153
- ke.div,
13156
+ Ee.div,
13154
13157
  {
13155
13158
  tabIndex: x || T === 0 ? -1 : 0,
13156
13159
  "data-orientation": r,
@@ -13199,7 +13202,7 @@ var L0 = m.forwardRef((e, t) => {
13199
13202
  focusable: r,
13200
13203
  active: o,
13201
13204
  children: /* @__PURE__ */ c.jsx(
13202
- ke.span,
13205
+ Ee.span,
13203
13206
  {
13204
13207
  tabIndex: f ? 0 : -1,
13205
13208
  "data-orientation": d.orientation,
@@ -13273,7 +13276,7 @@ var H0 = bf, U0 = Sf, Hi = ["Enter", " "], W0 = ["ArrowDown", "PageUp", "Home"],
13273
13276
  Y0,
13274
13277
  Ns,
13275
13278
  wf
13276
- ]), As = Ns(), Ef = wf(), [X0, rr] = nr(ao), [J0, lo] = nr(ao), kf = (e) => {
13279
+ ]), As = Ns(), kf = wf(), [X0, rr] = nr(ao), [J0, lo] = nr(ao), Ef = (e) => {
13277
13280
  const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = As(t), [l, u] = m.useState(null), d = m.useRef(!1), f = mt(s), h = Ts(o);
13278
13281
  return m.useEffect(() => {
13279
13282
  const p = () => {
@@ -13304,7 +13307,7 @@ var H0 = bf, U0 = Sf, Hi = ["Enter", " "], W0 = ["ArrowDown", "PageUp", "Home"],
13304
13307
  }
13305
13308
  ) });
13306
13309
  };
13307
- kf.displayName = ao;
13310
+ Ef.displayName = ao;
13308
13311
  var Z0 = "MenuAnchor", La = m.forwardRef(
13309
13312
  (e, t) => {
13310
13313
  const { __scopeMenu: n, ...r } = e, o = As(n);
@@ -13377,7 +13380,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13377
13380
  onDismiss: p,
13378
13381
  disableOutsideScroll: w,
13379
13382
  ...v
13380
- } = e, g = rr(Ht, n), x = lo(Ht, n), y = As(n), S = Ef(n), R = G0(n), [C, T] = m.useState(null), E = m.useRef(null), I = ze(t, E, g.onContentChange), A = m.useRef(0), _ = m.useRef(""), D = m.useRef(0), L = m.useRef(null), W = m.useRef("right"), P = m.useRef(0), Y = w ? ws : m.Fragment, K = w ? { as: rS, allowPinchZoom: !0 } : void 0, J = ($) => {
13383
+ } = e, g = rr(Ht, n), x = lo(Ht, n), y = As(n), S = kf(n), R = G0(n), [C, T] = m.useState(null), k = m.useRef(null), I = ze(t, k, g.onContentChange), A = m.useRef(0), _ = m.useRef(""), D = m.useRef(0), L = m.useRef(null), W = m.useRef("right"), P = m.useRef(0), Y = w ? ws : m.Fragment, K = w ? { as: rS, allowPinchZoom: !0 } : void 0, J = ($) => {
13381
13384
  var G, O;
13382
13385
  const F = _.current + $, B = R().filter((Q) => !Q.disabled), pe = document.activeElement, ue = (G = B.find((Q) => Q.ref.current === pe)) == null ? void 0 : G.textValue, ee = B.map((Q) => Q.textValue), Ie = mS(ee, F, ue), Ce = (O = B.find((Q) => Q.textValue === Ie)) == null ? void 0 : O.ref.current;
13383
13386
  (function Q(q) {
@@ -13403,7 +13406,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13403
13406
  onItemLeave: m.useCallback(
13404
13407
  ($) => {
13405
13408
  var F;
13406
- z($) || ((F = E.current) == null || F.focus(), T(null));
13409
+ z($) || ((F = k.current) == null || F.focus(), T(null));
13407
13410
  },
13408
13411
  [z]
13409
13412
  ),
@@ -13424,7 +13427,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13424
13427
  trapped: o,
13425
13428
  onMountAutoFocus: le(s, ($) => {
13426
13429
  var F;
13427
- $.preventDefault(), (F = E.current) == null || F.focus({ preventScroll: !0 });
13430
+ $.preventDefault(), (F = k.current) == null || F.focus({ preventScroll: !0 });
13428
13431
  }),
13429
13432
  onUnmountAutoFocus: i,
13430
13433
  children: /* @__PURE__ */ c.jsx(
@@ -13466,7 +13469,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13466
13469
  onKeyDown: le(v.onKeyDown, ($) => {
13467
13470
  const B = $.target.closest("[data-radix-menu-content]") === $.currentTarget, pe = $.ctrlKey || $.altKey || $.metaKey, ue = $.key.length === 1;
13468
13471
  B && ($.key === "Tab" && $.preventDefault(), !pe && ue && J($.key));
13469
- const ee = E.current;
13472
+ const ee = k.current;
13470
13473
  if ($.target !== ee || !V0.includes($.key)) return;
13471
13474
  $.preventDefault();
13472
13475
  const Ce = R().filter((G) => !G.disabled).map((G) => G.ref.current);
@@ -13501,14 +13504,14 @@ Af.displayName = Ht;
13501
13504
  var oS = "MenuGroup", Ba = m.forwardRef(
13502
13505
  (e, t) => {
13503
13506
  const { __scopeMenu: n, ...r } = e;
13504
- return /* @__PURE__ */ c.jsx(ke.div, { role: "group", ...r, ref: t });
13507
+ return /* @__PURE__ */ c.jsx(Ee.div, { role: "group", ...r, ref: t });
13505
13508
  }
13506
13509
  );
13507
13510
  Ba.displayName = oS;
13508
13511
  var sS = "MenuLabel", _f = m.forwardRef(
13509
13512
  (e, t) => {
13510
13513
  const { __scopeMenu: n, ...r } = e;
13511
- return /* @__PURE__ */ c.jsx(ke.div, { ...r, ref: t });
13514
+ return /* @__PURE__ */ c.jsx(Ee.div, { ...r, ref: t });
13512
13515
  }
13513
13516
  );
13514
13517
  _f.displayName = sS;
@@ -13547,7 +13550,7 @@ var Yo = "MenuItem", Ic = "menu.itemSelect", _s = m.forwardRef(
13547
13550
  _s.displayName = Yo;
13548
13551
  var jf = m.forwardRef(
13549
13552
  (e, t) => {
13550
- const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Fa(Yo, n), a = Ef(n), l = m.useRef(null), u = ze(t, l), [d, f] = m.useState(!1), [h, p] = m.useState("");
13553
+ const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Fa(Yo, n), a = kf(n), l = m.useRef(null), u = ze(t, l), [d, f] = m.useState(!1), [h, p] = m.useState("");
13551
13554
  return m.useEffect(() => {
13552
13555
  const w = l.current;
13553
13556
  w && p((w.textContent ?? "").trim());
@@ -13558,7 +13561,7 @@ var jf = m.forwardRef(
13558
13561
  disabled: r,
13559
13562
  textValue: o ?? h,
13560
13563
  children: /* @__PURE__ */ c.jsx(U0, { asChild: !0, ...a, focusable: !r, children: /* @__PURE__ */ c.jsx(
13561
- ke.div,
13564
+ Ee.div,
13562
13565
  {
13563
13566
  role: "menuitem",
13564
13567
  "data-highlighted": d ? "" : void 0,
@@ -13650,7 +13653,7 @@ var Ha = "MenuItemIndicator", [$f, cS] = nr(
13650
13653
  {
13651
13654
  present: r || Xo(s.checked) || s.checked === !0,
13652
13655
  children: /* @__PURE__ */ c.jsx(
13653
- ke.span,
13656
+ Ee.span,
13654
13657
  {
13655
13658
  ...o,
13656
13659
  ref: t,
@@ -13666,7 +13669,7 @@ var uS = "MenuSeparator", zf = m.forwardRef(
13666
13669
  (e, t) => {
13667
13670
  const { __scopeMenu: n, ...r } = e;
13668
13671
  return /* @__PURE__ */ c.jsx(
13669
- ke.div,
13672
+ Ee.div,
13670
13673
  {
13671
13674
  role: "separator",
13672
13675
  "aria-orientation": "horizontal",
@@ -13834,7 +13837,7 @@ function xS(e, t) {
13834
13837
  function Xr(e) {
13835
13838
  return (t) => t.pointerType === "mouse" ? e(t) : void 0;
13836
13839
  }
13837
- var vS = kf, wS = La, bS = Nf, yS = Af, SS = Ba, CS = _f, TS = _s, RS = Pf, ES = Mf, kS = Lf, IS = Ff, NS = zf, AS = Bf, _S = Uf, jS = Vf, js = "DropdownMenu", [PS, GT] = fn(
13840
+ var vS = Ef, wS = La, bS = Nf, yS = Af, SS = Ba, CS = _f, TS = _s, RS = Pf, kS = Mf, ES = Lf, IS = Ff, NS = zf, AS = Bf, _S = Uf, jS = Vf, js = "DropdownMenu", [PS, GT] = fn(
13838
13841
  js,
13839
13842
  [Rf]
13840
13843
  ), Tt = Rf(), [OS, qf] = PS(js), Gf = (e) => {
@@ -13872,7 +13875,7 @@ var Yf = "DropdownMenuTrigger", Xf = m.forwardRef(
13872
13875
  (e, t) => {
13873
13876
  const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = qf(Yf, n), i = Tt(n);
13874
13877
  return /* @__PURE__ */ c.jsx(wS, { asChild: !0, ...i, children: /* @__PURE__ */ c.jsx(
13875
- ke.button,
13878
+ Ee.button,
13876
13879
  {
13877
13880
  type: "button",
13878
13881
  id: s.triggerId,
@@ -13960,12 +13963,12 @@ var zS = "DropdownMenuCheckboxItem", nh = m.forwardRef((e, t) => {
13960
13963
  nh.displayName = zS;
13961
13964
  var BS = "DropdownMenuRadioGroup", HS = m.forwardRef((e, t) => {
13962
13965
  const { __scopeDropdownMenu: n, ...r } = e, o = Tt(n);
13963
- return /* @__PURE__ */ c.jsx(ES, { ...o, ...r, ref: t });
13966
+ return /* @__PURE__ */ c.jsx(kS, { ...o, ...r, ref: t });
13964
13967
  });
13965
13968
  HS.displayName = BS;
13966
13969
  var US = "DropdownMenuRadioItem", rh = m.forwardRef((e, t) => {
13967
13970
  const { __scopeDropdownMenu: n, ...r } = e, o = Tt(n);
13968
- return /* @__PURE__ */ c.jsx(kS, { ...o, ...r, ref: t });
13971
+ return /* @__PURE__ */ c.jsx(ES, { ...o, ...r, ref: t });
13969
13972
  });
13970
13973
  rh.displayName = US;
13971
13974
  var WS = "DropdownMenuItemIndicator", oh = m.forwardRef((e, t) => {
@@ -14147,7 +14150,7 @@ function mi({
14147
14150
  messages: R,
14148
14151
  hasMoreHistory: C,
14149
14152
  isLoadingHistory: T,
14150
- send: E,
14153
+ send: k,
14151
14154
  stop: I,
14152
14155
  loadOlderMessages: A
14153
14156
  } = hu(), {
@@ -14182,11 +14185,11 @@ function mi({
14182
14185
  }, Le = me.current;
14183
14186
  if (!(Le && Le.threadId === ve.threadId && Le.checkpointId === ve.checkpointId && Le.checkpointNs === ve.checkpointNs))
14184
14187
  return x(v).then((Xe) => {
14185
- var k;
14188
+ var E;
14186
14189
  if (re) return;
14187
14190
  const xt = ((Xe == null ? void 0 : Xe.checkpoints) ?? []).slice().sort((b, N) => new Date(N.createdAt).getTime() - new Date(b.createdAt).getTime());
14188
14191
  et(xt);
14189
- const Vt = Fe, $n = Vt && xt.some((b) => b.checkpointId === Vt) ? Vt : ((k = xt[0]) == null ? void 0 : k.checkpointId) ?? null;
14192
+ const Vt = Fe, $n = Vt && xt.some((b) => b.checkpointId === Vt) ? Vt : ((E = xt[0]) == null ? void 0 : E.checkpointId) ?? null;
14190
14193
  let ar = null;
14191
14194
  if ($n) {
14192
14195
  const b = xt.find((N) => N.checkpointId === $n);
@@ -14244,7 +14247,7 @@ function mi({
14244
14247
  }
14245
14248
  }
14246
14249
  try {
14247
- await E(ve || "", {
14250
+ await k(ve || "", {
14248
14251
  checkpointId: Fe ?? W ?? void 0,
14249
14252
  checkpointNs: ft ?? P ?? void 0,
14250
14253
  payloadExtras: Y ? { edit: !0, originalMessageId: Y } : void 0,
@@ -14274,13 +14277,13 @@ function mi({
14274
14277
  for (let Le = re - 1; Le >= 0; Le--)
14275
14278
  if (R[Le].role === "user") {
14276
14279
  const Xe = ve(R[Le]);
14277
- Xe && E(Xe, {
14280
+ Xe && k(Xe, {
14278
14281
  checkpointId: Fe ?? W ?? void 0,
14279
14282
  checkpointNs: ft ?? P ?? void 0
14280
14283
  });
14281
14284
  break;
14282
14285
  }
14283
- }, [R, E, Fe, ft, W, P]), Mn = (re) => {
14286
+ }, [R, k, Fe, ft, W, P]), Mn = (re) => {
14284
14287
  const ve = Array.from(re.target.files || []);
14285
14288
  pe((Le) => [...Le, ...ve]), re.target.value = "";
14286
14289
  }, Mt = (re) => {
@@ -14293,7 +14296,7 @@ function mi({
14293
14296
  if (ve) {
14294
14297
  q(null), ie(null), O(!0);
14295
14298
  try {
14296
- await E("", {
14299
+ await k("", {
14297
14300
  checkpointId: Fe ?? W ?? void 0,
14298
14301
  checkpointNs: ft ?? P ?? void 0,
14299
14302
  attachments: [ve]
@@ -14552,7 +14555,7 @@ var Wa = "ScrollArea", [vh, YT] = fn(Wa), [lC, Wt] = vh(Wa), wh = m.forwardRef(
14552
14555
  dir: o,
14553
14556
  scrollHideDelay: s = 600,
14554
14557
  ...i
14555
- } = e, [a, l] = m.useState(null), [u, d] = m.useState(null), [f, h] = m.useState(null), [p, w] = m.useState(null), [v, g] = m.useState(null), [x, y] = m.useState(0), [S, R] = m.useState(0), [C, T] = m.useState(!1), [E, I] = m.useState(!1), A = ze(t, (D) => l(D)), _ = Ts(o);
14558
+ } = e, [a, l] = m.useState(null), [u, d] = m.useState(null), [f, h] = m.useState(null), [p, w] = m.useState(null), [v, g] = m.useState(null), [x, y] = m.useState(0), [S, R] = m.useState(0), [C, T] = m.useState(!1), [k, I] = m.useState(!1), A = ze(t, (D) => l(D)), _ = Ts(o);
14556
14559
  return /* @__PURE__ */ c.jsx(
14557
14560
  lC,
14558
14561
  {
@@ -14571,12 +14574,12 @@ var Wa = "ScrollArea", [vh, YT] = fn(Wa), [lC, Wt] = vh(Wa), wh = m.forwardRef(
14571
14574
  onScrollbarXEnabledChange: T,
14572
14575
  scrollbarY: v,
14573
14576
  onScrollbarYChange: g,
14574
- scrollbarYEnabled: E,
14577
+ scrollbarYEnabled: k,
14575
14578
  onScrollbarYEnabledChange: I,
14576
14579
  onCornerWidthChange: y,
14577
14580
  onCornerHeightChange: R,
14578
14581
  children: /* @__PURE__ */ c.jsx(
14579
- ke.div,
14582
+ Ee.div,
14580
14583
  {
14581
14584
  dir: _,
14582
14585
  ...i,
@@ -14609,7 +14612,7 @@ var bh = "ScrollAreaViewport", yh = m.forwardRef(
14609
14612
  }
14610
14613
  ),
14611
14614
  /* @__PURE__ */ c.jsx(
14612
- ke.div,
14615
+ Ee.div,
14613
14616
  {
14614
14617
  "data-radix-scroll-area-viewport": "",
14615
14618
  ...s,
@@ -14733,7 +14736,7 @@ var cC = m.forwardRef((e, t) => {
14733
14736
  content: 0,
14734
14737
  viewport: 0,
14735
14738
  scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
14736
- }), u = kh(a.viewport, a.content), d = {
14739
+ }), u = Eh(a.viewport, a.content), d = {
14737
14740
  ...r,
14738
14741
  sizes: a,
14739
14742
  onSizesChange: l,
@@ -14874,7 +14877,7 @@ var cC = m.forwardRef((e, t) => {
14874
14877
  onWheelScroll: d,
14875
14878
  onResize: f,
14876
14879
  ...h
14877
- } = e, p = Wt(pn, n), [w, v] = m.useState(null), g = ze(t, (A) => v(A)), x = m.useRef(null), y = m.useRef(""), S = p.viewport, R = r.content - r.viewport, C = mt(d), T = mt(l), E = Os(f, 10);
14880
+ } = e, p = Wt(pn, n), [w, v] = m.useState(null), g = ze(t, (A) => v(A)), x = m.useRef(null), y = m.useRef(""), S = p.viewport, R = r.content - r.viewport, C = mt(d), T = mt(l), k = Os(f, 10);
14878
14881
  function I(A) {
14879
14882
  if (x.current) {
14880
14883
  const _ = A.clientX - x.current.left, D = A.clientY - x.current.top;
@@ -14887,7 +14890,7 @@ var cC = m.forwardRef((e, t) => {
14887
14890
  (w == null ? void 0 : w.contains(D)) && C(_, R);
14888
14891
  };
14889
14892
  return document.addEventListener("wheel", A, { passive: !1 }), () => document.removeEventListener("wheel", A, { passive: !1 });
14890
- }, [S, w, R, C]), m.useEffect(T, [r, T]), yr(w, E), yr(p.content, E), /* @__PURE__ */ c.jsx(
14893
+ }, [S, w, R, C]), m.useEffect(T, [r, T]), yr(w, k), yr(p.content, k), /* @__PURE__ */ c.jsx(
14891
14894
  hC,
14892
14895
  {
14893
14896
  scope: n,
@@ -14898,7 +14901,7 @@ var cC = m.forwardRef((e, t) => {
14898
14901
  onThumbPositionChange: T,
14899
14902
  onThumbPointerDown: mt(a),
14900
14903
  children: /* @__PURE__ */ c.jsx(
14901
- ke.div,
14904
+ Ee.div,
14902
14905
  {
14903
14906
  ...h,
14904
14907
  ref: g,
@@ -14940,7 +14943,7 @@ var cC = m.forwardRef((e, t) => {
14940
14943
  return a(), f.addEventListener("scroll", h), () => f.removeEventListener("scroll", h);
14941
14944
  }
14942
14945
  }, [s.viewport, d, a]), /* @__PURE__ */ c.jsx(
14943
- ke.div,
14946
+ Ee.div,
14944
14947
  {
14945
14948
  "data-state": i.hasThumb ? "visible" : "hidden",
14946
14949
  ...o,
@@ -14960,13 +14963,13 @@ var cC = m.forwardRef((e, t) => {
14960
14963
  }
14961
14964
  );
14962
14965
  Rh.displayName = Zo;
14963
- var qa = "ScrollAreaCorner", Eh = m.forwardRef(
14966
+ var qa = "ScrollAreaCorner", kh = m.forwardRef(
14964
14967
  (e, t) => {
14965
14968
  const n = Wt(qa, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
14966
14969
  return n.type !== "scroll" && r ? /* @__PURE__ */ c.jsx(mC, { ...e, ref: t }) : null;
14967
14970
  }
14968
14971
  );
14969
- Eh.displayName = qa;
14972
+ kh.displayName = qa;
14970
14973
  var mC = m.forwardRef((e, t) => {
14971
14974
  const { __scopeScrollArea: n, ...r } = e, o = Wt(qa, n), [s, i] = m.useState(0), [a, l] = m.useState(0), u = !!(s && a);
14972
14975
  return yr(o.scrollbarX, () => {
@@ -14978,7 +14981,7 @@ var mC = m.forwardRef((e, t) => {
14978
14981
  const d = ((f = o.scrollbarY) == null ? void 0 : f.offsetWidth) || 0;
14979
14982
  o.onCornerWidthChange(d), i(d);
14980
14983
  }), u ? /* @__PURE__ */ c.jsx(
14981
- ke.div,
14984
+ Ee.div,
14982
14985
  {
14983
14986
  ...r,
14984
14987
  ref: t,
@@ -14997,12 +15000,12 @@ var mC = m.forwardRef((e, t) => {
14997
15000
  function Qo(e) {
14998
15001
  return e ? parseInt(e, 10) : 0;
14999
15002
  }
15000
- function kh(e, t) {
15003
+ function Eh(e, t) {
15001
15004
  const n = e / t;
15002
15005
  return isNaN(n) ? 0 : n;
15003
15006
  }
15004
15007
  function Ps(e) {
15005
- const t = kh(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
15008
+ const t = Eh(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
15006
15009
  return Math.max(r, 18);
15007
15010
  }
15008
15011
  function gC(e, t, n, r = "ltr") {
@@ -15051,7 +15054,7 @@ function yr(e, t) {
15051
15054
  }
15052
15055
  }, [e, n]);
15053
15056
  }
15054
- var Ah = wh, vC = yh, wC = Eh;
15057
+ var Ah = wh, vC = yh, wC = kh;
15055
15058
  const _h = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ c.jsxs(
15056
15059
  Ah,
15057
15060
  {
@@ -15103,7 +15106,7 @@ function Ac({
15103
15106
  deleteThread: v,
15104
15107
  renameThread: g,
15105
15108
  isLoadingThreads: x
15106
- } = ra(), [y, S] = xe(Array.isArray(h) ? h : []), R = Ge(y.length > 0), [C, T] = xe(null), [E, I] = xe(""), [A, _] = xe(!1);
15109
+ } = ra(), [y, S] = xe(Array.isArray(h) ? h : []), R = Ge(y.length > 0), [C, T] = xe(null), [k, I] = xe(""), [A, _] = xe(!1);
15107
15110
  ct(() => {
15108
15111
  const F = Array.isArray(h) ? h : [];
15109
15112
  if (F.length > 0) {
@@ -15138,9 +15141,9 @@ function Ac({
15138
15141
  }, P = (F, B) => {
15139
15142
  B.stopPropagation(), T(F.threadId), I(F.title || `Thread ${F.threadId.slice(0, 8)}`);
15140
15143
  }, Y = async (F) => {
15141
- if (E.trim())
15144
+ if (k.trim())
15142
15145
  try {
15143
- await g(F, E.trim()), T(null), I("");
15146
+ await g(F, k.trim()), T(null), I("");
15144
15147
  } catch (B) {
15145
15148
  console.error("Failed to update title:", B);
15146
15149
  }
@@ -15189,7 +15192,7 @@ function Ac({
15189
15192
  children: [
15190
15193
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
15191
15194
  /* @__PURE__ */ c.jsx("div", { className: "flex-1 min-w-0", children: C === F.threadId ? /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2", onClick: (B) => B.stopPropagation(), children: [
15192
- /* @__PURE__ */ c.jsx(Jo, { value: E, onChange: (B) => I(B.target.value), onKeyDown: (B) => J(B, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
15195
+ /* @__PURE__ */ c.jsx(Jo, { value: k, onChange: (B) => I(B.target.value), onKeyDown: (B) => J(B, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
15193
15196
  /* @__PURE__ */ c.jsx(Ue, { variant: "ghost", size: "sm", onClick: () => Y(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c.jsx(Zi, { size: 12 }) }),
15194
15197
  /* @__PURE__ */ c.jsx(Ue, { variant: "ghost", size: "sm", onClick: K, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c.jsx(fr, { size: 12 }) })
15195
15198
  ] }) : /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
@@ -15328,7 +15331,7 @@ function JT(e) {
15328
15331
  }), TC(e);
15329
15332
  }
15330
15333
  var RC = "Label", Lh = m.forwardRef((e, t) => /* @__PURE__ */ c.jsx(
15331
- ke.label,
15334
+ Ee.label,
15332
15335
  {
15333
15336
  ...e,
15334
15337
  ref: t,
@@ -15340,13 +15343,13 @@ var RC = "Label", Lh = m.forwardRef((e, t) => /* @__PURE__ */ c.jsx(
15340
15343
  ));
15341
15344
  Lh.displayName = RC;
15342
15345
  var $h = Lh;
15343
- const EC = ns(
15346
+ const kC = ns(
15344
15347
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
15345
15348
  ), $t = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15346
15349
  $h,
15347
15350
  {
15348
15351
  ref: n,
15349
- className: te(EC(), e),
15352
+ className: te(kC(), e),
15350
15353
  ...t
15351
15354
  }
15352
15355
  ));
@@ -15355,7 +15358,7 @@ function Fh(e) {
15355
15358
  const t = m.useRef({ value: e, previous: e });
15356
15359
  return m.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
15357
15360
  }
15358
- var Ms = "Switch", [kC, ZT] = fn(Ms), [IC, NC] = kC(Ms), zh = m.forwardRef(
15361
+ var Ms = "Switch", [EC, ZT] = fn(Ms), [IC, NC] = EC(Ms), zh = m.forwardRef(
15359
15362
  (e, t) => {
15360
15363
  const {
15361
15364
  __scopeSwitch: n,
@@ -15376,7 +15379,7 @@ var Ms = "Switch", [kC, ZT] = fn(Ms), [IC, NC] = kC(Ms), zh = m.forwardRef(
15376
15379
  });
15377
15380
  return /* @__PURE__ */ c.jsxs(IC, { scope: n, checked: x, disabled: a, children: [
15378
15381
  /* @__PURE__ */ c.jsx(
15379
- ke.button,
15382
+ Ee.button,
15380
15383
  {
15381
15384
  type: "button",
15382
15385
  role: "switch",
@@ -15415,7 +15418,7 @@ var Bh = "SwitchThumb", Hh = m.forwardRef(
15415
15418
  (e, t) => {
15416
15419
  const { __scopeSwitch: n, ...r } = e, o = NC(Bh, n);
15417
15420
  return /* @__PURE__ */ c.jsx(
15418
- ke.span,
15421
+ Ee.span,
15419
15422
  {
15420
15423
  "data-state": Wh(o.checked),
15421
15424
  "data-disabled": o.disabled ? "" : void 0,
@@ -15506,7 +15509,7 @@ var Kh = Object.freeze({
15506
15509
  wordWrap: "normal"
15507
15510
  }), jC = "VisuallyHidden", PC = m.forwardRef(
15508
15511
  (e, t) => /* @__PURE__ */ c.jsx(
15509
- ke.span,
15512
+ Ee.span,
15510
15513
  {
15511
15514
  ...e,
15512
15515
  ref: t,
@@ -15534,7 +15537,7 @@ var OC = [" ", "Enter", "ArrowUp", "ArrowDown"], MC = [" ", "Enter"], Jn = "Sele
15534
15537
  disabled: h,
15535
15538
  required: p,
15536
15539
  form: w
15537
- } = e, v = $s(t), [g, x] = m.useState(null), [y, S] = m.useState(null), [R, C] = m.useState(!1), T = Ts(u), [E, I] = Gn({
15540
+ } = e, v = $s(t), [g, x] = m.useState(null), [y, S] = m.useState(null), [R, C] = m.useState(!1), T = Ts(u), [k, I] = Gn({
15538
15541
  prop: r,
15539
15542
  defaultProp: o ?? !1,
15540
15543
  onChange: s,
@@ -15559,7 +15562,7 @@ var OC = [" ", "Enter", "ArrowUp", "ArrowDown"], MC = [" ", "Enter"], Jn = "Sele
15559
15562
  contentId: ln(),
15560
15563
  value: A,
15561
15564
  onValueChange: _,
15562
- open: E,
15565
+ open: k,
15563
15566
  onOpenChange: I,
15564
15567
  dir: T,
15565
15568
  triggerPointerDownPosRef: D,
@@ -15617,7 +15620,7 @@ var Gh = "SelectTrigger", Yh = m.forwardRef(
15617
15620
  });
15618
15621
  };
15619
15622
  return /* @__PURE__ */ c.jsx(mf, { asChild: !0, ...s, children: /* @__PURE__ */ c.jsx(
15620
- ke.button,
15623
+ Ee.button,
15621
15624
  {
15622
15625
  type: "button",
15623
15626
  role: "combobox",
@@ -15655,7 +15658,7 @@ var Xh = "SelectValue", Jh = m.forwardRef(
15655
15658
  return pt(() => {
15656
15659
  u(d);
15657
15660
  }, [u, d]), /* @__PURE__ */ c.jsx(
15658
- ke.span,
15661
+ Ee.span,
15659
15662
  {
15660
15663
  ...a,
15661
15664
  ref: f,
@@ -15669,7 +15672,7 @@ Jh.displayName = Xh;
15669
15672
  var zC = "SelectIcon", Zh = m.forwardRef(
15670
15673
  (e, t) => {
15671
15674
  const { __scopeSelect: n, children: r, ...o } = e;
15672
- return /* @__PURE__ */ c.jsx(ke.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
15675
+ return /* @__PURE__ */ c.jsx(Ee.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
15673
15676
  }
15674
15677
  );
15675
15678
  Zh.displayName = zC;
@@ -15713,7 +15716,7 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
15713
15716
  avoidCollisions: g,
15714
15717
  //
15715
15718
  ...x
15716
- } = e, y = jn(Zn, n), [S, R] = m.useState(null), [C, T] = m.useState(null), E = ze(t, (G) => R(G)), [I, A] = m.useState(null), [_, D] = m.useState(
15719
+ } = e, y = jn(Zn, n), [S, R] = m.useState(null), [C, T] = m.useState(null), k = ze(t, (G) => R(G)), [I, A] = m.useState(null), [_, D] = m.useState(
15717
15720
  null
15718
15721
  ), L = Ls(n), [W, P] = m.useState(!1), Y = m.useRef(!1);
15719
15722
  m.useEffect(() => {
@@ -15831,7 +15834,7 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
15831
15834
  ...x,
15832
15835
  ...Ce,
15833
15836
  onPlaced: () => P(!0),
15834
- ref: E,
15837
+ ref: k,
15835
15838
  style: {
15836
15839
  // flex layout so we can place the scroll buttons properly
15837
15840
  display: "flex",
@@ -15863,11 +15866,11 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
15863
15866
  );
15864
15867
  np.displayName = HC;
15865
15868
  var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15866
- const { __scopeSelect: n, onPlaced: r, ...o } = e, s = jn(Zn, n), i = Pn(Zn, n), [a, l] = m.useState(null), [u, d] = m.useState(null), f = ze(t, (E) => d(E)), h = Ls(n), p = m.useRef(!1), w = m.useRef(!0), { viewport: v, selectedItem: g, selectedItemText: x, focusSelectedItem: y } = i, S = m.useCallback(() => {
15869
+ const { __scopeSelect: n, onPlaced: r, ...o } = e, s = jn(Zn, n), i = Pn(Zn, n), [a, l] = m.useState(null), [u, d] = m.useState(null), f = ze(t, (k) => d(k)), h = Ls(n), p = m.useRef(!1), w = m.useRef(!0), { viewport: v, selectedItem: g, selectedItemText: x, focusSelectedItem: y } = i, S = m.useCallback(() => {
15867
15870
  if (s.trigger && s.valueNode && a && u && v && g && x) {
15868
- const E = s.trigger.getBoundingClientRect(), I = u.getBoundingClientRect(), A = s.valueNode.getBoundingClientRect(), _ = x.getBoundingClientRect();
15871
+ const k = s.trigger.getBoundingClientRect(), I = u.getBoundingClientRect(), A = s.valueNode.getBoundingClientRect(), _ = x.getBoundingClientRect();
15869
15872
  if (s.dir !== "rtl") {
15870
- const ce = _.left - I.left, ie = A.left - ce, $e = E.left - ie, Ke = E.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15873
+ const ce = _.left - I.left, ie = A.left - ce, $e = k.left - ie, Ke = k.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15871
15874
  Kt,
15872
15875
  // Prevents the content from going off the starting edge of the
15873
15876
  // viewport. It may still go off the ending edge, but this can be
@@ -15878,13 +15881,13 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15878
15881
  ]);
15879
15882
  a.style.minWidth = Ke + "px", a.style.left = Pe + "px";
15880
15883
  } else {
15881
- const ce = I.right - _.right, ie = window.innerWidth - A.right - ce, $e = window.innerWidth - E.right - ie, Ke = E.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15884
+ const ce = I.right - _.right, ie = window.innerWidth - A.right - ce, $e = window.innerWidth - k.right - ie, Ke = k.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15882
15885
  Kt,
15883
15886
  Math.max(Kt, Te - We)
15884
15887
  ]);
15885
15888
  a.style.minWidth = Ke + "px", a.style.right = Pe + "px";
15886
15889
  }
15887
- const D = h(), L = window.innerHeight - Kt * 2, W = v.scrollHeight, P = window.getComputedStyle(u), Y = parseInt(P.borderTopWidth, 10), K = parseInt(P.paddingTop, 10), J = parseInt(P.borderBottomWidth, 10), z = parseInt(P.paddingBottom, 10), $ = Y + K + W + z + J, F = Math.min(g.offsetHeight * 5, $), B = window.getComputedStyle(v), pe = parseInt(B.paddingTop, 10), ue = parseInt(B.paddingBottom, 10), ee = E.top + E.height / 2 - Kt, Ie = L - ee, Ce = g.offsetHeight / 2, G = g.offsetTop + Ce, O = Y + K + G, Q = $ - O;
15890
+ const D = h(), L = window.innerHeight - Kt * 2, W = v.scrollHeight, P = window.getComputedStyle(u), Y = parseInt(P.borderTopWidth, 10), K = parseInt(P.paddingTop, 10), J = parseInt(P.borderBottomWidth, 10), z = parseInt(P.paddingBottom, 10), $ = Y + K + W + z + J, F = Math.min(g.offsetHeight * 5, $), B = window.getComputedStyle(v), pe = parseInt(B.paddingTop, 10), ue = parseInt(B.paddingBottom, 10), ee = k.top + k.height / 2 - Kt, Ie = L - ee, Ce = g.offsetHeight / 2, G = g.offsetTop + Ce, O = Y + K + G, Q = $ - O;
15888
15891
  if (O <= ee) {
15889
15892
  const ce = D.length > 0 && g === D[D.length - 1].ref.current;
15890
15893
  a.style.bottom = "0px";
@@ -15924,8 +15927,8 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15924
15927
  u && C(window.getComputedStyle(u).zIndex);
15925
15928
  }, [u]);
15926
15929
  const T = m.useCallback(
15927
- (E) => {
15928
- E && w.current === !0 && (S(), y == null || y(), w.current = !1);
15930
+ (k) => {
15931
+ k && w.current === !0 && (S(), y == null || y(), w.current = !1);
15929
15932
  },
15930
15933
  [S, y]
15931
15934
  );
@@ -15947,7 +15950,7 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15947
15950
  zIndex: R
15948
15951
  },
15949
15952
  children: /* @__PURE__ */ c.jsx(
15950
- ke.div,
15953
+ Ee.div,
15951
15954
  {
15952
15955
  ...o,
15953
15956
  ref: f,
@@ -16010,7 +16013,7 @@ var [KC, Ga] = Ir(Zn, {}), Ki = "SelectViewport", op = m.forwardRef(
16010
16013
  }
16011
16014
  ),
16012
16015
  /* @__PURE__ */ c.jsx(Ds.Slot, { scope: n, children: /* @__PURE__ */ c.jsx(
16013
- ke.div,
16016
+ Ee.div,
16014
16017
  {
16015
16018
  "data-radix-select-viewport": "",
16016
16019
  role: "presentation",
@@ -16052,14 +16055,14 @@ op.displayName = Ki;
16052
16055
  var sp = "SelectGroup", [qC, GC] = Ir(sp), YC = m.forwardRef(
16053
16056
  (e, t) => {
16054
16057
  const { __scopeSelect: n, ...r } = e, o = ln();
16055
- return /* @__PURE__ */ c.jsx(qC, { scope: n, id: o, children: /* @__PURE__ */ c.jsx(ke.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
16058
+ return /* @__PURE__ */ c.jsx(qC, { scope: n, id: o, children: /* @__PURE__ */ c.jsx(Ee.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
16056
16059
  }
16057
16060
  );
16058
16061
  YC.displayName = sp;
16059
16062
  var ip = "SelectLabel", ap = m.forwardRef(
16060
16063
  (e, t) => {
16061
16064
  const { __scopeSelect: n, ...r } = e, o = GC(ip, n);
16062
- return /* @__PURE__ */ c.jsx(ke.div, { id: o.id, ...r, ref: t });
16065
+ return /* @__PURE__ */ c.jsx(Ee.div, { id: o.id, ...r, ref: t });
16063
16066
  }
16064
16067
  );
16065
16068
  ap.displayName = ip;
@@ -16103,7 +16106,7 @@ var es = "SelectItem", [XC, lp] = Ir(es), cp = m.forwardRef(
16103
16106
  disabled: o,
16104
16107
  textValue: d,
16105
16108
  children: /* @__PURE__ */ c.jsx(
16106
- ke.div,
16109
+ Ee.div,
16107
16110
  {
16108
16111
  role: "option",
16109
16112
  "aria-labelledby": v,
@@ -16162,7 +16165,7 @@ var Or = "SelectItemText", up = m.forwardRef(
16162
16165
  [l.disabled, l.value, p]
16163
16166
  ), { onNativeOptionAdd: v, onNativeOptionRemove: g } = u;
16164
16167
  return pt(() => (v(w), () => g(w)), [v, g, w]), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
16165
- /* @__PURE__ */ c.jsx(ke.span, { id: l.textId, ...s, ref: h }),
16168
+ /* @__PURE__ */ c.jsx(Ee.span, { id: l.textId, ...s, ref: h }),
16166
16169
  l.isSelected && i.valueNode && !i.valueNodeHasChildren ? rs.createPortal(s.children, i.valueNode) : null
16167
16170
  ] });
16168
16171
  }
@@ -16171,7 +16174,7 @@ up.displayName = Or;
16171
16174
  var dp = "SelectItemIndicator", fp = m.forwardRef(
16172
16175
  (e, t) => {
16173
16176
  const { __scopeSelect: n, ...r } = e;
16174
- return lp(dp, n).isSelected ? /* @__PURE__ */ c.jsx(ke.span, { "aria-hidden": !0, ...r, ref: t }) : null;
16177
+ return lp(dp, n).isSelected ? /* @__PURE__ */ c.jsx(Ee.span, { "aria-hidden": !0, ...r, ref: t }) : null;
16175
16178
  }
16176
16179
  );
16177
16180
  fp.displayName = dp;
@@ -16232,7 +16235,7 @@ var mp = m.forwardRef((e, t) => {
16232
16235
  const u = a().find((f) => f.ref.current === document.activeElement);
16233
16236
  (d = u == null ? void 0 : u.ref.current) == null || d.scrollIntoView({ block: "nearest" });
16234
16237
  }, [a]), /* @__PURE__ */ c.jsx(
16235
- ke.div,
16238
+ Ee.div,
16236
16239
  {
16237
16240
  "aria-hidden": !0,
16238
16241
  ...o,
@@ -16253,7 +16256,7 @@ var mp = m.forwardRef((e, t) => {
16253
16256
  }), JC = "SelectSeparator", gp = m.forwardRef(
16254
16257
  (e, t) => {
16255
16258
  const { __scopeSelect: n, ...r } = e;
16256
- return /* @__PURE__ */ c.jsx(ke.div, { "aria-hidden": !0, ...r, ref: t });
16259
+ return /* @__PURE__ */ c.jsx(Ee.div, { "aria-hidden": !0, ...r, ref: t });
16257
16260
  }
16258
16261
  );
16259
16262
  gp.displayName = JC;
@@ -16279,7 +16282,7 @@ var QC = "SelectBubbleInput", xp = m.forwardRef(
16279
16282
  d.call(a, t), a.dispatchEvent(f);
16280
16283
  }
16281
16284
  }, [i, t]), /* @__PURE__ */ c.jsx(
16282
- ke.select,
16285
+ Ee.select,
16283
16286
  {
16284
16287
  ...n,
16285
16288
  style: { ...Kh, ...n.style },
@@ -16319,7 +16322,7 @@ function bp(e, t, n) {
16319
16322
  function eT(e, t) {
16320
16323
  return e.map((n, r) => e[(t + r) % e.length]);
16321
16324
  }
16322
- var tT = qh, yp = Yh, nT = Jh, rT = Zh, oT = Qh, Sp = ep, sT = op, Cp = ap, Tp = cp, iT = up, aT = fp, Rp = hp, Ep = pp, kp = gp;
16325
+ var tT = qh, yp = Yh, nT = Jh, rT = Zh, oT = Qh, Sp = ep, sT = op, Cp = ap, Tp = cp, iT = up, aT = fp, Rp = hp, kp = pp, Ep = gp;
16323
16326
  const _c = tT, jc = nT, Xi = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ c.jsxs(
16324
16327
  yp,
16325
16328
  {
@@ -16350,7 +16353,7 @@ const Ip = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16350
16353
  ));
16351
16354
  Ip.displayName = Rp.displayName;
16352
16355
  const Np = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16353
- Ep,
16356
+ kp,
16354
16357
  {
16355
16358
  ref: n,
16356
16359
  className: te(
@@ -16361,7 +16364,7 @@ const Np = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16361
16364
  children: /* @__PURE__ */ c.jsx(dr, { className: "h-4 w-4" })
16362
16365
  }
16363
16366
  ));
16364
- Np.displayName = Ep.displayName;
16367
+ Np.displayName = kp.displayName;
16365
16368
  const Ji = m.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ c.jsx(oT, { children: /* @__PURE__ */ c.jsxs(
16366
16369
  Sp,
16367
16370
  {
@@ -16416,18 +16419,18 @@ const zn = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
16416
16419
  ));
16417
16420
  zn.displayName = Tp.displayName;
16418
16421
  const cT = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16419
- kp,
16422
+ Ep,
16420
16423
  {
16421
16424
  ref: n,
16422
16425
  className: te("-mx-1 my-1 h-px bg-muted", e),
16423
16426
  ...t
16424
16427
  }
16425
16428
  ));
16426
- cT.displayName = kp.displayName;
16429
+ cT.displayName = Ep.displayName;
16427
16430
  var uT = "Separator", Pc = "horizontal", dT = ["horizontal", "vertical"], Ap = m.forwardRef((e, t) => {
16428
16431
  const { decorative: n, orientation: r = Pc, ...o } = e, s = fT(r) ? r : Pc, a = n ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
16429
16432
  return /* @__PURE__ */ c.jsx(
16430
- ke.div,
16433
+ Ee.div,
16431
16434
  {
16432
16435
  "data-orientation": s,
16433
16436
  ...a,
@@ -16607,7 +16610,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
16607
16610
  /* @__PURE__ */ c.jsx(om, { className: "h-5 w-5" }),
16608
16611
  "API Configuration"
16609
16612
  ] }) }),
16610
- /* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
16613
+ /* @__PURE__ */ c.jsxs(Eo, { className: "space-y-4", children: [
16611
16614
  /* @__PURE__ */ c.jsxs("div", { className: "space-y-2", children: [
16612
16615
  /* @__PURE__ */ c.jsx($t, { htmlFor: "api-url", children: "API Base URL" }),
16613
16616
  /* @__PURE__ */ c.jsxs("div", { className: "flex gap-2", children: [
@@ -16674,7 +16677,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
16674
16677
  /* @__PURE__ */ c.jsx(am, { className: "h-5 w-5" }),
16675
16678
  "Interface Settings"
16676
16679
  ] }) }),
16677
- /* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
16680
+ /* @__PURE__ */ c.jsxs(Eo, { className: "space-y-4", children: [
16678
16681
  /* @__PURE__ */ c.jsxs("div", { className: "space-y-2", children: [
16679
16682
  /* @__PURE__ */ c.jsx($t, { htmlFor: "layout", children: "Layout Style" }),
16680
16683
  /* @__PURE__ */ c.jsxs(
@@ -16769,7 +16772,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
16769
16772
  /* @__PURE__ */ c.jsx(lm, { className: "h-5 w-5" }),
16770
16773
  "Behavior Settings"
16771
16774
  ] }) }),
16772
- /* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
16775
+ /* @__PURE__ */ c.jsxs(Eo, { className: "space-y-4", children: [
16773
16776
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
16774
16777
  /* @__PURE__ */ c.jsxs("div", { children: [
16775
16778
  /* @__PURE__ */ c.jsx($t, { htmlFor: "auto-save", children: "Auto-save Conversations" }),