@trinitydesign/design-system 1.2.0
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/CHANGELOG.md +167 -0
- package/CONTRIBUTING.md +394 -0
- package/MIGRATION.md +347 -0
- package/README.md +142 -0
- package/dist/ai.js +6155 -0
- package/dist/charts.js +2650 -0
- package/dist/data.js +1516 -0
- package/dist/forms.js +971 -0
- package/dist/index.js +5897 -0
- package/dist/navigation.js +2977 -0
- package/dist/theme.js +1289 -0
- package/dist/tokens.js +25 -0
- package/package.json +129 -0
|
@@ -0,0 +1,2977 @@
|
|
|
1
|
+
import * as H from "react";
|
|
2
|
+
import { useState as z, useCallback as W, useRef as Oe, useEffect as $e } from "react";
|
|
3
|
+
import { jsxs as i, jsx as e, Fragment as Te } from "react/jsx-runtime";
|
|
4
|
+
import { useTheme as we, useMediaQuery as Ae, AppBar as mn, Toolbar as un, Box as l, Divider as pe, Typography as b, IconButton as v, Menu as me, MenuItem as O, Avatar as Pe, ListItemIcon as Z, ListItemText as ee, Drawer as Xe, InputBase as qe, Button as Je, List as gn, ListItem as fn, ListItemButton as xn, alpha as _e, Tooltip as U, TextField as tn, InputAdornment as yn, Stack as de, Chip as Cn, Fab as Sn, Badge as wn } from "@mui/material";
|
|
5
|
+
import ge from "@mui/icons-material/Search";
|
|
6
|
+
import Ee from "@mui/icons-material/Clear";
|
|
7
|
+
import Ze from "@mui/icons-material/Apps";
|
|
8
|
+
import De from "@mui/icons-material/KeyboardArrowDown";
|
|
9
|
+
import Fe from "@mui/icons-material/HelpOutline";
|
|
10
|
+
import je from "@mui/icons-material/NotificationsNone";
|
|
11
|
+
import en from "@mui/icons-material/Logout";
|
|
12
|
+
import Ce from "@mui/icons-material/OpenInNew";
|
|
13
|
+
import { b as f, s as t, c as he, d as Y, I as ye, e as vn, A as kn, f as zn, g as In, h as Wn, i as An, j as Pn, k as En, l as Dn } from "./ai.js";
|
|
14
|
+
import nn from "./assets/trinity-logo-white.svg";
|
|
15
|
+
import { alpha as _, styled as $ } from "@mui/material/styles";
|
|
16
|
+
import Ye from "@mui/icons-material/Close";
|
|
17
|
+
import Tn from "@mui/icons-material/Menu";
|
|
18
|
+
import Mn from "@mui/icons-material/HomeOutlined";
|
|
19
|
+
import Ln from "@mui/icons-material/TrendingUp";
|
|
20
|
+
import Rn from "@mui/icons-material/TrackChanges";
|
|
21
|
+
import Bn from "@mui/icons-material/FolderOpen";
|
|
22
|
+
import Hn from "@mui/icons-material/SupportAgent";
|
|
23
|
+
import bn from "@mui/icons-material/AutoAwesome";
|
|
24
|
+
import On from "@mui/icons-material/ChatBubbleOutline";
|
|
25
|
+
import $n from "@mui/icons-material/DeleteOutline";
|
|
26
|
+
import Nn from "@mui/icons-material/Edit";
|
|
27
|
+
import Fn from "@mui/icons-material/MoreHoriz";
|
|
28
|
+
import jn from "@mui/icons-material/Add";
|
|
29
|
+
import Un from "@mui/icons-material/ChevronLeft";
|
|
30
|
+
import Kn from "@mui/icons-material/Folder";
|
|
31
|
+
import on from "@mui/icons-material/Star";
|
|
32
|
+
import Vn from "@mui/icons-material/StarBorder";
|
|
33
|
+
const rn = $("div")(({ theme: n, focused: o }) => ({
|
|
34
|
+
position: "relative",
|
|
35
|
+
borderRadius: `${t.borders.radius.menu}px`,
|
|
36
|
+
// 12px
|
|
37
|
+
backgroundColor: o === "true" ? n.palette.common.white : t.effects.onDark.subtle,
|
|
38
|
+
// 12% white
|
|
39
|
+
"&:hover": {
|
|
40
|
+
backgroundColor: o === "true" ? n.palette.common.white : "rgba(255, 255, 255, 0.15)"
|
|
41
|
+
// @intentional-color: hover state slightly stronger
|
|
42
|
+
},
|
|
43
|
+
marginRight: n.spacing(2),
|
|
44
|
+
marginLeft: n.spacing(2),
|
|
45
|
+
width: "100%",
|
|
46
|
+
maxWidth: 400,
|
|
47
|
+
transition: n.transitions.create(["background-color"]),
|
|
48
|
+
[n.breakpoints.up("sm")]: {
|
|
49
|
+
marginLeft: n.spacing(3),
|
|
50
|
+
width: "auto",
|
|
51
|
+
minWidth: 300
|
|
52
|
+
}
|
|
53
|
+
})), an = $("div")(({ theme: n, focused: o }) => ({
|
|
54
|
+
padding: n.spacing(0, 2),
|
|
55
|
+
height: "100%",
|
|
56
|
+
position: "absolute",
|
|
57
|
+
pointerEvents: "none",
|
|
58
|
+
display: "flex",
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
justifyContent: "center",
|
|
61
|
+
color: o === "true" ? f.primary.main : _(n.palette.common.white, 0.5)
|
|
62
|
+
})), ln = $(qe)(({ theme: n, focused: o }) => ({
|
|
63
|
+
color: o === "true" ? f.primary.main : "inherit",
|
|
64
|
+
width: "100%",
|
|
65
|
+
"& .MuiInputBase-input": {
|
|
66
|
+
padding: n.spacing(1, 4, 1, 0),
|
|
67
|
+
paddingLeft: `calc(1em + ${n.spacing(4)})`,
|
|
68
|
+
transition: n.transitions.create("width"),
|
|
69
|
+
width: "100%",
|
|
70
|
+
fontSize: t.typography.body.small.fontSize,
|
|
71
|
+
// 14px
|
|
72
|
+
"&::placeholder": {
|
|
73
|
+
color: o === "true" ? f.neutral.gray500 : _(n.palette.common.white, 0.5),
|
|
74
|
+
opacity: 1
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
})), sn = $(v)(({ show: n }) => ({
|
|
78
|
+
position: "absolute",
|
|
79
|
+
right: t.inline.tight,
|
|
80
|
+
// 4px
|
|
81
|
+
top: "50%",
|
|
82
|
+
transform: "translateY(-50%)",
|
|
83
|
+
padding: t.inline.tight,
|
|
84
|
+
// 4px
|
|
85
|
+
opacity: n === "true" ? 1 : 0,
|
|
86
|
+
pointerEvents: n === "true" ? "auto" : "none",
|
|
87
|
+
color: f.neutral.gray500,
|
|
88
|
+
"&:hover": {
|
|
89
|
+
backgroundColor: t.effects.overlay.hover
|
|
90
|
+
// 8%
|
|
91
|
+
}
|
|
92
|
+
})), Qn = $(Je)(({ theme: n }) => ({
|
|
93
|
+
backgroundColor: t.effects.onDark.subtle,
|
|
94
|
+
// 12% white
|
|
95
|
+
color: n.palette.common.white,
|
|
96
|
+
borderRadius: `${t.borders.radius.menu}px`,
|
|
97
|
+
// 12px
|
|
98
|
+
padding: `${t.inline.tight}px ${t.inline.compact}px`,
|
|
99
|
+
// 6px 12px
|
|
100
|
+
textTransform: "none",
|
|
101
|
+
fontSize: t.typography.body.small.fontSize,
|
|
102
|
+
// 14px
|
|
103
|
+
fontWeight: t.typography.body.small.fontWeight,
|
|
104
|
+
// 400
|
|
105
|
+
minWidth: 180,
|
|
106
|
+
justifyContent: "space-between",
|
|
107
|
+
"&:hover": {
|
|
108
|
+
backgroundColor: "rgba(255, 255, 255, 0.15)"
|
|
109
|
+
// @intentional-color: hover state
|
|
110
|
+
}
|
|
111
|
+
})), _n = () => /* @__PURE__ */ e(l, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ e("img", { src: nn, alt: "Trinity", height: 28 }) });
|
|
112
|
+
function Gn({
|
|
113
|
+
appName: n = "App Name",
|
|
114
|
+
clientName: o = "Long Client Name 1",
|
|
115
|
+
clients: s = [
|
|
116
|
+
{ id: "1", name: "Long Client Name 1" },
|
|
117
|
+
{ id: "2", name: "Long Client Name 2" },
|
|
118
|
+
{ id: "3", name: "Long Client Name 3" },
|
|
119
|
+
{ id: "4", name: "Client ABC" },
|
|
120
|
+
{ id: "5", name: "Client XYZ" }
|
|
121
|
+
],
|
|
122
|
+
onClientChange: a,
|
|
123
|
+
userInitials: u = "RD",
|
|
124
|
+
userName: g = "Rahul M Desai",
|
|
125
|
+
userEmail: c = "rdesai@trinitylifesciences.com",
|
|
126
|
+
onSearch: h,
|
|
127
|
+
onAppsClick: A,
|
|
128
|
+
onUserMenuClick: E,
|
|
129
|
+
apps: y = [
|
|
130
|
+
{ id: "launch-accelerator", name: "Launch Accelerator", url: "#" },
|
|
131
|
+
{ id: "cloudcast", name: "CloudCast", url: "#" },
|
|
132
|
+
{ id: "terra", name: "Terra", url: "#" },
|
|
133
|
+
{ id: "market-intelligence", name: "Market Intelligence Dashboard", url: "#" }
|
|
134
|
+
],
|
|
135
|
+
hideAppNameOnMobile: k = !0
|
|
136
|
+
}) {
|
|
137
|
+
const L = we();
|
|
138
|
+
Ae(L.breakpoints.down("md"));
|
|
139
|
+
const N = Ae(L.breakpoints.down("sm")), [B, q] = H.useState(null), [I, R] = H.useState(null), [C, D] = H.useState(null), [m, T] = H.useState(o), [M, F] = H.useState(""), [K, S] = H.useState(!1), [V, d] = H.useState(!1), w = (x) => {
|
|
140
|
+
q(x.currentTarget);
|
|
141
|
+
}, oe = () => {
|
|
142
|
+
q(null);
|
|
143
|
+
}, re = (x) => {
|
|
144
|
+
T(x.name), a?.(x.id), oe();
|
|
145
|
+
}, ae = (x) => {
|
|
146
|
+
R(x.currentTarget);
|
|
147
|
+
}, ne = () => {
|
|
148
|
+
R(null);
|
|
149
|
+
}, G = (x) => {
|
|
150
|
+
E?.(x), ne();
|
|
151
|
+
}, le = (x) => {
|
|
152
|
+
D(x.currentTarget);
|
|
153
|
+
}, Q = () => {
|
|
154
|
+
D(null);
|
|
155
|
+
}, te = (x) => {
|
|
156
|
+
A?.(x), Q();
|
|
157
|
+
}, P = (x) => {
|
|
158
|
+
F(x.target.value);
|
|
159
|
+
}, se = (x) => {
|
|
160
|
+
x.key === "Enter" && h?.(M);
|
|
161
|
+
}, ce = () => {
|
|
162
|
+
F("");
|
|
163
|
+
}, Se = () => {
|
|
164
|
+
d(!0);
|
|
165
|
+
}, J = () => {
|
|
166
|
+
d(!1), F(""), S(!1);
|
|
167
|
+
}, fe = () => {
|
|
168
|
+
M.trim() && (h?.(M), J());
|
|
169
|
+
};
|
|
170
|
+
return /* @__PURE__ */ i(
|
|
171
|
+
mn,
|
|
172
|
+
{
|
|
173
|
+
position: "fixed",
|
|
174
|
+
elevation: 0,
|
|
175
|
+
component: "header",
|
|
176
|
+
sx: {
|
|
177
|
+
backgroundColor: f.primary.main,
|
|
178
|
+
borderBottom: `1px solid ${_(f.neutral.white, 0.1)}`,
|
|
179
|
+
borderRadius: 0
|
|
180
|
+
},
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ i(
|
|
183
|
+
un,
|
|
184
|
+
{
|
|
185
|
+
component: "nav",
|
|
186
|
+
"aria-label": "Main navigation",
|
|
187
|
+
sx: { minHeight: 56, px: { xs: 2, sm: 3 } },
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ i(l, { sx: { display: "flex", alignItems: "center", gap: { xs: 1, sm: 2 }, minWidth: 0 }, children: [
|
|
190
|
+
/* @__PURE__ */ e(_n, {}),
|
|
191
|
+
!(N && k) && /* @__PURE__ */ i(Te, { children: [
|
|
192
|
+
/* @__PURE__ */ e(
|
|
193
|
+
pe,
|
|
194
|
+
{
|
|
195
|
+
orientation: "vertical",
|
|
196
|
+
flexItem: !0,
|
|
197
|
+
sx: {
|
|
198
|
+
backgroundColor: "rgba(255, 255, 255, 0.3)",
|
|
199
|
+
// @intentional-color: decorative divider
|
|
200
|
+
height: t.iconSize.prominent,
|
|
201
|
+
// 24px
|
|
202
|
+
alignSelf: "center",
|
|
203
|
+
display: { xs: "none", sm: "block" }
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
/* @__PURE__ */ e(
|
|
208
|
+
b,
|
|
209
|
+
{
|
|
210
|
+
variant: "subtitle1",
|
|
211
|
+
noWrap: !0,
|
|
212
|
+
sx: {
|
|
213
|
+
color: "white",
|
|
214
|
+
fontWeight: t.typography.label.large.fontWeight,
|
|
215
|
+
// 500
|
|
216
|
+
fontSize: t.typography.body.small.fontSize,
|
|
217
|
+
// 14px
|
|
218
|
+
display: { xs: "none", sm: "block" }
|
|
219
|
+
},
|
|
220
|
+
children: n
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
] })
|
|
224
|
+
] }),
|
|
225
|
+
/* @__PURE__ */ e(l, { sx: { flexGrow: 1, display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ i(
|
|
226
|
+
rn,
|
|
227
|
+
{
|
|
228
|
+
focused: K.toString(),
|
|
229
|
+
sx: { display: { xs: "none", md: "flex" } },
|
|
230
|
+
children: [
|
|
231
|
+
/* @__PURE__ */ e(an, { focused: K.toString(), children: /* @__PURE__ */ e(ge, {}) }),
|
|
232
|
+
/* @__PURE__ */ e(
|
|
233
|
+
ln,
|
|
234
|
+
{
|
|
235
|
+
placeholder: "Search",
|
|
236
|
+
inputProps: { "aria-label": "search" },
|
|
237
|
+
value: M,
|
|
238
|
+
onChange: P,
|
|
239
|
+
onKeyPress: se,
|
|
240
|
+
onFocus: () => S(!0),
|
|
241
|
+
onBlur: () => S(!1),
|
|
242
|
+
focused: K.toString()
|
|
243
|
+
}
|
|
244
|
+
),
|
|
245
|
+
/* @__PURE__ */ e(
|
|
246
|
+
sn,
|
|
247
|
+
{
|
|
248
|
+
show: (M.length > 0).toString(),
|
|
249
|
+
onClick: ce,
|
|
250
|
+
size: "small",
|
|
251
|
+
"aria-label": "Clear search",
|
|
252
|
+
children: /* @__PURE__ */ e(Ee, { fontSize: "small" })
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
) }),
|
|
258
|
+
/* @__PURE__ */ e(
|
|
259
|
+
v,
|
|
260
|
+
{
|
|
261
|
+
onClick: Se,
|
|
262
|
+
"aria-label": "Open search",
|
|
263
|
+
sx: {
|
|
264
|
+
display: { xs: "flex", md: "none" },
|
|
265
|
+
color: t.effects.onDark.secondary,
|
|
266
|
+
"&:hover": {
|
|
267
|
+
backgroundColor: t.effects.onDark.subtle,
|
|
268
|
+
color: f.neutral.white
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
children: /* @__PURE__ */ e(ge, {})
|
|
272
|
+
}
|
|
273
|
+
),
|
|
274
|
+
/* @__PURE__ */ i(l, { sx: { display: "flex", alignItems: "center", gap: { xs: 0.5, sm: 1.5 } }, children: [
|
|
275
|
+
/* @__PURE__ */ e(
|
|
276
|
+
Qn,
|
|
277
|
+
{
|
|
278
|
+
onClick: w,
|
|
279
|
+
endIcon: /* @__PURE__ */ e(De, {}),
|
|
280
|
+
"aria-label": `Current client: ${m}. Click to switch clients`,
|
|
281
|
+
"aria-haspopup": "listbox",
|
|
282
|
+
"aria-expanded": !!B,
|
|
283
|
+
sx: {
|
|
284
|
+
minWidth: { xs: 100, sm: 180 },
|
|
285
|
+
maxWidth: { xs: 120, sm: "none" },
|
|
286
|
+
"& .MuiButton-endIcon": {
|
|
287
|
+
ml: { xs: 0, sm: 1 }
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
children: /* @__PURE__ */ e(b, { noWrap: !0, sx: { maxWidth: { xs: 80, sm: "none" } }, children: m })
|
|
291
|
+
}
|
|
292
|
+
),
|
|
293
|
+
/* @__PURE__ */ i(
|
|
294
|
+
me,
|
|
295
|
+
{
|
|
296
|
+
id: "client-menu",
|
|
297
|
+
anchorEl: B,
|
|
298
|
+
open: !!B,
|
|
299
|
+
onClose: oe,
|
|
300
|
+
anchorOrigin: {
|
|
301
|
+
vertical: "bottom",
|
|
302
|
+
horizontal: "right"
|
|
303
|
+
},
|
|
304
|
+
transformOrigin: {
|
|
305
|
+
vertical: "top",
|
|
306
|
+
horizontal: "right"
|
|
307
|
+
},
|
|
308
|
+
MenuListProps: {
|
|
309
|
+
"aria-label": "Client selection",
|
|
310
|
+
role: "listbox"
|
|
311
|
+
},
|
|
312
|
+
PaperProps: {
|
|
313
|
+
sx: {
|
|
314
|
+
mt: 1,
|
|
315
|
+
minWidth: 220,
|
|
316
|
+
borderRadius: t.borders.radiusPx.lg,
|
|
317
|
+
// 12px
|
|
318
|
+
boxShadow: t.effects.shadow.floating
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
children: [
|
|
322
|
+
/* @__PURE__ */ e(
|
|
323
|
+
b,
|
|
324
|
+
{
|
|
325
|
+
variant: "subtitle2",
|
|
326
|
+
sx: { px: 2, py: 1.5, fontWeight: 600, color: "text.primary" },
|
|
327
|
+
id: "client-menu-header",
|
|
328
|
+
children: "Switch Clients"
|
|
329
|
+
}
|
|
330
|
+
),
|
|
331
|
+
s.map((x) => /* @__PURE__ */ e(
|
|
332
|
+
O,
|
|
333
|
+
{
|
|
334
|
+
onClick: () => re(x),
|
|
335
|
+
selected: x.name === m,
|
|
336
|
+
"aria-selected": x.name === m,
|
|
337
|
+
role: "option",
|
|
338
|
+
sx: { py: 1 },
|
|
339
|
+
children: x.name
|
|
340
|
+
},
|
|
341
|
+
x.id
|
|
342
|
+
))
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
),
|
|
346
|
+
/* @__PURE__ */ e(
|
|
347
|
+
v,
|
|
348
|
+
{
|
|
349
|
+
onClick: le,
|
|
350
|
+
"aria-label": "Applications menu",
|
|
351
|
+
"aria-haspopup": "menu",
|
|
352
|
+
"aria-expanded": !!C,
|
|
353
|
+
sx: {
|
|
354
|
+
color: t.effects.onDark.secondary,
|
|
355
|
+
// 70% white
|
|
356
|
+
"&:hover": {
|
|
357
|
+
backgroundColor: t.effects.onDark.subtle,
|
|
358
|
+
// 12% white
|
|
359
|
+
color: f.neutral.white
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
children: /* @__PURE__ */ e(Ze, {})
|
|
363
|
+
}
|
|
364
|
+
),
|
|
365
|
+
/* @__PURE__ */ i(
|
|
366
|
+
me,
|
|
367
|
+
{
|
|
368
|
+
anchorEl: C,
|
|
369
|
+
open: !!C,
|
|
370
|
+
onClose: Q,
|
|
371
|
+
anchorOrigin: {
|
|
372
|
+
vertical: "bottom",
|
|
373
|
+
horizontal: "right"
|
|
374
|
+
},
|
|
375
|
+
transformOrigin: {
|
|
376
|
+
vertical: "top",
|
|
377
|
+
horizontal: "right"
|
|
378
|
+
},
|
|
379
|
+
PaperProps: {
|
|
380
|
+
sx: {
|
|
381
|
+
mt: 1,
|
|
382
|
+
minWidth: 240,
|
|
383
|
+
borderRadius: t.borders.radiusPx.lg,
|
|
384
|
+
// 12px
|
|
385
|
+
boxShadow: t.effects.shadow.floating
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
children: [
|
|
389
|
+
/* @__PURE__ */ i(
|
|
390
|
+
O,
|
|
391
|
+
{
|
|
392
|
+
sx: { py: 1.5 },
|
|
393
|
+
onClick: () => te("trinity-edge"),
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ i(l, { sx: { flex: 1 }, children: [
|
|
396
|
+
/* @__PURE__ */ e(b, { variant: "subtitle2", fontWeight: 600, children: "TrinityEDGE" }),
|
|
397
|
+
/* @__PURE__ */ e(b, { variant: "caption", color: "text.secondary", children: "Apps Access" })
|
|
398
|
+
] }),
|
|
399
|
+
/* @__PURE__ */ e(Ce, { fontSize: "small", sx: { color: "text.secondary", ml: 2 } })
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
),
|
|
403
|
+
/* @__PURE__ */ e(pe, {}),
|
|
404
|
+
y.map((x) => /* @__PURE__ */ i(
|
|
405
|
+
O,
|
|
406
|
+
{
|
|
407
|
+
onClick: () => te(x.id),
|
|
408
|
+
sx: { py: 1, justifyContent: "space-between" },
|
|
409
|
+
children: [
|
|
410
|
+
/* @__PURE__ */ e(b, { variant: "body2", children: x.name }),
|
|
411
|
+
/* @__PURE__ */ e(Ce, { fontSize: "small", sx: { color: "text.secondary", ml: 2 } })
|
|
412
|
+
]
|
|
413
|
+
},
|
|
414
|
+
x.id
|
|
415
|
+
))
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
),
|
|
419
|
+
/* @__PURE__ */ i(
|
|
420
|
+
v,
|
|
421
|
+
{
|
|
422
|
+
onClick: ae,
|
|
423
|
+
"aria-label": `User menu for ${g}`,
|
|
424
|
+
"aria-haspopup": "menu",
|
|
425
|
+
"aria-expanded": !!I,
|
|
426
|
+
sx: {
|
|
427
|
+
display: "flex",
|
|
428
|
+
alignItems: "center",
|
|
429
|
+
borderRadius: t.borders.radiusPx.lg,
|
|
430
|
+
// 12px
|
|
431
|
+
padding: `${t.inline.tight}px ${t.inline.compact}px`,
|
|
432
|
+
// 4px 8px
|
|
433
|
+
"&:hover": {
|
|
434
|
+
backgroundColor: t.effects.onDark.subtle
|
|
435
|
+
// 12% white
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
children: [
|
|
439
|
+
/* @__PURE__ */ e(
|
|
440
|
+
Pe,
|
|
441
|
+
{
|
|
442
|
+
sx: {
|
|
443
|
+
width: he.avatar.size.sm,
|
|
444
|
+
height: he.avatar.size.sm,
|
|
445
|
+
fontSize: t.typography.label.small.fontSize,
|
|
446
|
+
// 12px
|
|
447
|
+
fontWeight: t.typography.heading.h6.fontWeight,
|
|
448
|
+
// 600
|
|
449
|
+
backgroundColor: f.primary.light,
|
|
450
|
+
color: "white"
|
|
451
|
+
},
|
|
452
|
+
children: u
|
|
453
|
+
}
|
|
454
|
+
),
|
|
455
|
+
/* @__PURE__ */ e(
|
|
456
|
+
De,
|
|
457
|
+
{
|
|
458
|
+
sx: {
|
|
459
|
+
color: t.effects.onDark.secondary,
|
|
460
|
+
// 70% white
|
|
461
|
+
fontSize: t.iconSize.navigation,
|
|
462
|
+
// 20px
|
|
463
|
+
ml: 0.5
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
)
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
),
|
|
470
|
+
/* @__PURE__ */ i(
|
|
471
|
+
me,
|
|
472
|
+
{
|
|
473
|
+
anchorEl: I,
|
|
474
|
+
open: !!I,
|
|
475
|
+
onClose: ne,
|
|
476
|
+
anchorOrigin: {
|
|
477
|
+
vertical: "bottom",
|
|
478
|
+
horizontal: "right"
|
|
479
|
+
},
|
|
480
|
+
transformOrigin: {
|
|
481
|
+
vertical: "top",
|
|
482
|
+
horizontal: "right"
|
|
483
|
+
},
|
|
484
|
+
PaperProps: {
|
|
485
|
+
sx: {
|
|
486
|
+
mt: 1,
|
|
487
|
+
minWidth: 240,
|
|
488
|
+
borderRadius: t.borders.radiusPx.lg,
|
|
489
|
+
// 12px
|
|
490
|
+
boxShadow: t.effects.shadow.floating
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
children: [
|
|
494
|
+
/* @__PURE__ */ i(l, { sx: { px: 2, py: 1.5, display: "flex", alignItems: "center", gap: 1.5 }, children: [
|
|
495
|
+
/* @__PURE__ */ e(
|
|
496
|
+
Pe,
|
|
497
|
+
{
|
|
498
|
+
sx: {
|
|
499
|
+
width: he.avatar.size.md,
|
|
500
|
+
height: he.avatar.size.md,
|
|
501
|
+
fontSize: t.typography.body.small.fontSize,
|
|
502
|
+
// 14px
|
|
503
|
+
fontWeight: t.typography.heading.h6.fontWeight,
|
|
504
|
+
// 600
|
|
505
|
+
backgroundColor: f.primary.light,
|
|
506
|
+
color: "white"
|
|
507
|
+
},
|
|
508
|
+
children: u
|
|
509
|
+
}
|
|
510
|
+
),
|
|
511
|
+
/* @__PURE__ */ i(l, { children: [
|
|
512
|
+
/* @__PURE__ */ e(b, { variant: "subtitle2", fontWeight: 600, children: g }),
|
|
513
|
+
/* @__PURE__ */ e(b, { variant: "caption", color: "text.secondary", children: c })
|
|
514
|
+
] })
|
|
515
|
+
] }),
|
|
516
|
+
/* @__PURE__ */ e(pe, {}),
|
|
517
|
+
/* @__PURE__ */ i(O, { onClick: () => G("help"), sx: { py: 1.5 }, children: [
|
|
518
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(Fe, { fontSize: "small" }) }),
|
|
519
|
+
/* @__PURE__ */ e(ee, { primary: "Help" }),
|
|
520
|
+
/* @__PURE__ */ e(Ce, { fontSize: "small", sx: { color: "text.secondary" } })
|
|
521
|
+
] }),
|
|
522
|
+
/* @__PURE__ */ i(O, { onClick: () => G("notifications"), sx: { py: 1.5 }, children: [
|
|
523
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(je, { fontSize: "small" }) }),
|
|
524
|
+
/* @__PURE__ */ e(ee, { primary: "Notification" })
|
|
525
|
+
] }),
|
|
526
|
+
/* @__PURE__ */ i(O, { onClick: () => G("logout"), sx: { py: 1.5 }, children: [
|
|
527
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(en, { fontSize: "small" }) }),
|
|
528
|
+
/* @__PURE__ */ e(ee, { primary: "Log out" })
|
|
529
|
+
] })
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
] })
|
|
534
|
+
]
|
|
535
|
+
}
|
|
536
|
+
),
|
|
537
|
+
/* @__PURE__ */ e(
|
|
538
|
+
Xe,
|
|
539
|
+
{
|
|
540
|
+
anchor: "top",
|
|
541
|
+
open: V,
|
|
542
|
+
onClose: J,
|
|
543
|
+
sx: {
|
|
544
|
+
display: { xs: "block", md: "none" },
|
|
545
|
+
"& .MuiDrawer-paper": {
|
|
546
|
+
backgroundColor: f.primary.main,
|
|
547
|
+
pt: 1,
|
|
548
|
+
pb: 2
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
children: /* @__PURE__ */ i(l, { sx: { px: 2 }, children: [
|
|
552
|
+
/* @__PURE__ */ i(l, { sx: { display: "flex", alignItems: "center", gap: 1, mb: 2 }, children: [
|
|
553
|
+
/* @__PURE__ */ e(
|
|
554
|
+
v,
|
|
555
|
+
{
|
|
556
|
+
onClick: J,
|
|
557
|
+
"aria-label": "Close search",
|
|
558
|
+
sx: { color: "white" },
|
|
559
|
+
children: /* @__PURE__ */ e(Ye, {})
|
|
560
|
+
}
|
|
561
|
+
),
|
|
562
|
+
/* @__PURE__ */ e(b, { variant: "subtitle1", sx: { color: "white", fontWeight: 500 }, children: "Search" })
|
|
563
|
+
] }),
|
|
564
|
+
/* @__PURE__ */ i(rn, { focused: "true", sx: { maxWidth: "none", mx: 0 }, children: [
|
|
565
|
+
/* @__PURE__ */ e(an, { focused: "true", children: /* @__PURE__ */ e(ge, {}) }),
|
|
566
|
+
/* @__PURE__ */ e(
|
|
567
|
+
ln,
|
|
568
|
+
{
|
|
569
|
+
placeholder: "Search...",
|
|
570
|
+
inputProps: { "aria-label": "search" },
|
|
571
|
+
value: M,
|
|
572
|
+
onChange: P,
|
|
573
|
+
onKeyPress: (x) => {
|
|
574
|
+
x.key === "Enter" && fe();
|
|
575
|
+
},
|
|
576
|
+
autoFocus: !0,
|
|
577
|
+
focused: "true"
|
|
578
|
+
}
|
|
579
|
+
),
|
|
580
|
+
/* @__PURE__ */ e(
|
|
581
|
+
sn,
|
|
582
|
+
{
|
|
583
|
+
show: (M.length > 0).toString(),
|
|
584
|
+
onClick: ce,
|
|
585
|
+
size: "small",
|
|
586
|
+
"aria-label": "Clear search",
|
|
587
|
+
children: /* @__PURE__ */ e(Ee, { fontSize: "small" })
|
|
588
|
+
}
|
|
589
|
+
)
|
|
590
|
+
] })
|
|
591
|
+
] })
|
|
592
|
+
}
|
|
593
|
+
)
|
|
594
|
+
]
|
|
595
|
+
}
|
|
596
|
+
);
|
|
597
|
+
}
|
|
598
|
+
const He = 200, Xn = 56, cn = $("div")(({ theme: n, focused: o }) => ({
|
|
599
|
+
position: "relative",
|
|
600
|
+
borderRadius: `${t.borders.radius.menu}px`,
|
|
601
|
+
// 12px
|
|
602
|
+
backgroundColor: o === "true" ? n.palette.common.white : t.effects.onDark.subtle,
|
|
603
|
+
// 12% white
|
|
604
|
+
"&:hover": {
|
|
605
|
+
backgroundColor: o === "true" ? n.palette.common.white : "rgba(255, 255, 255, 0.15)"
|
|
606
|
+
// @intentional-color: hover state
|
|
607
|
+
},
|
|
608
|
+
marginRight: n.spacing(2),
|
|
609
|
+
marginLeft: n.spacing(2),
|
|
610
|
+
width: "100%",
|
|
611
|
+
maxWidth: 400,
|
|
612
|
+
transition: n.transitions.create(["background-color"]),
|
|
613
|
+
[n.breakpoints.up("sm")]: {
|
|
614
|
+
marginLeft: n.spacing(3),
|
|
615
|
+
width: "auto",
|
|
616
|
+
minWidth: 300
|
|
617
|
+
}
|
|
618
|
+
})), dn = $("div")(({ theme: n, focused: o }) => ({
|
|
619
|
+
padding: n.spacing(0, 2),
|
|
620
|
+
height: "100%",
|
|
621
|
+
position: "absolute",
|
|
622
|
+
pointerEvents: "none",
|
|
623
|
+
display: "flex",
|
|
624
|
+
alignItems: "center",
|
|
625
|
+
justifyContent: "center",
|
|
626
|
+
color: o === "true" ? f.primary.main : _(n.palette.common.white, 0.5)
|
|
627
|
+
})), hn = $(qe)(({ theme: n, focused: o }) => ({
|
|
628
|
+
color: o === "true" ? f.primary.main : "inherit",
|
|
629
|
+
width: "100%",
|
|
630
|
+
"& .MuiInputBase-input": {
|
|
631
|
+
padding: n.spacing(1, 4, 1, 0),
|
|
632
|
+
paddingLeft: `calc(1em + ${n.spacing(4)})`,
|
|
633
|
+
transition: n.transitions.create("width"),
|
|
634
|
+
width: "100%",
|
|
635
|
+
fontSize: t.typography.body.small.fontSize,
|
|
636
|
+
// 14px
|
|
637
|
+
"&::placeholder": {
|
|
638
|
+
color: o === "true" ? f.neutral.gray500 : _(n.palette.common.white, 0.5),
|
|
639
|
+
opacity: 1
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
})), pn = $(v)(({ show: n }) => ({
|
|
643
|
+
position: "absolute",
|
|
644
|
+
right: t.inline.tight,
|
|
645
|
+
// 4px
|
|
646
|
+
top: "50%",
|
|
647
|
+
transform: "translateY(-50%)",
|
|
648
|
+
padding: t.inline.tight,
|
|
649
|
+
// 4px
|
|
650
|
+
opacity: n === "true" ? 1 : 0,
|
|
651
|
+
pointerEvents: n === "true" ? "auto" : "none",
|
|
652
|
+
color: f.neutral.gray500,
|
|
653
|
+
"&:hover": {
|
|
654
|
+
backgroundColor: t.effects.overlay.hover
|
|
655
|
+
// 8%
|
|
656
|
+
}
|
|
657
|
+
})), Yn = $(Je)(({ theme: n }) => ({
|
|
658
|
+
backgroundColor: t.effects.onDark.subtle,
|
|
659
|
+
// 12% white
|
|
660
|
+
color: n.palette.common.white,
|
|
661
|
+
borderRadius: `${t.borders.radius.menu}px`,
|
|
662
|
+
// 12px
|
|
663
|
+
padding: `${t.density.compact.cellPadding}px ${t.density.standard.cellPadding}px`,
|
|
664
|
+
// 6px 12px
|
|
665
|
+
textTransform: "none",
|
|
666
|
+
fontSize: t.typography.body.small.fontSize,
|
|
667
|
+
// 14px
|
|
668
|
+
fontWeight: t.typography.body.small.fontWeight,
|
|
669
|
+
// 400
|
|
670
|
+
minWidth: 180,
|
|
671
|
+
justifyContent: "space-between",
|
|
672
|
+
"&:hover": {
|
|
673
|
+
backgroundColor: "rgba(255, 255, 255, 0.15)"
|
|
674
|
+
// @intentional-color: hover state
|
|
675
|
+
}
|
|
676
|
+
})), qn = () => /* @__PURE__ */ e(l, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ e("img", { src: nn, alt: "Trinity", height: 28 }) }), Jn = [
|
|
677
|
+
{ id: "home", label: "Home", icon: /* @__PURE__ */ e(Mn, {}) },
|
|
678
|
+
{ id: "menu2", label: "Menu 2", icon: /* @__PURE__ */ e(Ln, {}) },
|
|
679
|
+
{ id: "menu3", label: "Menu 3", icon: /* @__PURE__ */ e(Rn, {}) },
|
|
680
|
+
{ id: "menu4", label: "Menu 4", icon: /* @__PURE__ */ e(Bn, {}) },
|
|
681
|
+
{ id: "menu5", label: "Menu 5", icon: /* @__PURE__ */ e(Hn, {}) },
|
|
682
|
+
{ id: "insight-engine", label: "Insight Engine", icon: /* @__PURE__ */ e(bn, {}), isSpecial: !0 }
|
|
683
|
+
];
|
|
684
|
+
function Zn({
|
|
685
|
+
appName: n = "App Name",
|
|
686
|
+
clientName: o = "Long Client Name 1",
|
|
687
|
+
clients: s = [
|
|
688
|
+
{ id: "1", name: "Long Client Name 1" },
|
|
689
|
+
{ id: "2", name: "Long Client Name 2" },
|
|
690
|
+
{ id: "3", name: "Long Client Name 3" },
|
|
691
|
+
{ id: "4", name: "Client ABC" },
|
|
692
|
+
{ id: "5", name: "Client XYZ" }
|
|
693
|
+
],
|
|
694
|
+
onClientChange: a,
|
|
695
|
+
userInitials: u = "RD",
|
|
696
|
+
userName: g = "Rahul M Desai",
|
|
697
|
+
userEmail: c = "rdesai@trinitylifesciences.com",
|
|
698
|
+
onSearch: h,
|
|
699
|
+
onAppsClick: A,
|
|
700
|
+
onUserMenuClick: E,
|
|
701
|
+
apps: y = [
|
|
702
|
+
{ id: "launch-accelerator", name: "Launch Accelerator" },
|
|
703
|
+
{ id: "cloudcast", name: "CloudCast" },
|
|
704
|
+
{ id: "terra", name: "Terra" },
|
|
705
|
+
{ id: "market-intelligence", name: "Market Intelligence Dashboard" }
|
|
706
|
+
],
|
|
707
|
+
navItems: k = Jn,
|
|
708
|
+
selectedNavItem: L = "home",
|
|
709
|
+
onNavItemClick: N,
|
|
710
|
+
children: B,
|
|
711
|
+
sidebarExpanded: q,
|
|
712
|
+
onSidebarExpandedChange: I
|
|
713
|
+
}) {
|
|
714
|
+
const R = we(), C = Ae(R.breakpoints.down("md"));
|
|
715
|
+
Ae(R.breakpoints.down("sm"));
|
|
716
|
+
const [D, m] = H.useState(null), [T, M] = H.useState(null), [F, K] = H.useState(null), [S, V] = H.useState(o), [d, w] = H.useState(""), [oe, re] = H.useState(!1), [ae, ne] = H.useState(!0), [G, le] = H.useState(L), Q = q ?? ae, te = (r) => {
|
|
717
|
+
ne(r), I?.(r);
|
|
718
|
+
}, [P, se] = H.useState(!1), [ce, Se] = H.useState(!1), J = C || Q ? He : Xn, fe = () => {
|
|
719
|
+
C ? se(!P) : te(!Q);
|
|
720
|
+
}, x = () => {
|
|
721
|
+
se(!1);
|
|
722
|
+
}, Ue = () => {
|
|
723
|
+
Se(!0);
|
|
724
|
+
}, ve = () => {
|
|
725
|
+
Se(!1), w(""), re(!1);
|
|
726
|
+
}, Ke = () => {
|
|
727
|
+
d.trim() && (h?.(d), ve());
|
|
728
|
+
}, Me = (r) => {
|
|
729
|
+
le(r), N?.(r), C && x();
|
|
730
|
+
}, Ve = (r) => {
|
|
731
|
+
m(r.currentTarget);
|
|
732
|
+
}, Le = () => {
|
|
733
|
+
m(null);
|
|
734
|
+
}, ue = (r) => {
|
|
735
|
+
V(r.name), a?.(r.id), Le();
|
|
736
|
+
}, ke = (r) => {
|
|
737
|
+
M(r.currentTarget);
|
|
738
|
+
}, ie = () => {
|
|
739
|
+
M(null);
|
|
740
|
+
}, ze = (r) => {
|
|
741
|
+
E?.(r), ie();
|
|
742
|
+
}, Qe = (r) => {
|
|
743
|
+
K(r.currentTarget);
|
|
744
|
+
}, Re = () => {
|
|
745
|
+
K(null);
|
|
746
|
+
}, Be = (r) => {
|
|
747
|
+
A?.(r), Re();
|
|
748
|
+
}, Ie = (r) => {
|
|
749
|
+
w(r.target.value);
|
|
750
|
+
}, We = (r) => {
|
|
751
|
+
r.key === "Enter" && h?.(d);
|
|
752
|
+
}, p = () => {
|
|
753
|
+
w("");
|
|
754
|
+
};
|
|
755
|
+
return /* @__PURE__ */ i(l, { sx: { display: "flex", minHeight: "100vh" }, children: [
|
|
756
|
+
/* @__PURE__ */ i(
|
|
757
|
+
mn,
|
|
758
|
+
{
|
|
759
|
+
position: "fixed",
|
|
760
|
+
elevation: 0,
|
|
761
|
+
component: "header",
|
|
762
|
+
sx: {
|
|
763
|
+
backgroundColor: f.primary.main,
|
|
764
|
+
borderBottom: `1px solid ${t.effects.onDark.subtle}`,
|
|
765
|
+
// 12% white
|
|
766
|
+
borderRadius: 0,
|
|
767
|
+
zIndex: (r) => r.zIndex.drawer + 1
|
|
768
|
+
},
|
|
769
|
+
children: [
|
|
770
|
+
/* @__PURE__ */ i(un, { sx: { minHeight: 56, px: { xs: 1, sm: 2 } }, children: [
|
|
771
|
+
/* @__PURE__ */ e(
|
|
772
|
+
v,
|
|
773
|
+
{
|
|
774
|
+
onClick: fe,
|
|
775
|
+
"aria-label": Q ? "Collapse sidebar navigation" : "Expand sidebar navigation",
|
|
776
|
+
"aria-expanded": Q,
|
|
777
|
+
"aria-controls": "sidebar-navigation",
|
|
778
|
+
sx: {
|
|
779
|
+
color: "white",
|
|
780
|
+
mr: 1,
|
|
781
|
+
"&:hover": {
|
|
782
|
+
backgroundColor: t.effects.onDark.subtle
|
|
783
|
+
// 12% white
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
children: /* @__PURE__ */ e(Tn, {})
|
|
787
|
+
}
|
|
788
|
+
),
|
|
789
|
+
/* @__PURE__ */ i(l, { sx: { display: "flex", alignItems: "center", gap: { xs: 1, sm: 2 }, minWidth: 0 }, children: [
|
|
790
|
+
/* @__PURE__ */ e(qn, {}),
|
|
791
|
+
/* @__PURE__ */ e(
|
|
792
|
+
pe,
|
|
793
|
+
{
|
|
794
|
+
orientation: "vertical",
|
|
795
|
+
flexItem: !0,
|
|
796
|
+
sx: {
|
|
797
|
+
backgroundColor: "rgba(255, 255, 255, 0.3)",
|
|
798
|
+
// @intentional-color: decorative divider
|
|
799
|
+
height: t.iconSize.prominent,
|
|
800
|
+
// 24px
|
|
801
|
+
alignSelf: "center",
|
|
802
|
+
display: { xs: "none", sm: "block" }
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
),
|
|
806
|
+
/* @__PURE__ */ e(
|
|
807
|
+
b,
|
|
808
|
+
{
|
|
809
|
+
variant: "subtitle1",
|
|
810
|
+
noWrap: !0,
|
|
811
|
+
sx: {
|
|
812
|
+
color: "white",
|
|
813
|
+
fontWeight: t.typography.label.medium.fontWeight,
|
|
814
|
+
// 500
|
|
815
|
+
fontSize: t.typography.body.small.fontSize,
|
|
816
|
+
// 14px
|
|
817
|
+
display: { xs: "none", sm: "block" }
|
|
818
|
+
},
|
|
819
|
+
children: n
|
|
820
|
+
}
|
|
821
|
+
)
|
|
822
|
+
] }),
|
|
823
|
+
/* @__PURE__ */ e(l, { sx: { flexGrow: 1, display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ i(
|
|
824
|
+
cn,
|
|
825
|
+
{
|
|
826
|
+
focused: oe.toString(),
|
|
827
|
+
sx: { display: { xs: "none", md: "flex" } },
|
|
828
|
+
children: [
|
|
829
|
+
/* @__PURE__ */ e(dn, { focused: oe.toString(), children: /* @__PURE__ */ e(ge, {}) }),
|
|
830
|
+
/* @__PURE__ */ e(
|
|
831
|
+
hn,
|
|
832
|
+
{
|
|
833
|
+
placeholder: "Search",
|
|
834
|
+
inputProps: { "aria-label": "search" },
|
|
835
|
+
value: d,
|
|
836
|
+
onChange: Ie,
|
|
837
|
+
onKeyPress: We,
|
|
838
|
+
onFocus: () => re(!0),
|
|
839
|
+
onBlur: () => re(!1),
|
|
840
|
+
focused: oe.toString()
|
|
841
|
+
}
|
|
842
|
+
),
|
|
843
|
+
/* @__PURE__ */ e(
|
|
844
|
+
pn,
|
|
845
|
+
{
|
|
846
|
+
show: (d.length > 0).toString(),
|
|
847
|
+
onClick: p,
|
|
848
|
+
size: "small",
|
|
849
|
+
"aria-label": "Clear search",
|
|
850
|
+
children: /* @__PURE__ */ e(Ee, { fontSize: "small" })
|
|
851
|
+
}
|
|
852
|
+
)
|
|
853
|
+
]
|
|
854
|
+
}
|
|
855
|
+
) }),
|
|
856
|
+
/* @__PURE__ */ e(
|
|
857
|
+
v,
|
|
858
|
+
{
|
|
859
|
+
onClick: Ue,
|
|
860
|
+
"aria-label": "Open search",
|
|
861
|
+
sx: {
|
|
862
|
+
display: { xs: "flex", md: "none" },
|
|
863
|
+
color: t.effects.onDark.secondary,
|
|
864
|
+
"&:hover": {
|
|
865
|
+
backgroundColor: t.effects.onDark.subtle,
|
|
866
|
+
color: f.neutral.white
|
|
867
|
+
}
|
|
868
|
+
},
|
|
869
|
+
children: /* @__PURE__ */ e(ge, {})
|
|
870
|
+
}
|
|
871
|
+
),
|
|
872
|
+
/* @__PURE__ */ i(l, { sx: { display: "flex", alignItems: "center", gap: { xs: 0.5, sm: 1.5 } }, children: [
|
|
873
|
+
/* @__PURE__ */ e(
|
|
874
|
+
Yn,
|
|
875
|
+
{
|
|
876
|
+
onClick: Ve,
|
|
877
|
+
endIcon: /* @__PURE__ */ e(De, {}),
|
|
878
|
+
"aria-label": `Current client: ${S}. Click to switch clients`,
|
|
879
|
+
"aria-haspopup": "listbox",
|
|
880
|
+
"aria-expanded": !!D,
|
|
881
|
+
sx: {
|
|
882
|
+
minWidth: { xs: 100, sm: 180 },
|
|
883
|
+
maxWidth: { xs: 120, sm: "none" },
|
|
884
|
+
display: { xs: "none", sm: "flex" },
|
|
885
|
+
"& .MuiButton-endIcon": {
|
|
886
|
+
ml: { xs: 0, sm: 1 }
|
|
887
|
+
}
|
|
888
|
+
},
|
|
889
|
+
children: /* @__PURE__ */ e(b, { noWrap: !0, sx: { maxWidth: { xs: 80, sm: "none" } }, children: S })
|
|
890
|
+
}
|
|
891
|
+
),
|
|
892
|
+
/* @__PURE__ */ i(
|
|
893
|
+
me,
|
|
894
|
+
{
|
|
895
|
+
anchorEl: D,
|
|
896
|
+
open: !!D,
|
|
897
|
+
onClose: Le,
|
|
898
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
899
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
900
|
+
PaperProps: {
|
|
901
|
+
sx: { mt: 1, minWidth: 220, borderRadius: t.borders.radiusPx.lg, boxShadow: t.effects.shadow.floating }
|
|
902
|
+
},
|
|
903
|
+
children: [
|
|
904
|
+
/* @__PURE__ */ e(b, { variant: "subtitle2", sx: { px: 2, py: 1.5, fontWeight: t.typography.label.medium.fontWeight }, children: "Switch Clients" }),
|
|
905
|
+
s.map((r) => /* @__PURE__ */ e(
|
|
906
|
+
O,
|
|
907
|
+
{
|
|
908
|
+
onClick: () => ue(r),
|
|
909
|
+
selected: r.name === S,
|
|
910
|
+
sx: { py: 1 },
|
|
911
|
+
children: r.name
|
|
912
|
+
},
|
|
913
|
+
r.id
|
|
914
|
+
))
|
|
915
|
+
]
|
|
916
|
+
}
|
|
917
|
+
),
|
|
918
|
+
/* @__PURE__ */ e(
|
|
919
|
+
v,
|
|
920
|
+
{
|
|
921
|
+
onClick: Qe,
|
|
922
|
+
"aria-label": "Applications menu",
|
|
923
|
+
"aria-haspopup": "menu",
|
|
924
|
+
"aria-expanded": !!F,
|
|
925
|
+
sx: {
|
|
926
|
+
color: t.effects.onDark.secondary,
|
|
927
|
+
// 70% white
|
|
928
|
+
"&:hover": { backgroundColor: t.effects.onDark.subtle, color: f.neutral.white }
|
|
929
|
+
},
|
|
930
|
+
children: /* @__PURE__ */ e(Ze, {})
|
|
931
|
+
}
|
|
932
|
+
),
|
|
933
|
+
/* @__PURE__ */ i(
|
|
934
|
+
me,
|
|
935
|
+
{
|
|
936
|
+
anchorEl: F,
|
|
937
|
+
open: !!F,
|
|
938
|
+
onClose: Re,
|
|
939
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
940
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
941
|
+
PaperProps: {
|
|
942
|
+
sx: { mt: 1, minWidth: 240, borderRadius: t.borders.radiusPx.lg, boxShadow: t.effects.shadow.floating }
|
|
943
|
+
},
|
|
944
|
+
children: [
|
|
945
|
+
/* @__PURE__ */ i(O, { sx: { py: 1.5 }, onClick: () => Be("trinity-edge"), children: [
|
|
946
|
+
/* @__PURE__ */ i(l, { sx: { flex: 1 }, children: [
|
|
947
|
+
/* @__PURE__ */ e(b, { variant: "subtitle2", fontWeight: t.typography.label.medium.fontWeight, children: "TrinityEDGE" }),
|
|
948
|
+
/* @__PURE__ */ e(b, { variant: "caption", color: "text.secondary", children: "Apps Access" })
|
|
949
|
+
] }),
|
|
950
|
+
/* @__PURE__ */ e(Ce, { fontSize: "small", sx: { color: "text.secondary", ml: 2 } })
|
|
951
|
+
] }),
|
|
952
|
+
/* @__PURE__ */ e(pe, {}),
|
|
953
|
+
y.map((r) => /* @__PURE__ */ i(O, { onClick: () => Be(r.id), sx: { py: 1, justifyContent: "space-between" }, children: [
|
|
954
|
+
/* @__PURE__ */ e(b, { variant: "body2", children: r.name }),
|
|
955
|
+
/* @__PURE__ */ e(Ce, { fontSize: "small", sx: { color: "text.secondary", ml: 2 } })
|
|
956
|
+
] }, r.id))
|
|
957
|
+
]
|
|
958
|
+
}
|
|
959
|
+
),
|
|
960
|
+
/* @__PURE__ */ i(
|
|
961
|
+
v,
|
|
962
|
+
{
|
|
963
|
+
onClick: ke,
|
|
964
|
+
"aria-label": `User menu for ${g}`,
|
|
965
|
+
"aria-haspopup": "menu",
|
|
966
|
+
"aria-expanded": !!T,
|
|
967
|
+
sx: {
|
|
968
|
+
display: "flex",
|
|
969
|
+
alignItems: "center",
|
|
970
|
+
borderRadius: t.borders.radiusPx.lg,
|
|
971
|
+
// 12px
|
|
972
|
+
padding: `${t.inline.tight}px ${t.inline.compact}px`,
|
|
973
|
+
// 4px 8px
|
|
974
|
+
"&:hover": { backgroundColor: t.effects.onDark.subtle }
|
|
975
|
+
},
|
|
976
|
+
children: [
|
|
977
|
+
/* @__PURE__ */ e(
|
|
978
|
+
Pe,
|
|
979
|
+
{
|
|
980
|
+
sx: {
|
|
981
|
+
width: he.avatar.size.sm,
|
|
982
|
+
height: he.avatar.size.sm,
|
|
983
|
+
fontSize: t.typography.label.small.fontSize,
|
|
984
|
+
// 12px
|
|
985
|
+
fontWeight: t.typography.heading.h6.fontWeight,
|
|
986
|
+
// 600
|
|
987
|
+
backgroundColor: f.primary.light,
|
|
988
|
+
color: "white"
|
|
989
|
+
},
|
|
990
|
+
children: u
|
|
991
|
+
}
|
|
992
|
+
),
|
|
993
|
+
/* @__PURE__ */ e(De, { sx: { color: t.effects.onDark.secondary, fontSize: t.iconSize.navigation, ml: 0.5 } })
|
|
994
|
+
]
|
|
995
|
+
}
|
|
996
|
+
),
|
|
997
|
+
/* @__PURE__ */ i(
|
|
998
|
+
me,
|
|
999
|
+
{
|
|
1000
|
+
anchorEl: T,
|
|
1001
|
+
open: !!T,
|
|
1002
|
+
onClose: ie,
|
|
1003
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1004
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
1005
|
+
PaperProps: {
|
|
1006
|
+
sx: { mt: 1, minWidth: 240, borderRadius: t.borders.radiusPx.lg, boxShadow: t.effects.shadow.floating }
|
|
1007
|
+
},
|
|
1008
|
+
children: [
|
|
1009
|
+
/* @__PURE__ */ i(l, { sx: { px: 2, py: 1.5, display: "flex", alignItems: "center", gap: 1.5 }, children: [
|
|
1010
|
+
/* @__PURE__ */ e(
|
|
1011
|
+
Pe,
|
|
1012
|
+
{
|
|
1013
|
+
sx: {
|
|
1014
|
+
width: he.avatar.size.md,
|
|
1015
|
+
height: he.avatar.size.md,
|
|
1016
|
+
fontSize: t.typography.body.small.fontSize,
|
|
1017
|
+
// 14px
|
|
1018
|
+
fontWeight: t.typography.heading.h6.fontWeight,
|
|
1019
|
+
// 600
|
|
1020
|
+
backgroundColor: f.primary.light,
|
|
1021
|
+
color: "white"
|
|
1022
|
+
},
|
|
1023
|
+
children: u
|
|
1024
|
+
}
|
|
1025
|
+
),
|
|
1026
|
+
/* @__PURE__ */ i(l, { children: [
|
|
1027
|
+
/* @__PURE__ */ e(b, { variant: "subtitle2", fontWeight: t.typography.heading.h6.fontWeight, children: g }),
|
|
1028
|
+
/* @__PURE__ */ e(b, { variant: "caption", color: "text.secondary", children: c })
|
|
1029
|
+
] })
|
|
1030
|
+
] }),
|
|
1031
|
+
/* @__PURE__ */ e(pe, {}),
|
|
1032
|
+
/* @__PURE__ */ i(O, { onClick: () => ze("help"), sx: { py: 1.5 }, children: [
|
|
1033
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(Fe, { fontSize: "small" }) }),
|
|
1034
|
+
/* @__PURE__ */ e(ee, { primary: "Help" }),
|
|
1035
|
+
/* @__PURE__ */ e(Ce, { fontSize: "small", sx: { color: "text.secondary" } })
|
|
1036
|
+
] }),
|
|
1037
|
+
/* @__PURE__ */ i(O, { onClick: () => ze("notifications"), sx: { py: 1.5 }, children: [
|
|
1038
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(je, { fontSize: "small" }) }),
|
|
1039
|
+
/* @__PURE__ */ e(ee, { primary: "Notification" })
|
|
1040
|
+
] }),
|
|
1041
|
+
/* @__PURE__ */ i(O, { onClick: () => ze("logout"), sx: { py: 1.5 }, children: [
|
|
1042
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(en, { fontSize: "small" }) }),
|
|
1043
|
+
/* @__PURE__ */ e(ee, { primary: "Log out" })
|
|
1044
|
+
] })
|
|
1045
|
+
]
|
|
1046
|
+
}
|
|
1047
|
+
)
|
|
1048
|
+
] })
|
|
1049
|
+
] }),
|
|
1050
|
+
/* @__PURE__ */ e(
|
|
1051
|
+
Xe,
|
|
1052
|
+
{
|
|
1053
|
+
anchor: "top",
|
|
1054
|
+
open: ce,
|
|
1055
|
+
onClose: ve,
|
|
1056
|
+
sx: {
|
|
1057
|
+
display: { xs: "block", md: "none" },
|
|
1058
|
+
"& .MuiDrawer-paper": {
|
|
1059
|
+
backgroundColor: f.primary.main,
|
|
1060
|
+
pt: 1,
|
|
1061
|
+
pb: 2
|
|
1062
|
+
}
|
|
1063
|
+
},
|
|
1064
|
+
children: /* @__PURE__ */ i(l, { sx: { px: 2 }, children: [
|
|
1065
|
+
/* @__PURE__ */ i(l, { sx: { display: "flex", alignItems: "center", gap: 1, mb: 2 }, children: [
|
|
1066
|
+
/* @__PURE__ */ e(
|
|
1067
|
+
v,
|
|
1068
|
+
{
|
|
1069
|
+
onClick: ve,
|
|
1070
|
+
"aria-label": "Close search",
|
|
1071
|
+
sx: { color: "white" },
|
|
1072
|
+
children: /* @__PURE__ */ e(Ye, {})
|
|
1073
|
+
}
|
|
1074
|
+
),
|
|
1075
|
+
/* @__PURE__ */ e(b, { variant: "subtitle1", sx: { color: "white", fontWeight: 500 }, children: "Search" })
|
|
1076
|
+
] }),
|
|
1077
|
+
/* @__PURE__ */ i(cn, { focused: "true", sx: { maxWidth: "none", mx: 0 }, children: [
|
|
1078
|
+
/* @__PURE__ */ e(dn, { focused: "true", children: /* @__PURE__ */ e(ge, {}) }),
|
|
1079
|
+
/* @__PURE__ */ e(
|
|
1080
|
+
hn,
|
|
1081
|
+
{
|
|
1082
|
+
placeholder: "Search...",
|
|
1083
|
+
inputProps: { "aria-label": "search" },
|
|
1084
|
+
value: d,
|
|
1085
|
+
onChange: Ie,
|
|
1086
|
+
onKeyPress: (r) => {
|
|
1087
|
+
r.key === "Enter" && Ke();
|
|
1088
|
+
},
|
|
1089
|
+
focused: "true"
|
|
1090
|
+
}
|
|
1091
|
+
),
|
|
1092
|
+
/* @__PURE__ */ e(
|
|
1093
|
+
pn,
|
|
1094
|
+
{
|
|
1095
|
+
show: (d.length > 0).toString(),
|
|
1096
|
+
onClick: p,
|
|
1097
|
+
size: "small",
|
|
1098
|
+
"aria-label": "Clear search",
|
|
1099
|
+
children: /* @__PURE__ */ e(Ee, { fontSize: "small" })
|
|
1100
|
+
}
|
|
1101
|
+
)
|
|
1102
|
+
] })
|
|
1103
|
+
] })
|
|
1104
|
+
}
|
|
1105
|
+
)
|
|
1106
|
+
]
|
|
1107
|
+
}
|
|
1108
|
+
),
|
|
1109
|
+
/* @__PURE__ */ i(
|
|
1110
|
+
Xe,
|
|
1111
|
+
{
|
|
1112
|
+
variant: C ? "temporary" : "permanent",
|
|
1113
|
+
open: C ? P : !0,
|
|
1114
|
+
onClose: x,
|
|
1115
|
+
id: "sidebar-navigation",
|
|
1116
|
+
ModalProps: {
|
|
1117
|
+
keepMounted: !0
|
|
1118
|
+
// Better mobile performance
|
|
1119
|
+
},
|
|
1120
|
+
sx: {
|
|
1121
|
+
width: C ? He : J,
|
|
1122
|
+
flexShrink: 0,
|
|
1123
|
+
display: { xs: "block" },
|
|
1124
|
+
"& .MuiDrawer-paper": {
|
|
1125
|
+
width: C ? He : J,
|
|
1126
|
+
boxSizing: "border-box",
|
|
1127
|
+
borderRight: "1px solid",
|
|
1128
|
+
borderColor: "divider",
|
|
1129
|
+
backgroundColor: "background.paper",
|
|
1130
|
+
transition: (r) => r.transitions.create("width", {
|
|
1131
|
+
easing: r.transitions.easing.sharp,
|
|
1132
|
+
duration: r.transitions.duration.enteringScreen
|
|
1133
|
+
}),
|
|
1134
|
+
overflowX: "hidden",
|
|
1135
|
+
mt: C ? 0 : "56px"
|
|
1136
|
+
// No top margin on mobile (overlay)
|
|
1137
|
+
}
|
|
1138
|
+
},
|
|
1139
|
+
children: [
|
|
1140
|
+
C && /* @__PURE__ */ i(
|
|
1141
|
+
l,
|
|
1142
|
+
{
|
|
1143
|
+
sx: {
|
|
1144
|
+
display: "flex",
|
|
1145
|
+
alignItems: "center",
|
|
1146
|
+
justifyContent: "space-between",
|
|
1147
|
+
p: 2,
|
|
1148
|
+
borderBottom: "1px solid",
|
|
1149
|
+
borderColor: "divider"
|
|
1150
|
+
},
|
|
1151
|
+
children: [
|
|
1152
|
+
/* @__PURE__ */ e(b, { variant: "subtitle1", fontWeight: 600, children: "Navigation" }),
|
|
1153
|
+
/* @__PURE__ */ e(v, { onClick: x, "aria-label": "Close navigation", children: /* @__PURE__ */ e(Ye, {}) })
|
|
1154
|
+
]
|
|
1155
|
+
}
|
|
1156
|
+
),
|
|
1157
|
+
/* @__PURE__ */ e(
|
|
1158
|
+
gn,
|
|
1159
|
+
{
|
|
1160
|
+
component: "nav",
|
|
1161
|
+
"aria-label": "Main navigation",
|
|
1162
|
+
sx: { pt: C ? 1 : 2 },
|
|
1163
|
+
children: k.map((r) => {
|
|
1164
|
+
const j = G === r.id, xe = r.isSpecial, be = C || Q;
|
|
1165
|
+
return /* @__PURE__ */ e(fn, { disablePadding: !0, sx: { px: 1, mb: 0.5 }, children: /* @__PURE__ */ i(
|
|
1166
|
+
xn,
|
|
1167
|
+
{
|
|
1168
|
+
onClick: () => Me(r.id),
|
|
1169
|
+
"aria-current": j ? "page" : void 0,
|
|
1170
|
+
"aria-label": be ? void 0 : r.label,
|
|
1171
|
+
sx: {
|
|
1172
|
+
borderRadius: t.borders.radiusPx.md,
|
|
1173
|
+
// 8px
|
|
1174
|
+
minHeight: he.avatar.size.md,
|
|
1175
|
+
// 40px
|
|
1176
|
+
justifyContent: be ? "initial" : "center",
|
|
1177
|
+
px: be ? 1.5 : 1,
|
|
1178
|
+
// Special gradient background for Insight Engine when selected
|
|
1179
|
+
...xe && j && {
|
|
1180
|
+
background: `linear-gradient(135deg, ${f.secondary.main} 0%, ${f.primary.light} 100%)`,
|
|
1181
|
+
color: "white",
|
|
1182
|
+
"&:hover": {
|
|
1183
|
+
background: `linear-gradient(135deg, ${f.secondary.main} 0%, ${f.primary.light} 100%)`
|
|
1184
|
+
},
|
|
1185
|
+
"& .MuiListItemIcon-root": {
|
|
1186
|
+
color: "white"
|
|
1187
|
+
}
|
|
1188
|
+
},
|
|
1189
|
+
// Normal selected state
|
|
1190
|
+
...!xe && j && {
|
|
1191
|
+
backgroundColor: f.primary.main,
|
|
1192
|
+
color: "white",
|
|
1193
|
+
"&:hover": {
|
|
1194
|
+
backgroundColor: f.primary.main
|
|
1195
|
+
},
|
|
1196
|
+
"& .MuiListItemIcon-root": {
|
|
1197
|
+
color: "white"
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
// Hover state for non-selected items
|
|
1201
|
+
...!j && {
|
|
1202
|
+
"&:hover": {
|
|
1203
|
+
backgroundColor: t.effects.overlay.hover
|
|
1204
|
+
// 8%
|
|
1205
|
+
}
|
|
1206
|
+
},
|
|
1207
|
+
// Special item non-selected state (icon has gradient)
|
|
1208
|
+
...xe && !j && {
|
|
1209
|
+
"& .MuiListItemIcon-root": {
|
|
1210
|
+
color: f.secondary.main
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
},
|
|
1214
|
+
children: [
|
|
1215
|
+
/* @__PURE__ */ e(
|
|
1216
|
+
Z,
|
|
1217
|
+
{
|
|
1218
|
+
sx: {
|
|
1219
|
+
minWidth: 0,
|
|
1220
|
+
mr: be ? 1.5 : 0,
|
|
1221
|
+
justifyContent: "center",
|
|
1222
|
+
color: j ? "inherit" : f.primary.light
|
|
1223
|
+
},
|
|
1224
|
+
children: r.icon
|
|
1225
|
+
}
|
|
1226
|
+
),
|
|
1227
|
+
be && /* @__PURE__ */ e(
|
|
1228
|
+
ee,
|
|
1229
|
+
{
|
|
1230
|
+
primary: r.label,
|
|
1231
|
+
primaryTypographyProps: {
|
|
1232
|
+
fontSize: t.typography.body.small.fontSize,
|
|
1233
|
+
// 14px
|
|
1234
|
+
fontWeight: j ? t.typography.label.medium.fontWeight : t.typography.body.medium.fontWeight
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
)
|
|
1238
|
+
]
|
|
1239
|
+
}
|
|
1240
|
+
) }, r.id);
|
|
1241
|
+
})
|
|
1242
|
+
}
|
|
1243
|
+
)
|
|
1244
|
+
]
|
|
1245
|
+
}
|
|
1246
|
+
),
|
|
1247
|
+
/* @__PURE__ */ e(
|
|
1248
|
+
l,
|
|
1249
|
+
{
|
|
1250
|
+
component: "main",
|
|
1251
|
+
sx: {
|
|
1252
|
+
flexGrow: 1,
|
|
1253
|
+
mt: "56px",
|
|
1254
|
+
// Height of AppBar
|
|
1255
|
+
// No margin-left needed - the Drawer with flexShrink: 0 already reserves space
|
|
1256
|
+
// Only add margin on mobile when drawer is temporary (overlay)
|
|
1257
|
+
backgroundColor: "background.default",
|
|
1258
|
+
height: "calc(100vh - 56px)",
|
|
1259
|
+
overflow: "hidden",
|
|
1260
|
+
display: "flex",
|
|
1261
|
+
flexDirection: "column",
|
|
1262
|
+
"& > *": {
|
|
1263
|
+
flex: 1,
|
|
1264
|
+
minHeight: 0
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
children: B
|
|
1268
|
+
}
|
|
1269
|
+
)
|
|
1270
|
+
] });
|
|
1271
|
+
}
|
|
1272
|
+
const et = $("div")(({ theme: n, focused: o }) => ({
|
|
1273
|
+
position: "relative",
|
|
1274
|
+
borderRadius: 12,
|
|
1275
|
+
backgroundColor: o === "true" ? n.palette.common.white : _(n.palette.common.white, 0.1),
|
|
1276
|
+
"&:hover": {
|
|
1277
|
+
backgroundColor: o === "true" ? n.palette.common.white : _(n.palette.common.white, 0.15)
|
|
1278
|
+
},
|
|
1279
|
+
marginRight: n.spacing(2),
|
|
1280
|
+
marginLeft: n.spacing(2),
|
|
1281
|
+
width: "100%",
|
|
1282
|
+
maxWidth: 400,
|
|
1283
|
+
transition: n.transitions.create(["background-color"]),
|
|
1284
|
+
[n.breakpoints.up("sm")]: {
|
|
1285
|
+
marginLeft: n.spacing(3),
|
|
1286
|
+
width: "auto",
|
|
1287
|
+
minWidth: 300
|
|
1288
|
+
}
|
|
1289
|
+
})), nt = $("div")(({ theme: n, focused: o }) => ({
|
|
1290
|
+
padding: n.spacing(0, 2),
|
|
1291
|
+
height: "100%",
|
|
1292
|
+
position: "absolute",
|
|
1293
|
+
pointerEvents: "none",
|
|
1294
|
+
display: "flex",
|
|
1295
|
+
alignItems: "center",
|
|
1296
|
+
justifyContent: "center",
|
|
1297
|
+
color: o === "true" ? f.primary.main : _(n.palette.common.white, 0.5)
|
|
1298
|
+
})), tt = $(qe)(({ theme: n, focused: o }) => ({
|
|
1299
|
+
color: o === "true" ? f.primary.main : "inherit",
|
|
1300
|
+
width: "100%",
|
|
1301
|
+
"& .MuiInputBase-input": {
|
|
1302
|
+
padding: n.spacing(1, 4, 1, 0),
|
|
1303
|
+
paddingLeft: `calc(1em + ${n.spacing(4)})`,
|
|
1304
|
+
transition: n.transitions.create("width"),
|
|
1305
|
+
width: "100%",
|
|
1306
|
+
fontSize: 14,
|
|
1307
|
+
"&::placeholder": {
|
|
1308
|
+
color: o === "true" ? f.neutral.gray500 : _(n.palette.common.white, 0.5),
|
|
1309
|
+
opacity: 1
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
})), ot = $(v)(({ show: n }) => ({
|
|
1313
|
+
position: "absolute",
|
|
1314
|
+
right: 4,
|
|
1315
|
+
top: "50%",
|
|
1316
|
+
transform: "translateY(-50%)",
|
|
1317
|
+
padding: 4,
|
|
1318
|
+
opacity: n === "true" ? 1 : 0,
|
|
1319
|
+
pointerEvents: n === "true" ? "auto" : "none",
|
|
1320
|
+
color: f.neutral.gray500,
|
|
1321
|
+
"&:hover": {
|
|
1322
|
+
backgroundColor: _(f.neutral.gray500, 0.1)
|
|
1323
|
+
}
|
|
1324
|
+
})), it = $(Je)(({ theme: n }) => ({
|
|
1325
|
+
backgroundColor: _(n.palette.common.white, 0.1),
|
|
1326
|
+
color: n.palette.common.white,
|
|
1327
|
+
borderRadius: 12,
|
|
1328
|
+
padding: "6px 12px",
|
|
1329
|
+
textTransform: "none",
|
|
1330
|
+
fontSize: 14,
|
|
1331
|
+
fontWeight: 400,
|
|
1332
|
+
minWidth: 180,
|
|
1333
|
+
justifyContent: "space-between",
|
|
1334
|
+
"&:hover": {
|
|
1335
|
+
backgroundColor: _(n.palette.common.white, 0.15)
|
|
1336
|
+
}
|
|
1337
|
+
})), Ne = $(v)(({ theme: n }) => ({
|
|
1338
|
+
color: _(n.palette.common.white, 0.7),
|
|
1339
|
+
padding: 8,
|
|
1340
|
+
"&:hover": {
|
|
1341
|
+
backgroundColor: _(n.palette.common.white, 0.1),
|
|
1342
|
+
color: n.palette.common.white
|
|
1343
|
+
}
|
|
1344
|
+
}));
|
|
1345
|
+
$(l)({
|
|
1346
|
+
display: "flex",
|
|
1347
|
+
alignItems: "center"
|
|
1348
|
+
});
|
|
1349
|
+
const Xt = ({
|
|
1350
|
+
initialClient: n = "",
|
|
1351
|
+
onClientChange: o
|
|
1352
|
+
}) => {
|
|
1353
|
+
const [s, a] = z(null), [u, g] = z(n), c = W((E) => {
|
|
1354
|
+
a(E.currentTarget);
|
|
1355
|
+
}, []), h = W(() => {
|
|
1356
|
+
a(null);
|
|
1357
|
+
}, []), A = W((E) => {
|
|
1358
|
+
g(E.name), o?.(E.id), a(null);
|
|
1359
|
+
}, [o]);
|
|
1360
|
+
return {
|
|
1361
|
+
selectedClient: u,
|
|
1362
|
+
anchorEl: s,
|
|
1363
|
+
isOpen: !!s,
|
|
1364
|
+
handleClick: c,
|
|
1365
|
+
handleClose: h,
|
|
1366
|
+
handleSelect: A
|
|
1367
|
+
};
|
|
1368
|
+
}, Yt = ({
|
|
1369
|
+
onUserMenuClick: n
|
|
1370
|
+
}) => {
|
|
1371
|
+
const [o, s] = z(null), a = W((c) => {
|
|
1372
|
+
s(c.currentTarget);
|
|
1373
|
+
}, []), u = W(() => {
|
|
1374
|
+
s(null);
|
|
1375
|
+
}, []), g = W((c) => {
|
|
1376
|
+
n?.(c), s(null);
|
|
1377
|
+
}, [n]);
|
|
1378
|
+
return {
|
|
1379
|
+
anchorEl: o,
|
|
1380
|
+
isOpen: !!o,
|
|
1381
|
+
handleClick: a,
|
|
1382
|
+
handleClose: u,
|
|
1383
|
+
handleAction: g
|
|
1384
|
+
};
|
|
1385
|
+
}, qt = ({
|
|
1386
|
+
onAppsClick: n
|
|
1387
|
+
}) => {
|
|
1388
|
+
const [o, s] = z(null), a = W((c) => {
|
|
1389
|
+
s(c.currentTarget);
|
|
1390
|
+
}, []), u = W(() => {
|
|
1391
|
+
s(null);
|
|
1392
|
+
}, []), g = W((c) => {
|
|
1393
|
+
n?.(c), s(null);
|
|
1394
|
+
}, [n]);
|
|
1395
|
+
return {
|
|
1396
|
+
anchorEl: o,
|
|
1397
|
+
isOpen: !!o,
|
|
1398
|
+
handleClick: a,
|
|
1399
|
+
handleClose: u,
|
|
1400
|
+
handleSelect: g
|
|
1401
|
+
};
|
|
1402
|
+
}, Jt = ({
|
|
1403
|
+
onSearch: n
|
|
1404
|
+
}) => {
|
|
1405
|
+
const [o, s] = z(""), [a, u] = z(!1), g = W((y) => {
|
|
1406
|
+
s(y.target.value);
|
|
1407
|
+
}, []), c = W((y) => {
|
|
1408
|
+
y.key === "Enter" && n?.(o);
|
|
1409
|
+
}, [n, o]), h = W(() => {
|
|
1410
|
+
s("");
|
|
1411
|
+
}, []), A = W(() => {
|
|
1412
|
+
u(!0);
|
|
1413
|
+
}, []), E = W(() => {
|
|
1414
|
+
u(!1);
|
|
1415
|
+
}, []);
|
|
1416
|
+
return {
|
|
1417
|
+
value: o,
|
|
1418
|
+
isFocused: a,
|
|
1419
|
+
handleChange: g,
|
|
1420
|
+
handleKeyPress: c,
|
|
1421
|
+
handleClear: h,
|
|
1422
|
+
handleFocus: A,
|
|
1423
|
+
handleBlur: E
|
|
1424
|
+
};
|
|
1425
|
+
}, Zt = ({
|
|
1426
|
+
defaultExpanded: n = !0,
|
|
1427
|
+
onExpandedChange: o
|
|
1428
|
+
} = {}) => {
|
|
1429
|
+
const [s, a] = z(n), u = W(() => {
|
|
1430
|
+
a((h) => {
|
|
1431
|
+
const A = !h;
|
|
1432
|
+
return o?.(A), A;
|
|
1433
|
+
});
|
|
1434
|
+
}, [o]), g = W(() => {
|
|
1435
|
+
a(!0), o?.(!0);
|
|
1436
|
+
}, [o]), c = W(() => {
|
|
1437
|
+
a(!1), o?.(!1);
|
|
1438
|
+
}, [o]);
|
|
1439
|
+
return {
|
|
1440
|
+
isExpanded: s,
|
|
1441
|
+
toggle: u,
|
|
1442
|
+
expand: g,
|
|
1443
|
+
collapse: c
|
|
1444
|
+
};
|
|
1445
|
+
}, eo = ({ height: n = 28 }) => /* @__PURE__ */ e(l, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ e("img", { src: nn, alt: "Trinity", height: n }) }), no = ({
|
|
1446
|
+
value: n,
|
|
1447
|
+
isFocused: o,
|
|
1448
|
+
placeholder: s = "Search",
|
|
1449
|
+
onChange: a,
|
|
1450
|
+
onKeyPress: u,
|
|
1451
|
+
onClear: g,
|
|
1452
|
+
onFocus: c,
|
|
1453
|
+
onBlur: h
|
|
1454
|
+
}) => /* @__PURE__ */ i(et, { focused: o.toString(), children: [
|
|
1455
|
+
/* @__PURE__ */ e(nt, { focused: o.toString(), children: /* @__PURE__ */ e(ge, {}) }),
|
|
1456
|
+
/* @__PURE__ */ e(
|
|
1457
|
+
tt,
|
|
1458
|
+
{
|
|
1459
|
+
placeholder: s,
|
|
1460
|
+
inputProps: { "aria-label": "search" },
|
|
1461
|
+
value: n,
|
|
1462
|
+
onChange: a,
|
|
1463
|
+
onKeyPress: u,
|
|
1464
|
+
onFocus: c,
|
|
1465
|
+
onBlur: h,
|
|
1466
|
+
focused: o.toString()
|
|
1467
|
+
}
|
|
1468
|
+
),
|
|
1469
|
+
/* @__PURE__ */ e(
|
|
1470
|
+
ot,
|
|
1471
|
+
{
|
|
1472
|
+
show: (n.length > 0).toString(),
|
|
1473
|
+
onClick: g,
|
|
1474
|
+
size: "small",
|
|
1475
|
+
"aria-label": "Clear search",
|
|
1476
|
+
children: /* @__PURE__ */ e(Ee, { fontSize: "small" })
|
|
1477
|
+
}
|
|
1478
|
+
)
|
|
1479
|
+
] }), to = ({
|
|
1480
|
+
selectedClient: n,
|
|
1481
|
+
clients: o,
|
|
1482
|
+
anchorEl: s,
|
|
1483
|
+
isOpen: a,
|
|
1484
|
+
onButtonClick: u,
|
|
1485
|
+
onClose: g,
|
|
1486
|
+
onSelect: c
|
|
1487
|
+
}) => /* @__PURE__ */ i(Te, { children: [
|
|
1488
|
+
/* @__PURE__ */ e(
|
|
1489
|
+
it,
|
|
1490
|
+
{
|
|
1491
|
+
onClick: u,
|
|
1492
|
+
endIcon: /* @__PURE__ */ e(De, {}),
|
|
1493
|
+
"aria-label": `Current client: ${n}. Click to switch clients`,
|
|
1494
|
+
"aria-haspopup": "listbox",
|
|
1495
|
+
"aria-expanded": a,
|
|
1496
|
+
children: n
|
|
1497
|
+
}
|
|
1498
|
+
),
|
|
1499
|
+
/* @__PURE__ */ i(
|
|
1500
|
+
me,
|
|
1501
|
+
{
|
|
1502
|
+
id: "client-menu",
|
|
1503
|
+
anchorEl: s,
|
|
1504
|
+
open: a,
|
|
1505
|
+
onClose: g,
|
|
1506
|
+
anchorOrigin: {
|
|
1507
|
+
vertical: "bottom",
|
|
1508
|
+
horizontal: "right"
|
|
1509
|
+
},
|
|
1510
|
+
transformOrigin: {
|
|
1511
|
+
vertical: "top",
|
|
1512
|
+
horizontal: "right"
|
|
1513
|
+
},
|
|
1514
|
+
MenuListProps: {
|
|
1515
|
+
"aria-label": "Client selection",
|
|
1516
|
+
role: "listbox"
|
|
1517
|
+
},
|
|
1518
|
+
PaperProps: {
|
|
1519
|
+
sx: {
|
|
1520
|
+
mt: 1,
|
|
1521
|
+
minWidth: 220,
|
|
1522
|
+
borderRadius: "12px",
|
|
1523
|
+
boxShadow: "0px 4px 20px rgba(0, 0, 0, 0.15)"
|
|
1524
|
+
}
|
|
1525
|
+
},
|
|
1526
|
+
children: [
|
|
1527
|
+
/* @__PURE__ */ e(
|
|
1528
|
+
b,
|
|
1529
|
+
{
|
|
1530
|
+
variant: "subtitle2",
|
|
1531
|
+
sx: { px: 2, py: 1.5, fontWeight: 600, color: "text.primary" },
|
|
1532
|
+
children: "Switch Clients"
|
|
1533
|
+
}
|
|
1534
|
+
),
|
|
1535
|
+
o.map((h) => /* @__PURE__ */ e(
|
|
1536
|
+
O,
|
|
1537
|
+
{
|
|
1538
|
+
onClick: () => c(h),
|
|
1539
|
+
selected: h.name === n,
|
|
1540
|
+
"aria-selected": h.name === n,
|
|
1541
|
+
role: "option",
|
|
1542
|
+
sx: { py: 1 },
|
|
1543
|
+
children: h.name
|
|
1544
|
+
},
|
|
1545
|
+
h.id
|
|
1546
|
+
))
|
|
1547
|
+
]
|
|
1548
|
+
}
|
|
1549
|
+
)
|
|
1550
|
+
] }), oo = ({
|
|
1551
|
+
apps: n,
|
|
1552
|
+
anchorEl: o,
|
|
1553
|
+
isOpen: s,
|
|
1554
|
+
onButtonClick: a,
|
|
1555
|
+
onClose: u,
|
|
1556
|
+
onSelect: g
|
|
1557
|
+
}) => /* @__PURE__ */ i(Te, { children: [
|
|
1558
|
+
/* @__PURE__ */ e(
|
|
1559
|
+
Ne,
|
|
1560
|
+
{
|
|
1561
|
+
onClick: a,
|
|
1562
|
+
"aria-label": "Applications menu",
|
|
1563
|
+
"aria-haspopup": "menu",
|
|
1564
|
+
"aria-expanded": s,
|
|
1565
|
+
children: /* @__PURE__ */ e(Ze, {})
|
|
1566
|
+
}
|
|
1567
|
+
),
|
|
1568
|
+
/* @__PURE__ */ i(
|
|
1569
|
+
me,
|
|
1570
|
+
{
|
|
1571
|
+
id: "apps-menu",
|
|
1572
|
+
anchorEl: o,
|
|
1573
|
+
open: s,
|
|
1574
|
+
onClose: u,
|
|
1575
|
+
anchorOrigin: {
|
|
1576
|
+
vertical: "bottom",
|
|
1577
|
+
horizontal: "right"
|
|
1578
|
+
},
|
|
1579
|
+
transformOrigin: {
|
|
1580
|
+
vertical: "top",
|
|
1581
|
+
horizontal: "right"
|
|
1582
|
+
},
|
|
1583
|
+
PaperProps: {
|
|
1584
|
+
sx: {
|
|
1585
|
+
mt: 1,
|
|
1586
|
+
minWidth: 280,
|
|
1587
|
+
borderRadius: "12px",
|
|
1588
|
+
boxShadow: "0px 4px 20px rgba(0, 0, 0, 0.15)"
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1591
|
+
children: [
|
|
1592
|
+
/* @__PURE__ */ e(
|
|
1593
|
+
b,
|
|
1594
|
+
{
|
|
1595
|
+
variant: "subtitle2",
|
|
1596
|
+
sx: { px: 2, py: 1.5, fontWeight: 600, color: "text.primary" },
|
|
1597
|
+
children: "Trinity Applications"
|
|
1598
|
+
}
|
|
1599
|
+
),
|
|
1600
|
+
n.map((c) => /* @__PURE__ */ i(
|
|
1601
|
+
O,
|
|
1602
|
+
{
|
|
1603
|
+
onClick: () => g(c.id),
|
|
1604
|
+
sx: { py: 1.5 },
|
|
1605
|
+
children: [
|
|
1606
|
+
/* @__PURE__ */ e(ee, { primary: c.name }),
|
|
1607
|
+
c.url && /* @__PURE__ */ e(Z, { sx: { minWidth: "auto", ml: 1 }, children: /* @__PURE__ */ e(Ce, { fontSize: "small", sx: { color: "text.secondary" } }) })
|
|
1608
|
+
]
|
|
1609
|
+
},
|
|
1610
|
+
c.id
|
|
1611
|
+
))
|
|
1612
|
+
]
|
|
1613
|
+
}
|
|
1614
|
+
)
|
|
1615
|
+
] }), io = ({
|
|
1616
|
+
userInitials: n,
|
|
1617
|
+
userName: o,
|
|
1618
|
+
userEmail: s,
|
|
1619
|
+
anchorEl: a,
|
|
1620
|
+
isOpen: u,
|
|
1621
|
+
onButtonClick: g,
|
|
1622
|
+
onClose: c,
|
|
1623
|
+
onAction: h
|
|
1624
|
+
}) => /* @__PURE__ */ i(Te, { children: [
|
|
1625
|
+
/* @__PURE__ */ e(
|
|
1626
|
+
Ne,
|
|
1627
|
+
{
|
|
1628
|
+
onClick: g,
|
|
1629
|
+
"aria-label": "User menu",
|
|
1630
|
+
"aria-haspopup": "menu",
|
|
1631
|
+
"aria-expanded": u,
|
|
1632
|
+
children: /* @__PURE__ */ e(
|
|
1633
|
+
Pe,
|
|
1634
|
+
{
|
|
1635
|
+
sx: {
|
|
1636
|
+
width: 32,
|
|
1637
|
+
height: 32,
|
|
1638
|
+
fontSize: 13,
|
|
1639
|
+
fontWeight: 600,
|
|
1640
|
+
bgcolor: f.secondary.main,
|
|
1641
|
+
color: "white"
|
|
1642
|
+
},
|
|
1643
|
+
children: n
|
|
1644
|
+
}
|
|
1645
|
+
)
|
|
1646
|
+
}
|
|
1647
|
+
),
|
|
1648
|
+
/* @__PURE__ */ i(
|
|
1649
|
+
me,
|
|
1650
|
+
{
|
|
1651
|
+
id: "user-menu",
|
|
1652
|
+
anchorEl: a,
|
|
1653
|
+
open: u,
|
|
1654
|
+
onClose: c,
|
|
1655
|
+
anchorOrigin: {
|
|
1656
|
+
vertical: "bottom",
|
|
1657
|
+
horizontal: "right"
|
|
1658
|
+
},
|
|
1659
|
+
transformOrigin: {
|
|
1660
|
+
vertical: "top",
|
|
1661
|
+
horizontal: "right"
|
|
1662
|
+
},
|
|
1663
|
+
PaperProps: {
|
|
1664
|
+
sx: {
|
|
1665
|
+
mt: 1,
|
|
1666
|
+
minWidth: 280,
|
|
1667
|
+
borderRadius: "12px",
|
|
1668
|
+
boxShadow: "0px 4px 20px rgba(0, 0, 0, 0.15)"
|
|
1669
|
+
}
|
|
1670
|
+
},
|
|
1671
|
+
children: [
|
|
1672
|
+
/* @__PURE__ */ i(l, { sx: { px: 2, py: 1.5 }, children: [
|
|
1673
|
+
/* @__PURE__ */ e(b, { variant: "subtitle2", sx: { fontWeight: 600 }, children: o }),
|
|
1674
|
+
/* @__PURE__ */ e(b, { variant: "body2", color: "text.secondary", children: s })
|
|
1675
|
+
] }),
|
|
1676
|
+
/* @__PURE__ */ e(pe, {}),
|
|
1677
|
+
/* @__PURE__ */ i(O, { onClick: () => h("help"), sx: { py: 1.5 }, children: [
|
|
1678
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(Fe, { fontSize: "small" }) }),
|
|
1679
|
+
/* @__PURE__ */ e(ee, { primary: "Help & Support" })
|
|
1680
|
+
] }),
|
|
1681
|
+
/* @__PURE__ */ i(O, { onClick: () => h("notifications"), sx: { py: 1.5 }, children: [
|
|
1682
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(je, { fontSize: "small" }) }),
|
|
1683
|
+
/* @__PURE__ */ e(ee, { primary: "Notifications" })
|
|
1684
|
+
] }),
|
|
1685
|
+
/* @__PURE__ */ e(pe, {}),
|
|
1686
|
+
/* @__PURE__ */ i(O, { onClick: () => h("logout"), sx: { py: 1.5 }, children: [
|
|
1687
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(en, { fontSize: "small" }) }),
|
|
1688
|
+
/* @__PURE__ */ e(ee, { primary: "Sign out" })
|
|
1689
|
+
] })
|
|
1690
|
+
]
|
|
1691
|
+
}
|
|
1692
|
+
)
|
|
1693
|
+
] }), ro = ({
|
|
1694
|
+
onHelpClick: n,
|
|
1695
|
+
onNotificationsClick: o,
|
|
1696
|
+
showHelp: s = !0,
|
|
1697
|
+
showNotifications: a = !0
|
|
1698
|
+
}) => /* @__PURE__ */ i(Te, { children: [
|
|
1699
|
+
s && /* @__PURE__ */ e(
|
|
1700
|
+
Ne,
|
|
1701
|
+
{
|
|
1702
|
+
"aria-label": "Help",
|
|
1703
|
+
onClick: n,
|
|
1704
|
+
children: /* @__PURE__ */ e(Fe, {})
|
|
1705
|
+
}
|
|
1706
|
+
),
|
|
1707
|
+
a && /* @__PURE__ */ e(
|
|
1708
|
+
Ne,
|
|
1709
|
+
{
|
|
1710
|
+
"aria-label": "Notifications",
|
|
1711
|
+
onClick: o,
|
|
1712
|
+
children: /* @__PURE__ */ e(je, {})
|
|
1713
|
+
}
|
|
1714
|
+
)
|
|
1715
|
+
] }), rt = [
|
|
1716
|
+
{
|
|
1717
|
+
label: "Today",
|
|
1718
|
+
threads: [
|
|
1719
|
+
{ id: "1", title: "KOL Engagement Analysis", preview: "What are the top performing KOLs...", timestamp: /* @__PURE__ */ new Date(), messageCount: 8 },
|
|
1720
|
+
{ id: "2", title: "Q4 Performance Review", preview: "Show me the Q4 metrics...", timestamp: /* @__PURE__ */ new Date(), isStarred: !0, messageCount: 12 }
|
|
1721
|
+
]
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
label: "Yesterday",
|
|
1725
|
+
threads: [
|
|
1726
|
+
{ id: "3", title: "Content Strategy Planning", preview: "Help me create a content calendar...", timestamp: new Date(Date.now() - 864e5), messageCount: 5 },
|
|
1727
|
+
{ id: "4", title: "Competitor Analysis", preview: "Compare our engagement with...", timestamp: new Date(Date.now() - 864e5), messageCount: 15 }
|
|
1728
|
+
]
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
label: "Previous 7 Days",
|
|
1732
|
+
threads: [
|
|
1733
|
+
{ id: "5", title: "Regional Performance Deep Dive", preview: "Break down EMEA performance...", timestamp: new Date(Date.now() - 1728e5), messageCount: 22 },
|
|
1734
|
+
{ id: "6", title: "Dr. Chen Profile Research", preview: "Tell me about Dr. Sarah Chen...", timestamp: new Date(Date.now() - 2592e5), isStarred: !0, messageCount: 7 },
|
|
1735
|
+
{ id: "7", title: "Video Content Analysis", preview: "Which video formats perform best...", timestamp: new Date(Date.now() - 3456e5), messageCount: 4 }
|
|
1736
|
+
]
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
label: "Previous 30 Days",
|
|
1740
|
+
threads: [
|
|
1741
|
+
{ id: "8", title: "Annual Planning Discussion", preview: "Help me prepare the annual...", timestamp: new Date(Date.now() - 864e6), messageCount: 30 },
|
|
1742
|
+
{ id: "9", title: "Social Media Insights", preview: "Analyze our LinkedIn performance...", timestamp: new Date(Date.now() - 1296e6), messageCount: 11 }
|
|
1743
|
+
]
|
|
1744
|
+
}
|
|
1745
|
+
], at = ({
|
|
1746
|
+
threadGroups: n = rt,
|
|
1747
|
+
selectedThreadId: o,
|
|
1748
|
+
onThreadSelect: s,
|
|
1749
|
+
onNewThread: a,
|
|
1750
|
+
onThreadDelete: u,
|
|
1751
|
+
onThreadRename: g,
|
|
1752
|
+
onThreadStar: c,
|
|
1753
|
+
onClose: h,
|
|
1754
|
+
open: A = !0,
|
|
1755
|
+
width: E = 280
|
|
1756
|
+
}) => {
|
|
1757
|
+
const y = we(), k = y.palette.mode === "dark", [L, N] = z(""), [B, q] = z(null), [I, R] = z(null), [C, D] = z(""), m = {
|
|
1758
|
+
background: k ? _e(y.palette.background.paper, 0.95) : y.palette.background.paper,
|
|
1759
|
+
border: y.palette.divider,
|
|
1760
|
+
text: y.palette.text.primary,
|
|
1761
|
+
textSecondary: y.palette.text.secondary,
|
|
1762
|
+
hover: y.palette.action.hover,
|
|
1763
|
+
selected: k ? _e(Y.colors.aiPrimary, 0.15) : _e(Y.colors.aiPrimary, 0.08),
|
|
1764
|
+
selectedBorder: Y.colors.aiPrimary
|
|
1765
|
+
}, T = n.map((S) => ({
|
|
1766
|
+
...S,
|
|
1767
|
+
threads: S.threads.filter(
|
|
1768
|
+
(V) => V.title.toLowerCase().includes(L.toLowerCase()) || V.preview?.toLowerCase().includes(L.toLowerCase())
|
|
1769
|
+
)
|
|
1770
|
+
})).filter((S) => S.threads.length > 0), M = (S) => {
|
|
1771
|
+
R(S.id), D(S.title);
|
|
1772
|
+
}, F = (S) => {
|
|
1773
|
+
C.trim() && g?.(S, C.trim()), R(null), D("");
|
|
1774
|
+
}, K = () => {
|
|
1775
|
+
R(null), D("");
|
|
1776
|
+
};
|
|
1777
|
+
return A ? /* @__PURE__ */ i(
|
|
1778
|
+
l,
|
|
1779
|
+
{
|
|
1780
|
+
sx: {
|
|
1781
|
+
width: E,
|
|
1782
|
+
height: "100%",
|
|
1783
|
+
display: "flex",
|
|
1784
|
+
flexDirection: "column",
|
|
1785
|
+
backgroundColor: m.background,
|
|
1786
|
+
borderRight: `1px solid ${m.border}`,
|
|
1787
|
+
flexShrink: 0
|
|
1788
|
+
},
|
|
1789
|
+
children: [
|
|
1790
|
+
/* @__PURE__ */ i(
|
|
1791
|
+
l,
|
|
1792
|
+
{
|
|
1793
|
+
sx: {
|
|
1794
|
+
px: 2,
|
|
1795
|
+
py: 1.5,
|
|
1796
|
+
display: "flex",
|
|
1797
|
+
alignItems: "center",
|
|
1798
|
+
justifyContent: "space-between",
|
|
1799
|
+
borderBottom: `1px solid ${m.border}`
|
|
1800
|
+
},
|
|
1801
|
+
children: [
|
|
1802
|
+
/* @__PURE__ */ e(b, { variant: "subtitle2", fontWeight: 600, color: m.text, children: "History" }),
|
|
1803
|
+
/* @__PURE__ */ i(l, { sx: { display: "flex", gap: 0.5 }, children: [
|
|
1804
|
+
/* @__PURE__ */ e(U, { title: "New thread", children: /* @__PURE__ */ e(v, { size: "small", onClick: a, children: /* @__PURE__ */ e(jn, { fontSize: "small" }) }) }),
|
|
1805
|
+
/* @__PURE__ */ e(U, { title: "Close history", children: /* @__PURE__ */ e(v, { size: "small", onClick: h, children: /* @__PURE__ */ e(Un, { fontSize: "small" }) }) })
|
|
1806
|
+
] })
|
|
1807
|
+
]
|
|
1808
|
+
}
|
|
1809
|
+
),
|
|
1810
|
+
/* @__PURE__ */ e(l, { sx: { px: 2, py: 1.5 }, children: /* @__PURE__ */ e(
|
|
1811
|
+
tn,
|
|
1812
|
+
{
|
|
1813
|
+
fullWidth: !0,
|
|
1814
|
+
size: "small",
|
|
1815
|
+
placeholder: "Search threads...",
|
|
1816
|
+
value: L,
|
|
1817
|
+
onChange: (S) => N(S.target.value),
|
|
1818
|
+
InputProps: {
|
|
1819
|
+
startAdornment: /* @__PURE__ */ e(yn, { position: "start", children: /* @__PURE__ */ e(ge, { fontSize: "small", sx: { color: m.textSecondary } }) })
|
|
1820
|
+
},
|
|
1821
|
+
sx: {
|
|
1822
|
+
"& .MuiOutlinedInput-root": {
|
|
1823
|
+
backgroundColor: y.palette.action.hover,
|
|
1824
|
+
"& fieldset": {
|
|
1825
|
+
borderColor: "transparent"
|
|
1826
|
+
},
|
|
1827
|
+
"&:hover fieldset": {
|
|
1828
|
+
borderColor: y.palette.divider
|
|
1829
|
+
},
|
|
1830
|
+
"&.Mui-focused fieldset": {
|
|
1831
|
+
borderColor: Y.colors.aiPrimary
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
) }),
|
|
1837
|
+
/* @__PURE__ */ i(l, { sx: { flex: 1, overflow: "auto" }, children: [
|
|
1838
|
+
T.map((S, V) => /* @__PURE__ */ i(l, { children: [
|
|
1839
|
+
/* @__PURE__ */ e(
|
|
1840
|
+
b,
|
|
1841
|
+
{
|
|
1842
|
+
variant: "caption",
|
|
1843
|
+
sx: {
|
|
1844
|
+
px: 2,
|
|
1845
|
+
py: 1,
|
|
1846
|
+
display: "block",
|
|
1847
|
+
color: m.textSecondary,
|
|
1848
|
+
fontWeight: 500,
|
|
1849
|
+
fontSize: "0.7rem",
|
|
1850
|
+
textTransform: "uppercase",
|
|
1851
|
+
letterSpacing: "0.5px"
|
|
1852
|
+
},
|
|
1853
|
+
children: S.label
|
|
1854
|
+
}
|
|
1855
|
+
),
|
|
1856
|
+
/* @__PURE__ */ e(gn, { dense: !0, disablePadding: !0, children: S.threads.map((d) => /* @__PURE__ */ e(
|
|
1857
|
+
fn,
|
|
1858
|
+
{
|
|
1859
|
+
disablePadding: !0,
|
|
1860
|
+
onMouseEnter: () => q(d.id),
|
|
1861
|
+
onMouseLeave: () => q(null),
|
|
1862
|
+
secondaryAction: B === d.id && I !== d.id ? /* @__PURE__ */ i(l, { sx: { display: "flex", gap: 0.5 }, children: [
|
|
1863
|
+
/* @__PURE__ */ e(U, { title: d.isStarred ? "Unstar" : "Star", children: /* @__PURE__ */ e(
|
|
1864
|
+
v,
|
|
1865
|
+
{
|
|
1866
|
+
size: "small",
|
|
1867
|
+
onClick: (w) => {
|
|
1868
|
+
w.stopPropagation(), c?.(d.id);
|
|
1869
|
+
},
|
|
1870
|
+
sx: { p: 0.5 },
|
|
1871
|
+
children: d.isStarred ? (
|
|
1872
|
+
// eslint-disable-next-line no-restricted-syntax -- @intentional-color: star indicator yellow
|
|
1873
|
+
/* @__PURE__ */ e(on, { fontSize: "small", sx: { color: "#F59E0B", fontSize: 16 } })
|
|
1874
|
+
) : /* @__PURE__ */ e(Vn, { fontSize: "small", sx: { fontSize: 16 } })
|
|
1875
|
+
}
|
|
1876
|
+
) }),
|
|
1877
|
+
/* @__PURE__ */ e(U, { title: "Rename", children: /* @__PURE__ */ e(
|
|
1878
|
+
v,
|
|
1879
|
+
{
|
|
1880
|
+
size: "small",
|
|
1881
|
+
onClick: (w) => {
|
|
1882
|
+
w.stopPropagation(), M(d);
|
|
1883
|
+
},
|
|
1884
|
+
sx: { p: 0.5 },
|
|
1885
|
+
children: /* @__PURE__ */ e(Nn, { fontSize: "small", sx: { fontSize: 16 } })
|
|
1886
|
+
}
|
|
1887
|
+
) }),
|
|
1888
|
+
/* @__PURE__ */ e(U, { title: "Delete", children: /* @__PURE__ */ e(
|
|
1889
|
+
v,
|
|
1890
|
+
{
|
|
1891
|
+
size: "small",
|
|
1892
|
+
onClick: (w) => {
|
|
1893
|
+
w.stopPropagation(), u?.(d.id);
|
|
1894
|
+
},
|
|
1895
|
+
sx: { p: 0.5 },
|
|
1896
|
+
children: /* @__PURE__ */ e($n, { fontSize: "small", sx: { fontSize: 16 } })
|
|
1897
|
+
}
|
|
1898
|
+
) })
|
|
1899
|
+
] }) : d.isStarred && B !== d.id ? (
|
|
1900
|
+
// eslint-disable-next-line no-restricted-syntax -- @intentional-color: star indicator yellow
|
|
1901
|
+
/* @__PURE__ */ e(on, { fontSize: "small", sx: { color: "#F59E0B", fontSize: 16, mr: 1 } })
|
|
1902
|
+
) : null,
|
|
1903
|
+
children: /* @__PURE__ */ i(
|
|
1904
|
+
xn,
|
|
1905
|
+
{
|
|
1906
|
+
selected: o === d.id,
|
|
1907
|
+
onClick: () => s?.(d.id),
|
|
1908
|
+
sx: {
|
|
1909
|
+
py: 1,
|
|
1910
|
+
px: 2,
|
|
1911
|
+
borderRadius: 1,
|
|
1912
|
+
mx: 1,
|
|
1913
|
+
"&.Mui-selected": {
|
|
1914
|
+
backgroundColor: m.selected,
|
|
1915
|
+
borderLeft: `2px solid ${m.selectedBorder}`,
|
|
1916
|
+
"&:hover": {
|
|
1917
|
+
backgroundColor: m.selected
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
},
|
|
1921
|
+
children: [
|
|
1922
|
+
/* @__PURE__ */ e(Z, { sx: { minWidth: 32 }, children: /* @__PURE__ */ e(
|
|
1923
|
+
On,
|
|
1924
|
+
{
|
|
1925
|
+
fontSize: "small",
|
|
1926
|
+
sx: {
|
|
1927
|
+
color: o === d.id ? Y.colors.aiPrimary : m.textSecondary,
|
|
1928
|
+
fontSize: 18
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
) }),
|
|
1932
|
+
I === d.id ? /* @__PURE__ */ e(
|
|
1933
|
+
tn,
|
|
1934
|
+
{
|
|
1935
|
+
size: "small",
|
|
1936
|
+
value: C,
|
|
1937
|
+
onChange: (w) => D(w.target.value),
|
|
1938
|
+
onBlur: () => F(d.id),
|
|
1939
|
+
onKeyDown: (w) => {
|
|
1940
|
+
w.key === "Enter" && F(d.id), w.key === "Escape" && K();
|
|
1941
|
+
},
|
|
1942
|
+
autoFocus: !0,
|
|
1943
|
+
fullWidth: !0,
|
|
1944
|
+
sx: {
|
|
1945
|
+
"& .MuiInputBase-input": {
|
|
1946
|
+
py: 0.5,
|
|
1947
|
+
fontSize: "0.875rem"
|
|
1948
|
+
}
|
|
1949
|
+
},
|
|
1950
|
+
onClick: (w) => w.stopPropagation()
|
|
1951
|
+
}
|
|
1952
|
+
) : /* @__PURE__ */ e(
|
|
1953
|
+
ee,
|
|
1954
|
+
{
|
|
1955
|
+
primary: d.title,
|
|
1956
|
+
secondary: d.preview,
|
|
1957
|
+
primaryTypographyProps: {
|
|
1958
|
+
variant: "body2",
|
|
1959
|
+
fontWeight: o === d.id ? 600 : 400,
|
|
1960
|
+
noWrap: !0,
|
|
1961
|
+
sx: {
|
|
1962
|
+
color: (o === d.id, m.text)
|
|
1963
|
+
}
|
|
1964
|
+
},
|
|
1965
|
+
secondaryTypographyProps: {
|
|
1966
|
+
variant: "caption",
|
|
1967
|
+
noWrap: !0,
|
|
1968
|
+
sx: {
|
|
1969
|
+
color: m.textSecondary,
|
|
1970
|
+
fontSize: "0.7rem"
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
)
|
|
1975
|
+
]
|
|
1976
|
+
}
|
|
1977
|
+
)
|
|
1978
|
+
},
|
|
1979
|
+
d.id
|
|
1980
|
+
)) }),
|
|
1981
|
+
V < T.length - 1 && /* @__PURE__ */ e(pe, { sx: { my: 1, mx: 2 } })
|
|
1982
|
+
] }, S.label)),
|
|
1983
|
+
T.length === 0 && /* @__PURE__ */ i(
|
|
1984
|
+
l,
|
|
1985
|
+
{
|
|
1986
|
+
sx: {
|
|
1987
|
+
display: "flex",
|
|
1988
|
+
flexDirection: "column",
|
|
1989
|
+
alignItems: "center",
|
|
1990
|
+
justifyContent: "center",
|
|
1991
|
+
py: 4,
|
|
1992
|
+
px: 2
|
|
1993
|
+
},
|
|
1994
|
+
children: [
|
|
1995
|
+
/* @__PURE__ */ e(Kn, { sx: { fontSize: 40, color: m.textSecondary, mb: 1 } }),
|
|
1996
|
+
/* @__PURE__ */ e(b, { variant: "body2", color: m.textSecondary, textAlign: "center", children: L ? "No threads match your search" : "No conversation history" })
|
|
1997
|
+
]
|
|
1998
|
+
}
|
|
1999
|
+
)
|
|
2000
|
+
] }),
|
|
2001
|
+
/* @__PURE__ */ i(
|
|
2002
|
+
l,
|
|
2003
|
+
{
|
|
2004
|
+
sx: {
|
|
2005
|
+
px: 2,
|
|
2006
|
+
py: 1.5,
|
|
2007
|
+
borderTop: `1px solid ${m.border}`,
|
|
2008
|
+
display: "flex",
|
|
2009
|
+
alignItems: "center",
|
|
2010
|
+
justifyContent: "space-between"
|
|
2011
|
+
},
|
|
2012
|
+
children: [
|
|
2013
|
+
/* @__PURE__ */ i(b, { variant: "caption", color: m.textSecondary, children: [
|
|
2014
|
+
n.reduce((S, V) => S + V.threads.length, 0),
|
|
2015
|
+
" threads"
|
|
2016
|
+
] }),
|
|
2017
|
+
/* @__PURE__ */ e(U, { title: "More options", children: /* @__PURE__ */ e(v, { size: "small", children: /* @__PURE__ */ e(Fn, { fontSize: "small" }) }) })
|
|
2018
|
+
]
|
|
2019
|
+
}
|
|
2020
|
+
)
|
|
2021
|
+
]
|
|
2022
|
+
}
|
|
2023
|
+
) : null;
|
|
2024
|
+
}, X = {
|
|
2025
|
+
section: `${t.spacing.component.gapLg}px`,
|
|
2026
|
+
// 24px - between major sections
|
|
2027
|
+
content: `${t.spacing.component.gapMd}px`,
|
|
2028
|
+
// 16px - within sections
|
|
2029
|
+
element: `${t.spacing.component.gapSm}px`,
|
|
2030
|
+
// 8px - between related elements
|
|
2031
|
+
inset: `${t.spacing.component.paddingMd}px`,
|
|
2032
|
+
// 16px - container padding
|
|
2033
|
+
insetSm: `${t.spacing.component.paddingSm}px`
|
|
2034
|
+
// 8px - small padding
|
|
2035
|
+
}, lt = [
|
|
2036
|
+
{ id: "gpt-4o", label: "GPT-4o", description: "Most capable model" },
|
|
2037
|
+
{ id: "gpt-4o-mini", label: "GPT-4o Mini", description: "Fast and efficient" },
|
|
2038
|
+
{ id: "claude-3-5-sonnet", label: "Claude 3.5 Sonnet", description: "Balanced performance" },
|
|
2039
|
+
{ id: "claude-3-opus", label: "Claude 3 Opus", description: "Most powerful" },
|
|
2040
|
+
{ id: "gemini-pro", label: "Gemini Pro", description: "Multimodal capable" }
|
|
2041
|
+
], st = [
|
|
2042
|
+
{ id: "web", label: "Web Search", icon: "globe", enabled: !0 },
|
|
2043
|
+
{ id: "documents", label: "Documents", icon: "file-text", enabled: !0 },
|
|
2044
|
+
{ id: "database", label: "Database", icon: "database", enabled: !1 },
|
|
2045
|
+
{ id: "sharepoint", label: "SharePoint", icon: "cloud", enabled: !1 },
|
|
2046
|
+
{ id: "projects", label: "Projects", icon: "folder", enabled: !1 }
|
|
2047
|
+
], Ge = {
|
|
2048
|
+
default: {
|
|
2049
|
+
content: `Based on my analysis of the available data, here are the key insights:
|
|
2050
|
+
|
|
2051
|
+
**Performance Overview**
|
|
2052
|
+
The engagement metrics show a strong upward trend, with a 23% increase compared to the previous quarter. This growth is primarily driven by content in the clinical research and treatment guidelines categories.
|
|
2053
|
+
|
|
2054
|
+
**Key Findings**
|
|
2055
|
+
1. **Peak Engagement Windows**: Tuesday through Thursday between 9am-11am EST consistently show the highest engagement rates
|
|
2056
|
+
2. **Content Performance**: Educational content outperforms promotional material by 3.2x
|
|
2057
|
+
3. **KOL Impact**: Content shared by key opinion leaders receives 4.5x more engagement
|
|
2058
|
+
|
|
2059
|
+
**Recommendations**
|
|
2060
|
+
• Prioritize content publication during peak engagement windows
|
|
2061
|
+
• Increase investment in educational content formats
|
|
2062
|
+
• Expand KOL partnership program based on current success metrics`,
|
|
2063
|
+
sources: [
|
|
2064
|
+
{ id: "affiliations", name: "Affiliations", count: 1 },
|
|
2065
|
+
{ id: "contact", name: "Contact Details", count: 1 },
|
|
2066
|
+
{
|
|
2067
|
+
id: "publications",
|
|
2068
|
+
name: "Publications",
|
|
2069
|
+
count: 4,
|
|
2070
|
+
items: [
|
|
2071
|
+
{
|
|
2072
|
+
id: "pub-a",
|
|
2073
|
+
label: "Small solitary pulmonary nodules detected at population-based CT screening...",
|
|
2074
|
+
details: {
|
|
2075
|
+
Title: "Small solitary pulmonary nodules (<= 1 cm) detected at population-based CT screening for lung cancer: reliable high-resolution CT features of benign lesions.",
|
|
2076
|
+
Journal: "International Journal of Cancer",
|
|
2077
|
+
"Authorship Position": "Coauthor",
|
|
2078
|
+
"Publication Date": "2024-12-12",
|
|
2079
|
+
"Publication Type": "Journal Article",
|
|
2080
|
+
Tables: "Publications, PublicationRelations",
|
|
2081
|
+
"Last Updated On": "10/29/2025"
|
|
2082
|
+
}
|
|
2083
|
+
},
|
|
2084
|
+
{ id: "pub-b", label: "Screening for lung cancer with low-dose CT: analysis of screening data..." },
|
|
2085
|
+
{ id: "pub-c", label: "Clinical insights into small cell lung cancer treatment strategies..." },
|
|
2086
|
+
{ id: "pub-d", label: "US Lung Screen (USLS) nodule management protocol and outcomes..." }
|
|
2087
|
+
]
|
|
2088
|
+
},
|
|
2089
|
+
{ id: "trials", name: "Clinical Trials", count: 10 },
|
|
2090
|
+
{ id: "sci-topics", name: "Scientific Leader Topics", count: 25 },
|
|
2091
|
+
{ id: "clin-topics", name: "Clinical Leader Topics", count: 19 },
|
|
2092
|
+
{ id: "dig-topics", name: "Digital Leader Topics", count: 31 },
|
|
2093
|
+
{ id: "msl", name: "MSL Interactions", count: 2 }
|
|
2094
|
+
],
|
|
2095
|
+
relatedQuestions: [
|
|
2096
|
+
"What are some discussion questions for this HCP?",
|
|
2097
|
+
"What are some themes I could engage this HCP on?",
|
|
2098
|
+
"What conferences has this HCP attended recently?",
|
|
2099
|
+
"Please summarize this HCP's experience."
|
|
2100
|
+
]
|
|
2101
|
+
},
|
|
2102
|
+
"What can you help with?": {
|
|
2103
|
+
content: `I'm Insight Engine, your AI-powered research assistant. Here's what I can help you with:
|
|
2104
|
+
|
|
2105
|
+
**Research & Analysis**
|
|
2106
|
+
• Search across your data sources, documents, and the web
|
|
2107
|
+
• Analyze trends and patterns in your data
|
|
2108
|
+
• Generate insights from complex datasets
|
|
2109
|
+
|
|
2110
|
+
**Content & Strategy**
|
|
2111
|
+
• Help draft and refine content
|
|
2112
|
+
• Provide competitive intelligence
|
|
2113
|
+
• Suggest optimization strategies
|
|
2114
|
+
|
|
2115
|
+
**Data Exploration**
|
|
2116
|
+
• Query your databases naturally
|
|
2117
|
+
• Create visualizations and summaries
|
|
2118
|
+
• Connect insights across multiple sources
|
|
2119
|
+
|
|
2120
|
+
Simply ask me a question, and I'll search relevant sources to provide a comprehensive answer with citations.`,
|
|
2121
|
+
sources: [
|
|
2122
|
+
{ id: "docs", name: "Documentation", count: 2 },
|
|
2123
|
+
{ id: "help", name: "Help Articles", count: 3 }
|
|
2124
|
+
],
|
|
2125
|
+
relatedQuestions: [
|
|
2126
|
+
"Show me recent insights",
|
|
2127
|
+
"Analyze my engagement data",
|
|
2128
|
+
"What are the top performing KOLs?"
|
|
2129
|
+
]
|
|
2130
|
+
},
|
|
2131
|
+
"Show recent insights": {
|
|
2132
|
+
content: `Here are the most significant insights from the past week:
|
|
2133
|
+
|
|
2134
|
+
**📈 Engagement Surge**
|
|
2135
|
+
Your immunotherapy content series saw a 156% increase in engagement. The article "Advances in CAR-T Therapy" was shared 2,341 times.
|
|
2136
|
+
|
|
2137
|
+
**👥 Rising KOL**
|
|
2138
|
+
Dr. Sarah Chen from Stanford Medicine has emerged as a key voice in precision oncology. Her engagement rate is 3x higher than average.
|
|
2139
|
+
|
|
2140
|
+
**🌍 Regional Performance**
|
|
2141
|
+
EMEA region outperformed other regions by 45%, driven primarily by localized content strategy in Germany and UK markets.
|
|
2142
|
+
|
|
2143
|
+
**📊 Content Insights**
|
|
2144
|
+
Video content is generating 2.8x more engagement than static posts. Consider increasing video production.`,
|
|
2145
|
+
sources: [
|
|
2146
|
+
{ id: "analytics", name: "Analytics Dashboard", count: 5 },
|
|
2147
|
+
{ id: "kol-report", name: "KOL Tracking", count: 3 },
|
|
2148
|
+
{ id: "regional", name: "Regional Analysis", count: 4 }
|
|
2149
|
+
],
|
|
2150
|
+
relatedQuestions: [
|
|
2151
|
+
"Tell me more about Dr. Sarah Chen",
|
|
2152
|
+
"Why is EMEA outperforming?",
|
|
2153
|
+
"What video content works best?"
|
|
2154
|
+
]
|
|
2155
|
+
}
|
|
2156
|
+
}, ct = ({
|
|
2157
|
+
initialMessages: n = [],
|
|
2158
|
+
messages: o,
|
|
2159
|
+
onMessagesChange: s,
|
|
2160
|
+
placeholder: a = "Ask anything...",
|
|
2161
|
+
title: u = "Insight Engine",
|
|
2162
|
+
subtitle: g,
|
|
2163
|
+
onSendMessage: c,
|
|
2164
|
+
isTyping: h = !1,
|
|
2165
|
+
aiAvatar: A,
|
|
2166
|
+
onClose: E,
|
|
2167
|
+
isFullscreen: y = !1,
|
|
2168
|
+
onFullscreenToggle: k,
|
|
2169
|
+
showControls: L = !0,
|
|
2170
|
+
demoMode: N = !0,
|
|
2171
|
+
onNewThread: B,
|
|
2172
|
+
themeMode: q,
|
|
2173
|
+
boxedLayout: I = !0,
|
|
2174
|
+
onBoxedLayoutToggle: R,
|
|
2175
|
+
userInitials: C = "RD",
|
|
2176
|
+
// History sidebar props
|
|
2177
|
+
showHistory: D,
|
|
2178
|
+
onHistoryToggle: m,
|
|
2179
|
+
threadGroups: T,
|
|
2180
|
+
selectedThreadId: M,
|
|
2181
|
+
onThreadSelect: F,
|
|
2182
|
+
onThreadDelete: K,
|
|
2183
|
+
onThreadRename: S,
|
|
2184
|
+
onThreadStar: V
|
|
2185
|
+
}) => {
|
|
2186
|
+
const d = we(), w = o !== void 0, [oe, re] = z(n), ae = w ? o : oe, ne = (p) => {
|
|
2187
|
+
if (w) {
|
|
2188
|
+
const r = typeof p == "function" ? p(o) : p;
|
|
2189
|
+
s?.(r);
|
|
2190
|
+
} else
|
|
2191
|
+
re(p);
|
|
2192
|
+
}, [G, le] = z(""), [Q, te] = z(h), [P, se] = z(!1), [ce, Se] = z(!1), [J, fe] = z(!1), [x, Ue] = z("gpt-4o"), [ve, Ke] = z(["web", "documents"]), Me = Oe(null), [Ve, Le] = z(!1), ue = D ?? Ve, ke = m ?? (() => Le((p) => !p)), ie = {
|
|
2193
|
+
background: d.palette.background.default,
|
|
2194
|
+
surface: d.palette.background.paper,
|
|
2195
|
+
inputBg: d.palette.action.hover,
|
|
2196
|
+
text: d.palette.text.primary,
|
|
2197
|
+
textSecondary: d.palette.text.secondary,
|
|
2198
|
+
iconActive: d.palette.primary.main,
|
|
2199
|
+
iconInactive: d.palette.text.disabled,
|
|
2200
|
+
buttonHighlight: d.palette.primary.main
|
|
2201
|
+
}, ze = () => {
|
|
2202
|
+
Me.current?.scrollIntoView({ behavior: "smooth" });
|
|
2203
|
+
};
|
|
2204
|
+
$e(() => {
|
|
2205
|
+
ze();
|
|
2206
|
+
}, [ae, Q]), $e(() => {
|
|
2207
|
+
te(h);
|
|
2208
|
+
}, [h]);
|
|
2209
|
+
const Qe = (p) => Ge[p] ? Ge[p] : Ge.default, Re = () => {
|
|
2210
|
+
if (!G.trim()) return;
|
|
2211
|
+
const p = {
|
|
2212
|
+
id: Date.now().toString(),
|
|
2213
|
+
role: "user",
|
|
2214
|
+
content: G.trim(),
|
|
2215
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
2216
|
+
};
|
|
2217
|
+
ne((j) => [...j, p]);
|
|
2218
|
+
const r = G.trim();
|
|
2219
|
+
le(""), c?.(r, { proSearch: P }), N && (te(!0), setTimeout(() => {
|
|
2220
|
+
const j = Qe(r), xe = {
|
|
2221
|
+
id: (Date.now() + 1).toString(),
|
|
2222
|
+
role: "assistant",
|
|
2223
|
+
content: j.content,
|
|
2224
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
2225
|
+
sources: j.sources,
|
|
2226
|
+
relatedQuestions: j.relatedQuestions
|
|
2227
|
+
};
|
|
2228
|
+
ne((be) => [...be, xe]), te(!1);
|
|
2229
|
+
}, 2e3));
|
|
2230
|
+
}, Be = (p) => {
|
|
2231
|
+
le(p);
|
|
2232
|
+
}, Ie = () => {
|
|
2233
|
+
ne([]), B?.();
|
|
2234
|
+
}, We = /* @__PURE__ */ e(Dn, { size: "xs", icon: "sparkles" });
|
|
2235
|
+
return /* @__PURE__ */ i(
|
|
2236
|
+
de,
|
|
2237
|
+
{
|
|
2238
|
+
direction: ue ? "row" : "column",
|
|
2239
|
+
sx: {
|
|
2240
|
+
height: "100%",
|
|
2241
|
+
width: "100%",
|
|
2242
|
+
minHeight: 0
|
|
2243
|
+
},
|
|
2244
|
+
children: [
|
|
2245
|
+
ue && /* @__PURE__ */ e(
|
|
2246
|
+
at,
|
|
2247
|
+
{
|
|
2248
|
+
open: ue,
|
|
2249
|
+
threadGroups: T,
|
|
2250
|
+
selectedThreadId: M,
|
|
2251
|
+
onThreadSelect: F,
|
|
2252
|
+
onNewThread: Ie,
|
|
2253
|
+
onThreadDelete: K,
|
|
2254
|
+
onThreadRename: S,
|
|
2255
|
+
onThreadStar: V,
|
|
2256
|
+
onClose: ke,
|
|
2257
|
+
width: y ? 280 : 240
|
|
2258
|
+
}
|
|
2259
|
+
),
|
|
2260
|
+
/* @__PURE__ */ i(
|
|
2261
|
+
de,
|
|
2262
|
+
{
|
|
2263
|
+
sx: {
|
|
2264
|
+
flex: 1,
|
|
2265
|
+
minWidth: 0,
|
|
2266
|
+
height: "100%",
|
|
2267
|
+
overflow: "hidden",
|
|
2268
|
+
background: Y.gradient.subtle
|
|
2269
|
+
},
|
|
2270
|
+
children: [
|
|
2271
|
+
/* @__PURE__ */ i(
|
|
2272
|
+
de,
|
|
2273
|
+
{
|
|
2274
|
+
direction: "row",
|
|
2275
|
+
alignItems: "center",
|
|
2276
|
+
spacing: X.element,
|
|
2277
|
+
sx: {
|
|
2278
|
+
px: X.inset,
|
|
2279
|
+
py: X.insetSm,
|
|
2280
|
+
borderBottom: 1,
|
|
2281
|
+
borderColor: "divider",
|
|
2282
|
+
bgcolor: "background.default",
|
|
2283
|
+
flexShrink: 0
|
|
2284
|
+
},
|
|
2285
|
+
children: [
|
|
2286
|
+
!ue && /* @__PURE__ */ e(U, { title: "Show history", children: /* @__PURE__ */ e(
|
|
2287
|
+
v,
|
|
2288
|
+
{
|
|
2289
|
+
size: "small",
|
|
2290
|
+
onClick: ke,
|
|
2291
|
+
sx: { color: ie.iconInactive },
|
|
2292
|
+
children: /* @__PURE__ */ e(ye, { name: "menu", size: "small" })
|
|
2293
|
+
}
|
|
2294
|
+
) }),
|
|
2295
|
+
/* @__PURE__ */ e(U, { title: "New thread", children: /* @__PURE__ */ e(
|
|
2296
|
+
v,
|
|
2297
|
+
{
|
|
2298
|
+
size: "small",
|
|
2299
|
+
onClick: Ie,
|
|
2300
|
+
sx: { color: ie.iconInactive },
|
|
2301
|
+
children: /* @__PURE__ */ e(ye, { name: "plus", size: "small" })
|
|
2302
|
+
}
|
|
2303
|
+
) }),
|
|
2304
|
+
/* @__PURE__ */ i(de, { direction: "row", alignItems: "center", spacing: 1, sx: { flex: 1 }, children: [
|
|
2305
|
+
A || We,
|
|
2306
|
+
/* @__PURE__ */ e(b, { variant: "subtitle2", fontWeight: 600, color: "text.primary", children: u }),
|
|
2307
|
+
P && /* @__PURE__ */ e(
|
|
2308
|
+
Cn,
|
|
2309
|
+
{
|
|
2310
|
+
label: "Pro",
|
|
2311
|
+
size: "small",
|
|
2312
|
+
sx: {
|
|
2313
|
+
height: 20,
|
|
2314
|
+
fontSize: 10,
|
|
2315
|
+
fontWeight: 600,
|
|
2316
|
+
background: Y.gradient.diagonal,
|
|
2317
|
+
// eslint-disable-next-line no-restricted-syntax -- @intentional-color: white on gradient
|
|
2318
|
+
color: "#FFFFFF"
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
)
|
|
2322
|
+
] }),
|
|
2323
|
+
L && /* @__PURE__ */ i(de, { direction: "row", spacing: 0.5, children: [
|
|
2324
|
+
/* @__PURE__ */ e(U, { title: ue ? "Hide history" : "Show history", children: /* @__PURE__ */ e(
|
|
2325
|
+
v,
|
|
2326
|
+
{
|
|
2327
|
+
size: "small",
|
|
2328
|
+
onClick: ke,
|
|
2329
|
+
sx: { color: ue ? ie.iconActive : ie.iconInactive },
|
|
2330
|
+
children: /* @__PURE__ */ e(ye, { name: "clock", size: "small" })
|
|
2331
|
+
}
|
|
2332
|
+
) }),
|
|
2333
|
+
y && R && /* @__PURE__ */ e(U, { title: I ? "Full width" : "Boxed layout", children: /* @__PURE__ */ e(
|
|
2334
|
+
v,
|
|
2335
|
+
{
|
|
2336
|
+
size: "small",
|
|
2337
|
+
onClick: R,
|
|
2338
|
+
sx: { color: ie.iconInactive },
|
|
2339
|
+
children: /* @__PURE__ */ e(ye, { name: I ? "maximize-2" : "minimize-2", size: "small" })
|
|
2340
|
+
}
|
|
2341
|
+
) }),
|
|
2342
|
+
k && /* @__PURE__ */ e(U, { title: y ? "Exit fullscreen" : "Fullscreen", children: /* @__PURE__ */ e(
|
|
2343
|
+
v,
|
|
2344
|
+
{
|
|
2345
|
+
size: "small",
|
|
2346
|
+
onClick: k,
|
|
2347
|
+
sx: { color: ie.iconInactive },
|
|
2348
|
+
children: /* @__PURE__ */ e(ye, { name: y ? "minimize" : "maximize", size: "small" })
|
|
2349
|
+
}
|
|
2350
|
+
) }),
|
|
2351
|
+
E && /* @__PURE__ */ e(U, { title: "Close", children: /* @__PURE__ */ e(
|
|
2352
|
+
v,
|
|
2353
|
+
{
|
|
2354
|
+
size: "small",
|
|
2355
|
+
onClick: E,
|
|
2356
|
+
sx: { color: ie.iconInactive },
|
|
2357
|
+
children: /* @__PURE__ */ e(ye, { name: "x", size: "small" })
|
|
2358
|
+
}
|
|
2359
|
+
) })
|
|
2360
|
+
] })
|
|
2361
|
+
]
|
|
2362
|
+
}
|
|
2363
|
+
),
|
|
2364
|
+
/* @__PURE__ */ e(
|
|
2365
|
+
l,
|
|
2366
|
+
{
|
|
2367
|
+
sx: {
|
|
2368
|
+
flex: 1,
|
|
2369
|
+
overflow: "auto",
|
|
2370
|
+
minHeight: 0,
|
|
2371
|
+
display: "flex",
|
|
2372
|
+
flexDirection: "column"
|
|
2373
|
+
},
|
|
2374
|
+
children: /* @__PURE__ */ i(
|
|
2375
|
+
de,
|
|
2376
|
+
{
|
|
2377
|
+
sx: {
|
|
2378
|
+
flex: 1,
|
|
2379
|
+
px: X.inset,
|
|
2380
|
+
// Add horizontal padding for whitespace
|
|
2381
|
+
...y && I && { maxWidth: 900, mx: "auto", px: 3 }
|
|
2382
|
+
},
|
|
2383
|
+
children: [
|
|
2384
|
+
ae.length === 0 && /* @__PURE__ */ i(
|
|
2385
|
+
de,
|
|
2386
|
+
{
|
|
2387
|
+
alignItems: "center",
|
|
2388
|
+
justifyContent: "center",
|
|
2389
|
+
spacing: X.content,
|
|
2390
|
+
sx: { flex: 1, p: X.section, minHeight: 400 },
|
|
2391
|
+
children: [
|
|
2392
|
+
/* @__PURE__ */ e(
|
|
2393
|
+
l,
|
|
2394
|
+
{
|
|
2395
|
+
sx: {
|
|
2396
|
+
width: 56,
|
|
2397
|
+
height: 56,
|
|
2398
|
+
borderRadius: vn.lg,
|
|
2399
|
+
background: Y.gradient.subtle,
|
|
2400
|
+
display: "flex",
|
|
2401
|
+
alignItems: "center",
|
|
2402
|
+
justifyContent: "center"
|
|
2403
|
+
},
|
|
2404
|
+
children: /* @__PURE__ */ e(ye, { name: "sparkles", size: "medium", color: Y.colors.aiPrimary })
|
|
2405
|
+
}
|
|
2406
|
+
),
|
|
2407
|
+
/* @__PURE__ */ e(b, { variant: "h6", fontWeight: 600, color: "text.primary", children: "What do you want to know?" }),
|
|
2408
|
+
/* @__PURE__ */ e(b, { variant: "body2", color: "text.secondary", textAlign: "center", sx: { maxWidth: 300 }, children: "Ask anything and I'll search across your sources to find the answer" })
|
|
2409
|
+
]
|
|
2410
|
+
}
|
|
2411
|
+
),
|
|
2412
|
+
ae.map((p) => /* @__PURE__ */ i(
|
|
2413
|
+
kn,
|
|
2414
|
+
{
|
|
2415
|
+
role: p.role,
|
|
2416
|
+
content: p.content,
|
|
2417
|
+
aiAvatar: A || We,
|
|
2418
|
+
userInitials: C,
|
|
2419
|
+
showCopy: p.role === "assistant",
|
|
2420
|
+
showFeedback: p.role === "assistant",
|
|
2421
|
+
showShare: p.role === "assistant",
|
|
2422
|
+
showRegenerate: p.role === "assistant",
|
|
2423
|
+
children: [
|
|
2424
|
+
p.sources && p.sources.length > 0 && /* @__PURE__ */ e(l, { sx: { mt: X.content }, children: /* @__PURE__ */ e(zn, { sources: p.sources }) }),
|
|
2425
|
+
p.relatedQuestions && p.relatedQuestions.length > 0 && /* @__PURE__ */ e(l, { sx: { mt: X.content }, children: /* @__PURE__ */ e(
|
|
2426
|
+
In,
|
|
2427
|
+
{
|
|
2428
|
+
questions: p.relatedQuestions,
|
|
2429
|
+
onQuestionClick: Be
|
|
2430
|
+
}
|
|
2431
|
+
) })
|
|
2432
|
+
]
|
|
2433
|
+
},
|
|
2434
|
+
p.id
|
|
2435
|
+
)),
|
|
2436
|
+
Q && /* @__PURE__ */ i(
|
|
2437
|
+
de,
|
|
2438
|
+
{
|
|
2439
|
+
direction: "row",
|
|
2440
|
+
alignItems: "flex-start",
|
|
2441
|
+
spacing: X.content,
|
|
2442
|
+
sx: { p: X.inset, bgcolor: "background.default" },
|
|
2443
|
+
children: [
|
|
2444
|
+
A || We,
|
|
2445
|
+
/* @__PURE__ */ e(Wn, { text: "Searching..." })
|
|
2446
|
+
]
|
|
2447
|
+
}
|
|
2448
|
+
),
|
|
2449
|
+
/* @__PURE__ */ e("div", { ref: Me })
|
|
2450
|
+
]
|
|
2451
|
+
}
|
|
2452
|
+
)
|
|
2453
|
+
}
|
|
2454
|
+
),
|
|
2455
|
+
/* @__PURE__ */ i(
|
|
2456
|
+
de,
|
|
2457
|
+
{
|
|
2458
|
+
sx: {
|
|
2459
|
+
px: X.inset,
|
|
2460
|
+
py: X.insetSm,
|
|
2461
|
+
bgcolor: "background.default",
|
|
2462
|
+
borderTop: 1,
|
|
2463
|
+
borderColor: "divider",
|
|
2464
|
+
flexShrink: 0,
|
|
2465
|
+
...y && I && {
|
|
2466
|
+
alignItems: "center",
|
|
2467
|
+
"& > *": { maxWidth: 900, width: "100%" }
|
|
2468
|
+
}
|
|
2469
|
+
},
|
|
2470
|
+
children: [
|
|
2471
|
+
/* @__PURE__ */ e(
|
|
2472
|
+
An,
|
|
2473
|
+
{
|
|
2474
|
+
value: G,
|
|
2475
|
+
onChange: le,
|
|
2476
|
+
onSubmit: (p) => {
|
|
2477
|
+
Re(), c?.(p, {});
|
|
2478
|
+
},
|
|
2479
|
+
placeholder: "Ask anything. Type @ for mentions and / for shortcuts.",
|
|
2480
|
+
models: lt,
|
|
2481
|
+
selectedModel: x,
|
|
2482
|
+
onModelChange: Ue,
|
|
2483
|
+
sources: st.map((p) => ({
|
|
2484
|
+
id: p.id,
|
|
2485
|
+
label: p.label,
|
|
2486
|
+
icon: p.icon,
|
|
2487
|
+
enabled: ve.includes(p.id)
|
|
2488
|
+
})),
|
|
2489
|
+
onSourceToggle: (p, r) => {
|
|
2490
|
+
Ke(
|
|
2491
|
+
(j) => r ? [...j, p] : j.filter((xe) => xe !== p)
|
|
2492
|
+
);
|
|
2493
|
+
},
|
|
2494
|
+
deepThinkingEnabled: P,
|
|
2495
|
+
onDeepThinkingToggle: (p) => se(p),
|
|
2496
|
+
webSearchEnabled: !0,
|
|
2497
|
+
onWebSearchToggle: () => {
|
|
2498
|
+
},
|
|
2499
|
+
onAttachmentClick: () => console.log("Attachment clicked"),
|
|
2500
|
+
onVoiceClick: () => fe(!J),
|
|
2501
|
+
isListening: J
|
|
2502
|
+
}
|
|
2503
|
+
),
|
|
2504
|
+
/* @__PURE__ */ e(
|
|
2505
|
+
Pn,
|
|
2506
|
+
{
|
|
2507
|
+
open: ce,
|
|
2508
|
+
isListening: J,
|
|
2509
|
+
onListeningToggle: () => fe(!J),
|
|
2510
|
+
onClose: () => Se(!1)
|
|
2511
|
+
}
|
|
2512
|
+
),
|
|
2513
|
+
!ce && /* @__PURE__ */ e(En, { isListening: J, onStop: () => fe(!1) }),
|
|
2514
|
+
/* @__PURE__ */ e(b, { variant: "caption", color: "text.secondary", sx: { mt: X.element, textAlign: "center" }, children: "Insight Engine can make mistakes. Verify important information." })
|
|
2515
|
+
]
|
|
2516
|
+
}
|
|
2517
|
+
)
|
|
2518
|
+
]
|
|
2519
|
+
}
|
|
2520
|
+
)
|
|
2521
|
+
]
|
|
2522
|
+
}
|
|
2523
|
+
);
|
|
2524
|
+
}, dt = ({
|
|
2525
|
+
open: n,
|
|
2526
|
+
children: o,
|
|
2527
|
+
defaultWidth: s = 400,
|
|
2528
|
+
minWidth: a = 320,
|
|
2529
|
+
maxWidth: u = 800,
|
|
2530
|
+
onClose: g,
|
|
2531
|
+
side: c = "right",
|
|
2532
|
+
header: h,
|
|
2533
|
+
showCloseButton: A = !0,
|
|
2534
|
+
sx: E,
|
|
2535
|
+
contentSx: y
|
|
2536
|
+
}) => {
|
|
2537
|
+
const [k, L] = z(s), [N, B] = z(!1), q = Oe(null), I = Oe(0), R = Oe(0), C = W((T) => {
|
|
2538
|
+
T.preventDefault(), B(!0), I.current = T.clientX, R.current = k;
|
|
2539
|
+
}, [k]), D = W((T) => {
|
|
2540
|
+
if (!N) return;
|
|
2541
|
+
const M = c === "right" ? I.current - T.clientX : T.clientX - I.current, F = Math.min(u, Math.max(a, R.current + M));
|
|
2542
|
+
L(F);
|
|
2543
|
+
}, [N, a, u, c]), m = W(() => {
|
|
2544
|
+
B(!1);
|
|
2545
|
+
}, []);
|
|
2546
|
+
return $e(() => (N && (document.addEventListener("mousemove", D), document.addEventListener("mouseup", m), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none"), () => {
|
|
2547
|
+
document.removeEventListener("mousemove", D), document.removeEventListener("mouseup", m), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
2548
|
+
}), [N, D, m]), n ? /* @__PURE__ */ i(
|
|
2549
|
+
l,
|
|
2550
|
+
{
|
|
2551
|
+
ref: q,
|
|
2552
|
+
sx: {
|
|
2553
|
+
position: "relative",
|
|
2554
|
+
width: k,
|
|
2555
|
+
minWidth: a,
|
|
2556
|
+
maxWidth: u,
|
|
2557
|
+
height: "100%",
|
|
2558
|
+
display: "flex",
|
|
2559
|
+
flexDirection: "column",
|
|
2560
|
+
backgroundColor: "background.paper",
|
|
2561
|
+
// Use MUI theme
|
|
2562
|
+
borderLeft: c === "right" ? "1px solid" : "none",
|
|
2563
|
+
borderRight: c === "left" ? "1px solid" : "none",
|
|
2564
|
+
borderColor: "divider",
|
|
2565
|
+
// Use MUI theme
|
|
2566
|
+
transition: N ? "none" : "width 0.1s ease-out",
|
|
2567
|
+
overflow: "hidden",
|
|
2568
|
+
flexShrink: 0,
|
|
2569
|
+
...E
|
|
2570
|
+
},
|
|
2571
|
+
children: [
|
|
2572
|
+
/* @__PURE__ */ e(
|
|
2573
|
+
l,
|
|
2574
|
+
{
|
|
2575
|
+
onMouseDown: C,
|
|
2576
|
+
sx: {
|
|
2577
|
+
position: "absolute",
|
|
2578
|
+
top: 0,
|
|
2579
|
+
[c === "right" ? "left" : "right"]: 0,
|
|
2580
|
+
width: 6,
|
|
2581
|
+
height: "100%",
|
|
2582
|
+
cursor: "col-resize",
|
|
2583
|
+
zIndex: 10,
|
|
2584
|
+
display: "flex",
|
|
2585
|
+
alignItems: "center",
|
|
2586
|
+
justifyContent: "center",
|
|
2587
|
+
"&:hover": {
|
|
2588
|
+
"& .resize-indicator": {
|
|
2589
|
+
backgroundColor: "primary.light",
|
|
2590
|
+
// Use MUI theme
|
|
2591
|
+
opacity: 1
|
|
2592
|
+
}
|
|
2593
|
+
},
|
|
2594
|
+
...N && {
|
|
2595
|
+
"& .resize-indicator": {
|
|
2596
|
+
backgroundColor: "primary.light",
|
|
2597
|
+
// Use MUI theme
|
|
2598
|
+
opacity: 1
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
},
|
|
2602
|
+
children: /* @__PURE__ */ e(
|
|
2603
|
+
l,
|
|
2604
|
+
{
|
|
2605
|
+
className: "resize-indicator",
|
|
2606
|
+
sx: {
|
|
2607
|
+
width: 3,
|
|
2608
|
+
height: 40,
|
|
2609
|
+
borderRadius: 2,
|
|
2610
|
+
backgroundColor: "action.hover",
|
|
2611
|
+
// Use MUI theme
|
|
2612
|
+
opacity: 0.5,
|
|
2613
|
+
transition: `all ${t.motion.duration.fast}`
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
)
|
|
2617
|
+
}
|
|
2618
|
+
),
|
|
2619
|
+
h && /* @__PURE__ */ i(
|
|
2620
|
+
l,
|
|
2621
|
+
{
|
|
2622
|
+
sx: {
|
|
2623
|
+
display: "flex",
|
|
2624
|
+
alignItems: "center",
|
|
2625
|
+
justifyContent: "space-between",
|
|
2626
|
+
p: 2,
|
|
2627
|
+
borderBottom: "1px solid",
|
|
2628
|
+
borderColor: "divider",
|
|
2629
|
+
// Use MUI theme
|
|
2630
|
+
flexShrink: 0
|
|
2631
|
+
},
|
|
2632
|
+
children: [
|
|
2633
|
+
/* @__PURE__ */ e(l, { sx: { flex: 1 }, children: h }),
|
|
2634
|
+
A && /* @__PURE__ */ e(U, { title: "Close panel", children: /* @__PURE__ */ e(
|
|
2635
|
+
v,
|
|
2636
|
+
{
|
|
2637
|
+
size: "small",
|
|
2638
|
+
onClick: g,
|
|
2639
|
+
sx: {
|
|
2640
|
+
color: "text.secondary",
|
|
2641
|
+
// Use MUI theme
|
|
2642
|
+
"&:hover": {
|
|
2643
|
+
backgroundColor: t.effects.overlay.hover
|
|
2644
|
+
// 8%
|
|
2645
|
+
}
|
|
2646
|
+
},
|
|
2647
|
+
children: /* @__PURE__ */ e("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e("path", { d: "M18 6L6 18M6 6l12 12" }) })
|
|
2648
|
+
}
|
|
2649
|
+
) })
|
|
2650
|
+
]
|
|
2651
|
+
}
|
|
2652
|
+
),
|
|
2653
|
+
/* @__PURE__ */ e(
|
|
2654
|
+
l,
|
|
2655
|
+
{
|
|
2656
|
+
sx: {
|
|
2657
|
+
flex: 1,
|
|
2658
|
+
overflow: "hidden",
|
|
2659
|
+
minHeight: 0,
|
|
2660
|
+
display: "flex",
|
|
2661
|
+
flexDirection: "column",
|
|
2662
|
+
...y
|
|
2663
|
+
},
|
|
2664
|
+
children: o
|
|
2665
|
+
}
|
|
2666
|
+
)
|
|
2667
|
+
]
|
|
2668
|
+
}
|
|
2669
|
+
) : null;
|
|
2670
|
+
}, ht = ({
|
|
2671
|
+
open: n = !1,
|
|
2672
|
+
onClick: o,
|
|
2673
|
+
position: s = "bottom-right",
|
|
2674
|
+
offset: a = { x: 24, y: 24 },
|
|
2675
|
+
showBadge: u = !1,
|
|
2676
|
+
badgeContent: g,
|
|
2677
|
+
size: c = "large",
|
|
2678
|
+
tooltip: h = "Ask AI",
|
|
2679
|
+
disabled: A = !1,
|
|
2680
|
+
zIndex: E = 1e3
|
|
2681
|
+
}) => {
|
|
2682
|
+
we().palette.mode;
|
|
2683
|
+
const k = {
|
|
2684
|
+
position: "fixed",
|
|
2685
|
+
zIndex: E
|
|
2686
|
+
};
|
|
2687
|
+
switch (s) {
|
|
2688
|
+
case "bottom-right":
|
|
2689
|
+
k.bottom = a.y, k.right = a.x;
|
|
2690
|
+
break;
|
|
2691
|
+
case "bottom-left":
|
|
2692
|
+
k.bottom = a.y, k.left = a.x;
|
|
2693
|
+
break;
|
|
2694
|
+
case "top-right":
|
|
2695
|
+
k.top = a.y, k.right = a.x;
|
|
2696
|
+
break;
|
|
2697
|
+
case "top-left":
|
|
2698
|
+
k.top = a.y, k.left = a.x;
|
|
2699
|
+
break;
|
|
2700
|
+
}
|
|
2701
|
+
const L = /* @__PURE__ */ i(
|
|
2702
|
+
Sn,
|
|
2703
|
+
{
|
|
2704
|
+
color: "primary",
|
|
2705
|
+
onClick: o,
|
|
2706
|
+
disabled: A,
|
|
2707
|
+
size: c,
|
|
2708
|
+
sx: {
|
|
2709
|
+
background: Y.gradient.diagonal,
|
|
2710
|
+
boxShadow: Y.gradient.glow,
|
|
2711
|
+
transition: "all 0.3s ease",
|
|
2712
|
+
"&:hover": {
|
|
2713
|
+
background: Y.gradient.diagonal,
|
|
2714
|
+
boxShadow: Y.gradient.glow,
|
|
2715
|
+
transform: "scale(1.05)"
|
|
2716
|
+
},
|
|
2717
|
+
"&:active": {
|
|
2718
|
+
transform: "scale(0.95)"
|
|
2719
|
+
},
|
|
2720
|
+
"&.Mui-disabled": {
|
|
2721
|
+
background: "action.disabledBackground",
|
|
2722
|
+
// Use MUI theme
|
|
2723
|
+
boxShadow: "none"
|
|
2724
|
+
}
|
|
2725
|
+
},
|
|
2726
|
+
children: [
|
|
2727
|
+
/* @__PURE__ */ e(bn, { sx: { color: "common.white" } }),
|
|
2728
|
+
" "
|
|
2729
|
+
]
|
|
2730
|
+
}
|
|
2731
|
+
);
|
|
2732
|
+
return /* @__PURE__ */ e(l, { sx: k, children: u ? /* @__PURE__ */ e(
|
|
2733
|
+
wn,
|
|
2734
|
+
{
|
|
2735
|
+
badgeContent: g,
|
|
2736
|
+
color: "error",
|
|
2737
|
+
overlap: "circular",
|
|
2738
|
+
sx: {
|
|
2739
|
+
"& .MuiBadge-badge": {
|
|
2740
|
+
backgroundColor: "secondary.main",
|
|
2741
|
+
// Use MUI theme
|
|
2742
|
+
color: "common.white"
|
|
2743
|
+
// Use MUI theme
|
|
2744
|
+
}
|
|
2745
|
+
},
|
|
2746
|
+
children: /* @__PURE__ */ e(U, { title: h, placement: "left", children: L })
|
|
2747
|
+
}
|
|
2748
|
+
) : /* @__PURE__ */ e(U, { title: h, placement: "left", children: L }) });
|
|
2749
|
+
}, pt = "insight-engine", mt = t.spacing.layout.aiPanelWidth, ut = ({
|
|
2750
|
+
isFullscreen: n,
|
|
2751
|
+
headerHeight: o,
|
|
2752
|
+
sidebarWidth: s,
|
|
2753
|
+
panelZIndex: a,
|
|
2754
|
+
navStyle: u
|
|
2755
|
+
}) => {
|
|
2756
|
+
const g = {
|
|
2757
|
+
position: "fixed",
|
|
2758
|
+
top: o,
|
|
2759
|
+
height: `calc(100vh - ${o}px)`,
|
|
2760
|
+
zIndex: a
|
|
2761
|
+
};
|
|
2762
|
+
return n ? {
|
|
2763
|
+
...g,
|
|
2764
|
+
left: u === "sidebar" ? s : 0,
|
|
2765
|
+
right: 0,
|
|
2766
|
+
bottom: 0
|
|
2767
|
+
} : {
|
|
2768
|
+
...g,
|
|
2769
|
+
right: 0
|
|
2770
|
+
};
|
|
2771
|
+
}, gt = ({
|
|
2772
|
+
aiPanelFullscreen: n,
|
|
2773
|
+
contentSx: o
|
|
2774
|
+
}) => ({
|
|
2775
|
+
flex: 1,
|
|
2776
|
+
minHeight: 0,
|
|
2777
|
+
bgcolor: "background.default",
|
|
2778
|
+
overflow: "auto",
|
|
2779
|
+
display: n ? "none" : "block",
|
|
2780
|
+
...o
|
|
2781
|
+
}), ft = ({
|
|
2782
|
+
aiPanelOpen: n,
|
|
2783
|
+
aiPanelFullscreen: o,
|
|
2784
|
+
aiPanelWidth: s,
|
|
2785
|
+
transition: a
|
|
2786
|
+
}) => ({
|
|
2787
|
+
display: "flex",
|
|
2788
|
+
flexDirection: "column",
|
|
2789
|
+
flex: 1,
|
|
2790
|
+
minHeight: 0,
|
|
2791
|
+
transition: a,
|
|
2792
|
+
marginRight: n && !o ? `${s}px` : 0
|
|
2793
|
+
}), xt = ({
|
|
2794
|
+
children: n,
|
|
2795
|
+
navStyle: o = "sidebar",
|
|
2796
|
+
aiTrigger: s,
|
|
2797
|
+
companyName: a = "Trinity",
|
|
2798
|
+
navItems: u = [],
|
|
2799
|
+
selectedNavItem: g,
|
|
2800
|
+
onSelectedNavItemChange: c,
|
|
2801
|
+
user: h,
|
|
2802
|
+
clientName: A,
|
|
2803
|
+
clients: E,
|
|
2804
|
+
onClientChange: y,
|
|
2805
|
+
onNavigate: k,
|
|
2806
|
+
fabProps: L,
|
|
2807
|
+
panelProps: N,
|
|
2808
|
+
aiPanelWidth: B = mt,
|
|
2809
|
+
contentSx: q
|
|
2810
|
+
}) => {
|
|
2811
|
+
const I = we();
|
|
2812
|
+
Ae(I.breakpoints.down("md"));
|
|
2813
|
+
const R = s ?? (o === "sidebar" ? "sidebar" : "fab"), [C, D] = z(!1), [m, T] = z(!1), [M, F] = z(!0), K = W(() => {
|
|
2814
|
+
D((P) => !P);
|
|
2815
|
+
}, []), S = W(() => {
|
|
2816
|
+
D(!1), T(!1);
|
|
2817
|
+
}, []), V = W(() => {
|
|
2818
|
+
T((P) => !P);
|
|
2819
|
+
}, []), d = W(
|
|
2820
|
+
(P) => {
|
|
2821
|
+
if (P === pt) {
|
|
2822
|
+
K();
|
|
2823
|
+
return;
|
|
2824
|
+
}
|
|
2825
|
+
c?.(P), k?.(P);
|
|
2826
|
+
},
|
|
2827
|
+
[K, c, k]
|
|
2828
|
+
), { layout: w } = t.spacing, oe = w.headerHeight, re = w.sidebarWidthExpanded, ae = w.sidebarWidthCollapsed, ne = () => {
|
|
2829
|
+
if (R === "none" || !C && !m) return null;
|
|
2830
|
+
const P = I.zIndex.drawer - 1, ce = ut({
|
|
2831
|
+
isFullscreen: m,
|
|
2832
|
+
headerHeight: oe,
|
|
2833
|
+
sidebarWidth: M ? re : ae,
|
|
2834
|
+
panelZIndex: P,
|
|
2835
|
+
navStyle: o
|
|
2836
|
+
});
|
|
2837
|
+
return /* @__PURE__ */ e(
|
|
2838
|
+
dt,
|
|
2839
|
+
{
|
|
2840
|
+
open: C,
|
|
2841
|
+
defaultWidth: B,
|
|
2842
|
+
minWidth: 320,
|
|
2843
|
+
maxWidth: m ? void 0 : 800,
|
|
2844
|
+
side: "right",
|
|
2845
|
+
showCloseButton: !1,
|
|
2846
|
+
sx: {
|
|
2847
|
+
...ce,
|
|
2848
|
+
bgcolor: "background.paper",
|
|
2849
|
+
// Remove shadow when fullscreen to eliminate gap appearance
|
|
2850
|
+
boxShadow: C && !m ? t.effects.shadow.floating : "none",
|
|
2851
|
+
// In fullscreen mode, take full width and disable resize
|
|
2852
|
+
...m && {
|
|
2853
|
+
width: "auto",
|
|
2854
|
+
minWidth: "auto",
|
|
2855
|
+
maxWidth: "none"
|
|
2856
|
+
}
|
|
2857
|
+
},
|
|
2858
|
+
contentSx: {
|
|
2859
|
+
display: "flex",
|
|
2860
|
+
flexDirection: "column",
|
|
2861
|
+
height: "100%"
|
|
2862
|
+
},
|
|
2863
|
+
children: /* @__PURE__ */ e(
|
|
2864
|
+
ct,
|
|
2865
|
+
{
|
|
2866
|
+
showControls: !0,
|
|
2867
|
+
onClose: S,
|
|
2868
|
+
isFullscreen: m,
|
|
2869
|
+
onFullscreenToggle: V,
|
|
2870
|
+
...N
|
|
2871
|
+
}
|
|
2872
|
+
)
|
|
2873
|
+
}
|
|
2874
|
+
);
|
|
2875
|
+
}, G = () => {
|
|
2876
|
+
if (R !== "fab") return null;
|
|
2877
|
+
const P = w.gutter, se = {
|
|
2878
|
+
x: C ? B + P : P,
|
|
2879
|
+
y: P
|
|
2880
|
+
};
|
|
2881
|
+
return /* @__PURE__ */ e(
|
|
2882
|
+
ht,
|
|
2883
|
+
{
|
|
2884
|
+
onClick: K,
|
|
2885
|
+
open: C,
|
|
2886
|
+
position: "bottom-right",
|
|
2887
|
+
offset: se,
|
|
2888
|
+
zIndex: I.zIndex.drawer + 1,
|
|
2889
|
+
...L
|
|
2890
|
+
}
|
|
2891
|
+
);
|
|
2892
|
+
}, le = I.transitions.create(["margin", "width"], {
|
|
2893
|
+
easing: I.transitions.easing.sharp,
|
|
2894
|
+
duration: I.transitions.duration.enteringScreen
|
|
2895
|
+
}), Q = gt({
|
|
2896
|
+
aiPanelFullscreen: m,
|
|
2897
|
+
contentSx: q
|
|
2898
|
+
}), te = ft({
|
|
2899
|
+
aiPanelOpen: C,
|
|
2900
|
+
aiPanelFullscreen: m,
|
|
2901
|
+
aiPanelWidth: B,
|
|
2902
|
+
transition: le
|
|
2903
|
+
});
|
|
2904
|
+
return o === "sidebar" ? /* @__PURE__ */ i(l, { sx: { display: "flex", minHeight: "100vh" }, children: [
|
|
2905
|
+
/* @__PURE__ */ e(l, { sx: te, children: /* @__PURE__ */ e(
|
|
2906
|
+
Zn,
|
|
2907
|
+
{
|
|
2908
|
+
appName: a,
|
|
2909
|
+
clientName: A,
|
|
2910
|
+
clients: E,
|
|
2911
|
+
onClientChange: y,
|
|
2912
|
+
navItems: u,
|
|
2913
|
+
selectedNavItem: g,
|
|
2914
|
+
onNavItemClick: d,
|
|
2915
|
+
userName: h?.name,
|
|
2916
|
+
userEmail: h?.email,
|
|
2917
|
+
userInitials: h?.initials,
|
|
2918
|
+
sidebarExpanded: M,
|
|
2919
|
+
onSidebarExpandedChange: F,
|
|
2920
|
+
children: /* @__PURE__ */ e(l, { sx: Q, children: n })
|
|
2921
|
+
}
|
|
2922
|
+
) }),
|
|
2923
|
+
ne(),
|
|
2924
|
+
G()
|
|
2925
|
+
] }) : /* @__PURE__ */ i(l, { sx: { display: "flex", flexDirection: "column", minHeight: "100vh" }, children: [
|
|
2926
|
+
/* @__PURE__ */ e(
|
|
2927
|
+
Gn,
|
|
2928
|
+
{
|
|
2929
|
+
appName: a,
|
|
2930
|
+
clientName: A,
|
|
2931
|
+
clients: E,
|
|
2932
|
+
onClientChange: y,
|
|
2933
|
+
userName: h?.name,
|
|
2934
|
+
userEmail: h?.email,
|
|
2935
|
+
userInitials: h?.initials
|
|
2936
|
+
}
|
|
2937
|
+
),
|
|
2938
|
+
/* @__PURE__ */ e(
|
|
2939
|
+
l,
|
|
2940
|
+
{
|
|
2941
|
+
component: "main",
|
|
2942
|
+
sx: {
|
|
2943
|
+
...te,
|
|
2944
|
+
...Q,
|
|
2945
|
+
pt: `${w.contentPadding}px`
|
|
2946
|
+
// Account for fixed header
|
|
2947
|
+
},
|
|
2948
|
+
children: n
|
|
2949
|
+
}
|
|
2950
|
+
),
|
|
2951
|
+
ne(),
|
|
2952
|
+
G()
|
|
2953
|
+
] });
|
|
2954
|
+
}, ao = (n) => ($e(() => {
|
|
2955
|
+
process.env.NODE_ENV === "development" && console.warn(
|
|
2956
|
+
'[Trinity Design System] AIFabLayout is deprecated and will be removed in v2.0.0. Use AppLayout with navStyle="topnav" and aiTrigger="fab" instead. See migration guide: https://trinity.design/migration'
|
|
2957
|
+
);
|
|
2958
|
+
}, []), /* @__PURE__ */ e(xt, { aiTrigger: "fab", ...n }));
|
|
2959
|
+
export {
|
|
2960
|
+
oo as A,
|
|
2961
|
+
to as C,
|
|
2962
|
+
ro as H,
|
|
2963
|
+
ct as I,
|
|
2964
|
+
dt as R,
|
|
2965
|
+
no as S,
|
|
2966
|
+
Gn as T,
|
|
2967
|
+
io as U,
|
|
2968
|
+
Zn as a,
|
|
2969
|
+
eo as b,
|
|
2970
|
+
Yt as c,
|
|
2971
|
+
qt as d,
|
|
2972
|
+
Jt as e,
|
|
2973
|
+
Zt as f,
|
|
2974
|
+
xt as g,
|
|
2975
|
+
ao as h,
|
|
2976
|
+
Xt as u
|
|
2977
|
+
};
|