@epam/ai-dial-conversation-panel 1.3.0-dev.98 → 1.3.0-rc.1
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/components/ConversationGroupHeader/ConversationGroupHeader.d.ts +3 -0
- package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts.map +1 -1
- package/components/ConversationList/ConversationList.d.ts +5 -0
- package/components/ConversationList/ConversationList.d.ts.map +1 -0
- package/components/ConversationListHeader/ConversationListHeader.d.ts +5 -0
- package/components/ConversationListHeader/ConversationListHeader.d.ts.map +1 -0
- package/components/ConversationListSection/ConversationListSection.d.ts +5 -0
- package/components/ConversationListSection/ConversationListSection.d.ts.map +1 -0
- package/components/ConversationPanel/ConversationPanel.d.ts.map +1 -1
- package/components/ConversationRow/ConversationRow.d.ts +8 -0
- package/components/ConversationRow/ConversationRow.d.ts.map +1 -1
- package/components/ProjectRow/ProjectRow.d.ts +36 -0
- package/components/ProjectRow/ProjectRow.d.ts.map +1 -0
- package/components/ProjectRow/ProjectSeeAllRow.d.ts +26 -0
- package/components/ProjectRow/ProjectSeeAllRow.d.ts.map +1 -0
- package/components/RenameConversationPopup/RenameConversationPopup.d.ts.map +1 -1
- package/components/RowActionsMenu/RowActionsMenu.d.ts +20 -0
- package/components/RowActionsMenu/RowActionsMenu.d.ts.map +1 -0
- package/components/RowLink/RowLink.d.ts +12 -0
- package/components/RowLink/RowLink.d.ts.map +1 -0
- package/components/RowRenderer/RowRenderer.d.ts +2 -2
- package/components/RowRenderer/RowRenderer.d.ts.map +1 -1
- package/constants/public-class-names.d.ts +6 -0
- package/constants/public-class-names.d.ts.map +1 -1
- package/constants/virtual-list.d.ts +6 -0
- package/constants/virtual-list.d.ts.map +1 -1
- package/hooks/useRowActions.d.ts +17 -0
- package/hooks/useRowActions.d.ts.map +1 -0
- package/index.css +2 -2
- package/index.d.ts +9 -0
- package/index.d.ts.map +1 -1
- package/index.js +1888 -709
- package/models/conversation-list-header.d.ts +82 -0
- package/models/conversation-list-header.d.ts.map +1 -0
- package/models/conversation-list-section.d.ts +66 -0
- package/models/conversation-list-section.d.ts.map +1 -0
- package/models/conversation-list.d.ts +152 -0
- package/models/conversation-list.d.ts.map +1 -0
- package/models/panel-props.d.ts +31 -53
- package/models/panel-props.d.ts.map +1 -1
- package/models/pinned-projects.d.ts +65 -0
- package/models/pinned-projects.d.ts.map +1 -0
- package/models/rename-conversation-popup.d.ts +2 -0
- package/models/rename-conversation-popup.d.ts.map +1 -1
- package/models/virtual-row.d.ts +58 -1
- package/models/virtual-row.d.ts.map +1 -1
- package/package.json +6 -6
- package/types/conversation-kind.d.ts +7 -0
- package/types/conversation-kind.d.ts.map +1 -0
- package/types/conversation-row-variant.d.ts +8 -0
- package/types/conversation-row-variant.d.ts.map +1 -0
- package/types/virtual-row.d.ts +8 -2
- package/types/virtual-row.d.ts.map +1 -1
- package/utils/conversation-filter.d.ts +29 -0
- package/utils/conversation-filter.d.ts.map +1 -0
- package/utils/conversation-row.d.ts +19 -4
- package/utils/conversation-row.d.ts.map +1 -1
- package/components/ConversationPanel/utils.d.ts +0 -7
- package/components/ConversationPanel/utils.d.ts.map +0 -1
package/index.js
CHANGED
|
@@ -1,33 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PanelEmpty as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { createElement as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { IconCaretDownFilled as
|
|
1
|
+
import { ConversationKind as e, DeploymentIcon as t, FilterTab as n, buildCssVars as r, getUtf8ByteLength as i, mergeClasses as a, sanitizeConversationName as o, stripTrailingDots as s } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { PanelEmpty as c, PanelNoResults as l, SidebarOrientation as u, SidebarPanel as d } from "@epam/ai-dial-sidebar";
|
|
3
|
+
import { Button as f, ButtonVariant as p, DIAL_ICON_SIZE as m, DIAL_KIT_ICON_STROKE as h, Dropdown as g, ElementSize as _, EllipsisTooltip as v, FilterChips as y, GhostIconButton as b, Highlight as x, Input as S, LiveRegion as C, LiveRegionElement as w, LiveRegionPoliteness as T, MenuItemMark as E, Popup as D, PopupSize as O, Search as k, Skeleton as A, SkeletonVariant as j, Spinner as M, mergeClasses as N } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { Fragment as P, createElement as F, memo as I, useCallback as L, useEffect as R, useId as ee, useImperativeHandle as te, useLayoutEffect as z, useMemo as B, useRef as V, useState as H, useSyncExternalStore as U } from "react";
|
|
5
|
+
import { Fragment as ne, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
6
|
+
import { IconBriefcase as re, IconCaretDownFilled as K, IconCaretRightFilled as ie, IconChevronDown as ae, IconChevronRight as oe, IconDotsVertical as se, IconFilter2 as ce, IconPlus as le, IconSearch as ue, IconSparkles as de, IconX as fe } from "@tabler/icons-react";
|
|
7
7
|
//#region src/constants/public-class-names.ts
|
|
8
|
-
var
|
|
8
|
+
var pe = {
|
|
9
9
|
newChatButton: "dial-cp-new-chat-button",
|
|
10
|
-
search: "dial-cp-search"
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
search: "dial-cp-search",
|
|
11
|
+
list: "dial-cp-list",
|
|
12
|
+
listHeader: "dial-cp-list-header",
|
|
13
|
+
listSection: "dial-cp-list-section"
|
|
14
|
+
}, q = typeof window < "u" ? z : R;
|
|
15
|
+
function me(e) {
|
|
16
|
+
let t = e;
|
|
17
|
+
for (; t;) {
|
|
18
|
+
if (t.dir) return t.dir === "rtl";
|
|
19
|
+
t = t.parentElement;
|
|
20
|
+
}
|
|
21
|
+
return !1;
|
|
22
|
+
}
|
|
23
|
+
function he() {
|
|
24
|
+
return () => {};
|
|
25
|
+
}
|
|
26
|
+
function ge() {
|
|
27
|
+
return U(he, () => !1, () => !0);
|
|
28
|
+
}
|
|
29
|
+
function J(e) {
|
|
30
|
+
return e?.ownerDocument.defaultView ?? window;
|
|
31
|
+
}
|
|
32
|
+
function _e(e) {
|
|
33
|
+
return J(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
|
|
34
|
+
}
|
|
35
|
+
function ve(e) {
|
|
13
36
|
if (e !== void 0) switch (typeof e) {
|
|
14
37
|
case "number": return e;
|
|
15
|
-
case "string":
|
|
16
|
-
if (e.endsWith("px")) return parseFloat(e);
|
|
17
|
-
break;
|
|
38
|
+
case "string": if (e.endsWith("px")) return parseFloat(e);
|
|
18
39
|
}
|
|
19
40
|
}
|
|
20
|
-
function
|
|
21
|
-
let { styleHeight: s, styleWidth: c } =
|
|
22
|
-
styleHeight:
|
|
23
|
-
styleWidth:
|
|
24
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
41
|
+
function ye({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
42
|
+
let { styleHeight: s, styleWidth: c } = B(() => ({
|
|
43
|
+
styleHeight: ve(o?.height),
|
|
44
|
+
styleWidth: ve(o?.width)
|
|
45
|
+
}), [o?.height, o?.width]), [l, u] = H({
|
|
25
46
|
height: t,
|
|
26
47
|
width: n
|
|
27
48
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
28
|
-
return
|
|
49
|
+
return q(() => {
|
|
29
50
|
if (i === null || d) return;
|
|
30
|
-
let t =
|
|
51
|
+
let t = _e(i);
|
|
52
|
+
if (!t) return;
|
|
53
|
+
let n = new t((e) => {
|
|
31
54
|
for (let t of e) {
|
|
32
55
|
let { contentRect: e, target: n } = t;
|
|
33
56
|
i === n && u((t) => t.height === e.height && t.width === e.width ? t : {
|
|
@@ -36,8 +59,8 @@ function B({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
36
59
|
});
|
|
37
60
|
}
|
|
38
61
|
});
|
|
39
|
-
return
|
|
40
|
-
|
|
62
|
+
return n.observe(i, { box: e }), () => {
|
|
63
|
+
n?.unobserve(i);
|
|
41
64
|
};
|
|
42
65
|
}, [
|
|
43
66
|
e,
|
|
@@ -45,7 +68,7 @@ function B({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
45
68
|
i,
|
|
46
69
|
s,
|
|
47
70
|
c
|
|
48
|
-
]),
|
|
71
|
+
]), B(() => ({
|
|
49
72
|
height: s ?? l.height,
|
|
50
73
|
width: c ?? l.width
|
|
51
74
|
}), [
|
|
@@ -54,114 +77,200 @@ function B({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
54
77
|
c
|
|
55
78
|
]);
|
|
56
79
|
}
|
|
57
|
-
function
|
|
58
|
-
let t =
|
|
59
|
-
throw Error("Cannot call
|
|
80
|
+
function be(e) {
|
|
81
|
+
let t = V(() => {
|
|
82
|
+
throw Error("Cannot call an event handler while rendering.");
|
|
60
83
|
});
|
|
61
|
-
return
|
|
84
|
+
return q(() => {
|
|
62
85
|
t.current = e;
|
|
63
|
-
}, [e]),
|
|
86
|
+
}, [e]), L((...e) => t.current?.(...e), [t]);
|
|
64
87
|
}
|
|
65
|
-
var
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
88
|
+
var xe = /* @__PURE__ */ new WeakMap();
|
|
89
|
+
function Se(e = !1, t = document) {
|
|
90
|
+
let n = xe.get(t);
|
|
91
|
+
if (n === void 0 || e) {
|
|
92
|
+
let e = t.createElement("div"), r = e.style;
|
|
93
|
+
r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
|
|
94
|
+
let i = t.createElement("div"), a = i.style;
|
|
95
|
+
a.width = "100px", a.height = "100px", e.appendChild(i), t.body.appendChild(e), e.scrollLeft > 0 ? n = "positive-descending" : (e.scrollLeft = 1, n = e.scrollLeft === 0 ? "negative" : "positive-ascending"), t.body.removeChild(e), xe.set(t, n);
|
|
72
96
|
}
|
|
73
|
-
return
|
|
97
|
+
return n;
|
|
74
98
|
}
|
|
75
|
-
function
|
|
76
|
-
if (t === "horizontal" && n) switch (
|
|
99
|
+
function Ce({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
100
|
+
if (t === "horizontal" && n) switch (Se(!1, e?.ownerDocument ?? document)) {
|
|
77
101
|
case "negative": return -r;
|
|
78
|
-
case "positive-descending":
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
break;
|
|
102
|
+
case "positive-descending": if (e) {
|
|
103
|
+
let { clientWidth: t, scrollWidth: n } = e;
|
|
104
|
+
return n - t - r;
|
|
105
|
+
}
|
|
84
106
|
}
|
|
85
107
|
return r;
|
|
86
108
|
}
|
|
87
|
-
function
|
|
109
|
+
function we({ container: e, element: t, onChange: n }) {
|
|
110
|
+
let r = J(t), i = _e(t), a = r.MutationObserver ?? (typeof MutationObserver < "u" ? MutationObserver : void 0), o = i ? new i(n) : void 0, s = (e) => !e.isConnected || (e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0, c = a ? new a((e) => {
|
|
111
|
+
e.some((e) => Array.from(e.addedNodes).some(s) || e.removedNodes.length > 0 && e.nextSibling !== null && s(e.nextSibling)) && (u(), n());
|
|
112
|
+
}) : void 0, l = /* @__PURE__ */ new Set(), u = () => {
|
|
113
|
+
for (let e of l) o?.unobserve(e);
|
|
114
|
+
l.clear(), c?.disconnect();
|
|
115
|
+
let n = t;
|
|
116
|
+
for (; n !== e;) {
|
|
117
|
+
let e = n.parentElement;
|
|
118
|
+
if (e === null) break;
|
|
119
|
+
if (o) for (let e = n.previousElementSibling; e !== null; e = e.previousElementSibling) l.add(e), o.observe(e);
|
|
120
|
+
c?.observe(e, { childList: !0 }), n = e;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return u(), () => {
|
|
124
|
+
o?.disconnect(), c?.disconnect();
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function Te(e) {
|
|
128
|
+
return e.window === e;
|
|
129
|
+
}
|
|
130
|
+
function Ee(e, t) {
|
|
131
|
+
return t === "window" ? e ? J(e) : null : t ?? null;
|
|
132
|
+
}
|
|
133
|
+
function De(e, t) {
|
|
134
|
+
return Te(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
|
|
135
|
+
}
|
|
136
|
+
function Oe(e, t) {
|
|
137
|
+
let n = Te(e) ? e.document.scrollingElement ?? e.document.documentElement : e;
|
|
138
|
+
return t === "vertical" ? n.scrollHeight - n.clientHeight : n.scrollWidth - n.clientWidth;
|
|
139
|
+
}
|
|
140
|
+
function ke(e, t) {
|
|
141
|
+
let { overflowX: n, overflowY: r } = J(e).getComputedStyle(e), i = t === "vertical" ? r : n;
|
|
142
|
+
return i === "visible" || i === "clip" ? !1 : t === "vertical" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
143
|
+
}
|
|
144
|
+
function Ae({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
|
|
145
|
+
let i = t === "vertical", a, o;
|
|
146
|
+
if (Te(r)) {
|
|
147
|
+
let { documentElement: e } = r.document;
|
|
148
|
+
a = 0, o = i ? e.clientHeight : e.clientWidth;
|
|
149
|
+
} else {
|
|
150
|
+
let e = r.getBoundingClientRect();
|
|
151
|
+
a = i ? e.top + r.clientTop : e.left + r.clientLeft, o = i ? r.clientHeight : r.clientWidth;
|
|
152
|
+
}
|
|
153
|
+
let s = a + o, c = e.getBoundingClientRect(), l = i ? c.top + e.clientTop : c.left + e.clientLeft, u = i ? e.clientHeight : e.clientWidth, d = l + u, f = Ce({
|
|
154
|
+
containerElement: e,
|
|
155
|
+
direction: t,
|
|
156
|
+
isRtl: n,
|
|
157
|
+
scrollOffset: i ? e.scrollTop : e.scrollLeft
|
|
158
|
+
}), p = !i && n ? d - s : a - l, m = p + o, h = Math.max(0, p), g = Math.min(u, m);
|
|
159
|
+
return {
|
|
160
|
+
offset: f + h,
|
|
161
|
+
size: Math.max(0, g - h),
|
|
162
|
+
viewportOffset: f + p,
|
|
163
|
+
viewportSize: o
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function je({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
|
|
167
|
+
let i = Te(n) ? n.document.documentElement : n, a = J(i).getComputedStyle(i), o = (e) => {
|
|
168
|
+
let t = parseFloat(e ?? "");
|
|
169
|
+
return !Number.isFinite(t) || t < 0 ? 0 : e.endsWith("px") ? t : e.endsWith("%") ? t * r / 100 : 0;
|
|
170
|
+
};
|
|
171
|
+
if (e === "vertical") return {
|
|
172
|
+
end: o(a.scrollPaddingBottom),
|
|
173
|
+
start: o(a.scrollPaddingTop)
|
|
174
|
+
};
|
|
175
|
+
let s = o(a.scrollPaddingLeft), c = o(a.scrollPaddingRight);
|
|
176
|
+
return t ? {
|
|
177
|
+
end: s,
|
|
178
|
+
start: c
|
|
179
|
+
} : {
|
|
180
|
+
end: c,
|
|
181
|
+
start: s
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function Me(e, t = "Assertion error") {
|
|
88
185
|
if (!e) throw console.error(t), Error(t);
|
|
89
186
|
}
|
|
90
|
-
function
|
|
187
|
+
function Ne(e, t) {
|
|
91
188
|
if (e === t) return !0;
|
|
92
|
-
if (!!e != !!t || (
|
|
93
|
-
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
189
|
+
if (!!e != !!t || (Me(e !== void 0), Me(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
190
|
+
for (let n in e) if (!Object.hasOwn(t, n) || !Object.is(t[n], e[n])) return !1;
|
|
94
191
|
return !0;
|
|
95
192
|
}
|
|
96
|
-
function
|
|
193
|
+
function Pe({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
97
194
|
if (t === 0) return 0;
|
|
98
195
|
if (typeof n == "number") return t * n;
|
|
99
196
|
{
|
|
100
197
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
101
|
-
return
|
|
198
|
+
return Me(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
102
199
|
}
|
|
103
200
|
}
|
|
104
|
-
function
|
|
105
|
-
if (
|
|
106
|
-
let
|
|
201
|
+
function Fe({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i, itemSize: a, containerScrollOffset: o, containerSize: s }) {
|
|
202
|
+
if (r < 0 || r >= i) throw RangeError(`Invalid index specified: ${r}`, { cause: `Index ${r} is not within the range of 0 - ${i - 1}` });
|
|
203
|
+
let c = t.get(r), l = Pe({
|
|
107
204
|
cachedBounds: t,
|
|
108
|
-
itemCount:
|
|
109
|
-
itemSize:
|
|
110
|
-
}),
|
|
111
|
-
switch (e === "smart" && (e =
|
|
112
|
-
case "start": return
|
|
113
|
-
case "end": return
|
|
114
|
-
case "center": return c.scrollOffset
|
|
115
|
-
default: return
|
|
205
|
+
itemCount: i,
|
|
206
|
+
itemSize: a
|
|
207
|
+
}), u = (e) => n ? Math.max(0, Math.min(l - s, e)) : e, d = u(c.scrollOffset), f = n ? Math.max(0, c.scrollOffset - s + c.size) : c.scrollOffset - s + c.size, p = c.size > s ? o >= c.scrollOffset && o <= f : o >= f && o <= c.scrollOffset;
|
|
208
|
+
switch (e === "smart" && (e = p ? "auto" : "center"), e) {
|
|
209
|
+
case "start": return d;
|
|
210
|
+
case "end": return f;
|
|
211
|
+
case "center": return u(c.scrollOffset + c.size / 2 - s / 2);
|
|
212
|
+
default: return p ? o : o < f ? f : d;
|
|
116
213
|
}
|
|
117
214
|
}
|
|
118
|
-
function
|
|
119
|
-
let a = r - 1
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
215
|
+
function Ie({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
216
|
+
let a = r - 1;
|
|
217
|
+
if (r === 0) return {
|
|
218
|
+
startIndexVisible: 0,
|
|
219
|
+
stopIndexVisible: -1,
|
|
220
|
+
startIndexOverscan: 0,
|
|
221
|
+
stopIndexOverscan: -1
|
|
222
|
+
};
|
|
223
|
+
let o, s, { itemSize: c } = e;
|
|
224
|
+
if (c !== void 0) c > 0 ? (o = Math.max(0, Math.min(a, Math.floor(t / c))), s = Math.max(o, Math.min(a, Math.ceil((t + n) / c) - 1))) : (o = 0, s = 0);
|
|
225
|
+
else {
|
|
226
|
+
let r = 0, i = Math.min(a, Math.max(0, e.size - 1));
|
|
227
|
+
for (; r < i;) {
|
|
228
|
+
let n = Math.floor((r + i) / 2), a = e.get(n);
|
|
229
|
+
a.scrollOffset + a.size > t ? i = n : r = n + 1;
|
|
230
|
+
}
|
|
231
|
+
for (; r < a;) {
|
|
232
|
+
let n = e.get(r);
|
|
233
|
+
if (n.scrollOffset + n.size > t) break;
|
|
234
|
+
r++;
|
|
235
|
+
}
|
|
236
|
+
for (o = r, s = r; s < a;) {
|
|
237
|
+
let r = e.get(s);
|
|
238
|
+
if (r.scrollOffset + r.size >= t + n) break;
|
|
239
|
+
s++;
|
|
240
|
+
}
|
|
129
241
|
}
|
|
130
|
-
return
|
|
242
|
+
return {
|
|
131
243
|
startIndexVisible: o,
|
|
132
244
|
stopIndexVisible: s,
|
|
133
|
-
startIndexOverscan:
|
|
134
|
-
stopIndexOverscan:
|
|
245
|
+
startIndexOverscan: Math.max(0, o - i),
|
|
246
|
+
stopIndexOverscan: Math.min(a, s + i)
|
|
135
247
|
};
|
|
136
248
|
}
|
|
137
|
-
function
|
|
249
|
+
function Le({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
138
250
|
let r = /* @__PURE__ */ new Map();
|
|
139
251
|
return {
|
|
252
|
+
itemSize: typeof n == "number" ? n : void 0,
|
|
140
253
|
get(i) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
case "number":
|
|
148
|
-
a = n;
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
254
|
+
if (Me(i < e, `Invalid index ${i}`), typeof n == "number") return Me(i >= 0, `Invalid index ${i}`), {
|
|
255
|
+
size: n,
|
|
256
|
+
scrollOffset: i * n
|
|
257
|
+
};
|
|
258
|
+
for (; r.size - 1 < i;) {
|
|
259
|
+
let e = r.size, a = n(e, t);
|
|
151
260
|
if (e === 0) r.set(e, {
|
|
152
261
|
size: a,
|
|
153
262
|
scrollOffset: 0
|
|
154
263
|
});
|
|
155
264
|
else {
|
|
156
265
|
let t = r.get(e - 1);
|
|
157
|
-
|
|
266
|
+
Me(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
158
267
|
scrollOffset: t.scrollOffset + t.size,
|
|
159
268
|
size: a
|
|
160
269
|
});
|
|
161
270
|
}
|
|
162
271
|
}
|
|
163
272
|
let a = r.get(i);
|
|
164
|
-
return
|
|
273
|
+
return Me(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
165
274
|
},
|
|
166
275
|
set(e, t) {
|
|
167
276
|
r.set(e, t);
|
|
@@ -171,8 +280,8 @@ function de({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
171
280
|
}
|
|
172
281
|
};
|
|
173
282
|
}
|
|
174
|
-
function
|
|
175
|
-
return
|
|
283
|
+
function Re({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
284
|
+
return B(() => Le({
|
|
176
285
|
itemCount: e,
|
|
177
286
|
itemProps: t,
|
|
178
287
|
itemSize: n
|
|
@@ -182,874 +291,1944 @@ function J({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
182
291
|
n
|
|
183
292
|
]);
|
|
184
293
|
}
|
|
185
|
-
function
|
|
294
|
+
function ze({ containerSize: e, itemSize: t }) {
|
|
186
295
|
let n;
|
|
187
296
|
switch (typeof t) {
|
|
188
297
|
case "string":
|
|
189
|
-
|
|
190
|
-
break;
|
|
191
|
-
default:
|
|
192
|
-
n = t;
|
|
298
|
+
Me(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Me(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseFloat(t) / 100;
|
|
193
299
|
break;
|
|
300
|
+
default: n = t;
|
|
194
301
|
}
|
|
195
|
-
return n;
|
|
302
|
+
return typeof n == "number" && !(Number.isFinite(n) && n > 0) && (n = 0), n;
|
|
196
303
|
}
|
|
197
|
-
function
|
|
198
|
-
let { height:
|
|
199
|
-
defaultHeight:
|
|
200
|
-
defaultWidth:
|
|
304
|
+
function Be({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, defaultScrollOffset: r = 0, direction: i, isRtl: a = !1, itemCount: o, itemProps: s, itemSize: c, onResize: l, overscanCount: u, scrollElement: d }) {
|
|
305
|
+
let f = d !== void 0, p = f ? Ee(e, d) : e, { height: m = n, width: h = n } = ye({
|
|
306
|
+
defaultHeight: i === "vertical" ? n : void 0,
|
|
307
|
+
defaultWidth: i === "horizontal" ? n : void 0,
|
|
201
308
|
element: e,
|
|
202
|
-
mode:
|
|
309
|
+
mode: i === "vertical" ? "only-height" : "only-width",
|
|
203
310
|
style: t
|
|
204
|
-
}),
|
|
311
|
+
}), g = V({
|
|
205
312
|
height: 0,
|
|
206
313
|
width: 0
|
|
207
|
-
}),
|
|
208
|
-
containerSize:
|
|
209
|
-
itemSize:
|
|
314
|
+
}), [_, v] = H(n), y = f ? _ : i === "vertical" ? m : h, b = ze({
|
|
315
|
+
containerSize: y,
|
|
316
|
+
itemSize: c
|
|
210
317
|
});
|
|
211
|
-
|
|
212
|
-
if (typeof
|
|
213
|
-
let e =
|
|
214
|
-
(e.height !==
|
|
215
|
-
height:
|
|
216
|
-
width:
|
|
217
|
-
}, { ...e }), e.height =
|
|
318
|
+
q(() => {
|
|
319
|
+
if (typeof l == "function") {
|
|
320
|
+
let e = g.current;
|
|
321
|
+
(e.height !== m || e.width !== h) && (l({
|
|
322
|
+
height: m,
|
|
323
|
+
width: h
|
|
324
|
+
}, { ...e }), e.height = m, e.width = h);
|
|
218
325
|
}
|
|
219
326
|
}, [
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
327
|
+
m,
|
|
328
|
+
l,
|
|
329
|
+
h
|
|
223
330
|
]);
|
|
224
|
-
let
|
|
225
|
-
itemCount:
|
|
226
|
-
itemProps:
|
|
227
|
-
itemSize:
|
|
228
|
-
}),
|
|
229
|
-
cachedBounds:
|
|
230
|
-
containerScrollOffset:
|
|
231
|
-
containerSize:
|
|
232
|
-
itemCount:
|
|
233
|
-
overscanCount:
|
|
234
|
-
})), { startIndexVisible:
|
|
235
|
-
startIndexVisible: Math.min(
|
|
236
|
-
startIndexOverscan: Math.min(
|
|
237
|
-
stopIndexVisible: Math.min(
|
|
238
|
-
stopIndexOverscan: Math.min(
|
|
239
|
-
},
|
|
240
|
-
cachedBounds:
|
|
241
|
-
itemCount:
|
|
242
|
-
itemSize:
|
|
331
|
+
let x = Re({
|
|
332
|
+
itemCount: o,
|
|
333
|
+
itemProps: s,
|
|
334
|
+
itemSize: b
|
|
335
|
+
}), S = ge(), [C] = H(() => S || f ? 0 : r), w = L((e) => x.get(e), [x]), [T, E] = H(() => Ie({
|
|
336
|
+
cachedBounds: x,
|
|
337
|
+
containerScrollOffset: C,
|
|
338
|
+
containerSize: y,
|
|
339
|
+
itemCount: o,
|
|
340
|
+
overscanCount: u
|
|
341
|
+
})), { startIndexVisible: D, startIndexOverscan: O, stopIndexVisible: k, stopIndexOverscan: A } = {
|
|
342
|
+
startIndexVisible: Math.min(o - 1, T.startIndexVisible),
|
|
343
|
+
startIndexOverscan: Math.min(o - 1, T.startIndexOverscan),
|
|
344
|
+
stopIndexVisible: Math.min(o - 1, T.stopIndexVisible),
|
|
345
|
+
stopIndexOverscan: Math.min(o - 1, T.stopIndexOverscan)
|
|
346
|
+
}, j = L(() => Pe({
|
|
347
|
+
cachedBounds: x,
|
|
348
|
+
itemCount: o,
|
|
349
|
+
itemSize: b
|
|
243
350
|
}), [
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
]),
|
|
248
|
-
|
|
249
|
-
containerScrollOffset: U({
|
|
351
|
+
x,
|
|
352
|
+
o,
|
|
353
|
+
b
|
|
354
|
+
]), M = L((t) => {
|
|
355
|
+
let n = Ce({
|
|
250
356
|
containerElement: e,
|
|
251
|
-
direction:
|
|
252
|
-
isRtl:
|
|
357
|
+
direction: i,
|
|
358
|
+
isRtl: a,
|
|
253
359
|
scrollOffset: t
|
|
254
|
-
})
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
360
|
+
});
|
|
361
|
+
return Ie({
|
|
362
|
+
cachedBounds: x,
|
|
363
|
+
containerScrollOffset: n,
|
|
364
|
+
containerSize: y,
|
|
365
|
+
itemCount: o,
|
|
366
|
+
overscanCount: u
|
|
367
|
+
});
|
|
368
|
+
}, [
|
|
369
|
+
x,
|
|
260
370
|
e,
|
|
261
|
-
|
|
262
|
-
r,
|
|
371
|
+
y,
|
|
263
372
|
i,
|
|
264
373
|
a,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
374
|
+
o,
|
|
375
|
+
u
|
|
376
|
+
]), N = V(!1);
|
|
377
|
+
q(() => {
|
|
378
|
+
if (!e || o === 0 || f || N.current || (N.current = !0, r <= 0)) return;
|
|
379
|
+
let t = i === "horizontal" && me(e);
|
|
380
|
+
if (Ce({
|
|
381
|
+
containerElement: e,
|
|
382
|
+
direction: i,
|
|
383
|
+
isRtl: t,
|
|
384
|
+
scrollOffset: i === "vertical" ? e.scrollTop : e.scrollLeft
|
|
385
|
+
}) !== 0) return;
|
|
386
|
+
let n = Ce({
|
|
387
|
+
containerElement: e,
|
|
388
|
+
direction: i,
|
|
389
|
+
isRtl: t,
|
|
390
|
+
scrollOffset: r
|
|
391
|
+
});
|
|
392
|
+
typeof e.scrollTo == "function" ? e.scrollTo({
|
|
393
|
+
behavior: "instant",
|
|
394
|
+
[i === "vertical" ? "top" : "left"]: n
|
|
395
|
+
}) : i === "vertical" ? e.scrollTop = n : e.scrollLeft = n;
|
|
396
|
+
}, [e, o]), q(() => {
|
|
397
|
+
if (f && e && p) return;
|
|
398
|
+
let t = e && !f ? M(i === "vertical" ? e.scrollTop : e.scrollLeft) : Ie({
|
|
399
|
+
cachedBounds: x,
|
|
400
|
+
containerScrollOffset: C,
|
|
401
|
+
containerSize: y,
|
|
402
|
+
itemCount: o,
|
|
403
|
+
overscanCount: u
|
|
404
|
+
});
|
|
405
|
+
E((e) => Ne(t, e) ? e : t);
|
|
269
406
|
}, [
|
|
407
|
+
x,
|
|
270
408
|
e,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
409
|
+
y,
|
|
410
|
+
i,
|
|
411
|
+
M,
|
|
412
|
+
C,
|
|
413
|
+
f,
|
|
414
|
+
o,
|
|
415
|
+
u,
|
|
416
|
+
p
|
|
417
|
+
]), q(() => {
|
|
418
|
+
if (!e || f) return;
|
|
275
419
|
let t = () => {
|
|
276
|
-
|
|
277
|
-
let { scrollLeft: n, scrollTop:
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
containerSize:
|
|
286
|
-
itemCount:
|
|
287
|
-
overscanCount:
|
|
420
|
+
E((t) => {
|
|
421
|
+
let { scrollLeft: n, scrollTop: r } = e, s = Ce({
|
|
422
|
+
containerElement: e,
|
|
423
|
+
direction: i,
|
|
424
|
+
isRtl: a,
|
|
425
|
+
scrollOffset: i === "vertical" ? r : n
|
|
426
|
+
}), c = Ie({
|
|
427
|
+
cachedBounds: x,
|
|
428
|
+
containerScrollOffset: s,
|
|
429
|
+
containerSize: y,
|
|
430
|
+
itemCount: o,
|
|
431
|
+
overscanCount: u
|
|
288
432
|
});
|
|
289
|
-
return
|
|
433
|
+
return Ne(c, t) ? t : c;
|
|
290
434
|
});
|
|
291
435
|
};
|
|
292
436
|
return e.addEventListener("scroll", t), () => {
|
|
293
437
|
e.removeEventListener("scroll", t);
|
|
294
438
|
};
|
|
295
439
|
}, [
|
|
296
|
-
|
|
440
|
+
x,
|
|
297
441
|
e,
|
|
298
|
-
|
|
299
|
-
|
|
442
|
+
y,
|
|
443
|
+
i,
|
|
300
444
|
a,
|
|
301
|
-
|
|
445
|
+
f,
|
|
446
|
+
o,
|
|
447
|
+
u
|
|
448
|
+
]);
|
|
449
|
+
let P = be(() => {
|
|
450
|
+
if (!e || !p) return;
|
|
451
|
+
let { offset: t, size: n, viewportSize: r } = Ae({
|
|
452
|
+
containerElement: e,
|
|
453
|
+
direction: i,
|
|
454
|
+
isRtl: a,
|
|
455
|
+
scrollTarget: p
|
|
456
|
+
});
|
|
457
|
+
v(r);
|
|
458
|
+
let s = Ie({
|
|
459
|
+
cachedBounds: x,
|
|
460
|
+
containerScrollOffset: t,
|
|
461
|
+
containerSize: n,
|
|
462
|
+
itemCount: o,
|
|
463
|
+
overscanCount: u
|
|
464
|
+
});
|
|
465
|
+
E((e) => Ne(s, e) ? e : s);
|
|
466
|
+
});
|
|
467
|
+
return q(() => {
|
|
468
|
+
f && P();
|
|
469
|
+
}), q(() => {
|
|
470
|
+
if (!f || !e || !p) return;
|
|
471
|
+
let t = J(e), n = () => P();
|
|
472
|
+
p.addEventListener("scroll", n, { passive: !0 }), e.addEventListener("scroll", n, { passive: !0 }), t.addEventListener("resize", n);
|
|
473
|
+
let r, i = _e(e);
|
|
474
|
+
i && !Te(p) && (r = new i(n), r.observe(p));
|
|
475
|
+
let a = we({
|
|
476
|
+
container: Te(p) ? p.document.documentElement : p,
|
|
477
|
+
element: e,
|
|
478
|
+
onChange: n
|
|
479
|
+
});
|
|
480
|
+
return () => {
|
|
481
|
+
p.removeEventListener("scroll", n), e.removeEventListener("scroll", n), t.removeEventListener("resize", n), r?.disconnect(), a();
|
|
482
|
+
};
|
|
483
|
+
}, [
|
|
484
|
+
e,
|
|
485
|
+
f,
|
|
486
|
+
p,
|
|
487
|
+
P
|
|
302
488
|
]), {
|
|
303
|
-
getCellBounds:
|
|
304
|
-
getEstimatedSize:
|
|
305
|
-
|
|
306
|
-
let
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
489
|
+
getCellBounds: w,
|
|
490
|
+
getEstimatedSize: j,
|
|
491
|
+
getScrollPositionForIndex: be(({ align: t = "auto", index: n }) => {
|
|
492
|
+
let r = ({ clamp: e, containerScrollOffset: r, containerSize: i, padding: a }) => {
|
|
493
|
+
if (a.start === 0 && a.end === 0) return Fe({
|
|
494
|
+
align: t,
|
|
495
|
+
cachedBounds: x,
|
|
496
|
+
clamp: e,
|
|
497
|
+
containerScrollOffset: r,
|
|
498
|
+
containerSize: i,
|
|
499
|
+
index: n,
|
|
500
|
+
itemCount: o,
|
|
501
|
+
itemSize: b
|
|
502
|
+
});
|
|
503
|
+
let s = Fe({
|
|
504
|
+
align: t,
|
|
505
|
+
cachedBounds: x,
|
|
506
|
+
clamp: !1,
|
|
507
|
+
containerScrollOffset: r + a.start,
|
|
508
|
+
containerSize: Math.max(0, i - a.start - a.end),
|
|
509
|
+
index: n,
|
|
510
|
+
itemCount: o,
|
|
511
|
+
itemSize: b
|
|
512
|
+
}) - a.start;
|
|
513
|
+
return e ? Math.max(0, Math.min(j() - i, s)) : s;
|
|
514
|
+
};
|
|
515
|
+
if (f && e && p && !ke(e, i)) {
|
|
516
|
+
let { viewportOffset: t, viewportSize: n } = Ae({
|
|
517
|
+
containerElement: e,
|
|
518
|
+
direction: i,
|
|
519
|
+
isRtl: a,
|
|
520
|
+
scrollTarget: p
|
|
521
|
+
}), o = r({
|
|
522
|
+
clamp: !1,
|
|
523
|
+
containerScrollOffset: t,
|
|
524
|
+
containerSize: n,
|
|
525
|
+
padding: je({
|
|
526
|
+
direction: i,
|
|
527
|
+
isRtl: a,
|
|
528
|
+
scrollTarget: p,
|
|
529
|
+
viewportSize: n
|
|
530
|
+
})
|
|
531
|
+
}) - t, s = i === "horizontal" && a ? -o : o;
|
|
532
|
+
return {
|
|
533
|
+
scrollOffset: De(p, i) + s,
|
|
534
|
+
scrollTarget: p
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
let s = e ? i === "vertical" ? e.scrollTop : e.scrollLeft : 0, c = f && e ? i === "vertical" ? e.clientHeight : e.clientWidth : y, l = r({
|
|
538
|
+
clamp: !0,
|
|
539
|
+
containerScrollOffset: Ce({
|
|
317
540
|
containerElement: e,
|
|
318
|
-
direction:
|
|
319
|
-
isRtl:
|
|
541
|
+
direction: i,
|
|
542
|
+
isRtl: a,
|
|
320
543
|
scrollOffset: s
|
|
321
|
-
}),
|
|
322
|
-
|
|
323
|
-
|
|
544
|
+
}),
|
|
545
|
+
containerSize: c,
|
|
546
|
+
padding: e ? je({
|
|
547
|
+
direction: i,
|
|
548
|
+
isRtl: a,
|
|
549
|
+
scrollTarget: e,
|
|
550
|
+
viewportSize: c
|
|
551
|
+
}) : {
|
|
552
|
+
end: 0,
|
|
553
|
+
start: 0
|
|
324
554
|
}
|
|
325
|
-
|
|
555
|
+
});
|
|
556
|
+
if (e && (!f || p)) {
|
|
557
|
+
if (l = Ce({
|
|
558
|
+
containerElement: e,
|
|
559
|
+
direction: i,
|
|
560
|
+
isRtl: a,
|
|
561
|
+
scrollOffset: l
|
|
562
|
+
}), !f && typeof e.scrollTo != "function") {
|
|
563
|
+
let e = M(l);
|
|
564
|
+
Ne(T, e) || E(e);
|
|
565
|
+
}
|
|
566
|
+
return {
|
|
567
|
+
scrollOffset: l,
|
|
568
|
+
scrollTarget: e
|
|
569
|
+
};
|
|
326
570
|
}
|
|
327
571
|
}),
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
572
|
+
scrollTarget: p,
|
|
573
|
+
startIndexOverscan: O,
|
|
574
|
+
startIndexVisible: D,
|
|
575
|
+
stopIndexOverscan: A,
|
|
576
|
+
stopIndexVisible: k
|
|
332
577
|
};
|
|
333
578
|
}
|
|
334
|
-
function
|
|
335
|
-
|
|
579
|
+
function Ve(e) {
|
|
580
|
+
let [t, n] = H(e);
|
|
581
|
+
return Ne(t, e) ? t : (n(e), e);
|
|
336
582
|
}
|
|
337
|
-
function
|
|
583
|
+
function He(e, t) {
|
|
338
584
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
339
|
-
return
|
|
585
|
+
return Ne(n, a) && Ne(r, o) && Ne(i, s);
|
|
586
|
+
}
|
|
587
|
+
var Ue = "data-react-window-index", We = "data-index";
|
|
588
|
+
function Ge(e) {
|
|
589
|
+
let t = e.getAttribute(Ue) ?? e.getAttribute(We);
|
|
590
|
+
return t !== null && /^\d+$/.test(t) ? Number(t) : void 0;
|
|
591
|
+
}
|
|
592
|
+
var Ke = 1e3, qe = 500;
|
|
593
|
+
function Je(e) {
|
|
594
|
+
return 1 - (1 - e) ** 3;
|
|
340
595
|
}
|
|
341
|
-
function
|
|
596
|
+
function Ye({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, itemCount: i, itemElements: a, scrollTarget: o, getScrollPositionForIndex: s }) {
|
|
597
|
+
let c = e === "vertical", l = V(null), u = V(void 0), d = be(() => {
|
|
598
|
+
l.current = null, u.current !== void 0 && (u.current.view.cancelAnimationFrame(u.current.id), u.current = void 0);
|
|
599
|
+
}), f = be(() => {
|
|
600
|
+
let e = J(t);
|
|
601
|
+
u.current = {
|
|
602
|
+
id: e.requestAnimationFrame(p),
|
|
603
|
+
view: e
|
|
604
|
+
};
|
|
605
|
+
}), p = be(() => {
|
|
606
|
+
u.current = void 0;
|
|
607
|
+
let o = l.current;
|
|
608
|
+
if (!o) return;
|
|
609
|
+
let p = performance.now();
|
|
610
|
+
if (!t || !r || o.index >= i || o.animation !== void 0 && p >= o.animation.deadline) {
|
|
611
|
+
d();
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
let m = s({
|
|
615
|
+
align: o.align,
|
|
616
|
+
index: o.index
|
|
617
|
+
});
|
|
618
|
+
if (m !== void 0) {
|
|
619
|
+
let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t, Oe(r, e)));
|
|
620
|
+
o.animation === void 0 && (o.animation = {
|
|
621
|
+
deadline: p + (o.smooth ? qe : 0) + Ke,
|
|
622
|
+
startOffset: De(r, e),
|
|
623
|
+
startTime: p
|
|
624
|
+
});
|
|
625
|
+
let l = o.smooth ? (p - o.animation.startTime) / qe : 1;
|
|
626
|
+
if (l < 1) {
|
|
627
|
+
let { startOffset: e } = o.animation;
|
|
628
|
+
o.stableFrames = 0, r.scrollTo({
|
|
629
|
+
behavior: "instant",
|
|
630
|
+
[c ? "top" : "left"]: e + (s - e) * Je(l)
|
|
631
|
+
});
|
|
632
|
+
} else if (Math.abs(s - De(r, e)) > 1) o.stableFrames = 0, r.scrollTo({
|
|
633
|
+
behavior: "instant",
|
|
634
|
+
[c ? "top" : "left"]: s
|
|
635
|
+
});
|
|
636
|
+
else {
|
|
637
|
+
let e = a.current;
|
|
638
|
+
if (!(e.some((e) => Ge(e) === o.index) && e.every((e) => {
|
|
639
|
+
let t = Ge(e);
|
|
640
|
+
if (t === void 0 || t >= i) return !0;
|
|
641
|
+
let r = c ? e.offsetHeight : e.offsetWidth;
|
|
642
|
+
return Math.abs(n(t).size - r) <= 1;
|
|
643
|
+
}))) o.stableFrames = 0;
|
|
644
|
+
else if (++o.stableFrames >= 2) {
|
|
645
|
+
d();
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
f();
|
|
651
|
+
});
|
|
652
|
+
return q(() => {
|
|
653
|
+
let e = o ?? t;
|
|
654
|
+
if (!e) return;
|
|
655
|
+
let n = (e) => {
|
|
656
|
+
switch (e.key) {
|
|
657
|
+
case "ArrowUp":
|
|
658
|
+
case "ArrowDown":
|
|
659
|
+
case "ArrowLeft":
|
|
660
|
+
case "ArrowRight":
|
|
661
|
+
case "PageUp":
|
|
662
|
+
case "PageDown":
|
|
663
|
+
case "Home":
|
|
664
|
+
case "End":
|
|
665
|
+
case " ": d();
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
return e.addEventListener("wheel", d, { passive: !0 }), e.addEventListener("touchstart", d, { passive: !0 }), e.addEventListener("pointerdown", d), e.addEventListener("keydown", n), () => {
|
|
669
|
+
d(), e.removeEventListener("wheel", d), e.removeEventListener("touchstart", d), e.removeEventListener("pointerdown", d), e.removeEventListener("keydown", n);
|
|
670
|
+
};
|
|
671
|
+
}, [
|
|
672
|
+
d,
|
|
673
|
+
t,
|
|
674
|
+
o
|
|
675
|
+
]), L(({ align: n = "auto", behavior: i = "auto", index: a }) => {
|
|
676
|
+
if (r && n === "smart") {
|
|
677
|
+
let t = s({
|
|
678
|
+
align: "auto",
|
|
679
|
+
index: a
|
|
680
|
+
});
|
|
681
|
+
n = t === void 0 || t.scrollOffset === De(t.scrollTarget, e) ? "auto" : "center";
|
|
682
|
+
}
|
|
683
|
+
let o = s({
|
|
684
|
+
align: n,
|
|
685
|
+
index: a
|
|
686
|
+
});
|
|
687
|
+
if (d(), o && typeof o.scrollTarget.scrollTo == "function") {
|
|
688
|
+
let { scrollOffset: e, scrollTarget: s } = o;
|
|
689
|
+
if (r) {
|
|
690
|
+
let e = i === "smooth" && t?.ownerDocument.visibilityState !== "hidden";
|
|
691
|
+
if (l.current = {
|
|
692
|
+
align: n,
|
|
693
|
+
index: a,
|
|
694
|
+
smooth: e,
|
|
695
|
+
stableFrames: 0
|
|
696
|
+
}, f(), e) return;
|
|
697
|
+
}
|
|
698
|
+
s.scrollTo({
|
|
699
|
+
behavior: r ? "instant" : i,
|
|
700
|
+
[c ? "top" : "left"]: e
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
}, [
|
|
704
|
+
d,
|
|
705
|
+
e,
|
|
706
|
+
t,
|
|
707
|
+
r,
|
|
708
|
+
c,
|
|
709
|
+
f,
|
|
710
|
+
s
|
|
711
|
+
]);
|
|
712
|
+
}
|
|
713
|
+
function Xe({ callback: e, element: t, enabled: n = !0 }) {
|
|
714
|
+
let r = be(e);
|
|
715
|
+
R(() => {
|
|
716
|
+
if (!n || !t) return;
|
|
717
|
+
let e = J(t), i = e.requestAnimationFrame(() => {
|
|
718
|
+
i = e.requestAnimationFrame(r);
|
|
719
|
+
});
|
|
720
|
+
return () => {
|
|
721
|
+
e.cancelAnimationFrame(i);
|
|
722
|
+
};
|
|
723
|
+
}, [
|
|
724
|
+
t,
|
|
725
|
+
n,
|
|
726
|
+
r
|
|
727
|
+
]);
|
|
728
|
+
}
|
|
729
|
+
function Ze({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopIndex: i }) {
|
|
730
|
+
if (r < 0 || i < r) return [];
|
|
731
|
+
let a = [], o = /* @__PURE__ */ new Set(), s = !0;
|
|
732
|
+
for (let t of e) {
|
|
733
|
+
let e = t.getAttribute("aria-posinset");
|
|
734
|
+
if (e === null) continue;
|
|
735
|
+
let c = Number(e) - 1;
|
|
736
|
+
if (!/^\d+$/.test(e) || c < r || c > i || o.has(c) || t.getAttribute("aria-setsize") !== `${n}`) {
|
|
737
|
+
s = !1;
|
|
738
|
+
break;
|
|
739
|
+
}
|
|
740
|
+
o.add(c), a.push({
|
|
741
|
+
element: t,
|
|
742
|
+
index: c
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
if (s && a.length > 0) return a;
|
|
746
|
+
let c = Math.min(e.length, i - r + 1);
|
|
747
|
+
return (t ? e.slice(e.length - c) : e.slice(0, c)).map((e, t) => ({
|
|
748
|
+
element: e,
|
|
749
|
+
index: r + t
|
|
750
|
+
}));
|
|
751
|
+
}
|
|
752
|
+
function Qe(e) {
|
|
342
753
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
343
754
|
}
|
|
344
|
-
var
|
|
345
|
-
function
|
|
346
|
-
let
|
|
347
|
-
|
|
348
|
-
|
|
755
|
+
var $e = "data-react-window-sizer";
|
|
756
|
+
function et({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffset: r = 0, listRef: i, onResize: a, onRowsRendered: o, overscanCount: s = 3, rowComponent: c, rowCount: l, rowHeight: u, rowKey: d, rowProps: f, scrollElement: p, tagName: m = "div", style: h, ...g }) {
|
|
757
|
+
let _ = Ve(f), v = B(() => I(c, He), [c]), [y, b] = H(null), x = Qe(u), S = B(() => x ? (e) => u.getRowHeight(e) ?? u.getAverageRowHeight() : u, [x, u]), C = ge(), [w, T] = H(() => C && x), E = V(u);
|
|
758
|
+
q(() => {
|
|
759
|
+
w && E.current !== u && T(!1);
|
|
760
|
+
}, [w, u]), Xe({
|
|
761
|
+
callback: () => T(!1),
|
|
762
|
+
element: y,
|
|
763
|
+
enabled: w
|
|
764
|
+
});
|
|
765
|
+
let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex: A, startIndexOverscan: j, startIndexVisible: M, stopIndexOverscan: N, stopIndexVisible: L } = Be({
|
|
766
|
+
containerElement: y,
|
|
767
|
+
containerStyle: h,
|
|
349
768
|
defaultContainerSize: n,
|
|
769
|
+
defaultScrollOffset: r,
|
|
770
|
+
direction: "vertical",
|
|
771
|
+
itemCount: l,
|
|
772
|
+
itemProps: _,
|
|
773
|
+
itemSize: S,
|
|
774
|
+
onResize: a,
|
|
775
|
+
overscanCount: s,
|
|
776
|
+
scrollElement: p
|
|
777
|
+
}), ee = V([]), z = Ye({
|
|
350
778
|
direction: "vertical",
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
779
|
+
element: y,
|
|
780
|
+
getCellBounds: D,
|
|
781
|
+
isDynamicSize: x,
|
|
782
|
+
itemCount: l,
|
|
783
|
+
itemElements: ee,
|
|
784
|
+
scrollTarget: k,
|
|
785
|
+
getScrollPositionForIndex: A
|
|
356
786
|
});
|
|
357
|
-
|
|
787
|
+
te(i, () => ({
|
|
358
788
|
get element() {
|
|
359
|
-
return
|
|
789
|
+
return y;
|
|
360
790
|
},
|
|
361
|
-
scrollToRow
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
if (
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
});
|
|
379
|
-
if (v) return l.observeRowElements(e);
|
|
791
|
+
scrollToRow: z
|
|
792
|
+
}), [y, z]);
|
|
793
|
+
let U = w && x && j === 0;
|
|
794
|
+
q(() => {
|
|
795
|
+
if (!y) return;
|
|
796
|
+
let e = Array.from(y.children).filter((e) => !e.hasAttribute($e)), t = Ze({
|
|
797
|
+
elements: e,
|
|
798
|
+
isFlowLayout: U,
|
|
799
|
+
rowCount: l,
|
|
800
|
+
startIndex: j,
|
|
801
|
+
stopIndex: N
|
|
802
|
+
}), n = t.map(({ element: e }) => e);
|
|
803
|
+
if (e.forEach((e) => {
|
|
804
|
+
n.includes(e) || e.removeAttribute(Ue);
|
|
805
|
+
}), t.forEach(({ element: e, index: t }) => {
|
|
806
|
+
e.setAttribute(Ue, `${t}`);
|
|
807
|
+
}), ee.current = n, x) return u.observeRowElements(n);
|
|
380
808
|
}, [
|
|
381
|
-
g,
|
|
382
809
|
v,
|
|
810
|
+
y,
|
|
811
|
+
x,
|
|
812
|
+
U,
|
|
383
813
|
l,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
814
|
+
u,
|
|
815
|
+
d,
|
|
816
|
+
_,
|
|
817
|
+
j,
|
|
818
|
+
N
|
|
819
|
+
]), R(() => {
|
|
820
|
+
j >= 0 && N >= 0 && o && o({
|
|
821
|
+
startIndex: M,
|
|
822
|
+
stopIndex: L
|
|
390
823
|
}, {
|
|
391
|
-
startIndex:
|
|
392
|
-
stopIndex:
|
|
824
|
+
startIndex: j,
|
|
825
|
+
stopIndex: N
|
|
393
826
|
});
|
|
394
827
|
}, [
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
828
|
+
o,
|
|
829
|
+
j,
|
|
830
|
+
M,
|
|
831
|
+
N,
|
|
832
|
+
L
|
|
400
833
|
]);
|
|
401
|
-
let
|
|
834
|
+
let ne = B(() => {
|
|
402
835
|
let e = [];
|
|
403
|
-
if (
|
|
404
|
-
let n =
|
|
405
|
-
e.push(/* @__PURE__ */
|
|
406
|
-
...
|
|
836
|
+
if (l > 0) for (let t = j; t <= N; t++) {
|
|
837
|
+
let n = D(t);
|
|
838
|
+
e.push(/* @__PURE__ */ F(v, {
|
|
839
|
+
..._,
|
|
407
840
|
ariaAttributes: {
|
|
408
841
|
"aria-posinset": t + 1,
|
|
409
|
-
"aria-setsize":
|
|
842
|
+
"aria-setsize": l,
|
|
410
843
|
role: "listitem"
|
|
411
844
|
},
|
|
412
|
-
key: t,
|
|
845
|
+
key: d ? d(t, _) : t,
|
|
413
846
|
index: t,
|
|
414
|
-
style: {
|
|
847
|
+
style: U ? { width: "100%" } : {
|
|
415
848
|
position: "absolute",
|
|
416
849
|
left: 0,
|
|
417
850
|
transform: `translateY(${n.scrollOffset}px)`,
|
|
418
|
-
height:
|
|
851
|
+
height: x ? void 0 : n.size,
|
|
419
852
|
width: "100%"
|
|
420
853
|
}
|
|
421
854
|
}));
|
|
422
855
|
}
|
|
423
856
|
return e;
|
|
424
857
|
}, [
|
|
425
|
-
h,
|
|
426
|
-
y,
|
|
427
858
|
v,
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
859
|
+
D,
|
|
860
|
+
x,
|
|
861
|
+
U,
|
|
862
|
+
l,
|
|
863
|
+
d,
|
|
864
|
+
_,
|
|
865
|
+
j,
|
|
866
|
+
N
|
|
867
|
+
]), G = /* @__PURE__ */ W("div", {
|
|
433
868
|
"aria-hidden": !0,
|
|
869
|
+
[$e]: "",
|
|
434
870
|
style: {
|
|
435
|
-
|
|
871
|
+
position: U ? "absolute" : void 0,
|
|
872
|
+
top: U ? 0 : void 0,
|
|
873
|
+
height: O(),
|
|
436
874
|
width: "100%",
|
|
437
875
|
zIndex: -1
|
|
438
876
|
}
|
|
439
|
-
});
|
|
440
|
-
return
|
|
877
|
+
}, "sizer"), re = /* @__PURE__ */ W(P, { children: e }, "children"), K = /* @__PURE__ */ W(P, { children: ne }, "rows");
|
|
878
|
+
return F(m, {
|
|
441
879
|
role: "list",
|
|
442
|
-
...
|
|
880
|
+
...g,
|
|
443
881
|
className: t,
|
|
444
|
-
ref:
|
|
882
|
+
ref: b,
|
|
445
883
|
style: {
|
|
446
884
|
position: "relative",
|
|
447
|
-
maxHeight: "100%",
|
|
448
885
|
flexGrow: 1,
|
|
449
|
-
|
|
450
|
-
|
|
886
|
+
...p === void 0 && {
|
|
887
|
+
maxHeight: "100%",
|
|
888
|
+
overflowY: "auto"
|
|
889
|
+
},
|
|
890
|
+
...h
|
|
451
891
|
}
|
|
452
|
-
},
|
|
892
|
+
}, ...U ? [re, K] : [K, re], G);
|
|
453
893
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
return e.
|
|
458
|
-
}({}),
|
|
894
|
+
var tt = /* @__PURE__ */ Object.assign(et, { displayName: "List" }), Y = /* @__PURE__ */ function(e) {
|
|
895
|
+
return e.All = "all", e.Chat = "chat", e.Task = "task", e;
|
|
896
|
+
}({}), X = /* @__PURE__ */ function(e) {
|
|
897
|
+
return e.Avatar = "avatar", e.Indicator = "indicator", e;
|
|
898
|
+
}({}), Z = /* @__PURE__ */ function(e) {
|
|
899
|
+
return e.Header = "header", e.Item = "item", e.Project = "project", e.ProjectConversation = "project-conversation", e.ProjectSeeAll = "project-see-all", e;
|
|
900
|
+
}({}), nt = (e, t) => t === n.All || e.source === t, rt = (t, n) => {
|
|
901
|
+
if (n === Y.All) return !0;
|
|
902
|
+
let r = t.kind ?? e.Chat;
|
|
903
|
+
return n === Y.Task ? r === e.Task : r === e.Chat;
|
|
904
|
+
}, it = (e, t) => !t || e.title.toLowerCase().includes(t.toLowerCase()), at = (e, { searchQuery: t, activeFilter: r, activeTypeFilter: i, hiddenSources: a }) => {
|
|
905
|
+
if (i === Y.Task) return [];
|
|
906
|
+
let o = t.toLowerCase(), s = [];
|
|
907
|
+
for (let i of e) {
|
|
908
|
+
let e = i.source ?? n.MyChats;
|
|
909
|
+
if (a?.includes(e) || r !== n.All && r !== e) continue;
|
|
910
|
+
if (!o || i.name.toLowerCase().includes(o)) {
|
|
911
|
+
s.push(i);
|
|
912
|
+
continue;
|
|
913
|
+
}
|
|
914
|
+
let c = i.conversations.filter((e) => it(e, t));
|
|
915
|
+
c.length > 0 && s.push({
|
|
916
|
+
...i,
|
|
917
|
+
conversations: c,
|
|
918
|
+
hasMore: !1
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
return s;
|
|
922
|
+
}, Q = {
|
|
923
|
+
guideLine: "_guideLine_1fnby_7",
|
|
924
|
+
guideLineFirst: "_guideLineFirst_1fnby_18",
|
|
925
|
+
guideLineLast: "_guideLineLast_1fnby_22",
|
|
926
|
+
chevron: "_chevron_1fnby_27",
|
|
927
|
+
projectIcon: "_projectIcon_1fnby_27",
|
|
928
|
+
seeAllText: "_seeAllText_1fnby_31"
|
|
929
|
+
}, ot = (e) => `${60 + e * 23 % 35}%`, st = (e, t, n = X.Avatar) => e ? t ? "pe-9" : "pe-2 group-focus-within/conversation:pe-9 group-hover/conversation:pe-9" : n === X.Indicator ? "pe-2" : "pe-3", ct = (e) => ({
|
|
930
|
+
"aria-level": 2,
|
|
931
|
+
"aria-posinset": e.posInSet,
|
|
932
|
+
"aria-setsize": e.setSize,
|
|
933
|
+
className: a("ps-7", Q.guideLine, e.isFirstNested && Q.guideLineFirst, e.isLastNested && Q.guideLineLast)
|
|
934
|
+
}), lt = (e, t) => {
|
|
935
|
+
let n = t.rows[e];
|
|
936
|
+
return n.kind === Z.ProjectConversation && t.projectConversationVariant === X.Avatar ? 36 : n.kind === Z.Project || n.kind === Z.ProjectConversation || n.kind === Z.ProjectSeeAll ? 34 : t.rowVariant === X.Indicator ? n.kind === Z.Item ? 34 : e === 0 ? 32 : 40 : n.kind === Z.Item ? 36 : e === 0 ? 24 : 56;
|
|
937
|
+
}, ut = 5, dt = (e) => Math.max(ut, Math.ceil(Math.ceil(e / 36) / 2)), ft = (e, { startIndex: t, stopIndex: n }) => {
|
|
938
|
+
let r = /* @__PURE__ */ new Set();
|
|
939
|
+
for (let i = Math.max(0, t); i <= Math.min(n, e.length - 1); i++) {
|
|
940
|
+
let t = e[i];
|
|
941
|
+
t.kind === Z.Item && r.add(t.item.id);
|
|
942
|
+
}
|
|
943
|
+
return [...r];
|
|
944
|
+
}, pt = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), mt = (e, t) => e.isExpanded !== !1 || t !== "" && e.conversations.some((e) => it(e, t)), ht = (e, t = !0) => {
|
|
945
|
+
let n = [{
|
|
946
|
+
kind: Z.Project,
|
|
947
|
+
project: e,
|
|
948
|
+
isExpanded: t
|
|
949
|
+
}];
|
|
950
|
+
if (!t) return n;
|
|
951
|
+
let r = e.conversations.length + +!!e.hasMore;
|
|
952
|
+
return e.conversations.forEach((t, i) => {
|
|
953
|
+
n.push({
|
|
954
|
+
kind: Z.ProjectConversation,
|
|
955
|
+
item: t,
|
|
956
|
+
projectId: e.id,
|
|
957
|
+
posInSet: i + 1,
|
|
958
|
+
setSize: r,
|
|
959
|
+
isFirstNested: i === 0,
|
|
960
|
+
isLastNested: i + 1 === r
|
|
961
|
+
});
|
|
962
|
+
}), e.hasMore && n.push({
|
|
963
|
+
kind: Z.ProjectSeeAll,
|
|
964
|
+
project: e,
|
|
965
|
+
projectId: e.id,
|
|
966
|
+
posInSet: r,
|
|
967
|
+
setSize: r,
|
|
968
|
+
isFirstNested: r === 1,
|
|
969
|
+
isLastNested: !0
|
|
970
|
+
}), n;
|
|
971
|
+
}, gt = (e) => {
|
|
459
972
|
switch (e) {
|
|
460
|
-
case
|
|
461
|
-
case
|
|
462
|
-
default: return
|
|
973
|
+
case n.Shared: return n.Shared;
|
|
974
|
+
case n.Organization: return n.Organization;
|
|
975
|
+
default: return n.MyChats;
|
|
463
976
|
}
|
|
464
|
-
},
|
|
977
|
+
}, _t = (e, t) => {
|
|
465
978
|
let n = null;
|
|
466
|
-
for (let r of e) if (r.kind ===
|
|
467
|
-
else if (r.item.id === t) return n;
|
|
979
|
+
for (let r of e) if (r.kind === Z.Header) n = r.groupKey;
|
|
980
|
+
else if (r.kind === Z.Item && r.item.id === t) return n;
|
|
468
981
|
return null;
|
|
469
|
-
},
|
|
982
|
+
}, vt = (e, t, r) => {
|
|
470
983
|
let i = /* @__PURE__ */ new Set();
|
|
471
|
-
if (
|
|
984
|
+
if (t != null && i.add(t), t === n.Pinned) {
|
|
472
985
|
let t = r.find((t) => t.id === e);
|
|
473
|
-
t && i.add(
|
|
474
|
-
} else i.add(
|
|
986
|
+
t && i.add(gt(t.source));
|
|
987
|
+
} else i.add(n.Pinned);
|
|
475
988
|
return i;
|
|
476
|
-
},
|
|
989
|
+
}, yt = (e, t, n, r) => {
|
|
477
990
|
let i = e.currentTarget.getBoundingClientRect();
|
|
478
991
|
if (e.clientY >= i.top + i.height / 2) return t;
|
|
479
992
|
let a = null, o = !1;
|
|
480
|
-
for (let e of n) if (e.kind ===
|
|
481
|
-
else if (o) {
|
|
993
|
+
for (let e of n) if (e.kind === Z.Header) o = e.groupKey === r;
|
|
994
|
+
else if (e.kind === Z.Item && o) {
|
|
482
995
|
if (e.item.id === t) return a;
|
|
483
996
|
a = e.item.id;
|
|
484
997
|
}
|
|
485
998
|
return null;
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
value: t.All,
|
|
489
|
-
labelKey: "all"
|
|
490
|
-
},
|
|
491
|
-
{
|
|
492
|
-
value: t.MyChats,
|
|
493
|
-
labelKey: "myChats"
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
value: t.Shared,
|
|
497
|
-
labelKey: "shared"
|
|
498
|
-
},
|
|
499
|
-
{
|
|
500
|
-
value: t.Organization,
|
|
501
|
-
labelKey: "organization"
|
|
502
|
-
}
|
|
503
|
-
], Oe = k(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => /* @__PURE__ */ I(v, {
|
|
504
|
-
items: N(() => De.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
|
|
505
|
-
value: e,
|
|
506
|
-
label: t[n]
|
|
507
|
-
})), [t, i]),
|
|
508
|
-
value: e,
|
|
509
|
-
onChange: n,
|
|
510
|
-
stretch: !0,
|
|
511
|
-
"aria-label": t.groupAriaLabel ?? "Filter chats",
|
|
512
|
-
className: "px-3 py-2",
|
|
513
|
-
chipClassName: D("!px-2", r)
|
|
514
|
-
})), ke = { button: "_button_vjird_1" }, Ae = k(({ label: e, onClick: t, labelClassName: r = "dial-small-semi-text", colors: a, className: o }) => /* @__PURE__ */ I("div", {
|
|
515
|
-
className: "px-3 py-2",
|
|
516
|
-
style: n({
|
|
517
|
-
"--cp-new-chat-bg": a?.background,
|
|
518
|
-
"--cp-new-chat-text": a?.text,
|
|
519
|
-
"--cp-new-chat-focus-outline": a?.focusOutline
|
|
520
|
-
}),
|
|
521
|
-
children: /* @__PURE__ */ I(d, {
|
|
522
|
-
label: e,
|
|
523
|
-
textClassName: r,
|
|
524
|
-
iconBefore: /* @__PURE__ */ I(ae, {
|
|
525
|
-
size: 18,
|
|
526
|
-
stroke: m,
|
|
527
|
-
className: "shrink-0",
|
|
528
|
-
"aria-hidden": !0
|
|
529
|
-
}),
|
|
530
|
-
onClick: t,
|
|
531
|
-
className: i("h-[36px] w-full gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", ke.button, o, se.newChatButton)
|
|
532
|
-
})
|
|
533
|
-
})), Z = {
|
|
999
|
+
}, $ = {
|
|
534
1000
|
skeletonColor: "var(--cp-skeleton-color, var(--bg-control-disable-primary, #dce0e8))",
|
|
535
|
-
item: "
|
|
536
|
-
itemActive: "
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
1001
|
+
item: "_item_slsie_2",
|
|
1002
|
+
itemActive: "_itemActive_slsie_17",
|
|
1003
|
+
row: "_row_slsie_27",
|
|
1004
|
+
itemIndicator: "_itemIndicator_slsie_35",
|
|
1005
|
+
indicatorDot: "_indicatorDot_slsie_39",
|
|
1006
|
+
groupHeader: "_groupHeader_slsie_43",
|
|
1007
|
+
groupHeaderIndicator: "_groupHeaderIndicator_slsie_48",
|
|
1008
|
+
dropZoneActive: "_dropZoneActive_slsie_52",
|
|
1009
|
+
trigger: "_trigger_slsie_57",
|
|
1010
|
+
triggerActive: "_triggerActive_slsie_58",
|
|
1011
|
+
triggerIcon: "_triggerIcon_slsie_61",
|
|
1012
|
+
unreadDot: "_unreadDot_slsie_70",
|
|
1013
|
+
search: "_search_slsie_78",
|
|
1014
|
+
list: "_list_slsie_89"
|
|
1015
|
+
}, bt = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: i = "dial-tiny-lead-text", variant: o = X.Avatar, dropZoneGroupKey: s, isDragOver: c, onDragOver: l, onDragLeave: u, onDrop: d }) => {
|
|
1016
|
+
let f = s != null, p = o === X.Indicator;
|
|
1017
|
+
return /* @__PURE__ */ G("button", {
|
|
546
1018
|
type: "button",
|
|
547
1019
|
"aria-expanded": t,
|
|
548
1020
|
"aria-controls": r,
|
|
549
1021
|
onClick: n,
|
|
550
|
-
onDragOver:
|
|
551
|
-
|
|
1022
|
+
onDragOver: f ? (e) => {
|
|
1023
|
+
f && (e.preventDefault(), l?.(s));
|
|
552
1024
|
} : void 0,
|
|
553
|
-
onDragLeave:
|
|
554
|
-
|
|
1025
|
+
onDragLeave: f ? (e) => {
|
|
1026
|
+
f && (e.currentTarget.contains(e.relatedTarget) || u?.());
|
|
555
1027
|
} : void 0,
|
|
556
|
-
onDrop:
|
|
557
|
-
|
|
1028
|
+
onDrop: f ? (e) => {
|
|
1029
|
+
f && (e.preventDefault(), d?.(s, s, null));
|
|
558
1030
|
} : void 0,
|
|
559
|
-
className:
|
|
560
|
-
children: [
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
1031
|
+
className: a("group flex h-6 w-full items-center gap-1 rounded text-start", p ? "px-2" : "py-1 pe-3", i, $.groupHeader, p && $.groupHeaderIndicator, c && $.dropZoneActive),
|
|
1032
|
+
children: [
|
|
1033
|
+
!p && (t ? /* @__PURE__ */ W(K, {
|
|
1034
|
+
size: 12,
|
|
1035
|
+
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
1036
|
+
"aria-hidden": !0
|
|
1037
|
+
}) : /* @__PURE__ */ W(ie, {
|
|
1038
|
+
size: 12,
|
|
1039
|
+
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
|
|
1040
|
+
"aria-hidden": !0
|
|
1041
|
+
})),
|
|
1042
|
+
p ? /* @__PURE__ */ W("span", {
|
|
1043
|
+
className: "max-w-full min-w-0",
|
|
1044
|
+
children: /* @__PURE__ */ W(v, { text: e })
|
|
1045
|
+
}) : /* @__PURE__ */ W(v, { text: e }),
|
|
1046
|
+
p && (t ? /* @__PURE__ */ W(ae, {
|
|
1047
|
+
size: m.SM,
|
|
1048
|
+
stroke: h,
|
|
1049
|
+
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
1050
|
+
"aria-hidden": !0
|
|
1051
|
+
}) : /* @__PURE__ */ W(oe, {
|
|
1052
|
+
size: m.SM,
|
|
1053
|
+
stroke: h,
|
|
1054
|
+
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
|
|
1055
|
+
"aria-hidden": !0
|
|
1056
|
+
}))
|
|
1057
|
+
]
|
|
1058
|
+
});
|
|
1059
|
+
}, xt = (e, t, n) => {
|
|
1060
|
+
let [r, i] = H(!1), a = B(() => t?.(e) ?? [], [t, e]), o = L((t) => n?.(e, t), [n, e]);
|
|
1061
|
+
return {
|
|
1062
|
+
menuItems: a,
|
|
1063
|
+
hasActions: a.length > 0,
|
|
1064
|
+
isMenuOpen: r,
|
|
1065
|
+
handleOpenChange: i,
|
|
1066
|
+
handleOpen: o
|
|
1067
|
+
};
|
|
1068
|
+
}, St = I(({ items: e, isOpen: t, onOpenChange: n, onOpen: r, actionsLabel: i, variant: o = X.Indicator }) => {
|
|
1069
|
+
let s = o === X.Indicator, c = V(null), l = L((e) => {
|
|
1070
|
+
n(e), e && c.current && r?.(c.current);
|
|
1071
|
+
}, [n, r]);
|
|
1072
|
+
return /* @__PURE__ */ W("div", {
|
|
1073
|
+
className: a("absolute inset-y-0 flex items-center", s ? "inset-e-2" : "inset-e-1", t ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
|
|
1074
|
+
children: /* @__PURE__ */ W(g, {
|
|
1075
|
+
items: e,
|
|
1076
|
+
onOpenChange: l,
|
|
1077
|
+
matchReferenceWidth: !1,
|
|
1078
|
+
listClassName: "w-[200px]",
|
|
1079
|
+
children: /* @__PURE__ */ W(b, {
|
|
1080
|
+
ref: c,
|
|
1081
|
+
icon: /* @__PURE__ */ W(se, {
|
|
1082
|
+
size: s ? m.SM : m.MD,
|
|
1083
|
+
className: $.triggerIcon,
|
|
1084
|
+
"aria-hidden": !0,
|
|
1085
|
+
stroke: h
|
|
1086
|
+
}),
|
|
1087
|
+
size: _.Small,
|
|
1088
|
+
"aria-label": i,
|
|
1089
|
+
className: a(s && "size-6! min-h-0! min-w-0! p-1!", $.trigger, t && $.triggerActive)
|
|
1090
|
+
})
|
|
1091
|
+
})
|
|
569
1092
|
});
|
|
570
|
-
},
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
1093
|
+
}), Ct = ({ href: e, onSelect: t, "aria-label": n, ...r }) => /* @__PURE__ */ W("a", {
|
|
1094
|
+
href: e,
|
|
1095
|
+
"aria-label": e ? n : void 0,
|
|
1096
|
+
className: "contents",
|
|
1097
|
+
onClick: (n) => {
|
|
1098
|
+
e && (n.preventDefault(), t());
|
|
1099
|
+
},
|
|
1100
|
+
children: /* @__PURE__ */ W(f, {
|
|
1101
|
+
...r,
|
|
1102
|
+
"aria-label": n,
|
|
1103
|
+
onClick: e ? void 0 : t,
|
|
1104
|
+
tabIndex: e ? -1 : void 0
|
|
1105
|
+
})
|
|
1106
|
+
}), wt = I(({ item: e, isActive: n, onSelectConversation: r, searchQuery: i = "", getActions: o, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", unreadItemTitleClassName: u = "dial-small-semi-text", itemIconBadgeClassName: d, unreadIndicatorLabel: f = "Unread", variant: p = X.Avatar, nesting: h, rowGroupKey: g, rows: _, draggingId: v, dragOverId: y, allowedDropGroups: b, onDragStart: S, onDragEnd: C, onDragOver: w, onDragLeave: T, onDrop: E }) => {
|
|
1107
|
+
let { menuItems: D, hasActions: O, isMenuOpen: k, handleOpenChange: M, handleOpen: N } = xt(e, o, s), P = B(() => ({ tooltip: e.iconTooltip }), [e.iconTooltip]), F = B(() => ({ badgeClassName: d }), [d]), I = p === X.Indicator, R = e.leadingIcon ? /* @__PURE__ */ W("span", {
|
|
574
1108
|
className: "flex size-6 shrink-0 items-center justify-center",
|
|
575
|
-
children:
|
|
576
|
-
}) :
|
|
577
|
-
variant:
|
|
578
|
-
width:
|
|
579
|
-
height:
|
|
580
|
-
color:
|
|
1109
|
+
children: e.leadingIcon
|
|
1110
|
+
}) : e.isIconLoading ? /* @__PURE__ */ W(A, {
|
|
1111
|
+
variant: j.Circular,
|
|
1112
|
+
width: m.LG,
|
|
1113
|
+
height: m.LG,
|
|
1114
|
+
color: $.skeletonColor,
|
|
581
1115
|
"aria-hidden": !0
|
|
582
|
-
}) : /* @__PURE__ */
|
|
583
|
-
src:
|
|
584
|
-
size:
|
|
585
|
-
initialsName:
|
|
586
|
-
labels:
|
|
587
|
-
styles:
|
|
588
|
-
}),
|
|
1116
|
+
}) : /* @__PURE__ */ W(t, {
|
|
1117
|
+
src: e.iconUrl,
|
|
1118
|
+
size: m.LG,
|
|
1119
|
+
initialsName: e.iconTooltip ?? "",
|
|
1120
|
+
labels: P,
|
|
1121
|
+
styles: F
|
|
1122
|
+
}), ee = st(O, k, p), te = /* @__PURE__ */ G("span", {
|
|
589
1123
|
className: "flex size-6 shrink-0 items-center justify-center",
|
|
590
|
-
children: [/* @__PURE__ */
|
|
591
|
-
className:
|
|
1124
|
+
children: [/* @__PURE__ */ W("span", {
|
|
1125
|
+
className: a("size-[7.11px] rounded-full", e.isUnread ? $.unreadDot : $.indicatorDot),
|
|
592
1126
|
"aria-hidden": !0
|
|
593
|
-
}), /* @__PURE__ */
|
|
1127
|
+
}), e.isUnread && /* @__PURE__ */ W("span", {
|
|
594
1128
|
className: "sr-only",
|
|
595
1129
|
children: f
|
|
596
1130
|
})]
|
|
597
|
-
})
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
1131
|
+
}), z = e.isUnread && !I ? /* @__PURE__ */ G("span", {
|
|
1132
|
+
className: "flex size-6 shrink-0 items-center justify-center",
|
|
1133
|
+
children: [/* @__PURE__ */ W("span", {
|
|
1134
|
+
className: a("size-[7.11px] rounded-full", $.unreadDot, O && (k ? "opacity-0" : "group-focus-within/conversation:opacity-0 group-hover/conversation:opacity-0")),
|
|
1135
|
+
"aria-hidden": !0
|
|
1136
|
+
}), /* @__PURE__ */ W("span", {
|
|
1137
|
+
className: "sr-only",
|
|
1138
|
+
children: f
|
|
1139
|
+
})]
|
|
1140
|
+
}) : void 0, V = g != null, H = L((e) => {
|
|
1141
|
+
e.currentTarget.contains(e.relatedTarget) || T?.();
|
|
1142
|
+
}, [T]), U = L((t) => {
|
|
1143
|
+
if (!g || !_ || !E) return;
|
|
1144
|
+
t.preventDefault();
|
|
1145
|
+
let n = yt(t, e.id, _, g);
|
|
1146
|
+
E(e.id, g, n);
|
|
604
1147
|
}, [
|
|
605
|
-
|
|
606
|
-
v,
|
|
1148
|
+
e.id,
|
|
607
1149
|
_,
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
1150
|
+
g,
|
|
1151
|
+
E
|
|
1152
|
+
]), ne = e.id === v, re = e.id === y, K = g != null && (b?.has(g) ?? !1), ie = v != null, ae = h ? ct(h) : void 0;
|
|
1153
|
+
return /* @__PURE__ */ G("li", {
|
|
1154
|
+
...ae,
|
|
1155
|
+
className: a("group/conversation relative", $.row, ae?.className, ne && "cursor-grabbing opacity-50", re && K && "rounded", re && K && $.dropZoneActive, ie && !ne && !K && "cursor-not-allowed"),
|
|
1156
|
+
draggable: V || void 0,
|
|
1157
|
+
onDragStart: V ? () => S?.(e.id) : void 0,
|
|
1158
|
+
onDragEnd: V ? C : void 0,
|
|
1159
|
+
onDragOver: V ? (t) => {
|
|
1160
|
+
t.preventDefault(), w?.(e.id);
|
|
617
1161
|
} : void 0,
|
|
618
|
-
onDragLeave:
|
|
619
|
-
onDrop:
|
|
620
|
-
children: [/* @__PURE__ */
|
|
621
|
-
href:
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
1162
|
+
onDragLeave: V ? H : void 0,
|
|
1163
|
+
onDrop: V ? U : void 0,
|
|
1164
|
+
children: [/* @__PURE__ */ W(Ct, {
|
|
1165
|
+
href: e.href,
|
|
1166
|
+
onSelect: () => r(e.id),
|
|
1167
|
+
iconBefore: I ? te : R,
|
|
1168
|
+
label: /* @__PURE__ */ W(x, {
|
|
1169
|
+
text: e.title,
|
|
1170
|
+
query: i,
|
|
1171
|
+
className: e.isUnread ? u : l,
|
|
1172
|
+
maxLines: 1
|
|
1173
|
+
}),
|
|
1174
|
+
iconAfter: z,
|
|
1175
|
+
textClassName: "min-w-0 flex-1",
|
|
1176
|
+
"aria-current": n ? "page" : void 0,
|
|
1177
|
+
className: a("h-8 w-full justify-start py-2 after:pointer-events-none", I ? "gap-0.5 ps-2" : "gap-2 ps-3", ee, $.item, I && $.itemIndicator, n && $.itemActive, k && $.itemActive)
|
|
1178
|
+
}), O && /* @__PURE__ */ W(St, {
|
|
1179
|
+
items: D,
|
|
1180
|
+
isOpen: k,
|
|
1181
|
+
onOpenChange: M,
|
|
1182
|
+
onOpen: N,
|
|
1183
|
+
actionsLabel: c,
|
|
1184
|
+
variant: p
|
|
1185
|
+
})]
|
|
1186
|
+
});
|
|
1187
|
+
}), Tt = I(({ project: e, isActive: t, isExpanded: n = !0, listId: r, onSelectProject: i, onToggleProject: o, searchQuery: s = "", getActions: c, onActionMenuOpen: l, actionsLabel: u = "More actions", expandLabel: d = "Expand project", collapseLabel: f = "Collapse project", unreadIndicatorLabel: p = "Unread", titleClassName: g = "dial-small-text" }) => {
|
|
1188
|
+
let { menuItems: v, hasActions: y, isMenuOpen: S, handleOpenChange: C, handleOpen: w } = xt(e, c, l), T = o != null, E = (e) => e.preventDefault(), D = !n && e.conversations.some((e) => e.isUnread) ? /* @__PURE__ */ G("span", {
|
|
1189
|
+
className: "flex size-6 shrink-0 items-center justify-center",
|
|
1190
|
+
children: [/* @__PURE__ */ W("span", {
|
|
1191
|
+
className: a("size-[7.11px] rounded-full", $.unreadDot, y && (S ? "opacity-0" : "group-focus-within/conversation:opacity-0 group-hover/conversation:opacity-0")),
|
|
1192
|
+
"aria-hidden": !0
|
|
1193
|
+
}), /* @__PURE__ */ W("span", {
|
|
1194
|
+
className: "sr-only",
|
|
1195
|
+
children: p
|
|
1196
|
+
})]
|
|
1197
|
+
}) : void 0;
|
|
1198
|
+
return /* @__PURE__ */ G("li", {
|
|
1199
|
+
"aria-level": 1,
|
|
1200
|
+
className: a("group/conversation relative", $.row),
|
|
1201
|
+
children: [
|
|
1202
|
+
/* @__PURE__ */ W(Ct, {
|
|
1203
|
+
href: e.href,
|
|
1204
|
+
onSelect: () => i(e.id),
|
|
1205
|
+
iconBefore: /* @__PURE__ */ W("span", {
|
|
1206
|
+
className: a("flex size-6 shrink-0 items-center justify-center", T && (S ? "opacity-0" : "group-focus-within/conversation:opacity-0 group-hover/conversation:opacity-0 mobile:opacity-0")),
|
|
1207
|
+
children: /* @__PURE__ */ W(re, {
|
|
1208
|
+
size: m.SM,
|
|
1209
|
+
stroke: h,
|
|
1210
|
+
className: Q.projectIcon,
|
|
1211
|
+
"aria-hidden": !0
|
|
1212
|
+
})
|
|
1213
|
+
}),
|
|
1214
|
+
label: /* @__PURE__ */ W(x, {
|
|
1215
|
+
text: e.name,
|
|
1216
|
+
query: s,
|
|
1217
|
+
className: g,
|
|
632
1218
|
maxLines: 1
|
|
633
1219
|
}),
|
|
634
|
-
iconAfter:
|
|
1220
|
+
iconAfter: D,
|
|
635
1221
|
textClassName: "min-w-0 flex-1",
|
|
636
|
-
"aria-current":
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
"aria-hidden": !0,
|
|
654
|
-
stroke: m
|
|
1222
|
+
"aria-current": t ? "page" : void 0,
|
|
1223
|
+
className: a("h-8 w-full justify-start gap-0.5 py-2 ps-2 after:pointer-events-none", st(y, S, X.Indicator), $.item, $.itemIndicator, (t || S) && $.itemActive)
|
|
1224
|
+
}),
|
|
1225
|
+
T && /* @__PURE__ */ W("div", {
|
|
1226
|
+
className: a("absolute inset-y-0 inset-s-2 flex items-center", S ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100 mobile:opacity-100"),
|
|
1227
|
+
children: /* @__PURE__ */ W(b, {
|
|
1228
|
+
type: "button",
|
|
1229
|
+
icon: n ? /* @__PURE__ */ W(ae, {
|
|
1230
|
+
size: m.SM,
|
|
1231
|
+
stroke: h,
|
|
1232
|
+
className: Q.projectIcon,
|
|
1233
|
+
"aria-hidden": !0
|
|
1234
|
+
}) : /* @__PURE__ */ W(oe, {
|
|
1235
|
+
size: m.SM,
|
|
1236
|
+
stroke: h,
|
|
1237
|
+
className: a(Q.projectIcon, "rtl:scale-x-[-1]"),
|
|
1238
|
+
"aria-hidden": !0
|
|
655
1239
|
}),
|
|
656
|
-
size:
|
|
657
|
-
"aria-label":
|
|
658
|
-
|
|
1240
|
+
size: _.Small,
|
|
1241
|
+
"aria-label": n ? f : d,
|
|
1242
|
+
"aria-expanded": n,
|
|
1243
|
+
"aria-controls": r,
|
|
1244
|
+
className: a("size-6! min-h-0! min-w-0! rounded-full! p-1!", $.trigger, Q.chevron),
|
|
1245
|
+
onMouseDown: E,
|
|
1246
|
+
onClick: () => o(e.id, !n)
|
|
659
1247
|
})
|
|
1248
|
+
}),
|
|
1249
|
+
y && /* @__PURE__ */ W(St, {
|
|
1250
|
+
items: v,
|
|
1251
|
+
isOpen: S,
|
|
1252
|
+
onOpenChange: C,
|
|
1253
|
+
onOpen: w,
|
|
1254
|
+
actionsLabel: u
|
|
660
1255
|
})
|
|
1256
|
+
]
|
|
1257
|
+
});
|
|
1258
|
+
}), Et = (e) => `See all chats in ${e}`, Dt = I(({ project: e, position: t, onSeeAll: n, label: r = "See all", ariaLabel: i = Et, getActions: o, onActionMenuOpen: s, actionsLabel: c = "More actions", titleClassName: l = "dial-small-text" }) => {
|
|
1259
|
+
let { menuItems: u, hasActions: d, isMenuOpen: f, handleOpenChange: p, handleOpen: m } = xt(e, o, s), h = ct(t);
|
|
1260
|
+
return /* @__PURE__ */ G("li", {
|
|
1261
|
+
...h,
|
|
1262
|
+
className: a("group/conversation relative", $.row, h.className),
|
|
1263
|
+
children: [/* @__PURE__ */ W(Ct, {
|
|
1264
|
+
href: e.href,
|
|
1265
|
+
onSelect: () => n(e.id),
|
|
1266
|
+
label: /* @__PURE__ */ W("span", {
|
|
1267
|
+
className: a("block truncate text-start", l, Q.seeAllText),
|
|
1268
|
+
children: r
|
|
1269
|
+
}),
|
|
1270
|
+
"aria-label": i(e.name),
|
|
1271
|
+
textClassName: "min-w-0 flex-1",
|
|
1272
|
+
className: a("h-8 w-full justify-start py-2 ps-2 after:pointer-events-none", st(d, f, X.Indicator), $.item, $.itemIndicator, f && $.itemActive)
|
|
1273
|
+
}), d && /* @__PURE__ */ W(St, {
|
|
1274
|
+
items: u,
|
|
1275
|
+
isOpen: f,
|
|
1276
|
+
onOpenChange: p,
|
|
1277
|
+
onOpen: m,
|
|
1278
|
+
actionsLabel: c
|
|
661
1279
|
})]
|
|
662
1280
|
});
|
|
663
|
-
}),
|
|
664
|
-
let
|
|
665
|
-
if (
|
|
666
|
-
let r =
|
|
667
|
-
return /* @__PURE__ */
|
|
668
|
-
role: "
|
|
669
|
-
style:
|
|
670
|
-
className: e
|
|
671
|
-
children: /* @__PURE__ */
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
1281
|
+
}), Ot = (e, t) => t ? e === 0 ? "pt-2" : "pt-4" : e === 0 ? "pt-0" : "pt-8", kt = ({ index: e, style: t, rows: r, expandedGroups: i, onToggleGroup: a, listId: o, activeConversationId: s, searchQuery: c, onSelectConversation: l, getActions: u, onActionMenuOpen: d, actionsLabel: f, unreadIndicatorLabel: p, activeProjectId: m, onSelectProject: h, onSelectProjectConversation: g, onSeeAll: _, getProjectActions: v, onProjectActionMenuOpen: y, seeAllLabel: b, seeAllAriaLabel: x, onToggleProject: S, expandProjectLabel: C, collapseProjectLabel: w, styles: T, rowVariant: E = X.Avatar, projectConversationVariant: D = X.Indicator, draggingId: O, dragOverId: k, allowedDropGroups: A, onDragStart: j, onDragEnd: M, onDragOver: N, onDragLeave: P, onDrop: F }) => {
|
|
1282
|
+
let I = r[e], L = E === X.Indicator;
|
|
1283
|
+
if (I.kind === Z.Header) {
|
|
1284
|
+
let r = I.groupKey === n.Pinned;
|
|
1285
|
+
return /* @__PURE__ */ W("div", {
|
|
1286
|
+
role: "listitem",
|
|
1287
|
+
style: t,
|
|
1288
|
+
className: Ot(e, L),
|
|
1289
|
+
children: /* @__PURE__ */ W(bt, {
|
|
1290
|
+
variant: E,
|
|
1291
|
+
label: I.label,
|
|
1292
|
+
isExpanded: i.has(I.groupKey),
|
|
1293
|
+
onToggle: () => a(I.groupKey),
|
|
675
1294
|
listId: o,
|
|
676
|
-
className:
|
|
677
|
-
dropZoneGroupKey: r ?
|
|
678
|
-
isDragOver: r &&
|
|
679
|
-
onDragOver: r ?
|
|
680
|
-
onDragLeave: r ?
|
|
681
|
-
onDrop: r ?
|
|
1295
|
+
className: T?.groupHeaderClassName,
|
|
1296
|
+
dropZoneGroupKey: r ? n.Pinned : void 0,
|
|
1297
|
+
isDragOver: r && k === n.Pinned,
|
|
1298
|
+
onDragOver: r ? N : void 0,
|
|
1299
|
+
onDragLeave: r ? P : void 0,
|
|
1300
|
+
onDrop: r ? F : void 0
|
|
682
1301
|
})
|
|
683
1302
|
});
|
|
684
1303
|
}
|
|
685
|
-
return /* @__PURE__ */
|
|
1304
|
+
return I.kind === Z.Project ? /* @__PURE__ */ W("div", {
|
|
1305
|
+
role: "presentation",
|
|
1306
|
+
style: t,
|
|
1307
|
+
className: "pt-0.5",
|
|
1308
|
+
children: /* @__PURE__ */ W(Tt, {
|
|
1309
|
+
project: I.project,
|
|
1310
|
+
isActive: I.project.id === m,
|
|
1311
|
+
isExpanded: I.isExpanded,
|
|
1312
|
+
listId: o,
|
|
1313
|
+
onSelectProject: h,
|
|
1314
|
+
onToggleProject: S,
|
|
1315
|
+
searchQuery: c,
|
|
1316
|
+
getActions: v,
|
|
1317
|
+
onActionMenuOpen: y,
|
|
1318
|
+
actionsLabel: f,
|
|
1319
|
+
expandLabel: C,
|
|
1320
|
+
collapseLabel: w,
|
|
1321
|
+
unreadIndicatorLabel: p,
|
|
1322
|
+
titleClassName: T?.itemTitleClassName
|
|
1323
|
+
})
|
|
1324
|
+
}) : I.kind === Z.ProjectSeeAll ? /* @__PURE__ */ W("div", {
|
|
1325
|
+
role: "presentation",
|
|
1326
|
+
style: t,
|
|
1327
|
+
className: "pt-0.5",
|
|
1328
|
+
children: /* @__PURE__ */ W(Dt, {
|
|
1329
|
+
project: I.project,
|
|
1330
|
+
position: I,
|
|
1331
|
+
onSeeAll: _,
|
|
1332
|
+
label: b,
|
|
1333
|
+
ariaLabel: x,
|
|
1334
|
+
getActions: v,
|
|
1335
|
+
onActionMenuOpen: y,
|
|
1336
|
+
actionsLabel: f,
|
|
1337
|
+
titleClassName: T?.itemTitleClassName
|
|
1338
|
+
})
|
|
1339
|
+
}) : I.kind === Z.ProjectConversation ? /* @__PURE__ */ W("div", {
|
|
1340
|
+
role: "presentation",
|
|
1341
|
+
style: t,
|
|
1342
|
+
className: "pt-0.5",
|
|
1343
|
+
children: /* @__PURE__ */ W(wt, {
|
|
1344
|
+
variant: D,
|
|
1345
|
+
nesting: I,
|
|
1346
|
+
item: I.item,
|
|
1347
|
+
isActive: I.item.id === s,
|
|
1348
|
+
searchQuery: c,
|
|
1349
|
+
onSelectConversation: g,
|
|
1350
|
+
unreadIndicatorLabel: p,
|
|
1351
|
+
itemTitleClassName: T?.itemTitleClassName,
|
|
1352
|
+
unreadItemTitleClassName: T?.unreadItemTitleClassName,
|
|
1353
|
+
itemIconBadgeClassName: T?.itemIconBadgeClassName
|
|
1354
|
+
})
|
|
1355
|
+
}) : /* @__PURE__ */ W("div", {
|
|
686
1356
|
role: "presentation",
|
|
687
|
-
style:
|
|
688
|
-
className: "pt-1",
|
|
689
|
-
children: /* @__PURE__ */
|
|
690
|
-
|
|
691
|
-
|
|
1357
|
+
style: t,
|
|
1358
|
+
className: L ? "pt-0.5" : "pt-1",
|
|
1359
|
+
children: /* @__PURE__ */ W(wt, {
|
|
1360
|
+
variant: E,
|
|
1361
|
+
item: I.item,
|
|
1362
|
+
isActive: I.item.id === s,
|
|
692
1363
|
searchQuery: c,
|
|
693
1364
|
onSelectConversation: l,
|
|
694
1365
|
getActions: u,
|
|
695
1366
|
onActionMenuOpen: d,
|
|
696
1367
|
actionsLabel: f,
|
|
697
1368
|
unreadIndicatorLabel: p,
|
|
698
|
-
itemTitleClassName:
|
|
699
|
-
|
|
700
|
-
|
|
1369
|
+
itemTitleClassName: T?.itemTitleClassName,
|
|
1370
|
+
unreadItemTitleClassName: T?.unreadItemTitleClassName,
|
|
1371
|
+
itemIconBadgeClassName: T?.itemIconBadgeClassName,
|
|
1372
|
+
rowGroupKey: I.groupKey,
|
|
701
1373
|
rows: r,
|
|
702
|
-
draggingId:
|
|
703
|
-
dragOverId:
|
|
704
|
-
allowedDropGroups:
|
|
705
|
-
onDragStart:
|
|
706
|
-
onDragEnd:
|
|
707
|
-
onDragOver:
|
|
708
|
-
onDragLeave:
|
|
709
|
-
onDrop:
|
|
1374
|
+
draggingId: O,
|
|
1375
|
+
dragOverId: k,
|
|
1376
|
+
allowedDropGroups: A,
|
|
1377
|
+
onDragStart: j,
|
|
1378
|
+
onDragEnd: M,
|
|
1379
|
+
onDragOver: N,
|
|
1380
|
+
onDragLeave: P,
|
|
1381
|
+
onDrop: F
|
|
710
1382
|
})
|
|
711
1383
|
});
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
]),
|
|
718
|
-
let { colors: D, typography: O,
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
let J = N(() => E?.length ? e.filter((e) => e.source == null || !E.includes(e.source)) : e, [e, E]), [Y, fe] = F(() => Ie), [pe, me] = F(5), he = te(), ge = P(null), ye = P(null), [xe, Ce] = F(null), [Ee, De] = F(null), [ke, je] = F(null), Me = P(null), Le = P(null), Re = A(({ height: e }) => {
|
|
723
|
-
me(Se(e));
|
|
724
|
-
}, []), ze = A((e) => {
|
|
725
|
-
ue(e ?? "");
|
|
726
|
-
}, []), Be = A((e) => {
|
|
727
|
-
fe((t) => {
|
|
1384
|
+
}, At = /* @__PURE__ */ new Set([
|
|
1385
|
+
n.Pinned,
|
|
1386
|
+
n.MyChats,
|
|
1387
|
+
n.Shared,
|
|
1388
|
+
n.Organization
|
|
1389
|
+
]), jt = [], Mt = I(({ conversations: e, isLoading: t, isUpdatingTitles: i = !1, preserveActiveSearchResult: o = !1, onSelectConversation: s, activeConversationId: u, labels: d, searchQuery: f = "", activeFilter: p = n.All, activeTypeFilter: m = Y.All, hiddenSources: h, rowVariant: g, getActions: _, onActionMenuOpen: v, onMoveConversation: y, onVisibleConversationIdsChange: b, pinnedProjects: x, styles: S, id: T, className: E }) => {
|
|
1390
|
+
let { colors: D, typography: O, itemIconBadgeClassName: k } = S ?? {}, { emptyLabel: j, emptyDescription: M, noResultsLabel: N, noResultsDescription: P, sharedEmptyDescription: F = P, tabEmptyLabels: I, loadingLabel: te = "Loading conversations", updatingTitlesLabel: z = "Updating conversation names", groupLabels: U, actionsLabel: ne, unreadIndicatorLabel: re, seeAllLabel: K, seeAllAriaLabel: ie, expandProjectLabel: ae, collapseProjectLabel: oe } = d, { projects: se, onSelectProject: ce, onSelectConversation: le, onSeeAll: ue, onToggleProject: de, getActions: fe, onActionMenuOpen: q, activeProjectId: me, conversationRowVariant: he } = x ?? {}, ge = B(() => h?.length ? e.filter((e) => e.source == null || !h.includes(e.source)) : e, [e, h]), [J, _e] = H(() => At), [ve, ye] = H(5), be = ee(), xe = V(null), Se = V(null), [Ce, we] = H(null), [Te, Ee] = H(null), [De, Oe] = H(null), ke = V(null), Ae = V(null), je = L(({ height: e }) => {
|
|
1391
|
+
ye(dt(e));
|
|
1392
|
+
}, []), Me = L((e) => {
|
|
1393
|
+
_e((t) => {
|
|
728
1394
|
let n = new Set(t);
|
|
729
1395
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
730
1396
|
});
|
|
731
|
-
}, []),
|
|
732
|
-
|
|
733
|
-
}, []),
|
|
734
|
-
let n =
|
|
735
|
-
|
|
736
|
-
}, [
|
|
737
|
-
|
|
738
|
-
}, [
|
|
739
|
-
|
|
740
|
-
}, []),
|
|
741
|
-
|
|
742
|
-
}, []),
|
|
743
|
-
let r =
|
|
744
|
-
|
|
1397
|
+
}, []), Ne = L(() => {
|
|
1398
|
+
ke.current = null, Ae.current = null, we(null), Ee(null), Oe(null);
|
|
1399
|
+
}, []), Pe = L((e, t) => {
|
|
1400
|
+
let n = vt(e, _t(t, e), ge);
|
|
1401
|
+
ke.current = e, Ae.current = n, we(e), Oe(n);
|
|
1402
|
+
}, [ge]), Fe = L(() => {
|
|
1403
|
+
Ne();
|
|
1404
|
+
}, [Ne]), Ie = L((e) => {
|
|
1405
|
+
Ee(e);
|
|
1406
|
+
}, []), Le = L(() => {
|
|
1407
|
+
Ee(null);
|
|
1408
|
+
}, []), Re = L((e, t, n) => {
|
|
1409
|
+
let r = ke.current, i = Ae.current;
|
|
1410
|
+
Ne(), r != null && r !== e && i?.has(t) && y?.({
|
|
745
1411
|
draggedId: r,
|
|
746
1412
|
targetGroupKey: t,
|
|
747
1413
|
afterId: n
|
|
748
1414
|
});
|
|
749
|
-
}, [
|
|
1415
|
+
}, [Ne, y]), ze = r({
|
|
750
1416
|
"--cp-item-hover": D?.itemHover,
|
|
751
1417
|
"--cp-item-active": D?.itemActive,
|
|
752
1418
|
"--cp-text": D?.text,
|
|
753
1419
|
"--cp-text-secondary": D?.textSecondary,
|
|
754
|
-
"--cp-new-chat-bg": k?.background,
|
|
755
|
-
"--cp-new-chat-text": k?.text,
|
|
756
|
-
"--cp-new-chat-focus-outline": k?.focusOutline,
|
|
757
1420
|
"--cp-drop-zone-ring": D?.dropZoneRing,
|
|
758
1421
|
"--cp-trigger-bg": D?.triggerBackground,
|
|
759
1422
|
"--cp-trigger-icon": D?.triggerIcon,
|
|
760
1423
|
"--cp-trigger-icon-idle": D?.triggerIconIdle,
|
|
761
1424
|
"--cp-skeleton-color": D?.skeletonColor,
|
|
762
|
-
"--cp-unread-dot": D?.unreadDot
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
1425
|
+
"--cp-unread-dot": D?.unreadDot,
|
|
1426
|
+
"--cp-indicator-dot": D?.indicatorDot,
|
|
1427
|
+
"--cp-project-guide-line": D?.projectGuideLine,
|
|
1428
|
+
"--cp-list-font-family": O?.fontFamily
|
|
1429
|
+
}), [Be, Ve] = H(null);
|
|
1430
|
+
R(() => {
|
|
1431
|
+
if (!o || !f || !u) {
|
|
1432
|
+
Ve(null);
|
|
1433
|
+
return;
|
|
1434
|
+
}
|
|
1435
|
+
let e = ge.find((e) => e.id === u);
|
|
1436
|
+
Ve((t) => e && it(e, f) ? t?.id === e.id && t.query === f ? t : {
|
|
1437
|
+
id: e.id,
|
|
1438
|
+
query: f
|
|
1439
|
+
} : t?.id === u && t.query === f ? t : null);
|
|
1440
|
+
}, [
|
|
1441
|
+
o,
|
|
1442
|
+
f,
|
|
1443
|
+
u,
|
|
1444
|
+
ge
|
|
1445
|
+
]);
|
|
1446
|
+
let He = L((e) => {
|
|
1447
|
+
o && f && Ve({
|
|
1448
|
+
id: e,
|
|
1449
|
+
query: f
|
|
1450
|
+
}), s(e);
|
|
1451
|
+
}, [
|
|
1452
|
+
o,
|
|
1453
|
+
f,
|
|
1454
|
+
s
|
|
1455
|
+
]), Ue = o && f !== "" && Be?.query === f && Be.id === u ? Be.id : void 0, We = B(() => ge.filter((e) => nt(e, p) && rt(e, m) && (it(e, f) || e.id === Ue)), [
|
|
1456
|
+
ge,
|
|
1457
|
+
p,
|
|
1458
|
+
m,
|
|
1459
|
+
f,
|
|
1460
|
+
Ue
|
|
1461
|
+
]), Ge = B(() => se ? at(se, {
|
|
1462
|
+
searchQuery: f,
|
|
1463
|
+
activeFilter: p,
|
|
1464
|
+
activeTypeFilter: m,
|
|
1465
|
+
hiddenSources: h
|
|
1466
|
+
}) : jt, [
|
|
1467
|
+
se,
|
|
1468
|
+
f,
|
|
1469
|
+
p,
|
|
1470
|
+
m,
|
|
1471
|
+
h
|
|
1472
|
+
]), Ke = B(() => {
|
|
1473
|
+
let e = /* @__PURE__ */ new Map();
|
|
1474
|
+
for (let t of Ge) for (let n of t.conversations) e.set(n.id, t.id);
|
|
1475
|
+
return e;
|
|
1476
|
+
}, [Ge]), qe = L((e) => ce?.(e), [ce]), Je = L((e) => {
|
|
1477
|
+
let t = Ke.get(e);
|
|
1478
|
+
t != null && le?.(e, t);
|
|
1479
|
+
}, [Ke, le]), Ye = L((e) => ue?.(e), [ue]), Xe = B(() => We.filter((e) => e.isPinned), [We]), Ze = B(() => We.filter((e) => !e.isPinned && e.source !== n.Shared && e.source !== n.Organization), [We]), Qe = B(() => We.filter((e) => !e.isPinned && e.source === n.Shared), [We]), $e = B(() => We.filter((e) => !e.isPinned && e.source === n.Organization), [We]), et = B(() => [
|
|
768
1480
|
{
|
|
769
|
-
key:
|
|
770
|
-
label:
|
|
771
|
-
items:
|
|
1481
|
+
key: n.Pinned,
|
|
1482
|
+
label: U?.pinned ?? "Pinned",
|
|
1483
|
+
items: Xe
|
|
772
1484
|
},
|
|
773
1485
|
{
|
|
774
|
-
key:
|
|
775
|
-
label:
|
|
776
|
-
items:
|
|
1486
|
+
key: n.MyChats,
|
|
1487
|
+
label: U?.myChats ?? "My chats",
|
|
1488
|
+
items: Ze
|
|
777
1489
|
},
|
|
778
1490
|
{
|
|
779
|
-
key:
|
|
780
|
-
label:
|
|
781
|
-
items:
|
|
1491
|
+
key: n.Shared,
|
|
1492
|
+
label: U?.shared ?? "Shared",
|
|
1493
|
+
items: Qe
|
|
782
1494
|
},
|
|
783
1495
|
{
|
|
784
|
-
key:
|
|
785
|
-
label:
|
|
786
|
-
items:
|
|
1496
|
+
key: n.Organization,
|
|
1497
|
+
label: U?.organization ?? "Organization",
|
|
1498
|
+
items: $e
|
|
787
1499
|
}
|
|
788
1500
|
], [
|
|
789
|
-
|
|
790
|
-
Je,
|
|
791
|
-
Ye,
|
|
1501
|
+
U,
|
|
792
1502
|
Xe,
|
|
793
|
-
Ze
|
|
794
|
-
|
|
1503
|
+
Ze,
|
|
1504
|
+
Qe,
|
|
1505
|
+
$e
|
|
1506
|
+
]), Q = B(() => {
|
|
795
1507
|
let e = [];
|
|
796
|
-
for (let t of
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
1508
|
+
for (let t of et) {
|
|
1509
|
+
let r = t.key === n.Pinned ? Ge : jt;
|
|
1510
|
+
if ((t.items.length !== 0 || r.length !== 0) && (e.push({
|
|
1511
|
+
kind: Z.Header,
|
|
1512
|
+
groupKey: t.key,
|
|
1513
|
+
label: t.label
|
|
1514
|
+
}), J.has(t.key))) {
|
|
1515
|
+
for (let t of r) e.push(...ht(t, mt(t, f)));
|
|
1516
|
+
for (let n of t.items) e.push({
|
|
1517
|
+
kind: Z.Item,
|
|
1518
|
+
item: n,
|
|
1519
|
+
groupKey: t.key
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
805
1523
|
return e;
|
|
806
|
-
}, [
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
1524
|
+
}, [
|
|
1525
|
+
et,
|
|
1526
|
+
Ge,
|
|
1527
|
+
J,
|
|
1528
|
+
f
|
|
1529
|
+
]);
|
|
1530
|
+
R(() => {
|
|
1531
|
+
if (!u || Se.current === u) return;
|
|
1532
|
+
let e = Q.findIndex((e) => (e.kind === Z.Item || e.kind === Z.ProjectConversation) && e.item.id === u);
|
|
1533
|
+
e >= 0 && (xe.current?.scrollToRow({
|
|
811
1534
|
index: e,
|
|
812
1535
|
align: "smart",
|
|
813
1536
|
behavior: "smooth"
|
|
814
|
-
}),
|
|
1537
|
+
}), Se.current = u);
|
|
815
1538
|
}, [
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
1539
|
+
u,
|
|
1540
|
+
et,
|
|
1541
|
+
J,
|
|
1542
|
+
Q
|
|
820
1543
|
]);
|
|
821
|
-
let
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
}, [
|
|
825
|
-
let
|
|
826
|
-
rows:
|
|
827
|
-
expandedGroups:
|
|
828
|
-
onToggleGroup:
|
|
829
|
-
listId:
|
|
830
|
-
activeConversationId:
|
|
831
|
-
searchQuery:
|
|
832
|
-
onSelectConversation:
|
|
1544
|
+
let st = V(Q);
|
|
1545
|
+
R(() => {
|
|
1546
|
+
st.current = Q;
|
|
1547
|
+
}, [Q]);
|
|
1548
|
+
let ct = L((e) => Pe(e, st.current), [Pe]), ut = B(() => ({
|
|
1549
|
+
rows: Q,
|
|
1550
|
+
expandedGroups: J,
|
|
1551
|
+
onToggleGroup: Me,
|
|
1552
|
+
listId: be,
|
|
1553
|
+
activeConversationId: u,
|
|
1554
|
+
searchQuery: f,
|
|
1555
|
+
onSelectConversation: He,
|
|
833
1556
|
getActions: _,
|
|
834
1557
|
onActionMenuOpen: v,
|
|
835
|
-
actionsLabel:
|
|
836
|
-
unreadIndicatorLabel:
|
|
1558
|
+
actionsLabel: ne,
|
|
1559
|
+
unreadIndicatorLabel: re,
|
|
1560
|
+
activeProjectId: me,
|
|
1561
|
+
onSelectProject: qe,
|
|
1562
|
+
onSelectProjectConversation: Je,
|
|
1563
|
+
onSeeAll: Ye,
|
|
1564
|
+
onToggleProject: de,
|
|
1565
|
+
getProjectActions: fe,
|
|
1566
|
+
onProjectActionMenuOpen: q,
|
|
1567
|
+
seeAllLabel: K,
|
|
1568
|
+
seeAllAriaLabel: ie,
|
|
1569
|
+
expandProjectLabel: ae,
|
|
1570
|
+
collapseProjectLabel: oe,
|
|
1571
|
+
rowVariant: g,
|
|
1572
|
+
projectConversationVariant: he,
|
|
837
1573
|
styles: {
|
|
838
1574
|
groupHeaderClassName: O?.groupHeaderClassName,
|
|
839
1575
|
itemTitleClassName: O?.itemTitleClassName,
|
|
840
|
-
|
|
1576
|
+
unreadItemTitleClassName: O?.unreadItemTitleClassName,
|
|
1577
|
+
itemIconBadgeClassName: k
|
|
841
1578
|
},
|
|
842
|
-
draggingId:
|
|
843
|
-
dragOverId:
|
|
844
|
-
allowedDropGroups:
|
|
845
|
-
onDragStart:
|
|
846
|
-
onDragEnd:
|
|
847
|
-
onDragOver:
|
|
848
|
-
onDragLeave:
|
|
849
|
-
onDrop:
|
|
1579
|
+
draggingId: Ce,
|
|
1580
|
+
dragOverId: Te,
|
|
1581
|
+
allowedDropGroups: De,
|
|
1582
|
+
onDragStart: ct,
|
|
1583
|
+
onDragEnd: Fe,
|
|
1584
|
+
onDragOver: Ie,
|
|
1585
|
+
onDragLeave: Le,
|
|
1586
|
+
onDrop: Re
|
|
850
1587
|
}), [
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
1588
|
+
Q,
|
|
1589
|
+
J,
|
|
1590
|
+
Me,
|
|
1591
|
+
be,
|
|
1592
|
+
u,
|
|
1593
|
+
f,
|
|
1594
|
+
He,
|
|
858
1595
|
_,
|
|
859
1596
|
v,
|
|
860
|
-
|
|
861
|
-
|
|
1597
|
+
ne,
|
|
1598
|
+
re,
|
|
1599
|
+
me,
|
|
1600
|
+
qe,
|
|
1601
|
+
Je,
|
|
1602
|
+
Ye,
|
|
1603
|
+
de,
|
|
1604
|
+
fe,
|
|
1605
|
+
q,
|
|
1606
|
+
K,
|
|
1607
|
+
ie,
|
|
1608
|
+
ae,
|
|
1609
|
+
oe,
|
|
1610
|
+
g,
|
|
1611
|
+
he,
|
|
862
1612
|
O?.groupHeaderClassName,
|
|
863
1613
|
O?.itemTitleClassName,
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
1614
|
+
O?.unreadItemTitleClassName,
|
|
1615
|
+
k,
|
|
1616
|
+
Ce,
|
|
1617
|
+
Te,
|
|
1618
|
+
De,
|
|
1619
|
+
ct,
|
|
1620
|
+
Fe,
|
|
1621
|
+
Ie,
|
|
1622
|
+
Le,
|
|
1623
|
+
Re
|
|
1624
|
+
]), gt = f !== "" || p !== n.All || m !== Y.All, yt = We.length === 0 && Ge.length === 0, bt = yt && gt, xt = yt && !gt, St = bt && f === "" && m === Y.All ? I?.[p] : void 0, Ct = St?.label ?? N, wt = p === n.Shared && f === "" ? F : P, Tt = St?.description ?? wt, Et = !t && !yt, Dt = V(null), Ot = V(null), Mt = V(b);
|
|
1625
|
+
R(() => {
|
|
1626
|
+
Mt.current = b;
|
|
1627
|
+
}, [b]);
|
|
1628
|
+
let Nt = L((e) => {
|
|
1629
|
+
Ot.current && pt(Ot.current, e) || (Ot.current = e, Mt.current?.(e));
|
|
1630
|
+
}, []), Pt = L((e) => {
|
|
1631
|
+
Dt.current = e, Nt(ft(Q, e));
|
|
1632
|
+
}, [Q, Nt]);
|
|
1633
|
+
return R(() => {
|
|
1634
|
+
Et ? Dt.current && Nt(ft(Q, Dt.current)) : (Dt.current = null, Nt([]));
|
|
1635
|
+
}, [
|
|
1636
|
+
Et,
|
|
1637
|
+
Q,
|
|
1638
|
+
Nt
|
|
1639
|
+
]), /* @__PURE__ */ G("div", {
|
|
1640
|
+
id: T,
|
|
1641
|
+
style: ze,
|
|
1642
|
+
className: a("flex-1 overflow-hidden px-3", $.list, O?.fontClassName, g !== X.Indicator && "py-1", E, pe.list),
|
|
1643
|
+
children: [/* @__PURE__ */ W(C, {
|
|
1644
|
+
visuallyHidden: !0,
|
|
1645
|
+
as: w.Span,
|
|
1646
|
+
children: t ? te : i ? z : xt ? j : bt ? Ct : ""
|
|
1647
|
+
}), t ? /* @__PURE__ */ W("div", {
|
|
1648
|
+
className: "flex flex-col gap-3 px-2 py-3",
|
|
1649
|
+
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ W(A, {
|
|
1650
|
+
avatar: { size: 24 },
|
|
1651
|
+
showTitle: { width: ot(t) },
|
|
1652
|
+
paragraph: !1,
|
|
1653
|
+
active: !0,
|
|
1654
|
+
color: $.skeletonColor
|
|
1655
|
+
}, t))
|
|
1656
|
+
}) : xt ? /* @__PURE__ */ W(c, {
|
|
1657
|
+
label: j,
|
|
1658
|
+
description: M
|
|
1659
|
+
}) : bt && f !== "" && i ? /* @__PURE__ */ W(c, { label: z }) : bt ? /* @__PURE__ */ W(l, {
|
|
1660
|
+
label: Ct,
|
|
1661
|
+
description: Tt
|
|
1662
|
+
}) : /* @__PURE__ */ W(tt, {
|
|
1663
|
+
listRef: xe,
|
|
1664
|
+
id: be,
|
|
1665
|
+
role: "list",
|
|
1666
|
+
style: { height: "100%" },
|
|
1667
|
+
rowComponent: kt,
|
|
1668
|
+
rowCount: Q.length,
|
|
1669
|
+
rowHeight: lt,
|
|
1670
|
+
overscanCount: ve,
|
|
1671
|
+
onResize: je,
|
|
1672
|
+
onRowsRendered: Pt,
|
|
1673
|
+
rowProps: ut
|
|
1674
|
+
})]
|
|
1675
|
+
});
|
|
1676
|
+
}), Nt = {
|
|
1677
|
+
title: "_title_mvx21_2",
|
|
1678
|
+
filterValue: "_filterValue_mvx21_12",
|
|
1679
|
+
filterIndicator: "_filterIndicator_mvx21_17"
|
|
1680
|
+
}, Pt = "!size-6 !min-h-0 !min-w-0 !p-1", Ft = [
|
|
1681
|
+
{
|
|
1682
|
+
value: n.All,
|
|
1683
|
+
getLabel: (e) => e.all
|
|
1684
|
+
},
|
|
1685
|
+
{
|
|
1686
|
+
value: n.MyChats,
|
|
1687
|
+
getLabel: (e) => e.personal ?? "Personal"
|
|
1688
|
+
},
|
|
1689
|
+
{
|
|
1690
|
+
value: n.Shared,
|
|
1691
|
+
getLabel: (e) => e.shared
|
|
1692
|
+
},
|
|
1693
|
+
{
|
|
1694
|
+
value: n.Organization,
|
|
1695
|
+
getLabel: (e) => e.organization
|
|
1696
|
+
}
|
|
1697
|
+
], It = [
|
|
1698
|
+
{
|
|
1699
|
+
value: Y.All,
|
|
1700
|
+
getLabel: (e) => e.all
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
value: Y.Chat,
|
|
1704
|
+
getLabel: (e) => e.chat ?? "Chat"
|
|
1705
|
+
},
|
|
1706
|
+
{
|
|
1707
|
+
value: Y.Task,
|
|
1708
|
+
getLabel: (e) => e.task ?? "Task"
|
|
1709
|
+
}
|
|
1710
|
+
], Lt = I(({ labels: e, isExpanded: t = !0, onToggleExpanded: i, controlsId: o, searchQuery: s = "", isSearchOpen: c = !1, onSearchChange: l, onSearchOpenChange: u, activeFilter: d = n.All, onFilterChange: f, activeTypeFilter: p = Y.All, onTypeFilterChange: v, hiddenSources: y, actions: x, styles: S, className: C }) => {
|
|
1711
|
+
let w = S?.typography?.titleClassName ?? "dial-tiny-lead-semi-text", T = S?.typography?.searchTextClassName ?? "dial-tiny-text", D = S?.colors?.filterValue, O = V(null), A = V(null), j = V(c), M = e.filterLabels.groupAriaLabel ?? "Filter chats", N = e.filterActiveLabel ?? "Filters applied", P = ee(), F = d !== n.All || p !== Y.All, I = l != null && u != null;
|
|
1712
|
+
R(() => {
|
|
1713
|
+
c ? A.current?.focus() : j.current && O.current?.focus(), j.current = c;
|
|
1714
|
+
}, [c]);
|
|
1715
|
+
let te = L(() => {
|
|
1716
|
+
u?.(!0);
|
|
1717
|
+
}, [u]), z = L(() => {
|
|
1718
|
+
l?.(""), u?.(!1);
|
|
1719
|
+
}, [l, u]), H = L((e) => {
|
|
1720
|
+
l?.(e ?? "");
|
|
1721
|
+
}, [l]), U = L((e) => {
|
|
1722
|
+
e.key === "Escape" && (e.stopPropagation(), z());
|
|
1723
|
+
}, [z]), re = B(() => {
|
|
1724
|
+
let { filterLabels: t } = e, n = r({ "--cp-list-header-filter-value": D }), i = (e, t) => () => /* @__PURE__ */ G(ne, { children: [/* @__PURE__ */ W("span", {
|
|
1725
|
+
className: "min-w-0 flex-1 truncate text-start",
|
|
1726
|
+
children: e
|
|
1727
|
+
}), /* @__PURE__ */ W("span", {
|
|
1728
|
+
className: a("shrink-0", Nt.filterValue),
|
|
1729
|
+
style: n,
|
|
1730
|
+
children: t
|
|
1731
|
+
})] }), o = [];
|
|
1732
|
+
if (v) {
|
|
1733
|
+
let e = It.map(({ value: e, getLabel: n }) => ({
|
|
1734
|
+
key: e,
|
|
1735
|
+
label: n(t),
|
|
1736
|
+
mark: E.Check,
|
|
1737
|
+
checked: e === p,
|
|
1738
|
+
onClick: () => v(e)
|
|
1739
|
+
})), n = It.find(({ value: e }) => e === p);
|
|
1740
|
+
o.push({
|
|
1741
|
+
key: "filter-type",
|
|
1742
|
+
label: t.type ?? "Type",
|
|
1743
|
+
renderItem: i(t.type ?? "Type", n ? n.getLabel(t) : t.all),
|
|
1744
|
+
children: e
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
if (f) {
|
|
1748
|
+
let e = Ft.filter(({ value: e }) => !y?.includes(e)), n = e.find(({ value: e }) => e === d);
|
|
1749
|
+
o.push({
|
|
1750
|
+
key: "filter-origin",
|
|
1751
|
+
label: t.origin ?? "Origin",
|
|
1752
|
+
renderItem: i(t.origin ?? "Origin", n ? n.getLabel(t) : t.all),
|
|
1753
|
+
children: e.map(({ value: e, getLabel: n }) => ({
|
|
1754
|
+
key: e,
|
|
1755
|
+
label: n(t),
|
|
1756
|
+
mark: E.Check,
|
|
1757
|
+
checked: e === d,
|
|
1758
|
+
onClick: () => f(e)
|
|
1759
|
+
}))
|
|
1760
|
+
});
|
|
1761
|
+
}
|
|
1762
|
+
return o;
|
|
1763
|
+
}, [
|
|
1764
|
+
e,
|
|
1765
|
+
y,
|
|
1766
|
+
d,
|
|
1767
|
+
p,
|
|
1768
|
+
f,
|
|
1769
|
+
v,
|
|
1770
|
+
D
|
|
1771
|
+
]), K = B(() => r({
|
|
1772
|
+
"--cp-list-header-title": S?.colors?.title,
|
|
1773
|
+
"--cp-list-header-title-focus": S?.colors?.titleFocus,
|
|
1774
|
+
"--cp-list-header-filter-indicator": S?.colors?.filterIndicator
|
|
1775
|
+
}), [
|
|
1776
|
+
S?.colors?.title,
|
|
1777
|
+
S?.colors?.titleFocus,
|
|
1778
|
+
S?.colors?.filterIndicator
|
|
1779
|
+
]), ie = (e) => a("flex min-h-6 items-center justify-between ps-2", e, C, pe.listHeader);
|
|
1780
|
+
if (I && c) return /* @__PURE__ */ G("div", {
|
|
1781
|
+
role: "search",
|
|
1782
|
+
style: K,
|
|
1783
|
+
className: ie("gap-2"),
|
|
1784
|
+
onKeyDown: U,
|
|
1785
|
+
children: [/* @__PURE__ */ W(k, {
|
|
1786
|
+
containerClassName: "min-w-0 flex-1",
|
|
1787
|
+
wrapperClassName: a("h-6! min-h-0! py-1! pe-2! [&_svg]:size-4!", T),
|
|
1788
|
+
inputRef: A,
|
|
1789
|
+
value: s,
|
|
1790
|
+
onChange: H,
|
|
1791
|
+
placeholder: e.searchPlaceholder,
|
|
1792
|
+
clearLabel: e.searchClearLabel,
|
|
1793
|
+
"aria-label": e.searchPlaceholder
|
|
1794
|
+
}), /* @__PURE__ */ W(b, {
|
|
1795
|
+
icon: /* @__PURE__ */ W(fe, {
|
|
1796
|
+
size: m.SM,
|
|
1797
|
+
stroke: h,
|
|
1798
|
+
"aria-hidden": !0
|
|
1799
|
+
}),
|
|
1800
|
+
size: _.Small,
|
|
1801
|
+
className: Pt,
|
|
1802
|
+
"aria-label": e.searchCloseLabel,
|
|
1803
|
+
onClick: z
|
|
1804
|
+
})]
|
|
1805
|
+
});
|
|
1806
|
+
let se = /* @__PURE__ */ W("span", {
|
|
1807
|
+
className: w,
|
|
1808
|
+
children: e.title
|
|
1809
|
+
});
|
|
1810
|
+
return /* @__PURE__ */ G("div", {
|
|
1811
|
+
style: K,
|
|
1812
|
+
className: ie(),
|
|
1813
|
+
children: [i ? /* @__PURE__ */ G("button", {
|
|
1814
|
+
type: "button",
|
|
1815
|
+
"aria-expanded": t,
|
|
1816
|
+
"aria-controls": o,
|
|
1817
|
+
onClick: i,
|
|
1818
|
+
className: a("group flex items-center gap-1 rounded", Nt.title),
|
|
1819
|
+
children: [se, t ? /* @__PURE__ */ W(ae, {
|
|
1820
|
+
size: m.SM,
|
|
1821
|
+
stroke: h,
|
|
1822
|
+
className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
1823
|
+
"aria-hidden": !0
|
|
1824
|
+
}) : /* @__PURE__ */ W(oe, {
|
|
1825
|
+
size: m.SM,
|
|
1826
|
+
stroke: h,
|
|
1827
|
+
className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
|
|
1828
|
+
"aria-hidden": !0
|
|
1829
|
+
})]
|
|
1830
|
+
}) : /* @__PURE__ */ W("span", {
|
|
1831
|
+
className: Nt.title,
|
|
1832
|
+
children: se
|
|
1833
|
+
}), /* @__PURE__ */ G("div", {
|
|
1834
|
+
className: "flex items-center gap-2",
|
|
1835
|
+
children: [
|
|
1836
|
+
I && /* @__PURE__ */ W(b, {
|
|
1837
|
+
ref: O,
|
|
1838
|
+
icon: /* @__PURE__ */ W(ue, {
|
|
1839
|
+
size: m.SM,
|
|
1840
|
+
stroke: h,
|
|
1841
|
+
"aria-hidden": !0
|
|
1842
|
+
}),
|
|
1843
|
+
size: _.Small,
|
|
1844
|
+
className: Pt,
|
|
1845
|
+
"aria-label": e.searchOpenLabel,
|
|
1846
|
+
onClick: te
|
|
1847
|
+
}),
|
|
1848
|
+
(f || v) && /* @__PURE__ */ W(g, {
|
|
1849
|
+
items: re,
|
|
1850
|
+
placement: "bottom-end",
|
|
1851
|
+
matchReferenceWidth: !1,
|
|
1852
|
+
children: /* @__PURE__ */ W(b, {
|
|
1853
|
+
icon: /* @__PURE__ */ G("span", {
|
|
1854
|
+
className: "relative inline-flex",
|
|
1855
|
+
children: [/* @__PURE__ */ W(ce, {
|
|
1856
|
+
size: m.SM,
|
|
1857
|
+
stroke: h,
|
|
1858
|
+
"aria-hidden": !0
|
|
1859
|
+
}), F && /* @__PURE__ */ W("span", {
|
|
1860
|
+
"aria-hidden": !0,
|
|
1861
|
+
className: a(Nt.filterIndicator, "absolute -inset-e-0.5 -top-0.5 size-1.5 rounded-full")
|
|
1862
|
+
})]
|
|
1863
|
+
}),
|
|
1864
|
+
size: _.Small,
|
|
1865
|
+
className: Pt,
|
|
1866
|
+
"aria-label": M,
|
|
1867
|
+
"aria-describedby": F ? P : void 0
|
|
1868
|
+
})
|
|
1869
|
+
}),
|
|
1870
|
+
F && (f || v) && /* @__PURE__ */ W("span", {
|
|
1871
|
+
id: P,
|
|
1872
|
+
className: "sr-only",
|
|
1873
|
+
children: N
|
|
1874
|
+
}),
|
|
1875
|
+
x
|
|
1876
|
+
]
|
|
1877
|
+
})]
|
|
1878
|
+
});
|
|
1879
|
+
}), Rt = I(({ conversations: e, isLoading: t, isUpdatingTitles: r, preserveActiveSearchResult: i, onSelectConversation: o, activeConversationId: s, labels: c, requestedFilter: l, isFilterHidden: u = !1, onFilterChange: d, isTypeFilterHidden: f = !1, onTypeFilterChange: p, hiddenSources: m, headerActions: h, getActions: g, onActionMenuOpen: _, onMoveConversation: v, onVisibleConversationIdsChange: y, pinnedProjects: b, styles: x, listClassName: S, className: C }) => {
|
|
1880
|
+
let w = ee(), [T, E] = H(""), [D, O] = H(!1), [k, A] = H(!0), [j, M] = H(n.All), [N, P] = H(Y.All);
|
|
1881
|
+
R(() => {
|
|
1882
|
+
l != null && M(l);
|
|
1883
|
+
}, [l]);
|
|
1884
|
+
let F = L((e) => {
|
|
1885
|
+
M(e), d?.(e);
|
|
1886
|
+
}, [d]), I = L((e) => {
|
|
1887
|
+
E(e), e !== "" && A(!0);
|
|
1888
|
+
}, []), te = L((e) => {
|
|
1889
|
+
O(e), e && A(!0);
|
|
1890
|
+
}, []), z = L((e) => {
|
|
1891
|
+
P(e), p?.(e);
|
|
1892
|
+
}, [p]), B = L(() => A((e) => !e), []);
|
|
1893
|
+
return /* @__PURE__ */ G("section", {
|
|
1894
|
+
"aria-label": c.title,
|
|
1895
|
+
className: a("flex min-h-0 flex-1 flex-col px-1 pt-4", C, pe.listSection),
|
|
1896
|
+
children: [/* @__PURE__ */ W("div", {
|
|
1897
|
+
className: "px-3 pb-2",
|
|
1898
|
+
children: /* @__PURE__ */ W(Lt, {
|
|
1899
|
+
labels: c,
|
|
1900
|
+
isExpanded: k,
|
|
1901
|
+
onToggleExpanded: B,
|
|
1902
|
+
controlsId: w,
|
|
1903
|
+
searchQuery: T,
|
|
1904
|
+
isSearchOpen: D,
|
|
1905
|
+
onSearchChange: I,
|
|
1906
|
+
onSearchOpenChange: te,
|
|
1907
|
+
activeFilter: j,
|
|
1908
|
+
onFilterChange: u ? void 0 : F,
|
|
1909
|
+
activeTypeFilter: N,
|
|
1910
|
+
onTypeFilterChange: u || f ? void 0 : z,
|
|
1911
|
+
hiddenSources: m,
|
|
1912
|
+
actions: h,
|
|
1913
|
+
styles: x?.header
|
|
1914
|
+
})
|
|
1915
|
+
}), /* @__PURE__ */ W("div", {
|
|
1916
|
+
hidden: !k,
|
|
1917
|
+
inert: !k,
|
|
1918
|
+
className: k ? "flex min-h-0 flex-1 flex-col" : "hidden",
|
|
1919
|
+
children: /* @__PURE__ */ W(Mt, {
|
|
1920
|
+
id: w,
|
|
1921
|
+
conversations: e,
|
|
1922
|
+
isLoading: t,
|
|
1923
|
+
isUpdatingTitles: r,
|
|
1924
|
+
preserveActiveSearchResult: i,
|
|
1925
|
+
onSelectConversation: o,
|
|
1926
|
+
activeConversationId: s,
|
|
1927
|
+
labels: c,
|
|
1928
|
+
searchQuery: T,
|
|
1929
|
+
activeFilter: j,
|
|
1930
|
+
activeTypeFilter: N,
|
|
1931
|
+
hiddenSources: m,
|
|
1932
|
+
rowVariant: X.Indicator,
|
|
1933
|
+
getActions: g,
|
|
1934
|
+
onActionMenuOpen: _,
|
|
1935
|
+
onMoveConversation: v,
|
|
1936
|
+
onVisibleConversationIdsChange: y,
|
|
1937
|
+
pinnedProjects: b,
|
|
1938
|
+
styles: x?.list,
|
|
1939
|
+
className: S
|
|
1940
|
+
})
|
|
1941
|
+
})]
|
|
1942
|
+
});
|
|
1943
|
+
}), zt = [
|
|
1944
|
+
{
|
|
1945
|
+
value: n.All,
|
|
1946
|
+
labelKey: "all"
|
|
1947
|
+
},
|
|
1948
|
+
{
|
|
1949
|
+
value: n.MyChats,
|
|
1950
|
+
labelKey: "myChats"
|
|
1951
|
+
},
|
|
1952
|
+
{
|
|
1953
|
+
value: n.Shared,
|
|
1954
|
+
labelKey: "shared"
|
|
1955
|
+
},
|
|
1956
|
+
{
|
|
1957
|
+
value: n.Organization,
|
|
1958
|
+
labelKey: "organization"
|
|
1959
|
+
}
|
|
1960
|
+
], Bt = I(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => {
|
|
1961
|
+
let a = B(() => zt.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
|
|
1962
|
+
value: e,
|
|
1963
|
+
label: t[n]
|
|
1964
|
+
})), [t, i]);
|
|
1965
|
+
return /* @__PURE__ */ W(y, {
|
|
1966
|
+
items: a,
|
|
1967
|
+
value: e,
|
|
1968
|
+
onChange: n,
|
|
1969
|
+
stretch: !0,
|
|
1970
|
+
"aria-label": t.groupAriaLabel ?? "Filter chats",
|
|
1971
|
+
className: "px-3 py-2",
|
|
1972
|
+
chipClassName: N("px-2!", r)
|
|
1973
|
+
});
|
|
1974
|
+
}), Vt = { button: "_button_vjird_1" }, Ht = I(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i, className: o }) => {
|
|
1975
|
+
let s = r({
|
|
1976
|
+
"--cp-new-chat-bg": i?.background,
|
|
1977
|
+
"--cp-new-chat-text": i?.text,
|
|
1978
|
+
"--cp-new-chat-focus-outline": i?.focusOutline
|
|
1979
|
+
});
|
|
1980
|
+
return /* @__PURE__ */ W("div", {
|
|
1981
|
+
className: "px-3 py-2",
|
|
1982
|
+
style: s,
|
|
1983
|
+
children: /* @__PURE__ */ W(f, {
|
|
1984
|
+
label: e,
|
|
1985
|
+
textClassName: n,
|
|
1986
|
+
iconBefore: /* @__PURE__ */ W(le, {
|
|
1987
|
+
size: 18,
|
|
1988
|
+
stroke: h,
|
|
1989
|
+
className: "shrink-0",
|
|
1990
|
+
"aria-hidden": !0
|
|
1991
|
+
}),
|
|
1992
|
+
onClick: t,
|
|
1993
|
+
className: a("h-[36px] w-full gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", Vt.button, o, pe.newChatButton)
|
|
1994
|
+
})
|
|
1995
|
+
});
|
|
1996
|
+
}), Ut = I(({ conversations: e, isLoading: t, isUpdatingTitles: i, preserveActiveSearchResult: o, isOpen: s, onSelectConversation: c, activeConversationId: l, labels: f, onNewChat: p, styles: m, className: h, isOverlay: g = !1, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: x, onVisibleConversationIdsChange: S, activeFilter: C, onActiveFilterChange: w, isFilterTabsHidden: T = !1, hiddenSources: E, pinnedProjects: D }) => {
|
|
1997
|
+
let { colors: O, typography: A, newChatButton: j, searchWrapperClassName: M, headerClassName: N, headerActionsClassName: P, newChatButtonClassName: F } = m ?? {}, { title: I, emptyLabel: ee, emptyDescription: te, noResultsLabel: z, noResultsDescription: V, sharedEmptyDescription: U, tabEmptyLabels: ne, loadingLabel: re, updatingTitlesLabel: K, newChatLabel: ie, searchPlaceholder: ae, searchClearLabel: oe, filterLabels: se, groupLabels: ce, actionsLabel: le, unreadIndicatorLabel: ue, seeAllLabel: de, seeAllAriaLabel: fe, expandProjectLabel: q, collapseProjectLabel: me, closeAriaLabel: he } = f, [ge, J] = H(""), [_e, ve] = H(n.All);
|
|
1998
|
+
R(() => {
|
|
1999
|
+
C != null && ve(C);
|
|
2000
|
+
}, [C]);
|
|
2001
|
+
let ye = L((e) => {
|
|
2002
|
+
J(e ?? "");
|
|
2003
|
+
}, []), be = r({
|
|
2004
|
+
"--cp-text": O?.text,
|
|
2005
|
+
"--cp-new-chat-bg": j?.background,
|
|
2006
|
+
"--cp-new-chat-text": j?.text,
|
|
2007
|
+
"--cp-new-chat-focus-outline": j?.focusOutline
|
|
2008
|
+
}), xe = B(() => ({
|
|
2009
|
+
emptyLabel: ee,
|
|
2010
|
+
emptyDescription: te,
|
|
2011
|
+
noResultsLabel: z,
|
|
2012
|
+
noResultsDescription: V,
|
|
2013
|
+
sharedEmptyDescription: U,
|
|
2014
|
+
tabEmptyLabels: ne,
|
|
2015
|
+
loadingLabel: re,
|
|
2016
|
+
updatingTitlesLabel: K,
|
|
2017
|
+
groupLabels: ce,
|
|
2018
|
+
actionsLabel: le,
|
|
2019
|
+
unreadIndicatorLabel: ue,
|
|
2020
|
+
seeAllLabel: de,
|
|
2021
|
+
seeAllAriaLabel: fe,
|
|
2022
|
+
expandProjectLabel: q,
|
|
2023
|
+
collapseProjectLabel: me
|
|
2024
|
+
}), [
|
|
2025
|
+
ee,
|
|
2026
|
+
te,
|
|
2027
|
+
z,
|
|
2028
|
+
V,
|
|
2029
|
+
U,
|
|
2030
|
+
ne,
|
|
2031
|
+
re,
|
|
2032
|
+
K,
|
|
2033
|
+
ce,
|
|
2034
|
+
le,
|
|
2035
|
+
ue,
|
|
2036
|
+
de,
|
|
2037
|
+
fe,
|
|
2038
|
+
q,
|
|
2039
|
+
me
|
|
2040
|
+
]), Se = B(() => ({
|
|
2041
|
+
colors: O,
|
|
2042
|
+
typography: {
|
|
2043
|
+
fontFamily: A?.fontFamily,
|
|
2044
|
+
groupHeaderClassName: A?.groupHeaderClassName,
|
|
2045
|
+
itemTitleClassName: A?.itemTitleClassName,
|
|
2046
|
+
unreadItemTitleClassName: A?.unreadItemTitleClassName
|
|
2047
|
+
},
|
|
2048
|
+
itemIconBadgeClassName: m?.itemIconBadgeClassName
|
|
2049
|
+
}), [
|
|
2050
|
+
O,
|
|
2051
|
+
A?.fontFamily,
|
|
2052
|
+
A?.groupHeaderClassName,
|
|
2053
|
+
A?.itemTitleClassName,
|
|
2054
|
+
A?.unreadItemTitleClassName,
|
|
2055
|
+
m?.itemIconBadgeClassName
|
|
2056
|
+
]);
|
|
2057
|
+
return /* @__PURE__ */ G(d, {
|
|
2058
|
+
isOpen: s,
|
|
876
2059
|
isOverlay: g,
|
|
877
|
-
orientation:
|
|
878
|
-
title:
|
|
2060
|
+
orientation: u.Left,
|
|
2061
|
+
title: I,
|
|
879
2062
|
labels: {
|
|
880
|
-
ariaLabel:
|
|
881
|
-
closeLabel:
|
|
2063
|
+
ariaLabel: I,
|
|
2064
|
+
closeLabel: he
|
|
882
2065
|
},
|
|
883
2066
|
onClose: y,
|
|
884
2067
|
styles: {
|
|
885
2068
|
colors: {
|
|
886
|
-
background:
|
|
887
|
-
border:
|
|
2069
|
+
background: O?.background,
|
|
2070
|
+
border: O?.border
|
|
888
2071
|
},
|
|
889
|
-
typography: { fontClassName:
|
|
2072
|
+
typography: { fontClassName: A?.fontClassName },
|
|
890
2073
|
bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
|
|
891
|
-
cssVars:
|
|
892
|
-
titleClassName:
|
|
893
|
-
headerClassName:
|
|
894
|
-
headerActionsClassName:
|
|
895
|
-
className:
|
|
2074
|
+
cssVars: be,
|
|
2075
|
+
titleClassName: A?.fontClassName,
|
|
2076
|
+
headerClassName: a("h-[64px]", N),
|
|
2077
|
+
headerActionsClassName: P,
|
|
2078
|
+
className: a(s ? "w-[324px] mobile:w-full" : "w-0", h)
|
|
896
2079
|
},
|
|
897
2080
|
rightActions: b,
|
|
898
2081
|
children: [
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
label:
|
|
2082
|
+
/* @__PURE__ */ W(Ht, {
|
|
2083
|
+
label: ie,
|
|
901
2084
|
onClick: p,
|
|
902
|
-
labelClassName:
|
|
903
|
-
colors:
|
|
904
|
-
className:
|
|
2085
|
+
labelClassName: A?.newChatLabelClassName,
|
|
2086
|
+
colors: j,
|
|
2087
|
+
className: F
|
|
905
2088
|
}),
|
|
906
|
-
/* @__PURE__ */
|
|
2089
|
+
/* @__PURE__ */ W("div", {
|
|
907
2090
|
role: "search",
|
|
908
|
-
className:
|
|
909
|
-
children: /* @__PURE__ */
|
|
910
|
-
wrapperClassName:
|
|
911
|
-
value:
|
|
912
|
-
onChange:
|
|
913
|
-
placeholder:
|
|
914
|
-
clearLabel:
|
|
915
|
-
"aria-label":
|
|
2091
|
+
className: a("px-3 py-2", pe.search),
|
|
2092
|
+
children: /* @__PURE__ */ W(k, {
|
|
2093
|
+
wrapperClassName: a($.search, M),
|
|
2094
|
+
value: ge,
|
|
2095
|
+
onChange: ye,
|
|
2096
|
+
placeholder: ae,
|
|
2097
|
+
clearLabel: oe,
|
|
2098
|
+
"aria-label": ae
|
|
916
2099
|
})
|
|
917
2100
|
}),
|
|
918
|
-
!
|
|
919
|
-
activeTab:
|
|
920
|
-
labels:
|
|
2101
|
+
!T && /* @__PURE__ */ W(Bt, {
|
|
2102
|
+
activeTab: _e,
|
|
2103
|
+
labels: se,
|
|
921
2104
|
onChange: (e) => {
|
|
922
|
-
|
|
2105
|
+
ve(e), w?.(e);
|
|
923
2106
|
},
|
|
924
|
-
tabClassName:
|
|
2107
|
+
tabClassName: A?.tabClassName,
|
|
925
2108
|
hiddenSources: E
|
|
926
2109
|
}),
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
}) : nt ? /* @__PURE__ */ I(s, { label: ae }) : rt ? /* @__PURE__ */ I(c, { label: oe }) : /* @__PURE__ */ I(_e, {
|
|
945
|
-
listRef: ge,
|
|
946
|
-
id: he,
|
|
947
|
-
role: "list",
|
|
948
|
-
style: { height: "100%" },
|
|
949
|
-
rowComponent: Ne,
|
|
950
|
-
rowCount: $.length,
|
|
951
|
-
rowHeight: be,
|
|
952
|
-
overscanCount: pe,
|
|
953
|
-
onResize: Re,
|
|
954
|
-
rowProps: tt
|
|
955
|
-
})
|
|
2110
|
+
/* @__PURE__ */ W(Mt, {
|
|
2111
|
+
conversations: e,
|
|
2112
|
+
isLoading: t,
|
|
2113
|
+
isUpdatingTitles: i,
|
|
2114
|
+
preserveActiveSearchResult: o,
|
|
2115
|
+
onSelectConversation: c,
|
|
2116
|
+
activeConversationId: l,
|
|
2117
|
+
labels: xe,
|
|
2118
|
+
searchQuery: ge,
|
|
2119
|
+
activeFilter: _e,
|
|
2120
|
+
hiddenSources: E,
|
|
2121
|
+
getActions: _,
|
|
2122
|
+
onActionMenuOpen: v,
|
|
2123
|
+
onMoveConversation: x,
|
|
2124
|
+
onVisibleConversationIdsChange: S,
|
|
2125
|
+
pinnedProjects: D,
|
|
2126
|
+
styles: Se
|
|
956
2127
|
})
|
|
957
2128
|
]
|
|
958
2129
|
});
|
|
959
|
-
}),
|
|
960
|
-
let [
|
|
961
|
-
|
|
962
|
-
let n = e && !
|
|
963
|
-
if (
|
|
964
|
-
|
|
2130
|
+
}), Wt = I(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
|
|
2131
|
+
let [f, g] = H(t), [_, v] = H(!1), [y, x] = H(null), E = V(null), k = V(!1), A = V(0);
|
|
2132
|
+
R(() => {
|
|
2133
|
+
let n = e && !k.current;
|
|
2134
|
+
if (k.current = e, !e) {
|
|
2135
|
+
A.current += 1, v(!1);
|
|
965
2136
|
return;
|
|
966
2137
|
}
|
|
967
2138
|
if (!n) return;
|
|
968
|
-
|
|
969
|
-
let r = setTimeout(() =>
|
|
2139
|
+
A.current += 1, g(t), x(null), v(!1);
|
|
2140
|
+
let r = setTimeout(() => E.current?.focus(), 0);
|
|
970
2141
|
return () => clearTimeout(r);
|
|
971
|
-
}, [e, t]),
|
|
972
|
-
|
|
2142
|
+
}, [e, t]), R(() => () => {
|
|
2143
|
+
A.current += 1;
|
|
973
2144
|
}, []);
|
|
974
|
-
let
|
|
975
|
-
|
|
2145
|
+
let j = s(f.trim()), N = i(j) > 255, P = n || j === "" || j === t.trim() || N, F = L(() => {
|
|
2146
|
+
P || a(j);
|
|
976
2147
|
}, [
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
]),
|
|
981
|
-
e.key === "Enter" &&
|
|
982
|
-
}, [
|
|
2148
|
+
P,
|
|
2149
|
+
a,
|
|
2150
|
+
j
|
|
2151
|
+
]), I = L((e) => {
|
|
2152
|
+
e.key === "Enter" && F();
|
|
2153
|
+
}, [F]), ee = L(async () => {
|
|
983
2154
|
if (_) return;
|
|
984
|
-
let e = ++
|
|
985
|
-
v(!0),
|
|
2155
|
+
let e = ++A.current;
|
|
2156
|
+
v(!0), x(null);
|
|
986
2157
|
try {
|
|
987
2158
|
let t = await l();
|
|
988
|
-
if (e !==
|
|
989
|
-
g(
|
|
2159
|
+
if (e !== A.current) return;
|
|
2160
|
+
g(o(t));
|
|
990
2161
|
} catch {
|
|
991
|
-
if (e !==
|
|
992
|
-
|
|
2162
|
+
if (e !== A.current) return;
|
|
2163
|
+
x(u.renameWithAiError);
|
|
993
2164
|
} finally {
|
|
994
|
-
e ===
|
|
2165
|
+
e === A.current && v(!1);
|
|
995
2166
|
}
|
|
996
2167
|
}, [
|
|
997
2168
|
_,
|
|
998
2169
|
l,
|
|
999
2170
|
u.renameWithAiError
|
|
1000
|
-
]),
|
|
1001
|
-
return
|
|
2171
|
+
]), te = y ?? r ?? void 0, z;
|
|
2172
|
+
return z = N ? u.nameTooLongError : te, /* @__PURE__ */ W(D, {
|
|
1002
2173
|
open: e,
|
|
1003
2174
|
header: u.popupTitle,
|
|
1004
|
-
size:
|
|
2175
|
+
size: O.Sm,
|
|
1005
2176
|
onClose: c,
|
|
1006
2177
|
mainButtons: n ? void 0 : [{
|
|
1007
2178
|
label: u.cancelLabel,
|
|
1008
2179
|
onClick: c
|
|
1009
2180
|
}, {
|
|
1010
2181
|
label: u.saveLabel,
|
|
1011
|
-
variant:
|
|
1012
|
-
disabled:
|
|
1013
|
-
onClick:
|
|
2182
|
+
variant: p.Primary,
|
|
2183
|
+
disabled: P,
|
|
2184
|
+
onClick: F
|
|
1014
2185
|
}],
|
|
1015
|
-
children: /* @__PURE__ */
|
|
2186
|
+
children: /* @__PURE__ */ G("div", {
|
|
1016
2187
|
className: d?.bodyClassName,
|
|
1017
2188
|
style: d?.cssVars,
|
|
1018
|
-
children:
|
|
2189
|
+
children: [/* @__PURE__ */ W(C, {
|
|
2190
|
+
politeness: T.Assertive,
|
|
2191
|
+
visuallyHidden: !0,
|
|
2192
|
+
as: w.Span,
|
|
2193
|
+
children: !n && !N && te
|
|
2194
|
+
}), n ? /* @__PURE__ */ W("div", {
|
|
1019
2195
|
className: "h-[120px] px-6 py-4",
|
|
1020
|
-
children: /* @__PURE__ */
|
|
1021
|
-
|
|
2196
|
+
children: /* @__PURE__ */ W(M, {
|
|
2197
|
+
size: 50,
|
|
2198
|
+
ariaLabel: u.savingLabel ?? "Saving"
|
|
2199
|
+
})
|
|
2200
|
+
}) : /* @__PURE__ */ G("div", {
|
|
1022
2201
|
className: "flex items-start gap-2 px-6 py-3",
|
|
1023
|
-
children: [/* @__PURE__ */
|
|
2202
|
+
children: [/* @__PURE__ */ W("div", {
|
|
1024
2203
|
className: "min-w-0 flex-1",
|
|
1025
|
-
children: /* @__PURE__ */
|
|
1026
|
-
inputRef:
|
|
1027
|
-
value:
|
|
2204
|
+
children: /* @__PURE__ */ W(S, {
|
|
2205
|
+
inputRef: E,
|
|
2206
|
+
value: f,
|
|
1028
2207
|
placeholder: u.inputPlaceholder,
|
|
1029
|
-
error:
|
|
1030
|
-
onChange: (e) => g(
|
|
1031
|
-
onKeyDown:
|
|
2208
|
+
error: z,
|
|
2209
|
+
onChange: (e) => g(o(e ?? "")),
|
|
2210
|
+
onKeyDown: I
|
|
1032
2211
|
})
|
|
1033
|
-
}), /* @__PURE__ */
|
|
2212
|
+
}), /* @__PURE__ */ W(b, {
|
|
1034
2213
|
"aria-label": u.renameWithAiLabel,
|
|
1035
2214
|
tooltipProps: { tooltip: u.renameWithAiLabel },
|
|
1036
2215
|
disabled: _ || n,
|
|
1037
2216
|
"aria-busy": _,
|
|
1038
|
-
onClick:
|
|
1039
|
-
icon: _ ? /* @__PURE__ */
|
|
2217
|
+
onClick: ee,
|
|
2218
|
+
icon: _ ? /* @__PURE__ */ W("span", {
|
|
1040
2219
|
className: "flex",
|
|
1041
2220
|
"aria-hidden": !0,
|
|
1042
|
-
children: /* @__PURE__ */
|
|
1043
|
-
}) : /* @__PURE__ */
|
|
1044
|
-
size:
|
|
1045
|
-
stroke:
|
|
2221
|
+
children: /* @__PURE__ */ W(M, { size: m.MD })
|
|
2222
|
+
}) : /* @__PURE__ */ W(de, {
|
|
2223
|
+
size: m.MD,
|
|
2224
|
+
stroke: h,
|
|
1046
2225
|
"aria-hidden": !0
|
|
1047
2226
|
})
|
|
1048
2227
|
})]
|
|
1049
|
-
})
|
|
2228
|
+
})]
|
|
1050
2229
|
})
|
|
1051
2230
|
});
|
|
1052
2231
|
});
|
|
1053
|
-
|
|
2232
|
+
Wt.displayName = "RenameConversationPopup";
|
|
1054
2233
|
//#endregion
|
|
1055
|
-
export {
|
|
2234
|
+
export { pe as CONVERSATION_PANEL_CLASS, Mt as ConversationList, Lt as ConversationListHeader, Rt as ConversationListSection, Ut as ConversationPanel, X as ConversationRowVariant, Y as ConversationTypeFilter, Wt as RenameConversationPopup };
|