teodor-new-chat-ui 4.3.551 → 4.3.552

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
@@ -351,14 +351,14 @@ function Tx() {
351
351
  ke.unshift("Warning: " + ee), Function.prototype.apply.call(console[I], console, ke);
352
352
  }
353
353
  }
354
- var E = !1, T = !1, y = !1, C = !1, N = !1, j;
355
- j = Symbol.for("react.module.reference");
354
+ var E = !1, T = !1, y = !1, C = !1, N = !1, A;
355
+ A = Symbol.for("react.module.reference");
356
356
  function $(I) {
357
357
  return !!(typeof I == "string" || typeof I == "function" || I === r || I === s || N || I === o || I === c || I === d || C || I === p || E || T || y || typeof I == "object" && I !== null && (I.$$typeof === m || I.$$typeof === f || I.$$typeof === a || I.$$typeof === i || I.$$typeof === l || // This needs to include all possible module reference object
358
358
  // types supported by any Flight configuration anywhere since
359
359
  // we don't know which Flight build this will end up being used
360
360
  // with.
361
- I.$$typeof === j || I.getModuleId !== void 0));
361
+ I.$$typeof === A || I.getModuleId !== void 0));
362
362
  }
363
363
  function O(I, ee, Q) {
364
364
  var ue = I.displayName;
@@ -415,14 +415,14 @@ function Tx() {
415
415
  }
416
416
  return null;
417
417
  }
418
- var _ = Object.assign, U = 0, Y, z, A, k, K, J, M;
418
+ var _ = Object.assign, U = 0, Y, z, j, k, K, J, M;
419
419
  function q() {
420
420
  }
421
421
  q.__reactDisabledLog = !0;
422
422
  function D() {
423
423
  {
424
424
  if (U === 0) {
425
- Y = console.log, z = console.info, A = console.warn, k = console.error, K = console.group, J = console.groupCollapsed, M = console.groupEnd;
425
+ Y = console.log, z = console.info, j = console.warn, k = console.error, K = console.group, J = console.groupCollapsed, M = console.groupEnd;
426
426
  var I = {
427
427
  configurable: !0,
428
428
  enumerable: !0,
@@ -458,7 +458,7 @@ function Tx() {
458
458
  value: z
459
459
  }),
460
460
  warn: _({}, I, {
461
- value: A
461
+ value: j
462
462
  }),
463
463
  error: _({}, I, {
464
464
  value: k
@@ -802,7 +802,7 @@ Check the top-level render call using <` + Q + ">.");
802
802
  I && I._owner && I._owner !== Bt.current && (ue = " It was passed a child from " + G(I._owner.type) + "."), $e(I), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', Q, ue), $e(null);
803
803
  }
804
804
  }
805
- function at(I, ee) {
805
+ function st(I, ee) {
806
806
  {
807
807
  if (typeof I != "object")
808
808
  return;
@@ -821,7 +821,7 @@ Check the top-level render call using <` + Q + ">.");
821
821
  }
822
822
  }
823
823
  }
824
- function rt(I) {
824
+ function nt(I) {
825
825
  {
826
826
  var ee = I.type;
827
827
  if (ee == null || typeof ee == "string")
@@ -846,7 +846,7 @@ Check the top-level render call using <` + Q + ">.");
846
846
  typeof ee.getDefaultProps == "function" && !ee.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
847
847
  }
848
848
  }
849
- function it(I) {
849
+ function at(I) {
850
850
  {
851
851
  for (var ee = Object.keys(I.props), Q = 0; Q < ee.length; Q++) {
852
852
  var ue = ee[Q];
@@ -859,7 +859,7 @@ Check the top-level render call using <` + Q + ">.");
859
859
  }
860
860
  }
861
861
  var xt = {};
862
- function V(I, ee, Q, ue, we, ke) {
862
+ function W(I, ee, Q, ue, we, ke) {
863
863
  {
864
864
  var Ne = $(I);
865
865
  if (!Ne) {
@@ -879,12 +879,12 @@ Check the top-level render call using <` + Q + ">.");
879
879
  if (ue)
880
880
  if (ut(on)) {
881
881
  for (var xr = 0; xr < on.length; xr++)
882
- at(on[xr], I);
882
+ st(on[xr], I);
883
883
  Object.freeze && Object.freeze(on);
884
884
  } else
885
885
  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.");
886
886
  else
887
- at(on, I);
887
+ st(on, I);
888
888
  }
889
889
  if (qe.call(ee, "key")) {
890
890
  var Kn = G(I), Vt = Object.keys(ee).filter(function(Mg) {
@@ -900,17 +900,17 @@ React keys must be passed directly to JSX without using spread:
900
900
  <%s key={someKey} {...props} />`, wa, Kn, _g, Kn), xt[Kn + wa] = !0;
901
901
  }
902
902
  }
903
- return I === r ? it(It) : rt(It), It;
903
+ return I === r ? at(It) : nt(It), It;
904
904
  }
905
905
  }
906
906
  function re(I, ee, Q) {
907
- return V(I, ee, Q, !0);
907
+ return W(I, ee, Q, !0);
908
908
  }
909
909
  function ae(I, ee, Q) {
910
- return V(I, ee, Q, !1);
910
+ return W(I, ee, Q, !1);
911
911
  }
912
- var me = ae, tt = re;
913
- Yr.Fragment = r, Yr.jsx = me, Yr.jsxs = tt;
912
+ var me = ae, it = re;
913
+ Yr.Fragment = r, Yr.jsx = me, Yr.jsxs = it;
914
914
  }()), Yr;
915
915
  }
916
916
  process.env.NODE_ENV === "production" ? Ga.exports = Sx() : Ga.exports = Tx();
@@ -1167,7 +1167,7 @@ const ov = (e) => {
1167
1167
  }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
1168
1168
  typeof setImmediate == "function",
1169
1169
  Yt(Gn.postMessage)
1170
- ), iv = typeof queueMicrotask < "u" ? queueMicrotask.bind(Gn) : typeof process < "u" && process.nextTick || Ku, lv = (e) => e != null && Yt(e[Ms]), W = {
1170
+ ), iv = typeof queueMicrotask < "u" ? queueMicrotask.bind(Gn) : typeof process < "u" && process.nextTick || Ku, lv = (e) => e != null && Yt(e[Ms]), V = {
1171
1171
  isArray: $r,
1172
1172
  isArrayBuffer: zu,
1173
1173
  isBuffer: To,
@@ -1230,7 +1230,7 @@ const ov = (e) => {
1230
1230
  function je(e, t, n, r, o) {
1231
1231
  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);
1232
1232
  }
1233
- W.inherits(je, Error, {
1233
+ V.inherits(je, Error, {
1234
1234
  toJSON: function() {
1235
1235
  return {
1236
1236
  // Standard
@@ -1245,7 +1245,7 @@ W.inherits(je, Error, {
1245
1245
  columnNumber: this.columnNumber,
1246
1246
  stack: this.stack,
1247
1247
  // Axios
1248
- config: W.toJSONObject(this.config),
1248
+ config: V.toJSONObject(this.config),
1249
1249
  code: this.code,
1250
1250
  status: this.status
1251
1251
  };
@@ -1273,7 +1273,7 @@ Object.defineProperties(je, Gu);
1273
1273
  Object.defineProperty(qu, "isAxiosError", { value: !0 });
1274
1274
  je.from = (e, t, n, r, o, s) => {
1275
1275
  const a = Object.create(qu);
1276
- W.toFlatObject(e, a, function(d) {
1276
+ V.toFlatObject(e, a, function(d) {
1277
1277
  return d !== Error.prototype;
1278
1278
  }, (c) => c !== "isAxiosError");
1279
1279
  const i = e && e.message ? e.message : "Error", l = t == null && e ? e.code : t;
@@ -1281,10 +1281,10 @@ je.from = (e, t, n, r, o, s) => {
1281
1281
  };
1282
1282
  const cv = null;
1283
1283
  function Xa(e) {
1284
- return W.isPlainObject(e) || W.isArray(e);
1284
+ return V.isPlainObject(e) || V.isArray(e);
1285
1285
  }
1286
1286
  function Yu(e) {
1287
- return W.endsWith(e, "[]") ? e.slice(0, -2) : e;
1287
+ return V.endsWith(e, "[]") ? e.slice(0, -2) : e;
1288
1288
  }
1289
1289
  function tc(e, t, n) {
1290
1290
  return e ? e.concat(t).map(function(o, s) {
@@ -1292,42 +1292,42 @@ function tc(e, t, n) {
1292
1292
  }).join(n ? "." : "") : t;
1293
1293
  }
1294
1294
  function uv(e) {
1295
- return W.isArray(e) && !e.some(Xa);
1295
+ return V.isArray(e) && !e.some(Xa);
1296
1296
  }
1297
- const dv = W.toFlatObject(W, {}, null, function(t) {
1297
+ const dv = V.toFlatObject(V, {}, null, function(t) {
1298
1298
  return /^is[A-Z]/.test(t);
1299
1299
  });
1300
1300
  function Ls(e, t, n) {
1301
- if (!W.isObject(e))
1301
+ if (!V.isObject(e))
1302
1302
  throw new TypeError("target must be an object");
1303
- t = t || new FormData(), n = W.toFlatObject(n, {
1303
+ t = t || new FormData(), n = V.toFlatObject(n, {
1304
1304
  metaTokens: !0,
1305
1305
  dots: !1,
1306
1306
  indexes: !1
1307
1307
  }, !1, function(g, x) {
1308
- return !W.isUndefined(x[g]);
1308
+ return !V.isUndefined(x[g]);
1309
1309
  });
1310
- const r = n.metaTokens, o = n.visitor || d, s = n.dots, a = n.indexes, l = (n.Blob || typeof Blob < "u" && Blob) && W.isSpecCompliantForm(t);
1311
- if (!W.isFunction(o))
1310
+ const r = n.metaTokens, o = n.visitor || d, s = n.dots, a = n.indexes, l = (n.Blob || typeof Blob < "u" && Blob) && V.isSpecCompliantForm(t);
1311
+ if (!V.isFunction(o))
1312
1312
  throw new TypeError("visitor must be a function");
1313
1313
  function c(v) {
1314
1314
  if (v === null) return "";
1315
- if (W.isDate(v))
1315
+ if (V.isDate(v))
1316
1316
  return v.toISOString();
1317
- if (W.isBoolean(v))
1317
+ if (V.isBoolean(v))
1318
1318
  return v.toString();
1319
- if (!l && W.isBlob(v))
1319
+ if (!l && V.isBlob(v))
1320
1320
  throw new je("Blob is not supported. Use a Buffer instead.");
1321
- return W.isArrayBuffer(v) || W.isTypedArray(v) ? l && typeof Blob == "function" ? new Blob([v]) : Buffer.from(v) : v;
1321
+ return V.isArrayBuffer(v) || V.isTypedArray(v) ? l && typeof Blob == "function" ? new Blob([v]) : Buffer.from(v) : v;
1322
1322
  }
1323
1323
  function d(v, g, x) {
1324
1324
  let b = v;
1325
1325
  if (v && !x && typeof v == "object") {
1326
- if (W.endsWith(g, "{}"))
1326
+ if (V.endsWith(g, "{}"))
1327
1327
  g = r ? g : g.slice(0, -2), v = JSON.stringify(v);
1328
- else if (W.isArray(v) && uv(v) || (W.isFileList(v) || W.endsWith(g, "[]")) && (b = W.toArray(v)))
1328
+ else if (V.isArray(v) && uv(v) || (V.isFileList(v) || V.endsWith(g, "[]")) && (b = V.toArray(v)))
1329
1329
  return g = Yu(g), b.forEach(function(S, E) {
1330
- !(W.isUndefined(S) || S === null) && t.append(
1330
+ !(V.isUndefined(S) || S === null) && t.append(
1331
1331
  // eslint-disable-next-line no-nested-ternary
1332
1332
  a === !0 ? tc([g], E, s) : a === null ? g : g + "[]",
1333
1333
  c(S)
@@ -1342,21 +1342,21 @@ function Ls(e, t, n) {
1342
1342
  isVisitable: Xa
1343
1343
  });
1344
1344
  function p(v, g) {
1345
- if (!W.isUndefined(v)) {
1345
+ if (!V.isUndefined(v)) {
1346
1346
  if (f.indexOf(v) !== -1)
1347
1347
  throw Error("Circular reference detected in " + g.join("."));
1348
- f.push(v), W.forEach(v, function(b, w) {
1349
- (!(W.isUndefined(b) || b === null) && o.call(
1348
+ f.push(v), V.forEach(v, function(b, w) {
1349
+ (!(V.isUndefined(b) || b === null) && o.call(
1350
1350
  t,
1351
1351
  b,
1352
- W.isString(w) ? w.trim() : w,
1352
+ V.isString(w) ? w.trim() : w,
1353
1353
  g,
1354
1354
  m
1355
1355
  )) === !0 && p(b, g ? g.concat(w) : [w]);
1356
1356
  }), f.pop();
1357
1357
  }
1358
1358
  }
1359
- if (!W.isObject(e))
1359
+ if (!V.isObject(e))
1360
1360
  throw new TypeError("data must be an object");
1361
1361
  return p(e), t;
1362
1362
  }
@@ -1396,12 +1396,12 @@ function Ju(e, t, n) {
1396
1396
  if (!t)
1397
1397
  return e;
1398
1398
  const r = n && n.encode || fv;
1399
- W.isFunction(n) && (n = {
1399
+ V.isFunction(n) && (n = {
1400
1400
  serialize: n
1401
1401
  });
1402
1402
  const o = n && n.serialize;
1403
1403
  let s;
1404
- if (o ? s = o(t, n) : s = W.isURLSearchParams(t) ? t.toString() : new Oi(t, n).toString(r), s) {
1404
+ if (o ? s = o(t, n) : s = V.isURLSearchParams(t) ? t.toString() : new Oi(t, n).toString(r), s) {
1405
1405
  const a = e.indexOf("#");
1406
1406
  a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
1407
1407
  }
@@ -1456,7 +1456,7 @@ class rc {
1456
1456
  * @returns {void}
1457
1457
  */
1458
1458
  forEach(t) {
1459
- W.forEach(this.handlers, function(r) {
1459
+ V.forEach(this.handlers, function(r) {
1460
1460
  r !== null && t(r);
1461
1461
  });
1462
1462
  }
@@ -1488,13 +1488,13 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", wv
1488
1488
  function yv(e, t) {
1489
1489
  return Ls(e, new Lt.classes.URLSearchParams(), {
1490
1490
  visitor: function(n, r, o, s) {
1491
- return Lt.isNode && W.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1491
+ return Lt.isNode && V.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1492
1492
  },
1493
1493
  ...t
1494
1494
  });
1495
1495
  }
1496
1496
  function Sv(e) {
1497
- return W.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
1497
+ return V.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
1498
1498
  }
1499
1499
  function Tv(e) {
1500
1500
  const t = {}, n = Object.keys(e);
@@ -1510,20 +1510,20 @@ function Qu(e) {
1510
1510
  let a = n[s++];
1511
1511
  if (a === "__proto__") return !0;
1512
1512
  const i = Number.isFinite(+a), l = s >= n.length;
1513
- return a = !a && W.isArray(o) ? o.length : a, l ? (W.hasOwnProp(o, a) ? o[a] = [o[a], r] : o[a] = r, !i) : ((!o[a] || !W.isObject(o[a])) && (o[a] = []), t(n, r, o[a], s) && W.isArray(o[a]) && (o[a] = Tv(o[a])), !i);
1513
+ return a = !a && V.isArray(o) ? o.length : a, l ? (V.hasOwnProp(o, a) ? o[a] = [o[a], r] : o[a] = r, !i) : ((!o[a] || !V.isObject(o[a])) && (o[a] = []), t(n, r, o[a], s) && V.isArray(o[a]) && (o[a] = Tv(o[a])), !i);
1514
1514
  }
1515
- if (W.isFormData(e) && W.isFunction(e.entries)) {
1515
+ if (V.isFormData(e) && V.isFunction(e.entries)) {
1516
1516
  const n = {};
1517
- return W.forEachEntry(e, (r, o) => {
1517
+ return V.forEachEntry(e, (r, o) => {
1518
1518
  t(Sv(r), o, n, 0);
1519
1519
  }), n;
1520
1520
  }
1521
1521
  return null;
1522
1522
  }
1523
1523
  function Cv(e, t, n) {
1524
- if (W.isString(e))
1524
+ if (V.isString(e))
1525
1525
  try {
1526
- return (t || JSON.parse)(e), W.trim(e);
1526
+ return (t || JSON.parse)(e), V.trim(e);
1527
1527
  } catch (r) {
1528
1528
  if (r.name !== "SyntaxError")
1529
1529
  throw r;
@@ -1534,20 +1534,20 @@ const ko = {
1534
1534
  transitional: Zu,
1535
1535
  adapter: ["xhr", "http", "fetch"],
1536
1536
  transformRequest: [function(t, n) {
1537
- const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = W.isObject(t);
1538
- if (s && W.isHTMLForm(t) && (t = new FormData(t)), W.isFormData(t))
1537
+ const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = V.isObject(t);
1538
+ if (s && V.isHTMLForm(t) && (t = new FormData(t)), V.isFormData(t))
1539
1539
  return o ? JSON.stringify(Qu(t)) : t;
1540
- if (W.isArrayBuffer(t) || W.isBuffer(t) || W.isStream(t) || W.isFile(t) || W.isBlob(t) || W.isReadableStream(t))
1540
+ if (V.isArrayBuffer(t) || V.isBuffer(t) || V.isStream(t) || V.isFile(t) || V.isBlob(t) || V.isReadableStream(t))
1541
1541
  return t;
1542
- if (W.isArrayBufferView(t))
1542
+ if (V.isArrayBufferView(t))
1543
1543
  return t.buffer;
1544
- if (W.isURLSearchParams(t))
1544
+ if (V.isURLSearchParams(t))
1545
1545
  return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
1546
1546
  let i;
1547
1547
  if (s) {
1548
1548
  if (r.indexOf("application/x-www-form-urlencoded") > -1)
1549
1549
  return yv(t, this.formSerializer).toString();
1550
- if ((i = W.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
1550
+ if ((i = V.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
1551
1551
  const l = this.env && this.env.FormData;
1552
1552
  return Ls(
1553
1553
  i ? { "files[]": t } : t,
@@ -1560,9 +1560,9 @@ const ko = {
1560
1560
  }],
1561
1561
  transformResponse: [function(t) {
1562
1562
  const n = this.transitional || ko.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
1563
- if (W.isResponse(t) || W.isReadableStream(t))
1563
+ if (V.isResponse(t) || V.isReadableStream(t))
1564
1564
  return t;
1565
- if (t && W.isString(t) && (r && !this.responseType || o)) {
1565
+ if (t && V.isString(t) && (r && !this.responseType || o)) {
1566
1566
  const a = !(n && n.silentJSONParsing) && o;
1567
1567
  try {
1568
1568
  return JSON.parse(t, this.parseReviver);
@@ -1596,10 +1596,10 @@ const ko = {
1596
1596
  }
1597
1597
  }
1598
1598
  };
1599
- W.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
1599
+ V.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
1600
1600
  ko.headers[e] = {};
1601
1601
  });
1602
- const Ev = W.toObjectSet([
1602
+ const Ev = V.toObjectSet([
1603
1603
  "age",
1604
1604
  "authorization",
1605
1605
  "content-length",
@@ -1629,7 +1629,7 @@ function Xr(e) {
1629
1629
  return e && String(e).trim().toLowerCase();
1630
1630
  }
1631
1631
  function ns(e) {
1632
- return e === !1 || e == null ? e : W.isArray(e) ? e.map(ns) : String(e);
1632
+ return e === !1 || e == null ? e : V.isArray(e) ? e.map(ns) : String(e);
1633
1633
  }
1634
1634
  function Rv(e) {
1635
1635
  const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
@@ -1640,12 +1640,12 @@ function Rv(e) {
1640
1640
  }
1641
1641
  const Iv = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
1642
1642
  function Sa(e, t, n, r, o) {
1643
- if (W.isFunction(r))
1643
+ if (V.isFunction(r))
1644
1644
  return r.call(this, t, n);
1645
- if (o && (t = n), !!W.isString(t)) {
1646
- if (W.isString(r))
1645
+ if (o && (t = n), !!V.isString(t)) {
1646
+ if (V.isString(r))
1647
1647
  return t.indexOf(r) !== -1;
1648
- if (W.isRegExp(r))
1648
+ if (V.isRegExp(r))
1649
1649
  return r.test(t);
1650
1650
  }
1651
1651
  }
@@ -1653,7 +1653,7 @@ function Nv(e) {
1653
1653
  return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
1654
1654
  }
1655
1655
  function Av(e, t) {
1656
- const n = W.toCamelCase(" " + t);
1656
+ const n = V.toCamelCase(" " + t);
1657
1657
  ["get", "set", "has"].forEach((r) => {
1658
1658
  Object.defineProperty(e, r + n, {
1659
1659
  value: function(o, s, a) {
@@ -1673,20 +1673,20 @@ let Xt = class {
1673
1673
  const d = Xr(l);
1674
1674
  if (!d)
1675
1675
  throw new Error("header name must be a non-empty string");
1676
- const f = W.findKey(o, d);
1676
+ const f = V.findKey(o, d);
1677
1677
  (!f || o[f] === void 0 || c === !0 || c === void 0 && o[f] !== !1) && (o[f || l] = ns(i));
1678
1678
  }
1679
- const a = (i, l) => W.forEach(i, (c, d) => s(c, d, l));
1680
- if (W.isPlainObject(t) || t instanceof this.constructor)
1679
+ const a = (i, l) => V.forEach(i, (c, d) => s(c, d, l));
1680
+ if (V.isPlainObject(t) || t instanceof this.constructor)
1681
1681
  a(t, n);
1682
- else if (W.isString(t) && (t = t.trim()) && !Iv(t))
1682
+ else if (V.isString(t) && (t = t.trim()) && !Iv(t))
1683
1683
  a(kv(t), n);
1684
- else if (W.isObject(t) && W.isIterable(t)) {
1684
+ else if (V.isObject(t) && V.isIterable(t)) {
1685
1685
  let i = {}, l, c;
1686
1686
  for (const d of t) {
1687
- if (!W.isArray(d))
1687
+ if (!V.isArray(d))
1688
1688
  throw TypeError("Object iterator must return a key-value pair");
1689
- i[c = d[0]] = (l = i[c]) ? W.isArray(l) ? [...l, d[1]] : [l, d[1]] : d[1];
1689
+ i[c = d[0]] = (l = i[c]) ? V.isArray(l) ? [...l, d[1]] : [l, d[1]] : d[1];
1690
1690
  }
1691
1691
  a(i, n);
1692
1692
  } else
@@ -1695,16 +1695,16 @@ let Xt = class {
1695
1695
  }
1696
1696
  get(t, n) {
1697
1697
  if (t = Xr(t), t) {
1698
- const r = W.findKey(this, t);
1698
+ const r = V.findKey(this, t);
1699
1699
  if (r) {
1700
1700
  const o = this[r];
1701
1701
  if (!n)
1702
1702
  return o;
1703
1703
  if (n === !0)
1704
1704
  return Rv(o);
1705
- if (W.isFunction(n))
1705
+ if (V.isFunction(n))
1706
1706
  return n.call(this, o, r);
1707
- if (W.isRegExp(n))
1707
+ if (V.isRegExp(n))
1708
1708
  return n.exec(o);
1709
1709
  throw new TypeError("parser must be boolean|regexp|function");
1710
1710
  }
@@ -1712,7 +1712,7 @@ let Xt = class {
1712
1712
  }
1713
1713
  has(t, n) {
1714
1714
  if (t = Xr(t), t) {
1715
- const r = W.findKey(this, t);
1715
+ const r = V.findKey(this, t);
1716
1716
  return !!(r && this[r] !== void 0 && (!n || Sa(this, this[r], r, n)));
1717
1717
  }
1718
1718
  return !1;
@@ -1722,11 +1722,11 @@ let Xt = class {
1722
1722
  let o = !1;
1723
1723
  function s(a) {
1724
1724
  if (a = Xr(a), a) {
1725
- const i = W.findKey(r, a);
1725
+ const i = V.findKey(r, a);
1726
1726
  i && (!n || Sa(r, r[i], i, n)) && (delete r[i], o = !0);
1727
1727
  }
1728
1728
  }
1729
- return W.isArray(t) ? t.forEach(s) : s(t), o;
1729
+ return V.isArray(t) ? t.forEach(s) : s(t), o;
1730
1730
  }
1731
1731
  clear(t) {
1732
1732
  const n = Object.keys(this);
@@ -1739,8 +1739,8 @@ let Xt = class {
1739
1739
  }
1740
1740
  normalize(t) {
1741
1741
  const n = this, r = {};
1742
- return W.forEach(this, (o, s) => {
1743
- const a = W.findKey(r, s);
1742
+ return V.forEach(this, (o, s) => {
1743
+ const a = V.findKey(r, s);
1744
1744
  if (a) {
1745
1745
  n[a] = ns(o), delete n[s];
1746
1746
  return;
@@ -1754,8 +1754,8 @@ let Xt = class {
1754
1754
  }
1755
1755
  toJSON(t) {
1756
1756
  const n = /* @__PURE__ */ Object.create(null);
1757
- return W.forEach(this, (r, o) => {
1758
- r != null && r !== !1 && (n[o] = t && W.isArray(r) ? r.join(", ") : r);
1757
+ return V.forEach(this, (r, o) => {
1758
+ r != null && r !== !1 && (n[o] = t && V.isArray(r) ? r.join(", ") : r);
1759
1759
  }), n;
1760
1760
  }
1761
1761
  [Symbol.iterator]() {
@@ -1786,11 +1786,11 @@ let Xt = class {
1786
1786
  const i = Xr(a);
1787
1787
  r[i] || (Av(o, a), r[i] = !0);
1788
1788
  }
1789
- return W.isArray(t) ? t.forEach(s) : s(t), this;
1789
+ return V.isArray(t) ? t.forEach(s) : s(t), this;
1790
1790
  }
1791
1791
  };
1792
1792
  Xt.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1793
- W.reduceDescriptors(Xt.prototype, ({ value: e }, t) => {
1793
+ V.reduceDescriptors(Xt.prototype, ({ value: e }, t) => {
1794
1794
  let n = t[0].toUpperCase() + t.slice(1);
1795
1795
  return {
1796
1796
  get: () => e,
@@ -1799,11 +1799,11 @@ W.reduceDescriptors(Xt.prototype, ({ value: e }, t) => {
1799
1799
  }
1800
1800
  };
1801
1801
  });
1802
- W.freezeMethods(Xt);
1802
+ V.freezeMethods(Xt);
1803
1803
  function Ta(e, t) {
1804
1804
  const n = this || ko, r = t || n, o = Xt.from(r.headers);
1805
1805
  let s = r.data;
1806
- return W.forEach(e, function(i) {
1806
+ return V.forEach(e, function(i) {
1807
1807
  s = i.call(n, s, o.normalize(), t ? t.status : void 0);
1808
1808
  }), o.normalize(), s;
1809
1809
  }
@@ -1813,7 +1813,7 @@ function ed(e) {
1813
1813
  function Fr(e, t, n) {
1814
1814
  je.call(this, e ?? "canceled", je.ERR_CANCELED, t, n), this.name = "CanceledError";
1815
1815
  }
1816
- W.inherits(Fr, je, {
1816
+ V.inherits(Fr, je, {
1817
1817
  __CANCEL__: !0
1818
1818
  });
1819
1819
  function td(e, t, n) {
@@ -1884,7 +1884,7 @@ const hs = (e, t, n = 3) => {
1884
1884
  total: e,
1885
1885
  loaded: r
1886
1886
  }), t[1]];
1887
- }, ac = (e) => (...t) => W.asap(() => e(...t)), Mv = 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)))(
1887
+ }, ac = (e) => (...t) => V.asap(() => e(...t)), Mv = 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)))(
1888
1888
  new URL(Lt.origin),
1889
1889
  Lt.navigator && /(msie|trident)/i.test(Lt.navigator.userAgent)
1890
1890
  ) : () => !0, Ov = Lt.hasStandardBrowserEnv ? (
@@ -1892,7 +1892,7 @@ const hs = (e, t, n = 3) => {
1892
1892
  {
1893
1893
  write(e, t, n, r, o, s) {
1894
1894
  const a = [e + "=" + encodeURIComponent(t)];
1895
- W.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()), W.isString(r) && a.push("path=" + r), W.isString(o) && a.push("domain=" + o), s === !0 && a.push("secure"), document.cookie = a.join("; ");
1895
+ V.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()), V.isString(r) && a.push("path=" + r), V.isString(o) && a.push("domain=" + o), s === !0 && a.push("secure"), document.cookie = a.join("; ");
1896
1896
  },
1897
1897
  read(e) {
1898
1898
  const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
@@ -1929,21 +1929,21 @@ function rr(e, t) {
1929
1929
  t = t || {};
1930
1930
  const n = {};
1931
1931
  function r(c, d, f, m) {
1932
- return W.isPlainObject(c) && W.isPlainObject(d) ? W.merge.call({ caseless: m }, c, d) : W.isPlainObject(d) ? W.merge({}, d) : W.isArray(d) ? d.slice() : d;
1932
+ return V.isPlainObject(c) && V.isPlainObject(d) ? V.merge.call({ caseless: m }, c, d) : V.isPlainObject(d) ? V.merge({}, d) : V.isArray(d) ? d.slice() : d;
1933
1933
  }
1934
1934
  function o(c, d, f, m) {
1935
- if (W.isUndefined(d)) {
1936
- if (!W.isUndefined(c))
1935
+ if (V.isUndefined(d)) {
1936
+ if (!V.isUndefined(c))
1937
1937
  return r(void 0, c, f, m);
1938
1938
  } else return r(c, d, f, m);
1939
1939
  }
1940
1940
  function s(c, d) {
1941
- if (!W.isUndefined(d))
1941
+ if (!V.isUndefined(d))
1942
1942
  return r(void 0, d);
1943
1943
  }
1944
1944
  function a(c, d) {
1945
- if (W.isUndefined(d)) {
1946
- if (!W.isUndefined(c))
1945
+ if (V.isUndefined(d)) {
1946
+ if (!V.isUndefined(c))
1947
1947
  return r(void 0, c);
1948
1948
  } else return r(void 0, d);
1949
1949
  }
@@ -1984,9 +1984,9 @@ function rr(e, t) {
1984
1984
  validateStatus: i,
1985
1985
  headers: (c, d, f) => o(ic(c), ic(d), f, !0)
1986
1986
  };
1987
- return W.forEach(Object.keys({ ...e, ...t }), function(d) {
1987
+ return V.forEach(Object.keys({ ...e, ...t }), function(d) {
1988
1988
  const f = l[d] || o, m = f(e[d], t[d], d);
1989
- W.isUndefined(m) && f !== i || (n[d] = m);
1989
+ V.isUndefined(m) && f !== i || (n[d] = m);
1990
1990
  }), n;
1991
1991
  }
1992
1992
  const rd = (e) => {
@@ -1995,17 +1995,17 @@ const rd = (e) => {
1995
1995
  if (t.headers = a = Xt.from(a), t.url = Ju(nd(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), i && a.set(
1996
1996
  "Authorization",
1997
1997
  "Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
1998
- ), W.isFormData(n)) {
1998
+ ), V.isFormData(n)) {
1999
1999
  if (Lt.hasStandardBrowserEnv || Lt.hasStandardBrowserWebWorkerEnv)
2000
2000
  a.setContentType(void 0);
2001
- else if (W.isFunction(n.getHeaders)) {
2001
+ else if (V.isFunction(n.getHeaders)) {
2002
2002
  const l = n.getHeaders(), c = ["content-type", "content-length"];
2003
2003
  Object.entries(l).forEach(([d, f]) => {
2004
2004
  c.includes(d.toLowerCase()) && a.set(d, f);
2005
2005
  });
2006
2006
  }
2007
2007
  }
2008
- if (Lt.hasStandardBrowserEnv && (r && W.isFunction(r) && (r = r(t)), r || r !== !1 && Mv(t.url))) {
2008
+ if (Lt.hasStandardBrowserEnv && (r && V.isFunction(r) && (r = r(t)), r || r !== !1 && Mv(t.url))) {
2009
2009
  const l = o && s && Ov.read(s);
2010
2010
  l && a.set(o, l);
2011
2011
  }
@@ -2056,9 +2056,9 @@ const rd = (e) => {
2056
2056
  e,
2057
2057
  x
2058
2058
  )), x = null;
2059
- }, s === void 0 && a.setContentType(null), "setRequestHeader" in x && W.forEach(a.toJSON(), function(E, T) {
2059
+ }, s === void 0 && a.setContentType(null), "setRequestHeader" in x && V.forEach(a.toJSON(), function(E, T) {
2060
2060
  x.setRequestHeader(T, E);
2061
- }), W.isUndefined(o.withCredentials) || (x.withCredentials = !!o.withCredentials), i && i !== "json" && (x.responseType = o.responseType), c && ([m, v] = hs(c, !0), x.addEventListener("progress", m)), l && x.upload && ([f, p] = hs(l), x.upload.addEventListener("progress", f), x.upload.addEventListener("loadend", p)), (o.cancelToken || o.signal) && (d = (S) => {
2061
+ }), V.isUndefined(o.withCredentials) || (x.withCredentials = !!o.withCredentials), i && i !== "json" && (x.responseType = o.responseType), c && ([m, v] = hs(c, !0), x.addEventListener("progress", m)), l && x.upload && ([f, p] = hs(l), x.upload.addEventListener("progress", f), x.upload.addEventListener("loadend", p)), (o.cancelToken || o.signal) && (d = (S) => {
2062
2062
  x && (r(!S || S.type ? new Fr(null, e, x) : S), x.abort(), x = null);
2063
2063
  }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
2064
2064
  const w = jv(o.url);
@@ -2089,7 +2089,7 @@ const rd = (e) => {
2089
2089
  };
2090
2090
  e.forEach((c) => c.addEventListener("abort", s));
2091
2091
  const { signal: l } = r;
2092
- return l.unsubscribe = () => W.asap(i), l;
2092
+ return l.unsubscribe = () => V.asap(i), l;
2093
2093
  }
2094
2094
  }, zv = function* (e, t) {
2095
2095
  let n = e.byteLength;
@@ -2148,20 +2148,20 @@ const rd = (e) => {
2148
2148
  }, {
2149
2149
  highWaterMark: 2
2150
2150
  });
2151
- }, cc = 64 * 1024, { isFunction: Ho } = W, Wv = (({ Request: e, Response: t }) => ({
2151
+ }, cc = 64 * 1024, { isFunction: Ho } = V, Wv = (({ Request: e, Response: t }) => ({
2152
2152
  Request: e,
2153
2153
  Response: t
2154
- }))(W.global), {
2154
+ }))(V.global), {
2155
2155
  ReadableStream: uc,
2156
2156
  TextEncoder: dc
2157
- } = W.global, fc = (e, ...t) => {
2157
+ } = V.global, fc = (e, ...t) => {
2158
2158
  try {
2159
2159
  return !!e(...t);
2160
2160
  } catch {
2161
2161
  return !1;
2162
2162
  }
2163
2163
  }, Vv = (e) => {
2164
- e = W.merge.call({
2164
+ e = V.merge.call({
2165
2165
  skipUndefined: !0
2166
2166
  }, Wv, e);
2167
2167
  const { fetch: t, Request: n, Response: r } = e, o = t ? Ho(t) : typeof fetch == "function", s = Ho(n), a = Ho(r);
@@ -2177,7 +2177,7 @@ const rd = (e) => {
2177
2177
  }
2178
2178
  }).headers.has("Content-Type");
2179
2179
  return v && !g;
2180
- }), d = a && i && fc(() => W.isReadableStream(new r("").body)), f = {
2180
+ }), d = a && i && fc(() => V.isReadableStream(new r("").body)), f = {
2181
2181
  stream: d && ((v) => v.body)
2182
2182
  };
2183
2183
  o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((v) => {
@@ -2191,19 +2191,19 @@ const rd = (e) => {
2191
2191
  const m = async (v) => {
2192
2192
  if (v == null)
2193
2193
  return 0;
2194
- if (W.isBlob(v))
2194
+ if (V.isBlob(v))
2195
2195
  return v.size;
2196
- if (W.isSpecCompliantForm(v))
2196
+ if (V.isSpecCompliantForm(v))
2197
2197
  return (await new n(Lt.origin, {
2198
2198
  method: "POST",
2199
2199
  body: v
2200
2200
  }).arrayBuffer()).byteLength;
2201
- if (W.isArrayBufferView(v) || W.isArrayBuffer(v))
2201
+ if (V.isArrayBufferView(v) || V.isArrayBuffer(v))
2202
2202
  return v.byteLength;
2203
- if (W.isURLSearchParams(v) && (v = v + ""), W.isString(v))
2203
+ if (V.isURLSearchParams(v) && (v = v + ""), V.isString(v))
2204
2204
  return (await l(v)).byteLength;
2205
2205
  }, p = async (v, g) => {
2206
- const x = W.toFiniteNumber(v.getContentLength());
2206
+ const x = V.toFiniteNumber(v.getContentLength());
2207
2207
  return x ?? m(g);
2208
2208
  };
2209
2209
  return async (v) => {
@@ -2218,7 +2218,7 @@ const rd = (e) => {
2218
2218
  onUploadProgress: y,
2219
2219
  responseType: C,
2220
2220
  headers: N,
2221
- withCredentials: j = "same-origin",
2221
+ withCredentials: A = "same-origin",
2222
2222
  fetchOptions: $
2223
2223
  } = rd(v), O = t || fetch;
2224
2224
  C = C ? (C + "").toLowerCase() : "text";
@@ -2234,7 +2234,7 @@ const rd = (e) => {
2234
2234
  body: b,
2235
2235
  duplex: "half"
2236
2236
  }), M;
2237
- if (W.isFormData(b) && (M = J.headers.get("content-type")) && N.setContentType(M), J.body) {
2237
+ if (V.isFormData(b) && (M = J.headers.get("content-type")) && N.setContentType(M), J.body) {
2238
2238
  const [q, D] = sc(
2239
2239
  U,
2240
2240
  hs(ac(y))
@@ -2242,7 +2242,7 @@ const rd = (e) => {
2242
2242
  b = lc(J.body, cc, q, D);
2243
2243
  }
2244
2244
  }
2245
- W.isString(j) || (j = j ? "include" : "omit");
2245
+ V.isString(A) || (A = A ? "include" : "omit");
2246
2246
  const Y = s && "credentials" in n.prototype, z = {
2247
2247
  ...$,
2248
2248
  signal: B,
@@ -2250,35 +2250,35 @@ const rd = (e) => {
2250
2250
  headers: N.normalize().toJSON(),
2251
2251
  body: b,
2252
2252
  duplex: "half",
2253
- credentials: Y ? j : void 0
2253
+ credentials: Y ? A : void 0
2254
2254
  };
2255
2255
  G = s && new n(g, z);
2256
- let A = await (s ? O(G, $) : O(g, z));
2256
+ let j = await (s ? O(G, $) : O(g, z));
2257
2257
  const k = d && (C === "stream" || C === "response");
2258
2258
  if (d && (T || k && _)) {
2259
2259
  const J = {};
2260
2260
  ["status", "statusText", "headers"].forEach((L) => {
2261
- J[L] = A[L];
2261
+ J[L] = j[L];
2262
2262
  });
2263
- const M = W.toFiniteNumber(A.headers.get("content-length")), [q, D] = T && sc(
2263
+ const M = V.toFiniteNumber(j.headers.get("content-length")), [q, D] = T && sc(
2264
2264
  M,
2265
2265
  hs(ac(T), !0)
2266
2266
  ) || [];
2267
- A = new r(
2268
- lc(A.body, cc, q, () => {
2267
+ j = new r(
2268
+ lc(j.body, cc, q, () => {
2269
2269
  D && D(), _ && _();
2270
2270
  }),
2271
2271
  J
2272
2272
  );
2273
2273
  }
2274
2274
  C = C || "text";
2275
- let K = await f[W.findKey(f, C) || "text"](A, v);
2275
+ let K = await f[V.findKey(f, C) || "text"](j, v);
2276
2276
  return !k && _ && _(), await new Promise((J, M) => {
2277
2277
  td(J, M, {
2278
2278
  data: K,
2279
- headers: Xt.from(A.headers),
2280
- status: A.status,
2281
- statusText: A.statusText,
2279
+ headers: Xt.from(j.headers),
2280
+ status: j.status,
2281
+ statusText: j.statusText,
2282
2282
  config: v,
2283
2283
  request: G
2284
2284
  });
@@ -2312,7 +2312,7 @@ const Za = {
2312
2312
  get: od
2313
2313
  }
2314
2314
  };
2315
- W.forEach(Za, (e, t) => {
2315
+ V.forEach(Za, (e, t) => {
2316
2316
  if (e) {
2317
2317
  try {
2318
2318
  Object.defineProperty(e, "name", { value: t });
@@ -2321,9 +2321,9 @@ W.forEach(Za, (e, t) => {
2321
2321
  Object.defineProperty(e, "adapterName", { value: t });
2322
2322
  }
2323
2323
  });
2324
- const pc = (e) => `- ${e}`, qv = (e) => W.isFunction(e) || e === null || e === !1, sd = {
2324
+ const pc = (e) => `- ${e}`, qv = (e) => V.isFunction(e) || e === null || e === !1, sd = {
2325
2325
  getAdapter: (e, t) => {
2326
- e = W.isArray(e) ? e : [e];
2326
+ e = V.isArray(e) ? e : [e];
2327
2327
  const { length: n } = e;
2328
2328
  let r, o;
2329
2329
  const s = {};
@@ -2332,7 +2332,7 @@ const pc = (e) => `- ${e}`, qv = (e) => W.isFunction(e) || e === null || e === !
2332
2332
  let i;
2333
2333
  if (o = r, !qv(r) && (o = Za[(i = String(r)).toLowerCase()], o === void 0))
2334
2334
  throw new je(`Unknown adapter '${i}'`);
2335
- if (o && (W.isFunction(o) || (o = o.get(t))))
2335
+ if (o && (V.isFunction(o) || (o = o.get(t))))
2336
2336
  break;
2337
2337
  s[i || "#" + a] = o;
2338
2338
  }
@@ -2462,7 +2462,7 @@ let Zn = class {
2462
2462
  silentJSONParsing: wn.transitional(wn.boolean),
2463
2463
  forcedJSONParsing: wn.transitional(wn.boolean),
2464
2464
  clarifyTimeoutError: wn.transitional(wn.boolean)
2465
- }, !1), o != null && (W.isFunction(o) ? n.paramsSerializer = {
2465
+ }, !1), o != null && (V.isFunction(o) ? n.paramsSerializer = {
2466
2466
  serialize: o
2467
2467
  } : rs.assertOptions(o, {
2468
2468
  encode: wn.function,
@@ -2471,11 +2471,11 @@ let Zn = class {
2471
2471
  baseUrl: wn.spelling("baseURL"),
2472
2472
  withXsrfToken: wn.spelling("withXSRFToken")
2473
2473
  }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
2474
- let a = s && W.merge(
2474
+ let a = s && V.merge(
2475
2475
  s.common,
2476
2476
  s[n.method]
2477
2477
  );
2478
- s && W.forEach(
2478
+ s && V.forEach(
2479
2479
  ["delete", "get", "head", "post", "put", "patch", "common"],
2480
2480
  (v) => {
2481
2481
  delete s[v];
@@ -2523,7 +2523,7 @@ let Zn = class {
2523
2523
  return Ju(n, t.params, t.paramsSerializer);
2524
2524
  }
2525
2525
  };
2526
- W.forEach(["delete", "get", "head", "options"], function(t) {
2526
+ V.forEach(["delete", "get", "head", "options"], function(t) {
2527
2527
  Zn.prototype[t] = function(n, r) {
2528
2528
  return this.request(rr(r || {}, {
2529
2529
  method: t,
@@ -2532,7 +2532,7 @@ W.forEach(["delete", "get", "head", "options"], function(t) {
2532
2532
  }));
2533
2533
  };
2534
2534
  });
2535
- W.forEach(["post", "put", "patch"], function(t) {
2535
+ V.forEach(["post", "put", "patch"], function(t) {
2536
2536
  function n(r) {
2537
2537
  return function(s, a, i) {
2538
2538
  return this.request(rr(i || {}, {
@@ -2626,7 +2626,7 @@ function Xv(e) {
2626
2626
  };
2627
2627
  }
2628
2628
  function Jv(e) {
2629
- return W.isObject(e) && e.isAxiosError === !0;
2629
+ return V.isObject(e) && e.isAxiosError === !0;
2630
2630
  }
2631
2631
  const Qa = {
2632
2632
  Continue: 100,
@@ -2698,7 +2698,7 @@ Object.entries(Qa).forEach(([e, t]) => {
2698
2698
  });
2699
2699
  function ld(e) {
2700
2700
  const t = new Zn(e), n = Fu(Zn.prototype.request, t);
2701
- return W.extend(n, Zn.prototype, t, { allOwnKeys: !0 }), W.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
2701
+ return V.extend(n, Zn.prototype, t, { allOwnKeys: !0 }), V.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
2702
2702
  return ld(rr(e, o));
2703
2703
  }, n;
2704
2704
  }
@@ -2718,7 +2718,7 @@ St.spread = Xv;
2718
2718
  St.isAxiosError = Jv;
2719
2719
  St.mergeConfig = rr;
2720
2720
  St.AxiosHeaders = Xt;
2721
- St.formToJSON = (e) => Qu(W.isHTMLForm(e) ? new FormData(e) : e);
2721
+ St.formToJSON = (e) => Qu(V.isHTMLForm(e) ? new FormData(e) : e);
2722
2722
  St.getAdapter = sd.getAdapter;
2723
2723
  St.HttpStatusCode = Qa;
2724
2724
  St.default = St;
@@ -3120,14 +3120,14 @@ function hd(e) {
3120
3120
  return t[t.length - 1] || null;
3121
3121
  }
3122
3122
  function hw(e = {}) {
3123
- const t = e.baseUrl || "", n = e.streamPath ?? "/runs/stream", [r, o] = pe(e.token ?? null), s = Ae(e.headers ?? {}), a = e.credentials ?? "include", [i, l] = pe(!1), [c, d] = pe(null), [f, m] = pe(""), [p, v] = pe(null), [g, x] = pe(0), [b, w] = pe(!1), [S, E] = pe(null), T = Ae(null), y = Ae(!0), C = Ae(0), N = Ae(null), j = Ae(null), $ = Ae(null), O = Ae(null), B = Ae({
3123
+ const t = e.baseUrl || "", n = e.streamPath ?? "/runs/stream", [r, o] = pe(e.token ?? null), s = Ae(e.headers ?? {}), a = e.credentials ?? "include", [i, l] = pe(!1), [c, d] = pe(null), [f, m] = pe(""), [p, v] = pe(null), [g, x] = pe(0), [b, w] = pe(!1), [S, E] = pe(null), T = Ae(null), y = Ae(!0), C = Ae(0), N = Ae(null), A = Ae(null), $ = Ae(null), O = Ae(null), B = Ae({
3124
3124
  messageId: null,
3125
3125
  lastSeq: null,
3126
3126
  lastText: ""
3127
3127
  }), G = ce((z) => {
3128
3128
  o(z);
3129
3129
  }, []), _ = ce(() => {
3130
- m(""), v(null), d(null), j.current = null, $.current = null, O.current = null, E(null), B.current = {
3130
+ m(""), v(null), d(null), A.current = null, $.current = null, O.current = null, E(null), B.current = {
3131
3131
  messageId: null,
3132
3132
  lastSeq: null,
3133
3133
  lastText: ""
@@ -3135,16 +3135,16 @@ function hw(e = {}) {
3135
3135
  }, []), U = ce(() => {
3136
3136
  var K;
3137
3137
  console.debug("[use-chat] stop() invoked - aborting stream");
3138
- const z = (K = N.current) == null ? void 0 : K.threadId, A = () => {
3138
+ const z = (K = N.current) == null ? void 0 : K.threadId, j = () => {
3139
3139
  var J;
3140
3140
  (J = T.current) == null || J.abort(), T.current = null, N.current = null, l(!1), w(!1), C.current = 0, x(0);
3141
3141
  };
3142
3142
  (z ? or.cancelRun(z).catch((J) => {
3143
3143
  console.warn("[use-chat] cancel run failed:", J);
3144
- }) : Promise.resolve()).finally(A);
3144
+ }) : Promise.resolve()).finally(j);
3145
3145
  }, []), Y = ce(
3146
- (z, A, k) => {
3147
- T.current && (T.current.abort(), T.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && m(""), v(null), j.current = null, $.current = null, O.current = null, E(null), B.current = {
3146
+ (z, j, k) => {
3147
+ T.current && (T.current.abort(), T.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && m(""), v(null), A.current = null, $.current = null, O.current = null, E(null), B.current = {
3148
3148
  messageId: null,
3149
3149
  lastSeq: null,
3150
3150
  lastText: ""
@@ -3261,103 +3261,103 @@ function hw(e = {}) {
3261
3261
  `)) >= 0; ) {
3262
3262
  const De = Qe.slice(0, ge);
3263
3263
  Qe = Qe.slice(ge + 2);
3264
- const Fe = De.split(/\r?\n/), at = [];
3264
+ const Fe = De.split(/\r?\n/), st = [];
3265
3265
  for (const ae of Fe)
3266
3266
  if (!(!ae || ae.startsWith(":")) && ae.startsWith("data:")) {
3267
3267
  const me = ae.slice(5);
3268
- at.push(me.startsWith(" ") ? me.slice(1) : me);
3268
+ st.push(me.startsWith(" ") ? me.slice(1) : me);
3269
3269
  }
3270
- const rt = at.join(`
3270
+ const nt = st.join(`
3271
3271
  `);
3272
- if (!rt) continue;
3273
- let it;
3272
+ if (!nt) continue;
3273
+ let at;
3274
3274
  try {
3275
- it = JSON.parse(rt);
3275
+ at = JSON.parse(nt);
3276
3276
  } catch {
3277
- console.debug("[use-chat] malformed SSE:", rt.slice(0, 200));
3277
+ console.debug("[use-chat] malformed SSE:", nt.slice(0, 200));
3278
3278
  continue;
3279
3279
  }
3280
- const xt = cw(it) ? it.data : it;
3280
+ const xt = cw(at) ? at.data : at;
3281
3281
  if (!xt) {
3282
- console.warn("[use-chat] dropped envelope event without payload", it);
3282
+ console.warn("[use-chat] dropped envelope event without payload", at);
3283
3283
  continue;
3284
3284
  }
3285
- const V = xt;
3285
+ const W = xt;
3286
3286
  mt = Date.now();
3287
- const re = V.seq;
3287
+ const re = W.seq;
3288
3288
  if (re !== void 0) {
3289
3289
  if (re <= ht) {
3290
- console.debug("[use-chat] drop duplicate/out-of-order event", { seq: re, lastProcessedSeq: ht, type: V.type });
3290
+ console.debug("[use-chat] drop duplicate/out-of-order event", { seq: re, lastProcessedSeq: ht, type: W.type });
3291
3291
  continue;
3292
3292
  }
3293
3293
  ht > 0 && re > ht + 1 && ((oe = k == null ? void 0 : k.onGap) == null || oe.call(k, { from: ht, to: re })), ht = re, C.current = re, x(re);
3294
3294
  }
3295
- if (V.type === "message.start" && V.role === "assistant") {
3296
- const ae = hd(V.model);
3295
+ if (W.type === "message.start" && W.role === "assistant") {
3296
+ const ae = hd(W.model);
3297
3297
  B.current = {
3298
- messageId: V.id,
3298
+ messageId: W.id,
3299
3299
  lastSeq: re ?? null,
3300
3300
  lastText: ""
3301
3301
  }, E({
3302
- id: V.id,
3302
+ id: W.id,
3303
3303
  role: "assistant",
3304
3304
  name: ae ?? void 0,
3305
- model: V.model,
3305
+ model: W.model,
3306
3306
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
3307
3307
  content: []
3308
3308
  });
3309
3309
  }
3310
- if (V.type === "checkpoint")
3311
- j.current = V.checkpointId ?? null, $.current = V.checkpointNs ?? null, v(V.checkpointId ?? null);
3312
- else if (V.type === "state_history") {
3313
- O.current = V;
3310
+ if (W.type === "checkpoint")
3311
+ A.current = W.checkpointId ?? null, $.current = W.checkpointNs ?? null, v(W.checkpointId ?? null);
3312
+ else if (W.type === "state_history") {
3313
+ O.current = W;
3314
3314
  try {
3315
- const me = Tr(V).latest;
3316
- me && (j.current = me.checkpointId ?? null, $.current = me.checkpointNs ?? null, v(me.checkpointId ?? null));
3315
+ const me = Tr(W).latest;
3316
+ me && (A.current = me.checkpointId ?? null, $.current = me.checkpointNs ?? null, v(me.checkpointId ?? null));
3317
3317
  } catch (ae) {
3318
3318
  console.warn("[use-chat] Failed to hydrate state_history payload", ae);
3319
3319
  }
3320
3320
  }
3321
3321
  try {
3322
- A == null || A(V);
3322
+ j == null || j(W);
3323
3323
  } catch (ae) {
3324
- console.error("[use-chat] Error in onEvent callback:", ae, "for event:", V.type);
3324
+ console.error("[use-chat] Error in onEvent callback:", ae, "for event:", W.type);
3325
3325
  }
3326
- if (V.type === "message.delta") {
3326
+ if (W.type === "message.delta") {
3327
3327
  E((me) => {
3328
- const tt = B.current;
3329
- if (!me || tt.messageId !== me.id) return me;
3328
+ const it = B.current;
3329
+ if (!me || it.messageId !== me.id) return me;
3330
3330
  const { newParts: I, newMeta: ee, changed: Q } = pd(
3331
3331
  me.content ?? [],
3332
- V.delta,
3333
- { lastSeq: tt.lastSeq, lastText: tt.lastText },
3332
+ W.delta,
3333
+ { lastSeq: it.lastSeq, lastText: it.lastText },
3334
3334
  re ?? null
3335
3335
  );
3336
3336
  return Q ? (B.current = {
3337
- ...tt,
3338
- lastSeq: ee.lastSeq ?? tt.lastSeq,
3339
- lastText: ee.lastText ?? tt.lastText
3337
+ ...it,
3338
+ lastSeq: ee.lastSeq ?? it.lastSeq,
3339
+ lastText: ee.lastText ?? it.lastText
3340
3340
  }, { ...me, content: I }) : me;
3341
3341
  });
3342
- const ae = V.delta.filter((me) => me.type === "text").map((me) => me.text).join("");
3342
+ const ae = W.delta.filter((me) => me.type === "text").map((me) => me.text).join("");
3343
3343
  ae && e.autoAppendAssistant !== !1 && (kt.push(ae), _t());
3344
- } else if (V.type === "heartbeat") {
3344
+ } else if (W.type === "heartbeat") {
3345
3345
  console.debug("[use-chat] heartbeat received");
3346
3346
  try {
3347
- (le = k == null ? void 0 : k.onHeartbeat) == null || le.call(k, V);
3347
+ (le = k == null ? void 0 : k.onHeartbeat) == null || le.call(k, W);
3348
3348
  } catch (ae) {
3349
3349
  console.warn("[use-chat] heartbeat callback failed", ae);
3350
3350
  }
3351
- } else if (vt !== null && cancelAnimationFrame(vt), At(), V.type === "checkpoint")
3352
- v(V.checkpointId);
3353
- else if (V.type === "error") {
3354
- const ae = V;
3351
+ } else if (vt !== null && cancelAnimationFrame(vt), At(), W.type === "checkpoint")
3352
+ v(W.checkpointId);
3353
+ else if (W.type === "error") {
3354
+ const ae = W;
3355
3355
  if (d(ae.message), J = "error", M = ae.message, ae.error_type === "auth_error" || ae.code === "TOKEN_EXPIRED" || ((Ee = ae.message) == null ? void 0 : Ee.includes("token")) || ((ye = ae.message) == null ? void 0 : ye.includes("401")) || ((Pe = ae.message) == null ? void 0 : Pe.includes("unauthorized")) || ((qe = ae.message) == null ? void 0 : qe.includes("Unauthorized"))) {
3356
3356
  console.error("[use-chat] Auth error detected:", ae.message);
3357
3357
  try {
3358
3358
  (ze = k == null ? void 0 : k.onAuthError) == null || ze.call(k, ae.message);
3359
- } catch (tt) {
3360
- console.warn("[use-chat] onAuthError handler failed", tt);
3359
+ } catch (it) {
3360
+ console.warn("[use-chat] onAuthError handler failed", it);
3361
3361
  }
3362
3362
  K.abort();
3363
3363
  }
@@ -3389,7 +3389,7 @@ function hw(e = {}) {
3389
3389
  J = "error", M = _e, d(_e), (Tt = k == null ? void 0 : k.onError) == null || Tt.call(k, _e), q || ((Ct = k == null ? void 0 : k.onConnectionError) == null || Ct.call(k, _e), q = !0);
3390
3390
  }
3391
3391
  } finally {
3392
- const Ve = C.current, _e = j.current, Ge = $.current, Ie = O.current, Ye = J ?? (K.signal.aborted ? "aborted" : M ? "error" : "complete");
3392
+ const Ve = C.current, _e = A.current, Ge = $.current, Ie = O.current, Ye = J ?? (K.signal.aborted ? "aborted" : M ? "error" : "complete");
3393
3393
  try {
3394
3394
  (ut = k == null ? void 0 : k.onClosed) == null || ut.call(k, {
3395
3395
  reason: Ye,
@@ -3484,21 +3484,21 @@ function xw({
3484
3484
  const N = ce(async () => {
3485
3485
  d(!0), m(null);
3486
3486
  try {
3487
- const A = await e.listThreads();
3488
- a(A ?? []);
3489
- } catch (A) {
3490
- const k = String(A);
3487
+ const j = await e.listThreads();
3488
+ a(j ?? []);
3489
+ } catch (j) {
3490
+ const k = String(j);
3491
3491
  m(k), n == null || n(k);
3492
3492
  } finally {
3493
3493
  d(!1);
3494
3494
  }
3495
- }, [e, n]), j = ce(async () => {
3495
+ }, [e, n]), A = ce(async () => {
3496
3496
  x(!0), b(null);
3497
3497
  try {
3498
- const A = await e.listSharedThreads();
3499
- v(A ?? []);
3500
- } catch (A) {
3501
- const k = String(A);
3498
+ const j = await e.listSharedThreads();
3499
+ v(j ?? []);
3500
+ } catch (j) {
3501
+ const k = String(j);
3502
3502
  b(k), n == null || n(k);
3503
3503
  } finally {
3504
3504
  x(!1);
@@ -3507,14 +3507,14 @@ function xw({
3507
3507
  Xe(() => {
3508
3508
  N();
3509
3509
  }, [N]), Xe(() => {
3510
- j();
3511
- }, [j]), Xe(() => {
3510
+ A();
3511
+ }, [A]), Xe(() => {
3512
3512
  r == null || r(i);
3513
3513
  }, [i, r]);
3514
3514
  const $ = ce(
3515
- async (A, k) => {
3515
+ async (j, k) => {
3516
3516
  try {
3517
- const K = await e.createThread(A, k);
3517
+ const K = await e.createThread(j, k);
3518
3518
  return l(K.threadId), await N(), K.threadId;
3519
3519
  } catch (K) {
3520
3520
  const J = String(K);
@@ -3523,36 +3523,36 @@ function xw({
3523
3523
  },
3524
3524
  [e, n, N]
3525
3525
  ), O = ce(
3526
- async (A) => {
3526
+ async (j) => {
3527
3527
  const k = s;
3528
- a((J) => J.filter((M) => M.threadId !== A));
3528
+ a((J) => J.filter((M) => M.threadId !== j));
3529
3529
  const K = new AbortController();
3530
- C.current.set(A, K);
3530
+ C.current.set(j, K);
3531
3531
  try {
3532
- await e.deleteThread(A), y.current === A && (l(null), o == null || o());
3532
+ await e.deleteThread(j), y.current === j && (l(null), o == null || o());
3533
3533
  } catch (J) {
3534
3534
  a(k);
3535
3535
  const M = String(J);
3536
3536
  n == null || n(M);
3537
3537
  } finally {
3538
- C.current.delete(A);
3538
+ C.current.delete(j);
3539
3539
  }
3540
3540
  },
3541
3541
  [e, o, n, s]
3542
3542
  ), B = ce(
3543
- async (A, k) => {
3543
+ async (j, k) => {
3544
3544
  try {
3545
- await e.updateThread(A, k), await N();
3545
+ await e.updateThread(j, k), await N();
3546
3546
  } catch (K) {
3547
3547
  n == null || n(String(K));
3548
3548
  }
3549
3549
  },
3550
3550
  [e, n, N]
3551
3551
  ), G = ce(
3552
- async (A, k) => {
3552
+ async (j, k) => {
3553
3553
  T(!0), S("Sharing thread…");
3554
3554
  try {
3555
- await e.shareThread(A, k), await j(), S("Shared successfully");
3555
+ await e.shareThread(j, k), await A(), S("Shared successfully");
3556
3556
  } catch (K) {
3557
3557
  const J = gw(K);
3558
3558
  throw n == null || n(J), S(`Failed to share: ${J}`), new Error(J);
@@ -3560,37 +3560,37 @@ function xw({
3560
3560
  T(!1);
3561
3561
  }
3562
3562
  },
3563
- [e, n, j]
3563
+ [e, n, A]
3564
3564
  ), _ = ce(
3565
- async (A, k) => {
3565
+ async (j, k) => {
3566
3566
  try {
3567
- await e.unshareThread(A, k), await j();
3567
+ await e.unshareThread(j, k), await A();
3568
3568
  } catch (K) {
3569
3569
  const J = String(K);
3570
3570
  throw n == null || n(J), K;
3571
3571
  }
3572
3572
  },
3573
- [e, n, j]
3573
+ [e, n, A]
3574
3574
  ), U = Be(
3575
3575
  () => ({
3576
3576
  createThread: $,
3577
3577
  deleteThread: O,
3578
3578
  renameThread: B,
3579
3579
  refreshThreads: N,
3580
- refreshSharedThreads: j,
3580
+ refreshSharedThreads: A,
3581
3581
  shareThread: G,
3582
3582
  unshareThread: _
3583
3583
  }),
3584
- [$, O, B, N, j, G, _]
3585
- ), Y = ce((A) => {
3586
- if (!(A != null && A.threadId)) return;
3584
+ [$, O, B, N, A, G, _]
3585
+ ), Y = ce((j) => {
3586
+ if (!(j != null && j.threadId)) return;
3587
3587
  const k = {
3588
- threadId: A.threadId,
3589
- title: A.title || `Thread ${A.threadId.slice(0, 8)}`,
3590
- project: A.project,
3591
- createdAt: A.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
3592
- updatedAt: A.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3593
- messageCount: A.messageCount ?? 1
3588
+ threadId: j.threadId,
3589
+ title: j.title || `Thread ${j.threadId.slice(0, 8)}`,
3590
+ project: j.project,
3591
+ createdAt: j.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
3592
+ updatedAt: j.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3593
+ messageCount: j.messageCount ?? 1
3594
3594
  };
3595
3595
  a((K) => {
3596
3596
  let J = !1;
@@ -4214,7 +4214,7 @@ function Lw({
4214
4214
  const [d, f] = pe(null), p = Be(
4215
4215
  () => Tr(d),
4216
4216
  [d]
4217
- ).checkpoints, v = px(p), g = v.timeline, [x, b] = pe(!1), [w, S] = pe(!1), [E, T] = pe(null), y = Ae(r), C = Ae(null), N = Ae(null), j = Ae(null), $ = Ae(null), O = Ae(null), B = Ae(/* @__PURE__ */ new Map()), G = Ae(null);
4217
+ ).checkpoints, v = px(p), g = v.timeline, [x, b] = pe(!1), [w, S] = pe(!1), [E, T] = pe(null), y = Ae(r), C = Ae(null), N = Ae(null), A = Ae(null), $ = Ae(null), O = Ae(null), B = Ae(/* @__PURE__ */ new Map()), G = Ae(null);
4218
4218
  Xe(() => {
4219
4219
  y.current = r;
4220
4220
  }, [r]);
@@ -4296,8 +4296,8 @@ function Lw({
4296
4296
  [U]
4297
4297
  ), z = ce((D) => {
4298
4298
  N.current = D;
4299
- }, []), A = ce((D) => {
4300
- j.current = D;
4299
+ }, []), j = ce((D) => {
4300
+ A.current = D;
4301
4301
  }, []), k = ce(
4302
4302
  (D) => {
4303
4303
  const L = D.threadId ?? y.current;
@@ -4306,12 +4306,12 @@ function Lw({
4306
4306
  const { checkpoints: X } = Tr(D);
4307
4307
  if (!X.length)
4308
4308
  return;
4309
- const R = X.find((H) => H.messages && H.messages.length > 0) ?? X.find((H) => !!H.checkpointId) ?? X[0], P = j.current === L;
4309
+ const R = X.find((H) => H.messages && H.messages.length > 0) ?? X.find((H) => !!H.checkpointId) ?? X[0], P = A.current === L;
4310
4310
  !l && !P && t((R == null ? void 0 : R.messages) ?? [], {
4311
4311
  checkpointId: (R == null ? void 0 : R.checkpointId) ?? null,
4312
4312
  checkpointNs: (R == null ? void 0 : R.checkpointNs) ?? null,
4313
4313
  pendingInterrupt: (R == null ? void 0 : R.interrupt) ?? null
4314
- }), f(D), O.current = `${L}:latest`, N.current = null, j.current === L && (j.current = null);
4314
+ }), f(D), O.current = `${L}:latest`, N.current = null, A.current === L && (A.current = null);
4315
4315
  },
4316
4316
  [t, l]
4317
4317
  ), K = ce(
@@ -4362,7 +4362,7 @@ function Lw({
4362
4362
  N.current = null, C.current = r;
4363
4363
  return;
4364
4364
  }
4365
- if (j.current === r) {
4365
+ if (A.current === r) {
4366
4366
  C.current = r;
4367
4367
  return;
4368
4368
  }
@@ -4387,7 +4387,7 @@ function Lw({
4387
4387
  Y
4388
4388
  ]);
4389
4389
  const q = ce(() => {
4390
- f(null), b(!1), S(!1), T(null), N.current = null, j.current = null, C.current = null, O.current = null, $.current = null;
4390
+ f(null), b(!1), S(!1), T(null), N.current = null, A.current = null, C.current = null, O.current = null, $.current = null;
4391
4391
  }, []);
4392
4392
  return {
4393
4393
  threadCheckpoints: p,
@@ -4402,7 +4402,7 @@ function Lw({
4402
4402
  returnToLatest: M,
4403
4403
  handleStateHistoryEvent: k,
4404
4404
  markSkipNextLoad: z,
4405
- markStreamPendingThread: A,
4405
+ markStreamPendingThread: j,
4406
4406
  resetHistoryState: q
4407
4407
  };
4408
4408
  }
@@ -4440,7 +4440,7 @@ function Fw({
4440
4440
  returnToLatest: y,
4441
4441
  handleStateHistoryEvent: C,
4442
4442
  markSkipNextLoad: N,
4443
- markStreamPendingThread: j,
4443
+ markStreamPendingThread: A,
4444
4444
  resetHistoryState: $
4445
4445
  } = Lw({
4446
4446
  api: i,
@@ -4471,7 +4471,7 @@ function Fw({
4471
4471
  ), Y = ce(
4472
4472
  (K) => _(() => K),
4473
4473
  []
4474
- ), z = Be(() => ({ assemblingMessageId: c.assemblingId ?? null }), [c.assemblingId]), A = Be(
4474
+ ), z = Be(() => ({ assemblingMessageId: c.assemblingId ?? null }), [c.assemblingId]), j = Be(
4475
4475
  () => ({
4476
4476
  threadId: l,
4477
4477
  messages: c.messages,
@@ -4497,7 +4497,7 @@ function Fw({
4497
4497
  messagePreviews: g.messagePreviews,
4498
4498
  handleStateHistoryEvent: C,
4499
4499
  markSkipNextLoad: N,
4500
- markStreamPendingThread: j,
4500
+ markStreamPendingThread: A,
4501
4501
  resetHistoryState: $,
4502
4502
  pushUser: f,
4503
4503
  onEvent: m
@@ -4521,7 +4521,7 @@ function Fw({
4521
4521
  g.messagePreviews,
4522
4522
  C,
4523
4523
  N,
4524
- j,
4524
+ A,
4525
4525
  $,
4526
4526
  f,
4527
4527
  m
@@ -4533,7 +4533,7 @@ function Fw({
4533
4533
  }),
4534
4534
  [U, Y]
4535
4535
  );
4536
- return /* @__PURE__ */ u.jsx(Sd.Provider, { value: k, children: /* @__PURE__ */ u.jsx(yd.Provider, { value: A, children: e }) });
4536
+ return /* @__PURE__ */ u.jsx(Sd.Provider, { value: k, children: /* @__PURE__ */ u.jsx(yd.Provider, { value: j, children: e }) });
4537
4537
  }
4538
4538
  function Sc(e, t) {
4539
4539
  if (!e) return null;
@@ -4631,27 +4631,27 @@ function Ww({
4631
4631
  resetHistoryState: E,
4632
4632
  pushUser: T,
4633
4633
  onEvent: y
4634
- } = Fs(), { registerClearThread: C, registerRespondToInterrupt: N } = $w(), j = ce(
4634
+ } = Fs(), { registerClearThread: C, registerRespondToInterrupt: N } = $w(), A = ce(
4635
4635
  (z) => {
4636
4636
  v(z), p.current !== z.threadId && ((z.created ?? !p.current) && w(z.threadId), S(z.threadId), m(z.threadId));
4637
4637
  },
4638
4638
  [v, w, S, m, p]
4639
4639
  ), $ = ce(
4640
4640
  (z) => {
4641
- z.type === "thread_info" ? j(z) : z.type === "state_history" ? b(z) : z.type === "tool.end" ? (y(z), a == null || a(z)) : y(z);
4641
+ z.type === "thread_info" ? A(z) : z.type === "state_history" ? b(z) : z.type === "tool.end" ? (y(z), a == null || a(z)) : y(z);
4642
4642
  },
4643
- [j, b, y, a]
4643
+ [A, b, y, a]
4644
4644
  ), O = ce(
4645
4645
  (z) => {
4646
4646
  i(z, $, {
4647
- onError: (A) => {
4648
- console.error("[StreamingProvider] Stream error:", A), r == null || r(A);
4647
+ onError: (j) => {
4648
+ console.error("[StreamingProvider] Stream error:", j), r == null || r(j);
4649
4649
  },
4650
- onAuthError: (A) => {
4651
- console.error("[StreamingProvider] Auth error:", A), o == null || o(A);
4650
+ onAuthError: (j) => {
4651
+ console.error("[StreamingProvider] Auth error:", j), o == null || o(j);
4652
4652
  },
4653
- onConnectionError: (A) => {
4654
- console.error("[StreamingProvider] Connection error:", A), s == null || s(A);
4653
+ onConnectionError: (j) => {
4654
+ console.error("[StreamingProvider] Connection error:", j), s == null || s(j);
4655
4655
  }
4656
4656
  });
4657
4657
  },
@@ -4661,11 +4661,11 @@ function Ww({
4661
4661
  B.current = g;
4662
4662
  }, [g]);
4663
4663
  const G = ce(
4664
- async (z, A, k) => {
4664
+ async (z, j, k) => {
4665
4665
  const K = p.current;
4666
4666
  if (!K)
4667
4667
  throw new Error("No active thread to handle interrupt");
4668
- const J = z ? A ?? !0 : !1, M = B.current, q = {
4668
+ const J = z ? j ?? !0 : !1, M = B.current, q = {
4669
4669
  threadId: K,
4670
4670
  checkpointId: M.id ?? void 0,
4671
4671
  checkpointNs: M.namespace ?? void 0,
@@ -4690,7 +4690,7 @@ function Ww({
4690
4690
  C(_);
4691
4691
  }, [_, C]);
4692
4692
  const U = ce(
4693
- async (z, A) => {
4693
+ async (z, j) => {
4694
4694
  c && l();
4695
4695
  let k = p.current;
4696
4696
  const K = (z == null ? void 0 : z.text) ?? "", J = (z == null ? void 0 : z.attachments) ?? [], M = (K == null ? void 0 : K.trim()) ?? "", q = { ...(z == null ? void 0 : z.payload) ?? {} }, D = Array.isArray(q.messages) ? q.messages : void 0;
@@ -4703,7 +4703,7 @@ function Ww({
4703
4703
  }
4704
4704
  const { contentParts: X, filesInfo: R } = await lw(J), P = [...X];
4705
4705
  M && P.push({ type: "text", text: K });
4706
- const H = A == null ? void 0 : A.originalMessageId, Z = !!(A != null && A.edit && H), oe = !L && P.length > 0;
4706
+ const H = j == null ? void 0 : j.originalMessageId, Z = !!(j != null && j.edit && H), oe = !L && P.length > 0;
4707
4707
  let le = null;
4708
4708
  oe && (le = {
4709
4709
  id: Z ? H : `msg-${Date.now()}`,
@@ -4716,7 +4716,7 @@ function Ww({
4716
4716
  ...R.length ? { files_info: R } : {}
4717
4717
  };
4718
4718
  Ee.length ? ye.messages = Ee : "messages" in ye || (ye.messages = []);
4719
- let Pe = (A == null ? void 0 : A.checkpointId) ?? g.id ?? void 0, qe = (A == null ? void 0 : A.checkpointNs) ?? g.namespace ?? void 0;
4719
+ let Pe = (j == null ? void 0 : j.checkpointId) ?? g.id ?? void 0, qe = (j == null ? void 0 : j.checkpointNs) ?? g.namespace ?? void 0;
4720
4720
  if (Z && H) {
4721
4721
  const We = Hw(x, H);
4722
4722
  Pe = We.checkpointId, qe = We.checkpointNs ?? void 0;
@@ -4726,8 +4726,8 @@ function Ww({
4726
4726
  payload: ye,
4727
4727
  checkpointId: Pe,
4728
4728
  checkpointNs: qe,
4729
- config: A == null ? void 0 : A.config,
4730
- edit: !!(A != null && A.edit)
4729
+ config: j == null ? void 0 : j.config,
4730
+ edit: !!(j != null && j.edit)
4731
4731
  };
4732
4732
  O(ze);
4733
4733
  },
@@ -4942,7 +4942,7 @@ const Zw = bo(
4942
4942
  size: "default"
4943
4943
  }
4944
4944
  }
4945
- ), nt = h.forwardRef(
4945
+ ), tt = h.forwardRef(
4946
4946
  ({ className: e, variant: t, size: n, asChild: r = !1, ...o }, s) => {
4947
4947
  const a = r ? Hg : "button";
4948
4948
  return /* @__PURE__ */ u.jsx(
@@ -4955,7 +4955,7 @@ const Zw = bo(
4955
4955
  );
4956
4956
  }
4957
4957
  );
4958
- nt.displayName = "Button";
4958
+ tt.displayName = "Button";
4959
4959
  function ie(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
4960
4960
  return function(o) {
4961
4961
  if (e == null || e(o), n === !1 || !o.defaultPrevented)
@@ -5169,8 +5169,8 @@ var lb = "DismissableLayer", ti = "dismissableLayer.update", cb = "dismissableLa
5169
5169
  onDismiss: i,
5170
5170
  ...l
5171
5171
  } = e, c = h.useContext(Nd), [d, f] = h.useState(null), m = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = h.useState({}), v = Oe(t, (C) => f(C)), g = Array.from(c.layers), [x] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), b = g.indexOf(x), w = d ? g.indexOf(d) : -1, S = c.layersWithOutsidePointerEventsDisabled.size > 0, E = w >= b, T = fb((C) => {
5172
- const N = C.target, j = [...c.branches].some(($) => $.contains(N));
5173
- !E || j || (o == null || o(C), a == null || a(C), C.defaultPrevented || i == null || i());
5172
+ const N = C.target, A = [...c.branches].some(($) => $.contains(N));
5173
+ !E || A || (o == null || o(C), a == null || a(C), C.defaultPrevented || i == null || i());
5174
5174
  }, m), y = pb((C) => {
5175
5175
  const N = C.target;
5176
5176
  [...c.branches].some(($) => $.contains(N)) || (s == null || s(C), a == null || a(C), C.defaultPrevented || i == null || i());
@@ -5895,8 +5895,8 @@ function ay(e) {
5895
5895
  return !1;
5896
5896
  if (!r.current && "changedTouches" in g && (S || E) && (r.current = T), !T)
5897
5897
  return !0;
5898
- var j = r.current || T;
5899
- return ny(j, x, g, j === "h" ? S : E);
5898
+ var A = r.current || T;
5899
+ return ny(A, x, g, A === "h" ? S : E);
5900
5900
  }, []), l = h.useCallback(function(g) {
5901
5901
  var x = g;
5902
5902
  if (!(!wr.length || wr[wr.length - 1] !== s)) {
@@ -6447,7 +6447,7 @@ function Ny({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
6447
6447
  ] }) : c ? /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
6448
6448
  /* @__PURE__ */ u.jsx("div", { className: "text-red-500 mb-4", children: "⚠️" }),
6449
6449
  /* @__PURE__ */ u.jsx("p", { className: "text-red-600 mb-4", children: c }),
6450
- /* @__PURE__ */ u.jsx(nt, { onClick: p, variant: "outline", children: "Try Again" })
6450
+ /* @__PURE__ */ u.jsx(tt, { onClick: p, variant: "outline", children: "Try Again" })
6451
6451
  ] }) : i ? o.startsWith("image/") ? /* @__PURE__ */ u.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ u.jsx(
6452
6452
  "img",
6453
6453
  {
@@ -6487,7 +6487,7 @@ function Ny({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
6487
6487
  ] }),
6488
6488
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
6489
6489
  /* @__PURE__ */ u.jsxs(
6490
- nt,
6490
+ tt,
6491
6491
  {
6492
6492
  variant: "outline",
6493
6493
  size: "sm",
@@ -6500,7 +6500,7 @@ function Ny({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
6500
6500
  }
6501
6501
  ),
6502
6502
  /* @__PURE__ */ u.jsxs(
6503
- nt,
6503
+ tt,
6504
6504
  {
6505
6505
  variant: "outline",
6506
6506
  size: "sm",
@@ -6565,7 +6565,7 @@ function uf(e) {
6565
6565
  return e.replace(My, (t, n) => (n = n.toLowerCase(), n === "colon" ? ":" : n.charAt(0) === "#" ? n.charAt(1) === "x" ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)) : ""));
6566
6566
  }
6567
6567
  const Oy = /(^|[^\[])\^/g;
6568
- function st(e, t) {
6568
+ function ot(e, t) {
6569
6569
  e = typeof e == "string" ? e : e.source, t = t || "";
6570
6570
  const n = {
6571
6571
  replace: (r, o) => (o = o.source || o, o = o.replace(Oy, "$1"), e = e.replace(r, o), n),
@@ -7127,26 +7127,26 @@ const be = {
7127
7127
  };
7128
7128
  be._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
7129
7129
  be._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
7130
- be.def = st(be.def).replace("label", be._label).replace("title", be._title).getRegex();
7130
+ be.def = ot(be.def).replace("label", be._label).replace("title", be._title).getRegex();
7131
7131
  be.bullet = /(?:[*+-]|\d{1,9}[.)])/;
7132
- be.listItemStart = st(/^( *)(bull) */).replace("bull", be.bullet).getRegex();
7133
- be.list = st(be.list).replace(/bull/g, be.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + be.def.source + ")").getRegex();
7132
+ be.listItemStart = ot(/^( *)(bull) */).replace("bull", be.bullet).getRegex();
7133
+ be.list = ot(be.list).replace(/bull/g, be.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + be.def.source + ")").getRegex();
7134
7134
  be._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
7135
7135
  be._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
7136
- be.html = st(be.html, "i").replace("comment", be._comment).replace("tag", be._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
7137
- be.paragraph = st(be._paragraph).replace("hr", be.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", be._tag).getRegex();
7138
- be.blockquote = st(be.blockquote).replace("paragraph", be.paragraph).getRegex();
7136
+ be.html = ot(be.html, "i").replace("comment", be._comment).replace("tag", be._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
7137
+ be.paragraph = ot(be._paragraph).replace("hr", be.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", be._tag).getRegex();
7138
+ be.blockquote = ot(be.blockquote).replace("paragraph", be.paragraph).getRegex();
7139
7139
  be.normal = { ...be };
7140
7140
  be.gfm = {
7141
7141
  ...be.normal,
7142
7142
  table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
7143
7143
  // Cells
7144
7144
  };
7145
- be.gfm.table = st(be.gfm.table).replace("hr", be.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", be._tag).getRegex();
7146
- be.gfm.paragraph = st(be._paragraph).replace("hr", be.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", be.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", be._tag).getRegex();
7145
+ be.gfm.table = ot(be.gfm.table).replace("hr", be.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", be._tag).getRegex();
7146
+ be.gfm.paragraph = ot(be._paragraph).replace("hr", be.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", be.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", be._tag).getRegex();
7147
7147
  be.pedantic = {
7148
7148
  ...be.normal,
7149
- html: st(
7149
+ html: ot(
7150
7150
  `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
7151
7151
  ).replace("comment", be._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
7152
7152
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
@@ -7154,7 +7154,7 @@ be.pedantic = {
7154
7154
  fences: xs,
7155
7155
  // fences not supported
7156
7156
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
7157
- paragraph: st(be.normal._paragraph).replace("hr", be.hr).replace("heading", ` *#{1,6} *[^
7157
+ paragraph: ot(be.normal._paragraph).replace("hr", be.hr).replace("heading", ` *#{1,6} *[^
7158
7158
  ]`).replace("lheading", be.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
7159
7159
  };
7160
7160
  const fe = {
@@ -7182,26 +7182,26 @@ const fe = {
7182
7182
  punctuation: /^([\spunctuation])/
7183
7183
  };
7184
7184
  fe._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
7185
- fe.punctuation = st(fe.punctuation).replace(/punctuation/g, fe._punctuation).getRegex();
7185
+ fe.punctuation = ot(fe.punctuation).replace(/punctuation/g, fe._punctuation).getRegex();
7186
7186
  fe.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
7187
7187
  fe.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
7188
- fe._comment = st(be._comment).replace("(?:-->|$)", "-->").getRegex();
7189
- fe.emStrong.lDelim = st(fe.emStrong.lDelim).replace(/punct/g, fe._punctuation).getRegex();
7190
- fe.emStrong.rDelimAst = st(fe.emStrong.rDelimAst, "g").replace(/punct/g, fe._punctuation).getRegex();
7191
- fe.emStrong.rDelimUnd = st(fe.emStrong.rDelimUnd, "g").replace(/punct/g, fe._punctuation).getRegex();
7188
+ fe._comment = ot(be._comment).replace("(?:-->|$)", "-->").getRegex();
7189
+ fe.emStrong.lDelim = ot(fe.emStrong.lDelim).replace(/punct/g, fe._punctuation).getRegex();
7190
+ fe.emStrong.rDelimAst = ot(fe.emStrong.rDelimAst, "g").replace(/punct/g, fe._punctuation).getRegex();
7191
+ fe.emStrong.rDelimUnd = ot(fe.emStrong.rDelimUnd, "g").replace(/punct/g, fe._punctuation).getRegex();
7192
7192
  fe._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
7193
7193
  fe._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
7194
7194
  fe._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
7195
- fe.autolink = st(fe.autolink).replace("scheme", fe._scheme).replace("email", fe._email).getRegex();
7195
+ fe.autolink = ot(fe.autolink).replace("scheme", fe._scheme).replace("email", fe._email).getRegex();
7196
7196
  fe._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
7197
- fe.tag = st(fe.tag).replace("comment", fe._comment).replace("attribute", fe._attribute).getRegex();
7197
+ fe.tag = ot(fe.tag).replace("comment", fe._comment).replace("attribute", fe._attribute).getRegex();
7198
7198
  fe._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
7199
7199
  fe._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
7200
7200
  fe._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
7201
- fe.link = st(fe.link).replace("label", fe._label).replace("href", fe._href).replace("title", fe._title).getRegex();
7202
- fe.reflink = st(fe.reflink).replace("label", fe._label).replace("ref", be._label).getRegex();
7203
- fe.nolink = st(fe.nolink).replace("ref", be._label).getRegex();
7204
- fe.reflinkSearch = st(fe.reflinkSearch, "g").replace("reflink", fe.reflink).replace("nolink", fe.nolink).getRegex();
7201
+ fe.link = ot(fe.link).replace("label", fe._label).replace("href", fe._href).replace("title", fe._title).getRegex();
7202
+ fe.reflink = ot(fe.reflink).replace("label", fe._label).replace("ref", be._label).getRegex();
7203
+ fe.nolink = ot(fe.nolink).replace("ref", be._label).getRegex();
7204
+ fe.reflinkSearch = ot(fe.reflinkSearch, "g").replace("reflink", fe.reflink).replace("nolink", fe.nolink).getRegex();
7205
7205
  fe.normal = { ...fe };
7206
7206
  fe.pedantic = {
7207
7207
  ...fe.normal,
@@ -7217,23 +7217,23 @@ fe.pedantic = {
7217
7217
  endAst: /\*(?!\*)/g,
7218
7218
  endUnd: /_(?!_)/g
7219
7219
  },
7220
- link: st(/^!?\[(label)\]\((.*?)\)/).replace("label", fe._label).getRegex(),
7221
- reflink: st(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", fe._label).getRegex()
7220
+ link: ot(/^!?\[(label)\]\((.*?)\)/).replace("label", fe._label).getRegex(),
7221
+ reflink: ot(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", fe._label).getRegex()
7222
7222
  };
7223
7223
  fe.gfm = {
7224
7224
  ...fe.normal,
7225
- escape: st(fe.escape).replace("])", "~|])").getRegex(),
7225
+ escape: ot(fe.escape).replace("])", "~|])").getRegex(),
7226
7226
  _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
7227
7227
  url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
7228
7228
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
7229
7229
  del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
7230
7230
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
7231
7231
  };
7232
- fe.gfm.url = st(fe.gfm.url, "i").replace("email", fe.gfm._extended_email).getRegex();
7232
+ fe.gfm.url = ot(fe.gfm.url, "i").replace("email", fe.gfm._extended_email).getRegex();
7233
7233
  fe.breaks = {
7234
7234
  ...fe.gfm,
7235
- br: st(fe.br).replace("{2,}", "*").getRegex(),
7236
- text: st(fe.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
7235
+ br: ot(fe.br).replace("{2,}", "*").getRegex(),
7236
+ text: ot(fe.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
7237
7237
  };
7238
7238
  function Vy(e) {
7239
7239
  return e.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
@@ -8293,7 +8293,7 @@ function wf({
8293
8293
  /* @__PURE__ */ u.jsx(xf, { className: "text-blue-700 dark:text-blue-300 text-sm", children: c })
8294
8294
  ] }),
8295
8295
  i ? /* @__PURE__ */ u.jsx(oi, { className: "pt-0 pb-3", children: /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: i.alternatives.map((f) => /* @__PURE__ */ u.jsx(
8296
- nt,
8296
+ tt,
8297
8297
  {
8298
8298
  size: "sm",
8299
8299
  variant: "outline",
@@ -8309,7 +8309,7 @@ function wf({
8309
8309
  )) }) }) : d && /* @__PURE__ */ u.jsx(oi, { className: "pt-0 pb-3", children: d }),
8310
8310
  !i && /* @__PURE__ */ u.jsx(vf, { className: "pt-0", children: /* @__PURE__ */ u.jsxs("div", { className: "flex gap-2 ml-auto", children: [
8311
8311
  /* @__PURE__ */ u.jsx(
8312
- nt,
8312
+ tt,
8313
8313
  {
8314
8314
  size: "sm",
8315
8315
  variant: "outline",
@@ -8320,7 +8320,7 @@ function wf({
8320
8320
  }
8321
8321
  ),
8322
8322
  /* @__PURE__ */ u.jsx(
8323
- nt,
8323
+ tt,
8324
8324
  {
8325
8325
  size: "sm",
8326
8326
  onClick: () => t(e),
@@ -8380,7 +8380,7 @@ function Qy({
8380
8380
  }
8381
8381
  ) }),
8382
8382
  /* @__PURE__ */ u.jsx(
8383
- nt,
8383
+ tt,
8384
8384
  {
8385
8385
  type: "button",
8386
8386
  variant: "ghost",
@@ -8444,7 +8444,7 @@ function t0({
8444
8444
  setIsUserExpanded: y,
8445
8445
  isCompactLayout: C,
8446
8446
  iconForeground: N,
8447
- toolConfig: j,
8447
+ toolConfig: A,
8448
8448
  handleInterruptApprove: $,
8449
8449
  handleInterruptReject: O,
8450
8450
  handleInterruptAlternative: B,
@@ -8458,12 +8458,12 @@ function t0({
8458
8458
  a,
8459
8459
  (p ?? !0) && f,
8460
8460
  m ?? 0
8461
- ), A = Be(
8461
+ ), j = Be(
8462
8462
  () => z.filter((R) => R.type === "text"),
8463
8463
  [z]
8464
8464
  ), k = Be(
8465
- () => A.map((R) => R.text ?? "").join(""),
8466
- [A]
8465
+ () => j.map((R) => R.text ?? "").join(""),
8466
+ [j]
8467
8467
  ), K = Be(() => {
8468
8468
  if (!v)
8469
8469
  return null;
@@ -8588,7 +8588,7 @@ function t0({
8588
8588
  viewMode: r,
8589
8589
  expandable: o,
8590
8590
  isStreaming: s,
8591
- toolConfig: j
8591
+ toolConfig: A
8592
8592
  },
8593
8593
  e.id
8594
8594
  );
@@ -8664,7 +8664,7 @@ function i0({
8664
8664
  attemptIndex: y,
8665
8665
  handleOlderAttemptSelect: C,
8666
8666
  handleNewerAttemptSelect: N,
8667
- messageCreatedAt: j,
8667
+ messageCreatedAt: A,
8668
8668
  copied: $
8669
8669
  }) {
8670
8670
  return !e && !t && !n && !r ? null : /* @__PURE__ */ u.jsxs(
@@ -8747,13 +8747,13 @@ function i0({
8747
8747
  }
8748
8748
  )
8749
8749
  ] }),
8750
- e && j && /* @__PURE__ */ u.jsx(
8750
+ e && A && /* @__PURE__ */ u.jsx(
8751
8751
  "time",
8752
8752
  {
8753
8753
  className: ne("text-xs opacity-60", o, c && "text-xs"),
8754
- dateTime: new Date(j).toISOString(),
8755
- title: new Date(j).toLocaleString(),
8756
- children: new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit" }).format(new Date(j))
8754
+ dateTime: new Date(A.endsWith("Z") || A.includes("+") ? A : `${A}Z`).toISOString(),
8755
+ title: new Date(A.endsWith("Z") || A.includes("+") ? A : `${A}Z`).toLocaleString(),
8756
+ children: new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit" }).format(new Date(A.endsWith("Z") || A.includes("+") ? A : `${A}Z`))
8757
8757
  }
8758
8758
  ),
8759
8759
  d && !f && /* @__PURE__ */ u.jsxs(
@@ -8766,7 +8766,7 @@ function i0({
8766
8766
  ),
8767
8767
  children: [
8768
8768
  /* @__PURE__ */ u.jsx("div", { className: "relative", children: /* @__PURE__ */ u.jsx(
8769
- nt,
8769
+ tt,
8770
8770
  {
8771
8771
  variant: "ghost",
8772
8772
  size: "sm",
@@ -8778,7 +8778,7 @@ function i0({
8778
8778
  }
8779
8779
  ) }),
8780
8780
  m === "user" && w && /* @__PURE__ */ u.jsx(
8781
- nt,
8781
+ tt,
8782
8782
  {
8783
8783
  variant: "ghost",
8784
8784
  size: "sm",
@@ -8789,7 +8789,7 @@ function i0({
8789
8789
  }
8790
8790
  ),
8791
8791
  m === "assistant" && S && /* @__PURE__ */ u.jsx(
8792
- nt,
8792
+ tt,
8793
8793
  {
8794
8794
  variant: "ghost",
8795
8795
  size: "sm",
@@ -8988,18 +8988,18 @@ const el = $g(function({
8988
8988
  onSelectCheckpoint: C,
8989
8989
  attemptMetas: N = []
8990
8990
  }) {
8991
- const [j, $] = pe(!1), [O, B] = pe(!1), { currentThreadId: G } = Io(), { respondToInterrupt: _ } = Fs(), [U, Y] = pe(!1), z = l === "phone" || l === "half-screen", A = t.role, k = A === "interrupt", K = A === "tool" || k, M = !(t.role === "default_message") && t.expandable !== void 0 ? t.expandable !== !1 : !0, { toolRenderers: q, toolArtifactRenderers: D, getToolExpandable: L } = m ?? {}, X = Be(() => !L || t.role !== "tool" ? !1 : L(t), [L, t.id, t.role]), [R, P] = pe(X ? "preview" : "expanded");
8991
+ const [A, $] = pe(!1), [O, B] = pe(!1), { currentThreadId: G } = Io(), { respondToInterrupt: _ } = Fs(), [U, Y] = pe(!1), z = l === "phone" || l === "half-screen", j = t.role, k = j === "interrupt", K = j === "tool" || k, M = !(t.role === "default_message") && t.expandable !== void 0 ? t.expandable !== !1 : !0, { toolRenderers: q, toolArtifactRenderers: D, getToolExpandable: L } = m ?? {}, X = Be(() => !L || t.role !== "tool" ? !1 : L(t), [L, t.id, t.role]), [R, P] = pe(X ? "preview" : "expanded");
8992
8992
  Xe(() => {
8993
8993
  P(X ? "preview" : "expanded");
8994
8994
  }, [X, t.id]);
8995
- const H = Be(() => t.role === "default_message" ? t : null, [t]), Z = !!H, oe = !(r && A !== "user"), {
8995
+ const H = Be(() => t.role === "default_message" ? t : null, [t]), Z = !!H, oe = !(r && j !== "user"), {
8996
8996
  uploadingFiles: le,
8997
8997
  handleFileClick: Ee,
8998
8998
  fileViewerOpen: ye,
8999
8999
  currentFileInfo: Pe,
9000
9000
  closeFileViewer: qe
9001
9001
  } = l0({ allowFileOpen: oe, currentThreadId: G }), ze = Be(() => {
9002
- switch (A) {
9002
+ switch (j) {
9003
9003
  case "user":
9004
9004
  return "text-[hsl(var(--chat-bubble-user-text))]";
9005
9005
  case "assistant":
@@ -9013,7 +9013,7 @@ const el = $g(function({
9013
9013
  default:
9014
9014
  return "text-[hsl(var(--chat-bubble-ai-text))]";
9015
9015
  }
9016
- }, [A]), We = c0(t, H), {
9016
+ }, [j]), We = c0(t, H), {
9017
9017
  contentParts: He,
9018
9018
  imageParts: Tt,
9019
9019
  fileParts: Ct,
@@ -9030,10 +9030,10 @@ const el = $g(function({
9030
9030
  return;
9031
9031
  }
9032
9032
  if (navigator.clipboard && typeof navigator.clipboard.write == "function" && typeof ClipboardItem < "u") {
9033
- const tt = new Blob([me], { type: "text/plain" });
9033
+ const it = new Blob([me], { type: "text/plain" });
9034
9034
  await navigator.clipboard.write([
9035
9035
  new ClipboardItem({
9036
- "text/plain": tt
9036
+ "text/plain": it
9037
9037
  })
9038
9038
  ]);
9039
9039
  return;
@@ -9055,10 +9055,10 @@ const el = $g(function({
9055
9055
  }
9056
9056
  Y(!0);
9057
9057
  try {
9058
- const tt = E == null ? void 0 : E(t);
9059
- await _(re, ae, tt);
9060
- } catch (tt) {
9061
- console.error("Failed to respond to interrupt:", tt);
9058
+ const it = E == null ? void 0 : E(t);
9059
+ await _(re, ae, it);
9060
+ } catch (it) {
9061
+ console.error("Failed to respond to interrupt:", it);
9062
9062
  } finally {
9063
9063
  Y(!1);
9064
9064
  }
@@ -9092,7 +9092,7 @@ const el = $g(function({
9092
9092
  w == null || w(n);
9093
9093
  }, [w, n]), mt = ce(() => {
9094
9094
  const ae = ne(z ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", ze);
9095
- switch (A) {
9095
+ switch (j) {
9096
9096
  case "user":
9097
9097
  return /* @__PURE__ */ u.jsx(Jg, { className: ae });
9098
9098
  case "assistant":
@@ -9104,9 +9104,9 @@ const el = $g(function({
9104
9104
  default:
9105
9105
  return /* @__PURE__ */ u.jsx(zo, { className: ae });
9106
9106
  }
9107
- }, [z, ze, A]), gt = ce(() => {
9107
+ }, [z, ze, j]), gt = ce(() => {
9108
9108
  const re = "group relative mb-4 flex w-full";
9109
- switch (A) {
9109
+ switch (j) {
9110
9110
  case "user":
9111
9111
  return ne(re, "justify-end");
9112
9112
  case "assistant":
@@ -9117,7 +9117,7 @@ const el = $g(function({
9117
9117
  default:
9118
9118
  return re;
9119
9119
  }
9120
- }, [A]), Bt = ce(() => {
9120
+ }, [j]), Bt = ce(() => {
9121
9121
  const re = ne(
9122
9122
  "rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
9123
9123
  z && "px-3 py-2 text-sm"
@@ -9129,7 +9129,7 @@ const el = $g(function({
9129
9129
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
9130
9130
  "border border-border/60 dark:border-border/40 shadow-sm"
9131
9131
  );
9132
- switch (A) {
9132
+ switch (j) {
9133
9133
  case "user":
9134
9134
  return ne(
9135
9135
  re,
@@ -9157,7 +9157,7 @@ const el = $g(function({
9157
9157
  "border border-border/60 dark:border-border/40"
9158
9158
  );
9159
9159
  }
9160
- }, [z, Z, A]), Ke = X && !k && M, $e = ce(() => {
9160
+ }, [z, Z, j]), Ke = X && !k && M, $e = ce(() => {
9161
9161
  Ke && P((re) => re === "expanded" ? "preview" : "expanded");
9162
9162
  }, [Ke]), Rt = k ? "expanded" : R, dt = (f || k) && M, Mt = /* @__PURE__ */ u.jsx(
9163
9163
  t0,
@@ -9184,7 +9184,7 @@ const el = $g(function({
9184
9184
  streamingDebounceMs: v,
9185
9185
  handleFileClick: Ee,
9186
9186
  uploadingFiles: le,
9187
- messageRole: A,
9187
+ messageRole: j,
9188
9188
  truncateUserMessages: c,
9189
9189
  userMessagePreviewLength: d,
9190
9190
  isUserExpanded: O,
@@ -9198,11 +9198,11 @@ const el = $g(function({
9198
9198
  disableInterruptActions: U,
9199
9199
  isInterruptMessage: k
9200
9200
  }
9201
- ), ge = Be(() => H ? "Assistant" : Cw(t), [H, t]), De = mt(), Fe = A === "user" && (T ?? 1) > 1 && typeof C == "function", at = (N == null ? void 0 : N.length) ?? 0, rt = at > 0 && y < at - 1 ? N[y + 1] : void 0, it = at > 0 && y > 0 ? N[y - 1] : void 0, xt = ce(() => {
9202
- !rt || !C || C(rt.id, void 0, !!rt.isLatestAttempt);
9203
- }, [rt, C]), V = ce(() => {
9204
- !it || !C || C(it.id, void 0, !!it.isLatestAttempt);
9205
- }, [it, C]);
9201
+ ), ge = Be(() => H ? "Assistant" : Cw(t), [H, t]), De = mt(), Fe = j === "user" && (T ?? 1) > 1 && typeof C == "function", st = (N == null ? void 0 : N.length) ?? 0, nt = st > 0 && y < st - 1 ? N[y + 1] : void 0, at = st > 0 && y > 0 ? N[y - 1] : void 0, xt = ce(() => {
9202
+ !nt || !C || C(nt.id, void 0, !!nt.isLatestAttempt);
9203
+ }, [nt, C]), W = ce(() => {
9204
+ !at || !C || C(at.id, void 0, !!at.isLatestAttempt);
9205
+ }, [at, C]);
9206
9206
  return K && !f ? null : Z && H ? /* @__PURE__ */ u.jsx("div", { className: ne(gt(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: ne(Bt(), p.content), children: [
9207
9207
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
9208
9208
  /* @__PURE__ */ u.jsx(zo, { className: ne("h-4 w-4", ze) }),
@@ -9231,7 +9231,7 @@ const el = $g(function({
9231
9231
  isCompactLayout: z,
9232
9232
  showActions: s,
9233
9233
  isEditing: o,
9234
- messageRole: A,
9234
+ messageRole: j,
9235
9235
  toolViewMode: Rt,
9236
9236
  toolExpandable: X,
9237
9237
  isInterruptMessage: k,
@@ -9244,9 +9244,9 @@ const el = $g(function({
9244
9244
  attemptCount: T,
9245
9245
  attemptIndex: y,
9246
9246
  handleOlderAttemptSelect: xt,
9247
- handleNewerAttemptSelect: V,
9247
+ handleNewerAttemptSelect: W,
9248
9248
  messageCreatedAt: t.createdAt,
9249
- copied: j
9249
+ copied: A
9250
9250
  }
9251
9251
  ),
9252
9252
  /* @__PURE__ */ u.jsx("div", { className: "relative", children: Mt }),
@@ -9260,17 +9260,17 @@ const el = $g(function({
9260
9260
  ),
9261
9261
  children: [
9262
9262
  /* @__PURE__ */ u.jsx(
9263
- nt,
9263
+ tt,
9264
9264
  {
9265
9265
  variant: "ghost",
9266
9266
  size: "sm",
9267
9267
  onClick: () => Et(),
9268
9268
  className: ne("h-6 w-6 p-0 hover:bg-background/50 text-current", z && "h-5 w-5"),
9269
- children: /* @__PURE__ */ u.jsx(_u, { className: ne(j ? "text-success" : "text-current", z ? "h-3 w-3" : "h-4 w-4") })
9269
+ children: /* @__PURE__ */ u.jsx(_u, { className: ne(A ? "text-success" : "text-current", z ? "h-3 w-3" : "h-4 w-4") })
9270
9270
  }
9271
9271
  ),
9272
- A === "user" && b && /* @__PURE__ */ u.jsx(
9273
- nt,
9272
+ j === "user" && b && /* @__PURE__ */ u.jsx(
9273
+ tt,
9274
9274
  {
9275
9275
  variant: "ghost",
9276
9276
  size: "sm",
@@ -9279,8 +9279,8 @@ const el = $g(function({
9279
9279
  children: /* @__PURE__ */ u.jsx(Mu, { className: ne("text-current", z ? "h-3 w-3" : "h-4 w-4") })
9280
9280
  }
9281
9281
  ),
9282
- A === "assistant" && w && /* @__PURE__ */ u.jsx(
9283
- nt,
9282
+ j === "assistant" && w && /* @__PURE__ */ u.jsx(
9283
+ tt,
9284
9284
  {
9285
9285
  variant: "ghost",
9286
9286
  size: "sm",
@@ -9754,15 +9754,15 @@ function Cf(e, t) {
9754
9754
  }
9755
9755
  return s.push({ end: 1 / 0, start: r, value: o }), s;
9756
9756
  }
9757
- function ot(e) {
9757
+ function rt(e) {
9758
9758
  return e === co;
9759
9759
  }
9760
9760
  function uo(e, t) {
9761
- if (!ot(e))
9761
+ if (!rt(e))
9762
9762
  return t === e.k ? e.v : t < e.k ? uo(e.l, t) : uo(e.r, t);
9763
9763
  }
9764
9764
  function hn(e, t, n = "k") {
9765
- if (ot(e))
9765
+ if (rt(e))
9766
9766
  return [-1 / 0, void 0];
9767
9767
  if (Number(e[n]) === t)
9768
9768
  return [e.k, e.v];
@@ -9773,24 +9773,24 @@ function hn(e, t, n = "k") {
9773
9773
  return hn(e.l, t, n);
9774
9774
  }
9775
9775
  function tn(e, t, n) {
9776
- return ot(e) ? Rf(t, n, 1) : t === e.k ? jt(e, { k: t, v: n }) : t < e.k ? Yc(jt(e, { l: tn(e.l, t, n) })) : Yc(jt(e, { r: tn(e.r, t, n) }));
9776
+ return rt(e) ? Rf(t, n, 1) : t === e.k ? jt(e, { k: t, v: n }) : t < e.k ? Yc(jt(e, { l: tn(e.l, t, n) })) : Yc(jt(e, { r: tn(e.r, t, n) }));
9777
9777
  }
9778
9778
  function Rr() {
9779
9779
  return co;
9780
9780
  }
9781
9781
  function qs(e, t, n) {
9782
- if (ot(e))
9782
+ if (rt(e))
9783
9783
  return [];
9784
9784
  const r = hn(e, t)[0];
9785
9785
  return E0(ii(e, r, n));
9786
9786
  }
9787
9787
  function ai(e, t) {
9788
- if (ot(e)) return co;
9788
+ if (rt(e)) return co;
9789
9789
  const { k: n, l: r, r: o } = e;
9790
9790
  if (t === n) {
9791
- if (ot(r))
9791
+ if (rt(r))
9792
9792
  return o;
9793
- if (ot(o))
9793
+ if (rt(o))
9794
9794
  return r;
9795
9795
  {
9796
9796
  const [s, a] = kf(r);
@@ -9799,10 +9799,10 @@ function ai(e, t) {
9799
9799
  } else return t < n ? us(jt(e, { l: ai(r, t) })) : us(jt(e, { r: ai(o, t) }));
9800
9800
  }
9801
9801
  function Yn(e) {
9802
- return ot(e) ? [] : [...Yn(e.l), { k: e.k, v: e.v }, ...Yn(e.r)];
9802
+ return rt(e) ? [] : [...Yn(e.l), { k: e.k, v: e.v }, ...Yn(e.r)];
9803
9803
  }
9804
9804
  function ii(e, t, n) {
9805
- if (ot(e))
9805
+ if (rt(e))
9806
9806
  return [];
9807
9807
  const { k: r, l: o, r: s, v: a } = e;
9808
9808
  let i = [];
@@ -9815,7 +9815,7 @@ function us(e) {
9815
9815
  if (n > r.lvl + 1) {
9816
9816
  if (Da(t))
9817
9817
  return If(jt(e, { lvl: n - 1 }));
9818
- if (!ot(t) && !ot(t.r))
9818
+ if (!rt(t) && !rt(t.r))
9819
9819
  return jt(t.r, {
9820
9820
  l: jt(t, { r: t.r.l }),
9821
9821
  lvl: n,
@@ -9828,7 +9828,7 @@ function us(e) {
9828
9828
  } else {
9829
9829
  if (Da(e))
9830
9830
  return li(jt(e, { lvl: n - 1 }));
9831
- if (!ot(r) && !ot(r.l)) {
9831
+ if (!rt(r) && !rt(r.l)) {
9832
9832
  const o = r.l, s = Da(o) ? r.lvl - 1 : r.lvl;
9833
9833
  return jt(o, {
9834
9834
  l: jt(e, {
@@ -9852,13 +9852,13 @@ function jt(e, t) {
9852
9852
  );
9853
9853
  }
9854
9854
  function Ef(e) {
9855
- return ot(e.r) ? e.l : us(jt(e, { r: Ef(e.r) }));
9855
+ return rt(e.r) ? e.l : us(jt(e, { r: Ef(e.r) }));
9856
9856
  }
9857
9857
  function Da(e) {
9858
- return ot(e) || e.lvl > e.r.lvl;
9858
+ return rt(e) || e.lvl > e.r.lvl;
9859
9859
  }
9860
9860
  function kf(e) {
9861
- return ot(e.r) ? [e.k, e.v] : kf(e.r);
9861
+ return rt(e.r) ? [e.k, e.v] : kf(e.r);
9862
9862
  }
9863
9863
  function Rf(e, t, n, r = co, o = co) {
9864
9864
  return { k: e, l: r, lvl: n, r: o, v: t };
@@ -9868,11 +9868,11 @@ function Yc(e) {
9868
9868
  }
9869
9869
  function If(e) {
9870
9870
  const { l: t } = e;
9871
- return !ot(t) && t.lvl === e.lvl ? jt(t, { r: jt(e, { l: t.r }) }) : e;
9871
+ return !rt(t) && t.lvl === e.lvl ? jt(t, { r: jt(e, { l: t.r }) }) : e;
9872
9872
  }
9873
9873
  function li(e) {
9874
9874
  const { lvl: t, r: n } = e;
9875
- return !ot(n) && !ot(n.r) && n.lvl === t && n.r.lvl === t ? jt(n, { l: jt(e, { r: n.l }), lvl: t + 1 }) : e;
9875
+ return !rt(n) && !rt(n.r) && n.lvl === t && n.r.lvl === t ? jt(n, { l: jt(e, { r: n.l }), lvl: t + 1 }) : e;
9876
9876
  }
9877
9877
  function E0(e) {
9878
9878
  return Cf(e, ({ k: t, v: n }) => ({ index: t, value: n }));
@@ -9917,7 +9917,7 @@ function Ln(e, t) {
9917
9917
  return Math.round(e.getBoundingClientRect()[t]);
9918
9918
  }
9919
9919
  function Gs(e) {
9920
- return !ot(e.groupOffsetTree);
9920
+ return !rt(e.groupOffsetTree);
9921
9921
  }
9922
9922
  function sl({ index: e }, t) {
9923
9923
  return t === e ? 0 : t < e ? -1 : 1;
@@ -9934,10 +9934,10 @@ function R0() {
9934
9934
  };
9935
9935
  }
9936
9936
  function I0(e, t) {
9937
- let n = ot(e) ? 0 : 1 / 0;
9937
+ let n = rt(e) ? 0 : 1 / 0;
9938
9938
  for (const r of t) {
9939
9939
  const { endIndex: o, size: s, startIndex: a } = r;
9940
- if (n = Math.min(n, a), ot(e)) {
9940
+ if (n = Math.min(n, a), rt(e)) {
9941
9941
  e = tn(e, 0, s);
9942
9942
  continue;
9943
9943
  }
@@ -9987,7 +9987,7 @@ function P0(e, [t, n, r, o]) {
9987
9987
  t.length > 0 && r("received item sizes", t, Jt.DEBUG);
9988
9988
  const s = e.sizeTree;
9989
9989
  let a = s, i = 0;
9990
- if (n.length > 0 && ot(s) && t.length === 2) {
9990
+ if (n.length > 0 && rt(s) && t.length === 2) {
9991
9991
  const m = t[0].size, p = t[1].size;
9992
9992
  a = n.reduce((v, g) => tn(tn(v, g, m), g + 1, p), a);
9993
9993
  } else
@@ -10073,7 +10073,7 @@ const D0 = {
10073
10073
  Ce((T) => T.length > 0),
10074
10074
  Le(g, p),
10075
10075
  de(([T, y, C]) => {
10076
- const N = T.reduce((j, $, O) => tn(j, $, po($, y.offsetTree, C) || O), Rr());
10076
+ const N = T.reduce((A, $, O) => tn(A, $, po($, y.offsetTree, C) || O), Rr());
10077
10077
  return {
10078
10078
  ...y,
10079
10079
  groupIndices: T,
@@ -10107,7 +10107,7 @@ const D0 = {
10107
10107
  xe(
10108
10108
  te(
10109
10109
  d,
10110
- Ce((T) => T !== void 0 && ot(bt(g).sizeTree)),
10110
+ Ce((T) => T !== void 0 && rt(bt(g).sizeTree)),
10111
10111
  de((T) => [{ endIndex: 0, size: T, startIndex: 0 }])
10112
10112
  ),
10113
10113
  n
@@ -10157,7 +10157,7 @@ const D0 = {
10157
10157
  s,
10158
10158
  Le(g),
10159
10159
  de(([T, y]) => {
10160
- const C = y.groupIndices.length > 0, N = [], j = y.lastSize;
10160
+ const C = y.groupIndices.length > 0, N = [], A = y.lastSize;
10161
10161
  if (C) {
10162
10162
  const $ = uo(y.sizeTree, 0);
10163
10163
  let O = 0, B = 0;
@@ -10169,7 +10169,7 @@ const D0 = {
10169
10169
  startIndex: _
10170
10170
  }), N.push({
10171
10171
  endIndex: _ + 1 + U - 1,
10172
- size: j,
10172
+ size: A,
10173
10173
  startIndex: _ + 1
10174
10174
  }), B++, O += U + 1;
10175
10175
  }
@@ -10205,7 +10205,7 @@ const D0 = {
10205
10205
  }),
10206
10206
  {
10207
10207
  prevIndex: 0,
10208
- prevSize: j,
10208
+ prevSize: A,
10209
10209
  ranges: []
10210
10210
  }
10211
10211
  ).ranges;
@@ -10229,14 +10229,14 @@ const D0 = {
10229
10229
  Le(g, p),
10230
10230
  de(([T, y, C]) => {
10231
10231
  if (y.groupIndices.length > 0) {
10232
- if (ot(y.sizeTree))
10232
+ if (rt(y.sizeTree))
10233
10233
  return y;
10234
10234
  let N = Rr();
10235
- const j = bt(x);
10235
+ const A = bt(x);
10236
10236
  let $ = 0, O = 0, B = 0;
10237
10237
  for (; $ < -T; ) {
10238
- B = j[O];
10239
- const G = j[O + 1] - B - 1;
10238
+ B = A[O];
10239
+ const G = A[O + 1] - B - 1;
10240
10240
  O++, $ += G + 1;
10241
10241
  }
10242
10242
  if (N = Yn(y.sizeTree).reduce((G, { k: _, v: U }) => tn(G, Math.max(0, _ + T), U), N), $ !== -T) {
@@ -10251,7 +10251,7 @@ const D0 = {
10251
10251
  ...ci(y.offsetTree, 0, N, C)
10252
10252
  };
10253
10253
  } else {
10254
- const N = Yn(y.sizeTree).reduce((j, { k: $, v: O }) => tn(j, Math.max(0, $ + T), O), Rr());
10254
+ const N = Yn(y.sizeTree).reduce((A, { k: $, v: O }) => tn(A, Math.max(0, $ + T), O), Rr());
10255
10255
  return {
10256
10256
  ...y,
10257
10257
  sizeTree: N,
@@ -10369,14 +10369,14 @@ const Po = Je(
10369
10369
  Le(e, s, o),
10370
10370
  de(
10371
10371
  ([
10372
- [E, T, y, C, N, j, $, O],
10372
+ [E, T, y, C, N, A, $, O],
10373
10373
  B,
10374
10374
  G,
10375
10375
  _
10376
10376
  ]) => {
10377
- const U = Mf(E), { align: Y, behavior: z, offset: A } = U, k = C - 1, K = Pf(U, T, k);
10378
- let J = po(K, T.offsetTree, B) + j;
10379
- Y === "end" ? (J += G + hn(T.sizeTree, K)[1] - y + _, K === k && (J += $)) : Y === "center" ? J += (G + hn(T.sizeTree, K)[1] - y + _) / 2 : J -= N, A && (J += A);
10377
+ const U = Mf(E), { align: Y, behavior: z, offset: j } = U, k = C - 1, K = Pf(U, T, k);
10378
+ let J = po(K, T.offsetTree, B) + A;
10379
+ Y === "end" ? (J += G + hn(T.sizeTree, K)[1] - y + _, K === k && (J += $)) : Y === "center" ? J += (G + hn(T.sizeTree, K)[1] - y + _) / 2 : J -= N, j && (J += j);
10380
10380
  const M = (q) => {
10381
10381
  S(), q ? (O("retrying to scroll to", { location: E }, Jt.DEBUG), Me(p, E)) : (Me(v, !0), O("list did not change, scroll successful", {}, Jt.DEBUG));
10382
10382
  };
@@ -10447,7 +10447,7 @@ const _o = Je(
10447
10447
  te(
10448
10448
  Nt(t, a),
10449
10449
  Le(i, n, e, c),
10450
- Ce(([[, d], f, { sizeTree: m }, p, v]) => d && (!ot(m) || tl(p)) && !f && !v),
10450
+ Ce(([[, d], f, { sizeTree: m }, p, v]) => d && (!rt(m) || tl(p)) && !f && !v),
10451
10451
  Le(l)
10452
10452
  ),
10453
10453
  ([, d]) => {
@@ -10503,12 +10503,12 @@ const ho = "up", so = "down", B0 = "none", z0 = {
10503
10503
  te(
10504
10504
  Nt(r, Se(s), Se(t), Se(e), Se(d)),
10505
10505
  Sn((w, [{ scrollHeight: S, scrollTop: E }, T, y, C, N]) => {
10506
- const j = E + T - S > -N, $ = {
10506
+ const A = E + T - S > -N, $ = {
10507
10507
  scrollHeight: S,
10508
10508
  scrollTop: E,
10509
10509
  viewportHeight: T
10510
10510
  };
10511
- if (j) {
10511
+ if (A) {
10512
10512
  let B, G;
10513
10513
  return E > w.state.scrollTop ? (B = "SCROLLED_DOWN", G = w.state.scrollTop - E) : (B = "SIZE_DECREASED", G = w.state.scrollTop - E || w.scrollTopDelta), {
10514
10514
  atBottom: !0,
@@ -10649,10 +10649,10 @@ const ll = Je(
10649
10649
  ]) => {
10650
10650
  const E = d - w, T = x + b, y = Math.max(m - E, 0);
10651
10651
  let C = Jc;
10652
- const N = Qc(S, bs), j = Qc(S, ys);
10653
- return p -= w, p += m + b, v += m + b, v -= w, p > d + T - N && (C = ho), v < d - y + f + j && (C = so), C !== Jc ? [
10652
+ const N = Qc(S, bs), A = Qc(S, ys);
10653
+ return p -= w, p += m + b, v += m + b, v -= w, p > d + T - N && (C = ho), v < d - y + f + A && (C = so), C !== Jc ? [
10654
10654
  Math.max(E - m - Zc(g, bs, C) - N, 0),
10655
- E - y - b + f + Zc(g, ys, C) + j
10655
+ E - y - b + f + Zc(g, ys, C) + A
10656
10656
  ] : null;
10657
10657
  }
10658
10658
  ),
@@ -10786,8 +10786,8 @@ const hr = Je(
10786
10786
  Se(n),
10787
10787
  e
10788
10788
  ),
10789
- Ce(([y, C, , N, , , , , , , j]) => {
10790
- const $ = j && j.length !== N;
10789
+ Ce(([y, C, , N, , , , , , , A]) => {
10790
+ const $ = A && A.length !== N;
10791
10791
  return y && !C && !$;
10792
10792
  }),
10793
10793
  de(
@@ -10796,7 +10796,7 @@ const hr = Je(
10796
10796
  ,
10797
10797
  [y, C],
10798
10798
  N,
10799
- j,
10799
+ A,
10800
10800
  $,
10801
10801
  O,
10802
10802
  B,
@@ -10804,12 +10804,12 @@ const hr = Je(
10804
10804
  _,
10805
10805
  U
10806
10806
  ]) => {
10807
- const Y = j, { offsetTree: z, sizeTree: A } = Y, k = bt(x);
10807
+ const Y = A, { offsetTree: z, sizeTree: j } = Y, k = bt(x);
10808
10808
  if (N === 0)
10809
10809
  return { ...La, totalCount: N };
10810
10810
  if (y === 0 && C === 0)
10811
- return k === 0 ? { ...La, totalCount: N } : Df(k, $, j, G, _, U || []);
10812
- if (ot(A))
10811
+ return k === 0 ? { ...La, totalCount: N } : Df(k, $, A, G, _, U || []);
10812
+ if (rt(j))
10813
10813
  return k > 0 ? null : ds(
10814
10814
  U0(il($, N), Y, U),
10815
10815
  [],
@@ -10822,7 +10822,7 @@ const hr = Je(
10822
10822
  if (B.length > 0) {
10823
10823
  const L = B[0], X = B[B.length - 1];
10824
10824
  let R = 0;
10825
- for (const P of qs(A, L, X)) {
10825
+ for (const P of qs(j, L, X)) {
10826
10826
  const H = P.value, Z = Math.max(P.start, L), oe = Math.min(P.end, X);
10827
10827
  for (let le = Z; le <= oe; le++)
10828
10828
  K.push({ data: U == null ? void 0 : U[le], index: le, offset: R, size: H }), R += H;
@@ -10983,7 +10983,7 @@ const hr = Je(
10983
10983
  Le(t, l, n, s, o, r, i),
10984
10984
  Le(e),
10985
10985
  de(([[f, m, p, v, g, x, b, w], S]) => {
10986
- const { align: E, behavior: T, calculateViewLocation: y = V0, done: C, ...N } = f, j = Pf(f, m, v - 1), $ = po(j, m.offsetTree, S) + g + x, O = $ + hn(m.sizeTree, j)[1], B = w + x, G = w + p - b, _ = y({
10986
+ const { align: E, behavior: T, calculateViewLocation: y = V0, done: C, ...N } = f, A = Pf(f, m, v - 1), $ = po(A, m.offsetTree, S) + g + x, O = $ + hn(m.sizeTree, A)[1], B = w + x, G = w + p - b, _ = y({
10987
10987
  itemBottom: O,
10988
10988
  itemTop: $,
10989
10989
  locationParams: { align: E, behavior: T, ...N },
@@ -11039,8 +11039,8 @@ const K0 = (e, t) => typeof e == "function" ? tu(e(t)) : t && tu(e), q0 = Je(
11039
11039
  te(
11040
11040
  Nt(te(Se(t), ar(1)), l),
11041
11041
  Le(Se(v), s, i, f),
11042
- de(([[T, y], C, N, j, $]) => {
11043
- let O = y && j, B = "auto";
11042
+ de(([[T, y], C, N, A, $]) => {
11043
+ let O = y && A, B = "auto";
11044
11044
  return O && (B = K0(C, N || $), O = O && !!B), { followOutputBehavior: B, shouldFollow: O, totalCount: T };
11045
11045
  }),
11046
11046
  Ce(({ shouldFollow: T }) => T)
@@ -11095,7 +11095,7 @@ const K0 = (e, t) => typeof e == "function" ? tu(e(t)) : t && tu(e), q0 = Je(
11095
11095
  te(
11096
11096
  Nt(te(E, ar(1)), l),
11097
11097
  Le(Se(S), i, f, m),
11098
- de(([[T, y], C, N, j, $]) => y && N && (C == null ? void 0 : C({ context: $, totalCount: T, scrollingInProgress: j }))),
11098
+ de(([[T, y], C, N, A, $]) => y && N && (C == null ? void 0 : C({ context: $, totalCount: T, scrollingInProgress: A }))),
11099
11099
  Ce((T) => !!T),
11100
11100
  Nn(0)
11101
11101
  ),
@@ -11290,9 +11290,9 @@ const Q0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
11290
11290
  Le(a),
11291
11291
  Sn(
11292
11292
  ([, b, w, S], [{ bottom: E, items: T, offsetBottom: y, totalCount: C }, N]) => {
11293
- const j = E + y;
11293
+ const A = E + y;
11294
11294
  let $ = 0;
11295
- return w === C && b.length > 0 && T.length > 0 && (T[0].originalIndex === 0 && b[0].originalIndex === 0 || ($ = j - S, $ !== 0 && ($ += N))), [$, T, C, j];
11295
+ return w === C && b.length > 0 && T.length > 0 && (T[0].originalIndex === 0 && b[0].originalIndex === 0 || ($ = A - S, $ !== 0 && ($ += N))), [$, T, C, A];
11296
11296
  },
11297
11297
  [0, [], 0, 0]
11298
11298
  ),
@@ -11334,11 +11334,11 @@ const Q0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
11334
11334
  {
11335
11335
  let C = 0;
11336
11336
  const N = uo(E, 0);
11337
- let j = 0, $ = 0;
11338
- for (; j < b; ) {
11339
- j++, C += N;
11337
+ let A = 0, $ = 0;
11338
+ for (; A < b; ) {
11339
+ A++, C += N;
11340
11340
  let O = w.length === $ + 1 ? 1 / 0 : w[$ + 1] - w[$] - 1;
11341
- j + O > b && (C -= N, O = b - j + 1), j += O, C += y(O), $++;
11341
+ A + O > b && (C -= N, O = b - A + 1), A += O, C += y(O), $++;
11342
11342
  }
11343
11343
  return C;
11344
11344
  }
@@ -11418,10 +11418,10 @@ const Q0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
11418
11418
  y,
11419
11419
  { topItemCount: C },
11420
11420
  { groupCounts: N },
11421
- j
11422
- ]) => (xe(E.rangeChanged, j.scrollSeekRangeChanged), xe(
11421
+ A
11422
+ ]) => (xe(E.rangeChanged, A.scrollSeekRangeChanged), xe(
11423
11423
  te(
11424
- j.windowViewportRect,
11424
+ A.windowViewportRect,
11425
11425
  de(($) => $.visibleHeight)
11426
11426
  ),
11427
11427
  g.viewportHeight
@@ -11451,7 +11451,7 @@ const Q0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
11451
11451
  // exported from stateFlagsSystem
11452
11452
  ...E,
11453
11453
  // the bag of IO from featureGroup1System
11454
- ...j,
11454
+ ...A,
11455
11455
  ...g,
11456
11456
  sizes: l,
11457
11457
  ...x
@@ -11668,7 +11668,7 @@ const oS = /* @__PURE__ */ Je(() => {
11668
11668
  fl("deviation", (_) => {
11669
11669
  b !== _ && w(_);
11670
11670
  });
11671
- const S = Re("EmptyPlaceholder"), E = Re("ScrollSeekPlaceholder") || aS, T = Re("ListComponent"), y = Re("ItemComponent"), C = Re("GroupComponent"), N = Re("computeItemKey"), j = Re("isSeeking"), $ = Re("groupIndices").length > 0, O = Re("alignToBottom"), B = Re("initialItemFinalLocationReached"), G = e ? {} : {
11671
+ const S = Re("EmptyPlaceholder"), E = Re("ScrollSeekPlaceholder") || aS, T = Re("ListComponent"), y = Re("ItemComponent"), C = Re("GroupComponent"), N = Re("computeItemKey"), A = Re("isSeeking"), $ = Re("groupIndices").length > 0, O = Re("alignToBottom"), B = Re("initialItemFinalLocationReached"), G = e ? {} : {
11672
11672
  boxSizing: "border-box",
11673
11673
  ...g ? {
11674
11674
  display: "inline-block",
@@ -11693,7 +11693,7 @@ const oS = /* @__PURE__ */ Je(() => {
11693
11693
  style: G,
11694
11694
  children: (e ? t.topItems : t.items).map((_) => {
11695
11695
  const U = _.originalIndex, Y = N(U + t.firstItemIndex, _.data, c);
11696
- return j ? /* @__PURE__ */ es(
11696
+ return A ? /* @__PURE__ */ es(
11697
11697
  E,
11698
11698
  {
11699
11699
  ...$t(E, c),
@@ -12011,7 +12011,7 @@ const RS = /* @__PURE__ */ Je(
12011
12011
  { customScrollParent: x, useWindowScroll: b, windowScrollContainerState: w, windowScrollTo: S, windowViewportRect: E },
12012
12012
  T
12013
12013
  ]) => {
12014
- const y = se(0), C = se(0), N = se(ou), j = se({ height: 0, width: 0 }), $ = se({ height: 0, width: 0 }), O = Ue(), B = Ue(), G = se(0), _ = se(null), U = se({ column: 0, row: 0 }), Y = Ue(), z = Ue(), A = se(!1), k = se(0), K = se(!0), J = se(!1), M = se(!1);
12014
+ const y = se(0), C = se(0), N = se(ou), A = se({ height: 0, width: 0 }), $ = se({ height: 0, width: 0 }), O = Ue(), B = Ue(), G = se(0), _ = se(null), U = se({ column: 0, row: 0 }), Y = Ue(), z = Ue(), j = se(!1), k = se(0), K = se(!0), J = se(!1), M = se(!1);
12015
12015
  et(
12016
12016
  te(
12017
12017
  v,
@@ -12023,7 +12023,7 @@ const RS = /* @__PURE__ */ Je(
12023
12023
  }
12024
12024
  ), et(
12025
12025
  te(
12026
- Nt(v, K, $, j, k, J),
12026
+ Nt(v, K, $, A, k, J),
12027
12027
  Ce(([P, H, Z, oe, , le]) => P && !H && Z.height !== 0 && oe.height !== 0 && !le)
12028
12028
  ),
12029
12029
  ([, , , , P]) => {
@@ -12047,20 +12047,20 @@ const RS = /* @__PURE__ */ Je(
12047
12047
  Ce(([, P]) => P != null)
12048
12048
  ),
12049
12049
  ([, P]) => {
12050
- P && (Me(j, P.viewport), Me($, P.item), Me(U, P.gap), P.scrollTop > 0 && (Me(A, !0), pn(te(c, ar(1)), (H) => {
12051
- Me(A, !1);
12050
+ P && (Me(A, P.viewport), Me($, P.item), Me(U, P.gap), P.scrollTop > 0 && (Me(j, !0), pn(te(c, ar(1)), (H) => {
12051
+ Me(j, !1);
12052
12052
  }), Me(l, { top: P.scrollTop })));
12053
12053
  }
12054
12054
  ), xe(
12055
12055
  te(
12056
- j,
12056
+ A,
12057
12057
  de(({ height: P }) => P)
12058
12058
  ),
12059
12059
  f
12060
12060
  ), xe(
12061
12061
  te(
12062
12062
  Nt(
12063
- Se(j, Xo),
12063
+ Se(A, Xo),
12064
12064
  Se($, Xo),
12065
12065
  Se(U, (P, H) => P && P.column === H.column && P.row === H.row),
12066
12066
  Se(c)
@@ -12080,10 +12080,10 @@ const RS = /* @__PURE__ */ Je(
12080
12080
  r,
12081
12081
  Se(U, kS),
12082
12082
  Se($, Xo),
12083
- Se(j, Xo),
12083
+ Se(A, Xo),
12084
12084
  Se(_),
12085
12085
  Se(C),
12086
- Se(A),
12086
+ Se(j),
12087
12087
  Se(K),
12088
12088
  Se(k)
12089
12089
  ),
@@ -12126,7 +12126,7 @@ const RS = /* @__PURE__ */ Je(
12126
12126
  y
12127
12127
  ), xe(
12128
12128
  te(
12129
- Nt(j, $, N, U),
12129
+ Nt(A, $, N, U),
12130
12130
  Ce(([P, H, { items: Z }]) => Z.length > 0 && H.height !== 0 && P.height !== 0),
12131
12131
  de(([P, H, { items: Z }, oe]) => {
12132
12132
  const { bottom: le, top: Ee } = lu(P, oe, H, Z);
@@ -12167,7 +12167,7 @@ const RS = /* @__PURE__ */ Je(
12167
12167
  ), X = nn(
12168
12168
  te(
12169
12169
  Se(N),
12170
- Le(A),
12170
+ Le(j),
12171
12171
  Ce(([{ items: P }, H]) => P.length > 0 && !H),
12172
12172
  de(([{ items: P }]) => ({
12173
12173
  endIndex: P[P.length - 1].index,
@@ -12180,7 +12180,7 @@ const RS = /* @__PURE__ */ Je(
12180
12180
  xe(X, p.scrollSeekRangeChanged), xe(
12181
12181
  te(
12182
12182
  O,
12183
- Le(j, $, y, U),
12183
+ Le(A, $, y, U),
12184
12184
  de(([P, H, Z, oe, le]) => {
12185
12185
  const Ee = Mf(P), { align: ye, behavior: Pe, offset: qe } = Ee;
12186
12186
  let ze = Ee.index;
@@ -12203,7 +12203,7 @@ const RS = /* @__PURE__ */ Je(
12203
12203
  E,
12204
12204
  de((P) => ({ height: P.visibleHeight, width: P.visibleWidth }))
12205
12205
  ),
12206
- j
12206
+ A
12207
12207
  ), {
12208
12208
  customScrollParent: x,
12209
12209
  // input
@@ -12226,7 +12226,7 @@ const RS = /* @__PURE__ */ Je(
12226
12226
  smoothScrollTargetReached: d,
12227
12227
  totalCount: y,
12228
12228
  useWindowScroll: b,
12229
- viewportDimensions: j,
12229
+ viewportDimensions: A,
12230
12230
  windowScrollContainerState: w,
12231
12231
  windowScrollTo: S,
12232
12232
  windowViewportRect: E,
@@ -12242,7 +12242,7 @@ const RS = /* @__PURE__ */ Je(
12242
12242
  rangeChanged: X,
12243
12243
  startReached: L,
12244
12244
  stateChanged: Y,
12245
- stateRestoreInProgress: A,
12245
+ stateRestoreInProgress: j,
12246
12246
  ...T
12247
12247
  };
12248
12248
  },
@@ -12475,7 +12475,7 @@ const $S = {
12475
12475
  getInterruptOptions: x,
12476
12476
  toolConfig: b
12477
12477
  }) {
12478
- const w = Qf(t, n), S = t.role === "default_message", y = !!t.__syntheticStreaming || o === t.id && t.role === "assistant", C = p ?? $S, N = !S && "checkpointId" in t ? t.checkpointId ?? null : null, { attemptCount: j, attemptIndex: $, attempts: O } = Be(
12478
+ const w = Qf(t, n), S = t.role === "default_message", y = !!t.__syntheticStreaming || o === t.id && t.role === "assistant", C = p ?? $S, N = !S && "checkpointId" in t ? t.checkpointId ?? null : null, { attemptCount: A, attemptIndex: $, attempts: O } = Be(
12479
12479
  () => fx(t.id, N, C),
12480
12480
  [t.id, N, C]
12481
12481
  ), B = g == null ? void 0 : g(t);
@@ -12506,7 +12506,7 @@ const $S = {
12506
12506
  onCancelEdit: f,
12507
12507
  getInterruptOptions: x,
12508
12508
  showToolMessages: m,
12509
- attemptCount: j,
12509
+ attemptCount: A,
12510
12510
  attemptIndex: $,
12511
12511
  attemptMetas: O,
12512
12512
  onSelectCheckpoint: v,
@@ -12544,7 +12544,7 @@ const tp = F.forwardRef(({
12544
12544
  onSelectCheckpoint: y,
12545
12545
  createSyntheticThinkingMessage: C = !0,
12546
12546
  forceSyntheticThinking: N = !1,
12547
- getMessageCustomStyles: j,
12547
+ getMessageCustomStyles: A,
12548
12548
  getInterruptOptions: $
12549
12549
  }, O) => {
12550
12550
  const B = Ae(null), G = Ae(null), _ = Ae(!1), U = Ae(!1), Y = e, z = Be(() => {
@@ -12559,7 +12559,7 @@ const tp = F.forwardRef(({
12559
12559
  __syntheticStreaming: !0
12560
12560
  }
12561
12561
  ] : Y;
12562
- }, [Y, t, n, C, N]), A = Be(() => w ? z : z.filter((R) => (R == null ? void 0 : R.role) !== "tool"), [z, w]), k = ce((R) => {
12562
+ }, [Y, t, n, C, N]), j = Be(() => w ? z : z.filter((R) => (R == null ? void 0 : R.role) !== "tool"), [z, w]), k = ce((R) => {
12563
12563
  x && x(!R), b && b(R);
12564
12564
  }, [x, b]), K = Be(() => {
12565
12565
  if (i)
@@ -12576,15 +12576,15 @@ const tp = F.forwardRef(({
12576
12576
  }, [i]), J = Be(() => !v || g ? !1 : "auto", [v, g]), M = Be(() => {
12577
12577
  if (typeof p != "string") return null;
12578
12578
  const R = p.trim();
12579
- return !R || A && A.length > 0 ? null : {
12579
+ return !R || j && j.length > 0 ? null : {
12580
12580
  id: "default-message",
12581
12581
  role: "default_message",
12582
12582
  content: R,
12583
12583
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
12584
12584
  };
12585
- }, [p, A]), q = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), D = () => {
12585
+ }, [p, j]), q = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), D = () => {
12586
12586
  if (M) {
12587
- const R = j == null ? void 0 : j(M);
12587
+ const R = A == null ? void 0 : A(M);
12588
12588
  return /* @__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(
12589
12589
  el,
12590
12590
  {
@@ -12607,7 +12607,7 @@ const tp = F.forwardRef(({
12607
12607
  ) }) });
12608
12608
  }
12609
12609
  return /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: p ?? "No messages yet. Start a conversation!" });
12610
- }, L = A.length, X = L > 0;
12610
+ }, L = j.length, X = L > 0;
12611
12611
  return Xe(() => {
12612
12612
  var R, P;
12613
12613
  if (L === 0) {
@@ -12615,17 +12615,17 @@ const tp = F.forwardRef(({
12615
12615
  return;
12616
12616
  }
12617
12617
  if (!U.current)
12618
- if (U.current = !0, B.current && A.length > 0) {
12619
- const H = A.length - 1;
12618
+ if (U.current = !0, B.current && j.length > 0) {
12619
+ const H = j.length - 1;
12620
12620
  (P = (R = B.current).scrollToIndex) == null || P.call(R, { index: H, align: "end", behavior: "auto" });
12621
12621
  } else G.current && (G.current.scrollTop = G.current.scrollHeight);
12622
- }, [L, A.length]), Fg(
12622
+ }, [L, j.length]), Fg(
12623
12623
  O,
12624
12624
  () => ({
12625
12625
  scrollToLatest: () => {
12626
12626
  var R, P;
12627
- if (B.current && A.length > 0) {
12628
- const H = A.length - 1;
12627
+ if (B.current && j.length > 0) {
12628
+ const H = j.length - 1;
12629
12629
  (P = (R = B.current).scrollToIndex) == null || P.call(R, {
12630
12630
  index: H,
12631
12631
  align: "end",
@@ -12635,14 +12635,14 @@ const tp = F.forwardRef(({
12635
12635
  },
12636
12636
  scrollToTop: () => {
12637
12637
  var R, P;
12638
- B.current && A.length > 0 ? (P = (R = B.current).scrollToIndex) == null || P.call(R, {
12638
+ B.current && j.length > 0 ? (P = (R = B.current).scrollToIndex) == null || P.call(R, {
12639
12639
  index: 0,
12640
12640
  align: "start",
12641
12641
  behavior: "auto"
12642
12642
  }) : G.current && (G.current.scrollTop = 0);
12643
12643
  }
12644
12644
  }),
12645
- [A]
12645
+ [j]
12646
12646
  ), /* @__PURE__ */ u.jsx("div", { className: q, style: m, children: /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: X ? /* @__PURE__ */ u.jsx(
12647
12647
  SS,
12648
12648
  {
@@ -12652,7 +12652,7 @@ const tp = F.forwardRef(({
12652
12652
  scrollerRef: (R) => {
12653
12653
  G.current = R instanceof HTMLDivElement ? R : null;
12654
12654
  },
12655
- data: A,
12655
+ data: j,
12656
12656
  followOutput: J,
12657
12657
  overscan: 200,
12658
12658
  increaseViewportBy: { top: 100, bottom: 200 },
@@ -12683,7 +12683,7 @@ const tp = F.forwardRef(({
12683
12683
  checkpointIndex: E,
12684
12684
  activeCheckpointId: T,
12685
12685
  onSelectCheckpoint: y,
12686
- getMessageCustomStyles: j,
12686
+ getMessageCustomStyles: A,
12687
12687
  getInterruptOptions: $
12688
12688
  }
12689
12689
  )
@@ -12769,11 +12769,11 @@ function FS({
12769
12769
  message: e,
12770
12770
  toolPayload: c,
12771
12771
  isStreaming: n
12772
- })) ?? null, j = y ?? E;
12772
+ })) ?? null, A = y ?? E;
12773
12773
  return /* @__PURE__ */ u.jsxs("div", { className: "space-y-2", children: [
12774
12774
  a && (N ?? /* @__PURE__ */ u.jsx(Gy, { artifact: a, idx: 0 })),
12775
12775
  /* @__PURE__ */ u.jsx(Xy, { message: e, isStreaming: n }),
12776
- T ? j : null
12776
+ T ? A : null
12777
12777
  ] });
12778
12778
  }
12779
12779
  function Xs(e) {
@@ -13105,7 +13105,7 @@ const QS = (e) => ({
13105
13105
  }, p = ml(o), v = hl(p), g = await a.getDimensions(c), x = p === "y", b = x ? "top" : "left", w = x ? "bottom" : "right", S = x ? "clientHeight" : "clientWidth", E = s.reference[v] + s.reference[p] - m[p] - s.floating[v], T = m[p] - s.reference[p], y = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(c));
13106
13106
  let C = y ? y[S] : 0;
13107
13107
  (!C || !await (a.isElement == null ? void 0 : a.isElement(y))) && (C = i.floating[S] || s.floating[v]);
13108
- const N = E / 2 - T / 2, j = C / 2 - g[v] / 2 - 1, $ = $n(f[b], j), O = $n(f[w], j), B = $, G = C - g[v] - O, _ = C / 2 - g[v] / 2 + N, U = di(B, _, G), Y = !l.arrow && Wr(o) != null && _ !== U && s.reference[v] / 2 - (_ < B ? $ : O) - g[v] / 2 < 0, z = Y ? _ < B ? _ - B : _ - G : 0;
13108
+ const N = E / 2 - T / 2, A = C / 2 - g[v] / 2 - 1, $ = $n(f[b], A), O = $n(f[w], A), B = $, G = C - g[v] - O, _ = C / 2 - g[v] / 2 + N, U = di(B, _, G), Y = !l.arrow && Wr(o) != null && _ !== U && s.reference[v] / 2 - (_ < B ? $ : O) - g[v] / 2 < 0, z = Y ? _ < B ? _ - B : _ - G : 0;
13109
13109
  return {
13110
13110
  [p]: m[p] + z,
13111
13111
  data: {
@@ -13144,21 +13144,21 @@ const QS = (e) => ({
13144
13144
  return {};
13145
13145
  const b = Pn(o), w = Tn(i), S = Pn(i) === i, E = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), T = m || (S || !g ? [Cs(i)] : KS(i)), y = v !== "none";
13146
13146
  !m && y && T.push(...XS(i, g, v, E));
13147
- const C = [i, ...T], N = await mo(t, x), j = [];
13147
+ const C = [i, ...T], N = await mo(t, x), A = [];
13148
13148
  let $ = ((r = s.flip) == null ? void 0 : r.overflows) || [];
13149
- if (d && j.push(N[b]), f) {
13149
+ if (d && A.push(N[b]), f) {
13150
13150
  const _ = VS(o, a, E);
13151
- j.push(N[_[0]], N[_[1]]);
13151
+ A.push(N[_[0]], N[_[1]]);
13152
13152
  }
13153
13153
  if ($ = [...$, {
13154
13154
  placement: o,
13155
- overflows: j
13156
- }], !j.every((_) => _ <= 0)) {
13155
+ overflows: A
13156
+ }], !A.every((_) => _ <= 0)) {
13157
13157
  var O, B;
13158
13158
  const _ = (((O = s.flip) == null ? void 0 : O.index) || 0) + 1, U = C[_];
13159
13159
  if (U && (!(f === "alignment" ? w !== Tn(U) : !1) || // We leave the current main axis only if every placement on that axis
13160
13160
  // overflows the main axis.
13161
- $.every((A) => Tn(A.placement) === w ? A.overflows[0] > 0 : !0)))
13161
+ $.every((j) => Tn(j.placement) === w ? j.overflows[0] > 0 : !0)))
13162
13162
  return {
13163
13163
  data: {
13164
13164
  index: _,
@@ -13168,20 +13168,20 @@ const QS = (e) => ({
13168
13168
  placement: U
13169
13169
  }
13170
13170
  };
13171
- let Y = (B = $.filter((z) => z.overflows[0] <= 0).sort((z, A) => z.overflows[1] - A.overflows[1])[0]) == null ? void 0 : B.placement;
13171
+ let Y = (B = $.filter((z) => z.overflows[0] <= 0).sort((z, j) => z.overflows[1] - j.overflows[1])[0]) == null ? void 0 : B.placement;
13172
13172
  if (!Y)
13173
13173
  switch (p) {
13174
13174
  case "bestFit": {
13175
13175
  var G;
13176
- const z = (G = $.filter((A) => {
13176
+ const z = (G = $.filter((j) => {
13177
13177
  if (y) {
13178
- const k = Tn(A.placement);
13178
+ const k = Tn(j.placement);
13179
13179
  return k === w || // Create a bias to the `y` side axis due to horizontal
13180
13180
  // reading directions favoring greater width.
13181
13181
  k === "y";
13182
13182
  }
13183
13183
  return !0;
13184
- }).map((A) => [A.placement, A.overflows.filter((k) => k > 0).reduce((k, K) => k + K, 0)]).sort((A, k) => A[1] - k[1])[0]) == null ? void 0 : G[0];
13184
+ }).map((j) => [j.placement, j.overflows.filter((k) => k > 0).reduce((k, K) => k + K, 0)]).sort((j, k) => j[1] - k[1])[0]) == null ? void 0 : G[0];
13185
13185
  z && (Y = z);
13186
13186
  break;
13187
13187
  }
@@ -13432,8 +13432,8 @@ const rT = function(e) {
13432
13432
  availableWidth: N,
13433
13433
  availableHeight: C
13434
13434
  });
13435
- const j = await a.getDimensions(i.floating);
13436
- return v !== j.width || g !== j.height ? {
13435
+ const A = await a.getDimensions(i.floating);
13436
+ return v !== A.width || g !== A.height ? {
13437
13437
  reset: {
13438
13438
  rects: !0
13439
13439
  }
@@ -14009,19 +14009,19 @@ function HT(e) {
14009
14009
  isPositioned: !1
14010
14010
  }), [m, p] = h.useState(r);
14011
14011
  ks(m, r) || p(r);
14012
- const [v, g] = h.useState(null), [x, b] = h.useState(null), w = h.useCallback((A) => {
14013
- A !== y.current && (y.current = A, g(A));
14014
- }, []), S = h.useCallback((A) => {
14015
- A !== C.current && (C.current = A, b(A));
14016
- }, []), E = s || v, T = a || x, y = h.useRef(null), C = h.useRef(null), N = h.useRef(d), j = l != null, $ = Ha(l), O = Ha(o), B = Ha(c), G = h.useCallback(() => {
14012
+ const [v, g] = h.useState(null), [x, b] = h.useState(null), w = h.useCallback((j) => {
14013
+ j !== y.current && (y.current = j, g(j));
14014
+ }, []), S = h.useCallback((j) => {
14015
+ j !== C.current && (C.current = j, b(j));
14016
+ }, []), E = s || v, T = a || x, y = h.useRef(null), C = h.useRef(null), N = h.useRef(d), A = l != null, $ = Ha(l), O = Ha(o), B = Ha(c), G = h.useCallback(() => {
14017
14017
  if (!y.current || !C.current)
14018
14018
  return;
14019
- const A = {
14019
+ const j = {
14020
14020
  placement: t,
14021
14021
  strategy: n,
14022
14022
  middleware: m
14023
14023
  };
14024
- O.current && (A.platform = O.current), FT(y.current, C.current, A).then((k) => {
14024
+ O.current && (j.platform = O.current), FT(y.current, C.current, j).then((k) => {
14025
14025
  const K = {
14026
14026
  ...k,
14027
14027
  // The floating element's position may be recomputed while it's closed
@@ -14036,8 +14036,8 @@ function HT(e) {
14036
14036
  });
14037
14037
  }, [m, t, n, O, B]);
14038
14038
  fs(() => {
14039
- c === !1 && N.current.isPositioned && (N.current.isPositioned = !1, f((A) => ({
14040
- ...A,
14039
+ c === !1 && N.current.isPositioned && (N.current.isPositioned = !1, f((j) => ({
14040
+ ...j,
14041
14041
  isPositioned: !1
14042
14042
  })));
14043
14043
  }, [c]);
@@ -14050,7 +14050,7 @@ function HT(e) {
14050
14050
  return $.current(E, T, G);
14051
14051
  G();
14052
14052
  }
14053
- }, [E, T, G, $, j]);
14053
+ }, [E, T, G, $, A]);
14054
14054
  const U = h.useMemo(() => ({
14055
14055
  reference: y,
14056
14056
  floating: C,
@@ -14060,16 +14060,16 @@ function HT(e) {
14060
14060
  reference: E,
14061
14061
  floating: T
14062
14062
  }), [E, T]), z = h.useMemo(() => {
14063
- const A = {
14063
+ const j = {
14064
14064
  position: n,
14065
14065
  left: 0,
14066
14066
  top: 0
14067
14067
  };
14068
14068
  if (!Y.floating)
14069
- return A;
14069
+ return j;
14070
14070
  const k = bu(Y.floating, d.x), K = bu(Y.floating, d.y);
14071
14071
  return i ? {
14072
- ...A,
14072
+ ...j,
14073
14073
  transform: "translate(" + k + "px, " + K + "px)",
14074
14074
  ...fp(Y.floating) >= 1.5 && {
14075
14075
  willChange: "transform"
@@ -14203,15 +14203,15 @@ var bl = "PopperContent", [eC, tC] = mp(bl), bp = h.forwardRef(
14203
14203
  updatePositionStrategy: p = "optimized",
14204
14204
  onPlaced: v,
14205
14205
  ...g
14206
- } = e, x = gp(bl, n), [b, w] = h.useState(null), S = Oe(t, (Ee) => w(Ee)), [E, T] = h.useState(null), y = hp(E), C = (y == null ? void 0 : y.width) ?? 0, N = (y == null ? void 0 : y.height) ?? 0, j = r + (s !== "center" ? "-" + s : ""), $ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, O = Array.isArray(c) ? c : [c], B = O.length > 0, G = {
14206
+ } = e, x = gp(bl, n), [b, w] = h.useState(null), S = Oe(t, (Ee) => w(Ee)), [E, T] = h.useState(null), y = hp(E), C = (y == null ? void 0 : y.width) ?? 0, N = (y == null ? void 0 : y.height) ?? 0, A = r + (s !== "center" ? "-" + s : ""), $ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, O = Array.isArray(c) ? c : [c], B = O.length > 0, G = {
14207
14207
  padding: $,
14208
14208
  boundary: O.filter(rC),
14209
14209
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
14210
14210
  altBoundary: B
14211
- }, { refs: _, floatingStyles: U, placement: Y, isPositioned: z, middlewareData: A } = HT({
14211
+ }, { refs: _, floatingStyles: U, placement: Y, isPositioned: z, middlewareData: j } = HT({
14212
14212
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
14213
14213
  strategy: "fixed",
14214
- placement: j,
14214
+ placement: A,
14215
14215
  whileElementsMounted: (...Ee) => PT(...Ee, {
14216
14216
  animationFrame: p === "always"
14217
14217
  }),
@@ -14242,7 +14242,7 @@ var bl = "PopperContent", [eC, tC] = mp(bl), bp = h.forwardRef(
14242
14242
  Pt(() => {
14243
14243
  z && (J == null || J());
14244
14244
  }, [z, J]);
14245
- const M = (R = A.arrow) == null ? void 0 : R.x, q = (P = A.arrow) == null ? void 0 : P.y, D = ((H = A.arrow) == null ? void 0 : H.centerOffset) !== 0, [L, X] = h.useState();
14245
+ const M = (R = j.arrow) == null ? void 0 : R.x, q = (P = j.arrow) == null ? void 0 : P.y, D = ((H = j.arrow) == null ? void 0 : H.centerOffset) !== 0, [L, X] = h.useState();
14246
14246
  return Pt(() => {
14247
14247
  b && X(window.getComputedStyle(b).zIndex);
14248
14248
  }, [b]), /* @__PURE__ */ u.jsx(
@@ -14257,13 +14257,13 @@ var bl = "PopperContent", [eC, tC] = mp(bl), bp = h.forwardRef(
14257
14257
  minWidth: "max-content",
14258
14258
  zIndex: L,
14259
14259
  "--radix-popper-transform-origin": [
14260
- (Z = A.transformOrigin) == null ? void 0 : Z.x,
14261
- (oe = A.transformOrigin) == null ? void 0 : oe.y
14260
+ (Z = j.transformOrigin) == null ? void 0 : Z.x,
14261
+ (oe = j.transformOrigin) == null ? void 0 : oe.y
14262
14262
  ].join(" "),
14263
14263
  // hide the content if using the hide middleware and should be hidden
14264
14264
  // set visibility to hidden and disable pointer events so the UI behaves
14265
14265
  // as if the PopperContent isn't there at all
14266
- ...((le = A.hide) == null ? void 0 : le.referenceHidden) && {
14266
+ ...((le = j.hide) == null ? void 0 : le.referenceHidden) && {
14267
14267
  visibility: "hidden",
14268
14268
  pointerEvents: "none"
14269
14269
  }
@@ -14430,8 +14430,8 @@ var uC = h.forwardRef((e, t) => {
14430
14430
  T.current = !0;
14431
14431
  }),
14432
14432
  onFocus: ie(e.onFocus, (N) => {
14433
- const j = !T.current;
14434
- if (N.target === N.currentTarget && j && !b) {
14433
+ const A = !T.current;
14434
+ if (N.target === N.currentTarget && A && !b) {
14435
14435
  const $ = new CustomEvent(Ua, sC);
14436
14436
  if (N.currentTarget.dispatchEvent($), !$.defaultPrevented) {
14437
14437
  const O = E().filter((Y) => Y.focusable), B = O.find((Y) => Y.active), G = O.find((Y) => Y.id === g), U = [B, G, ...O].filter(
@@ -14646,15 +14646,15 @@ var ln = "MenuContent", [RC, Rl] = mr(ln), Dp = h.forwardRef(
14646
14646
  onDismiss: p,
14647
14647
  disableOutsideScroll: v,
14648
14648
  ...g
14649
- } = e, x = gr(ln, n), b = $o(ln, n), w = na(n), S = Pp(n), E = yC(n), [T, y] = h.useState(null), C = h.useRef(null), N = Oe(t, C, x.onContentChange), j = h.useRef(0), $ = h.useRef(""), O = h.useRef(0), B = h.useRef(null), G = h.useRef("right"), _ = h.useRef(0), U = v ? Hs : h.Fragment, Y = v ? { as: AC, allowPinchZoom: !0 } : void 0, z = (k) => {
14649
+ } = e, x = gr(ln, n), b = $o(ln, n), w = na(n), S = Pp(n), E = yC(n), [T, y] = h.useState(null), C = h.useRef(null), N = Oe(t, C, x.onContentChange), A = h.useRef(0), $ = h.useRef(""), O = h.useRef(0), B = h.useRef(null), G = h.useRef("right"), _ = h.useRef(0), U = v ? Hs : h.Fragment, Y = v ? { as: AC, allowPinchZoom: !0 } : void 0, z = (k) => {
14650
14650
  var R, P;
14651
14651
  const K = $.current + k, J = E().filter((H) => !H.disabled), M = document.activeElement, q = (R = J.find((H) => H.ref.current === M)) == null ? void 0 : R.textValue, D = J.map((H) => H.textValue), L = HC(D, K, q), X = (P = J.find((H) => H.textValue === L)) == null ? void 0 : P.ref.current;
14652
14652
  (function H(Z) {
14653
- $.current = Z, window.clearTimeout(j.current), Z !== "" && (j.current = window.setTimeout(() => H(""), 1e3));
14653
+ $.current = Z, window.clearTimeout(A.current), Z !== "" && (A.current = window.setTimeout(() => H(""), 1e3));
14654
14654
  })(K), X && setTimeout(() => X.focus());
14655
14655
  };
14656
- h.useEffect(() => () => window.clearTimeout(j.current), []), zi();
14657
- const A = h.useCallback((k) => {
14656
+ h.useEffect(() => () => window.clearTimeout(A.current), []), zi();
14657
+ const j = h.useCallback((k) => {
14658
14658
  var J, M;
14659
14659
  return G.current === ((J = B.current) == null ? void 0 : J.side) && WC(k, (M = B.current) == null ? void 0 : M.area);
14660
14660
  }, []);
@@ -14665,22 +14665,22 @@ var ln = "MenuContent", [RC, Rl] = mr(ln), Dp = h.forwardRef(
14665
14665
  searchRef: $,
14666
14666
  onItemEnter: h.useCallback(
14667
14667
  (k) => {
14668
- A(k) && k.preventDefault();
14668
+ j(k) && k.preventDefault();
14669
14669
  },
14670
- [A]
14670
+ [j]
14671
14671
  ),
14672
14672
  onItemLeave: h.useCallback(
14673
14673
  (k) => {
14674
14674
  var K;
14675
- A(k) || ((K = C.current) == null || K.focus(), y(null));
14675
+ j(k) || ((K = C.current) == null || K.focus(), y(null));
14676
14676
  },
14677
- [A]
14677
+ [j]
14678
14678
  ),
14679
14679
  onTriggerLeave: h.useCallback(
14680
14680
  (k) => {
14681
- A(k) && k.preventDefault();
14681
+ j(k) && k.preventDefault();
14682
14682
  },
14683
- [A]
14683
+ [j]
14684
14684
  ),
14685
14685
  pointerGraceTimerRef: O,
14686
14686
  onPointerGraceIntentChange: h.useCallback((k) => {
@@ -14742,7 +14742,7 @@ var ln = "MenuContent", [RC, Rl] = mr(ln), Dp = h.forwardRef(
14742
14742
  Ap.includes(k.key) && X.reverse(), BC(X);
14743
14743
  }),
14744
14744
  onBlur: ie(e.onBlur, (k) => {
14745
- k.currentTarget.contains(k.target) || (window.clearTimeout(j.current), $.current = "");
14745
+ k.currentTarget.contains(k.target) || (window.clearTimeout(A.current), $.current = "");
14746
14746
  }),
14747
14747
  onPointerMove: ie(
14748
14748
  e.onPointerMove,
@@ -15424,9 +15424,9 @@ function _E({
15424
15424
  validate: g,
15425
15425
  onValidationError: x
15426
15426
  }) {
15427
- const b = a !== void 0, [w, S] = F.useState(e), E = (b ? a : w) ?? "", [T, y] = F.useTransition(), C = F.useRef(null), N = F.useRef(0), j = F.useRef(null), $ = F.useRef("");
15427
+ const b = a !== void 0, [w, S] = F.useState(e), E = (b ? a : w) ?? "", [T, y] = F.useTransition(), C = F.useRef(null), N = F.useRef(0), A = F.useRef(null), $ = F.useRef("");
15428
15428
  F.useEffect(() => {
15429
- if (!b && (S(e ?? ""), j.current = null, C.current)) {
15429
+ if (!b && (S(e ?? ""), A.current = null, C.current)) {
15430
15430
  const D = !e || e.trim() === "", L = 44;
15431
15431
  D ? C.current.style.height = `${L}px` : (C.current.style.height = "auto", C.current.style.height = `${Math.max(C.current.scrollHeight, L)}px`);
15432
15432
  }
@@ -15465,14 +15465,14 @@ function _E({
15465
15465
  b || S(D), L && (i == null || i(D));
15466
15466
  },
15467
15467
  [b, i]
15468
- ), A = F.useCallback(
15468
+ ), j = F.useCallback(
15469
15469
  async (D) => {
15470
15470
  D && D.preventDefault();
15471
15471
  const L = (E ?? "").trim();
15472
15472
  if (!L && !p || U(L))
15473
15473
  return;
15474
15474
  const X = ++N.current;
15475
- j.current = {
15475
+ A.current = {
15476
15476
  id: X,
15477
15477
  shouldClear: !0
15478
15478
  }, y(() => {
@@ -15481,25 +15481,25 @@ function _E({
15481
15481
  const Z = l(L);
15482
15482
  Z && typeof Z.then == "function" ? Z.then(() => {
15483
15483
  var oe, le;
15484
- ((oe = j.current) == null ? void 0 : oe.id) === X && j.current.shouldClear && (b || (S(""), C.current && (C.current.style.height = "auto"), i == null || i(""))), ((le = j.current) == null ? void 0 : le.id) === X && (j.current = null);
15484
+ ((oe = A.current) == null ? void 0 : oe.id) === X && A.current.shouldClear && (b || (S(""), C.current && (C.current.style.height = "auto"), i == null || i(""))), ((le = A.current) == null ? void 0 : le.id) === X && (A.current = null);
15485
15485
  }).catch(() => {
15486
15486
  var oe;
15487
- ((oe = j.current) == null ? void 0 : oe.id) === X && (j.current = null);
15488
- }) : (((R = j.current) == null ? void 0 : R.id) === X && j.current.shouldClear && (b || (S(""), C.current && (C.current.style.height = "auto"), i == null || i(""))), ((P = j.current) == null ? void 0 : P.id) === X && (j.current = null));
15487
+ ((oe = A.current) == null ? void 0 : oe.id) === X && (A.current = null);
15488
+ }) : (((R = A.current) == null ? void 0 : R.id) === X && A.current.shouldClear && (b || (S(""), C.current && (C.current.style.height = "auto"), i == null || i(""))), ((P = A.current) == null ? void 0 : P.id) === X && (A.current = null));
15489
15489
  } catch {
15490
- ((H = j.current) == null ? void 0 : H.id) === X && (j.current = null);
15490
+ ((H = A.current) == null ? void 0 : H.id) === X && (A.current = null);
15491
15491
  }
15492
15492
  });
15493
15493
  },
15494
15494
  [E, l, p, b, i, U]
15495
15495
  ), k = F.useCallback((D) => {
15496
15496
  const L = D.target.value;
15497
- z(L, { fromUser: !0 }), j.current && (j.current.shouldClear = !1), C.current && (C.current.style.height = "auto", C.current.style.height = `${C.current.scrollHeight}px`), O && U(L.trim());
15497
+ z(L, { fromUser: !0 }), A.current && (A.current.shouldClear = !1), C.current && (C.current.style.height = "auto", C.current.style.height = `${C.current.scrollHeight}px`), O && U(L.trim());
15498
15498
  }, [z, U, O]), K = F.useCallback(
15499
15499
  (D) => {
15500
- D.key === "Enter" && !D.shiftKey ? (D.preventDefault(), A()) : D.key === "Escape" && t && (D.preventDefault(), c == null || c());
15500
+ D.key === "Enter" && !D.shiftKey ? (D.preventDefault(), j()) : D.key === "Escape" && t && (D.preventDefault(), c == null || c());
15501
15501
  },
15502
- [A, t, c]
15502
+ [j, t, c]
15503
15503
  ), q = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${m}`;
15504
15504
  return /* @__PURE__ */ u.jsx("div", { className: `w-full ${f}`, children: /* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
15505
15505
  /* @__PURE__ */ u.jsxs("div", { className: "flex-1", children: [
@@ -15522,7 +15522,7 @@ function _E({
15522
15522
  O && /* @__PURE__ */ u.jsx("p", { className: "mt-1 text-xs text-destructive font-medium", children: O })
15523
15523
  ] }),
15524
15524
  /* @__PURE__ */ u.jsx("div", { children: r ? /* @__PURE__ */ u.jsx(
15525
- nt,
15525
+ tt,
15526
15526
  {
15527
15527
  type: "button",
15528
15528
  onClick: () => {
@@ -15536,10 +15536,10 @@ function _E({
15536
15536
  children: /* @__PURE__ */ u.jsx(Qg, { size: 16 })
15537
15537
  }
15538
15538
  ) : /* @__PURE__ */ u.jsx(
15539
- nt,
15539
+ tt,
15540
15540
  {
15541
15541
  type: "button",
15542
- onClick: (D) => void A(D),
15542
+ onClick: (D) => void j(D),
15543
15543
  size: "icon",
15544
15544
  className: `shrink-0 ${v ?? ""}`,
15545
15545
  title: t ? "Save changes" : "Send message",
@@ -15571,9 +15571,9 @@ function OE({
15571
15571
  allowEmptySend: b = !1,
15572
15572
  inputError: w = null
15573
15573
  }) {
15574
- const [S, E] = pe([]), T = Ae(null), y = Ae(null), [C, N] = pe(0), [j, $] = pe(0), [O, B] = pe(!1), [G, _] = pe(null), [U, Y] = pe(null), z = ce(() => {
15574
+ const [S, E] = pe([]), T = Ae(null), y = Ae(null), [C, N] = pe(0), [A, $] = pe(0), [O, B] = pe(!1), [G, _] = pe(null), [U, Y] = pe(null), z = ce(() => {
15575
15575
  T.current && (T.current.value = ""), y.current && (y.current.value = ""), N((L) => L + 1), $((L) => L + 1);
15576
- }, []), A = ce((L) => {
15576
+ }, []), j = ce((L) => {
15577
15577
  E((X) => {
15578
15578
  const R = [...X, ...L];
15579
15579
  return g == null || g(R), R;
@@ -15581,9 +15581,9 @@ function OE({
15581
15581
  }, [g]), k = ce(
15582
15582
  (L) => {
15583
15583
  const X = Array.from(L.target.files || []);
15584
- A(X), L.target.value = "";
15584
+ j(X), L.target.value = "";
15585
15585
  },
15586
- [A]
15586
+ [j]
15587
15587
  ), K = ce((L) => {
15588
15588
  E((X) => {
15589
15589
  const R = X.filter((P, H) => H !== L);
@@ -15634,7 +15634,7 @@ function OE({
15634
15634
  /* @__PURE__ */ u.jsx(Gl, { size: 14 }),
15635
15635
  /* @__PURE__ */ u.jsx("span", { className: "truncate max-w-[150px]", children: L.name }),
15636
15636
  /* @__PURE__ */ u.jsx(
15637
- nt,
15637
+ tt,
15638
15638
  {
15639
15639
  variant: "ghost",
15640
15640
  size: "sm",
@@ -15659,7 +15659,7 @@ function OE({
15659
15659
  onChange: J,
15660
15660
  className: "hidden"
15661
15661
  },
15662
- j
15662
+ A
15663
15663
  ),
15664
15664
  O && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15665
15665
  /* @__PURE__ */ u.jsx(Xn, { className: "h-4 w-4 animate-spin" }),
@@ -15672,7 +15672,7 @@ function OE({
15672
15672
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
15673
15673
  (m || p) && /* @__PURE__ */ u.jsxs(Pl, { children: [
15674
15674
  /* @__PURE__ */ u.jsx(_l, { asChild: !0, children: /* @__PURE__ */ u.jsx(
15675
- nt,
15675
+ tt,
15676
15676
  {
15677
15677
  type: "button",
15678
15678
  size: "icon",
@@ -15763,7 +15763,7 @@ function io({
15763
15763
  const { chatApi: E } = dr(), T = E.baseUrl, { currentThreadId: y } = Io(), {
15764
15764
  threadId: C,
15765
15765
  messages: N,
15766
- isLoading: j,
15766
+ isLoading: A,
15767
15767
  navigateToCheckpoint: $,
15768
15768
  returnToLatest: O,
15769
15769
  checkpoint: B,
@@ -15772,10 +15772,10 @@ function io({
15772
15772
  metadata: U,
15773
15773
  checkpointIndex: Y,
15774
15774
  respondToInterrupt: z
15775
- } = Fs(), { isStreaming: A, error: k, connectionState: K, submit: J, stop: M } = Vw(), q = C ?? y ?? null, D = (B == null ? void 0 : B.id) ?? null, L = (B == null ? void 0 : B.namespace) ?? null, X = (U == null ? void 0 : U.assemblingMessageId) ?? null;
15775
+ } = Fs(), { isStreaming: j, error: k, connectionState: K, submit: J, stop: M } = Vw(), q = C ?? y ?? null, D = (B == null ? void 0 : B.id) ?? null, L = (B == null ? void 0 : B.namespace) ?? null, X = (U == null ? void 0 : U.assemblingMessageId) ?? null;
15776
15776
  F.useEffect(() => {
15777
- console.log("[ChatInterface] streamingAssistantId changed:", { streamingAssistantId: X, isStreaming: A, assemblingMessageId: U == null ? void 0 : U.assemblingMessageId });
15778
- }, [X, A, U == null ? void 0 : U.assemblingMessageId]);
15777
+ console.log("[ChatInterface] streamingAssistantId changed:", { streamingAssistantId: X, isStreaming: j, assemblingMessageId: U == null ? void 0 : U.assemblingMessageId });
15778
+ }, [X, j, U == null ? void 0 : U.assemblingMessageId]);
15779
15779
  const R = _, P = R ? xd(R.id) : null, H = P !== null ? { type: "interrupt", id: P } : null, [Z, oe] = pe(!1), [le, Ee] = pe(!1);
15780
15780
  Xe(() => {
15781
15781
  R || oe(!1);
@@ -15824,8 +15824,8 @@ function io({
15824
15824
  [pt]
15825
15825
  );
15826
15826
  Xe(() => {
15827
- A || Ee(!1);
15828
- }, [A]), Xe(() => {
15827
+ j || Ee(!1);
15828
+ }, [j]), Xe(() => {
15829
15829
  U != null && U.assemblingMessageId && Ee(!1);
15830
15830
  }, [U == null ? void 0 : U.assemblingMessageId]);
15831
15831
  const [De, Fe] = pe("desktop");
@@ -15865,7 +15865,7 @@ function io({
15865
15865
  }, [E, T, S]), Xe(() => {
15866
15866
  k && !ht && (w == null || w(k));
15867
15867
  }, [k, ht, w]);
15868
- const at = async (Q, ue) => {
15868
+ const st = async (Q, ue) => {
15869
15869
  const we = Q.trim();
15870
15870
  if (!(!we && ue.length === 0))
15871
15871
  try {
@@ -15887,7 +15887,7 @@ function io({
15887
15887
  const Ne = (ke == null ? void 0 : ke.message) || "Failed to send message";
15888
15888
  kt(Ne), w == null || w(Ne), Ee(!1);
15889
15889
  }
15890
- }, rt = ce(
15890
+ }, nt = ce(
15891
15891
  async (Q) => {
15892
15892
  await J(
15893
15893
  { attachments: [Q], payload: p },
@@ -15898,7 +15898,7 @@ function io({
15898
15898
  ), b == null || b({ file: Q });
15899
15899
  },
15900
15900
  [D, L, p, b, J]
15901
- ), it = F.useCallback(
15901
+ ), at = F.useCallback(
15902
15902
  (Q, ue, we) => {
15903
15903
  l && ($e.current = gt, Ge(Q), Ye(ue), pt(ue), kt(null), Et({
15904
15904
  checkpointId: (we == null ? void 0 : we.checkpointId) ?? null,
@@ -15908,11 +15908,11 @@ function io({
15908
15908
  [gt, l, pt]
15909
15909
  ), xt = F.useCallback(() => {
15910
15910
  Ge(null), Ye(""), Et(null), kt(null), pt($e.current ?? gt), $e.current = null;
15911
- }, [gt, pt]), V = ce(
15911
+ }, [gt, pt]), W = ce(
15912
15912
  (Q, ue, we) => {
15913
- it(Q, ue, we);
15913
+ at(Q, ue, we);
15914
15914
  },
15915
- [it]
15915
+ [at]
15916
15916
  ), re = ce((Q) => {
15917
15917
  let ue = null;
15918
15918
  for (let Te = Q - 1; Te >= 0; Te--)
@@ -15971,12 +15971,12 @@ function io({
15971
15971
  await ae(we ? null : Q);
15972
15972
  },
15973
15973
  [ae]
15974
- ), tt = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${v.container || ""}`, I = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 ${R ? "pb-32" : ""} bg-transparent ${v.messagesArea || ""}`, ee = `relative flex-shrink-0 w-full border-t p-4 bg-transparent ${v.inputArea || ""}`;
15975
- return /* @__PURE__ */ u.jsxs("div", { className: tt, children: [
15974
+ ), it = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${v.container || ""}`, I = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 ${R ? "pb-32" : ""} bg-transparent ${v.messagesArea || ""}`, ee = `relative flex-shrink-0 w-full border-t p-4 bg-transparent ${v.inputArea || ""}`;
15975
+ return /* @__PURE__ */ u.jsxs("div", { className: it, children: [
15976
15976
  !!k && !ht && /* @__PURE__ */ u.jsxs("div", { className: "flex-shrink-0 bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between", children: [
15977
15977
  /* @__PURE__ */ u.jsx("span", { children: k }),
15978
15978
  /* @__PURE__ */ u.jsx(
15979
- nt,
15979
+ tt,
15980
15980
  {
15981
15981
  variant: "ghost",
15982
15982
  size: "sm",
@@ -16000,14 +16000,14 @@ function io({
16000
16000
  className: "h-full",
16001
16001
  style: { height: "100%" },
16002
16002
  messages: N,
16003
- isStreaming: A,
16003
+ isStreaming: j,
16004
16004
  streamingAssistantId: X,
16005
16005
  streamingDebounceMs: o,
16006
16006
  followNewMessages: s,
16007
16007
  layoutSize: De,
16008
16008
  enableMessageEditing: l,
16009
16009
  editingMessageId: _e,
16010
- onEdit: V,
16010
+ onEdit: W,
16011
16011
  onRegenerate: re,
16012
16012
  onCancelEdit: xt,
16013
16013
  emptyMessage: At ?? void 0,
@@ -16028,7 +16028,7 @@ function io({
16028
16028
  K === "reconnecting" ? "Reconnecting…" : "Connecting…"
16029
16029
  ] }) }),
16030
16030
  K === "error" && /* @__PURE__ */ u.jsx("div", { className: "pointer-events-none absolute top-3 right-3 z-20 rounded-full bg-destructive/10 px-3 py-1 text-xs font-semibold text-destructive shadow-sm", children: "Connection lost" }),
16031
- j && /* @__PURE__ */ u.jsxs("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-background/80 backdrop-blur-sm text-muted-foreground", children: [
16031
+ A && /* @__PURE__ */ u.jsxs("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-background/80 backdrop-blur-sm text-muted-foreground", children: [
16032
16032
  /* @__PURE__ */ u.jsx(Xn, { className: "h-6 w-6 animate-spin" }),
16033
16033
  /* @__PURE__ */ u.jsx("span", { className: "text-xs font-semibold uppercase tracking-wide", children: "Loading messages…" })
16034
16034
  ] }),
@@ -16058,7 +16058,7 @@ function io({
16058
16058
  /* @__PURE__ */ u.jsx("span", { className: "text-sm font-medium text-blue-800", children: "Editing message" })
16059
16059
  ] }),
16060
16060
  /* @__PURE__ */ u.jsx(
16061
- nt,
16061
+ tt,
16062
16062
  {
16063
16063
  variant: "ghost",
16064
16064
  size: "sm",
@@ -16074,17 +16074,17 @@ function io({
16074
16074
  {
16075
16075
  composerValue: gt,
16076
16076
  onComposerChange: ge,
16077
- onSend: at,
16077
+ onSend: st,
16078
16078
  onCancelEdit: xt,
16079
16079
  onStop: M,
16080
16080
  editingMessageId: _e,
16081
16081
  editingInitialValue: Ie,
16082
16082
  placeholder: _e ? "Edit your message..." : t,
16083
- isStreaming: A,
16083
+ isStreaming: j,
16084
16084
  disabled: Ve,
16085
16085
  enableFileUpload: a,
16086
16086
  enableExcelUpload: i,
16087
- onExcelUpload: rt,
16087
+ onExcelUpload: nt,
16088
16088
  onError: w,
16089
16089
  customStyles: v,
16090
16090
  textareaClassName: v.textarea || "",
@@ -16146,7 +16146,7 @@ var Qr = '[cmdk-group=""]', Ka = '[cmdk-group-items=""]', KE = '[cmdk-group-head
16146
16146
  a.current.forEach((M) => M());
16147
16147
  } }), []), N = h.useMemo(() => ({ value: (M, q, D) => {
16148
16148
  var L;
16149
- q !== ((L = s.current.get(M)) == null ? void 0 : L.value) && (s.current.set(M, { value: q, keywords: D }), n.current.filtered.items.set(M, j(q, D)), y(2, () => {
16149
+ q !== ((L = s.current.get(M)) == null ? void 0 : L.value) && (s.current.set(M, { value: q, keywords: D }), n.current.filtered.items.set(M, A(q, D)), y(2, () => {
16150
16150
  $(), C.emit();
16151
16151
  }));
16152
16152
  }, item: (M, q) => (r.current.add(M), q && (o.current.has(q) ? o.current.get(q).add(M) : o.current.set(q, /* @__PURE__ */ new Set([M]))), y(3, () => {
@@ -16160,7 +16160,7 @@ var Qr = '[cmdk-group=""]', Ka = '[cmdk-group-items=""]', KE = '[cmdk-group-head
16160
16160
  }), group: (M) => (o.current.has(M) || o.current.set(M, /* @__PURE__ */ new Set()), () => {
16161
16161
  s.current.delete(M), o.current.delete(M);
16162
16162
  }), filter: () => i.current.shouldFilter, label: l || e["aria-label"], getDisablePointerSelection: () => i.current.disablePointerSelection, listId: w, inputId: E, labelId: S, listInnerRef: T }), []);
16163
- function j(M, q) {
16163
+ function A(M, q) {
16164
16164
  var D, L;
16165
16165
  let X = (L = (D = i.current) == null ? void 0 : D.filter) != null ? L : qE;
16166
16166
  return M ? X(M, n.current.search, q) : 0;
@@ -16202,7 +16202,7 @@ var Qr = '[cmdk-group=""]', Ka = '[cmdk-group-items=""]', KE = '[cmdk-group-head
16202
16202
  n.current.filtered.groups = /* @__PURE__ */ new Set();
16203
16203
  let X = 0;
16204
16204
  for (let R of r.current) {
16205
- let P = (q = (M = s.current.get(R)) == null ? void 0 : M.value) != null ? q : "", H = (L = (D = s.current.get(R)) == null ? void 0 : D.keywords) != null ? L : [], Z = j(P, H);
16205
+ let P = (q = (M = s.current.get(R)) == null ? void 0 : M.value) != null ? q : "", H = (L = (D = s.current.get(R)) == null ? void 0 : D.keywords) != null ? L : [], Z = A(P, H);
16206
16206
  n.current.filtered.items.set(R, Z), Z > 0 && X++;
16207
16207
  }
16208
16208
  for (let [R, P] of o.current) for (let H of P) if (n.current.filtered.items.get(H) > 0) {
@@ -16233,15 +16233,15 @@ var Qr = '[cmdk-group=""]', Ka = '[cmdk-group-items=""]', KE = '[cmdk-group-head
16233
16233
  let D = _(), L = U(), X = L.findIndex((P) => P === D), R = L[X + M];
16234
16234
  (q = i.current) != null && q.loop && (R = X + M < 0 ? L[L.length - 1] : X + M === L.length ? L[0] : L[X + M]), R && C.setState("value", R.getAttribute(yr));
16235
16235
  }
16236
- function A(M) {
16236
+ function j(M) {
16237
16237
  let q = _(), D = q == null ? void 0 : q.closest(Qr), L;
16238
16238
  for (; D && !L; ) D = M > 0 ? nk(D, Qr) : rk(D, Qr), L = D == null ? void 0 : D.querySelector(Eu);
16239
16239
  L ? C.setState("value", L.getAttribute(yr)) : z(M);
16240
16240
  }
16241
16241
  let k = () => Y(U().length - 1), K = (M) => {
16242
- M.preventDefault(), M.metaKey ? k() : M.altKey ? A(1) : z(1);
16242
+ M.preventDefault(), M.metaKey ? k() : M.altKey ? j(1) : z(1);
16243
16243
  }, J = (M) => {
16244
- M.preventDefault(), M.metaKey ? Y(0) : M.altKey ? A(-1) : z(-1);
16244
+ M.preventDefault(), M.metaKey ? Y(0) : M.altKey ? j(-1) : z(-1);
16245
16245
  };
16246
16246
  return h.createElement(he.div, { ref: t, tabIndex: -1, ...b, "cmdk-root": "", onKeyDown: (M) => {
16247
16247
  var q;
@@ -16493,7 +16493,7 @@ var Ol = "ScrollArea", [$h, ON] = cn(Ol), [ck, un] = $h(Ol), Fh = h.forwardRef(
16493
16493
  dir: o,
16494
16494
  scrollHideDelay: s = 600,
16495
16495
  ...a
16496
- } = e, [i, l] = h.useState(null), [c, d] = h.useState(null), [f, m] = h.useState(null), [p, v] = h.useState(null), [g, x] = h.useState(null), [b, w] = h.useState(0), [S, E] = h.useState(0), [T, y] = h.useState(!1), [C, N] = h.useState(!1), j = Oe(t, (O) => l(O)), $ = Js(o);
16496
+ } = e, [i, l] = h.useState(null), [c, d] = h.useState(null), [f, m] = h.useState(null), [p, v] = h.useState(null), [g, x] = h.useState(null), [b, w] = h.useState(0), [S, E] = h.useState(0), [T, y] = h.useState(!1), [C, N] = h.useState(!1), A = Oe(t, (O) => l(O)), $ = Js(o);
16497
16497
  return /* @__PURE__ */ u.jsx(
16498
16498
  ck,
16499
16499
  {
@@ -16521,7 +16521,7 @@ var Ol = "ScrollArea", [$h, ON] = cn(Ol), [ck, un] = $h(Ol), Fh = h.forwardRef(
16521
16521
  {
16522
16522
  dir: $,
16523
16523
  ...a,
16524
- ref: j,
16524
+ ref: A,
16525
16525
  style: {
16526
16526
  position: "relative",
16527
16527
  // Pass corner sizes as CSS vars to reduce re-renders of context consumers
@@ -16815,19 +16815,19 @@ var uk = h.forwardRef((e, t) => {
16815
16815
  onWheelScroll: d,
16816
16816
  onResize: f,
16817
16817
  ...m
16818
- } = e, p = un(In, n), [v, g] = h.useState(null), x = Oe(t, (j) => g(j)), b = h.useRef(null), w = h.useRef(""), S = p.viewport, E = r.content - r.viewport, T = yt(d), y = yt(l), C = la(f, 10);
16819
- function N(j) {
16818
+ } = e, p = un(In, n), [v, g] = h.useState(null), x = Oe(t, (A) => g(A)), b = h.useRef(null), w = h.useRef(""), S = p.viewport, E = r.content - r.viewport, T = yt(d), y = yt(l), C = la(f, 10);
16819
+ function N(A) {
16820
16820
  if (b.current) {
16821
- const $ = j.clientX - b.current.left, O = j.clientY - b.current.top;
16821
+ const $ = A.clientX - b.current.left, O = A.clientY - b.current.top;
16822
16822
  c({ x: $, y: O });
16823
16823
  }
16824
16824
  }
16825
16825
  return h.useEffect(() => {
16826
- const j = ($) => {
16826
+ const A = ($) => {
16827
16827
  const O = $.target;
16828
16828
  (v == null ? void 0 : v.contains(O)) && T($, E);
16829
16829
  };
16830
- return document.addEventListener("wheel", j, { passive: !1 }), () => document.removeEventListener("wheel", j, { passive: !1 });
16830
+ return document.addEventListener("wheel", A, { passive: !1 }), () => document.removeEventListener("wheel", A, { passive: !1 });
16831
16831
  }, [S, v, E, T]), h.useEffect(y, [r, y]), Mr(v, C), Mr(p.content, C), /* @__PURE__ */ u.jsx(
16832
16832
  hk,
16833
16833
  {
@@ -16844,13 +16844,13 @@ var uk = h.forwardRef((e, t) => {
16844
16844
  ...m,
16845
16845
  ref: x,
16846
16846
  style: { position: "absolute", ...m.style },
16847
- onPointerDown: ie(e.onPointerDown, (j) => {
16848
- j.button === 0 && (j.target.setPointerCapture(j.pointerId), b.current = v.getBoundingClientRect(), w.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", p.viewport && (p.viewport.style.scrollBehavior = "auto"), N(j));
16847
+ onPointerDown: ie(e.onPointerDown, (A) => {
16848
+ A.button === 0 && (A.target.setPointerCapture(A.pointerId), b.current = v.getBoundingClientRect(), w.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", p.viewport && (p.viewport.style.scrollBehavior = "auto"), N(A));
16849
16849
  }),
16850
16850
  onPointerMove: ie(e.onPointerMove, N),
16851
- onPointerUp: ie(e.onPointerUp, (j) => {
16852
- const $ = j.target;
16853
- $.hasPointerCapture(j.pointerId) && $.releasePointerCapture(j.pointerId), document.body.style.webkitUserSelect = w.current, p.viewport && (p.viewport.style.scrollBehavior = ""), b.current = null;
16851
+ onPointerUp: ie(e.onPointerUp, (A) => {
16852
+ const $ = A.target;
16853
+ $.hasPointerCapture(A.pointerId) && $.releasePointerCapture(A.pointerId), document.body.style.webkitUserSelect = w.current, p.viewport && (p.viewport.style.scrollBehavior = ""), b.current = null;
16854
16854
  })
16855
16855
  }
16856
16856
  )
@@ -17084,7 +17084,7 @@ function Ru({
17084
17084
  }
17085
17085
  ),
17086
17086
  /* @__PURE__ */ u.jsx(
17087
- nt,
17087
+ tt,
17088
17088
  {
17089
17089
  variant: "ghost",
17090
17090
  size: "sm",
@@ -17093,7 +17093,7 @@ function Ru({
17093
17093
  children: /* @__PURE__ */ u.jsx(_s, { size: 12 })
17094
17094
  }
17095
17095
  ),
17096
- /* @__PURE__ */ u.jsx(nt, { variant: "ghost", size: "sm", onClick: l, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(nr, { size: 12 }) })
17096
+ /* @__PURE__ */ u.jsx(tt, { variant: "ghost", size: "sm", onClick: l, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(nr, { size: 12 }) })
17097
17097
  ] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
17098
17098
  /* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: v(e) }),
17099
17099
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
@@ -17104,7 +17104,7 @@ function Ru({
17104
17104
  g && /* @__PURE__ */ u.jsx("div", { className: "text-[11px] text-muted-foreground mt-1", children: g })
17105
17105
  ] }) }),
17106
17106
  /* @__PURE__ */ u.jsx("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: /* @__PURE__ */ u.jsxs(Pl, { children: [
17107
- /* @__PURE__ */ u.jsx(_l, { asChild: !0, children: /* @__PURE__ */ u.jsx(nt, { variant: "ghost", size: "sm", className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(Du, { size: 12 }) }) }),
17107
+ /* @__PURE__ */ u.jsx(_l, { asChild: !0, children: /* @__PURE__ */ u.jsx(tt, { variant: "ghost", size: "sm", className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(Du, { size: 12 }) }) }),
17108
17108
  /* @__PURE__ */ u.jsxs(
17109
17109
  sa,
17110
17110
  {
@@ -17318,7 +17318,7 @@ function wi({
17318
17318
  const { chatApi: T, authApi: y } = dr(), {
17319
17319
  threads: C,
17320
17320
  sharedThreads: N,
17321
- currentThreadId: j,
17321
+ currentThreadId: A,
17322
17322
  setCurrentThreadId: $,
17323
17323
  isLoading: O,
17324
17324
  isLoadingSharedThreads: B,
@@ -17326,7 +17326,7 @@ function wi({
17326
17326
  shareInFlight: _,
17327
17327
  shareStatus: U,
17328
17328
  clearShareStatus: Y
17329
- } = Io(), { createThread: z, deleteThread: A, renameThread: k, shareThread: K } = G, { loadThread: J } = Fs(), M = a ?? j, [q, D] = pe(Array.isArray(C) ? C : []), L = Ae(q.length > 0), X = Ae(null), R = Ae(0), [P, H] = pe(null), [Z, oe] = pe(""), [le, Ee] = pe(!1), [ye, Pe] = pe(!1), [qe, ze] = pe(null), [We, He] = pe(""), [Tt, Ct] = pe([]), [ut, Ve] = pe(!1);
17329
+ } = Io(), { createThread: z, deleteThread: j, renameThread: k, shareThread: K } = G, { loadThread: J } = Fs(), M = a ?? A, [q, D] = pe(Array.isArray(C) ? C : []), L = Ae(q.length > 0), X = Ae(null), R = Ae(0), [P, H] = pe(null), [Z, oe] = pe(""), [le, Ee] = pe(!1), [ye, Pe] = pe(!1), [qe, ze] = pe(null), [We, He] = pe(""), [Tt, Ct] = pe([]), [ut, Ve] = pe(!1);
17330
17330
  Xe(() => {
17331
17331
  ye && !b && Tt.length === 0 && !ut && (async () => {
17332
17332
  Ve(!0);
@@ -17347,114 +17347,114 @@ function wi({
17347
17347
  })();
17348
17348
  }, [ye, b, Tt.length, ut, T]);
17349
17349
  const _e = b ?? Tt, Ge = w ?? ut, Ie = v && v.length > 0 ? v : Mk, Ye = _k({ defaultView: m }), Ze = g ?? Ye, Et = f ?? Ze.view, Qe = ce(
17350
- (V) => {
17351
- f || Ze.setView(V), p == null || p(V);
17350
+ (W) => {
17351
+ f || Ze.setView(W), p == null || p(W);
17352
17352
  },
17353
17353
  [f, p, Ze]
17354
- ), kt = Ie.find((V) => V.key === Et) ?? Ie[0], ht = (V) => {
17355
- ze(V), He(""), Pe(!0);
17354
+ ), kt = Ie.find((W) => W.key === Et) ?? Ie[0], ht = (W) => {
17355
+ ze(W), He(""), Pe(!0);
17356
17356
  }, vt = () => {
17357
17357
  Pe(!1), ze(null), He(""), Y();
17358
17358
  }, At = ce(
17359
- async (V) => {
17360
- if (!(!qe || _) && V.id)
17359
+ async (W) => {
17360
+ if (!(!qe || _) && W.id)
17361
17361
  try {
17362
- await K(qe, V.id), setTimeout(() => vt(), 600);
17362
+ await K(qe, W.id), setTimeout(() => vt(), 600);
17363
17363
  } catch (re) {
17364
17364
  console.error("Failed to share thread:", re);
17365
17365
  }
17366
17366
  },
17367
17367
  [vt, _, qe, K]
17368
17368
  ), _t = Be(() => {
17369
- const V = _e, re = We.trim().toLowerCase();
17370
- return re ? S ? V.filter((ae) => S(ae, re)) : V.filter((ae) => `${ae.label} ${ae.secondaryLabel ?? ""}`.toLowerCase().includes(re)) : V;
17369
+ const W = _e, re = We.trim().toLowerCase();
17370
+ return re ? S ? W.filter((ae) => S(ae, re)) : W.filter((ae) => `${ae.label} ${ae.secondaryLabel ?? ""}`.toLowerCase().includes(re)) : W;
17371
17371
  }, [b, We, S]), mt = Et === "shared", gt = mt ? N : q, Bt = Be(() => {
17372
17372
  if (!E || mt) return null;
17373
- const V = {}, re = "Default";
17373
+ const W = {}, re = "Default";
17374
17374
  return gt.forEach((ae) => {
17375
- var tt, I;
17375
+ var it, I;
17376
17376
  let me = re;
17377
- E === "project" ? me = ((tt = ae.project) == null ? void 0 : tt.name) || ((I = ae.project) == null ? void 0 : I.id) || re : me = ae[E] || re, V[me] || (V[me] = []), V[me].push(ae);
17378
- }), Object.keys(V).forEach((ae) => {
17379
- V[ae].sort(
17380
- (me, tt) => new Date(tt.updatedAt || tt.createdAt || "").getTime() - new Date(me.updatedAt || me.createdAt || "").getTime()
17377
+ E === "project" ? me = ((it = ae.project) == null ? void 0 : it.name) || ((I = ae.project) == null ? void 0 : I.id) || re : me = ae[E] || re, W[me] || (W[me] = []), W[me].push(ae);
17378
+ }), Object.keys(W).forEach((ae) => {
17379
+ W[ae].sort(
17380
+ (me, it) => new Date(it.updatedAt || it.createdAt || "").getTime() - new Date(me.updatedAt || me.createdAt || "").getTime()
17381
17381
  );
17382
- }), V;
17383
- }, [gt, E, mt]), Ke = mt ? B : O, $e = mt ? "No shared conversations yet" : "No conversations yet", pt = (V) => {
17384
- const re = V.sharedAt ? ` • ${rt(V.sharedAt)}` : "";
17385
- return `Shared by ${V.sharedByUserId}${re}`;
17386
- }, Rt = (V) => "sharedByUserId" in V;
17382
+ }), W;
17383
+ }, [gt, E, mt]), Ke = mt ? B : O, $e = mt ? "No shared conversations yet" : "No conversations yet", pt = (W) => {
17384
+ const re = W.sharedAt ? ` • ${nt(W.sharedAt)}` : "";
17385
+ return `Shared by ${W.sharedByUserId}${re}`;
17386
+ }, Rt = (W) => "sharedByUserId" in W;
17387
17387
  Xe(() => {
17388
- const V = Array.isArray(C) ? C : [];
17389
- if (V.length > 0) {
17390
- L.current = !0, D(V);
17388
+ const W = Array.isArray(C) ? C : [];
17389
+ if (W.length > 0) {
17390
+ L.current = !0, D(W);
17391
17391
  return;
17392
17392
  }
17393
- O || (L.current = !1, D(V));
17393
+ O || (L.current = !1, D(W));
17394
17394
  }, [C, O]), Xe(() => {
17395
17395
  if (!X.current) return;
17396
- const V = X.current.querySelector(
17396
+ const W = X.current.querySelector(
17397
17397
  "[data-radix-scroll-area-viewport]"
17398
17398
  );
17399
- if (!V) return;
17399
+ if (!W) return;
17400
17400
  let re = null, ae = null;
17401
17401
  return re = requestAnimationFrame(() => {
17402
17402
  ae = requestAnimationFrame(() => {
17403
- V.scrollTop = R.current;
17403
+ W.scrollTop = R.current;
17404
17404
  });
17405
17405
  }), () => {
17406
17406
  re !== null && cancelAnimationFrame(re), ae !== null && cancelAnimationFrame(ae);
17407
17407
  };
17408
17408
  }, [q]);
17409
- const dt = async (V) => {
17409
+ const dt = async (W) => {
17410
17410
  try {
17411
- $(V), await J(V), i == null || i(V), l == null || l(V);
17411
+ $(W), await J(W), i == null || i(W), l == null || l(W);
17412
17412
  } catch (re) {
17413
17413
  console.error("Failed to select thread:", re);
17414
17414
  }
17415
17415
  }, Mt = async () => {
17416
17416
  try {
17417
17417
  Ee(!0);
17418
- const V = await z();
17419
- V && (c == null || c(V), i == null || i(V));
17420
- } catch (V) {
17421
- console.error("Failed to create thread:", V);
17418
+ const W = await z();
17419
+ W && (c == null || c(W), i == null || i(W));
17420
+ } catch (W) {
17421
+ console.error("Failed to create thread:", W);
17422
17422
  } finally {
17423
17423
  Ee(!1);
17424
17424
  }
17425
- }, ge = async (V, re) => {
17425
+ }, ge = async (W, re) => {
17426
17426
  if (re.stopPropagation(), !!confirm("Delete this thread?")) {
17427
17427
  if (X.current) {
17428
17428
  const ae = X.current.querySelector("[data-radix-scroll-area-viewport]");
17429
17429
  ae && (R.current = ae.scrollTop);
17430
17430
  }
17431
17431
  try {
17432
- await A(V), d == null || d(V);
17432
+ await j(W), d == null || d(W);
17433
17433
  } catch (ae) {
17434
17434
  console.error("Failed to delete thread:", ae);
17435
17435
  }
17436
17436
  }
17437
- }, De = (V, re) => {
17438
- re.stopPropagation(), H(V.threadId), oe(V.title || `Thread ${V.threadId.slice(0, 8)}`);
17439
- }, Fe = async (V) => {
17437
+ }, De = (W, re) => {
17438
+ re.stopPropagation(), H(W.threadId), oe(W.title || `Thread ${W.threadId.slice(0, 8)}`);
17439
+ }, Fe = async (W) => {
17440
17440
  if (Z.trim())
17441
17441
  try {
17442
- await k(V, Z.trim()), H(null), oe("");
17442
+ await k(W, Z.trim()), H(null), oe("");
17443
17443
  } catch (re) {
17444
17444
  console.error("Failed to update title:", re);
17445
17445
  }
17446
- }, at = () => {
17446
+ }, st = () => {
17447
17447
  H(null), oe("");
17448
- }, rt = (V) => {
17449
- if (!V) return "";
17448
+ }, nt = (W) => {
17449
+ if (!W) return "";
17450
17450
  try {
17451
- const re = new Date(V), me = (/* @__PURE__ */ new Date()).getTime() - re.getTime(), tt = Math.floor(me / (1e3 * 60 * 60 * 24));
17452
- return tt === 0 ? re.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : tt === 1 ? "Yesterday" : tt < 7 ? `${tt} days ago` : re.toLocaleDateString();
17451
+ const re = W.endsWith("Z") || W.includes("+") ? W : `${W}Z`, ae = new Date(re), it = (/* @__PURE__ */ new Date()).getTime() - ae.getTime(), I = Math.floor(it / (1e3 * 60 * 60 * 24));
17452
+ return I === 0 ? ae.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : I === 1 ? "Yesterday" : I < 7 ? `${I} days ago` : ae.toLocaleDateString();
17453
17453
  } catch {
17454
17454
  return "";
17455
17455
  }
17456
- }, it = (V) => V.title || `Thread ${V.threadId.slice(0, 8)}`, xt = (V) => {
17457
- const re = it(V);
17456
+ }, at = (W) => W.title || `Thread ${W.threadId.slice(0, 8)}`, xt = (W) => {
17457
+ const re = at(W);
17458
17458
  return re.length <= Iu ? re : `${re.slice(0, Iu)}...`;
17459
17459
  };
17460
17460
  return /* @__PURE__ */ u.jsxs("div", { className: `thread-manager-root flex flex-col h-full ${e} ${s.container || ""}`, children: [
@@ -17464,7 +17464,7 @@ function wi({
17464
17464
  className: s.header || "flex flex-col gap-2 px-1 py-0 border border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900 shadow-sm",
17465
17465
  children: [
17466
17466
  t && /* @__PURE__ */ u.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ u.jsxs(
17467
- nt,
17467
+ tt,
17468
17468
  {
17469
17469
  onClick: Mt,
17470
17470
  disabled: le || O,
@@ -17482,7 +17482,7 @@ function wi({
17482
17482
  /* @__PURE__ */ u.jsx("span", { children: "Current View" }),
17483
17483
  /* @__PURE__ */ u.jsxs(Pl, { children: [
17484
17484
  /* @__PURE__ */ u.jsx(_l, { asChild: !0, children: /* @__PURE__ */ u.jsx(
17485
- nt,
17485
+ tt,
17486
17486
  {
17487
17487
  variant: "outline",
17488
17488
  size: "sm",
@@ -17490,19 +17490,19 @@ function wi({
17490
17490
  children: kt.label
17491
17491
  }
17492
17492
  ) }),
17493
- /* @__PURE__ */ u.jsx(sa, { align: "start", sideOffset: 6, className: "w-40", children: Ie.map((V) => /* @__PURE__ */ u.jsxs(
17493
+ /* @__PURE__ */ u.jsx(sa, { align: "start", sideOffset: 6, className: "w-40", children: Ie.map((W) => /* @__PURE__ */ u.jsxs(
17494
17494
  tr,
17495
17495
  {
17496
17496
  className: "justify-between text-[12px]",
17497
17497
  onClick: (re) => {
17498
- re.preventDefault(), Qe(V.key);
17498
+ re.preventDefault(), Qe(W.key);
17499
17499
  },
17500
17500
  children: [
17501
- /* @__PURE__ */ u.jsx("span", { children: V.label }),
17502
- Et === V.key && /* @__PURE__ */ u.jsx(_s, { className: "h-3 w-3" })
17501
+ /* @__PURE__ */ u.jsx("span", { children: W.label }),
17502
+ Et === W.key && /* @__PURE__ */ u.jsx(_s, { className: "h-3 w-3" })
17503
17503
  ]
17504
17504
  },
17505
- V.key
17505
+ W.key
17506
17506
  )) })
17507
17507
  ] })
17508
17508
  ] })
@@ -17521,13 +17521,13 @@ function wi({
17521
17521
  ] }) : gt.length === 0 ? /* @__PURE__ */ u.jsxs("div", { className: "text-center py-8 text-slate-400", children: [
17522
17522
  /* @__PURE__ */ u.jsx(Lu, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
17523
17523
  /* @__PURE__ */ u.jsx("p", { className: "text-sm text-slate-500", children: $e })
17524
- ] }) : Bt ? Object.entries(Bt).sort(([V], [re]) => {
17524
+ ] }) : Bt ? Object.entries(Bt).sort(([W], [re]) => {
17525
17525
  const ae = "Default";
17526
- return V === ae ? 1 : re === ae ? -1 : V.localeCompare(re);
17527
- }).map(([V, re]) => /* @__PURE__ */ u.jsxs(Ik, { defaultOpen: !0, className: "group/collapsible", children: [
17526
+ return W === ae ? 1 : re === ae ? -1 : W.localeCompare(re);
17527
+ }).map(([W, re]) => /* @__PURE__ */ u.jsxs(Ik, { defaultOpen: !0, className: "group/collapsible", children: [
17528
17528
  /* @__PURE__ */ u.jsxs(Nk, { className: "flex items-center w-full px-2 py-1 text-xs font-medium text-slate-500 hover:text-slate-800 dark:hover:text-slate-200", children: [
17529
17529
  /* @__PURE__ */ u.jsx(Pi, { className: "w-3 h-3 mr-1 transition-transform group-data-[state=open]/collapsible:rotate-90" }),
17530
- V,
17530
+ W,
17531
17531
  /* @__PURE__ */ u.jsx("span", { className: "ml-auto text-[10px] text-slate-400", children: re.length })
17532
17532
  ] }),
17533
17533
  /* @__PURE__ */ u.jsx(Ak, { children: /* @__PURE__ */ u.jsx("div", { className: "pl-2 border-l border-slate-100 dark:border-slate-800 ml-1.5 my-1 space-y-1", children: re.map((ae) => /* @__PURE__ */ u.jsx(
@@ -17541,45 +17541,45 @@ function wi({
17541
17541
  onStartEditing: De,
17542
17542
  onEditingTitleChange: (me) => oe(me),
17543
17543
  onSaveEditing: Fe,
17544
- onCancelEditing: at,
17544
+ onCancelEditing: st,
17545
17545
  onShare: () => ht(ae.threadId),
17546
17546
  onDelete: ge,
17547
17547
  showEditTitle: r,
17548
17548
  showDeleteButton: n,
17549
- formatDate: rt,
17549
+ formatDate: nt,
17550
17550
  getDisplayThreadTitle: xt,
17551
17551
  itemClassName: s.threadItem,
17552
17552
  activeItemClassName: s.activeThread
17553
17553
  },
17554
17554
  ae.threadId
17555
17555
  )) }) })
17556
- ] }, V)) : gt.slice().sort((V, re) => new Date(re.updatedAt || re.createdAt || "").getTime() - new Date(V.updatedAt || V.createdAt || "").getTime()).map((V) => /* @__PURE__ */ u.jsx(
17556
+ ] }, W)) : gt.slice().sort((W, re) => new Date(re.updatedAt || re.createdAt || "").getTime() - new Date(W.updatedAt || W.createdAt || "").getTime()).map((W) => /* @__PURE__ */ u.jsx(
17557
17557
  Ru,
17558
17558
  {
17559
- thread: V,
17560
- isActive: M === V.threadId,
17559
+ thread: W,
17560
+ isActive: M === W.threadId,
17561
17561
  editingThreadId: P,
17562
17562
  editingTitle: Z,
17563
17563
  onSelect: dt,
17564
17564
  onStartEditing: De,
17565
17565
  onEditingTitleChange: (re) => oe(re),
17566
17566
  onSaveEditing: Fe,
17567
- onCancelEditing: at,
17568
- onShare: () => ht(V.threadId),
17567
+ onCancelEditing: st,
17568
+ onShare: () => ht(W.threadId),
17569
17569
  onDelete: ge,
17570
17570
  showEditTitle: r,
17571
17571
  showDeleteButton: n,
17572
- formatDate: rt,
17572
+ formatDate: nt,
17573
17573
  getDisplayThreadTitle: xt,
17574
- secondaryLine: mt && Rt(V) ? pt(V) : void 0,
17574
+ secondaryLine: mt && Rt(W) ? pt(W) : void 0,
17575
17575
  itemClassName: s.threadItem,
17576
17576
  activeItemClassName: s.activeThread
17577
17577
  },
17578
- V.threadId
17578
+ W.threadId
17579
17579
  )) })
17580
17580
  }
17581
17581
  ),
17582
- /* @__PURE__ */ u.jsx(of, { open: ye, onOpenChange: (V) => !V && vt(), children: /* @__PURE__ */ u.jsxs(Gi, { className: "max-w-md p-0", children: [
17582
+ /* @__PURE__ */ u.jsx(of, { open: ye, onOpenChange: (W) => !W && vt(), children: /* @__PURE__ */ u.jsxs(Gi, { className: "max-w-md p-0", children: [
17583
17583
  /* @__PURE__ */ u.jsx(Yi, { children: /* @__PURE__ */ u.jsx(Xi, { children: "Share thread" }) }),
17584
17584
  /* @__PURE__ */ u.jsxs(Ph, { children: [
17585
17585
  /* @__PURE__ */ u.jsx(
@@ -17587,7 +17587,7 @@ function wi({
17587
17587
  {
17588
17588
  autoFocus: !0,
17589
17589
  value: We,
17590
- onValueChange: (V) => He(V),
17590
+ onValueChange: (W) => He(W),
17591
17591
  placeholder: "Search for recipients..."
17592
17592
  }
17593
17593
  ),
@@ -17606,10 +17606,10 @@ function wi({
17606
17606
  /* @__PURE__ */ u.jsx(Xn, { className: "h-4 w-4 animate-spin" }),
17607
17607
  "Loading recipients…"
17608
17608
  ] }) : "No matching recipients found" }),
17609
- _t.length > 0 && /* @__PURE__ */ u.jsx(Dh, { heading: "Recipients", children: _t.map((V) => /* @__PURE__ */ u.jsx(Lh, { onSelect: () => At(V), children: /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col items-start text-sm", children: [
17610
- /* @__PURE__ */ u.jsx("span", { className: "font-medium", children: V.label }),
17611
- V.secondaryLabel && /* @__PURE__ */ u.jsx("span", { className: "text-xs text-muted-foreground", children: V.secondaryLabel })
17612
- ] }) }, V.id)) })
17609
+ _t.length > 0 && /* @__PURE__ */ u.jsx(Dh, { heading: "Recipients", children: _t.map((W) => /* @__PURE__ */ u.jsx(Lh, { onSelect: () => At(W), children: /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col items-start text-sm", children: [
17610
+ /* @__PURE__ */ u.jsx("span", { className: "font-medium", children: W.label }),
17611
+ W.secondaryLabel && /* @__PURE__ */ u.jsx("span", { className: "text-xs text-muted-foreground", children: W.secondaryLabel })
17612
+ ] }) }, W.id)) })
17613
17613
  ] })
17614
17614
  ] })
17615
17615
  ] }) })
@@ -17771,7 +17771,7 @@ function FN({
17771
17771
  ] }),
17772
17772
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-1", children: [
17773
17773
  /* @__PURE__ */ u.jsx(
17774
- nt,
17774
+ tt,
17775
17775
  {
17776
17776
  variant: "ghost",
17777
17777
  size: "sm",
@@ -17781,7 +17781,7 @@ function FN({
17781
17781
  }
17782
17782
  ),
17783
17783
  /* @__PURE__ */ u.jsx(
17784
- nt,
17784
+ tt,
17785
17785
  {
17786
17786
  variant: "ghost",
17787
17787
  size: "sm",
@@ -17791,7 +17791,7 @@ function FN({
17791
17791
  }
17792
17792
  ),
17793
17793
  /* @__PURE__ */ u.jsx(
17794
- nt,
17794
+ tt,
17795
17795
  {
17796
17796
  variant: "ghost",
17797
17797
  size: "sm",
@@ -17821,7 +17821,7 @@ function BN({
17821
17821
  ...s
17822
17822
  }) {
17823
17823
  return /* @__PURE__ */ u.jsxs(
17824
- nt,
17824
+ tt,
17825
17825
  {
17826
17826
  variant: r,
17827
17827
  size: o,
@@ -17912,7 +17912,7 @@ var Bk = ua, zk = [" ", "Enter", "ArrowUp", "ArrowDown"], Hk = [" ", "Enter"], c
17912
17912
  defaultProp: o ?? !1,
17913
17913
  onChange: s,
17914
17914
  caller: cr
17915
- }), [j, $] = An({
17915
+ }), [A, $] = An({
17916
17916
  prop: a,
17917
17917
  defaultProp: i,
17918
17918
  onChange: l,
@@ -17930,7 +17930,7 @@ var Bk = ua, zk = [" ", "Enter", "ArrowUp", "ArrowDown"], Hk = [" ", "Enter"], c
17930
17930
  valueNodeHasChildren: E,
17931
17931
  onValueNodeHasChildrenChange: T,
17932
17932
  contentId: Ot(),
17933
- value: j,
17933
+ value: A,
17934
17934
  onValueChange: $,
17935
17935
  open: C,
17936
17936
  onOpenChange: N,
@@ -17947,8 +17947,8 @@ var Bk = ua, zk = [" ", "Enter", "ArrowUp", "ArrowDown"], Hk = [" ", "Enter"], c
17947
17947
  }, []),
17948
17948
  onNativeOptionRemove: h.useCallback((Y) => {
17949
17949
  _((z) => {
17950
- const A = new Set(z);
17951
- return A.delete(Y), A;
17950
+ const j = new Set(z);
17951
+ return j.delete(Y), j;
17952
17952
  });
17953
17953
  }, []),
17954
17954
  children: n
@@ -17962,12 +17962,12 @@ var Bk = ua, zk = [" ", "Enter", "ArrowUp", "ArrowDown"], Hk = [" ", "Enter"], c
17962
17962
  tabIndex: -1,
17963
17963
  name: d,
17964
17964
  autoComplete: f,
17965
- value: j,
17965
+ value: A,
17966
17966
  onChange: (Y) => $(Y.target.value),
17967
17967
  disabled: m,
17968
17968
  form: v,
17969
17969
  children: [
17970
- j === void 0 ? /* @__PURE__ */ u.jsx("option", { value: "" }) : null,
17970
+ A === void 0 ? /* @__PURE__ */ u.jsx("option", { value: "" }) : null,
17971
17971
  Array.from(G)
17972
17972
  ]
17973
17973
  },
@@ -18086,7 +18086,7 @@ var fn = 10, [xm, Vn] = qr(ur), Yk = "SelectContentImpl", Xk = Nr("SelectContent
18086
18086
  avoidCollisions: x,
18087
18087
  //
18088
18088
  ...b
18089
- } = e, w = Wn(ur, n), [S, E] = h.useState(null), [T, y] = h.useState(null), C = Oe(t, (R) => E(R)), [N, j] = h.useState(null), [$, O] = h.useState(
18089
+ } = e, w = Wn(ur, n), [S, E] = h.useState(null), [T, y] = h.useState(null), C = Oe(t, (R) => E(R)), [N, A] = h.useState(null), [$, O] = h.useState(
18090
18090
  null
18091
18091
  ), B = fa(n), [G, _] = h.useState(!1), U = h.useRef(!1);
18092
18092
  h.useEffect(() => {
@@ -18106,7 +18106,7 @@ var fn = 10, [xm, Vn] = qr(ur), Yk = "SelectContentImpl", Xk = Nr("SelectContent
18106
18106
  h.useEffect(() => {
18107
18107
  G && z();
18108
18108
  }, [G, z]);
18109
- const { onOpenChange: A, triggerPointerDownPosRef: k } = w;
18109
+ const { onOpenChange: j, triggerPointerDownPosRef: k } = w;
18110
18110
  h.useEffect(() => {
18111
18111
  if (S) {
18112
18112
  let R = { x: 0, y: 0 };
@@ -18117,25 +18117,25 @@ var fn = 10, [xm, Vn] = qr(ur), Yk = "SelectContentImpl", Xk = Nr("SelectContent
18117
18117
  y: Math.abs(Math.round(Z.pageY) - (((le = k.current) == null ? void 0 : le.y) ?? 0))
18118
18118
  };
18119
18119
  }, H = (Z) => {
18120
- R.x <= 10 && R.y <= 10 ? Z.preventDefault() : S.contains(Z.target) || A(!1), document.removeEventListener("pointermove", P), k.current = null;
18120
+ R.x <= 10 && R.y <= 10 ? Z.preventDefault() : S.contains(Z.target) || j(!1), document.removeEventListener("pointermove", P), k.current = null;
18121
18121
  };
18122
18122
  return k.current !== null && (document.addEventListener("pointermove", P), document.addEventListener("pointerup", H, { capture: !0, once: !0 })), () => {
18123
18123
  document.removeEventListener("pointermove", P), document.removeEventListener("pointerup", H, { capture: !0 });
18124
18124
  };
18125
18125
  }
18126
- }, [S, A, k]), h.useEffect(() => {
18127
- const R = () => A(!1);
18126
+ }, [S, j, k]), h.useEffect(() => {
18127
+ const R = () => j(!1);
18128
18128
  return window.addEventListener("blur", R), window.addEventListener("resize", R), () => {
18129
18129
  window.removeEventListener("blur", R), window.removeEventListener("resize", R);
18130
18130
  };
18131
- }, [A]);
18131
+ }, [j]);
18132
18132
  const [K, J] = Om((R) => {
18133
18133
  const P = B().filter((oe) => !oe.disabled), H = P.find((oe) => oe.ref.current === document.activeElement), Z = Dm(P, R, H);
18134
18134
  Z && setTimeout(() => Z.ref.current.focus());
18135
18135
  }), M = h.useCallback(
18136
18136
  (R, P, H) => {
18137
18137
  const Z = !U.current && !H;
18138
- (w.value !== void 0 && w.value === P || Z) && (j(R), Z && (U.current = !0));
18138
+ (w.value !== void 0 && w.value === P || Z) && (A(R), Z && (U.current = !0));
18139
18139
  },
18140
18140
  [w.value]
18141
18141
  ), q = h.useCallback(() => S == null ? void 0 : S.focus(), [S]), D = h.useCallback(
@@ -18238,9 +18238,9 @@ vm.displayName = Yk;
18238
18238
  var Jk = "SelectItemAlignedPosition", wm = h.forwardRef((e, t) => {
18239
18239
  const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Wn(ur, n), a = Vn(ur, n), [i, l] = h.useState(null), [c, d] = h.useState(null), f = Oe(t, (C) => d(C)), m = fa(n), p = h.useRef(!1), v = h.useRef(!0), { viewport: g, selectedItem: x, selectedItemText: b, focusSelectedItem: w } = a, S = h.useCallback(() => {
18240
18240
  if (s.trigger && s.valueNode && i && c && g && x && b) {
18241
- const C = s.trigger.getBoundingClientRect(), N = c.getBoundingClientRect(), j = s.valueNode.getBoundingClientRect(), $ = b.getBoundingClientRect();
18241
+ const C = s.trigger.getBoundingClientRect(), N = c.getBoundingClientRect(), A = s.valueNode.getBoundingClientRect(), $ = b.getBoundingClientRect();
18242
18242
  if (s.dir !== "rtl") {
18243
- const oe = $.left - N.left, le = j.left - oe, Ee = C.left - le, ye = C.width + Ee, Pe = Math.max(ye, N.width), qe = window.innerWidth - fn, ze = vi(le, [
18243
+ const oe = $.left - N.left, le = A.left - oe, Ee = C.left - le, ye = C.width + Ee, Pe = Math.max(ye, N.width), qe = window.innerWidth - fn, ze = vi(le, [
18244
18244
  fn,
18245
18245
  // Prevents the content from going off the starting edge of the
18246
18246
  // viewport. It may still go off the ending edge, but this can be
@@ -18251,13 +18251,13 @@ var Jk = "SelectItemAlignedPosition", wm = h.forwardRef((e, t) => {
18251
18251
  ]);
18252
18252
  i.style.minWidth = ye + "px", i.style.left = ze + "px";
18253
18253
  } else {
18254
- const oe = N.right - $.right, le = window.innerWidth - j.right - oe, Ee = window.innerWidth - C.right - le, ye = C.width + Ee, Pe = Math.max(ye, N.width), qe = window.innerWidth - fn, ze = vi(le, [
18254
+ const oe = N.right - $.right, le = window.innerWidth - A.right - oe, Ee = window.innerWidth - C.right - le, ye = C.width + Ee, Pe = Math.max(ye, N.width), qe = window.innerWidth - fn, ze = vi(le, [
18255
18255
  fn,
18256
18256
  Math.max(fn, qe - Pe)
18257
18257
  ]);
18258
18258
  i.style.minWidth = ye + "px", i.style.right = ze + "px";
18259
18259
  }
18260
- const O = m(), B = window.innerHeight - fn * 2, G = g.scrollHeight, _ = window.getComputedStyle(c), U = parseInt(_.borderTopWidth, 10), Y = parseInt(_.paddingTop, 10), z = parseInt(_.borderBottomWidth, 10), A = parseInt(_.paddingBottom, 10), k = U + Y + G + A + z, K = Math.min(x.offsetHeight * 5, k), J = window.getComputedStyle(g), M = parseInt(J.paddingTop, 10), q = parseInt(J.paddingBottom, 10), D = C.top + C.height / 2 - fn, L = B - D, X = x.offsetHeight / 2, R = x.offsetTop + X, P = U + Y + R, H = k - P;
18260
+ const O = m(), B = window.innerHeight - fn * 2, G = g.scrollHeight, _ = window.getComputedStyle(c), U = parseInt(_.borderTopWidth, 10), Y = parseInt(_.paddingTop, 10), z = parseInt(_.borderBottomWidth, 10), j = parseInt(_.paddingBottom, 10), k = U + Y + G + j + z, K = Math.min(x.offsetHeight * 5, k), J = window.getComputedStyle(g), M = parseInt(J.paddingTop, 10), q = parseInt(J.paddingBottom, 10), D = C.top + C.height / 2 - fn, L = B - D, X = x.offsetHeight / 2, R = x.offsetTop + X, P = U + Y + R, H = k - P;
18261
18261
  if (P <= D) {
18262
18262
  const oe = O.length > 0 && x === O[O.length - 1].ref.current;
18263
18263
  i.style.bottom = "0px";
@@ -19450,13 +19450,13 @@ var dg = "ToastViewport", sI = ["F8"], Ri = "toast.viewportPause", Ii = "toast.v
19450
19450
  var T, y, C;
19451
19451
  const S = w.altKey || w.ctrlKey || w.metaKey;
19452
19452
  if (w.key === "Tab" && !S) {
19453
- const N = document.activeElement, j = w.shiftKey;
19454
- if (w.target === x && j) {
19453
+ const N = document.activeElement, A = w.shiftKey;
19454
+ if (w.target === x && A) {
19455
19455
  (T = c.current) == null || T.focus();
19456
19456
  return;
19457
19457
  }
19458
- const B = g({ tabbingDirection: j ? "backwards" : "forwards" }), G = B.findIndex((_) => _ === N);
19459
- qa(B.slice(G + 1)) ? w.preventDefault() : j ? (y = c.current) == null || y.focus() : (C = d.current) == null || C.focus();
19458
+ const B = g({ tabbingDirection: A ? "backwards" : "forwards" }), G = B.findIndex((_) => _ === N);
19459
+ qa(B.slice(G + 1)) ? w.preventDefault() : A ? (y = c.current) == null || y.focus() : (C = d.current) == null || C.focus();
19460
19460
  }
19461
19461
  };
19462
19462
  return x.addEventListener("keydown", b), () => x.removeEventListener("keydown", b);
@@ -19576,7 +19576,7 @@ var [uI, dI] = cg(Bo, {
19576
19576
  onSwipeCancel: m,
19577
19577
  onSwipeEnd: p,
19578
19578
  ...v
19579
- } = e, g = va(Bo, n), [x, b] = h.useState(null), w = Oe(t, (_) => b(_)), S = h.useRef(null), E = h.useRef(null), T = o || g.duration, y = h.useRef(0), C = h.useRef(T), N = h.useRef(0), { onToastAdd: j, onToastRemove: $ } = g, O = yt(() => {
19579
+ } = e, g = va(Bo, n), [x, b] = h.useState(null), w = Oe(t, (_) => b(_)), S = h.useRef(null), E = h.useRef(null), T = o || g.duration, y = h.useRef(0), C = h.useRef(T), N = h.useRef(0), { onToastAdd: A, onToastRemove: $ } = g, O = yt(() => {
19580
19580
  var U;
19581
19581
  (x == null ? void 0 : x.contains(document.activeElement)) && ((U = g.viewport) == null || U.focus()), a();
19582
19582
  }), B = h.useCallback(
@@ -19600,7 +19600,7 @@ var [uI, dI] = cg(Bo, {
19600
19600
  }
19601
19601
  }, [g.viewport, T, l, c, B]), h.useEffect(() => {
19602
19602
  s && !g.isClosePausedRef.current && B(T);
19603
- }, [s, T, g.isClosePausedRef, B]), h.useEffect(() => (j(), () => $()), [j, $]);
19603
+ }, [s, T, g.isClosePausedRef, B]), h.useEffect(() => (A(), () => $()), [A, $]);
19604
19604
  const G = h.useMemo(() => x ? yg(x) : null, [x]);
19605
19605
  return g.viewport ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
19606
19606
  G && /* @__PURE__ */ u.jsx(
@@ -19637,7 +19637,7 @@ var [uI, dI] = cg(Bo, {
19637
19637
  }),
19638
19638
  onPointerMove: ie(e.onPointerMove, (_) => {
19639
19639
  if (!S.current) return;
19640
- const U = _.clientX - S.current.x, Y = _.clientY - S.current.y, z = !!E.current, A = ["left", "right"].includes(g.swipeDirection), k = ["left", "up"].includes(g.swipeDirection) ? Math.min : Math.max, K = A ? k(0, U) : 0, J = A ? 0 : k(0, Y), M = _.pointerType === "touch" ? 10 : 2, q = { x: K, y: J }, D = { originalEvent: _, delta: q };
19640
+ const U = _.clientX - S.current.x, Y = _.clientY - S.current.y, z = !!E.current, j = ["left", "right"].includes(g.swipeDirection), k = ["left", "up"].includes(g.swipeDirection) ? Math.min : Math.max, K = j ? k(0, U) : 0, J = j ? 0 : k(0, Y), M = _.pointerType === "touch" ? 10 : 2, q = { x: K, y: J }, D = { originalEvent: _, delta: q };
19641
19641
  z ? (E.current = q, Zo(iI, f, D, {
19642
19642
  discrete: !1
19643
19643
  })) : Au(q, g.swipeDirection, M) ? (E.current = q, Zo(aI, d, D, {
@@ -19647,13 +19647,13 @@ var [uI, dI] = cg(Bo, {
19647
19647
  onPointerUp: ie(e.onPointerUp, (_) => {
19648
19648
  const U = E.current, Y = _.target;
19649
19649
  if (Y.hasPointerCapture(_.pointerId) && Y.releasePointerCapture(_.pointerId), E.current = null, S.current = null, U) {
19650
- const z = _.currentTarget, A = { originalEvent: _, delta: U };
19651
- Au(U, g.swipeDirection, g.swipeThreshold) ? Zo(cI, p, A, {
19650
+ const z = _.currentTarget, j = { originalEvent: _, delta: U };
19651
+ Au(U, g.swipeDirection, g.swipeThreshold) ? Zo(cI, p, j, {
19652
19652
  discrete: !0
19653
19653
  }) : Zo(
19654
19654
  lI,
19655
19655
  m,
19656
- A,
19656
+ j,
19657
19657
  {
19658
19658
  discrete: !0
19659
19659
  }
@@ -19995,7 +19995,7 @@ function XI(e) {
19995
19995
  }
19996
19996
  var JI = (e) => {
19997
19997
  var t, n, r, o, s, a, i, l, c, d, f;
19998
- let { invert: m, toast: p, unstyled: v, interacting: g, setHeights: x, visibleToasts: b, heights: w, index: S, toasts: E, expanded: T, removeToast: y, defaultRichColors: C, closeButton: N, style: j, cancelButtonStyle: $, actionButtonStyle: O, className: B = "", descriptionClassName: G = "", duration: _, position: U, gap: Y, loadingIcon: z, expandByDefault: A, classNames: k, icons: K, closeButtonAriaLabel: J = "Close toast", pauseWhenPageIsHidden: M } = e, [q, D] = F.useState(null), [L, X] = F.useState(null), [R, P] = F.useState(!1), [H, Z] = F.useState(!1), [oe, le] = F.useState(!1), [Ee, ye] = F.useState(!1), [Pe, qe] = F.useState(!1), [ze, We] = F.useState(0), [He, Tt] = F.useState(0), Ct = F.useRef(p.duration || _ || ju), ut = F.useRef(null), Ve = F.useRef(null), _e = S === 0, Ge = S + 1 <= b, Ie = p.type, Ye = p.dismissible !== !1, Ze = p.className || "", Et = p.descriptionClassName || "", Qe = F.useMemo(() => w.findIndex((ge) => ge.toastId === p.id) || 0, [w, p.id]), kt = F.useMemo(() => {
19998
+ let { invert: m, toast: p, unstyled: v, interacting: g, setHeights: x, visibleToasts: b, heights: w, index: S, toasts: E, expanded: T, removeToast: y, defaultRichColors: C, closeButton: N, style: A, cancelButtonStyle: $, actionButtonStyle: O, className: B = "", descriptionClassName: G = "", duration: _, position: U, gap: Y, loadingIcon: z, expandByDefault: j, classNames: k, icons: K, closeButtonAriaLabel: J = "Close toast", pauseWhenPageIsHidden: M } = e, [q, D] = F.useState(null), [L, X] = F.useState(null), [R, P] = F.useState(!1), [H, Z] = F.useState(!1), [oe, le] = F.useState(!1), [Ee, ye] = F.useState(!1), [Pe, qe] = F.useState(!1), [ze, We] = F.useState(0), [He, Tt] = F.useState(0), Ct = F.useRef(p.duration || _ || ju), ut = F.useRef(null), Ve = F.useRef(null), _e = S === 0, Ge = S + 1 <= b, Ie = p.type, Ye = p.dismissible !== !1, Ze = p.className || "", Et = p.descriptionClassName || "", Qe = F.useMemo(() => w.findIndex((ge) => ge.toastId === p.id) || 0, [w, p.id]), kt = F.useMemo(() => {
19999
19999
  var ge;
20000
20000
  return (ge = p.closeButton) != null ? ge : N;
20001
20001
  }, [p.closeButton, N]), ht = F.useMemo(() => p.duration || _ || ju, [p.duration, _]), vt = F.useRef(0), At = F.useRef(0), _t = F.useRef(0), mt = F.useRef(null), [gt, Bt] = U.split("-"), Ke = F.useMemo(() => w.reduce((ge, De, Fe) => Fe >= Qe ? ge : ge + De.height, 0), [w, Qe]), $e = OI(), pt = p.invert || m, Rt = Ie === "loading";
@@ -20007,14 +20007,14 @@ var JI = (e) => {
20007
20007
  let ge = Ve.current;
20008
20008
  if (ge) {
20009
20009
  let De = ge.getBoundingClientRect().height;
20010
- return Tt(De), x((Fe) => [{ toastId: p.id, height: De, position: p.position }, ...Fe]), () => x((Fe) => Fe.filter((at) => at.toastId !== p.id));
20010
+ return Tt(De), x((Fe) => [{ toastId: p.id, height: De, position: p.position }, ...Fe]), () => x((Fe) => Fe.filter((st) => st.toastId !== p.id));
20011
20011
  }
20012
20012
  }, [x, p.id]), F.useLayoutEffect(() => {
20013
20013
  if (!R) return;
20014
20014
  let ge = Ve.current, De = ge.style.height;
20015
20015
  ge.style.height = "auto";
20016
20016
  let Fe = ge.getBoundingClientRect().height;
20017
- ge.style.height = De, Tt(Fe), x((at) => at.find((rt) => rt.toastId === p.id) ? at.map((rt) => rt.toastId === p.id ? { ...rt, height: Fe } : rt) : [{ toastId: p.id, height: Fe, position: p.position }, ...at]);
20017
+ ge.style.height = De, Tt(Fe), x((st) => st.find((nt) => nt.toastId === p.id) ? st.map((nt) => nt.toastId === p.id ? { ...nt, height: Fe } : nt) : [{ toastId: p.id, height: Fe, position: p.position }, ...st]);
20018
20018
  }, [R, p.title, p.description, x, p.id]);
20019
20019
  let dt = F.useCallback(() => {
20020
20020
  Z(!0), We(At.current), x((ge) => ge.filter((De) => De.toastId !== p.id)), setTimeout(() => {
@@ -20041,27 +20041,27 @@ var JI = (e) => {
20041
20041
  var ge, De, Fe;
20042
20042
  return K != null && K.loading ? F.createElement("div", { className: dn(k == null ? void 0 : k.loader, (ge = p == null ? void 0 : p.classNames) == null ? void 0 : ge.loader, "sonner-loader"), "data-visible": Ie === "loading" }, K.loading) : z ? F.createElement("div", { className: dn(k == null ? void 0 : k.loader, (De = p == null ? void 0 : p.classNames) == null ? void 0 : De.loader, "sonner-loader"), "data-visible": Ie === "loading" }, z) : F.createElement(NI, { className: dn(k == null ? void 0 : k.loader, (Fe = p == null ? void 0 : p.classNames) == null ? void 0 : Fe.loader), visible: Ie === "loading" });
20043
20043
  }
20044
- return F.createElement("li", { tabIndex: 0, ref: Ve, className: dn(B, Ze, k == null ? void 0 : k.toast, (t = p == null ? void 0 : p.classNames) == null ? void 0 : t.toast, k == null ? void 0 : k.default, k == null ? void 0 : k[Ie], (n = p == null ? void 0 : p.classNames) == null ? void 0 : n[Ie]), "data-sonner-toast": "", "data-rich-colors": (r = p.richColors) != null ? r : C, "data-styled": !(p.jsx || p.unstyled || v), "data-mounted": R, "data-promise": !!p.promise, "data-swiped": Pe, "data-removed": H, "data-visible": Ge, "data-y-position": gt, "data-x-position": Bt, "data-index": S, "data-front": _e, "data-swiping": oe, "data-dismissible": Ye, "data-type": Ie, "data-invert": pt, "data-swipe-out": Ee, "data-swipe-direction": L, "data-expanded": !!(T || A && R), style: { "--index": S, "--toasts-before": S, "--z-index": E.length - S, "--offset": `${H ? ze : At.current}px`, "--initial-height": A ? "auto" : `${He}px`, ...j, ...p.style }, onDragEnd: () => {
20044
+ return F.createElement("li", { tabIndex: 0, ref: Ve, className: dn(B, Ze, k == null ? void 0 : k.toast, (t = p == null ? void 0 : p.classNames) == null ? void 0 : t.toast, k == null ? void 0 : k.default, k == null ? void 0 : k[Ie], (n = p == null ? void 0 : p.classNames) == null ? void 0 : n[Ie]), "data-sonner-toast": "", "data-rich-colors": (r = p.richColors) != null ? r : C, "data-styled": !(p.jsx || p.unstyled || v), "data-mounted": R, "data-promise": !!p.promise, "data-swiped": Pe, "data-removed": H, "data-visible": Ge, "data-y-position": gt, "data-x-position": Bt, "data-index": S, "data-front": _e, "data-swiping": oe, "data-dismissible": Ye, "data-type": Ie, "data-invert": pt, "data-swipe-out": Ee, "data-swipe-direction": L, "data-expanded": !!(T || j && R), style: { "--index": S, "--toasts-before": S, "--z-index": E.length - S, "--offset": `${H ? ze : At.current}px`, "--initial-height": j ? "auto" : `${He}px`, ...A, ...p.style }, onDragEnd: () => {
20045
20045
  le(!1), D(null), mt.current = null;
20046
20046
  }, onPointerDown: (ge) => {
20047
20047
  Rt || !Ye || (ut.current = /* @__PURE__ */ new Date(), We(At.current), ge.target.setPointerCapture(ge.pointerId), ge.target.tagName !== "BUTTON" && (le(!0), mt.current = { x: ge.clientX, y: ge.clientY }));
20048
20048
  }, onPointerUp: () => {
20049
- var ge, De, Fe, at;
20049
+ var ge, De, Fe, st;
20050
20050
  if (Ee || !Ye) return;
20051
20051
  mt.current = null;
20052
- let rt = Number(((ge = Ve.current) == null ? void 0 : ge.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), it = Number(((De = Ve.current) == null ? void 0 : De.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), xt = (/* @__PURE__ */ new Date()).getTime() - ((Fe = ut.current) == null ? void 0 : Fe.getTime()), V = q === "x" ? rt : it, re = Math.abs(V) / xt;
20053
- if (Math.abs(V) >= GI || re > 0.11) {
20054
- We(At.current), (at = p.onDismiss) == null || at.call(p, p), X(q === "x" ? rt > 0 ? "right" : "left" : it > 0 ? "down" : "up"), dt(), ye(!0), qe(!1);
20052
+ let nt = Number(((ge = Ve.current) == null ? void 0 : ge.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), at = Number(((De = Ve.current) == null ? void 0 : De.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), xt = (/* @__PURE__ */ new Date()).getTime() - ((Fe = ut.current) == null ? void 0 : Fe.getTime()), W = q === "x" ? nt : at, re = Math.abs(W) / xt;
20053
+ if (Math.abs(W) >= GI || re > 0.11) {
20054
+ We(At.current), (st = p.onDismiss) == null || st.call(p, p), X(q === "x" ? nt > 0 ? "right" : "left" : at > 0 ? "down" : "up"), dt(), ye(!0), qe(!1);
20055
20055
  return;
20056
20056
  }
20057
20057
  le(!1), D(null);
20058
20058
  }, onPointerMove: (ge) => {
20059
- var De, Fe, at, rt;
20059
+ var De, Fe, st, nt;
20060
20060
  if (!mt.current || !Ye || ((De = window.getSelection()) == null ? void 0 : De.toString().length) > 0) return;
20061
- let it = ge.clientY - mt.current.y, xt = ge.clientX - mt.current.x, V = (Fe = e.swipeDirections) != null ? Fe : XI(U);
20062
- !q && (Math.abs(xt) > 1 || Math.abs(it) > 1) && D(Math.abs(xt) > Math.abs(it) ? "x" : "y");
20061
+ let at = ge.clientY - mt.current.y, xt = ge.clientX - mt.current.x, W = (Fe = e.swipeDirections) != null ? Fe : XI(U);
20062
+ !q && (Math.abs(xt) > 1 || Math.abs(at) > 1) && D(Math.abs(xt) > Math.abs(at) ? "x" : "y");
20063
20063
  let re = { x: 0, y: 0 };
20064
- q === "y" ? (V.includes("top") || V.includes("bottom")) && (V.includes("top") && it < 0 || V.includes("bottom") && it > 0) && (re.y = it) : q === "x" && (V.includes("left") || V.includes("right")) && (V.includes("left") && xt < 0 || V.includes("right") && xt > 0) && (re.x = xt), (Math.abs(re.x) > 0 || Math.abs(re.y) > 0) && qe(!0), (at = Ve.current) == null || at.style.setProperty("--swipe-amount-x", `${re.x}px`), (rt = Ve.current) == null || rt.style.setProperty("--swipe-amount-y", `${re.y}px`);
20064
+ q === "y" ? (W.includes("top") || W.includes("bottom")) && (W.includes("top") && at < 0 || W.includes("bottom") && at > 0) && (re.y = at) : q === "x" && (W.includes("left") || W.includes("right")) && (W.includes("left") && xt < 0 || W.includes("right") && xt > 0) && (re.x = xt), (Math.abs(re.x) > 0 || Math.abs(re.y) > 0) && qe(!0), (st = Ve.current) == null || st.style.setProperty("--swipe-amount-x", `${re.x}px`), (nt = Ve.current) == null || nt.style.setProperty("--swipe-amount-y", `${re.y}px`);
20065
20065
  } }, kt && !p.jsx ? F.createElement("button", { "aria-label": J, "data-disabled": Rt, "data-close-button": !0, onClick: Rt || !Ye ? () => {
20066
20066
  } : () => {
20067
20067
  var ge;
@@ -20094,7 +20094,7 @@ function ZI(e, t) {
20094
20094
  }), n;
20095
20095
  }
20096
20096
  var QI = zg(function(e, t) {
20097
- let { invert: n, position: r = "bottom-right", hotkey: o = ["altKey", "KeyT"], expand: s, closeButton: a, className: i, offset: l, mobileOffset: c, theme: d = "light", richColors: f, duration: m, style: p, visibleToasts: v = UI, toastOptions: g, dir: x = Pu(), gap: b = qI, loadingIcon: w, icons: S, containerAriaLabel: E = "Notifications", pauseWhenPageIsHidden: T } = e, [y, C] = F.useState([]), N = F.useMemo(() => Array.from(new Set([r].concat(y.filter((M) => M.position).map((M) => M.position)))), [y, r]), [j, $] = F.useState([]), [O, B] = F.useState(!1), [G, _] = F.useState(!1), [U, Y] = F.useState(d !== "system" ? d : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), z = F.useRef(null), A = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), k = F.useRef(null), K = F.useRef(!1), J = F.useCallback((M) => {
20097
+ let { invert: n, position: r = "bottom-right", hotkey: o = ["altKey", "KeyT"], expand: s, closeButton: a, className: i, offset: l, mobileOffset: c, theme: d = "light", richColors: f, duration: m, style: p, visibleToasts: v = UI, toastOptions: g, dir: x = Pu(), gap: b = qI, loadingIcon: w, icons: S, containerAriaLabel: E = "Notifications", pauseWhenPageIsHidden: T } = e, [y, C] = F.useState([]), N = F.useMemo(() => Array.from(new Set([r].concat(y.filter((M) => M.position).map((M) => M.position)))), [y, r]), [A, $] = F.useState([]), [O, B] = F.useState(!1), [G, _] = F.useState(!1), [U, Y] = F.useState(d !== "system" ? d : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), z = F.useRef(null), j = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), k = F.useRef(null), K = F.useRef(!1), J = F.useCallback((M) => {
20098
20098
  C((q) => {
20099
20099
  var D;
20100
20100
  return (D = q.find((L) => L.id === M.id)) != null && D.delete || qt.dismiss(M.id), q.filter(({ id: L }) => L !== M.id);
@@ -20145,10 +20145,10 @@ var QI = zg(function(e, t) {
20145
20145
  if (z.current) return () => {
20146
20146
  k.current && (k.current.focus({ preventScroll: !0 }), k.current = null, K.current = !1);
20147
20147
  };
20148
- }, [z.current]), F.createElement("section", { ref: t, "aria-label": `${E} ${A}`, tabIndex: -1, "aria-live": "polite", "aria-relevant": "additions text", "aria-atomic": "false", suppressHydrationWarning: !0 }, N.map((M, q) => {
20148
+ }, [z.current]), F.createElement("section", { ref: t, "aria-label": `${E} ${j}`, tabIndex: -1, "aria-live": "polite", "aria-relevant": "additions text", "aria-atomic": "false", suppressHydrationWarning: !0 }, N.map((M, q) => {
20149
20149
  var D;
20150
20150
  let [L, X] = M.split("-");
20151
- return y.length ? F.createElement("ol", { key: M, dir: x === "auto" ? Pu() : x, tabIndex: -1, ref: z, className: i, "data-sonner-toaster": !0, "data-theme": U, "data-y-position": L, "data-lifted": O && y.length > 1 && !s, "data-x-position": X, style: { "--front-toast-height": `${((D = j[0]) == null ? void 0 : D.height) || 0}px`, "--width": `${KI}px`, "--gap": `${b}px`, ...p, ...ZI(l, c) }, onBlur: (R) => {
20151
+ return y.length ? F.createElement("ol", { key: M, dir: x === "auto" ? Pu() : x, tabIndex: -1, ref: z, className: i, "data-sonner-toaster": !0, "data-theme": U, "data-y-position": L, "data-lifted": O && y.length > 1 && !s, "data-x-position": X, style: { "--front-toast-height": `${((D = A[0]) == null ? void 0 : D.height) || 0}px`, "--width": `${KI}px`, "--gap": `${b}px`, ...p, ...ZI(l, c) }, onBlur: (R) => {
20152
20152
  K.current && !R.currentTarget.contains(R.relatedTarget) && (K.current = !1, k.current && (k.current.focus({ preventScroll: !0 }), k.current = null));
20153
20153
  }, onFocus: (R) => {
20154
20154
  R.target instanceof HTMLElement && R.target.dataset.dismissible === "false" || K.current || (K.current = !0, k.current = R.relatedTarget);
@@ -20158,7 +20158,7 @@ var QI = zg(function(e, t) {
20158
20158
  R.target instanceof HTMLElement && R.target.dataset.dismissible === "false" || _(!0);
20159
20159
  }, onPointerUp: () => _(!1) }, y.filter((R) => !R.position && q === 0 || R.position === M).map((R, P) => {
20160
20160
  var H, Z;
20161
- return F.createElement(JI, { key: R.id, icons: S, index: P, toast: R, defaultRichColors: f, duration: (H = g == null ? void 0 : g.duration) != null ? H : m, className: g == null ? void 0 : g.className, descriptionClassName: g == null ? void 0 : g.descriptionClassName, invert: n, visibleToasts: v, closeButton: (Z = g == null ? void 0 : g.closeButton) != null ? Z : a, interacting: G, position: M, style: g == null ? void 0 : g.style, unstyled: g == null ? void 0 : g.unstyled, classNames: g == null ? void 0 : g.classNames, cancelButtonStyle: g == null ? void 0 : g.cancelButtonStyle, actionButtonStyle: g == null ? void 0 : g.actionButtonStyle, removeToast: J, toasts: y.filter((oe) => oe.position == R.position), heights: j.filter((oe) => oe.position == R.position), setHeights: $, expandByDefault: s, gap: b, loadingIcon: w, expanded: O, pauseWhenPageIsHidden: T, swipeDirections: e.swipeDirections });
20161
+ return F.createElement(JI, { key: R.id, icons: S, index: P, toast: R, defaultRichColors: f, duration: (H = g == null ? void 0 : g.duration) != null ? H : m, className: g == null ? void 0 : g.className, descriptionClassName: g == null ? void 0 : g.descriptionClassName, invert: n, visibleToasts: v, closeButton: (Z = g == null ? void 0 : g.closeButton) != null ? Z : a, interacting: G, position: M, style: g == null ? void 0 : g.style, unstyled: g == null ? void 0 : g.unstyled, classNames: g == null ? void 0 : g.classNames, cancelButtonStyle: g == null ? void 0 : g.cancelButtonStyle, actionButtonStyle: g == null ? void 0 : g.actionButtonStyle, removeToast: J, toasts: y.filter((oe) => oe.position == R.position), heights: A.filter((oe) => oe.position == R.position), setHeights: $, expandByDefault: s, gap: b, loadingIcon: w, expanded: O, pauseWhenPageIsHidden: T, swipeDirections: e.swipeDirections });
20162
20162
  })) : null;
20163
20163
  }));
20164
20164
  });
@@ -20185,7 +20185,7 @@ export {
20185
20185
  aw as ApiProvider,
20186
20186
  Gy as ArtifactRenderer,
20187
20187
  a0 as Badge,
20188
- nt as Button,
20188
+ tt as Button,
20189
20189
  hf as Card,
20190
20190
  oi as CardContent,
20191
20191
  xf as CardDescription,