teodor-new-chat-ui 3.0.1 → 3.0.2

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
@@ -22,12 +22,12 @@ const { toString: Nd } = Object.prototype, { getPrototypeOf: Fo } = Object, { it
22
22
  function fn(e) {
23
23
  return e !== null && !Lt(e) && e.constructor !== null && !Lt(e.constructor) && Pe(e.constructor.isBuffer) && e.constructor.isBuffer(e);
24
24
  }
25
- const Ma = Ve("ArrayBuffer");
25
+ const ka = Ve("ArrayBuffer");
26
26
  function Rd(e) {
27
27
  let t;
28
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ma(e.buffer), t;
28
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && ka(e.buffer), t;
29
29
  }
30
- const Td = fr("string"), Pe = fr("function"), ka = fr("number"), pn = (e) => e !== null && typeof e == "object", Ad = (e) => e === !0 || e === !1, Ln = (e) => {
30
+ const Td = fr("string"), Pe = fr("function"), Ma = fr("number"), pn = (e) => e !== null && typeof e == "object", Ad = (e) => e === !0 || e === !1, Ln = (e) => {
31
31
  if (dr(e) !== "object")
32
32
  return !1;
33
33
  const t = Fo(e);
@@ -40,7 +40,7 @@ const Td = fr("string"), Pe = fr("function"), ka = fr("number"), pn = (e) => e !
40
40
  } catch {
41
41
  return !1;
42
42
  }
43
- }, Id = Ve("Date"), _d = Ve("File"), Od = Ve("Blob"), Md = Ve("FileList"), kd = (e) => pn(e) && Pe(e.pipe), Dd = (e) => {
43
+ }, Id = Ve("Date"), _d = Ve("File"), Od = Ve("Blob"), kd = Ve("FileList"), Md = (e) => pn(e) && Pe(e.pipe), Dd = (e) => {
44
44
  let t;
45
45
  return e && (typeof FormData == "function" && e instanceof FormData || Pe(e.append) && ((t = dr(e)) === "formdata" || // detect form-data instance
46
46
  t === "object" && Pe(e.toString) && e.toString() === "[object FormData]"));
@@ -106,7 +106,7 @@ const zd = (e, t, n, { allOwnKeys: r } = {}) => (hn(t, (o, s) => {
106
106
  if (!e) return null;
107
107
  if (Ht(e)) return e;
108
108
  let t = e.length;
109
- if (!ka(t)) return null;
109
+ if (!Ma(t)) return null;
110
110
  const n = new Array(t);
111
111
  for (; t-- > 0; )
112
112
  n[t] = e[t];
@@ -190,12 +190,12 @@ const sf = (e) => {
190
190
  Pe(bt.postMessage)
191
191
  ), lf = typeof queueMicrotask < "u" ? queueMicrotask.bind(bt) : typeof process < "u" && process.nextTick || $a, uf = (e) => e != null && Pe(e[ur]), S = {
192
192
  isArray: Ht,
193
- isArrayBuffer: Ma,
193
+ isArrayBuffer: ka,
194
194
  isBuffer: fn,
195
195
  isFormData: Dd,
196
196
  isArrayBufferView: Rd,
197
197
  isString: Td,
198
- isNumber: ka,
198
+ isNumber: Ma,
199
199
  isBoolean: Ad,
200
200
  isObject: pn,
201
201
  isPlainObject: Ln,
@@ -210,10 +210,10 @@ const sf = (e) => {
210
210
  isBlob: Od,
211
211
  isRegExp: Qd,
212
212
  isFunction: Pe,
213
- isStream: kd,
213
+ isStream: Md,
214
214
  isURLSearchParams: Ld,
215
215
  isTypedArray: qd,
216
- isFileList: Md,
216
+ isFileList: kd,
217
217
  forEach: hn,
218
218
  merge: uo,
219
219
  extend: zd,
@@ -847,11 +847,11 @@ function Ga(e, t, n) {
847
847
  n
848
848
  ));
849
849
  }
850
- function Mf(e) {
850
+ function kf(e) {
851
851
  const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
852
852
  return t && t[1] || "";
853
853
  }
854
- function kf(e, t) {
854
+ function Mf(e, t) {
855
855
  e = e || 10;
856
856
  const n = new Array(e), r = new Array(e);
857
857
  let o = 0, s = 0, a;
@@ -881,7 +881,7 @@ function Df(e, t) {
881
881
  }
882
882
  const Jn = (e, t, n = 3) => {
883
883
  let r = 0;
884
- const o = kf(50, 250);
884
+ const o = Mf(50, 250);
885
885
  return Df((s) => {
886
886
  const a = s.loaded, i = s.lengthComputable ? s.total : void 0, l = a - r, f = o(l), d = a <= i;
887
887
  r = a;
@@ -898,14 +898,14 @@ const Jn = (e, t, n = 3) => {
898
898
  };
899
899
  e(p);
900
900
  }, n);
901
- }, Ms = (e, t) => {
901
+ }, ks = (e, t) => {
902
902
  const n = e != null;
903
903
  return [(r) => t[0]({
904
904
  lengthComputable: n,
905
905
  total: e,
906
906
  loaded: r
907
907
  }), t[1]];
908
- }, ks = (e) => (...t) => S.asap(() => e(...t)), Lf = xe.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, xe.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
908
+ }, Ms = (e) => (...t) => S.asap(() => e(...t)), Lf = xe.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, xe.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
909
909
  new URL(xe.origin),
910
910
  xe.navigator && /(msie|trident)/i.test(xe.navigator.userAgent)
911
911
  ) : () => !0, Ff = xe.hasStandardBrowserEnv ? (
@@ -1082,7 +1082,7 @@ const Xa = (e) => {
1082
1082
  }), S.isUndefined(o.withCredentials) || (b.withCredentials = !!o.withCredentials), i && i !== "json" && (b.responseType = o.responseType), f && ([m, g] = Jn(f, !0), b.addEventListener("progress", m)), l && b.upload && ([p, v] = Jn(l), b.upload.addEventListener("progress", p), b.upload.addEventListener("loadend", v)), (o.cancelToken || o.signal) && (d = (y) => {
1083
1083
  b && (r(!y || y.type ? new zt(null, e, b) : y), b.abort(), b = null);
1084
1084
  }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
1085
- const x = Mf(o.url);
1085
+ const x = kf(o.url);
1086
1086
  if (x && xe.protocols.indexOf(x) === -1) {
1087
1087
  r(new ne("Unsupported protocol " + x + ":", ne.ERR_BAD_REQUEST, e));
1088
1088
  return;
@@ -1238,27 +1238,27 @@ const Xa = (e) => {
1238
1238
  onDownloadProgress: R,
1239
1239
  onUploadProgress: _,
1240
1240
  responseType: N,
1241
- headers: M,
1241
+ headers: k,
1242
1242
  withCredentials: L = "same-origin",
1243
1243
  fetchOptions: P
1244
1244
  } = Xa(g), $ = t || fetch;
1245
1245
  N = N ? (N + "").toLowerCase() : "text";
1246
1246
  let K = zf([x, y && y.toAbortSignal()], C), B = null;
1247
- const k = K && K.unsubscribe && (() => {
1247
+ const M = K && K.unsubscribe && (() => {
1248
1248
  K.unsubscribe();
1249
1249
  });
1250
1250
  let H;
1251
1251
  try {
1252
- if (_ && f && b !== "get" && b !== "head" && (H = await v(M, w)) !== 0) {
1252
+ if (_ && f && b !== "get" && b !== "head" && (H = await v(k, w)) !== 0) {
1253
1253
  let q = new n(h, {
1254
1254
  method: "POST",
1255
1255
  body: w,
1256
1256
  duplex: "half"
1257
1257
  }), ae;
1258
- if (S.isFormData(w) && (ae = q.headers.get("content-type")) && M.setContentType(ae), q.body) {
1259
- const [F, j] = Ms(
1258
+ if (S.isFormData(w) && (ae = q.headers.get("content-type")) && k.setContentType(ae), q.body) {
1259
+ const [F, j] = ks(
1260
1260
  H,
1261
- Jn(ks(_))
1261
+ Jn(Ms(_))
1262
1262
  );
1263
1263
  w = Ls(q.body, Fs, F, j);
1264
1264
  }
@@ -1268,7 +1268,7 @@ const Xa = (e) => {
1268
1268
  ...P,
1269
1269
  signal: K,
1270
1270
  method: b.toUpperCase(),
1271
- headers: M.normalize().toJSON(),
1271
+ headers: k.normalize().toJSON(),
1272
1272
  body: w,
1273
1273
  duplex: "half",
1274
1274
  credentials: O ? L : void 0
@@ -1276,25 +1276,25 @@ const Xa = (e) => {
1276
1276
  B = s && new n(h, G);
1277
1277
  let D = await (s ? $(B, P) : $(h, G));
1278
1278
  const T = d && (N === "stream" || N === "response");
1279
- if (d && (R || T && k)) {
1279
+ if (d && (R || T && M)) {
1280
1280
  const q = {};
1281
1281
  ["status", "statusText", "headers"].forEach((ce) => {
1282
1282
  q[ce] = D[ce];
1283
1283
  });
1284
- const ae = S.toFiniteNumber(D.headers.get("content-length")), [F, j] = R && Ms(
1284
+ const ae = S.toFiniteNumber(D.headers.get("content-length")), [F, j] = R && ks(
1285
1285
  ae,
1286
- Jn(ks(R), !0)
1286
+ Jn(Ms(R), !0)
1287
1287
  ) || [];
1288
1288
  D = new r(
1289
1289
  Ls(D.body, Fs, F, () => {
1290
- j && j(), k && k();
1290
+ j && j(), M && M();
1291
1291
  }),
1292
1292
  q
1293
1293
  );
1294
1294
  }
1295
1295
  N = N || "text";
1296
1296
  let Q = await p[S.findKey(p, N) || "text"](D, g);
1297
- return !T && k && k(), await new Promise((q, ae) => {
1297
+ return !T && M && M(), await new Promise((q, ae) => {
1298
1298
  Ga(q, ae, {
1299
1299
  data: Q,
1300
1300
  headers: Ie.from(D.headers),
@@ -1305,7 +1305,7 @@ const Xa = (e) => {
1305
1305
  });
1306
1306
  });
1307
1307
  } catch (O) {
1308
- throw k && k(), O && O.name === "TypeError" && /Load failed|fetch/i.test(O.message) ? Object.assign(
1308
+ throw M && M(), O && O.name === "TypeError" && /Load failed|fetch/i.test(O.message) ? Object.assign(
1309
1309
  new ne("Network Error", ne.ERR_NETWORK, g, B),
1310
1310
  {
1311
1311
  cause: O.cause || O
@@ -1756,8 +1756,8 @@ const {
1756
1756
  spread: Iy,
1757
1757
  toFormData: _y,
1758
1758
  AxiosHeaders: Oy,
1759
- HttpStatusCode: My,
1760
- formToJSON: ky,
1759
+ HttpStatusCode: ky,
1760
+ formToJSON: My,
1761
1761
  getAdapter: Dy,
1762
1762
  mergeConfig: Ly
1763
1763
  } = me, jr = {};
@@ -1945,29 +1945,29 @@ function sp(e = {}) {
1945
1945
  return g.current = _, (async () => {
1946
1946
  var L, P, $, K, B;
1947
1947
  const N = (() => {
1948
- var k;
1948
+ var M;
1949
1949
  try {
1950
- return typeof window < "u" && ((k = window.localStorage) == null ? void 0 : k.getItem("chat-debug")) === "1";
1950
+ return typeof window < "u" && ((M = window.localStorage) == null ? void 0 : M.getItem("chat-debug")) === "1";
1951
1951
  } catch {
1952
1952
  return !1;
1953
1953
  }
1954
- })(), M = (k) => {
1954
+ })(), k = (M) => {
1955
1955
  var H;
1956
1956
  try {
1957
- const O = JSON.parse(JSON.stringify(k));
1957
+ const O = JSON.parse(JSON.stringify(M));
1958
1958
  return (H = O == null ? void 0 : O.payload) != null && H.files_info && Array.isArray(O.payload.files_info) && (O.payload.files_info = O.payload.files_info.map((G) => ({
1959
1959
  ...G,
1960
1960
  data: G != null && G.data ? `<base64 ${String(G.data).length} chars>` : G == null ? void 0 : G.data
1961
1961
  }))), O;
1962
1962
  } catch {
1963
- return k;
1963
+ return M;
1964
1964
  }
1965
1965
  };
1966
1966
  try {
1967
- let k = {};
1967
+ let M = {};
1968
1968
  try {
1969
1969
  if (r)
1970
- k = { Authorization: `Bearer ${r}` };
1970
+ M = { Authorization: `Bearer ${r}` };
1971
1971
  else if (typeof window < "u") {
1972
1972
  const Q = window.__AUTH_TOKEN__, q = ((L = window.localStorage) == null ? void 0 : L.getItem("authToken")) || null;
1973
1973
  let ae = null;
@@ -1977,17 +1977,17 @@ function sp(e = {}) {
1977
1977
  } catch {
1978
1978
  }
1979
1979
  const F = Q || q || ae || null;
1980
- F && (k = { Authorization: `Bearer ${F}` });
1980
+ F && (M = { Authorization: `Bearer ${F}` });
1981
1981
  }
1982
1982
  } catch {
1983
1983
  }
1984
- N && console.debug("[use-chat] POST", t + n, M(y));
1984
+ N && console.debug("[use-chat] POST", t + n, k(y));
1985
1985
  const H = await fetch(t + n, {
1986
1986
  method: "POST",
1987
1987
  headers: {
1988
1988
  "Content-Type": "application/json",
1989
1989
  Accept: "text/event-stream",
1990
- ...k,
1990
+ ...M,
1991
1991
  ...s.current
1992
1992
  },
1993
1993
  body: JSON.stringify(y),
@@ -2037,9 +2037,9 @@ function sp(e = {}) {
2037
2037
  } else ce.type === "checkpoint" ? v(ce.checkpointId) : ce.type === "error" && f(ce.message);
2038
2038
  }
2039
2039
  }
2040
- } catch (k) {
2041
- if ((k == null ? void 0 : k.name) === "AbortError") return;
2042
- const H = (k == null ? void 0 : k.message) || String(k);
2040
+ } catch (M) {
2041
+ if ((M == null ? void 0 : M.name) === "AbortError") return;
2042
+ const H = (M == null ? void 0 : M.message) || String(M);
2043
2043
  N && console.debug("[use-chat] error:", H), f(H), (B = R == null ? void 0 : R.onError) == null || B.call(R, H);
2044
2044
  } finally {
2045
2045
  i(!1), g.current = null;
@@ -2278,7 +2278,7 @@ function Bn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2278
2278
  }, [l, v]);
2279
2279
  const b = be((X) => {
2280
2280
  l.setAuthToken(X);
2281
- }, [l]), { state: w, seed: x, prepend: y, pushUser: C, onEvent: R, reset: _ } = up(), N = s && s > 0 ? s : 6, [M, L] = re(!1), [P, $] = re(!1), [K, B] = re(null), [k, H] = re(void 0), O = be(
2281
+ }, [l]), { state: w, seed: x, prepend: y, pushUser: C, onEvent: R, reset: _ } = up(), N = s && s > 0 ? s : 6, [k, L] = re(!1), [P, $] = re(!1), [K, B] = re(null), [M, H] = re(void 0), O = be(
2282
2282
  (X, Y) => {
2283
2283
  const he = Array.isArray(X == null ? void 0 : X.messages) ? X.messages : [];
2284
2284
  Y === "replace" ? x(he) : Y === "prepend" && he.length && y(he), B((X == null ? void 0 : X.nextCursor) ?? null), L(!!(X != null && X.hasMore)), H((Fe) => (X == null ? void 0 : X.checkpointId) ?? Fe ?? void 0);
@@ -2459,14 +2459,14 @@ function Bn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2459
2459
  }, [T, C, p, R, w.lastCheckpointId, l, t == null ? void 0 : t.uploadPath, q, Q]), pe = be(
2460
2460
  async (X) => {
2461
2461
  if (!T) throw new Error("No active thread");
2462
- if (P || !M) return;
2462
+ if (P || !k) return;
2463
2463
  const Y = K;
2464
2464
  if (Y) {
2465
2465
  $(!0);
2466
2466
  try {
2467
2467
  const he = await l.getMessages({
2468
2468
  threadId: T,
2469
- checkpointId: k,
2469
+ checkpointId: M,
2470
2470
  limit: (X == null ? void 0 : X.limit) ?? N,
2471
2471
  beforeId: Y
2472
2472
  });
@@ -2476,7 +2476,7 @@ function Bn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2476
2476
  }
2477
2477
  }
2478
2478
  },
2479
- [l, T, k, K, M, P, O]
2479
+ [l, T, M, K, k, P, O]
2480
2480
  ), Se = {
2481
2481
  baseUrl: l.baseUrl,
2482
2482
  token: g,
@@ -2490,7 +2490,7 @@ function Bn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2490
2490
  error: d,
2491
2491
  lastCheckpointId: w.lastCheckpointId,
2492
2492
  streamingAssistantId: w.assemblingId,
2493
- hasMoreHistory: M,
2493
+ hasMoreHistory: k,
2494
2494
  isLoadingHistory: P,
2495
2495
  loadOlderMessages: pe,
2496
2496
  historyPageSize: N,
@@ -2994,7 +2994,7 @@ function In({ content: e, className: t = "" }) {
2994
2994
  return /* @__PURE__ */ c("div", { className: r, style: { wordBreak: "break-word", overflowWrap: "anywhere" }, children: /* @__PURE__ */ c(Cd, { remarkPlugins: [Ed], components: n, children: e }) });
2995
2995
  }
2996
2996
  const Un = "prose prose-sm max-w-none break-words dark:prose-invert prose-headings:break-words prose-p:break-words prose-li:break-words prose-td:break-words prose-th:break-words prose-a:break-all prose-code:break-words prose-blockquote:break-words";
2997
- function Mp({ className: e }) {
2997
+ function kp({ className: e }) {
2998
2998
  const [t, n] = re(0);
2999
2999
  return ge(() => {
3000
3000
  const r = setInterval(() => n((o) => (o + 1) % 4), 500);
@@ -3011,7 +3011,7 @@ function Mp({ className: e }) {
3011
3011
  }
3012
3012
  );
3013
3013
  }
3014
- function kp({
3014
+ function Mp({
3015
3015
  message: e,
3016
3016
  messageIndex: t,
3017
3017
  isStreamingMessage: n = !1,
@@ -3031,7 +3031,7 @@ function kp({
3031
3031
  onCancelEdit: b,
3032
3032
  onCopy: w
3033
3033
  }) {
3034
- const [x, y] = re(!1), [C, R] = re(!1), [_, N] = re(!1), [M, L] = re(!1), P = l === "phone" || l === "half-screen", $ = e.role, K = $ === "tool", B = qe.useMemo(() => {
3034
+ const [x, y] = re(!1), [C, R] = re(!1), [_, N] = re(!1), [k, L] = re(!1), P = l === "phone" || l === "half-screen", $ = e.role, K = $ === "tool", B = qe.useMemo(() => {
3035
3035
  switch ($) {
3036
3036
  case "user":
3037
3037
  return "text-[hsl(var(--chat-bubble-user-text))]";
@@ -3044,16 +3044,16 @@ function kp({
3044
3044
  default:
3045
3045
  return "text-foreground";
3046
3046
  }
3047
- }, [$]), k = gt(() => Dp(e.content), [e.content]), H = gt(() => Hp(e.content), [e.content]), O = gt(() => e.content.filter((W) => W.type === "image_url"), [e.content]), G = gt(() => e.content.filter((W) => W.type === "file"), [e.content]), D = Wp(k, n ? r : 0), T = async () => {
3047
+ }, [$]), M = gt(() => Dp(e.content), [e.content]), H = gt(() => Hp(e.content), [e.content]), O = gt(() => e.content.filter((W) => W.type === "image_url"), [e.content]), G = gt(() => e.content.filter((W) => W.type === "file"), [e.content]), D = Wp(M, n ? r : 0), T = async () => {
3048
3048
  try {
3049
- const W = K ? Tt(e.content) : k;
3049
+ const W = K ? Tt(e.content) : M;
3050
3050
  await navigator.clipboard.writeText(W), y(!0), setTimeout(() => y(!1), 2e3), w == null || w(W);
3051
3051
  } catch (W) {
3052
3052
  console.error("Failed to copy:", W);
3053
3053
  }
3054
3054
  }, Q = () => {
3055
3055
  if (!g) return;
3056
- const W = K ? Tt(e.content) : k;
3056
+ const W = K ? Tt(e.content) : M;
3057
3057
  g(e.id, W);
3058
3058
  }, q = () => h == null ? void 0 : h(t), ae = () => {
3059
3059
  const oe = A(P ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", B);
@@ -3115,7 +3115,7 @@ function kp({
3115
3115
  }
3116
3116
  }, fe = () => {
3117
3117
  if (e.model === "reflection") {
3118
- const V = k.trim(), Z = Xr(V);
3118
+ const V = M.trim(), Z = Xr(V);
3119
3119
  if (Z && typeof Z == "object")
3120
3120
  return /* @__PURE__ */ c(Vp, { data: Z });
3121
3121
  }
@@ -3159,15 +3159,15 @@ function kp({
3159
3159
  const V = Xr(D);
3160
3160
  return V !== null ? /* @__PURE__ */ c(Ys, { data: V }) : /* @__PURE__ */ c(In, { content: $p(Fp(D)) });
3161
3161
  })(),
3162
- /* @__PURE__ */ c(Mp, { className: A(B, P ? "text-xs" : "text-sm") })
3162
+ /* @__PURE__ */ c(kp, { className: A(B, P ? "text-xs" : "text-sm") })
3163
3163
  ] }) : (() => {
3164
- const V = Xr(k.trim());
3164
+ const V = Xr(M.trim());
3165
3165
  if (V !== null) return /* @__PURE__ */ c(Ys, { data: V });
3166
3166
  if ($ === "user" && p) {
3167
- const Z = k.trim();
3167
+ const Z = M.trim();
3168
3168
  if (Z.length > m)
3169
- return /* @__PURE__ */ E(qs, { open: M, onOpenChange: L, children: [
3170
- /* @__PURE__ */ c("div", { className: A("text-sm text-[hsl(var(--chat-bubble-user-text))]", P && "text-xs"), children: M ? /* @__PURE__ */ c(In, { content: Z }) : /* @__PURE__ */ E("pre", { className: A("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", P && "text-xs"), children: [
3169
+ return /* @__PURE__ */ E(qs, { open: k, onOpenChange: L, children: [
3170
+ /* @__PURE__ */ c("div", { className: A("text-sm text-[hsl(var(--chat-bubble-user-text))]", P && "text-xs"), children: k ? /* @__PURE__ */ c(In, { content: Z }) : /* @__PURE__ */ E("pre", { className: A("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", P && "text-xs"), children: [
3171
3171
  Z.substring(0, m),
3172
3172
  "..."
3173
3173
  ] }) }),
@@ -3177,7 +3177,7 @@ function kp({
3177
3177
  variant: "ghost",
3178
3178
  size: "sm",
3179
3179
  className: "h-6 text-xs !text-[hsl(var(--chat-bubble-user-text))]",
3180
- children: M ? /* @__PURE__ */ E(Ae, { children: [
3180
+ children: k ? /* @__PURE__ */ E(Ae, { children: [
3181
3181
  /* @__PURE__ */ c(Jt, { className: "h-3 w-3 mr-1" }),
3182
3182
  " Show less"
3183
3183
  ] }) : /* @__PURE__ */ E(Ae, { children: [
@@ -3190,7 +3190,7 @@ function kp({
3190
3190
  ) })
3191
3191
  ] });
3192
3192
  }
3193
- return /* @__PURE__ */ c(In, { content: k.trim() });
3193
+ return /* @__PURE__ */ c(In, { content: M.trim() });
3194
3194
  })(),
3195
3195
  W && /* @__PURE__ */ c("div", { className: "mt-2 grid grid-cols-2 gap-2", children: O.map((V, Z) => /* @__PURE__ */ E("div", { className: "relative border rounded overflow-hidden", children: [
3196
3196
  /* @__PURE__ */ c("img", { src: V.url, alt: V.alt ?? "image", className: "w-full h-auto" }),
@@ -3691,11 +3691,11 @@ var Jp = "DismissableLayer", bo = "dismissableLayer.update", Zp = "dismissableLa
3691
3691
  onDismiss: i,
3692
3692
  ...l
3693
3693
  } = e, f = u.useContext(di), [d, p] = u.useState(null), m = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = u.useState({}), g = ie(t, (N) => p(N)), h = Array.from(f.layers), [b] = [...f.layersWithOutsidePointerEventsDisabled].slice(-1), w = h.indexOf(b), x = d ? h.indexOf(d) : -1, y = f.layersWithOutsidePointerEventsDisabled.size > 0, C = x >= w, R = nh((N) => {
3694
- const M = N.target, L = [...f.branches].some((P) => P.contains(M));
3694
+ const k = N.target, L = [...f.branches].some((P) => P.contains(k));
3695
3695
  !C || L || (o == null || o(N), a == null || a(N), N.defaultPrevented || i == null || i());
3696
3696
  }, m), _ = rh((N) => {
3697
- const M = N.target;
3698
- [...f.branches].some((P) => P.contains(M)) || (s == null || s(N), a == null || a(N), N.defaultPrevented || i == null || i());
3697
+ const k = N.target;
3698
+ [...f.branches].some((P) => P.contains(k)) || (s == null || s(N), a == null || a(N), N.defaultPrevented || i == null || i());
3699
3699
  }, m);
3700
3700
  return Yp((N) => {
3701
3701
  x === f.layers.size - 1 && (r == null || r(N), !N.defaultPrevented && i && (N.preventDefault(), i()));
@@ -4218,12 +4218,12 @@ const Ch = (e) => ({
4218
4218
  }, v = qo(o), g = Go(v), h = await a.getDimensions(f), b = v === "y", w = b ? "top" : "left", x = b ? "bottom" : "right", y = b ? "clientHeight" : "clientWidth", C = s.reference[g] + s.reference[v] - m[v] - s.floating[g], R = m[v] - s.reference[v], _ = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(f));
4219
4219
  let N = _ ? _[y] : 0;
4220
4220
  (!N || !await (a.isElement == null ? void 0 : a.isElement(_))) && (N = i.floating[y] || s.floating[g]);
4221
- const M = C / 2 - R / 2, L = N / 2 - h[g] / 2 - 1, P = ut(p[w], L), $ = ut(p[x], L), K = P, B = N - h[g] - $, k = N / 2 - h[g] / 2 + M, H = vo(K, k, B), O = !l.arrow && Wt(o) != null && k !== H && s.reference[g] / 2 - (k < K ? P : $) - h[g] / 2 < 0, G = O ? k < K ? k - K : k - B : 0;
4221
+ const k = C / 2 - R / 2, L = N / 2 - h[g] / 2 - 1, P = ut(p[w], L), $ = ut(p[x], L), K = P, B = N - h[g] - $, M = N / 2 - h[g] / 2 + k, H = vo(K, M, B), O = !l.arrow && Wt(o) != null && M !== H && s.reference[g] / 2 - (M < K ? P : $) - h[g] / 2 < 0, G = O ? M < K ? M - K : M - B : 0;
4222
4222
  return {
4223
4223
  [v]: m[v] + G,
4224
4224
  data: {
4225
4225
  [v]: H,
4226
- centerOffset: k - H - G,
4226
+ centerOffset: M - H - G,
4227
4227
  ...O && {
4228
4228
  alignmentOffset: G
4229
4229
  }
@@ -4257,24 +4257,24 @@ const Ch = (e) => ({
4257
4257
  return {};
4258
4258
  const w = ot(o), x = Ye(i), y = ot(i) === i, C = await (l.isRTL == null ? void 0 : l.isRTL(f.floating)), R = m || (y || !h ? [er(i)] : gh(i)), _ = g !== "none";
4259
4259
  !m && _ && R.push(...yh(i, h, g, C));
4260
- const N = [i, ...R], M = await on(t, b), L = [];
4260
+ const N = [i, ...R], k = await on(t, b), L = [];
4261
4261
  let P = ((r = s.flip) == null ? void 0 : r.overflows) || [];
4262
- if (d && L.push(M[w]), p) {
4263
- const k = mh(o, a, C);
4264
- L.push(M[k[0]], M[k[1]]);
4262
+ if (d && L.push(k[w]), p) {
4263
+ const M = mh(o, a, C);
4264
+ L.push(k[M[0]], k[M[1]]);
4265
4265
  }
4266
4266
  if (P = [...P, {
4267
4267
  placement: o,
4268
4268
  overflows: L
4269
- }], !L.every((k) => k <= 0)) {
4269
+ }], !L.every((M) => M <= 0)) {
4270
4270
  var $, K;
4271
- const k = ((($ = s.flip) == null ? void 0 : $.index) || 0) + 1, H = N[k];
4271
+ const M = ((($ = s.flip) == null ? void 0 : $.index) || 0) + 1, H = N[M];
4272
4272
  if (H && (!(p === "alignment" ? x !== Ye(H) : !1) || // We leave the current main axis only if every placement on that axis
4273
4273
  // overflows the main axis.
4274
4274
  P.every((D) => Ye(D.placement) === x ? D.overflows[0] > 0 : !0)))
4275
4275
  return {
4276
4276
  data: {
4277
- index: k,
4277
+ index: M,
4278
4278
  overflows: P
4279
4279
  },
4280
4280
  reset: {
@@ -4535,14 +4535,14 @@ const Th = function(e) {
4535
4535
  let b, w;
4536
4536
  p === "top" || p === "bottom" ? (b = p, w = m === (await (a.isRTL == null ? void 0 : a.isRTL(i.floating)) ? "start" : "end") ? "left" : "right") : (w = p, b = m === "end" ? "top" : "bottom");
4537
4537
  const x = h - d.top - d.bottom, y = g - d.left - d.right, C = ut(h - d[b], x), R = ut(g - d[w], y), _ = !t.middlewareData.shift;
4538
- let N = C, M = R;
4539
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (M = y), (r = t.middlewareData.shift) != null && r.enabled.y && (N = x), _ && !m) {
4538
+ let N = C, k = R;
4539
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (k = y), (r = t.middlewareData.shift) != null && r.enabled.y && (N = x), _ && !m) {
4540
4540
  const P = Oe(d.left, 0), $ = Oe(d.right, 0), K = Oe(d.top, 0), B = Oe(d.bottom, 0);
4541
- v ? M = g - 2 * (P !== 0 || $ !== 0 ? P + $ : Oe(d.left, d.right)) : N = h - 2 * (K !== 0 || B !== 0 ? K + B : Oe(d.top, d.bottom));
4541
+ v ? k = g - 2 * (P !== 0 || $ !== 0 ? P + $ : Oe(d.left, d.right)) : N = h - 2 * (K !== 0 || B !== 0 ? K + B : Oe(d.top, d.bottom));
4542
4542
  }
4543
4543
  await l({
4544
4544
  ...t,
4545
- availableWidth: M,
4545
+ availableWidth: k,
4546
4546
  availableHeight: N
4547
4547
  });
4548
4548
  const L = await a.getDimensions(i.floating);
@@ -4560,7 +4560,7 @@ function vr() {
4560
4560
  function Vt(e) {
4561
4561
  return gi(e) ? (e.nodeName || "").toLowerCase() : "#document";
4562
4562
  }
4563
- function Me(e) {
4563
+ function ke(e) {
4564
4564
  var t;
4565
4565
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
4566
4566
  }
@@ -4569,16 +4569,16 @@ function Qe(e) {
4569
4569
  return (t = (gi(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
4570
4570
  }
4571
4571
  function gi(e) {
4572
- return vr() ? e instanceof Node || e instanceof Me(e).Node : !1;
4572
+ return vr() ? e instanceof Node || e instanceof ke(e).Node : !1;
4573
4573
  }
4574
4574
  function ze(e) {
4575
- return vr() ? e instanceof Element || e instanceof Me(e).Element : !1;
4575
+ return vr() ? e instanceof Element || e instanceof ke(e).Element : !1;
4576
4576
  }
4577
4577
  function Ze(e) {
4578
- return vr() ? e instanceof HTMLElement || e instanceof Me(e).HTMLElement : !1;
4578
+ return vr() ? e instanceof HTMLElement || e instanceof ke(e).HTMLElement : !1;
4579
4579
  }
4580
4580
  function la(e) {
4581
- return !vr() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Me(e).ShadowRoot;
4581
+ return !vr() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ke(e).ShadowRoot;
4582
4582
  }
4583
4583
  const _h = /* @__PURE__ */ new Set(["inline", "contents"]);
4584
4584
  function bn(e) {
@@ -4591,12 +4591,12 @@ function bn(e) {
4591
4591
  return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !_h.has(o);
4592
4592
  }
4593
4593
  const Oh = /* @__PURE__ */ new Set(["table", "td", "th"]);
4594
- function Mh(e) {
4594
+ function kh(e) {
4595
4595
  return Oh.has(Vt(e));
4596
4596
  }
4597
- const kh = [":popover-open", ":modal"];
4597
+ const Mh = [":popover-open", ":modal"];
4598
4598
  function wr(e) {
4599
- return kh.some((t) => {
4599
+ return Mh.some((t) => {
4600
4600
  try {
4601
4601
  return e.matches(t);
4602
4602
  } catch {
@@ -4628,7 +4628,7 @@ function Ft(e) {
4628
4628
  return Bh.has(Vt(e));
4629
4629
  }
4630
4630
  function We(e) {
4631
- return Me(e).getComputedStyle(e);
4631
+ return ke(e).getComputedStyle(e);
4632
4632
  }
4633
4633
  function yr(e) {
4634
4634
  return ze(e) ? {
@@ -4658,7 +4658,7 @@ function bi(e) {
4658
4658
  function sn(e, t, n) {
4659
4659
  var r;
4660
4660
  t === void 0 && (t = []), n === void 0 && (n = !0);
4661
- const o = bi(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), a = Me(o);
4661
+ const o = bi(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), a = ke(o);
4662
4662
  if (s) {
4663
4663
  const i = yo(a);
4664
4664
  return t.concat(a, a.visualViewport || [], bn(o) ? o : [], i && n ? sn(i) : []);
@@ -4681,7 +4681,7 @@ function vi(e) {
4681
4681
  function Jo(e) {
4682
4682
  return ze(e) ? e : e.contextElement;
4683
4683
  }
4684
- function Mt(e) {
4684
+ function kt(e) {
4685
4685
  const t = Jo(e);
4686
4686
  if (!Ze(t))
4687
4687
  return Je(1);
@@ -4698,28 +4698,28 @@ function Mt(e) {
4698
4698
  }
4699
4699
  const Uh = /* @__PURE__ */ Je(0);
4700
4700
  function wi(e) {
4701
- const t = Me(e);
4701
+ const t = ke(e);
4702
4702
  return !Yo() || !t.visualViewport ? Uh : {
4703
4703
  x: t.visualViewport.offsetLeft,
4704
4704
  y: t.visualViewport.offsetTop
4705
4705
  };
4706
4706
  }
4707
4707
  function Hh(e, t, n) {
4708
- return t === void 0 && (t = !1), !n || t && n !== Me(e) ? !1 : t;
4708
+ return t === void 0 && (t = !1), !n || t && n !== ke(e) ? !1 : t;
4709
4709
  }
4710
4710
  function xt(e, t, n, r) {
4711
4711
  t === void 0 && (t = !1), n === void 0 && (n = !1);
4712
4712
  const o = e.getBoundingClientRect(), s = Jo(e);
4713
4713
  let a = Je(1);
4714
- t && (r ? ze(r) && (a = Mt(r)) : a = Mt(e));
4714
+ t && (r ? ze(r) && (a = kt(r)) : a = kt(e));
4715
4715
  const i = Hh(s, n, r) ? wi(s) : Je(0);
4716
4716
  let l = (o.left + i.x) / a.x, f = (o.top + i.y) / a.y, d = o.width / a.x, p = o.height / a.y;
4717
4717
  if (s) {
4718
- const m = Me(s), v = r && ze(r) ? Me(r) : r;
4718
+ const m = ke(s), v = r && ze(r) ? ke(r) : r;
4719
4719
  let g = m, h = yo(g);
4720
4720
  for (; h && r && v !== g; ) {
4721
- const b = Mt(h), w = h.getBoundingClientRect(), x = We(h), y = w.left + (h.clientLeft + parseFloat(x.paddingLeft)) * b.x, C = w.top + (h.clientTop + parseFloat(x.paddingTop)) * b.y;
4722
- l *= b.x, f *= b.y, d *= b.x, p *= b.y, l += y, f += C, g = Me(h), h = yo(g);
4721
+ const b = kt(h), w = h.getBoundingClientRect(), x = We(h), y = w.left + (h.clientLeft + parseFloat(x.paddingLeft)) * b.x, C = w.top + (h.clientTop + parseFloat(x.paddingTop)) * b.y;
4722
+ l *= b.x, f *= b.y, d *= b.x, p *= b.y, l += y, f += C, g = ke(h), h = yo(g);
4723
4723
  }
4724
4724
  }
4725
4725
  return tr({
@@ -4757,7 +4757,7 @@ function zh(e) {
4757
4757
  const d = Je(0), p = Ze(r);
4758
4758
  if ((p || !p && !s) && ((Vt(r) !== "body" || bn(a)) && (l = yr(r)), Ze(r))) {
4759
4759
  const v = xt(r);
4760
- f = Mt(r), d.x = v.x + r.clientLeft, d.y = v.y + r.clientTop;
4760
+ f = kt(r), d.x = v.x + r.clientLeft, d.y = v.y + r.clientTop;
4761
4761
  }
4762
4762
  const m = a && !p && !s ? yi(a, l) : Je(0);
4763
4763
  return {
@@ -4783,7 +4783,7 @@ function Vh(e) {
4783
4783
  }
4784
4784
  const ua = 25;
4785
4785
  function jh(e, t) {
4786
- const n = Me(e), r = Qe(e), o = n.visualViewport;
4786
+ const n = ke(e), r = Qe(e), o = n.visualViewport;
4787
4787
  let s = r.clientWidth, a = r.clientHeight, i = 0, l = 0;
4788
4788
  if (o) {
4789
4789
  s = o.width, a = o.height;
@@ -4804,7 +4804,7 @@ function jh(e, t) {
4804
4804
  }
4805
4805
  const Kh = /* @__PURE__ */ new Set(["absolute", "fixed"]);
4806
4806
  function Gh(e, t) {
4807
- const n = xt(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = Ze(e) ? Mt(e) : Je(1), a = e.clientWidth * s.x, i = e.clientHeight * s.y, l = o * s.x, f = r * s.y;
4807
+ const n = xt(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = Ze(e) ? kt(e) : Je(1), a = e.clientWidth * s.x, i = e.clientHeight * s.y, l = o * s.x, f = r * s.y;
4808
4808
  return {
4809
4809
  width: a,
4810
4810
  height: i,
@@ -4912,7 +4912,7 @@ function fa(e, t) {
4912
4912
  return Qe(e) === n && (n = n.ownerDocument.body), n;
4913
4913
  }
4914
4914
  function Si(e, t) {
4915
- const n = Me(e);
4915
+ const n = ke(e);
4916
4916
  if (wr(e))
4917
4917
  return n;
4918
4918
  if (!Ze(e)) {
@@ -4925,7 +4925,7 @@ function Si(e, t) {
4925
4925
  return n;
4926
4926
  }
4927
4927
  let r = fa(e, t);
4928
- for (; r && Mh(r) && Qr(r); )
4928
+ for (; r && kh(r) && Qr(r); )
4929
4929
  r = fa(r, t);
4930
4930
  return r && Ft(r) && Qr(r) && !Xo(r) ? n : r || $h(e) || n;
4931
4931
  }
@@ -4952,7 +4952,7 @@ const em = {
4952
4952
  getElementRects: Zh,
4953
4953
  getClientRects: Wh,
4954
4954
  getDimensions: Yh,
4955
- getScale: Mt,
4955
+ getScale: kt,
4956
4956
  isElement: ze,
4957
4957
  isRTL: Qh
4958
4958
  };
@@ -5126,7 +5126,7 @@ function fm(e) {
5126
5126
  D !== _.current && (_.current = D, h(D));
5127
5127
  }, []), y = u.useCallback((D) => {
5128
5128
  D !== N.current && (N.current = D, w(D));
5129
- }, []), C = s || g, R = a || b, _ = u.useRef(null), N = u.useRef(null), M = u.useRef(d), L = l != null, P = eo(l), $ = eo(o), K = eo(f), B = u.useCallback(() => {
5129
+ }, []), C = s || g, R = a || b, _ = u.useRef(null), N = u.useRef(null), k = u.useRef(d), L = l != null, P = eo(l), $ = eo(o), K = eo(f), B = u.useCallback(() => {
5130
5130
  if (!_.current || !N.current)
5131
5131
  return;
5132
5132
  const D = {
@@ -5143,20 +5143,20 @@ function fm(e) {
5143
5143
  // setting it to `true` when `open === false` (must be specified).
5144
5144
  isPositioned: K.current !== !1
5145
5145
  };
5146
- k.current && !nr(M.current, Q) && (M.current = Q, lr.flushSync(() => {
5146
+ M.current && !nr(k.current, Q) && (k.current = Q, lr.flushSync(() => {
5147
5147
  p(Q);
5148
5148
  }));
5149
5149
  });
5150
5150
  }, [m, t, n, $, K]);
5151
5151
  Hn(() => {
5152
- f === !1 && M.current.isPositioned && (M.current.isPositioned = !1, p((D) => ({
5152
+ f === !1 && k.current.isPositioned && (k.current.isPositioned = !1, p((D) => ({
5153
5153
  ...D,
5154
5154
  isPositioned: !1
5155
5155
  })));
5156
5156
  }, [f]);
5157
- const k = u.useRef(!1);
5158
- Hn(() => (k.current = !0, () => {
5159
- k.current = !1;
5157
+ const M = u.useRef(!1);
5158
+ Hn(() => (M.current = !0, () => {
5159
+ M.current = !1;
5160
5160
  }), []), Hn(() => {
5161
5161
  if (C && (_.current = C), R && (N.current = R), C && R) {
5162
5162
  if (P.current)
@@ -5316,12 +5316,12 @@ var Qo = "PopperContent", [Em, Nm] = Ti(Qo), Oi = u.forwardRef(
5316
5316
  updatePositionStrategy: v = "optimized",
5317
5317
  onPlaced: g,
5318
5318
  ...h
5319
- } = e, b = Ai(Qo, n), [w, x] = u.useState(null), y = ie(t, (pe) => x(pe)), [C, R] = u.useState(null), _ = Ri(C), N = (_ == null ? void 0 : _.width) ?? 0, M = (_ == null ? void 0 : _.height) ?? 0, L = r + (s !== "center" ? "-" + s : ""), P = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, $ = Array.isArray(f) ? f : [f], K = $.length > 0, B = {
5319
+ } = e, b = Ai(Qo, n), [w, x] = u.useState(null), y = ie(t, (pe) => x(pe)), [C, R] = u.useState(null), _ = Ri(C), N = (_ == null ? void 0 : _.width) ?? 0, k = (_ == null ? void 0 : _.height) ?? 0, L = r + (s !== "center" ? "-" + s : ""), P = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, $ = Array.isArray(f) ? f : [f], K = $.length > 0, B = {
5320
5320
  padding: P,
5321
5321
  boundary: $.filter(Tm),
5322
5322
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
5323
5323
  altBoundary: K
5324
- }, { refs: k, floatingStyles: H, placement: O, isPositioned: G, middlewareData: D } = fm({
5324
+ }, { refs: M, floatingStyles: H, placement: O, isPositioned: G, middlewareData: D } = fm({
5325
5325
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
5326
5326
  strategy: "fixed",
5327
5327
  placement: L,
@@ -5332,7 +5332,7 @@ var Qo = "PopperContent", [Em, Nm] = Ti(Qo), Oi = u.forwardRef(
5332
5332
  reference: b.anchor
5333
5333
  },
5334
5334
  middleware: [
5335
- hm({ mainAxis: o + M, alignmentAxis: a }),
5335
+ hm({ mainAxis: o + k, alignmentAxis: a }),
5336
5336
  l && mm({
5337
5337
  mainAxis: !0,
5338
5338
  crossAxis: !1,
@@ -5348,7 +5348,7 @@ var Qo = "PopperContent", [Em, Nm] = Ti(Qo), Oi = u.forwardRef(
5348
5348
  }
5349
5349
  }),
5350
5350
  C && ym({ element: C, padding: i }),
5351
- Am({ arrowWidth: N, arrowHeight: M }),
5351
+ Am({ arrowWidth: N, arrowHeight: k }),
5352
5352
  m && wm({ strategy: "referenceHidden", ...B })
5353
5353
  ]
5354
5354
  }), [T, Q] = Di(O), q = we(g);
@@ -5361,7 +5361,7 @@ var Qo = "PopperContent", [Em, Nm] = Ti(Qo), Oi = u.forwardRef(
5361
5361
  }, [w]), /* @__PURE__ */ c(
5362
5362
  "div",
5363
5363
  {
5364
- ref: k.setFloating,
5364
+ ref: M.setFloating,
5365
5365
  "data-radix-popper-content-wrapper": "",
5366
5366
  style: {
5367
5367
  ...H,
@@ -5413,13 +5413,13 @@ var Qo = "PopperContent", [Em, Nm] = Ti(Qo), Oi = u.forwardRef(
5413
5413
  }
5414
5414
  );
5415
5415
  Oi.displayName = Qo;
5416
- var Mi = "PopperArrow", Rm = {
5416
+ var ki = "PopperArrow", Rm = {
5417
5417
  top: "bottom",
5418
5418
  right: "left",
5419
5419
  bottom: "top",
5420
5420
  left: "right"
5421
- }, ki = u.forwardRef(function(t, n) {
5422
- const { __scopePopper: r, ...o } = t, s = Nm(Mi, r), a = Rm[s.placedSide];
5421
+ }, Mi = u.forwardRef(function(t, n) {
5422
+ const { __scopePopper: r, ...o } = t, s = Nm(ki, r), a = Rm[s.placedSide];
5423
5423
  return (
5424
5424
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
5425
5425
  // doesn't report size as we'd expect on SVG elements.
@@ -5463,7 +5463,7 @@ var Mi = "PopperArrow", Rm = {
5463
5463
  )
5464
5464
  );
5465
5465
  });
5466
- ki.displayName = Mi;
5466
+ Mi.displayName = ki;
5467
5467
  function Tm(e) {
5468
5468
  return e !== null;
5469
5469
  }
@@ -5481,7 +5481,7 @@ function Di(e) {
5481
5481
  const [t, n = "center"] = e.split("-");
5482
5482
  return [t, n];
5483
5483
  }
5484
- var es = Pi, ts = _i, ns = Oi, rs = ki, Pm = "Portal", Sr = u.forwardRef((e, t) => {
5484
+ var es = Pi, ts = _i, ns = Oi, rs = Mi, Pm = "Portal", Sr = u.forwardRef((e, t) => {
5485
5485
  var i;
5486
5486
  const { container: n, ...r } = e, [o, s] = u.useState(!1);
5487
5487
  ve(() => s(!0), []);
@@ -5492,7 +5492,7 @@ Sr.displayName = Pm;
5492
5492
  var to = "rovingFocusGroup.onEntryFocus", Im = { bubbles: !1, cancelable: !0 }, vn = "RovingFocusGroup", [xo, Li, _m] = Vo(vn), [Om, Fi] = je(
5493
5493
  vn,
5494
5494
  [_m]
5495
- ), [Mm, km] = Om(vn), $i = u.forwardRef(
5495
+ ), [km, Mm] = Om(vn), $i = u.forwardRef(
5496
5496
  (e, t) => /* @__PURE__ */ c(xo.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(xo.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(Dm, { ...e, ref: t }) }) })
5497
5497
  );
5498
5498
  $i.displayName = vn;
@@ -5515,11 +5515,11 @@ var Dm = u.forwardRef((e, t) => {
5515
5515
  caller: vn
5516
5516
  }), [w, x] = u.useState(!1), y = we(f), C = Li(n), R = u.useRef(!1), [_, N] = u.useState(0);
5517
5517
  return u.useEffect(() => {
5518
- const M = m.current;
5519
- if (M)
5520
- return M.addEventListener(to, y), () => M.removeEventListener(to, y);
5518
+ const k = m.current;
5519
+ if (k)
5520
+ return k.addEventListener(to, y), () => k.removeEventListener(to, y);
5521
5521
  }, [y]), /* @__PURE__ */ c(
5522
- Mm,
5522
+ km,
5523
5523
  {
5524
5524
  scope: n,
5525
5525
  orientation: r,
@@ -5527,16 +5527,16 @@ var Dm = u.forwardRef((e, t) => {
5527
5527
  loop: o,
5528
5528
  currentTabStopId: h,
5529
5529
  onItemFocus: u.useCallback(
5530
- (M) => b(M),
5530
+ (k) => b(k),
5531
5531
  [b]
5532
5532
  ),
5533
5533
  onItemShiftTab: u.useCallback(() => x(!0), []),
5534
5534
  onFocusableItemAdd: u.useCallback(
5535
- () => N((M) => M + 1),
5535
+ () => N((k) => k + 1),
5536
5536
  []
5537
5537
  ),
5538
5538
  onFocusableItemRemove: u.useCallback(
5539
- () => N((M) => M - 1),
5539
+ () => N((k) => k - 1),
5540
5540
  []
5541
5541
  ),
5542
5542
  children: /* @__PURE__ */ c(
@@ -5550,11 +5550,11 @@ var Dm = u.forwardRef((e, t) => {
5550
5550
  onMouseDown: U(e.onMouseDown, () => {
5551
5551
  R.current = !0;
5552
5552
  }),
5553
- onFocus: U(e.onFocus, (M) => {
5553
+ onFocus: U(e.onFocus, (k) => {
5554
5554
  const L = !R.current;
5555
- if (M.target === M.currentTarget && L && !w) {
5555
+ if (k.target === k.currentTarget && L && !w) {
5556
5556
  const P = new CustomEvent(to, Im);
5557
- if (M.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
5557
+ if (k.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
5558
5558
  const $ = C().filter((O) => O.focusable), K = $.find((O) => O.active), B = $.find((O) => O.id === h), H = [K, B, ...$].filter(
5559
5559
  Boolean
5560
5560
  ).map((O) => O.ref.current);
@@ -5577,7 +5577,7 @@ var Dm = u.forwardRef((e, t) => {
5577
5577
  tabStopId: s,
5578
5578
  children: a,
5579
5579
  ...i
5580
- } = e, l = He(), f = s || l, d = km(Bi, n), p = d.currentTabStopId === f, m = Li(n), { onFocusableItemAdd: v, onFocusableItemRemove: g, currentTabStopId: h } = d;
5580
+ } = e, l = He(), f = s || l, d = Mm(Bi, n), p = d.currentTabStopId === f, m = Li(n), { onFocusableItemAdd: v, onFocusableItemRemove: g, currentTabStopId: h } = d;
5581
5581
  return u.useEffect(() => {
5582
5582
  if (r)
5583
5583
  return v(), () => g();
@@ -5658,7 +5658,7 @@ var Um = $i, Hm = Ui, zm = function(e) {
5658
5658
  return null;
5659
5659
  var t = Array.isArray(e) ? e[0] : e;
5660
5660
  return t.ownerDocument.body;
5661
- }, At = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), Mn = {}, no = 0, zi = function(e) {
5661
+ }, At = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), kn = {}, no = 0, zi = function(e) {
5662
5662
  return e && (e.host || zi(e.parentNode));
5663
5663
  }, Wm = function(e, t) {
5664
5664
  return t.map(function(n) {
@@ -5671,8 +5671,8 @@ var Um = $i, Hm = Ui, zm = function(e) {
5671
5671
  });
5672
5672
  }, Vm = function(e, t, n, r) {
5673
5673
  var o = Wm(t, Array.isArray(e) ? e : [e]);
5674
- Mn[n] || (Mn[n] = /* @__PURE__ */ new WeakMap());
5675
- var s = Mn[n], a = [], i = /* @__PURE__ */ new Set(), l = new Set(o), f = function(p) {
5674
+ kn[n] || (kn[n] = /* @__PURE__ */ new WeakMap());
5675
+ var s = kn[n], a = [], i = /* @__PURE__ */ new Set(), l = new Set(o), f = function(p) {
5676
5676
  !p || i.has(p) || (i.add(p), f(p.parentNode));
5677
5677
  };
5678
5678
  o.forEach(f);
@@ -5693,7 +5693,7 @@ var Um = $i, Hm = Ui, zm = function(e) {
5693
5693
  a.forEach(function(p) {
5694
5694
  var m = At.get(p) - 1, v = s.get(p) - 1;
5695
5695
  At.set(p, m), s.set(p, v), m || (On.has(p) || p.removeAttribute(r), On.delete(p)), v || p.removeAttribute(n);
5696
- }), no--, no || (At = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), Mn = {});
5696
+ }), no--, no || (At = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), kn = {});
5697
5697
  };
5698
5698
  }, os = function(e, t, n) {
5699
5699
  n === void 0 && (n = "data-aria-hidden");
@@ -5931,14 +5931,14 @@ var sg = function() {
5931
5931
  right: t[2],
5932
5932
  gap: Math.max(0, r - n + t[2] - t[0])
5933
5933
  };
5934
- }, ug = Ki(), kt = "data-scroll-locked", dg = function(e, t, n, r) {
5934
+ }, ug = Ki(), Mt = "data-scroll-locked", dg = function(e, t, n, r) {
5935
5935
  var o = e.left, s = e.top, a = e.right, i = e.gap;
5936
5936
  return n === void 0 && (n = "margin"), `
5937
5937
  .`.concat(Km, ` {
5938
5938
  overflow: hidden `).concat(r, `;
5939
5939
  padding-right: `).concat(i, "px ").concat(r, `;
5940
5940
  }
5941
- body[`).concat(kt, `] {
5941
+ body[`).concat(Mt, `] {
5942
5942
  overflow: hidden `).concat(r, `;
5943
5943
  overscroll-behavior: contain;
5944
5944
  `).concat([
@@ -5971,18 +5971,18 @@ var sg = function() {
5971
5971
  margin-right: 0 `).concat(r, `;
5972
5972
  }
5973
5973
 
5974
- body[`).concat(kt, `] {
5974
+ body[`).concat(Mt, `] {
5975
5975
  `).concat(Gm, ": ").concat(i, `px;
5976
5976
  }
5977
5977
  `);
5978
5978
  }, ga = function() {
5979
- var e = parseInt(document.body.getAttribute(kt) || "0", 10);
5979
+ var e = parseInt(document.body.getAttribute(Mt) || "0", 10);
5980
5980
  return isFinite(e) ? e : 0;
5981
5981
  }, fg = function() {
5982
5982
  u.useEffect(function() {
5983
- return document.body.setAttribute(kt, (ga() + 1).toString()), function() {
5983
+ return document.body.setAttribute(Mt, (ga() + 1).toString()), function() {
5984
5984
  var e = ga() - 1;
5985
- e <= 0 ? document.body.removeAttribute(kt) : document.body.setAttribute(kt, e.toString());
5985
+ e <= 0 ? document.body.removeAttribute(Mt) : document.body.setAttribute(Mt, e.toString());
5986
5986
  };
5987
5987
  }, []);
5988
5988
  }, pg = function(e) {
@@ -5995,12 +5995,12 @@ var sg = function() {
5995
5995
  }, So = !1;
5996
5996
  if (typeof window < "u")
5997
5997
  try {
5998
- var kn = Object.defineProperty({}, "passive", {
5998
+ var Mn = Object.defineProperty({}, "passive", {
5999
5999
  get: function() {
6000
6000
  return So = !0, !0;
6001
6001
  }
6002
6002
  });
6003
- window.addEventListener("test", kn, kn), window.removeEventListener("test", kn, kn);
6003
+ window.addEventListener("test", Mn, Mn), window.removeEventListener("test", Mn, Mn);
6004
6004
  } catch {
6005
6005
  So = !1;
6006
6006
  }
@@ -6104,10 +6104,10 @@ function Eg(e) {
6104
6104
  var w = Dn(h), x = n.current, y = "deltaX" in h ? h.deltaX : x[0] - w[0], C = "deltaY" in h ? h.deltaY : x[1] - w[1], R, _ = h.target, N = Math.abs(y) > Math.abs(C) ? "h" : "v";
6105
6105
  if ("touches" in h && N === "h" && _.type === "range")
6106
6106
  return !1;
6107
- var M = ba(N, _);
6108
- if (!M)
6107
+ var k = ba(N, _);
6108
+ if (!k)
6109
6109
  return !0;
6110
- if (M ? R = N : (R = N === "v" ? "h" : "v", M = ba(N, _)), !M)
6110
+ if (k ? R = N : (R = N === "v" ? "h" : "v", k = ba(N, _)), !k)
6111
6111
  return !1;
6112
6112
  if (!r.current && "changedTouches" in h && (y || C) && (r.current = R), !R)
6113
6113
  return !0;
@@ -6183,7 +6183,7 @@ var Co = ["Enter", " "], Tg = ["ArrowDown", "PageUp", "Home"], Yi = ["ArrowUp",
6183
6183
  Og,
6184
6184
  jt,
6185
6185
  Fi
6186
- ]), Nr = jt(), Zi = Fi(), [Mg, Rt] = Nt(wn), [kg, yn] = Nt(wn), Qi = (e) => {
6186
+ ]), Nr = jt(), Zi = Fi(), [kg, Rt] = Nt(wn), [Mg, yn] = Nt(wn), Qi = (e) => {
6187
6187
  const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: a = !0 } = e, i = Nr(t), [l, f] = u.useState(null), d = u.useRef(!1), p = we(s), m = gr(o);
6188
6188
  return u.useEffect(() => {
6189
6189
  const v = () => {
@@ -6193,7 +6193,7 @@ var Co = ["Enter", " "], Tg = ["ArrowDown", "PageUp", "Home"], Yi = ["ArrowUp",
6193
6193
  document.removeEventListener("keydown", v, { capture: !0 }), document.removeEventListener("pointerdown", g, { capture: !0 }), document.removeEventListener("pointermove", g, { capture: !0 });
6194
6194
  };
6195
6195
  }, []), /* @__PURE__ */ c(es, { ...i, children: /* @__PURE__ */ c(
6196
- Mg,
6196
+ kg,
6197
6197
  {
6198
6198
  scope: t,
6199
6199
  open: n,
@@ -6201,7 +6201,7 @@ var Co = ["Enter", " "], Tg = ["ArrowDown", "PageUp", "Home"], Yi = ["ArrowUp",
6201
6201
  content: l,
6202
6202
  onContentChange: f,
6203
6203
  children: /* @__PURE__ */ c(
6204
- kg,
6204
+ Mg,
6205
6205
  {
6206
6206
  scope: t,
6207
6207
  onClose: u.useCallback(() => p(!1), [p]),
@@ -6287,7 +6287,7 @@ var De = "MenuContent", [Fg, is] = Nt(De), nc = u.forwardRef(
6287
6287
  onDismiss: v,
6288
6288
  disableOutsideScroll: g,
6289
6289
  ...h
6290
- } = e, b = Rt(De, n), w = yn(De, n), x = Nr(n), y = Zi(n), C = _g(n), [R, _] = u.useState(null), N = u.useRef(null), M = ie(t, N, b.onContentChange), L = u.useRef(0), P = u.useRef(""), $ = u.useRef(0), K = u.useRef(null), B = u.useRef("right"), k = u.useRef(0), H = g ? Er : u.Fragment, O = g ? { as: Ug, allowPinchZoom: !0 } : void 0, G = (T) => {
6290
+ } = e, b = Rt(De, n), w = yn(De, n), x = Nr(n), y = Zi(n), C = _g(n), [R, _] = u.useState(null), N = u.useRef(null), k = ie(t, N, b.onContentChange), L = u.useRef(0), P = u.useRef(""), $ = u.useRef(0), K = u.useRef(null), B = u.useRef("right"), M = u.useRef(0), H = g ? Er : u.Fragment, O = g ? { as: Ug, allowPinchZoom: !0 } : void 0, G = (T) => {
6291
6291
  var z, W;
6292
6292
  const Q = P.current + T, q = C().filter((oe) => !oe.disabled), ae = document.activeElement, F = (z = q.find((oe) => oe.ref.current === ae)) == null ? void 0 : z.textValue, j = q.map((oe) => oe.textValue), ce = Zg(j, Q, F), fe = (W = q.find((oe) => oe.textValue === ce)) == null ? void 0 : W.ref.current;
6293
6293
  (function oe(V) {
@@ -6371,7 +6371,7 @@ var De = "MenuContent", [Fg, is] = Nt(De), nc = u.forwardRef(
6371
6371
  dir: w.dir,
6372
6372
  ...x,
6373
6373
  ...h,
6374
- ref: M,
6374
+ ref: k,
6375
6375
  style: { outline: "none", ...h.style },
6376
6376
  onKeyDown: U(h.onKeyDown, (T) => {
6377
6377
  const q = T.target.closest("[data-radix-menu-content]") === T.currentTarget, ae = T.ctrlKey || T.altKey || T.metaKey, F = T.key.length === 1;
@@ -6388,10 +6388,10 @@ var De = "MenuContent", [Fg, is] = Nt(De), nc = u.forwardRef(
6388
6388
  onPointerMove: U(
6389
6389
  e.onPointerMove,
6390
6390
  cn((T) => {
6391
- const Q = T.target, q = k.current !== T.clientX;
6391
+ const Q = T.target, q = M.current !== T.clientX;
6392
6392
  if (T.currentTarget.contains(Q) && q) {
6393
- const ae = T.clientX > k.current ? "right" : "left";
6394
- B.current = ae, k.current = T.clientX;
6393
+ const ae = T.clientX > M.current ? "right" : "left";
6394
+ B.current = ae, M.current = T.clientX;
6395
6395
  }
6396
6396
  })
6397
6397
  )
@@ -6900,7 +6900,7 @@ var _b = "DropdownMenuSubTrigger", Oc = u.forwardRef((e, t) => {
6900
6900
  return /* @__PURE__ */ c(hb, { ...o, ...r, ref: t });
6901
6901
  });
6902
6902
  Oc.displayName = _b;
6903
- var Ob = "DropdownMenuSubContent", Mc = u.forwardRef((e, t) => {
6903
+ var Ob = "DropdownMenuSubContent", kc = u.forwardRef((e, t) => {
6904
6904
  const { __scopeDropdownMenu: n, ...r } = e, o = Ce(n);
6905
6905
  return /* @__PURE__ */ c(
6906
6906
  mb,
@@ -6919,9 +6919,9 @@ var Ob = "DropdownMenuSubContent", Mc = u.forwardRef((e, t) => {
6919
6919
  }
6920
6920
  );
6921
6921
  });
6922
- Mc.displayName = Ob;
6923
- var Mb = yc, kb = Sc, Db = Cc, kc = Nc, Dc = Rc, Lc = Tc, Fc = Ac, $c = Pc, Bc = Ic, Uc = _c, Hc = Oc, zc = Mc;
6924
- const Lb = Mb, Fb = kb, $b = u.forwardRef(({ className: e, inset: t, children: n, ...r }, o) => /* @__PURE__ */ E(
6922
+ kc.displayName = Ob;
6923
+ var kb = yc, Mb = Sc, Db = Cc, Mc = Nc, Dc = Rc, Lc = Tc, Fc = Ac, $c = Pc, Bc = Ic, Uc = _c, Hc = Oc, zc = kc;
6924
+ const Lb = kb, Fb = Mb, $b = u.forwardRef(({ className: e, inset: t, children: n, ...r }, o) => /* @__PURE__ */ E(
6925
6925
  Hc,
6926
6926
  {
6927
6927
  ref: o,
@@ -6951,7 +6951,7 @@ const Bb = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
6951
6951
  ));
6952
6952
  Bb.displayName = zc.displayName;
6953
6953
  const Wc = u.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ c(Db, { children: /* @__PURE__ */ c(
6954
- kc,
6954
+ Mc,
6955
6955
  {
6956
6956
  ref: r,
6957
6957
  sideOffset: t,
@@ -6962,7 +6962,7 @@ const Wc = u.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__
6962
6962
  ...n
6963
6963
  }
6964
6964
  ) }));
6965
- Wc.displayName = kc.displayName;
6965
+ Wc.displayName = Mc.displayName;
6966
6966
  const Eo = u.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */ c(
6967
6967
  Lc,
6968
6968
  {
@@ -7058,10 +7058,10 @@ function Vn({
7058
7058
  navigateToCheckpoint: R,
7059
7059
  returnToLatest: _,
7060
7060
  hasMoreHistory: N,
7061
- isLoadingHistory: M,
7061
+ isLoadingHistory: k,
7062
7062
  loadOlderMessages: L,
7063
7063
  api: P
7064
- } = ri(), [$, K] = re(""), [B, k] = re(null), [H, O] = re(null), [G, D] = re([]), [T, Q] = re(!1), [q, ae] = re(null), [F, j] = re(null), [ce, fe] = re(!1), [z, W] = re([]), [oe, V] = re(null), Z = Te(null), J = Te(null), pe = Te(null), Se = Te(null), X = Te(null), Y = Te(!1), he = Te(!0), Fe = Te(0), Ee = Te(null), [xn, Gt] = re("desktop");
7064
+ } = ri(), [$, K] = re(""), [B, M] = re(null), [H, O] = re(null), [G, D] = re([]), [T, Q] = re(!1), [q, ae] = re(null), [F, j] = re(null), [ce, fe] = re(!1), [z, W] = re([]), [oe, V] = re(null), Z = Te(null), J = Te(null), pe = Te(null), Se = Te(null), X = Te(null), Y = Te(!1), he = Te(!0), Fe = Te(0), Ee = Te(null), [xn, Gt] = re("desktop");
7065
7065
  ge(() => {
7066
7066
  const I = () => {
7067
7067
  const ee = window.innerWidth;
@@ -7095,7 +7095,7 @@ function Vn({
7095
7095
  y && V(y);
7096
7096
  }, [y]);
7097
7097
  const ht = be(async () => {
7098
- if (!N || M) return;
7098
+ if (!N || k) return;
7099
7099
  const I = X.current;
7100
7100
  if (!I) return;
7101
7101
  const ee = I.scrollHeight, le = I.scrollTop;
@@ -7117,7 +7117,7 @@ function Vn({
7117
7117
  he.current = st <= 32, Y.current = !1;
7118
7118
  });
7119
7119
  }
7120
- }, [N, M, L]);
7120
+ }, [N, k, L]);
7121
7121
  ge(() => {
7122
7122
  const I = X.current;
7123
7123
  if (!I) return;
@@ -7163,17 +7163,17 @@ function Vn({
7163
7163
  return;
7164
7164
  }
7165
7165
  try {
7166
- await w(I, { checkpointId: oe || y || void 0, payloadExtras: B ? { edit: !0, originalMessageId: B } : void 0, attachments: G }), f == null || f(I), K(""), O(null), D([]), k(null), J.current && (J.current.style.height = "auto");
7166
+ await w(I, { checkpointId: oe || y || void 0, payloadExtras: B ? { edit: !0, originalMessageId: B } : void 0, attachments: G }), f == null || f(I), K(""), O(null), D([]), M(null), J.current && (J.current.style.height = "auto");
7167
7167
  } catch (le) {
7168
7168
  const ue = (le == null ? void 0 : le.message) || "Failed to send message";
7169
7169
  O(ue), p == null || p(ue);
7170
7170
  }
7171
7171
  }, Cn = (I, ee) => {
7172
- i && (k(I), K(ee), O(null), setTimeout(() => {
7172
+ i && (M(I), K(ee), O(null), setTimeout(() => {
7173
7173
  J.current && (J.current.focus(), J.current.style.height = "auto", J.current.style.height = J.current.scrollHeight + "px");
7174
7174
  }, 0));
7175
7175
  }, Xt = () => {
7176
- k(null), K(""), O(null), J.current && (J.current.style.height = "auto");
7176
+ M(null), K(""), O(null), J.current && (J.current.style.height = "auto");
7177
7177
  }, Ur = (I) => {
7178
7178
  I.key === "Enter" && !I.shiftKey ? (I.preventDefault(), Sn()) : I.key === "Escape" && B && (I.preventDefault(), Xt());
7179
7179
  }, Hr = (I) => {
@@ -7250,9 +7250,9 @@ function Vn({
7250
7250
  style: r ? { maxHeight: r } : void 0,
7251
7251
  children: [
7252
7252
  v.length === 0 ? /* @__PURE__ */ c("div", { className: "flex items-center justify-center py-8 text-muted-foreground", children: "No messages yet. Start a conversation!" }) : /* @__PURE__ */ E(Ae, { children: [
7253
- (M || !N) && /* @__PURE__ */ c("div", { className: "flex justify-center py-2 text-xs text-muted-foreground", children: M ? /* @__PURE__ */ c(Rs, { className: "h-4 w-4 animate-spin" }) : "You've reached the beginning" }),
7253
+ (k || !N) && /* @__PURE__ */ c("div", { className: "flex justify-center py-2 text-xs text-muted-foreground", children: k ? /* @__PURE__ */ c(Rs, { className: "h-4 w-4 animate-spin" }) : "You've reached the beginning" }),
7254
7254
  v.map((I, ee) => /* @__PURE__ */ c(
7255
- kp,
7255
+ Mp,
7256
7256
  {
7257
7257
  message: I,
7258
7258
  messageIndex: ee,
@@ -7308,7 +7308,7 @@ function Vn({
7308
7308
  className: "hidden"
7309
7309
  }
7310
7310
  ),
7311
- G.length > 0 && /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-2", children: G.map((I, ee) => /* @__PURE__ */ E("div", { className: "flex items-center gap-2 bg-gray-100 rounded-lg px-3 py-2 text-sm", children: [
7311
+ G.length > 0 && /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-2", children: G.map((I, ee) => /* @__PURE__ */ E("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: [
7312
7312
  /* @__PURE__ */ c(Ts, { size: 14 }),
7313
7313
  /* @__PURE__ */ c("span", { className: "truncate max-w-[150px]", children: I.name }),
7314
7314
  /* @__PURE__ */ c(
@@ -7317,7 +7317,7 @@ function Vn({
7317
7317
  variant: "ghost",
7318
7318
  size: "sm",
7319
7319
  onClick: () => En(ee),
7320
- className: "h-4 w-4 p-0 text-gray-500 hover:text-red-500",
7320
+ className: "h-4 w-4 p-0 text-gray-500 dark:text-gray-400 hover:text-red-500 dark:hover:text-red-400",
7321
7321
  "aria-label": `Remove ${I.name}`,
7322
7322
  children: /* @__PURE__ */ c(en, { size: 12 })
7323
7323
  }
@@ -7459,7 +7459,7 @@ var fs = "ScrollArea", [Vc, Uy] = je(fs), [jb, Le] = Vc(fs), jc = u.forwardRef(
7459
7459
  dir: o,
7460
7460
  scrollHideDelay: s = 600,
7461
7461
  ...a
7462
- } = e, [i, l] = u.useState(null), [f, d] = u.useState(null), [p, m] = u.useState(null), [v, g] = u.useState(null), [h, b] = u.useState(null), [w, x] = u.useState(0), [y, C] = u.useState(0), [R, _] = u.useState(!1), [N, M] = u.useState(!1), L = ie(t, ($) => l($)), P = gr(o);
7462
+ } = e, [i, l] = u.useState(null), [f, d] = u.useState(null), [p, m] = u.useState(null), [v, g] = u.useState(null), [h, b] = u.useState(null), [w, x] = u.useState(0), [y, C] = u.useState(0), [R, _] = u.useState(!1), [N, k] = u.useState(!1), L = ie(t, ($) => l($)), P = gr(o);
7463
7463
  return /* @__PURE__ */ c(
7464
7464
  jb,
7465
7465
  {
@@ -7479,7 +7479,7 @@ var fs = "ScrollArea", [Vc, Uy] = je(fs), [jb, Le] = Vc(fs), jc = u.forwardRef(
7479
7479
  scrollbarY: h,
7480
7480
  onScrollbarYChange: b,
7481
7481
  scrollbarYEnabled: N,
7482
- onScrollbarYEnabledChange: M,
7482
+ onScrollbarYEnabledChange: k,
7483
7483
  onCornerWidthChange: x,
7484
7484
  onCornerHeightChange: C,
7485
7485
  children: /* @__PURE__ */ c(
@@ -7782,7 +7782,7 @@ var Kb = u.forwardRef((e, t) => {
7782
7782
  onResize: p,
7783
7783
  ...m
7784
7784
  } = e, v = Le(et, n), [g, h] = u.useState(null), b = ie(t, (L) => h(L)), w = u.useRef(null), x = u.useRef(""), y = v.viewport, C = r.content - r.viewport, R = we(d), _ = we(l), N = Pr(p, 10);
7785
- function M(L) {
7785
+ function k(L) {
7786
7786
  if (w.current) {
7787
7787
  const P = L.clientX - w.current.left, $ = L.clientY - w.current.top;
7788
7788
  f({ x: P, y: $ });
@@ -7811,9 +7811,9 @@ var Kb = u.forwardRef((e, t) => {
7811
7811
  ref: b,
7812
7812
  style: { position: "absolute", ...m.style },
7813
7813
  onPointerDown: U(e.onPointerDown, (L) => {
7814
- L.button === 0 && (L.target.setPointerCapture(L.pointerId), w.current = g.getBoundingClientRect(), x.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), M(L));
7814
+ L.button === 0 && (L.target.setPointerCapture(L.pointerId), w.current = g.getBoundingClientRect(), x.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), k(L));
7815
7815
  }),
7816
- onPointerMove: U(e.onPointerMove, M),
7816
+ onPointerMove: U(e.onPointerMove, k),
7817
7817
  onPointerUp: U(e.onPointerUp, (L) => {
7818
7818
  const P = L.target;
7819
7819
  P.hasPointerCapture(L.pointerId) && P.releasePointerCapture(L.pointerId), document.body.style.webkitUserSelect = x.current, v.viewport && (v.viewport.style.scrollBehavior = ""), w.current = null;
@@ -8010,11 +8010,11 @@ function Ro({
8010
8010
  createThread: h,
8011
8011
  deleteThread: b,
8012
8012
  renameThread: w
8013
- } = ri(), [x, y] = re(m ?? []), [C, R] = re(!1), [_, N] = re(null), [M, L] = re(null), [P, $] = re(""), [K, B] = re(!1);
8013
+ } = ri(), [x, y] = re(m ?? []), [C, R] = re(!1), [_, N] = re(null), [k, L] = re(null), [P, $] = re(""), [K, B] = re(!1);
8014
8014
  ge(() => {
8015
8015
  y(m ?? []);
8016
8016
  }, [m]);
8017
- const k = async (F) => {
8017
+ const M = async (F) => {
8018
8018
  try {
8019
8019
  await p(F), i == null || i(F), l == null || l(F);
8020
8020
  } catch (j) {
@@ -8083,11 +8083,11 @@ function Ro({
8083
8083
  ] }) : x.slice().sort((F, j) => new Date(j.updatedAt || j.createdAt || "").getTime() - new Date(F.updatedAt || F.createdAt || "").getTime()).map((F) => /* @__PURE__ */ E(
8084
8084
  "div",
8085
8085
  {
8086
- onClick: () => k(F.threadId),
8086
+ onClick: () => M(F.threadId),
8087
8087
  className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(a ?? g) === F.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
8088
8088
  children: [
8089
8089
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
8090
- /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: M === F.threadId ? /* @__PURE__ */ E("div", { className: "flex items-center gap-2", onClick: (j) => j.stopPropagation(), children: [
8090
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: k === F.threadId ? /* @__PURE__ */ E("div", { className: "flex items-center gap-2", onClick: (j) => j.stopPropagation(), children: [
8091
8091
  /* @__PURE__ */ c(ln, { value: P, onChange: (j) => $(j.target.value), onKeyDown: (j) => Q(j, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
8092
8092
  /* @__PURE__ */ c(de, { variant: "ghost", size: "sm", onClick: () => D(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(Lo, { size: 12 }) }),
8093
8093
  /* @__PURE__ */ c(de, { variant: "ghost", size: "sm", onClick: T, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(en, { size: 12 }) })
@@ -8099,7 +8099,7 @@ function Ro({
8099
8099
  ] })
8100
8100
  ] }) }),
8101
8101
  /* @__PURE__ */ E("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
8102
- r && M !== F.threadId && /* @__PURE__ */ c(de, { variant: "ghost", size: "sm", onClick: (j) => G(F, j), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ c(Ia, { size: 12 }) }),
8102
+ r && k !== F.threadId && /* @__PURE__ */ c(de, { variant: "ghost", size: "sm", onClick: (j) => G(F, j), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ c(Ia, { size: 12 }) }),
8103
8103
  n && /* @__PURE__ */ c(
8104
8104
  de,
8105
8105
  {
@@ -8542,7 +8542,7 @@ const Ol = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8542
8542
  }
8543
8543
  ));
8544
8544
  Ol.displayName = Tl.displayName;
8545
- const Ml = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8545
+ const kl = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8546
8546
  Al,
8547
8547
  {
8548
8548
  ref: n,
@@ -8550,7 +8550,7 @@ const Ml = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8550
8550
  ...t
8551
8551
  }
8552
8552
  ));
8553
- Ml.displayName = Al.displayName;
8553
+ kl.displayName = Al.displayName;
8554
8554
  function Ea({
8555
8555
  className: e,
8556
8556
  ...t
@@ -8563,7 +8563,7 @@ function Ea({
8563
8563
  }
8564
8564
  );
8565
8565
  }
8566
- var kl = Object.freeze({
8566
+ var Ml = Object.freeze({
8567
8567
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
8568
8568
  position: "absolute",
8569
8569
  border: 0,
@@ -8581,7 +8581,7 @@ var kl = Object.freeze({
8581
8581
  {
8582
8582
  ...e,
8583
8583
  ref: t,
8584
- style: { ...kl, ...e.style }
8584
+ style: { ...Ml, ...e.style }
8585
8585
  }
8586
8586
  )
8587
8587
  );
@@ -8624,7 +8624,7 @@ var Iv = Dl, [_r, Gy] = je("Tooltip", [
8624
8624
  );
8625
8625
  };
8626
8626
  Fl.displayName = Ll;
8627
- var un = "Tooltip", [Mv, Mr] = _r(un), $l = (e) => {
8627
+ var un = "Tooltip", [kv, kr] = _r(un), $l = (e) => {
8628
8628
  const {
8629
8629
  __scopeTooltip: t,
8630
8630
  children: n,
@@ -8652,7 +8652,7 @@ var un = "Tooltip", [Mv, Mr] = _r(un), $l = (e) => {
8652
8652
  return u.useEffect(() => () => {
8653
8653
  v.current && (window.clearTimeout(v.current), v.current = 0);
8654
8654
  }, []), /* @__PURE__ */ c(es, { ...f, children: /* @__PURE__ */ c(
8655
- Mv,
8655
+ kv,
8656
8656
  {
8657
8657
  scope: t,
8658
8658
  contentId: m,
@@ -8676,7 +8676,7 @@ var un = "Tooltip", [Mv, Mr] = _r(un), $l = (e) => {
8676
8676
  $l.displayName = un;
8677
8677
  var Ao = "TooltipTrigger", Bl = u.forwardRef(
8678
8678
  (e, t) => {
8679
- const { __scopeTooltip: n, ...r } = e, o = Mr(Ao, n), s = xs(Ao, n), a = Or(n), i = u.useRef(null), l = ie(t, i, o.onTriggerChange), f = u.useRef(!1), d = u.useRef(!1), p = u.useCallback(() => f.current = !1, []);
8679
+ const { __scopeTooltip: n, ...r } = e, o = kr(Ao, n), s = xs(Ao, n), a = Or(n), i = u.useRef(null), l = ie(t, i, o.onTriggerChange), f = u.useRef(!1), d = u.useRef(!1), p = u.useCallback(() => f.current = !1, []);
8680
8680
  return u.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ c(ts, { asChild: !0, ...a, children: /* @__PURE__ */ c(
8681
8681
  te.button,
8682
8682
  {
@@ -8703,15 +8703,15 @@ var Ao = "TooltipTrigger", Bl = u.forwardRef(
8703
8703
  }
8704
8704
  );
8705
8705
  Bl.displayName = Ao;
8706
- var kv = "TooltipPortal", [qy, Dv] = _r(kv, {
8706
+ var Mv = "TooltipPortal", [qy, Dv] = _r(Mv, {
8707
8707
  forceMount: void 0
8708
8708
  }), Bt = "TooltipContent", Ul = u.forwardRef(
8709
8709
  (e, t) => {
8710
- const n = Dv(Bt, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = Mr(Bt, e.__scopeTooltip);
8710
+ const n = Dv(Bt, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = kr(Bt, e.__scopeTooltip);
8711
8711
  return /* @__PURE__ */ c(_e, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(Hl, { side: o, ...s, ref: t }) : /* @__PURE__ */ c(Lv, { side: o, ...s, ref: t }) });
8712
8712
  }
8713
8713
  ), Lv = u.forwardRef((e, t) => {
8714
- const n = Mr(Bt, e.__scopeTooltip), r = xs(Bt, e.__scopeTooltip), o = u.useRef(null), s = ie(t, o), [a, i] = u.useState(null), { trigger: l, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r, m = u.useCallback(() => {
8714
+ const n = kr(Bt, e.__scopeTooltip), r = xs(Bt, e.__scopeTooltip), o = u.useRef(null), s = ie(t, o), [a, i] = u.useState(null), { trigger: l, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r, m = u.useCallback(() => {
8715
8715
  i(null), p(!1);
8716
8716
  }, [p]), v = u.useCallback(
8717
8717
  (g, h) => {
@@ -8745,7 +8745,7 @@ var kv = "TooltipPortal", [qy, Dv] = _r(kv, {
8745
8745
  onEscapeKeyDown: s,
8746
8746
  onPointerDownOutside: a,
8747
8747
  ...i
8748
- } = e, l = Mr(Bt, n), f = Or(n), { onClose: d } = l;
8748
+ } = e, l = kr(Bt, n), f = Or(n), { onClose: d } = l;
8749
8749
  return u.useEffect(() => (document.addEventListener(To, d), () => document.removeEventListener(To, d)), [d]), u.useEffect(() => {
8750
8750
  if (l.trigger) {
8751
8751
  const p = (m) => {
@@ -8906,7 +8906,7 @@ const Yv = Gv, Jv = qv, Zv = Xv, Vl = u.forwardRef(({ className: e, sideOffset:
8906
8906
  ));
8907
8907
  Vl.displayName = Wl.displayName;
8908
8908
  const Qv = "sidebar:state", ew = 60 * 60 * 24 * 7, tw = "16rem", nw = "18rem", rw = "3rem", ow = "b", jl = u.createContext(null);
8909
- function kr() {
8909
+ function Mr() {
8910
8910
  const e = u.useContext(jl);
8911
8911
  if (!e)
8912
8912
  throw new Error("useSidebar must be used within a SidebarProvider.");
@@ -8976,7 +8976,7 @@ const Gl = u.forwardRef(
8976
8976
  children: o,
8977
8977
  ...s
8978
8978
  }, a) => {
8979
- const { isMobile: i, state: l, openMobile: f, setOpenMobile: d } = kr();
8979
+ const { isMobile: i, state: l, openMobile: f, setOpenMobile: d } = Mr();
8980
8980
  return n === "none" ? /* @__PURE__ */ c(
8981
8981
  "div",
8982
8982
  {
@@ -9049,7 +9049,7 @@ const Gl = u.forwardRef(
9049
9049
  );
9050
9050
  Gl.displayName = "Sidebar";
9051
9051
  const ql = u.forwardRef(({ className: e, onClick: t, ...n }, r) => {
9052
- const { toggleSidebar: o } = kr();
9052
+ const { toggleSidebar: o } = Mr();
9053
9053
  return /* @__PURE__ */ E(
9054
9054
  de,
9055
9055
  {
@@ -9071,7 +9071,7 @@ const ql = u.forwardRef(({ className: e, onClick: t, ...n }, r) => {
9071
9071
  });
9072
9072
  ql.displayName = "SidebarTrigger";
9073
9073
  const sw = u.forwardRef(({ className: e, ...t }, n) => {
9074
- const { toggleSidebar: r } = kr();
9074
+ const { toggleSidebar: r } = Mr();
9075
9075
  return /* @__PURE__ */ c(
9076
9076
  "button",
9077
9077
  {
@@ -9263,7 +9263,7 @@ const uw = dn(
9263
9263
  className: s,
9264
9264
  ...a
9265
9265
  }, i) => {
9266
- const l = e ? Ut : "button", { isMobile: f, state: d } = kr(), p = /* @__PURE__ */ c(
9266
+ const l = e ? Ut : "button", { isMobile: f, state: d } = Mr(), p = /* @__PURE__ */ c(
9267
9267
  l,
9268
9268
  {
9269
9269
  ref: i,
@@ -9446,7 +9446,7 @@ ou.displayName = bw;
9446
9446
  var su = ou;
9447
9447
  const vw = dn(
9448
9448
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9449
- ), ke = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
9449
+ ), Me = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
9450
9450
  su,
9451
9451
  {
9452
9452
  ref: n,
@@ -9454,7 +9454,7 @@ const vw = dn(
9454
9454
  ...t
9455
9455
  }
9456
9456
  ));
9457
- ke.displayName = su.displayName;
9457
+ Me.displayName = su.displayName;
9458
9458
  function au(e) {
9459
9459
  const t = u.useRef({ value: e, previous: e });
9460
9460
  return u.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
@@ -9615,7 +9615,7 @@ var Ew = [" ", "Enter", "ArrowUp", "ArrowDown"], Nw = [" ", "Enter"], Ct = "Sele
9615
9615
  disabled: m,
9616
9616
  required: v,
9617
9617
  form: g
9618
- } = e, h = $r(t), [b, w] = u.useState(null), [x, y] = u.useState(null), [C, R] = u.useState(!1), _ = gr(f), [N, M] = lt({
9618
+ } = e, h = $r(t), [b, w] = u.useState(null), [x, y] = u.useState(null), [C, R] = u.useState(!1), _ = gr(f), [N, k] = lt({
9619
9619
  prop: r,
9620
9620
  defaultProp: o ?? !1,
9621
9621
  onChange: s,
@@ -9625,7 +9625,7 @@ var Ew = [" ", "Enter", "ArrowUp", "ArrowDown"], Nw = [" ", "Enter"], Ct = "Sele
9625
9625
  defaultProp: i,
9626
9626
  onChange: l,
9627
9627
  caller: Ct
9628
- }), $ = u.useRef(null), K = b ? g || !!b.closest("form") : !0, [B, k] = u.useState(/* @__PURE__ */ new Set()), H = Array.from(B).map((O) => O.props.value).join(";");
9628
+ }), $ = u.useRef(null), K = b ? g || !!b.closest("form") : !0, [B, M] = u.useState(/* @__PURE__ */ new Set()), H = Array.from(B).map((O) => O.props.value).join(";");
9629
9629
  return /* @__PURE__ */ c(es, { ...h, children: /* @__PURE__ */ E(
9630
9630
  Tw,
9631
9631
  {
@@ -9641,7 +9641,7 @@ var Ew = [" ", "Enter", "ArrowUp", "ArrowDown"], Nw = [" ", "Enter"], Ct = "Sele
9641
9641
  value: L,
9642
9642
  onValueChange: P,
9643
9643
  open: N,
9644
- onOpenChange: M,
9644
+ onOpenChange: k,
9645
9645
  dir: _,
9646
9646
  triggerPointerDownPosRef: $,
9647
9647
  disabled: m,
@@ -9651,10 +9651,10 @@ var Ew = [" ", "Enter", "ArrowUp", "ArrowDown"], Nw = [" ", "Enter"], Ct = "Sele
9651
9651
  {
9652
9652
  scope: e.__scopeSelect,
9653
9653
  onNativeOptionAdd: u.useCallback((O) => {
9654
- k((G) => new Set(G).add(O));
9654
+ M((G) => new Set(G).add(O));
9655
9655
  }, []),
9656
9656
  onNativeOptionRemove: u.useCallback((O) => {
9657
- k((G) => {
9657
+ M((G) => {
9658
9658
  const D = new Set(G);
9659
9659
  return D.delete(O), D;
9660
9660
  });
@@ -9772,7 +9772,7 @@ var Et = "SelectContent", yu = u.forwardRef(
9772
9772
  }
9773
9773
  );
9774
9774
  yu.displayName = Et;
9775
- var Ue = 10, [xu, pt] = Kt(Et), Ow = "SelectContentImpl", Mw = Dt("SelectContent.RemoveScroll"), Su = u.forwardRef(
9775
+ var Ue = 10, [xu, pt] = Kt(Et), Ow = "SelectContentImpl", kw = Dt("SelectContent.RemoveScroll"), Su = u.forwardRef(
9776
9776
  (e, t) => {
9777
9777
  const {
9778
9778
  __scopeSelect: n,
@@ -9794,9 +9794,9 @@ var Ue = 10, [xu, pt] = Kt(Et), Ow = "SelectContentImpl", Mw = Dt("SelectContent
9794
9794
  avoidCollisions: b,
9795
9795
  //
9796
9796
  ...w
9797
- } = e, x = ft(Et, n), [y, C] = u.useState(null), [R, _] = u.useState(null), N = ie(t, (z) => C(z)), [M, L] = u.useState(null), [P, $] = u.useState(
9797
+ } = e, x = ft(Et, n), [y, C] = u.useState(null), [R, _] = u.useState(null), N = ie(t, (z) => C(z)), [k, L] = u.useState(null), [P, $] = u.useState(
9798
9798
  null
9799
- ), K = Fr(n), [B, k] = u.useState(!1), H = u.useRef(!1);
9799
+ ), K = Fr(n), [B, M] = u.useState(!1), H = u.useRef(!1);
9800
9800
  u.useEffect(() => {
9801
9801
  if (y) return os(y);
9802
9802
  }, [y]), jo();
@@ -9808,8 +9808,8 @@ var Ue = 10, [xu, pt] = Kt(Et), Ow = "SelectContentImpl", Mw = Dt("SelectContent
9808
9808
  },
9809
9809
  [K, R]
9810
9810
  ), G = u.useCallback(
9811
- () => O([M, y]),
9812
- [O, M, y]
9811
+ () => O([k, y]),
9812
+ [O, k, y]
9813
9813
  );
9814
9814
  u.useEffect(() => {
9815
9815
  B && G();
@@ -9872,7 +9872,7 @@ var Ue = 10, [xu, pt] = Kt(Et), Ow = "SelectContentImpl", Mw = Dt("SelectContent
9872
9872
  viewport: R,
9873
9873
  onViewportChange: _,
9874
9874
  itemRefCallback: ae,
9875
- selectedItem: M,
9875
+ selectedItem: k,
9876
9876
  onItemLeave: F,
9877
9877
  itemTextRefCallback: j,
9878
9878
  focusSelectedItem: G,
@@ -9880,7 +9880,7 @@ var Ue = 10, [xu, pt] = Kt(Et), Ow = "SelectContentImpl", Mw = Dt("SelectContent
9880
9880
  position: r,
9881
9881
  isPositioned: B,
9882
9882
  searchRef: Q,
9883
- children: /* @__PURE__ */ c(Er, { as: Mw, allowPinchZoom: !0, children: /* @__PURE__ */ c(
9883
+ children: /* @__PURE__ */ c(Er, { as: kw, allowPinchZoom: !0, children: /* @__PURE__ */ c(
9884
9884
  br,
9885
9885
  {
9886
9886
  asChild: !0,
@@ -9911,7 +9911,7 @@ var Ue = 10, [xu, pt] = Kt(Et), Ow = "SelectContentImpl", Mw = Dt("SelectContent
9911
9911
  onContextMenu: (z) => z.preventDefault(),
9912
9912
  ...w,
9913
9913
  ...fe,
9914
- onPlaced: () => k(!0),
9914
+ onPlaced: () => M(!0),
9915
9915
  ref: N,
9916
9916
  style: {
9917
9917
  // flex layout so we can place the scroll buttons properly
@@ -9943,12 +9943,12 @@ var Ue = 10, [xu, pt] = Kt(Et), Ow = "SelectContentImpl", Mw = Dt("SelectContent
9943
9943
  }
9944
9944
  );
9945
9945
  Su.displayName = Ow;
9946
- var kw = "SelectItemAlignedPosition", Cu = u.forwardRef((e, t) => {
9946
+ var Mw = "SelectItemAlignedPosition", Cu = u.forwardRef((e, t) => {
9947
9947
  const { __scopeSelect: n, onPlaced: r, ...o } = e, s = ft(Et, n), a = pt(Et, n), [i, l] = u.useState(null), [f, d] = u.useState(null), p = ie(t, (N) => d(N)), m = Fr(n), v = u.useRef(!1), g = u.useRef(!0), { viewport: h, selectedItem: b, selectedItemText: w, focusSelectedItem: x } = a, y = u.useCallback(() => {
9948
9948
  if (s.trigger && s.valueNode && i && f && h && b && w) {
9949
- const N = s.trigger.getBoundingClientRect(), M = f.getBoundingClientRect(), L = s.valueNode.getBoundingClientRect(), P = w.getBoundingClientRect();
9949
+ const N = s.trigger.getBoundingClientRect(), k = f.getBoundingClientRect(), L = s.valueNode.getBoundingClientRect(), P = w.getBoundingClientRect();
9950
9950
  if (s.dir !== "rtl") {
9951
- const Z = P.left - M.left, J = L.left - Z, pe = N.left - J, Se = N.width + pe, X = Math.max(Se, M.width), Y = window.innerWidth - Ue, he = No(J, [
9951
+ const Z = P.left - k.left, J = L.left - Z, pe = N.left - J, Se = N.width + pe, X = Math.max(Se, k.width), Y = window.innerWidth - Ue, he = No(J, [
9952
9952
  Ue,
9953
9953
  // Prevents the content from going off the starting edge of the
9954
9954
  // viewport. It may still go off the ending edge, but this can be
@@ -9959,13 +9959,13 @@ var kw = "SelectItemAlignedPosition", Cu = u.forwardRef((e, t) => {
9959
9959
  ]);
9960
9960
  i.style.minWidth = Se + "px", i.style.left = he + "px";
9961
9961
  } else {
9962
- const Z = M.right - P.right, J = window.innerWidth - L.right - Z, pe = window.innerWidth - N.right - J, Se = N.width + pe, X = Math.max(Se, M.width), Y = window.innerWidth - Ue, he = No(J, [
9962
+ const Z = k.right - P.right, J = window.innerWidth - L.right - Z, pe = window.innerWidth - N.right - J, Se = N.width + pe, X = Math.max(Se, k.width), Y = window.innerWidth - Ue, he = No(J, [
9963
9963
  Ue,
9964
9964
  Math.max(Ue, Y - X)
9965
9965
  ]);
9966
9966
  i.style.minWidth = Se + "px", i.style.right = he + "px";
9967
9967
  }
9968
- const $ = m(), K = window.innerHeight - Ue * 2, B = h.scrollHeight, k = window.getComputedStyle(f), H = parseInt(k.borderTopWidth, 10), O = parseInt(k.paddingTop, 10), G = parseInt(k.borderBottomWidth, 10), D = parseInt(k.paddingBottom, 10), T = H + O + B + D + G, Q = Math.min(b.offsetHeight * 5, T), q = window.getComputedStyle(h), ae = parseInt(q.paddingTop, 10), F = parseInt(q.paddingBottom, 10), j = N.top + N.height / 2 - Ue, ce = K - j, fe = b.offsetHeight / 2, z = b.offsetTop + fe, W = H + O + z, oe = T - W;
9968
+ const $ = m(), K = window.innerHeight - Ue * 2, B = h.scrollHeight, M = window.getComputedStyle(f), H = parseInt(M.borderTopWidth, 10), O = parseInt(M.paddingTop, 10), G = parseInt(M.borderBottomWidth, 10), D = parseInt(M.paddingBottom, 10), T = H + O + B + D + G, Q = Math.min(b.offsetHeight * 5, T), q = window.getComputedStyle(h), ae = parseInt(q.paddingTop, 10), F = parseInt(q.paddingBottom, 10), j = N.top + N.height / 2 - Ue, ce = K - j, fe = b.offsetHeight / 2, z = b.offsetTop + fe, W = H + O + z, oe = T - W;
9969
9969
  if (W <= j) {
9970
9970
  const Z = $.length > 0 && b === $[$.length - 1].ref.current;
9971
9971
  i.style.bottom = "0px";
@@ -10047,7 +10047,7 @@ var kw = "SelectItemAlignedPosition", Cu = u.forwardRef((e, t) => {
10047
10047
  }
10048
10048
  );
10049
10049
  });
10050
- Cu.displayName = kw;
10050
+ Cu.displayName = Mw;
10051
10051
  var Dw = "SelectPopperPosition", Po = u.forwardRef((e, t) => {
10052
10052
  const {
10053
10053
  __scopeSelect: n,
@@ -10256,7 +10256,7 @@ var _u = "SelectItemIndicator", Ou = u.forwardRef(
10256
10256
  }
10257
10257
  );
10258
10258
  Ou.displayName = _u;
10259
- var _o = "SelectScrollUpButton", Mu = u.forwardRef((e, t) => {
10259
+ var _o = "SelectScrollUpButton", ku = u.forwardRef((e, t) => {
10260
10260
  const n = pt(_o, e.__scopeSelect), r = Ss(_o, e.__scopeSelect), [o, s] = u.useState(!1), a = ie(t, r.onScrollButtonChange);
10261
10261
  return ve(() => {
10262
10262
  if (n.viewport && n.isPositioned) {
@@ -10279,8 +10279,8 @@ var _o = "SelectScrollUpButton", Mu = u.forwardRef((e, t) => {
10279
10279
  }
10280
10280
  ) : null;
10281
10281
  });
10282
- Mu.displayName = _o;
10283
- var Oo = "SelectScrollDownButton", ku = u.forwardRef((e, t) => {
10282
+ ku.displayName = _o;
10283
+ var Oo = "SelectScrollDownButton", Mu = u.forwardRef((e, t) => {
10284
10284
  const n = pt(Oo, e.__scopeSelect), r = Ss(Oo, e.__scopeSelect), [o, s] = u.useState(!1), a = ie(t, r.onScrollButtonChange);
10285
10285
  return ve(() => {
10286
10286
  if (n.viewport && n.isPositioned) {
@@ -10303,7 +10303,7 @@ var Oo = "SelectScrollDownButton", ku = u.forwardRef((e, t) => {
10303
10303
  }
10304
10304
  ) : null;
10305
10305
  });
10306
- ku.displayName = Oo;
10306
+ Mu.displayName = Oo;
10307
10307
  var Du = u.forwardRef((e, t) => {
10308
10308
  const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s = pt("SelectScrollButton", n), a = u.useRef(null), i = Fr(n), l = u.useCallback(() => {
10309
10309
  a.current !== null && (window.clearInterval(a.current), a.current = null);
@@ -10338,13 +10338,13 @@ var Du = u.forwardRef((e, t) => {
10338
10338
  }
10339
10339
  );
10340
10340
  Lu.displayName = Hw;
10341
- var Mo = "SelectArrow", zw = u.forwardRef(
10341
+ var ko = "SelectArrow", zw = u.forwardRef(
10342
10342
  (e, t) => {
10343
- const { __scopeSelect: n, ...r } = e, o = $r(n), s = ft(Mo, n), a = pt(Mo, n);
10343
+ const { __scopeSelect: n, ...r } = e, o = $r(n), s = ft(ko, n), a = pt(ko, n);
10344
10344
  return s.open && a.position === "popper" ? /* @__PURE__ */ c(rs, { ...o, ...r, ref: t }) : null;
10345
10345
  }
10346
10346
  );
10347
- zw.displayName = Mo;
10347
+ zw.displayName = ko;
10348
10348
  var Ww = "SelectBubbleInput", Fu = u.forwardRef(
10349
10349
  ({ __scopeSelect: e, value: t, ...n }, r) => {
10350
10350
  const o = u.useRef(null), s = ie(r, o), a = au(t);
@@ -10363,7 +10363,7 @@ var Ww = "SelectBubbleInput", Fu = u.forwardRef(
10363
10363
  te.select,
10364
10364
  {
10365
10365
  ...n,
10366
- style: { ...kl, ...n.style },
10366
+ style: { ...Ml, ...n.style },
10367
10367
  ref: s,
10368
10368
  defaultValue: t
10369
10369
  }
@@ -10400,8 +10400,8 @@ function Uu(e, t, n) {
10400
10400
  function Vw(e, t) {
10401
10401
  return e.map((n, r) => e[(t + r) % e.length]);
10402
10402
  }
10403
- var jw = pu, Hu = mu, Kw = bu, Gw = vu, qw = wu, zu = yu, Xw = Eu, Wu = Tu, Vu = Pu, Yw = Iu, Jw = Ou, ju = Mu, Ku = ku, Gu = Lu;
10404
- const Na = jw, Ra = Kw, ko = u.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ E(
10403
+ var jw = pu, Hu = mu, Kw = bu, Gw = vu, qw = wu, zu = yu, Xw = Eu, Wu = Tu, Vu = Pu, Yw = Iu, Jw = Ou, ju = ku, Ku = Mu, Gu = Lu;
10404
+ const Na = jw, Ra = Kw, Mo = u.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ E(
10405
10405
  Hu,
10406
10406
  {
10407
10407
  ref: r,
@@ -10416,7 +10416,7 @@ const Na = jw, Ra = Kw, ko = u.forwardRef(({ className: e, children: t, ...n },
10416
10416
  ]
10417
10417
  }
10418
10418
  ));
10419
- ko.displayName = Hu.displayName;
10419
+ Mo.displayName = Hu.displayName;
10420
10420
  const qu = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10421
10421
  ju,
10422
10422
  {
@@ -10712,7 +10712,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10712
10712
  /* @__PURE__ */ E(ys, { className: "w-[500px] sm:w-[600px] overflow-y-auto", children: [
10713
10713
  /* @__PURE__ */ E(_l, { children: [
10714
10714
  /* @__PURE__ */ c(Ol, { children: "Chat Settings" }),
10715
- /* @__PURE__ */ c(Ml, { children: "Configure your chat interface, API connection, and behavior preferences." })
10715
+ /* @__PURE__ */ c(kl, { children: "Configure your chat interface, API connection, and behavior preferences." })
10716
10716
  ] }),
10717
10717
  /* @__PURE__ */ E("div", { className: "space-y-6 py-6", children: [
10718
10718
  /* @__PURE__ */ E(jn, { children: [
@@ -10722,7 +10722,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10722
10722
  ] }) }),
10723
10723
  /* @__PURE__ */ E(qn, { className: "space-y-4", children: [
10724
10724
  /* @__PURE__ */ E("div", { className: "space-y-2", children: [
10725
- /* @__PURE__ */ c(ke, { htmlFor: "api-url", children: "API Base URL" }),
10725
+ /* @__PURE__ */ c(Me, { htmlFor: "api-url", children: "API Base URL" }),
10726
10726
  /* @__PURE__ */ E("div", { className: "flex gap-2", children: [
10727
10727
  /* @__PURE__ */ c(
10728
10728
  ln,
@@ -10740,7 +10740,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10740
10740
  ] })
10741
10741
  ] }),
10742
10742
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
10743
- /* @__PURE__ */ c(ke, { htmlFor: "enable-auth", children: "Enable Authentication" }),
10743
+ /* @__PURE__ */ c(Me, { htmlFor: "enable-auth", children: "Enable Authentication" }),
10744
10744
  /* @__PURE__ */ c(
10745
10745
  it,
10746
10746
  {
@@ -10754,7 +10754,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10754
10754
  )
10755
10755
  ] }),
10756
10756
  i.api.enableAuth && /* @__PURE__ */ E("div", { className: "space-y-2", children: [
10757
- /* @__PURE__ */ c(ke, { htmlFor: "auth-token", children: "Authentication Token" }),
10757
+ /* @__PURE__ */ c(Me, { htmlFor: "auth-token", children: "Authentication Token" }),
10758
10758
  /* @__PURE__ */ E("div", { className: "flex gap-2", children: [
10759
10759
  /* @__PURE__ */ c(
10760
10760
  ln,
@@ -10789,7 +10789,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10789
10789
  ] }) }),
10790
10790
  /* @__PURE__ */ E(qn, { className: "space-y-4", children: [
10791
10791
  /* @__PURE__ */ E("div", { className: "space-y-2", children: [
10792
- /* @__PURE__ */ c(ke, { htmlFor: "layout", children: "Layout Style" }),
10792
+ /* @__PURE__ */ c(Me, { htmlFor: "layout", children: "Layout Style" }),
10793
10793
  /* @__PURE__ */ E(
10794
10794
  Na,
10795
10795
  {
@@ -10799,7 +10799,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10799
10799
  ui: { ...w.ui, layout: b }
10800
10800
  })),
10801
10801
  children: [
10802
- /* @__PURE__ */ c(ko, { children: /* @__PURE__ */ c(Ra, {}) }),
10802
+ /* @__PURE__ */ c(Mo, { children: /* @__PURE__ */ c(Ra, {}) }),
10803
10803
  /* @__PURE__ */ E(Do, { children: [
10804
10804
  /* @__PURE__ */ c(mt, { value: "sidebar", children: "Sidebar Layout" }),
10805
10805
  /* @__PURE__ */ c(mt, { value: "fullscreen", children: "Fullscreen" }),
@@ -10810,7 +10810,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10810
10810
  )
10811
10811
  ] }),
10812
10812
  /* @__PURE__ */ E("div", { className: "space-y-2", children: [
10813
- /* @__PURE__ */ c(ke, { htmlFor: "theme", children: "Theme" }),
10813
+ /* @__PURE__ */ c(Me, { htmlFor: "theme", children: "Theme" }),
10814
10814
  /* @__PURE__ */ E(
10815
10815
  Na,
10816
10816
  {
@@ -10820,7 +10820,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10820
10820
  ui: { ...w.ui, theme: b }
10821
10821
  })),
10822
10822
  children: [
10823
- /* @__PURE__ */ c(ko, { children: /* @__PURE__ */ c(Ra, {}) }),
10823
+ /* @__PURE__ */ c(Mo, { children: /* @__PURE__ */ c(Ra, {}) }),
10824
10824
  /* @__PURE__ */ E(Do, { children: [
10825
10825
  /* @__PURE__ */ c(mt, { value: "light", children: "Light" }),
10826
10826
  /* @__PURE__ */ c(mt, { value: "dark", children: "Dark" }),
@@ -10833,7 +10833,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10833
10833
  /* @__PURE__ */ c(gs, {}),
10834
10834
  /* @__PURE__ */ E("div", { className: "space-y-3", children: [
10835
10835
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
10836
- /* @__PURE__ */ c(ke, { htmlFor: "show-timestamps", children: "Show Timestamps" }),
10836
+ /* @__PURE__ */ c(Me, { htmlFor: "show-timestamps", children: "Show Timestamps" }),
10837
10837
  /* @__PURE__ */ c(
10838
10838
  it,
10839
10839
  {
@@ -10847,7 +10847,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10847
10847
  )
10848
10848
  ] }),
10849
10849
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
10850
- /* @__PURE__ */ c(ke, { htmlFor: "show-agent-names", children: "Show Agent Names" }),
10850
+ /* @__PURE__ */ c(Me, { htmlFor: "show-agent-names", children: "Show Agent Names" }),
10851
10851
  /* @__PURE__ */ c(
10852
10852
  it,
10853
10853
  {
@@ -10861,7 +10861,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10861
10861
  )
10862
10862
  ] }),
10863
10863
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
10864
- /* @__PURE__ */ c(ke, { htmlFor: "compact-messages", children: "Compact Messages" }),
10864
+ /* @__PURE__ */ c(Me, { htmlFor: "compact-messages", children: "Compact Messages" }),
10865
10865
  /* @__PURE__ */ c(
10866
10866
  it,
10867
10867
  {
@@ -10885,7 +10885,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10885
10885
  /* @__PURE__ */ E(qn, { className: "space-y-4", children: [
10886
10886
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
10887
10887
  /* @__PURE__ */ E("div", { children: [
10888
- /* @__PURE__ */ c(ke, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
10888
+ /* @__PURE__ */ c(Me, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
10889
10889
  /* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: "Automatically save messages to threads" })
10890
10890
  ] }),
10891
10891
  /* @__PURE__ */ c(
@@ -10902,7 +10902,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10902
10902
  ] }),
10903
10903
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
10904
10904
  /* @__PURE__ */ E("div", { children: [
10905
- /* @__PURE__ */ c(ke, { htmlFor: "enable-streaming", children: "Enable Streaming" }),
10905
+ /* @__PURE__ */ c(Me, { htmlFor: "enable-streaming", children: "Enable Streaming" }),
10906
10906
  /* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: "Stream responses in real-time" })
10907
10907
  ] }),
10908
10908
  /* @__PURE__ */ c(
@@ -10919,7 +10919,7 @@ function Zy({ settings: e, onSettingsChange: t, className: n = "" }) {
10919
10919
  ] }),
10920
10920
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
10921
10921
  /* @__PURE__ */ E("div", { children: [
10922
- /* @__PURE__ */ c(ke, { htmlFor: "typing-indicator", children: "Typing Indicator" }),
10922
+ /* @__PURE__ */ c(Me, { htmlFor: "typing-indicator", children: "Typing Indicator" }),
10923
10923
  /* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: "Show typing indicator during responses" })
10924
10924
  ] }),
10925
10925
  /* @__PURE__ */ c(
@@ -11037,7 +11037,7 @@ export {
11037
11037
  Hy as ChatRoutingProvider,
11038
11038
  Zy as ChatSettings,
11039
11039
  In as MarkdownContent,
11040
- kp as MessageComponent,
11040
+ Mp as MessageComponent,
11041
11041
  Ro as ThreadManager,
11042
11042
  yt as apiClient,
11043
11043
  Vy as applySettings,