teodor-new-chat-ui 4.3.288 → 4.3.289

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
@@ -288,7 +288,7 @@ function Em() {
288
288
  var de = R ? R.displayName || R.name : "", fe = de ? D(de) : "";
289
289
  return typeof R == "function" && ne.set(R, fe), fe;
290
290
  }
291
- function $e(R, W, le) {
291
+ function Me(R, W, le) {
292
292
  return q(R, !1);
293
293
  }
294
294
  function Ue(R) {
@@ -311,7 +311,7 @@ function Em() {
311
311
  if (typeof R == "object")
312
312
  switch (R.$$typeof) {
313
313
  case l:
314
- return $e(R.render);
314
+ return Me(R.render);
315
315
  case f:
316
316
  return Ze(R.type, W, le);
317
317
  case p: {
@@ -324,13 +324,13 @@ function Em() {
324
324
  }
325
325
  return "";
326
326
  }
327
- var re = Object.prototype.hasOwnProperty, me = {}, De = g.ReactDebugCurrentFrame;
327
+ var re = Object.prototype.hasOwnProperty, me = {}, Le = g.ReactDebugCurrentFrame;
328
328
  function Fe(R) {
329
329
  if (R) {
330
330
  var W = R._owner, le = Ze(R.type, R._source, W ? W.type : null);
331
- De.setExtraStackFrame(le);
331
+ Le.setExtraStackFrame(le);
332
332
  } else
333
- De.setExtraStackFrame(null);
333
+ Le.setExtraStackFrame(null);
334
334
  }
335
335
  function Pe(R, W, le, Ee, tt) {
336
336
  {
@@ -874,10 +874,10 @@ const lg = (e) => {
874
874
  asap: dg,
875
875
  isIterable: fg
876
876
  };
877
- function Me(e, t, n, r, o) {
877
+ function De(e, t, n, r, o) {
878
878
  Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
879
879
  }
880
- O.inherits(Me, Error, {
880
+ O.inherits(De, Error, {
881
881
  toJSON: function() {
882
882
  return {
883
883
  // Standard
@@ -898,7 +898,7 @@ O.inherits(Me, Error, {
898
898
  };
899
899
  }
900
900
  });
901
- const eu = Me.prototype, tu = {};
901
+ const eu = De.prototype, tu = {};
902
902
  [
903
903
  "ERR_BAD_OPTION_VALUE",
904
904
  "ERR_BAD_OPTION",
@@ -916,15 +916,15 @@ const eu = Me.prototype, tu = {};
916
916
  ].forEach((e) => {
917
917
  tu[e] = { value: e };
918
918
  });
919
- Object.defineProperties(Me, tu);
919
+ Object.defineProperties(De, tu);
920
920
  Object.defineProperty(eu, "isAxiosError", { value: !0 });
921
- Me.from = (e, t, n, r, o, s) => {
921
+ De.from = (e, t, n, r, o, s) => {
922
922
  const i = Object.create(eu);
923
923
  O.toFlatObject(e, i, function(d) {
924
924
  return d !== Error.prototype;
925
925
  }, (c) => c !== "isAxiosError");
926
926
  const a = e && e.message ? e.message : "Error", l = t == null && e ? e.code : t;
927
- return Me.call(i, a, l, n, r, o), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", s && Object.assign(i, s), i;
927
+ return De.call(i, a, l, n, r, o), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", s && Object.assign(i, s), i;
928
928
  };
929
929
  const pg = null;
930
930
  function Ni(e) {
@@ -964,7 +964,7 @@ function bs(e, t, n) {
964
964
  if (O.isBoolean(m))
965
965
  return m.toString();
966
966
  if (!l && O.isBlob(m))
967
- throw new Me("Blob is not supported. Use a Buffer instead.");
967
+ throw new De("Blob is not supported. Use a Buffer instead.");
968
968
  return O.isArrayBuffer(m) || O.isTypedArray(m) ? l && typeof Blob == "function" ? new Blob([m]) : Buffer.from(m) : m;
969
969
  }
970
970
  function d(m, x, y) {
@@ -1215,7 +1215,7 @@ const uo = {
1215
1215
  return JSON.parse(t, this.parseReviver);
1216
1216
  } catch (a) {
1217
1217
  if (i)
1218
- throw a.name === "SyntaxError" ? Me.from(a, Me.ERR_BAD_RESPONSE, this, null, this.response) : a;
1218
+ throw a.name === "SyntaxError" ? De.from(a, De.ERR_BAD_RESPONSE, this, null, this.response) : a;
1219
1219
  }
1220
1220
  }
1221
1221
  return t;
@@ -1458,16 +1458,16 @@ function au(e) {
1458
1458
  return !!(e && e.__CANCEL__);
1459
1459
  }
1460
1460
  function Er(e, t, n) {
1461
- Me.call(this, e ?? "canceled", Me.ERR_CANCELED, t, n), this.name = "CanceledError";
1461
+ De.call(this, e ?? "canceled", De.ERR_CANCELED, t, n), this.name = "CanceledError";
1462
1462
  }
1463
- O.inherits(Er, Me, {
1463
+ O.inherits(Er, De, {
1464
1464
  __CANCEL__: !0
1465
1465
  });
1466
1466
  function lu(e, t, n) {
1467
1467
  const r = n.config.validateStatus;
1468
- !n.status || !r || r(n.status) ? e(n) : t(new Me(
1468
+ !n.status || !r || r(n.status) ? e(n) : t(new De(
1469
1469
  "Request failed with status code " + n.status,
1470
- [Me.ERR_BAD_REQUEST, Me.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
1470
+ [De.ERR_BAD_REQUEST, De.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
1471
1471
  n.config,
1472
1472
  n.request,
1473
1473
  n
@@ -1690,16 +1690,16 @@ const uu = (e) => {
1690
1690
  "onloadend" in y ? y.onloadend = g : y.onreadystatechange = function() {
1691
1691
  !y || y.readyState !== 4 || y.status === 0 && !(y.responseURL && y.responseURL.indexOf("file:") === 0) || setTimeout(g);
1692
1692
  }, y.onabort = function() {
1693
- y && (r(new Me("Request aborted", Me.ECONNABORTED, e, y)), y = null);
1693
+ y && (r(new De("Request aborted", De.ECONNABORTED, e, y)), y = null);
1694
1694
  }, y.onerror = function(T) {
1695
- const C = T && T.message ? T.message : "Network Error", S = new Me(C, Me.ERR_NETWORK, e, y);
1695
+ const C = T && T.message ? T.message : "Network Error", S = new De(C, De.ERR_NETWORK, e, y);
1696
1696
  S.event = T || null, r(S), y = null;
1697
1697
  }, y.ontimeout = function() {
1698
1698
  let T = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
1699
1699
  const C = o.transitional || su;
1700
- o.timeoutErrorMessage && (T = o.timeoutErrorMessage), r(new Me(
1700
+ o.timeoutErrorMessage && (T = o.timeoutErrorMessage), r(new De(
1701
1701
  T,
1702
- C.clarifyTimeoutError ? Me.ETIMEDOUT : Me.ECONNABORTED,
1702
+ C.clarifyTimeoutError ? De.ETIMEDOUT : De.ECONNABORTED,
1703
1703
  e,
1704
1704
  y
1705
1705
  )), y = null;
@@ -1710,7 +1710,7 @@ const uu = (e) => {
1710
1710
  }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
1711
1711
  const w = Mg(o.url);
1712
1712
  if (w && Lt.protocols.indexOf(w) === -1) {
1713
- r(new Me("Unsupported protocol " + w + ":", Me.ERR_BAD_REQUEST, e));
1713
+ r(new De("Unsupported protocol " + w + ":", De.ERR_BAD_REQUEST, e));
1714
1714
  return;
1715
1715
  }
1716
1716
  y.send(s || null);
@@ -1723,11 +1723,11 @@ const uu = (e) => {
1723
1723
  if (!o) {
1724
1724
  o = !0, a();
1725
1725
  const d = c instanceof Error ? c : this.reason;
1726
- r.abort(d instanceof Me ? d : new Er(d instanceof Error ? d.message : d));
1726
+ r.abort(d instanceof De ? d : new Er(d instanceof Error ? d.message : d));
1727
1727
  }
1728
1728
  };
1729
1729
  let i = t && setTimeout(() => {
1730
- i = null, s(new Me(`timeout ${t} of ms exceeded`, Me.ETIMEDOUT));
1730
+ i = null, s(new De(`timeout ${t} of ms exceeded`, De.ETIMEDOUT));
1731
1731
  }, t);
1732
1732
  const a = () => {
1733
1733
  e && (i && clearTimeout(i), i = null, e.forEach((c) => {
@@ -1832,7 +1832,7 @@ const uu = (e) => {
1832
1832
  let g = x && x[m];
1833
1833
  if (g)
1834
1834
  return g.call(x);
1835
- throw new Me(`Response type '${m}' is not supported`, Me.ERR_NOT_SUPPORT, y);
1835
+ throw new De(`Response type '${m}' is not supported`, De.ERR_NOT_SUPPORT, y);
1836
1836
  });
1837
1837
  });
1838
1838
  const p = async (m) => {
@@ -1932,11 +1932,11 @@ const uu = (e) => {
1932
1932
  });
1933
1933
  } catch (A) {
1934
1934
  throw I && I(), A && A.name === "TypeError" && /Load failed|fetch/i.test(A.message) ? Object.assign(
1935
- new Me("Network Error", Me.ERR_NETWORK, m, $),
1935
+ new De("Network Error", De.ERR_NETWORK, m, $),
1936
1936
  {
1937
1937
  cause: A.cause || A
1938
1938
  }
1939
- ) : Me.from(A, A && A.code, m, $);
1939
+ ) : De.from(A, A && A.code, m, $);
1940
1940
  }
1941
1941
  };
1942
1942
  }, Xg = /* @__PURE__ */ new Map(), du = (e) => {
@@ -1978,7 +1978,7 @@ const bl = (e) => `- ${e}`, Jg = (e) => O.isFunction(e) || e === null || e === !
1978
1978
  r = e[i];
1979
1979
  let a;
1980
1980
  if (o = r, !Jg(r) && (o = _i[(a = String(r)).toLowerCase()], o === void 0))
1981
- throw new Me(`Unknown adapter '${a}'`);
1981
+ throw new De(`Unknown adapter '${a}'`);
1982
1982
  if (o && (O.isFunction(o) || (o = o.get(t))))
1983
1983
  break;
1984
1984
  s[a || "#" + i] = o;
@@ -1990,7 +1990,7 @@ const bl = (e) => `- ${e}`, Jg = (e) => O.isFunction(e) || e === null || e === !
1990
1990
  let a = n ? i.length > 1 ? `since :
1991
1991
  ` + i.map(bl).join(`
1992
1992
  `) : " " + bl(i[0]) : "as no adapter specified";
1993
- throw new Me(
1993
+ throw new De(
1994
1994
  "There is no suitable adapter to dispatch the request " + a,
1995
1995
  "ERR_NOT_SUPPORT"
1996
1996
  );
@@ -2034,9 +2034,9 @@ Ss.transitional = function(t, n, r) {
2034
2034
  }
2035
2035
  return (s, i, a) => {
2036
2036
  if (t === !1)
2037
- throw new Me(
2037
+ throw new De(
2038
2038
  o(i, " has been removed" + (n ? " in " + n : "")),
2039
- Me.ERR_DEPRECATED
2039
+ De.ERR_DEPRECATED
2040
2040
  );
2041
2041
  return n && !Cl[i] && (Cl[i] = !0, console.warn(
2042
2042
  o(
@@ -2051,7 +2051,7 @@ Ss.spelling = function(t) {
2051
2051
  };
2052
2052
  function Zg(e, t, n) {
2053
2053
  if (typeof e != "object")
2054
- throw new Me("options must be an object", Me.ERR_BAD_OPTION_VALUE);
2054
+ throw new De("options must be an object", De.ERR_BAD_OPTION_VALUE);
2055
2055
  const r = Object.keys(e);
2056
2056
  let o = r.length;
2057
2057
  for (; o-- > 0; ) {
@@ -2059,11 +2059,11 @@ function Zg(e, t, n) {
2059
2059
  if (i) {
2060
2060
  const a = e[s], l = a === void 0 || i(a, s, e);
2061
2061
  if (l !== !0)
2062
- throw new Me("option " + s + " must be " + l, Me.ERR_BAD_OPTION_VALUE);
2062
+ throw new De("option " + s + " must be " + l, De.ERR_BAD_OPTION_VALUE);
2063
2063
  continue;
2064
2064
  }
2065
2065
  if (n !== !0)
2066
- throw new Me("Unknown option " + s, Me.ERR_BAD_OPTION);
2066
+ throw new De("Unknown option " + s, De.ERR_BAD_OPTION);
2067
2067
  }
2068
2068
  }
2069
2069
  const Do = {
@@ -2356,7 +2356,7 @@ It.CancelToken = Qg;
2356
2356
  It.isCancel = au;
2357
2357
  It.VERSION = pu;
2358
2358
  It.toFormData = bs;
2359
- It.AxiosError = Me;
2359
+ It.AxiosError = De;
2360
2360
  It.Cancel = It.CanceledError;
2361
2361
  It.all = function(t) {
2362
2362
  return Promise.all(t);
@@ -3048,7 +3048,7 @@ function Ox(e = {}) {
3048
3048
  threadId: I.threadId ?? null,
3049
3049
  headers: {}
3050
3050
  }, (async () => {
3051
- var pe, Re, Ae, K, oe, Y, D, H, ne, se, q, $e, Ue, Ze, re, me, De, Fe;
3051
+ var pe, Re, Ae, K, oe, Y, D, H, ne, se, q, Me, Ue, Ze, re, me, Le, Fe;
3052
3052
  const G = (Pe) => {
3053
3053
  var et;
3054
3054
  try {
@@ -3215,7 +3215,7 @@ function Ox(e = {}) {
3215
3215
  m(ee.checkpointId);
3216
3216
  else if (ee.type === "error") {
3217
3217
  const ae = ee;
3218
- if (d(ae.message), L = "error", _ = ae.message, ae.error_type === "auth_error" || ae.code === "TOKEN_EXPIRED" || ((ne = ae.message) == null ? void 0 : ne.includes("token")) || ((se = ae.message) == null ? void 0 : se.includes("401")) || ((q = ae.message) == null ? void 0 : q.includes("unauthorized")) || (($e = ae.message) == null ? void 0 : $e.includes("Unauthorized"))) {
3218
+ if (d(ae.message), L = "error", _ = ae.message, ae.error_type === "auth_error" || ae.code === "TOKEN_EXPIRED" || ((ne = ae.message) == null ? void 0 : ne.includes("token")) || ((se = ae.message) == null ? void 0 : se.includes("401")) || ((q = ae.message) == null ? void 0 : q.includes("unauthorized")) || ((Me = ae.message) == null ? void 0 : Me.includes("Unauthorized"))) {
3219
3219
  console.error("[use-chat] Auth error detected:", ae.message);
3220
3220
  try {
3221
3221
  (Ue = A == null ? void 0 : A.onAuthError) == null || Ue.call(A, ae.message);
@@ -3249,7 +3249,7 @@ function Ox(e = {}) {
3249
3249
  L = L ?? "aborted";
3250
3250
  else {
3251
3251
  const et = Pe.message || String(Pe);
3252
- L = "error", _ = et, d(et), (me = A == null ? void 0 : A.onError) == null || me.call(A, et), J || ((De = A == null ? void 0 : A.onConnectionError) == null || De.call(A, et), J = !0);
3252
+ L = "error", _ = et, d(et), (me = A == null ? void 0 : A.onError) == null || me.call(A, et), J || ((Le = A == null ? void 0 : A.onConnectionError) == null || Le.call(A, et), J = !0);
3253
3253
  }
3254
3254
  } finally {
3255
3255
  const Pe = C.current, et = k.current, We = E.current, Ge = N.current, qe = L ?? (X.signal.aborted ? "aborted" : _ ? "error" : "complete");
@@ -3995,7 +3995,7 @@ function qx({
3995
3995
  console.log(`[ChatSessionProvider] Cached metadata for ${Se.length} checkpoints from ${ee}`), ne(V, Se);
3996
3996
  },
3997
3997
  [ne]
3998
- ), q = He(m), $e = He(null), Ue = He(null), Ze = He(null), re = He(null), me = He(!1), De = He(null), Fe = He(/* @__PURE__ */ new Map());
3998
+ ), q = He(m), Me = He(null), Ue = He(null), Ze = He(null), re = He(null), me = He(!1), Le = He(null), Fe = He(/* @__PURE__ */ new Map());
3999
3999
  Et(() => {
4000
4000
  q.current = m;
4001
4001
  }, [m]);
@@ -4033,7 +4033,7 @@ function qx({
4033
4033
  N((ae == null ? void 0 : ae.messages) ?? [], {
4034
4034
  checkpointId: (ae == null ? void 0 : ae.checkpointId) ?? null,
4035
4035
  checkpointNs: (ae == null ? void 0 : ae.checkpointNs) ?? null
4036
- }), oe(Se), K(ee), I(!!(ae != null && ae.nextCursor)), L((ae == null ? void 0 : ae.nextCursor) ?? null), De.current = `${ie}:latest`, Ue.current = null, Ze.current = null;
4036
+ }), oe(Se), K(ee), I(!!(ae != null && ae.nextCursor)), L((ae == null ? void 0 : ae.nextCursor) ?? null), Le.current = `${ie}:latest`, Ue.current = null, Ze.current = null;
4037
4037
  },
4038
4038
  [K, oe, se, N]
4039
4039
  ), Ge = ke((V) => {
@@ -4115,7 +4115,7 @@ function qx({
4115
4115
  } finally {
4116
4116
  Fe.current.delete(ee);
4117
4117
  }
4118
- return q.current === V && (De.current = ee), ae;
4118
+ return q.current === V && (Le.current = ee), ae;
4119
4119
  },
4120
4120
  [c, N, s, se]
4121
4121
  ), Ct = ke(
@@ -4133,18 +4133,20 @@ function qx({
4133
4133
  if (!o || !m || T || St)
4134
4134
  return;
4135
4135
  if (Ue.current === m) {
4136
- Ue.current = null;
4136
+ Ue.current = null, Me.current = m;
4137
4137
  return;
4138
4138
  }
4139
- if (Ze.current === m)
4139
+ if (Ze.current === m) {
4140
+ Me.current = m;
4140
4141
  return;
4142
+ }
4141
4143
  if (re.current === m) {
4142
- re.current = null, $e.current = m;
4144
+ re.current = null, Me.current = m;
4143
4145
  return;
4144
4146
  }
4145
- if ($e.current === m)
4147
+ if (Me.current === m)
4146
4148
  return;
4147
- $e.current = m;
4149
+ Me.current = m;
4148
4150
  const V = !me.current && !!n && m === t;
4149
4151
  let ie;
4150
4152
  V && n ? (ie = n, me.current = !0, console.log(
@@ -4153,7 +4155,7 @@ function qx({
4153
4155
  r ? `(ns: ${r})` : ""
4154
4156
  )) : console.log("[ChatSessionProvider] Loading thread with latest checkpoint");
4155
4157
  const ee = `${m}:${ie ?? "latest"}`;
4156
- De.current !== ee && Ct(m, ie);
4158
+ Le.current !== ee && Ct(m, ie);
4157
4159
  }, [
4158
4160
  o,
4159
4161
  m,
@@ -6469,7 +6471,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6469
6471
  updatePositionStrategy: h = "optimized",
6470
6472
  onPlaced: m,
6471
6473
  ...x
6472
- } = e, y = Vu(Ca, n), [g, w] = v.useState(null), b = Je(t, ($e) => w($e)), [T, C] = v.useState(null), S = Uu(T), k = (S == null ? void 0 : S.width) ?? 0, E = (S == null ? void 0 : S.height) ?? 0, N = r + (s !== "center" ? "-" + s : ""), M = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, j = Array.isArray(c) ? c : [c], P = j.length > 0, $ = {
6474
+ } = e, y = Vu(Ca, n), [g, w] = v.useState(null), b = Je(t, (Me) => w(Me)), [T, C] = v.useState(null), S = Uu(T), k = (S == null ? void 0 : S.width) ?? 0, E = (S == null ? void 0 : S.height) ?? 0, N = r + (s !== "center" ? "-" + s : ""), M = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, j = Array.isArray(c) ? c : [c], P = j.length > 0, $ = {
6473
6475
  padding: M,
6474
6476
  boundary: j.filter($v),
6475
6477
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
@@ -6478,7 +6480,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6478
6480
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
6479
6481
  strategy: "fixed",
6480
6482
  placement: N,
6481
- whileElementsMounted: (...$e) => pv(...$e, {
6483
+ whileElementsMounted: (...Me) => pv(...Me, {
6482
6484
  animationFrame: h === "always"
6483
6485
  }),
6484
6486
  elements: {
@@ -6495,9 +6497,9 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6495
6497
  l && Iv({ ...$ }),
6496
6498
  Nv({
6497
6499
  ...$,
6498
- apply: ({ elements: $e, rects: Ue, availableWidth: Ze, availableHeight: re }) => {
6499
- const { width: me, height: De } = Ue.reference, Fe = $e.floating.style;
6500
- Fe.setProperty("--radix-popper-available-width", `${Ze}px`), Fe.setProperty("--radix-popper-available-height", `${re}px`), Fe.setProperty("--radix-popper-anchor-width", `${me}px`), Fe.setProperty("--radix-popper-anchor-height", `${De}px`);
6500
+ apply: ({ elements: Me, rects: Ue, availableWidth: Ze, availableHeight: re }) => {
6501
+ const { width: me, height: Le } = Ue.reference, Fe = Me.floating.style;
6502
+ Fe.setProperty("--radix-popper-available-width", `${Ze}px`), Fe.setProperty("--radix-popper-available-height", `${re}px`), Fe.setProperty("--radix-popper-anchor-width", `${me}px`), Fe.setProperty("--radix-popper-anchor-height", `${Le}px`);
6501
6503
  }
6502
6504
  }),
6503
6505
  T && _v({ element: T, padding: a }),
@@ -8326,7 +8328,7 @@ function ht(...e) {
8326
8328
  function st(e, t) {
8327
8329
  return e(Un, t);
8328
8330
  }
8329
- function Le(e, t) {
8331
+ function $e(e, t) {
8330
8332
  e(Ls, t);
8331
8333
  }
8332
8334
  function Pa(e) {
@@ -8506,7 +8508,7 @@ function Nt(...e) {
8506
8508
  return e.forEach((s, i) => {
8507
8509
  const a = Math.pow(2, i);
8508
8510
  st(s, (l) => {
8509
- n[i] = l, r = r | a, r === o && Le(t, n);
8511
+ n[i] = l, r = r | a, r === o && $e(t, n);
8510
8512
  });
8511
8513
  }), function(s, i) {
8512
8514
  switch (s) {
@@ -9102,10 +9104,10 @@ const A0 = {
9102
9104
  (C) => {
9103
9105
  const { groupIndices: S } = Rt(x);
9104
9106
  if (C > 0)
9105
- Le(t, !0), Le(s, C + dc(C, S));
9107
+ $e(t, !0), $e(s, C + dc(C, S));
9106
9108
  else if (C < 0) {
9107
9109
  const k = Rt(y);
9108
- k.length > 0 && (C -= dc(-C, k)), Le(i, C);
9110
+ k.length > 0 && (C -= dc(-C, k)), $e(i, C);
9109
9111
  }
9110
9112
  }
9111
9113
  ), st(U(a, ze(e)), ([C, S]) => {
@@ -9324,7 +9326,7 @@ const go = nt(
9324
9326
  const h = Xe(), m = Xe(), x = Z(0);
9325
9327
  let y = null, g = null, w = null;
9326
9328
  function b() {
9327
- y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), Le(l, !1);
9329
+ y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), $e(l, !1);
9328
9330
  }
9329
9331
  return ge(
9330
9332
  U(
@@ -9342,7 +9344,7 @@ const go = nt(
9342
9344
  let G = no(J, C.offsetTree, P) + N;
9343
9345
  A === "end" ? (G += $ + gn(C.sizeTree, J)[1] - S + I, J === _ && (G += M)) : A === "center" ? G += ($ + gn(C.sizeTree, J)[1] - S + I) / 2 : G -= E, L && (G += L);
9344
9346
  const pe = (Re) => {
9345
- b(), Re ? (j("retrying to scroll to", { location: T }, qt.DEBUG), Le(h, T)) : (Le(m, !0), j("list did not change, scroll successful", {}, qt.DEBUG));
9347
+ b(), Re ? (j("retrying to scroll to", { location: T }, qt.DEBUG), $e(h, T)) : ($e(m, !0), j("list did not change, scroll successful", {}, qt.DEBUG));
9346
9348
  };
9347
9349
  if (b(), X === "smooth") {
9348
9350
  let Re = !1;
@@ -9355,7 +9357,7 @@ const go = nt(
9355
9357
  y = pn(U(t, P0(150)), pe);
9356
9358
  return g = setTimeout(() => {
9357
9359
  b();
9358
- }, 1200), Le(l, !0), j("scrolling from index to", { behavior: X, index: J, top: G }, qt.DEBUG), { behavior: X, top: G };
9360
+ }, 1200), $e(l, !0), j("scrolling from index to", { behavior: X, index: J, top: G }, qt.DEBUG), { behavior: X, top: G };
9359
9361
  }
9360
9362
  )
9361
9363
  ),
@@ -9416,11 +9418,11 @@ const xo = nt(
9416
9418
  ),
9417
9419
  ([, d]) => {
9418
9420
  pn(o, () => {
9419
- Le(c, !0);
9421
+ $e(c, !0);
9420
9422
  }), La(4, () => {
9421
9423
  pn(r, () => {
9422
- Le(a, !0);
9423
- }), Le(s, d);
9424
+ $e(a, !0);
9425
+ }), $e(s, d);
9424
9426
  });
9425
9427
  }
9426
9428
  ), {
@@ -9993,7 +9995,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = nt(
9993
9995
  const m = Z(!1), x = Xe();
9994
9996
  let y = null;
9995
9997
  function g(C) {
9996
- Le(i, {
9998
+ $e(i, {
9997
9999
  align: "end",
9998
10000
  behavior: C,
9999
10001
  index: "LAST"
@@ -10065,9 +10067,9 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = nt(
10065
10067
  ),
10066
10068
  (C) => {
10067
10069
  y && (y(), y = null), Rt(n) ? requestAnimationFrame(() => {
10068
- Rt(d)("scrolling into view", {}), Le(h, C);
10070
+ Rt(d)("scrolling into view", {}), $e(h, C);
10069
10071
  }) : y = pn(e, () => {
10070
- Rt(d)("scrolling into view", {}), Le(h, C), y = null;
10072
+ Rt(d)("scrolling into view", {}), $e(h, C), y = null;
10071
10073
  });
10072
10074
  }
10073
10075
  ), { autoscrollToBottom: x, followOutput: m, scrollIntoViewOnChange: b };
@@ -10115,7 +10117,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = nt(
10115
10117
  ),
10116
10118
  () => {
10117
10119
  requestAnimationFrame(() => {
10118
- Le(t, o);
10120
+ $e(t, o);
10119
10121
  });
10120
10122
  }
10121
10123
  );
@@ -10267,10 +10269,10 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10267
10269
  )
10268
10270
  );
10269
10271
  function y(g) {
10270
- g > 0 ? (Le(t, { behavior: "auto", top: -g }), Le(e, 0)) : (Le(e, 0), Le(t, { behavior: "auto", top: -g }));
10272
+ g > 0 ? ($e(t, { behavior: "auto", top: -g }), $e(e, 0)) : ($e(e, 0), $e(t, { behavior: "auto", top: -g }));
10271
10273
  }
10272
10274
  return st(U(x, ze(e, s)), ([g, w, b]) => {
10273
- b && q0() ? Le(e, w - g) : y(-g);
10275
+ b && q0() ? $e(e, w - g) : y(-g);
10274
10276
  }), st(
10275
10277
  U(
10276
10278
  Nt(Ft(s, !1), e, m),
@@ -10309,9 +10311,9 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10309
10311
  })
10310
10312
  ),
10311
10313
  (g) => {
10312
- Le(e, g), requestAnimationFrame(() => {
10313
- Le(t, { top: g }), requestAnimationFrame(() => {
10314
- Le(e, 0), Le(m, !1);
10314
+ $e(e, g), requestAnimationFrame(() => {
10315
+ $e(t, { top: g }), requestAnimationFrame(() => {
10316
+ $e(e, 0), $e(m, !1);
10315
10317
  });
10316
10318
  });
10317
10319
  }
@@ -10448,22 +10450,22 @@ const No = typeof document < "u" ? z.useLayoutEffect : z.useEffect;
10448
10450
  function Mf(e, t, n) {
10449
10451
  const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a = z.createContext({});
10450
10452
  function l(y, g) {
10451
- y.propsReady && Le(y.propsReady, !1);
10453
+ y.propsReady && $e(y.propsReady, !1);
10452
10454
  for (const w of r) {
10453
10455
  const b = y[t.required[w]];
10454
- Le(b, g[w]);
10456
+ $e(b, g[w]);
10455
10457
  }
10456
10458
  for (const w of o)
10457
10459
  if (w in g) {
10458
10460
  const b = y[t.optional[w]];
10459
- Le(b, g[w]);
10461
+ $e(b, g[w]);
10460
10462
  }
10461
- y.propsReady && Le(y.propsReady, !0);
10463
+ y.propsReady && $e(y.propsReady, !0);
10462
10464
  }
10463
10465
  function c(y) {
10464
10466
  return s.reduce((g, w) => (g[w] = (b) => {
10465
10467
  const T = y[t.methods[w]];
10466
- Le(T, b);
10468
+ $e(T, b);
10467
10469
  }, g), {});
10468
10470
  }
10469
10471
  function d(y) {
@@ -10488,7 +10490,7 @@ function Mf(e, t, n) {
10488
10490
  const g = z.useContext(a);
10489
10491
  return z.useCallback(
10490
10492
  (w) => {
10491
- Le(g[y], w);
10493
+ $e(g[y], w);
10492
10494
  },
10493
10495
  [g, y]
10494
10496
  );
@@ -10983,7 +10985,7 @@ const bS = /* @__PURE__ */ nt(
10983
10985
  Ne(([D, H]) => !!H)
10984
10986
  ),
10985
10987
  () => {
10986
- Le(J, !1);
10988
+ $e(J, !1);
10987
10989
  }
10988
10990
  ), st(
10989
10991
  U(
@@ -10991,10 +10993,10 @@ const bS = /* @__PURE__ */ nt(
10991
10993
  Ne(([D, H, ne, se, , q]) => D && !H && ne.height !== 0 && se.height !== 0 && !q)
10992
10994
  ),
10993
10995
  ([, , , , D]) => {
10994
- Le(G, !0), La(1, () => {
10995
- Le(j, D);
10996
+ $e(G, !0), La(1, () => {
10997
+ $e(j, D);
10996
10998
  }), pn(U(c), () => {
10997
- Le(t, [0, 0]), Le(J, !0);
10999
+ $e(t, [0, 0]), $e(J, !0);
10998
11000
  });
10999
11001
  }
11000
11002
  ), ge(
@@ -11011,9 +11013,9 @@ const bS = /* @__PURE__ */ nt(
11011
11013
  Ne(([, D]) => D != null)
11012
11014
  ),
11013
11015
  ([, D]) => {
11014
- D && (Le(N, D.viewport), Le(M, D.item), Le(F, D.gap), D.scrollTop > 0 && (Le(L, !0), pn(U(c, nr(1)), (H) => {
11015
- Le(L, !1);
11016
- }), Le(l, { top: D.scrollTop })));
11016
+ D && ($e(N, D.viewport), $e(M, D.item), $e(F, D.gap), D.scrollTop > 0 && ($e(L, !0), pn(U(c, nr(1)), (H) => {
11017
+ $e(L, !1);
11018
+ }), $e(l, { top: D.scrollTop })));
11017
11019
  }
11018
11020
  ), ge(
11019
11021
  U(
@@ -11058,24 +11060,24 @@ const bS = /* @__PURE__ */ nt(
11058
11060
  [H, ne],
11059
11061
  se,
11060
11062
  q,
11061
- $e,
11063
+ Me,
11062
11064
  Ue,
11063
11065
  Ze,
11064
11066
  ,
11065
11067
  re,
11066
11068
  me
11067
11069
  ]) => {
11068
- const { column: De, row: Fe } = se, { height: Pe, width: et } = q, { width: We } = $e;
11070
+ const { column: Le, row: Fe } = se, { height: Pe, width: et } = q, { width: We } = Me;
11069
11071
  if (Ze === 0 && (D === 0 || We === 0))
11070
11072
  return vc;
11071
11073
  if (et === 0) {
11072
11074
  const Ve = $a(me, D), jt = Ve + Math.max(Ze - 1, 0);
11073
11075
  return vS(Sc(Ve, jt, Ue));
11074
11076
  }
11075
- const Ge = Uf(We, et, De);
11077
+ const Ge = Uf(We, et, Le);
11076
11078
  let qe, Qe;
11077
11079
  re ? H === 0 && ne === 0 && Ze > 0 ? (qe = 0, Qe = Ze - 1) : (qe = Ge * os((H + Fe) / (Pe + Fe)), Qe = Ge * wc((ne + Fe) / (Pe + Fe)) - 1, Qe = bi(D - 1, Ur(Qe, Ge - 1)), qe = bi(Qe, Ur(0, qe))) : (qe = 0, Qe = -1);
11078
- const St = Sc(qe, Qe, Ue), { bottom: mt, top: gt } = Cc($e, se, q, St), ft = wc(D / Ge), it = ft * Pe + (ft - 1) * Fe - mt;
11080
+ const St = Sc(qe, Qe, Ue), { bottom: mt, top: gt } = Cc(Me, se, q, St), ft = wc(D / Ge), it = ft * Pe + (ft - 1) * Fe - mt;
11079
11081
  return { bottom: mt, itemHeight: Pe, items: St, itemWidth: et, offsetBottom: it, offsetTop: gt, top: gt };
11080
11082
  }
11081
11083
  )
@@ -11093,8 +11095,8 @@ const bS = /* @__PURE__ */ nt(
11093
11095
  Nt(N, M, E, F),
11094
11096
  Ne(([D, H, { items: ne }]) => ne.length > 0 && H.height !== 0 && D.height !== 0),
11095
11097
  ce(([D, H, { items: ne }, se]) => {
11096
- const { bottom: q, top: $e } = Cc(D, se, H, ne);
11097
- return [$e, q];
11098
+ const { bottom: q, top: Me } = Cc(D, se, H, ne);
11099
+ return [Me, q];
11098
11100
  }),
11099
11101
  pt(to)
11100
11102
  ),
@@ -11146,11 +11148,11 @@ const bS = /* @__PURE__ */ nt(
11146
11148
  j,
11147
11149
  ze(N, M, S, F),
11148
11150
  ce(([D, H, ne, se, q]) => {
11149
- const $e = Rf(D), { align: Ue, behavior: Ze, offset: re } = $e;
11150
- let me = $e.index;
11151
+ const Me = Rf(D), { align: Ue, behavior: Ze, offset: re } = Me;
11152
+ let me = Me.index;
11151
11153
  me === "LAST" && (me = se - 1), me = Ur(0, me, bi(se - 1, me));
11152
- let De = Gi(H, q, ne, me);
11153
- return Ue === "end" ? De = bc(De - H.height + ne.height) : Ue === "center" && (De = bc(De - H.height / 2 + ne.height / 2)), re && (De += re), { behavior: Ze, top: De };
11154
+ let Le = Gi(H, q, ne, me);
11155
+ return Ue === "end" ? Le = bc(Le - H.height + ne.height) : Ue === "center" && (Le = bc(Le - H.height / 2 + ne.height / 2)), re && (Le += re), { behavior: Ze, top: Le };
11154
11156
  })
11155
11157
  ),
11156
11158
  l
@@ -13843,14 +13845,14 @@ const Oc = z.memo(function({
13843
13845
  }, [_]), ne = rt(() => G ? "" : wC(t.content), [G, t]), se = rt(() => G ? {} : Rp(t), [G, t]), q = rt(
13844
13846
  () => G ? [] : t.content.filter((B) => B.type === "image_url"),
13845
13847
  [G, t]
13846
- ), $e = rt(
13848
+ ), Me = rt(
13847
13849
  () => G ? [] : t.content.filter((B) => B.type === "file"),
13848
13850
  [G, t]
13849
13851
  ), Ue = rt(
13850
13852
  () => G ? [] : t.content.filter((B) => B.type === "interrupt"),
13851
13853
  [G, t]
13852
- ), Ze = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), re = jo(Ze), me = g == null ? void 0 : g.value, De = rt(() => G ? "" : bC(t.content), [G, t]), Fe = z.useCallback(async () => {
13853
- const B = J ? De : ne;
13854
+ ), Ze = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), re = jo(Ze), me = g == null ? void 0 : g.value, Le = rt(() => G ? "" : bC(t.content), [G, t]), Fe = z.useCallback(async () => {
13855
+ const B = J ? Le : ne;
13854
13856
  async function ye(ve) {
13855
13857
  if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
13856
13858
  await navigator.clipboard.writeText(ve);
@@ -13872,14 +13874,14 @@ const Oc = z.memo(function({
13872
13874
  } catch (ve) {
13873
13875
  console.error("Failed to copy:", ve);
13874
13876
  }
13875
- }, [J, De, ne, y]), Pe = z.useCallback(() => {
13877
+ }, [J, Le, ne, y]), Pe = z.useCallback(() => {
13876
13878
  if (!h) return;
13877
- const B = J ? De : ne, ye = "type" in t && t.type === "default_message" ? void 0 : {
13879
+ const B = J ? Le : ne, ye = "type" in t && t.type === "default_message" ? void 0 : {
13878
13880
  checkpointId: t.checkpointId ?? null,
13879
13881
  checkpointNs: t.checkpointNs ?? null
13880
13882
  };
13881
13883
  h(t.id, B, ye);
13882
- }, [h, t.id, J, De, ne, t]), et = z.useCallback(() => {
13884
+ }, [h, t.id, J, Le, ne, t]), et = z.useCallback(() => {
13883
13885
  m == null || m(n);
13884
13886
  }, [m, n]), We = z.useCallback(() => {
13885
13887
  const ye = te(L ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", H);
@@ -14077,8 +14079,8 @@ const Oc = z.memo(function({
14077
14079
  /* @__PURE__ */ u.jsx(ki, { className: "h-4 w-4 text-muted-foreground" }),
14078
14080
  /* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
14079
14081
  ] }), []), ft = z.useCallback(() => {
14080
- const B = ne.trim().length > 0 || q.length > 0 || $e.length > 0 || Ue.length > 0;
14081
- if (!J && $e.length > 0 && !r)
14082
+ const B = ne.trim().length > 0 || q.length > 0 || Me.length > 0 || Ue.length > 0;
14083
+ if (!J && Me.length > 0 && !r)
14082
14084
  return gt();
14083
14085
  if (!J && !B && !r)
14084
14086
  return null;
@@ -14101,7 +14103,7 @@ const Oc = z.memo(function({
14101
14103
  }, [
14102
14104
  ne,
14103
14105
  q.length,
14104
- $e.length,
14106
+ Me.length,
14105
14107
  Ue.length,
14106
14108
  r,
14107
14109
  J,
@@ -14693,9 +14695,9 @@ const IC = ({
14693
14695
  return null;
14694
14696
  const re = w.id && String(w.id).trim() ? String(w.id).trim() : "pending-interrupt";
14695
14697
  let me;
14696
- const De = w.value;
14697
- if (De && typeof De == "object" && !Array.isArray(De)) {
14698
- const Fe = De.title;
14698
+ const Le = w.value;
14699
+ if (Le && typeof Le == "object" && !Array.isArray(Le)) {
14700
+ const Fe = Le.title;
14699
14701
  typeof Fe == "string" && Fe.trim() && (me = Fe.trim());
14700
14702
  }
14701
14703
  return {
@@ -14706,7 +14708,7 @@ const IC = ({
14706
14708
  {
14707
14709
  type: "interrupt",
14708
14710
  id: re,
14709
- value: De,
14711
+ value: Le,
14710
14712
  title: me
14711
14713
  }
14712
14714
  ]
@@ -14721,8 +14723,8 @@ const IC = ({
14721
14723
  }
14722
14724
  ] : pe, [pe, t, $]), Ae = rt(() => S ? Re : Re.filter((re) => (re == null ? void 0 : re.role) !== "tool"), [Re, S]), K = rt(() => {
14723
14725
  const re = /* @__PURE__ */ new Set(), me = [];
14724
- for (let De = Ae.length - 1; De >= 0; De--) {
14725
- const Fe = Ae[De];
14726
+ for (let Le = Ae.length - 1; Le >= 0; Le--) {
14727
+ const Fe = Ae[Le];
14726
14728
  if (!Fe) continue;
14727
14729
  if ("type" in Fe && Fe.type === "default_message") {
14728
14730
  me.push(Fe);
@@ -14764,7 +14766,7 @@ const IC = ({
14764
14766
  onSelectCheckpoint: M,
14765
14767
  messagePreviews: P
14766
14768
  }
14767
- ) : null, $e = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), Ue = () => se ? /* @__PURE__ */ u.jsx("div", { className: "p-6 h-full overflow-y-auto", children: /* @__PURE__ */ u.jsx("div", { className: "w-full max-w-full", children: /* @__PURE__ */ u.jsx(
14769
+ ) : null, Me = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), Ue = () => se ? /* @__PURE__ */ u.jsx("div", { className: "p-6 h-full overflow-y-auto", children: /* @__PURE__ */ u.jsx("div", { className: "w-full max-w-full", children: /* @__PURE__ */ u.jsx(
14768
14770
  Oc,
14769
14771
  {
14770
14772
  message: se,
@@ -14788,9 +14790,9 @@ const IC = ({
14788
14790
  scrollToLatest: () => {
14789
14791
  var re, me;
14790
14792
  if (F.current && K.length > 0) {
14791
- const De = K.length - 1;
14793
+ const Le = K.length - 1;
14792
14794
  (me = (re = F.current).scrollToIndex) == null || me.call(re, {
14793
- index: De,
14795
+ index: Le,
14794
14796
  align: "end",
14795
14797
  behavior: "auto"
14796
14798
  });
@@ -14806,7 +14808,7 @@ const IC = ({
14806
14808
  }
14807
14809
  }),
14808
14810
  [K]
14809
- ), /* @__PURE__ */ u.jsxs("div", { className: $e, style: p, children: [
14811
+ ), /* @__PURE__ */ u.jsxs("div", { className: Me, style: p, children: [
14810
14812
  q,
14811
14813
  /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: Ze ? /* @__PURE__ */ u.jsx(
14812
14814
  gS,
@@ -14832,7 +14834,7 @@ const IC = ({
14832
14834
  computeItemKey: (re, me) => Mc(me, re),
14833
14835
  itemContent: (re, me) => {
14834
14836
  var mt;
14835
- const De = Mc(me, re), Fe = "type" in me && me.type === "default_message";
14837
+ const Le = Mc(me, re), Fe = "type" in me && me.type === "default_message";
14836
14838
  let Pe = [], et = null, We = {}, Ge = {}, qe = null, Qe = null;
14837
14839
  if (!Fe) {
14838
14840
  const gt = me, ft = gt.checkpointId ?? null;
@@ -14854,7 +14856,7 @@ const IC = ({
14854
14856
  "div",
14855
14857
  {
14856
14858
  className: "relative mb-4 last:mb-0",
14857
- "data-message-id": De,
14859
+ "data-message-id": Le,
14858
14860
  style: {
14859
14861
  minHeight: "60px",
14860
14862
  containIntrinsicSize: "auto 120px"
@@ -14935,7 +14937,7 @@ function Ti({
14935
14937
  Ae(!0);
14936
14938
  }, []), oe = ke(() => {
14937
14939
  Ae(!1);
14938
- }, []), Y = !!pe || Re, [D, H] = we(null), [ne, se] = we(""), [q, $e] = we(null), [Ue, Ze] = we(null), [re, me] = we([]), [De, Fe] = we(0), [Pe, et] = we(0), [We, Ge] = we(!1), [qe, Qe] = we(null), [St, mt] = we(null), [gt, ft] = we(!1), [it, Ve] = we(null), jt = He(!1), [Ct, Zt] = we(() => Dc.value), ln = He(Ct), Ye = He(null), _e = ke((Q) => {
14940
+ }, []), Y = !!pe || Re, [D, H] = we(null), [ne, se] = we(""), [q, Me] = we(null), [Ue, Ze] = we(null), [re, me] = we([]), [Le, Fe] = we(0), [Pe, et] = we(0), [We, Ge] = we(!1), [qe, Qe] = we(null), [St, mt] = we(null), [gt, ft] = we(!1), [it, Ve] = we(null), jt = He(!1), [Ct, Zt] = we(() => Dc.value), ln = He(Ct), Ye = He(null), _e = ke((Q) => {
14939
14941
  Dc.value = Q, Zt(Q);
14940
14942
  }, []), [_t, zt] = we(!1), B = He(null), ye = ke(
14941
14943
  (Q, de) => {
@@ -15086,7 +15088,7 @@ function Ti({
15086
15088
  checkpointId: fe,
15087
15089
  checkpointNs: be
15088
15090
  }
15089
- ), p == null || p(de), _e(""), Ze(null), me([]), Te(), H(null), se(""), $e(null);
15091
+ ), p == null || p(de), _e(""), Ze(null), me([]), Te(), H(null), se(""), Me(null);
15090
15092
  } catch (fe) {
15091
15093
  const be = (fe == null ? void 0 : fe.message) || "Failed to send message";
15092
15094
  Ze(be), m == null || m(be);
@@ -15094,14 +15096,14 @@ function Ti({
15094
15096
  }
15095
15097
  }, vo = z.useCallback(
15096
15098
  (Q, de, fe) => {
15097
- c && (Ye.current = Ct, H(Q), se(de), _e(de), Ze(null), $e({
15099
+ c && (Ye.current = Ct, H(Q), se(de), _e(de), Ze(null), Me({
15098
15100
  checkpointId: (fe == null ? void 0 : fe.checkpointId) ?? null,
15099
15101
  checkpointNs: (fe == null ? void 0 : fe.checkpointNs) ?? null
15100
15102
  }));
15101
15103
  },
15102
15104
  [Ct, c, _e]
15103
15105
  ), R = z.useCallback(() => {
15104
- H(null), se(""), $e(null), Ze(null), _e(Ye.current ?? Ct), Ye.current = null;
15106
+ H(null), se(""), Me(null), Ze(null), _e(Ye.current ?? Ct), Ye.current = null;
15105
15107
  }, [Ct, _e]), W = ke(
15106
15108
  (Q, de, fe) => {
15107
15109
  vo(Q, de, fe);
@@ -15288,7 +15290,7 @@ function Ti({
15288
15290
  onChange: (Q) => Ee(Q),
15289
15291
  className: "hidden"
15290
15292
  },
15291
- De
15293
+ Le
15292
15294
  ),
15293
15295
  re.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap gap-2", children: re.map((Q, de) => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100", children: [
15294
15296
  /* @__PURE__ */ u.jsx(ki, { size: 14 }),
@@ -16751,7 +16753,7 @@ var pT = "SelectItemAlignedPosition", hh = v.forwardRef((e, t) => {
16751
16753
  if (s.trigger && s.valueNode && a && c && x && y && g) {
16752
16754
  const k = s.trigger.getBoundingClientRect(), E = c.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(), M = g.getBoundingClientRect();
16753
16755
  if (s.dir !== "rtl") {
16754
- const se = M.left - E.left, q = N.left - se, $e = k.left - q, Ue = k.width + $e, Ze = Math.max(Ue, E.width), re = window.innerWidth - dn, me = Yi(q, [
16756
+ const se = M.left - E.left, q = N.left - se, Me = k.left - q, Ue = k.width + Me, Ze = Math.max(Ue, E.width), re = window.innerWidth - dn, me = Yi(q, [
16755
16757
  dn,
16756
16758
  // Prevents the content from going off the starting edge of the
16757
16759
  // viewport. It may still go off the ending edge, but this can be
@@ -16762,7 +16764,7 @@ var pT = "SelectItemAlignedPosition", hh = v.forwardRef((e, t) => {
16762
16764
  ]);
16763
16765
  a.style.minWidth = Ue + "px", a.style.left = me + "px";
16764
16766
  } else {
16765
- const se = E.right - M.right, q = window.innerWidth - N.right - se, $e = window.innerWidth - k.right - q, Ue = k.width + $e, Ze = Math.max(Ue, E.width), re = window.innerWidth - dn, me = Yi(q, [
16767
+ const se = E.right - M.right, q = window.innerWidth - N.right - se, Me = window.innerWidth - k.right - q, Ue = k.width + Me, Ze = Math.max(Ue, E.width), re = window.innerWidth - dn, me = Yi(q, [
16766
16768
  dn,
16767
16769
  Math.max(dn, re - Ze)
16768
16770
  ]);
@@ -16772,21 +16774,21 @@ var pT = "SelectItemAlignedPosition", hh = v.forwardRef((e, t) => {
16772
16774
  if (D <= Ae) {
16773
16775
  const se = j.length > 0 && y === j[j.length - 1].ref.current;
16774
16776
  a.style.bottom = "0px";
16775
- const q = c.clientHeight - x.offsetTop - x.offsetHeight, $e = Math.max(
16777
+ const q = c.clientHeight - x.offsetTop - x.offsetHeight, Me = Math.max(
16776
16778
  K,
16777
16779
  oe + // viewport might have padding bottom, include it to avoid a scrollable viewport
16778
16780
  (se ? Re : 0) + q + X
16779
- ), Ue = D + $e;
16781
+ ), Ue = D + Me;
16780
16782
  a.style.height = Ue + "px";
16781
16783
  } else {
16782
16784
  const se = j.length > 0 && y === j[0].ref.current;
16783
16785
  a.style.top = "0px";
16784
- const $e = Math.max(
16786
+ const Me = Math.max(
16785
16787
  Ae,
16786
16788
  F + x.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
16787
16789
  (se ? pe : 0) + oe
16788
16790
  ) + H;
16789
- a.style.height = $e + "px", x.scrollTop = D - Ae + x.offsetTop;
16791
+ a.style.height = Me + "px", x.scrollTop = D - Ae + x.offsetTop;
16790
16792
  }
16791
16793
  a.style.margin = `${dn}px 0`, a.style.minHeight = J + "px", a.style.maxHeight = P + "px", r == null || r(), requestAnimationFrame(() => h.current = !0);
16792
16794
  }