teodor-new-chat-ui 4.3.285 → 4.3.286

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 Yh = Object.defineProperty;
2
2
  var Xh = (e, t, n) => t in e ? Yh(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var nl = (e, t, n) => Xh(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as v from "react";
5
- import B, { createContext as oo, useContext as fs, useMemo as ot, useState as ve, useRef as We, useCallback as Se, useEffect as Tt, useReducer as Jh, useLayoutEffect as Zh, createElement as _o, useImperativeHandle as Qh } from "react";
5
+ import B, { createContext as oo, useContext as fs, useMemo as ot, useState as ve, useRef as Ve, useCallback as Se, useEffect as Tt, useReducer as Jh, useLayoutEffect as Zh, createElement as _o, useImperativeHandle as Qh } from "react";
6
6
  import { Square as em, Send as tm, ChevronRight as Uc, Check as ra, Circle as nm, X as hr, ExternalLink as rm, Download as om, Image as sm, FileText as rl, Loader as oa, Bot as Qs, Wrench as im, User as am, Paperclip as ki, ChevronUp as sa, ChevronDown as ps, ChevronLeft as lm, Copy as ol, Edit as sl, RotateCcw as Ri, Info as cm, Loader2 as Dr, Edit3 as Wc, Plus as um, FileSpreadsheet as dm, MessageSquarePlus as fm, MessageSquare as pm, Calendar as hm, Trash2 as mm, Settings as gm, Server as xm, EyeOff as ym, Eye as vm, Layout as wm, MessageCircle as bm, Save as Sm } from "lucide-react";
7
7
  import { Slot as Cm, createSlot as vr } from "@radix-ui/react-slot";
8
8
  import { cva as hs } from "class-variance-authority";
@@ -66,8 +66,8 @@ function Em() {
66
66
  {
67
67
  var ke = g.ReactDebugCurrentFrame, et = ke.getStackAddendum();
68
68
  et !== "" && (K += "%s", ae = ae.concat([et]));
69
- var lt = ae.map(function(qe) {
70
- return String(qe);
69
+ var lt = ae.map(function(Ge) {
70
+ return String(Ge);
71
71
  });
72
72
  lt.unshift("Warning: " + K), Function.prototype.apply.call(console[R], console, lt);
73
73
  }
@@ -126,9 +126,9 @@ function Em() {
126
126
  var ke = R.displayName || null;
127
127
  return ke !== null ? ke : $(R.type) || "Memo";
128
128
  case p: {
129
- var et = R, lt = et._payload, qe = et._init;
129
+ var et = R, lt = et._payload, Ge = et._init;
130
130
  try {
131
- return $(qe(lt));
131
+ return $(Ge(lt));
132
132
  } catch {
133
133
  return null;
134
134
  }
@@ -214,8 +214,8 @@ function Em() {
214
214
  }
215
215
  var H = !1, W;
216
216
  {
217
- var ie = typeof WeakMap == "function" ? WeakMap : Map;
218
- W = new ie();
217
+ var se = typeof WeakMap == "function" ? WeakMap : Map;
218
+ W = new se();
219
219
  }
220
220
  function re(R, K) {
221
221
  if (!R || H)
@@ -233,27 +233,27 @@ function Em() {
233
233
  lt = ne.current, ne.current = null, Ne();
234
234
  try {
235
235
  if (K) {
236
- var qe = function() {
236
+ var Ge = function() {
237
237
  throw Error();
238
238
  };
239
- if (Object.defineProperty(qe.prototype, "props", {
239
+ if (Object.defineProperty(Ge.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(qe, []);
245
+ Reflect.construct(Ge, []);
246
246
  } catch (we) {
247
247
  ke = we;
248
248
  }
249
- Reflect.construct(R, [], qe);
249
+ Reflect.construct(R, [], Ge);
250
250
  } else {
251
251
  try {
252
- qe.call();
252
+ Ge.call();
253
253
  } catch (we) {
254
254
  ke = we;
255
255
  }
256
- R.call(qe.prototype);
256
+ R.call(Ge.prototype);
257
257
  }
258
258
  } else {
259
259
  try {
@@ -265,17 +265,17 @@ function Em() {
265
265
  }
266
266
  } catch (we) {
267
267
  if (we && ke && typeof we.stack == "string") {
268
- for (var Ue = we.stack.split(`
268
+ for (var We = we.stack.split(`
269
269
  `), jt = ke.stack.split(`
270
- `), bt = Ue.length - 1, St = jt.length - 1; bt >= 1 && St >= 0 && Ue[bt] !== jt[St]; )
270
+ `), bt = We.length - 1, St = jt.length - 1; bt >= 1 && St >= 0 && We[bt] !== jt[St]; )
271
271
  St--;
272
272
  for (; bt >= 1 && St >= 0; bt--, St--)
273
- if (Ue[bt] !== jt[St]) {
273
+ if (We[bt] !== jt[St]) {
274
274
  if (bt !== 1 || St !== 1)
275
275
  do
276
- if (bt--, St--, St < 0 || Ue[bt] !== jt[St]) {
276
+ if (bt--, St--, St < 0 || We[bt] !== jt[St]) {
277
277
  var Q = `
278
- ` + Ue[bt].replace(" at new ", " at ");
278
+ ` + We[bt].replace(" at new ", " at ");
279
279
  return R.displayName && Q.includes("<anonymous>") && (Q = Q.replace("<anonymous>", R.displayName)), typeof R == "function" && W.set(R, Q), Q;
280
280
  }
281
281
  while (bt >= 1 && St >= 0);
@@ -288,10 +288,10 @@ function Em() {
288
288
  var ue = R ? R.displayName || R.name : "", de = ue ? D(ue) : "";
289
289
  return typeof R == "function" && W.set(R, de), de;
290
290
  }
291
- function ze(R, K, ae) {
291
+ function Le(R, K, ae) {
292
292
  return re(R, !1);
293
293
  }
294
- function Ve(R) {
294
+ function Ke(R) {
295
295
  var K = R.prototype;
296
296
  return !!(K && K.isReactComponent);
297
297
  }
@@ -299,7 +299,7 @@ function Em() {
299
299
  if (R == null)
300
300
  return "";
301
301
  if (typeof R == "function")
302
- return re(R, Ve(R));
302
+ return re(R, Ke(R));
303
303
  if (typeof R == "string")
304
304
  return D(R);
305
305
  switch (R) {
@@ -311,7 +311,7 @@ function Em() {
311
311
  if (typeof R == "object")
312
312
  switch (R.$$typeof) {
313
313
  case l:
314
- return ze(R.render);
314
+ return Le(R.render);
315
315
  case f:
316
316
  return Qe(R.type, K, ae);
317
317
  case p: {
@@ -325,7 +325,7 @@ function Em() {
325
325
  return "";
326
326
  }
327
327
  var oe = Object.prototype.hasOwnProperty, he = {}, Te = g.ReactDebugCurrentFrame;
328
- function Be(R) {
328
+ function He(R) {
329
329
  if (R) {
330
330
  var K = R._owner, ae = Qe(R.type, R._source, K ? K.type : null);
331
331
  Te.setExtraStackFrame(ae);
@@ -335,19 +335,19 @@ function Em() {
335
335
  function Ze(R, K, ae, ke, et) {
336
336
  {
337
337
  var lt = Function.call.bind(oe);
338
- for (var qe in R)
339
- if (lt(R, qe)) {
340
- var Ue = void 0;
338
+ for (var Ge in R)
339
+ if (lt(R, Ge)) {
340
+ var We = void 0;
341
341
  try {
342
- if (typeof R[qe] != "function") {
343
- var jt = Error((ke || "React class") + ": " + ae + " type `" + qe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[qe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
342
+ if (typeof R[Ge] != "function") {
343
+ var jt = Error((ke || "React class") + ": " + ae + " type `" + Ge + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Ge] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
344
  throw jt.name = "Invariant Violation", jt;
345
345
  }
346
- Ue = R[qe](K, qe, ke, ae, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ We = R[Ge](K, Ge, ke, ae, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
347
  } catch (bt) {
348
- Ue = bt;
348
+ We = bt;
349
349
  }
350
- Ue && !(Ue instanceof Error) && (Be(et), 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).", ke || "React class", ae, qe, typeof Ue), Be(null)), Ue instanceof Error && !(Ue.message in he) && (he[Ue.message] = !0, Be(et), w("Failed %s type: %s", ae, Ue.message), Be(null));
350
+ We && !(We instanceof Error) && (He(et), 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).", ke || "React class", ae, Ge, typeof We), He(null)), We instanceof Error && !(We.message in he) && (he[We.message] = !0, He(et), w("Failed %s type: %s", ae, We.message), He(null));
351
351
  }
352
352
  }
353
353
  }
@@ -355,13 +355,13 @@ function Em() {
355
355
  function $e(R) {
356
356
  return nt(R);
357
357
  }
358
- function He(R) {
358
+ function Ue(R) {
359
359
  {
360
360
  var K = typeof Symbol == "function" && Symbol.toStringTag, ae = K && R[Symbol.toStringTag] || R.constructor.name || "Object";
361
361
  return ae;
362
362
  }
363
363
  }
364
- function Ke(R) {
364
+ function qe(R) {
365
365
  try {
366
366
  return rt(R), !1;
367
367
  } catch {
@@ -372,8 +372,8 @@ function Em() {
372
372
  return "" + R;
373
373
  }
374
374
  function It(R) {
375
- if (Ke(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.", He(R)), rt(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.", Ue(R)), rt(R);
377
377
  }
378
378
  var ft = g.ReactCurrentOwner, mt = {
379
379
  key: !0,
@@ -381,7 +381,7 @@ function Em() {
381
381
  __self: !0,
382
382
  __source: !0
383
383
  }, gt, at;
384
- function Me(R) {
384
+ function Oe(R) {
385
385
  if (oe.call(R, "ref")) {
386
386
  var K = Object.getOwnPropertyDescriptor(R, "ref").get;
387
387
  if (K && K.isReactWarning)
@@ -422,51 +422,51 @@ function Em() {
422
422
  });
423
423
  }
424
424
  }
425
- var Ge = function(R, K, ae, ke, et, lt, qe) {
426
- var Ue = {
425
+ var Ye = function(R, K, ae, ke, et, lt, Ge) {
426
+ var We = {
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
431
  key: K,
432
432
  ref: ae,
433
- props: qe,
433
+ props: Ge,
434
434
  // Record the component responsible for creating this element.
435
435
  _owner: lt
436
436
  };
437
- return Ue._store = {}, Object.defineProperty(Ue._store, "validated", {
437
+ return We._store = {}, Object.defineProperty(We._store, "validated", {
438
438
  configurable: !1,
439
439
  enumerable: !1,
440
440
  writable: !0,
441
441
  value: !1
442
- }), Object.defineProperty(Ue, "_self", {
442
+ }), Object.defineProperty(We, "_self", {
443
443
  configurable: !1,
444
444
  enumerable: !1,
445
445
  writable: !1,
446
446
  value: ke
447
- }), Object.defineProperty(Ue, "_source", {
447
+ }), Object.defineProperty(We, "_source", {
448
448
  configurable: !1,
449
449
  enumerable: !1,
450
450
  writable: !1,
451
451
  value: et
452
- }), Object.freeze && (Object.freeze(Ue.props), Object.freeze(Ue)), Ue;
452
+ }), Object.freeze && (Object.freeze(We.props), Object.freeze(We)), We;
453
453
  };
454
454
  function Ae(R, K, ae, ke, et) {
455
455
  {
456
- var lt, qe = {}, Ue = null, jt = null;
457
- ae !== void 0 && (It(ae), Ue = "" + ae), At(K) && (It(K.key), Ue = "" + K.key), Me(K) && (jt = K.ref, _t(K, et));
456
+ var lt, Ge = {}, We = null, jt = null;
457
+ ae !== void 0 && (It(ae), We = "" + ae), At(K) && (It(K.key), We = "" + K.key), Oe(K) && (jt = K.ref, _t(K, et));
458
458
  for (lt in K)
459
- oe.call(K, lt) && !mt.hasOwnProperty(lt) && (qe[lt] = K[lt]);
459
+ oe.call(K, lt) && !mt.hasOwnProperty(lt) && (Ge[lt] = K[lt]);
460
460
  if (R && R.defaultProps) {
461
461
  var bt = R.defaultProps;
462
462
  for (lt in bt)
463
- qe[lt] === void 0 && (qe[lt] = bt[lt]);
463
+ Ge[lt] === void 0 && (Ge[lt] = bt[lt]);
464
464
  }
465
- if (Ue || jt) {
465
+ if (We || jt) {
466
466
  var St = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
467
- Ue && Xt(qe, St), jt && an(qe, St);
467
+ We && Xt(Ge, St), jt && an(Ge, St);
468
468
  }
469
- return Ge(R, Ue, jt, et, ke, ft.current, qe);
469
+ return Ye(R, We, jt, et, ke, ft.current, Ge);
470
470
  }
471
471
  }
472
472
  var Nt = g.ReactCurrentOwner, Bt = g.ReactDebugCurrentFrame;
@@ -498,7 +498,7 @@ Check the render method of \`` + R + "`.";
498
498
  return "";
499
499
  }
500
500
  var Ee = {};
501
- function se(R) {
501
+ function ie(R) {
502
502
  {
503
503
  var K = ee();
504
504
  if (!K) {
@@ -510,12 +510,12 @@ Check the top-level render call using <` + ae + ">.");
510
510
  return K;
511
511
  }
512
512
  }
513
- function Ye(R, K) {
513
+ function ze(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 ae = se(K);
518
+ var ae = ie(K);
519
519
  if (Ee[ae])
520
520
  return;
521
521
  Ee[ae] = !0;
@@ -523,26 +523,26 @@ Check the top-level render call using <` + ae + ">.");
523
523
  R && R._owner && R._owner !== Nt.current && (ke = " It was passed a child from " + $(R._owner.type) + "."), U(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.', ae, ke), U(null);
524
524
  }
525
525
  }
526
- function _e(R, K) {
526
+ function Fe(R, K) {
527
527
  {
528
528
  if (typeof R != "object")
529
529
  return;
530
530
  if ($e(R))
531
531
  for (var ae = 0; ae < R.length; ae++) {
532
532
  var ke = R[ae];
533
- z(ke) && Ye(ke, K);
533
+ z(ke) && ze(ke, K);
534
534
  }
535
535
  else if (z(R))
536
536
  R._store && (R._store.validated = !0);
537
537
  else if (R) {
538
538
  var et = y(R);
539
539
  if (typeof et == "function" && et !== R.entries)
540
- for (var lt = et.call(R), qe; !(qe = lt.next()).done; )
541
- z(qe.value) && Ye(qe.value, K);
540
+ for (var lt = et.call(R), Ge; !(Ge = lt.next()).done; )
541
+ z(Ge.value) && ze(Ge.value, K);
542
542
  }
543
543
  }
544
544
  }
545
- function De(R) {
545
+ function Me(R) {
546
546
  {
547
547
  var K = R.type;
548
548
  if (K == null || typeof K == "string")
@@ -582,30 +582,30 @@ Check the top-level render call using <` + ae + ">.");
582
582
  var wt = {};
583
583
  function En(R, K, ae, ke, et, lt) {
584
584
  {
585
- var qe = M(R);
586
- if (!qe) {
587
- var Ue = "";
588
- (R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && (Ue += " 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 Ge = M(R);
586
+ if (!Ge) {
587
+ var We = "";
588
+ (R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && (We += " 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 jt = ge();
590
- jt ? Ue += jt : Ue += ee();
590
+ jt ? We += jt : We += ee();
591
591
  var bt;
592
- R === null ? bt = "null" : $e(R) ? bt = "array" : R !== void 0 && R.$$typeof === t ? (bt = "<" + ($(R.type) || "Unknown") + " />", Ue = " 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, Ue);
592
+ R === null ? bt = "null" : $e(R) ? bt = "array" : R !== void 0 && R.$$typeof === t ? (bt = "<" + ($(R.type) || "Unknown") + " />", We = " 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, We);
593
593
  }
594
594
  var St = Ae(R, K, ae, et, lt);
595
595
  if (St == null)
596
596
  return St;
597
- if (qe) {
597
+ if (Ge) {
598
598
  var Q = K.children;
599
599
  if (Q !== void 0)
600
600
  if (ke)
601
601
  if ($e(Q)) {
602
602
  for (var ue = 0; ue < Q.length; ue++)
603
- _e(Q[ue], R);
603
+ Fe(Q[ue], R);
604
604
  Object.freeze && Object.freeze(Q);
605
605
  } else
606
606
  w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
607
607
  else
608
- _e(Q, R);
608
+ Fe(Q, R);
609
609
  }
610
610
  if (oe.call(K, "key")) {
611
611
  var de = $(R), we = Object.keys(K).filter(function(ln) {
@@ -621,7 +621,7 @@ React keys must be passed directly to JSX without using spread:
621
621
  <%s key={someKey} {...props} />`, ct, de, xt, de), wt[de + ct] = !0;
622
622
  }
623
623
  }
624
- return R === r ? Jt(St) : De(St), St;
624
+ return R === r ? Jt(St) : Me(St), St;
625
625
  }
626
626
  }
627
627
  function Xs(R, K, ae) {
@@ -874,10 +874,10 @@ const lg = (e) => {
874
874
  asap: dg,
875
875
  isIterable: fg
876
876
  };
877
- function Oe(e, t, n, r, o) {
877
+ function Pe(e, t, n, r, o) {
878
878
  Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
879
879
  }
880
- O.inherits(Oe, Error, {
880
+ O.inherits(Pe, Error, {
881
881
  toJSON: function() {
882
882
  return {
883
883
  // Standard
@@ -898,7 +898,7 @@ O.inherits(Oe, Error, {
898
898
  };
899
899
  }
900
900
  });
901
- const eu = Oe.prototype, tu = {};
901
+ const eu = Pe.prototype, tu = {};
902
902
  [
903
903
  "ERR_BAD_OPTION_VALUE",
904
904
  "ERR_BAD_OPTION",
@@ -916,15 +916,15 @@ const eu = Oe.prototype, tu = {};
916
916
  ].forEach((e) => {
917
917
  tu[e] = { value: e };
918
918
  });
919
- Object.defineProperties(Oe, tu);
919
+ Object.defineProperties(Pe, tu);
920
920
  Object.defineProperty(eu, "isAxiosError", { value: !0 });
921
- Oe.from = (e, t, n, r, o, s) => {
921
+ Pe.from = (e, t, n, r, o, s) => {
922
922
  const i = Object.create(eu);
923
923
  O.toFlatObject(e, i, function(d) {
924
924
  return d !== Error.prototype;
925
925
  }, (c) => c !== "isAxiosError");
926
926
  const a = e && e.message ? e.message : "Error", l = t == null && e ? e.code : t;
927
- return Oe.call(i, a, l, n, r, o), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", s && Object.assign(i, s), i;
927
+ return Pe.call(i, a, l, n, r, o), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", s && Object.assign(i, s), i;
928
928
  };
929
929
  const pg = null;
930
930
  function Ni(e) {
@@ -964,7 +964,7 @@ function vs(e, t, n) {
964
964
  if (O.isBoolean(m))
965
965
  return m.toString();
966
966
  if (!l && O.isBlob(m))
967
- throw new Oe("Blob is not supported. Use a Buffer instead.");
967
+ throw new Pe("Blob is not supported. Use a Buffer instead.");
968
968
  return O.isArrayBuffer(m) || O.isTypedArray(m) ? l && typeof Blob == "function" ? new Blob([m]) : Buffer.from(m) : m;
969
969
  }
970
970
  function d(m, x, y) {
@@ -1215,7 +1215,7 @@ const lo = {
1215
1215
  return JSON.parse(t, this.parseReviver);
1216
1216
  } catch (a) {
1217
1217
  if (i)
1218
- throw a.name === "SyntaxError" ? Oe.from(a, Oe.ERR_BAD_RESPONSE, this, null, this.response) : a;
1218
+ throw a.name === "SyntaxError" ? Pe.from(a, Pe.ERR_BAD_RESPONSE, this, null, this.response) : a;
1219
1219
  }
1220
1220
  }
1221
1221
  return t;
@@ -1458,16 +1458,16 @@ function au(e) {
1458
1458
  return !!(e && e.__CANCEL__);
1459
1459
  }
1460
1460
  function kr(e, t, n) {
1461
- Oe.call(this, e ?? "canceled", Oe.ERR_CANCELED, t, n), this.name = "CanceledError";
1461
+ Pe.call(this, e ?? "canceled", Pe.ERR_CANCELED, t, n), this.name = "CanceledError";
1462
1462
  }
1463
- O.inherits(kr, Oe, {
1463
+ O.inherits(kr, Pe, {
1464
1464
  __CANCEL__: !0
1465
1465
  });
1466
1466
  function lu(e, t, n) {
1467
1467
  const r = n.config.validateStatus;
1468
- !n.status || !r || r(n.status) ? e(n) : t(new Oe(
1468
+ !n.status || !r || r(n.status) ? e(n) : t(new Pe(
1469
1469
  "Request failed with status code " + n.status,
1470
- [Oe.ERR_BAD_REQUEST, Oe.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
1470
+ [Pe.ERR_BAD_REQUEST, Pe.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
1471
1471
  n.config,
1472
1472
  n.request,
1473
1473
  n
@@ -1690,16 +1690,16 @@ const uu = (e) => {
1690
1690
  "onloadend" in y ? y.onloadend = g : y.onreadystatechange = function() {
1691
1691
  !y || y.readyState !== 4 || y.status === 0 && !(y.responseURL && y.responseURL.indexOf("file:") === 0) || setTimeout(g);
1692
1692
  }, y.onabort = function() {
1693
- y && (r(new Oe("Request aborted", Oe.ECONNABORTED, e, y)), y = null);
1693
+ y && (r(new Pe("Request aborted", Pe.ECONNABORTED, e, y)), y = null);
1694
1694
  }, y.onerror = function(T) {
1695
- const C = T && T.message ? T.message : "Network Error", S = new Oe(C, Oe.ERR_NETWORK, e, y);
1695
+ const C = T && T.message ? T.message : "Network Error", S = new Pe(C, Pe.ERR_NETWORK, e, y);
1696
1696
  S.event = T || null, r(S), y = null;
1697
1697
  }, y.ontimeout = function() {
1698
1698
  let T = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
1699
1699
  const C = o.transitional || su;
1700
- o.timeoutErrorMessage && (T = o.timeoutErrorMessage), r(new Oe(
1700
+ o.timeoutErrorMessage && (T = o.timeoutErrorMessage), r(new Pe(
1701
1701
  T,
1702
- C.clarifyTimeoutError ? Oe.ETIMEDOUT : Oe.ECONNABORTED,
1702
+ C.clarifyTimeoutError ? Pe.ETIMEDOUT : Pe.ECONNABORTED,
1703
1703
  e,
1704
1704
  y
1705
1705
  )), y = null;
@@ -1710,7 +1710,7 @@ const uu = (e) => {
1710
1710
  }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
1711
1711
  const w = Mg(o.url);
1712
1712
  if (w && Dt.protocols.indexOf(w) === -1) {
1713
- r(new Oe("Unsupported protocol " + w + ":", Oe.ERR_BAD_REQUEST, e));
1713
+ r(new Pe("Unsupported protocol " + w + ":", Pe.ERR_BAD_REQUEST, e));
1714
1714
  return;
1715
1715
  }
1716
1716
  y.send(s || null);
@@ -1723,11 +1723,11 @@ const uu = (e) => {
1723
1723
  if (!o) {
1724
1724
  o = !0, a();
1725
1725
  const d = c instanceof Error ? c : this.reason;
1726
- r.abort(d instanceof Oe ? d : new kr(d instanceof Error ? d.message : d));
1726
+ r.abort(d instanceof Pe ? d : new kr(d instanceof Error ? d.message : d));
1727
1727
  }
1728
1728
  };
1729
1729
  let i = t && setTimeout(() => {
1730
- i = null, s(new Oe(`timeout ${t} of ms exceeded`, Oe.ETIMEDOUT));
1730
+ i = null, s(new Pe(`timeout ${t} of ms exceeded`, Pe.ETIMEDOUT));
1731
1731
  }, t);
1732
1732
  const a = () => {
1733
1733
  e && (i && clearTimeout(i), i = null, e.forEach((c) => {
@@ -1832,7 +1832,7 @@ const uu = (e) => {
1832
1832
  let g = x && x[m];
1833
1833
  if (g)
1834
1834
  return g.call(x);
1835
- throw new Oe(`Response type '${m}' is not supported`, Oe.ERR_NOT_SUPPORT, y);
1835
+ throw new Pe(`Response type '${m}' is not supported`, Pe.ERR_NOT_SUPPORT, y);
1836
1836
  });
1837
1837
  });
1838
1838
  const p = async (m) => {
@@ -1932,11 +1932,11 @@ const uu = (e) => {
1932
1932
  });
1933
1933
  } catch (A) {
1934
1934
  throw I && I(), A && A.name === "TypeError" && /Load failed|fetch/i.test(A.message) ? Object.assign(
1935
- new Oe("Network Error", Oe.ERR_NETWORK, m, $),
1935
+ new Pe("Network Error", Pe.ERR_NETWORK, m, $),
1936
1936
  {
1937
1937
  cause: A.cause || A
1938
1938
  }
1939
- ) : Oe.from(A, A && A.code, m, $);
1939
+ ) : Pe.from(A, A && A.code, m, $);
1940
1940
  }
1941
1941
  };
1942
1942
  }, Xg = /* @__PURE__ */ new Map(), du = (e) => {
@@ -1978,7 +1978,7 @@ const bl = (e) => `- ${e}`, Jg = (e) => O.isFunction(e) || e === null || e === !
1978
1978
  r = e[i];
1979
1979
  let a;
1980
1980
  if (o = r, !Jg(r) && (o = _i[(a = String(r)).toLowerCase()], o === void 0))
1981
- throw new Oe(`Unknown adapter '${a}'`);
1981
+ throw new Pe(`Unknown adapter '${a}'`);
1982
1982
  if (o && (O.isFunction(o) || (o = o.get(t))))
1983
1983
  break;
1984
1984
  s[a || "#" + i] = o;
@@ -1990,7 +1990,7 @@ const bl = (e) => `- ${e}`, Jg = (e) => O.isFunction(e) || e === null || e === !
1990
1990
  let a = n ? i.length > 1 ? `since :
1991
1991
  ` + i.map(bl).join(`
1992
1992
  `) : " " + bl(i[0]) : "as no adapter specified";
1993
- throw new Oe(
1993
+ throw new Pe(
1994
1994
  "There is no suitable adapter to dispatch the request " + a,
1995
1995
  "ERR_NOT_SUPPORT"
1996
1996
  );
@@ -2034,9 +2034,9 @@ ws.transitional = function(t, n, r) {
2034
2034
  }
2035
2035
  return (s, i, a) => {
2036
2036
  if (t === !1)
2037
- throw new Oe(
2037
+ throw new Pe(
2038
2038
  o(i, " has been removed" + (n ? " in " + n : "")),
2039
- Oe.ERR_DEPRECATED
2039
+ Pe.ERR_DEPRECATED
2040
2040
  );
2041
2041
  return n && !Cl[i] && (Cl[i] = !0, console.warn(
2042
2042
  o(
@@ -2051,7 +2051,7 @@ ws.spelling = function(t) {
2051
2051
  };
2052
2052
  function Zg(e, t, n) {
2053
2053
  if (typeof e != "object")
2054
- throw new Oe("options must be an object", Oe.ERR_BAD_OPTION_VALUE);
2054
+ throw new Pe("options must be an object", Pe.ERR_BAD_OPTION_VALUE);
2055
2055
  const r = Object.keys(e);
2056
2056
  let o = r.length;
2057
2057
  for (; o-- > 0; ) {
@@ -2059,11 +2059,11 @@ function Zg(e, t, n) {
2059
2059
  if (i) {
2060
2060
  const a = e[s], l = a === void 0 || i(a, s, e);
2061
2061
  if (l !== !0)
2062
- throw new Oe("option " + s + " must be " + l, Oe.ERR_BAD_OPTION_VALUE);
2062
+ throw new Pe("option " + s + " must be " + l, Pe.ERR_BAD_OPTION_VALUE);
2063
2063
  continue;
2064
2064
  }
2065
2065
  if (n !== !0)
2066
- throw new Oe("Unknown option " + s, Oe.ERR_BAD_OPTION);
2066
+ throw new Pe("Unknown option " + s, Pe.ERR_BAD_OPTION);
2067
2067
  }
2068
2068
  }
2069
2069
  const Oo = {
@@ -2356,7 +2356,7 @@ kt.CancelToken = Qg;
2356
2356
  kt.isCancel = au;
2357
2357
  kt.VERSION = pu;
2358
2358
  kt.toFormData = vs;
2359
- kt.AxiosError = Oe;
2359
+ kt.AxiosError = Pe;
2360
2360
  kt.Cancel = kt.CanceledError;
2361
2361
  kt.all = function(t) {
2362
2362
  return Promise.all(t);
@@ -3031,7 +3031,7 @@ function Px(e) {
3031
3031
  return t;
3032
3032
  }
3033
3033
  function Ox(e = {}) {
3034
- const t = ot(() => An(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ve(e.token ?? null), s = We(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ve(!1), [c, d] = ve(null), [f, p] = ve(""), [h, m] = ve(null), [x, y] = ve(0), [g, w] = ve(!1), b = We(null), T = We(!0), C = We(0), S = We(null), k = We(null), E = We(null), N = We(null), M = Se((I) => {
3034
+ const t = ot(() => An(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ve(e.token ?? null), s = Ve(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ve(!1), [c, d] = ve(null), [f, p] = ve(""), [h, m] = ve(null), [x, y] = ve(0), [g, w] = ve(!1), b = Ve(null), T = Ve(!0), C = Ve(0), S = Ve(null), k = Ve(null), E = Ve(null), N = Ve(null), M = Se((I) => {
3035
3035
  o(I);
3036
3036
  }, []), j = Se(() => {
3037
3037
  p(""), m(null), d(null), k.current = null, E.current = null, N.current = null;
@@ -3048,14 +3048,14 @@ function Ox(e = {}) {
3048
3048
  threadId: I.threadId ?? null,
3049
3049
  headers: {}
3050
3050
  }, (async () => {
3051
- var fe, Ce, Ne, q, ne, Y, D, H, W, ie, re, ze, Ve, Qe, oe, he, Te, Be;
3051
+ var fe, Ce, Ne, q, ne, Y, D, H, W, se, re, Le, Ke, Qe, oe, he, Te, He;
3052
3052
  const G = (Ze) => {
3053
3053
  var nt;
3054
3054
  try {
3055
3055
  const $e = JSON.parse(JSON.stringify(Ze));
3056
- return (nt = $e == null ? void 0 : $e.payload) != null && nt.files_info && Array.isArray($e.payload.files_info) && ($e.payload.files_info = $e.payload.files_info.map((He) => ({
3057
- ...He,
3058
- data: He != null && He.data ? `<base64 ${String(He.data).length} chars>` : He == null ? void 0 : He.data
3056
+ return (nt = $e == null ? void 0 : $e.payload) != null && nt.files_info && Array.isArray($e.payload.files_info) && ($e.payload.files_info = $e.payload.files_info.map((Ue) => ({
3057
+ ...Ue,
3058
+ data: Ue != null && Ue.data ? `<base64 ${String(Ue.data).length} chars>` : Ue == null ? void 0 : Ue.data
3059
3059
  }))), $e;
3060
3060
  } catch {
3061
3061
  return Ze;
@@ -3087,59 +3087,59 @@ function Ox(e = {}) {
3087
3087
  let nt = {};
3088
3088
  if (typeof window < "u")
3089
3089
  try {
3090
- const Ge = (q = window.localStorage) == null ? void 0 : q.getItem("authSessionId");
3091
- Ge && (nt = { "X-Session-Id": Ge });
3090
+ const Ye = (q = window.localStorage) == null ? void 0 : q.getItem("authSessionId");
3091
+ Ye && (nt = { "X-Session-Id": Ye });
3092
3092
  } catch {
3093
3093
  }
3094
3094
  const $e = {
3095
3095
  ...Ze,
3096
3096
  ...nt,
3097
3097
  ...s.current
3098
- }, He = {
3098
+ }, Ue = {
3099
3099
  "Content-Type": "application/json",
3100
3100
  Accept: "text/event-stream",
3101
3101
  ...$e
3102
- }, Ke = await fetch(t + n, {
3102
+ }, qe = await fetch(t + n, {
3103
3103
  method: "POST",
3104
- headers: He,
3104
+ headers: Ue,
3105
3105
  body: JSON.stringify(I),
3106
3106
  signal: X.signal,
3107
3107
  credentials: i
3108
3108
  });
3109
- if (S.current && (S.current.headers = $e), !Ke.ok || !Ke.body) {
3110
- const Ge = await Ke.text().catch(() => "");
3109
+ if (S.current && (S.current.headers = $e), !qe.ok || !qe.body) {
3110
+ const Ye = await qe.text().catch(() => "");
3111
3111
  console.debug(
3112
3112
  "[use-chat] non-OK response",
3113
- Ke.status,
3114
- Ge == null ? void 0 : Ge.slice(0, 500)
3113
+ qe.status,
3114
+ Ye == null ? void 0 : Ye.slice(0, 500)
3115
3115
  );
3116
- const Ae = `stream ${Ke.status}${Ge ? ": " + Ge : ""}`;
3116
+ const Ae = `stream ${qe.status}${Ye ? ": " + Ye : ""}`;
3117
3117
  throw (ne = A == null ? void 0 : A.onConnectionError) == null || ne.call(A, Ae), J = !0, L = "error", _ = Ae, new Error(Ae);
3118
3118
  }
3119
3119
  w(!0);
3120
- const rt = Ke.body.getReader(), It = new TextDecoder();
3120
+ const rt = qe.body.getReader(), It = new TextDecoder();
3121
3121
  let ft = "", mt = [];
3122
3122
  C.current = 0, y(0);
3123
3123
  let gt = 0, at = null;
3124
- const Me = () => {
3124
+ const Oe = () => {
3125
3125
  if (mt.length) {
3126
- const Ge = mt.join("");
3127
- mt = [], T.current && p((Ae) => Ae + Ge);
3126
+ const Ye = mt.join("");
3127
+ mt = [], T.current && p((Ae) => Ae + Ye);
3128
3128
  }
3129
3129
  at = null;
3130
3130
  }, At = () => {
3131
- typeof window < "u" && at == null && (at = requestAnimationFrame(Me));
3131
+ typeof window < "u" && at == null && (at = requestAnimationFrame(Oe));
3132
3132
  };
3133
3133
  let _t = Date.now();
3134
3134
  const Xt = setInterval(() => {
3135
- var Ge;
3135
+ var Ye;
3136
3136
  if (Date.now() - _t > 18e5) {
3137
3137
  const Ae = "Stream idle timeout";
3138
- d(Ae), L = "error", _ = Ae, X.abort(), (Ge = A == null ? void 0 : A.onError) == null || Ge.call(A, Ae);
3138
+ d(Ae), L = "error", _ = Ae, X.abort(), (Ye = A == null ? void 0 : A.onError) == null || Ye.call(A, Ae);
3139
3139
  }
3140
3140
  }, 5e3), an = 1024 * 1024;
3141
3141
  try {
3142
- const Ge = Ke.headers.get("X-Thread-Id") || Ke.headers.get("x-thread-id"), Ae = Ke.headers.get("X-Thread-Created") || Ke.headers.get("x-thread-created"), Nt = Ge ?? null, Bt = String(Ae ?? "").toLowerCase() === "true";
3142
+ const Ye = qe.headers.get("X-Thread-Id") || qe.headers.get("x-thread-id"), Ae = qe.headers.get("X-Thread-Created") || qe.headers.get("x-thread-created"), Nt = Ye ?? null, Bt = String(Ae ?? "").toLowerCase() === "true";
3143
3143
  for (S.current && !S.current.threadId && (S.current = {
3144
3144
  ...S.current,
3145
3145
  threadId: Nt
@@ -3162,63 +3162,63 @@ function Ox(e = {}) {
3162
3162
  console.debug("[use-chat] malformed SSE:", ge.slice(0, 200));
3163
3163
  continue;
3164
3164
  }
3165
- const se = Mx(Ee) ? Ee.data : Ee;
3165
+ const ie = Mx(Ee) ? Ee.data : Ee;
3166
3166
  _t = Date.now();
3167
- const Ye = se.seq;
3168
- if (Ye !== void 0) {
3169
- if (Ye <= gt) {
3170
- console.debug("[use-chat] drop duplicate/out-of-order event", { seq: Ye, lastProcessedSeq: gt, type: se.type });
3167
+ const ze = ie.seq;
3168
+ if (ze !== void 0) {
3169
+ if (ze <= gt) {
3170
+ console.debug("[use-chat] drop duplicate/out-of-order event", { seq: ze, lastProcessedSeq: gt, type: ie.type });
3171
3171
  continue;
3172
3172
  }
3173
- gt > 0 && Ye > gt + 1 && ((D = A == null ? void 0 : A.onGap) == null || D.call(A, { from: gt, to: Ye })), gt = Ye, C.current = Ye, y(Ye);
3173
+ gt > 0 && ze > gt + 1 && ((D = A == null ? void 0 : A.onGap) == null || D.call(A, { from: gt, to: ze })), gt = ze, C.current = ze, y(ze);
3174
3174
  }
3175
3175
  if (console.debug("[use-chat] received event", {
3176
- seq: se.seq,
3177
- type: se.type,
3176
+ seq: ie.seq,
3177
+ type: ie.type,
3178
3178
  preview: (() => {
3179
- var _e;
3179
+ var Fe;
3180
3180
  try {
3181
- return se.type === "message_delta" ? { deltaTypes: (_e = se.delta) == null ? void 0 : _e.map((De) => De.type), textLen: (se.delta || []).filter((De) => De.type === "text").map((De) => String(De.text || "").length) } : se.content || se.delta ? { hasContent: !0 } : {};
3182
- } catch (De) {
3183
- return { err: String(De) };
3181
+ return ie.type === "message_delta" ? { deltaTypes: (Fe = ie.delta) == null ? void 0 : Fe.map((Me) => Me.type), textLen: (ie.delta || []).filter((Me) => Me.type === "text").map((Me) => String(Me.text || "").length) } : ie.content || ie.delta ? { hasContent: !0 } : {};
3182
+ } catch (Me) {
3183
+ return { err: String(Me) };
3184
3184
  }
3185
3185
  })()
3186
- }), se.type === "checkpoint")
3187
- k.current = se.checkpointId ?? null, E.current = se.checkpointNs ?? null, m(se.checkpointId ?? null);
3188
- else if (se.type === "state_history") {
3189
- N.current = se;
3186
+ }), ie.type === "checkpoint")
3187
+ k.current = ie.checkpointId ?? null, E.current = ie.checkpointNs ?? null, m(ie.checkpointId ?? null);
3188
+ else if (ie.type === "state_history") {
3189
+ N.current = ie;
3190
3190
  try {
3191
- const De = fr(se).latest;
3192
- De && (k.current = De.checkpointId ?? null, E.current = De.checkpointNs ?? null, m(De.checkpointId ?? null));
3193
- } catch (_e) {
3194
- console.warn("[use-chat] Failed to hydrate state_history payload", _e);
3191
+ const Me = fr(ie).latest;
3192
+ Me && (k.current = Me.checkpointId ?? null, E.current = Me.checkpointNs ?? null, m(Me.checkpointId ?? null));
3193
+ } catch (Fe) {
3194
+ console.warn("[use-chat] Failed to hydrate state_history payload", Fe);
3195
3195
  }
3196
3196
  }
3197
3197
  try {
3198
- F == null || F(se);
3199
- } catch (_e) {
3200
- console.error("[use-chat] Error in onEvent callback:", _e, "for event:", se.type);
3198
+ F == null || F(ie);
3199
+ } catch (Fe) {
3200
+ console.error("[use-chat] Error in onEvent callback:", Fe, "for event:", ie.type);
3201
3201
  }
3202
- if (se.type === "token" && e.autoAppendAssistant !== !1)
3203
- mt.push(se.content), At();
3204
- else if (se.type === "message_delta") {
3205
- const _e = se.delta.filter((De) => De.type === "text").map((De) => De.text).join("");
3206
- _e && e.autoAppendAssistant !== !1 && (mt.push(_e), At());
3207
- } else if (se.type === "heartbeat") {
3202
+ if (ie.type === "token" && e.autoAppendAssistant !== !1)
3203
+ mt.push(ie.content), At();
3204
+ else if (ie.type === "message_delta") {
3205
+ const Fe = ie.delta.filter((Me) => Me.type === "text").map((Me) => Me.text).join("");
3206
+ Fe && e.autoAppendAssistant !== !1 && (mt.push(Fe), At());
3207
+ } else if (ie.type === "heartbeat") {
3208
3208
  console.debug("[use-chat] heartbeat received");
3209
3209
  try {
3210
- (H = A == null ? void 0 : A.onHeartbeat) == null || H.call(A, se);
3211
- } catch (_e) {
3212
- console.warn("[use-chat] heartbeat callback failed", _e);
3210
+ (H = A == null ? void 0 : A.onHeartbeat) == null || H.call(A, ie);
3211
+ } catch (Fe) {
3212
+ console.warn("[use-chat] heartbeat callback failed", Fe);
3213
3213
  }
3214
- } else if (at !== null && cancelAnimationFrame(at), Me(), se.type === "checkpoint")
3215
- m(se.checkpointId);
3216
- else if (se.type === "error") {
3217
- const _e = se;
3218
- if (d(_e.message), L = "error", _ = _e.message, _e.error_type === "auth_error" || _e.code === "TOKEN_EXPIRED" || ((W = _e.message) == null ? void 0 : W.includes("token")) || ((ie = _e.message) == null ? void 0 : ie.includes("401")) || ((re = _e.message) == null ? void 0 : re.includes("unauthorized")) || ((ze = _e.message) == null ? void 0 : ze.includes("Unauthorized"))) {
3219
- console.error("[use-chat] Auth error detected:", _e.message);
3214
+ } else if (at !== null && cancelAnimationFrame(at), Oe(), ie.type === "checkpoint")
3215
+ m(ie.checkpointId);
3216
+ else if (ie.type === "error") {
3217
+ const Fe = ie;
3218
+ if (d(Fe.message), L = "error", _ = Fe.message, Fe.error_type === "auth_error" || Fe.code === "TOKEN_EXPIRED" || ((W = Fe.message) == null ? void 0 : W.includes("token")) || ((se = Fe.message) == null ? void 0 : se.includes("401")) || ((re = Fe.message) == null ? void 0 : re.includes("unauthorized")) || ((Le = Fe.message) == null ? void 0 : Le.includes("Unauthorized"))) {
3219
+ console.error("[use-chat] Auth error detected:", Fe.message);
3220
3220
  try {
3221
- (Ve = A == null ? void 0 : A.onAuthError) == null || Ve.call(A, _e.message);
3221
+ (Ke = A == null ? void 0 : A.onAuthError) == null || Ke.call(A, Fe.message);
3222
3222
  } catch (Jt) {
3223
3223
  console.warn("[use-chat] onAuthError handler failed", Jt);
3224
3224
  }
@@ -3227,12 +3227,12 @@ function Ox(e = {}) {
3227
3227
  }
3228
3228
  }
3229
3229
  }
3230
- Me(), L === null && !X.signal.aborted && (L = "complete");
3231
- } catch (Ge) {
3232
- if (Ge.name === "AbortError")
3230
+ Oe(), L === null && !X.signal.aborted && (L = "complete");
3231
+ } catch (Ye) {
3232
+ if (Ye.name === "AbortError")
3233
3233
  L = L ?? "aborted";
3234
3234
  else {
3235
- const Ae = Ge.message || String(Ge);
3235
+ const Ae = Ye.message || String(Ye);
3236
3236
  L = "error", _ = Ae, d(Ae), (Qe = A == null ? void 0 : A.onError) == null || Qe.call(A, Ae);
3237
3237
  }
3238
3238
  } finally {
@@ -3252,14 +3252,14 @@ function Ox(e = {}) {
3252
3252
  L = "error", _ = nt, d(nt), (he = A == null ? void 0 : A.onError) == null || he.call(A, nt), J || ((Te = A == null ? void 0 : A.onConnectionError) == null || Te.call(A, nt), J = !0);
3253
3253
  }
3254
3254
  } finally {
3255
- const Ze = C.current, nt = k.current, $e = E.current, He = N.current, Ke = L ?? (X.signal.aborted ? "aborted" : _ ? "error" : "complete");
3255
+ const Ze = C.current, nt = k.current, $e = E.current, Ue = N.current, qe = L ?? (X.signal.aborted ? "aborted" : _ ? "error" : "complete");
3256
3256
  try {
3257
- (Be = A == null ? void 0 : A.onClosed) == null || Be.call(A, {
3258
- reason: Ke,
3257
+ (He = A == null ? void 0 : A.onClosed) == null || He.call(A, {
3258
+ reason: qe,
3259
3259
  lastSeq: Ze,
3260
3260
  lastCheckpointId: nt,
3261
3261
  lastCheckpointNs: $e,
3262
- lastStateHistory: He,
3262
+ lastStateHistory: Ue,
3263
3263
  error: _
3264
3264
  });
3265
3265
  } catch (rt) {
@@ -3361,7 +3361,7 @@ function Fx(e, t) {
3361
3361
  }
3362
3362
  }
3363
3363
  function zx(e = []) {
3364
- const [t, n] = Jh(Fx, { ...$x, messages: e }), r = We([]), o = We(null), s = We(null), i = Se(() => {
3364
+ const [t, n] = Jh(Fx, { ...$x, messages: e }), r = Ve([]), o = Ve(null), s = Ve(null), i = Se(() => {
3365
3365
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), o.current = null, s.current = null;
3366
3366
  const d = r.current;
3367
3367
  d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
@@ -3719,7 +3719,7 @@ function Vx({
3719
3719
  onAuthError: l,
3720
3720
  onHeartbeat: c
3721
3721
  }) {
3722
- const d = We(null), f = We(null), p = We(/* @__PURE__ */ new Map()), h = We(null), m = We(null), x = Se((j) => {
3722
+ const d = Ve(null), f = Ve(null), p = Ve(/* @__PURE__ */ new Map()), h = Ve(null), m = Ve(null), x = Se((j) => {
3723
3723
  try {
3724
3724
  const P = globalThis.structuredClone;
3725
3725
  if (typeof P == "function")
@@ -3913,7 +3913,7 @@ function Vx({
3913
3913
  );
3914
3914
  }
3915
3915
  function Kx() {
3916
- const e = We(/* @__PURE__ */ new Map()), t = Se(
3916
+ const e = Ve(/* @__PURE__ */ new Map()), t = Se(
3917
3917
  (a, l) => {
3918
3918
  const c = e.current.get(a), d = /* @__PURE__ */ new Map();
3919
3919
  c && c.forEach((f) => {
@@ -3971,15 +3971,15 @@ function qx({
3971
3971
  [_]
3972
3972
  ), ne = ot(() => Px(q), [q]), Y = l ?? Kx(), { setCacheForThread: D } = Y, H = Se(
3973
3973
  (z, ee, ge) => {
3974
- const Ee = ee.filter((se) => se.checkpointId).map((se) => ({
3975
- checkpointId: se.checkpointId,
3976
- checkpointNs: se.checkpointNs ?? void 0,
3977
- createdAt: se.createdAt ?? ""
3974
+ const Ee = ee.filter((ie) => ie.checkpointId).map((ie) => ({
3975
+ checkpointId: ie.checkpointId,
3976
+ checkpointNs: ie.checkpointNs ?? void 0,
3977
+ createdAt: ie.createdAt ?? ""
3978
3978
  }));
3979
3979
  console.log(`[ChatSessionProvider] Cached metadata for ${Ee.length} checkpoints from ${ge}`), D(z, Ee);
3980
3980
  },
3981
3981
  [D]
3982
- ), W = We(m), ie = We(null), re = We(null), ze = We(null), Ve = We(null), Qe = We(!1), oe = We(null), he = We(/* @__PURE__ */ new Map());
3982
+ ), W = Ve(m), se = Ve(null), re = Ve(null), Le = Ve(null), Ke = Ve(null), Qe = Ve(!1), oe = Ve(null), he = Ve(/* @__PURE__ */ new Map());
3983
3983
  Tt(() => {
3984
3984
  W.current = m;
3985
3985
  }, [m]);
@@ -3994,7 +3994,7 @@ function qx({
3994
3994
  } finally {
3995
3995
  g(!1);
3996
3996
  }
3997
- }, [c, s]), Be = Se((z) => {
3997
+ }, [c, s]), He = Se((z) => {
3998
3998
  if (!(z != null && z.threadId)) return;
3999
3999
  const ee = {
4000
4000
  threadId: z.threadId,
@@ -4003,7 +4003,7 @@ function qx({
4003
4003
  updatedAt: z.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
4004
4004
  messageCount: z.messageCount ?? 1
4005
4005
  };
4006
- h((ge) => ge.some((se) => se.threadId === ee.threadId) ? (console.debug("[ChatSessionProvider] thread_info: thread already in list", ee.threadId), ge) : (console.debug("[ChatSessionProvider] thread_info: adding thread to list", ee.threadId), [ee, ...ge]));
4006
+ h((ge) => ge.some((ie) => ie.threadId === ee.threadId) ? (console.debug("[ChatSessionProvider] thread_info: thread already in list", ee.threadId), ge) : (console.debug("[ChatSessionProvider] thread_info: adding thread to list", ee.threadId), [ee, ...ge]));
4007
4007
  }, []), Ze = Se(
4008
4008
  (z) => {
4009
4009
  const ee = z.threadId ?? W.current;
@@ -4013,18 +4013,16 @@ function qx({
4013
4013
  if (!ge.length)
4014
4014
  return;
4015
4015
  H(ee, ge, "stream state_history");
4016
- const se = ge.find((_e) => _e.messages && _e.messages.length > 0) ?? ge.find((_e) => !!_e.checkpointId) ?? ge[0];
4017
- N((se == null ? void 0 : se.messages) ?? [], {
4018
- checkpointId: (se == null ? void 0 : se.checkpointId) ?? null,
4019
- checkpointNs: (se == null ? void 0 : se.checkpointNs) ?? null
4020
- }), fe(Ee), J(ge), I(!!(se != null && se.nextCursor)), L((se == null ? void 0 : se.nextCursor) ?? null);
4021
- const Ye = `${ee}:${(se == null ? void 0 : se.checkpointId) ?? "latest"}`;
4022
- oe.current = Ye;
4016
+ const ie = ge.find((ze) => ze.messages && ze.messages.length > 0) ?? ge.find((ze) => !!ze.checkpointId) ?? ge[0];
4017
+ N((ie == null ? void 0 : ie.messages) ?? [], {
4018
+ checkpointId: (ie == null ? void 0 : ie.checkpointId) ?? null,
4019
+ checkpointNs: (ie == null ? void 0 : ie.checkpointNs) ?? null
4020
+ }), fe(Ee), J(ge), I(!!(ie != null && ie.nextCursor)), L((ie == null ? void 0 : ie.nextCursor) ?? null), oe.current = `${ee}:latest`, re.current = null, Le.current = null;
4023
4021
  },
4024
4022
  [H, N]
4025
4023
  ), nt = Se((z) => {
4026
- console.log("[ChatSessionProvider] 🎯 Received thread_info:", z.threadId), Be(z), W.current !== z.threadId && (re.current = z.threadId, ze.current = z.threadId, console.log("[ChatSessionProvider] thread_info: marking to skip auto-load for new thread"), x(z.threadId));
4027
- }, [Be]), { startStream: $e, stop: He, isStreaming: Ke, error: rt, setAuthToken: It } = Vx({
4024
+ console.log("[ChatSessionProvider] 🎯 Received thread_info:", z.threadId), He(z), W.current !== z.threadId && (re.current = z.threadId, Le.current = z.threadId, console.log("[ChatSessionProvider] thread_info: marking to skip auto-load for new thread"), x(z.threadId));
4025
+ }, [He]), { startStream: $e, stop: Ue, isStreaming: qe, error: rt, setAuthToken: It } = Vx({
4028
4026
  baseUrl: f,
4029
4027
  onThreadInfo: nt,
4030
4028
  onMessageEvent: P,
@@ -4067,68 +4065,70 @@ function qx({
4067
4065
  const ge = `${z}:${ee ?? "latest"}`, Ee = he.current.get(ge);
4068
4066
  if (Ee)
4069
4067
  return Ee;
4070
- const se = (async () => {
4071
- const Ye = z;
4068
+ const ie = (async () => {
4069
+ const ze = z;
4072
4070
  C(!0), k(null);
4073
4071
  try {
4074
- const _e = await c.getStateHistory({
4075
- threadId: Ye,
4072
+ const Fe = await c.getStateHistory({
4073
+ threadId: ze,
4076
4074
  checkpointId: ee || void 0
4077
4075
  });
4078
- if (W.current !== Ye) {
4079
- console.log(`[ChatSessionProvider] Thread changed during load (was ${Ye}, now ${W.current}), discarding stale data`);
4076
+ if (W.current !== ze) {
4077
+ console.log(`[ChatSessionProvider] Thread changed during load (was ${ze}, now ${W.current}), discarding stale data`);
4080
4078
  return;
4081
4079
  }
4082
- const { checkpoints: De, timeline: Jt } = fr(_e);
4083
- H(Ye, De, `thread load (requested: ${ee})`);
4084
- const wt = De.find((En) => En.messages && En.messages.length > 0) ?? (ee ? De.find((En) => En.checkpointId === ee) : null) ?? De[0];
4080
+ const { checkpoints: Me, timeline: Jt } = fr(Fe);
4081
+ H(ze, Me, `thread load (requested: ${ee})`);
4082
+ const wt = Me.find((En) => En.messages && En.messages.length > 0) ?? (ee ? Me.find((En) => En.checkpointId === ee) : null) ?? Me[0];
4085
4083
  N((wt == null ? void 0 : wt.messages) ?? [], {
4086
4084
  checkpointId: (wt == null ? void 0 : wt.checkpointId) ?? null,
4087
4085
  checkpointNs: (wt == null ? void 0 : wt.checkpointNs) ?? null
4088
- }), fe(Jt), J(De), I(!!(wt != null && wt.nextCursor)), L((wt == null ? void 0 : wt.nextCursor) ?? null);
4089
- } catch (_e) {
4090
- if (W.current === Ye) {
4091
- const De = String(_e);
4092
- k(De), s == null || s(De);
4086
+ }), fe(Jt), J(Me), I(!!(wt != null && wt.nextCursor)), L((wt == null ? void 0 : wt.nextCursor) ?? null);
4087
+ } catch (Fe) {
4088
+ if (W.current === ze) {
4089
+ const Me = String(Fe);
4090
+ k(Me), s == null || s(Me);
4093
4091
  }
4094
4092
  } finally {
4095
4093
  C(!1);
4096
4094
  }
4097
4095
  })();
4098
- he.current.set(ge, se);
4096
+ he.current.set(ge, ie);
4099
4097
  try {
4100
- await se;
4098
+ await ie;
4101
4099
  } finally {
4102
4100
  he.current.delete(ge);
4103
4101
  }
4104
- return W.current === z && (oe.current = ge), se;
4102
+ return W.current === z && (oe.current = ge), ie;
4105
4103
  },
4106
4104
  [c, N, s, H]
4107
- ), Me = Se(
4105
+ ), Oe = Se(
4108
4106
  async (z, ee) => {
4109
- Ve.current = z;
4107
+ Ke.current = z;
4110
4108
  try {
4111
4109
  await at(z, ee);
4112
4110
  } finally {
4113
- Ve.current === z && (Ve.current = null);
4111
+ Ke.current === z && (Ke.current = null);
4114
4112
  }
4115
4113
  },
4116
4114
  [at]
4117
4115
  );
4118
4116
  Tt(() => {
4119
- if (!o || !m || T || Ke)
4117
+ if (!o || !m || T || qe)
4120
4118
  return;
4121
4119
  if (re.current === m) {
4122
4120
  re.current = null;
4123
4121
  return;
4124
4122
  }
4125
- if (Ve.current === m) {
4126
- Ve.current = null, ie.current = m;
4123
+ if (Le.current === m)
4124
+ return;
4125
+ if (Ke.current === m) {
4126
+ Ke.current = null, se.current = m;
4127
4127
  return;
4128
4128
  }
4129
- if (ie.current === m)
4129
+ if (se.current === m)
4130
4130
  return;
4131
- ie.current = m;
4131
+ se.current = m;
4132
4132
  const z = !Qe.current && !!n && m === t;
4133
4133
  let ee;
4134
4134
  z && n ? (ee = n, Qe.current = !0, console.log(
@@ -4137,7 +4137,7 @@ function qx({
4137
4137
  r ? `(ns: ${r})` : ""
4138
4138
  )) : console.log("[ChatSessionProvider] Loading thread with latest checkpoint");
4139
4139
  const ge = `${m}:${ee ?? "latest"}`;
4140
- oe.current !== ge && Me(m, ee);
4140
+ oe.current !== ge && Oe(m, ee);
4141
4141
  }, [
4142
4142
  o,
4143
4143
  m,
@@ -4145,8 +4145,8 @@ function qx({
4145
4145
  r,
4146
4146
  t,
4147
4147
  T,
4148
- Ke,
4149
- Me
4148
+ qe,
4149
+ Oe
4150
4150
  ]);
4151
4151
  const At = Se(
4152
4152
  async (z, ee) => {
@@ -4155,7 +4155,7 @@ function qx({
4155
4155
  const Ee = ge;
4156
4156
  Ne(!0);
4157
4157
  try {
4158
- const se = await c.getStateHistory({
4158
+ const ie = await c.getStateHistory({
4159
4159
  threadId: Ee,
4160
4160
  checkpointId: z,
4161
4161
  checkpointNs: ee ?? void 0
@@ -4164,21 +4164,21 @@ function qx({
4164
4164
  console.log(`[ChatSessionProvider] Thread changed during checkpoint navigation (was ${Ee}, now ${W.current}), discarding stale data`);
4165
4165
  return;
4166
4166
  }
4167
- const { checkpoints: Ye, timeline: _e } = fr(se);
4168
- H(Ee, Ye, "checkpoint navigation");
4169
- const De = Ye.find(
4167
+ const { checkpoints: ze, timeline: Fe } = fr(ie);
4168
+ H(Ee, ze, "checkpoint navigation");
4169
+ const Me = ze.find(
4170
4170
  (Jt) => Jt.checkpointId === z && (ee ? Jt.checkpointNs === ee : !0)
4171
4171
  );
4172
- if (!De) {
4172
+ if (!Me) {
4173
4173
  console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: z, checkpointNs: ee });
4174
4174
  return;
4175
4175
  }
4176
- fe(_e), J(Ye), N(De.messages ?? [], {
4177
- checkpointId: De.checkpointId ?? null,
4178
- checkpointNs: De.checkpointNs ?? null
4176
+ fe(Fe), J(ze), N(Me.messages ?? [], {
4177
+ checkpointId: Me.checkpointId ?? null,
4178
+ checkpointNs: Me.checkpointNs ?? null
4179
4179
  });
4180
- } catch (se) {
4181
- W.current === Ee && (s == null || s(String(se)));
4180
+ } catch (ie) {
4181
+ W.current === Ee && (s == null || s(String(ie)));
4182
4182
  } finally {
4183
4183
  Ne(!1);
4184
4184
  }
@@ -4193,8 +4193,8 @@ function qx({
4193
4193
  },
4194
4194
  [N, E.messages]
4195
4195
  ), Xt = Se(async () => {
4196
- W.current && await Me(W.current);
4197
- }, [Me]), an = Se(async () => {
4196
+ W.current && await Oe(W.current);
4197
+ }, [Oe]), an = Se(async () => {
4198
4198
  if (!W.current || !X) return;
4199
4199
  const z = W.current;
4200
4200
  A(!0);
@@ -4217,30 +4217,30 @@ function qx({
4217
4217
  } finally {
4218
4218
  A(!1);
4219
4219
  }
4220
- }, [c, X, M, s]), Ge = Se(async () => {
4221
- N([], {}), x(null), He(), J([]), fe([]), I(!1), L(null), C(!1), Ne(!1), A(!1), k(null);
4220
+ }, [c, X, M, s]), Ye = Se(async () => {
4221
+ N([], {}), x(null), Ue(), J([]), fe([]), I(!1), L(null), C(!1), Ne(!1), A(!1), k(null);
4222
4222
  try {
4223
4223
  await c.getAgent("default");
4224
4224
  } catch (z) {
4225
4225
  console.warn("[ChatSessionProvider] Failed to refetch agent after clearing thread:", z);
4226
4226
  }
4227
- }, [N, He, c]), Ae = Se(
4227
+ }, [N, Ue, c]), Ae = Se(
4228
4228
  async (z, ee, ge) => {
4229
4229
  const Ee = W.current;
4230
4230
  if (!Ee)
4231
4231
  throw new Error("No active thread to handle interrupt");
4232
- const se = ee ? ge ?? !0 : !1;
4232
+ const ie = ee ? ge ?? !0 : !1;
4233
4233
  try {
4234
- const Ye = {
4234
+ const ze = {
4235
4235
  threadId: Ee,
4236
4236
  checkpointId: E.lastCheckpointId ?? void 0,
4237
4237
  checkpointNs: E.lastCheckpointNs ?? void 0,
4238
4238
  // The command is the key: backend extracts this and routes to LangGraph
4239
- command: { kind: "resume", value: se }
4239
+ command: { kind: "resume", value: ie }
4240
4240
  };
4241
- $e(Ye);
4242
- } catch (Ye) {
4243
- throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${z}:`, Ye), Ye;
4241
+ $e(ze);
4242
+ } catch (ze) {
4243
+ throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${z}:`, ze), ze;
4244
4244
  }
4245
4245
  },
4246
4246
  [E.lastCheckpointId, E.lastCheckpointNs, $e]
@@ -4262,27 +4262,27 @@ function qx({
4262
4262
  ).join("").slice(0, 16);
4263
4263
  ge = `${Jt}${wt}`, re.current = ge, x(ge);
4264
4264
  }
4265
- const { contentParts: se } = await dx(
4265
+ const { contentParts: ie } = await dx(
4266
4266
  c,
4267
4267
  (z == null ? void 0 : z.attachments) ?? []
4268
- ), Ye = [...se];
4269
- Ee != null && Ee.trim() && Ye.push({ type: "text", text: Ee });
4270
- const _e = {
4268
+ ), ze = [...ie];
4269
+ Ee != null && Ee.trim() && ze.push({ type: "text", text: Ee });
4270
+ const Fe = {
4271
4271
  id: `msg-${Date.now()}`,
4272
4272
  role: "user",
4273
- content: Ye,
4273
+ content: ze,
4274
4274
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
4275
4275
  };
4276
- j(_e);
4277
- const De = {
4276
+ j(Fe);
4277
+ const Me = {
4278
4278
  threadId: ge,
4279
4279
  payload: {
4280
- messages: [_e]
4280
+ messages: [Fe]
4281
4281
  },
4282
4282
  checkpointId: (ee == null ? void 0 : ee.checkpointId) ?? E.lastCheckpointId ?? void 0,
4283
4283
  checkpointNs: (ee == null ? void 0 : ee.checkpointNs) ?? E.lastCheckpointNs ?? void 0
4284
4284
  };
4285
- $e(De);
4285
+ $e(Me);
4286
4286
  },
4287
4287
  [c, ft, j, E, $e]
4288
4288
  ), Bt = ot(
@@ -4318,12 +4318,12 @@ function qx({
4318
4318
  error: S,
4319
4319
  hasMore: $,
4320
4320
  loadOlder: an,
4321
- clearState: Ge,
4321
+ clearState: Ye,
4322
4322
  navigateToCheckpoint: At,
4323
4323
  setCurrentCheckpointId: _t,
4324
4324
  returnToLatest: Xt,
4325
- loadThread: Me,
4326
- clearThread: Ge,
4325
+ loadThread: Oe,
4326
+ clearThread: Ye,
4327
4327
  respondToInterrupt: Ae,
4328
4328
  messagePreviews: ne
4329
4329
  }),
@@ -4338,25 +4338,25 @@ function qx({
4338
4338
  S,
4339
4339
  $,
4340
4340
  an,
4341
- Ge,
4341
+ Ye,
4342
4342
  At,
4343
4343
  _t,
4344
4344
  Xt,
4345
- Me,
4345
+ Oe,
4346
4346
  Ae,
4347
4347
  ne
4348
4348
  ]
4349
4349
  ), ye = ot(
4350
4350
  () => ({
4351
- isStreaming: Ke,
4351
+ isStreaming: qe,
4352
4352
  error: rt,
4353
- connectionState: Ke ? "connected" : "idle",
4353
+ connectionState: qe ? "connected" : "idle",
4354
4354
  submit: Nt,
4355
4355
  send: Nt,
4356
- stop: He,
4356
+ stop: Ue,
4357
4357
  setAuthToken: It
4358
4358
  }),
4359
- [Ke, rt, Nt, He, It]
4359
+ [qe, rt, Nt, Ue, It]
4360
4360
  );
4361
4361
  return /* @__PURE__ */ u.jsx(Cu.Provider, { value: Bt, children: /* @__PURE__ */ u.jsx(Tu.Provider, { value: U, children: /* @__PURE__ */ u.jsx(ku.Provider, { value: ye, children: e }) }) });
4362
4362
  }
@@ -4732,7 +4732,7 @@ var ry = [
4732
4732
  "span",
4733
4733
  "svg",
4734
4734
  "ul"
4735
- ], Pe = ry.reduce((e, t) => {
4735
+ ], je = ry.reduce((e, t) => {
4736
4736
  const n = vr(`Primitive.${t}`), r = v.forwardRef((o, s) => {
4737
4737
  const { asChild: i, ...a } = o, l = i ? n : t;
4738
4738
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u.jsx(l, { ...a, ref: s });
@@ -4839,7 +4839,7 @@ var iy = "DismissableLayer", Mi = "dismissableLayer.update", ay = "dismissableLa
4839
4839
  const k = () => h({});
4840
4840
  return document.addEventListener(Mi, k), () => document.removeEventListener(Mi, k);
4841
4841
  }, []), /* @__PURE__ */ u.jsx(
4842
- Pe.div,
4842
+ je.div,
4843
4843
  {
4844
4844
  ...l,
4845
4845
  ref: m,
@@ -4866,7 +4866,7 @@ var cy = "DismissableLayerBranch", uy = v.forwardRef((e, t) => {
4866
4866
  return n.branches.add(s), () => {
4867
4867
  n.branches.delete(s);
4868
4868
  };
4869
- }, [n.branches]), /* @__PURE__ */ u.jsx(Pe.div, { ...e, ref: o });
4869
+ }, [n.branches]), /* @__PURE__ */ u.jsx(je.div, { ...e, ref: o });
4870
4870
  });
4871
4871
  uy.displayName = cy;
4872
4872
  function dy(e, t = globalThis == null ? void 0 : globalThis.document) {
@@ -4998,7 +4998,7 @@ var li = "focusScope.autoFocusOnMount", ci = "focusScope.autoFocusOnUnmount", Fl
4998
4998
  },
4999
4999
  [n, r, h.paused]
5000
5000
  );
5001
- return /* @__PURE__ */ u.jsx(Pe.div, { tabIndex: -1, ...i, ref: p, onKeyDown: m });
5001
+ return /* @__PURE__ */ u.jsx(je.div, { tabIndex: -1, ...i, ref: p, onKeyDown: m });
5002
5002
  });
5003
5003
  Cs.displayName = py;
5004
5004
  function hy(e, { select: t = !1 } = {}) {
@@ -6384,7 +6384,7 @@ const Tv = (e) => {
6384
6384
  var jv = "Arrow", Hu = v.forwardRef((e, t) => {
6385
6385
  const { children: n, width: r = 10, height: o = 5, ...s } = e;
6386
6386
  return /* @__PURE__ */ u.jsx(
6387
- Pe.svg,
6387
+ je.svg,
6388
6388
  {
6389
6389
  ...s,
6390
6390
  ref: t,
@@ -6431,13 +6431,13 @@ var qu = "PopperAnchor", Gu = v.forwardRef(
6431
6431
  return v.useEffect(() => {
6432
6432
  const c = l.current;
6433
6433
  l.current = (r == null ? void 0 : r.current) || i.current, c !== l.current && s.onAnchorChange(l.current);
6434
- }), r ? null : /* @__PURE__ */ u.jsx(Pe.div, { ...o, ref: a });
6434
+ }), r ? null : /* @__PURE__ */ u.jsx(je.div, { ...o, ref: a });
6435
6435
  }
6436
6436
  );
6437
6437
  Gu.displayName = qu;
6438
6438
  var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6439
6439
  (e, t) => {
6440
- var Y, D, H, W, ie, re;
6440
+ var Y, D, H, W, se, re;
6441
6441
  const {
6442
6442
  __scopePopper: n,
6443
6443
  side: r = "bottom",
@@ -6453,7 +6453,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6453
6453
  updatePositionStrategy: h = "optimized",
6454
6454
  onPlaced: m,
6455
6455
  ...x
6456
- } = e, y = Vu(Ca, n), [g, w] = v.useState(null), b = Je(t, (ze) => w(ze)), [T, C] = v.useState(null), S = Uu(T), k = (S == null ? void 0 : S.width) ?? 0, E = (S == null ? void 0 : S.height) ?? 0, N = r + (s !== "center" ? "-" + s : ""), M = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, j = Array.isArray(c) ? c : [c], P = j.length > 0, $ = {
6456
+ } = e, y = Vu(Ca, n), [g, w] = v.useState(null), b = Je(t, (Le) => w(Le)), [T, C] = v.useState(null), S = Uu(T), k = (S == null ? void 0 : S.width) ?? 0, E = (S == null ? void 0 : S.height) ?? 0, N = r + (s !== "center" ? "-" + s : ""), M = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, j = Array.isArray(c) ? c : [c], P = j.length > 0, $ = {
6457
6457
  padding: M,
6458
6458
  boundary: j.filter($v),
6459
6459
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
@@ -6462,7 +6462,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6462
6462
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
6463
6463
  strategy: "fixed",
6464
6464
  placement: N,
6465
- whileElementsMounted: (...ze) => pv(...ze, {
6465
+ whileElementsMounted: (...Le) => pv(...Le, {
6466
6466
  animationFrame: h === "always"
6467
6467
  }),
6468
6468
  elements: {
@@ -6479,9 +6479,9 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6479
6479
  l && Iv({ ...$ }),
6480
6480
  Nv({
6481
6481
  ...$,
6482
- apply: ({ elements: ze, rects: Ve, availableWidth: Qe, availableHeight: oe }) => {
6483
- const { width: he, height: Te } = Ve.reference, Be = ze.floating.style;
6484
- Be.setProperty("--radix-popper-available-width", `${Qe}px`), Be.setProperty("--radix-popper-available-height", `${oe}px`), Be.setProperty("--radix-popper-anchor-width", `${he}px`), Be.setProperty("--radix-popper-anchor-height", `${Te}px`);
6482
+ apply: ({ elements: Le, rects: Ke, availableWidth: Qe, availableHeight: oe }) => {
6483
+ const { width: he, height: Te } = Ke.reference, He = Le.floating.style;
6484
+ He.setProperty("--radix-popper-available-width", `${Qe}px`), He.setProperty("--radix-popper-available-height", `${oe}px`), He.setProperty("--radix-popper-anchor-width", `${he}px`), He.setProperty("--radix-popper-anchor-height", `${Te}px`);
6485
6485
  }
6486
6486
  }),
6487
6487
  T && _v({ element: T, padding: a }),
@@ -6508,7 +6508,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6508
6508
  zIndex: q,
6509
6509
  "--radix-popper-transform-origin": [
6510
6510
  (W = L.transformOrigin) == null ? void 0 : W.x,
6511
- (ie = L.transformOrigin) == null ? void 0 : ie.y
6511
+ (se = L.transformOrigin) == null ? void 0 : se.y
6512
6512
  ].join(" "),
6513
6513
  // hide the content if using the hide middleware and should be hidden
6514
6514
  // set visibility to hidden and disable pointer events so the UI behaves
@@ -6529,7 +6529,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6529
6529
  arrowY: Ce,
6530
6530
  shouldHideArrow: Ne,
6531
6531
  children: /* @__PURE__ */ u.jsx(
6532
- Pe.div,
6532
+ je.div,
6533
6533
  {
6534
6534
  "data-side": _,
6535
6535
  "data-align": J,
@@ -6623,7 +6623,7 @@ var Qu = Ku, ed = Gu, td = Yu, nd = Ju, zv = "Portal", Ns = v.forwardRef((e, t)
6623
6623
  const { container: n, ...r } = e, [o, s] = v.useState(!1);
6624
6624
  Ot(() => s(!0), []);
6625
6625
  const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
6626
- return i ? Vc.createPortal(/* @__PURE__ */ u.jsx(Pe.div, { ...r, ref: t }), i) : null;
6626
+ return i ? Vc.createPortal(/* @__PURE__ */ u.jsx(je.div, { ...r, ref: t }), i) : null;
6627
6627
  });
6628
6628
  Ns.displayName = zv;
6629
6629
  function Bv(e, t) {
@@ -6742,7 +6742,7 @@ var Yv = v.forwardRef((e, t) => {
6742
6742
  []
6743
6743
  ),
6744
6744
  children: /* @__PURE__ */ u.jsx(
6745
- Pe.div,
6745
+ je.div,
6746
6746
  {
6747
6747
  tabIndex: g || S === 0 ? -1 : 0,
6748
6748
  "data-orientation": r,
@@ -6791,7 +6791,7 @@ var Yv = v.forwardRef((e, t) => {
6791
6791
  focusable: r,
6792
6792
  active: o,
6793
6793
  children: /* @__PURE__ */ u.jsx(
6794
- Pe.span,
6794
+ je.span,
6795
6795
  {
6796
6796
  tabIndex: f ? 0 : -1,
6797
6797
  "data-orientation": d.orientation,
@@ -7613,14 +7613,14 @@ Cd.displayName = nn;
7613
7613
  var tb = "MenuGroup", Na = v.forwardRef(
7614
7614
  (e, t) => {
7615
7615
  const { __scopeMenu: n, ...r } = e;
7616
- return /* @__PURE__ */ u.jsx(Pe.div, { role: "group", ...r, ref: t });
7616
+ return /* @__PURE__ */ u.jsx(je.div, { role: "group", ...r, ref: t });
7617
7617
  }
7618
7618
  );
7619
7619
  Na.displayName = tb;
7620
7620
  var nb = "MenuLabel", Td = v.forwardRef(
7621
7621
  (e, t) => {
7622
7622
  const { __scopeMenu: n, ...r } = e;
7623
- return /* @__PURE__ */ u.jsx(Pe.div, { ...r, ref: t });
7623
+ return /* @__PURE__ */ u.jsx(je.div, { ...r, ref: t });
7624
7624
  }
7625
7625
  );
7626
7626
  Td.displayName = nb;
@@ -7670,7 +7670,7 @@ var kd = v.forwardRef(
7670
7670
  disabled: r,
7671
7671
  textValue: o ?? p,
7672
7672
  children: /* @__PURE__ */ u.jsx(tw, { asChild: !0, ...a, focusable: !r, children: /* @__PURE__ */ u.jsx(
7673
- Pe.div,
7673
+ je.div,
7674
7674
  {
7675
7675
  role: "menuitem",
7676
7676
  "data-highlighted": d ? "" : void 0,
@@ -7762,7 +7762,7 @@ var Aa = "MenuItemIndicator", [_d, ib] = or(
7762
7762
  {
7763
7763
  present: r || Zo(s.checked) || s.checked === !0,
7764
7764
  children: /* @__PURE__ */ u.jsx(
7765
- Pe.span,
7765
+ je.span,
7766
7766
  {
7767
7767
  ...o,
7768
7768
  ref: t,
@@ -7778,7 +7778,7 @@ var ab = "MenuSeparator", Pd = v.forwardRef(
7778
7778
  (e, t) => {
7779
7779
  const { __scopeMenu: n, ...r } = e;
7780
7780
  return /* @__PURE__ */ u.jsx(
7781
- Pe.div,
7781
+ je.div,
7782
7782
  {
7783
7783
  role: "separator",
7784
7784
  "aria-orientation": "horizontal",
@@ -7984,7 +7984,7 @@ var Hd = "DropdownMenuTrigger", Ud = v.forwardRef(
7984
7984
  (e, t) => {
7985
7985
  const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = zd(Hd, n), i = Ft(n);
7986
7986
  return /* @__PURE__ */ u.jsx(gb, { asChild: !0, ...i, children: /* @__PURE__ */ u.jsx(
7987
- Pe.button,
7987
+ je.button,
7988
7988
  {
7989
7989
  type: "button",
7990
7990
  id: s.triggerId,
@@ -8310,7 +8310,7 @@ function ht(...e) {
8310
8310
  function it(e, t) {
8311
8311
  return e(Bn, t);
8312
8312
  }
8313
- function Le(e, t) {
8313
+ function De(e, t) {
8314
8314
  e(Ms, t);
8315
8315
  }
8316
8316
  function Pa(e) {
@@ -8388,7 +8388,7 @@ function In(e) {
8388
8388
  }, e));
8389
8389
  };
8390
8390
  }
8391
- function Fe(...e) {
8391
+ function Be(...e) {
8392
8392
  const t = new Array(e.length);
8393
8393
  let n = 0, r = null;
8394
8394
  const o = Math.pow(2, e.length) - 1;
@@ -8490,7 +8490,7 @@ function Rt(...e) {
8490
8490
  return e.forEach((s, i) => {
8491
8491
  const a = Math.pow(2, i);
8492
8492
  it(s, (l) => {
8493
- n[i] = l, r = r | a, r === o && Le(t, n);
8493
+ n[i] = l, r = r | a, r === o && De(t, n);
8494
8494
  });
8495
8495
  }), function(s, i) {
8496
8496
  switch (s) {
@@ -9001,7 +9001,7 @@ const A0 = {
9001
9001
  }, kn = tt(
9002
9002
  ([{ log: e }, { recalcInProgress: t }]) => {
9003
9003
  const n = Xe(), r = Xe(), o = $t(r, 0), s = Xe(), i = Xe(), a = Z(0), l = Z([]), c = Z(void 0), d = Z(void 0), f = Z((C, S) => $n(C, A0[S])), p = Z(void 0), h = Z(0), m = b0(), x = $t(
9004
- V(n, Fe(l, e, h), bn(R0, m), pt()),
9004
+ V(n, Be(l, e, h), bn(R0, m), pt()),
9005
9005
  m
9006
9006
  ), y = $t(
9007
9007
  V(
@@ -9019,7 +9019,7 @@ const A0 = {
9019
9019
  V(
9020
9020
  l,
9021
9021
  Ie((C) => C.length > 0),
9022
- Fe(x, h),
9022
+ Be(x, h),
9023
9023
  le(([C, S, k]) => {
9024
9024
  const E = C.reduce((N, M, j) => qt(N, M, eo(M, S.offsetTree, k) || j), xr());
9025
9025
  return {
@@ -9033,7 +9033,7 @@ const A0 = {
9033
9033
  ), me(
9034
9034
  V(
9035
9035
  r,
9036
- Fe(x),
9036
+ Be(x),
9037
9037
  Ie(([C, { lastIndex: S }]) => C < S),
9038
9038
  le(([C, { lastIndex: S, lastSize: k }]) => [
9039
9039
  {
@@ -9063,7 +9063,7 @@ const A0 = {
9063
9063
  const w = Yt(
9064
9064
  V(
9065
9065
  n,
9066
- Fe(x),
9066
+ Be(x),
9067
9067
  bn(
9068
9068
  ({ sizes: C }, [S, k]) => ({
9069
9069
  changed: k !== C,
@@ -9086,13 +9086,13 @@ const A0 = {
9086
9086
  (C) => {
9087
9087
  const { groupIndices: S } = Ct(x);
9088
9088
  if (C > 0)
9089
- Le(t, !0), Le(s, C + dc(C, S));
9089
+ De(t, !0), De(s, C + dc(C, S));
9090
9090
  else if (C < 0) {
9091
9091
  const k = Ct(y);
9092
- k.length > 0 && (C -= dc(-C, k)), Le(i, C);
9092
+ k.length > 0 && (C -= dc(-C, k)), De(i, C);
9093
9093
  }
9094
9094
  }
9095
- ), it(V(a, Fe(e)), ([C, S]) => {
9095
+ ), it(V(a, Be(e)), ([C, S]) => {
9096
9096
  C < 0 && S(
9097
9097
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
9098
9098
  { firstItemIndex: a },
@@ -9103,7 +9103,7 @@ const A0 = {
9103
9103
  me(
9104
9104
  V(
9105
9105
  s,
9106
- Fe(x),
9106
+ Be(x),
9107
9107
  le(([C, S]) => {
9108
9108
  const k = S.groupIndices.length > 0, E = [], N = S.lastSize;
9109
9109
  if (k) {
@@ -9164,7 +9164,7 @@ const A0 = {
9164
9164
  const T = Yt(
9165
9165
  V(
9166
9166
  i,
9167
- Fe(x, h),
9167
+ Be(x, h),
9168
9168
  le(([C, { offsetTree: S }, k]) => {
9169
9169
  const E = -C;
9170
9170
  return eo(E, S, k);
@@ -9174,7 +9174,7 @@ const A0 = {
9174
9174
  return me(
9175
9175
  V(
9176
9176
  i,
9177
- Fe(x, h),
9177
+ Be(x, h),
9178
9178
  le(([C, S, k]) => {
9179
9179
  if (S.groupIndices.length > 0) {
9180
9180
  if (ut(S.sizeTree))
@@ -9308,13 +9308,13 @@ const ho = tt(
9308
9308
  const h = Xe(), m = Xe(), x = Z(0);
9309
9309
  let y = null, g = null, w = null;
9310
9310
  function b() {
9311
- y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), Le(l, !1);
9311
+ y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), De(l, !1);
9312
9312
  }
9313
9313
  return me(
9314
9314
  V(
9315
9315
  h,
9316
- Fe(n, f, r, x, a, i, p),
9317
- Fe(e, s, o),
9316
+ Be(n, f, r, x, a, i, p),
9317
+ Be(e, s, o),
9318
9318
  le(
9319
9319
  ([
9320
9320
  [T, C, S, k, E, N, M, j],
@@ -9326,7 +9326,7 @@ const ho = tt(
9326
9326
  let G = eo(J, C.offsetTree, P) + N;
9327
9327
  A === "end" ? (G += $ + hn(C.sizeTree, J)[1] - S + I, J === _ && (G += M)) : A === "center" ? G += ($ + hn(C.sizeTree, J)[1] - S + I) / 2 : G -= E, L && (G += L);
9328
9328
  const fe = (Ce) => {
9329
- b(), Ce ? (j("retrying to scroll to", { location: T }, Vt.DEBUG), Le(h, T)) : (Le(m, !0), j("list did not change, scroll successful", {}, Vt.DEBUG));
9329
+ b(), Ce ? (j("retrying to scroll to", { location: T }, Vt.DEBUG), De(h, T)) : (De(m, !0), j("list did not change, scroll successful", {}, Vt.DEBUG));
9330
9330
  };
9331
9331
  if (b(), X === "smooth") {
9332
9332
  let Ce = !1;
@@ -9339,7 +9339,7 @@ const ho = tt(
9339
9339
  y = dn(V(t, P0(150)), fe);
9340
9340
  return g = setTimeout(() => {
9341
9341
  b();
9342
- }, 1200), Le(l, !0), j("scrolling from index to", { behavior: X, index: J, top: G }, Vt.DEBUG), { behavior: X, top: G };
9342
+ }, 1200), De(l, !0), j("scrolling from index to", { behavior: X, index: J, top: G }, Vt.DEBUG), { behavior: X, top: G };
9343
9343
  }
9344
9344
  )
9345
9345
  ),
@@ -9378,7 +9378,7 @@ const mo = tt(
9378
9378
  return me(
9379
9379
  V(
9380
9380
  i,
9381
- Fe(l),
9381
+ Be(l),
9382
9382
  Ie(([d, f]) => !!f),
9383
9383
  yn(!1)
9384
9384
  ),
@@ -9386,7 +9386,7 @@ const mo = tt(
9386
9386
  ), me(
9387
9387
  V(
9388
9388
  i,
9389
- Fe(l),
9389
+ Be(l),
9390
9390
  Ie(([d, f]) => !!f),
9391
9391
  yn(!1)
9392
9392
  ),
@@ -9394,17 +9394,17 @@ const mo = tt(
9394
9394
  ), it(
9395
9395
  V(
9396
9396
  Rt(t, i),
9397
- Fe(a, n, e, c),
9397
+ Be(a, n, e, c),
9398
9398
  Ie(([[, d], f, { sizeTree: p }, h, m]) => d && (!ut(p) || ja(h)) && !f && !m),
9399
- Fe(l)
9399
+ Be(l)
9400
9400
  ),
9401
9401
  ([, d]) => {
9402
9402
  dn(o, () => {
9403
- Le(c, !0);
9403
+ De(c, !0);
9404
9404
  }), La(4, () => {
9405
9405
  dn(r, () => {
9406
- Le(a, !0);
9407
- }), Le(s, d);
9406
+ De(a, !0);
9407
+ }), De(s, d);
9408
9408
  });
9409
9409
  }
9410
9410
  ), {
@@ -9541,7 +9541,7 @@ const to = "up", zr = "down", O0 = "none", M0 = {
9541
9541
  V(
9542
9542
  o,
9543
9543
  In(100),
9544
- Fe(p),
9544
+ Be(p),
9545
9545
  Ie(([w, b]) => !!b),
9546
9546
  bn(([w, b], [T]) => [b, T], [0, 0]),
9547
9547
  le(([w, b]) => b - w)
@@ -9771,8 +9771,8 @@ const ar = tt(
9771
9771
  const q = P[0], ne = P[P.length - 1];
9772
9772
  let Y = 0;
9773
9773
  for (const D of Ls(L, q, ne)) {
9774
- const H = D.value, W = Math.max(D.start, q), ie = Math.min(D.end, ne);
9775
- for (let re = W; re <= ie; re++)
9774
+ const H = D.value, W = Math.max(D.start, q), se = Math.min(D.end, ne);
9775
+ for (let re = W; re <= se; re++)
9776
9776
  J.push({ data: F == null ? void 0 : F[re], index: re, offset: Y, size: H }), Y += H;
9777
9777
  }
9778
9778
  }
@@ -9792,8 +9792,8 @@ const ar = tt(
9792
9792
  D += re * W + re * I;
9793
9793
  }
9794
9794
  H < G && (D += (G - H) * W, H = G);
9795
- const ie = Math.min(ne.end, Ce);
9796
- for (let re = H; re <= ie && !(D >= k); re++)
9795
+ const se = Math.min(ne.end, Ce);
9796
+ for (let re = H; re <= se && !(D >= k); re++)
9797
9797
  q.push({ data: F == null ? void 0 : F[re], index: re, offset: D, size: W }), D += W + I;
9798
9798
  }
9799
9799
  });
@@ -9836,7 +9836,7 @@ const ar = tt(
9836
9836
  V(
9837
9837
  w,
9838
9838
  Ie(({ items: S }) => S.length > 0),
9839
- Fe(o, e),
9839
+ Be(o, e),
9840
9840
  Ie(([{ items: S }, k]) => S[S.length - 1].originalIndex === k - 1),
9841
9841
  le(([, S, k]) => [S - 1, k]),
9842
9842
  pt(Qr),
@@ -9928,8 +9928,8 @@ const ar = tt(
9928
9928
  return me(
9929
9929
  V(
9930
9930
  d,
9931
- Fe(t, l, n, s, o, r, a),
9932
- Fe(e),
9931
+ Be(t, l, n, s, o, r, a),
9932
+ Be(e),
9933
9933
  le(([[f, p, h, m, x, y, g, w], b]) => {
9934
9934
  const { align: T, behavior: C, calculateViewLocation: S = F0, done: k, ...E } = f, N = Tf(f, p, m - 1), M = eo(N, p.offsetTree, b) + x + y, j = M + hn(p.sizeTree, N)[1], P = w + y, $ = w + h - g, I = S({
9935
9935
  itemBottom: j,
@@ -9977,7 +9977,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
9977
9977
  const m = Z(!1), x = Xe();
9978
9978
  let y = null;
9979
9979
  function g(C) {
9980
- Le(i, {
9980
+ De(i, {
9981
9981
  align: "end",
9982
9982
  behavior: C,
9983
9983
  index: "LAST"
@@ -9986,7 +9986,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
9986
9986
  it(
9987
9987
  V(
9988
9988
  Rt(V(Re(t), er(1)), l),
9989
- Fe(Re(m), s, a, f),
9989
+ Be(Re(m), s, a, f),
9990
9990
  le(([[C, S], k, E, N, M]) => {
9991
9991
  let j = S && N, P = "auto";
9992
9992
  return j && (P = z0(k, E || M), j = j && !!P), { followOutputBehavior: P, shouldFollow: j, totalCount: C };
@@ -10016,7 +10016,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10016
10016
  { refreshed: !1, value: 0 }
10017
10017
  ),
10018
10018
  Ie(({ refreshed: C }) => C),
10019
- Fe(m, t)
10019
+ Be(m, t)
10020
10020
  ),
10021
10021
  ([, C]) => {
10022
10022
  Ct(a) && w(C !== !1);
@@ -10042,16 +10042,16 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10042
10042
  ), it(
10043
10043
  V(
10044
10044
  Rt(V(T, er(1)), l),
10045
- Fe(Re(b), a, f, p),
10045
+ Be(Re(b), a, f, p),
10046
10046
  le(([[C, S], k, E, N, M]) => S && E && (k == null ? void 0 : k({ context: M, totalCount: C, scrollingInProgress: N }))),
10047
10047
  Ie((C) => !!C),
10048
10048
  In(0)
10049
10049
  ),
10050
10050
  (C) => {
10051
10051
  y && (y(), y = null), Ct(n) ? requestAnimationFrame(() => {
10052
- Ct(d)("scrolling into view", {}), Le(h, C);
10052
+ Ct(d)("scrolling into view", {}), De(h, C);
10053
10053
  }) : y = dn(e, () => {
10054
- Ct(d)("scrolling into view", {}), Le(h, C), y = null;
10054
+ Ct(d)("scrolling into view", {}), De(h, C), y = null;
10055
10055
  });
10056
10056
  }
10057
10057
  ), { autoscrollToBottom: x, followOutput: m, scrollIntoViewOnChange: b };
@@ -10071,9 +10071,9 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10071
10071
  ([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (me(
10072
10072
  V(
10073
10073
  a,
10074
- Fe(s),
10074
+ Be(s),
10075
10075
  Ie(([, l]) => l !== 0),
10076
- Fe(o, r, t, n, e),
10076
+ Be(o, r, t, n, e),
10077
10077
  le(([[, l], c, d, f, p, h = []]) => If(l, c, d, f, p, h))
10078
10078
  ),
10079
10079
  i
@@ -10086,7 +10086,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10086
10086
  return it(
10087
10087
  V(
10088
10088
  e,
10089
- Fe(r),
10089
+ Be(r),
10090
10090
  Ie(([, o]) => o !== 0),
10091
10091
  le(([, o]) => ({ top: o }))
10092
10092
  ),
@@ -10099,7 +10099,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10099
10099
  ),
10100
10100
  () => {
10101
10101
  requestAnimationFrame(() => {
10102
- Le(t, o);
10102
+ De(t, o);
10103
10103
  });
10104
10104
  }
10105
10105
  );
@@ -10116,7 +10116,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10116
10116
  return me(
10117
10117
  V(
10118
10118
  e,
10119
- Fe(r, t, n),
10119
+ Be(r, t, n),
10120
10120
  Ie(([o, s]) => !!s),
10121
10121
  le(([o, s, i, a]) => {
10122
10122
  const { enter: l, exit: c } = s;
@@ -10131,7 +10131,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10131
10131
  ),
10132
10132
  t
10133
10133
  ), it(
10134
- V(Rt(t, e, n), Fe(r)),
10134
+ V(Rt(t, e, n), Be(r)),
10135
10135
  ([[o, s, i], a]) => {
10136
10136
  o && a && a.change && a.change(s, i);
10137
10137
  }
@@ -10154,7 +10154,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10154
10154
  ), me(
10155
10155
  V(
10156
10156
  t,
10157
- Fe(r),
10157
+ Be(r),
10158
10158
  le(([a, { offsetTop: l }]) => ({
10159
10159
  ...a,
10160
10160
  top: a.top + l
@@ -10183,7 +10183,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10183
10183
  return me(a, f), me(l, p), it(
10184
10184
  V(
10185
10185
  c,
10186
- Fe(t, r, i, f, p, n)
10186
+ Be(t, r, i, f, p, n)
10187
10187
  ),
10188
10188
  ([h, m, x, y, g, w, b]) => {
10189
10189
  const T = E0(m.sizeTree);
@@ -10192,7 +10192,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10192
10192
  ), me(V(d, Ie(ja), le(V0)), o), me(
10193
10193
  V(
10194
10194
  s,
10195
- Fe(d),
10195
+ Be(d),
10196
10196
  Ie(([, h]) => h !== void 0),
10197
10197
  pt(),
10198
10198
  le(([, h]) => h.ranges)
@@ -10235,7 +10235,7 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10235
10235
  const x = Yt(
10236
10236
  V(
10237
10237
  l,
10238
- Fe(i),
10238
+ Be(i),
10239
10239
  bn(
10240
10240
  ([, g, w, b], [{ bottom: T, items: C, offsetBottom: S, totalCount: k }, E]) => {
10241
10241
  const N = T + S;
@@ -10245,16 +10245,16 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10245
10245
  [0, [], 0, 0]
10246
10246
  ),
10247
10247
  Ie(([g]) => g !== 0),
10248
- Fe(r, a, n, o, h, m),
10248
+ Be(r, a, n, o, h, m),
10249
10249
  Ie(([, g, w, b, , , T]) => !T && !b && g !== 0 && w === to),
10250
10250
  le(([[g], , , , , w]) => (w("Upward scrolling compensation", { amount: g }, Vt.DEBUG), g))
10251
10251
  )
10252
10252
  );
10253
10253
  function y(g) {
10254
- g > 0 ? (Le(t, { behavior: "auto", top: -g }), Le(e, 0)) : (Le(e, 0), Le(t, { behavior: "auto", top: -g }));
10254
+ g > 0 ? (De(t, { behavior: "auto", top: -g }), De(e, 0)) : (De(e, 0), De(t, { behavior: "auto", top: -g }));
10255
10255
  }
10256
- return it(V(x, Fe(e, s)), ([g, w, b]) => {
10257
- b && q0() ? Le(e, w - g) : y(-g);
10256
+ return it(V(x, Be(e, s)), ([g, w, b]) => {
10257
+ b && q0() ? De(e, w - g) : y(-g);
10258
10258
  }), it(
10259
10259
  V(
10260
10260
  Rt($t(s, !1), e, m),
@@ -10272,7 +10272,7 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10272
10272
  ), it(
10273
10273
  V(
10274
10274
  c,
10275
- Fe(p, d),
10275
+ Be(p, d),
10276
10276
  le(([g, { groupIndices: w, lastSize: b, sizeTree: T }, C]) => {
10277
10277
  function S(k) {
10278
10278
  return k * (b + C);
@@ -10293,9 +10293,9 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10293
10293
  })
10294
10294
  ),
10295
10295
  (g) => {
10296
- Le(e, g), requestAnimationFrame(() => {
10297
- Le(t, { top: g }), requestAnimationFrame(() => {
10298
- Le(e, 0), Le(m, !1);
10296
+ De(e, g), requestAnimationFrame(() => {
10297
+ De(t, { top: g }), requestAnimationFrame(() => {
10298
+ De(e, 0), De(m, !1);
10299
10299
  });
10300
10300
  });
10301
10301
  }
@@ -10432,22 +10432,22 @@ const Eo = typeof document < "u" ? B.useLayoutEffect : B.useEffect;
10432
10432
  function Mf(e, t, n) {
10433
10433
  const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a = B.createContext({});
10434
10434
  function l(y, g) {
10435
- y.propsReady && Le(y.propsReady, !1);
10435
+ y.propsReady && De(y.propsReady, !1);
10436
10436
  for (const w of r) {
10437
10437
  const b = y[t.required[w]];
10438
- Le(b, g[w]);
10438
+ De(b, g[w]);
10439
10439
  }
10440
10440
  for (const w of o)
10441
10441
  if (w in g) {
10442
10442
  const b = y[t.optional[w]];
10443
- Le(b, g[w]);
10443
+ De(b, g[w]);
10444
10444
  }
10445
- y.propsReady && Le(y.propsReady, !0);
10445
+ y.propsReady && De(y.propsReady, !0);
10446
10446
  }
10447
10447
  function c(y) {
10448
10448
  return s.reduce((g, w) => (g[w] = (b) => {
10449
10449
  const T = y[t.methods[w]];
10450
- Le(T, b);
10450
+ De(T, b);
10451
10451
  }, g), {});
10452
10452
  }
10453
10453
  function d(y) {
@@ -10472,7 +10472,7 @@ function Mf(e, t, n) {
10472
10472
  const g = B.useContext(a);
10473
10473
  return B.useCallback(
10474
10474
  (w) => {
10475
- Le(g[y], w);
10475
+ De(g[y], w);
10476
10476
  },
10477
10477
  [g, y]
10478
10478
  );
@@ -10602,7 +10602,7 @@ const Z0 = /* @__PURE__ */ tt(() => {
10602
10602
  ([e, t]) => ({ ...e, ...t }),
10603
10603
  ht(Of, Z0)
10604
10604
  ), eS = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), tS = { overflowAnchor: "none", position: Ba(), zIndex: 1 }, zf = { overflowAnchor: "none" }, nS = { ...zf, display: "inline-block", height: "100%" }, yc = /* @__PURE__ */ B.memo(function({ showTopList: e = !1 }) {
10605
- const t = je("listState"), n = en("sizeRanges"), r = je("useWindowScroll"), o = je("customScrollParent"), s = en("windowScrollContainerState"), i = en("scrollContainerState"), a = o || r ? s : i, l = je("itemContent"), c = je("context"), d = je("groupContent"), f = je("trackItemSizes"), p = je("itemSize"), h = je("log"), m = en("gap"), x = je("horizontalDirection"), { callbackRef: y } = x0(
10605
+ const t = _e("listState"), n = en("sizeRanges"), r = _e("useWindowScroll"), o = _e("customScrollParent"), s = en("windowScrollContainerState"), i = en("scrollContainerState"), a = o || r ? s : i, l = _e("itemContent"), c = _e("context"), d = _e("groupContent"), f = _e("trackItemSizes"), p = _e("itemSize"), h = _e("log"), m = en("gap"), x = _e("horizontalDirection"), { callbackRef: y } = x0(
10606
10606
  n,
10607
10607
  p,
10608
10608
  f,
@@ -10611,12 +10611,12 @@ const Z0 = /* @__PURE__ */ tt(() => {
10611
10611
  m,
10612
10612
  o,
10613
10613
  x,
10614
- je("skipAnimationFrameInResizeObserver")
10614
+ _e("skipAnimationFrameInResizeObserver")
10615
10615
  ), [g, w] = B.useState(0);
10616
10616
  Ua("deviation", (I) => {
10617
10617
  g !== I && w(I);
10618
10618
  });
10619
- const b = je("EmptyPlaceholder"), T = je("ScrollSeekPlaceholder") || eS, C = je("ListComponent"), S = je("ItemComponent"), k = je("GroupComponent"), E = je("computeItemKey"), N = je("isSeeking"), M = je("groupIndices").length > 0, j = je("alignToBottom"), P = je("initialItemFinalLocationReached"), $ = e ? {} : {
10619
+ const b = _e("EmptyPlaceholder"), T = _e("ScrollSeekPlaceholder") || eS, C = _e("ListComponent"), S = _e("ItemComponent"), k = _e("GroupComponent"), E = _e("computeItemKey"), N = _e("isSeeking"), M = _e("groupIndices").length > 0, j = _e("alignToBottom"), P = _e("initialItemFinalLocationReached"), $ = e ? {} : {
10620
10620
  boxSizing: "border-box",
10621
10621
  ...x ? {
10622
10622
  display: "inline-block",
@@ -10709,7 +10709,7 @@ function iS(e, t) {
10709
10709
  return { item: typeof e == "string" ? void 0 : t };
10710
10710
  }
10711
10711
  const aS = /* @__PURE__ */ B.memo(function() {
10712
- const e = je("HeaderComponent"), t = en("headerHeight"), n = je("HeaderFooterTag"), r = ir(
10712
+ const e = _e("HeaderComponent"), t = en("headerHeight"), n = _e("HeaderFooterTag"), r = ir(
10713
10713
  B.useMemo(
10714
10714
  () => (s) => {
10715
10715
  t($n(s, "height"));
@@ -10717,11 +10717,11 @@ const aS = /* @__PURE__ */ B.memo(function() {
10717
10717
  [t]
10718
10718
  ),
10719
10719
  !0,
10720
- je("skipAnimationFrameInResizeObserver")
10721
- ), o = je("context");
10720
+ _e("skipAnimationFrameInResizeObserver")
10721
+ ), o = _e("context");
10722
10722
  return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Lt(e, o) }) }) : null;
10723
10723
  }), lS = /* @__PURE__ */ B.memo(function() {
10724
- const e = je("FooterComponent"), t = en("footerHeight"), n = je("HeaderFooterTag"), r = ir(
10724
+ const e = _e("FooterComponent"), t = en("footerHeight"), n = _e("HeaderFooterTag"), r = ir(
10725
10725
  B.useMemo(
10726
10726
  () => (s) => {
10727
10727
  t($n(s, "height"));
@@ -10729,8 +10729,8 @@ const aS = /* @__PURE__ */ B.memo(function() {
10729
10729
  [t]
10730
10730
  ),
10731
10731
  !0,
10732
- je("skipAnimationFrameInResizeObserver")
10733
- ), o = je("context");
10732
+ _e("skipAnimationFrameInResizeObserver")
10733
+ ), o = _e("context");
10734
10734
  return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Lt(e, o) }) }) : null;
10735
10735
  });
10736
10736
  function Bf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
@@ -10786,27 +10786,27 @@ function Hf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
10786
10786
  });
10787
10787
  }
10788
10788
  const cS = ({ children: e }) => {
10789
- const t = B.useContext(Df), n = en("viewportHeight"), r = en("fixedItemHeight"), o = je("alignToBottom"), s = je("horizontalDirection"), i = B.useMemo(
10789
+ const t = B.useContext(Df), n = en("viewportHeight"), r = en("fixedItemHeight"), o = _e("alignToBottom"), s = _e("horizontalDirection"), i = B.useMemo(
10790
10790
  () => pf(n, (l) => $n(l, s ? "width" : "height")),
10791
10791
  [n, s]
10792
- ), a = ir(i, !0, je("skipAnimationFrameInResizeObserver"));
10792
+ ), a = ir(i, !0, _e("skipAnimationFrameInResizeObserver"));
10793
10793
  return B.useEffect(() => {
10794
10794
  t && (n(t.viewportHeight), r(t.itemHeight));
10795
10795
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "element", ref: a, style: Fs(o), children: e });
10796
10796
  }, uS = ({ children: e }) => {
10797
- const t = B.useContext(Df), n = en("windowViewportRect"), r = en("fixedItemHeight"), o = je("customScrollParent"), s = mf(
10797
+ const t = B.useContext(Df), n = en("windowViewportRect"), r = en("fixedItemHeight"), o = _e("customScrollParent"), s = mf(
10798
10798
  n,
10799
10799
  o,
10800
- je("skipAnimationFrameInResizeObserver")
10801
- ), i = je("alignToBottom");
10800
+ _e("skipAnimationFrameInResizeObserver")
10801
+ ), i = _e("alignToBottom");
10802
10802
  return B.useEffect(() => {
10803
10803
  t && (r(t.itemHeight), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
10804
10804
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "window", ref: s, style: Fs(i), children: e });
10805
10805
  }, dS = ({ children: e }) => {
10806
- const t = je("TopItemListComponent") || "div", n = je("headerHeight"), r = { ...sS, marginTop: `${n}px` }, o = je("context");
10806
+ const t = _e("TopItemListComponent") || "div", n = _e("headerHeight"), r = { ...sS, marginTop: `${n}px` }, o = _e("context");
10807
10807
  return /* @__PURE__ */ u.jsx(t, { style: r, ...Lt(t, o), children: e });
10808
10808
  }, fS = /* @__PURE__ */ B.memo(function(e) {
10809
- const t = je("useWindowScroll"), n = je("topItemsIndexes").length > 0, r = je("customScrollParent"), o = je("context");
10809
+ const t = _e("useWindowScroll"), n = _e("topItemsIndexes").length > 0, r = _e("customScrollParent"), o = _e("context");
10810
10810
  return /* @__PURE__ */ u.jsxs(r || t ? mS : hS, { ...e, context: o, children: [
10811
10811
  n && /* @__PURE__ */ u.jsx(dS, { children: /* @__PURE__ */ u.jsx(yc, { showTopList: !0 }) }),
10812
10812
  /* @__PURE__ */ u.jsxs(r || t ? uS : cS, { children: [
@@ -10818,7 +10818,7 @@ const cS = ({ children: e }) => {
10818
10818
  }), {
10819
10819
  Component: pS,
10820
10820
  useEmitter: Ua,
10821
- useEmitterValue: je,
10821
+ useEmitterValue: _e,
10822
10822
  usePublisher: en
10823
10823
  } = /* @__PURE__ */ Mf(
10824
10824
  Q0,
@@ -10879,7 +10879,7 @@ const cS = ({ children: e }) => {
10879
10879
  }
10880
10880
  },
10881
10881
  fS
10882
- ), hS = /* @__PURE__ */ Bf({ useEmitter: Ua, useEmitterValue: je, usePublisher: en }), mS = /* @__PURE__ */ Hf({ useEmitter: Ua, useEmitterValue: je, usePublisher: en }), gS = pS, xS = /* @__PURE__ */ tt(() => {
10882
+ ), hS = /* @__PURE__ */ Bf({ useEmitter: Ua, useEmitterValue: _e, usePublisher: en }), mS = /* @__PURE__ */ Hf({ useEmitter: Ua, useEmitterValue: _e, usePublisher: en }), gS = pS, xS = /* @__PURE__ */ tt(() => {
10883
10883
  const e = Z((c) => /* @__PURE__ */ u.jsxs("td", { children: [
10884
10884
  "Item $",
10885
10885
  c
@@ -10963,22 +10963,22 @@ const bS = /* @__PURE__ */ tt(
10963
10963
  it(
10964
10964
  V(
10965
10965
  m,
10966
- Fe(_),
10966
+ Be(_),
10967
10967
  Ie(([D, H]) => !!H)
10968
10968
  ),
10969
10969
  () => {
10970
- Le(J, !1);
10970
+ De(J, !1);
10971
10971
  }
10972
10972
  ), it(
10973
10973
  V(
10974
10974
  Rt(m, J, M, N, _, G),
10975
- Ie(([D, H, W, ie, , re]) => D && !H && W.height !== 0 && ie.height !== 0 && !re)
10975
+ Ie(([D, H, W, se, , re]) => D && !H && W.height !== 0 && se.height !== 0 && !re)
10976
10976
  ),
10977
10977
  ([, , , , D]) => {
10978
- Le(G, !0), La(1, () => {
10979
- Le(j, D);
10978
+ De(G, !0), La(1, () => {
10979
+ De(j, D);
10980
10980
  }), dn(V(c), () => {
10981
- Le(t, [0, 0]), Le(J, !0);
10981
+ De(t, [0, 0]), De(J, !0);
10982
10982
  });
10983
10983
  }
10984
10984
  ), me(
@@ -10991,13 +10991,13 @@ const bS = /* @__PURE__ */ tt(
10991
10991
  ), it(
10992
10992
  V(
10993
10993
  m,
10994
- Fe(X),
10994
+ Be(X),
10995
10995
  Ie(([, D]) => D != null)
10996
10996
  ),
10997
10997
  ([, D]) => {
10998
- D && (Le(N, D.viewport), Le(M, D.item), Le(F, D.gap), D.scrollTop > 0 && (Le(L, !0), dn(V(c, er(1)), (H) => {
10999
- Le(L, !1);
11000
- }), Le(l, { top: D.scrollTop })));
10998
+ D && (De(N, D.viewport), De(M, D.item), De(F, D.gap), D.scrollTop > 0 && (De(L, !0), dn(V(c, er(1)), (H) => {
10999
+ De(L, !1);
11000
+ }), De(l, { top: D.scrollTop })));
11001
11001
  }
11002
11002
  ), me(
11003
11003
  V(
@@ -11013,10 +11013,10 @@ const bS = /* @__PURE__ */ tt(
11013
11013
  Re(F, (D, H) => D && D.column === H.column && D.row === H.row),
11014
11014
  Re(c)
11015
11015
  ),
11016
- le(([D, H, W, ie]) => ({
11016
+ le(([D, H, W, se]) => ({
11017
11017
  gap: W,
11018
11018
  item: H,
11019
- scrollTop: ie,
11019
+ scrollTop: se,
11020
11020
  viewport: D
11021
11021
  }))
11022
11022
  ),
@@ -11040,26 +11040,26 @@ const bS = /* @__PURE__ */ tt(
11040
11040
  ([
11041
11041
  D,
11042
11042
  [H, W],
11043
- ie,
11043
+ se,
11044
11044
  re,
11045
- ze,
11046
- Ve,
11045
+ Le,
11046
+ Ke,
11047
11047
  Qe,
11048
11048
  ,
11049
11049
  oe,
11050
11050
  he
11051
11051
  ]) => {
11052
- const { column: Te, row: Be } = ie, { height: Ze, width: nt } = re, { width: $e } = ze;
11052
+ const { column: Te, row: He } = se, { height: Ze, width: nt } = re, { width: $e } = Le;
11053
11053
  if (Qe === 0 && (D === 0 || $e === 0))
11054
11054
  return vc;
11055
11055
  if (nt === 0) {
11056
- const Me = $a(he, D), At = Me + Math.max(Qe - 1, 0);
11057
- return vS(Sc(Me, At, Ve));
11056
+ const Oe = $a(he, D), At = Oe + Math.max(Qe - 1, 0);
11057
+ return vS(Sc(Oe, At, Ke));
11058
11058
  }
11059
- const He = Uf($e, nt, Te);
11060
- let Ke, rt;
11061
- oe ? H === 0 && W === 0 && Qe > 0 ? (Ke = 0, rt = Qe - 1) : (Ke = He * ns((H + Be) / (Ze + Be)), rt = He * wc((W + Be) / (Ze + Be)) - 1, rt = bi(D - 1, Br(rt, He - 1)), Ke = bi(rt, Br(0, Ke))) : (Ke = 0, rt = -1);
11062
- const It = Sc(Ke, rt, Ve), { bottom: ft, top: mt } = Cc(ze, ie, re, It), gt = wc(D / He), at = gt * Ze + (gt - 1) * Be - ft;
11059
+ const Ue = Uf($e, nt, Te);
11060
+ let qe, rt;
11061
+ oe ? H === 0 && W === 0 && Qe > 0 ? (qe = 0, rt = Qe - 1) : (qe = Ue * ns((H + He) / (Ze + He)), rt = Ue * wc((W + He) / (Ze + He)) - 1, rt = bi(D - 1, Br(rt, Ue - 1)), qe = bi(rt, Br(0, qe))) : (qe = 0, rt = -1);
11062
+ const It = Sc(qe, rt, Ke), { bottom: ft, top: mt } = Cc(Le, se, re, It), gt = wc(D / Ue), at = gt * Ze + (gt - 1) * He - ft;
11063
11063
  return { bottom: ft, itemHeight: Ze, items: It, itemWidth: nt, offsetBottom: at, offsetTop: mt, top: mt };
11064
11064
  }
11065
11065
  )
@@ -11076,9 +11076,9 @@ const bS = /* @__PURE__ */ tt(
11076
11076
  V(
11077
11077
  Rt(N, M, E, F),
11078
11078
  Ie(([D, H, { items: W }]) => W.length > 0 && H.height !== 0 && D.height !== 0),
11079
- le(([D, H, { items: W }, ie]) => {
11080
- const { bottom: re, top: ze } = Cc(D, ie, H, W);
11081
- return [ze, re];
11079
+ le(([D, H, { items: W }, se]) => {
11080
+ const { bottom: re, top: Le } = Cc(D, se, H, W);
11081
+ return [Le, re];
11082
11082
  }),
11083
11083
  pt(Qr)
11084
11084
  ),
@@ -11088,7 +11088,7 @@ const bS = /* @__PURE__ */ tt(
11088
11088
  me(
11089
11089
  V(
11090
11090
  c,
11091
- Fe(Ce),
11091
+ Be(Ce),
11092
11092
  le(([D, H]) => H || D !== 0)
11093
11093
  ),
11094
11094
  Ce
@@ -11097,10 +11097,10 @@ const bS = /* @__PURE__ */ tt(
11097
11097
  V(
11098
11098
  Rt(E, S),
11099
11099
  Ie(([{ items: D }]) => D.length > 0),
11100
- Fe(Ce),
11100
+ Be(Ce),
11101
11101
  Ie(([[D, H], W]) => {
11102
- const ie = D.items[D.items.length - 1].index === H - 1;
11103
- return (W || D.bottom > 0 && D.itemHeight > 0 && D.offsetBottom === 0 && D.items.length === H) && ie;
11102
+ const se = D.items[D.items.length - 1].index === H - 1;
11103
+ return (W || D.bottom > 0 && D.itemHeight > 0 && D.offsetBottom === 0 && D.items.length === H) && se;
11104
11104
  }),
11105
11105
  le(([[, D]]) => D - 1),
11106
11106
  pt()
@@ -11115,7 +11115,7 @@ const bS = /* @__PURE__ */ tt(
11115
11115
  ), ne = Yt(
11116
11116
  V(
11117
11117
  Re(E),
11118
- Fe(L),
11118
+ Be(L),
11119
11119
  Ie(([{ items: D }, H]) => D.length > 0 && !H),
11120
11120
  le(([{ items: D }]) => ({
11121
11121
  endIndex: D[D.length - 1].index,
@@ -11128,13 +11128,13 @@ const bS = /* @__PURE__ */ tt(
11128
11128
  me(ne, h.scrollSeekRangeChanged), me(
11129
11129
  V(
11130
11130
  j,
11131
- Fe(N, M, S, F),
11132
- le(([D, H, W, ie, re]) => {
11133
- const ze = Rf(D), { align: Ve, behavior: Qe, offset: oe } = ze;
11134
- let he = ze.index;
11135
- he === "LAST" && (he = ie - 1), he = Br(0, he, bi(ie - 1, he));
11131
+ Be(N, M, S, F),
11132
+ le(([D, H, W, se, re]) => {
11133
+ const Le = Rf(D), { align: Ke, behavior: Qe, offset: oe } = Le;
11134
+ let he = Le.index;
11135
+ he === "LAST" && (he = se - 1), he = Br(0, he, bi(se - 1, he));
11136
11136
  let Te = Gi(H, re, W, he);
11137
- return Ve === "end" ? Te = bc(Te - H.height + W.height) : Ve === "center" && (Te = bc(Te - H.height / 2 + W.height / 2)), oe && (Te += oe), { behavior: Qe, top: Te };
11137
+ return Ke === "end" ? Te = bc(Te - H.height + W.height) : Ke === "center" && (Te = bc(Te - H.height / 2 + W.height / 2)), oe && (Te += oe), { behavior: Qe, top: Te };
11138
11138
  })
11139
11139
  ),
11140
11140
  l
@@ -11710,7 +11710,7 @@ var Zf = "DialogTrigger", Qf = v.forwardRef(
11710
11710
  (e, t) => {
11711
11711
  const { __scopeDialog: n, ...r } = e, o = gn(Zf, n), s = Je(t, o.triggerRef);
11712
11712
  return /* @__PURE__ */ u.jsx(
11713
- Pe.button,
11713
+ je.button,
11714
11714
  {
11715
11715
  type: "button",
11716
11716
  "aria-haspopup": "dialog",
@@ -11746,7 +11746,7 @@ var WS = vr("DialogOverlay.RemoveScroll"), VS = v.forwardRef(
11746
11746
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
11747
11747
  // ie. when `Overlay` and `Content` are siblings
11748
11748
  /* @__PURE__ */ u.jsx(_s, { as: WS, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ u.jsx(
11749
- Pe.div,
11749
+ je.div,
11750
11750
  {
11751
11751
  "data-state": Ga(o.open),
11752
11752
  ...r,
@@ -11850,14 +11850,14 @@ var KS = v.forwardRef(
11850
11850
  ), qa = "DialogTitle", sp = v.forwardRef(
11851
11851
  (e, t) => {
11852
11852
  const { __scopeDialog: n, ...r } = e, o = gn(qa, n);
11853
- return /* @__PURE__ */ u.jsx(Pe.h2, { id: o.titleId, ...r, ref: t });
11853
+ return /* @__PURE__ */ u.jsx(je.h2, { id: o.titleId, ...r, ref: t });
11854
11854
  }
11855
11855
  );
11856
11856
  sp.displayName = qa;
11857
11857
  var ip = "DialogDescription", ap = v.forwardRef(
11858
11858
  (e, t) => {
11859
11859
  const { __scopeDialog: n, ...r } = e, o = gn(ip, n);
11860
- return /* @__PURE__ */ u.jsx(Pe.p, { id: o.descriptionId, ...r, ref: t });
11860
+ return /* @__PURE__ */ u.jsx(je.p, { id: o.descriptionId, ...r, ref: t });
11861
11861
  }
11862
11862
  );
11863
11863
  ap.displayName = ip;
@@ -11865,7 +11865,7 @@ var lp = "DialogClose", cp = v.forwardRef(
11865
11865
  (e, t) => {
11866
11866
  const { __scopeDialog: n, ...r } = e, o = gn(lp, n);
11867
11867
  return /* @__PURE__ */ u.jsx(
11868
- Pe.button,
11868
+ je.button,
11869
11869
  {
11870
11870
  type: "button",
11871
11871
  ...r,
@@ -13824,16 +13824,16 @@ const Oc = B.memo(function({
13824
13824
  default:
13825
13825
  return "text-[hsl(var(--chat-bubble-ai-text))]";
13826
13826
  }
13827
- }, [_]), W = ot(() => G ? "" : wC(t.content), [G, t]), ie = ot(() => G ? {} : Rp(t), [G, t]), re = ot(
13827
+ }, [_]), W = ot(() => G ? "" : wC(t.content), [G, t]), se = ot(() => G ? {} : Rp(t), [G, t]), re = ot(
13828
13828
  () => G ? [] : t.content.filter((U) => U.type === "image_url"),
13829
13829
  [G, t]
13830
- ), ze = ot(
13830
+ ), Le = ot(
13831
13831
  () => G ? [] : t.content.filter((U) => U.type === "file"),
13832
13832
  [G, t]
13833
- ), Ve = ot(
13833
+ ), Ke = ot(
13834
13834
  () => G ? [] : t.content.filter((U) => U.type === "interrupt"),
13835
13835
  [G, t]
13836
- ), Qe = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), oe = Ao(Qe), he = g == null ? void 0 : g.value, Te = ot(() => G ? "" : bC(t.content), [G, t]), Be = B.useCallback(async () => {
13836
+ ), Qe = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), oe = Ao(Qe), he = g == null ? void 0 : g.value, Te = ot(() => G ? "" : bC(t.content), [G, t]), He = B.useCallback(async () => {
13837
13837
  const U = J ? Te : W;
13838
13838
  async function ye(z) {
13839
13839
  if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
@@ -13877,7 +13877,7 @@ const Oc = B.memo(function({
13877
13877
  default:
13878
13878
  return /* @__PURE__ */ u.jsx(Qs, { className: ye });
13879
13879
  }
13880
- }, [L, H, _]), He = B.useCallback(() => {
13880
+ }, [L, H, _]), Ue = B.useCallback(() => {
13881
13881
  const U = "group relative mb-4 flex w-full";
13882
13882
  switch (_) {
13883
13883
  case "user":
@@ -13889,7 +13889,7 @@ const Oc = B.memo(function({
13889
13889
  default:
13890
13890
  return U;
13891
13891
  }
13892
- }, [_]), Ke = B.useCallback(() => {
13892
+ }, [_]), qe = B.useCallback(() => {
13893
13893
  const U = te(
13894
13894
  "rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
13895
13895
  L && "px-3 py-2 text-sm"
@@ -13930,7 +13930,7 @@ const Oc = B.memo(function({
13930
13930
  }
13931
13931
  }, [L, fe, _]);
13932
13932
  if (fe && G)
13933
- return /* @__PURE__ */ u.jsx("div", { className: te(He(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(Ke(), p.content), children: [
13933
+ return /* @__PURE__ */ u.jsx("div", { className: te(Ue(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(qe(), p.content), children: [
13934
13934
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
13935
13935
  /* @__PURE__ */ u.jsx(Qs, { className: te("h-4 w-4", H) }),
13936
13936
  a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
@@ -14027,11 +14027,11 @@ const Oc = B.memo(function({
14027
14027
  if (U.type === "interrupt") {
14028
14028
  const z = U, ee = Ao(
14029
14029
  (z == null ? void 0 : z.id) ?? (z == null ? void 0 : z.interrupt_id)
14030
- ), ge = !!(oe && ee && ee === oe), Ee = ge ? he ?? (z == null ? void 0 : z.value) : z == null ? void 0 : z.value, se = ee ? { ...z, id: ee, interrupt_id: ee } : z;
14030
+ ), ge = !!(oe && ee && ee === oe), Ee = ge ? he ?? (z == null ? void 0 : z.value) : z == null ? void 0 : z.value, ie = ee ? { ...z, id: ee, interrupt_id: ee } : z;
14031
14031
  return /* @__PURE__ */ u.jsx(
14032
14032
  TC,
14033
14033
  {
14034
- interruptPart: se,
14034
+ interruptPart: ie,
14035
14035
  onApprove: rt,
14036
14036
  onReject: It,
14037
14037
  disabled: w,
@@ -14056,13 +14056,13 @@ const Oc = B.memo(function({
14056
14056
  he,
14057
14057
  g,
14058
14058
  w,
14059
- Ve
14059
+ Ke
14060
14060
  ]), mt = B.useCallback(() => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 p-2 bg-muted/30 rounded", children: [
14061
14061
  /* @__PURE__ */ u.jsx(ki, { className: "h-4 w-4 text-muted-foreground" }),
14062
14062
  /* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
14063
14063
  ] }), []), gt = B.useCallback(() => {
14064
- const U = W.trim().length > 0 || re.length > 0 || ze.length > 0 || Ve.length > 0;
14065
- if (!J && ze.length > 0 && !r)
14064
+ const U = W.trim().length > 0 || re.length > 0 || Le.length > 0 || Ke.length > 0;
14065
+ if (!J && Le.length > 0 && !r)
14066
14066
  return mt();
14067
14067
  if (!J && !U && !r)
14068
14068
  return null;
@@ -14085,24 +14085,24 @@ const Oc = B.memo(function({
14085
14085
  }, [
14086
14086
  W,
14087
14087
  re.length,
14088
- ze.length,
14089
- Ve.length,
14088
+ Le.length,
14089
+ Ke.length,
14090
14090
  r,
14091
14091
  J,
14092
14092
  P,
14093
14093
  mt,
14094
14094
  H
14095
- ]), at = ot(() => G ? "Assistant" : SC(t), [G, t]), Me = B.useMemo(() => G ? [] : Array.isArray(C) ? C : [], [C, G]), At = B.useMemo(() => {
14095
+ ]), at = ot(() => G ? "Assistant" : SC(t), [G, t]), Oe = B.useMemo(() => G ? [] : Array.isArray(C) ? C : [], [C, G]), At = B.useMemo(() => {
14096
14096
  var U;
14097
- return Me.length ? E && Me.some((ye) => ye.id === E) ? E : ((U = Me[0]) == null ? void 0 : U.id) ?? null : null;
14098
- }, [E, Me]), Xt = B.useMemo(() => !Me.length || !S ? null : Me.some((U) => U.id === S) ? S : null, [S, Me]) ?? At, an = _ === "user" && Me.length > 0 && typeof k == "function", Ge = B.useCallback(
14097
+ return Oe.length ? E && Oe.some((ye) => ye.id === E) ? E : ((U = Oe[0]) == null ? void 0 : U.id) ?? null : null;
14098
+ }, [E, Oe]), Xt = B.useMemo(() => !Oe.length || !S ? null : Oe.some((U) => U.id === S) ? S : null, [S, Oe]) ?? At, an = _ === "user" && Oe.length > 0 && typeof k == "function", Ye = B.useCallback(
14099
14099
  (U) => {
14100
14100
  if (!k) return;
14101
14101
  const ye = (U == null ? void 0 : U.id) ?? null, z = (U == null ? void 0 : U.parentId) ?? N ?? null;
14102
14102
  k(ye, z);
14103
14103
  },
14104
14104
  [N, k]
14105
- ), Ae = B.useMemo(() => Xt ? Me.findIndex((U) => U.id === Xt) : -1, [Xt, Me]), Nt = B.useMemo(() => Ae < 0 ? null : Me[Ae] ?? null, [Ae, Me]), Bt = B.useCallback((U) => {
14105
+ ), Ae = B.useMemo(() => Xt ? Oe.findIndex((U) => U.id === Xt) : -1, [Xt, Oe]), Nt = B.useMemo(() => Ae < 0 ? null : Oe[Ae] ?? null, [Ae, Oe]), Bt = B.useCallback((U) => {
14106
14106
  const ye = [];
14107
14107
  if (U.step !== null && ye.push(`Step ${U.step}`), U.source && ye.push(U.source), !U.createdAt)
14108
14108
  return ye.length ? ye.join(" • ") : U.id.slice(0, 8);
@@ -14119,7 +14119,7 @@ const Oc = B.memo(function({
14119
14119
  return `${z}`;
14120
14120
  }, []);
14121
14121
  return J && !f ? null : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
14122
- /* @__PURE__ */ u.jsx("div", { className: te(He(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(Ke(), p.content), children: [
14122
+ /* @__PURE__ */ u.jsx("div", { className: te(Ue(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(qe(), p.content), children: [
14123
14123
  (i || a || J) && /* @__PURE__ */ u.jsxs(
14124
14124
  "div",
14125
14125
  {
@@ -14151,8 +14151,8 @@ const Oc = B.memo(function({
14151
14151
  (U.key === "Enter" || U.key === " ") && (U.preventDefault(), $((ye) => ye === "expanded" ? "preview" : "expanded"));
14152
14152
  },
14153
14153
  children: [
14154
- /* @__PURE__ */ u.jsx("span", { children: ie.name ?? "Tool Output" }),
14155
- ie.toolCallId && /* @__PURE__ */ u.jsx("span", { className: "opacity-70", children: ie.toolCallId.slice(0, 8) }),
14154
+ /* @__PURE__ */ u.jsx("span", { children: se.name ?? "Tool Output" }),
14155
+ se.toolCallId && /* @__PURE__ */ u.jsx("span", { className: "opacity-70", children: se.toolCallId.slice(0, 8) }),
14156
14156
  P === "expanded" ? /* @__PURE__ */ u.jsx(sa, { className: "h-3 w-3" }) : /* @__PURE__ */ u.jsx(ps, { className: "h-3 w-3" })
14157
14157
  ]
14158
14158
  }
@@ -14170,8 +14170,8 @@ const Oc = B.memo(function({
14170
14170
  ),
14171
14171
  onClick: () => {
14172
14172
  if (Ae <= 0) return;
14173
- const U = Me[Ae - 1];
14174
- U && Ge(U);
14173
+ const U = Oe[Ae - 1];
14174
+ U && Ye(U);
14175
14175
  },
14176
14176
  "aria-label": "Previous checkpoint",
14177
14177
  disabled: Ae <= 0,
@@ -14182,7 +14182,7 @@ const Oc = B.memo(function({
14182
14182
  /* @__PURE__ */ u.jsxs("span", { className: "whitespace-nowrap", children: [
14183
14183
  Ae + 1,
14184
14184
  " / ",
14185
- Me.length
14185
+ Oe.length
14186
14186
  ] }),
14187
14187
  /* @__PURE__ */ u.jsx("span", { className: "text-muted-foreground", children: Bt(Nt) })
14188
14188
  ] }),
@@ -14192,15 +14192,15 @@ const Oc = B.memo(function({
14192
14192
  type: "button",
14193
14193
  className: te(
14194
14194
  "flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
14195
- Ae < Me.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
14195
+ Ae < Oe.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
14196
14196
  ),
14197
14197
  onClick: () => {
14198
- if (Ae >= Me.length - 1) return;
14199
- const U = Me[Ae + 1];
14200
- U && Ge(U);
14198
+ if (Ae >= Oe.length - 1) return;
14199
+ const U = Oe[Ae + 1];
14200
+ U && Ye(U);
14201
14201
  },
14202
14202
  "aria-label": "Next checkpoint",
14203
- disabled: Ae >= Me.length - 1,
14203
+ disabled: Ae >= Oe.length - 1,
14204
14204
  children: /* @__PURE__ */ u.jsx(Uc, { className: "h-3 w-3" })
14205
14205
  }
14206
14206
  )
@@ -14228,7 +14228,7 @@ const Oc = B.memo(function({
14228
14228
  {
14229
14229
  variant: "ghost",
14230
14230
  size: "sm",
14231
- onClick: () => Be(),
14231
+ onClick: () => He(),
14232
14232
  className: te("h-6 w-6 p-0 hover:bg-foreground/10", H, L && "h-5 w-5"),
14233
14233
  "aria-label": "Copy message",
14234
14234
  title: "Copy message",
@@ -14265,14 +14265,14 @@ const Oc = B.memo(function({
14265
14265
  }
14266
14266
  ),
14267
14267
  /* @__PURE__ */ u.jsx("div", { className: "relative", children: gt() }),
14268
- J && P === "expanded" && (ie.toolCallId || ie.name) && /* @__PURE__ */ u.jsxs("div", { className: te("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", L && "text-xs"), children: [
14269
- ie.name && /* @__PURE__ */ u.jsxs("div", { children: [
14268
+ J && P === "expanded" && (se.toolCallId || se.name) && /* @__PURE__ */ u.jsxs("div", { className: te("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", L && "text-xs"), children: [
14269
+ se.name && /* @__PURE__ */ u.jsxs("div", { children: [
14270
14270
  "Function: ",
14271
- ie.name
14271
+ se.name
14272
14272
  ] }),
14273
- ie.toolCallId && /* @__PURE__ */ u.jsxs("div", { children: [
14273
+ se.toolCallId && /* @__PURE__ */ u.jsxs("div", { children: [
14274
14274
  "Call ID: ",
14275
- ie.toolCallId
14275
+ se.toolCallId
14276
14276
  ] })
14277
14277
  ] }),
14278
14278
  !(i || a || J) && s && !o && /* @__PURE__ */ u.jsxs(
@@ -14289,7 +14289,7 @@ const Oc = B.memo(function({
14289
14289
  {
14290
14290
  variant: "ghost",
14291
14291
  size: "sm",
14292
- onClick: () => Be(),
14292
+ onClick: () => He(),
14293
14293
  className: te("h-6 w-6 p-0 hover:bg-background/50 text-current", L && "h-5 w-5"),
14294
14294
  children: /* @__PURE__ */ u.jsx(ol, { className: te(M ? "text-success" : "text-current", L ? "h-3 w-3" : "h-4 w-4") })
14295
14295
  }
@@ -14670,7 +14670,7 @@ const IC = ({
14670
14670
  messagePreviews: P,
14671
14671
  createSyntheticThinkingMessage: $ = !1
14672
14672
  }, I) => {
14673
- const F = We(null), A = We(null), X = We(!1), [L, _] = ve(!0), J = ot(() => w ? e.some((oe) => "type" in oe && oe.type === "default_message" ? !1 : Array.isArray(oe == null ? void 0 : oe.content) && oe.content.some(
14673
+ const F = Ve(null), A = Ve(null), X = Ve(!1), [L, _] = ve(!0), J = ot(() => w ? e.some((oe) => "type" in oe && oe.type === "default_message" ? !1 : Array.isArray(oe == null ? void 0 : oe.content) && oe.content.some(
14674
14674
  (he) => he && he.type === "interrupt" && (he.id ?? he.interrupt_id) === w.id
14675
14675
  )) : !1, [w, e]), G = ot(() => {
14676
14676
  if (!w || J)
@@ -14679,8 +14679,8 @@ const IC = ({
14679
14679
  let he;
14680
14680
  const Te = w.value;
14681
14681
  if (Te && typeof Te == "object" && !Array.isArray(Te)) {
14682
- const Be = Te.title;
14683
- typeof Be == "string" && Be.trim() && (he = Be.trim());
14682
+ const He = Te.title;
14683
+ typeof He == "string" && He.trim() && (he = He.trim());
14684
14684
  }
14685
14685
  return {
14686
14686
  id: `interrupt-${oe}`,
@@ -14706,13 +14706,13 @@ const IC = ({
14706
14706
  ] : fe, [fe, t, $]), Ne = ot(() => S ? Ce : Ce.filter((oe) => (oe == null ? void 0 : oe.role) !== "tool"), [Ce, S]), q = ot(() => {
14707
14707
  const oe = /* @__PURE__ */ new Set(), he = [];
14708
14708
  for (let Te = Ne.length - 1; Te >= 0; Te--) {
14709
- const Be = Ne[Te];
14710
- if (!Be) continue;
14711
- if ("type" in Be && Be.type === "default_message") {
14712
- he.push(Be);
14709
+ const He = Ne[Te];
14710
+ if (!He) continue;
14711
+ if ("type" in He && He.type === "default_message") {
14712
+ he.push(He);
14713
14713
  continue;
14714
14714
  }
14715
- const Ze = Be, nt = NC(Ze);
14715
+ const Ze = He, nt = NC(Ze);
14716
14716
  oe.has(nt) || (oe.add(nt), he.push(Ze));
14717
14717
  }
14718
14718
  return he.reverse();
@@ -14730,7 +14730,7 @@ const IC = ({
14730
14730
  }
14731
14731
  }
14732
14732
  };
14733
- }, [a]), D = ot(() => !m || x ? !1 : L ? "auto" : !1, [L, m, x]), H = j ?? [], W = H.length > 0, ie = ot(() => {
14733
+ }, [a]), D = ot(() => !m || x ? !1 : L ? "auto" : !1, [L, m, x]), H = j ?? [], W = H.length > 0, se = ot(() => {
14734
14734
  if (typeof h != "string") return null;
14735
14735
  const oe = h.trim();
14736
14736
  return oe ? {
@@ -14748,10 +14748,10 @@ const IC = ({
14748
14748
  onSelectCheckpoint: M,
14749
14749
  messagePreviews: P
14750
14750
  }
14751
- ) : null, ze = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), Ve = () => ie ? /* @__PURE__ */ u.jsx("div", { className: "p-6 h-full overflow-y-auto", children: /* @__PURE__ */ u.jsx("div", { className: "w-full max-w-full", children: /* @__PURE__ */ u.jsx(
14751
+ ) : null, Le = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), Ke = () => se ? /* @__PURE__ */ u.jsx("div", { className: "p-6 h-full overflow-y-auto", children: /* @__PURE__ */ u.jsx("div", { className: "w-full max-w-full", children: /* @__PURE__ */ u.jsx(
14752
14752
  Oc,
14753
14753
  {
14754
- message: ie,
14754
+ message: se,
14755
14755
  messageIndex: 0,
14756
14756
  isStreamingMessage: !1,
14757
14757
  showActions: !1,
@@ -14790,7 +14790,7 @@ const IC = ({
14790
14790
  }
14791
14791
  }),
14792
14792
  [q]
14793
- ), /* @__PURE__ */ u.jsxs("div", { className: ze, style: p, children: [
14793
+ ), /* @__PURE__ */ u.jsxs("div", { className: Le, style: p, children: [
14794
14794
  re,
14795
14795
  /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: Qe ? /* @__PURE__ */ u.jsx(
14796
14796
  gS,
@@ -14816,23 +14816,23 @@ const IC = ({
14816
14816
  computeItemKey: (oe, he) => Mc(he, oe),
14817
14817
  itemContent: (oe, he) => {
14818
14818
  var ft;
14819
- const Te = Mc(he, oe), Be = "type" in he && he.type === "default_message";
14820
- let Ze = [], nt = null, $e = {}, He = {}, Ke = null, rt = null;
14821
- if (!Be) {
14819
+ const Te = Mc(he, oe), He = "type" in he && he.type === "default_message";
14820
+ let Ze = [], nt = null, $e = {}, Ue = {}, qe = null, rt = null;
14821
+ if (!He) {
14822
14822
  const mt = he, gt = mt.checkpointId ?? null;
14823
- $e = mt.additionalKwargs ?? {}, He = mt.responseMetadata ?? {};
14823
+ $e = mt.additionalKwargs ?? {}, Ue = mt.responseMetadata ?? {};
14824
14824
  const at = gt && k ? k.get(gt) ?? null : null;
14825
- Ke = typeof $e.step == "number" ? $e.step : typeof He.step == "number" ? He.step : (at == null ? void 0 : at.step) ?? null;
14826
- const Me = typeof $e.source == "string" ? $e.source : typeof He.source == "string" ? He.source : (at == null ? void 0 : at.source) ?? null;
14827
- rt = Me ? String(Me) : null;
14828
- const At = Ke !== null && rt ? `${Ke}:${rt}` : null;
14825
+ qe = typeof $e.step == "number" ? $e.step : typeof Ue.step == "number" ? Ue.step : (at == null ? void 0 : at.step) ?? null;
14826
+ const Oe = typeof $e.source == "string" ? $e.source : typeof Ue.source == "string" ? Ue.source : (at == null ? void 0 : at.source) ?? null;
14827
+ rt = Oe ? String(Oe) : null;
14828
+ const At = qe !== null && rt ? `${qe}:${rt}` : null;
14829
14829
  At && (E != null && E.has(At)) ? Ze = E.get(At) ?? [] : gt && at && (Ze = [at]), nt = gt ?? ((ft = Ze[0]) == null ? void 0 : ft.id) ?? null;
14830
14830
  }
14831
14831
  const It = (() => {
14832
14832
  if (typeof $e.parentCheckpointId == "string")
14833
14833
  return $e.parentCheckpointId;
14834
- if (typeof He.parentCheckpointId == "string")
14835
- return He.parentCheckpointId;
14834
+ if (typeof Ue.parentCheckpointId == "string")
14835
+ return Ue.parentCheckpointId;
14836
14836
  })();
14837
14837
  return /* @__PURE__ */ u.jsx(
14838
14838
  "div",
@@ -14874,7 +14874,7 @@ const IC = ({
14874
14874
  );
14875
14875
  }
14876
14876
  }
14877
- ) : Ve() })
14877
+ ) : Ke() })
14878
14878
  ] });
14879
14879
  });
14880
14880
  Ip.displayName = "MessageList";
@@ -14919,9 +14919,9 @@ function Ti({
14919
14919
  Ne(!0);
14920
14920
  }, []), ne = Se(() => {
14921
14921
  Ne(!1);
14922
- }, []), Y = !!fe || Ce, [D, H] = ve(null), [W, ie] = ve(""), [re, ze] = ve(null), [Ve, Qe] = ve(null), [oe, he] = ve([]), [Te, Be] = ve(0), [Ze, nt] = ve(0), [$e, He] = ve(!1), [Ke, rt] = ve(null), [It, ft] = ve(null), [mt, gt] = ve(!1), [at, Me] = ve(null), At = We(!1), [_t, Xt] = ve(() => Dc.value), an = We(_t), Ge = We(null), Ae = Se((Q) => {
14922
+ }, []), Y = !!fe || Ce, [D, H] = ve(null), [W, se] = ve(""), [re, Le] = ve(null), [Ke, Qe] = ve(null), [oe, he] = ve([]), [Te, He] = ve(0), [Ze, nt] = ve(0), [$e, Ue] = ve(!1), [qe, rt] = ve(null), [It, ft] = ve(null), [mt, gt] = ve(!1), [at, Oe] = ve(null), At = Ve(!1), [_t, Xt] = ve(() => Dc.value), an = Ve(_t), Ye = Ve(null), Ae = Se((Q) => {
14923
14923
  Dc.value = Q, Xt(Q);
14924
- }, []), [Nt, Bt] = ve(!1), U = We(null), ye = Se(
14924
+ }, []), [Nt, Bt] = ve(!1), U = Ve(null), ye = Se(
14925
14925
  (Q, ue) => {
14926
14926
  if (!Q || typeof Q != "object") return null;
14927
14927
  const de = Q[ue];
@@ -14991,17 +14991,17 @@ function Ti({
14991
14991
  return (ct.createdAt ?? "").localeCompare(xt);
14992
14992
  });
14993
14993
  return { checkpointMetaById: Q, checkpointIndexByKey: ue };
14994
- }, [ee, ye, z]), se = j ?? [], Ye = We(null), _e = We(null), De = Se(() => {
14995
- Ye.current && (Ye.current.value = ""), _e.current && (_e.current.value = ""), Be((Q) => Q + 1), nt((Q) => Q + 1);
14994
+ }, [ee, ye, z]), ie = j ?? [], ze = Ve(null), Fe = Ve(null), Me = Se(() => {
14995
+ ze.current && (ze.current.value = ""), Fe.current && (Fe.current.value = ""), He((Q) => Q + 1), nt((Q) => Q + 1);
14996
14996
  }, []), Jt = Se(
14997
14997
  (Q) => {
14998
14998
  Ae(Q);
14999
14999
  },
15000
15000
  [Ae]
15001
- ), wt = We(!1);
15001
+ ), wt = Ve(!1);
15002
15002
  Tt(() => {
15003
- wt.current && !$ && (he([]), De()), wt.current = $;
15004
- }, [$, De]);
15003
+ wt.current && !$ && (he([]), Me()), wt.current = $;
15004
+ }, [$, Me]);
15005
15005
  const [En, Xs] = ve("desktop");
15006
15006
  Tt(() => {
15007
15007
  const Q = () => {
@@ -15015,21 +15015,21 @@ function Ti({
15015
15015
  an.current = _t;
15016
15016
  }, [_t]), Tt(() => {
15017
15017
  if (!D) {
15018
- Ge.current = null;
15018
+ Ye.current = null;
15019
15019
  return;
15020
15020
  }
15021
- Ge.current === null && (Ge.current = an.current), Ae(W ?? "");
15021
+ Ye.current === null && (Ye.current = an.current), Ae(W ?? "");
15022
15022
  }, [W, D, Ae]), Tt(() => {
15023
15023
  (async () => {
15024
15024
  if (!x.baseUrl) {
15025
- Me(null);
15025
+ Oe(null);
15026
15026
  return;
15027
15027
  }
15028
15028
  try {
15029
15029
  const de = (await x.getAgent("default")).uiDefaultMessage || "";
15030
- Me(de || null);
15030
+ Oe(de || null);
15031
15031
  } catch (ue) {
15032
- console.warn("Failed to fetch default message:", ue), Me(null);
15032
+ console.warn("Failed to fetch default message:", ue), Oe(null);
15033
15033
  }
15034
15034
  })();
15035
15035
  }, [x.baseUrl]), Tt(() => {
@@ -15070,7 +15070,7 @@ function Ti({
15070
15070
  checkpointId: de,
15071
15071
  checkpointNs: we
15072
15072
  }
15073
- ), p == null || p(ue), Ae(""), Qe(null), he([]), De(), H(null), ie(""), ze(null);
15073
+ ), p == null || p(ue), Ae(""), Qe(null), he([]), Me(), H(null), se(""), Le(null);
15074
15074
  } catch (de) {
15075
15075
  const we = (de == null ? void 0 : de.message) || "Failed to send message";
15076
15076
  Qe(we), m == null || m(we);
@@ -15078,14 +15078,14 @@ function Ti({
15078
15078
  }
15079
15079
  }, xo = B.useCallback(
15080
15080
  (Q, ue, de) => {
15081
- c && (Ge.current = _t, H(Q), ie(ue), Ae(ue), Qe(null), ze({
15081
+ c && (Ye.current = _t, H(Q), se(ue), Ae(ue), Qe(null), Le({
15082
15082
  checkpointId: (de == null ? void 0 : de.checkpointId) ?? null,
15083
15083
  checkpointNs: (de == null ? void 0 : de.checkpointNs) ?? null
15084
15084
  }));
15085
15085
  },
15086
15086
  [_t, c, Ae]
15087
15087
  ), R = B.useCallback(() => {
15088
- H(null), ie(""), ze(null), Qe(null), Ae(Ge.current ?? _t), Ge.current = null;
15088
+ H(null), se(""), Le(null), Qe(null), Ae(Ye.current ?? _t), Ye.current = null;
15089
15089
  }, [_t, Ae]), K = Se(
15090
15090
  (Q, ue, de) => {
15091
15091
  xo(Q, ue, de);
@@ -15116,12 +15116,12 @@ function Ti({
15116
15116
  }, et = (Q) => {
15117
15117
  he((ue) => {
15118
15118
  const de = ue.filter((we, ct) => Q !== ct);
15119
- return de.length === 0 && De(), de;
15119
+ return de.length === 0 && Me(), de;
15120
15120
  });
15121
15121
  }, lt = async (Q) => {
15122
15122
  const ue = (Q.target.files || [])[0];
15123
15123
  if (ue) {
15124
- rt(null), ft(null), He(!0);
15124
+ rt(null), ft(null), Ue(!0);
15125
15125
  try {
15126
15126
  await A(
15127
15127
  { attachments: [ue] },
@@ -15136,10 +15136,10 @@ function Ti({
15136
15136
  const we = de instanceof Error ? de.message : "Failed to upload Excel file";
15137
15137
  console.error("Excel upload failed", de), rt(we), m == null || m(we);
15138
15138
  } finally {
15139
- He(!1), Q.target.value = "", De();
15139
+ Ue(!1), Q.target.value = "", Me();
15140
15140
  }
15141
15141
  }
15142
- }, qe = async (Q) => {
15142
+ }, Ge = async (Q) => {
15143
15143
  if (y) {
15144
15144
  Bt(!0);
15145
15145
  try {
@@ -15159,11 +15159,11 @@ function Ti({
15159
15159
  Bt(!1);
15160
15160
  }
15161
15161
  }
15162
- }, Ue = Se(
15162
+ }, We = Se(
15163
15163
  async (Q) => {
15164
- await qe(Q);
15164
+ await Ge(Q);
15165
15165
  },
15166
- [qe]
15166
+ [Ge]
15167
15167
  ), jt = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${f.container || ""}`, bt = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 bg-transparent ${f.messagesArea || ""}`, St = `flex-shrink-0 w-full border-t p-4 bg-transparent ${f.inputArea || ""}`;
15168
15168
  return Se(
15169
15169
  (Q) => {
@@ -15223,8 +15223,8 @@ function Ti({
15223
15223
  checkpointMetaById: ge,
15224
15224
  checkpointIndexByKey: Ee,
15225
15225
  activeCheckpointId: _,
15226
- onSelectCheckpoint: Ue,
15227
- timelineCheckpoints: se,
15226
+ onSelectCheckpoint: We,
15227
+ timelineCheckpoints: ie,
15228
15228
  messagePreviews: P
15229
15229
  }
15230
15230
  ),
@@ -15266,7 +15266,7 @@ function Ti({
15266
15266
  /* @__PURE__ */ u.jsx(
15267
15267
  "input",
15268
15268
  {
15269
- ref: Ye,
15269
+ ref: ze,
15270
15270
  type: "file",
15271
15271
  multiple: !0,
15272
15272
  onChange: (Q) => ke(Q),
@@ -15294,7 +15294,7 @@ function Ti({
15294
15294
  /* @__PURE__ */ u.jsx(
15295
15295
  "input",
15296
15296
  {
15297
- ref: _e,
15297
+ ref: Fe,
15298
15298
  type: "file",
15299
15299
  accept: ".xls,.xlsx,.xlsm",
15300
15300
  onChange: lt,
@@ -15307,10 +15307,10 @@ function Ti({
15307
15307
  " Uploading Excel file..."
15308
15308
  ] }),
15309
15309
  It && !$e && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: It }),
15310
- Ke && !$e && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: Ke })
15310
+ qe && !$e && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: qe })
15311
15311
  ] })
15312
15312
  ] }),
15313
- Ve && /* @__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: Ve }),
15313
+ Ke && /* @__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: Ke }),
15314
15314
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
15315
15315
  (a || l) && /* @__PURE__ */ u.jsxs(Xb, { children: [
15316
15316
  /* @__PURE__ */ u.jsx(Jb, { asChild: !0, children: /* @__PURE__ */ u.jsx(
@@ -15328,7 +15328,7 @@ function Ti({
15328
15328
  /* @__PURE__ */ u.jsxs(df, { align: "start", sideOffset: 6, className: "w-52", children: [
15329
15329
  a && /* @__PURE__ */ u.jsxs(Hi, { onClick: () => {
15330
15330
  var Q;
15331
- return (Q = Ye.current) == null ? void 0 : Q.click();
15331
+ return (Q = ze.current) == null ? void 0 : Q.click();
15332
15332
  }, className: "cursor-pointer", children: [
15333
15333
  /* @__PURE__ */ u.jsx(ki, { className: "h-4 w-4 mr-2" }),
15334
15334
  " Attach files or images"
@@ -15338,7 +15338,7 @@ function Ti({
15338
15338
  {
15339
15339
  onClick: () => {
15340
15340
  var Q;
15341
- $e || (Q = _e.current) == null || Q.click();
15341
+ $e || (Q = Fe.current) == null || Q.click();
15342
15342
  },
15343
15343
  className: `cursor-pointer ${$e ? "opacity-60 pointer-events-none" : ""}`,
15344
15344
  children: [
@@ -15364,7 +15364,7 @@ function Ti({
15364
15364
  onCancelEdit: R,
15365
15365
  onStop: X,
15366
15366
  allowEmptySend: oe.length > 0,
15367
- textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${D ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${Ve ? "border-red-400" : ""} ${f.textarea || ""}`
15367
+ textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${D ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${Ke ? "border-red-400" : ""} ${f.textarea || ""}`
15368
15368
  }
15369
15369
  ) })
15370
15370
  ] })
@@ -15424,7 +15424,7 @@ var Ja = "ScrollArea", [Np, xk] = Pn(Ja), [_C, sn] = Np(Ja), Ap = v.forwardRef(
15424
15424
  onCornerWidthChange: w,
15425
15425
  onCornerHeightChange: T,
15426
15426
  children: /* @__PURE__ */ u.jsx(
15427
- Pe.div,
15427
+ je.div,
15428
15428
  {
15429
15429
  dir: M,
15430
15430
  ...i,
@@ -15457,7 +15457,7 @@ var _p = "ScrollAreaViewport", jp = v.forwardRef(
15457
15457
  }
15458
15458
  ),
15459
15459
  /* @__PURE__ */ u.jsx(
15460
- Pe.div,
15460
+ je.div,
15461
15461
  {
15462
15462
  "data-radix-scroll-area-viewport": "",
15463
15463
  ...s,
@@ -15746,7 +15746,7 @@ var jC = v.forwardRef((e, t) => {
15746
15746
  onThumbPositionChange: S,
15747
15747
  onThumbPointerDown: Pt(a),
15748
15748
  children: /* @__PURE__ */ u.jsx(
15749
- Pe.div,
15749
+ je.div,
15750
15750
  {
15751
15751
  ...p,
15752
15752
  ref: y,
@@ -15788,7 +15788,7 @@ var jC = v.forwardRef((e, t) => {
15788
15788
  return a(), f.addEventListener("scroll", p), () => f.removeEventListener("scroll", p);
15789
15789
  }
15790
15790
  }, [s.viewport, d, a]), /* @__PURE__ */ u.jsx(
15791
- Pe.div,
15791
+ je.div,
15792
15792
  {
15793
15793
  "data-state": i.hasThumb ? "visible" : "hidden",
15794
15794
  ...o,
@@ -15826,7 +15826,7 @@ var $C = v.forwardRef((e, t) => {
15826
15826
  const d = ((f = o.scrollbarY) == null ? void 0 : f.offsetWidth) || 0;
15827
15827
  o.onCornerWidthChange(d), i(d);
15828
15828
  }), c ? /* @__PURE__ */ u.jsx(
15829
- Pe.div,
15829
+ je.div,
15830
15830
  {
15831
15831
  ...r,
15832
15832
  ref: t,
@@ -15950,7 +15950,7 @@ function Fc({
15950
15950
  setCurrentThreadId: h,
15951
15951
  isLoading: m,
15952
15952
  actions: x
15953
- } = da(), { loadThread: y } = fa(), { createThread: g, deleteThread: w, renameThread: b } = x, [T, C] = ve(Array.isArray(f) ? f : []), S = We(T.length > 0), k = We(null), E = We(0), [N, M] = ve(null), [j, P] = ve(""), [$, I] = ve(!1);
15953
+ } = da(), { loadThread: y } = fa(), { createThread: g, deleteThread: w, renameThread: b } = x, [T, C] = ve(Array.isArray(f) ? f : []), S = Ve(T.length > 0), k = Ve(null), E = Ve(0), [N, M] = ve(null), [j, P] = ve(""), [$, I] = ve(!1);
15954
15954
  Tt(() => {
15955
15955
  const q = Array.isArray(f) ? f : [];
15956
15956
  if (q.length > 0) {
@@ -16196,7 +16196,7 @@ function vk(e) {
16196
16196
  }), qC(e);
16197
16197
  }
16198
16198
  var GC = "Label", Gp = v.forwardRef((e, t) => /* @__PURE__ */ u.jsx(
16199
- Pe.label,
16199
+ je.label,
16200
16200
  {
16201
16201
  ...e,
16202
16202
  ref: t,
@@ -16244,7 +16244,7 @@ var Ks = "Switch", [XC, wk] = Pn(Ks), [JC, ZC] = XC(Ks), Jp = v.forwardRef(
16244
16244
  });
16245
16245
  return /* @__PURE__ */ u.jsxs(JC, { scope: n, checked: g, disabled: a, children: [
16246
16246
  /* @__PURE__ */ u.jsx(
16247
- Pe.button,
16247
+ je.button,
16248
16248
  {
16249
16249
  type: "button",
16250
16250
  role: "switch",
@@ -16283,7 +16283,7 @@ var Zp = "SwitchThumb", Qp = v.forwardRef(
16283
16283
  (e, t) => {
16284
16284
  const { __scopeSwitch: n, ...r } = e, o = ZC(Zp, n);
16285
16285
  return /* @__PURE__ */ u.jsx(
16286
- Pe.span,
16286
+ je.span,
16287
16287
  {
16288
16288
  "data-state": th(o.checked),
16289
16289
  "data-disabled": o.disabled ? "" : void 0,
@@ -16374,7 +16374,7 @@ var rh = Object.freeze({
16374
16374
  wordWrap: "normal"
16375
16375
  }), tT = "VisuallyHidden", nT = v.forwardRef(
16376
16376
  (e, t) => /* @__PURE__ */ u.jsx(
16377
- Pe.span,
16377
+ je.span,
16378
16378
  {
16379
16379
  ...e,
16380
16380
  ref: t,
@@ -16485,7 +16485,7 @@ var sh = "SelectTrigger", ih = v.forwardRef(
16485
16485
  });
16486
16486
  };
16487
16487
  return /* @__PURE__ */ u.jsx(ed, { asChild: !0, ...s, children: /* @__PURE__ */ u.jsx(
16488
- Pe.button,
16488
+ je.button,
16489
16489
  {
16490
16490
  type: "button",
16491
16491
  role: "combobox",
@@ -16523,7 +16523,7 @@ var ah = "SelectValue", lh = v.forwardRef(
16523
16523
  return Ot(() => {
16524
16524
  c(d);
16525
16525
  }, [c, d]), /* @__PURE__ */ u.jsx(
16526
- Pe.span,
16526
+ je.span,
16527
16527
  {
16528
16528
  ...a,
16529
16529
  ref: f,
@@ -16537,7 +16537,7 @@ lh.displayName = ah;
16537
16537
  var cT = "SelectIcon", ch = v.forwardRef(
16538
16538
  (e, t) => {
16539
16539
  const { __scopeSelect: n, children: r, ...o } = e;
16540
- return /* @__PURE__ */ u.jsx(Pe.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
16540
+ return /* @__PURE__ */ u.jsx(je.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
16541
16541
  }
16542
16542
  );
16543
16543
  ch.displayName = cT;
@@ -16589,9 +16589,9 @@ var cn = 10, [fh, Vn] = Ar(rr), dT = "SelectContentImpl", fT = vr("SelectContent
16589
16589
  }, [b]), ma();
16590
16590
  const A = v.useCallback(
16591
16591
  (Y) => {
16592
- const [D, ...H] = P().map((re) => re.ref.current), [W] = H.slice(-1), ie = document.activeElement;
16592
+ const [D, ...H] = P().map((re) => re.ref.current), [W] = H.slice(-1), se = document.activeElement;
16593
16593
  for (const re of Y)
16594
- if (re === ie || (re == null || re.scrollIntoView({ block: "nearest" }), re === D && C && (C.scrollTop = 0), re === W && C && (C.scrollTop = C.scrollHeight), re == null || re.focus(), document.activeElement !== ie)) return;
16594
+ if (re === se || (re == null || re.scrollIntoView({ block: "nearest" }), re === D && C && (C.scrollTop = 0), re === W && C && (C.scrollTop = C.scrollHeight), re == null || re.focus(), document.activeElement !== se)) return;
16595
16595
  },
16596
16596
  [P, C]
16597
16597
  ), X = v.useCallback(
@@ -16606,9 +16606,9 @@ var cn = 10, [fh, Vn] = Ar(rr), dT = "SelectContentImpl", fT = vr("SelectContent
16606
16606
  if (b) {
16607
16607
  let Y = { x: 0, y: 0 };
16608
16608
  const D = (W) => {
16609
- var ie, re;
16609
+ var se, re;
16610
16610
  Y = {
16611
- x: Math.abs(Math.round(W.pageX) - (((ie = _.current) == null ? void 0 : ie.x) ?? 0)),
16611
+ x: Math.abs(Math.round(W.pageX) - (((se = _.current) == null ? void 0 : se.x) ?? 0)),
16612
16612
  y: Math.abs(Math.round(W.pageY) - (((re = _.current) == null ? void 0 : re.y) ?? 0))
16613
16613
  };
16614
16614
  }, H = (W) => {
@@ -16625,7 +16625,7 @@ var cn = 10, [fh, Vn] = Ar(rr), dT = "SelectContentImpl", fT = vr("SelectContent
16625
16625
  };
16626
16626
  }, [L]);
16627
16627
  const [J, G] = Ah((Y) => {
16628
- const D = P().filter((ie) => !ie.disabled), H = D.find((ie) => ie.ref.current === document.activeElement), W = _h(D, Y, H);
16628
+ const D = P().filter((se) => !se.disabled), H = D.find((se) => se.ref.current === document.activeElement), W = _h(D, Y, H);
16629
16629
  W && setTimeout(() => W.ref.current.focus());
16630
16630
  }), fe = v.useCallback(
16631
16631
  (Y, D, H) => {
@@ -16711,9 +16711,9 @@ var cn = 10, [fh, Vn] = Ar(rr), dT = "SelectContentImpl", fT = vr("SelectContent
16711
16711
  onKeyDown: pe(g.onKeyDown, (Y) => {
16712
16712
  const D = Y.ctrlKey || Y.altKey || Y.metaKey;
16713
16713
  if (Y.key === "Tab" && Y.preventDefault(), !D && Y.key.length === 1 && G(Y.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(Y.key)) {
16714
- let W = P().filter((ie) => !ie.disabled).map((ie) => ie.ref.current);
16714
+ let W = P().filter((se) => !se.disabled).map((se) => se.ref.current);
16715
16715
  if (["ArrowUp", "End"].includes(Y.key) && (W = W.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(Y.key)) {
16716
- const ie = Y.target, re = W.indexOf(ie);
16716
+ const se = Y.target, re = W.indexOf(se);
16717
16717
  W = W.slice(re + 1);
16718
16718
  }
16719
16719
  setTimeout(() => A(W)), Y.preventDefault();
@@ -16735,7 +16735,7 @@ var pT = "SelectItemAlignedPosition", hh = v.forwardRef((e, t) => {
16735
16735
  if (s.trigger && s.valueNode && a && c && x && y && g) {
16736
16736
  const k = s.trigger.getBoundingClientRect(), E = c.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(), M = g.getBoundingClientRect();
16737
16737
  if (s.dir !== "rtl") {
16738
- const ie = M.left - E.left, re = N.left - ie, ze = k.left - re, Ve = k.width + ze, Qe = Math.max(Ve, E.width), oe = window.innerWidth - cn, he = Yi(re, [
16738
+ const se = M.left - E.left, re = N.left - se, Le = k.left - re, Ke = k.width + Le, Qe = Math.max(Ke, E.width), oe = window.innerWidth - cn, he = Yi(re, [
16739
16739
  cn,
16740
16740
  // Prevents the content from going off the starting edge of the
16741
16741
  // viewport. It may still go off the ending edge, but this can be
@@ -16744,33 +16744,33 @@ var pT = "SelectItemAlignedPosition", hh = v.forwardRef((e, t) => {
16744
16744
  // https://github.com/radix-ui/primitives/issues/2049
16745
16745
  Math.max(cn, oe - Qe)
16746
16746
  ]);
16747
- a.style.minWidth = Ve + "px", a.style.left = he + "px";
16747
+ a.style.minWidth = Ke + "px", a.style.left = he + "px";
16748
16748
  } else {
16749
- const ie = E.right - M.right, re = window.innerWidth - N.right - ie, ze = window.innerWidth - k.right - re, Ve = k.width + ze, Qe = Math.max(Ve, E.width), oe = window.innerWidth - cn, he = Yi(re, [
16749
+ const se = E.right - M.right, re = window.innerWidth - N.right - se, Le = window.innerWidth - k.right - re, Ke = k.width + Le, Qe = Math.max(Ke, E.width), oe = window.innerWidth - cn, he = Yi(re, [
16750
16750
  cn,
16751
16751
  Math.max(cn, oe - Qe)
16752
16752
  ]);
16753
- a.style.minWidth = Ve + "px", a.style.right = he + "px";
16753
+ a.style.minWidth = Ke + "px", a.style.right = he + "px";
16754
16754
  }
16755
16755
  const j = p(), P = window.innerHeight - cn * 2, $ = x.scrollHeight, I = window.getComputedStyle(c), F = parseInt(I.borderTopWidth, 10), A = parseInt(I.paddingTop, 10), X = parseInt(I.borderBottomWidth, 10), L = parseInt(I.paddingBottom, 10), _ = F + A + $ + L + X, J = Math.min(y.offsetHeight * 5, _), G = window.getComputedStyle(x), fe = parseInt(G.paddingTop, 10), Ce = parseInt(G.paddingBottom, 10), Ne = k.top + k.height / 2 - cn, q = P - Ne, ne = y.offsetHeight / 2, Y = y.offsetTop + ne, D = F + A + Y, H = _ - D;
16756
16756
  if (D <= Ne) {
16757
- const ie = j.length > 0 && y === j[j.length - 1].ref.current;
16757
+ const se = j.length > 0 && y === j[j.length - 1].ref.current;
16758
16758
  a.style.bottom = "0px";
16759
- const re = c.clientHeight - x.offsetTop - x.offsetHeight, ze = Math.max(
16759
+ const re = c.clientHeight - x.offsetTop - x.offsetHeight, Le = Math.max(
16760
16760
  q,
16761
16761
  ne + // viewport might have padding bottom, include it to avoid a scrollable viewport
16762
- (ie ? Ce : 0) + re + X
16763
- ), Ve = D + ze;
16764
- a.style.height = Ve + "px";
16762
+ (se ? Ce : 0) + re + X
16763
+ ), Ke = D + Le;
16764
+ a.style.height = Ke + "px";
16765
16765
  } else {
16766
- const ie = j.length > 0 && y === j[0].ref.current;
16766
+ const se = j.length > 0 && y === j[0].ref.current;
16767
16767
  a.style.top = "0px";
16768
- const ze = Math.max(
16768
+ const Le = Math.max(
16769
16769
  Ne,
16770
16770
  F + x.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
16771
- (ie ? fe : 0) + ne
16771
+ (se ? fe : 0) + ne
16772
16772
  ) + H;
16773
- a.style.height = ze + "px", x.scrollTop = D - Ne + x.offsetTop;
16773
+ a.style.height = Le + "px", x.scrollTop = D - Ne + x.offsetTop;
16774
16774
  }
16775
16775
  a.style.margin = `${cn}px 0`, a.style.minHeight = J + "px", a.style.maxHeight = P + "px", r == null || r(), requestAnimationFrame(() => h.current = !0);
16776
16776
  }
@@ -16815,7 +16815,7 @@ var pT = "SelectItemAlignedPosition", hh = v.forwardRef((e, t) => {
16815
16815
  zIndex: T
16816
16816
  },
16817
16817
  children: /* @__PURE__ */ u.jsx(
16818
- Pe.div,
16818
+ je.div,
16819
16819
  {
16820
16820
  ...o,
16821
16821
  ref: f,
@@ -16878,7 +16878,7 @@ var [mT, tl] = Ar(rr, {}), Ji = "SelectViewport", mh = v.forwardRef(
16878
16878
  }
16879
16879
  ),
16880
16880
  /* @__PURE__ */ u.jsx(qs.Slot, { scope: n, children: /* @__PURE__ */ u.jsx(
16881
- Pe.div,
16881
+ je.div,
16882
16882
  {
16883
16883
  "data-radix-select-viewport": "",
16884
16884
  role: "presentation",
@@ -16920,14 +16920,14 @@ mh.displayName = Ji;
16920
16920
  var gh = "SelectGroup", [gT, xT] = Ar(gh), yT = v.forwardRef(
16921
16921
  (e, t) => {
16922
16922
  const { __scopeSelect: n, ...r } = e, o = Nn();
16923
- return /* @__PURE__ */ u.jsx(gT, { scope: n, id: o, children: /* @__PURE__ */ u.jsx(Pe.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
16923
+ return /* @__PURE__ */ u.jsx(gT, { scope: n, id: o, children: /* @__PURE__ */ u.jsx(je.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
16924
16924
  }
16925
16925
  );
16926
16926
  yT.displayName = gh;
16927
16927
  var xh = "SelectLabel", yh = v.forwardRef(
16928
16928
  (e, t) => {
16929
16929
  const { __scopeSelect: n, ...r } = e, o = xT(xh, n);
16930
- return /* @__PURE__ */ u.jsx(Pe.div, { id: o.id, ...r, ref: t });
16930
+ return /* @__PURE__ */ u.jsx(je.div, { id: o.id, ...r, ref: t });
16931
16931
  }
16932
16932
  );
16933
16933
  yh.displayName = xh;
@@ -16971,7 +16971,7 @@ var ds = "SelectItem", [vT, vh] = Ar(ds), wh = v.forwardRef(
16971
16971
  disabled: o,
16972
16972
  textValue: d,
16973
16973
  children: /* @__PURE__ */ u.jsx(
16974
- Pe.div,
16974
+ je.div,
16975
16975
  {
16976
16976
  role: "option",
16977
16977
  "aria-labelledby": x,
@@ -17030,7 +17030,7 @@ var $r = "SelectItemText", bh = v.forwardRef(
17030
17030
  [l.disabled, l.value, h]
17031
17031
  ), { onNativeOptionAdd: x, onNativeOptionRemove: y } = c;
17032
17032
  return Ot(() => (x(m), () => y(m)), [x, y, m]), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
17033
- /* @__PURE__ */ u.jsx(Pe.span, { id: l.textId, ...s, ref: p }),
17033
+ /* @__PURE__ */ u.jsx(je.span, { id: l.textId, ...s, ref: p }),
17034
17034
  l.isSelected && i.valueNode && !i.valueNodeHasChildren ? ms.createPortal(s.children, i.valueNode) : null
17035
17035
  ] });
17036
17036
  }
@@ -17039,7 +17039,7 @@ bh.displayName = $r;
17039
17039
  var Sh = "SelectItemIndicator", Ch = v.forwardRef(
17040
17040
  (e, t) => {
17041
17041
  const { __scopeSelect: n, ...r } = e;
17042
- return vh(Sh, n).isSelected ? /* @__PURE__ */ u.jsx(Pe.span, { "aria-hidden": !0, ...r, ref: t }) : null;
17042
+ return vh(Sh, n).isSelected ? /* @__PURE__ */ u.jsx(je.span, { "aria-hidden": !0, ...r, ref: t }) : null;
17043
17043
  }
17044
17044
  );
17045
17045
  Ch.displayName = Sh;
@@ -17100,7 +17100,7 @@ var Rh = v.forwardRef((e, t) => {
17100
17100
  const c = a().find((f) => f.ref.current === document.activeElement);
17101
17101
  (d = c == null ? void 0 : c.ref.current) == null || d.scrollIntoView({ block: "nearest" });
17102
17102
  }, [a]), /* @__PURE__ */ u.jsx(
17103
- Pe.div,
17103
+ je.div,
17104
17104
  {
17105
17105
  "aria-hidden": !0,
17106
17106
  ...o,
@@ -17121,7 +17121,7 @@ var Rh = v.forwardRef((e, t) => {
17121
17121
  }), wT = "SelectSeparator", Eh = v.forwardRef(
17122
17122
  (e, t) => {
17123
17123
  const { __scopeSelect: n, ...r } = e;
17124
- return /* @__PURE__ */ u.jsx(Pe.div, { "aria-hidden": !0, ...r, ref: t });
17124
+ return /* @__PURE__ */ u.jsx(je.div, { "aria-hidden": !0, ...r, ref: t });
17125
17125
  }
17126
17126
  );
17127
17127
  Eh.displayName = wT;
@@ -17147,7 +17147,7 @@ var ST = "SelectBubbleInput", Ih = v.forwardRef(
17147
17147
  d.call(a, t), a.dispatchEvent(f);
17148
17148
  }
17149
17149
  }, [i, t]), /* @__PURE__ */ u.jsx(
17150
- Pe.select,
17150
+ je.select,
17151
17151
  {
17152
17152
  ...n,
17153
17153
  style: { ...rh, ...n.style },
@@ -17295,7 +17295,7 @@ jT.displayName = $h.displayName;
17295
17295
  var PT = "Separator", Hc = "horizontal", OT = ["horizontal", "vertical"], Bh = v.forwardRef((e, t) => {
17296
17296
  const { decorative: n, orientation: r = Hc, ...o } = e, s = MT(r) ? r : Hc, a = n ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
17297
17297
  return /* @__PURE__ */ u.jsx(
17298
- Pe.div,
17298
+ je.div,
17299
17299
  {
17300
17300
  "data-orientation": s,
17301
17301
  ...a,