teodor-new-chat-ui 4.3.286 → 4.3.287

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 Ve, 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 Ce, 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";
@@ -57,14 +57,14 @@ function Em() {
57
57
  var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
58
58
  function w(R) {
59
59
  {
60
- for (var K = arguments.length, ae = new Array(K > 1 ? K - 1 : 0), ke = 1; ke < K; ke++)
61
- ae[ke - 1] = arguments[ke];
60
+ for (var K = arguments.length, ae = new Array(K > 1 ? K - 1 : 0), Re = 1; Re < K; Re++)
61
+ ae[Re - 1] = arguments[Re];
62
62
  b("error", R, ae);
63
63
  }
64
64
  }
65
65
  function b(R, K, ae) {
66
66
  {
67
- var ke = g.ReactDebugCurrentFrame, et = ke.getStackAddendum();
67
+ var Re = g.ReactDebugCurrentFrame, et = Re.getStackAddendum();
68
68
  et !== "" && (K += "%s", ae = ae.concat([et]));
69
69
  var lt = ae.map(function(Ge) {
70
70
  return String(Ge);
@@ -82,9 +82,9 @@ function Em() {
82
82
  R.$$typeof === N || R.getModuleId !== void 0));
83
83
  }
84
84
  function j(R, K, ae) {
85
- var ke = R.displayName;
86
- if (ke)
87
- return ke;
85
+ var Re = R.displayName;
86
+ if (Re)
87
+ return Re;
88
88
  var et = K.displayName || K.name || "";
89
89
  return et !== "" ? ae + "(" + et + ")" : ae;
90
90
  }
@@ -123,8 +123,8 @@ function Em() {
123
123
  case l:
124
124
  return j(R, R.render, "ForwardRef");
125
125
  case f:
126
- var ke = R.displayName || null;
127
- return ke !== null ? ke : $(R.type) || "Memo";
126
+ var Re = R.displayName || null;
127
+ return Re !== null ? Re : $(R.type) || "Memo";
128
128
  case p: {
129
129
  var et = R, lt = et._payload, Ge = et._init;
130
130
  try {
@@ -137,9 +137,9 @@ function Em() {
137
137
  return null;
138
138
  }
139
139
  var I = Object.assign, F = 0, A, X, L, _, J, G, fe;
140
- function Ce() {
140
+ function Te() {
141
141
  }
142
- Ce.__reactDisabledLog = !0;
142
+ Te.__reactDisabledLog = !0;
143
143
  function Ne() {
144
144
  {
145
145
  if (F === 0) {
@@ -147,7 +147,7 @@ function Em() {
147
147
  var R = {
148
148
  configurable: !0,
149
149
  enumerable: !0,
150
- value: Ce,
150
+ value: Te,
151
151
  writable: !0
152
152
  };
153
153
  Object.defineProperties(console, {
@@ -205,8 +205,8 @@ function Em() {
205
205
  try {
206
206
  throw Error();
207
207
  } catch (et) {
208
- var ke = et.stack.trim().match(/\n( *(at )?)/);
209
- Y = ke && ke[1] || "";
208
+ var Re = et.stack.trim().match(/\n( *(at )?)/);
209
+ Y = Re && Re[1] || "";
210
210
  }
211
211
  return `
212
212
  ` + Y + R;
@@ -225,7 +225,7 @@ function Em() {
225
225
  if (ae !== void 0)
226
226
  return ae;
227
227
  }
228
- var ke;
228
+ var Re;
229
229
  H = !0;
230
230
  var et = Error.prepareStackTrace;
231
231
  Error.prepareStackTrace = void 0;
@@ -244,14 +244,14 @@ function Em() {
244
244
  try {
245
245
  Reflect.construct(Ge, []);
246
246
  } catch (we) {
247
- ke = we;
247
+ Re = we;
248
248
  }
249
249
  Reflect.construct(R, [], Ge);
250
250
  } else {
251
251
  try {
252
252
  Ge.call();
253
253
  } catch (we) {
254
- ke = we;
254
+ Re = we;
255
255
  }
256
256
  R.call(Ge.prototype);
257
257
  }
@@ -259,14 +259,14 @@ function Em() {
259
259
  try {
260
260
  throw Error();
261
261
  } catch (we) {
262
- ke = we;
262
+ Re = we;
263
263
  }
264
264
  R();
265
265
  }
266
266
  } catch (we) {
267
- if (we && ke && typeof we.stack == "string") {
267
+ if (we && Re && typeof we.stack == "string") {
268
268
  for (var We = we.stack.split(`
269
- `), jt = ke.stack.split(`
269
+ `), jt = Re.stack.split(`
270
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--)
@@ -288,7 +288,7 @@ 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 Le(R, K, ae) {
291
+ function Fe(R, K, ae) {
292
292
  return re(R, !1);
293
293
  }
294
294
  function Ke(R) {
@@ -311,11 +311,11 @@ function Em() {
311
311
  if (typeof R == "object")
312
312
  switch (R.$$typeof) {
313
313
  case l:
314
- return Le(R.render);
314
+ return Fe(R.render);
315
315
  case f:
316
316
  return Qe(R.type, K, ae);
317
317
  case p: {
318
- var ke = R, et = ke._payload, lt = ke._init;
318
+ var Re = R, et = Re._payload, lt = Re._init;
319
319
  try {
320
320
  return Qe(lt(et), K, ae);
321
321
  } catch {
@@ -324,15 +324,15 @@ function Em() {
324
324
  }
325
325
  return "";
326
326
  }
327
- var oe = Object.prototype.hasOwnProperty, he = {}, Te = g.ReactDebugCurrentFrame;
327
+ var oe = Object.prototype.hasOwnProperty, he = {}, ke = g.ReactDebugCurrentFrame;
328
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
- Te.setExtraStackFrame(ae);
331
+ ke.setExtraStackFrame(ae);
332
332
  } else
333
- Te.setExtraStackFrame(null);
333
+ ke.setExtraStackFrame(null);
334
334
  }
335
- function Ze(R, K, ae, ke, et) {
335
+ function Ze(R, K, ae, Re, et) {
336
336
  {
337
337
  var lt = Function.call.bind(oe);
338
338
  for (var Ge in R)
@@ -340,19 +340,19 @@ function Em() {
340
340
  var We = void 0;
341
341
  try {
342
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`.");
343
+ var jt = Error((Re || "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
- We = R[Ge](K, Ge, ke, ae, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ We = R[Ge](K, Ge, Re, ae, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
347
  } catch (bt) {
348
348
  We = bt;
349
349
  }
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));
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).", Re || "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
  }
354
354
  var nt = Array.isArray;
355
- function $e(R) {
355
+ function ze(R) {
356
356
  return nt(R);
357
357
  }
358
358
  function Ue(R) {
@@ -381,7 +381,7 @@ function Em() {
381
381
  __self: !0,
382
382
  __source: !0
383
383
  }, gt, at;
384
- function Oe(R) {
384
+ function De(R) {
385
385
  if (oe.call(R, "ref")) {
386
386
  var K = Object.getOwnPropertyDescriptor(R, "ref").get;
387
387
  if (K && K.isReactWarning)
@@ -400,7 +400,7 @@ function Em() {
400
400
  function _t(R, K) {
401
401
  typeof R.ref == "string" && ft.current;
402
402
  }
403
- function Xt(R, K) {
403
+ function Jt(R, K) {
404
404
  {
405
405
  var ae = function() {
406
406
  gt || (gt = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", K));
@@ -422,7 +422,7 @@ function Em() {
422
422
  });
423
423
  }
424
424
  }
425
- var Ye = function(R, K, ae, ke, et, lt, Ge) {
425
+ var Ye = function(R, K, ae, Re, et, lt, Ge) {
426
426
  var We = {
427
427
  // This tag allows us to uniquely identify this as a React Element
428
428
  $$typeof: t,
@@ -443,7 +443,7 @@ function Em() {
443
443
  configurable: !1,
444
444
  enumerable: !1,
445
445
  writable: !1,
446
- value: ke
446
+ value: Re
447
447
  }), Object.defineProperty(We, "_source", {
448
448
  configurable: !1,
449
449
  enumerable: !1,
@@ -451,10 +451,10 @@ function Em() {
451
451
  value: et
452
452
  }), Object.freeze && (Object.freeze(We.props), Object.freeze(We)), We;
453
453
  };
454
- function Ae(R, K, ae, ke, et) {
454
+ function Ae(R, K, ae, Re, et) {
455
455
  {
456
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));
457
+ ae !== void 0 && (It(ae), We = "" + ae), At(K) && (It(K.key), We = "" + K.key), De(K) && (jt = K.ref, _t(K, et));
458
458
  for (lt in K)
459
459
  oe.call(K, lt) && !mt.hasOwnProperty(lt) && (Ge[lt] = K[lt]);
460
460
  if (R && R.defaultProps) {
@@ -464,18 +464,18 @@ function Em() {
464
464
  }
465
465
  if (We || jt) {
466
466
  var St = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
467
- We && Xt(Ge, St), jt && an(Ge, St);
467
+ We && Jt(Ge, St), jt && an(Ge, St);
468
468
  }
469
- return Ye(R, We, jt, et, ke, ft.current, Ge);
469
+ return Ye(R, We, jt, et, Re, ft.current, Ge);
470
470
  }
471
471
  }
472
- var Nt = g.ReactCurrentOwner, Bt = g.ReactDebugCurrentFrame;
472
+ var Nt = g.ReactCurrentOwner, Ht = g.ReactDebugCurrentFrame;
473
473
  function U(R) {
474
474
  if (R) {
475
475
  var K = R._owner, ae = Qe(R.type, R._source, K ? K.type : null);
476
- Bt.setExtraStackFrame(ae);
476
+ Ht.setExtraStackFrame(ae);
477
477
  } else
478
- Bt.setExtraStackFrame(null);
478
+ Ht.setExtraStackFrame(null);
479
479
  }
480
480
  var ye;
481
481
  ye = !1;
@@ -497,7 +497,7 @@ Check the render method of \`` + R + "`.";
497
497
  function ge(R) {
498
498
  return "";
499
499
  }
500
- var Ee = {};
500
+ var Se = {};
501
501
  function ie(R) {
502
502
  {
503
503
  var K = ee();
@@ -510,27 +510,27 @@ Check the top-level render call using <` + ae + ">.");
510
510
  return K;
511
511
  }
512
512
  }
513
- function ze(R, K) {
513
+ function Le(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
518
  var ae = ie(K);
519
- if (Ee[ae])
519
+ if (Se[ae])
520
520
  return;
521
- Ee[ae] = !0;
522
- var ke = "";
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);
521
+ Se[ae] = !0;
522
+ var Re = "";
523
+ R && R._owner && R._owner !== Nt.current && (Re = " 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, Re), U(null);
524
524
  }
525
525
  }
526
- function Fe(R, K) {
526
+ function Pe(R, K) {
527
527
  {
528
528
  if (typeof R != "object")
529
529
  return;
530
- if ($e(R))
530
+ if (ze(R))
531
531
  for (var ae = 0; ae < R.length; ae++) {
532
- var ke = R[ae];
533
- z(ke) && ze(ke, K);
532
+ var Re = R[ae];
533
+ z(Re) && Le(Re, K);
534
534
  }
535
535
  else if (z(R))
536
536
  R._store && (R._store.validated = !0);
@@ -538,11 +538,11 @@ Check the top-level render call using <` + ae + ">.");
538
538
  var et = y(R);
539
539
  if (typeof et == "function" && et !== R.entries)
540
540
  for (var lt = et.call(R), Ge; !(Ge = lt.next()).done; )
541
- z(Ge.value) && ze(Ge.value, K);
541
+ z(Ge.value) && Le(Ge.value, K);
542
542
  }
543
543
  }
544
544
  }
545
- function Me(R) {
545
+ function Oe(R) {
546
546
  {
547
547
  var K = R.type;
548
548
  if (K == null || typeof K == "string")
@@ -557,8 +557,8 @@ Check the top-level render call using <` + ae + ">.");
557
557
  else
558
558
  return;
559
559
  if (ae) {
560
- var ke = $(K);
561
- Ze(ae, R.props, "prop", ke, R);
560
+ var Re = $(K);
561
+ Ze(ae, R.props, "prop", Re, R);
562
562
  } else if (K.PropTypes !== void 0 && !ye) {
563
563
  ye = !0;
564
564
  var et = $(K);
@@ -567,12 +567,12 @@ Check the top-level render call using <` + ae + ">.");
567
567
  typeof K.getDefaultProps == "function" && !K.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
568
568
  }
569
569
  }
570
- function Jt(R) {
570
+ function Mt(R) {
571
571
  {
572
572
  for (var K = Object.keys(R.props), ae = 0; ae < K.length; ae++) {
573
- var ke = K[ae];
574
- if (ke !== "children" && ke !== "key") {
575
- U(R), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", ke), U(null);
573
+ var Re = K[ae];
574
+ if (Re !== "children" && Re !== "key") {
575
+ U(R), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", Re), U(null);
576
576
  break;
577
577
  }
578
578
  }
@@ -580,7 +580,7 @@ Check the top-level render call using <` + ae + ">.");
580
580
  }
581
581
  }
582
582
  var wt = {};
583
- function En(R, K, ae, ke, et, lt) {
583
+ function En(R, K, ae, Re, et, lt) {
584
584
  {
585
585
  var Ge = M(R);
586
586
  if (!Ge) {
@@ -589,7 +589,7 @@ Check the top-level render call using <` + ae + ">.");
589
589
  var jt = ge();
590
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") + " />", 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);
592
+ R === null ? bt = "null" : ze(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)
@@ -597,15 +597,15 @@ Check the top-level render call using <` + ae + ">.");
597
597
  if (Ge) {
598
598
  var Q = K.children;
599
599
  if (Q !== void 0)
600
- if (ke)
601
- if ($e(Q)) {
600
+ if (Re)
601
+ if (ze(Q)) {
602
602
  for (var ue = 0; ue < Q.length; ue++)
603
- Fe(Q[ue], R);
603
+ Pe(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
- Fe(Q, R);
608
+ Pe(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) : Me(St), St;
624
+ return R === r ? Mt(St) : Oe(St), St;
625
625
  }
626
626
  }
627
627
  function Xs(R, K, ae) {
@@ -646,14 +646,14 @@ const { toString: Im } = Object.prototype, { getPrototypeOf: ia } = Object, { it
646
646
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
647
647
  })(/* @__PURE__ */ Object.create(null)), mn = (e) => (e = e.toLowerCase(), (t) => xs(t) === e), ys = (e) => (t) => typeof t === e, { isArray: Tr } = Array, wr = ys("undefined");
648
648
  function so(e) {
649
- return e !== null && !wr(e) && e.constructor !== null && !wr(e.constructor) && Ut(e.constructor.isBuffer) && e.constructor.isBuffer(e);
649
+ return e !== null && !wr(e) && e.constructor !== null && !wr(e.constructor) && Wt(e.constructor.isBuffer) && e.constructor.isBuffer(e);
650
650
  }
651
651
  const Gc = mn("ArrayBuffer");
652
652
  function Nm(e) {
653
653
  let t;
654
654
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Gc(e.buffer), t;
655
655
  }
656
- const Am = ys("string"), Ut = ys("function"), Yc = ys("number"), io = (e) => e !== null && typeof e == "object", _m = (e) => e === !0 || e === !1, jo = (e) => {
656
+ const Am = ys("string"), Wt = ys("function"), Yc = ys("number"), io = (e) => e !== null && typeof e == "object", _m = (e) => e === !0 || e === !1, jo = (e) => {
657
657
  if (xs(e) !== "object")
658
658
  return !1;
659
659
  const t = ia(e);
@@ -666,10 +666,10 @@ const Am = ys("string"), Ut = ys("function"), Yc = ys("number"), io = (e) => e !
666
666
  } catch {
667
667
  return !1;
668
668
  }
669
- }, Pm = mn("Date"), Om = mn("File"), Mm = mn("Blob"), Dm = mn("FileList"), Lm = (e) => io(e) && Ut(e.pipe), $m = (e) => {
669
+ }, Pm = mn("Date"), Om = mn("File"), Mm = mn("Blob"), Dm = mn("FileList"), Lm = (e) => io(e) && Wt(e.pipe), $m = (e) => {
670
670
  let t;
671
- return e && (typeof FormData == "function" && e instanceof FormData || Ut(e.append) && ((t = xs(e)) === "formdata" || // detect form-data instance
672
- t === "object" && Ut(e.toString) && e.toString() === "[object FormData]"));
671
+ return e && (typeof FormData == "function" && e instanceof FormData || Wt(e.append) && ((t = xs(e)) === "formdata" || // detect form-data instance
672
+ t === "object" && Wt(e.toString) && e.toString() === "[object FormData]"));
673
673
  }, Fm = mn("URLSearchParams"), [zm, Bm, Hm, Um] = ["ReadableStream", "Request", "Response", "Headers"].map(mn), Wm = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
674
674
  function ao(e, t, { allOwnKeys: n = !1 } = {}) {
675
675
  if (e === null || typeof e > "u")
@@ -709,7 +709,7 @@ function Ii() {
709
709
  return n;
710
710
  }
711
711
  const Vm = (e, t, n, { allOwnKeys: r } = {}) => (ao(t, (o, s) => {
712
- n && Ut(o) ? e[s] = Kc(o, n) : e[s] = o;
712
+ n && Wt(o) ? e[s] = Kc(o, n) : e[s] = o;
713
713
  }, { allOwnKeys: r }), e), Km = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), qm = (e, t, n, r) => {
714
714
  e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
715
715
  value: t.prototype
@@ -763,10 +763,10 @@ const Vm = (e, t, n, { allOwnKeys: r } = {}) => (ao(t, (o, s) => {
763
763
  }), Object.defineProperties(e, r);
764
764
  }, rg = (e) => {
765
765
  Zc(e, (t, n) => {
766
- if (Ut(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
766
+ if (Wt(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
767
767
  return !1;
768
768
  const r = e[n];
769
- if (Ut(r)) {
769
+ if (Wt(r)) {
770
770
  if (t.enumerable = !1, "writable" in t) {
771
771
  t.writable = !1;
772
772
  return;
@@ -786,7 +786,7 @@ const Vm = (e, t, n, { allOwnKeys: r } = {}) => (ao(t, (o, s) => {
786
786
  }, sg = () => {
787
787
  }, ig = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
788
788
  function ag(e) {
789
- return !!(e && Ut(e.append) && e[qc] === "FormData" && e[gs]);
789
+ return !!(e && Wt(e.append) && e[qc] === "FormData" && e[gs]);
790
790
  }
791
791
  const lg = (e) => {
792
792
  const t = new Array(10), n = (r, o) => {
@@ -807,14 +807,14 @@ const lg = (e) => {
807
807
  return r;
808
808
  };
809
809
  return n(e, 0);
810
- }, cg = mn("AsyncFunction"), ug = (e) => e && (io(e) || Ut(e)) && Ut(e.then) && Ut(e.catch), Qc = ((e, t) => e ? setImmediate : t ? ((n, r) => (qn.addEventListener("message", ({ source: o, data: s }) => {
810
+ }, cg = mn("AsyncFunction"), ug = (e) => e && (io(e) || Wt(e)) && Wt(e.then) && Wt(e.catch), Qc = ((e, t) => e ? setImmediate : t ? ((n, r) => (qn.addEventListener("message", ({ source: o, data: s }) => {
811
811
  o === qn && s === n && r.length && r.shift()();
812
812
  }, !1), (o) => {
813
813
  r.push(o), qn.postMessage(n, "*");
814
814
  }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
815
815
  typeof setImmediate == "function",
816
- Ut(qn.postMessage)
817
- ), dg = typeof queueMicrotask < "u" ? queueMicrotask.bind(qn) : typeof process < "u" && process.nextTick || Qc, fg = (e) => e != null && Ut(e[gs]), O = {
816
+ Wt(qn.postMessage)
817
+ ), dg = typeof queueMicrotask < "u" ? queueMicrotask.bind(qn) : typeof process < "u" && process.nextTick || Qc, fg = (e) => e != null && Wt(e[gs]), O = {
818
818
  isArray: Tr,
819
819
  isArrayBuffer: Gc,
820
820
  isBuffer: so,
@@ -835,7 +835,7 @@ const lg = (e) => {
835
835
  isFile: Om,
836
836
  isBlob: Mm,
837
837
  isRegExp: ng,
838
- isFunction: Ut,
838
+ isFunction: Wt,
839
839
  isStream: Lm,
840
840
  isURLSearchParams: Fm,
841
841
  isTypedArray: Jm,
@@ -874,10 +874,10 @@ const lg = (e) => {
874
874
  asap: dg,
875
875
  isIterable: fg
876
876
  };
877
- function Pe(e, t, n, r, o) {
877
+ function Me(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(Pe, Error, {
880
+ O.inherits(Me, Error, {
881
881
  toJSON: function() {
882
882
  return {
883
883
  // Standard
@@ -898,7 +898,7 @@ O.inherits(Pe, Error, {
898
898
  };
899
899
  }
900
900
  });
901
- const eu = Pe.prototype, tu = {};
901
+ const eu = Me.prototype, tu = {};
902
902
  [
903
903
  "ERR_BAD_OPTION_VALUE",
904
904
  "ERR_BAD_OPTION",
@@ -916,15 +916,15 @@ const eu = Pe.prototype, tu = {};
916
916
  ].forEach((e) => {
917
917
  tu[e] = { value: e };
918
918
  });
919
- Object.defineProperties(Pe, tu);
919
+ Object.defineProperties(Me, tu);
920
920
  Object.defineProperty(eu, "isAxiosError", { value: !0 });
921
- Pe.from = (e, t, n, r, o, s) => {
921
+ Me.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 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;
927
+ return Me.call(i, a, l, n, r, o), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", s && Object.assign(i, s), i;
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 Pe("Blob is not supported. Use a Buffer instead.");
967
+ throw new Me("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) {
@@ -1128,14 +1128,14 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Cg
1128
1128
  hasStandardBrowserWebWorkerEnv: Sg,
1129
1129
  navigator: Ai,
1130
1130
  origin: Cg
1131
- }, Symbol.toStringTag, { value: "Module" })), Dt = {
1131
+ }, Symbol.toStringTag, { value: "Module" })), Lt = {
1132
1132
  ...Tg,
1133
1133
  ...wg
1134
1134
  };
1135
1135
  function kg(e, t) {
1136
- return vs(e, new Dt.classes.URLSearchParams(), {
1136
+ return vs(e, new Lt.classes.URLSearchParams(), {
1137
1137
  visitor: function(n, r, o, s) {
1138
- return Dt.isNode && O.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1138
+ return Lt.isNode && O.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1139
1139
  },
1140
1140
  ...t
1141
1141
  });
@@ -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" ? Pe.from(a, Pe.ERR_BAD_RESPONSE, this, null, this.response) : a;
1218
+ throw a.name === "SyntaxError" ? Me.from(a, Me.ERR_BAD_RESPONSE, this, null, this.response) : a;
1219
1219
  }
1220
1220
  }
1221
1221
  return t;
@@ -1230,8 +1230,8 @@ const lo = {
1230
1230
  maxContentLength: -1,
1231
1231
  maxBodyLength: -1,
1232
1232
  env: {
1233
- FormData: Dt.classes.FormData,
1234
- Blob: Dt.classes.Blob
1233
+ FormData: Lt.classes.FormData,
1234
+ Blob: Lt.classes.Blob
1235
1235
  },
1236
1236
  validateStatus: function(t) {
1237
1237
  return t >= 200 && t < 300;
@@ -1310,7 +1310,7 @@ function Og(e, t) {
1310
1310
  });
1311
1311
  });
1312
1312
  }
1313
- let Wt = class {
1313
+ let Vt = class {
1314
1314
  constructor(t) {
1315
1315
  t && this.set(t);
1316
1316
  }
@@ -1436,8 +1436,8 @@ let Wt = class {
1436
1436
  return O.isArray(t) ? t.forEach(s) : s(t), this;
1437
1437
  }
1438
1438
  };
1439
- Wt.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1440
- O.reduceDescriptors(Wt.prototype, ({ value: e }, t) => {
1439
+ Vt.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1440
+ O.reduceDescriptors(Vt.prototype, ({ value: e }, t) => {
1441
1441
  let n = t[0].toUpperCase() + t.slice(1);
1442
1442
  return {
1443
1443
  get: () => e,
@@ -1446,9 +1446,9 @@ O.reduceDescriptors(Wt.prototype, ({ value: e }, t) => {
1446
1446
  }
1447
1447
  };
1448
1448
  });
1449
- O.freezeMethods(Wt);
1449
+ O.freezeMethods(Vt);
1450
1450
  function ti(e, t) {
1451
- const n = this || lo, r = t || n, o = Wt.from(r.headers);
1451
+ const n = this || lo, r = t || n, o = Vt.from(r.headers);
1452
1452
  let s = r.data;
1453
1453
  return O.forEach(e, function(a) {
1454
1454
  s = a.call(n, s, o.normalize(), t ? t.status : void 0);
@@ -1458,16 +1458,16 @@ function au(e) {
1458
1458
  return !!(e && e.__CANCEL__);
1459
1459
  }
1460
1460
  function kr(e, t, n) {
1461
- Pe.call(this, e ?? "canceled", Pe.ERR_CANCELED, t, n), this.name = "CanceledError";
1461
+ Me.call(this, e ?? "canceled", Me.ERR_CANCELED, t, n), this.name = "CanceledError";
1462
1462
  }
1463
- O.inherits(kr, Pe, {
1463
+ O.inherits(kr, Me, {
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 Pe(
1468
+ !n.status || !r || r(n.status) ? e(n) : t(new Me(
1469
1469
  "Request failed with status code " + n.status,
1470
- [Pe.ERR_BAD_REQUEST, Pe.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
1470
+ [Me.ERR_BAD_REQUEST, Me.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
1471
1471
  n.config,
1472
1472
  n.request,
1473
1473
  n
@@ -1531,10 +1531,10 @@ const Vo = (e, t, n = 3) => {
1531
1531
  total: e,
1532
1532
  loaded: r
1533
1533
  }), t[1]];
1534
- }, hl = (e) => (...t) => O.asap(() => e(...t)), $g = Dt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, Dt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1535
- new URL(Dt.origin),
1536
- Dt.navigator && /(msie|trident)/i.test(Dt.navigator.userAgent)
1537
- ) : () => !0, Fg = Dt.hasStandardBrowserEnv ? (
1534
+ }, hl = (e) => (...t) => O.asap(() => e(...t)), $g = Lt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, Lt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1535
+ new URL(Lt.origin),
1536
+ Lt.navigator && /(msie|trident)/i.test(Lt.navigator.userAgent)
1537
+ ) : () => !0, Fg = Lt.hasStandardBrowserEnv ? (
1538
1538
  // Standard browser envs support document.cookie
1539
1539
  {
1540
1540
  write(e, t, n, r, o, s) {
@@ -1571,7 +1571,7 @@ function cu(e, t, n) {
1571
1571
  let r = !zg(t);
1572
1572
  return e && (r || n == !1) ? Bg(e, t) : t;
1573
1573
  }
1574
- const ml = (e) => e instanceof Wt ? { ...e } : e;
1574
+ const ml = (e) => e instanceof Vt ? { ...e } : e;
1575
1575
  function Jn(e, t) {
1576
1576
  t = t || {};
1577
1577
  const n = {};
@@ -1639,11 +1639,11 @@ function Jn(e, t) {
1639
1639
  const uu = (e) => {
1640
1640
  const t = Jn({}, e);
1641
1641
  let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: a } = t;
1642
- if (t.headers = i = Wt.from(i), t.url = ou(cu(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1642
+ if (t.headers = i = Vt.from(i), t.url = ou(cu(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1643
1643
  "Authorization",
1644
1644
  "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1645
1645
  ), O.isFormData(n)) {
1646
- if (Dt.hasStandardBrowserEnv || Dt.hasStandardBrowserWebWorkerEnv)
1646
+ if (Lt.hasStandardBrowserEnv || Lt.hasStandardBrowserWebWorkerEnv)
1647
1647
  i.setContentType(void 0);
1648
1648
  else if (O.isFunction(n.getHeaders)) {
1649
1649
  const l = n.getHeaders(), c = ["content-type", "content-length"];
@@ -1652,7 +1652,7 @@ const uu = (e) => {
1652
1652
  });
1653
1653
  }
1654
1654
  }
1655
- if (Dt.hasStandardBrowserEnv && (r && O.isFunction(r) && (r = r(t)), r || r !== !1 && $g(t.url))) {
1655
+ if (Lt.hasStandardBrowserEnv && (r && O.isFunction(r) && (r = r(t)), r || r !== !1 && $g(t.url))) {
1656
1656
  const l = o && s && Fg.read(s);
1657
1657
  l && i.set(o, l);
1658
1658
  }
@@ -1661,7 +1661,7 @@ const uu = (e) => {
1661
1661
  return new Promise(function(n, r) {
1662
1662
  const o = uu(e);
1663
1663
  let s = o.data;
1664
- const i = Wt.from(o.headers).normalize();
1664
+ const i = Vt.from(o.headers).normalize();
1665
1665
  let { responseType: a, onUploadProgress: l, onDownloadProgress: c } = o, d, f, p, h, m;
1666
1666
  function x() {
1667
1667
  h && h(), m && m(), o.cancelToken && o.cancelToken.unsubscribe(d), o.signal && o.signal.removeEventListener("abort", d);
@@ -1671,7 +1671,7 @@ const uu = (e) => {
1671
1671
  function g() {
1672
1672
  if (!y)
1673
1673
  return;
1674
- const b = Wt.from(
1674
+ const b = Vt.from(
1675
1675
  "getAllResponseHeaders" in y && y.getAllResponseHeaders()
1676
1676
  ), C = {
1677
1677
  data: !a || a === "text" || a === "json" ? y.responseText : y.response,
@@ -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 Pe("Request aborted", Pe.ECONNABORTED, e, y)), y = null);
1693
+ y && (r(new Me("Request aborted", Me.ECONNABORTED, e, y)), y = null);
1694
1694
  }, y.onerror = function(T) {
1695
- const C = T && T.message ? T.message : "Network Error", S = new Pe(C, Pe.ERR_NETWORK, e, y);
1695
+ const C = T && T.message ? T.message : "Network Error", S = new Me(C, Me.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 Pe(
1700
+ o.timeoutErrorMessage && (T = o.timeoutErrorMessage), r(new Me(
1701
1701
  T,
1702
- C.clarifyTimeoutError ? Pe.ETIMEDOUT : Pe.ECONNABORTED,
1702
+ C.clarifyTimeoutError ? Me.ETIMEDOUT : Me.ECONNABORTED,
1703
1703
  e,
1704
1704
  y
1705
1705
  )), y = null;
@@ -1709,8 +1709,8 @@ const uu = (e) => {
1709
1709
  y && (r(!b || b.type ? new kr(null, e, y) : b), y.abort(), y = null);
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
- if (w && Dt.protocols.indexOf(w) === -1) {
1713
- r(new Pe("Unsupported protocol " + w + ":", Pe.ERR_BAD_REQUEST, e));
1712
+ if (w && Lt.protocols.indexOf(w) === -1) {
1713
+ r(new Me("Unsupported protocol " + w + ":", Me.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 Pe ? d : new kr(d instanceof Error ? d.message : d));
1726
+ r.abort(d instanceof Me ? d : new kr(d instanceof Error ? d.message : d));
1727
1727
  }
1728
1728
  };
1729
1729
  let i = t && setTimeout(() => {
1730
- i = null, s(new Pe(`timeout ${t} of ms exceeded`, Pe.ETIMEDOUT));
1730
+ i = null, s(new Me(`timeout ${t} of ms exceeded`, Me.ETIMEDOUT));
1731
1731
  }, t);
1732
1732
  const a = () => {
1733
1733
  e && (i && clearTimeout(i), i = null, e.forEach((c) => {
@@ -1816,7 +1816,7 @@ const uu = (e) => {
1816
1816
  return !1;
1817
1817
  const a = o && yo(yl), l = o && (typeof vl == "function" ? /* @__PURE__ */ ((m) => (x) => m.encode(x))(new vl()) : async (m) => new Uint8Array(await new n(m).arrayBuffer())), c = s && a && wl(() => {
1818
1818
  let m = !1;
1819
- const x = new n(Dt.origin, {
1819
+ const x = new n(Lt.origin, {
1820
1820
  body: new yl(),
1821
1821
  method: "POST",
1822
1822
  get duplex() {
@@ -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 Pe(`Response type '${m}' is not supported`, Pe.ERR_NOT_SUPPORT, y);
1835
+ throw new Me(`Response type '${m}' is not supported`, Me.ERR_NOT_SUPPORT, y);
1836
1836
  });
1837
1837
  });
1838
1838
  const p = async (m) => {
@@ -1841,7 +1841,7 @@ const uu = (e) => {
1841
1841
  if (O.isBlob(m))
1842
1842
  return m.size;
1843
1843
  if (O.isSpecCompliantForm(m))
1844
- return (await new n(Dt.origin, {
1844
+ return (await new n(Lt.origin, {
1845
1845
  method: "POST",
1846
1846
  body: m
1847
1847
  }).arrayBuffer()).byteLength;
@@ -1882,11 +1882,11 @@ const uu = (e) => {
1882
1882
  duplex: "half"
1883
1883
  }), fe;
1884
1884
  if (O.isFormData(g) && (fe = G.headers.get("content-type")) && E.setContentType(fe), G.body) {
1885
- const [Ce, Ne] = pl(
1885
+ const [Te, Ne] = pl(
1886
1886
  F,
1887
1887
  Vo(hl(S))
1888
1888
  );
1889
- g = gl(G.body, xl, Ce, Ne);
1889
+ g = gl(G.body, xl, Te, Ne);
1890
1890
  }
1891
1891
  }
1892
1892
  O.isString(N) || (N = N ? "include" : "omit");
@@ -1907,12 +1907,12 @@ const uu = (e) => {
1907
1907
  ["status", "statusText", "headers"].forEach((q) => {
1908
1908
  G[q] = L[q];
1909
1909
  });
1910
- const fe = O.toFiniteNumber(L.headers.get("content-length")), [Ce, Ne] = C && pl(
1910
+ const fe = O.toFiniteNumber(L.headers.get("content-length")), [Te, Ne] = C && pl(
1911
1911
  fe,
1912
1912
  Vo(hl(C), !0)
1913
1913
  ) || [];
1914
1914
  L = new r(
1915
- gl(L.body, xl, Ce, () => {
1915
+ gl(L.body, xl, Te, () => {
1916
1916
  Ne && Ne(), I && I();
1917
1917
  }),
1918
1918
  G
@@ -1923,7 +1923,7 @@ const uu = (e) => {
1923
1923
  return !_ && I && I(), await new Promise((G, fe) => {
1924
1924
  lu(G, fe, {
1925
1925
  data: J,
1926
- headers: Wt.from(L.headers),
1926
+ headers: Vt.from(L.headers),
1927
1927
  status: L.status,
1928
1928
  statusText: L.statusText,
1929
1929
  config: 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 Pe("Network Error", Pe.ERR_NETWORK, m, $),
1935
+ new Me("Network Error", Me.ERR_NETWORK, m, $),
1936
1936
  {
1937
1937
  cause: A.cause || A
1938
1938
  }
1939
- ) : Pe.from(A, A && A.code, m, $);
1939
+ ) : Me.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 Pe(`Unknown adapter '${a}'`);
1981
+ throw new Me(`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 Pe(
1993
+ throw new Me(
1994
1994
  "There is no suitable adapter to dispatch the request " + a,
1995
1995
  "ERR_NOT_SUPPORT"
1996
1996
  );
@@ -2004,7 +2004,7 @@ function ni(e) {
2004
2004
  throw new kr(null, e);
2005
2005
  }
2006
2006
  function Sl(e) {
2007
- return ni(e), e.headers = Wt.from(e.headers), e.data = ti.call(
2007
+ return ni(e), e.headers = Vt.from(e.headers), e.data = ti.call(
2008
2008
  e,
2009
2009
  e.transformRequest
2010
2010
  ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), fu.getAdapter(e.adapter || lo.adapter, e)(e).then(function(r) {
@@ -2012,13 +2012,13 @@ function Sl(e) {
2012
2012
  e,
2013
2013
  e.transformResponse,
2014
2014
  r
2015
- ), r.headers = Wt.from(r.headers), r;
2015
+ ), r.headers = Vt.from(r.headers), r;
2016
2016
  }, function(r) {
2017
2017
  return au(r) || (ni(e), r && r.response && (r.response.data = ti.call(
2018
2018
  e,
2019
2019
  e.transformResponse,
2020
2020
  r.response
2021
- ), r.response.headers = Wt.from(r.response.headers))), Promise.reject(r);
2021
+ ), r.response.headers = Vt.from(r.response.headers))), Promise.reject(r);
2022
2022
  });
2023
2023
  }
2024
2024
  const pu = "1.12.2", ws = {};
@@ -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 Pe(
2037
+ throw new Me(
2038
2038
  o(i, " has been removed" + (n ? " in " + n : "")),
2039
- Pe.ERR_DEPRECATED
2039
+ Me.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 Pe("options must be an object", Pe.ERR_BAD_OPTION_VALUE);
2054
+ throw new Me("options must be an object", Me.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 Pe("option " + s + " must be " + l, Pe.ERR_BAD_OPTION_VALUE);
2062
+ throw new Me("option " + s + " must be " + l, Me.ERR_BAD_OPTION_VALUE);
2063
2063
  continue;
2064
2064
  }
2065
2065
  if (n !== !0)
2066
- throw new Pe("Unknown option " + s, Pe.ERR_BAD_OPTION);
2066
+ throw new Me("Unknown option " + s, Me.ERR_BAD_OPTION);
2067
2067
  }
2068
2068
  }
2069
2069
  const Oo = {
@@ -2127,7 +2127,7 @@ let Yn = class {
2127
2127
  (m) => {
2128
2128
  delete s[m];
2129
2129
  }
2130
- ), n.headers = Wt.concat(i, s);
2130
+ ), n.headers = Vt.concat(i, s);
2131
2131
  const a = [];
2132
2132
  let l = !0;
2133
2133
  this.interceptors.request.forEach(function(x) {
@@ -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 = Pe;
2359
+ kt.AxiosError = Me;
2360
2360
  kt.Cancel = kt.CanceledError;
2361
2361
  kt.all = function(t) {
2362
2362
  return Promise.all(t);
@@ -2364,7 +2364,7 @@ kt.all = function(t) {
2364
2364
  kt.spread = ex;
2365
2365
  kt.isAxiosError = tx;
2366
2366
  kt.mergeConfig = Jn;
2367
- kt.AxiosHeaders = Wt;
2367
+ kt.AxiosHeaders = Vt;
2368
2368
  kt.formToJSON = (e) => iu(O.isHTMLForm(e) ? new FormData(e) : e);
2369
2369
  kt.getAdapter = fu.getAdapter;
2370
2370
  kt.HttpStatusCode = ji;
@@ -2620,9 +2620,9 @@ function fr(e) {
2620
2620
  }
2621
2621
  function yu(e, t) {
2622
2622
  if (!ca(e)) return null;
2623
- const n = e.values ?? { messages: [] }, r = Array.isArray(n == null ? void 0 : n.messages) ? n.messages : [], { messages: o, ...s } = n, i = Object.keys(s).length ? s : null, a = e.tasks, l = Array.isArray(a) ? a.filter((N) => !!N && typeof N == "object").map((N) => ({ ...N })) : a === null ? null : void 0, c = r.map((N, M) => kx(N, M)).filter((N) => !!N), d = Ht(e.config), f = Ht(d == null ? void 0 : d.configurable), p = vt(f, ["checkpoint_id", "checkpointId"]), h = vt(f, ["checkpoint_ns", "checkpointNs"]), m = Ht(e == null ? void 0 : e.parentConfig), x = Ht(m == null ? void 0 : m.configurable), y = vt(x, ["checkpoint_id", "checkpointId"]) ?? null, g = vt(x, ["checkpoint_ns", "checkpointNs"]) ?? null, w = e == null ? void 0 : e.createdAt, b = typeof w == "string" && w.trim() ? w : new Date(Date.now() - t).toISOString();
2623
+ const n = e.values ?? { messages: [] }, r = Array.isArray(n == null ? void 0 : n.messages) ? n.messages : [], { messages: o, ...s } = n, i = Object.keys(s).length ? s : null, a = e.tasks, l = Array.isArray(a) ? a.filter((N) => !!N && typeof N == "object").map((N) => ({ ...N })) : a === null ? null : void 0, c = r.map((N, M) => kx(N, M)).filter((N) => !!N), d = Ut(e.config), f = Ut(d == null ? void 0 : d.configurable), p = vt(f, ["checkpoint_id", "checkpointId"]), h = vt(f, ["checkpoint_ns", "checkpointNs"]), m = Ut(e == null ? void 0 : e.parentConfig), x = Ut(m == null ? void 0 : m.configurable), y = vt(x, ["checkpoint_id", "checkpointId"]) ?? null, g = vt(x, ["checkpoint_ns", "checkpointNs"]) ?? null, w = e == null ? void 0 : e.createdAt, b = typeof w == "string" && w.trim() ? w : new Date(Date.now() - t).toISOString();
2624
2624
  c[c.length - 1];
2625
- const T = c.slice().reverse().find((N) => N.role === "user") ?? null, C = Ht(e == null ? void 0 : e.metadata), S = vt(C, ["branch_label", "branchLabel"]), k = vt(x, ["checkpoint_id", "checkpointId"]), E = Array.isArray(e.next) ? [...e.next] : (e == null ? void 0 : e.next) === null ? null : void 0;
2625
+ const T = c.slice().reverse().find((N) => N.role === "user") ?? null, C = Ut(e == null ? void 0 : e.metadata), S = vt(C, ["branch_label", "branchLabel"]), k = vt(x, ["checkpoint_id", "checkpointId"]), E = Array.isArray(e.next) ? [...e.next] : (e == null ? void 0 : e.next) === null ? null : void 0;
2626
2626
  return {
2627
2627
  messages: c,
2628
2628
  checkpointId: p ?? null,
@@ -2779,7 +2779,7 @@ function Tx(e, t) {
2779
2779
  const [a, l, c, , d, , f, ...p] = e, h = typeof a == "string" && a.trim() ? a : t, m = typeof l == "string" && l.trim() ? l : Array.isArray(c) && typeof c[0] == "string" ? String(c[0]) : "task", x = Array.isArray(d) ? d : void 0, y = p.length ? p[p.length - 1] : void 0;
2780
2780
  return { id: h, name: m, interrupts: x, state: y !== void 0 ? y : f };
2781
2781
  }
2782
- const n = Ht(e);
2782
+ const n = Ut(e);
2783
2783
  if (!n) return null;
2784
2784
  const r = vt(n, ["id", "thread_id", "taskId"]) ?? t, o = vt(n, ["name"]) ?? "task", s = Array.isArray(n.interrupts) ? n.interrupts : void 0, i = Object.prototype.hasOwnProperty.call(n, "state") ? n.state : void 0;
2785
2785
  return { id: r, name: o, interrupts: s, state: i };
@@ -2861,12 +2861,12 @@ function El(e) {
2861
2861
  }
2862
2862
  function kx(e, t) {
2863
2863
  if (!e || typeof e != "object") return null;
2864
- const n = e, r = Ht(e) ?? {}, o = Ht(n.data) ?? r, s = String(
2864
+ const n = e, r = Ut(e) ?? {}, o = Ut(n.data) ?? r, s = String(
2865
2865
  n.type ?? o.type ?? o.role ?? ""
2866
2866
  ).toLowerCase(), i = fx[s];
2867
2867
  if (!i)
2868
2868
  return null;
2869
- const a = o.id ?? o.message_id ?? o.run_id ?? null, l = typeof a == "string" && a.trim() ? a : `history-${i}-${t}`, c = Ht(o.additional_kwargs) ?? Ht(o.additionalKwargs), d = Ht(o.response_metadata) ?? Ht(o.responseMetadata), f = vt(c, ["createdAt", "created_at"]) ?? vt(o, ["created_at", "createdAt"]), p = vt(c, ["checkpointId", "checkpoint_id"]), h = vt(c, ["checkpointNs", "checkpoint_ns"]), m = Rx(o.content), x = {
2869
+ const a = o.id ?? o.message_id ?? o.run_id ?? null, l = typeof a == "string" && a.trim() ? a : `history-${i}-${t}`, c = Ut(o.additional_kwargs) ?? Ut(o.additionalKwargs), d = Ut(o.response_metadata) ?? Ut(o.responseMetadata), f = vt(c, ["createdAt", "created_at"]) ?? vt(o, ["created_at", "createdAt"]), p = vt(c, ["checkpointId", "checkpoint_id"]), h = vt(c, ["checkpointNs", "checkpoint_ns"]), m = Rx(o.content), x = {
2870
2870
  id: l,
2871
2871
  role: i,
2872
2872
  content: m
@@ -2943,9 +2943,9 @@ function Il(e) {
2943
2943
  }
2944
2944
  function wu(e, t) {
2945
2945
  var s;
2946
- const n = vt(e, ["id", "call_id"]) ?? t, r = vt(e, ["name"]) ?? vt(Ht(e.function), ["name"]);
2946
+ const n = vt(e, ["id", "call_id"]) ?? t, r = vt(e, ["name"]) ?? vt(Ut(e.function), ["name"]);
2947
2947
  if (!n || !r) return null;
2948
- const o = Nx(e.args ?? e.arguments ?? ((s = Ht(e.function)) == null ? void 0 : s.arguments));
2948
+ const o = Nx(e.args ?? e.arguments ?? ((s = Ut(e.function)) == null ? void 0 : s.arguments));
2949
2949
  return { type: "tool_call", id: n, name: r, args: o };
2950
2950
  }
2951
2951
  function Ex(e) {
@@ -2972,7 +2972,7 @@ function Nx(e) {
2972
2972
  }
2973
2973
  return typeof e == "object" && !Array.isArray(e) ? { ...e } : {};
2974
2974
  }
2975
- function Ht(e) {
2975
+ function Ut(e) {
2976
2976
  if (!(!e || typeof e != "object" || Array.isArray(e)))
2977
2977
  return { ...e };
2978
2978
  }
@@ -3031,14 +3031,14 @@ 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 = 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) => {
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 = Ce((I) => {
3035
3035
  o(I);
3036
- }, []), j = Se(() => {
3036
+ }, []), j = Ce(() => {
3037
3037
  p(""), m(null), d(null), k.current = null, E.current = null, N.current = null;
3038
- }, []), P = Se(() => {
3038
+ }, []), P = Ce(() => {
3039
3039
  var I;
3040
3040
  console.debug("[use-chat] stop() invoked - aborting stream"), (I = b.current) == null || I.abort(), b.current = null, S.current = null, l(!1), w(!1), C.current = 0, y(0);
3041
- }, []), $ = Se(
3041
+ }, []), $ = Ce(
3042
3042
  (I, F, A) => {
3043
3043
  b.current && (b.current.abort(), b.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && p(""), m(null), k.current = null, E.current = null, N.current = null;
3044
3044
  const X = new AbortController();
@@ -3048,15 +3048,15 @@ 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, se, re, Le, Ke, Qe, oe, he, Te, He;
3051
+ var fe, Te, Ne, q, ne, Y, D, H, W, se, re, Fe, Ke, Qe, oe, he, ke, He;
3052
3052
  const G = (Ze) => {
3053
3053
  var nt;
3054
3054
  try {
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((Ue) => ({
3055
+ const ze = JSON.parse(JSON.stringify(Ze));
3056
+ return (nt = ze == null ? void 0 : ze.payload) != null && nt.files_info && Array.isArray(ze.payload.files_info) && (ze.payload.files_info = ze.payload.files_info.map((Ue) => ({
3057
3057
  ...Ue,
3058
3058
  data: Ue != null && Ue.data ? `<base64 ${String(Ue.data).length} chars>` : Ue == null ? void 0 : Ue.data
3059
- }))), $e;
3059
+ }))), ze;
3060
3060
  } catch {
3061
3061
  return Ze;
3062
3062
  }
@@ -3068,13 +3068,13 @@ function Ox(e = {}) {
3068
3068
  Ze = { Authorization: `Bearer ${r}` };
3069
3069
  else if (typeof window < "u") {
3070
3070
  const Ae = window.__AUTH_TOKEN__, Nt = ((fe = window.localStorage) == null ? void 0 : fe.getItem("authToken")) || null;
3071
- let Bt = null;
3071
+ let Ht = null;
3072
3072
  try {
3073
- const ye = (Ce = window.localStorage) == null ? void 0 : Ce.getItem("chat-settings");
3074
- ye && (Bt = ((Ne = JSON.parse(ye)) == null ? void 0 : Ne.apiKey) || null);
3073
+ const ye = (Te = window.localStorage) == null ? void 0 : Te.getItem("chat-settings");
3074
+ ye && (Ht = ((Ne = JSON.parse(ye)) == null ? void 0 : Ne.apiKey) || null);
3075
3075
  } catch {
3076
3076
  }
3077
- const U = Ae || Nt || Bt || null;
3077
+ const U = Ae || Nt || Ht || null;
3078
3078
  U && (Ze = { Authorization: `Bearer ${U}` });
3079
3079
  }
3080
3080
  } catch {
@@ -3091,14 +3091,14 @@ function Ox(e = {}) {
3091
3091
  Ye && (nt = { "X-Session-Id": Ye });
3092
3092
  } catch {
3093
3093
  }
3094
- const $e = {
3094
+ const ze = {
3095
3095
  ...Ze,
3096
3096
  ...nt,
3097
3097
  ...s.current
3098
3098
  }, Ue = {
3099
3099
  "Content-Type": "application/json",
3100
3100
  Accept: "text/event-stream",
3101
- ...$e
3101
+ ...ze
3102
3102
  }, qe = await fetch(t + n, {
3103
3103
  method: "POST",
3104
3104
  headers: Ue,
@@ -3106,7 +3106,7 @@ function Ox(e = {}) {
3106
3106
  signal: X.signal,
3107
3107
  credentials: i
3108
3108
  });
3109
- if (S.current && (S.current.headers = $e), !qe.ok || !qe.body) {
3109
+ if (S.current && (S.current.headers = ze), !qe.ok || !qe.body) {
3110
3110
  const Ye = await qe.text().catch(() => "");
3111
3111
  console.debug(
3112
3112
  "[use-chat] non-OK response",
@@ -3121,17 +3121,17 @@ function Ox(e = {}) {
3121
3121
  let ft = "", mt = [];
3122
3122
  C.current = 0, y(0);
3123
3123
  let gt = 0, at = null;
3124
- const Oe = () => {
3124
+ const De = () => {
3125
3125
  if (mt.length) {
3126
3126
  const Ye = mt.join("");
3127
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(Oe));
3131
+ typeof window < "u" && at == null && (at = requestAnimationFrame(De));
3132
3132
  };
3133
3133
  let _t = Date.now();
3134
- const Xt = setInterval(() => {
3134
+ const Jt = setInterval(() => {
3135
3135
  var Ye;
3136
3136
  if (Date.now() - _t > 18e5) {
3137
3137
  const Ae = "Stream idle timeout";
@@ -3139,11 +3139,11 @@ function Ox(e = {}) {
3139
3139
  }
3140
3140
  }, 5e3), an = 1024 * 1024;
3141
3141
  try {
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";
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, Ht = String(Ae ?? "").toLowerCase() === "true";
3143
3143
  for (S.current && !S.current.threadId && (S.current = {
3144
3144
  ...S.current,
3145
3145
  threadId: Nt
3146
- }), (Y = A == null ? void 0 : A.onOpen) == null || Y.call(A, { threadId: Nt, created: Bt }); ; ) {
3146
+ }), (Y = A == null ? void 0 : A.onOpen) == null || Y.call(A, { threadId: Nt, created: Ht }); ; ) {
3147
3147
  const { value: U, done: ye } = await rt.read();
3148
3148
  if (ye) break;
3149
3149
  ft += It.decode(U, { stream: !0 }), ft.length > an && (ft = "", console.warn("Stream buffer reset: exceeded 1MB"));
@@ -3155,32 +3155,32 @@ function Ox(e = {}) {
3155
3155
  ft = ft.slice(z + 2);
3156
3156
  const ge = Dx(ee);
3157
3157
  if (!ge) continue;
3158
- let Ee;
3158
+ let Se;
3159
3159
  try {
3160
- Ee = JSON.parse(ge);
3160
+ Se = JSON.parse(ge);
3161
3161
  } catch {
3162
3162
  console.debug("[use-chat] malformed SSE:", ge.slice(0, 200));
3163
3163
  continue;
3164
3164
  }
3165
- const ie = Mx(Ee) ? Ee.data : Ee;
3165
+ const ie = Mx(Se) ? Se.data : Se;
3166
3166
  _t = Date.now();
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 });
3167
+ const Le = ie.seq;
3168
+ if (Le !== void 0) {
3169
+ if (Le <= gt) {
3170
+ console.debug("[use-chat] drop duplicate/out-of-order event", { seq: Le, lastProcessedSeq: gt, type: ie.type });
3171
3171
  continue;
3172
3172
  }
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);
3173
+ gt > 0 && Le > gt + 1 && ((D = A == null ? void 0 : A.onGap) == null || D.call(A, { from: gt, to: Le })), gt = Le, C.current = Le, y(Le);
3174
3174
  }
3175
3175
  if (console.debug("[use-chat] received event", {
3176
3176
  seq: ie.seq,
3177
3177
  type: ie.type,
3178
3178
  preview: (() => {
3179
- var Fe;
3179
+ var Pe;
3180
3180
  try {
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) };
3181
+ return ie.type === "message_delta" ? { deltaTypes: (Pe = ie.delta) == null ? void 0 : Pe.map((Oe) => Oe.type), textLen: (ie.delta || []).filter((Oe) => Oe.type === "text").map((Oe) => String(Oe.text || "").length) } : ie.content || ie.delta ? { hasContent: !0 } : {};
3182
+ } catch (Oe) {
3183
+ return { err: String(Oe) };
3184
3184
  }
3185
3185
  })()
3186
3186
  }), ie.type === "checkpoint")
@@ -3188,46 +3188,46 @@ function Ox(e = {}) {
3188
3188
  else if (ie.type === "state_history") {
3189
3189
  N.current = ie;
3190
3190
  try {
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);
3191
+ const Oe = fr(ie).latest;
3192
+ Oe && (k.current = Oe.checkpointId ?? null, E.current = Oe.checkpointNs ?? null, m(Oe.checkpointId ?? null));
3193
+ } catch (Pe) {
3194
+ console.warn("[use-chat] Failed to hydrate state_history payload", Pe);
3195
3195
  }
3196
3196
  }
3197
3197
  try {
3198
3198
  F == null || F(ie);
3199
- } catch (Fe) {
3200
- console.error("[use-chat] Error in onEvent callback:", Fe, "for event:", ie.type);
3199
+ } catch (Pe) {
3200
+ console.error("[use-chat] Error in onEvent callback:", Pe, "for event:", ie.type);
3201
3201
  }
3202
3202
  if (ie.type === "token" && e.autoAppendAssistant !== !1)
3203
3203
  mt.push(ie.content), At();
3204
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());
3205
+ const Pe = ie.delta.filter((Oe) => Oe.type === "text").map((Oe) => Oe.text).join("");
3206
+ Pe && e.autoAppendAssistant !== !1 && (mt.push(Pe), At());
3207
3207
  } else if (ie.type === "heartbeat") {
3208
3208
  console.debug("[use-chat] heartbeat received");
3209
3209
  try {
3210
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);
3211
+ } catch (Pe) {
3212
+ console.warn("[use-chat] heartbeat callback failed", Pe);
3213
3213
  }
3214
- } else if (at !== null && cancelAnimationFrame(at), Oe(), ie.type === "checkpoint")
3214
+ } else if (at !== null && cancelAnimationFrame(at), De(), ie.type === "checkpoint")
3215
3215
  m(ie.checkpointId);
3216
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);
3217
+ const Pe = ie;
3218
+ if (d(Pe.message), L = "error", _ = Pe.message, Pe.error_type === "auth_error" || Pe.code === "TOKEN_EXPIRED" || ((W = Pe.message) == null ? void 0 : W.includes("token")) || ((se = Pe.message) == null ? void 0 : se.includes("401")) || ((re = Pe.message) == null ? void 0 : re.includes("unauthorized")) || ((Fe = Pe.message) == null ? void 0 : Fe.includes("Unauthorized"))) {
3219
+ console.error("[use-chat] Auth error detected:", Pe.message);
3220
3220
  try {
3221
- (Ke = A == null ? void 0 : A.onAuthError) == null || Ke.call(A, Fe.message);
3222
- } catch (Jt) {
3223
- console.warn("[use-chat] onAuthError handler failed", Jt);
3221
+ (Ke = A == null ? void 0 : A.onAuthError) == null || Ke.call(A, Pe.message);
3222
+ } catch (Mt) {
3223
+ console.warn("[use-chat] onAuthError handler failed", Mt);
3224
3224
  }
3225
3225
  X.abort();
3226
3226
  }
3227
3227
  }
3228
3228
  }
3229
3229
  }
3230
- Oe(), L === null && !X.signal.aborted && (L = "complete");
3230
+ De(), L === null && !X.signal.aborted && (L = "complete");
3231
3231
  } catch (Ye) {
3232
3232
  if (Ye.name === "AbortError")
3233
3233
  L = L ?? "aborted";
@@ -3242,23 +3242,23 @@ function Ox(e = {}) {
3242
3242
  } finally {
3243
3243
  (oe = rt.releaseLock) == null || oe.call(rt);
3244
3244
  }
3245
- at !== null && typeof window < "u" && window.cancelAnimationFrame(at), clearInterval(Xt);
3245
+ at !== null && typeof window < "u" && window.cancelAnimationFrame(at), clearInterval(Jt);
3246
3246
  }
3247
3247
  } catch (Ze) {
3248
3248
  if (Ze.name === "AbortError")
3249
3249
  L = L ?? "aborted";
3250
3250
  else {
3251
3251
  const nt = Ze.message || String(Ze);
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);
3252
+ L = "error", _ = nt, d(nt), (he = A == null ? void 0 : A.onError) == null || he.call(A, nt), J || ((ke = A == null ? void 0 : A.onConnectionError) == null || ke.call(A, nt), J = !0);
3253
3253
  }
3254
3254
  } finally {
3255
- const Ze = C.current, nt = k.current, $e = E.current, Ue = N.current, qe = L ?? (X.signal.aborted ? "aborted" : _ ? "error" : "complete");
3255
+ const Ze = C.current, nt = k.current, ze = E.current, Ue = N.current, qe = L ?? (X.signal.aborted ? "aborted" : _ ? "error" : "complete");
3256
3256
  try {
3257
3257
  (He = A == null ? void 0 : A.onClosed) == null || He.call(A, {
3258
3258
  reason: qe,
3259
3259
  lastSeq: Ze,
3260
3260
  lastCheckpointId: nt,
3261
- lastCheckpointNs: $e,
3261
+ lastCheckpointNs: ze,
3262
3262
  lastStateHistory: Ue,
3263
3263
  error: _
3264
3264
  });
@@ -3361,13 +3361,13 @@ function Fx(e, t) {
3361
3361
  }
3362
3362
  }
3363
3363
  function zx(e = []) {
3364
- const [t, n] = Jh(Fx, { ...$x, messages: e }), r = Ve([]), o = Ve(null), s = Ve(null), i = Se(() => {
3364
+ const [t, n] = Jh(Fx, { ...$x, messages: e }), r = Ve([]), o = Ve(null), s = Ve(null), i = Ce(() => {
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 } }));
3368
- }, []), a = Se(() => {
3368
+ }, []), a = Ce(() => {
3369
3369
  typeof window < "u" && typeof window.requestAnimationFrame == "function" ? o.current === null && (o.current = window.requestAnimationFrame(() => i())) : s.current === null && (s.current = setTimeout(i, 8));
3370
- }, [i]), l = Se((d) => {
3370
+ }, [i]), l = Ce((d) => {
3371
3371
  r.current.push(d), a();
3372
3372
  }, [a]);
3373
3373
  Tt(() => () => {
@@ -3719,7 +3719,7 @@ function Vx({
3719
3719
  onAuthError: l,
3720
3720
  onHeartbeat: c
3721
3721
  }) {
3722
- const d = Ve(null), f = Ve(null), p = Ve(/* @__PURE__ */ new Map()), h = Ve(null), m = Ve(null), x = Se((j) => {
3722
+ const d = Ve(null), f = Ve(null), p = Ve(/* @__PURE__ */ new Map()), h = Ve(null), m = Ve(null), x = Ce((j) => {
3723
3723
  try {
3724
3724
  const P = globalThis.structuredClone;
3725
3725
  if (typeof P == "function")
@@ -3731,16 +3731,16 @@ function Vx({
3731
3731
  } catch {
3732
3732
  return j;
3733
3733
  }
3734
- }, []), y = Se(
3734
+ }, []), y = Ce(
3735
3735
  (j, P) => {
3736
3736
  if (!j) return;
3737
3737
  const $ = p.current.get(j) ?? [], I = x(P), F = $.length >= Ol ? [...$.slice($.length - Ol + 1), I] : [...$, I];
3738
3738
  p.current.set(j, F);
3739
3739
  },
3740
3740
  [x]
3741
- ), g = Se((j) => {
3741
+ ), g = Ce((j) => {
3742
3742
  j && p.current.set(j, []);
3743
- }, []), w = Se(
3743
+ }, []), w = Ce(
3744
3744
  (j) => {
3745
3745
  const P = j ?? f.current;
3746
3746
  if (!P) return;
@@ -3754,7 +3754,7 @@ function Vx({
3754
3754
  });
3755
3755
  },
3756
3756
  [n]
3757
- ), b = Se(
3757
+ ), b = Ce(
3758
3758
  (j) => {
3759
3759
  var I, F, A, X, L;
3760
3760
  const P = j.seq ?? null;
@@ -3823,7 +3823,7 @@ function Vx({
3823
3823
  ), { stream: T, stop: C, isStreaming: S, error: k, setToken: E } = Ox({
3824
3824
  baseUrl: e,
3825
3825
  token: void 0
3826
- }), N = Se(
3826
+ }), N = Ce(
3827
3827
  (j, P) => {
3828
3828
  d.current = null, m.current = null, f.current = j.threadId ?? null, h.current = {
3829
3829
  request: j,
@@ -3897,7 +3897,7 @@ function Vx({
3897
3897
  i,
3898
3898
  T
3899
3899
  ]
3900
- ), M = Se(() => {
3900
+ ), M = Ce(() => {
3901
3901
  h.current && (h.current.manualStop = !0), C();
3902
3902
  }, [C]);
3903
3903
  return ot(
@@ -3913,7 +3913,7 @@ function Vx({
3913
3913
  );
3914
3914
  }
3915
3915
  function Kx() {
3916
- const e = Ve(/* @__PURE__ */ new Map()), t = Se(
3916
+ const e = Ve(/* @__PURE__ */ new Map()), t = Ce(
3917
3917
  (a, l) => {
3918
3918
  const c = e.current.get(a), d = /* @__PURE__ */ new Map();
3919
3919
  c && c.forEach((f) => {
@@ -3923,24 +3923,24 @@ function Kx() {
3923
3923
  }), e.current.set(a, Array.from(d.values()));
3924
3924
  },
3925
3925
  []
3926
- ), n = Se(
3926
+ ), n = Ce(
3927
3927
  (a, l) => {
3928
3928
  const c = e.current.get(a);
3929
3929
  return c == null ? void 0 : c.find((d) => d.checkpointId === l);
3930
3930
  },
3931
3931
  []
3932
- ), r = Se(
3932
+ ), r = Ce(
3933
3933
  (a, l) => {
3934
3934
  const c = e.current.get(a);
3935
3935
  return (c == null ? void 0 : c.some((d) => d.checkpointId === l)) ?? !1;
3936
3936
  },
3937
3937
  []
3938
- ), o = Se(
3938
+ ), o = Ce(
3939
3939
  (a) => e.current.get(a),
3940
3940
  []
3941
- ), s = Se((a) => {
3941
+ ), s = Ce((a) => {
3942
3942
  e.current.delete(a);
3943
- }, []), i = Se(() => {
3943
+ }, []), i = Ce(() => {
3944
3944
  e.current.clear();
3945
3945
  }, []);
3946
3946
  return {
@@ -3966,24 +3966,24 @@ function qx({
3966
3966
  onThreadChange: a,
3967
3967
  checkpointMetadataCache: l
3968
3968
  }) {
3969
- const { api: c, baseUrl: d } = xu(), f = ot(() => An(d), [d]), [p, h] = ve([]), [m, x] = ve(t), [y, g] = ve(!1), [w, b] = ve(null), [T, C] = ve(!1), [S, k] = ve(null), { state: E, seed: N, prepend: M, pushUser: j, onEvent: P } = zx(), [$, I] = ve(!1), [F, A] = ve(!1), [X, L] = ve(null), [_, J] = ve([]), [G, fe] = ve([]), [Ce, Ne] = ve(!1), q = ot(
3969
+ const { api: c, baseUrl: d } = xu(), f = ot(() => An(d), [d]), [p, h] = ve([]), [m, x] = ve(t), [y, g] = ve(!1), [w, b] = ve(null), [T, C] = ve(!1), [S, k] = ve(null), { state: E, seed: N, prepend: M, pushUser: j, onEvent: P } = zx(), [$, I] = ve(!1), [F, A] = ve(!1), [X, L] = ve(null), [_, J] = ve([]), [G, fe] = ve([]), [Te, Ne] = ve(!1), q = ot(
3970
3970
  () => _.flatMap((z) => z.messages ?? []),
3971
3971
  [_]
3972
- ), ne = ot(() => Px(q), [q]), Y = l ?? Kx(), { setCacheForThread: D } = Y, H = Se(
3972
+ ), ne = ot(() => Px(q), [q]), Y = l ?? Kx(), { setCacheForThread: D } = Y, H = Ce(
3973
3973
  (z, ee, ge) => {
3974
- const Ee = ee.filter((ie) => ie.checkpointId).map((ie) => ({
3974
+ const Se = ee.filter((ie) => ie.checkpointId).map((ie) => ({
3975
3975
  checkpointId: ie.checkpointId,
3976
3976
  checkpointNs: ie.checkpointNs ?? void 0,
3977
3977
  createdAt: ie.createdAt ?? ""
3978
3978
  }));
3979
- console.log(`[ChatSessionProvider] Cached metadata for ${Ee.length} checkpoints from ${ge}`), D(z, Ee);
3979
+ console.log(`[ChatSessionProvider] Cached metadata for ${Se.length} checkpoints from ${ge}`), D(z, Se);
3980
3980
  },
3981
3981
  [D]
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());
3982
+ ), W = Ve(m), se = Ve(null), re = Ve(null), Fe = 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]);
3986
- const Te = Se(async () => {
3986
+ const ke = Ce(async () => {
3987
3987
  g(!0), b(null);
3988
3988
  try {
3989
3989
  const z = await c.listThreads();
@@ -3994,7 +3994,7 @@ function qx({
3994
3994
  } finally {
3995
3995
  g(!1);
3996
3996
  }
3997
- }, [c, s]), He = Se((z) => {
3997
+ }, [c, s]), He = Ce((z) => {
3998
3998
  if (!(z != null && z.threadId)) return;
3999
3999
  const ee = {
4000
4000
  threadId: z.threadId,
@@ -4004,25 +4004,28 @@ function qx({
4004
4004
  messageCount: z.messageCount ?? 1
4005
4005
  };
4006
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
- }, []), Ze = Se(
4007
+ }, []), Ze = Ce(
4008
4008
  (z) => {
4009
4009
  const ee = z.threadId ?? W.current;
4010
4010
  if (!ee || W.current && W.current !== ee)
4011
4011
  return;
4012
- const { checkpoints: ge, timeline: Ee } = fr(z);
4012
+ const { checkpoints: ge, timeline: Se } = fr(z);
4013
4013
  if (!ge.length)
4014
4014
  return;
4015
4015
  H(ee, ge, "stream state_history");
4016
- const ie = ge.find((ze) => ze.messages && ze.messages.length > 0) ?? ge.find((ze) => !!ze.checkpointId) ?? ge[0];
4016
+ const ie = ge.find((Le) => Le.messages && Le.messages.length > 0) ?? ge.find((Le) => !!Le.checkpointId) ?? ge[0];
4017
4017
  N((ie == null ? void 0 : ie.messages) ?? [], {
4018
4018
  checkpointId: (ie == null ? void 0 : ie.checkpointId) ?? null,
4019
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;
4020
+ }), Se.length && fe((Le) => {
4021
+ const Pe = new Set(Se.map((Mt) => Mt.id));
4022
+ return [...Le.filter((Mt) => !Pe.has(Mt.id)), ...Se];
4023
+ }), J(ge), I(!!(ie != null && ie.nextCursor)), L((ie == null ? void 0 : ie.nextCursor) ?? null), oe.current = `${ee}:latest`, re.current = null, Fe.current = null;
4021
4024
  },
4022
4025
  [H, N]
4023
- ), nt = Se((z) => {
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({
4026
+ ), nt = Ce((z) => {
4027
+ console.log("[ChatSessionProvider] 🎯 Received thread_info:", z.threadId), He(z), W.current !== z.threadId && (re.current = z.threadId, Fe.current = z.threadId, console.log("[ChatSessionProvider] thread_info: marking to skip auto-load for new thread"), x(z.threadId));
4028
+ }, [He]), { startStream: ze, stop: Ue, isStreaming: qe, error: rt, setAuthToken: It } = Vx({
4026
4029
  baseUrl: f,
4027
4030
  onThreadInfo: nt,
4028
4031
  onMessageEvent: P,
@@ -4031,63 +4034,63 @@ function qx({
4031
4034
  console.warn("[ChatSessionProvider] Unhandled event:", z.type);
4032
4035
  },
4033
4036
  onAuthError: i
4034
- }), ft = Se(
4037
+ }), ft = Ce(
4035
4038
  async (z) => {
4036
4039
  try {
4037
4040
  const ee = await c.createThread(z);
4038
- return x(ee.threadId), await Te(), ee.threadId;
4041
+ return x(ee.threadId), await ke(), ee.threadId;
4039
4042
  } catch (ee) {
4040
4043
  return s == null || s(String(ee)), null;
4041
4044
  }
4042
4045
  },
4043
- [c, Te, s]
4044
- ), mt = Se(
4046
+ [c, ke, s]
4047
+ ), mt = Ce(
4045
4048
  async (z) => {
4046
4049
  try {
4047
- await c.deleteThread(z), W.current === z && (x(null), N([], {})), await Te();
4050
+ await c.deleteThread(z), W.current === z && (x(null), N([], {})), await ke();
4048
4051
  } catch (ee) {
4049
4052
  s == null || s(String(ee));
4050
4053
  }
4051
4054
  },
4052
- [c, Te, N, s]
4053
- ), gt = Se(
4055
+ [c, ke, N, s]
4056
+ ), gt = Ce(
4054
4057
  async (z, ee) => {
4055
4058
  try {
4056
- await c.updateThread(z, ee), await Te();
4059
+ await c.updateThread(z, ee), await ke();
4057
4060
  } catch (ge) {
4058
4061
  s == null || s(String(ge));
4059
4062
  }
4060
4063
  },
4061
- [c, Te, s]
4062
- ), at = Se(
4064
+ [c, ke, s]
4065
+ ), at = Ce(
4063
4066
  async (z, ee) => {
4064
4067
  if (!z) return;
4065
- const ge = `${z}:${ee ?? "latest"}`, Ee = he.current.get(ge);
4066
- if (Ee)
4067
- return Ee;
4068
+ const ge = `${z}:${ee ?? "latest"}`, Se = he.current.get(ge);
4069
+ if (Se)
4070
+ return Se;
4068
4071
  const ie = (async () => {
4069
- const ze = z;
4072
+ const Le = z;
4070
4073
  C(!0), k(null);
4071
4074
  try {
4072
- const Fe = await c.getStateHistory({
4073
- threadId: ze,
4075
+ const Pe = await c.getStateHistory({
4076
+ threadId: Le,
4074
4077
  checkpointId: ee || void 0
4075
4078
  });
4076
- if (W.current !== ze) {
4077
- console.log(`[ChatSessionProvider] Thread changed during load (was ${ze}, now ${W.current}), discarding stale data`);
4079
+ if (W.current !== Le) {
4080
+ console.log(`[ChatSessionProvider] Thread changed during load (was ${Le}, now ${W.current}), discarding stale data`);
4078
4081
  return;
4079
4082
  }
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];
4083
+ const { checkpoints: Oe, timeline: Mt } = fr(Pe);
4084
+ H(Le, Oe, `thread load (requested: ${ee})`);
4085
+ const wt = Oe.find((En) => En.messages && En.messages.length > 0) ?? (ee ? Oe.find((En) => En.checkpointId === ee) : null) ?? Oe[0];
4083
4086
  N((wt == null ? void 0 : wt.messages) ?? [], {
4084
4087
  checkpointId: (wt == null ? void 0 : wt.checkpointId) ?? null,
4085
4088
  checkpointNs: (wt == null ? void 0 : wt.checkpointNs) ?? null
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);
4089
+ }), fe(Mt), J(Oe), I(!!(wt != null && wt.nextCursor)), L((wt == null ? void 0 : wt.nextCursor) ?? null);
4090
+ } catch (Pe) {
4091
+ if (W.current === Le) {
4092
+ const Oe = String(Pe);
4093
+ k(Oe), s == null || s(Oe);
4091
4094
  }
4092
4095
  } finally {
4093
4096
  C(!1);
@@ -4102,7 +4105,7 @@ function qx({
4102
4105
  return W.current === z && (oe.current = ge), ie;
4103
4106
  },
4104
4107
  [c, N, s, H]
4105
- ), Oe = Se(
4108
+ ), De = Ce(
4106
4109
  async (z, ee) => {
4107
4110
  Ke.current = z;
4108
4111
  try {
@@ -4120,7 +4123,7 @@ function qx({
4120
4123
  re.current = null;
4121
4124
  return;
4122
4125
  }
4123
- if (Le.current === m)
4126
+ if (Fe.current === m)
4124
4127
  return;
4125
4128
  if (Ke.current === m) {
4126
4129
  Ke.current = null, se.current = m;
@@ -4137,7 +4140,7 @@ function qx({
4137
4140
  r ? `(ns: ${r})` : ""
4138
4141
  )) : console.log("[ChatSessionProvider] Loading thread with latest checkpoint");
4139
4142
  const ge = `${m}:${ee ?? "latest"}`;
4140
- oe.current !== ge && Oe(m, ee);
4143
+ oe.current !== ge && De(m, ee);
4141
4144
  }, [
4142
4145
  o,
4143
4146
  m,
@@ -4146,45 +4149,45 @@ function qx({
4146
4149
  t,
4147
4150
  T,
4148
4151
  qe,
4149
- Oe
4152
+ De
4150
4153
  ]);
4151
- const At = Se(
4154
+ const At = Ce(
4152
4155
  async (z, ee) => {
4153
4156
  const ge = W.current;
4154
4157
  if (!ge) return;
4155
- const Ee = ge;
4158
+ const Se = ge;
4156
4159
  Ne(!0);
4157
4160
  try {
4158
4161
  const ie = await c.getStateHistory({
4159
- threadId: Ee,
4162
+ threadId: Se,
4160
4163
  checkpointId: z,
4161
4164
  checkpointNs: ee ?? void 0
4162
4165
  });
4163
- if (W.current !== Ee) {
4164
- console.log(`[ChatSessionProvider] Thread changed during checkpoint navigation (was ${Ee}, now ${W.current}), discarding stale data`);
4166
+ if (W.current !== Se) {
4167
+ console.log(`[ChatSessionProvider] Thread changed during checkpoint navigation (was ${Se}, now ${W.current}), discarding stale data`);
4165
4168
  return;
4166
4169
  }
4167
- const { checkpoints: ze, timeline: Fe } = fr(ie);
4168
- H(Ee, ze, "checkpoint navigation");
4169
- const Me = ze.find(
4170
- (Jt) => Jt.checkpointId === z && (ee ? Jt.checkpointNs === ee : !0)
4170
+ const { checkpoints: Le, timeline: Pe } = fr(ie);
4171
+ H(Se, Le, "checkpoint navigation");
4172
+ const Oe = Le.find(
4173
+ (Mt) => Mt.checkpointId === z && (ee ? Mt.checkpointNs === ee : !0)
4171
4174
  );
4172
- if (!Me) {
4175
+ if (!Oe) {
4173
4176
  console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: z, checkpointNs: ee });
4174
4177
  return;
4175
4178
  }
4176
- fe(Fe), J(ze), N(Me.messages ?? [], {
4177
- checkpointId: Me.checkpointId ?? null,
4178
- checkpointNs: Me.checkpointNs ?? null
4179
+ fe(Pe), J(Le), N(Oe.messages ?? [], {
4180
+ checkpointId: Oe.checkpointId ?? null,
4181
+ checkpointNs: Oe.checkpointNs ?? null
4179
4182
  });
4180
4183
  } catch (ie) {
4181
- W.current === Ee && (s == null || s(String(ie)));
4184
+ W.current === Se && (s == null || s(String(ie)));
4182
4185
  } finally {
4183
4186
  Ne(!1);
4184
4187
  }
4185
4188
  },
4186
4189
  [c, N, s, H]
4187
- ), _t = Se(
4190
+ ), _t = Ce(
4188
4191
  (z, ee) => {
4189
4192
  N(E.messages, {
4190
4193
  checkpointId: z ?? null,
@@ -4192,9 +4195,9 @@ function qx({
4192
4195
  });
4193
4196
  },
4194
4197
  [N, E.messages]
4195
- ), Xt = Se(async () => {
4196
- W.current && await Oe(W.current);
4197
- }, [Oe]), an = Se(async () => {
4198
+ ), Jt = Ce(async () => {
4199
+ W.current && await De(W.current);
4200
+ }, [De]), an = Ce(async () => {
4198
4201
  if (!W.current || !X) return;
4199
4202
  const z = W.current;
4200
4203
  A(!0);
@@ -4209,83 +4212,83 @@ function qx({
4209
4212
  }
4210
4213
  const { checkpoints: ge } = fr(ee);
4211
4214
  if (ge.length > 0) {
4212
- const Ee = ge[ge.length - 1];
4213
- M((Ee == null ? void 0 : Ee.messages) ?? []), I(!!(Ee != null && Ee.nextCursor)), L((Ee == null ? void 0 : Ee.nextCursor) ?? null);
4215
+ const Se = ge[ge.length - 1];
4216
+ M((Se == null ? void 0 : Se.messages) ?? []), I(!!(Se != null && Se.nextCursor)), L((Se == null ? void 0 : Se.nextCursor) ?? null);
4214
4217
  }
4215
4218
  } catch (ee) {
4216
4219
  W.current === z && (s == null || s(String(ee)));
4217
4220
  } finally {
4218
4221
  A(!1);
4219
4222
  }
4220
- }, [c, X, M, s]), Ye = Se(async () => {
4223
+ }, [c, X, M, s]), Ye = Ce(async () => {
4221
4224
  N([], {}), x(null), Ue(), J([]), fe([]), I(!1), L(null), C(!1), Ne(!1), A(!1), k(null);
4222
4225
  try {
4223
4226
  await c.getAgent("default");
4224
4227
  } catch (z) {
4225
4228
  console.warn("[ChatSessionProvider] Failed to refetch agent after clearing thread:", z);
4226
4229
  }
4227
- }, [N, Ue, c]), Ae = Se(
4230
+ }, [N, Ue, c]), Ae = Ce(
4228
4231
  async (z, ee, ge) => {
4229
- const Ee = W.current;
4230
- if (!Ee)
4232
+ const Se = W.current;
4233
+ if (!Se)
4231
4234
  throw new Error("No active thread to handle interrupt");
4232
4235
  const ie = ee ? ge ?? !0 : !1;
4233
4236
  try {
4234
- const ze = {
4235
- threadId: Ee,
4237
+ const Le = {
4238
+ threadId: Se,
4236
4239
  checkpointId: E.lastCheckpointId ?? void 0,
4237
4240
  checkpointNs: E.lastCheckpointNs ?? void 0,
4238
4241
  // The command is the key: backend extracts this and routes to LangGraph
4239
4242
  command: { kind: "resume", value: ie }
4240
4243
  };
4241
- $e(ze);
4242
- } catch (ze) {
4243
- throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${z}:`, ze), ze;
4244
+ ze(Le);
4245
+ } catch (Le) {
4246
+ throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${z}:`, Le), Le;
4244
4247
  }
4245
4248
  },
4246
- [E.lastCheckpointId, E.lastCheckpointNs, $e]
4249
+ [E.lastCheckpointId, E.lastCheckpointNs, ze]
4247
4250
  );
4248
4251
  Tt(() => {
4249
- Te();
4250
- }, [Te]), Tt(() => {
4252
+ ke();
4253
+ }, [ke]), Tt(() => {
4251
4254
  a == null || a(m);
4252
4255
  }, [m, a]);
4253
- const Nt = Se(
4256
+ const Nt = Ce(
4254
4257
  async (z, ee) => {
4255
4258
  let ge = W.current;
4256
- const Ee = (z == null ? void 0 : z.text) ?? "";
4257
- if (!ge && !Ee) return;
4258
- if (!ge && Ee) {
4259
- const Jt = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), wt = Array.from(
4259
+ const Se = (z == null ? void 0 : z.text) ?? "";
4260
+ if (!ge && !Se) return;
4261
+ if (!ge && Se) {
4262
+ const Mt = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), wt = Array.from(
4260
4263
  { length: 4 },
4261
4264
  () => Math.floor(Math.random() * 4294967295).toString(16).padStart(8, "0")
4262
4265
  ).join("").slice(0, 16);
4263
- ge = `${Jt}${wt}`, re.current = ge, x(ge);
4266
+ ge = `${Mt}${wt}`, re.current = ge, x(ge);
4264
4267
  }
4265
4268
  const { contentParts: ie } = await dx(
4266
4269
  c,
4267
4270
  (z == null ? void 0 : z.attachments) ?? []
4268
- ), ze = [...ie];
4269
- Ee != null && Ee.trim() && ze.push({ type: "text", text: Ee });
4270
- const Fe = {
4271
+ ), Le = [...ie];
4272
+ Se != null && Se.trim() && Le.push({ type: "text", text: Se });
4273
+ const Pe = {
4271
4274
  id: `msg-${Date.now()}`,
4272
4275
  role: "user",
4273
- content: ze,
4276
+ content: Le,
4274
4277
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
4275
4278
  };
4276
- j(Fe);
4277
- const Me = {
4279
+ j(Pe);
4280
+ const Oe = {
4278
4281
  threadId: ge,
4279
4282
  payload: {
4280
- messages: [Fe]
4283
+ messages: [Pe]
4281
4284
  },
4282
4285
  checkpointId: (ee == null ? void 0 : ee.checkpointId) ?? E.lastCheckpointId ?? void 0,
4283
4286
  checkpointNs: (ee == null ? void 0 : ee.checkpointNs) ?? E.lastCheckpointNs ?? void 0
4284
4287
  };
4285
- $e(Me);
4288
+ ze(Oe);
4286
4289
  },
4287
- [c, ft, j, E, $e]
4288
- ), Bt = ot(
4290
+ [c, ft, j, E, ze]
4291
+ ), Ht = ot(
4289
4292
  () => ({
4290
4293
  threads: p,
4291
4294
  currentThreadId: m,
@@ -4296,10 +4299,10 @@ function qx({
4296
4299
  createThread: ft,
4297
4300
  deleteThread: mt,
4298
4301
  renameThread: gt,
4299
- refreshThreads: Te
4302
+ refreshThreads: ke
4300
4303
  }
4301
4304
  }),
4302
- [p, m, y, w, ft, mt, gt, Te]
4305
+ [p, m, y, w, ft, mt, gt, ke]
4303
4306
  ), U = ot(
4304
4307
  () => ({
4305
4308
  threadId: m,
@@ -4314,15 +4317,15 @@ function qx({
4314
4317
  metadata: null,
4315
4318
  isLoading: T,
4316
4319
  isHistoryLoading: F,
4317
- isLoadingCheckpoint: Ce,
4320
+ isLoadingCheckpoint: Te,
4318
4321
  error: S,
4319
4322
  hasMore: $,
4320
4323
  loadOlder: an,
4321
4324
  clearState: Ye,
4322
4325
  navigateToCheckpoint: At,
4323
4326
  setCurrentCheckpointId: _t,
4324
- returnToLatest: Xt,
4325
- loadThread: Oe,
4327
+ returnToLatest: Jt,
4328
+ loadThread: De,
4326
4329
  clearThread: Ye,
4327
4330
  respondToInterrupt: Ae,
4328
4331
  messagePreviews: ne
@@ -4334,15 +4337,15 @@ function qx({
4334
4337
  G,
4335
4338
  T,
4336
4339
  F,
4337
- Ce,
4340
+ Te,
4338
4341
  S,
4339
4342
  $,
4340
4343
  an,
4341
4344
  Ye,
4342
4345
  At,
4343
4346
  _t,
4344
- Xt,
4345
- Oe,
4347
+ Jt,
4348
+ De,
4346
4349
  Ae,
4347
4350
  ne
4348
4351
  ]
@@ -4358,7 +4361,7 @@ function qx({
4358
4361
  }),
4359
4362
  [qe, rt, Nt, Ue, It]
4360
4363
  );
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 }) }) });
4364
+ return /* @__PURE__ */ u.jsx(Cu.Provider, { value: Ht, children: /* @__PURE__ */ u.jsx(Tu.Provider, { value: U, children: /* @__PURE__ */ u.jsx(ku.Provider, { value: ye, children: e }) }) });
4362
4365
  }
4363
4366
  function da() {
4364
4367
  const e = fs(Cu);
@@ -4504,8 +4507,8 @@ function Xx({
4504
4507
  try {
4505
4508
  const G = l(A);
4506
4509
  G && typeof G.then == "function" ? G.then(() => {
4507
- var fe, Ce;
4508
- ((fe = S.current) == null ? void 0 : fe.id) === X && S.current.shouldClear && (m || (y(""), T.current && (T.current.style.height = "auto"), a == null || a(""))), ((Ce = S.current) == null ? void 0 : Ce.id) === X && (S.current = null);
4510
+ var fe, Te;
4511
+ ((fe = S.current) == null ? void 0 : fe.id) === X && S.current.shouldClear && (m || (y(""), T.current && (T.current.style.height = "auto"), a == null || a(""))), ((Te = S.current) == null ? void 0 : Te.id) === X && (S.current = null);
4509
4512
  }).catch(() => {
4510
4513
  var fe;
4511
4514
  ((fe = S.current) == null ? void 0 : fe.id) === X && (S.current = null);
@@ -5071,7 +5074,7 @@ function Nn(e) {
5071
5074
  n((r) => r ?? String(by++));
5072
5075
  }, [e]), t ? `radix-${t}` : "";
5073
5076
  }
5074
- const Sy = ["top", "right", "bottom", "left"], Dn = Math.min, Kt = Math.max, qo = Math.round, bo = Math.floor, Sn = (e) => ({
5077
+ const Sy = ["top", "right", "bottom", "left"], Dn = Math.min, qt = Math.max, qo = Math.round, bo = Math.floor, Sn = (e) => ({
5075
5078
  x: e,
5076
5079
  y: e
5077
5080
  }), Cy = {
@@ -5084,7 +5087,7 @@ const Sy = ["top", "right", "bottom", "left"], Dn = Math.min, Kt = Math.max, qo
5084
5087
  end: "start"
5085
5088
  };
5086
5089
  function Di(e, t, n) {
5087
- return Kt(e, Dn(t, n));
5090
+ return qt(e, Dn(t, n));
5088
5091
  }
5089
5092
  function _n(e, t) {
5090
5093
  return typeof e == "function" ? e(t) : e;
@@ -5674,8 +5677,8 @@ const $y = function(e) {
5674
5677
  const w = x - d.top - d.bottom, b = m - d.left - d.right, T = Dn(x - d[y], w), C = Dn(m - d[g], b), S = !t.middlewareData.shift;
5675
5678
  let k = T, E = C;
5676
5679
  if ((n = t.middlewareData.shift) != null && n.enabled.x && (E = b), (r = t.middlewareData.shift) != null && r.enabled.y && (k = w), S && !p) {
5677
- const M = Kt(d.left, 0), j = Kt(d.right, 0), P = Kt(d.top, 0), $ = Kt(d.bottom, 0);
5678
- h ? E = m - 2 * (M !== 0 || j !== 0 ? M + j : Kt(d.left, d.right)) : k = x - 2 * (P !== 0 || $ !== 0 ? P + $ : Kt(d.top, d.bottom));
5680
+ const M = qt(d.left, 0), j = qt(d.right, 0), P = qt(d.top, 0), $ = qt(d.bottom, 0);
5681
+ h ? E = m - 2 * (M !== 0 || j !== 0 ? M + j : qt(d.left, d.right)) : k = x - 2 * (P !== 0 || $ !== 0 ? P + $ : qt(d.top, d.bottom));
5679
5682
  }
5680
5683
  await l({
5681
5684
  ...t,
@@ -5697,7 +5700,7 @@ function Ts() {
5697
5700
  function Er(e) {
5698
5701
  return Pu(e) ? (e.nodeName || "").toLowerCase() : "#document";
5699
5702
  }
5700
- function Gt(e) {
5703
+ function Yt(e) {
5701
5704
  var t;
5702
5705
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
5703
5706
  }
@@ -5706,16 +5709,16 @@ function Tn(e) {
5706
5709
  return (t = (Pu(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
5707
5710
  }
5708
5711
  function Pu(e) {
5709
- return Ts() ? e instanceof Node || e instanceof Gt(e).Node : !1;
5712
+ return Ts() ? e instanceof Node || e instanceof Yt(e).Node : !1;
5710
5713
  }
5711
5714
  function fn(e) {
5712
- return Ts() ? e instanceof Element || e instanceof Gt(e).Element : !1;
5715
+ return Ts() ? e instanceof Element || e instanceof Yt(e).Element : !1;
5713
5716
  }
5714
5717
  function Cn(e) {
5715
- return Ts() ? e instanceof HTMLElement || e instanceof Gt(e).HTMLElement : !1;
5718
+ return Ts() ? e instanceof HTMLElement || e instanceof Yt(e).HTMLElement : !1;
5716
5719
  }
5717
5720
  function Gl(e) {
5718
- return !Ts() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Gt(e).ShadowRoot;
5721
+ return !Ts() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Yt(e).ShadowRoot;
5719
5722
  }
5720
5723
  const Hy = /* @__PURE__ */ new Set(["inline", "contents"]);
5721
5724
  function co(e) {
@@ -5765,7 +5768,7 @@ function Sr(e) {
5765
5768
  return Xy.has(Er(e));
5766
5769
  }
5767
5770
  function pn(e) {
5768
- return Gt(e).getComputedStyle(e);
5771
+ return Yt(e).getComputedStyle(e);
5769
5772
  }
5770
5773
  function Rs(e) {
5771
5774
  return fn(e) ? {
@@ -5795,7 +5798,7 @@ function Ou(e) {
5795
5798
  function Gr(e, t, n) {
5796
5799
  var r;
5797
5800
  t === void 0 && (t = []), n === void 0 && (n = !0);
5798
- const o = Ou(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), i = Gt(o);
5801
+ const o = Ou(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), i = Yt(o);
5799
5802
  if (s) {
5800
5803
  const a = $i(i);
5801
5804
  return t.concat(i, i.visualViewport || [], co(o) ? o : [], a && n ? Gr(a) : []);
@@ -5835,14 +5838,14 @@ function mr(e) {
5835
5838
  }
5836
5839
  const Jy = /* @__PURE__ */ Sn(0);
5837
5840
  function Du(e) {
5838
- const t = Gt(e);
5841
+ const t = Yt(e);
5839
5842
  return !wa() || !t.visualViewport ? Jy : {
5840
5843
  x: t.visualViewport.offsetLeft,
5841
5844
  y: t.visualViewport.offsetTop
5842
5845
  };
5843
5846
  }
5844
5847
  function Zy(e, t, n) {
5845
- return t === void 0 && (t = !1), !n || t && n !== Gt(e) ? !1 : t;
5848
+ return t === void 0 && (t = !1), !n || t && n !== Yt(e) ? !1 : t;
5846
5849
  }
5847
5850
  function Qn(e, t, n, r) {
5848
5851
  t === void 0 && (t = !1), n === void 0 && (n = !1);
@@ -5852,11 +5855,11 @@ function Qn(e, t, n, r) {
5852
5855
  const a = Zy(s, n, r) ? Du(s) : Sn(0);
5853
5856
  let l = (o.left + a.x) / i.x, c = (o.top + a.y) / i.y, d = o.width / i.x, f = o.height / i.y;
5854
5857
  if (s) {
5855
- const p = Gt(s), h = r && fn(r) ? Gt(r) : r;
5858
+ const p = Yt(s), h = r && fn(r) ? Yt(r) : r;
5856
5859
  let m = p, x = $i(m);
5857
5860
  for (; x && r && h !== m; ) {
5858
5861
  const y = mr(x), g = x.getBoundingClientRect(), w = pn(x), b = g.left + (x.clientLeft + parseFloat(w.paddingLeft)) * y.x, T = g.top + (x.clientTop + parseFloat(w.paddingTop)) * y.y;
5859
- l *= y.x, c *= y.y, d *= y.x, f *= y.y, l += b, c += T, m = Gt(x), x = $i(m);
5862
+ l *= y.x, c *= y.y, d *= y.x, f *= y.y, l += b, c += T, m = Yt(x), x = $i(m);
5860
5863
  }
5861
5864
  }
5862
5865
  return Yo({
@@ -5908,10 +5911,10 @@ function ev(e) {
5908
5911
  return Array.from(e.getClientRects());
5909
5912
  }
5910
5913
  function tv(e) {
5911
- const t = Tn(e), n = Rs(e), r = e.ownerDocument.body, o = Kt(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = Kt(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
5914
+ const t = Tn(e), n = Rs(e), r = e.ownerDocument.body, o = qt(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = qt(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
5912
5915
  let i = -n.scrollLeft + Es(e);
5913
5916
  const a = -n.scrollTop;
5914
- return pn(r).direction === "rtl" && (i += Kt(t.clientWidth, r.clientWidth) - o), {
5917
+ return pn(r).direction === "rtl" && (i += qt(t.clientWidth, r.clientWidth) - o), {
5915
5918
  width: o,
5916
5919
  height: s,
5917
5920
  x: i,
@@ -5920,7 +5923,7 @@ function tv(e) {
5920
5923
  }
5921
5924
  const Yl = 25;
5922
5925
  function nv(e, t) {
5923
- const n = Gt(e), r = Tn(e), o = n.visualViewport;
5926
+ const n = Yt(e), r = Tn(e), o = n.visualViewport;
5924
5927
  let s = r.clientWidth, i = r.clientHeight, a = 0, l = 0;
5925
5928
  if (o) {
5926
5929
  s = o.width, i = o.height;
@@ -5994,7 +5997,7 @@ function iv(e) {
5994
5997
  } = e;
5995
5998
  const i = [...n === "clippingAncestors" ? ks(t) ? [] : sv(t, this._c) : [].concat(n), r], a = i[0], l = i.reduce((c, d) => {
5996
5999
  const f = Xl(t, d, o);
5997
- return c.top = Kt(f.top, c.top), c.right = Dn(f.right, c.right), c.bottom = Dn(f.bottom, c.bottom), c.left = Kt(f.left, c.left), c;
6000
+ return c.top = qt(f.top, c.top), c.right = Dn(f.right, c.right), c.bottom = Dn(f.bottom, c.bottom), c.left = qt(f.left, c.left), c;
5998
6001
  }, Xl(t, a, o));
5999
6002
  return {
6000
6003
  width: l.right - l.left,
@@ -6049,7 +6052,7 @@ function Jl(e, t) {
6049
6052
  return Tn(e) === n && (n = n.ownerDocument.body), n;
6050
6053
  }
6051
6054
  function Fu(e, t) {
6052
- const n = Gt(e);
6055
+ const n = Yt(e);
6053
6056
  if (ks(e))
6054
6057
  return n;
6055
6058
  if (!Cn(e)) {
@@ -6115,7 +6118,7 @@ function fv(e, t) {
6115
6118
  return;
6116
6119
  const m = bo(f), x = bo(o.clientWidth - (d + p)), y = bo(o.clientHeight - (f + h)), g = bo(d), b = {
6117
6120
  rootMargin: -m + "px " + -x + "px " + -y + "px " + -g + "px",
6118
- threshold: Kt(0, Dn(1, l)) || 1
6121
+ threshold: qt(0, Dn(1, l)) || 1
6119
6122
  };
6120
6123
  let T = !0;
6121
6124
  function C(S) {
@@ -6453,7 +6456,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6453
6456
  updatePositionStrategy: h = "optimized",
6454
6457
  onPlaced: m,
6455
6458
  ...x
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, $ = {
6459
+ } = e, y = Vu(Ca, n), [g, w] = v.useState(null), b = Je(t, (Fe) => w(Fe)), [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
6460
  padding: M,
6458
6461
  boundary: j.filter($v),
6459
6462
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
@@ -6462,7 +6465,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6462
6465
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
6463
6466
  strategy: "fixed",
6464
6467
  placement: N,
6465
- whileElementsMounted: (...Le) => pv(...Le, {
6468
+ whileElementsMounted: (...Fe) => pv(...Fe, {
6466
6469
  animationFrame: h === "always"
6467
6470
  }),
6468
6471
  elements: {
@@ -6479,9 +6482,9 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6479
6482
  l && Iv({ ...$ }),
6480
6483
  Nv({
6481
6484
  ...$,
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
+ apply: ({ elements: Fe, rects: Ke, availableWidth: Qe, availableHeight: oe }) => {
6486
+ const { width: he, height: ke } = Ke.reference, He = Fe.floating.style;
6487
+ 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", `${ke}px`);
6485
6488
  }
6486
6489
  }),
6487
6490
  T && _v({ element: T, padding: a }),
@@ -6492,7 +6495,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6492
6495
  Ot(() => {
6493
6496
  X && (G == null || G());
6494
6497
  }, [X, G]);
6495
- const fe = (Y = L.arrow) == null ? void 0 : Y.x, Ce = (D = L.arrow) == null ? void 0 : D.y, Ne = ((H = L.arrow) == null ? void 0 : H.centerOffset) !== 0, [q, ne] = v.useState();
6498
+ const fe = (Y = L.arrow) == null ? void 0 : Y.x, Te = (D = L.arrow) == null ? void 0 : D.y, Ne = ((H = L.arrow) == null ? void 0 : H.centerOffset) !== 0, [q, ne] = v.useState();
6496
6499
  return Ot(() => {
6497
6500
  g && ne(window.getComputedStyle(g).zIndex);
6498
6501
  }, [g]), /* @__PURE__ */ u.jsx(
@@ -6526,7 +6529,7 @@ var Ca = "PopperContent", [Mv, Dv] = Wu(Ca), Yu = v.forwardRef(
6526
6529
  placedSide: _,
6527
6530
  onArrowChange: C,
6528
6531
  arrowX: fe,
6529
- arrowY: Ce,
6532
+ arrowY: Te,
6530
6533
  shouldHideArrow: Ne,
6531
6534
  children: /* @__PURE__ */ u.jsx(
6532
6535
  je.div,
@@ -7491,7 +7494,7 @@ var nn = "MenuContent", [Jw, Ea] = or(nn), Cd = v.forwardRef(
7491
7494
  ...x
7492
7495
  } = e, y = sr(nn, n), g = po(nn, n), w = js(n), b = vd(n), T = Vw(n), [C, S] = v.useState(null), k = v.useRef(null), E = Je(t, k, y.onContentChange), N = v.useRef(0), M = v.useRef(""), j = v.useRef(0), P = v.useRef(null), $ = v.useRef("right"), I = v.useRef(0), F = m ? _s : v.Fragment, A = m ? { as: eb, allowPinchZoom: !0 } : void 0, X = (_) => {
7493
7496
  var Y, D;
7494
- const J = M.current + _, G = T().filter((H) => !H.disabled), fe = document.activeElement, Ce = (Y = G.find((H) => H.ref.current === fe)) == null ? void 0 : Y.textValue, Ne = G.map((H) => H.textValue), q = fb(Ne, J, Ce), ne = (D = G.find((H) => H.textValue === q)) == null ? void 0 : D.ref.current;
7497
+ const J = M.current + _, G = T().filter((H) => !H.disabled), fe = document.activeElement, Te = (Y = G.find((H) => H.ref.current === fe)) == null ? void 0 : Y.textValue, Ne = G.map((H) => H.textValue), q = fb(Ne, J, Te), ne = (D = G.find((H) => H.textValue === q)) == null ? void 0 : D.ref.current;
7495
7498
  (function H(W) {
7496
7499
  M.current = W, window.clearTimeout(N.current), W !== "" && (N.current = window.setTimeout(() => H(""), 1e3));
7497
7500
  })(J), ne && setTimeout(() => ne.focus());
@@ -7576,8 +7579,8 @@ var nn = "MenuContent", [Jw, Ea] = or(nn), Cd = v.forwardRef(
7576
7579
  ref: E,
7577
7580
  style: { outline: "none", ...x.style },
7578
7581
  onKeyDown: pe(x.onKeyDown, (_) => {
7579
- const G = _.target.closest("[data-radix-menu-content]") === _.currentTarget, fe = _.ctrlKey || _.altKey || _.metaKey, Ce = _.key.length === 1;
7580
- G && (_.key === "Tab" && _.preventDefault(), !fe && Ce && X(_.key));
7582
+ const G = _.target.closest("[data-radix-menu-content]") === _.currentTarget, fe = _.ctrlKey || _.altKey || _.metaKey, Te = _.key.length === 1;
7583
+ G && (_.key === "Tab" && _.preventDefault(), !fe && Te && X(_.key));
7581
7584
  const Ne = k.current;
7582
7585
  if (_.target !== Ne || !Hw.includes(_.key)) return;
7583
7586
  _.preventDefault();
@@ -7949,7 +7952,7 @@ function Xr(e) {
7949
7952
  var mb = wd, gb = ka, xb = Sd, yb = Cd, vb = Na, wb = Td, bb = Ps, Sb = Rd, Cb = Id, Tb = Ad, kb = jd, Rb = Pd, Eb = Od, Ib = Dd, Nb = $d, Os = "DropdownMenu", [Ab, hk] = Pn(
7950
7953
  Os,
7951
7954
  [yd]
7952
- ), Ft = yd(), [_b, zd] = Ab(Os), Bd = (e) => {
7955
+ ), zt = yd(), [_b, zd] = Ab(Os), Bd = (e) => {
7953
7956
  const {
7954
7957
  __scopeDropdownMenu: t,
7955
7958
  children: n,
@@ -7958,7 +7961,7 @@ var mb = wd, gb = ka, xb = Sd, yb = Cd, vb = Na, wb = Td, bb = Ps, Sb = Rd, Cb =
7958
7961
  defaultOpen: s,
7959
7962
  onOpenChange: i,
7960
7963
  modal: a = !0
7961
- } = e, l = Ft(t), c = v.useRef(null), [d, f] = br({
7964
+ } = e, l = zt(t), c = v.useRef(null), [d, f] = br({
7962
7965
  prop: o,
7963
7966
  defaultProp: s ?? !1,
7964
7967
  onChange: i,
@@ -7982,7 +7985,7 @@ var mb = wd, gb = ka, xb = Sd, yb = Cd, vb = Na, wb = Td, bb = Ps, Sb = Rd, Cb =
7982
7985
  Bd.displayName = Os;
7983
7986
  var Hd = "DropdownMenuTrigger", Ud = v.forwardRef(
7984
7987
  (e, t) => {
7985
- const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = zd(Hd, n), i = Ft(n);
7988
+ const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = zd(Hd, n), i = zt(n);
7986
7989
  return /* @__PURE__ */ u.jsx(gb, { asChild: !0, ...i, children: /* @__PURE__ */ u.jsx(
7987
7990
  je.button,
7988
7991
  {
@@ -8008,13 +8011,13 @@ var Hd = "DropdownMenuTrigger", Ud = v.forwardRef(
8008
8011
  );
8009
8012
  Ud.displayName = Hd;
8010
8013
  var jb = "DropdownMenuPortal", Wd = (e) => {
8011
- const { __scopeDropdownMenu: t, ...n } = e, r = Ft(t);
8014
+ const { __scopeDropdownMenu: t, ...n } = e, r = zt(t);
8012
8015
  return /* @__PURE__ */ u.jsx(xb, { ...r, ...n });
8013
8016
  };
8014
8017
  Wd.displayName = jb;
8015
8018
  var Vd = "DropdownMenuContent", Kd = v.forwardRef(
8016
8019
  (e, t) => {
8017
- const { __scopeDropdownMenu: n, ...r } = e, o = zd(Vd, n), s = Ft(n), i = v.useRef(!1);
8020
+ const { __scopeDropdownMenu: n, ...r } = e, o = zd(Vd, n), s = zt(n), i = v.useRef(!1);
8018
8021
  return /* @__PURE__ */ u.jsx(
8019
8022
  yb,
8020
8023
  {
@@ -8046,64 +8049,64 @@ var Vd = "DropdownMenuContent", Kd = v.forwardRef(
8046
8049
  Kd.displayName = Vd;
8047
8050
  var Pb = "DropdownMenuGroup", Ob = v.forwardRef(
8048
8051
  (e, t) => {
8049
- const { __scopeDropdownMenu: n, ...r } = e, o = Ft(n);
8052
+ const { __scopeDropdownMenu: n, ...r } = e, o = zt(n);
8050
8053
  return /* @__PURE__ */ u.jsx(vb, { ...o, ...r, ref: t });
8051
8054
  }
8052
8055
  );
8053
8056
  Ob.displayName = Pb;
8054
8057
  var Mb = "DropdownMenuLabel", qd = v.forwardRef(
8055
8058
  (e, t) => {
8056
- const { __scopeDropdownMenu: n, ...r } = e, o = Ft(n);
8059
+ const { __scopeDropdownMenu: n, ...r } = e, o = zt(n);
8057
8060
  return /* @__PURE__ */ u.jsx(wb, { ...o, ...r, ref: t });
8058
8061
  }
8059
8062
  );
8060
8063
  qd.displayName = Mb;
8061
8064
  var Db = "DropdownMenuItem", Gd = v.forwardRef(
8062
8065
  (e, t) => {
8063
- const { __scopeDropdownMenu: n, ...r } = e, o = Ft(n);
8066
+ const { __scopeDropdownMenu: n, ...r } = e, o = zt(n);
8064
8067
  return /* @__PURE__ */ u.jsx(bb, { ...o, ...r, ref: t });
8065
8068
  }
8066
8069
  );
8067
8070
  Gd.displayName = Db;
8068
8071
  var Lb = "DropdownMenuCheckboxItem", Yd = v.forwardRef((e, t) => {
8069
- const { __scopeDropdownMenu: n, ...r } = e, o = Ft(n);
8072
+ const { __scopeDropdownMenu: n, ...r } = e, o = zt(n);
8070
8073
  return /* @__PURE__ */ u.jsx(Sb, { ...o, ...r, ref: t });
8071
8074
  });
8072
8075
  Yd.displayName = Lb;
8073
8076
  var $b = "DropdownMenuRadioGroup", Fb = v.forwardRef((e, t) => {
8074
- const { __scopeDropdownMenu: n, ...r } = e, o = Ft(n);
8077
+ const { __scopeDropdownMenu: n, ...r } = e, o = zt(n);
8075
8078
  return /* @__PURE__ */ u.jsx(Cb, { ...o, ...r, ref: t });
8076
8079
  });
8077
8080
  Fb.displayName = $b;
8078
8081
  var zb = "DropdownMenuRadioItem", Xd = v.forwardRef((e, t) => {
8079
- const { __scopeDropdownMenu: n, ...r } = e, o = Ft(n);
8082
+ const { __scopeDropdownMenu: n, ...r } = e, o = zt(n);
8080
8083
  return /* @__PURE__ */ u.jsx(Tb, { ...o, ...r, ref: t });
8081
8084
  });
8082
8085
  Xd.displayName = zb;
8083
8086
  var Bb = "DropdownMenuItemIndicator", Jd = v.forwardRef((e, t) => {
8084
- const { __scopeDropdownMenu: n, ...r } = e, o = Ft(n);
8087
+ const { __scopeDropdownMenu: n, ...r } = e, o = zt(n);
8085
8088
  return /* @__PURE__ */ u.jsx(kb, { ...o, ...r, ref: t });
8086
8089
  });
8087
8090
  Jd.displayName = Bb;
8088
8091
  var Hb = "DropdownMenuSeparator", Zd = v.forwardRef((e, t) => {
8089
- const { __scopeDropdownMenu: n, ...r } = e, o = Ft(n);
8092
+ const { __scopeDropdownMenu: n, ...r } = e, o = zt(n);
8090
8093
  return /* @__PURE__ */ u.jsx(Rb, { ...o, ...r, ref: t });
8091
8094
  });
8092
8095
  Zd.displayName = Hb;
8093
8096
  var Ub = "DropdownMenuArrow", Wb = v.forwardRef(
8094
8097
  (e, t) => {
8095
- const { __scopeDropdownMenu: n, ...r } = e, o = Ft(n);
8098
+ const { __scopeDropdownMenu: n, ...r } = e, o = zt(n);
8096
8099
  return /* @__PURE__ */ u.jsx(Eb, { ...o, ...r, ref: t });
8097
8100
  }
8098
8101
  );
8099
8102
  Wb.displayName = Ub;
8100
8103
  var Vb = "DropdownMenuSubTrigger", Qd = v.forwardRef((e, t) => {
8101
- const { __scopeDropdownMenu: n, ...r } = e, o = Ft(n);
8104
+ const { __scopeDropdownMenu: n, ...r } = e, o = zt(n);
8102
8105
  return /* @__PURE__ */ u.jsx(Ib, { ...o, ...r, ref: t });
8103
8106
  });
8104
8107
  Qd.displayName = Vb;
8105
8108
  var Kb = "DropdownMenuSubContent", ef = v.forwardRef((e, t) => {
8106
- const { __scopeDropdownMenu: n, ...r } = e, o = Ft(n);
8109
+ const { __scopeDropdownMenu: n, ...r } = e, o = zt(n);
8107
8110
  return /* @__PURE__ */ u.jsx(
8108
8111
  Nb,
8109
8112
  {
@@ -8310,7 +8313,7 @@ function ht(...e) {
8310
8313
  function it(e, t) {
8311
8314
  return e(Bn, t);
8312
8315
  }
8313
- function De(e, t) {
8316
+ function $e(e, t) {
8314
8317
  e(Ms, t);
8315
8318
  }
8316
8319
  function Pa(e) {
@@ -8439,7 +8442,7 @@ function Z(e) {
8439
8442
  return n(r, o);
8440
8443
  };
8441
8444
  }
8442
- function $t(e, t) {
8445
+ function Ft(e, t) {
8443
8446
  return Ds(Z(t), (n) => me(e, n));
8444
8447
  }
8445
8448
  function Xe() {
@@ -8462,7 +8465,7 @@ function Xe() {
8462
8465
  }
8463
8466
  };
8464
8467
  }
8465
- function Yt(e) {
8468
+ function Xt(e) {
8466
8469
  return Ds(Xe(), (t) => me(e, t));
8467
8470
  }
8468
8471
  function tt(e, t = [], { singleton: n } = { singleton: !0 }) {
@@ -8490,7 +8493,7 @@ function Rt(...e) {
8490
8493
  return e.forEach((s, i) => {
8491
8494
  const a = Math.pow(2, i);
8492
8495
  it(s, (l) => {
8493
- n[i] = l, r = r | a, r === o && De(t, n);
8496
+ n[i] = l, r = r | a, r === o && $e(t, n);
8494
8497
  });
8495
8498
  }), function(s, i) {
8496
8499
  switch (s) {
@@ -8503,7 +8506,7 @@ function Rt(...e) {
8503
8506
  }
8504
8507
  };
8505
8508
  }
8506
- function Re(e, t = hf) {
8509
+ function Ee(e, t = hf) {
8507
8510
  return V(e, pt(t));
8508
8511
  }
8509
8512
  function Ui(...e) {
@@ -8516,7 +8519,7 @@ function Ui(...e) {
8516
8519
  }
8517
8520
  };
8518
8521
  }
8519
- var Vt = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e))(Vt || {});
8522
+ var Kt = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e))(Kt || {});
8520
8523
  const m0 = {
8521
8524
  0: "debug",
8522
8525
  3: "error",
@@ -8597,7 +8600,7 @@ function y0(e, t, n, r) {
8597
8600
  if (a.dataset.index === void 0)
8598
8601
  continue;
8599
8602
  const l = parseInt(a.dataset.index), c = parseFloat(a.dataset.knownSize), d = t(a, n);
8600
- if (d === 0 && r("Zero-sized element, this should not happen", { child: a }, Vt.ERROR), d === c)
8603
+ if (d === 0 && r("Zero-sized element, this should not happen", { child: a }, Kt.ERROR), d === c)
8601
8604
  continue;
8602
8605
  const f = s[s.length - 1];
8603
8606
  s.length === 0 || f.size !== d || f.endIndex !== l - 1 ? s.push({ endIndex: l, size: d, startIndex: l }) : s[s.length - 1].endIndex++;
@@ -8605,7 +8608,7 @@ function y0(e, t, n, r) {
8605
8608
  return s;
8606
8609
  }
8607
8610
  function cc(e, t, n) {
8608
- return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Vt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
8611
+ return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
8609
8612
  }
8610
8613
  function mf(e, t, n) {
8611
8614
  const r = B.useRef(null), o = B.useCallback(
@@ -8650,7 +8653,7 @@ function mf(e, t, n) {
8650
8653
  }
8651
8654
  }, [a, t, i]), s;
8652
8655
  }
8653
- const zt = tt(
8656
+ const Bt = tt(
8654
8657
  () => {
8655
8658
  const e = Xe(), t = Xe(), n = Z(0), r = Xe(), o = Z(0), s = Xe(), i = Xe(), a = Z(0), l = Z(0), c = Z(0), d = Z(0), f = Xe(), p = Xe(), h = Z(!1), m = Z(!1), x = Z(!1);
8656
8659
  return me(
@@ -8720,8 +8723,8 @@ function hn(e, t, n = "k") {
8720
8723
  }
8721
8724
  return hn(e.l, t, n);
8722
8725
  }
8723
- function qt(e, t, n) {
8724
- return ut(e) ? vf(t, n, 1) : t === e.k ? Et(e, { k: t, v: n }) : t < e.k ? uc(Et(e, { l: qt(e.l, t, n) })) : uc(Et(e, { r: qt(e.r, t, n) }));
8726
+ function Gt(e, t, n) {
8727
+ return ut(e) ? vf(t, n, 1) : t === e.k ? Et(e, { k: t, v: n }) : t < e.k ? uc(Et(e, { l: Gt(e.l, t, n) })) : uc(Et(e, { r: Gt(e.r, t, n) }));
8725
8728
  }
8726
8729
  function xr() {
8727
8730
  return Jr;
@@ -8886,7 +8889,7 @@ function S0(e, t) {
8886
8889
  for (const r of t) {
8887
8890
  const { endIndex: o, size: s, startIndex: i } = r;
8888
8891
  if (n = Math.min(n, i), ut(e)) {
8889
- e = qt(e, 0, s);
8892
+ e = Gt(e, 0, s);
8890
8893
  continue;
8891
8894
  }
8892
8895
  const a = Ls(e, i - 1, o + 1);
@@ -8894,8 +8897,8 @@ function S0(e, t) {
8894
8897
  continue;
8895
8898
  let l = !1, c = !1;
8896
8899
  for (const { end: d, start: f, value: p } of a)
8897
- l ? (o >= f || s === p) && (e = Wi(e, f)) : (c = p !== s, l = !0), d > o && o >= f && p !== s && (e = qt(e, o + 1, p));
8898
- c && (e = qt(e, i, s));
8900
+ l ? (o >= f || s === p) && (e = Wi(e, f)) : (c = p !== s, l = !0), d > o && o >= f && p !== s && (e = Gt(e, o + 1, p));
8901
+ c && (e = Gt(e, i, s));
8899
8902
  }
8900
8903
  return [e, n];
8901
8904
  }
@@ -8932,12 +8935,12 @@ function k0(e, t, n, r = 0) {
8932
8935
  return r > 0 && (t = Math.max(t, Sf(e, r, Da).offset)), gf(w0(e, t, n, T0), I0);
8933
8936
  }
8934
8937
  function R0(e, [t, n, r, o]) {
8935
- t.length > 0 && r("received item sizes", t, Vt.DEBUG);
8938
+ t.length > 0 && r("received item sizes", t, Kt.DEBUG);
8936
8939
  const s = e.sizeTree;
8937
8940
  let i = s, a = 0;
8938
8941
  if (n.length > 0 && ut(s) && t.length === 2) {
8939
8942
  const p = t[0].size, h = t[1].size;
8940
- i = n.reduce((m, x) => qt(qt(m, x, p), x + 1, h), i);
8943
+ i = n.reduce((m, x) => Gt(Gt(m, x, p), x + 1, h), i);
8941
8944
  } else
8942
8945
  [i, a] = S0(i, t);
8943
8946
  if (i === s)
@@ -8945,7 +8948,7 @@ function R0(e, [t, n, r, o]) {
8945
8948
  const { lastIndex: l, lastOffset: c, lastSize: d, offsetTree: f } = qi(e.offsetTree, a, i, o);
8946
8949
  return {
8947
8950
  groupIndices: n,
8948
- groupOffsetTree: n.reduce((p, h) => qt(p, h, eo(h, f, o)), xr()),
8951
+ groupOffsetTree: n.reduce((p, h) => Gt(p, h, eo(h, f, o)), xr()),
8949
8952
  lastIndex: l,
8950
8953
  lastOffset: c,
8951
8954
  lastSize: d,
@@ -9000,10 +9003,10 @@ const A0 = {
9000
9003
  offsetWidth: "width"
9001
9004
  }, kn = tt(
9002
9005
  ([{ log: e }, { recalcInProgress: t }]) => {
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(
9006
+ const n = Xe(), r = Xe(), o = Ft(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 = Ft(
9004
9007
  V(n, Be(l, e, h), bn(R0, m), pt()),
9005
9008
  m
9006
- ), y = $t(
9009
+ ), y = Ft(
9007
9010
  V(
9008
9011
  l,
9009
9012
  pt(),
@@ -9021,7 +9024,7 @@ const A0 = {
9021
9024
  Ie((C) => C.length > 0),
9022
9025
  Be(x, h),
9023
9026
  le(([C, S, k]) => {
9024
- const E = C.reduce((N, M, j) => qt(N, M, eo(M, S.offsetTree, k) || j), xr());
9027
+ const E = C.reduce((N, M, j) => Gt(N, M, eo(M, S.offsetTree, k) || j), xr());
9025
9028
  return {
9026
9029
  ...S,
9027
9030
  groupIndices: C,
@@ -9045,7 +9048,7 @@ const A0 = {
9045
9048
  ),
9046
9049
  n
9047
9050
  ), me(c, d);
9048
- const g = $t(
9051
+ const g = Ft(
9049
9052
  V(
9050
9053
  c,
9051
9054
  le((C) => C === void 0)
@@ -9060,7 +9063,7 @@ const A0 = {
9060
9063
  ),
9061
9064
  n
9062
9065
  );
9063
- const w = Yt(
9066
+ const w = Xt(
9064
9067
  V(
9065
9068
  n,
9066
9069
  Be(x),
@@ -9086,20 +9089,20 @@ const A0 = {
9086
9089
  (C) => {
9087
9090
  const { groupIndices: S } = Ct(x);
9088
9091
  if (C > 0)
9089
- De(t, !0), De(s, C + dc(C, S));
9092
+ $e(t, !0), $e(s, C + dc(C, S));
9090
9093
  else if (C < 0) {
9091
9094
  const k = Ct(y);
9092
- k.length > 0 && (C -= dc(-C, k)), De(i, C);
9095
+ k.length > 0 && (C -= dc(-C, k)), $e(i, C);
9093
9096
  }
9094
9097
  }
9095
9098
  ), it(V(a, Be(e)), ([C, S]) => {
9096
9099
  C < 0 && S(
9097
9100
  "`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
9101
  { firstItemIndex: a },
9099
- Vt.ERROR
9102
+ Kt.ERROR
9100
9103
  );
9101
9104
  });
9102
- const b = Yt(s);
9105
+ const b = Xt(s);
9103
9106
  me(
9104
9107
  V(
9105
9108
  s,
@@ -9161,7 +9164,7 @@ const A0 = {
9161
9164
  ),
9162
9165
  n
9163
9166
  );
9164
- const T = Yt(
9167
+ const T = Xt(
9165
9168
  V(
9166
9169
  i,
9167
9170
  Be(x, h),
@@ -9187,11 +9190,11 @@ const A0 = {
9187
9190
  const $ = N[j + 1] - P - 1;
9188
9191
  j++, M += $ + 1;
9189
9192
  }
9190
- if (E = Gn(S.sizeTree).reduce(($, { k: I, v: F }) => qt($, Math.max(0, I + C), F), E), M !== -C) {
9193
+ if (E = Gn(S.sizeTree).reduce(($, { k: I, v: F }) => Gt($, Math.max(0, I + C), F), E), M !== -C) {
9191
9194
  const $ = Zr(S.sizeTree, P);
9192
- E = qt(E, 0, $);
9195
+ E = Gt(E, 0, $);
9193
9196
  const I = hn(S.sizeTree, -C + 1)[1];
9194
- E = qt(E, 1, I);
9197
+ E = Gt(E, 1, I);
9195
9198
  }
9196
9199
  return {
9197
9200
  ...S,
@@ -9199,7 +9202,7 @@ const A0 = {
9199
9202
  ...qi(S.offsetTree, 0, E, k)
9200
9203
  };
9201
9204
  } else {
9202
- const E = Gn(S.sizeTree).reduce((N, { k: M, v: j }) => qt(N, Math.max(0, M + C), j), xr());
9205
+ const E = Gn(S.sizeTree).reduce((N, { k: M, v: j }) => Gt(N, Math.max(0, M + C), j), xr());
9203
9206
  return {
9204
9207
  ...S,
9205
9208
  sizeTree: E,
@@ -9245,7 +9248,7 @@ function _0(e) {
9245
9248
  }
9246
9249
  const kf = tt(
9247
9250
  ([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
9248
- const s = Xe(), i = Xe(), a = Yt(V(s, le(_0)));
9251
+ const s = Xe(), i = Xe(), a = Xt(V(s, le(_0)));
9249
9252
  return me(
9250
9253
  V(
9251
9254
  a,
@@ -9269,10 +9272,10 @@ const kf = tt(
9269
9272
  i
9270
9273
  ), { groupCounts: s, topItemsIndexes: i };
9271
9274
  },
9272
- ht(kn, zt)
9275
+ ht(kn, Bt)
9273
9276
  ), Un = tt(
9274
9277
  ([{ log: e }]) => {
9275
- const t = Z(!1), n = Yt(
9278
+ const t = Z(!1), n = Xt(
9276
9279
  V(
9277
9280
  t,
9278
9281
  Ie((r) => r),
@@ -9280,7 +9283,7 @@ const kf = tt(
9280
9283
  )
9281
9284
  );
9282
9285
  return it(t, (r) => {
9283
- r && Ct(e)("props updated", {}, Vt.DEBUG);
9286
+ r && Ct(e)("props updated", {}, Kt.DEBUG);
9284
9287
  }), { didMount: n, propsReady: t };
9285
9288
  },
9286
9289
  ht(Hn),
@@ -9308,7 +9311,7 @@ const ho = tt(
9308
9311
  const h = Xe(), m = Xe(), x = Z(0);
9309
9312
  let y = null, g = null, w = null;
9310
9313
  function b() {
9311
- y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), De(l, !1);
9314
+ y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), $e(l, !1);
9312
9315
  }
9313
9316
  return me(
9314
9317
  V(
@@ -9325,21 +9328,21 @@ const ho = tt(
9325
9328
  const F = Rf(T), { align: A, behavior: X, offset: L } = F, _ = k - 1, J = Tf(F, C, _);
9326
9329
  let G = eo(J, C.offsetTree, P) + N;
9327
9330
  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
- const fe = (Ce) => {
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));
9331
+ const fe = (Te) => {
9332
+ b(), Te ? (j("retrying to scroll to", { location: T }, Kt.DEBUG), $e(h, T)) : ($e(m, !0), j("list did not change, scroll successful", {}, Kt.DEBUG));
9330
9333
  };
9331
9334
  if (b(), X === "smooth") {
9332
- let Ce = !1;
9335
+ let Te = !1;
9333
9336
  w = it(t, (Ne) => {
9334
- Ce = Ce || Ne;
9337
+ Te = Te || Ne;
9335
9338
  }), y = dn(d, () => {
9336
- fe(Ce);
9339
+ fe(Te);
9337
9340
  });
9338
9341
  } else
9339
9342
  y = dn(V(t, P0(150)), fe);
9340
9343
  return g = setTimeout(() => {
9341
9344
  b();
9342
- }, 1200), De(l, !0), j("scrolling from index to", { behavior: X, index: J, top: G }, Vt.DEBUG), { behavior: X, top: G };
9345
+ }, 1200), $e(l, !0), j("scrolling from index to", { behavior: X, index: J, top: G }, Kt.DEBUG), { behavior: X, top: G };
9343
9346
  }
9344
9347
  )
9345
9348
  ),
@@ -9350,7 +9353,7 @@ const ho = tt(
9350
9353
  topListHeight: x
9351
9354
  };
9352
9355
  },
9353
- ht(kn, zt, Hn),
9356
+ ht(kn, Bt, Hn),
9354
9357
  { singleton: !0 }
9355
9358
  );
9356
9359
  function P0(e) {
@@ -9400,11 +9403,11 @@ const mo = tt(
9400
9403
  ),
9401
9404
  ([, d]) => {
9402
9405
  dn(o, () => {
9403
- De(c, !0);
9406
+ $e(c, !0);
9404
9407
  }), La(4, () => {
9405
9408
  dn(r, () => {
9406
- De(a, !0);
9407
- }), De(s, d);
9409
+ $e(a, !0);
9410
+ }), $e(s, d);
9408
9411
  });
9409
9412
  }
9410
9413
  ), {
@@ -9413,7 +9416,7 @@ const mo = tt(
9413
9416
  scrolledToInitialItem: a
9414
9417
  };
9415
9418
  },
9416
- ht(kn, zt, ho, Un),
9419
+ ht(kn, Bt, ho, Un),
9417
9420
  { singleton: !0 }
9418
9421
  );
9419
9422
  function Ef(e, t) {
@@ -9429,27 +9432,27 @@ const to = "up", zr = "down", O0 = "none", M0 = {
9429
9432
  viewportHeight: 0
9430
9433
  }
9431
9434
  }, D0 = 0, go = tt(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
9432
- const i = Z(!1), a = Z(!0), l = Xe(), c = Xe(), d = Z(4), f = Z(D0), p = $t(
9435
+ const i = Z(!1), a = Z(!0), l = Xe(), c = Xe(), d = Z(4), f = Z(D0), p = Ft(
9433
9436
  V(
9434
- Ui(V(Re(o), er(1), yn(!0)), V(Re(o), er(1), yn(!1), lc(100))),
9437
+ Ui(V(Ee(o), er(1), yn(!0)), V(Ee(o), er(1), yn(!1), lc(100))),
9435
9438
  pt()
9436
9439
  ),
9437
9440
  !1
9438
- ), h = $t(
9441
+ ), h = Ft(
9439
9442
  V(Ui(V(n, yn(!0)), V(n, yn(!1), lc(200))), pt()),
9440
9443
  !1
9441
9444
  );
9442
9445
  me(
9443
9446
  V(
9444
- Rt(Re(o), Re(f)),
9447
+ Rt(Ee(o), Ee(f)),
9445
9448
  le(([w, b]) => w <= b),
9446
9449
  pt()
9447
9450
  ),
9448
9451
  a
9449
9452
  ), me(V(a, In(50)), c);
9450
- const m = Yt(
9453
+ const m = Xt(
9451
9454
  V(
9452
- Rt(r, Re(s), Re(t), Re(e), Re(d)),
9455
+ Rt(r, Ee(s), Ee(t), Ee(e), Ee(d)),
9453
9456
  bn((w, [{ scrollHeight: b, scrollTop: T }, C, S, k, E]) => {
9454
9457
  const N = T + C - b > -E, M = {
9455
9458
  scrollHeight: b,
@@ -9474,7 +9477,7 @@ const to = "up", zr = "down", O0 = "none", M0 = {
9474
9477
  }, M0),
9475
9478
  pt((w, b) => w && w.atBottom === b.atBottom)
9476
9479
  )
9477
- ), x = $t(
9480
+ ), x = Ft(
9478
9481
  V(
9479
9482
  r,
9480
9483
  bn(
@@ -9560,7 +9563,7 @@ const to = "up", zr = "down", O0 = "none", M0 = {
9560
9563
  scrollDirection: y,
9561
9564
  scrollVelocity: g
9562
9565
  };
9563
- }, ht(zt)), es = "top", ts = "bottom", fc = "none";
9566
+ }, ht(Bt)), es = "top", ts = "bottom", fc = "none";
9564
9567
  function pc(e, t, n) {
9565
9568
  return typeof e == "number" ? n === to && t === es || n === zr && t === ts ? e : 0 : n === to ? t === es ? e.main : e.reverse : t === ts ? e.main : e.reverse;
9566
9569
  }
@@ -9570,18 +9573,18 @@ function hc(e, t) {
9570
9573
  }
9571
9574
  const Fa = tt(
9572
9575
  ([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
9573
- const s = Xe(), i = Z(0), a = Z(0), l = Z(0), c = $t(
9576
+ const s = Xe(), i = Z(0), a = Z(0), l = Z(0), c = Ft(
9574
9577
  V(
9575
9578
  Rt(
9576
- Re(r),
9577
- Re(o),
9578
- Re(n),
9579
- Re(s, Qr),
9580
- Re(l),
9581
- Re(i),
9582
- Re(t),
9583
- Re(e),
9584
- Re(a)
9579
+ Ee(r),
9580
+ Ee(o),
9581
+ Ee(n),
9582
+ Ee(s, Qr),
9583
+ Ee(l),
9584
+ Ee(i),
9585
+ Ee(t),
9586
+ Ee(e),
9587
+ Ee(a)
9585
9588
  ),
9586
9589
  le(
9587
9590
  ([
@@ -9619,7 +9622,7 @@ const Fa = tt(
9619
9622
  visibleRange: c
9620
9623
  };
9621
9624
  },
9622
- ht(zt),
9625
+ ht(Bt),
9623
9626
  { singleton: !0 }
9624
9627
  );
9625
9628
  function L0(e, t, n) {
@@ -9719,19 +9722,19 @@ const ar = tt(
9719
9722
  ]) => {
9720
9723
  const x = Z([]), y = Z(0), g = Xe();
9721
9724
  me(s.topItemsIndexes, x);
9722
- const w = $t(
9725
+ const w = Ft(
9723
9726
  V(
9724
9727
  Rt(
9725
9728
  h,
9726
9729
  m,
9727
- Re(l, Qr),
9728
- Re(o),
9729
- Re(r),
9730
- Re(c),
9730
+ Ee(l, Qr),
9731
+ Ee(o),
9732
+ Ee(r),
9733
+ Ee(c),
9731
9734
  d,
9732
- Re(x),
9733
- Re(t),
9734
- Re(n),
9735
+ Ee(x),
9736
+ Ee(t),
9737
+ Ee(n),
9735
9738
  e
9736
9739
  ),
9737
9740
  Ie(([S, k, , E, , , , , , , N]) => {
@@ -9781,7 +9784,7 @@ const ar = tt(
9781
9784
  const G = P.length > 0 ? P[P.length - 1] + 1 : 0, fe = k0(X, S, k, G);
9782
9785
  if (fe.length === 0)
9783
9786
  return null;
9784
- const Ce = E - 1, Ne = Ds([], (q) => {
9787
+ const Te = E - 1, Ne = Ds([], (q) => {
9785
9788
  for (const ne of fe) {
9786
9789
  const Y = ne.value;
9787
9790
  let D = Y.offset, H = ne.start;
@@ -9792,7 +9795,7 @@ const ar = tt(
9792
9795
  D += re * W + re * I;
9793
9796
  }
9794
9797
  H < G && (D += (G - H) * W, H = G);
9795
- const se = Math.min(ne.end, Ce);
9798
+ const se = Math.min(ne.end, Te);
9796
9799
  for (let re = H; re <= se && !(D >= k); re++)
9797
9800
  q.push({ data: F == null ? void 0 : F[re], index: re, offset: D, size: W }), D += W + I;
9798
9801
  }
@@ -9832,7 +9835,7 @@ const ar = tt(
9832
9835
  ),
9833
9836
  g
9834
9837
  );
9835
- const b = Yt(
9838
+ const b = Xt(
9836
9839
  V(
9837
9840
  w,
9838
9841
  Ie(({ items: S }) => S.length > 0),
@@ -9842,7 +9845,7 @@ const ar = tt(
9842
9845
  pt(Qr),
9843
9846
  le(([S]) => S)
9844
9847
  )
9845
- ), T = Yt(
9848
+ ), T = Xt(
9846
9849
  V(
9847
9850
  w,
9848
9851
  In(200),
@@ -9850,7 +9853,7 @@ const ar = tt(
9850
9853
  le(({ items: S }) => S[0].index),
9851
9854
  pt()
9852
9855
  )
9853
- ), C = Yt(
9856
+ ), C = Xt(
9854
9857
  V(
9855
9858
  w,
9856
9859
  Ie(({ items: S }) => S.length > 0),
@@ -9883,20 +9886,20 @@ const ar = tt(
9883
9886
  { singleton: !0 }
9884
9887
  ), Nf = tt(
9885
9888
  ([{ fixedFooterHeight: e, fixedHeaderHeight: t, footerHeight: n, headerHeight: r }, { listState: o }]) => {
9886
- const s = Xe(), i = $t(
9889
+ const s = Xe(), i = Ft(
9887
9890
  V(
9888
9891
  Rt(n, e, r, t, o),
9889
9892
  le(([a, l, c, d, f]) => a + l + c + d + f.offsetBottom + f.bottom)
9890
9893
  ),
9891
9894
  0
9892
9895
  );
9893
- return me(Re(i), s), { totalListHeight: i, totalListHeightChanged: s };
9896
+ return me(Ee(i), s), { totalListHeight: i, totalListHeightChanged: s };
9894
9897
  },
9895
- ht(zt, ar),
9898
+ ht(Bt, ar),
9896
9899
  { singleton: !0 }
9897
9900
  ), $0 = tt(
9898
9901
  ([{ viewportHeight: e }, { totalListHeight: t }]) => {
9899
- const n = Z(!1), r = $t(
9902
+ const n = Z(!1), r = Ft(
9900
9903
  V(
9901
9904
  Rt(n, e, t),
9902
9905
  Ie(([o]) => o),
@@ -9908,7 +9911,7 @@ const ar = tt(
9908
9911
  );
9909
9912
  return { alignToBottom: n, paddingTopAddition: r };
9910
9913
  },
9911
- ht(zt, Nf),
9914
+ ht(Bt, Nf),
9912
9915
  { singleton: !0 }
9913
9916
  ), Af = tt(() => ({
9914
9917
  context: Z(null)
@@ -9956,7 +9959,7 @@ const ar = tt(
9956
9959
  scrollIntoView: d
9957
9960
  };
9958
9961
  },
9959
- ht(kn, zt, ho, ar, Hn),
9962
+ ht(kn, Bt, ho, ar, Hn),
9960
9963
  { singleton: !0 }
9961
9964
  );
9962
9965
  function gc(e) {
@@ -9977,7 +9980,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
9977
9980
  const m = Z(!1), x = Xe();
9978
9981
  let y = null;
9979
9982
  function g(C) {
9980
- De(i, {
9983
+ $e(i, {
9981
9984
  align: "end",
9982
9985
  behavior: C,
9983
9986
  index: "LAST"
@@ -9985,8 +9988,8 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
9985
9988
  }
9986
9989
  it(
9987
9990
  V(
9988
- Rt(V(Re(t), er(1)), l),
9989
- Be(Re(m), s, a, f),
9991
+ Rt(V(Ee(t), er(1)), l),
9992
+ Be(Ee(m), s, a, f),
9990
9993
  le(([[C, S], k, E, N, M]) => {
9991
9994
  let j = S && N, P = "auto";
9992
9995
  return j && (P = z0(k, E || M), j = j && !!P), { followOutputBehavior: P, shouldFollow: j, totalCount: C };
@@ -9995,21 +9998,21 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
9995
9998
  ),
9996
9999
  ({ followOutputBehavior: C, totalCount: S }) => {
9997
10000
  y && (y(), y = null), Ct(n) ? requestAnimationFrame(() => {
9998
- Ct(d)("following output to ", { totalCount: S }, Vt.DEBUG), g(C);
10001
+ Ct(d)("following output to ", { totalCount: S }, Kt.DEBUG), g(C);
9999
10002
  }) : y = dn(e, () => {
10000
- Ct(d)("following output to ", { totalCount: S }, Vt.DEBUG), g(C), y = null;
10003
+ Ct(d)("following output to ", { totalCount: S }, Kt.DEBUG), g(C), y = null;
10001
10004
  });
10002
10005
  }
10003
10006
  );
10004
10007
  function w(C) {
10005
10008
  const S = dn(o, (k) => {
10006
- C && !k.atBottom && k.notAtBottomBecause === "SIZE_INCREASED" && !y && (Ct(d)("scrolling to bottom due to increased size", {}, Vt.DEBUG), g("auto"));
10009
+ C && !k.atBottom && k.notAtBottomBecause === "SIZE_INCREASED" && !y && (Ct(d)("scrolling to bottom due to increased size", {}, Kt.DEBUG), g("auto"));
10007
10010
  });
10008
10011
  setTimeout(S, 100);
10009
10012
  }
10010
10013
  it(
10011
10014
  V(
10012
- Rt(Re(m), t, c),
10015
+ Rt(Ee(m), t, c),
10013
10016
  Ie(([C, , S]) => C && S),
10014
10017
  bn(
10015
10018
  ({ value: C }, [, S]) => ({ refreshed: C === S, value: S }),
@@ -10023,35 +10026,35 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10023
10026
  }
10024
10027
  ), it(x, () => {
10025
10028
  w(Ct(m) !== !1);
10026
- }), it(Rt(Re(m), o), ([C, S]) => {
10029
+ }), it(Rt(Ee(m), o), ([C, S]) => {
10027
10030
  C && !S.atBottom && S.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
10028
10031
  });
10029
10032
  const b = Z(null), T = Xe();
10030
10033
  return me(
10031
10034
  Ui(
10032
10035
  V(
10033
- Re(r),
10036
+ Ee(r),
10034
10037
  le((C) => {
10035
10038
  var S;
10036
10039
  return (S = C == null ? void 0 : C.length) != null ? S : 0;
10037
10040
  })
10038
10041
  ),
10039
- V(Re(t))
10042
+ V(Ee(t))
10040
10043
  ),
10041
10044
  T
10042
10045
  ), it(
10043
10046
  V(
10044
10047
  Rt(V(T, er(1)), l),
10045
- Be(Re(b), a, f, p),
10048
+ Be(Ee(b), a, f, p),
10046
10049
  le(([[C, S], k, E, N, M]) => S && E && (k == null ? void 0 : k({ context: M, totalCount: C, scrollingInProgress: N }))),
10047
10050
  Ie((C) => !!C),
10048
10051
  In(0)
10049
10052
  ),
10050
10053
  (C) => {
10051
10054
  y && (y(), y = null), Ct(n) ? requestAnimationFrame(() => {
10052
- Ct(d)("scrolling into view", {}), De(h, C);
10055
+ Ct(d)("scrolling into view", {}), $e(h, C);
10053
10056
  }) : y = dn(e, () => {
10054
- Ct(d)("scrolling into view", {}), De(h, C), y = null;
10057
+ Ct(d)("scrolling into view", {}), $e(h, C), y = null;
10055
10058
  });
10056
10059
  }
10057
10060
  ), { autoscrollToBottom: x, followOutput: m, scrollIntoViewOnChange: b };
@@ -10063,7 +10066,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10063
10066
  mo,
10064
10067
  Un,
10065
10068
  Hn,
10066
- zt,
10069
+ Bt,
10067
10070
  Af,
10068
10071
  _f
10069
10072
  )
@@ -10099,7 +10102,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10099
10102
  ),
10100
10103
  () => {
10101
10104
  requestAnimationFrame(() => {
10102
- De(t, o);
10105
+ $e(t, o);
10103
10106
  });
10104
10107
  }
10105
10108
  );
@@ -10108,7 +10111,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10108
10111
  initialScrollTop: r
10109
10112
  };
10110
10113
  },
10111
- ht(Un, zt, ar),
10114
+ ht(Un, Bt, ar),
10112
10115
  { singleton: !0 }
10113
10116
  ), jf = tt(
10114
10117
  ([{ scrollVelocity: e }]) => {
@@ -10171,7 +10174,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10171
10174
  windowScrollTo: o,
10172
10175
  windowViewportRect: r
10173
10176
  };
10174
- }, ht(zt)), W0 = tt(
10177
+ }, ht(Bt)), W0 = tt(
10175
10178
  ([
10176
10179
  { sizeRanges: e, sizes: t },
10177
10180
  { headerHeight: n, scrollTop: r },
@@ -10203,7 +10206,7 @@ const z0 = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), B0 = tt(
10203
10206
  restoreStateFrom: d
10204
10207
  };
10205
10208
  },
10206
- ht(kn, zt, mo, Un, za)
10209
+ ht(kn, Bt, mo, Un, za)
10207
10210
  );
10208
10211
  function V0(e) {
10209
10212
  return { align: "start", index: 0, offset: e.scrollTop };
@@ -10232,7 +10235,7 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10232
10235
  { log: h },
10233
10236
  { recalcInProgress: m }
10234
10237
  ]) => {
10235
- const x = Yt(
10238
+ const x = Xt(
10236
10239
  V(
10237
10240
  l,
10238
10241
  Be(i),
@@ -10247,17 +10250,17 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10247
10250
  Ie(([g]) => g !== 0),
10248
10251
  Be(r, a, n, o, h, m),
10249
10252
  Ie(([, g, w, b, , , T]) => !T && !b && g !== 0 && w === to),
10250
- le(([[g], , , , , w]) => (w("Upward scrolling compensation", { amount: g }, Vt.DEBUG), g))
10253
+ le(([[g], , , , , w]) => (w("Upward scrolling compensation", { amount: g }, Kt.DEBUG), g))
10251
10254
  )
10252
10255
  );
10253
10256
  function y(g) {
10254
- g > 0 ? (De(t, { behavior: "auto", top: -g }), De(e, 0)) : (De(e, 0), De(t, { behavior: "auto", top: -g }));
10257
+ g > 0 ? ($e(t, { behavior: "auto", top: -g }), $e(e, 0)) : ($e(e, 0), $e(t, { behavior: "auto", top: -g }));
10255
10258
  }
10256
10259
  return it(V(x, Be(e, s)), ([g, w, b]) => {
10257
- b && q0() ? De(e, w - g) : y(-g);
10260
+ b && q0() ? $e(e, w - g) : y(-g);
10258
10261
  }), it(
10259
10262
  V(
10260
- Rt($t(s, !1), e, m),
10263
+ Rt(Ft(s, !1), e, m),
10261
10264
  Ie(([g, w, b]) => !g && !b && w !== 0),
10262
10265
  le(([g, w]) => w),
10263
10266
  In(1)
@@ -10293,15 +10296,15 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10293
10296
  })
10294
10297
  ),
10295
10298
  (g) => {
10296
- De(e, g), requestAnimationFrame(() => {
10297
- De(t, { top: g }), requestAnimationFrame(() => {
10298
- De(e, 0), De(m, !1);
10299
+ $e(e, g), requestAnimationFrame(() => {
10300
+ $e(t, { top: g }), requestAnimationFrame(() => {
10301
+ $e(e, 0), $e(m, !1);
10299
10302
  });
10300
10303
  });
10301
10304
  }
10302
10305
  ), { deviation: e };
10303
10306
  },
10304
- ht(zt, go, ar, kn, Hn, Ma)
10307
+ ht(Bt, go, ar, kn, Hn, Ma)
10305
10308
  ), Y0 = tt(
10306
10309
  ([
10307
10310
  e,
@@ -10407,7 +10410,7 @@ const q0 = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10407
10410
  ht(
10408
10411
  kn,
10409
10412
  mo,
10410
- zt,
10413
+ Bt,
10411
10414
  W0,
10412
10415
  B0,
10413
10416
  ar,
@@ -10432,22 +10435,22 @@ const Eo = typeof document < "u" ? B.useLayoutEffect : B.useEffect;
10432
10435
  function Mf(e, t, n) {
10433
10436
  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
10437
  function l(y, g) {
10435
- y.propsReady && De(y.propsReady, !1);
10438
+ y.propsReady && $e(y.propsReady, !1);
10436
10439
  for (const w of r) {
10437
10440
  const b = y[t.required[w]];
10438
- De(b, g[w]);
10441
+ $e(b, g[w]);
10439
10442
  }
10440
10443
  for (const w of o)
10441
10444
  if (w in g) {
10442
10445
  const b = y[t.optional[w]];
10443
- De(b, g[w]);
10446
+ $e(b, g[w]);
10444
10447
  }
10445
- y.propsReady && De(y.propsReady, !0);
10448
+ y.propsReady && $e(y.propsReady, !0);
10446
10449
  }
10447
10450
  function c(y) {
10448
10451
  return s.reduce((g, w) => (g[w] = (b) => {
10449
10452
  const T = y[t.methods[w]];
10450
- De(T, b);
10453
+ $e(T, b);
10451
10454
  }, g), {});
10452
10455
  }
10453
10456
  function d(y) {
@@ -10472,7 +10475,7 @@ function Mf(e, t, n) {
10472
10475
  const g = B.useContext(a);
10473
10476
  return B.useCallback(
10474
10477
  (w) => {
10475
- De(g[y], w);
10478
+ $e(g[y], w);
10476
10479
  },
10477
10480
  [g, y]
10478
10481
  );
@@ -10573,7 +10576,7 @@ function Ha(e) {
10573
10576
  return e;
10574
10577
  }
10575
10578
  const Z0 = /* @__PURE__ */ tt(() => {
10576
- const e = Z((a) => `Item ${a}`), t = Z((a) => `Group ${a}`), n = Z({}), r = Z(Ha), o = Z("div"), s = Z(Nr), i = (a, l = null) => $t(
10579
+ const e = Z((a) => `Item ${a}`), t = Z((a) => `Group ${a}`), n = Z({}), r = Z(Ha), o = Z("div"), s = Z(Nr), i = (a, l = null) => Ft(
10577
10580
  V(
10578
10581
  n,
10579
10582
  le((c) => c[a]),
@@ -10632,10 +10635,10 @@ const Z0 = /* @__PURE__ */ tt(() => {
10632
10635
  },
10633
10636
  ...P ? {} : { visibility: "hidden" }
10634
10637
  };
10635
- return !e && t.totalCount === 0 && b ? /* @__PURE__ */ u.jsx(b, { ...Lt(b, c) }) : /* @__PURE__ */ u.jsx(
10638
+ return !e && t.totalCount === 0 && b ? /* @__PURE__ */ u.jsx(b, { ...$t(b, c) }) : /* @__PURE__ */ u.jsx(
10636
10639
  C,
10637
10640
  {
10638
- ...Lt(C, c),
10641
+ ...$t(C, c),
10639
10642
  "data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
10640
10643
  ref: y,
10641
10644
  style: $,
@@ -10644,7 +10647,7 @@ const Z0 = /* @__PURE__ */ tt(() => {
10644
10647
  return N ? /* @__PURE__ */ _o(
10645
10648
  T,
10646
10649
  {
10647
- ...Lt(T, c),
10650
+ ...$t(T, c),
10648
10651
  height: I.size,
10649
10652
  index: I.index,
10650
10653
  key: A,
@@ -10654,7 +10657,7 @@ const Z0 = /* @__PURE__ */ tt(() => {
10654
10657
  ) : I.type === "group" ? /* @__PURE__ */ _o(
10655
10658
  k,
10656
10659
  {
10657
- ...Lt(k, c),
10660
+ ...$t(k, c),
10658
10661
  "data-index": F,
10659
10662
  "data-item-index": I.index,
10660
10663
  "data-known-size": I.size,
@@ -10665,7 +10668,7 @@ const Z0 = /* @__PURE__ */ tt(() => {
10665
10668
  ) : /* @__PURE__ */ _o(
10666
10669
  S,
10667
10670
  {
10668
- ...Lt(S, c),
10671
+ ...$t(S, c),
10669
10672
  ...iS(S, I.data),
10670
10673
  "data-index": F,
10671
10674
  "data-item-group-index": I.groupIndex,
@@ -10701,7 +10704,7 @@ const Z0 = /* @__PURE__ */ tt(() => {
10701
10704
  width: "100%",
10702
10705
  zIndex: 1
10703
10706
  };
10704
- function Lt(e, t) {
10707
+ function $t(e, t) {
10705
10708
  if (typeof e != "string")
10706
10709
  return { context: t };
10707
10710
  }
@@ -10719,7 +10722,7 @@ const aS = /* @__PURE__ */ B.memo(function() {
10719
10722
  !0,
10720
10723
  _e("skipAnimationFrameInResizeObserver")
10721
10724
  ), o = _e("context");
10722
- return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Lt(e, o) }) }) : null;
10725
+ return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...$t(e, o) }) }) : null;
10723
10726
  }), lS = /* @__PURE__ */ B.memo(function() {
10724
10727
  const e = _e("FooterComponent"), t = en("footerHeight"), n = _e("HeaderFooterTag"), r = ir(
10725
10728
  B.useMemo(
@@ -10731,7 +10734,7 @@ const aS = /* @__PURE__ */ B.memo(function() {
10731
10734
  !0,
10732
10735
  _e("skipAnimationFrameInResizeObserver")
10733
10736
  ), o = _e("context");
10734
- return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Lt(e, o) }) }) : null;
10737
+ return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...$t(e, o) }) }) : null;
10735
10738
  });
10736
10739
  function Bf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
10737
10740
  return B.memo(function({ children: r, style: o, context: s, ...i }) {
@@ -10752,7 +10755,7 @@ function Bf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
10752
10755
  style: { ...f ? oS : rS, ...o },
10753
10756
  tabIndex: 0,
10754
10757
  ...i,
10755
- ...Lt(l, s),
10758
+ ...$t(l, s),
10756
10759
  children: r
10757
10760
  }
10758
10761
  );
@@ -10779,7 +10782,7 @@ function Hf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
10779
10782
  "data-virtuoso-scroller": !0,
10780
10783
  style: { position: "relative", ...o, ...d !== 0 ? { height: d + f } : {} },
10781
10784
  ...i,
10782
- ...Lt(l, s),
10785
+ ...$t(l, s),
10783
10786
  children: r
10784
10787
  }
10785
10788
  );
@@ -10804,7 +10807,7 @@ const cS = ({ children: e }) => {
10804
10807
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "window", ref: s, style: Fs(i), children: e });
10805
10808
  }, dS = ({ children: e }) => {
10806
10809
  const t = _e("TopItemListComponent") || "div", n = _e("headerHeight"), r = { ...sS, marginTop: `${n}px` }, o = _e("context");
10807
- return /* @__PURE__ */ u.jsx(t, { style: r, ...Lt(t, o), children: e });
10810
+ return /* @__PURE__ */ u.jsx(t, { style: r, ...$t(t, o), children: e });
10808
10811
  }, fS = /* @__PURE__ */ B.memo(function(e) {
10809
10812
  const t = _e("useWindowScroll"), n = _e("topItemsIndexes").length > 0, r = _e("customScrollParent"), o = _e("context");
10810
10813
  return /* @__PURE__ */ u.jsxs(r || t ? mS : hS, { ...e, context: o, children: [
@@ -10886,7 +10889,7 @@ const cS = ({ children: e }) => {
10886
10889
  ] })), t = Z(null), n = Z((c) => /* @__PURE__ */ u.jsxs("td", { colSpan: 1e3, children: [
10887
10890
  "Group ",
10888
10891
  c
10889
- ] })), r = Z(null), o = Z(null), s = Z({}), i = Z(Ha), a = Z(Nr), l = (c, d = null) => $t(
10892
+ ] })), r = Z(null), o = Z(null), s = Z({}), i = Z(Ha), a = Z(Nr), l = (c, d = null) => Ft(
10890
10893
  V(
10891
10894
  s,
10892
10895
  le((f) => f[c]),
@@ -10967,7 +10970,7 @@ const bS = /* @__PURE__ */ tt(
10967
10970
  Ie(([D, H]) => !!H)
10968
10971
  ),
10969
10972
  () => {
10970
- De(J, !1);
10973
+ $e(J, !1);
10971
10974
  }
10972
10975
  ), it(
10973
10976
  V(
@@ -10975,10 +10978,10 @@ const bS = /* @__PURE__ */ tt(
10975
10978
  Ie(([D, H, W, se, , re]) => D && !H && W.height !== 0 && se.height !== 0 && !re)
10976
10979
  ),
10977
10980
  ([, , , , D]) => {
10978
- De(G, !0), La(1, () => {
10979
- De(j, D);
10981
+ $e(G, !0), La(1, () => {
10982
+ $e(j, D);
10980
10983
  }), dn(V(c), () => {
10981
- De(t, [0, 0]), De(J, !0);
10984
+ $e(t, [0, 0]), $e(J, !0);
10982
10985
  });
10983
10986
  }
10984
10987
  ), me(
@@ -10995,9 +10998,9 @@ const bS = /* @__PURE__ */ tt(
10995
10998
  Ie(([, D]) => D != null)
10996
10999
  ),
10997
11000
  ([, D]) => {
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
+ D && ($e(N, D.viewport), $e(M, D.item), $e(F, D.gap), D.scrollTop > 0 && ($e(L, !0), dn(V(c, er(1)), (H) => {
11002
+ $e(L, !1);
11003
+ }), $e(l, { top: D.scrollTop })));
11001
11004
  }
11002
11005
  ), me(
11003
11006
  V(
@@ -11008,10 +11011,10 @@ const bS = /* @__PURE__ */ tt(
11008
11011
  ), me(
11009
11012
  V(
11010
11013
  Rt(
11011
- Re(N, Io),
11012
- Re(M, Io),
11013
- Re(F, (D, H) => D && D.column === H.column && D.row === H.row),
11014
- Re(c)
11014
+ Ee(N, Io),
11015
+ Ee(M, Io),
11016
+ Ee(F, (D, H) => D && D.column === H.column && D.row === H.row),
11017
+ Ee(c)
11015
11018
  ),
11016
11019
  le(([D, H, W, se]) => ({
11017
11020
  gap: W,
@@ -11024,16 +11027,16 @@ const bS = /* @__PURE__ */ tt(
11024
11027
  ), me(
11025
11028
  V(
11026
11029
  Rt(
11027
- Re(S),
11030
+ Ee(S),
11028
11031
  r,
11029
- Re(F, wS),
11030
- Re(M, Io),
11031
- Re(N, Io),
11032
- Re(I),
11033
- Re(k),
11034
- Re(L),
11035
- Re(J),
11036
- Re(_)
11032
+ Ee(F, wS),
11033
+ Ee(M, Io),
11034
+ Ee(N, Io),
11035
+ Ee(I),
11036
+ Ee(k),
11037
+ Ee(L),
11038
+ Ee(J),
11039
+ Ee(_)
11037
11040
  ),
11038
11041
  Ie(([, , , , , , , D]) => !D),
11039
11042
  le(
@@ -11042,24 +11045,24 @@ const bS = /* @__PURE__ */ tt(
11042
11045
  [H, W],
11043
11046
  se,
11044
11047
  re,
11045
- Le,
11048
+ Fe,
11046
11049
  Ke,
11047
11050
  Qe,
11048
11051
  ,
11049
11052
  oe,
11050
11053
  he
11051
11054
  ]) => {
11052
- const { column: Te, row: He } = se, { height: Ze, width: nt } = re, { width: $e } = Le;
11053
- if (Qe === 0 && (D === 0 || $e === 0))
11055
+ const { column: ke, row: He } = se, { height: Ze, width: nt } = re, { width: ze } = Fe;
11056
+ if (Qe === 0 && (D === 0 || ze === 0))
11054
11057
  return vc;
11055
11058
  if (nt === 0) {
11056
- const Oe = $a(he, D), At = Oe + Math.max(Qe - 1, 0);
11057
- return vS(Sc(Oe, At, Ke));
11059
+ const De = $a(he, D), At = De + Math.max(Qe - 1, 0);
11060
+ return vS(Sc(De, At, Ke));
11058
11061
  }
11059
- const Ue = Uf($e, nt, Te);
11062
+ const Ue = Uf(ze, nt, ke);
11060
11063
  let qe, rt;
11061
11064
  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;
11065
+ const It = Sc(qe, rt, Ke), { bottom: ft, top: mt } = Cc(Fe, se, re, It), gt = wc(D / Ue), at = gt * Ze + (gt - 1) * He - ft;
11063
11066
  return { bottom: ft, itemHeight: Ze, items: It, itemWidth: nt, offsetBottom: at, offsetTop: mt, top: mt };
11064
11067
  }
11065
11068
  )
@@ -11077,27 +11080,27 @@ const bS = /* @__PURE__ */ tt(
11077
11080
  Rt(N, M, E, F),
11078
11081
  Ie(([D, H, { items: W }]) => W.length > 0 && H.height !== 0 && D.height !== 0),
11079
11082
  le(([D, H, { items: W }, se]) => {
11080
- const { bottom: re, top: Le } = Cc(D, se, H, W);
11081
- return [Le, re];
11083
+ const { bottom: re, top: Fe } = Cc(D, se, H, W);
11084
+ return [Fe, re];
11082
11085
  }),
11083
11086
  pt(Qr)
11084
11087
  ),
11085
11088
  t
11086
11089
  );
11087
- const Ce = Z(!1);
11090
+ const Te = Z(!1);
11088
11091
  me(
11089
11092
  V(
11090
11093
  c,
11091
- Be(Ce),
11094
+ Be(Te),
11092
11095
  le(([D, H]) => H || D !== 0)
11093
11096
  ),
11094
- Ce
11097
+ Te
11095
11098
  );
11096
- const Ne = Yt(
11099
+ const Ne = Xt(
11097
11100
  V(
11098
11101
  Rt(E, S),
11099
11102
  Ie(([{ items: D }]) => D.length > 0),
11100
- Be(Ce),
11103
+ Be(Te),
11101
11104
  Ie(([[D, H], W]) => {
11102
11105
  const se = D.items[D.items.length - 1].index === H - 1;
11103
11106
  return (W || D.bottom > 0 && D.itemHeight > 0 && D.offsetBottom === 0 && D.items.length === H) && se;
@@ -11105,16 +11108,16 @@ const bS = /* @__PURE__ */ tt(
11105
11108
  le(([[, D]]) => D - 1),
11106
11109
  pt()
11107
11110
  )
11108
- ), q = Yt(
11111
+ ), q = Xt(
11109
11112
  V(
11110
- Re(E),
11113
+ Ee(E),
11111
11114
  Ie(({ items: D }) => D.length > 0 && D[0].index === 0),
11112
11115
  yn(0),
11113
11116
  pt()
11114
11117
  )
11115
- ), ne = Yt(
11118
+ ), ne = Xt(
11116
11119
  V(
11117
- Re(E),
11120
+ Ee(E),
11118
11121
  Be(L),
11119
11122
  Ie(([{ items: D }, H]) => D.length > 0 && !H),
11120
11123
  le(([{ items: D }]) => ({
@@ -11130,16 +11133,16 @@ const bS = /* @__PURE__ */ tt(
11130
11133
  j,
11131
11134
  Be(N, M, S, F),
11132
11135
  le(([D, H, W, se, re]) => {
11133
- const Le = Rf(D), { align: Ke, behavior: Qe, offset: oe } = Le;
11134
- let he = Le.index;
11136
+ const Fe = Rf(D), { align: Ke, behavior: Qe, offset: oe } = Fe;
11137
+ let he = Fe.index;
11135
11138
  he === "LAST" && (he = se - 1), he = Br(0, he, bi(se - 1, he));
11136
- let Te = Gi(H, re, W, he);
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 };
11139
+ let ke = Gi(H, re, W, he);
11140
+ return Ke === "end" ? ke = bc(ke - H.height + W.height) : Ke === "center" && (ke = bc(ke - H.height / 2 + W.height / 2)), oe && (ke += oe), { behavior: Qe, top: ke };
11138
11141
  })
11139
11142
  ),
11140
11143
  l
11141
11144
  );
11142
- const Y = $t(
11145
+ const Y = Ft(
11143
11146
  V(
11144
11147
  E,
11145
11148
  le((D) => D.offsetBottom + D.bottom)
@@ -11194,7 +11197,7 @@ const bS = /* @__PURE__ */ tt(
11194
11197
  ...C
11195
11198
  };
11196
11199
  },
11197
- ht(Fa, zt, go, jf, Un, za, Hn)
11200
+ ht(Fa, Bt, go, jf, Un, za, Hn)
11198
11201
  );
11199
11202
  function Uf(e, t, n) {
11200
11203
  return Br(1, ns((e + n) / (ns(t) + n)));
@@ -11211,7 +11214,7 @@ function Gi(e, t, n, r) {
11211
11214
  return i > 0 ? i + t.row : i;
11212
11215
  }
11213
11216
  const SS = /* @__PURE__ */ tt(() => {
11214
- const e = Z((f) => `Item ${f}`), t = Z({}), n = Z(null), r = Z("virtuoso-grid-item"), o = Z("virtuoso-grid-list"), s = Z(Ha), i = Z("div"), a = Z(Nr), l = (f, p = null) => $t(
11217
+ const e = Z((f) => `Item ${f}`), t = Z({}), n = Z(null), r = Z("virtuoso-grid-item"), o = Z("virtuoso-grid-list"), s = Z(Ha), i = Z("div"), a = Z(Nr), l = (f, p = null) => Ft(
11215
11218
  V(
11216
11219
  t,
11217
11220
  le((h) => h[f]),
@@ -11219,7 +11222,7 @@ const SS = /* @__PURE__ */ tt(() => {
11219
11222
  ),
11220
11223
  p
11221
11224
  ), c = Z(!1), d = Z(!1);
11222
- return me(Re(d), c), {
11225
+ return me(Ee(d), c), {
11223
11226
  components: t,
11224
11227
  computeItemKey: s,
11225
11228
  context: n,
@@ -11268,7 +11271,7 @@ const SS = /* @__PURE__ */ tt(() => {
11268
11271
  {
11269
11272
  className: t,
11270
11273
  ref: y,
11271
- ...Lt(l, d),
11274
+ ...$t(l, d),
11272
11275
  "data-testid": "virtuoso-item-list",
11273
11276
  style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
11274
11277
  children: e.items.map((g) => {
@@ -11276,7 +11279,7 @@ const SS = /* @__PURE__ */ tt(() => {
11276
11279
  return s ? /* @__PURE__ */ u.jsx(
11277
11280
  c,
11278
11281
  {
11279
- ...Lt(c, d),
11282
+ ...$t(c, d),
11280
11283
  height: e.itemHeight,
11281
11284
  index: g.index,
11282
11285
  width: e.itemWidth
@@ -11285,7 +11288,7 @@ const SS = /* @__PURE__ */ tt(() => {
11285
11288
  ) : /* @__PURE__ */ _o(
11286
11289
  a,
11287
11290
  {
11288
- ...Lt(a, d),
11291
+ ...$t(a, d),
11289
11292
  className: n,
11290
11293
  "data-index": g.index,
11291
11294
  key: w
@@ -11306,7 +11309,7 @@ const SS = /* @__PURE__ */ tt(() => {
11306
11309
  !0,
11307
11310
  !1
11308
11311
  ), o = yt("context");
11309
- return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Lt(e, o) }) }) : null;
11312
+ return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...$t(e, o) }) }) : null;
11310
11313
  }), RS = B.memo(function() {
11311
11314
  const e = yt("FooterComponent"), t = tn("footerHeight"), n = yt("headerFooterTag"), r = ir(
11312
11315
  B.useMemo(
@@ -11318,7 +11321,7 @@ const SS = /* @__PURE__ */ tt(() => {
11318
11321
  !0,
11319
11322
  !1
11320
11323
  ), o = yt("context");
11321
- return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Lt(e, o) }) }) : null;
11324
+ return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...$t(e, o) }) }) : null;
11322
11325
  }), ES = ({ children: e }) => {
11323
11326
  const t = B.useContext(Lf), n = tn("itemDimensions"), r = tn("viewportDimensions"), o = ir(
11324
11327
  B.useMemo(
@@ -11340,7 +11343,7 @@ const SS = /* @__PURE__ */ tt(() => {
11340
11343
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { ref: s, style: Fs(!1), children: e });
11341
11344
  }, NS = /* @__PURE__ */ B.memo(function({ ...e }) {
11342
11345
  const t = yt("useWindowScroll"), n = yt("customScrollParent"), r = n || t ? _S : AS, o = n || t ? IS : ES, s = yt("context");
11343
- return /* @__PURE__ */ u.jsx(r, { ...e, ...Lt(r, s), children: /* @__PURE__ */ u.jsxs(o, { children: [
11346
+ return /* @__PURE__ */ u.jsx(r, { ...e, ...$t(r, s), children: /* @__PURE__ */ u.jsxs(o, { children: [
11344
11347
  /* @__PURE__ */ u.jsx(kS, {}),
11345
11348
  /* @__PURE__ */ u.jsx(TS, {}),
11346
11349
  /* @__PURE__ */ u.jsx(RS, {})
@@ -11392,7 +11395,7 @@ const SS = /* @__PURE__ */ tt(() => {
11392
11395
  NS
11393
11396
  ), AS = /* @__PURE__ */ Bf({ useEmitter: Wf, useEmitterValue: yt, usePublisher: tn }), _S = /* @__PURE__ */ Hf({ useEmitter: Wf, useEmitterValue: yt, usePublisher: tn });
11394
11397
  function Tc(e, t, n) {
11395
- return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Vt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
11398
+ return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
11396
11399
  }
11397
11400
  const jS = hs(
11398
11401
  "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
@@ -12130,7 +12133,7 @@ const wp = /[&<>"']/, rC = new RegExp(wp.source, "g"), bp = /[<>"']|&(?!(#\d{1,7
12130
12133
  '"': "&quot;",
12131
12134
  "'": "&#39;"
12132
12135
  }, Ec = (e) => sC[e];
12133
- function Mt(e, t) {
12136
+ function Dt(e, t) {
12134
12137
  if (t) {
12135
12138
  if (wp.test(e))
12136
12139
  return e.replace(rC, Ec);
@@ -12236,7 +12239,7 @@ function Ac(e, t) {
12236
12239
  return n + e;
12237
12240
  }
12238
12241
  function _c(e, t, n, r) {
12239
- const o = t.href, s = t.title ? Mt(t.title) : null, i = e[1].replace(/\\([\[\]])/g, "$1");
12242
+ const o = t.href, s = t.title ? Dt(t.title) : null, i = e[1].replace(/\\([\[\]])/g, "$1");
12240
12243
  if (e[0].charAt(0) !== "!") {
12241
12244
  r.state.inLink = !0;
12242
12245
  const a = {
@@ -12254,7 +12257,7 @@ function _c(e, t, n, r) {
12254
12257
  raw: n,
12255
12258
  href: o,
12256
12259
  title: s,
12257
- text: Mt(i)
12260
+ text: Dt(i)
12258
12261
  };
12259
12262
  }
12260
12263
  function gC(e, t) {
@@ -12415,7 +12418,7 @@ class Ya {
12415
12418
  text: n[0]
12416
12419
  };
12417
12420
  if (this.options.sanitize) {
12418
- const o = this.options.sanitizer ? this.options.sanitizer(n[0]) : Mt(n[0]);
12421
+ const o = this.options.sanitizer ? this.options.sanitizer(n[0]) : Dt(n[0]);
12419
12422
  r.type = "paragraph", r.text = o, r.tokens = this.lexer.inline(o);
12420
12423
  }
12421
12424
  return r;
@@ -12500,7 +12503,7 @@ class Ya {
12500
12503
  return {
12501
12504
  type: "escape",
12502
12505
  raw: n[0],
12503
- text: Mt(n[1])
12506
+ text: Dt(n[1])
12504
12507
  };
12505
12508
  }
12506
12509
  tag(t) {
@@ -12511,7 +12514,7 @@ class Ya {
12511
12514
  raw: n[0],
12512
12515
  inLink: this.lexer.state.inLink,
12513
12516
  inRawBlock: this.lexer.state.inRawBlock,
12514
- text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(n[0]) : Mt(n[0]) : n[0]
12517
+ text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(n[0]) : Dt(n[0]) : n[0]
12515
12518
  };
12516
12519
  }
12517
12520
  link(t) {
@@ -12602,7 +12605,7 @@ class Ya {
12602
12605
  if (n) {
12603
12606
  let r = n[2].replace(/\n/g, " ");
12604
12607
  const o = /[^ ]/.test(r), s = /^ /.test(r) && / $/.test(r);
12605
- return o && s && (r = r.substring(1, r.length - 1)), r = Mt(r, !0), {
12608
+ return o && s && (r = r.substring(1, r.length - 1)), r = Dt(r, !0), {
12606
12609
  type: "codespan",
12607
12610
  raw: n[0],
12608
12611
  text: r
@@ -12631,7 +12634,7 @@ class Ya {
12631
12634
  const r = this.rules.inline.autolink.exec(t);
12632
12635
  if (r) {
12633
12636
  let o, s;
12634
- return r[2] === "@" ? (o = Mt(this.options.mangle ? n(r[1]) : r[1]), s = "mailto:" + o) : (o = Mt(r[1]), s = o), {
12637
+ return r[2] === "@" ? (o = Dt(this.options.mangle ? n(r[1]) : r[1]), s = "mailto:" + o) : (o = Dt(r[1]), s = o), {
12635
12638
  type: "link",
12636
12639
  raw: r[0],
12637
12640
  text: o,
@@ -12651,13 +12654,13 @@ class Ya {
12651
12654
  if (r = this.rules.inline.url.exec(t)) {
12652
12655
  let o, s;
12653
12656
  if (r[2] === "@")
12654
- o = Mt(this.options.mangle ? n(r[0]) : r[0]), s = "mailto:" + o;
12657
+ o = Dt(this.options.mangle ? n(r[0]) : r[0]), s = "mailto:" + o;
12655
12658
  else {
12656
12659
  let i;
12657
12660
  do
12658
12661
  i = r[0], r[0] = this.rules.inline._backpedal.exec(r[0])[0];
12659
12662
  while (i !== r[0]);
12660
- o = Mt(r[0]), r[1] === "www." ? s = "http://" + r[0] : s = r[0];
12663
+ o = Dt(r[0]), r[1] === "www." ? s = "http://" + r[0] : s = r[0];
12661
12664
  }
12662
12665
  return {
12663
12666
  type: "link",
@@ -12678,7 +12681,7 @@ class Ya {
12678
12681
  const r = this.rules.inline.text.exec(t);
12679
12682
  if (r) {
12680
12683
  let o;
12681
- return this.lexer.state.inRawBlock ? o = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(r[0]) : Mt(r[0]) : r[0] : o = Mt(this.options.smartypants ? n(r[0]) : r[0]), {
12684
+ return this.lexer.state.inRawBlock ? o = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(r[0]) : Dt(r[0]) : r[0] : o = Dt(this.options.smartypants ? n(r[0]) : r[0]), {
12682
12685
  type: "text",
12683
12686
  raw: r[0],
12684
12687
  text: o
@@ -13054,8 +13057,8 @@ class Xa {
13054
13057
  s != null && s !== t && (r = !0, t = s);
13055
13058
  }
13056
13059
  return t = t.replace(/\n$/, "") + `
13057
- `, o ? '<pre><code class="' + this.options.langPrefix + Mt(o) + '">' + (r ? t : Mt(t, !0)) + `</code></pre>
13058
- ` : "<pre><code>" + (r ? t : Mt(t, !0)) + `</code></pre>
13060
+ `, o ? '<pre><code class="' + this.options.langPrefix + Dt(o) + '">' + (r ? t : Dt(t, !0)) + `</code></pre>
13061
+ ` : "<pre><code>" + (r ? t : Dt(t, !0)) + `</code></pre>
13059
13062
  `;
13060
13063
  }
13061
13064
  /**
@@ -13455,7 +13458,7 @@ function yC(e, t, n) {
13455
13458
  return (r) => {
13456
13459
  if (r.message += `
13457
13460
  Please report this to https://github.com/markedjs/marked.`, e) {
13458
- const o = "<p>An error occurred:</p><pre>" + Mt(r.message + "", !0) + "</pre>";
13461
+ const o = "<p>An error occurred:</p><pre>" + Dt(r.message + "", !0) + "</pre>";
13459
13462
  if (t)
13460
13463
  return Promise.resolve(o);
13461
13464
  if (n) {
@@ -13805,13 +13808,13 @@ const Oc = B.memo(function({
13805
13808
  defaultCheckpointId: E = null,
13806
13809
  messageParentCheckpointId: N = null
13807
13810
  }) {
13808
- const [M, j] = ve(!1), [P, $] = ve("preview"), [I, F] = ve(!1), { currentThreadId: A } = da(), { respondToInterrupt: X } = fa(), L = l === "phone" || l === "half-screen", _ = t.role, J = _ === "tool", G = ot(() => "type" in t && t.type === "default_message" ? t : null, [t]), fe = !!G, Ce = !(r && _ !== "user"), {
13811
+ const [M, j] = ve(!1), [P, $] = ve("preview"), [I, F] = ve(!1), { currentThreadId: A } = da(), { respondToInterrupt: X } = fa(), L = l === "phone" || l === "half-screen", _ = t.role, J = _ === "tool", G = ot(() => "type" in t && t.type === "default_message" ? t : null, [t]), fe = !!G, Te = !(r && _ !== "user"), {
13809
13812
  uploadingFiles: Ne,
13810
13813
  handleFileClick: q,
13811
13814
  fileViewerOpen: ne,
13812
13815
  currentFileInfo: Y,
13813
13816
  closeFileViewer: D
13814
- } = kC({ allowFileOpen: Ce, currentThreadId: A }), H = B.useMemo(() => {
13817
+ } = kC({ allowFileOpen: Te, currentThreadId: A }), H = B.useMemo(() => {
13815
13818
  switch (_) {
13816
13819
  case "user":
13817
13820
  return "text-[hsl(var(--chat-bubble-user-text))]";
@@ -13827,14 +13830,14 @@ const Oc = B.memo(function({
13827
13830
  }, [_]), W = ot(() => G ? "" : wC(t.content), [G, t]), se = ot(() => G ? {} : Rp(t), [G, t]), re = ot(
13828
13831
  () => G ? [] : t.content.filter((U) => U.type === "image_url"),
13829
13832
  [G, t]
13830
- ), Le = ot(
13833
+ ), Fe = ot(
13831
13834
  () => G ? [] : t.content.filter((U) => U.type === "file"),
13832
13835
  [G, t]
13833
13836
  ), Ke = ot(
13834
13837
  () => G ? [] : t.content.filter((U) => U.type === "interrupt"),
13835
13838
  [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]), He = B.useCallback(async () => {
13837
- const U = J ? Te : W;
13839
+ ), Qe = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), oe = Ao(Qe), he = g == null ? void 0 : g.value, ke = ot(() => G ? "" : bC(t.content), [G, t]), He = B.useCallback(async () => {
13840
+ const U = J ? ke : W;
13838
13841
  async function ye(z) {
13839
13842
  if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
13840
13843
  await navigator.clipboard.writeText(z);
@@ -13856,16 +13859,16 @@ const Oc = B.memo(function({
13856
13859
  } catch (z) {
13857
13860
  console.error("Failed to copy:", z);
13858
13861
  }
13859
- }, [J, Te, W, y]), Ze = B.useCallback(() => {
13862
+ }, [J, ke, W, y]), Ze = B.useCallback(() => {
13860
13863
  if (!h) return;
13861
- const U = J ? Te : W, ye = "type" in t && t.type === "default_message" ? void 0 : {
13864
+ const U = J ? ke : W, ye = "type" in t && t.type === "default_message" ? void 0 : {
13862
13865
  checkpointId: t.checkpointId ?? null,
13863
13866
  checkpointNs: t.checkpointNs ?? null
13864
13867
  };
13865
13868
  h(t.id, U, ye);
13866
- }, [h, t.id, J, Te, W, t]), nt = B.useCallback(() => {
13869
+ }, [h, t.id, J, ke, W, t]), nt = B.useCallback(() => {
13867
13870
  m == null || m(n);
13868
- }, [m, n]), $e = B.useCallback(() => {
13871
+ }, [m, n]), ze = B.useCallback(() => {
13869
13872
  const ye = te(L ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", H);
13870
13873
  switch (_) {
13871
13874
  case "user":
@@ -14027,7 +14030,7 @@ const Oc = B.memo(function({
14027
14030
  if (U.type === "interrupt") {
14028
14031
  const z = U, ee = Ao(
14029
14032
  (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, ie = ee ? { ...z, id: ee, interrupt_id: ee } : z;
14033
+ ), ge = !!(oe && ee && ee === oe), Se = ge ? he ?? (z == null ? void 0 : z.value) : z == null ? void 0 : z.value, ie = ee ? { ...z, id: ee, interrupt_id: ee } : z;
14031
14034
  return /* @__PURE__ */ u.jsx(
14032
14035
  TC,
14033
14036
  {
@@ -14036,7 +14039,7 @@ const Oc = B.memo(function({
14036
14039
  onReject: It,
14037
14040
  disabled: w,
14038
14041
  isActive: ge,
14039
- payload: Ee
14042
+ payload: Se
14040
14043
  },
14041
14044
  ye
14042
14045
  );
@@ -14061,8 +14064,8 @@ const Oc = B.memo(function({
14061
14064
  /* @__PURE__ */ u.jsx(ki, { className: "h-4 w-4 text-muted-foreground" }),
14062
14065
  /* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
14063
14066
  ] }), []), gt = B.useCallback(() => {
14064
- const U = W.trim().length > 0 || re.length > 0 || Le.length > 0 || Ke.length > 0;
14065
- if (!J && Le.length > 0 && !r)
14067
+ const U = W.trim().length > 0 || re.length > 0 || Fe.length > 0 || Ke.length > 0;
14068
+ if (!J && Fe.length > 0 && !r)
14066
14069
  return mt();
14067
14070
  if (!J && !U && !r)
14068
14071
  return null;
@@ -14085,24 +14088,24 @@ const Oc = B.memo(function({
14085
14088
  }, [
14086
14089
  W,
14087
14090
  re.length,
14088
- Le.length,
14091
+ Fe.length,
14089
14092
  Ke.length,
14090
14093
  r,
14091
14094
  J,
14092
14095
  P,
14093
14096
  mt,
14094
14097
  H
14095
- ]), at = ot(() => G ? "Assistant" : SC(t), [G, t]), Oe = B.useMemo(() => G ? [] : Array.isArray(C) ? C : [], [C, G]), At = B.useMemo(() => {
14098
+ ]), at = ot(() => G ? "Assistant" : SC(t), [G, t]), De = B.useMemo(() => G ? [] : Array.isArray(C) ? C : [], [C, G]), At = B.useMemo(() => {
14096
14099
  var U;
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(
14100
+ return De.length ? E && De.some((ye) => ye.id === E) ? E : ((U = De[0]) == null ? void 0 : U.id) ?? null : null;
14101
+ }, [E, De]), Jt = B.useMemo(() => !De.length || !S ? null : De.some((U) => U.id === S) ? S : null, [S, De]) ?? At, an = _ === "user" && De.length > 0 && typeof k == "function", Ye = B.useCallback(
14099
14102
  (U) => {
14100
14103
  if (!k) return;
14101
14104
  const ye = (U == null ? void 0 : U.id) ?? null, z = (U == null ? void 0 : U.parentId) ?? N ?? null;
14102
14105
  k(ye, z);
14103
14106
  },
14104
14107
  [N, k]
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) => {
14108
+ ), Ae = B.useMemo(() => Jt ? De.findIndex((U) => U.id === Jt) : -1, [Jt, De]), Nt = B.useMemo(() => Ae < 0 ? null : De[Ae] ?? null, [Ae, De]), Ht = B.useCallback((U) => {
14106
14109
  const ye = [];
14107
14110
  if (U.step !== null && ye.push(`Step ${U.step}`), U.source && ye.push(U.source), !U.createdAt)
14108
14111
  return ye.length ? ye.join(" • ") : U.id.slice(0, 8);
@@ -14131,7 +14134,7 @@ const Oc = B.memo(function({
14131
14134
  ),
14132
14135
  children: [
14133
14136
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
14134
- $e(),
14137
+ ze(),
14135
14138
  a && at && /* @__PURE__ */ u.jsx("span", { className: te("font-medium", L ? "text-xs" : "text-sm"), children: at }),
14136
14139
  J && /* @__PURE__ */ u.jsxs(
14137
14140
  Vf,
@@ -14170,7 +14173,7 @@ const Oc = B.memo(function({
14170
14173
  ),
14171
14174
  onClick: () => {
14172
14175
  if (Ae <= 0) return;
14173
- const U = Oe[Ae - 1];
14176
+ const U = De[Ae - 1];
14174
14177
  U && Ye(U);
14175
14178
  },
14176
14179
  "aria-label": "Previous checkpoint",
@@ -14182,9 +14185,9 @@ const Oc = B.memo(function({
14182
14185
  /* @__PURE__ */ u.jsxs("span", { className: "whitespace-nowrap", children: [
14183
14186
  Ae + 1,
14184
14187
  " / ",
14185
- Oe.length
14188
+ De.length
14186
14189
  ] }),
14187
- /* @__PURE__ */ u.jsx("span", { className: "text-muted-foreground", children: Bt(Nt) })
14190
+ /* @__PURE__ */ u.jsx("span", { className: "text-muted-foreground", children: Ht(Nt) })
14188
14191
  ] }),
14189
14192
  /* @__PURE__ */ u.jsx(
14190
14193
  "button",
@@ -14192,15 +14195,15 @@ const Oc = B.memo(function({
14192
14195
  type: "button",
14193
14196
  className: te(
14194
14197
  "flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
14195
- Ae < Oe.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
14198
+ Ae < De.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
14196
14199
  ),
14197
14200
  onClick: () => {
14198
- if (Ae >= Oe.length - 1) return;
14199
- const U = Oe[Ae + 1];
14201
+ if (Ae >= De.length - 1) return;
14202
+ const U = De[Ae + 1];
14200
14203
  U && Ye(U);
14201
14204
  },
14202
14205
  "aria-label": "Next checkpoint",
14203
- disabled: Ae >= Oe.length - 1,
14206
+ disabled: Ae >= De.length - 1,
14204
14207
  children: /* @__PURE__ */ u.jsx(Uc, { className: "h-3 w-3" })
14205
14208
  }
14206
14209
  )
@@ -14677,9 +14680,9 @@ const IC = ({
14677
14680
  return null;
14678
14681
  const oe = w.id && String(w.id).trim() ? String(w.id).trim() : "pending-interrupt";
14679
14682
  let he;
14680
- const Te = w.value;
14681
- if (Te && typeof Te == "object" && !Array.isArray(Te)) {
14682
- const He = Te.title;
14683
+ const ke = w.value;
14684
+ if (ke && typeof ke == "object" && !Array.isArray(ke)) {
14685
+ const He = ke.title;
14683
14686
  typeof He == "string" && He.trim() && (he = He.trim());
14684
14687
  }
14685
14688
  return {
@@ -14690,12 +14693,12 @@ const IC = ({
14690
14693
  {
14691
14694
  type: "interrupt",
14692
14695
  id: oe,
14693
- value: Te,
14696
+ value: ke,
14694
14697
  title: he
14695
14698
  }
14696
14699
  ]
14697
14700
  };
14698
- }, [w, J]), fe = ot(() => G ? [...e, G] : e, [e, G]), Ce = ot(() => !$ || !t ? fe : !fe.some((he) => he.role === "assistant") && fe.length > 0 ? [
14701
+ }, [w, J]), fe = ot(() => G ? [...e, G] : e, [e, G]), Te = ot(() => !$ || !t ? fe : !fe.some((he) => he.role === "assistant") && fe.length > 0 ? [
14699
14702
  ...fe,
14700
14703
  {
14701
14704
  id: "thinking-assistant",
@@ -14703,10 +14706,10 @@ const IC = ({
14703
14706
  content: [],
14704
14707
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
14705
14708
  }
14706
- ] : fe, [fe, t, $]), Ne = ot(() => S ? Ce : Ce.filter((oe) => (oe == null ? void 0 : oe.role) !== "tool"), [Ce, S]), q = ot(() => {
14709
+ ] : fe, [fe, t, $]), Ne = ot(() => S ? Te : Te.filter((oe) => (oe == null ? void 0 : oe.role) !== "tool"), [Te, S]), q = ot(() => {
14707
14710
  const oe = /* @__PURE__ */ new Set(), he = [];
14708
- for (let Te = Ne.length - 1; Te >= 0; Te--) {
14709
- const He = Ne[Te];
14711
+ for (let ke = Ne.length - 1; ke >= 0; ke--) {
14712
+ const He = Ne[ke];
14710
14713
  if (!He) continue;
14711
14714
  if ("type" in He && He.type === "default_message") {
14712
14715
  he.push(He);
@@ -14716,7 +14719,7 @@ const IC = ({
14716
14719
  oe.has(nt) || (oe.add(nt), he.push(Ze));
14717
14720
  }
14718
14721
  return he.reverse();
14719
- }, [Ne]), ne = Se((oe) => {
14722
+ }, [Ne]), ne = Ce((oe) => {
14720
14723
  _(oe), y && y(!oe), g && g(oe);
14721
14724
  }, [y, g]), Y = ot(() => {
14722
14725
  if (a)
@@ -14748,7 +14751,7 @@ const IC = ({
14748
14751
  onSelectCheckpoint: M,
14749
14752
  messagePreviews: P
14750
14753
  }
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(
14754
+ ) : null, Fe = ["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
14755
  Oc,
14753
14756
  {
14754
14757
  message: se,
@@ -14772,9 +14775,9 @@ const IC = ({
14772
14775
  scrollToLatest: () => {
14773
14776
  var oe, he;
14774
14777
  if (F.current && q.length > 0) {
14775
- const Te = q.length - 1;
14778
+ const ke = q.length - 1;
14776
14779
  (he = (oe = F.current).scrollToIndex) == null || he.call(oe, {
14777
- index: Te,
14780
+ index: ke,
14778
14781
  align: "end",
14779
14782
  behavior: "auto"
14780
14783
  });
@@ -14790,7 +14793,7 @@ const IC = ({
14790
14793
  }
14791
14794
  }),
14792
14795
  [q]
14793
- ), /* @__PURE__ */ u.jsxs("div", { className: Le, style: p, children: [
14796
+ ), /* @__PURE__ */ u.jsxs("div", { className: Fe, style: p, children: [
14794
14797
  re,
14795
14798
  /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: Qe ? /* @__PURE__ */ u.jsx(
14796
14799
  gS,
@@ -14816,21 +14819,21 @@ const IC = ({
14816
14819
  computeItemKey: (oe, he) => Mc(he, oe),
14817
14820
  itemContent: (oe, he) => {
14818
14821
  var ft;
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;
14822
+ const ke = Mc(he, oe), He = "type" in he && he.type === "default_message";
14823
+ let Ze = [], nt = null, ze = {}, Ue = {}, qe = null, rt = null;
14821
14824
  if (!He) {
14822
14825
  const mt = he, gt = mt.checkpointId ?? null;
14823
- $e = mt.additionalKwargs ?? {}, Ue = mt.responseMetadata ?? {};
14826
+ ze = mt.additionalKwargs ?? {}, Ue = mt.responseMetadata ?? {};
14824
14827
  const at = gt && k ? k.get(gt) ?? null : 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
+ qe = typeof ze.step == "number" ? ze.step : typeof Ue.step == "number" ? Ue.step : (at == null ? void 0 : at.step) ?? null;
14829
+ const De = typeof ze.source == "string" ? ze.source : typeof Ue.source == "string" ? Ue.source : (at == null ? void 0 : at.source) ?? null;
14830
+ rt = De ? String(De) : null;
14828
14831
  const At = qe !== null && rt ? `${qe}:${rt}` : null;
14829
14832
  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
14833
  }
14831
14834
  const It = (() => {
14832
- if (typeof $e.parentCheckpointId == "string")
14833
- return $e.parentCheckpointId;
14835
+ if (typeof ze.parentCheckpointId == "string")
14836
+ return ze.parentCheckpointId;
14834
14837
  if (typeof Ue.parentCheckpointId == "string")
14835
14838
  return Ue.parentCheckpointId;
14836
14839
  })();
@@ -14838,7 +14841,7 @@ const IC = ({
14838
14841
  "div",
14839
14842
  {
14840
14843
  className: "relative mb-4 last:mb-0",
14841
- "data-message-id": Te,
14844
+ "data-message-id": ke,
14842
14845
  style: {
14843
14846
  minHeight: "60px",
14844
14847
  containIntrinsicSize: "auto 120px"
@@ -14911,24 +14914,24 @@ function Ti({
14911
14914
  metadata: M,
14912
14915
  timelineCheckpoints: j,
14913
14916
  messagePreviews: P
14914
- } = fa(), { isStreaming: $, error: I, connectionState: F, submit: A, stop: X } = Gx(), L = g ?? y ?? null, _ = (k == null ? void 0 : k.id) ?? null, J = (k == null ? void 0 : k.namespace) ?? null, G = (M == null ? void 0 : M.assemblingMessageId) ?? null, fe = N, [Ce, Ne] = ve(!1);
14917
+ } = fa(), { isStreaming: $, error: I, connectionState: F, submit: A, stop: X } = Gx(), L = g ?? y ?? null, _ = (k == null ? void 0 : k.id) ?? null, J = (k == null ? void 0 : k.namespace) ?? null, G = (M == null ? void 0 : M.assemblingMessageId) ?? null, fe = N, [Te, Ne] = ve(!1);
14915
14918
  Tt(() => {
14916
14919
  fe || Ne(!1);
14917
14920
  }, [fe]);
14918
- const q = Se(() => {
14921
+ const q = Ce(() => {
14919
14922
  Ne(!0);
14920
- }, []), ne = Se(() => {
14923
+ }, []), ne = Ce(() => {
14921
14924
  Ne(!1);
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
- Dc.value = Q, Xt(Q);
14924
- }, []), [Nt, Bt] = ve(!1), U = Ve(null), ye = Se(
14925
+ }, []), Y = !!fe || Te, [D, H] = ve(null), [W, se] = ve(""), [re, Fe] = ve(null), [Ke, Qe] = ve(null), [oe, he] = ve([]), [ke, He] = ve(0), [Ze, nt] = ve(0), [ze, Ue] = ve(!1), [qe, rt] = ve(null), [It, ft] = ve(null), [mt, gt] = ve(!1), [at, De] = ve(null), At = Ve(!1), [_t, Jt] = ve(() => Dc.value), an = Ve(_t), Ye = Ve(null), Ae = Ce((Q) => {
14926
+ Dc.value = Q, Jt(Q);
14927
+ }, []), [Nt, Ht] = ve(!1), U = Ve(null), ye = Ce(
14925
14928
  (Q, ue) => {
14926
14929
  if (!Q || typeof Q != "object") return null;
14927
14930
  const de = Q[ue];
14928
14931
  return typeof de == "number" ? de : null;
14929
14932
  },
14930
14933
  []
14931
- ), z = Se(
14934
+ ), z = Ce(
14932
14935
  (Q, ue) => {
14933
14936
  if (!Q || typeof Q != "object") return null;
14934
14937
  const de = Q[ue];
@@ -14967,7 +14970,7 @@ function Ti({
14967
14970
  const _r = Date.parse(we.createdAt ?? ""), jr = Date.parse(ct.createdAt ?? "");
14968
14971
  return Number.isNaN(_r) || Number.isNaN(jr) ? 0 : jr - _r;
14969
14972
  }), ue;
14970
- }, [E, ye]), { checkpointMetaById: ge, checkpointIndexByKey: Ee } = ot(() => {
14973
+ }, [E, ye]), { checkpointMetaById: ge, checkpointIndexByKey: Se } = ot(() => {
14971
14974
  const Q = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Map();
14972
14975
  for (const de of ee) {
14973
14976
  const we = de.checkpointId ?? null;
@@ -14991,17 +14994,17 @@ function Ti({
14991
14994
  return (ct.createdAt ?? "").localeCompare(xt);
14992
14995
  });
14993
14996
  return { checkpointMetaById: Q, checkpointIndexByKey: ue };
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
- }, []), Jt = Se(
14997
+ }, [ee, ye, z]), ie = j ?? [], Le = Ve(null), Pe = Ve(null), Oe = Ce(() => {
14998
+ Le.current && (Le.current.value = ""), Pe.current && (Pe.current.value = ""), He((Q) => Q + 1), nt((Q) => Q + 1);
14999
+ }, []), Mt = Ce(
14997
15000
  (Q) => {
14998
15001
  Ae(Q);
14999
15002
  },
15000
15003
  [Ae]
15001
15004
  ), wt = Ve(!1);
15002
15005
  Tt(() => {
15003
- wt.current && !$ && (he([]), Me()), wt.current = $;
15004
- }, [$, Me]);
15006
+ wt.current && !$ && (he([]), Oe()), wt.current = $;
15007
+ }, [$, Oe]);
15005
15008
  const [En, Xs] = ve("desktop");
15006
15009
  Tt(() => {
15007
15010
  const Q = () => {
@@ -15022,14 +15025,14 @@ function Ti({
15022
15025
  }, [W, D, Ae]), Tt(() => {
15023
15026
  (async () => {
15024
15027
  if (!x.baseUrl) {
15025
- Oe(null);
15028
+ De(null);
15026
15029
  return;
15027
15030
  }
15028
15031
  try {
15029
15032
  const de = (await x.getAgent("default")).uiDefaultMessage || "";
15030
- Oe(de || null);
15033
+ De(de || null);
15031
15034
  } catch (ue) {
15032
- console.warn("Failed to fetch default message:", ue), Oe(null);
15035
+ console.warn("Failed to fetch default message:", ue), De(null);
15033
15036
  }
15034
15037
  })();
15035
15038
  }, [x.baseUrl]), Tt(() => {
@@ -15070,7 +15073,7 @@ function Ti({
15070
15073
  checkpointId: de,
15071
15074
  checkpointNs: we
15072
15075
  }
15073
- ), p == null || p(ue), Ae(""), Qe(null), he([]), Me(), H(null), se(""), Le(null);
15076
+ ), p == null || p(ue), Ae(""), Qe(null), he([]), Oe(), H(null), se(""), Fe(null);
15074
15077
  } catch (de) {
15075
15078
  const we = (de == null ? void 0 : de.message) || "Failed to send message";
15076
15079
  Qe(we), m == null || m(we);
@@ -15078,20 +15081,20 @@ function Ti({
15078
15081
  }
15079
15082
  }, xo = B.useCallback(
15080
15083
  (Q, ue, de) => {
15081
- c && (Ye.current = _t, H(Q), se(ue), Ae(ue), Qe(null), Le({
15084
+ c && (Ye.current = _t, H(Q), se(ue), Ae(ue), Qe(null), Fe({
15082
15085
  checkpointId: (de == null ? void 0 : de.checkpointId) ?? null,
15083
15086
  checkpointNs: (de == null ? void 0 : de.checkpointNs) ?? null
15084
15087
  }));
15085
15088
  },
15086
15089
  [_t, c, Ae]
15087
15090
  ), R = B.useCallback(() => {
15088
- H(null), se(""), Le(null), Qe(null), Ae(Ye.current ?? _t), Ye.current = null;
15089
- }, [_t, Ae]), K = Se(
15091
+ H(null), se(""), Fe(null), Qe(null), Ae(Ye.current ?? _t), Ye.current = null;
15092
+ }, [_t, Ae]), K = Ce(
15090
15093
  (Q, ue, de) => {
15091
15094
  xo(Q, ue, de);
15092
15095
  },
15093
15096
  [xo]
15094
- ), ae = Se((Q) => {
15097
+ ), ae = Ce((Q) => {
15095
15098
  for (let ue = Q - 1; ue >= 0; ue--)
15096
15099
  if (w[ue].role === "user") {
15097
15100
  const de = w[ue].content || [], ct = de.filter((xt) => xt.type === "text").map((xt) => xt.text).join("") || (() => {
@@ -15110,13 +15113,13 @@ function Ti({
15110
15113
  );
15111
15114
  break;
15112
15115
  }
15113
- }, [w, A, _, J]), ke = (Q) => {
15116
+ }, [w, A, _, J]), Re = (Q) => {
15114
15117
  const ue = Array.from(Q.target.files || []);
15115
15118
  he((de) => [...de, ...ue]), Q.target.value = "";
15116
15119
  }, et = (Q) => {
15117
15120
  he((ue) => {
15118
15121
  const de = ue.filter((we, ct) => Q !== ct);
15119
- return de.length === 0 && Me(), de;
15122
+ return de.length === 0 && Oe(), de;
15120
15123
  });
15121
15124
  }, lt = async (Q) => {
15122
15125
  const ue = (Q.target.files || [])[0];
@@ -15136,12 +15139,12 @@ function Ti({
15136
15139
  const we = de instanceof Error ? de.message : "Failed to upload Excel file";
15137
15140
  console.error("Excel upload failed", de), rt(we), m == null || m(we);
15138
15141
  } finally {
15139
- Ue(!1), Q.target.value = "", Me();
15142
+ Ue(!1), Q.target.value = "", Oe();
15140
15143
  }
15141
15144
  }
15142
15145
  }, Ge = async (Q) => {
15143
15146
  if (y) {
15144
- Bt(!0);
15147
+ Ht(!0);
15145
15148
  try {
15146
15149
  if (!Q) {
15147
15150
  await S(), requestAnimationFrame(() => {
@@ -15156,16 +15159,16 @@ function Ti({
15156
15159
  (we = U.current) == null || we.scrollToTop();
15157
15160
  });
15158
15161
  } finally {
15159
- Bt(!1);
15162
+ Ht(!1);
15160
15163
  }
15161
15164
  }
15162
- }, We = Se(
15165
+ }, We = Ce(
15163
15166
  async (Q) => {
15164
15167
  await Ge(Q);
15165
15168
  },
15166
15169
  [Ge]
15167
15170
  ), 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
- return Se(
15171
+ return Ce(
15169
15172
  (Q) => {
15170
15173
  if (!Q)
15171
15174
  return "Latest";
@@ -15216,12 +15219,12 @@ function Ti({
15216
15219
  emptyMessage: at ?? void 0,
15217
15220
  isNavigatingCheckpoint: Nt,
15218
15221
  activeInterrupt: fe,
15219
- disableInterruptActions: Ce,
15222
+ disableInterruptActions: Te,
15220
15223
  onInterruptActionStart: q,
15221
15224
  onInterruptActionEnd: ne,
15222
15225
  showToolMessages: d,
15223
15226
  checkpointMetaById: ge,
15224
- checkpointIndexByKey: Ee,
15227
+ checkpointIndexByKey: Se,
15225
15228
  activeCheckpointId: _,
15226
15229
  onSelectCheckpoint: We,
15227
15230
  timelineCheckpoints: ie,
@@ -15266,13 +15269,13 @@ function Ti({
15266
15269
  /* @__PURE__ */ u.jsx(
15267
15270
  "input",
15268
15271
  {
15269
- ref: ze,
15272
+ ref: Le,
15270
15273
  type: "file",
15271
15274
  multiple: !0,
15272
- onChange: (Q) => ke(Q),
15275
+ onChange: (Q) => Re(Q),
15273
15276
  className: "hidden"
15274
15277
  },
15275
- Te
15278
+ ke
15276
15279
  ),
15277
15280
  oe.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap gap-2", children: oe.map((Q, ue) => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100", children: [
15278
15281
  /* @__PURE__ */ u.jsx(ki, { size: 14 }),
@@ -15294,7 +15297,7 @@ function Ti({
15294
15297
  /* @__PURE__ */ u.jsx(
15295
15298
  "input",
15296
15299
  {
15297
- ref: Fe,
15300
+ ref: Pe,
15298
15301
  type: "file",
15299
15302
  accept: ".xls,.xlsx,.xlsm",
15300
15303
  onChange: lt,
@@ -15302,12 +15305,12 @@ function Ti({
15302
15305
  },
15303
15306
  Ze
15304
15307
  ),
15305
- $e && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15308
+ ze && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15306
15309
  /* @__PURE__ */ u.jsx(Dr, { className: "h-4 w-4 animate-spin" }),
15307
15310
  " Uploading Excel file..."
15308
15311
  ] }),
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
- 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 })
15312
+ It && !ze && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: It }),
15313
+ qe && !ze && /* @__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
15314
  ] })
15312
15315
  ] }),
15313
15316
  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 }),
@@ -15328,7 +15331,7 @@ function Ti({
15328
15331
  /* @__PURE__ */ u.jsxs(df, { align: "start", sideOffset: 6, className: "w-52", children: [
15329
15332
  a && /* @__PURE__ */ u.jsxs(Hi, { onClick: () => {
15330
15333
  var Q;
15331
- return (Q = ze.current) == null ? void 0 : Q.click();
15334
+ return (Q = Le.current) == null ? void 0 : Q.click();
15332
15335
  }, className: "cursor-pointer", children: [
15333
15336
  /* @__PURE__ */ u.jsx(ki, { className: "h-4 w-4 mr-2" }),
15334
15337
  " Attach files or images"
@@ -15338,9 +15341,9 @@ function Ti({
15338
15341
  {
15339
15342
  onClick: () => {
15340
15343
  var Q;
15341
- $e || (Q = Fe.current) == null || Q.click();
15344
+ ze || (Q = Pe.current) == null || Q.click();
15342
15345
  },
15343
- className: `cursor-pointer ${$e ? "opacity-60 pointer-events-none" : ""}`,
15346
+ className: `cursor-pointer ${ze ? "opacity-60 pointer-events-none" : ""}`,
15344
15347
  children: [
15345
15348
  /* @__PURE__ */ u.jsx(dm, { className: "h-4 w-4 mr-2" }),
15346
15349
  " Upload Excel file"
@@ -15355,7 +15358,7 @@ function Ti({
15355
15358
  initialValue: W,
15356
15359
  editingMessageId: D,
15357
15360
  value: _t,
15358
- onValueChange: Jt,
15361
+ onValueChange: Mt,
15359
15362
  placeholder: D ? "Edit your message..." : t,
15360
15363
  isStreaming: $,
15361
15364
  disabled: Y,
@@ -16022,8 +16025,8 @@ function Fc({
16022
16025
  } catch {
16023
16026
  return "";
16024
16027
  }
16025
- }, Ce = (q) => q.title || `Thread ${q.threadId.slice(0, 8)}`, Ne = (q) => {
16026
- const ne = Ce(q);
16028
+ }, Te = (q) => q.title || `Thread ${q.threadId.slice(0, 8)}`, Ne = (q) => {
16029
+ const ne = Te(q);
16027
16030
  return ne.length <= $c ? ne : `${ne.slice(0, $c)}...`;
16028
16031
  };
16029
16032
  return /* @__PURE__ */ u.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
@@ -16633,7 +16636,7 @@ var cn = 10, [fh, Vn] = Ar(rr), dT = "SelectContentImpl", fT = vr("SelectContent
16633
16636
  (w.value !== void 0 && w.value === D || W) && (N(Y), W && (F.current = !0));
16634
16637
  },
16635
16638
  [w.value]
16636
- ), Ce = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Ne = v.useCallback(
16639
+ ), Te = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Ne = v.useCallback(
16637
16640
  (Y, D, H) => {
16638
16641
  const W = !F.current && !H;
16639
16642
  (w.value !== void 0 && w.value === D || W) && j(Y);
@@ -16660,7 +16663,7 @@ var cn = 10, [fh, Vn] = Ar(rr), dT = "SelectContentImpl", fT = vr("SelectContent
16660
16663
  onViewportChange: S,
16661
16664
  itemRefCallback: fe,
16662
16665
  selectedItem: E,
16663
- onItemLeave: Ce,
16666
+ onItemLeave: Te,
16664
16667
  itemTextRefCallback: Ne,
16665
16668
  focusSelectedItem: X,
16666
16669
  selectedItemText: M,
@@ -16735,7 +16738,7 @@ var pT = "SelectItemAlignedPosition", hh = v.forwardRef((e, t) => {
16735
16738
  if (s.trigger && s.valueNode && a && c && x && y && g) {
16736
16739
  const k = s.trigger.getBoundingClientRect(), E = c.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(), M = g.getBoundingClientRect();
16737
16740
  if (s.dir !== "rtl") {
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, [
16741
+ const se = M.left - E.left, re = N.left - se, Fe = k.left - re, Ke = k.width + Fe, Qe = Math.max(Ke, E.width), oe = window.innerWidth - cn, he = Yi(re, [
16739
16742
  cn,
16740
16743
  // Prevents the content from going off the starting edge of the
16741
16744
  // viewport. It may still go off the ending edge, but this can be
@@ -16746,31 +16749,31 @@ var pT = "SelectItemAlignedPosition", hh = v.forwardRef((e, t) => {
16746
16749
  ]);
16747
16750
  a.style.minWidth = Ke + "px", a.style.left = he + "px";
16748
16751
  } else {
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, [
16752
+ const se = E.right - M.right, re = window.innerWidth - N.right - se, Fe = window.innerWidth - k.right - re, Ke = k.width + Fe, Qe = Math.max(Ke, E.width), oe = window.innerWidth - cn, he = Yi(re, [
16750
16753
  cn,
16751
16754
  Math.max(cn, oe - Qe)
16752
16755
  ]);
16753
16756
  a.style.minWidth = Ke + "px", a.style.right = he + "px";
16754
16757
  }
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;
16758
+ 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), Te = 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
16759
  if (D <= Ne) {
16757
16760
  const se = j.length > 0 && y === j[j.length - 1].ref.current;
16758
16761
  a.style.bottom = "0px";
16759
- const re = c.clientHeight - x.offsetTop - x.offsetHeight, Le = Math.max(
16762
+ const re = c.clientHeight - x.offsetTop - x.offsetHeight, Fe = Math.max(
16760
16763
  q,
16761
16764
  ne + // viewport might have padding bottom, include it to avoid a scrollable viewport
16762
- (se ? Ce : 0) + re + X
16763
- ), Ke = D + Le;
16765
+ (se ? Te : 0) + re + X
16766
+ ), Ke = D + Fe;
16764
16767
  a.style.height = Ke + "px";
16765
16768
  } else {
16766
16769
  const se = j.length > 0 && y === j[0].ref.current;
16767
16770
  a.style.top = "0px";
16768
- const Le = Math.max(
16771
+ const Fe = Math.max(
16769
16772
  Ne,
16770
16773
  F + x.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
16771
16774
  (se ? fe : 0) + ne
16772
16775
  ) + H;
16773
- a.style.height = Le + "px", x.scrollTop = D - Ne + x.offsetTop;
16776
+ a.style.height = Fe + "px", x.scrollTop = D - Ne + x.offsetTop;
16774
16777
  }
16775
16778
  a.style.margin = `${cn}px 0`, a.style.minHeight = J + "px", a.style.maxHeight = P + "px", r == null || r(), requestAnimationFrame(() => h.current = !0);
16776
16779
  }