teodor-new-chat-ui 4.3.347 → 4.3.348
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 +959 -956
- package/dist/index.umd.js +25 -25
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -26,11 +26,11 @@ function Am() {
|
|
|
26
26
|
rl = 1;
|
|
27
27
|
var e = Q, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
28
28
|
function i(a, l, c) {
|
|
29
|
-
var d, f = {},
|
|
30
|
-
c !== void 0 && (
|
|
29
|
+
var d, f = {}, p = null, h = null;
|
|
30
|
+
c !== void 0 && (p = "" + c), l.key !== void 0 && (p = "" + l.key), l.ref !== void 0 && (h = l.ref);
|
|
31
31
|
for (d in l) r.call(l, d) && !s.hasOwnProperty(d) && (f[d] = l[d]);
|
|
32
32
|
if (a && a.defaultProps) for (d in l = a.defaultProps, l) f[d] === void 0 && (f[d] = l[d]);
|
|
33
|
-
return { $$typeof: t, type: a, key:
|
|
33
|
+
return { $$typeof: t, type: a, key: p, ref: h, props: f, _owner: o.current };
|
|
34
34
|
}
|
|
35
35
|
return Mr.Fragment = n, Mr.jsx = i, Mr.jsxs = i, Mr;
|
|
36
36
|
}
|
|
@@ -47,7 +47,7 @@ var Or = {};
|
|
|
47
47
|
var ol;
|
|
48
48
|
function Nm() {
|
|
49
49
|
return ol || (ol = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
-
var e = Q, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"),
|
|
50
|
+
var e = Q, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), m = Symbol.iterator, g = "@@iterator";
|
|
51
51
|
function y(I) {
|
|
52
52
|
if (I === null || typeof I != "object")
|
|
53
53
|
return null;
|
|
@@ -72,14 +72,14 @@ function Nm() {
|
|
|
72
72
|
rt.unshift("Warning: " + H), Function.prototype.apply.call(console[I], console, rt);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
var T = !1, S = !1, C = !1, k = !1, R = !1,
|
|
76
|
-
|
|
75
|
+
var T = !1, S = !1, C = !1, k = !1, R = !1, A;
|
|
76
|
+
A = Symbol.for("react.module.reference");
|
|
77
77
|
function D(I) {
|
|
78
|
-
return !!(typeof I == "string" || typeof I == "function" || I === r || I === s || R || I === o || I === c || I === d || k || I ===
|
|
78
|
+
return !!(typeof I == "string" || typeof I == "function" || I === r || I === s || R || I === o || I === c || I === d || k || I === h || T || S || C || typeof I == "object" && I !== null && (I.$$typeof === p || I.$$typeof === f || I.$$typeof === i || I.$$typeof === a || I.$$typeof === l || // This needs to include all possible module reference object
|
|
79
79
|
// types supported by any Flight configuration anywhere since
|
|
80
80
|
// we don't know which Flight build this will end up being used
|
|
81
81
|
// with.
|
|
82
|
-
I.$$typeof ===
|
|
82
|
+
I.$$typeof === A || I.getModuleId !== void 0));
|
|
83
83
|
}
|
|
84
84
|
function j(I, H, ae) {
|
|
85
85
|
var Se = I.displayName;
|
|
@@ -125,7 +125,7 @@ function Nm() {
|
|
|
125
125
|
case f:
|
|
126
126
|
var Se = I.displayName || null;
|
|
127
127
|
return Se !== null ? Se : $(I.type) || "Memo";
|
|
128
|
-
case
|
|
128
|
+
case p: {
|
|
129
129
|
var Ye = I, rt = Ye._payload, ze = Ye._init;
|
|
130
130
|
try {
|
|
131
131
|
return $(ze(rt));
|
|
@@ -136,7 +136,7 @@ function Nm() {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
var
|
|
139
|
+
var E = Object.assign, F = 0, N, V, B, _, q, Y, se;
|
|
140
140
|
function we() {
|
|
141
141
|
}
|
|
142
142
|
we.__reactDisabledLog = !0;
|
|
@@ -172,25 +172,25 @@ function Nm() {
|
|
|
172
172
|
writable: !0
|
|
173
173
|
};
|
|
174
174
|
Object.defineProperties(console, {
|
|
175
|
-
log:
|
|
175
|
+
log: E({}, I, {
|
|
176
176
|
value: N
|
|
177
177
|
}),
|
|
178
|
-
info:
|
|
178
|
+
info: E({}, I, {
|
|
179
179
|
value: V
|
|
180
180
|
}),
|
|
181
|
-
warn:
|
|
181
|
+
warn: E({}, I, {
|
|
182
182
|
value: B
|
|
183
183
|
}),
|
|
184
|
-
error:
|
|
184
|
+
error: E({}, I, {
|
|
185
185
|
value: _
|
|
186
186
|
}),
|
|
187
|
-
group:
|
|
187
|
+
group: E({}, I, {
|
|
188
188
|
value: q
|
|
189
189
|
}),
|
|
190
|
-
groupCollapsed:
|
|
190
|
+
groupCollapsed: E({}, I, {
|
|
191
191
|
value: Y
|
|
192
192
|
}),
|
|
193
|
-
groupEnd:
|
|
193
|
+
groupEnd: E({}, I, {
|
|
194
194
|
value: se
|
|
195
195
|
})
|
|
196
196
|
});
|
|
@@ -314,7 +314,7 @@ function Nm() {
|
|
|
314
314
|
return Ae(I.render);
|
|
315
315
|
case f:
|
|
316
316
|
return oe(I.type, H, ae);
|
|
317
|
-
case
|
|
317
|
+
case p: {
|
|
318
318
|
var Se = I, Ye = Se._payload, rt = Se._init;
|
|
319
319
|
try {
|
|
320
320
|
return oe(rt(Ye), H, ae);
|
|
@@ -983,12 +983,12 @@ function bs(e, t, n) {
|
|
|
983
983
|
}
|
|
984
984
|
return Ri(m) ? !0 : (t.append(il(y, g, s), c(m)), !1);
|
|
985
985
|
}
|
|
986
|
-
const f = [],
|
|
986
|
+
const f = [], p = Object.assign(yg, {
|
|
987
987
|
defaultVisitor: d,
|
|
988
988
|
convertValue: c,
|
|
989
989
|
isVisitable: Ri
|
|
990
990
|
});
|
|
991
|
-
function
|
|
991
|
+
function h(m, g) {
|
|
992
992
|
if (!P.isUndefined(m)) {
|
|
993
993
|
if (f.indexOf(m) !== -1)
|
|
994
994
|
throw Error("Circular reference detected in " + g.join("."));
|
|
@@ -998,14 +998,14 @@ function bs(e, t, n) {
|
|
|
998
998
|
x,
|
|
999
999
|
P.isString(w) ? w.trim() : w,
|
|
1000
1000
|
g,
|
|
1001
|
-
|
|
1002
|
-
)) === !0 &&
|
|
1001
|
+
p
|
|
1002
|
+
)) === !0 && h(x, g ? g.concat(w) : [w]);
|
|
1003
1003
|
}), f.pop();
|
|
1004
1004
|
}
|
|
1005
1005
|
}
|
|
1006
1006
|
if (!P.isObject(e))
|
|
1007
1007
|
throw new TypeError("data must be an object");
|
|
1008
|
-
return
|
|
1008
|
+
return h(e), t;
|
|
1009
1009
|
}
|
|
1010
1010
|
function al(e) {
|
|
1011
1011
|
const t = {
|
|
@@ -1484,13 +1484,13 @@ function Fg(e, t) {
|
|
|
1484
1484
|
return t = t !== void 0 ? t : 1e3, function(l) {
|
|
1485
1485
|
const c = Date.now(), d = r[s];
|
|
1486
1486
|
i || (i = c), n[o] = l, r[o] = c;
|
|
1487
|
-
let f = s,
|
|
1487
|
+
let f = s, p = 0;
|
|
1488
1488
|
for (; f !== o; )
|
|
1489
|
-
|
|
1489
|
+
p += n[f++], f = f % e;
|
|
1490
1490
|
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), c - i < t)
|
|
1491
1491
|
return;
|
|
1492
|
-
const
|
|
1493
|
-
return
|
|
1492
|
+
const h = d && c - d;
|
|
1493
|
+
return h ? Math.round(p * 1e3 / h) : void 0;
|
|
1494
1494
|
};
|
|
1495
1495
|
}
|
|
1496
1496
|
function Bg(e, t) {
|
|
@@ -1575,14 +1575,14 @@ const fl = (e) => e instanceof Ut ? { ...e } : e;
|
|
|
1575
1575
|
function Qn(e, t) {
|
|
1576
1576
|
t = t || {};
|
|
1577
1577
|
const n = {};
|
|
1578
|
-
function r(c, d, f,
|
|
1579
|
-
return P.isPlainObject(c) && P.isPlainObject(d) ? P.merge.call({ caseless:
|
|
1578
|
+
function r(c, d, f, p) {
|
|
1579
|
+
return P.isPlainObject(c) && P.isPlainObject(d) ? P.merge.call({ caseless: p }, c, d) : P.isPlainObject(d) ? P.merge({}, d) : P.isArray(d) ? d.slice() : d;
|
|
1580
1580
|
}
|
|
1581
|
-
function o(c, d, f,
|
|
1581
|
+
function o(c, d, f, p) {
|
|
1582
1582
|
if (P.isUndefined(d)) {
|
|
1583
1583
|
if (!P.isUndefined(c))
|
|
1584
|
-
return r(void 0, c, f,
|
|
1585
|
-
} else return r(c, d, f,
|
|
1584
|
+
return r(void 0, c, f, p);
|
|
1585
|
+
} else return r(c, d, f, p);
|
|
1586
1586
|
}
|
|
1587
1587
|
function s(c, d) {
|
|
1588
1588
|
if (!P.isUndefined(d))
|
|
@@ -1632,8 +1632,8 @@ function Qn(e, t) {
|
|
|
1632
1632
|
headers: (c, d, f) => o(fl(c), fl(d), f, !0)
|
|
1633
1633
|
};
|
|
1634
1634
|
return P.forEach(Object.keys({ ...e, ...t }), function(d) {
|
|
1635
|
-
const f = l[d] || o,
|
|
1636
|
-
P.isUndefined(
|
|
1635
|
+
const f = l[d] || o, p = f(e[d], t[d], d);
|
|
1636
|
+
P.isUndefined(p) && f !== a || (n[d] = p);
|
|
1637
1637
|
}), n;
|
|
1638
1638
|
}
|
|
1639
1639
|
const cu = (e) => {
|
|
@@ -1662,9 +1662,9 @@ const cu = (e) => {
|
|
|
1662
1662
|
const o = cu(e);
|
|
1663
1663
|
let s = o.data;
|
|
1664
1664
|
const i = Ut.from(o.headers).normalize();
|
|
1665
|
-
let { responseType: a, onUploadProgress: l, onDownloadProgress: c } = o, d, f,
|
|
1665
|
+
let { responseType: a, onUploadProgress: l, onDownloadProgress: c } = o, d, f, p, h, m;
|
|
1666
1666
|
function g() {
|
|
1667
|
-
|
|
1667
|
+
h && h(), m && m(), o.cancelToken && o.cancelToken.unsubscribe(d), o.signal && o.signal.removeEventListener("abort", d);
|
|
1668
1668
|
}
|
|
1669
1669
|
let y = new XMLHttpRequest();
|
|
1670
1670
|
y.open(o.method.toUpperCase(), o.url, !0), y.timeout = o.timeout;
|
|
@@ -1705,7 +1705,7 @@ const cu = (e) => {
|
|
|
1705
1705
|
)), y = null;
|
|
1706
1706
|
}, s === void 0 && i.setContentType(null), "setRequestHeader" in y && P.forEach(i.toJSON(), function(T, S) {
|
|
1707
1707
|
y.setRequestHeader(S, T);
|
|
1708
|
-
}), P.isUndefined(o.withCredentials) || (y.withCredentials = !!o.withCredentials), a && a !== "json" && (y.responseType = o.responseType), c && ([
|
|
1708
|
+
}), P.isUndefined(o.withCredentials) || (y.withCredentials = !!o.withCredentials), a && a !== "json" && (y.responseType = o.responseType), c && ([p, m] = Ko(c, !0), y.addEventListener("progress", p)), l && y.upload && ([f, h] = Ko(l), y.upload.addEventListener("progress", f), y.upload.addEventListener("loadend", h)), (o.cancelToken || o.signal) && (d = (b) => {
|
|
1709
1709
|
y && (r(!b || b.type ? new Rr(null, e, y) : b), y.abort(), y = null);
|
|
1710
1710
|
}, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
|
|
1711
1711
|
const w = $g(o.url);
|
|
@@ -1781,8 +1781,8 @@ const cu = (e) => {
|
|
|
1781
1781
|
}
|
|
1782
1782
|
let f = d.byteLength;
|
|
1783
1783
|
if (n) {
|
|
1784
|
-
let
|
|
1785
|
-
n(
|
|
1784
|
+
let p = s += f;
|
|
1785
|
+
n(p);
|
|
1786
1786
|
}
|
|
1787
1787
|
l.enqueue(new Uint8Array(d));
|
|
1788
1788
|
} catch (c) {
|
|
@@ -1835,7 +1835,7 @@ const cu = (e) => {
|
|
|
1835
1835
|
throw new Pe(`Response type '${m}' is not supported`, Pe.ERR_NOT_SUPPORT, y);
|
|
1836
1836
|
});
|
|
1837
1837
|
});
|
|
1838
|
-
const
|
|
1838
|
+
const p = async (m) => {
|
|
1839
1839
|
if (m == null)
|
|
1840
1840
|
return 0;
|
|
1841
1841
|
if (P.isBlob(m))
|
|
@@ -1849,9 +1849,9 @@ const cu = (e) => {
|
|
|
1849
1849
|
return m.byteLength;
|
|
1850
1850
|
if (P.isURLSearchParams(m) && (m = m + ""), P.isString(m))
|
|
1851
1851
|
return (await l(m)).byteLength;
|
|
1852
|
-
},
|
|
1852
|
+
}, h = async (m, g) => {
|
|
1853
1853
|
const y = P.toFiniteNumber(m.getContentLength());
|
|
1854
|
-
return y ??
|
|
1854
|
+
return y ?? p(g);
|
|
1855
1855
|
};
|
|
1856
1856
|
return async (m) => {
|
|
1857
1857
|
let {
|
|
@@ -1865,17 +1865,17 @@ const cu = (e) => {
|
|
|
1865
1865
|
onUploadProgress: C,
|
|
1866
1866
|
responseType: k,
|
|
1867
1867
|
headers: R,
|
|
1868
|
-
withCredentials:
|
|
1868
|
+
withCredentials: A = "same-origin",
|
|
1869
1869
|
fetchOptions: D
|
|
1870
1870
|
} = cu(m), j = t || fetch;
|
|
1871
1871
|
k = k ? (k + "").toLowerCase() : "text";
|
|
1872
1872
|
let M = qg([w, b && b.toAbortSignal()], T), $ = null;
|
|
1873
|
-
const
|
|
1873
|
+
const E = M && M.unsubscribe && (() => {
|
|
1874
1874
|
M.unsubscribe();
|
|
1875
1875
|
});
|
|
1876
1876
|
let F;
|
|
1877
1877
|
try {
|
|
1878
|
-
if (C && c && y !== "get" && y !== "head" && (F = await
|
|
1878
|
+
if (C && c && y !== "get" && y !== "head" && (F = await h(R, x)) !== 0) {
|
|
1879
1879
|
let Y = new n(g, {
|
|
1880
1880
|
method: "POST",
|
|
1881
1881
|
body: x,
|
|
@@ -1889,7 +1889,7 @@ const cu = (e) => {
|
|
|
1889
1889
|
x = pl(Y.body, hl, we, Ie);
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
1892
|
-
P.isString(
|
|
1892
|
+
P.isString(A) || (A = A ? "include" : "omit");
|
|
1893
1893
|
const N = s && "credentials" in n.prototype, V = {
|
|
1894
1894
|
...D,
|
|
1895
1895
|
signal: M,
|
|
@@ -1897,12 +1897,12 @@ const cu = (e) => {
|
|
|
1897
1897
|
headers: R.normalize().toJSON(),
|
|
1898
1898
|
body: x,
|
|
1899
1899
|
duplex: "half",
|
|
1900
|
-
credentials: N ?
|
|
1900
|
+
credentials: N ? A : void 0
|
|
1901
1901
|
};
|
|
1902
1902
|
$ = s && new n(g, V);
|
|
1903
1903
|
let B = await (s ? j($, D) : j(g, V));
|
|
1904
1904
|
const _ = d && (k === "stream" || k === "response");
|
|
1905
|
-
if (d && (S || _ &&
|
|
1905
|
+
if (d && (S || _ && E)) {
|
|
1906
1906
|
const Y = {};
|
|
1907
1907
|
["status", "statusText", "headers"].forEach((G) => {
|
|
1908
1908
|
Y[G] = B[G];
|
|
@@ -1913,14 +1913,14 @@ const cu = (e) => {
|
|
|
1913
1913
|
) || [];
|
|
1914
1914
|
B = new r(
|
|
1915
1915
|
pl(B.body, hl, we, () => {
|
|
1916
|
-
Ie && Ie(),
|
|
1916
|
+
Ie && Ie(), E && E();
|
|
1917
1917
|
}),
|
|
1918
1918
|
Y
|
|
1919
1919
|
);
|
|
1920
1920
|
}
|
|
1921
1921
|
k = k || "text";
|
|
1922
1922
|
let q = await f[P.findKey(f, k) || "text"](B, m);
|
|
1923
|
-
return !_ &&
|
|
1923
|
+
return !_ && E && E(), await new Promise((Y, se) => {
|
|
1924
1924
|
au(Y, se, {
|
|
1925
1925
|
data: q,
|
|
1926
1926
|
headers: Ut.from(B.headers),
|
|
@@ -1931,7 +1931,7 @@ const cu = (e) => {
|
|
|
1931
1931
|
});
|
|
1932
1932
|
});
|
|
1933
1933
|
} catch (N) {
|
|
1934
|
-
throw
|
|
1934
|
+
throw E && E(), N && N.name === "TypeError" && /Load failed|fetch/i.test(N.message) ? Object.assign(
|
|
1935
1935
|
new Pe("Network Error", Pe.ERR_NETWORK, m, $),
|
|
1936
1936
|
{
|
|
1937
1937
|
cause: N.cause || N
|
|
@@ -2137,30 +2137,30 @@ let Jn = class {
|
|
|
2137
2137
|
this.interceptors.response.forEach(function(g) {
|
|
2138
2138
|
c.push(g.fulfilled, g.rejected);
|
|
2139
2139
|
});
|
|
2140
|
-
let d, f = 0,
|
|
2140
|
+
let d, f = 0, p;
|
|
2141
2141
|
if (!l) {
|
|
2142
2142
|
const m = [vl.bind(this), void 0];
|
|
2143
|
-
for (m.unshift(...a), m.push(...c),
|
|
2143
|
+
for (m.unshift(...a), m.push(...c), p = m.length, d = Promise.resolve(n); f < p; )
|
|
2144
2144
|
d = d.then(m[f++], m[f++]);
|
|
2145
2145
|
return d;
|
|
2146
2146
|
}
|
|
2147
|
-
|
|
2148
|
-
let
|
|
2149
|
-
for (; f <
|
|
2147
|
+
p = a.length;
|
|
2148
|
+
let h = n;
|
|
2149
|
+
for (; f < p; ) {
|
|
2150
2150
|
const m = a[f++], g = a[f++];
|
|
2151
2151
|
try {
|
|
2152
|
-
|
|
2152
|
+
h = m(h);
|
|
2153
2153
|
} catch (y) {
|
|
2154
2154
|
g.call(this, y);
|
|
2155
2155
|
break;
|
|
2156
2156
|
}
|
|
2157
2157
|
}
|
|
2158
2158
|
try {
|
|
2159
|
-
d = vl.call(this,
|
|
2159
|
+
d = vl.call(this, h);
|
|
2160
2160
|
} catch (m) {
|
|
2161
2161
|
return Promise.reject(m);
|
|
2162
2162
|
}
|
|
2163
|
-
for (f = 0,
|
|
2163
|
+
for (f = 0, p = c.length; f < p; )
|
|
2164
2164
|
d = d.then(c[f++], c[f++]);
|
|
2165
2165
|
return d;
|
|
2166
2166
|
}
|
|
@@ -2620,11 +2620,11 @@ function mr(e) {
|
|
|
2620
2620
|
}
|
|
2621
2621
|
function xu(e, t) {
|
|
2622
2622
|
if (!ia(e)) return null;
|
|
2623
|
-
const n = e.values ?? { messages: [] }, r = Array.isArray(n == null ? void 0 : n.messages) ? n.messages : [], { messages: o, ...s } = n, i = Object.keys(s).length ? s : null, a = e.tasks, l = Array.isArray(a) ? a.filter((
|
|
2623
|
+
const n = e.values ?? { messages: [] }, r = Array.isArray(n == null ? void 0 : n.messages) ? n.messages : [], { messages: o, ...s } = n, i = Object.keys(s).length ? s : null, a = e.tasks, l = Array.isArray(a) ? a.filter((A) => !!A && typeof A == "object").map((A) => ({ ...A })) : a === null ? null : void 0, c = r.map((A, D) => Ex(A, D)).filter((A) => !!A), d = $t(e.config), f = $t(d == null ? void 0 : d.configurable), p = pt(f, ["checkpoint_id", "checkpointId"]), h = pt(f, ["checkpoint_ns", "checkpointNs"]), m = $t(e == null ? void 0 : e.parentConfig), g = $t(m == null ? void 0 : m.configurable), y = pt(g, ["checkpoint_id", "checkpointId"]) ?? null, x = pt(g, ["checkpoint_ns", "checkpointNs"]) ?? null, w = e == null ? void 0 : e.createdAt, b = typeof w == "string" && w.trim() ? w : new Date(Date.now() - t).toISOString(), T = c.slice().reverse().find((A) => A.role === "user") ?? null, S = $t(e == null ? void 0 : e.metadata), C = pt(S, ["branch_label", "branchLabel"]), k = pt(g, ["checkpoint_id", "checkpointId"]), R = Array.isArray(e.next) ? [...e.next] : (e == null ? void 0 : e.next) === null ? null : void 0;
|
|
2624
2624
|
return {
|
|
2625
2625
|
messages: c,
|
|
2626
|
-
checkpointId:
|
|
2627
|
-
checkpointNs:
|
|
2626
|
+
checkpointId: p ?? null,
|
|
2627
|
+
checkpointNs: h ?? null,
|
|
2628
2628
|
nextCursor: y,
|
|
2629
2629
|
nextCursorNs: x,
|
|
2630
2630
|
interrupt: xx(a, c, t),
|
|
@@ -2672,15 +2672,15 @@ function vx(e) {
|
|
|
2672
2672
|
for (const o of e) {
|
|
2673
2673
|
const s = o.checkpointId ?? null;
|
|
2674
2674
|
if (!s) continue;
|
|
2675
|
-
const i = o.metadata ?? {}, a = pt(i, ["label"]) ?? pt(i, ["branch_label", "branchLabel"]) ?? pt(i, ["description"]) ?? "User input", l = bx(i, ["step"]), c = pt(i, ["source"]), d = o.createdAt ?? null, f = ((r = (n = o.messages) == null ? void 0 : n[o.messages.length - 1]) == null ? void 0 : r.id) ?? null,
|
|
2675
|
+
const i = o.metadata ?? {}, a = pt(i, ["label"]) ?? pt(i, ["branch_label", "branchLabel"]) ?? pt(i, ["description"]) ?? "User input", l = bx(i, ["step"]), c = pt(i, ["source"]), d = o.createdAt ?? null, f = ((r = (n = o.messages) == null ? void 0 : n[o.messages.length - 1]) == null ? void 0 : r.id) ?? null, p = o.lastUserMessageId ?? f, h = wx(o.next);
|
|
2676
2676
|
t.push({
|
|
2677
2677
|
id: s,
|
|
2678
2678
|
label: a,
|
|
2679
|
-
messageId:
|
|
2679
|
+
messageId: p,
|
|
2680
2680
|
step: l,
|
|
2681
2681
|
source: c ?? null,
|
|
2682
2682
|
createdAt: d,
|
|
2683
|
-
next:
|
|
2683
|
+
next: h ?? void 0,
|
|
2684
2684
|
parentConfig: o.parentConfig ?? null
|
|
2685
2685
|
});
|
|
2686
2686
|
}
|
|
@@ -2775,8 +2775,8 @@ function Ix(e, t) {
|
|
|
2775
2775
|
function Rx(e, t) {
|
|
2776
2776
|
if (!e) return null;
|
|
2777
2777
|
if (Array.isArray(e)) {
|
|
2778
|
-
const [a, l, c, , d, , f, ...
|
|
2779
|
-
return { id:
|
|
2778
|
+
const [a, l, c, , d, , f, ...p] = e, h = typeof a == "string" && a.trim() ? a : t, m = typeof l == "string" && l.trim() ? l : Array.isArray(c) && typeof c[0] == "string" ? String(c[0]) : "task", g = Array.isArray(d) ? d : void 0, y = p.length ? p[p.length - 1] : void 0;
|
|
2779
|
+
return { id: h, name: m, interrupts: g, state: y !== void 0 ? y : f };
|
|
2780
2780
|
}
|
|
2781
2781
|
const n = $t(e);
|
|
2782
2782
|
if (!n) return null;
|
|
@@ -2865,12 +2865,12 @@ function Ex(e, t) {
|
|
|
2865
2865
|
).toLowerCase(), i = mx[s];
|
|
2866
2866
|
if (!i)
|
|
2867
2867
|
return null;
|
|
2868
|
-
const a = o.id ?? o.message_id ?? o.run_id ?? null, l = typeof a == "string" && a.trim() ? a : `history-${i}-${t}`, c = $t(o.additional_kwargs) ?? $t(o.additionalKwargs), d = $t(o.response_metadata) ?? $t(o.responseMetadata), f = pt(c, ["createdAt", "created_at"]) ?? pt(o, ["created_at", "createdAt"]),
|
|
2868
|
+
const a = o.id ?? o.message_id ?? o.run_id ?? null, l = typeof a == "string" && a.trim() ? a : `history-${i}-${t}`, c = $t(o.additional_kwargs) ?? $t(o.additionalKwargs), d = $t(o.response_metadata) ?? $t(o.responseMetadata), f = pt(c, ["createdAt", "created_at"]) ?? pt(o, ["created_at", "createdAt"]), p = pt(c, ["checkpointId", "checkpoint_id"]), h = pt(c, ["checkpointNs", "checkpoint_ns"]), m = Ax(o.content), g = {
|
|
2869
2869
|
id: l,
|
|
2870
2870
|
role: i,
|
|
2871
2871
|
content: m
|
|
2872
2872
|
};
|
|
2873
|
-
f && (g.createdAt = f), typeof o.name == "string" && o.name.trim() && (g.name = o.name), typeof (d == null ? void 0 : d.model_name) == "string" && (g.model = String(d.model_name)), !g.model && typeof o.model == "string" && (g.model = o.model),
|
|
2873
|
+
f && (g.createdAt = f), typeof o.name == "string" && o.name.trim() && (g.name = o.name), typeof (d == null ? void 0 : d.model_name) == "string" && (g.model = String(d.model_name)), !g.model && typeof o.model == "string" && (g.model = o.model), p && (g.checkpointId = p), h && (g.checkpointNs = h);
|
|
2874
2874
|
const y = jx(
|
|
2875
2875
|
$t(
|
|
2876
2876
|
o.artifact ?? r.artifact ?? o.artifacts ?? r.artifacts
|
|
@@ -3054,21 +3054,21 @@ function $x(e) {
|
|
|
3054
3054
|
return t;
|
|
3055
3055
|
}
|
|
3056
3056
|
function Fx(e = {}) {
|
|
3057
|
-
const t = Le(() => En(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ye(e.token ?? null), s = $e(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ye(!1), [c, d] = ye(null), [f,
|
|
3058
|
-
o(
|
|
3057
|
+
const t = Le(() => En(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ye(e.token ?? null), s = $e(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ye(!1), [c, d] = ye(null), [f, p] = ye(""), [h, m] = ye(null), [g, y] = ye(0), [x, w] = ye(!1), b = $e(null), T = $e(!0), S = $e(0), C = $e(null), k = $e(null), R = $e(null), A = $e(null), D = ve((E) => {
|
|
3058
|
+
o(E);
|
|
3059
3059
|
}, []), j = ve(() => {
|
|
3060
|
-
|
|
3060
|
+
p(""), m(null), d(null), k.current = null, R.current = null, A.current = null;
|
|
3061
3061
|
}, []), M = ve(() => {
|
|
3062
|
-
var
|
|
3063
|
-
console.debug("[use-chat] stop() invoked - aborting stream"), (
|
|
3062
|
+
var E;
|
|
3063
|
+
console.debug("[use-chat] stop() invoked - aborting stream"), (E = b.current) == null || E.abort(), b.current = null, C.current = null, l(!1), w(!1), S.current = 0, y(0);
|
|
3064
3064
|
}, []), $ = ve(
|
|
3065
|
-
(
|
|
3066
|
-
b.current && (b.current.abort(), b.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 &&
|
|
3065
|
+
(E, F, N) => {
|
|
3066
|
+
b.current && (b.current.abort(), b.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && p(""), m(null), k.current = null, R.current = null, A.current = null;
|
|
3067
3067
|
const V = new AbortController();
|
|
3068
3068
|
b.current = V;
|
|
3069
3069
|
let B = null, _ = null, q = !1;
|
|
3070
3070
|
return C.current = {
|
|
3071
|
-
threadId:
|
|
3071
|
+
threadId: E.threadId ?? null,
|
|
3072
3072
|
headers: {}
|
|
3073
3073
|
}, (async () => {
|
|
3074
3074
|
var se, we, Ie, G, z, X, L, K, J, le, ie, Ae, Ve, oe, xe, Oe, Je, ot;
|
|
@@ -3105,7 +3105,7 @@ function Fx(e = {}) {
|
|
|
3105
3105
|
console.debug(
|
|
3106
3106
|
"[use-chat] POST",
|
|
3107
3107
|
t + n,
|
|
3108
|
-
Y(
|
|
3108
|
+
Y(E)
|
|
3109
3109
|
);
|
|
3110
3110
|
let Ge = {};
|
|
3111
3111
|
if (typeof window < "u")
|
|
@@ -3125,7 +3125,7 @@ function Fx(e = {}) {
|
|
|
3125
3125
|
}, et = await fetch(t + n, {
|
|
3126
3126
|
method: "POST",
|
|
3127
3127
|
headers: Qe,
|
|
3128
|
-
body: JSON.stringify(
|
|
3128
|
+
body: JSON.stringify(E),
|
|
3129
3129
|
signal: V.signal,
|
|
3130
3130
|
credentials: i
|
|
3131
3131
|
});
|
|
@@ -3147,7 +3147,7 @@ function Fx(e = {}) {
|
|
|
3147
3147
|
const _t = () => {
|
|
3148
3148
|
if (ht.length) {
|
|
3149
3149
|
const st = ht.join("");
|
|
3150
|
-
ht = [], T.current &&
|
|
3150
|
+
ht = [], T.current && p((Ke) => Ke + st);
|
|
3151
3151
|
}
|
|
3152
3152
|
Tt = null;
|
|
3153
3153
|
}, Lt = () => {
|
|
@@ -3209,7 +3209,7 @@ function Fx(e = {}) {
|
|
|
3209
3209
|
}), me.type === "checkpoint")
|
|
3210
3210
|
k.current = me.checkpointId ?? null, R.current = me.checkpointNs ?? null, m(me.checkpointId ?? null);
|
|
3211
3211
|
else if (me.type === "state_history") {
|
|
3212
|
-
|
|
3212
|
+
A.current = me;
|
|
3213
3213
|
try {
|
|
3214
3214
|
const Ne = mr(me).latest;
|
|
3215
3215
|
Ne && (k.current = Ne.checkpointId ?? null, R.current = Ne.checkpointNs ?? null, m(Ne.checkpointId ?? null));
|
|
@@ -3275,7 +3275,7 @@ function Fx(e = {}) {
|
|
|
3275
3275
|
B = "error", _ = Ge, d(Ge), (Oe = N == null ? void 0 : N.onError) == null || Oe.call(N, Ge), q || ((Je = N == null ? void 0 : N.onConnectionError) == null || Je.call(N, Ge), q = !0);
|
|
3276
3276
|
}
|
|
3277
3277
|
} finally {
|
|
3278
|
-
const Ze = S.current, Ge = k.current, it = R.current, Qe =
|
|
3278
|
+
const Ze = S.current, Ge = k.current, it = R.current, Qe = A.current, et = B ?? (V.signal.aborted ? "aborted" : _ ? "error" : "complete");
|
|
3279
3279
|
try {
|
|
3280
3280
|
(ot = N == null ? void 0 : N.onClosed) == null || ot.call(N, {
|
|
3281
3281
|
reason: et,
|
|
@@ -3295,13 +3295,13 @@ function Fx(e = {}) {
|
|
|
3295
3295
|
[t, n, r, e.autoAppendAssistant]
|
|
3296
3296
|
);
|
|
3297
3297
|
return wt(() => () => {
|
|
3298
|
-
var
|
|
3299
|
-
T.current = !1, (
|
|
3298
|
+
var E;
|
|
3299
|
+
T.current = !1, (E = b.current) == null || E.abort();
|
|
3300
3300
|
}, []), {
|
|
3301
3301
|
isStreaming: a,
|
|
3302
3302
|
error: c,
|
|
3303
3303
|
assistantText: f,
|
|
3304
|
-
lastCheckpointId:
|
|
3304
|
+
lastCheckpointId: h,
|
|
3305
3305
|
lastSeq: g,
|
|
3306
3306
|
connected: x,
|
|
3307
3307
|
stream: $,
|
|
@@ -3440,189 +3440,192 @@ function Jx(e = []) {
|
|
|
3440
3440
|
return { state: t, dispatch: n, ...c };
|
|
3441
3441
|
}
|
|
3442
3442
|
function El(e, t) {
|
|
3443
|
-
var n, r, o, s
|
|
3443
|
+
var n, r, o, s;
|
|
3444
3444
|
if (t.type === "message_start" && t.role === "assistant") {
|
|
3445
|
-
const
|
|
3446
|
-
if (e.messages.some((
|
|
3447
|
-
const
|
|
3448
|
-
...
|
|
3449
|
-
[
|
|
3445
|
+
const i = t.id, a = sy(t.model);
|
|
3446
|
+
if (e.messages.some((d) => d.id === i)) {
|
|
3447
|
+
const d = e.messagesStreamMeta ?? {}, f = {
|
|
3448
|
+
...d,
|
|
3449
|
+
[i]: d[i] ?? { lastSeq: t.seq ?? null, lastText: "" }
|
|
3450
3450
|
};
|
|
3451
|
-
return { ...e, assemblingId:
|
|
3451
|
+
return { ...e, assemblingId: i, messagesStreamMeta: f };
|
|
3452
3452
|
}
|
|
3453
|
-
const
|
|
3454
|
-
id:
|
|
3453
|
+
const c = {
|
|
3454
|
+
id: i,
|
|
3455
3455
|
role: "assistant",
|
|
3456
|
-
name:
|
|
3456
|
+
name: a || void 0,
|
|
3457
3457
|
model: t.model,
|
|
3458
3458
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3459
3459
|
content: []
|
|
3460
3460
|
};
|
|
3461
|
-
return { ...e, assemblingId:
|
|
3461
|
+
return { ...e, assemblingId: i, messages: [...e.messages, c] };
|
|
3462
3462
|
}
|
|
3463
3463
|
if (t.type === "message_delta") {
|
|
3464
|
-
const
|
|
3465
|
-
if (!
|
|
3466
|
-
const
|
|
3467
|
-
if (
|
|
3468
|
-
const
|
|
3469
|
-
if (p !== null && typeof p == "number" && typeof
|
|
3470
|
-
return console.debug("[MessageReducer] skipping delta - seq <= lastSeq", { seq: p, lastSeq:
|
|
3471
|
-
const { newParts:
|
|
3472
|
-
if (!
|
|
3473
|
-
const
|
|
3474
|
-
return { ...e, messages:
|
|
3464
|
+
const i = e.assemblingId ?? Al(e.messages);
|
|
3465
|
+
if (!i) return e;
|
|
3466
|
+
const a = e.messages, l = a.findIndex((b) => b.id === i && b.role === "assistant");
|
|
3467
|
+
if (l === -1) return e;
|
|
3468
|
+
const c = a[l], d = e.messagesStreamMeta ?? {}, f = d[i] ?? { lastSeq: null, lastText: Su(c.content) }, p = t.seq ?? null;
|
|
3469
|
+
if (p !== null && typeof p == "number" && typeof f.lastSeq == "number" && p <= f.lastSeq)
|
|
3470
|
+
return console.debug("[MessageReducer] skipping delta - seq <= lastSeq", { seq: p, lastSeq: f.lastSeq }), e;
|
|
3471
|
+
const { newParts: h, newMeta: m, changed: g } = ny(c.content, t.delta, f, p);
|
|
3472
|
+
if (!g) return e;
|
|
3473
|
+
const y = { ...c, content: h }, x = Oo(a, l, y), w = { ...d, [i]: m };
|
|
3474
|
+
return { ...e, messages: x, messagesStreamMeta: w };
|
|
3475
3475
|
}
|
|
3476
3476
|
if (t.type === "message_end") {
|
|
3477
|
-
const
|
|
3478
|
-
if (!
|
|
3479
|
-
const
|
|
3480
|
-
if (
|
|
3481
|
-
const
|
|
3482
|
-
if (!((n =
|
|
3477
|
+
const i = e.assemblingId ?? Al(e.messages);
|
|
3478
|
+
if (!i) return { ...e, assemblingId: null };
|
|
3479
|
+
const a = e.messages, l = a.findIndex((c) => c.id === i && c.role === "assistant");
|
|
3480
|
+
if (l >= 0) {
|
|
3481
|
+
const c = a[l];
|
|
3482
|
+
if (!((n = c.content) == null ? void 0 : n.some((f) => {
|
|
3483
3483
|
var p;
|
|
3484
|
-
return (
|
|
3484
|
+
return (f == null ? void 0 : f.type) === "text" && ((p = f.text) == null ? void 0 : p.trim());
|
|
3485
3485
|
}))) {
|
|
3486
3486
|
console.debug("[MessageReducer] pruning assistant message with no visible text", {
|
|
3487
|
-
id:
|
|
3488
|
-
contentTypes: (r =
|
|
3489
|
-
contentPreview: (o =
|
|
3487
|
+
id: c.id,
|
|
3488
|
+
contentTypes: (r = c.content) == null ? void 0 : r.map((p) => p == null ? void 0 : p.type),
|
|
3489
|
+
contentPreview: (o = c.content) == null ? void 0 : o.map((p) => (p == null ? void 0 : p.type) === "text" ? String(p.text).slice(0, 100) : p == null ? void 0 : p.type)
|
|
3490
3490
|
});
|
|
3491
|
-
const
|
|
3492
|
-
return { ...e, assemblingId: null, messages:
|
|
3491
|
+
const f = [...a.slice(0, l), ...a.slice(l + 1)];
|
|
3492
|
+
return { ...e, assemblingId: null, messages: f };
|
|
3493
3493
|
}
|
|
3494
3494
|
}
|
|
3495
3495
|
return e;
|
|
3496
3496
|
}
|
|
3497
3497
|
if (t.type === "tool_start") {
|
|
3498
|
-
const
|
|
3499
|
-
!
|
|
3500
|
-
const
|
|
3498
|
+
const i = Nl(t), a = i[0] ?? (typeof t.id == "string" ? t.id : null) ?? (typeof t.call_id == "string" ? t.call_id : null), l = t.name ?? t.tool ?? "tool";
|
|
3499
|
+
!a && i.length === 0 && i.push(`${l}-${Date.now()}`);
|
|
3500
|
+
const c = i.length ? i : a ? [a] : [], d = c[0] ?? `${l}-${Date.now()}`, f = { type: "tool_call", id: d, name: l, args: t.args }, p = {
|
|
3501
3501
|
type: e.toolStreamingMessageId ? "tool_call" : "tool_start",
|
|
3502
|
-
toolId:
|
|
3503
|
-
toolName:
|
|
3504
|
-
title: `Invoking ${
|
|
3502
|
+
toolId: a ?? d,
|
|
3503
|
+
toolName: l,
|
|
3504
|
+
title: `Invoking ${l}`,
|
|
3505
3505
|
metadata: {
|
|
3506
3506
|
args: t.args
|
|
3507
3507
|
}
|
|
3508
|
-
},
|
|
3509
|
-
if (!
|
|
3510
|
-
const
|
|
3511
|
-
id: `tool-${
|
|
3508
|
+
}, h = e.toolStreamingMessageId;
|
|
3509
|
+
if (!h) {
|
|
3510
|
+
const y = {
|
|
3511
|
+
id: `tool-${d}`,
|
|
3512
3512
|
role: "tool",
|
|
3513
|
-
name:
|
|
3513
|
+
name: l,
|
|
3514
3514
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3515
|
-
content: [
|
|
3515
|
+
content: [f],
|
|
3516
3516
|
additionalKwargs: {
|
|
3517
|
-
...Qx(void 0,
|
|
3517
|
+
...Qx(void 0, c.length ? c : [d], l, t.args),
|
|
3518
3518
|
toolStreaming: !0
|
|
3519
3519
|
}
|
|
3520
|
-
},
|
|
3520
|
+
}, x = ey(y, c.length ? c : [d]), w = [...e.messages, y], b = wo(w, y.id, p);
|
|
3521
3521
|
return {
|
|
3522
3522
|
...e,
|
|
3523
|
-
messages:
|
|
3524
|
-
toolIndex: _l(e.toolIndex,
|
|
3525
|
-
toolStreamingMessageId:
|
|
3526
|
-
toolStreamingStack: jl(e.toolStreamingStack ?? [],
|
|
3523
|
+
messages: b,
|
|
3524
|
+
toolIndex: _l(e.toolIndex, y.id, x),
|
|
3525
|
+
toolStreamingMessageId: y.id,
|
|
3526
|
+
toolStreamingStack: jl(e.toolStreamingStack ?? [], a ?? d)
|
|
3527
3527
|
};
|
|
3528
3528
|
}
|
|
3529
|
-
const
|
|
3529
|
+
const m = wo(e.messages, h, p);
|
|
3530
3530
|
return {
|
|
3531
3531
|
...e,
|
|
3532
|
-
messages:
|
|
3533
|
-
toolIndex: _l(e.toolIndex,
|
|
3534
|
-
toolStreamingStack: jl(e.toolStreamingStack ?? [],
|
|
3532
|
+
messages: m,
|
|
3533
|
+
toolIndex: _l(e.toolIndex, h, c),
|
|
3534
|
+
toolStreamingStack: jl(e.toolStreamingStack ?? [], a ?? d)
|
|
3535
3535
|
};
|
|
3536
3536
|
}
|
|
3537
3537
|
if (t.type === "tool_end") {
|
|
3538
|
-
const
|
|
3539
|
-
if (!
|
|
3538
|
+
const i = Nl(t);
|
|
3539
|
+
if (!i.length && !(typeof t.id == "string" && t.id))
|
|
3540
3540
|
return e;
|
|
3541
|
-
const
|
|
3542
|
-
if (!
|
|
3541
|
+
const a = i[0] ?? (typeof t.id == "string" ? t.id : null);
|
|
3542
|
+
if (!a)
|
|
3543
3543
|
return e;
|
|
3544
|
-
const
|
|
3544
|
+
const l = e.toolStreamingStack ?? [], c = l[0] ?? null, d = ty(l, a), f = d[0] ? e.toolIndex[d[0]] : null, p = e.toolStreamingMessageId, h = c === a, m = t.name ?? ((s = e.messages.find((b) => b.id === p)) == null ? void 0 : s.name) ?? "tool", g = typeof t.output == "string" ? t.output.trim() : JSON.stringify(t.output ?? ""), y = {
|
|
3545
3545
|
type: "tool_end",
|
|
3546
|
-
toolId:
|
|
3547
|
-
toolName:
|
|
3548
|
-
title: `${
|
|
3549
|
-
content:
|
|
3546
|
+
toolId: a,
|
|
3547
|
+
toolName: m,
|
|
3548
|
+
title: `${m} completed`,
|
|
3549
|
+
content: g == null ? void 0 : g.slice(0, 200)
|
|
3550
3550
|
};
|
|
3551
|
-
let
|
|
3552
|
-
if (p && (
|
|
3553
|
-
const
|
|
3554
|
-
if (
|
|
3555
|
-
const
|
|
3551
|
+
let x = e.messages;
|
|
3552
|
+
if (p && (x = wo(x, p, y)), h && p) {
|
|
3553
|
+
const b = x.findIndex((T) => T.id === p);
|
|
3554
|
+
if (b >= 0) {
|
|
3555
|
+
const T = x[b], C = {
|
|
3556
3556
|
type: "text",
|
|
3557
3557
|
text: (() => {
|
|
3558
3558
|
if (typeof t.output == "string") {
|
|
3559
|
-
const
|
|
3559
|
+
const R = t.output.trim();
|
|
3560
3560
|
try {
|
|
3561
|
-
return
|
|
3561
|
+
return R;
|
|
3562
3562
|
} catch {
|
|
3563
|
-
return
|
|
3563
|
+
return R;
|
|
3564
3564
|
}
|
|
3565
3565
|
}
|
|
3566
3566
|
return JSON.stringify(t.output ?? "");
|
|
3567
3567
|
})()
|
|
3568
|
-
},
|
|
3569
|
-
...
|
|
3570
|
-
content: [
|
|
3571
|
-
artifact: t.artifact ??
|
|
3572
|
-
additionalKwargs: { ...
|
|
3568
|
+
}, k = {
|
|
3569
|
+
...T,
|
|
3570
|
+
content: [C],
|
|
3571
|
+
artifact: t.artifact ?? T.artifact,
|
|
3572
|
+
additionalKwargs: { ...T.additionalKwargs ?? {} }
|
|
3573
3573
|
};
|
|
3574
|
-
|
|
3574
|
+
x = Oo(x, b, k);
|
|
3575
3575
|
}
|
|
3576
3576
|
}
|
|
3577
3577
|
return {
|
|
3578
3578
|
...e,
|
|
3579
|
-
messages:
|
|
3580
|
-
toolStreamingMessageId:
|
|
3581
|
-
toolStreamingStack:
|
|
3579
|
+
messages: x,
|
|
3580
|
+
toolStreamingMessageId: h ? f : p,
|
|
3581
|
+
toolStreamingStack: d
|
|
3582
3582
|
};
|
|
3583
3583
|
}
|
|
3584
3584
|
if (t.type === "progress") {
|
|
3585
|
-
const
|
|
3586
|
-
if (!
|
|
3585
|
+
const i = e.toolStreamingMessageId;
|
|
3586
|
+
if (!i)
|
|
3587
3587
|
return e;
|
|
3588
|
-
const
|
|
3588
|
+
const a = {
|
|
3589
3589
|
type: "progress",
|
|
3590
3590
|
step: t.step ?? null,
|
|
3591
3591
|
title: t.title ?? null,
|
|
3592
3592
|
content: t.content ?? null,
|
|
3593
3593
|
factsFound: typeof t.facts_found == "number" ? t.facts_found : null,
|
|
3594
3594
|
isSufficient: typeof t.is_sufficient == "boolean" ? t.is_sufficient : null
|
|
3595
|
-
},
|
|
3596
|
-
|
|
3595
|
+
}, l = wo(e.messages, i, a), c = l.findIndex((m) => m.id === i);
|
|
3596
|
+
if (c === -1)
|
|
3597
|
+
return e;
|
|
3598
|
+
const d = l[c], f = {
|
|
3599
|
+
...d.additionalKwargs ?? {},
|
|
3597
3600
|
toolStreaming: !0
|
|
3598
|
-
},
|
|
3599
|
-
return { ...e, messages:
|
|
3601
|
+
}, p = { ...d, additionalKwargs: f }, h = Oo(l, c, p);
|
|
3602
|
+
return { ...e, messages: h };
|
|
3600
3603
|
}
|
|
3601
3604
|
if (t.type === "checkpoint") {
|
|
3602
|
-
const
|
|
3603
|
-
return { ...e, lastCheckpointId: t.checkpointId, lastCheckpointNs:
|
|
3605
|
+
const i = t.checkpointNs ?? e.lastCheckpointNs ?? null, a = oy(e.messages, t.checkpointId, i);
|
|
3606
|
+
return { ...e, lastCheckpointId: t.checkpointId, lastCheckpointNs: i, messages: a };
|
|
3604
3607
|
}
|
|
3605
3608
|
if (t.type === "branch") {
|
|
3606
|
-
const
|
|
3607
|
-
return { ...e, lastBranch: t, lastCheckpointId:
|
|
3609
|
+
const i = t.checkpointId ?? e.lastCheckpointId, a = t.checkpointNs ?? e.lastCheckpointNs;
|
|
3610
|
+
return { ...e, lastBranch: t, lastCheckpointId: i ?? null, lastCheckpointNs: a ?? null };
|
|
3608
3611
|
}
|
|
3609
3612
|
if (t.type === "error") {
|
|
3610
|
-
const
|
|
3613
|
+
const i = {
|
|
3611
3614
|
id: `err-${Date.now()}`,
|
|
3612
3615
|
role: "system",
|
|
3613
3616
|
content: [{ type: "text", text: `Error: ${t.message}` }],
|
|
3614
3617
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3615
3618
|
};
|
|
3616
|
-
return { ...e, messages: [...e.messages,
|
|
3619
|
+
return { ...e, messages: [...e.messages, i] };
|
|
3617
3620
|
}
|
|
3618
3621
|
if (t.type === "state_history") {
|
|
3619
|
-
const
|
|
3622
|
+
const i = mr(t), a = i.interrupt, l = i.latest, c = a === null ? bu(e.messages) : e.messages;
|
|
3620
3623
|
return {
|
|
3621
3624
|
...e,
|
|
3622
|
-
messages:
|
|
3623
|
-
pendingInterrupt:
|
|
3624
|
-
lastCheckpointId: (
|
|
3625
|
-
lastCheckpointNs: (
|
|
3625
|
+
messages: c,
|
|
3626
|
+
pendingInterrupt: a,
|
|
3627
|
+
lastCheckpointId: (l == null ? void 0 : l.checkpointId) ?? e.lastCheckpointId,
|
|
3628
|
+
lastCheckpointNs: (l == null ? void 0 : l.checkpointNs) ?? e.lastCheckpointNs
|
|
3626
3629
|
};
|
|
3627
3630
|
}
|
|
3628
3631
|
return t.type === "thread_info", e;
|
|
@@ -3742,9 +3745,9 @@ function ny(e, t, n, r) {
|
|
|
3742
3745
|
if (s) {
|
|
3743
3746
|
const f = ry(a, s);
|
|
3744
3747
|
if (f === "" ? l = "" : f === s ? l = s : l = f, l) {
|
|
3745
|
-
const
|
|
3746
|
-
if ((
|
|
3747
|
-
const
|
|
3748
|
+
const p = c[c.length - 1];
|
|
3749
|
+
if ((p == null ? void 0 : p.type) === "text") {
|
|
3750
|
+
const h = p.text ?? "", m = { ...p, text: h + l };
|
|
3748
3751
|
c = [...c.slice(0, c.length - 1), m];
|
|
3749
3752
|
} else
|
|
3750
3753
|
c = [...c, { type: "text", text: l }];
|
|
@@ -3801,7 +3804,7 @@ function iy({
|
|
|
3801
3804
|
onAuthError: l,
|
|
3802
3805
|
onHeartbeat: c
|
|
3803
3806
|
}) {
|
|
3804
|
-
const d = $e(null), f = $e(null),
|
|
3807
|
+
const d = $e(null), f = $e(null), p = $e(/* @__PURE__ */ new Map()), h = $e(null), m = $e(null), g = ve((j) => {
|
|
3805
3808
|
try {
|
|
3806
3809
|
const M = globalThis.structuredClone;
|
|
3807
3810
|
if (typeof M == "function")
|
|
@@ -3816,20 +3819,20 @@ function iy({
|
|
|
3816
3819
|
}, []), y = ve(
|
|
3817
3820
|
(j, M) => {
|
|
3818
3821
|
if (!j) return;
|
|
3819
|
-
const $ =
|
|
3820
|
-
|
|
3822
|
+
const $ = p.current.get(j) ?? [], E = g(M), F = $.length >= Ml ? [...$.slice($.length - Ml + 1), E] : [...$, E];
|
|
3823
|
+
p.current.set(j, F);
|
|
3821
3824
|
},
|
|
3822
3825
|
[g]
|
|
3823
3826
|
), x = ve((j) => {
|
|
3824
|
-
j &&
|
|
3827
|
+
j && p.current.set(j, []);
|
|
3825
3828
|
}, []), w = ve(
|
|
3826
3829
|
(j) => {
|
|
3827
3830
|
const M = j ?? f.current;
|
|
3828
3831
|
if (!M) return;
|
|
3829
|
-
const $ =
|
|
3830
|
-
$ != null && $.length && $.forEach((
|
|
3832
|
+
const $ = p.current.get(M);
|
|
3833
|
+
$ != null && $.length && $.forEach((E) => {
|
|
3831
3834
|
try {
|
|
3832
|
-
n(
|
|
3835
|
+
n(E);
|
|
3833
3836
|
} catch (F) {
|
|
3834
3837
|
console.error("[useChatStreamingService] Failed to replay buffered event", F);
|
|
3835
3838
|
}
|
|
@@ -3838,7 +3841,7 @@ function iy({
|
|
|
3838
3841
|
[n]
|
|
3839
3842
|
), b = ve(
|
|
3840
3843
|
(j) => {
|
|
3841
|
-
var
|
|
3844
|
+
var E, F, N, V, B;
|
|
3842
3845
|
const M = j.seq ?? null;
|
|
3843
3846
|
if (M !== null) {
|
|
3844
3847
|
const _ = d.current;
|
|
@@ -3850,7 +3853,7 @@ function iy({
|
|
|
3850
3853
|
d.current = M;
|
|
3851
3854
|
}
|
|
3852
3855
|
if (j.type === "thread_info") {
|
|
3853
|
-
f.current = j.threadId,
|
|
3856
|
+
f.current = j.threadId, h.current && (h.current.threadIdGuess = j.threadId), m.current = j, x(j.threadId), console.log("[useChatStreamingService] 🎯 Received thread_info event:", j);
|
|
3854
3857
|
try {
|
|
3855
3858
|
t(j);
|
|
3856
3859
|
} catch (_) {
|
|
@@ -3868,7 +3871,7 @@ function iy({
|
|
|
3868
3871
|
}
|
|
3869
3872
|
if (j.type === "error") {
|
|
3870
3873
|
const _ = j;
|
|
3871
|
-
if (_.error_type === "auth_error" || _.code === "TOKEN_EXPIRED" || ((
|
|
3874
|
+
if (_.error_type === "auth_error" || _.code === "TOKEN_EXPIRED" || ((E = _.message) == null ? void 0 : E.includes("token")) || ((F = _.message) == null ? void 0 : F.includes("401")) || ((N = _.message) == null ? void 0 : N.includes("unauthorized")) || ((V = _.message) == null ? void 0 : V.includes("Unauthorized"))) {
|
|
3872
3875
|
console.error("[useChatStreamingService] Auth error event detected:", _.message);
|
|
3873
3876
|
try {
|
|
3874
3877
|
l == null || l(_.message);
|
|
@@ -3877,7 +3880,7 @@ function iy({
|
|
|
3877
3880
|
}
|
|
3878
3881
|
}
|
|
3879
3882
|
}
|
|
3880
|
-
const $ = j.threadId ?? (j.type === "state_history" ? j.threadId : void 0) ?? f.current ?? ((B =
|
|
3883
|
+
const $ = j.threadId ?? (j.type === "state_history" ? j.threadId : void 0) ?? f.current ?? ((B = h.current) == null ? void 0 : B.threadIdGuess) ?? null;
|
|
3881
3884
|
if (j.type === "state_history") {
|
|
3882
3885
|
f.current = $ ?? f.current;
|
|
3883
3886
|
try {
|
|
@@ -3905,9 +3908,9 @@ function iy({
|
|
|
3905
3908
|
), { stream: T, stop: S, isStreaming: C, error: k, setToken: R } = Fx({
|
|
3906
3909
|
baseUrl: e,
|
|
3907
3910
|
token: void 0
|
|
3908
|
-
}),
|
|
3911
|
+
}), A = ve(
|
|
3909
3912
|
(j, M) => {
|
|
3910
|
-
d.current = null, m.current = null, f.current = j.threadId ?? null,
|
|
3913
|
+
d.current = null, m.current = null, f.current = j.threadId ?? null, h.current = {
|
|
3911
3914
|
request: j,
|
|
3912
3915
|
callbacks: M,
|
|
3913
3916
|
manualStop: !1,
|
|
@@ -3918,41 +3921,41 @@ function iy({
|
|
|
3918
3921
|
{
|
|
3919
3922
|
onOpen: M == null ? void 0 : M.onOpen,
|
|
3920
3923
|
onError: ($) => {
|
|
3921
|
-
var
|
|
3922
|
-
(
|
|
3924
|
+
var E;
|
|
3925
|
+
(E = M == null ? void 0 : M.onError) == null || E.call(M, $);
|
|
3923
3926
|
},
|
|
3924
3927
|
onGap: (M == null ? void 0 : M.onGap) ?? s,
|
|
3925
3928
|
onConnectionError: ($) => {
|
|
3926
|
-
var
|
|
3927
|
-
a == null || a($), (
|
|
3929
|
+
var E;
|
|
3930
|
+
a == null || a($), (E = M == null ? void 0 : M.onConnectionError) == null || E.call(M, $);
|
|
3928
3931
|
},
|
|
3929
3932
|
onAuthError: ($) => {
|
|
3930
|
-
var
|
|
3931
|
-
l == null || l($), (
|
|
3933
|
+
var E;
|
|
3934
|
+
l == null || l($), (E = M == null ? void 0 : M.onAuthError) == null || E.call(M, $);
|
|
3932
3935
|
},
|
|
3933
3936
|
onHeartbeat: ($) => {
|
|
3934
|
-
var
|
|
3937
|
+
var E;
|
|
3935
3938
|
try {
|
|
3936
3939
|
c == null || c($);
|
|
3937
3940
|
} catch (F) {
|
|
3938
3941
|
console.warn("[useChatStreamingService] onHeartbeat handler failed", F);
|
|
3939
3942
|
}
|
|
3940
3943
|
try {
|
|
3941
|
-
(
|
|
3944
|
+
(E = M == null ? void 0 : M.onHeartbeat) == null || E.call(M, $);
|
|
3942
3945
|
} catch (F) {
|
|
3943
3946
|
console.warn("[useChatStreamingService] downstream onHeartbeat handler failed", F);
|
|
3944
3947
|
}
|
|
3945
3948
|
},
|
|
3946
3949
|
onClosed: ($) => {
|
|
3947
3950
|
var V, B, _, q;
|
|
3948
|
-
const
|
|
3949
|
-
($.reason === "complete" || $.reason === "aborted" &&
|
|
3951
|
+
const E = ((V = h.current) == null ? void 0 : V.manualStop) ?? !1, F = f.current ?? ((B = h.current) == null ? void 0 : B.threadIdGuess) ?? ((_ = $.lastStateHistory) == null ? void 0 : _.threadId) ?? null;
|
|
3952
|
+
($.reason === "complete" || $.reason === "aborted" && E) && x(F);
|
|
3950
3953
|
const N = {
|
|
3951
3954
|
...$,
|
|
3952
3955
|
threadId: F,
|
|
3953
3956
|
threadInfo: m.current,
|
|
3954
3957
|
// ✅ Include thread_info for recovery
|
|
3955
|
-
manualStop:
|
|
3958
|
+
manualStop: E
|
|
3956
3959
|
};
|
|
3957
3960
|
try {
|
|
3958
3961
|
i == null || i(N);
|
|
@@ -3964,7 +3967,7 @@ function iy({
|
|
|
3964
3967
|
} catch (Y) {
|
|
3965
3968
|
console.warn("[useChatStreamingService] downstream onClosed handler failed", Y);
|
|
3966
3969
|
}
|
|
3967
|
-
|
|
3970
|
+
h.current && (h.current = null);
|
|
3968
3971
|
}
|
|
3969
3972
|
}
|
|
3970
3973
|
);
|
|
@@ -3980,18 +3983,18 @@ function iy({
|
|
|
3980
3983
|
T
|
|
3981
3984
|
]
|
|
3982
3985
|
), D = ve(() => {
|
|
3983
|
-
|
|
3986
|
+
h.current && (h.current.manualStop = !0), S();
|
|
3984
3987
|
}, [S]);
|
|
3985
3988
|
return Le(
|
|
3986
3989
|
() => ({
|
|
3987
|
-
startStream:
|
|
3990
|
+
startStream: A,
|
|
3988
3991
|
stop: D,
|
|
3989
3992
|
isStreaming: C,
|
|
3990
3993
|
error: k,
|
|
3991
3994
|
setAuthToken: R,
|
|
3992
3995
|
replayBufferedEvents: w
|
|
3993
3996
|
}),
|
|
3994
|
-
[
|
|
3997
|
+
[A, D, C, k, R, w]
|
|
3995
3998
|
);
|
|
3996
3999
|
}
|
|
3997
4000
|
const Cu = so(null), Tu = so(null), ku = so(null);
|
|
@@ -4007,7 +4010,7 @@ function ay({
|
|
|
4007
4010
|
onThreadChange: a,
|
|
4008
4011
|
onConnectionError: l
|
|
4009
4012
|
}) {
|
|
4010
|
-
const { api: c, baseUrl: d } = gu(), f = Le(() => En(d), [d]), [
|
|
4013
|
+
const { api: c, baseUrl: d } = gu(), f = Le(() => En(d), [d]), [p, h] = ye([]), [m, g] = ye(t), [y, x] = ye(!1), [w, b] = ye(null), [T, S] = ye(!1), [C, k] = ye(null), { state: R, seed: A, prepend: D, pushUser: j, onEvent: M } = Jx(), [$, E] = ye(!1), [F, N] = ye(!1), [V, B] = ye(null), [_, q] = ye([]), [Y, se] = ye([]), [we, Ie] = ye(!1), G = Le(() => $x(_), [_]), z = $e(m), X = $e(null), L = $e(null), K = $e(null), J = $e(null), le = $e(!1), ie = $e(null), Ae = $e(/* @__PURE__ */ new Map()), Ve = $e(/* @__PURE__ */ new Map());
|
|
4011
4014
|
wt(() => {
|
|
4012
4015
|
z.current = m;
|
|
4013
4016
|
}, [m]);
|
|
@@ -4015,7 +4018,7 @@ function ay({
|
|
|
4015
4018
|
x(!0), b(null);
|
|
4016
4019
|
try {
|
|
4017
4020
|
const U = await c.listThreads();
|
|
4018
|
-
|
|
4021
|
+
h(U ?? []);
|
|
4019
4022
|
} catch (U) {
|
|
4020
4023
|
const re = String(U);
|
|
4021
4024
|
b(re), s == null || s(re);
|
|
@@ -4031,7 +4034,7 @@ function ay({
|
|
|
4031
4034
|
updatedAt: U.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
4032
4035
|
messageCount: U.messageCount ?? 1
|
|
4033
4036
|
};
|
|
4034
|
-
|
|
4037
|
+
h((O) => {
|
|
4035
4038
|
let Z = !1;
|
|
4036
4039
|
const ne = O.map((pe) => pe.threadId === re.threadId ? (Z = !0, console.debug("[ChatSessionProvider] thread_info: updating existing thread", re.threadId), {
|
|
4037
4040
|
...pe,
|
|
@@ -4050,12 +4053,12 @@ function ay({
|
|
|
4050
4053
|
if (!O.length)
|
|
4051
4054
|
return;
|
|
4052
4055
|
const ne = O.find((pe) => pe.messages && pe.messages.length > 0) ?? O.find((pe) => !!pe.checkpointId) ?? O[0];
|
|
4053
|
-
|
|
4056
|
+
A((ne == null ? void 0 : ne.messages) ?? [], {
|
|
4054
4057
|
checkpointId: (ne == null ? void 0 : ne.checkpointId) ?? null,
|
|
4055
4058
|
checkpointNs: (ne == null ? void 0 : ne.checkpointNs) ?? null
|
|
4056
|
-
}), se(Z), q(O),
|
|
4059
|
+
}), se(Z), q(O), E(!!(ne != null && ne.nextCursor)), B((ne == null ? void 0 : ne.nextCursor) ?? null), ie.current = `${re}:latest`, L.current = null, K.current = null;
|
|
4057
4060
|
},
|
|
4058
|
-
[
|
|
4061
|
+
[A]
|
|
4059
4062
|
), Je = ve((U) => {
|
|
4060
4063
|
console.log("[ChatSessionProvider] 🎯 Received thread_info:", U.threadId), xe(U), z.current !== U.threadId && ((U.created ?? !z.current) && (L.current = U.threadId), K.current = U.threadId, console.log("[ChatSessionProvider] thread_info: marking to skip auto-load for new thread"), g(U.threadId));
|
|
4061
4064
|
}, [xe]), { startStream: ot, stop: Ze, isStreaming: Ge, error: it, setAuthToken: Qe } = iy({
|
|
@@ -4080,19 +4083,19 @@ function ay({
|
|
|
4080
4083
|
[c, oe, s]
|
|
4081
4084
|
), ct = ve(
|
|
4082
4085
|
async (U) => {
|
|
4083
|
-
const re =
|
|
4084
|
-
|
|
4086
|
+
const re = p;
|
|
4087
|
+
h((Z) => Z.filter((ne) => ne.threadId !== U));
|
|
4085
4088
|
const O = new AbortController();
|
|
4086
4089
|
Ve.current.set(U, O);
|
|
4087
4090
|
try {
|
|
4088
|
-
await c.deleteThread(U), z.current === U && (g(null),
|
|
4091
|
+
await c.deleteThread(U), z.current === U && (g(null), A([], {})), console.log("[ChatSessionProvider] Thread deleted successfully:", U);
|
|
4089
4092
|
} catch (Z) {
|
|
4090
|
-
console.error("[ChatSessionProvider] Delete failed, restoring thread:", U, Z),
|
|
4093
|
+
console.error("[ChatSessionProvider] Delete failed, restoring thread:", U, Z), h(re), s == null || s(`Failed to delete thread: ${String(Z)}`);
|
|
4091
4094
|
} finally {
|
|
4092
4095
|
Ve.current.delete(U);
|
|
4093
4096
|
}
|
|
4094
4097
|
},
|
|
4095
|
-
[
|
|
4098
|
+
[p, c, A, s]
|
|
4096
4099
|
), Nt = ve(
|
|
4097
4100
|
async (U, re) => {
|
|
4098
4101
|
try {
|
|
@@ -4121,10 +4124,10 @@ function ay({
|
|
|
4121
4124
|
return;
|
|
4122
4125
|
}
|
|
4123
4126
|
const { checkpoints: De, timeline: je } = mr(me), Ne = De.find((Vt) => Vt.messages && Vt.messages.length > 0) ?? (re ? De.find((Vt) => Vt.checkpointId === re) : null) ?? De[0];
|
|
4124
|
-
|
|
4127
|
+
A((Ne == null ? void 0 : Ne.messages) ?? [], {
|
|
4125
4128
|
checkpointId: (Ne == null ? void 0 : Ne.checkpointId) ?? null,
|
|
4126
4129
|
checkpointNs: (Ne == null ? void 0 : Ne.checkpointNs) ?? null
|
|
4127
|
-
}), se(je), q(De),
|
|
4130
|
+
}), se(je), q(De), E(!!(Ne != null && Ne.nextCursor)), B((Ne == null ? void 0 : Ne.nextCursor) ?? null);
|
|
4128
4131
|
} catch (me) {
|
|
4129
4132
|
if (z.current === pe) {
|
|
4130
4133
|
const De = String(me);
|
|
@@ -4142,7 +4145,7 @@ function ay({
|
|
|
4142
4145
|
}
|
|
4143
4146
|
return z.current === U && (ie.current = O), ne;
|
|
4144
4147
|
},
|
|
4145
|
-
[c,
|
|
4148
|
+
[c, A, s]
|
|
4146
4149
|
), ht = ve(
|
|
4147
4150
|
async (U, re) => {
|
|
4148
4151
|
J.current = U;
|
|
@@ -4214,7 +4217,7 @@ function ay({
|
|
|
4214
4217
|
console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: U, checkpointNs: re });
|
|
4215
4218
|
return;
|
|
4216
4219
|
}
|
|
4217
|
-
se(me), q(pe),
|
|
4220
|
+
se(me), q(pe), A(De.messages ?? [], {
|
|
4218
4221
|
checkpointId: De.checkpointId ?? null,
|
|
4219
4222
|
checkpointNs: De.checkpointNs ?? null
|
|
4220
4223
|
});
|
|
@@ -4224,15 +4227,15 @@ function ay({
|
|
|
4224
4227
|
Ie(!1);
|
|
4225
4228
|
}
|
|
4226
4229
|
},
|
|
4227
|
-
[c,
|
|
4230
|
+
[c, A, s]
|
|
4228
4231
|
), Tt = ve(
|
|
4229
4232
|
(U, re) => {
|
|
4230
|
-
|
|
4233
|
+
A(R.messages, {
|
|
4231
4234
|
checkpointId: U ?? null,
|
|
4232
4235
|
checkpointNs: re ?? null
|
|
4233
4236
|
});
|
|
4234
4237
|
},
|
|
4235
|
-
[
|
|
4238
|
+
[A, R.messages]
|
|
4236
4239
|
), _t = ve(async () => {
|
|
4237
4240
|
z.current && await ht(z.current);
|
|
4238
4241
|
}, [ht]), Lt = ve(async () => {
|
|
@@ -4249,7 +4252,7 @@ function ay({
|
|
|
4249
4252
|
const { checkpoints: O } = mr(re);
|
|
4250
4253
|
if (O.length > 0) {
|
|
4251
4254
|
const Z = O[O.length - 1];
|
|
4252
|
-
D((Z == null ? void 0 : Z.messages) ?? []),
|
|
4255
|
+
D((Z == null ? void 0 : Z.messages) ?? []), E(!!(Z != null && Z.nextCursor)), B((Z == null ? void 0 : Z.nextCursor) ?? null);
|
|
4253
4256
|
}
|
|
4254
4257
|
} catch (re) {
|
|
4255
4258
|
z.current === U && (s == null || s(String(re)));
|
|
@@ -4257,13 +4260,13 @@ function ay({
|
|
|
4257
4260
|
N(!1);
|
|
4258
4261
|
}
|
|
4259
4262
|
}, [c, V, D, s]), Wt = ve(async () => {
|
|
4260
|
-
|
|
4263
|
+
A([], {}), g(null), Ze(), q([]), se([]), E(!1), B(null), S(!1), Ie(!1), N(!1), k(null);
|
|
4261
4264
|
try {
|
|
4262
4265
|
await c.getAgent("default");
|
|
4263
4266
|
} catch (U) {
|
|
4264
4267
|
console.warn("[ChatSessionProvider] Failed to refetch agent after clearing thread:", U);
|
|
4265
4268
|
}
|
|
4266
|
-
}, [
|
|
4269
|
+
}, [A, Ze, c]), Ue = ve(
|
|
4267
4270
|
async (U, re, O) => {
|
|
4268
4271
|
const Z = z.current;
|
|
4269
4272
|
if (!Z)
|
|
@@ -4334,7 +4337,7 @@ function ay({
|
|
|
4334
4337
|
[c, j, R, ot, Y]
|
|
4335
4338
|
), st = Le(
|
|
4336
4339
|
() => ({
|
|
4337
|
-
threads:
|
|
4340
|
+
threads: p,
|
|
4338
4341
|
currentThreadId: m,
|
|
4339
4342
|
setCurrentThreadId: g,
|
|
4340
4343
|
isLoading: y,
|
|
@@ -4346,7 +4349,7 @@ function ay({
|
|
|
4346
4349
|
refreshThreads: oe
|
|
4347
4350
|
}
|
|
4348
4351
|
}),
|
|
4349
|
-
[
|
|
4352
|
+
[p, m, y, w, et, ct, Nt, oe]
|
|
4350
4353
|
), Ke = Le(() => {
|
|
4351
4354
|
const U = R.assemblingId ?? null;
|
|
4352
4355
|
return U ? { assemblingMessageId: U } : null;
|
|
@@ -4521,8 +4524,8 @@ function uy({
|
|
|
4521
4524
|
onCancelEdit: c,
|
|
4522
4525
|
onStop: d,
|
|
4523
4526
|
className: f = "",
|
|
4524
|
-
textareaClassName:
|
|
4525
|
-
allowEmptySend:
|
|
4527
|
+
textareaClassName: p = "",
|
|
4528
|
+
allowEmptySend: h = !1
|
|
4526
4529
|
}) {
|
|
4527
4530
|
const m = i !== void 0, [g, y] = Q.useState(e), x = (m ? i : g) ?? "", [w, b] = Q.useTransition(), T = Q.useRef(null), S = Q.useRef(0), C = Q.useRef(null);
|
|
4528
4531
|
Q.useEffect(() => {
|
|
@@ -4540,11 +4543,11 @@ function uy({
|
|
|
4540
4543
|
m || y(F), N && (a == null || a(F));
|
|
4541
4544
|
},
|
|
4542
4545
|
[m, a]
|
|
4543
|
-
),
|
|
4546
|
+
), A = Q.useCallback(
|
|
4544
4547
|
async (F) => {
|
|
4545
4548
|
F && F.preventDefault();
|
|
4546
4549
|
const N = (x ?? "").trim();
|
|
4547
|
-
if (!N && !
|
|
4550
|
+
if (!N && !h)
|
|
4548
4551
|
return;
|
|
4549
4552
|
const V = ++S.current;
|
|
4550
4553
|
C.current = {
|
|
@@ -4566,17 +4569,17 @@ function uy({
|
|
|
4566
4569
|
}
|
|
4567
4570
|
});
|
|
4568
4571
|
},
|
|
4569
|
-
[x, l,
|
|
4572
|
+
[x, l, h, m, a]
|
|
4570
4573
|
), D = Q.useCallback((F) => {
|
|
4571
4574
|
const N = F.target.value;
|
|
4572
4575
|
R(N, { fromUser: !0 }), C.current && (C.current.shouldClear = !1), T.current && (T.current.style.height = "auto", T.current.style.height = `${T.current.scrollHeight}px`);
|
|
4573
4576
|
}, [R]), j = Q.useCallback(
|
|
4574
4577
|
(F) => {
|
|
4575
|
-
F.key === "Enter" && !F.shiftKey ? (F.preventDefault(),
|
|
4578
|
+
F.key === "Enter" && !F.shiftKey ? (F.preventDefault(), A()) : F.key === "Escape" && t && (F.preventDefault(), c == null || c());
|
|
4576
4579
|
},
|
|
4577
|
-
[
|
|
4578
|
-
),
|
|
4579
|
-
return /* @__PURE__ */ u.jsx("form", { onSubmit: (F) => void
|
|
4580
|
+
[A, t, c]
|
|
4581
|
+
), E = `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))]" : ""} ${p}`;
|
|
4582
|
+
return /* @__PURE__ */ u.jsx("form", { onSubmit: (F) => void A(F), className: `w-full ${f}`, children: /* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
4580
4583
|
/* @__PURE__ */ u.jsx("div", { className: "flex-1", children: /* @__PURE__ */ u.jsx(
|
|
4581
4584
|
Iu,
|
|
4582
4585
|
{
|
|
@@ -4585,7 +4588,7 @@ function uy({
|
|
|
4585
4588
|
onChange: D,
|
|
4586
4589
|
onKeyDown: j,
|
|
4587
4590
|
placeholder: t ? "Edit your message..." : n,
|
|
4588
|
-
className:
|
|
4591
|
+
className: E,
|
|
4589
4592
|
disabled: o,
|
|
4590
4593
|
maxLength: s,
|
|
4591
4594
|
rows: 1,
|
|
@@ -4614,7 +4617,7 @@ function uy({
|
|
|
4614
4617
|
size: "icon",
|
|
4615
4618
|
className: "shrink-0",
|
|
4616
4619
|
title: t ? "Save changes" : "Send message",
|
|
4617
|
-
disabled: o || !x.trim() && !
|
|
4620
|
+
disabled: o || !x.trim() && !h || w,
|
|
4618
4621
|
children: /* @__PURE__ */ u.jsx(sm, { size: 16 })
|
|
4619
4622
|
}
|
|
4620
4623
|
) })
|
|
@@ -4672,13 +4675,13 @@ function _n(e, t = []) {
|
|
|
4672
4675
|
n = [...n, i];
|
|
4673
4676
|
const c = (f) => {
|
|
4674
4677
|
var x;
|
|
4675
|
-
const { scope:
|
|
4676
|
-
return /* @__PURE__ */ u.jsx(g.Provider, { value: y, children:
|
|
4678
|
+
const { scope: p, children: h, ...m } = f, g = ((x = p == null ? void 0 : p[e]) == null ? void 0 : x[l]) || a, y = v.useMemo(() => m, Object.values(m));
|
|
4679
|
+
return /* @__PURE__ */ u.jsx(g.Provider, { value: y, children: h });
|
|
4677
4680
|
};
|
|
4678
4681
|
c.displayName = s + "Provider";
|
|
4679
|
-
function d(f,
|
|
4682
|
+
function d(f, p) {
|
|
4680
4683
|
var g;
|
|
4681
|
-
const
|
|
4684
|
+
const h = ((g = p == null ? void 0 : p[e]) == null ? void 0 : g[l]) || a, m = v.useContext(h);
|
|
4682
4685
|
if (m) return m;
|
|
4683
4686
|
if (i !== void 0) return i;
|
|
4684
4687
|
throw new Error(`\`${f}\` must be used within \`${s}\``);
|
|
@@ -4741,8 +4744,8 @@ function Cr({
|
|
|
4741
4744
|
(d) => {
|
|
4742
4745
|
var f;
|
|
4743
4746
|
if (a) {
|
|
4744
|
-
const
|
|
4745
|
-
|
|
4747
|
+
const p = gy(d) ? d(e) : d;
|
|
4748
|
+
p !== e && ((f = i.current) == null || f.call(i, p));
|
|
4746
4749
|
} else
|
|
4747
4750
|
s(d);
|
|
4748
4751
|
},
|
|
@@ -4809,13 +4812,13 @@ function ua(e) {
|
|
|
4809
4812
|
}
|
|
4810
4813
|
);
|
|
4811
4814
|
c.displayName = a;
|
|
4812
|
-
const d = e + "CollectionItemSlot", f = "data-radix-collection-item",
|
|
4815
|
+
const d = e + "CollectionItemSlot", f = "data-radix-collection-item", p = br(d), h = Q.forwardRef(
|
|
4813
4816
|
(g, y) => {
|
|
4814
4817
|
const { scope: x, children: w, ...b } = g, T = Q.useRef(null), S = We(y, T), C = s(d, x);
|
|
4815
|
-
return Q.useEffect(() => (C.itemMap.set(T, { ref: T, ...b }), () => void C.itemMap.delete(T))), /* @__PURE__ */ u.jsx(
|
|
4818
|
+
return Q.useEffect(() => (C.itemMap.set(T, { ref: T, ...b }), () => void C.itemMap.delete(T))), /* @__PURE__ */ u.jsx(p, { [f]: "", ref: S, children: w });
|
|
4816
4819
|
}
|
|
4817
4820
|
);
|
|
4818
|
-
|
|
4821
|
+
h.displayName = d;
|
|
4819
4822
|
function m(g) {
|
|
4820
4823
|
const y = s(e + "CollectionConsumer", g);
|
|
4821
4824
|
return Q.useCallback(() => {
|
|
@@ -4828,7 +4831,7 @@ function ua(e) {
|
|
|
4828
4831
|
}, [y.collectionRef, y.itemMap]);
|
|
4829
4832
|
}
|
|
4830
4833
|
return [
|
|
4831
|
-
{ Provider: i, Slot: c, ItemSlot:
|
|
4834
|
+
{ Provider: i, Slot: c, ItemSlot: h },
|
|
4832
4835
|
m,
|
|
4833
4836
|
r
|
|
4834
4837
|
];
|
|
@@ -4870,24 +4873,24 @@ var wy = "DismissableLayer", Pi = "dismissableLayer.update", by = "dismissableLa
|
|
|
4870
4873
|
onInteractOutside: i,
|
|
4871
4874
|
onDismiss: a,
|
|
4872
4875
|
...l
|
|
4873
|
-
} = e, c = v.useContext(Eu), [d, f] = v.useState(null),
|
|
4874
|
-
const R = k.target,
|
|
4875
|
-
!T ||
|
|
4876
|
-
},
|
|
4876
|
+
} = e, c = v.useContext(Eu), [d, f] = v.useState(null), p = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = v.useState({}), m = We(t, (k) => f(k)), g = Array.from(c.layers), [y] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), x = g.indexOf(y), w = d ? g.indexOf(d) : -1, b = c.layersWithOutsidePointerEventsDisabled.size > 0, T = w >= x, S = ky((k) => {
|
|
4877
|
+
const R = k.target, A = [...c.branches].some((D) => D.contains(R));
|
|
4878
|
+
!T || A || (o == null || o(k), i == null || i(k), k.defaultPrevented || a == null || a());
|
|
4879
|
+
}, p), C = Iy((k) => {
|
|
4877
4880
|
const R = k.target;
|
|
4878
4881
|
[...c.branches].some((D) => D.contains(R)) || (s == null || s(k), i == null || i(k), k.defaultPrevented || a == null || a());
|
|
4879
|
-
},
|
|
4882
|
+
}, p);
|
|
4880
4883
|
return vy((k) => {
|
|
4881
4884
|
w === c.layers.size - 1 && (r == null || r(k), !k.defaultPrevented && a && (k.preventDefault(), a()));
|
|
4882
|
-
},
|
|
4885
|
+
}, p), v.useEffect(() => {
|
|
4883
4886
|
if (d)
|
|
4884
|
-
return n && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (Dl =
|
|
4885
|
-
n && c.layersWithOutsidePointerEventsDisabled.size === 1 && (
|
|
4887
|
+
return n && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (Dl = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(d)), c.layers.add(d), Ll(), () => {
|
|
4888
|
+
n && c.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = Dl);
|
|
4886
4889
|
};
|
|
4887
|
-
}, [d,
|
|
4890
|
+
}, [d, p, n, c]), v.useEffect(() => () => {
|
|
4888
4891
|
d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), Ll());
|
|
4889
4892
|
}, [d, c]), v.useEffect(() => {
|
|
4890
|
-
const k = () =>
|
|
4893
|
+
const k = () => h({});
|
|
4891
4894
|
return document.addEventListener(Pi, k), () => document.removeEventListener(Pi, k);
|
|
4892
4895
|
}, []), /* @__PURE__ */ u.jsx(
|
|
4893
4896
|
_e.div,
|
|
@@ -4992,7 +4995,7 @@ var ii = "focusScope.autoFocusOnMount", ai = "focusScope.autoFocusOnUnmount", Fl
|
|
|
4992
4995
|
onMountAutoFocus: o,
|
|
4993
4996
|
onUnmountAutoFocus: s,
|
|
4994
4997
|
...i
|
|
4995
|
-
} = e, [a, l] = v.useState(null), c = Et(o), d = Et(s), f = v.useRef(null),
|
|
4998
|
+
} = e, [a, l] = v.useState(null), c = Et(o), d = Et(s), f = v.useRef(null), p = We(t, (g) => l(g)), h = v.useRef({
|
|
4996
4999
|
paused: !1,
|
|
4997
5000
|
pause() {
|
|
4998
5001
|
this.paused = !0;
|
|
@@ -5004,11 +5007,11 @@ var ii = "focusScope.autoFocusOnMount", ai = "focusScope.autoFocusOnUnmount", Fl
|
|
|
5004
5007
|
v.useEffect(() => {
|
|
5005
5008
|
if (r) {
|
|
5006
5009
|
let g = function(b) {
|
|
5007
|
-
if (
|
|
5010
|
+
if (h.paused || !a) return;
|
|
5008
5011
|
const T = b.target;
|
|
5009
5012
|
a.contains(T) ? f.current = T : Mn(f.current, { select: !0 });
|
|
5010
5013
|
}, y = function(b) {
|
|
5011
|
-
if (
|
|
5014
|
+
if (h.paused || !a) return;
|
|
5012
5015
|
const T = b.relatedTarget;
|
|
5013
5016
|
T !== null && (a.contains(T) || Mn(f.current, { select: !0 }));
|
|
5014
5017
|
}, x = function(b) {
|
|
@@ -5022,9 +5025,9 @@ var ii = "focusScope.autoFocusOnMount", ai = "focusScope.autoFocusOnUnmount", Fl
|
|
|
5022
5025
|
document.removeEventListener("focusin", g), document.removeEventListener("focusout", y), w.disconnect();
|
|
5023
5026
|
};
|
|
5024
5027
|
}
|
|
5025
|
-
}, [r, a,
|
|
5028
|
+
}, [r, a, h.paused]), v.useEffect(() => {
|
|
5026
5029
|
if (a) {
|
|
5027
|
-
zl.add(
|
|
5030
|
+
zl.add(h);
|
|
5028
5031
|
const g = document.activeElement;
|
|
5029
5032
|
if (!a.contains(g)) {
|
|
5030
5033
|
const x = new CustomEvent(ii, Fl);
|
|
@@ -5033,23 +5036,23 @@ var ii = "focusScope.autoFocusOnMount", ai = "focusScope.autoFocusOnUnmount", Fl
|
|
|
5033
5036
|
return () => {
|
|
5034
5037
|
a.removeEventListener(ii, c), setTimeout(() => {
|
|
5035
5038
|
const x = new CustomEvent(ai, Fl);
|
|
5036
|
-
a.addEventListener(ai, d), a.dispatchEvent(x), x.defaultPrevented || Mn(g ?? document.body, { select: !0 }), a.removeEventListener(ai, d), zl.remove(
|
|
5039
|
+
a.addEventListener(ai, d), a.dispatchEvent(x), x.defaultPrevented || Mn(g ?? document.body, { select: !0 }), a.removeEventListener(ai, d), zl.remove(h);
|
|
5037
5040
|
}, 0);
|
|
5038
5041
|
};
|
|
5039
5042
|
}
|
|
5040
|
-
}, [a, c, d,
|
|
5043
|
+
}, [a, c, d, h]);
|
|
5041
5044
|
const m = v.useCallback(
|
|
5042
5045
|
(g) => {
|
|
5043
|
-
if (!n && !r ||
|
|
5046
|
+
if (!n && !r || h.paused) return;
|
|
5044
5047
|
const y = g.key === "Tab" && !g.altKey && !g.ctrlKey && !g.metaKey, x = document.activeElement;
|
|
5045
5048
|
if (y && x) {
|
|
5046
5049
|
const w = g.currentTarget, [b, T] = Ay(w);
|
|
5047
5050
|
b && T ? !g.shiftKey && x === T ? (g.preventDefault(), n && Mn(b, { select: !0 })) : g.shiftKey && x === b && (g.preventDefault(), n && Mn(T, { select: !0 })) : x === w && g.preventDefault();
|
|
5048
5051
|
}
|
|
5049
5052
|
},
|
|
5050
|
-
[n, r,
|
|
5053
|
+
[n, r, h.paused]
|
|
5051
5054
|
);
|
|
5052
|
-
return /* @__PURE__ */ u.jsx(_e.div, { tabIndex: -1, ...i, ref:
|
|
5055
|
+
return /* @__PURE__ */ u.jsx(_e.div, { tabIndex: -1, ...i, ref: p, onKeyDown: m });
|
|
5053
5056
|
});
|
|
5054
5057
|
ks.displayName = Ry;
|
|
5055
5058
|
function Ey(e, { select: t = !1 } = {}) {
|
|
@@ -5233,48 +5236,48 @@ function Vl(e, t, n) {
|
|
|
5233
5236
|
reference: r,
|
|
5234
5237
|
floating: o
|
|
5235
5238
|
} = e;
|
|
5236
|
-
const s = yn(t), i = ha(t), a = pa(i), l = Nn(t), c = s === "y", d = r.x + r.width / 2 - o.width / 2, f = r.y + r.height / 2 - o.height / 2,
|
|
5237
|
-
let
|
|
5239
|
+
const s = yn(t), i = ha(t), a = pa(i), l = Nn(t), c = s === "y", d = r.x + r.width / 2 - o.width / 2, f = r.y + r.height / 2 - o.height / 2, p = r[a] / 2 - o[a] / 2;
|
|
5240
|
+
let h;
|
|
5238
5241
|
switch (l) {
|
|
5239
5242
|
case "top":
|
|
5240
|
-
|
|
5243
|
+
h = {
|
|
5241
5244
|
x: d,
|
|
5242
5245
|
y: r.y - o.height
|
|
5243
5246
|
};
|
|
5244
5247
|
break;
|
|
5245
5248
|
case "bottom":
|
|
5246
|
-
|
|
5249
|
+
h = {
|
|
5247
5250
|
x: d,
|
|
5248
5251
|
y: r.y + r.height
|
|
5249
5252
|
};
|
|
5250
5253
|
break;
|
|
5251
5254
|
case "right":
|
|
5252
|
-
|
|
5255
|
+
h = {
|
|
5253
5256
|
x: r.x + r.width,
|
|
5254
5257
|
y: f
|
|
5255
5258
|
};
|
|
5256
5259
|
break;
|
|
5257
5260
|
case "left":
|
|
5258
|
-
|
|
5261
|
+
h = {
|
|
5259
5262
|
x: r.x - o.width,
|
|
5260
5263
|
y: f
|
|
5261
5264
|
};
|
|
5262
5265
|
break;
|
|
5263
5266
|
default:
|
|
5264
|
-
|
|
5267
|
+
h = {
|
|
5265
5268
|
x: r.x,
|
|
5266
5269
|
y: r.y
|
|
5267
5270
|
};
|
|
5268
5271
|
}
|
|
5269
5272
|
switch (Er(t)) {
|
|
5270
5273
|
case "start":
|
|
5271
|
-
|
|
5274
|
+
h[i] -= p * (n && c ? -1 : 1);
|
|
5272
5275
|
break;
|
|
5273
5276
|
case "end":
|
|
5274
|
-
|
|
5277
|
+
h[i] += p * (n && c ? -1 : 1);
|
|
5275
5278
|
break;
|
|
5276
5279
|
}
|
|
5277
|
-
return
|
|
5280
|
+
return h;
|
|
5278
5281
|
}
|
|
5279
5282
|
const qy = async (e, t, n) => {
|
|
5280
5283
|
const {
|
|
@@ -5290,7 +5293,7 @@ const qy = async (e, t, n) => {
|
|
|
5290
5293
|
}), {
|
|
5291
5294
|
x: d,
|
|
5292
5295
|
y: f
|
|
5293
|
-
} = Vl(c, r, l),
|
|
5296
|
+
} = Vl(c, r, l), p = r, h = {}, m = 0;
|
|
5294
5297
|
for (let g = 0; g < a.length; g++) {
|
|
5295
5298
|
const {
|
|
5296
5299
|
name: y,
|
|
@@ -5304,9 +5307,9 @@ const qy = async (e, t, n) => {
|
|
|
5304
5307
|
x: d,
|
|
5305
5308
|
y: f,
|
|
5306
5309
|
initialPlacement: r,
|
|
5307
|
-
placement:
|
|
5310
|
+
placement: p,
|
|
5308
5311
|
strategy: o,
|
|
5309
|
-
middlewareData:
|
|
5312
|
+
middlewareData: h,
|
|
5310
5313
|
rects: c,
|
|
5311
5314
|
platform: i,
|
|
5312
5315
|
elements: {
|
|
@@ -5314,27 +5317,27 @@ const qy = async (e, t, n) => {
|
|
|
5314
5317
|
floating: t
|
|
5315
5318
|
}
|
|
5316
5319
|
});
|
|
5317
|
-
d = w ?? d, f = b ?? f,
|
|
5318
|
-
...
|
|
5320
|
+
d = w ?? d, f = b ?? f, h = {
|
|
5321
|
+
...h,
|
|
5319
5322
|
[y]: {
|
|
5320
|
-
...
|
|
5323
|
+
...h[y],
|
|
5321
5324
|
...T
|
|
5322
5325
|
}
|
|
5323
|
-
}, S && m <= 50 && (m++, typeof S == "object" && (S.placement && (
|
|
5326
|
+
}, S && m <= 50 && (m++, typeof S == "object" && (S.placement && (p = S.placement), S.rects && (c = S.rects === !0 ? await i.getElementRects({
|
|
5324
5327
|
reference: e,
|
|
5325
5328
|
floating: t,
|
|
5326
5329
|
strategy: o
|
|
5327
5330
|
}) : S.rects), {
|
|
5328
5331
|
x: d,
|
|
5329
5332
|
y: f
|
|
5330
|
-
} = Vl(c,
|
|
5333
|
+
} = Vl(c, p, l)), g = -1);
|
|
5331
5334
|
}
|
|
5332
5335
|
return {
|
|
5333
5336
|
x: d,
|
|
5334
5337
|
y: f,
|
|
5335
|
-
placement:
|
|
5338
|
+
placement: p,
|
|
5336
5339
|
strategy: o,
|
|
5337
|
-
middlewareData:
|
|
5340
|
+
middlewareData: h
|
|
5338
5341
|
};
|
|
5339
5342
|
};
|
|
5340
5343
|
async function Gr(e, t) {
|
|
@@ -5351,9 +5354,9 @@ async function Gr(e, t) {
|
|
|
5351
5354
|
boundary: c = "clippingAncestors",
|
|
5352
5355
|
rootBoundary: d = "viewport",
|
|
5353
5356
|
elementContext: f = "floating",
|
|
5354
|
-
altBoundary:
|
|
5355
|
-
padding:
|
|
5356
|
-
} = An(t, e), m = _u(
|
|
5357
|
+
altBoundary: p = !1,
|
|
5358
|
+
padding: h = 0
|
|
5359
|
+
} = An(t, e), m = _u(h), y = a[p ? f === "floating" ? "reference" : "floating" : f], x = Xo(await s.getClippingRect({
|
|
5357
5360
|
element: (n = await (s.isElement == null ? void 0 : s.isElement(y))) == null || n ? y : y.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(a.floating)),
|
|
5358
5361
|
boundary: c,
|
|
5359
5362
|
rootBoundary: d,
|
|
@@ -5400,18 +5403,18 @@ const Gy = (e) => ({
|
|
|
5400
5403
|
} = An(e, t) || {};
|
|
5401
5404
|
if (c == null)
|
|
5402
5405
|
return {};
|
|
5403
|
-
const f = _u(d),
|
|
5406
|
+
const f = _u(d), p = {
|
|
5404
5407
|
x: n,
|
|
5405
5408
|
y: r
|
|
5406
|
-
},
|
|
5409
|
+
}, h = ha(o), m = pa(h), g = await i.getDimensions(c), y = h === "y", x = y ? "top" : "left", w = y ? "bottom" : "right", b = y ? "clientHeight" : "clientWidth", T = s.reference[m] + s.reference[h] - p[h] - s.floating[m], S = p[h] - s.reference[h], C = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c));
|
|
5407
5410
|
let k = C ? C[b] : 0;
|
|
5408
5411
|
(!k || !await (i.isElement == null ? void 0 : i.isElement(C))) && (k = a.floating[b] || s.floating[m]);
|
|
5409
|
-
const R = T / 2 - S / 2,
|
|
5412
|
+
const R = T / 2 - S / 2, A = k / 2 - g[m] / 2 - 1, D = Dn(f[x], A), j = Dn(f[w], A), M = D, $ = k - g[m] - j, E = k / 2 - g[m] / 2 + R, F = Mi(M, E, $), N = !l.arrow && Er(o) != null && E !== F && s.reference[m] / 2 - (E < M ? D : j) - g[m] / 2 < 0, V = N ? E < M ? E - M : E - $ : 0;
|
|
5410
5413
|
return {
|
|
5411
|
-
[
|
|
5414
|
+
[h]: p[h] + V,
|
|
5412
5415
|
data: {
|
|
5413
|
-
[
|
|
5414
|
-
centerOffset:
|
|
5416
|
+
[h]: F,
|
|
5417
|
+
centerOffset: E - F - V,
|
|
5415
5418
|
...N && {
|
|
5416
5419
|
alignmentOffset: V
|
|
5417
5420
|
}
|
|
@@ -5435,34 +5438,34 @@ const Gy = (e) => ({
|
|
|
5435
5438
|
} = t, {
|
|
5436
5439
|
mainAxis: d = !0,
|
|
5437
5440
|
crossAxis: f = !0,
|
|
5438
|
-
fallbackPlacements:
|
|
5439
|
-
fallbackStrategy:
|
|
5441
|
+
fallbackPlacements: p,
|
|
5442
|
+
fallbackStrategy: h = "bestFit",
|
|
5440
5443
|
fallbackAxisSideDirection: m = "none",
|
|
5441
5444
|
flipAlignment: g = !0,
|
|
5442
5445
|
...y
|
|
5443
5446
|
} = An(e, t);
|
|
5444
5447
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
5445
5448
|
return {};
|
|
5446
|
-
const x = Nn(o), w = yn(a), b = Nn(a) === a, T = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), S =
|
|
5447
|
-
!
|
|
5448
|
-
const k = [a, ...S], R = await Gr(t, y),
|
|
5449
|
+
const x = Nn(o), w = yn(a), b = Nn(a) === a, T = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), S = p || (b || !g ? [Yo(a)] : zy(a)), C = m !== "none";
|
|
5450
|
+
!p && C && S.push(...Vy(a, g, m, T));
|
|
5451
|
+
const k = [a, ...S], R = await Gr(t, y), A = [];
|
|
5449
5452
|
let D = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
5450
|
-
if (d &&
|
|
5451
|
-
const
|
|
5452
|
-
|
|
5453
|
+
if (d && A.push(R[x]), f) {
|
|
5454
|
+
const E = By(o, i, T);
|
|
5455
|
+
A.push(R[E[0]], R[E[1]]);
|
|
5453
5456
|
}
|
|
5454
5457
|
if (D = [...D, {
|
|
5455
5458
|
placement: o,
|
|
5456
|
-
overflows:
|
|
5457
|
-
}], !
|
|
5459
|
+
overflows: A
|
|
5460
|
+
}], !A.every((E) => E <= 0)) {
|
|
5458
5461
|
var j, M;
|
|
5459
|
-
const
|
|
5462
|
+
const E = (((j = s.flip) == null ? void 0 : j.index) || 0) + 1, F = k[E];
|
|
5460
5463
|
if (F && (!(f === "alignment" ? w !== yn(F) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5461
5464
|
// overflows the main axis.
|
|
5462
5465
|
D.every((B) => yn(B.placement) === w ? B.overflows[0] > 0 : !0)))
|
|
5463
5466
|
return {
|
|
5464
5467
|
data: {
|
|
5465
|
-
index:
|
|
5468
|
+
index: E,
|
|
5466
5469
|
overflows: D
|
|
5467
5470
|
},
|
|
5468
5471
|
reset: {
|
|
@@ -5471,7 +5474,7 @@ const Gy = (e) => ({
|
|
|
5471
5474
|
};
|
|
5472
5475
|
let N = (M = D.filter((V) => V.overflows[0] <= 0).sort((V, B) => V.overflows[1] - B.overflows[1])[0]) == null ? void 0 : M.placement;
|
|
5473
5476
|
if (!N)
|
|
5474
|
-
switch (
|
|
5477
|
+
switch (h) {
|
|
5475
5478
|
case "bestFit": {
|
|
5476
5479
|
var $;
|
|
5477
5480
|
const V = ($ = D.filter((B) => {
|
|
@@ -5561,8 +5564,8 @@ async function Jy(e, t) {
|
|
|
5561
5564
|
elements: o
|
|
5562
5565
|
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = Nn(n), a = Er(n), l = yn(n) === "y", c = ju.has(i) ? -1 : 1, d = s && l ? -1 : 1, f = An(t, e);
|
|
5563
5566
|
let {
|
|
5564
|
-
mainAxis:
|
|
5565
|
-
crossAxis:
|
|
5567
|
+
mainAxis: p,
|
|
5568
|
+
crossAxis: h,
|
|
5566
5569
|
alignmentAxis: m
|
|
5567
5570
|
} = typeof f == "number" ? {
|
|
5568
5571
|
mainAxis: f,
|
|
@@ -5573,12 +5576,12 @@ async function Jy(e, t) {
|
|
|
5573
5576
|
crossAxis: f.crossAxis || 0,
|
|
5574
5577
|
alignmentAxis: f.alignmentAxis
|
|
5575
5578
|
};
|
|
5576
|
-
return a && typeof m == "number" && (
|
|
5577
|
-
x:
|
|
5578
|
-
y:
|
|
5579
|
+
return a && typeof m == "number" && (h = a === "end" ? m * -1 : m), l ? {
|
|
5580
|
+
x: h * d,
|
|
5581
|
+
y: p * c
|
|
5579
5582
|
} : {
|
|
5580
|
-
x:
|
|
5581
|
-
y:
|
|
5583
|
+
x: p * c,
|
|
5584
|
+
y: h * d
|
|
5582
5585
|
};
|
|
5583
5586
|
}
|
|
5584
5587
|
const Zy = function(e) {
|
|
@@ -5631,11 +5634,11 @@ const Zy = function(e) {
|
|
|
5631
5634
|
} = An(e, t), c = {
|
|
5632
5635
|
x: n,
|
|
5633
5636
|
y: r
|
|
5634
|
-
}, d = await Gr(t, l), f = yn(Nn(o)),
|
|
5635
|
-
let
|
|
5637
|
+
}, d = await Gr(t, l), f = yn(Nn(o)), p = fa(f);
|
|
5638
|
+
let h = c[p], m = c[f];
|
|
5636
5639
|
if (s) {
|
|
5637
|
-
const y =
|
|
5638
|
-
|
|
5640
|
+
const y = p === "y" ? "top" : "left", x = p === "y" ? "bottom" : "right", w = h + d[y], b = h - d[x];
|
|
5641
|
+
h = Mi(w, h, b);
|
|
5639
5642
|
}
|
|
5640
5643
|
if (i) {
|
|
5641
5644
|
const y = f === "y" ? "top" : "left", x = f === "y" ? "bottom" : "right", w = m + d[y], b = m - d[x];
|
|
@@ -5643,7 +5646,7 @@ const Zy = function(e) {
|
|
|
5643
5646
|
}
|
|
5644
5647
|
const g = a.fn({
|
|
5645
5648
|
...t,
|
|
5646
|
-
[
|
|
5649
|
+
[p]: h,
|
|
5647
5650
|
[f]: m
|
|
5648
5651
|
});
|
|
5649
5652
|
return {
|
|
@@ -5652,7 +5655,7 @@ const Zy = function(e) {
|
|
|
5652
5655
|
x: g.x - n,
|
|
5653
5656
|
y: g.y - r,
|
|
5654
5657
|
enabled: {
|
|
5655
|
-
[
|
|
5658
|
+
[p]: s,
|
|
5656
5659
|
[f]: i
|
|
5657
5660
|
}
|
|
5658
5661
|
}
|
|
@@ -5676,8 +5679,8 @@ const Zy = function(e) {
|
|
|
5676
5679
|
} = An(e, t), d = {
|
|
5677
5680
|
x: n,
|
|
5678
5681
|
y: r
|
|
5679
|
-
}, f = yn(o),
|
|
5680
|
-
let
|
|
5682
|
+
}, f = yn(o), p = fa(f);
|
|
5683
|
+
let h = d[p], m = d[f];
|
|
5681
5684
|
const g = An(a, t), y = typeof g == "number" ? {
|
|
5682
5685
|
mainAxis: g,
|
|
5683
5686
|
crossAxis: 0
|
|
@@ -5687,16 +5690,16 @@ const Zy = function(e) {
|
|
|
5687
5690
|
...g
|
|
5688
5691
|
};
|
|
5689
5692
|
if (l) {
|
|
5690
|
-
const b =
|
|
5691
|
-
|
|
5693
|
+
const b = p === "y" ? "height" : "width", T = s.reference[p] - s.floating[b] + y.mainAxis, S = s.reference[p] + s.reference[b] - y.mainAxis;
|
|
5694
|
+
h < T ? h = T : h > S && (h = S);
|
|
5692
5695
|
}
|
|
5693
5696
|
if (c) {
|
|
5694
5697
|
var x, w;
|
|
5695
|
-
const b =
|
|
5698
|
+
const b = p === "y" ? "width" : "height", T = ju.has(Nn(o)), S = s.reference[f] - s.floating[b] + (T && ((x = i.offset) == null ? void 0 : x[f]) || 0) + (T ? 0 : y.crossAxis), C = s.reference[f] + s.reference[b] + (T ? 0 : ((w = i.offset) == null ? void 0 : w[f]) || 0) - (T ? y.crossAxis : 0);
|
|
5696
5699
|
m < S ? m = S : m > C && (m = C);
|
|
5697
5700
|
}
|
|
5698
5701
|
return {
|
|
5699
|
-
[
|
|
5702
|
+
[p]: h,
|
|
5700
5703
|
[f]: m
|
|
5701
5704
|
};
|
|
5702
5705
|
}
|
|
@@ -5716,25 +5719,25 @@ const Zy = function(e) {
|
|
|
5716
5719
|
apply: l = () => {
|
|
5717
5720
|
},
|
|
5718
5721
|
...c
|
|
5719
|
-
} = An(e, t), d = await Gr(t, c), f = Nn(o),
|
|
5722
|
+
} = An(e, t), d = await Gr(t, c), f = Nn(o), p = Er(o), h = yn(o) === "y", {
|
|
5720
5723
|
width: m,
|
|
5721
5724
|
height: g
|
|
5722
5725
|
} = s.floating;
|
|
5723
5726
|
let y, x;
|
|
5724
|
-
f === "top" || f === "bottom" ? (y = f, x =
|
|
5727
|
+
f === "top" || f === "bottom" ? (y = f, x = p === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (x = f, y = p === "end" ? "top" : "bottom");
|
|
5725
5728
|
const w = g - d.top - d.bottom, b = m - d.left - d.right, T = Dn(g - d[y], w), S = Dn(m - d[x], b), C = !t.middlewareData.shift;
|
|
5726
5729
|
let k = T, R = S;
|
|
5727
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (R = b), (r = t.middlewareData.shift) != null && r.enabled.y && (k = w), C && !
|
|
5730
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (R = b), (r = t.middlewareData.shift) != null && r.enabled.y && (k = w), C && !p) {
|
|
5728
5731
|
const D = Kt(d.left, 0), j = Kt(d.right, 0), M = Kt(d.top, 0), $ = Kt(d.bottom, 0);
|
|
5729
|
-
|
|
5732
|
+
h ? R = m - 2 * (D !== 0 || j !== 0 ? D + j : Kt(d.left, d.right)) : k = g - 2 * (M !== 0 || $ !== 0 ? M + $ : Kt(d.top, d.bottom));
|
|
5730
5733
|
}
|
|
5731
5734
|
await l({
|
|
5732
5735
|
...t,
|
|
5733
5736
|
availableWidth: R,
|
|
5734
5737
|
availableHeight: k
|
|
5735
5738
|
});
|
|
5736
|
-
const
|
|
5737
|
-
return m !==
|
|
5739
|
+
const A = await i.getDimensions(a.floating);
|
|
5740
|
+
return m !== A.width || g !== A.height ? {
|
|
5738
5741
|
reset: {
|
|
5739
5742
|
rects: !0
|
|
5740
5743
|
}
|
|
@@ -5903,9 +5906,9 @@ function tr(e, t, n, r) {
|
|
|
5903
5906
|
const a = fv(s, n, r) ? Du(s) : wn(0);
|
|
5904
5907
|
let l = (o.left + a.x) / i.x, c = (o.top + a.y) / i.y, d = o.width / i.x, f = o.height / i.y;
|
|
5905
5908
|
if (s) {
|
|
5906
|
-
const
|
|
5907
|
-
let m =
|
|
5908
|
-
for (; g && r &&
|
|
5909
|
+
const p = Gt(s), h = r && un(r) ? Gt(r) : r;
|
|
5910
|
+
let m = p, g = Di(m);
|
|
5911
|
+
for (; g && r && h !== m; ) {
|
|
5909
5912
|
const y = xr(g), x = g.getBoundingClientRect(), w = dn(g), b = x.left + (g.clientLeft + parseFloat(w.paddingLeft)) * y.x, T = x.top + (g.clientTop + parseFloat(w.paddingTop)) * y.y;
|
|
5910
5913
|
l *= y.x, c *= y.y, d *= y.x, f *= y.y, l += b, c += T, m = Gt(g), g = Di(m);
|
|
5911
5914
|
}
|
|
@@ -5944,15 +5947,15 @@ function pv(e) {
|
|
|
5944
5947
|
}, c = wn(1);
|
|
5945
5948
|
const d = wn(0), f = bn(r);
|
|
5946
5949
|
if ((f || !f && !s) && ((Ar(r) !== "body" || uo(i)) && (l = Es(r)), bn(r))) {
|
|
5947
|
-
const
|
|
5948
|
-
c = xr(r), d.x =
|
|
5950
|
+
const h = tr(r);
|
|
5951
|
+
c = xr(r), d.x = h.x + r.clientLeft, d.y = h.y + r.clientTop;
|
|
5949
5952
|
}
|
|
5950
|
-
const
|
|
5953
|
+
const p = i && !f && !s ? Lu(i, l) : wn(0);
|
|
5951
5954
|
return {
|
|
5952
5955
|
width: n.width * c.x,
|
|
5953
5956
|
height: n.height * c.y,
|
|
5954
|
-
x: n.x * c.x - l.scrollLeft * c.x + d.x +
|
|
5955
|
-
y: n.y * c.y - l.scrollTop * c.y + d.y +
|
|
5957
|
+
x: n.x * c.x - l.scrollLeft * c.x + d.x + p.x,
|
|
5958
|
+
y: n.y * c.y - l.scrollTop * c.y + d.y + p.y
|
|
5956
5959
|
};
|
|
5957
5960
|
}
|
|
5958
5961
|
function hv(e) {
|
|
@@ -5980,7 +5983,7 @@ function gv(e, t) {
|
|
|
5980
5983
|
}
|
|
5981
5984
|
const c = As(r);
|
|
5982
5985
|
if (c <= 0) {
|
|
5983
|
-
const d = r.ownerDocument, f = d.body,
|
|
5986
|
+
const d = r.ownerDocument, f = d.body, p = getComputedStyle(f), h = d.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, m = Math.abs(r.clientWidth - f.clientWidth - h);
|
|
5984
5987
|
m <= Yl && (s -= m);
|
|
5985
5988
|
} else c <= Yl && (s += c);
|
|
5986
5989
|
return {
|
|
@@ -6076,14 +6079,14 @@ function Sv(e, t, n) {
|
|
|
6076
6079
|
}
|
|
6077
6080
|
if (r || !r && !s)
|
|
6078
6081
|
if ((Ar(t) !== "body" || uo(o)) && (a = Es(t)), r) {
|
|
6079
|
-
const
|
|
6080
|
-
l.x =
|
|
6082
|
+
const h = tr(t, !0, s, t);
|
|
6083
|
+
l.x = h.x + t.clientLeft, l.y = h.y + t.clientTop;
|
|
6081
6084
|
} else o && c();
|
|
6082
6085
|
s && !r && o && c();
|
|
6083
|
-
const d = o && !r && !s ? Lu(o, a) : wn(0), f = i.left + a.scrollLeft - l.x - d.x,
|
|
6086
|
+
const d = o && !r && !s ? Lu(o, a) : wn(0), f = i.left + a.scrollLeft - l.x - d.x, p = i.top + a.scrollTop - l.y - d.y;
|
|
6084
6087
|
return {
|
|
6085
6088
|
x: f,
|
|
6086
|
-
y:
|
|
6089
|
+
y: p,
|
|
6087
6090
|
width: i.width,
|
|
6088
6091
|
height: i.height
|
|
6089
6092
|
};
|
|
@@ -6159,12 +6162,12 @@ function Iv(e, t) {
|
|
|
6159
6162
|
const c = e.getBoundingClientRect(), {
|
|
6160
6163
|
left: d,
|
|
6161
6164
|
top: f,
|
|
6162
|
-
width:
|
|
6163
|
-
height:
|
|
6165
|
+
width: p,
|
|
6166
|
+
height: h
|
|
6164
6167
|
} = c;
|
|
6165
|
-
if (a || t(), !
|
|
6168
|
+
if (a || t(), !p || !h)
|
|
6166
6169
|
return;
|
|
6167
|
-
const m = bo(f), g = bo(o.clientWidth - (d +
|
|
6170
|
+
const m = bo(f), g = bo(o.clientWidth - (d + p)), y = bo(o.clientHeight - (f + h)), x = bo(d), b = {
|
|
6168
6171
|
rootMargin: -m + "px " + -g + "px " + -y + "px " + -x + "px",
|
|
6169
6172
|
threshold: Kt(0, Dn(1, l)) || 1
|
|
6170
6173
|
};
|
|
@@ -6208,14 +6211,14 @@ function Rv(e, t, n, r) {
|
|
|
6208
6211
|
}), s && x.addEventListener("resize", n);
|
|
6209
6212
|
});
|
|
6210
6213
|
const f = c && a ? Iv(c, n) : null;
|
|
6211
|
-
let
|
|
6212
|
-
i && (
|
|
6214
|
+
let p = -1, h = null;
|
|
6215
|
+
i && (h = new ResizeObserver((x) => {
|
|
6213
6216
|
let [w] = x;
|
|
6214
|
-
w && w.target === c &&
|
|
6217
|
+
w && w.target === c && h && (h.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
|
6215
6218
|
var b;
|
|
6216
|
-
(b =
|
|
6219
|
+
(b = h) == null || b.observe(t);
|
|
6217
6220
|
})), n();
|
|
6218
|
-
}), c && !l &&
|
|
6221
|
+
}), c && !l && h.observe(c), h.observe(t));
|
|
6219
6222
|
let m, g = l ? tr(e) : null;
|
|
6220
6223
|
l && y();
|
|
6221
6224
|
function y() {
|
|
@@ -6226,7 +6229,7 @@ function Rv(e, t, n, r) {
|
|
|
6226
6229
|
var x;
|
|
6227
6230
|
d.forEach((w) => {
|
|
6228
6231
|
o && w.removeEventListener("scroll", n), s && w.removeEventListener("resize", n);
|
|
6229
|
-
}), f == null || f(), (x =
|
|
6232
|
+
}), f == null || f(), (x = h) == null || x.disconnect(), h = null, l && cancelAnimationFrame(m);
|
|
6230
6233
|
};
|
|
6231
6234
|
}
|
|
6232
6235
|
const Ev = Zy, Av = Qy, Nv = Yy, _v = tv, jv = Xy, Zl = Gy, Pv = ev, Mv = (e, t, n) => {
|
|
@@ -6308,19 +6311,19 @@ function Lv(e) {
|
|
|
6308
6311
|
placement: t,
|
|
6309
6312
|
middlewareData: {},
|
|
6310
6313
|
isPositioned: !1
|
|
6311
|
-
}), [
|
|
6312
|
-
Jo(
|
|
6314
|
+
}), [p, h] = v.useState(r);
|
|
6315
|
+
Jo(p, r) || h(r);
|
|
6313
6316
|
const [m, g] = v.useState(null), [y, x] = v.useState(null), w = v.useCallback((B) => {
|
|
6314
6317
|
B !== C.current && (C.current = B, g(B));
|
|
6315
6318
|
}, []), b = v.useCallback((B) => {
|
|
6316
6319
|
B !== k.current && (k.current = B, x(B));
|
|
6317
|
-
}, []), T = s || m, S = i || y, C = v.useRef(null), k = v.useRef(null), R = v.useRef(d),
|
|
6320
|
+
}, []), T = s || m, S = i || y, C = v.useRef(null), k = v.useRef(null), R = v.useRef(d), A = l != null, D = ci(l), j = ci(o), M = ci(c), $ = v.useCallback(() => {
|
|
6318
6321
|
if (!C.current || !k.current)
|
|
6319
6322
|
return;
|
|
6320
6323
|
const B = {
|
|
6321
6324
|
placement: t,
|
|
6322
6325
|
strategy: n,
|
|
6323
|
-
middleware:
|
|
6326
|
+
middleware: p
|
|
6324
6327
|
};
|
|
6325
6328
|
j.current && (B.platform = j.current), Mv(C.current, k.current, B).then((_) => {
|
|
6326
6329
|
const q = {
|
|
@@ -6331,27 +6334,27 @@ function Lv(e) {
|
|
|
6331
6334
|
// setting it to `true` when `open === false` (must be specified).
|
|
6332
6335
|
isPositioned: M.current !== !1
|
|
6333
6336
|
};
|
|
6334
|
-
|
|
6337
|
+
E.current && !Jo(R.current, q) && (R.current = q, xs.flushSync(() => {
|
|
6335
6338
|
f(q);
|
|
6336
6339
|
}));
|
|
6337
6340
|
});
|
|
6338
|
-
}, [
|
|
6341
|
+
}, [p, t, n, j, M]);
|
|
6339
6342
|
Do(() => {
|
|
6340
6343
|
c === !1 && R.current.isPositioned && (R.current.isPositioned = !1, f((B) => ({
|
|
6341
6344
|
...B,
|
|
6342
6345
|
isPositioned: !1
|
|
6343
6346
|
})));
|
|
6344
6347
|
}, [c]);
|
|
6345
|
-
const
|
|
6346
|
-
Do(() => (
|
|
6347
|
-
|
|
6348
|
+
const E = v.useRef(!1);
|
|
6349
|
+
Do(() => (E.current = !0, () => {
|
|
6350
|
+
E.current = !1;
|
|
6348
6351
|
}), []), Do(() => {
|
|
6349
6352
|
if (T && (C.current = T), S && (k.current = S), T && S) {
|
|
6350
6353
|
if (D.current)
|
|
6351
6354
|
return D.current(T, S, $);
|
|
6352
6355
|
$();
|
|
6353
6356
|
}
|
|
6354
|
-
}, [T, S, $, D,
|
|
6357
|
+
}, [T, S, $, D, A]);
|
|
6355
6358
|
const F = v.useMemo(() => ({
|
|
6356
6359
|
reference: C,
|
|
6357
6360
|
floating: k,
|
|
@@ -6500,21 +6503,21 @@ var va = "PopperContent", [Yv, Xv] = Wu(va), Yu = v.forwardRef(
|
|
|
6500
6503
|
collisionBoundary: c = [],
|
|
6501
6504
|
collisionPadding: d = 0,
|
|
6502
6505
|
sticky: f = "partial",
|
|
6503
|
-
hideWhenDetached:
|
|
6504
|
-
updatePositionStrategy:
|
|
6506
|
+
hideWhenDetached: p = !1,
|
|
6507
|
+
updatePositionStrategy: h = "optimized",
|
|
6505
6508
|
onPlaced: m,
|
|
6506
6509
|
...g
|
|
6507
|
-
} = e, y = Vu(va, n), [x, w] = v.useState(null), b = We(t, (Ae) => w(Ae)), [T, S] = v.useState(null), C = Hu(T), k = (C == null ? void 0 : C.width) ?? 0, R = (C == null ? void 0 : C.height) ?? 0,
|
|
6510
|
+
} = e, y = Vu(va, n), [x, w] = v.useState(null), b = We(t, (Ae) => w(Ae)), [T, S] = v.useState(null), C = Hu(T), k = (C == null ? void 0 : C.width) ?? 0, R = (C == null ? void 0 : C.height) ?? 0, A = r + (s !== "center" ? "-" + s : ""), D = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, j = Array.isArray(c) ? c : [c], M = j.length > 0, $ = {
|
|
6508
6511
|
padding: D,
|
|
6509
6512
|
boundary: j.filter(Zv),
|
|
6510
6513
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
6511
6514
|
altBoundary: M
|
|
6512
|
-
}, { refs:
|
|
6515
|
+
}, { refs: E, floatingStyles: F, placement: N, isPositioned: V, middlewareData: B } = Lv({
|
|
6513
6516
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
6514
6517
|
strategy: "fixed",
|
|
6515
|
-
placement:
|
|
6518
|
+
placement: A,
|
|
6516
6519
|
whileElementsMounted: (...Ae) => Rv(...Ae, {
|
|
6517
|
-
animationFrame:
|
|
6520
|
+
animationFrame: h === "always"
|
|
6518
6521
|
}),
|
|
6519
6522
|
elements: {
|
|
6520
6523
|
reference: y.anchor
|
|
@@ -6537,7 +6540,7 @@ var va = "PopperContent", [Yv, Xv] = Wu(va), Yu = v.forwardRef(
|
|
|
6537
6540
|
}),
|
|
6538
6541
|
T && Vv({ element: T, padding: a }),
|
|
6539
6542
|
Qv({ arrowWidth: k, arrowHeight: R }),
|
|
6540
|
-
|
|
6543
|
+
p && Wv({ strategy: "referenceHidden", ...$ })
|
|
6541
6544
|
]
|
|
6542
6545
|
}), [_, q] = Zu(N), Y = Et(m);
|
|
6543
6546
|
At(() => {
|
|
@@ -6549,7 +6552,7 @@ var va = "PopperContent", [Yv, Xv] = Wu(va), Yu = v.forwardRef(
|
|
|
6549
6552
|
}, [x]), /* @__PURE__ */ u.jsx(
|
|
6550
6553
|
"div",
|
|
6551
6554
|
{
|
|
6552
|
-
ref:
|
|
6555
|
+
ref: E.setFloating,
|
|
6553
6556
|
"data-radix-popper-content-wrapper": "",
|
|
6554
6557
|
style: {
|
|
6555
6558
|
...F,
|
|
@@ -6660,9 +6663,9 @@ var Qv = (e) => ({
|
|
|
6660
6663
|
options: e,
|
|
6661
6664
|
fn(t) {
|
|
6662
6665
|
var y, x, w;
|
|
6663
|
-
const { placement: n, rects: r, middlewareData: o } = t, i = ((y = o.arrow) == null ? void 0 : y.centerOffset) !== 0, a = i ? 0 : e.arrowWidth, l = i ? 0 : e.arrowHeight, [c, d] = Zu(n), f = { start: "0%", center: "50%", end: "100%" }[d],
|
|
6666
|
+
const { placement: n, rects: r, middlewareData: o } = t, i = ((y = o.arrow) == null ? void 0 : y.centerOffset) !== 0, a = i ? 0 : e.arrowWidth, l = i ? 0 : e.arrowHeight, [c, d] = Zu(n), f = { start: "0%", center: "50%", end: "100%" }[d], p = (((x = o.arrow) == null ? void 0 : x.x) ?? 0) + a / 2, h = (((w = o.arrow) == null ? void 0 : w.y) ?? 0) + l / 2;
|
|
6664
6667
|
let m = "", g = "";
|
|
6665
|
-
return c === "bottom" ? (m = i ? f : `${
|
|
6668
|
+
return c === "bottom" ? (m = i ? f : `${p}px`, g = `${-l}px`) : c === "top" ? (m = i ? f : `${p}px`, g = `${r.floating.height + l}px`) : c === "right" ? (m = `${-l}px`, g = i ? f : `${h}px`) : c === "left" && (m = `${r.floating.width + l}px`, g = i ? f : `${h}px`), { data: { x: m, y: g } };
|
|
6666
6669
|
}
|
|
6667
6670
|
});
|
|
6668
6671
|
function Zu(e) {
|
|
@@ -6705,25 +6708,25 @@ function nw(e) {
|
|
|
6705
6708
|
}, [a]), At(() => {
|
|
6706
6709
|
const c = r.current, d = o.current;
|
|
6707
6710
|
if (d !== e) {
|
|
6708
|
-
const
|
|
6709
|
-
e ? l("MOUNT") :
|
|
6711
|
+
const p = s.current, h = So(c);
|
|
6712
|
+
e ? l("MOUNT") : h === "none" || (c == null ? void 0 : c.display) === "none" ? l("UNMOUNT") : l(d && p !== h ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
|
|
6710
6713
|
}
|
|
6711
6714
|
}, [e, l]), At(() => {
|
|
6712
6715
|
if (t) {
|
|
6713
6716
|
let c;
|
|
6714
|
-
const d = t.ownerDocument.defaultView ?? window, f = (
|
|
6715
|
-
const g = So(r.current).includes(CSS.escape(
|
|
6716
|
-
if (
|
|
6717
|
+
const d = t.ownerDocument.defaultView ?? window, f = (h) => {
|
|
6718
|
+
const g = So(r.current).includes(CSS.escape(h.animationName));
|
|
6719
|
+
if (h.target === t && g && (l("ANIMATION_END"), !o.current)) {
|
|
6717
6720
|
const y = t.style.animationFillMode;
|
|
6718
6721
|
t.style.animationFillMode = "forwards", c = d.setTimeout(() => {
|
|
6719
6722
|
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = y);
|
|
6720
6723
|
});
|
|
6721
6724
|
}
|
|
6722
|
-
},
|
|
6723
|
-
|
|
6725
|
+
}, p = (h) => {
|
|
6726
|
+
h.target === t && (s.current = So(r.current));
|
|
6724
6727
|
};
|
|
6725
|
-
return t.addEventListener("animationstart",
|
|
6726
|
-
d.clearTimeout(c), t.removeEventListener("animationstart",
|
|
6728
|
+
return t.addEventListener("animationstart", p), t.addEventListener("animationcancel", f), t.addEventListener("animationend", f), () => {
|
|
6729
|
+
d.clearTimeout(c), t.removeEventListener("animationstart", p), t.removeEventListener("animationcancel", f), t.removeEventListener("animationend", f);
|
|
6727
6730
|
};
|
|
6728
6731
|
} else
|
|
6729
6732
|
l("ANIMATION_END");
|
|
@@ -6761,14 +6764,14 @@ var cw = v.forwardRef((e, t) => {
|
|
|
6761
6764
|
onEntryFocus: c,
|
|
6762
6765
|
preventScrollOnEntryFocus: d = !1,
|
|
6763
6766
|
...f
|
|
6764
|
-
} = e,
|
|
6767
|
+
} = e, p = v.useRef(null), h = We(t, p), m = Cs(s), [g, y] = Cr({
|
|
6765
6768
|
prop: i,
|
|
6766
6769
|
defaultProp: a ?? null,
|
|
6767
6770
|
onChange: l,
|
|
6768
6771
|
caller: fo
|
|
6769
6772
|
}), [x, w] = v.useState(!1), b = Et(c), T = rd(n), S = v.useRef(!1), [C, k] = v.useState(0);
|
|
6770
6773
|
return v.useEffect(() => {
|
|
6771
|
-
const R =
|
|
6774
|
+
const R = p.current;
|
|
6772
6775
|
if (R)
|
|
6773
6776
|
return R.addEventListener(ui, b), () => R.removeEventListener(ui, b);
|
|
6774
6777
|
}, [b]), /* @__PURE__ */ u.jsx(
|
|
@@ -6798,14 +6801,14 @@ var cw = v.forwardRef((e, t) => {
|
|
|
6798
6801
|
tabIndex: x || C === 0 ? -1 : 0,
|
|
6799
6802
|
"data-orientation": r,
|
|
6800
6803
|
...f,
|
|
6801
|
-
ref:
|
|
6804
|
+
ref: h,
|
|
6802
6805
|
style: { outline: "none", ...e.style },
|
|
6803
6806
|
onMouseDown: de(e.onMouseDown, () => {
|
|
6804
6807
|
S.current = !0;
|
|
6805
6808
|
}),
|
|
6806
6809
|
onFocus: de(e.onFocus, (R) => {
|
|
6807
|
-
const
|
|
6808
|
-
if (R.target === R.currentTarget &&
|
|
6810
|
+
const A = !S.current;
|
|
6811
|
+
if (R.target === R.currentTarget && A && !x) {
|
|
6809
6812
|
const D = new CustomEvent(ui, ow);
|
|
6810
6813
|
if (R.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
|
|
6811
6814
|
const j = T().filter((N) => N.focusable), M = j.find((N) => N.active), $ = j.find((N) => N.id === g), F = [M, $, ...j].filter(
|
|
@@ -6830,11 +6833,11 @@ var cw = v.forwardRef((e, t) => {
|
|
|
6830
6833
|
tabStopId: s,
|
|
6831
6834
|
children: i,
|
|
6832
6835
|
...a
|
|
6833
|
-
} = e, l = Rn(), c = s || l, d = lw(id, n), f = d.currentTabStopId === c,
|
|
6836
|
+
} = e, l = Rn(), c = s || l, d = lw(id, n), f = d.currentTabStopId === c, p = rd(n), { onFocusableItemAdd: h, onFocusableItemRemove: m, currentTabStopId: g } = d;
|
|
6834
6837
|
return v.useEffect(() => {
|
|
6835
6838
|
if (r)
|
|
6836
|
-
return
|
|
6837
|
-
}, [r,
|
|
6839
|
+
return h(), () => m();
|
|
6840
|
+
}, [r, h, m]), /* @__PURE__ */ u.jsx(
|
|
6838
6841
|
Li.ItemSlot,
|
|
6839
6842
|
{
|
|
6840
6843
|
scope: n,
|
|
@@ -6862,7 +6865,7 @@ var cw = v.forwardRef((e, t) => {
|
|
|
6862
6865
|
if (x !== void 0) {
|
|
6863
6866
|
if (y.metaKey || y.ctrlKey || y.altKey || y.shiftKey) return;
|
|
6864
6867
|
y.preventDefault();
|
|
6865
|
-
let b =
|
|
6868
|
+
let b = p().filter((T) => T.focusable).map((T) => T.ref.current);
|
|
6866
6869
|
if (x === "last") b.reverse();
|
|
6867
6870
|
else if (x === "prev" || x === "next") {
|
|
6868
6871
|
x === "prev" && b.reverse();
|
|
@@ -6930,22 +6933,22 @@ var hw = sd, mw = ad, gw = function(e) {
|
|
|
6930
6933
|
};
|
|
6931
6934
|
o.forEach(c);
|
|
6932
6935
|
var d = function(f) {
|
|
6933
|
-
!f || l.has(f) || Array.prototype.forEach.call(f.children, function(
|
|
6934
|
-
if (a.has(
|
|
6935
|
-
d(
|
|
6936
|
+
!f || l.has(f) || Array.prototype.forEach.call(f.children, function(p) {
|
|
6937
|
+
if (a.has(p))
|
|
6938
|
+
d(p);
|
|
6936
6939
|
else
|
|
6937
6940
|
try {
|
|
6938
|
-
var
|
|
6939
|
-
fr.set(
|
|
6941
|
+
var h = p.getAttribute(r), m = h !== null && h !== "false", g = (fr.get(p) || 0) + 1, y = (s.get(p) || 0) + 1;
|
|
6942
|
+
fr.set(p, g), s.set(p, y), i.push(p), g === 1 && m && Co.set(p, !0), y === 1 && p.setAttribute(n, "true"), m || p.setAttribute(r, "true");
|
|
6940
6943
|
} catch (x) {
|
|
6941
|
-
console.error("aria-hidden: cannot operate on ",
|
|
6944
|
+
console.error("aria-hidden: cannot operate on ", p, x);
|
|
6942
6945
|
}
|
|
6943
6946
|
});
|
|
6944
6947
|
};
|
|
6945
6948
|
return d(t), a.clear(), di++, function() {
|
|
6946
6949
|
i.forEach(function(f) {
|
|
6947
|
-
var
|
|
6948
|
-
fr.set(f,
|
|
6950
|
+
var p = fr.get(f) - 1, h = s.get(f) - 1;
|
|
6951
|
+
fr.set(f, p), s.set(f, h), p || (Co.has(f) || f.removeAttribute(r), Co.delete(f)), h || f.removeAttribute(n);
|
|
6949
6952
|
}), di--, di || (fr = /* @__PURE__ */ new WeakMap(), fr = /* @__PURE__ */ new WeakMap(), Co = /* @__PURE__ */ new WeakMap(), To = {});
|
|
6950
6953
|
};
|
|
6951
6954
|
}, wa = function(e, t, n) {
|
|
@@ -7103,11 +7106,11 @@ var fd = Rw(), pi = function() {
|
|
|
7103
7106
|
onScrollCapture: pi,
|
|
7104
7107
|
onWheelCapture: pi,
|
|
7105
7108
|
onTouchMoveCapture: pi
|
|
7106
|
-
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, c = e.removeScrollBar, d = e.enabled, f = e.shards,
|
|
7109
|
+
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, c = e.removeScrollBar, d = e.enabled, f = e.shards, p = e.sideCar, h = e.noRelative, m = e.noIsolation, g = e.inert, y = e.allowPinchZoom, x = e.as, w = x === void 0 ? "div" : x, b = e.gapMode, T = ud(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = p, C = Tw([n, t]), k = xn(xn({}, T), o);
|
|
7107
7110
|
return v.createElement(
|
|
7108
7111
|
v.Fragment,
|
|
7109
7112
|
null,
|
|
7110
|
-
d && v.createElement(S, { sideCar: fd, removeScrollBar: c, shards: f, noRelative:
|
|
7113
|
+
d && v.createElement(S, { sideCar: fd, removeScrollBar: c, shards: f, noRelative: h, noIsolation: m, inert: g, setCallbacks: s, allowPinchZoom: !!y, lockRef: n, gapMode: b }),
|
|
7111
7114
|
i ? v.cloneElement(v.Children.only(a), xn(xn({}, k), { ref: C })) : v.createElement(w, xn({}, k, { className: l, ref: C }), a)
|
|
7112
7115
|
);
|
|
7113
7116
|
});
|
|
@@ -7306,12 +7309,12 @@ var pr = $i ? { passive: !1 } : !1, Uw = function(e) {
|
|
|
7306
7309
|
}, qw = function(e, t) {
|
|
7307
7310
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
7308
7311
|
}, Gw = function(e, t, n, r, o) {
|
|
7309
|
-
var s = qw(e, window.getComputedStyle(t).direction), i = s * r, a = n.target, l = t.contains(a), c = !1, d = i > 0, f = 0,
|
|
7312
|
+
var s = qw(e, window.getComputedStyle(t).direction), i = s * r, a = n.target, l = t.contains(a), c = !1, d = i > 0, f = 0, p = 0;
|
|
7310
7313
|
do {
|
|
7311
7314
|
if (!a)
|
|
7312
7315
|
break;
|
|
7313
|
-
var
|
|
7314
|
-
(m || x) && md(e, a) && (f += x,
|
|
7316
|
+
var h = gd(e, a), m = h[0], g = h[1], y = h[2], x = g - y - s * m;
|
|
7317
|
+
(m || x) && md(e, a) && (f += x, p += m);
|
|
7315
7318
|
var w = a.parentNode;
|
|
7316
7319
|
a = w && w.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? w.host : w;
|
|
7317
7320
|
} while (
|
|
@@ -7319,7 +7322,7 @@ var pr = $i ? { passive: !1 } : !1, Uw = function(e) {
|
|
|
7319
7322
|
!l && a !== document.body || // self content
|
|
7320
7323
|
l && (t.contains(a) || t === a)
|
|
7321
7324
|
);
|
|
7322
|
-
return (d && Math.abs(f) < 1 || !d && Math.abs(
|
|
7325
|
+
return (d && Math.abs(f) < 1 || !d && Math.abs(p) < 1) && (c = !0), c;
|
|
7323
7326
|
}, Io = function(e) {
|
|
7324
7327
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
7325
7328
|
}, rc = function(e) {
|
|
@@ -7364,8 +7367,8 @@ function Zw(e) {
|
|
|
7364
7367
|
return !1;
|
|
7365
7368
|
if (!r.current && "changedTouches" in g && (b || T) && (r.current = S), !S)
|
|
7366
7369
|
return !0;
|
|
7367
|
-
var
|
|
7368
|
-
return Gw(
|
|
7370
|
+
var A = r.current || S;
|
|
7371
|
+
return Gw(A, y, g, A === "h" ? b : T);
|
|
7369
7372
|
}, []), l = v.useCallback(function(g) {
|
|
7370
7373
|
var y = g;
|
|
7371
7374
|
if (!(!hr.length || hr[hr.length - 1] !== s)) {
|
|
@@ -7394,26 +7397,26 @@ function Zw(e) {
|
|
|
7394
7397
|
n.current = Io(g), r.current = void 0;
|
|
7395
7398
|
}, []), f = v.useCallback(function(g) {
|
|
7396
7399
|
c(g.type, rc(g), g.target, a(g, e.lockRef.current));
|
|
7397
|
-
}, []),
|
|
7400
|
+
}, []), p = v.useCallback(function(g) {
|
|
7398
7401
|
c(g.type, Io(g), g.target, a(g, e.lockRef.current));
|
|
7399
7402
|
}, []);
|
|
7400
7403
|
v.useEffect(function() {
|
|
7401
7404
|
return hr.push(s), e.setCallbacks({
|
|
7402
7405
|
onScrollCapture: f,
|
|
7403
7406
|
onWheelCapture: f,
|
|
7404
|
-
onTouchMoveCapture:
|
|
7407
|
+
onTouchMoveCapture: p
|
|
7405
7408
|
}), document.addEventListener("wheel", l, pr), document.addEventListener("touchmove", l, pr), document.addEventListener("touchstart", d, pr), function() {
|
|
7406
7409
|
hr = hr.filter(function(g) {
|
|
7407
7410
|
return g !== s;
|
|
7408
7411
|
}), document.removeEventListener("wheel", l, pr), document.removeEventListener("touchmove", l, pr), document.removeEventListener("touchstart", d, pr);
|
|
7409
7412
|
};
|
|
7410
7413
|
}, []);
|
|
7411
|
-
var
|
|
7414
|
+
var h = e.removeScrollBar, m = e.inert;
|
|
7412
7415
|
return v.createElement(
|
|
7413
7416
|
v.Fragment,
|
|
7414
7417
|
null,
|
|
7415
7418
|
m ? v.createElement(s, { styles: Xw(o) }) : null,
|
|
7416
|
-
|
|
7419
|
+
h ? v.createElement(zw, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
7417
7420
|
);
|
|
7418
7421
|
}
|
|
7419
7422
|
function Qw(e) {
|
|
@@ -7437,13 +7440,13 @@ var Fi = ["Enter", " "], tb = ["ArrowDown", "PageUp", "Home"], xd = ["ArrowUp",
|
|
|
7437
7440
|
Ns,
|
|
7438
7441
|
od
|
|
7439
7442
|
]), Ms = Ns(), vd = od(), [ab, ar] = ir(po), [lb, ho] = ir(po), wd = (e) => {
|
|
7440
|
-
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = Ms(t), [l, c] = v.useState(null), d = v.useRef(!1), f = Et(s),
|
|
7443
|
+
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = Ms(t), [l, c] = v.useState(null), d = v.useRef(!1), f = Et(s), p = Cs(o);
|
|
7441
7444
|
return v.useEffect(() => {
|
|
7442
|
-
const
|
|
7445
|
+
const h = () => {
|
|
7443
7446
|
d.current = !0, document.addEventListener("pointerdown", m, { capture: !0, once: !0 }), document.addEventListener("pointermove", m, { capture: !0, once: !0 });
|
|
7444
7447
|
}, m = () => d.current = !1;
|
|
7445
|
-
return document.addEventListener("keydown",
|
|
7446
|
-
document.removeEventListener("keydown",
|
|
7448
|
+
return document.addEventListener("keydown", h, { capture: !0 }), () => {
|
|
7449
|
+
document.removeEventListener("keydown", h, { capture: !0 }), document.removeEventListener("pointerdown", m, { capture: !0 }), document.removeEventListener("pointermove", m, { capture: !0 });
|
|
7447
7450
|
};
|
|
7448
7451
|
}, []), /* @__PURE__ */ u.jsx(Qu, { ...a, children: /* @__PURE__ */ u.jsx(
|
|
7449
7452
|
ab,
|
|
@@ -7459,7 +7462,7 @@ var Fi = ["Enter", " "], tb = ["ArrowDown", "PageUp", "Home"], xd = ["ArrowUp",
|
|
|
7459
7462
|
scope: t,
|
|
7460
7463
|
onClose: v.useCallback(() => f(!1), [f]),
|
|
7461
7464
|
isUsingKeyboardRef: d,
|
|
7462
|
-
dir:
|
|
7465
|
+
dir: p,
|
|
7463
7466
|
modal: i,
|
|
7464
7467
|
children: r
|
|
7465
7468
|
}
|
|
@@ -7536,18 +7539,18 @@ var tn = "MenuContent", [db, Ca] = ir(tn), Cd = v.forwardRef(
|
|
|
7536
7539
|
onEscapeKeyDown: c,
|
|
7537
7540
|
onPointerDownOutside: d,
|
|
7538
7541
|
onFocusOutside: f,
|
|
7539
|
-
onInteractOutside:
|
|
7540
|
-
onDismiss:
|
|
7542
|
+
onInteractOutside: p,
|
|
7543
|
+
onDismiss: h,
|
|
7541
7544
|
disableOutsideScroll: m,
|
|
7542
7545
|
...g
|
|
7543
|
-
} = e, y = ar(tn, n), x = ho(tn, n), w = Ms(n), b = vd(n), T = sb(n), [S, C] = v.useState(null), k = v.useRef(null), R = We(t, k, y.onContentChange),
|
|
7546
|
+
} = e, y = ar(tn, n), x = ho(tn, n), w = Ms(n), b = vd(n), T = sb(n), [S, C] = v.useState(null), k = v.useRef(null), R = We(t, k, y.onContentChange), A = v.useRef(0), D = v.useRef(""), j = v.useRef(0), M = v.useRef(null), $ = v.useRef("right"), E = v.useRef(0), F = m ? Ps : v.Fragment, N = m ? { as: hb, allowPinchZoom: !0 } : void 0, V = (_) => {
|
|
7544
7547
|
var X, L;
|
|
7545
7548
|
const q = D.current + _, Y = T().filter((K) => !K.disabled), se = document.activeElement, we = (X = Y.find((K) => K.ref.current === se)) == null ? void 0 : X.textValue, Ie = Y.map((K) => K.textValue), G = Ib(Ie, q, we), z = (L = Y.find((K) => K.textValue === G)) == null ? void 0 : L.ref.current;
|
|
7546
7549
|
(function K(J) {
|
|
7547
|
-
D.current = J, window.clearTimeout(
|
|
7550
|
+
D.current = J, window.clearTimeout(A.current), J !== "" && (A.current = window.setTimeout(() => K(""), 1e3));
|
|
7548
7551
|
})(q), z && setTimeout(() => z.focus());
|
|
7549
7552
|
};
|
|
7550
|
-
v.useEffect(() => () => window.clearTimeout(
|
|
7553
|
+
v.useEffect(() => () => window.clearTimeout(A.current), []), da();
|
|
7551
7554
|
const B = v.useCallback((_) => {
|
|
7552
7555
|
var Y, se;
|
|
7553
7556
|
return $.current === ((Y = M.current) == null ? void 0 : Y.side) && Eb(_, (se = M.current) == null ? void 0 : se.area);
|
|
@@ -7598,8 +7601,8 @@ var tn = "MenuContent", [db, Ca] = ir(tn), Cd = v.forwardRef(
|
|
|
7598
7601
|
onEscapeKeyDown: c,
|
|
7599
7602
|
onPointerDownOutside: d,
|
|
7600
7603
|
onFocusOutside: f,
|
|
7601
|
-
onInteractOutside:
|
|
7602
|
-
onDismiss:
|
|
7604
|
+
onInteractOutside: p,
|
|
7605
|
+
onDismiss: h,
|
|
7603
7606
|
children: /* @__PURE__ */ u.jsx(
|
|
7604
7607
|
hw,
|
|
7605
7608
|
{
|
|
@@ -7636,15 +7639,15 @@ var tn = "MenuContent", [db, Ca] = ir(tn), Cd = v.forwardRef(
|
|
|
7636
7639
|
xd.includes(_.key) && z.reverse(), Tb(z);
|
|
7637
7640
|
}),
|
|
7638
7641
|
onBlur: de(e.onBlur, (_) => {
|
|
7639
|
-
_.currentTarget.contains(_.target) || (window.clearTimeout(
|
|
7642
|
+
_.currentTarget.contains(_.target) || (window.clearTimeout(A.current), D.current = "");
|
|
7640
7643
|
}),
|
|
7641
7644
|
onPointerMove: de(
|
|
7642
7645
|
e.onPointerMove,
|
|
7643
7646
|
Jr((_) => {
|
|
7644
|
-
const q = _.target, Y =
|
|
7647
|
+
const q = _.target, Y = E.current !== _.clientX;
|
|
7645
7648
|
if (_.currentTarget.contains(q) && Y) {
|
|
7646
|
-
const se = _.clientX >
|
|
7647
|
-
$.current = se,
|
|
7649
|
+
const se = _.clientX > E.current ? "right" : "left";
|
|
7650
|
+
$.current = se, E.current = _.clientX;
|
|
7648
7651
|
}
|
|
7649
7652
|
})
|
|
7650
7653
|
)
|
|
@@ -7680,8 +7683,8 @@ var Zo = "MenuItem", sc = "menu.itemSelect", Os = v.forwardRef(
|
|
|
7680
7683
|
const { disabled: n = !1, onSelect: r, ...o } = e, s = v.useRef(null), i = ho(Zo, e.__scopeMenu), a = Ca(Zo, e.__scopeMenu), l = We(t, s), c = v.useRef(!1), d = () => {
|
|
7681
7684
|
const f = s.current;
|
|
7682
7685
|
if (!n && f) {
|
|
7683
|
-
const
|
|
7684
|
-
f.addEventListener(sc, (
|
|
7686
|
+
const p = new CustomEvent(sc, { bubbles: !0, cancelable: !0 });
|
|
7687
|
+
f.addEventListener(sc, (h) => r == null ? void 0 : r(h), { once: !0 }), Ru(f, p), p.defaultPrevented ? c.current = !1 : i.onClose();
|
|
7685
7688
|
}
|
|
7686
7689
|
};
|
|
7687
7690
|
return /* @__PURE__ */ u.jsx(
|
|
@@ -7692,16 +7695,16 @@ var Zo = "MenuItem", sc = "menu.itemSelect", Os = v.forwardRef(
|
|
|
7692
7695
|
disabled: n,
|
|
7693
7696
|
onClick: de(e.onClick, d),
|
|
7694
7697
|
onPointerDown: (f) => {
|
|
7695
|
-
var
|
|
7696
|
-
(
|
|
7698
|
+
var p;
|
|
7699
|
+
(p = e.onPointerDown) == null || p.call(e, f), c.current = !0;
|
|
7697
7700
|
},
|
|
7698
7701
|
onPointerUp: de(e.onPointerUp, (f) => {
|
|
7699
|
-
var
|
|
7700
|
-
c.current || (
|
|
7702
|
+
var p;
|
|
7703
|
+
c.current || (p = f.currentTarget) == null || p.click();
|
|
7701
7704
|
}),
|
|
7702
7705
|
onKeyDown: de(e.onKeyDown, (f) => {
|
|
7703
|
-
const
|
|
7704
|
-
n ||
|
|
7706
|
+
const p = a.searchRef.current !== "";
|
|
7707
|
+
n || p && f.key === " " || Fi.includes(f.key) && (f.currentTarget.click(), f.preventDefault());
|
|
7705
7708
|
})
|
|
7706
7709
|
}
|
|
7707
7710
|
);
|
|
@@ -7710,16 +7713,16 @@ var Zo = "MenuItem", sc = "menu.itemSelect", Os = v.forwardRef(
|
|
|
7710
7713
|
Os.displayName = Zo;
|
|
7711
7714
|
var kd = v.forwardRef(
|
|
7712
7715
|
(e, t) => {
|
|
7713
|
-
const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Ca(Zo, n), a = vd(n), l = v.useRef(null), c = We(t, l), [d, f] = v.useState(!1), [
|
|
7716
|
+
const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Ca(Zo, n), a = vd(n), l = v.useRef(null), c = We(t, l), [d, f] = v.useState(!1), [p, h] = v.useState("");
|
|
7714
7717
|
return v.useEffect(() => {
|
|
7715
7718
|
const m = l.current;
|
|
7716
|
-
m &&
|
|
7719
|
+
m && h((m.textContent ?? "").trim());
|
|
7717
7720
|
}, [s.children]), /* @__PURE__ */ u.jsx(
|
|
7718
7721
|
Xr.ItemSlot,
|
|
7719
7722
|
{
|
|
7720
7723
|
scope: n,
|
|
7721
7724
|
disabled: r,
|
|
7722
|
-
textValue: o ??
|
|
7725
|
+
textValue: o ?? p,
|
|
7723
7726
|
children: /* @__PURE__ */ u.jsx(mw, { asChild: !0, ...a, focusable: !r, children: /* @__PURE__ */ u.jsx(
|
|
7724
7727
|
_e.div,
|
|
7725
7728
|
{
|
|
@@ -7868,8 +7871,8 @@ var Cb = "MenuSub", [Vk, Od] = ir(Cb), $r = "MenuSubTrigger", Dd = v.forwardRef(
|
|
|
7868
7871
|
...e,
|
|
7869
7872
|
ref: ca(t, o.onTriggerChange),
|
|
7870
7873
|
onClick: (f) => {
|
|
7871
|
-
var
|
|
7872
|
-
(
|
|
7874
|
+
var p;
|
|
7875
|
+
(p = e.onClick) == null || p.call(e, f), !(e.disabled || f.defaultPrevented) && (f.currentTarget.focus(), n.open || n.onOpenChange(!0));
|
|
7873
7876
|
},
|
|
7874
7877
|
onPointerMove: de(
|
|
7875
7878
|
e.onPointerMove,
|
|
@@ -7882,20 +7885,20 @@ var Cb = "MenuSub", [Vk, Od] = ir(Cb), $r = "MenuSubTrigger", Dd = v.forwardRef(
|
|
|
7882
7885
|
onPointerLeave: de(
|
|
7883
7886
|
e.onPointerLeave,
|
|
7884
7887
|
Jr((f) => {
|
|
7885
|
-
var
|
|
7888
|
+
var h, m;
|
|
7886
7889
|
d();
|
|
7887
|
-
const
|
|
7888
|
-
if (
|
|
7889
|
-
const g = (m = n.content) == null ? void 0 : m.dataset.side, y = g === "right", x = y ? -5 : 5, w =
|
|
7890
|
+
const p = (h = n.content) == null ? void 0 : h.getBoundingClientRect();
|
|
7891
|
+
if (p) {
|
|
7892
|
+
const g = (m = n.content) == null ? void 0 : m.dataset.side, y = g === "right", x = y ? -5 : 5, w = p[y ? "left" : "right"], b = p[y ? "right" : "left"];
|
|
7890
7893
|
s.onPointerGraceIntentChange({
|
|
7891
7894
|
area: [
|
|
7892
7895
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
7893
7896
|
// consistently within polygon bounds
|
|
7894
7897
|
{ x: f.clientX + x, y: f.clientY },
|
|
7895
|
-
{ x: w, y:
|
|
7896
|
-
{ x: b, y:
|
|
7897
|
-
{ x: b, y:
|
|
7898
|
-
{ x: w, y:
|
|
7898
|
+
{ x: w, y: p.top },
|
|
7899
|
+
{ x: b, y: p.top },
|
|
7900
|
+
{ x: b, y: p.bottom },
|
|
7901
|
+
{ x: w, y: p.bottom }
|
|
7899
7902
|
],
|
|
7900
7903
|
side: g
|
|
7901
7904
|
}), window.clearTimeout(a.current), a.current = window.setTimeout(
|
|
@@ -7909,9 +7912,9 @@ var Cb = "MenuSub", [Vk, Od] = ir(Cb), $r = "MenuSubTrigger", Dd = v.forwardRef(
|
|
|
7909
7912
|
})
|
|
7910
7913
|
),
|
|
7911
7914
|
onKeyDown: de(e.onKeyDown, (f) => {
|
|
7912
|
-
var
|
|
7913
|
-
const
|
|
7914
|
-
e.disabled ||
|
|
7915
|
+
var h;
|
|
7916
|
+
const p = s.searchRef.current !== "";
|
|
7917
|
+
e.disabled || p && f.key === " " || rb[r.dir].includes(f.key) && (n.onOpenChange(!0), (h = n.content) == null || h.focus(), f.preventDefault());
|
|
7915
7918
|
})
|
|
7916
7919
|
}
|
|
7917
7920
|
) });
|
|
@@ -7945,9 +7948,9 @@ var Ld = "MenuSubContent", $d = v.forwardRef(
|
|
|
7945
7948
|
i.onClose(), d.preventDefault();
|
|
7946
7949
|
}),
|
|
7947
7950
|
onKeyDown: de(e.onKeyDown, (d) => {
|
|
7948
|
-
var
|
|
7949
|
-
const f = d.currentTarget.contains(d.target),
|
|
7950
|
-
f &&
|
|
7951
|
+
var h;
|
|
7952
|
+
const f = d.currentTarget.contains(d.target), p = ob[i.dir].includes(d.key);
|
|
7953
|
+
f && p && (s.onOpenChange(!1), (h = a.trigger) == null || h.focus(), d.preventDefault());
|
|
7951
7954
|
})
|
|
7952
7955
|
}
|
|
7953
7956
|
) }) }) });
|
|
@@ -7984,8 +7987,8 @@ function Rb(e, t) {
|
|
|
7984
7987
|
const { x: n, y: r } = e;
|
|
7985
7988
|
let o = !1;
|
|
7986
7989
|
for (let s = 0, i = t.length - 1; s < t.length; i = s++) {
|
|
7987
|
-
const a = t[s], l = t[i], c = a.x, d = a.y, f = l.x,
|
|
7988
|
-
d > r !=
|
|
7990
|
+
const a = t[s], l = t[i], c = a.x, d = a.y, f = l.x, p = l.y;
|
|
7991
|
+
d > r != p > r && n < (f - c) * (r - d) / (p - d) + c && (o = !o);
|
|
7989
7992
|
}
|
|
7990
7993
|
return o;
|
|
7991
7994
|
}
|
|
@@ -8024,7 +8027,7 @@ var Ab = wd, Nb = ba, _b = Sd, jb = Cd, Pb = ka, Mb = Td, Ob = Os, Db = Id, Lb =
|
|
|
8024
8027
|
contentId: Rn(),
|
|
8025
8028
|
open: d,
|
|
8026
8029
|
onOpenChange: f,
|
|
8027
|
-
onOpenToggle: v.useCallback(() => f((
|
|
8030
|
+
onOpenToggle: v.useCallback(() => f((p) => !p), [f]),
|
|
8028
8031
|
modal: a,
|
|
8029
8032
|
children: /* @__PURE__ */ u.jsx(Ab, { ...l, open: d, onOpenChange: f, dir: r, modal: a, children: n })
|
|
8030
8033
|
}
|
|
@@ -8412,32 +8415,32 @@ function T0(e) {
|
|
|
8412
8415
|
() => {
|
|
8413
8416
|
const i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
8414
8417
|
for (const f of t) {
|
|
8415
|
-
const
|
|
8416
|
-
if (!
|
|
8417
|
-
const
|
|
8418
|
-
id:
|
|
8419
|
-
step:
|
|
8418
|
+
const p = f.checkpointId ?? null;
|
|
8419
|
+
if (!p) continue;
|
|
8420
|
+
const h = Fo(f.metadata, "step"), m = b0(f.metadata, "source"), g = {
|
|
8421
|
+
id: p,
|
|
8422
|
+
step: h,
|
|
8420
8423
|
source: m,
|
|
8421
8424
|
createdAt: f.createdAt ?? null,
|
|
8422
8425
|
namespace: f.checkpointNs ?? null,
|
|
8423
8426
|
parentId: f.parentId ?? null
|
|
8424
8427
|
};
|
|
8425
|
-
if (i.set(
|
|
8426
|
-
const y = `${
|
|
8428
|
+
if (i.set(p, g), h !== null && m) {
|
|
8429
|
+
const y = `${h}:${m}`, x = a.get(y) ?? [];
|
|
8427
8430
|
x.push(g), a.set(y, x);
|
|
8428
8431
|
}
|
|
8429
8432
|
}
|
|
8430
8433
|
const c = v0(t);
|
|
8431
|
-
for (const [f,
|
|
8432
|
-
const
|
|
8433
|
-
|
|
8434
|
-
...
|
|
8435
|
-
attemptIndex:
|
|
8436
|
-
attemptCount:
|
|
8437
|
-
isLatestAttempt:
|
|
8438
|
-
baseUserMessageId:
|
|
8434
|
+
for (const [f, p] of i.entries()) {
|
|
8435
|
+
const h = c.get(f);
|
|
8436
|
+
h ? l.set(f, {
|
|
8437
|
+
...p,
|
|
8438
|
+
attemptIndex: h.attemptIndex,
|
|
8439
|
+
attemptCount: h.attemptCount,
|
|
8440
|
+
isLatestAttempt: h.isLatestAttempt,
|
|
8441
|
+
baseUserMessageId: h.baseUserMessageId ?? null
|
|
8439
8442
|
}) : l.set(f, {
|
|
8440
|
-
...
|
|
8443
|
+
...p,
|
|
8441
8444
|
attemptIndex: 0,
|
|
8442
8445
|
attemptCount: 1,
|
|
8443
8446
|
isLatestAttempt: !0,
|
|
@@ -8791,13 +8794,13 @@ function $0(e, t, n, r, o, s, i, a, l) {
|
|
|
8791
8794
|
const c = Q.useCallback(
|
|
8792
8795
|
(d) => {
|
|
8793
8796
|
const f = F0(d.children, t, a ? "offsetWidth" : "offsetHeight", o);
|
|
8794
|
-
let
|
|
8795
|
-
for (; !
|
|
8796
|
-
|
|
8797
|
-
const
|
|
8797
|
+
let p = d.parentElement;
|
|
8798
|
+
for (; !p.dataset.virtuosoScroller; )
|
|
8799
|
+
p = p.parentElement;
|
|
8800
|
+
const h = p.lastElementChild.dataset.viewportType === "window";
|
|
8798
8801
|
let m;
|
|
8799
|
-
|
|
8800
|
-
const g = i ? a ? i.scrollLeft : i.scrollTop :
|
|
8802
|
+
h && (m = p.ownerDocument.defaultView);
|
|
8803
|
+
const g = i ? a ? i.scrollLeft : i.scrollTop : h ? a ? m.scrollX || m.document.documentElement.scrollLeft : m.scrollY || m.document.documentElement.scrollTop : a ? p.scrollLeft : p.scrollTop, y = i ? a ? i.scrollWidth : i.scrollHeight : h ? a ? m.document.documentElement.scrollWidth : m.document.documentElement.scrollHeight : a ? p.scrollWidth : p.scrollHeight, x = i ? a ? i.offsetWidth : i.offsetHeight : h ? a ? m.innerWidth : m.innerHeight : a ? p.offsetWidth : p.offsetHeight;
|
|
8801
8804
|
r({
|
|
8802
8805
|
scrollHeight: y,
|
|
8803
8806
|
scrollTop: Math.max(g, 0),
|
|
@@ -8836,17 +8839,17 @@ function mf(e, t, n) {
|
|
|
8836
8839
|
if (!(l != null && l.offsetParent))
|
|
8837
8840
|
return;
|
|
8838
8841
|
const c = l.getBoundingClientRect(), d = c.width;
|
|
8839
|
-
let f,
|
|
8842
|
+
let f, p;
|
|
8840
8843
|
if (t) {
|
|
8841
|
-
const
|
|
8842
|
-
|
|
8844
|
+
const h = t.getBoundingClientRect(), m = c.top - h.top;
|
|
8845
|
+
p = h.height - Math.max(0, m), f = m + t.scrollTop;
|
|
8843
8846
|
} else {
|
|
8844
|
-
const
|
|
8845
|
-
|
|
8847
|
+
const h = i.current.ownerDocument.defaultView;
|
|
8848
|
+
p = h.innerHeight - Math.max(0, c.top), f = c.top + h.scrollY;
|
|
8846
8849
|
}
|
|
8847
8850
|
r.current = {
|
|
8848
8851
|
offsetTop: f,
|
|
8849
|
-
visibleHeight:
|
|
8852
|
+
visibleHeight: p,
|
|
8850
8853
|
visibleWidth: d
|
|
8851
8854
|
}, e(r.current);
|
|
8852
8855
|
},
|
|
@@ -8875,7 +8878,7 @@ function mf(e, t, n) {
|
|
|
8875
8878
|
}
|
|
8876
8879
|
const Bt = Xe(
|
|
8877
8880
|
() => {
|
|
8878
|
-
const e = He(), t = He(), n = ee(0), r = He(), o = ee(0), s = He(), i = He(), a = ee(0), l = ee(0), c = ee(0), d = ee(0), f = He(),
|
|
8881
|
+
const e = He(), t = He(), n = ee(0), r = He(), o = ee(0), s = He(), i = He(), a = ee(0), l = ee(0), c = ee(0), d = ee(0), f = He(), p = He(), h = ee(!1), m = ee(!1), g = ee(!1);
|
|
8879
8882
|
return he(
|
|
8880
8883
|
W(
|
|
8881
8884
|
e,
|
|
@@ -8895,11 +8898,11 @@ const Bt = Xe(
|
|
|
8895
8898
|
footerHeight: d,
|
|
8896
8899
|
headerHeight: a,
|
|
8897
8900
|
horizontalDirection: m,
|
|
8898
|
-
scrollBy:
|
|
8901
|
+
scrollBy: p,
|
|
8899
8902
|
// input
|
|
8900
8903
|
scrollContainerState: e,
|
|
8901
8904
|
scrollHeight: i,
|
|
8902
|
-
scrollingInProgress:
|
|
8905
|
+
scrollingInProgress: h,
|
|
8903
8906
|
// signals
|
|
8904
8907
|
scrollTo: f,
|
|
8905
8908
|
scrollTop: t,
|
|
@@ -9116,8 +9119,8 @@ function H0(e, t) {
|
|
|
9116
9119
|
if (a.some(X0(r)))
|
|
9117
9120
|
continue;
|
|
9118
9121
|
let l = !1, c = !1;
|
|
9119
|
-
for (const { end: d, start: f, value:
|
|
9120
|
-
l ? (o >= f || s ===
|
|
9122
|
+
for (const { end: d, start: f, value: p } of a)
|
|
9123
|
+
l ? (o >= f || s === p) && (e = Ui(e, f)) : (c = p !== s, l = !0), d > o && o >= f && p !== s && (e = qt(e, o + 1, p));
|
|
9121
9124
|
c && (e = qt(e, i, s));
|
|
9122
9125
|
}
|
|
9123
9126
|
return [e, n];
|
|
@@ -9159,8 +9162,8 @@ function q0(e, [t, n, r, o]) {
|
|
|
9159
9162
|
const s = e.sizeTree;
|
|
9160
9163
|
let i = s, a = 0;
|
|
9161
9164
|
if (n.length > 0 && at(s) && t.length === 2) {
|
|
9162
|
-
const
|
|
9163
|
-
i = n.reduce((m, g) => qt(qt(m, g,
|
|
9165
|
+
const p = t[0].size, h = t[1].size;
|
|
9166
|
+
i = n.reduce((m, g) => qt(qt(m, g, p), g + 1, h), i);
|
|
9164
9167
|
} else
|
|
9165
9168
|
[i, a] = H0(i, t);
|
|
9166
9169
|
if (i === s)
|
|
@@ -9168,7 +9171,7 @@ function q0(e, [t, n, r, o]) {
|
|
|
9168
9171
|
const { lastIndex: l, lastOffset: c, lastSize: d, offsetTree: f } = Vi(e.offsetTree, a, i, o);
|
|
9169
9172
|
return {
|
|
9170
9173
|
groupIndices: n,
|
|
9171
|
-
groupOffsetTree: n.reduce((
|
|
9174
|
+
groupOffsetTree: n.reduce((p, h) => qt(p, h, to(h, f, o)), vr()),
|
|
9172
9175
|
lastIndex: l,
|
|
9173
9176
|
lastOffset: c,
|
|
9174
9177
|
lastSize: d,
|
|
@@ -9197,12 +9200,12 @@ function Vi(e, t, n, r) {
|
|
|
9197
9200
|
} else
|
|
9198
9201
|
o = [];
|
|
9199
9202
|
for (const { start: c, value: d } of Fs(n, t, 1 / 0)) {
|
|
9200
|
-
const f = c - s,
|
|
9203
|
+
const f = c - s, p = f * i + a + f * r;
|
|
9201
9204
|
o.push({
|
|
9202
9205
|
index: c,
|
|
9203
|
-
offset:
|
|
9206
|
+
offset: p,
|
|
9204
9207
|
size: d
|
|
9205
|
-
}), s = c, a =
|
|
9208
|
+
}), s = c, a = p, i = d;
|
|
9206
9209
|
}
|
|
9207
9210
|
return {
|
|
9208
9211
|
lastIndex: s,
|
|
@@ -9223,8 +9226,8 @@ const J0 = {
|
|
|
9223
9226
|
offsetWidth: "width"
|
|
9224
9227
|
}, Cn = Xe(
|
|
9225
9228
|
([{ log: e }, { recalcInProgress: t }]) => {
|
|
9226
|
-
const n = He(), r = He(), o = Dt(r, 0), s = He(), i = He(), a = ee(0), l = ee([]), c = ee(void 0), d = ee(void 0), f = ee((S, C) => $n(S, J0[C])),
|
|
9227
|
-
W(n, Fe(l, e,
|
|
9229
|
+
const n = He(), r = He(), o = Dt(r, 0), s = He(), i = He(), a = ee(0), l = ee([]), c = ee(void 0), d = ee(void 0), f = ee((S, C) => $n(S, J0[C])), p = ee(void 0), h = ee(0), m = U0(), g = Dt(
|
|
9230
|
+
W(n, Fe(l, e, h), vn(q0, m), ut()),
|
|
9228
9231
|
m
|
|
9229
9232
|
), y = Dt(
|
|
9230
9233
|
W(
|
|
@@ -9242,9 +9245,9 @@ const J0 = {
|
|
|
9242
9245
|
W(
|
|
9243
9246
|
l,
|
|
9244
9247
|
ke((S) => S.length > 0),
|
|
9245
|
-
Fe(g,
|
|
9248
|
+
Fe(g, h),
|
|
9246
9249
|
ce(([S, C, k]) => {
|
|
9247
|
-
const R = S.reduce((
|
|
9250
|
+
const R = S.reduce((A, D, j) => qt(A, D, to(D, C.offsetTree, k) || j), vr());
|
|
9248
9251
|
return {
|
|
9249
9252
|
...C,
|
|
9250
9253
|
groupIndices: S,
|
|
@@ -9328,32 +9331,32 @@ const J0 = {
|
|
|
9328
9331
|
s,
|
|
9329
9332
|
Fe(g),
|
|
9330
9333
|
ce(([S, C]) => {
|
|
9331
|
-
const k = C.groupIndices.length > 0, R = [],
|
|
9334
|
+
const k = C.groupIndices.length > 0, R = [], A = C.lastSize;
|
|
9332
9335
|
if (k) {
|
|
9333
9336
|
const D = Qr(C.sizeTree, 0);
|
|
9334
9337
|
let j = 0, M = 0;
|
|
9335
9338
|
for (; j < S; ) {
|
|
9336
|
-
const
|
|
9339
|
+
const E = C.groupIndices[M], F = C.groupIndices.length === M + 1 ? 1 / 0 : C.groupIndices[M + 1] - E - 1;
|
|
9337
9340
|
R.push({
|
|
9338
|
-
endIndex:
|
|
9341
|
+
endIndex: E,
|
|
9339
9342
|
size: D,
|
|
9340
|
-
startIndex:
|
|
9343
|
+
startIndex: E
|
|
9341
9344
|
}), R.push({
|
|
9342
|
-
endIndex:
|
|
9343
|
-
size:
|
|
9344
|
-
startIndex:
|
|
9345
|
+
endIndex: E + 1 + F - 1,
|
|
9346
|
+
size: A,
|
|
9347
|
+
startIndex: E + 1
|
|
9345
9348
|
}), M++, j += F + 1;
|
|
9346
9349
|
}
|
|
9347
9350
|
const $ = Xn(C.sizeTree);
|
|
9348
9351
|
return j !== S && $.shift(), $.reduce(
|
|
9349
|
-
(
|
|
9350
|
-
let V =
|
|
9351
|
-
return
|
|
9352
|
-
...
|
|
9352
|
+
(E, { k: F, v: N }) => {
|
|
9353
|
+
let V = E.ranges;
|
|
9354
|
+
return E.prevSize !== 0 && (V = [
|
|
9355
|
+
...E.ranges,
|
|
9353
9356
|
{
|
|
9354
9357
|
endIndex: F + S - 1,
|
|
9355
|
-
size:
|
|
9356
|
-
startIndex:
|
|
9358
|
+
size: E.prevSize,
|
|
9359
|
+
startIndex: E.prevIndex
|
|
9357
9360
|
}
|
|
9358
9361
|
]), {
|
|
9359
9362
|
prevIndex: F + S,
|
|
@@ -9376,7 +9379,7 @@ const J0 = {
|
|
|
9376
9379
|
}),
|
|
9377
9380
|
{
|
|
9378
9381
|
prevIndex: 0,
|
|
9379
|
-
prevSize:
|
|
9382
|
+
prevSize: A,
|
|
9380
9383
|
ranges: []
|
|
9381
9384
|
}
|
|
9382
9385
|
).ranges;
|
|
@@ -9387,7 +9390,7 @@ const J0 = {
|
|
|
9387
9390
|
const T = Yt(
|
|
9388
9391
|
W(
|
|
9389
9392
|
i,
|
|
9390
|
-
Fe(g,
|
|
9393
|
+
Fe(g, h),
|
|
9391
9394
|
ce(([S, { offsetTree: C }, k]) => {
|
|
9392
9395
|
const R = -S;
|
|
9393
9396
|
return to(R, C, k);
|
|
@@ -9397,24 +9400,24 @@ const J0 = {
|
|
|
9397
9400
|
return he(
|
|
9398
9401
|
W(
|
|
9399
9402
|
i,
|
|
9400
|
-
Fe(g,
|
|
9403
|
+
Fe(g, h),
|
|
9401
9404
|
ce(([S, C, k]) => {
|
|
9402
9405
|
if (C.groupIndices.length > 0) {
|
|
9403
9406
|
if (at(C.sizeTree))
|
|
9404
9407
|
return C;
|
|
9405
9408
|
let R = vr();
|
|
9406
|
-
const
|
|
9409
|
+
const A = bt(y);
|
|
9407
9410
|
let D = 0, j = 0, M = 0;
|
|
9408
9411
|
for (; D < -S; ) {
|
|
9409
|
-
M =
|
|
9410
|
-
const $ =
|
|
9412
|
+
M = A[j];
|
|
9413
|
+
const $ = A[j + 1] - M - 1;
|
|
9411
9414
|
j++, D += $ + 1;
|
|
9412
9415
|
}
|
|
9413
|
-
if (R = Xn(C.sizeTree).reduce(($, { k:
|
|
9416
|
+
if (R = Xn(C.sizeTree).reduce(($, { k: E, v: F }) => qt($, Math.max(0, E + S), F), R), D !== -S) {
|
|
9414
9417
|
const $ = Qr(C.sizeTree, M);
|
|
9415
9418
|
R = qt(R, 0, $);
|
|
9416
|
-
const
|
|
9417
|
-
R = qt(R, 1,
|
|
9419
|
+
const E = fn(C.sizeTree, -S + 1)[1];
|
|
9420
|
+
R = qt(R, 1, E);
|
|
9418
9421
|
}
|
|
9419
9422
|
return {
|
|
9420
9423
|
...C,
|
|
@@ -9422,7 +9425,7 @@ const J0 = {
|
|
|
9422
9425
|
...Vi(C.offsetTree, 0, R, k)
|
|
9423
9426
|
};
|
|
9424
9427
|
} else {
|
|
9425
|
-
const R = Xn(C.sizeTree).reduce((
|
|
9428
|
+
const R = Xn(C.sizeTree).reduce((A, { k: D, v: j }) => qt(A, Math.max(0, D + S), j), vr());
|
|
9426
9429
|
return {
|
|
9427
9430
|
...C,
|
|
9428
9431
|
sizeTree: R,
|
|
@@ -9435,11 +9438,11 @@ const J0 = {
|
|
|
9435
9438
|
), {
|
|
9436
9439
|
beforeUnshiftWith: b,
|
|
9437
9440
|
// input
|
|
9438
|
-
data:
|
|
9441
|
+
data: p,
|
|
9439
9442
|
defaultItemSize: d,
|
|
9440
9443
|
firstItemIndex: a,
|
|
9441
9444
|
fixedItemSize: c,
|
|
9442
|
-
gap:
|
|
9445
|
+
gap: h,
|
|
9443
9446
|
groupIndices: l,
|
|
9444
9447
|
itemSize: f,
|
|
9445
9448
|
listRefresh: w,
|
|
@@ -9526,30 +9529,30 @@ const mo = Xe(
|
|
|
9526
9529
|
smoothScrollTargetReached: d,
|
|
9527
9530
|
viewportHeight: f
|
|
9528
9531
|
},
|
|
9529
|
-
{ log:
|
|
9532
|
+
{ log: p }
|
|
9530
9533
|
]) => {
|
|
9531
|
-
const
|
|
9534
|
+
const h = He(), m = He(), g = ee(0);
|
|
9532
9535
|
let y = null, x = null, w = null;
|
|
9533
9536
|
function b() {
|
|
9534
9537
|
y && (y(), y = null), w && (w(), w = null), x && (clearTimeout(x), x = null), Me(l, !1);
|
|
9535
9538
|
}
|
|
9536
9539
|
return he(
|
|
9537
9540
|
W(
|
|
9538
|
-
|
|
9539
|
-
Fe(n, f, r, g, a, i,
|
|
9541
|
+
h,
|
|
9542
|
+
Fe(n, f, r, g, a, i, p),
|
|
9540
9543
|
Fe(e, s, o),
|
|
9541
9544
|
ce(
|
|
9542
9545
|
([
|
|
9543
|
-
[T, S, C, k, R,
|
|
9546
|
+
[T, S, C, k, R, A, D, j],
|
|
9544
9547
|
M,
|
|
9545
9548
|
$,
|
|
9546
|
-
|
|
9549
|
+
E
|
|
9547
9550
|
]) => {
|
|
9548
9551
|
const F = If(T), { align: N, behavior: V, offset: B } = F, _ = k - 1, q = Tf(F, S, _);
|
|
9549
|
-
let Y = to(q, S.offsetTree, M) +
|
|
9550
|
-
N === "end" ? (Y += $ + fn(S.sizeTree, q)[1] - C +
|
|
9552
|
+
let Y = to(q, S.offsetTree, M) + A;
|
|
9553
|
+
N === "end" ? (Y += $ + fn(S.sizeTree, q)[1] - C + E, q === _ && (Y += D)) : N === "center" ? Y += ($ + fn(S.sizeTree, q)[1] - C + E) / 2 : Y -= R, B && (Y += B);
|
|
9551
9554
|
const se = (we) => {
|
|
9552
|
-
b(), we ? (j("retrying to scroll to", { location: T }, Ht.DEBUG), Me(
|
|
9555
|
+
b(), we ? (j("retrying to scroll to", { location: T }, Ht.DEBUG), Me(h, T)) : (Me(m, !0), j("list did not change, scroll successful", {}, Ht.DEBUG));
|
|
9553
9556
|
};
|
|
9554
9557
|
if (b(), V === "smooth") {
|
|
9555
9558
|
let we = !1;
|
|
@@ -9569,7 +9572,7 @@ const mo = Xe(
|
|
|
9569
9572
|
c
|
|
9570
9573
|
), {
|
|
9571
9574
|
scrollTargetReached: m,
|
|
9572
|
-
scrollToIndex:
|
|
9575
|
+
scrollToIndex: h,
|
|
9573
9576
|
topListHeight: g
|
|
9574
9577
|
};
|
|
9575
9578
|
},
|
|
@@ -9618,7 +9621,7 @@ const go = Xe(
|
|
|
9618
9621
|
W(
|
|
9619
9622
|
Ct(t, i),
|
|
9620
9623
|
Fe(a, n, e, c),
|
|
9621
|
-
ke(([[, d], f, { sizeTree:
|
|
9624
|
+
ke(([[, d], f, { sizeTree: p }, h, m]) => d && (!at(p) || Ea(h)) && !f && !m),
|
|
9622
9625
|
Fe(l)
|
|
9623
9626
|
),
|
|
9624
9627
|
([, d]) => {
|
|
@@ -9652,13 +9655,13 @@ const no = "up", zr = "down", tS = "none", nS = {
|
|
|
9652
9655
|
viewportHeight: 0
|
|
9653
9656
|
}
|
|
9654
9657
|
}, rS = 0, xo = Xe(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
|
|
9655
|
-
const i = ee(!1), a = ee(!0), l = He(), c = He(), d = ee(4), f = ee(rS),
|
|
9658
|
+
const i = ee(!1), a = ee(!0), l = He(), c = He(), d = ee(4), f = ee(rS), p = Dt(
|
|
9656
9659
|
W(
|
|
9657
9660
|
zi(W(Te(o), nr(1), gn(!0)), W(Te(o), nr(1), gn(!1), lc(100))),
|
|
9658
9661
|
ut()
|
|
9659
9662
|
),
|
|
9660
9663
|
!1
|
|
9661
|
-
),
|
|
9664
|
+
), h = Dt(
|
|
9662
9665
|
W(zi(W(n, gn(!0)), W(n, gn(!1), lc(200))), ut()),
|
|
9663
9666
|
!1
|
|
9664
9667
|
);
|
|
@@ -9674,12 +9677,12 @@ const no = "up", zr = "down", tS = "none", nS = {
|
|
|
9674
9677
|
W(
|
|
9675
9678
|
Ct(r, Te(s), Te(t), Te(e), Te(d)),
|
|
9676
9679
|
vn((w, [{ scrollHeight: b, scrollTop: T }, S, C, k, R]) => {
|
|
9677
|
-
const
|
|
9680
|
+
const A = T + S - b > -R, D = {
|
|
9678
9681
|
scrollHeight: b,
|
|
9679
9682
|
scrollTop: T,
|
|
9680
9683
|
viewportHeight: S
|
|
9681
9684
|
};
|
|
9682
|
-
if (
|
|
9685
|
+
if (A) {
|
|
9683
9686
|
let M, $;
|
|
9684
9687
|
return T > w.state.scrollTop ? (M = "SCROLLED_DOWN", $ = w.state.scrollTop - T) : (M = "SIZE_DECREASED", $ = w.state.scrollTop - T || w.scrollTopDelta), {
|
|
9685
9688
|
atBottom: !0,
|
|
@@ -9745,7 +9748,7 @@ const no = "up", zr = "down", tS = "none", nS = {
|
|
|
9745
9748
|
ce(({ scrollTop: w }) => w),
|
|
9746
9749
|
ut(),
|
|
9747
9750
|
vn(
|
|
9748
|
-
(w, b) => bt(
|
|
9751
|
+
(w, b) => bt(h) ? { direction: w.direction, prevScrollTop: b } : { direction: b < w.prevScrollTop ? no : zr, prevScrollTop: b },
|
|
9749
9752
|
{ direction: zr, prevScrollTop: 0 }
|
|
9750
9753
|
),
|
|
9751
9754
|
ce((w) => w.direction)
|
|
@@ -9755,7 +9758,7 @@ const no = "up", zr = "down", tS = "none", nS = {
|
|
|
9755
9758
|
const x = ee(0);
|
|
9756
9759
|
return he(
|
|
9757
9760
|
W(
|
|
9758
|
-
|
|
9761
|
+
p,
|
|
9759
9762
|
ke((w) => !w),
|
|
9760
9763
|
gn(0)
|
|
9761
9764
|
),
|
|
@@ -9764,7 +9767,7 @@ const no = "up", zr = "down", tS = "none", nS = {
|
|
|
9764
9767
|
W(
|
|
9765
9768
|
o,
|
|
9766
9769
|
In(100),
|
|
9767
|
-
Fe(
|
|
9770
|
+
Fe(p),
|
|
9768
9771
|
ke(([w, b]) => !!b),
|
|
9769
9772
|
vn(([w, b], [T]) => [b, T], [0, 0]),
|
|
9770
9773
|
ce(([w, b]) => b - w)
|
|
@@ -9778,7 +9781,7 @@ const no = "up", zr = "down", tS = "none", nS = {
|
|
|
9778
9781
|
atTopThreshold: f,
|
|
9779
9782
|
isAtBottom: i,
|
|
9780
9783
|
isAtTop: a,
|
|
9781
|
-
isScrolling:
|
|
9784
|
+
isScrolling: p,
|
|
9782
9785
|
lastJumpDueToItemResize: g,
|
|
9783
9786
|
scrollDirection: y,
|
|
9784
9787
|
scrollVelocity: x
|
|
@@ -9810,20 +9813,20 @@ const Oa = Xe(
|
|
|
9810
9813
|
([
|
|
9811
9814
|
d,
|
|
9812
9815
|
f,
|
|
9813
|
-
|
|
9814
|
-
[
|
|
9816
|
+
p,
|
|
9817
|
+
[h, m],
|
|
9815
9818
|
g,
|
|
9816
9819
|
y,
|
|
9817
9820
|
x,
|
|
9818
9821
|
w,
|
|
9819
9822
|
b
|
|
9820
9823
|
]) => {
|
|
9821
|
-
const T = d - w, S = y + x, C = Math.max(
|
|
9824
|
+
const T = d - w, S = y + x, C = Math.max(p - T, 0);
|
|
9822
9825
|
let k = fc;
|
|
9823
|
-
const R = hc(b, ts),
|
|
9824
|
-
return
|
|
9825
|
-
Math.max(T -
|
|
9826
|
-
T - C - x + f + pc(g, ns, k) +
|
|
9826
|
+
const R = hc(b, ts), A = hc(b, ns);
|
|
9827
|
+
return h -= w, h += p + x, m += p + x, m -= w, h > d + S - R && (k = no), m < d - C + f + A && (k = zr), k !== fc ? [
|
|
9828
|
+
Math.max(T - p - pc(g, ts, k) - R, 0),
|
|
9829
|
+
T - C - x + f + pc(g, ns, k) + A
|
|
9827
9830
|
] : null;
|
|
9828
9831
|
}
|
|
9829
9832
|
),
|
|
@@ -9874,14 +9877,14 @@ function Uo(e, t, n, r, o, s) {
|
|
|
9874
9877
|
const g = e[e.length - 1];
|
|
9875
9878
|
d = g.offset + g.size;
|
|
9876
9879
|
}
|
|
9877
|
-
const f = n - i,
|
|
9880
|
+
const f = n - i, p = a + f * l + (f - 1) * r, h = c, m = p - d;
|
|
9878
9881
|
return {
|
|
9879
9882
|
bottom: d,
|
|
9880
9883
|
firstItemIndex: s,
|
|
9881
9884
|
items: mc(e, o, s),
|
|
9882
9885
|
offsetBottom: m,
|
|
9883
9886
|
offsetTop: c,
|
|
9884
|
-
top:
|
|
9887
|
+
top: h,
|
|
9885
9888
|
topItems: mc(t, o, s),
|
|
9886
9889
|
topListHeight: t.reduce((g, y) => y.size + g, 0),
|
|
9887
9890
|
totalCount: n
|
|
@@ -9936,8 +9939,8 @@ const cr = Xe(
|
|
|
9936
9939
|
{ listBoundary: i, topListHeight: a, visibleRange: l },
|
|
9937
9940
|
{ initialTopMostItemIndex: c, scrolledToInitialItem: d },
|
|
9938
9941
|
{ topListHeight: f },
|
|
9939
|
-
|
|
9940
|
-
{ didMount:
|
|
9942
|
+
p,
|
|
9943
|
+
{ didMount: h },
|
|
9941
9944
|
{ recalcInProgress: m }
|
|
9942
9945
|
]) => {
|
|
9943
9946
|
const g = ee([]), y = ee(0), x = He();
|
|
@@ -9945,7 +9948,7 @@ const cr = Xe(
|
|
|
9945
9948
|
const w = Dt(
|
|
9946
9949
|
W(
|
|
9947
9950
|
Ct(
|
|
9948
|
-
|
|
9951
|
+
h,
|
|
9949
9952
|
m,
|
|
9950
9953
|
Te(l, eo),
|
|
9951
9954
|
Te(o),
|
|
@@ -9957,8 +9960,8 @@ const cr = Xe(
|
|
|
9957
9960
|
Te(n),
|
|
9958
9961
|
e
|
|
9959
9962
|
),
|
|
9960
|
-
ke(([C, k, , R, , , , , , ,
|
|
9961
|
-
const D =
|
|
9963
|
+
ke(([C, k, , R, , , , , , , A]) => {
|
|
9964
|
+
const D = A && A.length !== R;
|
|
9962
9965
|
return C && !k && !D;
|
|
9963
9966
|
}),
|
|
9964
9967
|
ce(
|
|
@@ -9967,25 +9970,25 @@ const cr = Xe(
|
|
|
9967
9970
|
,
|
|
9968
9971
|
[C, k],
|
|
9969
9972
|
R,
|
|
9970
|
-
|
|
9973
|
+
A,
|
|
9971
9974
|
D,
|
|
9972
9975
|
j,
|
|
9973
9976
|
M,
|
|
9974
9977
|
$,
|
|
9975
|
-
|
|
9978
|
+
E,
|
|
9976
9979
|
F
|
|
9977
9980
|
]) => {
|
|
9978
|
-
const N =
|
|
9981
|
+
const N = A, { offsetTree: V, sizeTree: B } = N, _ = bt(y);
|
|
9979
9982
|
if (R === 0)
|
|
9980
9983
|
return { ...gi, totalCount: R };
|
|
9981
9984
|
if (C === 0 && k === 0)
|
|
9982
|
-
return _ === 0 ? { ...gi, totalCount: R } : Ef(_, D,
|
|
9985
|
+
return _ === 0 ? { ...gi, totalCount: R } : Ef(_, D, A, $, E, F || []);
|
|
9983
9986
|
if (at(B))
|
|
9984
9987
|
return _ > 0 ? null : Uo(
|
|
9985
9988
|
oS(Ma(D, R), N, F),
|
|
9986
9989
|
[],
|
|
9987
9990
|
R,
|
|
9988
|
-
|
|
9991
|
+
E,
|
|
9989
9992
|
N,
|
|
9990
9993
|
$
|
|
9991
9994
|
);
|
|
@@ -10000,7 +10003,7 @@ const cr = Xe(
|
|
|
10000
10003
|
}
|
|
10001
10004
|
}
|
|
10002
10005
|
if (!j)
|
|
10003
|
-
return Uo([], q, R,
|
|
10006
|
+
return Uo([], q, R, E, N, $);
|
|
10004
10007
|
const Y = M.length > 0 ? M[M.length - 1] + 1 : 0, se = K0(V, C, k, Y);
|
|
10005
10008
|
if (se.length === 0)
|
|
10006
10009
|
return null;
|
|
@@ -10010,17 +10013,17 @@ const cr = Xe(
|
|
|
10010
10013
|
let L = X.offset, K = z.start;
|
|
10011
10014
|
const J = X.size;
|
|
10012
10015
|
if (X.offset < C) {
|
|
10013
|
-
K += Math.floor((C - X.offset +
|
|
10016
|
+
K += Math.floor((C - X.offset + E) / (J + E));
|
|
10014
10017
|
const ie = K - z.start;
|
|
10015
|
-
L += ie * J + ie *
|
|
10018
|
+
L += ie * J + ie * E;
|
|
10016
10019
|
}
|
|
10017
10020
|
K < Y && (L += (Y - K) * J, K = Y);
|
|
10018
10021
|
const le = Math.min(z.end, we);
|
|
10019
10022
|
for (let ie = K; ie <= le && !(L >= k); ie++)
|
|
10020
|
-
G.push({ data: F == null ? void 0 : F[ie], index: ie, offset: L, size: J }), L += J +
|
|
10023
|
+
G.push({ data: F == null ? void 0 : F[ie], index: ie, offset: L, size: J }), L += J + E;
|
|
10021
10024
|
}
|
|
10022
10025
|
});
|
|
10023
|
-
return Uo(Ie, q, R,
|
|
10026
|
+
return Uo(Ie, q, R, E, N, $);
|
|
10024
10027
|
}
|
|
10025
10028
|
),
|
|
10026
10029
|
//@ts-expect-error filter needs to be fixed
|
|
@@ -10091,7 +10094,7 @@ const cr = Xe(
|
|
|
10091
10094
|
ut(bf)
|
|
10092
10095
|
)
|
|
10093
10096
|
);
|
|
10094
|
-
return { endReached: b, initialItemCount: y, itemsRendered: x, listState: w, rangeChanged: S, startReached: T, topItemsIndexes: g, ...
|
|
10097
|
+
return { endReached: b, initialItemCount: y, itemsRendered: x, listState: w, rangeChanged: S, startReached: T, topItemsIndexes: g, ...p };
|
|
10095
10098
|
},
|
|
10096
10099
|
dt(
|
|
10097
10100
|
Cn,
|
|
@@ -10153,15 +10156,15 @@ const cr = Xe(
|
|
|
10153
10156
|
d,
|
|
10154
10157
|
Fe(t, l, n, s, o, r, a),
|
|
10155
10158
|
Fe(e),
|
|
10156
|
-
ce(([[f,
|
|
10157
|
-
const { align: T, behavior: S, calculateViewLocation: C = iS, done: k, ...R } = f,
|
|
10159
|
+
ce(([[f, p, h, m, g, y, x, w], b]) => {
|
|
10160
|
+
const { align: T, behavior: S, calculateViewLocation: C = iS, done: k, ...R } = f, A = Tf(f, p, m - 1), D = to(A, p.offsetTree, b) + g + y, j = D + fn(p.sizeTree, A)[1], M = w + y, $ = w + h - x, E = C({
|
|
10158
10161
|
itemBottom: j,
|
|
10159
10162
|
itemTop: D,
|
|
10160
10163
|
locationParams: { align: T, behavior: S, ...R },
|
|
10161
10164
|
viewportBottom: $,
|
|
10162
10165
|
viewportTop: M
|
|
10163
10166
|
});
|
|
10164
|
-
return
|
|
10167
|
+
return E ? k && cn(
|
|
10165
10168
|
W(
|
|
10166
10169
|
i,
|
|
10167
10170
|
ke((F) => !F),
|
|
@@ -10170,7 +10173,7 @@ const cr = Xe(
|
|
|
10170
10173
|
nr(bt(i) ? 1 : 2)
|
|
10171
10174
|
),
|
|
10172
10175
|
k
|
|
10173
|
-
) : k && k(),
|
|
10176
|
+
) : k && k(), E;
|
|
10174
10177
|
}),
|
|
10175
10178
|
ke((f) => f !== null)
|
|
10176
10179
|
),
|
|
@@ -10194,8 +10197,8 @@ const aS = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), lS = Xe(
|
|
|
10194
10197
|
{ didMount: l, propsReady: c },
|
|
10195
10198
|
{ log: d },
|
|
10196
10199
|
{ scrollingInProgress: f },
|
|
10197
|
-
{ context:
|
|
10198
|
-
{ scrollIntoView:
|
|
10200
|
+
{ context: p },
|
|
10201
|
+
{ scrollIntoView: h }
|
|
10199
10202
|
]) => {
|
|
10200
10203
|
const m = ee(!1), g = He();
|
|
10201
10204
|
let y = null;
|
|
@@ -10210,8 +10213,8 @@ const aS = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), lS = Xe(
|
|
|
10210
10213
|
W(
|
|
10211
10214
|
Ct(W(Te(t), nr(1)), l),
|
|
10212
10215
|
Fe(Te(m), s, a, f),
|
|
10213
|
-
ce(([[S, C], k, R,
|
|
10214
|
-
let j = C &&
|
|
10216
|
+
ce(([[S, C], k, R, A, D]) => {
|
|
10217
|
+
let j = C && A, M = "auto";
|
|
10215
10218
|
return j && (M = aS(k, R || D), j = j && !!M), { followOutputBehavior: M, shouldFollow: j, totalCount: S };
|
|
10216
10219
|
}),
|
|
10217
10220
|
ke(({ shouldFollow: S }) => S)
|
|
@@ -10265,16 +10268,16 @@ const aS = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), lS = Xe(
|
|
|
10265
10268
|
), nt(
|
|
10266
10269
|
W(
|
|
10267
10270
|
Ct(W(T, nr(1)), l),
|
|
10268
|
-
Fe(Te(b), a, f,
|
|
10269
|
-
ce(([[S, C], k, R,
|
|
10271
|
+
Fe(Te(b), a, f, p),
|
|
10272
|
+
ce(([[S, C], k, R, A, D]) => C && R && (k == null ? void 0 : k({ context: D, totalCount: S, scrollingInProgress: A }))),
|
|
10270
10273
|
ke((S) => !!S),
|
|
10271
10274
|
In(0)
|
|
10272
10275
|
),
|
|
10273
10276
|
(S) => {
|
|
10274
10277
|
y && (y(), y = null), bt(n) ? requestAnimationFrame(() => {
|
|
10275
|
-
bt(d)("scrolling into view", {}), Me(
|
|
10278
|
+
bt(d)("scrolling into view", {}), Me(h, S);
|
|
10276
10279
|
}) : y = cn(e, () => {
|
|
10277
|
-
bt(d)("scrolling into view", {}), Me(
|
|
10280
|
+
bt(d)("scrolling into view", {}), Me(h, S), y = null;
|
|
10278
10281
|
});
|
|
10279
10282
|
}
|
|
10280
10283
|
), { autoscrollToBottom: g, followOutput: m, scrollIntoViewOnChange: b };
|
|
@@ -10297,7 +10300,7 @@ const aS = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), lS = Xe(
|
|
|
10297
10300
|
Fe(s),
|
|
10298
10301
|
ke(([, l]) => l !== 0),
|
|
10299
10302
|
Fe(o, r, t, n, e),
|
|
10300
|
-
ce(([[, l], c, d, f,
|
|
10303
|
+
ce(([[, l], c, d, f, p, h = []]) => Ef(l, c, d, f, p, h))
|
|
10301
10304
|
),
|
|
10302
10305
|
i
|
|
10303
10306
|
), {}),
|
|
@@ -10402,23 +10405,23 @@ const aS = (e, t) => typeof e == "function" ? gc(e(t)) : t && gc(e), lS = Xe(
|
|
|
10402
10405
|
{ didMount: s },
|
|
10403
10406
|
{ useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: l }
|
|
10404
10407
|
]) => {
|
|
10405
|
-
const c = He(), d = ee(void 0), f = ee(null),
|
|
10406
|
-
return he(a, f), he(l,
|
|
10408
|
+
const c = He(), d = ee(void 0), f = ee(null), p = ee(null);
|
|
10409
|
+
return he(a, f), he(l, p), nt(
|
|
10407
10410
|
W(
|
|
10408
10411
|
c,
|
|
10409
|
-
Fe(t, r, i, f,
|
|
10412
|
+
Fe(t, r, i, f, p, n)
|
|
10410
10413
|
),
|
|
10411
|
-
([
|
|
10414
|
+
([h, m, g, y, x, w, b]) => {
|
|
10412
10415
|
const T = G0(m.sizeTree);
|
|
10413
|
-
y && x !== null && w !== null && (g = x.scrollTop - w.offsetTop), g -= b,
|
|
10416
|
+
y && x !== null && w !== null && (g = x.scrollTop - w.offsetTop), g -= b, h({ ranges: T, scrollTop: g });
|
|
10414
10417
|
}
|
|
10415
10418
|
), he(W(d, ke(Ea), ce(fS)), o), he(
|
|
10416
10419
|
W(
|
|
10417
10420
|
s,
|
|
10418
10421
|
Fe(d),
|
|
10419
|
-
ke(([,
|
|
10422
|
+
ke(([, h]) => h !== void 0),
|
|
10420
10423
|
ut(),
|
|
10421
|
-
ce(([,
|
|
10424
|
+
ce(([, h]) => h.ranges)
|
|
10422
10425
|
),
|
|
10423
10426
|
e
|
|
10424
10427
|
), {
|
|
@@ -10451,8 +10454,8 @@ const hS = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10451
10454
|
{ deviation: e, scrollBy: t, scrollingInProgress: n, scrollTop: r },
|
|
10452
10455
|
{ isAtBottom: o, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: a },
|
|
10453
10456
|
{ listState: l },
|
|
10454
|
-
{ beforeUnshiftWith: c, gap: d, shiftWithOffset: f, sizes:
|
|
10455
|
-
{ log:
|
|
10457
|
+
{ beforeUnshiftWith: c, gap: d, shiftWithOffset: f, sizes: p },
|
|
10458
|
+
{ log: h },
|
|
10456
10459
|
{ recalcInProgress: m }
|
|
10457
10460
|
]) => {
|
|
10458
10461
|
const g = Yt(
|
|
@@ -10461,14 +10464,14 @@ const hS = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10461
10464
|
Fe(i),
|
|
10462
10465
|
vn(
|
|
10463
10466
|
([, x, w, b], [{ bottom: T, items: S, offsetBottom: C, totalCount: k }, R]) => {
|
|
10464
|
-
const
|
|
10467
|
+
const A = T + C;
|
|
10465
10468
|
let D = 0;
|
|
10466
|
-
return w === k && x.length > 0 && S.length > 0 && (S[0].originalIndex === 0 && x[0].originalIndex === 0 || (D =
|
|
10469
|
+
return w === k && x.length > 0 && S.length > 0 && (S[0].originalIndex === 0 && x[0].originalIndex === 0 || (D = A - b, D !== 0 && (D += R))), [D, S, k, A];
|
|
10467
10470
|
},
|
|
10468
10471
|
[0, [], 0, 0]
|
|
10469
10472
|
),
|
|
10470
10473
|
ke(([x]) => x !== 0),
|
|
10471
|
-
Fe(r, a, n, o,
|
|
10474
|
+
Fe(r, a, n, o, h, m),
|
|
10472
10475
|
ke(([, x, w, b, , , T]) => !T && !b && x !== 0 && w === no),
|
|
10473
10476
|
ce(([[x], , , , , w]) => (w("Upward scrolling compensation", { amount: x }, Ht.DEBUG), x))
|
|
10474
10477
|
)
|
|
@@ -10495,7 +10498,7 @@ const hS = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10495
10498
|
), nt(
|
|
10496
10499
|
W(
|
|
10497
10500
|
c,
|
|
10498
|
-
Fe(
|
|
10501
|
+
Fe(p, d),
|
|
10499
10502
|
ce(([x, { groupIndices: w, lastSize: b, sizeTree: T }, S]) => {
|
|
10500
10503
|
function C(k) {
|
|
10501
10504
|
return k * (b + S);
|
|
@@ -10505,11 +10508,11 @@ const hS = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10505
10508
|
{
|
|
10506
10509
|
let k = 0;
|
|
10507
10510
|
const R = Qr(T, 0);
|
|
10508
|
-
let
|
|
10509
|
-
for (;
|
|
10510
|
-
|
|
10511
|
+
let A = 0, D = 0;
|
|
10512
|
+
for (; A < x; ) {
|
|
10513
|
+
A++, k += R;
|
|
10511
10514
|
let j = w.length === D + 1 ? 1 / 0 : w[D + 1] - w[D] - 1;
|
|
10512
|
-
|
|
10515
|
+
A + j > x && (k -= R, j = x - A + 1), A += j, k += C(j), D++;
|
|
10513
10516
|
}
|
|
10514
10517
|
return k;
|
|
10515
10518
|
}
|
|
@@ -10580,7 +10583,7 @@ const hS = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10580
10583
|
totalCount: d,
|
|
10581
10584
|
trackItemSizes: f
|
|
10582
10585
|
},
|
|
10583
|
-
{ initialItemFinalLocationReached:
|
|
10586
|
+
{ initialItemFinalLocationReached: p, initialTopMostItemIndex: h, scrolledToInitialItem: m },
|
|
10584
10587
|
g,
|
|
10585
10588
|
y,
|
|
10586
10589
|
x,
|
|
@@ -10589,10 +10592,10 @@ const hS = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10589
10592
|
C,
|
|
10590
10593
|
{ topItemCount: k },
|
|
10591
10594
|
{ groupCounts: R },
|
|
10592
|
-
|
|
10593
|
-
]) => (he(T.rangeChanged,
|
|
10595
|
+
A
|
|
10596
|
+
]) => (he(T.rangeChanged, A.scrollSeekRangeChanged), he(
|
|
10594
10597
|
W(
|
|
10595
|
-
|
|
10598
|
+
A.windowViewportRect,
|
|
10596
10599
|
ce((D) => D.visibleHeight)
|
|
10597
10600
|
),
|
|
10598
10601
|
g.viewportHeight
|
|
@@ -10603,8 +10606,8 @@ const hS = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10603
10606
|
fixedItemHeight: r,
|
|
10604
10607
|
gap: o,
|
|
10605
10608
|
groupCounts: R,
|
|
10606
|
-
initialItemFinalLocationReached:
|
|
10607
|
-
initialTopMostItemIndex:
|
|
10609
|
+
initialItemFinalLocationReached: p,
|
|
10610
|
+
initialTopMostItemIndex: h,
|
|
10608
10611
|
scrolledToInitialItem: m,
|
|
10609
10612
|
sizeRanges: a,
|
|
10610
10613
|
topItemCount: k,
|
|
@@ -10622,7 +10625,7 @@ const hS = Pf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10622
10625
|
// exported from stateFlagsSystem
|
|
10623
10626
|
...T,
|
|
10624
10627
|
// the bag of IO from featureGroup1System
|
|
10625
|
-
...
|
|
10628
|
+
...A,
|
|
10626
10629
|
...g,
|
|
10627
10630
|
sizes: l,
|
|
10628
10631
|
...y
|
|
@@ -10691,7 +10694,7 @@ function Of(e, t, n) {
|
|
|
10691
10694
|
}), Q.useImperativeHandle(x, ic(c(T)));
|
|
10692
10695
|
const C = n;
|
|
10693
10696
|
return /* @__PURE__ */ u.jsx(a.Provider, { value: T, children: n ? /* @__PURE__ */ u.jsx(C, { ...xS([...r, ...o, ...i], b), children: w }) : w });
|
|
10694
|
-
}),
|
|
10697
|
+
}), p = (y) => {
|
|
10695
10698
|
const x = Q.useContext(a);
|
|
10696
10699
|
return Q.useCallback(
|
|
10697
10700
|
(w) => {
|
|
@@ -10699,7 +10702,7 @@ function Of(e, t, n) {
|
|
|
10699
10702
|
},
|
|
10700
10703
|
[x, y]
|
|
10701
10704
|
);
|
|
10702
|
-
},
|
|
10705
|
+
}, h = (y) => {
|
|
10703
10706
|
const x = Q.useContext(a)[y], w = Q.useCallback(
|
|
10704
10707
|
(b) => nt(x, b),
|
|
10705
10708
|
[x]
|
|
@@ -10717,7 +10720,7 @@ function Of(e, t, n) {
|
|
|
10717
10720
|
}),
|
|
10718
10721
|
[x, w]
|
|
10719
10722
|
), w;
|
|
10720
|
-
}, g = Q.version.startsWith("18") ?
|
|
10723
|
+
}, g = Q.version.startsWith("18") ? h : m;
|
|
10721
10724
|
return {
|
|
10722
10725
|
Component: f,
|
|
10723
10726
|
useEmitter: (y, x) => {
|
|
@@ -10725,7 +10728,7 @@ function Of(e, t, n) {
|
|
|
10725
10728
|
Ro(() => nt(w, x), [x, w]);
|
|
10726
10729
|
},
|
|
10727
10730
|
useEmitterValue: g,
|
|
10728
|
-
usePublisher:
|
|
10731
|
+
usePublisher: p
|
|
10729
10732
|
};
|
|
10730
10733
|
}
|
|
10731
10734
|
const Df = Q.createContext(void 0), Lf = Q.createContext(void 0), $f = typeof document < "u" ? Q.useLayoutEffect : Q.useEffect;
|
|
@@ -10737,52 +10740,52 @@ function yS(e) {
|
|
|
10737
10740
|
}
|
|
10738
10741
|
function Ff(e, t, n, r = _r, o, s) {
|
|
10739
10742
|
const i = Q.useRef(null), a = Q.useRef(null), l = Q.useRef(null), c = Q.useCallback(
|
|
10740
|
-
(
|
|
10741
|
-
let
|
|
10742
|
-
const y =
|
|
10743
|
+
(p) => {
|
|
10744
|
+
let h, m, g;
|
|
10745
|
+
const y = p.target;
|
|
10743
10746
|
if (yS(y) || xi(y)) {
|
|
10744
10747
|
const w = xi(y) ? y : y.defaultView;
|
|
10745
|
-
g = s ? w.scrollX : w.scrollY,
|
|
10748
|
+
g = s ? w.scrollX : w.scrollY, h = s ? w.document.documentElement.scrollWidth : w.document.documentElement.scrollHeight, m = s ? w.innerWidth : w.innerHeight;
|
|
10746
10749
|
} else
|
|
10747
|
-
g = s ? y.scrollLeft : y.scrollTop,
|
|
10750
|
+
g = s ? y.scrollLeft : y.scrollTop, h = s ? y.scrollWidth : y.scrollHeight, m = s ? y.offsetWidth : y.offsetHeight;
|
|
10748
10751
|
const x = () => {
|
|
10749
10752
|
e({
|
|
10750
|
-
scrollHeight:
|
|
10753
|
+
scrollHeight: h,
|
|
10751
10754
|
scrollTop: Math.max(g, 0),
|
|
10752
10755
|
viewportHeight: m
|
|
10753
10756
|
});
|
|
10754
10757
|
};
|
|
10755
|
-
|
|
10758
|
+
p.suppressFlushSync ? x() : Wc.flushSync(x), a.current !== null && (g === a.current || g <= 0 || g === h - m) && (a.current = null, t(!0), l.current && (clearTimeout(l.current), l.current = null));
|
|
10756
10759
|
},
|
|
10757
10760
|
[e, t, s]
|
|
10758
10761
|
);
|
|
10759
10762
|
Q.useEffect(() => {
|
|
10760
|
-
const
|
|
10761
|
-
return r(o || i.current), c({ suppressFlushSync: !0, target:
|
|
10762
|
-
r(null),
|
|
10763
|
+
const p = o || i.current;
|
|
10764
|
+
return r(o || i.current), c({ suppressFlushSync: !0, target: p }), p.addEventListener("scroll", c, { passive: !0 }), () => {
|
|
10765
|
+
r(null), p.removeEventListener("scroll", c);
|
|
10763
10766
|
};
|
|
10764
10767
|
}, [i, c, n, r, o]);
|
|
10765
|
-
function d(
|
|
10766
|
-
const
|
|
10767
|
-
if (!
|
|
10768
|
+
function d(p) {
|
|
10769
|
+
const h = i.current;
|
|
10770
|
+
if (!h || (s ? "offsetWidth" in h && h.offsetWidth === 0 : "offsetHeight" in h && h.offsetHeight === 0))
|
|
10768
10771
|
return;
|
|
10769
|
-
const m =
|
|
10772
|
+
const m = p.behavior === "smooth";
|
|
10770
10773
|
let g, y, x;
|
|
10771
|
-
xi(
|
|
10772
|
-
$n(
|
|
10773
|
-
s ?
|
|
10774
|
-
), g = s ?
|
|
10774
|
+
xi(h) ? (y = Math.max(
|
|
10775
|
+
$n(h.document.documentElement, s ? "width" : "height"),
|
|
10776
|
+
s ? h.document.documentElement.scrollWidth : h.document.documentElement.scrollHeight
|
|
10777
|
+
), g = s ? h.innerWidth : h.innerHeight, x = s ? window.scrollX : window.scrollY) : (y = h[s ? "scrollWidth" : "scrollHeight"], g = $n(h, s ? "width" : "height"), x = h[s ? "scrollLeft" : "scrollTop"]);
|
|
10775
10778
|
const w = y - g;
|
|
10776
|
-
if (
|
|
10779
|
+
if (p.top = Math.ceil(Math.max(Math.min(w, p.top), 0)), Rf(g, y) || p.top === x) {
|
|
10777
10780
|
e({ scrollHeight: y, scrollTop: x, viewportHeight: g }), m && t(!0);
|
|
10778
10781
|
return;
|
|
10779
10782
|
}
|
|
10780
|
-
m ? (a.current =
|
|
10783
|
+
m ? (a.current = p.top, l.current && clearTimeout(l.current), l.current = setTimeout(() => {
|
|
10781
10784
|
l.current = null, a.current = null, t(!0);
|
|
10782
|
-
}, 1e3)) : a.current = null, s && (
|
|
10785
|
+
}, 1e3)) : a.current = null, s && (p = { behavior: p.behavior, left: p.top }), h.scrollTo(p);
|
|
10783
10786
|
}
|
|
10784
|
-
function f(
|
|
10785
|
-
s && (
|
|
10787
|
+
function f(p) {
|
|
10788
|
+
s && (p = { behavior: p.behavior, left: p.top }), i.current.scrollBy(p);
|
|
10786
10789
|
}
|
|
10787
10790
|
return { scrollByCallback: f, scrollerRef: i, scrollToCallback: d };
|
|
10788
10791
|
}
|
|
@@ -10825,21 +10828,21 @@ const vS = /* @__PURE__ */ Xe(() => {
|
|
|
10825
10828
|
([e, t]) => ({ ...e, ...t }),
|
|
10826
10829
|
dt(Mf, vS)
|
|
10827
10830
|
), bS = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), SS = { overflowAnchor: "none", position: La(), zIndex: 1 }, Bf = { overflowAnchor: "none" }, CS = { ...Bf, display: "inline-block", height: "100%" }, yc = /* @__PURE__ */ Q.memo(function({ showTopList: e = !1 }) {
|
|
10828
|
-
const t = Ee("listState"), n = Qt("sizeRanges"), r = Ee("useWindowScroll"), o = Ee("customScrollParent"), s = Qt("windowScrollContainerState"), i = Qt("scrollContainerState"), a = o || r ? s : i, l = Ee("itemContent"), c = Ee("context"), d = Ee("groupContent"), f = Ee("trackItemSizes"),
|
|
10831
|
+
const t = Ee("listState"), n = Qt("sizeRanges"), r = Ee("useWindowScroll"), o = Ee("customScrollParent"), s = Qt("windowScrollContainerState"), i = Qt("scrollContainerState"), a = o || r ? s : i, l = Ee("itemContent"), c = Ee("context"), d = Ee("groupContent"), f = Ee("trackItemSizes"), p = Ee("itemSize"), h = Ee("log"), m = Qt("gap"), g = Ee("horizontalDirection"), { callbackRef: y } = $0(
|
|
10829
10832
|
n,
|
|
10830
|
-
|
|
10833
|
+
p,
|
|
10831
10834
|
f,
|
|
10832
10835
|
e ? _r : a,
|
|
10833
|
-
|
|
10836
|
+
h,
|
|
10834
10837
|
m,
|
|
10835
10838
|
o,
|
|
10836
10839
|
g,
|
|
10837
10840
|
Ee("skipAnimationFrameInResizeObserver")
|
|
10838
10841
|
), [x, w] = Q.useState(0);
|
|
10839
|
-
Fa("deviation", (
|
|
10840
|
-
x !==
|
|
10842
|
+
Fa("deviation", (E) => {
|
|
10843
|
+
x !== E && w(E);
|
|
10841
10844
|
});
|
|
10842
|
-
const b = Ee("EmptyPlaceholder"), T = Ee("ScrollSeekPlaceholder") || bS, S = Ee("ListComponent"), C = Ee("ItemComponent"), k = Ee("GroupComponent"), R = Ee("computeItemKey"),
|
|
10845
|
+
const b = Ee("EmptyPlaceholder"), T = Ee("ScrollSeekPlaceholder") || bS, S = Ee("ListComponent"), C = Ee("ItemComponent"), k = Ee("GroupComponent"), R = Ee("computeItemKey"), A = Ee("isSeeking"), D = Ee("groupIndices").length > 0, j = Ee("alignToBottom"), M = Ee("initialItemFinalLocationReached"), $ = e ? {} : {
|
|
10843
10846
|
boxSizing: "border-box",
|
|
10844
10847
|
...g ? {
|
|
10845
10848
|
display: "inline-block",
|
|
@@ -10862,42 +10865,42 @@ const vS = /* @__PURE__ */ Xe(() => {
|
|
|
10862
10865
|
"data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
|
|
10863
10866
|
ref: y,
|
|
10864
10867
|
style: $,
|
|
10865
|
-
children: (e ? t.topItems : t.items).map((
|
|
10866
|
-
const F =
|
|
10867
|
-
return
|
|
10868
|
+
children: (e ? t.topItems : t.items).map((E) => {
|
|
10869
|
+
const F = E.originalIndex, N = R(F + t.firstItemIndex, E.data, c);
|
|
10870
|
+
return A ? /* @__PURE__ */ _o(
|
|
10868
10871
|
T,
|
|
10869
10872
|
{
|
|
10870
10873
|
...Ot(T, c),
|
|
10871
|
-
height:
|
|
10872
|
-
index:
|
|
10874
|
+
height: E.size,
|
|
10875
|
+
index: E.index,
|
|
10873
10876
|
key: N,
|
|
10874
|
-
type:
|
|
10875
|
-
...
|
|
10877
|
+
type: E.type || "item",
|
|
10878
|
+
...E.type === "group" ? {} : { groupIndex: E.groupIndex }
|
|
10876
10879
|
}
|
|
10877
|
-
) :
|
|
10880
|
+
) : E.type === "group" ? /* @__PURE__ */ _o(
|
|
10878
10881
|
k,
|
|
10879
10882
|
{
|
|
10880
10883
|
...Ot(k, c),
|
|
10881
10884
|
"data-index": F,
|
|
10882
|
-
"data-item-index":
|
|
10883
|
-
"data-known-size":
|
|
10885
|
+
"data-item-index": E.index,
|
|
10886
|
+
"data-known-size": E.size,
|
|
10884
10887
|
key: N,
|
|
10885
10888
|
style: SS
|
|
10886
10889
|
},
|
|
10887
|
-
d(
|
|
10890
|
+
d(E.index, c)
|
|
10888
10891
|
) : /* @__PURE__ */ _o(
|
|
10889
10892
|
C,
|
|
10890
10893
|
{
|
|
10891
10894
|
...Ot(C, c),
|
|
10892
|
-
...RS(C,
|
|
10895
|
+
...RS(C, E.data),
|
|
10893
10896
|
"data-index": F,
|
|
10894
|
-
"data-item-group-index":
|
|
10895
|
-
"data-item-index":
|
|
10896
|
-
"data-known-size":
|
|
10897
|
+
"data-item-group-index": E.groupIndex,
|
|
10898
|
+
"data-item-index": E.index,
|
|
10899
|
+
"data-known-size": E.size,
|
|
10897
10900
|
key: N,
|
|
10898
10901
|
style: g ? CS : Bf
|
|
10899
10902
|
},
|
|
10900
|
-
D ? l(
|
|
10903
|
+
D ? l(E.index, E.groupIndex, E.data, c) : l(E.index, E.data, c)
|
|
10901
10904
|
);
|
|
10902
10905
|
})
|
|
10903
10906
|
}
|
|
@@ -10958,7 +10961,7 @@ const ES = /* @__PURE__ */ Q.memo(function() {
|
|
|
10958
10961
|
});
|
|
10959
10962
|
function zf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
10960
10963
|
return Q.memo(function({ children: r, style: o, context: s, ...i }) {
|
|
10961
|
-
const a = n("scrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("scrollerRef"), f = t("horizontalDirection") || !1, { scrollByCallback:
|
|
10964
|
+
const a = n("scrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("scrollerRef"), f = t("horizontalDirection") || !1, { scrollByCallback: p, scrollerRef: h, scrollToCallback: m } = Ff(
|
|
10962
10965
|
a,
|
|
10963
10966
|
c,
|
|
10964
10967
|
l,
|
|
@@ -10966,12 +10969,12 @@ function zf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
10966
10969
|
void 0,
|
|
10967
10970
|
f
|
|
10968
10971
|
);
|
|
10969
|
-
return e("scrollTo", m), e("scrollBy",
|
|
10972
|
+
return e("scrollTo", m), e("scrollBy", p), /* @__PURE__ */ u.jsx(
|
|
10970
10973
|
l,
|
|
10971
10974
|
{
|
|
10972
10975
|
"data-testid": "virtuoso-scroller",
|
|
10973
10976
|
"data-virtuoso-scroller": !0,
|
|
10974
|
-
ref:
|
|
10977
|
+
ref: h,
|
|
10975
10978
|
style: { ...f ? kS : TS, ...o },
|
|
10976
10979
|
tabIndex: 0,
|
|
10977
10980
|
...i,
|
|
@@ -10983,22 +10986,22 @@ function zf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
10983
10986
|
}
|
|
10984
10987
|
function Uf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
10985
10988
|
return Q.memo(function({ children: r, style: o, context: s, ...i }) {
|
|
10986
|
-
const a = n("windowScrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("totalListHeight"), f = t("deviation"),
|
|
10989
|
+
const a = n("windowScrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("totalListHeight"), f = t("deviation"), p = t("customScrollParent"), h = Q.useRef(null), m = t("scrollerRef"), { scrollByCallback: g, scrollerRef: y, scrollToCallback: x } = Ff(
|
|
10987
10990
|
a,
|
|
10988
10991
|
c,
|
|
10989
10992
|
l,
|
|
10990
10993
|
m,
|
|
10991
|
-
|
|
10994
|
+
p
|
|
10992
10995
|
);
|
|
10993
10996
|
return $f(() => {
|
|
10994
10997
|
var w;
|
|
10995
|
-
return y.current =
|
|
10998
|
+
return y.current = p || ((w = h.current) == null ? void 0 : w.ownerDocument.defaultView), () => {
|
|
10996
10999
|
y.current = null;
|
|
10997
11000
|
};
|
|
10998
|
-
}, [y,
|
|
11001
|
+
}, [y, p]), e("windowScrollTo", x), e("scrollBy", g), /* @__PURE__ */ u.jsx(
|
|
10999
11002
|
l,
|
|
11000
11003
|
{
|
|
11001
|
-
ref:
|
|
11004
|
+
ref: h,
|
|
11002
11005
|
"data-virtuoso-scroller": !0,
|
|
11003
11006
|
style: { position: "relative", ...o, ...d !== 0 ? { height: d + f } : {} },
|
|
11004
11007
|
...i,
|
|
@@ -11176,13 +11179,13 @@ const US = /* @__PURE__ */ Xe(
|
|
|
11176
11179
|
([
|
|
11177
11180
|
{ increaseViewportBy: e, listBoundary: t, overscan: n, visibleRange: r },
|
|
11178
11181
|
{ footerHeight: o, headerHeight: s, scrollBy: i, scrollContainerState: a, scrollTo: l, scrollTop: c, smoothScrollTargetReached: d, viewportHeight: f },
|
|
11179
|
-
h,
|
|
11180
11182
|
p,
|
|
11183
|
+
h,
|
|
11181
11184
|
{ didMount: m, propsReady: g },
|
|
11182
11185
|
{ customScrollParent: y, useWindowScroll: x, windowScrollContainerState: w, windowScrollTo: b, windowViewportRect: T },
|
|
11183
11186
|
S
|
|
11184
11187
|
]) => {
|
|
11185
|
-
const C = ee(0), k = ee(0), R = ee(vc),
|
|
11188
|
+
const C = ee(0), k = ee(0), R = ee(vc), A = ee({ height: 0, width: 0 }), D = ee({ height: 0, width: 0 }), j = He(), M = He(), $ = ee(0), E = ee(null), F = ee({ column: 0, row: 0 }), N = He(), V = He(), B = ee(!1), _ = ee(0), q = ee(!0), Y = ee(!1), se = ee(!1);
|
|
11186
11189
|
nt(
|
|
11187
11190
|
W(
|
|
11188
11191
|
m,
|
|
@@ -11194,7 +11197,7 @@ const US = /* @__PURE__ */ Xe(
|
|
|
11194
11197
|
}
|
|
11195
11198
|
), nt(
|
|
11196
11199
|
W(
|
|
11197
|
-
Ct(m, q, D,
|
|
11200
|
+
Ct(m, q, D, A, _, Y),
|
|
11198
11201
|
ke(([L, K, J, le, , ie]) => L && !K && J.height !== 0 && le.height !== 0 && !ie)
|
|
11199
11202
|
),
|
|
11200
11203
|
([, , , , L]) => {
|
|
@@ -11218,20 +11221,20 @@ const US = /* @__PURE__ */ Xe(
|
|
|
11218
11221
|
ke(([, L]) => L != null)
|
|
11219
11222
|
),
|
|
11220
11223
|
([, L]) => {
|
|
11221
|
-
L && (Me(
|
|
11224
|
+
L && (Me(A, L.viewport), Me(D, L.item), Me(F, L.gap), L.scrollTop > 0 && (Me(B, !0), cn(W(c, nr(1)), (K) => {
|
|
11222
11225
|
Me(B, !1);
|
|
11223
11226
|
}), Me(l, { top: L.scrollTop })));
|
|
11224
11227
|
}
|
|
11225
11228
|
), he(
|
|
11226
11229
|
W(
|
|
11227
|
-
|
|
11230
|
+
A,
|
|
11228
11231
|
ce(({ height: L }) => L)
|
|
11229
11232
|
),
|
|
11230
11233
|
f
|
|
11231
11234
|
), he(
|
|
11232
11235
|
W(
|
|
11233
11236
|
Ct(
|
|
11234
|
-
Te(
|
|
11237
|
+
Te(A, Eo),
|
|
11235
11238
|
Te(D, Eo),
|
|
11236
11239
|
Te(F, (L, K) => L && L.column === K.column && L.row === K.row),
|
|
11237
11240
|
Te(c)
|
|
@@ -11251,8 +11254,8 @@ const US = /* @__PURE__ */ Xe(
|
|
|
11251
11254
|
r,
|
|
11252
11255
|
Te(F, zS),
|
|
11253
11256
|
Te(D, Eo),
|
|
11254
|
-
Te(
|
|
11255
|
-
Te(
|
|
11257
|
+
Te(A, Eo),
|
|
11258
|
+
Te(E),
|
|
11256
11259
|
Te(k),
|
|
11257
11260
|
Te(B),
|
|
11258
11261
|
Te(q),
|
|
@@ -11290,14 +11293,14 @@ const US = /* @__PURE__ */ Xe(
|
|
|
11290
11293
|
R
|
|
11291
11294
|
), he(
|
|
11292
11295
|
W(
|
|
11293
|
-
|
|
11296
|
+
E,
|
|
11294
11297
|
ke((L) => L !== null),
|
|
11295
11298
|
ce((L) => L.length)
|
|
11296
11299
|
),
|
|
11297
11300
|
C
|
|
11298
11301
|
), he(
|
|
11299
11302
|
W(
|
|
11300
|
-
Ct(
|
|
11303
|
+
Ct(A, D, R, F),
|
|
11301
11304
|
ke(([L, K, { items: J }]) => J.length > 0 && K.height !== 0 && L.height !== 0),
|
|
11302
11305
|
ce(([L, K, { items: J }, le]) => {
|
|
11303
11306
|
const { bottom: ie, top: Ae } = Cc(L, le, K, J);
|
|
@@ -11348,10 +11351,10 @@ const US = /* @__PURE__ */ Xe(
|
|
|
11348
11351
|
In(0)
|
|
11349
11352
|
)
|
|
11350
11353
|
);
|
|
11351
|
-
he(z,
|
|
11354
|
+
he(z, h.scrollSeekRangeChanged), he(
|
|
11352
11355
|
W(
|
|
11353
11356
|
j,
|
|
11354
|
-
Fe(
|
|
11357
|
+
Fe(A, D, C, F),
|
|
11355
11358
|
ce(([L, K, J, le, ie]) => {
|
|
11356
11359
|
const Ae = If(L), { align: Ve, behavior: oe, offset: xe } = Ae;
|
|
11357
11360
|
let Oe = Ae.index;
|
|
@@ -11374,11 +11377,11 @@ const US = /* @__PURE__ */ Xe(
|
|
|
11374
11377
|
T,
|
|
11375
11378
|
ce((L) => ({ height: L.visibleHeight, width: L.visibleWidth }))
|
|
11376
11379
|
),
|
|
11377
|
-
|
|
11380
|
+
A
|
|
11378
11381
|
), {
|
|
11379
11382
|
customScrollParent: y,
|
|
11380
11383
|
// input
|
|
11381
|
-
data:
|
|
11384
|
+
data: E,
|
|
11382
11385
|
deviation: $,
|
|
11383
11386
|
footerHeight: o,
|
|
11384
11387
|
gap: F,
|
|
@@ -11397,17 +11400,17 @@ const US = /* @__PURE__ */ Xe(
|
|
|
11397
11400
|
smoothScrollTargetReached: d,
|
|
11398
11401
|
totalCount: C,
|
|
11399
11402
|
useWindowScroll: x,
|
|
11400
|
-
viewportDimensions:
|
|
11403
|
+
viewportDimensions: A,
|
|
11401
11404
|
windowScrollContainerState: w,
|
|
11402
11405
|
windowScrollTo: b,
|
|
11403
11406
|
windowViewportRect: T,
|
|
11404
|
-
...
|
|
11407
|
+
...h,
|
|
11405
11408
|
// output
|
|
11406
11409
|
gridState: R,
|
|
11407
11410
|
horizontalDirection: se,
|
|
11408
11411
|
initialTopMostItemIndex: _,
|
|
11409
11412
|
totalListHeight: X,
|
|
11410
|
-
...
|
|
11413
|
+
...p,
|
|
11411
11414
|
endReached: Ie,
|
|
11412
11415
|
propsReady: g,
|
|
11413
11416
|
rangeChanged: z,
|
|
@@ -11434,13 +11437,13 @@ function Ki(e, t, n, r) {
|
|
|
11434
11437
|
return i > 0 ? i + t.row : i;
|
|
11435
11438
|
}
|
|
11436
11439
|
const HS = /* @__PURE__ */ Xe(() => {
|
|
11437
|
-
const e = ee((f) => `Item ${f}`), t = ee({}), n = ee(null), r = ee("virtuoso-grid-item"), o = ee("virtuoso-grid-list"), s = ee($a), i = ee("div"), a = ee(_r), l = (f,
|
|
11440
|
+
const e = ee((f) => `Item ${f}`), t = ee({}), n = ee(null), r = ee("virtuoso-grid-item"), o = ee("virtuoso-grid-list"), s = ee($a), i = ee("div"), a = ee(_r), l = (f, p = null) => Dt(
|
|
11438
11441
|
W(
|
|
11439
11442
|
t,
|
|
11440
|
-
ce((
|
|
11443
|
+
ce((h) => h[f]),
|
|
11441
11444
|
ut()
|
|
11442
11445
|
),
|
|
11443
|
-
|
|
11446
|
+
p
|
|
11444
11447
|
), c = ee(!1), d = ee(!1);
|
|
11445
11448
|
return he(Te(d), c), {
|
|
11446
11449
|
components: t,
|
|
@@ -11464,7 +11467,7 @@ const HS = /* @__PURE__ */ Xe(() => {
|
|
|
11464
11467
|
([e, t]) => ({ ...e, ...t }),
|
|
11465
11468
|
dt(US, HS)
|
|
11466
11469
|
), VS = /* @__PURE__ */ Q.memo(function() {
|
|
11467
|
-
const e = ft("gridState"), t = ft("listClassName"), n = ft("itemClassName"), r = ft("itemContent"), o = ft("computeItemKey"), s = ft("isSeeking"), i = en("scrollHeight"), a = ft("ItemComponent"), l = ft("ListComponent"), c = ft("ScrollSeekPlaceholder"), d = ft("context"), f = en("itemDimensions"),
|
|
11470
|
+
const e = ft("gridState"), t = ft("listClassName"), n = ft("itemClassName"), r = ft("itemContent"), o = ft("computeItemKey"), s = ft("isSeeking"), i = en("scrollHeight"), a = ft("ItemComponent"), l = ft("ListComponent"), c = ft("ScrollSeekPlaceholder"), d = ft("context"), f = en("itemDimensions"), p = en("gap"), h = ft("log"), m = ft("stateRestoreInProgress"), g = en("reportReadyState"), y = lr(
|
|
11468
11471
|
Q.useMemo(
|
|
11469
11472
|
() => (x) => {
|
|
11470
11473
|
const w = x.parentElement.parentElement.scrollHeight;
|
|
@@ -11474,12 +11477,12 @@ const HS = /* @__PURE__ */ Xe(() => {
|
|
|
11474
11477
|
const { height: T, width: S } = b.getBoundingClientRect();
|
|
11475
11478
|
f({ height: T, width: S });
|
|
11476
11479
|
}
|
|
11477
|
-
|
|
11478
|
-
column: Tc("column-gap", getComputedStyle(x).columnGap,
|
|
11479
|
-
row: Tc("row-gap", getComputedStyle(x).rowGap,
|
|
11480
|
+
p({
|
|
11481
|
+
column: Tc("column-gap", getComputedStyle(x).columnGap, h),
|
|
11482
|
+
row: Tc("row-gap", getComputedStyle(x).rowGap, h)
|
|
11480
11483
|
});
|
|
11481
11484
|
},
|
|
11482
|
-
[i, f,
|
|
11485
|
+
[i, f, p, h]
|
|
11483
11486
|
),
|
|
11484
11487
|
!0,
|
|
11485
11488
|
!1
|
|
@@ -12243,7 +12246,7 @@ function Wa() {
|
|
|
12243
12246
|
};
|
|
12244
12247
|
}
|
|
12245
12248
|
function AC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
12246
|
-
const [s, i] = ye(!1), [a, l] = ye(null), [c, d] = ye(null), { toast: f } = Wa(),
|
|
12249
|
+
const [s, i] = ye(!1), [a, l] = ye(null), [c, d] = ye(null), { toast: f } = Wa(), p = Q.useCallback(async () => {
|
|
12247
12250
|
if (n) {
|
|
12248
12251
|
i(!0), d(null), l(null);
|
|
12249
12252
|
try {
|
|
@@ -12257,9 +12260,9 @@ function AC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
12257
12260
|
}
|
|
12258
12261
|
}, [n]);
|
|
12259
12262
|
wt(() => {
|
|
12260
|
-
e && n &&
|
|
12261
|
-
}, [e, n,
|
|
12262
|
-
const
|
|
12263
|
+
e && n && p();
|
|
12264
|
+
}, [e, n, p]);
|
|
12265
|
+
const h = async () => {
|
|
12263
12266
|
if (n)
|
|
12264
12267
|
try {
|
|
12265
12268
|
await cC(n), f({ title: "Download started", description: `Downloading ${r}` });
|
|
@@ -12280,7 +12283,7 @@ function AC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
12280
12283
|
] }) : c ? /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
|
|
12281
12284
|
/* @__PURE__ */ u.jsx("div", { className: "text-red-500 mb-4", children: "⚠️" }),
|
|
12282
12285
|
/* @__PURE__ */ u.jsx("p", { className: "text-red-600 mb-4", children: c }),
|
|
12283
|
-
/* @__PURE__ */ u.jsx(tt, { onClick:
|
|
12286
|
+
/* @__PURE__ */ u.jsx(tt, { onClick: p, variant: "outline", children: "Try Again" })
|
|
12284
12287
|
] }) : a ? o.startsWith("image/") ? /* @__PURE__ */ u.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ u.jsx(
|
|
12285
12288
|
"img",
|
|
12286
12289
|
{
|
|
@@ -12337,7 +12340,7 @@ function AC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
12337
12340
|
{
|
|
12338
12341
|
variant: "outline",
|
|
12339
12342
|
size: "sm",
|
|
12340
|
-
onClick:
|
|
12343
|
+
onClick: h,
|
|
12341
12344
|
className: "flex items-center gap-2",
|
|
12342
12345
|
children: [
|
|
12343
12346
|
/* @__PURE__ */ u.jsx(lm, { className: "h-4 w-4" }),
|
|
@@ -12606,7 +12609,7 @@ class Va {
|
|
|
12606
12609
|
list(t) {
|
|
12607
12610
|
let n = this.rules.block.list.exec(t);
|
|
12608
12611
|
if (n) {
|
|
12609
|
-
let r, o, s, i, a, l, c, d, f,
|
|
12612
|
+
let r, o, s, i, a, l, c, d, f, p, h, m, g = n[1].trim();
|
|
12610
12613
|
const y = g.length > 1, x = {
|
|
12611
12614
|
type: "list",
|
|
12612
12615
|
raw: "",
|
|
@@ -12620,34 +12623,34 @@ class Va {
|
|
|
12620
12623
|
for (; t && (m = !1, !(!(n = w.exec(t)) || this.rules.block.hr.test(t))); ) {
|
|
12621
12624
|
if (r = n[0], t = t.substring(r.length), d = n[2].split(`
|
|
12622
12625
|
`, 1)[0].replace(/^\t+/, (T) => " ".repeat(3 * T.length)), f = t.split(`
|
|
12623
|
-
`, 1)[0], this.options.pedantic ? (i = 2,
|
|
12626
|
+
`, 1)[0], this.options.pedantic ? (i = 2, h = d.trimLeft()) : (i = n[2].search(/[^ ]/), i = i > 4 ? 1 : i, h = d.slice(i), i += n[1].length), l = !1, !d && /^ *$/.test(f) && (r += f + `
|
|
12624
12627
|
`, t = t.substring(f.length + 1), m = !0), !m) {
|
|
12625
12628
|
const T = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), S = new RegExp(`^ {0,${Math.min(3, i - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), C = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:\`\`\`|~~~)`), k = new RegExp(`^ {0,${Math.min(3, i - 1)}}#`);
|
|
12626
|
-
for (; t && (
|
|
12627
|
-
`, 1)[0], f =
|
|
12629
|
+
for (; t && (p = t.split(`
|
|
12630
|
+
`, 1)[0], f = p, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(C.test(f) || k.test(f) || T.test(f) || S.test(t))); ) {
|
|
12628
12631
|
if (f.search(/[^ ]/) >= i || !f.trim())
|
|
12629
|
-
|
|
12632
|
+
h += `
|
|
12630
12633
|
` + f.slice(i);
|
|
12631
12634
|
else {
|
|
12632
12635
|
if (l || d.search(/[^ ]/) >= 4 || C.test(d) || k.test(d) || S.test(d))
|
|
12633
12636
|
break;
|
|
12634
|
-
|
|
12637
|
+
h += `
|
|
12635
12638
|
` + f;
|
|
12636
12639
|
}
|
|
12637
|
-
!l && !f.trim() && (l = !0), r +=
|
|
12638
|
-
`, t = t.substring(
|
|
12640
|
+
!l && !f.trim() && (l = !0), r += p + `
|
|
12641
|
+
`, t = t.substring(p.length + 1), d = f.slice(i);
|
|
12639
12642
|
}
|
|
12640
12643
|
}
|
|
12641
|
-
x.loose || (c ? x.loose = !0 : /\n *\n *$/.test(r) && (c = !0)), this.options.gfm && (o = /^\[[ xX]\] /.exec(
|
|
12644
|
+
x.loose || (c ? x.loose = !0 : /\n *\n *$/.test(r) && (c = !0)), this.options.gfm && (o = /^\[[ xX]\] /.exec(h), o && (s = o[0] !== "[ ] ", h = h.replace(/^\[[ xX]\] +/, ""))), x.items.push({
|
|
12642
12645
|
type: "list_item",
|
|
12643
12646
|
raw: r,
|
|
12644
12647
|
task: !!o,
|
|
12645
12648
|
checked: s,
|
|
12646
12649
|
loose: !1,
|
|
12647
|
-
text:
|
|
12650
|
+
text: h
|
|
12648
12651
|
}), x.raw += r;
|
|
12649
12652
|
}
|
|
12650
|
-
x.items[x.items.length - 1].raw = r.trimRight(), x.items[x.items.length - 1].text =
|
|
12653
|
+
x.items[x.items.length - 1].raw = r.trimRight(), x.items[x.items.length - 1].text = h.trimRight(), x.raw = x.raw.trimRight();
|
|
12651
12654
|
const b = x.items.length;
|
|
12652
12655
|
for (a = 0; a < b; a++)
|
|
12653
12656
|
if (this.lexer.state.top = !1, x.items[a].tokens = this.lexer.blockTokens(x.items[a].text, []), !x.loose) {
|
|
@@ -12832,22 +12835,22 @@ class Va {
|
|
|
12832
12835
|
}
|
|
12833
12836
|
if (c -= l, c > 0) continue;
|
|
12834
12837
|
l = Math.min(l, l + c + d);
|
|
12835
|
-
const
|
|
12838
|
+
const p = t.slice(0, i + o.index + (o[0].length - a.length) + l);
|
|
12836
12839
|
if (Math.min(i, l) % 2) {
|
|
12837
|
-
const m =
|
|
12840
|
+
const m = p.slice(1, -1);
|
|
12838
12841
|
return {
|
|
12839
12842
|
type: "em",
|
|
12840
|
-
raw:
|
|
12843
|
+
raw: p,
|
|
12841
12844
|
text: m,
|
|
12842
12845
|
tokens: this.lexer.inlineTokens(m)
|
|
12843
12846
|
};
|
|
12844
12847
|
}
|
|
12845
|
-
const
|
|
12848
|
+
const h = p.slice(2, -2);
|
|
12846
12849
|
return {
|
|
12847
12850
|
type: "strong",
|
|
12848
|
-
raw:
|
|
12849
|
-
text:
|
|
12850
|
-
tokens: this.lexer.inlineTokens(
|
|
12851
|
+
raw: p,
|
|
12852
|
+
text: h,
|
|
12853
|
+
tokens: this.lexer.inlineTokens(h)
|
|
12851
12854
|
};
|
|
12852
12855
|
}
|
|
12853
12856
|
}
|
|
@@ -13277,9 +13280,9 @@ class Fn {
|
|
|
13277
13280
|
if (s = t, this.options.extensions && this.options.extensions.startInline) {
|
|
13278
13281
|
let d = 1 / 0;
|
|
13279
13282
|
const f = t.slice(1);
|
|
13280
|
-
let
|
|
13281
|
-
this.options.extensions.startInline.forEach(function(
|
|
13282
|
-
|
|
13283
|
+
let p;
|
|
13284
|
+
this.options.extensions.startInline.forEach(function(h) {
|
|
13285
|
+
p = h.call({ lexer: this }, f), typeof p == "number" && p >= 0 && (d = Math.min(d, p));
|
|
13283
13286
|
}), d < 1 / 0 && d >= 0 && (s = t.substring(0, d + 1));
|
|
13284
13287
|
}
|
|
13285
13288
|
if (r = this.tokenizer.inlineText(s, VC)) {
|
|
@@ -13531,14 +13534,14 @@ class Bn {
|
|
|
13531
13534
|
* Parse Loop
|
|
13532
13535
|
*/
|
|
13533
13536
|
parse(t, n = !0) {
|
|
13534
|
-
let r = "", o, s, i, a, l, c, d, f,
|
|
13537
|
+
let r = "", o, s, i, a, l, c, d, f, p, h, m, g, y, x, w, b, T, S, C;
|
|
13535
13538
|
const k = t.length;
|
|
13536
13539
|
for (o = 0; o < k; o++) {
|
|
13537
|
-
if (
|
|
13540
|
+
if (h = t[o], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[h.type] && (C = this.options.extensions.renderers[h.type].call({ parser: this }, h), C !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(h.type))) {
|
|
13538
13541
|
r += C || "";
|
|
13539
13542
|
continue;
|
|
13540
13543
|
}
|
|
13541
|
-
switch (
|
|
13544
|
+
switch (h.type) {
|
|
13542
13545
|
case "space":
|
|
13543
13546
|
continue;
|
|
13544
13547
|
case "hr": {
|
|
@@ -13547,68 +13550,68 @@ class Bn {
|
|
|
13547
13550
|
}
|
|
13548
13551
|
case "heading": {
|
|
13549
13552
|
r += this.renderer.heading(
|
|
13550
|
-
this.parseInline(
|
|
13551
|
-
|
|
13552
|
-
bp(this.parseInline(
|
|
13553
|
+
this.parseInline(h.tokens),
|
|
13554
|
+
h.depth,
|
|
13555
|
+
bp(this.parseInline(h.tokens, this.textRenderer)),
|
|
13553
13556
|
this.slugger
|
|
13554
13557
|
);
|
|
13555
13558
|
continue;
|
|
13556
13559
|
}
|
|
13557
13560
|
case "code": {
|
|
13558
13561
|
r += this.renderer.code(
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
+
h.text,
|
|
13563
|
+
h.lang,
|
|
13564
|
+
h.escaped
|
|
13562
13565
|
);
|
|
13563
13566
|
continue;
|
|
13564
13567
|
}
|
|
13565
13568
|
case "table": {
|
|
13566
|
-
for (f = "", d = "", a =
|
|
13569
|
+
for (f = "", d = "", a = h.header.length, s = 0; s < a; s++)
|
|
13567
13570
|
d += this.renderer.tablecell(
|
|
13568
|
-
this.parseInline(
|
|
13569
|
-
{ header: !0, align:
|
|
13571
|
+
this.parseInline(h.header[s].tokens),
|
|
13572
|
+
{ header: !0, align: h.align[s] }
|
|
13570
13573
|
);
|
|
13571
|
-
for (f += this.renderer.tablerow(d),
|
|
13572
|
-
for (c =
|
|
13574
|
+
for (f += this.renderer.tablerow(d), p = "", a = h.rows.length, s = 0; s < a; s++) {
|
|
13575
|
+
for (c = h.rows[s], d = "", l = c.length, i = 0; i < l; i++)
|
|
13573
13576
|
d += this.renderer.tablecell(
|
|
13574
13577
|
this.parseInline(c[i].tokens),
|
|
13575
|
-
{ header: !1, align:
|
|
13578
|
+
{ header: !1, align: h.align[i] }
|
|
13576
13579
|
);
|
|
13577
|
-
|
|
13580
|
+
p += this.renderer.tablerow(d);
|
|
13578
13581
|
}
|
|
13579
|
-
r += this.renderer.table(f,
|
|
13582
|
+
r += this.renderer.table(f, p);
|
|
13580
13583
|
continue;
|
|
13581
13584
|
}
|
|
13582
13585
|
case "blockquote": {
|
|
13583
|
-
|
|
13586
|
+
p = this.parse(h.tokens), r += this.renderer.blockquote(p);
|
|
13584
13587
|
continue;
|
|
13585
13588
|
}
|
|
13586
13589
|
case "list": {
|
|
13587
|
-
for (m =
|
|
13588
|
-
w =
|
|
13590
|
+
for (m = h.ordered, g = h.start, y = h.loose, a = h.items.length, p = "", s = 0; s < a; s++)
|
|
13591
|
+
w = h.items[s], b = w.checked, T = w.task, x = "", w.task && (S = this.renderer.checkbox(b), y ? w.tokens.length > 0 && w.tokens[0].type === "paragraph" ? (w.tokens[0].text = S + " " + w.tokens[0].text, w.tokens[0].tokens && w.tokens[0].tokens.length > 0 && w.tokens[0].tokens[0].type === "text" && (w.tokens[0].tokens[0].text = S + " " + w.tokens[0].tokens[0].text)) : w.tokens.unshift({
|
|
13589
13592
|
type: "text",
|
|
13590
13593
|
text: S
|
|
13591
|
-
}) : x += S), x += this.parse(w.tokens, y),
|
|
13592
|
-
r += this.renderer.list(
|
|
13594
|
+
}) : x += S), x += this.parse(w.tokens, y), p += this.renderer.listitem(x, T, b);
|
|
13595
|
+
r += this.renderer.list(p, m, g);
|
|
13593
13596
|
continue;
|
|
13594
13597
|
}
|
|
13595
13598
|
case "html": {
|
|
13596
|
-
r += this.renderer.html(
|
|
13599
|
+
r += this.renderer.html(h.text);
|
|
13597
13600
|
continue;
|
|
13598
13601
|
}
|
|
13599
13602
|
case "paragraph": {
|
|
13600
|
-
r += this.renderer.paragraph(this.parseInline(
|
|
13603
|
+
r += this.renderer.paragraph(this.parseInline(h.tokens));
|
|
13601
13604
|
continue;
|
|
13602
13605
|
}
|
|
13603
13606
|
case "text": {
|
|
13604
|
-
for (
|
|
13605
|
-
|
|
13606
|
-
` + (
|
|
13607
|
-
r += n ? this.renderer.paragraph(
|
|
13607
|
+
for (p = h.tokens ? this.parseInline(h.tokens) : h.text; o + 1 < k && t[o + 1].type === "text"; )
|
|
13608
|
+
h = t[++o], p += `
|
|
13609
|
+
` + (h.tokens ? this.parseInline(h.tokens) : h.text);
|
|
13610
|
+
r += n ? this.renderer.paragraph(p) : p;
|
|
13608
13611
|
continue;
|
|
13609
13612
|
}
|
|
13610
13613
|
default: {
|
|
13611
|
-
const R = 'Token with "' +
|
|
13614
|
+
const R = 'Token with "' + h.type + '" type was not found.';
|
|
13612
13615
|
if (this.options.silent) {
|
|
13613
13616
|
console.error(R);
|
|
13614
13617
|
return;
|
|
@@ -13747,23 +13750,23 @@ function Tp(e, t) {
|
|
|
13747
13750
|
return i(f);
|
|
13748
13751
|
}
|
|
13749
13752
|
const c = function(f) {
|
|
13750
|
-
let
|
|
13753
|
+
let p;
|
|
13751
13754
|
if (!f)
|
|
13752
13755
|
try {
|
|
13753
|
-
r.walkTokens && ge.walkTokens(l, r.walkTokens),
|
|
13754
|
-
} catch (
|
|
13755
|
-
f =
|
|
13756
|
+
r.walkTokens && ge.walkTokens(l, r.walkTokens), p = t(l, r), r.hooks && (p = r.hooks.postprocess(p));
|
|
13757
|
+
} catch (h) {
|
|
13758
|
+
f = h;
|
|
13756
13759
|
}
|
|
13757
|
-
return r.highlight = a, f ? i(f) : o(null,
|
|
13760
|
+
return r.highlight = a, f ? i(f) : o(null, p);
|
|
13758
13761
|
};
|
|
13759
13762
|
if (!a || a.length < 3 || (delete r.highlight, !l.length)) return c();
|
|
13760
13763
|
let d = 0;
|
|
13761
13764
|
ge.walkTokens(l, function(f) {
|
|
13762
13765
|
f.type === "code" && (d++, setTimeout(() => {
|
|
13763
|
-
a(f.text, f.lang, function(
|
|
13764
|
-
if (
|
|
13765
|
-
return c(
|
|
13766
|
-
|
|
13766
|
+
a(f.text, f.lang, function(p, h) {
|
|
13767
|
+
if (p)
|
|
13768
|
+
return c(p);
|
|
13769
|
+
h != null && h !== f.text && (f.text = h, f.escaped = !0), d--, d === 0 && c();
|
|
13767
13770
|
});
|
|
13768
13771
|
}, 0));
|
|
13769
13772
|
}), d === 0 && c();
|
|
@@ -14213,29 +14216,29 @@ function nT({ message: e, viewMode: t, isStreaming: n = !1 }) {
|
|
|
14213
14216
|
function rT(e) {
|
|
14214
14217
|
const { allowFileOpen: t, currentThreadId: n } = e, { toast: r } = Wa(), [o, s] = ye({}), [i, a] = ye(null), [l, c] = ye(!1), d = ve(() => {
|
|
14215
14218
|
c(!1), a(null);
|
|
14216
|
-
}, []), f = ve((
|
|
14217
|
-
a(
|
|
14218
|
-
}, []),
|
|
14219
|
-
async (
|
|
14219
|
+
}, []), f = ve((h) => {
|
|
14220
|
+
a(h), c(!0);
|
|
14221
|
+
}, []), p = ve(
|
|
14222
|
+
async (h, m, g) => {
|
|
14220
14223
|
var y, x;
|
|
14221
14224
|
if (!t) {
|
|
14222
|
-
|
|
14225
|
+
h.preventDefault();
|
|
14223
14226
|
return;
|
|
14224
14227
|
}
|
|
14225
14228
|
if (o[g]) {
|
|
14226
|
-
|
|
14229
|
+
h.preventDefault();
|
|
14227
14230
|
return;
|
|
14228
14231
|
}
|
|
14229
14232
|
try {
|
|
14230
14233
|
const w = String(m.url ?? ""), b = w.match(/\/chat\/files\/([^/]+)(?:\/(view|download))?/);
|
|
14231
14234
|
if (b) {
|
|
14232
|
-
|
|
14235
|
+
h.preventDefault();
|
|
14233
14236
|
const T = b[1], S = m.name || `file_${T}`, C = m.mimeType || "application/octet-stream";
|
|
14234
14237
|
f({ id: T, name: S, mimeType: C });
|
|
14235
14238
|
return;
|
|
14236
14239
|
}
|
|
14237
14240
|
if (w.startsWith("data:")) {
|
|
14238
|
-
|
|
14241
|
+
h.preventDefault(), s((S) => ({ ...S, [g]: !0 }));
|
|
14239
14242
|
const T = r({ title: "Fetching file...", description: "", open: !0 });
|
|
14240
14243
|
try {
|
|
14241
14244
|
const S = await uC(n ?? void 0);
|
|
@@ -14276,7 +14279,7 @@ function rT(e) {
|
|
|
14276
14279
|
);
|
|
14277
14280
|
return {
|
|
14278
14281
|
uploadingFiles: o,
|
|
14279
|
-
handleFileClick:
|
|
14282
|
+
handleFileClick: p,
|
|
14280
14283
|
fileViewerOpen: l,
|
|
14281
14284
|
currentFileInfo: i,
|
|
14282
14285
|
closeFileViewer: d
|
|
@@ -14359,8 +14362,8 @@ const qa = nm(function({
|
|
|
14359
14362
|
truncateUserMessages: c = !0,
|
|
14360
14363
|
userMessagePreviewLength: d = 500,
|
|
14361
14364
|
showToolMessages: f = !0,
|
|
14362
|
-
showArtifactPreviews:
|
|
14363
|
-
customStyles:
|
|
14365
|
+
showArtifactPreviews: p = !0,
|
|
14366
|
+
customStyles: h = {},
|
|
14364
14367
|
onEdit: m,
|
|
14365
14368
|
onRegenerate: g,
|
|
14366
14369
|
onCancelEdit: y,
|
|
@@ -14372,10 +14375,10 @@ const qa = nm(function({
|
|
|
14372
14375
|
checkpointCandidates: C = [],
|
|
14373
14376
|
activeCheckpointId: k = null,
|
|
14374
14377
|
onSelectCheckpoint: R,
|
|
14375
|
-
defaultCheckpointId:
|
|
14378
|
+
defaultCheckpointId: A = null,
|
|
14376
14379
|
messageParentCheckpointId: D = null
|
|
14377
14380
|
}) {
|
|
14378
|
-
const [j, M] = ye(!1), [$,
|
|
14381
|
+
const [j, M] = ye(!1), [$, E] = ye("preview"), [F, N] = ye(!1), { currentThreadId: V } = aa(), { respondToInterrupt: B } = la(), _ = l === "phone" || l === "half-screen", q = t.role, Y = q === "tool", se = Le(() => "type" in t && t.type === "default_message" ? t : null, [t]), we = !!se, Ie = !(r && q !== "user"), {
|
|
14379
14382
|
uploadingFiles: G,
|
|
14380
14383
|
handleFileClick: z,
|
|
14381
14384
|
fileViewerOpen: X,
|
|
@@ -14434,7 +14437,7 @@ const qa = nm(function({
|
|
|
14434
14437
|
const O = t.content;
|
|
14435
14438
|
return Array.isArray(O) ? rC(O) : "";
|
|
14436
14439
|
}, [se, t]), Ge = Le(() => {
|
|
14437
|
-
if (se || !
|
|
14440
|
+
if (se || !p) return [];
|
|
14438
14441
|
const Z = t.artifact;
|
|
14439
14442
|
if (!Z) return [];
|
|
14440
14443
|
const ne = [], pe = [
|
|
@@ -14445,7 +14448,7 @@ const qa = nm(function({
|
|
|
14445
14448
|
De && ne.push(De);
|
|
14446
14449
|
}
|
|
14447
14450
|
return ne;
|
|
14448
|
-
}, [se, t,
|
|
14451
|
+
}, [se, t, p]), it = ve(async () => {
|
|
14449
14452
|
const O = Y ? Ze : le;
|
|
14450
14453
|
async function Z(ne) {
|
|
14451
14454
|
if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
|
|
@@ -14694,8 +14697,8 @@ const qa = nm(function({
|
|
|
14694
14697
|
J
|
|
14695
14698
|
]), Wt = Le(() => se ? "Assistant" : oC(t), [se, t]), Ue = Le(() => se ? [] : Array.isArray(C) ? C : [], [C, se]), sn = Le(() => {
|
|
14696
14699
|
var O;
|
|
14697
|
-
return Ue.length ?
|
|
14698
|
-
}, [
|
|
14700
|
+
return Ue.length ? A && Ue.some((Z) => Z.id === A) ? A : ((O = Ue[0]) == null ? void 0 : O.id) ?? null : null;
|
|
14701
|
+
}, [A, Ue]), Ke = Le(() => !Ue.length || !k ? null : Ue.some((O) => O.id === k) ? k : null, [k, Ue]) ?? sn, yt = q === "user" && Ue.length > 0 && typeof R == "function", jt = ve(
|
|
14699
14702
|
(O, Z = !1) => {
|
|
14700
14703
|
if (!R) return;
|
|
14701
14704
|
const ne = (O == null ? void 0 : O.id) ?? null, pe = (O == null ? void 0 : O.parentId) ?? D ?? null;
|
|
@@ -14703,7 +14706,7 @@ const qa = nm(function({
|
|
|
14703
14706
|
},
|
|
14704
14707
|
[D, R]
|
|
14705
14708
|
), U = Le(() => Ke ? Ue.findIndex((O) => O.id === Ke) : -1, [Ke, Ue]), re = Le(() => U < 0 ? null : Ue[U] ?? null, [U, Ue]);
|
|
14706
|
-
return Y && !f && Ge.length === 0 ? null : we && se ? /* @__PURE__ */ u.jsx("div", { className: te(Nt(),
|
|
14709
|
+
return Y && !f && Ge.length === 0 ? null : we && se ? /* @__PURE__ */ u.jsx("div", { className: te(Nt(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(gt(), h.content), children: [
|
|
14707
14710
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
|
|
14708
14711
|
/* @__PURE__ */ u.jsx(Zs, { className: te("h-4 w-4", J) }),
|
|
14709
14712
|
a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
|
|
@@ -14716,7 +14719,7 @@ const qa = nm(function({
|
|
|
14716
14719
|
}
|
|
14717
14720
|
)
|
|
14718
14721
|
] }) }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
14719
|
-
/* @__PURE__ */ u.jsx("div", { className: te(Nt(),
|
|
14722
|
+
/* @__PURE__ */ u.jsx("div", { className: te(Nt(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(gt(), h.content), children: [
|
|
14720
14723
|
(i || a || Y) && /* @__PURE__ */ u.jsxs(
|
|
14721
14724
|
"div",
|
|
14722
14725
|
{
|
|
@@ -14724,7 +14727,7 @@ const qa = nm(function({
|
|
|
14724
14727
|
"flex items-center justify-between mb-2 pb-2 border-b border-current/10",
|
|
14725
14728
|
_ && "mb-1 pb-1",
|
|
14726
14729
|
J,
|
|
14727
|
-
|
|
14730
|
+
h.header
|
|
14728
14731
|
),
|
|
14729
14732
|
children: [
|
|
14730
14733
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -14743,9 +14746,9 @@ const qa = nm(function({
|
|
|
14743
14746
|
role: "button",
|
|
14744
14747
|
tabIndex: 0,
|
|
14745
14748
|
"aria-expanded": $ === "expanded",
|
|
14746
|
-
onClick: () =>
|
|
14749
|
+
onClick: () => E((O) => O === "expanded" ? "preview" : "expanded"),
|
|
14747
14750
|
onKeyDown: (O) => {
|
|
14748
|
-
(O.key === "Enter" || O.key === " ") && (O.preventDefault(),
|
|
14751
|
+
(O.key === "Enter" || O.key === " ") && (O.preventDefault(), E((Z) => Z === "expanded" ? "preview" : "expanded"));
|
|
14749
14752
|
},
|
|
14750
14753
|
children: [
|
|
14751
14754
|
/* @__PURE__ */ u.jsx("span", { children: ie.name ?? "Tool Output" }),
|
|
@@ -14818,7 +14821,7 @@ const qa = nm(function({
|
|
|
14818
14821
|
className: te(
|
|
14819
14822
|
"opacity-0 group-hover:opacity-100 transition-opacity",
|
|
14820
14823
|
"flex items-center gap-1",
|
|
14821
|
-
|
|
14824
|
+
h.actions
|
|
14822
14825
|
),
|
|
14823
14826
|
children: [
|
|
14824
14827
|
/* @__PURE__ */ u.jsx("div", { className: "relative", children: /* @__PURE__ */ u.jsx(
|
|
@@ -14864,7 +14867,7 @@ const qa = nm(function({
|
|
|
14864
14867
|
),
|
|
14865
14868
|
/* @__PURE__ */ u.jsxs("div", { className: "relative", children: [
|
|
14866
14869
|
Lt(),
|
|
14867
|
-
|
|
14870
|
+
p && Ge.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "mt-3 space-y-4", children: Ge.map((O, Z) => /* @__PURE__ */ u.jsx(ZC, { preview: O, idx: Z }, `artifact-${Z}`)) })
|
|
14868
14871
|
] }),
|
|
14869
14872
|
Y && $ === "expanded" && (ie.toolCallId || ie.name) && /* @__PURE__ */ u.jsxs("div", { className: te("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", _ && "text-xs"), children: [
|
|
14870
14873
|
ie.name && /* @__PURE__ */ u.jsxs("div", { children: [
|
|
@@ -14882,7 +14885,7 @@ const qa = nm(function({
|
|
|
14882
14885
|
className: te(
|
|
14883
14886
|
"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
14884
14887
|
"flex items-center gap-1",
|
|
14885
|
-
|
|
14888
|
+
h.actions
|
|
14886
14889
|
),
|
|
14887
14890
|
children: [
|
|
14888
14891
|
/* @__PURE__ */ u.jsx(
|
|
@@ -14931,7 +14934,7 @@ const qa = nm(function({
|
|
|
14931
14934
|
)
|
|
14932
14935
|
] });
|
|
14933
14936
|
}, (e, t) => {
|
|
14934
|
-
var l, c, d, f,
|
|
14937
|
+
var l, c, d, f, p, h, m, g;
|
|
14935
14938
|
if (t.isStreamingMessage || e.isStreamingMessage || !(e.message.id === t.message.id && kc(e.message) === kc(t.message))) return !1;
|
|
14936
14939
|
const o = [
|
|
14937
14940
|
"isEditing",
|
|
@@ -14943,7 +14946,7 @@ const qa = nm(function({
|
|
|
14943
14946
|
"userMessagePreviewLength",
|
|
14944
14947
|
"showToolMessages",
|
|
14945
14948
|
"attemptMeta"
|
|
14946
|
-
].every((y) => e[y] === t[y]), s = ((l = e.customStyles) == null ? void 0 : l.container) === ((c = t.customStyles) == null ? void 0 : c.container) && ((d = e.customStyles) == null ? void 0 : d.content) === ((f = t.customStyles) == null ? void 0 : f.content) && ((
|
|
14949
|
+
].every((y) => e[y] === t[y]), s = ((l = e.customStyles) == null ? void 0 : l.container) === ((c = t.customStyles) == null ? void 0 : c.container) && ((d = e.customStyles) == null ? void 0 : d.content) === ((f = t.customStyles) == null ? void 0 : f.content) && ((p = e.customStyles) == null ? void 0 : p.actions) === ((h = t.customStyles) == null ? void 0 : h.actions) && ((m = e.customStyles) == null ? void 0 : m.header) === ((g = t.customStyles) == null ? void 0 : g.header);
|
|
14947
14950
|
if (!o || !s)
|
|
14948
14951
|
return !1;
|
|
14949
14952
|
const i = Mc(e.message), a = Mc(t.message);
|
|
@@ -14952,7 +14955,7 @@ const qa = nm(function({
|
|
|
14952
14955
|
qa.displayName = "MessageComponent";
|
|
14953
14956
|
function iT(e, t) {
|
|
14954
14957
|
return Le(() => {
|
|
14955
|
-
var d, f,
|
|
14958
|
+
var d, f, p, h, m;
|
|
14956
14959
|
const n = e && "type" in e && e.type === "default_message";
|
|
14957
14960
|
let r = [], o = null, s = {}, i = {}, a = null, l = null, c = null;
|
|
14958
14961
|
if (!n && e) {
|
|
@@ -14963,11 +14966,11 @@ function iT(e, t) {
|
|
|
14963
14966
|
const w = typeof s.source == "string" ? s.source : typeof i.source == "string" ? i.source : (x == null ? void 0 : x.source) ?? null;
|
|
14964
14967
|
l = w ? String(w) : null;
|
|
14965
14968
|
const b = a !== null && l ? `${a}:${l}` : null;
|
|
14966
|
-
if (b && ((d = t.checkpointIndexByKey) != null && d.has(b)) ? r = t.checkpointIndexByKey.get(b) ?? [] : y && x && (r = [x]), o = y ?? ((f = r[0]) == null ? void 0 : f.id) ?? null, c = y ? ((
|
|
14969
|
+
if (b && ((d = t.checkpointIndexByKey) != null && d.has(b)) ? r = t.checkpointIndexByKey.get(b) ?? [] : y && x && (r = [x]), o = y ?? ((f = r[0]) == null ? void 0 : f.id) ?? null, c = y ? ((p = t.attemptMetaById) == null ? void 0 : p.get(y)) ?? null : null, !c && (e == null ? void 0 : e.role) === "user" && (e != null && e.id) && t.userMessageIdToAttempts) {
|
|
14967
14970
|
const T = t.userMessageIdToAttempts.get(e.id);
|
|
14968
14971
|
if (T && T.length > 0) {
|
|
14969
14972
|
const S = T[0].checkpointId;
|
|
14970
|
-
c = ((
|
|
14973
|
+
c = ((h = t.attemptMetaById) == null ? void 0 : h.get(S)) ?? null, c && console.log(`[useMessageMetadata] Found attempt by user message ID "${e.id}":`, T.length, "versions");
|
|
14971
14974
|
}
|
|
14972
14975
|
}
|
|
14973
14976
|
if (!c && r.length > 0 && t.attemptMetaById) {
|
|
@@ -15029,8 +15032,8 @@ const Ep = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Ap = Q.memo(
|
|
|
15029
15032
|
onEdit: c,
|
|
15030
15033
|
onRegenerate: d,
|
|
15031
15034
|
onCancelEdit: f,
|
|
15032
|
-
activeInterrupt:
|
|
15033
|
-
disableInterruptActions:
|
|
15035
|
+
activeInterrupt: p,
|
|
15036
|
+
disableInterruptActions: h,
|
|
15034
15037
|
onInterruptActionStart: m,
|
|
15035
15038
|
onInterruptActionEnd: g,
|
|
15036
15039
|
showToolMessages: y,
|
|
@@ -15042,16 +15045,16 @@ const Ep = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Ap = Q.memo(
|
|
|
15042
15045
|
activeCheckpointId: C,
|
|
15043
15046
|
onSelectCheckpoint: k
|
|
15044
15047
|
}) {
|
|
15045
|
-
const R = Ep(t, n),
|
|
15048
|
+
const R = Ep(t, n), A = "type" in t && t.type === "default_message", { checkpointCandidates: D, defaultCheckpointId: j, attemptMeta: M } = iT(t, {
|
|
15046
15049
|
checkpointMetaById: w,
|
|
15047
15050
|
checkpointIndexByKey: b,
|
|
15048
15051
|
attemptMetaById: T,
|
|
15049
15052
|
userMessageIdToAttempts: S
|
|
15050
|
-
}), $ = t && !
|
|
15053
|
+
}), $ = t && !A ? t.additionalKwargs ?? {} : {}, E = t && !A ? t.responseMetadata ?? {} : {}, F = (() => {
|
|
15051
15054
|
if (typeof $.parentCheckpointId == "string")
|
|
15052
15055
|
return $.parentCheckpointId;
|
|
15053
|
-
if (typeof
|
|
15054
|
-
return
|
|
15056
|
+
if (typeof E.parentCheckpointId == "string")
|
|
15057
|
+
return E.parentCheckpointId;
|
|
15055
15058
|
})();
|
|
15056
15059
|
return /* @__PURE__ */ u.jsx(
|
|
15057
15060
|
"div",
|
|
@@ -15077,8 +15080,8 @@ const Ep = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Ap = Q.memo(
|
|
|
15077
15080
|
onEdit: c,
|
|
15078
15081
|
onRegenerate: () => d(n),
|
|
15079
15082
|
onCancelEdit: f,
|
|
15080
|
-
activeInterrupt:
|
|
15081
|
-
disableInterruptActions:
|
|
15083
|
+
activeInterrupt: p,
|
|
15084
|
+
disableInterruptActions: h,
|
|
15082
15085
|
onInterruptActionStart: m,
|
|
15083
15086
|
onInterruptActionEnd: g,
|
|
15084
15087
|
showToolMessages: y,
|
|
@@ -15108,8 +15111,8 @@ const Np = Q.forwardRef(({
|
|
|
15108
15111
|
onRegenerate: c,
|
|
15109
15112
|
onCancelEdit: d,
|
|
15110
15113
|
className: f,
|
|
15111
|
-
style:
|
|
15112
|
-
emptyMessage:
|
|
15114
|
+
style: p,
|
|
15115
|
+
emptyMessage: h,
|
|
15113
15116
|
followNewMessages: m = !0,
|
|
15114
15117
|
isNavigatingCheckpoint: g = !1,
|
|
15115
15118
|
onScrollAway: y,
|
|
@@ -15121,12 +15124,12 @@ const Np = Q.forwardRef(({
|
|
|
15121
15124
|
showToolMessages: C = !0,
|
|
15122
15125
|
showArtifactPreviews: k = !0,
|
|
15123
15126
|
checkpointMetaById: R,
|
|
15124
|
-
checkpointIndexByKey:
|
|
15127
|
+
checkpointIndexByKey: A,
|
|
15125
15128
|
attemptMetaById: D,
|
|
15126
15129
|
userMessageIdToAttempts: j,
|
|
15127
15130
|
activeCheckpointId: M,
|
|
15128
15131
|
onSelectCheckpoint: $,
|
|
15129
|
-
createSyntheticThinkingMessage:
|
|
15132
|
+
createSyntheticThinkingMessage: E = !1
|
|
15130
15133
|
}, F) => {
|
|
15131
15134
|
const N = $e(null), V = $e(null), B = $e(!1), _ = $e(!1), [q, Y] = ye(!0), se = Le(() => w ? e.some((oe) => "type" in oe && oe.type === "default_message" ? !1 : Array.isArray(oe == null ? void 0 : oe.content) && oe.content.some(
|
|
15132
15135
|
(xe) => xe && xe.type === "interrupt" && (xe.id ?? xe.interrupt_id) === w.id
|
|
@@ -15153,7 +15156,7 @@ const Np = Q.forwardRef(({
|
|
|
15153
15156
|
}
|
|
15154
15157
|
]
|
|
15155
15158
|
};
|
|
15156
|
-
}, [w, se]), Ie = Le(() => we ? [...e, we] : e, [e, we]), G = Le(() => !
|
|
15159
|
+
}, [w, se]), Ie = Le(() => we ? [...e, we] : e, [e, we]), G = Le(() => !E || !t ? Ie : !Ie.some((xe) => xe.role === "assistant") && Ie.length > 0 ? [
|
|
15157
15160
|
...Ie,
|
|
15158
15161
|
{
|
|
15159
15162
|
id: "thinking-assistant",
|
|
@@ -15161,7 +15164,7 @@ const Np = Q.forwardRef(({
|
|
|
15161
15164
|
content: [],
|
|
15162
15165
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
15163
15166
|
}
|
|
15164
|
-
] : Ie, [Ie, t,
|
|
15167
|
+
] : Ie, [Ie, t, E]), z = Le(() => C ? G : G.filter((oe) => (oe == null ? void 0 : oe.role) !== "tool"), [G, C]), X = ve((oe) => {
|
|
15165
15168
|
Y(oe), y && y(!oe), x && x(oe);
|
|
15166
15169
|
}, [y, x]), L = Le(() => {
|
|
15167
15170
|
if (a)
|
|
@@ -15176,8 +15179,8 @@ const Np = Q.forwardRef(({
|
|
|
15176
15179
|
}
|
|
15177
15180
|
};
|
|
15178
15181
|
}, [a]), K = Le(() => !m || g ? !1 : q ? "auto" : !1, [q, m, g]), J = Le(() => {
|
|
15179
|
-
if (typeof
|
|
15180
|
-
const oe =
|
|
15182
|
+
if (typeof h != "string") return null;
|
|
15183
|
+
const oe = h.trim();
|
|
15181
15184
|
return oe ? {
|
|
15182
15185
|
id: "default-message",
|
|
15183
15186
|
role: "assistant",
|
|
@@ -15185,7 +15188,7 @@ const Np = Q.forwardRef(({
|
|
|
15185
15188
|
content: oe,
|
|
15186
15189
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
15187
15190
|
} : null;
|
|
15188
|
-
}, [
|
|
15191
|
+
}, [h]), le = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), ie = () => J ? /* @__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(
|
|
15189
15192
|
qa,
|
|
15190
15193
|
{
|
|
15191
15194
|
message: J,
|
|
@@ -15203,7 +15206,7 @@ const Np = Q.forwardRef(({
|
|
|
15203
15206
|
},
|
|
15204
15207
|
showArtifactPreviews: k
|
|
15205
15208
|
}
|
|
15206
|
-
) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children:
|
|
15209
|
+
) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: h ?? "No messages yet. Start a conversation!" }), Ae = z.length, Ve = Ae > 0;
|
|
15207
15210
|
return wt(() => {
|
|
15208
15211
|
var oe, xe;
|
|
15209
15212
|
if (Ae === 0) {
|
|
@@ -15239,7 +15242,7 @@ const Np = Q.forwardRef(({
|
|
|
15239
15242
|
}
|
|
15240
15243
|
}),
|
|
15241
15244
|
[z]
|
|
15242
|
-
), /* @__PURE__ */ u.jsx("div", { className: le, style:
|
|
15245
|
+
), /* @__PURE__ */ u.jsx("div", { className: le, style: p, children: /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: Ve ? /* @__PURE__ */ u.jsx(
|
|
15243
15246
|
LS,
|
|
15244
15247
|
{
|
|
15245
15248
|
ref: (oe) => {
|
|
@@ -15281,7 +15284,7 @@ const Np = Q.forwardRef(({
|
|
|
15281
15284
|
showToolMessages: C,
|
|
15282
15285
|
showArtifactPreviews: k,
|
|
15283
15286
|
checkpointMetaById: R,
|
|
15284
|
-
checkpointIndexByKey:
|
|
15287
|
+
checkpointIndexByKey: A,
|
|
15285
15288
|
attemptMetaById: D,
|
|
15286
15289
|
userMessageIdToAttempts: j,
|
|
15287
15290
|
activeCheckpointId: M,
|
|
@@ -15308,8 +15311,8 @@ function Si({
|
|
|
15308
15311
|
enableMessageEditing: c = !0,
|
|
15309
15312
|
showToolMessages: d = !0,
|
|
15310
15313
|
showArtifactPreviews: f = !0,
|
|
15311
|
-
customStyles:
|
|
15312
|
-
onMessageSent:
|
|
15314
|
+
customStyles: p = {},
|
|
15315
|
+
onMessageSent: h,
|
|
15313
15316
|
onExcelUploadSuccess: m,
|
|
15314
15317
|
onError: g
|
|
15315
15318
|
}) {
|
|
@@ -15321,12 +15324,12 @@ function Si({
|
|
|
15321
15324
|
navigateToCheckpoint: C,
|
|
15322
15325
|
returnToLatest: k,
|
|
15323
15326
|
checkpoint: R,
|
|
15324
|
-
checkpoints:
|
|
15327
|
+
checkpoints: A,
|
|
15325
15328
|
interrupt: D,
|
|
15326
15329
|
metadata: j,
|
|
15327
15330
|
timelineCheckpoints: M,
|
|
15328
15331
|
messagePreviews: $
|
|
15329
|
-
} = la(), { isStreaming:
|
|
15332
|
+
} = la(), { isStreaming: E, error: F, connectionState: N, submit: V, stop: B } = ly(), _ = w ?? x ?? null, q = (R == null ? void 0 : R.id) ?? null, Y = (R == null ? void 0 : R.namespace) ?? null, se = (j == null ? void 0 : j.assemblingMessageId) ?? null, we = D, [Ie, G] = ye(!1);
|
|
15330
15333
|
wt(() => {
|
|
15331
15334
|
we || G(!1);
|
|
15332
15335
|
}, [we]);
|
|
@@ -15336,7 +15339,7 @@ function Si({
|
|
|
15336
15339
|
G(!1);
|
|
15337
15340
|
}, []), L = !!we || Ie, [K, J] = ye(null), [le, ie] = ye(""), [Ae, Ve] = ye(null), [oe, xe] = ye(null), [Oe, Je] = ye([]), [ot, Ze] = ye(0), [Ge, it] = ye(0), [Qe, et] = ye(!1), [ct, Nt] = ye(null), [gt, ht] = ye(null), [xt, Tt] = ye(!1), [_t, Lt] = ye(null), Wt = $e(!1), [Ue, sn] = ye(() => Oc.value), st = $e(Ue), Ke = $e(null), yt = ve((fe) => {
|
|
15338
15341
|
Oc.value = fe, sn(fe);
|
|
15339
|
-
}, []), [jt, U] = ye(!1), re = $e(null), { checkpointMetaById: O, checkpointIndexByKey: Z, attemptMetaById: ne, userMessageIdToAttempts: pe } = T0(
|
|
15342
|
+
}, []), [jt, U] = ye(!1), re = $e(null), { checkpointMetaById: O, checkpointIndexByKey: Z, attemptMetaById: ne, userMessageIdToAttempts: pe } = T0(A), me = M ?? [], De = $e(null), je = $e(null), Ne = ve(() => {
|
|
15340
15343
|
De.current && (De.current.value = ""), je.current && (je.current.value = ""), Ze((fe) => fe + 1), it((fe) => fe + 1);
|
|
15341
15344
|
}, []), Vt = ve(
|
|
15342
15345
|
(fe) => {
|
|
@@ -15345,8 +15348,8 @@ function Si({
|
|
|
15345
15348
|
[yt]
|
|
15346
15349
|
), kn = $e(!1);
|
|
15347
15350
|
wt(() => {
|
|
15348
|
-
kn.current && !
|
|
15349
|
-
}, [
|
|
15351
|
+
kn.current && !E && (Je([]), Ne()), kn.current = E;
|
|
15352
|
+
}, [E, Ne]);
|
|
15350
15353
|
const [Kn, dr] = ye("desktop");
|
|
15351
15354
|
wt(() => {
|
|
15352
15355
|
const fe = () => {
|
|
@@ -15411,7 +15414,7 @@ function Si({
|
|
|
15411
15414
|
edit: !!K,
|
|
15412
15415
|
originalMessageId: K ?? void 0
|
|
15413
15416
|
}
|
|
15414
|
-
),
|
|
15417
|
+
), h == null || h(Ce), yt(""), xe(null), Je([]), Ne(), J(null), ie(""), Ve(null);
|
|
15415
15418
|
} catch (Re) {
|
|
15416
15419
|
const qe = (Re == null ? void 0 : Re.message) || "Failed to send message";
|
|
15417
15420
|
xe(qe), g == null || g(qe);
|
|
@@ -15496,7 +15499,7 @@ function Si({
|
|
|
15496
15499
|
});
|
|
15497
15500
|
return;
|
|
15498
15501
|
}
|
|
15499
|
-
const Ce =
|
|
15502
|
+
const Ce = A.find((qe) => qe.checkpointId === fe), Re = (Ce == null ? void 0 : Ce.checkpointNs) ?? null;
|
|
15500
15503
|
await C(fe, Re), requestAnimationFrame(() => {
|
|
15501
15504
|
var qe;
|
|
15502
15505
|
(qe = re.current) == null || qe.scrollToTop();
|
|
@@ -15510,7 +15513,7 @@ function Si({
|
|
|
15510
15513
|
await ze(Re ? null : fe);
|
|
15511
15514
|
},
|
|
15512
15515
|
[ze]
|
|
15513
|
-
), It = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${
|
|
15516
|
+
), It = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${p.container || ""}`, mt = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 bg-transparent ${p.messagesArea || ""}`, vt = `relative flex-shrink-0 w-full border-t p-4 bg-transparent ${p.inputArea || ""}`;
|
|
15514
15517
|
return /* @__PURE__ */ u.jsxs("div", { className: It, children: [
|
|
15515
15518
|
!!F && !xt && /* @__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: [
|
|
15516
15519
|
/* @__PURE__ */ u.jsx("span", { children: F }),
|
|
@@ -15539,7 +15542,7 @@ function Si({
|
|
|
15539
15542
|
className: "h-full",
|
|
15540
15543
|
style: { height: "100%" },
|
|
15541
15544
|
messages: b,
|
|
15542
|
-
isStreaming:
|
|
15545
|
+
isStreaming: E,
|
|
15543
15546
|
streamingAssistantId: se,
|
|
15544
15547
|
streamingDebounceMs: typeof s == "number" ? s : o,
|
|
15545
15548
|
followNewMessages: i,
|
|
@@ -15658,9 +15661,9 @@ function Si({
|
|
|
15658
15661
|
type: "button",
|
|
15659
15662
|
size: "icon",
|
|
15660
15663
|
variant: "outline",
|
|
15661
|
-
disabled:
|
|
15664
|
+
disabled: E || L,
|
|
15662
15665
|
title: "More input actions",
|
|
15663
|
-
className:
|
|
15666
|
+
className: p.moreButton || "",
|
|
15664
15667
|
children: /* @__PURE__ */ u.jsx(pm, { size: 16 })
|
|
15665
15668
|
}
|
|
15666
15669
|
) }),
|
|
@@ -15696,14 +15699,14 @@ function Si({
|
|
|
15696
15699
|
value: Ue,
|
|
15697
15700
|
onValueChange: Vt,
|
|
15698
15701
|
placeholder: K ? "Edit your message..." : t,
|
|
15699
|
-
isStreaming:
|
|
15702
|
+
isStreaming: E,
|
|
15700
15703
|
disabled: L,
|
|
15701
15704
|
maxLength: Bo,
|
|
15702
15705
|
onSend: jn,
|
|
15703
15706
|
onCancelEdit: I,
|
|
15704
15707
|
onStop: B,
|
|
15705
15708
|
allowEmptySend: Oe.length > 0,
|
|
15706
|
-
textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${K ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${oe ? "border-red-400" : ""} ${
|
|
15709
|
+
textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${K ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${oe ? "border-red-400" : ""} ${p.textarea || ""}`
|
|
15707
15710
|
}
|
|
15708
15711
|
) })
|
|
15709
15712
|
] })
|
|
@@ -15739,7 +15742,7 @@ var Ga = "ScrollArea", [_p, Yk] = _n(Ga), [lT, on] = _p(Ga), jp = v.forwardRef(
|
|
|
15739
15742
|
dir: o,
|
|
15740
15743
|
scrollHideDelay: s = 600,
|
|
15741
15744
|
...i
|
|
15742
|
-
} = e, [a, l] = v.useState(null), [c, d] = v.useState(null), [f,
|
|
15745
|
+
} = e, [a, l] = v.useState(null), [c, d] = v.useState(null), [f, p] = v.useState(null), [h, m] = v.useState(null), [g, y] = v.useState(null), [x, w] = v.useState(0), [b, T] = v.useState(0), [S, C] = v.useState(!1), [k, R] = v.useState(!1), A = We(t, (j) => l(j)), D = Cs(o);
|
|
15743
15746
|
return /* @__PURE__ */ u.jsx(
|
|
15744
15747
|
lT,
|
|
15745
15748
|
{
|
|
@@ -15751,8 +15754,8 @@ var Ga = "ScrollArea", [_p, Yk] = _n(Ga), [lT, on] = _p(Ga), jp = v.forwardRef(
|
|
|
15751
15754
|
viewport: c,
|
|
15752
15755
|
onViewportChange: d,
|
|
15753
15756
|
content: f,
|
|
15754
|
-
onContentChange:
|
|
15755
|
-
scrollbarX:
|
|
15757
|
+
onContentChange: p,
|
|
15758
|
+
scrollbarX: h,
|
|
15756
15759
|
onScrollbarXChange: m,
|
|
15757
15760
|
scrollbarXEnabled: S,
|
|
15758
15761
|
onScrollbarXEnabledChange: C,
|
|
@@ -15767,7 +15770,7 @@ var Ga = "ScrollArea", [_p, Yk] = _n(Ga), [lT, on] = _p(Ga), jp = v.forwardRef(
|
|
|
15767
15770
|
{
|
|
15768
15771
|
dir: D,
|
|
15769
15772
|
...i,
|
|
15770
|
-
ref:
|
|
15773
|
+
ref: A,
|
|
15771
15774
|
style: {
|
|
15772
15775
|
position: "relative",
|
|
15773
15776
|
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
@@ -15884,11 +15887,11 @@ var cT = v.forwardRef((e, t) => {
|
|
|
15884
15887
|
const c = o.viewport, d = s ? "scrollLeft" : "scrollTop";
|
|
15885
15888
|
if (c) {
|
|
15886
15889
|
let f = c[d];
|
|
15887
|
-
const
|
|
15888
|
-
const
|
|
15889
|
-
f !==
|
|
15890
|
+
const p = () => {
|
|
15891
|
+
const h = c[d];
|
|
15892
|
+
f !== h && (l("SCROLL"), i()), f = h;
|
|
15890
15893
|
};
|
|
15891
|
-
return c.addEventListener("scroll",
|
|
15894
|
+
return c.addEventListener("scroll", p), () => c.removeEventListener("scroll", p);
|
|
15892
15895
|
}
|
|
15893
15896
|
}, [o.viewport, s, l, i]), /* @__PURE__ */ u.jsx(rn, { present: n || a !== "hidden", children: /* @__PURE__ */ u.jsx(
|
|
15894
15897
|
Xa,
|
|
@@ -15925,12 +15928,12 @@ var cT = v.forwardRef((e, t) => {
|
|
|
15925
15928
|
sizes: a,
|
|
15926
15929
|
onSizesChange: l,
|
|
15927
15930
|
hasThumb: c > 0 && c < 1,
|
|
15928
|
-
onThumbChange: (
|
|
15931
|
+
onThumbChange: (p) => s.current = p,
|
|
15929
15932
|
onThumbPointerUp: () => i.current = 0,
|
|
15930
|
-
onThumbPointerDown: (
|
|
15933
|
+
onThumbPointerDown: (p) => i.current = p
|
|
15931
15934
|
};
|
|
15932
|
-
function f(
|
|
15933
|
-
return gT(
|
|
15935
|
+
function f(p, h) {
|
|
15936
|
+
return gT(p, i.current, a, h);
|
|
15934
15937
|
}
|
|
15935
15938
|
return n === "horizontal" ? /* @__PURE__ */ u.jsx(
|
|
15936
15939
|
dT,
|
|
@@ -15939,15 +15942,15 @@ var cT = v.forwardRef((e, t) => {
|
|
|
15939
15942
|
ref: t,
|
|
15940
15943
|
onThumbPositionChange: () => {
|
|
15941
15944
|
if (o.viewport && s.current) {
|
|
15942
|
-
const
|
|
15943
|
-
s.current.style.transform = `translate3d(${
|
|
15945
|
+
const p = o.viewport.scrollLeft, h = Dc(p, a, o.dir);
|
|
15946
|
+
s.current.style.transform = `translate3d(${h}px, 0, 0)`;
|
|
15944
15947
|
}
|
|
15945
15948
|
},
|
|
15946
|
-
onWheelScroll: (
|
|
15947
|
-
o.viewport && (o.viewport.scrollLeft =
|
|
15949
|
+
onWheelScroll: (p) => {
|
|
15950
|
+
o.viewport && (o.viewport.scrollLeft = p);
|
|
15948
15951
|
},
|
|
15949
|
-
onDragScroll: (
|
|
15950
|
-
o.viewport && (o.viewport.scrollLeft = f(
|
|
15952
|
+
onDragScroll: (p) => {
|
|
15953
|
+
o.viewport && (o.viewport.scrollLeft = f(p, o.dir));
|
|
15951
15954
|
}
|
|
15952
15955
|
}
|
|
15953
15956
|
) : n === "vertical" ? /* @__PURE__ */ u.jsx(
|
|
@@ -15957,15 +15960,15 @@ var cT = v.forwardRef((e, t) => {
|
|
|
15957
15960
|
ref: t,
|
|
15958
15961
|
onThumbPositionChange: () => {
|
|
15959
15962
|
if (o.viewport && s.current) {
|
|
15960
|
-
const
|
|
15961
|
-
s.current.style.transform = `translate3d(0, ${
|
|
15963
|
+
const p = o.viewport.scrollTop, h = Dc(p, a);
|
|
15964
|
+
s.current.style.transform = `translate3d(0, ${h}px, 0)`;
|
|
15962
15965
|
}
|
|
15963
15966
|
},
|
|
15964
|
-
onWheelScroll: (
|
|
15965
|
-
o.viewport && (o.viewport.scrollTop =
|
|
15967
|
+
onWheelScroll: (p) => {
|
|
15968
|
+
o.viewport && (o.viewport.scrollTop = p);
|
|
15966
15969
|
},
|
|
15967
|
-
onDragScroll: (
|
|
15968
|
-
o.viewport && (o.viewport.scrollTop = f(
|
|
15970
|
+
onDragScroll: (p) => {
|
|
15971
|
+
o.viewport && (o.viewport.scrollTop = f(p));
|
|
15969
15972
|
}
|
|
15970
15973
|
}
|
|
15971
15974
|
) : null;
|
|
@@ -15991,8 +15994,8 @@ var cT = v.forwardRef((e, t) => {
|
|
|
15991
15994
|
onDragScroll: (d) => e.onDragScroll(d.x),
|
|
15992
15995
|
onWheelScroll: (d, f) => {
|
|
15993
15996
|
if (s.viewport) {
|
|
15994
|
-
const
|
|
15995
|
-
e.onWheelScroll(
|
|
15997
|
+
const p = s.viewport.scrollLeft + d.deltaX;
|
|
15998
|
+
e.onWheelScroll(p), Up(p, f) && d.preventDefault();
|
|
15996
15999
|
}
|
|
15997
16000
|
},
|
|
15998
16001
|
onResize: () => {
|
|
@@ -16031,8 +16034,8 @@ var cT = v.forwardRef((e, t) => {
|
|
|
16031
16034
|
onDragScroll: (d) => e.onDragScroll(d.y),
|
|
16032
16035
|
onWheelScroll: (d, f) => {
|
|
16033
16036
|
if (s.viewport) {
|
|
16034
|
-
const
|
|
16035
|
-
e.onWheelScroll(
|
|
16037
|
+
const p = s.viewport.scrollTop + d.deltaY;
|
|
16038
|
+
e.onWheelScroll(p), Up(p, f) && d.preventDefault();
|
|
16036
16039
|
}
|
|
16037
16040
|
},
|
|
16038
16041
|
onResize: () => {
|
|
@@ -16060,21 +16063,21 @@ var cT = v.forwardRef((e, t) => {
|
|
|
16060
16063
|
onDragScroll: c,
|
|
16061
16064
|
onWheelScroll: d,
|
|
16062
16065
|
onResize: f,
|
|
16063
|
-
...
|
|
16064
|
-
} = e,
|
|
16065
|
-
function R(
|
|
16066
|
+
...p
|
|
16067
|
+
} = e, h = on(Tn, n), [m, g] = v.useState(null), y = We(t, (A) => g(A)), x = v.useRef(null), w = v.useRef(""), b = h.viewport, T = r.content - r.viewport, S = Et(d), C = Et(l), k = qs(f, 10);
|
|
16068
|
+
function R(A) {
|
|
16066
16069
|
if (x.current) {
|
|
16067
|
-
const D =
|
|
16070
|
+
const D = A.clientX - x.current.left, j = A.clientY - x.current.top;
|
|
16068
16071
|
c({ x: D, y: j });
|
|
16069
16072
|
}
|
|
16070
16073
|
}
|
|
16071
16074
|
return v.useEffect(() => {
|
|
16072
|
-
const
|
|
16075
|
+
const A = (D) => {
|
|
16073
16076
|
const j = D.target;
|
|
16074
16077
|
(m == null ? void 0 : m.contains(j)) && S(D, T);
|
|
16075
16078
|
};
|
|
16076
|
-
return document.addEventListener("wheel",
|
|
16077
|
-
}, [b, m, T, S]), v.useEffect(C, [r, C]), kr(m, k), kr(
|
|
16079
|
+
return document.addEventListener("wheel", A, { passive: !1 }), () => document.removeEventListener("wheel", A, { passive: !1 });
|
|
16080
|
+
}, [b, m, T, S]), v.useEffect(C, [r, C]), kr(m, k), kr(h.content, k), /* @__PURE__ */ u.jsx(
|
|
16078
16081
|
pT,
|
|
16079
16082
|
{
|
|
16080
16083
|
scope: n,
|
|
@@ -16087,16 +16090,16 @@ var cT = v.forwardRef((e, t) => {
|
|
|
16087
16090
|
children: /* @__PURE__ */ u.jsx(
|
|
16088
16091
|
_e.div,
|
|
16089
16092
|
{
|
|
16090
|
-
...
|
|
16093
|
+
...p,
|
|
16091
16094
|
ref: y,
|
|
16092
|
-
style: { position: "absolute", ...
|
|
16093
|
-
onPointerDown: de(e.onPointerDown, (
|
|
16094
|
-
|
|
16095
|
+
style: { position: "absolute", ...p.style },
|
|
16096
|
+
onPointerDown: de(e.onPointerDown, (A) => {
|
|
16097
|
+
A.button === 0 && (A.target.setPointerCapture(A.pointerId), x.current = m.getBoundingClientRect(), w.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", h.viewport && (h.viewport.style.scrollBehavior = "auto"), R(A));
|
|
16095
16098
|
}),
|
|
16096
16099
|
onPointerMove: de(e.onPointerMove, R),
|
|
16097
|
-
onPointerUp: de(e.onPointerUp, (
|
|
16098
|
-
const D =
|
|
16099
|
-
D.hasPointerCapture(
|
|
16100
|
+
onPointerUp: de(e.onPointerUp, (A) => {
|
|
16101
|
+
const D = A.target;
|
|
16102
|
+
D.hasPointerCapture(A.pointerId) && D.releasePointerCapture(A.pointerId), document.body.style.webkitUserSelect = w.current, h.viewport && (h.viewport.style.scrollBehavior = ""), x.current = null;
|
|
16100
16103
|
})
|
|
16101
16104
|
}
|
|
16102
16105
|
)
|
|
@@ -16118,13 +16121,13 @@ var cT = v.forwardRef((e, t) => {
|
|
|
16118
16121
|
return v.useEffect(() => {
|
|
16119
16122
|
const f = s.viewport;
|
|
16120
16123
|
if (f) {
|
|
16121
|
-
const
|
|
16124
|
+
const p = () => {
|
|
16122
16125
|
if (d(), !c.current) {
|
|
16123
|
-
const
|
|
16124
|
-
c.current =
|
|
16126
|
+
const h = xT(f, a);
|
|
16127
|
+
c.current = h, a();
|
|
16125
16128
|
}
|
|
16126
16129
|
};
|
|
16127
|
-
return a(), f.addEventListener("scroll",
|
|
16130
|
+
return a(), f.addEventListener("scroll", p), () => f.removeEventListener("scroll", p);
|
|
16128
16131
|
}
|
|
16129
16132
|
}, [s.viewport, d, a]), /* @__PURE__ */ u.jsx(
|
|
16130
16133
|
_e.div,
|
|
@@ -16138,7 +16141,7 @@ var cT = v.forwardRef((e, t) => {
|
|
|
16138
16141
|
...r
|
|
16139
16142
|
},
|
|
16140
16143
|
onPointerDownCapture: de(e.onPointerDownCapture, (f) => {
|
|
16141
|
-
const
|
|
16144
|
+
const h = f.target.getBoundingClientRect(), m = f.clientX - h.left, g = f.clientY - h.top;
|
|
16142
16145
|
i.onThumbPointerDown({ x: m, y: g });
|
|
16143
16146
|
}),
|
|
16144
16147
|
onPointerUp: de(e.onPointerUp, i.onThumbPointerUp)
|
|
@@ -16285,11 +16288,11 @@ function $c({
|
|
|
16285
16288
|
}) {
|
|
16286
16289
|
const {
|
|
16287
16290
|
threads: f,
|
|
16288
|
-
currentThreadId:
|
|
16289
|
-
setCurrentThreadId:
|
|
16291
|
+
currentThreadId: p,
|
|
16292
|
+
setCurrentThreadId: h,
|
|
16290
16293
|
isLoading: m,
|
|
16291
16294
|
actions: g
|
|
16292
|
-
} = aa(), { loadThread: y } = la(), { createThread: x, deleteThread: w, renameThread: b } = g, [T, S] = ye(Array.isArray(f) ? f : []), C = $e(T.length > 0), k = $e(null), R = $e(0), [
|
|
16295
|
+
} = aa(), { loadThread: y } = la(), { createThread: x, deleteThread: w, renameThread: b } = g, [T, S] = ye(Array.isArray(f) ? f : []), C = $e(T.length > 0), k = $e(null), R = $e(0), [A, D] = ye(null), [j, M] = ye(""), [$, E] = ye(!1);
|
|
16293
16296
|
wt(() => {
|
|
16294
16297
|
const G = Array.isArray(f) ? f : [];
|
|
16295
16298
|
if (G.length > 0) {
|
|
@@ -16314,19 +16317,19 @@ function $c({
|
|
|
16314
16317
|
}, [T]);
|
|
16315
16318
|
const F = async (G) => {
|
|
16316
16319
|
try {
|
|
16317
|
-
|
|
16320
|
+
h(G), await y(G), a == null || a(G), l == null || l(G);
|
|
16318
16321
|
} catch (z) {
|
|
16319
16322
|
console.error("Failed to select thread:", z);
|
|
16320
16323
|
}
|
|
16321
16324
|
}, N = async () => {
|
|
16322
16325
|
try {
|
|
16323
|
-
|
|
16326
|
+
E(!0);
|
|
16324
16327
|
const G = await x();
|
|
16325
16328
|
G && (c == null || c(G), a == null || a(G));
|
|
16326
16329
|
} catch (G) {
|
|
16327
16330
|
console.error("Failed to create thread:", G);
|
|
16328
16331
|
} finally {
|
|
16329
|
-
|
|
16332
|
+
E(!1);
|
|
16330
16333
|
}
|
|
16331
16334
|
}, V = async (G, z) => {
|
|
16332
16335
|
if (z.stopPropagation(), !!confirm("Delete this thread?")) {
|
|
@@ -16394,10 +16397,10 @@ function $c({
|
|
|
16394
16397
|
"div",
|
|
16395
16398
|
{
|
|
16396
16399
|
onClick: () => F(G.threadId),
|
|
16397
|
-
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ??
|
|
16400
|
+
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? p) === G.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
|
|
16398
16401
|
children: [
|
|
16399
16402
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
16400
|
-
/* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children:
|
|
16403
|
+
/* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: A === G.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (z) => z.stopPropagation(), children: [
|
|
16401
16404
|
/* @__PURE__ */ u.jsx(cs, { value: j, onChange: (z) => M(z.target.value), onKeyDown: (z) => Y(z, G.threadId), className: "h-6 text-sm", autoFocus: !0 }),
|
|
16402
16405
|
/* @__PURE__ */ u.jsx(tt, { variant: "ghost", size: "sm", onClick: () => _(G.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(ta, { size: 12 }) }),
|
|
16403
16406
|
/* @__PURE__ */ u.jsx(tt, { variant: "ghost", size: "sm", onClick: q, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(gr, { size: 12 }) })
|
|
@@ -16409,7 +16412,7 @@ function $c({
|
|
|
16409
16412
|
] })
|
|
16410
16413
|
] }) }),
|
|
16411
16414
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
|
|
16412
|
-
r &&
|
|
16415
|
+
r && A !== G.threadId && /* @__PURE__ */ u.jsx(tt, { variant: "ghost", size: "sm", onClick: (z) => B(G, z), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ u.jsx(Hc, { size: 12 }) }),
|
|
16413
16416
|
n && /* @__PURE__ */ u.jsx(
|
|
16414
16417
|
tt,
|
|
16415
16418
|
{
|
|
@@ -16444,25 +16447,25 @@ const Xk = ({
|
|
|
16444
16447
|
const a = e ?? [], l = a.length > 0, c = Le(() => l ? [...a].reverse() : [], [a, l]), d = t ?? (a.length ? a[a.length - 1].id : null);
|
|
16445
16448
|
if (!l)
|
|
16446
16449
|
return null;
|
|
16447
|
-
const
|
|
16450
|
+
const p = ["w-32 flex-shrink-0 flex-col border-r border-border/40 pr-2 flex bg-white text-gray-900 dark:bg-slate-900 dark:text-slate-100", o].filter(Boolean).join(" ");
|
|
16448
16451
|
return /* @__PURE__ */ u.jsxs(
|
|
16449
16452
|
"div",
|
|
16450
16453
|
{
|
|
16451
|
-
className:
|
|
16454
|
+
className: p,
|
|
16452
16455
|
onMouseEnter: s,
|
|
16453
16456
|
onMouseLeave: i,
|
|
16454
16457
|
children: [
|
|
16455
16458
|
/* @__PURE__ */ u.jsxs("div", { className: "relative flex-1 overflow-y-auto pt-4 pb-2 pr-1", children: [
|
|
16456
16459
|
/* @__PURE__ */ u.jsx("div", { className: "absolute left-0 right-0 top-1 px-2 pb-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground", children: /* @__PURE__ */ u.jsx("span", { children: "Timeline" }) }),
|
|
16457
16460
|
/* @__PURE__ */ u.jsx("div", { className: "pointer-events-none absolute left-3 top-0 bottom-0 w-px bg-border/40" }),
|
|
16458
|
-
/* @__PURE__ */ u.jsx("div", { className: "flex flex-col gap-3 pt-6 pr-2", children: c.map((
|
|
16459
|
-
const m = d ===
|
|
16461
|
+
/* @__PURE__ */ u.jsx("div", { className: "flex flex-col gap-3 pt-6 pr-2", children: c.map((h) => {
|
|
16462
|
+
const m = d === h.id, g = (r == null ? void 0 : r.get(h.id)) ?? null;
|
|
16460
16463
|
return /* @__PURE__ */ u.jsxs(
|
|
16461
16464
|
"button",
|
|
16462
16465
|
{
|
|
16463
16466
|
type: "button",
|
|
16464
16467
|
disabled: !n,
|
|
16465
|
-
onClick: () => n == null ? void 0 : n(
|
|
16468
|
+
onClick: () => n == null ? void 0 : n(h.id),
|
|
16466
16469
|
className: `relative flex items-start gap-2 text-left text-[11px] transition ${m ? "text-primary" : "text-muted-foreground"} ${n ? "hover:text-foreground" : "cursor-default opacity-70"}`,
|
|
16467
16470
|
children: [
|
|
16468
16471
|
/* @__PURE__ */ u.jsx(
|
|
@@ -16473,10 +16476,10 @@ const Xk = ({
|
|
|
16473
16476
|
}
|
|
16474
16477
|
),
|
|
16475
16478
|
/* @__PURE__ */ u.jsxs("span", { className: "flex-1", children: [
|
|
16476
|
-
/* @__PURE__ */ u.jsx("span", { className: "block font-medium leading-tight", children:
|
|
16479
|
+
/* @__PURE__ */ u.jsx("span", { className: "block font-medium leading-tight", children: h.label || "User input" }),
|
|
16477
16480
|
/* @__PURE__ */ u.jsxs("span", { className: "text-[9px] uppercase tracking-wide text-muted-foreground/70", children: [
|
|
16478
|
-
|
|
16479
|
-
|
|
16481
|
+
h.step !== null ? `STEP ${h.step}` : "STEP —",
|
|
16482
|
+
h.next ? ` - ${h.next}` : ""
|
|
16480
16483
|
] }),
|
|
16481
16484
|
g && /* @__PURE__ */ u.jsx(
|
|
16482
16485
|
"p",
|
|
@@ -16489,7 +16492,7 @@ const Xk = ({
|
|
|
16489
16492
|
] })
|
|
16490
16493
|
]
|
|
16491
16494
|
},
|
|
16492
|
-
|
|
16495
|
+
h.id
|
|
16493
16496
|
);
|
|
16494
16497
|
}) })
|
|
16495
16498
|
] }),
|
|
@@ -16675,24 +16678,24 @@ var AT = [" ", "Enter", "ArrowUp", "ArrowDown"], NT = [" ", "Enter"], or = "Sele
|
|
|
16675
16678
|
dir: c,
|
|
16676
16679
|
name: d,
|
|
16677
16680
|
autoComplete: f,
|
|
16678
|
-
disabled:
|
|
16679
|
-
required:
|
|
16681
|
+
disabled: p,
|
|
16682
|
+
required: h,
|
|
16680
16683
|
form: m
|
|
16681
16684
|
} = e, g = Xs(t), [y, x] = v.useState(null), [w, b] = v.useState(null), [T, S] = v.useState(!1), C = Cs(c), [k, R] = Cr({
|
|
16682
16685
|
prop: r,
|
|
16683
16686
|
defaultProp: o ?? !1,
|
|
16684
16687
|
onChange: s,
|
|
16685
16688
|
caller: or
|
|
16686
|
-
}), [
|
|
16689
|
+
}), [A, D] = Cr({
|
|
16687
16690
|
prop: i,
|
|
16688
16691
|
defaultProp: a,
|
|
16689
16692
|
onChange: l,
|
|
16690
16693
|
caller: or
|
|
16691
|
-
}), j = v.useRef(null), M = y ? m || !!y.closest("form") : !0, [$,
|
|
16694
|
+
}), j = v.useRef(null), M = y ? m || !!y.closest("form") : !0, [$, E] = v.useState(/* @__PURE__ */ new Set()), F = Array.from($).map((N) => N.props.value).join(";");
|
|
16692
16695
|
return /* @__PURE__ */ u.jsx(Qu, { ...g, children: /* @__PURE__ */ u.jsxs(
|
|
16693
16696
|
jT,
|
|
16694
16697
|
{
|
|
16695
|
-
required:
|
|
16698
|
+
required: h,
|
|
16696
16699
|
scope: t,
|
|
16697
16700
|
trigger: y,
|
|
16698
16701
|
onTriggerChange: x,
|
|
@@ -16701,23 +16704,23 @@ var AT = [" ", "Enter", "ArrowUp", "ArrowDown"], NT = [" ", "Enter"], or = "Sele
|
|
|
16701
16704
|
valueNodeHasChildren: T,
|
|
16702
16705
|
onValueNodeHasChildrenChange: S,
|
|
16703
16706
|
contentId: Rn(),
|
|
16704
|
-
value:
|
|
16707
|
+
value: A,
|
|
16705
16708
|
onValueChange: D,
|
|
16706
16709
|
open: k,
|
|
16707
16710
|
onOpenChange: R,
|
|
16708
16711
|
dir: C,
|
|
16709
16712
|
triggerPointerDownPosRef: j,
|
|
16710
|
-
disabled:
|
|
16713
|
+
disabled: p,
|
|
16711
16714
|
children: [
|
|
16712
16715
|
/* @__PURE__ */ u.jsx(Gs.Provider, { scope: t, children: /* @__PURE__ */ u.jsx(
|
|
16713
16716
|
PT,
|
|
16714
16717
|
{
|
|
16715
16718
|
scope: e.__scopeSelect,
|
|
16716
16719
|
onNativeOptionAdd: v.useCallback((N) => {
|
|
16717
|
-
|
|
16720
|
+
E((V) => new Set(V).add(N));
|
|
16718
16721
|
}, []),
|
|
16719
16722
|
onNativeOptionRemove: v.useCallback((N) => {
|
|
16720
|
-
|
|
16723
|
+
E((V) => {
|
|
16721
16724
|
const B = new Set(V);
|
|
16722
16725
|
return B.delete(N), B;
|
|
16723
16726
|
});
|
|
@@ -16729,16 +16732,16 @@ var AT = [" ", "Enter", "ArrowUp", "ArrowDown"], NT = [" ", "Enter"], or = "Sele
|
|
|
16729
16732
|
Th,
|
|
16730
16733
|
{
|
|
16731
16734
|
"aria-hidden": !0,
|
|
16732
|
-
required:
|
|
16735
|
+
required: h,
|
|
16733
16736
|
tabIndex: -1,
|
|
16734
16737
|
name: d,
|
|
16735
16738
|
autoComplete: f,
|
|
16736
|
-
value:
|
|
16739
|
+
value: A,
|
|
16737
16740
|
onChange: (N) => D(N.target.value),
|
|
16738
|
-
disabled:
|
|
16741
|
+
disabled: p,
|
|
16739
16742
|
form: m,
|
|
16740
16743
|
children: [
|
|
16741
|
-
|
|
16744
|
+
A === void 0 ? /* @__PURE__ */ u.jsx("option", { value: "" }) : null,
|
|
16742
16745
|
Array.from($)
|
|
16743
16746
|
]
|
|
16744
16747
|
},
|
|
@@ -16751,11 +16754,11 @@ var AT = [" ", "Enter", "ArrowUp", "ArrowDown"], NT = [" ", "Enter"], or = "Sele
|
|
|
16751
16754
|
eh.displayName = or;
|
|
16752
16755
|
var th = "SelectTrigger", nh = v.forwardRef(
|
|
16753
16756
|
(e, t) => {
|
|
16754
|
-
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Xs(n), i = Wn(th, n), a = i.disabled || r, l = We(t, i.onTriggerChange), c = Ys(n), d = v.useRef("touch"), [f,
|
|
16757
|
+
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Xs(n), i = Wn(th, n), a = i.disabled || r, l = We(t, i.onTriggerChange), c = Ys(n), d = v.useRef("touch"), [f, p, h] = Ih((g) => {
|
|
16755
16758
|
const y = c().filter((b) => !b.disabled), x = y.find((b) => b.value === i.value), w = Rh(y, g, x);
|
|
16756
16759
|
w !== void 0 && i.onValueChange(w.value);
|
|
16757
16760
|
}), m = (g) => {
|
|
16758
|
-
a || (i.onOpenChange(!0),
|
|
16761
|
+
a || (i.onOpenChange(!0), h()), g && (i.triggerPointerDownPosRef.current = {
|
|
16759
16762
|
x: Math.round(g.pageX),
|
|
16760
16763
|
y: Math.round(g.pageY)
|
|
16761
16764
|
});
|
|
@@ -16786,7 +16789,7 @@ var th = "SelectTrigger", nh = v.forwardRef(
|
|
|
16786
16789
|
}),
|
|
16787
16790
|
onKeyDown: de(o.onKeyDown, (g) => {
|
|
16788
16791
|
const y = f.current !== "";
|
|
16789
|
-
!(g.ctrlKey || g.altKey || g.metaKey) && g.key.length === 1 &&
|
|
16792
|
+
!(g.ctrlKey || g.altKey || g.metaKey) && g.key.length === 1 && p(g.key), !(y && g.key === " ") && AT.includes(g.key) && (m(), g.preventDefault());
|
|
16790
16793
|
})
|
|
16791
16794
|
}
|
|
16792
16795
|
) });
|
|
@@ -16850,16 +16853,16 @@ var an = 10, [lh, Vn] = jr(sr), LT = "SelectContentImpl", $T = br("SelectContent
|
|
|
16850
16853
|
align: c,
|
|
16851
16854
|
alignOffset: d,
|
|
16852
16855
|
arrowPadding: f,
|
|
16853
|
-
collisionBoundary:
|
|
16854
|
-
collisionPadding:
|
|
16856
|
+
collisionBoundary: p,
|
|
16857
|
+
collisionPadding: h,
|
|
16855
16858
|
sticky: m,
|
|
16856
16859
|
hideWhenDetached: g,
|
|
16857
16860
|
avoidCollisions: y,
|
|
16858
16861
|
//
|
|
16859
16862
|
...x
|
|
16860
|
-
} = e, w = Wn(sr, n), [b, T] = v.useState(null), [S, C] = v.useState(null), k = We(t, (X) => T(X)), [R,
|
|
16863
|
+
} = e, w = Wn(sr, n), [b, T] = v.useState(null), [S, C] = v.useState(null), k = We(t, (X) => T(X)), [R, A] = v.useState(null), [D, j] = v.useState(
|
|
16861
16864
|
null
|
|
16862
|
-
), M = Ys(n), [$,
|
|
16865
|
+
), M = Ys(n), [$, E] = v.useState(!1), F = v.useRef(!1);
|
|
16863
16866
|
v.useEffect(() => {
|
|
16864
16867
|
if (b) return wa(b);
|
|
16865
16868
|
}, [b]), da();
|
|
@@ -16906,7 +16909,7 @@ var an = 10, [lh, Vn] = jr(sr), LT = "SelectContentImpl", $T = br("SelectContent
|
|
|
16906
16909
|
}), se = v.useCallback(
|
|
16907
16910
|
(X, L, K) => {
|
|
16908
16911
|
const J = !F.current && !K;
|
|
16909
|
-
(w.value !== void 0 && w.value === L || J) && (
|
|
16912
|
+
(w.value !== void 0 && w.value === L || J) && (A(X), J && (F.current = !0));
|
|
16910
16913
|
},
|
|
16911
16914
|
[w.value]
|
|
16912
16915
|
), we = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Ie = v.useCallback(
|
|
@@ -16921,8 +16924,8 @@ var an = 10, [lh, Vn] = jr(sr), LT = "SelectContentImpl", $T = br("SelectContent
|
|
|
16921
16924
|
align: c,
|
|
16922
16925
|
alignOffset: d,
|
|
16923
16926
|
arrowPadding: f,
|
|
16924
|
-
collisionBoundary:
|
|
16925
|
-
collisionPadding:
|
|
16927
|
+
collisionBoundary: p,
|
|
16928
|
+
collisionPadding: h,
|
|
16926
16929
|
sticky: m,
|
|
16927
16930
|
hideWhenDetached: g,
|
|
16928
16931
|
avoidCollisions: y
|
|
@@ -16974,7 +16977,7 @@ var an = 10, [lh, Vn] = jr(sr), LT = "SelectContentImpl", $T = br("SelectContent
|
|
|
16974
16977
|
onContextMenu: (X) => X.preventDefault(),
|
|
16975
16978
|
...x,
|
|
16976
16979
|
...z,
|
|
16977
|
-
onPlaced: () =>
|
|
16980
|
+
onPlaced: () => E(!0),
|
|
16978
16981
|
ref: k,
|
|
16979
16982
|
style: {
|
|
16980
16983
|
// flex layout so we can place the scroll buttons properly
|
|
@@ -17007,11 +17010,11 @@ var an = 10, [lh, Vn] = jr(sr), LT = "SelectContentImpl", $T = br("SelectContent
|
|
|
17007
17010
|
);
|
|
17008
17011
|
ch.displayName = LT;
|
|
17009
17012
|
var FT = "SelectItemAlignedPosition", uh = v.forwardRef((e, t) => {
|
|
17010
|
-
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Wn(sr, n), i = Vn(sr, n), [a, l] = v.useState(null), [c, d] = v.useState(null), f = We(t, (k) => d(k)),
|
|
17013
|
+
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Wn(sr, n), i = Vn(sr, n), [a, l] = v.useState(null), [c, d] = v.useState(null), f = We(t, (k) => d(k)), p = Ys(n), h = v.useRef(!1), m = v.useRef(!0), { viewport: g, selectedItem: y, selectedItemText: x, focusSelectedItem: w } = i, b = v.useCallback(() => {
|
|
17011
17014
|
if (s.trigger && s.valueNode && a && c && g && y && x) {
|
|
17012
|
-
const k = s.trigger.getBoundingClientRect(), R = c.getBoundingClientRect(),
|
|
17015
|
+
const k = s.trigger.getBoundingClientRect(), R = c.getBoundingClientRect(), A = s.valueNode.getBoundingClientRect(), D = x.getBoundingClientRect();
|
|
17013
17016
|
if (s.dir !== "rtl") {
|
|
17014
|
-
const le = D.left - R.left, ie =
|
|
17017
|
+
const le = D.left - R.left, ie = A.left - le, Ae = k.left - ie, Ve = k.width + Ae, oe = Math.max(Ve, R.width), xe = window.innerWidth - an, Oe = qi(ie, [
|
|
17015
17018
|
an,
|
|
17016
17019
|
// Prevents the content from going off the starting edge of the
|
|
17017
17020
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -17022,13 +17025,13 @@ var FT = "SelectItemAlignedPosition", uh = v.forwardRef((e, t) => {
|
|
|
17022
17025
|
]);
|
|
17023
17026
|
a.style.minWidth = Ve + "px", a.style.left = Oe + "px";
|
|
17024
17027
|
} else {
|
|
17025
|
-
const le = R.right - D.right, ie = window.innerWidth -
|
|
17028
|
+
const le = R.right - D.right, ie = window.innerWidth - A.right - le, Ae = window.innerWidth - k.right - ie, Ve = k.width + Ae, oe = Math.max(Ve, R.width), xe = window.innerWidth - an, Oe = qi(ie, [
|
|
17026
17029
|
an,
|
|
17027
17030
|
Math.max(an, xe - oe)
|
|
17028
17031
|
]);
|
|
17029
17032
|
a.style.minWidth = Ve + "px", a.style.right = Oe + "px";
|
|
17030
17033
|
}
|
|
17031
|
-
const j =
|
|
17034
|
+
const j = p(), M = window.innerHeight - an * 2, $ = g.scrollHeight, E = window.getComputedStyle(c), F = parseInt(E.borderTopWidth, 10), N = parseInt(E.paddingTop, 10), V = parseInt(E.borderBottomWidth, 10), B = parseInt(E.paddingBottom, 10), _ = F + N + $ + B + V, q = Math.min(y.offsetHeight * 5, _), Y = window.getComputedStyle(g), se = parseInt(Y.paddingTop, 10), we = parseInt(Y.paddingBottom, 10), Ie = k.top + k.height / 2 - an, G = M - Ie, z = y.offsetHeight / 2, X = y.offsetTop + z, L = F + N + X, K = _ - L;
|
|
17032
17035
|
if (L <= Ie) {
|
|
17033
17036
|
const le = j.length > 0 && y === j[j.length - 1].ref.current;
|
|
17034
17037
|
a.style.bottom = "0px";
|
|
@@ -17048,10 +17051,10 @@ var FT = "SelectItemAlignedPosition", uh = v.forwardRef((e, t) => {
|
|
|
17048
17051
|
) + K;
|
|
17049
17052
|
a.style.height = Ae + "px", g.scrollTop = L - Ie + g.offsetTop;
|
|
17050
17053
|
}
|
|
17051
|
-
a.style.margin = `${an}px 0`, a.style.minHeight = q + "px", a.style.maxHeight = M + "px", r == null || r(), requestAnimationFrame(() =>
|
|
17054
|
+
a.style.margin = `${an}px 0`, a.style.minHeight = q + "px", a.style.maxHeight = M + "px", r == null || r(), requestAnimationFrame(() => h.current = !0);
|
|
17052
17055
|
}
|
|
17053
17056
|
}, [
|
|
17054
|
-
|
|
17057
|
+
p,
|
|
17055
17058
|
s.trigger,
|
|
17056
17059
|
s.valueNode,
|
|
17057
17060
|
a,
|
|
@@ -17078,7 +17081,7 @@ var FT = "SelectItemAlignedPosition", uh = v.forwardRef((e, t) => {
|
|
|
17078
17081
|
{
|
|
17079
17082
|
scope: n,
|
|
17080
17083
|
contentWrapper: a,
|
|
17081
|
-
shouldExpandOnScrollRef:
|
|
17084
|
+
shouldExpandOnScrollRef: h,
|
|
17082
17085
|
onScrollButtonChange: C,
|
|
17083
17086
|
children: /* @__PURE__ */ u.jsx(
|
|
17084
17087
|
"div",
|
|
@@ -17174,13 +17177,13 @@ var [zT, Za] = jr(sr, {}), Yi = "SelectViewport", dh = v.forwardRef(
|
|
|
17174
17177
|
...o.style
|
|
17175
17178
|
},
|
|
17176
17179
|
onScroll: de(o.onScroll, (c) => {
|
|
17177
|
-
const d = c.currentTarget, { contentWrapper: f, shouldExpandOnScrollRef:
|
|
17178
|
-
if (
|
|
17179
|
-
const
|
|
17180
|
-
if (
|
|
17180
|
+
const d = c.currentTarget, { contentWrapper: f, shouldExpandOnScrollRef: p } = i;
|
|
17181
|
+
if (p != null && p.current && f) {
|
|
17182
|
+
const h = Math.abs(l.current - d.scrollTop);
|
|
17183
|
+
if (h > 0) {
|
|
17181
17184
|
const m = window.innerHeight - an * 2, g = parseFloat(f.style.minHeight), y = parseFloat(f.style.height), x = Math.max(g, y);
|
|
17182
17185
|
if (x < m) {
|
|
17183
|
-
const w = x +
|
|
17186
|
+
const w = x + h, b = Math.min(m, w), T = w - b;
|
|
17184
17187
|
f.style.height = b + "px", f.style.bottom === "0px" && (d.scrollTop = T > 0 ? T : 0, f.style.justifyContent = "flex-end");
|
|
17185
17188
|
}
|
|
17186
17189
|
}
|
|
@@ -17215,7 +17218,7 @@ var fs = "SelectItem", [VT, mh] = jr(fs), gh = v.forwardRef(
|
|
|
17215
17218
|
disabled: o = !1,
|
|
17216
17219
|
textValue: s,
|
|
17217
17220
|
...i
|
|
17218
|
-
} = e, a = Wn(fs, n), l = Vn(fs, n), c = a.value === r, [d, f] = v.useState(s ?? ""), [
|
|
17221
|
+
} = e, a = Wn(fs, n), l = Vn(fs, n), c = a.value === r, [d, f] = v.useState(s ?? ""), [p, h] = v.useState(!1), m = We(
|
|
17219
17222
|
t,
|
|
17220
17223
|
(w) => {
|
|
17221
17224
|
var b;
|
|
@@ -17251,16 +17254,16 @@ var fs = "SelectItem", [VT, mh] = jr(fs), gh = v.forwardRef(
|
|
|
17251
17254
|
{
|
|
17252
17255
|
role: "option",
|
|
17253
17256
|
"aria-labelledby": g,
|
|
17254
|
-
"data-highlighted":
|
|
17255
|
-
"aria-selected": c &&
|
|
17257
|
+
"data-highlighted": p ? "" : void 0,
|
|
17258
|
+
"aria-selected": c && p,
|
|
17256
17259
|
"data-state": c ? "checked" : "unchecked",
|
|
17257
17260
|
"aria-disabled": o || void 0,
|
|
17258
17261
|
"data-disabled": o ? "" : void 0,
|
|
17259
17262
|
tabIndex: o ? void 0 : -1,
|
|
17260
17263
|
...i,
|
|
17261
17264
|
ref: m,
|
|
17262
|
-
onFocus: de(i.onFocus, () =>
|
|
17263
|
-
onBlur: de(i.onBlur, () =>
|
|
17265
|
+
onFocus: de(i.onFocus, () => h(!0)),
|
|
17266
|
+
onBlur: de(i.onBlur, () => h(!1)),
|
|
17264
17267
|
onClick: de(i.onClick, () => {
|
|
17265
17268
|
y.current !== "mouse" && x();
|
|
17266
17269
|
}),
|
|
@@ -17293,7 +17296,7 @@ var fs = "SelectItem", [VT, mh] = jr(fs), gh = v.forwardRef(
|
|
|
17293
17296
|
gh.displayName = fs;
|
|
17294
17297
|
var Fr = "SelectItemText", xh = v.forwardRef(
|
|
17295
17298
|
(e, t) => {
|
|
17296
|
-
const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Wn(Fr, n), a = Vn(Fr, n), l = mh(Fr, n), c = MT(Fr, n), [d, f] = v.useState(null),
|
|
17299
|
+
const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Wn(Fr, n), a = Vn(Fr, n), l = mh(Fr, n), c = MT(Fr, n), [d, f] = v.useState(null), p = We(
|
|
17297
17300
|
t,
|
|
17298
17301
|
(x) => f(x),
|
|
17299
17302
|
l.onItemTextChange,
|
|
@@ -17301,12 +17304,12 @@ var Fr = "SelectItemText", xh = v.forwardRef(
|
|
|
17301
17304
|
var w;
|
|
17302
17305
|
return (w = a.itemTextRefCallback) == null ? void 0 : w.call(a, x, l.value, l.disabled);
|
|
17303
17306
|
}
|
|
17304
|
-
),
|
|
17305
|
-
() => /* @__PURE__ */ u.jsx("option", { value: l.value, disabled: l.disabled, children:
|
|
17306
|
-
[l.disabled, l.value,
|
|
17307
|
+
), h = d == null ? void 0 : d.textContent, m = v.useMemo(
|
|
17308
|
+
() => /* @__PURE__ */ u.jsx("option", { value: l.value, disabled: l.disabled, children: h }, l.value),
|
|
17309
|
+
[l.disabled, l.value, h]
|
|
17307
17310
|
), { onNativeOptionAdd: g, onNativeOptionRemove: y } = c;
|
|
17308
17311
|
return At(() => (g(m), () => y(m)), [g, y, m]), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
17309
|
-
/* @__PURE__ */ u.jsx(_e.span, { id: l.textId, ...s, ref:
|
|
17312
|
+
/* @__PURE__ */ u.jsx(_e.span, { id: l.textId, ...s, ref: p }),
|
|
17310
17313
|
l.isSelected && i.valueNode && !i.valueNodeHasChildren ? xs.createPortal(s.children, i.valueNode) : null
|
|
17311
17314
|
] });
|
|
17312
17315
|
}
|
|
@@ -17693,7 +17696,7 @@ var Js = "Switch", [fk, eI] = _n(Js), [pk, hk] = fk(Js), Vh = v.forwardRef(
|
|
|
17693
17696
|
onCheckedChange: c,
|
|
17694
17697
|
form: d,
|
|
17695
17698
|
...f
|
|
17696
|
-
} = e, [
|
|
17699
|
+
} = e, [p, h] = v.useState(null), m = We(t, (b) => h(b)), g = v.useRef(!1), y = p ? d || !!p.closest("form") : !0, [x, w] = Cr({
|
|
17697
17700
|
prop: o,
|
|
17698
17701
|
defaultProp: s ?? !1,
|
|
17699
17702
|
onChange: c,
|
|
@@ -17721,7 +17724,7 @@ var Js = "Switch", [fk, eI] = _n(Js), [pk, hk] = fk(Js), Vh = v.forwardRef(
|
|
|
17721
17724
|
y && /* @__PURE__ */ u.jsx(
|
|
17722
17725
|
Gh,
|
|
17723
17726
|
{
|
|
17724
|
-
control:
|
|
17727
|
+
control: p,
|
|
17725
17728
|
bubbles: !g.current,
|
|
17726
17729
|
name: r,
|
|
17727
17730
|
value: l,
|
|
@@ -17763,13 +17766,13 @@ var mk = "SwitchBubbleInput", Gh = v.forwardRef(
|
|
|
17763
17766
|
return v.useEffect(() => {
|
|
17764
17767
|
const d = i.current;
|
|
17765
17768
|
if (!d) return;
|
|
17766
|
-
const f = window.HTMLInputElement.prototype,
|
|
17769
|
+
const f = window.HTMLInputElement.prototype, h = Object.getOwnPropertyDescriptor(
|
|
17767
17770
|
f,
|
|
17768
17771
|
"checked"
|
|
17769
17772
|
).set;
|
|
17770
|
-
if (l !== n &&
|
|
17773
|
+
if (l !== n && h) {
|
|
17771
17774
|
const m = new Event("click", { bubbles: r });
|
|
17772
|
-
|
|
17775
|
+
h.call(d, n), d.dispatchEvent(m);
|
|
17773
17776
|
}
|
|
17774
17777
|
}, [l, n, r]), /* @__PURE__ */ u.jsx(
|
|
17775
17778
|
"input",
|
|
@@ -17844,12 +17847,12 @@ function tI({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
17844
17847
|
}, [a, e]), wt(() => {
|
|
17845
17848
|
l(e);
|
|
17846
17849
|
}, [e]);
|
|
17847
|
-
const
|
|
17850
|
+
const p = () => {
|
|
17848
17851
|
t(a), d(!1), f({
|
|
17849
17852
|
title: "Settings saved",
|
|
17850
17853
|
description: "Your chat configuration has been updated successfully."
|
|
17851
17854
|
});
|
|
17852
|
-
},
|
|
17855
|
+
}, h = () => {
|
|
17853
17856
|
l(xk), d(!0), f({
|
|
17854
17857
|
title: "Settings reset",
|
|
17855
17858
|
description: "Configuration has been reset to defaults."
|
|
@@ -18106,13 +18109,13 @@ function tI({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
18106
18109
|
] })
|
|
18107
18110
|
] }),
|
|
18108
18111
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between pt-6 border-t", children: [
|
|
18109
|
-
/* @__PURE__ */ u.jsxs(tt, { variant: "outline", onClick:
|
|
18112
|
+
/* @__PURE__ */ u.jsxs(tt, { variant: "outline", onClick: h, children: [
|
|
18110
18113
|
/* @__PURE__ */ u.jsx(Ti, { className: "h-4 w-4 mr-2" }),
|
|
18111
18114
|
"Reset"
|
|
18112
18115
|
] }),
|
|
18113
18116
|
/* @__PURE__ */ u.jsxs("div", { className: "flex gap-2", children: [
|
|
18114
18117
|
/* @__PURE__ */ u.jsx(tt, { variant: "outline", onClick: m, children: "Cancel" }),
|
|
18115
|
-
/* @__PURE__ */ u.jsxs(tt, { onClick:
|
|
18118
|
+
/* @__PURE__ */ u.jsxs(tt, { onClick: p, disabled: !c, children: [
|
|
18116
18119
|
/* @__PURE__ */ u.jsx(km, { className: "h-4 w-4 mr-2" }),
|
|
18117
18120
|
"Save Changes"
|
|
18118
18121
|
] })
|