@deepagents/react-genai 7.45.5 → 7.46.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/dist/index.js +807 -800
- package/dist/index.js.map +1 -1
- package/dist/lib/chat/citation-order.d.ts +12 -0
- package/dist/lib/chat/citation-order.d.ts.map +1 -0
- package/dist/lib/chat/citations.d.ts +4 -3
- package/dist/lib/chat/citations.d.ts.map +1 -1
- package/dist/lib/chat/message-parts.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/segments/index.d.ts.map +1 -1
- package/dist/lib/copy/assistant-snapshot.d.ts +4 -0
- package/dist/lib/copy/assistant-snapshot.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -186,7 +186,7 @@ function zt(e) {
|
|
|
186
186
|
function Bt(e) {
|
|
187
187
|
let t = O(13), n;
|
|
188
188
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = { initial: "smooth" }, t[0] = n) : n = t[0];
|
|
189
|
-
let { scrollRef: r, contentRef: i } = ie(n), { hasSubmitted: a } =
|
|
189
|
+
let { scrollRef: r, contentRef: i } = ie(n), { hasSubmitted: a } = B(), o;
|
|
190
190
|
t[1] === e.className ? o = t[2] : (o = k("@container mx-auto h-full w-full overflow-y-auto", e.className), t[1] = e.className, t[2] = o);
|
|
191
191
|
let s = a ? "min-h-full" : "h-full justify-center", c;
|
|
192
192
|
t[3] === s ? c = t[4] : (c = k("relative mx-auto flex w-full flex-col", s), t[3] = s, t[4] = c);
|
|
@@ -207,7 +207,7 @@ function Bt(e) {
|
|
|
207
207
|
}), t[9] = r, t[10] = o, t[11] = l, t[12] = u) : u = t[12], u;
|
|
208
208
|
}
|
|
209
209
|
function Vt(e) {
|
|
210
|
-
let t = O(12), { hasSubmitted: n } =
|
|
210
|
+
let t = O(12), { hasSubmitted: n } = B(), r;
|
|
211
211
|
t[0] !== n || t[1] !== e.className ? (r = k(n ? k("bg-background sticky top-0 z-10 shrink-0 space-y-1 backdrop-blur-md", e.className) : "relative flex justify-center py-4"), t[0] = n, t[1] = e.className, t[2] = r) : r = t[2];
|
|
212
212
|
let i;
|
|
213
213
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = { layout: {
|
|
@@ -237,7 +237,7 @@ function Vt(e) {
|
|
|
237
237
|
}
|
|
238
238
|
Vt.displayName = "AgentHeader.Root";
|
|
239
239
|
function Ht(e) {
|
|
240
|
-
let t = O(6), { hasSubmitted: n } =
|
|
240
|
+
let t = O(6), { hasSubmitted: n } = B(), r;
|
|
241
241
|
t[0] !== n || t[1] !== e.children || t[2] !== e.icon ? (r = !n && /* @__PURE__ */ M(A.div, {
|
|
242
242
|
exit: { opacity: 0 },
|
|
243
243
|
transition: { duration: .2 },
|
|
@@ -263,7 +263,7 @@ function Ut(e) {
|
|
|
263
263
|
}
|
|
264
264
|
Ut.displayName = "AgentHeader.Title";
|
|
265
265
|
function Wt(e) {
|
|
266
|
-
let t = O(5), { hasSubmitted: n } =
|
|
266
|
+
let t = O(5), { hasSubmitted: n } = B(), r;
|
|
267
267
|
t[0] !== n || t[1] !== e.children ? (r = n && !!e.children && /* @__PURE__ */ M(A.p, {
|
|
268
268
|
initial: { opacity: 0 },
|
|
269
269
|
animate: { opacity: 1 },
|
|
@@ -351,49 +351,58 @@ function z() {
|
|
|
351
351
|
if (e === void 0) throw Error("useAgent must be used within an AgentProvider");
|
|
352
352
|
return e;
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function Qt() {
|
|
355
355
|
return { status: l(qt) };
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function B() {
|
|
358
358
|
let e = l(Xt);
|
|
359
359
|
if (e === void 0) throw Error("useAgentMeta must be used within an AgentProvider");
|
|
360
360
|
return e;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function V() {
|
|
363
363
|
let e = l(Jt);
|
|
364
364
|
if (e === void 0) throw Error("useAgentMessages must be used within an AgentProvider");
|
|
365
365
|
return e;
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function $t() {
|
|
368
368
|
let e = l(Yt);
|
|
369
369
|
if (!e) throw Error("useChatManager must be used within an AgentProvider");
|
|
370
370
|
return e;
|
|
371
371
|
}
|
|
372
372
|
//#endregion
|
|
373
|
+
//#region src/lib/chat/citation-order.ts
|
|
374
|
+
function en(e, t) {
|
|
375
|
+
return t.map((t, n) => ({
|
|
376
|
+
citation: t,
|
|
377
|
+
order: n,
|
|
378
|
+
at: t.endIndex ?? e.length
|
|
379
|
+
})).sort((e, t) => e.at - t.at || e.order - t.order);
|
|
380
|
+
}
|
|
381
|
+
//#endregion
|
|
373
382
|
//#region src/lib/chat/citations.ts
|
|
374
|
-
function
|
|
383
|
+
function H(e) {
|
|
375
384
|
return (e ?? []).filter((e) => e.source.sourceType === "url");
|
|
376
385
|
}
|
|
377
|
-
function
|
|
378
|
-
let t =
|
|
379
|
-
|
|
386
|
+
function tn(e) {
|
|
387
|
+
let t = new Set(e.parts.flatMap((e) => e.type === "text" ? H(e.citations).map(({ source: e }) => e.url) : [])), n = /* @__PURE__ */ new Map(), r = (e, t) => {
|
|
388
|
+
n.has(e) || n.set(e, {
|
|
380
389
|
url: e,
|
|
381
|
-
title:
|
|
382
|
-
})
|
|
390
|
+
title: t
|
|
391
|
+
});
|
|
383
392
|
};
|
|
384
|
-
for (let
|
|
385
|
-
if (
|
|
386
|
-
|
|
393
|
+
for (let n of e.parts) {
|
|
394
|
+
if (n.type === "text") for (let { citation: e } of en(n.text, H(n.citations))) r(e.source.url, e.source.title);
|
|
395
|
+
n.type === "source-url" && !t.has(n.url) && r(n.url, n.title);
|
|
387
396
|
}
|
|
388
|
-
return n;
|
|
397
|
+
return [...n.values()];
|
|
389
398
|
}
|
|
390
|
-
function
|
|
399
|
+
function nn(e, t) {
|
|
391
400
|
let n = e.findIndex((e) => e.url === t);
|
|
392
401
|
return n === -1 ? null : n + 1;
|
|
393
402
|
}
|
|
394
403
|
//#endregion
|
|
395
404
|
//#region src/lib/chat/read-only-transport.ts
|
|
396
|
-
var
|
|
405
|
+
var rn = class {
|
|
397
406
|
sendMessages() {
|
|
398
407
|
return Promise.reject(/* @__PURE__ */ Error("This chat is read-only: it has no transport to send messages through."));
|
|
399
408
|
}
|
|
@@ -403,19 +412,19 @@ var nn = class {
|
|
|
403
412
|
};
|
|
404
413
|
//#endregion
|
|
405
414
|
//#region src/lib/chat/tool-abort.ts
|
|
406
|
-
function
|
|
415
|
+
function an(e, t) {
|
|
407
416
|
return t === "streaming" || t === "submitted" ? !1 : e === "input-streaming" || e === "input-available";
|
|
408
417
|
}
|
|
409
|
-
function
|
|
410
|
-
return
|
|
418
|
+
function on(e, t) {
|
|
419
|
+
return an(e.state, t);
|
|
411
420
|
}
|
|
412
|
-
function
|
|
413
|
-
let t = O(3), { status: n } =
|
|
414
|
-
return t[0] !== e || t[1] !== n ? (r =
|
|
421
|
+
function sn(e) {
|
|
422
|
+
let t = O(3), { status: n } = Qt(), r;
|
|
423
|
+
return t[0] !== e || t[1] !== n ? (r = on(e, n), t[0] = e, t[1] = n, t[2] = r) : r = t[2], r;
|
|
415
424
|
}
|
|
416
425
|
//#endregion
|
|
417
426
|
//#region src/lib/chat/tools-schema.ts
|
|
418
|
-
function
|
|
427
|
+
function cn(e) {
|
|
419
428
|
return Object.entries(e).reduce((e, [t, n]) => (n.static || (e[t] = {
|
|
420
429
|
inputSchema: P.toJSONSchema(n.inputSchema, {
|
|
421
430
|
io: "input",
|
|
@@ -440,7 +449,7 @@ function U(e) {
|
|
|
440
449
|
}
|
|
441
450
|
//#endregion
|
|
442
451
|
//#region src/lib/chat/trajectory/compact-disclosure.tsx
|
|
443
|
-
function
|
|
452
|
+
function ln(e) {
|
|
444
453
|
let t = O(4), { className: n } = e, r;
|
|
445
454
|
t[0] === n ? r = t[1] : (r = k("size-3.5 shrink-0 transition-transform group-data-[panel-open]:rotate-90", n), t[0] = n, t[1] = r);
|
|
446
455
|
let i;
|
|
@@ -449,22 +458,22 @@ function cn(e) {
|
|
|
449
458
|
className: r
|
|
450
459
|
}), t[2] = r, t[3] = i), i;
|
|
451
460
|
}
|
|
452
|
-
function
|
|
461
|
+
function un(e) {
|
|
453
462
|
return k("group hover:bg-muted/30 flex min-h-7 w-full gap-2 rounded-sm py-1 text-left transition-colors", e);
|
|
454
463
|
}
|
|
455
464
|
//#endregion
|
|
456
465
|
//#region src/lib/chat/trajectory/IndexProgressSegment.tsx
|
|
457
|
-
var
|
|
466
|
+
var dn = "data-text2sql-index-progress", fn = {
|
|
458
467
|
initial: "instant",
|
|
459
468
|
resize: "instant"
|
|
460
469
|
};
|
|
461
|
-
function fn(e) {
|
|
462
|
-
return e.type === un;
|
|
463
|
-
}
|
|
464
470
|
function pn(e) {
|
|
465
|
-
return e.
|
|
471
|
+
return e.type === dn;
|
|
466
472
|
}
|
|
467
473
|
function mn(e) {
|
|
474
|
+
return e.parts.filter(pn).map((e) => e.data);
|
|
475
|
+
}
|
|
476
|
+
function hn(e) {
|
|
468
477
|
let t = /* @__PURE__ */ new Map(), n = "running", r, i, a = (e, n) => {
|
|
469
478
|
let r = t.get(e) ?? {
|
|
470
479
|
name: e,
|
|
@@ -526,11 +535,11 @@ function mn(e) {
|
|
|
526
535
|
errorMessage: i
|
|
527
536
|
};
|
|
528
537
|
}
|
|
529
|
-
function
|
|
538
|
+
function gn(e) {
|
|
530
539
|
let t = O(2), n;
|
|
531
|
-
return t[0] === e ? n = t[1] : (n =
|
|
540
|
+
return t[0] === e ? n = t[1] : (n = hn(e), t[0] = e, t[1] = n), n;
|
|
532
541
|
}
|
|
533
|
-
function
|
|
542
|
+
function _n(e) {
|
|
534
543
|
let t = O(7), { status: n, resetKey: r, controlledOpen: i, onOpenChange: a } = e, o = `${r}:${n}`, [s, c] = g(null), l = i ?? (s?.key === o ? s.open : n === "running"), u;
|
|
535
544
|
t[0] !== i || t[1] !== o || t[2] !== a ? (u = (e) => {
|
|
536
545
|
i === void 0 && c({
|
|
@@ -544,20 +553,20 @@ function gn(e) {
|
|
|
544
553
|
handleOpenChange: d
|
|
545
554
|
}, t[4] = d, t[5] = l, t[6] = f) : f = t[6], f;
|
|
546
555
|
}
|
|
547
|
-
function
|
|
556
|
+
function vn(e, t) {
|
|
548
557
|
return e.length === 0 ? !0 : t.status !== "complete" || t.adapters.length === 0 ? !1 : t.adapters.every((e) => e.status === "cache-hit");
|
|
549
558
|
}
|
|
550
|
-
function
|
|
559
|
+
function yn(e) {
|
|
551
560
|
return e.filter((e) => e.type === "index:start").length;
|
|
552
561
|
}
|
|
553
|
-
function
|
|
562
|
+
function bn(e) {
|
|
554
563
|
return e.filter((e) => [
|
|
555
564
|
"adapter:start",
|
|
556
565
|
"adapter:cache-hit",
|
|
557
566
|
"adapter:cache-miss"
|
|
558
567
|
].includes(e.type)).length;
|
|
559
568
|
}
|
|
560
|
-
function
|
|
569
|
+
function xn(e) {
|
|
561
570
|
let t = (e.totalAdapters ?? e.adapters.length) > 1;
|
|
562
571
|
if (e.status === "error") {
|
|
563
572
|
let n = e.adapters.find((e) => e.status === "error");
|
|
@@ -573,7 +582,7 @@ function bn(e) {
|
|
|
573
582
|
}
|
|
574
583
|
return e.adapters.length === 0 || !t ? ["Schema indexed"] : ["Schema indexed", `${e.adapters.length} adapters`];
|
|
575
584
|
}
|
|
576
|
-
function
|
|
585
|
+
function Sn(e) {
|
|
577
586
|
if (e.status === "error") return [
|
|
578
587
|
"Failed",
|
|
579
588
|
e.name,
|
|
@@ -597,18 +606,18 @@ function xn(e) {
|
|
|
597
606
|
"queued"
|
|
598
607
|
];
|
|
599
608
|
}
|
|
600
|
-
function
|
|
609
|
+
function Cn(e) {
|
|
601
610
|
return ["Failed", e.errorMessage ?? "unknown error"];
|
|
602
611
|
}
|
|
603
|
-
var
|
|
604
|
-
function
|
|
605
|
-
let t = l(
|
|
612
|
+
var wn = o(null);
|
|
613
|
+
function Tn(e) {
|
|
614
|
+
let t = l(wn);
|
|
606
615
|
if (!t) throw Error(`<IndexProgress.${e}> must be used inside <IndexProgress.Root>`);
|
|
607
616
|
return t;
|
|
608
617
|
}
|
|
609
|
-
function
|
|
610
|
-
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s =
|
|
611
|
-
t[0] === n ? l = t[1] : (l =
|
|
618
|
+
function En(e) {
|
|
619
|
+
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s = gn(n), c = s.status, l;
|
|
620
|
+
t[0] === n ? l = t[1] : (l = yn(n), t[0] = n, t[1] = l);
|
|
612
621
|
let u;
|
|
613
622
|
t[2] !== r || t[3] !== i || t[4] !== s.status || t[5] !== l ? (u = {
|
|
614
623
|
status: c,
|
|
@@ -616,8 +625,8 @@ function Tn(e) {
|
|
|
616
625
|
controlledOpen: r,
|
|
617
626
|
onOpenChange: i
|
|
618
627
|
}, t[2] = r, t[3] = i, t[4] = s.status, t[5] = l, t[6] = u) : u = t[6];
|
|
619
|
-
let { isOpen: d, handleOpenChange: f } =
|
|
620
|
-
if (
|
|
628
|
+
let { isOpen: d, handleOpenChange: f } = _n(u);
|
|
629
|
+
if (vn(n, s)) return null;
|
|
621
630
|
let p;
|
|
622
631
|
t[7] !== n || t[8] !== s ? (p = {
|
|
623
632
|
state: s,
|
|
@@ -635,14 +644,14 @@ function Tn(e) {
|
|
|
635
644
|
children: a
|
|
636
645
|
}), t[12] = a, t[13] = f, t[14] = d, t[15] = s.status, t[16] = h, t[17] = g) : g = t[17];
|
|
637
646
|
let _;
|
|
638
|
-
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(
|
|
647
|
+
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(wn, {
|
|
639
648
|
value: p,
|
|
640
649
|
children: g
|
|
641
650
|
}), t[18] = p, t[19] = g, t[20] = _) : _ = t[20], _;
|
|
642
651
|
}
|
|
643
|
-
function
|
|
644
|
-
let t = O(13), { className: n } = e, { state: r } =
|
|
645
|
-
t[0] === n ? i = t[1] : (i =
|
|
652
|
+
function Dn(e) {
|
|
653
|
+
let t = O(13), { className: n } = e, { state: r } = Tn("Trigger"), i;
|
|
654
|
+
t[0] === n ? i = t[1] : (i = On(n), t[0] = n, t[1] = i);
|
|
646
655
|
let a;
|
|
647
656
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("button", {
|
|
648
657
|
type: "button",
|
|
@@ -650,28 +659,28 @@ function En(e) {
|
|
|
650
659
|
className: i
|
|
651
660
|
}), t[2] = i, t[3] = a);
|
|
652
661
|
let o;
|
|
653
|
-
t[4] === r ? o = t[5] : (o =
|
|
662
|
+
t[4] === r ? o = t[5] : (o = xn(r), t[4] = r, t[5] = o);
|
|
654
663
|
let s = r.status === "running", c;
|
|
655
|
-
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(
|
|
664
|
+
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(kn, {
|
|
656
665
|
segments: o,
|
|
657
666
|
isRunning: s
|
|
658
667
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8];
|
|
659
668
|
let l;
|
|
660
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(
|
|
669
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(jn, {}), t[9] = l) : l = t[9];
|
|
661
670
|
let u;
|
|
662
671
|
return t[10] !== a || t[11] !== c ? (u = /* @__PURE__ */ N(L, {
|
|
663
672
|
render: a,
|
|
664
673
|
children: [c, l]
|
|
665
674
|
}), t[10] = a, t[11] = c, t[12] = u) : u = t[12], u;
|
|
666
675
|
}
|
|
667
|
-
function Dn(e) {
|
|
668
|
-
return ln(k("items-baseline px-1", e));
|
|
669
|
-
}
|
|
670
676
|
function On(e) {
|
|
677
|
+
return un(k("items-baseline px-1", e));
|
|
678
|
+
}
|
|
679
|
+
function kn(e) {
|
|
671
680
|
let t = O(8), { segments: n, isRunning: r } = e, i = n.length - 1, a;
|
|
672
681
|
if (t[0] !== i || t[1] !== n) {
|
|
673
682
|
let e;
|
|
674
|
-
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(
|
|
683
|
+
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(An, {
|
|
675
684
|
segment: e,
|
|
676
685
|
index: t,
|
|
677
686
|
isLast: t === i
|
|
@@ -685,7 +694,7 @@ function On(e) {
|
|
|
685
694
|
children: a
|
|
686
695
|
}), t[5] = r, t[6] = a, t[7] = o) : o = t[7], o;
|
|
687
696
|
}
|
|
688
|
-
function
|
|
697
|
+
function An(e) {
|
|
689
698
|
let t = O(11), { segment: n, index: r, isLast: i } = e, o;
|
|
690
699
|
t[0] === r ? o = t[1] : (o = r > 0 && /* @__PURE__ */ M("span", {
|
|
691
700
|
"aria-hidden": !0,
|
|
@@ -702,11 +711,11 @@ function kn(e) {
|
|
|
702
711
|
let d;
|
|
703
712
|
return t[8] !== o || t[9] !== u ? (d = /* @__PURE__ */ N(a, { children: [o, u] }), t[8] = o, t[9] = u, t[10] = d) : d = t[10], d;
|
|
704
713
|
}
|
|
705
|
-
function
|
|
714
|
+
function jn() {
|
|
706
715
|
let e = O(1), t;
|
|
707
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
716
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(ln, { className: "text-muted-foreground/60 size-3" }), e[0] = t) : t = e[0], t;
|
|
708
717
|
}
|
|
709
|
-
function
|
|
718
|
+
function Mn(e) {
|
|
710
719
|
let t = O(3), { className: n, children: r } = e, i;
|
|
711
720
|
return t[0] !== r || t[1] !== n ? (i = /* @__PURE__ */ M(I, {
|
|
712
721
|
"data-slot": "index-progress-content",
|
|
@@ -714,7 +723,7 @@ function jn(e) {
|
|
|
714
723
|
children: r
|
|
715
724
|
}), t[0] = r, t[1] = n, t[2] = i) : i = t[2], i;
|
|
716
725
|
}
|
|
717
|
-
function
|
|
726
|
+
function Nn(e) {
|
|
718
727
|
let t = O(11), { event: n } = e, r;
|
|
719
728
|
t[0] === n.type ? r = t[1] : (r = /* @__PURE__ */ M("span", {
|
|
720
729
|
className: "text-muted-foreground/50 w-40 shrink-0 truncate",
|
|
@@ -744,7 +753,7 @@ function Mn(e) {
|
|
|
744
753
|
]
|
|
745
754
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o) : o = t[10], o;
|
|
746
755
|
}
|
|
747
|
-
function
|
|
756
|
+
function Pn(e) {
|
|
748
757
|
let t = O(2), n;
|
|
749
758
|
if (t[0] !== e) {
|
|
750
759
|
let r = /* @__PURE__ */ new Map(), i = [];
|
|
@@ -759,25 +768,25 @@ function Nn(e) {
|
|
|
759
768
|
} else n = t[1];
|
|
760
769
|
return n;
|
|
761
770
|
}
|
|
762
|
-
function
|
|
763
|
-
let t = O(8), { className: n } = e, { events: r } =
|
|
771
|
+
function Fn(e) {
|
|
772
|
+
let t = O(8), { className: n } = e, { events: r } = Tn("EventLog"), i = Pn(r), a;
|
|
764
773
|
t[0] === n ? a = t[1] : (a = k("mt-2 ml-4 max-h-64 overflow-y-auto font-mono text-[11px]", n), t[0] = n, t[1] = a);
|
|
765
774
|
let o = a;
|
|
766
775
|
if (i.byAdapter.size <= 1) {
|
|
767
776
|
let e;
|
|
768
|
-
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(
|
|
777
|
+
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(Ln, {
|
|
769
778
|
events: r,
|
|
770
779
|
className: o
|
|
771
780
|
}), t[2] = o, t[3] = r, t[4] = e) : e = t[4], e;
|
|
772
781
|
}
|
|
773
782
|
let s;
|
|
774
|
-
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(
|
|
783
|
+
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(zn, {
|
|
775
784
|
groupedEvents: i,
|
|
776
785
|
className: o
|
|
777
786
|
}), t[5] = o, t[6] = i, t[7] = s) : s = t[7], s;
|
|
778
787
|
}
|
|
779
|
-
function
|
|
780
|
-
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(
|
|
788
|
+
function In(e) {
|
|
789
|
+
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(fn), s;
|
|
781
790
|
t[0] !== i || t[1] !== r || t[2] !== o ? (s = /* @__PURE__ */ M("div", {
|
|
782
791
|
ref: o,
|
|
783
792
|
"data-slot": "index-progress-event-log",
|
|
@@ -791,56 +800,56 @@ function Fn(e) {
|
|
|
791
800
|
children: s
|
|
792
801
|
}), t[4] = n, t[5] = a, t[6] = s, t[7] = c) : c = t[7], c;
|
|
793
802
|
}
|
|
794
|
-
function
|
|
803
|
+
function Ln(e) {
|
|
795
804
|
let t = O(7), { events: n, className: r } = e, i;
|
|
796
|
-
t[0] === n ? i = t[1] : (i = n.map(
|
|
805
|
+
t[0] === n ? i = t[1] : (i = n.map(Rn), t[0] = n, t[1] = i);
|
|
797
806
|
let a;
|
|
798
807
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("ul", {
|
|
799
808
|
className: "space-y-0.5",
|
|
800
809
|
children: i
|
|
801
810
|
}), t[2] = i, t[3] = a);
|
|
802
811
|
let o;
|
|
803
|
-
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(
|
|
812
|
+
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(In, {
|
|
804
813
|
className: r,
|
|
805
814
|
children: a
|
|
806
815
|
}), t[4] = r, t[5] = a, t[6] = o) : o = t[6], o;
|
|
807
816
|
}
|
|
808
|
-
function
|
|
809
|
-
return /* @__PURE__ */ M(
|
|
817
|
+
function Rn(e, t) {
|
|
818
|
+
return /* @__PURE__ */ M(Nn, { event: e }, `${e.type}-${t}`);
|
|
810
819
|
}
|
|
811
|
-
function
|
|
820
|
+
function zn(e) {
|
|
812
821
|
let t = O(8), { groupedEvents: n, className: r } = e, i;
|
|
813
822
|
t[0] === n.globalEvents ? i = t[1] : (i = n.globalEvents.length > 0 && /* @__PURE__ */ M("ul", {
|
|
814
823
|
className: "space-y-0.5",
|
|
815
|
-
children: n.globalEvents.map(
|
|
824
|
+
children: n.globalEvents.map(Vn)
|
|
816
825
|
}), t[0] = n.globalEvents, t[1] = i);
|
|
817
826
|
let a;
|
|
818
|
-
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(
|
|
827
|
+
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(Bn), t[2] = n.byAdapter, t[3] = a);
|
|
819
828
|
let o;
|
|
820
|
-
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(
|
|
829
|
+
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(In, {
|
|
821
830
|
className: r,
|
|
822
831
|
contentClassName: "space-y-2",
|
|
823
832
|
children: [i, a]
|
|
824
833
|
}), t[4] = r, t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
|
|
825
834
|
}
|
|
826
|
-
function
|
|
835
|
+
function Bn(e) {
|
|
827
836
|
let [t, n] = e;
|
|
828
|
-
return /* @__PURE__ */ M(
|
|
837
|
+
return /* @__PURE__ */ M(Hn, {
|
|
829
838
|
name: t,
|
|
830
839
|
events: n
|
|
831
840
|
}, t);
|
|
832
841
|
}
|
|
833
|
-
function
|
|
834
|
-
return /* @__PURE__ */ M(
|
|
842
|
+
function Vn(e, t) {
|
|
843
|
+
return /* @__PURE__ */ M(Nn, { event: e }, `${e.type}-${t}`);
|
|
835
844
|
}
|
|
836
|
-
function
|
|
845
|
+
function Hn(e) {
|
|
837
846
|
let t = O(9), { name: n, events: r } = e, i;
|
|
838
847
|
t[0] === n ? i = t[1] : (i = /* @__PURE__ */ M("div", {
|
|
839
848
|
className: "text-foreground/90",
|
|
840
849
|
children: n
|
|
841
850
|
}), t[0] = n, t[1] = i);
|
|
842
851
|
let a;
|
|
843
|
-
t[2] === r ? a = t[3] : (a = r.map(
|
|
852
|
+
t[2] === r ? a = t[3] : (a = r.map(Un), t[2] = r, t[3] = a);
|
|
844
853
|
let o;
|
|
845
854
|
t[4] === a ? o = t[5] : (o = /* @__PURE__ */ M("ul", {
|
|
846
855
|
className: "space-y-0.5",
|
|
@@ -852,21 +861,21 @@ function Vn(e) {
|
|
|
852
861
|
children: [i, o]
|
|
853
862
|
}), t[6] = i, t[7] = o, t[8] = s) : s = t[8], s;
|
|
854
863
|
}
|
|
855
|
-
function
|
|
856
|
-
return /* @__PURE__ */ M(
|
|
864
|
+
function Un(e, t) {
|
|
865
|
+
return /* @__PURE__ */ M(Nn, { event: e }, `${e.type}-${t}`);
|
|
857
866
|
}
|
|
858
|
-
function
|
|
859
|
-
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o =
|
|
860
|
-
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(
|
|
867
|
+
function Wn(e) {
|
|
868
|
+
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o = gn(n), s = Pn(n), c;
|
|
869
|
+
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(Gn), t[0] = s.globalEvents, t[1] = c);
|
|
861
870
|
let l = c;
|
|
862
|
-
if (n.length === 0 || !a &&
|
|
871
|
+
if (n.length === 0 || !a && vn(n, o)) return null;
|
|
863
872
|
if (o.adapters.length === 0) {
|
|
864
873
|
let e;
|
|
865
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(
|
|
874
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(Dn, {}), t[2] = e) : e = t[2];
|
|
866
875
|
let i;
|
|
867
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(
|
|
876
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(Mn, { children: /* @__PURE__ */ M(Fn, {}) }), t[3] = i) : i = t[3];
|
|
868
877
|
let a;
|
|
869
|
-
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(
|
|
878
|
+
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(En, {
|
|
870
879
|
events: n,
|
|
871
880
|
className: r,
|
|
872
881
|
children: [e, i]
|
|
@@ -877,13 +886,13 @@ function Un(e) {
|
|
|
877
886
|
let f;
|
|
878
887
|
if (t[9] !== s.byAdapter || t[10] !== o.adapters) {
|
|
879
888
|
let e;
|
|
880
|
-
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(
|
|
889
|
+
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(Kn, {
|
|
881
890
|
adapter: e,
|
|
882
891
|
events: s.byAdapter.get(e.name) ?? []
|
|
883
892
|
}, e.name), t[12] = s.byAdapter, t[13] = e), f = o.adapters.map(e), t[9] = s.byAdapter, t[10] = o.adapters, t[11] = f;
|
|
884
893
|
} else f = t[11];
|
|
885
894
|
let p;
|
|
886
|
-
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(
|
|
895
|
+
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(Jn, {
|
|
887
896
|
state: o,
|
|
888
897
|
events: l
|
|
889
898
|
}), t[14] = l, t[15] = o, t[16] = p) : p = t[16];
|
|
@@ -895,32 +904,32 @@ function Un(e) {
|
|
|
895
904
|
children: [f, p]
|
|
896
905
|
}), t[17] = o.status, t[18] = d, t[19] = f, t[20] = p, t[21] = m) : m = t[21], m;
|
|
897
906
|
}
|
|
898
|
-
function
|
|
907
|
+
function Gn(e) {
|
|
899
908
|
return e.type === "index:error";
|
|
900
909
|
}
|
|
901
|
-
function
|
|
910
|
+
function Kn(e) {
|
|
902
911
|
let t = O(22), { adapter: n, events: r } = e, i = n.status, a;
|
|
903
|
-
t[0] === r ? a = t[1] : (a =
|
|
912
|
+
t[0] === r ? a = t[1] : (a = bn(r), t[0] = r, t[1] = a);
|
|
904
913
|
let o;
|
|
905
914
|
t[2] !== n.status || t[3] !== a ? (o = {
|
|
906
915
|
status: i,
|
|
907
916
|
resetKey: a
|
|
908
917
|
}, t[2] = n.status, t[3] = a, t[4] = o) : o = t[4];
|
|
909
|
-
let { isOpen: s, handleOpenChange: c } =
|
|
918
|
+
let { isOpen: s, handleOpenChange: c } = _n(o), l = n.status, u;
|
|
910
919
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ M("button", {
|
|
911
920
|
type: "button",
|
|
912
921
|
"data-slot": "index-progress-adapter-trigger",
|
|
913
|
-
className:
|
|
922
|
+
className: On()
|
|
914
923
|
}), t[5] = u) : u = t[5];
|
|
915
924
|
let d;
|
|
916
|
-
t[6] === n ? d = t[7] : (d =
|
|
925
|
+
t[6] === n ? d = t[7] : (d = Sn(n), t[6] = n, t[7] = d);
|
|
917
926
|
let f = n.status === "running", p;
|
|
918
|
-
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(
|
|
927
|
+
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(kn, {
|
|
919
928
|
segments: d,
|
|
920
929
|
isRunning: f
|
|
921
930
|
}), t[8] = d, t[9] = f, t[10] = p) : p = t[10];
|
|
922
931
|
let m;
|
|
923
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(
|
|
932
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(jn, {}), t[11] = m) : m = t[11];
|
|
924
933
|
let h;
|
|
925
934
|
t[12] === p ? h = t[13] : (h = /* @__PURE__ */ N(L, {
|
|
926
935
|
render: u,
|
|
@@ -929,7 +938,7 @@ function Gn(e) {
|
|
|
929
938
|
let g;
|
|
930
939
|
t[14] === r ? g = t[15] : (g = /* @__PURE__ */ M(I, {
|
|
931
940
|
"data-slot": "index-progress-adapter-content",
|
|
932
|
-
children: /* @__PURE__ */ M(
|
|
941
|
+
children: /* @__PURE__ */ M(qn, { events: r })
|
|
933
942
|
}), t[14] = r, t[15] = g);
|
|
934
943
|
let _;
|
|
935
944
|
return t[16] !== n.status || t[17] !== c || t[18] !== s || t[19] !== h || t[20] !== g ? (_ = /* @__PURE__ */ N(F, {
|
|
@@ -941,36 +950,36 @@ function Gn(e) {
|
|
|
941
950
|
children: [h, g]
|
|
942
951
|
}), t[16] = n.status, t[17] = c, t[18] = s, t[19] = h, t[20] = g, t[21] = _) : _ = t[21], _;
|
|
943
952
|
}
|
|
944
|
-
function
|
|
953
|
+
function qn(e) {
|
|
945
954
|
let t = O(2), { events: n } = e;
|
|
946
955
|
if (n.length === 0) return null;
|
|
947
956
|
let r;
|
|
948
|
-
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(
|
|
957
|
+
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(Ln, {
|
|
949
958
|
events: n,
|
|
950
959
|
className: "mt-2 ml-4 max-h-64 overflow-y-auto font-mono text-[11px]"
|
|
951
960
|
}), t[0] = n, t[1] = r), r;
|
|
952
961
|
}
|
|
953
|
-
function
|
|
962
|
+
function Jn(e) {
|
|
954
963
|
let t = O(20), { state: n, events: r } = e, i;
|
|
955
964
|
t[0] !== r.length || t[1] !== n.status ? (i = {
|
|
956
965
|
status: n.status,
|
|
957
966
|
resetKey: r.length
|
|
958
967
|
}, t[0] = r.length, t[1] = n.status, t[2] = i) : i = t[2];
|
|
959
|
-
let { isOpen: a, handleOpenChange: o } =
|
|
968
|
+
let { isOpen: a, handleOpenChange: o } = _n(i), s = n.status, c;
|
|
960
969
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ M("button", {
|
|
961
970
|
type: "button",
|
|
962
971
|
"data-slot": "index-progress-global-error-trigger",
|
|
963
|
-
className:
|
|
972
|
+
className: On()
|
|
964
973
|
}), t[3] = c) : c = t[3];
|
|
965
974
|
let l;
|
|
966
|
-
t[4] === n ? l = t[5] : (l =
|
|
975
|
+
t[4] === n ? l = t[5] : (l = Cn(n), t[4] = n, t[5] = l);
|
|
967
976
|
let u = n.status === "running", d;
|
|
968
|
-
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(
|
|
977
|
+
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(kn, {
|
|
969
978
|
segments: l,
|
|
970
979
|
isRunning: u
|
|
971
980
|
}), t[6] = l, t[7] = u, t[8] = d) : d = t[8];
|
|
972
981
|
let f;
|
|
973
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(
|
|
982
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(jn, {}), t[9] = f) : f = t[9];
|
|
974
983
|
let p;
|
|
975
984
|
t[10] === d ? p = t[11] : (p = /* @__PURE__ */ N(L, {
|
|
976
985
|
render: c,
|
|
@@ -979,7 +988,7 @@ function qn(e) {
|
|
|
979
988
|
let m;
|
|
980
989
|
t[12] === r ? m = t[13] : (m = /* @__PURE__ */ M(I, {
|
|
981
990
|
"data-slot": "index-progress-global-error-content",
|
|
982
|
-
children: /* @__PURE__ */ M(
|
|
991
|
+
children: /* @__PURE__ */ M(qn, { events: r })
|
|
983
992
|
}), t[12] = r, t[13] = m);
|
|
984
993
|
let h;
|
|
985
994
|
return t[14] !== o || t[15] !== a || t[16] !== n.status || t[17] !== p || t[18] !== m ? (h = /* @__PURE__ */ N(F, {
|
|
@@ -991,30 +1000,30 @@ function qn(e) {
|
|
|
991
1000
|
children: [p, m]
|
|
992
1001
|
}), t[14] = o, t[15] = a, t[16] = n.status, t[17] = p, t[18] = m, t[19] = h) : h = t[19], h;
|
|
993
1002
|
}
|
|
994
|
-
var
|
|
995
|
-
Root:
|
|
996
|
-
Trigger:
|
|
997
|
-
Content:
|
|
998
|
-
EventLog:
|
|
999
|
-
PerAdapter:
|
|
1000
|
-
},
|
|
1003
|
+
var Yn = {
|
|
1004
|
+
Root: En,
|
|
1005
|
+
Trigger: Dn,
|
|
1006
|
+
Content: Mn,
|
|
1007
|
+
EventLog: Fn,
|
|
1008
|
+
PerAdapter: Wn
|
|
1009
|
+
}, Xn = o(void 0), Zn = o(void 0);
|
|
1001
1010
|
function W() {
|
|
1002
|
-
let e = l(
|
|
1011
|
+
let e = l(Xn);
|
|
1003
1012
|
if (!e) throw Error("useMessagesContext must be used within <Messages>");
|
|
1004
1013
|
return e;
|
|
1005
1014
|
}
|
|
1006
1015
|
function G() {
|
|
1007
|
-
let e = l(
|
|
1016
|
+
let e = l(Xn), { status: t } = Qt();
|
|
1008
1017
|
return e?.status ?? t;
|
|
1009
1018
|
}
|
|
1010
1019
|
function K() {
|
|
1011
|
-
let e = l(
|
|
1020
|
+
let e = l(Zn);
|
|
1012
1021
|
if (!e) throw Error("useMessageItem must be used within <Messages.Item>");
|
|
1013
1022
|
return e;
|
|
1014
1023
|
}
|
|
1015
1024
|
//#endregion
|
|
1016
1025
|
//#region src/lib/components/CitationPill.tsx
|
|
1017
|
-
function
|
|
1026
|
+
function Qn({ source: e, index: t, labels: n = {
|
|
1018
1027
|
source: `Source ${t}`,
|
|
1019
1028
|
open: "Open the source"
|
|
1020
1029
|
}, children: r }) {
|
|
@@ -1054,7 +1063,7 @@ function Zn({ source: e, index: t, labels: n = {
|
|
|
1054
1063
|
}
|
|
1055
1064
|
//#endregion
|
|
1056
1065
|
//#region src/lib/ui/TablePanel.tsx
|
|
1057
|
-
function
|
|
1066
|
+
function $n(e) {
|
|
1058
1067
|
let t = O(10), n, r, i;
|
|
1059
1068
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({ref: i, className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
1060
1069
|
let a;
|
|
@@ -1068,8 +1077,8 @@ function Qn(e) {
|
|
|
1068
1077
|
...r
|
|
1069
1078
|
}), t[6] = r, t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
1070
1079
|
}
|
|
1071
|
-
|
|
1072
|
-
function
|
|
1080
|
+
$n.displayName = "TablePanel.Root";
|
|
1081
|
+
function er(e) {
|
|
1073
1082
|
let t = O(8), n, r;
|
|
1074
1083
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1075
1084
|
let i;
|
|
@@ -1081,7 +1090,7 @@ function $n(e) {
|
|
|
1081
1090
|
...r
|
|
1082
1091
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1083
1092
|
}
|
|
1084
|
-
function
|
|
1093
|
+
function tr(e) {
|
|
1085
1094
|
let t = O(8), n, r;
|
|
1086
1095
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1087
1096
|
let i;
|
|
@@ -1093,7 +1102,7 @@ function er(e) {
|
|
|
1093
1102
|
...r
|
|
1094
1103
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1095
1104
|
}
|
|
1096
|
-
function
|
|
1105
|
+
function nr(e) {
|
|
1097
1106
|
let t = O(8), n, r;
|
|
1098
1107
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1099
1108
|
let i;
|
|
@@ -1105,7 +1114,7 @@ function tr(e) {
|
|
|
1105
1114
|
...r
|
|
1106
1115
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1107
1116
|
}
|
|
1108
|
-
function
|
|
1117
|
+
function rr(e) {
|
|
1109
1118
|
let t = O(8), n, r;
|
|
1110
1119
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1111
1120
|
let i;
|
|
@@ -1117,7 +1126,7 @@ function nr(e) {
|
|
|
1117
1126
|
...r
|
|
1118
1127
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1119
1128
|
}
|
|
1120
|
-
function
|
|
1129
|
+
function ir(e) {
|
|
1121
1130
|
let t = O(8), n, r;
|
|
1122
1131
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1123
1132
|
let i;
|
|
@@ -1129,7 +1138,7 @@ function rr(e) {
|
|
|
1129
1138
|
...r
|
|
1130
1139
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1131
1140
|
}
|
|
1132
|
-
function
|
|
1141
|
+
function ar(e) {
|
|
1133
1142
|
let t = O(8), n, r;
|
|
1134
1143
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1135
1144
|
let i;
|
|
@@ -1141,40 +1150,40 @@ function ir(e) {
|
|
|
1141
1150
|
...r
|
|
1142
1151
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1143
1152
|
}
|
|
1144
|
-
var q = Object.assign(
|
|
1145
|
-
Header:
|
|
1146
|
-
Heading:
|
|
1147
|
-
Title:
|
|
1148
|
-
Description:
|
|
1149
|
-
Actions:
|
|
1150
|
-
Content:
|
|
1151
|
-
}),
|
|
1152
|
-
function
|
|
1153
|
-
return e.replace(
|
|
1154
|
-
}
|
|
1155
|
-
function
|
|
1153
|
+
var q = Object.assign($n, {
|
|
1154
|
+
Header: er,
|
|
1155
|
+
Heading: tr,
|
|
1156
|
+
Title: nr,
|
|
1157
|
+
Description: rr,
|
|
1158
|
+
Actions: ir,
|
|
1159
|
+
Content: ar
|
|
1160
|
+
}), or = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>/g, sr = /\b([\w-]+)="((?:\\.|[^"])*)"/g;
|
|
1161
|
+
function cr(e) {
|
|
1162
|
+
return e.replace(or, (e) => e.replace(sr, (e, t, n) => `${t}="${n.replace(/\\"/g, """)}"`));
|
|
1163
|
+
}
|
|
1164
|
+
function lr(e, t) {
|
|
1156
1165
|
if (typeof e != "string") return e;
|
|
1157
|
-
let n =
|
|
1158
|
-
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") &&
|
|
1166
|
+
let n = cr(gr(e, fr(t))).replace(/<(\w[\w-]*)((?:\s+[\w-]+="[^"]*")+)\s*(\/?>)/g, (e, t, n, r) => `<${t}${n.replace(/\s+/g, " ")}${r}`);
|
|
1167
|
+
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") && dr(r, n) ? e : "/>\n\n<"), _r(n, t);
|
|
1159
1168
|
}
|
|
1160
|
-
var
|
|
1161
|
-
function
|
|
1169
|
+
var ur = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>|<\/[\w-]+\s*>/g;
|
|
1170
|
+
function dr(e, t) {
|
|
1162
1171
|
let n = e.lastIndexOf("\n", t - 1) + 1, r = e.indexOf("\n", t);
|
|
1163
|
-
return e.slice(n, r < 0 ? e.length : r).replace(
|
|
1172
|
+
return e.slice(n, r < 0 ? e.length : r).replace(ur, "").trim() !== "";
|
|
1164
1173
|
}
|
|
1165
|
-
function
|
|
1174
|
+
function fr(e) {
|
|
1166
1175
|
let t = e?.length ? new Set(e) : null;
|
|
1167
1176
|
return t ? (e) => t.has(e) : (e) => e.includes("-");
|
|
1168
1177
|
}
|
|
1169
|
-
var
|
|
1170
|
-
function
|
|
1171
|
-
return e.replace(
|
|
1178
|
+
var pr = /<([\w-]+)((?:\s+[\w-]+=(?:[“”][^“”]*[“”]|[‘’][^‘’]*[‘’]|"[^"]*"|'[^']*'))+)\s*(\/?>)/g, mr = /([\w-]+)=(?:[“”]([^“”]*)[“”]|[‘’]([^‘’]*)[‘’])/g;
|
|
1179
|
+
function hr(e) {
|
|
1180
|
+
return e.replace(mr, (e, t, n, r) => `${t}="${(n ?? r ?? "").replace(/"/g, """)}"`);
|
|
1172
1181
|
}
|
|
1173
|
-
function
|
|
1174
|
-
return e.replace(
|
|
1182
|
+
function gr(e, t) {
|
|
1183
|
+
return e.replace(pr, (e, n, r, i) => t(n) ? `<${n}${hr(r)}${i}` : e);
|
|
1175
1184
|
}
|
|
1176
|
-
function
|
|
1177
|
-
let r =
|
|
1185
|
+
function _r(e, t, n = !1) {
|
|
1186
|
+
let r = fr(t), i = "", a = 0;
|
|
1178
1187
|
for (; a < e.length;) {
|
|
1179
1188
|
if (e[a] !== "<" || e[a + 1] === "/") {
|
|
1180
1189
|
i += e[a++];
|
|
@@ -1187,36 +1196,36 @@ function gr(e, t, n = !1) {
|
|
|
1187
1196
|
i += e[a++];
|
|
1188
1197
|
continue;
|
|
1189
1198
|
}
|
|
1190
|
-
let c =
|
|
1199
|
+
let c = vr(e, a);
|
|
1191
1200
|
if (c < 0) {
|
|
1192
1201
|
i += e[a++];
|
|
1193
1202
|
continue;
|
|
1194
1203
|
}
|
|
1195
1204
|
if (e[c - 1] === "/") {
|
|
1196
1205
|
let t = e.slice(a, c + 1);
|
|
1197
|
-
n ? i += "<div>" + t + "</div>" :
|
|
1206
|
+
n ? i += "<div>" + t + "</div>" : dr(e, a) ? i += "<span>" + t.slice(0, -2).trimEnd() + "></" + s + "></span>" : (i += t.slice(0, -2).trimEnd() + "></" + s + ">", e[c + 1] === "\n" && c + 2 < e.length && e[c + 2] !== "\n" && (i += "\n")), a = c + 1;
|
|
1198
1207
|
continue;
|
|
1199
1208
|
}
|
|
1200
|
-
let l =
|
|
1209
|
+
let l = yr(e, c + 1, s);
|
|
1201
1210
|
if (!l) {
|
|
1202
1211
|
if (n) {
|
|
1203
|
-
let n = e.slice(a, c + 1), r =
|
|
1212
|
+
let n = e.slice(a, c + 1), r = _r(e.slice(c + 1), t, !0);
|
|
1204
1213
|
return i += "<div>" + n + r + "</" + s + "></div>", i;
|
|
1205
1214
|
}
|
|
1206
1215
|
i += e.slice(a, c + 1), a = c + 1;
|
|
1207
1216
|
continue;
|
|
1208
1217
|
}
|
|
1209
|
-
let u = e.slice(a, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p =
|
|
1218
|
+
let u = e.slice(a, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p = _r(d, t, !0);
|
|
1210
1219
|
if (n) i += "<div>" + u + p + f + "</div>";
|
|
1211
1220
|
else {
|
|
1212
1221
|
let t = p.includes("\n") ? "\n" : "";
|
|
1213
|
-
i =
|
|
1222
|
+
i = br(i) + "<div>" + t + u + p + f + t + "</div>", e[l.end] === "\n" && l.end + 1 < e.length && e[l.end + 1] !== "\n" && (i += "\n");
|
|
1214
1223
|
}
|
|
1215
1224
|
a = l.end;
|
|
1216
1225
|
}
|
|
1217
1226
|
return i;
|
|
1218
1227
|
}
|
|
1219
|
-
function
|
|
1228
|
+
function vr(e, t) {
|
|
1220
1229
|
let n = t + 1;
|
|
1221
1230
|
for (; n < e.length;) {
|
|
1222
1231
|
if (e[n] === "\"") for (n++; n < e.length && e[n] !== "\"";) n++;
|
|
@@ -1225,14 +1234,14 @@ function _r(e, t) {
|
|
|
1225
1234
|
}
|
|
1226
1235
|
return -1;
|
|
1227
1236
|
}
|
|
1228
|
-
function
|
|
1237
|
+
function yr(e, t, n) {
|
|
1229
1238
|
let r = 1, i = t, a = "<" + n, o = "</" + n;
|
|
1230
1239
|
for (; i < e.length;) {
|
|
1231
1240
|
let t = e.indexOf("<", i);
|
|
1232
1241
|
if (t < 0) return null;
|
|
1233
1242
|
if (e.startsWith(o, t) && !/[\w-]/.test(e[t + o.length] || "")) {
|
|
1234
1243
|
if (r--, r === 0) {
|
|
1235
|
-
let n =
|
|
1244
|
+
let n = vr(e, t);
|
|
1236
1245
|
return n < 0 ? null : {
|
|
1237
1246
|
start: t,
|
|
1238
1247
|
end: n + 1
|
|
@@ -1241,25 +1250,25 @@ function vr(e, t, n) {
|
|
|
1241
1250
|
let n = e.indexOf(">", t + o.length);
|
|
1242
1251
|
i = n < 0 ? t + 1 : n + 1;
|
|
1243
1252
|
} else if (e.startsWith(a, t) && !/[\w-]/.test(e[t + a.length] || "")) {
|
|
1244
|
-
let n =
|
|
1253
|
+
let n = vr(e, t);
|
|
1245
1254
|
n >= 0 && e[n - 1] !== "/" && r++, i = n < 0 ? t + 1 : n + 1;
|
|
1246
1255
|
} else if (/[a-zA-Z/]/.test(e[t + 1] || "")) {
|
|
1247
|
-
let n =
|
|
1256
|
+
let n = vr(e, t);
|
|
1248
1257
|
i = n < 0 ? t + 1 : n + 1;
|
|
1249
1258
|
} else i = t + 1;
|
|
1250
1259
|
}
|
|
1251
1260
|
return null;
|
|
1252
1261
|
}
|
|
1253
|
-
function
|
|
1262
|
+
function br(e) {
|
|
1254
1263
|
return e.length === 0 ? "\n\n" : e.endsWith("\n\n") ? e : e.endsWith("\n") ? e + "\n" : e + "\n\n";
|
|
1255
1264
|
}
|
|
1256
1265
|
//#endregion
|
|
1257
1266
|
//#region src/lib/elements/table-panel-extension.tsx
|
|
1258
|
-
var
|
|
1267
|
+
var xr = "response-table-panel", Sr = ["title", "description"], Cr = k(Ne({
|
|
1259
1268
|
variant: "ghost",
|
|
1260
1269
|
size: "icon-sm"
|
|
1261
|
-
})),
|
|
1262
|
-
let t = _t(e), n =
|
|
1270
|
+
})), wr = vt().use(ut).use(lt).use(ct), Tr = (e) => {
|
|
1271
|
+
let t = _t(e), n = Or(e);
|
|
1263
1272
|
if (n.length === 0) return t;
|
|
1264
1273
|
let r = 0, i = t.map((e) => {
|
|
1265
1274
|
let t = {
|
|
@@ -1274,49 +1283,49 @@ var br = "response-table-panel", xr = ["title", "description"], Sr = k(Ne({
|
|
|
1274
1283
|
}
|
|
1275
1284
|
return t.reduce((e, t, n) => (a.has(n) && e.length > 0 ? e[e.length - 1] += t : e.push(t), e), []);
|
|
1276
1285
|
};
|
|
1277
|
-
function
|
|
1286
|
+
function Er(e) {
|
|
1278
1287
|
return e?.type === "leafDirective" && "name" in e && e.name === "table";
|
|
1279
1288
|
}
|
|
1280
|
-
function
|
|
1289
|
+
function Dr(e, t) {
|
|
1281
1290
|
if (t === void 0) return;
|
|
1282
1291
|
let n = e[t - 1];
|
|
1283
|
-
return
|
|
1292
|
+
return Er(n) ? n : void 0;
|
|
1284
1293
|
}
|
|
1285
|
-
function
|
|
1294
|
+
function Or(e) {
|
|
1286
1295
|
let t = [];
|
|
1287
|
-
return bt(
|
|
1296
|
+
return bt(wr.parse(e), "table", (e, n, r) => {
|
|
1288
1297
|
if (!r) return;
|
|
1289
|
-
let i =
|
|
1298
|
+
let i = Dr(r.children, n)?.position?.start.offset, a = e.position?.end.offset;
|
|
1290
1299
|
i !== void 0 && a !== void 0 && t.push({
|
|
1291
1300
|
start: i,
|
|
1292
1301
|
end: a
|
|
1293
1302
|
});
|
|
1294
1303
|
}), t;
|
|
1295
1304
|
}
|
|
1296
|
-
function
|
|
1305
|
+
function kr(e, t) {
|
|
1297
1306
|
return e.attributes?.[t]?.trim() || void 0;
|
|
1298
1307
|
}
|
|
1299
|
-
function
|
|
1300
|
-
let t =
|
|
1308
|
+
function Ar(e) {
|
|
1309
|
+
let t = wr.parse(e), n = !1;
|
|
1301
1310
|
if (bt(t, "leafDirective", (e, t, r) => {
|
|
1302
1311
|
let i = t === void 0 ? void 0 : r?.children[t + 1];
|
|
1303
1312
|
if (e.name !== "table" || i?.type !== "table") return;
|
|
1304
1313
|
n = !0;
|
|
1305
|
-
let a = [
|
|
1314
|
+
let a = [kr(e, "title"), kr(e, "description")].filter(Boolean).join(" ");
|
|
1306
1315
|
e.children = a ? [{
|
|
1307
1316
|
type: "text",
|
|
1308
1317
|
value: a
|
|
1309
1318
|
}] : [];
|
|
1310
1319
|
}), n) return gt(st(t, { includeHtml: !1 }));
|
|
1311
1320
|
}
|
|
1312
|
-
function
|
|
1321
|
+
function jr(e) {
|
|
1313
1322
|
let t = O(2), n;
|
|
1314
1323
|
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(dt, { ...e }), t[0] = e, t[1] = n), n;
|
|
1315
1324
|
}
|
|
1316
|
-
function
|
|
1325
|
+
function Mr(e) {
|
|
1317
1326
|
function t(t) {
|
|
1318
1327
|
let n = O(6), r;
|
|
1319
|
-
n[0] !== t.content || n[1] !== t.dir ? (r =
|
|
1328
|
+
n[0] !== t.content || n[1] !== t.dir ? (r = Ar(t.content) ?? t.dir, n[0] = t.content, n[1] = t.dir, n[2] = r) : r = n[2];
|
|
1320
1329
|
let i = r, a;
|
|
1321
1330
|
return n[3] !== i || n[4] !== t ? (a = /* @__PURE__ */ M(e, {
|
|
1322
1331
|
...t,
|
|
@@ -1325,54 +1334,54 @@ function jr(e) {
|
|
|
1325
1334
|
}
|
|
1326
1335
|
return t.displayName = "DirectionAwareTableBlock", t;
|
|
1327
1336
|
}
|
|
1328
|
-
function
|
|
1329
|
-
let n = t &&
|
|
1337
|
+
function Nr(e, t) {
|
|
1338
|
+
let n = t && kr(t, "title"), r = t && kr(t, "description"), i = {
|
|
1330
1339
|
...n ? { title: n } : {},
|
|
1331
1340
|
...r ? { description: r } : {}
|
|
1332
1341
|
};
|
|
1333
1342
|
return {
|
|
1334
1343
|
type: "tablePanel",
|
|
1335
1344
|
data: {
|
|
1336
|
-
hName:
|
|
1345
|
+
hName: xr,
|
|
1337
1346
|
...Object.keys(i).length > 0 ? { hProperties: i } : {}
|
|
1338
1347
|
},
|
|
1339
1348
|
children: [e]
|
|
1340
1349
|
};
|
|
1341
1350
|
}
|
|
1342
|
-
function
|
|
1351
|
+
function Pr() {
|
|
1343
1352
|
return (e) => {
|
|
1344
1353
|
bt(e, "table", (e, t, n) => {
|
|
1345
1354
|
if (t === void 0 || !n) return;
|
|
1346
|
-
let r =
|
|
1347
|
-
return n.children.splice(i, a,
|
|
1355
|
+
let r = Dr(n.children, t), i = r ? t - 1 : t, a = r ? 2 : 1;
|
|
1356
|
+
return n.children.splice(i, a, Nr(e, r)), [yt, i + 1];
|
|
1348
1357
|
});
|
|
1349
1358
|
};
|
|
1350
1359
|
}
|
|
1351
|
-
var
|
|
1360
|
+
var Fr = [
|
|
1352
1361
|
...Object.values(ht),
|
|
1353
1362
|
ct,
|
|
1354
|
-
|
|
1355
|
-
],
|
|
1363
|
+
Pr
|
|
1364
|
+
], Ir = t.createContext({
|
|
1356
1365
|
actions: null,
|
|
1357
1366
|
controls: !0
|
|
1358
1367
|
});
|
|
1359
|
-
function
|
|
1368
|
+
function Lr(e, t) {
|
|
1360
1369
|
if (e === !1) return !1;
|
|
1361
1370
|
if (e === !0 || e === void 0) return !0;
|
|
1362
1371
|
let n = e.table;
|
|
1363
1372
|
return n === !1 ? !1 : n === !0 || n === void 0 || n[t] !== !1;
|
|
1364
1373
|
}
|
|
1365
|
-
function
|
|
1374
|
+
function Rr(e) {
|
|
1366
1375
|
return e === !1 ? !1 : e === !0 || e === void 0 ? { table: !1 } : {
|
|
1367
1376
|
...e,
|
|
1368
1377
|
table: !1
|
|
1369
1378
|
};
|
|
1370
1379
|
}
|
|
1371
|
-
function
|
|
1372
|
-
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(
|
|
1373
|
-
n[0] === c ? l = n[1] : (l =
|
|
1380
|
+
function zr(e) {
|
|
1381
|
+
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(Ir), l;
|
|
1382
|
+
n[0] === c ? l = n[1] : (l = Lr(c, "copy"), n[0] = c, n[1] = l);
|
|
1374
1383
|
let u = l, d;
|
|
1375
|
-
n[2] === c ? d = n[3] : (d =
|
|
1384
|
+
n[2] === c ? d = n[3] : (d = Lr(c, "download"), n[2] = c, n[3] = d);
|
|
1376
1385
|
let f = d, p = !!(a || o), m = !!(u || f || s);
|
|
1377
1386
|
if (!r) return null;
|
|
1378
1387
|
let h;
|
|
@@ -1386,8 +1395,8 @@ function Rr(e) {
|
|
|
1386
1395
|
})] }), m && /* @__PURE__ */ N(q.Actions, {
|
|
1387
1396
|
"data-copy-exclude": "assistant-snapshot",
|
|
1388
1397
|
children: [
|
|
1389
|
-
u && /* @__PURE__ */ M(pt, { className:
|
|
1390
|
-
f && /* @__PURE__ */ M(mt, { className:
|
|
1398
|
+
u && /* @__PURE__ */ M(pt, { className: Cr }),
|
|
1399
|
+
f && /* @__PURE__ */ M(mt, { className: Cr }),
|
|
1391
1400
|
s
|
|
1392
1401
|
]
|
|
1393
1402
|
})]
|
|
@@ -1406,31 +1415,31 @@ function Rr(e) {
|
|
|
1406
1415
|
children: [g, v]
|
|
1407
1416
|
}), n[17] = h, n[18] = g, n[19] = v, n[20] = y) : y = n[20], y;
|
|
1408
1417
|
}
|
|
1409
|
-
function
|
|
1418
|
+
function Br(e) {
|
|
1410
1419
|
let t = O(43), n, r, i, a, o, s, c, l, u, d;
|
|
1411
1420
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6], c = t[7], l = t[8], u = t[9], d = t[10]) : ({allowedTags: r, BlockComponent: n, children: i, components: a, controls: o, dir: s, mode: c, remarkPlugins: u, tableActions: d, ...l} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s, t[7] = c, t[8] = l, t[9] = u, t[10] = d);
|
|
1412
1421
|
let f;
|
|
1413
1422
|
bb0: {
|
|
1414
1423
|
if (!u) {
|
|
1415
|
-
f =
|
|
1424
|
+
f = Fr;
|
|
1416
1425
|
break bb0;
|
|
1417
1426
|
}
|
|
1418
1427
|
let e;
|
|
1419
1428
|
t[11] === u ? e = t[12] : (e = [
|
|
1420
1429
|
...u,
|
|
1421
1430
|
ct,
|
|
1422
|
-
|
|
1431
|
+
Pr
|
|
1423
1432
|
], t[11] = u, t[12] = e), f = e;
|
|
1424
1433
|
}
|
|
1425
1434
|
let p = f, m;
|
|
1426
1435
|
t[13] === r ? m = t[14] : (m = {
|
|
1427
1436
|
...r,
|
|
1428
|
-
[
|
|
1437
|
+
[xr]: Sr
|
|
1429
1438
|
}, t[13] = r, t[14] = m);
|
|
1430
1439
|
let h = m, g;
|
|
1431
1440
|
t[15] === a ? g = t[16] : (g = {
|
|
1432
1441
|
...a,
|
|
1433
|
-
[
|
|
1442
|
+
[xr]: zr
|
|
1434
1443
|
}, t[15] = a, t[16] = g);
|
|
1435
1444
|
let _ = g, v;
|
|
1436
1445
|
t[17] !== o || t[18] !== d ? (v = {
|
|
@@ -1443,8 +1452,8 @@ function zr(e) {
|
|
|
1443
1452
|
b = n;
|
|
1444
1453
|
break bb1;
|
|
1445
1454
|
}
|
|
1446
|
-
let e = n ??
|
|
1447
|
-
t[20] === e ? r = t[21] : (r =
|
|
1455
|
+
let e = n ?? jr, r;
|
|
1456
|
+
t[20] === e ? r = t[21] : (r = Mr(e), t[20] = e, t[21] = r), b = r;
|
|
1448
1457
|
}
|
|
1449
1458
|
let x = b, S;
|
|
1450
1459
|
bb2: {
|
|
@@ -1453,12 +1462,12 @@ function zr(e) {
|
|
|
1453
1462
|
break bb2;
|
|
1454
1463
|
}
|
|
1455
1464
|
let e;
|
|
1456
|
-
t[22] !== i || t[23] !== s ? (e =
|
|
1465
|
+
t[22] !== i || t[23] !== s ? (e = Ar(i) ?? s, t[22] = i, t[23] = s, t[24] = e) : e = t[24], S = e;
|
|
1457
1466
|
}
|
|
1458
1467
|
let C = S, w;
|
|
1459
|
-
t[25] === o ? w = t[26] : (w =
|
|
1468
|
+
t[25] === o ? w = t[26] : (w = Rr(o), t[25] = o, t[26] = w);
|
|
1460
1469
|
let T;
|
|
1461
|
-
t[27] !== i || t[28] !== h ? (T =
|
|
1470
|
+
t[27] !== i || t[28] !== h ? (T = lr(i, Object.keys(h)), t[27] = i, t[28] = h, t[29] = T) : T = t[29];
|
|
1462
1471
|
let E;
|
|
1463
1472
|
t[30] !== c || t[31] !== l || t[32] !== C || t[33] !== w || t[34] !== T || t[35] !== h || t[36] !== x || t[37] !== _ || t[38] !== p ? (E = /* @__PURE__ */ M(ft, {
|
|
1464
1473
|
allowedTags: h,
|
|
@@ -1467,20 +1476,20 @@ function zr(e) {
|
|
|
1467
1476
|
controls: w,
|
|
1468
1477
|
dir: C,
|
|
1469
1478
|
mode: c,
|
|
1470
|
-
parseMarkdownIntoBlocksFn:
|
|
1479
|
+
parseMarkdownIntoBlocksFn: Tr,
|
|
1471
1480
|
remarkPlugins: p,
|
|
1472
1481
|
...l,
|
|
1473
1482
|
children: T
|
|
1474
1483
|
}), t[30] = c, t[31] = l, t[32] = C, t[33] = w, t[34] = T, t[35] = h, t[36] = x, t[37] = _, t[38] = p, t[39] = E) : E = t[39];
|
|
1475
1484
|
let D;
|
|
1476
|
-
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(
|
|
1485
|
+
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(Ir, {
|
|
1477
1486
|
value: y,
|
|
1478
1487
|
children: E
|
|
1479
1488
|
}), t[40] = E, t[41] = y, t[42] = D) : D = t[42], D;
|
|
1480
1489
|
}
|
|
1481
1490
|
//#endregion
|
|
1482
1491
|
//#region src/lib/elements/Response.tsx
|
|
1483
|
-
var
|
|
1492
|
+
var Vr = class extends t.Component {
|
|
1484
1493
|
state = {
|
|
1485
1494
|
hasError: !1,
|
|
1486
1495
|
error: null
|
|
@@ -1503,7 +1512,7 @@ var Br = class extends t.Component {
|
|
|
1503
1512
|
let i;
|
|
1504
1513
|
t[3] === n ? i = t[4] : (i = k("size-full space-y-2 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", n), t[3] = n, t[4] = i);
|
|
1505
1514
|
let a;
|
|
1506
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(
|
|
1515
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(Vr, { children: /* @__PURE__ */ M(Br, {
|
|
1507
1516
|
className: i,
|
|
1508
1517
|
dir: "auto",
|
|
1509
1518
|
...r
|
|
@@ -1512,7 +1521,7 @@ var Br = class extends t.Component {
|
|
|
1512
1521
|
J.displayName = "Response";
|
|
1513
1522
|
//#endregion
|
|
1514
1523
|
//#region src/lib/ui/use-copy-feedback.ts
|
|
1515
|
-
function
|
|
1524
|
+
function Hr(e) {
|
|
1516
1525
|
let t = O(9), n = e === void 0 ? 2e3 : e, r = St(), [i, a] = g(!1), o = h(null), s, c;
|
|
1517
1526
|
t[0] === r ? (s = t[1], c = t[2]) : (s = () => () => {
|
|
1518
1527
|
o.current && r.clearTimeout(o.current);
|
|
@@ -1526,13 +1535,13 @@ function Vr(e) {
|
|
|
1526
1535
|
}
|
|
1527
1536
|
//#endregion
|
|
1528
1537
|
//#region src/lib/elements/code-block.tsx
|
|
1529
|
-
var
|
|
1538
|
+
var Ur = o({ code: "" }), Wr = (e) => {
|
|
1530
1539
|
let t = O(24), n, r, i, a, o, s;
|
|
1531
1540
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6]) : ({code: r, language: i, showLineNumbers: o, wrap: s, children: n, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s);
|
|
1532
1541
|
let c = o !== void 0 && o, l = s !== void 0 && s, u = Pe(r, i), d;
|
|
1533
1542
|
t[7] === r ? d = t[8] : (d = { code: r }, t[7] = r, t[8] = d);
|
|
1534
1543
|
let f;
|
|
1535
|
-
t[9] === u ? f = t[10] : (f = u.map(
|
|
1544
|
+
t[9] === u ? f = t[10] : (f = u.map(Kr), t[9] = u, t[10] = f);
|
|
1536
1545
|
let p;
|
|
1537
1546
|
t[11] !== c || t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Te, {
|
|
1538
1547
|
lineNumbers: c,
|
|
@@ -1548,12 +1557,12 @@ var Hr = o({ code: "" }), Ur = (e) => {
|
|
|
1548
1557
|
children: [p, m]
|
|
1549
1558
|
}), t[17] = a, t[18] = p, t[19] = m, t[20] = h) : h = t[20];
|
|
1550
1559
|
let g;
|
|
1551
|
-
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(
|
|
1560
|
+
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(Ur, {
|
|
1552
1561
|
value: d,
|
|
1553
1562
|
children: h
|
|
1554
1563
|
}), t[21] = d, t[22] = h, t[23] = g) : g = t[23], g;
|
|
1555
|
-
},
|
|
1556
|
-
let [o, s] =
|
|
1564
|
+
}, Gr = ({ onCopy: e, onError: t, timeout: n = 2e3, children: r, className: i, ...a }) => {
|
|
1565
|
+
let [o, s] = Hr(n), { code: c } = l(Ur), u = async () => {
|
|
1557
1566
|
if (typeof window > "u" || !navigator.clipboard.writeText) {
|
|
1558
1567
|
t?.(/* @__PURE__ */ Error("Clipboard API not available"));
|
|
1559
1568
|
return;
|
|
@@ -1573,12 +1582,12 @@ var Hr = o({ code: "" }), Ur = (e) => {
|
|
|
1573
1582
|
children: r ?? /* @__PURE__ */ M(d, {})
|
|
1574
1583
|
});
|
|
1575
1584
|
};
|
|
1576
|
-
function
|
|
1585
|
+
function Kr(e, t) {
|
|
1577
1586
|
return /* @__PURE__ */ M(Ee, { children: e }, t);
|
|
1578
1587
|
}
|
|
1579
1588
|
//#endregion
|
|
1580
1589
|
//#region src/lib/elements/Tool.tsx
|
|
1581
|
-
var
|
|
1590
|
+
var qr = (e) => {
|
|
1582
1591
|
let t = O(8), n, r;
|
|
1583
1592
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1584
1593
|
let i;
|
|
@@ -1588,7 +1597,7 @@ var Kr = (e) => {
|
|
|
1588
1597
|
className: i,
|
|
1589
1598
|
...r
|
|
1590
1599
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1591
|
-
},
|
|
1600
|
+
}, Jr = (e) => /* @__PURE__ */ N(me, {
|
|
1592
1601
|
className: "gap-1.5 rounded-full text-xs",
|
|
1593
1602
|
variant: "secondary",
|
|
1594
1603
|
children: [{
|
|
@@ -1608,7 +1617,7 @@ var Kr = (e) => {
|
|
|
1608
1617
|
"output-error": "Error",
|
|
1609
1618
|
"output-denied": "Denied"
|
|
1610
1619
|
}[e]]
|
|
1611
|
-
}),
|
|
1620
|
+
}), Yr = (e) => {
|
|
1612
1621
|
let t = O(23), n, r, i, a;
|
|
1613
1622
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({className: n, title: a, part: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
|
|
1614
1623
|
let o;
|
|
@@ -1623,7 +1632,7 @@ var Kr = (e) => {
|
|
|
1623
1632
|
children: c
|
|
1624
1633
|
}), t[11] = c, t[12] = l);
|
|
1625
1634
|
let u;
|
|
1626
|
-
t[13] === r.state ? u = t[14] : (u =
|
|
1635
|
+
t[13] === r.state ? u = t[14] : (u = Jr(r.state), t[13] = r.state, t[14] = u);
|
|
1627
1636
|
let d;
|
|
1628
1637
|
t[15] !== l || t[16] !== u ? (d = /* @__PURE__ */ N("div", {
|
|
1629
1638
|
className: "flex items-center gap-2",
|
|
@@ -1641,7 +1650,7 @@ var Kr = (e) => {
|
|
|
1641
1650
|
...i,
|
|
1642
1651
|
children: [d, f]
|
|
1643
1652
|
}), t[19] = i, t[20] = o, t[21] = d, t[22] = p) : p = t[22], p;
|
|
1644
|
-
},
|
|
1653
|
+
}, Xr = (e) => {
|
|
1645
1654
|
let t = O(8), n, r;
|
|
1646
1655
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1647
1656
|
let i;
|
|
@@ -1651,7 +1660,7 @@ var Kr = (e) => {
|
|
|
1651
1660
|
className: i,
|
|
1652
1661
|
...r
|
|
1653
1662
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1654
|
-
},
|
|
1663
|
+
}, Zr = (e) => {
|
|
1655
1664
|
let t = O(15), n, r, i;
|
|
1656
1665
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, input: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
1657
1666
|
let a;
|
|
@@ -1666,7 +1675,7 @@ var Kr = (e) => {
|
|
|
1666
1675
|
let c;
|
|
1667
1676
|
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M("div", {
|
|
1668
1677
|
className: "bg-muted/50 rounded-md",
|
|
1669
|
-
children: /* @__PURE__ */ M(
|
|
1678
|
+
children: /* @__PURE__ */ M(Wr, {
|
|
1670
1679
|
code: s,
|
|
1671
1680
|
language: "json"
|
|
1672
1681
|
})
|
|
@@ -1677,7 +1686,7 @@ var Kr = (e) => {
|
|
|
1677
1686
|
...i,
|
|
1678
1687
|
children: [o, c]
|
|
1679
1688
|
}), t[11] = i, t[12] = a, t[13] = c, t[14] = l) : l = t[14], l;
|
|
1680
|
-
},
|
|
1689
|
+
}, Qr = (e) => {
|
|
1681
1690
|
let t = O(24), n, r, i, a;
|
|
1682
1691
|
if (t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({className: n, output: i, errorText: r, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a), !(i || r)) return null;
|
|
1683
1692
|
let o;
|
|
@@ -1692,7 +1701,7 @@ var Kr = (e) => {
|
|
|
1692
1701
|
let d;
|
|
1693
1702
|
t[11] === r ? d = t[12] : (d = r && /* @__PURE__ */ M("div", { children: r }), t[11] = r, t[12] = d);
|
|
1694
1703
|
let f;
|
|
1695
|
-
t[13] === i ? f = t[14] : (f =
|
|
1704
|
+
t[13] === i ? f = t[14] : (f = $r(i), t[13] = i, t[14] = f);
|
|
1696
1705
|
let p;
|
|
1697
1706
|
t[15] !== u || t[16] !== d || t[17] !== f ? (p = /* @__PURE__ */ N("div", {
|
|
1698
1707
|
className: u,
|
|
@@ -1705,27 +1714,27 @@ var Kr = (e) => {
|
|
|
1705
1714
|
children: [c, p]
|
|
1706
1715
|
}), t[19] = a, t[20] = o, t[21] = c, t[22] = p, t[23] = m) : m = t[23], m;
|
|
1707
1716
|
};
|
|
1708
|
-
function
|
|
1709
|
-
return typeof e == "string" ? /* @__PURE__ */ M(
|
|
1717
|
+
function $r(e) {
|
|
1718
|
+
return typeof e == "string" ? /* @__PURE__ */ M(Wr, {
|
|
1710
1719
|
code: e,
|
|
1711
1720
|
language: "json"
|
|
1712
|
-
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(
|
|
1721
|
+
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(Wr, {
|
|
1713
1722
|
code: JSON.stringify(e, null, 2),
|
|
1714
1723
|
language: "json"
|
|
1715
1724
|
}) : typeof e == "number" || typeof e == "bigint" ? /* @__PURE__ */ M("div", { children: e }) : /* @__PURE__ */ M("div", {});
|
|
1716
1725
|
}
|
|
1717
1726
|
//#endregion
|
|
1718
1727
|
//#region src/lib/components/tool-debug.tsx
|
|
1719
|
-
function
|
|
1728
|
+
function ei(e) {
|
|
1720
1729
|
let t = O(20), { part: n } = e, r;
|
|
1721
1730
|
t[0] === n ? r = t[1] : (r = b(n), t[0] = n, t[1] = r);
|
|
1722
1731
|
let i = `Executing ${r}`, a;
|
|
1723
|
-
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(
|
|
1732
|
+
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(Yr, {
|
|
1724
1733
|
title: i,
|
|
1725
1734
|
part: n
|
|
1726
1735
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4];
|
|
1727
1736
|
let o;
|
|
1728
|
-
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(
|
|
1737
|
+
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(Zr, { input: n.input }), t[5] = n.input, t[6] = o);
|
|
1729
1738
|
let s;
|
|
1730
1739
|
t[7] === n.output ? s = t[8] : (s = typeof n.output == "string" ? n.output : JSON.stringify(n.output, null, 2), t[7] = n.output, t[8] = s);
|
|
1731
1740
|
let c;
|
|
@@ -1734,26 +1743,26 @@ function $r(e) {
|
|
|
1734
1743
|
children: s
|
|
1735
1744
|
}), t[9] = s, t[10] = c);
|
|
1736
1745
|
let l;
|
|
1737
|
-
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(
|
|
1746
|
+
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(Qr, {
|
|
1738
1747
|
output: c,
|
|
1739
1748
|
errorText: n.errorText
|
|
1740
1749
|
}), t[11] = n.errorText, t[12] = c, t[13] = l) : l = t[13];
|
|
1741
1750
|
let u;
|
|
1742
|
-
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(
|
|
1751
|
+
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(Xr, { children: [o, l] }), t[14] = o, t[15] = l, t[16] = u) : u = t[16];
|
|
1743
1752
|
let d;
|
|
1744
|
-
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(
|
|
1753
|
+
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(qr, {
|
|
1745
1754
|
"data-copy-exclude": "assistant-snapshot",
|
|
1746
1755
|
children: [a, u]
|
|
1747
1756
|
}), t[17] = a, t[18] = u, t[19] = d) : d = t[19], d;
|
|
1748
1757
|
}
|
|
1749
|
-
function
|
|
1758
|
+
function ti(e) {
|
|
1750
1759
|
let t = O(18), { part: n } = e, r = `Executing ${n.toolName}`, i;
|
|
1751
|
-
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
1760
|
+
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(Yr, {
|
|
1752
1761
|
title: r,
|
|
1753
1762
|
part: n
|
|
1754
1763
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
1755
1764
|
let a;
|
|
1756
|
-
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
1765
|
+
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(Zr, { input: n.input }), t[3] = n.input, t[4] = a);
|
|
1757
1766
|
let o;
|
|
1758
1767
|
t[5] === n.output ? o = t[6] : (o = typeof n.output == "string" ? n.output : JSON.stringify(n.output, null, 2), t[5] = n.output, t[6] = o);
|
|
1759
1768
|
let s;
|
|
@@ -1762,49 +1771,49 @@ function ei(e) {
|
|
|
1762
1771
|
children: o
|
|
1763
1772
|
}), t[7] = o, t[8] = s);
|
|
1764
1773
|
let c;
|
|
1765
|
-
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(
|
|
1774
|
+
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(Qr, {
|
|
1766
1775
|
output: s,
|
|
1767
1776
|
errorText: n.errorText
|
|
1768
1777
|
}), t[9] = n.errorText, t[10] = s, t[11] = c) : c = t[11];
|
|
1769
1778
|
let l;
|
|
1770
|
-
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(
|
|
1779
|
+
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(Xr, { children: [a, c] }), t[12] = a, t[13] = c, t[14] = l) : l = t[14];
|
|
1771
1780
|
let u;
|
|
1772
|
-
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(
|
|
1781
|
+
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(qr, {
|
|
1773
1782
|
"data-copy-exclude": "assistant-snapshot",
|
|
1774
1783
|
children: [i, l]
|
|
1775
1784
|
}), t[15] = i, t[16] = l, t[17] = u) : u = t[17], u;
|
|
1776
1785
|
}
|
|
1777
1786
|
//#endregion
|
|
1778
1787
|
//#region src/lib/copy/copy-image.ts
|
|
1779
|
-
var
|
|
1788
|
+
var ni = "data-copy-exclude", ri = {
|
|
1780
1789
|
image: "image",
|
|
1781
1790
|
assistantSnapshot: "assistant-snapshot"
|
|
1782
1791
|
};
|
|
1783
|
-
function
|
|
1792
|
+
function ii(e) {
|
|
1784
1793
|
return typeof e == "object" && !!e && "getAttribute" in e && typeof e.getAttribute == "function";
|
|
1785
1794
|
}
|
|
1786
|
-
function
|
|
1787
|
-
if (!
|
|
1788
|
-
let n = e.getAttribute(
|
|
1795
|
+
function ai(e, t) {
|
|
1796
|
+
if (!ii(e)) return !1;
|
|
1797
|
+
let n = e.getAttribute(ni);
|
|
1789
1798
|
return n ? n.split(/\s+/).includes(t) : !1;
|
|
1790
1799
|
}
|
|
1791
|
-
function
|
|
1792
|
-
return !
|
|
1800
|
+
function oi(e, t) {
|
|
1801
|
+
return !ai(e, t);
|
|
1793
1802
|
}
|
|
1794
|
-
function
|
|
1803
|
+
function si({ clipboard: e, ClipboardItem: t }) {
|
|
1795
1804
|
return typeof e?.write == "function" && typeof t == "function" ? "image" : typeof e?.writeText == "function" ? "text" : "none";
|
|
1796
1805
|
}
|
|
1797
1806
|
//#endregion
|
|
1798
1807
|
//#region src/lib/copy/snapshot-context.ts
|
|
1799
|
-
var
|
|
1808
|
+
var ci = o(!1);
|
|
1800
1809
|
//#endregion
|
|
1801
1810
|
//#region src/lib/copy/snapshot-render.tsx
|
|
1802
|
-
function
|
|
1811
|
+
function li() {
|
|
1803
1812
|
return new Promise((e) => {
|
|
1804
1813
|
requestAnimationFrame(() => e());
|
|
1805
1814
|
});
|
|
1806
1815
|
}
|
|
1807
|
-
function
|
|
1816
|
+
function ui(e) {
|
|
1808
1817
|
let t = O(9), { contentRef: n, children: r, width: i, padding: a, className: o } = e, s = i === void 0 ? 1120 : i, c = a === void 0 ? 24 : a, l = o === void 0 ? "bg-background text-foreground flex flex-col gap-3" : o;
|
|
1809
1818
|
if (typeof document > "u") return null;
|
|
1810
1819
|
let u;
|
|
@@ -1825,7 +1834,7 @@ function li(e) {
|
|
|
1825
1834
|
return t[4] !== r || t[5] !== l || t[6] !== n || t[7] !== d ? (f = Ct(/* @__PURE__ */ M("div", {
|
|
1826
1835
|
"aria-hidden": "true",
|
|
1827
1836
|
style: u,
|
|
1828
|
-
children: /* @__PURE__ */ M(
|
|
1837
|
+
children: /* @__PURE__ */ M(ci, {
|
|
1829
1838
|
value: !0,
|
|
1830
1839
|
children: /* @__PURE__ */ M("div", {
|
|
1831
1840
|
ref: n,
|
|
@@ -1838,13 +1847,13 @@ function li(e) {
|
|
|
1838
1847
|
}
|
|
1839
1848
|
//#endregion
|
|
1840
1849
|
//#region src/lib/copy/use-copy-element-as-image.ts
|
|
1841
|
-
function
|
|
1850
|
+
function di(e) {
|
|
1842
1851
|
let t = getComputedStyle(e).backgroundColor;
|
|
1843
1852
|
if (t !== "rgba(0, 0, 0, 0)") return t;
|
|
1844
1853
|
let n = getComputedStyle(document.body).backgroundColor;
|
|
1845
1854
|
return n === "rgba(0, 0, 0, 0)" ? void 0 : n;
|
|
1846
1855
|
}
|
|
1847
|
-
function
|
|
1856
|
+
function fi({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
1848
1857
|
let r = St(), [i, a] = g(!1), [o, s] = g(null), c = h(null), l = u(() => {
|
|
1849
1858
|
c.current !== null && (r.clearTimeout(c.current), c.current = null);
|
|
1850
1859
|
}, [r]), f = u((e) => {
|
|
@@ -1861,9 +1870,9 @@ function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1861
1870
|
}), !0), [n, f]), m = u(async () => {
|
|
1862
1871
|
if (!e.current) throw Error("Nothing is ready to copy yet.");
|
|
1863
1872
|
let { toBlob: n } = await import("html-to-image"), r = await n(e.current, {
|
|
1864
|
-
backgroundColor:
|
|
1873
|
+
backgroundColor: di(e.current),
|
|
1865
1874
|
pixelRatio: 2,
|
|
1866
|
-
filter: (e) =>
|
|
1875
|
+
filter: (e) => oi(e, t)
|
|
1867
1876
|
});
|
|
1868
1877
|
if (!r) throw Error("Unable to render the image for copying.");
|
|
1869
1878
|
await navigator.clipboard.write([new ClipboardItem({ [r.type]: r })]), f({
|
|
@@ -1879,7 +1888,7 @@ function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1879
1888
|
copy: u(async () => {
|
|
1880
1889
|
a(!0), s(null);
|
|
1881
1890
|
try {
|
|
1882
|
-
let e =
|
|
1891
|
+
let e = si({
|
|
1883
1892
|
clipboard: typeof navigator > "u" ? void 0 : navigator.clipboard,
|
|
1884
1893
|
ClipboardItem: typeof window > "u" ? void 0 : window.ClipboardItem
|
|
1885
1894
|
});
|
|
@@ -1914,29 +1923,30 @@ function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1914
1923
|
}
|
|
1915
1924
|
//#endregion
|
|
1916
1925
|
//#region src/lib/copy/assistant-snapshot.tsx
|
|
1917
|
-
function
|
|
1918
|
-
|
|
1926
|
+
function pi(e) {
|
|
1927
|
+
let t = tn(e), n = e.parts.filter(C).map((e) => en(e.text, H(e.citations)).reverse().reduce((e, { at: n, citation: r }) => `${e.slice(0, n)}[${nn(t, r.source.url)}]${e.slice(n)}`, e.text)).join("\n");
|
|
1928
|
+
return t.length === 0 ? n : `${n}\n\n${t.map(({ url: e, title: t }, n) => `[${n + 1}] ${t ? `${t} — ` : ""}${e}`).join("\n")}`;
|
|
1919
1929
|
}
|
|
1920
1930
|
function Y() {
|
|
1921
|
-
return l(
|
|
1931
|
+
return l(ci);
|
|
1922
1932
|
}
|
|
1923
|
-
function
|
|
1933
|
+
function mi(e) {
|
|
1924
1934
|
let t = O(30), { message: n, renderContent: r, className: i } = e, a = h(null), [o, s] = g(!1), c;
|
|
1925
|
-
t[0] === n ? c = t[1] : (c =
|
|
1935
|
+
t[0] === n ? c = t[1] : (c = pi(n), t[0] = n, t[1] = c);
|
|
1926
1936
|
let l = c, u;
|
|
1927
1937
|
t[2] === l ? u = t[3] : (u = {
|
|
1928
1938
|
elementRef: a,
|
|
1929
|
-
excludeMode:
|
|
1939
|
+
excludeMode: ri.assistantSnapshot,
|
|
1930
1940
|
fallbackText: l
|
|
1931
1941
|
}, t[2] = l, t[3] = u);
|
|
1932
|
-
let { copy: d, feedback: f, isCopying: p } =
|
|
1942
|
+
let { copy: d, feedback: f, isCopying: p } = fi(u), m;
|
|
1933
1943
|
t[4] !== d || t[5] !== o ? (m = async () => {
|
|
1934
|
-
o || s(!0), await
|
|
1944
|
+
o || s(!0), await li(), await d();
|
|
1935
1945
|
}, t[4] = d, t[5] = o, t[6] = m) : m = t[6];
|
|
1936
1946
|
let _ = m, v = "Copy snapshot";
|
|
1937
1947
|
p ? v = "Copying snapshot" : f?.kind === "success" && (v = f.mode === "image" ? "Copied snapshot" : "Copied text");
|
|
1938
1948
|
let y;
|
|
1939
|
-
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(
|
|
1949
|
+
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(ui, {
|
|
1940
1950
|
contentRef: a,
|
|
1941
1951
|
children: r()
|
|
1942
1952
|
}), t[7] = r, t[8] = o, t[9] = y) : y = t[9];
|
|
@@ -1972,41 +1982,41 @@ function pi(e) {
|
|
|
1972
1982
|
}
|
|
1973
1983
|
//#endregion
|
|
1974
1984
|
//#region src/lib/tools/helpers.ts
|
|
1975
|
-
function
|
|
1985
|
+
function hi(e) {
|
|
1976
1986
|
return w(e) && e.toolMetadata?.kind === "subagent";
|
|
1977
1987
|
}
|
|
1978
|
-
function
|
|
1988
|
+
function gi(e) {
|
|
1979
1989
|
let t = e.toolMetadata?.displayName;
|
|
1980
1990
|
return typeof t == "string" ? t : "Subagent";
|
|
1981
1991
|
}
|
|
1982
|
-
function
|
|
1992
|
+
function _i(e, t) {
|
|
1983
1993
|
let n = y(e);
|
|
1984
1994
|
return {
|
|
1985
1995
|
toolKey: n,
|
|
1986
1996
|
toolEntry: t?.[n]
|
|
1987
1997
|
};
|
|
1988
1998
|
}
|
|
1989
|
-
function
|
|
1999
|
+
function vi(e, t) {
|
|
1990
2000
|
return e?.static === !1 && !!e?.requiresUserInput && t === "input-available";
|
|
1991
2001
|
}
|
|
1992
2002
|
//#endregion
|
|
1993
2003
|
//#region src/lib/chat/markdown-paragraph.tsx
|
|
1994
|
-
var
|
|
1995
|
-
function
|
|
2004
|
+
var yi = /* @__PURE__ */ new Set(/* @__PURE__ */ "a.abbr.b.bdi.bdo.br.cite.code.data.del.dfn.em.i.ins.kbd.mark.q.s.samp.small.span.strong.sub.sup.time.u.var.wbr".split("."));
|
|
2005
|
+
function bi(e) {
|
|
1996
2006
|
if (!n.isValidElement(e)) return !1;
|
|
1997
2007
|
let t = typeof e.type == "string" ? e.type : e.props.node?.tagName;
|
|
1998
|
-
return t === void 0 || !
|
|
2008
|
+
return t === void 0 || !yi.has(t);
|
|
1999
2009
|
}
|
|
2000
|
-
function
|
|
2010
|
+
function xi(e) {
|
|
2001
2011
|
let t = O(6), { children: r, dir: i } = e, a = n.Children.toArray(r);
|
|
2002
|
-
if (!a.some(
|
|
2012
|
+
if (!a.some(bi)) {
|
|
2003
2013
|
let e;
|
|
2004
2014
|
return t[0] !== r || t[1] !== i ? (e = /* @__PURE__ */ M("p", {
|
|
2005
2015
|
dir: i,
|
|
2006
2016
|
children: r
|
|
2007
2017
|
}), t[0] = r, t[1] = i, t[2] = e) : e = t[2], e;
|
|
2008
2018
|
}
|
|
2009
|
-
if (a.every(
|
|
2019
|
+
if (a.every(bi)) return r;
|
|
2010
2020
|
let o;
|
|
2011
2021
|
return t[3] !== r || t[4] !== i ? (o = /* @__PURE__ */ M("div", {
|
|
2012
2022
|
dir: i,
|
|
@@ -2015,25 +2025,25 @@ function bi(e) {
|
|
|
2015
2025
|
}
|
|
2016
2026
|
//#endregion
|
|
2017
2027
|
//#region src/lib/components/InteractiveResponse.tsx
|
|
2018
|
-
var
|
|
2028
|
+
var Si = { p: ({ children: e, dir: t }) => /* @__PURE__ */ M(xi, {
|
|
2019
2029
|
dir: t,
|
|
2020
2030
|
children: e
|
|
2021
2031
|
}) };
|
|
2022
|
-
function
|
|
2023
|
-
let t = { ...
|
|
2032
|
+
function Ci(e) {
|
|
2033
|
+
let t = { ...Si }, n = {};
|
|
2024
2034
|
for (let r of e) ae(r), t[r.name] = r.component, n[r.name] = r.allowedAttributes;
|
|
2025
2035
|
return {
|
|
2026
2036
|
components: t,
|
|
2027
2037
|
allowedTags: n
|
|
2028
2038
|
};
|
|
2029
2039
|
}
|
|
2030
|
-
function
|
|
2040
|
+
function wi(e) {
|
|
2031
2041
|
let t = O(10), n, r;
|
|
2032
2042
|
t[0] === e ? (n = t[1], r = t[2]) : ({elements: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
2033
2043
|
let i;
|
|
2034
2044
|
t[3] === n ? i = t[4] : (i = n ?? [], t[3] = n, t[4] = i);
|
|
2035
2045
|
let a;
|
|
2036
|
-
t[5] === i ? a = t[6] : (a =
|
|
2046
|
+
t[5] === i ? a = t[6] : (a = Ci(i), t[5] = i, t[6] = a);
|
|
2037
2047
|
let o = a, s;
|
|
2038
2048
|
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(J, {
|
|
2039
2049
|
...o,
|
|
@@ -2042,8 +2052,8 @@ function Ci(e) {
|
|
|
2042
2052
|
}
|
|
2043
2053
|
//#endregion
|
|
2044
2054
|
//#region src/lib/renderers/render-part.tsx
|
|
2045
|
-
function
|
|
2046
|
-
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } =
|
|
2055
|
+
function Ti(e) {
|
|
2056
|
+
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } = V();
|
|
2047
2057
|
if (n.state !== "approval-requested") return null;
|
|
2048
2058
|
let i;
|
|
2049
2059
|
t[0] === n ? i = t[1] : (i = n.title ?? y(n), t[0] = n, t[1] = i);
|
|
@@ -2095,21 +2105,21 @@ function wi(e) {
|
|
|
2095
2105
|
children: [l, f]
|
|
2096
2106
|
}), t[18] = o, t[19] = l, t[20] = f, t[21] = p) : p = t[21], p;
|
|
2097
2107
|
}
|
|
2098
|
-
function
|
|
2108
|
+
function Ei(e) {
|
|
2099
2109
|
let t = O(25), { part: n } = e, { registry: r } = z();
|
|
2100
2110
|
if (n.input === void 0) {
|
|
2101
2111
|
let e;
|
|
2102
|
-
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(
|
|
2112
|
+
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(Qr, {
|
|
2103
2113
|
output: n.output,
|
|
2104
2114
|
errorText: n.errorText
|
|
2105
2115
|
}) : /* @__PURE__ */ M(Xe, { className: "size-4 animate-spin" }), t[0] = n.errorText, t[1] = n.output, t[2] = n.state, t[3] = e) : e = t[3], e;
|
|
2106
2116
|
}
|
|
2107
2117
|
let i;
|
|
2108
|
-
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(
|
|
2118
|
+
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(Ti, { part: n }), t[4] = n, t[5] = i);
|
|
2109
2119
|
let a = i;
|
|
2110
2120
|
if (!r) return a;
|
|
2111
2121
|
let o;
|
|
2112
|
-
t[6] !== n || t[7] !== r ? (o =
|
|
2122
|
+
t[6] !== n || t[7] !== r ? (o = _i(n, r), t[6] = n, t[7] = r, t[8] = o) : o = t[8];
|
|
2113
2123
|
let { toolEntry: s } = o;
|
|
2114
2124
|
if (s) {
|
|
2115
2125
|
let e = s.component, i;
|
|
@@ -2134,8 +2144,8 @@ function Ti(e) {
|
|
|
2134
2144
|
}
|
|
2135
2145
|
//#endregion
|
|
2136
2146
|
//#region src/lib/chat/message-parts.tsx
|
|
2137
|
-
var
|
|
2138
|
-
function
|
|
2147
|
+
var Di = { animation: "slideUp" };
|
|
2148
|
+
function Oi(e) {
|
|
2139
2149
|
let t = O(3), { filename: n, url: r } = e, i = n ?? "Attached image", a;
|
|
2140
2150
|
return t[0] !== i || t[1] !== r ? (a = /* @__PURE__ */ M("img", {
|
|
2141
2151
|
src: r,
|
|
@@ -2143,7 +2153,7 @@ function Di(e) {
|
|
|
2143
2153
|
className: "max-h-64 rounded-md border object-contain"
|
|
2144
2154
|
}), t[0] = i, t[1] = r, t[2] = a) : a = t[2], a;
|
|
2145
2155
|
}
|
|
2146
|
-
function
|
|
2156
|
+
function ki(e) {
|
|
2147
2157
|
let t = O(16), { filename: n, mediaType: r, url: i } = e, a = n || "Untitled", o;
|
|
2148
2158
|
t[0] !== r || t[1] !== a || t[2] !== i ? (o = i?.startsWith("data:") ? null : i && r.startsWith("video/") ? /* @__PURE__ */ M("video", {
|
|
2149
2159
|
controls: !0,
|
|
@@ -2189,30 +2199,27 @@ function Oi(e) {
|
|
|
2189
2199
|
children: [s, d]
|
|
2190
2200
|
}), t[13] = s, t[14] = d, t[15] = f) : f = t[15], f;
|
|
2191
2201
|
}
|
|
2192
|
-
function
|
|
2202
|
+
function Ai(e) {
|
|
2193
2203
|
let t = O(4), { filename: n, mediaType: r, url: i } = e, a;
|
|
2194
|
-
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(
|
|
2204
|
+
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(Oi, {
|
|
2195
2205
|
filename: n,
|
|
2196
2206
|
url: i
|
|
2197
|
-
}) : /* @__PURE__ */ M(
|
|
2207
|
+
}) : /* @__PURE__ */ M(ki, {
|
|
2198
2208
|
filename: n,
|
|
2199
2209
|
mediaType: r,
|
|
2200
2210
|
url: i
|
|
2201
2211
|
}), t[0] = n, t[1] = r, t[2] = i, t[3] = a) : a = t[3], a;
|
|
2202
2212
|
}
|
|
2203
|
-
var
|
|
2204
|
-
function
|
|
2205
|
-
return t.
|
|
2206
|
-
at: t.endIndex ?? e.length,
|
|
2207
|
-
order: n
|
|
2208
|
-
})).sort((e, t) => t.at - e.at || t.order - e.order).reduce((e, { at: t, order: n }) => `${e.slice(0, t)}<${Ai} citation="${n}" />${e.slice(t)}`, e);
|
|
2213
|
+
var ji = "genai-citation";
|
|
2214
|
+
function Mi(e, t) {
|
|
2215
|
+
return en(e, t).reverse().reduce((e, { at: t, order: n }) => `${e.slice(0, t)}<${ji} citation="${n}" />${e.slice(t)}`, e);
|
|
2209
2216
|
}
|
|
2210
|
-
var
|
|
2211
|
-
function
|
|
2212
|
-
let t = O(16), n = l(
|
|
2217
|
+
var Ni = o(null);
|
|
2218
|
+
function Pi(e) {
|
|
2219
|
+
let t = O(16), n = l(Ni), r = n?.citations[Number(e.citation)];
|
|
2213
2220
|
if (!n || !r) return null;
|
|
2214
2221
|
let i;
|
|
2215
|
-
t[0] !== r.source.url || t[1] !== n.sources ? (i =
|
|
2222
|
+
t[0] !== r.source.url || t[1] !== n.sources ? (i = nn(n.sources, r.source.url), t[0] = r.source.url, t[1] = n.sources, t[2] = i) : i = t[2];
|
|
2216
2223
|
let a = i;
|
|
2217
2224
|
if (a === null) return null;
|
|
2218
2225
|
if (n.HostCitation) {
|
|
@@ -2233,38 +2240,38 @@ function Ni(e) {
|
|
|
2233
2240
|
children: r.citedText
|
|
2234
2241
|
}) : null, t[10] = r.citedText, t[11] = s);
|
|
2235
2242
|
let c;
|
|
2236
|
-
return t[12] !== a || t[13] !== o || t[14] !== s ? (c = /* @__PURE__ */ M(
|
|
2243
|
+
return t[12] !== a || t[13] !== o || t[14] !== s ? (c = /* @__PURE__ */ M(Qn, {
|
|
2237
2244
|
source: o,
|
|
2238
2245
|
index: a,
|
|
2239
2246
|
children: s
|
|
2240
2247
|
}), t[12] = a, t[13] = o, t[14] = s, t[15] = c) : c = t[15], c;
|
|
2241
2248
|
}
|
|
2242
|
-
var
|
|
2243
|
-
name:
|
|
2249
|
+
var Fi = {
|
|
2250
|
+
name: ji,
|
|
2244
2251
|
allowedAttributes: ["citation"],
|
|
2245
|
-
component:
|
|
2252
|
+
component: Pi
|
|
2246
2253
|
};
|
|
2247
|
-
function
|
|
2248
|
-
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } =
|
|
2249
|
-
t[0] === r ? u = t[1] : (u =
|
|
2254
|
+
function Ii(e) {
|
|
2255
|
+
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } = Qt(), s = Y(), { citation: c } = W(), { message: l } = K(), u;
|
|
2256
|
+
t[0] === r ? u = t[1] : (u = H(r), t[0] = r, t[1] = u);
|
|
2250
2257
|
let d = u, f;
|
|
2251
|
-
t[2] ===
|
|
2258
|
+
t[2] === l ? f = t[3] : (f = tn(l), t[2] = l, t[3] = f);
|
|
2252
2259
|
let p;
|
|
2253
|
-
t[4] !==
|
|
2260
|
+
t[4] !== c || t[5] !== f || t[6] !== d ? (p = {
|
|
2254
2261
|
citations: d,
|
|
2255
2262
|
sources: f,
|
|
2256
|
-
HostCitation:
|
|
2257
|
-
}, t[4] =
|
|
2263
|
+
HostCitation: c
|
|
2264
|
+
}, t[4] = c, t[5] = f, t[6] = d, t[7] = p) : p = t[7];
|
|
2258
2265
|
let m = p, h = d.length > 0, g;
|
|
2259
|
-
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [],
|
|
2266
|
+
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [], Fi] : i, t[8] = i, t[9] = h, t[10] = g) : g = t[10];
|
|
2260
2267
|
let _ = g, v;
|
|
2261
2268
|
t[11] === a ? v = t[12] : (v = k("text-sm", a), t[11] = a, t[12] = v);
|
|
2262
2269
|
let y = !s && o === "streaming", b;
|
|
2263
|
-
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ?
|
|
2270
|
+
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ? Mi(n, d) : n, t[13] = h, t[14] = n, t[15] = d, t[16] = b) : b = t[16];
|
|
2264
2271
|
let x;
|
|
2265
|
-
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(
|
|
2272
|
+
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(wi, {
|
|
2266
2273
|
elements: _,
|
|
2267
|
-
animated:
|
|
2274
|
+
animated: Di,
|
|
2268
2275
|
isAnimating: y,
|
|
2269
2276
|
children: b
|
|
2270
2277
|
}), t[17] = y, t[18] = b, t[19] = _, t[20] = x) : x = t[20];
|
|
@@ -2274,40 +2281,40 @@ function Fi(e) {
|
|
|
2274
2281
|
children: x
|
|
2275
2282
|
}), t[21] = v, t[22] = x, t[23] = S) : S = t[23];
|
|
2276
2283
|
let C;
|
|
2277
|
-
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(
|
|
2284
|
+
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(Ni, {
|
|
2278
2285
|
value: m,
|
|
2279
2286
|
children: S
|
|
2280
2287
|
}), t[24] = m, t[25] = S, t[26] = C) : C = t[26], C;
|
|
2281
2288
|
}
|
|
2282
|
-
function
|
|
2283
|
-
let t = O(8), { part: n } = e, r =
|
|
2284
|
-
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M(
|
|
2289
|
+
function Li(e) {
|
|
2290
|
+
let t = O(8), { part: n } = e, r = Ri(), i;
|
|
2291
|
+
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M(ei, { part: n }), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
2285
2292
|
let a;
|
|
2286
|
-
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
2293
|
+
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(Ei, { part: n }), t[3] = n, t[4] = a);
|
|
2287
2294
|
let o;
|
|
2288
2295
|
return t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(j, { children: [i, a] }), t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
|
|
2289
2296
|
}
|
|
2290
|
-
function
|
|
2297
|
+
function Ri() {
|
|
2291
2298
|
let { debugMode: e } = z(), t = Y();
|
|
2292
2299
|
return !!e && !t;
|
|
2293
2300
|
}
|
|
2294
2301
|
//#endregion
|
|
2295
2302
|
//#region src/lib/chat/trajectory/tool-label.tsx
|
|
2296
|
-
function
|
|
2303
|
+
function zi(e) {
|
|
2297
2304
|
return !!e && e !== "output-available";
|
|
2298
2305
|
}
|
|
2299
|
-
function
|
|
2306
|
+
function Bi(e) {
|
|
2300
2307
|
let t = O(5), { label: n, part: r, state: i } = e, a = Y(), o;
|
|
2301
|
-
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !
|
|
2308
|
+
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !zi(i), t[0] = a, t[1] = n, t[2] = r, t[3] = i, t[4] = o) : o = t[4], o;
|
|
2302
2309
|
}
|
|
2303
|
-
function
|
|
2310
|
+
function Vi(e) {
|
|
2304
2311
|
let t = O(18), { label: n, part: r } = e, i = n.icon, a = n.actions, o;
|
|
2305
2312
|
t[0] !== n || t[1] !== r ? (o = {
|
|
2306
2313
|
label: n,
|
|
2307
2314
|
part: r,
|
|
2308
2315
|
state: r.state
|
|
2309
2316
|
}, t[0] = n, t[1] = r, t[2] = o) : o = t[2];
|
|
2310
|
-
let s =
|
|
2317
|
+
let s = Bi(o), c;
|
|
2311
2318
|
t[3] !== i || t[4] !== n.isError ? (c = i && /* @__PURE__ */ M(i, { className: k("size-3.5", n.isError ? "text-destructive" : "text-muted-foreground") }), t[3] = i, t[4] = n.isError, t[5] = c) : c = t[5];
|
|
2312
2319
|
let l;
|
|
2313
2320
|
t[6] === n.name ? l = t[7] : (l = /* @__PURE__ */ M("span", {
|
|
@@ -2327,7 +2334,7 @@ function Bi(e) {
|
|
|
2327
2334
|
children: [u, d]
|
|
2328
2335
|
}), t[15] = u, t[16] = d, t[17] = f) : f = t[17], f;
|
|
2329
2336
|
}
|
|
2330
|
-
function
|
|
2337
|
+
function Hi(e) {
|
|
2331
2338
|
let t = O(3), { name: n, value: r } = e, i;
|
|
2332
2339
|
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ N("span", {
|
|
2333
2340
|
"data-slot": "tool-arg",
|
|
@@ -2339,15 +2346,15 @@ function Vi(e) {
|
|
|
2339
2346
|
]
|
|
2340
2347
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2341
2348
|
}
|
|
2342
|
-
function
|
|
2349
|
+
function Ui(e) {
|
|
2343
2350
|
let t = O(23), { label: n, state: r, part: i, children: a } = e, o = n.actions, s;
|
|
2344
2351
|
t[0] !== n || t[1] !== i || t[2] !== r ? (s = {
|
|
2345
2352
|
label: n,
|
|
2346
2353
|
part: i,
|
|
2347
2354
|
state: r
|
|
2348
2355
|
}, t[0] = n, t[1] = i, t[2] = r, t[3] = s) : s = t[3];
|
|
2349
|
-
let c =
|
|
2350
|
-
t[4] === n.args ? l = t[5] : (l = n.args ? Object.entries(n.args).map(
|
|
2356
|
+
let c = Bi(s), l;
|
|
2357
|
+
t[4] === n.args ? l = t[5] : (l = n.args ? Object.entries(n.args).map(Wi) : "...", t[4] = n.args, t[5] = l);
|
|
2351
2358
|
let u;
|
|
2352
2359
|
t[6] !== a || t[7] !== n.name || t[8] !== l ? (u = /* @__PURE__ */ N("span", {
|
|
2353
2360
|
className: "text-muted-foreground min-w-0 truncate font-mono text-xs [&>[data-slot=tool-arg]+[data-slot=tool-arg]]:before:mr-1 [&>[data-slot=tool-arg]+[data-slot=tool-arg]]:before:content-[',']",
|
|
@@ -2380,25 +2387,25 @@ function Hi(e) {
|
|
|
2380
2387
|
children: [f, p]
|
|
2381
2388
|
}), t[20] = f, t[21] = p, t[22] = m) : m = t[22], m;
|
|
2382
2389
|
}
|
|
2383
|
-
function
|
|
2390
|
+
function Wi(e) {
|
|
2384
2391
|
let [t, n] = e;
|
|
2385
|
-
return /* @__PURE__ */ M(
|
|
2392
|
+
return /* @__PURE__ */ M(Hi, {
|
|
2386
2393
|
name: t,
|
|
2387
2394
|
value: n
|
|
2388
2395
|
}, t);
|
|
2389
2396
|
}
|
|
2390
2397
|
//#endregion
|
|
2391
2398
|
//#region src/lib/chat/trajectory/segments/index.tsx
|
|
2392
|
-
function
|
|
2399
|
+
function Gi(e) {
|
|
2393
2400
|
return e.type === "text" && e.providerMetadata?.openai?.phase === "commentary";
|
|
2394
2401
|
}
|
|
2395
|
-
function
|
|
2402
|
+
function Ki(e) {
|
|
2396
2403
|
let t = O(9), { segment: n, elements: r, className: i } = e, a;
|
|
2397
2404
|
if (t[0] !== i || t[1] !== r || t[2] !== n.parts) {
|
|
2398
2405
|
let e;
|
|
2399
2406
|
t[4] !== i || t[5] !== r ? (e = (e) => {
|
|
2400
2407
|
let { part: t, idx: n } = e;
|
|
2401
|
-
return t.type === "text" ? /* @__PURE__ */ M(
|
|
2408
|
+
return t.type === "text" ? /* @__PURE__ */ M(Ii, {
|
|
2402
2409
|
text: t.text,
|
|
2403
2410
|
citations: t.citations,
|
|
2404
2411
|
elements: r,
|
|
@@ -2409,27 +2416,27 @@ function Gi(e) {
|
|
|
2409
2416
|
let o;
|
|
2410
2417
|
return t[7] === a ? o = t[8] : (o = /* @__PURE__ */ M(j, { children: a }), t[7] = a, t[8] = o), o;
|
|
2411
2418
|
}
|
|
2412
|
-
function
|
|
2419
|
+
function qi(e) {
|
|
2413
2420
|
let t = O(4), { segment: n } = e, { part: r } = n;
|
|
2414
2421
|
if (r.type !== "file") return null;
|
|
2415
2422
|
let i;
|
|
2416
|
-
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(
|
|
2423
|
+
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(Ai, {
|
|
2417
2424
|
filename: r.filename,
|
|
2418
2425
|
mediaType: r.mediaType,
|
|
2419
2426
|
url: r.url
|
|
2420
2427
|
}), t[0] = r.filename, t[1] = r.mediaType, t[2] = r.url, t[3] = i) : i = t[3], i;
|
|
2421
2428
|
}
|
|
2422
|
-
function
|
|
2423
|
-
let t = O(9), { segment: n } = e, {
|
|
2424
|
-
t[0] === r ? i = t[1] : (i =
|
|
2429
|
+
function Ji(e) {
|
|
2430
|
+
let t = O(9), { segment: n } = e, { message: r } = K(), i;
|
|
2431
|
+
t[0] === r ? i = t[1] : (i = tn(r), t[0] = r, t[1] = i);
|
|
2425
2432
|
let a = i, o;
|
|
2426
2433
|
if (t[2] !== n.parts || t[3] !== a) {
|
|
2427
2434
|
let e;
|
|
2428
2435
|
t[5] === a ? e = t[6] : (e = (e) => {
|
|
2429
2436
|
let { part: t, idx: n } = e;
|
|
2430
2437
|
if (t.type !== "source-url") return null;
|
|
2431
|
-
let r =
|
|
2432
|
-
return r === null ? null : /* @__PURE__ */ M(
|
|
2438
|
+
let r = nn(a, t.url);
|
|
2439
|
+
return r === null ? null : /* @__PURE__ */ M(Qn, {
|
|
2433
2440
|
source: {
|
|
2434
2441
|
url: t.url,
|
|
2435
2442
|
title: t.title
|
|
@@ -2441,7 +2448,7 @@ function qi(e) {
|
|
|
2441
2448
|
let s;
|
|
2442
2449
|
return t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M("span", { children: o }), t[7] = o, t[8] = s), s;
|
|
2443
2450
|
}
|
|
2444
|
-
function
|
|
2451
|
+
function Yi(e) {
|
|
2445
2452
|
let t = O(3), { segment: n } = e, r = G();
|
|
2446
2453
|
if (Y()) return null;
|
|
2447
2454
|
let { part: i } = n;
|
|
@@ -2450,31 +2457,31 @@ function Ji(e) {
|
|
|
2450
2457
|
return t[0] !== i.text || t[1] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
2451
2458
|
className: "text-muted-foreground text-xs",
|
|
2452
2459
|
children: /* @__PURE__ */ M(J, {
|
|
2453
|
-
animated:
|
|
2460
|
+
animated: Di,
|
|
2454
2461
|
isAnimating: a,
|
|
2455
2462
|
children: i.text
|
|
2456
2463
|
})
|
|
2457
2464
|
}), t[0] = i.text, t[1] = a, t[2] = o) : o = t[2], o;
|
|
2458
2465
|
}
|
|
2459
|
-
function
|
|
2466
|
+
function Xi(e) {
|
|
2460
2467
|
let t = O(2), { segment: n } = e;
|
|
2461
|
-
if (!
|
|
2468
|
+
if (!Ri()) return null;
|
|
2462
2469
|
let { part: r } = n;
|
|
2463
2470
|
if (r.type !== "dynamic-tool") return null;
|
|
2464
2471
|
let i;
|
|
2465
|
-
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(
|
|
2472
|
+
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(ti, { part: r }), t[0] = r, t[1] = i), i;
|
|
2466
2473
|
}
|
|
2467
|
-
var
|
|
2468
|
-
function
|
|
2469
|
-
let e = l(
|
|
2474
|
+
var Zi = o(null), Qi = o(null);
|
|
2475
|
+
function $i() {
|
|
2476
|
+
let e = l(Zi);
|
|
2470
2477
|
if (!e) throw Error("Segment.Tool* parts must be rendered within Segment.Tool");
|
|
2471
2478
|
return e;
|
|
2472
2479
|
}
|
|
2473
|
-
function
|
|
2480
|
+
function ea(e) {
|
|
2474
2481
|
let t = O(29), { segment: n, children: r } = e, i = z(), a = G(), { part: o } = n;
|
|
2475
2482
|
if (!S(o)) return null;
|
|
2476
2483
|
let s, c, l, u;
|
|
2477
|
-
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} =
|
|
2484
|
+
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} = _i(o, i.registry), c = vi(u, o.state), s = !c && on(o, a), l = u?.label?.(o), t[0] = i.registry, t[1] = a, t[2] = o, t[3] = s, t[4] = c, t[5] = l, t[6] = u) : (s = t[3], c = t[4], l = t[5], u = t[6]);
|
|
2478
2485
|
let d = l, f;
|
|
2479
2486
|
t[7] !== s || t[8] !== d || t[9] !== o ? (f = s ? {
|
|
2480
2487
|
...d ?? { name: y(o) },
|
|
@@ -2496,37 +2503,37 @@ function $i(e) {
|
|
|
2496
2503
|
aborted: s
|
|
2497
2504
|
}, t[17] = s, t[18] = p, t[19] = o.state, t[20] = g) : g = t[20];
|
|
2498
2505
|
let _;
|
|
2499
|
-
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(
|
|
2506
|
+
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(na, {}), t[21] = r, t[22] = _);
|
|
2500
2507
|
let v;
|
|
2501
|
-
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(
|
|
2508
|
+
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(Qi, {
|
|
2502
2509
|
value: g,
|
|
2503
2510
|
children: _
|
|
2504
2511
|
}), t[23] = g, t[24] = _, t[25] = v) : v = t[25];
|
|
2505
2512
|
let b;
|
|
2506
|
-
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(
|
|
2513
|
+
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(Zi, {
|
|
2507
2514
|
value: h,
|
|
2508
2515
|
children: v
|
|
2509
2516
|
}), t[26] = h, t[27] = v, t[28] = b) : b = t[28], b;
|
|
2510
2517
|
}
|
|
2511
|
-
function
|
|
2512
|
-
let e = O(2), { part: t, activeClientInput: n } =
|
|
2518
|
+
function ta() {
|
|
2519
|
+
let e = O(2), { part: t, activeClientInput: n } = $i();
|
|
2513
2520
|
if (n) return null;
|
|
2514
2521
|
let r;
|
|
2515
|
-
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(
|
|
2522
|
+
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(Li, { part: t }), e[0] = t, e[1] = r), r;
|
|
2516
2523
|
}
|
|
2517
|
-
function
|
|
2518
|
-
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } =
|
|
2524
|
+
function na(e) {
|
|
2525
|
+
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } = $i();
|
|
2519
2526
|
if (!i) {
|
|
2520
2527
|
let e;
|
|
2521
2528
|
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M("div", {
|
|
2522
2529
|
className: "min-w-0 flex-1",
|
|
2523
|
-
children: /* @__PURE__ */ M(
|
|
2530
|
+
children: /* @__PURE__ */ M(ta, {})
|
|
2524
2531
|
}), t[0] = e) : e = t[0], e;
|
|
2525
2532
|
}
|
|
2526
2533
|
let o;
|
|
2527
2534
|
t[1] !== n || t[2] !== i || t[3] !== r ? (o = /* @__PURE__ */ M(L, {
|
|
2528
2535
|
className: "cursor-pointer",
|
|
2529
|
-
children: /* @__PURE__ */ M(
|
|
2536
|
+
children: /* @__PURE__ */ M(Ui, {
|
|
2530
2537
|
label: i,
|
|
2531
2538
|
state: r.state,
|
|
2532
2539
|
part: r,
|
|
@@ -2536,7 +2543,7 @@ function ta(e) {
|
|
|
2536
2543
|
let s;
|
|
2537
2544
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(I, {
|
|
2538
2545
|
className: "mb-2",
|
|
2539
|
-
children: /* @__PURE__ */ M(
|
|
2546
|
+
children: /* @__PURE__ */ M(ta, {})
|
|
2540
2547
|
}), t[5] = s) : s = t[5];
|
|
2541
2548
|
let c;
|
|
2542
2549
|
return t[6] !== a || t[7] !== o ? (c = /* @__PURE__ */ N(F, {
|
|
@@ -2546,31 +2553,31 @@ function ta(e) {
|
|
|
2546
2553
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2547
2554
|
}
|
|
2548
2555
|
var X = {
|
|
2549
|
-
Text:
|
|
2550
|
-
File:
|
|
2551
|
-
Source:
|
|
2552
|
-
Reasoning:
|
|
2553
|
-
DynamicTool:
|
|
2554
|
-
Tool:
|
|
2555
|
-
ToolDisclosure:
|
|
2556
|
-
ToolContent:
|
|
2556
|
+
Text: Ki,
|
|
2557
|
+
File: qi,
|
|
2558
|
+
Source: Ji,
|
|
2559
|
+
Reasoning: Yi,
|
|
2560
|
+
DynamicTool: Xi,
|
|
2561
|
+
Tool: ea,
|
|
2562
|
+
ToolDisclosure: na,
|
|
2563
|
+
ToolContent: ta
|
|
2557
2564
|
};
|
|
2558
2565
|
//#endregion
|
|
2559
2566
|
//#region src/lib/chat/trajectory/trajectory-segments.ts
|
|
2560
|
-
function
|
|
2567
|
+
function ra(e) {
|
|
2561
2568
|
return S(e) ? "tool" : e.type === "dynamic-tool" ? "dynamic-tool" : e.type === "reasoning" && "text" in e && e.text ? "reasoning" : null;
|
|
2562
2569
|
}
|
|
2563
|
-
function
|
|
2570
|
+
function ia(e, t) {
|
|
2564
2571
|
return e.kind === "text" || e.kind === "file" || e.kind === "source" ? !1 : e.kind === "reasoning" || e.kind !== "dynamic-tool" || !!t;
|
|
2565
2572
|
}
|
|
2566
|
-
function
|
|
2573
|
+
function aa(e, t, n) {
|
|
2567
2574
|
let r = e[t + 1];
|
|
2568
|
-
return !!r &&
|
|
2575
|
+
return !!r && ia(r, n);
|
|
2569
2576
|
}
|
|
2570
|
-
function
|
|
2571
|
-
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ?
|
|
2577
|
+
function oa(e) {
|
|
2578
|
+
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ? H(e.citations).map(({ source: e }) => e.url) : []));
|
|
2572
2579
|
for (let r = 0; r < e.length; r++) {
|
|
2573
|
-
let i = e[r], a =
|
|
2580
|
+
let i = e[r], a = ra(i);
|
|
2574
2581
|
if (a) t.push({
|
|
2575
2582
|
kind: a,
|
|
2576
2583
|
part: i,
|
|
@@ -2614,7 +2621,7 @@ function Z(e, t) {
|
|
|
2614
2621
|
}
|
|
2615
2622
|
//#endregion
|
|
2616
2623
|
//#region src/lib/chat/trajectory/nested-trajectory.tsx
|
|
2617
|
-
function
|
|
2624
|
+
function sa(e, t) {
|
|
2618
2625
|
let n = `${Z(e, t)}:${e.kind}`;
|
|
2619
2626
|
if (e.kind === "text") return `${n}:${e.parts.map(({ part: e }) => e.type === "text" ? e.text : "").join("")}`;
|
|
2620
2627
|
if (e.kind === "reasoning" && e.part.type === "reasoning") return `${n}:${e.part.text}`;
|
|
@@ -2624,10 +2631,10 @@ function oa(e, t) {
|
|
|
2624
2631
|
}
|
|
2625
2632
|
return e.kind === "file" && e.part.type === "file" ? `${n}:${e.part.url}:${e.part.mediaType}:${e.part.filename ?? ""}` : n;
|
|
2626
2633
|
}
|
|
2627
|
-
function
|
|
2634
|
+
function ca(e, t, n) {
|
|
2628
2635
|
return e.kind === "file" || e.kind === "source" ? !0 : e.kind === "tool" || e.kind === "dynamic-tool" ? w(e.part) ? e.part.state === "output-error" || e.part.state === "output-available" && e.part.preliminary !== !0 : !1 : t < n - 1;
|
|
2629
2636
|
}
|
|
2630
|
-
var
|
|
2637
|
+
var la = c(function(e) {
|
|
2631
2638
|
let t = O(8), { segment: n } = e;
|
|
2632
2639
|
if (n.kind === "tool") {
|
|
2633
2640
|
let e;
|
|
@@ -2649,13 +2656,13 @@ var ca = c(function(e) {
|
|
|
2649
2656
|
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(X.File, { segment: n }), t[6] = n, t[7] = e), e;
|
|
2650
2657
|
}
|
|
2651
2658
|
return null;
|
|
2652
|
-
},
|
|
2653
|
-
function
|
|
2659
|
+
}, ua);
|
|
2660
|
+
function ua(e, t) {
|
|
2654
2661
|
return e.complete && t.complete && e.cacheKey === t.cacheKey;
|
|
2655
2662
|
}
|
|
2656
|
-
function
|
|
2663
|
+
function da(e) {
|
|
2657
2664
|
let t = O(11), { parts: n, className: r } = e, i;
|
|
2658
|
-
t[0] === n ? i = t[1] : (i =
|
|
2665
|
+
t[0] === n ? i = t[1] : (i = oa(n), t[0] = n, t[1] = i);
|
|
2659
2666
|
let a = i;
|
|
2660
2667
|
if (a.length === 0) return null;
|
|
2661
2668
|
let o;
|
|
@@ -2665,10 +2672,10 @@ function ua(e) {
|
|
|
2665
2672
|
let e;
|
|
2666
2673
|
t[6] === a.length ? e = t[7] : (e = (e, t) => {
|
|
2667
2674
|
let n = `${Z(e, t)}-${e.kind}`;
|
|
2668
|
-
return /* @__PURE__ */ M(
|
|
2675
|
+
return /* @__PURE__ */ M(la, {
|
|
2669
2676
|
segment: e,
|
|
2670
|
-
cacheKey:
|
|
2671
|
-
complete:
|
|
2677
|
+
cacheKey: sa(e, t),
|
|
2678
|
+
complete: ca(e, t, a.length)
|
|
2672
2679
|
}, n);
|
|
2673
2680
|
}, t[6] = a.length, t[7] = e), s = a.map(e), t[4] = a, t[5] = s;
|
|
2674
2681
|
} else s = t[5];
|
|
@@ -2700,13 +2707,13 @@ function Q(e) {
|
|
|
2700
2707
|
}
|
|
2701
2708
|
//#endregion
|
|
2702
2709
|
//#region src/lib/chat/trajectory/trajectories/message-actions.tsx
|
|
2703
|
-
function
|
|
2710
|
+
function fa() {
|
|
2704
2711
|
let { index: e } = K(), { messages: t } = W(), n = G();
|
|
2705
2712
|
return !(e === t.length - 1 && (n === "submitted" || n === "streaming" || n === "error"));
|
|
2706
2713
|
}
|
|
2707
|
-
function
|
|
2714
|
+
function pa(e) {
|
|
2708
2715
|
let t = O(5), { className: n, children: r } = e;
|
|
2709
|
-
if (!
|
|
2716
|
+
if (!fa() || i.toArray(r).length === 0) return null;
|
|
2710
2717
|
let a;
|
|
2711
2718
|
t[0] === n ? a = t[1] : (a = k("mt-1 flex items-center gap-0.5", n), t[0] = n, t[1] = a);
|
|
2712
2719
|
let o;
|
|
@@ -2716,11 +2723,11 @@ function fa(e) {
|
|
|
2716
2723
|
children: r
|
|
2717
2724
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2718
2725
|
}
|
|
2719
|
-
function
|
|
2720
|
-
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] =
|
|
2726
|
+
function ma(e) {
|
|
2727
|
+
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] = Hr(), o = i ? "Copied" : "Copy message", s;
|
|
2721
2728
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2722
2729
|
let c;
|
|
2723
|
-
t[2] !== a || t[3] !== r ? (c = () => void a(
|
|
2730
|
+
t[2] !== a || t[3] !== r ? (c = () => void a(pi(r)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
2724
2731
|
let l;
|
|
2725
2732
|
t[5] === i ? l = t[6] : (l = M(i ? Re : Ke, { className: "size-3.5" }), t[5] = i, t[6] = l);
|
|
2726
2733
|
let u;
|
|
@@ -2731,8 +2738,8 @@ function pa(e) {
|
|
|
2731
2738
|
icon: l
|
|
2732
2739
|
}), t[7] = o, t[8] = s, t[9] = c, t[10] = l, t[11] = u) : u = t[11], u;
|
|
2733
2740
|
}
|
|
2734
|
-
function
|
|
2735
|
-
let t = O(9), { className: n } = e, { message: r } = K(), { regenerate: i } =
|
|
2741
|
+
function ha(e) {
|
|
2742
|
+
let t = O(9), { className: n } = e, { message: r } = K(), { regenerate: i } = V(), a;
|
|
2736
2743
|
t[0] === n ? a = t[1] : (a = k("p-1.5", n), t[0] = n, t[1] = a);
|
|
2737
2744
|
let o;
|
|
2738
2745
|
t[2] !== r.id || t[3] !== i ? (o = () => void i({ messageId: r.id }), t[2] = r.id, t[3] = i, t[4] = o) : o = t[4];
|
|
@@ -2746,8 +2753,8 @@ function ma(e) {
|
|
|
2746
2753
|
icon: s
|
|
2747
2754
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2748
2755
|
}
|
|
2749
|
-
function
|
|
2750
|
-
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] =
|
|
2756
|
+
function ga(e) {
|
|
2757
|
+
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] = Hr(), o = i ? "Copied" : "Copy debug JSON", s;
|
|
2751
2758
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2752
2759
|
let c;
|
|
2753
2760
|
t[2] !== a || t[3] !== r ? (c = () => void a(JSON.stringify(r, null, 2)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
@@ -2763,7 +2770,7 @@ function ha(e) {
|
|
|
2763
2770
|
}
|
|
2764
2771
|
//#endregion
|
|
2765
2772
|
//#region src/lib/chat/trajectory/trajectories/messages-error.tsx
|
|
2766
|
-
function
|
|
2773
|
+
function _a(e) {
|
|
2767
2774
|
let t = O(7), { onTryAgain: n, error: r } = e, i = r instanceof Error ? r.message : "An error occurred. Please try again.", a;
|
|
2768
2775
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
2769
2776
|
className: "text-destructive text-sm",
|
|
@@ -2789,18 +2796,18 @@ function ga(e) {
|
|
|
2789
2796
|
})
|
|
2790
2797
|
}), t[4] = a, t[5] = o, t[6] = s) : s = t[6], s;
|
|
2791
2798
|
}
|
|
2792
|
-
function
|
|
2799
|
+
function va(e) {
|
|
2793
2800
|
let t = O(3), { error: n, onRetry: r } = e;
|
|
2794
2801
|
if (!n || !r) return null;
|
|
2795
2802
|
let i;
|
|
2796
|
-
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
2803
|
+
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(_a, {
|
|
2797
2804
|
onTryAgain: r,
|
|
2798
2805
|
error: n
|
|
2799
2806
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2800
2807
|
}
|
|
2801
2808
|
//#endregion
|
|
2802
2809
|
//#region src/lib/chat/trajectory/trajectories/messages-shell.tsx
|
|
2803
|
-
function
|
|
2810
|
+
function ya(e) {
|
|
2804
2811
|
let t = O(15), { messages: n, className: r, elements: i, citation: a, status: o, children: s } = e, c;
|
|
2805
2812
|
t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== o ? (c = {
|
|
2806
2813
|
messages: n,
|
|
@@ -2821,12 +2828,12 @@ function va(e) {
|
|
|
2821
2828
|
children: d
|
|
2822
2829
|
}), t[9] = u, t[10] = d, t[11] = f) : f = t[11];
|
|
2823
2830
|
let p;
|
|
2824
|
-
return t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(
|
|
2831
|
+
return t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Xn, {
|
|
2825
2832
|
value: l,
|
|
2826
2833
|
children: f
|
|
2827
2834
|
}), t[12] = f, t[13] = l, t[14] = p) : p = t[14], p;
|
|
2828
2835
|
}
|
|
2829
|
-
function
|
|
2836
|
+
function ba(e) {
|
|
2830
2837
|
let t = O(5), { className: n, children: r } = e, i;
|
|
2831
2838
|
t[0] === n ? i = t[1] : (i = k("flex flex-col gap-4", n), t[0] = n, t[1] = i);
|
|
2832
2839
|
let a;
|
|
@@ -2835,7 +2842,7 @@ function ya(e) {
|
|
|
2835
2842
|
children: r
|
|
2836
2843
|
}), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
|
|
2837
2844
|
}
|
|
2838
|
-
function
|
|
2845
|
+
function xa(e) {
|
|
2839
2846
|
let t = O(9), { message: n, index: r, className: i, children: a } = e, o;
|
|
2840
2847
|
t[0] !== r || t[1] !== n ? (o = {
|
|
2841
2848
|
message: n,
|
|
@@ -2847,22 +2854,22 @@ function ba(e) {
|
|
|
2847
2854
|
children: a
|
|
2848
2855
|
}), t[3] = a, t[4] = i, t[5] = c) : c = t[5];
|
|
2849
2856
|
let l;
|
|
2850
|
-
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(
|
|
2857
|
+
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(Zn, {
|
|
2851
2858
|
value: s,
|
|
2852
2859
|
children: c
|
|
2853
2860
|
}), t[6] = c, t[7] = s, t[8] = l) : l = t[8], l;
|
|
2854
2861
|
}
|
|
2855
2862
|
//#endregion
|
|
2856
2863
|
//#region src/lib/components/PendingToolInput.tsx
|
|
2857
|
-
function
|
|
2858
|
-
let e = O(5), { registry: t } = z(), n =
|
|
2864
|
+
function Sa() {
|
|
2865
|
+
let e = O(5), { registry: t } = z(), n = V().messages, r;
|
|
2859
2866
|
if (e[0] !== n || e[1] !== t) {
|
|
2860
2867
|
bb0: {
|
|
2861
2868
|
if (!t) {
|
|
2862
2869
|
r = null;
|
|
2863
2870
|
break bb0;
|
|
2864
2871
|
}
|
|
2865
|
-
let i = n.findLast(
|
|
2872
|
+
let i = n.findLast(Ca);
|
|
2866
2873
|
if (!i) {
|
|
2867
2874
|
r = null;
|
|
2868
2875
|
break bb0;
|
|
@@ -2881,12 +2888,12 @@ function xa() {
|
|
|
2881
2888
|
} else r = e[2];
|
|
2882
2889
|
return r;
|
|
2883
2890
|
}
|
|
2884
|
-
function
|
|
2891
|
+
function Ca(e) {
|
|
2885
2892
|
let { role: t } = e;
|
|
2886
2893
|
return t === "assistant";
|
|
2887
2894
|
}
|
|
2888
|
-
function
|
|
2889
|
-
let t = O(10), { children: n, className: i } = e, a =
|
|
2895
|
+
function wa(e) {
|
|
2896
|
+
let t = O(10), { children: n, className: i } = e, a = Sa(), o = a?.entry.component, s = a ? "hidden" : "visible", c;
|
|
2890
2897
|
t[0] !== n || t[1] !== s ? (c = /* @__PURE__ */ M(r, {
|
|
2891
2898
|
mode: s,
|
|
2892
2899
|
children: n
|
|
@@ -2901,12 +2908,12 @@ function Ca(e) {
|
|
|
2901
2908
|
}
|
|
2902
2909
|
//#endregion
|
|
2903
2910
|
//#region src/lib/chat/trajectory/trajectories/thinking-hint.ts
|
|
2904
|
-
function
|
|
2911
|
+
function Ta(e, t) {
|
|
2905
2912
|
if (e === "error" || e === "ready" || !t) return null;
|
|
2906
2913
|
if (t.role !== "assistant") return "Thinking...";
|
|
2907
2914
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2908
2915
|
let n = t.parts[e];
|
|
2909
|
-
if (C(n) &&
|
|
2916
|
+
if (C(n) && Gi(n) && n.text) return n.text;
|
|
2910
2917
|
}
|
|
2911
2918
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2912
2919
|
let n = t.parts[e];
|
|
@@ -2930,7 +2937,7 @@ function wa(e, t) {
|
|
|
2930
2937
|
}
|
|
2931
2938
|
//#endregion
|
|
2932
2939
|
//#region src/lib/chat/trajectory/trajectories/timeline-dot.tsx
|
|
2933
|
-
function
|
|
2940
|
+
function Ea(e) {
|
|
2934
2941
|
let t = O(5), { isLast: n } = e, r = n !== void 0 && n, i;
|
|
2935
2942
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M("span", { className: "bg-muted-foreground/50 z-10 mt-1 size-2 shrink-0 rounded-full" }), t[0] = i) : i = t[0];
|
|
2936
2943
|
let a;
|
|
@@ -2943,7 +2950,7 @@ function Ta(e) {
|
|
|
2943
2950
|
}
|
|
2944
2951
|
//#endregion
|
|
2945
2952
|
//#region src/lib/chat/trajectory/trajectories/timeline-item.tsx
|
|
2946
|
-
function
|
|
2953
|
+
function Da(e) {
|
|
2947
2954
|
let t = O(6), { marker: n, children: r, className: i } = e, a;
|
|
2948
2955
|
t[0] === i ? a = t[1] : (a = k("relative z-0 flex gap-3 pl-5", i), t[0] = i, t[1] = a);
|
|
2949
2956
|
let o;
|
|
@@ -2954,15 +2961,15 @@ function Ea(e) {
|
|
|
2954
2961
|
}
|
|
2955
2962
|
//#endregion
|
|
2956
2963
|
//#region src/lib/chat/trajectory/trajectories/trajectory-thinking.tsx
|
|
2957
|
-
function
|
|
2958
|
-
let e = O(6), t = G(), { messages: n } = W(), r =
|
|
2959
|
-
e[0] !== t || e[1] !== i ? (a =
|
|
2964
|
+
function Oa() {
|
|
2965
|
+
let e = O(6), t = G(), { messages: n } = W(), r = Sa(), i = n[n.length - 1], a;
|
|
2966
|
+
e[0] !== t || e[1] !== i ? (a = Ta(t, i), e[0] = t, e[1] = i, e[2] = a) : a = e[2];
|
|
2960
2967
|
let o = a;
|
|
2961
2968
|
if (!o || r) return null;
|
|
2962
2969
|
let s;
|
|
2963
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
2970
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(Ea, { isLast: !0 }), e[3] = s) : s = e[3];
|
|
2964
2971
|
let c;
|
|
2965
|
-
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(
|
|
2972
|
+
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(Da, {
|
|
2966
2973
|
className: "mt-2",
|
|
2967
2974
|
marker: s,
|
|
2968
2975
|
children: /* @__PURE__ */ M("span", {
|
|
@@ -2983,7 +2990,7 @@ var $ = [
|
|
|
2983
2990
|
"reasoningTokens",
|
|
2984
2991
|
"cachedInputTokens",
|
|
2985
2992
|
"totalTokens"
|
|
2986
|
-
],
|
|
2993
|
+
], ka = {
|
|
2987
2994
|
inputTokens: [["inputTokens"], ["raw", "prompt_tokens"]],
|
|
2988
2995
|
outputTokens: [["outputTokens"], ["raw", "completion_tokens"]],
|
|
2989
2996
|
reasoningTokens: [
|
|
@@ -3007,7 +3014,7 @@ var $ = [
|
|
|
3007
3014
|
],
|
|
3008
3015
|
totalTokens: [["totalTokens"], ["raw", "total_tokens"]]
|
|
3009
3016
|
};
|
|
3010
|
-
function
|
|
3017
|
+
function Aa(e) {
|
|
3011
3018
|
if (typeof e == "number" && Number.isFinite(e) && e >= 0) return e;
|
|
3012
3019
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
3013
3020
|
let t = Number(e);
|
|
@@ -3015,7 +3022,7 @@ function ka(e) {
|
|
|
3015
3022
|
}
|
|
3016
3023
|
return null;
|
|
3017
3024
|
}
|
|
3018
|
-
function
|
|
3025
|
+
function ja(e) {
|
|
3019
3026
|
if (!e || typeof e != "object") return null;
|
|
3020
3027
|
let t = {
|
|
3021
3028
|
inputTokens: null,
|
|
@@ -3024,8 +3031,8 @@ function Aa(e) {
|
|
|
3024
3031
|
cachedInputTokens: null,
|
|
3025
3032
|
totalTokens: null
|
|
3026
3033
|
};
|
|
3027
|
-
for (let n of $) for (let r of
|
|
3028
|
-
let i =
|
|
3034
|
+
for (let n of $) for (let r of ka[n]) {
|
|
3035
|
+
let i = Aa(Dt(e, r));
|
|
3029
3036
|
if (i !== null) {
|
|
3030
3037
|
t[n] = i;
|
|
3031
3038
|
break;
|
|
@@ -3033,10 +3040,10 @@ function Aa(e) {
|
|
|
3033
3040
|
}
|
|
3034
3041
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3035
3042
|
}
|
|
3036
|
-
function
|
|
3037
|
-
return D(e) ?
|
|
3043
|
+
function Ma(e) {
|
|
3044
|
+
return D(e) ? ja(e.totalUsage ?? e.usage) : null;
|
|
3038
3045
|
}
|
|
3039
|
-
function
|
|
3046
|
+
function Na(e, t) {
|
|
3040
3047
|
let n = {
|
|
3041
3048
|
inputTokens: null,
|
|
3042
3049
|
outputTokens: null,
|
|
@@ -3058,7 +3065,7 @@ function Ma(e, t) {
|
|
|
3058
3065
|
}
|
|
3059
3066
|
return $.some((e) => n[e] !== null) ? n : null;
|
|
3060
3067
|
}
|
|
3061
|
-
function
|
|
3068
|
+
function Pa(e) {
|
|
3062
3069
|
if (e.length === 0) return null;
|
|
3063
3070
|
let t = {
|
|
3064
3071
|
inputTokens: null,
|
|
@@ -3077,32 +3084,32 @@ function Na(e) {
|
|
|
3077
3084
|
}
|
|
3078
3085
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3079
3086
|
}
|
|
3080
|
-
function
|
|
3087
|
+
function Fa(e) {
|
|
3081
3088
|
let t = {}, n = [], r = null, i = null;
|
|
3082
3089
|
for (let a of e) {
|
|
3083
3090
|
if (a.role !== "assistant") continue;
|
|
3084
|
-
let e = D(a.metadata) ? a.metadata : void 0, o =
|
|
3091
|
+
let e = D(a.metadata) ? a.metadata : void 0, o = ja(e?.usage), s = ja(e?.totalUsage), c = o ?? (s ? Na(s, r) : null);
|
|
3085
3092
|
c && (t[a.id] = c, n.push(c)), s && (i = s, r = s);
|
|
3086
3093
|
}
|
|
3087
3094
|
return {
|
|
3088
3095
|
assistantUsageByMessageId: t,
|
|
3089
|
-
chatUsageSummary: i ??
|
|
3096
|
+
chatUsageSummary: i ?? Pa(n)
|
|
3090
3097
|
};
|
|
3091
3098
|
}
|
|
3092
|
-
function
|
|
3093
|
-
let e = O(2), t =
|
|
3094
|
-
return e[0] === t.messages ? n = e[1] : (n =
|
|
3099
|
+
function Ia() {
|
|
3100
|
+
let e = O(2), t = V(), n;
|
|
3101
|
+
return e[0] === t.messages ? n = e[1] : (n = Fa(t.messages), e[0] = t.messages, e[1] = n), n;
|
|
3095
3102
|
}
|
|
3096
|
-
function
|
|
3103
|
+
function La(e) {
|
|
3097
3104
|
return kt(e);
|
|
3098
3105
|
}
|
|
3099
|
-
function
|
|
3106
|
+
function Ra(e) {
|
|
3100
3107
|
let t = [`↑ ${Ot(e.inputTokens)}`, `↓ ${Ot(e.outputTokens)}`];
|
|
3101
3108
|
return e.totalTokens !== null && t.push(`· ${kt(e.totalTokens)} tokens`), e.cachedInputTokens !== null && e.cachedInputTokens > 0 && t.push(`(${Ot(e.cachedInputTokens)} cached)`), t.join(" ");
|
|
3102
3109
|
}
|
|
3103
3110
|
//#endregion
|
|
3104
3111
|
//#region src/lib/chat/zukhruf-chat-transport.ts
|
|
3105
|
-
var
|
|
3112
|
+
var za = "x-upload-filename", Ba = P.strictObject({
|
|
3106
3113
|
path: P.string().startsWith("/"),
|
|
3107
3114
|
name: P.string().min(1),
|
|
3108
3115
|
mediaType: P.enum([
|
|
@@ -3120,19 +3127,19 @@ var Ra = "x-upload-filename", za = P.strictObject({
|
|
|
3120
3127
|
]),
|
|
3121
3128
|
size: P.int().nonnegative(),
|
|
3122
3129
|
url: P.url()
|
|
3123
|
-
}),
|
|
3130
|
+
}), Va = class extends _ {
|
|
3124
3131
|
sessionsApi;
|
|
3125
3132
|
request;
|
|
3126
3133
|
constructor({ api: e, fetch: t = (e, t) => globalThis.fetch(e, t), tools: n = {}, elements: r = [] }) {
|
|
3127
|
-
let i =
|
|
3134
|
+
let i = Ga(e), a = r.map(se);
|
|
3128
3135
|
super({
|
|
3129
3136
|
api: i,
|
|
3130
3137
|
fetch: async (e, n) => {
|
|
3131
3138
|
let r = await t(e, n);
|
|
3132
3139
|
if ((n?.method ?? "GET").toUpperCase() !== "POST" || !r.ok) return r;
|
|
3133
3140
|
let i = await r.json();
|
|
3134
|
-
if (!
|
|
3135
|
-
let a =
|
|
3141
|
+
if (!Ka(i)) throw Error("Zukhruf returned an invalid accepted-turn response");
|
|
3142
|
+
let a = Ga(String(e)), o = decodeURIComponent(a.slice(a.lastIndexOf("/") + 1));
|
|
3136
3143
|
if (i.sessionId !== o) throw Error("Zukhruf returned a different session ID");
|
|
3137
3144
|
let s = n?.signal;
|
|
3138
3145
|
return s?.addEventListener("abort", () => {
|
|
@@ -3147,7 +3154,7 @@ var Ra = "x-upload-filename", za = P.strictObject({
|
|
|
3147
3154
|
let o = t[t.length - 1];
|
|
3148
3155
|
if (!o) throw Error("A message is required");
|
|
3149
3156
|
return {
|
|
3150
|
-
api:
|
|
3157
|
+
api: Ha(i, e),
|
|
3151
3158
|
body: {
|
|
3152
3159
|
sessionId: e,
|
|
3153
3160
|
message: o,
|
|
@@ -3158,50 +3165,50 @@ var Ra = "x-upload-filename", za = P.strictObject({
|
|
|
3158
3165
|
};
|
|
3159
3166
|
},
|
|
3160
3167
|
prepareReconnectToStreamRequest: ({ headers: e, id: t }) => ({
|
|
3161
|
-
api: `${
|
|
3168
|
+
api: `${Ha(i, t)}/stream`,
|
|
3162
3169
|
headers: e
|
|
3163
3170
|
})
|
|
3164
3171
|
}), this.sessionsApi = i, this.request = t;
|
|
3165
3172
|
}
|
|
3166
3173
|
async uploadFile(e, t) {
|
|
3167
|
-
let n = await this.request(`${
|
|
3174
|
+
let n = await this.request(`${Ha(this.sessionsApi, e)}/uploads`, {
|
|
3168
3175
|
method: "POST",
|
|
3169
3176
|
headers: {
|
|
3170
3177
|
"content-type": t.type,
|
|
3171
|
-
[
|
|
3178
|
+
[za]: encodeURIComponent(t.name)
|
|
3172
3179
|
},
|
|
3173
3180
|
body: t
|
|
3174
3181
|
});
|
|
3175
|
-
if (!n.ok) throw Error(await
|
|
3176
|
-
let r =
|
|
3182
|
+
if (!n.ok) throw Error(await Ua(n, t));
|
|
3183
|
+
let r = Ba.safeParse(await n.json());
|
|
3177
3184
|
if (!r.success) throw Error("Zukhruf returned an invalid upload response");
|
|
3178
3185
|
return r.data;
|
|
3179
3186
|
}
|
|
3180
3187
|
};
|
|
3181
|
-
function
|
|
3188
|
+
function Ha(e, t) {
|
|
3182
3189
|
return `${e}/${encodeURIComponent(t)}`;
|
|
3183
3190
|
}
|
|
3184
|
-
async function
|
|
3185
|
-
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r =
|
|
3191
|
+
async function Ua(e, t) {
|
|
3192
|
+
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r = Wa(await e.json().catch((e) => {
|
|
3186
3193
|
if (e instanceof SyntaxError) return null;
|
|
3187
3194
|
throw e;
|
|
3188
3195
|
}));
|
|
3189
3196
|
return r ? `${n}: ${r}` : n;
|
|
3190
3197
|
}
|
|
3191
|
-
function
|
|
3198
|
+
function Wa(e) {
|
|
3192
3199
|
if (typeof e != "object" || !e) return null;
|
|
3193
3200
|
let t = "cause" in e && typeof e.cause == "object" && e.cause !== null ? e.cause : null;
|
|
3194
3201
|
return [t && "code" in t && typeof t.code == "string" ? t.code : null, t && "detail" in t && typeof t.detail == "string" ? t.detail : "error" in e && typeof e.error == "string" ? e.error : null].filter((e) => e !== null).join(" — ") || null;
|
|
3195
3202
|
}
|
|
3196
|
-
function
|
|
3203
|
+
function Ga(e) {
|
|
3197
3204
|
return e.replace(/\/$/, "");
|
|
3198
3205
|
}
|
|
3199
|
-
function
|
|
3206
|
+
function Ka(e) {
|
|
3200
3207
|
return typeof e == "object" && !!e && "ok" in e && e.ok === !0 && "sessionId" in e && typeof e.sessionId == "string" && "turnId" in e && typeof e.turnId == "string";
|
|
3201
3208
|
}
|
|
3202
3209
|
//#endregion
|
|
3203
3210
|
//#region src/lib/chat/trajectory/trajectories/collapsible-disclosure.tsx
|
|
3204
|
-
function
|
|
3211
|
+
function qa(e) {
|
|
3205
3212
|
let t = O(24), { label: n, open: r, onOpenChange: i, children: a, className: o, triggerClassName: s, contentClassName: c, chevronClassName: l } = e, u;
|
|
3206
3213
|
t[0] === s ? u = t[1] : (u = k("flex items-center font-mono", s), t[0] = s, t[1] = u);
|
|
3207
3214
|
let d;
|
|
@@ -3235,19 +3242,19 @@ function Ka(e) {
|
|
|
3235
3242
|
}
|
|
3236
3243
|
//#endregion
|
|
3237
3244
|
//#region src/lib/chat/trajectory/trajectories/user-message.tsx
|
|
3238
|
-
function
|
|
3245
|
+
function Ja(e) {
|
|
3239
3246
|
let t = O(7), { metadata: n } = e;
|
|
3240
3247
|
if (!n) return null;
|
|
3241
3248
|
let r, i, a;
|
|
3242
3249
|
if (t[0] !== n) {
|
|
3243
3250
|
a = Symbol.for("react.early_return_sentinel");
|
|
3244
3251
|
bb0: {
|
|
3245
|
-
let e =
|
|
3252
|
+
let e = Ma(n);
|
|
3246
3253
|
if (!e) {
|
|
3247
3254
|
a = null;
|
|
3248
3255
|
break bb0;
|
|
3249
3256
|
}
|
|
3250
|
-
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i =
|
|
3257
|
+
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i = Ra(e);
|
|
3251
3258
|
}
|
|
3252
3259
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a;
|
|
3253
3260
|
} else r = t[1], i = t[2], a = t[3];
|
|
@@ -3258,27 +3265,27 @@ function qa(e) {
|
|
|
3258
3265
|
children: i
|
|
3259
3266
|
}), t[4] = r, t[5] = i, t[6] = o) : o = t[6], o;
|
|
3260
3267
|
}
|
|
3261
|
-
function
|
|
3268
|
+
function Ya(e, t) {
|
|
3262
3269
|
return D(e.metadata) ? e.metadata[t] : void 0;
|
|
3263
3270
|
}
|
|
3264
|
-
function
|
|
3265
|
-
let t =
|
|
3271
|
+
function Xa(e) {
|
|
3272
|
+
let t = Ya(e, "reminders");
|
|
3266
3273
|
return Array.isArray(t) ? t.filter((e) => {
|
|
3267
3274
|
if (!e || typeof e != "object") return !1;
|
|
3268
3275
|
let t = e;
|
|
3269
3276
|
return typeof t.id == "string" && t.id.length > 0 && typeof t.text == "string" && t.text.trim().length > 0;
|
|
3270
3277
|
}) : [];
|
|
3271
3278
|
}
|
|
3272
|
-
function
|
|
3273
|
-
let t =
|
|
3279
|
+
function Za(e) {
|
|
3280
|
+
let t = Ya(e, "uploads");
|
|
3274
3281
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
3275
|
-
let t =
|
|
3282
|
+
let t = Ba.safeParse(e);
|
|
3276
3283
|
return t.success ? [t.data] : [];
|
|
3277
3284
|
}) : [];
|
|
3278
3285
|
}
|
|
3279
|
-
function
|
|
3286
|
+
function Qa(e) {
|
|
3280
3287
|
let t = O(7), { text: n } = e, [r, i] = g(!1), a;
|
|
3281
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(
|
|
3288
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i($a), t[0] = a) : a = t[0];
|
|
3282
3289
|
let o = !r && "line-clamp-3", s;
|
|
3283
3290
|
t[1] === o ? s = t[2] : (s = k("hover:text-foreground w-full cursor-pointer text-left whitespace-pre-wrap", o), t[1] = o, t[2] = s);
|
|
3284
3291
|
let c;
|
|
@@ -3290,21 +3297,21 @@ function Za(e) {
|
|
|
3290
3297
|
children: n
|
|
3291
3298
|
}) }), t[3] = r, t[4] = s, t[5] = n, t[6] = c) : c = t[6], c;
|
|
3292
3299
|
}
|
|
3293
|
-
function
|
|
3300
|
+
function $a(e) {
|
|
3294
3301
|
return !e;
|
|
3295
3302
|
}
|
|
3296
|
-
function
|
|
3303
|
+
function eo(e) {
|
|
3297
3304
|
let t = O(8), { reminders: n } = e, [r, i] = g(!1);
|
|
3298
3305
|
if (n.length === 0) return null;
|
|
3299
3306
|
let a = `${n.length} reminder${n.length === 1 ? "" : "s"} attached`, o;
|
|
3300
|
-
t[0] === n ? o = t[1] : (o = n.map(
|
|
3307
|
+
t[0] === n ? o = t[1] : (o = n.map(to), t[0] = n, t[1] = o);
|
|
3301
3308
|
let s;
|
|
3302
3309
|
t[2] === o ? s = t[3] : (s = /* @__PURE__ */ M("ul", {
|
|
3303
3310
|
className: "border-ink-12 text-muted-foreground space-y-1 border-l pl-3 text-xs",
|
|
3304
3311
|
children: o
|
|
3305
3312
|
}), t[2] = o, t[3] = s);
|
|
3306
3313
|
let c;
|
|
3307
|
-
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(
|
|
3314
|
+
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(qa, {
|
|
3308
3315
|
label: a,
|
|
3309
3316
|
open: r,
|
|
3310
3317
|
onOpenChange: i,
|
|
@@ -3315,10 +3322,10 @@ function $a(e) {
|
|
|
3315
3322
|
children: s
|
|
3316
3323
|
}), t[4] = a, t[5] = r, t[6] = s, t[7] = c) : c = t[7], c;
|
|
3317
3324
|
}
|
|
3318
|
-
function eo(e) {
|
|
3319
|
-
return /* @__PURE__ */ M(Za, { text: e.text }, e.id);
|
|
3320
|
-
}
|
|
3321
3325
|
function to(e) {
|
|
3326
|
+
return /* @__PURE__ */ M(Qa, { text: e.text }, e.id);
|
|
3327
|
+
}
|
|
3328
|
+
function no(e) {
|
|
3322
3329
|
let t = O(19), { upload: n } = e;
|
|
3323
3330
|
if (n.mediaType.startsWith("video/")) {
|
|
3324
3331
|
let e;
|
|
@@ -3384,17 +3391,17 @@ function to(e) {
|
|
|
3384
3391
|
})
|
|
3385
3392
|
}), t[16] = n.name, t[17] = n.url, t[18] = r) : r = t[18], r;
|
|
3386
3393
|
}
|
|
3387
|
-
function
|
|
3394
|
+
function ro(e) {
|
|
3388
3395
|
let t = O(13), { message: n } = e, r, i, a, o, s, c;
|
|
3389
3396
|
if (t[0] !== n) {
|
|
3390
3397
|
c = Symbol.for("react.early_return_sentinel");
|
|
3391
3398
|
bb0: {
|
|
3392
|
-
let e =
|
|
3399
|
+
let e = Za(n);
|
|
3393
3400
|
if (e.length === 0) {
|
|
3394
3401
|
c = null;
|
|
3395
3402
|
break bb0;
|
|
3396
3403
|
}
|
|
3397
|
-
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(
|
|
3404
|
+
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(io);
|
|
3398
3405
|
}
|
|
3399
3406
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a, t[4] = o, t[5] = s, t[6] = c;
|
|
3400
3407
|
} else r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], c = t[6];
|
|
@@ -3407,23 +3414,23 @@ function no(e) {
|
|
|
3407
3414
|
children: s
|
|
3408
3415
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o, t[11] = s, t[12] = l) : l = t[12], l;
|
|
3409
3416
|
}
|
|
3410
|
-
function
|
|
3417
|
+
function io(e) {
|
|
3411
3418
|
return /* @__PURE__ */ M("div", {
|
|
3412
3419
|
role: "listitem",
|
|
3413
3420
|
"data-slot": "attachment",
|
|
3414
|
-
children: /* @__PURE__ */ M(
|
|
3421
|
+
children: /* @__PURE__ */ M(no, { upload: e })
|
|
3415
3422
|
}, e.path);
|
|
3416
3423
|
}
|
|
3417
|
-
function
|
|
3424
|
+
function ao(e) {
|
|
3418
3425
|
let t = O(10), { body: n, reminders: r, metadata: i } = e, a;
|
|
3419
3426
|
t[0] === n ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
3420
3427
|
className: "flex-1 space-y-3",
|
|
3421
3428
|
children: n
|
|
3422
3429
|
}), t[0] = n, t[1] = a);
|
|
3423
3430
|
let o;
|
|
3424
|
-
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(
|
|
3431
|
+
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(eo, { reminders: r }), t[2] = r, t[3] = o);
|
|
3425
3432
|
let s;
|
|
3426
|
-
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(
|
|
3433
|
+
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(Ja, { metadata: i }), t[4] = i, t[5] = s);
|
|
3427
3434
|
let c;
|
|
3428
3435
|
return t[6] !== a || t[7] !== o || t[8] !== s ? (c = /* @__PURE__ */ N("div", {
|
|
3429
3436
|
className: "bg-secondary flex max-w-[80%] flex-col gap-3 rounded-lg p-3",
|
|
@@ -3434,13 +3441,13 @@ function io(e) {
|
|
|
3434
3441
|
]
|
|
3435
3442
|
}), t[6] = a, t[7] = o, t[8] = s, t[9] = c) : c = t[9], c;
|
|
3436
3443
|
}
|
|
3437
|
-
function
|
|
3444
|
+
function oo(e) {
|
|
3438
3445
|
let t = O(28), { message: n } = e;
|
|
3439
|
-
|
|
3446
|
+
Ya(n, "reminders");
|
|
3440
3447
|
let r;
|
|
3441
3448
|
t[0] === n ? r = t[1] : (r = ee(n), t[0] = n, t[1] = r);
|
|
3442
3449
|
let i;
|
|
3443
|
-
t[2] === n ? i = t[3] : (i =
|
|
3450
|
+
t[2] === n ? i = t[3] : (i = Xa(n), t[2] = n, t[3] = i);
|
|
3444
3451
|
let a;
|
|
3445
3452
|
t[4] !== r || t[5] !== i ? (a = {
|
|
3446
3453
|
message: r,
|
|
@@ -3448,7 +3455,7 @@ function ao(e) {
|
|
|
3448
3455
|
}, t[4] = r, t[5] = i, t[6] = a) : a = t[6];
|
|
3449
3456
|
let { message: o, reminders: s } = a, c;
|
|
3450
3457
|
if (t[7] !== n) {
|
|
3451
|
-
let e =
|
|
3458
|
+
let e = Ya(n, "alias");
|
|
3452
3459
|
c = typeof e == "string" && e.trim().length > 0 ? e : void 0, t[7] = n, t[8] = c;
|
|
3453
3460
|
} else c = t[8];
|
|
3454
3461
|
let l = c;
|
|
@@ -3460,13 +3467,13 @@ function ao(e) {
|
|
|
3460
3467
|
children: l
|
|
3461
3468
|
}), t[9] = l, t[10] = e);
|
|
3462
3469
|
let n;
|
|
3463
|
-
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(
|
|
3470
|
+
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(ao, {
|
|
3464
3471
|
reminders: s,
|
|
3465
3472
|
body: e
|
|
3466
3473
|
}), t[11] = s, t[12] = e, t[13] = n) : n = t[13], n;
|
|
3467
3474
|
}
|
|
3468
3475
|
let u;
|
|
3469
|
-
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(
|
|
3476
|
+
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(ro, { message: o }), t[14] = o, t[15] = u);
|
|
3470
3477
|
let d = o.metadata, f;
|
|
3471
3478
|
if (t[16] !== o.id || t[17] !== o.parts) {
|
|
3472
3479
|
let e;
|
|
@@ -3477,7 +3484,7 @@ function ao(e) {
|
|
|
3477
3484
|
}, `${o.id}-${t}-text`) : null, t[19] = o.id, t[20] = e), f = o.parts.map(e), t[16] = o.id, t[17] = o.parts, t[18] = f;
|
|
3478
3485
|
} else f = t[18];
|
|
3479
3486
|
let p;
|
|
3480
|
-
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(
|
|
3487
|
+
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(ao, {
|
|
3481
3488
|
reminders: s,
|
|
3482
3489
|
metadata: d,
|
|
3483
3490
|
body: f
|
|
@@ -3488,11 +3495,11 @@ function ao(e) {
|
|
|
3488
3495
|
children: [u, p]
|
|
3489
3496
|
}), t[25] = u, t[26] = p, t[27] = m) : m = t[27], m;
|
|
3490
3497
|
}
|
|
3491
|
-
var
|
|
3498
|
+
var so = c(function(e) {
|
|
3492
3499
|
let t = O(7), { className: n } = e, { message: r } = K(), i;
|
|
3493
3500
|
t[0] === n ? i = t[1] : (i = k("flex justify-end", n), t[0] = n, t[1] = i);
|
|
3494
3501
|
let a;
|
|
3495
|
-
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(
|
|
3502
|
+
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(oo, { message: r }), t[2] = r, t[3] = a);
|
|
3496
3503
|
let o;
|
|
3497
3504
|
return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3498
3505
|
className: i,
|
|
@@ -3501,20 +3508,20 @@ var oo = c(function(e) {
|
|
|
3501
3508
|
});
|
|
3502
3509
|
//#endregion
|
|
3503
3510
|
//#region src/lib/chat/trajectory/trajectories/compact-messages.tsx
|
|
3504
|
-
function
|
|
3505
|
-
return e.kind === "tool" ? !
|
|
3511
|
+
function co(e) {
|
|
3512
|
+
return e.kind === "tool" ? !hi(e.part) : e.kind === "dynamic-tool" || e.kind === "reasoning";
|
|
3506
3513
|
}
|
|
3507
|
-
function
|
|
3514
|
+
function lo(e, t) {
|
|
3508
3515
|
return e.kind === "tool" ? !0 : e.kind === "reasoning" || e.kind === "dynamic-tool" ? !!t : !1;
|
|
3509
3516
|
}
|
|
3510
|
-
function
|
|
3511
|
-
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !
|
|
3517
|
+
function uo(e) {
|
|
3518
|
+
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !Gi(e));
|
|
3512
3519
|
}
|
|
3513
|
-
function
|
|
3520
|
+
function fo(e, t) {
|
|
3514
3521
|
let n = [];
|
|
3515
3522
|
for (let r = 0; r < e.length; r++) {
|
|
3516
3523
|
let i = e[r];
|
|
3517
|
-
if (!
|
|
3524
|
+
if (!co(i)) {
|
|
3518
3525
|
n.push({
|
|
3519
3526
|
kind: "segment",
|
|
3520
3527
|
segment: i,
|
|
@@ -3523,25 +3530,25 @@ function uo(e, t) {
|
|
|
3523
3530
|
continue;
|
|
3524
3531
|
}
|
|
3525
3532
|
let a = [], o = r;
|
|
3526
|
-
for (; r < e.length &&
|
|
3533
|
+
for (; r < e.length && co(e[r]);) {
|
|
3527
3534
|
let n = e[r];
|
|
3528
|
-
|
|
3535
|
+
lo(n, t) && a.push({ segment: n }), r++;
|
|
3529
3536
|
}
|
|
3530
3537
|
r--, a.length > 0 && n.push({
|
|
3531
3538
|
kind: "group",
|
|
3532
3539
|
items: a,
|
|
3533
|
-
hasLaterText: e.slice(r + 1).some((e) =>
|
|
3540
|
+
hasLaterText: e.slice(r + 1).some((e) => uo(e)),
|
|
3534
3541
|
firstIndex: o
|
|
3535
3542
|
});
|
|
3536
3543
|
}
|
|
3537
3544
|
return n;
|
|
3538
3545
|
}
|
|
3539
|
-
function
|
|
3546
|
+
function po(e) {
|
|
3540
3547
|
if (e.kind !== "tool" && e.kind !== "dynamic-tool") return;
|
|
3541
3548
|
let { part: t } = e;
|
|
3542
3549
|
return w(t) ? t.state : void 0;
|
|
3543
3550
|
}
|
|
3544
|
-
function
|
|
3551
|
+
function mo({ groupStatus: e, labelCount: t }) {
|
|
3545
3552
|
return e === "running" ? {
|
|
3546
3553
|
title: "text-info",
|
|
3547
3554
|
detail: "text-info/80",
|
|
@@ -3564,20 +3571,20 @@ function po({ groupStatus: e, labelCount: t }) {
|
|
|
3564
3571
|
chevron: "text-muted-foreground"
|
|
3565
3572
|
};
|
|
3566
3573
|
}
|
|
3567
|
-
function
|
|
3574
|
+
function ho(e) {
|
|
3568
3575
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3569
3576
|
}
|
|
3570
|
-
function
|
|
3577
|
+
function go(e, t = 80) {
|
|
3571
3578
|
let n = e.replace(/\s+/g, " ").trim();
|
|
3572
3579
|
return n.length <= t ? n : `${n.slice(0, t - 3).trimEnd()}...`;
|
|
3573
3580
|
}
|
|
3574
|
-
function
|
|
3575
|
-
if (typeof e == "string") return
|
|
3581
|
+
function _o(e) {
|
|
3582
|
+
if (typeof e == "string") return go(e, 48);
|
|
3576
3583
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
3577
3584
|
if (Array.isArray(e)) return `${e.length} items`;
|
|
3578
3585
|
}
|
|
3579
|
-
function
|
|
3580
|
-
if (!
|
|
3586
|
+
function vo(e) {
|
|
3587
|
+
if (!ho(e)) return;
|
|
3581
3588
|
let t = [
|
|
3582
3589
|
"command",
|
|
3583
3590
|
"query",
|
|
@@ -3589,13 +3596,13 @@ function _o(e) {
|
|
|
3589
3596
|
"checks"
|
|
3590
3597
|
], n = [...t.filter((t) => t in e).map((t) => [t, e[t]]), ...Object.entries(e).filter(([e]) => !t.includes(e))], r = {};
|
|
3591
3598
|
for (let [e, t] of n) {
|
|
3592
|
-
let n =
|
|
3599
|
+
let n = _o(t);
|
|
3593
3600
|
if (n && (r[e] = n, Object.keys(r).length >= 2)) break;
|
|
3594
3601
|
}
|
|
3595
3602
|
return Object.keys(r).length > 0 ? r : void 0;
|
|
3596
3603
|
}
|
|
3597
|
-
function
|
|
3598
|
-
if (
|
|
3604
|
+
function yo(e) {
|
|
3605
|
+
if (ho(e)) for (let t of [
|
|
3599
3606
|
"reasoning",
|
|
3600
3607
|
"thoughts",
|
|
3601
3608
|
"thought",
|
|
@@ -3603,36 +3610,36 @@ function vo(e) {
|
|
|
3603
3610
|
"detail"
|
|
3604
3611
|
]) {
|
|
3605
3612
|
let n = e[t];
|
|
3606
|
-
if (typeof n == "string" && n.trim().length > 0) return
|
|
3613
|
+
if (typeof n == "string" && n.trim().length > 0) return go(n);
|
|
3607
3614
|
}
|
|
3608
3615
|
}
|
|
3609
|
-
function
|
|
3616
|
+
function bo(e) {
|
|
3610
3617
|
if (e.kind !== "reasoning") return;
|
|
3611
3618
|
let { part: t } = e;
|
|
3612
|
-
if (t.type === "reasoning") return
|
|
3619
|
+
if (t.type === "reasoning") return go(t.text, 96);
|
|
3613
3620
|
}
|
|
3614
|
-
function
|
|
3621
|
+
function xo(e, t) {
|
|
3615
3622
|
if (e.kind === "reasoning") return {
|
|
3616
3623
|
kind: "reasoning",
|
|
3617
3624
|
name: "reasoning",
|
|
3618
|
-
detail:
|
|
3625
|
+
detail: bo(e)
|
|
3619
3626
|
};
|
|
3620
3627
|
if (e.kind === "dynamic-tool" && e.part.type === "dynamic-tool") {
|
|
3621
3628
|
let t = e.part;
|
|
3622
3629
|
return {
|
|
3623
3630
|
kind: "dynamic-tool",
|
|
3624
3631
|
name: t.toolName || "Tool",
|
|
3625
|
-
args:
|
|
3626
|
-
detail:
|
|
3632
|
+
args: vo(t.input),
|
|
3633
|
+
detail: yo(t.input)
|
|
3627
3634
|
};
|
|
3628
3635
|
}
|
|
3629
3636
|
if (e.kind === "tool" && S(e.part)) {
|
|
3630
|
-
let n = e.part, { toolEntry: r, toolKey: i } =
|
|
3637
|
+
let n = e.part, { toolEntry: r, toolKey: i } = _i(n, t), a = r?.label?.(n);
|
|
3631
3638
|
return {
|
|
3632
3639
|
kind: "tool",
|
|
3633
3640
|
name: a?.name ?? i,
|
|
3634
|
-
args: a?.args ??
|
|
3635
|
-
detail: a?.detail ??
|
|
3641
|
+
args: a?.args ?? vo(n.input),
|
|
3642
|
+
detail: a?.detail ?? yo(n.input),
|
|
3636
3643
|
isError: a?.isError
|
|
3637
3644
|
};
|
|
3638
3645
|
}
|
|
@@ -3641,54 +3648,54 @@ function bo(e, t) {
|
|
|
3641
3648
|
name: "Step"
|
|
3642
3649
|
};
|
|
3643
3650
|
}
|
|
3644
|
-
function
|
|
3651
|
+
function So(e) {
|
|
3645
3652
|
if (!e) return;
|
|
3646
3653
|
let t = Object.entries(e).filter((e) => typeof e[1] == "string" && e[1].trim().length > 0);
|
|
3647
|
-
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${
|
|
3654
|
+
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${go(t, 36)}`).join(", ");
|
|
3648
3655
|
}
|
|
3649
|
-
function
|
|
3650
|
-
let t =
|
|
3656
|
+
function Co(e) {
|
|
3657
|
+
let t = So(e.args);
|
|
3651
3658
|
return t ? `${e.name}(${t})` : e.name;
|
|
3652
3659
|
}
|
|
3653
|
-
function
|
|
3660
|
+
function wo(e) {
|
|
3654
3661
|
return e === "output-available" || e === "output-error" || e === "output-denied";
|
|
3655
3662
|
}
|
|
3656
|
-
function
|
|
3657
|
-
return !!e && !
|
|
3663
|
+
function To(e) {
|
|
3664
|
+
return !!e && !wo(e);
|
|
3658
3665
|
}
|
|
3659
|
-
function
|
|
3660
|
-
return
|
|
3666
|
+
function Eo(e, t) {
|
|
3667
|
+
return an(e, t);
|
|
3661
3668
|
}
|
|
3662
|
-
function
|
|
3663
|
-
return e.some(({ segment: e }) =>
|
|
3664
|
-
let t =
|
|
3669
|
+
function Do({ items: e, labels: t, status: n, hasLaterText: r }) {
|
|
3670
|
+
return e.some(({ segment: e }) => Eo(po(e), n)) ? "aborted" : !r && (n === "streaming" || n === "submitted") ? "running" : t.some((e) => e.isError) || e.some(({ segment: e }) => {
|
|
3671
|
+
let t = po(e);
|
|
3665
3672
|
return t === "output-error" || t === "output-denied";
|
|
3666
|
-
}) ? "error" : e.some(({ segment: e }) =>
|
|
3673
|
+
}) ? "error" : e.some(({ segment: e }) => To(po(e))) || !r && t.every((e) => e.kind === "reasoning") && (n === "streaming" || n === "submitted") ? "running" : "complete";
|
|
3667
3674
|
}
|
|
3668
|
-
function
|
|
3675
|
+
function Oo(e) {
|
|
3669
3676
|
return e && `${e[0].toUpperCase()}${e.slice(1)}`;
|
|
3670
3677
|
}
|
|
3671
|
-
function
|
|
3678
|
+
function ko(e) {
|
|
3672
3679
|
return e.filter((e) => e.kind !== "reasoning").length;
|
|
3673
3680
|
}
|
|
3674
|
-
function
|
|
3675
|
-
let n =
|
|
3681
|
+
function Ao(e, t) {
|
|
3682
|
+
let n = ko(e);
|
|
3676
3683
|
if (n !== 0) return `${t === "running" || t === "aborted" ? "running" : "ran"} ${n} ${n === 1 ? "tool" : "tools"}`;
|
|
3677
3684
|
}
|
|
3678
|
-
function
|
|
3679
|
-
let n =
|
|
3680
|
-
if (n) return
|
|
3685
|
+
function jo(e, t) {
|
|
3686
|
+
let n = Ao(e, t);
|
|
3687
|
+
if (n) return Oo(t === "error" ? `${n} with issues` : t === "aborted" ? `cancelled after ${n}` : n);
|
|
3681
3688
|
}
|
|
3682
|
-
function
|
|
3689
|
+
function Mo(e, t, n) {
|
|
3683
3690
|
let r = e.length === 1 ? e[0] : void 0;
|
|
3684
3691
|
if (t === "running") return n || (r?.kind === "reasoning" ? `Reasoning${r.detail ? ` ${r.detail}` : ""}` : e.every((e) => e.kind === "reasoning") ? "Reasoning" : "Working...");
|
|
3685
3692
|
if (r) {
|
|
3686
|
-
let e =
|
|
3693
|
+
let e = Co(r);
|
|
3687
3694
|
return t === "error" ? `Failed ${e}` : t === "aborted" ? `Cancelled ${e}` : r.kind === "reasoning" ? `Reasoned${r.detail ? ` ${r.detail}` : ""}` : `Called ${e}`;
|
|
3688
3695
|
}
|
|
3689
|
-
return e.every((e) => e.kind === "reasoning") ? "Reasoned" :
|
|
3696
|
+
return e.every((e) => e.kind === "reasoning") ? "Reasoned" : jo(e, t) ?? "Ran tools";
|
|
3690
3697
|
}
|
|
3691
|
-
function
|
|
3698
|
+
function No(e, t) {
|
|
3692
3699
|
if (t !== "running") {
|
|
3693
3700
|
if (e.length === 1) {
|
|
3694
3701
|
let t = e[0];
|
|
@@ -3697,28 +3704,28 @@ function Mo(e, t) {
|
|
|
3697
3704
|
return Array.from(new Set([...e].sort((e, t) => e.kind === "reasoning" && t.kind !== "reasoning" ? 1 : e.kind !== "reasoning" && t.kind === "reasoning" ? -1 : 0).map((e) => e.name))).slice(0, 3).join(", ") || void 0;
|
|
3698
3705
|
}
|
|
3699
3706
|
}
|
|
3700
|
-
function
|
|
3707
|
+
function Po(e) {
|
|
3701
3708
|
let t;
|
|
3702
3709
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
3703
3710
|
let r = e[n].segment;
|
|
3704
3711
|
if (r.kind === "dynamic-tool" && r.part.type === "dynamic-tool") {
|
|
3705
|
-
let e =
|
|
3712
|
+
let e = yo(r.part.input);
|
|
3706
3713
|
if (e) return e;
|
|
3707
3714
|
}
|
|
3708
3715
|
if (r.kind === "tool" && S(r.part)) {
|
|
3709
|
-
let e =
|
|
3716
|
+
let e = yo(r.part.input);
|
|
3710
3717
|
if (e) return e;
|
|
3711
3718
|
}
|
|
3712
|
-
r.kind === "reasoning" && (t ??=
|
|
3719
|
+
r.kind === "reasoning" && (t ??= bo(r));
|
|
3713
3720
|
}
|
|
3714
3721
|
return t;
|
|
3715
3722
|
}
|
|
3716
|
-
function
|
|
3717
|
-
return !e || e.role !== "assistant" ? !1 :
|
|
3723
|
+
function Fo(e, t) {
|
|
3724
|
+
return !e || e.role !== "assistant" ? !1 : fo(oa(e.parts), t).some((e) => e.kind === "group" && !e.hasLaterText);
|
|
3718
3725
|
}
|
|
3719
|
-
function
|
|
3726
|
+
function Io() {
|
|
3720
3727
|
let e = O(8), { message: t } = K(), { debugMode: n } = z(), r;
|
|
3721
|
-
e[0] === t.parts ? r = e[1] : (r =
|
|
3728
|
+
e[0] === t.parts ? r = e[1] : (r = oa(t.parts), e[0] = t.parts, e[1] = r);
|
|
3722
3729
|
let i = r, a;
|
|
3723
3730
|
if (e[2] !== n || e[3] !== t.id || e[4] !== i) {
|
|
3724
3731
|
let r;
|
|
@@ -3728,29 +3735,29 @@ function Fo() {
|
|
|
3728
3735
|
} : {
|
|
3729
3736
|
...e,
|
|
3730
3737
|
key: `${t.id}-${Z(e.segment, e.segmentIndex)}-${e.segment.kind}`
|
|
3731
|
-
}, e[6] = t.id, e[7] = r), a =
|
|
3738
|
+
}, e[6] = t.id, e[7] = r), a = fo(i, n).map(r), e[2] = n, e[3] = t.id, e[4] = i, e[5] = a;
|
|
3732
3739
|
} else a = e[5];
|
|
3733
3740
|
return a;
|
|
3734
3741
|
}
|
|
3735
|
-
var
|
|
3736
|
-
function
|
|
3737
|
-
let e = l(
|
|
3742
|
+
var Lo = o(null);
|
|
3743
|
+
function Ro() {
|
|
3744
|
+
let e = l(Lo);
|
|
3738
3745
|
if (!e) throw Error("CompactTrajectory group parts must be rendered within CompactTrajectory.Group");
|
|
3739
3746
|
return e;
|
|
3740
3747
|
}
|
|
3741
|
-
function
|
|
3748
|
+
function zo(e) {
|
|
3742
3749
|
let t = O(21), { group: n, children: r } = e, { registry: i } = z(), { message: a } = K(), o = G(), [s, c] = g(!n.hasLaterText), l, u, d;
|
|
3743
3750
|
if (t[0] !== n.hasLaterText || t[1] !== n.items || t[2] !== i || t[3] !== o) {
|
|
3744
3751
|
let e;
|
|
3745
3752
|
t[7] === i ? e = t[8] : (e = (e) => {
|
|
3746
3753
|
let { segment: t } = e;
|
|
3747
|
-
return
|
|
3748
|
-
}, t[7] = i, t[8] = e), u = n.items.map(e), l =
|
|
3754
|
+
return xo(t, i);
|
|
3755
|
+
}, t[7] = i, t[8] = e), u = n.items.map(e), l = Do({
|
|
3749
3756
|
items: n.items,
|
|
3750
3757
|
labels: u,
|
|
3751
3758
|
status: o,
|
|
3752
3759
|
hasLaterText: n.hasLaterText
|
|
3753
|
-
}), d =
|
|
3760
|
+
}), d = mo({
|
|
3754
3761
|
groupStatus: l,
|
|
3755
3762
|
labelCount: u.length
|
|
3756
3763
|
}), t[0] = n.hasLaterText, t[1] = n.items, t[2] = i, t[3] = o, t[4] = l, t[5] = u, t[6] = d;
|
|
@@ -3771,16 +3778,16 @@ function Ro(e) {
|
|
|
3771
3778
|
children: r
|
|
3772
3779
|
}), t[15] = r, t[16] = s, t[17] = m) : m = t[17];
|
|
3773
3780
|
let h;
|
|
3774
|
-
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(
|
|
3781
|
+
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(Lo, {
|
|
3775
3782
|
value: p,
|
|
3776
3783
|
children: m
|
|
3777
3784
|
}), t[18] = p, t[19] = m, t[20] = h) : h = t[20], h;
|
|
3778
3785
|
}
|
|
3779
|
-
function
|
|
3786
|
+
function Bo(e) {
|
|
3780
3787
|
let t = O(3), { children: n } = e, r;
|
|
3781
3788
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M("button", {
|
|
3782
3789
|
type: "button",
|
|
3783
|
-
className:
|
|
3790
|
+
className: un("items-start")
|
|
3784
3791
|
}), t[0] = r) : r = t[0];
|
|
3785
3792
|
let i;
|
|
3786
3793
|
return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ M(L, {
|
|
@@ -3791,11 +3798,11 @@ function zo(e) {
|
|
|
3791
3798
|
})
|
|
3792
3799
|
}), t[1] = n, t[2] = i), i;
|
|
3793
3800
|
}
|
|
3794
|
-
function
|
|
3795
|
-
let e = O(12), { items: t, labels: n, groupStatus: r, tone: i } =
|
|
3796
|
-
e[0] !== r || e[1] !== t || e[2] !== n ? (a =
|
|
3801
|
+
function Vo() {
|
|
3802
|
+
let e = O(12), { items: t, labels: n, groupStatus: r, tone: i } = Ro(), a;
|
|
3803
|
+
e[0] !== r || e[1] !== t || e[2] !== n ? (a = Mo(n, r, Po(t)), e[0] = r, e[1] = t, e[2] = n, e[3] = a) : a = e[3];
|
|
3797
3804
|
let o = a, s;
|
|
3798
|
-
e[4] !== r || e[5] !== n ? (s =
|
|
3805
|
+
e[4] !== r || e[5] !== n ? (s = No(n, r), e[4] = r, e[5] = n, e[6] = s) : s = e[6];
|
|
3799
3806
|
let c = s, l;
|
|
3800
3807
|
return e[7] !== c || e[8] !== r || e[9] !== o || e[10] !== i ? (l = {
|
|
3801
3808
|
title: o,
|
|
@@ -3804,8 +3811,8 @@ function Bo() {
|
|
|
3804
3811
|
groupStatus: r
|
|
3805
3812
|
}, e[7] = c, e[8] = r, e[9] = o, e[10] = i, e[11] = l) : l = e[11], l;
|
|
3806
3813
|
}
|
|
3807
|
-
function
|
|
3808
|
-
let t = O(9), { title: n, suffix: r, children: i } = e, { title: a, tone: o, groupStatus: s } =
|
|
3814
|
+
function Ho(e) {
|
|
3815
|
+
let t = O(9), { title: n, suffix: r, children: i } = e, { title: a, tone: o, groupStatus: s } = Vo(), c = n ?? a, l = r ? `${c} · ${r}` : c, u = s === "running", d = s === "running" ? "text-info" : o.title, f;
|
|
3809
3816
|
t[0] === d ? f = t[1] : (f = k("max-w-full min-w-0 truncate", d), t[0] = d, t[1] = f);
|
|
3810
3817
|
let p;
|
|
3811
3818
|
t[2] !== u || t[3] !== f || t[4] !== l ? (p = /* @__PURE__ */ M(U, {
|
|
@@ -3820,12 +3827,12 @@ function Vo(e) {
|
|
|
3820
3827
|
children: [p, i]
|
|
3821
3828
|
}), t[6] = i, t[7] = p, t[8] = m) : m = t[8], m;
|
|
3822
3829
|
}
|
|
3823
|
-
function
|
|
3824
|
-
let e = O(2), { tone: t } =
|
|
3825
|
-
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(
|
|
3830
|
+
function Uo() {
|
|
3831
|
+
let e = O(2), { tone: t } = Ro(), n;
|
|
3832
|
+
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(ln, { className: t.chevron }), e[0] = t.chevron, e[1] = n), n;
|
|
3826
3833
|
}
|
|
3827
|
-
function
|
|
3828
|
-
let t = O(5), { detail: n } = e, { title: r, detail: i, tone: a } =
|
|
3834
|
+
function Wo(e) {
|
|
3835
|
+
let t = O(5), { detail: n } = e, { title: r, detail: i, tone: a } = Vo();
|
|
3829
3836
|
if (n === null) return null;
|
|
3830
3837
|
let o = n ?? i;
|
|
3831
3838
|
if (!o || o === r) return null;
|
|
@@ -3837,8 +3844,8 @@ function Uo(e) {
|
|
|
3837
3844
|
children: o
|
|
3838
3845
|
}), t[2] = o, t[3] = s, t[4] = c) : c = t[4], c;
|
|
3839
3846
|
}
|
|
3840
|
-
function
|
|
3841
|
-
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } =
|
|
3847
|
+
function Go(e) {
|
|
3848
|
+
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } = Ro(), o = a === "running", s;
|
|
3842
3849
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
3843
3850
|
initial: "instant",
|
|
3844
3851
|
resize: "instant"
|
|
@@ -3862,11 +3869,11 @@ function Wo(e) {
|
|
|
3862
3869
|
children: h
|
|
3863
3870
|
}), t[10] = u, t[11] = f, t[12] = h, t[13] = g) : g = t[13], g;
|
|
3864
3871
|
}
|
|
3865
|
-
function
|
|
3872
|
+
function Ko(e) {
|
|
3866
3873
|
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } = W(), { segment: o } = n;
|
|
3867
3874
|
if (o.kind === "text") {
|
|
3868
3875
|
let e;
|
|
3869
|
-
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(
|
|
3876
|
+
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(qo), t[0] = o.parts, t[1] = e);
|
|
3870
3877
|
let n = e;
|
|
3871
3878
|
if (n.length === 0) return null;
|
|
3872
3879
|
let r;
|
|
@@ -3903,55 +3910,55 @@ function Go(e) {
|
|
|
3903
3910
|
}
|
|
3904
3911
|
return null;
|
|
3905
3912
|
}
|
|
3906
|
-
function
|
|
3913
|
+
function qo(e) {
|
|
3907
3914
|
let { part: t } = e;
|
|
3908
|
-
return !
|
|
3909
|
-
}
|
|
3910
|
-
var
|
|
3911
|
-
Group:
|
|
3912
|
-
GroupTrigger:
|
|
3913
|
-
GroupTitle:
|
|
3914
|
-
GroupChevron:
|
|
3915
|
-
GroupDetail:
|
|
3916
|
-
GroupContent:
|
|
3917
|
-
Segment:
|
|
3915
|
+
return !Gi(t);
|
|
3916
|
+
}
|
|
3917
|
+
var Jo = {
|
|
3918
|
+
Group: zo,
|
|
3919
|
+
GroupTrigger: Bo,
|
|
3920
|
+
GroupTitle: Ho,
|
|
3921
|
+
GroupChevron: Uo,
|
|
3922
|
+
GroupDetail: Wo,
|
|
3923
|
+
GroupContent: Go,
|
|
3924
|
+
Segment: Ko
|
|
3918
3925
|
};
|
|
3919
|
-
function
|
|
3926
|
+
function Yo() {
|
|
3920
3927
|
let e = O(1), t = G(), { messages: n } = W(), { debugMode: r } = z(), i = n[n.length - 1];
|
|
3921
|
-
if (t !== "ready" && t !== "error" &&
|
|
3928
|
+
if (t !== "ready" && t !== "error" && Fo(i, r)) return null;
|
|
3922
3929
|
let a;
|
|
3923
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
3930
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(Oa, {}), e[0] = a) : a = e[0], a;
|
|
3924
3931
|
}
|
|
3925
|
-
var
|
|
3926
|
-
Root:
|
|
3927
|
-
List:
|
|
3928
|
-
Item:
|
|
3929
|
-
UserBubble:
|
|
3932
|
+
var Xo = {
|
|
3933
|
+
Root: ya,
|
|
3934
|
+
List: ba,
|
|
3935
|
+
Item: xa,
|
|
3936
|
+
UserBubble: so,
|
|
3930
3937
|
AssistantContent: c(function(e) {
|
|
3931
|
-
let t = O(5), { className: n } = e, r =
|
|
3932
|
-
t[0] === r ? i = t[1] : (i = r.map(
|
|
3938
|
+
let t = O(5), { className: n } = e, r = Io(), i;
|
|
3939
|
+
t[0] === r ? i = t[1] : (i = r.map(Zo), t[0] = r, t[1] = i);
|
|
3933
3940
|
let a;
|
|
3934
3941
|
return t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M("div", {
|
|
3935
3942
|
className: n,
|
|
3936
3943
|
children: i
|
|
3937
3944
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
3938
3945
|
}),
|
|
3939
|
-
Actions:
|
|
3940
|
-
CopyAction:
|
|
3941
|
-
RegenerateAction:
|
|
3942
|
-
CopyDebugJsonAction:
|
|
3943
|
-
Thinking:
|
|
3944
|
-
Error:
|
|
3946
|
+
Actions: pa,
|
|
3947
|
+
CopyAction: ma,
|
|
3948
|
+
RegenerateAction: ha,
|
|
3949
|
+
CopyDebugJsonAction: ga,
|
|
3950
|
+
Thinking: Yo,
|
|
3951
|
+
Error: va
|
|
3945
3952
|
};
|
|
3946
|
-
function
|
|
3947
|
-
return e.kind === "group" ? /* @__PURE__ */ N(
|
|
3953
|
+
function Zo(e) {
|
|
3954
|
+
return e.kind === "group" ? /* @__PURE__ */ N(zo, {
|
|
3948
3955
|
group: e,
|
|
3949
|
-
children: [/* @__PURE__ */ N(
|
|
3950
|
-
}, e.key) : /* @__PURE__ */ M(
|
|
3956
|
+
children: [/* @__PURE__ */ N(Bo, { children: [/* @__PURE__ */ M(Ho, { children: /* @__PURE__ */ M(Uo, {}) }), /* @__PURE__ */ M(Wo, {})] }), /* @__PURE__ */ M(Go, {})]
|
|
3957
|
+
}, e.key) : /* @__PURE__ */ M(Ko, { item: e }, e.key);
|
|
3951
3958
|
}
|
|
3952
3959
|
//#endregion
|
|
3953
3960
|
//#region src/lib/chat/trajectory/trajectories/messages.tsx
|
|
3954
|
-
function
|
|
3961
|
+
function Qo(e) {
|
|
3955
3962
|
let t = O(8), { message: n, className: r } = e, i;
|
|
3956
3963
|
t[0] === r ? i = t[1] : (i = k("text-destructive/90 bg-destructive/10 flex items-start gap-2 rounded-md px-3 py-2 text-sm", r), t[0] = r, t[1] = i);
|
|
3957
3964
|
let a;
|
|
@@ -3964,13 +3971,13 @@ function Zo(e) {
|
|
|
3964
3971
|
children: [a, o]
|
|
3965
3972
|
}), t[5] = i, t[6] = o, t[7] = s) : s = t[7], s;
|
|
3966
3973
|
}
|
|
3967
|
-
function
|
|
3974
|
+
function $o(e) {
|
|
3968
3975
|
let t = O(15), { part: n } = e, r = z(), i, a;
|
|
3969
3976
|
if (t[0] !== r.registry || t[1] !== n) {
|
|
3970
3977
|
a = Symbol.for("react.early_return_sentinel");
|
|
3971
3978
|
bb0: {
|
|
3972
|
-
let { toolEntry: e } =
|
|
3973
|
-
if (e &&
|
|
3979
|
+
let { toolEntry: e } = _i(n, r.registry);
|
|
3980
|
+
if (e && vi(e, n.state)) {
|
|
3974
3981
|
let t = e.label?.(n);
|
|
3975
3982
|
if (!t) {
|
|
3976
3983
|
a = null;
|
|
@@ -4003,14 +4010,14 @@ function Qo(e) {
|
|
|
4003
4010
|
} else i = t[2], a = t[3];
|
|
4004
4011
|
if (a !== Symbol.for("react.early_return_sentinel")) return a;
|
|
4005
4012
|
let o = i, s;
|
|
4006
|
-
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(
|
|
4013
|
+
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(Vi, {
|
|
4007
4014
|
label: o,
|
|
4008
4015
|
part: n
|
|
4009
4016
|
}), t[4] = o, t[5] = n, t[6] = s) : s = t[6];
|
|
4010
4017
|
let c;
|
|
4011
|
-
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(
|
|
4018
|
+
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(Qo, { message: o.detail }), t[7] = o, t[8] = c);
|
|
4012
4019
|
let l;
|
|
4013
|
-
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(
|
|
4020
|
+
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(Li, { part: n }), t[9] = n, t[10] = l);
|
|
4014
4021
|
let u;
|
|
4015
4022
|
return t[11] !== s || t[12] !== c || t[13] !== l ? (u = /* @__PURE__ */ N(j, { children: [
|
|
4016
4023
|
s,
|
|
@@ -4018,7 +4025,7 @@ function Qo(e) {
|
|
|
4018
4025
|
l
|
|
4019
4026
|
] }), t[11] = s, t[12] = c, t[13] = l, t[14] = u) : u = t[14], u;
|
|
4020
4027
|
}
|
|
4021
|
-
function
|
|
4028
|
+
function es(e) {
|
|
4022
4029
|
let t = O(5), { part: n } = e, [r, i] = g(!1), a;
|
|
4023
4030
|
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(J, {
|
|
4024
4031
|
mode: "static",
|
|
@@ -4028,7 +4035,7 @@ function $o(e) {
|
|
|
4028
4035
|
return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
4029
4036
|
"data-copy-exclude": "assistant-snapshot",
|
|
4030
4037
|
className: "bg-muted/30 prose max-w-auto prose-sm text-muted-foreground border-border mb-4 w-full min-w-full rounded-lg p-3",
|
|
4031
|
-
children: /* @__PURE__ */ M(
|
|
4038
|
+
children: /* @__PURE__ */ M(qa, {
|
|
4032
4039
|
label: "Reasoning",
|
|
4033
4040
|
open: r,
|
|
4034
4041
|
onOpenChange: i,
|
|
@@ -4039,12 +4046,12 @@ function $o(e) {
|
|
|
4039
4046
|
})
|
|
4040
4047
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
4041
4048
|
}
|
|
4042
|
-
function
|
|
4043
|
-
let t = O(16), { part: n } = e, { elements: r } = W(), i =
|
|
4049
|
+
function ts(e) {
|
|
4050
|
+
let t = O(16), { part: n } = e, { elements: r } = W(), i = Ri();
|
|
4044
4051
|
if (n.type === "text") {
|
|
4045
|
-
if (
|
|
4052
|
+
if (Gi(n)) return null;
|
|
4046
4053
|
let e;
|
|
4047
|
-
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(
|
|
4054
|
+
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(Ii, {
|
|
4048
4055
|
text: n.text,
|
|
4049
4056
|
citations: n.citations,
|
|
4050
4057
|
elements: r
|
|
@@ -4052,19 +4059,19 @@ function es(e) {
|
|
|
4052
4059
|
}
|
|
4053
4060
|
if (n.type === "dynamic-tool") {
|
|
4054
4061
|
let e;
|
|
4055
|
-
return t[4] !== i || t[5] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
4062
|
+
return t[4] !== i || t[5] !== n ? (e = i ? /* @__PURE__ */ M(ti, { part: n }) : null, t[4] = i, t[5] = n, t[6] = e) : e = t[6], e;
|
|
4056
4063
|
}
|
|
4057
4064
|
if (S(n)) {
|
|
4058
4065
|
let e;
|
|
4059
|
-
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(
|
|
4066
|
+
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M($o, { part: n }), t[7] = n, t[8] = e), e;
|
|
4060
4067
|
}
|
|
4061
4068
|
if (n.type === "reasoning" && n.text) {
|
|
4062
4069
|
let e;
|
|
4063
|
-
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
4070
|
+
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(es, { part: n }) : null, t[9] = i, t[10] = n, t[11] = e) : e = t[11], e;
|
|
4064
4071
|
}
|
|
4065
4072
|
if (n.type === "file") {
|
|
4066
4073
|
let e;
|
|
4067
|
-
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(
|
|
4074
|
+
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(Ai, {
|
|
4068
4075
|
filename: n.filename,
|
|
4069
4076
|
mediaType: n.mediaType,
|
|
4070
4077
|
url: n.url
|
|
@@ -4072,13 +4079,13 @@ function es(e) {
|
|
|
4072
4079
|
}
|
|
4073
4080
|
return null;
|
|
4074
4081
|
}
|
|
4075
|
-
var
|
|
4082
|
+
var ns = c(function(e) {
|
|
4076
4083
|
let t = O(10), { className: n } = e, { message: r } = K(), i;
|
|
4077
4084
|
t[0] === n ? i = t[1] : (i = k("flex-1 space-y-3", n), t[0] = n, t[1] = i);
|
|
4078
4085
|
let a;
|
|
4079
4086
|
if (t[2] !== r.id || t[3] !== r.parts) {
|
|
4080
4087
|
let e;
|
|
4081
|
-
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(
|
|
4088
|
+
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(ts, { part: e }, `${r.id}-${t}`), t[5] = r.id, t[6] = e), a = r.parts.map(e), t[2] = r.id, t[3] = r.parts, t[4] = a;
|
|
4082
4089
|
} else a = t[4];
|
|
4083
4090
|
let o;
|
|
4084
4091
|
return t[7] !== i || t[8] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
@@ -4086,9 +4093,9 @@ var ts = c(function(e) {
|
|
|
4086
4093
|
children: a
|
|
4087
4094
|
}), t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
4088
4095
|
});
|
|
4089
|
-
function
|
|
4096
|
+
function rs(e) {
|
|
4090
4097
|
let t = O(9), { className: n, label: r } = e, i;
|
|
4091
|
-
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(
|
|
4098
|
+
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(is).pop() || "Thinking...", t[0] = r, t[1] = i);
|
|
4092
4099
|
let a = i, o;
|
|
4093
4100
|
t[2] === n ? o = t[3] : (o = k("flex items-start", n), t[2] = n, t[3] = o);
|
|
4094
4101
|
let s;
|
|
@@ -4103,33 +4110,33 @@ function ns(e) {
|
|
|
4103
4110
|
children: s
|
|
4104
4111
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4105
4112
|
}
|
|
4106
|
-
function
|
|
4113
|
+
function is(e) {
|
|
4107
4114
|
return e.trim();
|
|
4108
4115
|
}
|
|
4109
|
-
function
|
|
4116
|
+
function as() {
|
|
4110
4117
|
let e = O(5), t = G(), { messages: n } = W(), r = n[n.length - 1], i;
|
|
4111
|
-
e[0] !== t || e[1] !== r ? (i =
|
|
4118
|
+
e[0] !== t || e[1] !== r ? (i = Ta(t, r), e[0] = t, e[1] = r, e[2] = i) : i = e[2];
|
|
4112
4119
|
let a = i;
|
|
4113
4120
|
if (!a) return null;
|
|
4114
4121
|
let o;
|
|
4115
|
-
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(
|
|
4122
|
+
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(rs, {
|
|
4116
4123
|
label: a,
|
|
4117
4124
|
className: "mt-2"
|
|
4118
4125
|
}), e[3] = a, e[4] = o), o;
|
|
4119
4126
|
}
|
|
4120
|
-
var
|
|
4121
|
-
Root:
|
|
4122
|
-
List:
|
|
4123
|
-
Item:
|
|
4124
|
-
UserBubble:
|
|
4125
|
-
AssistantContent:
|
|
4126
|
-
Thinking:
|
|
4127
|
-
Error:
|
|
4128
|
-
Actions:
|
|
4129
|
-
CopyAction:
|
|
4130
|
-
RegenerateAction:
|
|
4131
|
-
CopyDebugJsonAction:
|
|
4132
|
-
},
|
|
4127
|
+
var os = {
|
|
4128
|
+
Root: ya,
|
|
4129
|
+
List: ba,
|
|
4130
|
+
Item: xa,
|
|
4131
|
+
UserBubble: so,
|
|
4132
|
+
AssistantContent: ns,
|
|
4133
|
+
Thinking: as,
|
|
4134
|
+
Error: va,
|
|
4135
|
+
Actions: pa,
|
|
4136
|
+
CopyAction: ma,
|
|
4137
|
+
RegenerateAction: ha,
|
|
4138
|
+
CopyDebugJsonAction: ga
|
|
4139
|
+
}, ss = {
|
|
4133
4140
|
braille: {
|
|
4134
4141
|
frames: [
|
|
4135
4142
|
"⠋",
|
|
@@ -4196,10 +4203,10 @@ var as = {
|
|
|
4196
4203
|
interval: 100
|
|
4197
4204
|
}
|
|
4198
4205
|
};
|
|
4199
|
-
function
|
|
4206
|
+
function cs(e) {
|
|
4200
4207
|
let t = O(15), n, r, i;
|
|
4201
4208
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, variant: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
4202
|
-
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } =
|
|
4209
|
+
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } = ss[a], [l, u] = g(0), f, p;
|
|
4203
4210
|
t[4] !== o || t[5] !== s.length || t[6] !== c ? (f = () => {
|
|
4204
4211
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
4205
4212
|
let e = o.setInterval(() => {
|
|
@@ -4224,9 +4231,9 @@ function ss(e) {
|
|
|
4224
4231
|
}
|
|
4225
4232
|
//#endregion
|
|
4226
4233
|
//#region src/lib/chat/trajectory/trajectories/timeline.tsx
|
|
4227
|
-
function
|
|
4234
|
+
function ls(e) {
|
|
4228
4235
|
let t = O(11), { Icon: n, isLast: r, isLoading: i, aborted: a, state: o, isError: s } = e, c;
|
|
4229
|
-
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(
|
|
4236
|
+
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(cs, { className: "text-muted-foreground z-10 shrink-0 text-sm" }) : a ? /* @__PURE__ */ M(Ie, { className: "text-destructive z-10 size-3.5 shrink-0" }) : /* @__PURE__ */ M(n, { className: k("z-10 size-3.5 shrink-0", o === "output-error" || s ? "text-destructive" : "text-muted-foreground") }), t[0] = n, t[1] = a, t[2] = s, t[3] = i, t[4] = o, t[5] = c) : c = t[5];
|
|
4230
4237
|
let l;
|
|
4231
4238
|
t[6] === r ? l = t[7] : (l = !r && /* @__PURE__ */ M("span", { className: "bg-border w-px flex-1" }), t[6] = r, t[7] = l);
|
|
4232
4239
|
let u;
|
|
@@ -4235,16 +4242,16 @@ function cs(e) {
|
|
|
4235
4242
|
children: [c, l]
|
|
4236
4243
|
}), t[8] = c, t[9] = l, t[10] = u) : u = t[10], u;
|
|
4237
4244
|
}
|
|
4238
|
-
function
|
|
4239
|
-
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(
|
|
4240
|
-
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(
|
|
4245
|
+
function us(e) {
|
|
4246
|
+
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(Qi), c = r ?? s?.label, u = i ?? s?.state, d = a ?? s?.aborted ?? !1, f = c?.icon, p = !!u && !d && u !== "output-available" && u !== "output-error", m;
|
|
4247
|
+
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(ls, {
|
|
4241
4248
|
Icon: f,
|
|
4242
4249
|
isLast: n,
|
|
4243
4250
|
isLoading: p,
|
|
4244
4251
|
aborted: d,
|
|
4245
4252
|
state: u,
|
|
4246
4253
|
isError: c?.isError ?? !1
|
|
4247
|
-
}) : /* @__PURE__ */ M(
|
|
4254
|
+
}) : /* @__PURE__ */ M(Ea, { isLast: n }), t[0] = f, t[1] = d, t[2] = c?.isError, t[3] = u, t[4] = n, t[5] = p, t[6] = m) : m = t[6];
|
|
4248
4255
|
let h = m, g = n ? "" : "pb-3.5", _;
|
|
4249
4256
|
t[7] === g ? _ = t[8] : (_ = k("min-w-0 flex-1", g), t[7] = g, t[8] = _);
|
|
4250
4257
|
let v;
|
|
@@ -4253,16 +4260,16 @@ function ls(e) {
|
|
|
4253
4260
|
children: o
|
|
4254
4261
|
}), t[9] = o, t[10] = _, t[11] = v) : v = t[11];
|
|
4255
4262
|
let y;
|
|
4256
|
-
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(
|
|
4263
|
+
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(Da, {
|
|
4257
4264
|
marker: h,
|
|
4258
4265
|
children: v
|
|
4259
4266
|
}), t[12] = h, t[13] = v, t[14] = y) : y = t[14], y;
|
|
4260
4267
|
}
|
|
4261
|
-
function
|
|
4268
|
+
function ds(e) {
|
|
4262
4269
|
let t = O(10), { label: n, state: r, part: i, defaultOpen: a, children: o } = e, s = a !== void 0 && a, c;
|
|
4263
4270
|
t[0] !== n || t[1] !== i || t[2] !== r ? (c = /* @__PURE__ */ M(L, {
|
|
4264
4271
|
className: "cursor-pointer",
|
|
4265
|
-
children: /* @__PURE__ */ M(
|
|
4272
|
+
children: /* @__PURE__ */ M(Ui, {
|
|
4266
4273
|
label: n,
|
|
4267
4274
|
state: r,
|
|
4268
4275
|
part: i
|
|
@@ -4277,17 +4284,17 @@ function us(e) {
|
|
|
4277
4284
|
children: [c, l]
|
|
4278
4285
|
}), t[6] = s, t[7] = c, t[8] = l, t[9] = u) : u = t[9], u;
|
|
4279
4286
|
}
|
|
4280
|
-
var
|
|
4281
|
-
Item:
|
|
4282
|
-
Disclosure:
|
|
4283
|
-
},
|
|
4284
|
-
Root:
|
|
4285
|
-
List:
|
|
4286
|
-
Item:
|
|
4287
|
-
UserBubble:
|
|
4287
|
+
var fs = {
|
|
4288
|
+
Item: us,
|
|
4289
|
+
Disclosure: ds
|
|
4290
|
+
}, ps = {
|
|
4291
|
+
Root: ya,
|
|
4292
|
+
List: ba,
|
|
4293
|
+
Item: xa,
|
|
4294
|
+
UserBubble: so,
|
|
4288
4295
|
AssistantContent: c(function(e) {
|
|
4289
|
-
let t = O(12), { className: n } = e, { message: r } = K(), { elements: i } = W(), { debugMode: a } = z(), o =
|
|
4290
|
-
t[0] === r.parts ? c = t[1] : (c =
|
|
4296
|
+
let t = O(12), { className: n } = e, { message: r } = K(), { elements: i } = W(), { debugMode: a } = z(), o = Ri(), s = Y(), c;
|
|
4297
|
+
t[0] === r.parts ? c = t[1] : (c = oa(r.parts), t[0] = r.parts, t[1] = c);
|
|
4291
4298
|
let l = c, u;
|
|
4292
4299
|
t[2] !== a || t[3] !== i || t[4] !== s || t[5] !== r.id || t[6] !== l || t[7] !== o ? (u = l.map((e, t) => {
|
|
4293
4300
|
let n = `${r.id}-${Z(e, t)}-${e.kind}`;
|
|
@@ -4300,33 +4307,33 @@ var ds = {
|
|
|
4300
4307
|
if (e.kind === "source") return /* @__PURE__ */ M(X.Source, { segment: e }, n);
|
|
4301
4308
|
if (e.kind === "dynamic-tool") {
|
|
4302
4309
|
if (!o) return null;
|
|
4303
|
-
let r = !
|
|
4304
|
-
return /* @__PURE__ */ M(
|
|
4310
|
+
let r = !aa(l, t, !0);
|
|
4311
|
+
return /* @__PURE__ */ M(fs.Item, {
|
|
4305
4312
|
isLast: r,
|
|
4306
4313
|
children: /* @__PURE__ */ M(X.DynamicTool, { segment: e })
|
|
4307
4314
|
}, n);
|
|
4308
4315
|
}
|
|
4309
4316
|
if (e.kind === "reasoning") {
|
|
4310
4317
|
if (s || e.part.type !== "reasoning") return null;
|
|
4311
|
-
let r = !
|
|
4318
|
+
let r = !aa(l, t, a), i = {
|
|
4312
4319
|
name: "Reasoning",
|
|
4313
4320
|
icon: Je,
|
|
4314
4321
|
args: { text: [...e.part.text].slice(0, 60).join("") }
|
|
4315
4322
|
};
|
|
4316
|
-
return /* @__PURE__ */ M(
|
|
4323
|
+
return /* @__PURE__ */ M(fs.Item, {
|
|
4317
4324
|
isLast: r,
|
|
4318
4325
|
label: i,
|
|
4319
|
-
children: /* @__PURE__ */ M(
|
|
4326
|
+
children: /* @__PURE__ */ M(fs.Disclosure, {
|
|
4320
4327
|
label: i,
|
|
4321
4328
|
children: /* @__PURE__ */ M(X.Reasoning, { segment: e })
|
|
4322
4329
|
})
|
|
4323
4330
|
}, n);
|
|
4324
4331
|
}
|
|
4325
4332
|
if (e.kind === "tool") {
|
|
4326
|
-
let r = !
|
|
4333
|
+
let r = !aa(l, t, a);
|
|
4327
4334
|
return /* @__PURE__ */ M(X.Tool, {
|
|
4328
4335
|
segment: e,
|
|
4329
|
-
children: /* @__PURE__ */ M(
|
|
4336
|
+
children: /* @__PURE__ */ M(fs.Item, {
|
|
4330
4337
|
isLast: r,
|
|
4331
4338
|
children: /* @__PURE__ */ M(X.ToolDisclosure, {})
|
|
4332
4339
|
})
|
|
@@ -4340,19 +4347,19 @@ var ds = {
|
|
|
4340
4347
|
children: u
|
|
4341
4348
|
}), t[9] = n, t[10] = u, t[11] = d) : d = t[11], d;
|
|
4342
4349
|
}),
|
|
4343
|
-
Actions:
|
|
4344
|
-
CopyAction:
|
|
4345
|
-
RegenerateAction:
|
|
4346
|
-
CopyDebugJsonAction:
|
|
4347
|
-
Thinking:
|
|
4348
|
-
Error:
|
|
4350
|
+
Actions: pa,
|
|
4351
|
+
CopyAction: ma,
|
|
4352
|
+
RegenerateAction: ha,
|
|
4353
|
+
CopyDebugJsonAction: ga,
|
|
4354
|
+
Thinking: Oa,
|
|
4355
|
+
Error: va
|
|
4349
4356
|
};
|
|
4350
4357
|
//#endregion
|
|
4351
4358
|
//#region src/lib/components/ChatComposer.tsx
|
|
4352
|
-
function
|
|
4359
|
+
function ms(e) {
|
|
4353
4360
|
let t = O(9), n, r;
|
|
4354
4361
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4355
|
-
let { hasSubmitted: i } =
|
|
4362
|
+
let { hasSubmitted: i } = B(), a;
|
|
4356
4363
|
t[3] === n ? a = t[4] : (a = k("bg-background sticky bottom-0 rounded-t-2xl border-0 **:data-[slot=composer-editor]:!min-h-15", n), t[3] = n, t[4] = a);
|
|
4357
4364
|
let o;
|
|
4358
4365
|
return t[5] !== i || t[6] !== r || t[7] !== a ? (o = /* @__PURE__ */ M(R.Root, {
|
|
@@ -4361,7 +4368,7 @@ function ps(e) {
|
|
|
4361
4368
|
...r
|
|
4362
4369
|
}), t[5] = i, t[6] = r, t[7] = a, t[8] = o) : o = t[8], o;
|
|
4363
4370
|
}
|
|
4364
|
-
function
|
|
4371
|
+
function hs(e) {
|
|
4365
4372
|
let t = O(8), n, r;
|
|
4366
4373
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4367
4374
|
let i;
|
|
@@ -4372,7 +4379,7 @@ function ms(e) {
|
|
|
4372
4379
|
...r
|
|
4373
4380
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4374
4381
|
}
|
|
4375
|
-
function
|
|
4382
|
+
function gs(e) {
|
|
4376
4383
|
let t = O(8), n, r;
|
|
4377
4384
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4378
4385
|
let i;
|
|
@@ -4383,7 +4390,7 @@ function hs(e) {
|
|
|
4383
4390
|
...r
|
|
4384
4391
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4385
4392
|
}
|
|
4386
|
-
function
|
|
4393
|
+
function _s(e) {
|
|
4387
4394
|
let t = O(8), n, r;
|
|
4388
4395
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4389
4396
|
let i;
|
|
@@ -4394,7 +4401,7 @@ function gs(e) {
|
|
|
4394
4401
|
...r
|
|
4395
4402
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4396
4403
|
}
|
|
4397
|
-
function
|
|
4404
|
+
function vs(e) {
|
|
4398
4405
|
let t = O(8), n, r;
|
|
4399
4406
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4400
4407
|
let i;
|
|
@@ -4405,7 +4412,7 @@ function _s(e) {
|
|
|
4405
4412
|
...r
|
|
4406
4413
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4407
4414
|
}
|
|
4408
|
-
function
|
|
4415
|
+
function ys(e) {
|
|
4409
4416
|
let t = O(8), n, r;
|
|
4410
4417
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4411
4418
|
let i;
|
|
@@ -4416,7 +4423,7 @@ function vs(e) {
|
|
|
4416
4423
|
...r
|
|
4417
4424
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4418
4425
|
}
|
|
4419
|
-
function
|
|
4426
|
+
function bs(e) {
|
|
4420
4427
|
let t = O(3), n;
|
|
4421
4428
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ M(Q, { icon: /* @__PURE__ */ M($e, { className: "size-4" }) }), t[0] = n) : n = t[0];
|
|
4422
4429
|
let r;
|
|
@@ -4426,7 +4433,7 @@ function ys(e) {
|
|
|
4426
4433
|
...e
|
|
4427
4434
|
}), t[1] = e, t[2] = r), r;
|
|
4428
4435
|
}
|
|
4429
|
-
function
|
|
4436
|
+
function xs() {
|
|
4430
4437
|
let e = O(6), { actions: t, meta: n } = Tt("ChatComposer.CommandButton"), r;
|
|
4431
4438
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M(et, { className: "size-4" }), e[0] = r) : r = e[0];
|
|
4432
4439
|
let i = n.activePopup?.trigger === "/", a;
|
|
@@ -4442,7 +4449,7 @@ function bs() {
|
|
|
4442
4449
|
onClick: a
|
|
4443
4450
|
}), e[3] = i, e[4] = a, e[5] = o) : o = e[5], o;
|
|
4444
4451
|
}
|
|
4445
|
-
function
|
|
4452
|
+
function Ss(e) {
|
|
4446
4453
|
switch (e) {
|
|
4447
4454
|
case "permission-denied": return "Allow microphone access to use dictation";
|
|
4448
4455
|
case "no-microphone": return "Connect a microphone to use dictation";
|
|
@@ -4451,17 +4458,17 @@ function xs(e) {
|
|
|
4451
4458
|
case "transcription-failed": return "Unable to transcribe audio";
|
|
4452
4459
|
}
|
|
4453
4460
|
}
|
|
4454
|
-
function
|
|
4461
|
+
function Cs(e) {
|
|
4455
4462
|
switch (e.status) {
|
|
4456
4463
|
case "unavailable": return e.reason === "blocked" ? "Allow microphone access in your browser settings to use dictation" : "Dictation is not available in this browser";
|
|
4457
4464
|
case "idle": return "Start dictation";
|
|
4458
4465
|
case "starting": return "Starting dictation";
|
|
4459
4466
|
case "recording": return "Stop dictation";
|
|
4460
4467
|
case "finishing": return "Transcribing…";
|
|
4461
|
-
case "failed": return
|
|
4468
|
+
case "failed": return Ss(e.error.code);
|
|
4462
4469
|
}
|
|
4463
4470
|
}
|
|
4464
|
-
function
|
|
4471
|
+
function ws(e) {
|
|
4465
4472
|
switch (e.status) {
|
|
4466
4473
|
case "recording": return /* @__PURE__ */ M(nt, { className: "size-4 fill-current" });
|
|
4467
4474
|
case "starting":
|
|
@@ -4471,11 +4478,11 @@ function Cs(e) {
|
|
|
4471
4478
|
case "failed": return /* @__PURE__ */ M(Qe, { className: "size-4" });
|
|
4472
4479
|
}
|
|
4473
4480
|
}
|
|
4474
|
-
function
|
|
4475
|
-
let e = O(20), { status: t } =
|
|
4476
|
-
e[0] === n ? r = e[1] : (r =
|
|
4481
|
+
function Ts() {
|
|
4482
|
+
let e = O(20), { status: t } = Qt(), { state: n } = Et("ChatComposer.Dictate"), r;
|
|
4483
|
+
e[0] === n ? r = e[1] : (r = Cs(n), e[0] = n, e[1] = r);
|
|
4477
4484
|
let i = r, a = n.status === "starting" || n.status === "recording" || n.status === "finishing", o = t === "streaming" || t === "submitted", s;
|
|
4478
|
-
e[2] === n ? s = e[3] : (s =
|
|
4485
|
+
e[2] === n ? s = e[3] : (s = ws(n), e[2] = n, e[3] = s);
|
|
4479
4486
|
let c;
|
|
4480
4487
|
e[4] !== i || e[5] !== s ? (c = /* @__PURE__ */ M(Q, {
|
|
4481
4488
|
icon: s,
|
|
@@ -4505,22 +4512,22 @@ function ws() {
|
|
|
4505
4512
|
d
|
|
4506
4513
|
] }), e[16] = l, e[17] = u, e[18] = d, e[19] = f) : f = e[19], f;
|
|
4507
4514
|
}
|
|
4508
|
-
var
|
|
4509
|
-
Provider:
|
|
4510
|
-
Root:
|
|
4515
|
+
var Es = {
|
|
4516
|
+
Provider: ms,
|
|
4517
|
+
Root: hs,
|
|
4511
4518
|
Popup: R.Popup,
|
|
4512
|
-
Content:
|
|
4513
|
-
Attachments:
|
|
4514
|
-
Editor:
|
|
4519
|
+
Content: gs,
|
|
4520
|
+
Attachments: vs,
|
|
4521
|
+
Editor: _s,
|
|
4515
4522
|
Error: R.Error,
|
|
4516
|
-
Toolbar:
|
|
4517
|
-
CommandButton:
|
|
4518
|
-
AttachFiles:
|
|
4519
|
-
Dictate:
|
|
4523
|
+
Toolbar: ys,
|
|
4524
|
+
CommandButton: xs,
|
|
4525
|
+
AttachFiles: bs,
|
|
4526
|
+
Dictate: Ts
|
|
4520
4527
|
};
|
|
4521
4528
|
//#endregion
|
|
4522
4529
|
//#region src/lib/components/ChatTextarea.tsx
|
|
4523
|
-
function
|
|
4530
|
+
function Ds(e) {
|
|
4524
4531
|
let t = O(10), n, r, i;
|
|
4525
4532
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, ref: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
4526
4533
|
let a;
|
|
@@ -4537,7 +4544,7 @@ function Es(e) {
|
|
|
4537
4544
|
}
|
|
4538
4545
|
//#endregion
|
|
4539
4546
|
//#region src/lib/components/queue.tsx
|
|
4540
|
-
function
|
|
4547
|
+
function Os(e) {
|
|
4541
4548
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4542
4549
|
t[0] === r ? i = t[1] : (i = k("border-border flex flex-col border-b px-2 py-1.5", r), t[0] = r, t[1] = i);
|
|
4543
4550
|
let a;
|
|
@@ -4546,7 +4553,7 @@ function Ds(e) {
|
|
|
4546
4553
|
children: n
|
|
4547
4554
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4548
4555
|
}
|
|
4549
|
-
function
|
|
4556
|
+
function ks(e) {
|
|
4550
4557
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4551
4558
|
t[0] === r ? i = t[1] : (i = k("flex items-center gap-2 px-2 py-1.5", r), t[0] = r, t[1] = i);
|
|
4552
4559
|
let a;
|
|
@@ -4555,13 +4562,13 @@ function Os(e) {
|
|
|
4555
4562
|
children: n
|
|
4556
4563
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4557
4564
|
}
|
|
4558
|
-
function
|
|
4565
|
+
function As(e) {
|
|
4559
4566
|
let t = O(4), { className: n } = e, r;
|
|
4560
4567
|
t[0] === n ? r = t[1] : (r = k("text-muted-foreground size-3.5 shrink-0", n), t[0] = n, t[1] = r);
|
|
4561
4568
|
let i;
|
|
4562
4569
|
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(Ye, { className: r }), t[2] = r, t[3] = i), i;
|
|
4563
4570
|
}
|
|
4564
|
-
function
|
|
4571
|
+
function js(e) {
|
|
4565
4572
|
let t = O(7), { children: n, className: r } = e, i;
|
|
4566
4573
|
t[0] === r ? i = t[1] : (i = k("min-w-0 flex-1 truncate text-sm", r), t[0] = r, t[1] = i);
|
|
4567
4574
|
let a;
|
|
@@ -4572,7 +4579,7 @@ function As(e) {
|
|
|
4572
4579
|
children: a
|
|
4573
4580
|
}), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
|
|
4574
4581
|
}
|
|
4575
|
-
function
|
|
4582
|
+
function Ms(e) {
|
|
4576
4583
|
let t = O(6), { onClick: n, className: r } = e, i;
|
|
4577
4584
|
t[0] === r ? i = t[1] : (i = k("text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors", r), t[0] = r, t[1] = i);
|
|
4578
4585
|
let a;
|
|
@@ -4586,13 +4593,13 @@ function js(e) {
|
|
|
4586
4593
|
children: a
|
|
4587
4594
|
}), t[3] = n, t[4] = i, t[5] = o) : o = t[5], o;
|
|
4588
4595
|
}
|
|
4589
|
-
var
|
|
4590
|
-
Root:
|
|
4591
|
-
Item:
|
|
4592
|
-
Icon:
|
|
4593
|
-
Text:
|
|
4594
|
-
Remove:
|
|
4595
|
-
},
|
|
4596
|
+
var Ns = {
|
|
4597
|
+
Root: Os,
|
|
4598
|
+
Item: ks,
|
|
4599
|
+
Icon: As,
|
|
4600
|
+
Text: js,
|
|
4601
|
+
Remove: Ms
|
|
4602
|
+
}, Ps = {
|
|
4596
4603
|
normal: {
|
|
4597
4604
|
d: "m5 12 7-7 7 7",
|
|
4598
4605
|
translateY: 0
|
|
@@ -4606,7 +4613,7 @@ var Ms = {
|
|
|
4606
4613
|
],
|
|
4607
4614
|
transition: { duration: .4 }
|
|
4608
4615
|
}
|
|
4609
|
-
},
|
|
4616
|
+
}, Fs = {
|
|
4610
4617
|
normal: { d: "M12 19V5" },
|
|
4611
4618
|
animate: {
|
|
4612
4619
|
d: [
|
|
@@ -4616,7 +4623,7 @@ var Ms = {
|
|
|
4616
4623
|
],
|
|
4617
4624
|
transition: { duration: .4 }
|
|
4618
4625
|
}
|
|
4619
|
-
},
|
|
4626
|
+
}, Is = (e) => {
|
|
4620
4627
|
let t = O(30), n, r, i, a, o, s;
|
|
4621
4628
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6]) : ({ref: o, onMouseEnter: r, onMouseLeave: i, className: n, size: s, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s);
|
|
4622
4629
|
let c = s === void 0 ? 20 : s, l = ne(), u = h(!1), d;
|
|
@@ -4638,11 +4645,11 @@ var Ms = {
|
|
|
4638
4645
|
t[17] === l ? (y = t[18], b = t[19]) : (y = /* @__PURE__ */ M(A.path, {
|
|
4639
4646
|
animate: l,
|
|
4640
4647
|
d: "m5 12 7-7 7 7",
|
|
4641
|
-
variants:
|
|
4648
|
+
variants: Ps
|
|
4642
4649
|
}), b = /* @__PURE__ */ M(A.path, {
|
|
4643
4650
|
animate: l,
|
|
4644
4651
|
d: "M12 19V5",
|
|
4645
|
-
variants:
|
|
4652
|
+
variants: Fs
|
|
4646
4653
|
}), t[17] = l, t[18] = y, t[19] = b);
|
|
4647
4654
|
let x;
|
|
4648
4655
|
t[20] !== c || t[21] !== y || t[22] !== b ? (x = /* @__PURE__ */ N("svg", {
|
|
@@ -4666,10 +4673,10 @@ var Ms = {
|
|
|
4666
4673
|
children: x
|
|
4667
4674
|
}), t[24] = m, t[25] = _, t[26] = a, t[27] = v, t[28] = x, t[29] = S) : S = t[29], S;
|
|
4668
4675
|
};
|
|
4669
|
-
|
|
4676
|
+
Is.displayName = "ArrowUpIcon";
|
|
4670
4677
|
//#endregion
|
|
4671
4678
|
//#region src/lib/components/SubmitButton.tsx
|
|
4672
|
-
var
|
|
4679
|
+
var Ls = {
|
|
4673
4680
|
duration: .15,
|
|
4674
4681
|
ease: [
|
|
4675
4682
|
0,
|
|
@@ -4677,7 +4684,7 @@ var Is = {
|
|
|
4677
4684
|
.2,
|
|
4678
4685
|
1
|
|
4679
4686
|
]
|
|
4680
|
-
},
|
|
4687
|
+
}, Rs = {
|
|
4681
4688
|
duration: .12,
|
|
4682
4689
|
ease: [
|
|
4683
4690
|
0,
|
|
@@ -4686,7 +4693,7 @@ var Is = {
|
|
|
4686
4693
|
1
|
|
4687
4694
|
]
|
|
4688
4695
|
};
|
|
4689
|
-
function
|
|
4696
|
+
function zs(e) {
|
|
4690
4697
|
let t = O(40), n, r, i, a;
|
|
4691
4698
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({variant: a, className: n, disabled: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
|
|
4692
4699
|
let o = re(), s = a === "stop", c;
|
|
@@ -4726,7 +4733,7 @@ function Rs(e) {
|
|
|
4726
4733
|
scale: .7
|
|
4727
4734
|
}, t[21] = o, t[22] = v);
|
|
4728
4735
|
let y;
|
|
4729
|
-
t[23] === s ? y = t[24] : (y = M(s ?
|
|
4736
|
+
t[23] === s ? y = t[24] : (y = M(s ? Hs : Vs, {}), t[23] = s, t[24] = y);
|
|
4730
4737
|
let b;
|
|
4731
4738
|
t[25] !== v || t[26] !== y || t[27] !== h || t[28] !== g ? (b = /* @__PURE__ */ M(te, {
|
|
4732
4739
|
initial: !1,
|
|
@@ -4734,7 +4741,7 @@ function Rs(e) {
|
|
|
4734
4741
|
initial: g,
|
|
4735
4742
|
animate: _,
|
|
4736
4743
|
exit: v,
|
|
4737
|
-
transition:
|
|
4744
|
+
transition: Rs,
|
|
4738
4745
|
className: "absolute flex items-center justify-center",
|
|
4739
4746
|
children: y
|
|
4740
4747
|
}, h)
|
|
@@ -4744,7 +4751,7 @@ function Rs(e) {
|
|
|
4744
4751
|
initial: c,
|
|
4745
4752
|
animate: l,
|
|
4746
4753
|
exit: u,
|
|
4747
|
-
transition:
|
|
4754
|
+
transition: Ls,
|
|
4748
4755
|
whileHover: d,
|
|
4749
4756
|
whileTap: f,
|
|
4750
4757
|
"aria-label": p,
|
|
@@ -4754,7 +4761,7 @@ function Rs(e) {
|
|
|
4754
4761
|
children: b
|
|
4755
4762
|
}), t[30] = r, t[31] = i, t[32] = c, t[33] = b, t[34] = u, t[35] = d, t[36] = f, t[37] = p, t[38] = m, t[39] = x) : x = t[39], x;
|
|
4756
4763
|
}
|
|
4757
|
-
function
|
|
4764
|
+
function Bs(e) {
|
|
4758
4765
|
let t = O(2), { children: n } = e, r;
|
|
4759
4766
|
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M("svg", {
|
|
4760
4767
|
width: "20",
|
|
@@ -4765,13 +4772,13 @@ function zs(e) {
|
|
|
4765
4772
|
children: n
|
|
4766
4773
|
}), t[0] = n, t[1] = r), r;
|
|
4767
4774
|
}
|
|
4768
|
-
function
|
|
4775
|
+
function Vs() {
|
|
4769
4776
|
let e = O(1), t;
|
|
4770
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4777
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Is, {}), e[0] = t) : t = e[0], t;
|
|
4771
4778
|
}
|
|
4772
|
-
function
|
|
4779
|
+
function Hs() {
|
|
4773
4780
|
let e = O(1), t;
|
|
4774
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4781
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Bs, { children: /* @__PURE__ */ M("rect", {
|
|
4775
4782
|
x: "5",
|
|
4776
4783
|
y: "5",
|
|
4777
4784
|
width: "10",
|
|
@@ -4781,9 +4788,9 @@ function Vs() {
|
|
|
4781
4788
|
}
|
|
4782
4789
|
//#endregion
|
|
4783
4790
|
//#region src/lib/components/tool-error.tsx
|
|
4784
|
-
function
|
|
4785
|
-
let t = O(25), { title: n, detail: r, detailLabel: i, part: a, error: o } = e, s = n === void 0 ? "Failed to render tool" : n, c = i === void 0 ? "View details" : i, l =
|
|
4786
|
-
t[0] === o.issues ? u = t[1] : (u = o.issues.map(
|
|
4791
|
+
function Us(e) {
|
|
4792
|
+
let t = O(25), { title: n, detail: r, detailLabel: i, part: a, error: o } = e, s = n === void 0 ? "Failed to render tool" : n, c = i === void 0 ? "View details" : i, l = V(), u;
|
|
4793
|
+
t[0] === o.issues ? u = t[1] : (u = o.issues.map(Ws).join("\n"), t[0] = o.issues, t[1] = u);
|
|
4787
4794
|
let d = u, f;
|
|
4788
4795
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(Fe, { className: "size-5" }), t[2] = f) : f = t[2];
|
|
4789
4796
|
let p;
|
|
@@ -4851,71 +4858,71 @@ function Hs(e) {
|
|
|
4851
4858
|
]
|
|
4852
4859
|
}), t[21] = v, t[22] = S, t[23] = p, t[24] = C) : C = t[24], C;
|
|
4853
4860
|
}
|
|
4854
|
-
function
|
|
4861
|
+
function Ws(e) {
|
|
4855
4862
|
return `${e.path.join(".")}: ${e.message}`;
|
|
4856
4863
|
}
|
|
4857
4864
|
//#endregion
|
|
4858
4865
|
//#region src/lib/components/Tip/TipProvider.tsx
|
|
4859
|
-
var
|
|
4860
|
-
function
|
|
4861
|
-
return l(
|
|
4866
|
+
var Gs = o("");
|
|
4867
|
+
function Ks() {
|
|
4868
|
+
return l(Gs);
|
|
4862
4869
|
}
|
|
4863
|
-
var
|
|
4864
|
-
function
|
|
4870
|
+
var qs = "tips:history", Js = "tips:session";
|
|
4871
|
+
function Ys() {
|
|
4865
4872
|
try {
|
|
4866
|
-
return JSON.parse(localStorage.getItem(
|
|
4873
|
+
return JSON.parse(localStorage.getItem(qs) ?? "{}");
|
|
4867
4874
|
} catch (e) {
|
|
4868
|
-
if (
|
|
4875
|
+
if (Qs(e)) return {};
|
|
4869
4876
|
throw e;
|
|
4870
4877
|
}
|
|
4871
4878
|
}
|
|
4872
|
-
function
|
|
4879
|
+
function Xs(e, t) {
|
|
4873
4880
|
try {
|
|
4874
|
-
let n =
|
|
4875
|
-
n[e] = t, localStorage.setItem(
|
|
4881
|
+
let n = Ys();
|
|
4882
|
+
n[e] = t, localStorage.setItem(qs, JSON.stringify(n));
|
|
4876
4883
|
} catch (e) {
|
|
4877
|
-
if (!
|
|
4884
|
+
if (!Qs(e)) throw e;
|
|
4878
4885
|
}
|
|
4879
4886
|
}
|
|
4880
|
-
function
|
|
4887
|
+
function Zs(e) {
|
|
4881
4888
|
try {
|
|
4882
|
-
let t = localStorage.getItem(
|
|
4889
|
+
let t = localStorage.getItem(Js), n = t ? JSON.parse(t) : {
|
|
4883
4890
|
id: "",
|
|
4884
4891
|
n: 0
|
|
4885
4892
|
};
|
|
4886
|
-
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(
|
|
4893
|
+
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(Js, JSON.stringify(n))), n.n;
|
|
4887
4894
|
} catch (e) {
|
|
4888
|
-
if (
|
|
4895
|
+
if (Qs(e)) return 0;
|
|
4889
4896
|
throw e;
|
|
4890
4897
|
}
|
|
4891
4898
|
}
|
|
4892
|
-
function
|
|
4899
|
+
function Qs(e) {
|
|
4893
4900
|
return e instanceof SyntaxError || e instanceof DOMException && (e.name === "QuotaExceededError" || e.name === "SecurityError");
|
|
4894
4901
|
}
|
|
4895
|
-
function
|
|
4902
|
+
function $s(e, t, n) {
|
|
4896
4903
|
let r = n[e];
|
|
4897
4904
|
return r == null ? Infinity : t - r;
|
|
4898
4905
|
}
|
|
4899
|
-
async function
|
|
4900
|
-
let r =
|
|
4906
|
+
async function ec(e, t, n) {
|
|
4907
|
+
let r = Ys(), i = await Promise.all(e.map((e) => e.isRelevant(t))), a = e.filter((e, t) => i[t]);
|
|
4901
4908
|
if (a.length === 0) return null;
|
|
4902
|
-
let o = a.filter((e) =>
|
|
4903
|
-
s.sort((e, t) =>
|
|
4909
|
+
let o = a.filter((e) => $s(e.id, n, r) >= e.cooldownSessions), s = o.length > 0 ? o : a;
|
|
4910
|
+
s.sort((e, t) => $s(t.id, n, r) - $s(e.id, n, r));
|
|
4904
4911
|
let c = s[0], l = await c.content(t);
|
|
4905
4912
|
return {
|
|
4906
4913
|
id: c.id,
|
|
4907
4914
|
text: l
|
|
4908
4915
|
};
|
|
4909
4916
|
}
|
|
4910
|
-
function
|
|
4917
|
+
function tc(e) {
|
|
4911
4918
|
let t = O(13), { tips: n, streaming: r, chatId: i, context: a, children: o } = e, s;
|
|
4912
|
-
t[0] === i ? s = t[1] : (s = () =>
|
|
4919
|
+
t[0] === i ? s = t[1] : (s = () => Zs(i), t[0] = i, t[1] = s);
|
|
4913
4920
|
let [c] = g(s), [l, u] = g(""), [p, m] = g(r), [_, v] = g(0);
|
|
4914
|
-
r !== p && (m(r), r && v(
|
|
4921
|
+
r !== p && (m(r), r && v(nc));
|
|
4915
4922
|
let y = h(!1), b;
|
|
4916
4923
|
t[2] !== a || t[3] !== c || t[4] !== n ? (b = () => {
|
|
4917
|
-
y.current || (y.current = !0,
|
|
4918
|
-
e && (u(e.text),
|
|
4924
|
+
y.current || (y.current = !0, ec(n, a, c).then((e) => {
|
|
4925
|
+
e && (u(e.text), Xs(e.id, c));
|
|
4919
4926
|
}).finally(() => {
|
|
4920
4927
|
y.current = !1;
|
|
4921
4928
|
}));
|
|
@@ -4927,17 +4934,17 @@ function ec(e) {
|
|
|
4927
4934
|
let C;
|
|
4928
4935
|
t[8] === _ ? C = t[9] : (C = [_], t[8] = _, t[9] = C), d(S, C);
|
|
4929
4936
|
let w;
|
|
4930
|
-
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(
|
|
4937
|
+
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(Gs, {
|
|
4931
4938
|
value: l,
|
|
4932
4939
|
children: o
|
|
4933
4940
|
}), t[10] = o, t[11] = l, t[12] = w) : w = t[12], w;
|
|
4934
4941
|
}
|
|
4935
|
-
function
|
|
4942
|
+
function nc(e) {
|
|
4936
4943
|
return e + 1;
|
|
4937
4944
|
}
|
|
4938
|
-
function
|
|
4939
|
-
let t = O(6), { tips: n, context: r, children: i } = e, { chatId: a } = z(), { status: o } =
|
|
4940
|
-
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(
|
|
4945
|
+
function rc(e) {
|
|
4946
|
+
let t = O(6), { tips: n, context: r, children: i } = e, { chatId: a } = z(), { status: o } = Qt(), s = o === "streaming" || o === "submitted", c = a ?? "", l;
|
|
4947
|
+
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(tc, {
|
|
4941
4948
|
tips: n,
|
|
4942
4949
|
streaming: s,
|
|
4943
4950
|
chatId: c,
|
|
@@ -4947,14 +4954,14 @@ function nc(e) {
|
|
|
4947
4954
|
}
|
|
4948
4955
|
//#endregion
|
|
4949
4956
|
//#region src/lib/components/Tip/TipLine.tsx
|
|
4950
|
-
var
|
|
4951
|
-
function
|
|
4952
|
-
let t = O(13), { className: n } = e, r = St(), i =
|
|
4957
|
+
var ic = 1.5;
|
|
4958
|
+
function ac(e) {
|
|
4959
|
+
let t = O(13), { className: n } = e, r = St(), i = Ks(), [a, o] = g(i), [s, c] = g(!1);
|
|
4953
4960
|
i !== a && (o(i), i && c(!0));
|
|
4954
4961
|
let l, u;
|
|
4955
4962
|
t[0] !== r || t[1] !== s ? (l = () => {
|
|
4956
4963
|
if (!s) return;
|
|
4957
|
-
let e = r.setTimeout(() => c(!1),
|
|
4964
|
+
let e = r.setTimeout(() => c(!1), ic * 1e3);
|
|
4958
4965
|
return () => r.clearTimeout(e);
|
|
4959
4966
|
}, u = [r, s], t[0] = r, t[1] = s, t[2] = l, t[3] = u) : (l = t[2], u = t[3]), d(l, u);
|
|
4960
4967
|
let f;
|
|
@@ -4965,7 +4972,7 @@ function ic(e) {
|
|
|
4965
4972
|
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(U, {
|
|
4966
4973
|
as: "span",
|
|
4967
4974
|
enabled: s,
|
|
4968
|
-
duration:
|
|
4975
|
+
duration: ic,
|
|
4969
4976
|
children: ["Tip: ", i]
|
|
4970
4977
|
}), t[7] = s, t[8] = i, t[9] = m) : m = t[9];
|
|
4971
4978
|
let h;
|
|
@@ -4976,7 +4983,7 @@ function ic(e) {
|
|
|
4976
4983
|
}
|
|
4977
4984
|
//#endregion
|
|
4978
4985
|
//#region src/lib/hooks/use-async-generator.ts
|
|
4979
|
-
function
|
|
4986
|
+
function oc() {
|
|
4980
4987
|
let [e, t] = g({
|
|
4981
4988
|
loading: !1,
|
|
4982
4989
|
error: null
|
|
@@ -5006,7 +5013,7 @@ function ac() {
|
|
|
5006
5013
|
}
|
|
5007
5014
|
//#endregion
|
|
5008
5015
|
//#region src/lib/hooks/use-auto-resize-textarea.ts
|
|
5009
|
-
function
|
|
5016
|
+
function sc(e) {
|
|
5010
5017
|
let t = O(16), { minHeight: n, maxHeight: r, value: i } = e, a = h(null), o;
|
|
5011
5018
|
t[0] !== r || t[1] !== n ? (o = (e) => {
|
|
5012
5019
|
let t = a.current;
|
|
@@ -5043,22 +5050,22 @@ function oc(e) {
|
|
|
5043
5050
|
}
|
|
5044
5051
|
//#endregion
|
|
5045
5052
|
//#region src/lib/hooks/use-keyboard.ts
|
|
5046
|
-
function
|
|
5053
|
+
function cc(e) {
|
|
5047
5054
|
let t = [];
|
|
5048
5055
|
return e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.altKey && t.push("alt"), e.shiftKey && t.push("shift"), t.push(e.key.toLowerCase()), t.join("+");
|
|
5049
5056
|
}
|
|
5050
|
-
function
|
|
5057
|
+
function lc(e) {
|
|
5051
5058
|
let t = O(4), { enabled: n, handlers: r } = e, i = n === void 0 || n, a, o;
|
|
5052
5059
|
t[0] !== i || t[1] !== r ? (a = () => {
|
|
5053
5060
|
if (!i) return;
|
|
5054
5061
|
let e = (e) => {
|
|
5055
|
-
let t =
|
|
5062
|
+
let t = cc(e), n = r[t];
|
|
5056
5063
|
n ||= r[e.key], n && (e.preventDefault(), e.stopPropagation(), n(e));
|
|
5057
5064
|
};
|
|
5058
5065
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
5059
5066
|
}, o = [i, r], t[0] = i, t[1] = r, t[2] = a, t[3] = o) : (a = t[2], o = t[3]), d(a, o);
|
|
5060
5067
|
}
|
|
5061
5068
|
//#endregion
|
|
5062
|
-
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea,
|
|
5069
|
+
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea, mi as AssistantSnapshot, ni as COPY_EXCLUSION_ATTRIBUTE, ri as COPY_EXCLUSION_MODES, Q as ChatActionButton, zt as ChatBot, Es as ChatComposer, Ft as ChatManager, Ds as ChatTextarea, Qn as CitationPill, Wr as CodeBlock, Gr as CodeBlockCopyButton, Xo as CompactMessages, Jo as CompactTrajectory, ma as CopyAction, ga as CopyDebugJsonAction, Yn as IndexProgress, wi as InteractiveResponse, Zn as MessageItemContext, Ja as MessageMetadata, Ns as MessageQueue, os as Messages, pa as MessagesActions, Xn as MessagesContext, va as MessagesError, xa as MessagesItem, ba as MessagesList, ya as MessagesRoot, so as MessagesUserBubble, da as NestedTrajectory, wa as PendingToolInput, rn as ReadOnlyChatTransport, ha as RegenerateAction, J as Response, X as Segment, ui as SnapshotRenderPortal, zs as SubmitButton, U as TextShimmer, ps as TimelinedMessages, ac as TipLine, tc as TipProvider, Gs as TipValueContext, rc as Tips, Hi as ToolArg, Us as ToolError, oo as UserMessageContent, Va as ZukhrufChatTransport, nn as citationIndexOf, Nt as clearPrefill, oe as defineElements, pi as extractAssistantRawText, tn as extractSourcesFromMessage, Ra as formatUsageBreakdown, La as formatUsageValue, mn as getIndexProgressEvents, Z as getSegmentKey, ai as hasCopyExclusion, vi as isActiveClientInputTool, Gi as isCommentaryTextPart, hi as isSubagentPart, on as isToolAborted, an as isToolStateAborted, Ma as parseMetadataUsage, ja as parseUsage, Pt as persistedPromptOf, jt as readPrefill, si as resolveCopyToClipboardStrategy, _i as resolveToolEntry, cn as serializeToolsRegistry, oi as shouldIncludeInCopyImage, gi as subagentDisplayName, H as urlCitationsOf, Sa as useActivePendingToolInput, z as useAgent, Lt as useAgentChatSetup, V as useAgentMessages, B as useAgentMeta, Qt as useAgentStatus, oc as useAsyncGenerator, sc as useAutoResizeTextarea, $t as useChatManager, Ro as useCompactGroup, fi as useCopyElementAsImage, Y as useIsAssistantSnapshotRender, sn as useIsToolAborted, lc as useKeyboard, K as useMessageItem, W as useMessagesContext, G as useMessagesStatus, Ia as useNormalizedUsageTracking, Ks as useTipValue, $i as useToolSegment, Io as useTrajectoryItems, li as waitForNextPaint, Mt as writePrefill };
|
|
5063
5070
|
|
|
5064
5071
|
//# sourceMappingURL=index.js.map
|