teodor-new-chat-ui 4.3.144 → 4.3.145
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 +57 -57
- package/dist/index.umd.js +6 -6
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -371,7 +371,7 @@ function zg() {
|
|
|
371
371
|
function et(E) {
|
|
372
372
|
return "" + E;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function Pt(E) {
|
|
375
375
|
if (qe(E))
|
|
376
376
|
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(E)), et(E);
|
|
377
377
|
}
|
|
@@ -454,7 +454,7 @@ function zg() {
|
|
|
454
454
|
function Ve(E, Y, ae, Te, Ye) {
|
|
455
455
|
{
|
|
456
456
|
var Ge, Ue = {}, Oe = null, _t = null;
|
|
457
|
-
ae !== void 0 && (
|
|
457
|
+
ae !== void 0 && (Pt(ae), Oe = "" + ae), Yt(Y) && (Pt(Y.key), Oe = "" + Y.key), it(Y) && (_t = Y.ref, Xt(Y, Ye));
|
|
458
458
|
for (Ge in Y)
|
|
459
459
|
Pe.call(Y, Ge) && !tt.hasOwnProperty(Ge) && (Ue[Ge] = Y[Ge]);
|
|
460
460
|
if (E && E.defaultProps) {
|
|
@@ -469,13 +469,13 @@ function zg() {
|
|
|
469
469
|
return ft(E, Oe, _t, Ye, Te, kt.current, Ue);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
var Dt = y.ReactCurrentOwner,
|
|
472
|
+
var Dt = y.ReactCurrentOwner, Ot = y.ReactDebugCurrentFrame;
|
|
473
473
|
function G(E) {
|
|
474
474
|
if (E) {
|
|
475
475
|
var Y = E._owner, ae = ye(E.type, E._source, Y ? Y.type : null);
|
|
476
|
-
|
|
476
|
+
Ot.setExtraStackFrame(ae);
|
|
477
477
|
} else
|
|
478
|
-
|
|
478
|
+
Ot.setExtraStackFrame(null);
|
|
479
479
|
}
|
|
480
480
|
var Re;
|
|
481
481
|
Re = !1;
|
|
@@ -3393,13 +3393,13 @@ function Gy(e = {}) {
|
|
|
3393
3393
|
Xe = { Authorization: `Bearer ${r}` };
|
|
3394
3394
|
else if (typeof window < "u") {
|
|
3395
3395
|
const Ve = window.__AUTH_TOKEN__, Dt = ((ge = window.localStorage) == null ? void 0 : ge.getItem("authToken")) || null;
|
|
3396
|
-
let
|
|
3396
|
+
let Ot = null;
|
|
3397
3397
|
try {
|
|
3398
3398
|
const Re = (_e = window.localStorage) == null ? void 0 : _e.getItem("chat-settings");
|
|
3399
|
-
Re && (
|
|
3399
|
+
Re && (Ot = ((J = JSON.parse(Re)) == null ? void 0 : J.apiKey) || null);
|
|
3400
3400
|
} catch {
|
|
3401
3401
|
}
|
|
3402
|
-
const G = Ve || Dt ||
|
|
3402
|
+
const G = Ve || Dt || Ot || null;
|
|
3403
3403
|
G && (Xe = { Authorization: `Bearer ${G}` });
|
|
3404
3404
|
}
|
|
3405
3405
|
} catch {
|
|
@@ -3442,7 +3442,7 @@ function Gy(e = {}) {
|
|
|
3442
3442
|
throw (ke = j == null ? void 0 : j.onConnectionError) == null || ke.call(j, Ve), ne = !0, F = "error", L = Ve, new Error(Ve);
|
|
3443
3443
|
}
|
|
3444
3444
|
w(!0);
|
|
3445
|
-
const et = qe.body.getReader(),
|
|
3445
|
+
const et = qe.body.getReader(), Pt = new TextDecoder();
|
|
3446
3446
|
let kt = "", tt = [];
|
|
3447
3447
|
C.current = 0, x(0);
|
|
3448
3448
|
let vt = 0, At = null;
|
|
@@ -3464,14 +3464,14 @@ function Gy(e = {}) {
|
|
|
3464
3464
|
}
|
|
3465
3465
|
}, 5e3), Zt = 1024 * 1024;
|
|
3466
3466
|
try {
|
|
3467
|
-
const ft = qe.headers.get("X-Thread-Id") || qe.headers.get("x-thread-id"), Ve = qe.headers.get("X-Thread-Created") || qe.headers.get("x-thread-created"), Dt = ft ?? null,
|
|
3467
|
+
const ft = qe.headers.get("X-Thread-Id") || qe.headers.get("x-thread-id"), Ve = qe.headers.get("X-Thread-Created") || qe.headers.get("x-thread-created"), Dt = ft ?? null, Ot = String(Ve ?? "").toLowerCase() === "true";
|
|
3468
3468
|
for (b.current && !b.current.threadId && (b.current = {
|
|
3469
3469
|
...b.current,
|
|
3470
3470
|
threadId: Dt
|
|
3471
|
-
}), (ee = j == null ? void 0 : j.onOpen) == null || ee.call(j, { threadId: Dt, created:
|
|
3471
|
+
}), (ee = j == null ? void 0 : j.onOpen) == null || ee.call(j, { threadId: Dt, created: Ot }); ; ) {
|
|
3472
3472
|
const { value: G, done: Re } = await et.read();
|
|
3473
3473
|
if (Re) break;
|
|
3474
|
-
kt +=
|
|
3474
|
+
kt += Pt.decode(G, { stream: !0 }), kt.length > Zt && (kt = "", console.warn("Stream buffer reset: exceeded 1MB"));
|
|
3475
3475
|
let ve;
|
|
3476
3476
|
for (; (ve = kt.indexOf(`
|
|
3477
3477
|
|
|
@@ -4250,7 +4250,7 @@ function wv({
|
|
|
4250
4250
|
St(() => {
|
|
4251
4251
|
Ce.current = k;
|
|
4252
4252
|
}, [k]);
|
|
4253
|
-
const Xe = Ee(!1), st = Ee([]), Qe = Ee(null), Je = Ee(null), qe = Ee(/* @__PURE__ */ new Map()), et = Ee(k),
|
|
4253
|
+
const Xe = Ee(!1), st = Ee([]), Qe = Ee(null), Je = Ee(null), qe = Ee(/* @__PURE__ */ new Map()), et = Ee(k), Pt = Ee(!1), kt = Ee(null), tt = Ee(/* @__PURE__ */ new Map()), vt = Ee(/* @__PURE__ */ new Map()), {
|
|
4254
4254
|
threadCheckpoints: At,
|
|
4255
4255
|
syncActiveThreadCheckpoints: it,
|
|
4256
4256
|
updateCheckpointCache: Yt,
|
|
@@ -4260,7 +4260,7 @@ function wv({
|
|
|
4260
4260
|
resetThreadCheckpoints: ft,
|
|
4261
4261
|
getSnapshotCache: Ve,
|
|
4262
4262
|
getSnapshotFromCache: Dt
|
|
4263
|
-
} = yv({ currentThreadId: k, currentThreadIdRef: Ce }),
|
|
4263
|
+
} = yv({ currentThreadId: k, currentThreadIdRef: Ce }), Ot = de(() => {
|
|
4264
4264
|
var K;
|
|
4265
4265
|
const R = vt.current;
|
|
4266
4266
|
if (R.size <= $c) return;
|
|
@@ -4322,12 +4322,12 @@ function wv({
|
|
|
4322
4322
|
usedHistoryApi: !1
|
|
4323
4323
|
};
|
|
4324
4324
|
}
|
|
4325
|
-
})().then((Be) => (vt.current.set(le, { result: Be, timestamp: Date.now() }),
|
|
4325
|
+
})().then((Be) => (vt.current.set(le, { result: Be, timestamp: Date.now() }), Ot(), Be)).finally(() => {
|
|
4326
4326
|
tt.current.get(le) === bt && tt.current.delete(le);
|
|
4327
4327
|
});
|
|
4328
4328
|
return tt.current.set(le, bt), bt;
|
|
4329
4329
|
},
|
|
4330
|
-
[c, G,
|
|
4330
|
+
[c, G, Ot]
|
|
4331
4331
|
), ve = de((R, I) => new Promise((U, K) => {
|
|
4332
4332
|
const he = async () => {
|
|
4333
4333
|
Xe.current = !0;
|
|
@@ -4442,7 +4442,7 @@ function wv({
|
|
|
4442
4442
|
}), F(le.interrupt ?? null), ue(le.nextCursor ?? null), Q(!!le.nextCursor), ee(le.checkpointId ?? void 0), q(le.checkpointNs ?? void 0), ce(le.nextCursorNs ?? void 0);
|
|
4443
4443
|
return;
|
|
4444
4444
|
}
|
|
4445
|
-
const Be = qe.current.get(he), Et = (Be == null ? void 0 : Be.snapshot) ?? null, Wt = Array.isArray(Et == null ? void 0 : Et.messages) ? Et.messages : [], fn = hn(Et), Wn = Array.isArray(R == null ? void 0 : R.messages) ? R.messages : [], qt = /* @__PURE__ */ new Set(),
|
|
4445
|
+
const Be = qe.current.get(he), Et = (Be == null ? void 0 : Be.snapshot) ?? null, Wt = Array.isArray(Et == null ? void 0 : Et.messages) ? Et.messages : [], fn = hn(Et), Wn = Array.isArray(R == null ? void 0 : R.messages) ? R.messages : [], qt = /* @__PURE__ */ new Set(), Mt = [...Wn, ...Wt].filter((Gt) => {
|
|
4446
4446
|
const $i = Gt == null ? void 0 : Gt.id;
|
|
4447
4447
|
return $i ? qt.has($i) ? !1 : (qt.add($i), !0) : !0;
|
|
4448
4448
|
}), tr = _d(fn, le), Cr = {
|
|
@@ -4451,10 +4451,10 @@ function wv({
|
|
|
4451
4451
|
createdAt: le.createdAt ?? fn.createdAt ?? null,
|
|
4452
4452
|
parentId: le.parentId ?? fn.parentId ?? null,
|
|
4453
4453
|
branchLabel: le.branchLabel ?? fn.branchLabel ?? null,
|
|
4454
|
-
lastMessageId: ((Fi =
|
|
4455
|
-
messagesLen:
|
|
4456
|
-
hasMessages:
|
|
4457
|
-
messages:
|
|
4454
|
+
lastMessageId: ((Fi = Mt[Mt.length - 1]) == null ? void 0 : Fi.id) ?? null,
|
|
4455
|
+
messagesLen: Mt.length,
|
|
4456
|
+
hasMessages: Mt.length > 0,
|
|
4457
|
+
messages: Mt,
|
|
4458
4458
|
nextCursor: le.nextCursor ?? fn.nextCursor ?? null,
|
|
4459
4459
|
nextCursorNs: le.nextCursorNs ?? fn.nextCursorNs ?? null,
|
|
4460
4460
|
interrupt: fn.interrupt ?? le.interrupt ?? null,
|
|
@@ -4698,11 +4698,11 @@ function wv({
|
|
|
4698
4698
|
On(R);
|
|
4699
4699
|
const I = (he) => {
|
|
4700
4700
|
const le = Yi(h, he);
|
|
4701
|
-
kt.current !== le && (kt.current = le,
|
|
4701
|
+
kt.current !== le && (kt.current = le, Pt.current = !1), S(le);
|
|
4702
4702
|
const ht = Xi(le);
|
|
4703
4703
|
go(() => {
|
|
4704
4704
|
C(os(ht));
|
|
4705
|
-
}), he && !
|
|
4705
|
+
}), he && !Pt.current && (Pt.current = !0);
|
|
4706
4706
|
};
|
|
4707
4707
|
I(R);
|
|
4708
4708
|
const U = (K = c.onTokenChange) == null ? void 0 : K.call(c, (he) => {
|
|
@@ -4800,26 +4800,26 @@ function wv({
|
|
|
4800
4800
|
if (qt)
|
|
4801
4801
|
Ue(qt), Wt = !0;
|
|
4802
4802
|
else {
|
|
4803
|
-
const
|
|
4804
|
-
|
|
4803
|
+
const Mt = m(R);
|
|
4804
|
+
Mt && (qe.current.set(R, Mt), Ue(Mt), Wt = !0);
|
|
4805
4805
|
}
|
|
4806
4806
|
}
|
|
4807
4807
|
const fn = K || !Wt || !!I || !!U, Wn = async (qt) => {
|
|
4808
4808
|
qt && $(!0), Qe.current = R;
|
|
4809
4809
|
try {
|
|
4810
|
-
const
|
|
4810
|
+
const Mt = await Re(
|
|
4811
4811
|
{ threadId: R, checkpointId: I, checkpointNs: U },
|
|
4812
4812
|
{ force: K }
|
|
4813
|
-
), { latest: tr, checkpoints: Cr, snapshots: Vr } = Os(
|
|
4813
|
+
), { latest: tr, checkpoints: Cr, snapshots: Vr } = Os(Mt.payload);
|
|
4814
4814
|
go(() => {
|
|
4815
4815
|
Ge(tr, "replace", R), Yt(R, Cr, "replace"), Xt(R, Vr, "replace"), j(null), qt && $(!1);
|
|
4816
|
-
}),
|
|
4816
|
+
}), Mt.usedHistoryApi || ae(R).then((Cn) => {
|
|
4817
4817
|
Jt(R, Cn);
|
|
4818
4818
|
}).catch((Cn) => {
|
|
4819
4819
|
console.warn("[ChatSessionProvider] Failed to refresh checkpoint summaries:", Cn);
|
|
4820
4820
|
});
|
|
4821
|
-
} catch (
|
|
4822
|
-
if (Y(
|
|
4821
|
+
} catch (Mt) {
|
|
4822
|
+
if (Y(Mt))
|
|
4823
4823
|
try {
|
|
4824
4824
|
const tr = await ae(R), Cr = Jt(R, tr);
|
|
4825
4825
|
if (Q(!1), ue(null), ce(void 0), ee(void 0), q(void 0), Cr) {
|
|
@@ -4829,7 +4829,7 @@ function wv({
|
|
|
4829
4829
|
} catch (tr) {
|
|
4830
4830
|
console.warn("[ChatSessionProvider] Failed to fetch checkpoint summaries after timeout:", tr);
|
|
4831
4831
|
}
|
|
4832
|
-
throw (!Wt || K || qt) && (i == null || i(String(
|
|
4832
|
+
throw (!Wt || K || qt) && (i == null || i(String(Mt))), j(String(Mt)), Mt;
|
|
4833
4833
|
} finally {
|
|
4834
4834
|
Qe.current = null;
|
|
4835
4835
|
}
|
|
@@ -4965,7 +4965,7 @@ function wv({
|
|
|
4965
4965
|
le
|
|
4966
4966
|
), Wt = [...Be];
|
|
4967
4967
|
K && K.trim() && Wt.push({ type: "text", text: K.trim() });
|
|
4968
|
-
const fn = !!U, Wn = fn ? (I == null ? void 0 : I.checkpointId) ?? H.lastCheckpointId ?? void 0 : void 0, qt = fn ? (I == null ? void 0 : I.checkpointNs) ?? H.lastCheckpointNs ?? void 0 : void 0,
|
|
4968
|
+
const fn = !!U, Wn = fn ? (I == null ? void 0 : I.checkpointId) ?? H.lastCheckpointId ?? void 0 : void 0, qt = fn ? (I == null ? void 0 : I.checkpointNs) ?? H.lastCheckpointNs ?? void 0 : void 0, Mt = {
|
|
4969
4969
|
id: ((Tr = crypto.randomUUID) == null ? void 0 : Tr.call(crypto)) || `user-${Date.now()}`,
|
|
4970
4970
|
role: "user",
|
|
4971
4971
|
content: Wt,
|
|
@@ -4973,11 +4973,11 @@ function wv({
|
|
|
4973
4973
|
...Wn != null ? { checkpointId: Wn } : {},
|
|
4974
4974
|
...qt != null ? { checkpointNs: qt } : {}
|
|
4975
4975
|
};
|
|
4976
|
-
ht && Object.keys(ht).length && (
|
|
4977
|
-
...
|
|
4976
|
+
ht && Object.keys(ht).length && (Mt.additionalKwargs = {
|
|
4977
|
+
...Mt.additionalKwargs ?? {},
|
|
4978
4978
|
...ht
|
|
4979
|
-
}), Wt.length > 0 && Pe(
|
|
4980
|
-
const tr = { ...
|
|
4979
|
+
}), Wt.length > 0 && Pe(Mt);
|
|
4980
|
+
const tr = { ...Mt, content: Wt }, Cr = le.length > 0, Vr = {
|
|
4981
4981
|
messages: Wt.length > 0 ? [tr] : [],
|
|
4982
4982
|
files_info: Et,
|
|
4983
4983
|
...o && Cr && s ? { active_agent: s } : {},
|
|
@@ -5047,7 +5047,7 @@ function wv({
|
|
|
5047
5047
|
} catch (R) {
|
|
5048
5048
|
console.warn("[ChatSessionProvider] Failed to persist lastThreadId:", R);
|
|
5049
5049
|
}
|
|
5050
|
-
}, [k, l]), St(() => ((async () => {
|
|
5050
|
+
}, [k, l]), St(() => Pt.current ? void 0 : (Pt.current = !0, (async () => {
|
|
5051
5051
|
try {
|
|
5052
5052
|
if (await dt(), !r && !t)
|
|
5053
5053
|
try {
|
|
@@ -11897,8 +11897,8 @@ const GC = /* @__PURE__ */ ut(
|
|
|
11897
11897
|
const Je = Qh(Qe, st, ot);
|
|
11898
11898
|
let qe, et;
|
|
11899
11899
|
Pe ? q === 0 && ie === 0 && ye > 0 ? (qe = 0, et = ye - 1) : (qe = Je * Ws((q + Ce) / (Xe + Ce)), et = Je * Iu((ie + Ce) / (Xe + Ce)) - 1, et = ha(D - 1, To(et, Je - 1)), qe = ha(et, To(0, qe))) : (qe = 0, et = -1);
|
|
11900
|
-
const
|
|
11901
|
-
return { bottom: kt, itemHeight: Xe, items:
|
|
11900
|
+
const Pt = Au(qe, et, re), { bottom: kt, top: tt } = _u(We, ce, H, Pt), vt = Iu(D / Je), At = vt * Xe + (vt - 1) * Ce - kt;
|
|
11901
|
+
return { bottom: kt, itemHeight: Xe, items: Pt, itemWidth: st, offsetBottom: At, offsetTop: tt, top: tt };
|
|
11902
11902
|
}
|
|
11903
11903
|
)
|
|
11904
11904
|
),
|
|
@@ -14798,7 +14798,7 @@ const Hu = V.memo(function({
|
|
|
14798
14798
|
} finally {
|
|
14799
14799
|
T == null || T();
|
|
14800
14800
|
}
|
|
14801
|
-
}, [w, T, S, W]),
|
|
14801
|
+
}, [w, T, S, W]), Pt = V.useCallback(async (G) => {
|
|
14802
14802
|
if (w)
|
|
14803
14803
|
return;
|
|
14804
14804
|
const Re = ps(
|
|
@@ -14871,7 +14871,7 @@ const Hu = V.memo(function({
|
|
|
14871
14871
|
{
|
|
14872
14872
|
interruptPart: Me,
|
|
14873
14873
|
onApprove: et,
|
|
14874
|
-
onReject:
|
|
14874
|
+
onReject: Pt,
|
|
14875
14875
|
disabled: w,
|
|
14876
14876
|
isActive: xt,
|
|
14877
14877
|
payload: dt
|
|
@@ -14884,7 +14884,7 @@ const Hu = V.memo(function({
|
|
|
14884
14884
|
ue,
|
|
14885
14885
|
J,
|
|
14886
14886
|
et,
|
|
14887
|
-
|
|
14887
|
+
Pt,
|
|
14888
14888
|
L,
|
|
14889
14889
|
c,
|
|
14890
14890
|
d,
|
|
@@ -14940,7 +14940,7 @@ const Hu = V.memo(function({
|
|
|
14940
14940
|
k(Re, ve);
|
|
14941
14941
|
},
|
|
14942
14942
|
[N, k]
|
|
14943
|
-
), Ve = V.useMemo(() => Jt ? it.findIndex((G) => G.id === Jt) : -1, [Jt, it]), Dt = V.useMemo(() => Ve < 0 ? null : it[Ve] ?? null, [Ve, it]),
|
|
14943
|
+
), Ve = V.useMemo(() => Jt ? it.findIndex((G) => G.id === Jt) : -1, [Jt, it]), Dt = V.useMemo(() => Ve < 0 ? null : it[Ve] ?? null, [Ve, it]), Ot = V.useCallback((G) => {
|
|
14944
14944
|
const Re = [];
|
|
14945
14945
|
if (G.step !== null && Re.push(`Step ${G.step}`), G.source && Re.push(G.source), !G.createdAt)
|
|
14946
14946
|
return Re.length ? Re.join(" • ") : G.id.slice(0, 8);
|
|
@@ -15022,7 +15022,7 @@ const Hu = V.memo(function({
|
|
|
15022
15022
|
" / ",
|
|
15023
15023
|
it.length
|
|
15024
15024
|
] }),
|
|
15025
|
-
/* @__PURE__ */ u.jsx("span", { className: "text-muted-foreground", children:
|
|
15025
|
+
/* @__PURE__ */ u.jsx("span", { className: "text-muted-foreground", children: Ot(Dt) })
|
|
15026
15026
|
] }),
|
|
15027
15027
|
/* @__PURE__ */ u.jsx(
|
|
15028
15028
|
"button",
|
|
@@ -15614,8 +15614,8 @@ const Uu = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, tk = (e) =>
|
|
|
15614
15614
|
const Pe = Uu(ye, re), $e = "type" in ye && ye.type === "default_message";
|
|
15615
15615
|
let ot = [], Ce = null, Xe = {}, st = {}, Qe = null, Je = null;
|
|
15616
15616
|
if (!$e) {
|
|
15617
|
-
const
|
|
15618
|
-
Xe =
|
|
15617
|
+
const Pt = ye, kt = Pt.checkpointId ?? null;
|
|
15618
|
+
Xe = Pt.additionalKwargs ?? {}, st = Pt.responseMetadata ?? {};
|
|
15619
15619
|
const tt = kt && k ? k.get(kt) ?? null : null;
|
|
15620
15620
|
Qe = typeof Xe.step == "number" ? Xe.step : typeof st.step == "number" ? st.step : (tt == null ? void 0 : tt.step) ?? null;
|
|
15621
15621
|
const vt = typeof Xe.source == "string" ? Xe.source : typeof st.source == "string" ? st.source : (tt == null ? void 0 : tt.source) ?? null;
|
|
@@ -15714,7 +15714,7 @@ function ga({
|
|
|
15714
15714
|
J(!0);
|
|
15715
15715
|
}, []), ke = de(() => {
|
|
15716
15716
|
J(!1);
|
|
15717
|
-
}, []), ee = !!ge || _e, [D, q] = we(null), [ie, ce] = we(""), [H, We] = we(null), [re, ye] = we(null), [Pe, $e] = we([]), [ot, Ce] = we(0), [Xe, st] = we(0), [Qe, Je] = we(!1), [qe, et] = we(null), [
|
|
15717
|
+
}, []), ee = !!ge || _e, [D, q] = we(null), [ie, ce] = we(""), [H, We] = we(null), [re, ye] = we(null), [Pe, $e] = we([]), [ot, Ce] = we(0), [Xe, st] = we(0), [Qe, Je] = we(!1), [qe, et] = we(null), [Pt, kt] = we(null), [tt, vt] = we(!1), [At, it] = we(null), [Yt, Xt] = we(!1), Jt = Ee(!1), [Zt, ft] = we(() => Wu.value), Ve = Ee(Zt), Dt = Ee(null), Ot = de((Z) => {
|
|
15718
15718
|
Wu.value = Z, ft(Z);
|
|
15719
15719
|
}, []), [G, Re] = we(!1), ve = Ee(null), gt = de((Z) => {
|
|
15720
15720
|
if (!Array.isArray(Z))
|
|
@@ -15842,9 +15842,9 @@ function ga({
|
|
|
15842
15842
|
jn.current && (jn.current.value = ""), Lt.current && (Lt.current.value = ""), Ce((Z) => Z + 1), st((Z) => Z + 1);
|
|
15843
15843
|
}, []), Ur = de(
|
|
15844
15844
|
(Z) => {
|
|
15845
|
-
|
|
15845
|
+
Ot(Z);
|
|
15846
15846
|
},
|
|
15847
|
-
[
|
|
15847
|
+
[Ot]
|
|
15848
15848
|
), Wr = Ee(!1);
|
|
15849
15849
|
St(() => {
|
|
15850
15850
|
Wr.current && !z && ($e([]), un()), Wr.current = z;
|
|
@@ -15865,8 +15865,8 @@ function ga({
|
|
|
15865
15865
|
Dt.current = null;
|
|
15866
15866
|
return;
|
|
15867
15867
|
}
|
|
15868
|
-
Dt.current === null && (Dt.current = Ve.current),
|
|
15869
|
-
}, [ie, D,
|
|
15868
|
+
Dt.current === null && (Dt.current = Ve.current), Ot(ie ?? "");
|
|
15869
|
+
}, [ie, D, Ot]);
|
|
15870
15870
|
const E = de(async () => {
|
|
15871
15871
|
if (!(!S || T || !Yt))
|
|
15872
15872
|
try {
|
|
@@ -15926,7 +15926,7 @@ function ga({
|
|
|
15926
15926
|
checkpointId: fe,
|
|
15927
15927
|
checkpointNs: Ie
|
|
15928
15928
|
}
|
|
15929
|
-
), h == null || h(se),
|
|
15929
|
+
), h == null || h(se), Ot(""), ye(null), $e([]), un(), q(null), ce(""), We(null);
|
|
15930
15930
|
} catch (fe) {
|
|
15931
15931
|
const Ie = (fe == null ? void 0 : fe.message) || "Failed to send message";
|
|
15932
15932
|
ye(Ie), m == null || m(Ie);
|
|
@@ -15934,15 +15934,15 @@ function ga({
|
|
|
15934
15934
|
}
|
|
15935
15935
|
}, Te = V.useCallback(
|
|
15936
15936
|
(Z, se, fe) => {
|
|
15937
|
-
c && (Dt.current = Zt, q(Z), ce(se),
|
|
15937
|
+
c && (Dt.current = Zt, q(Z), ce(se), Ot(se), ye(null), We({
|
|
15938
15938
|
checkpointId: (fe == null ? void 0 : fe.checkpointId) ?? null,
|
|
15939
15939
|
checkpointNs: (fe == null ? void 0 : fe.checkpointNs) ?? null
|
|
15940
15940
|
}));
|
|
15941
15941
|
},
|
|
15942
|
-
[Zt, c,
|
|
15942
|
+
[Zt, c, Ot]
|
|
15943
15943
|
), Ye = V.useCallback(() => {
|
|
15944
|
-
q(null), ce(""), We(null), ye(null),
|
|
15945
|
-
}, [Zt,
|
|
15944
|
+
q(null), ce(""), We(null), ye(null), Ot(Dt.current ?? Zt), Dt.current = null;
|
|
15945
|
+
}, [Zt, Ot]), Ge = de(
|
|
15946
15946
|
(Z, se, fe) => {
|
|
15947
15947
|
Te(Z, se, fe);
|
|
15948
15948
|
},
|
|
@@ -16188,7 +16188,7 @@ function ga({
|
|
|
16188
16188
|
/* @__PURE__ */ u.jsx(gs, { className: "h-4 w-4 animate-spin" }),
|
|
16189
16189
|
" Uploading Excel file..."
|
|
16190
16190
|
] }),
|
|
16191
|
-
|
|
16191
|
+
Pt && !Qe && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: Pt }),
|
|
16192
16192
|
qe && !Qe && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: qe })
|
|
16193
16193
|
] })
|
|
16194
16194
|
] }),
|