@carto/ps-react-ui 4.4.0-chat-ui.1 → 4.4.0-chat-ui.2

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.
Files changed (39) hide show
  1. package/dist/chat.js +1071 -391
  2. package/dist/chat.js.map +1 -1
  3. package/dist/components.js +141 -159
  4. package/dist/components.js.map +1 -1
  5. package/dist/copy-button-DGL1tyli.js +26 -0
  6. package/dist/copy-button-DGL1tyli.js.map +1 -0
  7. package/dist/index-BnyeR7Qx.js +6601 -0
  8. package/dist/index-BnyeR7Qx.js.map +1 -0
  9. package/dist/types/chat/const.d.ts +1 -0
  10. package/dist/types/chat/feedback/chat-tool-code-area.d.ts +4 -0
  11. package/dist/types/chat/feedback/chat-tool-full-view-dialog.d.ts +2 -0
  12. package/dist/types/chat/feedback/chat-tool-group.d.ts +2 -0
  13. package/dist/types/chat/feedback/chat-tool-trace.d.ts +3 -0
  14. package/dist/types/chat/feedback/get-tool-label.d.ts +2 -0
  15. package/dist/types/chat/feedback/index.d.ts +4 -1
  16. package/dist/types/chat/feedback/styles.d.ts +149 -3
  17. package/dist/types/chat/index.d.ts +6 -3
  18. package/dist/types/chat/types.d.ts +58 -5
  19. package/dist/widgets/toolbar-actions.js +101 -6693
  20. package/dist/widgets/toolbar-actions.js.map +1 -1
  21. package/package.json +1 -1
  22. package/src/chat/const.ts +1 -0
  23. package/src/chat/feedback/chat-tool-code-area.test.tsx +23 -0
  24. package/src/chat/feedback/chat-tool-code-area.tsx +71 -0
  25. package/src/chat/feedback/chat-tool-full-view-dialog.test.tsx +39 -0
  26. package/src/chat/feedback/chat-tool-full-view-dialog.tsx +121 -0
  27. package/src/chat/feedback/chat-tool-group.test.tsx +84 -0
  28. package/src/chat/feedback/chat-tool-group.tsx +156 -0
  29. package/src/chat/feedback/chat-tool-trace.test.tsx +81 -0
  30. package/src/chat/feedback/chat-tool-trace.tsx +187 -0
  31. package/src/chat/feedback/get-tool-label.test.tsx +91 -0
  32. package/src/chat/feedback/get-tool-label.ts +13 -0
  33. package/src/chat/feedback/index.ts +4 -1
  34. package/src/chat/feedback/styles.ts +153 -4
  35. package/src/chat/index.ts +14 -3
  36. package/src/chat/types.ts +64 -5
  37. package/dist/types/chat/feedback/chat-tools.d.ts +0 -2
  38. package/src/chat/feedback/chat-tools.test.tsx +0 -23
  39. package/src/chat/feedback/chat-tools.tsx +0 -54
package/dist/chat.js CHANGED
@@ -1,17 +1,19 @@
1
- import { jsx as d, jsxs as y, Fragment as K } from "react/jsx-runtime";
2
- import { c as T } from "react/compiler-runtime";
3
- import { styled as H, Typography as $, Box as x, Link as Y, ButtonBase as X, Fab as J, IconButton as O, FilledInput as V, FormHelperText as q, FormControl as Q, Accordion as Z, AccordionSummary as ee, AccordionDetails as te, CircularProgress as oe } from "@mui/material";
4
- import { ErrorOutline as N, ArrowUpward as ne, KeyboardArrowDown as le, Close as re, StopCircleOutlined as se, ArrowUpwardOutlined as ie, ThumbUp as ae, ThumbUpOutlined as ce, ThumbDown as de, ThumbDownOutlined as me, ExpandMore as pe, CheckCircleOutline as fe } from "@mui/icons-material";
5
- import { keyframes as P } from "@mui/material/styles";
6
- import { useRef as ue } from "react";
7
- const j = 768, Ee = 300, Fe = 100, G = H($)(() => ({
1
+ import { jsx as a, jsxs as T, Fragment as Te } from "react/jsx-runtime";
2
+ import { c as z } from "react/compiler-runtime";
3
+ import { styled as se, Typography as _, Box as y, Link as ke, ButtonBase as Se, Fab as _e, IconButton as H, FilledInput as $e, FormHelperText as Ae, FormControl as Ie, DialogTitle as Re, DialogContent as Ee, Dialog as Le, createSvgIcon as ae, Tooltip as De, Button as re, Collapse as le, CircularProgress as ze } from "@mui/material";
4
+ import { ErrorOutline as he, ArrowUpward as Be, KeyboardArrowDown as Fe, Close as ge, StopCircleOutlined as We, ArrowUpwardOutlined as Me, ThumbUp as Oe, ThumbUpOutlined as He, ThumbDown as Pe, ThumbDownOutlined as Ve, ArrowRight as xe, Error as Ue, CheckCircle as je, ChevronRight as Ne } from "@mui/icons-material";
5
+ import { keyframes as N } from "@mui/material/styles";
6
+ import { useRef as be, forwardRef as ce, useState as ie, useEffect as Ge } from "react";
7
+ import { C as Ke } from "./copy-button-DGL1tyli.js";
8
+ import { a as Xe } from "./index-BnyeR7Qx.js";
9
+ const q = 768, Mt = 300, Ot = 100, Ye = 126, ye = se(_)(() => ({
8
10
  whiteSpace: "pre-wrap",
9
11
  overflowX: "clip",
10
12
  overflowWrap: "break-word",
11
13
  maxWidth: "100%"
12
14
  }));
13
- G.displayName = "ChatMessageOverflow";
14
- const A = {
15
+ ye.displayName = "ChatMessageOverflow";
16
+ const O = {
15
17
  agentMessageContainer: (t) => ({
16
18
  width: "100%",
17
19
  display: "flex",
@@ -161,125 +163,125 @@ const A = {
161
163
  }
162
164
  }
163
165
  };
164
- function Oe(t) {
165
- const e = T(11), {
166
- children: n,
167
- muted: o,
168
- topContext: i,
169
- sx: r
170
- } = t, m = o === void 0 ? !1 : o;
171
- let a;
172
- e[0] !== i ? (a = i && /* @__PURE__ */ d(x, { sx: A.userMessageTop, children: i }), e[0] = i, e[1] = a) : a = e[1];
173
- const s = m ? A.muted : void 0;
174
- let l;
175
- e[2] !== r || e[3] !== s ? (l = {
176
- ...A.userMessage,
177
- ...s,
178
- ...r
179
- }, e[2] = r, e[3] = s, e[4] = l) : l = e[4];
166
+ function Ht(t) {
167
+ const e = z(11), {
168
+ children: o,
169
+ muted: r,
170
+ topContext: l,
171
+ sx: n
172
+ } = t, u = r === void 0 ? !1 : r;
173
+ let s;
174
+ e[0] !== l ? (s = l && /* @__PURE__ */ a(y, { sx: O.userMessageTop, children: l }), e[0] = l, e[1] = s) : s = e[1];
175
+ const i = u ? O.muted : void 0;
180
176
  let c;
181
- e[5] !== n || e[6] !== l ? (c = /* @__PURE__ */ d(G, { className: "PsChat--user-message-inner", variant: "body2", sx: l, children: n }), e[5] = n, e[6] = l, e[7] = c) : c = e[7];
182
- let p;
183
- return e[8] !== a || e[9] !== c ? (p = /* @__PURE__ */ y(x, { className: "PsChat--user-message", sx: A.userMessageContainer, children: [
184
- a,
185
- c
186
- ] }), e[8] = a, e[9] = c, e[10] = p) : p = e[10], p;
177
+ e[2] !== n || e[3] !== i ? (c = {
178
+ ...O.userMessage,
179
+ ...i,
180
+ ...n
181
+ }, e[2] = n, e[3] = i, e[4] = c) : c = e[4];
182
+ let d;
183
+ e[5] !== o || e[6] !== c ? (d = /* @__PURE__ */ a(ye, { className: "PsChat--user-message-inner", variant: "body2", sx: c, children: o }), e[5] = o, e[6] = c, e[7] = d) : d = e[7];
184
+ let x;
185
+ return e[8] !== s || e[9] !== d ? (x = /* @__PURE__ */ T(y, { className: "PsChat--user-message", sx: O.userMessageContainer, children: [
186
+ s,
187
+ d
188
+ ] }), e[8] = s, e[9] = d, e[10] = x) : x = e[10], x;
187
189
  }
188
- const he = (t) => {
189
- const e = T(6);
190
- let n, o;
190
+ const Je = (t) => {
191
+ const e = z(6);
192
+ let o, r;
191
193
  e[0] !== t ? ({
192
- className: n,
193
- ...o
194
- } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
195
- const i = `PsChat--agent-message ${n ?? ""}`;
196
- let r;
197
- return e[3] !== o || e[4] !== i ? (r = /* @__PURE__ */ d(x, { className: i, ...o }), e[3] = o, e[4] = i, e[5] = r) : r = e[5], r;
198
- }, ge = H(he)(({
194
+ className: o,
195
+ ...r
196
+ } = t, e[0] = t, e[1] = o, e[2] = r) : (o = e[1], r = e[2]);
197
+ const l = `PsChat--agent-message ${o ?? ""}`;
198
+ let n;
199
+ return e[3] !== r || e[4] !== l ? (n = /* @__PURE__ */ a(y, { className: l, ...r }), e[3] = r, e[4] = l, e[5] = n) : n = e[5], n;
200
+ }, qe = se(Je)(({
199
201
  theme: t
200
- }) => A.agentMessageContainer(t));
201
- ge.displayName = "ChatAgentMessage";
202
- function Pe(t) {
203
- const e = T(13), {
204
- errors: n,
205
- icon: o,
206
- actions: i,
207
- sx: r
202
+ }) => O.agentMessageContainer(t));
203
+ qe.displayName = "ChatAgentMessage";
204
+ function Pt(t) {
205
+ const e = z(13), {
206
+ errors: o,
207
+ icon: r,
208
+ actions: l,
209
+ sx: n
208
210
  } = t;
209
- let m;
210
- e[0] !== r ? (m = {
211
- ...A.errorMessage,
212
- ...r
213
- }, e[0] = r, e[1] = m) : m = e[1];
214
- let a;
215
- e[2] !== o ? (a = o ?? /* @__PURE__ */ d(N, { fontSize: "medium", color: "error" }), e[2] = o, e[3] = a) : a = e[3];
211
+ let u;
212
+ e[0] !== n ? (u = {
213
+ ...O.errorMessage,
214
+ ...n
215
+ }, e[0] = n, e[1] = u) : u = e[1];
216
216
  let s;
217
- e[4] !== n ? (s = n.map(xe), e[4] = n, e[5] = s) : s = e[5];
218
- let l;
219
- e[6] !== i ? (l = i?.length ? /* @__PURE__ */ d(x, { sx: A.errorActions, children: (i ?? []).map(be) }) : null, e[6] = i, e[7] = l) : l = e[7];
217
+ e[2] !== r ? (s = r ?? /* @__PURE__ */ a(he, { fontSize: "medium", color: "error" }), e[2] = r, e[3] = s) : s = e[3];
218
+ let i;
219
+ e[4] !== o ? (i = o.map(Ze), e[4] = o, e[5] = i) : i = e[5];
220
220
  let c;
221
- return e[8] !== m || e[9] !== a || e[10] !== s || e[11] !== l ? (c = /* @__PURE__ */ y(x, { sx: m, children: [
222
- a,
221
+ e[6] !== l ? (c = l?.length ? /* @__PURE__ */ a(y, { sx: O.errorActions, children: (l ?? []).map(Qe) }) : null, e[6] = l, e[7] = c) : c = e[7];
222
+ let d;
223
+ return e[8] !== u || e[9] !== s || e[10] !== i || e[11] !== c ? (d = /* @__PURE__ */ T(y, { sx: u, children: [
223
224
  s,
224
- l
225
- ] }), e[8] = m, e[9] = a, e[10] = s, e[11] = l, e[12] = c) : c = e[12], c;
225
+ i,
226
+ c
227
+ ] }), e[8] = u, e[9] = s, e[10] = i, e[11] = c, e[12] = d) : d = e[12], d;
226
228
  }
227
- function be(t, e) {
228
- return /* @__PURE__ */ y("span", { children: [
229
- e > 0 && /* @__PURE__ */ d($, { component: "span", variant: "body2", sx: A.errorActionSeparator, children: "·" }),
230
- /* @__PURE__ */ d(Y, { component: "button", variant: "body2", onClick: t.onClick, sx: A.errorAction, children: t.label })
229
+ function Qe(t, e) {
230
+ return /* @__PURE__ */ T("span", { children: [
231
+ e > 0 && /* @__PURE__ */ a(_, { component: "span", variant: "body2", sx: O.errorActionSeparator, children: "·" }),
232
+ /* @__PURE__ */ a(ke, { component: "button", variant: "body2", onClick: t.onClick, sx: O.errorAction, children: t.label })
231
233
  ] }, e);
232
234
  }
233
- function xe(t, e) {
234
- return /* @__PURE__ */ d($, { variant: "subtitle2", color: "error.relatedDark", children: t }, e);
235
+ function Ze(t, e) {
236
+ return /* @__PURE__ */ a(_, { variant: "subtitle2", color: "error.relatedDark", children: t }, e);
235
237
  }
236
- function Ce(t) {
237
- const e = T(17);
238
- let n, o, i, r;
238
+ function et(t) {
239
+ const e = z(17);
240
+ let o, r, l, n;
239
241
  e[0] !== t ? ({
240
- label: o,
241
- color: n,
242
- sx: r,
243
- ...i
244
- } = t, e[0] = t, e[1] = n, e[2] = o, e[3] = i, e[4] = r) : (n = e[1], o = e[2], i = e[3], r = e[4]);
245
- let m;
246
- e[5] !== n ? (m = n ? {
247
- backgroundColor: n
248
- } : void 0, e[5] = n, e[6] = m) : m = e[6];
249
- let a;
250
- e[7] !== r || e[8] !== m ? (a = {
251
- ...A.suggestionButton,
252
- ...m,
253
- ...r
254
- }, e[7] = r, e[8] = m, e[9] = a) : a = e[9];
242
+ label: r,
243
+ color: o,
244
+ sx: n,
245
+ ...l
246
+ } = t, e[0] = t, e[1] = o, e[2] = r, e[3] = l, e[4] = n) : (o = e[1], r = e[2], l = e[3], n = e[4]);
247
+ let u;
248
+ e[5] !== o ? (u = o ? {
249
+ backgroundColor: o
250
+ } : void 0, e[5] = o, e[6] = u) : u = e[6];
255
251
  let s;
256
- e[10] !== o ? (s = /* @__PURE__ */ d($, { color: "inherit", variant: "body2", children: o }), e[10] = o, e[11] = s) : s = e[11];
257
- let l;
258
- e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ d(ne, {}), e[12] = l) : l = e[12];
252
+ e[7] !== n || e[8] !== u ? (s = {
253
+ ...O.suggestionButton,
254
+ ...u,
255
+ ...n
256
+ }, e[7] = n, e[8] = u, e[9] = s) : s = e[9];
257
+ let i;
258
+ e[10] !== r ? (i = /* @__PURE__ */ a(_, { color: "inherit", variant: "body2", children: r }), e[10] = r, e[11] = i) : i = e[11];
259
259
  let c;
260
- return e[13] !== i || e[14] !== a || e[15] !== s ? (c = /* @__PURE__ */ y(X, { sx: a, ...i, children: [
261
- s,
262
- l
263
- ] }), e[13] = i, e[14] = a, e[15] = s, e[16] = c) : c = e[16], c;
260
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ a(Be, {}), e[12] = c) : c = e[12];
261
+ let d;
262
+ return e[13] !== l || e[14] !== s || e[15] !== i ? (d = /* @__PURE__ */ T(Se, { sx: s, ...l, children: [
263
+ i,
264
+ c
265
+ ] }), e[13] = l, e[14] = s, e[15] = i, e[16] = d) : d = e[16], d;
264
266
  }
265
- const ye = P`
267
+ const tt = N`
266
268
  0% {
267
269
  background-position: 150% 0;
268
270
  }
269
271
  100% {
270
272
  background-position: -50% 0;
271
273
  }
272
- `, ve = P`
274
+ `, ot = N`
273
275
  0% { transform: scale(0.68); opacity: 0.7; }
274
276
  40% { transform: scale(1); opacity: 1; }
275
277
  80% { transform: scale(0.6); opacity: 0.65; }
276
278
  100% { transform: scale(0.68); opacity: 0.7; }
277
- `, Te = P`
279
+ `, nt = N`
278
280
  0% { transform: scale(1); }
279
281
  40% { transform: scale(0.75); }
280
282
  80% { transform: scale(1.125); }
281
283
  100% { transform: scale(1); }
282
- `, z = {
284
+ `, w = {
283
285
  thinking: {
284
286
  display: "flex",
285
287
  alignItems: "center",
@@ -298,7 +300,7 @@ const ye = P`
298
300
  backgroundClip: "text",
299
301
  WebkitBackgroundClip: "text",
300
302
  WebkitTextFillColor: "transparent",
301
- animation: `${ye} 2s ease-in-out infinite`,
303
+ animation: `${tt} 2s ease-in-out infinite`,
302
304
  animationDuration: "2s"
303
305
  },
304
306
  loader: {
@@ -316,7 +318,7 @@ const ye = P`
316
318
  backgroundColor: ({
317
319
  palette: t
318
320
  }) => t.action.disabled,
319
- animation: `${ve} 1s ease-in-out infinite`
321
+ animation: `${ot} 1s ease-in-out infinite`
320
322
  },
321
323
  loaderInnerCircle: {
322
324
  position: "absolute",
@@ -326,84 +328,301 @@ const ye = P`
326
328
  backgroundColor: ({
327
329
  palette: t
328
330
  }) => t.text.primary,
329
- animation: `${Te} 1s ease-in-out infinite`
331
+ animation: `${nt} 1s ease-in-out infinite`
330
332
  },
331
- tools: {
333
+ // --- Tool Trace styles ---
334
+ traceHeader: {
335
+ display: "flex",
336
+ alignItems: "center",
337
+ padding: 0,
338
+ paddingLeft: ({
339
+ spacing: t
340
+ }) => t(0.5),
341
+ borderRadius: ({
342
+ spacing: t
343
+ }) => t(0.5),
344
+ width: "fit-content",
345
+ color: ({
346
+ palette: t
347
+ }) => t.text.secondary,
348
+ "&:hover": {
349
+ backgroundColor: ({
350
+ palette: t
351
+ }) => t.action.hover
352
+ }
353
+ },
354
+ traceChevron: {
355
+ color: ({
356
+ palette: t
357
+ }) => t.text.secondary,
358
+ transition: "transform 0.2s"
359
+ },
360
+ traceDetailsWrapper: {
361
+ marginTop: ({
362
+ spacing: t
363
+ }) => t(0.5),
364
+ padding: ({
365
+ spacing: t
366
+ }) => t(1.5),
367
+ border: "1px solid",
368
+ borderColor: "divider",
369
+ borderRadius: ({
370
+ spacing: t
371
+ }) => t(1)
372
+ },
373
+ traceField: {
374
+ display: "flex",
375
+ alignItems: "flex-start",
376
+ gap: ({
377
+ spacing: t
378
+ }) => t(1)
379
+ },
380
+ traceFieldLabel: {
381
+ flexShrink: 0
382
+ },
383
+ traceReference: {
384
+ display: "flex",
385
+ borderRadius: ({
386
+ spacing: t
387
+ }) => t(0.25),
388
+ padding: ({
389
+ spacing: t
390
+ }) => t(0, 0.5),
391
+ gap: ({
392
+ spacing: t
393
+ }) => t(0.5),
394
+ backgroundColor: ({
395
+ palette: t
396
+ }) => t.success.relatedLight,
397
+ color: ({
398
+ palette: t
399
+ }) => t.success.dark
400
+ },
401
+ traceStatusSuccess: {
402
+ color: ({
403
+ palette: t
404
+ }) => t.success.main
405
+ },
406
+ traceStatusError: {
407
+ color: ({
408
+ palette: t
409
+ }) => t.error.main
410
+ },
411
+ // --- Code Area styles ---
412
+ codeArea: {
413
+ position: "relative",
332
414
  width: "100%"
333
415
  },
334
- toolHeader: {
416
+ codeAreaPre: {
417
+ margin: 0,
418
+ padding: ({
419
+ spacing: t
420
+ }) => t(1),
421
+ borderRadius: ({
422
+ spacing: t
423
+ }) => t(0.5),
424
+ backgroundColor: ({
425
+ palette: t
426
+ }) => t.background.default,
427
+ fontSize: "0.75rem",
428
+ fontFamily: "monospace",
429
+ whiteSpace: "pre-wrap",
430
+ wordBreak: "break-word",
431
+ overflowY: "auto"
432
+ },
433
+ codeAreaPreError: {
434
+ borderLeft: ({
435
+ palette: t
436
+ }) => `3px solid ${t.error.main}`,
437
+ backgroundColor: ({
438
+ palette: t
439
+ }) => `${t.error.main}08`
440
+ },
441
+ codeAreaFullViewButton: {
442
+ position: "absolute",
443
+ top: ({
444
+ spacing: t
445
+ }) => t(0.5),
446
+ right: ({
447
+ spacing: t
448
+ }) => t(0.5)
449
+ },
450
+ // --- Full View Dialog styles ---
451
+ fullViewDialog: {
452
+ margin: ({
453
+ spacing: t
454
+ }) => t(5)
455
+ },
456
+ fullViewPaper: {
457
+ borderRadius: 1
458
+ },
459
+ fullViewTitle: {
460
+ display: "flex",
461
+ alignItems: "center",
462
+ justifyContent: "space-between",
463
+ padding: ({
464
+ spacing: t
465
+ }) => t(2),
466
+ borderBottom: "1px solid",
467
+ borderBottomColor: "divider"
468
+ },
469
+ fullViewDialogContent: {
470
+ padding: 0,
471
+ "&:first-of-type": {
472
+ paddingTop: 0
473
+ }
474
+ },
475
+ fullViewPre: {
476
+ margin: 0,
477
+ padding: ({
478
+ spacing: t
479
+ }) => t(1),
480
+ background: ({
481
+ palette: t,
482
+ spacing: e
483
+ }) => `linear-gradient(to right, ${t.action.hover} calc(${e(1)} + 3em), ${t.background.default} calc(${e(1)} + 3em))`,
484
+ fontFamily: "monospace",
485
+ fontSize: "0.8125rem",
486
+ whiteSpace: "pre-wrap",
487
+ wordBreak: "break-word",
488
+ lineHeight: 1.6,
489
+ counterReset: "line"
490
+ },
491
+ fullViewLine: {
492
+ display: "block",
493
+ "&::before": {
494
+ counterIncrement: "line",
495
+ content: "counter(line)",
496
+ display: "inline-block",
497
+ width: "2em",
498
+ marginRight: "2em",
499
+ textAlign: "right",
500
+ color: ({
501
+ palette: t
502
+ }) => t.text.secondary,
503
+ userSelect: "none"
504
+ }
505
+ },
506
+ groupHeader: {
507
+ textAlign: "left",
335
508
  display: "flex",
336
509
  alignItems: "center",
510
+ borderRadius: 0,
337
511
  gap: ({
338
512
  spacing: t
339
- }) => t(1)
513
+ }) => t(0.5)
340
514
  },
341
- toolStatusIcon: {
515
+ errorBadge: {
516
+ color: ({
517
+ palette: t
518
+ }) => t.error.main,
519
+ fontWeight: 600,
342
520
  display: "flex",
343
- alignItems: "center"
521
+ alignItems: "center",
522
+ gap: ({
523
+ spacing: t
524
+ }) => t(0.25)
525
+ },
526
+ // --- Syntax highlighting token styles ---
527
+ syntaxToken_key: {
528
+ color: "#881280"
529
+ },
530
+ syntaxToken_string: {
531
+ color: "#c41a16"
532
+ },
533
+ syntaxToken_number: {
534
+ color: "#1c00cf"
535
+ },
536
+ syntaxToken_boolean: {
537
+ color: "#1c00cf"
538
+ },
539
+ syntaxToken_null: {
540
+ color: "#808080"
541
+ },
542
+ syntaxToken_punctuation: {
543
+ color: ({
544
+ palette: t
545
+ }) => t.text.primary
546
+ },
547
+ groupListItem: {
548
+ borderBottom: "1px solid",
549
+ borderColor: "divider",
550
+ "&:first-of-type .MuiButton-root": {
551
+ borderRadius: ({
552
+ spacing: t
553
+ }) => t(1, 1, 0, 0)
554
+ },
555
+ "&:last-of-type:not([aria-expanded=true]) .MuiButton-root": {
556
+ borderRadius: ({
557
+ spacing: t
558
+ }) => t(0, 0, 1, 1)
559
+ },
560
+ "&:last-of-type": {
561
+ borderBottomWidth: 0
562
+ }
344
563
  }
345
564
  };
346
- function we(t) {
347
- const e = T(6), {
348
- children: n,
349
- duration: o,
350
- sx: i
351
- } = t, r = n === void 0 ? "Thinking..." : n, a = `${(o === void 0 ? 2e3 : o) / 1e3}s`;
352
- let s;
353
- e[0] !== a || e[1] !== i ? (s = {
354
- ...z.thinking,
355
- animationDuration: a,
356
- ...i
357
- }, e[0] = a, e[1] = i, e[2] = s) : s = e[2];
358
- let l;
359
- return e[3] !== r || e[4] !== s ? (l = /* @__PURE__ */ d($, { variant: "body2", sx: s, children: r }), e[3] = r, e[4] = s, e[5] = l) : l = e[5], l;
565
+ function rt(t) {
566
+ const e = z(6), {
567
+ children: o,
568
+ duration: r,
569
+ sx: l
570
+ } = t, n = o === void 0 ? "Thinking..." : o, s = `${(r === void 0 ? 2e3 : r) / 1e3}s`;
571
+ let i;
572
+ e[0] !== s || e[1] !== l ? (i = {
573
+ ...w.thinking,
574
+ animationDuration: s,
575
+ ...l
576
+ }, e[0] = s, e[1] = l, e[2] = i) : i = e[2];
577
+ let c;
578
+ return e[3] !== n || e[4] !== i ? (c = /* @__PURE__ */ a(_, { variant: "body2", sx: i, children: n }), e[3] = n, e[4] = i, e[5] = c) : c = e[5], c;
360
579
  }
361
- function Re(t) {
362
- const e = T(16), {
363
- size: n,
364
- labels: o,
365
- sx: i
366
- } = t, r = n === void 0 ? 24 : n;
367
- let m;
368
- e[0] !== o ? (m = o === void 0 ? {} : o, e[0] = o, e[1] = m) : m = e[1];
369
- const s = m.loading ?? "Loading";
370
- let l;
371
- e[2] !== r || e[3] !== i ? (l = {
372
- ...z.loader,
373
- width: r,
374
- height: r,
375
- ...i
376
- }, e[2] = r, e[3] = i, e[4] = l) : l = e[4];
377
- const c = r * 0.75, p = r * 0.75;
378
- let f;
379
- e[5] !== c || e[6] !== p ? (f = /* @__PURE__ */ d(x, { component: "span", sx: {
380
- ...z.loaderOuterCircle,
381
- width: c,
382
- height: p
383
- } }), e[5] = c, e[6] = p, e[7] = f) : f = e[7];
384
- const u = r * 0.32, g = r * 0.32;
385
- let b;
386
- e[8] !== g || e[9] !== u ? (b = /* @__PURE__ */ d(x, { component: "span", sx: {
387
- ...z.loaderInnerCircle,
388
- width: u,
389
- height: g
390
- } }), e[8] = g, e[9] = u, e[10] = b) : b = e[10];
580
+ function Vt(t) {
581
+ const e = z(16), {
582
+ size: o,
583
+ labels: r,
584
+ sx: l
585
+ } = t, n = o === void 0 ? 24 : o;
586
+ let u;
587
+ e[0] !== r ? (u = r === void 0 ? {} : r, e[0] = r, e[1] = u) : u = e[1];
588
+ const i = u.loading ?? "Loading";
589
+ let c;
590
+ e[2] !== n || e[3] !== l ? (c = {
591
+ ...w.loader,
592
+ width: n,
593
+ height: n,
594
+ ...l
595
+ }, e[2] = n, e[3] = l, e[4] = c) : c = e[4];
596
+ const d = n * 0.75, x = n * 0.75;
391
597
  let h;
392
- return e[11] !== b || e[12] !== s || e[13] !== l || e[14] !== f ? (h = /* @__PURE__ */ y(x, { role: "status", "aria-busy": !0, "aria-label": s, sx: l, children: [
393
- f,
394
- b
395
- ] }), e[11] = b, e[12] = s, e[13] = l, e[14] = f, e[15] = h) : h = e[15], h;
598
+ e[5] !== d || e[6] !== x ? (h = /* @__PURE__ */ a(y, { component: "span", sx: {
599
+ ...w.loaderOuterCircle,
600
+ width: d,
601
+ height: x
602
+ } }), e[5] = d, e[6] = x, e[7] = h) : h = e[7];
603
+ const f = n * 0.32, m = n * 0.32;
604
+ let g;
605
+ e[8] !== m || e[9] !== f ? (g = /* @__PURE__ */ a(y, { component: "span", sx: {
606
+ ...w.loaderInnerCircle,
607
+ width: f,
608
+ height: m
609
+ } }), e[8] = m, e[9] = f, e[10] = g) : g = e[10];
610
+ let p;
611
+ return e[11] !== g || e[12] !== i || e[13] !== c || e[14] !== h ? (p = /* @__PURE__ */ T(y, { role: "status", "aria-busy": !0, "aria-label": i, sx: c, children: [
612
+ h,
613
+ g
614
+ ] }), e[11] = g, e[12] = i, e[13] = c, e[14] = h, e[15] = p) : p = e[15], p;
396
615
  }
397
- const Se = P`
616
+ const lt = N`
398
617
  0% { border-top-color: transparent; border-bottom-color: var(--chat-border-color) }
399
618
  0.1% { border-top-color: var(--chat-border-color); border-bottom-color: var(--chat-border-color) }
400
619
  99.9% { border-top-color: var(--chat-border-color); border-bottom-color: var(--chat-border-color) }
401
620
  100% { border-top-color: var(--chat-border-color); border-bottom-color: transparent }
402
- `, Ie = P`
621
+ `, it = N`
403
622
  0% { opacity: 1; pointer-events: auto }
404
623
  95% { opacity: 1; pointer-events: auto }
405
624
  100% { opacity: 0; pointer-events: none }
406
- `, v = {
625
+ `, W = {
407
626
  header: {
408
627
  display: "flex",
409
628
  alignItems: "center",
@@ -437,11 +656,11 @@ const Se = P`
437
656
  footerCorner: {
438
657
  position: "absolute",
439
658
  bottom: "38px",
440
- right: `max(16px, calc(50% - ${j / 2}px + 6px))`,
659
+ right: `max(16px, calc(50% - ${q / 2}px + 6px))`,
441
660
  margin: "0 auto"
442
661
  },
443
662
  footer: {
444
- maxWidth: j,
663
+ maxWidth: q,
445
664
  margin: "0 auto"
446
665
  },
447
666
  footerCaption: {
@@ -452,7 +671,7 @@ const Se = P`
452
671
  flex: 1,
453
672
  position: "relative",
454
673
  mx: "auto",
455
- maxWidth: j,
674
+ maxWidth: q,
456
675
  width: "100%",
457
676
  maxHeight: "100%",
458
677
  pt: 1,
@@ -466,7 +685,7 @@ const Se = P`
466
685
  borderTop: "1px solid transparent",
467
686
  borderBottom: "1px solid transparent",
468
687
  "@supports (animation-timeline: scroll())": {
469
- animation: `${Se} linear both`,
688
+ animation: `${lt} linear both`,
470
689
  animationTimeline: "scroll(self)"
471
690
  }
472
691
  },
@@ -484,7 +703,7 @@ const Se = P`
484
703
  opacity: 0,
485
704
  pointerEvents: "none",
486
705
  "@supports (animation-timeline: scroll())": {
487
- animation: `${Ie} linear both`,
706
+ animation: `${it} linear both`,
488
707
  animationTimeline: "scroll(nearest)"
489
708
  },
490
709
  "@supports not (animation-timeline: scroll())": {
@@ -500,7 +719,7 @@ const Se = P`
500
719
  spacing: t
501
720
  }) => t(3),
502
721
  textAlign: "center",
503
- maxWidth: j,
722
+ maxWidth: q,
504
723
  margin: "0 auto"
505
724
  },
506
725
  starterItems: {
@@ -514,119 +733,119 @@ const Se = P`
514
733
  gridTemplateColumns: "repeat(2, 1fr)"
515
734
  }
516
735
  };
517
- function je(t) {
518
- const e = T(12), {
519
- children: n,
520
- labels: o,
521
- sx: i
736
+ function Ut(t) {
737
+ const e = z(12), {
738
+ children: o,
739
+ labels: r,
740
+ sx: l
522
741
  } = t;
523
- let r;
524
- e[0] !== o ? (r = o === void 0 ? {} : o, e[0] = o, e[1] = r) : r = e[1];
525
- const m = r, a = ue(null);
526
- let s;
527
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = () => {
528
- a.current?.scrollTo({
529
- top: a.current.scrollHeight,
742
+ let n;
743
+ e[0] !== r ? (n = r === void 0 ? {} : r, e[0] = r, e[1] = n) : n = e[1];
744
+ const u = n, s = be(null);
745
+ let i;
746
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = () => {
747
+ s.current?.scrollTo({
748
+ top: s.current.scrollHeight,
530
749
  behavior: "smooth"
531
750
  });
532
- }, e[2] = s) : s = e[2];
533
- const l = s;
534
- let c;
535
- e[3] !== i ? (c = {
536
- ...v.content,
537
- ...i
538
- }, e[3] = i, e[4] = c) : c = e[4];
539
- const p = m.jumpToLatest ?? "Jump to latest";
751
+ }, e[2] = i) : i = e[2];
752
+ const c = i;
753
+ let d;
754
+ e[3] !== l ? (d = {
755
+ ...W.content,
756
+ ...l
757
+ }, e[3] = l, e[4] = d) : d = e[4];
758
+ const x = u.jumpToLatest ?? "Jump to latest";
759
+ let h;
760
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ a(Fe, {}), e[5] = h) : h = e[5];
540
761
  let f;
541
- e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ d(le, {}), e[5] = f) : f = e[5];
542
- let u;
543
- e[6] !== p ? (u = /* @__PURE__ */ d(x, { sx: v.jumpToLatestWrapper, children: /* @__PURE__ */ d(J, { size: "small", onClick: l, "aria-label": p, sx: v.jumpToLatest, children: f }) }), e[6] = p, e[7] = u) : u = e[7];
544
- let g;
545
- return e[8] !== n || e[9] !== c || e[10] !== u ? (g = /* @__PURE__ */ y(x, { ref: a, sx: c, children: [
546
- n,
547
- u
548
- ] }), e[8] = n, e[9] = c, e[10] = u, e[11] = g) : g = e[11], g;
549
- }
550
- function He(t) {
551
- const e = T(14), {
552
- leftSlot: n,
553
- title: o,
554
- rightSlot: i,
555
- onClose: r,
556
- sx: m
762
+ e[6] !== x ? (f = /* @__PURE__ */ a(y, { sx: W.jumpToLatestWrapper, children: /* @__PURE__ */ a(_e, { size: "small", onClick: c, "aria-label": x, sx: W.jumpToLatest, children: h }) }), e[6] = x, e[7] = f) : f = e[7];
763
+ let m;
764
+ return e[8] !== o || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ T(y, { ref: s, sx: d, children: [
765
+ o,
766
+ f
767
+ ] }), e[8] = o, e[9] = d, e[10] = f, e[11] = m) : m = e[11], m;
768
+ }
769
+ function jt(t) {
770
+ const e = z(14), {
771
+ leftSlot: o,
772
+ title: r,
773
+ rightSlot: l,
774
+ onClose: n,
775
+ sx: u
557
776
  } = t;
558
- let a;
559
- e[0] !== m ? (a = {
560
- ...v.header,
561
- ...m
562
- }, e[0] = m, e[1] = a) : a = e[1];
563
777
  let s;
564
- e[2] !== o ? (s = /* @__PURE__ */ d($, { variant: "subtitle2", sx: v.headerTitle, children: o }), e[2] = o, e[3] = s) : s = e[3];
565
- let l;
566
- e[4] !== r ? (l = r && /* @__PURE__ */ d(O, { size: "medium", onClick: r, "aria-label": "Close", children: /* @__PURE__ */ d(re, {}) }), e[4] = r, e[5] = l) : l = e[5];
778
+ e[0] !== u ? (s = {
779
+ ...W.header,
780
+ ...u
781
+ }, e[0] = u, e[1] = s) : s = e[1];
782
+ let i;
783
+ e[2] !== r ? (i = /* @__PURE__ */ a(_, { variant: "subtitle2", sx: W.headerTitle, children: r }), e[2] = r, e[3] = i) : i = e[3];
567
784
  let c;
568
- e[6] !== i || e[7] !== l ? (c = /* @__PURE__ */ y(x, { sx: v.headerActions, children: [
569
- i,
570
- l
571
- ] }), e[6] = i, e[7] = l, e[8] = c) : c = e[8];
572
- let p;
573
- return e[9] !== n || e[10] !== a || e[11] !== s || e[12] !== c ? (p = /* @__PURE__ */ y(x, { sx: a, children: [
574
- n,
575
- s,
785
+ e[4] !== n ? (c = n && /* @__PURE__ */ a(H, { size: "medium", onClick: n, "aria-label": "Close", children: /* @__PURE__ */ a(ge, {}) }), e[4] = n, e[5] = c) : c = e[5];
786
+ let d;
787
+ e[6] !== l || e[7] !== c ? (d = /* @__PURE__ */ T(y, { sx: W.headerActions, children: [
788
+ l,
576
789
  c
577
- ] }), e[9] = n, e[10] = a, e[11] = s, e[12] = c, e[13] = p) : p = e[13], p;
578
- }
579
- const ke = "Responses are AI generated. Please verify key information.";
580
- function Ue(t) {
581
- const e = T(35), {
582
- value: n,
583
- onChange: o,
584
- onSend: i,
585
- onStop: r,
586
- isGenerating: m,
587
- disabled: a,
588
- placeholder: s,
589
- labels: l,
590
- caption: c,
591
- sx: p
592
- } = t, f = m === void 0 ? !1 : m, u = a === void 0 ? !1 : a, g = s === void 0 ? "Type a message..." : s;
593
- let b;
594
- e[0] !== l ? (b = l === void 0 ? {} : l, e[0] = l, e[1] = b) : b = e[1];
595
- const h = b, C = c === void 0 ? ke : c;
596
- let w;
597
- e[2] !== u || e[3] !== f || e[4] !== n ? (w = n.trim() && !u && !f, e[2] = u, e[3] = f, e[4] = n, e[5] = w) : w = e[5];
598
- const S = w;
599
- let L;
600
- e[6] !== S || e[7] !== i ? (L = (F) => {
601
- F.key === "Enter" && !F.shiftKey && (F.preventDefault(), S && i());
602
- }, e[6] = S, e[7] = i, e[8] = L) : L = e[8];
603
- const M = L;
604
- let I;
605
- e[9] !== p ? (I = {
606
- ...v.footerWrapper,
607
- ...p
608
- }, e[9] = p, e[10] = I) : I = e[10];
790
+ ] }), e[6] = l, e[7] = c, e[8] = d) : d = e[8];
791
+ let x;
792
+ return e[9] !== o || e[10] !== s || e[11] !== i || e[12] !== d ? (x = /* @__PURE__ */ T(y, { sx: s, children: [
793
+ o,
794
+ i,
795
+ d
796
+ ] }), e[9] = o, e[10] = s, e[11] = i, e[12] = d, e[13] = x) : x = e[13], x;
797
+ }
798
+ const st = "Responses are AI generated. Please verify key information.";
799
+ function Nt(t) {
800
+ const e = z(35), {
801
+ value: o,
802
+ onChange: r,
803
+ onSend: l,
804
+ onStop: n,
805
+ isGenerating: u,
806
+ disabled: s,
807
+ placeholder: i,
808
+ labels: c,
809
+ caption: d,
810
+ sx: x
811
+ } = t, h = u === void 0 ? !1 : u, f = s === void 0 ? !1 : s, m = i === void 0 ? "Type a message..." : i;
812
+ let g;
813
+ e[0] !== c ? (g = c === void 0 ? {} : c, e[0] = c, e[1] = g) : g = e[1];
814
+ const p = g, b = d === void 0 ? st : d;
815
+ let v;
816
+ e[2] !== f || e[3] !== h || e[4] !== o ? (v = o.trim() && !f && !h, e[2] = f, e[3] = h, e[4] = o, e[5] = v) : v = e[5];
817
+ const C = v;
609
818
  let k;
610
- e[11] !== o ? (k = (F) => o(F.target.value), e[11] = o, e[12] = k) : k = e[12];
611
- const D = u || f;
612
- let _;
613
- e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = {
819
+ e[6] !== C || e[7] !== l ? (k = (M) => {
820
+ M.key === "Enter" && !M.shiftKey && (M.preventDefault(), C && l());
821
+ }, e[6] = C, e[7] = l, e[8] = k) : k = e[8];
822
+ const S = k;
823
+ let A;
824
+ e[9] !== x ? (A = {
825
+ ...W.footerWrapper,
826
+ ...x
827
+ }, e[9] = x, e[10] = A) : A = e[10];
828
+ let I;
829
+ e[11] !== r ? (I = (M) => r(M.target.value), e[11] = r, e[12] = I) : I = e[12];
830
+ const R = f || h;
831
+ let $;
832
+ e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = {
614
833
  minHeight: 0
615
- }, e[13] = _) : _ = e[13];
616
- let W;
617
- e[14] !== M || e[15] !== g || e[16] !== k || e[17] !== D || e[18] !== n ? (W = /* @__PURE__ */ d(V, { multiline: !0, value: n, onChange: k, onKeyDown: M, placeholder: g, disabled: D, sx: v.footer, style: _, fullWidth: !0, size: "small" }), e[14] = M, e[15] = g, e[16] = k, e[17] = D, e[18] = n, e[19] = W) : W = e[19];
618
- let B;
619
- e[20] !== S || e[21] !== u || e[22] !== f || e[23] !== h.send || e[24] !== h.stop || e[25] !== i || e[26] !== r ? (B = /* @__PURE__ */ d(x, { sx: v.footerCorner, children: f && r ? /* @__PURE__ */ d(O, { size: "small", onClick: r, disabled: u, "aria-label": h.stop ?? "Stop", children: /* @__PURE__ */ d(se, {}) }) : /* @__PURE__ */ d(O, { size: "small", variant: "contained", onClick: i, disabled: !S, "aria-label": h.send ?? "Send", children: /* @__PURE__ */ d(ie, {}) }) }), e[20] = S, e[21] = u, e[22] = f, e[23] = h.send, e[24] = h.stop, e[25] = i, e[26] = r, e[27] = B) : B = e[27];
834
+ }, e[13] = $) : $ = e[13];
620
835
  let E;
621
- e[28] !== C ? (E = C ? /* @__PURE__ */ d(q, { sx: v.footerCaption, children: C }) : null, e[28] = C, e[29] = E) : E = e[29];
622
- let R;
623
- return e[30] !== W || e[31] !== B || e[32] !== E || e[33] !== I ? (R = /* @__PURE__ */ y(Q, { fullWidth: !0, sx: I, children: [
624
- W,
836
+ e[14] !== S || e[15] !== m || e[16] !== I || e[17] !== R || e[18] !== o ? (E = /* @__PURE__ */ a($e, { multiline: !0, value: o, onChange: I, onKeyDown: S, placeholder: m, disabled: R, sx: W.footer, style: $, fullWidth: !0, size: "small" }), e[14] = S, e[15] = m, e[16] = I, e[17] = R, e[18] = o, e[19] = E) : E = e[19];
837
+ let B;
838
+ e[20] !== C || e[21] !== f || e[22] !== h || e[23] !== p.send || e[24] !== p.stop || e[25] !== l || e[26] !== n ? (B = /* @__PURE__ */ a(y, { sx: W.footerCorner, children: h && n ? /* @__PURE__ */ a(H, { size: "small", onClick: n, disabled: f, "aria-label": p.stop ?? "Stop", children: /* @__PURE__ */ a(We, {}) }) : /* @__PURE__ */ a(H, { size: "small", variant: "contained", onClick: l, disabled: !C, "aria-label": p.send ?? "Send", children: /* @__PURE__ */ a(Me, {}) }) }), e[20] = C, e[21] = f, e[22] = h, e[23] = p.send, e[24] = p.stop, e[25] = l, e[26] = n, e[27] = B) : B = e[27];
839
+ let L;
840
+ e[28] !== b ? (L = b ? /* @__PURE__ */ a(Ae, { sx: W.footerCaption, children: b }) : null, e[28] = b, e[29] = L) : L = e[29];
841
+ let D;
842
+ return e[30] !== E || e[31] !== B || e[32] !== L || e[33] !== A ? (D = /* @__PURE__ */ T(Ie, { fullWidth: !0, sx: A, children: [
843
+ E,
625
844
  B,
626
- E
627
- ] }), e[30] = W, e[31] = B, e[32] = E, e[33] = I, e[34] = R) : R = e[34], R;
845
+ L
846
+ ] }), e[30] = E, e[31] = B, e[32] = L, e[33] = A, e[34] = D) : D = e[34], D;
628
847
  }
629
- const U = [
848
+ const de = [
630
849
  "#C9DB7440",
631
850
  // pastel green
632
851
  "#FE88B140",
@@ -636,166 +855,627 @@ const U = [
636
855
  "#F6CF7140"
637
856
  // pastel yellow
638
857
  ];
639
- function Ne(t) {
640
- const e = T(40), {
641
- icon: n,
642
- title: o,
643
- description: i,
644
- items: r,
645
- size: m,
646
- onSelect: a,
647
- sx: s
648
- } = t, l = m === void 0 ? "small" : m;
649
- let c, p, f, u, g, b, h, C;
650
- if (e[0] !== i || e[1] !== n || e[2] !== r || e[3] !== a || e[4] !== l || e[5] !== s || e[6] !== o) {
651
- const L = r.map(Ae);
652
- p = x;
653
- const M = l === "small" ? 1 : 2;
654
- e[15] !== s || e[16] !== M ? (g = {
655
- ...v.starter,
656
- gap: M,
657
- ...s
658
- }, e[15] = s, e[16] = M, e[17] = g) : g = e[17], b = n, e[18] !== l || e[19] !== o ? (h = o && /* @__PURE__ */ d($, { variant: l === "small" ? "h6" : "h5", children: o }), e[18] = l, e[19] = o, e[20] = h) : h = e[20], e[21] !== i || e[22] !== l ? (C = i && /* @__PURE__ */ d($, { variant: l === "small" ? "body2" : "body1", color: "text.secondary", children: i }), e[21] = i, e[22] = l, e[23] = C) : C = e[23], c = x;
659
- const I = l === "small" ? 1 : 2, k = r.length > 2 ? v.starterItemsTwoCol : void 0;
660
- e[24] !== k || e[25] !== I ? (f = {
661
- ...v.starterItems,
662
- gap: I,
663
- ...k
664
- }, e[24] = k, e[25] = I, e[26] = f) : f = e[26];
665
- let D;
666
- e[27] !== a ? (D = (_) => /* @__PURE__ */ d(Ce, { label: _.label, onClick: () => a?.(_.label), color: _.color }, _.label), e[27] = a, e[28] = D) : D = e[28], u = L.map(D), e[0] = i, e[1] = n, e[2] = r, e[3] = a, e[4] = l, e[5] = s, e[6] = o, e[7] = c, e[8] = p, e[9] = f, e[10] = u, e[11] = g, e[12] = b, e[13] = h, e[14] = C;
858
+ function Gt(t) {
859
+ const e = z(40), {
860
+ icon: o,
861
+ title: r,
862
+ description: l,
863
+ items: n,
864
+ size: u,
865
+ onSelect: s,
866
+ sx: i
867
+ } = t, c = u === void 0 ? "small" : u;
868
+ let d, x, h, f, m, g, p, b;
869
+ if (e[0] !== l || e[1] !== o || e[2] !== n || e[3] !== s || e[4] !== c || e[5] !== i || e[6] !== r) {
870
+ const k = n.map(at);
871
+ x = y;
872
+ const S = c === "small" ? 1 : 2;
873
+ e[15] !== i || e[16] !== S ? (m = {
874
+ ...W.starter,
875
+ gap: S,
876
+ ...i
877
+ }, e[15] = i, e[16] = S, e[17] = m) : m = e[17], g = o, e[18] !== c || e[19] !== r ? (p = r && /* @__PURE__ */ a(_, { variant: c === "small" ? "h6" : "h5", children: r }), e[18] = c, e[19] = r, e[20] = p) : p = e[20], e[21] !== l || e[22] !== c ? (b = l && /* @__PURE__ */ a(_, { variant: c === "small" ? "body2" : "body1", color: "text.secondary", children: l }), e[21] = l, e[22] = c, e[23] = b) : b = e[23], d = y;
878
+ const A = c === "small" ? 1 : 2, I = n.length > 2 ? W.starterItemsTwoCol : void 0;
879
+ e[24] !== I || e[25] !== A ? (h = {
880
+ ...W.starterItems,
881
+ gap: A,
882
+ ...I
883
+ }, e[24] = I, e[25] = A, e[26] = h) : h = e[26];
884
+ let R;
885
+ e[27] !== s ? (R = ($) => /* @__PURE__ */ a(et, { label: $.label, onClick: () => s?.($.label), color: $.color }, $.label), e[27] = s, e[28] = R) : R = e[28], f = k.map(R), e[0] = l, e[1] = o, e[2] = n, e[3] = s, e[4] = c, e[5] = i, e[6] = r, e[7] = d, e[8] = x, e[9] = h, e[10] = f, e[11] = m, e[12] = g, e[13] = p, e[14] = b;
667
886
  } else
668
- c = e[7], p = e[8], f = e[9], u = e[10], g = e[11], b = e[12], h = e[13], C = e[14];
669
- let w;
670
- e[29] !== c || e[30] !== f || e[31] !== u ? (w = /* @__PURE__ */ d(c, { sx: f, children: u }), e[29] = c, e[30] = f, e[31] = u, e[32] = w) : w = e[32];
671
- let S;
672
- return e[33] !== p || e[34] !== g || e[35] !== b || e[36] !== h || e[37] !== C || e[38] !== w ? (S = /* @__PURE__ */ y(p, { sx: g, children: [
887
+ d = e[7], x = e[8], h = e[9], f = e[10], m = e[11], g = e[12], p = e[13], b = e[14];
888
+ let v;
889
+ e[29] !== d || e[30] !== h || e[31] !== f ? (v = /* @__PURE__ */ a(d, { sx: h, children: f }), e[29] = d, e[30] = h, e[31] = f, e[32] = v) : v = e[32];
890
+ let C;
891
+ return e[33] !== x || e[34] !== m || e[35] !== g || e[36] !== p || e[37] !== b || e[38] !== v ? (C = /* @__PURE__ */ T(x, { sx: m, children: [
892
+ g,
893
+ p,
673
894
  b,
674
- h,
675
- C,
676
- w
677
- ] }), e[33] = p, e[34] = g, e[35] = b, e[36] = h, e[37] = C, e[38] = w, e[39] = S) : S = e[39], S;
895
+ v
896
+ ] }), e[33] = x, e[34] = m, e[35] = g, e[36] = p, e[37] = b, e[38] = v, e[39] = C) : C = e[39], C;
678
897
  }
679
- function Ae(t, e) {
898
+ function at(t, e) {
680
899
  return typeof t == "string" ? {
681
900
  label: t,
682
- color: U[e]
901
+ color: de[e]
683
902
  } : {
684
903
  label: t.label,
685
- color: t.color ?? U[e]
904
+ color: t.color ?? de[e]
686
905
  };
687
906
  }
688
- const Ge = H(x)(({
907
+ const Kt = se(y)(({
689
908
  theme: t
690
909
  }) => ({
691
910
  display: "flex",
692
911
  alignItems: "center",
693
912
  gap: t.spacing(0.5)
694
913
  }));
695
- function Ke(t) {
696
- const e = T(25), {
697
- rating: n,
698
- onRatingChange: o,
699
- labels: i
914
+ function Xt(t) {
915
+ const e = z(25), {
916
+ rating: o,
917
+ onRatingChange: r,
918
+ labels: l
700
919
  } = t;
701
- let r;
702
- e[0] !== i ? (r = i === void 0 ? {} : i, e[0] = i, e[1] = r) : r = e[1];
703
- const m = r;
704
- let a;
705
- e[2] !== o || e[3] !== n ? (a = () => o?.(n === "up" ? null : "up"), e[2] = o, e[3] = n, e[4] = a) : a = e[4];
706
- const s = m.thumbUp ?? "Thumbs up", l = n === "up" ? "primary" : void 0;
707
- let c;
708
- e[5] !== n ? (c = n === "up" ? /* @__PURE__ */ d(ae, { fontSize: "small" }) : /* @__PURE__ */ d(ce, { fontSize: "small" }), e[5] = n, e[6] = c) : c = e[6];
920
+ let n;
921
+ e[0] !== l ? (n = l === void 0 ? {} : l, e[0] = l, e[1] = n) : n = e[1];
922
+ const u = n;
923
+ let s;
924
+ e[2] !== r || e[3] !== o ? (s = () => r?.(o === "up" ? null : "up"), e[2] = r, e[3] = o, e[4] = s) : s = e[4];
925
+ const i = u.thumbUp ?? "Thumbs up", c = o === "up" ? "primary" : void 0;
926
+ let d;
927
+ e[5] !== o ? (d = o === "up" ? /* @__PURE__ */ a(Oe, { fontSize: "small" }) : /* @__PURE__ */ a(He, { fontSize: "small" }), e[5] = o, e[6] = d) : d = e[6];
928
+ let x;
929
+ e[7] !== s || e[8] !== i || e[9] !== c || e[10] !== d ? (x = /* @__PURE__ */ a(H, { size: "small", onClick: s, "aria-label": i, color: c, children: d }), e[7] = s, e[8] = i, e[9] = c, e[10] = d, e[11] = x) : x = e[11];
930
+ let h;
931
+ e[12] !== r || e[13] !== o ? (h = () => r?.(o === "down" ? null : "down"), e[12] = r, e[13] = o, e[14] = h) : h = e[14];
932
+ const f = u.thumbDown ?? "Thumbs down", m = o === "down" ? "primary" : void 0;
933
+ let g;
934
+ e[15] !== o ? (g = o === "down" ? /* @__PURE__ */ a(Pe, { fontSize: "small" }) : /* @__PURE__ */ a(Ve, { fontSize: "small" }), e[15] = o, e[16] = g) : g = e[16];
709
935
  let p;
710
- e[7] !== a || e[8] !== s || e[9] !== l || e[10] !== c ? (p = /* @__PURE__ */ d(O, { size: "small", onClick: a, "aria-label": s, color: l, children: c }), e[7] = a, e[8] = s, e[9] = l, e[10] = c, e[11] = p) : p = e[11];
711
- let f;
712
- e[12] !== o || e[13] !== n ? (f = () => o?.(n === "down" ? null : "down"), e[12] = o, e[13] = n, e[14] = f) : f = e[14];
713
- const u = m.thumbDown ?? "Thumbs down", g = n === "down" ? "primary" : void 0;
936
+ e[17] !== m || e[18] !== g || e[19] !== h || e[20] !== f ? (p = /* @__PURE__ */ a(H, { size: "small", onClick: h, "aria-label": f, color: m, children: g }), e[17] = m, e[18] = g, e[19] = h, e[20] = f, e[21] = p) : p = e[21];
714
937
  let b;
715
- e[15] !== n ? (b = n === "down" ? /* @__PURE__ */ d(de, { fontSize: "small" }) : /* @__PURE__ */ d(me, { fontSize: "small" }), e[15] = n, e[16] = b) : b = e[16];
938
+ return e[22] !== p || e[23] !== x ? (b = /* @__PURE__ */ T(Te, { children: [
939
+ x,
940
+ p
941
+ ] }), e[22] = p, e[23] = x, e[24] = b) : b = e[24], b;
942
+ }
943
+ const ct = /^-?\d/;
944
+ function dt(t) {
945
+ const e = [];
946
+ let o = 0, r;
947
+ const l = /* @__PURE__ */ new Set(), n = /("(?:[^"\\]|\\.)*")\s*:/g;
948
+ let u;
949
+ for (; (u = n.exec(t)) !== null; )
950
+ l.add(u.index);
951
+ const s = (
952
+ // eslint-disable-next-line no-useless-escape
953
+ /"(?:[^"\\]|\\.)*"|\b(?:true|false)\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|[{}\[\]:,]/g
954
+ );
955
+ for (; (r = s.exec(t)) !== null; ) {
956
+ r.index > o && e.push(t.slice(o, r.index));
957
+ const i = r[0];
958
+ i.startsWith('"') ? l.has(r.index) ? e.push({
959
+ type: "key",
960
+ value: i
961
+ }) : e.push({
962
+ type: "string",
963
+ value: i
964
+ }) : ct.test(i) ? e.push({
965
+ type: "number",
966
+ value: i
967
+ }) : i === "true" || i === "false" ? e.push({
968
+ type: "boolean",
969
+ value: i
970
+ }) : i === "null" ? e.push({
971
+ type: "null",
972
+ value: i
973
+ }) : e.push({
974
+ type: "punctuation",
975
+ value: i
976
+ }), o = r.index + i.length;
977
+ }
978
+ return o < t.length && e.push(t.slice(o)), e;
979
+ }
980
+ function ut(t) {
981
+ const e = z(24), {
982
+ open: o,
983
+ onClose: r,
984
+ title: l,
985
+ content: n
986
+ } = t;
987
+ let u;
988
+ e[0] !== n ? (u = n.split(`
989
+ `).map(mt), e[0] = n, e[1] = u) : u = e[1];
990
+ const s = u;
991
+ let i;
992
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = {
993
+ sx: w.fullViewPaper
994
+ }, e[2] = i) : i = e[2];
995
+ let c;
996
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = {
997
+ display: "flex",
998
+ alignItems: "center",
999
+ gap: 0.5
1000
+ }, e[3] = c) : c = e[3];
1001
+ let d;
1002
+ e[4] !== n ? (d = /* @__PURE__ */ a(Ke, { copyText: n, "aria-label": "Copy content" }), e[4] = n, e[5] = d) : d = e[5];
1003
+ let x;
1004
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ a(ge, {}), e[6] = x) : x = e[6];
716
1005
  let h;
717
- e[17] !== g || e[18] !== b || e[19] !== f || e[20] !== u ? (h = /* @__PURE__ */ d(O, { size: "small", onClick: f, "aria-label": u, color: g, children: b }), e[17] = g, e[18] = b, e[19] = f, e[20] = u, e[21] = h) : h = e[21];
718
- let C;
719
- return e[22] !== h || e[23] !== p ? (C = /* @__PURE__ */ y(K, { children: [
720
- p,
1006
+ e[7] !== r ? (h = /* @__PURE__ */ a(H, { onClick: r, "aria-label": "close", children: x }), e[7] = r, e[8] = h) : h = e[8];
1007
+ let f;
1008
+ e[9] !== d || e[10] !== h ? (f = /* @__PURE__ */ T(y, { sx: c, children: [
1009
+ d,
721
1010
  h
722
- ] }), e[22] = h, e[23] = p, e[24] = C) : C = e[24], C;
1011
+ ] }), e[9] = d, e[10] = h, e[11] = f) : f = e[11];
1012
+ let m;
1013
+ e[12] !== f || e[13] !== l ? (m = /* @__PURE__ */ T(Re, { sx: w.fullViewTitle, children: [
1014
+ l,
1015
+ f
1016
+ ] }), e[12] = f, e[13] = l, e[14] = m) : m = e[14];
1017
+ let g;
1018
+ e[15] !== s ? (g = s.map(ft), e[15] = s, e[16] = g) : g = e[16];
1019
+ let p;
1020
+ e[17] !== g ? (p = /* @__PURE__ */ a(Ee, { sx: w.fullViewDialogContent, children: /* @__PURE__ */ a(y, { component: "pre", sx: w.fullViewPre, children: g }) }), e[17] = g, e[18] = p) : p = e[18];
1021
+ let b;
1022
+ return e[19] !== r || e[20] !== o || e[21] !== p || e[22] !== m ? (b = /* @__PURE__ */ T(Le, { open: o, onClose: r, sx: w.fullViewDialog, PaperProps: i, fullScreen: !0, children: [
1023
+ m,
1024
+ p
1025
+ ] }), e[19] = r, e[20] = o, e[21] = p, e[22] = m, e[23] = b) : b = e[23], b;
723
1026
  }
724
- function $e(t) {
725
- const e = T(4), {
726
- status: n
727
- } = t;
728
- switch (n) {
729
- case "loading": {
730
- let o;
731
- return e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ d(oe, { size: 16 }), e[0] = o) : o = e[0], o;
1027
+ function ft(t, e) {
1028
+ return /* @__PURE__ */ T(y, { component: "span", sx: w.fullViewLine, children: [
1029
+ t.map(pt),
1030
+ `
1031
+ `
1032
+ ] }, e);
1033
+ }
1034
+ function pt(t, e) {
1035
+ return typeof t == "string" ? t : /* @__PURE__ */ a(y, { component: "span", sx: w[`syntaxToken_${t.type}`], children: t.value }, e);
1036
+ }
1037
+ function mt(t) {
1038
+ return dt(t);
1039
+ }
1040
+ const ht = () => /* @__PURE__ */ a("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ a(
1041
+ "path",
1042
+ {
1043
+ fill: "currentColor",
1044
+ fillRule: "evenodd",
1045
+ d: "M12.01 11.83 15.18 15l1.41-1.41L12.01 9l-4.59 4.59L8.84 15z",
1046
+ clipRule: "evenodd"
1047
+ }
1048
+ ) }), gt = ae(ht(), "ArrowUp");
1049
+ function xt({ width: t, height: e, sx: o, ...r }, l) {
1050
+ return /* @__PURE__ */ a(
1051
+ gt,
1052
+ {
1053
+ ref: l,
1054
+ viewBox: "0 0 24 24",
1055
+ sx: {
1056
+ width: t,
1057
+ height: e || t,
1058
+ ...o
1059
+ },
1060
+ ...r
732
1061
  }
733
- case "thinking": {
734
- let o;
735
- return e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ d(we, { children: "..." }), e[1] = o) : o = e[1], o;
1062
+ );
1063
+ }
1064
+ const bt = ce(xt);
1065
+ bt.displayName = "ArrowUp";
1066
+ const yt = () => /* @__PURE__ */ a("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ a(
1067
+ "path",
1068
+ {
1069
+ fill: "currentColor",
1070
+ fillRule: "evenodd",
1071
+ d: "m6.121 19.293 2.877-2.877V19H11v-6l-6 .007v1.994l2.584.001-2.877 2.877zM13 11l6-.007V8.999h-2.585l2.878-2.878-1.414-1.414L15 7.585V5H13z",
1072
+ clipRule: "evenodd"
1073
+ }
1074
+ ) }), Ct = ae(yt(), "CloseDiagonallyRight");
1075
+ function vt({ width: t, height: e, sx: o, ...r }, l) {
1076
+ return /* @__PURE__ */ a(
1077
+ Ct,
1078
+ {
1079
+ ref: l,
1080
+ viewBox: "0 0 24 24",
1081
+ sx: {
1082
+ width: t,
1083
+ height: e || t,
1084
+ ...o
1085
+ },
1086
+ ...r
1087
+ }
1088
+ );
1089
+ }
1090
+ const wt = ce(vt);
1091
+ wt.displayName = "CloseDiagonallyRight";
1092
+ const Tt = () => /* @__PURE__ */ a("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ a(
1093
+ "path",
1094
+ {
1095
+ fill: "currentColor",
1096
+ fillRule: "evenodd",
1097
+ d: "m14.121 11.293 2.877-2.877V11H19V5l-6 .007v1.994l2.584.001-2.877 2.877zM5 19l6-.007v-1.994H8.415l2.878-2.878-1.414-1.414L7 15.585V13H5z",
1098
+ clipRule: "evenodd"
1099
+ }
1100
+ ) }), kt = ae(Tt(), "OpenDiagonallyRight");
1101
+ function St({ width: t, height: e, sx: o, ...r }, l) {
1102
+ return /* @__PURE__ */ a(
1103
+ kt,
1104
+ {
1105
+ ref: l,
1106
+ viewBox: "0 0 24 24",
1107
+ sx: {
1108
+ width: t,
1109
+ height: e || t,
1110
+ ...o
1111
+ },
1112
+ ...r
736
1113
  }
1114
+ );
1115
+ }
1116
+ const Ce = ce(St);
1117
+ Ce.displayName = "OpenDiagonallyRight";
1118
+ function ue(t) {
1119
+ const e = z(28), {
1120
+ content: o,
1121
+ title: r,
1122
+ isError: l,
1123
+ labels: n,
1124
+ sx: u
1125
+ } = t, s = r === void 0 ? "" : r, i = l === void 0 ? !1 : l;
1126
+ let c;
1127
+ e[0] !== n ? (c = n === void 0 ? {} : n, e[0] = n, e[1] = c) : c = e[1];
1128
+ const d = c, x = be(null), [h, f] = ie(!1), [m, g] = ie(!1);
1129
+ let p;
1130
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = () => {
1131
+ const D = x.current;
1132
+ D && f(D.scrollHeight > D.clientHeight);
1133
+ }, e[2] = p) : p = e[2];
1134
+ const b = p;
1135
+ let v;
1136
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = () => {
1137
+ b();
1138
+ const D = x.current;
1139
+ if (!D)
1140
+ return;
1141
+ const M = new ResizeObserver(b);
1142
+ return M.observe(D), () => M.disconnect();
1143
+ }, e[3] = v) : v = e[3];
1144
+ let C;
1145
+ e[4] !== o ? (C = [b, o], e[4] = o, e[5] = C) : C = e[5], Ge(v, C);
1146
+ const k = d.fullView ?? "Full view";
1147
+ let S;
1148
+ e[6] !== u ? (S = {
1149
+ ...w.codeArea,
1150
+ ...u
1151
+ }, e[6] = u, e[7] = S) : S = e[7];
1152
+ let A;
1153
+ e[8] !== i ? (A = i ? w.codeAreaPreError : {}, e[8] = i, e[9] = A) : A = e[9];
1154
+ let I;
1155
+ e[10] !== A ? (I = {
1156
+ ...w.codeAreaPre,
1157
+ maxHeight: Ye,
1158
+ ...A
1159
+ }, e[10] = A, e[11] = I) : I = e[11];
1160
+ let R;
1161
+ e[12] !== o || e[13] !== I ? (R = /* @__PURE__ */ a(y, { component: "pre", ref: x, sx: I, children: o }), e[12] = o, e[13] = I, e[14] = R) : R = e[14];
1162
+ let $;
1163
+ e[15] !== k || e[16] !== h ? ($ = h && /* @__PURE__ */ a(De, { title: k, children: /* @__PURE__ */ a(H, { size: "small", onClick: () => g(!0), sx: w.codeAreaFullViewButton, children: /* @__PURE__ */ a(Ce, {}) }) }), e[15] = k, e[16] = h, e[17] = $) : $ = e[17];
1164
+ let E;
1165
+ e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = () => g(!1), e[18] = E) : E = e[18];
1166
+ let B;
1167
+ e[19] !== o || e[20] !== m || e[21] !== s ? (B = /* @__PURE__ */ a(ut, { open: m, onClose: E, title: s, content: o }), e[19] = o, e[20] = m, e[21] = s, e[22] = B) : B = e[22];
1168
+ let L;
1169
+ return e[23] !== R || e[24] !== $ || e[25] !== B || e[26] !== S ? (L = /* @__PURE__ */ T(y, { sx: S, children: [
1170
+ R,
1171
+ $,
1172
+ B
1173
+ ] }), e[23] = R, e[24] = $, e[25] = B, e[26] = S, e[27] = L) : L = e[27], L;
1174
+ }
1175
+ function fe(t) {
1176
+ const e = t.replace(/_/g, " ");
1177
+ return e.charAt(0).toUpperCase() + e.slice(1);
1178
+ }
1179
+ function ve(t) {
1180
+ return t.status === "running" ? t.runningLabel ?? fe(t.name) : t.label ?? fe(t.name);
1181
+ }
1182
+ function _t(t) {
1183
+ const e = z(9), {
1184
+ status: o,
1185
+ labels: r
1186
+ } = t;
1187
+ switch (o) {
737
1188
  case "complete": {
738
- let o;
739
- return e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ d(fe, { fontSize: "small", color: "success" }), e[2] = o) : o = e[2], o;
1189
+ let l;
1190
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = {
1191
+ display: "flex",
1192
+ alignItems: "center",
1193
+ gap: 0.5
1194
+ }, e[0] = l) : l = e[0];
1195
+ let n;
1196
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ a(je, { sx: {
1197
+ fontSize: 12
1198
+ }, color: "success" }), e[1] = n) : n = e[1];
1199
+ const u = r?.success ?? "Success";
1200
+ let s;
1201
+ return e[2] !== u ? (s = /* @__PURE__ */ T(y, { sx: l, children: [
1202
+ n,
1203
+ /* @__PURE__ */ a(_, { variant: "caption", children: u })
1204
+ ] }), e[2] = u, e[3] = s) : s = e[3], s;
740
1205
  }
741
1206
  case "error": {
742
- let o;
743
- return e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ d(N, { fontSize: "small", color: "error" }), e[3] = o) : o = e[3], o;
1207
+ let l;
1208
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = {
1209
+ display: "flex",
1210
+ alignItems: "center",
1211
+ gap: 0.5
1212
+ }, e[4] = l) : l = e[4];
1213
+ let n;
1214
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ a(Ue, { sx: {
1215
+ fontSize: 12
1216
+ }, color: "error" }), e[5] = n) : n = e[5];
1217
+ const u = r?.error ?? "Error";
1218
+ let s;
1219
+ return e[6] !== u ? (s = /* @__PURE__ */ T(y, { sx: l, children: [
1220
+ n,
1221
+ /* @__PURE__ */ a(_, { variant: "code3", children: u })
1222
+ ] }), e[6] = u, e[7] = s) : s = e[7], s;
1223
+ }
1224
+ case "running": {
1225
+ let l;
1226
+ return e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ a(ze, { size: 14 }), e[8] = l) : l = e[8], l;
744
1227
  }
1228
+ default:
1229
+ return null;
745
1230
  }
746
1231
  }
747
- function Ye(t) {
748
- const e = T(12), {
749
- tools: n,
750
- labels: o,
751
- sx: i
1232
+ function we(t) {
1233
+ const e = z(33), {
1234
+ tool: o,
1235
+ labels: r
752
1236
  } = t;
753
- let r;
754
- e[0] !== o ? (r = o === void 0 ? {} : o, e[0] = o, e[1] = r) : r = e[1];
755
- const m = r;
756
- let a;
757
- e[2] !== i ? (a = {
758
- ...z.tools,
759
- ...i
760
- }, e[2] = i, e[3] = a) : a = e[3];
761
- let s;
762
- e[4] !== m.title ? (s = m.title && /* @__PURE__ */ d($, { variant: "caption", color: "text.secondary", sx: {
763
- mb: 1
764
- }, children: m.title }), e[4] = m.title, e[5] = s) : s = e[5];
765
1237
  let l;
766
- e[6] !== n ? (l = n.map(_e), e[6] = n, e[7] = l) : l = e[7];
767
- let c;
768
- return e[8] !== a || e[9] !== s || e[10] !== l ? (c = /* @__PURE__ */ y(x, { sx: a, children: [
769
- s,
770
- l
771
- ] }), e[8] = a, e[9] = s, e[10] = l, e[11] = c) : c = e[11], c;
772
- }
773
- function _e(t) {
774
- return /* @__PURE__ */ y(Z, { disableGutters: !0, elevation: 0, children: [
775
- /* @__PURE__ */ d(ee, { expandIcon: /* @__PURE__ */ d(pe, {}), children: /* @__PURE__ */ y(x, { sx: z.toolHeader, children: [
776
- /* @__PURE__ */ d(x, { sx: z.toolStatusIcon, children: /* @__PURE__ */ d($e, { status: t.status }) }),
777
- /* @__PURE__ */ d($, { variant: "body2", children: t.name })
778
- ] }) }),
779
- t.content && /* @__PURE__ */ d(te, { children: t.content })
780
- ] }, t.id);
1238
+ e[0] !== r ? (l = r === void 0 ? {} : r, e[0] = r, e[1] = l) : l = e[1];
1239
+ const n = l, u = o.status === "error", s = n.toolExecuted ?? "Tool executed", i = n.reference ?? "Reference:", c = n.duration ?? "Duration:", d = n.status ?? "Status:", x = n.inputArguments ?? "Input arguments:", h = n.output ?? "Output:";
1240
+ let f;
1241
+ e[2] !== i || e[3] !== o.reference ? (f = o.reference && /* @__PURE__ */ T(y, { sx: w.traceField, children: [
1242
+ /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, color: "text.secondary", sx: w.traceFieldLabel, children: i }),
1243
+ /* @__PURE__ */ T(y, { sx: w.traceReference, children: [
1244
+ /* @__PURE__ */ a(Xe, { color: "success" }),
1245
+ /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, children: o.reference })
1246
+ ] })
1247
+ ] }), e[2] = i, e[3] = o.reference, e[4] = f) : f = e[4];
1248
+ let m;
1249
+ e[5] !== c || e[6] !== o.duration ? (m = o.duration != null && /* @__PURE__ */ T(y, { sx: w.traceField, children: [
1250
+ /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, color: "text.secondary", sx: w.traceFieldLabel, children: c }),
1251
+ /* @__PURE__ */ T(_, { variant: "code3", children: [
1252
+ o.duration,
1253
+ "s"
1254
+ ] })
1255
+ ] }), e[5] = c, e[6] = o.duration, e[7] = m) : m = e[7];
1256
+ let g;
1257
+ e[8] !== d ? (g = /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, color: "text.secondary", sx: w.traceFieldLabel, children: d }), e[8] = d, e[9] = g) : g = e[9];
1258
+ let p;
1259
+ e[10] !== n || e[11] !== o.status ? (p = /* @__PURE__ */ a(_t, { status: o.status, labels: n }), e[10] = n, e[11] = o.status, e[12] = p) : p = e[12];
1260
+ let b;
1261
+ e[13] !== g || e[14] !== p ? (b = /* @__PURE__ */ T(y, { sx: w.traceField, children: [
1262
+ g,
1263
+ p
1264
+ ] }), e[13] = g, e[14] = p, e[15] = b) : b = e[15];
1265
+ let v;
1266
+ e[16] !== x || e[17] !== u || e[18] !== o.inputArguments || e[19] !== o.output || e[20] !== s ? (v = o.inputArguments && /* @__PURE__ */ T(y, { children: [
1267
+ /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, color: "text.secondary", sx: w.traceField, children: x }),
1268
+ /* @__PURE__ */ a(ue, { sx: {
1269
+ mt: 0.5,
1270
+ mb: o.output ? 1.5 : 0
1271
+ }, content: o.inputArguments, title: `${s}: ${x}`, isError: u })
1272
+ ] }), e[16] = x, e[17] = u, e[18] = o.inputArguments, e[19] = o.output, e[20] = s, e[21] = v) : v = e[21];
1273
+ let C;
1274
+ e[22] !== u || e[23] !== h || e[24] !== o.output || e[25] !== s ? (C = o.output && /* @__PURE__ */ T(y, { children: [
1275
+ /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, color: "text.secondary", sx: w.traceField, children: h }),
1276
+ /* @__PURE__ */ a(ue, { sx: {
1277
+ mt: 0.5
1278
+ }, content: o.output, title: `${s}: ${h}`, isError: u })
1279
+ ] }), e[22] = u, e[23] = h, e[24] = o.output, e[25] = s, e[26] = C) : C = e[26];
1280
+ let k;
1281
+ return e[27] !== f || e[28] !== m || e[29] !== b || e[30] !== v || e[31] !== C ? (k = /* @__PURE__ */ T(y, { children: [
1282
+ f,
1283
+ m,
1284
+ b,
1285
+ v,
1286
+ C
1287
+ ] }), e[27] = f, e[28] = m, e[29] = b, e[30] = v, e[31] = C, e[32] = k) : k = e[32], k;
1288
+ }
1289
+ function pe(t) {
1290
+ const e = z(29), {
1291
+ tool: o,
1292
+ expanded: r,
1293
+ onExpandedChange: l,
1294
+ labels: n,
1295
+ sx: u
1296
+ } = t;
1297
+ let s;
1298
+ e[0] !== n ? (s = n === void 0 ? {} : n, e[0] = n, e[1] = s) : s = e[1];
1299
+ const i = s, c = o.status === "running", d = i.toolExecuted ?? "Tool executed";
1300
+ if (c) {
1301
+ let k;
1302
+ e[2] !== o ? (k = ve(o), e[2] = o, e[3] = k) : k = e[3];
1303
+ let S;
1304
+ return e[4] !== k ? (S = /* @__PURE__ */ a(rt, { children: k }), e[4] = k, e[5] = S) : S = e[5], S;
1305
+ }
1306
+ const x = `PsChat--tool-trace ${o.name}`;
1307
+ let h;
1308
+ e[6] !== r || e[7] !== l ? (h = () => l?.(!r), e[6] = r, e[7] = l, e[8] = h) : h = e[8];
1309
+ let f;
1310
+ e[9] !== d ? (f = /* @__PURE__ */ a(_, { variant: "caption", fontWeight: 600, color: "text.secondary", children: d }), e[9] = d, e[10] = f) : f = e[10];
1311
+ const m = r ? "rotate(90deg)" : "rotate(0deg)";
1312
+ let g;
1313
+ e[11] !== m ? (g = /* @__PURE__ */ a(xe, { sx: {
1314
+ ...w.traceChevron,
1315
+ transform: m
1316
+ } }), e[11] = m, e[12] = g) : g = e[12];
1317
+ let p;
1318
+ e[13] !== r || e[14] !== h || e[15] !== f || e[16] !== g ? (p = /* @__PURE__ */ T(re, { size: "small", variant: "text", onClick: h, "aria-expanded": r, sx: w.traceHeader, children: [
1319
+ f,
1320
+ g
1321
+ ] }), e[13] = r, e[14] = h, e[15] = f, e[16] = g, e[17] = p) : p = e[17];
1322
+ let b;
1323
+ e[18] !== i || e[19] !== o ? (b = /* @__PURE__ */ a(y, { sx: w.traceDetailsWrapper, children: /* @__PURE__ */ a(we, { tool: o, labels: i }) }), e[18] = i, e[19] = o, e[20] = b) : b = e[20];
1324
+ let v;
1325
+ e[21] !== r || e[22] !== b ? (v = /* @__PURE__ */ a(le, { in: r, unmountOnExit: !0, children: b }), e[21] = r, e[22] = b, e[23] = v) : v = e[23];
1326
+ let C;
1327
+ return e[24] !== u || e[25] !== v || e[26] !== x || e[27] !== p ? (C = /* @__PURE__ */ T(y, { width: "100%", sx: u, className: x, children: [
1328
+ p,
1329
+ v
1330
+ ] }), e[24] = u, e[25] = v, e[26] = x, e[27] = p, e[28] = C) : C = e[28], C;
1331
+ }
1332
+ function me(t, e) {
1333
+ const o = z(5), [r, l] = ie(t);
1334
+ if (e) {
1335
+ let n;
1336
+ return o[0] !== e || o[1] !== t ? (n = [t, e], o[0] = e, o[1] = t, o[2] = n) : n = o[2], n;
1337
+ } else {
1338
+ let n;
1339
+ return o[3] !== r ? (n = [r, l], o[3] = r, o[4] = n) : n = o[4], n;
1340
+ }
1341
+ }
1342
+ function Yt(t) {
1343
+ const e = z(62), {
1344
+ tools: o,
1345
+ expanded: r,
1346
+ onExpandedChange: l,
1347
+ expandedTools: n,
1348
+ onToolExpandedChange: u,
1349
+ labels: s,
1350
+ sx: i
1351
+ } = t, c = r === void 0 ? !1 : r;
1352
+ let d;
1353
+ e[0] !== n ? (d = n === void 0 ? {} : n, e[0] = n, e[1] = d) : d = e[1];
1354
+ const x = d;
1355
+ let h;
1356
+ e[2] !== s ? (h = s === void 0 ? {} : s, e[2] = s, e[3] = h) : h = e[3];
1357
+ const f = h, [m, g] = me(c, l), [p, b] = me(x, u);
1358
+ let v;
1359
+ e[4] !== o ? (v = o.filter(It), e[4] = o, e[5] = v) : v = e[5];
1360
+ const C = v.length;
1361
+ let k, S;
1362
+ if (e[6] !== m || e[7] !== p || e[8] !== f || e[9] !== C || e[10] !== g || e[11] !== b || e[12] !== i || e[13] !== o) {
1363
+ S = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
1364
+ e: {
1365
+ const A = o.filter(At), I = o.filter($t), R = f.toolsUsed ?? "tools used", $ = f.error ?? "Error";
1366
+ if (o.length === 1) {
1367
+ let F;
1368
+ e[16] !== m || e[17] !== f || e[18] !== g || e[19] !== i || e[20] !== o[0] ? (F = /* @__PURE__ */ a(pe, { tool: o[0], expanded: m, onExpandedChange: g, labels: f, sx: i }), e[16] = m, e[17] = f, e[18] = g, e[19] = i, e[20] = o[0], e[21] = F) : F = e[21], S = F;
1369
+ break e;
1370
+ }
1371
+ let E;
1372
+ e[22] !== m || e[23] !== g ? (E = () => g(!m), e[22] = m, e[23] = g, e[24] = E) : E = e[24];
1373
+ const B = C > 0 ? 0.5 : 0;
1374
+ let L;
1375
+ e[25] !== B ? (L = {
1376
+ ...w.traceHeader,
1377
+ pr: B
1378
+ }, e[25] = B, e[26] = L) : L = e[26];
1379
+ let D;
1380
+ e[27] !== o.length || e[28] !== R ? (D = /* @__PURE__ */ T(_, { variant: "caption", fontWeight: 600, color: "text.secondary", children: [
1381
+ o.length,
1382
+ " ",
1383
+ R
1384
+ ] }), e[27] = o.length, e[28] = R, e[29] = D) : D = e[29];
1385
+ const M = m ? "rotate(90deg)" : "rotate(0deg)";
1386
+ let P;
1387
+ e[30] !== M ? (P = /* @__PURE__ */ a(xe, { sx: {
1388
+ ...w.traceChevron,
1389
+ transform: M
1390
+ } }), e[30] = M, e[31] = P) : P = e[31];
1391
+ let V;
1392
+ e[32] !== C ? (V = C > 0 && /* @__PURE__ */ T(_, { variant: "code3", sx: w.errorBadge, children: [
1393
+ C,
1394
+ /* @__PURE__ */ a(he, { sx: {
1395
+ fontSize: 12
1396
+ }, color: "error" })
1397
+ ] }), e[32] = C, e[33] = V) : V = e[33];
1398
+ let G;
1399
+ e[34] !== m || e[35] !== L || e[36] !== D || e[37] !== P || e[38] !== V || e[39] !== E ? (G = /* @__PURE__ */ T(re, { size: "small", variant: "text", onClick: E, "aria-expanded": m, sx: L, children: [
1400
+ D,
1401
+ P,
1402
+ V
1403
+ ] }), e[34] = m, e[35] = L, e[36] = D, e[37] = P, e[38] = V, e[39] = E, e[40] = G) : G = e[40];
1404
+ const Q = le, Z = m, ee = !0, te = y, oe = "ul";
1405
+ let U;
1406
+ e[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (U = {
1407
+ ...w.traceDetailsWrapper,
1408
+ p: 0,
1409
+ listStyle: "none"
1410
+ }, e[41] = U) : U = e[41];
1411
+ let K;
1412
+ e[42] !== $ || e[43] !== m || e[44] !== p || e[45] !== f || e[46] !== b ? (K = (F) => {
1413
+ const J = p[F.id] ?? !1;
1414
+ return /* @__PURE__ */ T(y, { component: "li", sx: w.groupListItem, "aria-expanded": J, children: [
1415
+ /* @__PURE__ */ T(re, { variant: "text", color: "inherit", fullWidth: !0, onClick: () => b({
1416
+ ...p,
1417
+ [F.id]: !J
1418
+ }), "aria-expanded": J, sx: w.groupHeader, children: [
1419
+ /* @__PURE__ */ a(_, { flexGrow: 1, flexShrink: 0, variant: "caption", color: "text.secondary", children: ve(F) }),
1420
+ F.status === "error" && /* @__PURE__ */ a(_, { variant: "code3", color: "error.main", children: $ }),
1421
+ /* @__PURE__ */ a(Ne, { sx: {
1422
+ ...w.traceChevron,
1423
+ transform: m ? "rotate(90deg)" : "rotate(0deg)"
1424
+ } })
1425
+ ] }),
1426
+ /* @__PURE__ */ a(le, { in: J, unmountOnExit: !0, children: /* @__PURE__ */ a(y, { px: 1.5, py: 1, children: /* @__PURE__ */ a(we, { tool: F, labels: f }) }) })
1427
+ ] }, F.id);
1428
+ }, e[42] = $, e[43] = m, e[44] = p, e[45] = f, e[46] = b, e[47] = K) : K = e[47];
1429
+ const ne = I.map(K);
1430
+ let j;
1431
+ e[48] !== te || e[49] !== oe || e[50] !== U || e[51] !== ne ? (j = /* @__PURE__ */ a(te, { component: oe, sx: U, children: ne }), e[48] = te, e[49] = oe, e[50] = U, e[51] = ne, e[52] = j) : j = e[52];
1432
+ let X;
1433
+ e[53] !== Q || e[54] !== Z || e[55] !== ee || e[56] !== j ? (X = /* @__PURE__ */ a(Q, { in: Z, unmountOnExit: ee, children: j }), e[53] = Q, e[54] = Z, e[55] = ee, e[56] = j, e[57] = X) : X = e[57];
1434
+ let Y;
1435
+ e[58] !== p || e[59] !== f || e[60] !== b ? (Y = (F) => /* @__PURE__ */ a(pe, { tool: F, labels: f, expanded: p[F.id], onExpandedChange: () => b({
1436
+ ...p,
1437
+ [F.id]: !p[F.id]
1438
+ }) }, F.id), e[58] = p, e[59] = f, e[60] = b, e[61] = Y) : Y = e[61], k = /* @__PURE__ */ T(y, { width: "100%", sx: i, className: "PsChat--tool-group", children: [
1439
+ G,
1440
+ X,
1441
+ A.map(Y)
1442
+ ] });
1443
+ }
1444
+ e[6] = m, e[7] = p, e[8] = f, e[9] = C, e[10] = g, e[11] = b, e[12] = i, e[13] = o, e[14] = k, e[15] = S;
1445
+ } else
1446
+ k = e[14], S = e[15];
1447
+ return S !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel") ? S : k;
1448
+ }
1449
+ function $t(t) {
1450
+ return t.status !== "running";
1451
+ }
1452
+ function At(t) {
1453
+ return t.status === "running";
1454
+ }
1455
+ function It(t) {
1456
+ return t.status === "error";
781
1457
  }
782
1458
  export {
783
- Fe as CHAT_DIVIDER_DELAY,
784
- j as CHAT_MAX_WIDTH,
785
- Ee as CHAT_SCROLL_DELAY,
786
- Ge as ChatActionsContainer,
787
- ge as ChatAgentMessage,
788
- je as ChatContent,
789
- Pe as ChatErrorMessage,
790
- Ue as ChatFooter,
791
- He as ChatHeader,
792
- Re as ChatLoader,
793
- G as ChatMessageOverflow,
794
- Ke as ChatRatingAction,
795
- Ne as ChatStarter,
796
- Ce as ChatSuggestionButton,
797
- we as ChatThinking,
798
- Ye as ChatTools,
799
- Oe as ChatUserMessage
1459
+ Ot as CHAT_DIVIDER_DELAY,
1460
+ q as CHAT_MAX_WIDTH,
1461
+ Mt as CHAT_SCROLL_DELAY,
1462
+ Ye as CHAT_TOOL_CODE_AREA_MAX_HEIGHT,
1463
+ Kt as ChatActionsContainer,
1464
+ qe as ChatAgentMessage,
1465
+ Ut as ChatContent,
1466
+ Pt as ChatErrorMessage,
1467
+ Nt as ChatFooter,
1468
+ jt as ChatHeader,
1469
+ Vt as ChatLoader,
1470
+ ye as ChatMessageOverflow,
1471
+ Xt as ChatRatingAction,
1472
+ Gt as ChatStarter,
1473
+ et as ChatSuggestionButton,
1474
+ rt as ChatThinking,
1475
+ ue as ChatToolCodeArea,
1476
+ ut as ChatToolFullViewDialog,
1477
+ Yt as ChatToolGroup,
1478
+ pe as ChatToolTrace,
1479
+ Ht as ChatUserMessage
800
1480
  };
801
1481
  //# sourceMappingURL=chat.js.map