@deepagents/react-genai 7.44.1 → 7.45.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 +926 -844
- package/dist/index.js.map +1 -1
- package/dist/lib/chat/citations.d.ts +8 -1
- package/dist/lib/chat/citations.d.ts.map +1 -1
- package/dist/lib/chat/message-parts.d.ts +3 -2
- package/dist/lib/chat/message-parts.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/messages-context.d.ts +7 -0
- package/dist/lib/chat/trajectory/messages-context.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/segments/index.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/trajectories/messages-shell.d.ts +3 -1
- package/dist/lib/chat/trajectory/trajectories/messages-shell.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/trajectories/messages.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/trajectory-segments.d.ts.map +1 -1
- package/dist/lib/components/CitationPill.d.ts +6 -1
- package/dist/lib/components/CitationPill.d.ts.map +1 -1
- package/dist/lib/elements/normalize-streamdown-children.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -372,20 +372,28 @@ function Qt() {
|
|
|
372
372
|
//#endregion
|
|
373
373
|
//#region src/lib/chat/citations.ts
|
|
374
374
|
function $t(e) {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
375
|
+
return (e ?? []).filter((e) => e.source.sourceType === "url");
|
|
376
|
+
}
|
|
377
|
+
function en(e) {
|
|
378
|
+
let t = /* @__PURE__ */ new Set(), n = [], r = (e, r) => {
|
|
379
|
+
t.has(e) || (t.add(e), n.push({
|
|
380
|
+
url: e,
|
|
381
|
+
title: r
|
|
382
|
+
}));
|
|
383
|
+
};
|
|
384
|
+
for (let t of e) for (let e of t.parts) {
|
|
385
|
+
if (e.type === "text") for (let { source: t } of $t(e.citations)) r(t.url, t.title);
|
|
386
|
+
e.type === "source-url" && r(e.url, e.title);
|
|
387
|
+
}
|
|
380
388
|
return n;
|
|
381
389
|
}
|
|
382
|
-
function
|
|
390
|
+
function tn(e, t) {
|
|
383
391
|
let n = e.findIndex((e) => e.url === t);
|
|
384
392
|
return n === -1 ? null : n + 1;
|
|
385
393
|
}
|
|
386
394
|
//#endregion
|
|
387
395
|
//#region src/lib/chat/read-only-transport.ts
|
|
388
|
-
var
|
|
396
|
+
var nn = class {
|
|
389
397
|
sendMessages() {
|
|
390
398
|
return Promise.reject(/* @__PURE__ */ Error("This chat is read-only: it has no transport to send messages through."));
|
|
391
399
|
}
|
|
@@ -395,19 +403,19 @@ var tn = class {
|
|
|
395
403
|
};
|
|
396
404
|
//#endregion
|
|
397
405
|
//#region src/lib/chat/tool-abort.ts
|
|
398
|
-
function
|
|
406
|
+
function rn(e, t) {
|
|
399
407
|
return t === "streaming" || t === "submitted" ? !1 : e === "input-streaming" || e === "input-available";
|
|
400
408
|
}
|
|
401
|
-
function
|
|
402
|
-
return
|
|
409
|
+
function an(e, t) {
|
|
410
|
+
return rn(e.state, t);
|
|
403
411
|
}
|
|
404
|
-
function
|
|
412
|
+
function on(e) {
|
|
405
413
|
let t = O(3), { status: n } = B(), r;
|
|
406
|
-
return t[0] !== e || t[1] !== n ? (r =
|
|
414
|
+
return t[0] !== e || t[1] !== n ? (r = an(e, n), t[0] = e, t[1] = n, t[2] = r) : r = t[2], r;
|
|
407
415
|
}
|
|
408
416
|
//#endregion
|
|
409
417
|
//#region src/lib/chat/tools-schema.ts
|
|
410
|
-
function
|
|
418
|
+
function sn(e) {
|
|
411
419
|
return Object.entries(e).reduce((e, [t, n]) => (n.static || (e[t] = {
|
|
412
420
|
inputSchema: P.toJSONSchema(n.inputSchema, {
|
|
413
421
|
io: "input",
|
|
@@ -432,7 +440,7 @@ function U(e) {
|
|
|
432
440
|
}
|
|
433
441
|
//#endregion
|
|
434
442
|
//#region src/lib/chat/trajectory/compact-disclosure.tsx
|
|
435
|
-
function
|
|
443
|
+
function cn(e) {
|
|
436
444
|
let t = O(4), { className: n } = e, r;
|
|
437
445
|
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);
|
|
438
446
|
let i;
|
|
@@ -441,22 +449,22 @@ function sn(e) {
|
|
|
441
449
|
className: r
|
|
442
450
|
}), t[2] = r, t[3] = i), i;
|
|
443
451
|
}
|
|
444
|
-
function
|
|
452
|
+
function ln(e) {
|
|
445
453
|
return k("group hover:bg-muted/30 flex min-h-7 w-full gap-2 rounded-sm py-1 text-left transition-colors", e);
|
|
446
454
|
}
|
|
447
455
|
//#endregion
|
|
448
456
|
//#region src/lib/chat/trajectory/IndexProgressSegment.tsx
|
|
449
|
-
var
|
|
457
|
+
var un = "data-text2sql-index-progress", dn = {
|
|
450
458
|
initial: "instant",
|
|
451
459
|
resize: "instant"
|
|
452
460
|
};
|
|
453
|
-
function dn(e) {
|
|
454
|
-
return e.type === ln;
|
|
455
|
-
}
|
|
456
461
|
function fn(e) {
|
|
457
|
-
return e.
|
|
462
|
+
return e.type === un;
|
|
458
463
|
}
|
|
459
464
|
function pn(e) {
|
|
465
|
+
return e.parts.filter(fn).map((e) => e.data);
|
|
466
|
+
}
|
|
467
|
+
function mn(e) {
|
|
460
468
|
let t = /* @__PURE__ */ new Map(), n = "running", r, i, a = (e, n) => {
|
|
461
469
|
let r = t.get(e) ?? {
|
|
462
470
|
name: e,
|
|
@@ -518,11 +526,11 @@ function pn(e) {
|
|
|
518
526
|
errorMessage: i
|
|
519
527
|
};
|
|
520
528
|
}
|
|
521
|
-
function
|
|
529
|
+
function hn(e) {
|
|
522
530
|
let t = O(2), n;
|
|
523
|
-
return t[0] === e ? n = t[1] : (n =
|
|
531
|
+
return t[0] === e ? n = t[1] : (n = mn(e), t[0] = e, t[1] = n), n;
|
|
524
532
|
}
|
|
525
|
-
function
|
|
533
|
+
function gn(e) {
|
|
526
534
|
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;
|
|
527
535
|
t[0] !== i || t[1] !== o || t[2] !== a ? (u = (e) => {
|
|
528
536
|
i === void 0 && c({
|
|
@@ -536,20 +544,20 @@ function hn(e) {
|
|
|
536
544
|
handleOpenChange: d
|
|
537
545
|
}, t[4] = d, t[5] = l, t[6] = f) : f = t[6], f;
|
|
538
546
|
}
|
|
539
|
-
function
|
|
547
|
+
function _n(e, t) {
|
|
540
548
|
return e.length === 0 ? !0 : t.status !== "complete" || t.adapters.length === 0 ? !1 : t.adapters.every((e) => e.status === "cache-hit");
|
|
541
549
|
}
|
|
542
|
-
function
|
|
550
|
+
function vn(e) {
|
|
543
551
|
return e.filter((e) => e.type === "index:start").length;
|
|
544
552
|
}
|
|
545
|
-
function
|
|
553
|
+
function yn(e) {
|
|
546
554
|
return e.filter((e) => [
|
|
547
555
|
"adapter:start",
|
|
548
556
|
"adapter:cache-hit",
|
|
549
557
|
"adapter:cache-miss"
|
|
550
558
|
].includes(e.type)).length;
|
|
551
559
|
}
|
|
552
|
-
function
|
|
560
|
+
function bn(e) {
|
|
553
561
|
let t = (e.totalAdapters ?? e.adapters.length) > 1;
|
|
554
562
|
if (e.status === "error") {
|
|
555
563
|
let n = e.adapters.find((e) => e.status === "error");
|
|
@@ -565,7 +573,7 @@ function yn(e) {
|
|
|
565
573
|
}
|
|
566
574
|
return e.adapters.length === 0 || !t ? ["Schema indexed"] : ["Schema indexed", `${e.adapters.length} adapters`];
|
|
567
575
|
}
|
|
568
|
-
function
|
|
576
|
+
function xn(e) {
|
|
569
577
|
if (e.status === "error") return [
|
|
570
578
|
"Failed",
|
|
571
579
|
e.name,
|
|
@@ -589,18 +597,18 @@ function bn(e) {
|
|
|
589
597
|
"queued"
|
|
590
598
|
];
|
|
591
599
|
}
|
|
592
|
-
function
|
|
600
|
+
function Sn(e) {
|
|
593
601
|
return ["Failed", e.errorMessage ?? "unknown error"];
|
|
594
602
|
}
|
|
595
|
-
var
|
|
596
|
-
function
|
|
597
|
-
let t = l(
|
|
603
|
+
var Cn = o(null);
|
|
604
|
+
function wn(e) {
|
|
605
|
+
let t = l(Cn);
|
|
598
606
|
if (!t) throw Error(`<IndexProgress.${e}> must be used inside <IndexProgress.Root>`);
|
|
599
607
|
return t;
|
|
600
608
|
}
|
|
601
|
-
function
|
|
602
|
-
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s =
|
|
603
|
-
t[0] === n ? l = t[1] : (l =
|
|
609
|
+
function Tn(e) {
|
|
610
|
+
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s = hn(n), c = s.status, l;
|
|
611
|
+
t[0] === n ? l = t[1] : (l = vn(n), t[0] = n, t[1] = l);
|
|
604
612
|
let u;
|
|
605
613
|
t[2] !== r || t[3] !== i || t[4] !== s.status || t[5] !== l ? (u = {
|
|
606
614
|
status: c,
|
|
@@ -608,8 +616,8 @@ function wn(e) {
|
|
|
608
616
|
controlledOpen: r,
|
|
609
617
|
onOpenChange: i
|
|
610
618
|
}, t[2] = r, t[3] = i, t[4] = s.status, t[5] = l, t[6] = u) : u = t[6];
|
|
611
|
-
let { isOpen: d, handleOpenChange: f } =
|
|
612
|
-
if (
|
|
619
|
+
let { isOpen: d, handleOpenChange: f } = gn(u);
|
|
620
|
+
if (_n(n, s)) return null;
|
|
613
621
|
let p;
|
|
614
622
|
t[7] !== n || t[8] !== s ? (p = {
|
|
615
623
|
state: s,
|
|
@@ -627,14 +635,14 @@ function wn(e) {
|
|
|
627
635
|
children: a
|
|
628
636
|
}), t[12] = a, t[13] = f, t[14] = d, t[15] = s.status, t[16] = h, t[17] = g) : g = t[17];
|
|
629
637
|
let _;
|
|
630
|
-
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(
|
|
638
|
+
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(Cn, {
|
|
631
639
|
value: p,
|
|
632
640
|
children: g
|
|
633
641
|
}), t[18] = p, t[19] = g, t[20] = _) : _ = t[20], _;
|
|
634
642
|
}
|
|
635
|
-
function
|
|
636
|
-
let t = O(13), { className: n } = e, { state: r } =
|
|
637
|
-
t[0] === n ? i = t[1] : (i =
|
|
643
|
+
function En(e) {
|
|
644
|
+
let t = O(13), { className: n } = e, { state: r } = wn("Trigger"), i;
|
|
645
|
+
t[0] === n ? i = t[1] : (i = Dn(n), t[0] = n, t[1] = i);
|
|
638
646
|
let a;
|
|
639
647
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("button", {
|
|
640
648
|
type: "button",
|
|
@@ -642,28 +650,28 @@ function Tn(e) {
|
|
|
642
650
|
className: i
|
|
643
651
|
}), t[2] = i, t[3] = a);
|
|
644
652
|
let o;
|
|
645
|
-
t[4] === r ? o = t[5] : (o =
|
|
653
|
+
t[4] === r ? o = t[5] : (o = bn(r), t[4] = r, t[5] = o);
|
|
646
654
|
let s = r.status === "running", c;
|
|
647
|
-
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(
|
|
655
|
+
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(On, {
|
|
648
656
|
segments: o,
|
|
649
657
|
isRunning: s
|
|
650
658
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8];
|
|
651
659
|
let l;
|
|
652
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(
|
|
660
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(An, {}), t[9] = l) : l = t[9];
|
|
653
661
|
let u;
|
|
654
662
|
return t[10] !== a || t[11] !== c ? (u = /* @__PURE__ */ N(L, {
|
|
655
663
|
render: a,
|
|
656
664
|
children: [c, l]
|
|
657
665
|
}), t[10] = a, t[11] = c, t[12] = u) : u = t[12], u;
|
|
658
666
|
}
|
|
659
|
-
function En(e) {
|
|
660
|
-
return cn(k("items-baseline px-1", e));
|
|
661
|
-
}
|
|
662
667
|
function Dn(e) {
|
|
668
|
+
return ln(k("items-baseline px-1", e));
|
|
669
|
+
}
|
|
670
|
+
function On(e) {
|
|
663
671
|
let t = O(8), { segments: n, isRunning: r } = e, i = n.length - 1, a;
|
|
664
672
|
if (t[0] !== i || t[1] !== n) {
|
|
665
673
|
let e;
|
|
666
|
-
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(
|
|
674
|
+
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(kn, {
|
|
667
675
|
segment: e,
|
|
668
676
|
index: t,
|
|
669
677
|
isLast: t === i
|
|
@@ -677,7 +685,7 @@ function Dn(e) {
|
|
|
677
685
|
children: a
|
|
678
686
|
}), t[5] = r, t[6] = a, t[7] = o) : o = t[7], o;
|
|
679
687
|
}
|
|
680
|
-
function
|
|
688
|
+
function kn(e) {
|
|
681
689
|
let t = O(11), { segment: n, index: r, isLast: i } = e, o;
|
|
682
690
|
t[0] === r ? o = t[1] : (o = r > 0 && /* @__PURE__ */ M("span", {
|
|
683
691
|
"aria-hidden": !0,
|
|
@@ -694,11 +702,11 @@ function On(e) {
|
|
|
694
702
|
let d;
|
|
695
703
|
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;
|
|
696
704
|
}
|
|
697
|
-
function
|
|
705
|
+
function An() {
|
|
698
706
|
let e = O(1), t;
|
|
699
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
707
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(cn, { className: "text-muted-foreground/60 size-3" }), e[0] = t) : t = e[0], t;
|
|
700
708
|
}
|
|
701
|
-
function
|
|
709
|
+
function jn(e) {
|
|
702
710
|
let t = O(3), { className: n, children: r } = e, i;
|
|
703
711
|
return t[0] !== r || t[1] !== n ? (i = /* @__PURE__ */ M(I, {
|
|
704
712
|
"data-slot": "index-progress-content",
|
|
@@ -706,7 +714,7 @@ function An(e) {
|
|
|
706
714
|
children: r
|
|
707
715
|
}), t[0] = r, t[1] = n, t[2] = i) : i = t[2], i;
|
|
708
716
|
}
|
|
709
|
-
function
|
|
717
|
+
function Mn(e) {
|
|
710
718
|
let t = O(11), { event: n } = e, r;
|
|
711
719
|
t[0] === n.type ? r = t[1] : (r = /* @__PURE__ */ M("span", {
|
|
712
720
|
className: "text-muted-foreground/50 w-40 shrink-0 truncate",
|
|
@@ -736,7 +744,7 @@ function jn(e) {
|
|
|
736
744
|
]
|
|
737
745
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o) : o = t[10], o;
|
|
738
746
|
}
|
|
739
|
-
function
|
|
747
|
+
function Nn(e) {
|
|
740
748
|
let t = O(2), n;
|
|
741
749
|
if (t[0] !== e) {
|
|
742
750
|
let r = /* @__PURE__ */ new Map(), i = [];
|
|
@@ -751,25 +759,25 @@ function Mn(e) {
|
|
|
751
759
|
} else n = t[1];
|
|
752
760
|
return n;
|
|
753
761
|
}
|
|
754
|
-
function
|
|
755
|
-
let t = O(8), { className: n } = e, { events: r } =
|
|
762
|
+
function Pn(e) {
|
|
763
|
+
let t = O(8), { className: n } = e, { events: r } = wn("EventLog"), i = Nn(r), a;
|
|
756
764
|
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);
|
|
757
765
|
let o = a;
|
|
758
766
|
if (i.byAdapter.size <= 1) {
|
|
759
767
|
let e;
|
|
760
|
-
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(
|
|
768
|
+
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(In, {
|
|
761
769
|
events: r,
|
|
762
770
|
className: o
|
|
763
771
|
}), t[2] = o, t[3] = r, t[4] = e) : e = t[4], e;
|
|
764
772
|
}
|
|
765
773
|
let s;
|
|
766
|
-
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(
|
|
774
|
+
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(Rn, {
|
|
767
775
|
groupedEvents: i,
|
|
768
776
|
className: o
|
|
769
777
|
}), t[5] = o, t[6] = i, t[7] = s) : s = t[7], s;
|
|
770
778
|
}
|
|
771
|
-
function
|
|
772
|
-
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(
|
|
779
|
+
function Fn(e) {
|
|
780
|
+
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(dn), s;
|
|
773
781
|
t[0] !== i || t[1] !== r || t[2] !== o ? (s = /* @__PURE__ */ M("div", {
|
|
774
782
|
ref: o,
|
|
775
783
|
"data-slot": "index-progress-event-log",
|
|
@@ -783,56 +791,56 @@ function Pn(e) {
|
|
|
783
791
|
children: s
|
|
784
792
|
}), t[4] = n, t[5] = a, t[6] = s, t[7] = c) : c = t[7], c;
|
|
785
793
|
}
|
|
786
|
-
function
|
|
794
|
+
function In(e) {
|
|
787
795
|
let t = O(7), { events: n, className: r } = e, i;
|
|
788
|
-
t[0] === n ? i = t[1] : (i = n.map(
|
|
796
|
+
t[0] === n ? i = t[1] : (i = n.map(Ln), t[0] = n, t[1] = i);
|
|
789
797
|
let a;
|
|
790
798
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("ul", {
|
|
791
799
|
className: "space-y-0.5",
|
|
792
800
|
children: i
|
|
793
801
|
}), t[2] = i, t[3] = a);
|
|
794
802
|
let o;
|
|
795
|
-
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(
|
|
803
|
+
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(Fn, {
|
|
796
804
|
className: r,
|
|
797
805
|
children: a
|
|
798
806
|
}), t[4] = r, t[5] = a, t[6] = o) : o = t[6], o;
|
|
799
807
|
}
|
|
800
|
-
function
|
|
801
|
-
return /* @__PURE__ */ M(
|
|
808
|
+
function Ln(e, t) {
|
|
809
|
+
return /* @__PURE__ */ M(Mn, { event: e }, `${e.type}-${t}`);
|
|
802
810
|
}
|
|
803
|
-
function
|
|
811
|
+
function Rn(e) {
|
|
804
812
|
let t = O(8), { groupedEvents: n, className: r } = e, i;
|
|
805
813
|
t[0] === n.globalEvents ? i = t[1] : (i = n.globalEvents.length > 0 && /* @__PURE__ */ M("ul", {
|
|
806
814
|
className: "space-y-0.5",
|
|
807
|
-
children: n.globalEvents.map(
|
|
815
|
+
children: n.globalEvents.map(Bn)
|
|
808
816
|
}), t[0] = n.globalEvents, t[1] = i);
|
|
809
817
|
let a;
|
|
810
|
-
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(
|
|
818
|
+
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(zn), t[2] = n.byAdapter, t[3] = a);
|
|
811
819
|
let o;
|
|
812
|
-
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(
|
|
820
|
+
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(Fn, {
|
|
813
821
|
className: r,
|
|
814
822
|
contentClassName: "space-y-2",
|
|
815
823
|
children: [i, a]
|
|
816
824
|
}), t[4] = r, t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
|
|
817
825
|
}
|
|
818
|
-
function
|
|
826
|
+
function zn(e) {
|
|
819
827
|
let [t, n] = e;
|
|
820
|
-
return /* @__PURE__ */ M(
|
|
828
|
+
return /* @__PURE__ */ M(Vn, {
|
|
821
829
|
name: t,
|
|
822
830
|
events: n
|
|
823
831
|
}, t);
|
|
824
832
|
}
|
|
825
|
-
function
|
|
826
|
-
return /* @__PURE__ */ M(
|
|
833
|
+
function Bn(e, t) {
|
|
834
|
+
return /* @__PURE__ */ M(Mn, { event: e }, `${e.type}-${t}`);
|
|
827
835
|
}
|
|
828
|
-
function
|
|
836
|
+
function Vn(e) {
|
|
829
837
|
let t = O(9), { name: n, events: r } = e, i;
|
|
830
838
|
t[0] === n ? i = t[1] : (i = /* @__PURE__ */ M("div", {
|
|
831
839
|
className: "text-foreground/90",
|
|
832
840
|
children: n
|
|
833
841
|
}), t[0] = n, t[1] = i);
|
|
834
842
|
let a;
|
|
835
|
-
t[2] === r ? a = t[3] : (a = r.map(
|
|
843
|
+
t[2] === r ? a = t[3] : (a = r.map(Hn), t[2] = r, t[3] = a);
|
|
836
844
|
let o;
|
|
837
845
|
t[4] === a ? o = t[5] : (o = /* @__PURE__ */ M("ul", {
|
|
838
846
|
className: "space-y-0.5",
|
|
@@ -844,21 +852,21 @@ function Bn(e) {
|
|
|
844
852
|
children: [i, o]
|
|
845
853
|
}), t[6] = i, t[7] = o, t[8] = s) : s = t[8], s;
|
|
846
854
|
}
|
|
847
|
-
function
|
|
848
|
-
return /* @__PURE__ */ M(
|
|
855
|
+
function Hn(e, t) {
|
|
856
|
+
return /* @__PURE__ */ M(Mn, { event: e }, `${e.type}-${t}`);
|
|
849
857
|
}
|
|
850
|
-
function
|
|
851
|
-
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o =
|
|
852
|
-
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(
|
|
858
|
+
function Un(e) {
|
|
859
|
+
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o = hn(n), s = Nn(n), c;
|
|
860
|
+
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(Wn), t[0] = s.globalEvents, t[1] = c);
|
|
853
861
|
let l = c;
|
|
854
|
-
if (n.length === 0 || !a &&
|
|
862
|
+
if (n.length === 0 || !a && _n(n, o)) return null;
|
|
855
863
|
if (o.adapters.length === 0) {
|
|
856
864
|
let e;
|
|
857
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(
|
|
865
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(En, {}), t[2] = e) : e = t[2];
|
|
858
866
|
let i;
|
|
859
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(
|
|
867
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(jn, { children: /* @__PURE__ */ M(Pn, {}) }), t[3] = i) : i = t[3];
|
|
860
868
|
let a;
|
|
861
|
-
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(
|
|
869
|
+
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(Tn, {
|
|
862
870
|
events: n,
|
|
863
871
|
className: r,
|
|
864
872
|
children: [e, i]
|
|
@@ -869,13 +877,13 @@ function Hn(e) {
|
|
|
869
877
|
let f;
|
|
870
878
|
if (t[9] !== s.byAdapter || t[10] !== o.adapters) {
|
|
871
879
|
let e;
|
|
872
|
-
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(
|
|
880
|
+
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(Gn, {
|
|
873
881
|
adapter: e,
|
|
874
882
|
events: s.byAdapter.get(e.name) ?? []
|
|
875
883
|
}, 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;
|
|
876
884
|
} else f = t[11];
|
|
877
885
|
let p;
|
|
878
|
-
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(
|
|
886
|
+
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(qn, {
|
|
879
887
|
state: o,
|
|
880
888
|
events: l
|
|
881
889
|
}), t[14] = l, t[15] = o, t[16] = p) : p = t[16];
|
|
@@ -887,32 +895,32 @@ function Hn(e) {
|
|
|
887
895
|
children: [f, p]
|
|
888
896
|
}), t[17] = o.status, t[18] = d, t[19] = f, t[20] = p, t[21] = m) : m = t[21], m;
|
|
889
897
|
}
|
|
890
|
-
function
|
|
898
|
+
function Wn(e) {
|
|
891
899
|
return e.type === "index:error";
|
|
892
900
|
}
|
|
893
|
-
function
|
|
901
|
+
function Gn(e) {
|
|
894
902
|
let t = O(22), { adapter: n, events: r } = e, i = n.status, a;
|
|
895
|
-
t[0] === r ? a = t[1] : (a =
|
|
903
|
+
t[0] === r ? a = t[1] : (a = yn(r), t[0] = r, t[1] = a);
|
|
896
904
|
let o;
|
|
897
905
|
t[2] !== n.status || t[3] !== a ? (o = {
|
|
898
906
|
status: i,
|
|
899
907
|
resetKey: a
|
|
900
908
|
}, t[2] = n.status, t[3] = a, t[4] = o) : o = t[4];
|
|
901
|
-
let { isOpen: s, handleOpenChange: c } =
|
|
909
|
+
let { isOpen: s, handleOpenChange: c } = gn(o), l = n.status, u;
|
|
902
910
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ M("button", {
|
|
903
911
|
type: "button",
|
|
904
912
|
"data-slot": "index-progress-adapter-trigger",
|
|
905
|
-
className:
|
|
913
|
+
className: Dn()
|
|
906
914
|
}), t[5] = u) : u = t[5];
|
|
907
915
|
let d;
|
|
908
|
-
t[6] === n ? d = t[7] : (d =
|
|
916
|
+
t[6] === n ? d = t[7] : (d = xn(n), t[6] = n, t[7] = d);
|
|
909
917
|
let f = n.status === "running", p;
|
|
910
|
-
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(
|
|
918
|
+
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(On, {
|
|
911
919
|
segments: d,
|
|
912
920
|
isRunning: f
|
|
913
921
|
}), t[8] = d, t[9] = f, t[10] = p) : p = t[10];
|
|
914
922
|
let m;
|
|
915
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(
|
|
923
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(An, {}), t[11] = m) : m = t[11];
|
|
916
924
|
let h;
|
|
917
925
|
t[12] === p ? h = t[13] : (h = /* @__PURE__ */ N(L, {
|
|
918
926
|
render: u,
|
|
@@ -921,7 +929,7 @@ function Wn(e) {
|
|
|
921
929
|
let g;
|
|
922
930
|
t[14] === r ? g = t[15] : (g = /* @__PURE__ */ M(I, {
|
|
923
931
|
"data-slot": "index-progress-adapter-content",
|
|
924
|
-
children: /* @__PURE__ */ M(
|
|
932
|
+
children: /* @__PURE__ */ M(Kn, { events: r })
|
|
925
933
|
}), t[14] = r, t[15] = g);
|
|
926
934
|
let _;
|
|
927
935
|
return t[16] !== n.status || t[17] !== c || t[18] !== s || t[19] !== h || t[20] !== g ? (_ = /* @__PURE__ */ N(F, {
|
|
@@ -933,36 +941,36 @@ function Wn(e) {
|
|
|
933
941
|
children: [h, g]
|
|
934
942
|
}), t[16] = n.status, t[17] = c, t[18] = s, t[19] = h, t[20] = g, t[21] = _) : _ = t[21], _;
|
|
935
943
|
}
|
|
936
|
-
function
|
|
944
|
+
function Kn(e) {
|
|
937
945
|
let t = O(2), { events: n } = e;
|
|
938
946
|
if (n.length === 0) return null;
|
|
939
947
|
let r;
|
|
940
|
-
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(
|
|
948
|
+
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(In, {
|
|
941
949
|
events: n,
|
|
942
950
|
className: "mt-2 ml-4 max-h-64 overflow-y-auto font-mono text-[11px]"
|
|
943
951
|
}), t[0] = n, t[1] = r), r;
|
|
944
952
|
}
|
|
945
|
-
function
|
|
953
|
+
function qn(e) {
|
|
946
954
|
let t = O(20), { state: n, events: r } = e, i;
|
|
947
955
|
t[0] !== r.length || t[1] !== n.status ? (i = {
|
|
948
956
|
status: n.status,
|
|
949
957
|
resetKey: r.length
|
|
950
958
|
}, t[0] = r.length, t[1] = n.status, t[2] = i) : i = t[2];
|
|
951
|
-
let { isOpen: a, handleOpenChange: o } =
|
|
959
|
+
let { isOpen: a, handleOpenChange: o } = gn(i), s = n.status, c;
|
|
952
960
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ M("button", {
|
|
953
961
|
type: "button",
|
|
954
962
|
"data-slot": "index-progress-global-error-trigger",
|
|
955
|
-
className:
|
|
963
|
+
className: Dn()
|
|
956
964
|
}), t[3] = c) : c = t[3];
|
|
957
965
|
let l;
|
|
958
|
-
t[4] === n ? l = t[5] : (l =
|
|
966
|
+
t[4] === n ? l = t[5] : (l = Sn(n), t[4] = n, t[5] = l);
|
|
959
967
|
let u = n.status === "running", d;
|
|
960
|
-
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(
|
|
968
|
+
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(On, {
|
|
961
969
|
segments: l,
|
|
962
970
|
isRunning: u
|
|
963
971
|
}), t[6] = l, t[7] = u, t[8] = d) : d = t[8];
|
|
964
972
|
let f;
|
|
965
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(
|
|
973
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(An, {}), t[9] = f) : f = t[9];
|
|
966
974
|
let p;
|
|
967
975
|
t[10] === d ? p = t[11] : (p = /* @__PURE__ */ N(L, {
|
|
968
976
|
render: c,
|
|
@@ -971,7 +979,7 @@ function Kn(e) {
|
|
|
971
979
|
let m;
|
|
972
980
|
t[12] === r ? m = t[13] : (m = /* @__PURE__ */ M(I, {
|
|
973
981
|
"data-slot": "index-progress-global-error-content",
|
|
974
|
-
children: /* @__PURE__ */ M(
|
|
982
|
+
children: /* @__PURE__ */ M(Kn, { events: r })
|
|
975
983
|
}), t[12] = r, t[13] = m);
|
|
976
984
|
let h;
|
|
977
985
|
return t[14] !== o || t[15] !== a || t[16] !== n.status || t[17] !== p || t[18] !== m ? (h = /* @__PURE__ */ N(F, {
|
|
@@ -983,69 +991,66 @@ function Kn(e) {
|
|
|
983
991
|
children: [p, m]
|
|
984
992
|
}), t[14] = o, t[15] = a, t[16] = n.status, t[17] = p, t[18] = m, t[19] = h) : h = t[19], h;
|
|
985
993
|
}
|
|
986
|
-
var
|
|
987
|
-
Root:
|
|
988
|
-
Trigger:
|
|
989
|
-
Content:
|
|
990
|
-
EventLog:
|
|
991
|
-
PerAdapter:
|
|
992
|
-
},
|
|
994
|
+
var Jn = {
|
|
995
|
+
Root: Tn,
|
|
996
|
+
Trigger: En,
|
|
997
|
+
Content: jn,
|
|
998
|
+
EventLog: Pn,
|
|
999
|
+
PerAdapter: Un
|
|
1000
|
+
}, Yn = o(void 0), Xn = o(void 0);
|
|
993
1001
|
function W() {
|
|
994
|
-
let e = l(
|
|
1002
|
+
let e = l(Yn);
|
|
995
1003
|
if (!e) throw Error("useMessagesContext must be used within <Messages>");
|
|
996
1004
|
return e;
|
|
997
1005
|
}
|
|
998
1006
|
function G() {
|
|
999
|
-
let e = l(
|
|
1007
|
+
let e = l(Yn), { status: t } = B();
|
|
1000
1008
|
return e?.status ?? t;
|
|
1001
1009
|
}
|
|
1002
1010
|
function K() {
|
|
1003
|
-
let e = l(
|
|
1011
|
+
let e = l(Xn);
|
|
1004
1012
|
if (!e) throw Error("useMessageItem must be used within <Messages.Item>");
|
|
1005
1013
|
return e;
|
|
1006
1014
|
}
|
|
1007
1015
|
//#endregion
|
|
1008
1016
|
//#region src/lib/components/CitationPill.tsx
|
|
1009
|
-
function
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
children: r
|
|
1016
|
-
}), t[0] = r, t[1] = o, t[2] = s) : s = t[2];
|
|
1017
|
-
let c = n.title ?? a, l;
|
|
1018
|
-
t[3] === c ? l = t[4] : (l = /* @__PURE__ */ M(je, { children: c }), t[3] = c, t[4] = l);
|
|
1019
|
-
let u;
|
|
1020
|
-
t[5] !== a || t[6] !== n.title ? (u = n.title ? /* @__PURE__ */ M(ke, { children: a }) : null, t[5] = a, t[6] = n.title, t[7] = u) : u = t[7];
|
|
1021
|
-
let d;
|
|
1022
|
-
t[8] !== l || t[9] !== u ? (d = /* @__PURE__ */ N(Ae, { children: [l, u] }), t[8] = l, t[9] = u, t[10] = d) : d = t[10];
|
|
1023
|
-
let f;
|
|
1024
|
-
t[11] === n.url ? f = t[12] : (f = /* @__PURE__ */ M("a", {
|
|
1025
|
-
href: n.url,
|
|
1026
|
-
target: "_blank",
|
|
1027
|
-
rel: "noopener noreferrer",
|
|
1028
|
-
className: "text-primary underline",
|
|
1029
|
-
children: "Open the source"
|
|
1030
|
-
}), t[11] = n.url, t[12] = f);
|
|
1031
|
-
let p;
|
|
1032
|
-
t[13] !== i || t[14] !== d || t[15] !== f ? (p = /* @__PURE__ */ N(Oe, {
|
|
1033
|
-
className: "w-72 gap-2 text-sm",
|
|
1034
|
-
children: [
|
|
1035
|
-
d,
|
|
1036
|
-
i,
|
|
1037
|
-
f
|
|
1038
|
-
]
|
|
1039
|
-
}), t[13] = i, t[14] = d, t[15] = f, t[16] = p) : p = t[16];
|
|
1040
|
-
let m;
|
|
1041
|
-
return t[17] !== s || t[18] !== p ? (m = /* @__PURE__ */ M("sup", {
|
|
1017
|
+
function Zn({ source: e, index: t, labels: n = {
|
|
1018
|
+
source: `Source ${t}`,
|
|
1019
|
+
open: "Open the source"
|
|
1020
|
+
}, children: r }) {
|
|
1021
|
+
let i = URL.parse(e.url)?.hostname ?? e.url;
|
|
1022
|
+
return /* @__PURE__ */ M("sup", {
|
|
1042
1023
|
className: "ml-0.5 inline-block",
|
|
1043
|
-
children: /* @__PURE__ */ N(De, { children: [
|
|
1044
|
-
|
|
1024
|
+
children: /* @__PURE__ */ N(De, { children: [/* @__PURE__ */ M(Me, {
|
|
1025
|
+
openOnHover: !0,
|
|
1026
|
+
"aria-label": n.source,
|
|
1027
|
+
className: "text-primary bg-primary/10 hover:bg-primary/20 focus-visible:ring-ring focus-visible:ring-offset-background inline-block rounded px-1 font-mono text-[10px] leading-tight transition-colors focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-none",
|
|
1028
|
+
children: t
|
|
1029
|
+
}), /* @__PURE__ */ N(Oe, {
|
|
1030
|
+
className: "w-72 gap-2 text-sm",
|
|
1031
|
+
children: [
|
|
1032
|
+
/* @__PURE__ */ N(Ae, { children: [/* @__PURE__ */ M(je, {
|
|
1033
|
+
dir: "auto",
|
|
1034
|
+
children: e.title ?? i
|
|
1035
|
+
}), e.title ? /* @__PURE__ */ M(ke, {
|
|
1036
|
+
dir: "auto",
|
|
1037
|
+
children: i
|
|
1038
|
+
}) : null] }),
|
|
1039
|
+
r,
|
|
1040
|
+
/* @__PURE__ */ M("a", {
|
|
1041
|
+
href: e.url,
|
|
1042
|
+
target: "_blank",
|
|
1043
|
+
rel: "noopener noreferrer",
|
|
1044
|
+
className: "text-primary underline",
|
|
1045
|
+
children: n.open
|
|
1046
|
+
})
|
|
1047
|
+
]
|
|
1048
|
+
})] })
|
|
1049
|
+
});
|
|
1045
1050
|
}
|
|
1046
1051
|
//#endregion
|
|
1047
1052
|
//#region src/lib/ui/TablePanel.tsx
|
|
1048
|
-
function
|
|
1053
|
+
function Qn(e) {
|
|
1049
1054
|
let t = O(10), n, r, i;
|
|
1050
1055
|
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);
|
|
1051
1056
|
let a;
|
|
@@ -1059,8 +1064,8 @@ function Zn(e) {
|
|
|
1059
1064
|
...r
|
|
1060
1065
|
}), t[6] = r, t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
1061
1066
|
}
|
|
1062
|
-
|
|
1063
|
-
function
|
|
1067
|
+
Qn.displayName = "TablePanel.Root";
|
|
1068
|
+
function $n(e) {
|
|
1064
1069
|
let t = O(8), n, r;
|
|
1065
1070
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1066
1071
|
let i;
|
|
@@ -1072,7 +1077,7 @@ function Qn(e) {
|
|
|
1072
1077
|
...r
|
|
1073
1078
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1074
1079
|
}
|
|
1075
|
-
function
|
|
1080
|
+
function er(e) {
|
|
1076
1081
|
let t = O(8), n, r;
|
|
1077
1082
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1078
1083
|
let i;
|
|
@@ -1084,7 +1089,7 @@ function $n(e) {
|
|
|
1084
1089
|
...r
|
|
1085
1090
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1086
1091
|
}
|
|
1087
|
-
function
|
|
1092
|
+
function tr(e) {
|
|
1088
1093
|
let t = O(8), n, r;
|
|
1089
1094
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1090
1095
|
let i;
|
|
@@ -1096,7 +1101,7 @@ function er(e) {
|
|
|
1096
1101
|
...r
|
|
1097
1102
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1098
1103
|
}
|
|
1099
|
-
function
|
|
1104
|
+
function nr(e) {
|
|
1100
1105
|
let t = O(8), n, r;
|
|
1101
1106
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1102
1107
|
let i;
|
|
@@ -1108,7 +1113,7 @@ function tr(e) {
|
|
|
1108
1113
|
...r
|
|
1109
1114
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1110
1115
|
}
|
|
1111
|
-
function
|
|
1116
|
+
function rr(e) {
|
|
1112
1117
|
let t = O(8), n, r;
|
|
1113
1118
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1114
1119
|
let i;
|
|
@@ -1120,7 +1125,7 @@ function nr(e) {
|
|
|
1120
1125
|
...r
|
|
1121
1126
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1122
1127
|
}
|
|
1123
|
-
function
|
|
1128
|
+
function ir(e) {
|
|
1124
1129
|
let t = O(8), n, r;
|
|
1125
1130
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1126
1131
|
let i;
|
|
@@ -1132,66 +1137,77 @@ function rr(e) {
|
|
|
1132
1137
|
...r
|
|
1133
1138
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1134
1139
|
}
|
|
1135
|
-
var q = Object.assign(
|
|
1136
|
-
Header:
|
|
1137
|
-
Heading:
|
|
1138
|
-
Title:
|
|
1139
|
-
Description:
|
|
1140
|
-
Actions:
|
|
1141
|
-
Content:
|
|
1142
|
-
}),
|
|
1143
|
-
function
|
|
1144
|
-
return e.replace(
|
|
1145
|
-
}
|
|
1146
|
-
function
|
|
1140
|
+
var q = Object.assign(Qn, {
|
|
1141
|
+
Header: $n,
|
|
1142
|
+
Heading: er,
|
|
1143
|
+
Title: tr,
|
|
1144
|
+
Description: nr,
|
|
1145
|
+
Actions: rr,
|
|
1146
|
+
Content: ir
|
|
1147
|
+
}), ar = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>/g, or = /\b([\w-]+)="((?:\\.|[^"])*)"/g;
|
|
1148
|
+
function sr(e) {
|
|
1149
|
+
return e.replace(ar, (e) => e.replace(or, (e, t, n) => `${t}="${n.replace(/\\"/g, """)}"`));
|
|
1150
|
+
}
|
|
1151
|
+
function cr(e, t) {
|
|
1147
1152
|
if (typeof e != "string") return e;
|
|
1148
|
-
let n =
|
|
1149
|
-
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") &&
|
|
1153
|
+
let n = sr(hr(e, dr(t))).replace(/<(\w[\w-]*)((?:\s+[\w-]+="[^"]*")+)\s*(\/?>)/g, (e, t, n, r) => `<${t}${n.replace(/\s+/g, " ").replace(/"([^"]*)"/g, (e, t) => `"${t.replace(/\*/g, "*")}"`)}${r}`);
|
|
1154
|
+
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") && ur(r, n) ? e : "/>\n\n<"), gr(n, t);
|
|
1150
1155
|
}
|
|
1151
|
-
var
|
|
1152
|
-
function
|
|
1156
|
+
var lr = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>|<\/[\w-]+\s*>/g;
|
|
1157
|
+
function ur(e, t) {
|
|
1153
1158
|
let n = e.lastIndexOf("\n", t - 1) + 1, r = e.indexOf("\n", t);
|
|
1154
|
-
return e.slice(n, r < 0 ? e.length : r).replace(
|
|
1159
|
+
return e.slice(n, r < 0 ? e.length : r).replace(lr, "").trim() !== "";
|
|
1160
|
+
}
|
|
1161
|
+
function dr(e) {
|
|
1162
|
+
let t = e?.length ? new Set(e) : null;
|
|
1163
|
+
return t ? (e) => t.has(e) : (e) => e.includes("-");
|
|
1164
|
+
}
|
|
1165
|
+
var fr = /<([\w-]+)((?:\s+[\w-]+=(?:[“”][^“”]*[“”]|[‘’][^‘’]*[‘’]|"[^"]*"|'[^']*'))+)\s*(\/?>)/g, pr = /([\w-]+)=(?:[“”]([^“”]*)[“”]|[‘’]([^‘’]*)[‘’])/g;
|
|
1166
|
+
function mr(e) {
|
|
1167
|
+
return e.replace(pr, (e, t, n, r) => `${t}="${(n ?? r ?? "").replace(/"/g, """)}"`);
|
|
1168
|
+
}
|
|
1169
|
+
function hr(e, t) {
|
|
1170
|
+
return e.replace(fr, (e, n, r, i) => t(n) ? `<${n}${mr(r)}${i}` : e);
|
|
1155
1171
|
}
|
|
1156
|
-
function
|
|
1157
|
-
let r =
|
|
1158
|
-
for (;
|
|
1159
|
-
if (e[
|
|
1160
|
-
|
|
1172
|
+
function gr(e, t, n = !1) {
|
|
1173
|
+
let r = dr(t), i = "", a = 0;
|
|
1174
|
+
for (; a < e.length;) {
|
|
1175
|
+
if (e[a] !== "<" || e[a + 1] === "/") {
|
|
1176
|
+
i += e[a++];
|
|
1161
1177
|
continue;
|
|
1162
1178
|
}
|
|
1163
|
-
let
|
|
1164
|
-
for (;
|
|
1165
|
-
let s = e.slice(
|
|
1166
|
-
if (!s || !
|
|
1167
|
-
|
|
1179
|
+
let o = a + 1;
|
|
1180
|
+
for (; o < e.length && /[\w-]/.test(e[o]);) o++;
|
|
1181
|
+
let s = e.slice(a + 1, o);
|
|
1182
|
+
if (!s || !r(s)) {
|
|
1183
|
+
i += e[a++];
|
|
1168
1184
|
continue;
|
|
1169
1185
|
}
|
|
1170
|
-
let c =
|
|
1186
|
+
let c = _r(e, a);
|
|
1171
1187
|
if (c < 0) {
|
|
1172
|
-
|
|
1188
|
+
i += e[a++];
|
|
1173
1189
|
continue;
|
|
1174
1190
|
}
|
|
1175
1191
|
if (e[c - 1] === "/") {
|
|
1176
|
-
let t = e.slice(
|
|
1177
|
-
n ?
|
|
1192
|
+
let t = e.slice(a, c + 1);
|
|
1193
|
+
n ? i += "<div>" + t + "</div>" : ur(e, a) ? i += "<span>" + t.slice(0, -2).trimEnd() + "></" + s + "></span>" : (i += t, e[c + 1] === "\n" && c + 2 < e.length && e[c + 2] !== "\n" && (i += "\n")), a = c + 1;
|
|
1178
1194
|
continue;
|
|
1179
1195
|
}
|
|
1180
|
-
let l =
|
|
1196
|
+
let l = vr(e, c + 1, s);
|
|
1181
1197
|
if (!l) {
|
|
1182
1198
|
if (n) {
|
|
1183
|
-
let n = e.slice(
|
|
1184
|
-
return
|
|
1199
|
+
let n = e.slice(a, c + 1), r = gr(e.slice(c + 1), t, !0);
|
|
1200
|
+
return i += "<div>" + n + r + "</" + s + "></div>", i;
|
|
1185
1201
|
}
|
|
1186
|
-
|
|
1202
|
+
i += e.slice(a, c + 1), a = c + 1;
|
|
1187
1203
|
continue;
|
|
1188
1204
|
}
|
|
1189
|
-
let u = e.slice(
|
|
1190
|
-
n ?
|
|
1205
|
+
let u = e.slice(a, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p = gr(d, t, !0);
|
|
1206
|
+
n ? i += "<div>" + u + p + f + "</div>" : i = yr(i) + "<div>" + u + p + f + "</div>", a = l.end;
|
|
1191
1207
|
}
|
|
1192
|
-
return
|
|
1208
|
+
return i;
|
|
1193
1209
|
}
|
|
1194
|
-
function
|
|
1210
|
+
function _r(e, t) {
|
|
1195
1211
|
let n = t + 1;
|
|
1196
1212
|
for (; n < e.length;) {
|
|
1197
1213
|
if (e[n] === "\"") for (n++; n < e.length && e[n] !== "\"";) n++;
|
|
@@ -1200,14 +1216,14 @@ function dr(e, t) {
|
|
|
1200
1216
|
}
|
|
1201
1217
|
return -1;
|
|
1202
1218
|
}
|
|
1203
|
-
function
|
|
1219
|
+
function vr(e, t, n) {
|
|
1204
1220
|
let r = 1, i = t, a = "<" + n, o = "</" + n;
|
|
1205
1221
|
for (; i < e.length;) {
|
|
1206
1222
|
let t = e.indexOf("<", i);
|
|
1207
1223
|
if (t < 0) return null;
|
|
1208
1224
|
if (e.startsWith(o, t) && !/[\w-]/.test(e[t + o.length] || "")) {
|
|
1209
1225
|
if (r--, r === 0) {
|
|
1210
|
-
let n =
|
|
1226
|
+
let n = _r(e, t);
|
|
1211
1227
|
return n < 0 ? null : {
|
|
1212
1228
|
start: t,
|
|
1213
1229
|
end: n + 1
|
|
@@ -1216,25 +1232,25 @@ function fr(e, t, n) {
|
|
|
1216
1232
|
let n = e.indexOf(">", t + o.length);
|
|
1217
1233
|
i = n < 0 ? t + 1 : n + 1;
|
|
1218
1234
|
} else if (e.startsWith(a, t) && !/[\w-]/.test(e[t + a.length] || "")) {
|
|
1219
|
-
let n =
|
|
1235
|
+
let n = _r(e, t);
|
|
1220
1236
|
n >= 0 && e[n - 1] !== "/" && r++, i = n < 0 ? t + 1 : n + 1;
|
|
1221
1237
|
} else if (/[a-zA-Z/]/.test(e[t + 1] || "")) {
|
|
1222
|
-
let n =
|
|
1238
|
+
let n = _r(e, t);
|
|
1223
1239
|
i = n < 0 ? t + 1 : n + 1;
|
|
1224
1240
|
} else i = t + 1;
|
|
1225
1241
|
}
|
|
1226
1242
|
return null;
|
|
1227
1243
|
}
|
|
1228
|
-
function
|
|
1244
|
+
function yr(e) {
|
|
1229
1245
|
return e.length === 0 ? "\n\n" : e.endsWith("\n\n") ? e : e.endsWith("\n") ? e + "\n" : e + "\n\n";
|
|
1230
1246
|
}
|
|
1231
1247
|
//#endregion
|
|
1232
1248
|
//#region src/lib/elements/table-panel-extension.tsx
|
|
1233
|
-
var
|
|
1249
|
+
var br = "response-table-panel", xr = ["title", "description"], Sr = k(Ne({
|
|
1234
1250
|
variant: "ghost",
|
|
1235
1251
|
size: "icon-sm"
|
|
1236
|
-
})),
|
|
1237
|
-
let t = _t(e), n =
|
|
1252
|
+
})), Cr = vt().use(ut).use(lt).use(ct), wr = (e) => {
|
|
1253
|
+
let t = _t(e), n = Dr(e);
|
|
1238
1254
|
if (n.length === 0) return t;
|
|
1239
1255
|
let r = 0, i = t.map((e) => {
|
|
1240
1256
|
let t = {
|
|
@@ -1249,49 +1265,49 @@ var mr = "response-table-panel", hr = ["title", "description"], gr = k(Ne({
|
|
|
1249
1265
|
}
|
|
1250
1266
|
return t.reduce((e, t, n) => (a.has(n) && e.length > 0 ? e[e.length - 1] += t : e.push(t), e), []);
|
|
1251
1267
|
};
|
|
1252
|
-
function
|
|
1268
|
+
function Tr(e) {
|
|
1253
1269
|
return e?.type === "leafDirective" && "name" in e && e.name === "table";
|
|
1254
1270
|
}
|
|
1255
|
-
function
|
|
1271
|
+
function Er(e, t) {
|
|
1256
1272
|
if (t === void 0) return;
|
|
1257
1273
|
let n = e[t - 1];
|
|
1258
|
-
return
|
|
1274
|
+
return Tr(n) ? n : void 0;
|
|
1259
1275
|
}
|
|
1260
|
-
function
|
|
1276
|
+
function Dr(e) {
|
|
1261
1277
|
let t = [];
|
|
1262
|
-
return bt(
|
|
1278
|
+
return bt(Cr.parse(e), "table", (e, n, r) => {
|
|
1263
1279
|
if (!r) return;
|
|
1264
|
-
let i =
|
|
1280
|
+
let i = Er(r.children, n)?.position?.start.offset, a = e.position?.end.offset;
|
|
1265
1281
|
i !== void 0 && a !== void 0 && t.push({
|
|
1266
1282
|
start: i,
|
|
1267
1283
|
end: a
|
|
1268
1284
|
});
|
|
1269
1285
|
}), t;
|
|
1270
1286
|
}
|
|
1271
|
-
function
|
|
1287
|
+
function Or(e, t) {
|
|
1272
1288
|
return e.attributes?.[t]?.trim() || void 0;
|
|
1273
1289
|
}
|
|
1274
|
-
function
|
|
1275
|
-
let t =
|
|
1290
|
+
function kr(e) {
|
|
1291
|
+
let t = Cr.parse(e), n = !1;
|
|
1276
1292
|
if (bt(t, "leafDirective", (e, t, r) => {
|
|
1277
1293
|
let i = t === void 0 ? void 0 : r?.children[t + 1];
|
|
1278
1294
|
if (e.name !== "table" || i?.type !== "table") return;
|
|
1279
1295
|
n = !0;
|
|
1280
|
-
let a = [
|
|
1296
|
+
let a = [Or(e, "title"), Or(e, "description")].filter(Boolean).join(" ");
|
|
1281
1297
|
e.children = a ? [{
|
|
1282
1298
|
type: "text",
|
|
1283
1299
|
value: a
|
|
1284
1300
|
}] : [];
|
|
1285
1301
|
}), n) return gt(st(t, { includeHtml: !1 }));
|
|
1286
1302
|
}
|
|
1287
|
-
function
|
|
1303
|
+
function Ar(e) {
|
|
1288
1304
|
let t = O(2), n;
|
|
1289
1305
|
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(dt, { ...e }), t[0] = e, t[1] = n), n;
|
|
1290
1306
|
}
|
|
1291
|
-
function
|
|
1307
|
+
function jr(e) {
|
|
1292
1308
|
function t(t) {
|
|
1293
1309
|
let n = O(6), r;
|
|
1294
|
-
n[0] !== t.content || n[1] !== t.dir ? (r =
|
|
1310
|
+
n[0] !== t.content || n[1] !== t.dir ? (r = kr(t.content) ?? t.dir, n[0] = t.content, n[1] = t.dir, n[2] = r) : r = n[2];
|
|
1295
1311
|
let i = r, a;
|
|
1296
1312
|
return n[3] !== i || n[4] !== t ? (a = /* @__PURE__ */ M(e, {
|
|
1297
1313
|
...t,
|
|
@@ -1300,54 +1316,54 @@ function Tr(e) {
|
|
|
1300
1316
|
}
|
|
1301
1317
|
return t.displayName = "DirectionAwareTableBlock", t;
|
|
1302
1318
|
}
|
|
1303
|
-
function
|
|
1304
|
-
let n = t &&
|
|
1319
|
+
function Mr(e, t) {
|
|
1320
|
+
let n = t && Or(t, "title"), r = t && Or(t, "description"), i = {
|
|
1305
1321
|
...n ? { title: n } : {},
|
|
1306
1322
|
...r ? { description: r } : {}
|
|
1307
1323
|
};
|
|
1308
1324
|
return {
|
|
1309
1325
|
type: "tablePanel",
|
|
1310
1326
|
data: {
|
|
1311
|
-
hName:
|
|
1327
|
+
hName: br,
|
|
1312
1328
|
...Object.keys(i).length > 0 ? { hProperties: i } : {}
|
|
1313
1329
|
},
|
|
1314
1330
|
children: [e]
|
|
1315
1331
|
};
|
|
1316
1332
|
}
|
|
1317
|
-
function
|
|
1333
|
+
function Nr() {
|
|
1318
1334
|
return (e) => {
|
|
1319
1335
|
bt(e, "table", (e, t, n) => {
|
|
1320
1336
|
if (t === void 0 || !n) return;
|
|
1321
|
-
let r =
|
|
1322
|
-
return n.children.splice(i, a,
|
|
1337
|
+
let r = Er(n.children, t), i = r ? t - 1 : t, a = r ? 2 : 1;
|
|
1338
|
+
return n.children.splice(i, a, Mr(e, r)), [yt, i + 1];
|
|
1323
1339
|
});
|
|
1324
1340
|
};
|
|
1325
1341
|
}
|
|
1326
|
-
var
|
|
1342
|
+
var Pr = [
|
|
1327
1343
|
...Object.values(ht),
|
|
1328
1344
|
ct,
|
|
1329
|
-
|
|
1330
|
-
],
|
|
1345
|
+
Nr
|
|
1346
|
+
], Fr = t.createContext({
|
|
1331
1347
|
actions: null,
|
|
1332
1348
|
controls: !0
|
|
1333
1349
|
});
|
|
1334
|
-
function
|
|
1350
|
+
function Ir(e, t) {
|
|
1335
1351
|
if (e === !1) return !1;
|
|
1336
1352
|
if (e === !0 || e === void 0) return !0;
|
|
1337
1353
|
let n = e.table;
|
|
1338
1354
|
return n === !1 ? !1 : n === !0 || n === void 0 || n[t] !== !1;
|
|
1339
1355
|
}
|
|
1340
|
-
function
|
|
1356
|
+
function Lr(e) {
|
|
1341
1357
|
return e === !1 ? !1 : e === !0 || e === void 0 ? { table: !1 } : {
|
|
1342
1358
|
...e,
|
|
1343
1359
|
table: !1
|
|
1344
1360
|
};
|
|
1345
1361
|
}
|
|
1346
|
-
function
|
|
1347
|
-
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(
|
|
1348
|
-
n[0] === c ? l = n[1] : (l =
|
|
1362
|
+
function Rr(e) {
|
|
1363
|
+
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(Fr), l;
|
|
1364
|
+
n[0] === c ? l = n[1] : (l = Ir(c, "copy"), n[0] = c, n[1] = l);
|
|
1349
1365
|
let u = l, d;
|
|
1350
|
-
n[2] === c ? d = n[3] : (d =
|
|
1366
|
+
n[2] === c ? d = n[3] : (d = Ir(c, "download"), n[2] = c, n[3] = d);
|
|
1351
1367
|
let f = d, p = !!(a || o), m = !!(u || f || s);
|
|
1352
1368
|
if (!r) return null;
|
|
1353
1369
|
let h;
|
|
@@ -1361,8 +1377,8 @@ function Mr(e) {
|
|
|
1361
1377
|
})] }), m && /* @__PURE__ */ N(q.Actions, {
|
|
1362
1378
|
"data-copy-exclude": "assistant-snapshot",
|
|
1363
1379
|
children: [
|
|
1364
|
-
u && /* @__PURE__ */ M(pt, { className:
|
|
1365
|
-
f && /* @__PURE__ */ M(mt, { className:
|
|
1380
|
+
u && /* @__PURE__ */ M(pt, { className: Sr }),
|
|
1381
|
+
f && /* @__PURE__ */ M(mt, { className: Sr }),
|
|
1366
1382
|
s
|
|
1367
1383
|
]
|
|
1368
1384
|
})]
|
|
@@ -1381,31 +1397,31 @@ function Mr(e) {
|
|
|
1381
1397
|
children: [g, v]
|
|
1382
1398
|
}), n[17] = h, n[18] = g, n[19] = v, n[20] = y) : y = n[20], y;
|
|
1383
1399
|
}
|
|
1384
|
-
function
|
|
1400
|
+
function zr(e) {
|
|
1385
1401
|
let t = O(43), n, r, i, a, o, s, c, l, u, d;
|
|
1386
1402
|
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);
|
|
1387
1403
|
let f;
|
|
1388
1404
|
bb0: {
|
|
1389
1405
|
if (!u) {
|
|
1390
|
-
f =
|
|
1406
|
+
f = Pr;
|
|
1391
1407
|
break bb0;
|
|
1392
1408
|
}
|
|
1393
1409
|
let e;
|
|
1394
1410
|
t[11] === u ? e = t[12] : (e = [
|
|
1395
1411
|
...u,
|
|
1396
1412
|
ct,
|
|
1397
|
-
|
|
1413
|
+
Nr
|
|
1398
1414
|
], t[11] = u, t[12] = e), f = e;
|
|
1399
1415
|
}
|
|
1400
1416
|
let p = f, m;
|
|
1401
1417
|
t[13] === r ? m = t[14] : (m = {
|
|
1402
1418
|
...r,
|
|
1403
|
-
[
|
|
1419
|
+
[br]: xr
|
|
1404
1420
|
}, t[13] = r, t[14] = m);
|
|
1405
1421
|
let h = m, g;
|
|
1406
1422
|
t[15] === a ? g = t[16] : (g = {
|
|
1407
1423
|
...a,
|
|
1408
|
-
[
|
|
1424
|
+
[br]: Rr
|
|
1409
1425
|
}, t[15] = a, t[16] = g);
|
|
1410
1426
|
let _ = g, v;
|
|
1411
1427
|
t[17] !== o || t[18] !== d ? (v = {
|
|
@@ -1418,8 +1434,8 @@ function Nr(e) {
|
|
|
1418
1434
|
b = n;
|
|
1419
1435
|
break bb1;
|
|
1420
1436
|
}
|
|
1421
|
-
let e = n ??
|
|
1422
|
-
t[20] === e ? r = t[21] : (r =
|
|
1437
|
+
let e = n ?? Ar, r;
|
|
1438
|
+
t[20] === e ? r = t[21] : (r = jr(e), t[20] = e, t[21] = r), b = r;
|
|
1423
1439
|
}
|
|
1424
1440
|
let x = b, S;
|
|
1425
1441
|
bb2: {
|
|
@@ -1428,12 +1444,12 @@ function Nr(e) {
|
|
|
1428
1444
|
break bb2;
|
|
1429
1445
|
}
|
|
1430
1446
|
let e;
|
|
1431
|
-
t[22] !== i || t[23] !== s ? (e =
|
|
1447
|
+
t[22] !== i || t[23] !== s ? (e = kr(i) ?? s, t[22] = i, t[23] = s, t[24] = e) : e = t[24], S = e;
|
|
1432
1448
|
}
|
|
1433
1449
|
let C = S, w;
|
|
1434
|
-
t[25] === o ? w = t[26] : (w =
|
|
1450
|
+
t[25] === o ? w = t[26] : (w = Lr(o), t[25] = o, t[26] = w);
|
|
1435
1451
|
let T;
|
|
1436
|
-
t[27] !== i || t[28] !== h ? (T =
|
|
1452
|
+
t[27] !== i || t[28] !== h ? (T = cr(i, Object.keys(h)), t[27] = i, t[28] = h, t[29] = T) : T = t[29];
|
|
1437
1453
|
let E;
|
|
1438
1454
|
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, {
|
|
1439
1455
|
allowedTags: h,
|
|
@@ -1442,20 +1458,20 @@ function Nr(e) {
|
|
|
1442
1458
|
controls: w,
|
|
1443
1459
|
dir: C,
|
|
1444
1460
|
mode: c,
|
|
1445
|
-
parseMarkdownIntoBlocksFn:
|
|
1461
|
+
parseMarkdownIntoBlocksFn: wr,
|
|
1446
1462
|
remarkPlugins: p,
|
|
1447
1463
|
...l,
|
|
1448
1464
|
children: T
|
|
1449
1465
|
}), 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];
|
|
1450
1466
|
let D;
|
|
1451
|
-
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(
|
|
1467
|
+
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(Fr, {
|
|
1452
1468
|
value: y,
|
|
1453
1469
|
children: E
|
|
1454
1470
|
}), t[40] = E, t[41] = y, t[42] = D) : D = t[42], D;
|
|
1455
1471
|
}
|
|
1456
1472
|
//#endregion
|
|
1457
1473
|
//#region src/lib/elements/Response.tsx
|
|
1458
|
-
var
|
|
1474
|
+
var Br = class extends t.Component {
|
|
1459
1475
|
state = {
|
|
1460
1476
|
hasError: !1,
|
|
1461
1477
|
error: null
|
|
@@ -1478,7 +1494,7 @@ var Pr = class extends t.Component {
|
|
|
1478
1494
|
let i;
|
|
1479
1495
|
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);
|
|
1480
1496
|
let a;
|
|
1481
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(
|
|
1497
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(Br, { children: /* @__PURE__ */ M(zr, {
|
|
1482
1498
|
className: i,
|
|
1483
1499
|
dir: "auto",
|
|
1484
1500
|
...r
|
|
@@ -1487,7 +1503,7 @@ var Pr = class extends t.Component {
|
|
|
1487
1503
|
J.displayName = "Response";
|
|
1488
1504
|
//#endregion
|
|
1489
1505
|
//#region src/lib/ui/use-copy-feedback.ts
|
|
1490
|
-
function
|
|
1506
|
+
function Vr(e) {
|
|
1491
1507
|
let t = O(9), n = e === void 0 ? 2e3 : e, r = St(), [i, a] = g(!1), o = h(null), s, c;
|
|
1492
1508
|
t[0] === r ? (s = t[1], c = t[2]) : (s = () => () => {
|
|
1493
1509
|
o.current && r.clearTimeout(o.current);
|
|
@@ -1501,13 +1517,13 @@ function Fr(e) {
|
|
|
1501
1517
|
}
|
|
1502
1518
|
//#endregion
|
|
1503
1519
|
//#region src/lib/elements/code-block.tsx
|
|
1504
|
-
var
|
|
1520
|
+
var Hr = o({ code: "" }), Ur = (e) => {
|
|
1505
1521
|
let t = O(24), n, r, i, a, o, s;
|
|
1506
1522
|
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);
|
|
1507
1523
|
let c = o !== void 0 && o, l = s !== void 0 && s, u = Pe(r, i), d;
|
|
1508
1524
|
t[7] === r ? d = t[8] : (d = { code: r }, t[7] = r, t[8] = d);
|
|
1509
1525
|
let f;
|
|
1510
|
-
t[9] === u ? f = t[10] : (f = u.map(
|
|
1526
|
+
t[9] === u ? f = t[10] : (f = u.map(Gr), t[9] = u, t[10] = f);
|
|
1511
1527
|
let p;
|
|
1512
1528
|
t[11] !== c || t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Te, {
|
|
1513
1529
|
lineNumbers: c,
|
|
@@ -1523,12 +1539,12 @@ var Ir = o({ code: "" }), Lr = (e) => {
|
|
|
1523
1539
|
children: [p, m]
|
|
1524
1540
|
}), t[17] = a, t[18] = p, t[19] = m, t[20] = h) : h = t[20];
|
|
1525
1541
|
let g;
|
|
1526
|
-
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(
|
|
1542
|
+
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(Hr, {
|
|
1527
1543
|
value: d,
|
|
1528
1544
|
children: h
|
|
1529
1545
|
}), t[21] = d, t[22] = h, t[23] = g) : g = t[23], g;
|
|
1530
|
-
},
|
|
1531
|
-
let [o, s] =
|
|
1546
|
+
}, Wr = ({ onCopy: e, onError: t, timeout: n = 2e3, children: r, className: i, ...a }) => {
|
|
1547
|
+
let [o, s] = Vr(n), { code: c } = l(Hr), u = async () => {
|
|
1532
1548
|
if (typeof window > "u" || !navigator.clipboard.writeText) {
|
|
1533
1549
|
t?.(/* @__PURE__ */ Error("Clipboard API not available"));
|
|
1534
1550
|
return;
|
|
@@ -1548,12 +1564,12 @@ var Ir = o({ code: "" }), Lr = (e) => {
|
|
|
1548
1564
|
children: r ?? /* @__PURE__ */ M(d, {})
|
|
1549
1565
|
});
|
|
1550
1566
|
};
|
|
1551
|
-
function
|
|
1567
|
+
function Gr(e, t) {
|
|
1552
1568
|
return /* @__PURE__ */ M(Ee, { children: e }, t);
|
|
1553
1569
|
}
|
|
1554
1570
|
//#endregion
|
|
1555
1571
|
//#region src/lib/elements/Tool.tsx
|
|
1556
|
-
var
|
|
1572
|
+
var Kr = (e) => {
|
|
1557
1573
|
let t = O(8), n, r;
|
|
1558
1574
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1559
1575
|
let i;
|
|
@@ -1563,7 +1579,7 @@ var Br = (e) => {
|
|
|
1563
1579
|
className: i,
|
|
1564
1580
|
...r
|
|
1565
1581
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1566
|
-
},
|
|
1582
|
+
}, qr = (e) => /* @__PURE__ */ N(me, {
|
|
1567
1583
|
className: "gap-1.5 rounded-full text-xs",
|
|
1568
1584
|
variant: "secondary",
|
|
1569
1585
|
children: [{
|
|
@@ -1583,7 +1599,7 @@ var Br = (e) => {
|
|
|
1583
1599
|
"output-error": "Error",
|
|
1584
1600
|
"output-denied": "Denied"
|
|
1585
1601
|
}[e]]
|
|
1586
|
-
}),
|
|
1602
|
+
}), Jr = (e) => {
|
|
1587
1603
|
let t = O(23), n, r, i, a;
|
|
1588
1604
|
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);
|
|
1589
1605
|
let o;
|
|
@@ -1598,7 +1614,7 @@ var Br = (e) => {
|
|
|
1598
1614
|
children: c
|
|
1599
1615
|
}), t[11] = c, t[12] = l);
|
|
1600
1616
|
let u;
|
|
1601
|
-
t[13] === r.state ? u = t[14] : (u =
|
|
1617
|
+
t[13] === r.state ? u = t[14] : (u = qr(r.state), t[13] = r.state, t[14] = u);
|
|
1602
1618
|
let d;
|
|
1603
1619
|
t[15] !== l || t[16] !== u ? (d = /* @__PURE__ */ N("div", {
|
|
1604
1620
|
className: "flex items-center gap-2",
|
|
@@ -1616,7 +1632,7 @@ var Br = (e) => {
|
|
|
1616
1632
|
...i,
|
|
1617
1633
|
children: [d, f]
|
|
1618
1634
|
}), t[19] = i, t[20] = o, t[21] = d, t[22] = p) : p = t[22], p;
|
|
1619
|
-
},
|
|
1635
|
+
}, Yr = (e) => {
|
|
1620
1636
|
let t = O(8), n, r;
|
|
1621
1637
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1622
1638
|
let i;
|
|
@@ -1626,7 +1642,7 @@ var Br = (e) => {
|
|
|
1626
1642
|
className: i,
|
|
1627
1643
|
...r
|
|
1628
1644
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1629
|
-
},
|
|
1645
|
+
}, Xr = (e) => {
|
|
1630
1646
|
let t = O(15), n, r, i;
|
|
1631
1647
|
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);
|
|
1632
1648
|
let a;
|
|
@@ -1641,7 +1657,7 @@ var Br = (e) => {
|
|
|
1641
1657
|
let c;
|
|
1642
1658
|
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M("div", {
|
|
1643
1659
|
className: "bg-muted/50 rounded-md",
|
|
1644
|
-
children: /* @__PURE__ */ M(
|
|
1660
|
+
children: /* @__PURE__ */ M(Ur, {
|
|
1645
1661
|
code: s,
|
|
1646
1662
|
language: "json"
|
|
1647
1663
|
})
|
|
@@ -1652,7 +1668,7 @@ var Br = (e) => {
|
|
|
1652
1668
|
...i,
|
|
1653
1669
|
children: [o, c]
|
|
1654
1670
|
}), t[11] = i, t[12] = a, t[13] = c, t[14] = l) : l = t[14], l;
|
|
1655
|
-
},
|
|
1671
|
+
}, Zr = (e) => {
|
|
1656
1672
|
let t = O(24), n, r, i, a;
|
|
1657
1673
|
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;
|
|
1658
1674
|
let o;
|
|
@@ -1667,7 +1683,7 @@ var Br = (e) => {
|
|
|
1667
1683
|
let d;
|
|
1668
1684
|
t[11] === r ? d = t[12] : (d = r && /* @__PURE__ */ M("div", { children: r }), t[11] = r, t[12] = d);
|
|
1669
1685
|
let f;
|
|
1670
|
-
t[13] === i ? f = t[14] : (f =
|
|
1686
|
+
t[13] === i ? f = t[14] : (f = Qr(i), t[13] = i, t[14] = f);
|
|
1671
1687
|
let p;
|
|
1672
1688
|
t[15] !== u || t[16] !== d || t[17] !== f ? (p = /* @__PURE__ */ N("div", {
|
|
1673
1689
|
className: u,
|
|
@@ -1680,27 +1696,27 @@ var Br = (e) => {
|
|
|
1680
1696
|
children: [c, p]
|
|
1681
1697
|
}), t[19] = a, t[20] = o, t[21] = c, t[22] = p, t[23] = m) : m = t[23], m;
|
|
1682
1698
|
};
|
|
1683
|
-
function
|
|
1684
|
-
return typeof e == "string" ? /* @__PURE__ */ M(
|
|
1699
|
+
function Qr(e) {
|
|
1700
|
+
return typeof e == "string" ? /* @__PURE__ */ M(Ur, {
|
|
1685
1701
|
code: e,
|
|
1686
1702
|
language: "json"
|
|
1687
|
-
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(
|
|
1703
|
+
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(Ur, {
|
|
1688
1704
|
code: JSON.stringify(e, null, 2),
|
|
1689
1705
|
language: "json"
|
|
1690
1706
|
}) : typeof e == "number" || typeof e == "bigint" ? /* @__PURE__ */ M("div", { children: e }) : /* @__PURE__ */ M("div", {});
|
|
1691
1707
|
}
|
|
1692
1708
|
//#endregion
|
|
1693
1709
|
//#region src/lib/components/tool-debug.tsx
|
|
1694
|
-
function
|
|
1710
|
+
function $r(e) {
|
|
1695
1711
|
let t = O(20), { part: n } = e, r;
|
|
1696
1712
|
t[0] === n ? r = t[1] : (r = b(n), t[0] = n, t[1] = r);
|
|
1697
1713
|
let i = `Executing ${r}`, a;
|
|
1698
|
-
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(
|
|
1714
|
+
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(Jr, {
|
|
1699
1715
|
title: i,
|
|
1700
1716
|
part: n
|
|
1701
1717
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4];
|
|
1702
1718
|
let o;
|
|
1703
|
-
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(
|
|
1719
|
+
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(Xr, { input: n.input }), t[5] = n.input, t[6] = o);
|
|
1704
1720
|
let s;
|
|
1705
1721
|
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);
|
|
1706
1722
|
let c;
|
|
@@ -1709,26 +1725,26 @@ function qr(e) {
|
|
|
1709
1725
|
children: s
|
|
1710
1726
|
}), t[9] = s, t[10] = c);
|
|
1711
1727
|
let l;
|
|
1712
|
-
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(
|
|
1728
|
+
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(Zr, {
|
|
1713
1729
|
output: c,
|
|
1714
1730
|
errorText: n.errorText
|
|
1715
1731
|
}), t[11] = n.errorText, t[12] = c, t[13] = l) : l = t[13];
|
|
1716
1732
|
let u;
|
|
1717
|
-
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(
|
|
1733
|
+
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(Yr, { children: [o, l] }), t[14] = o, t[15] = l, t[16] = u) : u = t[16];
|
|
1718
1734
|
let d;
|
|
1719
|
-
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(
|
|
1735
|
+
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(Kr, {
|
|
1720
1736
|
"data-copy-exclude": "assistant-snapshot",
|
|
1721
1737
|
children: [a, u]
|
|
1722
1738
|
}), t[17] = a, t[18] = u, t[19] = d) : d = t[19], d;
|
|
1723
1739
|
}
|
|
1724
|
-
function
|
|
1740
|
+
function ei(e) {
|
|
1725
1741
|
let t = O(18), { part: n } = e, r = `Executing ${n.toolName}`, i;
|
|
1726
|
-
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
1742
|
+
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(Jr, {
|
|
1727
1743
|
title: r,
|
|
1728
1744
|
part: n
|
|
1729
1745
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
1730
1746
|
let a;
|
|
1731
|
-
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
1747
|
+
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(Xr, { input: n.input }), t[3] = n.input, t[4] = a);
|
|
1732
1748
|
let o;
|
|
1733
1749
|
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);
|
|
1734
1750
|
let s;
|
|
@@ -1737,49 +1753,49 @@ function Jr(e) {
|
|
|
1737
1753
|
children: o
|
|
1738
1754
|
}), t[7] = o, t[8] = s);
|
|
1739
1755
|
let c;
|
|
1740
|
-
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(
|
|
1756
|
+
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(Zr, {
|
|
1741
1757
|
output: s,
|
|
1742
1758
|
errorText: n.errorText
|
|
1743
1759
|
}), t[9] = n.errorText, t[10] = s, t[11] = c) : c = t[11];
|
|
1744
1760
|
let l;
|
|
1745
|
-
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(
|
|
1761
|
+
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(Yr, { children: [a, c] }), t[12] = a, t[13] = c, t[14] = l) : l = t[14];
|
|
1746
1762
|
let u;
|
|
1747
|
-
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(
|
|
1763
|
+
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(Kr, {
|
|
1748
1764
|
"data-copy-exclude": "assistant-snapshot",
|
|
1749
1765
|
children: [i, l]
|
|
1750
1766
|
}), t[15] = i, t[16] = l, t[17] = u) : u = t[17], u;
|
|
1751
1767
|
}
|
|
1752
1768
|
//#endregion
|
|
1753
1769
|
//#region src/lib/copy/copy-image.ts
|
|
1754
|
-
var
|
|
1770
|
+
var ti = "data-copy-exclude", ni = {
|
|
1755
1771
|
image: "image",
|
|
1756
1772
|
assistantSnapshot: "assistant-snapshot"
|
|
1757
1773
|
};
|
|
1758
|
-
function
|
|
1774
|
+
function ri(e) {
|
|
1759
1775
|
return typeof e == "object" && !!e && "getAttribute" in e && typeof e.getAttribute == "function";
|
|
1760
1776
|
}
|
|
1761
|
-
function
|
|
1762
|
-
if (!
|
|
1763
|
-
let n = e.getAttribute(
|
|
1777
|
+
function ii(e, t) {
|
|
1778
|
+
if (!ri(e)) return !1;
|
|
1779
|
+
let n = e.getAttribute(ti);
|
|
1764
1780
|
return n ? n.split(/\s+/).includes(t) : !1;
|
|
1765
1781
|
}
|
|
1766
|
-
function
|
|
1767
|
-
return !
|
|
1782
|
+
function ai(e, t) {
|
|
1783
|
+
return !ii(e, t);
|
|
1768
1784
|
}
|
|
1769
|
-
function
|
|
1785
|
+
function oi({ clipboard: e, ClipboardItem: t }) {
|
|
1770
1786
|
return typeof e?.write == "function" && typeof t == "function" ? "image" : typeof e?.writeText == "function" ? "text" : "none";
|
|
1771
1787
|
}
|
|
1772
1788
|
//#endregion
|
|
1773
1789
|
//#region src/lib/copy/snapshot-context.ts
|
|
1774
|
-
var
|
|
1790
|
+
var si = o(!1);
|
|
1775
1791
|
//#endregion
|
|
1776
1792
|
//#region src/lib/copy/snapshot-render.tsx
|
|
1777
|
-
function
|
|
1793
|
+
function ci() {
|
|
1778
1794
|
return new Promise((e) => {
|
|
1779
1795
|
requestAnimationFrame(() => e());
|
|
1780
1796
|
});
|
|
1781
1797
|
}
|
|
1782
|
-
function
|
|
1798
|
+
function li(e) {
|
|
1783
1799
|
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;
|
|
1784
1800
|
if (typeof document > "u") return null;
|
|
1785
1801
|
let u;
|
|
@@ -1800,7 +1816,7 @@ function ri(e) {
|
|
|
1800
1816
|
return t[4] !== r || t[5] !== l || t[6] !== n || t[7] !== d ? (f = Ct(/* @__PURE__ */ M("div", {
|
|
1801
1817
|
"aria-hidden": "true",
|
|
1802
1818
|
style: u,
|
|
1803
|
-
children: /* @__PURE__ */ M(
|
|
1819
|
+
children: /* @__PURE__ */ M(si, {
|
|
1804
1820
|
value: !0,
|
|
1805
1821
|
children: /* @__PURE__ */ M("div", {
|
|
1806
1822
|
ref: n,
|
|
@@ -1813,13 +1829,13 @@ function ri(e) {
|
|
|
1813
1829
|
}
|
|
1814
1830
|
//#endregion
|
|
1815
1831
|
//#region src/lib/copy/use-copy-element-as-image.ts
|
|
1816
|
-
function
|
|
1832
|
+
function ui(e) {
|
|
1817
1833
|
let t = getComputedStyle(e).backgroundColor;
|
|
1818
1834
|
if (t !== "rgba(0, 0, 0, 0)") return t;
|
|
1819
1835
|
let n = getComputedStyle(document.body).backgroundColor;
|
|
1820
1836
|
return n === "rgba(0, 0, 0, 0)" ? void 0 : n;
|
|
1821
1837
|
}
|
|
1822
|
-
function
|
|
1838
|
+
function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
1823
1839
|
let r = St(), [i, a] = g(!1), [o, s] = g(null), c = h(null), l = u(() => {
|
|
1824
1840
|
c.current !== null && (r.clearTimeout(c.current), c.current = null);
|
|
1825
1841
|
}, [r]), f = u((e) => {
|
|
@@ -1836,9 +1852,9 @@ function ai({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1836
1852
|
}), !0), [n, f]), m = u(async () => {
|
|
1837
1853
|
if (!e.current) throw Error("Nothing is ready to copy yet.");
|
|
1838
1854
|
let { toBlob: n } = await import("html-to-image"), r = await n(e.current, {
|
|
1839
|
-
backgroundColor:
|
|
1855
|
+
backgroundColor: ui(e.current),
|
|
1840
1856
|
pixelRatio: 2,
|
|
1841
|
-
filter: (e) =>
|
|
1857
|
+
filter: (e) => ai(e, t)
|
|
1842
1858
|
});
|
|
1843
1859
|
if (!r) throw Error("Unable to render the image for copying.");
|
|
1844
1860
|
await navigator.clipboard.write([new ClipboardItem({ [r.type]: r })]), f({
|
|
@@ -1854,7 +1870,7 @@ function ai({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1854
1870
|
copy: u(async () => {
|
|
1855
1871
|
a(!0), s(null);
|
|
1856
1872
|
try {
|
|
1857
|
-
let e =
|
|
1873
|
+
let e = oi({
|
|
1858
1874
|
clipboard: typeof navigator > "u" ? void 0 : navigator.clipboard,
|
|
1859
1875
|
ClipboardItem: typeof window > "u" ? void 0 : window.ClipboardItem
|
|
1860
1876
|
});
|
|
@@ -1889,29 +1905,29 @@ function ai({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1889
1905
|
}
|
|
1890
1906
|
//#endregion
|
|
1891
1907
|
//#region src/lib/copy/assistant-snapshot.tsx
|
|
1892
|
-
function
|
|
1908
|
+
function fi(e) {
|
|
1893
1909
|
return e.parts.filter(C).map((e) => e.text).join("\n");
|
|
1894
1910
|
}
|
|
1895
1911
|
function Y() {
|
|
1896
|
-
return l(
|
|
1912
|
+
return l(si);
|
|
1897
1913
|
}
|
|
1898
|
-
function
|
|
1914
|
+
function pi(e) {
|
|
1899
1915
|
let t = O(30), { message: n, renderContent: r, className: i } = e, a = h(null), [o, s] = g(!1), c;
|
|
1900
|
-
t[0] === n ? c = t[1] : (c =
|
|
1916
|
+
t[0] === n ? c = t[1] : (c = fi(n), t[0] = n, t[1] = c);
|
|
1901
1917
|
let l = c, u;
|
|
1902
1918
|
t[2] === l ? u = t[3] : (u = {
|
|
1903
1919
|
elementRef: a,
|
|
1904
|
-
excludeMode:
|
|
1920
|
+
excludeMode: ni.assistantSnapshot,
|
|
1905
1921
|
fallbackText: l
|
|
1906
1922
|
}, t[2] = l, t[3] = u);
|
|
1907
|
-
let { copy: d, feedback: f, isCopying: p } =
|
|
1923
|
+
let { copy: d, feedback: f, isCopying: p } = di(u), m;
|
|
1908
1924
|
t[4] !== d || t[5] !== o ? (m = async () => {
|
|
1909
|
-
o || s(!0), await
|
|
1925
|
+
o || s(!0), await ci(), await d();
|
|
1910
1926
|
}, t[4] = d, t[5] = o, t[6] = m) : m = t[6];
|
|
1911
1927
|
let _ = m, v = "Copy snapshot";
|
|
1912
1928
|
p ? v = "Copying snapshot" : f?.kind === "success" && (v = f.mode === "image" ? "Copied snapshot" : "Copied text");
|
|
1913
1929
|
let y;
|
|
1914
|
-
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(
|
|
1930
|
+
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(li, {
|
|
1915
1931
|
contentRef: a,
|
|
1916
1932
|
children: r()
|
|
1917
1933
|
}), t[7] = r, t[8] = o, t[9] = y) : y = t[9];
|
|
@@ -1947,41 +1963,41 @@ function si(e) {
|
|
|
1947
1963
|
}
|
|
1948
1964
|
//#endregion
|
|
1949
1965
|
//#region src/lib/tools/helpers.ts
|
|
1950
|
-
function
|
|
1966
|
+
function mi(e) {
|
|
1951
1967
|
return w(e) && e.toolMetadata?.kind === "subagent";
|
|
1952
1968
|
}
|
|
1953
|
-
function
|
|
1969
|
+
function hi(e) {
|
|
1954
1970
|
let t = e.toolMetadata?.displayName;
|
|
1955
1971
|
return typeof t == "string" ? t : "Subagent";
|
|
1956
1972
|
}
|
|
1957
|
-
function
|
|
1973
|
+
function gi(e, t) {
|
|
1958
1974
|
let n = y(e);
|
|
1959
1975
|
return {
|
|
1960
1976
|
toolKey: n,
|
|
1961
1977
|
toolEntry: t?.[n]
|
|
1962
1978
|
};
|
|
1963
1979
|
}
|
|
1964
|
-
function
|
|
1980
|
+
function _i(e, t) {
|
|
1965
1981
|
return e?.static === !1 && !!e?.requiresUserInput && t === "input-available";
|
|
1966
1982
|
}
|
|
1967
1983
|
//#endregion
|
|
1968
1984
|
//#region src/lib/chat/markdown-paragraph.tsx
|
|
1969
|
-
var
|
|
1970
|
-
function
|
|
1985
|
+
var vi = /* @__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("."));
|
|
1986
|
+
function yi(e) {
|
|
1971
1987
|
if (!n.isValidElement(e)) return !1;
|
|
1972
1988
|
let t = typeof e.type == "string" ? e.type : e.props.node?.tagName;
|
|
1973
|
-
return t === void 0 || !
|
|
1989
|
+
return t === void 0 || !vi.has(t);
|
|
1974
1990
|
}
|
|
1975
|
-
function
|
|
1991
|
+
function bi(e) {
|
|
1976
1992
|
let t = O(6), { children: r, dir: i } = e, a = n.Children.toArray(r);
|
|
1977
|
-
if (!a.some(
|
|
1993
|
+
if (!a.some(yi)) {
|
|
1978
1994
|
let e;
|
|
1979
1995
|
return t[0] !== r || t[1] !== i ? (e = /* @__PURE__ */ M("p", {
|
|
1980
1996
|
dir: i,
|
|
1981
1997
|
children: r
|
|
1982
1998
|
}), t[0] = r, t[1] = i, t[2] = e) : e = t[2], e;
|
|
1983
1999
|
}
|
|
1984
|
-
if (a.every(
|
|
2000
|
+
if (a.every(yi)) return r;
|
|
1985
2001
|
let o;
|
|
1986
2002
|
return t[3] !== r || t[4] !== i ? (o = /* @__PURE__ */ M("div", {
|
|
1987
2003
|
dir: i,
|
|
@@ -1990,25 +2006,25 @@ function mi(e) {
|
|
|
1990
2006
|
}
|
|
1991
2007
|
//#endregion
|
|
1992
2008
|
//#region src/lib/components/InteractiveResponse.tsx
|
|
1993
|
-
var
|
|
2009
|
+
var xi = { p: ({ children: e, dir: t }) => /* @__PURE__ */ M(bi, {
|
|
1994
2010
|
dir: t,
|
|
1995
2011
|
children: e
|
|
1996
2012
|
}) };
|
|
1997
|
-
function
|
|
1998
|
-
let t = { ...
|
|
2013
|
+
function Si(e) {
|
|
2014
|
+
let t = { ...xi }, n = {};
|
|
1999
2015
|
for (let r of e) ae(r), t[r.name] = r.component, n[r.name] = r.allowedAttributes;
|
|
2000
2016
|
return {
|
|
2001
2017
|
components: t,
|
|
2002
2018
|
allowedTags: n
|
|
2003
2019
|
};
|
|
2004
2020
|
}
|
|
2005
|
-
function
|
|
2021
|
+
function Ci(e) {
|
|
2006
2022
|
let t = O(10), n, r;
|
|
2007
2023
|
t[0] === e ? (n = t[1], r = t[2]) : ({elements: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
2008
2024
|
let i;
|
|
2009
2025
|
t[3] === n ? i = t[4] : (i = n ?? [], t[3] = n, t[4] = i);
|
|
2010
2026
|
let a;
|
|
2011
|
-
t[5] === i ? a = t[6] : (a =
|
|
2027
|
+
t[5] === i ? a = t[6] : (a = Si(i), t[5] = i, t[6] = a);
|
|
2012
2028
|
let o = a, s;
|
|
2013
2029
|
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(J, {
|
|
2014
2030
|
...o,
|
|
@@ -2017,7 +2033,7 @@ function _i(e) {
|
|
|
2017
2033
|
}
|
|
2018
2034
|
//#endregion
|
|
2019
2035
|
//#region src/lib/renderers/render-part.tsx
|
|
2020
|
-
function
|
|
2036
|
+
function wi(e) {
|
|
2021
2037
|
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } = H();
|
|
2022
2038
|
if (n.state !== "approval-requested") return null;
|
|
2023
2039
|
let i;
|
|
@@ -2070,21 +2086,21 @@ function vi(e) {
|
|
|
2070
2086
|
children: [l, f]
|
|
2071
2087
|
}), t[18] = o, t[19] = l, t[20] = f, t[21] = p) : p = t[21], p;
|
|
2072
2088
|
}
|
|
2073
|
-
function
|
|
2089
|
+
function Ti(e) {
|
|
2074
2090
|
let t = O(25), { part: n } = e, { registry: r } = z();
|
|
2075
2091
|
if (n.input === void 0) {
|
|
2076
2092
|
let e;
|
|
2077
|
-
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(
|
|
2093
|
+
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(Zr, {
|
|
2078
2094
|
output: n.output,
|
|
2079
2095
|
errorText: n.errorText
|
|
2080
2096
|
}) : /* @__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;
|
|
2081
2097
|
}
|
|
2082
2098
|
let i;
|
|
2083
|
-
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(
|
|
2099
|
+
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(wi, { part: n }), t[4] = n, t[5] = i);
|
|
2084
2100
|
let a = i;
|
|
2085
2101
|
if (!r) return a;
|
|
2086
2102
|
let o;
|
|
2087
|
-
t[6] !== n || t[7] !== r ? (o =
|
|
2103
|
+
t[6] !== n || t[7] !== r ? (o = gi(n, r), t[6] = n, t[7] = r, t[8] = o) : o = t[8];
|
|
2088
2104
|
let { toolEntry: s } = o;
|
|
2089
2105
|
if (s) {
|
|
2090
2106
|
let e = s.component, i;
|
|
@@ -2109,8 +2125,8 @@ function yi(e) {
|
|
|
2109
2125
|
}
|
|
2110
2126
|
//#endregion
|
|
2111
2127
|
//#region src/lib/chat/message-parts.tsx
|
|
2112
|
-
var
|
|
2113
|
-
function
|
|
2128
|
+
var Ei = { animation: "slideUp" };
|
|
2129
|
+
function Di(e) {
|
|
2114
2130
|
let t = O(3), { filename: n, url: r } = e, i = n ?? "Attached image", a;
|
|
2115
2131
|
return t[0] !== i || t[1] !== r ? (a = /* @__PURE__ */ M("img", {
|
|
2116
2132
|
src: r,
|
|
@@ -2118,7 +2134,7 @@ function xi(e) {
|
|
|
2118
2134
|
className: "max-h-64 rounded-md border object-contain"
|
|
2119
2135
|
}), t[0] = i, t[1] = r, t[2] = a) : a = t[2], a;
|
|
2120
2136
|
}
|
|
2121
|
-
function
|
|
2137
|
+
function Oi(e) {
|
|
2122
2138
|
let t = O(16), { filename: n, mediaType: r, url: i } = e, a = n || "Untitled", o;
|
|
2123
2139
|
t[0] !== r || t[1] !== a || t[2] !== i ? (o = i?.startsWith("data:") ? null : i && r.startsWith("video/") ? /* @__PURE__ */ M("video", {
|
|
2124
2140
|
controls: !0,
|
|
@@ -2164,62 +2180,125 @@ function Si(e) {
|
|
|
2164
2180
|
children: [s, d]
|
|
2165
2181
|
}), t[13] = s, t[14] = d, t[15] = f) : f = t[15], f;
|
|
2166
2182
|
}
|
|
2167
|
-
function
|
|
2183
|
+
function ki(e) {
|
|
2168
2184
|
let t = O(4), { filename: n, mediaType: r, url: i } = e, a;
|
|
2169
|
-
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(
|
|
2185
|
+
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(Di, {
|
|
2170
2186
|
filename: n,
|
|
2171
2187
|
url: i
|
|
2172
|
-
}) : /* @__PURE__ */ M(
|
|
2188
|
+
}) : /* @__PURE__ */ M(Oi, {
|
|
2173
2189
|
filename: n,
|
|
2174
2190
|
mediaType: r,
|
|
2175
2191
|
url: i
|
|
2176
2192
|
}), t[0] = n, t[1] = r, t[2] = i, t[3] = a) : a = t[3], a;
|
|
2177
2193
|
}
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
animated: bi,
|
|
2185
|
-
isAnimating: c,
|
|
2186
|
-
children: n
|
|
2187
|
-
}), t[2] = r, t[3] = c, t[4] = n, t[5] = l) : l = t[5];
|
|
2188
|
-
let u;
|
|
2189
|
-
return t[6] !== s || t[7] !== l ? (u = /* @__PURE__ */ M("div", {
|
|
2190
|
-
className: s,
|
|
2191
|
-
children: l
|
|
2192
|
-
}), t[6] = s, t[7] = l, t[8] = u) : u = t[8], u;
|
|
2194
|
+
var Ai = "genai-citation";
|
|
2195
|
+
function ji(e, t) {
|
|
2196
|
+
return t.map((t, n) => ({
|
|
2197
|
+
at: t.endIndex ?? e.length,
|
|
2198
|
+
order: n
|
|
2199
|
+
})).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);
|
|
2193
2200
|
}
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2201
|
+
var Mi = o(null);
|
|
2202
|
+
function Ni(e) {
|
|
2203
|
+
let t = O(16), n = l(Mi), r = n?.citations[Number(e.citation)];
|
|
2204
|
+
if (!n || !r) return null;
|
|
2205
|
+
let i;
|
|
2206
|
+
t[0] !== r.source.url || t[1] !== n.sources ? (i = tn(n.sources, r.source.url), t[0] = r.source.url, t[1] = n.sources, t[2] = i) : i = t[2];
|
|
2207
|
+
let a = i;
|
|
2208
|
+
if (a === null) return null;
|
|
2209
|
+
if (n.HostCitation) {
|
|
2210
|
+
let e;
|
|
2211
|
+
return t[3] !== r || t[4] !== n.HostCitation || t[5] !== a ? (e = /* @__PURE__ */ M(n.HostCitation, {
|
|
2212
|
+
citation: r,
|
|
2213
|
+
index: a
|
|
2214
|
+
}), t[3] = r, t[4] = n.HostCitation, t[5] = a, t[6] = e) : e = t[6], e;
|
|
2215
|
+
}
|
|
2216
|
+
let o;
|
|
2217
|
+
t[7] !== r.source.title || t[8] !== r.source.url ? (o = {
|
|
2218
|
+
url: r.source.url,
|
|
2219
|
+
title: r.source.title
|
|
2220
|
+
}, t[7] = r.source.title, t[8] = r.source.url, t[9] = o) : o = t[9];
|
|
2221
|
+
let s;
|
|
2222
|
+
t[10] === r.citedText ? s = t[11] : (s = r.citedText ? /* @__PURE__ */ M("blockquote", {
|
|
2223
|
+
dir: "auto",
|
|
2224
|
+
children: r.citedText
|
|
2225
|
+
}) : null, t[10] = r.citedText, t[11] = s);
|
|
2226
|
+
let c;
|
|
2227
|
+
return t[12] !== a || t[13] !== o || t[14] !== s ? (c = /* @__PURE__ */ M(Zn, {
|
|
2228
|
+
source: o,
|
|
2229
|
+
index: a,
|
|
2230
|
+
children: s
|
|
2231
|
+
}), t[12] = a, t[13] = o, t[14] = s, t[15] = c) : c = t[15], c;
|
|
2232
|
+
}
|
|
2233
|
+
var Pi = {
|
|
2234
|
+
name: Ai,
|
|
2235
|
+
allowedAttributes: ["citation"],
|
|
2236
|
+
component: Ni
|
|
2237
|
+
};
|
|
2238
|
+
function Fi(e) {
|
|
2239
|
+
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } = B(), s = Y(), { messages: c, citation: l } = W(), u;
|
|
2240
|
+
t[0] === r ? u = t[1] : (u = $t(r), t[0] = r, t[1] = u);
|
|
2241
|
+
let d = u, f;
|
|
2242
|
+
t[2] === c ? f = t[3] : (f = en(c), t[2] = c, t[3] = f);
|
|
2243
|
+
let p;
|
|
2244
|
+
t[4] !== l || t[5] !== f || t[6] !== d ? (p = {
|
|
2245
|
+
citations: d,
|
|
2246
|
+
sources: f,
|
|
2247
|
+
HostCitation: l
|
|
2248
|
+
}, t[4] = l, t[5] = f, t[6] = d, t[7] = p) : p = t[7];
|
|
2249
|
+
let m = p, h = d.length > 0, g;
|
|
2250
|
+
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [], Pi] : i, t[8] = i, t[9] = h, t[10] = g) : g = t[10];
|
|
2251
|
+
let _ = g, v;
|
|
2252
|
+
t[11] === a ? v = t[12] : (v = k("text-sm", a), t[11] = a, t[12] = v);
|
|
2253
|
+
let y = !s && o === "streaming", b;
|
|
2254
|
+
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ? ji(n, d) : n, t[13] = h, t[14] = n, t[15] = d, t[16] = b) : b = t[16];
|
|
2255
|
+
let x;
|
|
2256
|
+
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(Ci, {
|
|
2257
|
+
elements: _,
|
|
2258
|
+
animated: Ei,
|
|
2259
|
+
isAnimating: y,
|
|
2260
|
+
children: b
|
|
2261
|
+
}), t[17] = y, t[18] = b, t[19] = _, t[20] = x) : x = t[20];
|
|
2262
|
+
let S;
|
|
2263
|
+
t[21] !== v || t[22] !== x ? (S = /* @__PURE__ */ M("div", {
|
|
2264
|
+
className: v,
|
|
2265
|
+
children: x
|
|
2266
|
+
}), t[21] = v, t[22] = x, t[23] = S) : S = t[23];
|
|
2267
|
+
let C;
|
|
2268
|
+
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(Mi, {
|
|
2269
|
+
value: m,
|
|
2270
|
+
children: S
|
|
2271
|
+
}), t[24] = m, t[25] = S, t[26] = C) : C = t[26], C;
|
|
2272
|
+
}
|
|
2273
|
+
function Ii(e) {
|
|
2274
|
+
let t = O(8), { part: n } = e, r = Li(), i;
|
|
2275
|
+
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M($r, { part: n }), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
2197
2276
|
let a;
|
|
2198
|
-
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
2277
|
+
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(Ti, { part: n }), t[3] = n, t[4] = a);
|
|
2199
2278
|
let o;
|
|
2200
2279
|
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;
|
|
2201
2280
|
}
|
|
2202
|
-
function
|
|
2281
|
+
function Li() {
|
|
2203
2282
|
let { debugMode: e } = z(), t = Y();
|
|
2204
2283
|
return !!e && !t;
|
|
2205
2284
|
}
|
|
2206
2285
|
//#endregion
|
|
2207
2286
|
//#region src/lib/chat/trajectory/tool-label.tsx
|
|
2208
|
-
function
|
|
2287
|
+
function Ri(e) {
|
|
2209
2288
|
return !!e && e !== "output-available";
|
|
2210
2289
|
}
|
|
2211
|
-
function
|
|
2290
|
+
function zi(e) {
|
|
2212
2291
|
let t = O(5), { label: n, part: r, state: i } = e, a = Y(), o;
|
|
2213
|
-
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !
|
|
2292
|
+
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !Ri(i), t[0] = a, t[1] = n, t[2] = r, t[3] = i, t[4] = o) : o = t[4], o;
|
|
2214
2293
|
}
|
|
2215
|
-
function
|
|
2294
|
+
function Bi(e) {
|
|
2216
2295
|
let t = O(18), { label: n, part: r } = e, i = n.icon, a = n.actions, o;
|
|
2217
2296
|
t[0] !== n || t[1] !== r ? (o = {
|
|
2218
2297
|
label: n,
|
|
2219
2298
|
part: r,
|
|
2220
2299
|
state: r.state
|
|
2221
2300
|
}, t[0] = n, t[1] = r, t[2] = o) : o = t[2];
|
|
2222
|
-
let s =
|
|
2301
|
+
let s = zi(o), c;
|
|
2223
2302
|
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];
|
|
2224
2303
|
let l;
|
|
2225
2304
|
t[6] === n.name ? l = t[7] : (l = /* @__PURE__ */ M("span", {
|
|
@@ -2239,7 +2318,7 @@ function ki(e) {
|
|
|
2239
2318
|
children: [u, d]
|
|
2240
2319
|
}), t[15] = u, t[16] = d, t[17] = f) : f = t[17], f;
|
|
2241
2320
|
}
|
|
2242
|
-
function
|
|
2321
|
+
function Vi(e) {
|
|
2243
2322
|
let t = O(3), { name: n, value: r } = e, i;
|
|
2244
2323
|
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ N("span", {
|
|
2245
2324
|
"data-slot": "tool-arg",
|
|
@@ -2251,15 +2330,15 @@ function Ai(e) {
|
|
|
2251
2330
|
]
|
|
2252
2331
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2253
2332
|
}
|
|
2254
|
-
function
|
|
2333
|
+
function Hi(e) {
|
|
2255
2334
|
let t = O(23), { label: n, state: r, part: i, children: a } = e, o = n.actions, s;
|
|
2256
2335
|
t[0] !== n || t[1] !== i || t[2] !== r ? (s = {
|
|
2257
2336
|
label: n,
|
|
2258
2337
|
part: i,
|
|
2259
2338
|
state: r
|
|
2260
2339
|
}, t[0] = n, t[1] = i, t[2] = r, t[3] = s) : s = t[3];
|
|
2261
|
-
let c =
|
|
2262
|
-
t[4] === n.args ? l = t[5] : (l = n.args ? Object.entries(n.args).map(
|
|
2340
|
+
let c = zi(s), l;
|
|
2341
|
+
t[4] === n.args ? l = t[5] : (l = n.args ? Object.entries(n.args).map(Ui) : "...", t[4] = n.args, t[5] = l);
|
|
2263
2342
|
let u;
|
|
2264
2343
|
t[6] !== a || t[7] !== n.name || t[8] !== l ? (u = /* @__PURE__ */ N("span", {
|
|
2265
2344
|
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-[',']",
|
|
@@ -2292,26 +2371,27 @@ function ji(e) {
|
|
|
2292
2371
|
children: [f, p]
|
|
2293
2372
|
}), t[20] = f, t[21] = p, t[22] = m) : m = t[22], m;
|
|
2294
2373
|
}
|
|
2295
|
-
function
|
|
2374
|
+
function Ui(e) {
|
|
2296
2375
|
let [t, n] = e;
|
|
2297
|
-
return /* @__PURE__ */ M(
|
|
2376
|
+
return /* @__PURE__ */ M(Vi, {
|
|
2298
2377
|
name: t,
|
|
2299
2378
|
value: n
|
|
2300
2379
|
}, t);
|
|
2301
2380
|
}
|
|
2302
2381
|
//#endregion
|
|
2303
2382
|
//#region src/lib/chat/trajectory/segments/index.tsx
|
|
2304
|
-
function
|
|
2383
|
+
function Wi(e) {
|
|
2305
2384
|
return e.type === "text" && e.providerMetadata?.openai?.phase === "commentary";
|
|
2306
2385
|
}
|
|
2307
|
-
function
|
|
2386
|
+
function Gi(e) {
|
|
2308
2387
|
let t = O(9), { segment: n, elements: r, className: i } = e, a;
|
|
2309
2388
|
if (t[0] !== i || t[1] !== r || t[2] !== n.parts) {
|
|
2310
2389
|
let e;
|
|
2311
2390
|
t[4] !== i || t[5] !== r ? (e = (e) => {
|
|
2312
2391
|
let { part: t, idx: n } = e;
|
|
2313
|
-
return t.type === "text" ? /* @__PURE__ */ M(
|
|
2392
|
+
return t.type === "text" ? /* @__PURE__ */ M(Fi, {
|
|
2314
2393
|
text: t.text,
|
|
2394
|
+
citations: t.citations,
|
|
2315
2395
|
elements: r,
|
|
2316
2396
|
className: i
|
|
2317
2397
|
}, `${n}-text`) : null;
|
|
@@ -2320,27 +2400,27 @@ function Pi(e) {
|
|
|
2320
2400
|
let o;
|
|
2321
2401
|
return t[7] === a ? o = t[8] : (o = /* @__PURE__ */ M(j, { children: a }), t[7] = a, t[8] = o), o;
|
|
2322
2402
|
}
|
|
2323
|
-
function
|
|
2403
|
+
function Ki(e) {
|
|
2324
2404
|
let t = O(4), { segment: n } = e, { part: r } = n;
|
|
2325
2405
|
if (r.type !== "file") return null;
|
|
2326
2406
|
let i;
|
|
2327
|
-
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(
|
|
2407
|
+
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(ki, {
|
|
2328
2408
|
filename: r.filename,
|
|
2329
2409
|
mediaType: r.mediaType,
|
|
2330
2410
|
url: r.url
|
|
2331
2411
|
}), t[0] = r.filename, t[1] = r.mediaType, t[2] = r.url, t[3] = i) : i = t[3], i;
|
|
2332
2412
|
}
|
|
2333
|
-
function
|
|
2334
|
-
let t = O(9), { segment: n } = e, { messages: r } =
|
|
2335
|
-
t[0] === r ? i = t[1] : (i =
|
|
2413
|
+
function qi(e) {
|
|
2414
|
+
let t = O(9), { segment: n } = e, { messages: r } = W(), i;
|
|
2415
|
+
t[0] === r ? i = t[1] : (i = en(r), t[0] = r, t[1] = i);
|
|
2336
2416
|
let a = i, o;
|
|
2337
2417
|
if (t[2] !== n.parts || t[3] !== a) {
|
|
2338
2418
|
let e;
|
|
2339
2419
|
t[5] === a ? e = t[6] : (e = (e) => {
|
|
2340
2420
|
let { part: t, idx: n } = e;
|
|
2341
2421
|
if (t.type !== "source-url") return null;
|
|
2342
|
-
let r =
|
|
2343
|
-
return r === null ? null : /* @__PURE__ */ M(
|
|
2422
|
+
let r = tn(a, t.url);
|
|
2423
|
+
return r === null ? null : /* @__PURE__ */ M(Zn, {
|
|
2344
2424
|
source: {
|
|
2345
2425
|
url: t.url,
|
|
2346
2426
|
title: t.title
|
|
@@ -2352,7 +2432,7 @@ function Ii(e) {
|
|
|
2352
2432
|
let s;
|
|
2353
2433
|
return t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M("span", { children: o }), t[7] = o, t[8] = s), s;
|
|
2354
2434
|
}
|
|
2355
|
-
function
|
|
2435
|
+
function Ji(e) {
|
|
2356
2436
|
let t = O(3), { segment: n } = e, r = G();
|
|
2357
2437
|
if (Y()) return null;
|
|
2358
2438
|
let { part: i } = n;
|
|
@@ -2361,31 +2441,31 @@ function Li(e) {
|
|
|
2361
2441
|
return t[0] !== i.text || t[1] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
2362
2442
|
className: "text-muted-foreground text-xs",
|
|
2363
2443
|
children: /* @__PURE__ */ M(J, {
|
|
2364
|
-
animated:
|
|
2444
|
+
animated: Ei,
|
|
2365
2445
|
isAnimating: a,
|
|
2366
2446
|
children: i.text
|
|
2367
2447
|
})
|
|
2368
2448
|
}), t[0] = i.text, t[1] = a, t[2] = o) : o = t[2], o;
|
|
2369
2449
|
}
|
|
2370
|
-
function
|
|
2450
|
+
function Yi(e) {
|
|
2371
2451
|
let t = O(2), { segment: n } = e;
|
|
2372
|
-
if (!
|
|
2452
|
+
if (!Li()) return null;
|
|
2373
2453
|
let { part: r } = n;
|
|
2374
2454
|
if (r.type !== "dynamic-tool") return null;
|
|
2375
2455
|
let i;
|
|
2376
|
-
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(
|
|
2456
|
+
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(ei, { part: r }), t[0] = r, t[1] = i), i;
|
|
2377
2457
|
}
|
|
2378
|
-
var
|
|
2379
|
-
function
|
|
2380
|
-
let e = l(
|
|
2458
|
+
var Xi = o(null), Zi = o(null);
|
|
2459
|
+
function Qi() {
|
|
2460
|
+
let e = l(Xi);
|
|
2381
2461
|
if (!e) throw Error("Segment.Tool* parts must be rendered within Segment.Tool");
|
|
2382
2462
|
return e;
|
|
2383
2463
|
}
|
|
2384
|
-
function
|
|
2464
|
+
function $i(e) {
|
|
2385
2465
|
let t = O(29), { segment: n, children: r } = e, i = z(), a = G(), { part: o } = n;
|
|
2386
2466
|
if (!S(o)) return null;
|
|
2387
2467
|
let s, c, l, u;
|
|
2388
|
-
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} =
|
|
2468
|
+
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} = gi(o, i.registry), c = _i(u, o.state), s = !c && an(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]);
|
|
2389
2469
|
let d = l, f;
|
|
2390
2470
|
t[7] !== s || t[8] !== d || t[9] !== o ? (f = s ? {
|
|
2391
2471
|
...d ?? { name: y(o) },
|
|
@@ -2407,37 +2487,37 @@ function Hi(e) {
|
|
|
2407
2487
|
aborted: s
|
|
2408
2488
|
}, t[17] = s, t[18] = p, t[19] = o.state, t[20] = g) : g = t[20];
|
|
2409
2489
|
let _;
|
|
2410
|
-
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(
|
|
2490
|
+
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(ta, {}), t[21] = r, t[22] = _);
|
|
2411
2491
|
let v;
|
|
2412
|
-
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(
|
|
2492
|
+
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(Zi, {
|
|
2413
2493
|
value: g,
|
|
2414
2494
|
children: _
|
|
2415
2495
|
}), t[23] = g, t[24] = _, t[25] = v) : v = t[25];
|
|
2416
2496
|
let b;
|
|
2417
|
-
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(
|
|
2497
|
+
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(Xi, {
|
|
2418
2498
|
value: h,
|
|
2419
2499
|
children: v
|
|
2420
2500
|
}), t[26] = h, t[27] = v, t[28] = b) : b = t[28], b;
|
|
2421
2501
|
}
|
|
2422
|
-
function
|
|
2423
|
-
let e = O(2), { part: t, activeClientInput: n } =
|
|
2502
|
+
function ea() {
|
|
2503
|
+
let e = O(2), { part: t, activeClientInput: n } = Qi();
|
|
2424
2504
|
if (n) return null;
|
|
2425
2505
|
let r;
|
|
2426
|
-
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(
|
|
2506
|
+
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(Ii, { part: t }), e[0] = t, e[1] = r), r;
|
|
2427
2507
|
}
|
|
2428
|
-
function
|
|
2429
|
-
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } =
|
|
2508
|
+
function ta(e) {
|
|
2509
|
+
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } = Qi();
|
|
2430
2510
|
if (!i) {
|
|
2431
2511
|
let e;
|
|
2432
2512
|
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M("div", {
|
|
2433
2513
|
className: "min-w-0 flex-1",
|
|
2434
|
-
children: /* @__PURE__ */ M(
|
|
2514
|
+
children: /* @__PURE__ */ M(ea, {})
|
|
2435
2515
|
}), t[0] = e) : e = t[0], e;
|
|
2436
2516
|
}
|
|
2437
2517
|
let o;
|
|
2438
2518
|
t[1] !== n || t[2] !== i || t[3] !== r ? (o = /* @__PURE__ */ M(L, {
|
|
2439
2519
|
className: "cursor-pointer",
|
|
2440
|
-
children: /* @__PURE__ */ M(
|
|
2520
|
+
children: /* @__PURE__ */ M(Hi, {
|
|
2441
2521
|
label: i,
|
|
2442
2522
|
state: r.state,
|
|
2443
2523
|
part: r,
|
|
@@ -2447,7 +2527,7 @@ function Wi(e) {
|
|
|
2447
2527
|
let s;
|
|
2448
2528
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(I, {
|
|
2449
2529
|
className: "mb-2",
|
|
2450
|
-
children: /* @__PURE__ */ M(
|
|
2530
|
+
children: /* @__PURE__ */ M(ea, {})
|
|
2451
2531
|
}), t[5] = s) : s = t[5];
|
|
2452
2532
|
let c;
|
|
2453
2533
|
return t[6] !== a || t[7] !== o ? (c = /* @__PURE__ */ N(F, {
|
|
@@ -2457,63 +2537,63 @@ function Wi(e) {
|
|
|
2457
2537
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2458
2538
|
}
|
|
2459
2539
|
var X = {
|
|
2460
|
-
Text:
|
|
2461
|
-
File:
|
|
2462
|
-
Source:
|
|
2463
|
-
Reasoning:
|
|
2464
|
-
DynamicTool:
|
|
2465
|
-
Tool:
|
|
2466
|
-
ToolDisclosure:
|
|
2467
|
-
ToolContent:
|
|
2540
|
+
Text: Gi,
|
|
2541
|
+
File: Ki,
|
|
2542
|
+
Source: qi,
|
|
2543
|
+
Reasoning: Ji,
|
|
2544
|
+
DynamicTool: Yi,
|
|
2545
|
+
Tool: $i,
|
|
2546
|
+
ToolDisclosure: ta,
|
|
2547
|
+
ToolContent: ea
|
|
2468
2548
|
};
|
|
2469
2549
|
//#endregion
|
|
2470
2550
|
//#region src/lib/chat/trajectory/trajectory-segments.ts
|
|
2471
|
-
function
|
|
2551
|
+
function na(e) {
|
|
2472
2552
|
return S(e) ? "tool" : e.type === "dynamic-tool" ? "dynamic-tool" : e.type === "reasoning" && "text" in e && e.text ? "reasoning" : null;
|
|
2473
2553
|
}
|
|
2474
|
-
function
|
|
2554
|
+
function ra(e, t) {
|
|
2475
2555
|
return e.kind === "text" || e.kind === "file" || e.kind === "source" ? !1 : e.kind === "reasoning" || e.kind !== "dynamic-tool" || !!t;
|
|
2476
2556
|
}
|
|
2477
|
-
function
|
|
2557
|
+
function ia(e, t, n) {
|
|
2478
2558
|
let r = e[t + 1];
|
|
2479
|
-
return !!r &&
|
|
2559
|
+
return !!r && ra(r, n);
|
|
2480
2560
|
}
|
|
2481
|
-
function
|
|
2482
|
-
let t = [];
|
|
2483
|
-
for (let
|
|
2484
|
-
let
|
|
2485
|
-
if (
|
|
2486
|
-
kind:
|
|
2487
|
-
part:
|
|
2488
|
-
idx:
|
|
2561
|
+
function aa(e) {
|
|
2562
|
+
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ? $t(e.citations).map(({ source: e }) => e.url) : []));
|
|
2563
|
+
for (let r = 0; r < e.length; r++) {
|
|
2564
|
+
let i = e[r], a = na(i);
|
|
2565
|
+
if (a) t.push({
|
|
2566
|
+
kind: a,
|
|
2567
|
+
part: i,
|
|
2568
|
+
idx: r
|
|
2489
2569
|
});
|
|
2490
|
-
else if (
|
|
2570
|
+
else if (i.type === "text") {
|
|
2491
2571
|
let e = t[t.length - 1];
|
|
2492
2572
|
e && e.kind === "text" ? e.parts.push({
|
|
2493
|
-
part:
|
|
2494
|
-
idx:
|
|
2573
|
+
part: i,
|
|
2574
|
+
idx: r
|
|
2495
2575
|
}) : t.push({
|
|
2496
2576
|
kind: "text",
|
|
2497
2577
|
parts: [{
|
|
2498
|
-
part:
|
|
2499
|
-
idx:
|
|
2578
|
+
part: i,
|
|
2579
|
+
idx: r
|
|
2500
2580
|
}]
|
|
2501
2581
|
});
|
|
2502
|
-
} else if (
|
|
2582
|
+
} else if (i.type === "file") t.push({
|
|
2503
2583
|
kind: "file",
|
|
2504
|
-
part:
|
|
2505
|
-
idx:
|
|
2584
|
+
part: i,
|
|
2585
|
+
idx: r
|
|
2506
2586
|
});
|
|
2507
|
-
else if (
|
|
2587
|
+
else if (i.type === "source-url" && !n.has(i.url)) {
|
|
2508
2588
|
let e = t[t.length - 1];
|
|
2509
2589
|
e && e.kind === "source" ? e.parts.push({
|
|
2510
|
-
part:
|
|
2511
|
-
idx:
|
|
2590
|
+
part: i,
|
|
2591
|
+
idx: r
|
|
2512
2592
|
}) : t.push({
|
|
2513
2593
|
kind: "source",
|
|
2514
2594
|
parts: [{
|
|
2515
|
-
part:
|
|
2516
|
-
idx:
|
|
2595
|
+
part: i,
|
|
2596
|
+
idx: r
|
|
2517
2597
|
}]
|
|
2518
2598
|
});
|
|
2519
2599
|
}
|
|
@@ -2525,7 +2605,7 @@ function Z(e, t) {
|
|
|
2525
2605
|
}
|
|
2526
2606
|
//#endregion
|
|
2527
2607
|
//#region src/lib/chat/trajectory/nested-trajectory.tsx
|
|
2528
|
-
function
|
|
2608
|
+
function oa(e, t) {
|
|
2529
2609
|
let n = `${Z(e, t)}:${e.kind}`;
|
|
2530
2610
|
if (e.kind === "text") return `${n}:${e.parts.map(({ part: e }) => e.type === "text" ? e.text : "").join("")}`;
|
|
2531
2611
|
if (e.kind === "reasoning" && e.part.type === "reasoning") return `${n}:${e.part.text}`;
|
|
@@ -2535,10 +2615,10 @@ function Yi(e, t) {
|
|
|
2535
2615
|
}
|
|
2536
2616
|
return e.kind === "file" && e.part.type === "file" ? `${n}:${e.part.url}:${e.part.mediaType}:${e.part.filename ?? ""}` : n;
|
|
2537
2617
|
}
|
|
2538
|
-
function
|
|
2618
|
+
function sa(e, t, n) {
|
|
2539
2619
|
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;
|
|
2540
2620
|
}
|
|
2541
|
-
var
|
|
2621
|
+
var ca = c(function(e) {
|
|
2542
2622
|
let t = O(8), { segment: n } = e;
|
|
2543
2623
|
if (n.kind === "tool") {
|
|
2544
2624
|
let e;
|
|
@@ -2560,13 +2640,13 @@ var Zi = c(function(e) {
|
|
|
2560
2640
|
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(X.File, { segment: n }), t[6] = n, t[7] = e), e;
|
|
2561
2641
|
}
|
|
2562
2642
|
return null;
|
|
2563
|
-
},
|
|
2564
|
-
function
|
|
2643
|
+
}, la);
|
|
2644
|
+
function la(e, t) {
|
|
2565
2645
|
return e.complete && t.complete && e.cacheKey === t.cacheKey;
|
|
2566
2646
|
}
|
|
2567
|
-
function
|
|
2647
|
+
function ua(e) {
|
|
2568
2648
|
let t = O(11), { parts: n, className: r } = e, i;
|
|
2569
|
-
t[0] === n ? i = t[1] : (i =
|
|
2649
|
+
t[0] === n ? i = t[1] : (i = aa(n), t[0] = n, t[1] = i);
|
|
2570
2650
|
let a = i;
|
|
2571
2651
|
if (a.length === 0) return null;
|
|
2572
2652
|
let o;
|
|
@@ -2576,10 +2656,10 @@ function $i(e) {
|
|
|
2576
2656
|
let e;
|
|
2577
2657
|
t[6] === a.length ? e = t[7] : (e = (e, t) => {
|
|
2578
2658
|
let n = `${Z(e, t)}-${e.kind}`;
|
|
2579
|
-
return /* @__PURE__ */ M(
|
|
2659
|
+
return /* @__PURE__ */ M(ca, {
|
|
2580
2660
|
segment: e,
|
|
2581
|
-
cacheKey:
|
|
2582
|
-
complete:
|
|
2661
|
+
cacheKey: oa(e, t),
|
|
2662
|
+
complete: sa(e, t, a.length)
|
|
2583
2663
|
}, n);
|
|
2584
2664
|
}, t[6] = a.length, t[7] = e), s = a.map(e), t[4] = a, t[5] = s;
|
|
2585
2665
|
} else s = t[5];
|
|
@@ -2611,13 +2691,13 @@ function Q(e) {
|
|
|
2611
2691
|
}
|
|
2612
2692
|
//#endregion
|
|
2613
2693
|
//#region src/lib/chat/trajectory/trajectories/message-actions.tsx
|
|
2614
|
-
function
|
|
2694
|
+
function da() {
|
|
2615
2695
|
let { index: e } = K(), { messages: t } = W(), n = G();
|
|
2616
2696
|
return !(e === t.length - 1 && (n === "submitted" || n === "streaming" || n === "error"));
|
|
2617
2697
|
}
|
|
2618
|
-
function
|
|
2698
|
+
function fa(e) {
|
|
2619
2699
|
let t = O(5), { className: n, children: r } = e;
|
|
2620
|
-
if (!
|
|
2700
|
+
if (!da() || i.toArray(r).length === 0) return null;
|
|
2621
2701
|
let a;
|
|
2622
2702
|
t[0] === n ? a = t[1] : (a = k("mt-1 flex items-center gap-0.5", n), t[0] = n, t[1] = a);
|
|
2623
2703
|
let o;
|
|
@@ -2627,11 +2707,11 @@ function ta(e) {
|
|
|
2627
2707
|
children: r
|
|
2628
2708
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2629
2709
|
}
|
|
2630
|
-
function
|
|
2631
|
-
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] =
|
|
2710
|
+
function pa(e) {
|
|
2711
|
+
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] = Vr(), o = i ? "Copied" : "Copy message", s;
|
|
2632
2712
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2633
2713
|
let c;
|
|
2634
|
-
t[2] !== a || t[3] !== r ? (c = () => void a(
|
|
2714
|
+
t[2] !== a || t[3] !== r ? (c = () => void a(fi(r)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
2635
2715
|
let l;
|
|
2636
2716
|
t[5] === i ? l = t[6] : (l = M(i ? Re : Ke, { className: "size-3.5" }), t[5] = i, t[6] = l);
|
|
2637
2717
|
let u;
|
|
@@ -2642,7 +2722,7 @@ function na(e) {
|
|
|
2642
2722
|
icon: l
|
|
2643
2723
|
}), t[7] = o, t[8] = s, t[9] = c, t[10] = l, t[11] = u) : u = t[11], u;
|
|
2644
2724
|
}
|
|
2645
|
-
function
|
|
2725
|
+
function ma(e) {
|
|
2646
2726
|
let t = O(9), { className: n } = e, { message: r } = K(), { regenerate: i } = H(), a;
|
|
2647
2727
|
t[0] === n ? a = t[1] : (a = k("p-1.5", n), t[0] = n, t[1] = a);
|
|
2648
2728
|
let o;
|
|
@@ -2657,8 +2737,8 @@ function ra(e) {
|
|
|
2657
2737
|
icon: s
|
|
2658
2738
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2659
2739
|
}
|
|
2660
|
-
function
|
|
2661
|
-
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] =
|
|
2740
|
+
function ha(e) {
|
|
2741
|
+
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] = Vr(), o = i ? "Copied" : "Copy debug JSON", s;
|
|
2662
2742
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2663
2743
|
let c;
|
|
2664
2744
|
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];
|
|
@@ -2674,7 +2754,7 @@ function ia(e) {
|
|
|
2674
2754
|
}
|
|
2675
2755
|
//#endregion
|
|
2676
2756
|
//#region src/lib/chat/trajectory/trajectories/messages-error.tsx
|
|
2677
|
-
function
|
|
2757
|
+
function ga(e) {
|
|
2678
2758
|
let t = O(7), { onTryAgain: n, error: r } = e, i = r instanceof Error ? r.message : "An error occurred. Please try again.", a;
|
|
2679
2759
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
2680
2760
|
className: "text-destructive text-sm",
|
|
@@ -2700,43 +2780,44 @@ function aa(e) {
|
|
|
2700
2780
|
})
|
|
2701
2781
|
}), t[4] = a, t[5] = o, t[6] = s) : s = t[6], s;
|
|
2702
2782
|
}
|
|
2703
|
-
function
|
|
2783
|
+
function _a(e) {
|
|
2704
2784
|
let t = O(3), { error: n, onRetry: r } = e;
|
|
2705
2785
|
if (!n || !r) return null;
|
|
2706
2786
|
let i;
|
|
2707
|
-
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
2787
|
+
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(ga, {
|
|
2708
2788
|
onTryAgain: r,
|
|
2709
2789
|
error: n
|
|
2710
2790
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2711
2791
|
}
|
|
2712
2792
|
//#endregion
|
|
2713
2793
|
//#region src/lib/chat/trajectory/trajectories/messages-shell.tsx
|
|
2714
|
-
function
|
|
2715
|
-
let t = O(
|
|
2716
|
-
t[0] !==
|
|
2794
|
+
function va(e) {
|
|
2795
|
+
let t = O(15), { messages: n, className: r, elements: i, citation: a, status: o, children: s } = e, c;
|
|
2796
|
+
t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== o ? (c = {
|
|
2717
2797
|
messages: n,
|
|
2718
2798
|
elements: i,
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
t[6] === o ? u = t[7] : (u = /* @__PURE__ */ M("div", {
|
|
2725
|
-
className: "flex h-full min-h-0 flex-1 flex-col",
|
|
2726
|
-
children: o
|
|
2727
|
-
}), t[6] = o, t[7] = u);
|
|
2799
|
+
citation: a,
|
|
2800
|
+
status: o
|
|
2801
|
+
}, t[0] = a, t[1] = i, t[2] = n, t[3] = o, t[4] = c) : c = t[4];
|
|
2802
|
+
let l = c, u;
|
|
2803
|
+
t[5] === r ? u = t[6] : (u = k("flex h-full flex-col", r), t[5] = r, t[6] = u);
|
|
2728
2804
|
let d;
|
|
2729
|
-
t[
|
|
2730
|
-
className:
|
|
2731
|
-
children:
|
|
2732
|
-
}), t[
|
|
2805
|
+
t[7] === s ? d = t[8] : (d = /* @__PURE__ */ M("div", {
|
|
2806
|
+
className: "flex h-full min-h-0 flex-1 flex-col",
|
|
2807
|
+
children: s
|
|
2808
|
+
}), t[7] = s, t[8] = d);
|
|
2733
2809
|
let f;
|
|
2734
|
-
|
|
2735
|
-
|
|
2810
|
+
t[9] !== u || t[10] !== d ? (f = /* @__PURE__ */ M("div", {
|
|
2811
|
+
className: u,
|
|
2736
2812
|
children: d
|
|
2737
|
-
}), t[
|
|
2813
|
+
}), t[9] = u, t[10] = d, t[11] = f) : f = t[11];
|
|
2814
|
+
let p;
|
|
2815
|
+
return t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Yn, {
|
|
2816
|
+
value: l,
|
|
2817
|
+
children: f
|
|
2818
|
+
}), t[12] = f, t[13] = l, t[14] = p) : p = t[14], p;
|
|
2738
2819
|
}
|
|
2739
|
-
function
|
|
2820
|
+
function ya(e) {
|
|
2740
2821
|
let t = O(5), { className: n, children: r } = e, i;
|
|
2741
2822
|
t[0] === n ? i = t[1] : (i = k("flex flex-col gap-4", n), t[0] = n, t[1] = i);
|
|
2742
2823
|
let a;
|
|
@@ -2745,7 +2826,7 @@ function ca(e) {
|
|
|
2745
2826
|
children: r
|
|
2746
2827
|
}), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
|
|
2747
2828
|
}
|
|
2748
|
-
function
|
|
2829
|
+
function ba(e) {
|
|
2749
2830
|
let t = O(9), { message: n, index: r, className: i, children: a } = e, o;
|
|
2750
2831
|
t[0] !== r || t[1] !== n ? (o = {
|
|
2751
2832
|
message: n,
|
|
@@ -2757,14 +2838,14 @@ function la(e) {
|
|
|
2757
2838
|
children: a
|
|
2758
2839
|
}), t[3] = a, t[4] = i, t[5] = c) : c = t[5];
|
|
2759
2840
|
let l;
|
|
2760
|
-
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(
|
|
2841
|
+
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(Xn, {
|
|
2761
2842
|
value: s,
|
|
2762
2843
|
children: c
|
|
2763
2844
|
}), t[6] = c, t[7] = s, t[8] = l) : l = t[8], l;
|
|
2764
2845
|
}
|
|
2765
2846
|
//#endregion
|
|
2766
2847
|
//#region src/lib/components/PendingToolInput.tsx
|
|
2767
|
-
function
|
|
2848
|
+
function xa() {
|
|
2768
2849
|
let e = O(5), { registry: t } = z(), n = H().messages, r;
|
|
2769
2850
|
if (e[0] !== n || e[1] !== t) {
|
|
2770
2851
|
bb0: {
|
|
@@ -2772,7 +2853,7 @@ function ua() {
|
|
|
2772
2853
|
r = null;
|
|
2773
2854
|
break bb0;
|
|
2774
2855
|
}
|
|
2775
|
-
let i = n.findLast(
|
|
2856
|
+
let i = n.findLast(Sa);
|
|
2776
2857
|
if (!i) {
|
|
2777
2858
|
r = null;
|
|
2778
2859
|
break bb0;
|
|
@@ -2791,12 +2872,12 @@ function ua() {
|
|
|
2791
2872
|
} else r = e[2];
|
|
2792
2873
|
return r;
|
|
2793
2874
|
}
|
|
2794
|
-
function
|
|
2875
|
+
function Sa(e) {
|
|
2795
2876
|
let { role: t } = e;
|
|
2796
2877
|
return t === "assistant";
|
|
2797
2878
|
}
|
|
2798
|
-
function
|
|
2799
|
-
let t = O(10), { children: n, className: i } = e, a =
|
|
2879
|
+
function Ca(e) {
|
|
2880
|
+
let t = O(10), { children: n, className: i } = e, a = xa(), o = a?.entry.component, s = a ? "hidden" : "visible", c;
|
|
2800
2881
|
t[0] !== n || t[1] !== s ? (c = /* @__PURE__ */ M(r, {
|
|
2801
2882
|
mode: s,
|
|
2802
2883
|
children: n
|
|
@@ -2811,12 +2892,12 @@ function fa(e) {
|
|
|
2811
2892
|
}
|
|
2812
2893
|
//#endregion
|
|
2813
2894
|
//#region src/lib/chat/trajectory/trajectories/thinking-hint.ts
|
|
2814
|
-
function
|
|
2895
|
+
function wa(e, t) {
|
|
2815
2896
|
if (e === "error" || e === "ready" || !t) return null;
|
|
2816
2897
|
if (t.role !== "assistant") return "Thinking...";
|
|
2817
2898
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2818
2899
|
let n = t.parts[e];
|
|
2819
|
-
if (C(n) &&
|
|
2900
|
+
if (C(n) && Wi(n) && n.text) return n.text;
|
|
2820
2901
|
}
|
|
2821
2902
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2822
2903
|
let n = t.parts[e];
|
|
@@ -2840,7 +2921,7 @@ function pa(e, t) {
|
|
|
2840
2921
|
}
|
|
2841
2922
|
//#endregion
|
|
2842
2923
|
//#region src/lib/chat/trajectory/trajectories/timeline-dot.tsx
|
|
2843
|
-
function
|
|
2924
|
+
function Ta(e) {
|
|
2844
2925
|
let t = O(5), { isLast: n } = e, r = n !== void 0 && n, i;
|
|
2845
2926
|
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];
|
|
2846
2927
|
let a;
|
|
@@ -2853,7 +2934,7 @@ function ma(e) {
|
|
|
2853
2934
|
}
|
|
2854
2935
|
//#endregion
|
|
2855
2936
|
//#region src/lib/chat/trajectory/trajectories/timeline-item.tsx
|
|
2856
|
-
function
|
|
2937
|
+
function Ea(e) {
|
|
2857
2938
|
let t = O(6), { marker: n, children: r, className: i } = e, a;
|
|
2858
2939
|
t[0] === i ? a = t[1] : (a = k("relative z-0 flex gap-3 pl-5", i), t[0] = i, t[1] = a);
|
|
2859
2940
|
let o;
|
|
@@ -2864,15 +2945,15 @@ function ha(e) {
|
|
|
2864
2945
|
}
|
|
2865
2946
|
//#endregion
|
|
2866
2947
|
//#region src/lib/chat/trajectory/trajectories/trajectory-thinking.tsx
|
|
2867
|
-
function
|
|
2868
|
-
let e = O(6), t = G(), { messages: n } = W(), r =
|
|
2869
|
-
e[0] !== t || e[1] !== i ? (a =
|
|
2948
|
+
function Da() {
|
|
2949
|
+
let e = O(6), t = G(), { messages: n } = W(), r = xa(), i = n[n.length - 1], a;
|
|
2950
|
+
e[0] !== t || e[1] !== i ? (a = wa(t, i), e[0] = t, e[1] = i, e[2] = a) : a = e[2];
|
|
2870
2951
|
let o = a;
|
|
2871
2952
|
if (!o || r) return null;
|
|
2872
2953
|
let s;
|
|
2873
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
2954
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(Ta, { isLast: !0 }), e[3] = s) : s = e[3];
|
|
2874
2955
|
let c;
|
|
2875
|
-
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(
|
|
2956
|
+
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(Ea, {
|
|
2876
2957
|
className: "mt-2",
|
|
2877
2958
|
marker: s,
|
|
2878
2959
|
children: /* @__PURE__ */ M("span", {
|
|
@@ -2893,7 +2974,7 @@ var $ = [
|
|
|
2893
2974
|
"reasoningTokens",
|
|
2894
2975
|
"cachedInputTokens",
|
|
2895
2976
|
"totalTokens"
|
|
2896
|
-
],
|
|
2977
|
+
], Oa = {
|
|
2897
2978
|
inputTokens: [["inputTokens"], ["raw", "prompt_tokens"]],
|
|
2898
2979
|
outputTokens: [["outputTokens"], ["raw", "completion_tokens"]],
|
|
2899
2980
|
reasoningTokens: [
|
|
@@ -2917,7 +2998,7 @@ var $ = [
|
|
|
2917
2998
|
],
|
|
2918
2999
|
totalTokens: [["totalTokens"], ["raw", "total_tokens"]]
|
|
2919
3000
|
};
|
|
2920
|
-
function
|
|
3001
|
+
function ka(e) {
|
|
2921
3002
|
if (typeof e == "number" && Number.isFinite(e) && e >= 0) return e;
|
|
2922
3003
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
2923
3004
|
let t = Number(e);
|
|
@@ -2925,7 +3006,7 @@ function va(e) {
|
|
|
2925
3006
|
}
|
|
2926
3007
|
return null;
|
|
2927
3008
|
}
|
|
2928
|
-
function
|
|
3009
|
+
function Aa(e) {
|
|
2929
3010
|
if (!e || typeof e != "object") return null;
|
|
2930
3011
|
let t = {
|
|
2931
3012
|
inputTokens: null,
|
|
@@ -2934,8 +3015,8 @@ function ya(e) {
|
|
|
2934
3015
|
cachedInputTokens: null,
|
|
2935
3016
|
totalTokens: null
|
|
2936
3017
|
};
|
|
2937
|
-
for (let n of $) for (let r of
|
|
2938
|
-
let i =
|
|
3018
|
+
for (let n of $) for (let r of Oa[n]) {
|
|
3019
|
+
let i = ka(Dt(e, r));
|
|
2939
3020
|
if (i !== null) {
|
|
2940
3021
|
t[n] = i;
|
|
2941
3022
|
break;
|
|
@@ -2943,10 +3024,10 @@ function ya(e) {
|
|
|
2943
3024
|
}
|
|
2944
3025
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
2945
3026
|
}
|
|
2946
|
-
function
|
|
2947
|
-
return D(e) ?
|
|
3027
|
+
function ja(e) {
|
|
3028
|
+
return D(e) ? Aa(e.totalUsage ?? e.usage) : null;
|
|
2948
3029
|
}
|
|
2949
|
-
function
|
|
3030
|
+
function Ma(e, t) {
|
|
2950
3031
|
let n = {
|
|
2951
3032
|
inputTokens: null,
|
|
2952
3033
|
outputTokens: null,
|
|
@@ -2968,7 +3049,7 @@ function xa(e, t) {
|
|
|
2968
3049
|
}
|
|
2969
3050
|
return $.some((e) => n[e] !== null) ? n : null;
|
|
2970
3051
|
}
|
|
2971
|
-
function
|
|
3052
|
+
function Na(e) {
|
|
2972
3053
|
if (e.length === 0) return null;
|
|
2973
3054
|
let t = {
|
|
2974
3055
|
inputTokens: null,
|
|
@@ -2987,32 +3068,32 @@ function Sa(e) {
|
|
|
2987
3068
|
}
|
|
2988
3069
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
2989
3070
|
}
|
|
2990
|
-
function
|
|
3071
|
+
function Pa(e) {
|
|
2991
3072
|
let t = {}, n = [], r = null, i = null;
|
|
2992
3073
|
for (let a of e) {
|
|
2993
3074
|
if (a.role !== "assistant") continue;
|
|
2994
|
-
let e = D(a.metadata) ? a.metadata : void 0, o =
|
|
3075
|
+
let e = D(a.metadata) ? a.metadata : void 0, o = Aa(e?.usage), s = Aa(e?.totalUsage), c = o ?? (s ? Ma(s, r) : null);
|
|
2995
3076
|
c && (t[a.id] = c, n.push(c)), s && (i = s, r = s);
|
|
2996
3077
|
}
|
|
2997
3078
|
return {
|
|
2998
3079
|
assistantUsageByMessageId: t,
|
|
2999
|
-
chatUsageSummary: i ??
|
|
3080
|
+
chatUsageSummary: i ?? Na(n)
|
|
3000
3081
|
};
|
|
3001
3082
|
}
|
|
3002
|
-
function
|
|
3083
|
+
function Fa() {
|
|
3003
3084
|
let e = O(2), t = H(), n;
|
|
3004
|
-
return e[0] === t.messages ? n = e[1] : (n =
|
|
3085
|
+
return e[0] === t.messages ? n = e[1] : (n = Pa(t.messages), e[0] = t.messages, e[1] = n), n;
|
|
3005
3086
|
}
|
|
3006
|
-
function
|
|
3087
|
+
function Ia(e) {
|
|
3007
3088
|
return kt(e);
|
|
3008
3089
|
}
|
|
3009
|
-
function
|
|
3090
|
+
function La(e) {
|
|
3010
3091
|
let t = [`↑ ${Ot(e.inputTokens)}`, `↓ ${Ot(e.outputTokens)}`];
|
|
3011
3092
|
return e.totalTokens !== null && t.push(`· ${kt(e.totalTokens)} tokens`), e.cachedInputTokens !== null && e.cachedInputTokens > 0 && t.push(`(${Ot(e.cachedInputTokens)} cached)`), t.join(" ");
|
|
3012
3093
|
}
|
|
3013
3094
|
//#endregion
|
|
3014
3095
|
//#region src/lib/chat/zukhruf-chat-transport.ts
|
|
3015
|
-
var
|
|
3096
|
+
var Ra = "x-upload-filename", za = P.strictObject({
|
|
3016
3097
|
path: P.string().startsWith("/"),
|
|
3017
3098
|
name: P.string().min(1),
|
|
3018
3099
|
mediaType: P.enum([
|
|
@@ -3030,19 +3111,19 @@ var Da = "x-upload-filename", Oa = P.strictObject({
|
|
|
3030
3111
|
]),
|
|
3031
3112
|
size: P.int().nonnegative(),
|
|
3032
3113
|
url: P.url()
|
|
3033
|
-
}),
|
|
3114
|
+
}), Ba = class extends _ {
|
|
3034
3115
|
sessionsApi;
|
|
3035
3116
|
request;
|
|
3036
3117
|
constructor({ api: e, fetch: t = (e, t) => globalThis.fetch(e, t), tools: n = {}, elements: r = [] }) {
|
|
3037
|
-
let i =
|
|
3118
|
+
let i = Wa(e), a = r.map(se);
|
|
3038
3119
|
super({
|
|
3039
3120
|
api: i,
|
|
3040
3121
|
fetch: async (e, n) => {
|
|
3041
3122
|
let r = await t(e, n);
|
|
3042
3123
|
if ((n?.method ?? "GET").toUpperCase() !== "POST" || !r.ok) return r;
|
|
3043
3124
|
let i = await r.json();
|
|
3044
|
-
if (!
|
|
3045
|
-
let a =
|
|
3125
|
+
if (!Ga(i)) throw Error("Zukhruf returned an invalid accepted-turn response");
|
|
3126
|
+
let a = Wa(String(e)), o = decodeURIComponent(a.slice(a.lastIndexOf("/") + 1));
|
|
3046
3127
|
if (i.sessionId !== o) throw Error("Zukhruf returned a different session ID");
|
|
3047
3128
|
let s = n?.signal;
|
|
3048
3129
|
return s?.addEventListener("abort", () => {
|
|
@@ -3057,7 +3138,7 @@ var Da = "x-upload-filename", Oa = P.strictObject({
|
|
|
3057
3138
|
let o = t[t.length - 1];
|
|
3058
3139
|
if (!o) throw Error("A message is required");
|
|
3059
3140
|
return {
|
|
3060
|
-
api:
|
|
3141
|
+
api: Va(i, e),
|
|
3061
3142
|
body: {
|
|
3062
3143
|
sessionId: e,
|
|
3063
3144
|
message: o,
|
|
@@ -3068,50 +3149,50 @@ var Da = "x-upload-filename", Oa = P.strictObject({
|
|
|
3068
3149
|
};
|
|
3069
3150
|
},
|
|
3070
3151
|
prepareReconnectToStreamRequest: ({ headers: e, id: t }) => ({
|
|
3071
|
-
api: `${
|
|
3152
|
+
api: `${Va(i, t)}/stream`,
|
|
3072
3153
|
headers: e
|
|
3073
3154
|
})
|
|
3074
3155
|
}), this.sessionsApi = i, this.request = t;
|
|
3075
3156
|
}
|
|
3076
3157
|
async uploadFile(e, t) {
|
|
3077
|
-
let n = await this.request(`${
|
|
3158
|
+
let n = await this.request(`${Va(this.sessionsApi, e)}/uploads`, {
|
|
3078
3159
|
method: "POST",
|
|
3079
3160
|
headers: {
|
|
3080
3161
|
"content-type": t.type,
|
|
3081
|
-
[
|
|
3162
|
+
[Ra]: encodeURIComponent(t.name)
|
|
3082
3163
|
},
|
|
3083
3164
|
body: t
|
|
3084
3165
|
});
|
|
3085
|
-
if (!n.ok) throw Error(await
|
|
3086
|
-
let r =
|
|
3166
|
+
if (!n.ok) throw Error(await Ha(n, t));
|
|
3167
|
+
let r = za.safeParse(await n.json());
|
|
3087
3168
|
if (!r.success) throw Error("Zukhruf returned an invalid upload response");
|
|
3088
3169
|
return r.data;
|
|
3089
3170
|
}
|
|
3090
3171
|
};
|
|
3091
|
-
function
|
|
3172
|
+
function Va(e, t) {
|
|
3092
3173
|
return `${e}/${encodeURIComponent(t)}`;
|
|
3093
3174
|
}
|
|
3094
|
-
async function
|
|
3095
|
-
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r =
|
|
3175
|
+
async function Ha(e, t) {
|
|
3176
|
+
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r = Ua(await e.json().catch((e) => {
|
|
3096
3177
|
if (e instanceof SyntaxError) return null;
|
|
3097
3178
|
throw e;
|
|
3098
3179
|
}));
|
|
3099
3180
|
return r ? `${n}: ${r}` : n;
|
|
3100
3181
|
}
|
|
3101
|
-
function
|
|
3182
|
+
function Ua(e) {
|
|
3102
3183
|
if (typeof e != "object" || !e) return null;
|
|
3103
3184
|
let t = "cause" in e && typeof e.cause == "object" && e.cause !== null ? e.cause : null;
|
|
3104
3185
|
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;
|
|
3105
3186
|
}
|
|
3106
|
-
function
|
|
3187
|
+
function Wa(e) {
|
|
3107
3188
|
return e.replace(/\/$/, "");
|
|
3108
3189
|
}
|
|
3109
|
-
function
|
|
3190
|
+
function Ga(e) {
|
|
3110
3191
|
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";
|
|
3111
3192
|
}
|
|
3112
3193
|
//#endregion
|
|
3113
3194
|
//#region src/lib/chat/trajectory/trajectories/collapsible-disclosure.tsx
|
|
3114
|
-
function
|
|
3195
|
+
function Ka(e) {
|
|
3115
3196
|
let t = O(24), { label: n, open: r, onOpenChange: i, children: a, className: o, triggerClassName: s, contentClassName: c, chevronClassName: l } = e, u;
|
|
3116
3197
|
t[0] === s ? u = t[1] : (u = k("flex items-center font-mono", s), t[0] = s, t[1] = u);
|
|
3117
3198
|
let d;
|
|
@@ -3145,19 +3226,19 @@ function Fa(e) {
|
|
|
3145
3226
|
}
|
|
3146
3227
|
//#endregion
|
|
3147
3228
|
//#region src/lib/chat/trajectory/trajectories/user-message.tsx
|
|
3148
|
-
function
|
|
3229
|
+
function qa(e) {
|
|
3149
3230
|
let t = O(7), { metadata: n } = e;
|
|
3150
3231
|
if (!n) return null;
|
|
3151
3232
|
let r, i, a;
|
|
3152
3233
|
if (t[0] !== n) {
|
|
3153
3234
|
a = Symbol.for("react.early_return_sentinel");
|
|
3154
3235
|
bb0: {
|
|
3155
|
-
let e =
|
|
3236
|
+
let e = ja(n);
|
|
3156
3237
|
if (!e) {
|
|
3157
3238
|
a = null;
|
|
3158
3239
|
break bb0;
|
|
3159
3240
|
}
|
|
3160
|
-
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i =
|
|
3241
|
+
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i = La(e);
|
|
3161
3242
|
}
|
|
3162
3243
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a;
|
|
3163
3244
|
} else r = t[1], i = t[2], a = t[3];
|
|
@@ -3168,27 +3249,27 @@ function Ia(e) {
|
|
|
3168
3249
|
children: i
|
|
3169
3250
|
}), t[4] = r, t[5] = i, t[6] = o) : o = t[6], o;
|
|
3170
3251
|
}
|
|
3171
|
-
function
|
|
3252
|
+
function Ja(e, t) {
|
|
3172
3253
|
return D(e.metadata) ? e.metadata[t] : void 0;
|
|
3173
3254
|
}
|
|
3174
|
-
function
|
|
3175
|
-
let t =
|
|
3255
|
+
function Ya(e) {
|
|
3256
|
+
let t = Ja(e, "reminders");
|
|
3176
3257
|
return Array.isArray(t) ? t.filter((e) => {
|
|
3177
3258
|
if (!e || typeof e != "object") return !1;
|
|
3178
3259
|
let t = e;
|
|
3179
3260
|
return typeof t.id == "string" && t.id.length > 0 && typeof t.text == "string" && t.text.trim().length > 0;
|
|
3180
3261
|
}) : [];
|
|
3181
3262
|
}
|
|
3182
|
-
function
|
|
3183
|
-
let t =
|
|
3263
|
+
function Xa(e) {
|
|
3264
|
+
let t = Ja(e, "uploads");
|
|
3184
3265
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
3185
|
-
let t =
|
|
3266
|
+
let t = za.safeParse(e);
|
|
3186
3267
|
return t.success ? [t.data] : [];
|
|
3187
3268
|
}) : [];
|
|
3188
3269
|
}
|
|
3189
|
-
function
|
|
3270
|
+
function Za(e) {
|
|
3190
3271
|
let t = O(7), { text: n } = e, [r, i] = g(!1), a;
|
|
3191
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(
|
|
3272
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(Qa), t[0] = a) : a = t[0];
|
|
3192
3273
|
let o = !r && "line-clamp-3", s;
|
|
3193
3274
|
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);
|
|
3194
3275
|
let c;
|
|
@@ -3200,21 +3281,21 @@ function Ba(e) {
|
|
|
3200
3281
|
children: n
|
|
3201
3282
|
}) }), t[3] = r, t[4] = s, t[5] = n, t[6] = c) : c = t[6], c;
|
|
3202
3283
|
}
|
|
3203
|
-
function
|
|
3284
|
+
function Qa(e) {
|
|
3204
3285
|
return !e;
|
|
3205
3286
|
}
|
|
3206
|
-
function
|
|
3287
|
+
function $a(e) {
|
|
3207
3288
|
let t = O(8), { reminders: n } = e, [r, i] = g(!1);
|
|
3208
3289
|
if (n.length === 0) return null;
|
|
3209
3290
|
let a = `${n.length} reminder${n.length === 1 ? "" : "s"} attached`, o;
|
|
3210
|
-
t[0] === n ? o = t[1] : (o = n.map(
|
|
3291
|
+
t[0] === n ? o = t[1] : (o = n.map(eo), t[0] = n, t[1] = o);
|
|
3211
3292
|
let s;
|
|
3212
3293
|
t[2] === o ? s = t[3] : (s = /* @__PURE__ */ M("ul", {
|
|
3213
3294
|
className: "border-ink-12 text-muted-foreground space-y-1 border-l pl-3 text-xs",
|
|
3214
3295
|
children: o
|
|
3215
3296
|
}), t[2] = o, t[3] = s);
|
|
3216
3297
|
let c;
|
|
3217
|
-
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(
|
|
3298
|
+
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(Ka, {
|
|
3218
3299
|
label: a,
|
|
3219
3300
|
open: r,
|
|
3220
3301
|
onOpenChange: i,
|
|
@@ -3225,10 +3306,10 @@ function Ha(e) {
|
|
|
3225
3306
|
children: s
|
|
3226
3307
|
}), t[4] = a, t[5] = r, t[6] = s, t[7] = c) : c = t[7], c;
|
|
3227
3308
|
}
|
|
3228
|
-
function
|
|
3229
|
-
return /* @__PURE__ */ M(
|
|
3309
|
+
function eo(e) {
|
|
3310
|
+
return /* @__PURE__ */ M(Za, { text: e.text }, e.id);
|
|
3230
3311
|
}
|
|
3231
|
-
function
|
|
3312
|
+
function to(e) {
|
|
3232
3313
|
let t = O(19), { upload: n } = e;
|
|
3233
3314
|
if (n.mediaType.startsWith("video/")) {
|
|
3234
3315
|
let e;
|
|
@@ -3294,17 +3375,17 @@ function Wa(e) {
|
|
|
3294
3375
|
})
|
|
3295
3376
|
}), t[16] = n.name, t[17] = n.url, t[18] = r) : r = t[18], r;
|
|
3296
3377
|
}
|
|
3297
|
-
function
|
|
3378
|
+
function no(e) {
|
|
3298
3379
|
let t = O(13), { message: n } = e, r, i, a, o, s, c;
|
|
3299
3380
|
if (t[0] !== n) {
|
|
3300
3381
|
c = Symbol.for("react.early_return_sentinel");
|
|
3301
3382
|
bb0: {
|
|
3302
|
-
let e =
|
|
3383
|
+
let e = Xa(n);
|
|
3303
3384
|
if (e.length === 0) {
|
|
3304
3385
|
c = null;
|
|
3305
3386
|
break bb0;
|
|
3306
3387
|
}
|
|
3307
|
-
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(
|
|
3388
|
+
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(ro);
|
|
3308
3389
|
}
|
|
3309
3390
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a, t[4] = o, t[5] = s, t[6] = c;
|
|
3310
3391
|
} else r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], c = t[6];
|
|
@@ -3317,23 +3398,23 @@ function Ga(e) {
|
|
|
3317
3398
|
children: s
|
|
3318
3399
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o, t[11] = s, t[12] = l) : l = t[12], l;
|
|
3319
3400
|
}
|
|
3320
|
-
function
|
|
3401
|
+
function ro(e) {
|
|
3321
3402
|
return /* @__PURE__ */ M("div", {
|
|
3322
3403
|
role: "listitem",
|
|
3323
3404
|
"data-slot": "attachment",
|
|
3324
|
-
children: /* @__PURE__ */ M(
|
|
3405
|
+
children: /* @__PURE__ */ M(to, { upload: e })
|
|
3325
3406
|
}, e.path);
|
|
3326
3407
|
}
|
|
3327
|
-
function
|
|
3408
|
+
function io(e) {
|
|
3328
3409
|
let t = O(10), { body: n, reminders: r, metadata: i } = e, a;
|
|
3329
3410
|
t[0] === n ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
3330
3411
|
className: "flex-1 space-y-3",
|
|
3331
3412
|
children: n
|
|
3332
3413
|
}), t[0] = n, t[1] = a);
|
|
3333
3414
|
let o;
|
|
3334
|
-
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(
|
|
3415
|
+
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M($a, { reminders: r }), t[2] = r, t[3] = o);
|
|
3335
3416
|
let s;
|
|
3336
|
-
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(
|
|
3417
|
+
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(qa, { metadata: i }), t[4] = i, t[5] = s);
|
|
3337
3418
|
let c;
|
|
3338
3419
|
return t[6] !== a || t[7] !== o || t[8] !== s ? (c = /* @__PURE__ */ N("div", {
|
|
3339
3420
|
className: "bg-secondary flex max-w-[80%] flex-col gap-3 rounded-lg p-3",
|
|
@@ -3344,13 +3425,13 @@ function qa(e) {
|
|
|
3344
3425
|
]
|
|
3345
3426
|
}), t[6] = a, t[7] = o, t[8] = s, t[9] = c) : c = t[9], c;
|
|
3346
3427
|
}
|
|
3347
|
-
function
|
|
3428
|
+
function ao(e) {
|
|
3348
3429
|
let t = O(28), { message: n } = e;
|
|
3349
|
-
|
|
3430
|
+
Ja(n, "reminders");
|
|
3350
3431
|
let r;
|
|
3351
3432
|
t[0] === n ? r = t[1] : (r = ee(n), t[0] = n, t[1] = r);
|
|
3352
3433
|
let i;
|
|
3353
|
-
t[2] === n ? i = t[3] : (i =
|
|
3434
|
+
t[2] === n ? i = t[3] : (i = Ya(n), t[2] = n, t[3] = i);
|
|
3354
3435
|
let a;
|
|
3355
3436
|
t[4] !== r || t[5] !== i ? (a = {
|
|
3356
3437
|
message: r,
|
|
@@ -3358,7 +3439,7 @@ function Ja(e) {
|
|
|
3358
3439
|
}, t[4] = r, t[5] = i, t[6] = a) : a = t[6];
|
|
3359
3440
|
let { message: o, reminders: s } = a, c;
|
|
3360
3441
|
if (t[7] !== n) {
|
|
3361
|
-
let e =
|
|
3442
|
+
let e = Ja(n, "alias");
|
|
3362
3443
|
c = typeof e == "string" && e.trim().length > 0 ? e : void 0, t[7] = n, t[8] = c;
|
|
3363
3444
|
} else c = t[8];
|
|
3364
3445
|
let l = c;
|
|
@@ -3370,13 +3451,13 @@ function Ja(e) {
|
|
|
3370
3451
|
children: l
|
|
3371
3452
|
}), t[9] = l, t[10] = e);
|
|
3372
3453
|
let n;
|
|
3373
|
-
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(
|
|
3454
|
+
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(io, {
|
|
3374
3455
|
reminders: s,
|
|
3375
3456
|
body: e
|
|
3376
3457
|
}), t[11] = s, t[12] = e, t[13] = n) : n = t[13], n;
|
|
3377
3458
|
}
|
|
3378
3459
|
let u;
|
|
3379
|
-
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(
|
|
3460
|
+
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(no, { message: o }), t[14] = o, t[15] = u);
|
|
3380
3461
|
let d = o.metadata, f;
|
|
3381
3462
|
if (t[16] !== o.id || t[17] !== o.parts) {
|
|
3382
3463
|
let e;
|
|
@@ -3387,7 +3468,7 @@ function Ja(e) {
|
|
|
3387
3468
|
}, `${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;
|
|
3388
3469
|
} else f = t[18];
|
|
3389
3470
|
let p;
|
|
3390
|
-
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(
|
|
3471
|
+
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(io, {
|
|
3391
3472
|
reminders: s,
|
|
3392
3473
|
metadata: d,
|
|
3393
3474
|
body: f
|
|
@@ -3398,11 +3479,11 @@ function Ja(e) {
|
|
|
3398
3479
|
children: [u, p]
|
|
3399
3480
|
}), t[25] = u, t[26] = p, t[27] = m) : m = t[27], m;
|
|
3400
3481
|
}
|
|
3401
|
-
var
|
|
3482
|
+
var oo = c(function(e) {
|
|
3402
3483
|
let t = O(7), { className: n } = e, { message: r } = K(), i;
|
|
3403
3484
|
t[0] === n ? i = t[1] : (i = k("flex justify-end", n), t[0] = n, t[1] = i);
|
|
3404
3485
|
let a;
|
|
3405
|
-
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(
|
|
3486
|
+
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(ao, { message: r }), t[2] = r, t[3] = a);
|
|
3406
3487
|
let o;
|
|
3407
3488
|
return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3408
3489
|
className: i,
|
|
@@ -3411,20 +3492,20 @@ var Ya = c(function(e) {
|
|
|
3411
3492
|
});
|
|
3412
3493
|
//#endregion
|
|
3413
3494
|
//#region src/lib/chat/trajectory/trajectories/compact-messages.tsx
|
|
3414
|
-
function
|
|
3415
|
-
return e.kind === "tool" ? !
|
|
3495
|
+
function so(e) {
|
|
3496
|
+
return e.kind === "tool" ? !mi(e.part) : e.kind === "dynamic-tool" || e.kind === "reasoning";
|
|
3416
3497
|
}
|
|
3417
|
-
function
|
|
3498
|
+
function co(e, t) {
|
|
3418
3499
|
return e.kind === "tool" ? !0 : e.kind === "reasoning" || e.kind === "dynamic-tool" ? !!t : !1;
|
|
3419
3500
|
}
|
|
3420
|
-
function
|
|
3421
|
-
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !
|
|
3501
|
+
function lo(e) {
|
|
3502
|
+
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !Wi(e));
|
|
3422
3503
|
}
|
|
3423
|
-
function
|
|
3504
|
+
function uo(e, t) {
|
|
3424
3505
|
let n = [];
|
|
3425
3506
|
for (let r = 0; r < e.length; r++) {
|
|
3426
3507
|
let i = e[r];
|
|
3427
|
-
if (!
|
|
3508
|
+
if (!so(i)) {
|
|
3428
3509
|
n.push({
|
|
3429
3510
|
kind: "segment",
|
|
3430
3511
|
segment: i,
|
|
@@ -3433,25 +3514,25 @@ function $a(e, t) {
|
|
|
3433
3514
|
continue;
|
|
3434
3515
|
}
|
|
3435
3516
|
let a = [], o = r;
|
|
3436
|
-
for (; r < e.length &&
|
|
3517
|
+
for (; r < e.length && so(e[r]);) {
|
|
3437
3518
|
let n = e[r];
|
|
3438
|
-
|
|
3519
|
+
co(n, t) && a.push({ segment: n }), r++;
|
|
3439
3520
|
}
|
|
3440
3521
|
r--, a.length > 0 && n.push({
|
|
3441
3522
|
kind: "group",
|
|
3442
3523
|
items: a,
|
|
3443
|
-
hasLaterText: e.slice(r + 1).some((e) =>
|
|
3524
|
+
hasLaterText: e.slice(r + 1).some((e) => lo(e)),
|
|
3444
3525
|
firstIndex: o
|
|
3445
3526
|
});
|
|
3446
3527
|
}
|
|
3447
3528
|
return n;
|
|
3448
3529
|
}
|
|
3449
|
-
function
|
|
3530
|
+
function fo(e) {
|
|
3450
3531
|
if (e.kind !== "tool" && e.kind !== "dynamic-tool") return;
|
|
3451
3532
|
let { part: t } = e;
|
|
3452
3533
|
return w(t) ? t.state : void 0;
|
|
3453
3534
|
}
|
|
3454
|
-
function
|
|
3535
|
+
function po({ groupStatus: e, labelCount: t }) {
|
|
3455
3536
|
return e === "running" ? {
|
|
3456
3537
|
title: "text-info",
|
|
3457
3538
|
detail: "text-info/80",
|
|
@@ -3474,20 +3555,20 @@ function to({ groupStatus: e, labelCount: t }) {
|
|
|
3474
3555
|
chevron: "text-muted-foreground"
|
|
3475
3556
|
};
|
|
3476
3557
|
}
|
|
3477
|
-
function
|
|
3558
|
+
function mo(e) {
|
|
3478
3559
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3479
3560
|
}
|
|
3480
|
-
function
|
|
3561
|
+
function ho(e, t = 80) {
|
|
3481
3562
|
let n = e.replace(/\s+/g, " ").trim();
|
|
3482
3563
|
return n.length <= t ? n : `${n.slice(0, t - 3).trimEnd()}...`;
|
|
3483
3564
|
}
|
|
3484
|
-
function
|
|
3485
|
-
if (typeof e == "string") return
|
|
3565
|
+
function go(e) {
|
|
3566
|
+
if (typeof e == "string") return ho(e, 48);
|
|
3486
3567
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
3487
3568
|
if (Array.isArray(e)) return `${e.length} items`;
|
|
3488
3569
|
}
|
|
3489
|
-
function
|
|
3490
|
-
if (!
|
|
3570
|
+
function _o(e) {
|
|
3571
|
+
if (!mo(e)) return;
|
|
3491
3572
|
let t = [
|
|
3492
3573
|
"command",
|
|
3493
3574
|
"query",
|
|
@@ -3499,13 +3580,13 @@ function ao(e) {
|
|
|
3499
3580
|
"checks"
|
|
3500
3581
|
], n = [...t.filter((t) => t in e).map((t) => [t, e[t]]), ...Object.entries(e).filter(([e]) => !t.includes(e))], r = {};
|
|
3501
3582
|
for (let [e, t] of n) {
|
|
3502
|
-
let n =
|
|
3583
|
+
let n = go(t);
|
|
3503
3584
|
if (n && (r[e] = n, Object.keys(r).length >= 2)) break;
|
|
3504
3585
|
}
|
|
3505
3586
|
return Object.keys(r).length > 0 ? r : void 0;
|
|
3506
3587
|
}
|
|
3507
|
-
function
|
|
3508
|
-
if (
|
|
3588
|
+
function vo(e) {
|
|
3589
|
+
if (mo(e)) for (let t of [
|
|
3509
3590
|
"reasoning",
|
|
3510
3591
|
"thoughts",
|
|
3511
3592
|
"thought",
|
|
@@ -3513,36 +3594,36 @@ function oo(e) {
|
|
|
3513
3594
|
"detail"
|
|
3514
3595
|
]) {
|
|
3515
3596
|
let n = e[t];
|
|
3516
|
-
if (typeof n == "string" && n.trim().length > 0) return
|
|
3597
|
+
if (typeof n == "string" && n.trim().length > 0) return ho(n);
|
|
3517
3598
|
}
|
|
3518
3599
|
}
|
|
3519
|
-
function
|
|
3600
|
+
function yo(e) {
|
|
3520
3601
|
if (e.kind !== "reasoning") return;
|
|
3521
3602
|
let { part: t } = e;
|
|
3522
|
-
if (t.type === "reasoning") return
|
|
3603
|
+
if (t.type === "reasoning") return ho(t.text, 96);
|
|
3523
3604
|
}
|
|
3524
|
-
function
|
|
3605
|
+
function bo(e, t) {
|
|
3525
3606
|
if (e.kind === "reasoning") return {
|
|
3526
3607
|
kind: "reasoning",
|
|
3527
3608
|
name: "reasoning",
|
|
3528
|
-
detail:
|
|
3609
|
+
detail: yo(e)
|
|
3529
3610
|
};
|
|
3530
3611
|
if (e.kind === "dynamic-tool" && e.part.type === "dynamic-tool") {
|
|
3531
3612
|
let t = e.part;
|
|
3532
3613
|
return {
|
|
3533
3614
|
kind: "dynamic-tool",
|
|
3534
3615
|
name: t.toolName || "Tool",
|
|
3535
|
-
args:
|
|
3536
|
-
detail:
|
|
3616
|
+
args: _o(t.input),
|
|
3617
|
+
detail: vo(t.input)
|
|
3537
3618
|
};
|
|
3538
3619
|
}
|
|
3539
3620
|
if (e.kind === "tool" && S(e.part)) {
|
|
3540
|
-
let n = e.part, { toolEntry: r, toolKey: i } =
|
|
3621
|
+
let n = e.part, { toolEntry: r, toolKey: i } = gi(n, t), a = r?.label?.(n);
|
|
3541
3622
|
return {
|
|
3542
3623
|
kind: "tool",
|
|
3543
3624
|
name: a?.name ?? i,
|
|
3544
|
-
args: a?.args ??
|
|
3545
|
-
detail: a?.detail ??
|
|
3625
|
+
args: a?.args ?? _o(n.input),
|
|
3626
|
+
detail: a?.detail ?? vo(n.input),
|
|
3546
3627
|
isError: a?.isError
|
|
3547
3628
|
};
|
|
3548
3629
|
}
|
|
@@ -3551,54 +3632,54 @@ function co(e, t) {
|
|
|
3551
3632
|
name: "Step"
|
|
3552
3633
|
};
|
|
3553
3634
|
}
|
|
3554
|
-
function
|
|
3635
|
+
function xo(e) {
|
|
3555
3636
|
if (!e) return;
|
|
3556
3637
|
let t = Object.entries(e).filter((e) => typeof e[1] == "string" && e[1].trim().length > 0);
|
|
3557
|
-
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${
|
|
3638
|
+
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${ho(t, 36)}`).join(", ");
|
|
3558
3639
|
}
|
|
3559
|
-
function
|
|
3560
|
-
let t =
|
|
3640
|
+
function So(e) {
|
|
3641
|
+
let t = xo(e.args);
|
|
3561
3642
|
return t ? `${e.name}(${t})` : e.name;
|
|
3562
3643
|
}
|
|
3563
|
-
function
|
|
3644
|
+
function Co(e) {
|
|
3564
3645
|
return e === "output-available" || e === "output-error" || e === "output-denied";
|
|
3565
3646
|
}
|
|
3566
|
-
function
|
|
3567
|
-
return !!e && !
|
|
3647
|
+
function wo(e) {
|
|
3648
|
+
return !!e && !Co(e);
|
|
3568
3649
|
}
|
|
3569
|
-
function
|
|
3570
|
-
return
|
|
3650
|
+
function To(e, t) {
|
|
3651
|
+
return rn(e, t);
|
|
3571
3652
|
}
|
|
3572
|
-
function
|
|
3573
|
-
return e.some(({ segment: e }) =>
|
|
3574
|
-
let t =
|
|
3653
|
+
function Eo({ items: e, labels: t, status: n, hasLaterText: r }) {
|
|
3654
|
+
return e.some(({ segment: e }) => To(fo(e), n)) ? "aborted" : !r && (n === "streaming" || n === "submitted") ? "running" : t.some((e) => e.isError) || e.some(({ segment: e }) => {
|
|
3655
|
+
let t = fo(e);
|
|
3575
3656
|
return t === "output-error" || t === "output-denied";
|
|
3576
|
-
}) ? "error" : e.some(({ segment: e }) =>
|
|
3657
|
+
}) ? "error" : e.some(({ segment: e }) => wo(fo(e))) || !r && t.every((e) => e.kind === "reasoning") && (n === "streaming" || n === "submitted") ? "running" : "complete";
|
|
3577
3658
|
}
|
|
3578
|
-
function
|
|
3659
|
+
function Do(e) {
|
|
3579
3660
|
return e && `${e[0].toUpperCase()}${e.slice(1)}`;
|
|
3580
3661
|
}
|
|
3581
|
-
function
|
|
3662
|
+
function Oo(e) {
|
|
3582
3663
|
return e.filter((e) => e.kind !== "reasoning").length;
|
|
3583
3664
|
}
|
|
3584
|
-
function
|
|
3585
|
-
let n =
|
|
3665
|
+
function ko(e, t) {
|
|
3666
|
+
let n = Oo(e);
|
|
3586
3667
|
if (n !== 0) return `${t === "running" || t === "aborted" ? "running" : "ran"} ${n} ${n === 1 ? "tool" : "tools"}`;
|
|
3587
3668
|
}
|
|
3588
|
-
function
|
|
3589
|
-
let n =
|
|
3590
|
-
if (n) return
|
|
3669
|
+
function Ao(e, t) {
|
|
3670
|
+
let n = ko(e, t);
|
|
3671
|
+
if (n) return Do(t === "error" ? `${n} with issues` : t === "aborted" ? `cancelled after ${n}` : n);
|
|
3591
3672
|
}
|
|
3592
|
-
function
|
|
3673
|
+
function jo(e, t, n) {
|
|
3593
3674
|
let r = e.length === 1 ? e[0] : void 0;
|
|
3594
3675
|
if (t === "running") return n || (r?.kind === "reasoning" ? `Reasoning${r.detail ? ` ${r.detail}` : ""}` : e.every((e) => e.kind === "reasoning") ? "Reasoning" : "Working...");
|
|
3595
3676
|
if (r) {
|
|
3596
|
-
let e =
|
|
3677
|
+
let e = So(r);
|
|
3597
3678
|
return t === "error" ? `Failed ${e}` : t === "aborted" ? `Cancelled ${e}` : r.kind === "reasoning" ? `Reasoned${r.detail ? ` ${r.detail}` : ""}` : `Called ${e}`;
|
|
3598
3679
|
}
|
|
3599
|
-
return e.every((e) => e.kind === "reasoning") ? "Reasoned" :
|
|
3680
|
+
return e.every((e) => e.kind === "reasoning") ? "Reasoned" : Ao(e, t) ?? "Ran tools";
|
|
3600
3681
|
}
|
|
3601
|
-
function
|
|
3682
|
+
function Mo(e, t) {
|
|
3602
3683
|
if (t !== "running") {
|
|
3603
3684
|
if (e.length === 1) {
|
|
3604
3685
|
let t = e[0];
|
|
@@ -3607,28 +3688,28 @@ function xo(e, t) {
|
|
|
3607
3688
|
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;
|
|
3608
3689
|
}
|
|
3609
3690
|
}
|
|
3610
|
-
function
|
|
3691
|
+
function No(e) {
|
|
3611
3692
|
let t;
|
|
3612
3693
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
3613
3694
|
let r = e[n].segment;
|
|
3614
3695
|
if (r.kind === "dynamic-tool" && r.part.type === "dynamic-tool") {
|
|
3615
|
-
let e =
|
|
3696
|
+
let e = vo(r.part.input);
|
|
3616
3697
|
if (e) return e;
|
|
3617
3698
|
}
|
|
3618
3699
|
if (r.kind === "tool" && S(r.part)) {
|
|
3619
|
-
let e =
|
|
3700
|
+
let e = vo(r.part.input);
|
|
3620
3701
|
if (e) return e;
|
|
3621
3702
|
}
|
|
3622
|
-
r.kind === "reasoning" && (t ??=
|
|
3703
|
+
r.kind === "reasoning" && (t ??= yo(r));
|
|
3623
3704
|
}
|
|
3624
3705
|
return t;
|
|
3625
3706
|
}
|
|
3626
|
-
function
|
|
3627
|
-
return !e || e.role !== "assistant" ? !1 :
|
|
3707
|
+
function Po(e, t) {
|
|
3708
|
+
return !e || e.role !== "assistant" ? !1 : uo(aa(e.parts), t).some((e) => e.kind === "group" && !e.hasLaterText);
|
|
3628
3709
|
}
|
|
3629
|
-
function
|
|
3710
|
+
function Fo() {
|
|
3630
3711
|
let e = O(8), { message: t } = K(), { debugMode: n } = z(), r;
|
|
3631
|
-
e[0] === t.parts ? r = e[1] : (r =
|
|
3712
|
+
e[0] === t.parts ? r = e[1] : (r = aa(t.parts), e[0] = t.parts, e[1] = r);
|
|
3632
3713
|
let i = r, a;
|
|
3633
3714
|
if (e[2] !== n || e[3] !== t.id || e[4] !== i) {
|
|
3634
3715
|
let r;
|
|
@@ -3638,29 +3719,29 @@ function wo() {
|
|
|
3638
3719
|
} : {
|
|
3639
3720
|
...e,
|
|
3640
3721
|
key: `${t.id}-${Z(e.segment, e.segmentIndex)}-${e.segment.kind}`
|
|
3641
|
-
}, e[6] = t.id, e[7] = r), a =
|
|
3722
|
+
}, e[6] = t.id, e[7] = r), a = uo(i, n).map(r), e[2] = n, e[3] = t.id, e[4] = i, e[5] = a;
|
|
3642
3723
|
} else a = e[5];
|
|
3643
3724
|
return a;
|
|
3644
3725
|
}
|
|
3645
|
-
var
|
|
3646
|
-
function
|
|
3647
|
-
let e = l(
|
|
3726
|
+
var Io = o(null);
|
|
3727
|
+
function Lo() {
|
|
3728
|
+
let e = l(Io);
|
|
3648
3729
|
if (!e) throw Error("CompactTrajectory group parts must be rendered within CompactTrajectory.Group");
|
|
3649
3730
|
return e;
|
|
3650
3731
|
}
|
|
3651
|
-
function
|
|
3732
|
+
function Ro(e) {
|
|
3652
3733
|
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;
|
|
3653
3734
|
if (t[0] !== n.hasLaterText || t[1] !== n.items || t[2] !== i || t[3] !== o) {
|
|
3654
3735
|
let e;
|
|
3655
3736
|
t[7] === i ? e = t[8] : (e = (e) => {
|
|
3656
3737
|
let { segment: t } = e;
|
|
3657
|
-
return
|
|
3658
|
-
}, t[7] = i, t[8] = e), u = n.items.map(e), l =
|
|
3738
|
+
return bo(t, i);
|
|
3739
|
+
}, t[7] = i, t[8] = e), u = n.items.map(e), l = Eo({
|
|
3659
3740
|
items: n.items,
|
|
3660
3741
|
labels: u,
|
|
3661
3742
|
status: o,
|
|
3662
3743
|
hasLaterText: n.hasLaterText
|
|
3663
|
-
}), d =
|
|
3744
|
+
}), d = po({
|
|
3664
3745
|
groupStatus: l,
|
|
3665
3746
|
labelCount: u.length
|
|
3666
3747
|
}), t[0] = n.hasLaterText, t[1] = n.items, t[2] = i, t[3] = o, t[4] = l, t[5] = u, t[6] = d;
|
|
@@ -3681,16 +3762,16 @@ function Do(e) {
|
|
|
3681
3762
|
children: r
|
|
3682
3763
|
}), t[15] = r, t[16] = s, t[17] = m) : m = t[17];
|
|
3683
3764
|
let h;
|
|
3684
|
-
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(
|
|
3765
|
+
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(Io, {
|
|
3685
3766
|
value: p,
|
|
3686
3767
|
children: m
|
|
3687
3768
|
}), t[18] = p, t[19] = m, t[20] = h) : h = t[20], h;
|
|
3688
3769
|
}
|
|
3689
|
-
function
|
|
3770
|
+
function zo(e) {
|
|
3690
3771
|
let t = O(3), { children: n } = e, r;
|
|
3691
3772
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M("button", {
|
|
3692
3773
|
type: "button",
|
|
3693
|
-
className:
|
|
3774
|
+
className: ln("items-start")
|
|
3694
3775
|
}), t[0] = r) : r = t[0];
|
|
3695
3776
|
let i;
|
|
3696
3777
|
return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ M(L, {
|
|
@@ -3701,11 +3782,11 @@ function Oo(e) {
|
|
|
3701
3782
|
})
|
|
3702
3783
|
}), t[1] = n, t[2] = i), i;
|
|
3703
3784
|
}
|
|
3704
|
-
function
|
|
3705
|
-
let e = O(12), { items: t, labels: n, groupStatus: r, tone: i } =
|
|
3706
|
-
e[0] !== r || e[1] !== t || e[2] !== n ? (a =
|
|
3785
|
+
function Bo() {
|
|
3786
|
+
let e = O(12), { items: t, labels: n, groupStatus: r, tone: i } = Lo(), a;
|
|
3787
|
+
e[0] !== r || e[1] !== t || e[2] !== n ? (a = jo(n, r, No(t)), e[0] = r, e[1] = t, e[2] = n, e[3] = a) : a = e[3];
|
|
3707
3788
|
let o = a, s;
|
|
3708
|
-
e[4] !== r || e[5] !== n ? (s =
|
|
3789
|
+
e[4] !== r || e[5] !== n ? (s = Mo(n, r), e[4] = r, e[5] = n, e[6] = s) : s = e[6];
|
|
3709
3790
|
let c = s, l;
|
|
3710
3791
|
return e[7] !== c || e[8] !== r || e[9] !== o || e[10] !== i ? (l = {
|
|
3711
3792
|
title: o,
|
|
@@ -3714,8 +3795,8 @@ function ko() {
|
|
|
3714
3795
|
groupStatus: r
|
|
3715
3796
|
}, e[7] = c, e[8] = r, e[9] = o, e[10] = i, e[11] = l) : l = e[11], l;
|
|
3716
3797
|
}
|
|
3717
|
-
function
|
|
3718
|
-
let t = O(9), { title: n, suffix: r, children: i } = e, { title: a, tone: o, groupStatus: s } =
|
|
3798
|
+
function Vo(e) {
|
|
3799
|
+
let t = O(9), { title: n, suffix: r, children: i } = e, { title: a, tone: o, groupStatus: s } = Bo(), c = n ?? a, l = r ? `${c} · ${r}` : c, u = s === "running", d = s === "running" ? "text-info" : o.title, f;
|
|
3719
3800
|
t[0] === d ? f = t[1] : (f = k("max-w-full min-w-0 truncate", d), t[0] = d, t[1] = f);
|
|
3720
3801
|
let p;
|
|
3721
3802
|
t[2] !== u || t[3] !== f || t[4] !== l ? (p = /* @__PURE__ */ M(U, {
|
|
@@ -3730,12 +3811,12 @@ function Ao(e) {
|
|
|
3730
3811
|
children: [p, i]
|
|
3731
3812
|
}), t[6] = i, t[7] = p, t[8] = m) : m = t[8], m;
|
|
3732
3813
|
}
|
|
3733
|
-
function
|
|
3734
|
-
let e = O(2), { tone: t } =
|
|
3735
|
-
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(
|
|
3814
|
+
function Ho() {
|
|
3815
|
+
let e = O(2), { tone: t } = Lo(), n;
|
|
3816
|
+
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(cn, { className: t.chevron }), e[0] = t.chevron, e[1] = n), n;
|
|
3736
3817
|
}
|
|
3737
|
-
function
|
|
3738
|
-
let t = O(5), { detail: n } = e, { title: r, detail: i, tone: a } =
|
|
3818
|
+
function Uo(e) {
|
|
3819
|
+
let t = O(5), { detail: n } = e, { title: r, detail: i, tone: a } = Bo();
|
|
3739
3820
|
if (n === null) return null;
|
|
3740
3821
|
let o = n ?? i;
|
|
3741
3822
|
if (!o || o === r) return null;
|
|
@@ -3747,8 +3828,8 @@ function Mo(e) {
|
|
|
3747
3828
|
children: o
|
|
3748
3829
|
}), t[2] = o, t[3] = s, t[4] = c) : c = t[4], c;
|
|
3749
3830
|
}
|
|
3750
|
-
function
|
|
3751
|
-
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } =
|
|
3831
|
+
function Wo(e) {
|
|
3832
|
+
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } = Lo(), o = a === "running", s;
|
|
3752
3833
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
3753
3834
|
initial: "instant",
|
|
3754
3835
|
resize: "instant"
|
|
@@ -3772,11 +3853,11 @@ function No(e) {
|
|
|
3772
3853
|
children: h
|
|
3773
3854
|
}), t[10] = u, t[11] = f, t[12] = h, t[13] = g) : g = t[13], g;
|
|
3774
3855
|
}
|
|
3775
|
-
function
|
|
3856
|
+
function Go(e) {
|
|
3776
3857
|
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } = W(), { segment: o } = n;
|
|
3777
3858
|
if (o.kind === "text") {
|
|
3778
3859
|
let e;
|
|
3779
|
-
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(
|
|
3860
|
+
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(Ko), t[0] = o.parts, t[1] = e);
|
|
3780
3861
|
let n = e;
|
|
3781
3862
|
if (n.length === 0) return null;
|
|
3782
3863
|
let r;
|
|
@@ -3813,55 +3894,55 @@ function Po(e) {
|
|
|
3813
3894
|
}
|
|
3814
3895
|
return null;
|
|
3815
3896
|
}
|
|
3816
|
-
function
|
|
3897
|
+
function Ko(e) {
|
|
3817
3898
|
let { part: t } = e;
|
|
3818
|
-
return !
|
|
3819
|
-
}
|
|
3820
|
-
var
|
|
3821
|
-
Group:
|
|
3822
|
-
GroupTrigger:
|
|
3823
|
-
GroupTitle:
|
|
3824
|
-
GroupChevron:
|
|
3825
|
-
GroupDetail:
|
|
3826
|
-
GroupContent:
|
|
3827
|
-
Segment:
|
|
3899
|
+
return !Wi(t);
|
|
3900
|
+
}
|
|
3901
|
+
var qo = {
|
|
3902
|
+
Group: Ro,
|
|
3903
|
+
GroupTrigger: zo,
|
|
3904
|
+
GroupTitle: Vo,
|
|
3905
|
+
GroupChevron: Ho,
|
|
3906
|
+
GroupDetail: Uo,
|
|
3907
|
+
GroupContent: Wo,
|
|
3908
|
+
Segment: Go
|
|
3828
3909
|
};
|
|
3829
|
-
function
|
|
3910
|
+
function Jo() {
|
|
3830
3911
|
let e = O(1), t = G(), { messages: n } = W(), { debugMode: r } = z(), i = n[n.length - 1];
|
|
3831
|
-
if (t !== "ready" && t !== "error" &&
|
|
3912
|
+
if (t !== "ready" && t !== "error" && Po(i, r)) return null;
|
|
3832
3913
|
let a;
|
|
3833
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
3914
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(Da, {}), e[0] = a) : a = e[0], a;
|
|
3834
3915
|
}
|
|
3835
|
-
var
|
|
3836
|
-
Root:
|
|
3837
|
-
List:
|
|
3838
|
-
Item:
|
|
3839
|
-
UserBubble:
|
|
3916
|
+
var Yo = {
|
|
3917
|
+
Root: va,
|
|
3918
|
+
List: ya,
|
|
3919
|
+
Item: ba,
|
|
3920
|
+
UserBubble: oo,
|
|
3840
3921
|
AssistantContent: c(function(e) {
|
|
3841
|
-
let t = O(5), { className: n } = e, r =
|
|
3842
|
-
t[0] === r ? i = t[1] : (i = r.map(
|
|
3922
|
+
let t = O(5), { className: n } = e, r = Fo(), i;
|
|
3923
|
+
t[0] === r ? i = t[1] : (i = r.map(Xo), t[0] = r, t[1] = i);
|
|
3843
3924
|
let a;
|
|
3844
3925
|
return t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M("div", {
|
|
3845
3926
|
className: n,
|
|
3846
3927
|
children: i
|
|
3847
3928
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
3848
3929
|
}),
|
|
3849
|
-
Actions:
|
|
3850
|
-
CopyAction:
|
|
3851
|
-
RegenerateAction:
|
|
3852
|
-
CopyDebugJsonAction:
|
|
3853
|
-
Thinking:
|
|
3854
|
-
Error:
|
|
3930
|
+
Actions: fa,
|
|
3931
|
+
CopyAction: pa,
|
|
3932
|
+
RegenerateAction: ma,
|
|
3933
|
+
CopyDebugJsonAction: ha,
|
|
3934
|
+
Thinking: Jo,
|
|
3935
|
+
Error: _a
|
|
3855
3936
|
};
|
|
3856
|
-
function
|
|
3857
|
-
return e.kind === "group" ? /* @__PURE__ */ N(
|
|
3937
|
+
function Xo(e) {
|
|
3938
|
+
return e.kind === "group" ? /* @__PURE__ */ N(Ro, {
|
|
3858
3939
|
group: e,
|
|
3859
|
-
children: [/* @__PURE__ */ N(
|
|
3860
|
-
}, e.key) : /* @__PURE__ */ M(
|
|
3940
|
+
children: [/* @__PURE__ */ N(zo, { children: [/* @__PURE__ */ M(Vo, { children: /* @__PURE__ */ M(Ho, {}) }), /* @__PURE__ */ M(Uo, {})] }), /* @__PURE__ */ M(Wo, {})]
|
|
3941
|
+
}, e.key) : /* @__PURE__ */ M(Go, { item: e }, e.key);
|
|
3861
3942
|
}
|
|
3862
3943
|
//#endregion
|
|
3863
3944
|
//#region src/lib/chat/trajectory/trajectories/messages.tsx
|
|
3864
|
-
function
|
|
3945
|
+
function Zo(e) {
|
|
3865
3946
|
let t = O(8), { message: n, className: r } = e, i;
|
|
3866
3947
|
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);
|
|
3867
3948
|
let a;
|
|
@@ -3874,13 +3955,13 @@ function Bo(e) {
|
|
|
3874
3955
|
children: [a, o]
|
|
3875
3956
|
}), t[5] = i, t[6] = o, t[7] = s) : s = t[7], s;
|
|
3876
3957
|
}
|
|
3877
|
-
function
|
|
3958
|
+
function Qo(e) {
|
|
3878
3959
|
let t = O(15), { part: n } = e, r = z(), i, a;
|
|
3879
3960
|
if (t[0] !== r.registry || t[1] !== n) {
|
|
3880
3961
|
a = Symbol.for("react.early_return_sentinel");
|
|
3881
3962
|
bb0: {
|
|
3882
|
-
let { toolEntry: e } =
|
|
3883
|
-
if (e &&
|
|
3963
|
+
let { toolEntry: e } = gi(n, r.registry);
|
|
3964
|
+
if (e && _i(e, n.state)) {
|
|
3884
3965
|
let t = e.label?.(n);
|
|
3885
3966
|
if (!t) {
|
|
3886
3967
|
a = null;
|
|
@@ -3913,14 +3994,14 @@ function Vo(e) {
|
|
|
3913
3994
|
} else i = t[2], a = t[3];
|
|
3914
3995
|
if (a !== Symbol.for("react.early_return_sentinel")) return a;
|
|
3915
3996
|
let o = i, s;
|
|
3916
|
-
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(
|
|
3997
|
+
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(Bi, {
|
|
3917
3998
|
label: o,
|
|
3918
3999
|
part: n
|
|
3919
4000
|
}), t[4] = o, t[5] = n, t[6] = s) : s = t[6];
|
|
3920
4001
|
let c;
|
|
3921
|
-
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(
|
|
4002
|
+
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(Zo, { message: o.detail }), t[7] = o, t[8] = c);
|
|
3922
4003
|
let l;
|
|
3923
|
-
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(
|
|
4004
|
+
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(Ii, { part: n }), t[9] = n, t[10] = l);
|
|
3924
4005
|
let u;
|
|
3925
4006
|
return t[11] !== s || t[12] !== c || t[13] !== l ? (u = /* @__PURE__ */ N(j, { children: [
|
|
3926
4007
|
s,
|
|
@@ -3928,7 +4009,7 @@ function Vo(e) {
|
|
|
3928
4009
|
l
|
|
3929
4010
|
] }), t[11] = s, t[12] = c, t[13] = l, t[14] = u) : u = t[14], u;
|
|
3930
4011
|
}
|
|
3931
|
-
function
|
|
4012
|
+
function $o(e) {
|
|
3932
4013
|
let t = O(5), { part: n } = e, [r, i] = g(!1), a;
|
|
3933
4014
|
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(J, {
|
|
3934
4015
|
mode: "static",
|
|
@@ -3938,7 +4019,7 @@ function Ho(e) {
|
|
|
3938
4019
|
return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3939
4020
|
"data-copy-exclude": "assistant-snapshot",
|
|
3940
4021
|
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",
|
|
3941
|
-
children: /* @__PURE__ */ M(
|
|
4022
|
+
children: /* @__PURE__ */ M(Ka, {
|
|
3942
4023
|
label: "Reasoning",
|
|
3943
4024
|
open: r,
|
|
3944
4025
|
onOpenChange: i,
|
|
@@ -3949,45 +4030,46 @@ function Ho(e) {
|
|
|
3949
4030
|
})
|
|
3950
4031
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
3951
4032
|
}
|
|
3952
|
-
function
|
|
3953
|
-
let t = O(
|
|
4033
|
+
function es(e) {
|
|
4034
|
+
let t = O(16), { part: n } = e, { elements: r } = W(), i = Li();
|
|
3954
4035
|
if (n.type === "text") {
|
|
3955
|
-
if (
|
|
4036
|
+
if (Wi(n)) return null;
|
|
3956
4037
|
let e;
|
|
3957
|
-
return t[0] !== r || t[1] !== n.text ? (e = /* @__PURE__ */ M(
|
|
4038
|
+
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(Fi, {
|
|
3958
4039
|
text: n.text,
|
|
4040
|
+
citations: n.citations,
|
|
3959
4041
|
elements: r
|
|
3960
|
-
}), t[0] = r, t[1] = n.
|
|
4042
|
+
}), t[0] = r, t[1] = n.citations, t[2] = n.text, t[3] = e) : e = t[3], e;
|
|
3961
4043
|
}
|
|
3962
4044
|
if (n.type === "dynamic-tool") {
|
|
3963
4045
|
let e;
|
|
3964
|
-
return t[
|
|
4046
|
+
return t[4] !== i || t[5] !== n ? (e = i ? /* @__PURE__ */ M(ei, { part: n }) : null, t[4] = i, t[5] = n, t[6] = e) : e = t[6], e;
|
|
3965
4047
|
}
|
|
3966
4048
|
if (S(n)) {
|
|
3967
4049
|
let e;
|
|
3968
|
-
return t[
|
|
4050
|
+
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(Qo, { part: n }), t[7] = n, t[8] = e), e;
|
|
3969
4051
|
}
|
|
3970
4052
|
if (n.type === "reasoning" && n.text) {
|
|
3971
4053
|
let e;
|
|
3972
|
-
return t[
|
|
4054
|
+
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M($o, { part: n }) : null, t[9] = i, t[10] = n, t[11] = e) : e = t[11], e;
|
|
3973
4055
|
}
|
|
3974
4056
|
if (n.type === "file") {
|
|
3975
4057
|
let e;
|
|
3976
|
-
return t[
|
|
4058
|
+
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(ki, {
|
|
3977
4059
|
filename: n.filename,
|
|
3978
4060
|
mediaType: n.mediaType,
|
|
3979
4061
|
url: n.url
|
|
3980
|
-
}), t[
|
|
4062
|
+
}), t[12] = n.filename, t[13] = n.mediaType, t[14] = n.url, t[15] = e) : e = t[15], e;
|
|
3981
4063
|
}
|
|
3982
4064
|
return null;
|
|
3983
4065
|
}
|
|
3984
|
-
var
|
|
4066
|
+
var ts = c(function(e) {
|
|
3985
4067
|
let t = O(10), { className: n } = e, { message: r } = K(), i;
|
|
3986
4068
|
t[0] === n ? i = t[1] : (i = k("flex-1 space-y-3", n), t[0] = n, t[1] = i);
|
|
3987
4069
|
let a;
|
|
3988
4070
|
if (t[2] !== r.id || t[3] !== r.parts) {
|
|
3989
4071
|
let e;
|
|
3990
|
-
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(
|
|
4072
|
+
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(es, { 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;
|
|
3991
4073
|
} else a = t[4];
|
|
3992
4074
|
let o;
|
|
3993
4075
|
return t[7] !== i || t[8] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
@@ -3995,9 +4077,9 @@ var Wo = c(function(e) {
|
|
|
3995
4077
|
children: a
|
|
3996
4078
|
}), t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
3997
4079
|
});
|
|
3998
|
-
function
|
|
4080
|
+
function ns(e) {
|
|
3999
4081
|
let t = O(9), { className: n, label: r } = e, i;
|
|
4000
|
-
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(
|
|
4082
|
+
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(rs).pop() || "Thinking...", t[0] = r, t[1] = i);
|
|
4001
4083
|
let a = i, o;
|
|
4002
4084
|
t[2] === n ? o = t[3] : (o = k("flex items-start", n), t[2] = n, t[3] = o);
|
|
4003
4085
|
let s;
|
|
@@ -4012,33 +4094,33 @@ function Go(e) {
|
|
|
4012
4094
|
children: s
|
|
4013
4095
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4014
4096
|
}
|
|
4015
|
-
function
|
|
4097
|
+
function rs(e) {
|
|
4016
4098
|
return e.trim();
|
|
4017
4099
|
}
|
|
4018
|
-
function
|
|
4100
|
+
function is() {
|
|
4019
4101
|
let e = O(5), t = G(), { messages: n } = W(), r = n[n.length - 1], i;
|
|
4020
|
-
e[0] !== t || e[1] !== r ? (i =
|
|
4102
|
+
e[0] !== t || e[1] !== r ? (i = wa(t, r), e[0] = t, e[1] = r, e[2] = i) : i = e[2];
|
|
4021
4103
|
let a = i;
|
|
4022
4104
|
if (!a) return null;
|
|
4023
4105
|
let o;
|
|
4024
|
-
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(
|
|
4106
|
+
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(ns, {
|
|
4025
4107
|
label: a,
|
|
4026
4108
|
className: "mt-2"
|
|
4027
4109
|
}), e[3] = a, e[4] = o), o;
|
|
4028
4110
|
}
|
|
4029
|
-
var
|
|
4030
|
-
Root:
|
|
4031
|
-
List:
|
|
4032
|
-
Item:
|
|
4033
|
-
UserBubble:
|
|
4034
|
-
AssistantContent:
|
|
4035
|
-
Thinking:
|
|
4036
|
-
Error:
|
|
4037
|
-
Actions:
|
|
4038
|
-
CopyAction:
|
|
4039
|
-
RegenerateAction:
|
|
4040
|
-
CopyDebugJsonAction:
|
|
4041
|
-
},
|
|
4111
|
+
var as = {
|
|
4112
|
+
Root: va,
|
|
4113
|
+
List: ya,
|
|
4114
|
+
Item: ba,
|
|
4115
|
+
UserBubble: oo,
|
|
4116
|
+
AssistantContent: ts,
|
|
4117
|
+
Thinking: is,
|
|
4118
|
+
Error: _a,
|
|
4119
|
+
Actions: fa,
|
|
4120
|
+
CopyAction: pa,
|
|
4121
|
+
RegenerateAction: ma,
|
|
4122
|
+
CopyDebugJsonAction: ha
|
|
4123
|
+
}, os = {
|
|
4042
4124
|
braille: {
|
|
4043
4125
|
frames: [
|
|
4044
4126
|
"⠋",
|
|
@@ -4105,10 +4187,10 @@ var Jo = {
|
|
|
4105
4187
|
interval: 100
|
|
4106
4188
|
}
|
|
4107
4189
|
};
|
|
4108
|
-
function
|
|
4190
|
+
function ss(e) {
|
|
4109
4191
|
let t = O(15), n, r, i;
|
|
4110
4192
|
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);
|
|
4111
|
-
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } =
|
|
4193
|
+
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } = os[a], [l, u] = g(0), f, p;
|
|
4112
4194
|
t[4] !== o || t[5] !== s.length || t[6] !== c ? (f = () => {
|
|
4113
4195
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
4114
4196
|
let e = o.setInterval(() => {
|
|
@@ -4133,9 +4215,9 @@ function Xo(e) {
|
|
|
4133
4215
|
}
|
|
4134
4216
|
//#endregion
|
|
4135
4217
|
//#region src/lib/chat/trajectory/trajectories/timeline.tsx
|
|
4136
|
-
function
|
|
4218
|
+
function cs(e) {
|
|
4137
4219
|
let t = O(11), { Icon: n, isLast: r, isLoading: i, aborted: a, state: o, isError: s } = e, c;
|
|
4138
|
-
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(
|
|
4220
|
+
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(ss, { 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];
|
|
4139
4221
|
let l;
|
|
4140
4222
|
t[6] === r ? l = t[7] : (l = !r && /* @__PURE__ */ M("span", { className: "bg-border w-px flex-1" }), t[6] = r, t[7] = l);
|
|
4141
4223
|
let u;
|
|
@@ -4144,16 +4226,16 @@ function Zo(e) {
|
|
|
4144
4226
|
children: [c, l]
|
|
4145
4227
|
}), t[8] = c, t[9] = l, t[10] = u) : u = t[10], u;
|
|
4146
4228
|
}
|
|
4147
|
-
function
|
|
4148
|
-
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(
|
|
4149
|
-
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(
|
|
4229
|
+
function ls(e) {
|
|
4230
|
+
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(Zi), 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;
|
|
4231
|
+
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(cs, {
|
|
4150
4232
|
Icon: f,
|
|
4151
4233
|
isLast: n,
|
|
4152
4234
|
isLoading: p,
|
|
4153
4235
|
aborted: d,
|
|
4154
4236
|
state: u,
|
|
4155
4237
|
isError: c?.isError ?? !1
|
|
4156
|
-
}) : /* @__PURE__ */ M(
|
|
4238
|
+
}) : /* @__PURE__ */ M(Ta, { 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];
|
|
4157
4239
|
let h = m, g = n ? "" : "pb-3.5", _;
|
|
4158
4240
|
t[7] === g ? _ = t[8] : (_ = k("min-w-0 flex-1", g), t[7] = g, t[8] = _);
|
|
4159
4241
|
let v;
|
|
@@ -4162,16 +4244,16 @@ function Qo(e) {
|
|
|
4162
4244
|
children: o
|
|
4163
4245
|
}), t[9] = o, t[10] = _, t[11] = v) : v = t[11];
|
|
4164
4246
|
let y;
|
|
4165
|
-
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(
|
|
4247
|
+
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(Ea, {
|
|
4166
4248
|
marker: h,
|
|
4167
4249
|
children: v
|
|
4168
4250
|
}), t[12] = h, t[13] = v, t[14] = y) : y = t[14], y;
|
|
4169
4251
|
}
|
|
4170
|
-
function
|
|
4252
|
+
function us(e) {
|
|
4171
4253
|
let t = O(10), { label: n, state: r, part: i, defaultOpen: a, children: o } = e, s = a !== void 0 && a, c;
|
|
4172
4254
|
t[0] !== n || t[1] !== i || t[2] !== r ? (c = /* @__PURE__ */ M(L, {
|
|
4173
4255
|
className: "cursor-pointer",
|
|
4174
|
-
children: /* @__PURE__ */ M(
|
|
4256
|
+
children: /* @__PURE__ */ M(Hi, {
|
|
4175
4257
|
label: n,
|
|
4176
4258
|
state: r,
|
|
4177
4259
|
part: i
|
|
@@ -4186,17 +4268,17 @@ function $o(e) {
|
|
|
4186
4268
|
children: [c, l]
|
|
4187
4269
|
}), t[6] = s, t[7] = c, t[8] = l, t[9] = u) : u = t[9], u;
|
|
4188
4270
|
}
|
|
4189
|
-
var
|
|
4190
|
-
Item:
|
|
4191
|
-
Disclosure:
|
|
4192
|
-
},
|
|
4193
|
-
Root:
|
|
4194
|
-
List:
|
|
4195
|
-
Item:
|
|
4196
|
-
UserBubble:
|
|
4271
|
+
var ds = {
|
|
4272
|
+
Item: ls,
|
|
4273
|
+
Disclosure: us
|
|
4274
|
+
}, fs = {
|
|
4275
|
+
Root: va,
|
|
4276
|
+
List: ya,
|
|
4277
|
+
Item: ba,
|
|
4278
|
+
UserBubble: oo,
|
|
4197
4279
|
AssistantContent: c(function(e) {
|
|
4198
|
-
let t = O(12), { className: n } = e, { message: r } = K(), { elements: i } = W(), { debugMode: a } = z(), o =
|
|
4199
|
-
t[0] === r.parts ? c = t[1] : (c =
|
|
4280
|
+
let t = O(12), { className: n } = e, { message: r } = K(), { elements: i } = W(), { debugMode: a } = z(), o = Li(), s = Y(), c;
|
|
4281
|
+
t[0] === r.parts ? c = t[1] : (c = aa(r.parts), t[0] = r.parts, t[1] = c);
|
|
4200
4282
|
let l = c, u;
|
|
4201
4283
|
t[2] !== a || t[3] !== i || t[4] !== s || t[5] !== r.id || t[6] !== l || t[7] !== o ? (u = l.map((e, t) => {
|
|
4202
4284
|
let n = `${r.id}-${Z(e, t)}-${e.kind}`;
|
|
@@ -4209,33 +4291,33 @@ var es = {
|
|
|
4209
4291
|
if (e.kind === "source") return /* @__PURE__ */ M(X.Source, { segment: e }, n);
|
|
4210
4292
|
if (e.kind === "dynamic-tool") {
|
|
4211
4293
|
if (!o) return null;
|
|
4212
|
-
let r = !
|
|
4213
|
-
return /* @__PURE__ */ M(
|
|
4294
|
+
let r = !ia(l, t, !0);
|
|
4295
|
+
return /* @__PURE__ */ M(ds.Item, {
|
|
4214
4296
|
isLast: r,
|
|
4215
4297
|
children: /* @__PURE__ */ M(X.DynamicTool, { segment: e })
|
|
4216
4298
|
}, n);
|
|
4217
4299
|
}
|
|
4218
4300
|
if (e.kind === "reasoning") {
|
|
4219
4301
|
if (s || e.part.type !== "reasoning") return null;
|
|
4220
|
-
let r = !
|
|
4302
|
+
let r = !ia(l, t, a), i = {
|
|
4221
4303
|
name: "Reasoning",
|
|
4222
4304
|
icon: Je,
|
|
4223
4305
|
args: { text: [...e.part.text].slice(0, 60).join("") }
|
|
4224
4306
|
};
|
|
4225
|
-
return /* @__PURE__ */ M(
|
|
4307
|
+
return /* @__PURE__ */ M(ds.Item, {
|
|
4226
4308
|
isLast: r,
|
|
4227
4309
|
label: i,
|
|
4228
|
-
children: /* @__PURE__ */ M(
|
|
4310
|
+
children: /* @__PURE__ */ M(ds.Disclosure, {
|
|
4229
4311
|
label: i,
|
|
4230
4312
|
children: /* @__PURE__ */ M(X.Reasoning, { segment: e })
|
|
4231
4313
|
})
|
|
4232
4314
|
}, n);
|
|
4233
4315
|
}
|
|
4234
4316
|
if (e.kind === "tool") {
|
|
4235
|
-
let r = !
|
|
4317
|
+
let r = !ia(l, t, a);
|
|
4236
4318
|
return /* @__PURE__ */ M(X.Tool, {
|
|
4237
4319
|
segment: e,
|
|
4238
|
-
children: /* @__PURE__ */ M(
|
|
4320
|
+
children: /* @__PURE__ */ M(ds.Item, {
|
|
4239
4321
|
isLast: r,
|
|
4240
4322
|
children: /* @__PURE__ */ M(X.ToolDisclosure, {})
|
|
4241
4323
|
})
|
|
@@ -4249,16 +4331,16 @@ var es = {
|
|
|
4249
4331
|
children: u
|
|
4250
4332
|
}), t[9] = n, t[10] = u, t[11] = d) : d = t[11], d;
|
|
4251
4333
|
}),
|
|
4252
|
-
Actions:
|
|
4253
|
-
CopyAction:
|
|
4254
|
-
RegenerateAction:
|
|
4255
|
-
CopyDebugJsonAction:
|
|
4256
|
-
Thinking:
|
|
4257
|
-
Error:
|
|
4334
|
+
Actions: fa,
|
|
4335
|
+
CopyAction: pa,
|
|
4336
|
+
RegenerateAction: ma,
|
|
4337
|
+
CopyDebugJsonAction: ha,
|
|
4338
|
+
Thinking: Da,
|
|
4339
|
+
Error: _a
|
|
4258
4340
|
};
|
|
4259
4341
|
//#endregion
|
|
4260
4342
|
//#region src/lib/components/ChatComposer.tsx
|
|
4261
|
-
function
|
|
4343
|
+
function ps(e) {
|
|
4262
4344
|
let t = O(9), n, r;
|
|
4263
4345
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4264
4346
|
let { hasSubmitted: i } = V(), a;
|
|
@@ -4270,7 +4352,7 @@ function ns(e) {
|
|
|
4270
4352
|
...r
|
|
4271
4353
|
}), t[5] = i, t[6] = r, t[7] = a, t[8] = o) : o = t[8], o;
|
|
4272
4354
|
}
|
|
4273
|
-
function
|
|
4355
|
+
function ms(e) {
|
|
4274
4356
|
let t = O(8), n, r;
|
|
4275
4357
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4276
4358
|
let i;
|
|
@@ -4281,7 +4363,7 @@ function rs(e) {
|
|
|
4281
4363
|
...r
|
|
4282
4364
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4283
4365
|
}
|
|
4284
|
-
function
|
|
4366
|
+
function hs(e) {
|
|
4285
4367
|
let t = O(8), n, r;
|
|
4286
4368
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4287
4369
|
let i;
|
|
@@ -4292,7 +4374,7 @@ function is(e) {
|
|
|
4292
4374
|
...r
|
|
4293
4375
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4294
4376
|
}
|
|
4295
|
-
function
|
|
4377
|
+
function gs(e) {
|
|
4296
4378
|
let t = O(8), n, r;
|
|
4297
4379
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4298
4380
|
let i;
|
|
@@ -4303,7 +4385,7 @@ function as(e) {
|
|
|
4303
4385
|
...r
|
|
4304
4386
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4305
4387
|
}
|
|
4306
|
-
function
|
|
4388
|
+
function _s(e) {
|
|
4307
4389
|
let t = O(8), n, r;
|
|
4308
4390
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4309
4391
|
let i;
|
|
@@ -4314,7 +4396,7 @@ function os(e) {
|
|
|
4314
4396
|
...r
|
|
4315
4397
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4316
4398
|
}
|
|
4317
|
-
function
|
|
4399
|
+
function vs(e) {
|
|
4318
4400
|
let t = O(8), n, r;
|
|
4319
4401
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4320
4402
|
let i;
|
|
@@ -4325,7 +4407,7 @@ function ss(e) {
|
|
|
4325
4407
|
...r
|
|
4326
4408
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4327
4409
|
}
|
|
4328
|
-
function
|
|
4410
|
+
function ys(e) {
|
|
4329
4411
|
let t = O(3), n;
|
|
4330
4412
|
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];
|
|
4331
4413
|
let r;
|
|
@@ -4335,7 +4417,7 @@ function cs(e) {
|
|
|
4335
4417
|
...e
|
|
4336
4418
|
}), t[1] = e, t[2] = r), r;
|
|
4337
4419
|
}
|
|
4338
|
-
function
|
|
4420
|
+
function bs() {
|
|
4339
4421
|
let e = O(6), { actions: t, meta: n } = Tt("ChatComposer.CommandButton"), r;
|
|
4340
4422
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M(et, { className: "size-4" }), e[0] = r) : r = e[0];
|
|
4341
4423
|
let i = n.activePopup?.trigger === "/", a;
|
|
@@ -4351,7 +4433,7 @@ function ls() {
|
|
|
4351
4433
|
onClick: a
|
|
4352
4434
|
}), e[3] = i, e[4] = a, e[5] = o) : o = e[5], o;
|
|
4353
4435
|
}
|
|
4354
|
-
function
|
|
4436
|
+
function xs(e) {
|
|
4355
4437
|
switch (e) {
|
|
4356
4438
|
case "permission-denied": return "Allow microphone access to use dictation";
|
|
4357
4439
|
case "no-microphone": return "Connect a microphone to use dictation";
|
|
@@ -4360,17 +4442,17 @@ function us(e) {
|
|
|
4360
4442
|
case "transcription-failed": return "Unable to transcribe audio";
|
|
4361
4443
|
}
|
|
4362
4444
|
}
|
|
4363
|
-
function
|
|
4445
|
+
function Ss(e) {
|
|
4364
4446
|
switch (e.status) {
|
|
4365
4447
|
case "unavailable": return e.reason === "blocked" ? "Allow microphone access in your browser settings to use dictation" : "Dictation is not available in this browser";
|
|
4366
4448
|
case "idle": return "Start dictation";
|
|
4367
4449
|
case "starting": return "Starting dictation";
|
|
4368
4450
|
case "recording": return "Stop dictation";
|
|
4369
4451
|
case "finishing": return "Transcribing…";
|
|
4370
|
-
case "failed": return
|
|
4452
|
+
case "failed": return xs(e.error.code);
|
|
4371
4453
|
}
|
|
4372
4454
|
}
|
|
4373
|
-
function
|
|
4455
|
+
function Cs(e) {
|
|
4374
4456
|
switch (e.status) {
|
|
4375
4457
|
case "recording": return /* @__PURE__ */ M(nt, { className: "size-4 fill-current" });
|
|
4376
4458
|
case "starting":
|
|
@@ -4380,11 +4462,11 @@ function fs(e) {
|
|
|
4380
4462
|
case "failed": return /* @__PURE__ */ M(Qe, { className: "size-4" });
|
|
4381
4463
|
}
|
|
4382
4464
|
}
|
|
4383
|
-
function
|
|
4465
|
+
function ws() {
|
|
4384
4466
|
let e = O(20), { status: t } = B(), { state: n } = Et("ChatComposer.Dictate"), r;
|
|
4385
|
-
e[0] === n ? r = e[1] : (r =
|
|
4467
|
+
e[0] === n ? r = e[1] : (r = Ss(n), e[0] = n, e[1] = r);
|
|
4386
4468
|
let i = r, a = n.status === "starting" || n.status === "recording" || n.status === "finishing", o = t === "streaming" || t === "submitted", s;
|
|
4387
|
-
e[2] === n ? s = e[3] : (s =
|
|
4469
|
+
e[2] === n ? s = e[3] : (s = Cs(n), e[2] = n, e[3] = s);
|
|
4388
4470
|
let c;
|
|
4389
4471
|
e[4] !== i || e[5] !== s ? (c = /* @__PURE__ */ M(Q, {
|
|
4390
4472
|
icon: s,
|
|
@@ -4414,22 +4496,22 @@ function ps() {
|
|
|
4414
4496
|
d
|
|
4415
4497
|
] }), e[16] = l, e[17] = u, e[18] = d, e[19] = f) : f = e[19], f;
|
|
4416
4498
|
}
|
|
4417
|
-
var
|
|
4418
|
-
Provider:
|
|
4419
|
-
Root:
|
|
4499
|
+
var Ts = {
|
|
4500
|
+
Provider: ps,
|
|
4501
|
+
Root: ms,
|
|
4420
4502
|
Popup: R.Popup,
|
|
4421
|
-
Content:
|
|
4422
|
-
Attachments:
|
|
4423
|
-
Editor:
|
|
4503
|
+
Content: hs,
|
|
4504
|
+
Attachments: _s,
|
|
4505
|
+
Editor: gs,
|
|
4424
4506
|
Error: R.Error,
|
|
4425
|
-
Toolbar:
|
|
4426
|
-
CommandButton:
|
|
4427
|
-
AttachFiles:
|
|
4428
|
-
Dictate:
|
|
4507
|
+
Toolbar: vs,
|
|
4508
|
+
CommandButton: bs,
|
|
4509
|
+
AttachFiles: ys,
|
|
4510
|
+
Dictate: ws
|
|
4429
4511
|
};
|
|
4430
4512
|
//#endregion
|
|
4431
4513
|
//#region src/lib/components/ChatTextarea.tsx
|
|
4432
|
-
function
|
|
4514
|
+
function Es(e) {
|
|
4433
4515
|
let t = O(10), n, r, i;
|
|
4434
4516
|
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);
|
|
4435
4517
|
let a;
|
|
@@ -4446,7 +4528,7 @@ function hs(e) {
|
|
|
4446
4528
|
}
|
|
4447
4529
|
//#endregion
|
|
4448
4530
|
//#region src/lib/components/queue.tsx
|
|
4449
|
-
function
|
|
4531
|
+
function Ds(e) {
|
|
4450
4532
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4451
4533
|
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);
|
|
4452
4534
|
let a;
|
|
@@ -4455,7 +4537,7 @@ function gs(e) {
|
|
|
4455
4537
|
children: n
|
|
4456
4538
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4457
4539
|
}
|
|
4458
|
-
function
|
|
4540
|
+
function Os(e) {
|
|
4459
4541
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4460
4542
|
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);
|
|
4461
4543
|
let a;
|
|
@@ -4464,13 +4546,13 @@ function _s(e) {
|
|
|
4464
4546
|
children: n
|
|
4465
4547
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4466
4548
|
}
|
|
4467
|
-
function
|
|
4549
|
+
function ks(e) {
|
|
4468
4550
|
let t = O(4), { className: n } = e, r;
|
|
4469
4551
|
t[0] === n ? r = t[1] : (r = k("text-muted-foreground size-3.5 shrink-0", n), t[0] = n, t[1] = r);
|
|
4470
4552
|
let i;
|
|
4471
4553
|
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(Ye, { className: r }), t[2] = r, t[3] = i), i;
|
|
4472
4554
|
}
|
|
4473
|
-
function
|
|
4555
|
+
function As(e) {
|
|
4474
4556
|
let t = O(7), { children: n, className: r } = e, i;
|
|
4475
4557
|
t[0] === r ? i = t[1] : (i = k("min-w-0 flex-1 truncate text-sm", r), t[0] = r, t[1] = i);
|
|
4476
4558
|
let a;
|
|
@@ -4481,7 +4563,7 @@ function ys(e) {
|
|
|
4481
4563
|
children: a
|
|
4482
4564
|
}), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
|
|
4483
4565
|
}
|
|
4484
|
-
function
|
|
4566
|
+
function js(e) {
|
|
4485
4567
|
let t = O(6), { onClick: n, className: r } = e, i;
|
|
4486
4568
|
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);
|
|
4487
4569
|
let a;
|
|
@@ -4495,13 +4577,13 @@ function bs(e) {
|
|
|
4495
4577
|
children: a
|
|
4496
4578
|
}), t[3] = n, t[4] = i, t[5] = o) : o = t[5], o;
|
|
4497
4579
|
}
|
|
4498
|
-
var
|
|
4499
|
-
Root:
|
|
4500
|
-
Item:
|
|
4501
|
-
Icon:
|
|
4502
|
-
Text:
|
|
4503
|
-
Remove:
|
|
4504
|
-
},
|
|
4580
|
+
var Ms = {
|
|
4581
|
+
Root: Ds,
|
|
4582
|
+
Item: Os,
|
|
4583
|
+
Icon: ks,
|
|
4584
|
+
Text: As,
|
|
4585
|
+
Remove: js
|
|
4586
|
+
}, Ns = {
|
|
4505
4587
|
normal: {
|
|
4506
4588
|
d: "m5 12 7-7 7 7",
|
|
4507
4589
|
translateY: 0
|
|
@@ -4515,7 +4597,7 @@ var xs = {
|
|
|
4515
4597
|
],
|
|
4516
4598
|
transition: { duration: .4 }
|
|
4517
4599
|
}
|
|
4518
|
-
},
|
|
4600
|
+
}, Ps = {
|
|
4519
4601
|
normal: { d: "M12 19V5" },
|
|
4520
4602
|
animate: {
|
|
4521
4603
|
d: [
|
|
@@ -4525,7 +4607,7 @@ var xs = {
|
|
|
4525
4607
|
],
|
|
4526
4608
|
transition: { duration: .4 }
|
|
4527
4609
|
}
|
|
4528
|
-
},
|
|
4610
|
+
}, Fs = (e) => {
|
|
4529
4611
|
let t = O(30), n, r, i, a, o, s;
|
|
4530
4612
|
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);
|
|
4531
4613
|
let c = s === void 0 ? 20 : s, l = ne(), u = h(!1), d;
|
|
@@ -4547,11 +4629,11 @@ var xs = {
|
|
|
4547
4629
|
t[17] === l ? (y = t[18], b = t[19]) : (y = /* @__PURE__ */ M(A.path, {
|
|
4548
4630
|
animate: l,
|
|
4549
4631
|
d: "m5 12 7-7 7 7",
|
|
4550
|
-
variants:
|
|
4632
|
+
variants: Ns
|
|
4551
4633
|
}), b = /* @__PURE__ */ M(A.path, {
|
|
4552
4634
|
animate: l,
|
|
4553
4635
|
d: "M12 19V5",
|
|
4554
|
-
variants:
|
|
4636
|
+
variants: Ps
|
|
4555
4637
|
}), t[17] = l, t[18] = y, t[19] = b);
|
|
4556
4638
|
let x;
|
|
4557
4639
|
t[20] !== c || t[21] !== y || t[22] !== b ? (x = /* @__PURE__ */ N("svg", {
|
|
@@ -4575,10 +4657,10 @@ var xs = {
|
|
|
4575
4657
|
children: x
|
|
4576
4658
|
}), t[24] = m, t[25] = _, t[26] = a, t[27] = v, t[28] = x, t[29] = S) : S = t[29], S;
|
|
4577
4659
|
};
|
|
4578
|
-
|
|
4660
|
+
Fs.displayName = "ArrowUpIcon";
|
|
4579
4661
|
//#endregion
|
|
4580
4662
|
//#region src/lib/components/SubmitButton.tsx
|
|
4581
|
-
var
|
|
4663
|
+
var Is = {
|
|
4582
4664
|
duration: .15,
|
|
4583
4665
|
ease: [
|
|
4584
4666
|
0,
|
|
@@ -4586,7 +4668,7 @@ var Ts = {
|
|
|
4586
4668
|
.2,
|
|
4587
4669
|
1
|
|
4588
4670
|
]
|
|
4589
|
-
},
|
|
4671
|
+
}, Ls = {
|
|
4590
4672
|
duration: .12,
|
|
4591
4673
|
ease: [
|
|
4592
4674
|
0,
|
|
@@ -4595,7 +4677,7 @@ var Ts = {
|
|
|
4595
4677
|
1
|
|
4596
4678
|
]
|
|
4597
4679
|
};
|
|
4598
|
-
function
|
|
4680
|
+
function Rs(e) {
|
|
4599
4681
|
let t = O(40), n, r, i, a;
|
|
4600
4682
|
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);
|
|
4601
4683
|
let o = re(), s = a === "stop", c;
|
|
@@ -4635,7 +4717,7 @@ function Ds(e) {
|
|
|
4635
4717
|
scale: .7
|
|
4636
4718
|
}, t[21] = o, t[22] = v);
|
|
4637
4719
|
let y;
|
|
4638
|
-
t[23] === s ? y = t[24] : (y = M(s ?
|
|
4720
|
+
t[23] === s ? y = t[24] : (y = M(s ? Vs : Bs, {}), t[23] = s, t[24] = y);
|
|
4639
4721
|
let b;
|
|
4640
4722
|
t[25] !== v || t[26] !== y || t[27] !== h || t[28] !== g ? (b = /* @__PURE__ */ M(te, {
|
|
4641
4723
|
initial: !1,
|
|
@@ -4643,7 +4725,7 @@ function Ds(e) {
|
|
|
4643
4725
|
initial: g,
|
|
4644
4726
|
animate: _,
|
|
4645
4727
|
exit: v,
|
|
4646
|
-
transition:
|
|
4728
|
+
transition: Ls,
|
|
4647
4729
|
className: "absolute flex items-center justify-center",
|
|
4648
4730
|
children: y
|
|
4649
4731
|
}, h)
|
|
@@ -4653,7 +4735,7 @@ function Ds(e) {
|
|
|
4653
4735
|
initial: c,
|
|
4654
4736
|
animate: l,
|
|
4655
4737
|
exit: u,
|
|
4656
|
-
transition:
|
|
4738
|
+
transition: Is,
|
|
4657
4739
|
whileHover: d,
|
|
4658
4740
|
whileTap: f,
|
|
4659
4741
|
"aria-label": p,
|
|
@@ -4663,7 +4745,7 @@ function Ds(e) {
|
|
|
4663
4745
|
children: b
|
|
4664
4746
|
}), 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;
|
|
4665
4747
|
}
|
|
4666
|
-
function
|
|
4748
|
+
function zs(e) {
|
|
4667
4749
|
let t = O(2), { children: n } = e, r;
|
|
4668
4750
|
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M("svg", {
|
|
4669
4751
|
width: "20",
|
|
@@ -4674,13 +4756,13 @@ function Os(e) {
|
|
|
4674
4756
|
children: n
|
|
4675
4757
|
}), t[0] = n, t[1] = r), r;
|
|
4676
4758
|
}
|
|
4677
|
-
function
|
|
4759
|
+
function Bs() {
|
|
4678
4760
|
let e = O(1), t;
|
|
4679
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4761
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Fs, {}), e[0] = t) : t = e[0], t;
|
|
4680
4762
|
}
|
|
4681
|
-
function
|
|
4763
|
+
function Vs() {
|
|
4682
4764
|
let e = O(1), t;
|
|
4683
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4765
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(zs, { children: /* @__PURE__ */ M("rect", {
|
|
4684
4766
|
x: "5",
|
|
4685
4767
|
y: "5",
|
|
4686
4768
|
width: "10",
|
|
@@ -4690,9 +4772,9 @@ function As() {
|
|
|
4690
4772
|
}
|
|
4691
4773
|
//#endregion
|
|
4692
4774
|
//#region src/lib/components/tool-error.tsx
|
|
4693
|
-
function
|
|
4775
|
+
function Hs(e) {
|
|
4694
4776
|
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 = H(), u;
|
|
4695
|
-
t[0] === o.issues ? u = t[1] : (u = o.issues.map(
|
|
4777
|
+
t[0] === o.issues ? u = t[1] : (u = o.issues.map(Us).join("\n"), t[0] = o.issues, t[1] = u);
|
|
4696
4778
|
let d = u, f;
|
|
4697
4779
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(Fe, { className: "size-5" }), t[2] = f) : f = t[2];
|
|
4698
4780
|
let p;
|
|
@@ -4760,71 +4842,71 @@ function js(e) {
|
|
|
4760
4842
|
]
|
|
4761
4843
|
}), t[21] = v, t[22] = S, t[23] = p, t[24] = C) : C = t[24], C;
|
|
4762
4844
|
}
|
|
4763
|
-
function
|
|
4845
|
+
function Us(e) {
|
|
4764
4846
|
return `${e.path.join(".")}: ${e.message}`;
|
|
4765
4847
|
}
|
|
4766
4848
|
//#endregion
|
|
4767
4849
|
//#region src/lib/components/Tip/TipProvider.tsx
|
|
4768
|
-
var
|
|
4769
|
-
function
|
|
4770
|
-
return l(
|
|
4850
|
+
var Ws = o("");
|
|
4851
|
+
function Gs() {
|
|
4852
|
+
return l(Ws);
|
|
4771
4853
|
}
|
|
4772
|
-
var
|
|
4773
|
-
function
|
|
4854
|
+
var Ks = "tips:history", qs = "tips:session";
|
|
4855
|
+
function Js() {
|
|
4774
4856
|
try {
|
|
4775
|
-
return JSON.parse(localStorage.getItem(
|
|
4857
|
+
return JSON.parse(localStorage.getItem(Ks) ?? "{}");
|
|
4776
4858
|
} catch (e) {
|
|
4777
|
-
if (
|
|
4859
|
+
if (Zs(e)) return {};
|
|
4778
4860
|
throw e;
|
|
4779
4861
|
}
|
|
4780
4862
|
}
|
|
4781
|
-
function
|
|
4863
|
+
function Ys(e, t) {
|
|
4782
4864
|
try {
|
|
4783
|
-
let n =
|
|
4784
|
-
n[e] = t, localStorage.setItem(
|
|
4865
|
+
let n = Js();
|
|
4866
|
+
n[e] = t, localStorage.setItem(Ks, JSON.stringify(n));
|
|
4785
4867
|
} catch (e) {
|
|
4786
|
-
if (!
|
|
4868
|
+
if (!Zs(e)) throw e;
|
|
4787
4869
|
}
|
|
4788
4870
|
}
|
|
4789
|
-
function
|
|
4871
|
+
function Xs(e) {
|
|
4790
4872
|
try {
|
|
4791
|
-
let t = localStorage.getItem(
|
|
4873
|
+
let t = localStorage.getItem(qs), n = t ? JSON.parse(t) : {
|
|
4792
4874
|
id: "",
|
|
4793
4875
|
n: 0
|
|
4794
4876
|
};
|
|
4795
|
-
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(
|
|
4877
|
+
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(qs, JSON.stringify(n))), n.n;
|
|
4796
4878
|
} catch (e) {
|
|
4797
|
-
if (
|
|
4879
|
+
if (Zs(e)) return 0;
|
|
4798
4880
|
throw e;
|
|
4799
4881
|
}
|
|
4800
4882
|
}
|
|
4801
|
-
function
|
|
4883
|
+
function Zs(e) {
|
|
4802
4884
|
return e instanceof SyntaxError || e instanceof DOMException && (e.name === "QuotaExceededError" || e.name === "SecurityError");
|
|
4803
4885
|
}
|
|
4804
|
-
function
|
|
4886
|
+
function Qs(e, t, n) {
|
|
4805
4887
|
let r = n[e];
|
|
4806
4888
|
return r == null ? Infinity : t - r;
|
|
4807
4889
|
}
|
|
4808
|
-
async function
|
|
4809
|
-
let r =
|
|
4890
|
+
async function $s(e, t, n) {
|
|
4891
|
+
let r = Js(), i = await Promise.all(e.map((e) => e.isRelevant(t))), a = e.filter((e, t) => i[t]);
|
|
4810
4892
|
if (a.length === 0) return null;
|
|
4811
|
-
let o = a.filter((e) =>
|
|
4812
|
-
s.sort((e, t) =>
|
|
4893
|
+
let o = a.filter((e) => Qs(e.id, n, r) >= e.cooldownSessions), s = o.length > 0 ? o : a;
|
|
4894
|
+
s.sort((e, t) => Qs(t.id, n, r) - Qs(e.id, n, r));
|
|
4813
4895
|
let c = s[0], l = await c.content(t);
|
|
4814
4896
|
return {
|
|
4815
4897
|
id: c.id,
|
|
4816
4898
|
text: l
|
|
4817
4899
|
};
|
|
4818
4900
|
}
|
|
4819
|
-
function
|
|
4901
|
+
function ec(e) {
|
|
4820
4902
|
let t = O(13), { tips: n, streaming: r, chatId: i, context: a, children: o } = e, s;
|
|
4821
|
-
t[0] === i ? s = t[1] : (s = () =>
|
|
4903
|
+
t[0] === i ? s = t[1] : (s = () => Xs(i), t[0] = i, t[1] = s);
|
|
4822
4904
|
let [c] = g(s), [l, u] = g(""), [p, m] = g(r), [_, v] = g(0);
|
|
4823
|
-
r !== p && (m(r), r && v(
|
|
4905
|
+
r !== p && (m(r), r && v(tc));
|
|
4824
4906
|
let y = h(!1), b;
|
|
4825
4907
|
t[2] !== a || t[3] !== c || t[4] !== n ? (b = () => {
|
|
4826
|
-
y.current || (y.current = !0,
|
|
4827
|
-
e && (u(e.text),
|
|
4908
|
+
y.current || (y.current = !0, $s(n, a, c).then((e) => {
|
|
4909
|
+
e && (u(e.text), Ys(e.id, c));
|
|
4828
4910
|
}).finally(() => {
|
|
4829
4911
|
y.current = !1;
|
|
4830
4912
|
}));
|
|
@@ -4836,17 +4918,17 @@ function Us(e) {
|
|
|
4836
4918
|
let C;
|
|
4837
4919
|
t[8] === _ ? C = t[9] : (C = [_], t[8] = _, t[9] = C), d(S, C);
|
|
4838
4920
|
let w;
|
|
4839
|
-
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(
|
|
4921
|
+
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(Ws, {
|
|
4840
4922
|
value: l,
|
|
4841
4923
|
children: o
|
|
4842
4924
|
}), t[10] = o, t[11] = l, t[12] = w) : w = t[12], w;
|
|
4843
4925
|
}
|
|
4844
|
-
function
|
|
4926
|
+
function tc(e) {
|
|
4845
4927
|
return e + 1;
|
|
4846
4928
|
}
|
|
4847
|
-
function
|
|
4929
|
+
function nc(e) {
|
|
4848
4930
|
let t = O(6), { tips: n, context: r, children: i } = e, { chatId: a } = z(), { status: o } = B(), s = o === "streaming" || o === "submitted", c = a ?? "", l;
|
|
4849
|
-
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(
|
|
4931
|
+
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(ec, {
|
|
4850
4932
|
tips: n,
|
|
4851
4933
|
streaming: s,
|
|
4852
4934
|
chatId: c,
|
|
@@ -4856,14 +4938,14 @@ function Gs(e) {
|
|
|
4856
4938
|
}
|
|
4857
4939
|
//#endregion
|
|
4858
4940
|
//#region src/lib/components/Tip/TipLine.tsx
|
|
4859
|
-
var
|
|
4860
|
-
function
|
|
4861
|
-
let t = O(13), { className: n } = e, r = St(), i =
|
|
4941
|
+
var rc = 1.5;
|
|
4942
|
+
function ic(e) {
|
|
4943
|
+
let t = O(13), { className: n } = e, r = St(), i = Gs(), [a, o] = g(i), [s, c] = g(!1);
|
|
4862
4944
|
i !== a && (o(i), i && c(!0));
|
|
4863
4945
|
let l, u;
|
|
4864
4946
|
t[0] !== r || t[1] !== s ? (l = () => {
|
|
4865
4947
|
if (!s) return;
|
|
4866
|
-
let e = r.setTimeout(() => c(!1),
|
|
4948
|
+
let e = r.setTimeout(() => c(!1), rc * 1e3);
|
|
4867
4949
|
return () => r.clearTimeout(e);
|
|
4868
4950
|
}, u = [r, s], t[0] = r, t[1] = s, t[2] = l, t[3] = u) : (l = t[2], u = t[3]), d(l, u);
|
|
4869
4951
|
let f;
|
|
@@ -4874,7 +4956,7 @@ function qs(e) {
|
|
|
4874
4956
|
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(U, {
|
|
4875
4957
|
as: "span",
|
|
4876
4958
|
enabled: s,
|
|
4877
|
-
duration:
|
|
4959
|
+
duration: rc,
|
|
4878
4960
|
children: ["Tip: ", i]
|
|
4879
4961
|
}), t[7] = s, t[8] = i, t[9] = m) : m = t[9];
|
|
4880
4962
|
let h;
|
|
@@ -4885,7 +4967,7 @@ function qs(e) {
|
|
|
4885
4967
|
}
|
|
4886
4968
|
//#endregion
|
|
4887
4969
|
//#region src/lib/hooks/use-async-generator.ts
|
|
4888
|
-
function
|
|
4970
|
+
function ac() {
|
|
4889
4971
|
let [e, t] = g({
|
|
4890
4972
|
loading: !1,
|
|
4891
4973
|
error: null
|
|
@@ -4915,7 +4997,7 @@ function Js() {
|
|
|
4915
4997
|
}
|
|
4916
4998
|
//#endregion
|
|
4917
4999
|
//#region src/lib/hooks/use-auto-resize-textarea.ts
|
|
4918
|
-
function
|
|
5000
|
+
function oc(e) {
|
|
4919
5001
|
let t = O(16), { minHeight: n, maxHeight: r, value: i } = e, a = h(null), o;
|
|
4920
5002
|
t[0] !== r || t[1] !== n ? (o = (e) => {
|
|
4921
5003
|
let t = a.current;
|
|
@@ -4952,22 +5034,22 @@ function Ys(e) {
|
|
|
4952
5034
|
}
|
|
4953
5035
|
//#endregion
|
|
4954
5036
|
//#region src/lib/hooks/use-keyboard.ts
|
|
4955
|
-
function
|
|
5037
|
+
function sc(e) {
|
|
4956
5038
|
let t = [];
|
|
4957
5039
|
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("+");
|
|
4958
5040
|
}
|
|
4959
|
-
function
|
|
5041
|
+
function cc(e) {
|
|
4960
5042
|
let t = O(4), { enabled: n, handlers: r } = e, i = n === void 0 || n, a, o;
|
|
4961
5043
|
t[0] !== i || t[1] !== r ? (a = () => {
|
|
4962
5044
|
if (!i) return;
|
|
4963
5045
|
let e = (e) => {
|
|
4964
|
-
let t =
|
|
5046
|
+
let t = sc(e), n = r[t];
|
|
4965
5047
|
n ||= r[e.key], n && (e.preventDefault(), e.stopPropagation(), n(e));
|
|
4966
5048
|
};
|
|
4967
5049
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
4968
5050
|
}, o = [i, r], t[0] = i, t[1] = r, t[2] = a, t[3] = o) : (a = t[2], o = t[3]), d(a, o);
|
|
4969
5051
|
}
|
|
4970
5052
|
//#endregion
|
|
4971
|
-
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea,
|
|
5053
|
+
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea, pi as AssistantSnapshot, ti as COPY_EXCLUSION_ATTRIBUTE, ni as COPY_EXCLUSION_MODES, Q as ChatActionButton, zt as ChatBot, Ts as ChatComposer, Ft as ChatManager, Es as ChatTextarea, Zn as CitationPill, Ur as CodeBlock, Wr as CodeBlockCopyButton, Yo as CompactMessages, qo as CompactTrajectory, pa as CopyAction, ha as CopyDebugJsonAction, Jn as IndexProgress, Ci as InteractiveResponse, Xn as MessageItemContext, qa as MessageMetadata, Ms as MessageQueue, as as Messages, fa as MessagesActions, Yn as MessagesContext, _a as MessagesError, ba as MessagesItem, ya as MessagesList, va as MessagesRoot, oo as MessagesUserBubble, ua as NestedTrajectory, Ca as PendingToolInput, nn as ReadOnlyChatTransport, ma as RegenerateAction, J as Response, X as Segment, li as SnapshotRenderPortal, Rs as SubmitButton, U as TextShimmer, fs as TimelinedMessages, ic as TipLine, ec as TipProvider, Ws as TipValueContext, nc as Tips, Vi as ToolArg, Hs as ToolError, ao as UserMessageContent, Ba as ZukhrufChatTransport, tn as citationIndexOf, Nt as clearPrefill, oe as defineElements, fi as extractAssistantRawText, en as extractSourcesFromMessages, La as formatUsageBreakdown, Ia as formatUsageValue, pn as getIndexProgressEvents, Z as getSegmentKey, ii as hasCopyExclusion, _i as isActiveClientInputTool, Wi as isCommentaryTextPart, mi as isSubagentPart, an as isToolAborted, rn as isToolStateAborted, ja as parseMetadataUsage, Aa as parseUsage, Pt as persistedPromptOf, jt as readPrefill, oi as resolveCopyToClipboardStrategy, gi as resolveToolEntry, sn as serializeToolsRegistry, ai as shouldIncludeInCopyImage, hi as subagentDisplayName, $t as urlCitationsOf, xa as useActivePendingToolInput, z as useAgent, Lt as useAgentChatSetup, H as useAgentMessages, V as useAgentMeta, B as useAgentStatus, ac as useAsyncGenerator, oc as useAutoResizeTextarea, Qt as useChatManager, Lo as useCompactGroup, di as useCopyElementAsImage, Y as useIsAssistantSnapshotRender, on as useIsToolAborted, cc as useKeyboard, K as useMessageItem, W as useMessagesContext, G as useMessagesStatus, Fa as useNormalizedUsageTracking, Gs as useTipValue, Qi as useToolSegment, Fo as useTrajectoryItems, ci as waitForNextPaint, Mt as writePrefill };
|
|
4972
5054
|
|
|
4973
5055
|
//# sourceMappingURL=index.js.map
|