teodor-new-chat-ui 4.3.233 → 4.3.235

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -2,7 +2,7 @@ var om = Object.defineProperty;
2
2
  var sm = (e, t, n) => t in e ? om(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var cl = (e, t, n) => sm(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as v from "react";
5
- import z, { createContext as co, useContext as xs, useRef as et, useCallback as Ce, useReducer as im, useEffect as Et, useMemo as lt, useState as ge, useLayoutEffect as am, createElement as Do, useImperativeHandle as lm } from "react";
5
+ import z, { createContext as co, useContext as xs, useRef as Ze, useCallback as Ce, useReducer as im, useEffect as Et, useMemo as lt, useState as ge, useLayoutEffect as am, createElement as Do, useImperativeHandle as lm } from "react";
6
6
  import { Square as cm, Send as um, ChevronRight as Xc, Check as ca, Circle as dm, X as vr, ExternalLink as fm, Download as pm, Image as hm, FileText as ul, Loader as ua, Bot as si, Wrench as mm, User as gm, Paperclip as ji, ChevronUp as da, ChevronDown as ys, ChevronLeft as xm, Copy as dl, Edit as fl, RotateCcw as _i, Info as ym, Loader2 as zr, Edit3 as Jc, Plus as vm, FileSpreadsheet as wm, MessageSquarePlus as bm, MessageSquare as Sm, Calendar as Cm, Trash2 as Tm, Settings as km, Server as Rm, EyeOff as Em, Eye as Im, Layout as Nm, MessageCircle as Am, Save as jm } from "lucide-react";
7
7
  import { Slot as _m, createSlot as Tr } from "@radix-ui/react-slot";
8
8
  import { cva as vs } from "class-variance-authority";
@@ -51,25 +51,25 @@ function Dm() {
51
51
  function y(R) {
52
52
  if (R === null || typeof R != "object")
53
53
  return null;
54
- var q = m && R[m] || R[x];
55
- return typeof q == "function" ? q : null;
54
+ var K = m && R[m] || R[x];
55
+ return typeof K == "function" ? K : null;
56
56
  }
57
57
  var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
58
58
  function w(R) {
59
59
  {
60
- for (var q = arguments.length, ie = new Array(q > 1 ? q - 1 : 0), we = 1; we < q; we++)
60
+ for (var K = arguments.length, ie = new Array(K > 1 ? K - 1 : 0), we = 1; we < K; we++)
61
61
  ie[we - 1] = arguments[we];
62
62
  b("error", R, ie);
63
63
  }
64
64
  }
65
- function b(R, q, ie) {
65
+ function b(R, K, ie) {
66
66
  {
67
- var we = g.ReactDebugCurrentFrame, Je = we.getStackAddendum();
68
- Je !== "" && (q += "%s", ie = ie.concat([Je]));
69
- var at = ie.map(function(Ue) {
70
- return String(Ue);
67
+ var we = g.ReactDebugCurrentFrame, Ye = we.getStackAddendum();
68
+ Ye !== "" && (K += "%s", ie = ie.concat([Ye]));
69
+ var at = ie.map(function(He) {
70
+ return String(He);
71
71
  });
72
- at.unshift("Warning: " + q), Function.prototype.apply.call(console[R], console, at);
72
+ at.unshift("Warning: " + K), Function.prototype.apply.call(console[R], console, at);
73
73
  }
74
74
  }
75
75
  var T = !1, C = !1, S = !1, k = !1, N = !1, E;
@@ -81,12 +81,12 @@ function Dm() {
81
81
  // with.
82
82
  R.$$typeof === E || R.getModuleId !== void 0));
83
83
  }
84
- function O(R, q, ie) {
84
+ function O(R, K, ie) {
85
85
  var we = R.displayName;
86
86
  if (we)
87
87
  return we;
88
- var Je = q.displayName || q.name || "";
89
- return Je !== "" ? ie + "(" + Je + ")" : ie;
88
+ var Ye = K.displayName || K.name || "";
89
+ return Ye !== "" ? ie + "(" + Ye + ")" : ie;
90
90
  }
91
91
  function L(R) {
92
92
  return R.displayName || "Context";
@@ -115,8 +115,8 @@ function Dm() {
115
115
  if (typeof R == "object")
116
116
  switch (R.$$typeof) {
117
117
  case a:
118
- var q = R;
119
- return L(q) + ".Consumer";
118
+ var K = R;
119
+ return L(K) + ".Consumer";
120
120
  case i:
121
121
  var ie = R;
122
122
  return L(ie._context) + ".Provider";
@@ -126,9 +126,9 @@ function Dm() {
126
126
  var we = R.displayName || null;
127
127
  return we !== null ? we : F(R.type) || "Memo";
128
128
  case p: {
129
- var Je = R, at = Je._payload, Ue = Je._init;
129
+ var Ye = R, at = Ye._payload, He = Ye._init;
130
130
  try {
131
- return F(Ue(at));
131
+ return F(He(at));
132
132
  } catch {
133
133
  return null;
134
134
  }
@@ -140,7 +140,7 @@ function Dm() {
140
140
  function Re() {
141
141
  }
142
142
  Re.__reactDisabledLog = !0;
143
- function Ee() {
143
+ function Ie() {
144
144
  {
145
145
  if ($ === 0) {
146
146
  A = console.log, B = console.info, D = console.warn, M = console.error, Z = console.group, J = console.groupCollapsed, pe = console.groupEnd;
@@ -163,7 +163,7 @@ function Dm() {
163
163
  $++;
164
164
  }
165
165
  }
166
- function W() {
166
+ function U() {
167
167
  {
168
168
  if ($--, $ === 0) {
169
169
  var R = {
@@ -198,18 +198,18 @@ function Dm() {
198
198
  $ < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
199
199
  }
200
200
  }
201
- var ee = g.ReactCurrentDispatcher, U;
202
- function P(R, q, ie) {
201
+ var ee = g.ReactCurrentDispatcher, q;
202
+ function P(R, K, ie) {
203
203
  {
204
- if (U === void 0)
204
+ if (q === void 0)
205
205
  try {
206
206
  throw Error();
207
- } catch (Je) {
208
- var we = Je.stack.trim().match(/\n( *(at )?)/);
209
- U = we && we[1] || "";
207
+ } catch (Ye) {
208
+ var we = Ye.stack.trim().match(/\n( *(at )?)/);
209
+ q = we && we[1] || "";
210
210
  }
211
211
  return `
212
- ` + U + R;
212
+ ` + q + R;
213
213
  }
214
214
  }
215
215
  var H = !1, te;
@@ -217,7 +217,7 @@ function Dm() {
217
217
  var se = typeof WeakMap == "function" ? WeakMap : Map;
218
218
  te = new se();
219
219
  }
220
- function ne(R, q) {
220
+ function ne(R, K) {
221
221
  if (!R || H)
222
222
  return "";
223
223
  {
@@ -227,33 +227,33 @@ function Dm() {
227
227
  }
228
228
  var we;
229
229
  H = !0;
230
- var Je = Error.prepareStackTrace;
230
+ var Ye = Error.prepareStackTrace;
231
231
  Error.prepareStackTrace = void 0;
232
232
  var at;
233
- at = ee.current, ee.current = null, Ee();
233
+ at = ee.current, ee.current = null, Ie();
234
234
  try {
235
- if (q) {
236
- var Ue = function() {
235
+ if (K) {
236
+ var He = function() {
237
237
  throw Error();
238
238
  };
239
- if (Object.defineProperty(Ue.prototype, "props", {
239
+ if (Object.defineProperty(He.prototype, "props", {
240
240
  set: function() {
241
241
  throw Error();
242
242
  }
243
243
  }), typeof Reflect == "object" && Reflect.construct) {
244
244
  try {
245
- Reflect.construct(Ue, []);
245
+ Reflect.construct(He, []);
246
246
  } catch (Ft) {
247
247
  we = Ft;
248
248
  }
249
- Reflect.construct(R, [], Ue);
249
+ Reflect.construct(R, [], He);
250
250
  } else {
251
251
  try {
252
- Ue.call();
252
+ He.call();
253
253
  } catch (Ft) {
254
254
  we = Ft;
255
255
  }
256
- R.call(Ue.prototype);
256
+ R.call(He.prototype);
257
257
  }
258
258
  } else {
259
259
  try {
@@ -265,17 +265,17 @@ function Dm() {
265
265
  }
266
266
  } catch (Ft) {
267
267
  if (Ft && we && typeof Ft.stack == "string") {
268
- for (var ze = Ft.stack.split(`
268
+ for (var $e = Ft.stack.split(`
269
269
  `), Ot = we.stack.split(`
270
- `), bt = ze.length - 1, vt = Ot.length - 1; bt >= 1 && vt >= 0 && ze[bt] !== Ot[vt]; )
270
+ `), bt = $e.length - 1, vt = Ot.length - 1; bt >= 1 && vt >= 0 && $e[bt] !== Ot[vt]; )
271
271
  vt--;
272
272
  for (; bt >= 1 && vt >= 0; bt--, vt--)
273
- if (ze[bt] !== Ot[vt]) {
273
+ if ($e[bt] !== Ot[vt]) {
274
274
  if (bt !== 1 || vt !== 1)
275
275
  do
276
- if (bt--, vt--, vt < 0 || ze[bt] !== Ot[vt]) {
276
+ if (bt--, vt--, vt < 0 || $e[bt] !== Ot[vt]) {
277
277
  var Kt = `
278
- ` + ze[bt].replace(" at new ", " at ");
278
+ ` + $e[bt].replace(" at new ", " at ");
279
279
  return R.displayName && Kt.includes("<anonymous>") && (Kt = Kt.replace("<anonymous>", R.displayName)), typeof R == "function" && te.set(R, Kt), Kt;
280
280
  }
281
281
  while (bt >= 1 && vt >= 0);
@@ -283,19 +283,19 @@ function Dm() {
283
283
  }
284
284
  }
285
285
  } finally {
286
- H = !1, ee.current = at, W(), Error.prepareStackTrace = Je;
286
+ H = !1, ee.current = at, U(), Error.prepareStackTrace = Ye;
287
287
  }
288
288
  var Fn = R ? R.displayName || R.name : "", Nn = Fn ? P(Fn) : "";
289
289
  return typeof R == "function" && te.set(R, Nn), Nn;
290
290
  }
291
- function Le(R, q, ie) {
291
+ function De(R, K, ie) {
292
292
  return ne(R, !1);
293
293
  }
294
294
  function Y(R) {
295
- var q = R.prototype;
296
- return !!(q && q.isReactComponent);
295
+ var K = R.prototype;
296
+ return !!(K && K.isReactComponent);
297
297
  }
298
- function de(R, q, ie) {
298
+ function de(R, K, ie) {
299
299
  if (R == null)
300
300
  return "";
301
301
  if (typeof R == "function")
@@ -311,57 +311,57 @@ function Dm() {
311
311
  if (typeof R == "object")
312
312
  switch (R.$$typeof) {
313
313
  case l:
314
- return Le(R.render);
314
+ return De(R.render);
315
315
  case f:
316
- return de(R.type, q, ie);
316
+ return de(R.type, K, ie);
317
317
  case p: {
318
- var we = R, Je = we._payload, at = we._init;
318
+ var we = R, Ye = we._payload, at = we._init;
319
319
  try {
320
- return de(at(Je), q, ie);
320
+ return de(at(Ye), K, ie);
321
321
  } catch {
322
322
  }
323
323
  }
324
324
  }
325
325
  return "";
326
326
  }
327
- var ke = Object.prototype.hasOwnProperty, Ne = {}, Be = g.ReactDebugCurrentFrame;
328
- function He(R) {
327
+ var ke = Object.prototype.hasOwnProperty, Ae = {}, ze = g.ReactDebugCurrentFrame;
328
+ function Be(R) {
329
329
  if (R) {
330
- var q = R._owner, ie = de(R.type, R._source, q ? q.type : null);
331
- Be.setExtraStackFrame(ie);
330
+ var K = R._owner, ie = de(R.type, R._source, K ? K.type : null);
331
+ ze.setExtraStackFrame(ie);
332
332
  } else
333
- Be.setExtraStackFrame(null);
333
+ ze.setExtraStackFrame(null);
334
334
  }
335
- function We(R, q, ie, we, Je) {
335
+ function Ue(R, K, ie, we, Ye) {
336
336
  {
337
337
  var at = Function.call.bind(ke);
338
- for (var Ue in R)
339
- if (at(R, Ue)) {
340
- var ze = void 0;
338
+ for (var He in R)
339
+ if (at(R, He)) {
340
+ var $e = void 0;
341
341
  try {
342
- if (typeof R[Ue] != "function") {
343
- var Ot = Error((we || "React class") + ": " + ie + " type `" + Ue + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Ue] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
342
+ if (typeof R[He] != "function") {
343
+ var Ot = Error((we || "React class") + ": " + ie + " type `" + He + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[He] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
344
  throw Ot.name = "Invariant Violation", Ot;
345
345
  }
346
- ze = R[Ue](q, Ue, we, ie, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ $e = R[He](K, He, we, ie, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
347
  } catch (bt) {
348
- ze = bt;
348
+ $e = bt;
349
349
  }
350
- ze && !(ze instanceof Error) && (He(Je), w("%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).", we || "React class", ie, Ue, typeof ze), He(null)), ze instanceof Error && !(ze.message in Ne) && (Ne[ze.message] = !0, He(Je), w("Failed %s type: %s", ie, ze.message), He(null));
350
+ $e && !($e instanceof Error) && (Be(Ye), w("%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).", we || "React class", ie, He, typeof $e), Be(null)), $e instanceof Error && !($e.message in Ae) && (Ae[$e.message] = !0, Be(Ye), w("Failed %s type: %s", ie, $e.message), Be(null));
351
351
  }
352
352
  }
353
353
  }
354
- var qe = Array.isArray;
355
- function Ge(R) {
356
- return qe(R);
354
+ var Ke = Array.isArray;
355
+ function qe(R) {
356
+ return Ke(R);
357
357
  }
358
- function tt(R) {
358
+ function Qe(R) {
359
359
  {
360
- var q = typeof Symbol == "function" && Symbol.toStringTag, ie = q && R[Symbol.toStringTag] || R.constructor.name || "Object";
360
+ var K = typeof Symbol == "function" && Symbol.toStringTag, ie = K && R[Symbol.toStringTag] || R.constructor.name || "Object";
361
361
  return ie;
362
362
  }
363
363
  }
364
- function Qe(R) {
364
+ function Je(R) {
365
365
  try {
366
366
  return ot(R), !1;
367
367
  } catch {
@@ -372,8 +372,8 @@ function Dm() {
372
372
  return "" + R;
373
373
  }
374
374
  function St(R) {
375
- if (Qe(R))
376
- return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", tt(R)), ot(R);
375
+ if (Je(R))
376
+ return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qe(R)), ot(R);
377
377
  }
378
378
  var mt = g.ReactCurrentOwner, ct = {
379
379
  key: !0,
@@ -383,27 +383,27 @@ function Dm() {
383
383
  }, Ct, ce;
384
384
  function re(R) {
385
385
  if (ke.call(R, "ref")) {
386
- var q = Object.getOwnPropertyDescriptor(R, "ref").get;
387
- if (q && q.isReactWarning)
386
+ var K = Object.getOwnPropertyDescriptor(R, "ref").get;
387
+ if (K && K.isReactWarning)
388
388
  return !1;
389
389
  }
390
390
  return R.ref !== void 0;
391
391
  }
392
- function Ye(R) {
392
+ function Ge(R) {
393
393
  if (ke.call(R, "key")) {
394
- var q = Object.getOwnPropertyDescriptor(R, "key").get;
395
- if (q && q.isReactWarning)
394
+ var K = Object.getOwnPropertyDescriptor(R, "key").get;
395
+ if (K && K.isReactWarning)
396
396
  return !1;
397
397
  }
398
398
  return R.key !== void 0;
399
399
  }
400
- function De(R, q) {
400
+ function Ee(R, K) {
401
401
  typeof R.ref == "string" && mt.current;
402
402
  }
403
- function Xe(R, q) {
403
+ function Oe(R, K) {
404
404
  {
405
405
  var ie = function() {
406
- Ct || (Ct = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", q));
406
+ Ct || (Ct = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", K));
407
407
  };
408
408
  ie.isReactWarning = !0, Object.defineProperty(R, "key", {
409
409
  get: ie,
@@ -411,10 +411,10 @@ function Dm() {
411
411
  });
412
412
  }
413
413
  }
414
- function je(R, q) {
414
+ function et(R, K) {
415
415
  {
416
416
  var ie = function() {
417
- ce || (ce = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", q));
417
+ ce || (ce = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", K));
418
418
  };
419
419
  ie.isReactWarning = !0, Object.defineProperty(R, "ref", {
420
420
  get: ie,
@@ -422,57 +422,57 @@ function Dm() {
422
422
  });
423
423
  }
424
424
  }
425
- var Fe = function(R, q, ie, we, Je, at, Ue) {
426
- var ze = {
425
+ var tt = function(R, K, ie, we, Ye, at, He) {
426
+ var $e = {
427
427
  // This tag allows us to uniquely identify this as a React Element
428
428
  $$typeof: t,
429
429
  // Built-in properties that belong on the element
430
430
  type: R,
431
- key: q,
431
+ key: K,
432
432
  ref: ie,
433
- props: Ue,
433
+ props: He,
434
434
  // Record the component responsible for creating this element.
435
435
  _owner: at
436
436
  };
437
- return ze._store = {}, Object.defineProperty(ze._store, "validated", {
437
+ return $e._store = {}, Object.defineProperty($e._store, "validated", {
438
438
  configurable: !1,
439
439
  enumerable: !1,
440
440
  writable: !0,
441
441
  value: !1
442
- }), Object.defineProperty(ze, "_self", {
442
+ }), Object.defineProperty($e, "_self", {
443
443
  configurable: !1,
444
444
  enumerable: !1,
445
445
  writable: !1,
446
446
  value: we
447
- }), Object.defineProperty(ze, "_source", {
447
+ }), Object.defineProperty($e, "_source", {
448
448
  configurable: !1,
449
449
  enumerable: !1,
450
450
  writable: !1,
451
- value: Je
452
- }), Object.freeze && (Object.freeze(ze.props), Object.freeze(ze)), ze;
451
+ value: Ye
452
+ }), Object.freeze && (Object.freeze($e.props), Object.freeze($e)), $e;
453
453
  };
454
- function Oe(R, q, ie, we, Je) {
454
+ function Fe(R, K, ie, we, Ye) {
455
455
  {
456
- var at, Ue = {}, ze = null, Ot = null;
457
- ie !== void 0 && (St(ie), ze = "" + ie), Ye(q) && (St(q.key), ze = "" + q.key), re(q) && (Ot = q.ref, De(q, Je));
458
- for (at in q)
459
- ke.call(q, at) && !ct.hasOwnProperty(at) && (Ue[at] = q[at]);
456
+ var at, He = {}, $e = null, Ot = null;
457
+ ie !== void 0 && (St(ie), $e = "" + ie), Ge(K) && (St(K.key), $e = "" + K.key), re(K) && (Ot = K.ref, Ee(K, Ye));
458
+ for (at in K)
459
+ ke.call(K, at) && !ct.hasOwnProperty(at) && (He[at] = K[at]);
460
460
  if (R && R.defaultProps) {
461
461
  var bt = R.defaultProps;
462
462
  for (at in bt)
463
- Ue[at] === void 0 && (Ue[at] = bt[at]);
463
+ He[at] === void 0 && (He[at] = bt[at]);
464
464
  }
465
- if (ze || Ot) {
465
+ if ($e || Ot) {
466
466
  var vt = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
467
- ze && Xe(Ue, vt), Ot && je(Ue, vt);
467
+ $e && Oe(He, vt), Ot && et(He, vt);
468
468
  }
469
- return Fe(R, ze, Ot, Je, we, mt.current, Ue);
469
+ return tt(R, $e, Ot, Ye, we, mt.current, He);
470
470
  }
471
471
  }
472
472
  var Pt = g.ReactCurrentOwner, jt = g.ReactDebugCurrentFrame;
473
- function K(R) {
473
+ function V(R) {
474
474
  if (R) {
475
- var q = R._owner, ie = de(R.type, R._source, q ? q.type : null);
475
+ var K = R._owner, ie = de(R.type, R._source, K ? K.type : null);
476
476
  jt.setExtraStackFrame(ie);
477
477
  } else
478
478
  jt.setExtraStackFrame(null);
@@ -500,105 +500,105 @@ Check the render method of \`` + R + "`.";
500
500
  var Tt = {};
501
501
  function _e(R) {
502
502
  {
503
- var q = ht();
504
- if (!q) {
503
+ var K = ht();
504
+ if (!K) {
505
505
  var ie = typeof R == "string" ? R : R.displayName || R.name;
506
- ie && (q = `
506
+ ie && (K = `
507
507
 
508
508
  Check the top-level render call using <` + ie + ">.");
509
509
  }
510
- return q;
510
+ return K;
511
511
  }
512
512
  }
513
- function Vt(R, q) {
513
+ function Vt(R, K) {
514
514
  {
515
515
  if (!R._store || R._store.validated || R.key != null)
516
516
  return;
517
517
  R._store.validated = !0;
518
- var ie = _e(q);
518
+ var ie = _e(K);
519
519
  if (Tt[ie])
520
520
  return;
521
521
  Tt[ie] = !0;
522
522
  var we = "";
523
- R && R._owner && R._owner !== Pt.current && (we = " It was passed a child from " + F(R._owner.type) + "."), K(R), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ie, we), K(null);
523
+ R && R._owner && R._owner !== Pt.current && (we = " It was passed a child from " + F(R._owner.type) + "."), V(R), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ie, we), V(null);
524
524
  }
525
525
  }
526
- function ut(R, q) {
526
+ function ut(R, K) {
527
527
  {
528
528
  if (typeof R != "object")
529
529
  return;
530
- if (Ge(R))
530
+ if (qe(R))
531
531
  for (var ie = 0; ie < R.length; ie++) {
532
532
  var we = R[ie];
533
- xe(we) && Vt(we, q);
533
+ xe(we) && Vt(we, K);
534
534
  }
535
535
  else if (xe(R))
536
536
  R._store && (R._store.validated = !0);
537
537
  else if (R) {
538
- var Je = y(R);
539
- if (typeof Je == "function" && Je !== R.entries)
540
- for (var at = Je.call(R), Ue; !(Ue = at.next()).done; )
541
- xe(Ue.value) && Vt(Ue.value, q);
538
+ var Ye = y(R);
539
+ if (typeof Ye == "function" && Ye !== R.entries)
540
+ for (var at = Ye.call(R), He; !(He = at.next()).done; )
541
+ xe(He.value) && Vt(He.value, K);
542
542
  }
543
543
  }
544
544
  }
545
545
  function kt(R) {
546
546
  {
547
- var q = R.type;
548
- if (q == null || typeof q == "string")
547
+ var K = R.type;
548
+ if (K == null || typeof K == "string")
549
549
  return;
550
550
  var ie;
551
- if (typeof q == "function")
552
- ie = q.propTypes;
553
- else if (typeof q == "object" && (q.$$typeof === l || // Note: Memo only checks outer props here.
551
+ if (typeof K == "function")
552
+ ie = K.propTypes;
553
+ else if (typeof K == "object" && (K.$$typeof === l || // Note: Memo only checks outer props here.
554
554
  // Inner props are checked in the reconciler.
555
- q.$$typeof === f))
556
- ie = q.propTypes;
555
+ K.$$typeof === f))
556
+ ie = K.propTypes;
557
557
  else
558
558
  return;
559
559
  if (ie) {
560
- var we = F(q);
561
- We(ie, R.props, "prop", we, R);
562
- } else if (q.PropTypes !== void 0 && !ve) {
560
+ var we = F(K);
561
+ Ue(ie, R.props, "prop", we, R);
562
+ } else if (K.PropTypes !== void 0 && !ve) {
563
563
  ve = !0;
564
- var Je = F(q);
565
- w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Je || "Unknown");
564
+ var Ye = F(K);
565
+ w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Ye || "Unknown");
566
566
  }
567
- typeof q.getDefaultProps == "function" && !q.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
567
+ typeof K.getDefaultProps == "function" && !K.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
568
568
  }
569
569
  }
570
570
  function Dn(R) {
571
571
  {
572
- for (var q = Object.keys(R.props), ie = 0; ie < q.length; ie++) {
573
- var we = q[ie];
572
+ for (var K = Object.keys(R.props), ie = 0; ie < K.length; ie++) {
573
+ var we = K[ie];
574
574
  if (we !== "children" && we !== "key") {
575
- K(R), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", we), K(null);
575
+ V(R), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", we), V(null);
576
576
  break;
577
577
  }
578
578
  }
579
- R.ref !== null && (K(R), w("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
579
+ R.ref !== null && (V(R), w("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
580
580
  }
581
581
  }
582
582
  var Jn = {};
583
- function Ln(R, q, ie, we, Je, at) {
583
+ function Ln(R, K, ie, we, Ye, at) {
584
584
  {
585
- var Ue = I(R);
586
- if (!Ue) {
587
- var ze = "";
588
- (R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && (ze += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
585
+ var He = I(R);
586
+ if (!He) {
587
+ var $e = "";
588
+ (R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && ($e += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
589
589
  var Ot = gt();
590
- Ot ? ze += Ot : ze += ht();
590
+ Ot ? $e += Ot : $e += ht();
591
591
  var bt;
592
- R === null ? bt = "null" : Ge(R) ? bt = "array" : R !== void 0 && R.$$typeof === t ? (bt = "<" + (F(R.type) || "Unknown") + " />", ze = " Did you accidentally export a JSX literal instead of a component?") : bt = typeof R, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", bt, ze);
592
+ R === null ? bt = "null" : qe(R) ? bt = "array" : R !== void 0 && R.$$typeof === t ? (bt = "<" + (F(R.type) || "Unknown") + " />", $e = " Did you accidentally export a JSX literal instead of a component?") : bt = typeof R, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", bt, $e);
593
593
  }
594
- var vt = Oe(R, q, ie, Je, at);
594
+ var vt = Fe(R, K, ie, Ye, at);
595
595
  if (vt == null)
596
596
  return vt;
597
- if (Ue) {
598
- var Kt = q.children;
597
+ if (He) {
598
+ var Kt = K.children;
599
599
  if (Kt !== void 0)
600
600
  if (we)
601
- if (Ge(Kt)) {
601
+ if (qe(Kt)) {
602
602
  for (var Fn = 0; Fn < Kt.length; Fn++)
603
603
  ut(Kt[Fn], R);
604
604
  Object.freeze && Object.freeze(Kt);
@@ -607,8 +607,8 @@ Check the top-level render call using <` + ie + ">.");
607
607
  else
608
608
  ut(Kt, R);
609
609
  }
610
- if (ke.call(q, "key")) {
611
- var Nn = F(R), Ft = Object.keys(q).filter(function(oe) {
610
+ if (ke.call(K, "key")) {
611
+ var Nn = F(R), Ft = Object.keys(K).filter(function(oe) {
612
612
  return oe !== "key";
613
613
  }), Dr = Ft.length > 0 ? "{key: someKey, " + Ft.join(": ..., ") + ": ...}" : "{key: someKey}";
614
614
  if (!Jn[Nn + Dr]) {
@@ -624,11 +624,11 @@ React keys must be passed directly to JSX without using spread:
624
624
  return R === r ? Dn(vt) : kt(vt), vt;
625
625
  }
626
626
  }
627
- function ti(R, q, ie) {
628
- return Ln(R, q, ie, !0);
627
+ function ti(R, K, ie) {
628
+ return Ln(R, K, ie, !0);
629
629
  }
630
- function So(R, q, ie) {
631
- return Ln(R, q, ie, !1);
630
+ function So(R, K, ie) {
631
+ return Ln(R, K, ie, !1);
632
632
  }
633
633
  var ni = So, ri = ti;
634
634
  Fr.Fragment = r, Fr.jsx = ni, Fr.jsxs = ri;
@@ -1882,11 +1882,11 @@ const xu = (e) => {
1882
1882
  duplex: "half"
1883
1883
  }), pe;
1884
1884
  if (_.isFormData(g) && (pe = J.headers.get("content-type")) && N.setContentType(pe), J.body) {
1885
- const [Re, Ee] = wl(
1885
+ const [Re, Ie] = wl(
1886
1886
  $,
1887
1887
  Xo(bl(S))
1888
1888
  );
1889
- g = Cl(J.body, Tl, Re, Ee);
1889
+ g = Cl(J.body, Tl, Re, Ie);
1890
1890
  }
1891
1891
  }
1892
1892
  _.isString(E) || (E = E ? "include" : "omit");
@@ -1904,16 +1904,16 @@ const xu = (e) => {
1904
1904
  const M = d && (k === "stream" || k === "response");
1905
1905
  if (d && (C || M && j)) {
1906
1906
  const J = {};
1907
- ["status", "statusText", "headers"].forEach((W) => {
1908
- J[W] = D[W];
1907
+ ["status", "statusText", "headers"].forEach((U) => {
1908
+ J[U] = D[U];
1909
1909
  });
1910
- const pe = _.toFiniteNumber(D.headers.get("content-length")), [Re, Ee] = C && wl(
1910
+ const pe = _.toFiniteNumber(D.headers.get("content-length")), [Re, Ie] = C && wl(
1911
1911
  pe,
1912
1912
  Xo(bl(C), !0)
1913
1913
  ) || [];
1914
1914
  D = new r(
1915
1915
  Cl(D.body, Tl, Re, () => {
1916
- Ee && Ee(), j && j();
1916
+ Ie && Ie(), j && j();
1917
1917
  }),
1918
1918
  J
1919
1919
  );
@@ -2951,7 +2951,7 @@ function Dx(e, t) {
2951
2951
  return r ? Object.keys(n).length ? n : void 0 : e;
2952
2952
  }
2953
2953
  function Lx() {
2954
- const e = et(/* @__PURE__ */ new Map()), t = Ce(
2954
+ const e = Ze(/* @__PURE__ */ new Map()), t = Ce(
2955
2955
  (a, l) => {
2956
2956
  const c = e.current.get(a), d = /* @__PURE__ */ new Map();
2957
2957
  c && c.forEach((f) => {
@@ -3052,7 +3052,7 @@ function zx(e, t) {
3052
3052
  }
3053
3053
  }
3054
3054
  function Bx(e = []) {
3055
- const [t, n] = im(zx, { ...$x, messages: e }), r = et([]), o = et(null), s = et(null), i = Ce(() => {
3055
+ const [t, n] = im(zx, { ...$x, messages: e }), r = Ze([]), o = Ze(null), s = Ze(null), i = Ce(() => {
3056
3056
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), o.current = null, s.current = null;
3057
3057
  const d = r.current;
3058
3058
  d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
@@ -3398,7 +3398,7 @@ function Vx(e) {
3398
3398
  return t[t.length - 1] || null;
3399
3399
  }
3400
3400
  function Kx(e = {}) {
3401
- const t = lt(() => _n(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ge(e.token ?? null), s = et(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ge(!1), [c, d] = ge(null), [f, p] = ge(""), [h, m] = ge(null), [x, y] = ge(0), [g, w] = ge(!1), b = et(null), T = et(!0), C = et(0), S = et(null), k = et(null), N = et(null), E = et(null), I = Ce((j) => {
3401
+ const t = lt(() => _n(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ge(e.token ?? null), s = Ze(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ge(!1), [c, d] = ge(null), [f, p] = ge(""), [h, m] = ge(null), [x, y] = ge(0), [g, w] = ge(!1), b = Ze(null), T = Ze(!0), C = Ze(0), S = Ze(null), k = Ze(null), N = Ze(null), E = Ze(null), I = Ce((j) => {
3402
3402
  o(j);
3403
3403
  }, []), O = Ce(() => {
3404
3404
  p(""), m(null), d(null), k.current = null, N.current = null, E.current = null;
@@ -3415,34 +3415,34 @@ function Kx(e = {}) {
3415
3415
  threadId: j.threadId ?? null,
3416
3416
  headers: {}
3417
3417
  }, (async () => {
3418
- var pe, Re, Ee, W, ee, U, P, H, te, se, ne, Le, Y, de, ke, Ne, Be, He;
3419
- const J = (We) => {
3420
- var qe;
3418
+ var pe, Re, Ie, U, ee, q, P, H, te, se, ne, De, Y, de, ke, Ae, ze, Be;
3419
+ const J = (Ue) => {
3420
+ var Ke;
3421
3421
  try {
3422
- const Ge = JSON.parse(JSON.stringify(We));
3423
- return (qe = Ge == null ? void 0 : Ge.payload) != null && qe.files_info && Array.isArray(Ge.payload.files_info) && (Ge.payload.files_info = Ge.payload.files_info.map((tt) => ({
3424
- ...tt,
3425
- data: tt != null && tt.data ? `<base64 ${String(tt.data).length} chars>` : tt == null ? void 0 : tt.data
3426
- }))), Ge;
3422
+ const qe = JSON.parse(JSON.stringify(Ue));
3423
+ return (Ke = qe == null ? void 0 : qe.payload) != null && Ke.files_info && Array.isArray(qe.payload.files_info) && (qe.payload.files_info = qe.payload.files_info.map((Qe) => ({
3424
+ ...Qe,
3425
+ data: Qe != null && Qe.data ? `<base64 ${String(Qe.data).length} chars>` : Qe == null ? void 0 : Qe.data
3426
+ }))), qe;
3427
3427
  } catch {
3428
- return We;
3428
+ return Ue;
3429
3429
  }
3430
3430
  };
3431
3431
  try {
3432
- let We = {};
3432
+ let Ue = {};
3433
3433
  try {
3434
3434
  if (r)
3435
- We = { Authorization: `Bearer ${r}` };
3435
+ Ue = { Authorization: `Bearer ${r}` };
3436
3436
  else if (typeof window < "u") {
3437
- const Oe = window.__AUTH_TOKEN__, Pt = ((pe = window.localStorage) == null ? void 0 : pe.getItem("authToken")) || null;
3437
+ const Fe = window.__AUTH_TOKEN__, Pt = ((pe = window.localStorage) == null ? void 0 : pe.getItem("authToken")) || null;
3438
3438
  let jt = null;
3439
3439
  try {
3440
3440
  const ve = (Re = window.localStorage) == null ? void 0 : Re.getItem("chat-settings");
3441
- ve && (jt = ((Ee = JSON.parse(ve)) == null ? void 0 : Ee.apiKey) || null);
3441
+ ve && (jt = ((Ie = JSON.parse(ve)) == null ? void 0 : Ie.apiKey) || null);
3442
3442
  } catch {
3443
3443
  }
3444
- const K = Oe || Pt || jt || null;
3445
- K && (We = { Authorization: `Bearer ${K}` });
3444
+ const V = Fe || Pt || jt || null;
3445
+ V && (Ue = { Authorization: `Bearer ${V}` });
3446
3446
  }
3447
3447
  } catch {
3448
3448
  }
@@ -3451,69 +3451,69 @@ function Kx(e = {}) {
3451
3451
  t + n,
3452
3452
  J(j)
3453
3453
  );
3454
- let qe = {};
3454
+ let Ke = {};
3455
3455
  if (typeof window < "u")
3456
3456
  try {
3457
- const Fe = (W = window.localStorage) == null ? void 0 : W.getItem("authSessionId");
3458
- Fe && (qe = { "X-Session-Id": Fe });
3457
+ const tt = (U = window.localStorage) == null ? void 0 : U.getItem("authSessionId");
3458
+ tt && (Ke = { "X-Session-Id": tt });
3459
3459
  } catch {
3460
3460
  }
3461
- const Ge = {
3462
- ...We,
3463
- ...qe,
3461
+ const qe = {
3462
+ ...Ue,
3463
+ ...Ke,
3464
3464
  ...s.current
3465
- }, tt = {
3465
+ }, Qe = {
3466
3466
  "Content-Type": "application/json",
3467
3467
  Accept: "text/event-stream",
3468
- ...Ge
3469
- }, Qe = await fetch(t + n, {
3468
+ ...qe
3469
+ }, Je = await fetch(t + n, {
3470
3470
  method: "POST",
3471
- headers: tt,
3471
+ headers: Qe,
3472
3472
  body: JSON.stringify(j),
3473
3473
  signal: B.signal,
3474
3474
  credentials: i
3475
3475
  });
3476
- if (S.current && (S.current.headers = Ge), !Qe.ok || !Qe.body) {
3477
- const Fe = await Qe.text().catch(() => "");
3476
+ if (S.current && (S.current.headers = qe), !Je.ok || !Je.body) {
3477
+ const tt = await Je.text().catch(() => "");
3478
3478
  console.debug(
3479
3479
  "[use-chat] non-OK response",
3480
- Qe.status,
3481
- Fe == null ? void 0 : Fe.slice(0, 500)
3480
+ Je.status,
3481
+ tt == null ? void 0 : tt.slice(0, 500)
3482
3482
  );
3483
- const Oe = `stream ${Qe.status}${Fe ? ": " + Fe : ""}`;
3484
- throw (ee = A == null ? void 0 : A.onConnectionError) == null || ee.call(A, Oe), Z = !0, D = "error", M = Oe, new Error(Oe);
3483
+ const Fe = `stream ${Je.status}${tt ? ": " + tt : ""}`;
3484
+ throw (ee = A == null ? void 0 : A.onConnectionError) == null || ee.call(A, Fe), Z = !0, D = "error", M = Fe, new Error(Fe);
3485
3485
  }
3486
3486
  w(!0);
3487
- const ot = Qe.body.getReader(), St = new TextDecoder();
3487
+ const ot = Je.body.getReader(), St = new TextDecoder();
3488
3488
  let mt = "", ct = [];
3489
3489
  C.current = 0, y(0);
3490
3490
  let Ct = 0, ce = null;
3491
3491
  const re = () => {
3492
3492
  if (ct.length) {
3493
- const Fe = ct.join("");
3494
- ct = [], T.current && p((Oe) => Oe + Fe);
3493
+ const tt = ct.join("");
3494
+ ct = [], T.current && p((Fe) => Fe + tt);
3495
3495
  }
3496
3496
  ce = null;
3497
- }, Ye = () => {
3497
+ }, Ge = () => {
3498
3498
  typeof window < "u" && ce == null && (ce = requestAnimationFrame(re));
3499
3499
  };
3500
- let De = Date.now();
3501
- const Xe = setInterval(() => {
3502
- var Fe;
3503
- if (Date.now() - De > 18e5) {
3504
- const Oe = "Stream idle timeout";
3505
- d(Oe), D = "error", M = Oe, B.abort(), (Fe = A == null ? void 0 : A.onError) == null || Fe.call(A, Oe);
3500
+ let Ee = Date.now();
3501
+ const Oe = setInterval(() => {
3502
+ var tt;
3503
+ if (Date.now() - Ee > 18e5) {
3504
+ const Fe = "Stream idle timeout";
3505
+ d(Fe), D = "error", M = Fe, B.abort(), (tt = A == null ? void 0 : A.onError) == null || tt.call(A, Fe);
3506
3506
  }
3507
- }, 5e3), je = 1024 * 1024;
3507
+ }, 5e3), et = 1024 * 1024;
3508
3508
  try {
3509
- const Fe = Qe.headers.get("X-Thread-Id") || Qe.headers.get("x-thread-id"), Oe = Qe.headers.get("X-Thread-Created") || Qe.headers.get("x-thread-created"), Pt = Fe ?? null, jt = String(Oe ?? "").toLowerCase() === "true";
3509
+ const tt = Je.headers.get("X-Thread-Id") || Je.headers.get("x-thread-id"), Fe = Je.headers.get("X-Thread-Created") || Je.headers.get("x-thread-created"), Pt = tt ?? null, jt = String(Fe ?? "").toLowerCase() === "true";
3510
3510
  for (S.current && !S.current.threadId && (S.current = {
3511
3511
  ...S.current,
3512
3512
  threadId: Pt
3513
- }), (U = A == null ? void 0 : A.onOpen) == null || U.call(A, { threadId: Pt, created: jt }); ; ) {
3514
- const { value: K, done: ve } = await ot.read();
3513
+ }), (q = A == null ? void 0 : A.onOpen) == null || q.call(A, { threadId: Pt, created: jt }); ; ) {
3514
+ const { value: V, done: ve } = await ot.read();
3515
3515
  if (ve) break;
3516
- mt += St.decode(K, { stream: !0 }), mt.length > je && (mt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3516
+ mt += St.decode(V, { stream: !0 }), mt.length > et && (mt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3517
3517
  let xe;
3518
3518
  for (; (xe = mt.indexOf(`
3519
3519
 
@@ -3530,7 +3530,7 @@ function Kx(e = {}) {
3530
3530
  continue;
3531
3531
  }
3532
3532
  const _e = qx(Tt) ? Tt.data : Tt;
3533
- De = Date.now();
3533
+ Ee = Date.now();
3534
3534
  const Vt = _e.seq;
3535
3535
  if (Vt !== void 0) {
3536
3536
  if (Vt <= Ct) {
@@ -3567,10 +3567,10 @@ function Kx(e = {}) {
3567
3567
  console.error("[use-chat] Error in onEvent callback:", ut, "for event:", _e.type);
3568
3568
  }
3569
3569
  if (_e.type === "token" && e.autoAppendAssistant !== !1)
3570
- ct.push(_e.content), Ye();
3570
+ ct.push(_e.content), Ge();
3571
3571
  else if (_e.type === "message_delta") {
3572
3572
  const ut = _e.delta.filter((kt) => kt.type === "text").map((kt) => kt.text).join("");
3573
- ut && e.autoAppendAssistant !== !1 && (ct.push(ut), Ye());
3573
+ ut && e.autoAppendAssistant !== !1 && (ct.push(ut), Ge());
3574
3574
  } else if (_e.type === "heartbeat") {
3575
3575
  console.debug("[use-chat] heartbeat received");
3576
3576
  try {
@@ -3582,7 +3582,7 @@ function Kx(e = {}) {
3582
3582
  m(_e.checkpointId);
3583
3583
  else if (_e.type === "error") {
3584
3584
  const ut = _e;
3585
- if (d(ut.message), D = "error", M = ut.message, ut.error_type === "auth_error" || ut.code === "TOKEN_EXPIRED" || ((te = ut.message) == null ? void 0 : te.includes("token")) || ((se = ut.message) == null ? void 0 : se.includes("401")) || ((ne = ut.message) == null ? void 0 : ne.includes("unauthorized")) || ((Le = ut.message) == null ? void 0 : Le.includes("Unauthorized"))) {
3585
+ if (d(ut.message), D = "error", M = ut.message, ut.error_type === "auth_error" || ut.code === "TOKEN_EXPIRED" || ((te = ut.message) == null ? void 0 : te.includes("token")) || ((se = ut.message) == null ? void 0 : se.includes("401")) || ((ne = ut.message) == null ? void 0 : ne.includes("unauthorized")) || ((De = ut.message) == null ? void 0 : De.includes("Unauthorized"))) {
3586
3586
  console.error("[use-chat] Auth error detected:", ut.message);
3587
3587
  try {
3588
3588
  (Y = A == null ? void 0 : A.onAuthError) == null || Y.call(A, ut.message);
@@ -3595,12 +3595,12 @@ function Kx(e = {}) {
3595
3595
  }
3596
3596
  }
3597
3597
  re(), D === null && !B.signal.aborted && (D = "complete");
3598
- } catch (Fe) {
3599
- if (Fe.name === "AbortError")
3598
+ } catch (tt) {
3599
+ if (tt.name === "AbortError")
3600
3600
  D = D ?? "aborted";
3601
3601
  else {
3602
- const Oe = Fe.message || String(Fe);
3603
- D = "error", M = Oe, d(Oe), (de = A == null ? void 0 : A.onError) == null || de.call(A, Oe);
3602
+ const Fe = tt.message || String(tt);
3603
+ D = "error", M = Fe, d(Fe), (de = A == null ? void 0 : A.onError) == null || de.call(A, Fe);
3604
3604
  }
3605
3605
  } finally {
3606
3606
  try {
@@ -3609,24 +3609,24 @@ function Kx(e = {}) {
3609
3609
  } finally {
3610
3610
  (ke = ot.releaseLock) == null || ke.call(ot);
3611
3611
  }
3612
- ce !== null && typeof window < "u" && window.cancelAnimationFrame(ce), clearInterval(Xe);
3612
+ ce !== null && typeof window < "u" && window.cancelAnimationFrame(ce), clearInterval(Oe);
3613
3613
  }
3614
- } catch (We) {
3615
- if (We.name === "AbortError")
3614
+ } catch (Ue) {
3615
+ if (Ue.name === "AbortError")
3616
3616
  D = D ?? "aborted";
3617
3617
  else {
3618
- const qe = We.message || String(We);
3619
- D = "error", M = qe, d(qe), (Ne = A == null ? void 0 : A.onError) == null || Ne.call(A, qe), Z || ((Be = A == null ? void 0 : A.onConnectionError) == null || Be.call(A, qe), Z = !0);
3618
+ const Ke = Ue.message || String(Ue);
3619
+ D = "error", M = Ke, d(Ke), (Ae = A == null ? void 0 : A.onError) == null || Ae.call(A, Ke), Z || ((ze = A == null ? void 0 : A.onConnectionError) == null || ze.call(A, Ke), Z = !0);
3620
3620
  }
3621
3621
  } finally {
3622
- const We = C.current, qe = k.current, Ge = N.current, tt = E.current, Qe = D ?? (B.signal.aborted ? "aborted" : M ? "error" : "complete");
3622
+ const Ue = C.current, Ke = k.current, qe = N.current, Qe = E.current, Je = D ?? (B.signal.aborted ? "aborted" : M ? "error" : "complete");
3623
3623
  try {
3624
- (He = A == null ? void 0 : A.onClosed) == null || He.call(A, {
3625
- reason: Qe,
3626
- lastSeq: We,
3627
- lastCheckpointId: qe,
3628
- lastCheckpointNs: Ge,
3629
- lastStateHistory: tt,
3624
+ (Be = A == null ? void 0 : A.onClosed) == null || Be.call(A, {
3625
+ reason: Je,
3626
+ lastSeq: Ue,
3627
+ lastCheckpointId: Ke,
3628
+ lastCheckpointNs: qe,
3629
+ lastStateHistory: Qe,
3630
3630
  error: M
3631
3631
  });
3632
3632
  } catch (ot) {
@@ -3679,7 +3679,7 @@ function Yx({
3679
3679
  onAuthError: a,
3680
3680
  onHeartbeat: l
3681
3681
  }) {
3682
- const c = et(null), d = et(null), f = et(/* @__PURE__ */ new Map()), p = et(null), h = Ce((E) => {
3682
+ const c = Ze(null), d = Ze(null), f = Ze(/* @__PURE__ */ new Map()), p = Ze(null), h = Ce((E) => {
3683
3683
  try {
3684
3684
  const I = globalThis.structuredClone;
3685
3685
  if (typeof I == "function")
@@ -3875,18 +3875,18 @@ function Xx({
3875
3875
  onThreadChange: a,
3876
3876
  checkpointMetadataCache: l
3877
3877
  }) {
3878
- const { api: c, baseUrl: d } = Tu(), f = lt(() => _n(d), [d]), [p, h] = ge([]), [m, x] = ge(t), [y, g] = ge(!1), [w, b] = ge(null), [T, C] = ge(!1), [S, k] = ge(null), { state: N, seed: E, prepend: I, pushUser: O, onEvent: L } = Bx(), [F, j] = ge(!1), [$, A] = ge(!1), [B, D] = ge(null), [M, Z] = ge([]), [J, pe] = ge(!1), Re = l ?? Lx(), { setCacheForThread: Ee } = Re, W = et(m), ee = et(null), U = et(!1);
3878
+ const { api: c, baseUrl: d } = Tu(), f = lt(() => _n(d), [d]), [p, h] = ge([]), [m, x] = ge(t), [y, g] = ge(!1), [w, b] = ge(null), [T, C] = ge(!1), [S, k] = ge(null), { state: N, seed: E, prepend: I, pushUser: O, onEvent: L } = Bx(), [F, j] = ge(!1), [$, A] = ge(!1), [B, D] = ge(null), [M, Z] = ge([]), [J, pe] = ge(!1), Re = l ?? Lx(), { setCacheForThread: Ie } = Re, U = Ze(m), ee = Ze(null), q = Ze(!1);
3879
3879
  Et(() => {
3880
- W.current = m;
3880
+ U.current = m;
3881
3881
  }, [m]);
3882
- const P = et(), { startStream: H, stop: te, isStreaming: se, error: ne, setAuthToken: Le } = Yx({
3882
+ const P = Ze(), { startStream: H, stop: te, isStreaming: se, error: ne, setAuthToken: De } = Yx({
3883
3883
  baseUrl: f,
3884
3884
  onThreadInfo: (ce) => {
3885
- if (console.log("[ChatSessionProvider] Thread info:", ce.threadId), W.current === null) {
3885
+ if (console.log("[ChatSessionProvider] Thread info:", ce.threadId), U.current === null) {
3886
3886
  console.log("[ChatSessionProvider] Ignoring thread info: no active thread (new chat mode)");
3887
3887
  return;
3888
3888
  }
3889
- W.current !== ce.threadId && x(ce.threadId);
3889
+ U.current !== ce.threadId && x(ce.threadId);
3890
3890
  },
3891
3891
  onMessageEvent: L,
3892
3892
  onUnhandledEvent: (ce) => {
@@ -3917,114 +3917,92 @@ function Xx({
3917
3917
  ), ke = Ce(
3918
3918
  async (ce) => {
3919
3919
  try {
3920
- await c.deleteThread(ce), W.current === ce && (x(null), E([], {})), await Y();
3920
+ await c.deleteThread(ce), U.current === ce && (x(null), E([], {})), await Y();
3921
3921
  } catch (re) {
3922
3922
  s == null || s(String(re));
3923
3923
  }
3924
3924
  },
3925
3925
  [c, Y, E, s]
3926
- ), Ne = Ce(
3926
+ ), Ae = Ce(
3927
3927
  async (ce, re) => {
3928
3928
  try {
3929
3929
  await c.updateThread(ce, re), await Y();
3930
- } catch (Ye) {
3931
- s == null || s(String(Ye));
3930
+ } catch (Ge) {
3931
+ s == null || s(String(Ge));
3932
3932
  }
3933
3933
  },
3934
3934
  [c, Y, s]
3935
- ), Be = Ce(
3936
- (ce, re, Ye) => {
3937
- const De = re.filter((Xe) => Xe.checkpointId).map((Xe) => ({
3938
- checkpointId: Xe.checkpointId,
3939
- checkpointNs: Xe.checkpointNs ?? void 0,
3940
- createdAt: Xe.createdAt ?? ""
3935
+ ), ze = Ce(
3936
+ (ce, re, Ge) => {
3937
+ const Ee = re.filter((Oe) => Oe.checkpointId).map((Oe) => ({
3938
+ checkpointId: Oe.checkpointId,
3939
+ checkpointNs: Oe.checkpointNs ?? void 0,
3940
+ createdAt: Oe.createdAt ?? ""
3941
3941
  }));
3942
- console.log(`[ChatSessionProvider] Cached metadata for ${De.length} checkpoints from ${Ye}`), Ee(ce, De);
3942
+ console.log(`[ChatSessionProvider] Cached metadata for ${Ee.length} checkpoints from ${Ge}`), Ie(ce, Ee);
3943
3943
  },
3944
- [Ee]
3945
- ), He = Ce(
3944
+ [Ie]
3945
+ ), Be = Ce(
3946
3946
  async (ce, re) => {
3947
- if (!ce) return;
3948
- if (U.current) {
3949
- console.log("[ChatSessionProvider] Skipping thread load - cleanup in progress");
3950
- return;
3951
- }
3952
- C(!0), k(null);
3953
- let Ye = !0;
3954
- try {
3955
- const De = await c.getStateHistory({
3956
- threadId: ce,
3957
- checkpointId: re || void 0
3958
- // Let backend pick latest if not specified
3959
- });
3960
- if (U.current) {
3961
- console.log("[ChatSessionProvider] Discarding thread load - thread was cleared"), Ye = !1;
3962
- return;
3963
- }
3964
- const { checkpoints: Xe } = Ur(De);
3965
- Be(ce, Xe, `thread load (requested: ${re})`);
3966
- const je = Xe.find((Fe) => Fe.messages && Fe.messages.length > 0) ?? (re ? Xe.find((Fe) => Fe.checkpointId === re) : null) ?? Xe[0];
3967
- E((je == null ? void 0 : je.messages) ?? [], {
3968
- checkpointId: (je == null ? void 0 : je.checkpointId) ?? null,
3969
- checkpointNs: (je == null ? void 0 : je.checkpointNs) ?? null
3970
- }), Z(Xe), j(!!(je != null && je.nextCursor)), D((je == null ? void 0 : je.nextCursor) ?? null);
3971
- } catch (De) {
3972
- if (U.current)
3973
- console.log("[ChatSessionProvider] Error during thread load, but cleanup in progress - ignoring"), Ye = !1;
3974
- else {
3975
- const Xe = String(De);
3976
- k(Xe), s == null || s(Xe);
3947
+ if (ce) {
3948
+ C(!0), k(null);
3949
+ try {
3950
+ const Ge = await c.getStateHistory({
3951
+ threadId: ce,
3952
+ checkpointId: re || void 0
3953
+ // Let backend pick latest if not specified
3954
+ }), { checkpoints: Ee } = Ur(Ge);
3955
+ ze(ce, Ee, `thread load (requested: ${re})`);
3956
+ const Oe = Ee.find((et) => et.messages && et.messages.length > 0) ?? (re ? Ee.find((et) => et.checkpointId === re) : null) ?? Ee[0];
3957
+ E((Oe == null ? void 0 : Oe.messages) ?? [], {
3958
+ checkpointId: (Oe == null ? void 0 : Oe.checkpointId) ?? null,
3959
+ checkpointNs: (Oe == null ? void 0 : Oe.checkpointNs) ?? null
3960
+ }), Z(Ee), j(!!(Oe != null && Oe.nextCursor)), D((Oe == null ? void 0 : Oe.nextCursor) ?? null);
3961
+ } catch (Ge) {
3962
+ const Ee = String(Ge);
3963
+ k(Ee), s == null || s(Ee);
3964
+ } finally {
3965
+ C(!1);
3977
3966
  }
3978
- } finally {
3979
- Ye && C(!1);
3980
3967
  }
3981
3968
  },
3982
- [c, E, s, Be]
3969
+ [c, E, s, ze]
3983
3970
  );
3984
3971
  Et(() => {
3985
- P.current = He;
3986
- }, [He]);
3987
- const We = Ce(
3972
+ P.current = Be;
3973
+ }, [Be]);
3974
+ const Ue = Ce(
3988
3975
  async (ce, re) => {
3989
- const Ye = W.current;
3990
- if (!Ye) return;
3991
- if (U.current) {
3992
- console.log("[ChatSessionProvider] Skipping checkpoint navigation - cleanup in progress");
3993
- return;
3994
- }
3995
- pe(!0);
3996
- let De = !0;
3997
- try {
3998
- const Xe = await c.getStateHistory({
3999
- threadId: Ye,
4000
- checkpointId: ce,
4001
- checkpointNs: re ?? void 0
4002
- });
4003
- if (U.current) {
4004
- console.log("[ChatSessionProvider] Discarding checkpoint navigation - thread was cleared"), De = !1;
4005
- return;
4006
- }
4007
- const { checkpoints: je } = Ur(Xe);
4008
- Be(Ye, je, "checkpoint navigation");
4009
- const Fe = je.find(
4010
- (Oe) => Oe.checkpointId === ce && (re ? Oe.checkpointNs === re : !0)
4011
- );
4012
- if (!Fe) {
4013
- console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: ce, checkpointNs: re });
4014
- return;
3976
+ const Ge = U.current;
3977
+ if (Ge) {
3978
+ pe(!0);
3979
+ try {
3980
+ const Ee = await c.getStateHistory({
3981
+ threadId: Ge,
3982
+ checkpointId: ce,
3983
+ checkpointNs: re ?? void 0
3984
+ }), { checkpoints: Oe } = Ur(Ee);
3985
+ ze(Ge, Oe, "checkpoint navigation");
3986
+ const et = Oe.find(
3987
+ (tt) => tt.checkpointId === ce && (re ? tt.checkpointNs === re : !0)
3988
+ );
3989
+ if (!et) {
3990
+ console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: ce, checkpointNs: re });
3991
+ return;
3992
+ }
3993
+ Z(Oe), E(et.messages ?? [], {
3994
+ checkpointId: et.checkpointId ?? null,
3995
+ checkpointNs: et.checkpointNs ?? null
3996
+ });
3997
+ } catch (Ee) {
3998
+ s == null || s(String(Ee));
3999
+ } finally {
4000
+ pe(!1);
4015
4001
  }
4016
- Z(je), E(Fe.messages ?? [], {
4017
- checkpointId: Fe.checkpointId ?? null,
4018
- checkpointNs: Fe.checkpointNs ?? null
4019
- });
4020
- } catch (Xe) {
4021
- U.current ? (console.log("[ChatSessionProvider] Error during checkpoint navigation, but cleanup in progress - ignoring"), De = !1) : s == null || s(String(Xe));
4022
- } finally {
4023
- De && pe(!1);
4024
4002
  }
4025
4003
  },
4026
- [c, E, s, Be]
4027
- ), qe = Ce(
4004
+ [c, E, s, ze]
4005
+ ), Ke = Ce(
4028
4006
  (ce, re) => {
4029
4007
  E(N.messages, {
4030
4008
  checkpointId: ce ?? null,
@@ -4032,11 +4010,11 @@ function Xx({
4032
4010
  });
4033
4011
  },
4034
4012
  [E, N.messages]
4035
- ), Ge = Ce(async () => {
4036
- W.current && await He(W.current);
4037
- }, [He]), tt = Ce(async () => {
4038
- if (!W.current || !B) return;
4039
- if (U.current) {
4013
+ ), qe = Ce(async () => {
4014
+ U.current && await Be(U.current);
4015
+ }, [Be]), Qe = Ce(async () => {
4016
+ if (!U.current || !B) return;
4017
+ if (q.current) {
4040
4018
  console.log("[ChatSessionProvider] Skipping history load - thread cleanup in progress");
4041
4019
  return;
4042
4020
  }
@@ -4044,42 +4022,42 @@ function Xx({
4044
4022
  let ce = !0;
4045
4023
  try {
4046
4024
  const re = await c.getStateHistory({
4047
- threadId: W.current,
4025
+ threadId: U.current,
4048
4026
  checkpointId: B
4049
4027
  });
4050
- if (U.current) {
4028
+ if (q.current) {
4051
4029
  console.log("[ChatSessionProvider] Discarding history fetch - thread was cleared"), ce = !1;
4052
4030
  return;
4053
4031
  }
4054
- const { checkpoints: Ye } = Ur(re);
4055
- if (Ye.length > 0) {
4056
- const De = Ye[Ye.length - 1];
4057
- I((De == null ? void 0 : De.messages) ?? []), j(!!(De != null && De.nextCursor)), D((De == null ? void 0 : De.nextCursor) ?? null);
4032
+ const { checkpoints: Ge } = Ur(re);
4033
+ if (Ge.length > 0) {
4034
+ const Ee = Ge[Ge.length - 1];
4035
+ I((Ee == null ? void 0 : Ee.messages) ?? []), j(!!(Ee != null && Ee.nextCursor)), D((Ee == null ? void 0 : Ee.nextCursor) ?? null);
4058
4036
  }
4059
4037
  } catch (re) {
4060
- U.current ? (console.log("[ChatSessionProvider] Error during history fetch, but cleanup in progress - ignoring"), ce = !1) : s == null || s(String(re));
4038
+ q.current ? (console.log("[ChatSessionProvider] Error during history fetch, but cleanup in progress - ignoring"), ce = !1) : s == null || s(String(re));
4061
4039
  } finally {
4062
4040
  ce && A(!1);
4063
4041
  }
4064
- }, [c, B, I, s]), Qe = Ce(async () => {
4065
- U.current = !0, te(), W.current = null, ee.current = null, E([], {}), Z([]), j(!1), D(null), x(null), C(!1), A(!1), pe(!1), await Promise.resolve(), await Promise.resolve(), U.current = !1;
4042
+ }, [c, B, I, s]), Je = Ce(async () => {
4043
+ q.current = !0, te(), U.current = null, ee.current = null, E([], {}), Z([]), j(!1), D(null), x(null), await Promise.resolve(), q.current = !1;
4066
4044
  }, [E, te]), ot = Ce(
4067
- async (ce, re, Ye) => {
4068
- const De = W.current;
4069
- if (!De)
4045
+ async (ce, re, Ge) => {
4046
+ const Ee = U.current;
4047
+ if (!Ee)
4070
4048
  throw new Error("No active thread to handle interrupt");
4071
- const Xe = re ? Ye ?? !0 : !1;
4049
+ const Oe = re ? Ge ?? !0 : !1;
4072
4050
  try {
4073
- const je = {
4074
- threadId: De,
4051
+ const et = {
4052
+ threadId: Ee,
4075
4053
  checkpointId: N.lastCheckpointId ?? void 0,
4076
4054
  checkpointNs: N.lastCheckpointNs ?? void 0,
4077
4055
  // The command is the key: backend extracts this and routes to LangGraph
4078
- command: { kind: "resume", value: Xe }
4056
+ command: { kind: "resume", value: Oe }
4079
4057
  };
4080
- H(je);
4081
- } catch (je) {
4082
- throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${ce}:`, je), je;
4058
+ H(et);
4059
+ } catch (et) {
4060
+ throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${ce}:`, et), et;
4083
4061
  }
4084
4062
  },
4085
4063
  [N.lastCheckpointId, N.lastCheckpointNs, H]
@@ -4088,42 +4066,36 @@ function Xx({
4088
4066
  Y();
4089
4067
  }, [Y]), Et(() => {
4090
4068
  var ce, re;
4091
- if (!(!o || !m || T)) {
4092
- if (U.current) {
4093
- console.log("[ChatSessionProvider] Skipping load - cleanup in progress");
4094
- return;
4095
- }
4096
- ee.current !== m && (ee.current = m, n ? (console.log("[ChatSessionProvider] Loading thread with checkpoint:", n), (ce = P.current) == null || ce.call(P, m, n)) : (console.log("[ChatSessionProvider] Loading thread with latest checkpoint"), (re = P.current) == null || re.call(P, m)));
4097
- }
4069
+ !o || !m || T || ee.current !== m && (ee.current = m, n ? (console.log("[ChatSessionProvider] Loading thread with checkpoint:", n), (ce = P.current) == null || ce.call(P, m, n)) : (console.log("[ChatSessionProvider] Loading thread with latest checkpoint"), (re = P.current) == null || re.call(P, m)));
4098
4070
  }, [o, m, T, n, r]), Et(() => {
4099
4071
  a == null || a(m);
4100
4072
  }, [m, a]);
4101
4073
  const St = Ce(
4102
4074
  async (ce, re) => {
4103
- const Ye = W.current, De = (ce == null ? void 0 : ce.text) ?? "";
4104
- if (!Ye && !De) return;
4105
- if (!Ye) {
4075
+ const Ge = U.current, Ee = (ce == null ? void 0 : ce.text) ?? "";
4076
+ if (!Ge && !Ee) return;
4077
+ if (!Ge) {
4106
4078
  await de("New Chat");
4107
4079
  return;
4108
4080
  }
4109
- const { contentParts: Xe } = await wx(
4081
+ const { contentParts: Oe } = await wx(
4110
4082
  c,
4111
4083
  (ce == null ? void 0 : ce.attachments) ?? []
4112
- ), je = [...Xe];
4113
- De != null && De.trim() && je.push({ type: "text", text: De });
4114
- const Fe = {
4084
+ ), et = [...Oe];
4085
+ Ee != null && Ee.trim() && et.push({ type: "text", text: Ee });
4086
+ const tt = {
4115
4087
  id: `msg-${Date.now()}`,
4116
4088
  role: "user",
4117
- content: je,
4089
+ content: et,
4118
4090
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
4119
4091
  };
4120
- O(Fe);
4121
- const Oe = {
4122
- threadId: Ye,
4092
+ O(tt);
4093
+ const Fe = {
4094
+ threadId: Ge,
4123
4095
  checkpointId: (re == null ? void 0 : re.checkpointId) ?? N.lastCheckpointId ?? void 0,
4124
4096
  checkpointNs: (re == null ? void 0 : re.checkpointNs) ?? N.lastCheckpointNs ?? void 0
4125
4097
  };
4126
- H(Oe);
4098
+ H(Fe);
4127
4099
  },
4128
4100
  [c, de, O, N, H]
4129
4101
  ), mt = lt(
@@ -4136,11 +4108,11 @@ function Xx({
4136
4108
  actions: {
4137
4109
  createThread: de,
4138
4110
  deleteThread: ke,
4139
- renameThread: Ne,
4111
+ renameThread: Ae,
4140
4112
  refreshThreads: Y
4141
4113
  }
4142
4114
  }),
4143
- [p, m, y, w, de, ke, Ne, Y]
4115
+ [p, m, y, w, de, ke, Ae, Y]
4144
4116
  ), ct = lt(
4145
4117
  () => ({
4146
4118
  threadId: m,
@@ -4157,13 +4129,13 @@ function Xx({
4157
4129
  isLoadingCheckpoint: J,
4158
4130
  error: S,
4159
4131
  hasMore: F,
4160
- loadOlder: tt,
4161
- clearState: Qe,
4162
- navigateToCheckpoint: We,
4163
- setCurrentCheckpointId: qe,
4164
- returnToLatest: Ge,
4165
- loadThread: He,
4166
- clearThread: Qe,
4132
+ loadOlder: Qe,
4133
+ clearState: Je,
4134
+ navigateToCheckpoint: Ue,
4135
+ setCurrentCheckpointId: Ke,
4136
+ returnToLatest: qe,
4137
+ loadThread: Be,
4138
+ clearThread: Je,
4167
4139
  respondToInterrupt: ot
4168
4140
  }),
4169
4141
  [
@@ -4175,12 +4147,12 @@ function Xx({
4175
4147
  J,
4176
4148
  S,
4177
4149
  F,
4178
- tt,
4179
4150
  Qe,
4180
- We,
4151
+ Je,
4152
+ Ue,
4153
+ Ke,
4181
4154
  qe,
4182
- Ge,
4183
- He,
4155
+ Be,
4184
4156
  ot
4185
4157
  ]
4186
4158
  ), Ct = lt(
@@ -4191,9 +4163,9 @@ function Xx({
4191
4163
  submit: St,
4192
4164
  send: St,
4193
4165
  stop: te,
4194
- setAuthToken: Le
4166
+ setAuthToken: De
4195
4167
  }),
4196
- [se, ne, St, te, Le]
4168
+ [se, ne, St, te, De]
4197
4169
  );
4198
4170
  return /* @__PURE__ */ u.jsx(Au.Provider, { value: mt, children: /* @__PURE__ */ u.jsx(ju.Provider, { value: ct, children: /* @__PURE__ */ u.jsx(_u.Provider, { value: Ct, children: e }) }) });
4199
4171
  }
@@ -4434,7 +4406,7 @@ function va(...e) {
4434
4406
  };
4435
4407
  };
4436
4408
  }
4437
- function Ke(...e) {
4409
+ function Ve(...e) {
4438
4410
  return v.useCallback(va(...e), e);
4439
4411
  }
4440
4412
  function ty(e, t) {
@@ -4569,7 +4541,7 @@ var iy = [
4569
4541
  "span",
4570
4542
  "svg",
4571
4543
  "ul"
4572
- ], Ae = iy.reduce((e, t) => {
4544
+ ], je = iy.reduce((e, t) => {
4573
4545
  const n = Tr(`Primitive.${t}`), r = v.forwardRef((o, s) => {
4574
4546
  const { asChild: i, ...a } = o, l = i ? n : t;
4575
4547
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u.jsx(l, { ...a, ref: s });
@@ -4590,14 +4562,14 @@ function wa(e) {
4590
4562
  i.displayName = t;
4591
4563
  const a = e + "CollectionSlot", l = Tr(a), c = z.forwardRef(
4592
4564
  (x, y) => {
4593
- const { scope: g, children: w } = x, b = s(a, g), T = Ke(y, b.collectionRef);
4565
+ const { scope: g, children: w } = x, b = s(a, g), T = Ve(y, b.collectionRef);
4594
4566
  return /* @__PURE__ */ u.jsx(l, { ref: T, children: w });
4595
4567
  }
4596
4568
  );
4597
4569
  c.displayName = a;
4598
4570
  const d = e + "CollectionItemSlot", f = "data-radix-collection-item", p = Tr(d), h = z.forwardRef(
4599
4571
  (x, y) => {
4600
- const { scope: g, children: w, ...b } = x, T = z.useRef(null), C = Ke(y, T), S = s(d, g);
4572
+ const { scope: g, children: w, ...b } = x, T = z.useRef(null), C = Ve(y, T), S = s(d, g);
4601
4573
  return z.useEffect(() => (S.itemMap.set(T, { ref: T, ...b }), () => void S.itemMap.delete(T))), /* @__PURE__ */ u.jsx(p, { [f]: "", ref: C, children: w });
4602
4574
  }
4603
4575
  );
@@ -4656,7 +4628,7 @@ var cy = "DismissableLayer", Bi = "dismissableLayer.update", uy = "dismissableLa
4656
4628
  onInteractOutside: i,
4657
4629
  onDismiss: a,
4658
4630
  ...l
4659
- } = e, c = v.useContext(Mu), [d, f] = v.useState(null), p = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = v.useState({}), m = Ke(t, (k) => f(k)), x = Array.from(c.layers), [y] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), g = x.indexOf(y), w = d ? x.indexOf(d) : -1, b = c.layersWithOutsidePointerEventsDisabled.size > 0, T = w >= g, C = hy((k) => {
4631
+ } = e, c = v.useContext(Mu), [d, f] = v.useState(null), p = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = v.useState({}), m = Ve(t, (k) => f(k)), x = Array.from(c.layers), [y] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), g = x.indexOf(y), w = d ? x.indexOf(d) : -1, b = c.layersWithOutsidePointerEventsDisabled.size > 0, T = w >= g, C = hy((k) => {
4660
4632
  const N = k.target, E = [...c.branches].some((I) => I.contains(N));
4661
4633
  !T || E || (o == null || o(k), i == null || i(k), k.defaultPrevented || a == null || a());
4662
4634
  }, p), S = my((k) => {
@@ -4676,7 +4648,7 @@ var cy = "DismissableLayer", Bi = "dismissableLayer.update", uy = "dismissableLa
4676
4648
  const k = () => h({});
4677
4649
  return document.addEventListener(Bi, k), () => document.removeEventListener(Bi, k);
4678
4650
  }, []), /* @__PURE__ */ u.jsx(
4679
- Ae.div,
4651
+ je.div,
4680
4652
  {
4681
4653
  ...l,
4682
4654
  ref: m,
@@ -4696,14 +4668,14 @@ var cy = "DismissableLayer", Bi = "dismissableLayer.update", uy = "dismissableLa
4696
4668
  );
4697
4669
  Es.displayName = cy;
4698
4670
  var fy = "DismissableLayerBranch", py = v.forwardRef((e, t) => {
4699
- const n = v.useContext(Mu), r = v.useRef(null), o = Ke(t, r);
4671
+ const n = v.useContext(Mu), r = v.useRef(null), o = Ve(t, r);
4700
4672
  return v.useEffect(() => {
4701
4673
  const s = r.current;
4702
4674
  if (s)
4703
4675
  return n.branches.add(s), () => {
4704
4676
  n.branches.delete(s);
4705
4677
  };
4706
- }, [n.branches]), /* @__PURE__ */ u.jsx(Ae.div, { ...e, ref: o });
4678
+ }, [n.branches]), /* @__PURE__ */ u.jsx(je.div, { ...e, ref: o });
4707
4679
  });
4708
4680
  py.displayName = fy;
4709
4681
  function hy(e, t = globalThis == null ? void 0 : globalThis.document) {
@@ -4778,7 +4750,7 @@ var hi = "focusScope.autoFocusOnMount", mi = "focusScope.autoFocusOnUnmount", Kl
4778
4750
  onMountAutoFocus: o,
4779
4751
  onUnmountAutoFocus: s,
4780
4752
  ...i
4781
- } = e, [a, l] = v.useState(null), c = Dt(o), d = Dt(s), f = v.useRef(null), p = Ke(t, (x) => l(x)), h = v.useRef({
4753
+ } = e, [a, l] = v.useState(null), c = Dt(o), d = Dt(s), f = v.useRef(null), p = Ve(t, (x) => l(x)), h = v.useRef({
4782
4754
  paused: !1,
4783
4755
  pause() {
4784
4756
  this.paused = !0;
@@ -4835,7 +4807,7 @@ var hi = "focusScope.autoFocusOnMount", mi = "focusScope.autoFocusOnUnmount", Kl
4835
4807
  },
4836
4808
  [n, r, h.paused]
4837
4809
  );
4838
- return /* @__PURE__ */ u.jsx(Ae.div, { tabIndex: -1, ...i, ref: p, onKeyDown: m });
4810
+ return /* @__PURE__ */ u.jsx(je.div, { tabIndex: -1, ...i, ref: p, onKeyDown: m });
4839
4811
  });
4840
4812
  Is.displayName = gy;
4841
4813
  function xy(e, { select: t = !1 } = {}) {
@@ -6221,7 +6193,7 @@ const Ev = (e) => {
6221
6193
  var Mv = "Arrow", Yu = v.forwardRef((e, t) => {
6222
6194
  const { children: n, width: r = 10, height: o = 5, ...s } = e;
6223
6195
  return /* @__PURE__ */ u.jsx(
6224
- Ae.svg,
6196
+ je.svg,
6225
6197
  {
6226
6198
  ...s,
6227
6199
  ref: t,
@@ -6264,17 +6236,17 @@ var Ia = "Popper", [Ju, Ps] = Mn(Ia), [Lv, Zu] = Ju(Ia), Qu = (e) => {
6264
6236
  Qu.displayName = Ia;
6265
6237
  var ed = "PopperAnchor", td = v.forwardRef(
6266
6238
  (e, t) => {
6267
- const { __scopePopper: n, virtualRef: r, ...o } = e, s = Zu(ed, n), i = v.useRef(null), a = Ke(t, i), l = v.useRef(null);
6239
+ const { __scopePopper: n, virtualRef: r, ...o } = e, s = Zu(ed, n), i = v.useRef(null), a = Ve(t, i), l = v.useRef(null);
6268
6240
  return v.useEffect(() => {
6269
6241
  const c = l.current;
6270
6242
  l.current = (r == null ? void 0 : r.current) || i.current, c !== l.current && s.onAnchorChange(l.current);
6271
- }), r ? null : /* @__PURE__ */ u.jsx(Ae.div, { ...o, ref: a });
6243
+ }), r ? null : /* @__PURE__ */ u.jsx(je.div, { ...o, ref: a });
6272
6244
  }
6273
6245
  );
6274
6246
  td.displayName = ed;
6275
6247
  var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6276
6248
  (e, t) => {
6277
- var U, P, H, te, se, ne;
6249
+ var q, P, H, te, se, ne;
6278
6250
  const {
6279
6251
  __scopePopper: n,
6280
6252
  side: r = "bottom",
@@ -6290,7 +6262,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6290
6262
  updatePositionStrategy: h = "optimized",
6291
6263
  onPlaced: m,
6292
6264
  ...x
6293
- } = e, y = Zu(Na, n), [g, w] = v.useState(null), b = Ke(t, (Le) => w(Le)), [T, C] = v.useState(null), S = Xu(T), k = (S == null ? void 0 : S.width) ?? 0, N = (S == null ? void 0 : S.height) ?? 0, E = r + (s !== "center" ? "-" + s : ""), I = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, O = Array.isArray(c) ? c : [c], L = O.length > 0, F = {
6265
+ } = e, y = Zu(Na, n), [g, w] = v.useState(null), b = Ve(t, (De) => w(De)), [T, C] = v.useState(null), S = Xu(T), k = (S == null ? void 0 : S.width) ?? 0, N = (S == null ? void 0 : S.height) ?? 0, E = r + (s !== "center" ? "-" + s : ""), I = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, O = Array.isArray(c) ? c : [c], L = O.length > 0, F = {
6294
6266
  padding: I,
6295
6267
  boundary: O.filter(Bv),
6296
6268
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
@@ -6299,7 +6271,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6299
6271
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
6300
6272
  strategy: "fixed",
6301
6273
  placement: E,
6302
- whileElementsMounted: (...Le) => gv(...Le, {
6274
+ whileElementsMounted: (...De) => gv(...De, {
6303
6275
  animationFrame: h === "always"
6304
6276
  }),
6305
6277
  elements: {
@@ -6316,9 +6288,9 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6316
6288
  l && jv({ ...F }),
6317
6289
  _v({
6318
6290
  ...F,
6319
- apply: ({ elements: Le, rects: Y, availableWidth: de, availableHeight: ke }) => {
6320
- const { width: Ne, height: Be } = Y.reference, He = Le.floating.style;
6321
- He.setProperty("--radix-popper-available-width", `${de}px`), He.setProperty("--radix-popper-available-height", `${ke}px`), He.setProperty("--radix-popper-anchor-width", `${Ne}px`), He.setProperty("--radix-popper-anchor-height", `${Be}px`);
6291
+ apply: ({ elements: De, rects: Y, availableWidth: de, availableHeight: ke }) => {
6292
+ const { width: Ae, height: ze } = Y.reference, Be = De.floating.style;
6293
+ Be.setProperty("--radix-popper-available-width", `${de}px`), Be.setProperty("--radix-popper-available-height", `${ke}px`), Be.setProperty("--radix-popper-anchor-width", `${Ae}px`), Be.setProperty("--radix-popper-anchor-height", `${ze}px`);
6322
6294
  }
6323
6295
  }),
6324
6296
  T && Ov({ element: T, padding: a }),
@@ -6329,7 +6301,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6329
6301
  Lt(() => {
6330
6302
  B && (J == null || J());
6331
6303
  }, [B, J]);
6332
- const pe = (U = D.arrow) == null ? void 0 : U.x, Re = (P = D.arrow) == null ? void 0 : P.y, Ee = ((H = D.arrow) == null ? void 0 : H.centerOffset) !== 0, [W, ee] = v.useState();
6304
+ const pe = (q = D.arrow) == null ? void 0 : q.x, Re = (P = D.arrow) == null ? void 0 : P.y, Ie = ((H = D.arrow) == null ? void 0 : H.centerOffset) !== 0, [U, ee] = v.useState();
6333
6305
  return Lt(() => {
6334
6306
  g && ee(window.getComputedStyle(g).zIndex);
6335
6307
  }, [g]), /* @__PURE__ */ u.jsx(
@@ -6342,7 +6314,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6342
6314
  transform: B ? $.transform : "translate(0, -200%)",
6343
6315
  // keep off the page when measuring
6344
6316
  minWidth: "max-content",
6345
- zIndex: W,
6317
+ zIndex: U,
6346
6318
  "--radix-popper-transform-origin": [
6347
6319
  (te = D.transformOrigin) == null ? void 0 : te.x,
6348
6320
  (se = D.transformOrigin) == null ? void 0 : se.y
@@ -6364,9 +6336,9 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6364
6336
  onArrowChange: C,
6365
6337
  arrowX: pe,
6366
6338
  arrowY: Re,
6367
- shouldHideArrow: Ee,
6339
+ shouldHideArrow: Ie,
6368
6340
  children: /* @__PURE__ */ u.jsx(
6369
- Ae.div,
6341
+ je.div,
6370
6342
  {
6371
6343
  "data-side": M,
6372
6344
  "data-align": Z,
@@ -6460,14 +6432,14 @@ var id = Qu, ad = td, ld = nd, cd = od, Uv = "Portal", Os = v.forwardRef((e, t)
6460
6432
  const { container: n, ...r } = e, [o, s] = v.useState(!1);
6461
6433
  Lt(() => s(!0), []);
6462
6434
  const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
6463
- return i ? Zc.createPortal(/* @__PURE__ */ u.jsx(Ae.div, { ...r, ref: t }), i) : null;
6435
+ return i ? Zc.createPortal(/* @__PURE__ */ u.jsx(je.div, { ...r, ref: t }), i) : null;
6464
6436
  });
6465
6437
  Os.displayName = Uv;
6466
6438
  function Wv(e, t) {
6467
6439
  return v.useReducer((n, r) => t[n][r] ?? n, e);
6468
6440
  }
6469
6441
  var cn = (e) => {
6470
- const { present: t, children: n } = e, r = Vv(t), o = typeof n == "function" ? n({ present: r.isPresent }) : v.Children.only(n), s = Ke(r.ref, Kv(o));
6442
+ const { present: t, children: n } = e, r = Vv(t), o = typeof n == "function" ? n({ present: r.isPresent }) : v.Children.only(n), s = Ve(r.ref, Kv(o));
6471
6443
  return typeof n == "function" || r.isPresent ? v.cloneElement(o, { ref: s }) : null;
6472
6444
  };
6473
6445
  cn.displayName = "Presence";
@@ -6547,7 +6519,7 @@ var Zv = v.forwardRef((e, t) => {
6547
6519
  onEntryFocus: c,
6548
6520
  preventScrollOnEntryFocus: d = !1,
6549
6521
  ...f
6550
- } = e, p = v.useRef(null), h = Ke(t, p), m = Rs(s), [x, y] = Rr({
6522
+ } = e, p = v.useRef(null), h = Ve(t, p), m = Rs(s), [x, y] = Rr({
6551
6523
  prop: i,
6552
6524
  defaultProp: a ?? null,
6553
6525
  onChange: l,
@@ -6579,7 +6551,7 @@ var Zv = v.forwardRef((e, t) => {
6579
6551
  []
6580
6552
  ),
6581
6553
  children: /* @__PURE__ */ u.jsx(
6582
- Ae.div,
6554
+ je.div,
6583
6555
  {
6584
6556
  tabIndex: g || S === 0 ? -1 : 0,
6585
6557
  "data-orientation": r,
@@ -6628,7 +6600,7 @@ var Zv = v.forwardRef((e, t) => {
6628
6600
  focusable: r,
6629
6601
  active: o,
6630
6602
  children: /* @__PURE__ */ u.jsx(
6631
- Ae.span,
6603
+ je.span,
6632
6604
  {
6633
6605
  tabIndex: f ? 0 : -1,
6634
6606
  "data-orientation": d.orientation,
@@ -7275,7 +7247,7 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
7275
7247
  }
7276
7248
  ), tb = v.forwardRef(
7277
7249
  (e, t) => {
7278
- const n = fr(an, e.__scopeMenu), r = v.useRef(null), o = Ke(t, r);
7250
+ const n = fr(an, e.__scopeMenu), r = v.useRef(null), o = Ve(t, r);
7279
7251
  return v.useEffect(() => {
7280
7252
  const s = r.current;
7281
7253
  if (s) return Aa(s);
@@ -7326,9 +7298,9 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
7326
7298
  onDismiss: h,
7327
7299
  disableOutsideScroll: m,
7328
7300
  ...x
7329
- } = e, y = fr(an, n), g = yo(an, n), w = Ls(n), b = Rd(n), T = Gw(n), [C, S] = v.useState(null), k = v.useRef(null), N = Ke(t, k, y.onContentChange), E = v.useRef(0), I = v.useRef(""), O = v.useRef(0), L = v.useRef(null), F = v.useRef("right"), j = v.useRef(0), $ = m ? Ds : v.Fragment, A = m ? { as: rb, allowPinchZoom: !0 } : void 0, B = (M) => {
7330
- var U, P;
7331
- const Z = I.current + M, J = T().filter((H) => !H.disabled), pe = document.activeElement, Re = (U = J.find((H) => H.ref.current === pe)) == null ? void 0 : U.textValue, Ee = J.map((H) => H.textValue), W = mb(Ee, Z, Re), ee = (P = J.find((H) => H.textValue === W)) == null ? void 0 : P.ref.current;
7301
+ } = e, y = fr(an, n), g = yo(an, n), w = Ls(n), b = Rd(n), T = Gw(n), [C, S] = v.useState(null), k = v.useRef(null), N = Ve(t, k, y.onContentChange), E = v.useRef(0), I = v.useRef(""), O = v.useRef(0), L = v.useRef(null), F = v.useRef("right"), j = v.useRef(0), $ = m ? Ds : v.Fragment, A = m ? { as: rb, allowPinchZoom: !0 } : void 0, B = (M) => {
7302
+ var q, P;
7303
+ const Z = I.current + M, J = T().filter((H) => !H.disabled), pe = document.activeElement, Re = (q = J.find((H) => H.ref.current === pe)) == null ? void 0 : q.textValue, Ie = J.map((H) => H.textValue), U = mb(Ie, Z, Re), ee = (P = J.find((H) => H.textValue === U)) == null ? void 0 : P.ref.current;
7332
7304
  (function H(te) {
7333
7305
  I.current = te, window.clearTimeout(E.current), te !== "" && (E.current = window.setTimeout(() => H(""), 1e3));
7334
7306
  })(Z), ee && setTimeout(() => ee.focus());
@@ -7415,10 +7387,10 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
7415
7387
  onKeyDown: fe(x.onKeyDown, (M) => {
7416
7388
  const J = M.target.closest("[data-radix-menu-content]") === M.currentTarget, pe = M.ctrlKey || M.altKey || M.metaKey, Re = M.key.length === 1;
7417
7389
  J && (M.key === "Tab" && M.preventDefault(), !pe && Re && B(M.key));
7418
- const Ee = k.current;
7419
- if (M.target !== Ee || !Vw.includes(M.key)) return;
7390
+ const Ie = k.current;
7391
+ if (M.target !== Ie || !Vw.includes(M.key)) return;
7420
7392
  M.preventDefault();
7421
- const ee = T().filter((U) => !U.disabled).map((U) => U.ref.current);
7393
+ const ee = T().filter((q) => !q.disabled).map((q) => q.ref.current);
7422
7394
  Td.includes(M.key) && ee.reverse(), pb(ee);
7423
7395
  }),
7424
7396
  onBlur: fe(e.onBlur, (M) => {
@@ -7450,20 +7422,20 @@ Ad.displayName = an;
7450
7422
  var ob = "MenuGroup", Ma = v.forwardRef(
7451
7423
  (e, t) => {
7452
7424
  const { __scopeMenu: n, ...r } = e;
7453
- return /* @__PURE__ */ u.jsx(Ae.div, { role: "group", ...r, ref: t });
7425
+ return /* @__PURE__ */ u.jsx(je.div, { role: "group", ...r, ref: t });
7454
7426
  }
7455
7427
  );
7456
7428
  Ma.displayName = ob;
7457
7429
  var sb = "MenuLabel", jd = v.forwardRef(
7458
7430
  (e, t) => {
7459
7431
  const { __scopeMenu: n, ...r } = e;
7460
- return /* @__PURE__ */ u.jsx(Ae.div, { ...r, ref: t });
7432
+ return /* @__PURE__ */ u.jsx(je.div, { ...r, ref: t });
7461
7433
  }
7462
7434
  );
7463
7435
  jd.displayName = sb;
7464
7436
  var ns = "MenuItem", fc = "menu.itemSelect", Fs = v.forwardRef(
7465
7437
  (e, t) => {
7466
- const { disabled: n = !1, onSelect: r, ...o } = e, s = v.useRef(null), i = yo(ns, e.__scopeMenu), a = Pa(ns, e.__scopeMenu), l = Ke(t, s), c = v.useRef(!1), d = () => {
7438
+ const { disabled: n = !1, onSelect: r, ...o } = e, s = v.useRef(null), i = yo(ns, e.__scopeMenu), a = Pa(ns, e.__scopeMenu), l = Ve(t, s), c = v.useRef(!1), d = () => {
7467
7439
  const f = s.current;
7468
7440
  if (!n && f) {
7469
7441
  const p = new CustomEvent(fc, { bubbles: !0, cancelable: !0 });
@@ -7496,7 +7468,7 @@ var ns = "MenuItem", fc = "menu.itemSelect", Fs = v.forwardRef(
7496
7468
  Fs.displayName = ns;
7497
7469
  var _d = v.forwardRef(
7498
7470
  (e, t) => {
7499
- const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Pa(ns, n), a = Rd(n), l = v.useRef(null), c = Ke(t, l), [d, f] = v.useState(!1), [p, h] = v.useState("");
7471
+ const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Pa(ns, n), a = Rd(n), l = v.useRef(null), c = Ve(t, l), [d, f] = v.useState(!1), [p, h] = v.useState("");
7500
7472
  return v.useEffect(() => {
7501
7473
  const m = l.current;
7502
7474
  m && h((m.textContent ?? "").trim());
@@ -7507,7 +7479,7 @@ var _d = v.forwardRef(
7507
7479
  disabled: r,
7508
7480
  textValue: o ?? p,
7509
7481
  children: /* @__PURE__ */ u.jsx(ow, { asChild: !0, ...a, focusable: !r, children: /* @__PURE__ */ u.jsx(
7510
- Ae.div,
7482
+ je.div,
7511
7483
  {
7512
7484
  role: "menuitem",
7513
7485
  "data-highlighted": d ? "" : void 0,
@@ -7599,7 +7571,7 @@ var Da = "MenuItemIndicator", [Fd, cb] = dr(
7599
7571
  {
7600
7572
  present: r || rs(s.checked) || s.checked === !0,
7601
7573
  children: /* @__PURE__ */ u.jsx(
7602
- Ae.span,
7574
+ je.span,
7603
7575
  {
7604
7576
  ...o,
7605
7577
  ref: t,
@@ -7615,7 +7587,7 @@ var ub = "MenuSeparator", zd = v.forwardRef(
7615
7587
  (e, t) => {
7616
7588
  const { __scopeMenu: n, ...r } = e;
7617
7589
  return /* @__PURE__ */ u.jsx(
7618
- Ae.div,
7590
+ je.div,
7619
7591
  {
7620
7592
  role: "separator",
7621
7593
  "aria-orientation": "horizontal",
@@ -7706,7 +7678,7 @@ var fb = "MenuSub", [mk, Hd] = dr(fb), Br = "MenuSubTrigger", Ud = v.forwardRef(
7706
7678
  Ud.displayName = Br;
7707
7679
  var Wd = "MenuSubContent", Vd = v.forwardRef(
7708
7680
  (e, t) => {
7709
- const n = Id(an, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = fr(an, e.__scopeMenu), i = yo(an, e.__scopeMenu), a = Hd(Wd, e.__scopeMenu), l = v.useRef(null), c = Ke(t, l);
7681
+ const n = Id(an, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = fr(an, e.__scopeMenu), i = yo(an, e.__scopeMenu), a = Hd(Wd, e.__scopeMenu), l = v.useRef(null), c = Ve(t, l);
7710
7682
  return /* @__PURE__ */ u.jsx(eo.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(cn, { present: r || s.open, children: /* @__PURE__ */ u.jsx(eo.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(
7711
7683
  Oa,
7712
7684
  {
@@ -7821,7 +7793,7 @@ var Yd = "DropdownMenuTrigger", Xd = v.forwardRef(
7821
7793
  (e, t) => {
7822
7794
  const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = qd(Yd, n), i = Ut(n);
7823
7795
  return /* @__PURE__ */ u.jsx(vb, { asChild: !0, ...i, children: /* @__PURE__ */ u.jsx(
7824
- Ae.button,
7796
+ je.button,
7825
7797
  {
7826
7798
  type: "button",
7827
7799
  id: s.triggerId,
@@ -8195,7 +8167,7 @@ function wn(e) {
8195
8167
  t(e);
8196
8168
  };
8197
8169
  }
8198
- function V(e, ...t) {
8170
+ function W(e, ...t) {
8199
8171
  const n = h0(...t);
8200
8172
  return (r, o) => {
8201
8173
  switch (r) {
@@ -8225,7 +8197,7 @@ function An(e) {
8225
8197
  }, e));
8226
8198
  };
8227
8199
  }
8228
- function $e(...e) {
8200
+ function Le(...e) {
8229
8201
  const t = new Array(e.length);
8230
8202
  let n = 0, r = null;
8231
8203
  const o = Math.pow(2, e.length) - 1;
@@ -8260,7 +8232,7 @@ function m0(e) {
8260
8232
  }
8261
8233
  function X(e) {
8262
8234
  let t = e;
8263
- const n = Ve();
8235
+ const n = We();
8264
8236
  return (r, o) => {
8265
8237
  switch (r) {
8266
8238
  case zs:
@@ -8279,7 +8251,7 @@ function X(e) {
8279
8251
  function Ht(e, t) {
8280
8252
  return Bs(X(t), (n) => he(e, n));
8281
8253
  }
8282
- function Ve() {
8254
+ function We() {
8283
8255
  const e = [];
8284
8256
  return (t, n) => {
8285
8257
  switch (t) {
@@ -8300,7 +8272,7 @@ function Ve() {
8300
8272
  };
8301
8273
  }
8302
8274
  function en(e) {
8303
- return Bs(Ve(), (t) => he(e, t));
8275
+ return Bs(We(), (t) => he(e, t));
8304
8276
  }
8305
8277
  function nt(e, t = [], { singleton: n } = { singleton: !0 }) {
8306
8278
  return {
@@ -8321,7 +8293,7 @@ function x0(e) {
8321
8293
  return n(e);
8322
8294
  }
8323
8295
  function At(...e) {
8324
- const t = Ve(), n = new Array(e.length);
8296
+ const t = We(), n = new Array(e.length);
8325
8297
  let r = 0;
8326
8298
  const o = Math.pow(2, e.length) - 1;
8327
8299
  return e.forEach((s, i) => {
@@ -8341,7 +8313,7 @@ function At(...e) {
8341
8313
  };
8342
8314
  }
8343
8315
  function Se(e, t = bf) {
8344
- return V(e, xt(t));
8316
+ return W(e, xt(t));
8345
8317
  }
8346
8318
  function Yi(...e) {
8347
8319
  return function(t, n) {
@@ -8489,15 +8461,15 @@ function Sf(e, t, n) {
8489
8461
  }
8490
8462
  const Wt = nt(
8491
8463
  () => {
8492
- const e = Ve(), t = Ve(), n = X(0), r = Ve(), o = X(0), s = Ve(), i = Ve(), a = X(0), l = X(0), c = X(0), d = X(0), f = Ve(), p = Ve(), h = X(!1), m = X(!1), x = X(!1);
8464
+ const e = We(), t = We(), n = X(0), r = We(), o = X(0), s = We(), i = We(), a = X(0), l = X(0), c = X(0), d = X(0), f = We(), p = We(), h = X(!1), m = X(!1), x = X(!1);
8493
8465
  return he(
8494
- V(
8466
+ W(
8495
8467
  e,
8496
8468
  le(({ scrollTop: y }) => y)
8497
8469
  ),
8498
8470
  t
8499
8471
  ), he(
8500
- V(
8472
+ W(
8501
8473
  e,
8502
8474
  le(({ scrollHeight: y }) => y)
8503
8475
  ),
@@ -8837,11 +8809,11 @@ const P0 = {
8837
8809
  offsetWidth: "width"
8838
8810
  }, En = nt(
8839
8811
  ([{ log: e }, { recalcInProgress: t }]) => {
8840
- const n = Ve(), r = Ve(), o = Ht(r, 0), s = Ve(), i = Ve(), a = X(0), l = X([]), c = X(void 0), d = X(void 0), f = X((C, S) => Un(C, P0[S])), p = X(void 0), h = X(0), m = T0(), x = Ht(
8841
- V(n, $e(l, e, h), Cn(N0, m), xt()),
8812
+ const n = We(), r = We(), o = Ht(r, 0), s = We(), i = We(), a = X(0), l = X([]), c = X(void 0), d = X(void 0), f = X((C, S) => Un(C, P0[S])), p = X(void 0), h = X(0), m = T0(), x = Ht(
8813
+ W(n, Le(l, e, h), Cn(N0, m), xt()),
8842
8814
  m
8843
8815
  ), y = Ht(
8844
- V(
8816
+ W(
8845
8817
  l,
8846
8818
  xt(),
8847
8819
  Cn((C, S) => ({ current: S, prev: C.current }), {
@@ -8853,10 +8825,10 @@ const P0 = {
8853
8825
  []
8854
8826
  );
8855
8827
  he(
8856
- V(
8828
+ W(
8857
8829
  l,
8858
8830
  Te((C) => C.length > 0),
8859
- $e(x, h),
8831
+ Le(x, h),
8860
8832
  le(([C, S, k]) => {
8861
8833
  const N = C.reduce((E, I, O) => Zt(E, I, so(I, S.offsetTree, k) || O), Sr());
8862
8834
  return {
@@ -8868,9 +8840,9 @@ const P0 = {
8868
8840
  ),
8869
8841
  x
8870
8842
  ), he(
8871
- V(
8843
+ W(
8872
8844
  r,
8873
- $e(x),
8845
+ Le(x),
8874
8846
  Te(([C, { lastIndex: S }]) => C < S),
8875
8847
  le(([C, { lastIndex: S, lastSize: k }]) => [
8876
8848
  {
@@ -8883,14 +8855,14 @@ const P0 = {
8883
8855
  n
8884
8856
  ), he(c, d);
8885
8857
  const g = Ht(
8886
- V(
8858
+ W(
8887
8859
  c,
8888
8860
  le((C) => C === void 0)
8889
8861
  ),
8890
8862
  !0
8891
8863
  );
8892
8864
  he(
8893
- V(
8865
+ W(
8894
8866
  d,
8895
8867
  Te((C) => C !== void 0 && ft(Rt(x).sizeTree)),
8896
8868
  le((C) => [{ endIndex: 0, size: C, startIndex: 0 }])
@@ -8898,9 +8870,9 @@ const P0 = {
8898
8870
  n
8899
8871
  );
8900
8872
  const w = en(
8901
- V(
8873
+ W(
8902
8874
  n,
8903
- $e(x),
8875
+ Le(x),
8904
8876
  Cn(
8905
8877
  ({ sizes: C }, [S, k]) => ({
8906
8878
  changed: k !== C,
@@ -8912,7 +8884,7 @@ const P0 = {
8912
8884
  )
8913
8885
  );
8914
8886
  it(
8915
- V(
8887
+ W(
8916
8888
  a,
8917
8889
  Cn(
8918
8890
  (C, S) => ({ diff: C.prev - S, prev: S }),
@@ -8929,7 +8901,7 @@ const P0 = {
8929
8901
  k.length > 0 && (C -= yc(-C, k)), Me(i, C);
8930
8902
  }
8931
8903
  }
8932
- ), it(V(a, $e(e)), ([C, S]) => {
8904
+ ), it(W(a, Le(e)), ([C, S]) => {
8933
8905
  C < 0 && S(
8934
8906
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
8935
8907
  { firstItemIndex: a },
@@ -8938,9 +8910,9 @@ const P0 = {
8938
8910
  });
8939
8911
  const b = en(s);
8940
8912
  he(
8941
- V(
8913
+ W(
8942
8914
  s,
8943
- $e(x),
8915
+ Le(x),
8944
8916
  le(([C, S]) => {
8945
8917
  const k = S.groupIndices.length > 0, N = [], E = S.lastSize;
8946
8918
  if (k) {
@@ -8999,9 +8971,9 @@ const P0 = {
8999
8971
  n
9000
8972
  );
9001
8973
  const T = en(
9002
- V(
8974
+ W(
9003
8975
  i,
9004
- $e(x, h),
8976
+ Le(x, h),
9005
8977
  le(([C, { offsetTree: S }, k]) => {
9006
8978
  const N = -C;
9007
8979
  return so(N, S, k);
@@ -9009,9 +8981,9 @@ const P0 = {
9009
8981
  )
9010
8982
  );
9011
8983
  return he(
9012
- V(
8984
+ W(
9013
8985
  i,
9014
- $e(x, h),
8986
+ Le(x, h),
9015
8987
  le(([C, S, k]) => {
9016
8988
  if (S.groupIndices.length > 0) {
9017
8989
  if (ft(S.sizeTree))
@@ -9082,21 +9054,21 @@ function O0(e) {
9082
9054
  }
9083
9055
  const _f = nt(
9084
9056
  ([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
9085
- const s = Ve(), i = Ve(), a = en(V(s, le(O0)));
9057
+ const s = We(), i = We(), a = en(W(s, le(O0)));
9086
9058
  return he(
9087
- V(
9059
+ W(
9088
9060
  a,
9089
9061
  le((l) => l.totalCount)
9090
9062
  ),
9091
9063
  n
9092
9064
  ), he(
9093
- V(
9065
+ W(
9094
9066
  a,
9095
9067
  le((l) => l.groupIndices)
9096
9068
  ),
9097
9069
  e
9098
9070
  ), he(
9099
- V(
9071
+ W(
9100
9072
  At(o, t, r),
9101
9073
  Te(([l, c]) => Us(c)),
9102
9074
  le(([l, c, d]) => gn(c.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
@@ -9110,7 +9082,7 @@ const _f = nt(
9110
9082
  ), Gn = nt(
9111
9083
  ([{ log: e }]) => {
9112
9084
  const t = X(!1), n = en(
9113
- V(
9085
+ W(
9114
9086
  t,
9115
9087
  Te((r) => r),
9116
9088
  xt()
@@ -9142,16 +9114,16 @@ const vo = nt(
9142
9114
  },
9143
9115
  { log: p }
9144
9116
  ]) => {
9145
- const h = Ve(), m = Ve(), x = X(0);
9117
+ const h = We(), m = We(), x = X(0);
9146
9118
  let y = null, g = null, w = null;
9147
9119
  function b() {
9148
9120
  y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), Me(l, !1);
9149
9121
  }
9150
9122
  return he(
9151
- V(
9123
+ W(
9152
9124
  h,
9153
- $e(n, f, r, x, a, i, p),
9154
- $e(e, s, o),
9125
+ Le(n, f, r, x, a, i, p),
9126
+ Le(e, s, o),
9155
9127
  le(
9156
9128
  ([
9157
9129
  [T, C, S, k, N, E, I, O],
@@ -9167,13 +9139,13 @@ const vo = nt(
9167
9139
  };
9168
9140
  if (b(), B === "smooth") {
9169
9141
  let Re = !1;
9170
- w = it(t, (Ee) => {
9171
- Re = Re || Ee;
9142
+ w = it(t, (Ie) => {
9143
+ Re = Re || Ie;
9172
9144
  }), y = pn(d, () => {
9173
9145
  pe(Re);
9174
9146
  });
9175
9147
  } else
9176
- y = pn(V(t, D0(150)), pe);
9148
+ y = pn(W(t, D0(150)), pe);
9177
9149
  return g = setTimeout(() => {
9178
9150
  b();
9179
9151
  }, 1200), Me(l, !0), O("scrolling from index to", { behavior: B, index: Z, top: J }, Xt.DEBUG), { behavior: B, top: J };
@@ -9213,27 +9185,27 @@ const wo = nt(
9213
9185
  ([{ defaultItemSize: e, listRefresh: t, sizes: n }, { scrollTop: r }, { scrollTargetReached: o, scrollToIndex: s }, { didMount: i }]) => {
9214
9186
  const a = X(!0), l = X(0), c = X(!0);
9215
9187
  return he(
9216
- V(
9188
+ W(
9217
9189
  i,
9218
- $e(l),
9190
+ Le(l),
9219
9191
  Te(([d, f]) => !!f),
9220
9192
  wn(!1)
9221
9193
  ),
9222
9194
  a
9223
9195
  ), he(
9224
- V(
9196
+ W(
9225
9197
  i,
9226
- $e(l),
9198
+ Le(l),
9227
9199
  Te(([d, f]) => !!f),
9228
9200
  wn(!1)
9229
9201
  ),
9230
9202
  c
9231
9203
  ), it(
9232
- V(
9204
+ W(
9233
9205
  At(t, i),
9234
- $e(a, n, e, c),
9206
+ Le(a, n, e, c),
9235
9207
  Te(([[, d], f, { sizeTree: p }, h, m]) => d && (!ft(p) || Fa(h)) && !f && !m),
9236
- $e(l)
9208
+ Le(l)
9237
9209
  ),
9238
9210
  ([, d]) => {
9239
9211
  pn(o, () => {
@@ -9266,26 +9238,26 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9266
9238
  viewportHeight: 0
9267
9239
  }
9268
9240
  }, $0 = 0, bo = nt(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
9269
- const i = X(!1), a = X(!0), l = Ve(), c = Ve(), d = X(4), f = X($0), p = Ht(
9270
- V(
9271
- Yi(V(Se(o), ar(1), wn(!0)), V(Se(o), ar(1), wn(!1), mc(100))),
9241
+ const i = X(!1), a = X(!0), l = We(), c = We(), d = X(4), f = X($0), p = Ht(
9242
+ W(
9243
+ Yi(W(Se(o), ar(1), wn(!0)), W(Se(o), ar(1), wn(!1), mc(100))),
9272
9244
  xt()
9273
9245
  ),
9274
9246
  !1
9275
9247
  ), h = Ht(
9276
- V(Yi(V(n, wn(!0)), V(n, wn(!1), mc(200))), xt()),
9248
+ W(Yi(W(n, wn(!0)), W(n, wn(!1), mc(200))), xt()),
9277
9249
  !1
9278
9250
  );
9279
9251
  he(
9280
- V(
9252
+ W(
9281
9253
  At(Se(o), Se(f)),
9282
9254
  le(([w, b]) => w <= b),
9283
9255
  xt()
9284
9256
  ),
9285
9257
  a
9286
- ), he(V(a, An(50)), c);
9258
+ ), he(W(a, An(50)), c);
9287
9259
  const m = en(
9288
- V(
9260
+ W(
9289
9261
  At(r, Se(s), Se(t), Se(e), Se(d)),
9290
9262
  Cn((w, [{ scrollHeight: b, scrollTop: T }, C, S, k, N]) => {
9291
9263
  const E = T + C - b > -N, I = {
@@ -9312,7 +9284,7 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9312
9284
  xt((w, b) => w && w.atBottom === b.atBottom)
9313
9285
  )
9314
9286
  ), x = Ht(
9315
- V(
9287
+ W(
9316
9288
  r,
9317
9289
  Cn(
9318
9290
  (w, { scrollHeight: b, scrollTop: T, viewportHeight: C }) => {
@@ -9346,15 +9318,15 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9346
9318
  0
9347
9319
  );
9348
9320
  he(
9349
- V(
9321
+ W(
9350
9322
  m,
9351
9323
  le((w) => w.atBottom)
9352
9324
  ),
9353
9325
  i
9354
- ), he(V(i, An(50)), l);
9326
+ ), he(W(i, An(50)), l);
9355
9327
  const y = X(Vr);
9356
9328
  he(
9357
- V(
9329
+ W(
9358
9330
  r,
9359
9331
  le(({ scrollTop: w }) => w),
9360
9332
  xt(),
@@ -9365,20 +9337,20 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9365
9337
  le((w) => w.direction)
9366
9338
  ),
9367
9339
  y
9368
- ), he(V(r, An(50), wn(L0)), y);
9340
+ ), he(W(r, An(50), wn(L0)), y);
9369
9341
  const g = X(0);
9370
9342
  return he(
9371
- V(
9343
+ W(
9372
9344
  p,
9373
9345
  Te((w) => !w),
9374
9346
  wn(0)
9375
9347
  ),
9376
9348
  g
9377
9349
  ), he(
9378
- V(
9350
+ W(
9379
9351
  o,
9380
9352
  An(100),
9381
- $e(p),
9353
+ Le(p),
9382
9354
  Te(([w, b]) => !!b),
9383
9355
  Cn(([w, b], [T]) => [b, T], [0, 0]),
9384
9356
  le(([w, b]) => b - w)
@@ -9407,8 +9379,8 @@ function bc(e, t) {
9407
9379
  }
9408
9380
  const Va = nt(
9409
9381
  ([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
9410
- const s = Ve(), i = X(0), a = X(0), l = X(0), c = Ht(
9411
- V(
9382
+ const s = We(), i = X(0), a = X(0), l = X(0), c = Ht(
9383
+ W(
9412
9384
  At(
9413
9385
  Se(r),
9414
9386
  Se(o),
@@ -9554,10 +9526,10 @@ const hr = nt(
9554
9526
  { didMount: h },
9555
9527
  { recalcInProgress: m }
9556
9528
  ]) => {
9557
- const x = X([]), y = X(0), g = Ve();
9529
+ const x = X([]), y = X(0), g = We();
9558
9530
  he(s.topItemsIndexes, x);
9559
9531
  const w = Ht(
9560
- V(
9532
+ W(
9561
9533
  At(
9562
9534
  h,
9563
9535
  m,
@@ -9605,12 +9577,12 @@ const hr = nt(
9605
9577
  );
9606
9578
  const Z = [];
9607
9579
  if (L.length > 0) {
9608
- const W = L[0], ee = L[L.length - 1];
9609
- let U = 0;
9610
- for (const P of Hs(D, W, ee)) {
9611
- const H = P.value, te = Math.max(P.start, W), se = Math.min(P.end, ee);
9580
+ const U = L[0], ee = L[L.length - 1];
9581
+ let q = 0;
9582
+ for (const P of Hs(D, U, ee)) {
9583
+ const H = P.value, te = Math.max(P.start, U), se = Math.min(P.end, ee);
9612
9584
  for (let ne = te; ne <= se; ne++)
9613
- Z.push({ data: $ == null ? void 0 : $[ne], index: ne, offset: U, size: H }), U += H;
9585
+ Z.push({ data: $ == null ? void 0 : $[ne], index: ne, offset: q, size: H }), q += H;
9614
9586
  }
9615
9587
  }
9616
9588
  if (!O)
@@ -9618,23 +9590,23 @@ const hr = nt(
9618
9590
  const J = L.length > 0 ? L[L.length - 1] + 1 : 0, pe = I0(B, S, k, J);
9619
9591
  if (pe.length === 0)
9620
9592
  return null;
9621
- const Re = N - 1, Ee = Bs([], (W) => {
9593
+ const Re = N - 1, Ie = Bs([], (U) => {
9622
9594
  for (const ee of pe) {
9623
- const U = ee.value;
9624
- let P = U.offset, H = ee.start;
9625
- const te = U.size;
9626
- if (U.offset < S) {
9627
- H += Math.floor((S - U.offset + j) / (te + j));
9595
+ const q = ee.value;
9596
+ let P = q.offset, H = ee.start;
9597
+ const te = q.size;
9598
+ if (q.offset < S) {
9599
+ H += Math.floor((S - q.offset + j) / (te + j));
9628
9600
  const ne = H - ee.start;
9629
9601
  P += ne * te + ne * j;
9630
9602
  }
9631
9603
  H < J && (P += (J - H) * te, H = J);
9632
9604
  const se = Math.min(ee.end, Re);
9633
9605
  for (let ne = H; ne <= se && !(P >= k); ne++)
9634
- W.push({ data: $ == null ? void 0 : $[ne], index: ne, offset: P, size: te }), P += te + j;
9606
+ U.push({ data: $ == null ? void 0 : $[ne], index: ne, offset: P, size: te }), P += te + j;
9635
9607
  }
9636
9608
  });
9637
- return Ko(Ee, Z, N, j, A, F);
9609
+ return Ko(Ie, Z, N, j, A, F);
9638
9610
  }
9639
9611
  ),
9640
9612
  //@ts-expect-error filter needs to be fixed
@@ -9644,43 +9616,43 @@ const hr = nt(
9644
9616
  Ti
9645
9617
  );
9646
9618
  he(
9647
- V(
9619
+ W(
9648
9620
  e,
9649
9621
  Te(Fa),
9650
9622
  le((S) => S == null ? void 0 : S.length)
9651
9623
  ),
9652
9624
  o
9653
9625
  ), he(
9654
- V(
9626
+ W(
9655
9627
  w,
9656
9628
  le((S) => S.topListHeight)
9657
9629
  ),
9658
9630
  f
9659
9631
  ), he(f, a), he(
9660
- V(
9632
+ W(
9661
9633
  w,
9662
9634
  le((S) => [S.top, S.bottom])
9663
9635
  ),
9664
9636
  i
9665
9637
  ), he(
9666
- V(
9638
+ W(
9667
9639
  w,
9668
9640
  le((S) => S.items)
9669
9641
  ),
9670
9642
  g
9671
9643
  );
9672
9644
  const b = en(
9673
- V(
9645
+ W(
9674
9646
  w,
9675
9647
  Te(({ items: S }) => S.length > 0),
9676
- $e(o, e),
9648
+ Le(o, e),
9677
9649
  Te(([{ items: S }, k]) => S[S.length - 1].originalIndex === k - 1),
9678
9650
  le(([, S, k]) => [S - 1, k]),
9679
9651
  xt(oo),
9680
9652
  le(([S]) => S)
9681
9653
  )
9682
9654
  ), T = en(
9683
- V(
9655
+ W(
9684
9656
  w,
9685
9657
  An(200),
9686
9658
  Te(({ items: S, topItems: k }) => S.length > 0 && S[0].originalIndex === k.length),
@@ -9688,7 +9660,7 @@ const hr = nt(
9688
9660
  xt()
9689
9661
  )
9690
9662
  ), C = en(
9691
- V(
9663
+ W(
9692
9664
  w,
9693
9665
  Te(({ items: S }) => S.length > 0),
9694
9666
  le(({ items: S }) => {
@@ -9720,8 +9692,8 @@ const hr = nt(
9720
9692
  { singleton: !0 }
9721
9693
  ), Df = nt(
9722
9694
  ([{ fixedFooterHeight: e, fixedHeaderHeight: t, footerHeight: n, headerHeight: r }, { listState: o }]) => {
9723
- const s = Ve(), i = Ht(
9724
- V(
9695
+ const s = We(), i = Ht(
9696
+ W(
9725
9697
  At(n, e, r, t, o),
9726
9698
  le(([a, l, c, d, f]) => a + l + c + d + f.offsetBottom + f.bottom)
9727
9699
  ),
@@ -9734,7 +9706,7 @@ const hr = nt(
9734
9706
  ), B0 = nt(
9735
9707
  ([{ viewportHeight: e }, { totalListHeight: t }]) => {
9736
9708
  const n = X(!1), r = Ht(
9737
- V(
9709
+ W(
9738
9710
  At(n, e, t),
9739
9711
  Te(([o]) => o),
9740
9712
  le(([, o, s]) => Math.max(0, o - s)),
@@ -9761,12 +9733,12 @@ const hr = nt(
9761
9733
  { fixedFooterHeight: r, fixedHeaderHeight: o, headerHeight: s, scrollingInProgress: i, scrollTop: a, viewportHeight: l },
9762
9734
  { scrollToIndex: c }
9763
9735
  ]) => {
9764
- const d = Ve();
9736
+ const d = We();
9765
9737
  return he(
9766
- V(
9738
+ W(
9767
9739
  d,
9768
- $e(t, l, n, s, o, r, a),
9769
- $e(e),
9740
+ Le(t, l, n, s, o, r, a),
9741
+ Le(e),
9770
9742
  le(([[f, p, h, m, x, y, g, w], b]) => {
9771
9743
  const { align: T, behavior: C, calculateViewLocation: S = H0, done: k, ...N } = f, E = jf(f, p, m - 1), I = so(E, p.offsetTree, b) + x + y, O = I + gn(p.sizeTree, E)[1], L = w + y, F = w + h - g, j = S({
9772
9744
  itemBottom: O,
@@ -9776,7 +9748,7 @@ const hr = nt(
9776
9748
  viewportTop: L
9777
9749
  });
9778
9750
  return j ? k && pn(
9779
- V(
9751
+ W(
9780
9752
  i,
9781
9753
  Te(($) => !$),
9782
9754
  // skips the initial publish of false, and the cleanup call.
@@ -9811,7 +9783,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9811
9783
  { context: p },
9812
9784
  { scrollIntoView: h }
9813
9785
  ]) => {
9814
- const m = X(!1), x = Ve();
9786
+ const m = X(!1), x = We();
9815
9787
  let y = null;
9816
9788
  function g(C) {
9817
9789
  Me(i, {
@@ -9821,9 +9793,9 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9821
9793
  });
9822
9794
  }
9823
9795
  it(
9824
- V(
9825
- At(V(Se(t), ar(1)), l),
9826
- $e(Se(m), s, a, f),
9796
+ W(
9797
+ At(W(Se(t), ar(1)), l),
9798
+ Le(Se(m), s, a, f),
9827
9799
  le(([[C, S], k, N, E, I]) => {
9828
9800
  let O = S && E, L = "auto";
9829
9801
  return O && (L = U0(k, N || I), O = O && !!L), { followOutputBehavior: L, shouldFollow: O, totalCount: C };
@@ -9845,7 +9817,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9845
9817
  setTimeout(S, 100);
9846
9818
  }
9847
9819
  it(
9848
- V(
9820
+ W(
9849
9821
  At(Se(m), t, c),
9850
9822
  Te(([C, , S]) => C && S),
9851
9823
  Cn(
@@ -9853,7 +9825,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9853
9825
  { refreshed: !1, value: 0 }
9854
9826
  ),
9855
9827
  Te(({ refreshed: C }) => C),
9856
- $e(m, t)
9828
+ Le(m, t)
9857
9829
  ),
9858
9830
  ([, C]) => {
9859
9831
  Rt(a) && w(C !== !1);
@@ -9863,23 +9835,23 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9863
9835
  }), it(At(Se(m), o), ([C, S]) => {
9864
9836
  C && !S.atBottom && S.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
9865
9837
  });
9866
- const b = X(null), T = Ve();
9838
+ const b = X(null), T = We();
9867
9839
  return he(
9868
9840
  Yi(
9869
- V(
9841
+ W(
9870
9842
  Se(r),
9871
9843
  le((C) => {
9872
9844
  var S;
9873
9845
  return (S = C == null ? void 0 : C.length) != null ? S : 0;
9874
9846
  })
9875
9847
  ),
9876
- V(Se(t))
9848
+ W(Se(t))
9877
9849
  ),
9878
9850
  T
9879
9851
  ), it(
9880
- V(
9881
- At(V(T, ar(1)), l),
9882
- $e(Se(b), a, f, p),
9852
+ W(
9853
+ At(W(T, ar(1)), l),
9854
+ Le(Se(b), a, f, p),
9883
9855
  le(([[C, S], k, N, E, I]) => S && N && (k == null ? void 0 : k({ context: I, totalCount: C, scrollingInProgress: E }))),
9884
9856
  Te((C) => !!C),
9885
9857
  An(0)
@@ -9906,11 +9878,11 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9906
9878
  )
9907
9879
  ), V0 = nt(
9908
9880
  ([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (he(
9909
- V(
9881
+ W(
9910
9882
  a,
9911
- $e(s),
9883
+ Le(s),
9912
9884
  Te(([, l]) => l !== 0),
9913
- $e(o, r, t, n, e),
9885
+ Le(o, r, t, n, e),
9914
9886
  le(([[, l], c, d, f, p, h = []]) => Mf(l, c, d, f, p, h))
9915
9887
  ),
9916
9888
  i
@@ -9921,15 +9893,15 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9921
9893
  ([{ didMount: e }, { scrollTo: t }, { listState: n }]) => {
9922
9894
  const r = X(0);
9923
9895
  return it(
9924
- V(
9896
+ W(
9925
9897
  e,
9926
- $e(r),
9898
+ Le(r),
9927
9899
  Te(([, o]) => o !== 0),
9928
9900
  le(([, o]) => ({ top: o }))
9929
9901
  ),
9930
9902
  (o) => {
9931
9903
  pn(
9932
- V(
9904
+ W(
9933
9905
  n,
9934
9906
  ar(1),
9935
9907
  Te((s) => s.items.length > 1)
@@ -9949,11 +9921,11 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9949
9921
  { singleton: !0 }
9950
9922
  ), $f = nt(
9951
9923
  ([{ scrollVelocity: e }]) => {
9952
- const t = X(!1), n = Ve(), r = X(!1);
9924
+ const t = X(!1), n = We(), r = X(!1);
9953
9925
  return he(
9954
- V(
9926
+ W(
9955
9927
  e,
9956
- $e(r, t, n),
9928
+ Le(r, t, n),
9957
9929
  Te(([o, s]) => !!s),
9958
9930
  le(([o, s, i, a]) => {
9959
9931
  const { enter: l, exit: c } = s;
@@ -9968,7 +9940,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9968
9940
  ),
9969
9941
  t
9970
9942
  ), it(
9971
- V(At(t, e, n), $e(r)),
9943
+ W(At(t, e, n), Le(r)),
9972
9944
  ([[o, s, i], a]) => {
9973
9945
  o && a && a.change && a.change(s, i);
9974
9946
  }
@@ -9977,9 +9949,9 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9977
9949
  yt(bo),
9978
9950
  { singleton: !0 }
9979
9951
  ), Ka = nt(([{ scrollContainerState: e, scrollTo: t }]) => {
9980
- const n = Ve(), r = Ve(), o = Ve(), s = X(!1), i = X(void 0);
9952
+ const n = We(), r = We(), o = We(), s = X(!1), i = X(void 0);
9981
9953
  return he(
9982
- V(
9954
+ W(
9983
9955
  At(n, r),
9984
9956
  le(([{ scrollHeight: a, scrollTop: l, viewportHeight: c }, { offsetTop: d }]) => ({
9985
9957
  scrollHeight: a,
@@ -9989,9 +9961,9 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9989
9961
  ),
9990
9962
  e
9991
9963
  ), he(
9992
- V(
9964
+ W(
9993
9965
  t,
9994
- $e(r),
9966
+ Le(r),
9995
9967
  le(([a, { offsetTop: l }]) => ({
9996
9968
  ...a,
9997
9969
  top: a.top + l
@@ -10016,20 +9988,20 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
10016
9988
  { didMount: s },
10017
9989
  { useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: l }
10018
9990
  ]) => {
10019
- const c = Ve(), d = X(void 0), f = X(null), p = X(null);
9991
+ const c = We(), d = X(void 0), f = X(null), p = X(null);
10020
9992
  return he(a, f), he(l, p), it(
10021
- V(
9993
+ W(
10022
9994
  c,
10023
- $e(t, r, i, f, p, n)
9995
+ Le(t, r, i, f, p, n)
10024
9996
  ),
10025
9997
  ([h, m, x, y, g, w, b]) => {
10026
9998
  const T = A0(m.sizeTree);
10027
9999
  y && g !== null && w !== null && (x = g.scrollTop - w.offsetTop), x -= b, h({ ranges: T, scrollTop: x });
10028
10000
  }
10029
- ), he(V(d, Te(Fa), le(G0)), o), he(
10030
- V(
10001
+ ), he(W(d, Te(Fa), le(G0)), o), he(
10002
+ W(
10031
10003
  s,
10032
- $e(d),
10004
+ Le(d),
10033
10005
  Te(([, h]) => h !== void 0),
10034
10006
  xt(),
10035
10007
  le(([, h]) => h.ranges)
@@ -10048,7 +10020,7 @@ function G0(e) {
10048
10020
  const Y0 = nt(([{ topItemsIndexes: e }]) => {
10049
10021
  const t = X(0);
10050
10022
  return he(
10051
- V(
10023
+ W(
10052
10024
  t,
10053
10025
  Te((n) => n >= 0),
10054
10026
  le((n) => Array.from({ length: n }).map((r, o) => o))
@@ -10070,9 +10042,9 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10070
10042
  { recalcInProgress: m }
10071
10043
  ]) => {
10072
10044
  const x = en(
10073
- V(
10045
+ W(
10074
10046
  l,
10075
- $e(i),
10047
+ Le(i),
10076
10048
  Cn(
10077
10049
  ([, g, w, b], [{ bottom: T, items: C, offsetBottom: S, totalCount: k }, N]) => {
10078
10050
  const E = T + S;
@@ -10082,7 +10054,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10082
10054
  [0, [], 0, 0]
10083
10055
  ),
10084
10056
  Te(([g]) => g !== 0),
10085
- $e(r, a, n, o, h, m),
10057
+ Le(r, a, n, o, h, m),
10086
10058
  Te(([, g, w, b, , , T]) => !T && !b && g !== 0 && w === io),
10087
10059
  le(([[g], , , , , w]) => (w("Upward scrolling compensation", { amount: g }, Xt.DEBUG), g))
10088
10060
  )
@@ -10090,10 +10062,10 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10090
10062
  function y(g) {
10091
10063
  g > 0 ? (Me(t, { behavior: "auto", top: -g }), Me(e, 0)) : (Me(e, 0), Me(t, { behavior: "auto", top: -g }));
10092
10064
  }
10093
- return it(V(x, $e(e, s)), ([g, w, b]) => {
10065
+ return it(W(x, Le(e, s)), ([g, w, b]) => {
10094
10066
  b && X0() ? Me(e, w - g) : y(-g);
10095
10067
  }), it(
10096
- V(
10068
+ W(
10097
10069
  At(Ht(s, !1), e, m),
10098
10070
  Te(([g, w, b]) => !g && !b && w !== 0),
10099
10071
  le(([g, w]) => w),
@@ -10101,15 +10073,15 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10101
10073
  ),
10102
10074
  y
10103
10075
  ), he(
10104
- V(
10076
+ W(
10105
10077
  f,
10106
10078
  le((g) => ({ top: -g }))
10107
10079
  ),
10108
10080
  t
10109
10081
  ), it(
10110
- V(
10082
+ W(
10111
10083
  c,
10112
- $e(p, d),
10084
+ Le(p, d),
10113
10085
  le(([g, { groupIndices: w, lastSize: b, sizeTree: T }, C]) => {
10114
10086
  function S(k) {
10115
10087
  return k * (b + C);
@@ -10205,7 +10177,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10205
10177
  { groupCounts: N },
10206
10178
  E
10207
10179
  ]) => (he(T.rangeChanged, E.scrollSeekRangeChanged), he(
10208
- V(
10180
+ W(
10209
10181
  E.windowViewportRect,
10210
10182
  le((I) => I.visibleHeight)
10211
10183
  ),
@@ -10411,7 +10383,7 @@ function Ga(e) {
10411
10383
  }
10412
10384
  const tS = /* @__PURE__ */ nt(() => {
10413
10385
  const e = X((a) => `Item ${a}`), t = X((a) => `Group ${a}`), n = X({}), r = X(Ga), o = X("div"), s = X(Or), i = (a, l = null) => Ht(
10414
- V(
10386
+ W(
10415
10387
  n,
10416
10388
  le((c) => c[a]),
10417
10389
  xt()
@@ -10439,7 +10411,7 @@ const tS = /* @__PURE__ */ nt(() => {
10439
10411
  ([e, t]) => ({ ...e, ...t }),
10440
10412
  yt(Bf, tS)
10441
10413
  ), rS = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), oS = { overflowAnchor: "none", position: qa(), zIndex: 1 }, qf = { overflowAnchor: "none" }, sS = { ...qf, display: "inline-block", height: "100%" }, kc = /* @__PURE__ */ z.memo(function({ showTopList: e = !1 }) {
10442
- const t = Ie("listState"), n = on("sizeRanges"), r = Ie("useWindowScroll"), o = Ie("customScrollParent"), s = on("windowScrollContainerState"), i = on("scrollContainerState"), a = o || r ? s : i, l = Ie("itemContent"), c = Ie("context"), d = Ie("groupContent"), f = Ie("trackItemSizes"), p = Ie("itemSize"), h = Ie("log"), m = on("gap"), x = Ie("horizontalDirection"), { callbackRef: y } = w0(
10414
+ const t = Ne("listState"), n = on("sizeRanges"), r = Ne("useWindowScroll"), o = Ne("customScrollParent"), s = on("windowScrollContainerState"), i = on("scrollContainerState"), a = o || r ? s : i, l = Ne("itemContent"), c = Ne("context"), d = Ne("groupContent"), f = Ne("trackItemSizes"), p = Ne("itemSize"), h = Ne("log"), m = on("gap"), x = Ne("horizontalDirection"), { callbackRef: y } = w0(
10443
10415
  n,
10444
10416
  p,
10445
10417
  f,
@@ -10448,12 +10420,12 @@ const tS = /* @__PURE__ */ nt(() => {
10448
10420
  m,
10449
10421
  o,
10450
10422
  x,
10451
- Ie("skipAnimationFrameInResizeObserver")
10423
+ Ne("skipAnimationFrameInResizeObserver")
10452
10424
  ), [g, w] = z.useState(0);
10453
10425
  Ya("deviation", (j) => {
10454
10426
  g !== j && w(j);
10455
10427
  });
10456
- const b = Ie("EmptyPlaceholder"), T = Ie("ScrollSeekPlaceholder") || rS, C = Ie("ListComponent"), S = Ie("ItemComponent"), k = Ie("GroupComponent"), N = Ie("computeItemKey"), E = Ie("isSeeking"), I = Ie("groupIndices").length > 0, O = Ie("alignToBottom"), L = Ie("initialItemFinalLocationReached"), F = e ? {} : {
10428
+ const b = Ne("EmptyPlaceholder"), T = Ne("ScrollSeekPlaceholder") || rS, C = Ne("ListComponent"), S = Ne("ItemComponent"), k = Ne("GroupComponent"), N = Ne("computeItemKey"), E = Ne("isSeeking"), I = Ne("groupIndices").length > 0, O = Ne("alignToBottom"), L = Ne("initialItemFinalLocationReached"), F = e ? {} : {
10457
10429
  boxSizing: "border-box",
10458
10430
  ...x ? {
10459
10431
  display: "inline-block",
@@ -10546,7 +10518,7 @@ function cS(e, t) {
10546
10518
  return { item: typeof e == "string" ? void 0 : t };
10547
10519
  }
10548
10520
  const uS = /* @__PURE__ */ z.memo(function() {
10549
- const e = Ie("HeaderComponent"), t = on("headerHeight"), n = Ie("HeaderFooterTag"), r = pr(
10521
+ const e = Ne("HeaderComponent"), t = on("headerHeight"), n = Ne("HeaderFooterTag"), r = pr(
10550
10522
  z.useMemo(
10551
10523
  () => (s) => {
10552
10524
  t(Un(s, "height"));
@@ -10554,11 +10526,11 @@ const uS = /* @__PURE__ */ z.memo(function() {
10554
10526
  [t]
10555
10527
  ),
10556
10528
  !0,
10557
- Ie("skipAnimationFrameInResizeObserver")
10558
- ), o = Ie("context");
10529
+ Ne("skipAnimationFrameInResizeObserver")
10530
+ ), o = Ne("context");
10559
10531
  return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Bt(e, o) }) }) : null;
10560
10532
  }), dS = /* @__PURE__ */ z.memo(function() {
10561
- const e = Ie("FooterComponent"), t = on("footerHeight"), n = Ie("HeaderFooterTag"), r = pr(
10533
+ const e = Ne("FooterComponent"), t = on("footerHeight"), n = Ne("HeaderFooterTag"), r = pr(
10562
10534
  z.useMemo(
10563
10535
  () => (s) => {
10564
10536
  t(Un(s, "height"));
@@ -10566,8 +10538,8 @@ const uS = /* @__PURE__ */ z.memo(function() {
10566
10538
  [t]
10567
10539
  ),
10568
10540
  !0,
10569
- Ie("skipAnimationFrameInResizeObserver")
10570
- ), o = Ie("context");
10541
+ Ne("skipAnimationFrameInResizeObserver")
10542
+ ), o = Ne("context");
10571
10543
  return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Bt(e, o) }) }) : null;
10572
10544
  });
10573
10545
  function Gf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
@@ -10623,27 +10595,27 @@ function Yf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
10623
10595
  });
10624
10596
  }
10625
10597
  const fS = ({ children: e }) => {
10626
- const t = z.useContext(Uf), n = on("viewportHeight"), r = on("fixedItemHeight"), o = Ie("alignToBottom"), s = Ie("horizontalDirection"), i = z.useMemo(
10598
+ const t = z.useContext(Uf), n = on("viewportHeight"), r = on("fixedItemHeight"), o = Ne("alignToBottom"), s = Ne("horizontalDirection"), i = z.useMemo(
10627
10599
  () => wf(n, (l) => Un(l, s ? "width" : "height")),
10628
10600
  [n, s]
10629
- ), a = pr(i, !0, Ie("skipAnimationFrameInResizeObserver"));
10601
+ ), a = pr(i, !0, Ne("skipAnimationFrameInResizeObserver"));
10630
10602
  return z.useEffect(() => {
10631
10603
  t && (n(t.viewportHeight), r(t.itemHeight));
10632
10604
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "element", ref: a, style: Ws(o), children: e });
10633
10605
  }, pS = ({ children: e }) => {
10634
- const t = z.useContext(Uf), n = on("windowViewportRect"), r = on("fixedItemHeight"), o = Ie("customScrollParent"), s = Sf(
10606
+ const t = z.useContext(Uf), n = on("windowViewportRect"), r = on("fixedItemHeight"), o = Ne("customScrollParent"), s = Sf(
10635
10607
  n,
10636
10608
  o,
10637
- Ie("skipAnimationFrameInResizeObserver")
10638
- ), i = Ie("alignToBottom");
10609
+ Ne("skipAnimationFrameInResizeObserver")
10610
+ ), i = Ne("alignToBottom");
10639
10611
  return z.useEffect(() => {
10640
10612
  t && (r(t.itemHeight), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
10641
10613
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "window", ref: s, style: Ws(i), children: e });
10642
10614
  }, hS = ({ children: e }) => {
10643
- const t = Ie("TopItemListComponent") || "div", n = Ie("headerHeight"), r = { ...lS, marginTop: `${n}px` }, o = Ie("context");
10615
+ const t = Ne("TopItemListComponent") || "div", n = Ne("headerHeight"), r = { ...lS, marginTop: `${n}px` }, o = Ne("context");
10644
10616
  return /* @__PURE__ */ u.jsx(t, { style: r, ...Bt(t, o), children: e });
10645
10617
  }, mS = /* @__PURE__ */ z.memo(function(e) {
10646
- const t = Ie("useWindowScroll"), n = Ie("topItemsIndexes").length > 0, r = Ie("customScrollParent"), o = Ie("context");
10618
+ const t = Ne("useWindowScroll"), n = Ne("topItemsIndexes").length > 0, r = Ne("customScrollParent"), o = Ne("context");
10647
10619
  return /* @__PURE__ */ u.jsxs(r || t ? yS : xS, { ...e, context: o, children: [
10648
10620
  n && /* @__PURE__ */ u.jsx(hS, { children: /* @__PURE__ */ u.jsx(kc, { showTopList: !0 }) }),
10649
10621
  /* @__PURE__ */ u.jsxs(r || t ? pS : fS, { children: [
@@ -10655,7 +10627,7 @@ const fS = ({ children: e }) => {
10655
10627
  }), {
10656
10628
  Component: gS,
10657
10629
  useEmitter: Ya,
10658
- useEmitterValue: Ie,
10630
+ useEmitterValue: Ne,
10659
10631
  usePublisher: on
10660
10632
  } = /* @__PURE__ */ Hf(
10661
10633
  nS,
@@ -10716,7 +10688,7 @@ const fS = ({ children: e }) => {
10716
10688
  }
10717
10689
  },
10718
10690
  mS
10719
- ), xS = /* @__PURE__ */ Gf({ useEmitter: Ya, useEmitterValue: Ie, usePublisher: on }), yS = /* @__PURE__ */ Yf({ useEmitter: Ya, useEmitterValue: Ie, usePublisher: on }), vS = gS, wS = /* @__PURE__ */ nt(() => {
10691
+ ), xS = /* @__PURE__ */ Gf({ useEmitter: Ya, useEmitterValue: Ne, usePublisher: on }), yS = /* @__PURE__ */ Yf({ useEmitter: Ya, useEmitterValue: Ne, usePublisher: on }), vS = gS, wS = /* @__PURE__ */ nt(() => {
10720
10692
  const e = X((c) => /* @__PURE__ */ u.jsxs("td", { children: [
10721
10693
  "Item $",
10722
10694
  c
@@ -10724,7 +10696,7 @@ const fS = ({ children: e }) => {
10724
10696
  "Group ",
10725
10697
  c
10726
10698
  ] })), r = X(null), o = X(null), s = X({}), i = X(Ga), a = X(Or), l = (c, d = null) => Ht(
10727
- V(
10699
+ W(
10728
10700
  s,
10729
10701
  le((f) => f[c]),
10730
10702
  xt()
@@ -10796,54 +10768,54 @@ const TS = /* @__PURE__ */ nt(
10796
10768
  { customScrollParent: y, useWindowScroll: g, windowScrollContainerState: w, windowScrollTo: b, windowViewportRect: T },
10797
10769
  C
10798
10770
  ]) => {
10799
- const S = X(0), k = X(0), N = X(Rc), E = X({ height: 0, width: 0 }), I = X({ height: 0, width: 0 }), O = Ve(), L = Ve(), F = X(0), j = X(null), $ = X({ column: 0, row: 0 }), A = Ve(), B = Ve(), D = X(!1), M = X(0), Z = X(!0), J = X(!1), pe = X(!1);
10771
+ const S = X(0), k = X(0), N = X(Rc), E = X({ height: 0, width: 0 }), I = X({ height: 0, width: 0 }), O = We(), L = We(), F = X(0), j = X(null), $ = X({ column: 0, row: 0 }), A = We(), B = We(), D = X(!1), M = X(0), Z = X(!0), J = X(!1), pe = X(!1);
10800
10772
  it(
10801
- V(
10773
+ W(
10802
10774
  m,
10803
- $e(M),
10775
+ Le(M),
10804
10776
  Te(([P, H]) => !!H)
10805
10777
  ),
10806
10778
  () => {
10807
10779
  Me(Z, !1);
10808
10780
  }
10809
10781
  ), it(
10810
- V(
10782
+ W(
10811
10783
  At(m, Z, I, E, M, J),
10812
10784
  Te(([P, H, te, se, , ne]) => P && !H && te.height !== 0 && se.height !== 0 && !ne)
10813
10785
  ),
10814
10786
  ([, , , , P]) => {
10815
10787
  Me(J, !0), Ua(1, () => {
10816
10788
  Me(O, P);
10817
- }), pn(V(c), () => {
10789
+ }), pn(W(c), () => {
10818
10790
  Me(t, [0, 0]), Me(Z, !0);
10819
10791
  });
10820
10792
  }
10821
10793
  ), he(
10822
- V(
10794
+ W(
10823
10795
  B,
10824
10796
  Te((P) => P != null && P.scrollTop > 0),
10825
10797
  wn(0)
10826
10798
  ),
10827
10799
  k
10828
10800
  ), it(
10829
- V(
10801
+ W(
10830
10802
  m,
10831
- $e(B),
10803
+ Le(B),
10832
10804
  Te(([, P]) => P != null)
10833
10805
  ),
10834
10806
  ([, P]) => {
10835
- P && (Me(E, P.viewport), Me(I, P.item), Me($, P.gap), P.scrollTop > 0 && (Me(D, !0), pn(V(c, ar(1)), (H) => {
10807
+ P && (Me(E, P.viewport), Me(I, P.item), Me($, P.gap), P.scrollTop > 0 && (Me(D, !0), pn(W(c, ar(1)), (H) => {
10836
10808
  Me(D, !1);
10837
10809
  }), Me(l, { top: P.scrollTop })));
10838
10810
  }
10839
10811
  ), he(
10840
- V(
10812
+ W(
10841
10813
  E,
10842
10814
  le(({ height: P }) => P)
10843
10815
  ),
10844
10816
  f
10845
10817
  ), he(
10846
- V(
10818
+ W(
10847
10819
  At(
10848
10820
  Se(E, Po),
10849
10821
  Se(I, Po),
@@ -10859,7 +10831,7 @@ const TS = /* @__PURE__ */ nt(
10859
10831
  ),
10860
10832
  A
10861
10833
  ), he(
10862
- V(
10834
+ W(
10863
10835
  At(
10864
10836
  Se(S),
10865
10837
  r,
@@ -10879,43 +10851,43 @@ const TS = /* @__PURE__ */ nt(
10879
10851
  [H, te],
10880
10852
  se,
10881
10853
  ne,
10882
- Le,
10854
+ De,
10883
10855
  Y,
10884
10856
  de,
10885
10857
  ,
10886
10858
  ke,
10887
- Ne
10859
+ Ae
10888
10860
  ]) => {
10889
- const { column: Be, row: He } = se, { height: We, width: qe } = ne, { width: Ge } = Le;
10890
- if (de === 0 && (P === 0 || Ge === 0))
10861
+ const { column: ze, row: Be } = se, { height: Ue, width: Ke } = ne, { width: qe } = De;
10862
+ if (de === 0 && (P === 0 || qe === 0))
10891
10863
  return Rc;
10892
- if (qe === 0) {
10893
- const re = Wa(Ne, P), Ye = re + Math.max(de - 1, 0);
10894
- return SS(Nc(re, Ye, Y));
10864
+ if (Ke === 0) {
10865
+ const re = Wa(Ae, P), Ge = re + Math.max(de - 1, 0);
10866
+ return SS(Nc(re, Ge, Y));
10895
10867
  }
10896
- const tt = Xf(Ge, qe, Be);
10897
- let Qe, ot;
10898
- ke ? H === 0 && te === 0 && de > 0 ? (Qe = 0, ot = de - 1) : (Qe = tt * as((H + He) / (We + He)), ot = tt * Ec((te + He) / (We + He)) - 1, ot = Ei(P - 1, Kr(ot, tt - 1)), Qe = Ei(ot, Kr(0, Qe))) : (Qe = 0, ot = -1);
10899
- const St = Nc(Qe, ot, Y), { bottom: mt, top: ct } = Ac(Le, se, ne, St), Ct = Ec(P / tt), ce = Ct * We + (Ct - 1) * He - mt;
10900
- return { bottom: mt, itemHeight: We, items: St, itemWidth: qe, offsetBottom: ce, offsetTop: ct, top: ct };
10868
+ const Qe = Xf(qe, Ke, ze);
10869
+ let Je, ot;
10870
+ ke ? H === 0 && te === 0 && de > 0 ? (Je = 0, ot = de - 1) : (Je = Qe * as((H + Be) / (Ue + Be)), ot = Qe * Ec((te + Be) / (Ue + Be)) - 1, ot = Ei(P - 1, Kr(ot, Qe - 1)), Je = Ei(ot, Kr(0, Je))) : (Je = 0, ot = -1);
10871
+ const St = Nc(Je, ot, Y), { bottom: mt, top: ct } = Ac(De, se, ne, St), Ct = Ec(P / Qe), ce = Ct * Ue + (Ct - 1) * Be - mt;
10872
+ return { bottom: mt, itemHeight: Ue, items: St, itemWidth: Ke, offsetBottom: ce, offsetTop: ct, top: ct };
10901
10873
  }
10902
10874
  )
10903
10875
  ),
10904
10876
  N
10905
10877
  ), he(
10906
- V(
10878
+ W(
10907
10879
  j,
10908
10880
  Te((P) => P !== null),
10909
10881
  le((P) => P.length)
10910
10882
  ),
10911
10883
  S
10912
10884
  ), he(
10913
- V(
10885
+ W(
10914
10886
  At(E, I, N, $),
10915
10887
  Te(([P, H, { items: te }]) => te.length > 0 && H.height !== 0 && P.height !== 0),
10916
10888
  le(([P, H, { items: te }, se]) => {
10917
- const { bottom: ne, top: Le } = Ac(P, se, H, te);
10918
- return [Le, ne];
10889
+ const { bottom: ne, top: De } = Ac(P, se, H, te);
10890
+ return [De, ne];
10919
10891
  }),
10920
10892
  xt(oo)
10921
10893
  ),
@@ -10923,18 +10895,18 @@ const TS = /* @__PURE__ */ nt(
10923
10895
  );
10924
10896
  const Re = X(!1);
10925
10897
  he(
10926
- V(
10898
+ W(
10927
10899
  c,
10928
- $e(Re),
10900
+ Le(Re),
10929
10901
  le(([P, H]) => H || P !== 0)
10930
10902
  ),
10931
10903
  Re
10932
10904
  );
10933
- const Ee = en(
10934
- V(
10905
+ const Ie = en(
10906
+ W(
10935
10907
  At(N, S),
10936
10908
  Te(([{ items: P }]) => P.length > 0),
10937
- $e(Re),
10909
+ Le(Re),
10938
10910
  Te(([[P, H], te]) => {
10939
10911
  const se = P.items[P.items.length - 1].index === H - 1;
10940
10912
  return (te || P.bottom > 0 && P.itemHeight > 0 && P.offsetBottom === 0 && P.items.length === H) && se;
@@ -10942,17 +10914,17 @@ const TS = /* @__PURE__ */ nt(
10942
10914
  le(([[, P]]) => P - 1),
10943
10915
  xt()
10944
10916
  )
10945
- ), W = en(
10946
- V(
10917
+ ), U = en(
10918
+ W(
10947
10919
  Se(N),
10948
10920
  Te(({ items: P }) => P.length > 0 && P[0].index === 0),
10949
10921
  wn(0),
10950
10922
  xt()
10951
10923
  )
10952
10924
  ), ee = en(
10953
- V(
10925
+ W(
10954
10926
  Se(N),
10955
- $e(D),
10927
+ Le(D),
10956
10928
  Te(([{ items: P }, H]) => P.length > 0 && !H),
10957
10929
  le(([{ items: P }]) => ({
10958
10930
  endIndex: P[P.length - 1].index,
@@ -10963,28 +10935,28 @@ const TS = /* @__PURE__ */ nt(
10963
10935
  )
10964
10936
  );
10965
10937
  he(ee, h.scrollSeekRangeChanged), he(
10966
- V(
10938
+ W(
10967
10939
  O,
10968
- $e(E, I, S, $),
10940
+ Le(E, I, S, $),
10969
10941
  le(([P, H, te, se, ne]) => {
10970
- const Le = Pf(P), { align: Y, behavior: de, offset: ke } = Le;
10971
- let Ne = Le.index;
10972
- Ne === "LAST" && (Ne = se - 1), Ne = Kr(0, Ne, Ei(se - 1, Ne));
10973
- let Be = ea(H, ne, te, Ne);
10974
- return Y === "end" ? Be = Ic(Be - H.height + te.height) : Y === "center" && (Be = Ic(Be - H.height / 2 + te.height / 2)), ke && (Be += ke), { behavior: de, top: Be };
10942
+ const De = Pf(P), { align: Y, behavior: de, offset: ke } = De;
10943
+ let Ae = De.index;
10944
+ Ae === "LAST" && (Ae = se - 1), Ae = Kr(0, Ae, Ei(se - 1, Ae));
10945
+ let ze = ea(H, ne, te, Ae);
10946
+ return Y === "end" ? ze = Ic(ze - H.height + te.height) : Y === "center" && (ze = Ic(ze - H.height / 2 + te.height / 2)), ke && (ze += ke), { behavior: de, top: ze };
10975
10947
  })
10976
10948
  ),
10977
10949
  l
10978
10950
  );
10979
- const U = Ht(
10980
- V(
10951
+ const q = Ht(
10952
+ W(
10981
10953
  N,
10982
10954
  le((P) => P.offsetBottom + P.bottom)
10983
10955
  ),
10984
10956
  0
10985
10957
  );
10986
10958
  return he(
10987
- V(
10959
+ W(
10988
10960
  T,
10989
10961
  le((P) => ({ height: P.visibleHeight, width: P.visibleWidth }))
10990
10962
  ),
@@ -11020,12 +10992,12 @@ const TS = /* @__PURE__ */ nt(
11020
10992
  gridState: N,
11021
10993
  horizontalDirection: pe,
11022
10994
  initialTopMostItemIndex: M,
11023
- totalListHeight: U,
10995
+ totalListHeight: q,
11024
10996
  ...p,
11025
- endReached: Ee,
10997
+ endReached: Ie,
11026
10998
  propsReady: x,
11027
10999
  rangeChanged: ee,
11028
- startReached: W,
11000
+ startReached: U,
11029
11001
  stateChanged: A,
11030
11002
  stateRestoreInProgress: D,
11031
11003
  ...C
@@ -11049,7 +11021,7 @@ function ea(e, t, n, r) {
11049
11021
  }
11050
11022
  const kS = /* @__PURE__ */ nt(() => {
11051
11023
  const e = X((f) => `Item ${f}`), t = X({}), n = X(null), r = X("virtuoso-grid-item"), o = X("virtuoso-grid-list"), s = X(Ga), i = X("div"), a = X(Or), l = (f, p = null) => Ht(
11052
- V(
11024
+ W(
11053
11025
  t,
11054
11026
  le((h) => h[f]),
11055
11027
  xt()
@@ -11545,9 +11517,9 @@ var Vs = "Dialog", [rp, xk] = Mn(Vs), [VS, yn] = rp(Vs), op = (e) => {
11545
11517
  op.displayName = Vs;
11546
11518
  var sp = "DialogTrigger", ip = v.forwardRef(
11547
11519
  (e, t) => {
11548
- const { __scopeDialog: n, ...r } = e, o = yn(sp, n), s = Ke(t, o.triggerRef);
11520
+ const { __scopeDialog: n, ...r } = e, o = yn(sp, n), s = Ve(t, o.triggerRef);
11549
11521
  return /* @__PURE__ */ u.jsx(
11550
- Ae.button,
11522
+ je.button,
11551
11523
  {
11552
11524
  type: "button",
11553
11525
  "aria-haspopup": "dialog",
@@ -11583,7 +11555,7 @@ var qS = Tr("DialogOverlay.RemoveScroll"), GS = v.forwardRef(
11583
11555
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
11584
11556
  // ie. when `Overlay` and `Content` are siblings
11585
11557
  /* @__PURE__ */ u.jsx(Ds, { as: qS, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ u.jsx(
11586
- Ae.div,
11558
+ je.div,
11587
11559
  {
11588
11560
  "data-state": el(o.open),
11589
11561
  ...r,
@@ -11602,7 +11574,7 @@ var qS = Tr("DialogOverlay.RemoveScroll"), GS = v.forwardRef(
11602
11574
  up.displayName = lr;
11603
11575
  var YS = v.forwardRef(
11604
11576
  (e, t) => {
11605
- const n = yn(lr, e.__scopeDialog), r = v.useRef(null), o = Ke(t, n.contentRef, r);
11577
+ const n = yn(lr, e.__scopeDialog), r = v.useRef(null), o = Ve(t, n.contentRef, r);
11606
11578
  return v.useEffect(() => {
11607
11579
  const s = r.current;
11608
11580
  if (s) return Aa(s);
@@ -11653,7 +11625,7 @@ var YS = v.forwardRef(
11653
11625
  }
11654
11626
  ), dp = v.forwardRef(
11655
11627
  (e, t) => {
11656
- const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = yn(lr, n), l = v.useRef(null), c = Ke(t, l);
11628
+ const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = yn(lr, n), l = v.useRef(null), c = Ve(t, l);
11657
11629
  return ba(), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
11658
11630
  /* @__PURE__ */ u.jsx(
11659
11631
  Is,
@@ -11687,14 +11659,14 @@ var YS = v.forwardRef(
11687
11659
  ), Qa = "DialogTitle", fp = v.forwardRef(
11688
11660
  (e, t) => {
11689
11661
  const { __scopeDialog: n, ...r } = e, o = yn(Qa, n);
11690
- return /* @__PURE__ */ u.jsx(Ae.h2, { id: o.titleId, ...r, ref: t });
11662
+ return /* @__PURE__ */ u.jsx(je.h2, { id: o.titleId, ...r, ref: t });
11691
11663
  }
11692
11664
  );
11693
11665
  fp.displayName = Qa;
11694
11666
  var pp = "DialogDescription", hp = v.forwardRef(
11695
11667
  (e, t) => {
11696
11668
  const { __scopeDialog: n, ...r } = e, o = yn(pp, n);
11697
- return /* @__PURE__ */ u.jsx(Ae.p, { id: o.descriptionId, ...r, ref: t });
11669
+ return /* @__PURE__ */ u.jsx(je.p, { id: o.descriptionId, ...r, ref: t });
11698
11670
  }
11699
11671
  );
11700
11672
  hp.displayName = pp;
@@ -11702,7 +11674,7 @@ var mp = "DialogClose", gp = v.forwardRef(
11702
11674
  (e, t) => {
11703
11675
  const { __scopeDialog: n, ...r } = e, o = yn(mp, n);
11704
11676
  return /* @__PURE__ */ u.jsx(
11705
- Ae.button,
11677
+ je.button,
11706
11678
  {
11707
11679
  type: "button",
11708
11680
  ...r,
@@ -13643,10 +13615,10 @@ const Bc = z.memo(function({
13643
13615
  messageParentCheckpointId: E = null
13644
13616
  }) {
13645
13617
  const [I, O] = ge(!1), [L, F] = ge("preview"), [j, $] = ge(!1), { currentThreadId: A } = xa(), { respondToInterrupt: B } = ya(), D = l === "phone" || l === "half-screen", M = t.role, Z = M === "tool", J = lt(() => "type" in t && t.type === "default_message" ? t : null, [t]), pe = !!J, Re = !(r && M !== "user"), {
13646
- uploadingFiles: Ee,
13647
- handleFileClick: W,
13618
+ uploadingFiles: Ie,
13619
+ handleFileClick: U,
13648
13620
  fileViewerOpen: ee,
13649
- currentFileInfo: U,
13621
+ currentFileInfo: q,
13650
13622
  closeFileViewer: P
13651
13623
  } = IC({ allowFileOpen: Re, currentThreadId: A }), H = z.useMemo(() => {
13652
13624
  switch (M) {
@@ -13662,16 +13634,16 @@ const Bc = z.memo(function({
13662
13634
  return "text-[hsl(var(--chat-bubble-ai-text))]";
13663
13635
  }
13664
13636
  }, [M]), te = lt(() => J ? "" : CC(t.content), [J, t]), se = lt(() => J ? {} : Pp(t), [J, t]), ne = lt(
13665
- () => J ? [] : t.content.filter((K) => K.type === "image_url"),
13637
+ () => J ? [] : t.content.filter((V) => V.type === "image_url"),
13666
13638
  [J, t]
13667
- ), Le = lt(
13668
- () => J ? [] : t.content.filter((K) => K.type === "file"),
13639
+ ), De = lt(
13640
+ () => J ? [] : t.content.filter((V) => V.type === "file"),
13669
13641
  [J, t]
13670
13642
  ), Y = lt(
13671
- () => J ? [] : t.content.filter((K) => K.type === "interrupt"),
13643
+ () => J ? [] : t.content.filter((V) => V.type === "interrupt"),
13672
13644
  [J, t]
13673
- ), de = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), ke = Mo(de), Ne = g == null ? void 0 : g.value, Be = lt(() => J ? "" : TC(t.content), [J, t]), He = z.useCallback(async () => {
13674
- const K = Z ? Be : te;
13645
+ ), de = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), ke = Mo(de), Ae = g == null ? void 0 : g.value, ze = lt(() => J ? "" : TC(t.content), [J, t]), Be = z.useCallback(async () => {
13646
+ const V = Z ? ze : te;
13675
13647
  async function ve(xe) {
13676
13648
  if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
13677
13649
  await navigator.clipboard.writeText(xe);
@@ -13689,20 +13661,20 @@ const Bc = z.memo(function({
13689
13661
  throw new Error("Clipboard API not supported in this context.");
13690
13662
  }
13691
13663
  try {
13692
- await ve(K), O(!0), setTimeout(() => O(!1), 2e3), y == null || y(K);
13664
+ await ve(V), O(!0), setTimeout(() => O(!1), 2e3), y == null || y(V);
13693
13665
  } catch (xe) {
13694
13666
  console.error("Failed to copy:", xe);
13695
13667
  }
13696
- }, [Z, Be, te, y]), We = z.useCallback(() => {
13668
+ }, [Z, ze, te, y]), Ue = z.useCallback(() => {
13697
13669
  if (!h) return;
13698
- const K = Z ? Be : te, ve = "type" in t && t.type === "default_message" ? void 0 : {
13670
+ const V = Z ? ze : te, ve = "type" in t && t.type === "default_message" ? void 0 : {
13699
13671
  checkpointId: t.checkpointId ?? null,
13700
13672
  checkpointNs: t.checkpointNs ?? null
13701
13673
  };
13702
- h(t.id, K, ve);
13703
- }, [h, t.id, Z, Be, te, t]), qe = z.useCallback(() => {
13674
+ h(t.id, V, ve);
13675
+ }, [h, t.id, Z, ze, te, t]), Ke = z.useCallback(() => {
13704
13676
  m == null || m(n);
13705
- }, [m, n]), Ge = z.useCallback(() => {
13677
+ }, [m, n]), qe = z.useCallback(() => {
13706
13678
  const ve = Q(D ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", H);
13707
13679
  switch (M) {
13708
13680
  case "user":
@@ -13714,26 +13686,26 @@ const Bc = z.memo(function({
13714
13686
  default:
13715
13687
  return /* @__PURE__ */ u.jsx(si, { className: ve });
13716
13688
  }
13717
- }, [D, H, M]), tt = z.useCallback(() => {
13718
- const K = "group relative mb-4 flex w-full";
13689
+ }, [D, H, M]), Qe = z.useCallback(() => {
13690
+ const V = "group relative mb-4 flex w-full";
13719
13691
  switch (M) {
13720
13692
  case "user":
13721
- return Q(K, "justify-end");
13693
+ return Q(V, "justify-end");
13722
13694
  case "assistant":
13723
13695
  case "tool":
13724
13696
  case "system":
13725
- return Q(K, "justify-start");
13697
+ return Q(V, "justify-start");
13726
13698
  default:
13727
- return K;
13699
+ return V;
13728
13700
  }
13729
- }, [M]), Qe = z.useCallback(() => {
13730
- const K = Q(
13701
+ }, [M]), Je = z.useCallback(() => {
13702
+ const V = Q(
13731
13703
  "rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
13732
13704
  D && "px-3 py-2 text-sm"
13733
13705
  );
13734
13706
  if (pe)
13735
13707
  return Q(
13736
- K,
13708
+ V,
13737
13709
  "w-full",
13738
13710
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
13739
13711
  "border border-border/60 dark:border-border/40 shadow-sm"
@@ -13741,25 +13713,25 @@ const Bc = z.memo(function({
13741
13713
  switch (M) {
13742
13714
  case "user":
13743
13715
  return Q(
13744
- K,
13716
+ V,
13745
13717
  "w-full md:max-w-[95%]",
13746
13718
  "bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
13747
13719
  "border border-transparent"
13748
13720
  );
13749
13721
  case "assistant":
13750
13722
  return Q(
13751
- K,
13723
+ V,
13752
13724
  "w-full md:max-w-[95%]",
13753
13725
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
13754
13726
  "border border-border/60 dark:border-border/40"
13755
13727
  );
13756
13728
  case "tool":
13757
- return Q(K, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
13729
+ return Q(V, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
13758
13730
  case "system":
13759
- return Q(K, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
13731
+ return Q(V, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
13760
13732
  default:
13761
13733
  return Q(
13762
- K,
13734
+ V,
13763
13735
  "w-full md:max-w-[95%]",
13764
13736
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
13765
13737
  "border border-border/60 dark:border-border/40"
@@ -13767,7 +13739,7 @@ const Bc = z.memo(function({
13767
13739
  }
13768
13740
  }, [D, pe, M]);
13769
13741
  if (pe && J)
13770
- return /* @__PURE__ */ u.jsx("div", { className: Q(tt(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Q(Qe(), p.content), children: [
13742
+ return /* @__PURE__ */ u.jsx("div", { className: Q(Qe(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Q(Je(), p.content), children: [
13771
13743
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
13772
13744
  /* @__PURE__ */ u.jsx(si, { className: Q("h-4 w-4", H) }),
13773
13745
  a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
@@ -13780,14 +13752,14 @@ const Bc = z.memo(function({
13780
13752
  }
13781
13753
  )
13782
13754
  ] }) });
13783
- const ot = z.useCallback(async (K) => {
13755
+ const ot = z.useCallback(async (V) => {
13784
13756
  if (w)
13785
13757
  return;
13786
13758
  const ve = Mo(
13787
- (K == null ? void 0 : K.id) ?? (K == null ? void 0 : K.interrupt_id)
13759
+ (V == null ? void 0 : V.id) ?? (V == null ? void 0 : V.interrupt_id)
13788
13760
  );
13789
13761
  if (!ve) {
13790
- console.warn("Interrupt part missing id", K);
13762
+ console.warn("Interrupt part missing id", V);
13791
13763
  return;
13792
13764
  }
13793
13765
  try {
@@ -13797,14 +13769,14 @@ const Bc = z.memo(function({
13797
13769
  } finally {
13798
13770
  T == null || T();
13799
13771
  }
13800
- }, [w, T, b, B]), St = z.useCallback(async (K) => {
13772
+ }, [w, T, b, B]), St = z.useCallback(async (V) => {
13801
13773
  if (w)
13802
13774
  return;
13803
13775
  const ve = Mo(
13804
- (K == null ? void 0 : K.id) ?? (K == null ? void 0 : K.interrupt_id)
13776
+ (V == null ? void 0 : V.id) ?? (V == null ? void 0 : V.interrupt_id)
13805
13777
  );
13806
13778
  if (!ve) {
13807
- console.warn("Interrupt part missing id", K);
13779
+ console.warn("Interrupt part missing id", V);
13808
13780
  return;
13809
13781
  }
13810
13782
  try {
@@ -13814,9 +13786,9 @@ const Bc = z.memo(function({
13814
13786
  } finally {
13815
13787
  T == null || T();
13816
13788
  }
13817
- }, [w, T, b, B]), mt = z.useCallback(({ part: K, i: ve }) => {
13818
- if (K.type === "text") {
13819
- const xe = K.text ?? "", ht = xe.trim(), gt = Ja(ht);
13789
+ }, [w, T, b, B]), mt = z.useCallback(({ part: V, i: ve }) => {
13790
+ if (V.type === "text") {
13791
+ const xe = V.text ?? "", ht = xe.trim(), gt = Ja(ht);
13820
13792
  return gt && M !== "tool" ? /* @__PURE__ */ u.jsx(Op, { data: gt }, ve) : M === "user" && c && ht.length > d ? /* @__PURE__ */ u.jsx(
13821
13793
  NC,
13822
13794
  {
@@ -13829,8 +13801,8 @@ const Bc = z.memo(function({
13829
13801
  ve
13830
13802
  ) : /* @__PURE__ */ u.jsx(fs, { content: xe, allowHtml: !1 }, ve);
13831
13803
  }
13832
- if (K.type === "image_url") {
13833
- const xe = K;
13804
+ if (V.type === "image_url") {
13805
+ const xe = V;
13834
13806
  return /* @__PURE__ */ u.jsx("div", { className: "my-2", children: /* @__PURE__ */ u.jsx(
13835
13807
  "img",
13836
13808
  {
@@ -13841,30 +13813,30 @@ const Bc = z.memo(function({
13841
13813
  }
13842
13814
  ) }, ve);
13843
13815
  }
13844
- if (K.type === "file") {
13845
- const xe = K, ht = xe.name || "file";
13816
+ if (V.type === "file") {
13817
+ const xe = V, ht = xe.name || "file";
13846
13818
  return /* @__PURE__ */ u.jsxs(
13847
13819
  "a",
13848
13820
  {
13849
13821
  href: xe.url,
13850
- onClick: (gt) => W(gt, xe, ve),
13822
+ onClick: (gt) => U(gt, xe, ve),
13851
13823
  className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
13852
13824
  dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
13853
13825
  children: [
13854
- Ee[ve] ? /* @__PURE__ */ u.jsx(ua, { className: "h-4 w-4 animate-spin" }) : null,
13826
+ Ie[ve] ? /* @__PURE__ */ u.jsx(ua, { className: "h-4 w-4 animate-spin" }) : null,
13855
13827
  /* @__PURE__ */ u.jsxs("span", { className: "truncate max-w-[180px]", children: [
13856
13828
  ht,
13857
- Ee[ve] ? " (processing)" : ""
13829
+ Ie[ve] ? " (processing)" : ""
13858
13830
  ] })
13859
13831
  ]
13860
13832
  },
13861
13833
  ve
13862
13834
  );
13863
13835
  }
13864
- if (K.type === "interrupt") {
13865
- const xe = K, ht = Mo(
13836
+ if (V.type === "interrupt") {
13837
+ const xe = V, ht = Mo(
13866
13838
  (xe == null ? void 0 : xe.id) ?? (xe == null ? void 0 : xe.interrupt_id)
13867
- ), gt = !!(ke && ht && ht === ke), Tt = gt ? Ne ?? (xe == null ? void 0 : xe.value) : xe == null ? void 0 : xe.value, _e = ht ? { ...xe, id: ht, interrupt_id: ht } : xe;
13839
+ ), gt = !!(ke && ht && ht === ke), Tt = gt ? Ae ?? (xe == null ? void 0 : xe.value) : xe == null ? void 0 : xe.value, _e = ht ? { ...xe, id: ht, interrupt_id: ht } : xe;
13868
13840
  return /* @__PURE__ */ u.jsx(
13869
13841
  EC,
13870
13842
  {
@@ -13880,8 +13852,8 @@ const Bc = z.memo(function({
13880
13852
  }
13881
13853
  return null;
13882
13854
  }, [
13883
- W,
13884
- Ee,
13855
+ U,
13856
+ Ie,
13885
13857
  ot,
13886
13858
  St,
13887
13859
  M,
@@ -13890,7 +13862,7 @@ const Bc = z.memo(function({
13890
13862
  j,
13891
13863
  D,
13892
13864
  ke,
13893
- Ne,
13865
+ Ae,
13894
13866
  g,
13895
13867
  w,
13896
13868
  Y
@@ -13898,10 +13870,10 @@ const Bc = z.memo(function({
13898
13870
  /* @__PURE__ */ u.jsx(ji, { className: "h-4 w-4 text-muted-foreground" }),
13899
13871
  /* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
13900
13872
  ] }), []), Ct = z.useCallback(() => {
13901
- const K = te.trim().length > 0 || ne.length > 0 || Le.length > 0 || Y.length > 0;
13902
- if (!Z && Le.length > 0 && !r)
13873
+ const V = te.trim().length > 0 || ne.length > 0 || De.length > 0 || Y.length > 0;
13874
+ if (!Z && De.length > 0 && !r)
13903
13875
  return ct();
13904
- if (!Z && !K && !r)
13876
+ if (!Z && !V && !r)
13905
13877
  return null;
13906
13878
  if (Z)
13907
13879
  return /* @__PURE__ */ u.jsx(
@@ -13922,30 +13894,30 @@ const Bc = z.memo(function({
13922
13894
  }, [
13923
13895
  te,
13924
13896
  ne.length,
13925
- Le.length,
13897
+ De.length,
13926
13898
  Y.length,
13927
13899
  r,
13928
13900
  Z,
13929
13901
  L,
13930
13902
  ct,
13931
13903
  H
13932
- ]), ce = lt(() => J ? "Assistant" : kC(t), [J, t]), re = z.useMemo(() => J ? [] : Array.isArray(C) ? C : [], [C, J]), Ye = z.useMemo(() => {
13933
- var K;
13934
- return re.length ? N && re.some((ve) => ve.id === N) ? N : ((K = re[0]) == null ? void 0 : K.id) ?? null : null;
13935
- }, [N, re]), Xe = z.useMemo(() => !re.length || !S ? null : re.some((K) => K.id === S) ? S : null, [S, re]) ?? Ye, je = M === "user" && re.length > 0 && typeof k == "function", Fe = z.useCallback(
13936
- (K) => {
13904
+ ]), ce = lt(() => J ? "Assistant" : kC(t), [J, t]), re = z.useMemo(() => J ? [] : Array.isArray(C) ? C : [], [C, J]), Ge = z.useMemo(() => {
13905
+ var V;
13906
+ return re.length ? N && re.some((ve) => ve.id === N) ? N : ((V = re[0]) == null ? void 0 : V.id) ?? null : null;
13907
+ }, [N, re]), Oe = z.useMemo(() => !re.length || !S ? null : re.some((V) => V.id === S) ? S : null, [S, re]) ?? Ge, et = M === "user" && re.length > 0 && typeof k == "function", tt = z.useCallback(
13908
+ (V) => {
13937
13909
  if (!k) return;
13938
- const ve = (K == null ? void 0 : K.id) ?? null, xe = (K == null ? void 0 : K.parentId) ?? E ?? null;
13910
+ const ve = (V == null ? void 0 : V.id) ?? null, xe = (V == null ? void 0 : V.parentId) ?? E ?? null;
13939
13911
  k(ve, xe);
13940
13912
  },
13941
13913
  [E, k]
13942
- ), Oe = z.useMemo(() => Xe ? re.findIndex((K) => K.id === Xe) : -1, [Xe, re]), Pt = z.useMemo(() => Oe < 0 ? null : re[Oe] ?? null, [Oe, re]), jt = z.useCallback((K) => {
13914
+ ), Fe = z.useMemo(() => Oe ? re.findIndex((V) => V.id === Oe) : -1, [Oe, re]), Pt = z.useMemo(() => Fe < 0 ? null : re[Fe] ?? null, [Fe, re]), jt = z.useCallback((V) => {
13943
13915
  const ve = [];
13944
- if (K.step !== null && ve.push(`Step ${K.step}`), K.source && ve.push(K.source), !K.createdAt)
13945
- return ve.length ? ve.join(" • ") : K.id.slice(0, 8);
13916
+ if (V.step !== null && ve.push(`Step ${V.step}`), V.source && ve.push(V.source), !V.createdAt)
13917
+ return ve.length ? ve.join(" • ") : V.id.slice(0, 8);
13946
13918
  let xe = "";
13947
13919
  try {
13948
- const ht = new Date(K.createdAt);
13920
+ const ht = new Date(V.createdAt);
13949
13921
  Number.isNaN(ht.getTime()) || (xe = new Intl.DateTimeFormat(void 0, {
13950
13922
  hour: "2-digit",
13951
13923
  minute: "2-digit"
@@ -13956,7 +13928,7 @@ const Bc = z.memo(function({
13956
13928
  return `${xe}`;
13957
13929
  }, []);
13958
13930
  return Z && !f ? null : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
13959
- /* @__PURE__ */ u.jsx("div", { className: Q(tt(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Q(Qe(), p.content), children: [
13931
+ /* @__PURE__ */ u.jsx("div", { className: Q(Qe(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Q(Je(), p.content), children: [
13960
13932
  (i || a || Z) && /* @__PURE__ */ u.jsxs(
13961
13933
  "div",
13962
13934
  {
@@ -13968,7 +13940,7 @@ const Bc = z.memo(function({
13968
13940
  ),
13969
13941
  children: [
13970
13942
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
13971
- Ge(),
13943
+ qe(),
13972
13944
  a && ce && /* @__PURE__ */ u.jsx("span", { className: Q("font-medium", D ? "text-xs" : "text-sm"), children: ce }),
13973
13945
  Z && /* @__PURE__ */ u.jsxs(
13974
13946
  Zf,
@@ -13983,9 +13955,9 @@ const Bc = z.memo(function({
13983
13955
  role: "button",
13984
13956
  tabIndex: 0,
13985
13957
  "aria-expanded": L === "expanded",
13986
- onClick: () => F((K) => K === "expanded" ? "preview" : "expanded"),
13987
- onKeyDown: (K) => {
13988
- (K.key === "Enter" || K.key === " ") && (K.preventDefault(), F((ve) => ve === "expanded" ? "preview" : "expanded"));
13958
+ onClick: () => F((V) => V === "expanded" ? "preview" : "expanded"),
13959
+ onKeyDown: (V) => {
13960
+ (V.key === "Enter" || V.key === " ") && (V.preventDefault(), F((ve) => ve === "expanded" ? "preview" : "expanded"));
13989
13961
  },
13990
13962
  children: [
13991
13963
  /* @__PURE__ */ u.jsx("span", { children: se.name ?? "Tool Output" }),
@@ -13996,28 +13968,28 @@ const Bc = z.memo(function({
13996
13968
  )
13997
13969
  ] }),
13998
13970
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
13999
- je && Pt && Oe >= 0 && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs", children: [
13971
+ et && Pt && Fe >= 0 && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs", children: [
14000
13972
  /* @__PURE__ */ u.jsx(
14001
13973
  "button",
14002
13974
  {
14003
13975
  type: "button",
14004
13976
  className: Q(
14005
13977
  "flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
14006
- Oe > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
13978
+ Fe > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
14007
13979
  ),
14008
13980
  onClick: () => {
14009
- if (Oe <= 0) return;
14010
- const K = re[Oe - 1];
14011
- K && Fe(K);
13981
+ if (Fe <= 0) return;
13982
+ const V = re[Fe - 1];
13983
+ V && tt(V);
14012
13984
  },
14013
13985
  "aria-label": "Previous checkpoint",
14014
- disabled: Oe <= 0,
13986
+ disabled: Fe <= 0,
14015
13987
  children: /* @__PURE__ */ u.jsx(xm, { className: "h-3 w-3" })
14016
13988
  }
14017
13989
  ),
14018
13990
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
14019
13991
  /* @__PURE__ */ u.jsxs("span", { className: "whitespace-nowrap", children: [
14020
- Oe + 1,
13992
+ Fe + 1,
14021
13993
  " / ",
14022
13994
  re.length
14023
13995
  ] }),
@@ -14029,15 +14001,15 @@ const Bc = z.memo(function({
14029
14001
  type: "button",
14030
14002
  className: Q(
14031
14003
  "flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
14032
- Oe < re.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
14004
+ Fe < re.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
14033
14005
  ),
14034
14006
  onClick: () => {
14035
- if (Oe >= re.length - 1) return;
14036
- const K = re[Oe + 1];
14037
- K && Fe(K);
14007
+ if (Fe >= re.length - 1) return;
14008
+ const V = re[Fe + 1];
14009
+ V && tt(V);
14038
14010
  },
14039
14011
  "aria-label": "Next checkpoint",
14040
- disabled: Oe >= re.length - 1,
14012
+ disabled: Fe >= re.length - 1,
14041
14013
  children: /* @__PURE__ */ u.jsx(Xc, { className: "h-3 w-3" })
14042
14014
  }
14043
14015
  )
@@ -14065,7 +14037,7 @@ const Bc = z.memo(function({
14065
14037
  {
14066
14038
  variant: "ghost",
14067
14039
  size: "sm",
14068
- onClick: () => He(),
14040
+ onClick: () => Be(),
14069
14041
  className: Q("h-6 w-6 p-0 hover:bg-foreground/10", H, D && "h-5 w-5"),
14070
14042
  "aria-label": "Copy message",
14071
14043
  title: "Copy message",
@@ -14077,7 +14049,7 @@ const Bc = z.memo(function({
14077
14049
  {
14078
14050
  variant: "ghost",
14079
14051
  size: "sm",
14080
- onClick: We,
14052
+ onClick: Ue,
14081
14053
  className: Q("h-6 w-6 p-0 hover:bg-foreground/10", H, D && "h-5 w-5"),
14082
14054
  "aria-label": "Edit message",
14083
14055
  children: /* @__PURE__ */ u.jsx(fl, { className: Q(H, D ? "h-3 w-3" : "h-4 w-4") })
@@ -14088,7 +14060,7 @@ const Bc = z.memo(function({
14088
14060
  {
14089
14061
  variant: "ghost",
14090
14062
  size: "sm",
14091
- onClick: qe,
14063
+ onClick: Ke,
14092
14064
  className: Q("h-6 w-6 p-0 hover:bg-foreground/10", H, D && "h-5 w-5"),
14093
14065
  "aria-label": "Regenerate response",
14094
14066
  children: /* @__PURE__ */ u.jsx(_i, { className: Q(H, D ? "h-3 w-3" : "h-4 w-4") })
@@ -14126,7 +14098,7 @@ const Bc = z.memo(function({
14126
14098
  {
14127
14099
  variant: "ghost",
14128
14100
  size: "sm",
14129
- onClick: () => He(),
14101
+ onClick: () => Be(),
14130
14102
  className: Q("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
14131
14103
  children: /* @__PURE__ */ u.jsx(dl, { className: Q(I ? "text-success" : "text-current", D ? "h-3 w-3" : "h-4 w-4") })
14132
14104
  }
@@ -14136,7 +14108,7 @@ const Bc = z.memo(function({
14136
14108
  {
14137
14109
  variant: "ghost",
14138
14110
  size: "sm",
14139
- onClick: We,
14111
+ onClick: Ue,
14140
14112
  className: Q("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
14141
14113
  children: /* @__PURE__ */ u.jsx(fl, { className: Q("text-current", D ? "h-3 w-3" : "h-4 w-4") })
14142
14114
  }
@@ -14146,7 +14118,7 @@ const Bc = z.memo(function({
14146
14118
  {
14147
14119
  variant: "ghost",
14148
14120
  size: "sm",
14149
- onClick: qe,
14121
+ onClick: Ke,
14150
14122
  className: Q("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
14151
14123
  children: /* @__PURE__ */ u.jsx(_i, { className: Q("text-current", D ? "h-3 w-3" : "h-4 w-4") })
14152
14124
  }
@@ -14155,14 +14127,14 @@ const Bc = z.memo(function({
14155
14127
  }
14156
14128
  )
14157
14129
  ] }) }),
14158
- U && /* @__PURE__ */ u.jsx(
14130
+ q && /* @__PURE__ */ u.jsx(
14159
14131
  oC,
14160
14132
  {
14161
14133
  isOpen: ee,
14162
14134
  onClose: P,
14163
- fileId: U.id,
14164
- fileName: U.name,
14165
- mimeType: U.mimeType
14135
+ fileId: q.id,
14136
+ fileName: q.name,
14137
+ mimeType: q.mimeType
14166
14138
  }
14167
14139
  )
14168
14140
  ] });
@@ -14431,7 +14403,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14431
14403
  onSelectCheckpoint: I,
14432
14404
  timelineCheckpoints: O
14433
14405
  }, L) => {
14434
- const F = et(null), j = et(null), $ = et(!1), [A, B] = ge(!0), D = lt(() => w ? e.some((Y) => "type" in Y && Y.type === "default_message" ? !1 : Array.isArray(Y == null ? void 0 : Y.content) && Y.content.some(
14406
+ const F = Ze(null), j = Ze(null), $ = Ze(!1), [A, B] = ge(!0), D = lt(() => w ? e.some((Y) => "type" in Y && Y.type === "default_message" ? !1 : Array.isArray(Y == null ? void 0 : Y.content) && Y.content.some(
14435
14407
  (de) => de && de.type === "interrupt" && (de.id ?? de.interrupt_id) === w.id
14436
14408
  )) : !1, [w, e]), M = lt(() => {
14437
14409
  if (!w || D)
@@ -14440,8 +14412,8 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14440
14412
  let de;
14441
14413
  const ke = w.value;
14442
14414
  if (ke && typeof ke == "object" && !Array.isArray(ke)) {
14443
- const Ne = ke.title;
14444
- typeof Ne == "string" && Ne.trim() && (de = Ne.trim());
14415
+ const Ae = ke.title;
14416
+ typeof Ae == "string" && Ae.trim() && (de = Ae.trim());
14445
14417
  }
14446
14418
  return {
14447
14419
  id: `interrupt-${Y}`,
@@ -14459,19 +14431,19 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14459
14431
  }, [w, D]), Z = lt(() => M ? [...e, M] : e, [e, M]), J = lt(() => S ? Z : Z.filter((Y) => (Y == null ? void 0 : Y.role) !== "tool"), [Z, S]), pe = lt(() => {
14460
14432
  const Y = /* @__PURE__ */ new Set(), de = [];
14461
14433
  for (let ke = J.length - 1; ke >= 0; ke--) {
14462
- const Ne = J[ke];
14463
- if (!Ne) continue;
14464
- if ("type" in Ne && Ne.type === "default_message") {
14465
- de.push(Ne);
14434
+ const Ae = J[ke];
14435
+ if (!Ae) continue;
14436
+ if ("type" in Ae && Ae.type === "default_message") {
14437
+ de.push(Ae);
14466
14438
  continue;
14467
14439
  }
14468
- const Be = Ne, He = jC(Be);
14469
- Y.has(He) || (Y.add(He), de.push(Be));
14440
+ const ze = Ae, Be = jC(ze);
14441
+ Y.has(Be) || (Y.add(Be), de.push(ze));
14470
14442
  }
14471
14443
  return de.reverse();
14472
14444
  }, [J]), Re = Ce((Y) => {
14473
14445
  B(Y), y && y(!Y), g && g(Y);
14474
- }, [y, g]), Ee = lt(() => {
14446
+ }, [y, g]), Ie = lt(() => {
14475
14447
  if (a)
14476
14448
  return async () => {
14477
14449
  if (!$.current) {
@@ -14483,7 +14455,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14483
14455
  }
14484
14456
  }
14485
14457
  };
14486
- }, [a]), W = lt(() => !m || x ? !1 : A ? "auto" : !1, [A, m, x]), ee = lt(() => O ?? [], [O]), U = E ?? (ee.length ? ee[ee.length - 1].id : null), P = ee.length > 0, H = lt(() => {
14458
+ }, [a]), U = lt(() => !m || x ? !1 : A ? "auto" : !1, [A, m, x]), ee = lt(() => O ?? [], [O]), q = E ?? (ee.length ? ee[ee.length - 1].id : null), P = ee.length > 0, H = lt(() => {
14487
14459
  if (typeof h != "string") return null;
14488
14460
  const Y = h.trim();
14489
14461
  return Y ? {
@@ -14504,7 +14476,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14504
14476
  ] }),
14505
14477
  /* @__PURE__ */ u.jsx("div", { className: "pointer-events-none absolute left-5 top-0 bottom-0 w-px bg-border/50" }),
14506
14478
  /* @__PURE__ */ u.jsx("div", { className: "flex flex-col gap-4", children: ee.map((Y) => {
14507
- const de = U === Y.id;
14479
+ const de = q === Y.id;
14508
14480
  return /* @__PURE__ */ u.jsxs(
14509
14481
  "button",
14510
14482
  {
@@ -14559,7 +14531,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14559
14531
  onCancelEdit: () => {
14560
14532
  }
14561
14533
  }
14562
- ) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: h ?? "No messages yet. Start a conversation!" }), Le = pe.length > 0;
14534
+ ) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: h ?? "No messages yet. Start a conversation!" }), De = pe.length > 0;
14563
14535
  return lm(
14564
14536
  L,
14565
14537
  () => ({
@@ -14586,7 +14558,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14586
14558
  [pe]
14587
14559
  ), /* @__PURE__ */ u.jsxs("div", { className: se, style: p, children: [
14588
14560
  te,
14589
- /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: Le ? /* @__PURE__ */ u.jsx(
14561
+ /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: De ? /* @__PURE__ */ u.jsx(
14590
14562
  vS,
14591
14563
  {
14592
14564
  ref: (Y) => {
@@ -14596,37 +14568,37 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14596
14568
  j.current = Y instanceof HTMLDivElement ? Y : null;
14597
14569
  },
14598
14570
  data: pe,
14599
- followOutput: W,
14571
+ followOutput: U,
14600
14572
  overscan: 200,
14601
14573
  increaseViewportBy: { top: 100, bottom: 200 },
14602
14574
  defaultItemHeight: 80,
14603
14575
  atBottomThreshold: 50,
14604
14576
  alignToBottom: !1,
14605
14577
  startReached: () => {
14606
- Ee && Ee();
14578
+ Ie && Ie();
14607
14579
  },
14608
14580
  atBottomStateChange: Re,
14609
14581
  style: { height: "100%", overscrollBehavior: "contain" },
14610
14582
  computeItemKey: (Y, de) => Hc(de, Y),
14611
14583
  itemContent: (Y, de) => {
14612
14584
  var ot;
14613
- const ke = Hc(de, Y), Ne = "type" in de && de.type === "default_message";
14614
- let Be = [], He = null, We = {}, qe = {}, Ge = null, tt = null;
14615
- if (!Ne) {
14585
+ const ke = Hc(de, Y), Ae = "type" in de && de.type === "default_message";
14586
+ let ze = [], Be = null, Ue = {}, Ke = {}, qe = null, Qe = null;
14587
+ if (!Ae) {
14616
14588
  const St = de, mt = St.checkpointId ?? null;
14617
- We = St.additionalKwargs ?? {}, qe = St.responseMetadata ?? {};
14589
+ Ue = St.additionalKwargs ?? {}, Ke = St.responseMetadata ?? {};
14618
14590
  const ct = mt && k ? k.get(mt) ?? null : null;
14619
- Ge = typeof We.step == "number" ? We.step : typeof qe.step == "number" ? qe.step : (ct == null ? void 0 : ct.step) ?? null;
14620
- const Ct = typeof We.source == "string" ? We.source : typeof qe.source == "string" ? qe.source : (ct == null ? void 0 : ct.source) ?? null;
14621
- tt = Ct ? String(Ct) : null;
14622
- const ce = Ge !== null && tt ? `${Ge}:${tt}` : null;
14623
- ce && (N != null && N.has(ce)) ? Be = N.get(ce) ?? [] : mt && ct && (Be = [ct]), He = mt ?? ((ot = Be[0]) == null ? void 0 : ot.id) ?? null;
14591
+ qe = typeof Ue.step == "number" ? Ue.step : typeof Ke.step == "number" ? Ke.step : (ct == null ? void 0 : ct.step) ?? null;
14592
+ const Ct = typeof Ue.source == "string" ? Ue.source : typeof Ke.source == "string" ? Ke.source : (ct == null ? void 0 : ct.source) ?? null;
14593
+ Qe = Ct ? String(Ct) : null;
14594
+ const ce = qe !== null && Qe ? `${qe}:${Qe}` : null;
14595
+ ce && (N != null && N.has(ce)) ? ze = N.get(ce) ?? [] : mt && ct && (ze = [ct]), Be = mt ?? ((ot = ze[0]) == null ? void 0 : ot.id) ?? null;
14624
14596
  }
14625
- const Qe = (() => {
14626
- if (typeof We.parentCheckpointId == "string")
14627
- return We.parentCheckpointId;
14628
- if (typeof qe.parentCheckpointId == "string")
14629
- return qe.parentCheckpointId;
14597
+ const Je = (() => {
14598
+ if (typeof Ue.parentCheckpointId == "string")
14599
+ return Ue.parentCheckpointId;
14600
+ if (typeof Ke.parentCheckpointId == "string")
14601
+ return Ke.parentCheckpointId;
14630
14602
  })();
14631
14603
  return /* @__PURE__ */ u.jsx(
14632
14604
  "div",
@@ -14657,11 +14629,11 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14657
14629
  onInterruptActionStart: T,
14658
14630
  onInterruptActionEnd: C,
14659
14631
  showToolMessages: S,
14660
- checkpointCandidates: Be,
14632
+ checkpointCandidates: ze,
14661
14633
  activeCheckpointId: E ?? null,
14662
14634
  onSelectCheckpoint: I,
14663
- defaultCheckpointId: He,
14664
- messageParentCheckpointId: Qe
14635
+ defaultCheckpointId: Be,
14636
+ messageParentCheckpointId: Je
14665
14637
  }
14666
14638
  )
14667
14639
  }
@@ -14705,23 +14677,23 @@ function Ai({
14705
14677
  checkpoints: I,
14706
14678
  interrupt: O,
14707
14679
  metadata: L
14708
- } = ya(), { isStreaming: F, error: j, connectionState: $, submit: A, stop: B } = Jx(), D = g ?? y ?? null, M = (E == null ? void 0 : E.id) ?? null, Z = (E == null ? void 0 : E.namespace) ?? null, J = (L == null ? void 0 : L.assemblingMessageId) ?? null, pe = O, [Re, Ee] = ge(!1);
14680
+ } = ya(), { isStreaming: F, error: j, connectionState: $, submit: A, stop: B } = Jx(), D = g ?? y ?? null, M = (E == null ? void 0 : E.id) ?? null, Z = (E == null ? void 0 : E.namespace) ?? null, J = (L == null ? void 0 : L.assemblingMessageId) ?? null, pe = O, [Re, Ie] = ge(!1);
14709
14681
  Et(() => {
14710
- pe || Ee(!1);
14682
+ pe || Ie(!1);
14711
14683
  }, [pe]);
14712
- const W = Ce(() => {
14713
- Ee(!0);
14684
+ const U = Ce(() => {
14685
+ Ie(!0);
14714
14686
  }, []), ee = Ce(() => {
14715
- Ee(!1);
14716
- }, []), U = !!pe || Re, [P, H] = ge(null), [te, se] = ge(""), [ne, Le] = ge(null), [Y, de] = ge(null), [ke, Ne] = ge([]), [Be, He] = ge(0), [We, qe] = ge(0), [Ge, tt] = ge(!1), [Qe, ot] = ge(null), [St, mt] = ge(null), [ct, Ct] = ge(!1), [ce, re] = ge(null), [Ye, De] = ge(!1), Xe = et(!1), [je, Fe] = ge(() => Uc.value), Oe = et(je), Pt = et(null), jt = Ce((G) => {
14717
- Uc.value = G, Fe(G);
14718
- }, []), [K, ve] = ge(!1), xe = et(null), ht = Ce((G) => {
14687
+ Ie(!1);
14688
+ }, []), q = !!pe || Re, [P, H] = ge(null), [te, se] = ge(""), [ne, De] = ge(null), [Y, de] = ge(null), [ke, Ae] = ge([]), [ze, Be] = ge(0), [Ue, Ke] = ge(0), [qe, Qe] = ge(!1), [Je, ot] = ge(null), [St, mt] = ge(null), [ct, Ct] = ge(!1), [ce, re] = ge(null), [Ge, Ee] = ge(!1), Oe = Ze(!1), [et, tt] = ge(() => Uc.value), Fe = Ze(et), Pt = Ze(null), jt = Ce((G) => {
14689
+ Uc.value = G, tt(G);
14690
+ }, []), [V, ve] = ge(!1), xe = Ze(null), ht = Ce((G) => {
14719
14691
  if (!Array.isArray(G))
14720
14692
  return { text: null, messageId: null };
14721
14693
  for (let oe = G.length - 1; oe >= 0; oe--) {
14722
14694
  const ae = G[oe];
14723
14695
  if (!ae || ae.role !== "user") continue;
14724
- const be = (ae.content ?? []).filter((Ze) => (Ze == null ? void 0 : Ze.type) === "text").map((Ze) => Ze.text).filter((Ze) => typeof Ze == "string" && Ze.trim().length > 0);
14696
+ const be = (ae.content ?? []).filter((Xe) => (Xe == null ? void 0 : Xe.type) === "text").map((Xe) => Xe.text).filter((Xe) => typeof Xe == "string" && Xe.trim().length > 0);
14725
14697
  return {
14726
14698
  text: be.length ? be.join(" ").trim() : null,
14727
14699
  messageId: ae.id ?? null
@@ -14746,16 +14718,16 @@ function Ai({
14746
14718
  const G = (be) => {
14747
14719
  if (!Array.isArray(be) || be.length === 0)
14748
14720
  return null;
14749
- const dt = be.map((Ze) => {
14750
- if (typeof Ze == "string")
14751
- return Ze.trim();
14752
- if (Ze && typeof Ze == "object" && "type" in Ze) {
14753
- const rt = Ze;
14721
+ const dt = be.map((Xe) => {
14722
+ if (typeof Xe == "string")
14723
+ return Xe.trim();
14724
+ if (Xe && typeof Xe == "object" && "type" in Xe) {
14725
+ const rt = Xe;
14754
14726
  if (typeof rt.type == "string")
14755
14727
  return rt.type;
14756
14728
  }
14757
14729
  return null;
14758
- }).filter((Ze) => !!(Ze && Ze.length));
14730
+ }).filter((Xe) => !!(Xe && Xe.length));
14759
14731
  return dt.length ? dt.join(", ") : null;
14760
14732
  }, oe = Array.isArray(I) ? I.map((be) => {
14761
14733
  const dt = G(be.next);
@@ -14768,9 +14740,9 @@ function Ai({
14768
14740
  } : be;
14769
14741
  }) : [];
14770
14742
  return oe.some((be) => gt(be.metadata, "step") !== null) && oe.sort((be, dt) => {
14771
- const Ze = gt(be.metadata, "step"), rt = gt(dt.metadata, "step");
14772
- if (Ze !== null || rt !== null)
14773
- return (rt ?? Number.NEGATIVE_INFINITY) - (Ze ?? Number.NEGATIVE_INFINITY);
14743
+ const Xe = gt(be.metadata, "step"), rt = gt(dt.metadata, "step");
14744
+ if (Xe !== null || rt !== null)
14745
+ return (rt ?? Number.NEGATIVE_INFINITY) - (Xe ?? Number.NEGATIVE_INFINITY);
14774
14746
  const Mt = Date.parse(be.createdAt ?? ""), tn = Date.parse(dt.createdAt ?? "");
14775
14747
  return Number.isNaN(Mt) || Number.isNaN(tn) ? 0 : tn - Mt;
14776
14748
  }), oe;
@@ -14779,27 +14751,27 @@ function Ai({
14779
14751
  for (const ae of _e) {
14780
14752
  const be = ae.checkpointId ?? null;
14781
14753
  if (!be) continue;
14782
- const dt = gt(ae.metadata, "step"), Ze = Tt(ae.metadata, "source"), rt = {
14754
+ const dt = gt(ae.metadata, "step"), Xe = Tt(ae.metadata, "source"), rt = {
14783
14755
  id: be,
14784
14756
  step: dt,
14785
- source: Ze,
14757
+ source: Xe,
14786
14758
  createdAt: ae.createdAt ?? null,
14787
14759
  namespace: ae.checkpointNs ?? null,
14788
14760
  parentId: ae.parentId ?? null
14789
14761
  };
14790
- if (G.set(be, rt), dt !== null && Ze) {
14791
- const Mt = `${dt}:${Ze}`, tn = oe.get(Mt) ?? [];
14762
+ if (G.set(be, rt), dt !== null && Xe) {
14763
+ const Mt = `${dt}:${Xe}`, tn = oe.get(Mt) ?? [];
14792
14764
  tn.push(rt), oe.set(Mt, tn);
14793
14765
  }
14794
14766
  }
14795
14767
  for (const ae of oe.values())
14796
14768
  ae.sort((be, dt) => {
14797
- const Ze = be.createdAt ?? "";
14798
- return (dt.createdAt ?? "").localeCompare(Ze);
14769
+ const Xe = be.createdAt ?? "";
14770
+ return (dt.createdAt ?? "").localeCompare(Xe);
14799
14771
  });
14800
14772
  return { checkpointMetaById: G, checkpointIndexByKey: oe };
14801
14773
  }, [_e, gt, Tt]), kt = lt(() => {
14802
- var Ze;
14774
+ var Xe;
14803
14775
  if (!_e.length) return [];
14804
14776
  const G = [..._e].reverse(), oe = (rt, Mt) => {
14805
14777
  const tn = rt.checkpointId ?? null;
@@ -14818,7 +14790,7 @@ function Ai({
14818
14790
  };
14819
14791
  }, ae = [], be = /* @__PURE__ */ new Set();
14820
14792
  for (const rt of G) {
14821
- const Mt = ((Ze = Tt(rt.metadata, "source")) == null ? void 0 : Ze.toLowerCase()) ?? null;
14793
+ const Mt = ((Xe = Tt(rt.metadata, "source")) == null ? void 0 : Xe.toLowerCase()) ?? null;
14822
14794
  if (!(Mt === "input" || Mt === "user_input" || Mt === "user")) continue;
14823
14795
  const Zn = oe(rt, "User input");
14824
14796
  Zn && !be.has(Zn.id) && (ae.push(Zn), be.add(Zn.id));
@@ -14837,16 +14809,16 @@ function Ai({
14837
14809
  rt && !be.has(rt.id) && (ae.push(rt), be.add(rt.id));
14838
14810
  }
14839
14811
  return ae;
14840
- }, [_e, ht, gt, Tt]), Dn = et(null), Jn = et(null), Ln = Ce(() => {
14841
- Dn.current && (Dn.current.value = ""), Jn.current && (Jn.current.value = ""), He((G) => G + 1), qe((G) => G + 1);
14812
+ }, [_e, ht, gt, Tt]), Dn = Ze(null), Jn = Ze(null), Ln = Ce(() => {
14813
+ Dn.current && (Dn.current.value = ""), Jn.current && (Jn.current.value = ""), Be((G) => G + 1), Ke((G) => G + 1);
14842
14814
  }, []), ti = Ce(
14843
14815
  (G) => {
14844
14816
  jt(G);
14845
14817
  },
14846
14818
  [jt]
14847
- ), So = et(!1);
14819
+ ), So = Ze(!1);
14848
14820
  Et(() => {
14849
- So.current && !F && (Ne([]), Ln()), So.current = F;
14821
+ So.current && !F && (Ae([]), Ln()), So.current = F;
14850
14822
  }, [F, Ln]);
14851
14823
  const [ni, ri] = ge("desktop");
14852
14824
  Et(() => {
@@ -14856,24 +14828,24 @@ function Ai({
14856
14828
  };
14857
14829
  return G(), window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
14858
14830
  }, []), Et(() => {
14859
- De(!1), Xe.current = !1;
14831
+ Ee(!1), Oe.current = !1;
14860
14832
  }, [D]), Et(() => {
14861
- Oe.current = je;
14862
- }, [je]), Et(() => {
14833
+ Fe.current = et;
14834
+ }, [et]), Et(() => {
14863
14835
  if (!P) {
14864
14836
  Pt.current = null;
14865
14837
  return;
14866
14838
  }
14867
- Pt.current === null && (Pt.current = Oe.current), jt(te ?? "");
14839
+ Pt.current === null && (Pt.current = Fe.current), jt(te ?? "");
14868
14840
  }, [te, P, jt]);
14869
14841
  const R = Ce(async () => {
14870
- if (!(!b || T || !Ye))
14842
+ if (!(!b || T || !Ge))
14871
14843
  try {
14872
14844
  await S();
14873
14845
  } catch (G) {
14874
14846
  console.warn("loadOlder failed", G);
14875
14847
  }
14876
- }, [b, Ye, T, S]);
14848
+ }, [b, Ge, T, S]);
14877
14849
  Et(() => {
14878
14850
  (async () => {
14879
14851
  if (!x.baseUrl) {
@@ -14890,7 +14862,7 @@ function Ai({
14890
14862
  }, [x.baseUrl]), Et(() => {
14891
14863
  j && !ct && (m == null || m(j));
14892
14864
  }, [j, ct, m]);
14893
- const q = (G) => {
14865
+ const K = (G) => {
14894
14866
  if (G.length > Wo)
14895
14867
  return `Message too long (${G.length}/${Wo} characters)`;
14896
14868
  try {
@@ -14902,7 +14874,7 @@ function Ai({
14902
14874
  const oe = G.trim();
14903
14875
  if (!(!oe && ke.length === 0)) {
14904
14876
  if (oe) {
14905
- const ae = q(oe);
14877
+ const ae = K(oe);
14906
14878
  if (ae) {
14907
14879
  de(ae);
14908
14880
  return;
@@ -14925,7 +14897,7 @@ function Ai({
14925
14897
  checkpointId: ae,
14926
14898
  checkpointNs: be
14927
14899
  }
14928
- ), p == null || p(oe), jt(""), de(null), Ne([]), Ln(), H(null), se(""), Le(null);
14900
+ ), p == null || p(oe), jt(""), de(null), Ae([]), Ln(), H(null), se(""), De(null);
14929
14901
  } catch (ae) {
14930
14902
  const be = (ae == null ? void 0 : ae.message) || "Failed to send message";
14931
14903
  de(be), m == null || m(be);
@@ -14933,23 +14905,23 @@ function Ai({
14933
14905
  }
14934
14906
  }, we = z.useCallback(
14935
14907
  (G, oe, ae) => {
14936
- c && (Pt.current = je, H(G), se(oe), jt(oe), de(null), Le({
14908
+ c && (Pt.current = et, H(G), se(oe), jt(oe), de(null), De({
14937
14909
  checkpointId: (ae == null ? void 0 : ae.checkpointId) ?? null,
14938
14910
  checkpointNs: (ae == null ? void 0 : ae.checkpointNs) ?? null
14939
14911
  }));
14940
14912
  },
14941
- [je, c, jt]
14942
- ), Je = z.useCallback(() => {
14943
- H(null), se(""), Le(null), de(null), jt(Pt.current ?? je), Pt.current = null;
14944
- }, [je, jt]), at = Ce(
14913
+ [et, c, jt]
14914
+ ), Ye = z.useCallback(() => {
14915
+ H(null), se(""), De(null), de(null), jt(Pt.current ?? et), Pt.current = null;
14916
+ }, [et, jt]), at = Ce(
14945
14917
  (G, oe, ae) => {
14946
14918
  we(G, oe, ae);
14947
14919
  },
14948
14920
  [we]
14949
- ), Ue = Ce((G) => {
14921
+ ), He = Ce((G) => {
14950
14922
  for (let oe = G - 1; oe >= 0; oe--)
14951
14923
  if (w[oe].role === "user") {
14952
- const ae = w[oe].content || [], dt = ae.filter((Ze) => Ze.type === "text").map((Ze) => Ze.text).join("") || (() => {
14924
+ const ae = w[oe].content || [], dt = ae.filter((Xe) => Xe.type === "text").map((Xe) => Xe.text).join("") || (() => {
14953
14925
  try {
14954
14926
  return JSON.stringify(ae, null, 2);
14955
14927
  } catch {
@@ -14965,18 +14937,18 @@ function Ai({
14965
14937
  );
14966
14938
  break;
14967
14939
  }
14968
- }, [w, A, M, Z]), ze = (G) => {
14940
+ }, [w, A, M, Z]), $e = (G) => {
14969
14941
  const oe = Array.from(G.target.files || []);
14970
- Ne((ae) => [...ae, ...oe]), G.target.value = "";
14942
+ Ae((ae) => [...ae, ...oe]), G.target.value = "";
14971
14943
  }, Ot = (G) => {
14972
- Ne((oe) => {
14944
+ Ae((oe) => {
14973
14945
  const ae = oe.filter((be, dt) => G !== dt);
14974
14946
  return ae.length === 0 && Ln(), ae;
14975
14947
  });
14976
14948
  }, bt = async (G) => {
14977
14949
  const oe = (G.target.files || [])[0];
14978
14950
  if (oe) {
14979
- ot(null), mt(null), tt(!0);
14951
+ ot(null), mt(null), Qe(!0);
14980
14952
  try {
14981
14953
  await A(
14982
14954
  { attachments: [oe] },
@@ -14991,7 +14963,7 @@ function Ai({
14991
14963
  const be = ae instanceof Error ? ae.message : "Failed to upload Excel file";
14992
14964
  console.error("Excel upload failed", ae), ot(be), m == null || m(be);
14993
14965
  } finally {
14994
- tt(!1), G.target.value = "", Ln();
14966
+ Qe(!1), G.target.value = "", Ln();
14995
14967
  }
14996
14968
  }
14997
14969
  }, vt = async (G) => {
@@ -14999,14 +14971,14 @@ function Ai({
14999
14971
  ve(!0);
15000
14972
  try {
15001
14973
  if (!G) {
15002
- await N(), De(!1), requestAnimationFrame(() => {
14974
+ await N(), Ee(!1), requestAnimationFrame(() => {
15003
14975
  var be;
15004
14976
  (be = xe.current) == null || be.scrollToLatest();
15005
14977
  });
15006
14978
  return;
15007
14979
  }
15008
14980
  const oe = _e.find((be) => be.checkpointId === G), ae = (oe == null ? void 0 : oe.checkpointNs) ?? null;
15009
- await k(G, ae), De(!0), requestAnimationFrame(() => {
14981
+ await k(G, ae), Ee(!0), requestAnimationFrame(() => {
15010
14982
  var be;
15011
14983
  (be = xe.current) == null || be.scrollToTop();
15012
14984
  });
@@ -15087,23 +15059,23 @@ function Ai({
15087
15059
  enableMessageEditing: c,
15088
15060
  editingMessageId: P,
15089
15061
  onStartReached: () => {
15090
- Ye && R();
15062
+ Ge && R();
15091
15063
  },
15092
15064
  onScrollAway: (G) => {
15093
- if (!Xe.current) {
15094
- Xe.current = !0;
15065
+ if (!Oe.current) {
15066
+ Oe.current = !0;
15095
15067
  return;
15096
15068
  }
15097
- G && De(!0);
15069
+ G && Ee(!0);
15098
15070
  },
15099
15071
  onEdit: at,
15100
- onRegenerate: Ue,
15101
- onCancelEdit: Je,
15072
+ onRegenerate: He,
15073
+ onCancelEdit: Ye,
15102
15074
  emptyMessage: ce ?? void 0,
15103
- isNavigatingCheckpoint: K,
15075
+ isNavigatingCheckpoint: V,
15104
15076
  activeInterrupt: pe,
15105
15077
  disableInterruptActions: Re,
15106
- onInterruptActionStart: W,
15078
+ onInterruptActionStart: U,
15107
15079
  onInterruptActionEnd: ee,
15108
15080
  showToolMessages: d,
15109
15081
  checkpointMetaById: Vt,
@@ -15122,7 +15094,7 @@ function Ai({
15122
15094
  /* @__PURE__ */ u.jsx(zr, { className: "h-6 w-6 animate-spin" }),
15123
15095
  /* @__PURE__ */ u.jsx("span", { className: "text-xs font-semibold uppercase tracking-wide", children: "Loading messages…" })
15124
15096
  ] }),
15125
- (T || K) && /* @__PURE__ */ u.jsxs("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-background/80 backdrop-blur-sm text-muted-foreground", children: [
15097
+ (T || V) && /* @__PURE__ */ u.jsxs("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-background/80 backdrop-blur-sm text-muted-foreground", children: [
15126
15098
  /* @__PURE__ */ u.jsx(zr, { className: "h-6 w-6 animate-spin" }),
15127
15099
  /* @__PURE__ */ u.jsx("span", { className: "text-xs font-semibold uppercase tracking-wide", children: "Loading checkpoint…" })
15128
15100
  ] })
@@ -15140,7 +15112,7 @@ function Ai({
15140
15112
  {
15141
15113
  variant: "ghost",
15142
15114
  size: "sm",
15143
- onClick: Je,
15115
+ onClick: Ye,
15144
15116
  className: "text-blue-600 hover:bg-blue-100",
15145
15117
  children: /* @__PURE__ */ u.jsx(vr, { size: 16 })
15146
15118
  }
@@ -15154,10 +15126,10 @@ function Ai({
15154
15126
  ref: Dn,
15155
15127
  type: "file",
15156
15128
  multiple: !0,
15157
- onChange: (G) => ze(G),
15129
+ onChange: (G) => $e(G),
15158
15130
  className: "hidden"
15159
15131
  },
15160
- Be
15132
+ ze
15161
15133
  ),
15162
15134
  ke.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap gap-2", children: ke.map((G, oe) => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100", children: [
15163
15135
  /* @__PURE__ */ u.jsx(ji, { size: 14 }),
@@ -15185,14 +15157,14 @@ function Ai({
15185
15157
  onChange: bt,
15186
15158
  className: "hidden"
15187
15159
  },
15188
- We
15160
+ Ue
15189
15161
  ),
15190
- Ge && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15162
+ qe && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15191
15163
  /* @__PURE__ */ u.jsx(zr, { className: "h-4 w-4 animate-spin" }),
15192
15164
  " Uploading Excel file..."
15193
15165
  ] }),
15194
- St && !Ge && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: St }),
15195
- Qe && !Ge && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: Qe })
15166
+ St && !qe && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: St }),
15167
+ Je && !qe && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: Je })
15196
15168
  ] })
15197
15169
  ] }),
15198
15170
  Y && /* @__PURE__ */ u.jsx("div", { className: "mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2", children: Y }),
@@ -15204,7 +15176,7 @@ function Ai({
15204
15176
  type: "button",
15205
15177
  size: "icon",
15206
15178
  variant: "outline",
15207
- disabled: F || U,
15179
+ disabled: F || q,
15208
15180
  title: "More input actions",
15209
15181
  className: f.moreButton || "",
15210
15182
  children: /* @__PURE__ */ u.jsx(vm, { size: 16 })
@@ -15223,9 +15195,9 @@ function Ai({
15223
15195
  {
15224
15196
  onClick: () => {
15225
15197
  var G;
15226
- Ge || (G = Jn.current) == null || G.click();
15198
+ qe || (G = Jn.current) == null || G.click();
15227
15199
  },
15228
- className: `cursor-pointer ${Ge ? "opacity-60 pointer-events-none" : ""}`,
15200
+ className: `cursor-pointer ${qe ? "opacity-60 pointer-events-none" : ""}`,
15229
15201
  children: [
15230
15202
  /* @__PURE__ */ u.jsx(wm, { className: "h-4 w-4 mr-2" }),
15231
15203
  " Upload Excel file"
@@ -15239,14 +15211,14 @@ function Ai({
15239
15211
  {
15240
15212
  initialValue: te,
15241
15213
  editingMessageId: P,
15242
- value: je,
15214
+ value: et,
15243
15215
  onValueChange: ti,
15244
15216
  placeholder: P ? "Edit your message..." : t,
15245
15217
  isStreaming: F,
15246
- disabled: U,
15218
+ disabled: q,
15247
15219
  maxLength: Wo,
15248
15220
  onSend: ie,
15249
- onCancelEdit: Je,
15221
+ onCancelEdit: Ye,
15250
15222
  onStop: B,
15251
15223
  allowEmptySend: ke.length > 0,
15252
15224
  textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${P ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${Y ? "border-red-400" : ""} ${f.textarea || ""}`
@@ -15285,7 +15257,7 @@ var rl = "ScrollArea", [Dp, vk] = Mn(rl), [PC, un] = Dp(rl), Lp = v.forwardRef(
15285
15257
  dir: o,
15286
15258
  scrollHideDelay: s = 600,
15287
15259
  ...i
15288
- } = e, [a, l] = v.useState(null), [c, d] = v.useState(null), [f, p] = v.useState(null), [h, m] = v.useState(null), [x, y] = v.useState(null), [g, w] = v.useState(0), [b, T] = v.useState(0), [C, S] = v.useState(!1), [k, N] = v.useState(!1), E = Ke(t, (O) => l(O)), I = Rs(o);
15260
+ } = e, [a, l] = v.useState(null), [c, d] = v.useState(null), [f, p] = v.useState(null), [h, m] = v.useState(null), [x, y] = v.useState(null), [g, w] = v.useState(0), [b, T] = v.useState(0), [C, S] = v.useState(!1), [k, N] = v.useState(!1), E = Ve(t, (O) => l(O)), I = Rs(o);
15289
15261
  return /* @__PURE__ */ u.jsx(
15290
15262
  PC,
15291
15263
  {
@@ -15309,7 +15281,7 @@ var rl = "ScrollArea", [Dp, vk] = Mn(rl), [PC, un] = Dp(rl), Lp = v.forwardRef(
15309
15281
  onCornerWidthChange: w,
15310
15282
  onCornerHeightChange: T,
15311
15283
  children: /* @__PURE__ */ u.jsx(
15312
- Ae.div,
15284
+ je.div,
15313
15285
  {
15314
15286
  dir: I,
15315
15287
  ...i,
@@ -15330,7 +15302,7 @@ var rl = "ScrollArea", [Dp, vk] = Mn(rl), [PC, un] = Dp(rl), Lp = v.forwardRef(
15330
15302
  Lp.displayName = rl;
15331
15303
  var Fp = "ScrollAreaViewport", $p = v.forwardRef(
15332
15304
  (e, t) => {
15333
- const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, i = un(Fp, n), a = v.useRef(null), l = Ke(t, a, i.onViewportChange);
15305
+ const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, i = un(Fp, n), a = v.useRef(null), l = Ve(t, a, i.onViewportChange);
15334
15306
  return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
15335
15307
  /* @__PURE__ */ u.jsx(
15336
15308
  "style",
@@ -15342,7 +15314,7 @@ var Fp = "ScrollAreaViewport", $p = v.forwardRef(
15342
15314
  }
15343
15315
  ),
15344
15316
  /* @__PURE__ */ u.jsx(
15345
- Ae.div,
15317
+ je.div,
15346
15318
  {
15347
15319
  "data-radix-scroll-area-viewport": "",
15348
15320
  ...s,
@@ -15516,7 +15488,7 @@ var OC = v.forwardRef((e, t) => {
15516
15488
  }
15517
15489
  ) : null;
15518
15490
  }), DC = v.forwardRef((e, t) => {
15519
- const { sizes: n, onSizesChange: r, ...o } = e, s = un(In, e.__scopeScrollArea), [i, a] = v.useState(), l = v.useRef(null), c = Ke(t, l, s.onScrollbarXChange);
15491
+ const { sizes: n, onSizesChange: r, ...o } = e, s = un(In, e.__scopeScrollArea), [i, a] = v.useState(), l = v.useRef(null), c = Ve(t, l, s.onScrollbarXChange);
15520
15492
  return v.useEffect(() => {
15521
15493
  l.current && a(getComputedStyle(l.current));
15522
15494
  }, [l]), /* @__PURE__ */ u.jsx(
@@ -15555,7 +15527,7 @@ var OC = v.forwardRef((e, t) => {
15555
15527
  }
15556
15528
  );
15557
15529
  }), LC = v.forwardRef((e, t) => {
15558
- const { sizes: n, onSizesChange: r, ...o } = e, s = un(In, e.__scopeScrollArea), [i, a] = v.useState(), l = v.useRef(null), c = Ke(t, l, s.onScrollbarYChange);
15530
+ const { sizes: n, onSizesChange: r, ...o } = e, s = un(In, e.__scopeScrollArea), [i, a] = v.useState(), l = v.useRef(null), c = Ve(t, l, s.onScrollbarYChange);
15559
15531
  return v.useEffect(() => {
15560
15532
  l.current && a(getComputedStyle(l.current));
15561
15533
  }, [l]), /* @__PURE__ */ u.jsx(
@@ -15607,7 +15579,7 @@ var OC = v.forwardRef((e, t) => {
15607
15579
  onWheelScroll: d,
15608
15580
  onResize: f,
15609
15581
  ...p
15610
- } = e, h = un(In, n), [m, x] = v.useState(null), y = Ke(t, (E) => x(E)), g = v.useRef(null), w = v.useRef(""), b = h.viewport, T = r.content - r.viewport, C = Dt(d), S = Dt(l), k = Xs(f, 10);
15582
+ } = e, h = un(In, n), [m, x] = v.useState(null), y = Ve(t, (E) => x(E)), g = v.useRef(null), w = v.useRef(""), b = h.viewport, T = r.content - r.viewport, C = Dt(d), S = Dt(l), k = Xs(f, 10);
15611
15583
  function N(E) {
15612
15584
  if (g.current) {
15613
15585
  const I = E.clientX - g.current.left, O = E.clientY - g.current.top;
@@ -15631,7 +15603,7 @@ var OC = v.forwardRef((e, t) => {
15631
15603
  onThumbPositionChange: S,
15632
15604
  onThumbPointerDown: Dt(a),
15633
15605
  children: /* @__PURE__ */ u.jsx(
15634
- Ae.div,
15606
+ je.div,
15635
15607
  {
15636
15608
  ...p,
15637
15609
  ref: y,
@@ -15655,7 +15627,7 @@ var OC = v.forwardRef((e, t) => {
15655
15627
  }
15656
15628
  ), $C = v.forwardRef(
15657
15629
  (e, t) => {
15658
- const { __scopeScrollArea: n, style: r, ...o } = e, s = un(hs, n), i = Bp(hs, n), { onThumbPositionChange: a } = i, l = Ke(
15630
+ const { __scopeScrollArea: n, style: r, ...o } = e, s = un(hs, n), i = Bp(hs, n), { onThumbPositionChange: a } = i, l = Ve(
15659
15631
  t,
15660
15632
  (f) => i.onThumbChange(f)
15661
15633
  ), c = v.useRef(void 0), d = Xs(() => {
@@ -15673,7 +15645,7 @@ var OC = v.forwardRef((e, t) => {
15673
15645
  return a(), f.addEventListener("scroll", p), () => f.removeEventListener("scroll", p);
15674
15646
  }
15675
15647
  }, [s.viewport, d, a]), /* @__PURE__ */ u.jsx(
15676
- Ae.div,
15648
+ je.div,
15677
15649
  {
15678
15650
  "data-state": i.hasThumb ? "visible" : "hidden",
15679
15651
  ...o,
@@ -15711,7 +15683,7 @@ var zC = v.forwardRef((e, t) => {
15711
15683
  const d = ((f = o.scrollbarY) == null ? void 0 : f.offsetWidth) || 0;
15712
15684
  o.onCornerWidthChange(d), i(d);
15713
15685
  }), c ? /* @__PURE__ */ u.jsx(
15714
- Ae.div,
15686
+ je.div,
15715
15687
  {
15716
15688
  ...r,
15717
15689
  ref: t,
@@ -15835,80 +15807,80 @@ function Kc({
15835
15807
  setCurrentThreadId: h,
15836
15808
  isLoading: m,
15837
15809
  actions: x
15838
- } = xa(), { loadThread: y } = ya(), { createThread: g, deleteThread: w, renameThread: b } = x, [T, C] = ge(Array.isArray(f) ? f : []), S = et(T.length > 0), k = et(null), N = et(0), [E, I] = ge(null), [O, L] = ge(""), [F, j] = ge(!1);
15810
+ } = xa(), { loadThread: y } = ya(), { createThread: g, deleteThread: w, renameThread: b } = x, [T, C] = ge(Array.isArray(f) ? f : []), S = Ze(T.length > 0), k = Ze(null), N = Ze(0), [E, I] = ge(null), [O, L] = ge(""), [F, j] = ge(!1);
15839
15811
  Et(() => {
15840
- const W = Array.isArray(f) ? f : [];
15841
- if (W.length > 0) {
15842
- S.current = !0, C(W);
15812
+ const U = Array.isArray(f) ? f : [];
15813
+ if (U.length > 0) {
15814
+ S.current = !0, C(U);
15843
15815
  return;
15844
15816
  }
15845
- m || (S.current = !1, C(W));
15817
+ m || (S.current = !1, C(U));
15846
15818
  }, [f, m]), Et(() => {
15847
15819
  if (!k.current) return;
15848
- const W = k.current.querySelector(
15820
+ const U = k.current.querySelector(
15849
15821
  "[data-radix-scroll-area-viewport]"
15850
15822
  );
15851
- if (!W) return;
15852
- let ee = null, U = null;
15823
+ if (!U) return;
15824
+ let ee = null, q = null;
15853
15825
  return ee = requestAnimationFrame(() => {
15854
- U = requestAnimationFrame(() => {
15855
- W.scrollTop = N.current;
15826
+ q = requestAnimationFrame(() => {
15827
+ U.scrollTop = N.current;
15856
15828
  });
15857
15829
  }), () => {
15858
- ee !== null && cancelAnimationFrame(ee), U !== null && cancelAnimationFrame(U);
15830
+ ee !== null && cancelAnimationFrame(ee), q !== null && cancelAnimationFrame(q);
15859
15831
  };
15860
15832
  }, [T]);
15861
- const $ = async (W) => {
15833
+ const $ = async (U) => {
15862
15834
  try {
15863
- h(W), await y(W), a == null || a(W), l == null || l(W);
15835
+ h(U), await y(U), a == null || a(U), l == null || l(U);
15864
15836
  } catch (ee) {
15865
15837
  console.error("Failed to select thread:", ee);
15866
15838
  }
15867
15839
  }, A = async () => {
15868
15840
  try {
15869
15841
  j(!0);
15870
- const W = await g();
15871
- W && (c == null || c(W), a == null || a(W));
15872
- } catch (W) {
15873
- console.error("Failed to create thread:", W);
15842
+ const U = await g();
15843
+ U && (c == null || c(U), a == null || a(U));
15844
+ } catch (U) {
15845
+ console.error("Failed to create thread:", U);
15874
15846
  } finally {
15875
15847
  j(!1);
15876
15848
  }
15877
- }, B = async (W, ee) => {
15849
+ }, B = async (U, ee) => {
15878
15850
  if (ee.stopPropagation(), !!confirm("Delete this thread?")) {
15879
15851
  if (k.current) {
15880
- const U = k.current.querySelector("[data-radix-scroll-area-viewport]");
15881
- U && (N.current = U.scrollTop);
15852
+ const q = k.current.querySelector("[data-radix-scroll-area-viewport]");
15853
+ q && (N.current = q.scrollTop);
15882
15854
  }
15883
15855
  try {
15884
- await w(W), d == null || d(W);
15885
- } catch (U) {
15886
- console.error("Failed to delete thread:", U);
15856
+ await w(U), d == null || d(U);
15857
+ } catch (q) {
15858
+ console.error("Failed to delete thread:", q);
15887
15859
  }
15888
15860
  }
15889
- }, D = (W, ee) => {
15890
- ee.stopPropagation(), I(W.threadId), L(W.title || `Thread ${W.threadId.slice(0, 8)}`);
15891
- }, M = async (W) => {
15861
+ }, D = (U, ee) => {
15862
+ ee.stopPropagation(), I(U.threadId), L(U.title || `Thread ${U.threadId.slice(0, 8)}`);
15863
+ }, M = async (U) => {
15892
15864
  if (O.trim())
15893
15865
  try {
15894
- await b(W, O.trim()), I(null), L("");
15866
+ await b(U, O.trim()), I(null), L("");
15895
15867
  } catch (ee) {
15896
15868
  console.error("Failed to update title:", ee);
15897
15869
  }
15898
15870
  }, Z = () => {
15899
15871
  I(null), L("");
15900
- }, J = (W, ee) => {
15901
- W.key === "Enter" ? M(ee) : W.key === "Escape" && Z();
15902
- }, pe = (W) => {
15903
- if (!W) return "";
15872
+ }, J = (U, ee) => {
15873
+ U.key === "Enter" ? M(ee) : U.key === "Escape" && Z();
15874
+ }, pe = (U) => {
15875
+ if (!U) return "";
15904
15876
  try {
15905
- const ee = new Date(W), P = (/* @__PURE__ */ new Date()).getTime() - ee.getTime(), H = Math.floor(P / (1e3 * 60 * 60 * 24));
15877
+ const ee = new Date(U), P = (/* @__PURE__ */ new Date()).getTime() - ee.getTime(), H = Math.floor(P / (1e3 * 60 * 60 * 24));
15906
15878
  return H === 0 ? ee.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : H === 1 ? "Yesterday" : H < 7 ? `${H} days ago` : ee.toLocaleDateString();
15907
15879
  } catch {
15908
15880
  return "";
15909
15881
  }
15910
- }, Re = (W) => W.title || `Thread ${W.threadId.slice(0, 8)}`, Ee = (W) => {
15911
- const ee = Re(W);
15882
+ }, Re = (U) => U.title || `Thread ${U.threadId.slice(0, 8)}`, Ie = (U) => {
15883
+ const ee = Re(U);
15912
15884
  return ee.length <= Vc ? ee : `${ee.slice(0, Vc)}...`;
15913
15885
  };
15914
15886
  return /* @__PURE__ */ u.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
@@ -15936,32 +15908,32 @@ function Kc({
15936
15908
  ] }) : T.length === 0 ? /* @__PURE__ */ u.jsxs("div", { className: "text-center py-8 text-slate-400", children: [
15937
15909
  /* @__PURE__ */ u.jsx(Sm, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
15938
15910
  /* @__PURE__ */ u.jsx("p", { className: "text-sm text-slate-500", children: "No conversations yet" })
15939
- ] }) : T.slice().sort((W, ee) => new Date(ee.updatedAt || ee.createdAt || "").getTime() - new Date(W.updatedAt || W.createdAt || "").getTime()).map((W) => /* @__PURE__ */ u.jsxs(
15911
+ ] }) : T.slice().sort((U, ee) => new Date(ee.updatedAt || ee.createdAt || "").getTime() - new Date(U.updatedAt || U.createdAt || "").getTime()).map((U) => /* @__PURE__ */ u.jsxs(
15940
15912
  "div",
15941
15913
  {
15942
- onClick: () => $(W.threadId),
15943
- className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? p) === W.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
15914
+ onClick: () => $(U.threadId),
15915
+ className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? p) === U.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
15944
15916
  children: [
15945
15917
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
15946
- /* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: E === W.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (ee) => ee.stopPropagation(), children: [
15947
- /* @__PURE__ */ u.jsx(ps, { value: O, onChange: (ee) => L(ee.target.value), onKeyDown: (ee) => J(ee, W.threadId), className: "h-6 text-sm", autoFocus: !0 }),
15948
- /* @__PURE__ */ u.jsx(st, { variant: "ghost", size: "sm", onClick: () => M(W.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(ca, { size: 12 }) }),
15918
+ /* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: E === U.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (ee) => ee.stopPropagation(), children: [
15919
+ /* @__PURE__ */ u.jsx(ps, { value: O, onChange: (ee) => L(ee.target.value), onKeyDown: (ee) => J(ee, U.threadId), className: "h-6 text-sm", autoFocus: !0 }),
15920
+ /* @__PURE__ */ u.jsx(st, { variant: "ghost", size: "sm", onClick: () => M(U.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(ca, { size: 12 }) }),
15949
15921
  /* @__PURE__ */ u.jsx(st, { variant: "ghost", size: "sm", onClick: Z, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(vr, { size: 12 }) })
15950
15922
  ] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
15951
- /* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: Ee(W) }),
15923
+ /* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: Ie(U) }),
15952
15924
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
15953
15925
  /* @__PURE__ */ u.jsx(Cm, { size: 10 }),
15954
- /* @__PURE__ */ u.jsx("span", { children: pe(W.updatedAt || W.createdAt) })
15926
+ /* @__PURE__ */ u.jsx("span", { children: pe(U.updatedAt || U.createdAt) })
15955
15927
  ] })
15956
15928
  ] }) }),
15957
15929
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
15958
- r && E !== W.threadId && /* @__PURE__ */ u.jsx(st, { variant: "ghost", size: "sm", onClick: (ee) => D(W, ee), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ u.jsx(Jc, { size: 12 }) }),
15930
+ r && E !== U.threadId && /* @__PURE__ */ u.jsx(st, { variant: "ghost", size: "sm", onClick: (ee) => D(U, ee), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ u.jsx(Jc, { size: 12 }) }),
15959
15931
  n && /* @__PURE__ */ u.jsx(
15960
15932
  st,
15961
15933
  {
15962
15934
  variant: "ghost",
15963
15935
  size: "sm",
15964
- onClick: (ee) => B(W.threadId, ee),
15936
+ onClick: (ee) => B(U.threadId, ee),
15965
15937
  className: "h-6 w-6 p-0 text-red-400 hover:text-red-300 hover:bg-red-900/20",
15966
15938
  title: "Delete thread",
15967
15939
  children: /* @__PURE__ */ u.jsx(Tm, { size: 12 })
@@ -15969,10 +15941,10 @@ function Kc({
15969
15941
  )
15970
15942
  ] })
15971
15943
  ] }),
15972
- i === W.threadId && /* @__PURE__ */ u.jsx("div", { className: "absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-blue-400 rounded-r" })
15944
+ i === U.threadId && /* @__PURE__ */ u.jsx("div", { className: "absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-blue-400 rounded-r" })
15973
15945
  ]
15974
15946
  },
15975
- W.threadId
15947
+ U.threadId
15976
15948
  )) })
15977
15949
  }
15978
15950
  )
@@ -16081,7 +16053,7 @@ function bk(e) {
16081
16053
  }), YC(e);
16082
16054
  }
16083
16055
  var XC = "Label", th = v.forwardRef((e, t) => /* @__PURE__ */ u.jsx(
16084
- Ae.label,
16056
+ je.label,
16085
16057
  {
16086
16058
  ...e,
16087
16059
  ref: t,
@@ -16121,7 +16093,7 @@ var Js = "Switch", [ZC, Sk] = Mn(Js), [QC, eT] = ZC(Js), oh = v.forwardRef(
16121
16093
  onCheckedChange: c,
16122
16094
  form: d,
16123
16095
  ...f
16124
- } = e, [p, h] = v.useState(null), m = Ke(t, (b) => h(b)), x = v.useRef(!1), y = p ? d || !!p.closest("form") : !0, [g, w] = Rr({
16096
+ } = e, [p, h] = v.useState(null), m = Ve(t, (b) => h(b)), x = v.useRef(!1), y = p ? d || !!p.closest("form") : !0, [g, w] = Rr({
16125
16097
  prop: o,
16126
16098
  defaultProp: s ?? !1,
16127
16099
  onChange: c,
@@ -16129,7 +16101,7 @@ var Js = "Switch", [ZC, Sk] = Mn(Js), [QC, eT] = ZC(Js), oh = v.forwardRef(
16129
16101
  });
16130
16102
  return /* @__PURE__ */ u.jsxs(QC, { scope: n, checked: g, disabled: a, children: [
16131
16103
  /* @__PURE__ */ u.jsx(
16132
- Ae.button,
16104
+ je.button,
16133
16105
  {
16134
16106
  type: "button",
16135
16107
  role: "switch",
@@ -16168,7 +16140,7 @@ var sh = "SwitchThumb", ih = v.forwardRef(
16168
16140
  (e, t) => {
16169
16141
  const { __scopeSwitch: n, ...r } = e, o = eT(sh, n);
16170
16142
  return /* @__PURE__ */ u.jsx(
16171
- Ae.span,
16143
+ je.span,
16172
16144
  {
16173
16145
  "data-state": lh(o.checked),
16174
16146
  "data-disabled": o.disabled ? "" : void 0,
@@ -16187,7 +16159,7 @@ var tT = "SwitchBubbleInput", ah = v.forwardRef(
16187
16159
  bubbles: r = !0,
16188
16160
  ...o
16189
16161
  }, s) => {
16190
- const i = v.useRef(null), a = Ke(i, s), l = rh(n), c = Xu(t);
16162
+ const i = v.useRef(null), a = Ve(i, s), l = rh(n), c = Xu(t);
16191
16163
  return v.useEffect(() => {
16192
16164
  const d = i.current;
16193
16165
  if (!d) return;
@@ -16259,7 +16231,7 @@ var uh = Object.freeze({
16259
16231
  wordWrap: "normal"
16260
16232
  }), rT = "VisuallyHidden", oT = v.forwardRef(
16261
16233
  (e, t) => /* @__PURE__ */ u.jsx(
16262
- Ae.span,
16234
+ je.span,
16263
16235
  {
16264
16236
  ...e,
16265
16237
  ref: t,
@@ -16360,7 +16332,7 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], cr = "Sele
16360
16332
  dh.displayName = cr;
16361
16333
  var fh = "SelectTrigger", ph = v.forwardRef(
16362
16334
  (e, t) => {
16363
- const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = ei(n), i = Yn(fh, n), a = i.disabled || r, l = Ke(t, i.onTriggerChange), c = Qs(n), d = v.useRef("touch"), [f, p, h] = Lh((x) => {
16335
+ const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = ei(n), i = Yn(fh, n), a = i.disabled || r, l = Ve(t, i.onTriggerChange), c = Qs(n), d = v.useRef("touch"), [f, p, h] = Lh((x) => {
16364
16336
  const y = c().filter((b) => !b.disabled), g = y.find((b) => b.value === i.value), w = Fh(y, x, g);
16365
16337
  w !== void 0 && i.onValueChange(w.value);
16366
16338
  }), m = (x) => {
@@ -16370,7 +16342,7 @@ var fh = "SelectTrigger", ph = v.forwardRef(
16370
16342
  });
16371
16343
  };
16372
16344
  return /* @__PURE__ */ u.jsx(ad, { asChild: !0, ...s, children: /* @__PURE__ */ u.jsx(
16373
- Ae.button,
16345
+ je.button,
16374
16346
  {
16375
16347
  type: "button",
16376
16348
  role: "combobox",
@@ -16404,11 +16376,11 @@ var fh = "SelectTrigger", ph = v.forwardRef(
16404
16376
  ph.displayName = fh;
16405
16377
  var hh = "SelectValue", mh = v.forwardRef(
16406
16378
  (e, t) => {
16407
- const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, l = Yn(hh, n), { onValueNodeHasChildrenChange: c } = l, d = s !== void 0, f = Ke(t, l.onValueNodeChange);
16379
+ const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, l = Yn(hh, n), { onValueNodeHasChildrenChange: c } = l, d = s !== void 0, f = Ve(t, l.onValueNodeChange);
16408
16380
  return Lt(() => {
16409
16381
  c(d);
16410
16382
  }, [c, d]), /* @__PURE__ */ u.jsx(
16411
- Ae.span,
16383
+ je.span,
16412
16384
  {
16413
16385
  ...a,
16414
16386
  ref: f,
@@ -16422,7 +16394,7 @@ mh.displayName = hh;
16422
16394
  var dT = "SelectIcon", gh = v.forwardRef(
16423
16395
  (e, t) => {
16424
16396
  const { __scopeSelect: n, children: r, ...o } = e;
16425
- return /* @__PURE__ */ u.jsx(Ae.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
16397
+ return /* @__PURE__ */ u.jsx(je.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
16426
16398
  }
16427
16399
  );
16428
16400
  gh.displayName = dT;
@@ -16466,16 +16438,16 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16466
16438
  avoidCollisions: y,
16467
16439
  //
16468
16440
  ...g
16469
- } = e, w = Yn(ur, n), [b, T] = v.useState(null), [C, S] = v.useState(null), k = Ke(t, (U) => T(U)), [N, E] = v.useState(null), [I, O] = v.useState(
16441
+ } = e, w = Yn(ur, n), [b, T] = v.useState(null), [C, S] = v.useState(null), k = Ve(t, (q) => T(q)), [N, E] = v.useState(null), [I, O] = v.useState(
16470
16442
  null
16471
16443
  ), L = Qs(n), [F, j] = v.useState(!1), $ = v.useRef(!1);
16472
16444
  v.useEffect(() => {
16473
16445
  if (b) return Aa(b);
16474
16446
  }, [b]), ba();
16475
16447
  const A = v.useCallback(
16476
- (U) => {
16448
+ (q) => {
16477
16449
  const [P, ...H] = L().map((ne) => ne.ref.current), [te] = H.slice(-1), se = document.activeElement;
16478
- for (const ne of U)
16450
+ for (const ne of q)
16479
16451
  if (ne === se || (ne == null || ne.scrollIntoView({ block: "nearest" }), ne === P && C && (C.scrollTop = 0), ne === te && C && (C.scrollTop = C.scrollHeight), ne == null || ne.focus(), document.activeElement !== se)) return;
16480
16452
  },
16481
16453
  [L, C]
@@ -16489,42 +16461,42 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16489
16461
  const { onOpenChange: D, triggerPointerDownPosRef: M } = w;
16490
16462
  v.useEffect(() => {
16491
16463
  if (b) {
16492
- let U = { x: 0, y: 0 };
16464
+ let q = { x: 0, y: 0 };
16493
16465
  const P = (te) => {
16494
16466
  var se, ne;
16495
- U = {
16467
+ q = {
16496
16468
  x: Math.abs(Math.round(te.pageX) - (((se = M.current) == null ? void 0 : se.x) ?? 0)),
16497
16469
  y: Math.abs(Math.round(te.pageY) - (((ne = M.current) == null ? void 0 : ne.y) ?? 0))
16498
16470
  };
16499
16471
  }, H = (te) => {
16500
- U.x <= 10 && U.y <= 10 ? te.preventDefault() : b.contains(te.target) || D(!1), document.removeEventListener("pointermove", P), M.current = null;
16472
+ q.x <= 10 && q.y <= 10 ? te.preventDefault() : b.contains(te.target) || D(!1), document.removeEventListener("pointermove", P), M.current = null;
16501
16473
  };
16502
16474
  return M.current !== null && (document.addEventListener("pointermove", P), document.addEventListener("pointerup", H, { capture: !0, once: !0 })), () => {
16503
16475
  document.removeEventListener("pointermove", P), document.removeEventListener("pointerup", H, { capture: !0 });
16504
16476
  };
16505
16477
  }
16506
16478
  }, [b, D, M]), v.useEffect(() => {
16507
- const U = () => D(!1);
16508
- return window.addEventListener("blur", U), window.addEventListener("resize", U), () => {
16509
- window.removeEventListener("blur", U), window.removeEventListener("resize", U);
16479
+ const q = () => D(!1);
16480
+ return window.addEventListener("blur", q), window.addEventListener("resize", q), () => {
16481
+ window.removeEventListener("blur", q), window.removeEventListener("resize", q);
16510
16482
  };
16511
16483
  }, [D]);
16512
- const [Z, J] = Lh((U) => {
16513
- const P = L().filter((se) => !se.disabled), H = P.find((se) => se.ref.current === document.activeElement), te = Fh(P, U, H);
16484
+ const [Z, J] = Lh((q) => {
16485
+ const P = L().filter((se) => !se.disabled), H = P.find((se) => se.ref.current === document.activeElement), te = Fh(P, q, H);
16514
16486
  te && setTimeout(() => te.ref.current.focus());
16515
16487
  }), pe = v.useCallback(
16516
- (U, P, H) => {
16488
+ (q, P, H) => {
16517
16489
  const te = !$.current && !H;
16518
- (w.value !== void 0 && w.value === P || te) && (E(U), te && ($.current = !0));
16490
+ (w.value !== void 0 && w.value === P || te) && (E(q), te && ($.current = !0));
16519
16491
  },
16520
16492
  [w.value]
16521
- ), Re = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Ee = v.useCallback(
16522
- (U, P, H) => {
16493
+ ), Re = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Ie = v.useCallback(
16494
+ (q, P, H) => {
16523
16495
  const te = !$.current && !H;
16524
- (w.value !== void 0 && w.value === P || te) && O(U);
16496
+ (w.value !== void 0 && w.value === P || te) && O(q);
16525
16497
  },
16526
16498
  [w.value]
16527
- ), W = r === "popper" ? na : bh, ee = W === na ? {
16499
+ ), U = r === "popper" ? na : bh, ee = U === na ? {
16528
16500
  side: a,
16529
16501
  sideOffset: l,
16530
16502
  align: c,
@@ -16546,7 +16518,7 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16546
16518
  itemRefCallback: pe,
16547
16519
  selectedItem: N,
16548
16520
  onItemLeave: Re,
16549
- itemTextRefCallback: Ee,
16521
+ itemTextRefCallback: Ie,
16550
16522
  focusSelectedItem: B,
16551
16523
  selectedItemText: I,
16552
16524
  position: r,
@@ -16557,12 +16529,12 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16557
16529
  {
16558
16530
  asChild: !0,
16559
16531
  trapped: w.open,
16560
- onMountAutoFocus: (U) => {
16561
- U.preventDefault();
16532
+ onMountAutoFocus: (q) => {
16533
+ q.preventDefault();
16562
16534
  },
16563
- onUnmountAutoFocus: fe(o, (U) => {
16535
+ onUnmountAutoFocus: fe(o, (q) => {
16564
16536
  var P;
16565
- (P = w.trigger) == null || P.focus({ preventScroll: !0 }), U.preventDefault();
16537
+ (P = w.trigger) == null || P.focus({ preventScroll: !0 }), q.preventDefault();
16566
16538
  }),
16567
16539
  children: /* @__PURE__ */ u.jsx(
16568
16540
  Es,
@@ -16571,16 +16543,16 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16571
16543
  disableOutsidePointerEvents: !0,
16572
16544
  onEscapeKeyDown: s,
16573
16545
  onPointerDownOutside: i,
16574
- onFocusOutside: (U) => U.preventDefault(),
16546
+ onFocusOutside: (q) => q.preventDefault(),
16575
16547
  onDismiss: () => w.onOpenChange(!1),
16576
16548
  children: /* @__PURE__ */ u.jsx(
16577
- W,
16549
+ U,
16578
16550
  {
16579
16551
  role: "listbox",
16580
16552
  id: w.contentId,
16581
16553
  "data-state": w.open ? "open" : "closed",
16582
16554
  dir: w.dir,
16583
- onContextMenu: (U) => U.preventDefault(),
16555
+ onContextMenu: (q) => q.preventDefault(),
16584
16556
  ...g,
16585
16557
  ...ee,
16586
16558
  onPlaced: () => j(!0),
@@ -16593,15 +16565,15 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16593
16565
  outline: "none",
16594
16566
  ...g.style
16595
16567
  },
16596
- onKeyDown: fe(g.onKeyDown, (U) => {
16597
- const P = U.ctrlKey || U.altKey || U.metaKey;
16598
- if (U.key === "Tab" && U.preventDefault(), !P && U.key.length === 1 && J(U.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(U.key)) {
16568
+ onKeyDown: fe(g.onKeyDown, (q) => {
16569
+ const P = q.ctrlKey || q.altKey || q.metaKey;
16570
+ if (q.key === "Tab" && q.preventDefault(), !P && q.key.length === 1 && J(q.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(q.key)) {
16599
16571
  let te = L().filter((se) => !se.disabled).map((se) => se.ref.current);
16600
- if (["ArrowUp", "End"].includes(U.key) && (te = te.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(U.key)) {
16601
- const se = U.target, ne = te.indexOf(se);
16572
+ if (["ArrowUp", "End"].includes(q.key) && (te = te.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(q.key)) {
16573
+ const se = q.target, ne = te.indexOf(se);
16602
16574
  te = te.slice(ne + 1);
16603
16575
  }
16604
- setTimeout(() => A(te)), U.preventDefault();
16576
+ setTimeout(() => A(te)), q.preventDefault();
16605
16577
  }
16606
16578
  })
16607
16579
  }
@@ -16616,11 +16588,11 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16616
16588
  );
16617
16589
  wh.displayName = pT;
16618
16590
  var mT = "SelectItemAlignedPosition", bh = v.forwardRef((e, t) => {
16619
- const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Yn(ur, n), i = Xn(ur, n), [a, l] = v.useState(null), [c, d] = v.useState(null), f = Ke(t, (k) => d(k)), p = Qs(n), h = v.useRef(!1), m = v.useRef(!0), { viewport: x, selectedItem: y, selectedItemText: g, focusSelectedItem: w } = i, b = v.useCallback(() => {
16591
+ const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Yn(ur, n), i = Xn(ur, n), [a, l] = v.useState(null), [c, d] = v.useState(null), f = Ve(t, (k) => d(k)), p = Qs(n), h = v.useRef(!1), m = v.useRef(!0), { viewport: x, selectedItem: y, selectedItemText: g, focusSelectedItem: w } = i, b = v.useCallback(() => {
16620
16592
  if (s.trigger && s.valueNode && a && c && x && y && g) {
16621
16593
  const k = s.trigger.getBoundingClientRect(), N = c.getBoundingClientRect(), E = s.valueNode.getBoundingClientRect(), I = g.getBoundingClientRect();
16622
16594
  if (s.dir !== "rtl") {
16623
- const se = I.left - N.left, ne = E.left - se, Le = k.left - ne, Y = k.width + Le, de = Math.max(Y, N.width), ke = window.innerWidth - dn, Ne = ta(ne, [
16595
+ const se = I.left - N.left, ne = E.left - se, De = k.left - ne, Y = k.width + De, de = Math.max(Y, N.width), ke = window.innerWidth - dn, Ae = ta(ne, [
16624
16596
  dn,
16625
16597
  // Prevents the content from going off the starting edge of the
16626
16598
  // viewport. It may still go off the ending edge, but this can be
@@ -16629,33 +16601,33 @@ var mT = "SelectItemAlignedPosition", bh = v.forwardRef((e, t) => {
16629
16601
  // https://github.com/radix-ui/primitives/issues/2049
16630
16602
  Math.max(dn, ke - de)
16631
16603
  ]);
16632
- a.style.minWidth = Y + "px", a.style.left = Ne + "px";
16604
+ a.style.minWidth = Y + "px", a.style.left = Ae + "px";
16633
16605
  } else {
16634
- const se = N.right - I.right, ne = window.innerWidth - E.right - se, Le = window.innerWidth - k.right - ne, Y = k.width + Le, de = Math.max(Y, N.width), ke = window.innerWidth - dn, Ne = ta(ne, [
16606
+ const se = N.right - I.right, ne = window.innerWidth - E.right - se, De = window.innerWidth - k.right - ne, Y = k.width + De, de = Math.max(Y, N.width), ke = window.innerWidth - dn, Ae = ta(ne, [
16635
16607
  dn,
16636
16608
  Math.max(dn, ke - de)
16637
16609
  ]);
16638
- a.style.minWidth = Y + "px", a.style.right = Ne + "px";
16610
+ a.style.minWidth = Y + "px", a.style.right = Ae + "px";
16639
16611
  }
16640
- const O = p(), L = window.innerHeight - dn * 2, F = x.scrollHeight, j = window.getComputedStyle(c), $ = parseInt(j.borderTopWidth, 10), A = parseInt(j.paddingTop, 10), B = parseInt(j.borderBottomWidth, 10), D = parseInt(j.paddingBottom, 10), M = $ + A + F + D + B, Z = Math.min(y.offsetHeight * 5, M), J = window.getComputedStyle(x), pe = parseInt(J.paddingTop, 10), Re = parseInt(J.paddingBottom, 10), Ee = k.top + k.height / 2 - dn, W = L - Ee, ee = y.offsetHeight / 2, U = y.offsetTop + ee, P = $ + A + U, H = M - P;
16641
- if (P <= Ee) {
16612
+ const O = p(), L = window.innerHeight - dn * 2, F = x.scrollHeight, j = window.getComputedStyle(c), $ = parseInt(j.borderTopWidth, 10), A = parseInt(j.paddingTop, 10), B = parseInt(j.borderBottomWidth, 10), D = parseInt(j.paddingBottom, 10), M = $ + A + F + D + B, Z = Math.min(y.offsetHeight * 5, M), J = window.getComputedStyle(x), pe = parseInt(J.paddingTop, 10), Re = parseInt(J.paddingBottom, 10), Ie = k.top + k.height / 2 - dn, U = L - Ie, ee = y.offsetHeight / 2, q = y.offsetTop + ee, P = $ + A + q, H = M - P;
16613
+ if (P <= Ie) {
16642
16614
  const se = O.length > 0 && y === O[O.length - 1].ref.current;
16643
16615
  a.style.bottom = "0px";
16644
- const ne = c.clientHeight - x.offsetTop - x.offsetHeight, Le = Math.max(
16645
- W,
16616
+ const ne = c.clientHeight - x.offsetTop - x.offsetHeight, De = Math.max(
16617
+ U,
16646
16618
  ee + // viewport might have padding bottom, include it to avoid a scrollable viewport
16647
16619
  (se ? Re : 0) + ne + B
16648
- ), Y = P + Le;
16620
+ ), Y = P + De;
16649
16621
  a.style.height = Y + "px";
16650
16622
  } else {
16651
16623
  const se = O.length > 0 && y === O[0].ref.current;
16652
16624
  a.style.top = "0px";
16653
- const Le = Math.max(
16654
- Ee,
16625
+ const De = Math.max(
16626
+ Ie,
16655
16627
  $ + x.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
16656
16628
  (se ? pe : 0) + ee
16657
16629
  ) + H;
16658
- a.style.height = Le + "px", x.scrollTop = P - Ee + x.offsetTop;
16630
+ a.style.height = De + "px", x.scrollTop = P - Ie + x.offsetTop;
16659
16631
  }
16660
16632
  a.style.margin = `${dn}px 0`, a.style.minHeight = Z + "px", a.style.maxHeight = L + "px", r == null || r(), requestAnimationFrame(() => h.current = !0);
16661
16633
  }
@@ -16700,7 +16672,7 @@ var mT = "SelectItemAlignedPosition", bh = v.forwardRef((e, t) => {
16700
16672
  zIndex: T
16701
16673
  },
16702
16674
  children: /* @__PURE__ */ u.jsx(
16703
- Ae.div,
16675
+ je.div,
16704
16676
  {
16705
16677
  ...o,
16706
16678
  ref: f,
@@ -16751,7 +16723,7 @@ var gT = "SelectPopperPosition", na = v.forwardRef((e, t) => {
16751
16723
  na.displayName = gT;
16752
16724
  var [xT, al] = Mr(ur, {}), ra = "SelectViewport", Sh = v.forwardRef(
16753
16725
  (e, t) => {
16754
- const { __scopeSelect: n, nonce: r, ...o } = e, s = Xn(ra, n), i = al(ra, n), a = Ke(t, s.onViewportChange), l = v.useRef(0);
16726
+ const { __scopeSelect: n, nonce: r, ...o } = e, s = Xn(ra, n), i = al(ra, n), a = Ve(t, s.onViewportChange), l = v.useRef(0);
16755
16727
  return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
16756
16728
  /* @__PURE__ */ u.jsx(
16757
16729
  "style",
@@ -16763,7 +16735,7 @@ var [xT, al] = Mr(ur, {}), ra = "SelectViewport", Sh = v.forwardRef(
16763
16735
  }
16764
16736
  ),
16765
16737
  /* @__PURE__ */ u.jsx(Zs.Slot, { scope: n, children: /* @__PURE__ */ u.jsx(
16766
- Ae.div,
16738
+ je.div,
16767
16739
  {
16768
16740
  "data-radix-select-viewport": "",
16769
16741
  role: "presentation",
@@ -16805,14 +16777,14 @@ Sh.displayName = ra;
16805
16777
  var Ch = "SelectGroup", [yT, vT] = Mr(Ch), wT = v.forwardRef(
16806
16778
  (e, t) => {
16807
16779
  const { __scopeSelect: n, ...r } = e, o = jn();
16808
- return /* @__PURE__ */ u.jsx(yT, { scope: n, id: o, children: /* @__PURE__ */ u.jsx(Ae.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
16780
+ return /* @__PURE__ */ u.jsx(yT, { scope: n, id: o, children: /* @__PURE__ */ u.jsx(je.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
16809
16781
  }
16810
16782
  );
16811
16783
  wT.displayName = Ch;
16812
16784
  var Th = "SelectLabel", kh = v.forwardRef(
16813
16785
  (e, t) => {
16814
16786
  const { __scopeSelect: n, ...r } = e, o = vT(Th, n);
16815
- return /* @__PURE__ */ u.jsx(Ae.div, { id: o.id, ...r, ref: t });
16787
+ return /* @__PURE__ */ u.jsx(je.div, { id: o.id, ...r, ref: t });
16816
16788
  }
16817
16789
  );
16818
16790
  kh.displayName = Th;
@@ -16824,7 +16796,7 @@ var gs = "SelectItem", [bT, Rh] = Mr(gs), Eh = v.forwardRef(
16824
16796
  disabled: o = !1,
16825
16797
  textValue: s,
16826
16798
  ...i
16827
- } = e, a = Yn(gs, n), l = Xn(gs, n), c = a.value === r, [d, f] = v.useState(s ?? ""), [p, h] = v.useState(!1), m = Ke(
16799
+ } = e, a = Yn(gs, n), l = Xn(gs, n), c = a.value === r, [d, f] = v.useState(s ?? ""), [p, h] = v.useState(!1), m = Ve(
16828
16800
  t,
16829
16801
  (w) => {
16830
16802
  var b;
@@ -16856,7 +16828,7 @@ var gs = "SelectItem", [bT, Rh] = Mr(gs), Eh = v.forwardRef(
16856
16828
  disabled: o,
16857
16829
  textValue: d,
16858
16830
  children: /* @__PURE__ */ u.jsx(
16859
- Ae.div,
16831
+ je.div,
16860
16832
  {
16861
16833
  role: "option",
16862
16834
  "aria-labelledby": x,
@@ -16902,7 +16874,7 @@ var gs = "SelectItem", [bT, Rh] = Mr(gs), Eh = v.forwardRef(
16902
16874
  Eh.displayName = gs;
16903
16875
  var Hr = "SelectItemText", Ih = v.forwardRef(
16904
16876
  (e, t) => {
16905
- const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Yn(Hr, n), a = Xn(Hr, n), l = Rh(Hr, n), c = uT(Hr, n), [d, f] = v.useState(null), p = Ke(
16877
+ const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Yn(Hr, n), a = Xn(Hr, n), l = Rh(Hr, n), c = uT(Hr, n), [d, f] = v.useState(null), p = Ve(
16906
16878
  t,
16907
16879
  (g) => f(g),
16908
16880
  l.onItemTextChange,
@@ -16915,7 +16887,7 @@ var Hr = "SelectItemText", Ih = v.forwardRef(
16915
16887
  [l.disabled, l.value, h]
16916
16888
  ), { onNativeOptionAdd: x, onNativeOptionRemove: y } = c;
16917
16889
  return Lt(() => (x(m), () => y(m)), [x, y, m]), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
16918
- /* @__PURE__ */ u.jsx(Ae.span, { id: l.textId, ...s, ref: p }),
16890
+ /* @__PURE__ */ u.jsx(je.span, { id: l.textId, ...s, ref: p }),
16919
16891
  l.isSelected && i.valueNode && !i.valueNodeHasChildren ? ws.createPortal(s.children, i.valueNode) : null
16920
16892
  ] });
16921
16893
  }
@@ -16924,12 +16896,12 @@ Ih.displayName = Hr;
16924
16896
  var Nh = "SelectItemIndicator", Ah = v.forwardRef(
16925
16897
  (e, t) => {
16926
16898
  const { __scopeSelect: n, ...r } = e;
16927
- return Rh(Nh, n).isSelected ? /* @__PURE__ */ u.jsx(Ae.span, { "aria-hidden": !0, ...r, ref: t }) : null;
16899
+ return Rh(Nh, n).isSelected ? /* @__PURE__ */ u.jsx(je.span, { "aria-hidden": !0, ...r, ref: t }) : null;
16928
16900
  }
16929
16901
  );
16930
16902
  Ah.displayName = Nh;
16931
16903
  var oa = "SelectScrollUpButton", jh = v.forwardRef((e, t) => {
16932
- const n = Xn(oa, e.__scopeSelect), r = al(oa, e.__scopeSelect), [o, s] = v.useState(!1), i = Ke(t, r.onScrollButtonChange);
16904
+ const n = Xn(oa, e.__scopeSelect), r = al(oa, e.__scopeSelect), [o, s] = v.useState(!1), i = Ve(t, r.onScrollButtonChange);
16933
16905
  return Lt(() => {
16934
16906
  if (n.viewport && n.isPositioned) {
16935
16907
  let a = function() {
@@ -16953,7 +16925,7 @@ var oa = "SelectScrollUpButton", jh = v.forwardRef((e, t) => {
16953
16925
  });
16954
16926
  jh.displayName = oa;
16955
16927
  var sa = "SelectScrollDownButton", _h = v.forwardRef((e, t) => {
16956
- const n = Xn(sa, e.__scopeSelect), r = al(sa, e.__scopeSelect), [o, s] = v.useState(!1), i = Ke(t, r.onScrollButtonChange);
16928
+ const n = Xn(sa, e.__scopeSelect), r = al(sa, e.__scopeSelect), [o, s] = v.useState(!1), i = Ve(t, r.onScrollButtonChange);
16957
16929
  return Lt(() => {
16958
16930
  if (n.viewport && n.isPositioned) {
16959
16931
  let a = function() {
@@ -16985,7 +16957,7 @@ var Ph = v.forwardRef((e, t) => {
16985
16957
  const c = a().find((f) => f.ref.current === document.activeElement);
16986
16958
  (d = c == null ? void 0 : c.ref.current) == null || d.scrollIntoView({ block: "nearest" });
16987
16959
  }, [a]), /* @__PURE__ */ u.jsx(
16988
- Ae.div,
16960
+ je.div,
16989
16961
  {
16990
16962
  "aria-hidden": !0,
16991
16963
  ...o,
@@ -17006,7 +16978,7 @@ var Ph = v.forwardRef((e, t) => {
17006
16978
  }), ST = "SelectSeparator", Oh = v.forwardRef(
17007
16979
  (e, t) => {
17008
16980
  const { __scopeSelect: n, ...r } = e;
17009
- return /* @__PURE__ */ u.jsx(Ae.div, { "aria-hidden": !0, ...r, ref: t });
16981
+ return /* @__PURE__ */ u.jsx(je.div, { "aria-hidden": !0, ...r, ref: t });
17010
16982
  }
17011
16983
  );
17012
16984
  Oh.displayName = ST;
@@ -17019,7 +16991,7 @@ var ia = "SelectArrow", CT = v.forwardRef(
17019
16991
  CT.displayName = ia;
17020
16992
  var TT = "SelectBubbleInput", Mh = v.forwardRef(
17021
16993
  ({ __scopeSelect: e, value: t, ...n }, r) => {
17022
- const o = v.useRef(null), s = Ke(r, o), i = rh(t);
16994
+ const o = v.useRef(null), s = Ve(r, o), i = rh(t);
17023
16995
  return v.useEffect(() => {
17024
16996
  const a = o.current;
17025
16997
  if (!a) return;
@@ -17032,7 +17004,7 @@ var TT = "SelectBubbleInput", Mh = v.forwardRef(
17032
17004
  d.call(a, t), a.dispatchEvent(f);
17033
17005
  }
17034
17006
  }, [i, t]), /* @__PURE__ */ u.jsx(
17035
- Ae.select,
17007
+ je.select,
17036
17008
  {
17037
17009
  ...n,
17038
17010
  style: { ...uh, ...n.style },
@@ -17180,7 +17152,7 @@ OT.displayName = Vh.displayName;
17180
17152
  var MT = "Separator", Yc = "horizontal", DT = ["horizontal", "vertical"], Gh = v.forwardRef((e, t) => {
17181
17153
  const { decorative: n, orientation: r = Yc, ...o } = e, s = LT(r) ? r : Yc, a = n ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
17182
17154
  return /* @__PURE__ */ u.jsx(
17183
- Ae.div,
17155
+ je.div,
17184
17156
  {
17185
17157
  "data-orientation": s,
17186
17158
  ...a,