@deepagents/react-genai 7.47.1 → 7.49.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.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1045 -963
- package/dist/index.js.map +1 -1
- package/dist/lib/chat/trajectory/trajectories/compact-messages.d.ts +2 -1
- package/dist/lib/chat/trajectory/trajectories/compact-messages.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/trajectories/message-actions.d.ts.map +1 -1
- package/dist/lib/components/CitationPill.d.ts +1 -6
- package/dist/lib/components/CitationPill.d.ts.map +1 -1
- package/dist/lib/i18n/index.d.ts +3 -0
- package/dist/lib/i18n/index.d.ts.map +1 -0
- package/dist/lib/i18n/messages.d.ts +42 -0
- package/dist/lib/i18n/messages.d.ts.map +1 -0
- package/dist/lib/i18n/provider.d.ts +14 -0
- package/dist/lib/i18n/provider.d.ts.map +1 -0
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -186,7 +186,7 @@ function zt(e) {
|
|
|
186
186
|
function Bt(e) {
|
|
187
187
|
let t = O(13), n;
|
|
188
188
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = { initial: "smooth" }, t[0] = n) : n = t[0];
|
|
189
|
-
let { scrollRef: r, contentRef: i } = ie(n), { hasSubmitted: a } =
|
|
189
|
+
let { scrollRef: r, contentRef: i } = ie(n), { hasSubmitted: a } = Qt(), o;
|
|
190
190
|
t[1] === e.className ? o = t[2] : (o = k("@container mx-auto h-full w-full overflow-y-auto", e.className), t[1] = e.className, t[2] = o);
|
|
191
191
|
let s = a ? "min-h-full" : "h-full justify-center", c;
|
|
192
192
|
t[3] === s ? c = t[4] : (c = k("relative mx-auto flex w-full flex-col", s), t[3] = s, t[4] = c);
|
|
@@ -207,7 +207,7 @@ function Bt(e) {
|
|
|
207
207
|
}), t[9] = r, t[10] = o, t[11] = l, t[12] = u) : u = t[12], u;
|
|
208
208
|
}
|
|
209
209
|
function Vt(e) {
|
|
210
|
-
let t = O(12), { hasSubmitted: n } =
|
|
210
|
+
let t = O(12), { hasSubmitted: n } = Qt(), r;
|
|
211
211
|
t[0] !== n || t[1] !== e.className ? (r = k(n ? k("bg-background sticky top-0 z-10 shrink-0 space-y-1 backdrop-blur-md", e.className) : "relative flex justify-center py-4"), t[0] = n, t[1] = e.className, t[2] = r) : r = t[2];
|
|
212
212
|
let i;
|
|
213
213
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = { layout: {
|
|
@@ -237,7 +237,7 @@ function Vt(e) {
|
|
|
237
237
|
}
|
|
238
238
|
Vt.displayName = "AgentHeader.Root";
|
|
239
239
|
function Ht(e) {
|
|
240
|
-
let t = O(6), { hasSubmitted: n } =
|
|
240
|
+
let t = O(6), { hasSubmitted: n } = Qt(), r;
|
|
241
241
|
t[0] !== n || t[1] !== e.children || t[2] !== e.icon ? (r = !n && /* @__PURE__ */ M(A.div, {
|
|
242
242
|
exit: { opacity: 0 },
|
|
243
243
|
transition: { duration: .2 },
|
|
@@ -263,7 +263,7 @@ function Ut(e) {
|
|
|
263
263
|
}
|
|
264
264
|
Ut.displayName = "AgentHeader.Title";
|
|
265
265
|
function Wt(e) {
|
|
266
|
-
let t = O(5), { hasSubmitted: n } =
|
|
266
|
+
let t = O(5), { hasSubmitted: n } = Qt(), r;
|
|
267
267
|
t[0] !== n || t[1] !== e.children ? (r = n && !!e.children && /* @__PURE__ */ M(A.p, {
|
|
268
268
|
initial: { opacity: 0 },
|
|
269
269
|
animate: { opacity: 1 },
|
|
@@ -354,24 +354,24 @@ function z() {
|
|
|
354
354
|
function B() {
|
|
355
355
|
return { status: l(qt) };
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function Qt() {
|
|
358
358
|
let e = l(Xt);
|
|
359
359
|
if (e === void 0) throw Error("useAgentMeta must be used within an AgentProvider");
|
|
360
360
|
return e;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function $t() {
|
|
363
363
|
let e = l(Jt);
|
|
364
364
|
if (e === void 0) throw Error("useAgentMessages must be used within an AgentProvider");
|
|
365
365
|
return e;
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function en() {
|
|
368
368
|
let e = l(Yt);
|
|
369
369
|
if (!e) throw Error("useChatManager must be used within an AgentProvider");
|
|
370
370
|
return e;
|
|
371
371
|
}
|
|
372
372
|
//#endregion
|
|
373
373
|
//#region src/lib/chat/citation-order.ts
|
|
374
|
-
function
|
|
374
|
+
function tn(e, t) {
|
|
375
375
|
return t.map((t, n) => ({
|
|
376
376
|
citation: t,
|
|
377
377
|
order: n,
|
|
@@ -380,29 +380,29 @@ function $t(e, t) {
|
|
|
380
380
|
}
|
|
381
381
|
//#endregion
|
|
382
382
|
//#region src/lib/chat/citations.ts
|
|
383
|
-
function
|
|
383
|
+
function V(e) {
|
|
384
384
|
return (e ?? []).filter((e) => e.source.sourceType === "url");
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
let t = new Set(e.parts.flatMap((e) => e.type === "text" ?
|
|
386
|
+
function nn(e) {
|
|
387
|
+
let t = new Set(e.parts.flatMap((e) => e.type === "text" ? V(e.citations).map(({ source: e }) => e.url) : [])), n = /* @__PURE__ */ new Map(), r = (e, t) => {
|
|
388
388
|
n.has(e) || n.set(e, {
|
|
389
389
|
url: e,
|
|
390
390
|
title: t
|
|
391
391
|
});
|
|
392
392
|
};
|
|
393
393
|
for (let n of e.parts) {
|
|
394
|
-
if (n.type === "text") for (let { citation: e } of
|
|
394
|
+
if (n.type === "text") for (let { citation: e } of tn(n.text, V(n.citations))) r(e.source.url, e.source.title);
|
|
395
395
|
n.type === "source-url" && !t.has(n.url) && r(n.url, n.title);
|
|
396
396
|
}
|
|
397
397
|
return [...n.values()];
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function rn(e, t) {
|
|
400
400
|
let n = e.findIndex((e) => e.url === t);
|
|
401
401
|
return n === -1 ? null : n + 1;
|
|
402
402
|
}
|
|
403
403
|
//#endregion
|
|
404
404
|
//#region src/lib/chat/read-only-transport.ts
|
|
405
|
-
var
|
|
405
|
+
var an = class {
|
|
406
406
|
sendMessages() {
|
|
407
407
|
return Promise.reject(/* @__PURE__ */ Error("This chat is read-only: it has no transport to send messages through."));
|
|
408
408
|
}
|
|
@@ -412,19 +412,19 @@ var nn = class {
|
|
|
412
412
|
};
|
|
413
413
|
//#endregion
|
|
414
414
|
//#region src/lib/chat/tool-abort.ts
|
|
415
|
-
function
|
|
415
|
+
function on(e, t) {
|
|
416
416
|
return t === "streaming" || t === "submitted" ? !1 : e === "input-streaming" || e === "input-available";
|
|
417
417
|
}
|
|
418
|
-
function
|
|
419
|
-
return
|
|
418
|
+
function sn(e, t) {
|
|
419
|
+
return on(e.state, t);
|
|
420
420
|
}
|
|
421
|
-
function
|
|
421
|
+
function cn(e) {
|
|
422
422
|
let t = O(3), { status: n } = B(), r;
|
|
423
|
-
return t[0] !== e || t[1] !== n ? (r =
|
|
423
|
+
return t[0] !== e || t[1] !== n ? (r = sn(e, n), t[0] = e, t[1] = n, t[2] = r) : r = t[2], r;
|
|
424
424
|
}
|
|
425
425
|
//#endregion
|
|
426
426
|
//#region src/lib/chat/tools-schema.ts
|
|
427
|
-
function
|
|
427
|
+
function ln(e) {
|
|
428
428
|
return Object.entries(e).reduce((e, [t, n]) => (n.static || (e[t] = {
|
|
429
429
|
inputSchema: P.toJSONSchema(n.inputSchema, {
|
|
430
430
|
io: "input",
|
|
@@ -435,7 +435,7 @@ function sn(e) {
|
|
|
435
435
|
}
|
|
436
436
|
//#endregion
|
|
437
437
|
//#region src/lib/components/text-shimmer.tsx
|
|
438
|
-
function
|
|
438
|
+
function H(e) {
|
|
439
439
|
let t = O(12), { children: n, as: r, className: i, dir: a, duration: o, enabled: s } = e, c = r === void 0 ? "p" : r, l = s === void 0 || s, u = l && "shimmer", d;
|
|
440
440
|
t[0] !== i || t[1] !== u ? (d = k(u, i), t[0] = i, t[1] = u, t[2] = d) : d = t[2];
|
|
441
441
|
let f;
|
|
@@ -450,7 +450,7 @@ function W(e) {
|
|
|
450
450
|
}
|
|
451
451
|
//#endregion
|
|
452
452
|
//#region src/lib/chat/trajectory/compact-disclosure.tsx
|
|
453
|
-
function
|
|
453
|
+
function un(e) {
|
|
454
454
|
let t = O(4), { className: n } = e, r;
|
|
455
455
|
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);
|
|
456
456
|
let i;
|
|
@@ -459,22 +459,22 @@ function cn(e) {
|
|
|
459
459
|
className: r
|
|
460
460
|
}), t[2] = r, t[3] = i), i;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function dn(e) {
|
|
463
463
|
return k("group hover:bg-muted/30 flex min-h-7 w-full gap-2 rounded-sm py-1 text-left transition-colors", e);
|
|
464
464
|
}
|
|
465
465
|
//#endregion
|
|
466
466
|
//#region src/lib/chat/trajectory/IndexProgressSegment.tsx
|
|
467
|
-
var
|
|
467
|
+
var fn = "data-text2sql-index-progress", pn = {
|
|
468
468
|
initial: "instant",
|
|
469
469
|
resize: "instant"
|
|
470
470
|
};
|
|
471
|
-
function
|
|
472
|
-
return e.type ===
|
|
471
|
+
function mn(e) {
|
|
472
|
+
return e.type === fn;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
return e.parts.filter(
|
|
474
|
+
function hn(e) {
|
|
475
|
+
return e.parts.filter(mn).map((e) => e.data);
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function gn(e) {
|
|
478
478
|
let t = /* @__PURE__ */ new Map(), n = "running", r, i, a = (e, n) => {
|
|
479
479
|
let r = t.get(e) ?? {
|
|
480
480
|
name: e,
|
|
@@ -536,11 +536,11 @@ function mn(e) {
|
|
|
536
536
|
errorMessage: i
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function _n(e) {
|
|
540
540
|
let t = O(2), n;
|
|
541
|
-
return t[0] === e ? n = t[1] : (n =
|
|
541
|
+
return t[0] === e ? n = t[1] : (n = gn(e), t[0] = e, t[1] = n), n;
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function vn(e) {
|
|
544
544
|
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;
|
|
545
545
|
t[0] !== i || t[1] !== o || t[2] !== a ? (u = (e) => {
|
|
546
546
|
i === void 0 && c({
|
|
@@ -554,20 +554,20 @@ function gn(e) {
|
|
|
554
554
|
handleOpenChange: d
|
|
555
555
|
}, t[4] = d, t[5] = l, t[6] = f) : f = t[6], f;
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function yn(e, t) {
|
|
558
558
|
return e.length === 0 ? !0 : t.status !== "complete" || t.adapters.length === 0 ? !1 : t.adapters.every((e) => e.status === "cache-hit");
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function bn(e) {
|
|
561
561
|
return e.filter((e) => e.type === "index:start").length;
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function xn(e) {
|
|
564
564
|
return e.filter((e) => [
|
|
565
565
|
"adapter:start",
|
|
566
566
|
"adapter:cache-hit",
|
|
567
567
|
"adapter:cache-miss"
|
|
568
568
|
].includes(e.type)).length;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function Sn(e) {
|
|
571
571
|
let t = (e.totalAdapters ?? e.adapters.length) > 1;
|
|
572
572
|
if (e.status === "error") {
|
|
573
573
|
let n = e.adapters.find((e) => e.status === "error");
|
|
@@ -583,7 +583,7 @@ function bn(e) {
|
|
|
583
583
|
}
|
|
584
584
|
return e.adapters.length === 0 || !t ? ["Schema indexed"] : ["Schema indexed", `${e.adapters.length} adapters`];
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function Cn(e) {
|
|
587
587
|
if (e.status === "error") return [
|
|
588
588
|
"Failed",
|
|
589
589
|
e.name,
|
|
@@ -607,18 +607,18 @@ function xn(e) {
|
|
|
607
607
|
"queued"
|
|
608
608
|
];
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function wn(e) {
|
|
611
611
|
return ["Failed", e.errorMessage ?? "unknown error"];
|
|
612
612
|
}
|
|
613
|
-
var
|
|
614
|
-
function
|
|
615
|
-
let t = l(
|
|
613
|
+
var Tn = o(null);
|
|
614
|
+
function En(e) {
|
|
615
|
+
let t = l(Tn);
|
|
616
616
|
if (!t) throw Error(`<IndexProgress.${e}> must be used inside <IndexProgress.Root>`);
|
|
617
617
|
return t;
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s =
|
|
621
|
-
t[0] === n ? l = t[1] : (l =
|
|
619
|
+
function Dn(e) {
|
|
620
|
+
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s = _n(n), c = s.status, l;
|
|
621
|
+
t[0] === n ? l = t[1] : (l = bn(n), t[0] = n, t[1] = l);
|
|
622
622
|
let u;
|
|
623
623
|
t[2] !== r || t[3] !== i || t[4] !== s.status || t[5] !== l ? (u = {
|
|
624
624
|
status: c,
|
|
@@ -626,8 +626,8 @@ function Tn(e) {
|
|
|
626
626
|
controlledOpen: r,
|
|
627
627
|
onOpenChange: i
|
|
628
628
|
}, t[2] = r, t[3] = i, t[4] = s.status, t[5] = l, t[6] = u) : u = t[6];
|
|
629
|
-
let { isOpen: d, handleOpenChange: f } =
|
|
630
|
-
if (
|
|
629
|
+
let { isOpen: d, handleOpenChange: f } = vn(u);
|
|
630
|
+
if (yn(n, s)) return null;
|
|
631
631
|
let p;
|
|
632
632
|
t[7] !== n || t[8] !== s ? (p = {
|
|
633
633
|
state: s,
|
|
@@ -645,14 +645,14 @@ function Tn(e) {
|
|
|
645
645
|
children: a
|
|
646
646
|
}), t[12] = a, t[13] = f, t[14] = d, t[15] = s.status, t[16] = h, t[17] = g) : g = t[17];
|
|
647
647
|
let _;
|
|
648
|
-
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(
|
|
648
|
+
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(Tn, {
|
|
649
649
|
value: p,
|
|
650
650
|
children: g
|
|
651
651
|
}), t[18] = p, t[19] = g, t[20] = _) : _ = t[20], _;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
654
|
-
let t = O(13), { className: n } = e, { state: r } =
|
|
655
|
-
t[0] === n ? i = t[1] : (i =
|
|
653
|
+
function On(e) {
|
|
654
|
+
let t = O(13), { className: n } = e, { state: r } = En("Trigger"), i;
|
|
655
|
+
t[0] === n ? i = t[1] : (i = kn(n), t[0] = n, t[1] = i);
|
|
656
656
|
let a;
|
|
657
657
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("button", {
|
|
658
658
|
type: "button",
|
|
@@ -660,42 +660,42 @@ function En(e) {
|
|
|
660
660
|
className: i
|
|
661
661
|
}), t[2] = i, t[3] = a);
|
|
662
662
|
let o;
|
|
663
|
-
t[4] === r ? o = t[5] : (o =
|
|
663
|
+
t[4] === r ? o = t[5] : (o = Sn(r), t[4] = r, t[5] = o);
|
|
664
664
|
let s = r.status === "running", c;
|
|
665
|
-
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(
|
|
665
|
+
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(An, {
|
|
666
666
|
segments: o,
|
|
667
667
|
isRunning: s
|
|
668
668
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8];
|
|
669
669
|
let l;
|
|
670
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(
|
|
670
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(Mn, {}), t[9] = l) : l = t[9];
|
|
671
671
|
let u;
|
|
672
672
|
return t[10] !== a || t[11] !== c ? (u = /* @__PURE__ */ N(L, {
|
|
673
673
|
render: a,
|
|
674
674
|
children: [c, l]
|
|
675
675
|
}), t[10] = a, t[11] = c, t[12] = u) : u = t[12], u;
|
|
676
676
|
}
|
|
677
|
-
function
|
|
678
|
-
return
|
|
677
|
+
function kn(e) {
|
|
678
|
+
return dn(k("items-baseline px-1", e));
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function An(e) {
|
|
681
681
|
let t = O(8), { segments: n, isRunning: r } = e, i = n.length - 1, a;
|
|
682
682
|
if (t[0] !== i || t[1] !== n) {
|
|
683
683
|
let e;
|
|
684
|
-
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(
|
|
684
|
+
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(jn, {
|
|
685
685
|
segment: e,
|
|
686
686
|
index: t,
|
|
687
687
|
isLast: t === i
|
|
688
688
|
}, t), t[3] = i, t[4] = e), a = n.map(e), t[0] = i, t[1] = n, t[2] = a;
|
|
689
689
|
} else a = t[2];
|
|
690
690
|
let o;
|
|
691
|
-
return t[5] !== r || t[6] !== a ? (o = /* @__PURE__ */ M(
|
|
691
|
+
return t[5] !== r || t[6] !== a ? (o = /* @__PURE__ */ M(H, {
|
|
692
692
|
as: "span",
|
|
693
693
|
enabled: r,
|
|
694
694
|
className: "text-muted-foreground min-w-0 flex-1 truncate text-xs",
|
|
695
695
|
children: a
|
|
696
696
|
}), t[5] = r, t[6] = a, t[7] = o) : o = t[7], o;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function jn(e) {
|
|
699
699
|
let t = O(11), { segment: n, index: r, isLast: i } = e, o;
|
|
700
700
|
t[0] === r ? o = t[1] : (o = r > 0 && /* @__PURE__ */ M("span", {
|
|
701
701
|
"aria-hidden": !0,
|
|
@@ -712,11 +712,11 @@ function kn(e) {
|
|
|
712
712
|
let d;
|
|
713
713
|
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;
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function Mn() {
|
|
716
716
|
let e = O(1), t;
|
|
717
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
717
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(un, { className: "text-muted-foreground/60 size-3" }), e[0] = t) : t = e[0], t;
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function Nn(e) {
|
|
720
720
|
let t = O(3), { className: n, children: r } = e, i;
|
|
721
721
|
return t[0] !== r || t[1] !== n ? (i = /* @__PURE__ */ M(I, {
|
|
722
722
|
"data-slot": "index-progress-content",
|
|
@@ -724,7 +724,7 @@ function jn(e) {
|
|
|
724
724
|
children: r
|
|
725
725
|
}), t[0] = r, t[1] = n, t[2] = i) : i = t[2], i;
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function Pn(e) {
|
|
728
728
|
let t = O(11), { event: n } = e, r;
|
|
729
729
|
t[0] === n.type ? r = t[1] : (r = /* @__PURE__ */ M("span", {
|
|
730
730
|
className: "text-muted-foreground/50 w-40 shrink-0 truncate",
|
|
@@ -754,7 +754,7 @@ function Mn(e) {
|
|
|
754
754
|
]
|
|
755
755
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o) : o = t[10], o;
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function Fn(e) {
|
|
758
758
|
let t = O(2), n;
|
|
759
759
|
if (t[0] !== e) {
|
|
760
760
|
let r = /* @__PURE__ */ new Map(), i = [];
|
|
@@ -769,25 +769,25 @@ function Nn(e) {
|
|
|
769
769
|
} else n = t[1];
|
|
770
770
|
return n;
|
|
771
771
|
}
|
|
772
|
-
function
|
|
773
|
-
let t = O(8), { className: n } = e, { events: r } =
|
|
772
|
+
function In(e) {
|
|
773
|
+
let t = O(8), { className: n } = e, { events: r } = En("EventLog"), i = Fn(r), a;
|
|
774
774
|
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);
|
|
775
775
|
let o = a;
|
|
776
776
|
if (i.byAdapter.size <= 1) {
|
|
777
777
|
let e;
|
|
778
|
-
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(
|
|
778
|
+
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(Rn, {
|
|
779
779
|
events: r,
|
|
780
780
|
className: o
|
|
781
781
|
}), t[2] = o, t[3] = r, t[4] = e) : e = t[4], e;
|
|
782
782
|
}
|
|
783
783
|
let s;
|
|
784
|
-
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(
|
|
784
|
+
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(Bn, {
|
|
785
785
|
groupedEvents: i,
|
|
786
786
|
className: o
|
|
787
787
|
}), t[5] = o, t[6] = i, t[7] = s) : s = t[7], s;
|
|
788
788
|
}
|
|
789
|
-
function
|
|
790
|
-
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(
|
|
789
|
+
function Ln(e) {
|
|
790
|
+
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(pn), s;
|
|
791
791
|
t[0] !== i || t[1] !== r || t[2] !== o ? (s = /* @__PURE__ */ M("div", {
|
|
792
792
|
ref: o,
|
|
793
793
|
"data-slot": "index-progress-event-log",
|
|
@@ -801,56 +801,56 @@ function Fn(e) {
|
|
|
801
801
|
children: s
|
|
802
802
|
}), t[4] = n, t[5] = a, t[6] = s, t[7] = c) : c = t[7], c;
|
|
803
803
|
}
|
|
804
|
-
function
|
|
804
|
+
function Rn(e) {
|
|
805
805
|
let t = O(7), { events: n, className: r } = e, i;
|
|
806
|
-
t[0] === n ? i = t[1] : (i = n.map(
|
|
806
|
+
t[0] === n ? i = t[1] : (i = n.map(zn), t[0] = n, t[1] = i);
|
|
807
807
|
let a;
|
|
808
808
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("ul", {
|
|
809
809
|
className: "space-y-0.5",
|
|
810
810
|
children: i
|
|
811
811
|
}), t[2] = i, t[3] = a);
|
|
812
812
|
let o;
|
|
813
|
-
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(
|
|
813
|
+
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(Ln, {
|
|
814
814
|
className: r,
|
|
815
815
|
children: a
|
|
816
816
|
}), t[4] = r, t[5] = a, t[6] = o) : o = t[6], o;
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
return /* @__PURE__ */ M(
|
|
818
|
+
function zn(e, t) {
|
|
819
|
+
return /* @__PURE__ */ M(Pn, { event: e }, `${e.type}-${t}`);
|
|
820
820
|
}
|
|
821
|
-
function
|
|
821
|
+
function Bn(e) {
|
|
822
822
|
let t = O(8), { groupedEvents: n, className: r } = e, i;
|
|
823
823
|
t[0] === n.globalEvents ? i = t[1] : (i = n.globalEvents.length > 0 && /* @__PURE__ */ M("ul", {
|
|
824
824
|
className: "space-y-0.5",
|
|
825
|
-
children: n.globalEvents.map(
|
|
825
|
+
children: n.globalEvents.map(Hn)
|
|
826
826
|
}), t[0] = n.globalEvents, t[1] = i);
|
|
827
827
|
let a;
|
|
828
|
-
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(
|
|
828
|
+
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(Vn), t[2] = n.byAdapter, t[3] = a);
|
|
829
829
|
let o;
|
|
830
|
-
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(
|
|
830
|
+
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(Ln, {
|
|
831
831
|
className: r,
|
|
832
832
|
contentClassName: "space-y-2",
|
|
833
833
|
children: [i, a]
|
|
834
834
|
}), t[4] = r, t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function Vn(e) {
|
|
837
837
|
let [t, n] = e;
|
|
838
|
-
return /* @__PURE__ */ M(
|
|
838
|
+
return /* @__PURE__ */ M(Un, {
|
|
839
839
|
name: t,
|
|
840
840
|
events: n
|
|
841
841
|
}, t);
|
|
842
842
|
}
|
|
843
|
-
function
|
|
844
|
-
return /* @__PURE__ */ M(
|
|
843
|
+
function Hn(e, t) {
|
|
844
|
+
return /* @__PURE__ */ M(Pn, { event: e }, `${e.type}-${t}`);
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function Un(e) {
|
|
847
847
|
let t = O(9), { name: n, events: r } = e, i;
|
|
848
848
|
t[0] === n ? i = t[1] : (i = /* @__PURE__ */ M("div", {
|
|
849
849
|
className: "text-foreground/90",
|
|
850
850
|
children: n
|
|
851
851
|
}), t[0] = n, t[1] = i);
|
|
852
852
|
let a;
|
|
853
|
-
t[2] === r ? a = t[3] : (a = r.map(
|
|
853
|
+
t[2] === r ? a = t[3] : (a = r.map(Wn), t[2] = r, t[3] = a);
|
|
854
854
|
let o;
|
|
855
855
|
t[4] === a ? o = t[5] : (o = /* @__PURE__ */ M("ul", {
|
|
856
856
|
className: "space-y-0.5",
|
|
@@ -862,21 +862,21 @@ function Vn(e) {
|
|
|
862
862
|
children: [i, o]
|
|
863
863
|
}), t[6] = i, t[7] = o, t[8] = s) : s = t[8], s;
|
|
864
864
|
}
|
|
865
|
-
function
|
|
866
|
-
return /* @__PURE__ */ M(
|
|
865
|
+
function Wn(e, t) {
|
|
866
|
+
return /* @__PURE__ */ M(Pn, { event: e }, `${e.type}-${t}`);
|
|
867
867
|
}
|
|
868
|
-
function
|
|
869
|
-
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o =
|
|
870
|
-
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(
|
|
868
|
+
function Gn(e) {
|
|
869
|
+
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o = _n(n), s = Fn(n), c;
|
|
870
|
+
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(Kn), t[0] = s.globalEvents, t[1] = c);
|
|
871
871
|
let l = c;
|
|
872
|
-
if (n.length === 0 || !a &&
|
|
872
|
+
if (n.length === 0 || !a && yn(n, o)) return null;
|
|
873
873
|
if (o.adapters.length === 0) {
|
|
874
874
|
let e;
|
|
875
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(
|
|
875
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(On, {}), t[2] = e) : e = t[2];
|
|
876
876
|
let i;
|
|
877
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(
|
|
877
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(Nn, { children: /* @__PURE__ */ M(In, {}) }), t[3] = i) : i = t[3];
|
|
878
878
|
let a;
|
|
879
|
-
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(
|
|
879
|
+
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(Dn, {
|
|
880
880
|
events: n,
|
|
881
881
|
className: r,
|
|
882
882
|
children: [e, i]
|
|
@@ -887,13 +887,13 @@ function Un(e) {
|
|
|
887
887
|
let f;
|
|
888
888
|
if (t[9] !== s.byAdapter || t[10] !== o.adapters) {
|
|
889
889
|
let e;
|
|
890
|
-
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(
|
|
890
|
+
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(qn, {
|
|
891
891
|
adapter: e,
|
|
892
892
|
events: s.byAdapter.get(e.name) ?? []
|
|
893
893
|
}, 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;
|
|
894
894
|
} else f = t[11];
|
|
895
895
|
let p;
|
|
896
|
-
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(
|
|
896
|
+
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(Yn, {
|
|
897
897
|
state: o,
|
|
898
898
|
events: l
|
|
899
899
|
}), t[14] = l, t[15] = o, t[16] = p) : p = t[16];
|
|
@@ -905,32 +905,32 @@ function Un(e) {
|
|
|
905
905
|
children: [f, p]
|
|
906
906
|
}), t[17] = o.status, t[18] = d, t[19] = f, t[20] = p, t[21] = m) : m = t[21], m;
|
|
907
907
|
}
|
|
908
|
-
function
|
|
908
|
+
function Kn(e) {
|
|
909
909
|
return e.type === "index:error";
|
|
910
910
|
}
|
|
911
|
-
function
|
|
911
|
+
function qn(e) {
|
|
912
912
|
let t = O(22), { adapter: n, events: r } = e, i = n.status, a;
|
|
913
|
-
t[0] === r ? a = t[1] : (a =
|
|
913
|
+
t[0] === r ? a = t[1] : (a = xn(r), t[0] = r, t[1] = a);
|
|
914
914
|
let o;
|
|
915
915
|
t[2] !== n.status || t[3] !== a ? (o = {
|
|
916
916
|
status: i,
|
|
917
917
|
resetKey: a
|
|
918
918
|
}, t[2] = n.status, t[3] = a, t[4] = o) : o = t[4];
|
|
919
|
-
let { isOpen: s, handleOpenChange: c } =
|
|
919
|
+
let { isOpen: s, handleOpenChange: c } = vn(o), l = n.status, u;
|
|
920
920
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ M("button", {
|
|
921
921
|
type: "button",
|
|
922
922
|
"data-slot": "index-progress-adapter-trigger",
|
|
923
|
-
className:
|
|
923
|
+
className: kn()
|
|
924
924
|
}), t[5] = u) : u = t[5];
|
|
925
925
|
let d;
|
|
926
|
-
t[6] === n ? d = t[7] : (d =
|
|
926
|
+
t[6] === n ? d = t[7] : (d = Cn(n), t[6] = n, t[7] = d);
|
|
927
927
|
let f = n.status === "running", p;
|
|
928
|
-
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(
|
|
928
|
+
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(An, {
|
|
929
929
|
segments: d,
|
|
930
930
|
isRunning: f
|
|
931
931
|
}), t[8] = d, t[9] = f, t[10] = p) : p = t[10];
|
|
932
932
|
let m;
|
|
933
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(
|
|
933
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(Mn, {}), t[11] = m) : m = t[11];
|
|
934
934
|
let h;
|
|
935
935
|
t[12] === p ? h = t[13] : (h = /* @__PURE__ */ N(L, {
|
|
936
936
|
render: u,
|
|
@@ -939,7 +939,7 @@ function Gn(e) {
|
|
|
939
939
|
let g;
|
|
940
940
|
t[14] === r ? g = t[15] : (g = /* @__PURE__ */ M(I, {
|
|
941
941
|
"data-slot": "index-progress-adapter-content",
|
|
942
|
-
children: /* @__PURE__ */ M(
|
|
942
|
+
children: /* @__PURE__ */ M(Jn, { events: r })
|
|
943
943
|
}), t[14] = r, t[15] = g);
|
|
944
944
|
let _;
|
|
945
945
|
return t[16] !== n.status || t[17] !== c || t[18] !== s || t[19] !== h || t[20] !== g ? (_ = /* @__PURE__ */ N(F, {
|
|
@@ -951,36 +951,36 @@ function Gn(e) {
|
|
|
951
951
|
children: [h, g]
|
|
952
952
|
}), t[16] = n.status, t[17] = c, t[18] = s, t[19] = h, t[20] = g, t[21] = _) : _ = t[21], _;
|
|
953
953
|
}
|
|
954
|
-
function
|
|
954
|
+
function Jn(e) {
|
|
955
955
|
let t = O(2), { events: n } = e;
|
|
956
956
|
if (n.length === 0) return null;
|
|
957
957
|
let r;
|
|
958
|
-
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(
|
|
958
|
+
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(Rn, {
|
|
959
959
|
events: n,
|
|
960
960
|
className: "mt-2 ml-4 max-h-64 overflow-y-auto font-mono text-[11px]"
|
|
961
961
|
}), t[0] = n, t[1] = r), r;
|
|
962
962
|
}
|
|
963
|
-
function
|
|
963
|
+
function Yn(e) {
|
|
964
964
|
let t = O(20), { state: n, events: r } = e, i;
|
|
965
965
|
t[0] !== r.length || t[1] !== n.status ? (i = {
|
|
966
966
|
status: n.status,
|
|
967
967
|
resetKey: r.length
|
|
968
968
|
}, t[0] = r.length, t[1] = n.status, t[2] = i) : i = t[2];
|
|
969
|
-
let { isOpen: a, handleOpenChange: o } =
|
|
969
|
+
let { isOpen: a, handleOpenChange: o } = vn(i), s = n.status, c;
|
|
970
970
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ M("button", {
|
|
971
971
|
type: "button",
|
|
972
972
|
"data-slot": "index-progress-global-error-trigger",
|
|
973
|
-
className:
|
|
973
|
+
className: kn()
|
|
974
974
|
}), t[3] = c) : c = t[3];
|
|
975
975
|
let l;
|
|
976
|
-
t[4] === n ? l = t[5] : (l =
|
|
976
|
+
t[4] === n ? l = t[5] : (l = wn(n), t[4] = n, t[5] = l);
|
|
977
977
|
let u = n.status === "running", d;
|
|
978
|
-
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(
|
|
978
|
+
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(An, {
|
|
979
979
|
segments: l,
|
|
980
980
|
isRunning: u
|
|
981
981
|
}), t[6] = l, t[7] = u, t[8] = d) : d = t[8];
|
|
982
982
|
let f;
|
|
983
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(
|
|
983
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(Mn, {}), t[9] = f) : f = t[9];
|
|
984
984
|
let p;
|
|
985
985
|
t[10] === d ? p = t[11] : (p = /* @__PURE__ */ N(L, {
|
|
986
986
|
render: c,
|
|
@@ -989,7 +989,7 @@ function qn(e) {
|
|
|
989
989
|
let m;
|
|
990
990
|
t[12] === r ? m = t[13] : (m = /* @__PURE__ */ M(I, {
|
|
991
991
|
"data-slot": "index-progress-global-error-content",
|
|
992
|
-
children: /* @__PURE__ */ M(
|
|
992
|
+
children: /* @__PURE__ */ M(Jn, { events: r })
|
|
993
993
|
}), t[12] = r, t[13] = m);
|
|
994
994
|
let h;
|
|
995
995
|
return t[14] !== o || t[15] !== a || t[16] !== n.status || t[17] !== p || t[18] !== m ? (h = /* @__PURE__ */ N(F, {
|
|
@@ -1001,70 +1001,156 @@ function qn(e) {
|
|
|
1001
1001
|
children: [p, m]
|
|
1002
1002
|
}), t[14] = o, t[15] = a, t[16] = n.status, t[17] = p, t[18] = m, t[19] = h) : h = t[19], h;
|
|
1003
1003
|
}
|
|
1004
|
-
var
|
|
1005
|
-
Root:
|
|
1006
|
-
Trigger:
|
|
1007
|
-
Content:
|
|
1008
|
-
EventLog:
|
|
1009
|
-
PerAdapter:
|
|
1010
|
-
},
|
|
1011
|
-
function
|
|
1012
|
-
let e = l(
|
|
1004
|
+
var Xn = {
|
|
1005
|
+
Root: Dn,
|
|
1006
|
+
Trigger: On,
|
|
1007
|
+
Content: Nn,
|
|
1008
|
+
EventLog: In,
|
|
1009
|
+
PerAdapter: Gn
|
|
1010
|
+
}, Zn = o(void 0), Qn = o(void 0);
|
|
1011
|
+
function U() {
|
|
1012
|
+
let e = l(Zn);
|
|
1013
1013
|
if (!e) throw Error("useMessagesContext must be used within <Messages>");
|
|
1014
1014
|
return e;
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1017
|
-
let e = l(
|
|
1016
|
+
function W() {
|
|
1017
|
+
let e = l(Zn), { status: t } = B();
|
|
1018
1018
|
return e?.status ?? t;
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1021
|
-
let e = l(
|
|
1020
|
+
function G() {
|
|
1021
|
+
let e = l(Qn);
|
|
1022
1022
|
if (!e) throw Error("useMessageItem must be used within <Messages.Item>");
|
|
1023
1023
|
return e;
|
|
1024
1024
|
}
|
|
1025
1025
|
//#endregion
|
|
1026
|
+
//#region src/lib/i18n/messages.ts
|
|
1027
|
+
var $n = {
|
|
1028
|
+
"citation.source": ({ index: e }, { format: t }) => `Source ${t(e)}`,
|
|
1029
|
+
"citation.open": "Open the source",
|
|
1030
|
+
"message.copy": "Copy message",
|
|
1031
|
+
"message.copied": "Copied",
|
|
1032
|
+
"message.regenerate": "Regenerate response",
|
|
1033
|
+
"message.copyDebugJson": "Copy debug JSON",
|
|
1034
|
+
"steps.working": "Working...",
|
|
1035
|
+
"steps.reasoning": ({ detail: e }) => e ? `Reasoning ${e}` : "Reasoning",
|
|
1036
|
+
"steps.reasoned": ({ detail: e }) => e ? `Reasoned ${e}` : "Reasoned",
|
|
1037
|
+
"steps.call": ({ call: e, status: t }) => ({
|
|
1038
|
+
complete: `Called ${e}`,
|
|
1039
|
+
error: `Failed ${e}`,
|
|
1040
|
+
aborted: `Cancelled ${e}`
|
|
1041
|
+
})[t],
|
|
1042
|
+
"steps.tools": ({ count: e, status: t }, { plural: n }) => ({
|
|
1043
|
+
complete: n(e, {
|
|
1044
|
+
one: "Ran # tool",
|
|
1045
|
+
other: "Ran # tools"
|
|
1046
|
+
}),
|
|
1047
|
+
error: n(e, {
|
|
1048
|
+
one: "Ran # tool with issues",
|
|
1049
|
+
other: "Ran # tools with issues"
|
|
1050
|
+
}),
|
|
1051
|
+
aborted: n(e, {
|
|
1052
|
+
one: "Cancelled after running # tool",
|
|
1053
|
+
other: "Cancelled after running # tools"
|
|
1054
|
+
})
|
|
1055
|
+
})[t],
|
|
1056
|
+
"steps.unnamedTool": "Tool",
|
|
1057
|
+
"steps.unknownStep": "Step"
|
|
1058
|
+
}, er = o({
|
|
1059
|
+
locale: "en",
|
|
1060
|
+
dir: "ltr",
|
|
1061
|
+
messages: $n
|
|
1062
|
+
});
|
|
1063
|
+
function tr(e) {
|
|
1064
|
+
let { direction: t } = new Intl.Locale(e).getTextInfo();
|
|
1065
|
+
if (!t) throw Error(`Intl knows no text direction for the locale "${e}": give GenaiMessagesProvider its dir.`);
|
|
1066
|
+
return t;
|
|
1067
|
+
}
|
|
1068
|
+
function nr(e) {
|
|
1069
|
+
let t = O(13), { locale: n, dir: r, messages: i, children: a } = e, o;
|
|
1070
|
+
t[0] !== n || t[1] !== r ? (o = r === void 0 ? tr(n) : r, t[0] = n, t[1] = r, t[2] = o) : o = t[2];
|
|
1071
|
+
let s = o, c = l(er), u;
|
|
1072
|
+
t[3] !== i || t[4] !== c.messages ? (u = {
|
|
1073
|
+
...c.messages,
|
|
1074
|
+
...i
|
|
1075
|
+
}, t[3] = i, t[4] = c.messages, t[5] = u) : u = t[5];
|
|
1076
|
+
let d;
|
|
1077
|
+
t[6] !== s || t[7] !== n || t[8] !== u ? (d = {
|
|
1078
|
+
locale: n,
|
|
1079
|
+
dir: s,
|
|
1080
|
+
messages: u
|
|
1081
|
+
}, t[6] = s, t[7] = n, t[8] = u, t[9] = d) : d = t[9];
|
|
1082
|
+
let f;
|
|
1083
|
+
return t[10] !== a || t[11] !== d ? (f = /* @__PURE__ */ M(er, {
|
|
1084
|
+
value: d,
|
|
1085
|
+
children: a
|
|
1086
|
+
}), t[10] = a, t[11] = d, t[12] = f) : f = t[12], f;
|
|
1087
|
+
}
|
|
1088
|
+
function K() {
|
|
1089
|
+
let { locale: e, messages: t } = l(er), n = new Intl.PluralRules(e), r = new Intl.NumberFormat(e), i = {
|
|
1090
|
+
format: (e) => r.format(e),
|
|
1091
|
+
plural: (e, t) => (t[n.select(e)] ?? t.other).replaceAll("#", r.format(e))
|
|
1092
|
+
};
|
|
1093
|
+
return (e, n) => {
|
|
1094
|
+
let r = t[e];
|
|
1095
|
+
return typeof r == "string" ? r : r(n, i);
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
//#endregion
|
|
1026
1099
|
//#region src/lib/components/CitationPill.tsx
|
|
1027
|
-
function
|
|
1028
|
-
source:
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1100
|
+
function rr(e) {
|
|
1101
|
+
let t = O(27), { source: n, index: r, children: i } = e, a = K(), o = URL.parse(n.url)?.hostname ?? n.url, s;
|
|
1102
|
+
t[0] !== r || t[1] !== a ? (s = a("citation.source", { index: r }), t[0] = r, t[1] = a, t[2] = s) : s = t[2];
|
|
1103
|
+
let c;
|
|
1104
|
+
t[3] !== r || t[4] !== s ? (c = /* @__PURE__ */ M(Me, {
|
|
1105
|
+
openOnHover: !0,
|
|
1106
|
+
"aria-label": s,
|
|
1107
|
+
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",
|
|
1108
|
+
children: r
|
|
1109
|
+
}), t[3] = r, t[4] = s, t[5] = c) : c = t[5];
|
|
1110
|
+
let l = n.title ?? o, u = n.title ?? o, d;
|
|
1111
|
+
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(je, {
|
|
1112
|
+
dir: "auto",
|
|
1113
|
+
title: l,
|
|
1114
|
+
className: "truncate",
|
|
1115
|
+
children: u
|
|
1116
|
+
}), t[6] = l, t[7] = u, t[8] = d) : d = t[8];
|
|
1117
|
+
let f;
|
|
1118
|
+
t[9] !== o || t[10] !== n.title ? (f = n.title ? /* @__PURE__ */ M(ke, {
|
|
1119
|
+
dir: "auto",
|
|
1120
|
+
title: o,
|
|
1121
|
+
className: "truncate",
|
|
1122
|
+
children: o
|
|
1123
|
+
}) : null, t[9] = o, t[10] = n.title, t[11] = f) : f = t[11];
|
|
1124
|
+
let p;
|
|
1125
|
+
t[12] !== d || t[13] !== f ? (p = /* @__PURE__ */ N(Ae, { children: [d, f] }), t[12] = d, t[13] = f, t[14] = p) : p = t[14];
|
|
1126
|
+
let m = n.url, h;
|
|
1127
|
+
t[15] === a ? h = t[16] : (h = a("citation.open"), t[15] = a, t[16] = h);
|
|
1128
|
+
let g;
|
|
1129
|
+
t[17] !== n.url || t[18] !== h ? (g = /* @__PURE__ */ M("a", {
|
|
1130
|
+
href: m,
|
|
1131
|
+
target: "_blank",
|
|
1132
|
+
rel: "noopener noreferrer",
|
|
1133
|
+
className: "text-primary underline",
|
|
1134
|
+
children: h
|
|
1135
|
+
}), t[17] = n.url, t[18] = h, t[19] = g) : g = t[19];
|
|
1136
|
+
let _;
|
|
1137
|
+
t[20] !== i || t[21] !== g || t[22] !== p ? (_ = /* @__PURE__ */ N(Oe, {
|
|
1138
|
+
className: "w-72 gap-2 text-sm",
|
|
1139
|
+
children: [
|
|
1140
|
+
p,
|
|
1141
|
+
i,
|
|
1142
|
+
g
|
|
1143
|
+
]
|
|
1144
|
+
}), t[20] = i, t[21] = g, t[22] = p, t[23] = _) : _ = t[23];
|
|
1145
|
+
let v;
|
|
1146
|
+
return t[24] !== _ || t[25] !== c ? (v = /* @__PURE__ */ M("sup", {
|
|
1033
1147
|
className: "ml-0.5 inline-block",
|
|
1034
|
-
children: /* @__PURE__ */ N(De, { children: [
|
|
1035
|
-
|
|
1036
|
-
"aria-label": n.source,
|
|
1037
|
-
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",
|
|
1038
|
-
children: t
|
|
1039
|
-
}), /* @__PURE__ */ N(Oe, {
|
|
1040
|
-
className: "w-72 gap-2 text-sm",
|
|
1041
|
-
children: [
|
|
1042
|
-
/* @__PURE__ */ N(Ae, { children: [/* @__PURE__ */ M(je, {
|
|
1043
|
-
dir: "auto",
|
|
1044
|
-
title: e.title ?? i,
|
|
1045
|
-
className: "truncate",
|
|
1046
|
-
children: e.title ?? i
|
|
1047
|
-
}), e.title ? /* @__PURE__ */ M(ke, {
|
|
1048
|
-
dir: "auto",
|
|
1049
|
-
title: i,
|
|
1050
|
-
className: "truncate",
|
|
1051
|
-
children: i
|
|
1052
|
-
}) : null] }),
|
|
1053
|
-
r,
|
|
1054
|
-
/* @__PURE__ */ M("a", {
|
|
1055
|
-
href: e.url,
|
|
1056
|
-
target: "_blank",
|
|
1057
|
-
rel: "noopener noreferrer",
|
|
1058
|
-
className: "text-primary underline",
|
|
1059
|
-
children: n.open
|
|
1060
|
-
})
|
|
1061
|
-
]
|
|
1062
|
-
})] })
|
|
1063
|
-
});
|
|
1148
|
+
children: /* @__PURE__ */ N(De, { children: [c, _] })
|
|
1149
|
+
}), t[24] = _, t[25] = c, t[26] = v) : v = t[26], v;
|
|
1064
1150
|
}
|
|
1065
1151
|
//#endregion
|
|
1066
1152
|
//#region src/lib/ui/TablePanel.tsx
|
|
1067
|
-
function
|
|
1153
|
+
function ir(e) {
|
|
1068
1154
|
let t = O(10), n, r, i;
|
|
1069
1155
|
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);
|
|
1070
1156
|
let a;
|
|
@@ -1078,8 +1164,8 @@ function Qn(e) {
|
|
|
1078
1164
|
...r
|
|
1079
1165
|
}), t[6] = r, t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
1080
1166
|
}
|
|
1081
|
-
|
|
1082
|
-
function
|
|
1167
|
+
ir.displayName = "TablePanel.Root";
|
|
1168
|
+
function ar(e) {
|
|
1083
1169
|
let t = O(8), n, r;
|
|
1084
1170
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1085
1171
|
let i;
|
|
@@ -1091,7 +1177,7 @@ function $n(e) {
|
|
|
1091
1177
|
...r
|
|
1092
1178
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1093
1179
|
}
|
|
1094
|
-
function
|
|
1180
|
+
function or(e) {
|
|
1095
1181
|
let t = O(8), n, r;
|
|
1096
1182
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1097
1183
|
let i;
|
|
@@ -1103,7 +1189,7 @@ function er(e) {
|
|
|
1103
1189
|
...r
|
|
1104
1190
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1105
1191
|
}
|
|
1106
|
-
function
|
|
1192
|
+
function sr(e) {
|
|
1107
1193
|
let t = O(8), n, r;
|
|
1108
1194
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1109
1195
|
let i;
|
|
@@ -1115,7 +1201,7 @@ function tr(e) {
|
|
|
1115
1201
|
...r
|
|
1116
1202
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1117
1203
|
}
|
|
1118
|
-
function
|
|
1204
|
+
function cr(e) {
|
|
1119
1205
|
let t = O(8), n, r;
|
|
1120
1206
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1121
1207
|
let i;
|
|
@@ -1127,7 +1213,7 @@ function nr(e) {
|
|
|
1127
1213
|
...r
|
|
1128
1214
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1129
1215
|
}
|
|
1130
|
-
function
|
|
1216
|
+
function lr(e) {
|
|
1131
1217
|
let t = O(8), n, r;
|
|
1132
1218
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1133
1219
|
let i;
|
|
@@ -1139,7 +1225,7 @@ function rr(e) {
|
|
|
1139
1225
|
...r
|
|
1140
1226
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1141
1227
|
}
|
|
1142
|
-
function
|
|
1228
|
+
function ur(e) {
|
|
1143
1229
|
let t = O(8), n, r;
|
|
1144
1230
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1145
1231
|
let i;
|
|
@@ -1151,40 +1237,40 @@ function ir(e) {
|
|
|
1151
1237
|
...r
|
|
1152
1238
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1153
1239
|
}
|
|
1154
|
-
var
|
|
1155
|
-
Header:
|
|
1156
|
-
Heading:
|
|
1157
|
-
Title:
|
|
1158
|
-
Description:
|
|
1159
|
-
Actions:
|
|
1160
|
-
Content:
|
|
1161
|
-
}),
|
|
1162
|
-
function
|
|
1163
|
-
return e.replace(
|
|
1164
|
-
}
|
|
1165
|
-
function
|
|
1240
|
+
var q = Object.assign(ir, {
|
|
1241
|
+
Header: ar,
|
|
1242
|
+
Heading: or,
|
|
1243
|
+
Title: sr,
|
|
1244
|
+
Description: cr,
|
|
1245
|
+
Actions: lr,
|
|
1246
|
+
Content: ur
|
|
1247
|
+
}), dr = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>/g, fr = /\b([\w-]+)="((?:\\.|[^"])*)"/g;
|
|
1248
|
+
function pr(e) {
|
|
1249
|
+
return e.replace(dr, (e) => e.replace(fr, (e, t, n) => `${t}="${n.replace(/\\"/g, """)}"`));
|
|
1250
|
+
}
|
|
1251
|
+
function mr(e, t) {
|
|
1166
1252
|
if (typeof e != "string") return e;
|
|
1167
|
-
let n =
|
|
1168
|
-
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") &&
|
|
1253
|
+
let n = pr(xr(e, _r(t))).replace(/<(\w[\w-]*)((?:\s+[\w-]+="[^"]*")+)\s*(\/?>)/g, (e, t, n, r) => `<${t}${n.replace(/\s+/g, " ")}${r}`);
|
|
1254
|
+
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") && gr(r, n) ? e : "/>\n\n<"), Sr(n, t);
|
|
1169
1255
|
}
|
|
1170
|
-
var
|
|
1171
|
-
function
|
|
1256
|
+
var hr = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>|<\/[\w-]+\s*>/g;
|
|
1257
|
+
function gr(e, t) {
|
|
1172
1258
|
let n = e.lastIndexOf("\n", t - 1) + 1, r = e.indexOf("\n", t);
|
|
1173
|
-
return e.slice(n, r < 0 ? e.length : r).replace(
|
|
1259
|
+
return e.slice(n, r < 0 ? e.length : r).replace(hr, "").trim() !== "";
|
|
1174
1260
|
}
|
|
1175
|
-
function
|
|
1261
|
+
function _r(e) {
|
|
1176
1262
|
let t = e?.length ? new Set(e) : null;
|
|
1177
1263
|
return t ? (e) => t.has(e) : (e) => e.includes("-");
|
|
1178
1264
|
}
|
|
1179
|
-
var
|
|
1180
|
-
function
|
|
1181
|
-
return e.replace(
|
|
1265
|
+
var vr = /<([\w-]+)((?:\s+[\w-]+=(?:[“”][^“”]*[“”]|[‘’][^‘’]*[‘’]|"[^"]*"|'[^']*'))+)\s*(\/?>)/g, yr = /([\w-]+)=(?:[“”]([^“”]*)[“”]|[‘’]([^‘’]*)[‘’])/g;
|
|
1266
|
+
function br(e) {
|
|
1267
|
+
return e.replace(yr, (e, t, n, r) => `${t}="${(n ?? r ?? "").replace(/"/g, """)}"`);
|
|
1182
1268
|
}
|
|
1183
|
-
function
|
|
1184
|
-
return e.replace(
|
|
1269
|
+
function xr(e, t) {
|
|
1270
|
+
return e.replace(vr, (e, n, r, i) => t(n) ? `<${n}${br(r)}${i}` : e);
|
|
1185
1271
|
}
|
|
1186
|
-
function
|
|
1187
|
-
let r =
|
|
1272
|
+
function Sr(e, t, n = !1) {
|
|
1273
|
+
let r = _r(t), i = "", a = 0;
|
|
1188
1274
|
for (; a < e.length;) {
|
|
1189
1275
|
if (e[a] !== "<" || e[a + 1] === "/") {
|
|
1190
1276
|
i += e[a++];
|
|
@@ -1197,36 +1283,36 @@ function gr(e, t, n = !1) {
|
|
|
1197
1283
|
i += e[a++];
|
|
1198
1284
|
continue;
|
|
1199
1285
|
}
|
|
1200
|
-
let c =
|
|
1286
|
+
let c = Cr(e, a);
|
|
1201
1287
|
if (c < 0) {
|
|
1202
1288
|
i += e[a++];
|
|
1203
1289
|
continue;
|
|
1204
1290
|
}
|
|
1205
1291
|
if (e[c - 1] === "/") {
|
|
1206
1292
|
let t = e.slice(a, c + 1);
|
|
1207
|
-
n ? i += "<div>" + t + "</div>" :
|
|
1293
|
+
n ? i += "<div>" + t + "</div>" : gr(e, a) ? i += "<span>" + t.slice(0, -2).trimEnd() + "></" + s + "></span>" : (i += t.slice(0, -2).trimEnd() + "></" + s + ">", e[c + 1] === "\n" && c + 2 < e.length && e[c + 2] !== "\n" && (i += "\n")), a = c + 1;
|
|
1208
1294
|
continue;
|
|
1209
1295
|
}
|
|
1210
|
-
let l =
|
|
1296
|
+
let l = wr(e, c + 1, s);
|
|
1211
1297
|
if (!l) {
|
|
1212
1298
|
if (n) {
|
|
1213
|
-
let n = e.slice(a, c + 1), r =
|
|
1299
|
+
let n = e.slice(a, c + 1), r = Sr(e.slice(c + 1), t, !0);
|
|
1214
1300
|
return i += "<div>" + n + r + "</" + s + "></div>", i;
|
|
1215
1301
|
}
|
|
1216
1302
|
i += e.slice(a, c + 1), a = c + 1;
|
|
1217
1303
|
continue;
|
|
1218
1304
|
}
|
|
1219
|
-
let u = e.slice(a, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p =
|
|
1305
|
+
let u = e.slice(a, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p = Sr(d, t, !0);
|
|
1220
1306
|
if (n) i += "<div>" + u + p + f + "</div>";
|
|
1221
1307
|
else {
|
|
1222
1308
|
let t = p.includes("\n") ? "\n" : "";
|
|
1223
|
-
i =
|
|
1309
|
+
i = Tr(i) + "<div>" + t + u + p + f + t + "</div>", e[l.end] === "\n" && l.end + 1 < e.length && e[l.end + 1] !== "\n" && (i += "\n");
|
|
1224
1310
|
}
|
|
1225
1311
|
a = l.end;
|
|
1226
1312
|
}
|
|
1227
1313
|
return i;
|
|
1228
1314
|
}
|
|
1229
|
-
function
|
|
1315
|
+
function Cr(e, t) {
|
|
1230
1316
|
let n = t + 1;
|
|
1231
1317
|
for (; n < e.length;) {
|
|
1232
1318
|
if (e[n] === "\"") for (n++; n < e.length && e[n] !== "\"";) n++;
|
|
@@ -1235,14 +1321,14 @@ function _r(e, t) {
|
|
|
1235
1321
|
}
|
|
1236
1322
|
return -1;
|
|
1237
1323
|
}
|
|
1238
|
-
function
|
|
1324
|
+
function wr(e, t, n) {
|
|
1239
1325
|
let r = 1, i = t, a = "<" + n, o = "</" + n;
|
|
1240
1326
|
for (; i < e.length;) {
|
|
1241
1327
|
let t = e.indexOf("<", i);
|
|
1242
1328
|
if (t < 0) return null;
|
|
1243
1329
|
if (e.startsWith(o, t) && !/[\w-]/.test(e[t + o.length] || "")) {
|
|
1244
1330
|
if (r--, r === 0) {
|
|
1245
|
-
let n =
|
|
1331
|
+
let n = Cr(e, t);
|
|
1246
1332
|
return n < 0 ? null : {
|
|
1247
1333
|
start: t,
|
|
1248
1334
|
end: n + 1
|
|
@@ -1251,25 +1337,25 @@ function vr(e, t, n) {
|
|
|
1251
1337
|
let n = e.indexOf(">", t + o.length);
|
|
1252
1338
|
i = n < 0 ? t + 1 : n + 1;
|
|
1253
1339
|
} else if (e.startsWith(a, t) && !/[\w-]/.test(e[t + a.length] || "")) {
|
|
1254
|
-
let n =
|
|
1340
|
+
let n = Cr(e, t);
|
|
1255
1341
|
n >= 0 && e[n - 1] !== "/" && r++, i = n < 0 ? t + 1 : n + 1;
|
|
1256
1342
|
} else if (/[a-zA-Z/]/.test(e[t + 1] || "")) {
|
|
1257
|
-
let n =
|
|
1343
|
+
let n = Cr(e, t);
|
|
1258
1344
|
i = n < 0 ? t + 1 : n + 1;
|
|
1259
1345
|
} else i = t + 1;
|
|
1260
1346
|
}
|
|
1261
1347
|
return null;
|
|
1262
1348
|
}
|
|
1263
|
-
function
|
|
1349
|
+
function Tr(e) {
|
|
1264
1350
|
return e.length === 0 ? "\n\n" : e.endsWith("\n\n") ? e : e.endsWith("\n") ? e + "\n" : e + "\n\n";
|
|
1265
1351
|
}
|
|
1266
1352
|
//#endregion
|
|
1267
1353
|
//#region src/lib/elements/table-panel-extension.tsx
|
|
1268
|
-
var
|
|
1354
|
+
var Er = "response-table-panel", Dr = ["title", "description"], Or = k(Ne({
|
|
1269
1355
|
variant: "ghost",
|
|
1270
1356
|
size: "icon-sm"
|
|
1271
|
-
})),
|
|
1272
|
-
let t = _t(e), n =
|
|
1357
|
+
})), kr = vt().use(ut).use(lt).use(ct), Ar = (e) => {
|
|
1358
|
+
let t = _t(e), n = Nr(e);
|
|
1273
1359
|
if (n.length === 0) return t;
|
|
1274
1360
|
let r = 0, i = t.map((e) => {
|
|
1275
1361
|
let t = {
|
|
@@ -1284,49 +1370,49 @@ var br = "response-table-panel", xr = ["title", "description"], Sr = k(Ne({
|
|
|
1284
1370
|
}
|
|
1285
1371
|
return t.reduce((e, t, n) => (a.has(n) && e.length > 0 ? e[e.length - 1] += t : e.push(t), e), []);
|
|
1286
1372
|
};
|
|
1287
|
-
function
|
|
1373
|
+
function jr(e) {
|
|
1288
1374
|
return e?.type === "leafDirective" && "name" in e && e.name === "table";
|
|
1289
1375
|
}
|
|
1290
|
-
function
|
|
1376
|
+
function Mr(e, t) {
|
|
1291
1377
|
if (t === void 0) return;
|
|
1292
1378
|
let n = e[t - 1];
|
|
1293
|
-
return
|
|
1379
|
+
return jr(n) ? n : void 0;
|
|
1294
1380
|
}
|
|
1295
|
-
function
|
|
1381
|
+
function Nr(e) {
|
|
1296
1382
|
let t = [];
|
|
1297
|
-
return bt(
|
|
1383
|
+
return bt(kr.parse(e), "table", (e, n, r) => {
|
|
1298
1384
|
if (!r) return;
|
|
1299
|
-
let i =
|
|
1385
|
+
let i = Mr(r.children, n)?.position?.start.offset, a = e.position?.end.offset;
|
|
1300
1386
|
i !== void 0 && a !== void 0 && t.push({
|
|
1301
1387
|
start: i,
|
|
1302
1388
|
end: a
|
|
1303
1389
|
});
|
|
1304
1390
|
}), t;
|
|
1305
1391
|
}
|
|
1306
|
-
function
|
|
1392
|
+
function Pr(e, t) {
|
|
1307
1393
|
return e.attributes?.[t]?.trim() || void 0;
|
|
1308
1394
|
}
|
|
1309
|
-
function
|
|
1310
|
-
let t =
|
|
1395
|
+
function Fr(e) {
|
|
1396
|
+
let t = kr.parse(e), n = !1;
|
|
1311
1397
|
if (bt(t, "leafDirective", (e, t, r) => {
|
|
1312
1398
|
let i = t === void 0 ? void 0 : r?.children[t + 1];
|
|
1313
1399
|
if (e.name !== "table" || i?.type !== "table") return;
|
|
1314
1400
|
n = !0;
|
|
1315
|
-
let a = [
|
|
1401
|
+
let a = [Pr(e, "title"), Pr(e, "description")].filter(Boolean).join(" ");
|
|
1316
1402
|
e.children = a ? [{
|
|
1317
1403
|
type: "text",
|
|
1318
1404
|
value: a
|
|
1319
1405
|
}] : [];
|
|
1320
1406
|
}), n) return gt(st(t, { includeHtml: !1 }));
|
|
1321
1407
|
}
|
|
1322
|
-
function
|
|
1408
|
+
function Ir(e) {
|
|
1323
1409
|
let t = O(2), n;
|
|
1324
1410
|
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(dt, { ...e }), t[0] = e, t[1] = n), n;
|
|
1325
1411
|
}
|
|
1326
|
-
function
|
|
1412
|
+
function Lr(e) {
|
|
1327
1413
|
function t(t) {
|
|
1328
1414
|
let n = O(6), r;
|
|
1329
|
-
n[0] !== t.content || n[1] !== t.dir ? (r =
|
|
1415
|
+
n[0] !== t.content || n[1] !== t.dir ? (r = Fr(t.content) ?? t.dir, n[0] = t.content, n[1] = t.dir, n[2] = r) : r = n[2];
|
|
1330
1416
|
let i = r, a;
|
|
1331
1417
|
return n[3] !== i || n[4] !== t ? (a = /* @__PURE__ */ M(e, {
|
|
1332
1418
|
...t,
|
|
@@ -1335,69 +1421,69 @@ function jr(e) {
|
|
|
1335
1421
|
}
|
|
1336
1422
|
return t.displayName = "DirectionAwareTableBlock", t;
|
|
1337
1423
|
}
|
|
1338
|
-
function
|
|
1339
|
-
let n = t &&
|
|
1424
|
+
function Rr(e, t) {
|
|
1425
|
+
let n = t && Pr(t, "title"), r = t && Pr(t, "description"), i = {
|
|
1340
1426
|
...n ? { title: n } : {},
|
|
1341
1427
|
...r ? { description: r } : {}
|
|
1342
1428
|
};
|
|
1343
1429
|
return {
|
|
1344
1430
|
type: "tablePanel",
|
|
1345
1431
|
data: {
|
|
1346
|
-
hName:
|
|
1432
|
+
hName: Er,
|
|
1347
1433
|
...Object.keys(i).length > 0 ? { hProperties: i } : {}
|
|
1348
1434
|
},
|
|
1349
1435
|
children: [e]
|
|
1350
1436
|
};
|
|
1351
1437
|
}
|
|
1352
|
-
function
|
|
1438
|
+
function zr() {
|
|
1353
1439
|
return (e) => {
|
|
1354
1440
|
bt(e, "table", (e, t, n) => {
|
|
1355
1441
|
if (t === void 0 || !n) return;
|
|
1356
|
-
let r =
|
|
1357
|
-
return n.children.splice(i, a,
|
|
1442
|
+
let r = Mr(n.children, t), i = r ? t - 1 : t, a = r ? 2 : 1;
|
|
1443
|
+
return n.children.splice(i, a, Rr(e, r)), [yt, i + 1];
|
|
1358
1444
|
});
|
|
1359
1445
|
};
|
|
1360
1446
|
}
|
|
1361
|
-
var
|
|
1447
|
+
var Br = [
|
|
1362
1448
|
...Object.values(ht),
|
|
1363
1449
|
ct,
|
|
1364
|
-
|
|
1365
|
-
],
|
|
1450
|
+
zr
|
|
1451
|
+
], Vr = t.createContext({
|
|
1366
1452
|
actions: null,
|
|
1367
1453
|
controls: !0
|
|
1368
1454
|
});
|
|
1369
|
-
function
|
|
1455
|
+
function Hr(e, t) {
|
|
1370
1456
|
if (e === !1) return !1;
|
|
1371
1457
|
if (e === !0 || e === void 0) return !0;
|
|
1372
1458
|
let n = e.table;
|
|
1373
1459
|
return n === !1 ? !1 : n === !0 || n === void 0 || n[t] !== !1;
|
|
1374
1460
|
}
|
|
1375
|
-
function
|
|
1461
|
+
function Ur(e) {
|
|
1376
1462
|
return e === !1 ? !1 : e === !0 || e === void 0 ? { table: !1 } : {
|
|
1377
1463
|
...e,
|
|
1378
1464
|
table: !1
|
|
1379
1465
|
};
|
|
1380
1466
|
}
|
|
1381
|
-
function
|
|
1382
|
-
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(
|
|
1383
|
-
n[0] === c ? l = n[1] : (l =
|
|
1467
|
+
function Wr(e) {
|
|
1468
|
+
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(Vr), l;
|
|
1469
|
+
n[0] === c ? l = n[1] : (l = Hr(c, "copy"), n[0] = c, n[1] = l);
|
|
1384
1470
|
let u = l, d;
|
|
1385
|
-
n[2] === c ? d = n[3] : (d =
|
|
1471
|
+
n[2] === c ? d = n[3] : (d = Hr(c, "download"), n[2] = c, n[3] = d);
|
|
1386
1472
|
let f = d, p = !!(a || o), m = !!(u || f || s);
|
|
1387
1473
|
if (!r) return null;
|
|
1388
1474
|
let h;
|
|
1389
1475
|
n[4] === i ? h = n[5] : (h = k("my-4", i), n[4] = i, n[5] = h);
|
|
1390
1476
|
let g;
|
|
1391
|
-
n[6] !== s || n[7] !== o || n[8] !== m || n[9] !== p || n[10] !== u || n[11] !== f || n[12] !== a ? (g = (p || m) && /* @__PURE__ */ N(
|
|
1477
|
+
n[6] !== s || n[7] !== o || n[8] !== m || n[9] !== p || n[10] !== u || n[11] !== f || n[12] !== a ? (g = (p || m) && /* @__PURE__ */ N(q.Header, {
|
|
1392
1478
|
className: k(!p && "justify-end"),
|
|
1393
|
-
children: [p && /* @__PURE__ */ N(
|
|
1479
|
+
children: [p && /* @__PURE__ */ N(q.Heading, { children: [a && /* @__PURE__ */ M(q.Title, { children: a }), o && /* @__PURE__ */ M(q.Description, {
|
|
1394
1480
|
className: k(a && "mt-1"),
|
|
1395
1481
|
children: o
|
|
1396
|
-
})] }), m && /* @__PURE__ */ N(
|
|
1482
|
+
})] }), m && /* @__PURE__ */ N(q.Actions, {
|
|
1397
1483
|
"data-copy-exclude": "assistant-snapshot",
|
|
1398
1484
|
children: [
|
|
1399
|
-
u && /* @__PURE__ */ M(pt, { className:
|
|
1400
|
-
f && /* @__PURE__ */ M(mt, { className:
|
|
1485
|
+
u && /* @__PURE__ */ M(pt, { className: Or }),
|
|
1486
|
+
f && /* @__PURE__ */ M(mt, { className: Or }),
|
|
1401
1487
|
s
|
|
1402
1488
|
]
|
|
1403
1489
|
})]
|
|
@@ -1405,42 +1491,42 @@ function Rr(e) {
|
|
|
1405
1491
|
let _;
|
|
1406
1492
|
n[14] === Symbol.for("react.memo_cache_sentinel") ? (_ = k("overflow-hidden", "[&>[data-streamdown=table-wrapper]]:m-0 [&>[data-streamdown=table-wrapper]]:gap-0 [&>[data-streamdown=table-wrapper]]:rounded-none [&>[data-streamdown=table-wrapper]]:border-0 [&>[data-streamdown=table-wrapper]]:bg-transparent [&>[data-streamdown=table-wrapper]]:p-0", "[&>[data-streamdown=table-wrapper]>div:last-child]:rounded-none [&>[data-streamdown=table-wrapper]>div:last-child]:border-0", "[&_[data-streamdown=table]]:tabular-nums", "[&_[data-streamdown=table-header]]:bg-muted/30", "[&_[data-streamdown=table-header-cell]]:text-muted-foreground [&_[data-streamdown=table-header-cell]]:text-xs [&_[data-streamdown=table-header-cell]]:font-medium", "[&_[data-streamdown=table-cell]]:py-2", "[&_[data-streamdown=table-row]]:hover:bg-muted/30"), n[14] = _) : _ = n[14];
|
|
1407
1493
|
let v;
|
|
1408
|
-
n[15] === r ? v = n[16] : (v = /* @__PURE__ */ M(
|
|
1494
|
+
n[15] === r ? v = n[16] : (v = /* @__PURE__ */ M(q.Content, {
|
|
1409
1495
|
className: _,
|
|
1410
1496
|
children: r
|
|
1411
1497
|
}), n[15] = r, n[16] = v);
|
|
1412
1498
|
let y;
|
|
1413
|
-
return n[17] !== h || n[18] !== g || n[19] !== v ? (y = /* @__PURE__ */ N(
|
|
1499
|
+
return n[17] !== h || n[18] !== g || n[19] !== v ? (y = /* @__PURE__ */ N(q, {
|
|
1414
1500
|
"data-streamdown": "table-wrapper",
|
|
1415
1501
|
className: h,
|
|
1416
1502
|
children: [g, v]
|
|
1417
1503
|
}), n[17] = h, n[18] = g, n[19] = v, n[20] = y) : y = n[20], y;
|
|
1418
1504
|
}
|
|
1419
|
-
function
|
|
1505
|
+
function Gr(e) {
|
|
1420
1506
|
let t = O(43), n, r, i, a, o, s, c, l, u, d;
|
|
1421
1507
|
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);
|
|
1422
1508
|
let f;
|
|
1423
1509
|
bb0: {
|
|
1424
1510
|
if (!u) {
|
|
1425
|
-
f =
|
|
1511
|
+
f = Br;
|
|
1426
1512
|
break bb0;
|
|
1427
1513
|
}
|
|
1428
1514
|
let e;
|
|
1429
1515
|
t[11] === u ? e = t[12] : (e = [
|
|
1430
1516
|
...u,
|
|
1431
1517
|
ct,
|
|
1432
|
-
|
|
1518
|
+
zr
|
|
1433
1519
|
], t[11] = u, t[12] = e), f = e;
|
|
1434
1520
|
}
|
|
1435
1521
|
let p = f, m;
|
|
1436
1522
|
t[13] === r ? m = t[14] : (m = {
|
|
1437
1523
|
...r,
|
|
1438
|
-
[
|
|
1524
|
+
[Er]: Dr
|
|
1439
1525
|
}, t[13] = r, t[14] = m);
|
|
1440
1526
|
let h = m, g;
|
|
1441
1527
|
t[15] === a ? g = t[16] : (g = {
|
|
1442
1528
|
...a,
|
|
1443
|
-
[
|
|
1529
|
+
[Er]: Wr
|
|
1444
1530
|
}, t[15] = a, t[16] = g);
|
|
1445
1531
|
let _ = g, v;
|
|
1446
1532
|
t[17] !== o || t[18] !== d ? (v = {
|
|
@@ -1453,8 +1539,8 @@ function zr(e) {
|
|
|
1453
1539
|
b = n;
|
|
1454
1540
|
break bb1;
|
|
1455
1541
|
}
|
|
1456
|
-
let e = n ??
|
|
1457
|
-
t[20] === e ? r = t[21] : (r =
|
|
1542
|
+
let e = n ?? Ir, r;
|
|
1543
|
+
t[20] === e ? r = t[21] : (r = Lr(e), t[20] = e, t[21] = r), b = r;
|
|
1458
1544
|
}
|
|
1459
1545
|
let x = b, S;
|
|
1460
1546
|
bb2: {
|
|
@@ -1463,12 +1549,12 @@ function zr(e) {
|
|
|
1463
1549
|
break bb2;
|
|
1464
1550
|
}
|
|
1465
1551
|
let e;
|
|
1466
|
-
t[22] !== i || t[23] !== s ? (e =
|
|
1552
|
+
t[22] !== i || t[23] !== s ? (e = Fr(i) ?? s, t[22] = i, t[23] = s, t[24] = e) : e = t[24], S = e;
|
|
1467
1553
|
}
|
|
1468
1554
|
let C = S, w;
|
|
1469
|
-
t[25] === o ? w = t[26] : (w =
|
|
1555
|
+
t[25] === o ? w = t[26] : (w = Ur(o), t[25] = o, t[26] = w);
|
|
1470
1556
|
let T;
|
|
1471
|
-
t[27] !== i || t[28] !== h ? (T =
|
|
1557
|
+
t[27] !== i || t[28] !== h ? (T = mr(i, Object.keys(h)), t[27] = i, t[28] = h, t[29] = T) : T = t[29];
|
|
1472
1558
|
let E;
|
|
1473
1559
|
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, {
|
|
1474
1560
|
allowedTags: h,
|
|
@@ -1477,20 +1563,20 @@ function zr(e) {
|
|
|
1477
1563
|
controls: w,
|
|
1478
1564
|
dir: C,
|
|
1479
1565
|
mode: c,
|
|
1480
|
-
parseMarkdownIntoBlocksFn:
|
|
1566
|
+
parseMarkdownIntoBlocksFn: Ar,
|
|
1481
1567
|
remarkPlugins: p,
|
|
1482
1568
|
...l,
|
|
1483
1569
|
children: T
|
|
1484
1570
|
}), 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];
|
|
1485
1571
|
let D;
|
|
1486
|
-
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(
|
|
1572
|
+
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(Vr, {
|
|
1487
1573
|
value: y,
|
|
1488
1574
|
children: E
|
|
1489
1575
|
}), t[40] = E, t[41] = y, t[42] = D) : D = t[42], D;
|
|
1490
1576
|
}
|
|
1491
1577
|
//#endregion
|
|
1492
1578
|
//#region src/lib/elements/Response.tsx
|
|
1493
|
-
var
|
|
1579
|
+
var Kr = class extends t.Component {
|
|
1494
1580
|
state = {
|
|
1495
1581
|
hasError: !1,
|
|
1496
1582
|
error: null
|
|
@@ -1507,22 +1593,22 @@ var Br = class extends t.Component {
|
|
|
1507
1593
|
children: ["Failed to render content: ", this.state.error?.message]
|
|
1508
1594
|
}) : this.props.children;
|
|
1509
1595
|
}
|
|
1510
|
-
},
|
|
1596
|
+
}, J = c((e) => {
|
|
1511
1597
|
let t = O(8), n, r;
|
|
1512
1598
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1513
1599
|
let i;
|
|
1514
1600
|
t[3] === n ? i = t[4] : (i = k("flex size-full flex-col gap-2 space-y-0 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", n), t[3] = n, t[4] = i);
|
|
1515
1601
|
let a;
|
|
1516
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(
|
|
1602
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(Kr, { children: /* @__PURE__ */ M(Gr, {
|
|
1517
1603
|
className: i,
|
|
1518
1604
|
dir: "auto",
|
|
1519
1605
|
...r
|
|
1520
1606
|
}) }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1521
1607
|
});
|
|
1522
|
-
|
|
1608
|
+
J.displayName = "Response";
|
|
1523
1609
|
//#endregion
|
|
1524
1610
|
//#region src/lib/ui/use-copy-feedback.ts
|
|
1525
|
-
function
|
|
1611
|
+
function qr(e) {
|
|
1526
1612
|
let t = O(9), n = e === void 0 ? 2e3 : e, r = St(), [i, a] = g(!1), o = h(null), s, c;
|
|
1527
1613
|
t[0] === r ? (s = t[1], c = t[2]) : (s = () => () => {
|
|
1528
1614
|
o.current && r.clearTimeout(o.current);
|
|
@@ -1536,13 +1622,13 @@ function Vr(e) {
|
|
|
1536
1622
|
}
|
|
1537
1623
|
//#endregion
|
|
1538
1624
|
//#region src/lib/elements/code-block.tsx
|
|
1539
|
-
var
|
|
1625
|
+
var Jr = o({ code: "" }), Yr = (e) => {
|
|
1540
1626
|
let t = O(24), n, r, i, a, o, s;
|
|
1541
1627
|
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);
|
|
1542
1628
|
let c = o !== void 0 && o, l = s !== void 0 && s, u = Pe(r, i), d;
|
|
1543
1629
|
t[7] === r ? d = t[8] : (d = { code: r }, t[7] = r, t[8] = d);
|
|
1544
1630
|
let f;
|
|
1545
|
-
t[9] === u ? f = t[10] : (f = u.map(
|
|
1631
|
+
t[9] === u ? f = t[10] : (f = u.map(Zr), t[9] = u, t[10] = f);
|
|
1546
1632
|
let p;
|
|
1547
1633
|
t[11] !== c || t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Te, {
|
|
1548
1634
|
lineNumbers: c,
|
|
@@ -1558,12 +1644,12 @@ var Hr = o({ code: "" }), Ur = (e) => {
|
|
|
1558
1644
|
children: [p, m]
|
|
1559
1645
|
}), t[17] = a, t[18] = p, t[19] = m, t[20] = h) : h = t[20];
|
|
1560
1646
|
let g;
|
|
1561
|
-
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(
|
|
1647
|
+
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(Jr, {
|
|
1562
1648
|
value: d,
|
|
1563
1649
|
children: h
|
|
1564
1650
|
}), t[21] = d, t[22] = h, t[23] = g) : g = t[23], g;
|
|
1565
|
-
},
|
|
1566
|
-
let [o, s] =
|
|
1651
|
+
}, Xr = ({ onCopy: e, onError: t, timeout: n = 2e3, children: r, className: i, ...a }) => {
|
|
1652
|
+
let [o, s] = qr(n), { code: c } = l(Jr), u = async () => {
|
|
1567
1653
|
if (typeof window > "u" || !navigator.clipboard.writeText) {
|
|
1568
1654
|
t?.(/* @__PURE__ */ Error("Clipboard API not available"));
|
|
1569
1655
|
return;
|
|
@@ -1583,12 +1669,12 @@ var Hr = o({ code: "" }), Ur = (e) => {
|
|
|
1583
1669
|
children: r ?? /* @__PURE__ */ M(d, {})
|
|
1584
1670
|
});
|
|
1585
1671
|
};
|
|
1586
|
-
function
|
|
1672
|
+
function Zr(e, t) {
|
|
1587
1673
|
return /* @__PURE__ */ M(Ee, { children: e }, t);
|
|
1588
1674
|
}
|
|
1589
1675
|
//#endregion
|
|
1590
1676
|
//#region src/lib/elements/Tool.tsx
|
|
1591
|
-
var
|
|
1677
|
+
var Qr = (e) => {
|
|
1592
1678
|
let t = O(8), n, r;
|
|
1593
1679
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1594
1680
|
let i;
|
|
@@ -1598,7 +1684,7 @@ var Kr = (e) => {
|
|
|
1598
1684
|
className: i,
|
|
1599
1685
|
...r
|
|
1600
1686
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1601
|
-
},
|
|
1687
|
+
}, $r = (e) => /* @__PURE__ */ N(me, {
|
|
1602
1688
|
className: "gap-1.5 rounded-full text-xs",
|
|
1603
1689
|
variant: "secondary",
|
|
1604
1690
|
children: [{
|
|
@@ -1618,7 +1704,7 @@ var Kr = (e) => {
|
|
|
1618
1704
|
"output-error": "Error",
|
|
1619
1705
|
"output-denied": "Denied"
|
|
1620
1706
|
}[e]]
|
|
1621
|
-
}),
|
|
1707
|
+
}), ei = (e) => {
|
|
1622
1708
|
let t = O(23), n, r, i, a;
|
|
1623
1709
|
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);
|
|
1624
1710
|
let o;
|
|
@@ -1633,7 +1719,7 @@ var Kr = (e) => {
|
|
|
1633
1719
|
children: c
|
|
1634
1720
|
}), t[11] = c, t[12] = l);
|
|
1635
1721
|
let u;
|
|
1636
|
-
t[13] === r.state ? u = t[14] : (u =
|
|
1722
|
+
t[13] === r.state ? u = t[14] : (u = $r(r.state), t[13] = r.state, t[14] = u);
|
|
1637
1723
|
let d;
|
|
1638
1724
|
t[15] !== l || t[16] !== u ? (d = /* @__PURE__ */ N("div", {
|
|
1639
1725
|
className: "flex items-center gap-2",
|
|
@@ -1651,7 +1737,7 @@ var Kr = (e) => {
|
|
|
1651
1737
|
...i,
|
|
1652
1738
|
children: [d, f]
|
|
1653
1739
|
}), t[19] = i, t[20] = o, t[21] = d, t[22] = p) : p = t[22], p;
|
|
1654
|
-
},
|
|
1740
|
+
}, ti = (e) => {
|
|
1655
1741
|
let t = O(8), n, r;
|
|
1656
1742
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1657
1743
|
let i;
|
|
@@ -1661,7 +1747,7 @@ var Kr = (e) => {
|
|
|
1661
1747
|
className: i,
|
|
1662
1748
|
...r
|
|
1663
1749
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1664
|
-
},
|
|
1750
|
+
}, ni = (e) => {
|
|
1665
1751
|
let t = O(15), n, r, i;
|
|
1666
1752
|
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);
|
|
1667
1753
|
let a;
|
|
@@ -1676,7 +1762,7 @@ var Kr = (e) => {
|
|
|
1676
1762
|
let c;
|
|
1677
1763
|
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M("div", {
|
|
1678
1764
|
className: "bg-muted/50 rounded-md",
|
|
1679
|
-
children: /* @__PURE__ */ M(
|
|
1765
|
+
children: /* @__PURE__ */ M(Yr, {
|
|
1680
1766
|
code: s,
|
|
1681
1767
|
language: "json"
|
|
1682
1768
|
})
|
|
@@ -1687,7 +1773,7 @@ var Kr = (e) => {
|
|
|
1687
1773
|
...i,
|
|
1688
1774
|
children: [o, c]
|
|
1689
1775
|
}), t[11] = i, t[12] = a, t[13] = c, t[14] = l) : l = t[14], l;
|
|
1690
|
-
},
|
|
1776
|
+
}, ri = (e) => {
|
|
1691
1777
|
let t = O(24), n, r, i, a;
|
|
1692
1778
|
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;
|
|
1693
1779
|
let o;
|
|
@@ -1702,7 +1788,7 @@ var Kr = (e) => {
|
|
|
1702
1788
|
let d;
|
|
1703
1789
|
t[11] === r ? d = t[12] : (d = r && /* @__PURE__ */ M("div", { children: r }), t[11] = r, t[12] = d);
|
|
1704
1790
|
let f;
|
|
1705
|
-
t[13] === i ? f = t[14] : (f =
|
|
1791
|
+
t[13] === i ? f = t[14] : (f = ii(i), t[13] = i, t[14] = f);
|
|
1706
1792
|
let p;
|
|
1707
1793
|
t[15] !== u || t[16] !== d || t[17] !== f ? (p = /* @__PURE__ */ N("div", {
|
|
1708
1794
|
className: u,
|
|
@@ -1715,106 +1801,106 @@ var Kr = (e) => {
|
|
|
1715
1801
|
children: [c, p]
|
|
1716
1802
|
}), t[19] = a, t[20] = o, t[21] = c, t[22] = p, t[23] = m) : m = t[23], m;
|
|
1717
1803
|
};
|
|
1718
|
-
function
|
|
1719
|
-
return typeof e == "string" ? /* @__PURE__ */ M(
|
|
1804
|
+
function ii(e) {
|
|
1805
|
+
return typeof e == "string" ? /* @__PURE__ */ M(Yr, {
|
|
1720
1806
|
code: e,
|
|
1721
1807
|
language: "json"
|
|
1722
|
-
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(
|
|
1808
|
+
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(Yr, {
|
|
1723
1809
|
code: JSON.stringify(e, null, 2),
|
|
1724
1810
|
language: "json"
|
|
1725
1811
|
}) : typeof e == "number" || typeof e == "bigint" ? /* @__PURE__ */ M("div", { children: e }) : /* @__PURE__ */ M("div", {});
|
|
1726
1812
|
}
|
|
1727
1813
|
//#endregion
|
|
1728
1814
|
//#region src/lib/components/tool-debug.tsx
|
|
1729
|
-
function
|
|
1815
|
+
function ai(e) {
|
|
1730
1816
|
let t = O(20), { part: n } = e, r;
|
|
1731
1817
|
t[0] === n ? r = t[1] : (r = b(n), t[0] = n, t[1] = r);
|
|
1732
1818
|
let i = `Executing ${r}`, a;
|
|
1733
|
-
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(
|
|
1819
|
+
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(ei, {
|
|
1734
1820
|
title: i,
|
|
1735
1821
|
part: n
|
|
1736
1822
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4];
|
|
1737
1823
|
let o;
|
|
1738
|
-
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(
|
|
1824
|
+
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(ni, { input: n.input }), t[5] = n.input, t[6] = o);
|
|
1739
1825
|
let s;
|
|
1740
1826
|
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);
|
|
1741
1827
|
let c;
|
|
1742
|
-
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M(
|
|
1828
|
+
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M(J, {
|
|
1743
1829
|
className: "break-all",
|
|
1744
1830
|
children: s
|
|
1745
1831
|
}), t[9] = s, t[10] = c);
|
|
1746
1832
|
let l;
|
|
1747
|
-
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(
|
|
1833
|
+
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(ri, {
|
|
1748
1834
|
output: c,
|
|
1749
1835
|
errorText: n.errorText
|
|
1750
1836
|
}), t[11] = n.errorText, t[12] = c, t[13] = l) : l = t[13];
|
|
1751
1837
|
let u;
|
|
1752
|
-
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(
|
|
1838
|
+
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(ti, { children: [o, l] }), t[14] = o, t[15] = l, t[16] = u) : u = t[16];
|
|
1753
1839
|
let d;
|
|
1754
|
-
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(
|
|
1840
|
+
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(Qr, {
|
|
1755
1841
|
"data-copy-exclude": "assistant-snapshot",
|
|
1756
1842
|
children: [a, u]
|
|
1757
1843
|
}), t[17] = a, t[18] = u, t[19] = d) : d = t[19], d;
|
|
1758
1844
|
}
|
|
1759
|
-
function
|
|
1845
|
+
function oi(e) {
|
|
1760
1846
|
let t = O(18), { part: n } = e, r = `Executing ${n.toolName}`, i;
|
|
1761
|
-
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
1847
|
+
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(ei, {
|
|
1762
1848
|
title: r,
|
|
1763
1849
|
part: n
|
|
1764
1850
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
1765
1851
|
let a;
|
|
1766
|
-
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
1852
|
+
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(ni, { input: n.input }), t[3] = n.input, t[4] = a);
|
|
1767
1853
|
let o;
|
|
1768
1854
|
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);
|
|
1769
1855
|
let s;
|
|
1770
|
-
t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M(
|
|
1856
|
+
t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M(J, {
|
|
1771
1857
|
className: "break-all",
|
|
1772
1858
|
children: o
|
|
1773
1859
|
}), t[7] = o, t[8] = s);
|
|
1774
1860
|
let c;
|
|
1775
|
-
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(
|
|
1861
|
+
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(ri, {
|
|
1776
1862
|
output: s,
|
|
1777
1863
|
errorText: n.errorText
|
|
1778
1864
|
}), t[9] = n.errorText, t[10] = s, t[11] = c) : c = t[11];
|
|
1779
1865
|
let l;
|
|
1780
|
-
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(
|
|
1866
|
+
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(ti, { children: [a, c] }), t[12] = a, t[13] = c, t[14] = l) : l = t[14];
|
|
1781
1867
|
let u;
|
|
1782
|
-
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(
|
|
1868
|
+
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(Qr, {
|
|
1783
1869
|
"data-copy-exclude": "assistant-snapshot",
|
|
1784
1870
|
children: [i, l]
|
|
1785
1871
|
}), t[15] = i, t[16] = l, t[17] = u) : u = t[17], u;
|
|
1786
1872
|
}
|
|
1787
1873
|
//#endregion
|
|
1788
1874
|
//#region src/lib/copy/copy-image.ts
|
|
1789
|
-
var
|
|
1875
|
+
var si = "data-copy-exclude", ci = {
|
|
1790
1876
|
image: "image",
|
|
1791
1877
|
assistantSnapshot: "assistant-snapshot"
|
|
1792
1878
|
};
|
|
1793
|
-
function
|
|
1879
|
+
function li(e) {
|
|
1794
1880
|
return typeof e == "object" && !!e && "getAttribute" in e && typeof e.getAttribute == "function";
|
|
1795
1881
|
}
|
|
1796
|
-
function
|
|
1797
|
-
if (!
|
|
1798
|
-
let n = e.getAttribute(
|
|
1882
|
+
function ui(e, t) {
|
|
1883
|
+
if (!li(e)) return !1;
|
|
1884
|
+
let n = e.getAttribute(si);
|
|
1799
1885
|
return n ? n.split(/\s+/).includes(t) : !1;
|
|
1800
1886
|
}
|
|
1801
|
-
function
|
|
1802
|
-
return !
|
|
1887
|
+
function di(e, t) {
|
|
1888
|
+
return !ui(e, t);
|
|
1803
1889
|
}
|
|
1804
|
-
function
|
|
1890
|
+
function fi({ clipboard: e, ClipboardItem: t }) {
|
|
1805
1891
|
return typeof e?.write == "function" && typeof t == "function" ? "image" : typeof e?.writeText == "function" ? "text" : "none";
|
|
1806
1892
|
}
|
|
1807
1893
|
//#endregion
|
|
1808
1894
|
//#region src/lib/copy/snapshot-context.ts
|
|
1809
|
-
var
|
|
1895
|
+
var pi = o(!1);
|
|
1810
1896
|
//#endregion
|
|
1811
1897
|
//#region src/lib/copy/snapshot-render.tsx
|
|
1812
|
-
function
|
|
1898
|
+
function mi() {
|
|
1813
1899
|
return new Promise((e) => {
|
|
1814
1900
|
requestAnimationFrame(() => e());
|
|
1815
1901
|
});
|
|
1816
1902
|
}
|
|
1817
|
-
function
|
|
1903
|
+
function hi(e) {
|
|
1818
1904
|
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;
|
|
1819
1905
|
if (typeof document > "u") return null;
|
|
1820
1906
|
let u;
|
|
@@ -1835,7 +1921,7 @@ function li(e) {
|
|
|
1835
1921
|
return t[4] !== r || t[5] !== l || t[6] !== n || t[7] !== d ? (f = Ct(/* @__PURE__ */ M("div", {
|
|
1836
1922
|
"aria-hidden": "true",
|
|
1837
1923
|
style: u,
|
|
1838
|
-
children: /* @__PURE__ */ M(
|
|
1924
|
+
children: /* @__PURE__ */ M(pi, {
|
|
1839
1925
|
value: !0,
|
|
1840
1926
|
children: /* @__PURE__ */ M("div", {
|
|
1841
1927
|
ref: n,
|
|
@@ -1848,13 +1934,13 @@ function li(e) {
|
|
|
1848
1934
|
}
|
|
1849
1935
|
//#endregion
|
|
1850
1936
|
//#region src/lib/copy/use-copy-element-as-image.ts
|
|
1851
|
-
function
|
|
1937
|
+
function gi(e) {
|
|
1852
1938
|
let t = getComputedStyle(e).backgroundColor;
|
|
1853
1939
|
if (t !== "rgba(0, 0, 0, 0)") return t;
|
|
1854
1940
|
let n = getComputedStyle(document.body).backgroundColor;
|
|
1855
1941
|
return n === "rgba(0, 0, 0, 0)" ? void 0 : n;
|
|
1856
1942
|
}
|
|
1857
|
-
function
|
|
1943
|
+
function _i({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
1858
1944
|
let r = St(), [i, a] = g(!1), [o, s] = g(null), c = h(null), l = u(() => {
|
|
1859
1945
|
c.current !== null && (r.clearTimeout(c.current), c.current = null);
|
|
1860
1946
|
}, [r]), f = u((e) => {
|
|
@@ -1871,9 +1957,9 @@ function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1871
1957
|
}), !0), [n, f]), m = u(async () => {
|
|
1872
1958
|
if (!e.current) throw Error("Nothing is ready to copy yet.");
|
|
1873
1959
|
let { toBlob: n } = await import("html-to-image"), r = await n(e.current, {
|
|
1874
|
-
backgroundColor:
|
|
1960
|
+
backgroundColor: gi(e.current),
|
|
1875
1961
|
pixelRatio: 2,
|
|
1876
|
-
filter: (e) =>
|
|
1962
|
+
filter: (e) => di(e, t)
|
|
1877
1963
|
});
|
|
1878
1964
|
if (!r) throw Error("Unable to render the image for copying.");
|
|
1879
1965
|
await navigator.clipboard.write([new ClipboardItem({ [r.type]: r })]), f({
|
|
@@ -1889,7 +1975,7 @@ function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1889
1975
|
copy: u(async () => {
|
|
1890
1976
|
a(!0), s(null);
|
|
1891
1977
|
try {
|
|
1892
|
-
let e =
|
|
1978
|
+
let e = fi({
|
|
1893
1979
|
clipboard: typeof navigator > "u" ? void 0 : navigator.clipboard,
|
|
1894
1980
|
ClipboardItem: typeof window > "u" ? void 0 : window.ClipboardItem
|
|
1895
1981
|
});
|
|
@@ -1924,34 +2010,34 @@ function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1924
2010
|
}
|
|
1925
2011
|
//#endregion
|
|
1926
2012
|
//#region src/lib/copy/assistant-snapshot.tsx
|
|
1927
|
-
var
|
|
1928
|
-
function
|
|
1929
|
-
return e.split(
|
|
2013
|
+
var vi = /<\/?[a-z][\w]*-[\w-]*(?:\s+[^\s"'>/=]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*\/?>/gi, yi = /(```[\s\S]*?```|`[^`\n]+`)/;
|
|
2014
|
+
function bi(e) {
|
|
2015
|
+
return e.split(yi).map((e, t) => t % 2 == 1 ? e : e.replace(vi, "\0").replace(/ \0(?= )/g, "").replaceAll("\0", "")).join("");
|
|
1930
2016
|
}
|
|
1931
|
-
function
|
|
1932
|
-
let t =
|
|
2017
|
+
function xi(e) {
|
|
2018
|
+
let t = nn(e), n = e.parts.filter(C).map((e) => bi(tn(e.text, V(e.citations)).reverse().reduce((e, { at: n, citation: r }) => `${e.slice(0, n)}[${rn(t, r.source.url)}]${e.slice(n)}`, e.text))).join("\n");
|
|
1933
2019
|
return t.length === 0 ? n : `${n}\n\n${t.map(({ url: e, title: t }, n) => `[${n + 1}] ${t ? `${t} — ` : ""}${e}`).join("\n")}`;
|
|
1934
2020
|
}
|
|
1935
|
-
function
|
|
1936
|
-
return l(
|
|
2021
|
+
function Y() {
|
|
2022
|
+
return l(pi);
|
|
1937
2023
|
}
|
|
1938
|
-
function
|
|
2024
|
+
function Si(e) {
|
|
1939
2025
|
let t = O(30), { message: n, renderContent: r, className: i } = e, a = h(null), [o, s] = g(!1), c;
|
|
1940
|
-
t[0] === n ? c = t[1] : (c =
|
|
2026
|
+
t[0] === n ? c = t[1] : (c = xi(n), t[0] = n, t[1] = c);
|
|
1941
2027
|
let l = c, u;
|
|
1942
2028
|
t[2] === l ? u = t[3] : (u = {
|
|
1943
2029
|
elementRef: a,
|
|
1944
|
-
excludeMode:
|
|
2030
|
+
excludeMode: ci.assistantSnapshot,
|
|
1945
2031
|
fallbackText: l
|
|
1946
2032
|
}, t[2] = l, t[3] = u);
|
|
1947
|
-
let { copy: d, feedback: f, isCopying: p } =
|
|
2033
|
+
let { copy: d, feedback: f, isCopying: p } = _i(u), m;
|
|
1948
2034
|
t[4] !== d || t[5] !== o ? (m = async () => {
|
|
1949
|
-
o || s(!0), await
|
|
2035
|
+
o || s(!0), await mi(), await d();
|
|
1950
2036
|
}, t[4] = d, t[5] = o, t[6] = m) : m = t[6];
|
|
1951
2037
|
let _ = m, v = "Copy snapshot";
|
|
1952
2038
|
p ? v = "Copying snapshot" : f?.kind === "success" && (v = f.mode === "image" ? "Copied snapshot" : "Copied text");
|
|
1953
2039
|
let y;
|
|
1954
|
-
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(
|
|
2040
|
+
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(hi, {
|
|
1955
2041
|
contentRef: a,
|
|
1956
2042
|
children: r()
|
|
1957
2043
|
}), t[7] = r, t[8] = o, t[9] = y) : y = t[9];
|
|
@@ -1987,41 +2073,41 @@ function gi(e) {
|
|
|
1987
2073
|
}
|
|
1988
2074
|
//#endregion
|
|
1989
2075
|
//#region src/lib/tools/helpers.ts
|
|
1990
|
-
function
|
|
2076
|
+
function Ci(e) {
|
|
1991
2077
|
return w(e) && e.toolMetadata?.kind === "subagent";
|
|
1992
2078
|
}
|
|
1993
|
-
function
|
|
2079
|
+
function wi(e) {
|
|
1994
2080
|
let t = e.toolMetadata?.displayName;
|
|
1995
2081
|
return typeof t == "string" ? t : "Subagent";
|
|
1996
2082
|
}
|
|
1997
|
-
function
|
|
2083
|
+
function Ti(e, t) {
|
|
1998
2084
|
let n = y(e);
|
|
1999
2085
|
return {
|
|
2000
2086
|
toolKey: n,
|
|
2001
2087
|
toolEntry: t?.[n]
|
|
2002
2088
|
};
|
|
2003
2089
|
}
|
|
2004
|
-
function
|
|
2090
|
+
function Ei(e, t) {
|
|
2005
2091
|
return e?.static === !1 && !!e?.requiresUserInput && t === "input-available";
|
|
2006
2092
|
}
|
|
2007
2093
|
//#endregion
|
|
2008
2094
|
//#region src/lib/chat/markdown-paragraph.tsx
|
|
2009
|
-
var
|
|
2010
|
-
function
|
|
2095
|
+
var Di = /* @__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("."));
|
|
2096
|
+
function Oi(e) {
|
|
2011
2097
|
if (!n.isValidElement(e)) return !1;
|
|
2012
2098
|
let t = typeof e.type == "string" ? e.type : e.props.node?.tagName;
|
|
2013
|
-
return t === void 0 || !
|
|
2099
|
+
return t === void 0 || !Di.has(t);
|
|
2014
2100
|
}
|
|
2015
|
-
function
|
|
2101
|
+
function ki(e) {
|
|
2016
2102
|
let t = O(6), { children: r, dir: i } = e, a = n.Children.toArray(r);
|
|
2017
|
-
if (!a.some(
|
|
2103
|
+
if (!a.some(Oi)) {
|
|
2018
2104
|
let e;
|
|
2019
2105
|
return t[0] !== r || t[1] !== i ? (e = /* @__PURE__ */ M("p", {
|
|
2020
2106
|
dir: i,
|
|
2021
2107
|
children: r
|
|
2022
2108
|
}), t[0] = r, t[1] = i, t[2] = e) : e = t[2], e;
|
|
2023
2109
|
}
|
|
2024
|
-
if (a.every(
|
|
2110
|
+
if (a.every(Oi)) return r;
|
|
2025
2111
|
let o;
|
|
2026
2112
|
return t[3] !== r || t[4] !== i ? (o = /* @__PURE__ */ M("div", {
|
|
2027
2113
|
dir: i,
|
|
@@ -2030,35 +2116,35 @@ function Ci(e) {
|
|
|
2030
2116
|
}
|
|
2031
2117
|
//#endregion
|
|
2032
2118
|
//#region src/lib/components/InteractiveResponse.tsx
|
|
2033
|
-
var
|
|
2119
|
+
var Ai = { p: ({ children: e, dir: t }) => /* @__PURE__ */ M(ki, {
|
|
2034
2120
|
dir: t,
|
|
2035
2121
|
children: e
|
|
2036
2122
|
}) };
|
|
2037
|
-
function
|
|
2038
|
-
let t = { ...
|
|
2123
|
+
function ji(e) {
|
|
2124
|
+
let t = { ...Ai }, n = {};
|
|
2039
2125
|
for (let r of e) ae(r), t[r.name] = r.component, n[r.name] = r.allowedAttributes;
|
|
2040
2126
|
return {
|
|
2041
2127
|
components: t,
|
|
2042
2128
|
allowedTags: n
|
|
2043
2129
|
};
|
|
2044
2130
|
}
|
|
2045
|
-
function
|
|
2131
|
+
function Mi(e) {
|
|
2046
2132
|
let t = O(10), n, r;
|
|
2047
2133
|
t[0] === e ? (n = t[1], r = t[2]) : ({elements: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
2048
2134
|
let i;
|
|
2049
2135
|
t[3] === n ? i = t[4] : (i = n ?? [], t[3] = n, t[4] = i);
|
|
2050
2136
|
let a;
|
|
2051
|
-
t[5] === i ? a = t[6] : (a =
|
|
2137
|
+
t[5] === i ? a = t[6] : (a = ji(i), t[5] = i, t[6] = a);
|
|
2052
2138
|
let o = a, s;
|
|
2053
|
-
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(
|
|
2139
|
+
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(J, {
|
|
2054
2140
|
...o,
|
|
2055
2141
|
...r
|
|
2056
2142
|
}), t[7] = r, t[8] = o, t[9] = s) : s = t[9], s;
|
|
2057
2143
|
}
|
|
2058
2144
|
//#endregion
|
|
2059
2145
|
//#region src/lib/renderers/render-part.tsx
|
|
2060
|
-
function
|
|
2061
|
-
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } =
|
|
2146
|
+
function Ni(e) {
|
|
2147
|
+
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } = $t();
|
|
2062
2148
|
if (n.state !== "approval-requested") return null;
|
|
2063
2149
|
let i;
|
|
2064
2150
|
t[0] === n ? i = t[1] : (i = n.title ?? y(n), t[0] = n, t[1] = i);
|
|
@@ -2110,21 +2196,21 @@ function Di(e) {
|
|
|
2110
2196
|
children: [l, f]
|
|
2111
2197
|
}), t[18] = o, t[19] = l, t[20] = f, t[21] = p) : p = t[21], p;
|
|
2112
2198
|
}
|
|
2113
|
-
function
|
|
2199
|
+
function Pi(e) {
|
|
2114
2200
|
let t = O(25), { part: n } = e, { registry: r } = z();
|
|
2115
2201
|
if (n.input === void 0) {
|
|
2116
2202
|
let e;
|
|
2117
|
-
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(
|
|
2203
|
+
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(ri, {
|
|
2118
2204
|
output: n.output,
|
|
2119
2205
|
errorText: n.errorText
|
|
2120
2206
|
}) : /* @__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;
|
|
2121
2207
|
}
|
|
2122
2208
|
let i;
|
|
2123
|
-
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(
|
|
2209
|
+
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(Ni, { part: n }), t[4] = n, t[5] = i);
|
|
2124
2210
|
let a = i;
|
|
2125
2211
|
if (!r) return a;
|
|
2126
2212
|
let o;
|
|
2127
|
-
t[6] !== n || t[7] !== r ? (o =
|
|
2213
|
+
t[6] !== n || t[7] !== r ? (o = Ti(n, r), t[6] = n, t[7] = r, t[8] = o) : o = t[8];
|
|
2128
2214
|
let { toolEntry: s } = o;
|
|
2129
2215
|
if (s) {
|
|
2130
2216
|
let e = s.component, i;
|
|
@@ -2149,8 +2235,8 @@ function Oi(e) {
|
|
|
2149
2235
|
}
|
|
2150
2236
|
//#endregion
|
|
2151
2237
|
//#region src/lib/chat/message-parts.tsx
|
|
2152
|
-
var
|
|
2153
|
-
function
|
|
2238
|
+
var Fi = { animation: "slideUp" };
|
|
2239
|
+
function Ii(e) {
|
|
2154
2240
|
let t = O(3), { filename: n, url: r } = e, i = n ?? "Attached image", a;
|
|
2155
2241
|
return t[0] !== i || t[1] !== r ? (a = /* @__PURE__ */ M("img", {
|
|
2156
2242
|
src: r,
|
|
@@ -2158,7 +2244,7 @@ function Ai(e) {
|
|
|
2158
2244
|
className: "max-h-64 rounded-md border object-contain"
|
|
2159
2245
|
}), t[0] = i, t[1] = r, t[2] = a) : a = t[2], a;
|
|
2160
2246
|
}
|
|
2161
|
-
function
|
|
2247
|
+
function Li(e) {
|
|
2162
2248
|
let t = O(16), { filename: n, mediaType: r, url: i } = e, a = n || "Untitled", o;
|
|
2163
2249
|
t[0] !== r || t[1] !== a || t[2] !== i ? (o = i?.startsWith("data:") ? null : i && r.startsWith("video/") ? /* @__PURE__ */ M("video", {
|
|
2164
2250
|
controls: !0,
|
|
@@ -2204,27 +2290,27 @@ function ji(e) {
|
|
|
2204
2290
|
children: [s, d]
|
|
2205
2291
|
}), t[13] = s, t[14] = d, t[15] = f) : f = t[15], f;
|
|
2206
2292
|
}
|
|
2207
|
-
function
|
|
2293
|
+
function Ri(e) {
|
|
2208
2294
|
let t = O(4), { filename: n, mediaType: r, url: i } = e, a;
|
|
2209
|
-
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(
|
|
2295
|
+
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(Ii, {
|
|
2210
2296
|
filename: n,
|
|
2211
2297
|
url: i
|
|
2212
|
-
}) : /* @__PURE__ */ M(
|
|
2298
|
+
}) : /* @__PURE__ */ M(Li, {
|
|
2213
2299
|
filename: n,
|
|
2214
2300
|
mediaType: r,
|
|
2215
2301
|
url: i
|
|
2216
2302
|
}), t[0] = n, t[1] = r, t[2] = i, t[3] = a) : a = t[3], a;
|
|
2217
2303
|
}
|
|
2218
|
-
var
|
|
2219
|
-
function
|
|
2220
|
-
return
|
|
2304
|
+
var zi = "genai-citation";
|
|
2305
|
+
function Bi(e, t) {
|
|
2306
|
+
return tn(e, t).reverse().reduce((e, { at: t, order: n }) => `${e.slice(0, t)}<${zi} citation="${n}" />${e.slice(t)}`, e);
|
|
2221
2307
|
}
|
|
2222
|
-
var
|
|
2223
|
-
function
|
|
2224
|
-
let t = O(16), n = l(
|
|
2308
|
+
var Vi = o(null);
|
|
2309
|
+
function Hi(e) {
|
|
2310
|
+
let t = O(16), n = l(Vi), r = n?.citations[Number(e.citation)];
|
|
2225
2311
|
if (!n || !r) return null;
|
|
2226
2312
|
let i;
|
|
2227
|
-
t[0] !== r.source.url || t[1] !== n.sources ? (i =
|
|
2313
|
+
t[0] !== r.source.url || t[1] !== n.sources ? (i = rn(n.sources, r.source.url), t[0] = r.source.url, t[1] = n.sources, t[2] = i) : i = t[2];
|
|
2228
2314
|
let a = i;
|
|
2229
2315
|
if (a === null) return null;
|
|
2230
2316
|
if (n.HostCitation) {
|
|
@@ -2245,22 +2331,22 @@ function Ii(e) {
|
|
|
2245
2331
|
children: r.citedText
|
|
2246
2332
|
}) : null, t[10] = r.citedText, t[11] = s);
|
|
2247
2333
|
let c;
|
|
2248
|
-
return t[12] !== a || t[13] !== o || t[14] !== s ? (c = /* @__PURE__ */ M(
|
|
2334
|
+
return t[12] !== a || t[13] !== o || t[14] !== s ? (c = /* @__PURE__ */ M(rr, {
|
|
2249
2335
|
source: o,
|
|
2250
2336
|
index: a,
|
|
2251
2337
|
children: s
|
|
2252
2338
|
}), t[12] = a, t[13] = o, t[14] = s, t[15] = c) : c = t[15], c;
|
|
2253
2339
|
}
|
|
2254
|
-
var
|
|
2255
|
-
name:
|
|
2340
|
+
var Ui = {
|
|
2341
|
+
name: zi,
|
|
2256
2342
|
allowedAttributes: ["citation"],
|
|
2257
|
-
component:
|
|
2343
|
+
component: Hi
|
|
2258
2344
|
};
|
|
2259
|
-
function
|
|
2260
|
-
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } = B(), s =
|
|
2261
|
-
t[0] === r ? u = t[1] : (u =
|
|
2345
|
+
function Wi(e) {
|
|
2346
|
+
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } = B(), s = Y(), { citation: c } = U(), { message: l } = G(), u;
|
|
2347
|
+
t[0] === r ? u = t[1] : (u = V(r), t[0] = r, t[1] = u);
|
|
2262
2348
|
let d = u, f;
|
|
2263
|
-
t[2] === l ? f = t[3] : (f =
|
|
2349
|
+
t[2] === l ? f = t[3] : (f = nn(l), t[2] = l, t[3] = f);
|
|
2264
2350
|
let p;
|
|
2265
2351
|
t[4] !== c || t[5] !== f || t[6] !== d ? (p = {
|
|
2266
2352
|
citations: d,
|
|
@@ -2268,15 +2354,15 @@ function Ri(e) {
|
|
|
2268
2354
|
HostCitation: c
|
|
2269
2355
|
}, t[4] = c, t[5] = f, t[6] = d, t[7] = p) : p = t[7];
|
|
2270
2356
|
let m = p, h = d.length > 0, g;
|
|
2271
|
-
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [],
|
|
2357
|
+
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [], Ui] : i, t[8] = i, t[9] = h, t[10] = g) : g = t[10];
|
|
2272
2358
|
let _ = g, v;
|
|
2273
2359
|
t[11] === a ? v = t[12] : (v = k("text-sm", a), t[11] = a, t[12] = v);
|
|
2274
2360
|
let y = !s && o === "streaming", b;
|
|
2275
|
-
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ?
|
|
2361
|
+
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ? Bi(n, d) : n, t[13] = h, t[14] = n, t[15] = d, t[16] = b) : b = t[16];
|
|
2276
2362
|
let x;
|
|
2277
|
-
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(
|
|
2363
|
+
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(Mi, {
|
|
2278
2364
|
elements: _,
|
|
2279
|
-
animated:
|
|
2365
|
+
animated: Fi,
|
|
2280
2366
|
isAnimating: y,
|
|
2281
2367
|
children: b
|
|
2282
2368
|
}), t[17] = y, t[18] = b, t[19] = _, t[20] = x) : x = t[20];
|
|
@@ -2286,40 +2372,40 @@ function Ri(e) {
|
|
|
2286
2372
|
children: x
|
|
2287
2373
|
}), t[21] = v, t[22] = x, t[23] = S) : S = t[23];
|
|
2288
2374
|
let C;
|
|
2289
|
-
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(
|
|
2375
|
+
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(Vi, {
|
|
2290
2376
|
value: m,
|
|
2291
2377
|
children: S
|
|
2292
2378
|
}), t[24] = m, t[25] = S, t[26] = C) : C = t[26], C;
|
|
2293
2379
|
}
|
|
2294
|
-
function
|
|
2295
|
-
let t = O(8), { part: n } = e, r =
|
|
2296
|
-
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M(
|
|
2380
|
+
function Gi(e) {
|
|
2381
|
+
let t = O(8), { part: n } = e, r = Ki(), i;
|
|
2382
|
+
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M(ai, { part: n }), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
2297
2383
|
let a;
|
|
2298
|
-
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
2384
|
+
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(Pi, { part: n }), t[3] = n, t[4] = a);
|
|
2299
2385
|
let o;
|
|
2300
2386
|
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;
|
|
2301
2387
|
}
|
|
2302
|
-
function
|
|
2303
|
-
let { debugMode: e } = z(), t =
|
|
2388
|
+
function Ki() {
|
|
2389
|
+
let { debugMode: e } = z(), t = Y();
|
|
2304
2390
|
return !!e && !t;
|
|
2305
2391
|
}
|
|
2306
2392
|
//#endregion
|
|
2307
2393
|
//#region src/lib/chat/trajectory/tool-label.tsx
|
|
2308
|
-
function
|
|
2394
|
+
function qi(e) {
|
|
2309
2395
|
return !!e && e !== "output-available";
|
|
2310
2396
|
}
|
|
2311
|
-
function
|
|
2312
|
-
let t = O(5), { label: n, part: r, state: i } = e, a =
|
|
2313
|
-
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !
|
|
2397
|
+
function Ji(e) {
|
|
2398
|
+
let t = O(5), { label: n, part: r, state: i } = e, a = Y(), o;
|
|
2399
|
+
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !qi(i), t[0] = a, t[1] = n, t[2] = r, t[3] = i, t[4] = o) : o = t[4], o;
|
|
2314
2400
|
}
|
|
2315
|
-
function
|
|
2401
|
+
function Yi(e) {
|
|
2316
2402
|
let t = O(20), { label: n, part: r } = e, i = n.icon, a = n.actions, o;
|
|
2317
2403
|
t[0] !== n || t[1] !== r ? (o = {
|
|
2318
2404
|
label: n,
|
|
2319
2405
|
part: r,
|
|
2320
2406
|
state: r.state
|
|
2321
2407
|
}, t[0] = n, t[1] = r, t[2] = o) : o = t[2];
|
|
2322
|
-
let s =
|
|
2408
|
+
let s = Ji(o), c;
|
|
2323
2409
|
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];
|
|
2324
2410
|
let l;
|
|
2325
2411
|
t[6] !== n.kind || t[7] !== n.name || t[8] !== n.text ? (l = n.kind === "sentence" ? /* @__PURE__ */ M("span", {
|
|
@@ -2343,7 +2429,7 @@ function Ui(e) {
|
|
|
2343
2429
|
children: [u, d]
|
|
2344
2430
|
}), t[17] = u, t[18] = d, t[19] = f) : f = t[19], f;
|
|
2345
2431
|
}
|
|
2346
|
-
function
|
|
2432
|
+
function Xi(e) {
|
|
2347
2433
|
let t = O(3), { name: n, value: r } = e, i;
|
|
2348
2434
|
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ N("span", {
|
|
2349
2435
|
"data-slot": "tool-arg",
|
|
@@ -2355,14 +2441,14 @@ function Wi(e) {
|
|
|
2355
2441
|
]
|
|
2356
2442
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2357
2443
|
}
|
|
2358
|
-
function
|
|
2444
|
+
function Zi(e) {
|
|
2359
2445
|
let t = O(24), { label: n, state: r, part: i, children: a } = e, o = n.actions, s;
|
|
2360
2446
|
t[0] !== n || t[1] !== i || t[2] !== r ? (s = {
|
|
2361
2447
|
label: n,
|
|
2362
2448
|
part: i,
|
|
2363
2449
|
state: r
|
|
2364
2450
|
}, t[0] = n, t[1] = i, t[2] = r, t[3] = s) : s = t[3];
|
|
2365
|
-
let c =
|
|
2451
|
+
let c = Ji(s), l = n.kind === "sentence", u;
|
|
2366
2452
|
t[4] !== a || t[5] !== l || t[6] !== n.args || t[7] !== n.name || t[8] !== n.text ? (u = l ? /* @__PURE__ */ M("span", {
|
|
2367
2453
|
dir: "auto",
|
|
2368
2454
|
className: "text-muted-foreground min-w-0 truncate text-start text-xs",
|
|
@@ -2373,7 +2459,7 @@ function Gi(e) {
|
|
|
2373
2459
|
n.name,
|
|
2374
2460
|
"(",
|
|
2375
2461
|
a,
|
|
2376
|
-
n.args ? Object.entries(n.args).map(
|
|
2462
|
+
n.args ? Object.entries(n.args).map(Qi) : "...",
|
|
2377
2463
|
")"
|
|
2378
2464
|
]
|
|
2379
2465
|
}), t[4] = a, t[5] = l, t[6] = n.args, t[7] = n.name, t[8] = n.text, t[9] = u) : u = t[9];
|
|
@@ -2399,25 +2485,25 @@ function Gi(e) {
|
|
|
2399
2485
|
children: [f, p]
|
|
2400
2486
|
}), t[21] = f, t[22] = p, t[23] = m) : m = t[23], m;
|
|
2401
2487
|
}
|
|
2402
|
-
function
|
|
2488
|
+
function Qi(e) {
|
|
2403
2489
|
let [t, n] = e;
|
|
2404
|
-
return /* @__PURE__ */ M(
|
|
2490
|
+
return /* @__PURE__ */ M(Xi, {
|
|
2405
2491
|
name: t,
|
|
2406
2492
|
value: n
|
|
2407
2493
|
}, t);
|
|
2408
2494
|
}
|
|
2409
2495
|
//#endregion
|
|
2410
2496
|
//#region src/lib/chat/trajectory/segments/index.tsx
|
|
2411
|
-
function
|
|
2497
|
+
function $i(e) {
|
|
2412
2498
|
return e.type === "text" && e.providerMetadata?.openai?.phase === "commentary";
|
|
2413
2499
|
}
|
|
2414
|
-
function
|
|
2500
|
+
function ea(e) {
|
|
2415
2501
|
let t = O(9), { segment: n, elements: r, className: i } = e, a;
|
|
2416
2502
|
if (t[0] !== i || t[1] !== r || t[2] !== n.parts) {
|
|
2417
2503
|
let e;
|
|
2418
2504
|
t[4] !== i || t[5] !== r ? (e = (e) => {
|
|
2419
2505
|
let { part: t, idx: n } = e;
|
|
2420
|
-
return t.type === "text" ? /* @__PURE__ */ M(
|
|
2506
|
+
return t.type === "text" ? /* @__PURE__ */ M(Wi, {
|
|
2421
2507
|
text: t.text,
|
|
2422
2508
|
citations: t.citations,
|
|
2423
2509
|
elements: r,
|
|
@@ -2428,27 +2514,27 @@ function Ji(e) {
|
|
|
2428
2514
|
let o;
|
|
2429
2515
|
return t[7] === a ? o = t[8] : (o = /* @__PURE__ */ M(j, { children: a }), t[7] = a, t[8] = o), o;
|
|
2430
2516
|
}
|
|
2431
|
-
function
|
|
2517
|
+
function ta(e) {
|
|
2432
2518
|
let t = O(4), { segment: n } = e, { part: r } = n;
|
|
2433
2519
|
if (r.type !== "file") return null;
|
|
2434
2520
|
let i;
|
|
2435
|
-
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(
|
|
2521
|
+
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(Ri, {
|
|
2436
2522
|
filename: r.filename,
|
|
2437
2523
|
mediaType: r.mediaType,
|
|
2438
2524
|
url: r.url
|
|
2439
2525
|
}), t[0] = r.filename, t[1] = r.mediaType, t[2] = r.url, t[3] = i) : i = t[3], i;
|
|
2440
2526
|
}
|
|
2441
|
-
function
|
|
2442
|
-
let t = O(9), { segment: n } = e, { message: r } =
|
|
2443
|
-
t[0] === r ? i = t[1] : (i =
|
|
2527
|
+
function na(e) {
|
|
2528
|
+
let t = O(9), { segment: n } = e, { message: r } = G(), i;
|
|
2529
|
+
t[0] === r ? i = t[1] : (i = nn(r), t[0] = r, t[1] = i);
|
|
2444
2530
|
let a = i, o;
|
|
2445
2531
|
if (t[2] !== n.parts || t[3] !== a) {
|
|
2446
2532
|
let e;
|
|
2447
2533
|
t[5] === a ? e = t[6] : (e = (e) => {
|
|
2448
2534
|
let { part: t, idx: n } = e;
|
|
2449
2535
|
if (t.type !== "source-url") return null;
|
|
2450
|
-
let r =
|
|
2451
|
-
return r === null ? null : /* @__PURE__ */ M(
|
|
2536
|
+
let r = rn(a, t.url);
|
|
2537
|
+
return r === null ? null : /* @__PURE__ */ M(rr, {
|
|
2452
2538
|
source: {
|
|
2453
2539
|
url: t.url,
|
|
2454
2540
|
title: t.title
|
|
@@ -2460,40 +2546,40 @@ function Xi(e) {
|
|
|
2460
2546
|
let s;
|
|
2461
2547
|
return t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M("span", { children: o }), t[7] = o, t[8] = s), s;
|
|
2462
2548
|
}
|
|
2463
|
-
function
|
|
2464
|
-
let t = O(3), { segment: n } = e, r =
|
|
2465
|
-
if (
|
|
2549
|
+
function ra(e) {
|
|
2550
|
+
let t = O(3), { segment: n } = e, r = W();
|
|
2551
|
+
if (Y()) return null;
|
|
2466
2552
|
let { part: i } = n;
|
|
2467
2553
|
if (i.type !== "reasoning") return null;
|
|
2468
2554
|
let a = r === "streaming", o;
|
|
2469
2555
|
return t[0] !== i.text || t[1] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
2470
2556
|
className: "text-muted-foreground text-xs",
|
|
2471
|
-
children: /* @__PURE__ */ M(
|
|
2472
|
-
animated:
|
|
2557
|
+
children: /* @__PURE__ */ M(J, {
|
|
2558
|
+
animated: Fi,
|
|
2473
2559
|
isAnimating: a,
|
|
2474
2560
|
children: i.text
|
|
2475
2561
|
})
|
|
2476
2562
|
}), t[0] = i.text, t[1] = a, t[2] = o) : o = t[2], o;
|
|
2477
2563
|
}
|
|
2478
|
-
function
|
|
2564
|
+
function ia(e) {
|
|
2479
2565
|
let t = O(2), { segment: n } = e;
|
|
2480
|
-
if (!
|
|
2566
|
+
if (!Ki()) return null;
|
|
2481
2567
|
let { part: r } = n;
|
|
2482
2568
|
if (r.type !== "dynamic-tool") return null;
|
|
2483
2569
|
let i;
|
|
2484
|
-
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(
|
|
2570
|
+
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(oi, { part: r }), t[0] = r, t[1] = i), i;
|
|
2485
2571
|
}
|
|
2486
|
-
var
|
|
2487
|
-
function
|
|
2488
|
-
let e = l(
|
|
2572
|
+
var aa = o(null), oa = o(null);
|
|
2573
|
+
function sa() {
|
|
2574
|
+
let e = l(aa);
|
|
2489
2575
|
if (!e) throw Error("Segment.Tool* parts must be rendered within Segment.Tool");
|
|
2490
2576
|
return e;
|
|
2491
2577
|
}
|
|
2492
|
-
function
|
|
2493
|
-
let t = O(29), { segment: n, children: r } = e, i = z(), a =
|
|
2578
|
+
function ca(e) {
|
|
2579
|
+
let t = O(29), { segment: n, children: r } = e, i = z(), a = W(), { part: o } = n;
|
|
2494
2580
|
if (!S(o)) return null;
|
|
2495
2581
|
let s, c, l, u;
|
|
2496
|
-
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} =
|
|
2582
|
+
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} = Ti(o, i.registry), c = Ei(u, o.state), s = !c && sn(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]);
|
|
2497
2583
|
let d = l, f;
|
|
2498
2584
|
t[7] !== s || t[8] !== d || t[9] !== o ? (f = s ? {
|
|
2499
2585
|
...d ?? { name: y(o) },
|
|
@@ -2515,37 +2601,37 @@ function na(e) {
|
|
|
2515
2601
|
aborted: s
|
|
2516
2602
|
}, t[17] = s, t[18] = p, t[19] = o.state, t[20] = g) : g = t[20];
|
|
2517
2603
|
let _;
|
|
2518
|
-
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(
|
|
2604
|
+
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(ua, {}), t[21] = r, t[22] = _);
|
|
2519
2605
|
let v;
|
|
2520
|
-
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(
|
|
2606
|
+
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(oa, {
|
|
2521
2607
|
value: g,
|
|
2522
2608
|
children: _
|
|
2523
2609
|
}), t[23] = g, t[24] = _, t[25] = v) : v = t[25];
|
|
2524
2610
|
let b;
|
|
2525
|
-
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(
|
|
2611
|
+
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(aa, {
|
|
2526
2612
|
value: h,
|
|
2527
2613
|
children: v
|
|
2528
2614
|
}), t[26] = h, t[27] = v, t[28] = b) : b = t[28], b;
|
|
2529
2615
|
}
|
|
2530
|
-
function
|
|
2531
|
-
let e = O(2), { part: t, activeClientInput: n } =
|
|
2616
|
+
function la() {
|
|
2617
|
+
let e = O(2), { part: t, activeClientInput: n } = sa();
|
|
2532
2618
|
if (n) return null;
|
|
2533
2619
|
let r;
|
|
2534
|
-
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(
|
|
2620
|
+
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(Gi, { part: t }), e[0] = t, e[1] = r), r;
|
|
2535
2621
|
}
|
|
2536
|
-
function
|
|
2537
|
-
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } =
|
|
2622
|
+
function ua(e) {
|
|
2623
|
+
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } = sa();
|
|
2538
2624
|
if (!i) {
|
|
2539
2625
|
let e;
|
|
2540
2626
|
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M("div", {
|
|
2541
2627
|
className: "min-w-0 flex-1",
|
|
2542
|
-
children: /* @__PURE__ */ M(
|
|
2628
|
+
children: /* @__PURE__ */ M(la, {})
|
|
2543
2629
|
}), t[0] = e) : e = t[0], e;
|
|
2544
2630
|
}
|
|
2545
2631
|
let o;
|
|
2546
2632
|
t[1] !== n || t[2] !== i || t[3] !== r ? (o = /* @__PURE__ */ M(L, {
|
|
2547
2633
|
className: "cursor-pointer",
|
|
2548
|
-
children: /* @__PURE__ */ M(
|
|
2634
|
+
children: /* @__PURE__ */ M(Zi, {
|
|
2549
2635
|
label: i,
|
|
2550
2636
|
state: r.state,
|
|
2551
2637
|
part: r,
|
|
@@ -2555,7 +2641,7 @@ function ia(e) {
|
|
|
2555
2641
|
let s;
|
|
2556
2642
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(I, {
|
|
2557
2643
|
className: "mb-2",
|
|
2558
|
-
children: /* @__PURE__ */ M(
|
|
2644
|
+
children: /* @__PURE__ */ M(la, {})
|
|
2559
2645
|
}), t[5] = s) : s = t[5];
|
|
2560
2646
|
let c;
|
|
2561
2647
|
return t[6] !== a || t[7] !== o ? (c = /* @__PURE__ */ N(F, {
|
|
@@ -2564,32 +2650,32 @@ function ia(e) {
|
|
|
2564
2650
|
children: [o, s]
|
|
2565
2651
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2566
2652
|
}
|
|
2567
|
-
var
|
|
2568
|
-
Text:
|
|
2569
|
-
File:
|
|
2570
|
-
Source:
|
|
2571
|
-
Reasoning:
|
|
2572
|
-
DynamicTool:
|
|
2573
|
-
Tool:
|
|
2574
|
-
ToolDisclosure:
|
|
2575
|
-
ToolContent:
|
|
2653
|
+
var X = {
|
|
2654
|
+
Text: ea,
|
|
2655
|
+
File: ta,
|
|
2656
|
+
Source: na,
|
|
2657
|
+
Reasoning: ra,
|
|
2658
|
+
DynamicTool: ia,
|
|
2659
|
+
Tool: ca,
|
|
2660
|
+
ToolDisclosure: ua,
|
|
2661
|
+
ToolContent: la
|
|
2576
2662
|
};
|
|
2577
2663
|
//#endregion
|
|
2578
2664
|
//#region src/lib/chat/trajectory/trajectory-segments.ts
|
|
2579
|
-
function
|
|
2665
|
+
function da(e) {
|
|
2580
2666
|
return S(e) ? "tool" : e.type === "dynamic-tool" ? "dynamic-tool" : e.type === "reasoning" && "text" in e && e.text ? "reasoning" : null;
|
|
2581
2667
|
}
|
|
2582
|
-
function
|
|
2668
|
+
function fa(e, t) {
|
|
2583
2669
|
return e.kind === "text" || e.kind === "file" || e.kind === "source" ? !1 : e.kind === "reasoning" || e.kind !== "dynamic-tool" || !!t;
|
|
2584
2670
|
}
|
|
2585
|
-
function
|
|
2671
|
+
function pa(e, t, n) {
|
|
2586
2672
|
let r = e[t + 1];
|
|
2587
|
-
return !!r &&
|
|
2673
|
+
return !!r && fa(r, n);
|
|
2588
2674
|
}
|
|
2589
|
-
function
|
|
2590
|
-
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ?
|
|
2675
|
+
function ma(e) {
|
|
2676
|
+
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ? V(e.citations).map(({ source: e }) => e.url) : []));
|
|
2591
2677
|
for (let r = 0; r < e.length; r++) {
|
|
2592
|
-
let i = e[r], a =
|
|
2678
|
+
let i = e[r], a = da(i);
|
|
2593
2679
|
if (a) t.push({
|
|
2594
2680
|
kind: a,
|
|
2595
2681
|
part: i,
|
|
@@ -2628,13 +2714,13 @@ function ca(e) {
|
|
|
2628
2714
|
}
|
|
2629
2715
|
return t;
|
|
2630
2716
|
}
|
|
2631
|
-
function
|
|
2717
|
+
function Z(e, t) {
|
|
2632
2718
|
return e.kind === "text" || e.kind === "source" ? e.parts[0]?.idx ?? t : e.idx;
|
|
2633
2719
|
}
|
|
2634
2720
|
//#endregion
|
|
2635
2721
|
//#region src/lib/chat/trajectory/nested-trajectory.tsx
|
|
2636
|
-
function
|
|
2637
|
-
let n = `${
|
|
2722
|
+
function ha(e, t) {
|
|
2723
|
+
let n = `${Z(e, t)}:${e.kind}`;
|
|
2638
2724
|
if (e.kind === "text") return `${n}:${e.parts.map(({ part: e }) => e.type === "text" ? e.text : "").join("")}`;
|
|
2639
2725
|
if (e.kind === "reasoning" && e.part.type === "reasoning") return `${n}:${e.part.text}`;
|
|
2640
2726
|
if ((e.kind === "tool" || e.kind === "dynamic-tool") && w(e.part)) {
|
|
@@ -2643,38 +2729,38 @@ function ua(e, t) {
|
|
|
2643
2729
|
}
|
|
2644
2730
|
return e.kind === "file" && e.part.type === "file" ? `${n}:${e.part.url}:${e.part.mediaType}:${e.part.filename ?? ""}` : n;
|
|
2645
2731
|
}
|
|
2646
|
-
function
|
|
2732
|
+
function ga(e, t, n) {
|
|
2647
2733
|
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;
|
|
2648
2734
|
}
|
|
2649
|
-
var
|
|
2735
|
+
var _a = c(function(e) {
|
|
2650
2736
|
let t = O(8), { segment: n } = e;
|
|
2651
2737
|
if (n.kind === "tool") {
|
|
2652
2738
|
let e;
|
|
2653
|
-
return t[0] === n ? e = t[1] : (e = /* @__PURE__ */ M(
|
|
2739
|
+
return t[0] === n ? e = t[1] : (e = /* @__PURE__ */ M(X.Tool, { segment: n }), t[0] = n, t[1] = e), e;
|
|
2654
2740
|
}
|
|
2655
2741
|
if (n.kind === "reasoning") {
|
|
2656
2742
|
let e;
|
|
2657
|
-
return t[2] === n ? e = t[3] : (e = /* @__PURE__ */ M(
|
|
2743
|
+
return t[2] === n ? e = t[3] : (e = /* @__PURE__ */ M(X.Reasoning, { segment: n }), t[2] = n, t[3] = e), e;
|
|
2658
2744
|
}
|
|
2659
2745
|
if (n.kind === "text") {
|
|
2660
2746
|
let e;
|
|
2661
|
-
return t[4] === n ? e = t[5] : (e = /* @__PURE__ */ M(
|
|
2747
|
+
return t[4] === n ? e = t[5] : (e = /* @__PURE__ */ M(X.Text, {
|
|
2662
2748
|
segment: n,
|
|
2663
2749
|
className: "text-xs"
|
|
2664
2750
|
}), t[4] = n, t[5] = e), e;
|
|
2665
2751
|
}
|
|
2666
2752
|
if (n.kind === "file") {
|
|
2667
2753
|
let e;
|
|
2668
|
-
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(
|
|
2754
|
+
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(X.File, { segment: n }), t[6] = n, t[7] = e), e;
|
|
2669
2755
|
}
|
|
2670
2756
|
return null;
|
|
2671
|
-
},
|
|
2672
|
-
function
|
|
2757
|
+
}, va);
|
|
2758
|
+
function va(e, t) {
|
|
2673
2759
|
return e.complete && t.complete && e.cacheKey === t.cacheKey;
|
|
2674
2760
|
}
|
|
2675
|
-
function
|
|
2761
|
+
function ya(e) {
|
|
2676
2762
|
let t = O(11), { parts: n, className: r } = e, i;
|
|
2677
|
-
t[0] === n ? i = t[1] : (i =
|
|
2763
|
+
t[0] === n ? i = t[1] : (i = ma(n), t[0] = n, t[1] = i);
|
|
2678
2764
|
let a = i;
|
|
2679
2765
|
if (a.length === 0) return null;
|
|
2680
2766
|
let o;
|
|
@@ -2683,11 +2769,11 @@ function ma(e) {
|
|
|
2683
2769
|
if (t[4] !== a) {
|
|
2684
2770
|
let e;
|
|
2685
2771
|
t[6] === a.length ? e = t[7] : (e = (e, t) => {
|
|
2686
|
-
let n = `${
|
|
2687
|
-
return /* @__PURE__ */ M(
|
|
2772
|
+
let n = `${Z(e, t)}-${e.kind}`;
|
|
2773
|
+
return /* @__PURE__ */ M(_a, {
|
|
2688
2774
|
segment: e,
|
|
2689
|
-
cacheKey:
|
|
2690
|
-
complete:
|
|
2775
|
+
cacheKey: ha(e, t),
|
|
2776
|
+
complete: ga(e, t, a.length)
|
|
2691
2777
|
}, n);
|
|
2692
2778
|
}, t[6] = a.length, t[7] = e), s = a.map(e), t[4] = a, t[5] = s;
|
|
2693
2779
|
} else s = t[5];
|
|
@@ -2719,13 +2805,13 @@ function Q(e) {
|
|
|
2719
2805
|
}
|
|
2720
2806
|
//#endregion
|
|
2721
2807
|
//#region src/lib/chat/trajectory/trajectories/message-actions.tsx
|
|
2722
|
-
function
|
|
2723
|
-
let { index: e } =
|
|
2808
|
+
function ba() {
|
|
2809
|
+
let { index: e } = G(), { messages: t } = U(), n = W();
|
|
2724
2810
|
return !(e === t.length - 1 && (n === "submitted" || n === "streaming" || n === "error"));
|
|
2725
2811
|
}
|
|
2726
|
-
function
|
|
2812
|
+
function xa(e) {
|
|
2727
2813
|
let t = O(5), { className: n, children: r } = e;
|
|
2728
|
-
if (!
|
|
2814
|
+
if (!ba() || i.toArray(r).length === 0) return null;
|
|
2729
2815
|
let a;
|
|
2730
2816
|
t[0] === n ? a = t[1] : (a = k("mt-1 flex items-center gap-0.5", n), t[0] = n, t[1] = a);
|
|
2731
2817
|
let o;
|
|
@@ -2735,58 +2821,64 @@ function ga(e) {
|
|
|
2735
2821
|
children: r
|
|
2736
2822
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2737
2823
|
}
|
|
2738
|
-
function
|
|
2739
|
-
let t = O(
|
|
2740
|
-
t[0]
|
|
2741
|
-
let c;
|
|
2742
|
-
t[2] !== a || t[3] !== r ? (c = () => void a(hi(r)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
2824
|
+
function Sa(e) {
|
|
2825
|
+
let t = O(15), { className: n } = e, { message: r } = G(), [i, a] = qr(), o = K(), s = i ? "message.copied" : "message.copy", c;
|
|
2826
|
+
t[0] !== o || t[1] !== s ? (c = o(s), t[0] = o, t[1] = s, t[2] = c) : c = t[2];
|
|
2743
2827
|
let l;
|
|
2744
|
-
t[
|
|
2828
|
+
t[3] === n ? l = t[4] : (l = k("p-1.5", n), t[3] = n, t[4] = l);
|
|
2745
2829
|
let u;
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2830
|
+
t[5] !== a || t[6] !== r ? (u = () => void a(xi(r)), t[5] = a, t[6] = r, t[7] = u) : u = t[7];
|
|
2831
|
+
let d;
|
|
2832
|
+
t[8] === i ? d = t[9] : (d = M(i ? Re : Ke, { className: "size-3.5" }), t[8] = i, t[9] = d);
|
|
2833
|
+
let f;
|
|
2834
|
+
return t[10] !== c || t[11] !== l || t[12] !== u || t[13] !== d ? (f = /* @__PURE__ */ M(Q, {
|
|
2835
|
+
"aria-label": c,
|
|
2836
|
+
className: l,
|
|
2837
|
+
onClick: u,
|
|
2838
|
+
icon: d
|
|
2839
|
+
}), t[10] = c, t[11] = l, t[12] = u, t[13] = d, t[14] = f) : f = t[14], f;
|
|
2752
2840
|
}
|
|
2753
|
-
function
|
|
2754
|
-
let t = O(
|
|
2755
|
-
t[0] ===
|
|
2756
|
-
let o;
|
|
2757
|
-
t[2] !== r.id || t[3] !== i ? (o = () => void i({ messageId: r.id }), t[2] = r.id, t[3] = i, t[4] = o) : o = t[4];
|
|
2841
|
+
function Ca(e) {
|
|
2842
|
+
let t = O(12), { className: n } = e, { message: r } = G(), { regenerate: i } = $t(), a = K(), o;
|
|
2843
|
+
t[0] === a ? o = t[1] : (o = a("message.regenerate"), t[0] = a, t[1] = o);
|
|
2758
2844
|
let s;
|
|
2759
|
-
t[
|
|
2845
|
+
t[2] === n ? s = t[3] : (s = k("p-1.5", n), t[2] = n, t[3] = s);
|
|
2760
2846
|
let c;
|
|
2761
|
-
|
|
2762
|
-
"aria-label": "Regenerate response",
|
|
2763
|
-
className: a,
|
|
2764
|
-
onClick: o,
|
|
2765
|
-
icon: s
|
|
2766
|
-
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2767
|
-
}
|
|
2768
|
-
function ya(e) {
|
|
2769
|
-
let t = O(12), { className: n } = e, { message: r } = q(), [i, a] = Vr(), o = i ? "Copied" : "Copy debug JSON", s;
|
|
2770
|
-
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2771
|
-
let c;
|
|
2772
|
-
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];
|
|
2847
|
+
t[4] !== r.id || t[5] !== i ? (c = () => void i({ messageId: r.id }), t[4] = r.id, t[5] = i, t[6] = c) : c = t[6];
|
|
2773
2848
|
let l;
|
|
2774
|
-
t[
|
|
2849
|
+
t[7] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(tt, { className: "size-3.5" }), t[7] = l) : l = t[7];
|
|
2775
2850
|
let u;
|
|
2776
|
-
return t[
|
|
2851
|
+
return t[8] !== o || t[9] !== s || t[10] !== c ? (u = /* @__PURE__ */ M(Q, {
|
|
2777
2852
|
"aria-label": o,
|
|
2778
2853
|
className: s,
|
|
2779
2854
|
onClick: c,
|
|
2780
2855
|
icon: l
|
|
2781
|
-
}), t[
|
|
2856
|
+
}), t[8] = o, t[9] = s, t[10] = c, t[11] = u) : u = t[11], u;
|
|
2857
|
+
}
|
|
2858
|
+
function wa(e) {
|
|
2859
|
+
let t = O(15), { className: n } = e, { message: r } = G(), [i, a] = qr(), o = K(), s = i ? "message.copied" : "message.copyDebugJson", c;
|
|
2860
|
+
t[0] !== o || t[1] !== s ? (c = o(s), t[0] = o, t[1] = s, t[2] = c) : c = t[2];
|
|
2861
|
+
let l;
|
|
2862
|
+
t[3] === n ? l = t[4] : (l = k("p-1.5", n), t[3] = n, t[4] = l);
|
|
2863
|
+
let u;
|
|
2864
|
+
t[5] !== a || t[6] !== r ? (u = () => void a(JSON.stringify(r, null, 2)), t[5] = a, t[6] = r, t[7] = u) : u = t[7];
|
|
2865
|
+
let d;
|
|
2866
|
+
t[8] === i ? d = t[9] : (d = M(i ? Re : Le, { className: "size-3.5" }), t[8] = i, t[9] = d);
|
|
2867
|
+
let f;
|
|
2868
|
+
return t[10] !== c || t[11] !== l || t[12] !== u || t[13] !== d ? (f = /* @__PURE__ */ M(Q, {
|
|
2869
|
+
"aria-label": c,
|
|
2870
|
+
className: l,
|
|
2871
|
+
onClick: u,
|
|
2872
|
+
icon: d
|
|
2873
|
+
}), t[10] = c, t[11] = l, t[12] = u, t[13] = d, t[14] = f) : f = t[14], f;
|
|
2782
2874
|
}
|
|
2783
2875
|
//#endregion
|
|
2784
2876
|
//#region src/lib/chat/trajectory/trajectories/messages-error.tsx
|
|
2785
|
-
function
|
|
2877
|
+
function Ta(e) {
|
|
2786
2878
|
let t = O(7), { onTryAgain: n, error: r } = e, i = r instanceof Error ? r.message : "An error occurred. Please try again.", a;
|
|
2787
2879
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
2788
2880
|
className: "text-destructive text-sm",
|
|
2789
|
-
children: /* @__PURE__ */ M(
|
|
2881
|
+
children: /* @__PURE__ */ M(J, {
|
|
2790
2882
|
mode: "static",
|
|
2791
2883
|
children: i
|
|
2792
2884
|
})
|
|
@@ -2808,18 +2900,18 @@ function ba(e) {
|
|
|
2808
2900
|
})
|
|
2809
2901
|
}), t[4] = a, t[5] = o, t[6] = s) : s = t[6], s;
|
|
2810
2902
|
}
|
|
2811
|
-
function
|
|
2903
|
+
function Ea(e) {
|
|
2812
2904
|
let t = O(3), { error: n, onRetry: r } = e;
|
|
2813
2905
|
if (!n || !r) return null;
|
|
2814
2906
|
let i;
|
|
2815
|
-
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
2907
|
+
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(Ta, {
|
|
2816
2908
|
onTryAgain: r,
|
|
2817
2909
|
error: n
|
|
2818
2910
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2819
2911
|
}
|
|
2820
2912
|
//#endregion
|
|
2821
2913
|
//#region src/lib/chat/trajectory/trajectories/messages-shell.tsx
|
|
2822
|
-
function
|
|
2914
|
+
function Da(e) {
|
|
2823
2915
|
let t = O(15), { messages: n, className: r, elements: i, citation: a, status: o, children: s } = e, c;
|
|
2824
2916
|
t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== o ? (c = {
|
|
2825
2917
|
messages: n,
|
|
@@ -2840,12 +2932,12 @@ function Sa(e) {
|
|
|
2840
2932
|
children: d
|
|
2841
2933
|
}), t[9] = u, t[10] = d, t[11] = f) : f = t[11];
|
|
2842
2934
|
let p;
|
|
2843
|
-
return t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(
|
|
2935
|
+
return t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Zn, {
|
|
2844
2936
|
value: l,
|
|
2845
2937
|
children: f
|
|
2846
2938
|
}), t[12] = f, t[13] = l, t[14] = p) : p = t[14], p;
|
|
2847
2939
|
}
|
|
2848
|
-
function
|
|
2940
|
+
function Oa(e) {
|
|
2849
2941
|
let t = O(5), { className: n, children: r } = e, i;
|
|
2850
2942
|
t[0] === n ? i = t[1] : (i = k("flex flex-col gap-4", n), t[0] = n, t[1] = i);
|
|
2851
2943
|
let a;
|
|
@@ -2854,7 +2946,7 @@ function Ca(e) {
|
|
|
2854
2946
|
children: r
|
|
2855
2947
|
}), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
|
|
2856
2948
|
}
|
|
2857
|
-
function
|
|
2949
|
+
function ka(e) {
|
|
2858
2950
|
let t = O(9), { message: n, index: r, className: i, children: a } = e, o;
|
|
2859
2951
|
t[0] !== r || t[1] !== n ? (o = {
|
|
2860
2952
|
message: n,
|
|
@@ -2866,22 +2958,22 @@ function wa(e) {
|
|
|
2866
2958
|
children: a
|
|
2867
2959
|
}), t[3] = a, t[4] = i, t[5] = c) : c = t[5];
|
|
2868
2960
|
let l;
|
|
2869
|
-
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(
|
|
2961
|
+
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(Qn, {
|
|
2870
2962
|
value: s,
|
|
2871
2963
|
children: c
|
|
2872
2964
|
}), t[6] = c, t[7] = s, t[8] = l) : l = t[8], l;
|
|
2873
2965
|
}
|
|
2874
2966
|
//#endregion
|
|
2875
2967
|
//#region src/lib/components/PendingToolInput.tsx
|
|
2876
|
-
function
|
|
2877
|
-
let e = O(5), { registry: t } = z(), n =
|
|
2968
|
+
function Aa() {
|
|
2969
|
+
let e = O(5), { registry: t } = z(), n = $t().messages, r;
|
|
2878
2970
|
if (e[0] !== n || e[1] !== t) {
|
|
2879
2971
|
bb0: {
|
|
2880
2972
|
if (!t) {
|
|
2881
2973
|
r = null;
|
|
2882
2974
|
break bb0;
|
|
2883
2975
|
}
|
|
2884
|
-
let i = n.findLast(
|
|
2976
|
+
let i = n.findLast(ja);
|
|
2885
2977
|
if (!i) {
|
|
2886
2978
|
r = null;
|
|
2887
2979
|
break bb0;
|
|
@@ -2900,12 +2992,12 @@ function Ta() {
|
|
|
2900
2992
|
} else r = e[2];
|
|
2901
2993
|
return r;
|
|
2902
2994
|
}
|
|
2903
|
-
function
|
|
2995
|
+
function ja(e) {
|
|
2904
2996
|
let { role: t } = e;
|
|
2905
2997
|
return t === "assistant";
|
|
2906
2998
|
}
|
|
2907
|
-
function
|
|
2908
|
-
let t = O(10), { children: n, className: i } = e, a =
|
|
2999
|
+
function Ma(e) {
|
|
3000
|
+
let t = O(10), { children: n, className: i } = e, a = Aa(), o = a?.entry.component, s = a ? "hidden" : "visible", c;
|
|
2909
3001
|
t[0] !== n || t[1] !== s ? (c = /* @__PURE__ */ M(r, {
|
|
2910
3002
|
mode: s,
|
|
2911
3003
|
children: n
|
|
@@ -2920,12 +3012,12 @@ function Da(e) {
|
|
|
2920
3012
|
}
|
|
2921
3013
|
//#endregion
|
|
2922
3014
|
//#region src/lib/chat/trajectory/trajectories/thinking-hint.ts
|
|
2923
|
-
function
|
|
3015
|
+
function Na(e, t) {
|
|
2924
3016
|
if (e === "error" || e === "ready" || !t) return null;
|
|
2925
3017
|
if (t.role !== "assistant") return "Thinking...";
|
|
2926
3018
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2927
3019
|
let n = t.parts[e];
|
|
2928
|
-
if (C(n) &&
|
|
3020
|
+
if (C(n) && $i(n) && n.text) return n.text;
|
|
2929
3021
|
}
|
|
2930
3022
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2931
3023
|
let n = t.parts[e];
|
|
@@ -2949,7 +3041,7 @@ function Oa(e, t) {
|
|
|
2949
3041
|
}
|
|
2950
3042
|
//#endregion
|
|
2951
3043
|
//#region src/lib/chat/trajectory/trajectories/timeline-dot.tsx
|
|
2952
|
-
function
|
|
3044
|
+
function Pa(e) {
|
|
2953
3045
|
let t = O(5), { isLast: n } = e, r = n !== void 0 && n, i;
|
|
2954
3046
|
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];
|
|
2955
3047
|
let a;
|
|
@@ -2962,7 +3054,7 @@ function ka(e) {
|
|
|
2962
3054
|
}
|
|
2963
3055
|
//#endregion
|
|
2964
3056
|
//#region src/lib/chat/trajectory/trajectories/timeline-item.tsx
|
|
2965
|
-
function
|
|
3057
|
+
function Fa(e) {
|
|
2966
3058
|
let t = O(6), { marker: n, children: r, className: i } = e, a;
|
|
2967
3059
|
t[0] === i ? a = t[1] : (a = k("relative z-0 flex gap-3 pl-5", i), t[0] = i, t[1] = a);
|
|
2968
3060
|
let o;
|
|
@@ -2973,20 +3065,20 @@ function Aa(e) {
|
|
|
2973
3065
|
}
|
|
2974
3066
|
//#endregion
|
|
2975
3067
|
//#region src/lib/chat/trajectory/trajectories/trajectory-thinking.tsx
|
|
2976
|
-
function
|
|
2977
|
-
let e = O(6), t =
|
|
2978
|
-
e[0] !== t || e[1] !== i ? (a =
|
|
3068
|
+
function Ia() {
|
|
3069
|
+
let e = O(6), t = W(), { messages: n } = U(), r = Aa(), i = n[n.length - 1], a;
|
|
3070
|
+
e[0] !== t || e[1] !== i ? (a = Na(t, i), e[0] = t, e[1] = i, e[2] = a) : a = e[2];
|
|
2979
3071
|
let o = a;
|
|
2980
3072
|
if (!o || r) return null;
|
|
2981
3073
|
let s;
|
|
2982
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
3074
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(Pa, { isLast: !0 }), e[3] = s) : s = e[3];
|
|
2983
3075
|
let c;
|
|
2984
|
-
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(
|
|
3076
|
+
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(Fa, {
|
|
2985
3077
|
className: "mt-2",
|
|
2986
3078
|
marker: s,
|
|
2987
3079
|
children: /* @__PURE__ */ M("span", {
|
|
2988
3080
|
role: "status",
|
|
2989
|
-
children: /* @__PURE__ */ M(
|
|
3081
|
+
children: /* @__PURE__ */ M(H, {
|
|
2990
3082
|
as: "span",
|
|
2991
3083
|
className: "text-muted-foreground line-clamp-2 font-mono text-xs",
|
|
2992
3084
|
children: o
|
|
@@ -3002,7 +3094,7 @@ var $ = [
|
|
|
3002
3094
|
"reasoningTokens",
|
|
3003
3095
|
"cachedInputTokens",
|
|
3004
3096
|
"totalTokens"
|
|
3005
|
-
],
|
|
3097
|
+
], La = {
|
|
3006
3098
|
inputTokens: [["inputTokens"], ["raw", "prompt_tokens"]],
|
|
3007
3099
|
outputTokens: [["outputTokens"], ["raw", "completion_tokens"]],
|
|
3008
3100
|
reasoningTokens: [
|
|
@@ -3026,7 +3118,7 @@ var $ = [
|
|
|
3026
3118
|
],
|
|
3027
3119
|
totalTokens: [["totalTokens"], ["raw", "total_tokens"]]
|
|
3028
3120
|
};
|
|
3029
|
-
function
|
|
3121
|
+
function Ra(e) {
|
|
3030
3122
|
if (typeof e == "number" && Number.isFinite(e) && e >= 0) return e;
|
|
3031
3123
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
3032
3124
|
let t = Number(e);
|
|
@@ -3034,7 +3126,7 @@ function Na(e) {
|
|
|
3034
3126
|
}
|
|
3035
3127
|
return null;
|
|
3036
3128
|
}
|
|
3037
|
-
function
|
|
3129
|
+
function za(e) {
|
|
3038
3130
|
if (!e || typeof e != "object") return null;
|
|
3039
3131
|
let t = {
|
|
3040
3132
|
inputTokens: null,
|
|
@@ -3043,8 +3135,8 @@ function Pa(e) {
|
|
|
3043
3135
|
cachedInputTokens: null,
|
|
3044
3136
|
totalTokens: null
|
|
3045
3137
|
};
|
|
3046
|
-
for (let n of $) for (let r of
|
|
3047
|
-
let i =
|
|
3138
|
+
for (let n of $) for (let r of La[n]) {
|
|
3139
|
+
let i = Ra(Dt(e, r));
|
|
3048
3140
|
if (i !== null) {
|
|
3049
3141
|
t[n] = i;
|
|
3050
3142
|
break;
|
|
@@ -3052,10 +3144,10 @@ function Pa(e) {
|
|
|
3052
3144
|
}
|
|
3053
3145
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3054
3146
|
}
|
|
3055
|
-
function
|
|
3056
|
-
return D(e) ?
|
|
3147
|
+
function Ba(e) {
|
|
3148
|
+
return D(e) ? za(e.totalUsage ?? e.usage) : null;
|
|
3057
3149
|
}
|
|
3058
|
-
function
|
|
3150
|
+
function Va(e, t) {
|
|
3059
3151
|
let n = {
|
|
3060
3152
|
inputTokens: null,
|
|
3061
3153
|
outputTokens: null,
|
|
@@ -3077,7 +3169,7 @@ function Ia(e, t) {
|
|
|
3077
3169
|
}
|
|
3078
3170
|
return $.some((e) => n[e] !== null) ? n : null;
|
|
3079
3171
|
}
|
|
3080
|
-
function
|
|
3172
|
+
function Ha(e) {
|
|
3081
3173
|
if (e.length === 0) return null;
|
|
3082
3174
|
let t = {
|
|
3083
3175
|
inputTokens: null,
|
|
@@ -3096,32 +3188,32 @@ function La(e) {
|
|
|
3096
3188
|
}
|
|
3097
3189
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3098
3190
|
}
|
|
3099
|
-
function
|
|
3191
|
+
function Ua(e) {
|
|
3100
3192
|
let t = {}, n = [], r = null, i = null;
|
|
3101
3193
|
for (let a of e) {
|
|
3102
3194
|
if (a.role !== "assistant") continue;
|
|
3103
|
-
let e = D(a.metadata) ? a.metadata : void 0, o =
|
|
3195
|
+
let e = D(a.metadata) ? a.metadata : void 0, o = za(e?.usage), s = za(e?.totalUsage), c = o ?? (s ? Va(s, r) : null);
|
|
3104
3196
|
c && (t[a.id] = c, n.push(c)), s && (i = s, r = s);
|
|
3105
3197
|
}
|
|
3106
3198
|
return {
|
|
3107
3199
|
assistantUsageByMessageId: t,
|
|
3108
|
-
chatUsageSummary: i ??
|
|
3200
|
+
chatUsageSummary: i ?? Ha(n)
|
|
3109
3201
|
};
|
|
3110
3202
|
}
|
|
3111
|
-
function
|
|
3112
|
-
let e = O(2), t =
|
|
3113
|
-
return e[0] === t.messages ? n = e[1] : (n =
|
|
3203
|
+
function Wa() {
|
|
3204
|
+
let e = O(2), t = $t(), n;
|
|
3205
|
+
return e[0] === t.messages ? n = e[1] : (n = Ua(t.messages), e[0] = t.messages, e[1] = n), n;
|
|
3114
3206
|
}
|
|
3115
|
-
function
|
|
3207
|
+
function Ga(e) {
|
|
3116
3208
|
return kt(e);
|
|
3117
3209
|
}
|
|
3118
|
-
function
|
|
3210
|
+
function Ka(e) {
|
|
3119
3211
|
let t = [`↑ ${Ot(e.inputTokens)}`, `↓ ${Ot(e.outputTokens)}`];
|
|
3120
3212
|
return e.totalTokens !== null && t.push(`· ${kt(e.totalTokens)} tokens`), e.cachedInputTokens !== null && e.cachedInputTokens > 0 && t.push(`(${Ot(e.cachedInputTokens)} cached)`), t.join(" ");
|
|
3121
3213
|
}
|
|
3122
3214
|
//#endregion
|
|
3123
3215
|
//#region src/lib/chat/zukhruf-chat-transport.ts
|
|
3124
|
-
var
|
|
3216
|
+
var qa = "x-upload-filename", Ja = P.strictObject({
|
|
3125
3217
|
path: P.string().startsWith("/"),
|
|
3126
3218
|
name: P.string().min(1),
|
|
3127
3219
|
mediaType: P.enum([
|
|
@@ -3139,19 +3231,19 @@ var Ha = "x-upload-filename", Ua = P.strictObject({
|
|
|
3139
3231
|
]),
|
|
3140
3232
|
size: P.int().nonnegative(),
|
|
3141
3233
|
url: P.url()
|
|
3142
|
-
}),
|
|
3234
|
+
}), Ya = class extends _ {
|
|
3143
3235
|
sessionsApi;
|
|
3144
3236
|
request;
|
|
3145
3237
|
constructor({ api: e, fetch: t = (e, t) => globalThis.fetch(e, t), tools: n = {}, elements: r = [] }) {
|
|
3146
|
-
let i =
|
|
3238
|
+
let i = $a(e), a = r.map(se);
|
|
3147
3239
|
super({
|
|
3148
3240
|
api: i,
|
|
3149
3241
|
fetch: async (e, n) => {
|
|
3150
3242
|
let r = await t(e, n);
|
|
3151
3243
|
if ((n?.method ?? "GET").toUpperCase() !== "POST" || !r.ok) return r;
|
|
3152
3244
|
let i = await r.json();
|
|
3153
|
-
if (!
|
|
3154
|
-
let a =
|
|
3245
|
+
if (!eo(i)) throw Error("Zukhruf returned an invalid accepted-turn response");
|
|
3246
|
+
let a = $a(String(e)), o = decodeURIComponent(a.slice(a.lastIndexOf("/") + 1));
|
|
3155
3247
|
if (i.sessionId !== o) throw Error("Zukhruf returned a different session ID");
|
|
3156
3248
|
let s = n?.signal;
|
|
3157
3249
|
return s?.addEventListener("abort", () => {
|
|
@@ -3166,7 +3258,7 @@ var Ha = "x-upload-filename", Ua = P.strictObject({
|
|
|
3166
3258
|
let o = t[t.length - 1];
|
|
3167
3259
|
if (!o) throw Error("A message is required");
|
|
3168
3260
|
return {
|
|
3169
|
-
api:
|
|
3261
|
+
api: Xa(i, e),
|
|
3170
3262
|
body: {
|
|
3171
3263
|
sessionId: e,
|
|
3172
3264
|
message: o,
|
|
@@ -3177,50 +3269,50 @@ var Ha = "x-upload-filename", Ua = P.strictObject({
|
|
|
3177
3269
|
};
|
|
3178
3270
|
},
|
|
3179
3271
|
prepareReconnectToStreamRequest: ({ headers: e, id: t }) => ({
|
|
3180
|
-
api: `${
|
|
3272
|
+
api: `${Xa(i, t)}/stream`,
|
|
3181
3273
|
headers: e
|
|
3182
3274
|
})
|
|
3183
3275
|
}), this.sessionsApi = i, this.request = t;
|
|
3184
3276
|
}
|
|
3185
3277
|
async uploadFile(e, t) {
|
|
3186
|
-
let n = await this.request(`${
|
|
3278
|
+
let n = await this.request(`${Xa(this.sessionsApi, e)}/uploads`, {
|
|
3187
3279
|
method: "POST",
|
|
3188
3280
|
headers: {
|
|
3189
3281
|
"content-type": t.type,
|
|
3190
|
-
[
|
|
3282
|
+
[qa]: encodeURIComponent(t.name)
|
|
3191
3283
|
},
|
|
3192
3284
|
body: t
|
|
3193
3285
|
});
|
|
3194
|
-
if (!n.ok) throw Error(await
|
|
3195
|
-
let r =
|
|
3286
|
+
if (!n.ok) throw Error(await Za(n, t));
|
|
3287
|
+
let r = Ja.safeParse(await n.json());
|
|
3196
3288
|
if (!r.success) throw Error("Zukhruf returned an invalid upload response");
|
|
3197
3289
|
return r.data;
|
|
3198
3290
|
}
|
|
3199
3291
|
};
|
|
3200
|
-
function
|
|
3292
|
+
function Xa(e, t) {
|
|
3201
3293
|
return `${e}/${encodeURIComponent(t)}`;
|
|
3202
3294
|
}
|
|
3203
|
-
async function
|
|
3204
|
-
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r =
|
|
3295
|
+
async function Za(e, t) {
|
|
3296
|
+
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r = Qa(await e.json().catch((e) => {
|
|
3205
3297
|
if (e instanceof SyntaxError) return null;
|
|
3206
3298
|
throw e;
|
|
3207
3299
|
}));
|
|
3208
3300
|
return r ? `${n}: ${r}` : n;
|
|
3209
3301
|
}
|
|
3210
|
-
function
|
|
3302
|
+
function Qa(e) {
|
|
3211
3303
|
if (typeof e != "object" || !e) return null;
|
|
3212
3304
|
let t = "cause" in e && typeof e.cause == "object" && e.cause !== null ? e.cause : null;
|
|
3213
3305
|
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;
|
|
3214
3306
|
}
|
|
3215
|
-
function
|
|
3307
|
+
function $a(e) {
|
|
3216
3308
|
return e.replace(/\/$/, "");
|
|
3217
3309
|
}
|
|
3218
|
-
function
|
|
3310
|
+
function eo(e) {
|
|
3219
3311
|
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";
|
|
3220
3312
|
}
|
|
3221
3313
|
//#endregion
|
|
3222
3314
|
//#region src/lib/chat/trajectory/trajectories/collapsible-disclosure.tsx
|
|
3223
|
-
function
|
|
3315
|
+
function to(e) {
|
|
3224
3316
|
let t = O(24), { label: n, open: r, onOpenChange: i, children: a, className: o, triggerClassName: s, contentClassName: c, chevronClassName: l } = e, u;
|
|
3225
3317
|
t[0] === s ? u = t[1] : (u = k("flex items-center font-mono", s), t[0] = s, t[1] = u);
|
|
3226
3318
|
let d;
|
|
@@ -3254,19 +3346,19 @@ function Xa(e) {
|
|
|
3254
3346
|
}
|
|
3255
3347
|
//#endregion
|
|
3256
3348
|
//#region src/lib/chat/trajectory/trajectories/user-message.tsx
|
|
3257
|
-
function
|
|
3349
|
+
function no(e) {
|
|
3258
3350
|
let t = O(7), { metadata: n } = e;
|
|
3259
3351
|
if (!n) return null;
|
|
3260
3352
|
let r, i, a;
|
|
3261
3353
|
if (t[0] !== n) {
|
|
3262
3354
|
a = Symbol.for("react.early_return_sentinel");
|
|
3263
3355
|
bb0: {
|
|
3264
|
-
let e =
|
|
3356
|
+
let e = Ba(n);
|
|
3265
3357
|
if (!e) {
|
|
3266
3358
|
a = null;
|
|
3267
3359
|
break bb0;
|
|
3268
3360
|
}
|
|
3269
|
-
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i =
|
|
3361
|
+
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i = Ka(e);
|
|
3270
3362
|
}
|
|
3271
3363
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a;
|
|
3272
3364
|
} else r = t[1], i = t[2], a = t[3];
|
|
@@ -3277,27 +3369,27 @@ function Za(e) {
|
|
|
3277
3369
|
children: i
|
|
3278
3370
|
}), t[4] = r, t[5] = i, t[6] = o) : o = t[6], o;
|
|
3279
3371
|
}
|
|
3280
|
-
function
|
|
3372
|
+
function ro(e, t) {
|
|
3281
3373
|
return D(e.metadata) ? e.metadata[t] : void 0;
|
|
3282
3374
|
}
|
|
3283
|
-
function
|
|
3284
|
-
let t =
|
|
3375
|
+
function io(e) {
|
|
3376
|
+
let t = ro(e, "reminders");
|
|
3285
3377
|
return Array.isArray(t) ? t.filter((e) => {
|
|
3286
3378
|
if (!e || typeof e != "object") return !1;
|
|
3287
3379
|
let t = e;
|
|
3288
3380
|
return typeof t.id == "string" && t.id.length > 0 && typeof t.text == "string" && t.text.trim().length > 0;
|
|
3289
3381
|
}) : [];
|
|
3290
3382
|
}
|
|
3291
|
-
function
|
|
3292
|
-
let t =
|
|
3383
|
+
function ao(e) {
|
|
3384
|
+
let t = ro(e, "uploads");
|
|
3293
3385
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
3294
|
-
let t =
|
|
3386
|
+
let t = Ja.safeParse(e);
|
|
3295
3387
|
return t.success ? [t.data] : [];
|
|
3296
3388
|
}) : [];
|
|
3297
3389
|
}
|
|
3298
|
-
function
|
|
3390
|
+
function oo(e) {
|
|
3299
3391
|
let t = O(7), { text: n } = e, [r, i] = g(!1), a;
|
|
3300
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(
|
|
3392
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(so), t[0] = a) : a = t[0];
|
|
3301
3393
|
let o = !r && "line-clamp-3", s;
|
|
3302
3394
|
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);
|
|
3303
3395
|
let c;
|
|
@@ -3309,21 +3401,21 @@ function to(e) {
|
|
|
3309
3401
|
children: n
|
|
3310
3402
|
}) }), t[3] = r, t[4] = s, t[5] = n, t[6] = c) : c = t[6], c;
|
|
3311
3403
|
}
|
|
3312
|
-
function
|
|
3404
|
+
function so(e) {
|
|
3313
3405
|
return !e;
|
|
3314
3406
|
}
|
|
3315
|
-
function
|
|
3407
|
+
function co(e) {
|
|
3316
3408
|
let t = O(8), { reminders: n } = e, [r, i] = g(!1);
|
|
3317
3409
|
if (n.length === 0) return null;
|
|
3318
3410
|
let a = `${n.length} reminder${n.length === 1 ? "" : "s"} attached`, o;
|
|
3319
|
-
t[0] === n ? o = t[1] : (o = n.map(
|
|
3411
|
+
t[0] === n ? o = t[1] : (o = n.map(lo), t[0] = n, t[1] = o);
|
|
3320
3412
|
let s;
|
|
3321
3413
|
t[2] === o ? s = t[3] : (s = /* @__PURE__ */ M("ul", {
|
|
3322
3414
|
className: "border-ink-12 text-muted-foreground space-y-1 border-l pl-3 text-xs",
|
|
3323
3415
|
children: o
|
|
3324
3416
|
}), t[2] = o, t[3] = s);
|
|
3325
3417
|
let c;
|
|
3326
|
-
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(
|
|
3418
|
+
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(to, {
|
|
3327
3419
|
label: a,
|
|
3328
3420
|
open: r,
|
|
3329
3421
|
onOpenChange: i,
|
|
@@ -3334,10 +3426,10 @@ function ro(e) {
|
|
|
3334
3426
|
children: s
|
|
3335
3427
|
}), t[4] = a, t[5] = r, t[6] = s, t[7] = c) : c = t[7], c;
|
|
3336
3428
|
}
|
|
3337
|
-
function
|
|
3338
|
-
return /* @__PURE__ */ M(
|
|
3429
|
+
function lo(e) {
|
|
3430
|
+
return /* @__PURE__ */ M(oo, { text: e.text }, e.id);
|
|
3339
3431
|
}
|
|
3340
|
-
function
|
|
3432
|
+
function uo(e) {
|
|
3341
3433
|
let t = O(19), { upload: n } = e;
|
|
3342
3434
|
if (n.mediaType.startsWith("video/")) {
|
|
3343
3435
|
let e;
|
|
@@ -3403,17 +3495,17 @@ function ao(e) {
|
|
|
3403
3495
|
})
|
|
3404
3496
|
}), t[16] = n.name, t[17] = n.url, t[18] = r) : r = t[18], r;
|
|
3405
3497
|
}
|
|
3406
|
-
function
|
|
3498
|
+
function fo(e) {
|
|
3407
3499
|
let t = O(13), { message: n } = e, r, i, a, o, s, c;
|
|
3408
3500
|
if (t[0] !== n) {
|
|
3409
3501
|
c = Symbol.for("react.early_return_sentinel");
|
|
3410
3502
|
bb0: {
|
|
3411
|
-
let e =
|
|
3503
|
+
let e = ao(n);
|
|
3412
3504
|
if (e.length === 0) {
|
|
3413
3505
|
c = null;
|
|
3414
3506
|
break bb0;
|
|
3415
3507
|
}
|
|
3416
|
-
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(
|
|
3508
|
+
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(po);
|
|
3417
3509
|
}
|
|
3418
3510
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a, t[4] = o, t[5] = s, t[6] = c;
|
|
3419
3511
|
} else r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], c = t[6];
|
|
@@ -3426,23 +3518,23 @@ function oo(e) {
|
|
|
3426
3518
|
children: s
|
|
3427
3519
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o, t[11] = s, t[12] = l) : l = t[12], l;
|
|
3428
3520
|
}
|
|
3429
|
-
function
|
|
3521
|
+
function po(e) {
|
|
3430
3522
|
return /* @__PURE__ */ M("div", {
|
|
3431
3523
|
role: "listitem",
|
|
3432
3524
|
"data-slot": "attachment",
|
|
3433
|
-
children: /* @__PURE__ */ M(
|
|
3525
|
+
children: /* @__PURE__ */ M(uo, { upload: e })
|
|
3434
3526
|
}, e.path);
|
|
3435
3527
|
}
|
|
3436
|
-
function
|
|
3528
|
+
function mo(e) {
|
|
3437
3529
|
let t = O(10), { body: n, reminders: r, metadata: i } = e, a;
|
|
3438
3530
|
t[0] === n ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
3439
3531
|
className: "flex-1 space-y-3",
|
|
3440
3532
|
children: n
|
|
3441
3533
|
}), t[0] = n, t[1] = a);
|
|
3442
3534
|
let o;
|
|
3443
|
-
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(
|
|
3535
|
+
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(co, { reminders: r }), t[2] = r, t[3] = o);
|
|
3444
3536
|
let s;
|
|
3445
|
-
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(
|
|
3537
|
+
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(no, { metadata: i }), t[4] = i, t[5] = s);
|
|
3446
3538
|
let c;
|
|
3447
3539
|
return t[6] !== a || t[7] !== o || t[8] !== s ? (c = /* @__PURE__ */ N("div", {
|
|
3448
3540
|
className: "bg-secondary flex max-w-[80%] flex-col gap-3 rounded-lg p-3",
|
|
@@ -3453,13 +3545,13 @@ function co(e) {
|
|
|
3453
3545
|
]
|
|
3454
3546
|
}), t[6] = a, t[7] = o, t[8] = s, t[9] = c) : c = t[9], c;
|
|
3455
3547
|
}
|
|
3456
|
-
function
|
|
3548
|
+
function ho(e) {
|
|
3457
3549
|
let t = O(28), { message: n } = e;
|
|
3458
|
-
|
|
3550
|
+
ro(n, "reminders");
|
|
3459
3551
|
let r;
|
|
3460
3552
|
t[0] === n ? r = t[1] : (r = ee(n), t[0] = n, t[1] = r);
|
|
3461
3553
|
let i;
|
|
3462
|
-
t[2] === n ? i = t[3] : (i =
|
|
3554
|
+
t[2] === n ? i = t[3] : (i = io(n), t[2] = n, t[3] = i);
|
|
3463
3555
|
let a;
|
|
3464
3556
|
t[4] !== r || t[5] !== i ? (a = {
|
|
3465
3557
|
message: r,
|
|
@@ -3467,7 +3559,7 @@ function lo(e) {
|
|
|
3467
3559
|
}, t[4] = r, t[5] = i, t[6] = a) : a = t[6];
|
|
3468
3560
|
let { message: o, reminders: s } = a, c;
|
|
3469
3561
|
if (t[7] !== n) {
|
|
3470
|
-
let e =
|
|
3562
|
+
let e = ro(n, "alias");
|
|
3471
3563
|
c = typeof e == "string" && e.trim().length > 0 ? e : void 0, t[7] = n, t[8] = c;
|
|
3472
3564
|
} else c = t[8];
|
|
3473
3565
|
let l = c;
|
|
@@ -3479,13 +3571,13 @@ function lo(e) {
|
|
|
3479
3571
|
children: l
|
|
3480
3572
|
}), t[9] = l, t[10] = e);
|
|
3481
3573
|
let n;
|
|
3482
|
-
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(
|
|
3574
|
+
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(mo, {
|
|
3483
3575
|
reminders: s,
|
|
3484
3576
|
body: e
|
|
3485
3577
|
}), t[11] = s, t[12] = e, t[13] = n) : n = t[13], n;
|
|
3486
3578
|
}
|
|
3487
3579
|
let u;
|
|
3488
|
-
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(
|
|
3580
|
+
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(fo, { message: o }), t[14] = o, t[15] = u);
|
|
3489
3581
|
let d = o.metadata, f;
|
|
3490
3582
|
if (t[16] !== o.id || t[17] !== o.parts) {
|
|
3491
3583
|
let e;
|
|
@@ -3496,7 +3588,7 @@ function lo(e) {
|
|
|
3496
3588
|
}, `${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;
|
|
3497
3589
|
} else f = t[18];
|
|
3498
3590
|
let p;
|
|
3499
|
-
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(
|
|
3591
|
+
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(mo, {
|
|
3500
3592
|
reminders: s,
|
|
3501
3593
|
metadata: d,
|
|
3502
3594
|
body: f
|
|
@@ -3507,11 +3599,11 @@ function lo(e) {
|
|
|
3507
3599
|
children: [u, p]
|
|
3508
3600
|
}), t[25] = u, t[26] = p, t[27] = m) : m = t[27], m;
|
|
3509
3601
|
}
|
|
3510
|
-
var
|
|
3511
|
-
let t = O(7), { className: n } = e, { message: r } =
|
|
3602
|
+
var go = c(function(e) {
|
|
3603
|
+
let t = O(7), { className: n } = e, { message: r } = G(), i;
|
|
3512
3604
|
t[0] === n ? i = t[1] : (i = k("flex justify-end", n), t[0] = n, t[1] = i);
|
|
3513
3605
|
let a;
|
|
3514
|
-
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(
|
|
3606
|
+
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(ho, { message: r }), t[2] = r, t[3] = a);
|
|
3515
3607
|
let o;
|
|
3516
3608
|
return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3517
3609
|
className: i,
|
|
@@ -3520,20 +3612,20 @@ var uo = c(function(e) {
|
|
|
3520
3612
|
});
|
|
3521
3613
|
//#endregion
|
|
3522
3614
|
//#region src/lib/chat/trajectory/trajectories/compact-messages.tsx
|
|
3523
|
-
function
|
|
3524
|
-
return e.kind === "tool" ? !
|
|
3615
|
+
function _o(e) {
|
|
3616
|
+
return e.kind === "tool" ? !Ci(e.part) : e.kind === "dynamic-tool" || e.kind === "reasoning";
|
|
3525
3617
|
}
|
|
3526
|
-
function
|
|
3618
|
+
function vo(e, t) {
|
|
3527
3619
|
return e.kind === "tool" ? !0 : e.kind === "reasoning" || e.kind === "dynamic-tool" ? !!t : !1;
|
|
3528
3620
|
}
|
|
3529
|
-
function
|
|
3530
|
-
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" &&
|
|
3621
|
+
function yo(e) {
|
|
3622
|
+
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !$i(e));
|
|
3531
3623
|
}
|
|
3532
|
-
function
|
|
3624
|
+
function bo(e, t) {
|
|
3533
3625
|
let n = [];
|
|
3534
3626
|
for (let r = 0; r < e.length; r++) {
|
|
3535
3627
|
let i = e[r];
|
|
3536
|
-
if (!
|
|
3628
|
+
if (!_o(i)) {
|
|
3537
3629
|
n.push({
|
|
3538
3630
|
kind: "segment",
|
|
3539
3631
|
segment: i,
|
|
@@ -3542,25 +3634,25 @@ function ho(e, t) {
|
|
|
3542
3634
|
continue;
|
|
3543
3635
|
}
|
|
3544
3636
|
let a = [], o = r;
|
|
3545
|
-
for (; r < e.length &&
|
|
3637
|
+
for (; r < e.length && _o(e[r]);) {
|
|
3546
3638
|
let n = e[r];
|
|
3547
|
-
|
|
3639
|
+
vo(n, t) && a.push({ segment: n }), r++;
|
|
3548
3640
|
}
|
|
3549
3641
|
r--, a.length > 0 && n.push({
|
|
3550
3642
|
kind: "group",
|
|
3551
3643
|
items: a,
|
|
3552
|
-
hasLaterText: e.slice(r + 1).some((e) =>
|
|
3644
|
+
hasLaterText: e.slice(r + 1).some((e) => yo(e)),
|
|
3553
3645
|
firstIndex: o
|
|
3554
3646
|
});
|
|
3555
3647
|
}
|
|
3556
3648
|
return n;
|
|
3557
3649
|
}
|
|
3558
|
-
function
|
|
3650
|
+
function xo(e) {
|
|
3559
3651
|
if (e.kind !== "tool" && e.kind !== "dynamic-tool") return;
|
|
3560
3652
|
let { part: t } = e;
|
|
3561
3653
|
return w(t) ? t.state : void 0;
|
|
3562
3654
|
}
|
|
3563
|
-
function
|
|
3655
|
+
function So({ groupStatus: e, labelCount: t }) {
|
|
3564
3656
|
return e === "running" ? {
|
|
3565
3657
|
title: "text-info",
|
|
3566
3658
|
detail: "text-info/80",
|
|
@@ -3583,20 +3675,20 @@ function _o({ groupStatus: e, labelCount: t }) {
|
|
|
3583
3675
|
chevron: "text-muted-foreground"
|
|
3584
3676
|
};
|
|
3585
3677
|
}
|
|
3586
|
-
function
|
|
3678
|
+
function Co(e) {
|
|
3587
3679
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3588
3680
|
}
|
|
3589
|
-
function
|
|
3681
|
+
function wo(e, t = 80) {
|
|
3590
3682
|
let n = e.replace(/\s+/g, " ").trim();
|
|
3591
3683
|
return n.length <= t ? n : `${n.slice(0, t - 3).trimEnd()}...`;
|
|
3592
3684
|
}
|
|
3593
|
-
function
|
|
3594
|
-
if (typeof e == "string") return
|
|
3685
|
+
function To(e) {
|
|
3686
|
+
if (typeof e == "string") return wo(e, 48);
|
|
3595
3687
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
3596
3688
|
if (Array.isArray(e)) return `${e.length} items`;
|
|
3597
3689
|
}
|
|
3598
|
-
function
|
|
3599
|
-
if (!
|
|
3690
|
+
function Eo(e) {
|
|
3691
|
+
if (!Co(e)) return;
|
|
3600
3692
|
let t = [
|
|
3601
3693
|
"command",
|
|
3602
3694
|
"query",
|
|
@@ -3608,13 +3700,13 @@ function xo(e) {
|
|
|
3608
3700
|
"checks"
|
|
3609
3701
|
], n = [...t.filter((t) => t in e).map((t) => [t, e[t]]), ...Object.entries(e).filter(([e]) => !t.includes(e))], r = {};
|
|
3610
3702
|
for (let [e, t] of n) {
|
|
3611
|
-
let n =
|
|
3703
|
+
let n = To(t);
|
|
3612
3704
|
if (n && (r[e] = n, Object.keys(r).length >= 2)) break;
|
|
3613
3705
|
}
|
|
3614
3706
|
return Object.keys(r).length > 0 ? r : void 0;
|
|
3615
3707
|
}
|
|
3616
|
-
function
|
|
3617
|
-
if (
|
|
3708
|
+
function Do(e) {
|
|
3709
|
+
if (Co(e)) for (let t of [
|
|
3618
3710
|
"reasoning",
|
|
3619
3711
|
"thoughts",
|
|
3620
3712
|
"thought",
|
|
@@ -3622,33 +3714,33 @@ function So(e) {
|
|
|
3622
3714
|
"detail"
|
|
3623
3715
|
]) {
|
|
3624
3716
|
let n = e[t];
|
|
3625
|
-
if (typeof n == "string" && n.trim().length > 0) return
|
|
3717
|
+
if (typeof n == "string" && n.trim().length > 0) return wo(n);
|
|
3626
3718
|
}
|
|
3627
3719
|
}
|
|
3628
|
-
function
|
|
3720
|
+
function Oo(e) {
|
|
3629
3721
|
if (e.kind !== "reasoning") return;
|
|
3630
3722
|
let { part: t } = e;
|
|
3631
|
-
if (t.type === "reasoning") return
|
|
3723
|
+
if (t.type === "reasoning") return wo(t.text, 96);
|
|
3632
3724
|
}
|
|
3633
|
-
function
|
|
3725
|
+
function ko(e, t, n) {
|
|
3634
3726
|
if (e.kind === "reasoning") return {
|
|
3635
3727
|
form: "call",
|
|
3636
3728
|
kind: "reasoning",
|
|
3637
3729
|
name: "reasoning",
|
|
3638
|
-
detail:
|
|
3730
|
+
detail: Oo(e)
|
|
3639
3731
|
};
|
|
3640
3732
|
if (e.kind === "dynamic-tool" && e.part.type === "dynamic-tool") {
|
|
3641
3733
|
let t = e.part;
|
|
3642
3734
|
return {
|
|
3643
3735
|
form: "call",
|
|
3644
3736
|
kind: "dynamic-tool",
|
|
3645
|
-
name: t.toolName || "
|
|
3646
|
-
args:
|
|
3647
|
-
detail:
|
|
3737
|
+
name: t.toolName || n("steps.unnamedTool"),
|
|
3738
|
+
args: Eo(t.input),
|
|
3739
|
+
detail: Do(t.input)
|
|
3648
3740
|
};
|
|
3649
3741
|
}
|
|
3650
3742
|
if (e.kind === "tool" && S(e.part)) {
|
|
3651
|
-
let n = e.part, { toolEntry: r, toolKey: i } =
|
|
3743
|
+
let n = e.part, { toolEntry: r, toolKey: i } = Ti(n, t), a = r?.label?.(n);
|
|
3652
3744
|
return a?.kind === "sentence" ? {
|
|
3653
3745
|
form: "sentence",
|
|
3654
3746
|
kind: "tool",
|
|
@@ -3659,69 +3751,59 @@ function wo(e, t) {
|
|
|
3659
3751
|
form: "call",
|
|
3660
3752
|
kind: "tool",
|
|
3661
3753
|
name: a?.name ?? i,
|
|
3662
|
-
args: a?.args ??
|
|
3663
|
-
detail: a?.detail ??
|
|
3754
|
+
args: a?.args ?? Eo(n.input),
|
|
3755
|
+
detail: a?.detail ?? Do(n.input),
|
|
3664
3756
|
isError: a?.isError
|
|
3665
3757
|
};
|
|
3666
3758
|
}
|
|
3667
3759
|
return {
|
|
3668
3760
|
form: "call",
|
|
3669
3761
|
kind: "tool",
|
|
3670
|
-
name: "
|
|
3762
|
+
name: n("steps.unknownStep")
|
|
3671
3763
|
};
|
|
3672
3764
|
}
|
|
3673
|
-
function
|
|
3765
|
+
function Ao(e) {
|
|
3674
3766
|
if (!e) return;
|
|
3675
3767
|
let t = Object.entries(e).filter((e) => typeof e[1] == "string" && e[1].trim().length > 0);
|
|
3676
|
-
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${
|
|
3768
|
+
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${wo(t, 36)}`).join(", ");
|
|
3677
3769
|
}
|
|
3678
|
-
function
|
|
3679
|
-
let t =
|
|
3770
|
+
function jo(e) {
|
|
3771
|
+
let t = Ao(e.args);
|
|
3680
3772
|
return t ? `${e.name}(${t})` : e.name;
|
|
3681
3773
|
}
|
|
3682
|
-
function
|
|
3774
|
+
function Mo(e) {
|
|
3683
3775
|
return e === "output-available" || e === "output-error" || e === "output-denied";
|
|
3684
3776
|
}
|
|
3685
|
-
function
|
|
3686
|
-
return !!e && !
|
|
3777
|
+
function No(e) {
|
|
3778
|
+
return !!e && !Mo(e);
|
|
3687
3779
|
}
|
|
3688
|
-
function
|
|
3689
|
-
return
|
|
3780
|
+
function Po(e, t) {
|
|
3781
|
+
return on(e, t);
|
|
3690
3782
|
}
|
|
3691
|
-
function
|
|
3692
|
-
return e.some(({ segment: e }) =>
|
|
3693
|
-
let t =
|
|
3783
|
+
function Fo({ items: e, labels: t, status: n, hasLaterText: r }) {
|
|
3784
|
+
return e.some(({ segment: e }) => Po(xo(e), n)) ? "aborted" : !r && (n === "streaming" || n === "submitted") ? "running" : t.some((e) => e.isError) || e.some(({ segment: e }) => {
|
|
3785
|
+
let t = xo(e);
|
|
3694
3786
|
return t === "output-error" || t === "output-denied";
|
|
3695
|
-
}) ? "error" : e.some(({ segment: e }) =>
|
|
3696
|
-
}
|
|
3697
|
-
function jo(e) {
|
|
3698
|
-
return e && `${e[0].toUpperCase()}${e.slice(1)}`;
|
|
3787
|
+
}) ? "error" : e.some(({ segment: e }) => No(xo(e))) || !r && t.every((e) => e.kind === "reasoning") && (n === "streaming" || n === "submitted") ? "running" : "complete";
|
|
3699
3788
|
}
|
|
3700
|
-
function
|
|
3789
|
+
function Io(e) {
|
|
3701
3790
|
return e.filter((e) => e.kind !== "reasoning").length;
|
|
3702
3791
|
}
|
|
3703
|
-
function
|
|
3704
|
-
let n = Mo(e);
|
|
3705
|
-
if (n !== 0) return `${t === "running" || t === "aborted" ? "running" : "ran"} ${n} ${n === 1 ? "tool" : "tools"}`;
|
|
3706
|
-
}
|
|
3707
|
-
function Po(e, t) {
|
|
3708
|
-
let n = No(e, t);
|
|
3709
|
-
if (n) return jo(t === "error" ? `${n} with issues` : t === "aborted" ? `cancelled after ${n}` : n);
|
|
3710
|
-
}
|
|
3711
|
-
function Fo(e) {
|
|
3792
|
+
function Lo(e) {
|
|
3712
3793
|
let t = e.findLast((e) => e.kind !== "reasoning");
|
|
3713
3794
|
return t?.form === "sentence" ? t : void 0;
|
|
3714
3795
|
}
|
|
3715
|
-
function
|
|
3716
|
-
let
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3796
|
+
function Ro(e, t, n, r) {
|
|
3797
|
+
let i = e.length === 1 ? e[0] : void 0;
|
|
3798
|
+
return t === "running" ? r || (i?.kind === "reasoning" ? n("steps.reasoning", { detail: i.detail }) : e.every((e) => e.kind === "reasoning") ? n("steps.reasoning", { detail: void 0 }) : n("steps.working")) : i?.form === "call" ? i.kind === "reasoning" && t === "complete" ? n("steps.reasoned", { detail: i.detail }) : n("steps.call", {
|
|
3799
|
+
call: jo(i),
|
|
3800
|
+
status: t
|
|
3801
|
+
}) : e.every((e) => e.kind === "reasoning") ? n("steps.reasoned", { detail: void 0 }) : n("steps.tools", {
|
|
3802
|
+
count: Io(e),
|
|
3803
|
+
status: t
|
|
3804
|
+
});
|
|
3723
3805
|
}
|
|
3724
|
-
function
|
|
3806
|
+
function zo(e, t) {
|
|
3725
3807
|
if (t !== "running") {
|
|
3726
3808
|
if (e.length === 1) {
|
|
3727
3809
|
let t = e[0];
|
|
@@ -3730,28 +3812,28 @@ function Lo(e, t) {
|
|
|
3730
3812
|
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.form === "sentence" ? e.text : e.name))).slice(0, 3).join(", ") || void 0;
|
|
3731
3813
|
}
|
|
3732
3814
|
}
|
|
3733
|
-
function
|
|
3815
|
+
function Bo(e) {
|
|
3734
3816
|
let t;
|
|
3735
3817
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
3736
3818
|
let r = e[n].segment;
|
|
3737
3819
|
if (r.kind === "dynamic-tool" && r.part.type === "dynamic-tool") {
|
|
3738
|
-
let e =
|
|
3820
|
+
let e = Do(r.part.input);
|
|
3739
3821
|
if (e) return e;
|
|
3740
3822
|
}
|
|
3741
3823
|
if (r.kind === "tool" && S(r.part)) {
|
|
3742
|
-
let e =
|
|
3824
|
+
let e = Do(r.part.input);
|
|
3743
3825
|
if (e) return e;
|
|
3744
3826
|
}
|
|
3745
|
-
r.kind === "reasoning" && (t ??=
|
|
3827
|
+
r.kind === "reasoning" && (t ??= Oo(r));
|
|
3746
3828
|
}
|
|
3747
3829
|
return t;
|
|
3748
3830
|
}
|
|
3749
|
-
function
|
|
3750
|
-
return !e || e.role !== "assistant" ? !1 :
|
|
3831
|
+
function Vo(e, t) {
|
|
3832
|
+
return !e || e.role !== "assistant" ? !1 : bo(ma(e.parts), t).some((e) => e.kind === "group" && !e.hasLaterText);
|
|
3751
3833
|
}
|
|
3752
|
-
function
|
|
3753
|
-
let e = O(8), { message: t } =
|
|
3754
|
-
e[0] === t.parts ? r = e[1] : (r =
|
|
3834
|
+
function Ho() {
|
|
3835
|
+
let e = O(8), { message: t } = G(), { debugMode: n } = z(), r;
|
|
3836
|
+
e[0] === t.parts ? r = e[1] : (r = ma(t.parts), e[0] = t.parts, e[1] = r);
|
|
3755
3837
|
let i = r, a;
|
|
3756
3838
|
if (e[2] !== n || e[3] !== t.id || e[4] !== i) {
|
|
3757
3839
|
let r;
|
|
@@ -3760,60 +3842,60 @@ function Bo() {
|
|
|
3760
3842
|
key: `${t.id}-${e.firstIndex}-group-${e.hasLaterText ? "past" : "current"}`
|
|
3761
3843
|
} : {
|
|
3762
3844
|
...e,
|
|
3763
|
-
key: `${t.id}-${
|
|
3764
|
-
}, e[6] = t.id, e[7] = r), a =
|
|
3845
|
+
key: `${t.id}-${Z(e.segment, e.segmentIndex)}-${e.segment.kind}`
|
|
3846
|
+
}, e[6] = t.id, e[7] = r), a = bo(i, n).map(r), e[2] = n, e[3] = t.id, e[4] = i, e[5] = a;
|
|
3765
3847
|
} else a = e[5];
|
|
3766
3848
|
return a;
|
|
3767
3849
|
}
|
|
3768
|
-
var
|
|
3769
|
-
function
|
|
3770
|
-
let e = l(
|
|
3850
|
+
var Uo = o(null);
|
|
3851
|
+
function Wo() {
|
|
3852
|
+
let e = l(Uo);
|
|
3771
3853
|
if (!e) throw Error("CompactTrajectory group parts must be rendered within CompactTrajectory.Group");
|
|
3772
3854
|
return e;
|
|
3773
3855
|
}
|
|
3774
|
-
function
|
|
3775
|
-
let t = O(
|
|
3776
|
-
if (t[0] !== n.hasLaterText || t[1] !== n.items || t[2] !== i || t[3] !== o) {
|
|
3856
|
+
function Go(e) {
|
|
3857
|
+
let t = O(23), { group: n, children: r } = e, { registry: i } = z(), { message: a } = G(), o = W(), s = K(), [c, l] = g(!n.hasLaterText), u, d, f;
|
|
3858
|
+
if (t[0] !== n.hasLaterText || t[1] !== n.items || t[2] !== i || t[3] !== o || t[4] !== s) {
|
|
3777
3859
|
let e;
|
|
3778
|
-
t[
|
|
3860
|
+
t[8] !== i || t[9] !== s ? (e = (e) => {
|
|
3779
3861
|
let { segment: t } = e;
|
|
3780
|
-
return
|
|
3781
|
-
}, t[
|
|
3862
|
+
return ko(t, i, s);
|
|
3863
|
+
}, t[8] = i, t[9] = s, t[10] = e) : e = t[10], d = n.items.map(e), u = Fo({
|
|
3782
3864
|
items: n.items,
|
|
3783
|
-
labels:
|
|
3865
|
+
labels: d,
|
|
3784
3866
|
status: o,
|
|
3785
3867
|
hasLaterText: n.hasLaterText
|
|
3786
|
-
}),
|
|
3787
|
-
groupStatus:
|
|
3788
|
-
labelCount:
|
|
3789
|
-
}), t[0] = n.hasLaterText, t[1] = n.items, t[2] = i, t[3] = o, t[4] =
|
|
3790
|
-
} else
|
|
3791
|
-
let
|
|
3792
|
-
t[
|
|
3868
|
+
}), f = So({
|
|
3869
|
+
groupStatus: u,
|
|
3870
|
+
labelCount: d.length
|
|
3871
|
+
}), t[0] = n.hasLaterText, t[1] = n.items, t[2] = i, t[3] = o, t[4] = s, t[5] = u, t[6] = d, t[7] = f;
|
|
3872
|
+
} else u = t[5], d = t[6], f = t[7];
|
|
3873
|
+
let p = f, m;
|
|
3874
|
+
t[11] !== n.items || t[12] !== u || t[13] !== d || t[14] !== a.id || t[15] !== p ? (m = {
|
|
3793
3875
|
items: n.items,
|
|
3794
|
-
labels:
|
|
3795
|
-
groupStatus:
|
|
3796
|
-
tone:
|
|
3876
|
+
labels: d,
|
|
3877
|
+
groupStatus: u,
|
|
3878
|
+
tone: p,
|
|
3797
3879
|
messageId: a.id
|
|
3798
|
-
}, t[
|
|
3799
|
-
let
|
|
3800
|
-
t[
|
|
3801
|
-
open:
|
|
3802
|
-
onOpenChange:
|
|
3880
|
+
}, t[11] = n.items, t[12] = u, t[13] = d, t[14] = a.id, t[15] = p, t[16] = m) : m = t[16];
|
|
3881
|
+
let h;
|
|
3882
|
+
t[17] !== r || t[18] !== c ? (h = /* @__PURE__ */ M(F, {
|
|
3883
|
+
open: c,
|
|
3884
|
+
onOpenChange: l,
|
|
3803
3885
|
className: "my-2 min-w-0",
|
|
3804
3886
|
children: r
|
|
3805
|
-
}), t[
|
|
3806
|
-
let
|
|
3807
|
-
return t[
|
|
3808
|
-
value:
|
|
3809
|
-
children:
|
|
3810
|
-
}), t[
|
|
3887
|
+
}), t[17] = r, t[18] = c, t[19] = h) : h = t[19];
|
|
3888
|
+
let _;
|
|
3889
|
+
return t[20] !== m || t[21] !== h ? (_ = /* @__PURE__ */ M(Uo, {
|
|
3890
|
+
value: m,
|
|
3891
|
+
children: h
|
|
3892
|
+
}), t[20] = m, t[21] = h, t[22] = _) : _ = t[22], _;
|
|
3811
3893
|
}
|
|
3812
|
-
function
|
|
3894
|
+
function Ko(e) {
|
|
3813
3895
|
let t = O(3), { children: n } = e, r;
|
|
3814
3896
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M("button", {
|
|
3815
3897
|
type: "button",
|
|
3816
|
-
className:
|
|
3898
|
+
className: dn("items-start")
|
|
3817
3899
|
}), t[0] = r) : r = t[0];
|
|
3818
3900
|
let i;
|
|
3819
3901
|
return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ M(L, {
|
|
@@ -3824,40 +3906,40 @@ function Wo(e) {
|
|
|
3824
3906
|
})
|
|
3825
3907
|
}), t[1] = n, t[2] = i), i;
|
|
3826
3908
|
}
|
|
3827
|
-
function
|
|
3828
|
-
let e = O(
|
|
3829
|
-
e[0] === n ?
|
|
3830
|
-
let
|
|
3831
|
-
if (
|
|
3832
|
-
let t =
|
|
3833
|
-
return e[2] !== r || e[3] !==
|
|
3834
|
-
title:
|
|
3909
|
+
function qo() {
|
|
3910
|
+
let e = O(21), { items: t, labels: n, groupStatus: r, tone: i } = Wo(), a = K(), o;
|
|
3911
|
+
e[0] === n ? o = e[1] : (o = Lo(n), e[0] = n, e[1] = o);
|
|
3912
|
+
let s = o;
|
|
3913
|
+
if (s) {
|
|
3914
|
+
let t = Io(n) - 1, a = t > 0 ? t : void 0, o;
|
|
3915
|
+
return e[2] !== r || e[3] !== s.detail || e[4] !== s.text || e[5] !== a || e[6] !== i ? (o = {
|
|
3916
|
+
title: s.text,
|
|
3835
3917
|
more: a,
|
|
3836
|
-
detail:
|
|
3918
|
+
detail: s.detail,
|
|
3837
3919
|
isSentence: !0,
|
|
3838
3920
|
tone: i,
|
|
3839
3921
|
groupStatus: r
|
|
3840
|
-
}, e[2] = r, e[3] =
|
|
3922
|
+
}, e[2] = r, e[3] = s.detail, e[4] = s.text, e[5] = a, e[6] = i, e[7] = o) : o = e[7], o;
|
|
3841
3923
|
}
|
|
3842
|
-
let
|
|
3843
|
-
e[8] !== r || e[9] !== t || e[10] !== n ? (
|
|
3844
|
-
let
|
|
3845
|
-
e[
|
|
3846
|
-
let
|
|
3847
|
-
return e[
|
|
3848
|
-
title:
|
|
3924
|
+
let c;
|
|
3925
|
+
e[8] !== r || e[9] !== t || e[10] !== n || e[11] !== a ? (c = Ro(n, r, a, Bo(t)), e[8] = r, e[9] = t, e[10] = n, e[11] = a, e[12] = c) : c = e[12];
|
|
3926
|
+
let l = c, u;
|
|
3927
|
+
e[13] !== r || e[14] !== n ? (u = zo(n, r), e[13] = r, e[14] = n, e[15] = u) : u = e[15];
|
|
3928
|
+
let d = u, f;
|
|
3929
|
+
return e[16] !== d || e[17] !== r || e[18] !== l || e[19] !== i ? (f = {
|
|
3930
|
+
title: l,
|
|
3849
3931
|
more: void 0,
|
|
3850
|
-
detail:
|
|
3932
|
+
detail: d,
|
|
3851
3933
|
isSentence: !1,
|
|
3852
3934
|
tone: i,
|
|
3853
3935
|
groupStatus: r
|
|
3854
|
-
}, e[
|
|
3936
|
+
}, e[16] = d, e[17] = r, e[18] = l, e[19] = i, e[20] = f) : f = e[20], f;
|
|
3855
3937
|
}
|
|
3856
|
-
function
|
|
3857
|
-
let t = O(14), { title: n, suffix: r, children: i } = e, a =
|
|
3938
|
+
function Jo(e) {
|
|
3939
|
+
let t = O(14), { title: n, suffix: r, children: i } = e, a = qo(), { tone: o, groupStatus: s } = a, c = n === void 0, l = n ?? a.title, u = r ? `${l} · ${r}` : l, d = c ? a.more : void 0, f = s === "running" ? "text-info" : o.title, p = c && a.isSentence ? "auto" : void 0, m = s === "running", h;
|
|
3858
3940
|
t[0] === f ? h = t[1] : (h = k("max-w-full min-w-0 truncate", f), t[0] = f, t[1] = h);
|
|
3859
3941
|
let g;
|
|
3860
|
-
t[2] !== p || t[3] !== m || t[4] !== h || t[5] !== u ? (g = /* @__PURE__ */ M(
|
|
3942
|
+
t[2] !== p || t[3] !== m || t[4] !== h || t[5] !== u ? (g = /* @__PURE__ */ M(H, {
|
|
3861
3943
|
as: "span",
|
|
3862
3944
|
dir: p,
|
|
3863
3945
|
enabled: m,
|
|
@@ -3880,12 +3962,12 @@ function Ko(e) {
|
|
|
3880
3962
|
]
|
|
3881
3963
|
}), t[10] = i, t[11] = g, t[12] = _, t[13] = v) : v = t[13], v;
|
|
3882
3964
|
}
|
|
3883
|
-
function
|
|
3884
|
-
let e = O(2), { tone: t } =
|
|
3885
|
-
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(
|
|
3965
|
+
function Yo() {
|
|
3966
|
+
let e = O(2), { tone: t } = Wo(), n;
|
|
3967
|
+
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(un, { className: t.chevron }), e[0] = t.chevron, e[1] = n), n;
|
|
3886
3968
|
}
|
|
3887
|
-
function
|
|
3888
|
-
let t = O(6), { detail: n } = e, { title: r, detail: i, isSentence: a, tone: o } =
|
|
3969
|
+
function Xo(e) {
|
|
3970
|
+
let t = O(6), { detail: n } = e, { title: r, detail: i, isSentence: a, tone: o } = qo();
|
|
3889
3971
|
if (n === null) return null;
|
|
3890
3972
|
let s = n ?? i;
|
|
3891
3973
|
if (!s || s === r) return null;
|
|
@@ -3898,8 +3980,8 @@ function Jo(e) {
|
|
|
3898
3980
|
children: s
|
|
3899
3981
|
}), t[2] = s, t[3] = c, t[4] = l, t[5] = u) : u = t[5], u;
|
|
3900
3982
|
}
|
|
3901
|
-
function
|
|
3902
|
-
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } =
|
|
3983
|
+
function Zo(e) {
|
|
3984
|
+
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } = Wo(), o = a === "running", s;
|
|
3903
3985
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
3904
3986
|
initial: "instant",
|
|
3905
3987
|
resize: "instant"
|
|
@@ -3908,8 +3990,8 @@ function Yo(e) {
|
|
|
3908
3990
|
t[1] === d ? f = t[2] : (f = k("mt-2", d), t[1] = d, t[2] = f);
|
|
3909
3991
|
let p = o ? l : void 0, m;
|
|
3910
3992
|
t[3] !== n || t[4] !== r || t[5] !== i ? (m = n ?? r.map((e, t) => {
|
|
3911
|
-
let { segment: n } = e, r = `${i}-${
|
|
3912
|
-
return n.kind === "tool" ? /* @__PURE__ */ M(
|
|
3993
|
+
let { segment: n } = e, r = `${i}-${Z(n, t)}-${n.kind}`;
|
|
3994
|
+
return n.kind === "tool" ? /* @__PURE__ */ M(X.Tool, { segment: n }, r) : n.kind === "reasoning" ? /* @__PURE__ */ M(X.Reasoning, { segment: n }, r) : n.kind === "dynamic-tool" ? /* @__PURE__ */ M(X.DynamicTool, { segment: n }, r) : null;
|
|
3913
3995
|
}), t[3] = n, t[4] = r, t[5] = i, t[6] = m) : m = t[6];
|
|
3914
3996
|
let h;
|
|
3915
3997
|
t[7] !== p || t[8] !== m ? (h = /* @__PURE__ */ M("div", {
|
|
@@ -3923,11 +4005,11 @@ function Yo(e) {
|
|
|
3923
4005
|
children: h
|
|
3924
4006
|
}), t[10] = u, t[11] = f, t[12] = h, t[13] = g) : g = t[13], g;
|
|
3925
4007
|
}
|
|
3926
|
-
function
|
|
3927
|
-
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } =
|
|
4008
|
+
function Qo(e) {
|
|
4009
|
+
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } = U(), { segment: o } = n;
|
|
3928
4010
|
if (o.kind === "text") {
|
|
3929
4011
|
let e;
|
|
3930
|
-
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(
|
|
4012
|
+
t[0] === o.parts ? e = t[1] : (e = o.parts.filter($o), t[0] = o.parts, t[1] = e);
|
|
3931
4013
|
let n = e;
|
|
3932
4014
|
if (n.length === 0) return null;
|
|
3933
4015
|
let r;
|
|
@@ -3936,7 +4018,7 @@ function Xo(e) {
|
|
|
3936
4018
|
parts: n
|
|
3937
4019
|
}, t[2] = o, t[3] = n, t[4] = r) : r = t[4];
|
|
3938
4020
|
let s;
|
|
3939
|
-
return t[5] !== a || t[6] !== r || t[7] !== i ? (s = /* @__PURE__ */ M(
|
|
4021
|
+
return t[5] !== a || t[6] !== r || t[7] !== i ? (s = /* @__PURE__ */ M(X.Text, {
|
|
3940
4022
|
segment: r,
|
|
3941
4023
|
elements: a,
|
|
3942
4024
|
className: i
|
|
@@ -3944,75 +4026,75 @@ function Xo(e) {
|
|
|
3944
4026
|
}
|
|
3945
4027
|
if (o.kind === "file") {
|
|
3946
4028
|
let e;
|
|
3947
|
-
return t[9] === o ? e = t[10] : (e = /* @__PURE__ */ M(
|
|
4029
|
+
return t[9] === o ? e = t[10] : (e = /* @__PURE__ */ M(X.File, { segment: o }), t[9] = o, t[10] = e), e;
|
|
3948
4030
|
}
|
|
3949
4031
|
if (o.kind === "source") {
|
|
3950
4032
|
let e;
|
|
3951
|
-
return t[11] === o ? e = t[12] : (e = /* @__PURE__ */ M(
|
|
4033
|
+
return t[11] === o ? e = t[12] : (e = /* @__PURE__ */ M(X.Source, { segment: o }), t[11] = o, t[12] = e), e;
|
|
3952
4034
|
}
|
|
3953
4035
|
if (o.kind === "tool") {
|
|
3954
4036
|
let e;
|
|
3955
|
-
return t[13] === o ? e = t[14] : (e = /* @__PURE__ */ M(
|
|
4037
|
+
return t[13] === o ? e = t[14] : (e = /* @__PURE__ */ M(X.Tool, { segment: o }), t[13] = o, t[14] = e), e;
|
|
3956
4038
|
}
|
|
3957
4039
|
if (o.kind === "reasoning") {
|
|
3958
4040
|
let e;
|
|
3959
|
-
return t[15] === o ? e = t[16] : (e = /* @__PURE__ */ M(
|
|
4041
|
+
return t[15] === o ? e = t[16] : (e = /* @__PURE__ */ M(X.Reasoning, { segment: o }), t[15] = o, t[16] = e), e;
|
|
3960
4042
|
}
|
|
3961
4043
|
if (o.kind === "dynamic-tool") {
|
|
3962
4044
|
let e;
|
|
3963
|
-
return t[17] === o ? e = t[18] : (e = /* @__PURE__ */ M(
|
|
4045
|
+
return t[17] === o ? e = t[18] : (e = /* @__PURE__ */ M(X.DynamicTool, { segment: o }), t[17] = o, t[18] = e), e;
|
|
3964
4046
|
}
|
|
3965
4047
|
return null;
|
|
3966
4048
|
}
|
|
3967
|
-
function
|
|
4049
|
+
function $o(e) {
|
|
3968
4050
|
let { part: t } = e;
|
|
3969
|
-
return
|
|
3970
|
-
}
|
|
3971
|
-
var
|
|
3972
|
-
Group:
|
|
3973
|
-
GroupTrigger:
|
|
3974
|
-
GroupTitle:
|
|
3975
|
-
GroupChevron:
|
|
3976
|
-
GroupDetail:
|
|
3977
|
-
GroupContent:
|
|
3978
|
-
Segment:
|
|
4051
|
+
return !$i(t);
|
|
4052
|
+
}
|
|
4053
|
+
var es = {
|
|
4054
|
+
Group: Go,
|
|
4055
|
+
GroupTrigger: Ko,
|
|
4056
|
+
GroupTitle: Jo,
|
|
4057
|
+
GroupChevron: Yo,
|
|
4058
|
+
GroupDetail: Xo,
|
|
4059
|
+
GroupContent: Zo,
|
|
4060
|
+
Segment: Qo
|
|
3979
4061
|
};
|
|
3980
|
-
function
|
|
3981
|
-
let e = O(1), t =
|
|
3982
|
-
if (t !== "ready" && t !== "error" &&
|
|
4062
|
+
function ts() {
|
|
4063
|
+
let e = O(1), t = W(), { messages: n } = U(), { debugMode: r } = z(), i = n[n.length - 1];
|
|
4064
|
+
if (t !== "ready" && t !== "error" && Vo(i, r)) return null;
|
|
3983
4065
|
let a;
|
|
3984
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
4066
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(Ia, {}), e[0] = a) : a = e[0], a;
|
|
3985
4067
|
}
|
|
3986
|
-
var
|
|
3987
|
-
Root:
|
|
3988
|
-
List:
|
|
3989
|
-
Item:
|
|
3990
|
-
UserBubble:
|
|
4068
|
+
var ns = {
|
|
4069
|
+
Root: Da,
|
|
4070
|
+
List: Oa,
|
|
4071
|
+
Item: ka,
|
|
4072
|
+
UserBubble: go,
|
|
3991
4073
|
AssistantContent: c(function(e) {
|
|
3992
|
-
let t = O(5), { className: n } = e, r =
|
|
3993
|
-
t[0] === r ? i = t[1] : (i = r.map(
|
|
4074
|
+
let t = O(5), { className: n } = e, r = Ho(), i;
|
|
4075
|
+
t[0] === r ? i = t[1] : (i = r.map(rs), t[0] = r, t[1] = i);
|
|
3994
4076
|
let a;
|
|
3995
4077
|
return t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M("div", {
|
|
3996
4078
|
className: n,
|
|
3997
4079
|
children: i
|
|
3998
4080
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
3999
4081
|
}),
|
|
4000
|
-
Actions:
|
|
4001
|
-
CopyAction:
|
|
4002
|
-
RegenerateAction:
|
|
4003
|
-
CopyDebugJsonAction:
|
|
4004
|
-
Thinking:
|
|
4005
|
-
Error:
|
|
4082
|
+
Actions: xa,
|
|
4083
|
+
CopyAction: Sa,
|
|
4084
|
+
RegenerateAction: Ca,
|
|
4085
|
+
CopyDebugJsonAction: wa,
|
|
4086
|
+
Thinking: ts,
|
|
4087
|
+
Error: Ea
|
|
4006
4088
|
};
|
|
4007
|
-
function
|
|
4008
|
-
return e.kind === "group" ? /* @__PURE__ */ N(
|
|
4089
|
+
function rs(e) {
|
|
4090
|
+
return e.kind === "group" ? /* @__PURE__ */ N(Go, {
|
|
4009
4091
|
group: e,
|
|
4010
|
-
children: [/* @__PURE__ */ N(
|
|
4011
|
-
}, e.key) : /* @__PURE__ */ M(
|
|
4092
|
+
children: [/* @__PURE__ */ N(Ko, { children: [/* @__PURE__ */ M(Jo, { children: /* @__PURE__ */ M(Yo, {}) }), /* @__PURE__ */ M(Xo, {})] }), /* @__PURE__ */ M(Zo, {})]
|
|
4093
|
+
}, e.key) : /* @__PURE__ */ M(Qo, { item: e }, e.key);
|
|
4012
4094
|
}
|
|
4013
4095
|
//#endregion
|
|
4014
4096
|
//#region src/lib/chat/trajectory/trajectories/messages.tsx
|
|
4015
|
-
function
|
|
4097
|
+
function is(e) {
|
|
4016
4098
|
let t = O(8), { message: n, className: r } = e, i;
|
|
4017
4099
|
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);
|
|
4018
4100
|
let a;
|
|
@@ -4025,7 +4107,7 @@ function ns(e) {
|
|
|
4025
4107
|
children: [a, o]
|
|
4026
4108
|
}), t[5] = i, t[6] = o, t[7] = s) : s = t[7], s;
|
|
4027
4109
|
}
|
|
4028
|
-
function
|
|
4110
|
+
function as(e) {
|
|
4029
4111
|
let t = O(9), { name: n, args: r } = e, i;
|
|
4030
4112
|
t[0] === r ? i = t[1] : (i = r ? Object.values(r)[0] : void 0, t[0] = r, t[1] = i);
|
|
4031
4113
|
let a = i, o;
|
|
@@ -4045,13 +4127,13 @@ function rs(e) {
|
|
|
4045
4127
|
let c;
|
|
4046
4128
|
return t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ N(j, { children: [o, s] }), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4047
4129
|
}
|
|
4048
|
-
function
|
|
4130
|
+
function os(e) {
|
|
4049
4131
|
let t = O(15), { part: n } = e, r = z(), i, a;
|
|
4050
4132
|
if (t[0] !== r.registry || t[1] !== n) {
|
|
4051
4133
|
a = Symbol.for("react.early_return_sentinel");
|
|
4052
4134
|
bb0: {
|
|
4053
|
-
let { toolEntry: e } =
|
|
4054
|
-
if (e &&
|
|
4135
|
+
let { toolEntry: e } = Ti(n, r.registry);
|
|
4136
|
+
if (e && Ei(e, n.state)) {
|
|
4055
4137
|
let t = e.label?.(n);
|
|
4056
4138
|
if (!t) {
|
|
4057
4139
|
a = null;
|
|
@@ -4064,7 +4146,7 @@ function is(e) {
|
|
|
4064
4146
|
dir: "auto",
|
|
4065
4147
|
className: "ms-2 truncate text-start",
|
|
4066
4148
|
children: t.text
|
|
4067
|
-
}) : /* @__PURE__ */ M(
|
|
4149
|
+
}) : /* @__PURE__ */ M(as, {
|
|
4068
4150
|
name: t.name,
|
|
4069
4151
|
args: t.args
|
|
4070
4152
|
})]
|
|
@@ -4077,14 +4159,14 @@ function is(e) {
|
|
|
4077
4159
|
} else i = t[2], a = t[3];
|
|
4078
4160
|
if (a !== Symbol.for("react.early_return_sentinel")) return a;
|
|
4079
4161
|
let o = i, s;
|
|
4080
|
-
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(
|
|
4162
|
+
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(Yi, {
|
|
4081
4163
|
label: o,
|
|
4082
4164
|
part: n
|
|
4083
4165
|
}), t[4] = o, t[5] = n, t[6] = s) : s = t[6];
|
|
4084
4166
|
let c;
|
|
4085
|
-
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(
|
|
4167
|
+
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(is, { message: o.detail }), t[7] = o, t[8] = c);
|
|
4086
4168
|
let l;
|
|
4087
|
-
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(
|
|
4169
|
+
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(Gi, { part: n }), t[9] = n, t[10] = l);
|
|
4088
4170
|
let u;
|
|
4089
4171
|
return t[11] !== s || t[12] !== c || t[13] !== l ? (u = /* @__PURE__ */ N(j, { children: [
|
|
4090
4172
|
s,
|
|
@@ -4092,9 +4174,9 @@ function is(e) {
|
|
|
4092
4174
|
l
|
|
4093
4175
|
] }), t[11] = s, t[12] = c, t[13] = l, t[14] = u) : u = t[14], u;
|
|
4094
4176
|
}
|
|
4095
|
-
function
|
|
4177
|
+
function ss(e) {
|
|
4096
4178
|
let t = O(5), { part: n } = e, [r, i] = g(!1), a;
|
|
4097
|
-
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(
|
|
4179
|
+
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(J, {
|
|
4098
4180
|
mode: "static",
|
|
4099
4181
|
children: n.text
|
|
4100
4182
|
}), t[0] = n.text, t[1] = a);
|
|
@@ -4102,7 +4184,7 @@ function as(e) {
|
|
|
4102
4184
|
return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
4103
4185
|
"data-copy-exclude": "assistant-snapshot",
|
|
4104
4186
|
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",
|
|
4105
|
-
children: /* @__PURE__ */ M(
|
|
4187
|
+
children: /* @__PURE__ */ M(to, {
|
|
4106
4188
|
label: "Reasoning",
|
|
4107
4189
|
open: r,
|
|
4108
4190
|
onOpenChange: i,
|
|
@@ -4113,12 +4195,12 @@ function as(e) {
|
|
|
4113
4195
|
})
|
|
4114
4196
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
4115
4197
|
}
|
|
4116
|
-
function
|
|
4117
|
-
let t = O(16), { part: n } = e, { elements: r } =
|
|
4198
|
+
function cs(e) {
|
|
4199
|
+
let t = O(16), { part: n } = e, { elements: r } = U(), i = Ki();
|
|
4118
4200
|
if (n.type === "text") {
|
|
4119
|
-
if (
|
|
4201
|
+
if ($i(n)) return null;
|
|
4120
4202
|
let e;
|
|
4121
|
-
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(
|
|
4203
|
+
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(Wi, {
|
|
4122
4204
|
text: n.text,
|
|
4123
4205
|
citations: n.citations,
|
|
4124
4206
|
elements: r
|
|
@@ -4126,19 +4208,19 @@ function os(e) {
|
|
|
4126
4208
|
}
|
|
4127
4209
|
if (n.type === "dynamic-tool") {
|
|
4128
4210
|
let e;
|
|
4129
|
-
return t[4] !== i || t[5] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
4211
|
+
return t[4] !== i || t[5] !== n ? (e = i ? /* @__PURE__ */ M(oi, { part: n }) : null, t[4] = i, t[5] = n, t[6] = e) : e = t[6], e;
|
|
4130
4212
|
}
|
|
4131
4213
|
if (S(n)) {
|
|
4132
4214
|
let e;
|
|
4133
|
-
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(
|
|
4215
|
+
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(os, { part: n }), t[7] = n, t[8] = e), e;
|
|
4134
4216
|
}
|
|
4135
4217
|
if (n.type === "reasoning" && n.text) {
|
|
4136
4218
|
let e;
|
|
4137
|
-
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
4219
|
+
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(ss, { part: n }) : null, t[9] = i, t[10] = n, t[11] = e) : e = t[11], e;
|
|
4138
4220
|
}
|
|
4139
4221
|
if (n.type === "file") {
|
|
4140
4222
|
let e;
|
|
4141
|
-
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(
|
|
4223
|
+
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(Ri, {
|
|
4142
4224
|
filename: n.filename,
|
|
4143
4225
|
mediaType: n.mediaType,
|
|
4144
4226
|
url: n.url
|
|
@@ -4146,13 +4228,13 @@ function os(e) {
|
|
|
4146
4228
|
}
|
|
4147
4229
|
return null;
|
|
4148
4230
|
}
|
|
4149
|
-
var
|
|
4150
|
-
let t = O(10), { className: n } = e, { message: r } =
|
|
4231
|
+
var ls = c(function(e) {
|
|
4232
|
+
let t = O(10), { className: n } = e, { message: r } = G(), i;
|
|
4151
4233
|
t[0] === n ? i = t[1] : (i = k("flex-1 space-y-3", n), t[0] = n, t[1] = i);
|
|
4152
4234
|
let a;
|
|
4153
4235
|
if (t[2] !== r.id || t[3] !== r.parts) {
|
|
4154
4236
|
let e;
|
|
4155
|
-
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(
|
|
4237
|
+
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(cs, { 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;
|
|
4156
4238
|
} else a = t[4];
|
|
4157
4239
|
let o;
|
|
4158
4240
|
return t[7] !== i || t[8] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
@@ -4160,13 +4242,13 @@ var ss = c(function(e) {
|
|
|
4160
4242
|
children: a
|
|
4161
4243
|
}), t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
4162
4244
|
});
|
|
4163
|
-
function
|
|
4245
|
+
function us(e) {
|
|
4164
4246
|
let t = O(9), { className: n, label: r } = e, i;
|
|
4165
|
-
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(
|
|
4247
|
+
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(ds).pop() || "Thinking...", t[0] = r, t[1] = i);
|
|
4166
4248
|
let a = i, o;
|
|
4167
4249
|
t[2] === n ? o = t[3] : (o = k("flex items-start", n), t[2] = n, t[3] = o);
|
|
4168
4250
|
let s;
|
|
4169
|
-
t[4] === a ? s = t[5] : (s = /* @__PURE__ */ M(
|
|
4251
|
+
t[4] === a ? s = t[5] : (s = /* @__PURE__ */ M(H, {
|
|
4170
4252
|
className: "text-muted-foreground line-clamp-2 text-sm",
|
|
4171
4253
|
children: a
|
|
4172
4254
|
}), t[4] = a, t[5] = s);
|
|
@@ -4177,33 +4259,33 @@ function cs(e) {
|
|
|
4177
4259
|
children: s
|
|
4178
4260
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4179
4261
|
}
|
|
4180
|
-
function
|
|
4262
|
+
function ds(e) {
|
|
4181
4263
|
return e.trim();
|
|
4182
4264
|
}
|
|
4183
|
-
function
|
|
4184
|
-
let e = O(5), t =
|
|
4185
|
-
e[0] !== t || e[1] !== r ? (i =
|
|
4265
|
+
function fs() {
|
|
4266
|
+
let e = O(5), t = W(), { messages: n } = U(), r = n[n.length - 1], i;
|
|
4267
|
+
e[0] !== t || e[1] !== r ? (i = Na(t, r), e[0] = t, e[1] = r, e[2] = i) : i = e[2];
|
|
4186
4268
|
let a = i;
|
|
4187
4269
|
if (!a) return null;
|
|
4188
4270
|
let o;
|
|
4189
|
-
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(
|
|
4271
|
+
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(us, {
|
|
4190
4272
|
label: a,
|
|
4191
4273
|
className: "mt-2"
|
|
4192
4274
|
}), e[3] = a, e[4] = o), o;
|
|
4193
4275
|
}
|
|
4194
|
-
var
|
|
4195
|
-
Root:
|
|
4196
|
-
List:
|
|
4197
|
-
Item:
|
|
4198
|
-
UserBubble:
|
|
4199
|
-
AssistantContent:
|
|
4200
|
-
Thinking:
|
|
4201
|
-
Error:
|
|
4202
|
-
Actions:
|
|
4203
|
-
CopyAction:
|
|
4204
|
-
RegenerateAction:
|
|
4205
|
-
CopyDebugJsonAction:
|
|
4206
|
-
},
|
|
4276
|
+
var ps = {
|
|
4277
|
+
Root: Da,
|
|
4278
|
+
List: Oa,
|
|
4279
|
+
Item: ka,
|
|
4280
|
+
UserBubble: go,
|
|
4281
|
+
AssistantContent: ls,
|
|
4282
|
+
Thinking: fs,
|
|
4283
|
+
Error: Ea,
|
|
4284
|
+
Actions: xa,
|
|
4285
|
+
CopyAction: Sa,
|
|
4286
|
+
RegenerateAction: Ca,
|
|
4287
|
+
CopyDebugJsonAction: wa
|
|
4288
|
+
}, ms = {
|
|
4207
4289
|
braille: {
|
|
4208
4290
|
frames: [
|
|
4209
4291
|
"⠋",
|
|
@@ -4270,10 +4352,10 @@ var ds = {
|
|
|
4270
4352
|
interval: 100
|
|
4271
4353
|
}
|
|
4272
4354
|
};
|
|
4273
|
-
function
|
|
4355
|
+
function hs(e) {
|
|
4274
4356
|
let t = O(15), n, r, i;
|
|
4275
4357
|
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);
|
|
4276
|
-
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } =
|
|
4358
|
+
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } = ms[a], [l, u] = g(0), f, p;
|
|
4277
4359
|
t[4] !== o || t[5] !== s.length || t[6] !== c ? (f = () => {
|
|
4278
4360
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
4279
4361
|
let e = o.setInterval(() => {
|
|
@@ -4298,9 +4380,9 @@ function ps(e) {
|
|
|
4298
4380
|
}
|
|
4299
4381
|
//#endregion
|
|
4300
4382
|
//#region src/lib/chat/trajectory/trajectories/timeline.tsx
|
|
4301
|
-
function
|
|
4383
|
+
function gs(e) {
|
|
4302
4384
|
let t = O(11), { Icon: n, isLast: r, isLoading: i, aborted: a, state: o, isError: s } = e, c;
|
|
4303
|
-
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(
|
|
4385
|
+
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(hs, { 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];
|
|
4304
4386
|
let l;
|
|
4305
4387
|
t[6] === r ? l = t[7] : (l = !r && /* @__PURE__ */ M("span", { className: "bg-border w-px flex-1" }), t[6] = r, t[7] = l);
|
|
4306
4388
|
let u;
|
|
@@ -4309,16 +4391,16 @@ function ms(e) {
|
|
|
4309
4391
|
children: [c, l]
|
|
4310
4392
|
}), t[8] = c, t[9] = l, t[10] = u) : u = t[10], u;
|
|
4311
4393
|
}
|
|
4312
|
-
function
|
|
4313
|
-
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(
|
|
4314
|
-
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(
|
|
4394
|
+
function _s(e) {
|
|
4395
|
+
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(oa), 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;
|
|
4396
|
+
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(gs, {
|
|
4315
4397
|
Icon: f,
|
|
4316
4398
|
isLast: n,
|
|
4317
4399
|
isLoading: p,
|
|
4318
4400
|
aborted: d,
|
|
4319
4401
|
state: u,
|
|
4320
4402
|
isError: c?.isError ?? !1
|
|
4321
|
-
}) : /* @__PURE__ */ M(
|
|
4403
|
+
}) : /* @__PURE__ */ M(Pa, { 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];
|
|
4322
4404
|
let h = m, g = n ? "" : "pb-3.5", _;
|
|
4323
4405
|
t[7] === g ? _ = t[8] : (_ = k("min-w-0 flex-1", g), t[7] = g, t[8] = _);
|
|
4324
4406
|
let v;
|
|
@@ -4327,16 +4409,16 @@ function hs(e) {
|
|
|
4327
4409
|
children: o
|
|
4328
4410
|
}), t[9] = o, t[10] = _, t[11] = v) : v = t[11];
|
|
4329
4411
|
let y;
|
|
4330
|
-
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(
|
|
4412
|
+
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(Fa, {
|
|
4331
4413
|
marker: h,
|
|
4332
4414
|
children: v
|
|
4333
4415
|
}), t[12] = h, t[13] = v, t[14] = y) : y = t[14], y;
|
|
4334
4416
|
}
|
|
4335
|
-
function
|
|
4417
|
+
function vs(e) {
|
|
4336
4418
|
let t = O(10), { label: n, state: r, part: i, defaultOpen: a, children: o } = e, s = a !== void 0 && a, c;
|
|
4337
4419
|
t[0] !== n || t[1] !== i || t[2] !== r ? (c = /* @__PURE__ */ M(L, {
|
|
4338
4420
|
className: "cursor-pointer",
|
|
4339
|
-
children: /* @__PURE__ */ M(
|
|
4421
|
+
children: /* @__PURE__ */ M(Zi, {
|
|
4340
4422
|
label: n,
|
|
4341
4423
|
state: r,
|
|
4342
4424
|
part: i
|
|
@@ -4351,58 +4433,58 @@ function gs(e) {
|
|
|
4351
4433
|
children: [c, l]
|
|
4352
4434
|
}), t[6] = s, t[7] = c, t[8] = l, t[9] = u) : u = t[9], u;
|
|
4353
4435
|
}
|
|
4354
|
-
var
|
|
4355
|
-
Item:
|
|
4356
|
-
Disclosure:
|
|
4357
|
-
},
|
|
4358
|
-
Root:
|
|
4359
|
-
List:
|
|
4360
|
-
Item:
|
|
4361
|
-
UserBubble:
|
|
4436
|
+
var ys = {
|
|
4437
|
+
Item: _s,
|
|
4438
|
+
Disclosure: vs
|
|
4439
|
+
}, bs = {
|
|
4440
|
+
Root: Da,
|
|
4441
|
+
List: Oa,
|
|
4442
|
+
Item: ka,
|
|
4443
|
+
UserBubble: go,
|
|
4362
4444
|
AssistantContent: c(function(e) {
|
|
4363
|
-
let t = O(12), { className: n } = e, { message: r } =
|
|
4364
|
-
t[0] === r.parts ? c = t[1] : (c =
|
|
4445
|
+
let t = O(12), { className: n } = e, { message: r } = G(), { elements: i } = U(), { debugMode: a } = z(), o = Ki(), s = Y(), c;
|
|
4446
|
+
t[0] === r.parts ? c = t[1] : (c = ma(r.parts), t[0] = r.parts, t[1] = c);
|
|
4365
4447
|
let l = c, u;
|
|
4366
4448
|
t[2] !== a || t[3] !== i || t[4] !== s || t[5] !== r.id || t[6] !== l || t[7] !== o ? (u = l.map((e, t) => {
|
|
4367
|
-
let n = `${r.id}-${
|
|
4368
|
-
if (e.kind === "text") return /* @__PURE__ */ M(
|
|
4449
|
+
let n = `${r.id}-${Z(e, t)}-${e.kind}`;
|
|
4450
|
+
if (e.kind === "text") return /* @__PURE__ */ M(X.Text, {
|
|
4369
4451
|
segment: e,
|
|
4370
4452
|
elements: i,
|
|
4371
4453
|
className: "my-4"
|
|
4372
4454
|
}, n);
|
|
4373
|
-
if (e.kind === "file") return /* @__PURE__ */ M(
|
|
4374
|
-
if (e.kind === "source") return /* @__PURE__ */ M(
|
|
4455
|
+
if (e.kind === "file") return /* @__PURE__ */ M(X.File, { segment: e }, n);
|
|
4456
|
+
if (e.kind === "source") return /* @__PURE__ */ M(X.Source, { segment: e }, n);
|
|
4375
4457
|
if (e.kind === "dynamic-tool") {
|
|
4376
4458
|
if (!o) return null;
|
|
4377
|
-
let r = !
|
|
4378
|
-
return /* @__PURE__ */ M(
|
|
4459
|
+
let r = !pa(l, t, !0);
|
|
4460
|
+
return /* @__PURE__ */ M(ys.Item, {
|
|
4379
4461
|
isLast: r,
|
|
4380
|
-
children: /* @__PURE__ */ M(
|
|
4462
|
+
children: /* @__PURE__ */ M(X.DynamicTool, { segment: e })
|
|
4381
4463
|
}, n);
|
|
4382
4464
|
}
|
|
4383
4465
|
if (e.kind === "reasoning") {
|
|
4384
4466
|
if (s || e.part.type !== "reasoning") return null;
|
|
4385
|
-
let r = !
|
|
4467
|
+
let r = !pa(l, t, a), i = {
|
|
4386
4468
|
name: "Reasoning",
|
|
4387
4469
|
icon: Je,
|
|
4388
4470
|
args: { text: [...e.part.text].slice(0, 60).join("") }
|
|
4389
4471
|
};
|
|
4390
|
-
return /* @__PURE__ */ M(
|
|
4472
|
+
return /* @__PURE__ */ M(ys.Item, {
|
|
4391
4473
|
isLast: r,
|
|
4392
4474
|
label: i,
|
|
4393
|
-
children: /* @__PURE__ */ M(
|
|
4475
|
+
children: /* @__PURE__ */ M(ys.Disclosure, {
|
|
4394
4476
|
label: i,
|
|
4395
|
-
children: /* @__PURE__ */ M(
|
|
4477
|
+
children: /* @__PURE__ */ M(X.Reasoning, { segment: e })
|
|
4396
4478
|
})
|
|
4397
4479
|
}, n);
|
|
4398
4480
|
}
|
|
4399
4481
|
if (e.kind === "tool") {
|
|
4400
|
-
let r = !
|
|
4401
|
-
return /* @__PURE__ */ M(
|
|
4482
|
+
let r = !pa(l, t, a);
|
|
4483
|
+
return /* @__PURE__ */ M(X.Tool, {
|
|
4402
4484
|
segment: e,
|
|
4403
|
-
children: /* @__PURE__ */ M(
|
|
4485
|
+
children: /* @__PURE__ */ M(ys.Item, {
|
|
4404
4486
|
isLast: r,
|
|
4405
|
-
children: /* @__PURE__ */ M(
|
|
4487
|
+
children: /* @__PURE__ */ M(X.ToolDisclosure, {})
|
|
4406
4488
|
})
|
|
4407
4489
|
}, n);
|
|
4408
4490
|
}
|
|
@@ -4414,19 +4496,19 @@ var _s = {
|
|
|
4414
4496
|
children: u
|
|
4415
4497
|
}), t[9] = n, t[10] = u, t[11] = d) : d = t[11], d;
|
|
4416
4498
|
}),
|
|
4417
|
-
Actions:
|
|
4418
|
-
CopyAction:
|
|
4419
|
-
RegenerateAction:
|
|
4420
|
-
CopyDebugJsonAction:
|
|
4421
|
-
Thinking:
|
|
4422
|
-
Error:
|
|
4499
|
+
Actions: xa,
|
|
4500
|
+
CopyAction: Sa,
|
|
4501
|
+
RegenerateAction: Ca,
|
|
4502
|
+
CopyDebugJsonAction: wa,
|
|
4503
|
+
Thinking: Ia,
|
|
4504
|
+
Error: Ea
|
|
4423
4505
|
};
|
|
4424
4506
|
//#endregion
|
|
4425
4507
|
//#region src/lib/components/ChatComposer.tsx
|
|
4426
|
-
function
|
|
4508
|
+
function xs(e) {
|
|
4427
4509
|
let t = O(9), n, r;
|
|
4428
4510
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4429
|
-
let { hasSubmitted: i } =
|
|
4511
|
+
let { hasSubmitted: i } = Qt(), a;
|
|
4430
4512
|
t[3] === n ? a = t[4] : (a = k("bg-background sticky bottom-0 rounded-t-2xl border-0 **:data-[slot=composer-editor]:!min-h-15", n), t[3] = n, t[4] = a);
|
|
4431
4513
|
let o;
|
|
4432
4514
|
return t[5] !== i || t[6] !== r || t[7] !== a ? (o = /* @__PURE__ */ M(R.Root, {
|
|
@@ -4435,7 +4517,7 @@ function ys(e) {
|
|
|
4435
4517
|
...r
|
|
4436
4518
|
}), t[5] = i, t[6] = r, t[7] = a, t[8] = o) : o = t[8], o;
|
|
4437
4519
|
}
|
|
4438
|
-
function
|
|
4520
|
+
function Ss(e) {
|
|
4439
4521
|
let t = O(8), n, r;
|
|
4440
4522
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4441
4523
|
let i;
|
|
@@ -4446,7 +4528,7 @@ function bs(e) {
|
|
|
4446
4528
|
...r
|
|
4447
4529
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4448
4530
|
}
|
|
4449
|
-
function
|
|
4531
|
+
function Cs(e) {
|
|
4450
4532
|
let t = O(8), n, r;
|
|
4451
4533
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4452
4534
|
let i;
|
|
@@ -4457,7 +4539,7 @@ function xs(e) {
|
|
|
4457
4539
|
...r
|
|
4458
4540
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4459
4541
|
}
|
|
4460
|
-
function
|
|
4542
|
+
function ws(e) {
|
|
4461
4543
|
let t = O(8), n, r;
|
|
4462
4544
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4463
4545
|
let i;
|
|
@@ -4468,7 +4550,7 @@ function Ss(e) {
|
|
|
4468
4550
|
...r
|
|
4469
4551
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4470
4552
|
}
|
|
4471
|
-
function
|
|
4553
|
+
function Ts(e) {
|
|
4472
4554
|
let t = O(8), n, r;
|
|
4473
4555
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4474
4556
|
let i;
|
|
@@ -4479,7 +4561,7 @@ function Cs(e) {
|
|
|
4479
4561
|
...r
|
|
4480
4562
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4481
4563
|
}
|
|
4482
|
-
function
|
|
4564
|
+
function Es(e) {
|
|
4483
4565
|
let t = O(8), n, r;
|
|
4484
4566
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4485
4567
|
let i;
|
|
@@ -4490,7 +4572,7 @@ function ws(e) {
|
|
|
4490
4572
|
...r
|
|
4491
4573
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4492
4574
|
}
|
|
4493
|
-
function
|
|
4575
|
+
function Ds(e) {
|
|
4494
4576
|
let t = O(3), n;
|
|
4495
4577
|
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];
|
|
4496
4578
|
let r;
|
|
@@ -4500,7 +4582,7 @@ function Ts(e) {
|
|
|
4500
4582
|
...e
|
|
4501
4583
|
}), t[1] = e, t[2] = r), r;
|
|
4502
4584
|
}
|
|
4503
|
-
function
|
|
4585
|
+
function Os() {
|
|
4504
4586
|
let e = O(6), { actions: t, meta: n } = Tt("ChatComposer.CommandButton"), r;
|
|
4505
4587
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M(et, { className: "size-4" }), e[0] = r) : r = e[0];
|
|
4506
4588
|
let i = n.activePopup?.trigger === "/", a;
|
|
@@ -4516,7 +4598,7 @@ function Es() {
|
|
|
4516
4598
|
onClick: a
|
|
4517
4599
|
}), e[3] = i, e[4] = a, e[5] = o) : o = e[5], o;
|
|
4518
4600
|
}
|
|
4519
|
-
function
|
|
4601
|
+
function ks(e) {
|
|
4520
4602
|
switch (e) {
|
|
4521
4603
|
case "permission-denied": return "Allow microphone access to use dictation";
|
|
4522
4604
|
case "no-microphone": return "Connect a microphone to use dictation";
|
|
@@ -4525,17 +4607,17 @@ function Ds(e) {
|
|
|
4525
4607
|
case "transcription-failed": return "Unable to transcribe audio";
|
|
4526
4608
|
}
|
|
4527
4609
|
}
|
|
4528
|
-
function
|
|
4610
|
+
function As(e) {
|
|
4529
4611
|
switch (e.status) {
|
|
4530
4612
|
case "unavailable": return e.reason === "blocked" ? "Allow microphone access in your browser settings to use dictation" : "Dictation is not available in this browser";
|
|
4531
4613
|
case "idle": return "Start dictation";
|
|
4532
4614
|
case "starting": return "Starting dictation";
|
|
4533
4615
|
case "recording": return "Stop dictation";
|
|
4534
4616
|
case "finishing": return "Transcribing…";
|
|
4535
|
-
case "failed": return
|
|
4617
|
+
case "failed": return ks(e.error.code);
|
|
4536
4618
|
}
|
|
4537
4619
|
}
|
|
4538
|
-
function
|
|
4620
|
+
function js(e) {
|
|
4539
4621
|
switch (e.status) {
|
|
4540
4622
|
case "recording": return /* @__PURE__ */ M(nt, { className: "size-4 fill-current" });
|
|
4541
4623
|
case "starting":
|
|
@@ -4545,11 +4627,11 @@ function ks(e) {
|
|
|
4545
4627
|
case "failed": return /* @__PURE__ */ M(Qe, { className: "size-4" });
|
|
4546
4628
|
}
|
|
4547
4629
|
}
|
|
4548
|
-
function
|
|
4630
|
+
function Ms() {
|
|
4549
4631
|
let e = O(20), { status: t } = B(), { state: n } = Et("ChatComposer.Dictate"), r;
|
|
4550
|
-
e[0] === n ? r = e[1] : (r =
|
|
4632
|
+
e[0] === n ? r = e[1] : (r = As(n), e[0] = n, e[1] = r);
|
|
4551
4633
|
let i = r, a = n.status === "starting" || n.status === "recording" || n.status === "finishing", o = t === "streaming" || t === "submitted", s;
|
|
4552
|
-
e[2] === n ? s = e[3] : (s =
|
|
4634
|
+
e[2] === n ? s = e[3] : (s = js(n), e[2] = n, e[3] = s);
|
|
4553
4635
|
let c;
|
|
4554
4636
|
e[4] !== i || e[5] !== s ? (c = /* @__PURE__ */ M(Q, {
|
|
4555
4637
|
icon: s,
|
|
@@ -4579,22 +4661,22 @@ function As() {
|
|
|
4579
4661
|
d
|
|
4580
4662
|
] }), e[16] = l, e[17] = u, e[18] = d, e[19] = f) : f = e[19], f;
|
|
4581
4663
|
}
|
|
4582
|
-
var
|
|
4583
|
-
Provider:
|
|
4584
|
-
Root:
|
|
4664
|
+
var Ns = {
|
|
4665
|
+
Provider: xs,
|
|
4666
|
+
Root: Ss,
|
|
4585
4667
|
Popup: R.Popup,
|
|
4586
|
-
Content:
|
|
4587
|
-
Attachments:
|
|
4588
|
-
Editor:
|
|
4668
|
+
Content: Cs,
|
|
4669
|
+
Attachments: Ts,
|
|
4670
|
+
Editor: ws,
|
|
4589
4671
|
Error: R.Error,
|
|
4590
|
-
Toolbar:
|
|
4591
|
-
CommandButton:
|
|
4592
|
-
AttachFiles:
|
|
4593
|
-
Dictate:
|
|
4672
|
+
Toolbar: Es,
|
|
4673
|
+
CommandButton: Os,
|
|
4674
|
+
AttachFiles: Ds,
|
|
4675
|
+
Dictate: Ms
|
|
4594
4676
|
};
|
|
4595
4677
|
//#endregion
|
|
4596
4678
|
//#region src/lib/components/ChatTextarea.tsx
|
|
4597
|
-
function
|
|
4679
|
+
function Ps(e) {
|
|
4598
4680
|
let t = O(10), n, r, i;
|
|
4599
4681
|
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);
|
|
4600
4682
|
let a;
|
|
@@ -4611,7 +4693,7 @@ function Ms(e) {
|
|
|
4611
4693
|
}
|
|
4612
4694
|
//#endregion
|
|
4613
4695
|
//#region src/lib/components/queue.tsx
|
|
4614
|
-
function
|
|
4696
|
+
function Fs(e) {
|
|
4615
4697
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4616
4698
|
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);
|
|
4617
4699
|
let a;
|
|
@@ -4620,7 +4702,7 @@ function Ns(e) {
|
|
|
4620
4702
|
children: n
|
|
4621
4703
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4622
4704
|
}
|
|
4623
|
-
function
|
|
4705
|
+
function Is(e) {
|
|
4624
4706
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4625
4707
|
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);
|
|
4626
4708
|
let a;
|
|
@@ -4629,13 +4711,13 @@ function Ps(e) {
|
|
|
4629
4711
|
children: n
|
|
4630
4712
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4631
4713
|
}
|
|
4632
|
-
function
|
|
4714
|
+
function Ls(e) {
|
|
4633
4715
|
let t = O(4), { className: n } = e, r;
|
|
4634
4716
|
t[0] === n ? r = t[1] : (r = k("text-muted-foreground size-3.5 shrink-0", n), t[0] = n, t[1] = r);
|
|
4635
4717
|
let i;
|
|
4636
4718
|
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(Ye, { className: r }), t[2] = r, t[3] = i), i;
|
|
4637
4719
|
}
|
|
4638
|
-
function
|
|
4720
|
+
function Rs(e) {
|
|
4639
4721
|
let t = O(7), { children: n, className: r } = e, i;
|
|
4640
4722
|
t[0] === r ? i = t[1] : (i = k("min-w-0 flex-1 truncate text-sm", r), t[0] = r, t[1] = i);
|
|
4641
4723
|
let a;
|
|
@@ -4646,7 +4728,7 @@ function Is(e) {
|
|
|
4646
4728
|
children: a
|
|
4647
4729
|
}), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
|
|
4648
4730
|
}
|
|
4649
|
-
function
|
|
4731
|
+
function zs(e) {
|
|
4650
4732
|
let t = O(6), { onClick: n, className: r } = e, i;
|
|
4651
4733
|
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);
|
|
4652
4734
|
let a;
|
|
@@ -4660,13 +4742,13 @@ function Ls(e) {
|
|
|
4660
4742
|
children: a
|
|
4661
4743
|
}), t[3] = n, t[4] = i, t[5] = o) : o = t[5], o;
|
|
4662
4744
|
}
|
|
4663
|
-
var
|
|
4664
|
-
Root:
|
|
4665
|
-
Item:
|
|
4666
|
-
Icon:
|
|
4667
|
-
Text:
|
|
4668
|
-
Remove:
|
|
4669
|
-
},
|
|
4745
|
+
var Bs = {
|
|
4746
|
+
Root: Fs,
|
|
4747
|
+
Item: Is,
|
|
4748
|
+
Icon: Ls,
|
|
4749
|
+
Text: Rs,
|
|
4750
|
+
Remove: zs
|
|
4751
|
+
}, Vs = {
|
|
4670
4752
|
normal: {
|
|
4671
4753
|
d: "m5 12 7-7 7 7",
|
|
4672
4754
|
translateY: 0
|
|
@@ -4680,7 +4762,7 @@ var Rs = {
|
|
|
4680
4762
|
],
|
|
4681
4763
|
transition: { duration: .4 }
|
|
4682
4764
|
}
|
|
4683
|
-
},
|
|
4765
|
+
}, Hs = {
|
|
4684
4766
|
normal: { d: "M12 19V5" },
|
|
4685
4767
|
animate: {
|
|
4686
4768
|
d: [
|
|
@@ -4690,7 +4772,7 @@ var Rs = {
|
|
|
4690
4772
|
],
|
|
4691
4773
|
transition: { duration: .4 }
|
|
4692
4774
|
}
|
|
4693
|
-
},
|
|
4775
|
+
}, Us = (e) => {
|
|
4694
4776
|
let t = O(30), n, r, i, a, o, s;
|
|
4695
4777
|
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);
|
|
4696
4778
|
let c = s === void 0 ? 20 : s, l = ne(), u = h(!1), d;
|
|
@@ -4712,11 +4794,11 @@ var Rs = {
|
|
|
4712
4794
|
t[17] === l ? (y = t[18], b = t[19]) : (y = /* @__PURE__ */ M(A.path, {
|
|
4713
4795
|
animate: l,
|
|
4714
4796
|
d: "m5 12 7-7 7 7",
|
|
4715
|
-
variants:
|
|
4797
|
+
variants: Vs
|
|
4716
4798
|
}), b = /* @__PURE__ */ M(A.path, {
|
|
4717
4799
|
animate: l,
|
|
4718
4800
|
d: "M12 19V5",
|
|
4719
|
-
variants:
|
|
4801
|
+
variants: Hs
|
|
4720
4802
|
}), t[17] = l, t[18] = y, t[19] = b);
|
|
4721
4803
|
let x;
|
|
4722
4804
|
t[20] !== c || t[21] !== y || t[22] !== b ? (x = /* @__PURE__ */ N("svg", {
|
|
@@ -4740,10 +4822,10 @@ var Rs = {
|
|
|
4740
4822
|
children: x
|
|
4741
4823
|
}), t[24] = m, t[25] = _, t[26] = a, t[27] = v, t[28] = x, t[29] = S) : S = t[29], S;
|
|
4742
4824
|
};
|
|
4743
|
-
|
|
4825
|
+
Us.displayName = "ArrowUpIcon";
|
|
4744
4826
|
//#endregion
|
|
4745
4827
|
//#region src/lib/components/SubmitButton.tsx
|
|
4746
|
-
var
|
|
4828
|
+
var Ws = {
|
|
4747
4829
|
duration: .15,
|
|
4748
4830
|
ease: [
|
|
4749
4831
|
0,
|
|
@@ -4751,7 +4833,7 @@ var Hs = {
|
|
|
4751
4833
|
.2,
|
|
4752
4834
|
1
|
|
4753
4835
|
]
|
|
4754
|
-
},
|
|
4836
|
+
}, Gs = {
|
|
4755
4837
|
duration: .12,
|
|
4756
4838
|
ease: [
|
|
4757
4839
|
0,
|
|
@@ -4760,7 +4842,7 @@ var Hs = {
|
|
|
4760
4842
|
1
|
|
4761
4843
|
]
|
|
4762
4844
|
};
|
|
4763
|
-
function
|
|
4845
|
+
function Ks(e) {
|
|
4764
4846
|
let t = O(40), n, r, i, a;
|
|
4765
4847
|
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);
|
|
4766
4848
|
let o = re(), s = a === "stop", c;
|
|
@@ -4800,7 +4882,7 @@ function Ws(e) {
|
|
|
4800
4882
|
scale: .7
|
|
4801
4883
|
}, t[21] = o, t[22] = v);
|
|
4802
4884
|
let y;
|
|
4803
|
-
t[23] === s ? y = t[24] : (y = M(s ?
|
|
4885
|
+
t[23] === s ? y = t[24] : (y = M(s ? Ys : Js, {}), t[23] = s, t[24] = y);
|
|
4804
4886
|
let b;
|
|
4805
4887
|
t[25] !== v || t[26] !== y || t[27] !== h || t[28] !== g ? (b = /* @__PURE__ */ M(te, {
|
|
4806
4888
|
initial: !1,
|
|
@@ -4808,7 +4890,7 @@ function Ws(e) {
|
|
|
4808
4890
|
initial: g,
|
|
4809
4891
|
animate: _,
|
|
4810
4892
|
exit: v,
|
|
4811
|
-
transition:
|
|
4893
|
+
transition: Gs,
|
|
4812
4894
|
className: "absolute flex items-center justify-center",
|
|
4813
4895
|
children: y
|
|
4814
4896
|
}, h)
|
|
@@ -4818,7 +4900,7 @@ function Ws(e) {
|
|
|
4818
4900
|
initial: c,
|
|
4819
4901
|
animate: l,
|
|
4820
4902
|
exit: u,
|
|
4821
|
-
transition:
|
|
4903
|
+
transition: Ws,
|
|
4822
4904
|
whileHover: d,
|
|
4823
4905
|
whileTap: f,
|
|
4824
4906
|
"aria-label": p,
|
|
@@ -4828,7 +4910,7 @@ function Ws(e) {
|
|
|
4828
4910
|
children: b
|
|
4829
4911
|
}), 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;
|
|
4830
4912
|
}
|
|
4831
|
-
function
|
|
4913
|
+
function qs(e) {
|
|
4832
4914
|
let t = O(2), { children: n } = e, r;
|
|
4833
4915
|
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M("svg", {
|
|
4834
4916
|
width: "20",
|
|
@@ -4839,13 +4921,13 @@ function Gs(e) {
|
|
|
4839
4921
|
children: n
|
|
4840
4922
|
}), t[0] = n, t[1] = r), r;
|
|
4841
4923
|
}
|
|
4842
|
-
function
|
|
4924
|
+
function Js() {
|
|
4843
4925
|
let e = O(1), t;
|
|
4844
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4926
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Us, {}), e[0] = t) : t = e[0], t;
|
|
4845
4927
|
}
|
|
4846
|
-
function
|
|
4928
|
+
function Ys() {
|
|
4847
4929
|
let e = O(1), t;
|
|
4848
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4930
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(qs, { children: /* @__PURE__ */ M("rect", {
|
|
4849
4931
|
x: "5",
|
|
4850
4932
|
y: "5",
|
|
4851
4933
|
width: "10",
|
|
@@ -4855,9 +4937,9 @@ function qs() {
|
|
|
4855
4937
|
}
|
|
4856
4938
|
//#endregion
|
|
4857
4939
|
//#region src/lib/components/tool-error.tsx
|
|
4858
|
-
function
|
|
4859
|
-
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 =
|
|
4860
|
-
t[0] === o.issues ? u = t[1] : (u = o.issues.map(
|
|
4940
|
+
function Xs(e) {
|
|
4941
|
+
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 = $t(), u;
|
|
4942
|
+
t[0] === o.issues ? u = t[1] : (u = o.issues.map(Zs).join("\n"), t[0] = o.issues, t[1] = u);
|
|
4861
4943
|
let d = u, f;
|
|
4862
4944
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(Fe, { className: "size-5" }), t[2] = f) : f = t[2];
|
|
4863
4945
|
let p;
|
|
@@ -4925,71 +5007,71 @@ function Js(e) {
|
|
|
4925
5007
|
]
|
|
4926
5008
|
}), t[21] = v, t[22] = S, t[23] = p, t[24] = C) : C = t[24], C;
|
|
4927
5009
|
}
|
|
4928
|
-
function
|
|
5010
|
+
function Zs(e) {
|
|
4929
5011
|
return `${e.path.join(".")}: ${e.message}`;
|
|
4930
5012
|
}
|
|
4931
5013
|
//#endregion
|
|
4932
5014
|
//#region src/lib/components/Tip/TipProvider.tsx
|
|
4933
|
-
var
|
|
4934
|
-
function
|
|
4935
|
-
return l(
|
|
5015
|
+
var Qs = o("");
|
|
5016
|
+
function $s() {
|
|
5017
|
+
return l(Qs);
|
|
4936
5018
|
}
|
|
4937
|
-
var
|
|
4938
|
-
function
|
|
5019
|
+
var ec = "tips:history", tc = "tips:session";
|
|
5020
|
+
function nc() {
|
|
4939
5021
|
try {
|
|
4940
|
-
return JSON.parse(localStorage.getItem(
|
|
5022
|
+
return JSON.parse(localStorage.getItem(ec) ?? "{}");
|
|
4941
5023
|
} catch (e) {
|
|
4942
|
-
if (
|
|
5024
|
+
if (ac(e)) return {};
|
|
4943
5025
|
throw e;
|
|
4944
5026
|
}
|
|
4945
5027
|
}
|
|
4946
|
-
function
|
|
5028
|
+
function rc(e, t) {
|
|
4947
5029
|
try {
|
|
4948
|
-
let n =
|
|
4949
|
-
n[e] = t, localStorage.setItem(
|
|
5030
|
+
let n = nc();
|
|
5031
|
+
n[e] = t, localStorage.setItem(ec, JSON.stringify(n));
|
|
4950
5032
|
} catch (e) {
|
|
4951
|
-
if (!
|
|
5033
|
+
if (!ac(e)) throw e;
|
|
4952
5034
|
}
|
|
4953
5035
|
}
|
|
4954
|
-
function
|
|
5036
|
+
function ic(e) {
|
|
4955
5037
|
try {
|
|
4956
|
-
let t = localStorage.getItem(
|
|
5038
|
+
let t = localStorage.getItem(tc), n = t ? JSON.parse(t) : {
|
|
4957
5039
|
id: "",
|
|
4958
5040
|
n: 0
|
|
4959
5041
|
};
|
|
4960
|
-
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(
|
|
5042
|
+
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(tc, JSON.stringify(n))), n.n;
|
|
4961
5043
|
} catch (e) {
|
|
4962
|
-
if (
|
|
5044
|
+
if (ac(e)) return 0;
|
|
4963
5045
|
throw e;
|
|
4964
5046
|
}
|
|
4965
5047
|
}
|
|
4966
|
-
function
|
|
5048
|
+
function ac(e) {
|
|
4967
5049
|
return e instanceof SyntaxError || e instanceof DOMException && (e.name === "QuotaExceededError" || e.name === "SecurityError");
|
|
4968
5050
|
}
|
|
4969
|
-
function
|
|
5051
|
+
function oc(e, t, n) {
|
|
4970
5052
|
let r = n[e];
|
|
4971
5053
|
return r == null ? Infinity : t - r;
|
|
4972
5054
|
}
|
|
4973
|
-
async function
|
|
4974
|
-
let r =
|
|
5055
|
+
async function sc(e, t, n) {
|
|
5056
|
+
let r = nc(), i = await Promise.all(e.map((e) => e.isRelevant(t))), a = e.filter((e, t) => i[t]);
|
|
4975
5057
|
if (a.length === 0) return null;
|
|
4976
|
-
let o = a.filter((e) =>
|
|
4977
|
-
s.sort((e, t) =>
|
|
5058
|
+
let o = a.filter((e) => oc(e.id, n, r) >= e.cooldownSessions), s = o.length > 0 ? o : a;
|
|
5059
|
+
s.sort((e, t) => oc(t.id, n, r) - oc(e.id, n, r));
|
|
4978
5060
|
let c = s[0], l = await c.content(t);
|
|
4979
5061
|
return {
|
|
4980
5062
|
id: c.id,
|
|
4981
5063
|
text: l
|
|
4982
5064
|
};
|
|
4983
5065
|
}
|
|
4984
|
-
function
|
|
5066
|
+
function cc(e) {
|
|
4985
5067
|
let t = O(13), { tips: n, streaming: r, chatId: i, context: a, children: o } = e, s;
|
|
4986
|
-
t[0] === i ? s = t[1] : (s = () =>
|
|
5068
|
+
t[0] === i ? s = t[1] : (s = () => ic(i), t[0] = i, t[1] = s);
|
|
4987
5069
|
let [c] = g(s), [l, u] = g(""), [p, m] = g(r), [_, v] = g(0);
|
|
4988
|
-
r !== p && (m(r), r && v(
|
|
5070
|
+
r !== p && (m(r), r && v(lc));
|
|
4989
5071
|
let y = h(!1), b;
|
|
4990
5072
|
t[2] !== a || t[3] !== c || t[4] !== n ? (b = () => {
|
|
4991
|
-
y.current || (y.current = !0,
|
|
4992
|
-
e && (u(e.text),
|
|
5073
|
+
y.current || (y.current = !0, sc(n, a, c).then((e) => {
|
|
5074
|
+
e && (u(e.text), rc(e.id, c));
|
|
4993
5075
|
}).finally(() => {
|
|
4994
5076
|
y.current = !1;
|
|
4995
5077
|
}));
|
|
@@ -5001,17 +5083,17 @@ function oc(e) {
|
|
|
5001
5083
|
let C;
|
|
5002
5084
|
t[8] === _ ? C = t[9] : (C = [_], t[8] = _, t[9] = C), d(S, C);
|
|
5003
5085
|
let w;
|
|
5004
|
-
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(
|
|
5086
|
+
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(Qs, {
|
|
5005
5087
|
value: l,
|
|
5006
5088
|
children: o
|
|
5007
5089
|
}), t[10] = o, t[11] = l, t[12] = w) : w = t[12], w;
|
|
5008
5090
|
}
|
|
5009
|
-
function
|
|
5091
|
+
function lc(e) {
|
|
5010
5092
|
return e + 1;
|
|
5011
5093
|
}
|
|
5012
|
-
function
|
|
5094
|
+
function uc(e) {
|
|
5013
5095
|
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;
|
|
5014
|
-
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(
|
|
5096
|
+
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(cc, {
|
|
5015
5097
|
tips: n,
|
|
5016
5098
|
streaming: s,
|
|
5017
5099
|
chatId: c,
|
|
@@ -5021,14 +5103,14 @@ function cc(e) {
|
|
|
5021
5103
|
}
|
|
5022
5104
|
//#endregion
|
|
5023
5105
|
//#region src/lib/components/Tip/TipLine.tsx
|
|
5024
|
-
var
|
|
5025
|
-
function
|
|
5026
|
-
let t = O(13), { className: n } = e, r = St(), i =
|
|
5106
|
+
var dc = 1.5;
|
|
5107
|
+
function fc(e) {
|
|
5108
|
+
let t = O(13), { className: n } = e, r = St(), i = $s(), [a, o] = g(i), [s, c] = g(!1);
|
|
5027
5109
|
i !== a && (o(i), i && c(!0));
|
|
5028
5110
|
let l, u;
|
|
5029
5111
|
t[0] !== r || t[1] !== s ? (l = () => {
|
|
5030
5112
|
if (!s) return;
|
|
5031
|
-
let e = r.setTimeout(() => c(!1),
|
|
5113
|
+
let e = r.setTimeout(() => c(!1), dc * 1e3);
|
|
5032
5114
|
return () => r.clearTimeout(e);
|
|
5033
5115
|
}, u = [r, s], t[0] = r, t[1] = s, t[2] = l, t[3] = u) : (l = t[2], u = t[3]), d(l, u);
|
|
5034
5116
|
let f;
|
|
@@ -5036,10 +5118,10 @@ function uc(e) {
|
|
|
5036
5118
|
let p;
|
|
5037
5119
|
t[6] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ M(Je, { className: "size-3 shrink-0" }), t[6] = p) : p = t[6];
|
|
5038
5120
|
let m;
|
|
5039
|
-
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(
|
|
5121
|
+
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(H, {
|
|
5040
5122
|
as: "span",
|
|
5041
5123
|
enabled: s,
|
|
5042
|
-
duration:
|
|
5124
|
+
duration: dc,
|
|
5043
5125
|
children: ["Tip: ", i]
|
|
5044
5126
|
}), t[7] = s, t[8] = i, t[9] = m) : m = t[9];
|
|
5045
5127
|
let h;
|
|
@@ -5050,7 +5132,7 @@ function uc(e) {
|
|
|
5050
5132
|
}
|
|
5051
5133
|
//#endregion
|
|
5052
5134
|
//#region src/lib/hooks/use-async-generator.ts
|
|
5053
|
-
function
|
|
5135
|
+
function pc() {
|
|
5054
5136
|
let [e, t] = g({
|
|
5055
5137
|
loading: !1,
|
|
5056
5138
|
error: null
|
|
@@ -5080,7 +5162,7 @@ function dc() {
|
|
|
5080
5162
|
}
|
|
5081
5163
|
//#endregion
|
|
5082
5164
|
//#region src/lib/hooks/use-auto-resize-textarea.ts
|
|
5083
|
-
function
|
|
5165
|
+
function mc(e) {
|
|
5084
5166
|
let t = O(16), { minHeight: n, maxHeight: r, value: i } = e, a = h(null), o;
|
|
5085
5167
|
t[0] !== r || t[1] !== n ? (o = (e) => {
|
|
5086
5168
|
let t = a.current;
|
|
@@ -5117,22 +5199,22 @@ function fc(e) {
|
|
|
5117
5199
|
}
|
|
5118
5200
|
//#endregion
|
|
5119
5201
|
//#region src/lib/hooks/use-keyboard.ts
|
|
5120
|
-
function
|
|
5202
|
+
function hc(e) {
|
|
5121
5203
|
let t = [];
|
|
5122
5204
|
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("+");
|
|
5123
5205
|
}
|
|
5124
|
-
function
|
|
5206
|
+
function gc(e) {
|
|
5125
5207
|
let t = O(4), { enabled: n, handlers: r } = e, i = n === void 0 || n, a, o;
|
|
5126
5208
|
t[0] !== i || t[1] !== r ? (a = () => {
|
|
5127
5209
|
if (!i) return;
|
|
5128
5210
|
let e = (e) => {
|
|
5129
|
-
let t =
|
|
5211
|
+
let t = hc(e), n = r[t];
|
|
5130
5212
|
n ||= r[e.key], n && (e.preventDefault(), e.stopPropagation(), n(e));
|
|
5131
5213
|
};
|
|
5132
5214
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
5133
5215
|
}, o = [i, r], t[0] = i, t[1] = r, t[2] = a, t[3] = o) : (a = t[2], o = t[3]), d(a, o);
|
|
5134
5216
|
}
|
|
5135
5217
|
//#endregion
|
|
5136
|
-
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea,
|
|
5218
|
+
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea, Si as AssistantSnapshot, si as COPY_EXCLUSION_ATTRIBUTE, ci as COPY_EXCLUSION_MODES, Q as ChatActionButton, zt as ChatBot, Ns as ChatComposer, Ft as ChatManager, Ps as ChatTextarea, rr as CitationPill, Yr as CodeBlock, Xr as CodeBlockCopyButton, ns as CompactMessages, es as CompactTrajectory, Sa as CopyAction, wa as CopyDebugJsonAction, nr as GenaiMessagesProvider, Xn as IndexProgress, Mi as InteractiveResponse, Qn as MessageItemContext, no as MessageMetadata, Bs as MessageQueue, ps as Messages, xa as MessagesActions, Zn as MessagesContext, Ea as MessagesError, ka as MessagesItem, Oa as MessagesList, Da as MessagesRoot, go as MessagesUserBubble, ya as NestedTrajectory, Ma as PendingToolInput, an as ReadOnlyChatTransport, Ca as RegenerateAction, J as Response, X as Segment, hi as SnapshotRenderPortal, Ks as SubmitButton, H as TextShimmer, bs as TimelinedMessages, fc as TipLine, cc as TipProvider, Qs as TipValueContext, uc as Tips, Xi as ToolArg, Xs as ToolError, ho as UserMessageContent, Ya as ZukhrufChatTransport, rn as citationIndexOf, Nt as clearPrefill, oe as defineElements, $n as en, xi as extractAssistantRawText, nn as extractSourcesFromMessage, Ka as formatUsageBreakdown, Ga as formatUsageValue, hn as getIndexProgressEvents, Z as getSegmentKey, ui as hasCopyExclusion, Ei as isActiveClientInputTool, $i as isCommentaryTextPart, Ci as isSubagentPart, sn as isToolAborted, on as isToolStateAborted, Ba as parseMetadataUsage, za as parseUsage, Pt as persistedPromptOf, jt as readPrefill, fi as resolveCopyToClipboardStrategy, Ti as resolveToolEntry, ln as serializeToolsRegistry, di as shouldIncludeInCopyImage, wi as subagentDisplayName, V as urlCitationsOf, Aa as useActivePendingToolInput, z as useAgent, Lt as useAgentChatSetup, $t as useAgentMessages, Qt as useAgentMeta, B as useAgentStatus, pc as useAsyncGenerator, mc as useAutoResizeTextarea, en as useChatManager, Wo as useCompactGroup, _i as useCopyElementAsImage, K as useGenaiMessages, Y as useIsAssistantSnapshotRender, cn as useIsToolAborted, gc as useKeyboard, G as useMessageItem, U as useMessagesContext, W as useMessagesStatus, Wa as useNormalizedUsageTracking, $s as useTipValue, sa as useToolSegment, Ho as useTrajectoryItems, mi as waitForNextPaint, Mt as writePrefill };
|
|
5137
5219
|
|
|
5138
5220
|
//# sourceMappingURL=index.js.map
|