teodor-new-chat-ui 4.3.689 → 4.3.690

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
@@ -1,17 +1,17 @@
1
1
  var gp = Object.defineProperty;
2
2
  var xp = (e, t, n) => t in e ? gp(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var Ws = (e, t, n) => xp(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { clsx as jc } from "clsx";
5
- import { twMerge as _c } from "tailwind-merge";
4
+ import { clsx as _c } from "clsx";
5
+ import { twMerge as jc } from "tailwind-merge";
6
6
  import * as x from "react";
7
- import Q, { createContext as ir, useContext as ar, useState as ue, useRef as Te, useCallback as ie, useEffect as qe, useMemo as Be, useReducer as yp, createElement as jo, memo as oo, useImperativeHandle as wp, useLayoutEffect as bp } from "react";
7
+ import Q, { createContext as ir, useContext as ar, useState as ue, useRef as Te, useCallback as ie, useEffect as qe, useMemo as Be, useReducer as yp, createElement as _o, memo as oo, useImperativeHandle as wp, useLayoutEffect as bp } from "react";
8
8
  import { Slot as vp, createSlot as Gr } from "@radix-ui/react-slot";
9
9
  import { cva as Pc } from "class-variance-authority";
10
10
  import * as Oc from "react-dom";
11
11
  import Mc from "react-dom";
12
- import { XCircle as Sp, CheckCircle2 as Cp, Loader2 as Gn, ChevronUp as Tp, ChevronDown as kp, ChevronLeft as Ip, ChevronRight as zi, Copy as Rp, Edit as Ep, RotateCcw as Ap, Loader as Np, Wrench as jp, Bot as _p, User as Pp, Info as Op, Check as Dc, Circle as Mp, Square as Dp, Send as Lp, Paperclip as Ja, X as Yo, Plus as $p, FileSpreadsheet as Fp, Edit3 as so, Search as zp, MoreVertical as Bp, Share2 as Up, Trash2 as Hp, MessageSquare as Lc, MoreHorizontal as Wp, Maximize2 as Vp, Minimize2 as Kp, History as qp } from "lucide-react";
12
+ import { XCircle as Sp, CheckCircle2 as Cp, Loader2 as Gn, ChevronUp as Tp, ChevronDown as kp, ChevronLeft as Ip, ChevronRight as zi, Copy as Rp, Edit as Ep, RotateCcw as Ap, Loader as Np, Wrench as _p, Bot as jp, User as Pp, Info as Op, Check as Dc, Circle as Mp, Square as Dp, Send as Lp, Paperclip as Ja, X as Yo, Plus as $p, FileSpreadsheet as Fp, Edit3 as so, Search as zp, MoreVertical as Bp, Share2 as Up, Trash2 as Hp, MessageSquare as Lc, MoreHorizontal as Wp, Maximize2 as Vp, Minimize2 as Kp, History as qp } from "lucide-react";
13
13
  function LT(...e) {
14
- return _c(jc(e));
14
+ return jc(_c(e));
15
15
  }
16
16
  function $c(e, t) {
17
17
  return function() {
@@ -30,7 +30,7 @@ function Yp(e) {
30
30
  let t;
31
31
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && zc(e.buffer), t;
32
32
  }
33
- const Xp = gs("string"), Et = gs("function"), Bc = gs("number"), ao = (e) => e !== null && typeof e == "object", Jp = (e) => e === !0 || e === !1, _o = (e) => {
33
+ const Xp = gs("string"), Et = gs("function"), Bc = gs("number"), ao = (e) => e !== null && typeof e == "object", Jp = (e) => e === !0 || e === !1, jo = (e) => {
34
34
  if (ms(e) !== "object")
35
35
  return !1;
36
36
  const t = Bi(e);
@@ -79,7 +79,7 @@ const Kn = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typ
79
79
  function gi() {
80
80
  const { caseless: e, skipUndefined: t } = Hc(this) && this || {}, n = {}, r = (o, s) => {
81
81
  const i = e && Uc(n, s) || s;
82
- _o(n[i]) && _o(o) ? n[i] = gi(n[i], o) : _o(o) ? n[i] = gi({}, o) : Ar(o) ? n[i] = o.slice() : (!t || !Tr(o)) && (n[i] = o);
82
+ jo(n[i]) && jo(o) ? n[i] = gi(n[i], o) : jo(o) ? n[i] = gi({}, o) : Ar(o) ? n[i] = o.slice() : (!t || !Tr(o)) && (n[i] = o);
83
83
  };
84
84
  for (let o = 0, s = arguments.length; o < s; o++)
85
85
  arguments[o] && lo(arguments[o], r);
@@ -191,7 +191,7 @@ const Em = (e) => {
191
191
  }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
192
192
  typeof setImmediate == "function",
193
193
  Et(Kn.postMessage)
194
- ), jm = typeof queueMicrotask < "u" ? queueMicrotask.bind(Kn) : typeof process < "u" && process.nextTick || Vc, _m = (e) => e != null && Et(e[ps]), F = {
194
+ ), _m = typeof queueMicrotask < "u" ? queueMicrotask.bind(Kn) : typeof process < "u" && process.nextTick || Vc, jm = (e) => e != null && Et(e[ps]), F = {
195
195
  isArray: Ar,
196
196
  isArrayBuffer: zc,
197
197
  isBuffer: io,
@@ -201,7 +201,7 @@ const Em = (e) => {
201
201
  isNumber: Bc,
202
202
  isBoolean: Jp,
203
203
  isObject: ao,
204
- isPlainObject: _o,
204
+ isPlainObject: jo,
205
205
  isEmptyObject: Zp,
206
206
  isReadableStream: im,
207
207
  isRequest: am,
@@ -248,8 +248,8 @@ const Em = (e) => {
248
248
  isAsyncFn: Am,
249
249
  isThenable: Nm,
250
250
  setImmediate: Vc,
251
- asap: jm,
252
- isIterable: _m
251
+ asap: _m,
252
+ isIterable: jm
253
253
  };
254
254
  function ke(e, t, n, r, o) {
255
255
  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);
@@ -1242,7 +1242,7 @@ const nu = (e) => {
1242
1242
  onUploadProgress: S,
1243
1243
  responseType: C,
1244
1244
  headers: R,
1245
- withCredentials: j = "same-origin",
1245
+ withCredentials: _ = "same-origin",
1246
1246
  fetchOptions: E
1247
1247
  } = nu(m), D = t || fetch;
1248
1248
  C = C ? (C + "").toLowerCase() : "text";
@@ -1266,7 +1266,7 @@ const nu = (e) => {
1266
1266
  w = il(W.body, al, A, L);
1267
1267
  }
1268
1268
  }
1269
- F.isString(j) || (j = j ? "include" : "omit");
1269
+ F.isString(_) || (_ = _ ? "include" : "omit");
1270
1270
  const q = s && "credentials" in n.prototype, ne = {
1271
1271
  ...E,
1272
1272
  signal: $,
@@ -1274,7 +1274,7 @@ const nu = (e) => {
1274
1274
  headers: R.normalize().toJSON(),
1275
1275
  body: w,
1276
1276
  duplex: "half",
1277
- credentials: q ? j : void 0
1277
+ credentials: q ? _ : void 0
1278
1278
  };
1279
1279
  z = s && new n(y, ne);
1280
1280
  let H = await (s ? D(z, E) : D(y, ne));
@@ -2040,14 +2040,14 @@ function Eg() {
2040
2040
  var w = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2041
2041
  function b(k) {
2042
2042
  {
2043
- for (var X = arguments.length, re = new Array(X > 1 ? X - 1 : 0), _ = 1; _ < X; _++)
2044
- re[_ - 1] = arguments[_];
2043
+ for (var X = arguments.length, re = new Array(X > 1 ? X - 1 : 0), j = 1; j < X; j++)
2044
+ re[j - 1] = arguments[j];
2045
2045
  T("error", k, re);
2046
2046
  }
2047
2047
  }
2048
2048
  function T(k, X, re) {
2049
2049
  {
2050
- var _ = w.ReactDebugCurrentFrame, G = _.getStackAddendum();
2050
+ var j = w.ReactDebugCurrentFrame, G = j.getStackAddendum();
2051
2051
  G !== "" && (X += "%s", re = re.concat([G]));
2052
2052
  var se = re.map(function(oe) {
2053
2053
  return String(oe);
@@ -2055,19 +2055,19 @@ function Eg() {
2055
2055
  se.unshift("Warning: " + X), Function.prototype.apply.call(console[k], console, se);
2056
2056
  }
2057
2057
  }
2058
- var I = !1, v = !1, S = !1, C = !1, R = !1, j;
2059
- j = Symbol.for("react.module.reference");
2058
+ var I = !1, v = !1, S = !1, C = !1, R = !1, _;
2059
+ _ = Symbol.for("react.module.reference");
2060
2060
  function E(k) {
2061
2061
  return !!(typeof k == "string" || typeof k == "function" || k === r || k === s || R || k === o || k === l || k === u || C || k === p || I || v || S || typeof k == "object" && k !== null && (k.$$typeof === h || k.$$typeof === f || k.$$typeof === i || k.$$typeof === a || k.$$typeof === c || // This needs to include all possible module reference object
2062
2062
  // types supported by any Flight configuration anywhere since
2063
2063
  // we don't know which Flight build this will end up being used
2064
2064
  // with.
2065
- k.$$typeof === j || k.getModuleId !== void 0));
2065
+ k.$$typeof === _ || k.getModuleId !== void 0));
2066
2066
  }
2067
2067
  function D(k, X, re) {
2068
- var _ = k.displayName;
2069
- if (_)
2070
- return _;
2068
+ var j = k.displayName;
2069
+ if (j)
2070
+ return j;
2071
2071
  var G = X.displayName || X.name || "";
2072
2072
  return G !== "" ? re + "(" + G + ")" : re;
2073
2073
  }
@@ -2106,8 +2106,8 @@ function Eg() {
2106
2106
  case c:
2107
2107
  return D(k, k.render, "ForwardRef");
2108
2108
  case f:
2109
- var _ = k.displayName || null;
2110
- return _ !== null ? _ : z(k.type) || "Memo";
2109
+ var j = k.displayName || null;
2110
+ return j !== null ? j : z(k.type) || "Memo";
2111
2111
  case h: {
2112
2112
  var G = k, se = G._payload, oe = G._init;
2113
2113
  try {
@@ -2188,8 +2188,8 @@ function Eg() {
2188
2188
  try {
2189
2189
  throw Error();
2190
2190
  } catch (G) {
2191
- var _ = G.stack.trim().match(/\n( *(at )?)/);
2192
- Z = _ && _[1] || "";
2191
+ var j = G.stack.trim().match(/\n( *(at )?)/);
2192
+ Z = j && j[1] || "";
2193
2193
  }
2194
2194
  return `
2195
2195
  ` + Z + k;
@@ -2208,7 +2208,7 @@ function Eg() {
2208
2208
  if (re !== void 0)
2209
2209
  return re;
2210
2210
  }
2211
- var _;
2211
+ var j;
2212
2212
  B = !0;
2213
2213
  var G = Error.prepareStackTrace;
2214
2214
  Error.prepareStackTrace = void 0;
@@ -2227,14 +2227,14 @@ function Eg() {
2227
2227
  try {
2228
2228
  Reflect.construct(oe, []);
2229
2229
  } catch (Le) {
2230
- _ = Le;
2230
+ j = Le;
2231
2231
  }
2232
2232
  Reflect.construct(k, [], oe);
2233
2233
  } else {
2234
2234
  try {
2235
2235
  oe.call();
2236
2236
  } catch (Le) {
2237
- _ = Le;
2237
+ j = Le;
2238
2238
  }
2239
2239
  k.call(oe.prototype);
2240
2240
  }
@@ -2242,14 +2242,14 @@ function Eg() {
2242
2242
  try {
2243
2243
  throw Error();
2244
2244
  } catch (Le) {
2245
- _ = Le;
2245
+ j = Le;
2246
2246
  }
2247
2247
  k();
2248
2248
  }
2249
2249
  } catch (Le) {
2250
- if (Le && _ && typeof Le.stack == "string") {
2250
+ if (Le && j && typeof Le.stack == "string") {
2251
2251
  for (var ye = Le.stack.split(`
2252
- `), ze = _.stack.split(`
2252
+ `), ze = j.stack.split(`
2253
2253
  `), Me = ye.length - 1, be = ze.length - 1; Me >= 1 && be >= 0 && ye[Me] !== ze[be]; )
2254
2254
  be--;
2255
2255
  for (; Me >= 1 && be >= 0; Me--, be--)
@@ -2298,7 +2298,7 @@ function Eg() {
2298
2298
  case f:
2299
2299
  return Ie(k.type, X, re);
2300
2300
  case h: {
2301
- var _ = k, G = _._payload, se = _._init;
2301
+ var j = k, G = j._payload, se = j._init;
2302
2302
  try {
2303
2303
  return Ie(se(G), X, re);
2304
2304
  } catch {
@@ -2315,7 +2315,7 @@ function Eg() {
2315
2315
  } else
2316
2316
  Ge.setExtraStackFrame(null);
2317
2317
  }
2318
- function dt(k, X, re, _, G) {
2318
+ function dt(k, X, re, j, G) {
2319
2319
  {
2320
2320
  var se = Function.call.bind(Ve);
2321
2321
  for (var oe in k)
@@ -2323,14 +2323,14 @@ function Eg() {
2323
2323
  var ye = void 0;
2324
2324
  try {
2325
2325
  if (typeof k[oe] != "function") {
2326
- var ze = Error((_ || "React class") + ": " + re + " type `" + oe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof k[oe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
2326
+ var ze = Error((j || "React class") + ": " + re + " type `" + oe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof k[oe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
2327
2327
  throw ze.name = "Invariant Violation", ze;
2328
2328
  }
2329
- ye = k[oe](X, oe, _, re, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
2329
+ ye = k[oe](X, oe, j, re, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
2330
2330
  } catch (Me) {
2331
2331
  ye = Me;
2332
2332
  }
2333
- ye && !(ye instanceof Error) && (Ke(G), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", _ || "React class", re, oe, typeof ye), Ke(null)), ye instanceof Error && !(ye.message in Ze) && (Ze[ye.message] = !0, Ke(G), b("Failed %s type: %s", re, ye.message), Ke(null));
2333
+ ye && !(ye instanceof Error) && (Ke(G), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", j || "React class", re, oe, typeof ye), Ke(null)), ye instanceof Error && !(ye.message in Ze) && (Ze[ye.message] = !0, Ke(G), b("Failed %s type: %s", re, ye.message), Ke(null));
2334
2334
  }
2335
2335
  }
2336
2336
  }
@@ -2346,17 +2346,17 @@ function Eg() {
2346
2346
  }
2347
2347
  function ht(k) {
2348
2348
  try {
2349
- return je(k), !1;
2349
+ return _e(k), !1;
2350
2350
  } catch {
2351
2351
  return !0;
2352
2352
  }
2353
2353
  }
2354
- function je(k) {
2354
+ function _e(k) {
2355
2355
  return "" + k;
2356
2356
  }
2357
2357
  function rt(k) {
2358
2358
  if (ht(k))
2359
- return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", lt(k)), je(k);
2359
+ return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", lt(k)), _e(k);
2360
2360
  }
2361
2361
  var Ye = w.ReactCurrentOwner, ot = {
2362
2362
  key: !0,
@@ -2405,7 +2405,7 @@ function Eg() {
2405
2405
  });
2406
2406
  }
2407
2407
  }
2408
- var Kt = function(k, X, re, _, G, se, oe) {
2408
+ var Kt = function(k, X, re, j, G, se, oe) {
2409
2409
  var ye = {
2410
2410
  // This tag allows us to uniquely identify this as a React Element
2411
2411
  $$typeof: t,
@@ -2426,7 +2426,7 @@ function Eg() {
2426
2426
  configurable: !1,
2427
2427
  enumerable: !1,
2428
2428
  writable: !1,
2429
- value: _
2429
+ value: j
2430
2430
  }), Object.defineProperty(ye, "_source", {
2431
2431
  configurable: !1,
2432
2432
  enumerable: !1,
@@ -2434,7 +2434,7 @@ function Eg() {
2434
2434
  value: G
2435
2435
  }), Object.freeze && (Object.freeze(ye.props), Object.freeze(ye)), ye;
2436
2436
  };
2437
- function _t(k, X, re, _, G) {
2437
+ function jt(k, X, re, j, G) {
2438
2438
  {
2439
2439
  var se, oe = {}, ye = null, ze = null;
2440
2440
  re !== void 0 && (rt(re), ye = "" + re), pt(X) && (rt(X.key), ye = "" + X.key), Ue(X) && (ze = X.ref, zn(X, G));
@@ -2449,7 +2449,7 @@ function Eg() {
2449
2449
  var be = typeof k == "function" ? k.displayName || k.name || "Unknown" : k;
2450
2450
  ye && Vt(oe, be), ze && Cn(oe, be);
2451
2451
  }
2452
- return Kt(k, ye, ze, G, _, Ye.current, oe);
2452
+ return Kt(k, ye, ze, G, j, Ye.current, oe);
2453
2453
  }
2454
2454
  }
2455
2455
  var mn = w.ReactCurrentOwner, Bn = w.ReactDebugCurrentFrame;
@@ -2502,8 +2502,8 @@ Check the top-level render call using <` + re + ">.");
2502
2502
  if (gn[re])
2503
2503
  return;
2504
2504
  gn[re] = !0;
2505
- var _ = "";
2506
- k && k._owner && k._owner !== mn.current && (_ = " It was passed a child from " + z(k._owner.type) + "."), mt(k), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', re, _), mt(null);
2505
+ var j = "";
2506
+ k && k._owner && k._owner !== mn.current && (j = " It was passed a child from " + z(k._owner.type) + "."), mt(k), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', re, j), mt(null);
2507
2507
  }
2508
2508
  }
2509
2509
  function tn(k, X) {
@@ -2512,8 +2512,8 @@ Check the top-level render call using <` + re + ">.");
2512
2512
  return;
2513
2513
  if (nt(k))
2514
2514
  for (var re = 0; re < k.length; re++) {
2515
- var _ = k[re];
2516
- Qt(_) && en(_, X);
2515
+ var j = k[re];
2516
+ Qt(j) && en(j, X);
2517
2517
  }
2518
2518
  else if (Qt(k))
2519
2519
  k._store && (k._store.validated = !0);
@@ -2540,8 +2540,8 @@ Check the top-level render call using <` + re + ">.");
2540
2540
  else
2541
2541
  return;
2542
2542
  if (re) {
2543
- var _ = z(X);
2544
- dt(re, k.props, "prop", _, k);
2543
+ var j = z(X);
2544
+ dt(re, k.props, "prop", j, k);
2545
2545
  } else if (X.PropTypes !== void 0 && !Tn) {
2546
2546
  Tn = !0;
2547
2547
  var G = z(X);
@@ -2553,9 +2553,9 @@ Check the top-level render call using <` + re + ">.");
2553
2553
  function hr(k) {
2554
2554
  {
2555
2555
  for (var X = Object.keys(k.props), re = 0; re < X.length; re++) {
2556
- var _ = X[re];
2557
- if (_ !== "children" && _ !== "key") {
2558
- mt(k), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", _), mt(null);
2556
+ var j = X[re];
2557
+ if (j !== "children" && j !== "key") {
2558
+ mt(k), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", j), mt(null);
2559
2559
  break;
2560
2560
  }
2561
2561
  }
@@ -2563,7 +2563,7 @@ Check the top-level render call using <` + re + ">.");
2563
2563
  }
2564
2564
  }
2565
2565
  var Hn = {};
2566
- function kn(k, X, re, _, G, se) {
2566
+ function kn(k, X, re, j, G, se) {
2567
2567
  {
2568
2568
  var oe = E(k);
2569
2569
  if (!oe) {
@@ -2574,13 +2574,13 @@ Check the top-level render call using <` + re + ">.");
2574
2574
  var Me;
2575
2575
  k === null ? Me = "null" : nt(k) ? Me = "array" : k !== void 0 && k.$$typeof === t ? (Me = "<" + (z(k.type) || "Unknown") + " />", ye = " Did you accidentally export a JSX literal instead of a component?") : Me = typeof k, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Me, ye);
2576
2576
  }
2577
- var be = _t(k, X, re, G, se);
2577
+ var be = jt(k, X, re, G, se);
2578
2578
  if (be == null)
2579
2579
  return be;
2580
2580
  if (oe) {
2581
2581
  var me = X.children;
2582
2582
  if (me !== void 0)
2583
- if (_)
2583
+ if (j)
2584
2584
  if (nt(me)) {
2585
2585
  for (var De = 0; De < me.length; De++)
2586
2586
  tn(me[De], k);
@@ -2653,7 +2653,7 @@ class Ag {
2653
2653
  }
2654
2654
  }
2655
2655
  const Ng = new Ag(), du = ir(null);
2656
- function jg({ children: e, apiConfig: t }) {
2656
+ function _g({ children: e, apiConfig: t }) {
2657
2657
  const n = tr, r = Ng;
2658
2658
  if (t) {
2659
2659
  const s = n.baseUrl, i = r.baseUrl, a = n.getAuthToken();
@@ -2671,7 +2671,7 @@ function jg({ children: e, apiConfig: t }) {
2671
2671
  };
2672
2672
  return /* @__PURE__ */ d.jsx(du.Provider, { value: o, children: e });
2673
2673
  }
2674
- async function _g(e) {
2674
+ async function jg(e) {
2675
2675
  return await new Promise((t, n) => {
2676
2676
  const r = new FileReader();
2677
2677
  r.onload = () => {
@@ -2691,7 +2691,7 @@ async function Pg(e = []) {
2691
2691
  const t = [], n = [];
2692
2692
  for (const r of e)
2693
2693
  try {
2694
- const o = await _g(r), s = r.type || "application/octet-stream";
2694
+ const o = await jg(r), s = r.type || "application/octet-stream";
2695
2695
  n.push({
2696
2696
  filename: r.name,
2697
2697
  data: o,
@@ -2980,7 +2980,7 @@ function qg(e) {
2980
2980
  return !!e && typeof e == "object" && "data" in e;
2981
2981
  }
2982
2982
  function Gg(e = {}) {
2983
- const t = e.baseUrl || "", n = e.streamPath ?? "/stream", [r, o] = ue(e.token ?? null), s = Te(e.headers ?? {}), i = e.credentials ?? "include", [a, c] = ue(!1), [l, u] = ue(null), [f, h] = ue(""), [p, m] = ue(null), [y, g] = ue(0), [w, b] = ue(!1), [T, I] = ue({}), [v, S] = ue(null), [C, R] = ue({}), j = Te(null), E = Te(!0), D = Te(0), $ = Te(null), z = Te(null), M = Te(null), V = Te(null), q = Te({
2983
+ const t = e.baseUrl || "", n = e.streamPath ?? "/stream", [r, o] = ue(e.token ?? null), s = Te(e.headers ?? {}), i = e.credentials ?? "include", [a, c] = ue(!1), [l, u] = ue(null), [f, h] = ue(""), [p, m] = ue(null), [y, g] = ue(0), [w, b] = ue(!1), [T, I] = ue({}), [v, S] = ue(null), [C, R] = ue({}), _ = Te(null), E = Te(!0), D = Te(0), $ = Te(null), z = Te(null), M = Te(null), V = Te(null), q = Te({
2984
2984
  messageId: null,
2985
2985
  lastSeq: null,
2986
2986
  lastText: ""
@@ -2997,27 +2997,27 @@ function Gg(e = {}) {
2997
2997
  console.debug("[use-chat] stop() invoked - aborting stream");
2998
2998
  const W = (L = $.current) == null ? void 0 : L.threadId, P = () => {
2999
2999
  var O;
3000
- (O = j.current) == null || O.abort(), j.current = null, $.current = null, c(!1), b(!1), D.current = 0, g(0);
3000
+ (O = _.current) == null || O.abort(), _.current = null, $.current = null, c(!1), b(!1), D.current = 0, g(0);
3001
3001
  };
3002
3002
  (W ? tr.cancelRun(W).catch((O) => {
3003
3003
  console.warn("[use-chat] cancel run failed:", O);
3004
3004
  }) : Promise.resolve()).finally(P);
3005
3005
  }, []), ee = ie(
3006
3006
  (W, P, A) => {
3007
- j.current && (j.current.abort(), j.current = null), c(!0), u(null), e.autoAppendAssistant !== !1 && h(""), m(null), z.current = null, M.current = null, V.current = null, I({}), S(null), R({}), q.current = {
3007
+ _.current && (_.current.abort(), _.current = null), c(!0), u(null), e.autoAppendAssistant !== !1 && h(""), m(null), z.current = null, M.current = null, V.current = null, I({}), S(null), R({}), q.current = {
3008
3008
  messageId: null,
3009
3009
  lastSeq: null,
3010
3010
  lastText: ""
3011
3011
  };
3012
3012
  const L = new AbortController();
3013
- j.current = L;
3013
+ _.current = L;
3014
3014
  let O = null, K = null, Z = !1;
3015
3015
  return $.current = {
3016
3016
  threadId: W.threadId ?? null,
3017
3017
  headers: {},
3018
3018
  isStreaming: !0
3019
3019
  }, (async () => {
3020
- var N, B, Y, ae, pe, ge, Ee, Ie, Ve, Ze, Ge, Ke, dt, ft, nt, lt, ht, je, rt;
3020
+ var N, B, Y, ae, pe, ge, Ee, Ie, Ve, Ze, Ge, Ke, dt, ft, nt, lt, ht, _e, rt;
3021
3021
  try {
3022
3022
  let Ye = {};
3023
3023
  try {
@@ -3073,15 +3073,15 @@ function Gg(e = {}) {
3073
3073
  const pt = Ue.body.getReader(), zn = new TextDecoder();
3074
3074
  let Vt = "", Cn = [];
3075
3075
  D.current = 0, g(0);
3076
- let Kt = 0, _t = null;
3076
+ let Kt = 0, jt = null;
3077
3077
  const mn = () => {
3078
3078
  if (Cn.length) {
3079
3079
  const Fe = Cn.join("");
3080
3080
  Cn = [], E.current && h((st) => st + Fe);
3081
3081
  }
3082
- _t = null;
3082
+ jt = null;
3083
3083
  }, Bn = () => {
3084
- typeof window < "u" && _t == null && (_t = requestAnimationFrame(mn));
3084
+ typeof window < "u" && jt == null && (jt = requestAnimationFrame(mn));
3085
3085
  };
3086
3086
  let mt = Date.now();
3087
3087
  const Tn = setInterval(() => {
@@ -3108,19 +3108,19 @@ function Gg(e = {}) {
3108
3108
  Vt = Vt.slice(Un + 2);
3109
3109
  const Hn = hr.split(/\r?\n/), kn = [];
3110
3110
  let In = null;
3111
- for (const _ of Hn) {
3112
- if (_.startsWith(":")) {
3113
- _.startsWith(": heartbeat") && console.debug("[use-chat] SSE heartbeat comment received");
3111
+ for (const j of Hn) {
3112
+ if (j.startsWith(":")) {
3113
+ j.startsWith(": heartbeat") && console.debug("[use-chat] SSE heartbeat comment received");
3114
3114
  continue;
3115
3115
  }
3116
- if (_) {
3117
- if (_.startsWith("event:")) {
3118
- const G = _.slice(6).trim();
3116
+ if (j) {
3117
+ if (j.startsWith("event:")) {
3118
+ const G = j.slice(6).trim();
3119
3119
  G && (In = G);
3120
3120
  continue;
3121
3121
  }
3122
- if (_.startsWith("data:")) {
3123
- const G = _.slice(5);
3122
+ if (j.startsWith("data:")) {
3123
+ const G = j.slice(5);
3124
3124
  kn.push(G.startsWith(" ") ? G.slice(1) : G);
3125
3125
  }
3126
3126
  }
@@ -3158,19 +3158,19 @@ function Gg(e = {}) {
3158
3158
  try {
3159
3159
  const G = wr(k).latest;
3160
3160
  G && (z.current = G.checkpointId ?? null, M.current = G.checkpointNs ?? null, m(G.checkpointId ?? null), R(G.values ?? {}));
3161
- } catch (_) {
3162
- console.warn("[use-chat] Failed to hydrate state_history payload", _);
3161
+ } catch (j) {
3162
+ console.warn("[use-chat] Failed to hydrate state_history payload", j);
3163
3163
  }
3164
3164
  }
3165
3165
  try {
3166
3166
  P == null || P(k);
3167
- } catch (_) {
3168
- console.error("[use-chat] Error in onEvent callback:", _, "for event:", k.type);
3167
+ } catch (j) {
3168
+ console.error("[use-chat] Error in onEvent callback:", j, "for event:", k.type);
3169
3169
  }
3170
3170
  try {
3171
3171
  k.type === "tool.start" && (A != null && A.onToolStart) ? A.onToolStart(k) : k.type === "tool.end" && (A != null && A.onToolEnd) ? A.onToolEnd(k) : k.type === "token" && (A != null && A.onToken) ? A.onToken(k.token) : k.type === "thread_info" && (A != null && A.onThreadInfo) && A.onThreadInfo(k), X === "updates" && (A != null && A.onUpdateEvent) ? A.onUpdateEvent(k) : X === "custom" && (A != null && A.onCustomEvent) ? A.onCustomEvent(k) : X === "metadata" && (A != null && A.onMetadataEvent) && A.onMetadataEvent(k);
3172
- } catch (_) {
3173
- console.warn("[use-chat] Typed callback error:", _);
3172
+ } catch (j) {
3173
+ console.warn("[use-chat] Typed callback error:", j);
3174
3174
  }
3175
3175
  if (k.type === "messages/partial") {
3176
3176
  const G = k.messages;
@@ -3213,16 +3213,16 @@ function Gg(e = {}) {
3213
3213
  }
3214
3214
  }
3215
3215
  } else if (k.type === "updates") {
3216
- const _ = k;
3217
- if (_.tools) {
3218
- const G = _.tools;
3216
+ const j = k;
3217
+ if (j.tools) {
3218
+ const G = j.tools;
3219
3219
  if (G.status === "start") {
3220
3220
  const se = {
3221
3221
  type: "tool.start",
3222
3222
  id: G.id,
3223
3223
  name: G.name,
3224
3224
  args: G.args,
3225
- seq: _.seq,
3225
+ seq: j.seq,
3226
3226
  callId: G.id
3227
3227
  };
3228
3228
  try {
@@ -3237,7 +3237,7 @@ function Gg(e = {}) {
3237
3237
  name: G.name,
3238
3238
  content: G.output,
3239
3239
  artifact: G.artifact,
3240
- seq: _.seq,
3240
+ seq: j.seq,
3241
3241
  callId: G.id
3242
3242
  };
3243
3243
  try {
@@ -3252,17 +3252,17 @@ function Gg(e = {}) {
3252
3252
  console.debug("[use-chat] heartbeat received");
3253
3253
  try {
3254
3254
  (Ie = A == null ? void 0 : A.onHeartbeat) == null || Ie.call(A, k);
3255
- } catch (_) {
3256
- console.warn("[use-chat] heartbeat callback failed", _);
3255
+ } catch (j) {
3256
+ console.warn("[use-chat] heartbeat callback failed", j);
3257
3257
  }
3258
- } else if (_t !== null && cancelAnimationFrame(_t), mn(), k.type === "checkpoint")
3258
+ } else if (jt !== null && cancelAnimationFrame(jt), mn(), k.type === "checkpoint")
3259
3259
  m(k.checkpointId ?? null);
3260
3260
  else if (k.type === "error") {
3261
- const _ = k;
3262
- if (u(_.message), O = "error", K = _.message, _.error_type === "auth_error" || _.code === "TOKEN_EXPIRED" || ((Ve = _.message) == null ? void 0 : Ve.includes("token")) || ((Ze = _.message) == null ? void 0 : Ze.includes("401")) || ((Ge = _.message) == null ? void 0 : Ge.includes("unauthorized")) || ((Ke = _.message) == null ? void 0 : Ke.includes("Unauthorized"))) {
3263
- console.error("[use-chat] Auth error detected:", _.message);
3261
+ const j = k;
3262
+ if (u(j.message), O = "error", K = j.message, j.error_type === "auth_error" || j.code === "TOKEN_EXPIRED" || ((Ve = j.message) == null ? void 0 : Ve.includes("token")) || ((Ze = j.message) == null ? void 0 : Ze.includes("401")) || ((Ge = j.message) == null ? void 0 : Ge.includes("unauthorized")) || ((Ke = j.message) == null ? void 0 : Ke.includes("Unauthorized"))) {
3263
+ console.error("[use-chat] Auth error detected:", j.message);
3264
3264
  try {
3265
- (dt = A == null ? void 0 : A.onAuthError) == null || dt.call(A, _.message);
3265
+ (dt = A == null ? void 0 : A.onAuthError) == null || dt.call(A, j.message);
3266
3266
  } catch (se) {
3267
3267
  console.warn("[use-chat] onAuthError handler failed", se);
3268
3268
  }
@@ -3286,7 +3286,7 @@ function Gg(e = {}) {
3286
3286
  } finally {
3287
3287
  (nt = pt.releaseLock) == null || nt.call(pt);
3288
3288
  }
3289
- _t !== null && typeof window < "u" && window.cancelAnimationFrame(_t), clearInterval(Tn);
3289
+ jt !== null && typeof window < "u" && window.cancelAnimationFrame(jt), clearInterval(Tn);
3290
3290
  }
3291
3291
  } catch (Ye) {
3292
3292
  if (Ye.name === "AbortError")
@@ -3298,7 +3298,7 @@ function Gg(e = {}) {
3298
3298
  } finally {
3299
3299
  const Ye = D.current, ot = z.current, xt = M.current, Ct = V.current, Ue = O ?? (L.signal.aborted ? "aborted" : K ? "error" : "complete");
3300
3300
  try {
3301
- (je = A == null ? void 0 : A.onClosed) == null || je.call(A, {
3301
+ (_e = A == null ? void 0 : A.onClosed) == null || _e.call(A, {
3302
3302
  reason: Ue,
3303
3303
  lastSeq: Ye,
3304
3304
  lastCheckpointId: ot,
@@ -3314,7 +3314,7 @@ function Gg(e = {}) {
3314
3314
  } catch (pt) {
3315
3315
  console.warn("[use-chat] onClosed callback failed", pt);
3316
3316
  }
3317
- c(!1), b(!1), j.current = null, D.current = 0, g(0), $.current = null;
3317
+ c(!1), b(!1), _.current = null, D.current = 0, g(0), $.current = null;
3318
3318
  }
3319
3319
  })(), { close: () => L.abort() };
3320
3320
  },
@@ -3322,7 +3322,7 @@ function Gg(e = {}) {
3322
3322
  );
3323
3323
  return qe(() => () => {
3324
3324
  var W;
3325
- E.current = !1, (W = j.current) == null || W.abort();
3325
+ E.current = !1, (W = _.current) == null || W.abort();
3326
3326
  }, []), {
3327
3327
  isStreaming: a,
3328
3328
  error: l,
@@ -3409,7 +3409,7 @@ function Jg({
3409
3409
  } finally {
3410
3410
  u(!1);
3411
3411
  }
3412
- }, [e, n]), j = ie(async () => {
3412
+ }, [e, n]), _ = ie(async () => {
3413
3413
  g(!0), w(null);
3414
3414
  try {
3415
3415
  const H = await e.listSharedThreads();
@@ -3424,8 +3424,8 @@ function Jg({
3424
3424
  qe(() => {
3425
3425
  R();
3426
3426
  }, [R]), qe(() => {
3427
- j();
3428
- }, [j]), qe(() => {
3427
+ _();
3428
+ }, [_]), qe(() => {
3429
3429
  r == null || r(a);
3430
3430
  }, [a, r]);
3431
3431
  const E = ie(
@@ -3469,7 +3469,7 @@ function Jg({
3469
3469
  async (H, U) => {
3470
3470
  v(!0), T("Sharing thread…");
3471
3471
  try {
3472
- await e.shareThread(H, U), await j(), T("Shared successfully");
3472
+ await e.shareThread(H, U), await _(), T("Shared successfully");
3473
3473
  } catch (ee) {
3474
3474
  const W = Xg(ee);
3475
3475
  throw n == null || n(W), T(`Failed to share: ${W}`), new Error(W);
@@ -3477,28 +3477,28 @@ function Jg({
3477
3477
  v(!1);
3478
3478
  }
3479
3479
  },
3480
- [e, n, j]
3480
+ [e, n, _]
3481
3481
  ), M = ie(
3482
3482
  async (H, U) => {
3483
3483
  try {
3484
- await e.unshareThread(H, U), await j();
3484
+ await e.unshareThread(H, U), await _();
3485
3485
  } catch (ee) {
3486
3486
  const W = String(ee);
3487
3487
  throw n == null || n(W), ee;
3488
3488
  }
3489
3489
  },
3490
- [e, n, j]
3490
+ [e, n, _]
3491
3491
  ), V = Be(
3492
3492
  () => ({
3493
3493
  createThread: E,
3494
3494
  deleteThread: D,
3495
3495
  renameThread: $,
3496
3496
  refreshThreads: R,
3497
- refreshSharedThreads: j,
3497
+ refreshSharedThreads: _,
3498
3498
  shareThread: z,
3499
3499
  unshareThread: M
3500
3500
  }),
3501
- [E, D, $, R, j, z, M]
3501
+ [E, D, $, R, _, z, M]
3502
3502
  ), q = ie((H) => {
3503
3503
  if (!(H != null && H.threadId)) return;
3504
3504
  const U = {
@@ -3625,7 +3625,7 @@ function sx(e) {
3625
3625
  return e.content.filter(tx);
3626
3626
  }
3627
3627
  function mu(e) {
3628
- return Array.isArray(e.toolCalls) ? e.toolCalls : [];
3628
+ return Array.isArray(e.toolCalls) && e.toolCalls.length > 0 ? e.toolCalls : e.content.filter((t) => (t == null ? void 0 : t.type) === "tool_call") || [];
3629
3629
  }
3630
3630
  function ix(e) {
3631
3631
  return e.content.filter(nx);
@@ -3904,7 +3904,7 @@ function Lo(e) {
3904
3904
  return !!(a || c || l || u || f);
3905
3905
  });
3906
3906
  }
3907
- function jr(e, t, n) {
3907
+ function _r(e, t, n) {
3908
3908
  return t < 0 || t >= e.length ? e : [...e.slice(0, t), n, ...e.slice(t + 1)];
3909
3909
  }
3910
3910
  function xx(e) {
@@ -3919,7 +3919,7 @@ function yx(e, t, n) {
3919
3919
  for (let r = e.length - 1; r >= 0; r--)
3920
3920
  if (e[r].role === "assistant") {
3921
3921
  const s = { ...e[r], checkpointId: t, checkpointNs: n ?? void 0 };
3922
- return jr(e, r, s);
3922
+ return _r(e, r, s);
3923
3923
  }
3924
3924
  return e;
3925
3925
  }
@@ -4125,7 +4125,7 @@ function Gi(e, t, n) {
4125
4125
  const o = e[r], s = (o.toolCalls ?? []).map(
4126
4126
  (i) => i.id === t ? { ...i, ...n } : i
4127
4127
  );
4128
- return jr(e, r, { ...o, toolCalls: s });
4128
+ return _r(e, r, { ...o, toolCalls: s });
4129
4129
  }
4130
4130
  function Tx(e) {
4131
4131
  if (e == null)
@@ -4169,7 +4169,7 @@ function kx(e, t) {
4169
4169
  name: r ?? u.name,
4170
4170
  additionalKwargs: h
4171
4171
  };
4172
- return { ...e, messages: jr(i, a, p) };
4172
+ return { ...e, messages: _r(i, a, p) };
4173
4173
  }
4174
4174
  const c = bu(o, n, r, t.args), l = Yi(c, s);
4175
4175
  return { ...e, messages: [...i, l] };
@@ -4192,7 +4192,7 @@ function Ix(e, t) {
4192
4192
  if (a === -1)
4193
4193
  return { ...e, messages: i };
4194
4194
  const c = Yi(i[a], s);
4195
- return { ...e, messages: jr(i, a, c) };
4195
+ return { ...e, messages: _r(i, a, c) };
4196
4196
  }
4197
4197
  function Rx(e, t) {
4198
4198
  const n = Ki(t), r = wu(t);
@@ -4225,7 +4225,7 @@ function Rx(e, t) {
4225
4225
  toolStreaming: !1
4226
4226
  }
4227
4227
  };
4228
- return { ...e, messages: jr(o, l, g) };
4228
+ return { ...e, messages: _r(o, l, g) };
4229
4229
  }
4230
4230
  function Ex(e, t) {
4231
4231
  const n = t.artifactId ?? t.artifact_id, r = dx(e.messages, n);
@@ -4263,7 +4263,7 @@ function Ex(e, t) {
4263
4263
  ...t.partial_data
4264
4264
  }), {
4265
4265
  ...e,
4266
- messages: jr(e.messages, o, s)
4266
+ messages: _r(e.messages, o, s)
4267
4267
  };
4268
4268
  }
4269
4269
  const Cl = 120;
@@ -4279,7 +4279,7 @@ function Ax(e) {
4279
4279
  function Nx(e) {
4280
4280
  return Ax(e.content) || "";
4281
4281
  }
4282
- function jx(e) {
4282
+ function _x(e) {
4283
4283
  const t = /* @__PURE__ */ new Map(), n = [], r = /* @__PURE__ */ new Map(), o = [];
4284
4284
  for (let l = 0; l < e.length; l++) {
4285
4285
  const u = e[l], f = u.checkpointId, h = f ?? `cp-${l}`, p = u.metadata ?? {}, m = typeof p.step == "number" ? p.step : null, y = typeof p.source == "string" ? p.source : null;
@@ -4352,7 +4352,7 @@ function jx(e) {
4352
4352
  }
4353
4353
  };
4354
4354
  }
4355
- function _x(e, t, n) {
4355
+ function jx(e, t, n) {
4356
4356
  if (!e)
4357
4357
  return { attemptCount: 1, attemptIndex: 0, attempts: [] };
4358
4358
  const r = n.getMessageAttempts(e);
@@ -4370,7 +4370,7 @@ function _x(e, t, n) {
4370
4370
  };
4371
4371
  }
4372
4372
  function Px(e) {
4373
- return Be(() => jx(e), [e]);
4373
+ return Be(() => _x(e), [e]);
4374
4374
  }
4375
4375
  function Ox({
4376
4376
  api: e,
@@ -4387,7 +4387,7 @@ function Ox({
4387
4387
  const [u, f] = ue(null), p = Be(
4388
4388
  () => wr(u),
4389
4389
  [u]
4390
- ).checkpoints, m = Px(p), y = m.timeline, [g, w] = ue(!1), [b, T] = ue(!1), [I, v] = ue(null), S = Te(r), C = Te(null), R = Te(null), j = Te(null), E = Te(null), D = Te(null), $ = Te(/* @__PURE__ */ new Map()), z = Te(null);
4390
+ ).checkpoints, m = Px(p), y = m.timeline, [g, w] = ue(!1), [b, T] = ue(!1), [I, v] = ue(null), S = Te(r), C = Te(null), R = Te(null), _ = Te(null), E = Te(null), D = Te(null), $ = Te(/* @__PURE__ */ new Map()), z = Te(null);
4391
4391
  qe(() => {
4392
4392
  S.current = r;
4393
4393
  }, [r]);
@@ -4470,7 +4470,7 @@ function Ox({
4470
4470
  ), ne = ie((L) => {
4471
4471
  R.current = L;
4472
4472
  }, []), H = ie((L) => {
4473
- j.current = L;
4473
+ _.current = L;
4474
4474
  }, []), U = ie(
4475
4475
  (L) => {
4476
4476
  const O = L.threadId ?? S.current;
@@ -4479,12 +4479,12 @@ function Ox({
4479
4479
  const { checkpoints: K, latest: Z } = wr(L);
4480
4480
  if (!K.length)
4481
4481
  return;
4482
- const N = Z, B = j.current === O;
4482
+ const N = Z, B = _.current === O;
4483
4483
  !c && !B && t((N == null ? void 0 : N.messages) ?? [], {
4484
4484
  checkpointId: (N == null ? void 0 : N.checkpointId) ?? null,
4485
4485
  checkpointNs: (N == null ? void 0 : N.checkpointNs) ?? null,
4486
4486
  pendingInterrupt: (N == null ? void 0 : N.interrupt) ?? null
4487
- }), f(L), D.current = `${O}:latest`, R.current = null, j.current === O && (j.current = null);
4487
+ }), f(L), D.current = `${O}:latest`, R.current = null, _.current === O && (_.current = null);
4488
4488
  },
4489
4489
  [t, c]
4490
4490
  ), ee = ie(
@@ -4535,7 +4535,7 @@ function Ox({
4535
4535
  R.current = null, C.current = r;
4536
4536
  return;
4537
4537
  }
4538
- if (j.current === r) {
4538
+ if (_.current === r) {
4539
4539
  C.current = r;
4540
4540
  return;
4541
4541
  }
@@ -4560,7 +4560,7 @@ function Ox({
4560
4560
  q
4561
4561
  ]);
4562
4562
  const A = ie(() => {
4563
- f(null), w(!1), T(!1), v(null), R.current = null, j.current = null, C.current = null, D.current = null, E.current = null;
4563
+ f(null), w(!1), T(!1), v(null), R.current = null, _.current = null, C.current = null, D.current = null, E.current = null;
4564
4564
  }, []);
4565
4565
  return {
4566
4566
  threadCheckpoints: p,
@@ -4614,7 +4614,7 @@ function Dx({
4614
4614
  returnToLatest: S,
4615
4615
  handleStateHistoryEvent: C,
4616
4616
  markSkipNextLoad: R,
4617
- markStreamPendingThread: j,
4617
+ markStreamPendingThread: _,
4618
4618
  resetHistoryState: E
4619
4619
  } = Ox({
4620
4620
  api: a,
@@ -4696,7 +4696,7 @@ function Dx({
4696
4696
  messagePreviews: y.messagePreviews,
4697
4697
  handleStateHistoryEvent: C,
4698
4698
  markSkipNextLoad: R,
4699
- markStreamPendingThread: j,
4699
+ markStreamPendingThread: _,
4700
4700
  resetHistoryState: E,
4701
4701
  pushUser: q,
4702
4702
  onEvent: f,
@@ -4724,7 +4724,7 @@ function Dx({
4724
4724
  T,
4725
4725
  C,
4726
4726
  R,
4727
- j,
4727
+ _,
4728
4728
  q,
4729
4729
  f,
4730
4730
  H
@@ -4795,7 +4795,7 @@ function Bx({
4795
4795
  onMetadataEvent: h,
4796
4796
  onFinish: p
4797
4797
  }) {
4798
- const { chatApi: m, baseUrl: y } = uo(), g = y, { stream: w, stop: b, clear: T, isStreaming: I, error: v, connected: S, streamedMessages: C, activeMessageId: R } = Gg({ baseUrl: g }), [j, E] = ue(!1);
4798
+ const { chatApi: m, baseUrl: y } = uo(), g = y, { stream: w, stop: b, clear: T, isStreaming: I, error: v, connected: S, streamedMessages: C, activeMessageId: R } = Gg({ baseUrl: g }), [_, E] = ue(!1);
4799
4799
  return qe(() => {
4800
4800
  E(I);
4801
4801
  }, [I]), /* @__PURE__ */ d.jsx(
@@ -4812,7 +4812,7 @@ function Bx({
4812
4812
  initialCheckpointNs: r,
4813
4813
  autoLoadInitial: o,
4814
4814
  onError: s,
4815
- isStreaming: j,
4815
+ isStreaming: _,
4816
4816
  children: /* @__PURE__ */ d.jsx(ku.Provider, { value: !0, children: /* @__PURE__ */ d.jsx(
4817
4817
  Ux,
4818
4818
  {
@@ -4854,7 +4854,7 @@ function Ux({
4854
4854
  const {
4855
4855
  interrupt: C,
4856
4856
  checkpoint: R,
4857
- timelineCheckpoints: j,
4857
+ timelineCheckpoints: _,
4858
4858
  handleStateHistoryEvent: E,
4859
4859
  markSkipNextLoad: D,
4860
4860
  markStreamPendingThread: $,
@@ -4939,24 +4939,24 @@ function Ux({
4939
4939
  const { contentParts: Ke, filesInfo: dt } = Ge ? { contentParts: Ge, filesInfo: [] } : await Pg(pe), ft = [...Ke];
4940
4940
  ge && ft.push({ type: "text", text: ae });
4941
4941
  const nt = B == null ? void 0 : B.originalMessageId, lt = !!(B != null && B.edit && nt), ht = !Ve && ft.length > 0;
4942
- let je = null;
4942
+ let _e = null;
4943
4943
  if (ht) {
4944
4944
  const Ue = lt ? nt : `msg-${Date.now()}`;
4945
- je = fu({
4945
+ _e = fu({
4946
4946
  id: Ue,
4947
4947
  role: "user",
4948
4948
  content: ft,
4949
4949
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
4950
- }, "user"), lt ? M(je, { editingMessageId: nt }) : M(je);
4950
+ }, "user"), lt ? M(_e, { editingMessageId: nt }) : M(_e);
4951
4951
  }
4952
- const rt = Ve ? Ie : je ? [je] : [], Ye = {
4952
+ const rt = Ve ? Ie : _e ? [_e] : [], Ye = {
4953
4953
  ...Ee,
4954
4954
  ...dt.length ? { files_info: dt } : {}
4955
4955
  };
4956
4956
  rt.length ? Ye.messages = rt : "messages" in Ye || (Ye.messages = []);
4957
4957
  let ot = (B == null ? void 0 : B.checkpointId) ?? R.id ?? void 0, xt = (B == null ? void 0 : B.checkpointNs) ?? R.namespace ?? void 0;
4958
4958
  if (lt && nt) {
4959
- const Ue = zx(j, nt);
4959
+ const Ue = zx(_, nt);
4960
4960
  ot = Ue.checkpointId, xt = Ue.checkpointNs ?? void 0;
4961
4961
  }
4962
4962
  const Ct = {
@@ -4969,7 +4969,7 @@ function Ux({
4969
4969
  };
4970
4970
  W(Ct, B == null ? void 0 : B.onEvent);
4971
4971
  },
4972
- [R, I, m, D, M, W, h, j]
4972
+ [R, I, m, D, M, W, h, _]
4973
4973
  ), K = Be(() => {
4974
4974
  if (!m || !b)
4975
4975
  return q;
@@ -5054,7 +5054,7 @@ function $o({
5054
5054
  onMetadataEvent: p,
5055
5055
  onFinish: m
5056
5056
  }) {
5057
- const y = Wx(t), g = wn(a), w = wn(c), b = wn(i), T = wn(l), I = wn(u), v = wn(f), S = wn(h), C = wn(p), R = wn(m), j = Be(
5057
+ const y = Wx(t), g = wn(a), w = wn(c), b = wn(i), T = wn(l), I = wn(u), v = wn(f), S = wn(h), C = wn(p), R = wn(m), _ = Be(
5058
5058
  () => ({
5059
5059
  initialThreadId: n,
5060
5060
  initialCheckpointId: r,
@@ -5077,7 +5077,7 @@ function $o({
5077
5077
  s
5078
5078
  ]
5079
5079
  );
5080
- return /* @__PURE__ */ d.jsx(jg, { apiConfig: y, children: /* @__PURE__ */ d.jsx(Bx, { ...j, children: e }) });
5080
+ return /* @__PURE__ */ d.jsx(_g, { apiConfig: y, children: /* @__PURE__ */ d.jsx(Bx, { ..._, children: e }) });
5081
5081
  }
5082
5082
  function wn(e) {
5083
5083
  const t = Te(e);
@@ -5182,7 +5182,7 @@ function ak(e) {
5182
5182
  }), Yx(e);
5183
5183
  }
5184
5184
  function de(...e) {
5185
- return _c(jc(e));
5185
+ return jc(_c(e));
5186
5186
  }
5187
5187
  const Xx = Pc(
5188
5188
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
@@ -5222,14 +5222,14 @@ const Xx = Pc(
5222
5222
  }
5223
5223
  );
5224
5224
  tt.displayName = "Button";
5225
- const Ss = 0, Dn = 1, _r = 2, ju = 4;
5225
+ const Ss = 0, Dn = 1, jr = 2, _u = 4;
5226
5226
  function Il(e) {
5227
5227
  return () => e;
5228
5228
  }
5229
5229
  function Jx(e) {
5230
5230
  e();
5231
5231
  }
5232
- function _u(e, t) {
5232
+ function ju(e, t) {
5233
5233
  return (n) => e(t(n));
5234
5234
  }
5235
5235
  function Rl(e, t) {
@@ -5264,10 +5264,10 @@ function Re(e, t) {
5264
5264
  e(Ss, t);
5265
5265
  }
5266
5266
  function Zi(e) {
5267
- e(_r);
5267
+ e(jr);
5268
5268
  }
5269
5269
  function it(e) {
5270
- return e(ju);
5270
+ return e(_u);
5271
5271
  }
5272
5272
  function fe(e, t) {
5273
5273
  return $e(e, Zx(t, Ss));
@@ -5301,7 +5301,7 @@ function ve(e) {
5301
5301
  };
5302
5302
  }
5303
5303
  function le(e) {
5304
- return (t) => _u(t, e);
5304
+ return (t) => ju(t, e);
5305
5305
  }
5306
5306
  function on(e) {
5307
5307
  return (t) => () => {
@@ -5312,7 +5312,7 @@ function J(e, ...t) {
5312
5312
  const n = ty(...t);
5313
5313
  return (r, o) => {
5314
5314
  switch (r) {
5315
- case _r:
5315
+ case jr:
5316
5316
  Zi(e);
5317
5317
  return;
5318
5318
  case Dn:
@@ -5365,7 +5365,7 @@ function ny(e) {
5365
5365
  switch (o) {
5366
5366
  case Dn:
5367
5367
  return s ? n === s ? void 0 : (r(), n = s, t = $e(e, s), t) : (r(), Pr);
5368
- case _r:
5368
+ case jr:
5369
5369
  r(), n = null;
5370
5370
  return;
5371
5371
  }
@@ -5373,7 +5373,7 @@ function ny(e) {
5373
5373
  }
5374
5374
  function te(e) {
5375
5375
  let t = e;
5376
- const n = _e();
5376
+ const n = je();
5377
5377
  return (r, o) => {
5378
5378
  switch (r) {
5379
5379
  case Ss:
@@ -5383,7 +5383,7 @@ function te(e) {
5383
5383
  o(t);
5384
5384
  break;
5385
5385
  }
5386
- case ju:
5386
+ case _u:
5387
5387
  return t;
5388
5388
  }
5389
5389
  return n(r, o);
@@ -5392,7 +5392,7 @@ function te(e) {
5392
5392
  function St(e, t) {
5393
5393
  return Cs(te(t), (n) => fe(e, n));
5394
5394
  }
5395
- function _e() {
5395
+ function je() {
5396
5396
  const e = [];
5397
5397
  return (t, n) => {
5398
5398
  switch (t) {
@@ -5401,7 +5401,7 @@ function _e() {
5401
5401
  r(n);
5402
5402
  });
5403
5403
  return;
5404
- case _r:
5404
+ case jr:
5405
5405
  e.splice(0, e.length);
5406
5406
  return;
5407
5407
  case Dn:
@@ -5413,7 +5413,7 @@ function _e() {
5413
5413
  };
5414
5414
  }
5415
5415
  function Lt(e) {
5416
- return Cs(_e(), (t) => fe(e, t));
5416
+ return Cs(je(), (t) => fe(e, t));
5417
5417
  }
5418
5418
  function Oe(e, t = [], { singleton: n } = { singleton: !0 }) {
5419
5419
  return {
@@ -5434,7 +5434,7 @@ function oy(e) {
5434
5434
  return n(e);
5435
5435
  }
5436
5436
  function ct(...e) {
5437
- const t = _e(), n = new Array(e.length);
5437
+ const t = je(), n = new Array(e.length);
5438
5438
  let r = 0;
5439
5439
  const o = Math.pow(2, e.length) - 1;
5440
5440
  return e.forEach((s, i) => {
@@ -5444,7 +5444,7 @@ function ct(...e) {
5444
5444
  });
5445
5445
  }), function(s, i) {
5446
5446
  switch (s) {
5447
- case _r: {
5447
+ case jr: {
5448
5448
  Zi(t);
5449
5449
  return;
5450
5450
  }
@@ -5459,7 +5459,7 @@ function we(e, t = Pu) {
5459
5459
  function Ci(...e) {
5460
5460
  return function(t, n) {
5461
5461
  switch (t) {
5462
- case _r:
5462
+ case jr:
5463
5463
  return;
5464
5464
  case Dn:
5465
5465
  return Qx(...e.map((r) => $e(r, n)));
@@ -5602,7 +5602,7 @@ function Ou(e, t, n) {
5602
5602
  }
5603
5603
  const Tt = Oe(
5604
5604
  () => {
5605
- const e = _e(), t = _e(), n = te(0), r = _e(), o = te(0), s = _e(), i = _e(), a = te(0), c = te(0), l = te(0), u = te(0), f = _e(), h = _e(), p = te(!1), m = te(!1), y = te(!1);
5605
+ const e = je(), t = je(), n = te(0), r = je(), o = te(0), s = je(), i = je(), a = te(0), c = te(0), l = te(0), u = te(0), f = je(), h = je(), p = te(!1), m = te(!1), y = te(!1);
5606
5606
  return fe(
5607
5607
  J(
5608
5608
  e,
@@ -5909,7 +5909,7 @@ function xy(e) {
5909
5909
  return { endIndex: s ? s.k - 1 : 1 / 0, size: n, startIndex: t };
5910
5910
  });
5911
5911
  }
5912
- function jl(e, t) {
5912
+ function _l(e, t) {
5913
5913
  let n = 0, r = 0;
5914
5914
  for (; n < e; )
5915
5915
  n += t[r + 1] - t[r] - 1, r++;
@@ -5950,7 +5950,7 @@ const by = {
5950
5950
  offsetWidth: "width"
5951
5951
  }, fn = Oe(
5952
5952
  ([{ log: e }, { recalcInProgress: t }]) => {
5953
- const n = _e(), r = _e(), o = St(r, 0), s = _e(), i = _e(), a = te(0), c = te([]), l = te(void 0), u = te(void 0), f = te((v, S) => An(v, by[S])), h = te(void 0), p = te(0), m = dy(), y = St(
5953
+ const n = je(), r = je(), o = St(r, 0), s = je(), i = je(), a = te(0), c = te([]), l = te(void 0), u = te(void 0), f = te((v, S) => An(v, by[S])), h = te(void 0), p = te(0), m = dy(), y = St(
5954
5954
  J(n, Ae(c, e, p), an(gy, m), Xe()),
5955
5955
  m
5956
5956
  ), g = St(
@@ -5971,7 +5971,7 @@ const by = {
5971
5971
  ve((v) => v.length > 0),
5972
5972
  Ae(y, p),
5973
5973
  le(([v, S, C]) => {
5974
- const R = v.reduce((j, E, D) => Dt(j, E, Zr(E, S.offsetTree, C) || D), vr());
5974
+ const R = v.reduce((_, E, D) => Dt(_, E, Zr(E, S.offsetTree, C) || D), vr());
5975
5975
  return {
5976
5976
  ...S,
5977
5977
  groupIndices: v,
@@ -6036,10 +6036,10 @@ const by = {
6036
6036
  (v) => {
6037
6037
  const { groupIndices: S } = it(y);
6038
6038
  if (v > 0)
6039
- Re(t, !0), Re(s, v + jl(v, S));
6039
+ Re(t, !0), Re(s, v + _l(v, S));
6040
6040
  else if (v < 0) {
6041
6041
  const C = it(g);
6042
- C.length > 0 && (v -= jl(-v, C)), Re(i, v);
6042
+ C.length > 0 && (v -= _l(-v, C)), Re(i, v);
6043
6043
  }
6044
6044
  }
6045
6045
  ), $e(J(a, Ae(e)), ([v, S]) => {
@@ -6055,7 +6055,7 @@ const by = {
6055
6055
  s,
6056
6056
  Ae(y),
6057
6057
  le(([v, S]) => {
6058
- const C = S.groupIndices.length > 0, R = [], j = S.lastSize;
6058
+ const C = S.groupIndices.length > 0, R = [], _ = S.lastSize;
6059
6059
  if (C) {
6060
6060
  const E = Xr(S.sizeTree, 0);
6061
6061
  let D = 0, $ = 0;
@@ -6067,7 +6067,7 @@ const by = {
6067
6067
  startIndex: M
6068
6068
  }), R.push({
6069
6069
  endIndex: M + 1 + V - 1,
6070
- size: j,
6070
+ size: _,
6071
6071
  startIndex: M + 1
6072
6072
  }), $++, D += V + 1;
6073
6073
  }
@@ -6103,7 +6103,7 @@ const by = {
6103
6103
  }),
6104
6104
  {
6105
6105
  prevIndex: 0,
6106
- prevSize: j,
6106
+ prevSize: _,
6107
6107
  ranges: []
6108
6108
  }
6109
6109
  ).ranges;
@@ -6130,11 +6130,11 @@ const by = {
6130
6130
  if (He(S.sizeTree))
6131
6131
  return S;
6132
6132
  let R = vr();
6133
- const j = it(g);
6133
+ const _ = it(g);
6134
6134
  let E = 0, D = 0, $ = 0;
6135
6135
  for (; E < -v; ) {
6136
- $ = j[D];
6137
- const z = j[D + 1] - $ - 1;
6136
+ $ = _[D];
6137
+ const z = _[D + 1] - $ - 1;
6138
6138
  D++, E += z + 1;
6139
6139
  }
6140
6140
  if (R = qn(S.sizeTree).reduce((z, { k: M, v: V }) => Dt(z, Math.max(0, M + v), V), R), E !== -v) {
@@ -6149,7 +6149,7 @@ const by = {
6149
6149
  ...Ri(S.offsetTree, 0, R, C)
6150
6150
  };
6151
6151
  } else {
6152
- const R = qn(S.sizeTree).reduce((j, { k: E, v: D }) => Dt(j, Math.max(0, E + v), D), vr());
6152
+ const R = qn(S.sizeTree).reduce((_, { k: E, v: D }) => Dt(_, Math.max(0, E + v), D), vr());
6153
6153
  return {
6154
6154
  ...S,
6155
6155
  sizeTree: R,
@@ -6195,7 +6195,7 @@ function vy(e) {
6195
6195
  }
6196
6196
  const Wu = Oe(
6197
6197
  ([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
6198
- const s = _e(), i = _e(), a = Lt(J(s, le(vy)));
6198
+ const s = je(), i = je(), a = Lt(J(s, le(vy)));
6199
6199
  return fe(
6200
6200
  J(
6201
6201
  a,
@@ -6255,7 +6255,7 @@ const ho = Oe(
6255
6255
  },
6256
6256
  { log: h }
6257
6257
  ]) => {
6258
- const p = _e(), m = _e(), y = te(0);
6258
+ const p = je(), m = je(), y = te(0);
6259
6259
  let g = null, w = null, b = null;
6260
6260
  function T() {
6261
6261
  g && (g(), g = null), b && (b(), b = null), w && (clearTimeout(w), w = null), Re(c, !1);
@@ -6267,13 +6267,13 @@ const ho = Oe(
6267
6267
  Ae(e, s, o),
6268
6268
  le(
6269
6269
  ([
6270
- [I, v, S, C, R, j, E, D],
6270
+ [I, v, S, C, R, _, E, D],
6271
6271
  $,
6272
6272
  z,
6273
6273
  M
6274
6274
  ]) => {
6275
6275
  const V = Vu(I), { align: q, behavior: ne, offset: H } = V, U = C - 1, ee = Hu(V, v, U);
6276
- let W = Zr(ee, v.offsetTree, $) + j;
6276
+ let W = Zr(ee, v.offsetTree, $) + _;
6277
6277
  q === "end" ? (W += z + Gt(v.sizeTree, ee)[1] - S + M, ee === U && (W += E)) : q === "center" ? W += (z + Gt(v.sizeTree, ee)[1] - S + M) / 2 : W -= R, H && (W += H);
6278
6278
  const P = (A) => {
6279
6279
  T(), A ? (D("retrying to scroll to", { location: I }, Nt.DEBUG), Re(p, I)) : (Re(m, !0), D("list did not change, scroll successful", {}, Nt.DEBUG));
@@ -6379,7 +6379,7 @@ const Qr = "up", Wr = "down", Ty = "none", ky = {
6379
6379
  viewportHeight: 0
6380
6380
  }
6381
6381
  }, Iy = 0, mo = Oe(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
6382
- const i = te(!1), a = te(!0), c = _e(), l = _e(), u = te(4), f = te(Iy), h = St(
6382
+ const i = te(!1), a = te(!0), c = je(), l = je(), u = te(4), f = te(Iy), h = St(
6383
6383
  J(
6384
6384
  Ci(J(we(o), nr(1), on(!0)), J(we(o), nr(1), on(!1), El(100))),
6385
6385
  Xe()
@@ -6401,12 +6401,12 @@ const Qr = "up", Wr = "down", Ty = "none", ky = {
6401
6401
  J(
6402
6402
  ct(r, we(s), we(t), we(e), we(u)),
6403
6403
  an((b, [{ scrollHeight: T, scrollTop: I }, v, S, C, R]) => {
6404
- const j = I + v - T > -R, E = {
6404
+ const _ = I + v - T > -R, E = {
6405
6405
  scrollHeight: T,
6406
6406
  scrollTop: I,
6407
6407
  viewportHeight: v
6408
6408
  };
6409
- if (j) {
6409
+ if (_) {
6410
6410
  let $, z;
6411
6411
  return I > b.state.scrollTop ? ($ = "SCROLLED_DOWN", z = b.state.scrollTop - I) : ($ = "SIZE_DECREASED", z = b.state.scrollTop - I || b.scrollTopDelta), {
6412
6412
  atBottom: !0,
@@ -6510,7 +6510,7 @@ const Qr = "up", Wr = "down", Ty = "none", ky = {
6510
6510
  scrollDirection: g,
6511
6511
  scrollVelocity: w
6512
6512
  };
6513
- }, Je(Tt)), es = "top", ts = "bottom", _l = "none";
6513
+ }, Je(Tt)), es = "top", ts = "bottom", jl = "none";
6514
6514
  function Pl(e, t, n) {
6515
6515
  return typeof e == "number" ? n === Qr && t === es || n === Wr && t === ts ? e : 0 : n === Qr ? t === es ? e.main : e.reverse : t === ts ? e.main : e.reverse;
6516
6516
  }
@@ -6520,7 +6520,7 @@ function Ol(e, t) {
6520
6520
  }
6521
6521
  const oa = Oe(
6522
6522
  ([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
6523
- const s = _e(), i = te(0), a = te(0), c = te(0), l = St(
6523
+ const s = je(), i = te(0), a = te(0), c = te(0), l = St(
6524
6524
  J(
6525
6525
  ct(
6526
6526
  we(r),
@@ -6546,11 +6546,11 @@ const oa = Oe(
6546
6546
  T
6547
6547
  ]) => {
6548
6548
  const I = u - b, v = g + w, S = Math.max(h - I, 0);
6549
- let C = _l;
6550
- const R = Ol(T, es), j = Ol(T, ts);
6551
- return p -= b, p += h + w, m += h + w, m -= b, p > u + v - R && (C = Qr), m < u - S + f + j && (C = Wr), C !== _l ? [
6549
+ let C = jl;
6550
+ const R = Ol(T, es), _ = Ol(T, ts);
6551
+ return p -= b, p += h + w, m += h + w, m -= b, p > u + v - R && (C = Qr), m < u - S + f + _ && (C = Wr), C !== jl ? [
6552
6552
  Math.max(I - h - Pl(y, es, C) - R, 0),
6553
- I - S - w + f + Pl(y, ts, C) + j
6553
+ I - S - w + f + Pl(y, ts, C) + _
6554
6554
  ] : null;
6555
6555
  }
6556
6556
  ),
@@ -6667,7 +6667,7 @@ const cr = Oe(
6667
6667
  { didMount: p },
6668
6668
  { recalcInProgress: m }
6669
6669
  ]) => {
6670
- const y = te([]), g = te(0), w = _e();
6670
+ const y = te([]), g = te(0), w = je();
6671
6671
  fe(s.topItemsIndexes, y);
6672
6672
  const b = St(
6673
6673
  J(
@@ -6684,8 +6684,8 @@ const cr = Oe(
6684
6684
  we(n),
6685
6685
  e
6686
6686
  ),
6687
- ve(([S, C, , R, , , , , , , j]) => {
6688
- const E = j && j.length !== R;
6687
+ ve(([S, C, , R, , , , , , , _]) => {
6688
+ const E = _ && _.length !== R;
6689
6689
  return S && !C && !E;
6690
6690
  }),
6691
6691
  le(
@@ -6694,7 +6694,7 @@ const cr = Oe(
6694
6694
  ,
6695
6695
  [S, C],
6696
6696
  R,
6697
- j,
6697
+ _,
6698
6698
  E,
6699
6699
  D,
6700
6700
  $,
@@ -6702,11 +6702,11 @@ const cr = Oe(
6702
6702
  M,
6703
6703
  V
6704
6704
  ]) => {
6705
- const q = j, { offsetTree: ne, sizeTree: H } = q, U = it(g);
6705
+ const q = _, { offsetTree: ne, sizeTree: H } = q, U = it(g);
6706
6706
  if (R === 0)
6707
6707
  return { ...Js, totalCount: R };
6708
6708
  if (S === 0 && C === 0)
6709
- return U === 0 ? { ...Js, totalCount: R } : qu(U, E, j, z, M, V || []);
6709
+ return U === 0 ? { ...Js, totalCount: R } : qu(U, E, _, z, M, V || []);
6710
6710
  if (He(H))
6711
6711
  return U > 0 ? null : zo(
6712
6712
  Ry(ra(E, R), q, V),
@@ -6833,7 +6833,7 @@ const cr = Oe(
6833
6833
  { singleton: !0 }
6834
6834
  ), Gu = Oe(
6835
6835
  ([{ fixedFooterHeight: e, fixedHeaderHeight: t, footerHeight: n, headerHeight: r }, { listState: o }]) => {
6836
- const s = _e(), i = St(
6836
+ const s = je(), i = St(
6837
6837
  J(
6838
6838
  ct(n, e, r, t, o),
6839
6839
  le(([a, c, l, u, f]) => a + c + l + u + f.offsetBottom + f.bottom)
@@ -6874,14 +6874,14 @@ const cr = Oe(
6874
6874
  { fixedFooterHeight: r, fixedHeaderHeight: o, headerHeight: s, scrollingInProgress: i, scrollTop: a, viewportHeight: c },
6875
6875
  { scrollToIndex: l }
6876
6876
  ]) => {
6877
- const u = _e();
6877
+ const u = je();
6878
6878
  return fe(
6879
6879
  J(
6880
6880
  u,
6881
6881
  Ae(t, c, n, s, o, r, a),
6882
6882
  Ae(e),
6883
6883
  le(([[f, h, p, m, y, g, w, b], T]) => {
6884
- const { align: I, behavior: v, calculateViewLocation: S = Ay, done: C, ...R } = f, j = Hu(f, h, m - 1), E = Zr(j, h.offsetTree, T) + y + g, D = E + Gt(h.sizeTree, j)[1], $ = b + g, z = b + p - w, M = S({
6884
+ const { align: I, behavior: v, calculateViewLocation: S = Ay, done: C, ...R } = f, _ = Hu(f, h, m - 1), E = Zr(_, h.offsetTree, T) + y + g, D = E + Gt(h.sizeTree, _)[1], $ = b + g, z = b + p - w, M = S({
6885
6885
  itemBottom: D,
6886
6886
  itemTop: E,
6887
6887
  locationParams: { align: I, behavior: v, ...R },
@@ -6912,7 +6912,7 @@ const cr = Oe(
6912
6912
  function Dl(e) {
6913
6913
  return e ? e === "smooth" ? "smooth" : "auto" : !1;
6914
6914
  }
6915
- const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
6915
+ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), _y = Oe(
6916
6916
  ([
6917
6917
  { listRefresh: e, totalCount: t, fixedItemSize: n, data: r },
6918
6918
  { atBottomState: o, isAtBottom: s },
@@ -6924,7 +6924,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
6924
6924
  { context: h },
6925
6925
  { scrollIntoView: p }
6926
6926
  ]) => {
6927
- const m = te(!1), y = _e();
6927
+ const m = te(!1), y = je();
6928
6928
  let g = null;
6929
6929
  function w(v) {
6930
6930
  Re(i, {
@@ -6937,8 +6937,8 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
6937
6937
  J(
6938
6938
  ct(J(we(t), nr(1)), c),
6939
6939
  Ae(we(m), s, a, f),
6940
- le(([[v, S], C, R, j, E]) => {
6941
- let D = S && j, $ = "auto";
6940
+ le(([[v, S], C, R, _, E]) => {
6941
+ let D = S && _, $ = "auto";
6942
6942
  return D && ($ = Ny(C, R || E), D = D && !!$), { followOutputBehavior: $, shouldFollow: D, totalCount: v };
6943
6943
  }),
6944
6944
  ve(({ shouldFollow: v }) => v)
@@ -6976,7 +6976,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
6976
6976
  }), $e(ct(we(m), o), ([v, S]) => {
6977
6977
  v && !S.atBottom && S.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && w("auto");
6978
6978
  });
6979
- const T = te(null), I = _e();
6979
+ const T = te(null), I = je();
6980
6980
  return fe(
6981
6981
  Ci(
6982
6982
  J(
@@ -6993,7 +6993,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
6993
6993
  J(
6994
6994
  ct(J(I, nr(1)), c),
6995
6995
  Ae(we(T), a, f, h),
6996
- le(([[v, S], C, R, j, E]) => S && R && (C == null ? void 0 : C({ context: E, totalCount: v, scrollingInProgress: j }))),
6996
+ le(([[v, S], C, R, _, E]) => S && R && (C == null ? void 0 : C({ context: E, totalCount: v, scrollingInProgress: _ }))),
6997
6997
  ve((v) => !!v),
6998
6998
  bn(0)
6999
6999
  ),
@@ -7017,7 +7017,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
7017
7017
  Yu,
7018
7018
  Xu
7019
7019
  )
7020
- ), _y = Oe(
7020
+ ), jy = Oe(
7021
7021
  ([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (fe(
7022
7022
  J(
7023
7023
  a,
@@ -7062,7 +7062,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
7062
7062
  { singleton: !0 }
7063
7063
  ), Ju = Oe(
7064
7064
  ([{ scrollVelocity: e }]) => {
7065
- const t = te(!1), n = _e(), r = te(!1);
7065
+ const t = te(!1), n = je(), r = te(!1);
7066
7066
  return fe(
7067
7067
  J(
7068
7068
  e,
@@ -7090,7 +7090,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
7090
7090
  Je(mo),
7091
7091
  { singleton: !0 }
7092
7092
  ), sa = Oe(([{ scrollContainerState: e, scrollTo: t }]) => {
7093
- const n = _e(), r = _e(), o = _e(), s = te(!1), i = te(void 0);
7093
+ const n = je(), r = je(), o = je(), s = te(!1), i = te(void 0);
7094
7094
  return fe(
7095
7095
  J(
7096
7096
  ct(n, r),
@@ -7129,7 +7129,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
7129
7129
  { didMount: s },
7130
7130
  { useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: c }
7131
7131
  ]) => {
7132
- const l = _e(), u = te(void 0), f = te(null), h = te(null);
7132
+ const l = je(), u = te(void 0), f = te(null), h = te(null);
7133
7133
  return fe(a, f), fe(c, h), $e(
7134
7134
  J(
7135
7135
  l,
@@ -7188,9 +7188,9 @@ const Ly = Zu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
7188
7188
  Ae(i),
7189
7189
  an(
7190
7190
  ([, w, b, T], [{ bottom: I, items: v, offsetBottom: S, totalCount: C }, R]) => {
7191
- const j = I + S;
7191
+ const _ = I + S;
7192
7192
  let E = 0;
7193
- return b === C && w.length > 0 && v.length > 0 && (v[0].originalIndex === 0 && w[0].originalIndex === 0 || (E = j - T, E !== 0 && (E += R))), [E, v, C, j];
7193
+ return b === C && w.length > 0 && v.length > 0 && (v[0].originalIndex === 0 && w[0].originalIndex === 0 || (E = _ - T, E !== 0 && (E += R))), [E, v, C, _];
7194
7194
  },
7195
7195
  [0, [], 0, 0]
7196
7196
  ),
@@ -7232,11 +7232,11 @@ const Ly = Zu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
7232
7232
  {
7233
7233
  let C = 0;
7234
7234
  const R = Xr(I, 0);
7235
- let j = 0, E = 0;
7236
- for (; j < w; ) {
7237
- j++, C += R;
7235
+ let _ = 0, E = 0;
7236
+ for (; _ < w; ) {
7237
+ _++, C += R;
7238
7238
  let D = b.length === E + 1 ? 1 / 0 : b[E + 1] - b[E] - 1;
7239
- j + D > w && (C -= R, D = w - j + 1), j += D, C += S(D), E++;
7239
+ _ + D > w && (C -= R, D = w - _ + 1), _ += D, C += S(D), E++;
7240
7240
  }
7241
7241
  return C;
7242
7242
  }
@@ -7280,7 +7280,7 @@ const Ly = Zu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
7280
7280
  }),
7281
7281
  Je(
7282
7282
  oa,
7283
- _y,
7283
+ jy,
7284
7284
  $n,
7285
7285
  Ju,
7286
7286
  Gu,
@@ -7316,10 +7316,10 @@ const Ly = Zu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
7316
7316
  S,
7317
7317
  { topItemCount: C },
7318
7318
  { groupCounts: R },
7319
- j
7320
- ]) => (fe(I.rangeChanged, j.scrollSeekRangeChanged), fe(
7319
+ _
7320
+ ]) => (fe(I.rangeChanged, _.scrollSeekRangeChanged), fe(
7321
7321
  J(
7322
- j.windowViewportRect,
7322
+ _.windowViewportRect,
7323
7323
  le((E) => E.visibleHeight)
7324
7324
  ),
7325
7325
  y.viewportHeight
@@ -7349,7 +7349,7 @@ const Ly = Zu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
7349
7349
  // exported from stateFlagsSystem
7350
7350
  ...I,
7351
7351
  // the bag of IO from featureGroup1System
7352
- ...j,
7352
+ ..._,
7353
7353
  ...y,
7354
7354
  sizes: c,
7355
7355
  ...g
@@ -7359,7 +7359,7 @@ const Ly = Zu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
7359
7359
  po,
7360
7360
  Tt,
7361
7361
  Oy,
7362
- jy,
7362
+ _y,
7363
7363
  cr,
7364
7364
  ho,
7365
7365
  $y,
@@ -7566,7 +7566,7 @@ const Uy = /* @__PURE__ */ Oe(() => {
7566
7566
  la("deviation", (M) => {
7567
7567
  w !== M && b(M);
7568
7568
  });
7569
- const T = Ce("EmptyPlaceholder"), I = Ce("ScrollSeekPlaceholder") || Wy, v = Ce("ListComponent"), S = Ce("ItemComponent"), C = Ce("GroupComponent"), R = Ce("computeItemKey"), j = Ce("isSeeking"), E = Ce("groupIndices").length > 0, D = Ce("alignToBottom"), $ = Ce("initialItemFinalLocationReached"), z = e ? {} : {
7569
+ const T = Ce("EmptyPlaceholder"), I = Ce("ScrollSeekPlaceholder") || Wy, v = Ce("ListComponent"), S = Ce("ItemComponent"), C = Ce("GroupComponent"), R = Ce("computeItemKey"), _ = Ce("isSeeking"), E = Ce("groupIndices").length > 0, D = Ce("alignToBottom"), $ = Ce("initialItemFinalLocationReached"), z = e ? {} : {
7570
7570
  boxSizing: "border-box",
7571
7571
  ...y ? {
7572
7572
  display: "inline-block",
@@ -7591,7 +7591,7 @@ const Uy = /* @__PURE__ */ Oe(() => {
7591
7591
  style: z,
7592
7592
  children: (e ? t.topItems : t.items).map((M) => {
7593
7593
  const V = M.originalIndex, q = R(V + t.firstItemIndex, M.data, l);
7594
- return j ? /* @__PURE__ */ jo(
7594
+ return _ ? /* @__PURE__ */ _o(
7595
7595
  I,
7596
7596
  {
7597
7597
  ...bt(I, l),
@@ -7601,7 +7601,7 @@ const Uy = /* @__PURE__ */ Oe(() => {
7601
7601
  type: M.type || "item",
7602
7602
  ...M.type === "group" ? {} : { groupIndex: M.groupIndex }
7603
7603
  }
7604
- ) : M.type === "group" ? /* @__PURE__ */ jo(
7604
+ ) : M.type === "group" ? /* @__PURE__ */ _o(
7605
7605
  C,
7606
7606
  {
7607
7607
  ...bt(C, l),
@@ -7612,7 +7612,7 @@ const Uy = /* @__PURE__ */ Oe(() => {
7612
7612
  style: Vy
7613
7613
  },
7614
7614
  u(M.index, l)
7615
- ) : /* @__PURE__ */ jo(
7615
+ ) : /* @__PURE__ */ _o(
7616
7616
  S,
7617
7617
  {
7618
7618
  ...bt(S, l),
@@ -7737,7 +7737,7 @@ function ad({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
7737
7737
  }
7738
7738
  const Qy = ({ children: e }) => {
7739
7739
  const t = Q.useContext(td), n = Bt("viewportHeight"), r = Bt("fixedItemHeight"), o = Ce("alignToBottom"), s = Ce("horizontalDirection"), i = Q.useMemo(
7740
- () => _u(n, (c) => An(c, s ? "width" : "height")),
7740
+ () => ju(n, (c) => An(c, s ? "width" : "height")),
7741
7741
  [n, s]
7742
7742
  ), a = lr(i, !0, Ce("skipAnimationFrameInResizeObserver"));
7743
7743
  return Q.useEffect(() => {
@@ -7909,7 +7909,7 @@ const dw = /* @__PURE__ */ Oe(
7909
7909
  { customScrollParent: g, useWindowScroll: w, windowScrollContainerState: b, windowScrollTo: T, windowViewportRect: I },
7910
7910
  v
7911
7911
  ]) => {
7912
- const S = te(0), C = te(0), R = te(Fl), j = te({ height: 0, width: 0 }), E = te({ height: 0, width: 0 }), D = _e(), $ = _e(), z = te(0), M = te(null), V = te({ column: 0, row: 0 }), q = _e(), ne = _e(), H = te(!1), U = te(0), ee = te(!0), W = te(!1), P = te(!1);
7912
+ const S = te(0), C = te(0), R = te(Fl), _ = te({ height: 0, width: 0 }), E = te({ height: 0, width: 0 }), D = je(), $ = je(), z = te(0), M = te(null), V = te({ column: 0, row: 0 }), q = je(), ne = je(), H = te(!1), U = te(0), ee = te(!0), W = te(!1), P = te(!1);
7913
7913
  $e(
7914
7914
  J(
7915
7915
  m,
@@ -7921,7 +7921,7 @@ const dw = /* @__PURE__ */ Oe(
7921
7921
  }
7922
7922
  ), $e(
7923
7923
  J(
7924
- ct(m, ee, E, j, U, W),
7924
+ ct(m, ee, E, _, U, W),
7925
7925
  ve(([N, B, Y, ae, , pe]) => N && !B && Y.height !== 0 && ae.height !== 0 && !pe)
7926
7926
  ),
7927
7927
  ([, , , , N]) => {
@@ -7945,20 +7945,20 @@ const dw = /* @__PURE__ */ Oe(
7945
7945
  ve(([, N]) => N != null)
7946
7946
  ),
7947
7947
  ([, N]) => {
7948
- N && (Re(j, N.viewport), Re(E, N.item), Re(V, N.gap), N.scrollTop > 0 && (Re(H, !0), qt(J(l, nr(1)), (B) => {
7948
+ N && (Re(_, N.viewport), Re(E, N.item), Re(V, N.gap), N.scrollTop > 0 && (Re(H, !0), qt(J(l, nr(1)), (B) => {
7949
7949
  Re(H, !1);
7950
7950
  }), Re(c, { top: N.scrollTop })));
7951
7951
  }
7952
7952
  ), fe(
7953
7953
  J(
7954
- j,
7954
+ _,
7955
7955
  le(({ height: N }) => N)
7956
7956
  ),
7957
7957
  f
7958
7958
  ), fe(
7959
7959
  J(
7960
7960
  ct(
7961
- we(j, Co),
7961
+ we(_, Co),
7962
7962
  we(E, Co),
7963
7963
  we(V, (N, B) => N && N.column === B.column && N.row === B.row),
7964
7964
  we(l)
@@ -7978,7 +7978,7 @@ const dw = /* @__PURE__ */ Oe(
7978
7978
  r,
7979
7979
  we(V, uw),
7980
7980
  we(E, Co),
7981
- we(j, Co),
7981
+ we(_, Co),
7982
7982
  we(M),
7983
7983
  we(C),
7984
7984
  we(H),
@@ -8007,9 +8007,9 @@ const dw = /* @__PURE__ */ Oe(
8007
8007
  return cw(Ul(Ue, pt, Ee));
8008
8008
  }
8009
8009
  const lt = ld(nt, ft, Ge);
8010
- let ht, je;
8011
- Ve ? B === 0 && Y === 0 && Ie > 0 ? (ht = 0, je = Ie - 1) : (ht = lt * ns((B + Ke) / (dt + Ke)), je = lt * zl((Y + Ke) / (dt + Ke)) - 1, je = ei(N - 1, Vr(je, lt - 1)), ht = ei(je, Vr(0, ht))) : (ht = 0, je = -1);
8012
- const rt = Ul(ht, je, Ee), { bottom: Ye, top: ot } = Hl(ge, ae, pe, rt), xt = zl(N / lt), Ct = xt * dt + (xt - 1) * Ke - Ye;
8010
+ let ht, _e;
8011
+ Ve ? B === 0 && Y === 0 && Ie > 0 ? (ht = 0, _e = Ie - 1) : (ht = lt * ns((B + Ke) / (dt + Ke)), _e = lt * zl((Y + Ke) / (dt + Ke)) - 1, _e = ei(N - 1, Vr(_e, lt - 1)), ht = ei(_e, Vr(0, ht))) : (ht = 0, _e = -1);
8012
+ const rt = Ul(ht, _e, Ee), { bottom: Ye, top: ot } = Hl(ge, ae, pe, rt), xt = zl(N / lt), Ct = xt * dt + (xt - 1) * Ke - Ye;
8013
8013
  return { bottom: Ye, itemHeight: dt, items: rt, itemWidth: ft, offsetBottom: Ct, offsetTop: ot, top: ot };
8014
8014
  }
8015
8015
  )
@@ -8024,7 +8024,7 @@ const dw = /* @__PURE__ */ Oe(
8024
8024
  S
8025
8025
  ), fe(
8026
8026
  J(
8027
- ct(j, E, R, V),
8027
+ ct(_, E, R, V),
8028
8028
  ve(([N, B, { items: Y }]) => Y.length > 0 && B.height !== 0 && N.height !== 0),
8029
8029
  le(([N, B, { items: Y }, ae]) => {
8030
8030
  const { bottom: pe, top: ge } = Hl(N, ae, B, Y);
@@ -8078,7 +8078,7 @@ const dw = /* @__PURE__ */ Oe(
8078
8078
  fe(K, p.scrollSeekRangeChanged), fe(
8079
8079
  J(
8080
8080
  D,
8081
- Ae(j, E, S, V),
8081
+ Ae(_, E, S, V),
8082
8082
  le(([N, B, Y, ae, pe]) => {
8083
8083
  const ge = Vu(N), { align: Ee, behavior: Ie, offset: Ve } = ge;
8084
8084
  let Ze = ge.index;
@@ -8101,7 +8101,7 @@ const dw = /* @__PURE__ */ Oe(
8101
8101
  I,
8102
8102
  le((N) => ({ height: N.visibleHeight, width: N.visibleWidth }))
8103
8103
  ),
8104
- j
8104
+ _
8105
8105
  ), {
8106
8106
  customScrollParent: g,
8107
8107
  // input
@@ -8124,7 +8124,7 @@ const dw = /* @__PURE__ */ Oe(
8124
8124
  smoothScrollTargetReached: u,
8125
8125
  totalCount: S,
8126
8126
  useWindowScroll: w,
8127
- viewportDimensions: j,
8127
+ viewportDimensions: _,
8128
8128
  windowScrollContainerState: b,
8129
8129
  windowScrollTo: T,
8130
8130
  windowViewportRect: I,
@@ -8232,7 +8232,7 @@ const fw = /* @__PURE__ */ Oe(() => {
8232
8232
  width: e.itemWidth
8233
8233
  },
8234
8234
  b
8235
- ) : /* @__PURE__ */ jo(
8235
+ ) : /* @__PURE__ */ _o(
8236
8236
  a,
8237
8237
  {
8238
8238
  ...bt(a, u),
@@ -8778,10 +8778,10 @@ function xd() {
8778
8778
  };
8779
8779
  }
8780
8780
  let ur = xd();
8781
- function jw(e) {
8781
+ function _w(e) {
8782
8782
  ur = e;
8783
8783
  }
8784
- const yd = /[&<>"']/, _w = new RegExp(yd.source, "g"), wd = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Pw = new RegExp(wd.source, "g"), Ow = {
8784
+ const yd = /[&<>"']/, jw = new RegExp(yd.source, "g"), wd = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Pw = new RegExp(wd.source, "g"), Ow = {
8785
8785
  "&": "&amp;",
8786
8786
  "<": "&lt;",
8787
8787
  ">": "&gt;",
@@ -8791,7 +8791,7 @@ const yd = /[&<>"']/, _w = new RegExp(yd.source, "g"), wd = /[<>"']|&(?!(#\d{1,7
8791
8791
  function yt(e, t) {
8792
8792
  if (t) {
8793
8793
  if (yd.test(e))
8794
- return e.replace(_w, ql);
8794
+ return e.replace(jw, ql);
8795
8795
  } else if (wd.test(e))
8796
8796
  return e.replace(Pw, ql);
8797
8797
  return e;
@@ -9914,7 +9914,7 @@ class Sd {
9914
9914
  return this.getNextSafeSlug(r, n.dryrun);
9915
9915
  }
9916
9916
  }
9917
- class jn {
9917
+ class _n {
9918
9918
  constructor(t) {
9919
9919
  this.options = t || ur, this.options.renderer = this.options.renderer || new ua(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new vd(), this.slugger = new Sd();
9920
9920
  }
@@ -9922,13 +9922,13 @@ class jn {
9922
9922
  * Static Parse Method
9923
9923
  */
9924
9924
  static parse(t, n) {
9925
- return new jn(n).parse(t);
9925
+ return new _n(n).parse(t);
9926
9926
  }
9927
9927
  /**
9928
9928
  * Static Parse Inline Method
9929
9929
  */
9930
9930
  static parseInline(t, n) {
9931
- return new jn(n).parseInline(t);
9931
+ return new _n(n).parseInline(t);
9932
9932
  }
9933
9933
  /**
9934
9934
  * Parse Loop
@@ -10186,10 +10186,10 @@ function Cd(e, t) {
10186
10186
  };
10187
10187
  }
10188
10188
  function he(e, t, n) {
10189
- return Cd(Nn.lex, jn.parse)(e, t, n);
10189
+ return Cd(Nn.lex, _n.parse)(e, t, n);
10190
10190
  }
10191
10191
  he.options = he.setOptions = function(e) {
10192
- return he.defaults = { ...he.defaults, ...e }, jw(he.defaults), he;
10192
+ return he.defaults = { ...he.defaults, ...e }, _w(he.defaults), he;
10193
10193
  };
10194
10194
  he.getDefaults = xd;
10195
10195
  he.defaults = ur;
@@ -10284,9 +10284,9 @@ he.walkTokens = function(e, t) {
10284
10284
  }
10285
10285
  return n;
10286
10286
  };
10287
- he.parseInline = Cd(Nn.lexInline, jn.parseInline);
10288
- he.Parser = jn;
10289
- he.parser = jn.parse;
10287
+ he.parseInline = Cd(Nn.lexInline, _n.parseInline);
10288
+ he.Parser = _n;
10289
+ he.parser = _n.parse;
10290
10290
  he.Renderer = ua;
10291
10291
  he.TextRenderer = vd;
10292
10292
  he.Lexer = Nn;
@@ -10300,7 +10300,7 @@ he.setOptions;
10300
10300
  he.use;
10301
10301
  he.walkTokens;
10302
10302
  he.parseInline;
10303
- jn.parse;
10303
+ _n.parse;
10304
10304
  Nn.lex;
10305
10305
  function Uo({
10306
10306
  content: e,
@@ -10706,14 +10706,14 @@ const Rs = oo(function({
10706
10706
  );
10707
10707
  }
10708
10708
  return null;
10709
- }, j = I ? T : n;
10710
- if (!(j.trim().length > 0 || r.length > 0 || o.length > 0) && !p) return null;
10709
+ }, _ = I ? T : n;
10710
+ if (!(_.trim().length > 0 || r.length > 0 || o.length > 0) && !p) return null;
10711
10711
  const D = I ? w.filter(($) => $.type !== "text") : w;
10712
10712
  return /* @__PURE__ */ d.jsxs("div", { className: "space-y-2", children: [
10713
10713
  I ? S : null,
10714
10714
  D.filter(($) => $.type === "text" || $.type === "file").map(($, z) => R($, z)),
10715
10715
  C(),
10716
- p && j.trim().length > 0 && /* @__PURE__ */ d.jsx(
10716
+ p && _.trim().length > 0 && /* @__PURE__ */ d.jsx(
10717
10717
  "span",
10718
10718
  {
10719
10719
  className: "inline-block w-2 h-4 ml-0.5 bg-current opacity-70 animate-pulse align-middle",
@@ -10835,8 +10835,8 @@ const Id = oo(function({
10835
10835
  onRegenerate: S,
10836
10836
  getInterruptOptions: C,
10837
10837
  showToolMessages: R,
10838
- messageCustomStyles: j
10839
- } = Xi(), E = l ?? T, D = a ?? b, $ = m ?? I, z = o ?? v ?? 0, M = f ?? S, V = p ?? C, q = c ?? R ?? !0, ne = y ?? q, H = g ?? q, U = { ...(j == null ? void 0 : j(t)) || {}, ...u }, ee = h, [W, P] = ue(!1), { respondToInterrupt: A } = vs(), [L, O] = ue(!1), K = D === "phone" || D === "half-screen", {
10838
+ messageCustomStyles: _
10839
+ } = Xi(), E = l ?? T, D = a ?? b, $ = m ?? I, z = o ?? v ?? 0, M = f ?? S, V = p ?? C, q = c ?? R ?? !0, ne = y ?? q, H = g ?? q, U = { ...(_ == null ? void 0 : _(t)) || {}, ...u }, ee = h, [W, P] = ue(!1), { respondToInterrupt: A } = vs(), [L, O] = ue(!1), K = D === "phone" || D === "half-screen", {
10840
10840
  contentParts: Z,
10841
10841
  textContent: N,
10842
10842
  imageParts: B,
@@ -10844,19 +10844,19 @@ const Id = oo(function({
10844
10844
  toolCalls: ae,
10845
10845
  interruptParts: pe
10846
10846
  } = da(t), ge = pe[0] || null, Ee = ie(async () => {
10847
- const je = N;
10847
+ const _e = N;
10848
10848
  try {
10849
- await navigator.clipboard.writeText(je), P(!0), setTimeout(() => P(!1), 2e3), ee == null || ee(je);
10849
+ await navigator.clipboard.writeText(_e), P(!0), setTimeout(() => P(!1), 2e3), ee == null || ee(_e);
10850
10850
  } catch (rt) {
10851
10851
  console.error("Failed to copy assistant message:", rt);
10852
10852
  }
10853
10853
  }, [N, ee]), Ie = ie(
10854
- async (je, rt) => {
10854
+ async (_e, rt) => {
10855
10855
  if (!(!ge || !gu(ge.id))) {
10856
10856
  O(!0);
10857
10857
  try {
10858
10858
  const ot = V == null ? void 0 : V(t);
10859
- await A(je, rt, ot);
10859
+ await A(_e, rt, ot);
10860
10860
  } finally {
10861
10861
  O(!1);
10862
10862
  }
@@ -10881,7 +10881,7 @@ const Id = oo(function({
10881
10881
  isInterruptMessage: !1,
10882
10882
  iconForeground: "text-[hsl(var(--chat-bubble-ai-text))]",
10883
10883
  agentName: t.name || t.model || "Agent",
10884
- messageIcon: t.role === "tool" ? /* @__PURE__ */ d.jsx(jp, { className: "h-4 w-4 opacity-60" }) : /* @__PURE__ */ d.jsx(_p, { className: "h-4 w-4 opacity-60" }),
10884
+ messageIcon: t.role === "tool" ? /* @__PURE__ */ d.jsx(_p, { className: "h-4 w-4 opacity-60" }) : /* @__PURE__ */ d.jsx(jp, { className: "h-4 w-4 opacity-60" }),
10885
10885
  isCompactLayout: K,
10886
10886
  showActions: !0,
10887
10887
  isEditing: !1,
@@ -10927,22 +10927,22 @@ const Id = oo(function({
10927
10927
  streamingDebounceMs: z
10928
10928
  }
10929
10929
  ),
10930
- t.role === "assistant" && H && ae.map((je) => /* @__PURE__ */ d.jsx(
10930
+ t.role === "assistant" && H && ae.map((_e) => /* @__PURE__ */ d.jsx(
10931
10931
  Kl,
10932
10932
  {
10933
10933
  message: {
10934
10934
  ...t,
10935
10935
  role: "tool",
10936
- name: je.name,
10937
- toolCallId: je.id,
10938
- artifact: je.artifact,
10939
- content: [{ type: "text", text: JSON.stringify(je.args) }]
10936
+ name: _e.name,
10937
+ toolCallId: _e.id,
10938
+ artifact: _e.artifact,
10939
+ content: [{ type: "text", text: JSON.stringify(_e.args) }]
10940
10940
  },
10941
10941
  viewMode: "expanded",
10942
10942
  isStreaming: r,
10943
10943
  toolConfig: E
10944
10944
  },
10945
- je.id
10945
+ _e.id
10946
10946
  )),
10947
10947
  /* @__PURE__ */ d.jsx(
10948
10948
  kd,
@@ -10953,7 +10953,7 @@ const Id = oo(function({
10953
10953
  interruptPart: ge,
10954
10954
  handleInterruptApprove: () => Ie(!0),
10955
10955
  handleInterruptReject: () => Ie(!1),
10956
- handleInterruptAlternative: (je, rt) => Ie(!0, { alternativeId: rt == null ? void 0 : rt.id }),
10956
+ handleInterruptAlternative: (_e, rt) => Ie(!0, { alternativeId: rt == null ? void 0 : rt.id }),
10957
10957
  disableInterruptActions: L,
10958
10958
  renderArtifactsInline: $,
10959
10959
  iconForeground: "text-[hsl(var(--chat-bubble-ai-text))]",
@@ -10997,7 +10997,7 @@ const Rd = oo(function({
10997
10997
  checkpointNs: t.checkpointNs ?? null
10998
10998
  };
10999
10999
  i(t.id, g, z);
11000
- }, [i, t, g]), { attemptCount: v, attemptIndex: S, attempts: C } = Be(() => a ? _x(t.id, t.checkpointId, a) : { attemptCount: 1, attemptIndex: 0, attempts: [] }, [t.id, t.checkpointId, a]), R = v > 1 && !!c, j = ie(() => {
11000
+ }, [i, t, g]), { attemptCount: v, attemptIndex: S, attempts: C } = Be(() => a ? jx(t.id, t.checkpointId, a) : { attemptCount: 1, attemptIndex: 0, attempts: [] }, [t.id, t.checkpointId, a]), R = v > 1 && !!c, _ = ie(() => {
11001
11001
  const z = C[S + 1];
11002
11002
  z && c && c(z.id, void 0, !!z.isLatestAttempt);
11003
11003
  }, [C, S, c]), E = ie(() => {
@@ -11021,7 +11021,7 @@ const Rd = oo(function({
11021
11021
  showCheckpointControls: R,
11022
11022
  attemptCount: v,
11023
11023
  attemptIndex: S,
11024
- handleOlderAttemptSelect: j,
11024
+ handleOlderAttemptSelect: _,
11025
11025
  handleNewerAttemptSelect: E,
11026
11026
  messageCreatedAt: t.createdAt,
11027
11027
  copied: u,
@@ -11142,7 +11142,7 @@ const Ad = Q.forwardRef(({
11142
11142
  p.current && e.length > 0 ? (D = (E = p.current).scrollToIndex) == null || D.call(E, { index: 0, align: "start", behavior: "auto" }) : m.current && (m.current.scrollTop = 0);
11143
11143
  }
11144
11144
  }), [e]);
11145
- const j = ie((E, D) => E.role === "user" ? /* @__PURE__ */ d.jsx(Rd, { message: E, messageIndex: D }) : E.role === "system" ? /* @__PURE__ */ d.jsx(Ed, { message: E }) : /* @__PURE__ */ d.jsx(
11145
+ const _ = ie((E, D) => E.role === "user" ? /* @__PURE__ */ d.jsx(Rd, { message: E, messageIndex: D }) : E.role === "system" ? /* @__PURE__ */ d.jsx(Ed, { message: E }) : /* @__PURE__ */ d.jsx(
11146
11146
  Id,
11147
11147
  {
11148
11148
  message: E,
@@ -11166,7 +11166,7 @@ const Ad = Q.forwardRef(({
11166
11166
  atBottomStateChange: w,
11167
11167
  style: { height: "100%", width: "100%", overscrollBehavior: "contain" },
11168
11168
  computeItemKey: (E, D) => D.id || E,
11169
- itemContent: (E, D) => c ? c(D, E) : j(D, E)
11169
+ itemContent: (E, D) => c ? c(D, E) : _(D, E)
11170
11170
  }
11171
11171
  ) : S() }) });
11172
11172
  });
@@ -11182,7 +11182,7 @@ function Ql(e, t) {
11182
11182
  return e(t);
11183
11183
  e != null && (e.current = t);
11184
11184
  }
11185
- function _n(...e) {
11185
+ function jn(...e) {
11186
11186
  return (t) => {
11187
11187
  let n = !1;
11188
11188
  const r = e.map((o) => {
@@ -11199,7 +11199,7 @@ function _n(...e) {
11199
11199
  };
11200
11200
  }
11201
11201
  function et(...e) {
11202
- return x.useCallback(_n(...e), e);
11202
+ return x.useCallback(jn(...e), e);
11203
11203
  }
11204
11204
  function eb(e, t) {
11205
11205
  const n = x.createContext(t), r = (s) => {
@@ -11343,7 +11343,7 @@ var sb = [
11343
11343
  function Nd(e, t) {
11344
11344
  e && Oc.flushSync(() => e.dispatchEvent(t));
11345
11345
  }
11346
- function jd(e) {
11346
+ function _d(e) {
11347
11347
  const t = e + "CollectionProvider", [n, r] = Fn(t), [o, s] = n(
11348
11348
  t,
11349
11349
  { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
@@ -11406,7 +11406,7 @@ function ab(e, t = globalThis == null ? void 0 : globalThis.document) {
11406
11406
  return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
11407
11407
  }, [n, t]);
11408
11408
  }
11409
- var lb = "DismissableLayer", Ni = "dismissableLayer.update", cb = "dismissableLayer.pointerDownOutside", ub = "dismissableLayer.focusOutside", ec, _d = x.createContext({
11409
+ var lb = "DismissableLayer", Ni = "dismissableLayer.update", cb = "dismissableLayer.pointerDownOutside", ub = "dismissableLayer.focusOutside", ec, jd = x.createContext({
11410
11410
  layers: /* @__PURE__ */ new Set(),
11411
11411
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
11412
11412
  branches: /* @__PURE__ */ new Set()
@@ -11420,9 +11420,9 @@ var lb = "DismissableLayer", Ni = "dismissableLayer.update", cb = "dismissableLa
11420
11420
  onInteractOutside: i,
11421
11421
  onDismiss: a,
11422
11422
  ...c
11423
- } = e, l = x.useContext(_d), [u, f] = x.useState(null), h = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = x.useState({}), m = et(t, (C) => f(C)), y = Array.from(l.layers), [g] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), w = y.indexOf(g), b = u ? y.indexOf(u) : -1, T = l.layersWithOutsidePointerEventsDisabled.size > 0, I = b >= w, v = hb((C) => {
11424
- const R = C.target, j = [...l.branches].some((E) => E.contains(R));
11425
- !I || j || (o == null || o(C), i == null || i(C), C.defaultPrevented || a == null || a());
11423
+ } = e, l = x.useContext(jd), [u, f] = x.useState(null), h = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = x.useState({}), m = et(t, (C) => f(C)), y = Array.from(l.layers), [g] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), w = y.indexOf(g), b = u ? y.indexOf(u) : -1, T = l.layersWithOutsidePointerEventsDisabled.size > 0, I = b >= w, v = hb((C) => {
11424
+ const R = C.target, _ = [...l.branches].some((E) => E.contains(R));
11425
+ !I || _ || (o == null || o(C), i == null || i(C), C.defaultPrevented || a == null || a());
11426
11426
  }, h), S = pb((C) => {
11427
11427
  const R = C.target;
11428
11428
  [...l.branches].some((E) => E.contains(R)) || (s == null || s(C), i == null || i(C), C.defaultPrevented || a == null || a());
@@ -11460,7 +11460,7 @@ var lb = "DismissableLayer", Ni = "dismissableLayer.update", cb = "dismissableLa
11460
11460
  );
11461
11461
  ha.displayName = lb;
11462
11462
  var db = "DismissableLayerBranch", fb = x.forwardRef((e, t) => {
11463
- const n = x.useContext(_d), r = x.useRef(null), o = et(t, r);
11463
+ const n = x.useContext(jd), r = x.useRef(null), o = et(t, r);
11464
11464
  return x.useEffect(() => {
11465
11465
  const s = r.current;
11466
11466
  if (s)
@@ -11684,7 +11684,7 @@ const Tb = ["top", "right", "bottom", "left"], Pn = Math.min, Mt = Math.max, ss
11684
11684
  start: "end",
11685
11685
  end: "start"
11686
11686
  };
11687
- function ji(e, t, n) {
11687
+ function _i(e, t, n) {
11688
11688
  return Mt(e, Pn(t, n));
11689
11689
  }
11690
11690
  function vn(e, t) {
@@ -11717,28 +11717,28 @@ function Eb(e, t, n) {
11717
11717
  }
11718
11718
  function Ab(e) {
11719
11719
  const t = is(e);
11720
- return [_i(e), t, _i(t)];
11720
+ return [ji(e), t, ji(t)];
11721
11721
  }
11722
- function _i(e) {
11722
+ function ji(e) {
11723
11723
  return e.replace(/start|end/g, (t) => Ib[t]);
11724
11724
  }
11725
- const ac = ["left", "right"], lc = ["right", "left"], Nb = ["top", "bottom"], jb = ["bottom", "top"];
11726
- function _b(e, t, n) {
11725
+ const ac = ["left", "right"], lc = ["right", "left"], Nb = ["top", "bottom"], _b = ["bottom", "top"];
11726
+ function jb(e, t, n) {
11727
11727
  switch (e) {
11728
11728
  case "top":
11729
11729
  case "bottom":
11730
11730
  return n ? t ? lc : ac : t ? ac : lc;
11731
11731
  case "left":
11732
11732
  case "right":
11733
- return t ? Nb : jb;
11733
+ return t ? Nb : _b;
11734
11734
  default:
11735
11735
  return [];
11736
11736
  }
11737
11737
  }
11738
11738
  function Pb(e, t, n, r) {
11739
11739
  const o = Or(e);
11740
- let s = _b(Sn(e), n === "start", r);
11741
- return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(_i)))), s;
11740
+ let s = jb(Sn(e), n === "start", r);
11741
+ return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(ji)))), s;
11742
11742
  }
11743
11743
  function is(e) {
11744
11744
  return e.replace(/left|right|bottom|top/g, (t) => kb[t]);
@@ -11956,7 +11956,7 @@ const Db = (e) => ({
11956
11956
  }, p = xa(o), m = ga(p), y = await i.getDimensions(l), g = p === "y", w = g ? "top" : "left", b = g ? "bottom" : "right", T = g ? "clientHeight" : "clientWidth", I = s.reference[m] + s.reference[p] - h[p] - s.floating[m], v = h[p] - s.reference[p], S = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l));
11957
11957
  let C = S ? S[T] : 0;
11958
11958
  (!C || !await (i.isElement == null ? void 0 : i.isElement(S))) && (C = a.floating[T] || s.floating[m]);
11959
- const R = I / 2 - v / 2, j = C / 2 - y[m] / 2 - 1, E = Pn(f[w], j), D = Pn(f[b], j), $ = E, z = C - y[m] - D, M = C / 2 - y[m] / 2 + R, V = ji($, M, z), q = !c.arrow && Or(o) != null && M !== V && s.reference[m] / 2 - (M < $ ? E : D) - y[m] / 2 < 0, ne = q ? M < $ ? M - $ : M - z : 0;
11959
+ const R = I / 2 - v / 2, _ = C / 2 - y[m] / 2 - 1, E = Pn(f[w], _), D = Pn(f[b], _), $ = E, z = C - y[m] - D, M = C / 2 - y[m] / 2 + R, V = _i($, M, z), q = !c.arrow && Or(o) != null && M !== V && s.reference[m] / 2 - (M < $ ? E : D) - y[m] / 2 < 0, ne = q ? M < $ ? M - $ : M - z : 0;
11960
11960
  return {
11961
11961
  [p]: h[p] + ne,
11962
11962
  data: {
@@ -11995,16 +11995,16 @@ const Db = (e) => ({
11995
11995
  return {};
11996
11996
  const w = Sn(o), b = ln(a), T = Sn(a) === a, I = await (c.isRTL == null ? void 0 : c.isRTL(l.floating)), v = h || (T || !y ? [is(a)] : Ab(a)), S = m !== "none";
11997
11997
  !h && S && v.push(...Pb(a, y, m, I));
11998
- const C = [a, ...v], R = await eo(t, g), j = [];
11998
+ const C = [a, ...v], R = await eo(t, g), _ = [];
11999
11999
  let E = ((r = s.flip) == null ? void 0 : r.overflows) || [];
12000
- if (u && j.push(R[w]), f) {
12000
+ if (u && _.push(R[w]), f) {
12001
12001
  const M = Eb(o, i, I);
12002
- j.push(R[M[0]], R[M[1]]);
12002
+ _.push(R[M[0]], R[M[1]]);
12003
12003
  }
12004
12004
  if (E = [...E, {
12005
12005
  placement: o,
12006
- overflows: j
12007
- }], !j.every((M) => M <= 0)) {
12006
+ overflows: _
12007
+ }], !_.every((M) => M <= 0)) {
12008
12008
  var D, $;
12009
12009
  const M = (((D = s.flip) == null ? void 0 : D.index) || 0) + 1, V = C[M];
12010
12010
  if (V && (!(f === "alignment" ? b !== ln(V) : !1) || // We leave the current main axis only if every placement on that axis
@@ -12185,11 +12185,11 @@ const zb = function(e) {
12185
12185
  let p = l[h], m = l[f];
12186
12186
  if (s) {
12187
12187
  const g = h === "y" ? "top" : "left", w = h === "y" ? "bottom" : "right", b = p + u[g], T = p - u[w];
12188
- p = ji(b, p, T);
12188
+ p = _i(b, p, T);
12189
12189
  }
12190
12190
  if (i) {
12191
12191
  const g = f === "y" ? "top" : "left", w = f === "y" ? "bottom" : "right", b = m + u[g], T = m - u[w];
12192
- m = ji(b, m, T);
12192
+ m = _i(b, m, T);
12193
12193
  }
12194
12194
  const y = a.fn({
12195
12195
  ...t,
@@ -12283,8 +12283,8 @@ const zb = function(e) {
12283
12283
  availableWidth: R,
12284
12284
  availableHeight: C
12285
12285
  });
12286
- const j = await i.getDimensions(a.floating);
12287
- return m !== j.width || y !== j.height ? {
12286
+ const _ = await i.getDimensions(a.floating);
12287
+ return m !== _.width || y !== _.height ? {
12288
12288
  reset: {
12289
12289
  rects: !0
12290
12290
  }
@@ -12333,7 +12333,7 @@ function Kb(e) {
12333
12333
  return Vb.has(Mr(e));
12334
12334
  }
12335
12335
  const qb = [":popover-open", ":modal"];
12336
- function js(e) {
12336
+ function _s(e) {
12337
12337
  return qb.some((t) => {
12338
12338
  try {
12339
12339
  return e.matches(t);
@@ -12352,7 +12352,7 @@ function Jb(e) {
12352
12352
  for (; dn(t) && !Rr(t); ) {
12353
12353
  if (ya(t))
12354
12354
  return t;
12355
- if (js(t))
12355
+ if (_s(t))
12356
12356
  return null;
12357
12357
  t = On(t);
12358
12358
  }
@@ -12368,7 +12368,7 @@ function Rr(e) {
12368
12368
  function Xt(e) {
12369
12369
  return Ft(e).getComputedStyle(e);
12370
12370
  }
12371
- function _s(e) {
12371
+ function js(e) {
12372
12372
  return Yt(e) ? {
12373
12373
  scrollLeft: e.scrollLeft,
12374
12374
  scrollTop: e.scrollTop
@@ -12468,7 +12468,7 @@ function rr(e, t, n, r) {
12468
12468
  });
12469
12469
  }
12470
12470
  function Ps(e, t) {
12471
- const n = _s(e).scrollLeft;
12471
+ const n = js(e).scrollLeft;
12472
12472
  return t ? t.left + n : rr(hn(e)).left + n;
12473
12473
  }
12474
12474
  function Ud(e, t) {
@@ -12485,7 +12485,7 @@ function tv(e) {
12485
12485
  offsetParent: r,
12486
12486
  strategy: o
12487
12487
  } = e;
12488
- const s = o === "fixed", i = hn(r), a = t ? js(t.floating) : !1;
12488
+ const s = o === "fixed", i = hn(r), a = t ? _s(t.floating) : !1;
12489
12489
  if (r === i || a && s)
12490
12490
  return n;
12491
12491
  let c = {
@@ -12493,7 +12493,7 @@ function tv(e) {
12493
12493
  scrollTop: 0
12494
12494
  }, l = cn(1);
12495
12495
  const u = cn(0), f = dn(r);
12496
- if ((f || !f && !s) && ((Mr(r) !== "body" || go(i)) && (c = _s(r)), dn(r))) {
12496
+ if ((f || !f && !s) && ((Mr(r) !== "body" || go(i)) && (c = js(r)), dn(r))) {
12497
12497
  const p = rr(r);
12498
12498
  l = Sr(r), u.x = p.x + r.clientLeft, u.y = p.y + r.clientTop;
12499
12499
  }
@@ -12509,7 +12509,7 @@ function nv(e) {
12509
12509
  return Array.from(e.getClientRects());
12510
12510
  }
12511
12511
  function rv(e) {
12512
- const t = hn(e), n = _s(e), r = e.ownerDocument.body, o = Mt(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = Mt(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
12512
+ const t = hn(e), n = js(e), r = e.ownerDocument.body, o = Mt(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = Mt(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
12513
12513
  let i = -n.scrollLeft + Ps(e);
12514
12514
  const a = -n.scrollTop;
12515
12515
  return Xt(r).direction === "rtl" && (i += Mt(t.clientWidth, r.clientWidth) - o), {
@@ -12593,7 +12593,7 @@ function lv(e) {
12593
12593
  rootBoundary: r,
12594
12594
  strategy: o
12595
12595
  } = e;
12596
- const i = [...n === "clippingAncestors" ? js(t) ? [] : av(t, this._c) : [].concat(n), r], a = i[0], c = i.reduce((l, u) => {
12596
+ const i = [...n === "clippingAncestors" ? _s(t) ? [] : av(t, this._c) : [].concat(n), r], a = i[0], c = i.reduce((l, u) => {
12597
12597
  const f = pc(t, u, o);
12598
12598
  return l.top = Mt(f.top, l.top), l.right = Pn(f.right, l.right), l.bottom = Pn(f.bottom, l.bottom), l.left = Mt(f.left, l.left), l;
12599
12599
  }, pc(t, a, o));
@@ -12625,7 +12625,7 @@ function uv(e, t, n) {
12625
12625
  c.x = Ps(o);
12626
12626
  }
12627
12627
  if (r || !r && !s)
12628
- if ((Mr(t) !== "body" || go(o)) && (a = _s(t)), r) {
12628
+ if ((Mr(t) !== "body" || go(o)) && (a = js(t)), r) {
12629
12629
  const p = rr(t, !0, s, t);
12630
12630
  c.x = p.x + t.clientLeft, c.y = p.y + t.clientTop;
12631
12631
  } else o && l();
@@ -12651,7 +12651,7 @@ function mc(e, t) {
12651
12651
  }
12652
12652
  function Wd(e, t) {
12653
12653
  const n = Ft(e);
12654
- if (js(e))
12654
+ if (_s(e))
12655
12655
  return n;
12656
12656
  if (!dn(e)) {
12657
12657
  let o = On(e);
@@ -12864,7 +12864,7 @@ function kv(e) {
12864
12864
  H !== S.current && (S.current = H, y(H));
12865
12865
  }, []), T = x.useCallback((H) => {
12866
12866
  H !== C.current && (C.current = H, w(H));
12867
- }, []), I = s || m, v = i || g, S = x.useRef(null), C = x.useRef(null), R = x.useRef(u), j = c != null, E = si(c), D = si(o), $ = si(l), z = x.useCallback(() => {
12867
+ }, []), I = s || m, v = i || g, S = x.useRef(null), C = x.useRef(null), R = x.useRef(u), _ = c != null, E = si(c), D = si(o), $ = si(l), z = x.useCallback(() => {
12868
12868
  if (!S.current || !C.current)
12869
12869
  return;
12870
12870
  const H = {
@@ -12901,7 +12901,7 @@ function kv(e) {
12901
12901
  return E.current(I, v, z);
12902
12902
  z();
12903
12903
  }
12904
- }, [I, v, z, E, j]);
12904
+ }, [I, v, z, E, _]);
12905
12905
  const V = x.useMemo(() => ({
12906
12906
  reference: S,
12907
12907
  floating: C,
@@ -12972,10 +12972,10 @@ const Iv = (e) => {
12972
12972
  }), Nv = (e, t) => ({
12973
12973
  ...yv(e),
12974
12974
  options: [e, t]
12975
- }), jv = (e, t) => ({
12975
+ }), _v = (e, t) => ({
12976
12976
  ...wv(e),
12977
12977
  options: [e, t]
12978
- }), _v = (e, t) => ({
12978
+ }), jv = (e, t) => ({
12979
12979
  ...bv(e),
12980
12980
  options: [e, t]
12981
12981
  }), Pv = (e, t) => ({
@@ -13054,7 +13054,7 @@ var Sa = "PopperContent", [$v, Fv] = Gd(Sa), ef = x.forwardRef(
13054
13054
  updatePositionStrategy: p = "optimized",
13055
13055
  onPlaced: m,
13056
13056
  ...y
13057
- } = e, g = Xd(Sa, n), [w, b] = x.useState(null), T = et(t, (ge) => b(ge)), [I, v] = x.useState(null), S = Dv(I), C = (S == null ? void 0 : S.width) ?? 0, R = (S == null ? void 0 : S.height) ?? 0, j = r + (s !== "center" ? "-" + s : ""), E = typeof u == "number" ? u : { top: 0, right: 0, bottom: 0, left: 0, ...u }, D = Array.isArray(l) ? l : [l], $ = D.length > 0, z = {
13057
+ } = e, g = Xd(Sa, n), [w, b] = x.useState(null), T = et(t, (ge) => b(ge)), [I, v] = x.useState(null), S = Dv(I), C = (S == null ? void 0 : S.width) ?? 0, R = (S == null ? void 0 : S.height) ?? 0, _ = r + (s !== "center" ? "-" + s : ""), E = typeof u == "number" ? u : { top: 0, right: 0, bottom: 0, left: 0, ...u }, D = Array.isArray(l) ? l : [l], $ = D.length > 0, z = {
13058
13058
  padding: E,
13059
13059
  boundary: D.filter(Bv),
13060
13060
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
@@ -13062,7 +13062,7 @@ var Sa = "PopperContent", [$v, Fv] = Gd(Sa), ef = x.forwardRef(
13062
13062
  }, { refs: M, floatingStyles: V, placement: q, isPositioned: ne, middlewareData: H } = kv({
13063
13063
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
13064
13064
  strategy: "fixed",
13065
- placement: j,
13065
+ placement: _,
13066
13066
  whileElementsMounted: (...ge) => mv(...ge, {
13067
13067
  animationFrame: p === "always"
13068
13068
  }),
@@ -13078,7 +13078,7 @@ var Sa = "PopperContent", [$v, Fv] = Gd(Sa), ef = x.forwardRef(
13078
13078
  ...z
13079
13079
  }),
13080
13080
  c && Nv({ ...z }),
13081
- jv({
13081
+ _v({
13082
13082
  ...z,
13083
13083
  apply: ({ elements: ge, rects: Ee, availableWidth: Ie, availableHeight: Ve }) => {
13084
13084
  const { width: Ze, height: Ge } = Ee.reference, Ke = ge.floating.style;
@@ -13087,7 +13087,7 @@ var Sa = "PopperContent", [$v, Fv] = Gd(Sa), ef = x.forwardRef(
13087
13087
  }),
13088
13088
  I && Pv({ element: I, padding: a }),
13089
13089
  Uv({ arrowWidth: C, arrowHeight: R }),
13090
- h && _v({ strategy: "referenceHidden", ...z })
13090
+ h && jv({ strategy: "referenceHidden", ...z })
13091
13091
  ]
13092
13092
  }), [U, ee] = rf(q), W = vt(m);
13093
13093
  un(() => {
@@ -13292,7 +13292,7 @@ function Xv(e) {
13292
13292
  let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
13293
13293
  return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
13294
13294
  }
13295
- var ii = "rovingFocusGroup.onEntryFocus", Jv = { bubbles: !1, cancelable: !0 }, xo = "RovingFocusGroup", [Oi, of, Zv] = jd(xo), [Qv, sf] = Fn(
13295
+ var ii = "rovingFocusGroup.onEntryFocus", Jv = { bubbles: !1, cancelable: !0 }, xo = "RovingFocusGroup", [Oi, of, Zv] = _d(xo), [Qv, sf] = Fn(
13296
13296
  xo,
13297
13297
  [Zv]
13298
13298
  ), [e0, t0] = Qv(xo), af = x.forwardRef(
@@ -13354,8 +13354,8 @@ var n0 = x.forwardRef((e, t) => {
13354
13354
  v.current = !0;
13355
13355
  }),
13356
13356
  onFocus: Se(e.onFocus, (R) => {
13357
- const j = !v.current;
13358
- if (R.target === R.currentTarget && j && !w) {
13357
+ const _ = !v.current;
13358
+ if (R.target === R.currentTarget && _ && !w) {
13359
13359
  const E = new CustomEvent(ii, Jv);
13360
13360
  if (R.currentTarget.dispatchEvent(E), !E.defaultPrevented) {
13361
13361
  const D = I().filter((q) => q.focusable), $ = D.find((q) => q.active), z = D.find((q) => q.id === y), V = [$, z, ...D].filter(
@@ -13734,7 +13734,7 @@ var I0 = function() {
13734
13734
  right: t[2],
13735
13735
  gap: Math.max(0, r - n + t[2] - t[0])
13736
13736
  };
13737
- }, j0 = gf(), Cr = "data-scroll-locked", _0 = function(e, t, n, r) {
13737
+ }, _0 = gf(), Cr = "data-scroll-locked", j0 = function(e, t, n, r) {
13738
13738
  var o = e.left, s = e.top, i = e.right, a = e.gap;
13739
13739
  return n === void 0 && (n = "margin"), `
13740
13740
  .`.concat(h0, ` {
@@ -13794,7 +13794,7 @@ var I0 = function() {
13794
13794
  var s = x.useMemo(function() {
13795
13795
  return N0(o);
13796
13796
  }, [o]);
13797
- return x.createElement(j0, { styles: _0(s, !t, o, n ? "" : "!important") });
13797
+ return x.createElement(_0, { styles: j0(s, !t, o, n ? "" : "!important") });
13798
13798
  }, Mi = !1;
13799
13799
  if (typeof window < "u")
13800
13800
  try {
@@ -13914,8 +13914,8 @@ function V0(e) {
13914
13914
  return !1;
13915
13915
  if (!r.current && "changedTouches" in y && (T || I) && (r.current = v), !v)
13916
13916
  return !0;
13917
- var j = r.current || v;
13918
- return B0(j, g, y, j === "h" ? T : I);
13917
+ var _ = r.current || v;
13918
+ return B0(_, g, y, _ === "h" ? T : I);
13919
13919
  }, []), c = x.useCallback(function(y) {
13920
13920
  var g = y;
13921
13921
  if (!(!gr.length || gr[gr.length - 1] !== s)) {
@@ -13982,7 +13982,7 @@ var Di = ["Enter", " "], G0 = ["ArrowDown", "PageUp", "Home"], bf = ["ArrowUp",
13982
13982
  }, J0 = {
13983
13983
  ltr: ["ArrowLeft"],
13984
13984
  rtl: ["ArrowRight"]
13985
- }, yo = "Menu", [no, Z0, Q0] = jd(yo), [dr, vf] = Fn(yo, [
13985
+ }, yo = "Menu", [no, Z0, Q0] = _d(yo), [dr, vf] = Fn(yo, [
13986
13986
  Q0,
13987
13987
  Yd,
13988
13988
  sf
@@ -14090,14 +14090,14 @@ var Ht = "MenuContent", [oS, Ra] = dr(Ht), If = x.forwardRef(
14090
14090
  onDismiss: p,
14091
14091
  disableOutsideScroll: m,
14092
14092
  ...y
14093
- } = e, g = fr(Ht, n), w = wo(Ht, n), b = Ms(n), T = Sf(n), I = Z0(n), [v, S] = x.useState(null), C = x.useRef(null), R = et(t, C, g.onContentChange), j = x.useRef(0), E = x.useRef(""), D = x.useRef(0), $ = x.useRef(null), z = x.useRef("right"), M = x.useRef(0), V = m ? Ta : x.Fragment, q = m ? { as: aS, allowPinchZoom: !0 } : void 0, ne = (U) => {
14093
+ } = e, g = fr(Ht, n), w = wo(Ht, n), b = Ms(n), T = Sf(n), I = Z0(n), [v, S] = x.useState(null), C = x.useRef(null), R = et(t, C, g.onContentChange), _ = x.useRef(0), E = x.useRef(""), D = x.useRef(0), $ = x.useRef(null), z = x.useRef("right"), M = x.useRef(0), V = m ? Ta : x.Fragment, q = m ? { as: aS, allowPinchZoom: !0 } : void 0, ne = (U) => {
14094
14094
  var Z, N;
14095
14095
  const ee = E.current + U, W = I().filter((B) => !B.disabled), P = document.activeElement, A = (Z = W.find((B) => B.ref.current === P)) == null ? void 0 : Z.textValue, L = W.map((B) => B.textValue), O = wS(L, ee, A), K = (N = W.find((B) => B.textValue === O)) == null ? void 0 : N.ref.current;
14096
14096
  (function B(Y) {
14097
- E.current = Y, window.clearTimeout(j.current), Y !== "" && (j.current = window.setTimeout(() => B(""), 1e3));
14097
+ E.current = Y, window.clearTimeout(_.current), Y !== "" && (_.current = window.setTimeout(() => B(""), 1e3));
14098
14098
  })(ee), K && setTimeout(() => K.focus());
14099
14099
  };
14100
- x.useEffect(() => () => window.clearTimeout(j.current), []), Od();
14100
+ x.useEffect(() => () => window.clearTimeout(_.current), []), Od();
14101
14101
  const H = x.useCallback((U) => {
14102
14102
  var W, P;
14103
14103
  return z.current === ((W = $.current) == null ? void 0 : W.side) && vS(U, (P = $.current) == null ? void 0 : P.area);
@@ -14186,7 +14186,7 @@ var Ht = "MenuContent", [oS, Ra] = dr(Ht), If = x.forwardRef(
14186
14186
  bf.includes(U.key) && K.reverse(), xS(K);
14187
14187
  }),
14188
14188
  onBlur: Se(e.onBlur, (U) => {
14189
- U.currentTarget.contains(U.target) || (window.clearTimeout(j.current), E.current = "");
14189
+ U.currentTarget.contains(U.target) || (window.clearTimeout(_.current), E.current = "");
14190
14190
  }),
14191
14191
  onPointerMove: Se(
14192
14192
  e.onPointerMove,
@@ -14306,7 +14306,7 @@ var Ef = x.forwardRef(
14306
14306
  "aria-checked": us(n) ? "mixed" : n,
14307
14307
  ...o,
14308
14308
  ref: t,
14309
- "data-state": ja(n),
14309
+ "data-state": _a(n),
14310
14310
  onSelect: Se(
14311
14311
  o.onSelect,
14312
14312
  () => r == null ? void 0 : r(us(n) ? !0 : !n),
@@ -14321,16 +14321,16 @@ var Nf = "MenuRadioGroup", [dS, fS] = dr(
14321
14321
  Nf,
14322
14322
  { value: void 0, onValueChange: () => {
14323
14323
  } }
14324
- ), jf = x.forwardRef(
14324
+ ), _f = x.forwardRef(
14325
14325
  (e, t) => {
14326
14326
  const { value: n, onValueChange: r, ...o } = e, s = vt(r);
14327
14327
  return /* @__PURE__ */ d.jsx(dS, { scope: e.__scopeMenu, value: n, onValueChange: s, children: /* @__PURE__ */ d.jsx(Aa, { ...o, ref: t }) });
14328
14328
  }
14329
14329
  );
14330
- jf.displayName = Nf;
14331
- var _f = "MenuRadioItem", Pf = x.forwardRef(
14330
+ _f.displayName = Nf;
14331
+ var jf = "MenuRadioItem", Pf = x.forwardRef(
14332
14332
  (e, t) => {
14333
- const { value: n, ...r } = e, o = fS(_f, e.__scopeMenu), s = n === o.value;
14333
+ const { value: n, ...r } = e, o = fS(jf, e.__scopeMenu), s = n === o.value;
14334
14334
  return /* @__PURE__ */ d.jsx(Of, { scope: e.__scopeMenu, checked: s, children: /* @__PURE__ */ d.jsx(
14335
14335
  Ds,
14336
14336
  {
@@ -14338,7 +14338,7 @@ var _f = "MenuRadioItem", Pf = x.forwardRef(
14338
14338
  "aria-checked": s,
14339
14339
  ...r,
14340
14340
  ref: t,
14341
- "data-state": ja(s),
14341
+ "data-state": _a(s),
14342
14342
  onSelect: Se(
14343
14343
  r.onSelect,
14344
14344
  () => {
@@ -14351,7 +14351,7 @@ var _f = "MenuRadioItem", Pf = x.forwardRef(
14351
14351
  ) });
14352
14352
  }
14353
14353
  );
14354
- Pf.displayName = _f;
14354
+ Pf.displayName = jf;
14355
14355
  var Na = "MenuItemIndicator", [Of, hS] = dr(
14356
14356
  Na,
14357
14357
  { checked: !1 }
@@ -14367,7 +14367,7 @@ var Na = "MenuItemIndicator", [Of, hS] = dr(
14367
14367
  {
14368
14368
  ...o,
14369
14369
  ref: t,
14370
- "data-state": ja(s.checked)
14370
+ "data-state": _a(s.checked)
14371
14371
  }
14372
14372
  )
14373
14373
  }
@@ -14416,7 +14416,7 @@ var gS = "MenuSub", [lk, $f] = dr(gS), Ur = "MenuSubTrigger", Ff = x.forwardRef(
14416
14416
  "aria-controls": o.contentId,
14417
14417
  "data-state": Uf(n.open),
14418
14418
  ...e,
14419
- ref: _n(t, o.onTriggerChange),
14419
+ ref: jn(t, o.onTriggerChange),
14420
14420
  onClick: (f) => {
14421
14421
  var h;
14422
14422
  (h = e.onClick) == null || h.call(e, f), !(e.disabled || f.defaultPrevented) && (f.currentTarget.focus(), n.open || n.onOpenChange(!0));
@@ -14510,7 +14510,7 @@ function Uf(e) {
14510
14510
  function us(e) {
14511
14511
  return e === "indeterminate";
14512
14512
  }
14513
- function ja(e) {
14513
+ function _a(e) {
14514
14514
  return us(e) ? "indeterminate" : e ? "checked" : "unchecked";
14515
14515
  }
14516
14516
  function xS(e) {
@@ -14547,7 +14547,7 @@ function vS(e, t) {
14547
14547
  function ro(e) {
14548
14548
  return (t) => t.pointerType === "mouse" ? e(t) : void 0;
14549
14549
  }
14550
- var SS = Cf, CS = ka, TS = kf, kS = If, IS = Aa, RS = Rf, ES = Ds, AS = Af, NS = jf, jS = Pf, _S = Mf, PS = Df, OS = Lf, MS = Ff, DS = Bf, Ls = "DropdownMenu", [LS, ck] = Fn(
14550
+ var SS = Cf, CS = ka, TS = kf, kS = If, IS = Aa, RS = Rf, ES = Ds, AS = Af, NS = _f, _S = Pf, jS = Mf, PS = Df, OS = Lf, MS = Ff, DS = Bf, Ls = "DropdownMenu", [LS, ck] = Fn(
14551
14551
  Ls,
14552
14552
  [vf]
14553
14553
  ), kt = vf(), [$S, Hf] = LS(Ls), Wf = (e) => {
@@ -14596,7 +14596,7 @@ var Vf = "DropdownMenuTrigger", Kf = x.forwardRef(
14596
14596
  "data-disabled": r ? "" : void 0,
14597
14597
  disabled: r,
14598
14598
  ...o,
14599
- ref: _n(t, s.triggerRef),
14599
+ ref: jn(t, s.triggerRef),
14600
14600
  onPointerDown: Se(e.onPointerDown, (a) => {
14601
14601
  !r && a.button === 0 && a.ctrlKey === !1 && (s.onOpenToggle(), s.open || a.preventDefault());
14602
14602
  }),
@@ -14678,12 +14678,12 @@ var VS = "DropdownMenuRadioGroup", KS = x.forwardRef((e, t) => {
14678
14678
  KS.displayName = VS;
14679
14679
  var qS = "DropdownMenuRadioItem", Qf = x.forwardRef((e, t) => {
14680
14680
  const { __scopeDropdownMenu: n, ...r } = e, o = kt(n);
14681
- return /* @__PURE__ */ d.jsx(jS, { ...o, ...r, ref: t });
14681
+ return /* @__PURE__ */ d.jsx(_S, { ...o, ...r, ref: t });
14682
14682
  });
14683
14683
  Qf.displayName = qS;
14684
14684
  var GS = "DropdownMenuItemIndicator", eh = x.forwardRef((e, t) => {
14685
14685
  const { __scopeDropdownMenu: n, ...r } = e, o = kt(n);
14686
- return /* @__PURE__ */ d.jsx(_S, { ...o, ...r, ref: t });
14686
+ return /* @__PURE__ */ d.jsx(jS, { ...o, ...r, ref: t });
14687
14687
  });
14688
14688
  eh.displayName = GS;
14689
14689
  var YS = "DropdownMenuSeparator", th = x.forwardRef((e, t) => {
@@ -14724,7 +14724,7 @@ var QS = "DropdownMenuSubContent", rh = x.forwardRef((e, t) => {
14724
14724
  });
14725
14725
  rh.displayName = QS;
14726
14726
  var eC = Wf, tC = Kf, nC = qf, oh = Yf, sh = Xf, ih = Jf, ah = Zf, lh = Qf, ch = eh, uh = th, dh = nh, fh = rh;
14727
- const _a = eC, Pa = tC, rC = x.forwardRef(({ className: e, inset: t, children: n, ...r }, o) => /* @__PURE__ */ d.jsxs(
14727
+ const ja = eC, Pa = tC, rC = x.forwardRef(({ className: e, inset: t, children: n, ...r }, o) => /* @__PURE__ */ d.jsxs(
14728
14728
  dh,
14729
14729
  {
14730
14730
  ref: o,
@@ -14868,9 +14868,9 @@ function uC({
14868
14868
  validate: y,
14869
14869
  onValidationError: g
14870
14870
  }) {
14871
- const w = i !== void 0, [b, T] = Q.useState(e), I = (w ? i : b) ?? "", [v, S] = Q.useTransition(), C = Q.useRef(null), R = Q.useRef(0), j = Q.useRef(null), E = Q.useRef("");
14871
+ const w = i !== void 0, [b, T] = Q.useState(e), I = (w ? i : b) ?? "", [v, S] = Q.useTransition(), C = Q.useRef(null), R = Q.useRef(0), _ = Q.useRef(null), E = Q.useRef("");
14872
14872
  Q.useEffect(() => {
14873
- if (!w && (T(e ?? ""), j.current = null, C.current)) {
14873
+ if (!w && (T(e ?? ""), _.current = null, C.current)) {
14874
14874
  const L = !e || e.trim() === "", O = 44;
14875
14875
  L ? C.current.style.height = `${O}px` : (C.current.style.height = "auto", C.current.style.height = `${Math.max(C.current.scrollHeight, O)}px`);
14876
14876
  }
@@ -14916,7 +14916,7 @@ function uC({
14916
14916
  if (!O && !p || V(O))
14917
14917
  return;
14918
14918
  const K = ++R.current;
14919
- j.current = {
14919
+ _.current = {
14920
14920
  id: K,
14921
14921
  shouldClear: !0
14922
14922
  }, S(() => {
@@ -14925,20 +14925,20 @@ function uC({
14925
14925
  const Y = c(O);
14926
14926
  Y && typeof Y.then == "function" ? Y.then(() => {
14927
14927
  var ae, pe;
14928
- ((ae = j.current) == null ? void 0 : ae.id) === K && j.current.shouldClear && (w || (T(""), C.current && (C.current.style.height = "auto"), a == null || a(""))), ((pe = j.current) == null ? void 0 : pe.id) === K && (j.current = null);
14928
+ ((ae = _.current) == null ? void 0 : ae.id) === K && _.current.shouldClear && (w || (T(""), C.current && (C.current.style.height = "auto"), a == null || a(""))), ((pe = _.current) == null ? void 0 : pe.id) === K && (_.current = null);
14929
14929
  }).catch(() => {
14930
14930
  var ae;
14931
- ((ae = j.current) == null ? void 0 : ae.id) === K && (j.current = null);
14932
- }) : (((Z = j.current) == null ? void 0 : Z.id) === K && j.current.shouldClear && (w || (T(""), C.current && (C.current.style.height = "auto"), a == null || a(""))), ((N = j.current) == null ? void 0 : N.id) === K && (j.current = null));
14931
+ ((ae = _.current) == null ? void 0 : ae.id) === K && (_.current = null);
14932
+ }) : (((Z = _.current) == null ? void 0 : Z.id) === K && _.current.shouldClear && (w || (T(""), C.current && (C.current.style.height = "auto"), a == null || a(""))), ((N = _.current) == null ? void 0 : N.id) === K && (_.current = null));
14933
14933
  } catch {
14934
- ((B = j.current) == null ? void 0 : B.id) === K && (j.current = null);
14934
+ ((B = _.current) == null ? void 0 : B.id) === K && (_.current = null);
14935
14935
  }
14936
14936
  });
14937
14937
  },
14938
14938
  [I, c, p, w, a, V]
14939
14939
  ), U = Q.useCallback((L) => {
14940
14940
  const O = L.target.value;
14941
- ne(O, { fromUser: !0 }), j.current && (j.current.shouldClear = !1), C.current && (C.current.style.height = "auto", C.current.style.height = `${C.current.scrollHeight}px`), D && V(O.trim());
14941
+ ne(O, { fromUser: !0 }), _.current && (_.current.shouldClear = !1), C.current && (C.current.style.height = "auto", C.current.style.height = `${C.current.scrollHeight}px`), D && V(O.trim());
14942
14942
  }, [ne, V, D]), ee = Q.useCallback(
14943
14943
  (L) => {
14944
14944
  L.key === "Enter" && !L.shiftKey ? (L.preventDefault(), H()) : L.key === "Escape" && t && (L.preventDefault(), l == null || l());
@@ -15015,7 +15015,7 @@ function ph({
15015
15015
  allowEmptySend: w = !1,
15016
15016
  inputError: b = null
15017
15017
  }) {
15018
- const [T, I] = ue([]), v = Te(null), S = Te(null), [C, R] = ue(0), [j, E] = ue(0), [D, $] = ue(!1), [z, M] = ue(null), [V, q] = ue(null), ne = ie(() => {
15018
+ const [T, I] = ue([]), v = Te(null), S = Te(null), [C, R] = ue(0), [_, E] = ue(0), [D, $] = ue(!1), [z, M] = ue(null), [V, q] = ue(null), ne = ie(() => {
15019
15019
  v.current && (v.current.value = ""), S.current && (S.current.value = ""), R((O) => O + 1), E((O) => O + 1);
15020
15020
  }, []), H = ie((O) => {
15021
15021
  I((K) => {
@@ -15103,7 +15103,7 @@ function ph({
15103
15103
  onChange: W,
15104
15104
  className: "hidden"
15105
15105
  },
15106
- j
15106
+ _
15107
15107
  ),
15108
15108
  D && /* @__PURE__ */ d.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15109
15109
  /* @__PURE__ */ d.jsx(Gn, { className: "h-4 w-4 animate-spin" }),
@@ -15114,7 +15114,7 @@ function ph({
15114
15114
  ] })
15115
15115
  ] }),
15116
15116
  /* @__PURE__ */ d.jsxs("div", { className: "flex items-end gap-2", children: [
15117
- (h || p) && /* @__PURE__ */ d.jsxs(_a, { children: [
15117
+ (h || p) && /* @__PURE__ */ d.jsxs(ja, { children: [
15118
15118
  /* @__PURE__ */ d.jsx(Pa, { asChild: !0, children: /* @__PURE__ */ d.jsx(
15119
15119
  tt,
15120
15120
  {
@@ -15195,17 +15195,17 @@ function fC({
15195
15195
  onEvent: f,
15196
15196
  activeThreadId: h
15197
15197
  }) {
15198
- const { messages: p } = Iu(), [m, y] = ue(null), [g, w] = ue(""), [b, T] = ue(null), [I, v] = ue(null), [S, C] = ue(!1), [R, j] = ue(""), E = Te(R), D = Te(null);
15198
+ const { messages: p } = Iu(), [m, y] = ue(null), [g, w] = ue(""), [b, T] = ue(null), [I, v] = ue(null), [S, C] = ue(!1), [R, _] = ue(""), E = Te(R), D = Te(null);
15199
15199
  qe(() => {
15200
15200
  if (!m)
15201
15201
  if (h) {
15202
15202
  const W = localStorage.getItem(Gs(h));
15203
- j(W || "");
15203
+ _(W || "");
15204
15204
  } else
15205
- j("");
15205
+ _("");
15206
15206
  }, [h, m]);
15207
15207
  const $ = ie((W) => {
15208
- j(W), !m && h && localStorage.setItem(Gs(h), W);
15208
+ _(W), !m && h && localStorage.setItem(Gs(h), W);
15209
15209
  }, [h, m]);
15210
15210
  qe(() => {
15211
15211
  E.current = R;
@@ -15296,7 +15296,7 @@ function fC({
15296
15296
  ), H = ie(() => {
15297
15297
  y(null), w(""), T(null), v(null);
15298
15298
  const W = D.current;
15299
- W !== null && j(W), D.current = null;
15299
+ W !== null && _(W), D.current = null;
15300
15300
  }, []), U = ie((W) => {
15301
15301
  let P = null;
15302
15302
  for (let K = W - 1; K >= 0; K--)
@@ -15567,8 +15567,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
15567
15567
  const o = (s = e.current) == null ? void 0 : s.getAttribute("aria-describedby");
15568
15568
  t && o && (document.getElementById(t) || console.warn(r));
15569
15569
  }, [r, e, t]), null;
15570
- }, Nh = gh, jh = wh, La = bh, $a = vh, Kr = Ch, _h = kh, CC = Rh;
15571
- const Ph = Nh, TC = jh, Oh = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
15570
+ }, Nh = gh, _h = wh, La = bh, $a = vh, Kr = Ch, jh = kh, CC = Rh;
15571
+ const Ph = Nh, TC = _h, Oh = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
15572
15572
  La,
15573
15573
  {
15574
15574
  ref: n,
@@ -15647,14 +15647,14 @@ const Ba = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
15647
15647
  ));
15648
15648
  Ba.displayName = Kr.displayName;
15649
15649
  const Mh = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
15650
- _h,
15650
+ jh,
15651
15651
  {
15652
15652
  ref: n,
15653
15653
  className: de("text-sm text-muted-foreground", e),
15654
15654
  ...t
15655
15655
  }
15656
15656
  ));
15657
- Mh.displayName = _h.displayName;
15657
+ Mh.displayName = jh.displayName;
15658
15658
  function kC(e, [t, n]) {
15659
15659
  return Math.min(n, Math.max(t, e));
15660
15660
  }
@@ -15669,7 +15669,7 @@ var Ua = "ScrollArea", [Dh, fk] = Fn(Ua), [RC, Wt] = Dh(Ua), Lh = x.forwardRef(
15669
15669
  dir: o,
15670
15670
  scrollHideDelay: s = 600,
15671
15671
  ...i
15672
- } = e, [a, c] = x.useState(null), [l, u] = x.useState(null), [f, h] = x.useState(null), [p, m] = x.useState(null), [y, g] = x.useState(null), [w, b] = x.useState(0), [T, I] = x.useState(0), [v, S] = x.useState(!1), [C, R] = x.useState(!1), j = et(t, (D) => c(D)), E = fa(o);
15672
+ } = e, [a, c] = x.useState(null), [l, u] = x.useState(null), [f, h] = x.useState(null), [p, m] = x.useState(null), [y, g] = x.useState(null), [w, b] = x.useState(0), [T, I] = x.useState(0), [v, S] = x.useState(!1), [C, R] = x.useState(!1), _ = et(t, (D) => c(D)), E = fa(o);
15673
15673
  return /* @__PURE__ */ d.jsx(
15674
15674
  RC,
15675
15675
  {
@@ -15697,7 +15697,7 @@ var Ua = "ScrollArea", [Dh, fk] = Fn(Ua), [RC, Wt] = Dh(Ua), Lh = x.forwardRef(
15697
15697
  {
15698
15698
  dir: E,
15699
15699
  ...i,
15700
- ref: j,
15700
+ ref: _,
15701
15701
  style: {
15702
15702
  position: "relative",
15703
15703
  // Pass corner sizes as CSS vars to reduce re-renders of context consumers
@@ -15881,7 +15881,7 @@ var EC = x.forwardRef((e, t) => {
15881
15881
  }
15882
15882
  }
15883
15883
  ) : n === "vertical" ? /* @__PURE__ */ d.jsx(
15884
- jC,
15884
+ _C,
15885
15885
  {
15886
15886
  ...u,
15887
15887
  ref: t,
@@ -15938,7 +15938,7 @@ var EC = x.forwardRef((e, t) => {
15938
15938
  }
15939
15939
  }
15940
15940
  );
15941
- }), jC = x.forwardRef((e, t) => {
15941
+ }), _C = x.forwardRef((e, t) => {
15942
15942
  const { sizes: n, onSizesChange: r, ...o } = e, s = Wt(pn, e.__scopeScrollArea), [i, a] = x.useState(), c = x.useRef(null), l = et(t, c, s.onScrollbarYChange);
15943
15943
  return x.useEffect(() => {
15944
15944
  c.current && a(getComputedStyle(c.current));
@@ -15978,7 +15978,7 @@ var EC = x.forwardRef((e, t) => {
15978
15978
  }
15979
15979
  }
15980
15980
  );
15981
- }), [_C, Bh] = Dh(pn), Uh = x.forwardRef((e, t) => {
15981
+ }), [jC, Bh] = Dh(pn), Uh = x.forwardRef((e, t) => {
15982
15982
  const {
15983
15983
  __scopeScrollArea: n,
15984
15984
  sizes: r,
@@ -15991,21 +15991,21 @@ var EC = x.forwardRef((e, t) => {
15991
15991
  onWheelScroll: u,
15992
15992
  onResize: f,
15993
15993
  ...h
15994
- } = e, p = Wt(pn, n), [m, y] = x.useState(null), g = et(t, (j) => y(j)), w = x.useRef(null), b = x.useRef(""), T = p.viewport, I = r.content - r.viewport, v = vt(u), S = vt(c), C = Bs(f, 10);
15995
- function R(j) {
15994
+ } = e, p = Wt(pn, n), [m, y] = x.useState(null), g = et(t, (_) => y(_)), w = x.useRef(null), b = x.useRef(""), T = p.viewport, I = r.content - r.viewport, v = vt(u), S = vt(c), C = Bs(f, 10);
15995
+ function R(_) {
15996
15996
  if (w.current) {
15997
- const E = j.clientX - w.current.left, D = j.clientY - w.current.top;
15997
+ const E = _.clientX - w.current.left, D = _.clientY - w.current.top;
15998
15998
  l({ x: E, y: D });
15999
15999
  }
16000
16000
  }
16001
16001
  return x.useEffect(() => {
16002
- const j = (E) => {
16002
+ const _ = (E) => {
16003
16003
  const D = E.target;
16004
16004
  (m == null ? void 0 : m.contains(D)) && v(E, I);
16005
16005
  };
16006
- return document.addEventListener("wheel", j, { passive: !1 }), () => document.removeEventListener("wheel", j, { passive: !1 });
16006
+ return document.addEventListener("wheel", _, { passive: !1 }), () => document.removeEventListener("wheel", _, { passive: !1 });
16007
16007
  }, [T, m, I, v]), x.useEffect(S, [r, S]), Er(m, C), Er(p.content, C), /* @__PURE__ */ d.jsx(
16008
- _C,
16008
+ jC,
16009
16009
  {
16010
16010
  scope: n,
16011
16011
  scrollbar: m,
@@ -16020,13 +16020,13 @@ var EC = x.forwardRef((e, t) => {
16020
16020
  ...h,
16021
16021
  ref: g,
16022
16022
  style: { position: "absolute", ...h.style },
16023
- onPointerDown: Se(e.onPointerDown, (j) => {
16024
- j.button === 0 && (j.target.setPointerCapture(j.pointerId), w.current = m.getBoundingClientRect(), b.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", p.viewport && (p.viewport.style.scrollBehavior = "auto"), R(j));
16023
+ onPointerDown: Se(e.onPointerDown, (_) => {
16024
+ _.button === 0 && (_.target.setPointerCapture(_.pointerId), w.current = m.getBoundingClientRect(), b.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", p.viewport && (p.viewport.style.scrollBehavior = "auto"), R(_));
16025
16025
  }),
16026
16026
  onPointerMove: Se(e.onPointerMove, R),
16027
- onPointerUp: Se(e.onPointerUp, (j) => {
16028
- const E = j.target;
16029
- E.hasPointerCapture(j.pointerId) && E.releasePointerCapture(j.pointerId), document.body.style.webkitUserSelect = b.current, p.viewport && (p.viewport.style.scrollBehavior = ""), w.current = null;
16027
+ onPointerUp: Se(e.onPointerUp, (_) => {
16028
+ const E = _.target;
16029
+ E.hasPointerCapture(_.pointerId) && E.releasePointerCapture(_.pointerId), document.body.style.webkitUserSelect = b.current, p.viewport && (p.viewport.style.scrollBehavior = ""), w.current = null;
16030
16030
  })
16031
16031
  }
16032
16032
  )
@@ -16275,7 +16275,7 @@ function Ko({
16275
16275
  },
16276
16276
  // Handled by stream state
16277
16277
  activeThreadId: I ?? null
16278
- }), R = v.interrupt, j = R ? gu(R.id) : null, E = j !== null ? { type: "interrupt", id: j } : null, [D, $] = ue(!1), [z, M] = ue("desktop"), [V, q] = ue(!1), [ne, H] = ue(null), U = Te(null);
16278
+ }), R = v.interrupt, _ = R ? gu(R.id) : null, E = _ !== null ? { type: "interrupt", id: _ } : null, [D, $] = ue(!1), [z, M] = ue("desktop"), [V, q] = ue(!1), [ne, H] = ue(null), U = Te(null);
16279
16279
  qe(() => {
16280
16280
  const Y = () => {
16281
16281
  const ae = window.innerWidth;
@@ -16477,7 +16477,7 @@ var zr = '[cmdk-group=""]', hi = '[cmdk-group-items=""]', YC = '[cmdk-group-head
16477
16477
  i.current.forEach((P) => P());
16478
16478
  } }), []), R = x.useMemo(() => ({ value: (P, A, L) => {
16479
16479
  var O;
16480
- A !== ((O = s.current.get(P)) == null ? void 0 : O.value) && (s.current.set(P, { value: A, keywords: L }), n.current.filtered.items.set(P, j(A, L)), S(2, () => {
16480
+ A !== ((O = s.current.get(P)) == null ? void 0 : O.value) && (s.current.set(P, { value: A, keywords: L }), n.current.filtered.items.set(P, _(A, L)), S(2, () => {
16481
16481
  E(), C.emit();
16482
16482
  }));
16483
16483
  }, item: (P, A) => (r.current.add(P), A && (o.current.has(A) ? o.current.get(A).add(P) : o.current.set(A, /* @__PURE__ */ new Set([P]))), S(3, () => {
@@ -16491,7 +16491,7 @@ var zr = '[cmdk-group=""]', hi = '[cmdk-group-items=""]', YC = '[cmdk-group-head
16491
16491
  }), group: (P) => (o.current.has(P) || o.current.set(P, /* @__PURE__ */ new Set()), () => {
16492
16492
  s.current.delete(P), o.current.delete(P);
16493
16493
  }), filter: () => a.current.shouldFilter, label: c || e["aria-label"], getDisablePointerSelection: () => a.current.disablePointerSelection, listId: b, inputId: I, labelId: T, listInnerRef: v }), []);
16494
- function j(P, A) {
16494
+ function _(P, A) {
16495
16495
  var L, O;
16496
16496
  let K = (O = (L = a.current) == null ? void 0 : L.filter) != null ? O : XC;
16497
16497
  return P ? K(P, n.current.search, A) : 0;
@@ -16533,7 +16533,7 @@ var zr = '[cmdk-group=""]', hi = '[cmdk-group-items=""]', YC = '[cmdk-group-head
16533
16533
  n.current.filtered.groups = /* @__PURE__ */ new Set();
16534
16534
  let K = 0;
16535
16535
  for (let Z of r.current) {
16536
- let N = (A = (P = s.current.get(Z)) == null ? void 0 : P.value) != null ? A : "", B = (O = (L = s.current.get(Z)) == null ? void 0 : L.keywords) != null ? O : [], Y = j(N, B);
16536
+ let N = (A = (P = s.current.get(Z)) == null ? void 0 : P.value) != null ? A : "", B = (O = (L = s.current.get(Z)) == null ? void 0 : L.keywords) != null ? O : [], Y = _(N, B);
16537
16537
  n.current.filtered.items.set(Z, Y), Y > 0 && K++;
16538
16538
  }
16539
16539
  for (let [Z, N] of o.current) for (let B of N) if (n.current.filtered.items.get(B) > 0) {
@@ -16635,15 +16635,15 @@ var zr = '[cmdk-group=""]', hi = '[cmdk-group-items=""]', YC = '[cmdk-group-head
16635
16635
  }
16636
16636
  if (!p) return null;
16637
16637
  let { disabled: g, value: w, onSelect: b, forceMount: T, keywords: I, ...v } = e;
16638
- return x.createElement(Ne.div, { ref: _n(s, t), ...v, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!g, "aria-selected": !!h, "data-disabled": !!g, "data-selected": !!h, onPointerMove: g || a.getDisablePointerSelection() ? void 0 : y, onClick: g ? void 0 : m }, e.children);
16638
+ return x.createElement(Ne.div, { ref: jn(s, t), ...v, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!g, "aria-selected": !!h, "data-disabled": !!g, "data-selected": !!h, onPointerMove: g || a.getDisablePointerSelection() ? void 0 : y, onClick: g ? void 0 : m }, e.children);
16639
16639
  }), ZC = x.forwardRef((e, t) => {
16640
16640
  let { heading: n, children: r, forceMount: o, ...s } = e, i = $t(), a = x.useRef(null), c = x.useRef(null), l = $t(), u = bo(), f = Mn((p) => o || u.filter() === !1 ? !0 : p.search ? p.filtered.groups.has(i) : !0);
16641
16641
  sr(() => u.group(i), []), rp(i, a, [e.value, e.heading, c]);
16642
16642
  let h = x.useMemo(() => ({ id: i, forceMount: o }), [o]);
16643
- return x.createElement(Ne.div, { ref: _n(a, t), ...s, "cmdk-group": "", role: "presentation", hidden: f ? void 0 : !0 }, n && x.createElement("div", { ref: c, "cmdk-group-heading": "", "aria-hidden": !0, id: l }, n), Us(e, (p) => x.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? l : void 0 }, x.createElement(ep.Provider, { value: h }, p))));
16643
+ return x.createElement(Ne.div, { ref: jn(a, t), ...s, "cmdk-group": "", role: "presentation", hidden: f ? void 0 : !0 }, n && x.createElement("div", { ref: c, "cmdk-group-heading": "", "aria-hidden": !0, id: l }, n), Us(e, (p) => x.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? l : void 0 }, x.createElement(ep.Provider, { value: h }, p))));
16644
16644
  }), QC = x.forwardRef((e, t) => {
16645
16645
  let { alwaysRender: n, ...r } = e, o = x.useRef(null), s = Mn((i) => !i.search);
16646
- return !n && !s ? null : x.createElement(Ne.div, { ref: _n(o, t), ...r, "cmdk-separator": "", role: "separator" });
16646
+ return !n && !s ? null : x.createElement(Ne.div, { ref: jn(o, t), ...r, "cmdk-separator": "", role: "separator" });
16647
16647
  }), eT = x.forwardRef((e, t) => {
16648
16648
  let { onValueChange: n, ...r } = e, o = e.value != null, s = qa(), i = Mn((l) => l.search), a = Mn((l) => l.selectedItemId), c = bo();
16649
16649
  return x.useEffect(() => {
@@ -16665,14 +16665,14 @@ var zr = '[cmdk-group=""]', hi = '[cmdk-group-items=""]', YC = '[cmdk-group-head
16665
16665
  cancelAnimationFrame(f), h.unobserve(l);
16666
16666
  };
16667
16667
  }
16668
- }, []), x.createElement(Ne.div, { ref: _n(s, t), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": a, "aria-label": r, id: c.listId }, Us(e, (l) => x.createElement("div", { ref: _n(i, c.listInnerRef), "cmdk-list-sizer": "" }, l)));
16668
+ }, []), x.createElement(Ne.div, { ref: jn(s, t), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": a, "aria-label": r, id: c.listId }, Us(e, (l) => x.createElement("div", { ref: jn(i, c.listInnerRef), "cmdk-list-sizer": "" }, l)));
16669
16669
  }), nT = x.forwardRef((e, t) => {
16670
16670
  let { open: n, onOpenChange: r, overlayClassName: o, contentClassName: s, container: i, ...a } = e;
16671
- return x.createElement(Nh, { open: n, onOpenChange: r }, x.createElement(jh, { container: i }, x.createElement(La, { "cmdk-overlay": "", className: o }), x.createElement($a, { "aria-label": e.label, "cmdk-dialog": "", className: s }, x.createElement(tp, { ref: t, ...a }))));
16671
+ return x.createElement(Nh, { open: n, onOpenChange: r }, x.createElement(_h, { container: i }, x.createElement(La, { "cmdk-overlay": "", className: o }), x.createElement($a, { "aria-label": e.label, "cmdk-dialog": "", className: s }, x.createElement(tp, { ref: t, ...a }))));
16672
16672
  }), rT = x.forwardRef((e, t) => Mn((n) => n.filtered.count === 0) ? x.createElement(Ne.div, { ref: t, ...e, "cmdk-empty": "", role: "presentation" }) : null), oT = x.forwardRef((e, t) => {
16673
16673
  let { progress: n, children: r, label: o = "Loading...", ...s } = e;
16674
16674
  return x.createElement(Ne.div, { ref: t, ...s, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, Us(e, (i) => x.createElement("div", { "aria-hidden": !0 }, i)));
16675
- }), jt = Object.assign(tp, { List: tT, Item: JC, Input: eT, Group: ZC, Separator: QC, Dialog: nT, Empty: rT, Loading: oT });
16675
+ }), _t = Object.assign(tp, { List: tT, Item: JC, Input: eT, Group: ZC, Separator: QC, Dialog: nT, Empty: rT, Loading: oT });
16676
16676
  function sT(e, t) {
16677
16677
  let n = e.nextElementSibling;
16678
16678
  for (; n; ) {
@@ -16733,7 +16733,7 @@ function Us({ asChild: e, children: t }, n) {
16733
16733
  }
16734
16734
  var cT = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
16735
16735
  const op = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
16736
- jt,
16736
+ _t,
16737
16737
  {
16738
16738
  ref: n,
16739
16739
  className: de(
@@ -16743,11 +16743,11 @@ const op = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
16743
16743
  ...t
16744
16744
  }
16745
16745
  ));
16746
- op.displayName = jt.displayName;
16746
+ op.displayName = _t.displayName;
16747
16747
  const sp = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
16748
16748
  /* @__PURE__ */ d.jsx(zp, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
16749
16749
  /* @__PURE__ */ d.jsx(
16750
- jt.Input,
16750
+ _t.Input,
16751
16751
  {
16752
16752
  ref: n,
16753
16753
  className: de(
@@ -16758,27 +16758,27 @@ const sp = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsxs("d
16758
16758
  }
16759
16759
  )
16760
16760
  ] }));
16761
- sp.displayName = jt.Input.displayName;
16761
+ sp.displayName = _t.Input.displayName;
16762
16762
  const ip = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
16763
- jt.List,
16763
+ _t.List,
16764
16764
  {
16765
16765
  ref: n,
16766
16766
  className: de("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
16767
16767
  ...t
16768
16768
  }
16769
16769
  ));
16770
- ip.displayName = jt.List.displayName;
16770
+ ip.displayName = _t.List.displayName;
16771
16771
  const ap = x.forwardRef((e, t) => /* @__PURE__ */ d.jsx(
16772
- jt.Empty,
16772
+ _t.Empty,
16773
16773
  {
16774
16774
  ref: t,
16775
16775
  className: "py-6 text-center text-sm",
16776
16776
  ...e
16777
16777
  }
16778
16778
  ));
16779
- ap.displayName = jt.Empty.displayName;
16779
+ ap.displayName = _t.Empty.displayName;
16780
16780
  const lp = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
16781
- jt.Group,
16781
+ _t.Group,
16782
16782
  {
16783
16783
  ref: n,
16784
16784
  className: de(
@@ -16788,18 +16788,18 @@ const lp = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
16788
16788
  ...t
16789
16789
  }
16790
16790
  ));
16791
- lp.displayName = jt.Group.displayName;
16791
+ lp.displayName = _t.Group.displayName;
16792
16792
  const uT = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
16793
- jt.Separator,
16793
+ _t.Separator,
16794
16794
  {
16795
16795
  ref: n,
16796
16796
  className: de("-mx-1 h-px bg-border", e),
16797
16797
  ...t
16798
16798
  }
16799
16799
  ));
16800
- uT.displayName = jt.Separator.displayName;
16800
+ uT.displayName = _t.Separator.displayName;
16801
16801
  const cp = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
16802
- jt.Item,
16802
+ _t.Item,
16803
16803
  {
16804
16804
  ref: n,
16805
16805
  className: de(
@@ -16809,7 +16809,7 @@ const cp = x.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsx(
16809
16809
  ...t
16810
16810
  }
16811
16811
  ));
16812
- cp.displayName = jt.Item.displayName;
16812
+ cp.displayName = _t.Item.displayName;
16813
16813
  function Ec({
16814
16814
  thread: e,
16815
16815
  isActive: t = !1,
@@ -16865,7 +16865,7 @@ function Ec({
16865
16865
  /* @__PURE__ */ d.jsx(tt, { size: "sm", variant: "ghost", className: "h-7 px-2 text-xs", onClick: (R) => {
16866
16866
  R.stopPropagation(), c == null || c(e);
16867
16867
  }, children: "Cancel" })
16868
- ] }) : /* @__PURE__ */ d.jsxs(_a, { onOpenChange: (R) => p == null ? void 0 : p(e.threadId, R), children: [
16868
+ ] }) : /* @__PURE__ */ d.jsxs(ja, { onOpenChange: (R) => p == null ? void 0 : p(e.threadId, R), children: [
16869
16869
  /* @__PURE__ */ d.jsx(Pa, { asChild: !0, children: /* @__PURE__ */ d.jsxs(
16870
16870
  tt,
16871
16871
  {
@@ -17069,7 +17069,7 @@ function Fi({
17069
17069
  groupBy: S,
17070
17070
  filter: C
17071
17071
  }) {
17072
- const { chatApi: R, authApi: j } = uo(), {
17072
+ const { chatApi: R, authApi: _ } = uo(), {
17073
17073
  threads: E,
17074
17074
  sharedThreads: D,
17075
17075
  currentThreadId: $,
@@ -17080,12 +17080,12 @@ function Fi({
17080
17080
  shareInFlight: ne,
17081
17081
  shareStatus: H,
17082
17082
  clearShareStatus: U
17083
- } = ws(), { createThread: ee, deleteThread: W, renameThread: P, shareThread: A } = q, { loadThread: L } = vs(), O = c ?? $, [K, Z] = ue(Array.isArray(E) ? E : []), N = Te(K.length > 0), B = Te(null), Y = Te(0), [ae, pe] = ue(null), [ge, Ee] = ue(""), [Ie, Ve] = ue(!1), [Ze, Ge] = ue(!1), [Ke, dt] = ue(null), [ft, nt] = ue(""), [lt, ht] = ue([]), [je, rt] = ue(!1), Ye = ie((_) => Ee(_), []);
17083
+ } = ws(), { createThread: ee, deleteThread: W, renameThread: P, shareThread: A } = q, { loadThread: L } = vs(), O = c ?? $, [K, Z] = ue(Array.isArray(E) ? E : []), N = Te(K.length > 0), B = Te(null), Y = Te(0), [ae, pe] = ue(null), [ge, Ee] = ue(""), [Ie, Ve] = ue(!1), [Ze, Ge] = ue(!1), [Ke, dt] = ue(null), [ft, nt] = ue(""), [lt, ht] = ue([]), [_e, rt] = ue(!1), Ye = ie((j) => Ee(j), []);
17084
17084
  qe(() => {
17085
- Ze && !T && lt.length === 0 && !je && (async () => {
17085
+ Ze && !T && lt.length === 0 && !_e && (async () => {
17086
17086
  rt(!0);
17087
17087
  try {
17088
- const se = (await j.listUsers()).filter((oe) => oe.id || oe.user_id).map((oe) => ({
17088
+ const se = (await _.listUsers()).filter((oe) => oe.id || oe.user_id).map((oe) => ({
17089
17089
  type: "user",
17090
17090
  value: oe.user_id || oe.id || "",
17091
17091
  id: oe.user_id || oe.id || "",
@@ -17099,32 +17099,32 @@ function Fi({
17099
17099
  rt(!1);
17100
17100
  }
17101
17101
  })();
17102
- }, [Ze, T, lt.length, je, R]);
17103
- const ot = T ?? lt, xt = I ?? je, Ct = g && g.length > 0 ? g : vT, Ue = bT({ defaultView: m }), pt = w ?? Ue, zn = p ?? pt.view, Vt = ie(
17104
- (_) => {
17105
- p || pt.setView(_), y == null || y(_);
17102
+ }, [Ze, T, lt.length, _e, R]);
17103
+ const ot = T ?? lt, xt = I ?? _e, Ct = g && g.length > 0 ? g : vT, Ue = bT({ defaultView: m }), pt = w ?? Ue, zn = p ?? pt.view, Vt = ie(
17104
+ (j) => {
17105
+ p || pt.setView(j), y == null || y(j);
17106
17106
  },
17107
17107
  [p, y, pt]
17108
- ), Cn = Ct.find((_) => _.key === zn) ?? Ct[0], Kt = (_) => {
17109
- dt(_), nt(""), Ge(!0);
17110
- }, _t = () => {
17108
+ ), Cn = Ct.find((j) => j.key === zn) ?? Ct[0], Kt = (j) => {
17109
+ dt(j), nt(""), Ge(!0);
17110
+ }, jt = () => {
17111
17111
  Ge(!1), dt(null), nt(""), U();
17112
17112
  }, mn = ie(
17113
- async (_) => {
17114
- if (!(!Ke || ne) && _.id)
17113
+ async (j) => {
17114
+ if (!(!Ke || ne) && j.id)
17115
17115
  try {
17116
- await A(Ke, _.id), setTimeout(() => _t(), 600);
17116
+ await A(Ke, j.id), setTimeout(() => jt(), 600);
17117
17117
  } catch (G) {
17118
17118
  console.error("Failed to share thread:", G);
17119
17119
  }
17120
17120
  },
17121
- [_t, ne, Ke, A]
17121
+ [jt, ne, Ke, A]
17122
17122
  ), Bn = Be(() => {
17123
- const _ = ot, G = ft.trim().toLowerCase();
17124
- return G ? v ? _.filter((se) => v(se, G)) : _.filter((se) => `${se.label} ${se.secondaryLabel ?? ""}`.toLowerCase().includes(G)) : _;
17123
+ const j = ot, G = ft.trim().toLowerCase();
17124
+ return G ? v ? j.filter((se) => v(se, G)) : j.filter((se) => `${se.label} ${se.secondaryLabel ?? ""}`.toLowerCase().includes(G)) : j;
17125
17125
  }, [T, ft, v]), mt = zn === "shared", Tn = mt ? D : K, Qt = C ? Tn.filter(C) : Tn, Fe = Be(() => {
17126
- const _ = Array.isArray(S) ? S : [];
17127
- if (_.length === 0 || mt) return null;
17126
+ const j = Array.isArray(S) ? S : [];
17127
+ if (j.length === 0 || mt) return null;
17128
17128
  const G = "Default", se = (me) => {
17129
17129
  if (!me) return "Older";
17130
17130
  try {
@@ -17169,52 +17169,52 @@ function Fi({
17169
17169
  return;
17170
17170
  }
17171
17171
  Object.values(me).forEach(Me);
17172
- }, be = ze(Qt, _);
17172
+ }, be = ze(Qt, j);
17173
17173
  return Me(be), { kind: "nested", groups: be };
17174
- }, [Qt, S, mt]), st = mt ? V : M, gn = mt ? "No shared conversations yet" : "No conversations yet", xn = (_) => {
17175
- const G = _.sharedAt ? ` • ${yn(_.sharedAt)}` : "";
17176
- return `Shared by ${_.sharedByUserId}${G}`;
17177
- }, en = (_) => "sharedByUserId" in _;
17174
+ }, [Qt, S, mt]), st = mt ? V : M, gn = mt ? "No shared conversations yet" : "No conversations yet", xn = (j) => {
17175
+ const G = j.sharedAt ? ` • ${yn(j.sharedAt)}` : "";
17176
+ return `Shared by ${j.sharedByUserId}${G}`;
17177
+ }, en = (j) => "sharedByUserId" in j;
17178
17178
  qe(() => {
17179
- const _ = Array.isArray(E) ? E : [];
17180
- if (_.length > 0) {
17181
- N.current = !0, Z(_);
17179
+ const j = Array.isArray(E) ? E : [];
17180
+ if (j.length > 0) {
17181
+ N.current = !0, Z(j);
17182
17182
  return;
17183
17183
  }
17184
- M || (N.current = !1, Z(_));
17184
+ M || (N.current = !1, Z(j));
17185
17185
  }, [E, M]), qe(() => {
17186
17186
  if (!B.current) return;
17187
- const _ = B.current.querySelector(
17187
+ const j = B.current.querySelector(
17188
17188
  "[data-radix-scroll-area-viewport]"
17189
17189
  );
17190
- if (!_) return;
17190
+ if (!j) return;
17191
17191
  let G = null, se = null;
17192
17192
  return G = requestAnimationFrame(() => {
17193
17193
  se = requestAnimationFrame(() => {
17194
- _.scrollTop = Y.current;
17194
+ j.scrollTop = Y.current;
17195
17195
  });
17196
17196
  }), () => {
17197
17197
  G !== null && cancelAnimationFrame(G), se !== null && cancelAnimationFrame(se);
17198
17198
  };
17199
17199
  }, [K]);
17200
- const tn = async (_) => {
17200
+ const tn = async (j) => {
17201
17201
  try {
17202
- z(_), await L(_), l == null || l(_), u == null || u(_);
17202
+ z(j), await L(j), l == null || l(j), u == null || u(j);
17203
17203
  } catch (G) {
17204
17204
  console.error("Failed to select thread:", G);
17205
17205
  }
17206
17206
  }, Un = async () => {
17207
17207
  try {
17208
17208
  Ve(!0);
17209
- const _ = await ee();
17210
- _ && (f == null || f(_), l == null || l(_));
17211
- } catch (_) {
17212
- console.error("Failed to create thread:", _);
17209
+ const j = await ee();
17210
+ j && (f == null || f(j), l == null || l(j));
17211
+ } catch (j) {
17212
+ console.error("Failed to create thread:", j);
17213
17213
  } finally {
17214
17214
  Ve(!1);
17215
17215
  }
17216
- }, hr = async (_, G) => {
17217
- const se = _.threadId;
17216
+ }, hr = async (j, G) => {
17217
+ const se = j.threadId;
17218
17218
  if (confirm("Delete this thread?")) {
17219
17219
  if (B.current) {
17220
17220
  const oe = B.current.querySelector("[data-radix-scroll-area-viewport]");
@@ -17226,35 +17226,35 @@ function Fi({
17226
17226
  console.error("Failed to delete thread:", oe);
17227
17227
  }
17228
17228
  }
17229
- }, Hn = (_, G) => {
17230
- G == null || G.stopPropagation(), pe(_.threadId), Ee(_.title || `Thread ${_.threadId.slice(0, 8)}`);
17231
- }, kn = async (_) => {
17232
- const G = typeof _ == "string" ? _ : _.threadId;
17229
+ }, Hn = (j, G) => {
17230
+ G == null || G.stopPropagation(), pe(j.threadId), Ee(j.title || `Thread ${j.threadId.slice(0, 8)}`);
17231
+ }, kn = async (j) => {
17232
+ const G = typeof j == "string" ? j : j.threadId;
17233
17233
  if (ge.trim())
17234
17234
  try {
17235
17235
  await P(G, ge.trim()), pe(null), Ee("");
17236
17236
  } catch (se) {
17237
17237
  console.error("Failed to update title:", se);
17238
17238
  }
17239
- }, In = (_) => {
17239
+ }, In = (j) => {
17240
17240
  pe(null), Ee("");
17241
- }, yn = (_) => {
17242
- if (!_) return "";
17241
+ }, yn = (j) => {
17242
+ if (!j) return "";
17243
17243
  try {
17244
- const G = _.endsWith("Z") || _.includes("+") ? _ : `${_}Z`, se = new Date(G), ye = (/* @__PURE__ */ new Date()).getTime() - se.getTime(), ze = Math.floor(ye / (1e3 * 60 * 60 * 24));
17244
+ const G = j.endsWith("Z") || j.includes("+") ? j : `${j}Z`, se = new Date(G), ye = (/* @__PURE__ */ new Date()).getTime() - se.getTime(), ze = Math.floor(ye / (1e3 * 60 * 60 * 24));
17245
17245
  return ze === 0 ? se.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : ze === 1 ? "Yesterday" : ze < 7 ? `${ze} days ago` : se.toLocaleDateString();
17246
17246
  } catch {
17247
17247
  return "";
17248
17248
  }
17249
- }, Pt = (_) => _.title || `Thread ${_.threadId.slice(0, 8)}`, Wn = (_) => {
17250
- const G = Pt(_);
17249
+ }, Pt = (j) => j.title || `Thread ${j.threadId.slice(0, 8)}`, Wn = (j) => {
17250
+ const G = Pt(j);
17251
17251
  return G.length <= Ac ? G : `${G.slice(0, Ac)}...`;
17252
- }, k = (_) => Array.isArray(_) ? _.length : Object.values(_).reduce((G, se) => Array.isArray(se) ? G + se.length : G + k(se), 0), X = (_) => {
17253
- const se = ["Today", "Yesterday", "Last 7 Days", "Older"].indexOf(_);
17252
+ }, k = (j) => Array.isArray(j) ? j.length : Object.values(j).reduce((G, se) => Array.isArray(se) ? G + se.length : G + k(se), 0), X = (j) => {
17253
+ const se = ["Today", "Yesterday", "Last 7 Days", "Older"].indexOf(j);
17254
17254
  return se === -1 ? null : se;
17255
- }, re = (_, G, se) => {
17256
- if (Array.isArray(_))
17257
- return _.map((be) => /* @__PURE__ */ d.jsx(
17255
+ }, re = (j, G, se) => {
17256
+ if (Array.isArray(j))
17257
+ return j.map((be) => /* @__PURE__ */ d.jsx(
17258
17258
  Ec,
17259
17259
  {
17260
17260
  thread: be,
@@ -17284,7 +17284,7 @@ function Fi({
17284
17284
  "flex items-center w-full px-2 py-1 text-xs font-semibold text-slate-600 hover:text-slate-900 dark:hover:text-slate-200",
17285
17285
  "flex items-center w-full px-2 py-1 text-[11px] font-medium text-slate-500 hover:text-slate-800 dark:hover:text-slate-200",
17286
17286
  "flex items-center w-full px-2 py-1 text-[10px] font-medium text-slate-400 hover:text-slate-600 dark:hover:text-slate-300"
17287
- ], ye = "pl-2 border-l border-slate-100 dark:border-slate-800 ml-1.5 my-1 space-y-1", ze = oe[G] ?? oe[oe.length - 1], Me = Object.entries(_);
17287
+ ], ye = "pl-2 border-l border-slate-100 dark:border-slate-800 ml-1.5 my-1 space-y-1", ze = oe[G] ?? oe[oe.length - 1], Me = Object.entries(j);
17288
17288
  if (Me.length === 1) {
17289
17289
  const [be, me] = Me[0];
17290
17290
  return re(
@@ -17342,7 +17342,7 @@ function Fi({
17342
17342
  ) }),
17343
17343
  /* @__PURE__ */ d.jsxs("div", { className: "flex items-center gap-2 text-sm font-semibold text-slate-700 dark:text-slate-200 uppercase tracking-wide leading-tight", children: [
17344
17344
  /* @__PURE__ */ d.jsx("span", { children: "Current View" }),
17345
- /* @__PURE__ */ d.jsxs(_a, { children: [
17345
+ /* @__PURE__ */ d.jsxs(ja, { children: [
17346
17346
  /* @__PURE__ */ d.jsx(Pa, { asChild: !0, children: /* @__PURE__ */ d.jsx(
17347
17347
  tt,
17348
17348
  {
@@ -17352,19 +17352,19 @@ function Fi({
17352
17352
  children: Cn.label
17353
17353
  }
17354
17354
  ) }),
17355
- /* @__PURE__ */ d.jsx($s, { align: "start", sideOffset: 6, className: "w-40", children: Ct.map((_) => /* @__PURE__ */ d.jsxs(
17355
+ /* @__PURE__ */ d.jsx($s, { align: "start", sideOffset: 6, className: "w-40", children: Ct.map((j) => /* @__PURE__ */ d.jsxs(
17356
17356
  Qn,
17357
17357
  {
17358
17358
  className: "justify-between text-[12px]",
17359
17359
  onClick: (G) => {
17360
- G.preventDefault(), Vt(_.key);
17360
+ G.preventDefault(), Vt(j.key);
17361
17361
  },
17362
17362
  children: [
17363
- /* @__PURE__ */ d.jsx("span", { children: _.label }),
17364
- zn === _.key && /* @__PURE__ */ d.jsx(Dc, { className: "h-3 w-3" })
17363
+ /* @__PURE__ */ d.jsx("span", { children: j.label }),
17364
+ zn === j.key && /* @__PURE__ */ d.jsx(Dc, { className: "h-3 w-3" })
17365
17365
  ]
17366
17366
  },
17367
- _.key
17367
+ j.key
17368
17368
  )) })
17369
17369
  ] })
17370
17370
  ] })
@@ -17387,11 +17387,11 @@ function Fi({
17387
17387
  Fe.groups,
17388
17388
  0,
17389
17389
  "group"
17390
- ) : Qt.slice().sort((_, G) => new Date(G.updatedAt || G.createdAt || "").getTime() - new Date(_.updatedAt || _.createdAt || "").getTime()).map((_) => /* @__PURE__ */ d.jsx(
17390
+ ) : Qt.slice().sort((j, G) => new Date(G.updatedAt || G.createdAt || "").getTime() - new Date(j.updatedAt || j.createdAt || "").getTime()).map((j) => /* @__PURE__ */ d.jsx(
17391
17391
  Ec,
17392
17392
  {
17393
- thread: _,
17394
- isActive: O === _.threadId,
17393
+ thread: j,
17394
+ isActive: O === j.threadId,
17395
17395
  editingThreadId: ae,
17396
17396
  editingTitle: ge,
17397
17397
  onSelect: tn,
@@ -17407,15 +17407,15 @@ function Fi({
17407
17407
  onMenuAction: s,
17408
17408
  formatDate: yn,
17409
17409
  getDisplayThreadTitle: Wn,
17410
- secondaryLine: mt && en(_) ? xn(_) : void 0,
17410
+ secondaryLine: mt && en(j) ? xn(j) : void 0,
17411
17411
  itemClassName: a.threadItem,
17412
17412
  activeItemClassName: a.activeThread
17413
17413
  },
17414
- _.threadId
17414
+ j.threadId
17415
17415
  )) })
17416
17416
  }
17417
17417
  ),
17418
- /* @__PURE__ */ d.jsx(Ph, { open: Ze, onOpenChange: (_) => !_ && _t(), children: /* @__PURE__ */ d.jsxs(Fa, { className: "max-w-md p-0", children: [
17418
+ /* @__PURE__ */ d.jsx(Ph, { open: Ze, onOpenChange: (j) => !j && jt(), children: /* @__PURE__ */ d.jsxs(Fa, { className: "max-w-md p-0", children: [
17419
17419
  /* @__PURE__ */ d.jsx(za, { children: /* @__PURE__ */ d.jsx(Ba, { children: "Share thread" }) }),
17420
17420
  /* @__PURE__ */ d.jsxs(op, { children: [
17421
17421
  /* @__PURE__ */ d.jsx(
@@ -17423,7 +17423,7 @@ function Fi({
17423
17423
  {
17424
17424
  autoFocus: !0,
17425
17425
  value: ft,
17426
- onValueChange: (_) => nt(_),
17426
+ onValueChange: (j) => nt(j),
17427
17427
  placeholder: "Search for recipients..."
17428
17428
  }
17429
17429
  ),
@@ -17442,10 +17442,10 @@ function Fi({
17442
17442
  /* @__PURE__ */ d.jsx(Gn, { className: "h-4 w-4 animate-spin" }),
17443
17443
  "Loading recipients…"
17444
17444
  ] }) : "No matching recipients found" }),
17445
- Bn.length > 0 && /* @__PURE__ */ d.jsx(lp, { heading: "Recipients", children: Bn.map((_) => /* @__PURE__ */ d.jsx(cp, { onSelect: () => mn(_), children: /* @__PURE__ */ d.jsxs("div", { className: "flex flex-col items-start text-sm", children: [
17446
- /* @__PURE__ */ d.jsx("span", { className: "font-medium", children: _.label }),
17447
- _.secondaryLabel && /* @__PURE__ */ d.jsx("span", { className: "text-xs text-muted-foreground", children: _.secondaryLabel })
17448
- ] }) }, _.id)) })
17445
+ Bn.length > 0 && /* @__PURE__ */ d.jsx(lp, { heading: "Recipients", children: Bn.map((j) => /* @__PURE__ */ d.jsx(cp, { onSelect: () => mn(j), children: /* @__PURE__ */ d.jsxs("div", { className: "flex flex-col items-start text-sm", children: [
17446
+ /* @__PURE__ */ d.jsx("span", { className: "font-medium", children: j.label }),
17447
+ j.secondaryLabel && /* @__PURE__ */ d.jsx("span", { className: "text-xs text-muted-foreground", children: j.secondaryLabel })
17448
+ ] }) }, j.id)) })
17449
17449
  ] })
17450
17450
  ] })
17451
17451
  ] }) })
@@ -17851,7 +17851,7 @@ function yk({
17851
17851
  );
17852
17852
  }
17853
17853
  export {
17854
- jg as ApiProvider,
17854
+ _g as ApiProvider,
17855
17855
  Id as AssistantMessageComponent,
17856
17856
  kg as ChatApi,
17857
17857
  pk as ChatApp,
@@ -17892,7 +17892,7 @@ export {
17892
17892
  Vx as extractTaskIdFromToolEnd,
17893
17893
  kr as extractToolContent,
17894
17894
  uu as fileApiClient,
17895
- _g as fileToBase64,
17895
+ jg as fileToBase64,
17896
17896
  tk as formatToolOutput,
17897
17897
  Ot as get,
17898
17898
  lu as getChatToken,