@8wave/ai-elements 0.126.0-beta.34 → 0.126.0-beta.36
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/_chunks/{PkChatbotFilePreview-B4vbUkNp.js → PkChatbotFilePreview-Cw3va5vW.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-B4vbUkNp.js.map → PkChatbotFilePreview-Cw3va5vW.js.map} +1 -1
- package/dist/_chunks/{PkFilePreview-C6ZZablL.js → PkFilePreview-D4TgY0T9.js} +3 -3
- package/dist/_chunks/{PkFilePreview-C6ZZablL.js.map → PkFilePreview-D4TgY0T9.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-BzBHAt8l.js → PkFilePreviewDialog-8H1GeV91.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-BzBHAt8l.js.map → PkFilePreviewDialog-8H1GeV91.js.map} +1 -1
- package/dist/_chunks/{PkImageEditorDialog-Dm34WFmS.js → PkImageEditorDialog-BqHjVX97.js} +2 -2
- package/dist/_chunks/{PkImageEditorDialog-Dm34WFmS.js.map → PkImageEditorDialog-BqHjVX97.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-CYqbMEjg.js → PkSelectionActions-BxUXWFNK.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-CYqbMEjg.js.map → PkSelectionActions-BxUXWFNK.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-B8rZbprU.js → PkStreamingMarkdown-14rJ_FK2.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-B8rZbprU.js.map → PkStreamingMarkdown-14rJ_FK2.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-C0emIVfS.js → PkToolChatFile-CSBzfuyE.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-C0emIVfS.js.map → PkToolChatFile-CSBzfuyE.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-DYr0Rq4D.js → PkToolShareDocument-Kq7SFbw5.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-DYr0Rq4D.js.map → PkToolShareDocument-Kq7SFbw5.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-B_KIIjEn.js → PkToolShowArtifact-d5tKvM01.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-B_KIIjEn.js.map → PkToolShowArtifact-d5tKvM01.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-DiHb3fRQ.js → PkToolShowContactForm-Bni1QzXV.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-DiHb3fRQ.js.map → PkToolShowContactForm-Bni1QzXV.js.map} +1 -1
- package/dist/_chunks/{PkToolShowEmail-CClEA1rp.js → PkToolShowEmail-D6Mw24jB.js} +2 -2
- package/dist/_chunks/{PkToolShowEmail-CClEA1rp.js.map → PkToolShowEmail-D6Mw24jB.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-BmUAhIQy.js → PkToolShowForm-CFXtO0j4.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-BmUAhIQy.js.map → PkToolShowForm-CFXtO0j4.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-CZ394fdT.js → PkToolShowImageGallery-Ci_Kg44s.js} +7 -2
- package/dist/_chunks/PkToolShowImageGallery-Ci_Kg44s.js.map +1 -0
- package/dist/_chunks/{PkToolShowLocation-DaFjO8MV.js → PkToolShowLocation-DV0puCbD.js} +136 -135
- package/dist/_chunks/PkToolShowLocation-DV0puCbD.js.map +1 -0
- package/dist/_chunks/{PkToolShowMessage-DIDp9JCf.js → PkToolShowMessage-Bq2dbSy1.js} +2 -2
- package/dist/_chunks/{PkToolShowMessage-DIDp9JCf.js.map → PkToolShowMessage-Bq2dbSy1.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-uNvUr2s9.js → PkToolShowProductList-BWWzkWWA.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-uNvUr2s9.js.map → PkToolShowProductList-BWWzkWWA.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-Dm0L4prK.js → PkToolShowSources-Dv7hbDyy.js} +8 -8
- package/dist/_chunks/{PkToolShowSources-Dm0L4prK.js.map → PkToolShowSources-Dv7hbDyy.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-Cj2mJrs5.js → PkToolShowWebPages-XxcYBQpr.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-Cj2mJrs5.js.map → PkToolShowWebPages-XxcYBQpr.js.map} +1 -1
- package/dist/_chunks/{utils-DPGBO-HU.js → utils-DE4cAz37.js} +43 -40
- package/dist/_chunks/utils-DE4cAz37.js.map +1 -0
- package/dist/ai-elements.es.js +1270 -1250
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-CXpftmWm.js → PkChatbot-CFJmT4nN.js} +7 -6
- package/dist-vue/_chunks/PkChatbot-CFJmT4nN.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotAudioTranscript-DgmuXalb.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-vA2v4FES.js → PkChatbotEmptyState-CLfzcH_t.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-vA2v4FES.js.map → PkChatbotEmptyState-CLfzcH_t.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotFilePreview-aKJBtw04.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-CIIJ1bpF.js → PkChatbotInput-C9l_1I3d.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotInput-CIIJ1bpF.js.map → PkChatbotInput-C9l_1I3d.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-_-h-egX7.js +1072 -0
- package/dist-vue/_chunks/{PkChatbotMessages-15R8RxAq.js.map → PkChatbotMessages-_-h-egX7.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-BbNSav-U.js → PkChatbotStepPayload-fyrbP7yS.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-BbNSav-U.js.map → PkChatbotStepPayload-fyrbP7yS.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-B_4pmbLe.js → PkChatbotStepToolDetail-Drhc6X-x.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-B_4pmbLe.js.map → PkChatbotStepToolDetail-Drhc6X-x.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-h4E6DH_g.js → PkChatbotSteps-DZwV7UVr.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-h4E6DH_g.js.map → PkChatbotSteps-DZwV7UVr.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-CLQ0J9_f.js → PkChatbotViewChat-Bg-Op2Oe.js} +7 -6
- package/dist-vue/_chunks/{PkChatbotViewChat-CLQ0J9_f.js.map → PkChatbotViewChat-Bg-Op2Oe.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-DFBbypGg.js → PkChatbotViewConversations--smzyxqN.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotViewConversations-DFBbypGg.js.map → PkChatbotViewConversations--smzyxqN.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-B0AZvHTr.js → PkChatbotViewProfile-Cn7IQfnQ.js} +2 -1
- package/dist-vue/_chunks/PkChatbotViewProfile-Cn7IQfnQ.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreview-Cb-1YRPN.js → PkFilePreview-DydUI1G2.js} +54 -54
- package/dist-vue/_chunks/{PkFilePreview-Cb-1YRPN.js.map → PkFilePreview-DydUI1G2.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-Bd7kEoCB.js → PkFilePreviewDialog-BuG1whsJ.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-Bd7kEoCB.js.map → PkFilePreviewDialog-BuG1whsJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkImageEditorDialog-Bj4sUHXM.js → PkImageEditorDialog-_-UkV0CO.js} +2 -2
- package/dist-vue/_chunks/{PkImageEditorDialog-Bj4sUHXM.js.map → PkImageEditorDialog-_-UkV0CO.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-BcUq4ThC.js → PkStreamingMarkdown-ha0V58V9.js} +2 -2
- package/dist-vue/_chunks/{PkStreamingMarkdown-BcUq4ThC.js.map → PkStreamingMarkdown-ha0V58V9.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-BOexrlLt.js → PkToolChatFile-OusYITiO.js} +2 -2
- package/dist-vue/_chunks/{PkToolChatFile-BOexrlLt.js.map → PkToolChatFile-OusYITiO.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-C4gHB6lH.js → PkToolShowArtifact-x57Gri2a.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-C4gHB6lH.js.map → PkToolShowArtifact-x57Gri2a.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowChart-CsPXNAb9.js → PkToolShowChart-BSnYmoJJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowChart-CsPXNAb9.js.map → PkToolShowChart-BSnYmoJJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-2_HBPZaa.js → PkToolShowContactForm-D0lDC69x.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-2_HBPZaa.js.map → PkToolShowContactForm-D0lDC69x.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-cCbeL6MK.js → PkToolShowDiagram-BR4fE_be.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-cCbeL6MK.js.map → PkToolShowDiagram-BR4fE_be.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowEmail-BehvoNsz.js → PkToolShowEmail-idhNR5-l.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowEmail-BehvoNsz.js.map → PkToolShowEmail-idhNR5-l.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-DjB3fji5.js → PkToolShowForm-yh0YAXcg.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowForm-DjB3fji5.js.map → PkToolShowForm-yh0YAXcg.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-C22TCUKW.js → PkToolShowImageGallery-mmUY1Yfg.js} +8 -3
- package/dist-vue/_chunks/PkToolShowImageGallery-mmUY1Yfg.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowLocation-CqqtwH_R.js → PkToolShowLocation-CyaKgQUX.js} +3 -3
- package/dist-vue/_chunks/PkToolShowLocation-CyaKgQUX.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowMessage-Cca7K7GQ.js → PkToolShowMessage-B4gztWUk.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowMessage-Cca7K7GQ.js.map → PkToolShowMessage-B4gztWUk.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-BvtmiHBf.js → PkToolShowProductList-B-ya1TDt.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowProductList-BvtmiHBf.js.map → PkToolShowProductList-B-ya1TDt.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-uKO4MQgd.js → PkToolShowSources-DYkHkVdX.js} +8 -8
- package/dist-vue/_chunks/{PkToolShowSources-uKO4MQgd.js.map → PkToolShowSources-DYkHkVdX.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-DKj5N1vo.js → PkToolShowVideo-CRg2lAY8.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-DKj5N1vo.js.map → PkToolShowVideo-CRg2lAY8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-BNZmbCSf.js → PkToolShowWebPages-C_pWag94.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowWebPages-BNZmbCSf.js.map → PkToolShowWebPages-C_pWag94.js.map} +1 -1
- package/dist-vue/_chunks/{utils-waie4Gfn.js → utils-Df5n2cDc.js} +66 -59
- package/dist-vue/_chunks/utils-Df5n2cDc.js.map +1 -0
- package/dist-vue/composables.js +5 -5
- package/dist-vue/index.js +3960 -3954
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +4 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +9 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkToolShowImageGallery-CZ394fdT.js.map +0 -1
- package/dist/_chunks/PkToolShowLocation-DaFjO8MV.js.map +0 -1
- package/dist/_chunks/utils-DPGBO-HU.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-CXpftmWm.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-15R8RxAq.js +0 -1068
- package/dist-vue/_chunks/PkChatbotViewProfile-B0AZvHTr.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowImageGallery-C22TCUKW.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowLocation-CqqtwH_R.js.map +0 -1
- package/dist-vue/_chunks/utils-waie4Gfn.js.map +0 -1
|
@@ -1,1068 +0,0 @@
|
|
|
1
|
-
import { b as e, g as t, r as n, w as r, x as i } from "./schemas-CwcNxjnD.js";
|
|
2
|
-
import { t as a } from "./VvButtonLocalized-C-vx25u4.js";
|
|
3
|
-
import { A as o, H as s, _ as c, k as l, r as u } from "./Agent-CBAd3F7k.js";
|
|
4
|
-
import { c as d } from "./Media-0U2B_qCS.js";
|
|
5
|
-
import { A as f, C as p, I as m, L as h, N as g, O as ee, P as _, S as v, U as y, _ as b, b as te, d as ne, f as re, g as ie, i as x, it as S, n as ae, r as oe, rt as se, t as C, x as ce, y as le, z as ue } from "./utils-waie4Gfn.js";
|
|
6
|
-
import { t as de } from "./PkStreamingMarkdown-BcUq4ThC.js";
|
|
7
|
-
import { t as fe } from "./PkChatbotError-DFZ5S5jd.js";
|
|
8
|
-
import { t as pe } from "./PkChatbotFeedbackForm-DdQQlAr1.js";
|
|
9
|
-
import { c as me, i as he, l as ge, n as _e, o as ve, s as ye, t as be, u as xe } from "./message-DuibQyHy.js";
|
|
10
|
-
import { t as Se } from "./PkChatbotMessageFeedback-DltXugdR.js";
|
|
11
|
-
import { t as Ce } from "./PkChatbotFilePreview-aKJBtw04.js";
|
|
12
|
-
import { t as we } from "./PkChatbotAudioTranscript-DgmuXalb.js";
|
|
13
|
-
import { t as Te } from "./PkRelativeTime-CZF5CYHv.js";
|
|
14
|
-
import "./src-nb8MU1sh.js";
|
|
15
|
-
import { n as Ee, r as De, t as Oe } from "./PkChatbotSteps-h4E6DH_g.js";
|
|
16
|
-
import { t as ke } from "./PkChatbotOutlineRail-BI-DMvZi.js";
|
|
17
|
-
import { n as Ae } from "./useLightbox-DrEFS3gx.js";
|
|
18
|
-
import { VvAccordion as je, VvButtonGroup as Me, VvIcon as Ne } from "@volverjs/ui-vue/components";
|
|
19
|
-
import { Fragment as w, Transition as T, computed as E, createBlock as D, createCommentVNode as O, createElementBlock as k, createElementVNode as A, createTextVNode as Pe, createVNode as j, defineAsyncComponent as M, defineComponent as Fe, inject as Ie, mergeProps as Le, nextTick as N, normalizeClass as P, normalizeStyle as Re, onBeforeUnmount as ze, onMounted as Be, openBlock as F, ref as I, renderList as Ve, renderSlot as He, resolveDynamicComponent as Ue, shallowRef as We, toDisplayString as L, unref as R, useSlots as Ge, useTemplateRef as Ke, watch as z, withCtx as B, withModifiers as V } from "vue";
|
|
20
|
-
import { useI18n as qe } from "vue-i18n";
|
|
21
|
-
import { useResizeObserver as Je } from "@vueuse/core";
|
|
22
|
-
t({
|
|
23
|
-
platform: e(),
|
|
24
|
-
threadId: e()
|
|
25
|
-
});
|
|
26
|
-
var Ye = t({
|
|
27
|
-
wakeId: r(),
|
|
28
|
-
dueAt: S(),
|
|
29
|
-
reason: e(),
|
|
30
|
-
kind: n(["wakeup", "task"]).optional(),
|
|
31
|
-
taskId: r().optional()
|
|
32
|
-
});
|
|
33
|
-
t({ pendingWakeup: Ye.nullable() });
|
|
34
|
-
var Xe = t({ wakeId: r() });
|
|
35
|
-
i([Xe, se]);
|
|
36
|
-
var H = (e) => e?.role === "user" && !!e.metadata?.wakeup, Ze = /* @__PURE__ */ new Set([
|
|
37
|
-
"input-streaming",
|
|
38
|
-
"input-available",
|
|
39
|
-
"approval-requested"
|
|
40
|
-
]), Qe = /* @__PURE__ */ new Set([
|
|
41
|
-
...o,
|
|
42
|
-
...l,
|
|
43
|
-
...c
|
|
44
|
-
]);
|
|
45
|
-
[...l, u.ShowContactForm];
|
|
46
|
-
var U = (e) => e.state, $e = (e) => e.type.startsWith("tool-") ? e.type.slice(5) : void 0, et = (e) => e?.role === "assistant" && e.parts.some((e) => {
|
|
47
|
-
if (e.type === "text") return e.text.trim().length > 0;
|
|
48
|
-
if (e.type === "file") return !0;
|
|
49
|
-
let t = U(e);
|
|
50
|
-
if (t && Ze.has(t)) return !0;
|
|
51
|
-
let n = $e(e);
|
|
52
|
-
return n !== void 0 && Qe.has(n) && t === "output-available";
|
|
53
|
-
}), tt = (e) => {
|
|
54
|
-
if (e?.role !== "assistant") return !1;
|
|
55
|
-
let t = !1;
|
|
56
|
-
for (let n of e.parts) (n.type === "tool-scheduleWakeup" || n.type === "tool-reportTaskRun") && (t = U(n) === "output-available" && n.input?.noop === !0);
|
|
57
|
-
return t;
|
|
58
|
-
}, nt = (e) => e?.role === "assistant" && !et(e) && tt(e), rt = {
|
|
59
|
-
requestOAuthConnection: M(() => import("./PkToolRequestOAuthConnection-DWkeVLpx.js")),
|
|
60
|
-
shareDocument: M(() => import("./PkToolShareDocument-Bkt9JVqk.js").then((e) => e.n)),
|
|
61
|
-
showArtifact: M(() => import("./PkToolShowArtifact-C4gHB6lH.js").then((e) => e.n)),
|
|
62
|
-
showCalendarEvent: M(() => import("./PkToolShowCalendarEvent-CAejFLQI.js").then((e) => e.n)),
|
|
63
|
-
showChart: M(() => import("./PkToolShowChart-CsPXNAb9.js")),
|
|
64
|
-
showComparison: M(() => import("./PkToolShowComparison-BEHyRNXE.js").then((e) => e.n)),
|
|
65
|
-
showContactForm: M(() => import("./PkToolShowContactForm-2_HBPZaa.js").then((e) => e.n)),
|
|
66
|
-
showDiagram: M(() => import("./PkToolShowDiagram-cCbeL6MK.js")),
|
|
67
|
-
showEmail: M(() => import("./PkToolShowEmail-BehvoNsz.js").then((e) => e.n)),
|
|
68
|
-
showImageGallery: M(() => import("./PkToolShowImageGallery-C22TCUKW.js").then((e) => e.n)),
|
|
69
|
-
showLocation: M(() => import("./PkToolShowLocation-CqqtwH_R.js").then((e) => e.n)),
|
|
70
|
-
showMessage: M(() => import("./PkToolShowMessage-Cca7K7GQ.js").then((e) => e.n)),
|
|
71
|
-
showForm: M(() => import("./PkToolShowForm-DjB3fji5.js").then((e) => e.n)),
|
|
72
|
-
showMultipleChoice: M(() => import("./PkToolShowForm-DjB3fji5.js").then((e) => e.n)),
|
|
73
|
-
showProductList: M(() => import("./PkToolShowProductList-BvtmiHBf.js").then((e) => e.n)),
|
|
74
|
-
showQrCode: M(() => import("./PkToolShowQrCode-96KzD1rX.js").then((e) => e.n)),
|
|
75
|
-
showSources: M(() => import("./PkToolShowSources-uKO4MQgd.js").then((e) => e.n)),
|
|
76
|
-
showSuggestedReply: M(() => import("./PkToolShowSuggestedReply-wKgwHTRO.js").then((e) => e.n)),
|
|
77
|
-
showVideo: M(() => import("./PkToolShowVideo-DKj5N1vo.js")),
|
|
78
|
-
showWeather: M(() => import("./PkToolShowWeather-DkWGFxNa.js")),
|
|
79
|
-
showWebPages: M(() => import("./PkToolShowWebPages-BNZmbCSf.js").then((e) => e.n))
|
|
80
|
-
}, it = {
|
|
81
|
-
key: 0,
|
|
82
|
-
class: "text-12 text-word-3 m-0 mb-xs"
|
|
83
|
-
}, W = /* @__PURE__ */ Fe({
|
|
84
|
-
__name: "PkToolApprovalPreviewMessage",
|
|
85
|
-
props: { input: {} },
|
|
86
|
-
setup(e) {
|
|
87
|
-
let t = e, n = E(() => {
|
|
88
|
-
let e = t.input;
|
|
89
|
-
return typeof e?.message == "string" ? e.message : "";
|
|
90
|
-
});
|
|
91
|
-
return (e, t) => n.value ? (F(), k("p", it, L(n.value), 1)) : O("", !0);
|
|
92
|
-
}
|
|
93
|
-
}), G = { [C]: W }, at = {
|
|
94
|
-
key: 0,
|
|
95
|
-
class: "text-12 text-word-3 m-0 mb-xs"
|
|
96
|
-
}, ot = /* @__PURE__ */ Fe({
|
|
97
|
-
__name: "PkToolApprovalCard",
|
|
98
|
-
props: {
|
|
99
|
-
part: {},
|
|
100
|
-
actionable: { type: Boolean },
|
|
101
|
-
callVerdict: { type: Boolean }
|
|
102
|
-
},
|
|
103
|
-
emits: ["respond"],
|
|
104
|
-
setup(e, { emit: t }) {
|
|
105
|
-
let n = e, r = t, { t: i, te: o } = qe({ useScope: "global" }), c = E(() => n.part), l = E(() => he(n.part)), u = E(() => l.value === C), d = E(() => u.value ? (c.value.state === "input-available" || s(c.value.output)) && n.callVerdict === void 0 : c.value.state === "approval-requested"), f = E(() => d.value && n.actionable === !0), p = E(() => d.value && n.actionable !== !0), m = E(() => u.value ? c.value.output === "confirmed" || n.callVerdict === !0 : c.value.approval?.approved === !0), h = E(() => u.value ? c.value.output === "cancelled" || n.callVerdict === !1 : c.value.approval?.approved === !1 || c.value.state === "output-denied"), g = E(() => G[l.value]), ee = E(() => g.value ? i("toolApproval.prompt") : i("toolApproval.promptNamed", { tool: y(l.value, {
|
|
106
|
-
t: i,
|
|
107
|
-
te: o
|
|
108
|
-
}) })), _ = E(() => {
|
|
109
|
-
if (p.value) return {
|
|
110
|
-
icon: "ri:time-line",
|
|
111
|
-
message: i("toolApproval.expired")
|
|
112
|
-
};
|
|
113
|
-
if (m.value) return {
|
|
114
|
-
icon: "ri:check-line",
|
|
115
|
-
message: i(u.value ? "toolApproval.confirmed" : "toolApproval.approved")
|
|
116
|
-
};
|
|
117
|
-
if (h.value) return {
|
|
118
|
-
icon: "ri:close-line",
|
|
119
|
-
message: i(u.value ? "toolApproval.cancelled" : "toolApproval.denied")
|
|
120
|
-
};
|
|
121
|
-
}), v = E(() => !!_.value && !g.value);
|
|
122
|
-
return (t, n) => {
|
|
123
|
-
let o = a, s = Me, l = Ne;
|
|
124
|
-
return F(), k("div", { class: P(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !v.value }]) }, [
|
|
125
|
-
j(T, null, {
|
|
126
|
-
default: B(() => [!u.value && d.value ? (F(), k("p", at, L(ee.value), 1)) : O("", !0)]),
|
|
127
|
-
_: 1
|
|
128
|
-
}),
|
|
129
|
-
g.value ? (F(), D(Ue(g.value), {
|
|
130
|
-
key: 0,
|
|
131
|
-
part: e.part,
|
|
132
|
-
input: c.value.input
|
|
133
|
-
}, null, 8, ["part", "input"])) : O("", !0),
|
|
134
|
-
j(T, { mode: "out-in" }, {
|
|
135
|
-
default: B(() => [_.value ? (F(), k("p", {
|
|
136
|
-
key: 1,
|
|
137
|
-
class: P(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs": g.value }])
|
|
138
|
-
}, [j(l, {
|
|
139
|
-
name: _.value.icon,
|
|
140
|
-
class: "shrink-0"
|
|
141
|
-
}, null, 8, ["name"]), Pe(" " + L(_.value.message), 1)], 2)) : (F(), D(s, { key: 0 }, {
|
|
142
|
-
default: B(() => [j(o, {
|
|
143
|
-
modifiers: "primary-small",
|
|
144
|
-
disabled: !f.value,
|
|
145
|
-
icon: "ri:check-line",
|
|
146
|
-
label: R(i)("action.proceed"),
|
|
147
|
-
onClick: n[0] ||= V((e) => r("respond", !0), ["stop"])
|
|
148
|
-
}, null, 8, ["disabled", "label"]), j(o, {
|
|
149
|
-
modifiers: "action-quiet-small",
|
|
150
|
-
disabled: !f.value,
|
|
151
|
-
icon: "ri:close-line",
|
|
152
|
-
label: R(i)("action.cancel"),
|
|
153
|
-
onClick: n[1] ||= V((e) => r("respond", !1), ["stop"])
|
|
154
|
-
}, null, 8, ["disabled", "label"])]),
|
|
155
|
-
_: 1
|
|
156
|
-
}))]),
|
|
157
|
-
_: 1
|
|
158
|
-
})
|
|
159
|
-
], 2);
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
}), K = { class: "pk-host-call-confirm-card w-full bg-surface p-sm rounded-xl border border-surface-3" }, st = { class: "text-14 text-word-2 m-0 mb-xs" }, ct = {
|
|
163
|
-
key: 1,
|
|
164
|
-
class: "pk-host-call-confirm-card__details text-14 m-0 mb-xs"
|
|
165
|
-
}, lt = {
|
|
166
|
-
key: 0,
|
|
167
|
-
class: "text-word-3 truncate"
|
|
168
|
-
}, q = {
|
|
169
|
-
key: 2,
|
|
170
|
-
class: "text-12 text-word-3 m-0 mb-xs"
|
|
171
|
-
}, ut = { class: "pk-host-call-confirm-card__details text-12 m-0" }, J = { class: "text-word-3" }, dt = { class: "text-word-2 m-0" }, ft = /* @__PURE__ */ Fe({
|
|
172
|
-
__name: "PkHostCallConfirmCard",
|
|
173
|
-
props: {
|
|
174
|
-
question: {},
|
|
175
|
-
details: {},
|
|
176
|
-
unchanged: {}
|
|
177
|
-
},
|
|
178
|
-
emits: ["respond"],
|
|
179
|
-
setup(e, { emit: t }) {
|
|
180
|
-
let n = e, r = t, i = E(() => n.details?.some((e) => e.before !== void 0) ?? !1);
|
|
181
|
-
return (t, n) => {
|
|
182
|
-
let o = je, s = a, c = Me;
|
|
183
|
-
return F(), k("div", K, [
|
|
184
|
-
A("p", st, L(e.question), 1),
|
|
185
|
-
e.details?.length && i.value ? (F(), D(De, {
|
|
186
|
-
key: 0,
|
|
187
|
-
changes: e.details,
|
|
188
|
-
class: "mb-xs"
|
|
189
|
-
}, null, 8, ["changes"])) : e.details?.length ? (F(), k("dl", ct, [(F(!0), k(w, null, Ve(e.details, (e, t) => (F(), k(w, { key: t }, [e.label ? (F(), k("dt", lt, L(e.label), 1)) : O("", !0), A("dd", { class: P(["text-word-1 m-0 truncate", { "pk-host-call-confirm-card__alone": !e.label }]) }, L(e.value), 3)], 64))), 128))])) : e.unchanged?.length ? (F(), k("p", q, L(t.$t("toolApproval.noChanges")), 1)) : O("", !0),
|
|
190
|
-
e.unchanged?.length ? (F(), D(o, {
|
|
191
|
-
key: 3,
|
|
192
|
-
title: t.$t("toolApproval.unchangedFields", e.unchanged.length),
|
|
193
|
-
modifiers: "compact",
|
|
194
|
-
class: "mb-xs"
|
|
195
|
-
}, {
|
|
196
|
-
default: B(() => [A("dl", ut, [(F(!0), k(w, null, Ve(e.unchanged, (e, t) => (F(), k(w, { key: t }, [A("dt", J, L(e.label), 1), A("dd", dt, L(e.value), 1)], 64))), 128))])]),
|
|
197
|
-
_: 1
|
|
198
|
-
}, 8, ["title"])) : O("", !0),
|
|
199
|
-
j(c, null, {
|
|
200
|
-
default: B(() => [j(s, {
|
|
201
|
-
modifiers: "primary-small",
|
|
202
|
-
icon: "ri:check-line",
|
|
203
|
-
label: t.$t("action.proceed"),
|
|
204
|
-
onClick: n[0] ||= V((e) => r("respond", !0), ["stop"])
|
|
205
|
-
}, null, 8, ["label"]), j(s, {
|
|
206
|
-
modifiers: "action-quiet-small",
|
|
207
|
-
icon: "ri:close-line",
|
|
208
|
-
label: t.$t("action.cancel"),
|
|
209
|
-
onClick: n[1] ||= V((e) => r("respond", !1), ["stop"])
|
|
210
|
-
}, null, 8, ["label"])]),
|
|
211
|
-
_: 1
|
|
212
|
-
})
|
|
213
|
-
]);
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
}), pt = 30, mt = 500;
|
|
217
|
-
function ht(e) {
|
|
218
|
-
let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l = I(!1), u = I(!0), d = !1, f = null, p = null, m = null, h = null, g = 0, ee = (e = "smooth") => {
|
|
219
|
-
!t.value || l.value ? d = !1 : (d = !0, t.value.scrollTo({
|
|
220
|
-
top: t.value.scrollHeight,
|
|
221
|
-
behavior: e
|
|
222
|
-
}), setTimeout(() => {
|
|
223
|
-
d = !1;
|
|
224
|
-
}, e === "instant" ? 0 : mt));
|
|
225
|
-
}, _ = (e) => {
|
|
226
|
-
e.deltaY < 0 && (l.value = !0);
|
|
227
|
-
}, v = 0, y = (e) => {
|
|
228
|
-
v = e.touches[0]?.clientY ?? 0;
|
|
229
|
-
}, b = (e) => {
|
|
230
|
-
let t = e.touches[0]?.clientY ?? 0;
|
|
231
|
-
t > v && (l.value = !0), v = t;
|
|
232
|
-
}, te = () => {
|
|
233
|
-
if (!t.value) return;
|
|
234
|
-
let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
|
|
235
|
-
u.value = n - r - e < pt, d || (e < g && s?.(), e > g && (u.value && (l.value = !1), c?.())), g = e;
|
|
236
|
-
}, ne = () => {
|
|
237
|
-
if (d || l.value || !t.value) return;
|
|
238
|
-
let e = t.value, n = e.scrollHeight - e.clientHeight;
|
|
239
|
-
n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
|
|
240
|
-
d = !1;
|
|
241
|
-
}));
|
|
242
|
-
}, re = () => {
|
|
243
|
-
!f && t.value && (f = new MutationObserver(ne), f.observe(t.value, {
|
|
244
|
-
childList: !0,
|
|
245
|
-
subtree: !0,
|
|
246
|
-
characterData: !0
|
|
247
|
-
}));
|
|
248
|
-
}, ie = () => {
|
|
249
|
-
f?.disconnect(), f = null;
|
|
250
|
-
};
|
|
251
|
-
z(n, (e, t) => {
|
|
252
|
-
e === "streaming" || e === "submitted" ? re() : (e !== "ready" || t !== "streaming") && ie();
|
|
253
|
-
}), z(r, async () => {
|
|
254
|
-
if (r() && i() !== "assistant") {
|
|
255
|
-
ae(), l.value = !1, d = !0;
|
|
256
|
-
try {
|
|
257
|
-
await N(), await o?.(), await N();
|
|
258
|
-
} finally {
|
|
259
|
-
ee();
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
let x = null, S = () => {
|
|
264
|
-
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, x && clearTimeout(x), x = setTimeout(ae, 300)));
|
|
265
|
-
}, ae = () => {
|
|
266
|
-
p?.disconnect(), p = null, m?.disconnect(), m = null, x &&= (clearTimeout(x), null);
|
|
267
|
-
};
|
|
268
|
-
return Be(() => {
|
|
269
|
-
if (!t.value) return;
|
|
270
|
-
t.value.addEventListener("wheel", _, { passive: !0 }), t.value.addEventListener("touchstart", y, { passive: !0 }), t.value.addEventListener("touchmove", b, { passive: !0 });
|
|
271
|
-
let e = n() === "submitted" || n() === "streaming";
|
|
272
|
-
e ? re() : (p = new ResizeObserver(S), p.observe(t.value), m = new MutationObserver(S), m.observe(t.value, {
|
|
273
|
-
childList: !0,
|
|
274
|
-
subtree: !0
|
|
275
|
-
}));
|
|
276
|
-
let r = a?.() ?? t.value.firstElementChild;
|
|
277
|
-
r && (h = new ResizeObserver(ne), h.observe(r)), e || S();
|
|
278
|
-
}), ze(() => {
|
|
279
|
-
t.value?.removeEventListener("wheel", _), t.value?.removeEventListener("touchstart", y), t.value?.removeEventListener("touchmove", b), h?.disconnect(), h = null, ie(), ae();
|
|
280
|
-
}), {
|
|
281
|
-
handleScroll: te,
|
|
282
|
-
scrollToBottom: ee,
|
|
283
|
-
userScrolledUp: l,
|
|
284
|
-
isAtBottom: u
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
// ../../packages/components/src/chat/wakeupFeed.ts
|
|
288
|
-
var Y = (e) => e?.metadata?.wakeup?.taskId;
|
|
289
|
-
function gt(e, t = () => !1) {
|
|
290
|
-
let n = (e) => nt(e) && !t(e), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = 0;
|
|
291
|
-
for (; a < e.length;) {
|
|
292
|
-
let t = e[a];
|
|
293
|
-
if (H(t) && n(e[a + 1])) {
|
|
294
|
-
let o = t.id, s = Y(t), c = 0, l;
|
|
295
|
-
for (; H(e[a]) && Y(e[a]) === s && n(e[a + 1]);) c += 1, l = e[a].metadata?.createdAt ?? l, r.add(e[a].id), r.add(e[a + 1].id), a += 2;
|
|
296
|
-
i.set(o, {
|
|
297
|
-
count: c,
|
|
298
|
-
lastAt: l,
|
|
299
|
-
taskId: s,
|
|
300
|
-
reason: s ? t.metadata?.wakeup?.reason : void 0
|
|
301
|
-
});
|
|
302
|
-
} else n(t) && r.add(t.id), a += 1;
|
|
303
|
-
}
|
|
304
|
-
return {
|
|
305
|
-
hidden: r,
|
|
306
|
-
quietRuns: i
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
// ../../packages/components/src/chat/PkChatbotMessages.vue?vue&type=script&setup=true&lang.ts
|
|
310
|
-
var _t = ["aria-busy"], vt = {
|
|
311
|
-
key: 0,
|
|
312
|
-
class: "pk-chatbot-messages__outline"
|
|
313
|
-
}, yt = {
|
|
314
|
-
key: 0,
|
|
315
|
-
class: "pk-chatbot-divider vv-separator"
|
|
316
|
-
}, bt = { class: "pk-chatbot-divider__label" }, xt = ["title"], St = ["title"], Ct = { class: "pk-chatbot-message__text" }, wt = ["title"], Tt = {
|
|
317
|
-
key: 0,
|
|
318
|
-
class: "pk-chatbot-message__reaction-emoji"
|
|
319
|
-
}, Et = {
|
|
320
|
-
key: 0,
|
|
321
|
-
class: "flex flex-col items-end gap-8 w-full"
|
|
322
|
-
}, Dt = { class: "pk-chatbot-message__host-step" }, Ot = { class: "pk-chatbot-message__host-call" }, kt = { class: "pk-chatbot-message__host-call-label" }, At = {
|
|
323
|
-
key: 0,
|
|
324
|
-
class: "pk-chatbot-message__host-call-outcome"
|
|
325
|
-
}, jt = {
|
|
326
|
-
key: 0,
|
|
327
|
-
class: "pk-chatbot-message__loading-info"
|
|
328
|
-
}, Mt = { class: "flex gap-8 items-center" }, Nt = { class: "text-12" }, Pt = ["title"], Ft = { class: "pk-chatbot-message__pointer-label" }, It = ["title"], Lt = { class: "pk-chatbot-message__pointer-label" }, Rt = { class: "flex gap-8 items-center" }, zt = {
|
|
329
|
-
key: 0,
|
|
330
|
-
class: "pk-chatbot-message__footer"
|
|
331
|
-
}, Bt = {
|
|
332
|
-
key: 0,
|
|
333
|
-
class: "pk-chatbot-message__hover-meta"
|
|
334
|
-
}, Vt = ["datetime", "title"], Ht = { class: "truncate" }, Ut = {
|
|
335
|
-
key: 0,
|
|
336
|
-
class: "flex items-center gap-4 min-w-0"
|
|
337
|
-
}, Wt = { class: "truncate" }, Gt = ["title"], Kt = {
|
|
338
|
-
key: 2,
|
|
339
|
-
class: "flex items-center gap-4 text-12 text-word-3"
|
|
340
|
-
}, qt = { class: "truncate" }, Jt = ["datetime"], Yt = { class: "truncate" }, Xt = {
|
|
341
|
-
key: 4,
|
|
342
|
-
class: "flex items-center gap-4 text-12 text-word-3"
|
|
343
|
-
}, Zt = { class: "pk-chatbot-message__loading-info" }, Qt = { class: "flex gap-8 items-center" }, $t = { class: "text-12" }, en = {
|
|
344
|
-
key: 0,
|
|
345
|
-
class: "pk-chatbot-message pk-chatbot-message--assistant"
|
|
346
|
-
}, tn = ["title", "aria-label"], nn = /* @__PURE__ */ Fe({
|
|
347
|
-
__name: "PkChatbotMessages",
|
|
348
|
-
props: {
|
|
349
|
-
status: {},
|
|
350
|
-
messages: {},
|
|
351
|
-
error: {},
|
|
352
|
-
actions: {},
|
|
353
|
-
mainColor: {},
|
|
354
|
-
textColor: {},
|
|
355
|
-
revisedAnswers: {},
|
|
356
|
-
messageFeedbacks: {},
|
|
357
|
-
readonlyFeedback: { type: Boolean },
|
|
358
|
-
disableHeightAdjustment: { type: Boolean },
|
|
359
|
-
showMessageDateTime: { type: Boolean },
|
|
360
|
-
showMessageTokensCount: { type: Boolean },
|
|
361
|
-
showMessageNumber: { type: Boolean },
|
|
362
|
-
showAllMessageParts: { type: Boolean },
|
|
363
|
-
interactive: { type: Boolean },
|
|
364
|
-
showExtendedSteps: { type: Boolean },
|
|
365
|
-
hideReasoning: { type: Boolean },
|
|
366
|
-
awaitingSpokenAnswer: { type: Boolean },
|
|
367
|
-
hostWorking: { type: Boolean },
|
|
368
|
-
hostConfirmation: {},
|
|
369
|
-
confirmVerdictsOnCall: {},
|
|
370
|
-
isDark: { type: Boolean },
|
|
371
|
-
showScrollToBottom: { type: Boolean },
|
|
372
|
-
parentScrolls: { type: Boolean },
|
|
373
|
-
feedbackMessageId: {},
|
|
374
|
-
feedbackLoading: { type: Boolean },
|
|
375
|
-
feedbackSubmitted: { type: Boolean },
|
|
376
|
-
feedbackError: {}
|
|
377
|
-
},
|
|
378
|
-
emits: [
|
|
379
|
-
"show-info",
|
|
380
|
-
"regenerate",
|
|
381
|
-
"revise",
|
|
382
|
-
"upvote",
|
|
383
|
-
"downvote",
|
|
384
|
-
"feedback",
|
|
385
|
-
"feedback-submit",
|
|
386
|
-
"feedback-close",
|
|
387
|
-
"scroll-up",
|
|
388
|
-
"scroll-down",
|
|
389
|
-
"auto-retry",
|
|
390
|
-
"reset-chat",
|
|
391
|
-
"approval-respond",
|
|
392
|
-
"confirm-respond",
|
|
393
|
-
"host-confirm-respond"
|
|
394
|
-
],
|
|
395
|
-
setup(e, { emit: t }) {
|
|
396
|
-
let n = e, r = t, { t: i, te: o, d: s, n: c } = qe({ useScope: "global" }), l = Ie(oe, void 0), u = Ie(ae, void 0), y = (e) => {
|
|
397
|
-
let t = e.toolCallId;
|
|
398
|
-
return typeof t == "string" ? u?.value[t]?.details : void 0;
|
|
399
|
-
}, S = Ge(), se = (e, t) => {
|
|
400
|
-
if (_(e)) {
|
|
401
|
-
let n = e.toolCallId;
|
|
402
|
-
n && r("confirm-respond", {
|
|
403
|
-
toolCallId: n,
|
|
404
|
-
confirmed: t
|
|
405
|
-
});
|
|
406
|
-
return;
|
|
407
|
-
}
|
|
408
|
-
let n = v(e);
|
|
409
|
-
n && r("approval-respond", {
|
|
410
|
-
id: n,
|
|
411
|
-
approved: t
|
|
412
|
-
});
|
|
413
|
-
}, C = Ke("scrollEl"), M = Ke("wrapperEl"), Fe = E(() => ue(n.textColor, n.mainColor));
|
|
414
|
-
Ae(M);
|
|
415
|
-
let { handleScroll: ze, scrollToBottom: Ye, userScrolledUp: Xe, isAtBottom: Ze } = ht({
|
|
416
|
-
scrollEl: C,
|
|
417
|
-
status: () => n.status,
|
|
418
|
-
messagesLength: () => n.messages?.length,
|
|
419
|
-
lastMessageRole: () => n.messages?.[n.messages.length - 1]?.role,
|
|
420
|
-
contentEl: () => M.value,
|
|
421
|
-
beforeNewMessageScroll: () => q(),
|
|
422
|
-
onScrollUp: () => r("scroll-up"),
|
|
423
|
-
onScrollDown: () => r("scroll-down")
|
|
424
|
-
}), Qe = () => {
|
|
425
|
-
Xe.value = !1, Ye();
|
|
426
|
-
}, U = E(() => (n.messages ?? []).filter((e) => e.role === "user" && !H(e)).map((e) => ({
|
|
427
|
-
id: e.id,
|
|
428
|
-
preview: e.parts.find(ge)?.text.trim().slice(0, 120) || "…"
|
|
429
|
-
}))), $e = I(), et = () => C.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], tt = () => {
|
|
430
|
-
let e = C.value;
|
|
431
|
-
if (!e || !n.showScrollToBottom) return;
|
|
432
|
-
let t = e.getBoundingClientRect().top + e.clientHeight / 2, r = U.value[0]?.id;
|
|
433
|
-
et().forEach((e, n) => {
|
|
434
|
-
e.getBoundingClientRect().top <= t && (r = U.value[n]?.id);
|
|
435
|
-
}), $e.value = r;
|
|
436
|
-
};
|
|
437
|
-
z(U, async () => {
|
|
438
|
-
await N(), tt();
|
|
439
|
-
});
|
|
440
|
-
let nt = () => {
|
|
441
|
-
ze(), tt();
|
|
442
|
-
}, it = (e) => {
|
|
443
|
-
let t = C.value, n = U.value.findIndex((t) => t.id === e), r = et()[n];
|
|
444
|
-
t && r && (Xe.value = !0, t.scrollTo({
|
|
445
|
-
top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
|
|
446
|
-
behavior: "smooth"
|
|
447
|
-
}));
|
|
448
|
-
}, W = E(() => n.status === "submitted" || n.status === "streaming" || n.hostWorking === !0), G = I(0), at = I(!1), K = !1, st = We(), ct = () => n.messages?.[n.messages.length - 1]?.role === "user" || W.value, lt = () => {
|
|
449
|
-
K = !1, at.value = !0, G.value = 0;
|
|
450
|
-
}, q = async () => {
|
|
451
|
-
if (!n.messages?.length || n.disableHeightAdjustment) return;
|
|
452
|
-
if (!ct()) {
|
|
453
|
-
K && (await N(), C.value?.scrollHeight, ct() || lt());
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
if (K = !0, at.value = !1, await N(), !C.value) return;
|
|
457
|
-
let { paddingTop: e, paddingBottom: t } = getComputedStyle(C.value), r = C.value.clientHeight - Number.parseFloat(e) - Number.parseFloat(t), i = M.value && Number.parseFloat(getComputedStyle(M.value).rowGap) || 0, a = et();
|
|
458
|
-
st.value = a[a.length - 1];
|
|
459
|
-
let o = r - (st.value?.clientHeight ?? 0) - i;
|
|
460
|
-
r > 0 && (G.value = Math.max(o, 0)), await N();
|
|
461
|
-
};
|
|
462
|
-
z([() => n.messages?.length, () => n.messages?.[n.messages.length - 1]?.id], () => q()), Je([C, st], () => {
|
|
463
|
-
K && q();
|
|
464
|
-
}), Be(() => {
|
|
465
|
-
(W.value || n.awaitingSpokenAnswer) && q();
|
|
466
|
-
}), z(W, (e) => {
|
|
467
|
-
e || lt();
|
|
468
|
-
});
|
|
469
|
-
let ut = (e) => n.revisedAnswers?.some((t) => t.messageId === e), J = (e) => n.messageFeedbacks?.find((t) => t.messageId === e), dt = /* @__PURE__ */ new Set([
|
|
470
|
-
"showContactForm",
|
|
471
|
-
"showForm",
|
|
472
|
-
"showMultipleChoice",
|
|
473
|
-
"showSuggestedReply"
|
|
474
|
-
]), pt = /* @__PURE__ */ new Set([
|
|
475
|
-
"showChart",
|
|
476
|
-
"showDiagram",
|
|
477
|
-
"showLocation"
|
|
478
|
-
]), mt = (e) => {
|
|
479
|
-
let t = he(e);
|
|
480
|
-
return {
|
|
481
|
-
...!n.interactive && dt.has(t) ? { record: !0 } : {},
|
|
482
|
-
...pt.has(t) ? { isDark: n.isDark } : {}
|
|
483
|
-
};
|
|
484
|
-
}, Y = (e, t) => !n.readonlyFeedback && xn(e, t), nn = (e) => n.readonlyFeedback ? J(e) : void 0, rn = (e) => nn(e)?.vote, an = (e) => {
|
|
485
|
-
let t = nn(e);
|
|
486
|
-
if (t?.vote) return;
|
|
487
|
-
let n = t?.metadata?.reactionEmoji;
|
|
488
|
-
return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
|
|
489
|
-
}, on = (e) => !!(rn(e) || an(e)), sn = (e) => {
|
|
490
|
-
if (an(e)) return "pk-chatbot-message__reaction--neutral";
|
|
491
|
-
let t = rn(e);
|
|
492
|
-
return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
|
|
493
|
-
}, cn = (e) => {
|
|
494
|
-
let t = rn(e);
|
|
495
|
-
return i(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
|
|
496
|
-
}, ln = (e) => {
|
|
497
|
-
let t = fn(e);
|
|
498
|
-
for (let e = t.length - 1; e >= 0; --e) if (ge(t[e])) return e;
|
|
499
|
-
return -1;
|
|
500
|
-
}, un = E(() => n.messages?.[n.messages.length - 1]), X = E(() => {
|
|
501
|
-
let e = un.value;
|
|
502
|
-
return e ? e.parts[e.parts.length - 1] : null;
|
|
503
|
-
}), dn = E(() => {
|
|
504
|
-
let e = /* @__PURE__ */ new Map();
|
|
505
|
-
for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id, h(ne(m(t.parts))));
|
|
506
|
-
return e;
|
|
507
|
-
}), fn = (e) => dn.value.get(e.id) ?? e.parts, pn = E(() => n.status === "error"), mn = E(() => n.awaitingSpokenAnswer === !0 && !W.value), hn = E(() => mn.value && un.value?.role === "user" && !pn.value), gn = (e, t) => t(), _n = E(() => {
|
|
508
|
-
let e = X.value;
|
|
509
|
-
return p(i, e, l?.value);
|
|
510
|
-
}), vn = E(() => {
|
|
511
|
-
let e = X.value;
|
|
512
|
-
return le(e);
|
|
513
|
-
}), yn = (e) => n.messages?.findIndex((t) => t.id === e), Z = (e) => e === void 0 || !n.messages ? !1 : e === n.messages.length - 1, bn = (e) => Z(e) && n.status === "ready" && !n.hostWorking && !!n.actions?.includes("regenerate"), xn = (e, t) => (!Z(t) || n.status === "ready" && !n.hostWorking) && !!n.actions?.includes(e), Sn = (e) => {
|
|
514
|
-
let t = e.parts[e.parts.length - 1];
|
|
515
|
-
return ge(t);
|
|
516
|
-
}, Cn = (e) => e.parts.some((e) => me(e) || xe(e) || !!b(e)), wn = (e) => !!n.showExtendedSteps && Q(e) && Cn(e), Tn = (e) => n.hostConfirmation !== void 0 && b(e) !== void 0 && e.toolCallId === n.hostConfirmation.toolCallId, En = E(() => n.hostConfirmation !== void 0 && !n.messages?.some((e) => e.parts.some(Tn))), Dn = (e, t) => W.value && Z(e) && b(t)?.state === "input-available", On = (e, t, n, r) => {
|
|
517
|
-
if (!b(n) || wn(e)) return !1;
|
|
518
|
-
let i = Dn(t, n);
|
|
519
|
-
return i && r === fn(e).length - 1 ? !1 : i || f(n) || !ve(e);
|
|
520
|
-
}, kn = (e, t) => {
|
|
521
|
-
let n = b(t);
|
|
522
|
-
return n?.state === "output-error" ? i(n.errorText === "The user refused this call. Do not repeat it unless the user asks." ? "toolApproval.denied" : "messagePart.hostToolFailed") : n?.state === "input-available" && !Dn(e, t) ? i("messagePart.hostToolNoAnswer") : void 0;
|
|
523
|
-
}, An = (e) => xe(e) && !g(e) && !!(rt[he(e)] || S[e.type] || n.showAllMessageParts), jn = (e) => e.parts.some((e) => ge(e) && !!e.text.trim() || ye(e) || ee(e) && !g(e) || An(e)), Q = (e) => e.role === "assistant", Mn = (e) => e.role === "user", Nn = (e) => n.messages?.slice(0, e).reverse().find((e) => Q(e)), Pn = (e) => n.messages?.slice(e + 1).find((e) => Q(e)), Fn = (e) => {
|
|
524
|
-
let t = Nn(e)?.metadata?.createdAt, n = Pn(e)?.metadata?.createdAt;
|
|
525
|
-
if (!t || !n) return;
|
|
526
|
-
let r = new Date(t), i = new Date(n);
|
|
527
|
-
return r.toDateString() === i.toDateString() ? void 0 : i;
|
|
528
|
-
}, $ = E(() => n.showAllMessageParts ? gt([]) : gt(n.messages ?? [], jn)), In = (e) => e ? "ri:calendar-schedule-line" : "ri:alarm-line", Ln = (e) => {
|
|
529
|
-
let t = e.metadata?.wakeup;
|
|
530
|
-
return t?.taskId ? i("label.taskRun", { reason: t.reason }) : i("label.wakeupCheck");
|
|
531
|
-
}, Rn = (e) => {
|
|
532
|
-
let t = s(e.lastAt ?? Date.now(), "time");
|
|
533
|
-
return e.taskId ? i("label.taskQuietRun", {
|
|
534
|
-
reason: e.reason,
|
|
535
|
-
count: e.count,
|
|
536
|
-
time: t
|
|
537
|
-
}, e.count) : i("label.wakeupQuietRun", {
|
|
538
|
-
count: e.count,
|
|
539
|
-
time: t
|
|
540
|
-
}, e.count);
|
|
541
|
-
}, zn = E(() => {
|
|
542
|
-
let e = 0;
|
|
543
|
-
return (n.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
|
|
544
|
-
}), Bn = (e, t) => t === 0 || e.role !== "assistant" ? !1 : !!(n.actions?.length || n.showMessageNumber || n.showMessageDateTime && e.metadata?.createdAt !== void 0 || e.metadata?.completedAt !== void 0 || n.showMessageTokensCount && e.metadata?.totalTokens !== void 0), Vn = (e) => {
|
|
545
|
-
let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
546
|
-
return s(t, n ? "time" : "date-time");
|
|
547
|
-
}, Hn = (e) => {
|
|
548
|
-
let { createdAt: t, completedAt: n } = e.metadata ?? {};
|
|
549
|
-
if (t && n) return ie(c, n - t);
|
|
550
|
-
}, Un = Ke("feedbackMessageEl");
|
|
551
|
-
return z(() => n.feedbackMessageId, async () => {
|
|
552
|
-
if (await N(), !n.feedbackMessageId) return;
|
|
553
|
-
let e = Un.value?.[0]?.$el;
|
|
554
|
-
e && (Z(yn(n.feedbackMessageId)) ? Ye() : e.scrollIntoView({
|
|
555
|
-
behavior: "smooth",
|
|
556
|
-
block: "center"
|
|
557
|
-
}));
|
|
558
|
-
}), (t, n) => {
|
|
559
|
-
let u = Ne, f = je, m = a, h = Me;
|
|
560
|
-
return F(), k("div", {
|
|
561
|
-
ref_key: "scrollEl",
|
|
562
|
-
ref: C,
|
|
563
|
-
class: P(["pk-chatbot-messages scrollbar-thin", {
|
|
564
|
-
"pk-chatbot-messages--settling": at.value,
|
|
565
|
-
"pk-chatbot-messages--parent-scrolls": e.parentScrolls
|
|
566
|
-
}]),
|
|
567
|
-
role: "log",
|
|
568
|
-
"aria-live": "polite",
|
|
569
|
-
"aria-relevant": "additions text",
|
|
570
|
-
"aria-busy": W.value,
|
|
571
|
-
style: Re({
|
|
572
|
-
"--chatbot-main-color": e.mainColor,
|
|
573
|
-
"--chatbot-contrast-color": Fe.value
|
|
574
|
-
}),
|
|
575
|
-
onScroll: nt
|
|
576
|
-
}, [
|
|
577
|
-
e.showScrollToBottom && U.value.length > 1 ? (F(), k("div", vt, [j(ke, {
|
|
578
|
-
items: U.value,
|
|
579
|
-
"active-id": $e.value,
|
|
580
|
-
onSelect: it
|
|
581
|
-
}, null, 8, ["items", "active-id"])])) : O("", !0),
|
|
582
|
-
A("div", {
|
|
583
|
-
ref_key: "wrapperEl",
|
|
584
|
-
ref: M,
|
|
585
|
-
class: "pk-chatbot-messages__wrapper"
|
|
586
|
-
}, [
|
|
587
|
-
(F(!0), k(w, null, Ve(e.messages, (a, v) => (F(), k(w, { key: a.id }, [
|
|
588
|
-
Mn(a) && Fn(v) ? (F(), k("div", yt, [A("span", bt, L(R(s)(Fn(v), "short")), 1)])) : O("", !0),
|
|
589
|
-
$.value.quietRuns.has(a.id) ? (F(), k("div", {
|
|
590
|
-
key: 1,
|
|
591
|
-
class: "pk-chatbot-wakeup",
|
|
592
|
-
title: $.value.quietRuns.get(a.id).reason
|
|
593
|
-
}, [j(u, {
|
|
594
|
-
name: In($.value.quietRuns.get(a.id).taskId),
|
|
595
|
-
class: "shrink-0"
|
|
596
|
-
}, null, 8, ["name"]), A("span", null, L(Rn($.value.quietRuns.get(a.id))), 1)], 8, xt)) : R(H)(a) && !$.value.hidden.has(a.id) && !e.showAllMessageParts ? (F(), k("div", {
|
|
597
|
-
key: 2,
|
|
598
|
-
class: "pk-chatbot-wakeup",
|
|
599
|
-
title: a.metadata?.wakeup?.reason
|
|
600
|
-
}, [j(u, {
|
|
601
|
-
name: In(a.metadata?.wakeup?.taskId),
|
|
602
|
-
class: "shrink-0"
|
|
603
|
-
}, null, 8, ["name"]), A("span", null, [Pe(L(Ln(a)) + " ", 1), a.metadata?.createdAt ? (F(), k(w, { key: 0 }, [Pe(" · " + L(R(s)(a.metadata.createdAt, "time")), 1)], 64)) : O("", !0)])], 8, St)) : O("", !0),
|
|
604
|
-
(!R(H)(a) || e.showAllMessageParts) && (!$.value.hidden.has(a.id) || W.value && Z(v)) && (a.parts.length || Z(v) && W.value && Q(a)) ? (F(), k("div", {
|
|
605
|
-
key: 3,
|
|
606
|
-
class: P(["pk-chatbot-message", [`pk-chatbot-message--${a.role}`, { "pk-chatbot-message--loading": W.value && Z(v) && Q(a) }]]),
|
|
607
|
-
style: Re({ minHeight: Z(v) && Q(a) && !pn.value ? `${G.value}px` : void 0 })
|
|
608
|
-
}, [
|
|
609
|
-
j(T, {
|
|
610
|
-
appear: "",
|
|
611
|
-
name: "pk-chatbot-part"
|
|
612
|
-
}, {
|
|
613
|
-
default: B(() => [wn(a) ? (F(), D(Oe, {
|
|
614
|
-
key: 0,
|
|
615
|
-
message: a,
|
|
616
|
-
"is-streaming": W.value && Z(v),
|
|
617
|
-
"has-content": jn(a),
|
|
618
|
-
"hide-reasoning": e.hideReasoning,
|
|
619
|
-
"is-dark": e.isDark
|
|
620
|
-
}, null, 8, [
|
|
621
|
-
"message",
|
|
622
|
-
"is-streaming",
|
|
623
|
-
"has-content",
|
|
624
|
-
"hide-reasoning",
|
|
625
|
-
"is-dark"
|
|
626
|
-
])) : O("", !0)]),
|
|
627
|
-
_: 2
|
|
628
|
-
}, 1024),
|
|
629
|
-
(F(!0), k(w, null, Ve(fn(a), (s, c) => (F(), k(w, { key: R(re)(s, c) }, [R(ge)(s) && s.text.trim() ? (F(), D(T, {
|
|
630
|
-
key: 0,
|
|
631
|
-
appear: "",
|
|
632
|
-
name: "pk-chatbot-part"
|
|
633
|
-
}, {
|
|
634
|
-
default: B(() => [A("div", Ct, [He(t.$slots, "text", Le({ ref_for: !0 }, {
|
|
635
|
-
message: a,
|
|
636
|
-
part: s,
|
|
637
|
-
index: v,
|
|
638
|
-
isLoading: W.value
|
|
639
|
-
}), () => [Q(a) ? (F(), D(de, {
|
|
640
|
-
key: 0,
|
|
641
|
-
class: "wysiwyg",
|
|
642
|
-
markdown: s.text,
|
|
643
|
-
"is-dark": e.isDark,
|
|
644
|
-
loading: Z(v) && e.status === "streaming"
|
|
645
|
-
}, null, 8, [
|
|
646
|
-
"markdown",
|
|
647
|
-
"is-dark",
|
|
648
|
-
"loading"
|
|
649
|
-
])) : (F(), k(w, { key: 1 }, [Pe(L(s.text), 1)], 64))]), on(a.id) && !J(a.id)?.comment && c === ln(a) ? (F(), k("span", {
|
|
650
|
-
key: 0,
|
|
651
|
-
class: P(["pk-chatbot-message__reaction", sn(a.id)]),
|
|
652
|
-
title: cn(a.id)
|
|
653
|
-
}, [an(a.id) ? (F(), k("span", Tt, L(an(a.id)), 1)) : (F(), D(u, {
|
|
654
|
-
key: 1,
|
|
655
|
-
name: rn(a.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
|
|
656
|
-
}, null, 8, ["name"]))], 10, wt)) : O("", !0)])]),
|
|
657
|
-
_: 2
|
|
658
|
-
}, 1024)) : R(ye)(s) ? (F(), D(T, {
|
|
659
|
-
key: 1,
|
|
660
|
-
appear: "",
|
|
661
|
-
name: "pk-chatbot-part"
|
|
662
|
-
}, {
|
|
663
|
-
default: B(() => [R(d)(s.filename, s.mediaType) ? (F(), k("div", Et, [j(Ce, {
|
|
664
|
-
"media-type": s.mediaType,
|
|
665
|
-
url: s.url,
|
|
666
|
-
filename: s.filename,
|
|
667
|
-
size: R(be)(s)?.bytesCount
|
|
668
|
-
}, null, 8, [
|
|
669
|
-
"media-type",
|
|
670
|
-
"url",
|
|
671
|
-
"filename",
|
|
672
|
-
"size"
|
|
673
|
-
]), j(we, {
|
|
674
|
-
url: s.url,
|
|
675
|
-
transcript: R(_e)(s),
|
|
676
|
-
pending: e.status === "submitted" && Z(v)
|
|
677
|
-
}, null, 8, [
|
|
678
|
-
"url",
|
|
679
|
-
"transcript",
|
|
680
|
-
"pending"
|
|
681
|
-
])])) : (F(), D(Ce, {
|
|
682
|
-
key: 1,
|
|
683
|
-
"media-type": s.mediaType,
|
|
684
|
-
url: s.url,
|
|
685
|
-
filename: s.filename,
|
|
686
|
-
size: R(be)(s)?.bytesCount
|
|
687
|
-
}, null, 8, [
|
|
688
|
-
"media-type",
|
|
689
|
-
"url",
|
|
690
|
-
"filename",
|
|
691
|
-
"size"
|
|
692
|
-
]))]),
|
|
693
|
-
_: 2
|
|
694
|
-
}, 1024)) : R(ee)(s) && !R(g)(s) ? (F(), D(T, {
|
|
695
|
-
key: 2,
|
|
696
|
-
appear: "",
|
|
697
|
-
name: "pk-chatbot-part"
|
|
698
|
-
}, {
|
|
699
|
-
default: B(() => [(F(), D(ot, {
|
|
700
|
-
key: `approval-${c}`,
|
|
701
|
-
part: s,
|
|
702
|
-
actionable: e.interactive === !0 && (R(_)(s) || Z(v)),
|
|
703
|
-
"call-verdict": e.confirmVerdictsOnCall?.get(s.toolCallId ?? ""),
|
|
704
|
-
onRespond: (e) => se(s, e)
|
|
705
|
-
}, null, 8, [
|
|
706
|
-
"part",
|
|
707
|
-
"actionable",
|
|
708
|
-
"call-verdict",
|
|
709
|
-
"onRespond"
|
|
710
|
-
]))]),
|
|
711
|
-
_: 2
|
|
712
|
-
}, 1024)) : Tn(s) ? (F(), D(T, {
|
|
713
|
-
key: 3,
|
|
714
|
-
appear: "",
|
|
715
|
-
name: "pk-chatbot-part"
|
|
716
|
-
}, {
|
|
717
|
-
default: B(() => [j(ft, {
|
|
718
|
-
question: e.hostConfirmation?.question ?? R(i)("toolApproval.hostCall", { name: R(p)(R(i), s) }),
|
|
719
|
-
details: e.hostConfirmation?.details,
|
|
720
|
-
unchanged: e.hostConfirmation?.unchanged,
|
|
721
|
-
onRespond: n[0] ||= (e) => r("host-confirm-respond", e)
|
|
722
|
-
}, null, 8, [
|
|
723
|
-
"question",
|
|
724
|
-
"details",
|
|
725
|
-
"unchanged"
|
|
726
|
-
])]),
|
|
727
|
-
_: 2
|
|
728
|
-
}, 1024)) : On(a, v, s, c) ? (F(), D(T, {
|
|
729
|
-
key: 4,
|
|
730
|
-
appear: "",
|
|
731
|
-
name: "pk-chatbot-part"
|
|
732
|
-
}, {
|
|
733
|
-
default: B(() => [A("div", Dt, [A("div", Ot, [
|
|
734
|
-
j(u, {
|
|
735
|
-
name: Dn(v, s) ? "loading-loop" : R(le)(s) ?? "ri:apps-line",
|
|
736
|
-
class: "shrink-0"
|
|
737
|
-
}, null, 8, ["name"]),
|
|
738
|
-
A("span", kt, L(R(p)(R(i), s, R(l))), 1),
|
|
739
|
-
kn(v, s) ? (F(), k("span", At, " · " + L(kn(v, s)), 1)) : O("", !0)
|
|
740
|
-
]), y(s)?.length ? (F(), D(f, {
|
|
741
|
-
key: 0,
|
|
742
|
-
title: R(i)("toolApproval.changesCount", y(s).length),
|
|
743
|
-
modifiers: "compact",
|
|
744
|
-
class: "pk-chatbot-message__host-changes"
|
|
745
|
-
}, {
|
|
746
|
-
default: B(() => [j(De, { changes: y(s) }, null, 8, ["changes"])]),
|
|
747
|
-
_: 2
|
|
748
|
-
}, 1032, ["title"])) : O("", !0)])]),
|
|
749
|
-
_: 2
|
|
750
|
-
}, 1024)) : An(s) ? (F(), D(T, {
|
|
751
|
-
key: 5,
|
|
752
|
-
appear: "",
|
|
753
|
-
name: "pk-chatbot-part"
|
|
754
|
-
}, {
|
|
755
|
-
default: B(() => [!R(S)[s.type] && R(rt)[R(he)(s)] ? (F(), D(Ue(R(rt)[R(he)(s)]), Le({
|
|
756
|
-
key: `component-${c}-${R(te)(s)}`,
|
|
757
|
-
part: s
|
|
758
|
-
}, { ref_for: !0 }, mt(s)), null, 16, ["part"])) : He(t.$slots, s.type, Le({ ref_for: !0 }, {
|
|
759
|
-
message: a,
|
|
760
|
-
part: s,
|
|
761
|
-
index: v,
|
|
762
|
-
isLoading: W.value
|
|
763
|
-
}), () => [e.showAllMessageParts ? (F(), k("div", jt, [A("div", Mt, [R(le)(s) ? (F(), D(u, {
|
|
764
|
-
key: 0,
|
|
765
|
-
name: R(le)(s),
|
|
766
|
-
class: "shrink-0"
|
|
767
|
-
}, null, 8, ["name"])) : O("", !0), A("span", Nt, L(R(ce)(s, {
|
|
768
|
-
t: R(i),
|
|
769
|
-
te: R(o)
|
|
770
|
-
})), 1)])])) : O("", !0)], void 0, 1)]),
|
|
771
|
-
_: 2
|
|
772
|
-
}, 1024)) : O("", !0), j(T, { mode: "out-in" }, {
|
|
773
|
-
default: B(() => [c === ln(a) && e.readonlyFeedback && J(a.id)?.comment ? (F(), D(Se, {
|
|
774
|
-
key: 0,
|
|
775
|
-
feedback: J(a.id)
|
|
776
|
-
}, null, 8, ["feedback"])) : O("", !0)]),
|
|
777
|
-
_: 2
|
|
778
|
-
}, 1024)], 64))), 128)),
|
|
779
|
-
Mn(a) && a.metadata?.pagePointer ? (F(), k("div", {
|
|
780
|
-
key: 0,
|
|
781
|
-
class: "pk-chatbot-message__pointer",
|
|
782
|
-
title: a.metadata.pagePointer.kind === "text" ? R(i)("pagePointer.selected") : R(i)("pagePointer.pointed")
|
|
783
|
-
}, [j(u, {
|
|
784
|
-
name: a.metadata.pagePointer.kind === "text" ? "ri:double-quotes-l" : "ri:focus-3-line",
|
|
785
|
-
class: "pk-chatbot-message__pointer-icon"
|
|
786
|
-
}, null, 8, ["name"]), A("span", Ft, L(a.metadata.pagePointer.kind === "text" ? `«${a.metadata.pagePointer.label}»` : a.metadata.pagePointer.label), 1)], 8, Pt)) : Mn(a) && a.metadata?.filePointer ? (F(), k("div", {
|
|
787
|
-
key: 1,
|
|
788
|
-
class: "pk-chatbot-message__pointer",
|
|
789
|
-
title: R(i)("selectionActions.selectedInFile")
|
|
790
|
-
}, [j(u, {
|
|
791
|
-
name: a.metadata.filePointer.format === "docx" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
|
|
792
|
-
class: "pk-chatbot-message__pointer-icon"
|
|
793
|
-
}, null, 8, ["name"]), A("span", Lt, L(a.metadata.filePointer.label), 1)], 8, It)) : O("", !0),
|
|
794
|
-
j(T, {
|
|
795
|
-
name: "fade-in",
|
|
796
|
-
mode: "out-in"
|
|
797
|
-
}, {
|
|
798
|
-
default: B(() => [W.value && Z(v) && !Sn(a) && !e.hostConfirmation && Q(a) && (!wn(a) || jn(a)) ? (F(), k("div", {
|
|
799
|
-
key: `loading-info-${a.id}`,
|
|
800
|
-
class: "pk-chatbot-message__loading-info"
|
|
801
|
-
}, [A("div", Rt, [
|
|
802
|
-
j(u, {
|
|
803
|
-
name: "loading-loop",
|
|
804
|
-
class: "shrink-0"
|
|
805
|
-
}),
|
|
806
|
-
j(T, { mode: "out-in" }, {
|
|
807
|
-
default: B(() => [vn.value ? (F(), D(u, {
|
|
808
|
-
key: vn.value,
|
|
809
|
-
class: "shrink-0",
|
|
810
|
-
name: vn.value
|
|
811
|
-
}, null, 8, ["name"])) : O("", !0)]),
|
|
812
|
-
_: 1
|
|
813
|
-
}),
|
|
814
|
-
j(T, { mode: "out-in" }, {
|
|
815
|
-
default: B(() => [_n.value ? (F(), k("span", {
|
|
816
|
-
key: _n.value,
|
|
817
|
-
class: "text-12"
|
|
818
|
-
}, L(_n.value), 1)) : O("", !0)]),
|
|
819
|
-
_: 1
|
|
820
|
-
})
|
|
821
|
-
]), j(T, {
|
|
822
|
-
name: "fade-in",
|
|
823
|
-
mode: "out-in"
|
|
824
|
-
}, {
|
|
825
|
-
default: B(() => [!e.hideReasoning && !wn(a) && X.value && "text" in X.value && X.value.text.trim() ? (F(), D(Ee, {
|
|
826
|
-
key: 0,
|
|
827
|
-
markdown: X.value.text,
|
|
828
|
-
"is-dark": e.isDark,
|
|
829
|
-
"tail-length": R(x),
|
|
830
|
-
"inner-class": "wysiwyg",
|
|
831
|
-
class: "border border-surface-3 rounded-md p-4 mt-8 bg-surface-1 max-h-64 text-12 w-full"
|
|
832
|
-
}, null, 8, [
|
|
833
|
-
"markdown",
|
|
834
|
-
"is-dark",
|
|
835
|
-
"tail-length"
|
|
836
|
-
])) : O("", !0)]),
|
|
837
|
-
_: 2
|
|
838
|
-
}, 1024)])) : O("", !0)]),
|
|
839
|
-
_: 2
|
|
840
|
-
}, 1024),
|
|
841
|
-
j(T, { mode: "out-in" }, {
|
|
842
|
-
default: B(() => [Bn(a, v) ? (F(), k("div", zt, [
|
|
843
|
-
j(h, {
|
|
844
|
-
modifiers: "compact",
|
|
845
|
-
class: "mr-auto shrink-0"
|
|
846
|
-
}, {
|
|
847
|
-
default: B(() => [
|
|
848
|
-
j(T, { mode: "out-in" }, {
|
|
849
|
-
default: B(() => [bn(v) ? (F(), D(m, {
|
|
850
|
-
key: 0,
|
|
851
|
-
icon: "ri:reset-right-line",
|
|
852
|
-
modifiers: "action-quiet-small",
|
|
853
|
-
title: R(i)("action.regenerate"),
|
|
854
|
-
"aria-label": R(i)("action.regenerate"),
|
|
855
|
-
onClick: n[1] ||= V((e) => t.$emit("regenerate"), ["stop"])
|
|
856
|
-
}, null, 8, ["title", "aria-label"])) : O("", !0)]),
|
|
857
|
-
_: 2
|
|
858
|
-
}, 1024),
|
|
859
|
-
j(T, { mode: "out-in" }, {
|
|
860
|
-
default: B(() => [xn("show-info", v) ? (F(), D(m, {
|
|
861
|
-
key: 0,
|
|
862
|
-
icon: "ri:information-line",
|
|
863
|
-
title: R(i)("action.getMoreInfo"),
|
|
864
|
-
"aria-label": R(i)("action.getMoreInfo"),
|
|
865
|
-
modifiers: "action-quiet-small",
|
|
866
|
-
onClick: V((e) => t.$emit("show-info", a), ["stop"])
|
|
867
|
-
}, null, 8, [
|
|
868
|
-
"title",
|
|
869
|
-
"aria-label",
|
|
870
|
-
"onClick"
|
|
871
|
-
])) : O("", !0)]),
|
|
872
|
-
_: 2
|
|
873
|
-
}, 1024),
|
|
874
|
-
j(T, { mode: "out-in" }, {
|
|
875
|
-
default: B(() => [xn("revise", v) ? (F(), D(m, {
|
|
876
|
-
key: 0,
|
|
877
|
-
icon: ut(a.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
|
|
878
|
-
title: ut(a.id) ? R(i)("action.editRevise") : R(i)("action.createRevise"),
|
|
879
|
-
"aria-label": ut(a.id) ? R(i)("action.editRevise") : R(i)("action.createRevise"),
|
|
880
|
-
modifiers: "action-quiet-small",
|
|
881
|
-
class: P({ "text-brand-graphic": ut(a.id) }),
|
|
882
|
-
onClick: V((e) => t.$emit("revise", a), ["stop"])
|
|
883
|
-
}, null, 8, [
|
|
884
|
-
"icon",
|
|
885
|
-
"title",
|
|
886
|
-
"aria-label",
|
|
887
|
-
"class",
|
|
888
|
-
"onClick"
|
|
889
|
-
])) : O("", !0)]),
|
|
890
|
-
_: 2
|
|
891
|
-
}, 1024),
|
|
892
|
-
j(T, { mode: "out-in" }, {
|
|
893
|
-
default: B(() => [Y("upvote", v) ? (F(), D(m, {
|
|
894
|
-
key: 0,
|
|
895
|
-
icon: J(a.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
|
|
896
|
-
title: R(i)("action.upvote"),
|
|
897
|
-
"aria-label": R(i)("action.upvote"),
|
|
898
|
-
modifiers: "action-quiet-small",
|
|
899
|
-
onClick: V((e) => t.$emit("upvote", a), ["stop"])
|
|
900
|
-
}, null, 8, [
|
|
901
|
-
"icon",
|
|
902
|
-
"title",
|
|
903
|
-
"aria-label",
|
|
904
|
-
"onClick"
|
|
905
|
-
])) : O("", !0)]),
|
|
906
|
-
_: 2
|
|
907
|
-
}, 1024),
|
|
908
|
-
j(T, { mode: "out-in" }, {
|
|
909
|
-
default: B(() => [Y("downvote", v) ? (F(), D(m, {
|
|
910
|
-
key: 0,
|
|
911
|
-
icon: J(a.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
|
|
912
|
-
title: R(i)("action.downvote"),
|
|
913
|
-
"aria-label": R(i)("action.downvote"),
|
|
914
|
-
modifiers: "action-quiet-small",
|
|
915
|
-
onClick: V((e) => t.$emit("downvote", a), ["stop"])
|
|
916
|
-
}, null, 8, [
|
|
917
|
-
"icon",
|
|
918
|
-
"title",
|
|
919
|
-
"aria-label",
|
|
920
|
-
"onClick"
|
|
921
|
-
])) : O("", !0)]),
|
|
922
|
-
_: 2
|
|
923
|
-
}, 1024),
|
|
924
|
-
j(T, { mode: "out-in" }, {
|
|
925
|
-
default: B(() => [Y("feedback", v) ? (F(), D(m, {
|
|
926
|
-
key: 0,
|
|
927
|
-
icon: J(a.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
|
|
928
|
-
title: R(i)("action.feedback"),
|
|
929
|
-
"aria-label": R(i)("action.feedback"),
|
|
930
|
-
modifiers: "action-quiet-small",
|
|
931
|
-
onClick: V((e) => t.$emit("feedback", a), ["stop"])
|
|
932
|
-
}, null, 8, [
|
|
933
|
-
"icon",
|
|
934
|
-
"title",
|
|
935
|
-
"aria-label",
|
|
936
|
-
"onClick"
|
|
937
|
-
])) : O("", !0)]),
|
|
938
|
-
_: 2
|
|
939
|
-
}, 1024)
|
|
940
|
-
]),
|
|
941
|
-
_: 2
|
|
942
|
-
}, 1024),
|
|
943
|
-
!e.showMessageDateTime && a.metadata?.createdAt && a.metadata?.completedAt ? (F(), k("div", Bt, [A("time", {
|
|
944
|
-
datetime: new Date(a.metadata.createdAt).toISOString(),
|
|
945
|
-
title: R(s)(new Date(a.metadata.createdAt), "date-time"),
|
|
946
|
-
class: "flex items-center gap-4 min-w-0"
|
|
947
|
-
}, [j(u, {
|
|
948
|
-
name: "ri:time-line",
|
|
949
|
-
class: "shrink-0"
|
|
950
|
-
}), A("span", Ht, L(Vn(a.metadata.createdAt)), 1)], 8, Vt), Hn(a) ? (F(), k("span", Ut, [j(u, {
|
|
951
|
-
name: "ri:hourglass-line",
|
|
952
|
-
class: "shrink-0"
|
|
953
|
-
}), A("span", Wt, L(Hn(a)), 1)])) : O("", !0)])) : O("", !0),
|
|
954
|
-
e.showMessageNumber ? (F(), k("span", {
|
|
955
|
-
key: 1,
|
|
956
|
-
title: R(i)("label.messageNumber", { n: zn.value[v] }),
|
|
957
|
-
class: "text-12 text-word-3 tabular-nums"
|
|
958
|
-
}, " #" + L(zn.value[v]), 9, Gt)) : O("", !0),
|
|
959
|
-
e.showMessageTokensCount && a.metadata?.totalTokens ? (F(), k("span", Kt, [j(u, {
|
|
960
|
-
name: "ri:ai-generate-2-line",
|
|
961
|
-
class: "shrink-0"
|
|
962
|
-
}), A("span", qt, L(R(c)(a.metadata.totalTokens, "integer")) + " " + L(R(i)("label.tokens")), 1)])) : O("", !0),
|
|
963
|
-
e.showMessageDateTime && a.metadata?.createdAt ? (F(), k("time", {
|
|
964
|
-
key: 3,
|
|
965
|
-
datetime: new Date(a.metadata?.createdAt).toISOString(),
|
|
966
|
-
class: "flex items-center gap-4 text-12 text-word-3"
|
|
967
|
-
}, [j(u, {
|
|
968
|
-
name: "ri:time-line",
|
|
969
|
-
class: "shrink-0"
|
|
970
|
-
}), A("span", Yt, L(R(s)(new Date(a.metadata?.createdAt), "date-time")), 1)], 8, Jt)) : O("", !0),
|
|
971
|
-
e.showMessageDateTime && a?.metadata?.completedAt && a?.metadata?.createdAt ? (F(), k("div", Xt, [j(u, {
|
|
972
|
-
name: "ri:hourglass-line",
|
|
973
|
-
class: "shrink-0"
|
|
974
|
-
}), j(Te, {
|
|
975
|
-
class: "truncate",
|
|
976
|
-
date: a.metadata?.createdAt,
|
|
977
|
-
"end-date": a.metadata?.completedAt
|
|
978
|
-
}, null, 8, ["date", "end-date"])])) : O("", !0)
|
|
979
|
-
])) : O("", !0)]),
|
|
980
|
-
_: 2
|
|
981
|
-
}, 1024),
|
|
982
|
-
j(T, { mode: "out-in" }, {
|
|
983
|
-
default: B(() => [a.id === e.feedbackMessageId ? (F(), D(pe, {
|
|
984
|
-
key: 0,
|
|
985
|
-
ref_for: !0,
|
|
986
|
-
ref_key: "feedbackMessageEl",
|
|
987
|
-
ref: Un,
|
|
988
|
-
loading: e.feedbackLoading,
|
|
989
|
-
submitted: e.feedbackSubmitted,
|
|
990
|
-
error: e.feedbackError,
|
|
991
|
-
onSubmit: n[2] ||= (e) => t.$emit("feedback-submit", e),
|
|
992
|
-
onClose: n[3] ||= (e) => t.$emit("feedback-close")
|
|
993
|
-
}, null, 8, [
|
|
994
|
-
"loading",
|
|
995
|
-
"submitted",
|
|
996
|
-
"error"
|
|
997
|
-
])) : O("", !0)]),
|
|
998
|
-
_: 2
|
|
999
|
-
}, 1024)
|
|
1000
|
-
], 6)) : O("", !0)
|
|
1001
|
-
], 64))), 128)),
|
|
1002
|
-
j(T, {
|
|
1003
|
-
appear: "",
|
|
1004
|
-
name: "pk-chatbot-part",
|
|
1005
|
-
onLeave: gn
|
|
1006
|
-
}, {
|
|
1007
|
-
default: B(() => [mn.value ? (F(), k("div", {
|
|
1008
|
-
key: 0,
|
|
1009
|
-
class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
|
|
1010
|
-
style: Re({ minHeight: hn.value ? `${G.value}px` : void 0 })
|
|
1011
|
-
}, [A("div", Zt, [A("div", Qt, [j(u, {
|
|
1012
|
-
name: "loading-loop",
|
|
1013
|
-
class: "shrink-0"
|
|
1014
|
-
}), A("span", $t, L(R(i)("label.answeringOnTheCall")), 1)])])], 4)) : O("", !0)]),
|
|
1015
|
-
_: 1
|
|
1016
|
-
}),
|
|
1017
|
-
j(T, {
|
|
1018
|
-
appear: "",
|
|
1019
|
-
name: "pk-chatbot-part"
|
|
1020
|
-
}, {
|
|
1021
|
-
default: B(() => [En.value ? (F(), k("div", en, [j(ft, {
|
|
1022
|
-
question: e.hostConfirmation?.question ?? R(i)("toolApproval.prompt"),
|
|
1023
|
-
details: e.hostConfirmation?.details,
|
|
1024
|
-
unchanged: e.hostConfirmation?.unchanged,
|
|
1025
|
-
onRespond: n[4] ||= (e) => r("host-confirm-respond", e)
|
|
1026
|
-
}, null, 8, [
|
|
1027
|
-
"question",
|
|
1028
|
-
"details",
|
|
1029
|
-
"unchanged"
|
|
1030
|
-
])])) : O("", !0)]),
|
|
1031
|
-
_: 1
|
|
1032
|
-
}),
|
|
1033
|
-
j(T, {
|
|
1034
|
-
appear: "",
|
|
1035
|
-
name: "pk-chatbot-part"
|
|
1036
|
-
}, {
|
|
1037
|
-
default: B(() => [pn.value ? (F(), D(fe, {
|
|
1038
|
-
key: 0,
|
|
1039
|
-
error: e.error,
|
|
1040
|
-
onRetry: n[5] ||= (e) => t.$emit("auto-retry"),
|
|
1041
|
-
onReset: n[6] ||= (e) => t.$emit("reset-chat")
|
|
1042
|
-
}, null, 8, ["error"])) : O("", !0)]),
|
|
1043
|
-
_: 1
|
|
1044
|
-
}),
|
|
1045
|
-
un.value?.role === "user" && !hn.value || pn.value ? (F(), k("div", {
|
|
1046
|
-
key: 0,
|
|
1047
|
-
class: "pk-chatbot-messages__spacer",
|
|
1048
|
-
style: Re({ minHeight: `${G.value}px` })
|
|
1049
|
-
}, null, 4)) : O("", !0)
|
|
1050
|
-
], 512),
|
|
1051
|
-
j(T, { name: "pk-chatbot-messages-fab" }, {
|
|
1052
|
-
default: B(() => [e.showScrollToBottom && (R(Xe) || !R(Ze)) ? (F(), k("button", {
|
|
1053
|
-
key: 0,
|
|
1054
|
-
type: "button",
|
|
1055
|
-
class: "pk-chatbot-messages__scroll-to-bottom",
|
|
1056
|
-
title: R(i)("action.scrollToBottom"),
|
|
1057
|
-
"aria-label": R(i)("action.scrollToBottom"),
|
|
1058
|
-
onClick: Qe
|
|
1059
|
-
}, [j(u, { name: "ri:arrow-down-line" })], 8, tn)) : O("", !0)]),
|
|
1060
|
-
_: 1
|
|
1061
|
-
})
|
|
1062
|
-
], 46, _t);
|
|
1063
|
-
};
|
|
1064
|
-
}
|
|
1065
|
-
});
|
|
1066
|
-
export { nn as t };
|
|
1067
|
-
|
|
1068
|
-
//# sourceMappingURL=PkChatbotMessages-15R8RxAq.js.map
|