teodor-new-chat-ui 4.3.339 → 4.3.340
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/components/chat/TimelineColumn.d.ts +3 -1
- package/dist/index.esm.js +711 -701
- package/dist/index.umd.js +25 -25
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -26,11 +26,11 @@ function km() {
|
|
|
26
26
|
sl = 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 = {}, h = null, p = null;
|
|
30
|
+
c !== void 0 && (h = "" + c), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (p = 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: h, ref: p, 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 il;
|
|
48
48
|
function Rm() {
|
|
49
49
|
return il || (il = 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"), h = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), x = Symbol.iterator, m = "@@iterator";
|
|
51
51
|
function y(k) {
|
|
52
52
|
if (k === null || typeof k != "object")
|
|
53
53
|
return null;
|
|
@@ -75,7 +75,7 @@ function Rm() {
|
|
|
75
75
|
var T = !1, S = !1, C = !1, I = !1, R = !1, _;
|
|
76
76
|
_ = Symbol.for("react.module.reference");
|
|
77
77
|
function D(k) {
|
|
78
|
-
return !!(typeof k == "string" || typeof k == "function" || k === r || k === s || R || k === o || k === c || k === d || I || k ===
|
|
78
|
+
return !!(typeof k == "string" || typeof k == "function" || k === r || k === s || R || k === o || k === c || k === d || I || k === p || T || S || C || typeof k == "object" && k !== null && (k.$$typeof === h || k.$$typeof === f || k.$$typeof === i || k.$$typeof === a || k.$$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.
|
|
@@ -125,7 +125,7 @@ function Rm() {
|
|
|
125
125
|
case f:
|
|
126
126
|
var be = k.displayName || null;
|
|
127
127
|
return be !== null ? be : $(k.type) || "Memo";
|
|
128
|
-
case
|
|
128
|
+
case h: {
|
|
129
129
|
var qe = k, st = qe._payload, Be = qe._init;
|
|
130
130
|
try {
|
|
131
131
|
return $(Be(st));
|
|
@@ -314,7 +314,7 @@ function Rm() {
|
|
|
314
314
|
return Ee(k.render);
|
|
315
315
|
case f:
|
|
316
316
|
return re(k.type, H, ie);
|
|
317
|
-
case
|
|
317
|
+
case h: {
|
|
318
318
|
var be = k, qe = be._payload, st = be._init;
|
|
319
319
|
try {
|
|
320
320
|
return re(st(qe), H, ie);
|
|
@@ -983,12 +983,12 @@ function ws(e, t, n) {
|
|
|
983
983
|
}
|
|
984
984
|
return Ri(x) ? !0 : (t.append(ll(y, m, s), c(x)), !1);
|
|
985
985
|
}
|
|
986
|
-
const f = [],
|
|
986
|
+
const f = [], h = Object.assign(mg, {
|
|
987
987
|
defaultVisitor: d,
|
|
988
988
|
convertValue: c,
|
|
989
989
|
isVisitable: Ri
|
|
990
990
|
});
|
|
991
|
-
function
|
|
991
|
+
function p(x, m) {
|
|
992
992
|
if (!O.isUndefined(x)) {
|
|
993
993
|
if (f.indexOf(x) !== -1)
|
|
994
994
|
throw Error("Circular reference detected in " + m.join("."));
|
|
@@ -998,14 +998,14 @@ function ws(e, t, n) {
|
|
|
998
998
|
g,
|
|
999
999
|
O.isString(w) ? w.trim() : w,
|
|
1000
1000
|
m,
|
|
1001
|
-
|
|
1002
|
-
)) === !0 &&
|
|
1001
|
+
h
|
|
1002
|
+
)) === !0 && p(g, m ? m.concat(w) : [w]);
|
|
1003
1003
|
}), f.pop();
|
|
1004
1004
|
}
|
|
1005
1005
|
}
|
|
1006
1006
|
if (!O.isObject(e))
|
|
1007
1007
|
throw new TypeError("data must be an object");
|
|
1008
|
-
return
|
|
1008
|
+
return p(e), t;
|
|
1009
1009
|
}
|
|
1010
1010
|
function cl(e) {
|
|
1011
1011
|
const t = {
|
|
@@ -1484,13 +1484,13 @@ function Dg(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, h = 0;
|
|
1488
1488
|
for (; f !== o; )
|
|
1489
|
-
|
|
1489
|
+
h += 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 p = d && c - d;
|
|
1493
|
+
return p ? Math.round(h * 1e3 / p) : void 0;
|
|
1494
1494
|
};
|
|
1495
1495
|
}
|
|
1496
1496
|
function Lg(e, t) {
|
|
@@ -1575,14 +1575,14 @@ const hl = (e) => e instanceof Ht ? { ...e } : e;
|
|
|
1575
1575
|
function Zn(e, t) {
|
|
1576
1576
|
t = t || {};
|
|
1577
1577
|
const n = {};
|
|
1578
|
-
function r(c, d, f,
|
|
1579
|
-
return O.isPlainObject(c) && O.isPlainObject(d) ? O.merge.call({ caseless:
|
|
1578
|
+
function r(c, d, f, h) {
|
|
1579
|
+
return O.isPlainObject(c) && O.isPlainObject(d) ? O.merge.call({ caseless: h }, c, d) : O.isPlainObject(d) ? O.merge({}, d) : O.isArray(d) ? d.slice() : d;
|
|
1580
1580
|
}
|
|
1581
|
-
function o(c, d, f,
|
|
1581
|
+
function o(c, d, f, h) {
|
|
1582
1582
|
if (O.isUndefined(d)) {
|
|
1583
1583
|
if (!O.isUndefined(c))
|
|
1584
|
-
return r(void 0, c, f,
|
|
1585
|
-
} else return r(c, d, f,
|
|
1584
|
+
return r(void 0, c, f, h);
|
|
1585
|
+
} else return r(c, d, f, h);
|
|
1586
1586
|
}
|
|
1587
1587
|
function s(c, d) {
|
|
1588
1588
|
if (!O.isUndefined(d))
|
|
@@ -1632,8 +1632,8 @@ function Zn(e, t) {
|
|
|
1632
1632
|
headers: (c, d, f) => o(hl(c), hl(d), f, !0)
|
|
1633
1633
|
};
|
|
1634
1634
|
return O.forEach(Object.keys({ ...e, ...t }), function(d) {
|
|
1635
|
-
const f = l[d] || o,
|
|
1636
|
-
O.isUndefined(
|
|
1635
|
+
const f = l[d] || o, h = f(e[d], t[d], d);
|
|
1636
|
+
O.isUndefined(h) && f !== a || (n[d] = h);
|
|
1637
1637
|
}), n;
|
|
1638
1638
|
}
|
|
1639
1639
|
const au = (e) => {
|
|
@@ -1662,9 +1662,9 @@ const au = (e) => {
|
|
|
1662
1662
|
const o = au(e);
|
|
1663
1663
|
let s = o.data;
|
|
1664
1664
|
const i = Ht.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, h, p, x;
|
|
1666
1666
|
function m() {
|
|
1667
|
-
|
|
1667
|
+
p && p(), x && x(), 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 au = (e) => {
|
|
|
1705
1705
|
)), y = null;
|
|
1706
1706
|
}, s === void 0 && i.setContentType(null), "setRequestHeader" in y && O.forEach(i.toJSON(), function(T, S) {
|
|
1707
1707
|
y.setRequestHeader(S, T);
|
|
1708
|
-
}), O.isUndefined(o.withCredentials) || (y.withCredentials = !!o.withCredentials), a && a !== "json" && (y.responseType = o.responseType), c && ([
|
|
1708
|
+
}), O.isUndefined(o.withCredentials) || (y.withCredentials = !!o.withCredentials), a && a !== "json" && (y.responseType = o.responseType), c && ([h, x] = Ko(c, !0), y.addEventListener("progress", h)), l && y.upload && ([f, p] = Ko(l), y.upload.addEventListener("progress", f), y.upload.addEventListener("loadend", p)), (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 = Og(o.url);
|
|
@@ -1781,8 +1781,8 @@ const au = (e) => {
|
|
|
1781
1781
|
}
|
|
1782
1782
|
let f = d.byteLength;
|
|
1783
1783
|
if (n) {
|
|
1784
|
-
let
|
|
1785
|
-
n(
|
|
1784
|
+
let h = s += f;
|
|
1785
|
+
n(h);
|
|
1786
1786
|
}
|
|
1787
1787
|
l.enqueue(new Uint8Array(d));
|
|
1788
1788
|
} catch (c) {
|
|
@@ -1835,7 +1835,7 @@ const au = (e) => {
|
|
|
1835
1835
|
throw new je(`Response type '${x}' is not supported`, je.ERR_NOT_SUPPORT, y);
|
|
1836
1836
|
});
|
|
1837
1837
|
});
|
|
1838
|
-
const
|
|
1838
|
+
const h = async (x) => {
|
|
1839
1839
|
if (x == null)
|
|
1840
1840
|
return 0;
|
|
1841
1841
|
if (O.isBlob(x))
|
|
@@ -1849,9 +1849,9 @@ const au = (e) => {
|
|
|
1849
1849
|
return x.byteLength;
|
|
1850
1850
|
if (O.isURLSearchParams(x) && (x = x + ""), O.isString(x))
|
|
1851
1851
|
return (await l(x)).byteLength;
|
|
1852
|
-
},
|
|
1852
|
+
}, p = async (x, m) => {
|
|
1853
1853
|
const y = O.toFiniteNumber(x.getContentLength());
|
|
1854
|
-
return y ??
|
|
1854
|
+
return y ?? h(m);
|
|
1855
1855
|
};
|
|
1856
1856
|
return async (x) => {
|
|
1857
1857
|
let {
|
|
@@ -1875,7 +1875,7 @@ const au = (e) => {
|
|
|
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 p(R, g)) !== 0) {
|
|
1879
1879
|
let X = new n(m, {
|
|
1880
1880
|
method: "POST",
|
|
1881
1881
|
body: g,
|
|
@@ -2137,30 +2137,30 @@ let Xn = class {
|
|
|
2137
2137
|
this.interceptors.response.forEach(function(m) {
|
|
2138
2138
|
c.push(m.fulfilled, m.rejected);
|
|
2139
2139
|
});
|
|
2140
|
-
let d, f = 0,
|
|
2140
|
+
let d, f = 0, h;
|
|
2141
2141
|
if (!l) {
|
|
2142
2142
|
const x = [bl.bind(this), void 0];
|
|
2143
|
-
for (x.unshift(...a), x.push(...c),
|
|
2143
|
+
for (x.unshift(...a), x.push(...c), h = x.length, d = Promise.resolve(n); f < h; )
|
|
2144
2144
|
d = d.then(x[f++], x[f++]);
|
|
2145
2145
|
return d;
|
|
2146
2146
|
}
|
|
2147
|
-
|
|
2148
|
-
let
|
|
2149
|
-
for (; f <
|
|
2147
|
+
h = a.length;
|
|
2148
|
+
let p = n;
|
|
2149
|
+
for (; f < h; ) {
|
|
2150
2150
|
const x = a[f++], m = a[f++];
|
|
2151
2151
|
try {
|
|
2152
|
-
|
|
2152
|
+
p = x(p);
|
|
2153
2153
|
} catch (y) {
|
|
2154
2154
|
m.call(this, y);
|
|
2155
2155
|
break;
|
|
2156
2156
|
}
|
|
2157
2157
|
}
|
|
2158
2158
|
try {
|
|
2159
|
-
d = bl.call(this,
|
|
2159
|
+
d = bl.call(this, p);
|
|
2160
2160
|
} catch (x) {
|
|
2161
2161
|
return Promise.reject(x);
|
|
2162
2162
|
}
|
|
2163
|
-
for (f = 0,
|
|
2163
|
+
for (f = 0, h = c.length; f < h; )
|
|
2164
2164
|
d = d.then(c[f++], c[f++]);
|
|
2165
2165
|
return d;
|
|
2166
2166
|
}
|
|
@@ -2620,11 +2620,11 @@ function hr(e) {
|
|
|
2620
2620
|
}
|
|
2621
2621
|
function mu(e, t) {
|
|
2622
2622
|
if (!aa(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((_) => !!_ && typeof _ == "object").map((_) => ({ ..._ })) : a === null ? null : void 0, c = r.map((_, D) => Ix(_, D)).filter((_) => !!_), d = $t(e.config), f = $t(d == null ? void 0 : d.configurable),
|
|
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((_) => !!_ && typeof _ == "object").map((_) => ({ ..._ })) : a === null ? null : void 0, c = r.map((_, D) => Ix(_, D)).filter((_) => !!_), d = $t(e.config), f = $t(d == null ? void 0 : d.configurable), h = mt(f, ["checkpoint_id", "checkpointId"]), p = mt(f, ["checkpoint_ns", "checkpointNs"]), x = $t(e == null ? void 0 : e.parentConfig), m = $t(x == null ? void 0 : x.configurable), y = mt(m, ["checkpoint_id", "checkpointId"]) ?? null, g = mt(m, ["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((_) => _.role === "user") ?? null, S = $t(e == null ? void 0 : e.metadata), C = mt(S, ["branch_label", "branchLabel"]), I = mt(m, ["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: h ?? null,
|
|
2627
|
+
checkpointNs: p ?? null,
|
|
2628
2628
|
nextCursor: y,
|
|
2629
2629
|
nextCursorNs: g,
|
|
2630
2630
|
interrupt: hx(a, c, t),
|
|
@@ -2672,15 +2672,15 @@ function gx(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 = mt(i, ["label"]) ?? mt(i, ["branch_label", "branchLabel"]) ?? mt(i, ["description"]) ?? "User input", l = yx(i, ["step"]), c = mt(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 = mt(i, ["label"]) ?? mt(i, ["branch_label", "branchLabel"]) ?? mt(i, ["description"]) ?? "User input", l = yx(i, ["step"]), c = mt(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, h = o.lastUserMessageId ?? f, p = xx(o.next);
|
|
2676
2676
|
t.push({
|
|
2677
2677
|
id: s,
|
|
2678
2678
|
label: a,
|
|
2679
|
-
messageId:
|
|
2679
|
+
messageId: h,
|
|
2680
2680
|
step: l,
|
|
2681
2681
|
source: c ?? null,
|
|
2682
2682
|
createdAt: d,
|
|
2683
|
-
next:
|
|
2683
|
+
next: p ?? void 0,
|
|
2684
2684
|
parentConfig: o.parentConfig ?? null
|
|
2685
2685
|
});
|
|
2686
2686
|
}
|
|
@@ -2775,8 +2775,8 @@ function Cx(e, t) {
|
|
|
2775
2775
|
function Tx(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, ...h] = e, p = typeof a == "string" && a.trim() ? a : t, x = typeof l == "string" && l.trim() ? l : Array.isArray(c) && typeof c[0] == "string" ? String(c[0]) : "task", m = Array.isArray(d) ? d : void 0, y = h.length ? h[h.length - 1] : void 0;
|
|
2779
|
+
return { id: p, name: x, interrupts: m, 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 Ix(e, t) {
|
|
|
2865
2865
|
).toLowerCase(), i = fx[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 = mt(c, ["createdAt", "created_at"]) ?? mt(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 = mt(c, ["createdAt", "created_at"]) ?? mt(o, ["created_at", "createdAt"]), h = mt(c, ["checkpointId", "checkpoint_id"]), p = mt(c, ["checkpointNs", "checkpoint_ns"]), x = kx(o.content), m = {
|
|
2869
2869
|
id: l,
|
|
2870
2870
|
role: i,
|
|
2871
2871
|
content: x
|
|
2872
2872
|
};
|
|
2873
|
-
f && (m.createdAt = f), typeof o.name == "string" && o.name.trim() && (m.name = o.name), typeof (d == null ? void 0 : d.model_name) == "string" && (m.model = String(d.model_name)), !m.model && typeof o.model == "string" && (m.model = o.model),
|
|
2873
|
+
f && (m.createdAt = f), typeof o.name == "string" && o.name.trim() && (m.name = o.name), typeof (d == null ? void 0 : d.model_name) == "string" && (m.model = String(d.model_name)), !m.model && typeof o.model == "string" && (m.model = o.model), h && (m.checkpointId = h), p && (m.checkpointNs = p);
|
|
2874
2874
|
const y = Ax(
|
|
2875
2875
|
$t(
|
|
2876
2876
|
o.artifact ?? r.artifact ?? o.artifacts ?? r.artifacts
|
|
@@ -3050,16 +3050,16 @@ function Dx(e) {
|
|
|
3050
3050
|
return t;
|
|
3051
3051
|
}
|
|
3052
3052
|
function Lx(e = {}) {
|
|
3053
|
-
const t = De(() => Rn(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = me(e.token ?? null), s = Le(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = me(!1), [c, d] = me(null), [f,
|
|
3053
|
+
const t = De(() => Rn(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = me(e.token ?? null), s = Le(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = me(!1), [c, d] = me(null), [f, h] = me(""), [p, x] = me(null), [m, y] = me(0), [g, w] = me(!1), b = Le(null), T = Le(!0), S = Le(0), C = Le(null), I = Le(null), R = Le(null), _ = Le(null), D = ge((E) => {
|
|
3054
3054
|
o(E);
|
|
3055
3055
|
}, []), P = ge(() => {
|
|
3056
|
-
|
|
3056
|
+
h(""), x(null), d(null), I.current = null, R.current = null, _.current = null;
|
|
3057
3057
|
}, []), M = ge(() => {
|
|
3058
3058
|
var E;
|
|
3059
3059
|
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);
|
|
3060
3060
|
}, []), $ = ge(
|
|
3061
3061
|
(E, F, N) => {
|
|
3062
|
-
b.current && (b.current.abort(), b.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 &&
|
|
3062
|
+
b.current && (b.current.abort(), b.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && h(""), x(null), I.current = null, R.current = null, _.current = null;
|
|
3063
3063
|
const W = new AbortController();
|
|
3064
3064
|
b.current = W;
|
|
3065
3065
|
let B = null, j = null, K = !1;
|
|
@@ -3143,7 +3143,7 @@ function Lx(e = {}) {
|
|
|
3143
3143
|
const Lt = () => {
|
|
3144
3144
|
if (gt.length) {
|
|
3145
3145
|
const Xe = gt.join("");
|
|
3146
|
-
gt = [], T.current &&
|
|
3146
|
+
gt = [], T.current && h((Je) => Je + Xe);
|
|
3147
3147
|
}
|
|
3148
3148
|
Tt = null;
|
|
3149
3149
|
}, jt = () => {
|
|
@@ -3297,7 +3297,7 @@ function Lx(e = {}) {
|
|
|
3297
3297
|
isStreaming: a,
|
|
3298
3298
|
error: c,
|
|
3299
3299
|
assistantText: f,
|
|
3300
|
-
lastCheckpointId:
|
|
3300
|
+
lastCheckpointId: p,
|
|
3301
3301
|
lastSeq: m,
|
|
3302
3302
|
connected: g,
|
|
3303
3303
|
stream: $,
|
|
@@ -3406,11 +3406,11 @@ function El(e, t) {
|
|
|
3406
3406
|
if (t.type === "message_start" && t.role === "assistant") {
|
|
3407
3407
|
const a = t.id, l = qx(t.model);
|
|
3408
3408
|
if (e.messages.some((f) => f.id === a)) {
|
|
3409
|
-
const f = e.messagesStreamMeta ?? {},
|
|
3409
|
+
const f = e.messagesStreamMeta ?? {}, h = {
|
|
3410
3410
|
...f,
|
|
3411
3411
|
[a]: f[a] ?? { lastSeq: t.seq ?? null, lastText: "" }
|
|
3412
3412
|
};
|
|
3413
|
-
return { ...e, assemblingId: a, messagesStreamMeta:
|
|
3413
|
+
return { ...e, assemblingId: a, messagesStreamMeta: h };
|
|
3414
3414
|
}
|
|
3415
3415
|
const d = {
|
|
3416
3416
|
id: a,
|
|
@@ -3427,10 +3427,10 @@ function El(e, t) {
|
|
|
3427
3427
|
if (!a) return e;
|
|
3428
3428
|
const l = e.messages, c = l.findIndex((T) => T.id === a && T.role === "assistant");
|
|
3429
3429
|
if (c === -1) return e;
|
|
3430
|
-
const d = l[c], f = e.messagesStreamMeta ?? {},
|
|
3431
|
-
if (
|
|
3432
|
-
return console.debug("[MessageReducer] skipping delta - seq <= lastSeq", { seq:
|
|
3433
|
-
const { newParts: x, newMeta: m, changed: y } = Wx(d.content, t.delta,
|
|
3430
|
+
const d = l[c], f = e.messagesStreamMeta ?? {}, h = f[a] ?? { lastSeq: null, lastText: vu(d.content) }, p = t.seq ?? null;
|
|
3431
|
+
if (p !== null && typeof p == "number" && typeof h.lastSeq == "number" && p <= h.lastSeq)
|
|
3432
|
+
return console.debug("[MessageReducer] skipping delta - seq <= lastSeq", { seq: p, lastSeq: h.lastSeq }), e;
|
|
3433
|
+
const { newParts: x, newMeta: m, changed: y } = Wx(d.content, t.delta, h, p);
|
|
3434
3434
|
if (!y) return e;
|
|
3435
3435
|
const g = { ...d, content: x }, w = Oo(l, c, g), b = { ...f, [a]: m };
|
|
3436
3436
|
return { ...e, messages: w, messagesStreamMeta: b };
|
|
@@ -3441,17 +3441,17 @@ function El(e, t) {
|
|
|
3441
3441
|
const l = e.messages, c = l.findIndex((d) => d.id === a && d.role === "assistant");
|
|
3442
3442
|
if (c >= 0) {
|
|
3443
3443
|
const d = l[c];
|
|
3444
|
-
if (!((n = d.content) == null ? void 0 : n.some((
|
|
3445
|
-
var
|
|
3446
|
-
return (
|
|
3444
|
+
if (!((n = d.content) == null ? void 0 : n.some((h) => {
|
|
3445
|
+
var p;
|
|
3446
|
+
return (h == null ? void 0 : h.type) === "text" && ((p = h.text) == null ? void 0 : p.trim());
|
|
3447
3447
|
}))) {
|
|
3448
3448
|
console.debug("[MessageReducer] pruning assistant message with no visible text", {
|
|
3449
3449
|
id: d.id,
|
|
3450
|
-
contentTypes: (r = d.content) == null ? void 0 : r.map((
|
|
3451
|
-
contentPreview: (o = d.content) == null ? void 0 : o.map((
|
|
3450
|
+
contentTypes: (r = d.content) == null ? void 0 : r.map((p) => p == null ? void 0 : p.type),
|
|
3451
|
+
contentPreview: (o = d.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)
|
|
3452
3452
|
});
|
|
3453
|
-
const
|
|
3454
|
-
return { ...e, assemblingId: null, messages:
|
|
3453
|
+
const h = [...l.slice(0, c), ...l.slice(c + 1)];
|
|
3454
|
+
return { ...e, assemblingId: null, messages: h };
|
|
3455
3455
|
}
|
|
3456
3456
|
}
|
|
3457
3457
|
return e;
|
|
@@ -3459,11 +3459,11 @@ function El(e, t) {
|
|
|
3459
3459
|
if (t.type === "tool_start") {
|
|
3460
3460
|
const a = Nl(t), l = a[0] ?? (typeof t.id == "string" ? t.id : null) ?? (typeof t.call_id == "string" ? t.call_id : null), c = t.name ?? t.tool ?? "tool";
|
|
3461
3461
|
!l && a.length === 0 && a.push(`${c}-${Date.now()}`);
|
|
3462
|
-
const d = a.length ? a : l ? [l] : [], f = _l(e, d, c),
|
|
3463
|
-
if (
|
|
3464
|
-
const b = ni(
|
|
3465
|
-
...
|
|
3466
|
-
name:
|
|
3462
|
+
const d = a.length ? a : l ? [l] : [], f = _l(e, d, c), h = f >= 0 ? e.messages[f] : null, p = l ?? d[0] ?? `${c}-${Date.now()}`, x = (h == null ? void 0 : h.id) ?? `tool-${p}`, m = d[0] ?? p, y = { type: "tool_call", id: m, name: c, args: t.args };
|
|
3463
|
+
if (h) {
|
|
3464
|
+
const b = ni(h, d, c, t.args), T = {
|
|
3465
|
+
...h,
|
|
3466
|
+
name: h.name ?? c,
|
|
3467
3467
|
additionalKwargs: b
|
|
3468
3468
|
}, S = f, C = S >= 0 ? Oo(e.messages, S, T) : e.messages, I = wo(T, d), R = ri(e.toolIndex, x, I);
|
|
3469
3469
|
return {
|
|
@@ -3490,7 +3490,7 @@ function El(e, t) {
|
|
|
3490
3490
|
const a = Nl(t);
|
|
3491
3491
|
if (!a.length && !(typeof t.id == "string" && t.id))
|
|
3492
3492
|
return e;
|
|
3493
|
-
const l = t.name ?? null, c = _l(e, a, l), d = c >= 0 ? e.messages[c] : null, f = l ?? (d == null ? void 0 : d.name) ?? ((s = d == null ? void 0 : d.additionalKwargs) == null ? void 0 : s.toolName) ?? "tool",
|
|
3493
|
+
const l = t.name ?? null, c = _l(e, a, l), d = c >= 0 ? e.messages[c] : null, f = l ?? (d == null ? void 0 : d.name) ?? ((s = d == null ? void 0 : d.additionalKwargs) == null ? void 0 : s.toolName) ?? "tool", h = a[0] ?? ((i = d == null ? void 0 : d.id) == null ? void 0 : i.replace(/^tool-/, "")) ?? `${f}-${Date.now()}`, p = (d == null ? void 0 : d.id) ?? `tool-${h}`, x = wo(d, a);
|
|
3494
3494
|
let m = t.output;
|
|
3495
3495
|
if (typeof t.output == "string")
|
|
3496
3496
|
try {
|
|
@@ -3503,7 +3503,7 @@ function El(e, t) {
|
|
|
3503
3503
|
type: "text",
|
|
3504
3504
|
text: typeof m == "string" ? m : JSON.stringify(m)
|
|
3505
3505
|
}, w = (d == null ? void 0 : d.createdAt) ?? (/* @__PURE__ */ new Date()).toISOString(), b = ni(d ?? void 0, x.length ? x : a, f), T = {
|
|
3506
|
-
id:
|
|
3506
|
+
id: p,
|
|
3507
3507
|
role: "tool",
|
|
3508
3508
|
name: f ?? (d == null ? void 0 : d.name) ?? "tool",
|
|
3509
3509
|
content: [g],
|
|
@@ -3514,7 +3514,7 @@ function El(e, t) {
|
|
|
3514
3514
|
return {
|
|
3515
3515
|
...e,
|
|
3516
3516
|
messages: S,
|
|
3517
|
-
toolIndex: ri(e.toolIndex,
|
|
3517
|
+
toolIndex: ri(e.toolIndex, p, C)
|
|
3518
3518
|
};
|
|
3519
3519
|
}
|
|
3520
3520
|
if (t.type === "checkpoint") {
|
|
@@ -3681,9 +3681,9 @@ function Wx(e, t, n, r) {
|
|
|
3681
3681
|
if (s) {
|
|
3682
3682
|
const f = Vx(a, s);
|
|
3683
3683
|
if (f === "" ? l = "" : f === s ? l = s : l = f, l) {
|
|
3684
|
-
const
|
|
3685
|
-
if ((
|
|
3686
|
-
const
|
|
3684
|
+
const h = c[c.length - 1];
|
|
3685
|
+
if ((h == null ? void 0 : h.type) === "text") {
|
|
3686
|
+
const p = h.text ?? "", x = { ...h, text: p + l };
|
|
3687
3687
|
c = [...c.slice(0, c.length - 1), x];
|
|
3688
3688
|
} else
|
|
3689
3689
|
c = [...c, { type: "text", text: l }];
|
|
@@ -3740,7 +3740,7 @@ function Gx({
|
|
|
3740
3740
|
onAuthError: l,
|
|
3741
3741
|
onHeartbeat: c
|
|
3742
3742
|
}) {
|
|
3743
|
-
const d = Le(null), f = Le(null),
|
|
3743
|
+
const d = Le(null), f = Le(null), h = Le(/* @__PURE__ */ new Map()), p = Le(null), x = Le(null), m = ge((P) => {
|
|
3744
3744
|
try {
|
|
3745
3745
|
const M = globalThis.structuredClone;
|
|
3746
3746
|
if (typeof M == "function")
|
|
@@ -3755,17 +3755,17 @@ function Gx({
|
|
|
3755
3755
|
}, []), y = ge(
|
|
3756
3756
|
(P, M) => {
|
|
3757
3757
|
if (!P) return;
|
|
3758
|
-
const $ =
|
|
3759
|
-
|
|
3758
|
+
const $ = h.current.get(P) ?? [], E = m(M), F = $.length >= Pl ? [...$.slice($.length - Pl + 1), E] : [...$, E];
|
|
3759
|
+
h.current.set(P, F);
|
|
3760
3760
|
},
|
|
3761
3761
|
[m]
|
|
3762
3762
|
), g = ge((P) => {
|
|
3763
|
-
P &&
|
|
3763
|
+
P && h.current.set(P, []);
|
|
3764
3764
|
}, []), w = ge(
|
|
3765
3765
|
(P) => {
|
|
3766
3766
|
const M = P ?? f.current;
|
|
3767
3767
|
if (!M) return;
|
|
3768
|
-
const $ =
|
|
3768
|
+
const $ = h.current.get(M);
|
|
3769
3769
|
$ != null && $.length && $.forEach((E) => {
|
|
3770
3770
|
try {
|
|
3771
3771
|
n(E);
|
|
@@ -3789,7 +3789,7 @@ function Gx({
|
|
|
3789
3789
|
d.current = M;
|
|
3790
3790
|
}
|
|
3791
3791
|
if (P.type === "thread_info") {
|
|
3792
|
-
f.current = P.threadId,
|
|
3792
|
+
f.current = P.threadId, p.current && (p.current.threadIdGuess = P.threadId), x.current = P, g(P.threadId), console.log("[useChatStreamingService] 🎯 Received thread_info event:", P);
|
|
3793
3793
|
try {
|
|
3794
3794
|
t(P);
|
|
3795
3795
|
} catch (j) {
|
|
@@ -3816,7 +3816,7 @@ function Gx({
|
|
|
3816
3816
|
}
|
|
3817
3817
|
}
|
|
3818
3818
|
}
|
|
3819
|
-
const $ = P.threadId ?? (P.type === "state_history" ? P.threadId : void 0) ?? f.current ?? ((B =
|
|
3819
|
+
const $ = P.threadId ?? (P.type === "state_history" ? P.threadId : void 0) ?? f.current ?? ((B = p.current) == null ? void 0 : B.threadIdGuess) ?? null;
|
|
3820
3820
|
if (P.type === "state_history") {
|
|
3821
3821
|
f.current = $ ?? f.current;
|
|
3822
3822
|
try {
|
|
@@ -3846,7 +3846,7 @@ function Gx({
|
|
|
3846
3846
|
token: void 0
|
|
3847
3847
|
}), _ = ge(
|
|
3848
3848
|
(P, M) => {
|
|
3849
|
-
d.current = null, x.current = null, f.current = P.threadId ?? null,
|
|
3849
|
+
d.current = null, x.current = null, f.current = P.threadId ?? null, p.current = {
|
|
3850
3850
|
request: P,
|
|
3851
3851
|
callbacks: M,
|
|
3852
3852
|
manualStop: !1,
|
|
@@ -3884,7 +3884,7 @@ function Gx({
|
|
|
3884
3884
|
},
|
|
3885
3885
|
onClosed: ($) => {
|
|
3886
3886
|
var W, B, j, K;
|
|
3887
|
-
const E = ((W =
|
|
3887
|
+
const E = ((W = p.current) == null ? void 0 : W.manualStop) ?? !1, F = f.current ?? ((B = p.current) == null ? void 0 : B.threadIdGuess) ?? ((j = $.lastStateHistory) == null ? void 0 : j.threadId) ?? null;
|
|
3888
3888
|
($.reason === "complete" || $.reason === "aborted" && E) && g(F);
|
|
3889
3889
|
const N = {
|
|
3890
3890
|
...$,
|
|
@@ -3903,7 +3903,7 @@ function Gx({
|
|
|
3903
3903
|
} catch (X) {
|
|
3904
3904
|
console.warn("[useChatStreamingService] downstream onClosed handler failed", X);
|
|
3905
3905
|
}
|
|
3906
|
-
|
|
3906
|
+
p.current && (p.current = null);
|
|
3907
3907
|
}
|
|
3908
3908
|
}
|
|
3909
3909
|
);
|
|
@@ -3919,7 +3919,7 @@ function Gx({
|
|
|
3919
3919
|
T
|
|
3920
3920
|
]
|
|
3921
3921
|
), D = ge(() => {
|
|
3922
|
-
|
|
3922
|
+
p.current && (p.current.manualStop = !0), S();
|
|
3923
3923
|
}, [S]);
|
|
3924
3924
|
return De(
|
|
3925
3925
|
() => ({
|
|
@@ -3945,18 +3945,18 @@ function Yx({
|
|
|
3945
3945
|
onAuthError: i,
|
|
3946
3946
|
onThreadChange: a
|
|
3947
3947
|
}) {
|
|
3948
|
-
const { api: l, baseUrl: c } = hu(), d = De(() => Rn(c), [c]), [f,
|
|
3948
|
+
const { api: l, baseUrl: c } = hu(), d = De(() => Rn(c), [c]), [f, h] = me([]), [p, x] = me(t), [m, y] = me(!1), [g, w] = me(null), [b, T] = me(!1), [S, C] = me(null), { state: I, seed: R, prepend: _, pushUser: D, onEvent: P } = Ux(), [M, $] = me(!1), [E, F] = me(!1), [N, W] = me(null), [B, j] = me([]), [K, X] = me([]), [se, xe] = me(!1), Re = De(
|
|
3949
3949
|
() => B.flatMap((q) => q.messages ?? []),
|
|
3950
3950
|
[B]
|
|
3951
|
-
), G = De(() => Dx(Re), [Re]), z = Le(
|
|
3951
|
+
), G = De(() => Dx(Re), [Re]), z = Le(p), J = Le(null), L = Le(null), V = Le(null), Z = Le(null), ae = Le(!1), oe = Le(null), Ee = Le(/* @__PURE__ */ new Map()), We = Le(/* @__PURE__ */ new Map());
|
|
3952
3952
|
wt(() => {
|
|
3953
|
-
z.current =
|
|
3954
|
-
}, [
|
|
3953
|
+
z.current = p;
|
|
3954
|
+
}, [p]);
|
|
3955
3955
|
const re = ge(async () => {
|
|
3956
3956
|
y(!0), w(null);
|
|
3957
3957
|
try {
|
|
3958
3958
|
const q = await l.listThreads();
|
|
3959
|
-
|
|
3959
|
+
h(q ?? []);
|
|
3960
3960
|
} catch (q) {
|
|
3961
3961
|
const A = String(q);
|
|
3962
3962
|
w(A), s == null || s(A);
|
|
@@ -3972,7 +3972,7 @@ function Yx({
|
|
|
3972
3972
|
updatedAt: q.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
3973
3973
|
messageCount: q.messageCount ?? 1
|
|
3974
3974
|
};
|
|
3975
|
-
|
|
3975
|
+
h((Y) => {
|
|
3976
3976
|
let te = !1;
|
|
3977
3977
|
const fe = Y.map((we) => we.threadId === A.threadId ? (te = !0, console.debug("[ChatSessionProvider] thread_info: updating existing thread", A.threadId), {
|
|
3978
3978
|
...we,
|
|
@@ -4021,13 +4021,13 @@ function Yx({
|
|
|
4021
4021
|
), at = ge(
|
|
4022
4022
|
async (q) => {
|
|
4023
4023
|
const A = f;
|
|
4024
|
-
|
|
4024
|
+
h((te) => te.filter((fe) => fe.threadId !== q));
|
|
4025
4025
|
const Y = new AbortController();
|
|
4026
4026
|
We.current.set(q, Y);
|
|
4027
4027
|
try {
|
|
4028
4028
|
await l.deleteThread(q), z.current === q && (x(null), R([], {})), console.log("[ChatSessionProvider] Thread deleted successfully:", q);
|
|
4029
4029
|
} catch (te) {
|
|
4030
|
-
console.error("[ChatSessionProvider] Delete failed, restoring thread:", q, te),
|
|
4030
|
+
console.error("[ChatSessionProvider] Delete failed, restoring thread:", q, te), h(A), s == null || s(`Failed to delete thread: ${String(te)}`);
|
|
4031
4031
|
} finally {
|
|
4032
4032
|
We.current.delete(q);
|
|
4033
4033
|
}
|
|
@@ -4095,35 +4095,35 @@ function Yx({
|
|
|
4095
4095
|
[yt]
|
|
4096
4096
|
);
|
|
4097
4097
|
wt(() => {
|
|
4098
|
-
if (!o || !
|
|
4098
|
+
if (!o || !p || b || rt)
|
|
4099
4099
|
return;
|
|
4100
|
-
if (L.current ===
|
|
4101
|
-
L.current = null, J.current =
|
|
4100
|
+
if (L.current === p) {
|
|
4101
|
+
L.current = null, J.current = p;
|
|
4102
4102
|
return;
|
|
4103
4103
|
}
|
|
4104
|
-
if (V.current ===
|
|
4105
|
-
J.current =
|
|
4104
|
+
if (V.current === p) {
|
|
4105
|
+
J.current = p;
|
|
4106
4106
|
return;
|
|
4107
4107
|
}
|
|
4108
|
-
if (Z.current ===
|
|
4109
|
-
Z.current = null, J.current =
|
|
4108
|
+
if (Z.current === p) {
|
|
4109
|
+
Z.current = null, J.current = p;
|
|
4110
4110
|
return;
|
|
4111
4111
|
}
|
|
4112
|
-
if (J.current ===
|
|
4112
|
+
if (J.current === p)
|
|
4113
4113
|
return;
|
|
4114
|
-
J.current =
|
|
4115
|
-
const q = !ae.current && !!n &&
|
|
4114
|
+
J.current = p;
|
|
4115
|
+
const q = !ae.current && !!n && p === t;
|
|
4116
4116
|
let A;
|
|
4117
4117
|
q && n ? (A = n, ae.current = !0, console.log(
|
|
4118
4118
|
"[ChatSessionProvider] Loading thread with checkpoint:",
|
|
4119
4119
|
A,
|
|
4120
4120
|
r ? `(ns: ${r})` : ""
|
|
4121
4121
|
)) : console.log("[ChatSessionProvider] Loading thread with latest checkpoint");
|
|
4122
|
-
const Y = `${
|
|
4123
|
-
oe.current !== Y && gt(
|
|
4122
|
+
const Y = `${p}:${A ?? "latest"}`;
|
|
4123
|
+
oe.current !== Y && gt(p, A);
|
|
4124
4124
|
}, [
|
|
4125
4125
|
o,
|
|
4126
|
-
|
|
4126
|
+
p,
|
|
4127
4127
|
n,
|
|
4128
4128
|
r,
|
|
4129
4129
|
t,
|
|
@@ -4227,8 +4227,8 @@ function Yx({
|
|
|
4227
4227
|
wt(() => {
|
|
4228
4228
|
re();
|
|
4229
4229
|
}, [re]), wt(() => {
|
|
4230
|
-
a == null || a(
|
|
4231
|
-
}, [
|
|
4230
|
+
a == null || a(p);
|
|
4231
|
+
}, [p, a]);
|
|
4232
4232
|
const pn = ge(
|
|
4233
4233
|
async (q, A) => {
|
|
4234
4234
|
let Y = z.current;
|
|
@@ -4275,7 +4275,7 @@ function Yx({
|
|
|
4275
4275
|
), Xe = De(
|
|
4276
4276
|
() => ({
|
|
4277
4277
|
threads: f,
|
|
4278
|
-
currentThreadId:
|
|
4278
|
+
currentThreadId: p,
|
|
4279
4279
|
setCurrentThreadId: x,
|
|
4280
4280
|
isLoading: m,
|
|
4281
4281
|
error: g,
|
|
@@ -4286,13 +4286,13 @@ function Yx({
|
|
|
4286
4286
|
refreshThreads: re
|
|
4287
4287
|
}
|
|
4288
4288
|
}),
|
|
4289
|
-
[f,
|
|
4289
|
+
[f, p, m, g, ot, at, _t, re]
|
|
4290
4290
|
), Je = De(() => {
|
|
4291
4291
|
const q = I.assemblingId ?? null;
|
|
4292
4292
|
return q ? { assemblingMessageId: q } : null;
|
|
4293
4293
|
}, [I.assemblingId]), pt = De(
|
|
4294
4294
|
() => ({
|
|
4295
|
-
threadId:
|
|
4295
|
+
threadId: p,
|
|
4296
4296
|
messages: I.messages,
|
|
4297
4297
|
interrupt: null,
|
|
4298
4298
|
checkpoint: {
|
|
@@ -4318,7 +4318,7 @@ function Yx({
|
|
|
4318
4318
|
messagePreviews: G
|
|
4319
4319
|
}),
|
|
4320
4320
|
[
|
|
4321
|
-
|
|
4321
|
+
p,
|
|
4322
4322
|
I,
|
|
4323
4323
|
B,
|
|
4324
4324
|
K,
|
|
@@ -4459,8 +4459,8 @@ function Zx({
|
|
|
4459
4459
|
onCancelEdit: c,
|
|
4460
4460
|
onStop: d,
|
|
4461
4461
|
className: f = "",
|
|
4462
|
-
textareaClassName:
|
|
4463
|
-
allowEmptySend:
|
|
4462
|
+
textareaClassName: h = "",
|
|
4463
|
+
allowEmptySend: p = !1
|
|
4464
4464
|
}) {
|
|
4465
4465
|
const x = i !== void 0, [m, y] = Q.useState(e), g = (x ? i : m) ?? "", [w, b] = Q.useTransition(), T = Q.useRef(null), S = Q.useRef(0), C = Q.useRef(null);
|
|
4466
4466
|
Q.useEffect(() => {
|
|
@@ -4482,7 +4482,7 @@ function Zx({
|
|
|
4482
4482
|
async (F) => {
|
|
4483
4483
|
F && F.preventDefault();
|
|
4484
4484
|
const N = (g ?? "").trim();
|
|
4485
|
-
if (!N && !
|
|
4485
|
+
if (!N && !p)
|
|
4486
4486
|
return;
|
|
4487
4487
|
const W = ++S.current;
|
|
4488
4488
|
C.current = {
|
|
@@ -4504,7 +4504,7 @@ function Zx({
|
|
|
4504
4504
|
}
|
|
4505
4505
|
});
|
|
4506
4506
|
},
|
|
4507
|
-
[g, l,
|
|
4507
|
+
[g, l, p, x, a]
|
|
4508
4508
|
), D = Q.useCallback((F) => {
|
|
4509
4509
|
const N = F.target.value;
|
|
4510
4510
|
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`);
|
|
@@ -4513,7 +4513,7 @@ function Zx({
|
|
|
4513
4513
|
F.key === "Enter" && !F.shiftKey ? (F.preventDefault(), _()) : F.key === "Escape" && t && (F.preventDefault(), c == null || c());
|
|
4514
4514
|
},
|
|
4515
4515
|
[_, t, c]
|
|
4516
|
-
), 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))]" : ""} ${
|
|
4516
|
+
), 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))]" : ""} ${h}`;
|
|
4517
4517
|
return /* @__PURE__ */ u.jsx("form", { onSubmit: (F) => void _(F), className: `w-full ${f}`, children: /* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
4518
4518
|
/* @__PURE__ */ u.jsx("div", { className: "flex-1", children: /* @__PURE__ */ u.jsx(
|
|
4519
4519
|
Cu,
|
|
@@ -4552,7 +4552,7 @@ function Zx({
|
|
|
4552
4552
|
size: "icon",
|
|
4553
4553
|
className: "shrink-0",
|
|
4554
4554
|
title: t ? "Save changes" : "Send message",
|
|
4555
|
-
disabled: o || !g.trim() && !
|
|
4555
|
+
disabled: o || !g.trim() && !p || w,
|
|
4556
4556
|
children: /* @__PURE__ */ u.jsx(nm, { size: 16 })
|
|
4557
4557
|
}
|
|
4558
4558
|
) })
|
|
@@ -4610,13 +4610,13 @@ function Nn(e, t = []) {
|
|
|
4610
4610
|
n = [...n, i];
|
|
4611
4611
|
const c = (f) => {
|
|
4612
4612
|
var g;
|
|
4613
|
-
const { scope:
|
|
4614
|
-
return /* @__PURE__ */ u.jsx(m.Provider, { value: y, children:
|
|
4613
|
+
const { scope: h, children: p, ...x } = f, m = ((g = h == null ? void 0 : h[e]) == null ? void 0 : g[l]) || a, y = v.useMemo(() => x, Object.values(x));
|
|
4614
|
+
return /* @__PURE__ */ u.jsx(m.Provider, { value: y, children: p });
|
|
4615
4615
|
};
|
|
4616
4616
|
c.displayName = s + "Provider";
|
|
4617
|
-
function d(f,
|
|
4617
|
+
function d(f, h) {
|
|
4618
4618
|
var m;
|
|
4619
|
-
const
|
|
4619
|
+
const p = ((m = h == null ? void 0 : h[e]) == null ? void 0 : m[l]) || a, x = v.useContext(p);
|
|
4620
4620
|
if (x) return x;
|
|
4621
4621
|
if (i !== void 0) return i;
|
|
4622
4622
|
throw new Error(`\`${f}\` must be used within \`${s}\``);
|
|
@@ -4679,8 +4679,8 @@ function Cr({
|
|
|
4679
4679
|
(d) => {
|
|
4680
4680
|
var f;
|
|
4681
4681
|
if (a) {
|
|
4682
|
-
const
|
|
4683
|
-
|
|
4682
|
+
const h = oy(d) ? d(e) : d;
|
|
4683
|
+
h !== e && ((f = i.current) == null || f.call(i, h));
|
|
4684
4684
|
} else
|
|
4685
4685
|
s(d);
|
|
4686
4686
|
},
|
|
@@ -4747,13 +4747,13 @@ function fa(e) {
|
|
|
4747
4747
|
}
|
|
4748
4748
|
);
|
|
4749
4749
|
c.displayName = a;
|
|
4750
|
-
const d = e + "CollectionItemSlot", f = "data-radix-collection-item",
|
|
4750
|
+
const d = e + "CollectionItemSlot", f = "data-radix-collection-item", h = br(d), p = Q.forwardRef(
|
|
4751
4751
|
(m, y) => {
|
|
4752
4752
|
const { scope: g, children: w, ...b } = m, T = Q.useRef(null), S = Ue(y, T), C = s(d, g);
|
|
4753
|
-
return Q.useEffect(() => (C.itemMap.set(T, { ref: T, ...b }), () => void C.itemMap.delete(T))), /* @__PURE__ */ u.jsx(
|
|
4753
|
+
return Q.useEffect(() => (C.itemMap.set(T, { ref: T, ...b }), () => void C.itemMap.delete(T))), /* @__PURE__ */ u.jsx(h, { [f]: "", ref: S, children: w });
|
|
4754
4754
|
}
|
|
4755
4755
|
);
|
|
4756
|
-
|
|
4756
|
+
p.displayName = d;
|
|
4757
4757
|
function x(m) {
|
|
4758
4758
|
const y = s(e + "CollectionConsumer", m);
|
|
4759
4759
|
return Q.useCallback(() => {
|
|
@@ -4766,7 +4766,7 @@ function fa(e) {
|
|
|
4766
4766
|
}, [y.collectionRef, y.itemMap]);
|
|
4767
4767
|
}
|
|
4768
4768
|
return [
|
|
4769
|
-
{ Provider: i, Slot: c, ItemSlot:
|
|
4769
|
+
{ Provider: i, Slot: c, ItemSlot: p },
|
|
4770
4770
|
x,
|
|
4771
4771
|
r
|
|
4772
4772
|
];
|
|
@@ -4808,24 +4808,24 @@ var ly = "DismissableLayer", Pi = "dismissableLayer.update", cy = "dismissableLa
|
|
|
4808
4808
|
onInteractOutside: i,
|
|
4809
4809
|
onDismiss: a,
|
|
4810
4810
|
...l
|
|
4811
|
-
} = e, c = v.useContext(Iu), [d, f] = v.useState(null),
|
|
4811
|
+
} = e, c = v.useContext(Iu), [d, f] = v.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = v.useState({}), x = Ue(t, (I) => f(I)), m = Array.from(c.layers), [y] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), g = m.indexOf(y), w = d ? m.indexOf(d) : -1, b = c.layersWithOutsidePointerEventsDisabled.size > 0, T = w >= g, S = py((I) => {
|
|
4812
4812
|
const R = I.target, _ = [...c.branches].some((D) => D.contains(R));
|
|
4813
4813
|
!T || _ || (o == null || o(I), i == null || i(I), I.defaultPrevented || a == null || a());
|
|
4814
|
-
},
|
|
4814
|
+
}, h), C = hy((I) => {
|
|
4815
4815
|
const R = I.target;
|
|
4816
4816
|
[...c.branches].some((D) => D.contains(R)) || (s == null || s(I), i == null || i(I), I.defaultPrevented || a == null || a());
|
|
4817
|
-
},
|
|
4817
|
+
}, h);
|
|
4818
4818
|
return ay((I) => {
|
|
4819
4819
|
w === c.layers.size - 1 && (r == null || r(I), !I.defaultPrevented && a && (I.preventDefault(), a()));
|
|
4820
|
-
},
|
|
4820
|
+
}, h), v.useEffect(() => {
|
|
4821
4821
|
if (d)
|
|
4822
|
-
return n && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (Ol =
|
|
4823
|
-
n && c.layersWithOutsidePointerEventsDisabled.size === 1 && (
|
|
4822
|
+
return n && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (Ol = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(d)), c.layers.add(d), Dl(), () => {
|
|
4823
|
+
n && c.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = Ol);
|
|
4824
4824
|
};
|
|
4825
|
-
}, [d,
|
|
4825
|
+
}, [d, h, n, c]), v.useEffect(() => () => {
|
|
4826
4826
|
d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), Dl());
|
|
4827
4827
|
}, [d, c]), v.useEffect(() => {
|
|
4828
|
-
const I = () =>
|
|
4828
|
+
const I = () => p({});
|
|
4829
4829
|
return document.addEventListener(Pi, I), () => document.removeEventListener(Pi, I);
|
|
4830
4830
|
}, []), /* @__PURE__ */ u.jsx(
|
|
4831
4831
|
_e.div,
|
|
@@ -4930,7 +4930,7 @@ var ii = "focusScope.autoFocusOnMount", ai = "focusScope.autoFocusOnUnmount", $l
|
|
|
4930
4930
|
onMountAutoFocus: o,
|
|
4931
4931
|
onUnmountAutoFocus: s,
|
|
4932
4932
|
...i
|
|
4933
|
-
} = e, [a, l] = v.useState(null), c = At(o), d = At(s), f = v.useRef(null),
|
|
4933
|
+
} = e, [a, l] = v.useState(null), c = At(o), d = At(s), f = v.useRef(null), h = Ue(t, (m) => l(m)), p = v.useRef({
|
|
4934
4934
|
paused: !1,
|
|
4935
4935
|
pause() {
|
|
4936
4936
|
this.paused = !0;
|
|
@@ -4942,11 +4942,11 @@ var ii = "focusScope.autoFocusOnMount", ai = "focusScope.autoFocusOnUnmount", $l
|
|
|
4942
4942
|
v.useEffect(() => {
|
|
4943
4943
|
if (r) {
|
|
4944
4944
|
let m = function(b) {
|
|
4945
|
-
if (
|
|
4945
|
+
if (p.paused || !a) return;
|
|
4946
4946
|
const T = b.target;
|
|
4947
4947
|
a.contains(T) ? f.current = T : Pn(f.current, { select: !0 });
|
|
4948
4948
|
}, y = function(b) {
|
|
4949
|
-
if (
|
|
4949
|
+
if (p.paused || !a) return;
|
|
4950
4950
|
const T = b.relatedTarget;
|
|
4951
4951
|
T !== null && (a.contains(T) || Pn(f.current, { select: !0 }));
|
|
4952
4952
|
}, g = function(b) {
|
|
@@ -4960,9 +4960,9 @@ var ii = "focusScope.autoFocusOnMount", ai = "focusScope.autoFocusOnUnmount", $l
|
|
|
4960
4960
|
document.removeEventListener("focusin", m), document.removeEventListener("focusout", y), w.disconnect();
|
|
4961
4961
|
};
|
|
4962
4962
|
}
|
|
4963
|
-
}, [r, a,
|
|
4963
|
+
}, [r, a, p.paused]), v.useEffect(() => {
|
|
4964
4964
|
if (a) {
|
|
4965
|
-
Bl.add(
|
|
4965
|
+
Bl.add(p);
|
|
4966
4966
|
const m = document.activeElement;
|
|
4967
4967
|
if (!a.contains(m)) {
|
|
4968
4968
|
const g = new CustomEvent(ii, $l);
|
|
@@ -4971,23 +4971,23 @@ var ii = "focusScope.autoFocusOnMount", ai = "focusScope.autoFocusOnUnmount", $l
|
|
|
4971
4971
|
return () => {
|
|
4972
4972
|
a.removeEventListener(ii, c), setTimeout(() => {
|
|
4973
4973
|
const g = new CustomEvent(ai, $l);
|
|
4974
|
-
a.addEventListener(ai, d), a.dispatchEvent(g), g.defaultPrevented || Pn(m ?? document.body, { select: !0 }), a.removeEventListener(ai, d), Bl.remove(
|
|
4974
|
+
a.addEventListener(ai, d), a.dispatchEvent(g), g.defaultPrevented || Pn(m ?? document.body, { select: !0 }), a.removeEventListener(ai, d), Bl.remove(p);
|
|
4975
4975
|
}, 0);
|
|
4976
4976
|
};
|
|
4977
4977
|
}
|
|
4978
|
-
}, [a, c, d,
|
|
4978
|
+
}, [a, c, d, p]);
|
|
4979
4979
|
const x = v.useCallback(
|
|
4980
4980
|
(m) => {
|
|
4981
|
-
if (!n && !r ||
|
|
4981
|
+
if (!n && !r || p.paused) return;
|
|
4982
4982
|
const y = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, g = document.activeElement;
|
|
4983
4983
|
if (y && g) {
|
|
4984
4984
|
const w = m.currentTarget, [b, T] = xy(w);
|
|
4985
4985
|
b && T ? !m.shiftKey && g === T ? (m.preventDefault(), n && Pn(b, { select: !0 })) : m.shiftKey && g === b && (m.preventDefault(), n && Pn(T, { select: !0 })) : g === w && m.preventDefault();
|
|
4986
4986
|
}
|
|
4987
4987
|
},
|
|
4988
|
-
[n, r,
|
|
4988
|
+
[n, r, p.paused]
|
|
4989
4989
|
);
|
|
4990
|
-
return /* @__PURE__ */ u.jsx(_e.div, { tabIndex: -1, ...i, ref:
|
|
4990
|
+
return /* @__PURE__ */ u.jsx(_e.div, { tabIndex: -1, ...i, ref: h, onKeyDown: x });
|
|
4991
4991
|
});
|
|
4992
4992
|
Ts.displayName = my;
|
|
4993
4993
|
function gy(e, { select: t = !1 } = {}) {
|
|
@@ -5171,48 +5171,48 @@ function Wl(e, t, n) {
|
|
|
5171
5171
|
reference: r,
|
|
5172
5172
|
floating: o
|
|
5173
5173
|
} = e;
|
|
5174
|
-
const s = xn(t), i = ga(t), a = ma(i), l = An(t), c = s === "y", d = r.x + r.width / 2 - o.width / 2, f = r.y + r.height / 2 - o.height / 2,
|
|
5175
|
-
let
|
|
5174
|
+
const s = xn(t), i = ga(t), a = ma(i), l = An(t), c = s === "y", d = r.x + r.width / 2 - o.width / 2, f = r.y + r.height / 2 - o.height / 2, h = r[a] / 2 - o[a] / 2;
|
|
5175
|
+
let p;
|
|
5176
5176
|
switch (l) {
|
|
5177
5177
|
case "top":
|
|
5178
|
-
|
|
5178
|
+
p = {
|
|
5179
5179
|
x: d,
|
|
5180
5180
|
y: r.y - o.height
|
|
5181
5181
|
};
|
|
5182
5182
|
break;
|
|
5183
5183
|
case "bottom":
|
|
5184
|
-
|
|
5184
|
+
p = {
|
|
5185
5185
|
x: d,
|
|
5186
5186
|
y: r.y + r.height
|
|
5187
5187
|
};
|
|
5188
5188
|
break;
|
|
5189
5189
|
case "right":
|
|
5190
|
-
|
|
5190
|
+
p = {
|
|
5191
5191
|
x: r.x + r.width,
|
|
5192
5192
|
y: f
|
|
5193
5193
|
};
|
|
5194
5194
|
break;
|
|
5195
5195
|
case "left":
|
|
5196
|
-
|
|
5196
|
+
p = {
|
|
5197
5197
|
x: r.x - o.width,
|
|
5198
5198
|
y: f
|
|
5199
5199
|
};
|
|
5200
5200
|
break;
|
|
5201
5201
|
default:
|
|
5202
|
-
|
|
5202
|
+
p = {
|
|
5203
5203
|
x: r.x,
|
|
5204
5204
|
y: r.y
|
|
5205
5205
|
};
|
|
5206
5206
|
}
|
|
5207
5207
|
switch (Er(t)) {
|
|
5208
5208
|
case "start":
|
|
5209
|
-
|
|
5209
|
+
p[i] -= h * (n && c ? -1 : 1);
|
|
5210
5210
|
break;
|
|
5211
5211
|
case "end":
|
|
5212
|
-
|
|
5212
|
+
p[i] += h * (n && c ? -1 : 1);
|
|
5213
5213
|
break;
|
|
5214
5214
|
}
|
|
5215
|
-
return
|
|
5215
|
+
return p;
|
|
5216
5216
|
}
|
|
5217
5217
|
const Oy = async (e, t, n) => {
|
|
5218
5218
|
const {
|
|
@@ -5228,7 +5228,7 @@ const Oy = async (e, t, n) => {
|
|
|
5228
5228
|
}), {
|
|
5229
5229
|
x: d,
|
|
5230
5230
|
y: f
|
|
5231
|
-
} = Wl(c, r, l),
|
|
5231
|
+
} = Wl(c, r, l), h = r, p = {}, x = 0;
|
|
5232
5232
|
for (let m = 0; m < a.length; m++) {
|
|
5233
5233
|
const {
|
|
5234
5234
|
name: y,
|
|
@@ -5242,9 +5242,9 @@ const Oy = async (e, t, n) => {
|
|
|
5242
5242
|
x: d,
|
|
5243
5243
|
y: f,
|
|
5244
5244
|
initialPlacement: r,
|
|
5245
|
-
placement:
|
|
5245
|
+
placement: h,
|
|
5246
5246
|
strategy: o,
|
|
5247
|
-
middlewareData:
|
|
5247
|
+
middlewareData: p,
|
|
5248
5248
|
rects: c,
|
|
5249
5249
|
platform: i,
|
|
5250
5250
|
elements: {
|
|
@@ -5252,27 +5252,27 @@ const Oy = async (e, t, n) => {
|
|
|
5252
5252
|
floating: t
|
|
5253
5253
|
}
|
|
5254
5254
|
});
|
|
5255
|
-
d = w ?? d, f = b ?? f,
|
|
5256
|
-
...
|
|
5255
|
+
d = w ?? d, f = b ?? f, p = {
|
|
5256
|
+
...p,
|
|
5257
5257
|
[y]: {
|
|
5258
|
-
...
|
|
5258
|
+
...p[y],
|
|
5259
5259
|
...T
|
|
5260
5260
|
}
|
|
5261
|
-
}, S && x <= 50 && (x++, typeof S == "object" && (S.placement && (
|
|
5261
|
+
}, S && x <= 50 && (x++, typeof S == "object" && (S.placement && (h = S.placement), S.rects && (c = S.rects === !0 ? await i.getElementRects({
|
|
5262
5262
|
reference: e,
|
|
5263
5263
|
floating: t,
|
|
5264
5264
|
strategy: o
|
|
5265
5265
|
}) : S.rects), {
|
|
5266
5266
|
x: d,
|
|
5267
5267
|
y: f
|
|
5268
|
-
} = Wl(c,
|
|
5268
|
+
} = Wl(c, h, l)), m = -1);
|
|
5269
5269
|
}
|
|
5270
5270
|
return {
|
|
5271
5271
|
x: d,
|
|
5272
5272
|
y: f,
|
|
5273
|
-
placement:
|
|
5273
|
+
placement: h,
|
|
5274
5274
|
strategy: o,
|
|
5275
|
-
middlewareData:
|
|
5275
|
+
middlewareData: p
|
|
5276
5276
|
};
|
|
5277
5277
|
};
|
|
5278
5278
|
async function Gr(e, t) {
|
|
@@ -5289,9 +5289,9 @@ async function Gr(e, t) {
|
|
|
5289
5289
|
boundary: c = "clippingAncestors",
|
|
5290
5290
|
rootBoundary: d = "viewport",
|
|
5291
5291
|
elementContext: f = "floating",
|
|
5292
|
-
altBoundary:
|
|
5293
|
-
padding:
|
|
5294
|
-
} = En(t, e), x = Eu(
|
|
5292
|
+
altBoundary: h = !1,
|
|
5293
|
+
padding: p = 0
|
|
5294
|
+
} = En(t, e), x = Eu(p), y = a[h ? f === "floating" ? "reference" : "floating" : f], g = Xo(await s.getClippingRect({
|
|
5295
5295
|
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)),
|
|
5296
5296
|
boundary: c,
|
|
5297
5297
|
rootBoundary: d,
|
|
@@ -5338,17 +5338,17 @@ const Dy = (e) => ({
|
|
|
5338
5338
|
} = En(e, t) || {};
|
|
5339
5339
|
if (c == null)
|
|
5340
5340
|
return {};
|
|
5341
|
-
const f = Eu(d),
|
|
5341
|
+
const f = Eu(d), h = {
|
|
5342
5342
|
x: n,
|
|
5343
5343
|
y: r
|
|
5344
|
-
},
|
|
5344
|
+
}, p = ga(o), x = ma(p), m = await i.getDimensions(c), y = p === "y", g = y ? "top" : "left", w = y ? "bottom" : "right", b = y ? "clientHeight" : "clientWidth", T = s.reference[x] + s.reference[p] - h[p] - s.floating[x], S = h[p] - s.reference[p], C = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c));
|
|
5345
5345
|
let I = C ? C[b] : 0;
|
|
5346
5346
|
(!I || !await (i.isElement == null ? void 0 : i.isElement(C))) && (I = a.floating[b] || s.floating[x]);
|
|
5347
5347
|
const R = T / 2 - S / 2, _ = I / 2 - m[x] / 2 - 1, D = On(f[g], _), P = On(f[w], _), M = D, $ = I - m[x] - P, E = I / 2 - m[x] / 2 + R, F = Mi(M, E, $), N = !l.arrow && Er(o) != null && E !== F && s.reference[x] / 2 - (E < M ? D : P) - m[x] / 2 < 0, W = N ? E < M ? E - M : E - $ : 0;
|
|
5348
5348
|
return {
|
|
5349
|
-
[
|
|
5349
|
+
[p]: h[p] + W,
|
|
5350
5350
|
data: {
|
|
5351
|
-
[
|
|
5351
|
+
[p]: F,
|
|
5352
5352
|
centerOffset: E - F - W,
|
|
5353
5353
|
...N && {
|
|
5354
5354
|
alignmentOffset: W
|
|
@@ -5373,16 +5373,16 @@ const Dy = (e) => ({
|
|
|
5373
5373
|
} = t, {
|
|
5374
5374
|
mainAxis: d = !0,
|
|
5375
5375
|
crossAxis: f = !0,
|
|
5376
|
-
fallbackPlacements:
|
|
5377
|
-
fallbackStrategy:
|
|
5376
|
+
fallbackPlacements: h,
|
|
5377
|
+
fallbackStrategy: p = "bestFit",
|
|
5378
5378
|
fallbackAxisSideDirection: x = "none",
|
|
5379
5379
|
flipAlignment: m = !0,
|
|
5380
5380
|
...y
|
|
5381
5381
|
} = En(e, t);
|
|
5382
5382
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
5383
5383
|
return {};
|
|
5384
|
-
const g = An(o), w = xn(a), b = An(a) === a, T = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), S =
|
|
5385
|
-
!
|
|
5384
|
+
const g = An(o), w = xn(a), b = An(a) === a, T = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), S = h || (b || !m ? [Yo(a)] : Ay(a)), C = x !== "none";
|
|
5385
|
+
!h && C && S.push(...Py(a, m, x, T));
|
|
5386
5386
|
const I = [a, ...S], R = await Gr(t, y), _ = [];
|
|
5387
5387
|
let D = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
5388
5388
|
if (d && _.push(R[g]), f) {
|
|
@@ -5409,7 +5409,7 @@ const Dy = (e) => ({
|
|
|
5409
5409
|
};
|
|
5410
5410
|
let N = (M = D.filter((W) => W.overflows[0] <= 0).sort((W, B) => W.overflows[1] - B.overflows[1])[0]) == null ? void 0 : M.placement;
|
|
5411
5411
|
if (!N)
|
|
5412
|
-
switch (
|
|
5412
|
+
switch (p) {
|
|
5413
5413
|
case "bestFit": {
|
|
5414
5414
|
var $;
|
|
5415
5415
|
const W = ($ = D.filter((B) => {
|
|
@@ -5499,8 +5499,8 @@ async function Fy(e, t) {
|
|
|
5499
5499
|
elements: o
|
|
5500
5500
|
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = An(n), a = Er(n), l = xn(n) === "y", c = Au.has(i) ? -1 : 1, d = s && l ? -1 : 1, f = En(t, e);
|
|
5501
5501
|
let {
|
|
5502
|
-
mainAxis:
|
|
5503
|
-
crossAxis:
|
|
5502
|
+
mainAxis: h,
|
|
5503
|
+
crossAxis: p,
|
|
5504
5504
|
alignmentAxis: x
|
|
5505
5505
|
} = typeof f == "number" ? {
|
|
5506
5506
|
mainAxis: f,
|
|
@@ -5511,12 +5511,12 @@ async function Fy(e, t) {
|
|
|
5511
5511
|
crossAxis: f.crossAxis || 0,
|
|
5512
5512
|
alignmentAxis: f.alignmentAxis
|
|
5513
5513
|
};
|
|
5514
|
-
return a && typeof x == "number" && (
|
|
5515
|
-
x:
|
|
5516
|
-
y:
|
|
5514
|
+
return a && typeof x == "number" && (p = a === "end" ? x * -1 : x), l ? {
|
|
5515
|
+
x: p * d,
|
|
5516
|
+
y: h * c
|
|
5517
5517
|
} : {
|
|
5518
|
-
x:
|
|
5519
|
-
y:
|
|
5518
|
+
x: h * c,
|
|
5519
|
+
y: p * d
|
|
5520
5520
|
};
|
|
5521
5521
|
}
|
|
5522
5522
|
const By = function(e) {
|
|
@@ -5569,11 +5569,11 @@ const By = function(e) {
|
|
|
5569
5569
|
} = En(e, t), c = {
|
|
5570
5570
|
x: n,
|
|
5571
5571
|
y: r
|
|
5572
|
-
}, d = await Gr(t, l), f = xn(An(o)),
|
|
5573
|
-
let
|
|
5572
|
+
}, d = await Gr(t, l), f = xn(An(o)), h = ha(f);
|
|
5573
|
+
let p = c[h], x = c[f];
|
|
5574
5574
|
if (s) {
|
|
5575
|
-
const y =
|
|
5576
|
-
|
|
5575
|
+
const y = h === "y" ? "top" : "left", g = h === "y" ? "bottom" : "right", w = p + d[y], b = p - d[g];
|
|
5576
|
+
p = Mi(w, p, b);
|
|
5577
5577
|
}
|
|
5578
5578
|
if (i) {
|
|
5579
5579
|
const y = f === "y" ? "top" : "left", g = f === "y" ? "bottom" : "right", w = x + d[y], b = x - d[g];
|
|
@@ -5581,7 +5581,7 @@ const By = function(e) {
|
|
|
5581
5581
|
}
|
|
5582
5582
|
const m = a.fn({
|
|
5583
5583
|
...t,
|
|
5584
|
-
[
|
|
5584
|
+
[h]: p,
|
|
5585
5585
|
[f]: x
|
|
5586
5586
|
});
|
|
5587
5587
|
return {
|
|
@@ -5590,7 +5590,7 @@ const By = function(e) {
|
|
|
5590
5590
|
x: m.x - n,
|
|
5591
5591
|
y: m.y - r,
|
|
5592
5592
|
enabled: {
|
|
5593
|
-
[
|
|
5593
|
+
[h]: s,
|
|
5594
5594
|
[f]: i
|
|
5595
5595
|
}
|
|
5596
5596
|
}
|
|
@@ -5614,8 +5614,8 @@ const By = function(e) {
|
|
|
5614
5614
|
} = En(e, t), d = {
|
|
5615
5615
|
x: n,
|
|
5616
5616
|
y: r
|
|
5617
|
-
}, f = xn(o),
|
|
5618
|
-
let
|
|
5617
|
+
}, f = xn(o), h = ha(f);
|
|
5618
|
+
let p = d[h], x = d[f];
|
|
5619
5619
|
const m = En(a, t), y = typeof m == "number" ? {
|
|
5620
5620
|
mainAxis: m,
|
|
5621
5621
|
crossAxis: 0
|
|
@@ -5625,16 +5625,16 @@ const By = function(e) {
|
|
|
5625
5625
|
...m
|
|
5626
5626
|
};
|
|
5627
5627
|
if (l) {
|
|
5628
|
-
const b =
|
|
5629
|
-
|
|
5628
|
+
const b = h === "y" ? "height" : "width", T = s.reference[h] - s.floating[b] + y.mainAxis, S = s.reference[h] + s.reference[b] - y.mainAxis;
|
|
5629
|
+
p < T ? p = T : p > S && (p = S);
|
|
5630
5630
|
}
|
|
5631
5631
|
if (c) {
|
|
5632
5632
|
var g, w;
|
|
5633
|
-
const b =
|
|
5633
|
+
const b = h === "y" ? "width" : "height", T = Au.has(An(o)), S = s.reference[f] - s.floating[b] + (T && ((g = i.offset) == null ? void 0 : g[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);
|
|
5634
5634
|
x < S ? x = S : x > C && (x = C);
|
|
5635
5635
|
}
|
|
5636
5636
|
return {
|
|
5637
|
-
[
|
|
5637
|
+
[h]: p,
|
|
5638
5638
|
[f]: x
|
|
5639
5639
|
};
|
|
5640
5640
|
}
|
|
@@ -5654,17 +5654,17 @@ const By = function(e) {
|
|
|
5654
5654
|
apply: l = () => {
|
|
5655
5655
|
},
|
|
5656
5656
|
...c
|
|
5657
|
-
} = En(e, t), d = await Gr(t, c), f = An(o),
|
|
5657
|
+
} = En(e, t), d = await Gr(t, c), f = An(o), h = Er(o), p = xn(o) === "y", {
|
|
5658
5658
|
width: x,
|
|
5659
5659
|
height: m
|
|
5660
5660
|
} = s.floating;
|
|
5661
5661
|
let y, g;
|
|
5662
|
-
f === "top" || f === "bottom" ? (y = f, g =
|
|
5662
|
+
f === "top" || f === "bottom" ? (y = f, g = h === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (g = f, y = h === "end" ? "top" : "bottom");
|
|
5663
5663
|
const w = m - d.top - d.bottom, b = x - d.left - d.right, T = On(m - d[y], w), S = On(x - d[g], b), C = !t.middlewareData.shift;
|
|
5664
5664
|
let I = T, R = S;
|
|
5665
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (R = b), (r = t.middlewareData.shift) != null && r.enabled.y && (I = w), C && !
|
|
5665
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (R = b), (r = t.middlewareData.shift) != null && r.enabled.y && (I = w), C && !h) {
|
|
5666
5666
|
const D = Vt(d.left, 0), P = Vt(d.right, 0), M = Vt(d.top, 0), $ = Vt(d.bottom, 0);
|
|
5667
|
-
|
|
5667
|
+
p ? R = x - 2 * (D !== 0 || P !== 0 ? D + P : Vt(d.left, d.right)) : I = m - 2 * (M !== 0 || $ !== 0 ? M + $ : Vt(d.top, d.bottom));
|
|
5668
5668
|
}
|
|
5669
5669
|
await l({
|
|
5670
5670
|
...t,
|
|
@@ -5841,9 +5841,9 @@ function er(e, t, n, r) {
|
|
|
5841
5841
|
const a = ev(s, n, r) ? Pu(s) : vn(0);
|
|
5842
5842
|
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;
|
|
5843
5843
|
if (s) {
|
|
5844
|
-
const
|
|
5845
|
-
let x =
|
|
5846
|
-
for (; m && r &&
|
|
5844
|
+
const h = qt(s), p = r && ln(r) ? qt(r) : r;
|
|
5845
|
+
let x = h, m = Di(x);
|
|
5846
|
+
for (; m && r && p !== x; ) {
|
|
5847
5847
|
const y = xr(m), g = m.getBoundingClientRect(), w = cn(m), b = g.left + (m.clientLeft + parseFloat(w.paddingLeft)) * y.x, T = g.top + (m.clientTop + parseFloat(w.paddingTop)) * y.y;
|
|
5848
5848
|
l *= y.x, c *= y.y, d *= y.x, f *= y.y, l += b, c += T, x = qt(m), m = Di(x);
|
|
5849
5849
|
}
|
|
@@ -5882,15 +5882,15 @@ function tv(e) {
|
|
|
5882
5882
|
}, c = vn(1);
|
|
5883
5883
|
const d = vn(0), f = wn(r);
|
|
5884
5884
|
if ((f || !f && !s) && ((Ar(r) !== "body" || uo(i)) && (l = Rs(r)), wn(r))) {
|
|
5885
|
-
const
|
|
5886
|
-
c = xr(r), d.x =
|
|
5885
|
+
const p = er(r);
|
|
5886
|
+
c = xr(r), d.x = p.x + r.clientLeft, d.y = p.y + r.clientTop;
|
|
5887
5887
|
}
|
|
5888
|
-
const
|
|
5888
|
+
const h = i && !f && !s ? Mu(i, l) : vn(0);
|
|
5889
5889
|
return {
|
|
5890
5890
|
width: n.width * c.x,
|
|
5891
5891
|
height: n.height * c.y,
|
|
5892
|
-
x: n.x * c.x - l.scrollLeft * c.x + d.x +
|
|
5893
|
-
y: n.y * c.y - l.scrollTop * c.y + d.y +
|
|
5892
|
+
x: n.x * c.x - l.scrollLeft * c.x + d.x + h.x,
|
|
5893
|
+
y: n.y * c.y - l.scrollTop * c.y + d.y + h.y
|
|
5894
5894
|
};
|
|
5895
5895
|
}
|
|
5896
5896
|
function nv(e) {
|
|
@@ -5918,7 +5918,7 @@ function ov(e, t) {
|
|
|
5918
5918
|
}
|
|
5919
5919
|
const c = Es(r);
|
|
5920
5920
|
if (c <= 0) {
|
|
5921
|
-
const d = r.ownerDocument, f = d.body,
|
|
5921
|
+
const d = r.ownerDocument, f = d.body, h = getComputedStyle(f), p = d.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, x = Math.abs(r.clientWidth - f.clientWidth - p);
|
|
5922
5922
|
x <= Gl && (s -= x);
|
|
5923
5923
|
} else c <= Gl && (s += c);
|
|
5924
5924
|
return {
|
|
@@ -6014,14 +6014,14 @@ function uv(e, t, n) {
|
|
|
6014
6014
|
}
|
|
6015
6015
|
if (r || !r && !s)
|
|
6016
6016
|
if ((Ar(t) !== "body" || uo(o)) && (a = Rs(t)), r) {
|
|
6017
|
-
const
|
|
6018
|
-
l.x =
|
|
6017
|
+
const p = er(t, !0, s, t);
|
|
6018
|
+
l.x = p.x + t.clientLeft, l.y = p.y + t.clientTop;
|
|
6019
6019
|
} else o && c();
|
|
6020
6020
|
s && !r && o && c();
|
|
6021
|
-
const d = o && !r && !s ? Mu(o, a) : vn(0), f = i.left + a.scrollLeft - l.x - d.x,
|
|
6021
|
+
const d = o && !r && !s ? Mu(o, a) : vn(0), f = i.left + a.scrollLeft - l.x - d.x, h = i.top + a.scrollTop - l.y - d.y;
|
|
6022
6022
|
return {
|
|
6023
6023
|
x: f,
|
|
6024
|
-
y:
|
|
6024
|
+
y: h,
|
|
6025
6025
|
width: i.width,
|
|
6026
6026
|
height: i.height
|
|
6027
6027
|
};
|
|
@@ -6097,12 +6097,12 @@ function hv(e, t) {
|
|
|
6097
6097
|
const c = e.getBoundingClientRect(), {
|
|
6098
6098
|
left: d,
|
|
6099
6099
|
top: f,
|
|
6100
|
-
width:
|
|
6101
|
-
height:
|
|
6100
|
+
width: h,
|
|
6101
|
+
height: p
|
|
6102
6102
|
} = c;
|
|
6103
|
-
if (a || t(), !
|
|
6103
|
+
if (a || t(), !h || !p)
|
|
6104
6104
|
return;
|
|
6105
|
-
const x = bo(f), m = bo(o.clientWidth - (d +
|
|
6105
|
+
const x = bo(f), m = bo(o.clientWidth - (d + h)), y = bo(o.clientHeight - (f + p)), g = bo(d), b = {
|
|
6106
6106
|
rootMargin: -x + "px " + -m + "px " + -y + "px " + -g + "px",
|
|
6107
6107
|
threshold: Vt(0, On(1, l)) || 1
|
|
6108
6108
|
};
|
|
@@ -6146,14 +6146,14 @@ function mv(e, t, n, r) {
|
|
|
6146
6146
|
}), s && g.addEventListener("resize", n);
|
|
6147
6147
|
});
|
|
6148
6148
|
const f = c && a ? hv(c, n) : null;
|
|
6149
|
-
let
|
|
6150
|
-
i && (
|
|
6149
|
+
let h = -1, p = null;
|
|
6150
|
+
i && (p = new ResizeObserver((g) => {
|
|
6151
6151
|
let [w] = g;
|
|
6152
|
-
w && w.target === c &&
|
|
6152
|
+
w && w.target === c && p && (p.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
6153
6153
|
var b;
|
|
6154
|
-
(b =
|
|
6154
|
+
(b = p) == null || b.observe(t);
|
|
6155
6155
|
})), n();
|
|
6156
|
-
}), c && !l &&
|
|
6156
|
+
}), c && !l && p.observe(c), p.observe(t));
|
|
6157
6157
|
let x, m = l ? er(e) : null;
|
|
6158
6158
|
l && y();
|
|
6159
6159
|
function y() {
|
|
@@ -6164,7 +6164,7 @@ function mv(e, t, n, r) {
|
|
|
6164
6164
|
var g;
|
|
6165
6165
|
d.forEach((w) => {
|
|
6166
6166
|
o && w.removeEventListener("scroll", n), s && w.removeEventListener("resize", n);
|
|
6167
|
-
}), f == null || f(), (g =
|
|
6167
|
+
}), f == null || f(), (g = p) == null || g.disconnect(), p = null, l && cancelAnimationFrame(x);
|
|
6168
6168
|
};
|
|
6169
6169
|
}
|
|
6170
6170
|
const gv = By, xv = zy, yv = Ly, vv = Uy, wv = $y, Jl = Dy, bv = Hy, Sv = (e, t, n) => {
|
|
@@ -6246,8 +6246,8 @@ function Iv(e) {
|
|
|
6246
6246
|
placement: t,
|
|
6247
6247
|
middlewareData: {},
|
|
6248
6248
|
isPositioned: !1
|
|
6249
|
-
}), [
|
|
6250
|
-
Jo(
|
|
6249
|
+
}), [h, p] = v.useState(r);
|
|
6250
|
+
Jo(h, r) || p(r);
|
|
6251
6251
|
const [x, m] = v.useState(null), [y, g] = v.useState(null), w = v.useCallback((B) => {
|
|
6252
6252
|
B !== C.current && (C.current = B, m(B));
|
|
6253
6253
|
}, []), b = v.useCallback((B) => {
|
|
@@ -6258,7 +6258,7 @@ function Iv(e) {
|
|
|
6258
6258
|
const B = {
|
|
6259
6259
|
placement: t,
|
|
6260
6260
|
strategy: n,
|
|
6261
|
-
middleware:
|
|
6261
|
+
middleware: h
|
|
6262
6262
|
};
|
|
6263
6263
|
P.current && (B.platform = P.current), Sv(C.current, I.current, B).then((j) => {
|
|
6264
6264
|
const K = {
|
|
@@ -6273,7 +6273,7 @@ function Iv(e) {
|
|
|
6273
6273
|
f(K);
|
|
6274
6274
|
}));
|
|
6275
6275
|
});
|
|
6276
|
-
}, [
|
|
6276
|
+
}, [h, t, n, P, M]);
|
|
6277
6277
|
Do(() => {
|
|
6278
6278
|
c === !1 && R.current.isPositioned && (R.current.isPositioned = !1, f((B) => ({
|
|
6279
6279
|
...B,
|
|
@@ -6438,8 +6438,8 @@ var ba = "PopperContent", [Lv, $v] = zu(ba), Ku = v.forwardRef(
|
|
|
6438
6438
|
collisionBoundary: c = [],
|
|
6439
6439
|
collisionPadding: d = 0,
|
|
6440
6440
|
sticky: f = "partial",
|
|
6441
|
-
hideWhenDetached:
|
|
6442
|
-
updatePositionStrategy:
|
|
6441
|
+
hideWhenDetached: h = !1,
|
|
6442
|
+
updatePositionStrategy: p = "optimized",
|
|
6443
6443
|
onPlaced: x,
|
|
6444
6444
|
...m
|
|
6445
6445
|
} = e, y = Hu(ba, n), [g, w] = v.useState(null), b = Ue(t, (Ee) => w(Ee)), [T, S] = v.useState(null), C = Bu(T), I = (C == null ? void 0 : C.width) ?? 0, R = (C == null ? void 0 : C.height) ?? 0, _ = r + (s !== "center" ? "-" + s : ""), D = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, P = Array.isArray(c) ? c : [c], M = P.length > 0, $ = {
|
|
@@ -6452,7 +6452,7 @@ var ba = "PopperContent", [Lv, $v] = zu(ba), Ku = v.forwardRef(
|
|
|
6452
6452
|
strategy: "fixed",
|
|
6453
6453
|
placement: _,
|
|
6454
6454
|
whileElementsMounted: (...Ee) => mv(...Ee, {
|
|
6455
|
-
animationFrame:
|
|
6455
|
+
animationFrame: p === "always"
|
|
6456
6456
|
}),
|
|
6457
6457
|
elements: {
|
|
6458
6458
|
reference: y.anchor
|
|
@@ -6475,7 +6475,7 @@ var ba = "PopperContent", [Lv, $v] = zu(ba), Ku = v.forwardRef(
|
|
|
6475
6475
|
}),
|
|
6476
6476
|
T && Pv({ element: T, padding: a }),
|
|
6477
6477
|
zv({ arrowWidth: I, arrowHeight: R }),
|
|
6478
|
-
|
|
6478
|
+
h && jv({ strategy: "referenceHidden", ...$ })
|
|
6479
6479
|
]
|
|
6480
6480
|
}), [j, K] = Yu(N), X = At(x);
|
|
6481
6481
|
Nt(() => {
|
|
@@ -6598,9 +6598,9 @@ var zv = (e) => ({
|
|
|
6598
6598
|
options: e,
|
|
6599
6599
|
fn(t) {
|
|
6600
6600
|
var y, g, w;
|
|
6601
|
-
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] = Yu(n), f = { start: "0%", center: "50%", end: "100%" }[d],
|
|
6601
|
+
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] = Yu(n), f = { start: "0%", center: "50%", end: "100%" }[d], h = (((g = o.arrow) == null ? void 0 : g.x) ?? 0) + a / 2, p = (((w = o.arrow) == null ? void 0 : w.y) ?? 0) + l / 2;
|
|
6602
6602
|
let x = "", m = "";
|
|
6603
|
-
return c === "bottom" ? (x = i ? f : `${
|
|
6603
|
+
return c === "bottom" ? (x = i ? f : `${h}px`, m = `${-l}px`) : c === "top" ? (x = i ? f : `${h}px`, m = `${r.floating.height + l}px`) : c === "right" ? (x = `${-l}px`, m = i ? f : `${p}px`) : c === "left" && (x = `${r.floating.width + l}px`, m = i ? f : `${p}px`), { data: { x, y: m } };
|
|
6604
6604
|
}
|
|
6605
6605
|
});
|
|
6606
6606
|
function Yu(e) {
|
|
@@ -6643,25 +6643,25 @@ function Wv(e) {
|
|
|
6643
6643
|
}, [a]), Nt(() => {
|
|
6644
6644
|
const c = r.current, d = o.current;
|
|
6645
6645
|
if (d !== e) {
|
|
6646
|
-
const
|
|
6647
|
-
e ? l("MOUNT") :
|
|
6646
|
+
const h = s.current, p = So(c);
|
|
6647
|
+
e ? l("MOUNT") : p === "none" || (c == null ? void 0 : c.display) === "none" ? l("UNMOUNT") : l(d && h !== p ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
|
|
6648
6648
|
}
|
|
6649
6649
|
}, [e, l]), Nt(() => {
|
|
6650
6650
|
if (t) {
|
|
6651
6651
|
let c;
|
|
6652
|
-
const d = t.ownerDocument.defaultView ?? window, f = (
|
|
6653
|
-
const m = So(r.current).includes(CSS.escape(
|
|
6654
|
-
if (
|
|
6652
|
+
const d = t.ownerDocument.defaultView ?? window, f = (p) => {
|
|
6653
|
+
const m = So(r.current).includes(CSS.escape(p.animationName));
|
|
6654
|
+
if (p.target === t && m && (l("ANIMATION_END"), !o.current)) {
|
|
6655
6655
|
const y = t.style.animationFillMode;
|
|
6656
6656
|
t.style.animationFillMode = "forwards", c = d.setTimeout(() => {
|
|
6657
6657
|
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = y);
|
|
6658
6658
|
});
|
|
6659
6659
|
}
|
|
6660
|
-
},
|
|
6661
|
-
|
|
6660
|
+
}, h = (p) => {
|
|
6661
|
+
p.target === t && (s.current = So(r.current));
|
|
6662
6662
|
};
|
|
6663
|
-
return t.addEventListener("animationstart",
|
|
6664
|
-
d.clearTimeout(c), t.removeEventListener("animationstart",
|
|
6663
|
+
return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", f), t.addEventListener("animationend", f), () => {
|
|
6664
|
+
d.clearTimeout(c), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", f), t.removeEventListener("animationend", f);
|
|
6665
6665
|
};
|
|
6666
6666
|
} else
|
|
6667
6667
|
l("ANIMATION_END");
|
|
@@ -6699,14 +6699,14 @@ var Jv = v.forwardRef((e, t) => {
|
|
|
6699
6699
|
onEntryFocus: c,
|
|
6700
6700
|
preventScrollOnEntryFocus: d = !1,
|
|
6701
6701
|
...f
|
|
6702
|
-
} = e,
|
|
6702
|
+
} = e, h = v.useRef(null), p = Ue(t, h), x = Ss(s), [m, y] = Cr({
|
|
6703
6703
|
prop: i,
|
|
6704
6704
|
defaultProp: a ?? null,
|
|
6705
6705
|
onChange: l,
|
|
6706
6706
|
caller: fo
|
|
6707
6707
|
}), [g, w] = v.useState(!1), b = At(c), T = ed(n), S = v.useRef(!1), [C, I] = v.useState(0);
|
|
6708
6708
|
return v.useEffect(() => {
|
|
6709
|
-
const R =
|
|
6709
|
+
const R = h.current;
|
|
6710
6710
|
if (R)
|
|
6711
6711
|
return R.addEventListener(ui, b), () => R.removeEventListener(ui, b);
|
|
6712
6712
|
}, [b]), /* @__PURE__ */ u.jsx(
|
|
@@ -6736,7 +6736,7 @@ var Jv = v.forwardRef((e, t) => {
|
|
|
6736
6736
|
tabIndex: g || C === 0 ? -1 : 0,
|
|
6737
6737
|
"data-orientation": r,
|
|
6738
6738
|
...f,
|
|
6739
|
-
ref:
|
|
6739
|
+
ref: p,
|
|
6740
6740
|
style: { outline: "none", ...e.style },
|
|
6741
6741
|
onMouseDown: ue(e.onMouseDown, () => {
|
|
6742
6742
|
S.current = !0;
|
|
@@ -6768,11 +6768,11 @@ var Jv = v.forwardRef((e, t) => {
|
|
|
6768
6768
|
tabStopId: s,
|
|
6769
6769
|
children: i,
|
|
6770
6770
|
...a
|
|
6771
|
-
} = e, l = kn(), c = s || l, d = Xv(rd, n), f = d.currentTabStopId === c,
|
|
6771
|
+
} = e, l = kn(), c = s || l, d = Xv(rd, n), f = d.currentTabStopId === c, h = ed(n), { onFocusableItemAdd: p, onFocusableItemRemove: x, currentTabStopId: m } = d;
|
|
6772
6772
|
return v.useEffect(() => {
|
|
6773
6773
|
if (r)
|
|
6774
|
-
return
|
|
6775
|
-
}, [r,
|
|
6774
|
+
return p(), () => x();
|
|
6775
|
+
}, [r, p, x]), /* @__PURE__ */ u.jsx(
|
|
6776
6776
|
Li.ItemSlot,
|
|
6777
6777
|
{
|
|
6778
6778
|
scope: n,
|
|
@@ -6800,7 +6800,7 @@ var Jv = v.forwardRef((e, t) => {
|
|
|
6800
6800
|
if (g !== void 0) {
|
|
6801
6801
|
if (y.metaKey || y.ctrlKey || y.altKey || y.shiftKey) return;
|
|
6802
6802
|
y.preventDefault();
|
|
6803
|
-
let b =
|
|
6803
|
+
let b = h().filter((T) => T.focusable).map((T) => T.ref.current);
|
|
6804
6804
|
if (g === "last") b.reverse();
|
|
6805
6805
|
else if (g === "prev" || g === "next") {
|
|
6806
6806
|
g === "prev" && b.reverse();
|
|
@@ -6868,22 +6868,22 @@ var nw = nd, rw = od, ow = function(e) {
|
|
|
6868
6868
|
};
|
|
6869
6869
|
o.forEach(c);
|
|
6870
6870
|
var d = function(f) {
|
|
6871
|
-
!f || l.has(f) || Array.prototype.forEach.call(f.children, function(
|
|
6872
|
-
if (a.has(
|
|
6873
|
-
d(
|
|
6871
|
+
!f || l.has(f) || Array.prototype.forEach.call(f.children, function(h) {
|
|
6872
|
+
if (a.has(h))
|
|
6873
|
+
d(h);
|
|
6874
6874
|
else
|
|
6875
6875
|
try {
|
|
6876
|
-
var
|
|
6877
|
-
dr.set(
|
|
6876
|
+
var p = h.getAttribute(r), x = p !== null && p !== "false", m = (dr.get(h) || 0) + 1, y = (s.get(h) || 0) + 1;
|
|
6877
|
+
dr.set(h, m), s.set(h, y), i.push(h), m === 1 && x && Co.set(h, !0), y === 1 && h.setAttribute(n, "true"), x || h.setAttribute(r, "true");
|
|
6878
6878
|
} catch (g) {
|
|
6879
|
-
console.error("aria-hidden: cannot operate on ",
|
|
6879
|
+
console.error("aria-hidden: cannot operate on ", h, g);
|
|
6880
6880
|
}
|
|
6881
6881
|
});
|
|
6882
6882
|
};
|
|
6883
6883
|
return d(t), a.clear(), di++, function() {
|
|
6884
6884
|
i.forEach(function(f) {
|
|
6885
|
-
var
|
|
6886
|
-
dr.set(f,
|
|
6885
|
+
var h = dr.get(f) - 1, p = s.get(f) - 1;
|
|
6886
|
+
dr.set(f, h), s.set(f, p), h || (Co.has(f) || f.removeAttribute(r), Co.delete(f)), p || f.removeAttribute(n);
|
|
6887
6887
|
}), di--, di || (dr = /* @__PURE__ */ new WeakMap(), dr = /* @__PURE__ */ new WeakMap(), Co = /* @__PURE__ */ new WeakMap(), To = {});
|
|
6888
6888
|
};
|
|
6889
6889
|
}, Sa = function(e, t, n) {
|
|
@@ -7041,11 +7041,11 @@ var cd = mw(), pi = function() {
|
|
|
7041
7041
|
onScrollCapture: pi,
|
|
7042
7042
|
onWheelCapture: pi,
|
|
7043
7043
|
onTouchMoveCapture: pi
|
|
7044
|
-
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, c = e.removeScrollBar, d = e.enabled, f = e.shards,
|
|
7044
|
+
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, c = e.removeScrollBar, d = e.enabled, f = e.shards, h = e.sideCar, p = e.noRelative, x = e.noIsolation, m = e.inert, y = e.allowPinchZoom, g = e.as, w = g === void 0 ? "div" : g, b = e.gapMode, T = ad(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = h, C = fw([n, t]), I = gn(gn({}, T), o);
|
|
7045
7045
|
return v.createElement(
|
|
7046
7046
|
v.Fragment,
|
|
7047
7047
|
null,
|
|
7048
|
-
d && v.createElement(S, { sideCar: cd, removeScrollBar: c, shards: f, noRelative:
|
|
7048
|
+
d && v.createElement(S, { sideCar: cd, removeScrollBar: c, shards: f, noRelative: p, noIsolation: x, inert: m, setCallbacks: s, allowPinchZoom: !!y, lockRef: n, gapMode: b }),
|
|
7049
7049
|
i ? v.cloneElement(v.Children.only(a), gn(gn({}, I), { ref: C })) : v.createElement(w, gn({}, I, { className: l, ref: C }), a)
|
|
7050
7050
|
);
|
|
7051
7051
|
});
|
|
@@ -7244,12 +7244,12 @@ var fr = $i ? { passive: !1 } : !1, Nw = function(e) {
|
|
|
7244
7244
|
}, Ow = function(e, t) {
|
|
7245
7245
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
7246
7246
|
}, Dw = function(e, t, n, r, o) {
|
|
7247
|
-
var s = Ow(e, window.getComputedStyle(t).direction), i = s * r, a = n.target, l = t.contains(a), c = !1, d = i > 0, f = 0,
|
|
7247
|
+
var s = Ow(e, window.getComputedStyle(t).direction), i = s * r, a = n.target, l = t.contains(a), c = !1, d = i > 0, f = 0, h = 0;
|
|
7248
7248
|
do {
|
|
7249
7249
|
if (!a)
|
|
7250
7250
|
break;
|
|
7251
|
-
var
|
|
7252
|
-
(x || g) && fd(e, a) && (f += g,
|
|
7251
|
+
var p = pd(e, a), x = p[0], m = p[1], y = p[2], g = m - y - s * x;
|
|
7252
|
+
(x || g) && fd(e, a) && (f += g, h += x);
|
|
7253
7253
|
var w = a.parentNode;
|
|
7254
7254
|
a = w && w.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? w.host : w;
|
|
7255
7255
|
} while (
|
|
@@ -7257,7 +7257,7 @@ var fr = $i ? { passive: !1 } : !1, Nw = function(e) {
|
|
|
7257
7257
|
!l && a !== document.body || // self content
|
|
7258
7258
|
l && (t.contains(a) || t === a)
|
|
7259
7259
|
);
|
|
7260
|
-
return (d && Math.abs(f) < 1 || !d && Math.abs(
|
|
7260
|
+
return (d && Math.abs(f) < 1 || !d && Math.abs(h) < 1) && (c = !0), c;
|
|
7261
7261
|
}, ko = function(e) {
|
|
7262
7262
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
7263
7263
|
}, nc = function(e) {
|
|
@@ -7332,26 +7332,26 @@ function Bw(e) {
|
|
|
7332
7332
|
n.current = ko(m), r.current = void 0;
|
|
7333
7333
|
}, []), f = v.useCallback(function(m) {
|
|
7334
7334
|
c(m.type, nc(m), m.target, a(m, e.lockRef.current));
|
|
7335
|
-
}, []),
|
|
7335
|
+
}, []), h = v.useCallback(function(m) {
|
|
7336
7336
|
c(m.type, ko(m), m.target, a(m, e.lockRef.current));
|
|
7337
7337
|
}, []);
|
|
7338
7338
|
v.useEffect(function() {
|
|
7339
7339
|
return pr.push(s), e.setCallbacks({
|
|
7340
7340
|
onScrollCapture: f,
|
|
7341
7341
|
onWheelCapture: f,
|
|
7342
|
-
onTouchMoveCapture:
|
|
7342
|
+
onTouchMoveCapture: h
|
|
7343
7343
|
}), document.addEventListener("wheel", l, fr), document.addEventListener("touchmove", l, fr), document.addEventListener("touchstart", d, fr), function() {
|
|
7344
7344
|
pr = pr.filter(function(m) {
|
|
7345
7345
|
return m !== s;
|
|
7346
7346
|
}), document.removeEventListener("wheel", l, fr), document.removeEventListener("touchmove", l, fr), document.removeEventListener("touchstart", d, fr);
|
|
7347
7347
|
};
|
|
7348
7348
|
}, []);
|
|
7349
|
-
var
|
|
7349
|
+
var p = e.removeScrollBar, x = e.inert;
|
|
7350
7350
|
return v.createElement(
|
|
7351
7351
|
v.Fragment,
|
|
7352
7352
|
null,
|
|
7353
7353
|
x ? v.createElement(s, { styles: $w(o) }) : null,
|
|
7354
|
-
|
|
7354
|
+
p ? v.createElement(Aw, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
7355
7355
|
);
|
|
7356
7356
|
}
|
|
7357
7357
|
function zw(e) {
|
|
@@ -7375,13 +7375,13 @@ var Fi = ["Enter", " "], Uw = ["ArrowDown", "PageUp", "Home"], hd = ["ArrowUp",
|
|
|
7375
7375
|
As,
|
|
7376
7376
|
td
|
|
7377
7377
|
]), Ps = As(), gd = td(), [Yw, ir] = sr(po), [Xw, ho] = sr(po), xd = (e) => {
|
|
7378
|
-
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = Ps(t), [l, c] = v.useState(null), d = v.useRef(!1), f = At(s),
|
|
7378
|
+
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = Ps(t), [l, c] = v.useState(null), d = v.useRef(!1), f = At(s), h = Ss(o);
|
|
7379
7379
|
return v.useEffect(() => {
|
|
7380
|
-
const
|
|
7380
|
+
const p = () => {
|
|
7381
7381
|
d.current = !0, document.addEventListener("pointerdown", x, { capture: !0, once: !0 }), document.addEventListener("pointermove", x, { capture: !0, once: !0 });
|
|
7382
7382
|
}, x = () => d.current = !1;
|
|
7383
|
-
return document.addEventListener("keydown",
|
|
7384
|
-
document.removeEventListener("keydown",
|
|
7383
|
+
return document.addEventListener("keydown", p, { capture: !0 }), () => {
|
|
7384
|
+
document.removeEventListener("keydown", p, { capture: !0 }), document.removeEventListener("pointerdown", x, { capture: !0 }), document.removeEventListener("pointermove", x, { capture: !0 });
|
|
7385
7385
|
};
|
|
7386
7386
|
}, []), /* @__PURE__ */ u.jsx(Xu, { ...a, children: /* @__PURE__ */ u.jsx(
|
|
7387
7387
|
Yw,
|
|
@@ -7397,7 +7397,7 @@ var Fi = ["Enter", " "], Uw = ["ArrowDown", "PageUp", "Home"], hd = ["ArrowUp",
|
|
|
7397
7397
|
scope: t,
|
|
7398
7398
|
onClose: v.useCallback(() => f(!1), [f]),
|
|
7399
7399
|
isUsingKeyboardRef: d,
|
|
7400
|
-
dir:
|
|
7400
|
+
dir: h,
|
|
7401
7401
|
modal: i,
|
|
7402
7402
|
children: r
|
|
7403
7403
|
}
|
|
@@ -7474,8 +7474,8 @@ var en = "MenuContent", [Qw, Ia] = sr(en), wd = v.forwardRef(
|
|
|
7474
7474
|
onEscapeKeyDown: c,
|
|
7475
7475
|
onPointerDownOutside: d,
|
|
7476
7476
|
onFocusOutside: f,
|
|
7477
|
-
onInteractOutside:
|
|
7478
|
-
onDismiss:
|
|
7477
|
+
onInteractOutside: h,
|
|
7478
|
+
onDismiss: p,
|
|
7479
7479
|
disableOutsideScroll: x,
|
|
7480
7480
|
...m
|
|
7481
7481
|
} = e, y = ir(en, n), g = ho(en, n), w = Ps(n), b = gd(n), T = qw(n), [S, C] = v.useState(null), I = v.useRef(null), R = Ue(t, I, y.onContentChange), _ = v.useRef(0), D = v.useRef(""), P = v.useRef(0), M = v.useRef(null), $ = v.useRef("right"), E = v.useRef(0), F = x ? js : v.Fragment, N = x ? { as: nb, allowPinchZoom: !0 } : void 0, W = (j) => {
|
|
@@ -7536,8 +7536,8 @@ var en = "MenuContent", [Qw, Ia] = sr(en), wd = v.forwardRef(
|
|
|
7536
7536
|
onEscapeKeyDown: c,
|
|
7537
7537
|
onPointerDownOutside: d,
|
|
7538
7538
|
onFocusOutside: f,
|
|
7539
|
-
onInteractOutside:
|
|
7540
|
-
onDismiss:
|
|
7539
|
+
onInteractOutside: h,
|
|
7540
|
+
onDismiss: p,
|
|
7541
7541
|
children: /* @__PURE__ */ u.jsx(
|
|
7542
7542
|
nw,
|
|
7543
7543
|
{
|
|
@@ -7618,8 +7618,8 @@ var Zo = "MenuItem", oc = "menu.itemSelect", Ms = v.forwardRef(
|
|
|
7618
7618
|
const { disabled: n = !1, onSelect: r, ...o } = e, s = v.useRef(null), i = ho(Zo, e.__scopeMenu), a = Ia(Zo, e.__scopeMenu), l = Ue(t, s), c = v.useRef(!1), d = () => {
|
|
7619
7619
|
const f = s.current;
|
|
7620
7620
|
if (!n && f) {
|
|
7621
|
-
const
|
|
7622
|
-
f.addEventListener(oc, (
|
|
7621
|
+
const h = new CustomEvent(oc, { bubbles: !0, cancelable: !0 });
|
|
7622
|
+
f.addEventListener(oc, (p) => r == null ? void 0 : r(p), { once: !0 }), Tu(f, h), h.defaultPrevented ? c.current = !1 : i.onClose();
|
|
7623
7623
|
}
|
|
7624
7624
|
};
|
|
7625
7625
|
return /* @__PURE__ */ u.jsx(
|
|
@@ -7630,16 +7630,16 @@ var Zo = "MenuItem", oc = "menu.itemSelect", Ms = v.forwardRef(
|
|
|
7630
7630
|
disabled: n,
|
|
7631
7631
|
onClick: ue(e.onClick, d),
|
|
7632
7632
|
onPointerDown: (f) => {
|
|
7633
|
-
var
|
|
7634
|
-
(
|
|
7633
|
+
var h;
|
|
7634
|
+
(h = e.onPointerDown) == null || h.call(e, f), c.current = !0;
|
|
7635
7635
|
},
|
|
7636
7636
|
onPointerUp: ue(e.onPointerUp, (f) => {
|
|
7637
|
-
var
|
|
7638
|
-
c.current || (
|
|
7637
|
+
var h;
|
|
7638
|
+
c.current || (h = f.currentTarget) == null || h.click();
|
|
7639
7639
|
}),
|
|
7640
7640
|
onKeyDown: ue(e.onKeyDown, (f) => {
|
|
7641
|
-
const
|
|
7642
|
-
n ||
|
|
7641
|
+
const h = a.searchRef.current !== "";
|
|
7642
|
+
n || h && f.key === " " || Fi.includes(f.key) && (f.currentTarget.click(), f.preventDefault());
|
|
7643
7643
|
})
|
|
7644
7644
|
}
|
|
7645
7645
|
);
|
|
@@ -7648,16 +7648,16 @@ var Zo = "MenuItem", oc = "menu.itemSelect", Ms = v.forwardRef(
|
|
|
7648
7648
|
Ms.displayName = Zo;
|
|
7649
7649
|
var Sd = v.forwardRef(
|
|
7650
7650
|
(e, t) => {
|
|
7651
|
-
const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Ia(Zo, n), a = gd(n), l = v.useRef(null), c = Ue(t, l), [d, f] = v.useState(!1), [
|
|
7651
|
+
const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Ia(Zo, n), a = gd(n), l = v.useRef(null), c = Ue(t, l), [d, f] = v.useState(!1), [h, p] = v.useState("");
|
|
7652
7652
|
return v.useEffect(() => {
|
|
7653
7653
|
const x = l.current;
|
|
7654
|
-
x &&
|
|
7654
|
+
x && p((x.textContent ?? "").trim());
|
|
7655
7655
|
}, [s.children]), /* @__PURE__ */ u.jsx(
|
|
7656
7656
|
Xr.ItemSlot,
|
|
7657
7657
|
{
|
|
7658
7658
|
scope: n,
|
|
7659
7659
|
disabled: r,
|
|
7660
|
-
textValue: o ??
|
|
7660
|
+
textValue: o ?? h,
|
|
7661
7661
|
children: /* @__PURE__ */ u.jsx(rw, { asChild: !0, ...a, focusable: !r, children: /* @__PURE__ */ u.jsx(
|
|
7662
7662
|
_e.div,
|
|
7663
7663
|
{
|
|
@@ -7806,8 +7806,8 @@ var db = "MenuSub", [_I, jd] = sr(db), $r = "MenuSubTrigger", Pd = v.forwardRef(
|
|
|
7806
7806
|
...e,
|
|
7807
7807
|
ref: da(t, o.onTriggerChange),
|
|
7808
7808
|
onClick: (f) => {
|
|
7809
|
-
var
|
|
7810
|
-
(
|
|
7809
|
+
var h;
|
|
7810
|
+
(h = e.onClick) == null || h.call(e, f), !(e.disabled || f.defaultPrevented) && (f.currentTarget.focus(), n.open || n.onOpenChange(!0));
|
|
7811
7811
|
},
|
|
7812
7812
|
onPointerMove: ue(
|
|
7813
7813
|
e.onPointerMove,
|
|
@@ -7820,20 +7820,20 @@ var db = "MenuSub", [_I, jd] = sr(db), $r = "MenuSubTrigger", Pd = v.forwardRef(
|
|
|
7820
7820
|
onPointerLeave: ue(
|
|
7821
7821
|
e.onPointerLeave,
|
|
7822
7822
|
Jr((f) => {
|
|
7823
|
-
var
|
|
7823
|
+
var p, x;
|
|
7824
7824
|
d();
|
|
7825
|
-
const
|
|
7826
|
-
if (
|
|
7827
|
-
const m = (x = n.content) == null ? void 0 : x.dataset.side, y = m === "right", g = y ? -5 : 5, w =
|
|
7825
|
+
const h = (p = n.content) == null ? void 0 : p.getBoundingClientRect();
|
|
7826
|
+
if (h) {
|
|
7827
|
+
const m = (x = n.content) == null ? void 0 : x.dataset.side, y = m === "right", g = y ? -5 : 5, w = h[y ? "left" : "right"], b = h[y ? "right" : "left"];
|
|
7828
7828
|
s.onPointerGraceIntentChange({
|
|
7829
7829
|
area: [
|
|
7830
7830
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
7831
7831
|
// consistently within polygon bounds
|
|
7832
7832
|
{ x: f.clientX + g, y: f.clientY },
|
|
7833
|
-
{ x: w, y:
|
|
7834
|
-
{ x: b, y:
|
|
7835
|
-
{ x: b, y:
|
|
7836
|
-
{ x: w, y:
|
|
7833
|
+
{ x: w, y: h.top },
|
|
7834
|
+
{ x: b, y: h.top },
|
|
7835
|
+
{ x: b, y: h.bottom },
|
|
7836
|
+
{ x: w, y: h.bottom }
|
|
7837
7837
|
],
|
|
7838
7838
|
side: m
|
|
7839
7839
|
}), window.clearTimeout(a.current), a.current = window.setTimeout(
|
|
@@ -7847,9 +7847,9 @@ var db = "MenuSub", [_I, jd] = sr(db), $r = "MenuSubTrigger", Pd = v.forwardRef(
|
|
|
7847
7847
|
})
|
|
7848
7848
|
),
|
|
7849
7849
|
onKeyDown: ue(e.onKeyDown, (f) => {
|
|
7850
|
-
var
|
|
7851
|
-
const
|
|
7852
|
-
e.disabled ||
|
|
7850
|
+
var p;
|
|
7851
|
+
const h = s.searchRef.current !== "";
|
|
7852
|
+
e.disabled || h && f.key === " " || Vw[r.dir].includes(f.key) && (n.onOpenChange(!0), (p = n.content) == null || p.focus(), f.preventDefault());
|
|
7853
7853
|
})
|
|
7854
7854
|
}
|
|
7855
7855
|
) });
|
|
@@ -7883,9 +7883,9 @@ var Md = "MenuSubContent", Od = v.forwardRef(
|
|
|
7883
7883
|
i.onClose(), d.preventDefault();
|
|
7884
7884
|
}),
|
|
7885
7885
|
onKeyDown: ue(e.onKeyDown, (d) => {
|
|
7886
|
-
var
|
|
7887
|
-
const f = d.currentTarget.contains(d.target),
|
|
7888
|
-
f &&
|
|
7886
|
+
var p;
|
|
7887
|
+
const f = d.currentTarget.contains(d.target), h = Kw[i.dir].includes(d.key);
|
|
7888
|
+
f && h && (s.onOpenChange(!1), (p = a.trigger) == null || p.focus(), d.preventDefault());
|
|
7889
7889
|
})
|
|
7890
7890
|
}
|
|
7891
7891
|
) }) }) });
|
|
@@ -7922,8 +7922,8 @@ function mb(e, t) {
|
|
|
7922
7922
|
const { x: n, y: r } = e;
|
|
7923
7923
|
let o = !1;
|
|
7924
7924
|
for (let s = 0, i = t.length - 1; s < t.length; i = s++) {
|
|
7925
|
-
const a = t[s], l = t[i], c = a.x, d = a.y, f = l.x,
|
|
7926
|
-
d > r !=
|
|
7925
|
+
const a = t[s], l = t[i], c = a.x, d = a.y, f = l.x, h = l.y;
|
|
7926
|
+
d > r != h > r && n < (f - c) * (r - d) / (h - d) + c && (o = !o);
|
|
7927
7927
|
}
|
|
7928
7928
|
return o;
|
|
7929
7929
|
}
|
|
@@ -7962,7 +7962,7 @@ var xb = xd, yb = Ca, vb = vd, wb = wd, bb = Ra, Sb = bd, Cb = Ms, Tb = Cd, Ib =
|
|
|
7962
7962
|
contentId: kn(),
|
|
7963
7963
|
open: d,
|
|
7964
7964
|
onOpenChange: f,
|
|
7965
|
-
onOpenToggle: v.useCallback(() => f((
|
|
7965
|
+
onOpenToggle: v.useCallback(() => f((h) => !h), [f]),
|
|
7966
7966
|
modal: a,
|
|
7967
7967
|
children: /* @__PURE__ */ u.jsx(xb, { ...l, open: d, onOpenChange: f, dir: r, modal: a, children: n })
|
|
7968
7968
|
}
|
|
@@ -8350,18 +8350,18 @@ function f0(e) {
|
|
|
8350
8350
|
() => {
|
|
8351
8351
|
const i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
8352
8352
|
for (const f of t) {
|
|
8353
|
-
const
|
|
8354
|
-
if (!
|
|
8355
|
-
const
|
|
8356
|
-
id:
|
|
8357
|
-
step:
|
|
8353
|
+
const h = f.checkpointId ?? null;
|
|
8354
|
+
if (!h) continue;
|
|
8355
|
+
const p = Fo(f.metadata, "step"), x = c0(f.metadata, "source"), m = {
|
|
8356
|
+
id: h,
|
|
8357
|
+
step: p,
|
|
8358
8358
|
source: x,
|
|
8359
8359
|
createdAt: f.createdAt ?? null,
|
|
8360
8360
|
namespace: f.checkpointNs ?? null,
|
|
8361
8361
|
parentId: f.parentId ?? null
|
|
8362
8362
|
};
|
|
8363
|
-
if (i.set(
|
|
8364
|
-
const y = `${
|
|
8363
|
+
if (i.set(h, m), p !== null && x) {
|
|
8364
|
+
const y = `${p}:${x}`, g = a.get(y) ?? [];
|
|
8365
8365
|
g.push(m), a.set(y, g);
|
|
8366
8366
|
}
|
|
8367
8367
|
}
|
|
@@ -8371,16 +8371,16 @@ function f0(e) {
|
|
|
8371
8371
|
"checkpoints"
|
|
8372
8372
|
);
|
|
8373
8373
|
const c = a0(t);
|
|
8374
|
-
for (const [f,
|
|
8375
|
-
const
|
|
8376
|
-
|
|
8377
|
-
...
|
|
8378
|
-
attemptIndex:
|
|
8379
|
-
attemptCount:
|
|
8380
|
-
isLatestAttempt:
|
|
8381
|
-
baseUserMessageId:
|
|
8374
|
+
for (const [f, h] of i.entries()) {
|
|
8375
|
+
const p = c.get(f);
|
|
8376
|
+
p ? l.set(f, {
|
|
8377
|
+
...h,
|
|
8378
|
+
attemptIndex: p.attemptIndex,
|
|
8379
|
+
attemptCount: p.attemptCount,
|
|
8380
|
+
isLatestAttempt: p.isLatestAttempt,
|
|
8381
|
+
baseUserMessageId: p.baseUserMessageId ?? null
|
|
8382
8382
|
}) : l.set(f, {
|
|
8383
|
-
...
|
|
8383
|
+
...h,
|
|
8384
8384
|
attemptIndex: 0,
|
|
8385
8385
|
attemptCount: 1,
|
|
8386
8386
|
isLatestAttempt: !0,
|
|
@@ -8390,10 +8390,10 @@ function f0(e) {
|
|
|
8390
8390
|
console.log("[useCheckpointMetadata] Final attemptMetaById:", {
|
|
8391
8391
|
totalCheckpoints: l.size,
|
|
8392
8392
|
withMultipleAttempts: Array.from(l.values()).filter((f) => f.attemptCount > 1).length,
|
|
8393
|
-
samples: Array.from(l.entries()).slice(0, 3).map(([f,
|
|
8393
|
+
samples: Array.from(l.entries()).slice(0, 3).map(([f, h]) => ({
|
|
8394
8394
|
checkpointId: f,
|
|
8395
|
-
attemptIndex:
|
|
8396
|
-
attemptCount:
|
|
8395
|
+
attemptIndex: h.attemptIndex,
|
|
8396
|
+
attemptCount: h.attemptCount
|
|
8397
8397
|
}))
|
|
8398
8398
|
});
|
|
8399
8399
|
const d = l0(l);
|
|
@@ -8747,13 +8747,13 @@ function k0(e, t, n, r, o, s, i, a, l) {
|
|
|
8747
8747
|
const c = Q.useCallback(
|
|
8748
8748
|
(d) => {
|
|
8749
8749
|
const f = R0(d.children, t, a ? "offsetWidth" : "offsetHeight", o);
|
|
8750
|
-
let
|
|
8751
|
-
for (; !
|
|
8752
|
-
|
|
8753
|
-
const
|
|
8750
|
+
let h = d.parentElement;
|
|
8751
|
+
for (; !h.dataset.virtuosoScroller; )
|
|
8752
|
+
h = h.parentElement;
|
|
8753
|
+
const p = h.lastElementChild.dataset.viewportType === "window";
|
|
8754
8754
|
let x;
|
|
8755
|
-
|
|
8756
|
-
const m = i ? a ? i.scrollLeft : i.scrollTop :
|
|
8755
|
+
p && (x = h.ownerDocument.defaultView);
|
|
8756
|
+
const m = i ? a ? i.scrollLeft : i.scrollTop : p ? a ? x.scrollX || x.document.documentElement.scrollLeft : x.scrollY || x.document.documentElement.scrollTop : a ? h.scrollLeft : h.scrollTop, y = i ? a ? i.scrollWidth : i.scrollHeight : p ? a ? x.document.documentElement.scrollWidth : x.document.documentElement.scrollHeight : a ? h.scrollWidth : h.scrollHeight, g = i ? a ? i.offsetWidth : i.offsetHeight : p ? a ? x.innerWidth : x.innerHeight : a ? h.offsetWidth : h.offsetHeight;
|
|
8757
8757
|
r({
|
|
8758
8758
|
scrollHeight: y,
|
|
8759
8759
|
scrollTop: Math.max(m, 0),
|
|
@@ -8792,17 +8792,17 @@ function ff(e, t, n) {
|
|
|
8792
8792
|
if (!(l != null && l.offsetParent))
|
|
8793
8793
|
return;
|
|
8794
8794
|
const c = l.getBoundingClientRect(), d = c.width;
|
|
8795
|
-
let f,
|
|
8795
|
+
let f, h;
|
|
8796
8796
|
if (t) {
|
|
8797
|
-
const
|
|
8798
|
-
|
|
8797
|
+
const p = t.getBoundingClientRect(), x = c.top - p.top;
|
|
8798
|
+
h = p.height - Math.max(0, x), f = x + t.scrollTop;
|
|
8799
8799
|
} else {
|
|
8800
|
-
const
|
|
8801
|
-
|
|
8800
|
+
const p = i.current.ownerDocument.defaultView;
|
|
8801
|
+
h = p.innerHeight - Math.max(0, c.top), f = c.top + p.scrollY;
|
|
8802
8802
|
}
|
|
8803
8803
|
r.current = {
|
|
8804
8804
|
offsetTop: f,
|
|
8805
|
-
visibleHeight:
|
|
8805
|
+
visibleHeight: h,
|
|
8806
8806
|
visibleWidth: d
|
|
8807
8807
|
}, e(r.current);
|
|
8808
8808
|
},
|
|
@@ -8831,7 +8831,7 @@ function ff(e, t, n) {
|
|
|
8831
8831
|
}
|
|
8832
8832
|
const Bt = Ge(
|
|
8833
8833
|
() => {
|
|
8834
|
-
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(),
|
|
8834
|
+
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(), h = He(), p = ee(!1), x = ee(!1), m = ee(!1);
|
|
8835
8835
|
return pe(
|
|
8836
8836
|
U(
|
|
8837
8837
|
e,
|
|
@@ -8851,11 +8851,11 @@ const Bt = Ge(
|
|
|
8851
8851
|
footerHeight: d,
|
|
8852
8852
|
headerHeight: a,
|
|
8853
8853
|
horizontalDirection: x,
|
|
8854
|
-
scrollBy:
|
|
8854
|
+
scrollBy: h,
|
|
8855
8855
|
// input
|
|
8856
8856
|
scrollContainerState: e,
|
|
8857
8857
|
scrollHeight: i,
|
|
8858
|
-
scrollingInProgress:
|
|
8858
|
+
scrollingInProgress: p,
|
|
8859
8859
|
// signals
|
|
8860
8860
|
scrollTo: f,
|
|
8861
8861
|
scrollTop: t,
|
|
@@ -9072,8 +9072,8 @@ function _0(e, t) {
|
|
|
9072
9072
|
if (a.some($0(r)))
|
|
9073
9073
|
continue;
|
|
9074
9074
|
let l = !1, c = !1;
|
|
9075
|
-
for (const { end: d, start: f, value:
|
|
9076
|
-
l ? (o >= f || s ===
|
|
9075
|
+
for (const { end: d, start: f, value: h } of a)
|
|
9076
|
+
l ? (o >= f || s === h) && (e = Hi(e, f)) : (c = h !== s, l = !0), d > o && o >= f && h !== s && (e = Kt(e, o + 1, h));
|
|
9077
9077
|
c && (e = Kt(e, i, s));
|
|
9078
9078
|
}
|
|
9079
9079
|
return [e, n];
|
|
@@ -9115,8 +9115,8 @@ function O0(e, [t, n, r, o]) {
|
|
|
9115
9115
|
const s = e.sizeTree;
|
|
9116
9116
|
let i = s, a = 0;
|
|
9117
9117
|
if (n.length > 0 && ct(s) && t.length === 2) {
|
|
9118
|
-
const
|
|
9119
|
-
i = n.reduce((x, m) => Kt(Kt(x, m,
|
|
9118
|
+
const h = t[0].size, p = t[1].size;
|
|
9119
|
+
i = n.reduce((x, m) => Kt(Kt(x, m, h), m + 1, p), i);
|
|
9120
9120
|
} else
|
|
9121
9121
|
[i, a] = _0(i, t);
|
|
9122
9122
|
if (i === s)
|
|
@@ -9124,7 +9124,7 @@ function O0(e, [t, n, r, o]) {
|
|
|
9124
9124
|
const { lastIndex: l, lastOffset: c, lastSize: d, offsetTree: f } = Vi(e.offsetTree, a, i, o);
|
|
9125
9125
|
return {
|
|
9126
9126
|
groupIndices: n,
|
|
9127
|
-
groupOffsetTree: n.reduce((
|
|
9127
|
+
groupOffsetTree: n.reduce((h, p) => Kt(h, p, to(p, f, o)), vr()),
|
|
9128
9128
|
lastIndex: l,
|
|
9129
9129
|
lastOffset: c,
|
|
9130
9130
|
lastSize: d,
|
|
@@ -9153,12 +9153,12 @@ function Vi(e, t, n, r) {
|
|
|
9153
9153
|
} else
|
|
9154
9154
|
o = [];
|
|
9155
9155
|
for (const { start: c, value: d } of $s(n, t, 1 / 0)) {
|
|
9156
|
-
const f = c - s,
|
|
9156
|
+
const f = c - s, h = f * i + a + f * r;
|
|
9157
9157
|
o.push({
|
|
9158
9158
|
index: c,
|
|
9159
|
-
offset:
|
|
9159
|
+
offset: h,
|
|
9160
9160
|
size: d
|
|
9161
|
-
}), s = c, a =
|
|
9161
|
+
}), s = c, a = h, i = d;
|
|
9162
9162
|
}
|
|
9163
9163
|
return {
|
|
9164
9164
|
lastIndex: s,
|
|
@@ -9179,8 +9179,8 @@ const F0 = {
|
|
|
9179
9179
|
offsetWidth: "width"
|
|
9180
9180
|
}, Sn = Ge(
|
|
9181
9181
|
([{ log: e }, { recalcInProgress: t }]) => {
|
|
9182
|
-
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) => Ln(S, F0[C])),
|
|
9183
|
-
U(n, $e(l, e,
|
|
9182
|
+
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) => Ln(S, F0[C])), h = ee(void 0), p = ee(0), x = N0(), m = Dt(
|
|
9183
|
+
U(n, $e(l, e, p), yn(O0, x), dt()),
|
|
9184
9184
|
x
|
|
9185
9185
|
), y = Dt(
|
|
9186
9186
|
U(
|
|
@@ -9198,7 +9198,7 @@ const F0 = {
|
|
|
9198
9198
|
U(
|
|
9199
9199
|
l,
|
|
9200
9200
|
Ie((S) => S.length > 0),
|
|
9201
|
-
$e(m,
|
|
9201
|
+
$e(m, p),
|
|
9202
9202
|
le(([S, C, I]) => {
|
|
9203
9203
|
const R = S.reduce((_, D, P) => Kt(_, D, to(D, C.offsetTree, I) || P), vr());
|
|
9204
9204
|
return {
|
|
@@ -9343,7 +9343,7 @@ const F0 = {
|
|
|
9343
9343
|
const T = Gt(
|
|
9344
9344
|
U(
|
|
9345
9345
|
i,
|
|
9346
|
-
$e(m,
|
|
9346
|
+
$e(m, p),
|
|
9347
9347
|
le(([S, { offsetTree: C }, I]) => {
|
|
9348
9348
|
const R = -S;
|
|
9349
9349
|
return to(R, C, I);
|
|
@@ -9353,7 +9353,7 @@ const F0 = {
|
|
|
9353
9353
|
return pe(
|
|
9354
9354
|
U(
|
|
9355
9355
|
i,
|
|
9356
|
-
$e(m,
|
|
9356
|
+
$e(m, p),
|
|
9357
9357
|
le(([S, C, I]) => {
|
|
9358
9358
|
if (C.groupIndices.length > 0) {
|
|
9359
9359
|
if (ct(C.sizeTree))
|
|
@@ -9391,11 +9391,11 @@ const F0 = {
|
|
|
9391
9391
|
), {
|
|
9392
9392
|
beforeUnshiftWith: b,
|
|
9393
9393
|
// input
|
|
9394
|
-
data:
|
|
9394
|
+
data: h,
|
|
9395
9395
|
defaultItemSize: d,
|
|
9396
9396
|
firstItemIndex: a,
|
|
9397
9397
|
fixedItemSize: c,
|
|
9398
|
-
gap:
|
|
9398
|
+
gap: p,
|
|
9399
9399
|
groupIndices: l,
|
|
9400
9400
|
itemSize: f,
|
|
9401
9401
|
listRefresh: w,
|
|
@@ -9482,17 +9482,17 @@ const mo = Ge(
|
|
|
9482
9482
|
smoothScrollTargetReached: d,
|
|
9483
9483
|
viewportHeight: f
|
|
9484
9484
|
},
|
|
9485
|
-
{ log:
|
|
9485
|
+
{ log: h }
|
|
9486
9486
|
]) => {
|
|
9487
|
-
const
|
|
9487
|
+
const p = He(), x = He(), m = ee(0);
|
|
9488
9488
|
let y = null, g = null, w = null;
|
|
9489
9489
|
function b() {
|
|
9490
9490
|
y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), Pe(l, !1);
|
|
9491
9491
|
}
|
|
9492
9492
|
return pe(
|
|
9493
9493
|
U(
|
|
9494
|
-
|
|
9495
|
-
$e(n, f, r, m, a, i,
|
|
9494
|
+
p,
|
|
9495
|
+
$e(n, f, r, m, a, i, h),
|
|
9496
9496
|
$e(e, s, o),
|
|
9497
9497
|
le(
|
|
9498
9498
|
([
|
|
@@ -9505,7 +9505,7 @@ const mo = Ge(
|
|
|
9505
9505
|
let X = to(K, S.offsetTree, M) + _;
|
|
9506
9506
|
N === "end" ? (X += $ + un(S.sizeTree, K)[1] - C + E, K === j && (X += D)) : N === "center" ? X += ($ + un(S.sizeTree, K)[1] - C + E) / 2 : X -= R, B && (X += B);
|
|
9507
9507
|
const se = (xe) => {
|
|
9508
|
-
b(), xe ? (P("retrying to scroll to", { location: T }, Ut.DEBUG), Pe(
|
|
9508
|
+
b(), xe ? (P("retrying to scroll to", { location: T }, Ut.DEBUG), Pe(p, T)) : (Pe(x, !0), P("list did not change, scroll successful", {}, Ut.DEBUG));
|
|
9509
9509
|
};
|
|
9510
9510
|
if (b(), W === "smooth") {
|
|
9511
9511
|
let xe = !1;
|
|
@@ -9525,7 +9525,7 @@ const mo = Ge(
|
|
|
9525
9525
|
c
|
|
9526
9526
|
), {
|
|
9527
9527
|
scrollTargetReached: x,
|
|
9528
|
-
scrollToIndex:
|
|
9528
|
+
scrollToIndex: p,
|
|
9529
9529
|
topListHeight: m
|
|
9530
9530
|
};
|
|
9531
9531
|
},
|
|
@@ -9574,7 +9574,7 @@ const go = Ge(
|
|
|
9574
9574
|
U(
|
|
9575
9575
|
It(t, i),
|
|
9576
9576
|
$e(a, n, e, c),
|
|
9577
|
-
Ie(([[, d], f, { sizeTree:
|
|
9577
|
+
Ie(([[, d], f, { sizeTree: h }, p, x]) => d && (!ct(h) || Na(p)) && !f && !x),
|
|
9578
9578
|
$e(l)
|
|
9579
9579
|
),
|
|
9580
9580
|
([, d]) => {
|
|
@@ -9608,13 +9608,13 @@ const no = "up", zr = "down", U0 = "none", W0 = {
|
|
|
9608
9608
|
viewportHeight: 0
|
|
9609
9609
|
}
|
|
9610
9610
|
}, V0 = 0, xo = Ge(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
|
|
9611
|
-
const i = ee(!1), a = ee(!0), l = He(), c = He(), d = ee(4), f = ee(V0),
|
|
9611
|
+
const i = ee(!1), a = ee(!0), l = He(), c = He(), d = ee(4), f = ee(V0), h = Dt(
|
|
9612
9612
|
U(
|
|
9613
9613
|
zi(U(Te(o), tr(1), mn(!0)), U(Te(o), tr(1), mn(!1), ac(100))),
|
|
9614
9614
|
dt()
|
|
9615
9615
|
),
|
|
9616
9616
|
!1
|
|
9617
|
-
),
|
|
9617
|
+
), p = Dt(
|
|
9618
9618
|
U(zi(U(n, mn(!0)), U(n, mn(!1), ac(200))), dt()),
|
|
9619
9619
|
!1
|
|
9620
9620
|
);
|
|
@@ -9701,7 +9701,7 @@ const no = "up", zr = "down", U0 = "none", W0 = {
|
|
|
9701
9701
|
le(({ scrollTop: w }) => w),
|
|
9702
9702
|
dt(),
|
|
9703
9703
|
yn(
|
|
9704
|
-
(w, b) => St(
|
|
9704
|
+
(w, b) => St(p) ? { direction: w.direction, prevScrollTop: b } : { direction: b < w.prevScrollTop ? no : zr, prevScrollTop: b },
|
|
9705
9705
|
{ direction: zr, prevScrollTop: 0 }
|
|
9706
9706
|
),
|
|
9707
9707
|
le((w) => w.direction)
|
|
@@ -9711,7 +9711,7 @@ const no = "up", zr = "down", U0 = "none", W0 = {
|
|
|
9711
9711
|
const g = ee(0);
|
|
9712
9712
|
return pe(
|
|
9713
9713
|
U(
|
|
9714
|
-
|
|
9714
|
+
h,
|
|
9715
9715
|
Ie((w) => !w),
|
|
9716
9716
|
mn(0)
|
|
9717
9717
|
),
|
|
@@ -9720,7 +9720,7 @@ const no = "up", zr = "down", U0 = "none", W0 = {
|
|
|
9720
9720
|
U(
|
|
9721
9721
|
o,
|
|
9722
9722
|
In(100),
|
|
9723
|
-
$e(
|
|
9723
|
+
$e(h),
|
|
9724
9724
|
Ie(([w, b]) => !!b),
|
|
9725
9725
|
yn(([w, b], [T]) => [b, T], [0, 0]),
|
|
9726
9726
|
le(([w, b]) => b - w)
|
|
@@ -9734,7 +9734,7 @@ const no = "up", zr = "down", U0 = "none", W0 = {
|
|
|
9734
9734
|
atTopThreshold: f,
|
|
9735
9735
|
isAtBottom: i,
|
|
9736
9736
|
isAtTop: a,
|
|
9737
|
-
isScrolling:
|
|
9737
|
+
isScrolling: h,
|
|
9738
9738
|
lastJumpDueToItemResize: m,
|
|
9739
9739
|
scrollDirection: y,
|
|
9740
9740
|
scrollVelocity: g
|
|
@@ -9766,19 +9766,19 @@ const La = Ge(
|
|
|
9766
9766
|
([
|
|
9767
9767
|
d,
|
|
9768
9768
|
f,
|
|
9769
|
-
|
|
9770
|
-
[
|
|
9769
|
+
h,
|
|
9770
|
+
[p, x],
|
|
9771
9771
|
m,
|
|
9772
9772
|
y,
|
|
9773
9773
|
g,
|
|
9774
9774
|
w,
|
|
9775
9775
|
b
|
|
9776
9776
|
]) => {
|
|
9777
|
-
const T = d - w, S = y + g, C = Math.max(
|
|
9777
|
+
const T = d - w, S = y + g, C = Math.max(h - T, 0);
|
|
9778
9778
|
let I = dc;
|
|
9779
9779
|
const R = pc(b, ts), _ = pc(b, ns);
|
|
9780
|
-
return
|
|
9781
|
-
Math.max(T -
|
|
9780
|
+
return p -= w, p += h + g, x += h + g, x -= w, p > d + S - R && (I = no), x < d - C + f + _ && (I = zr), I !== dc ? [
|
|
9781
|
+
Math.max(T - h - fc(m, ts, I) - R, 0),
|
|
9782
9782
|
T - C - g + f + fc(m, ns, I) + _
|
|
9783
9783
|
] : null;
|
|
9784
9784
|
}
|
|
@@ -9830,14 +9830,14 @@ function Ho(e, t, n, r, o, s) {
|
|
|
9830
9830
|
const m = e[e.length - 1];
|
|
9831
9831
|
d = m.offset + m.size;
|
|
9832
9832
|
}
|
|
9833
|
-
const f = n - i,
|
|
9833
|
+
const f = n - i, h = a + f * l + (f - 1) * r, p = c, x = h - d;
|
|
9834
9834
|
return {
|
|
9835
9835
|
bottom: d,
|
|
9836
9836
|
firstItemIndex: s,
|
|
9837
9837
|
items: hc(e, o, s),
|
|
9838
9838
|
offsetBottom: x,
|
|
9839
9839
|
offsetTop: c,
|
|
9840
|
-
top:
|
|
9840
|
+
top: p,
|
|
9841
9841
|
topItems: hc(t, o, s),
|
|
9842
9842
|
topListHeight: t.reduce((m, y) => y.size + m, 0),
|
|
9843
9843
|
totalCount: n
|
|
@@ -9892,8 +9892,8 @@ const lr = Ge(
|
|
|
9892
9892
|
{ listBoundary: i, topListHeight: a, visibleRange: l },
|
|
9893
9893
|
{ initialTopMostItemIndex: c, scrolledToInitialItem: d },
|
|
9894
9894
|
{ topListHeight: f },
|
|
9895
|
-
|
|
9896
|
-
{ didMount:
|
|
9895
|
+
h,
|
|
9896
|
+
{ didMount: p },
|
|
9897
9897
|
{ recalcInProgress: x }
|
|
9898
9898
|
]) => {
|
|
9899
9899
|
const m = ee([]), y = ee(0), g = He();
|
|
@@ -9901,7 +9901,7 @@ const lr = Ge(
|
|
|
9901
9901
|
const w = Dt(
|
|
9902
9902
|
U(
|
|
9903
9903
|
It(
|
|
9904
|
-
|
|
9904
|
+
p,
|
|
9905
9905
|
x,
|
|
9906
9906
|
Te(l, eo),
|
|
9907
9907
|
Te(o),
|
|
@@ -10047,7 +10047,7 @@ const lr = Ge(
|
|
|
10047
10047
|
dt(yf)
|
|
10048
10048
|
)
|
|
10049
10049
|
);
|
|
10050
|
-
return { endReached: b, initialItemCount: y, itemsRendered: g, listState: w, rangeChanged: S, startReached: T, topItemsIndexes: m, ...
|
|
10050
|
+
return { endReached: b, initialItemCount: y, itemsRendered: g, listState: w, rangeChanged: S, startReached: T, topItemsIndexes: m, ...h };
|
|
10051
10051
|
},
|
|
10052
10052
|
ft(
|
|
10053
10053
|
Sn,
|
|
@@ -10109,8 +10109,8 @@ const lr = Ge(
|
|
|
10109
10109
|
d,
|
|
10110
10110
|
$e(t, l, n, s, o, r, a),
|
|
10111
10111
|
$e(e),
|
|
10112
|
-
le(([[f,
|
|
10113
|
-
const { align: T, behavior: S, calculateViewLocation: C = G0, done: I, ...R } = f, _ = bf(f,
|
|
10112
|
+
le(([[f, h, p, x, m, y, g, w], b]) => {
|
|
10113
|
+
const { align: T, behavior: S, calculateViewLocation: C = G0, done: I, ...R } = f, _ = bf(f, h, x - 1), D = to(_, h.offsetTree, b) + m + y, P = D + un(h.sizeTree, _)[1], M = w + y, $ = w + p - g, E = C({
|
|
10114
10114
|
itemBottom: P,
|
|
10115
10115
|
itemTop: D,
|
|
10116
10116
|
locationParams: { align: T, behavior: S, ...R },
|
|
@@ -10150,8 +10150,8 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Ge(
|
|
|
10150
10150
|
{ didMount: l, propsReady: c },
|
|
10151
10151
|
{ log: d },
|
|
10152
10152
|
{ scrollingInProgress: f },
|
|
10153
|
-
{ context:
|
|
10154
|
-
{ scrollIntoView:
|
|
10153
|
+
{ context: h },
|
|
10154
|
+
{ scrollIntoView: p }
|
|
10155
10155
|
]) => {
|
|
10156
10156
|
const x = ee(!1), m = He();
|
|
10157
10157
|
let y = null;
|
|
@@ -10221,16 +10221,16 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Ge(
|
|
|
10221
10221
|
), nt(
|
|
10222
10222
|
U(
|
|
10223
10223
|
It(U(T, tr(1)), l),
|
|
10224
|
-
$e(Te(b), a, f,
|
|
10224
|
+
$e(Te(b), a, f, h),
|
|
10225
10225
|
le(([[S, C], I, R, _, D]) => C && R && (I == null ? void 0 : I({ context: D, totalCount: S, scrollingInProgress: _ }))),
|
|
10226
10226
|
Ie((S) => !!S),
|
|
10227
10227
|
In(0)
|
|
10228
10228
|
),
|
|
10229
10229
|
(S) => {
|
|
10230
10230
|
y && (y(), y = null), St(n) ? requestAnimationFrame(() => {
|
|
10231
|
-
St(d)("scrolling into view", {}), Pe(
|
|
10231
|
+
St(d)("scrolling into view", {}), Pe(p, S);
|
|
10232
10232
|
}) : y = an(e, () => {
|
|
10233
|
-
St(d)("scrolling into view", {}), Pe(
|
|
10233
|
+
St(d)("scrolling into view", {}), Pe(p, S), y = null;
|
|
10234
10234
|
});
|
|
10235
10235
|
}
|
|
10236
10236
|
), { autoscrollToBottom: m, followOutput: x, scrollIntoViewOnChange: b };
|
|
@@ -10253,7 +10253,7 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Ge(
|
|
|
10253
10253
|
$e(s),
|
|
10254
10254
|
Ie(([, l]) => l !== 0),
|
|
10255
10255
|
$e(o, r, t, n, e),
|
|
10256
|
-
le(([[, l], c, d, f,
|
|
10256
|
+
le(([[, l], c, d, f, h, p = []]) => If(l, c, d, f, h, p))
|
|
10257
10257
|
),
|
|
10258
10258
|
i
|
|
10259
10259
|
), {}),
|
|
@@ -10358,23 +10358,23 @@ const Y0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), X0 = Ge(
|
|
|
10358
10358
|
{ didMount: s },
|
|
10359
10359
|
{ useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: l }
|
|
10360
10360
|
]) => {
|
|
10361
|
-
const c = He(), d = ee(void 0), f = ee(null),
|
|
10362
|
-
return pe(a, f), pe(l,
|
|
10361
|
+
const c = He(), d = ee(void 0), f = ee(null), h = ee(null);
|
|
10362
|
+
return pe(a, f), pe(l, h), nt(
|
|
10363
10363
|
U(
|
|
10364
10364
|
c,
|
|
10365
|
-
$e(t, r, i, f,
|
|
10365
|
+
$e(t, r, i, f, h, n)
|
|
10366
10366
|
),
|
|
10367
|
-
([
|
|
10367
|
+
([p, x, m, y, g, w, b]) => {
|
|
10368
10368
|
const T = D0(x.sizeTree);
|
|
10369
|
-
y && g !== null && w !== null && (m = g.scrollTop - w.offsetTop), m -= b,
|
|
10369
|
+
y && g !== null && w !== null && (m = g.scrollTop - w.offsetTop), m -= b, p({ ranges: T, scrollTop: m });
|
|
10370
10370
|
}
|
|
10371
10371
|
), pe(U(d, Ie(Na), le(eS)), o), pe(
|
|
10372
10372
|
U(
|
|
10373
10373
|
s,
|
|
10374
10374
|
$e(d),
|
|
10375
|
-
Ie(([,
|
|
10375
|
+
Ie(([, p]) => p !== void 0),
|
|
10376
10376
|
dt(),
|
|
10377
|
-
le(([,
|
|
10377
|
+
le(([, p]) => p.ranges)
|
|
10378
10378
|
),
|
|
10379
10379
|
e
|
|
10380
10380
|
), {
|
|
@@ -10407,8 +10407,8 @@ const nS = Nf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10407
10407
|
{ deviation: e, scrollBy: t, scrollingInProgress: n, scrollTop: r },
|
|
10408
10408
|
{ isAtBottom: o, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: a },
|
|
10409
10409
|
{ listState: l },
|
|
10410
|
-
{ beforeUnshiftWith: c, gap: d, shiftWithOffset: f, sizes:
|
|
10411
|
-
{ log:
|
|
10410
|
+
{ beforeUnshiftWith: c, gap: d, shiftWithOffset: f, sizes: h },
|
|
10411
|
+
{ log: p },
|
|
10412
10412
|
{ recalcInProgress: x }
|
|
10413
10413
|
]) => {
|
|
10414
10414
|
const m = Gt(
|
|
@@ -10424,7 +10424,7 @@ const nS = Nf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10424
10424
|
[0, [], 0, 0]
|
|
10425
10425
|
),
|
|
10426
10426
|
Ie(([g]) => g !== 0),
|
|
10427
|
-
$e(r, a, n, o,
|
|
10427
|
+
$e(r, a, n, o, p, x),
|
|
10428
10428
|
Ie(([, g, w, b, , , T]) => !T && !b && g !== 0 && w === no),
|
|
10429
10429
|
le(([[g], , , , , w]) => (w("Upward scrolling compensation", { amount: g }, Ut.DEBUG), g))
|
|
10430
10430
|
)
|
|
@@ -10451,7 +10451,7 @@ const nS = Nf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10451
10451
|
), nt(
|
|
10452
10452
|
U(
|
|
10453
10453
|
c,
|
|
10454
|
-
$e(
|
|
10454
|
+
$e(h, d),
|
|
10455
10455
|
le(([g, { groupIndices: w, lastSize: b, sizeTree: T }, S]) => {
|
|
10456
10456
|
function C(I) {
|
|
10457
10457
|
return I * (b + S);
|
|
@@ -10536,7 +10536,7 @@ const nS = Nf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10536
10536
|
totalCount: d,
|
|
10537
10537
|
trackItemSizes: f
|
|
10538
10538
|
},
|
|
10539
|
-
{ initialItemFinalLocationReached:
|
|
10539
|
+
{ initialItemFinalLocationReached: h, initialTopMostItemIndex: p, scrolledToInitialItem: x },
|
|
10540
10540
|
m,
|
|
10541
10541
|
y,
|
|
10542
10542
|
g,
|
|
@@ -10559,8 +10559,8 @@ const nS = Nf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10559
10559
|
fixedItemHeight: r,
|
|
10560
10560
|
gap: o,
|
|
10561
10561
|
groupCounts: R,
|
|
10562
|
-
initialItemFinalLocationReached:
|
|
10563
|
-
initialTopMostItemIndex:
|
|
10562
|
+
initialItemFinalLocationReached: h,
|
|
10563
|
+
initialTopMostItemIndex: p,
|
|
10564
10564
|
scrolledToInitialItem: x,
|
|
10565
10565
|
sizeRanges: a,
|
|
10566
10566
|
topItemCount: I,
|
|
@@ -10647,7 +10647,7 @@ function jf(e, t, n) {
|
|
|
10647
10647
|
}), Q.useImperativeHandle(g, sc(c(T)));
|
|
10648
10648
|
const C = n;
|
|
10649
10649
|
return /* @__PURE__ */ u.jsx(a.Provider, { value: T, children: n ? /* @__PURE__ */ u.jsx(C, { ...sS([...r, ...o, ...i], b), children: w }) : w });
|
|
10650
|
-
}),
|
|
10650
|
+
}), h = (y) => {
|
|
10651
10651
|
const g = Q.useContext(a);
|
|
10652
10652
|
return Q.useCallback(
|
|
10653
10653
|
(w) => {
|
|
@@ -10655,7 +10655,7 @@ function jf(e, t, n) {
|
|
|
10655
10655
|
},
|
|
10656
10656
|
[g, y]
|
|
10657
10657
|
);
|
|
10658
|
-
},
|
|
10658
|
+
}, p = (y) => {
|
|
10659
10659
|
const g = Q.useContext(a)[y], w = Q.useCallback(
|
|
10660
10660
|
(b) => nt(g, b),
|
|
10661
10661
|
[g]
|
|
@@ -10673,7 +10673,7 @@ function jf(e, t, n) {
|
|
|
10673
10673
|
}),
|
|
10674
10674
|
[g, w]
|
|
10675
10675
|
), w;
|
|
10676
|
-
}, m = Q.version.startsWith("18") ?
|
|
10676
|
+
}, m = Q.version.startsWith("18") ? p : x;
|
|
10677
10677
|
return {
|
|
10678
10678
|
Component: f,
|
|
10679
10679
|
useEmitter: (y, g) => {
|
|
@@ -10681,7 +10681,7 @@ function jf(e, t, n) {
|
|
|
10681
10681
|
Ro(() => nt(w, g), [g, w]);
|
|
10682
10682
|
},
|
|
10683
10683
|
useEmitterValue: m,
|
|
10684
|
-
usePublisher:
|
|
10684
|
+
usePublisher: h
|
|
10685
10685
|
};
|
|
10686
10686
|
}
|
|
10687
10687
|
const Pf = Q.createContext(void 0), Mf = Q.createContext(void 0), Of = typeof document < "u" ? Q.useLayoutEffect : Q.useEffect;
|
|
@@ -10693,52 +10693,52 @@ function iS(e) {
|
|
|
10693
10693
|
}
|
|
10694
10694
|
function Df(e, t, n, r = _r, o, s) {
|
|
10695
10695
|
const i = Q.useRef(null), a = Q.useRef(null), l = Q.useRef(null), c = Q.useCallback(
|
|
10696
|
-
(
|
|
10697
|
-
let
|
|
10698
|
-
const y =
|
|
10696
|
+
(h) => {
|
|
10697
|
+
let p, x, m;
|
|
10698
|
+
const y = h.target;
|
|
10699
10699
|
if (iS(y) || xi(y)) {
|
|
10700
10700
|
const w = xi(y) ? y : y.defaultView;
|
|
10701
|
-
m = s ? w.scrollX : w.scrollY,
|
|
10701
|
+
m = s ? w.scrollX : w.scrollY, p = s ? w.document.documentElement.scrollWidth : w.document.documentElement.scrollHeight, x = s ? w.innerWidth : w.innerHeight;
|
|
10702
10702
|
} else
|
|
10703
|
-
m = s ? y.scrollLeft : y.scrollTop,
|
|
10703
|
+
m = s ? y.scrollLeft : y.scrollTop, p = s ? y.scrollWidth : y.scrollHeight, x = s ? y.offsetWidth : y.offsetHeight;
|
|
10704
10704
|
const g = () => {
|
|
10705
10705
|
e({
|
|
10706
|
-
scrollHeight:
|
|
10706
|
+
scrollHeight: p,
|
|
10707
10707
|
scrollTop: Math.max(m, 0),
|
|
10708
10708
|
viewportHeight: x
|
|
10709
10709
|
});
|
|
10710
10710
|
};
|
|
10711
|
-
|
|
10711
|
+
h.suppressFlushSync ? g() : Hc.flushSync(g), a.current !== null && (m === a.current || m <= 0 || m === p - x) && (a.current = null, t(!0), l.current && (clearTimeout(l.current), l.current = null));
|
|
10712
10712
|
},
|
|
10713
10713
|
[e, t, s]
|
|
10714
10714
|
);
|
|
10715
10715
|
Q.useEffect(() => {
|
|
10716
|
-
const
|
|
10717
|
-
return r(o || i.current), c({ suppressFlushSync: !0, target:
|
|
10718
|
-
r(null),
|
|
10716
|
+
const h = o || i.current;
|
|
10717
|
+
return r(o || i.current), c({ suppressFlushSync: !0, target: h }), h.addEventListener("scroll", c, { passive: !0 }), () => {
|
|
10718
|
+
r(null), h.removeEventListener("scroll", c);
|
|
10719
10719
|
};
|
|
10720
10720
|
}, [i, c, n, r, o]);
|
|
10721
|
-
function d(
|
|
10722
|
-
const
|
|
10723
|
-
if (!
|
|
10721
|
+
function d(h) {
|
|
10722
|
+
const p = i.current;
|
|
10723
|
+
if (!p || (s ? "offsetWidth" in p && p.offsetWidth === 0 : "offsetHeight" in p && p.offsetHeight === 0))
|
|
10724
10724
|
return;
|
|
10725
|
-
const x =
|
|
10725
|
+
const x = h.behavior === "smooth";
|
|
10726
10726
|
let m, y, g;
|
|
10727
|
-
xi(
|
|
10728
|
-
Ln(
|
|
10729
|
-
s ?
|
|
10730
|
-
), m = s ?
|
|
10727
|
+
xi(p) ? (y = Math.max(
|
|
10728
|
+
Ln(p.document.documentElement, s ? "width" : "height"),
|
|
10729
|
+
s ? p.document.documentElement.scrollWidth : p.document.documentElement.scrollHeight
|
|
10730
|
+
), m = s ? p.innerWidth : p.innerHeight, g = s ? window.scrollX : window.scrollY) : (y = p[s ? "scrollWidth" : "scrollHeight"], m = Ln(p, s ? "width" : "height"), g = p[s ? "scrollLeft" : "scrollTop"]);
|
|
10731
10731
|
const w = y - m;
|
|
10732
|
-
if (
|
|
10732
|
+
if (h.top = Math.ceil(Math.max(Math.min(w, h.top), 0)), Tf(m, y) || h.top === g) {
|
|
10733
10733
|
e({ scrollHeight: y, scrollTop: g, viewportHeight: m }), x && t(!0);
|
|
10734
10734
|
return;
|
|
10735
10735
|
}
|
|
10736
|
-
x ? (a.current =
|
|
10736
|
+
x ? (a.current = h.top, l.current && clearTimeout(l.current), l.current = setTimeout(() => {
|
|
10737
10737
|
l.current = null, a.current = null, t(!0);
|
|
10738
|
-
}, 1e3)) : a.current = null, s && (
|
|
10738
|
+
}, 1e3)) : a.current = null, s && (h = { behavior: h.behavior, left: h.top }), p.scrollTo(h);
|
|
10739
10739
|
}
|
|
10740
|
-
function f(
|
|
10741
|
-
s && (
|
|
10740
|
+
function f(h) {
|
|
10741
|
+
s && (h = { behavior: h.behavior, left: h.top }), i.current.scrollBy(h);
|
|
10742
10742
|
}
|
|
10743
10743
|
return { scrollByCallback: f, scrollerRef: i, scrollToCallback: d };
|
|
10744
10744
|
}
|
|
@@ -10781,12 +10781,12 @@ const aS = /* @__PURE__ */ Ge(() => {
|
|
|
10781
10781
|
([e, t]) => ({ ...e, ...t }),
|
|
10782
10782
|
ft(_f, aS)
|
|
10783
10783
|
), cS = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), uS = { overflowAnchor: "none", position: Fa(), zIndex: 1 }, Lf = { overflowAnchor: "none" }, dS = { ...Lf, display: "inline-block", height: "100%" }, xc = /* @__PURE__ */ Q.memo(function({ showTopList: e = !1 }) {
|
|
10784
|
-
const t = Ae("listState"), n = Zt("sizeRanges"), r = Ae("useWindowScroll"), o = Ae("customScrollParent"), s = Zt("windowScrollContainerState"), i = Zt("scrollContainerState"), a = o || r ? s : i, l = Ae("itemContent"), c = Ae("context"), d = Ae("groupContent"), f = Ae("trackItemSizes"),
|
|
10784
|
+
const t = Ae("listState"), n = Zt("sizeRanges"), r = Ae("useWindowScroll"), o = Ae("customScrollParent"), s = Zt("windowScrollContainerState"), i = Zt("scrollContainerState"), a = o || r ? s : i, l = Ae("itemContent"), c = Ae("context"), d = Ae("groupContent"), f = Ae("trackItemSizes"), h = Ae("itemSize"), p = Ae("log"), x = Zt("gap"), m = Ae("horizontalDirection"), { callbackRef: y } = k0(
|
|
10785
10785
|
n,
|
|
10786
|
-
|
|
10786
|
+
h,
|
|
10787
10787
|
f,
|
|
10788
10788
|
e ? _r : a,
|
|
10789
|
-
|
|
10789
|
+
p,
|
|
10790
10790
|
x,
|
|
10791
10791
|
o,
|
|
10792
10792
|
m,
|
|
@@ -10914,7 +10914,7 @@ const gS = /* @__PURE__ */ Q.memo(function() {
|
|
|
10914
10914
|
});
|
|
10915
10915
|
function $f({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
10916
10916
|
return Q.memo(function({ children: r, style: o, context: s, ...i }) {
|
|
10917
|
-
const a = n("scrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("scrollerRef"), f = t("horizontalDirection") || !1, { scrollByCallback:
|
|
10917
|
+
const a = n("scrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("scrollerRef"), f = t("horizontalDirection") || !1, { scrollByCallback: h, scrollerRef: p, scrollToCallback: x } = Df(
|
|
10918
10918
|
a,
|
|
10919
10919
|
c,
|
|
10920
10920
|
l,
|
|
@@ -10922,12 +10922,12 @@ function $f({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
10922
10922
|
void 0,
|
|
10923
10923
|
f
|
|
10924
10924
|
);
|
|
10925
|
-
return e("scrollTo", x), e("scrollBy",
|
|
10925
|
+
return e("scrollTo", x), e("scrollBy", h), /* @__PURE__ */ u.jsx(
|
|
10926
10926
|
l,
|
|
10927
10927
|
{
|
|
10928
10928
|
"data-testid": "virtuoso-scroller",
|
|
10929
10929
|
"data-virtuoso-scroller": !0,
|
|
10930
|
-
ref:
|
|
10930
|
+
ref: p,
|
|
10931
10931
|
style: { ...f ? pS : fS, ...o },
|
|
10932
10932
|
tabIndex: 0,
|
|
10933
10933
|
...i,
|
|
@@ -10939,22 +10939,22 @@ function $f({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
10939
10939
|
}
|
|
10940
10940
|
function Ff({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
10941
10941
|
return Q.memo(function({ children: r, style: o, context: s, ...i }) {
|
|
10942
|
-
const a = n("windowScrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("totalListHeight"), f = t("deviation"),
|
|
10942
|
+
const a = n("windowScrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("totalListHeight"), f = t("deviation"), h = t("customScrollParent"), p = Q.useRef(null), x = t("scrollerRef"), { scrollByCallback: m, scrollerRef: y, scrollToCallback: g } = Df(
|
|
10943
10943
|
a,
|
|
10944
10944
|
c,
|
|
10945
10945
|
l,
|
|
10946
10946
|
x,
|
|
10947
|
-
|
|
10947
|
+
h
|
|
10948
10948
|
);
|
|
10949
10949
|
return Of(() => {
|
|
10950
10950
|
var w;
|
|
10951
|
-
return y.current =
|
|
10951
|
+
return y.current = h || ((w = p.current) == null ? void 0 : w.ownerDocument.defaultView), () => {
|
|
10952
10952
|
y.current = null;
|
|
10953
10953
|
};
|
|
10954
|
-
}, [y,
|
|
10954
|
+
}, [y, h]), e("windowScrollTo", g), e("scrollBy", m), /* @__PURE__ */ u.jsx(
|
|
10955
10955
|
l,
|
|
10956
10956
|
{
|
|
10957
|
-
ref:
|
|
10957
|
+
ref: p,
|
|
10958
10958
|
"data-virtuoso-scroller": !0,
|
|
10959
10959
|
style: { position: "relative", ...o, ...d !== 0 ? { height: d + f } : {} },
|
|
10960
10960
|
...i,
|
|
@@ -11132,8 +11132,8 @@ const NS = /* @__PURE__ */ Ge(
|
|
|
11132
11132
|
([
|
|
11133
11133
|
{ increaseViewportBy: e, listBoundary: t, overscan: n, visibleRange: r },
|
|
11134
11134
|
{ footerHeight: o, headerHeight: s, scrollBy: i, scrollContainerState: a, scrollTo: l, scrollTop: c, smoothScrollTargetReached: d, viewportHeight: f },
|
|
11135
|
-
p,
|
|
11136
11135
|
h,
|
|
11136
|
+
p,
|
|
11137
11137
|
{ didMount: x, propsReady: m },
|
|
11138
11138
|
{ customScrollParent: y, useWindowScroll: g, windowScrollContainerState: w, windowScrollTo: b, windowViewportRect: T },
|
|
11139
11139
|
S
|
|
@@ -11304,7 +11304,7 @@ const NS = /* @__PURE__ */ Ge(
|
|
|
11304
11304
|
In(0)
|
|
11305
11305
|
)
|
|
11306
11306
|
);
|
|
11307
|
-
pe(z,
|
|
11307
|
+
pe(z, p.scrollSeekRangeChanged), pe(
|
|
11308
11308
|
U(
|
|
11309
11309
|
P,
|
|
11310
11310
|
$e(_, D, C, F),
|
|
@@ -11357,13 +11357,13 @@ const NS = /* @__PURE__ */ Ge(
|
|
|
11357
11357
|
windowScrollContainerState: w,
|
|
11358
11358
|
windowScrollTo: b,
|
|
11359
11359
|
windowViewportRect: T,
|
|
11360
|
-
...
|
|
11360
|
+
...p,
|
|
11361
11361
|
// output
|
|
11362
11362
|
gridState: R,
|
|
11363
11363
|
horizontalDirection: se,
|
|
11364
11364
|
initialTopMostItemIndex: j,
|
|
11365
11365
|
totalListHeight: J,
|
|
11366
|
-
...
|
|
11366
|
+
...h,
|
|
11367
11367
|
endReached: Re,
|
|
11368
11368
|
propsReady: m,
|
|
11369
11369
|
rangeChanged: z,
|
|
@@ -11390,13 +11390,13 @@ function Ki(e, t, n, r) {
|
|
|
11390
11390
|
return i > 0 ? i + t.row : i;
|
|
11391
11391
|
}
|
|
11392
11392
|
const _S = /* @__PURE__ */ Ge(() => {
|
|
11393
|
-
const e = ee((f) => `Item ${f}`), t = ee({}), n = ee(null), r = ee("virtuoso-grid-item"), o = ee("virtuoso-grid-list"), s = ee(Ba), i = ee("div"), a = ee(_r), l = (f,
|
|
11393
|
+
const e = ee((f) => `Item ${f}`), t = ee({}), n = ee(null), r = ee("virtuoso-grid-item"), o = ee("virtuoso-grid-list"), s = ee(Ba), i = ee("div"), a = ee(_r), l = (f, h = null) => Dt(
|
|
11394
11394
|
U(
|
|
11395
11395
|
t,
|
|
11396
|
-
le((
|
|
11396
|
+
le((p) => p[f]),
|
|
11397
11397
|
dt()
|
|
11398
11398
|
),
|
|
11399
|
-
|
|
11399
|
+
h
|
|
11400
11400
|
), c = ee(!1), d = ee(!1);
|
|
11401
11401
|
return pe(Te(d), c), {
|
|
11402
11402
|
components: t,
|
|
@@ -11420,7 +11420,7 @@ const _S = /* @__PURE__ */ Ge(() => {
|
|
|
11420
11420
|
([e, t]) => ({ ...e, ...t }),
|
|
11421
11421
|
ft(NS, _S)
|
|
11422
11422
|
), PS = /* @__PURE__ */ Q.memo(function() {
|
|
11423
|
-
const e = ht("gridState"), t = ht("listClassName"), n = ht("itemClassName"), r = ht("itemContent"), o = ht("computeItemKey"), s = ht("isSeeking"), i = Qt("scrollHeight"), a = ht("ItemComponent"), l = ht("ListComponent"), c = ht("ScrollSeekPlaceholder"), d = ht("context"), f = Qt("itemDimensions"),
|
|
11423
|
+
const e = ht("gridState"), t = ht("listClassName"), n = ht("itemClassName"), r = ht("itemContent"), o = ht("computeItemKey"), s = ht("isSeeking"), i = Qt("scrollHeight"), a = ht("ItemComponent"), l = ht("ListComponent"), c = ht("ScrollSeekPlaceholder"), d = ht("context"), f = Qt("itemDimensions"), h = Qt("gap"), p = ht("log"), x = ht("stateRestoreInProgress"), m = Qt("reportReadyState"), y = ar(
|
|
11424
11424
|
Q.useMemo(
|
|
11425
11425
|
() => (g) => {
|
|
11426
11426
|
const w = g.parentElement.parentElement.scrollHeight;
|
|
@@ -11430,12 +11430,12 @@ const _S = /* @__PURE__ */ Ge(() => {
|
|
|
11430
11430
|
const { height: T, width: S } = b.getBoundingClientRect();
|
|
11431
11431
|
f({ height: T, width: S });
|
|
11432
11432
|
}
|
|
11433
|
-
|
|
11434
|
-
column: Cc("column-gap", getComputedStyle(g).columnGap,
|
|
11435
|
-
row: Cc("row-gap", getComputedStyle(g).rowGap,
|
|
11433
|
+
h({
|
|
11434
|
+
column: Cc("column-gap", getComputedStyle(g).columnGap, p),
|
|
11435
|
+
row: Cc("row-gap", getComputedStyle(g).rowGap, p)
|
|
11436
11436
|
});
|
|
11437
11437
|
},
|
|
11438
|
-
[i, f,
|
|
11438
|
+
[i, f, h, p]
|
|
11439
11439
|
),
|
|
11440
11440
|
!0,
|
|
11441
11441
|
!1
|
|
@@ -12199,7 +12199,7 @@ function Ka() {
|
|
|
12199
12199
|
};
|
|
12200
12200
|
}
|
|
12201
12201
|
function xC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
12202
|
-
const [s, i] = me(!1), [a, l] = me(null), [c, d] = me(null), { toast: f } = Ka(),
|
|
12202
|
+
const [s, i] = me(!1), [a, l] = me(null), [c, d] = me(null), { toast: f } = Ka(), h = Q.useCallback(async () => {
|
|
12203
12203
|
if (n) {
|
|
12204
12204
|
i(!0), d(null), l(null);
|
|
12205
12205
|
try {
|
|
@@ -12213,9 +12213,9 @@ function xC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
12213
12213
|
}
|
|
12214
12214
|
}, [n]);
|
|
12215
12215
|
wt(() => {
|
|
12216
|
-
e && n &&
|
|
12217
|
-
}, [e, n,
|
|
12218
|
-
const
|
|
12216
|
+
e && n && h();
|
|
12217
|
+
}, [e, n, h]);
|
|
12218
|
+
const p = async () => {
|
|
12219
12219
|
if (n)
|
|
12220
12220
|
try {
|
|
12221
12221
|
await JS(n), f({ title: "Download started", description: `Downloading ${r}` });
|
|
@@ -12236,7 +12236,7 @@ function xC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
12236
12236
|
] }) : c ? /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
|
|
12237
12237
|
/* @__PURE__ */ u.jsx("div", { className: "text-red-500 mb-4", children: "⚠️" }),
|
|
12238
12238
|
/* @__PURE__ */ u.jsx("p", { className: "text-red-600 mb-4", children: c }),
|
|
12239
|
-
/* @__PURE__ */ u.jsx(tt, { onClick:
|
|
12239
|
+
/* @__PURE__ */ u.jsx(tt, { onClick: h, variant: "outline", children: "Try Again" })
|
|
12240
12240
|
] }) : a ? o.startsWith("image/") ? /* @__PURE__ */ u.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ u.jsx(
|
|
12241
12241
|
"img",
|
|
12242
12242
|
{
|
|
@@ -12293,7 +12293,7 @@ function xC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
12293
12293
|
{
|
|
12294
12294
|
variant: "outline",
|
|
12295
12295
|
size: "sm",
|
|
12296
|
-
onClick:
|
|
12296
|
+
onClick: p,
|
|
12297
12297
|
className: "flex items-center gap-2",
|
|
12298
12298
|
children: [
|
|
12299
12299
|
/* @__PURE__ */ u.jsx(sm, { className: "h-4 w-4" }),
|
|
@@ -12562,7 +12562,7 @@ class qa {
|
|
|
12562
12562
|
list(t) {
|
|
12563
12563
|
let n = this.rules.block.list.exec(t);
|
|
12564
12564
|
if (n) {
|
|
12565
|
-
let r, o, s, i, a, l, c, d, f,
|
|
12565
|
+
let r, o, s, i, a, l, c, d, f, h, p, x, m = n[1].trim();
|
|
12566
12566
|
const y = m.length > 1, g = {
|
|
12567
12567
|
type: "list",
|
|
12568
12568
|
raw: "",
|
|
@@ -12576,34 +12576,34 @@ class qa {
|
|
|
12576
12576
|
for (; t && (x = !1, !(!(n = w.exec(t)) || this.rules.block.hr.test(t))); ) {
|
|
12577
12577
|
if (r = n[0], t = t.substring(r.length), d = n[2].split(`
|
|
12578
12578
|
`, 1)[0].replace(/^\t+/, (T) => " ".repeat(3 * T.length)), f = t.split(`
|
|
12579
|
-
`, 1)[0], this.options.pedantic ? (i = 2,
|
|
12579
|
+
`, 1)[0], this.options.pedantic ? (i = 2, p = d.trimLeft()) : (i = n[2].search(/[^ ]/), i = i > 4 ? 1 : i, p = d.slice(i), i += n[1].length), l = !1, !d && /^ *$/.test(f) && (r += f + `
|
|
12580
12580
|
`, t = t.substring(f.length + 1), x = !0), !x) {
|
|
12581
12581
|
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)}}(?:\`\`\`|~~~)`), I = new RegExp(`^ {0,${Math.min(3, i - 1)}}#`);
|
|
12582
|
-
for (; t && (
|
|
12583
|
-
`, 1)[0], f =
|
|
12582
|
+
for (; t && (h = t.split(`
|
|
12583
|
+
`, 1)[0], f = h, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(C.test(f) || I.test(f) || T.test(f) || S.test(t))); ) {
|
|
12584
12584
|
if (f.search(/[^ ]/) >= i || !f.trim())
|
|
12585
|
-
|
|
12585
|
+
p += `
|
|
12586
12586
|
` + f.slice(i);
|
|
12587
12587
|
else {
|
|
12588
12588
|
if (l || d.search(/[^ ]/) >= 4 || C.test(d) || I.test(d) || S.test(d))
|
|
12589
12589
|
break;
|
|
12590
|
-
|
|
12590
|
+
p += `
|
|
12591
12591
|
` + f;
|
|
12592
12592
|
}
|
|
12593
|
-
!l && !f.trim() && (l = !0), r +=
|
|
12594
|
-
`, t = t.substring(
|
|
12593
|
+
!l && !f.trim() && (l = !0), r += h + `
|
|
12594
|
+
`, t = t.substring(h.length + 1), d = f.slice(i);
|
|
12595
12595
|
}
|
|
12596
12596
|
}
|
|
12597
|
-
g.loose || (c ? g.loose = !0 : /\n *\n *$/.test(r) && (c = !0)), this.options.gfm && (o = /^\[[ xX]\] /.exec(
|
|
12597
|
+
g.loose || (c ? g.loose = !0 : /\n *\n *$/.test(r) && (c = !0)), this.options.gfm && (o = /^\[[ xX]\] /.exec(p), o && (s = o[0] !== "[ ] ", p = p.replace(/^\[[ xX]\] +/, ""))), g.items.push({
|
|
12598
12598
|
type: "list_item",
|
|
12599
12599
|
raw: r,
|
|
12600
12600
|
task: !!o,
|
|
12601
12601
|
checked: s,
|
|
12602
12602
|
loose: !1,
|
|
12603
|
-
text:
|
|
12603
|
+
text: p
|
|
12604
12604
|
}), g.raw += r;
|
|
12605
12605
|
}
|
|
12606
|
-
g.items[g.items.length - 1].raw = r.trimRight(), g.items[g.items.length - 1].text =
|
|
12606
|
+
g.items[g.items.length - 1].raw = r.trimRight(), g.items[g.items.length - 1].text = p.trimRight(), g.raw = g.raw.trimRight();
|
|
12607
12607
|
const b = g.items.length;
|
|
12608
12608
|
for (a = 0; a < b; a++)
|
|
12609
12609
|
if (this.lexer.state.top = !1, g.items[a].tokens = this.lexer.blockTokens(g.items[a].text, []), !g.loose) {
|
|
@@ -12788,22 +12788,22 @@ class qa {
|
|
|
12788
12788
|
}
|
|
12789
12789
|
if (c -= l, c > 0) continue;
|
|
12790
12790
|
l = Math.min(l, l + c + d);
|
|
12791
|
-
const
|
|
12791
|
+
const h = t.slice(0, i + o.index + (o[0].length - a.length) + l);
|
|
12792
12792
|
if (Math.min(i, l) % 2) {
|
|
12793
|
-
const x =
|
|
12793
|
+
const x = h.slice(1, -1);
|
|
12794
12794
|
return {
|
|
12795
12795
|
type: "em",
|
|
12796
|
-
raw:
|
|
12796
|
+
raw: h,
|
|
12797
12797
|
text: x,
|
|
12798
12798
|
tokens: this.lexer.inlineTokens(x)
|
|
12799
12799
|
};
|
|
12800
12800
|
}
|
|
12801
|
-
const
|
|
12801
|
+
const p = h.slice(2, -2);
|
|
12802
12802
|
return {
|
|
12803
12803
|
type: "strong",
|
|
12804
|
-
raw:
|
|
12805
|
-
text:
|
|
12806
|
-
tokens: this.lexer.inlineTokens(
|
|
12804
|
+
raw: h,
|
|
12805
|
+
text: p,
|
|
12806
|
+
tokens: this.lexer.inlineTokens(p)
|
|
12807
12807
|
};
|
|
12808
12808
|
}
|
|
12809
12809
|
}
|
|
@@ -13233,9 +13233,9 @@ class $n {
|
|
|
13233
13233
|
if (s = t, this.options.extensions && this.options.extensions.startInline) {
|
|
13234
13234
|
let d = 1 / 0;
|
|
13235
13235
|
const f = t.slice(1);
|
|
13236
|
-
let
|
|
13237
|
-
this.options.extensions.startInline.forEach(function(
|
|
13238
|
-
|
|
13236
|
+
let h;
|
|
13237
|
+
this.options.extensions.startInline.forEach(function(p) {
|
|
13238
|
+
h = p.call({ lexer: this }, f), typeof h == "number" && h >= 0 && (d = Math.min(d, h));
|
|
13239
13239
|
}), d < 1 / 0 && d >= 0 && (s = t.substring(0, d + 1));
|
|
13240
13240
|
}
|
|
13241
13241
|
if (r = this.tokenizer.inlineText(s, PC)) {
|
|
@@ -13487,14 +13487,14 @@ class Fn {
|
|
|
13487
13487
|
* Parse Loop
|
|
13488
13488
|
*/
|
|
13489
13489
|
parse(t, n = !0) {
|
|
13490
|
-
let r = "", o, s, i, a, l, c, d, f,
|
|
13490
|
+
let r = "", o, s, i, a, l, c, d, f, h, p, x, m, y, g, w, b, T, S, C;
|
|
13491
13491
|
const I = t.length;
|
|
13492
13492
|
for (o = 0; o < I; o++) {
|
|
13493
|
-
if (
|
|
13493
|
+
if (p = t[o], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[p.type] && (C = this.options.extensions.renderers[p.type].call({ parser: this }, p), C !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(p.type))) {
|
|
13494
13494
|
r += C || "";
|
|
13495
13495
|
continue;
|
|
13496
13496
|
}
|
|
13497
|
-
switch (
|
|
13497
|
+
switch (p.type) {
|
|
13498
13498
|
case "space":
|
|
13499
13499
|
continue;
|
|
13500
13500
|
case "hr": {
|
|
@@ -13503,68 +13503,68 @@ class Fn {
|
|
|
13503
13503
|
}
|
|
13504
13504
|
case "heading": {
|
|
13505
13505
|
r += this.renderer.heading(
|
|
13506
|
-
this.parseInline(
|
|
13507
|
-
|
|
13508
|
-
yp(this.parseInline(
|
|
13506
|
+
this.parseInline(p.tokens),
|
|
13507
|
+
p.depth,
|
|
13508
|
+
yp(this.parseInline(p.tokens, this.textRenderer)),
|
|
13509
13509
|
this.slugger
|
|
13510
13510
|
);
|
|
13511
13511
|
continue;
|
|
13512
13512
|
}
|
|
13513
13513
|
case "code": {
|
|
13514
13514
|
r += this.renderer.code(
|
|
13515
|
-
|
|
13516
|
-
|
|
13517
|
-
|
|
13515
|
+
p.text,
|
|
13516
|
+
p.lang,
|
|
13517
|
+
p.escaped
|
|
13518
13518
|
);
|
|
13519
13519
|
continue;
|
|
13520
13520
|
}
|
|
13521
13521
|
case "table": {
|
|
13522
|
-
for (f = "", d = "", a =
|
|
13522
|
+
for (f = "", d = "", a = p.header.length, s = 0; s < a; s++)
|
|
13523
13523
|
d += this.renderer.tablecell(
|
|
13524
|
-
this.parseInline(
|
|
13525
|
-
{ header: !0, align:
|
|
13524
|
+
this.parseInline(p.header[s].tokens),
|
|
13525
|
+
{ header: !0, align: p.align[s] }
|
|
13526
13526
|
);
|
|
13527
|
-
for (f += this.renderer.tablerow(d),
|
|
13528
|
-
for (c =
|
|
13527
|
+
for (f += this.renderer.tablerow(d), h = "", a = p.rows.length, s = 0; s < a; s++) {
|
|
13528
|
+
for (c = p.rows[s], d = "", l = c.length, i = 0; i < l; i++)
|
|
13529
13529
|
d += this.renderer.tablecell(
|
|
13530
13530
|
this.parseInline(c[i].tokens),
|
|
13531
|
-
{ header: !1, align:
|
|
13531
|
+
{ header: !1, align: p.align[i] }
|
|
13532
13532
|
);
|
|
13533
|
-
|
|
13533
|
+
h += this.renderer.tablerow(d);
|
|
13534
13534
|
}
|
|
13535
|
-
r += this.renderer.table(f,
|
|
13535
|
+
r += this.renderer.table(f, h);
|
|
13536
13536
|
continue;
|
|
13537
13537
|
}
|
|
13538
13538
|
case "blockquote": {
|
|
13539
|
-
|
|
13539
|
+
h = this.parse(p.tokens), r += this.renderer.blockquote(h);
|
|
13540
13540
|
continue;
|
|
13541
13541
|
}
|
|
13542
13542
|
case "list": {
|
|
13543
|
-
for (x =
|
|
13544
|
-
w =
|
|
13543
|
+
for (x = p.ordered, m = p.start, y = p.loose, a = p.items.length, h = "", s = 0; s < a; s++)
|
|
13544
|
+
w = p.items[s], b = w.checked, T = w.task, g = "", 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({
|
|
13545
13545
|
type: "text",
|
|
13546
13546
|
text: S
|
|
13547
|
-
}) : g += S), g += this.parse(w.tokens, y),
|
|
13548
|
-
r += this.renderer.list(
|
|
13547
|
+
}) : g += S), g += this.parse(w.tokens, y), h += this.renderer.listitem(g, T, b);
|
|
13548
|
+
r += this.renderer.list(h, x, m);
|
|
13549
13549
|
continue;
|
|
13550
13550
|
}
|
|
13551
13551
|
case "html": {
|
|
13552
|
-
r += this.renderer.html(
|
|
13552
|
+
r += this.renderer.html(p.text);
|
|
13553
13553
|
continue;
|
|
13554
13554
|
}
|
|
13555
13555
|
case "paragraph": {
|
|
13556
|
-
r += this.renderer.paragraph(this.parseInline(
|
|
13556
|
+
r += this.renderer.paragraph(this.parseInline(p.tokens));
|
|
13557
13557
|
continue;
|
|
13558
13558
|
}
|
|
13559
13559
|
case "text": {
|
|
13560
|
-
for (
|
|
13561
|
-
|
|
13562
|
-
` + (
|
|
13563
|
-
r += n ? this.renderer.paragraph(
|
|
13560
|
+
for (h = p.tokens ? this.parseInline(p.tokens) : p.text; o + 1 < I && t[o + 1].type === "text"; )
|
|
13561
|
+
p = t[++o], h += `
|
|
13562
|
+
` + (p.tokens ? this.parseInline(p.tokens) : p.text);
|
|
13563
|
+
r += n ? this.renderer.paragraph(h) : h;
|
|
13564
13564
|
continue;
|
|
13565
13565
|
}
|
|
13566
13566
|
default: {
|
|
13567
|
-
const R = 'Token with "' +
|
|
13567
|
+
const R = 'Token with "' + p.type + '" type was not found.';
|
|
13568
13568
|
if (this.options.silent) {
|
|
13569
13569
|
console.error(R);
|
|
13570
13570
|
return;
|
|
@@ -13703,23 +13703,23 @@ function bp(e, t) {
|
|
|
13703
13703
|
return i(f);
|
|
13704
13704
|
}
|
|
13705
13705
|
const c = function(f) {
|
|
13706
|
-
let
|
|
13706
|
+
let h;
|
|
13707
13707
|
if (!f)
|
|
13708
13708
|
try {
|
|
13709
|
-
r.walkTokens && he.walkTokens(l, r.walkTokens),
|
|
13710
|
-
} catch (
|
|
13711
|
-
f =
|
|
13709
|
+
r.walkTokens && he.walkTokens(l, r.walkTokens), h = t(l, r), r.hooks && (h = r.hooks.postprocess(h));
|
|
13710
|
+
} catch (p) {
|
|
13711
|
+
f = p;
|
|
13712
13712
|
}
|
|
13713
|
-
return r.highlight = a, f ? i(f) : o(null,
|
|
13713
|
+
return r.highlight = a, f ? i(f) : o(null, h);
|
|
13714
13714
|
};
|
|
13715
13715
|
if (!a || a.length < 3 || (delete r.highlight, !l.length)) return c();
|
|
13716
13716
|
let d = 0;
|
|
13717
13717
|
he.walkTokens(l, function(f) {
|
|
13718
13718
|
f.type === "code" && (d++, setTimeout(() => {
|
|
13719
|
-
a(f.text, f.lang, function(
|
|
13720
|
-
if (
|
|
13721
|
-
return c(
|
|
13722
|
-
|
|
13719
|
+
a(f.text, f.lang, function(h, p) {
|
|
13720
|
+
if (h)
|
|
13721
|
+
return c(h);
|
|
13722
|
+
p != null && p !== f.text && (f.text = p, f.escaped = !0), d--, d === 0 && c();
|
|
13723
13723
|
});
|
|
13724
13724
|
}, 0));
|
|
13725
13725
|
}), d === 0 && c();
|
|
@@ -14088,29 +14088,29 @@ function HC({
|
|
|
14088
14088
|
function UC(e) {
|
|
14089
14089
|
const { allowFileOpen: t, currentThreadId: n } = e, { toast: r } = Ka(), [o, s] = me({}), [i, a] = me(null), [l, c] = me(!1), d = ge(() => {
|
|
14090
14090
|
c(!1), a(null);
|
|
14091
|
-
}, []), f = ge((
|
|
14092
|
-
a(
|
|
14093
|
-
}, []),
|
|
14094
|
-
async (
|
|
14091
|
+
}, []), f = ge((p) => {
|
|
14092
|
+
a(p), c(!0);
|
|
14093
|
+
}, []), h = ge(
|
|
14094
|
+
async (p, x, m) => {
|
|
14095
14095
|
var y, g;
|
|
14096
14096
|
if (!t) {
|
|
14097
|
-
|
|
14097
|
+
p.preventDefault();
|
|
14098
14098
|
return;
|
|
14099
14099
|
}
|
|
14100
14100
|
if (o[m]) {
|
|
14101
|
-
|
|
14101
|
+
p.preventDefault();
|
|
14102
14102
|
return;
|
|
14103
14103
|
}
|
|
14104
14104
|
try {
|
|
14105
14105
|
const w = String(x.url ?? ""), b = w.match(/\/chat\/files\/([^/]+)(?:\/(view|download))?/);
|
|
14106
14106
|
if (b) {
|
|
14107
|
-
|
|
14107
|
+
p.preventDefault();
|
|
14108
14108
|
const T = b[1], S = x.name || `file_${T}`, C = x.mimeType || "application/octet-stream";
|
|
14109
14109
|
f({ id: T, name: S, mimeType: C });
|
|
14110
14110
|
return;
|
|
14111
14111
|
}
|
|
14112
14112
|
if (w.startsWith("data:")) {
|
|
14113
|
-
|
|
14113
|
+
p.preventDefault(), s((S) => ({ ...S, [m]: !0 }));
|
|
14114
14114
|
const T = r({ title: "Fetching file...", description: "", open: !0 });
|
|
14115
14115
|
try {
|
|
14116
14116
|
const S = await ZS(n ?? void 0);
|
|
@@ -14151,7 +14151,7 @@ function UC(e) {
|
|
|
14151
14151
|
);
|
|
14152
14152
|
return {
|
|
14153
14153
|
uploadingFiles: o,
|
|
14154
|
-
handleFileClick:
|
|
14154
|
+
handleFileClick: h,
|
|
14155
14155
|
fileViewerOpen: l,
|
|
14156
14156
|
currentFileInfo: i,
|
|
14157
14157
|
closeFileViewer: d
|
|
@@ -14270,8 +14270,8 @@ const Ya = Qh(function({
|
|
|
14270
14270
|
truncateUserMessages: c = !0,
|
|
14271
14271
|
userMessagePreviewLength: d = 500,
|
|
14272
14272
|
showToolMessages: f = !0,
|
|
14273
|
-
showArtifactPreviews:
|
|
14274
|
-
customStyles:
|
|
14273
|
+
showArtifactPreviews: h = !0,
|
|
14274
|
+
customStyles: p = {},
|
|
14275
14275
|
onEdit: x,
|
|
14276
14276
|
onRegenerate: m,
|
|
14277
14277
|
onCancelEdit: y,
|
|
@@ -14345,7 +14345,7 @@ const Ya = Qh(function({
|
|
|
14345
14345
|
const A = t.content;
|
|
14346
14346
|
return Array.isArray(A) ? VS(A) : "";
|
|
14347
14347
|
}, [se, t]), Ke = De(() => {
|
|
14348
|
-
if (se || !
|
|
14348
|
+
if (se || !h) return [];
|
|
14349
14349
|
const Y = t.artifact;
|
|
14350
14350
|
if (!Y) return [];
|
|
14351
14351
|
const te = [], fe = [
|
|
@@ -14356,7 +14356,7 @@ const Ya = Qh(function({
|
|
|
14356
14356
|
Se && te.push(Se);
|
|
14357
14357
|
}
|
|
14358
14358
|
return te;
|
|
14359
|
-
}, [se, t,
|
|
14359
|
+
}, [se, t, h]), rt = ge(async () => {
|
|
14360
14360
|
const A = X ? Qe : ae;
|
|
14361
14361
|
async function Y(te) {
|
|
14362
14362
|
if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
|
|
@@ -14613,7 +14613,7 @@ const Ya = Qh(function({
|
|
|
14613
14613
|
},
|
|
14614
14614
|
[D, R]
|
|
14615
14615
|
), lt = De(() => Xe ? et.findIndex((A) => A.id === Xe) : -1, [Xe, et]), q = De(() => lt < 0 ? null : et[lt] ?? null, [lt, et]);
|
|
14616
|
-
return X && !f && Ke.length === 0 ? null : xe && se ? /* @__PURE__ */ u.jsx("div", { className: ne(at(),
|
|
14616
|
+
return X && !f && Ke.length === 0 ? null : xe && se ? /* @__PURE__ */ u.jsx("div", { className: ne(at(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: ne(_t(), p.content), children: [
|
|
14617
14617
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
|
|
14618
14618
|
/* @__PURE__ */ u.jsx(Js, { className: ne("h-4 w-4", Z) }),
|
|
14619
14619
|
a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
|
|
@@ -14626,7 +14626,7 @@ const Ya = Qh(function({
|
|
|
14626
14626
|
}
|
|
14627
14627
|
)
|
|
14628
14628
|
] }) }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
14629
|
-
/* @__PURE__ */ u.jsx("div", { className: ne(at(),
|
|
14629
|
+
/* @__PURE__ */ u.jsx("div", { className: ne(at(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: ne(_t(), p.content), children: [
|
|
14630
14630
|
(i || a || X) && /* @__PURE__ */ u.jsxs(
|
|
14631
14631
|
"div",
|
|
14632
14632
|
{
|
|
@@ -14634,7 +14634,7 @@ const Ya = Qh(function({
|
|
|
14634
14634
|
"flex items-center justify-between mb-2 pb-2 border-b border-current/10",
|
|
14635
14635
|
j && "mb-1 pb-1",
|
|
14636
14636
|
Z,
|
|
14637
|
-
|
|
14637
|
+
p.header
|
|
14638
14638
|
),
|
|
14639
14639
|
children: [
|
|
14640
14640
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -14728,7 +14728,7 @@ const Ya = Qh(function({
|
|
|
14728
14728
|
className: ne(
|
|
14729
14729
|
"opacity-0 group-hover:opacity-100 transition-opacity",
|
|
14730
14730
|
"flex items-center gap-1",
|
|
14731
|
-
|
|
14731
|
+
p.actions
|
|
14732
14732
|
),
|
|
14733
14733
|
children: [
|
|
14734
14734
|
/* @__PURE__ */ u.jsx("div", { className: "relative", children: /* @__PURE__ */ u.jsx(
|
|
@@ -14774,7 +14774,7 @@ const Ya = Qh(function({
|
|
|
14774
14774
|
),
|
|
14775
14775
|
/* @__PURE__ */ u.jsxs("div", { className: "relative", children: [
|
|
14776
14776
|
Lt(),
|
|
14777
|
-
|
|
14777
|
+
h && Ke.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "mt-3 space-y-4", children: Ke.map((A, Y) => /* @__PURE__ */ u.jsx(BC, { preview: A, idx: Y }, `artifact-${Y}`)) })
|
|
14778
14778
|
] }),
|
|
14779
14779
|
X && $ === "expanded" && (oe.toolCallId || oe.name) && /* @__PURE__ */ u.jsxs("div", { className: ne("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", j && "text-xs"), children: [
|
|
14780
14780
|
oe.name && /* @__PURE__ */ u.jsxs("div", { children: [
|
|
@@ -14792,7 +14792,7 @@ const Ya = Qh(function({
|
|
|
14792
14792
|
className: ne(
|
|
14793
14793
|
"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
14794
14794
|
"flex items-center gap-1",
|
|
14795
|
-
|
|
14795
|
+
p.actions
|
|
14796
14796
|
),
|
|
14797
14797
|
children: [
|
|
14798
14798
|
/* @__PURE__ */ u.jsx(
|
|
@@ -14841,7 +14841,7 @@ const Ya = Qh(function({
|
|
|
14841
14841
|
)
|
|
14842
14842
|
] });
|
|
14843
14843
|
}, (e, t) => {
|
|
14844
|
-
var i, a, l, c, d, f,
|
|
14844
|
+
var i, a, l, c, d, f, h, p;
|
|
14845
14845
|
if (t.isStreamingMessage || e.isStreamingMessage || !(e.message.id === t.message.id && Tc(e.message) === Tc(t.message))) return !1;
|
|
14846
14846
|
const o = [
|
|
14847
14847
|
"isEditing",
|
|
@@ -14853,13 +14853,13 @@ const Ya = Qh(function({
|
|
|
14853
14853
|
"userMessagePreviewLength",
|
|
14854
14854
|
"showToolMessages",
|
|
14855
14855
|
"attemptMeta"
|
|
14856
|
-
].every((x) => e[x] === t[x]), s = ((i = e.customStyles) == null ? void 0 : i.container) === ((a = t.customStyles) == null ? void 0 : a.container) && ((l = e.customStyles) == null ? void 0 : l.content) === ((c = t.customStyles) == null ? void 0 : c.content) && ((d = e.customStyles) == null ? void 0 : d.actions) === ((f = t.customStyles) == null ? void 0 : f.actions) && ((
|
|
14856
|
+
].every((x) => e[x] === t[x]), s = ((i = e.customStyles) == null ? void 0 : i.container) === ((a = t.customStyles) == null ? void 0 : a.container) && ((l = e.customStyles) == null ? void 0 : l.content) === ((c = t.customStyles) == null ? void 0 : c.content) && ((d = e.customStyles) == null ? void 0 : d.actions) === ((f = t.customStyles) == null ? void 0 : f.actions) && ((h = e.customStyles) == null ? void 0 : h.header) === ((p = t.customStyles) == null ? void 0 : p.header);
|
|
14857
14857
|
return o && s;
|
|
14858
14858
|
});
|
|
14859
14859
|
Ya.displayName = "MessageComponent";
|
|
14860
14860
|
function qC(e, t) {
|
|
14861
14861
|
return De(() => {
|
|
14862
|
-
var d, f,
|
|
14862
|
+
var d, f, h, p, x;
|
|
14863
14863
|
const n = e && "type" in e && e.type === "default_message";
|
|
14864
14864
|
let r = [], o = null, s = {}, i = {}, a = null, l = null, c = null;
|
|
14865
14865
|
if (!n && e) {
|
|
@@ -14870,11 +14870,11 @@ function qC(e, t) {
|
|
|
14870
14870
|
const w = typeof s.source == "string" ? s.source : typeof i.source == "string" ? i.source : (g == null ? void 0 : g.source) ?? null;
|
|
14871
14871
|
l = w ? String(w) : null;
|
|
14872
14872
|
const b = a !== null && l ? `${a}:${l}` : null;
|
|
14873
|
-
if (b && ((d = t.checkpointIndexByKey) != null && d.has(b)) ? r = t.checkpointIndexByKey.get(b) ?? [] : y && g && (r = [g]), o = y ?? ((f = r[0]) == null ? void 0 : f.id) ?? null, c = y ? ((
|
|
14873
|
+
if (b && ((d = t.checkpointIndexByKey) != null && d.has(b)) ? r = t.checkpointIndexByKey.get(b) ?? [] : y && g && (r = [g]), o = y ?? ((f = r[0]) == null ? void 0 : f.id) ?? null, c = y ? ((h = t.attemptMetaById) == null ? void 0 : h.get(y)) ?? null : null, !c && (e == null ? void 0 : e.role) === "user" && (e != null && e.id) && t.userMessageIdToAttempts) {
|
|
14874
14874
|
const T = t.userMessageIdToAttempts.get(e.id);
|
|
14875
14875
|
if (T && T.length > 0) {
|
|
14876
14876
|
const S = T[0].checkpointId;
|
|
14877
|
-
c = ((
|
|
14877
|
+
c = ((p = t.attemptMetaById) == null ? void 0 : p.get(S)) ?? null, c && console.log(`[useMessageMetadata] Found attempt by user message ID "${e.id}":`, T.length, "versions");
|
|
14878
14878
|
}
|
|
14879
14879
|
}
|
|
14880
14880
|
if (!c && r.length > 0 && t.attemptMetaById) {
|
|
@@ -14936,8 +14936,8 @@ const Ip = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, kp = Q.memo(
|
|
|
14936
14936
|
onEdit: c,
|
|
14937
14937
|
onRegenerate: d,
|
|
14938
14938
|
onCancelEdit: f,
|
|
14939
|
-
activeInterrupt:
|
|
14940
|
-
disableInterruptActions:
|
|
14939
|
+
activeInterrupt: h,
|
|
14940
|
+
disableInterruptActions: p,
|
|
14941
14941
|
onInterruptActionStart: x,
|
|
14942
14942
|
onInterruptActionEnd: m,
|
|
14943
14943
|
showToolMessages: y,
|
|
@@ -14984,8 +14984,8 @@ const Ip = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, kp = Q.memo(
|
|
|
14984
14984
|
onEdit: c,
|
|
14985
14985
|
onRegenerate: () => d(n),
|
|
14986
14986
|
onCancelEdit: f,
|
|
14987
|
-
activeInterrupt:
|
|
14988
|
-
disableInterruptActions:
|
|
14987
|
+
activeInterrupt: h,
|
|
14988
|
+
disableInterruptActions: p,
|
|
14989
14989
|
onInterruptActionStart: x,
|
|
14990
14990
|
onInterruptActionEnd: m,
|
|
14991
14991
|
showToolMessages: y,
|
|
@@ -15015,8 +15015,8 @@ const Rp = Q.forwardRef(({
|
|
|
15015
15015
|
onRegenerate: c,
|
|
15016
15016
|
onCancelEdit: d,
|
|
15017
15017
|
className: f,
|
|
15018
|
-
style:
|
|
15019
|
-
emptyMessage:
|
|
15018
|
+
style: h,
|
|
15019
|
+
emptyMessage: p,
|
|
15020
15020
|
followNewMessages: x = !0,
|
|
15021
15021
|
isNavigatingCheckpoint: m = !1,
|
|
15022
15022
|
onScrollAway: y,
|
|
@@ -15083,8 +15083,8 @@ const Rp = Q.forwardRef(({
|
|
|
15083
15083
|
}
|
|
15084
15084
|
};
|
|
15085
15085
|
}, [a]), V = De(() => !x || m ? !1 : K ? "auto" : !1, [K, x, m]), Z = De(() => {
|
|
15086
|
-
if (typeof
|
|
15087
|
-
const re =
|
|
15086
|
+
if (typeof p != "string") return null;
|
|
15087
|
+
const re = p.trim();
|
|
15088
15088
|
return re ? {
|
|
15089
15089
|
id: "default-message",
|
|
15090
15090
|
role: "assistant",
|
|
@@ -15092,7 +15092,7 @@ const Rp = Q.forwardRef(({
|
|
|
15092
15092
|
content: re,
|
|
15093
15093
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
15094
15094
|
} : null;
|
|
15095
|
-
}, [
|
|
15095
|
+
}, [p]), ae = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), oe = () => Z ? /* @__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(
|
|
15096
15096
|
Ya,
|
|
15097
15097
|
{
|
|
15098
15098
|
message: Z,
|
|
@@ -15110,7 +15110,7 @@ const Rp = Q.forwardRef(({
|
|
|
15110
15110
|
},
|
|
15111
15111
|
showArtifactPreviews: I
|
|
15112
15112
|
}
|
|
15113
|
-
) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children:
|
|
15113
|
+
) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: p ?? "No messages yet. Start a conversation!" }), Ee = z.length, We = Ee > 0;
|
|
15114
15114
|
return wt(() => {
|
|
15115
15115
|
var re, ye;
|
|
15116
15116
|
if (Ee === 0) {
|
|
@@ -15142,7 +15142,7 @@ const Rp = Q.forwardRef(({
|
|
|
15142
15142
|
}
|
|
15143
15143
|
}),
|
|
15144
15144
|
[z]
|
|
15145
|
-
), /* @__PURE__ */ u.jsx("div", { className: ae, style:
|
|
15145
|
+
), /* @__PURE__ */ u.jsx("div", { className: ae, style: h, children: /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: We ? /* @__PURE__ */ u.jsx(
|
|
15146
15146
|
IS,
|
|
15147
15147
|
{
|
|
15148
15148
|
ref: (re) => {
|
|
@@ -15211,8 +15211,8 @@ function Si({
|
|
|
15211
15211
|
enableMessageEditing: c = !0,
|
|
15212
15212
|
showToolMessages: d = !0,
|
|
15213
15213
|
showArtifactPreviews: f = !0,
|
|
15214
|
-
customStyles:
|
|
15215
|
-
onMessageSent:
|
|
15214
|
+
customStyles: h = {},
|
|
15215
|
+
onMessageSent: p,
|
|
15216
15216
|
onExcelUploadSuccess: x,
|
|
15217
15217
|
onError: m
|
|
15218
15218
|
}) {
|
|
@@ -15314,7 +15314,7 @@ function Si({
|
|
|
15314
15314
|
edit: !!V,
|
|
15315
15315
|
originalMessageId: V ?? void 0
|
|
15316
15316
|
}
|
|
15317
|
-
),
|
|
15317
|
+
), p == null || p(Ce), pt(""), ye(null), Ze([]), Ne(), Z(null), oe(""), We(null);
|
|
15318
15318
|
} catch (ke) {
|
|
15319
15319
|
const Ve = (ke == null ? void 0 : ke.message) || "Failed to send message";
|
|
15320
15320
|
ye(Ve), m == null || m(Ve);
|
|
@@ -15413,7 +15413,7 @@ function Si({
|
|
|
15413
15413
|
await Be(ke ? null : de);
|
|
15414
15414
|
},
|
|
15415
15415
|
[Be]
|
|
15416
|
-
), Et = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${
|
|
15416
|
+
), Et = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${h.container || ""}`, xt = `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 ${h.messagesArea || ""}`, vt = `relative flex-shrink-0 w-full border-t p-4 bg-transparent ${h.inputArea || ""}`;
|
|
15417
15417
|
return /* @__PURE__ */ u.jsxs("div", { className: Et, children: [
|
|
15418
15418
|
!!F && !bt && /* @__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: [
|
|
15419
15419
|
/* @__PURE__ */ u.jsx("span", { children: F }),
|
|
@@ -15563,7 +15563,7 @@ function Si({
|
|
|
15563
15563
|
variant: "outline",
|
|
15564
15564
|
disabled: E || L,
|
|
15565
15565
|
title: "More input actions",
|
|
15566
|
-
className:
|
|
15566
|
+
className: h.moreButton || "",
|
|
15567
15567
|
children: /* @__PURE__ */ u.jsx(um, { size: 16 })
|
|
15568
15568
|
}
|
|
15569
15569
|
) }),
|
|
@@ -15606,7 +15606,7 @@ function Si({
|
|
|
15606
15606
|
onCancelEdit: k,
|
|
15607
15607
|
onStop: B,
|
|
15608
15608
|
allowEmptySend: Me.length > 0,
|
|
15609
|
-
textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${V ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${re ? "border-red-400" : ""} ${
|
|
15609
|
+
textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${V ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${re ? "border-red-400" : ""} ${h.textarea || ""}`
|
|
15610
15610
|
}
|
|
15611
15611
|
) })
|
|
15612
15612
|
] })
|
|
@@ -15642,7 +15642,7 @@ var Xa = "ScrollArea", [Ep, OI] = Nn(Xa), [YC, rn] = Ep(Xa), Ap = v.forwardRef(
|
|
|
15642
15642
|
dir: o,
|
|
15643
15643
|
scrollHideDelay: s = 600,
|
|
15644
15644
|
...i
|
|
15645
|
-
} = e, [a, l] = v.useState(null), [c, d] = v.useState(null), [f,
|
|
15645
|
+
} = e, [a, l] = v.useState(null), [c, d] = v.useState(null), [f, h] = v.useState(null), [p, x] = v.useState(null), [m, y] = v.useState(null), [g, w] = v.useState(0), [b, T] = v.useState(0), [S, C] = v.useState(!1), [I, R] = v.useState(!1), _ = Ue(t, (P) => l(P)), D = Ss(o);
|
|
15646
15646
|
return /* @__PURE__ */ u.jsx(
|
|
15647
15647
|
YC,
|
|
15648
15648
|
{
|
|
@@ -15654,8 +15654,8 @@ var Xa = "ScrollArea", [Ep, OI] = Nn(Xa), [YC, rn] = Ep(Xa), Ap = v.forwardRef(
|
|
|
15654
15654
|
viewport: c,
|
|
15655
15655
|
onViewportChange: d,
|
|
15656
15656
|
content: f,
|
|
15657
|
-
onContentChange:
|
|
15658
|
-
scrollbarX:
|
|
15657
|
+
onContentChange: h,
|
|
15658
|
+
scrollbarX: p,
|
|
15659
15659
|
onScrollbarXChange: x,
|
|
15660
15660
|
scrollbarXEnabled: S,
|
|
15661
15661
|
onScrollbarXEnabledChange: C,
|
|
@@ -15787,11 +15787,11 @@ var XC = v.forwardRef((e, t) => {
|
|
|
15787
15787
|
const c = o.viewport, d = s ? "scrollLeft" : "scrollTop";
|
|
15788
15788
|
if (c) {
|
|
15789
15789
|
let f = c[d];
|
|
15790
|
-
const
|
|
15791
|
-
const
|
|
15792
|
-
f !==
|
|
15790
|
+
const h = () => {
|
|
15791
|
+
const p = c[d];
|
|
15792
|
+
f !== p && (l("SCROLL"), i()), f = p;
|
|
15793
15793
|
};
|
|
15794
|
-
return c.addEventListener("scroll",
|
|
15794
|
+
return c.addEventListener("scroll", h), () => c.removeEventListener("scroll", h);
|
|
15795
15795
|
}
|
|
15796
15796
|
}, [o.viewport, s, l, i]), /* @__PURE__ */ u.jsx(nn, { present: n || a !== "hidden", children: /* @__PURE__ */ u.jsx(
|
|
15797
15797
|
Za,
|
|
@@ -15828,12 +15828,12 @@ var XC = v.forwardRef((e, t) => {
|
|
|
15828
15828
|
sizes: a,
|
|
15829
15829
|
onSizesChange: l,
|
|
15830
15830
|
hasThumb: c > 0 && c < 1,
|
|
15831
|
-
onThumbChange: (
|
|
15831
|
+
onThumbChange: (h) => s.current = h,
|
|
15832
15832
|
onThumbPointerUp: () => i.current = 0,
|
|
15833
|
-
onThumbPointerDown: (
|
|
15833
|
+
onThumbPointerDown: (h) => i.current = h
|
|
15834
15834
|
};
|
|
15835
|
-
function f(
|
|
15836
|
-
return rT(
|
|
15835
|
+
function f(h, p) {
|
|
15836
|
+
return rT(h, i.current, a, p);
|
|
15837
15837
|
}
|
|
15838
15838
|
return n === "horizontal" ? /* @__PURE__ */ u.jsx(
|
|
15839
15839
|
ZC,
|
|
@@ -15842,15 +15842,15 @@ var XC = v.forwardRef((e, t) => {
|
|
|
15842
15842
|
ref: t,
|
|
15843
15843
|
onThumbPositionChange: () => {
|
|
15844
15844
|
if (o.viewport && s.current) {
|
|
15845
|
-
const
|
|
15846
|
-
s.current.style.transform = `translate3d(${
|
|
15845
|
+
const h = o.viewport.scrollLeft, p = Mc(h, a, o.dir);
|
|
15846
|
+
s.current.style.transform = `translate3d(${p}px, 0, 0)`;
|
|
15847
15847
|
}
|
|
15848
15848
|
},
|
|
15849
|
-
onWheelScroll: (
|
|
15850
|
-
o.viewport && (o.viewport.scrollLeft =
|
|
15849
|
+
onWheelScroll: (h) => {
|
|
15850
|
+
o.viewport && (o.viewport.scrollLeft = h);
|
|
15851
15851
|
},
|
|
15852
|
-
onDragScroll: (
|
|
15853
|
-
o.viewport && (o.viewport.scrollLeft = f(
|
|
15852
|
+
onDragScroll: (h) => {
|
|
15853
|
+
o.viewport && (o.viewport.scrollLeft = f(h, o.dir));
|
|
15854
15854
|
}
|
|
15855
15855
|
}
|
|
15856
15856
|
) : n === "vertical" ? /* @__PURE__ */ u.jsx(
|
|
@@ -15860,15 +15860,15 @@ var XC = v.forwardRef((e, t) => {
|
|
|
15860
15860
|
ref: t,
|
|
15861
15861
|
onThumbPositionChange: () => {
|
|
15862
15862
|
if (o.viewport && s.current) {
|
|
15863
|
-
const
|
|
15864
|
-
s.current.style.transform = `translate3d(0, ${
|
|
15863
|
+
const h = o.viewport.scrollTop, p = Mc(h, a);
|
|
15864
|
+
s.current.style.transform = `translate3d(0, ${p}px, 0)`;
|
|
15865
15865
|
}
|
|
15866
15866
|
},
|
|
15867
|
-
onWheelScroll: (
|
|
15868
|
-
o.viewport && (o.viewport.scrollTop =
|
|
15867
|
+
onWheelScroll: (h) => {
|
|
15868
|
+
o.viewport && (o.viewport.scrollTop = h);
|
|
15869
15869
|
},
|
|
15870
|
-
onDragScroll: (
|
|
15871
|
-
o.viewport && (o.viewport.scrollTop = f(
|
|
15870
|
+
onDragScroll: (h) => {
|
|
15871
|
+
o.viewport && (o.viewport.scrollTop = f(h));
|
|
15872
15872
|
}
|
|
15873
15873
|
}
|
|
15874
15874
|
) : null;
|
|
@@ -15894,8 +15894,8 @@ var XC = v.forwardRef((e, t) => {
|
|
|
15894
15894
|
onDragScroll: (d) => e.onDragScroll(d.x),
|
|
15895
15895
|
onWheelScroll: (d, f) => {
|
|
15896
15896
|
if (s.viewport) {
|
|
15897
|
-
const
|
|
15898
|
-
e.onWheelScroll(
|
|
15897
|
+
const h = s.viewport.scrollLeft + d.deltaX;
|
|
15898
|
+
e.onWheelScroll(h), Fp(h, f) && d.preventDefault();
|
|
15899
15899
|
}
|
|
15900
15900
|
},
|
|
15901
15901
|
onResize: () => {
|
|
@@ -15934,8 +15934,8 @@ var XC = v.forwardRef((e, t) => {
|
|
|
15934
15934
|
onDragScroll: (d) => e.onDragScroll(d.y),
|
|
15935
15935
|
onWheelScroll: (d, f) => {
|
|
15936
15936
|
if (s.viewport) {
|
|
15937
|
-
const
|
|
15938
|
-
e.onWheelScroll(
|
|
15937
|
+
const h = s.viewport.scrollTop + d.deltaY;
|
|
15938
|
+
e.onWheelScroll(h), Fp(h, f) && d.preventDefault();
|
|
15939
15939
|
}
|
|
15940
15940
|
},
|
|
15941
15941
|
onResize: () => {
|
|
@@ -15963,8 +15963,8 @@ var XC = v.forwardRef((e, t) => {
|
|
|
15963
15963
|
onDragScroll: c,
|
|
15964
15964
|
onWheelScroll: d,
|
|
15965
15965
|
onResize: f,
|
|
15966
|
-
...
|
|
15967
|
-
} = e,
|
|
15966
|
+
...h
|
|
15967
|
+
} = e, p = rn(Cn, n), [x, m] = v.useState(null), y = Ue(t, (_) => m(_)), g = v.useRef(null), w = v.useRef(""), b = p.viewport, T = r.content - r.viewport, S = At(d), C = At(l), I = Ks(f, 10);
|
|
15968
15968
|
function R(_) {
|
|
15969
15969
|
if (g.current) {
|
|
15970
15970
|
const D = _.clientX - g.current.left, P = _.clientY - g.current.top;
|
|
@@ -15977,7 +15977,7 @@ var XC = v.forwardRef((e, t) => {
|
|
|
15977
15977
|
(x == null ? void 0 : x.contains(P)) && S(D, T);
|
|
15978
15978
|
};
|
|
15979
15979
|
return document.addEventListener("wheel", _, { passive: !1 }), () => document.removeEventListener("wheel", _, { passive: !1 });
|
|
15980
|
-
}, [b, x, T, S]), v.useEffect(C, [r, C]), Ir(x, I), Ir(
|
|
15980
|
+
}, [b, x, T, S]), v.useEffect(C, [r, C]), Ir(x, I), Ir(p.content, I), /* @__PURE__ */ u.jsx(
|
|
15981
15981
|
eT,
|
|
15982
15982
|
{
|
|
15983
15983
|
scope: n,
|
|
@@ -15990,16 +15990,16 @@ var XC = v.forwardRef((e, t) => {
|
|
|
15990
15990
|
children: /* @__PURE__ */ u.jsx(
|
|
15991
15991
|
_e.div,
|
|
15992
15992
|
{
|
|
15993
|
-
...
|
|
15993
|
+
...h,
|
|
15994
15994
|
ref: y,
|
|
15995
|
-
style: { position: "absolute", ...
|
|
15995
|
+
style: { position: "absolute", ...h.style },
|
|
15996
15996
|
onPointerDown: ue(e.onPointerDown, (_) => {
|
|
15997
|
-
_.button === 0 && (_.target.setPointerCapture(_.pointerId), g.current = x.getBoundingClientRect(), w.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none",
|
|
15997
|
+
_.button === 0 && (_.target.setPointerCapture(_.pointerId), g.current = x.getBoundingClientRect(), w.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", p.viewport && (p.viewport.style.scrollBehavior = "auto"), R(_));
|
|
15998
15998
|
}),
|
|
15999
15999
|
onPointerMove: ue(e.onPointerMove, R),
|
|
16000
16000
|
onPointerUp: ue(e.onPointerUp, (_) => {
|
|
16001
16001
|
const D = _.target;
|
|
16002
|
-
D.hasPointerCapture(_.pointerId) && D.releasePointerCapture(_.pointerId), document.body.style.webkitUserSelect = w.current,
|
|
16002
|
+
D.hasPointerCapture(_.pointerId) && D.releasePointerCapture(_.pointerId), document.body.style.webkitUserSelect = w.current, p.viewport && (p.viewport.style.scrollBehavior = ""), g.current = null;
|
|
16003
16003
|
})
|
|
16004
16004
|
}
|
|
16005
16005
|
)
|
|
@@ -16021,13 +16021,13 @@ var XC = v.forwardRef((e, t) => {
|
|
|
16021
16021
|
return v.useEffect(() => {
|
|
16022
16022
|
const f = s.viewport;
|
|
16023
16023
|
if (f) {
|
|
16024
|
-
const
|
|
16024
|
+
const h = () => {
|
|
16025
16025
|
if (d(), !c.current) {
|
|
16026
|
-
const
|
|
16027
|
-
c.current =
|
|
16026
|
+
const p = oT(f, a);
|
|
16027
|
+
c.current = p, a();
|
|
16028
16028
|
}
|
|
16029
16029
|
};
|
|
16030
|
-
return a(), f.addEventListener("scroll",
|
|
16030
|
+
return a(), f.addEventListener("scroll", h), () => f.removeEventListener("scroll", h);
|
|
16031
16031
|
}
|
|
16032
16032
|
}, [s.viewport, d, a]), /* @__PURE__ */ u.jsx(
|
|
16033
16033
|
_e.div,
|
|
@@ -16041,7 +16041,7 @@ var XC = v.forwardRef((e, t) => {
|
|
|
16041
16041
|
...r
|
|
16042
16042
|
},
|
|
16043
16043
|
onPointerDownCapture: ue(e.onPointerDownCapture, (f) => {
|
|
16044
|
-
const
|
|
16044
|
+
const p = f.target.getBoundingClientRect(), x = f.clientX - p.left, m = f.clientY - p.top;
|
|
16045
16045
|
i.onThumbPointerDown({ x, y: m });
|
|
16046
16046
|
}),
|
|
16047
16047
|
onPointerUp: ue(e.onPointerUp, i.onThumbPointerUp)
|
|
@@ -16188,8 +16188,8 @@ function Dc({
|
|
|
16188
16188
|
}) {
|
|
16189
16189
|
const {
|
|
16190
16190
|
threads: f,
|
|
16191
|
-
currentThreadId:
|
|
16192
|
-
setCurrentThreadId:
|
|
16191
|
+
currentThreadId: h,
|
|
16192
|
+
setCurrentThreadId: p,
|
|
16193
16193
|
isLoading: x,
|
|
16194
16194
|
actions: m
|
|
16195
16195
|
} = ca(), { loadThread: y } = ua(), { createThread: g, deleteThread: w, renameThread: b } = m, [T, S] = me(Array.isArray(f) ? f : []), C = Le(T.length > 0), I = Le(null), R = Le(0), [_, D] = me(null), [P, M] = me(""), [$, E] = me(!1);
|
|
@@ -16217,7 +16217,7 @@ function Dc({
|
|
|
16217
16217
|
}, [T]);
|
|
16218
16218
|
const F = async (G) => {
|
|
16219
16219
|
try {
|
|
16220
|
-
|
|
16220
|
+
p(G), await y(G), a == null || a(G), l == null || l(G);
|
|
16221
16221
|
} catch (z) {
|
|
16222
16222
|
console.error("Failed to select thread:", z);
|
|
16223
16223
|
}
|
|
@@ -16297,7 +16297,7 @@ function Dc({
|
|
|
16297
16297
|
"div",
|
|
16298
16298
|
{
|
|
16299
16299
|
onClick: () => F(G.threadId),
|
|
16300
|
-
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ??
|
|
16300
|
+
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? h) === 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`,
|
|
16301
16301
|
children: [
|
|
16302
16302
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
16303
16303
|
/* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: _ === G.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (z) => z.stopPropagation(), children: [
|
|
@@ -16340,64 +16340,74 @@ const DI = ({
|
|
|
16340
16340
|
activeCheckpointId: t,
|
|
16341
16341
|
onSelectCheckpoint: n,
|
|
16342
16342
|
messagePreviews: r,
|
|
16343
|
-
className: o
|
|
16343
|
+
className: o,
|
|
16344
|
+
onHoverStart: s,
|
|
16345
|
+
onHoverEnd: i
|
|
16344
16346
|
}) => {
|
|
16345
|
-
const
|
|
16346
|
-
if (!
|
|
16347
|
+
const a = e ?? [], l = a.length > 0, c = De(() => l ? [...a].reverse() : [], [a, l]), d = t ?? (a.length ? a[a.length - 1].id : null);
|
|
16348
|
+
if (!l)
|
|
16347
16349
|
return null;
|
|
16348
|
-
const
|
|
16349
|
-
return /* @__PURE__ */ u.jsxs(
|
|
16350
|
-
|
|
16351
|
-
|
|
16352
|
-
|
|
16353
|
-
|
|
16354
|
-
|
|
16355
|
-
|
|
16350
|
+
const h = ["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(" ");
|
|
16351
|
+
return /* @__PURE__ */ u.jsxs(
|
|
16352
|
+
"div",
|
|
16353
|
+
{
|
|
16354
|
+
className: h,
|
|
16355
|
+
onMouseEnter: s,
|
|
16356
|
+
onMouseLeave: i,
|
|
16357
|
+
children: [
|
|
16358
|
+
/* @__PURE__ */ u.jsxs("div", { className: "relative flex-1 overflow-y-auto pt-4 pb-2 pr-1", children: [
|
|
16359
|
+
/* @__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" }) }),
|
|
16360
|
+
/* @__PURE__ */ u.jsx("div", { className: "pointer-events-none absolute left-3 top-0 bottom-0 w-px bg-border/40" }),
|
|
16361
|
+
/* @__PURE__ */ u.jsx("div", { className: "flex flex-col gap-3 pt-6 pr-2", children: c.map((p) => {
|
|
16362
|
+
const x = d === p.id, m = p.messageId ? (r == null ? void 0 : r.get(p.messageId)) ?? null : null;
|
|
16363
|
+
return /* @__PURE__ */ u.jsxs(
|
|
16364
|
+
"button",
|
|
16365
|
+
{
|
|
16366
|
+
type: "button",
|
|
16367
|
+
disabled: !n,
|
|
16368
|
+
onClick: () => n == null ? void 0 : n(p.id),
|
|
16369
|
+
className: `relative flex items-start gap-2 text-left text-[11px] transition ${x ? "text-primary" : "text-muted-foreground"} ${n ? "hover:text-foreground" : "cursor-default opacity-70"}`,
|
|
16370
|
+
children: [
|
|
16371
|
+
/* @__PURE__ */ u.jsx(
|
|
16372
|
+
"span",
|
|
16373
|
+
{
|
|
16374
|
+
className: `mt-1 inline-flex h-3 w-3 items-center justify-center rounded-full border ${x ? "border-primary bg-primary/10 text-primary" : "border-border bg-background"}`,
|
|
16375
|
+
children: /* @__PURE__ */ u.jsx("span", { className: `h-1.5 w-1.5 rounded-full ${x ? "bg-primary" : "bg-border"}` })
|
|
16376
|
+
}
|
|
16377
|
+
),
|
|
16378
|
+
/* @__PURE__ */ u.jsxs("span", { className: "flex-1", children: [
|
|
16379
|
+
/* @__PURE__ */ u.jsx("span", { className: "block font-medium leading-tight", children: p.label || "User input" }),
|
|
16380
|
+
/* @__PURE__ */ u.jsxs("span", { className: "text-[9px] uppercase tracking-wide text-muted-foreground/70", children: [
|
|
16381
|
+
p.step !== null ? `STEP ${p.step}` : "STEP —",
|
|
16382
|
+
p.next ? ` - ${p.next}` : ""
|
|
16383
|
+
] }),
|
|
16384
|
+
m && /* @__PURE__ */ u.jsx(
|
|
16385
|
+
"p",
|
|
16386
|
+
{
|
|
16387
|
+
className: "text-[10px] text-muted-foreground/80 mt-1 line-clamp-2",
|
|
16388
|
+
title: m,
|
|
16389
|
+
children: m
|
|
16390
|
+
}
|
|
16391
|
+
)
|
|
16392
|
+
] })
|
|
16393
|
+
]
|
|
16394
|
+
},
|
|
16395
|
+
p.id
|
|
16396
|
+
);
|
|
16397
|
+
}) })
|
|
16398
|
+
] }),
|
|
16399
|
+
n && /* @__PURE__ */ u.jsx(
|
|
16356
16400
|
"button",
|
|
16357
16401
|
{
|
|
16358
16402
|
type: "button",
|
|
16359
|
-
|
|
16360
|
-
|
|
16361
|
-
|
|
16362
|
-
|
|
16363
|
-
|
|
16364
|
-
|
|
16365
|
-
|
|
16366
|
-
|
|
16367
|
-
children: /* @__PURE__ */ u.jsx("span", { className: `h-1.5 w-1.5 rounded-full ${p ? "bg-primary" : "bg-border"}` })
|
|
16368
|
-
}
|
|
16369
|
-
),
|
|
16370
|
-
/* @__PURE__ */ u.jsxs("span", { className: "flex-1", children: [
|
|
16371
|
-
/* @__PURE__ */ u.jsx("span", { className: "block font-medium leading-tight", children: f.label || "User input" }),
|
|
16372
|
-
/* @__PURE__ */ u.jsxs("span", { className: "text-[9px] uppercase tracking-wide text-muted-foreground/70", children: [
|
|
16373
|
-
f.step !== null ? `STEP ${f.step}` : "STEP —",
|
|
16374
|
-
f.next ? ` - ${f.next}` : ""
|
|
16375
|
-
] }),
|
|
16376
|
-
h && /* @__PURE__ */ u.jsx(
|
|
16377
|
-
"p",
|
|
16378
|
-
{
|
|
16379
|
-
className: "text-[10px] text-muted-foreground/80 mt-1 line-clamp-2",
|
|
16380
|
-
title: h,
|
|
16381
|
-
children: h
|
|
16382
|
-
}
|
|
16383
|
-
)
|
|
16384
|
-
] })
|
|
16385
|
-
]
|
|
16386
|
-
},
|
|
16387
|
-
f.id
|
|
16388
|
-
);
|
|
16389
|
-
}) })
|
|
16390
|
-
] }),
|
|
16391
|
-
n && /* @__PURE__ */ u.jsx(
|
|
16392
|
-
"button",
|
|
16393
|
-
{
|
|
16394
|
-
type: "button",
|
|
16395
|
-
onClick: () => n == null ? void 0 : n(null),
|
|
16396
|
-
className: "mt-auto mb-3 rounded-md border border-border/70 px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground transition hover:border-foreground/60 hover:text-foreground",
|
|
16397
|
-
children: "Latest"
|
|
16398
|
-
}
|
|
16399
|
-
)
|
|
16400
|
-
] });
|
|
16403
|
+
onClick: () => n == null ? void 0 : n(null),
|
|
16404
|
+
className: "mt-auto mb-3 rounded-md border border-border/70 px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground transition hover:border-foreground/60 hover:text-foreground",
|
|
16405
|
+
children: "Latest"
|
|
16406
|
+
}
|
|
16407
|
+
)
|
|
16408
|
+
]
|
|
16409
|
+
}
|
|
16410
|
+
);
|
|
16401
16411
|
};
|
|
16402
16412
|
function wr(e) {
|
|
16403
16413
|
if (!(typeof globalThis > "u"))
|
|
@@ -16568,8 +16578,8 @@ var gT = [" ", "Enter", "ArrowUp", "ArrowDown"], xT = [" ", "Enter"], rr = "Sele
|
|
|
16568
16578
|
dir: c,
|
|
16569
16579
|
name: d,
|
|
16570
16580
|
autoComplete: f,
|
|
16571
|
-
disabled:
|
|
16572
|
-
required:
|
|
16581
|
+
disabled: h,
|
|
16582
|
+
required: p,
|
|
16573
16583
|
form: x
|
|
16574
16584
|
} = e, m = Ys(t), [y, g] = v.useState(null), [w, b] = v.useState(null), [T, S] = v.useState(!1), C = Ss(c), [I, R] = Cr({
|
|
16575
16585
|
prop: r,
|
|
@@ -16585,7 +16595,7 @@ var gT = [" ", "Enter", "ArrowUp", "ArrowDown"], xT = [" ", "Enter"], rr = "Sele
|
|
|
16585
16595
|
return /* @__PURE__ */ u.jsx(Xu, { ...m, children: /* @__PURE__ */ u.jsxs(
|
|
16586
16596
|
vT,
|
|
16587
16597
|
{
|
|
16588
|
-
required:
|
|
16598
|
+
required: p,
|
|
16589
16599
|
scope: t,
|
|
16590
16600
|
trigger: y,
|
|
16591
16601
|
onTriggerChange: g,
|
|
@@ -16600,7 +16610,7 @@ var gT = [" ", "Enter", "ArrowUp", "ArrowDown"], xT = [" ", "Enter"], rr = "Sele
|
|
|
16600
16610
|
onOpenChange: R,
|
|
16601
16611
|
dir: C,
|
|
16602
16612
|
triggerPointerDownPosRef: P,
|
|
16603
|
-
disabled:
|
|
16613
|
+
disabled: h,
|
|
16604
16614
|
children: [
|
|
16605
16615
|
/* @__PURE__ */ u.jsx(qs.Provider, { scope: t, children: /* @__PURE__ */ u.jsx(
|
|
16606
16616
|
wT,
|
|
@@ -16622,13 +16632,13 @@ var gT = [" ", "Enter", "ArrowUp", "ArrowDown"], xT = [" ", "Enter"], rr = "Sele
|
|
|
16622
16632
|
bh,
|
|
16623
16633
|
{
|
|
16624
16634
|
"aria-hidden": !0,
|
|
16625
|
-
required:
|
|
16635
|
+
required: p,
|
|
16626
16636
|
tabIndex: -1,
|
|
16627
16637
|
name: d,
|
|
16628
16638
|
autoComplete: f,
|
|
16629
16639
|
value: _,
|
|
16630
16640
|
onChange: (N) => D(N.target.value),
|
|
16631
|
-
disabled:
|
|
16641
|
+
disabled: h,
|
|
16632
16642
|
form: x,
|
|
16633
16643
|
children: [
|
|
16634
16644
|
_ === void 0 ? /* @__PURE__ */ u.jsx("option", { value: "" }) : null,
|
|
@@ -16644,11 +16654,11 @@ var gT = [" ", "Enter", "ArrowUp", "ArrowDown"], xT = [" ", "Enter"], rr = "Sele
|
|
|
16644
16654
|
Jp.displayName = rr;
|
|
16645
16655
|
var Zp = "SelectTrigger", Qp = v.forwardRef(
|
|
16646
16656
|
(e, t) => {
|
|
16647
|
-
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Ys(n), i = Un(Zp, n), a = i.disabled || r, l = Ue(t, i.onTriggerChange), c = Gs(n), d = v.useRef("touch"), [f,
|
|
16657
|
+
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Ys(n), i = Un(Zp, n), a = i.disabled || r, l = Ue(t, i.onTriggerChange), c = Gs(n), d = v.useRef("touch"), [f, h, p] = Ch((m) => {
|
|
16648
16658
|
const y = c().filter((b) => !b.disabled), g = y.find((b) => b.value === i.value), w = Th(y, m, g);
|
|
16649
16659
|
w !== void 0 && i.onValueChange(w.value);
|
|
16650
16660
|
}), x = (m) => {
|
|
16651
|
-
a || (i.onOpenChange(!0),
|
|
16661
|
+
a || (i.onOpenChange(!0), p()), m && (i.triggerPointerDownPosRef.current = {
|
|
16652
16662
|
x: Math.round(m.pageX),
|
|
16653
16663
|
y: Math.round(m.pageY)
|
|
16654
16664
|
});
|
|
@@ -16679,7 +16689,7 @@ var Zp = "SelectTrigger", Qp = v.forwardRef(
|
|
|
16679
16689
|
}),
|
|
16680
16690
|
onKeyDown: ue(o.onKeyDown, (m) => {
|
|
16681
16691
|
const y = f.current !== "";
|
|
16682
|
-
!(m.ctrlKey || m.altKey || m.metaKey) && m.key.length === 1 &&
|
|
16692
|
+
!(m.ctrlKey || m.altKey || m.metaKey) && m.key.length === 1 && h(m.key), !(y && m.key === " ") && gT.includes(m.key) && (x(), m.preventDefault());
|
|
16683
16693
|
})
|
|
16684
16694
|
}
|
|
16685
16695
|
) });
|
|
@@ -16743,8 +16753,8 @@ var on = 10, [sh, Wn] = jr(or), TT = "SelectContentImpl", IT = br("SelectContent
|
|
|
16743
16753
|
align: c,
|
|
16744
16754
|
alignOffset: d,
|
|
16745
16755
|
arrowPadding: f,
|
|
16746
|
-
collisionBoundary:
|
|
16747
|
-
collisionPadding:
|
|
16756
|
+
collisionBoundary: h,
|
|
16757
|
+
collisionPadding: p,
|
|
16748
16758
|
sticky: x,
|
|
16749
16759
|
hideWhenDetached: m,
|
|
16750
16760
|
avoidCollisions: y,
|
|
@@ -16814,8 +16824,8 @@ var on = 10, [sh, Wn] = jr(or), TT = "SelectContentImpl", IT = br("SelectContent
|
|
|
16814
16824
|
align: c,
|
|
16815
16825
|
alignOffset: d,
|
|
16816
16826
|
arrowPadding: f,
|
|
16817
|
-
collisionBoundary:
|
|
16818
|
-
collisionPadding:
|
|
16827
|
+
collisionBoundary: h,
|
|
16828
|
+
collisionPadding: p,
|
|
16819
16829
|
sticky: x,
|
|
16820
16830
|
hideWhenDetached: m,
|
|
16821
16831
|
avoidCollisions: y
|
|
@@ -16900,7 +16910,7 @@ var on = 10, [sh, Wn] = jr(or), TT = "SelectContentImpl", IT = br("SelectContent
|
|
|
16900
16910
|
);
|
|
16901
16911
|
ih.displayName = TT;
|
|
16902
16912
|
var kT = "SelectItemAlignedPosition", ah = v.forwardRef((e, t) => {
|
|
16903
|
-
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Un(or, n), i = Wn(or, n), [a, l] = v.useState(null), [c, d] = v.useState(null), f = Ue(t, (I) => d(I)),
|
|
16913
|
+
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Un(or, n), i = Wn(or, n), [a, l] = v.useState(null), [c, d] = v.useState(null), f = Ue(t, (I) => d(I)), h = Gs(n), p = v.useRef(!1), x = v.useRef(!0), { viewport: m, selectedItem: y, selectedItemText: g, focusSelectedItem: w } = i, b = v.useCallback(() => {
|
|
16904
16914
|
if (s.trigger && s.valueNode && a && c && m && y && g) {
|
|
16905
16915
|
const I = s.trigger.getBoundingClientRect(), R = c.getBoundingClientRect(), _ = s.valueNode.getBoundingClientRect(), D = g.getBoundingClientRect();
|
|
16906
16916
|
if (s.dir !== "rtl") {
|
|
@@ -16921,7 +16931,7 @@ var kT = "SelectItemAlignedPosition", ah = v.forwardRef((e, t) => {
|
|
|
16921
16931
|
]);
|
|
16922
16932
|
a.style.minWidth = We + "px", a.style.right = Me + "px";
|
|
16923
16933
|
}
|
|
16924
|
-
const P =
|
|
16934
|
+
const P = h(), M = window.innerHeight - on * 2, $ = m.scrollHeight, E = window.getComputedStyle(c), F = parseInt(E.borderTopWidth, 10), N = parseInt(E.paddingTop, 10), W = parseInt(E.borderBottomWidth, 10), B = parseInt(E.paddingBottom, 10), j = F + N + $ + B + W, K = Math.min(y.offsetHeight * 5, j), X = window.getComputedStyle(m), se = parseInt(X.paddingTop, 10), xe = parseInt(X.paddingBottom, 10), Re = I.top + I.height / 2 - on, G = M - Re, z = y.offsetHeight / 2, J = y.offsetTop + z, L = F + N + J, V = j - L;
|
|
16925
16935
|
if (L <= Re) {
|
|
16926
16936
|
const ae = P.length > 0 && y === P[P.length - 1].ref.current;
|
|
16927
16937
|
a.style.bottom = "0px";
|
|
@@ -16941,10 +16951,10 @@ var kT = "SelectItemAlignedPosition", ah = v.forwardRef((e, t) => {
|
|
|
16941
16951
|
) + V;
|
|
16942
16952
|
a.style.height = Ee + "px", m.scrollTop = L - Re + m.offsetTop;
|
|
16943
16953
|
}
|
|
16944
|
-
a.style.margin = `${on}px 0`, a.style.minHeight = K + "px", a.style.maxHeight = M + "px", r == null || r(), requestAnimationFrame(() =>
|
|
16954
|
+
a.style.margin = `${on}px 0`, a.style.minHeight = K + "px", a.style.maxHeight = M + "px", r == null || r(), requestAnimationFrame(() => p.current = !0);
|
|
16945
16955
|
}
|
|
16946
16956
|
}, [
|
|
16947
|
-
|
|
16957
|
+
h,
|
|
16948
16958
|
s.trigger,
|
|
16949
16959
|
s.valueNode,
|
|
16950
16960
|
a,
|
|
@@ -16971,7 +16981,7 @@ var kT = "SelectItemAlignedPosition", ah = v.forwardRef((e, t) => {
|
|
|
16971
16981
|
{
|
|
16972
16982
|
scope: n,
|
|
16973
16983
|
contentWrapper: a,
|
|
16974
|
-
shouldExpandOnScrollRef:
|
|
16984
|
+
shouldExpandOnScrollRef: p,
|
|
16975
16985
|
onScrollButtonChange: C,
|
|
16976
16986
|
children: /* @__PURE__ */ u.jsx(
|
|
16977
16987
|
"div",
|
|
@@ -17067,13 +17077,13 @@ var [ET, el] = jr(or, {}), Yi = "SelectViewport", lh = v.forwardRef(
|
|
|
17067
17077
|
...o.style
|
|
17068
17078
|
},
|
|
17069
17079
|
onScroll: ue(o.onScroll, (c) => {
|
|
17070
|
-
const d = c.currentTarget, { contentWrapper: f, shouldExpandOnScrollRef:
|
|
17071
|
-
if (
|
|
17072
|
-
const
|
|
17073
|
-
if (
|
|
17080
|
+
const d = c.currentTarget, { contentWrapper: f, shouldExpandOnScrollRef: h } = i;
|
|
17081
|
+
if (h != null && h.current && f) {
|
|
17082
|
+
const p = Math.abs(l.current - d.scrollTop);
|
|
17083
|
+
if (p > 0) {
|
|
17074
17084
|
const x = window.innerHeight - on * 2, m = parseFloat(f.style.minHeight), y = parseFloat(f.style.height), g = Math.max(m, y);
|
|
17075
17085
|
if (g < x) {
|
|
17076
|
-
const w = g +
|
|
17086
|
+
const w = g + p, b = Math.min(x, w), T = w - b;
|
|
17077
17087
|
f.style.height = b + "px", f.style.bottom === "0px" && (d.scrollTop = T > 0 ? T : 0, f.style.justifyContent = "flex-end");
|
|
17078
17088
|
}
|
|
17079
17089
|
}
|
|
@@ -17108,7 +17118,7 @@ var fs = "SelectItem", [jT, fh] = jr(fs), ph = v.forwardRef(
|
|
|
17108
17118
|
disabled: o = !1,
|
|
17109
17119
|
textValue: s,
|
|
17110
17120
|
...i
|
|
17111
|
-
} = e, a = Un(fs, n), l = Wn(fs, n), c = a.value === r, [d, f] = v.useState(s ?? ""), [
|
|
17121
|
+
} = e, a = Un(fs, n), l = Wn(fs, n), c = a.value === r, [d, f] = v.useState(s ?? ""), [h, p] = v.useState(!1), x = Ue(
|
|
17112
17122
|
t,
|
|
17113
17123
|
(w) => {
|
|
17114
17124
|
var b;
|
|
@@ -17144,16 +17154,16 @@ var fs = "SelectItem", [jT, fh] = jr(fs), ph = v.forwardRef(
|
|
|
17144
17154
|
{
|
|
17145
17155
|
role: "option",
|
|
17146
17156
|
"aria-labelledby": m,
|
|
17147
|
-
"data-highlighted":
|
|
17148
|
-
"aria-selected": c &&
|
|
17157
|
+
"data-highlighted": h ? "" : void 0,
|
|
17158
|
+
"aria-selected": c && h,
|
|
17149
17159
|
"data-state": c ? "checked" : "unchecked",
|
|
17150
17160
|
"aria-disabled": o || void 0,
|
|
17151
17161
|
"data-disabled": o ? "" : void 0,
|
|
17152
17162
|
tabIndex: o ? void 0 : -1,
|
|
17153
17163
|
...i,
|
|
17154
17164
|
ref: x,
|
|
17155
|
-
onFocus: ue(i.onFocus, () =>
|
|
17156
|
-
onBlur: ue(i.onBlur, () =>
|
|
17165
|
+
onFocus: ue(i.onFocus, () => p(!0)),
|
|
17166
|
+
onBlur: ue(i.onBlur, () => p(!1)),
|
|
17157
17167
|
onClick: ue(i.onClick, () => {
|
|
17158
17168
|
y.current !== "mouse" && g();
|
|
17159
17169
|
}),
|
|
@@ -17186,7 +17196,7 @@ var fs = "SelectItem", [jT, fh] = jr(fs), ph = v.forwardRef(
|
|
|
17186
17196
|
ph.displayName = fs;
|
|
17187
17197
|
var Fr = "SelectItemText", hh = v.forwardRef(
|
|
17188
17198
|
(e, t) => {
|
|
17189
|
-
const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Un(Fr, n), a = Wn(Fr, n), l = fh(Fr, n), c = bT(Fr, n), [d, f] = v.useState(null),
|
|
17199
|
+
const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Un(Fr, n), a = Wn(Fr, n), l = fh(Fr, n), c = bT(Fr, n), [d, f] = v.useState(null), h = Ue(
|
|
17190
17200
|
t,
|
|
17191
17201
|
(g) => f(g),
|
|
17192
17202
|
l.onItemTextChange,
|
|
@@ -17194,12 +17204,12 @@ var Fr = "SelectItemText", hh = v.forwardRef(
|
|
|
17194
17204
|
var w;
|
|
17195
17205
|
return (w = a.itemTextRefCallback) == null ? void 0 : w.call(a, g, l.value, l.disabled);
|
|
17196
17206
|
}
|
|
17197
|
-
),
|
|
17198
|
-
() => /* @__PURE__ */ u.jsx("option", { value: l.value, disabled: l.disabled, children:
|
|
17199
|
-
[l.disabled, l.value,
|
|
17207
|
+
), p = d == null ? void 0 : d.textContent, x = v.useMemo(
|
|
17208
|
+
() => /* @__PURE__ */ u.jsx("option", { value: l.value, disabled: l.disabled, children: p }, l.value),
|
|
17209
|
+
[l.disabled, l.value, p]
|
|
17200
17210
|
), { onNativeOptionAdd: m, onNativeOptionRemove: y } = c;
|
|
17201
17211
|
return Nt(() => (m(x), () => y(x)), [m, y, x]), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
17202
|
-
/* @__PURE__ */ u.jsx(_e.span, { id: l.textId, ...s, ref:
|
|
17212
|
+
/* @__PURE__ */ u.jsx(_e.span, { id: l.textId, ...s, ref: h }),
|
|
17203
17213
|
l.isSelected && i.valueNode && !i.valueNodeHasChildren ? gs.createPortal(s.children, i.valueNode) : null
|
|
17204
17214
|
] });
|
|
17205
17215
|
}
|
|
@@ -17586,7 +17596,7 @@ var Xs = "Switch", [QT, BI] = Nn(Xs), [eI, tI] = QT(Xs), Hh = v.forwardRef(
|
|
|
17586
17596
|
onCheckedChange: c,
|
|
17587
17597
|
form: d,
|
|
17588
17598
|
...f
|
|
17589
|
-
} = e, [
|
|
17599
|
+
} = e, [h, p] = v.useState(null), x = Ue(t, (b) => p(b)), m = v.useRef(!1), y = h ? d || !!h.closest("form") : !0, [g, w] = Cr({
|
|
17590
17600
|
prop: o,
|
|
17591
17601
|
defaultProp: s ?? !1,
|
|
17592
17602
|
onChange: c,
|
|
@@ -17614,7 +17624,7 @@ var Xs = "Switch", [QT, BI] = Nn(Xs), [eI, tI] = QT(Xs), Hh = v.forwardRef(
|
|
|
17614
17624
|
y && /* @__PURE__ */ u.jsx(
|
|
17615
17625
|
Vh,
|
|
17616
17626
|
{
|
|
17617
|
-
control:
|
|
17627
|
+
control: h,
|
|
17618
17628
|
bubbles: !m.current,
|
|
17619
17629
|
name: r,
|
|
17620
17630
|
value: l,
|
|
@@ -17656,13 +17666,13 @@ var nI = "SwitchBubbleInput", Vh = v.forwardRef(
|
|
|
17656
17666
|
return v.useEffect(() => {
|
|
17657
17667
|
const d = i.current;
|
|
17658
17668
|
if (!d) return;
|
|
17659
|
-
const f = window.HTMLInputElement.prototype,
|
|
17669
|
+
const f = window.HTMLInputElement.prototype, p = Object.getOwnPropertyDescriptor(
|
|
17660
17670
|
f,
|
|
17661
17671
|
"checked"
|
|
17662
17672
|
).set;
|
|
17663
|
-
if (l !== n &&
|
|
17673
|
+
if (l !== n && p) {
|
|
17664
17674
|
const x = new Event("click", { bubbles: r });
|
|
17665
|
-
|
|
17675
|
+
p.call(d, n), d.dispatchEvent(x);
|
|
17666
17676
|
}
|
|
17667
17677
|
}, [l, n, r]), /* @__PURE__ */ u.jsx(
|
|
17668
17678
|
"input",
|
|
@@ -17737,12 +17747,12 @@ function zI({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
17737
17747
|
}, [a, e]), wt(() => {
|
|
17738
17748
|
l(e);
|
|
17739
17749
|
}, [e]);
|
|
17740
|
-
const
|
|
17750
|
+
const h = () => {
|
|
17741
17751
|
t(a), d(!1), f({
|
|
17742
17752
|
title: "Settings saved",
|
|
17743
17753
|
description: "Your chat configuration has been updated successfully."
|
|
17744
17754
|
});
|
|
17745
|
-
},
|
|
17755
|
+
}, p = () => {
|
|
17746
17756
|
l(oI), d(!0), f({
|
|
17747
17757
|
title: "Settings reset",
|
|
17748
17758
|
description: "Configuration has been reset to defaults."
|
|
@@ -17999,13 +18009,13 @@ function zI({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
17999
18009
|
] })
|
|
18000
18010
|
] }),
|
|
18001
18011
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between pt-6 border-t", children: [
|
|
18002
|
-
/* @__PURE__ */ u.jsxs(tt, { variant: "outline", onClick:
|
|
18012
|
+
/* @__PURE__ */ u.jsxs(tt, { variant: "outline", onClick: p, children: [
|
|
18003
18013
|
/* @__PURE__ */ u.jsx(Ti, { className: "h-4 w-4 mr-2" }),
|
|
18004
18014
|
"Reset"
|
|
18005
18015
|
] }),
|
|
18006
18016
|
/* @__PURE__ */ u.jsxs("div", { className: "flex gap-2", children: [
|
|
18007
18017
|
/* @__PURE__ */ u.jsx(tt, { variant: "outline", onClick: x, children: "Cancel" }),
|
|
18008
|
-
/* @__PURE__ */ u.jsxs(tt, { onClick:
|
|
18018
|
+
/* @__PURE__ */ u.jsxs(tt, { onClick: h, disabled: !c, children: [
|
|
18009
18019
|
/* @__PURE__ */ u.jsx(Sm, { className: "h-4 w-4 mr-2" }),
|
|
18010
18020
|
"Save Changes"
|
|
18011
18021
|
] })
|